From: marco_giraldi
Date: Fri, 10 Jan 2020 13:57:25 +0000 (+0100)
Subject: Built motion from commit (unavailable).|2.4.1
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png//%27?a=commitdiff_plain;h=7d564303e29376fabb409aaeb5cde4ecd7fe22c8;p=motion2.git
Built motion from commit (unavailable).|2.4.1
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 67de759..45ed5a9 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2020-01-10T13:38:36.889Z",
+ "time": "2020-01-10T13:51:43.259Z",
"url": "http://apidocjs.com",
"version": "0.19.1"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 5019747..e722476 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2020-01-10T13:38:36.889Z",
+ "time": "2020-01-10T13:51:43.259Z",
"url": "http://apidocjs.com",
"version": "0.19.1"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index c3d01c8..83e5f7e 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 _0x9957=['integration','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]','TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'action':{'type':Sequelize[_0x7995('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7995('0x5'),_0x7995('0x6'),'motionbar',_0x7995('0x7'),_0x7995('0x8'),_0x7995('0x9'),_0x7995('0xa'),_0x7995('0xb')]],'msg':_0x7995('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x7995('0x4')](0x1000),'comment':_0x7995('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x7995('0xe')},'data3':{'type':Sequelize[_0x7995('0x4')](0x1000),'comment':_0x7995('0xf')},'data4':{'type':Sequelize[_0x7995('0x4')](0x1000)},'data5':{'type':Sequelize[_0x7995('0x4')](0x1000)},'data6':{'type':Sequelize[_0x7995('0x4')]},'data7':{'type':Sequelize[_0x7995('0x10')]}};
\ No newline at end of file
+var _0x008c=['TEXT','sequelize','exports','VIRTUAL','getDataValue','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)]','motionbar[NULL,NULL,WinAppArguments]'];(function(_0x1a1872,_0x509c68){var _0x46fe9a=function(_0x2af692){while(--_0x2af692){_0x1a1872['push'](_0x1a1872['shift']());}};_0x46fe9a(++_0x509c68);}(_0x008c,0x188));var _0xc008=function(_0x718f63,_0x13544f){_0x718f63=_0x718f63-0x0;var _0x3693f5=_0x008c[_0x718f63];return _0x3693f5;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')],'get':function(_0xae17af){return this[_0xc008('0x3')]('action');}},'action':{'type':Sequelize[_0xc008('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc008('0x5'),_0xc008('0x6'),_0xc008('0x7'),_0xc008('0x8'),_0xc008('0x9'),_0xc008('0xa'),_0xc008('0xb'),_0xc008('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xc008('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xc008('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0xc008('0x4')](0x1000),'comment':_0xc008('0xf')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xc008('0x10')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 47476ac..45620ce 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 _0xb80c=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','then','destroy','end','error','stack','name','update','Action','find','params','body'];(function(_0x105afa,_0x68b544){var _0x2c5e8d=function(_0x26c92a){while(--_0x26c92a){_0x105afa['push'](_0x105afa['shift']());}};_0x2c5e8d(++_0x68b544);}(_0xb80c,0xb0));var _0xcb80=function(_0x5c3dd6,_0x3759a5){_0x5c3dd6=_0x5c3dd6-0x0;var _0x5353fa=_0xb80c[_0x5c3dd6];return _0x5353fa;};'use strict';var pdf=require(_0xcb80('0x0'));var emlformat=require(_0xcb80('0x1'));var rimraf=require(_0xcb80('0x2'));var zipdir=require(_0xcb80('0x3'));var jsonpatch=require(_0xcb80('0x4'));var rp=require(_0xcb80('0x5'));var moment=require(_0xcb80('0x6'));var BPromise=require(_0xcb80('0x7'));var Mustache=require(_0xcb80('0x8'));var util=require('util');var path=require(_0xcb80('0x9'));var sox=require('sox');var csv=require(_0xcb80('0xa'));var ejs=require(_0xcb80('0xb'));var fs=require('fs');var _=require(_0xcb80('0xc'));var squel=require(_0xcb80('0xd'));var crypto=require('crypto');var jsforce=require(_0xcb80('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcb80('0xa'));var querystring=require(_0xcb80('0xf'));var Papa=require(_0xcb80('0x10'));var Redis=require(_0xcb80('0x11'));var authService=require(_0xcb80('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb80('0x13'))(_0xcb80('0x14'));var utils=require(_0xcb80('0x15'));var config=require('../../config/environment');var db=require(_0xcb80('0x16'))['db'];function respondWithStatusCode(_0x3d2135,_0x2e57ff){_0x2e57ff=_0x2e57ff||0xcc;return function(_0x32a674){if(_0x32a674){return _0x3d2135[_0xcb80('0x17')](_0x2e57ff);}return _0x3d2135[_0xcb80('0x18')](_0x2e57ff)['end']();};}function respondWithResult(_0x440bb2,_0x48f420){_0x48f420=_0x48f420||0xc8;return function(_0x5a140c){if(_0x5a140c){return _0x440bb2[_0xcb80('0x18')](_0x48f420)[_0xcb80('0x19')](_0x5a140c);}};}function respondWithFilteredResult(_0x22f526,_0x380ae3){return function(_0x386ea8){if(_0x386ea8){var _0x272fd6=_0x386ea8[_0xcb80('0x1a')],_0x3a9925=_0x380ae3['offset'],_0x5a0fba=_0x380ae3[_0xcb80('0x1b')]+_0x380ae3[_0xcb80('0x1c')],_0x3c79dd;if(_0x5a0fba>=_0x272fd6){_0x5a0fba=_0x272fd6;_0x3c79dd=0xc8;}else{_0x3c79dd=0xce;}_0x22f526['status'](_0x3c79dd);return _0x22f526[_0xcb80('0x1d')]('Content-Range',_0x3a9925+'-'+_0x5a0fba+'/'+_0x272fd6)['json'](_0x386ea8);}return null;};}function patchUpdates(_0x3b033c){return function(_0x502ca2){try{jsonpatch[_0xcb80('0x1e')](_0x502ca2,_0x3b033c,!![]);}catch(_0x496d33){return BPromise[_0xcb80('0x1f')](_0x496d33);}return _0x502ca2[_0xcb80('0x20')]();};}function saveUpdates(_0x3e1d94,_0x396128){return function(_0x448593){if(_0x448593){return _0x448593['update'](_0x3e1d94)[_0xcb80('0x21')](function(_0x5de840){return _0x5de840;});}return null;};}function removeEntity(_0x35fb6c,_0x494f0f){return function(_0xe713a1){if(_0xe713a1){return _0xe713a1[_0xcb80('0x22')]()['then'](function(){_0x35fb6c[_0xcb80('0x18')](0xcc)[_0xcb80('0x23')]();});}};}function handleEntityNotFound(_0xd902a9,_0x92112b){return function(_0x5a5c9d){if(!_0x5a5c9d){_0xd902a9[_0xcb80('0x17')](0x194);}return _0x5a5c9d;};}function handleError(_0x556bc6,_0x54d8de){_0x54d8de=_0x54d8de||0x1f4;return function(_0xffa1d8){logger[_0xcb80('0x24')](_0xffa1d8[_0xcb80('0x25')]);if(_0xffa1d8[_0xcb80('0x26')]){delete _0xffa1d8[_0xcb80('0x26')];}_0x556bc6['status'](_0x54d8de)['send'](_0xffa1d8);};}exports[_0xcb80('0x27')]=function(_0x3d6f7b,_0x53ad68){if(_0x3d6f7b['body']['id']){delete _0x3d6f7b['body']['id'];}return db[_0xcb80('0x28')][_0xcb80('0x29')]({'where':{'id':_0x3d6f7b[_0xcb80('0x2a')]['id']}})[_0xcb80('0x21')](handleEntityNotFound(_0x53ad68,null))[_0xcb80('0x21')](saveUpdates(_0x3d6f7b[_0xcb80('0x2b')],null))[_0xcb80('0x21')](respondWithResult(_0x53ad68,null))['catch'](handleError(_0x53ad68,null));};exports[_0xcb80('0x22')]=function(_0x1bf990,_0x538c12){return db[_0xcb80('0x28')][_0xcb80('0x29')]({'where':{'id':_0x1bf990[_0xcb80('0x2a')]['id']}})[_0xcb80('0x21')](handleEntityNotFound(_0x538c12,null))[_0xcb80('0x21')](removeEntity(_0x538c12,null))['catch'](handleError(_0x538c12,null));};
\ No newline at end of file
+var _0xa0f0=['limit','Content-Range','reject','save','update','then','stack','name','send','body','find','params','destroy','Action','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x308609,_0x41109e){var _0x44496c=function(_0x375999){while(--_0x375999){_0x308609['push'](_0x308609['shift']());}};_0x44496c(++_0x41109e);}(_0xa0f0,0x14a));var _0x0a0f=function(_0x4a6090,_0x422d4f){_0x4a6090=_0x4a6090-0x0;var _0x17b080=_0xa0f0[_0x4a6090];return _0x17b080;};'use strict';var pdf=require(_0x0a0f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0a0f('0x1'));var zipdir=require(_0x0a0f('0x2'));var jsonpatch=require(_0x0a0f('0x3'));var rp=require(_0x0a0f('0x4'));var moment=require(_0x0a0f('0x5'));var BPromise=require(_0x0a0f('0x6'));var Mustache=require(_0x0a0f('0x7'));var util=require('util');var path=require(_0x0a0f('0x8'));var sox=require(_0x0a0f('0x9'));var csv=require('to-csv');var ejs=require(_0x0a0f('0xa'));var fs=require('fs');var _=require(_0x0a0f('0xb'));var squel=require('squel');var crypto=require(_0x0a0f('0xc'));var jsforce=require(_0x0a0f('0xd'));var deskjs=require(_0x0a0f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0a0f('0xf'));var Papa=require(_0x0a0f('0x10'));var Redis=require(_0x0a0f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0a0f('0x12'));var hardwareService=require(_0x0a0f('0x13'));var logger=require(_0x0a0f('0x14'))(_0x0a0f('0x15'));var utils=require(_0x0a0f('0x16'));var config=require('../../config/environment');var db=require(_0x0a0f('0x17'))['db'];function respondWithStatusCode(_0x436ddb,_0x1ce38f){_0x1ce38f=_0x1ce38f||0xcc;return function(_0x352b60){if(_0x352b60){return _0x436ddb[_0x0a0f('0x18')](_0x1ce38f);}return _0x436ddb[_0x0a0f('0x19')](_0x1ce38f)[_0x0a0f('0x1a')]();};}function respondWithResult(_0x21d0d3,_0x39e774){_0x39e774=_0x39e774||0xc8;return function(_0x2879b2){if(_0x2879b2){return _0x21d0d3[_0x0a0f('0x19')](_0x39e774)[_0x0a0f('0x1b')](_0x2879b2);}};}function respondWithFilteredResult(_0x38f348,_0x515ab4){return function(_0x4e8380){if(_0x4e8380){var _0x102812=_0x4e8380[_0x0a0f('0x1c')],_0x423373=_0x515ab4[_0x0a0f('0x1d')],_0x421405=_0x515ab4['offset']+_0x515ab4[_0x0a0f('0x1e')],_0x1d1e78;if(_0x421405>=_0x102812){_0x421405=_0x102812;_0x1d1e78=0xc8;}else{_0x1d1e78=0xce;}_0x38f348[_0x0a0f('0x19')](_0x1d1e78);return _0x38f348['set'](_0x0a0f('0x1f'),_0x423373+'-'+_0x421405+'/'+_0x102812)[_0x0a0f('0x1b')](_0x4e8380);}return null;};}function patchUpdates(_0x2a3033){return function(_0x52a128){try{jsonpatch['apply'](_0x52a128,_0x2a3033,!![]);}catch(_0xe8bef6){return BPromise[_0x0a0f('0x20')](_0xe8bef6);}return _0x52a128[_0x0a0f('0x21')]();};}function saveUpdates(_0x58b6d5,_0x22b127){return function(_0x3e82ee){if(_0x3e82ee){return _0x3e82ee[_0x0a0f('0x22')](_0x58b6d5)[_0x0a0f('0x23')](function(_0x12f0e1){return _0x12f0e1;});}return null;};}function removeEntity(_0x4ea50b,_0x4e8687){return function(_0x549804){if(_0x549804){return _0x549804['destroy']()['then'](function(){_0x4ea50b['status'](0xcc)[_0x0a0f('0x1a')]();});}};}function handleEntityNotFound(_0x765880,_0x26a96a){return function(_0x229859){if(!_0x229859){_0x765880[_0x0a0f('0x18')](0x194);}return _0x229859;};}function handleError(_0x1541c0,_0x5b4677){_0x5b4677=_0x5b4677||0x1f4;return function(_0x462ed1){logger['error'](_0x462ed1[_0x0a0f('0x24')]);if(_0x462ed1[_0x0a0f('0x25')]){delete _0x462ed1[_0x0a0f('0x25')];}_0x1541c0['status'](_0x5b4677)[_0x0a0f('0x26')](_0x462ed1);};}exports['update']=function(_0x3dfec2,_0x49367f){if(_0x3dfec2['body']['id']){delete _0x3dfec2[_0x0a0f('0x27')]['id'];}return db['Action'][_0x0a0f('0x28')]({'where':{'id':_0x3dfec2[_0x0a0f('0x29')]['id']}})['then'](handleEntityNotFound(_0x49367f,null))['then'](saveUpdates(_0x3dfec2[_0x0a0f('0x27')],null))[_0x0a0f('0x23')](respondWithResult(_0x49367f,null))['catch'](handleError(_0x49367f,null));};exports[_0x0a0f('0x2a')]=function(_0x3e7359,_0x4003b4){return db[_0x0a0f('0x2b')][_0x0a0f('0x28')]({'where':{'id':_0x3e7359['params']['id']}})['then'](handleEntityNotFound(_0x4003b4,null))[_0x0a0f('0x23')](removeEntity(_0x4003b4,null))[_0x0a0f('0x2c')](handleError(_0x4003b4,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 4ec9a78..090eed2 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 _0x83ec=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','util'];(function(_0x2d783b,_0x1a295a){var _0x504d6a=function(_0x4ad063){while(--_0x4ad063){_0x2d783b['push'](_0x2d783b['shift']());}};_0x504d6a(++_0x1a295a);}(_0x83ec,0x19e));var _0xc83e=function(_0x38674e,_0xc01fb){_0x38674e=_0x38674e-0x0;var _0x4afa42=_0x83ec[_0x38674e];return _0x4afa42;};'use strict';var _=require(_0xc83e('0x0'));var util=require(_0xc83e('0x1'));var logger=require(_0xc83e('0x2'))(_0xc83e('0x3'));var moment=require('moment');var BPromise=require(_0xc83e('0x4'));var rp=require(_0xc83e('0x5'));var fs=require('fs');var path=require(_0xc83e('0x6'));var rimraf=require(_0xc83e('0x7'));var config=require(_0xc83e('0x8'));var attributes=require('./action.attributes');module[_0xc83e('0x9')]=function(_0xd34933,_0xee441e){return _0xd34933[_0xc83e('0xa')](_0xc83e('0xb'),attributes,{'tableName':_0xc83e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc43b=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./action.attributes','exports','define','Action','tools_actions'];(function(_0x23ba72,_0x1e4c2a){var _0x156eac=function(_0x37056b){while(--_0x37056b){_0x23ba72['push'](_0x23ba72['shift']());}};_0x156eac(++_0x1e4c2a);}(_0xc43b,0x1b0));var _0xbc43=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc43b[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xbc43('0x0'));var util=require(_0xbc43('0x1'));var logger=require(_0xbc43('0x2'))('api');var moment=require(_0xbc43('0x3'));var BPromise=require(_0xbc43('0x4'));var rp=require(_0xbc43('0x5'));var fs=require('fs');var path=require(_0xbc43('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbc43('0x7'));module[_0xbc43('0x8')]=function(_0x14d5cc,_0x2929a1){return _0x14d5cc[_0xbc43('0x9')](_0xbc43('0xa'),attributes,{'tableName':_0xbc43('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 706e4f4..fc3a343 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 _0xe9e8=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x160182,_0x4cf21a){var _0x1c1e78=function(_0x248245){while(--_0x248245){_0x160182['push'](_0x160182['shift']());}};_0x1c1e78(++_0x4cf21a);}(_0xe9e8,0x179));var _0x8e9e=function(_0x19df0b,_0x32de28){_0x19df0b=_0x19df0b-0x0;var _0x2b1cf4=_0xe9e8[_0x19df0b];return _0x2b1cf4;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require(_0x8e9e('0x2'));var BPromise=require(_0x8e9e('0x3'));var rs=require(_0x8e9e('0x4'));var fs=require('fs');var Redis=require(_0x8e9e('0x5'));var db=require(_0x8e9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x7'))('rpc');var config=require(_0x8e9e('0x8'));var jayson=require(_0x8e9e('0x9'));var client=jayson[_0x8e9e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dae01,_0x1613ff,_0x2e00d9){return new BPromise(function(_0x3afd97,_0x2745ef){return client[_0x8e9e('0xb')](_0x4dae01,_0x2e00d9)[_0x8e9e('0xc')](function(_0x50d9a1){logger['info'](_0x8e9e('0xd'),_0x1613ff,_0x8e9e('0xe'));logger[_0x8e9e('0xf')](_0x8e9e('0x10'),_0x1613ff,_0x8e9e('0xe'),JSON[_0x8e9e('0x11')](_0x50d9a1));if(_0x50d9a1[_0x8e9e('0x12')]){if(_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x13')]===0x1f4){logger[_0x8e9e('0x12')](_0x8e9e('0xd'),_0x1613ff,_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x14')]);return _0x2745ef(_0x50d9a1[_0x8e9e('0x12')]['message']);}logger[_0x8e9e('0x12')](_0x8e9e('0xd'),_0x1613ff,_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x14')]);return _0x3afd97(_0x50d9a1['error'][_0x8e9e('0x14')]);}else{logger['info'](_0x8e9e('0xd'),_0x1613ff,_0x8e9e('0xe'));_0x3afd97(_0x50d9a1[_0x8e9e('0x15')]['message']);}})['catch'](function(_0x20220a){logger[_0x8e9e('0x12')]('Action,\x20%s,\x20%s',_0x1613ff,_0x20220a);_0x2745ef(_0x20220a);});});}
\ No newline at end of file
+var _0x861c=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5b02a8,_0xef27bc){var _0x55f39d=function(_0x561d36){while(--_0x561d36){_0x5b02a8['push'](_0x5b02a8['shift']());}};_0x55f39d(++_0xef27bc);}(_0x861c,0xdb));var _0xc861=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x861c[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var moment=require(_0xc861('0x2'));var BPromise=require(_0xc861('0x3'));var rs=require(_0xc861('0x4'));var fs=require('fs');var Redis=require(_0xc861('0x5'));var db=require(_0xc861('0x6'))['db'];var utils=require(_0xc861('0x7'));var logger=require(_0xc861('0x8'))(_0xc861('0x9'));var config=require(_0xc861('0xa'));var jayson=require(_0xc861('0xb'));var client=jayson['client'][_0xc861('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xad001d,_0x1990b6,_0x36cb1f){return new BPromise(function(_0xb32e33,_0x293406){return client[_0xc861('0xd')](_0xad001d,_0x36cb1f)[_0xc861('0xe')](function(_0x241c77){logger[_0xc861('0xf')](_0xc861('0x10'),_0x1990b6,_0xc861('0x11'));logger[_0xc861('0x12')]('Action,\x20%s,\x20%s,\x20%s',_0x1990b6,_0xc861('0x11'),JSON[_0xc861('0x13')](_0x241c77));if(_0x241c77[_0xc861('0x14')]){if(_0x241c77[_0xc861('0x14')]['code']===0x1f4){logger[_0xc861('0x14')](_0xc861('0x10'),_0x1990b6,_0x241c77[_0xc861('0x14')][_0xc861('0x15')]);return _0x293406(_0x241c77['error']['message']);}logger[_0xc861('0x14')](_0xc861('0x10'),_0x1990b6,_0x241c77['error'][_0xc861('0x15')]);return _0xb32e33(_0x241c77[_0xc861('0x14')]['message']);}else{logger[_0xc861('0xf')](_0xc861('0x10'),_0x1990b6,_0xc861('0x11'));_0xb32e33(_0x241c77[_0xc861('0x16')][_0xc861('0x15')]);}})[_0xc861('0x17')](function(_0x5d6040){logger['error'](_0xc861('0x10'),_0x1990b6,_0x5d6040);_0x293406(_0x5d6040);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 0d94f98..e89611e 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 _0xd87e=['/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./action.controller','put','isAuthenticated'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0xd87e,0x1bf));var _0xed87=function(_0x2238f5,_0x3e0089){_0x2238f5=_0x2238f5-0x0;var _0x225e8b=_0xd87e[_0x2238f5];return _0x225e8b;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xed87('0x5'));var config=require('../../config/environment');var controller=require(_0xed87('0x6'));router[_0xed87('0x7')]('/:id',auth[_0xed87('0x8')](),controller['update']);router['delete'](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0xa')]);module[_0xed87('0xb')]=router;
\ No newline at end of file
+var _0xdca3=['delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x55ff6a,_0x385dff){var _0x58ea07=function(_0x47b91b){while(--_0x47b91b){_0x55ff6a['push'](_0x55ff6a['shift']());}};_0x58ea07(++_0x385dff);}(_0xdca3,0x64));var _0x3dca=function(_0x294484,_0x4e103d){_0x294484=_0x294484-0x0;var _0x5b86da=_0xdca3[_0x294484];return _0x5b86da;};'use strict';var multer=require(_0x3dca('0x0'));var util=require('util');var path=require(_0x3dca('0x1'));var timeout=require(_0x3dca('0x2'));var express=require(_0x3dca('0x3'));var router=express[_0x3dca('0x4')]();var auth=require(_0x3dca('0x5'));var interaction=require(_0x3dca('0x6'));var config=require(_0x3dca('0x7'));var controller=require(_0x3dca('0x8'));router[_0x3dca('0x9')](_0x3dca('0xa'),auth[_0x3dca('0xb')](),controller['update']);router[_0x3dca('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x3dca('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index ae6bdc4..e3febf0 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 _0x1b91=['exports','STRING','TEXT','sequelize'];(function(_0x1ca196,_0x574d6c){var _0xc3cc69=function(_0x4a251b){while(--_0x4a251b){_0x1ca196['push'](_0x1ca196['shift']());}};_0xc3cc69(++_0x574d6c);}(_0x1b91,0x18f));var _0x11b9=function(_0x708795,_0x4dbf2a){_0x708795=_0x708795-0x0;var _0x1507e1=_0x1b91[_0x708795];return _0x1507e1;};'use strict';var Sequelize=require(_0x11b9('0x0'));module[_0x11b9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x11b9('0x2')]},'parent':{'type':Sequelize[_0x11b9('0x2')]},'table':{'type':Sequelize[_0x11b9('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x11b9('0x3')]}};
\ No newline at end of file
+var _0xa95b=['TEXT','sequelize','exports','STRING'];(function(_0x329905,_0x13c144){var _0x3aa42=function(_0x2fac43){while(--_0x2fac43){_0x329905['push'](_0x329905['shift']());}};_0x3aa42(++_0x13c144);}(_0xa95b,0x1ad));var _0xba95=function(_0x36bbe7,_0x4e7403){_0x36bbe7=_0x36bbe7-0x0;var _0x17c57c=_0xa95b[_0x36bbe7];return _0x17c57c;};'use strict';var Sequelize=require(_0xba95('0x0'));module[_0xba95('0x1')]={'name':{'type':Sequelize[_0xba95('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xba95('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xba95('0x2')]},'conditions':{'type':Sequelize[_0xba95('0x3')]},'joins':{'type':Sequelize[_0xba95('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f6023c1..9e137b9 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 _0xd138=['startDate','info','Run\x20Query:','child_process','join','../../components/export/','../../files/reports','countTable','COUNT(*)','run','order','html-pdf','eml-format','rimraf','moment','util','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','key','VIRTUAL','field','merge','AnalyticCustomReport','include','findAll','catch','show','params','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','options','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','foreignKey','debug','toString','No\x20available\x20data','output','web','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x3b4ba9,_0x59557e){var _0x266220=function(_0x34cdaa){while(--_0x34cdaa){_0x3b4ba9['push'](_0x3b4ba9['shift']());}};_0x266220(++_0x59557e);}(_0xd138,0x1dc));var _0x8d13=function(_0x2489de,_0x181b41){_0x2489de=_0x2489de-0x0;var _0x34c7a2=_0xd138[_0x2489de];return _0x34c7a2;};'use strict';var pdf=require(_0x8d13('0x0'));var emlformat=require(_0x8d13('0x1'));var rimraf=require(_0x8d13('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8d13('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8d13('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8d13('0x5'));var crypto=require(_0x8d13('0x6'));var jsforce=require(_0x8d13('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x8d13('0x8'));var querystring=require('querystring');var Papa=require(_0x8d13('0x9'));var Redis=require(_0x8d13('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8d13('0xb'));var logger=require(_0x8d13('0xc'))(_0x8d13('0xd'));var utils=require('../../config/utils');var config=require(_0x8d13('0xe'));var db=require(_0x8d13('0xf'))['db'];function respondWithStatusCode(_0x21bf55,_0x5aa05e){_0x5aa05e=_0x5aa05e||0xcc;return function(_0x418b69){if(_0x418b69){return _0x21bf55[_0x8d13('0x10')](_0x5aa05e);}return _0x21bf55[_0x8d13('0x11')](_0x5aa05e)[_0x8d13('0x12')]();};}function respondWithResult(_0x3e8c49,_0x362385){_0x362385=_0x362385||0xc8;return function(_0xb43342){if(_0xb43342){return _0x3e8c49[_0x8d13('0x11')](_0x362385)[_0x8d13('0x13')](_0xb43342);}};}function respondWithFilteredResult(_0x4dcc50,_0x344340){return function(_0x545938){if(_0x545938){var _0x562ed9=_0x545938[_0x8d13('0x14')],_0xe697fe=_0x344340[_0x8d13('0x15')],_0x4b4dc9=_0x344340[_0x8d13('0x15')]+_0x344340[_0x8d13('0x16')],_0x1f247a;if(_0x4b4dc9>=_0x562ed9){_0x4b4dc9=_0x562ed9;_0x1f247a=0xc8;}else{_0x1f247a=0xce;}_0x4dcc50[_0x8d13('0x11')](_0x1f247a);return _0x4dcc50[_0x8d13('0x17')](_0x8d13('0x18'),_0xe697fe+'-'+_0x4b4dc9+'/'+_0x562ed9)[_0x8d13('0x13')](_0x545938);}return null;};}function patchUpdates(_0x2c36c4){return function(_0x17148d){try{jsonpatch[_0x8d13('0x19')](_0x17148d,_0x2c36c4,!![]);}catch(_0x212ef2){return BPromise[_0x8d13('0x1a')](_0x212ef2);}return _0x17148d[_0x8d13('0x1b')]();};}function saveUpdates(_0x4200ba,_0x393fff){return function(_0x1cb760){if(_0x1cb760){return _0x1cb760[_0x8d13('0x1c')](_0x4200ba)[_0x8d13('0x1d')](function(_0x3d2f97){return _0x3d2f97;});}return null;};}function removeEntity(_0x346c60,_0x2b6e28){return function(_0x535283){if(_0x535283){return _0x535283[_0x8d13('0x1e')]()[_0x8d13('0x1d')](function(){var _0x3c7524=_0x535283['get']({'plain':!![]});var _0x30fedc=_0x8d13('0x1f');return db[_0x8d13('0x20')][_0x8d13('0x1e')]({'where':{'type':_0x30fedc,'resourceId':_0x3c7524['id']}})[_0x8d13('0x1d')](function(){return _0x535283;});})[_0x8d13('0x1d')](function(){_0x346c60[_0x8d13('0x11')](0xcc)[_0x8d13('0x12')]();});}};}function handleEntityNotFound(_0x5c053f,_0x38f33c){return function(_0x1786b1){if(!_0x1786b1){_0x5c053f[_0x8d13('0x10')](0x194);}return _0x1786b1;};}function handleError(_0x1ed96b,_0x263375){_0x263375=_0x263375||0x1f4;return function(_0x35d5c8){logger[_0x8d13('0x21')](_0x35d5c8[_0x8d13('0x22')]);if(_0x35d5c8[_0x8d13('0x23')]){delete _0x35d5c8[_0x8d13('0x23')];}_0x1ed96b[_0x8d13('0x11')](_0x263375)[_0x8d13('0x24')](_0x35d5c8);};}exports['index']=function(_0x57fc61,_0x58e594){var _0x5f5b7b={},_0x34ed06={},_0x1f1604={'count':0x0,'rows':[]};var _0x39e8bf=db['AnalyticCustomReport'][_0x8d13('0x25')];_0x34ed06[_0x8d13('0x26')]=_[_0x8d13('0x27')](_0x39e8bf);_0x34ed06[_0x8d13('0x28')]=_[_0x8d13('0x27')](_0x57fc61[_0x8d13('0x28')]);_0x34ed06[_0x8d13('0x29')]=_[_0x8d13('0x2a')](_0x34ed06[_0x8d13('0x26')],_0x34ed06['query']);_0x5f5b7b[_0x8d13('0x2b')]=_[_0x8d13('0x2a')](_0x34ed06[_0x8d13('0x26')],qs[_0x8d13('0x2c')](_0x57fc61[_0x8d13('0x28')]['fields']));_0x5f5b7b[_0x8d13('0x2b')]=_0x5f5b7b[_0x8d13('0x2b')][_0x8d13('0x2d')]?_0x5f5b7b[_0x8d13('0x2b')]:_0x34ed06[_0x8d13('0x26')];if(!_0x57fc61[_0x8d13('0x28')][_0x8d13('0x2e')](_0x8d13('0x2f'))){_0x5f5b7b['limit']=qs[_0x8d13('0x16')](_0x57fc61[_0x8d13('0x28')][_0x8d13('0x16')]);_0x5f5b7b[_0x8d13('0x15')]=qs[_0x8d13('0x15')](_0x57fc61[_0x8d13('0x28')][_0x8d13('0x15')]);}_0x5f5b7b['order']=qs['sort'](_0x57fc61['query'][_0x8d13('0x30')]);_0x5f5b7b[_0x8d13('0x31')]=qs[_0x8d13('0x29')](_[_0x8d13('0x32')](_0x57fc61[_0x8d13('0x28')],_0x34ed06[_0x8d13('0x29')]));if(_0x57fc61[_0x8d13('0x28')][_0x8d13('0x33')]){_0x5f5b7b['where']=_['merge'](_0x5f5b7b[_0x8d13('0x31')],{'$or':_[_0x8d13('0x34')](_0x39e8bf,function(_0x4d155a){if(_0x4d155a['type'][_0x8d13('0x35')]!==_0x8d13('0x36')){var _0xccee5b={};_0xccee5b[_0x4d155a[_0x8d13('0x37')]]={'$like':'%'+_0x57fc61[_0x8d13('0x28')][_0x8d13('0x33')]+'%'};return _0xccee5b;}})});}_0x5f5b7b=_[_0x8d13('0x38')]({},_0x5f5b7b,_0x57fc61['options']);var _0xdb12c2={'where':_0x5f5b7b[_0x8d13('0x31')]};return db[_0x8d13('0x39')][_0x8d13('0x14')](_0xdb12c2)[_0x8d13('0x1d')](function(_0x38cf78){_0x1f1604['count']=_0x38cf78;if(_0x57fc61[_0x8d13('0x28')]['includeAll']){_0x5f5b7b[_0x8d13('0x3a')]=[{'all':!![]}];}return db[_0x8d13('0x39')][_0x8d13('0x3b')](_0x5f5b7b);})[_0x8d13('0x1d')](function(_0x202d85){_0x1f1604['rows']=_0x202d85;return _0x1f1604;})['then'](respondWithFilteredResult(_0x58e594,_0x5f5b7b))[_0x8d13('0x3c')](handleError(_0x58e594,null));};exports[_0x8d13('0x3d')]=function(_0x55812d,_0x458dfe){var _0x2ecc77={'raw':![],'where':{'id':_0x55812d[_0x8d13('0x3e')]['id']}},_0x5dbecc={};_0x5dbecc['model']=_[_0x8d13('0x27')](db[_0x8d13('0x39')][_0x8d13('0x25')]);_0x5dbecc['query']=_['keys'](_0x55812d[_0x8d13('0x28')]);_0x5dbecc['filters']=_[_0x8d13('0x2a')](_0x5dbecc[_0x8d13('0x26')],_0x5dbecc[_0x8d13('0x28')]);_0x2ecc77[_0x8d13('0x2b')]=_['intersection'](_0x5dbecc[_0x8d13('0x26')],qs[_0x8d13('0x2c')](_0x55812d[_0x8d13('0x28')][_0x8d13('0x2c')]));_0x2ecc77[_0x8d13('0x2b')]=_0x2ecc77[_0x8d13('0x2b')]['length']?_0x2ecc77[_0x8d13('0x2b')]:_0x5dbecc[_0x8d13('0x26')];if(_0x55812d[_0x8d13('0x28')]['includeAll']){_0x2ecc77[_0x8d13('0x3a')]=[{'all':!![]}];}_0x2ecc77=_[_0x8d13('0x38')]({},_0x2ecc77,_0x55812d['options']);return db[_0x8d13('0x39')]['find'](_0x2ecc77)['then'](handleEntityNotFound(_0x458dfe,null))[_0x8d13('0x1d')](respondWithResult(_0x458dfe,null))[_0x8d13('0x3c')](handleError(_0x458dfe,null));};exports[_0x8d13('0x3f')]=function(_0x2cd91b,_0x277cf7){return db[_0x8d13('0x39')][_0x8d13('0x3f')](_0x2cd91b[_0x8d13('0x40')],{})['then'](function(_0x5cc1f5){var _0x30df88=_0x2cd91b['user'][_0x8d13('0x41')]({'plain':!![]});if(!_0x30df88)throw new Error(_0x8d13('0x42'));if(_0x30df88[_0x8d13('0x43')]===_0x8d13('0x44')){var _0x9b5131=_0x5cc1f5[_0x8d13('0x41')]({'plain':!![]});var _0x234baa=_0x8d13('0x45');return db['UserProfileSection'][_0x8d13('0x46')]({'where':{'name':_0x234baa,'userProfileId':_0x30df88[_0x8d13('0x47')]},'raw':!![]})[_0x8d13('0x1d')](function(_0x3e31ea){if(_0x3e31ea&&_0x3e31ea['autoAssociation']===0x0){return db[_0x8d13('0x20')][_0x8d13('0x3f')]({'name':_0x9b5131['name'],'resourceId':_0x9b5131['id'],'type':_0x8d13('0x1f'),'sectionId':_0x3e31ea['id']},{})['then'](function(){return _0x5cc1f5;});}else{return _0x5cc1f5;}})[_0x8d13('0x3c')](function(_0x29a41f){logger[_0x8d13('0x21')](_0x8d13('0x48'),_0x29a41f);throw _0x29a41f;});}return _0x5cc1f5;})[_0x8d13('0x1d')](respondWithResult(_0x277cf7,0xc9))['catch'](handleError(_0x277cf7,null));};exports[_0x8d13('0x1c')]=function(_0x2ab460,_0x20514a){if(_0x2ab460[_0x8d13('0x40')]['id']){delete _0x2ab460['body']['id'];}return db[_0x8d13('0x39')][_0x8d13('0x46')]({'where':{'id':_0x2ab460['params']['id']}})['then'](handleEntityNotFound(_0x20514a,null))['then'](saveUpdates(_0x2ab460[_0x8d13('0x40')],null))[_0x8d13('0x1d')](respondWithResult(_0x20514a,null))['catch'](handleError(_0x20514a,null));};exports[_0x8d13('0x1e')]=function(_0x4e755b,_0x2f518e){return db['AnalyticCustomReport'][_0x8d13('0x46')]({'where':{'id':_0x4e755b[_0x8d13('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2f518e,null))['then'](removeEntity(_0x2f518e,null))['catch'](handleError(_0x2f518e,null));};exports[_0x8d13('0x49')]=function(_0x52b7cc,_0x3fa7b4){var _0x167ab2=0xa;var _0x766eb3=['join',_0x8d13('0x4a'),'right_join',_0x8d13('0x4b')];var _0x1577e5={'SUM':_0x8d13('0x4c'),'COUNT':_0x8d13('0x4d'),'COUNT DISTINCT':_0x8d13('0x4e'),'MAX':_0x8d13('0x4f'),'MIN':_0x8d13('0x50'),'AVG':_0x8d13('0x51'),'GROUP_CONCAT':_0x8d13('0x52'),'GROUP_CONCAT ASC':_0x8d13('0x53'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xa6fcba={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8d13('0x54'),'HOUR':_0x8d13('0x55'),'ROUND':_0x8d13('0x56'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x355a18=function(_0x293087){return!_[_0x8d13('0x57')](['IS\x20NULL',_0x8d13('0x58'),_0x8d13('0x59'),_0x8d13('0x5a')],_0x293087);};var _0x447f6c=function(_0x280304){if(!_0x280304||!_0x280304['rules'][_0x8d13('0x2d')]){return'';}for(var _0x98c47='(',_0x54744b=0x0;_0x54744b<_0x280304[_0x8d13('0x5b')][_0x8d13('0x2d')];_0x54744b+=0x1){_0x54744b>0x0&&(_0x98c47+='\x20'+_0x280304[_0x8d13('0x5c')]+'\x20');_0x98c47+=_0x280304[_0x8d13('0x5b')][_0x54744b][_0x8d13('0x5d')]?_0x447f6c(_0x280304[_0x8d13('0x5b')][_0x54744b][_0x8d13('0x5d')]):_0x280304[_0x8d13('0x5b')][_0x54744b]['field']+'\x20'+_0x280304[_0x8d13('0x5b')][_0x54744b][_0x8d13('0x5e')]+(_0x355a18(_0x280304[_0x8d13('0x5b')][_0x54744b][_0x8d13('0x5e')])?'\x20'+_0x280304[_0x8d13('0x5b')][_0x54744b][_0x8d13('0x5f')]:'');}return _0x98c47+')';};var _0x4a6d41={'where':{'id':_0x52b7cc[_0x8d13('0x3e')]['id']}},_0x5c06a1,_0x47e034,_0xeb7b01,_0x518ab3,_0x39e59c;_0x4a6d41=_[_0x8d13('0x38')]({},_0x4a6d41,_0x52b7cc[_0x8d13('0x60')]);return db['AnalyticCustomReport'][_0x8d13('0x46')](_0x4a6d41)[_0x8d13('0x1d')](function(_0x520d36){if(_0x520d36){_0x5c06a1=_0x520d36;return _0x520d36[_0x8d13('0x61')]();}return null;})[_0x8d13('0x1d')](function(_0xfc6856){if(_0xfc6856){if(!_0xfc6856[_0x8d13('0x2d')]){throw new db[(_0x8d13('0x62'))][(_0x8d13('0x63'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x47e034=_0xfc6856;return db[_0x8d13('0x64')][_0x8d13('0x3b')]({'raw':!![]});}return null;})[_0x8d13('0x1d')](function(_0x56b322){if(_0x56b322){_0xeb7b01=_[_0x8d13('0x65')](_0x56b322,'id');var _0x5b2a18;var _0x553115=squel[_0x8d13('0x66')]();_0x553115[_0x8d13('0x67')](_0x5c06a1[_0x8d13('0x68')]);for(var _0x4853d6=0x0;_0x4853d6<_0x47e034[_0x8d13('0x2d')];_0x4853d6+=0x1){_0x5b2a18=_0x47e034[_0x4853d6]['MetricId']?_0xeb7b01[_0x47e034[_0x4853d6][_0x8d13('0x69')]][_0x8d13('0x6a')]:_0x47e034[_0x4853d6]['field'];_0x5b2a18=_0x47e034[_0x4853d6][_0x8d13('0x6b')]?_[_0x8d13('0x6c')](_0x1577e5[_0x47e034[_0x4853d6][_0x8d13('0x6b')]],'%s',_0x5b2a18):_0x5b2a18;_0x5b2a18=_0x47e034[_0x4853d6][_0x8d13('0x6d')]?_[_0x8d13('0x6c')](_0xa6fcba[_0x47e034[_0x4853d6][_0x8d13('0x6d')]],'%s',_0x5b2a18):_0x5b2a18;if(_0x47e034[_0x4853d6][_0x8d13('0x6e')]){_0x553115[_0x8d13('0x5d')](_0x5b2a18);}_0x47e034[_0x4853d6][_0x8d13('0x6f')]&&_0x553115['order'](_0x5b2a18,_0x47e034[_0x4853d6][_0x8d13('0x6f')]===_0x8d13('0x70')?![]:!![]);_0x553115[_0x8d13('0x37')](_0x5b2a18,_0x47e034[_0x4853d6][_0x8d13('0x71')]||_0x5b2a18);}if(_0x5c06a1[_0x8d13('0x72')]){_0x5c06a1[_0x8d13('0x72')]=JSON[_0x8d13('0x73')](_0x5c06a1[_0x8d13('0x72')]);for(var _0x3d9541=0x0;_0x3d9541<_0x5c06a1[_0x8d13('0x72')][_0x8d13('0x2d')];_0x3d9541+=0x1){if(_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x74')]&&_[_0x8d13('0x57')](_0x766eb3,_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x74')])&&_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x75')]&&_0x5c06a1['joins'][_0x3d9541][_0x8d13('0x76')]&&_0x5c06a1['joins'][_0x3d9541]['foreignKey']){_0x553115[_0x5c06a1['joins'][_0x3d9541][_0x8d13('0x74')]](_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x76')],null,util['format'](_0x8d13('0x77'),_0x5c06a1[_0x8d13('0x68')],_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x75')],_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x76')],_0x5c06a1[_0x8d13('0x72')][_0x3d9541]['foreignKey']));}}}if(_0x5c06a1['conditions']){_0x5c06a1['conditions']=JSON[_0x8d13('0x73')](_0x5c06a1[_0x8d13('0x78')]);_0x553115[_0x8d13('0x31')](_0x447f6c(_0x5c06a1[_0x8d13('0x78')][_0x8d13('0x5d')]));}_0x39e59c=_0x553115[_0x8d13('0x79')]();_0x553115['limit'](_0x167ab2);_0x553115[_0x8d13('0x15')](0x0);logger['debug'](_0x8d13('0x7a'),_0x553115['toString']());return db[_0x8d13('0x7b')]['query'](_0x553115['toString'](),{'type':db[_0x8d13('0x7b')][_0x8d13('0x7c')][_0x8d13('0x7d')]});}})[_0x8d13('0x1d')](respondWithResult(_0x3fa7b4,null))['catch'](handleError(_0x3fa7b4,null));};function runReport(_0x521749,_0x4fffc7,_0x3b7df8){var _0x5d2abb=_0x4fffc7['name'];var _0x373bff=0xa;var _0x2ae6a7=['join','left_join',_0x8d13('0x7e'),_0x8d13('0x4b')];var _0x70886b={'SUM':_0x8d13('0x4c'),'COUNT':_0x8d13('0x4d'),'COUNT DISTINCT':_0x8d13('0x4e'),'MAX':_0x8d13('0x4f'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x8d13('0x52'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8d13('0x7f')};var _0x1bca49={'SEC_TO_TIME':_0x8d13('0x80'),'DATE':_0x8d13('0x54'),'HOUR':_0x8d13('0x55'),'ROUND':_0x8d13('0x56'),'UNIX_TIMESTAMP':_0x8d13('0x81')};var _0x3e90e7=function(_0x3579e8){return!_['includes']([_0x8d13('0x82'),'IS\x20NOT\x20NULL',_0x8d13('0x59'),_0x8d13('0x5a')],_0x3579e8);};var _0x533850=function(_0x43722f){if(!_0x43722f||!_0x43722f[_0x8d13('0x5b')][_0x8d13('0x2d')]){return'';}for(var _0x451b68='(',_0x441f08=0x0;_0x441f08<_0x43722f[_0x8d13('0x5b')]['length'];_0x441f08+=0x1){_0x441f08>0x0&&(_0x451b68+='\x20'+_0x43722f[_0x8d13('0x5c')]+'\x20');_0x451b68+=_0x43722f['rules'][_0x441f08][_0x8d13('0x5d')]?_0x533850(_0x43722f[_0x8d13('0x5b')][_0x441f08][_0x8d13('0x5d')]):_0x43722f[_0x8d13('0x5b')][_0x441f08][_0x8d13('0x37')]+'\x20'+_0x43722f[_0x8d13('0x5b')][_0x441f08]['condition']+(_0x3e90e7(_0x43722f[_0x8d13('0x5b')][_0x441f08][_0x8d13('0x5e')])?'\x20'+_0x43722f[_0x8d13('0x5b')][_0x441f08]['value']:'');}return _0x451b68+')';};var _0x455d98={'where':{'id':_0x521749['id']}},_0x4a5992,_0x4c6e7b,_0x4d10e5,_0xa0eb24,_0x15996c;_0x455d98=_[_0x8d13('0x38')]({},_0x455d98,_0x3b7df8);return db[_0x8d13('0x39')][_0x8d13('0x46')](_0x455d98)['then'](function(_0x195fa7){if(_0x195fa7){_0x4a5992=_0x195fa7;return _0x195fa7[_0x8d13('0x61')]();}return null;})[_0x8d13('0x1d')](function(_0x7b5c7e){if(_0x7b5c7e){if(!_0x7b5c7e[_0x8d13('0x2d')]){throw new db[(_0x8d13('0x62'))]['ValidationErrorItem'](_0x8d13('0x83'),0x193);}_0x4c6e7b=_0x7b5c7e;return db[_0x8d13('0x64')][_0x8d13('0x3b')]({'raw':!![]});}return null;})[_0x8d13('0x1d')](function(_0x5c6f54){if(_0x5c6f54){_0x4d10e5=_[_0x8d13('0x65')](_0x5c6f54,'id');var _0x385d66;var _0x1fad58=squel[_0x8d13('0x66')]();_0x1fad58['from'](_0x4a5992[_0x8d13('0x68')]);for(var _0x159677=0x0;_0x159677<_0x4c6e7b['length'];_0x159677+=0x1){_0x385d66=_0x4c6e7b[_0x159677][_0x8d13('0x69')]?_0x4d10e5[_0x4c6e7b[_0x159677]['MetricId']][_0x8d13('0x6a')]:_0x4c6e7b[_0x159677][_0x8d13('0x37')];_0x385d66=_0x4c6e7b[_0x159677][_0x8d13('0x6b')]?_[_0x8d13('0x6c')](_0x70886b[_0x4c6e7b[_0x159677][_0x8d13('0x6b')]],'%s',_0x385d66):_0x385d66;_0x385d66=_0x4c6e7b[_0x159677][_0x8d13('0x6d')]?_[_0x8d13('0x6c')](_0x1bca49[_0x4c6e7b[_0x159677][_0x8d13('0x6d')]],'%s',_0x385d66):_0x385d66;if(_0x4c6e7b[_0x159677][_0x8d13('0x6e')]){_0x1fad58[_0x8d13('0x5d')](_0x385d66);}_0x4c6e7b[_0x159677][_0x8d13('0x6f')]&&_0x1fad58['order'](_0x385d66,_0x4c6e7b[_0x159677][_0x8d13('0x6f')]===_0x8d13('0x70')?![]:!![]);_0x1fad58[_0x8d13('0x37')](_0x385d66,_0x4c6e7b[_0x159677][_0x8d13('0x71')]||_0x385d66);}if(_0x4a5992[_0x8d13('0x72')]){_0x4a5992['joins']=JSON[_0x8d13('0x73')](_0x4a5992[_0x8d13('0x72')]);for(var _0xf62966=0x0;_0xf62966<_0x4a5992[_0x8d13('0x72')]['length'];_0xf62966+=0x1){if(_0x4a5992['joins'][_0xf62966][_0x8d13('0x74')]&&_[_0x8d13('0x57')](_0x2ae6a7,_0x4a5992[_0x8d13('0x72')][_0xf62966][_0x8d13('0x74')])&&_0x4a5992['joins'][_0xf62966][_0x8d13('0x75')]&&_0x4a5992['joins'][_0xf62966][_0x8d13('0x76')]&&_0x4a5992[_0x8d13('0x72')][_0xf62966]['foreignKey']){_0x1fad58[_0x4a5992[_0x8d13('0x72')][_0xf62966]['type']](_0x4a5992[_0x8d13('0x72')][_0xf62966]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4a5992[_0x8d13('0x68')],_0x4a5992[_0x8d13('0x72')][_0xf62966]['parentKey'],_0x4a5992[_0x8d13('0x72')][_0xf62966][_0x8d13('0x76')],_0x4a5992['joins'][_0xf62966][_0x8d13('0x84')]));}}}if(_0x4a5992['conditions']){_0x4a5992[_0x8d13('0x78')]=JSON[_0x8d13('0x73')](_0x4a5992[_0x8d13('0x78')]);_0x1fad58['where'](_0x533850(_0x4a5992['conditions'][_0x8d13('0x5d')]));}_0x15996c=_0x1fad58['clone']();_0x1fad58['limit'](_0x373bff);_0x1fad58[_0x8d13('0x15')](0x0);logger[_0x8d13('0x85')](_0x8d13('0x7a'),_0x1fad58[_0x8d13('0x86')]());return db[_0x8d13('0x7b')][_0x8d13('0x28')](_0x1fad58[_0x8d13('0x86')](),{'type':db[_0x8d13('0x7b')][_0x8d13('0x7c')][_0x8d13('0x7d')]});}})[_0x8d13('0x1d')](function(_0x43b56a){if(!_0x43b56a[_0x8d13('0x2d')]){throw new db['Sequelize']['ValidationErrorItem'](_0x8d13('0x87'),0xcc);}if(_0x4fffc7[_0x8d13('0x88')]===_0x8d13('0x89')){return null;}var _0x34b8f9=_[_0x8d13('0x38')](_0x4fffc7,{'name':_0x4fffc7['fullPath']||_0x4fffc7[_0x8d13('0x23')]||_0x4a5992[_0x8d13('0x23')],'basename':_0x5d2abb,'savename':util[_0x8d13('0x6d')](_0x8d13('0x8a'),_0x4fffc7[_0x8d13('0x23')]||_0x4a5992[_0x8d13('0x23')],require(_0x8d13('0x8b'))['generate'](0x4),_0x4fffc7[_0x8d13('0x88')]||_0x8d13('0x8c')),'reportId':_0x4a5992['id'],'reportType':'custom'});return db[_0x8d13('0x8d')][_0x8d13('0x3f')](_0x34b8f9,{'raw':!![]});})['then'](function(_0x8d944){if(_0x4a5992[_0x8d13('0x68')]===_0x8d13('0x8e')){_0x15996c[_0x8d13('0x31')](_0x4a5992[_0x8d13('0x68')]+_0x8d13('0x8f'),_0x4fffc7[_0x8d13('0x90')],_0x4fffc7['endDate']);}else{_0x15996c['where'](_0x4a5992[_0x8d13('0x68')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4fffc7[_0x8d13('0x90')],_0x4fffc7['endDate']);}if(_0x8d944){logger[_0x8d13('0x91')](_0x8d13('0x92'),_0x15996c[_0x8d13('0x86')]());require(_0x8d13('0x93'))['fork'](path[_0x8d13('0x94')](__dirname,_0x8d13('0x95'),_0x8d944[_0x8d13('0x88')]),[_0x8d944['id'],_0x15996c['toString'](),path[_0x8d13('0x94')](__dirname,_0x8d13('0x96'),_0x8d944['savename']),_0x5d2abb]);return _0x8d944;}else{var _0x5d8e35=squel[_0x8d13('0x66')]();_0x5d8e35[_0x8d13('0x67')]('('+_0x15996c[_0x8d13('0x86')]()+')',_0x8d13('0x97'));_0x5d8e35['field'](_0x8d13('0x98'),_0x8d13('0x14'));_0x15996c[_0x8d13('0x16')](_0x4fffc7[_0x8d13('0x16')]||_0x373bff);_0x15996c[_0x8d13('0x15')](_0x4fffc7[_0x8d13('0x15')]||0x0);return db[_0x8d13('0x7b')]['query'](_0x5d8e35[_0x8d13('0x86')](),{'type':db[_0x8d13('0x7b')][_0x8d13('0x7c')]['SELECT']})[_0x8d13('0x1d')](function(_0x43f795){if(!_0x43f795['length']){_0xa0eb24=0x0;}else{_0xa0eb24=_0x43f795[0x0][_0x8d13('0x14')]||0x0;}return db[_0x8d13('0x7b')][_0x8d13('0x28')](_0x15996c[_0x8d13('0x86')](),{'type':db[_0x8d13('0x7b')][_0x8d13('0x7c')][_0x8d13('0x7d')]});})[_0x8d13('0x1d')](function(_0x5aa381){return{'rows':_0x5aa381||[],'count':_0xa0eb24};});}});}exports[_0x8d13('0x99')]=function(_0x4da895,_0x3aedbd){return runReport(_0x4da895[_0x8d13('0x3e')],_0x4da895[_0x8d13('0x28')],_0x4da895['options'])['then'](respondWithResult(_0x3aedbd,null))[_0x8d13('0x3c')](handleError(_0x3aedbd,null));};exports['runReport']=runReport;exports[_0x8d13('0x28')]=function(_0x41a5fa,_0xa2c8e3){var _0x5edc34=0xa;var _0xa68281=['join',_0x8d13('0x4a'),'right_join',_0x8d13('0x4b')];var _0xab5f5b={'SUM':_0x8d13('0x4c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8d13('0x4f'),'MIN':_0x8d13('0x50'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8d13('0x52'),'GROUP_CONCAT ASC':_0x8d13('0x53'),'GROUP_CONCAT DESC':_0x8d13('0x7f')};var _0x102aec={'SEC_TO_TIME':_0x8d13('0x80'),'DATE':_0x8d13('0x54'),'HOUR':_0x8d13('0x55'),'ROUND':_0x8d13('0x56'),'UNIX_TIMESTAMP':_0x8d13('0x81')};var _0x332a44=function(_0x4d5bc1){return!_[_0x8d13('0x57')](['IS\x20NULL',_0x8d13('0x58'),_0x8d13('0x59'),_0x8d13('0x5a')],_0x4d5bc1);};var _0x56708c=function(_0x11273f){if(!_0x11273f||!_0x11273f[_0x8d13('0x5b')][_0x8d13('0x2d')]){return'';}for(var _0x1bf20c='(',_0x2c7322=0x0;_0x2c7322<_0x11273f['rules'][_0x8d13('0x2d')];_0x2c7322+=0x1){_0x2c7322>0x0&&(_0x1bf20c+='\x20'+_0x11273f['operator']+'\x20');_0x1bf20c+=_0x11273f['rules'][_0x2c7322][_0x8d13('0x5d')]?_0x56708c(_0x11273f[_0x8d13('0x5b')][_0x2c7322]['group']):_0x11273f[_0x8d13('0x5b')][_0x2c7322]['field']+'\x20'+_0x11273f[_0x8d13('0x5b')][_0x2c7322][_0x8d13('0x5e')]+(_0x332a44(_0x11273f[_0x8d13('0x5b')][_0x2c7322][_0x8d13('0x5e')])?'\x20'+_0x11273f[_0x8d13('0x5b')][_0x2c7322]['value']:'');}return _0x1bf20c+')';};var _0x7b277a={'where':{'id':_0x41a5fa[_0x8d13('0x3e')]['id']}},_0x36e02c,_0x55f958,_0x548b17,_0x2c053d,_0x101c28;_0x7b277a=_[_0x8d13('0x38')]({},_0x7b277a,_0x41a5fa[_0x8d13('0x60')]);return db[_0x8d13('0x39')][_0x8d13('0x46')](_0x7b277a)[_0x8d13('0x1d')](function(_0x371fb9){if(_0x371fb9){_0x36e02c=_0x371fb9;return _0x371fb9[_0x8d13('0x61')]();}return null;})[_0x8d13('0x1d')](function(_0x17ce4c){if(_0x17ce4c){if(!_0x17ce4c[_0x8d13('0x2d')]){throw new db['Sequelize'][(_0x8d13('0x63'))](_0x8d13('0x83'),0x193);}_0x55f958=_0x17ce4c;return db[_0x8d13('0x64')][_0x8d13('0x3b')]({'raw':!![]});}return null;})[_0x8d13('0x1d')](function(_0x6faaf4){if(_0x6faaf4){_0x548b17=_[_0x8d13('0x65')](_0x6faaf4,'id');var _0x46a3e6;var _0x45d9f7=squel[_0x8d13('0x66')]();_0x45d9f7[_0x8d13('0x67')](_0x36e02c[_0x8d13('0x68')]);for(var _0x4461a6=0x0;_0x4461a6<_0x55f958[_0x8d13('0x2d')];_0x4461a6+=0x1){_0x46a3e6=_0x55f958[_0x4461a6][_0x8d13('0x69')]?_0x548b17[_0x55f958[_0x4461a6]['MetricId']][_0x8d13('0x6a')]:_0x55f958[_0x4461a6]['field'];_0x46a3e6=_0x55f958[_0x4461a6][_0x8d13('0x6b')]?_[_0x8d13('0x6c')](_0xab5f5b[_0x55f958[_0x4461a6][_0x8d13('0x6b')]],'%s',_0x46a3e6):_0x46a3e6;_0x46a3e6=_0x55f958[_0x4461a6][_0x8d13('0x6d')]?_[_0x8d13('0x6c')](_0x102aec[_0x55f958[_0x4461a6][_0x8d13('0x6d')]],'%s',_0x46a3e6):_0x46a3e6;if(_0x55f958[_0x4461a6]['groupBy']){_0x45d9f7[_0x8d13('0x5d')](_0x46a3e6);}_0x55f958[_0x4461a6][_0x8d13('0x6f')]&&_0x45d9f7[_0x8d13('0x9a')](_0x46a3e6,_0x55f958[_0x4461a6][_0x8d13('0x6f')]==='DESC'?![]:!![]);_0x45d9f7[_0x8d13('0x37')](_0x46a3e6,_0x55f958[_0x4461a6][_0x8d13('0x71')]||_0x46a3e6);}if(_0x36e02c[_0x8d13('0x72')]){_0x36e02c['joins']=JSON[_0x8d13('0x73')](_0x36e02c[_0x8d13('0x72')]);for(var _0x3491e0=0x0;_0x3491e0<_0x36e02c[_0x8d13('0x72')][_0x8d13('0x2d')];_0x3491e0+=0x1){if(_0x36e02c[_0x8d13('0x72')][_0x3491e0]['type']&&_[_0x8d13('0x57')](_0xa68281,_0x36e02c[_0x8d13('0x72')][_0x3491e0][_0x8d13('0x74')])&&_0x36e02c['joins'][_0x3491e0][_0x8d13('0x75')]&&_0x36e02c[_0x8d13('0x72')][_0x3491e0][_0x8d13('0x76')]&&_0x36e02c[_0x8d13('0x72')][_0x3491e0][_0x8d13('0x84')]){_0x45d9f7[_0x36e02c[_0x8d13('0x72')][_0x3491e0][_0x8d13('0x74')]](_0x36e02c[_0x8d13('0x72')][_0x3491e0]['foreignTable'],null,util[_0x8d13('0x6d')](_0x8d13('0x77'),_0x36e02c[_0x8d13('0x68')],_0x36e02c['joins'][_0x3491e0][_0x8d13('0x75')],_0x36e02c['joins'][_0x3491e0][_0x8d13('0x76')],_0x36e02c['joins'][_0x3491e0][_0x8d13('0x84')]));}}}if(_0x36e02c['conditions']){_0x36e02c[_0x8d13('0x78')]=JSON[_0x8d13('0x73')](_0x36e02c[_0x8d13('0x78')]);_0x45d9f7[_0x8d13('0x31')](_0x56708c(_0x36e02c[_0x8d13('0x78')][_0x8d13('0x5d')]));}_0x101c28=_0x45d9f7[_0x8d13('0x79')]();_0x45d9f7[_0x8d13('0x16')](_0x5edc34);_0x45d9f7[_0x8d13('0x15')](0x0);logger[_0x8d13('0x85')]('Limited\x20Query:',_0x45d9f7['toString']());return db[_0x8d13('0x7b')]['query'](_0x45d9f7['toString'](),{'type':db[_0x8d13('0x7b')][_0x8d13('0x7c')]['SELECT']});}})[_0x8d13('0x1d')](function(){return{'sql':_0x101c28['toString']()};})[_0x8d13('0x1d')](respondWithResult(_0xa2c8e3,null))['catch'](handleError(_0xa2c8e3,null));};
\ No newline at end of file
+var _0x278b=['orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','SELECT','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','value','ValidationErrorItem','groupBy','sequelize','No\x20available\x20data','output','web','randomstring','csv','AnalyticExtractedReport','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','fork','../../files/reports','savename','countTable','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','end','sendStatus','name','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','filter','where','merge','map','type','key','field','includeAll','include','AnalyticCustomReport','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','find','join','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','condition','options','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format'];(function(_0x539537,_0xf081b0){var _0x139518=function(_0x4688c4){while(--_0x4688c4){_0x539537['push'](_0x539537['shift']());}};_0x139518(++_0xf081b0);}(_0x278b,0xcb));var _0xb278=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x278b[_0x2bf141];return _0x48277b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb278('0x0'));var rimraf=require(_0xb278('0x1'));var zipdir=require(_0xb278('0x2'));var jsonpatch=require(_0xb278('0x3'));var rp=require(_0xb278('0x4'));var moment=require(_0xb278('0x5'));var BPromise=require(_0xb278('0x6'));var Mustache=require('mustache');var util=require(_0xb278('0x7'));var path=require(_0xb278('0x8'));var sox=require(_0xb278('0x9'));var csv=require(_0xb278('0xa'));var ejs=require(_0xb278('0xb'));var fs=require('fs');var _=require(_0xb278('0xc'));var squel=require(_0xb278('0xd'));var crypto=require(_0xb278('0xe'));var jsforce=require(_0xb278('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb278('0xa'));var querystring=require(_0xb278('0x10'));var Papa=require('papaparse');var Redis=require(_0xb278('0x11'));var authService=require(_0xb278('0x12'));var qs=require(_0xb278('0x13'));var hardwareService=require(_0xb278('0x14'));var logger=require(_0xb278('0x15'))(_0xb278('0x16'));var utils=require(_0xb278('0x17'));var config=require(_0xb278('0x18'));var db=require(_0xb278('0x19'))['db'];function respondWithStatusCode(_0x4ade31,_0x452fc3){_0x452fc3=_0x452fc3||0xcc;return function(_0x5ad1e1){if(_0x5ad1e1){return _0x4ade31['sendStatus'](_0x452fc3);}return _0x4ade31[_0xb278('0x1a')](_0x452fc3)['end']();};}function respondWithResult(_0x43a852,_0x5af503){_0x5af503=_0x5af503||0xc8;return function(_0x1e6950){if(_0x1e6950){return _0x43a852[_0xb278('0x1a')](_0x5af503)[_0xb278('0x1b')](_0x1e6950);}};}function respondWithFilteredResult(_0x43211b,_0x245674){return function(_0xe50f8a){if(_0xe50f8a){var _0x50fc63=_0xe50f8a[_0xb278('0x1c')],_0x8cd695=_0x245674[_0xb278('0x1d')],_0x570c0d=_0x245674[_0xb278('0x1d')]+_0x245674[_0xb278('0x1e')],_0x3bad40;if(_0x570c0d>=_0x50fc63){_0x570c0d=_0x50fc63;_0x3bad40=0xc8;}else{_0x3bad40=0xce;}_0x43211b['status'](_0x3bad40);return _0x43211b[_0xb278('0x1f')](_0xb278('0x20'),_0x8cd695+'-'+_0x570c0d+'/'+_0x50fc63)[_0xb278('0x1b')](_0xe50f8a);}return null;};}function patchUpdates(_0x112b62){return function(_0x857c39){try{jsonpatch[_0xb278('0x21')](_0x857c39,_0x112b62,!![]);}catch(_0x24307e){return BPromise['reject'](_0x24307e);}return _0x857c39[_0xb278('0x22')]();};}function saveUpdates(_0x56acc4,_0x410a68){return function(_0x977161){if(_0x977161){return _0x977161[_0xb278('0x23')](_0x56acc4)[_0xb278('0x24')](function(_0x5a1449){return _0x5a1449;});}return null;};}function removeEntity(_0x3baf9e,_0x4b795f){return function(_0x3db686){if(_0x3db686){return _0x3db686[_0xb278('0x25')]()['then'](function(){var _0x5257f7=_0x3db686[_0xb278('0x26')]({'plain':!![]});var _0x54f634=_0xb278('0x27');return db[_0xb278('0x28')][_0xb278('0x25')]({'where':{'type':_0x54f634,'resourceId':_0x5257f7['id']}})[_0xb278('0x24')](function(){return _0x3db686;});})[_0xb278('0x24')](function(){_0x3baf9e[_0xb278('0x1a')](0xcc)[_0xb278('0x29')]();});}};}function handleEntityNotFound(_0x9b069f,_0x4bb40d){return function(_0x27123f){if(!_0x27123f){_0x9b069f[_0xb278('0x2a')](0x194);}return _0x27123f;};}function handleError(_0x1d37df,_0x1a4cb0){_0x1a4cb0=_0x1a4cb0||0x1f4;return function(_0x2dd5f5){logger['error'](_0x2dd5f5['stack']);if(_0x2dd5f5[_0xb278('0x2b')]){delete _0x2dd5f5[_0xb278('0x2b')];}_0x1d37df['status'](_0x1a4cb0)['send'](_0x2dd5f5);};}exports[_0xb278('0x2c')]=function(_0x3c8c07,_0x2e5fdc){var _0x69a498={},_0x23ab48={},_0x171b53={'count':0x0,'rows':[]};var _0x48255f=db['AnalyticCustomReport'][_0xb278('0x2d')];_0x23ab48['model']=_[_0xb278('0x2e')](_0x48255f);_0x23ab48[_0xb278('0x2f')]=_[_0xb278('0x2e')](_0x3c8c07['query']);_0x23ab48[_0xb278('0x30')]=_[_0xb278('0x31')](_0x23ab48[_0xb278('0x32')],_0x23ab48[_0xb278('0x2f')]);_0x69a498[_0xb278('0x33')]=_['intersection'](_0x23ab48[_0xb278('0x32')],qs[_0xb278('0x34')](_0x3c8c07[_0xb278('0x2f')][_0xb278('0x34')]));_0x69a498[_0xb278('0x33')]=_0x69a498[_0xb278('0x33')]['length']?_0x69a498[_0xb278('0x33')]:_0x23ab48[_0xb278('0x32')];if(!_0x3c8c07[_0xb278('0x2f')]['hasOwnProperty'](_0xb278('0x35'))){_0x69a498['limit']=qs[_0xb278('0x1e')](_0x3c8c07[_0xb278('0x2f')][_0xb278('0x1e')]);_0x69a498[_0xb278('0x1d')]=qs[_0xb278('0x1d')](_0x3c8c07[_0xb278('0x2f')]['offset']);}_0x69a498[_0xb278('0x36')]=qs['sort'](_0x3c8c07[_0xb278('0x2f')][_0xb278('0x37')]);_0x69a498['where']=qs[_0xb278('0x30')](_[_0xb278('0x38')](_0x3c8c07[_0xb278('0x2f')],_0x23ab48[_0xb278('0x30')]));if(_0x3c8c07[_0xb278('0x2f')][_0xb278('0x39')]){_0x69a498[_0xb278('0x3a')]=_[_0xb278('0x3b')](_0x69a498['where'],{'$or':_[_0xb278('0x3c')](_0x48255f,function(_0x9e70ee){if(_0x9e70ee[_0xb278('0x3d')][_0xb278('0x3e')]!=='VIRTUAL'){var _0x1be697={};_0x1be697[_0x9e70ee[_0xb278('0x3f')]]={'$like':'%'+_0x3c8c07[_0xb278('0x2f')][_0xb278('0x39')]+'%'};return _0x1be697;}})});}_0x69a498=_[_0xb278('0x3b')]({},_0x69a498,_0x3c8c07['options']);var _0x51e653={'where':_0x69a498[_0xb278('0x3a')]};return db['AnalyticCustomReport'][_0xb278('0x1c')](_0x51e653)['then'](function(_0x1aba17){_0x171b53['count']=_0x1aba17;if(_0x3c8c07[_0xb278('0x2f')][_0xb278('0x40')]){_0x69a498[_0xb278('0x41')]=[{'all':!![]}];}return db[_0xb278('0x42')][_0xb278('0x43')](_0x69a498);})[_0xb278('0x24')](function(_0x4f02b2){_0x171b53[_0xb278('0x44')]=_0x4f02b2;return _0x171b53;})[_0xb278('0x24')](respondWithFilteredResult(_0x2e5fdc,_0x69a498))['catch'](handleError(_0x2e5fdc,null));};exports[_0xb278('0x45')]=function(_0x2f8f97,_0x170347){var _0x5301ca={'raw':![],'where':{'id':_0x2f8f97[_0xb278('0x46')]['id']}},_0x28126d={};_0x28126d['model']=_[_0xb278('0x2e')](db['AnalyticCustomReport']['rawAttributes']);_0x28126d[_0xb278('0x2f')]=_[_0xb278('0x2e')](_0x2f8f97[_0xb278('0x2f')]);_0x28126d['filters']=_[_0xb278('0x31')](_0x28126d[_0xb278('0x32')],_0x28126d[_0xb278('0x2f')]);_0x5301ca['attributes']=_[_0xb278('0x31')](_0x28126d[_0xb278('0x32')],qs[_0xb278('0x34')](_0x2f8f97[_0xb278('0x2f')][_0xb278('0x34')]));_0x5301ca['attributes']=_0x5301ca[_0xb278('0x33')]['length']?_0x5301ca['attributes']:_0x28126d[_0xb278('0x32')];if(_0x2f8f97[_0xb278('0x2f')][_0xb278('0x40')]){_0x5301ca[_0xb278('0x41')]=[{'all':!![]}];}_0x5301ca=_[_0xb278('0x3b')]({},_0x5301ca,_0x2f8f97['options']);return db[_0xb278('0x42')]['find'](_0x5301ca)['then'](handleEntityNotFound(_0x170347,null))['then'](respondWithResult(_0x170347,null))[_0xb278('0x47')](handleError(_0x170347,null));};exports['create']=function(_0x245232,_0x479c44){return db[_0xb278('0x42')][_0xb278('0x48')](_0x245232[_0xb278('0x49')],{})[_0xb278('0x24')](function(_0x19fa8e){var _0x140555=_0x245232[_0xb278('0x4a')]['get']({'plain':!![]});if(!_0x140555)throw new Error(_0xb278('0x4b'));if(_0x140555[_0xb278('0x4c')]===_0xb278('0x4a')){var _0x326317=_0x19fa8e['get']({'plain':!![]});var _0x5a3839=_0xb278('0x4d');return db[_0xb278('0x4e')]['find']({'where':{'name':_0x5a3839,'userProfileId':_0x140555[_0xb278('0x4f')]},'raw':!![]})[_0xb278('0x24')](function(_0x5751a5){if(_0x5751a5&&_0x5751a5[_0xb278('0x50')]===0x0){return db[_0xb278('0x28')]['create']({'name':_0x326317['name'],'resourceId':_0x326317['id'],'type':_0xb278('0x27'),'sectionId':_0x5751a5['id']},{})[_0xb278('0x24')](function(){return _0x19fa8e;});}else{return _0x19fa8e;}})[_0xb278('0x47')](function(_0x3b90f9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b90f9);throw _0x3b90f9;});}return _0x19fa8e;})[_0xb278('0x24')](respondWithResult(_0x479c44,0xc9))[_0xb278('0x47')](handleError(_0x479c44,null));};exports[_0xb278('0x23')]=function(_0x2993b5,_0x4f8dad){if(_0x2993b5[_0xb278('0x49')]['id']){delete _0x2993b5[_0xb278('0x49')]['id'];}return db[_0xb278('0x42')]['find']({'where':{'id':_0x2993b5[_0xb278('0x46')]['id']}})[_0xb278('0x24')](handleEntityNotFound(_0x4f8dad,null))[_0xb278('0x24')](saveUpdates(_0x2993b5[_0xb278('0x49')],null))[_0xb278('0x24')](respondWithResult(_0x4f8dad,null))[_0xb278('0x47')](handleError(_0x4f8dad,null));};exports[_0xb278('0x25')]=function(_0x23c02c,_0x30293f){return db[_0xb278('0x42')][_0xb278('0x51')]({'where':{'id':_0x23c02c['params']['id']}})[_0xb278('0x24')](handleEntityNotFound(_0x30293f,null))[_0xb278('0x24')](removeEntity(_0x30293f,null))['catch'](handleError(_0x30293f,null));};exports['preview']=function(_0x1c8e78,_0x2cc5ef){var _0x23b256=0xa;var _0xf9970c=[_0xb278('0x52'),_0xb278('0x53'),_0xb278('0x54'),_0xb278('0x55')];var _0x1886e6={'SUM':_0xb278('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb278('0x57'),'MIN':_0xb278('0x58'),'AVG':_0xb278('0x59'),'GROUP_CONCAT':_0xb278('0x5a'),'GROUP_CONCAT ASC':_0xb278('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x181b75={'SEC_TO_TIME':_0xb278('0x5c'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb278('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x39b915=function(_0xa70151){return!_[_0xb278('0x5e')]([_0xb278('0x5f'),_0xb278('0x60'),_0xb278('0x61'),_0xb278('0x62')],_0xa70151);};var _0x5a0790=function(_0x5a14d9){if(!_0x5a14d9||!_0x5a14d9[_0xb278('0x63')][_0xb278('0x64')]){return'';}for(var _0x40ece4='(',_0x563e3f=0x0;_0x563e3f<_0x5a14d9[_0xb278('0x63')][_0xb278('0x64')];_0x563e3f+=0x1){_0x563e3f>0x0&&(_0x40ece4+='\x20'+_0x5a14d9[_0xb278('0x65')]+'\x20');_0x40ece4+=_0x5a14d9[_0xb278('0x63')][_0x563e3f][_0xb278('0x66')]?_0x5a0790(_0x5a14d9[_0xb278('0x63')][_0x563e3f]['group']):_0x5a14d9[_0xb278('0x63')][_0x563e3f][_0xb278('0x3f')]+'\x20'+_0x5a14d9[_0xb278('0x63')][_0x563e3f][_0xb278('0x67')]+(_0x39b915(_0x5a14d9[_0xb278('0x63')][_0x563e3f][_0xb278('0x67')])?'\x20'+_0x5a14d9[_0xb278('0x63')][_0x563e3f]['value']:'');}return _0x40ece4+')';};var _0x2e3808={'where':{'id':_0x1c8e78[_0xb278('0x46')]['id']}},_0x33396b,_0x5b99ea,_0x166203,_0x485294,_0x5e1b81;_0x2e3808=_[_0xb278('0x3b')]({},_0x2e3808,_0x1c8e78[_0xb278('0x68')]);return db[_0xb278('0x42')][_0xb278('0x51')](_0x2e3808)[_0xb278('0x24')](function(_0x3d041a){if(_0x3d041a){_0x33396b=_0x3d041a;return _0x3d041a[_0xb278('0x69')]();}return null;})['then'](function(_0x181b09){if(_0x181b09){if(!_0x181b09[_0xb278('0x64')]){throw new db[(_0xb278('0x6a'))]['ValidationErrorItem'](_0xb278('0x6b'),0x193);}_0x5b99ea=_0x181b09;return db[_0xb278('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xb278('0x24')](function(_0x5440c6){if(_0x5440c6){_0x166203=_[_0xb278('0x6d')](_0x5440c6,'id');var _0x1ffd70;var _0x317db9=squel[_0xb278('0x6e')]();_0x317db9[_0xb278('0x6f')](_0x33396b['table']);for(var _0x13076d=0x0;_0x13076d<_0x5b99ea[_0xb278('0x64')];_0x13076d+=0x1){_0x1ffd70=_0x5b99ea[_0x13076d]['MetricId']?_0x166203[_0x5b99ea[_0x13076d][_0xb278('0x70')]][_0xb278('0x71')]:_0x5b99ea[_0x13076d][_0xb278('0x3f')];_0x1ffd70=_0x5b99ea[_0x13076d][_0xb278('0x72')]?_[_0xb278('0x73')](_0x1886e6[_0x5b99ea[_0x13076d]['function']],'%s',_0x1ffd70):_0x1ffd70;_0x1ffd70=_0x5b99ea[_0x13076d][_0xb278('0x74')]?_[_0xb278('0x73')](_0x181b75[_0x5b99ea[_0x13076d][_0xb278('0x74')]],'%s',_0x1ffd70):_0x1ffd70;if(_0x5b99ea[_0x13076d]['groupBy']){_0x317db9['group'](_0x1ffd70);}_0x5b99ea[_0x13076d][_0xb278('0x75')]&&_0x317db9['order'](_0x1ffd70,_0x5b99ea[_0x13076d][_0xb278('0x75')]===_0xb278('0x76')?![]:!![]);_0x317db9['field'](_0x1ffd70,_0x5b99ea[_0x13076d][_0xb278('0x77')]||_0x1ffd70);}if(_0x33396b['joins']){_0x33396b[_0xb278('0x78')]=JSON[_0xb278('0x79')](_0x33396b[_0xb278('0x78')]);for(var _0x544c6e=0x0;_0x544c6e<_0x33396b[_0xb278('0x78')][_0xb278('0x64')];_0x544c6e+=0x1){if(_0x33396b[_0xb278('0x78')][_0x544c6e][_0xb278('0x3d')]&&_[_0xb278('0x5e')](_0xf9970c,_0x33396b[_0xb278('0x78')][_0x544c6e][_0xb278('0x3d')])&&_0x33396b[_0xb278('0x78')][_0x544c6e][_0xb278('0x7a')]&&_0x33396b[_0xb278('0x78')][_0x544c6e][_0xb278('0x7b')]&&_0x33396b[_0xb278('0x78')][_0x544c6e]['foreignKey']){_0x317db9[_0x33396b['joins'][_0x544c6e]['type']](_0x33396b['joins'][_0x544c6e][_0xb278('0x7b')],null,util[_0xb278('0x74')](_0xb278('0x7c'),_0x33396b[_0xb278('0x7d')],_0x33396b[_0xb278('0x78')][_0x544c6e]['parentKey'],_0x33396b['joins'][_0x544c6e][_0xb278('0x7b')],_0x33396b['joins'][_0x544c6e][_0xb278('0x7e')]));}}}if(_0x33396b[_0xb278('0x7f')]){_0x33396b[_0xb278('0x7f')]=JSON[_0xb278('0x79')](_0x33396b[_0xb278('0x7f')]);_0x317db9[_0xb278('0x3a')](_0x5a0790(_0x33396b[_0xb278('0x7f')][_0xb278('0x66')]));}_0x5e1b81=_0x317db9[_0xb278('0x80')]();_0x317db9[_0xb278('0x1e')](_0x23b256);_0x317db9['offset'](0x0);logger[_0xb278('0x81')](_0xb278('0x82'),_0x317db9['toString']());return db['sequelize']['query'](_0x317db9[_0xb278('0x83')](),{'type':db['sequelize'][_0xb278('0x84')][_0xb278('0x85')]});}})[_0xb278('0x24')](respondWithResult(_0x2cc5ef,null))[_0xb278('0x47')](handleError(_0x2cc5ef,null));};function runReport(_0x1b2b01,_0xcf420a,_0x511d80){var _0x164160=_0xcf420a['name'];var _0x3d0c4e=0xa;var _0x45be99=[_0xb278('0x52'),_0xb278('0x53'),_0xb278('0x54'),_0xb278('0x55')];var _0x5e4fe0={'SUM':_0xb278('0x56'),'COUNT':_0xb278('0x86'),'COUNT DISTINCT':_0xb278('0x87'),'MAX':'MAX(%s)','MIN':_0xb278('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb278('0x5a'),'GROUP_CONCAT ASC':_0xb278('0x5b'),'GROUP_CONCAT DESC':_0xb278('0x88')};var _0x968af3={'SEC_TO_TIME':_0xb278('0x5c'),'DATE':_0xb278('0x89'),'HOUR':_0xb278('0x8a'),'ROUND':_0xb278('0x5d'),'UNIX_TIMESTAMP':_0xb278('0x8b')};var _0x4a5b4f=function(_0x1e79c4){return!_[_0xb278('0x5e')]([_0xb278('0x5f'),_0xb278('0x60'),_0xb278('0x61'),_0xb278('0x62')],_0x1e79c4);};var _0x12bd64=function(_0x3360cb){if(!_0x3360cb||!_0x3360cb[_0xb278('0x63')]['length']){return'';}for(var _0x331442='(',_0x4f3ebc=0x0;_0x4f3ebc<_0x3360cb[_0xb278('0x63')][_0xb278('0x64')];_0x4f3ebc+=0x1){_0x4f3ebc>0x0&&(_0x331442+='\x20'+_0x3360cb[_0xb278('0x65')]+'\x20');_0x331442+=_0x3360cb[_0xb278('0x63')][_0x4f3ebc][_0xb278('0x66')]?_0x12bd64(_0x3360cb[_0xb278('0x63')][_0x4f3ebc][_0xb278('0x66')]):_0x3360cb[_0xb278('0x63')][_0x4f3ebc]['field']+'\x20'+_0x3360cb['rules'][_0x4f3ebc][_0xb278('0x67')]+(_0x4a5b4f(_0x3360cb[_0xb278('0x63')][_0x4f3ebc]['condition'])?'\x20'+_0x3360cb[_0xb278('0x63')][_0x4f3ebc][_0xb278('0x8c')]:'');}return _0x331442+')';};var _0x213ba4={'where':{'id':_0x1b2b01['id']}},_0x49f54e,_0xc49657,_0x57281f,_0x4e4307,_0x9407dd;_0x213ba4=_[_0xb278('0x3b')]({},_0x213ba4,_0x511d80);return db['AnalyticCustomReport'][_0xb278('0x51')](_0x213ba4)[_0xb278('0x24')](function(_0x73fcb3){if(_0x73fcb3){_0x49f54e=_0x73fcb3;return _0x73fcb3[_0xb278('0x69')]();}return null;})[_0xb278('0x24')](function(_0x374503){if(_0x374503){if(!_0x374503[_0xb278('0x64')]){throw new db['Sequelize'][(_0xb278('0x8d'))](_0xb278('0x6b'),0x193);}_0xc49657=_0x374503;return db[_0xb278('0x6c')][_0xb278('0x43')]({'raw':!![]});}return null;})[_0xb278('0x24')](function(_0x499ec6){if(_0x499ec6){_0x57281f=_['keyBy'](_0x499ec6,'id');var _0x482360;var _0xa5f99e=squel[_0xb278('0x6e')]();_0xa5f99e[_0xb278('0x6f')](_0x49f54e[_0xb278('0x7d')]);for(var _0x43169e=0x0;_0x43169e<_0xc49657[_0xb278('0x64')];_0x43169e+=0x1){_0x482360=_0xc49657[_0x43169e][_0xb278('0x70')]?_0x57281f[_0xc49657[_0x43169e]['MetricId']][_0xb278('0x71')]:_0xc49657[_0x43169e][_0xb278('0x3f')];_0x482360=_0xc49657[_0x43169e][_0xb278('0x72')]?_[_0xb278('0x73')](_0x5e4fe0[_0xc49657[_0x43169e][_0xb278('0x72')]],'%s',_0x482360):_0x482360;_0x482360=_0xc49657[_0x43169e][_0xb278('0x74')]?_[_0xb278('0x73')](_0x968af3[_0xc49657[_0x43169e][_0xb278('0x74')]],'%s',_0x482360):_0x482360;if(_0xc49657[_0x43169e][_0xb278('0x8e')]){_0xa5f99e[_0xb278('0x66')](_0x482360);}_0xc49657[_0x43169e][_0xb278('0x75')]&&_0xa5f99e['order'](_0x482360,_0xc49657[_0x43169e][_0xb278('0x75')]===_0xb278('0x76')?![]:!![]);_0xa5f99e[_0xb278('0x3f')](_0x482360,_0xc49657[_0x43169e]['alias']||_0x482360);}if(_0x49f54e[_0xb278('0x78')]){_0x49f54e[_0xb278('0x78')]=JSON[_0xb278('0x79')](_0x49f54e[_0xb278('0x78')]);for(var _0x4900eb=0x0;_0x4900eb<_0x49f54e['joins'][_0xb278('0x64')];_0x4900eb+=0x1){if(_0x49f54e[_0xb278('0x78')][_0x4900eb][_0xb278('0x3d')]&&_[_0xb278('0x5e')](_0x45be99,_0x49f54e[_0xb278('0x78')][_0x4900eb][_0xb278('0x3d')])&&_0x49f54e[_0xb278('0x78')][_0x4900eb][_0xb278('0x7a')]&&_0x49f54e[_0xb278('0x78')][_0x4900eb][_0xb278('0x7b')]&&_0x49f54e[_0xb278('0x78')][_0x4900eb][_0xb278('0x7e')]){_0xa5f99e[_0x49f54e['joins'][_0x4900eb][_0xb278('0x3d')]](_0x49f54e[_0xb278('0x78')][_0x4900eb]['foreignTable'],null,util[_0xb278('0x74')](_0xb278('0x7c'),_0x49f54e[_0xb278('0x7d')],_0x49f54e[_0xb278('0x78')][_0x4900eb]['parentKey'],_0x49f54e['joins'][_0x4900eb][_0xb278('0x7b')],_0x49f54e['joins'][_0x4900eb][_0xb278('0x7e')]));}}}if(_0x49f54e[_0xb278('0x7f')]){_0x49f54e['conditions']=JSON[_0xb278('0x79')](_0x49f54e[_0xb278('0x7f')]);_0xa5f99e[_0xb278('0x3a')](_0x12bd64(_0x49f54e[_0xb278('0x7f')]['group']));}_0x9407dd=_0xa5f99e[_0xb278('0x80')]();_0xa5f99e[_0xb278('0x1e')](_0x3d0c4e);_0xa5f99e[_0xb278('0x1d')](0x0);logger[_0xb278('0x81')](_0xb278('0x82'),_0xa5f99e[_0xb278('0x83')]());return db[_0xb278('0x8f')]['query'](_0xa5f99e[_0xb278('0x83')](),{'type':db[_0xb278('0x8f')]['QueryTypes'][_0xb278('0x85')]});}})[_0xb278('0x24')](function(_0x37639a){if(!_0x37639a['length']){throw new db[(_0xb278('0x6a'))][(_0xb278('0x8d'))](_0xb278('0x90'),0xcc);}if(_0xcf420a[_0xb278('0x91')]===_0xb278('0x92')){return null;}var _0x23ceb5=_[_0xb278('0x3b')](_0xcf420a,{'name':_0xcf420a['fullPath']||_0xcf420a[_0xb278('0x2b')]||_0x49f54e[_0xb278('0x2b')],'basename':_0x164160,'savename':util['format']('%s-%s.%s',_0xcf420a[_0xb278('0x2b')]||_0x49f54e[_0xb278('0x2b')],require(_0xb278('0x93'))['generate'](0x4),_0xcf420a['output']||_0xb278('0x94')),'reportId':_0x49f54e['id'],'reportType':'custom'});return db[_0xb278('0x95')]['create'](_0x23ceb5,{'raw':!![]});})[_0xb278('0x24')](function(_0x1af1ec){if(_0x49f54e['table']==='cdr'){_0x9407dd[_0xb278('0x3a')](_0x49f54e[_0xb278('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xcf420a['startDate'],_0xcf420a[_0xb278('0x96')]);}else{_0x9407dd[_0xb278('0x3a')](_0x49f54e[_0xb278('0x7d')]+_0xb278('0x97'),_0xcf420a[_0xb278('0x98')],_0xcf420a[_0xb278('0x96')]);}if(_0x1af1ec){logger[_0xb278('0x99')]('Run\x20Query:',_0x9407dd[_0xb278('0x83')]());require(_0xb278('0x9a'))[_0xb278('0x9b')](path['join'](__dirname,'../../components/export/',_0x1af1ec[_0xb278('0x91')]),[_0x1af1ec['id'],_0x9407dd[_0xb278('0x83')](),path[_0xb278('0x52')](__dirname,_0xb278('0x9c'),_0x1af1ec[_0xb278('0x9d')]),_0x164160]);return _0x1af1ec;}else{var _0x4ed989=squel[_0xb278('0x6e')]();_0x4ed989['from']('('+_0x9407dd[_0xb278('0x83')]()+')',_0xb278('0x9e'));_0x4ed989['field']('COUNT(*)',_0xb278('0x1c'));_0x9407dd[_0xb278('0x1e')](_0xcf420a[_0xb278('0x1e')]||_0x3d0c4e);_0x9407dd[_0xb278('0x1d')](_0xcf420a['offset']||0x0);return db[_0xb278('0x8f')][_0xb278('0x2f')](_0x4ed989[_0xb278('0x83')](),{'type':db[_0xb278('0x8f')]['QueryTypes']['SELECT']})[_0xb278('0x24')](function(_0x16e167){if(!_0x16e167['length']){_0x4e4307=0x0;}else{_0x4e4307=_0x16e167[0x0][_0xb278('0x1c')]||0x0;}return db[_0xb278('0x8f')][_0xb278('0x2f')](_0x9407dd['toString'](),{'type':db[_0xb278('0x8f')][_0xb278('0x84')]['SELECT']});})['then'](function(_0x1f7a86){return{'rows':_0x1f7a86||[],'count':_0x4e4307};});}});}exports['run']=function(_0x4b6e34,_0x289620){return runReport(_0x4b6e34[_0xb278('0x46')],_0x4b6e34[_0xb278('0x2f')],_0x4b6e34[_0xb278('0x68')])[_0xb278('0x24')](respondWithResult(_0x289620,null))[_0xb278('0x47')](handleError(_0x289620,null));};exports[_0xb278('0x9f')]=runReport;exports[_0xb278('0x2f')]=function(_0x3e7968,_0x7feeb){var _0x14895e=0xa;var _0x1272d4=[_0xb278('0x52'),_0xb278('0x53'),_0xb278('0x54'),_0xb278('0x55')];var _0x47701f={'SUM':_0xb278('0x56'),'COUNT':_0xb278('0x86'),'COUNT DISTINCT':_0xb278('0x87'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xb278('0x59'),'GROUP_CONCAT':_0xb278('0x5a'),'GROUP_CONCAT ASC':_0xb278('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xa6f161={'SEC_TO_TIME':_0xb278('0x5c'),'DATE':_0xb278('0x89'),'HOUR':_0xb278('0x8a'),'ROUND':_0xb278('0x5d'),'UNIX_TIMESTAMP':_0xb278('0x8b')};var _0x1d58e0=function(_0x405ad4){return!_['includes'](['IS\x20NULL',_0xb278('0x60'),_0xb278('0x61'),'IS\x20NOT\x20EMPTY'],_0x405ad4);};var _0x32d297=function(_0x2c4ffe){if(!_0x2c4ffe||!_0x2c4ffe['rules'][_0xb278('0x64')]){return'';}for(var _0x407ce9='(',_0x34df3d=0x0;_0x34df3d<_0x2c4ffe[_0xb278('0x63')][_0xb278('0x64')];_0x34df3d+=0x1){_0x34df3d>0x0&&(_0x407ce9+='\x20'+_0x2c4ffe[_0xb278('0x65')]+'\x20');_0x407ce9+=_0x2c4ffe['rules'][_0x34df3d][_0xb278('0x66')]?_0x32d297(_0x2c4ffe[_0xb278('0x63')][_0x34df3d][_0xb278('0x66')]):_0x2c4ffe['rules'][_0x34df3d][_0xb278('0x3f')]+'\x20'+_0x2c4ffe[_0xb278('0x63')][_0x34df3d][_0xb278('0x67')]+(_0x1d58e0(_0x2c4ffe['rules'][_0x34df3d][_0xb278('0x67')])?'\x20'+_0x2c4ffe[_0xb278('0x63')][_0x34df3d][_0xb278('0x8c')]:'');}return _0x407ce9+')';};var _0x445e34={'where':{'id':_0x3e7968['params']['id']}},_0x1bb808,_0x4104a4,_0x439204,_0x3133a5,_0x318041;_0x445e34=_['merge']({},_0x445e34,_0x3e7968['options']);return db[_0xb278('0x42')][_0xb278('0x51')](_0x445e34)[_0xb278('0x24')](function(_0x41828b){if(_0x41828b){_0x1bb808=_0x41828b;return _0x41828b[_0xb278('0x69')]();}return null;})['then'](function(_0x505f48){if(_0x505f48){if(!_0x505f48[_0xb278('0x64')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4104a4=_0x505f48;return db[_0xb278('0x6c')][_0xb278('0x43')]({'raw':!![]});}return null;})[_0xb278('0x24')](function(_0x951f48){if(_0x951f48){_0x439204=_[_0xb278('0x6d')](_0x951f48,'id');var _0x141dc2;var _0x31dac6=squel[_0xb278('0x6e')]();_0x31dac6[_0xb278('0x6f')](_0x1bb808[_0xb278('0x7d')]);for(var _0x331640=0x0;_0x331640<_0x4104a4['length'];_0x331640+=0x1){_0x141dc2=_0x4104a4[_0x331640]['MetricId']?_0x439204[_0x4104a4[_0x331640][_0xb278('0x70')]]['metric']:_0x4104a4[_0x331640][_0xb278('0x3f')];_0x141dc2=_0x4104a4[_0x331640][_0xb278('0x72')]?_[_0xb278('0x73')](_0x47701f[_0x4104a4[_0x331640][_0xb278('0x72')]],'%s',_0x141dc2):_0x141dc2;_0x141dc2=_0x4104a4[_0x331640][_0xb278('0x74')]?_['replace'](_0xa6f161[_0x4104a4[_0x331640][_0xb278('0x74')]],'%s',_0x141dc2):_0x141dc2;if(_0x4104a4[_0x331640][_0xb278('0x8e')]){_0x31dac6[_0xb278('0x66')](_0x141dc2);}_0x4104a4[_0x331640]['orderBy']&&_0x31dac6[_0xb278('0x36')](_0x141dc2,_0x4104a4[_0x331640][_0xb278('0x75')]===_0xb278('0x76')?![]:!![]);_0x31dac6[_0xb278('0x3f')](_0x141dc2,_0x4104a4[_0x331640][_0xb278('0x77')]||_0x141dc2);}if(_0x1bb808[_0xb278('0x78')]){_0x1bb808[_0xb278('0x78')]=JSON['parse'](_0x1bb808[_0xb278('0x78')]);for(var _0x25adb2=0x0;_0x25adb2<_0x1bb808[_0xb278('0x78')]['length'];_0x25adb2+=0x1){if(_0x1bb808[_0xb278('0x78')][_0x25adb2][_0xb278('0x3d')]&&_['includes'](_0x1272d4,_0x1bb808[_0xb278('0x78')][_0x25adb2][_0xb278('0x3d')])&&_0x1bb808[_0xb278('0x78')][_0x25adb2][_0xb278('0x7a')]&&_0x1bb808[_0xb278('0x78')][_0x25adb2][_0xb278('0x7b')]&&_0x1bb808[_0xb278('0x78')][_0x25adb2]['foreignKey']){_0x31dac6[_0x1bb808[_0xb278('0x78')][_0x25adb2][_0xb278('0x3d')]](_0x1bb808[_0xb278('0x78')][_0x25adb2][_0xb278('0x7b')],null,util[_0xb278('0x74')](_0xb278('0x7c'),_0x1bb808[_0xb278('0x7d')],_0x1bb808['joins'][_0x25adb2][_0xb278('0x7a')],_0x1bb808[_0xb278('0x78')][_0x25adb2][_0xb278('0x7b')],_0x1bb808['joins'][_0x25adb2]['foreignKey']));}}}if(_0x1bb808[_0xb278('0x7f')]){_0x1bb808['conditions']=JSON['parse'](_0x1bb808[_0xb278('0x7f')]);_0x31dac6['where'](_0x32d297(_0x1bb808['conditions'][_0xb278('0x66')]));}_0x318041=_0x31dac6['clone']();_0x31dac6[_0xb278('0x1e')](_0x14895e);_0x31dac6[_0xb278('0x1d')](0x0);logger['debug'](_0xb278('0x82'),_0x31dac6['toString']());return db[_0xb278('0x8f')][_0xb278('0x2f')](_0x31dac6[_0xb278('0x83')](),{'type':db[_0xb278('0x8f')][_0xb278('0x84')][_0xb278('0x85')]});}})[_0xb278('0x24')](function(){return{'sql':_0x318041['toString']()};})[_0xb278('0x24')](respondWithResult(_0x7feeb,null))['catch'](handleError(_0x7feeb,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 6b8aa01..7c8b8cd 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 _0xcdd3=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1b71c6,_0x5ce7e4){var _0x493849=function(_0x199bd3){while(--_0x199bd3){_0x1b71c6['push'](_0x1b71c6['shift']());}};_0x493849(++_0x5ce7e4);}(_0xcdd3,0x124));var _0x3cdd=function(_0xa4ffee,_0x4f2da7){_0xa4ffee=_0xa4ffee-0x0;var _0x36e0a8=_0xcdd3[_0xa4ffee];return _0x36e0a8;};'use strict';var _=require(_0x3cdd('0x0'));var util=require(_0x3cdd('0x1'));var logger=require(_0x3cdd('0x2'))(_0x3cdd('0x3'));var moment=require(_0x3cdd('0x4'));var BPromise=require(_0x3cdd('0x5'));var rp=require(_0x3cdd('0x6'));var fs=require('fs');var path=require(_0x3cdd('0x7'));var rimraf=require(_0x3cdd('0x8'));var config=require(_0x3cdd('0x9'));var attributes=require(_0x3cdd('0xa'));module[_0x3cdd('0xb')]=function(_0x471540,_0x26763b){return _0x471540[_0x3cdd('0xc')](_0x3cdd('0xd'),attributes,{'tableName':_0x3cdd('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5eb6=['AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0x5eb6,0xf2));var _0x65eb=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5eb6[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x65eb('0x0'));var logger=require(_0x65eb('0x1'))(_0x65eb('0x2'));var moment=require('moment');var BPromise=require(_0x65eb('0x3'));var rp=require(_0x65eb('0x4'));var fs=require('fs');var path=require(_0x65eb('0x5'));var rimraf=require(_0x65eb('0x6'));var config=require(_0x65eb('0x7'));var attributes=require(_0x65eb('0x8'));module[_0x65eb('0x9')]=function(_0x27e539,_0x36d1f9){return _0x27e539['define'](_0x65eb('0xa'),attributes,{'tableName':_0x65eb('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 1bf2ba1..958f703 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 _0xa9e0=['http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xaf0dd7,_0x12a87a){var _0x5092bd=function(_0xc19214){while(--_0xc19214){_0xaf0dd7['push'](_0xaf0dd7['shift']());}};_0x5092bd(++_0x12a87a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x57f8c0,_0x136cf6){var _0x117f08=function(_0x426cd4){while(--_0x426cd4){_0x57f8c0['push'](_0x57f8c0['shift']());}};_0x117f08(++_0x136cf6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index a36050f..0fec572 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 _0xbbbc=['../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','post','put','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x602096,_0x37efbd){_0x602096=_0x602096-0x0;var _0x277084=_0xbbbc[_0x602096];return _0x277084;};'use strict';var multer=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var path=require(_0xcbbb('0x2'));var timeout=require(_0xcbbb('0x3'));var express=require(_0xcbbb('0x4'));var router=express[_0xcbbb('0x5')]();var auth=require(_0xcbbb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcbbb('0x7'));var controller=require(_0xcbbb('0x8'));router[_0xcbbb('0x9')]('/',auth[_0xcbbb('0xa')](),controller[_0xcbbb('0xb')]);router['get'](_0xcbbb('0xc'),auth[_0xcbbb('0xa')](),controller[_0xcbbb('0xd')]);router[_0xcbbb('0x9')](_0xcbbb('0xe'),auth[_0xcbbb('0xa')](),controller[_0xcbbb('0xf')]);router['get'](_0xcbbb('0x10'),auth['isAuthenticated'](),controller['run']);router[_0xcbbb('0x9')]('/:id/query',auth[_0xcbbb('0xa')](),controller['query']);router[_0xcbbb('0x11')]('/',auth[_0xcbbb('0xa')](),controller['create']);router[_0xcbbb('0x12')]('/:id',auth[_0xcbbb('0xa')](),controller['update']);router[_0xcbbb('0x13')](_0xcbbb('0xc'),auth[_0xcbbb('0xa')](),controller['destroy']);module[_0xcbbb('0x14')]=router;
\ No newline at end of file
+var _0x7916=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','preview','run','query','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','Router'];(function(_0x3a0f77,_0x39f605){var _0x54fd0c=function(_0x46208c){while(--_0x46208c){_0x3a0f77['push'](_0x3a0f77['shift']());}};_0x54fd0c(++_0x39f605);}(_0x7916,0x128));var _0x6791=function(_0xfb294e,_0x21f178){_0xfb294e=_0xfb294e-0x0;var _0x181a07=_0x7916[_0xfb294e];return _0x181a07;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var auth=require(_0x6791('0x4'));var interaction=require(_0x6791('0x5'));var config=require(_0x6791('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x6791('0x7')]('/',auth['isAuthenticated'](),controller[_0x6791('0x8')]);router[_0x6791('0x7')]('/:id',auth[_0x6791('0x9')](),controller['show']);router[_0x6791('0x7')]('/:id/preview',auth['isAuthenticated'](),controller[_0x6791('0xa')]);router[_0x6791('0x7')]('/:id/run',auth[_0x6791('0x9')](),controller[_0x6791('0xb')]);router[_0x6791('0x7')]('/:id/query',auth[_0x6791('0x9')](),controller[_0x6791('0xc')]);router[_0x6791('0xd')]('/',auth[_0x6791('0x9')](),controller[_0x6791('0xe')]);router[_0x6791('0xf')](_0x6791('0x10'),auth[_0x6791('0x9')](),controller[_0x6791('0x11')]);router[_0x6791('0x12')](_0x6791('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x6791('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 aa4f963..ccfefdf 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 _0xb34d=['exports','STRING','TEXT'];(function(_0x188762,_0x5d5da1){var _0x5c849b=function(_0x526396){while(--_0x526396){_0x188762['push'](_0x188762['shift']());}};_0x5c849b(++_0x5d5da1);}(_0xb34d,0x11d));var _0xdb34=function(_0x5cf274,_0x590c70){_0x5cf274=_0x5cf274-0x0;var _0x2c3569=_0xb34d[_0x5cf274];return _0x2c3569;};'use strict';var Sequelize=require('sequelize');module[_0xdb34('0x0')]={'name':{'type':Sequelize[_0xdb34('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xdb34('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xdb34('0x1')]},'conditions':{'type':Sequelize[_0xdb34('0x2')]},'joins':{'type':Sequelize[_0xdb34('0x2')]}};
\ No newline at end of file
+var _0x1804=['sequelize','STRING'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x1804,0x1b6));var _0x4180=function(_0xdb339f,_0x52d15e){_0xdb339f=_0xdb339f-0x0;var _0x120086=_0x1804[_0xdb339f];return _0x120086;};'use strict';var Sequelize=require(_0x4180('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x4180('0x1')]},'parent':{'type':Sequelize[_0x4180('0x1')]},'table':{'type':Sequelize[_0x4180('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 4cbd840..b3c8ec3 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 _0x14bd=['html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','name','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','map','key','VIRTUAL','field','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','error','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','metric','function','replace','format','groupBy','order','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','operator','value','ValidationErrorItem','AnalyticMetric','keyBy','foreignKey','fullPath','randomstring','generate','output','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL'];(function(_0x6489c6,_0x189231){var _0x2103f6=function(_0x4e9742){while(--_0x4e9742){_0x6489c6['push'](_0x6489c6['shift']());}};_0x2103f6(++_0x189231);}(_0x14bd,0x146));var _0xd14b=function(_0x4d95c4,_0x2248cb){_0x4d95c4=_0x4d95c4-0x0;var _0x4fe1bf=_0x14bd[_0x4d95c4];return _0x4fe1bf;};'use strict';var pdf=require(_0xd14b('0x0'));var emlformat=require(_0xd14b('0x1'));var rimraf=require(_0xd14b('0x2'));var zipdir=require(_0xd14b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd14b('0x4'));var moment=require(_0xd14b('0x5'));var BPromise=require(_0xd14b('0x6'));var Mustache=require('mustache');var util=require(_0xd14b('0x7'));var path=require('path');var sox=require(_0xd14b('0x8'));var csv=require(_0xd14b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd14b('0xa'));var crypto=require(_0xd14b('0xb'));var jsforce=require(_0xd14b('0xc'));var deskjs=require(_0xd14b('0xd'));var toCsv=require(_0xd14b('0x9'));var querystring=require(_0xd14b('0xe'));var Papa=require(_0xd14b('0xf'));var Redis=require(_0xd14b('0x10'));var authService=require(_0xd14b('0x11'));var qs=require(_0xd14b('0x12'));var hardwareService=require(_0xd14b('0x13'));var logger=require(_0xd14b('0x14'))(_0xd14b('0x15'));var utils=require(_0xd14b('0x16'));var config=require(_0xd14b('0x17'));var db=require(_0xd14b('0x18'))['db'];function respondWithStatusCode(_0x53f44e,_0x2cdd62){_0x2cdd62=_0x2cdd62||0xcc;return function(_0x5a81d0){if(_0x5a81d0){return _0x53f44e['sendStatus'](_0x2cdd62);}return _0x53f44e[_0xd14b('0x19')](_0x2cdd62)[_0xd14b('0x1a')]();};}function respondWithResult(_0x24fa71,_0x340e2c){_0x340e2c=_0x340e2c||0xc8;return function(_0x2fa7d8){if(_0x2fa7d8){return _0x24fa71[_0xd14b('0x19')](_0x340e2c)[_0xd14b('0x1b')](_0x2fa7d8);}};}function respondWithFilteredResult(_0x406b56,_0x3019e4){return function(_0x121465){if(_0x121465){var _0x99a0c4=_0x121465[_0xd14b('0x1c')],_0x1e0bfa=_0x3019e4[_0xd14b('0x1d')],_0x19b9b5=_0x3019e4['offset']+_0x3019e4[_0xd14b('0x1e')],_0x1c3281;if(_0x19b9b5>=_0x99a0c4){_0x19b9b5=_0x99a0c4;_0x1c3281=0xc8;}else{_0x1c3281=0xce;}_0x406b56[_0xd14b('0x19')](_0x1c3281);return _0x406b56[_0xd14b('0x1f')]('Content-Range',_0x1e0bfa+'-'+_0x19b9b5+'/'+_0x99a0c4)['json'](_0x121465);}return null;};}function patchUpdates(_0x3ea91e){return function(_0xd99382){try{jsonpatch[_0xd14b('0x20')](_0xd99382,_0x3ea91e,!![]);}catch(_0x3e4d67){return BPromise[_0xd14b('0x21')](_0x3e4d67);}return _0xd99382['save']();};}function saveUpdates(_0x1fed2f,_0x18ebc8){return function(_0x5ce9fa){if(_0x5ce9fa){return _0x5ce9fa[_0xd14b('0x22')](_0x1fed2f)[_0xd14b('0x23')](function(_0x400511){return _0x400511;});}return null;};}function removeEntity(_0x473308,_0x372d03){return function(_0x49918d){if(_0x49918d){return _0x49918d[_0xd14b('0x24')]()[_0xd14b('0x23')](function(){var _0x528c0a=_0x49918d[_0xd14b('0x25')]({'plain':!![]});var _0x111ab8=_0xd14b('0x26');return db[_0xd14b('0x27')][_0xd14b('0x24')]({'where':{'type':_0x111ab8,'resourceId':_0x528c0a['id']}})[_0xd14b('0x23')](function(){return _0x49918d;});})[_0xd14b('0x23')](function(){_0x473308[_0xd14b('0x19')](0xcc)[_0xd14b('0x1a')]();});}};}function handleEntityNotFound(_0x558010,_0x39a0eb){return function(_0x3155dd){if(!_0x3155dd){_0x558010[_0xd14b('0x28')](0x194);}return _0x3155dd;};}function handleError(_0x5ad98f,_0x5cb195){_0x5cb195=_0x5cb195||0x1f4;return function(_0x26fc08){logger['error'](_0x26fc08['stack']);if(_0x26fc08[_0xd14b('0x29')]){delete _0x26fc08['name'];}_0x5ad98f[_0xd14b('0x19')](_0x5cb195)['send'](_0x26fc08);};}exports[_0xd14b('0x2a')]=function(_0x3bbbe0,_0x39e7ca){var _0x10f004={},_0x353018={},_0x479b32={'count':0x0,'rows':[]};var _0x2e38ad=db['AnalyticDefaultReport'][_0xd14b('0x2b')];_0x353018[_0xd14b('0x2c')]=_['keys'](_0x2e38ad);_0x353018[_0xd14b('0x2d')]=_[_0xd14b('0x2e')](_0x3bbbe0['query']);_0x353018[_0xd14b('0x2f')]=_[_0xd14b('0x30')](_0x353018['model'],_0x353018['query']);_0x10f004[_0xd14b('0x31')]=_[_0xd14b('0x30')](_0x353018[_0xd14b('0x2c')],qs[_0xd14b('0x32')](_0x3bbbe0[_0xd14b('0x2d')][_0xd14b('0x32')]));_0x10f004['attributes']=_0x10f004[_0xd14b('0x31')][_0xd14b('0x33')]?_0x10f004['attributes']:_0x353018[_0xd14b('0x2c')];if(!_0x3bbbe0['query']['hasOwnProperty'](_0xd14b('0x34'))){_0x10f004['limit']=qs[_0xd14b('0x1e')](_0x3bbbe0[_0xd14b('0x2d')][_0xd14b('0x1e')]);_0x10f004[_0xd14b('0x1d')]=qs[_0xd14b('0x1d')](_0x3bbbe0['query'][_0xd14b('0x1d')]);}_0x10f004['order']=qs['sort'](_0x3bbbe0['query'][_0xd14b('0x35')]);_0x10f004[_0xd14b('0x36')]=qs[_0xd14b('0x2f')](_[_0xd14b('0x37')](_0x3bbbe0[_0xd14b('0x2d')],_0x353018[_0xd14b('0x2f')]));if(_0x3bbbe0['query']['filter']){_0x10f004['where']=_[_0xd14b('0x38')](_0x10f004[_0xd14b('0x36')],{'$or':_[_0xd14b('0x39')](_0x2e38ad,function(_0x1181ec){if(_0x1181ec['type'][_0xd14b('0x3a')]!==_0xd14b('0x3b')){var _0x12df36={};_0x12df36[_0x1181ec[_0xd14b('0x3c')]]={'$like':'%'+_0x3bbbe0['query']['filter']+'%'};return _0x12df36;}})});}_0x10f004=_[_0xd14b('0x38')]({},_0x10f004,_0x3bbbe0[_0xd14b('0x3d')]);var _0x33e15c={'where':_0x10f004[_0xd14b('0x36')]};return db[_0xd14b('0x3e')]['count'](_0x33e15c)[_0xd14b('0x23')](function(_0xaa3313){_0x479b32[_0xd14b('0x1c')]=_0xaa3313;if(_0x3bbbe0['query'][_0xd14b('0x3f')]){_0x10f004[_0xd14b('0x40')]=[{'all':!![]}];}return db[_0xd14b('0x3e')][_0xd14b('0x41')](_0x10f004);})[_0xd14b('0x23')](function(_0x3abfd9){_0x479b32[_0xd14b('0x42')]=_0x3abfd9;return _0x479b32;})[_0xd14b('0x23')](respondWithFilteredResult(_0x39e7ca,_0x10f004))['catch'](handleError(_0x39e7ca,null));};exports[_0xd14b('0x43')]=function(_0x252b3c,_0x334483){var _0x34772a={'raw':!![],'where':{'id':_0x252b3c[_0xd14b('0x44')]['id']}},_0x4efc49={};_0x4efc49[_0xd14b('0x2c')]=_['keys'](db[_0xd14b('0x3e')]['rawAttributes']);_0x4efc49[_0xd14b('0x2d')]=_[_0xd14b('0x2e')](_0x252b3c[_0xd14b('0x2d')]);_0x4efc49[_0xd14b('0x2f')]=_['intersection'](_0x4efc49[_0xd14b('0x2c')],_0x4efc49['query']);_0x34772a[_0xd14b('0x31')]=_[_0xd14b('0x30')](_0x4efc49[_0xd14b('0x2c')],qs['fields'](_0x252b3c[_0xd14b('0x2d')][_0xd14b('0x32')]));_0x34772a['attributes']=_0x34772a[_0xd14b('0x31')]['length']?_0x34772a[_0xd14b('0x31')]:_0x4efc49[_0xd14b('0x2c')];if(_0x252b3c[_0xd14b('0x2d')][_0xd14b('0x3f')]){_0x34772a['include']=[{'all':!![]}];}_0x34772a=_[_0xd14b('0x38')]({},_0x34772a,_0x252b3c[_0xd14b('0x3d')]);return db[_0xd14b('0x3e')][_0xd14b('0x45')](_0x34772a)[_0xd14b('0x23')](handleEntityNotFound(_0x334483,null))[_0xd14b('0x23')](respondWithResult(_0x334483,null))[_0xd14b('0x46')](handleError(_0x334483,null));};exports[_0xd14b('0x47')]=function(_0x407c2c,_0x38dba4){return db[_0xd14b('0x3e')][_0xd14b('0x47')](_0x407c2c[_0xd14b('0x48')],{})['then'](function(_0x410fd9){var _0x42d10d=_0x407c2c[_0xd14b('0x49')][_0xd14b('0x25')]({'plain':!![]});if(!_0x42d10d)throw new Error(_0xd14b('0x4a'));if(_0x42d10d[_0xd14b('0x4b')]===_0xd14b('0x49')){var _0x17b70c=_0x410fd9[_0xd14b('0x25')]({'plain':!![]});var _0x132e68=_0xd14b('0x4c');return db[_0xd14b('0x4d')][_0xd14b('0x45')]({'where':{'name':_0x132e68,'userProfileId':_0x42d10d['userProfileId']},'raw':!![]})[_0xd14b('0x23')](function(_0x114d14){if(_0x114d14&&_0x114d14[_0xd14b('0x4e')]===0x0){return db[_0xd14b('0x27')][_0xd14b('0x47')]({'name':_0x17b70c[_0xd14b('0x29')],'resourceId':_0x17b70c['id'],'type':_0xd14b('0x26'),'sectionId':_0x114d14['id']},{})['then'](function(){return _0x410fd9;});}else{return _0x410fd9;}})['catch'](function(_0x1a4fa0){logger[_0xd14b('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a4fa0);throw _0x1a4fa0;});}return _0x410fd9;})[_0xd14b('0x23')](respondWithResult(_0x38dba4,0xc9))[_0xd14b('0x46')](handleError(_0x38dba4,null));};exports[_0xd14b('0x22')]=function(_0x14e1cb,_0x5c1157){if(_0x14e1cb[_0xd14b('0x48')]['id']){delete _0x14e1cb['body']['id'];}return db['AnalyticDefaultReport']['find']({'where':{'id':_0x14e1cb[_0xd14b('0x44')]['id']}})[_0xd14b('0x23')](handleEntityNotFound(_0x5c1157,null))[_0xd14b('0x23')](saveUpdates(_0x14e1cb[_0xd14b('0x48')],null))[_0xd14b('0x23')](respondWithResult(_0x5c1157,null))['catch'](handleError(_0x5c1157,null));};exports[_0xd14b('0x24')]=function(_0x27726c,_0x485fba){return db[_0xd14b('0x3e')][_0xd14b('0x45')]({'where':{'id':_0x27726c[_0xd14b('0x44')]['id']}})[_0xd14b('0x23')](handleEntityNotFound(_0x485fba,null))[_0xd14b('0x23')](removeEntity(_0x485fba,null))[_0xd14b('0x46')](handleError(_0x485fba,null));};exports[_0xd14b('0x50')]=function(_0x317f43,_0x53262a){var _0x46933f=0xa;var _0x1848b6=[_0xd14b('0x51'),_0xd14b('0x52'),_0xd14b('0x53'),'cross_join'];var _0x19f306={'SUM':_0xd14b('0x54'),'COUNT':_0xd14b('0x55'),'COUNT DISTINCT':_0xd14b('0x56'),'MAX':_0xd14b('0x57'),'MIN':_0xd14b('0x58'),'AVG':_0xd14b('0x59'),'GROUP_CONCAT':_0xd14b('0x5a'),'GROUP_CONCAT ASC':_0xd14b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x288666={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xd14b('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd14b('0x5d')};var _0x3e2c68=function(_0x71b476){return!_[_0xd14b('0x5e')]([_0xd14b('0x5f'),'IS\x20NOT\x20NULL',_0xd14b('0x60'),_0xd14b('0x61')],_0x71b476);};var _0x4dd4cd=function(_0x3cfa84){if(!_0x3cfa84||!_0x3cfa84[_0xd14b('0x62')]['length']){return'';}for(var _0x46ac29='(',_0x45562d=0x0;_0x45562d<_0x3cfa84['rules'][_0xd14b('0x33')];_0x45562d+=0x1){_0x45562d>0x0&&(_0x46ac29+='\x20'+_0x3cfa84['operator']+'\x20');_0x46ac29+=_0x3cfa84['rules'][_0x45562d][_0xd14b('0x63')]?_0x4dd4cd(_0x3cfa84[_0xd14b('0x62')][_0x45562d][_0xd14b('0x63')]):_0x3cfa84[_0xd14b('0x62')][_0x45562d]['field']+'\x20'+_0x3cfa84[_0xd14b('0x62')][_0x45562d][_0xd14b('0x64')]+(_0x3e2c68(_0x3cfa84[_0xd14b('0x62')][_0x45562d][_0xd14b('0x64')])?'\x20'+_0x3cfa84['rules'][_0x45562d]['value']:'');}return _0x46ac29+')';};var _0x1beaa8={'where':{'id':_0x317f43['params']['id']}},_0x18ba5f,_0x3786cd,_0x124bdf,_0x331bcb,_0x532385;_0x1beaa8=_[_0xd14b('0x38')]({},_0x1beaa8,_0x317f43[_0xd14b('0x3d')]);return db[_0xd14b('0x3e')][_0xd14b('0x45')](_0x1beaa8)['then'](function(_0x106f3a){if(_0x106f3a){_0x18ba5f=_0x106f3a;return _0x106f3a[_0xd14b('0x65')]();}return null;})['then'](function(_0x1fdcd9){if(_0x1fdcd9){if(!_0x1fdcd9[_0xd14b('0x33')]){throw new db[(_0xd14b('0x66'))]['ValidationErrorItem'](_0xd14b('0x67'),0x193);}_0x3786cd=_0x1fdcd9;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd14b('0x23')](function(_0x1bdc7b){if(_0x1bdc7b){_0x124bdf=_['keyBy'](_0x1bdc7b,'id');var _0x310318;var _0x253d42=squel[_0xd14b('0x68')]();_0x253d42[_0xd14b('0x69')](_0x18ba5f[_0xd14b('0x6a')]);for(var _0x23015e=0x0;_0x23015e<_0x3786cd[_0xd14b('0x33')];_0x23015e+=0x1){_0x310318=_0x3786cd[_0x23015e][_0xd14b('0x6b')]?_0x124bdf[_0x3786cd[_0x23015e]['MetricId']][_0xd14b('0x6c')]:_0x3786cd[_0x23015e][_0xd14b('0x3c')];_0x310318=_0x3786cd[_0x23015e][_0xd14b('0x6d')]?_[_0xd14b('0x6e')](_0x19f306[_0x3786cd[_0x23015e][_0xd14b('0x6d')]],'%s',_0x310318):_0x310318;_0x310318=_0x3786cd[_0x23015e][_0xd14b('0x6f')]?_[_0xd14b('0x6e')](_0x288666[_0x3786cd[_0x23015e]['format']],'%s',_0x310318):_0x310318;if(_0x3786cd[_0x23015e][_0xd14b('0x70')]){_0x253d42['group'](_0x310318);}_0x3786cd[_0x23015e]['orderBy']&&_0x253d42[_0xd14b('0x71')](_0x310318,_0x3786cd[_0x23015e][_0xd14b('0x72')]===_0xd14b('0x73')?![]:!![]);_0x253d42['field'](_0x310318,_0x3786cd[_0x23015e][_0xd14b('0x74')]||_0x310318);}if(_0x18ba5f[_0xd14b('0x75')]){_0x18ba5f[_0xd14b('0x75')]=JSON[_0xd14b('0x76')](_0x18ba5f['joins']);for(var _0x1addd4=0x0;_0x1addd4<_0x18ba5f[_0xd14b('0x75')][_0xd14b('0x33')];_0x1addd4+=0x1){if(_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x77')]&&_['includes'](_0x1848b6,_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x77')])&&_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x78')]&&_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x79')]&&_0x18ba5f['joins'][_0x1addd4]['foreignKey']){_0x253d42[_0x18ba5f['joins'][_0x1addd4][_0xd14b('0x77')]](_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x79')],null,util['format'](_0xd14b('0x7a'),_0x18ba5f[_0xd14b('0x6a')],_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x78')],_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x79')],_0x18ba5f[_0xd14b('0x75')][_0x1addd4]['foreignKey']));}}}if(_0x18ba5f[_0xd14b('0x7b')]){_0x18ba5f[_0xd14b('0x7b')]=JSON[_0xd14b('0x76')](_0x18ba5f[_0xd14b('0x7b')]);_0x253d42[_0xd14b('0x36')](_0x4dd4cd(_0x18ba5f[_0xd14b('0x7b')]['group']));}_0x532385=_0x253d42[_0xd14b('0x7c')]();_0x253d42[_0xd14b('0x1e')](_0x46933f);_0x253d42['offset'](0x0);logger[_0xd14b('0x7d')](_0xd14b('0x7e'),_0x253d42[_0xd14b('0x7f')]());return db['sequelize'][_0xd14b('0x2d')](_0x253d42[_0xd14b('0x7f')](),{'type':db[_0xd14b('0x80')][_0xd14b('0x81')][_0xd14b('0x82')]});}})[_0xd14b('0x23')](respondWithResult(_0x53262a,null))[_0xd14b('0x46')](handleError(_0x53262a,null));};function runReport(_0x4fa4d3,_0x2ddbc7,_0x10c68d){var _0x2abc09=_0x2ddbc7['name'];var _0x16401a=0xa;var _0x40be4e=['join',_0xd14b('0x52'),_0xd14b('0x53'),_0xd14b('0x83')];var _0x197602={'SUM':_0xd14b('0x54'),'COUNT':_0xd14b('0x55'),'COUNT DISTINCT':_0xd14b('0x56'),'MAX':_0xd14b('0x57'),'MIN':_0xd14b('0x58'),'AVG':_0xd14b('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd14b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x140aef={'SEC_TO_TIME':_0xd14b('0x84'),'DATE':_0xd14b('0x85'),'HOUR':_0xd14b('0x5c'),'ROUND':_0xd14b('0x86'),'UNIX_TIMESTAMP':_0xd14b('0x5d')};var _0xc85614=function(_0x59161d){return!_['includes']([_0xd14b('0x5f'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xd14b('0x61')],_0x59161d);};var _0x4303a5=function(_0x492b1c){if(!_0x492b1c||!_0x492b1c['rules']['length']){return'';}for(var _0x7c2f7d='(',_0x57ad55=0x0;_0x57ad55<_0x492b1c[_0xd14b('0x62')]['length'];_0x57ad55+=0x1){_0x57ad55>0x0&&(_0x7c2f7d+='\x20'+_0x492b1c[_0xd14b('0x87')]+'\x20');_0x7c2f7d+=_0x492b1c[_0xd14b('0x62')][_0x57ad55][_0xd14b('0x63')]?_0x4303a5(_0x492b1c[_0xd14b('0x62')][_0x57ad55]['group']):_0x492b1c[_0xd14b('0x62')][_0x57ad55]['field']+'\x20'+_0x492b1c['rules'][_0x57ad55][_0xd14b('0x64')]+(_0xc85614(_0x492b1c[_0xd14b('0x62')][_0x57ad55][_0xd14b('0x64')])?'\x20'+_0x492b1c[_0xd14b('0x62')][_0x57ad55][_0xd14b('0x88')]:'');}return _0x7c2f7d+')';};var _0x534f7d={'where':{'id':_0x4fa4d3['id']}},_0x12e1a7,_0x2de0d2,_0x1d4ce2,_0x3c6538,_0x459141;_0x534f7d=_['merge']({},_0x534f7d,_0x10c68d);return db['AnalyticDefaultReport'][_0xd14b('0x45')](_0x534f7d)[_0xd14b('0x23')](function(_0x3851a9){if(_0x3851a9){_0x12e1a7=_0x3851a9;return _0x3851a9[_0xd14b('0x65')]();}return null;})[_0xd14b('0x23')](function(_0xe01d8e){if(_0xe01d8e){if(!_0xe01d8e[_0xd14b('0x33')]){throw new db['Sequelize'][(_0xd14b('0x89'))](_0xd14b('0x67'),0x193);}_0x2de0d2=_0xe01d8e;return db[_0xd14b('0x8a')][_0xd14b('0x41')]({'raw':!![]});}return null;})[_0xd14b('0x23')](function(_0x141279){if(_0x141279){_0x1d4ce2=_[_0xd14b('0x8b')](_0x141279,'id');var _0x2f630e;var _0x17cd98=squel['select']();_0x17cd98[_0xd14b('0x69')](_0x12e1a7['table']);for(var _0x4c0062=0x0;_0x4c0062<_0x2de0d2[_0xd14b('0x33')];_0x4c0062+=0x1){_0x2f630e=_0x2de0d2[_0x4c0062][_0xd14b('0x6b')]?_0x1d4ce2[_0x2de0d2[_0x4c0062][_0xd14b('0x6b')]][_0xd14b('0x6c')]:_0x2de0d2[_0x4c0062]['field'];_0x2f630e=_0x2de0d2[_0x4c0062][_0xd14b('0x6d')]?_[_0xd14b('0x6e')](_0x197602[_0x2de0d2[_0x4c0062][_0xd14b('0x6d')]],'%s',_0x2f630e):_0x2f630e;_0x2f630e=_0x2de0d2[_0x4c0062][_0xd14b('0x6f')]?_['replace'](_0x140aef[_0x2de0d2[_0x4c0062][_0xd14b('0x6f')]],'%s',_0x2f630e):_0x2f630e;if(_0x2de0d2[_0x4c0062][_0xd14b('0x70')]){_0x17cd98[_0xd14b('0x63')](_0x2f630e);}_0x2de0d2[_0x4c0062][_0xd14b('0x72')]&&_0x17cd98[_0xd14b('0x71')](_0x2f630e,_0x2de0d2[_0x4c0062][_0xd14b('0x72')]===_0xd14b('0x73')?![]:!![]);_0x17cd98[_0xd14b('0x3c')](_0x2f630e,_0x2de0d2[_0x4c0062][_0xd14b('0x74')]||_0x2f630e);}if(_0x12e1a7[_0xd14b('0x75')]){_0x12e1a7[_0xd14b('0x75')]=JSON['parse'](_0x12e1a7[_0xd14b('0x75')]);for(var _0x52b50c=0x0;_0x52b50c<_0x12e1a7[_0xd14b('0x75')][_0xd14b('0x33')];_0x52b50c+=0x1){if(_0x12e1a7['joins'][_0x52b50c][_0xd14b('0x77')]&&_[_0xd14b('0x5e')](_0x40be4e,_0x12e1a7['joins'][_0x52b50c][_0xd14b('0x77')])&&_0x12e1a7['joins'][_0x52b50c]['parentKey']&&_0x12e1a7[_0xd14b('0x75')][_0x52b50c][_0xd14b('0x79')]&&_0x12e1a7[_0xd14b('0x75')][_0x52b50c]['foreignKey']){_0x17cd98[_0x12e1a7['joins'][_0x52b50c][_0xd14b('0x77')]](_0x12e1a7[_0xd14b('0x75')][_0x52b50c][_0xd14b('0x79')],null,util['format'](_0xd14b('0x7a'),_0x12e1a7['table'],_0x12e1a7[_0xd14b('0x75')][_0x52b50c]['parentKey'],_0x12e1a7[_0xd14b('0x75')][_0x52b50c][_0xd14b('0x79')],_0x12e1a7[_0xd14b('0x75')][_0x52b50c][_0xd14b('0x8c')]));}}}if(_0x12e1a7[_0xd14b('0x7b')]){_0x12e1a7[_0xd14b('0x7b')]=JSON[_0xd14b('0x76')](_0x12e1a7[_0xd14b('0x7b')]);_0x17cd98[_0xd14b('0x36')](_0x4303a5(_0x12e1a7[_0xd14b('0x7b')][_0xd14b('0x63')]));}_0x459141=_0x17cd98['clone']();_0x17cd98[_0xd14b('0x1e')](_0x16401a);_0x17cd98[_0xd14b('0x1d')](0x0);logger[_0xd14b('0x7d')](_0xd14b('0x7e'),_0x17cd98[_0xd14b('0x7f')]());return db[_0xd14b('0x80')]['query'](_0x17cd98[_0xd14b('0x7f')](),{'type':db[_0xd14b('0x80')][_0xd14b('0x81')][_0xd14b('0x82')]});}})['then'](function(_0x34d931){if(!_0x34d931[_0xd14b('0x33')]){throw new db[(_0xd14b('0x66'))][(_0xd14b('0x89'))]('No\x20available\x20data',0xcc);}if(_0x2ddbc7['output']==='web'){return null;}var _0x140a52=_['merge'](_0x2ddbc7,{'name':_0x2ddbc7[_0xd14b('0x8d')]||_0x2ddbc7[_0xd14b('0x29')]||_0x12e1a7[_0xd14b('0x29')],'basename':_0x2abc09,'savename':util[_0xd14b('0x6f')]('%s-%s.%s',_0x2ddbc7[_0xd14b('0x29')]||_0x12e1a7[_0xd14b('0x29')],require(_0xd14b('0x8e'))[_0xd14b('0x8f')](0x4),_0x2ddbc7[_0xd14b('0x90')]||'csv'),'reportId':_0x12e1a7['id'],'reportType':_0xd14b('0x91')});return db['AnalyticExtractedReport'][_0xd14b('0x47')](_0x140a52,{'raw':!![]});})[_0xd14b('0x23')](function(_0x4b2af4){if(_0x12e1a7[_0xd14b('0x6a')]===_0xd14b('0x92')){_0x459141[_0xd14b('0x36')](_0x12e1a7['table']+_0xd14b('0x93'),_0x2ddbc7['startDate'],_0x2ddbc7[_0xd14b('0x94')]);}else{_0x459141['where'](_0x12e1a7['table']+_0xd14b('0x95'),_0x2ddbc7[_0xd14b('0x96')],_0x2ddbc7[_0xd14b('0x94')]);}if(_0x4b2af4){logger[_0xd14b('0x97')](_0xd14b('0x98'),_0x459141['toString']());require(_0xd14b('0x99'))[_0xd14b('0x9a')](path[_0xd14b('0x51')](__dirname,_0xd14b('0x9b'),_0x4b2af4[_0xd14b('0x90')]),[_0x4b2af4['id'],_0x459141[_0xd14b('0x7f')](),path[_0xd14b('0x51')](__dirname,'../../files/reports',_0x4b2af4[_0xd14b('0x9c')]),_0x2abc09]);return _0x4b2af4;}else{var _0x1624bf=squel['select']();_0x1624bf[_0xd14b('0x69')]('('+_0x459141['toString']()+')',_0xd14b('0x9d'));_0x1624bf[_0xd14b('0x3c')](_0xd14b('0x9e'),_0xd14b('0x1c'));_0x459141[_0xd14b('0x1e')](_0x2ddbc7['limit']||_0x16401a);_0x459141[_0xd14b('0x1d')](_0x2ddbc7[_0xd14b('0x1d')]||0x0);return db[_0xd14b('0x80')][_0xd14b('0x2d')](_0x1624bf[_0xd14b('0x7f')](),{'type':db['sequelize'][_0xd14b('0x81')][_0xd14b('0x82')]})[_0xd14b('0x23')](function(_0x1c294b){if(!_0x1c294b[_0xd14b('0x33')]){_0x3c6538=0x0;}else{_0x3c6538=_0x1c294b[0x0][_0xd14b('0x1c')]||0x0;}return db[_0xd14b('0x80')][_0xd14b('0x2d')](_0x459141['toString'](),{'type':db[_0xd14b('0x80')]['QueryTypes'][_0xd14b('0x82')]});})[_0xd14b('0x23')](function(_0x3ad3bd){return{'rows':_0x3ad3bd||[],'count':_0x3c6538};});}});}exports[_0xd14b('0x9f')]=function(_0xb54182,_0xa74064){return runReport(_0xb54182['params'],_0xb54182[_0xd14b('0x2d')],_0xb54182[_0xd14b('0x3d')])[_0xd14b('0x23')](respondWithResult(_0xa74064,null))[_0xd14b('0x46')](handleError(_0xa74064,null));};exports[_0xd14b('0xa0')]=runReport;exports[_0xd14b('0x2d')]=function(_0x77935c,_0x78f55){var _0x4e5b63=0xa;var _0x10af20=[_0xd14b('0x51'),_0xd14b('0x52'),_0xd14b('0x53'),_0xd14b('0x83')];var _0x2651f2={'SUM':'SUM(%s)','COUNT':_0xd14b('0x55'),'COUNT DISTINCT':_0xd14b('0x56'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd14b('0x5a'),'GROUP_CONCAT ASC':_0xd14b('0x5b'),'GROUP_CONCAT DESC':_0xd14b('0xa1')};var _0x457bd0={'SEC_TO_TIME':_0xd14b('0x84'),'DATE':_0xd14b('0x85'),'HOUR':'HOUR(%s)','ROUND':_0xd14b('0x86'),'UNIX_TIMESTAMP':_0xd14b('0x5d')};var _0x5e2405=function(_0x196c81){return!_[_0xd14b('0x5e')]([_0xd14b('0x5f'),_0xd14b('0xa2'),'IS\x20EMPTY',_0xd14b('0x61')],_0x196c81);};var _0x12e0ee=function(_0xc79889){if(!_0xc79889||!_0xc79889[_0xd14b('0x62')][_0xd14b('0x33')]){return'';}for(var _0x4fa172='(',_0x2cf866=0x0;_0x2cf866<_0xc79889[_0xd14b('0x62')][_0xd14b('0x33')];_0x2cf866+=0x1){_0x2cf866>0x0&&(_0x4fa172+='\x20'+_0xc79889[_0xd14b('0x87')]+'\x20');_0x4fa172+=_0xc79889[_0xd14b('0x62')][_0x2cf866][_0xd14b('0x63')]?_0x12e0ee(_0xc79889[_0xd14b('0x62')][_0x2cf866][_0xd14b('0x63')]):_0xc79889[_0xd14b('0x62')][_0x2cf866][_0xd14b('0x3c')]+'\x20'+_0xc79889[_0xd14b('0x62')][_0x2cf866][_0xd14b('0x64')]+(_0x5e2405(_0xc79889[_0xd14b('0x62')][_0x2cf866][_0xd14b('0x64')])?'\x20'+_0xc79889[_0xd14b('0x62')][_0x2cf866]['value']:'');}return _0x4fa172+')';};var _0x1f09b2={'where':{'id':_0x77935c['params']['id']}},_0x66c4c3,_0x575ce8,_0x49c51c,_0x2d686f,_0x1ce00a;_0x1f09b2=_[_0xd14b('0x38')]({},_0x1f09b2,_0x77935c[_0xd14b('0x3d')]);return db[_0xd14b('0x3e')]['find'](_0x1f09b2)['then'](function(_0xfcc5f){if(_0xfcc5f){_0x66c4c3=_0xfcc5f;return _0xfcc5f['getFields']();}return null;})[_0xd14b('0x23')](function(_0x48a678){if(_0x48a678){if(!_0x48a678[_0xd14b('0x33')]){throw new db['Sequelize'][(_0xd14b('0x89'))](_0xd14b('0x67'),0x193);}_0x575ce8=_0x48a678;return db[_0xd14b('0x8a')]['findAll']({'raw':!![]});}return null;})[_0xd14b('0x23')](function(_0x305c46){if(_0x305c46){_0x49c51c=_[_0xd14b('0x8b')](_0x305c46,'id');var _0x2302e7;var _0x8ed4d8=squel['select']();_0x8ed4d8[_0xd14b('0x69')](_0x66c4c3[_0xd14b('0x6a')]);for(var _0x569b8c=0x0;_0x569b8c<_0x575ce8['length'];_0x569b8c+=0x1){_0x2302e7=_0x575ce8[_0x569b8c][_0xd14b('0x6b')]?_0x49c51c[_0x575ce8[_0x569b8c]['MetricId']][_0xd14b('0x6c')]:_0x575ce8[_0x569b8c]['field'];_0x2302e7=_0x575ce8[_0x569b8c]['function']?_[_0xd14b('0x6e')](_0x2651f2[_0x575ce8[_0x569b8c][_0xd14b('0x6d')]],'%s',_0x2302e7):_0x2302e7;_0x2302e7=_0x575ce8[_0x569b8c][_0xd14b('0x6f')]?_[_0xd14b('0x6e')](_0x457bd0[_0x575ce8[_0x569b8c]['format']],'%s',_0x2302e7):_0x2302e7;if(_0x575ce8[_0x569b8c][_0xd14b('0x70')]){_0x8ed4d8[_0xd14b('0x63')](_0x2302e7);}_0x575ce8[_0x569b8c]['orderBy']&&_0x8ed4d8[_0xd14b('0x71')](_0x2302e7,_0x575ce8[_0x569b8c][_0xd14b('0x72')]===_0xd14b('0x73')?![]:!![]);_0x8ed4d8[_0xd14b('0x3c')](_0x2302e7,_0x575ce8[_0x569b8c][_0xd14b('0x74')]||_0x2302e7);}if(_0x66c4c3[_0xd14b('0x75')]){_0x66c4c3[_0xd14b('0x75')]=JSON[_0xd14b('0x76')](_0x66c4c3['joins']);for(var _0x45f3f3=0x0;_0x45f3f3<_0x66c4c3[_0xd14b('0x75')][_0xd14b('0x33')];_0x45f3f3+=0x1){if(_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x77')]&&_['includes'](_0x10af20,_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x77')])&&_0x66c4c3[_0xd14b('0x75')][_0x45f3f3]['parentKey']&&_0x66c4c3['joins'][_0x45f3f3][_0xd14b('0x79')]&&_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x8c')]){_0x8ed4d8[_0x66c4c3['joins'][_0x45f3f3][_0xd14b('0x77')]](_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x79')],null,util[_0xd14b('0x6f')]('%s.%s\x20=\x20%s.%s',_0x66c4c3[_0xd14b('0x6a')],_0x66c4c3[_0xd14b('0x75')][_0x45f3f3]['parentKey'],_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x79')],_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x8c')]));}}}if(_0x66c4c3[_0xd14b('0x7b')]){_0x66c4c3[_0xd14b('0x7b')]=JSON['parse'](_0x66c4c3[_0xd14b('0x7b')]);_0x8ed4d8[_0xd14b('0x36')](_0x12e0ee(_0x66c4c3[_0xd14b('0x7b')][_0xd14b('0x63')]));}_0x1ce00a=_0x8ed4d8[_0xd14b('0x7c')]();_0x8ed4d8[_0xd14b('0x1e')](_0x4e5b63);_0x8ed4d8[_0xd14b('0x1d')](0x0);logger[_0xd14b('0x7d')]('Limited\x20Query:',_0x8ed4d8[_0xd14b('0x7f')]());return db[_0xd14b('0x80')]['query'](_0x8ed4d8[_0xd14b('0x7f')](),{'type':db[_0xd14b('0x80')][_0xd14b('0x81')][_0xd14b('0x82')]});}})[_0xd14b('0x23')](function(){return{'sql':_0x1ce00a['toString']()};})[_0xd14b('0x23')](respondWithResult(_0x78f55,null))[_0xd14b('0x46')](handleError(_0x78f55,null));};
\ No newline at end of file
+var _0x5f89=['joins','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MIN(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','keyBy','select','DESC','parse','No\x20available\x20data','web','fullPath','randomstring','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','html-pdf','rimraf','moment','mustache','util','sox','to-csv','squel','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','options','count','include','findAll','catch','show','includeAll','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','alias'];(function(_0x313c92,_0x5d9943){var _0x8ddf39=function(_0x5c8fe7){while(--_0x5c8fe7){_0x313c92['push'](_0x313c92['shift']());}};_0x8ddf39(++_0x5d9943);}(_0x5f89,0xc5));var _0x95f8=function(_0x644e2d,_0xfad75c){_0x644e2d=_0x644e2d-0x0;var _0x3eea20=_0x5f89[_0x644e2d];return _0x3eea20;};'use strict';var pdf=require(_0x95f8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x95f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x95f8('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x95f8('0x3'));var util=require(_0x95f8('0x4'));var path=require('path');var sox=require(_0x95f8('0x5'));var csv=require(_0x95f8('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x95f8('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x95f8('0x8'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x95f8('0x9'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x95f8('0xa'));var hardwareService=require(_0x95f8('0xb'));var logger=require(_0x95f8('0xc'))(_0x95f8('0xd'));var utils=require(_0x95f8('0xe'));var config=require('../../config/environment');var db=require(_0x95f8('0xf'))['db'];function respondWithStatusCode(_0x26f40d,_0x36bdb5){_0x36bdb5=_0x36bdb5||0xcc;return function(_0x3f1fd4){if(_0x3f1fd4){return _0x26f40d[_0x95f8('0x10')](_0x36bdb5);}return _0x26f40d['status'](_0x36bdb5)[_0x95f8('0x11')]();};}function respondWithResult(_0x5c0f86,_0x2b1c1e){_0x2b1c1e=_0x2b1c1e||0xc8;return function(_0x759ada){if(_0x759ada){return _0x5c0f86[_0x95f8('0x12')](_0x2b1c1e)['json'](_0x759ada);}};}function respondWithFilteredResult(_0x523c62,_0x362156){return function(_0x579293){if(_0x579293){var _0x12326d=_0x579293['count'],_0x55ab59=_0x362156[_0x95f8('0x13')],_0x203b6b=_0x362156[_0x95f8('0x13')]+_0x362156[_0x95f8('0x14')],_0x2eca1e;if(_0x203b6b>=_0x12326d){_0x203b6b=_0x12326d;_0x2eca1e=0xc8;}else{_0x2eca1e=0xce;}_0x523c62[_0x95f8('0x12')](_0x2eca1e);return _0x523c62['set'](_0x95f8('0x15'),_0x55ab59+'-'+_0x203b6b+'/'+_0x12326d)[_0x95f8('0x16')](_0x579293);}return null;};}function patchUpdates(_0x5aca7d){return function(_0x318369){try{jsonpatch[_0x95f8('0x17')](_0x318369,_0x5aca7d,!![]);}catch(_0x5e70c3){return BPromise[_0x95f8('0x18')](_0x5e70c3);}return _0x318369[_0x95f8('0x19')]();};}function saveUpdates(_0x4f8016,_0x374ba6){return function(_0x727d7e){if(_0x727d7e){return _0x727d7e[_0x95f8('0x1a')](_0x4f8016)[_0x95f8('0x1b')](function(_0x5aad58){return _0x5aad58;});}return null;};}function removeEntity(_0x9250f0,_0x32d5fe){return function(_0x3c60dc){if(_0x3c60dc){return _0x3c60dc[_0x95f8('0x1c')]()['then'](function(){var _0x25bf5d=_0x3c60dc[_0x95f8('0x1d')]({'plain':!![]});var _0x345cd1=_0x95f8('0x1e');return db[_0x95f8('0x1f')][_0x95f8('0x1c')]({'where':{'type':_0x345cd1,'resourceId':_0x25bf5d['id']}})[_0x95f8('0x1b')](function(){return _0x3c60dc;});})[_0x95f8('0x1b')](function(){_0x9250f0[_0x95f8('0x12')](0xcc)[_0x95f8('0x11')]();});}};}function handleEntityNotFound(_0x330852,_0x50673f){return function(_0x48c946){if(!_0x48c946){_0x330852[_0x95f8('0x10')](0x194);}return _0x48c946;};}function handleError(_0x36d152,_0x5e4dac){_0x5e4dac=_0x5e4dac||0x1f4;return function(_0x32a1be){logger[_0x95f8('0x20')](_0x32a1be[_0x95f8('0x21')]);if(_0x32a1be[_0x95f8('0x22')]){delete _0x32a1be[_0x95f8('0x22')];}_0x36d152[_0x95f8('0x12')](_0x5e4dac)['send'](_0x32a1be);};}exports[_0x95f8('0x23')]=function(_0xc55e10,_0x3844f4){var _0x5c4d38={},_0x1447c5={},_0xd11990={'count':0x0,'rows':[]};var _0xa0abc=db[_0x95f8('0x24')][_0x95f8('0x25')];_0x1447c5[_0x95f8('0x26')]=_[_0x95f8('0x27')](_0xa0abc);_0x1447c5['query']=_[_0x95f8('0x27')](_0xc55e10[_0x95f8('0x28')]);_0x1447c5[_0x95f8('0x29')]=_[_0x95f8('0x2a')](_0x1447c5[_0x95f8('0x26')],_0x1447c5['query']);_0x5c4d38[_0x95f8('0x2b')]=_[_0x95f8('0x2a')](_0x1447c5['model'],qs[_0x95f8('0x2c')](_0xc55e10['query']['fields']));_0x5c4d38[_0x95f8('0x2b')]=_0x5c4d38[_0x95f8('0x2b')][_0x95f8('0x2d')]?_0x5c4d38[_0x95f8('0x2b')]:_0x1447c5['model'];if(!_0xc55e10[_0x95f8('0x28')]['hasOwnProperty'](_0x95f8('0x2e'))){_0x5c4d38['limit']=qs[_0x95f8('0x14')](_0xc55e10[_0x95f8('0x28')][_0x95f8('0x14')]);_0x5c4d38['offset']=qs[_0x95f8('0x13')](_0xc55e10[_0x95f8('0x28')]['offset']);}_0x5c4d38[_0x95f8('0x2f')]=qs[_0x95f8('0x30')](_0xc55e10['query'][_0x95f8('0x30')]);_0x5c4d38[_0x95f8('0x31')]=qs[_0x95f8('0x29')](_[_0x95f8('0x32')](_0xc55e10['query'],_0x1447c5['filters']));if(_0xc55e10['query'][_0x95f8('0x33')]){_0x5c4d38['where']=_['merge'](_0x5c4d38[_0x95f8('0x31')],{'$or':_[_0x95f8('0x34')](_0xa0abc,function(_0x55c4bc){if(_0x55c4bc[_0x95f8('0x35')][_0x95f8('0x36')]!==_0x95f8('0x37')){var _0x2de8a2={};_0x2de8a2[_0x55c4bc['field']]={'$like':'%'+_0xc55e10[_0x95f8('0x28')][_0x95f8('0x33')]+'%'};return _0x2de8a2;}})});}_0x5c4d38=_['merge']({},_0x5c4d38,_0xc55e10[_0x95f8('0x38')]);var _0x3bd31f={'where':_0x5c4d38[_0x95f8('0x31')]};return db[_0x95f8('0x24')][_0x95f8('0x39')](_0x3bd31f)['then'](function(_0x727f4a){_0xd11990[_0x95f8('0x39')]=_0x727f4a;if(_0xc55e10[_0x95f8('0x28')]['includeAll']){_0x5c4d38[_0x95f8('0x3a')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x95f8('0x3b')](_0x5c4d38);})[_0x95f8('0x1b')](function(_0x4c39c4){_0xd11990['rows']=_0x4c39c4;return _0xd11990;})[_0x95f8('0x1b')](respondWithFilteredResult(_0x3844f4,_0x5c4d38))[_0x95f8('0x3c')](handleError(_0x3844f4,null));};exports[_0x95f8('0x3d')]=function(_0x44d7d7,_0x1a521a){var _0x681024={'raw':!![],'where':{'id':_0x44d7d7['params']['id']}},_0x34cbc5={};_0x34cbc5['model']=_['keys'](db[_0x95f8('0x24')][_0x95f8('0x25')]);_0x34cbc5[_0x95f8('0x28')]=_['keys'](_0x44d7d7[_0x95f8('0x28')]);_0x34cbc5['filters']=_[_0x95f8('0x2a')](_0x34cbc5['model'],_0x34cbc5['query']);_0x681024[_0x95f8('0x2b')]=_['intersection'](_0x34cbc5['model'],qs[_0x95f8('0x2c')](_0x44d7d7[_0x95f8('0x28')]['fields']));_0x681024[_0x95f8('0x2b')]=_0x681024['attributes']['length']?_0x681024[_0x95f8('0x2b')]:_0x34cbc5[_0x95f8('0x26')];if(_0x44d7d7[_0x95f8('0x28')][_0x95f8('0x3e')]){_0x681024[_0x95f8('0x3a')]=[{'all':!![]}];}_0x681024=_[_0x95f8('0x3f')]({},_0x681024,_0x44d7d7[_0x95f8('0x38')]);return db[_0x95f8('0x24')][_0x95f8('0x40')](_0x681024)[_0x95f8('0x1b')](handleEntityNotFound(_0x1a521a,null))['then'](respondWithResult(_0x1a521a,null))[_0x95f8('0x3c')](handleError(_0x1a521a,null));};exports[_0x95f8('0x41')]=function(_0x4ace7a,_0x1f4c17){return db[_0x95f8('0x24')]['create'](_0x4ace7a[_0x95f8('0x42')],{})[_0x95f8('0x1b')](function(_0x485377){var _0x593698=_0x4ace7a[_0x95f8('0x43')][_0x95f8('0x1d')]({'plain':!![]});if(!_0x593698)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x593698[_0x95f8('0x44')]==='user'){var _0x5d744b=_0x485377['get']({'plain':!![]});var _0x124cb9='Reports';return db[_0x95f8('0x45')]['find']({'where':{'name':_0x124cb9,'userProfileId':_0x593698[_0x95f8('0x46')]},'raw':!![]})[_0x95f8('0x1b')](function(_0x4098c7){if(_0x4098c7&&_0x4098c7[_0x95f8('0x47')]===0x0){return db[_0x95f8('0x1f')][_0x95f8('0x41')]({'name':_0x5d744b[_0x95f8('0x22')],'resourceId':_0x5d744b['id'],'type':_0x95f8('0x1e'),'sectionId':_0x4098c7['id']},{})['then'](function(){return _0x485377;});}else{return _0x485377;}})[_0x95f8('0x3c')](function(_0x110751){logger['error'](_0x95f8('0x48'),_0x110751);throw _0x110751;});}return _0x485377;})[_0x95f8('0x1b')](respondWithResult(_0x1f4c17,0xc9))[_0x95f8('0x3c')](handleError(_0x1f4c17,null));};exports[_0x95f8('0x1a')]=function(_0xd3c735,_0x50b2db){if(_0xd3c735[_0x95f8('0x42')]['id']){delete _0xd3c735['body']['id'];}return db[_0x95f8('0x24')][_0x95f8('0x40')]({'where':{'id':_0xd3c735[_0x95f8('0x49')]['id']}})[_0x95f8('0x1b')](handleEntityNotFound(_0x50b2db,null))[_0x95f8('0x1b')](saveUpdates(_0xd3c735[_0x95f8('0x42')],null))['then'](respondWithResult(_0x50b2db,null))[_0x95f8('0x3c')](handleError(_0x50b2db,null));};exports['destroy']=function(_0x39ccae,_0x4bd1a5){return db[_0x95f8('0x24')][_0x95f8('0x40')]({'where':{'id':_0x39ccae[_0x95f8('0x49')]['id']}})[_0x95f8('0x1b')](handleEntityNotFound(_0x4bd1a5,null))[_0x95f8('0x1b')](removeEntity(_0x4bd1a5,null))[_0x95f8('0x3c')](handleError(_0x4bd1a5,null));};exports[_0x95f8('0x4a')]=function(_0x1a65aa,_0x31b15a){var _0x4bf373=0xa;var _0x1ebb8a=[_0x95f8('0x4b'),_0x95f8('0x4c'),_0x95f8('0x4d'),_0x95f8('0x4e')];var _0x4265af={'SUM':_0x95f8('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x95f8('0x50'),'MAX':_0x95f8('0x51'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x95f8('0x52'),'GROUP_CONCAT ASC':_0x95f8('0x53'),'GROUP_CONCAT DESC':_0x95f8('0x54')};var _0x5856b2={'SEC_TO_TIME':_0x95f8('0x55'),'DATE':_0x95f8('0x56'),'HOUR':_0x95f8('0x57'),'ROUND':_0x95f8('0x58'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x19754e=function(_0x882046){return!_['includes']([_0x95f8('0x59'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x882046);};var _0x28ab2b=function(_0xe2e9e4){if(!_0xe2e9e4||!_0xe2e9e4[_0x95f8('0x5a')][_0x95f8('0x2d')]){return'';}for(var _0x4fd907='(',_0xdb874f=0x0;_0xdb874f<_0xe2e9e4['rules'][_0x95f8('0x2d')];_0xdb874f+=0x1){_0xdb874f>0x0&&(_0x4fd907+='\x20'+_0xe2e9e4[_0x95f8('0x5b')]+'\x20');_0x4fd907+=_0xe2e9e4[_0x95f8('0x5a')][_0xdb874f][_0x95f8('0x5c')]?_0x28ab2b(_0xe2e9e4[_0x95f8('0x5a')][_0xdb874f][_0x95f8('0x5c')]):_0xe2e9e4['rules'][_0xdb874f]['field']+'\x20'+_0xe2e9e4[_0x95f8('0x5a')][_0xdb874f][_0x95f8('0x5d')]+(_0x19754e(_0xe2e9e4[_0x95f8('0x5a')][_0xdb874f]['condition'])?'\x20'+_0xe2e9e4[_0x95f8('0x5a')][_0xdb874f][_0x95f8('0x5e')]:'');}return _0x4fd907+')';};var _0x4ecb9e={'where':{'id':_0x1a65aa[_0x95f8('0x49')]['id']}},_0x54c949,_0x4cf87a,_0x352092,_0xab58a4,_0xcfa325;_0x4ecb9e=_[_0x95f8('0x3f')]({},_0x4ecb9e,_0x1a65aa[_0x95f8('0x38')]);return db[_0x95f8('0x24')][_0x95f8('0x40')](_0x4ecb9e)[_0x95f8('0x1b')](function(_0x275ef7){if(_0x275ef7){_0x54c949=_0x275ef7;return _0x275ef7[_0x95f8('0x5f')]();}return null;})[_0x95f8('0x1b')](function(_0x2e9ff6){if(_0x2e9ff6){if(!_0x2e9ff6[_0x95f8('0x2d')]){throw new db[(_0x95f8('0x60'))][(_0x95f8('0x61'))](_0x95f8('0x62'),0x193);}_0x4cf87a=_0x2e9ff6;return db[_0x95f8('0x63')][_0x95f8('0x3b')]({'raw':!![]});}return null;})[_0x95f8('0x1b')](function(_0x51733d){if(_0x51733d){_0x352092=_['keyBy'](_0x51733d,'id');var _0x33444c;var _0x151a18=squel['select']();_0x151a18[_0x95f8('0x64')](_0x54c949[_0x95f8('0x65')]);for(var _0x5db915=0x0;_0x5db915<_0x4cf87a[_0x95f8('0x2d')];_0x5db915+=0x1){_0x33444c=_0x4cf87a[_0x5db915]['MetricId']?_0x352092[_0x4cf87a[_0x5db915][_0x95f8('0x66')]][_0x95f8('0x67')]:_0x4cf87a[_0x5db915][_0x95f8('0x68')];_0x33444c=_0x4cf87a[_0x5db915][_0x95f8('0x69')]?_[_0x95f8('0x6a')](_0x4265af[_0x4cf87a[_0x5db915][_0x95f8('0x69')]],'%s',_0x33444c):_0x33444c;_0x33444c=_0x4cf87a[_0x5db915][_0x95f8('0x6b')]?_[_0x95f8('0x6a')](_0x5856b2[_0x4cf87a[_0x5db915][_0x95f8('0x6b')]],'%s',_0x33444c):_0x33444c;if(_0x4cf87a[_0x5db915][_0x95f8('0x6c')]){_0x151a18[_0x95f8('0x5c')](_0x33444c);}_0x4cf87a[_0x5db915][_0x95f8('0x6d')]&&_0x151a18[_0x95f8('0x2f')](_0x33444c,_0x4cf87a[_0x5db915][_0x95f8('0x6d')]==='DESC'?![]:!![]);_0x151a18['field'](_0x33444c,_0x4cf87a[_0x5db915][_0x95f8('0x6e')]||_0x33444c);}if(_0x54c949[_0x95f8('0x6f')]){_0x54c949[_0x95f8('0x6f')]=JSON['parse'](_0x54c949['joins']);for(var _0x3fdc66=0x0;_0x3fdc66<_0x54c949[_0x95f8('0x6f')][_0x95f8('0x2d')];_0x3fdc66+=0x1){if(_0x54c949[_0x95f8('0x6f')][_0x3fdc66][_0x95f8('0x35')]&&_[_0x95f8('0x70')](_0x1ebb8a,_0x54c949[_0x95f8('0x6f')][_0x3fdc66][_0x95f8('0x35')])&&_0x54c949[_0x95f8('0x6f')][_0x3fdc66][_0x95f8('0x71')]&&_0x54c949[_0x95f8('0x6f')][_0x3fdc66][_0x95f8('0x72')]&&_0x54c949[_0x95f8('0x6f')][_0x3fdc66][_0x95f8('0x73')]){_0x151a18[_0x54c949[_0x95f8('0x6f')][_0x3fdc66][_0x95f8('0x35')]](_0x54c949[_0x95f8('0x6f')][_0x3fdc66][_0x95f8('0x72')],null,util[_0x95f8('0x6b')](_0x95f8('0x74'),_0x54c949[_0x95f8('0x65')],_0x54c949['joins'][_0x3fdc66][_0x95f8('0x71')],_0x54c949[_0x95f8('0x6f')][_0x3fdc66][_0x95f8('0x72')],_0x54c949[_0x95f8('0x6f')][_0x3fdc66][_0x95f8('0x73')]));}}}if(_0x54c949['conditions']){_0x54c949['conditions']=JSON['parse'](_0x54c949[_0x95f8('0x75')]);_0x151a18[_0x95f8('0x31')](_0x28ab2b(_0x54c949[_0x95f8('0x75')]['group']));}_0xcfa325=_0x151a18[_0x95f8('0x76')]();_0x151a18['limit'](_0x4bf373);_0x151a18[_0x95f8('0x13')](0x0);logger[_0x95f8('0x77')](_0x95f8('0x78'),_0x151a18[_0x95f8('0x79')]());return db[_0x95f8('0x7a')][_0x95f8('0x28')](_0x151a18[_0x95f8('0x79')](),{'type':db['sequelize'][_0x95f8('0x7b')][_0x95f8('0x7c')]});}})[_0x95f8('0x1b')](respondWithResult(_0x31b15a,null))[_0x95f8('0x3c')](handleError(_0x31b15a,null));};function runReport(_0x3a365a,_0x8e9d68,_0x187cef){var _0x3ffc35=_0x8e9d68['name'];var _0x339916=0xa;var _0x1941e7=[_0x95f8('0x4b'),_0x95f8('0x4c'),'right_join',_0x95f8('0x4e')];var _0x212afc={'SUM':_0x95f8('0x4f'),'COUNT':_0x95f8('0x7d'),'COUNT DISTINCT':_0x95f8('0x50'),'MAX':_0x95f8('0x51'),'MIN':_0x95f8('0x7e'),'AVG':_0x95f8('0x7f'),'GROUP_CONCAT':_0x95f8('0x52'),'GROUP_CONCAT ASC':_0x95f8('0x53'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3c38c0={'SEC_TO_TIME':_0x95f8('0x55'),'DATE':_0x95f8('0x56'),'HOUR':_0x95f8('0x57'),'ROUND':_0x95f8('0x58'),'UNIX_TIMESTAMP':_0x95f8('0x80')};var _0x3ed615=function(_0x5df5ee){return!_[_0x95f8('0x70')]([_0x95f8('0x59'),_0x95f8('0x81'),'IS\x20EMPTY',_0x95f8('0x82')],_0x5df5ee);};var _0x28be4f=function(_0xc0d3ba){if(!_0xc0d3ba||!_0xc0d3ba['rules'][_0x95f8('0x2d')]){return'';}for(var _0x60c9e0='(',_0x31005f=0x0;_0x31005f<_0xc0d3ba[_0x95f8('0x5a')]['length'];_0x31005f+=0x1){_0x31005f>0x0&&(_0x60c9e0+='\x20'+_0xc0d3ba['operator']+'\x20');_0x60c9e0+=_0xc0d3ba[_0x95f8('0x5a')][_0x31005f][_0x95f8('0x5c')]?_0x28be4f(_0xc0d3ba['rules'][_0x31005f][_0x95f8('0x5c')]):_0xc0d3ba[_0x95f8('0x5a')][_0x31005f][_0x95f8('0x68')]+'\x20'+_0xc0d3ba[_0x95f8('0x5a')][_0x31005f][_0x95f8('0x5d')]+(_0x3ed615(_0xc0d3ba['rules'][_0x31005f]['condition'])?'\x20'+_0xc0d3ba[_0x95f8('0x5a')][_0x31005f][_0x95f8('0x5e')]:'');}return _0x60c9e0+')';};var _0x1c4472={'where':{'id':_0x3a365a['id']}},_0x508095,_0xb7dca1,_0x57dcc4,_0x1495c4,_0xbd9dc1;_0x1c4472=_[_0x95f8('0x3f')]({},_0x1c4472,_0x187cef);return db[_0x95f8('0x24')][_0x95f8('0x40')](_0x1c4472)[_0x95f8('0x1b')](function(_0x385a7b){if(_0x385a7b){_0x508095=_0x385a7b;return _0x385a7b['getFields']();}return null;})[_0x95f8('0x1b')](function(_0xcb6a52){if(_0xcb6a52){if(!_0xcb6a52['length']){throw new db[(_0x95f8('0x60'))]['ValidationErrorItem'](_0x95f8('0x62'),0x193);}_0xb7dca1=_0xcb6a52;return db[_0x95f8('0x63')]['findAll']({'raw':!![]});}return null;})[_0x95f8('0x1b')](function(_0xc7aa21){if(_0xc7aa21){_0x57dcc4=_[_0x95f8('0x83')](_0xc7aa21,'id');var _0x528553;var _0x5cbdb7=squel[_0x95f8('0x84')]();_0x5cbdb7[_0x95f8('0x64')](_0x508095[_0x95f8('0x65')]);for(var _0x112066=0x0;_0x112066<_0xb7dca1[_0x95f8('0x2d')];_0x112066+=0x1){_0x528553=_0xb7dca1[_0x112066][_0x95f8('0x66')]?_0x57dcc4[_0xb7dca1[_0x112066]['MetricId']]['metric']:_0xb7dca1[_0x112066][_0x95f8('0x68')];_0x528553=_0xb7dca1[_0x112066]['function']?_[_0x95f8('0x6a')](_0x212afc[_0xb7dca1[_0x112066][_0x95f8('0x69')]],'%s',_0x528553):_0x528553;_0x528553=_0xb7dca1[_0x112066][_0x95f8('0x6b')]?_[_0x95f8('0x6a')](_0x3c38c0[_0xb7dca1[_0x112066][_0x95f8('0x6b')]],'%s',_0x528553):_0x528553;if(_0xb7dca1[_0x112066][_0x95f8('0x6c')]){_0x5cbdb7[_0x95f8('0x5c')](_0x528553);}_0xb7dca1[_0x112066][_0x95f8('0x6d')]&&_0x5cbdb7['order'](_0x528553,_0xb7dca1[_0x112066][_0x95f8('0x6d')]===_0x95f8('0x85')?![]:!![]);_0x5cbdb7[_0x95f8('0x68')](_0x528553,_0xb7dca1[_0x112066]['alias']||_0x528553);}if(_0x508095[_0x95f8('0x6f')]){_0x508095[_0x95f8('0x6f')]=JSON[_0x95f8('0x86')](_0x508095[_0x95f8('0x6f')]);for(var _0x5dfe25=0x0;_0x5dfe25<_0x508095[_0x95f8('0x6f')]['length'];_0x5dfe25+=0x1){if(_0x508095[_0x95f8('0x6f')][_0x5dfe25]['type']&&_[_0x95f8('0x70')](_0x1941e7,_0x508095[_0x95f8('0x6f')][_0x5dfe25][_0x95f8('0x35')])&&_0x508095[_0x95f8('0x6f')][_0x5dfe25]['parentKey']&&_0x508095[_0x95f8('0x6f')][_0x5dfe25]['foreignTable']&&_0x508095[_0x95f8('0x6f')][_0x5dfe25][_0x95f8('0x73')]){_0x5cbdb7[_0x508095[_0x95f8('0x6f')][_0x5dfe25]['type']](_0x508095['joins'][_0x5dfe25][_0x95f8('0x72')],null,util[_0x95f8('0x6b')](_0x95f8('0x74'),_0x508095[_0x95f8('0x65')],_0x508095[_0x95f8('0x6f')][_0x5dfe25][_0x95f8('0x71')],_0x508095[_0x95f8('0x6f')][_0x5dfe25]['foreignTable'],_0x508095[_0x95f8('0x6f')][_0x5dfe25][_0x95f8('0x73')]));}}}if(_0x508095[_0x95f8('0x75')]){_0x508095[_0x95f8('0x75')]=JSON['parse'](_0x508095[_0x95f8('0x75')]);_0x5cbdb7[_0x95f8('0x31')](_0x28be4f(_0x508095[_0x95f8('0x75')]['group']));}_0xbd9dc1=_0x5cbdb7[_0x95f8('0x76')]();_0x5cbdb7[_0x95f8('0x14')](_0x339916);_0x5cbdb7['offset'](0x0);logger['debug'](_0x95f8('0x78'),_0x5cbdb7[_0x95f8('0x79')]());return db[_0x95f8('0x7a')]['query'](_0x5cbdb7[_0x95f8('0x79')](),{'type':db[_0x95f8('0x7a')][_0x95f8('0x7b')][_0x95f8('0x7c')]});}})[_0x95f8('0x1b')](function(_0xa519da){if(!_0xa519da[_0x95f8('0x2d')]){throw new db[(_0x95f8('0x60'))][(_0x95f8('0x61'))](_0x95f8('0x87'),0xcc);}if(_0x8e9d68['output']===_0x95f8('0x88')){return null;}var _0x4ba3f7=_[_0x95f8('0x3f')](_0x8e9d68,{'name':_0x8e9d68[_0x95f8('0x89')]||_0x8e9d68['name']||_0x508095[_0x95f8('0x22')],'basename':_0x3ffc35,'savename':util[_0x95f8('0x6b')]('%s-%s.%s',_0x8e9d68[_0x95f8('0x22')]||_0x508095[_0x95f8('0x22')],require(_0x95f8('0x8a'))['generate'](0x4),_0x8e9d68[_0x95f8('0x8b')]||_0x95f8('0x8c')),'reportId':_0x508095['id'],'reportType':_0x95f8('0x8d')});return db[_0x95f8('0x8e')][_0x95f8('0x41')](_0x4ba3f7,{'raw':!![]});})[_0x95f8('0x1b')](function(_0x63abed){if(_0x508095[_0x95f8('0x65')]==='cdr'){_0xbd9dc1[_0x95f8('0x31')](_0x508095[_0x95f8('0x65')]+_0x95f8('0x8f'),_0x8e9d68[_0x95f8('0x90')],_0x8e9d68[_0x95f8('0x91')]);}else{_0xbd9dc1['where'](_0x508095[_0x95f8('0x65')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x8e9d68[_0x95f8('0x90')],_0x8e9d68[_0x95f8('0x91')]);}if(_0x63abed){logger['info'](_0x95f8('0x92'),_0xbd9dc1[_0x95f8('0x79')]());require(_0x95f8('0x93'))[_0x95f8('0x94')](path['join'](__dirname,'../../components/export/',_0x63abed[_0x95f8('0x8b')]),[_0x63abed['id'],_0xbd9dc1['toString'](),path['join'](__dirname,_0x95f8('0x95'),_0x63abed[_0x95f8('0x96')]),_0x3ffc35]);return _0x63abed;}else{var _0x551641=squel[_0x95f8('0x84')]();_0x551641[_0x95f8('0x64')]('('+_0xbd9dc1['toString']()+')',_0x95f8('0x97'));_0x551641[_0x95f8('0x68')](_0x95f8('0x98'),_0x95f8('0x39'));_0xbd9dc1[_0x95f8('0x14')](_0x8e9d68[_0x95f8('0x14')]||_0x339916);_0xbd9dc1['offset'](_0x8e9d68[_0x95f8('0x13')]||0x0);return db[_0x95f8('0x7a')]['query'](_0x551641[_0x95f8('0x79')](),{'type':db[_0x95f8('0x7a')][_0x95f8('0x7b')][_0x95f8('0x7c')]})[_0x95f8('0x1b')](function(_0xc76dd6){if(!_0xc76dd6['length']){_0x1495c4=0x0;}else{_0x1495c4=_0xc76dd6[0x0]['count']||0x0;}return db['sequelize'][_0x95f8('0x28')](_0xbd9dc1[_0x95f8('0x79')](),{'type':db[_0x95f8('0x7a')][_0x95f8('0x7b')][_0x95f8('0x7c')]});})[_0x95f8('0x1b')](function(_0x3f6ef0){return{'rows':_0x3f6ef0||[],'count':_0x1495c4};});}});}exports[_0x95f8('0x99')]=function(_0x5623dd,_0x118070){return runReport(_0x5623dd[_0x95f8('0x49')],_0x5623dd['query'],_0x5623dd[_0x95f8('0x38')])['then'](respondWithResult(_0x118070,null))['catch'](handleError(_0x118070,null));};exports['runReport']=runReport;exports[_0x95f8('0x28')]=function(_0x3d1df8,_0xea72fc){var _0x544372=0xa;var _0x59628e=[_0x95f8('0x4b'),_0x95f8('0x4c'),_0x95f8('0x4d'),'cross_join'];var _0x51a231={'SUM':_0x95f8('0x4f'),'COUNT':_0x95f8('0x7d'),'COUNT DISTINCT':_0x95f8('0x50'),'MAX':'MAX(%s)','MIN':_0x95f8('0x7e'),'AVG':_0x95f8('0x7f'),'GROUP_CONCAT':_0x95f8('0x52'),'GROUP_CONCAT ASC':_0x95f8('0x53'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x454067={'SEC_TO_TIME':_0x95f8('0x55'),'DATE':_0x95f8('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x95f8('0x58'),'UNIX_TIMESTAMP':_0x95f8('0x80')};var _0x51b937=function(_0x284bf7){return!_[_0x95f8('0x70')]([_0x95f8('0x59'),_0x95f8('0x81'),'IS\x20EMPTY',_0x95f8('0x82')],_0x284bf7);};var _0x380e24=function(_0x4446e0){if(!_0x4446e0||!_0x4446e0['rules'][_0x95f8('0x2d')]){return'';}for(var _0x5dff6a='(',_0x238ef0=0x0;_0x238ef0<_0x4446e0[_0x95f8('0x5a')][_0x95f8('0x2d')];_0x238ef0+=0x1){_0x238ef0>0x0&&(_0x5dff6a+='\x20'+_0x4446e0[_0x95f8('0x5b')]+'\x20');_0x5dff6a+=_0x4446e0[_0x95f8('0x5a')][_0x238ef0]['group']?_0x380e24(_0x4446e0['rules'][_0x238ef0][_0x95f8('0x5c')]):_0x4446e0[_0x95f8('0x5a')][_0x238ef0][_0x95f8('0x68')]+'\x20'+_0x4446e0[_0x95f8('0x5a')][_0x238ef0]['condition']+(_0x51b937(_0x4446e0[_0x95f8('0x5a')][_0x238ef0]['condition'])?'\x20'+_0x4446e0['rules'][_0x238ef0]['value']:'');}return _0x5dff6a+')';};var _0xd83238={'where':{'id':_0x3d1df8[_0x95f8('0x49')]['id']}},_0x3fca94,_0x3e3aca,_0x5b25d9,_0x31d832,_0x1d284a;_0xd83238=_[_0x95f8('0x3f')]({},_0xd83238,_0x3d1df8['options']);return db['AnalyticDefaultReport'][_0x95f8('0x40')](_0xd83238)['then'](function(_0x263677){if(_0x263677){_0x3fca94=_0x263677;return _0x263677[_0x95f8('0x5f')]();}return null;})[_0x95f8('0x1b')](function(_0x32a783){if(_0x32a783){if(!_0x32a783['length']){throw new db[(_0x95f8('0x60'))][(_0x95f8('0x61'))](_0x95f8('0x62'),0x193);}_0x3e3aca=_0x32a783;return db[_0x95f8('0x63')][_0x95f8('0x3b')]({'raw':!![]});}return null;})[_0x95f8('0x1b')](function(_0x52a0d3){if(_0x52a0d3){_0x5b25d9=_[_0x95f8('0x83')](_0x52a0d3,'id');var _0x53cb25;var _0x5987c5=squel[_0x95f8('0x84')]();_0x5987c5['from'](_0x3fca94['table']);for(var _0x5a1f4d=0x0;_0x5a1f4d<_0x3e3aca[_0x95f8('0x2d')];_0x5a1f4d+=0x1){_0x53cb25=_0x3e3aca[_0x5a1f4d][_0x95f8('0x66')]?_0x5b25d9[_0x3e3aca[_0x5a1f4d][_0x95f8('0x66')]][_0x95f8('0x67')]:_0x3e3aca[_0x5a1f4d]['field'];_0x53cb25=_0x3e3aca[_0x5a1f4d][_0x95f8('0x69')]?_['replace'](_0x51a231[_0x3e3aca[_0x5a1f4d][_0x95f8('0x69')]],'%s',_0x53cb25):_0x53cb25;_0x53cb25=_0x3e3aca[_0x5a1f4d][_0x95f8('0x6b')]?_[_0x95f8('0x6a')](_0x454067[_0x3e3aca[_0x5a1f4d][_0x95f8('0x6b')]],'%s',_0x53cb25):_0x53cb25;if(_0x3e3aca[_0x5a1f4d]['groupBy']){_0x5987c5[_0x95f8('0x5c')](_0x53cb25);}_0x3e3aca[_0x5a1f4d][_0x95f8('0x6d')]&&_0x5987c5[_0x95f8('0x2f')](_0x53cb25,_0x3e3aca[_0x5a1f4d][_0x95f8('0x6d')]===_0x95f8('0x85')?![]:!![]);_0x5987c5[_0x95f8('0x68')](_0x53cb25,_0x3e3aca[_0x5a1f4d]['alias']||_0x53cb25);}if(_0x3fca94[_0x95f8('0x6f')]){_0x3fca94[_0x95f8('0x6f')]=JSON['parse'](_0x3fca94['joins']);for(var _0x10dbbd=0x0;_0x10dbbd<_0x3fca94[_0x95f8('0x6f')][_0x95f8('0x2d')];_0x10dbbd+=0x1){if(_0x3fca94['joins'][_0x10dbbd][_0x95f8('0x35')]&&_[_0x95f8('0x70')](_0x59628e,_0x3fca94[_0x95f8('0x6f')][_0x10dbbd][_0x95f8('0x35')])&&_0x3fca94[_0x95f8('0x6f')][_0x10dbbd]['parentKey']&&_0x3fca94[_0x95f8('0x6f')][_0x10dbbd][_0x95f8('0x72')]&&_0x3fca94[_0x95f8('0x6f')][_0x10dbbd]['foreignKey']){_0x5987c5[_0x3fca94[_0x95f8('0x6f')][_0x10dbbd][_0x95f8('0x35')]](_0x3fca94[_0x95f8('0x6f')][_0x10dbbd][_0x95f8('0x72')],null,util[_0x95f8('0x6b')](_0x95f8('0x74'),_0x3fca94[_0x95f8('0x65')],_0x3fca94['joins'][_0x10dbbd][_0x95f8('0x71')],_0x3fca94['joins'][_0x10dbbd]['foreignTable'],_0x3fca94['joins'][_0x10dbbd][_0x95f8('0x73')]));}}}if(_0x3fca94[_0x95f8('0x75')]){_0x3fca94[_0x95f8('0x75')]=JSON[_0x95f8('0x86')](_0x3fca94['conditions']);_0x5987c5[_0x95f8('0x31')](_0x380e24(_0x3fca94['conditions'][_0x95f8('0x5c')]));}_0x1d284a=_0x5987c5[_0x95f8('0x76')]();_0x5987c5[_0x95f8('0x14')](_0x544372);_0x5987c5['offset'](0x0);logger[_0x95f8('0x77')](_0x95f8('0x78'),_0x5987c5['toString']());return db['sequelize'][_0x95f8('0x28')](_0x5987c5[_0x95f8('0x79')](),{'type':db[_0x95f8('0x7a')][_0x95f8('0x7b')]['SELECT']});}})[_0x95f8('0x1b')](function(){return{'sql':_0x1d284a[_0x95f8('0x79')]()};})[_0x95f8('0x1b')](respondWithResult(_0xea72fc,null))[_0x95f8('0x3c')](handleError(_0xea72fc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 34eb097..d979f93 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 _0xbfbb=['analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./analyticDefaultReport.attributes','define'];(function(_0x5d572c,_0x53581f){var _0x5797cf=function(_0x5dcdd4){while(--_0x5dcdd4){_0x5d572c['push'](_0x5d572c['shift']());}};_0x5797cf(++_0x53581f);}(_0xbfbb,0x10f));var _0xbbfb=function(_0x5ec935,_0x3616fa){_0x5ec935=_0x5ec935-0x0;var _0x42d385=_0xbfbb[_0x5ec935];return _0x42d385;};'use strict';var _=require(_0xbbfb('0x0'));var util=require(_0xbbfb('0x1'));var logger=require(_0xbbfb('0x2'))(_0xbbfb('0x3'));var moment=require(_0xbbfb('0x4'));var BPromise=require('bluebird');var rp=require(_0xbbfb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbfb('0x6'));var config=require('../../config/environment');var attributes=require(_0xbbfb('0x7'));module['exports']=function(_0x216329,_0x161c30){return _0x216329[_0xbbfb('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0xbbfb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1071=['../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x4bd8a3,_0x452c5c){var _0x4eaf3c=function(_0x206ff7){while(--_0x206ff7){_0x4bd8a3['push'](_0x4bd8a3['shift']());}};_0x4eaf3c(++_0x452c5c);}(_0x1071,0x165));var _0x1107=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1071[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x1107('0x0'));var util=require('util');var logger=require(_0x1107('0x1'))(_0x1107('0x2'));var moment=require(_0x1107('0x3'));var BPromise=require(_0x1107('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1107('0x5'));var config=require(_0x1107('0x6'));var attributes=require(_0x1107('0x7'));module['exports']=function(_0x511981,_0x391331){return _0x511981[_0x1107('0x8')](_0x1107('0x9'),attributes,{'tableName':_0x1107('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 c8557fb..276b7e8 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 _0xe706=['http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x38b106,_0x55f4be){var _0x3e89e6=function(_0x46f6fb){while(--_0x46f6fb){_0x38b106['push'](_0x38b106['shift']());}};_0x3e89e6(++_0x55f4be);}(_0xe706,0xa3));var _0x6e70=function(_0xd60cb,_0x25496e){_0xd60cb=_0xd60cb-0x0;var _0x47eecd=_0xe706[_0xd60cb];return _0x47eecd;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
+var _0xbdb7=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x54b749,_0x45913f){_0x54b749=_0x54b749-0x0;var _0x5a1b77=_0xbdb7[_0x54b749];return _0x5a1b77;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index fcacb43..39d120c 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 _0xb3e8=['/:id','isAuthenticated','show','/:id/preview','preview','run','query','post','create','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index'];(function(_0x2744d7,_0xfb0a15){var _0x2ee626=function(_0x29ba4e){while(--_0x29ba4e){_0x2744d7['push'](_0x2744d7['shift']());}};_0x2ee626(++_0xfb0a15);}(_0xb3e8,0x132));var _0x8b3e=function(_0x5105e8,_0x44a2e0){_0x5105e8=_0x5105e8-0x0;var _0x53bbf5=_0xb3e8[_0x5105e8];return _0x53bbf5;};'use strict';var multer=require('multer');var util=require(_0x8b3e('0x0'));var path=require(_0x8b3e('0x1'));var timeout=require(_0x8b3e('0x2'));var express=require(_0x8b3e('0x3'));var router=express[_0x8b3e('0x4')]();var auth=require(_0x8b3e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b3e('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0x8b3e('0x7')]('/',auth['isAuthenticated'](),controller[_0x8b3e('0x8')]);router[_0x8b3e('0x7')](_0x8b3e('0x9'),auth[_0x8b3e('0xa')](),controller[_0x8b3e('0xb')]);router[_0x8b3e('0x7')](_0x8b3e('0xc'),auth[_0x8b3e('0xa')](),controller[_0x8b3e('0xd')]);router[_0x8b3e('0x7')]('/:id/run',auth[_0x8b3e('0xa')](),controller[_0x8b3e('0xe')]);router[_0x8b3e('0x7')]('/:id/query',auth[_0x8b3e('0xa')](),controller[_0x8b3e('0xf')]);router[_0x8b3e('0x10')]('/',auth[_0x8b3e('0xa')](),controller[_0x8b3e('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8b3e('0x12')]);router[_0x8b3e('0x13')](_0x8b3e('0x9'),auth[_0x8b3e('0xa')](),controller['destroy']);module[_0x8b3e('0x14')]=router;
\ No newline at end of file
+var _0x5634=['preview','/:id/query','query','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x5634,0x7c));var _0x4563=function(_0x2b59d8,_0x3a8432){_0x2b59d8=_0x2b59d8-0x0;var _0x36b742=_0x5634[_0x2b59d8];return _0x36b742;};'use strict';var multer=require('multer');var util=require(_0x4563('0x0'));var path=require(_0x4563('0x1'));var timeout=require(_0x4563('0x2'));var express=require(_0x4563('0x3'));var router=express[_0x4563('0x4')]();var auth=require(_0x4563('0x5'));var interaction=require(_0x4563('0x6'));var config=require('../../config/environment');var controller=require(_0x4563('0x7'));router['get']('/',auth[_0x4563('0x8')](),controller[_0x4563('0x9')]);router[_0x4563('0xa')](_0x4563('0xb'),auth['isAuthenticated'](),controller[_0x4563('0xc')]);router[_0x4563('0xa')](_0x4563('0xd'),auth[_0x4563('0x8')](),controller[_0x4563('0xe')]);router[_0x4563('0xa')]('/:id/run',auth[_0x4563('0x8')](),controller['run']);router[_0x4563('0xa')](_0x4563('0xf'),auth[_0x4563('0x8')](),controller[_0x4563('0x10')]);router[_0x4563('0x11')]('/',auth[_0x4563('0x8')](),controller[_0x4563('0x12')]);router[_0x4563('0x13')](_0x4563('0xb'),auth['isAuthenticated'](),controller[_0x4563('0x14')]);router[_0x4563('0x15')](_0x4563('0xb'),auth[_0x4563('0x8')](),controller[_0x4563('0x16')]);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 1071a19..083b085 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 _0x854a=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','Loading','manual','INTEGER'];(function(_0x5a7cbc,_0x573d85){var _0x44d2cc=function(_0x154862){while(--_0x154862){_0x5a7cbc['push'](_0x5a7cbc['shift']());}};_0x44d2cc(++_0x573d85);}(_0x854a,0xd9));var _0xa854=function(_0x55a12e,_0xc59cc6){_0x55a12e=_0x55a12e-0x0;var _0x431e69=_0x854a[_0x55a12e];return _0x431e69;};'use strict';var Sequelize=require(_0xa854('0x0'));var moment=require(_0xa854('0x1'));module[_0xa854('0x2')]={'name':{'type':Sequelize[_0xa854('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xa854('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xa854('0x4')](_0xa854('0x5'),_0xa854('0x6'),_0xa854('0x7')),'allowNull':![],'defaultValue':_0xa854('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xa854('0x3')],'defaultValue':_0xa854('0x8')},'type':{'type':Sequelize[_0xa854('0x4')]('manual','scheduled'),'allowNull':![],'defaultValue':_0xa854('0x9')},'reportId':{'type':Sequelize[_0xa854('0xa')](0xb)[_0xa854('0xb')]},'reportType':{'type':Sequelize[_0xa854('0x3')]}};
\ No newline at end of file
+var _0x060c=['Loading','manual','UNSIGNED','sequelize','exports','STRING','ENUM','csv','DATE'];(function(_0x1588eb,_0x4c24b3){var _0xe81c9d=function(_0xad36bc){while(--_0xad36bc){_0x1588eb['push'](_0x1588eb['shift']());}};_0xe81c9d(++_0x4c24b3);}(_0x060c,0x150));var _0xc060=function(_0x44bbe0,_0x445ef0){_0x44bbe0=_0x44bbe0-0x0;var _0x30ae3c=_0x060c[_0x44bbe0];return _0x30ae3c;};'use strict';var Sequelize=require(_0xc060('0x0'));var moment=require('moment');module[_0xc060('0x1')]={'name':{'type':Sequelize[_0xc060('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xc060('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xc060('0x3')](_0xc060('0x4'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xc060('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xc060('0x5')]},'endDate':{'type':Sequelize[_0xc060('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xc060('0x6')},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0xc060('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xc060('0x8')]},'reportType':{'type':Sequelize[_0xc060('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 9742413..3c96340 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 _0xc0fc=['format','%s.%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','name','index','AnalyticExtractedReport','keys','intersection','query','attributes','model','fields','length','order','sort','where','filters','pick','map','type','key','field','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty'];(function(_0x1ca995,_0x458edc){var _0x6c1cbb=function(_0x109124){while(--_0x109124){_0x1ca995['push'](_0x1ca995['shift']());}};_0x6c1cbb(++_0x458edc);}(_0xc0fc,0x166));var _0xcc0f=function(_0x5226ed,_0x2c5a59){_0x5226ed=_0x5226ed-0x0;var _0x2101b6=_0xc0fc[_0x5226ed];return _0x2101b6;};'use strict';var pdf=require(_0xcc0f('0x0'));var emlformat=require(_0xcc0f('0x1'));var rimraf=require(_0xcc0f('0x2'));var zipdir=require(_0xcc0f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc0f('0x4'));var moment=require(_0xcc0f('0x5'));var BPromise=require(_0xcc0f('0x6'));var Mustache=require(_0xcc0f('0x7'));var util=require('util');var path=require(_0xcc0f('0x8'));var sox=require('sox');var csv=require(_0xcc0f('0x9'));var ejs=require(_0xcc0f('0xa'));var fs=require('fs');var _=require(_0xcc0f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcc0f('0xc'));var deskjs=require(_0xcc0f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcc0f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcc0f('0xf'));var qs=require(_0xcc0f('0x10'));var hardwareService=require(_0xcc0f('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xcc0f('0x12'));var config=require(_0xcc0f('0x13'));var db=require(_0xcc0f('0x14'))['db'];function respondWithStatusCode(_0x567cab,_0x17de05){_0x17de05=_0x17de05||0xcc;return function(_0x20f56a){if(_0x20f56a){return _0x567cab[_0xcc0f('0x15')](_0x17de05);}return _0x567cab['status'](_0x17de05)[_0xcc0f('0x16')]();};}function respondWithResult(_0xd9183e,_0x49739f){_0x49739f=_0x49739f||0xc8;return function(_0xd528ca){if(_0xd528ca){return _0xd9183e['status'](_0x49739f)[_0xcc0f('0x17')](_0xd528ca);}};}function respondWithFilteredResult(_0x128ed6,_0x4530dc){return function(_0x26f830){if(_0x26f830){var _0x822369=_0x26f830[_0xcc0f('0x18')],_0x37ed20=_0x4530dc[_0xcc0f('0x19')],_0xe6d2a4=_0x4530dc[_0xcc0f('0x19')]+_0x4530dc[_0xcc0f('0x1a')],_0x5090d8;if(_0xe6d2a4>=_0x822369){_0xe6d2a4=_0x822369;_0x5090d8=0xc8;}else{_0x5090d8=0xce;}_0x128ed6[_0xcc0f('0x1b')](_0x5090d8);return _0x128ed6[_0xcc0f('0x1c')](_0xcc0f('0x1d'),_0x37ed20+'-'+_0xe6d2a4+'/'+_0x822369)[_0xcc0f('0x17')](_0x26f830);}return null;};}function patchUpdates(_0x2269ad){return function(_0xedfedc){try{jsonpatch[_0xcc0f('0x1e')](_0xedfedc,_0x2269ad,!![]);}catch(_0x50b9bc){return BPromise[_0xcc0f('0x1f')](_0x50b9bc);}return _0xedfedc[_0xcc0f('0x20')]();};}function saveUpdates(_0x4db605,_0x358c87){return function(_0x490ad5){if(_0x490ad5){return _0x490ad5['update'](_0x4db605)[_0xcc0f('0x21')](function(_0x14071d){return _0x14071d;});}return null;};}function removeEntity(_0x3f0643,_0x555f58){return function(_0x427176){if(_0x427176){return _0x427176[_0xcc0f('0x22')]()[_0xcc0f('0x21')](function(){var _0x58104f=_0x427176[_0xcc0f('0x23')]({'plain':!![]});var _0x3d3362=_0xcc0f('0x24');return db[_0xcc0f('0x25')][_0xcc0f('0x22')]({'where':{'type':_0x3d3362,'resourceId':_0x58104f['id']}})[_0xcc0f('0x21')](function(){return _0x427176;});})[_0xcc0f('0x21')](function(){_0x3f0643[_0xcc0f('0x1b')](0xcc)[_0xcc0f('0x16')]();});}};}function handleEntityNotFound(_0x5caef5,_0x446e2b){return function(_0x1022c7){if(!_0x1022c7){_0x5caef5[_0xcc0f('0x15')](0x194);}return _0x1022c7;};}function handleError(_0x164e23,_0x4ddaa0){_0x4ddaa0=_0x4ddaa0||0x1f4;return function(_0x49d1d8){logger[_0xcc0f('0x26')](_0x49d1d8['stack']);if(_0x49d1d8[_0xcc0f('0x27')]){delete _0x49d1d8[_0xcc0f('0x27')];}_0x164e23[_0xcc0f('0x1b')](_0x4ddaa0)['send'](_0x49d1d8);};}exports[_0xcc0f('0x28')]=function(_0x2f23dc,_0x3ac31e){var _0x287cd1={},_0x1e4f3c={},_0x59c36a={'count':0x0,'rows':[]};var _0x399e48=db[_0xcc0f('0x29')]['rawAttributes'];_0x1e4f3c['model']=_[_0xcc0f('0x2a')](_0x399e48);_0x1e4f3c['query']=_[_0xcc0f('0x2a')](_0x2f23dc['query']);_0x1e4f3c['filters']=_[_0xcc0f('0x2b')](_0x1e4f3c['model'],_0x1e4f3c[_0xcc0f('0x2c')]);_0x287cd1[_0xcc0f('0x2d')]=_['intersection'](_0x1e4f3c[_0xcc0f('0x2e')],qs[_0xcc0f('0x2f')](_0x2f23dc[_0xcc0f('0x2c')][_0xcc0f('0x2f')]));_0x287cd1[_0xcc0f('0x2d')]=_0x287cd1['attributes'][_0xcc0f('0x30')]?_0x287cd1[_0xcc0f('0x2d')]:_0x1e4f3c['model'];if(!_0x2f23dc[_0xcc0f('0x2c')]['hasOwnProperty']('nolimit')){_0x287cd1['limit']=qs[_0xcc0f('0x1a')](_0x2f23dc[_0xcc0f('0x2c')][_0xcc0f('0x1a')]);_0x287cd1[_0xcc0f('0x19')]=qs['offset'](_0x2f23dc[_0xcc0f('0x2c')][_0xcc0f('0x19')]);}_0x287cd1[_0xcc0f('0x31')]=qs[_0xcc0f('0x32')](_0x2f23dc[_0xcc0f('0x2c')][_0xcc0f('0x32')]);_0x287cd1[_0xcc0f('0x33')]=qs[_0xcc0f('0x34')](_[_0xcc0f('0x35')](_0x2f23dc[_0xcc0f('0x2c')],_0x1e4f3c[_0xcc0f('0x34')]));if(_0x2f23dc['query']['filter']){_0x287cd1['where']=_['merge'](_0x287cd1[_0xcc0f('0x33')],{'$or':_[_0xcc0f('0x36')](_0x399e48,function(_0x2573bd){if(_0x2573bd[_0xcc0f('0x37')][_0xcc0f('0x38')]!=='VIRTUAL'){var _0x3fc42e={};_0x3fc42e[_0x2573bd[_0xcc0f('0x39')]]={'$like':'%'+_0x2f23dc['query'][_0xcc0f('0x3a')]+'%'};return _0x3fc42e;}})});}_0x287cd1=_[_0xcc0f('0x3b')]({},_0x287cd1,_0x2f23dc[_0xcc0f('0x3c')]);var _0x4b439d={'where':_0x287cd1[_0xcc0f('0x33')]};return db[_0xcc0f('0x29')][_0xcc0f('0x18')](_0x4b439d)[_0xcc0f('0x21')](function(_0x530e25){_0x59c36a[_0xcc0f('0x18')]=_0x530e25;if(_0x2f23dc['query']['includeAll']){_0x287cd1[_0xcc0f('0x3d')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xcc0f('0x3e')](_0x287cd1);})[_0xcc0f('0x21')](function(_0x3a9496){_0x59c36a[_0xcc0f('0x3f')]=_0x3a9496;return _0x59c36a;})['then'](respondWithFilteredResult(_0x3ac31e,_0x287cd1))[_0xcc0f('0x40')](handleError(_0x3ac31e,null));};exports[_0xcc0f('0x41')]=function(_0x3a238d,_0x19c08b){var _0x1d4e33={'raw':!![],'where':{'id':_0x3a238d[_0xcc0f('0x42')]['id']}},_0x25c875={};_0x25c875[_0xcc0f('0x2e')]=_['keys'](db['AnalyticExtractedReport'][_0xcc0f('0x43')]);_0x25c875['query']=_[_0xcc0f('0x2a')](_0x3a238d[_0xcc0f('0x2c')]);_0x25c875[_0xcc0f('0x34')]=_[_0xcc0f('0x2b')](_0x25c875['model'],_0x25c875['query']);_0x1d4e33['attributes']=_[_0xcc0f('0x2b')](_0x25c875['model'],qs['fields'](_0x3a238d[_0xcc0f('0x2c')][_0xcc0f('0x2f')]));_0x1d4e33[_0xcc0f('0x2d')]=_0x1d4e33['attributes'][_0xcc0f('0x30')]?_0x1d4e33[_0xcc0f('0x2d')]:_0x25c875['model'];if(_0x3a238d[_0xcc0f('0x2c')][_0xcc0f('0x44')]){_0x1d4e33['include']=[{'all':!![]}];}_0x1d4e33=_[_0xcc0f('0x3b')]({},_0x1d4e33,_0x3a238d[_0xcc0f('0x3c')]);return db[_0xcc0f('0x29')][_0xcc0f('0x45')](_0x1d4e33)[_0xcc0f('0x21')](handleEntityNotFound(_0x19c08b,null))[_0xcc0f('0x21')](respondWithResult(_0x19c08b,null))['catch'](handleError(_0x19c08b,null));};exports[_0xcc0f('0x46')]=function(_0x48ee28,_0x50519d){return db[_0xcc0f('0x29')][_0xcc0f('0x46')](_0x48ee28[_0xcc0f('0x47')],{})[_0xcc0f('0x21')](function(_0xd7151d){var _0x2f9df5=_0x48ee28['user'][_0xcc0f('0x23')]({'plain':!![]});if(!_0x2f9df5)throw new Error(_0xcc0f('0x48'));if(_0x2f9df5['role']==='user'){var _0x222cc9=_0xd7151d[_0xcc0f('0x23')]({'plain':!![]});var _0x5443f3=_0xcc0f('0x24');return db['UserProfileSection'][_0xcc0f('0x45')]({'where':{'name':_0x5443f3,'userProfileId':_0x2f9df5[_0xcc0f('0x49')]},'raw':!![]})[_0xcc0f('0x21')](function(_0x532f3f){if(_0x532f3f&&_0x532f3f[_0xcc0f('0x4a')]===0x0){return db[_0xcc0f('0x25')][_0xcc0f('0x46')]({'name':_0x222cc9['name'],'resourceId':_0x222cc9['id'],'type':_0x532f3f[_0xcc0f('0x27')],'sectionId':_0x532f3f['id']},{})[_0xcc0f('0x21')](function(){return _0xd7151d;});}else{return _0xd7151d;}})[_0xcc0f('0x40')](function(_0x24647b){logger[_0xcc0f('0x26')](_0xcc0f('0x4b'),_0x24647b);throw _0x24647b;});}return _0xd7151d;})['then'](respondWithResult(_0x50519d,0xc9))['catch'](handleError(_0x50519d,null));};exports['update']=function(_0x520502,_0x3f01d8){if(_0x520502[_0xcc0f('0x47')]['id']){delete _0x520502[_0xcc0f('0x47')]['id'];}return db[_0xcc0f('0x29')][_0xcc0f('0x45')]({'where':{'id':_0x520502[_0xcc0f('0x42')]['id']}})[_0xcc0f('0x21')](handleEntityNotFound(_0x3f01d8,null))[_0xcc0f('0x21')](saveUpdates(_0x520502[_0xcc0f('0x47')],null))[_0xcc0f('0x21')](respondWithResult(_0x3f01d8,null))[_0xcc0f('0x40')](handleError(_0x3f01d8,null));};exports[_0xcc0f('0x22')]=function(_0xd69659,_0x485a4f){return db['AnalyticExtractedReport'][_0xcc0f('0x45')]({'where':{'id':_0xd69659[_0xcc0f('0x42')]['id']}})[_0xcc0f('0x21')](handleEntityNotFound(_0x485a4f,null))['then'](removeEntity(_0x485a4f,null))[_0xcc0f('0x40')](handleError(_0x485a4f,null));};exports[_0xcc0f('0x4c')]=function(_0xe8d215,_0x2031eb,_0x119a00){return db['AnalyticExtractedReport'][_0xcc0f('0x45')]({'where':{'id':_0xe8d215[_0xcc0f('0x42')]['id']},'attributes':[_0xcc0f('0x27'),_0xcc0f('0x4d'),'savename',_0xcc0f('0x4e')],'raw':!![]})[_0xcc0f('0x21')](handleEntityNotFound(_0x2031eb,null))[_0xcc0f('0x21')](function(_0x5630ed){if(_0x5630ed){if(!fs[_0xcc0f('0x4f')](path[_0xcc0f('0x50')](config[_0xcc0f('0x51')],_0xcc0f('0x52'),_0x5630ed[_0xcc0f('0x53')]))){throw new db[(_0xcc0f('0x54'))][(_0xcc0f('0x55'))](_0xcc0f('0x56'));}if(_0xe8d215[_0xcc0f('0x2c')]['exists']){return _0x2031eb[_0xcc0f('0x15')](0xc8);}return _0x2031eb['download'](path[_0xcc0f('0x50')](config['root'],_0xcc0f('0x52'),_0x5630ed[_0xcc0f('0x53')]),util[_0xcc0f('0x57')](_0xcc0f('0x58'),_0x5630ed[_0xcc0f('0x4d')]||_0x5630ed[_0xcc0f('0x27')],_0x5630ed[_0xcc0f('0x4e')]['toLowerCase']()));}})['catch'](handleError(_0x2031eb,null));};
\ No newline at end of file
+var _0x7b14=['util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','AnalyticExtractedReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x42dcbf,_0x43c17b){var _0x445458=function(_0x51064f){while(--_0x51064f){_0x42dcbf['push'](_0x42dcbf['shift']());}};_0x445458(++_0x43c17b);}(_0x7b14,0x1c7));var _0x47b1=function(_0x48fe28,_0x1f764e){_0x48fe28=_0x48fe28-0x0;var _0x1433c3=_0x7b14[_0x48fe28];return _0x1433c3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x47b1('0x0'));var rimraf=require(_0x47b1('0x1'));var zipdir=require(_0x47b1('0x2'));var jsonpatch=require(_0x47b1('0x3'));var rp=require(_0x47b1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x47b1('0x5'));var path=require(_0x47b1('0x6'));var sox=require('sox');var csv=require(_0x47b1('0x7'));var ejs=require(_0x47b1('0x8'));var fs=require('fs');var _=require(_0x47b1('0x9'));var squel=require(_0x47b1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x47b1('0xb'));var toCsv=require(_0x47b1('0x7'));var querystring=require('querystring');var Papa=require(_0x47b1('0xc'));var Redis=require(_0x47b1('0xd'));var authService=require(_0x47b1('0xe'));var qs=require(_0x47b1('0xf'));var hardwareService=require(_0x47b1('0x10'));var logger=require(_0x47b1('0x11'))('api');var utils=require(_0x47b1('0x12'));var config=require(_0x47b1('0x13'));var db=require(_0x47b1('0x14'))['db'];function respondWithStatusCode(_0x1fb703,_0xbe006){_0xbe006=_0xbe006||0xcc;return function(_0x209184){if(_0x209184){return _0x1fb703[_0x47b1('0x15')](_0xbe006);}return _0x1fb703['status'](_0xbe006)[_0x47b1('0x16')]();};}function respondWithResult(_0x5c9ed4,_0x11a834){_0x11a834=_0x11a834||0xc8;return function(_0x1724bd){if(_0x1724bd){return _0x5c9ed4[_0x47b1('0x17')](_0x11a834)[_0x47b1('0x18')](_0x1724bd);}};}function respondWithFilteredResult(_0x597658,_0x3a0f4a){return function(_0x1920f2){if(_0x1920f2){var _0x4a2c4f=_0x1920f2[_0x47b1('0x19')],_0x3062cb=_0x3a0f4a['offset'],_0x53051d=_0x3a0f4a[_0x47b1('0x1a')]+_0x3a0f4a[_0x47b1('0x1b')],_0x55cefd;if(_0x53051d>=_0x4a2c4f){_0x53051d=_0x4a2c4f;_0x55cefd=0xc8;}else{_0x55cefd=0xce;}_0x597658['status'](_0x55cefd);return _0x597658[_0x47b1('0x1c')]('Content-Range',_0x3062cb+'-'+_0x53051d+'/'+_0x4a2c4f)[_0x47b1('0x18')](_0x1920f2);}return null;};}function patchUpdates(_0x3633d0){return function(_0x285858){try{jsonpatch[_0x47b1('0x1d')](_0x285858,_0x3633d0,!![]);}catch(_0x242ae0){return BPromise[_0x47b1('0x1e')](_0x242ae0);}return _0x285858[_0x47b1('0x1f')]();};}function saveUpdates(_0x4a82a9,_0x13ce89){return function(_0x5f5de6){if(_0x5f5de6){return _0x5f5de6[_0x47b1('0x20')](_0x4a82a9)[_0x47b1('0x21')](function(_0x40ddaa){return _0x40ddaa;});}return null;};}function removeEntity(_0x298e51,_0x141499){return function(_0x5b5c6e){if(_0x5b5c6e){return _0x5b5c6e['destroy']()[_0x47b1('0x21')](function(){var _0x47ffde=_0x5b5c6e[_0x47b1('0x22')]({'plain':!![]});var _0xad3c28=_0x47b1('0x23');return db[_0x47b1('0x24')][_0x47b1('0x25')]({'where':{'type':_0xad3c28,'resourceId':_0x47ffde['id']}})[_0x47b1('0x21')](function(){return _0x5b5c6e;});})[_0x47b1('0x21')](function(){_0x298e51['status'](0xcc)[_0x47b1('0x16')]();});}};}function handleEntityNotFound(_0x4c9b2b,_0x5af697){return function(_0x4dc78e){if(!_0x4dc78e){_0x4c9b2b['sendStatus'](0x194);}return _0x4dc78e;};}function handleError(_0x753416,_0x870ebd){_0x870ebd=_0x870ebd||0x1f4;return function(_0x42e757){logger['error'](_0x42e757[_0x47b1('0x26')]);if(_0x42e757[_0x47b1('0x27')]){delete _0x42e757[_0x47b1('0x27')];}_0x753416[_0x47b1('0x17')](_0x870ebd)[_0x47b1('0x28')](_0x42e757);};}exports[_0x47b1('0x29')]=function(_0x47d605,_0x2ce697){var _0x25f2c7={},_0x3dc6fa={},_0x14011e={'count':0x0,'rows':[]};var _0x74c0ac=db[_0x47b1('0x2a')][_0x47b1('0x2b')];_0x3dc6fa[_0x47b1('0x2c')]=_[_0x47b1('0x2d')](_0x74c0ac);_0x3dc6fa[_0x47b1('0x2e')]=_[_0x47b1('0x2d')](_0x47d605[_0x47b1('0x2e')]);_0x3dc6fa[_0x47b1('0x2f')]=_[_0x47b1('0x30')](_0x3dc6fa[_0x47b1('0x2c')],_0x3dc6fa[_0x47b1('0x2e')]);_0x25f2c7[_0x47b1('0x31')]=_[_0x47b1('0x30')](_0x3dc6fa[_0x47b1('0x2c')],qs[_0x47b1('0x32')](_0x47d605[_0x47b1('0x2e')][_0x47b1('0x32')]));_0x25f2c7[_0x47b1('0x31')]=_0x25f2c7[_0x47b1('0x31')]['length']?_0x25f2c7['attributes']:_0x3dc6fa[_0x47b1('0x2c')];if(!_0x47d605[_0x47b1('0x2e')][_0x47b1('0x33')](_0x47b1('0x34'))){_0x25f2c7['limit']=qs[_0x47b1('0x1b')](_0x47d605[_0x47b1('0x2e')][_0x47b1('0x1b')]);_0x25f2c7[_0x47b1('0x1a')]=qs['offset'](_0x47d605[_0x47b1('0x2e')][_0x47b1('0x1a')]);}_0x25f2c7[_0x47b1('0x35')]=qs[_0x47b1('0x36')](_0x47d605['query'][_0x47b1('0x36')]);_0x25f2c7[_0x47b1('0x37')]=qs[_0x47b1('0x2f')](_[_0x47b1('0x38')](_0x47d605[_0x47b1('0x2e')],_0x3dc6fa[_0x47b1('0x2f')]));if(_0x47d605[_0x47b1('0x2e')][_0x47b1('0x39')]){_0x25f2c7[_0x47b1('0x37')]=_[_0x47b1('0x3a')](_0x25f2c7[_0x47b1('0x37')],{'$or':_[_0x47b1('0x3b')](_0x74c0ac,function(_0x31e4b2){if(_0x31e4b2['type'][_0x47b1('0x3c')]!=='VIRTUAL'){var _0x1b9e1e={};_0x1b9e1e[_0x31e4b2['field']]={'$like':'%'+_0x47d605[_0x47b1('0x2e')]['filter']+'%'};return _0x1b9e1e;}})});}_0x25f2c7=_[_0x47b1('0x3a')]({},_0x25f2c7,_0x47d605[_0x47b1('0x3d')]);var _0x4062ac={'where':_0x25f2c7[_0x47b1('0x37')]};return db[_0x47b1('0x2a')][_0x47b1('0x19')](_0x4062ac)[_0x47b1('0x21')](function(_0x23e4b6){_0x14011e['count']=_0x23e4b6;if(_0x47d605[_0x47b1('0x2e')][_0x47b1('0x3e')]){_0x25f2c7['include']=[{'all':!![]}];}return db[_0x47b1('0x2a')][_0x47b1('0x3f')](_0x25f2c7);})['then'](function(_0x11483f){_0x14011e[_0x47b1('0x40')]=_0x11483f;return _0x14011e;})['then'](respondWithFilteredResult(_0x2ce697,_0x25f2c7))[_0x47b1('0x41')](handleError(_0x2ce697,null));};exports[_0x47b1('0x42')]=function(_0x128a70,_0x5ca195){var _0x3a4ded={'raw':!![],'where':{'id':_0x128a70[_0x47b1('0x43')]['id']}},_0xd5d5ba={};_0xd5d5ba[_0x47b1('0x2c')]=_[_0x47b1('0x2d')](db['AnalyticExtractedReport'][_0x47b1('0x2b')]);_0xd5d5ba[_0x47b1('0x2e')]=_[_0x47b1('0x2d')](_0x128a70[_0x47b1('0x2e')]);_0xd5d5ba[_0x47b1('0x2f')]=_[_0x47b1('0x30')](_0xd5d5ba[_0x47b1('0x2c')],_0xd5d5ba['query']);_0x3a4ded['attributes']=_[_0x47b1('0x30')](_0xd5d5ba['model'],qs[_0x47b1('0x32')](_0x128a70[_0x47b1('0x2e')][_0x47b1('0x32')]));_0x3a4ded['attributes']=_0x3a4ded[_0x47b1('0x31')][_0x47b1('0x44')]?_0x3a4ded[_0x47b1('0x31')]:_0xd5d5ba[_0x47b1('0x2c')];if(_0x128a70[_0x47b1('0x2e')][_0x47b1('0x3e')]){_0x3a4ded[_0x47b1('0x45')]=[{'all':!![]}];}_0x3a4ded=_[_0x47b1('0x3a')]({},_0x3a4ded,_0x128a70['options']);return db[_0x47b1('0x2a')][_0x47b1('0x46')](_0x3a4ded)[_0x47b1('0x21')](handleEntityNotFound(_0x5ca195,null))[_0x47b1('0x21')](respondWithResult(_0x5ca195,null))[_0x47b1('0x41')](handleError(_0x5ca195,null));};exports[_0x47b1('0x47')]=function(_0x1cda7a,_0x395e6d){return db[_0x47b1('0x2a')][_0x47b1('0x47')](_0x1cda7a[_0x47b1('0x48')],{})[_0x47b1('0x21')](function(_0x19a0e6){var _0x2ccf9e=_0x1cda7a[_0x47b1('0x49')][_0x47b1('0x22')]({'plain':!![]});if(!_0x2ccf9e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ccf9e[_0x47b1('0x4a')]===_0x47b1('0x49')){var _0x37b13b=_0x19a0e6[_0x47b1('0x22')]({'plain':!![]});var _0x361113=_0x47b1('0x23');return db[_0x47b1('0x4b')]['find']({'where':{'name':_0x361113,'userProfileId':_0x2ccf9e['userProfileId']},'raw':!![]})[_0x47b1('0x21')](function(_0x46e44c){if(_0x46e44c&&_0x46e44c['autoAssociation']===0x0){return db[_0x47b1('0x24')][_0x47b1('0x47')]({'name':_0x37b13b[_0x47b1('0x27')],'resourceId':_0x37b13b['id'],'type':_0x46e44c[_0x47b1('0x27')],'sectionId':_0x46e44c['id']},{})[_0x47b1('0x21')](function(){return _0x19a0e6;});}else{return _0x19a0e6;}})[_0x47b1('0x41')](function(_0x17482a){logger[_0x47b1('0x4c')](_0x47b1('0x4d'),_0x17482a);throw _0x17482a;});}return _0x19a0e6;})[_0x47b1('0x21')](respondWithResult(_0x395e6d,0xc9))[_0x47b1('0x41')](handleError(_0x395e6d,null));};exports[_0x47b1('0x20')]=function(_0x457cc2,_0x4aa1cd){if(_0x457cc2[_0x47b1('0x48')]['id']){delete _0x457cc2[_0x47b1('0x48')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x457cc2['params']['id']}})[_0x47b1('0x21')](handleEntityNotFound(_0x4aa1cd,null))['then'](saveUpdates(_0x457cc2[_0x47b1('0x48')],null))[_0x47b1('0x21')](respondWithResult(_0x4aa1cd,null))[_0x47b1('0x41')](handleError(_0x4aa1cd,null));};exports[_0x47b1('0x25')]=function(_0x4e5061,_0x1df229){return db[_0x47b1('0x2a')][_0x47b1('0x46')]({'where':{'id':_0x4e5061['params']['id']}})['then'](handleEntityNotFound(_0x1df229,null))[_0x47b1('0x21')](removeEntity(_0x1df229,null))[_0x47b1('0x41')](handleError(_0x1df229,null));};exports[_0x47b1('0x4e')]=function(_0x9b3ca2,_0x1c0c88,_0x31d682){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x9b3ca2[_0x47b1('0x43')]['id']},'attributes':[_0x47b1('0x27'),_0x47b1('0x4f'),_0x47b1('0x50'),_0x47b1('0x51')],'raw':!![]})[_0x47b1('0x21')](handleEntityNotFound(_0x1c0c88,null))['then'](function(_0xf7db82){if(_0xf7db82){if(!fs[_0x47b1('0x52')](path[_0x47b1('0x53')](config[_0x47b1('0x54')],_0x47b1('0x55'),_0xf7db82['savename']))){throw new db['Sequelize'][(_0x47b1('0x56'))](_0x47b1('0x57'));}if(_0x9b3ca2[_0x47b1('0x2e')][_0x47b1('0x58')]){return _0x1c0c88['sendStatus'](0xc8);}return _0x1c0c88[_0x47b1('0x4e')](path[_0x47b1('0x53')](config['root'],_0x47b1('0x55'),_0xf7db82[_0x47b1('0x50')]),util[_0x47b1('0x59')](_0x47b1('0x5a'),_0xf7db82[_0x47b1('0x4f')]||_0xf7db82[_0x47b1('0x27')],_0xf7db82[_0x47b1('0x51')][_0x47b1('0x5b')]()));}})[_0x47b1('0x41')](handleError(_0x1c0c88,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 9dd1e14..d73122f 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 _0x5089=['exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x241b92,_0x1526dd){var _0x575bb4=function(_0xf8e35d){while(--_0xf8e35d){_0x241b92['push'](_0x241b92['shift']());}};_0x575bb4(++_0x1526dd);}(_0x5089,0x1bb));var _0x9508=function(_0x44b346,_0xeb097d){_0x44b346=_0x44b346-0x0;var _0x1c2f2b=_0x5089[_0x44b346];return _0x1c2f2b;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var logger=require('../../config/logger')(_0x9508('0x2'));var moment=require(_0x9508('0x3'));var BPromise=require(_0x9508('0x4'));var rp=require(_0x9508('0x5'));var fs=require('fs');var path=require(_0x9508('0x6'));var rimraf=require('rimraf');var config=require(_0x9508('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x9508('0x8')]=function(_0x4538dd,_0x257318){return _0x4538dd['define'](_0x9508('0x9'),attributes,{'tableName':_0x9508('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb458=['path','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x4020c2,_0x2f3163){var _0x83ea6d=function(_0x5c3d4c){while(--_0x5c3d4c){_0x4020c2['push'](_0x4020c2['shift']());}};_0x83ea6d(++_0x2f3163);}(_0xb458,0x103));var _0x8b45=function(_0xc71f27,_0x1c9acc){_0xc71f27=_0xc71f27-0x0;var _0x737ed1=_0xb458[_0xc71f27];return _0x737ed1;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require(_0x8b45('0x4'));var fs=require('fs');var path=require(_0x8b45('0x5'));var rimraf=require(_0x8b45('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b45('0x7'));module['exports']=function(_0x5cc2d5,_0xe8d774){return _0x5cc2d5[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 85aa554..ab53a9c 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 _0x25db=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x25db,0x137));var _0xb25d=function(_0x3aa395,_0x5c8396){_0x3aa395=_0x3aa395-0x0;var _0x5eb46b=_0x25db[_0x3aa395];return _0x5eb46b;};'use strict';var _=require(_0xb25d('0x0'));var util=require(_0xb25d('0x1'));var moment=require(_0xb25d('0x2'));var BPromise=require(_0xb25d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb25d('0x4'));var db=require(_0xb25d('0x5'))['db'];var utils=require(_0xb25d('0x6'));var logger=require(_0xb25d('0x7'))(_0xb25d('0x8'));var config=require(_0xb25d('0x9'));var jayson=require(_0xb25d('0xa'));var client=jayson[_0xb25d('0xb')][_0xb25d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b5d91,_0x433d53,_0x5b26de){return new BPromise(function(_0x4051bc,_0x32f6cb){return client[_0xb25d('0xd')](_0x4b5d91,_0x5b26de)[_0xb25d('0xe')](function(_0xb53a6d){logger[_0xb25d('0xf')](_0xb25d('0x10'),_0x433d53,_0xb25d('0x11'));logger[_0xb25d('0x12')](_0xb25d('0x13'),_0x433d53,_0xb25d('0x11'),JSON[_0xb25d('0x14')](_0xb53a6d));if(_0xb53a6d[_0xb25d('0x15')]){if(_0xb53a6d['error']['code']===0x1f4){logger[_0xb25d('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x433d53,_0xb53a6d['error'][_0xb25d('0x16')]);return _0x32f6cb(_0xb53a6d[_0xb25d('0x15')][_0xb25d('0x16')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x433d53,_0xb53a6d[_0xb25d('0x15')]['message']);return _0x4051bc(_0xb53a6d[_0xb25d('0x15')][_0xb25d('0x16')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x433d53,_0xb25d('0x11'));_0x4051bc(_0xb53a6d[_0xb25d('0x17')][_0xb25d('0x16')]);}})['catch'](function(_0x3af20e){logger[_0xb25d('0x15')](_0xb25d('0x10'),_0x433d53,_0x3af20e);_0x32f6cb(_0x3af20e);});});}
\ No newline at end of file
+var _0xf5d0=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring'];(function(_0x47d0c3,_0x9bac25){var _0x28c00b=function(_0x547d11){while(--_0x547d11){_0x47d0c3['push'](_0x47d0c3['shift']());}};_0x28c00b(++_0x9bac25);}(_0xf5d0,0xc4));var _0x0f5d=function(_0x4a65fe,_0x54ef4b){_0x4a65fe=_0x4a65fe-0x0;var _0x325068=_0xf5d0[_0x4a65fe];return _0x325068;};'use strict';var _=require('lodash');var util=require(_0x0f5d('0x0'));var moment=require(_0x0f5d('0x1'));var BPromise=require(_0x0f5d('0x2'));var rs=require(_0x0f5d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f5d('0x4'))['db'];var utils=require(_0x0f5d('0x5'));var logger=require(_0x0f5d('0x6'))('rpc');var config=require(_0x0f5d('0x7'));var jayson=require(_0x0f5d('0x8'));var client=jayson[_0x0f5d('0x9')][_0x0f5d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x60b580,_0x59bfec,_0x13f62a){return new BPromise(function(_0x621884,_0xbc4e36){return client[_0x0f5d('0xb')](_0x60b580,_0x13f62a)[_0x0f5d('0xc')](function(_0x2b9a76){logger[_0x0f5d('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x59bfec,_0x0f5d('0xe'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x59bfec,_0x0f5d('0xe'),JSON['stringify'](_0x2b9a76));if(_0x2b9a76[_0x0f5d('0xf')]){if(_0x2b9a76[_0x0f5d('0xf')][_0x0f5d('0x10')]===0x1f4){logger['error'](_0x0f5d('0x11'),_0x59bfec,_0x2b9a76[_0x0f5d('0xf')][_0x0f5d('0x12')]);return _0xbc4e36(_0x2b9a76[_0x0f5d('0xf')][_0x0f5d('0x12')]);}logger[_0x0f5d('0xf')](_0x0f5d('0x11'),_0x59bfec,_0x2b9a76[_0x0f5d('0xf')][_0x0f5d('0x12')]);return _0x621884(_0x2b9a76['error']['message']);}else{logger[_0x0f5d('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x59bfec,'request\x20sent');_0x621884(_0x2b9a76[_0x0f5d('0x13')][_0x0f5d('0x12')]);}})['catch'](function(_0x5ab35e){logger[_0x0f5d('0xf')](_0x0f5d('0x11'),_0x59bfec,_0x5ab35e);_0xbc4e36(_0x5ab35e);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index c10cae6..c5394a9 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 _0x52f6=['../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','post','put','update','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x52f6,0xbb));var _0x652f=function(_0xe386b0,_0x458c4d){_0xe386b0=_0xe386b0-0x0;var _0x2906d5=_0x52f6[_0xe386b0];return _0x2906d5;};'use strict';var multer=require('multer');var util=require(_0x652f('0x0'));var path=require('path');var timeout=require(_0x652f('0x1'));var express=require('express');var router=express[_0x652f('0x2')]();var auth=require(_0x652f('0x3'));var interaction=require(_0x652f('0x4'));var config=require(_0x652f('0x5'));var controller=require(_0x652f('0x6'));router[_0x652f('0x7')]('/',auth['isAuthenticated'](),controller[_0x652f('0x8')]);router[_0x652f('0x7')](_0x652f('0x9'),auth[_0x652f('0xa')](),controller['show']);router['get'](_0x652f('0xb'),auth[_0x652f('0xa')](),controller['download']);router[_0x652f('0xc')]('/',auth[_0x652f('0xa')](),controller['create']);router[_0x652f('0xd')]('/:id',auth[_0x652f('0xa')](),controller[_0x652f('0xe')]);router['delete'](_0x652f('0x9'),auth[_0x652f('0xa')](),controller['destroy']);module[_0x652f('0xf')]=router;
\ No newline at end of file
+var _0xcb4d=['delete','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','create','update'];(function(_0x11d840,_0x2a271c){var _0x500fa3=function(_0x50b1fd){while(--_0x50b1fd){_0x11d840['push'](_0x11d840['shift']());}};_0x500fa3(++_0x2a271c);}(_0xcb4d,0x169));var _0xdcb4=function(_0x54eefb,_0x48715e){_0x54eefb=_0x54eefb-0x0;var _0x3c3d9e=_0xcb4d[_0x54eefb];return _0x3c3d9e;};'use strict';var multer=require('multer');var util=require(_0xdcb4('0x0'));var path=require('path');var timeout=require(_0xdcb4('0x1'));var express=require('express');var router=express[_0xdcb4('0x2')]();var auth=require(_0xdcb4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xdcb4('0x4'));var controller=require(_0xdcb4('0x5'));router[_0xdcb4('0x6')]('/',auth[_0xdcb4('0x7')](),controller[_0xdcb4('0x8')]);router[_0xdcb4('0x6')](_0xdcb4('0x9'),auth[_0xdcb4('0x7')](),controller[_0xdcb4('0xa')]);router['get']('/:id/download',auth[_0xdcb4('0x7')](),controller[_0xdcb4('0xb')]);router['post']('/',auth[_0xdcb4('0x7')](),controller[_0xdcb4('0xc')]);router['put'](_0xdcb4('0x9'),auth[_0xdcb4('0x7')](),controller[_0xdcb4('0xd')]);router[_0xdcb4('0xe')](_0xdcb4('0x9'),auth[_0xdcb4('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index c4f666b..97315ab 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 _0x32d4=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0xcd7990,_0x570a18){var _0x2b9cfa=function(_0x231aa2){while(--_0x231aa2){_0xcd7990['push'](_0xcd7990['shift']());}};_0x2b9cfa(++_0x570a18);}(_0x32d4,0x94));var _0x432d=function(_0x23ec4c,_0x3cde1e){_0x23ec4c=_0x23ec4c-0x0;var _0x3b58be=_0x32d4[_0x23ec4c];return _0x3b58be;};'use strict';var Sequelize=require(_0x432d('0x0'));module[_0x432d('0x1')]={'field':{'type':Sequelize[_0x432d('0x2')]},'alias':{'type':Sequelize[_0x432d('0x3')]},'function':{'type':Sequelize[_0x432d('0x3')]},'format':{'type':Sequelize[_0x432d('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x432d('0x3')]},'custom':{'type':Sequelize[_0x432d('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9674=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x57d0bb,_0x3f66e1){var _0x3be34f=function(_0x275db8){while(--_0x275db8){_0x57d0bb['push'](_0x57d0bb['shift']());}};_0x3be34f(++_0x3f66e1);}(_0x9674,0xd7));var _0x4967=function(_0x218e99,_0x4a364f){_0x218e99=_0x218e99-0x0;var _0x47da41=_0x9674[_0x218e99];return _0x47da41;};'use strict';var Sequelize=require(_0x4967('0x0'));module[_0x4967('0x1')]={'field':{'type':Sequelize[_0x4967('0x2')]},'alias':{'type':Sequelize[_0x4967('0x3')]},'function':{'type':Sequelize[_0x4967('0x3')]},'format':{'type':Sequelize[_0x4967('0x3')]},'groupBy':{'type':Sequelize[_0x4967('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x4967('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index b2a435d..ca3faef 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 _0xc697=['moment','bluebird','mustache','util','path','ejs','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','AnalyticFieldReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','bulkCreate','bulkDestroy','ids','addFields','transaction','html-pdf','eml-format','zip-dir'];(function(_0x5d1979,_0xb99287){var _0x15d253=function(_0x35b0ec){while(--_0x35b0ec){_0x5d1979['push'](_0x5d1979['shift']());}};_0x15d253(++_0xb99287);}(_0xc697,0x8b));var _0x7c69=function(_0x1cce40,_0x2773c1){_0x1cce40=_0x1cce40-0x0;var _0x444893=_0xc697[_0x1cce40];return _0x444893;};'use strict';var pdf=require(_0x7c69('0x0'));var emlformat=require(_0x7c69('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7c69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7c69('0x3'));var BPromise=require(_0x7c69('0x4'));var Mustache=require(_0x7c69('0x5'));var util=require(_0x7c69('0x6'));var path=require(_0x7c69('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7c69('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7c69('0x9'));var crypto=require('crypto');var jsforce=require(_0x7c69('0xa'));var deskjs=require(_0x7c69('0xb'));var toCsv=require(_0x7c69('0xc'));var querystring=require(_0x7c69('0xd'));var Papa=require('papaparse');var Redis=require(_0x7c69('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7c69('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7c69('0x10'));var config=require(_0x7c69('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ce04e,_0x30a8a2){_0x30a8a2=_0x30a8a2||0xcc;return function(_0x4e5c30){if(_0x4e5c30){return _0x3ce04e['sendStatus'](_0x30a8a2);}return _0x3ce04e[_0x7c69('0x12')](_0x30a8a2)[_0x7c69('0x13')]();};}function respondWithResult(_0x4b7b17,_0x4e21f9){_0x4e21f9=_0x4e21f9||0xc8;return function(_0x1b2f8d){if(_0x1b2f8d){return _0x4b7b17['status'](_0x4e21f9)[_0x7c69('0x14')](_0x1b2f8d);}};}function respondWithFilteredResult(_0xe4e023,_0xb8e6a6){return function(_0x53c8ef){if(_0x53c8ef){var _0x3619ea=_0x53c8ef[_0x7c69('0x15')],_0x1cd521=_0xb8e6a6[_0x7c69('0x16')],_0x3ab397=_0xb8e6a6[_0x7c69('0x16')]+_0xb8e6a6[_0x7c69('0x17')],_0xf9f914;if(_0x3ab397>=_0x3619ea){_0x3ab397=_0x3619ea;_0xf9f914=0xc8;}else{_0xf9f914=0xce;}_0xe4e023[_0x7c69('0x12')](_0xf9f914);return _0xe4e023[_0x7c69('0x18')](_0x7c69('0x19'),_0x1cd521+'-'+_0x3ab397+'/'+_0x3619ea)['json'](_0x53c8ef);}return null;};}function patchUpdates(_0x547b85){return function(_0x5444a0){try{jsonpatch[_0x7c69('0x1a')](_0x5444a0,_0x547b85,!![]);}catch(_0x295e18){return BPromise[_0x7c69('0x1b')](_0x295e18);}return _0x5444a0[_0x7c69('0x1c')]();};}function saveUpdates(_0xef2024,_0x5d2f62){return function(_0x4fdfe0){if(_0x4fdfe0){return _0x4fdfe0[_0x7c69('0x1d')](_0xef2024)[_0x7c69('0x1e')](function(_0x24e037){return _0x24e037;});}return null;};}function removeEntity(_0x2a4ae5,_0x18c00b){return function(_0x48b62d){if(_0x48b62d){return _0x48b62d[_0x7c69('0x1f')]()['then'](function(){_0x2a4ae5['status'](0xcc)[_0x7c69('0x13')]();});}};}function handleEntityNotFound(_0x2087ca,_0x39e4c6){return function(_0x477921){if(!_0x477921){_0x2087ca[_0x7c69('0x20')](0x194);}return _0x477921;};}function handleError(_0x29033d,_0x202983){_0x202983=_0x202983||0x1f4;return function(_0x5433b0){logger[_0x7c69('0x21')](_0x5433b0[_0x7c69('0x22')]);if(_0x5433b0[_0x7c69('0x23')]){delete _0x5433b0[_0x7c69('0x23')];}_0x29033d[_0x7c69('0x12')](_0x202983)['send'](_0x5433b0);};}exports['index']=function(_0x2b069b,_0x57a542){var _0x336857={},_0x3e37c6={},_0x283061={'count':0x0,'rows':[]};var _0x1ceca6=db[_0x7c69('0x24')][_0x7c69('0x25')];_0x3e37c6[_0x7c69('0x26')]=_[_0x7c69('0x27')](_0x1ceca6);_0x3e37c6[_0x7c69('0x28')]=_['keys'](_0x2b069b[_0x7c69('0x28')]);_0x3e37c6[_0x7c69('0x29')]=_['intersection'](_0x3e37c6[_0x7c69('0x26')],_0x3e37c6[_0x7c69('0x28')]);_0x336857[_0x7c69('0x2a')]=_[_0x7c69('0x2b')](_0x3e37c6[_0x7c69('0x26')],qs[_0x7c69('0x2c')](_0x2b069b['query']['fields']));_0x336857[_0x7c69('0x2a')]=_0x336857[_0x7c69('0x2a')]['length']?_0x336857[_0x7c69('0x2a')]:_0x3e37c6[_0x7c69('0x26')];if(!_0x2b069b[_0x7c69('0x28')][_0x7c69('0x2d')](_0x7c69('0x2e'))){_0x336857[_0x7c69('0x17')]=qs[_0x7c69('0x17')](_0x2b069b['query'][_0x7c69('0x17')]);_0x336857[_0x7c69('0x16')]=qs[_0x7c69('0x16')](_0x2b069b[_0x7c69('0x28')][_0x7c69('0x16')]);}_0x336857['order']=qs[_0x7c69('0x2f')](_0x2b069b[_0x7c69('0x28')]['sort']);_0x336857[_0x7c69('0x30')]=qs['filters'](_['pick'](_0x2b069b[_0x7c69('0x28')],_0x3e37c6[_0x7c69('0x29')]));if(_0x2b069b[_0x7c69('0x28')]['filter']){_0x336857[_0x7c69('0x30')]=_['merge'](_0x336857[_0x7c69('0x30')],{'$or':_['map'](_0x1ceca6,function(_0x277480){if(_0x277480[_0x7c69('0x31')][_0x7c69('0x32')]!==_0x7c69('0x33')){var _0x352b30={};_0x352b30[_0x277480[_0x7c69('0x34')]]={'$like':'%'+_0x2b069b[_0x7c69('0x28')][_0x7c69('0x35')]+'%'};return _0x352b30;}})});}_0x336857=_[_0x7c69('0x36')]({},_0x336857,_0x2b069b[_0x7c69('0x37')]);var _0x2afea6={'where':_0x336857[_0x7c69('0x30')]};return db[_0x7c69('0x24')][_0x7c69('0x15')](_0x2afea6)[_0x7c69('0x1e')](function(_0x2a22e4){_0x283061[_0x7c69('0x15')]=_0x2a22e4;if(_0x2b069b['query'][_0x7c69('0x38')]){_0x336857[_0x7c69('0x39')]=[{'all':!![]}];}return db[_0x7c69('0x24')][_0x7c69('0x3a')](_0x336857);})['then'](function(_0x6716e9){_0x283061[_0x7c69('0x3b')]=_0x6716e9;return _0x283061;})[_0x7c69('0x1e')](respondWithFilteredResult(_0x57a542,_0x336857))[_0x7c69('0x3c')](handleError(_0x57a542,null));};exports['show']=function(_0x49edc6,_0x25123f){var _0x4d1d1b={'raw':![],'where':{'id':_0x49edc6[_0x7c69('0x3d')]['id']}},_0x571b95={};_0x571b95[_0x7c69('0x26')]=_[_0x7c69('0x27')](db['AnalyticFieldReport'][_0x7c69('0x25')]);_0x571b95[_0x7c69('0x28')]=_[_0x7c69('0x27')](_0x49edc6[_0x7c69('0x28')]);_0x571b95[_0x7c69('0x29')]=_[_0x7c69('0x2b')](_0x571b95['model'],_0x571b95['query']);_0x4d1d1b[_0x7c69('0x2a')]=_[_0x7c69('0x2b')](_0x571b95[_0x7c69('0x26')],qs['fields'](_0x49edc6[_0x7c69('0x28')][_0x7c69('0x2c')]));_0x4d1d1b[_0x7c69('0x2a')]=_0x4d1d1b['attributes'][_0x7c69('0x3e')]?_0x4d1d1b[_0x7c69('0x2a')]:_0x571b95[_0x7c69('0x26')];if(_0x49edc6['query'][_0x7c69('0x38')]){_0x4d1d1b[_0x7c69('0x39')]=[{'all':!![]}];}_0x4d1d1b=_[_0x7c69('0x36')]({},_0x4d1d1b,_0x49edc6[_0x7c69('0x37')]);return db[_0x7c69('0x24')][_0x7c69('0x3f')](_0x4d1d1b)[_0x7c69('0x1e')](handleEntityNotFound(_0x25123f,null))[_0x7c69('0x1e')](respondWithResult(_0x25123f,null))[_0x7c69('0x3c')](handleError(_0x25123f,null));};exports['create']=function(_0xa129d9,_0x4bf88b){return db[_0x7c69('0x24')][_0x7c69('0x40')](_0xa129d9[_0x7c69('0x41')],{})[_0x7c69('0x1e')](respondWithResult(_0x4bf88b,0xc9))['catch'](handleError(_0x4bf88b,null));};exports['bulkCreate']=function(_0x4b204f,_0x4b1cc2){return db[_0x7c69('0x24')][_0x7c69('0x42')](_0x4b204f[_0x7c69('0x41')],{'raw':![],'individualHooks':!![]})[_0x7c69('0x1e')](respondWithResult(_0x4b1cc2,0xc9))[_0x7c69('0x3c')](handleError(_0x4b1cc2,null));};exports[_0x7c69('0x1d')]=function(_0x2b91a4,_0x9ef40){if(_0x2b91a4[_0x7c69('0x41')]['id']){delete _0x2b91a4['body']['id'];}return db[_0x7c69('0x24')][_0x7c69('0x3f')]({'where':{'id':_0x2b91a4[_0x7c69('0x3d')]['id']}})[_0x7c69('0x1e')](handleEntityNotFound(_0x9ef40,null))[_0x7c69('0x1e')](saveUpdates(_0x2b91a4[_0x7c69('0x41')],null))[_0x7c69('0x1e')](respondWithResult(_0x9ef40,null))[_0x7c69('0x3c')](handleError(_0x9ef40,null));};exports['destroy']=function(_0x218bb4,_0x58e7de){return db[_0x7c69('0x24')][_0x7c69('0x3f')]({'where':{'id':_0x218bb4[_0x7c69('0x3d')]['id']}})[_0x7c69('0x1e')](handleEntityNotFound(_0x58e7de,null))[_0x7c69('0x1e')](removeEntity(_0x58e7de,null))[_0x7c69('0x3c')](handleError(_0x58e7de,null));};exports[_0x7c69('0x43')]=function(_0x3d4fc7,_0x4fb688){return db[_0x7c69('0x24')][_0x7c69('0x1f')]({'where':{'id':_0x3d4fc7[_0x7c69('0x28')][_0x7c69('0x44')]||[]},'raw':![],'individualHooks':!![]})[_0x7c69('0x1e')](respondWithResult(_0x4fb688,0xcc))[_0x7c69('0x3c')](handleError(_0x4fb688,null));};exports[_0x7c69('0x45')]=function(_0x98382,_0x42fc68,_0x53def0){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x98382[_0x7c69('0x3d')]['id']}})[_0x7c69('0x1e')](handleEntityNotFound(_0x42fc68,null))[_0x7c69('0x1e')](function(_0x2f8ae0){if(_0x2f8ae0){return db['sequelize'][_0x7c69('0x46')](function(_0x4f64f1){return db[_0x7c69('0x24')]['destroy']({'where':{'CustomReportId':_0x98382[_0x7c69('0x3d')]['id']},'transaction':_0x4f64f1})['then'](function(_0x4b7426){var _0x1f8fb9=_['map'](_0x98382[_0x7c69('0x41')],function(_0x29836c){delete _0x29836c['id'];_0x29836c['CustomReportId']=_0x98382['params']['id'];return _0x29836c;});return db[_0x7c69('0x24')][_0x7c69('0x42')](_0x1f8fb9,{'transaction':_0x4f64f1});});})[_0x7c69('0x1e')](function(){return db[_0x7c69('0x24')][_0x7c69('0x3a')]({'where':{'CustomReportId':_0x98382[_0x7c69('0x3d')]['id']}});});}})[_0x7c69('0x1e')](respondWithResult(_0x42fc68,null))[_0x7c69('0x3c')](handleError(_0x42fc68,null));};
\ No newline at end of file
+var _0x17e9=['filter','merge','map','key','VIRTUAL','options','include','findAll','rows','show','params','length','find','catch','create','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','AnalyticFieldReport','rawAttributes','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','limit','order','sort','where','pick'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x17e9,0xb2));var _0x917e=function(_0x416221,_0x4675f5){_0x416221=_0x416221-0x0;var _0x19b253=_0x17e9[_0x416221];return _0x19b253;};'use strict';var pdf=require(_0x917e('0x0'));var emlformat=require(_0x917e('0x1'));var rimraf=require(_0x917e('0x2'));var zipdir=require(_0x917e('0x3'));var jsonpatch=require(_0x917e('0x4'));var rp=require(_0x917e('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x917e('0x6'));var util=require(_0x917e('0x7'));var path=require(_0x917e('0x8'));var sox=require(_0x917e('0x9'));var csv=require('to-csv');var ejs=require(_0x917e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x917e('0xb'));var crypto=require(_0x917e('0xc'));var jsforce=require(_0x917e('0xd'));var deskjs=require(_0x917e('0xe'));var toCsv=require(_0x917e('0xf'));var querystring=require('querystring');var Papa=require(_0x917e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x917e('0x11'));var hardwareService=require(_0x917e('0x12'));var logger=require('../../config/logger')(_0x917e('0x13'));var utils=require(_0x917e('0x14'));var config=require(_0x917e('0x15'));var db=require(_0x917e('0x16'))['db'];function respondWithStatusCode(_0x4a3857,_0x136583){_0x136583=_0x136583||0xcc;return function(_0x5793d6){if(_0x5793d6){return _0x4a3857[_0x917e('0x17')](_0x136583);}return _0x4a3857[_0x917e('0x18')](_0x136583)['end']();};}function respondWithResult(_0x492df7,_0x5be161){_0x5be161=_0x5be161||0xc8;return function(_0x27719f){if(_0x27719f){return _0x492df7[_0x917e('0x18')](_0x5be161)[_0x917e('0x19')](_0x27719f);}};}function respondWithFilteredResult(_0x481681,_0xe869f7){return function(_0x345aad){if(_0x345aad){var _0x332468=_0x345aad[_0x917e('0x1a')],_0x16561b=_0xe869f7[_0x917e('0x1b')],_0x4335a9=_0xe869f7[_0x917e('0x1b')]+_0xe869f7['limit'],_0x2996e9;if(_0x4335a9>=_0x332468){_0x4335a9=_0x332468;_0x2996e9=0xc8;}else{_0x2996e9=0xce;}_0x481681[_0x917e('0x18')](_0x2996e9);return _0x481681[_0x917e('0x1c')](_0x917e('0x1d'),_0x16561b+'-'+_0x4335a9+'/'+_0x332468)[_0x917e('0x19')](_0x345aad);}return null;};}function patchUpdates(_0x243f57){return function(_0x43e168){try{jsonpatch[_0x917e('0x1e')](_0x43e168,_0x243f57,!![]);}catch(_0x654e28){return BPromise[_0x917e('0x1f')](_0x654e28);}return _0x43e168[_0x917e('0x20')]();};}function saveUpdates(_0x210f4b,_0x2adf3a){return function(_0x268868){if(_0x268868){return _0x268868[_0x917e('0x21')](_0x210f4b)[_0x917e('0x22')](function(_0x4ae3a1){return _0x4ae3a1;});}return null;};}function removeEntity(_0x192a99,_0xab4f81){return function(_0x2ef015){if(_0x2ef015){return _0x2ef015[_0x917e('0x23')]()[_0x917e('0x22')](function(){_0x192a99['status'](0xcc)[_0x917e('0x24')]();});}};}function handleEntityNotFound(_0x193065,_0x2cee9d){return function(_0x5a38fe){if(!_0x5a38fe){_0x193065['sendStatus'](0x194);}return _0x5a38fe;};}function handleError(_0x42f6e6,_0x5c0074){_0x5c0074=_0x5c0074||0x1f4;return function(_0x161de7){logger[_0x917e('0x25')](_0x161de7[_0x917e('0x26')]);if(_0x161de7[_0x917e('0x27')]){delete _0x161de7['name'];}_0x42f6e6[_0x917e('0x18')](_0x5c0074)['send'](_0x161de7);};}exports[_0x917e('0x28')]=function(_0x4b9b67,_0x269919){var _0x5798b8={},_0xe65d37={},_0x511dfb={'count':0x0,'rows':[]};var _0x44a4c2=db[_0x917e('0x29')][_0x917e('0x2a')];_0xe65d37[_0x917e('0x2b')]=_[_0x917e('0x2c')](_0x44a4c2);_0xe65d37['query']=_[_0x917e('0x2c')](_0x4b9b67['query']);_0xe65d37[_0x917e('0x2d')]=_[_0x917e('0x2e')](_0xe65d37[_0x917e('0x2b')],_0xe65d37[_0x917e('0x2f')]);_0x5798b8['attributes']=_['intersection'](_0xe65d37['model'],qs['fields'](_0x4b9b67[_0x917e('0x2f')][_0x917e('0x30')]));_0x5798b8[_0x917e('0x31')]=_0x5798b8[_0x917e('0x31')]['length']?_0x5798b8[_0x917e('0x31')]:_0xe65d37[_0x917e('0x2b')];if(!_0x4b9b67[_0x917e('0x2f')][_0x917e('0x32')]('nolimit')){_0x5798b8[_0x917e('0x33')]=qs[_0x917e('0x33')](_0x4b9b67[_0x917e('0x2f')]['limit']);_0x5798b8[_0x917e('0x1b')]=qs[_0x917e('0x1b')](_0x4b9b67[_0x917e('0x2f')][_0x917e('0x1b')]);}_0x5798b8[_0x917e('0x34')]=qs[_0x917e('0x35')](_0x4b9b67['query'][_0x917e('0x35')]);_0x5798b8[_0x917e('0x36')]=qs[_0x917e('0x2d')](_[_0x917e('0x37')](_0x4b9b67[_0x917e('0x2f')],_0xe65d37['filters']));if(_0x4b9b67['query'][_0x917e('0x38')]){_0x5798b8[_0x917e('0x36')]=_[_0x917e('0x39')](_0x5798b8[_0x917e('0x36')],{'$or':_[_0x917e('0x3a')](_0x44a4c2,function(_0x4fcc31){if(_0x4fcc31['type'][_0x917e('0x3b')]!==_0x917e('0x3c')){var _0x343ed9={};_0x343ed9[_0x4fcc31['field']]={'$like':'%'+_0x4b9b67[_0x917e('0x2f')][_0x917e('0x38')]+'%'};return _0x343ed9;}})});}_0x5798b8=_[_0x917e('0x39')]({},_0x5798b8,_0x4b9b67[_0x917e('0x3d')]);var _0x19dca8={'where':_0x5798b8['where']};return db['AnalyticFieldReport'][_0x917e('0x1a')](_0x19dca8)[_0x917e('0x22')](function(_0x3a02a7){_0x511dfb['count']=_0x3a02a7;if(_0x4b9b67[_0x917e('0x2f')]['includeAll']){_0x5798b8[_0x917e('0x3e')]=[{'all':!![]}];}return db[_0x917e('0x29')][_0x917e('0x3f')](_0x5798b8);})[_0x917e('0x22')](function(_0x3bc11f){_0x511dfb[_0x917e('0x40')]=_0x3bc11f;return _0x511dfb;})['then'](respondWithFilteredResult(_0x269919,_0x5798b8))['catch'](handleError(_0x269919,null));};exports[_0x917e('0x41')]=function(_0xa4a96d,_0x1bc005){var _0xa75a4c={'raw':![],'where':{'id':_0xa4a96d[_0x917e('0x42')]['id']}},_0xd3be51={};_0xd3be51[_0x917e('0x2b')]=_[_0x917e('0x2c')](db['AnalyticFieldReport'][_0x917e('0x2a')]);_0xd3be51[_0x917e('0x2f')]=_[_0x917e('0x2c')](_0xa4a96d[_0x917e('0x2f')]);_0xd3be51[_0x917e('0x2d')]=_[_0x917e('0x2e')](_0xd3be51[_0x917e('0x2b')],_0xd3be51[_0x917e('0x2f')]);_0xa75a4c[_0x917e('0x31')]=_['intersection'](_0xd3be51[_0x917e('0x2b')],qs[_0x917e('0x30')](_0xa4a96d[_0x917e('0x2f')]['fields']));_0xa75a4c[_0x917e('0x31')]=_0xa75a4c['attributes'][_0x917e('0x43')]?_0xa75a4c['attributes']:_0xd3be51['model'];if(_0xa4a96d[_0x917e('0x2f')]['includeAll']){_0xa75a4c['include']=[{'all':!![]}];}_0xa75a4c=_[_0x917e('0x39')]({},_0xa75a4c,_0xa4a96d[_0x917e('0x3d')]);return db[_0x917e('0x29')][_0x917e('0x44')](_0xa75a4c)[_0x917e('0x22')](handleEntityNotFound(_0x1bc005,null))[_0x917e('0x22')](respondWithResult(_0x1bc005,null))[_0x917e('0x45')](handleError(_0x1bc005,null));};exports[_0x917e('0x46')]=function(_0x39fc8d,_0x300179){return db['AnalyticFieldReport'][_0x917e('0x46')](_0x39fc8d[_0x917e('0x47')],{})['then'](respondWithResult(_0x300179,0xc9))[_0x917e('0x45')](handleError(_0x300179,null));};exports[_0x917e('0x48')]=function(_0x3fe60c,_0xfa00c7){return db[_0x917e('0x29')][_0x917e('0x48')](_0x3fe60c[_0x917e('0x47')],{'raw':![],'individualHooks':!![]})[_0x917e('0x22')](respondWithResult(_0xfa00c7,0xc9))['catch'](handleError(_0xfa00c7,null));};exports[_0x917e('0x21')]=function(_0x4921fb,_0x1dff94){if(_0x4921fb[_0x917e('0x47')]['id']){delete _0x4921fb[_0x917e('0x47')]['id'];}return db[_0x917e('0x29')][_0x917e('0x44')]({'where':{'id':_0x4921fb[_0x917e('0x42')]['id']}})['then'](handleEntityNotFound(_0x1dff94,null))[_0x917e('0x22')](saveUpdates(_0x4921fb['body'],null))[_0x917e('0x22')](respondWithResult(_0x1dff94,null))['catch'](handleError(_0x1dff94,null));};exports[_0x917e('0x23')]=function(_0x566a07,_0x5dfc85){return db['AnalyticFieldReport'][_0x917e('0x44')]({'where':{'id':_0x566a07['params']['id']}})[_0x917e('0x22')](handleEntityNotFound(_0x5dfc85,null))[_0x917e('0x22')](removeEntity(_0x5dfc85,null))['catch'](handleError(_0x5dfc85,null));};exports[_0x917e('0x49')]=function(_0x2b0407,_0x36e5a9){return db['AnalyticFieldReport'][_0x917e('0x23')]({'where':{'id':_0x2b0407['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x36e5a9,0xcc))[_0x917e('0x45')](handleError(_0x36e5a9,null));};exports[_0x917e('0x4a')]=function(_0x1b2089,_0x3b3185,_0x43c321){return db[_0x917e('0x4b')]['findOne']({'where':{'id':_0x1b2089['params']['id']}})['then'](handleEntityNotFound(_0x3b3185,null))[_0x917e('0x22')](function(_0x106ac1){if(_0x106ac1){return db['sequelize'][_0x917e('0x4c')](function(_0x16e7b3){return db[_0x917e('0x29')][_0x917e('0x23')]({'where':{'CustomReportId':_0x1b2089[_0x917e('0x42')]['id']},'transaction':_0x16e7b3})[_0x917e('0x22')](function(_0x44fd34){var _0x3c8885=_[_0x917e('0x3a')](_0x1b2089[_0x917e('0x47')],function(_0x3fb6b2){delete _0x3fb6b2['id'];_0x3fb6b2[_0x917e('0x4d')]=_0x1b2089[_0x917e('0x42')]['id'];return _0x3fb6b2;});return db[_0x917e('0x29')]['bulkCreate'](_0x3c8885,{'transaction':_0x16e7b3});});})['then'](function(){return db['AnalyticFieldReport'][_0x917e('0x3f')]({'where':{'CustomReportId':_0x1b2089[_0x917e('0x42')]['id']}});});}})[_0x917e('0x22')](respondWithResult(_0x3b3185,null))[_0x917e('0x45')](handleError(_0x3b3185,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 814ca4f..784747a 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 _0x6242=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x51ec61,_0xf9d1e3){var _0x223200=function(_0x3bd510){while(--_0x3bd510){_0x51ec61['push'](_0x51ec61['shift']());}};_0x223200(++_0xf9d1e3);}(_0x6242,0x1a8));var _0x2624=function(_0x370093,_0x2eab7a){_0x370093=_0x370093-0x0;var _0x4859a8=_0x6242[_0x370093];return _0x4859a8;};'use strict';var _=require('lodash');var util=require(_0x2624('0x0'));var logger=require(_0x2624('0x1'))(_0x2624('0x2'));var moment=require(_0x2624('0x3'));var BPromise=require('bluebird');var rp=require(_0x2624('0x4'));var fs=require('fs');var path=require(_0x2624('0x5'));var rimraf=require(_0x2624('0x6'));var config=require(_0x2624('0x7'));var attributes=require(_0x2624('0x8'));module[_0x2624('0x9')]=function(_0x5d4d07,_0x489344){return _0x5d4d07['define'](_0x2624('0xa'),attributes,{'tableName':_0x2624('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7c0=['./analyticFieldReport.attributes','exports','define','analytics_report_fields','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x37ae2e,_0x35be3a){var _0x19c50f=function(_0x49732a){while(--_0x49732a){_0x37ae2e['push'](_0x37ae2e['shift']());}};_0x19c50f(++_0x35be3a);}(_0xb7c0,0xb8));var _0x0b7c=function(_0x430988,_0x246c7c){_0x430988=_0x430988-0x0;var _0x5f03b0=_0xb7c0[_0x430988];return _0x5f03b0;};'use strict';var _=require('lodash');var util=require(_0x0b7c('0x0'));var logger=require(_0x0b7c('0x1'))('api');var moment=require(_0x0b7c('0x2'));var BPromise=require(_0x0b7c('0x3'));var rp=require(_0x0b7c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0b7c('0x5'));var attributes=require(_0x0b7c('0x6'));module[_0x0b7c('0x7')]=function(_0xe3882b,_0x2b5be0){return _0xe3882b[_0x0b7c('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x0b7c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 51c3509..6b62f1c 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 _0x0dee=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x31ba08,_0x33fd95){var _0x3595fb=function(_0x221d9a){while(--_0x221d9a){_0x31ba08['push'](_0x31ba08['shift']());}};_0x3595fb(++_0x33fd95);}(_0x0dee,0xf7));var _0xe0de=function(_0x485efd,_0x1499a1){_0x485efd=_0x485efd-0x0;var _0x5ca6c4=_0x0dee[_0x485efd];return _0x5ca6c4;};'use strict';var _=require(_0xe0de('0x0'));var util=require(_0xe0de('0x1'));var moment=require('moment');var BPromise=require(_0xe0de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0de('0x3'));var db=require(_0xe0de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0de('0x5'))(_0xe0de('0x6'));var config=require(_0xe0de('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe0de('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe1fd9,_0x5e5250,_0x349fd2){return new BPromise(function(_0x5b644c,_0x25818f){return client['request'](_0xfe1fd9,_0x349fd2)[_0xe0de('0x9')](function(_0x4a5ecd){logger[_0xe0de('0xa')](_0xe0de('0xb'),_0x5e5250,_0xe0de('0xc'));logger[_0xe0de('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5e5250,_0xe0de('0xc'),JSON[_0xe0de('0xe')](_0x4a5ecd));if(_0x4a5ecd[_0xe0de('0xf')]){if(_0x4a5ecd[_0xe0de('0xf')]['code']===0x1f4){logger['error'](_0xe0de('0xb'),_0x5e5250,_0x4a5ecd[_0xe0de('0xf')]['message']);return _0x25818f(_0x4a5ecd['error'][_0xe0de('0x10')]);}logger[_0xe0de('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5e5250,_0x4a5ecd['error']['message']);return _0x5b644c(_0x4a5ecd['error'][_0xe0de('0x10')]);}else{logger[_0xe0de('0xa')](_0xe0de('0xb'),_0x5e5250,_0xe0de('0xc'));_0x5b644c(_0x4a5ecd[_0xe0de('0x11')][_0xe0de('0x10')]);}})[_0xe0de('0x12')](function(_0x2d8c3d){logger[_0xe0de('0xf')](_0xe0de('0xb'),_0x5e5250,_0x2d8c3d);_0x25818f(_0x2d8c3d);});});}
\ No newline at end of file
+var _0xe767=['code','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x2d0687,_0x39c935){var _0x204c09=function(_0x291943){while(--_0x291943){_0x2d0687['push'](_0x2d0687['shift']());}};_0x204c09(++_0x39c935);}(_0xe767,0x11e));var _0x7e76=function(_0x5a54df,_0x32f461){_0x5a54df=_0x5a54df-0x0;var _0x1df277=_0xe767[_0x5a54df];return _0x1df277;};'use strict';var _=require('lodash');var util=require(_0x7e76('0x0'));var moment=require(_0x7e76('0x1'));var BPromise=require(_0x7e76('0x2'));var rs=require(_0x7e76('0x3'));var fs=require('fs');var Redis=require(_0x7e76('0x4'));var db=require(_0x7e76('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e76('0x6'));var config=require('../../config/environment');var jayson=require(_0x7e76('0x7'));var client=jayson['client'][_0x7e76('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a703b,_0xd52307,_0x3aaa07){return new BPromise(function(_0x46ddea,_0x177223){return client[_0x7e76('0x9')](_0x2a703b,_0x3aaa07)['then'](function(_0x49ffa4){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0xd52307,_0x7e76('0xa'));logger[_0x7e76('0xb')](_0x7e76('0xc'),_0xd52307,'request\x20sent',JSON['stringify'](_0x49ffa4));if(_0x49ffa4[_0x7e76('0xd')]){if(_0x49ffa4['error'][_0x7e76('0xe')]===0x1f4){logger[_0x7e76('0xd')](_0x7e76('0xf'),_0xd52307,_0x49ffa4['error'][_0x7e76('0x10')]);return _0x177223(_0x49ffa4[_0x7e76('0xd')][_0x7e76('0x10')]);}logger[_0x7e76('0xd')](_0x7e76('0xf'),_0xd52307,_0x49ffa4[_0x7e76('0xd')][_0x7e76('0x10')]);return _0x46ddea(_0x49ffa4[_0x7e76('0xd')][_0x7e76('0x10')]);}else{logger[_0x7e76('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0xd52307,_0x7e76('0xa'));_0x46ddea(_0x49ffa4[_0x7e76('0x12')][_0x7e76('0x10')]);}})[_0x7e76('0x13')](function(_0x5aeeb0){logger[_0x7e76('0xd')](_0x7e76('0xf'),_0xd52307,_0x5aeeb0);_0x177223(_0x5aeeb0);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 12a6e2a..fa71625 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 _0x0bb5=['get','isAuthenticated','/:id','show','post','/create_many','bulkCreate','/:id/create_many','addFields','put','update','/destroy_many','bulkDestroy','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller'];(function(_0x17e4f5,_0x1ccde6){var _0x5ac1d7=function(_0x56fd14){while(--_0x56fd14){_0x17e4f5['push'](_0x17e4f5['shift']());}};_0x5ac1d7(++_0x1ccde6);}(_0x0bb5,0x148));var _0x50bb=function(_0x34e296,_0x2d9b0a){_0x34e296=_0x34e296-0x0;var _0x58a69f=_0x0bb5[_0x34e296];return _0x58a69f;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var auth=require(_0x50bb('0x4'));var interaction=require(_0x50bb('0x5'));var config=require(_0x50bb('0x6'));var controller=require(_0x50bb('0x7'));router[_0x50bb('0x8')]('/',auth[_0x50bb('0x9')](),controller['index']);router['get'](_0x50bb('0xa'),auth[_0x50bb('0x9')](),controller[_0x50bb('0xb')]);router[_0x50bb('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x50bb('0xc')](_0x50bb('0xd'),auth[_0x50bb('0x9')](),controller[_0x50bb('0xe')]);router['post'](_0x50bb('0xf'),auth[_0x50bb('0x9')](),controller[_0x50bb('0x10')]);router[_0x50bb('0x11')](_0x50bb('0xa'),auth[_0x50bb('0x9')](),controller[_0x50bb('0x12')]);router['delete'](_0x50bb('0x13'),auth['isAuthenticated'](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')](_0x50bb('0xa'),auth['isAuthenticated'](),controller[_0x50bb('0x16')]);module[_0x50bb('0x17')]=router;
\ No newline at end of file
+var _0x5ff3=['destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','post','/:id/create_many','put','delete','/destroy_many','bulkDestroy'];(function(_0xe96c9,_0x2ae1ae){var _0x517679=function(_0x5798ec){while(--_0x5798ec){_0xe96c9['push'](_0xe96c9['shift']());}};_0x517679(++_0x2ae1ae);}(_0x5ff3,0x17d));var _0x35ff=function(_0x503767,_0x4a9c01){_0x503767=_0x503767-0x0;var _0x1c3c7c=_0x5ff3[_0x503767];return _0x1c3c7c;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var auth=require(_0x35ff('0x3'));var interaction=require(_0x35ff('0x4'));var config=require(_0x35ff('0x5'));var controller=require('./analyticFieldReport.controller');router[_0x35ff('0x6')]('/',auth[_0x35ff('0x7')](),controller[_0x35ff('0x8')]);router[_0x35ff('0x6')](_0x35ff('0x9'),auth['isAuthenticated'](),controller[_0x35ff('0xa')]);router['post']('/',auth[_0x35ff('0x7')](),controller[_0x35ff('0xb')]);router[_0x35ff('0xc')]('/create_many',auth[_0x35ff('0x7')](),controller['bulkCreate']);router[_0x35ff('0xc')](_0x35ff('0xd'),auth['isAuthenticated'](),controller['addFields']);router[_0x35ff('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x35ff('0xf')](_0x35ff('0x10'),auth[_0x35ff('0x7')](),controller[_0x35ff('0x11')]);router['delete'](_0x35ff('0x9'),auth[_0x35ff('0x7')](),controller[_0x35ff('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 91c3fb7..f1a6a2c 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 _0xe0b3=['TEXT','sequelize','exports','STRING'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xe0b3,0x149));var _0x3e0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe0b3[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3e0b('0x0'));module[_0x3e0b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x3e0b('0x2')]},'metric':{'type':Sequelize[_0x3e0b('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x55d5=['exports','STRING','name','TEXT','sequelize'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x55d5,0x1d5));var _0x555d=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x55d5[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0x555d('0x0'));module[_0x555d('0x1')]={'name':{'type':Sequelize[_0x555d('0x2')],'allowNull':![],'unique':_0x555d('0x3')},'table':{'type':Sequelize[_0x555d('0x2')]},'metric':{'type':Sequelize[_0x555d('0x4')]},'description':{'type':Sequelize[_0x555d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 38387df..b3eca82 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 _0x4d82=['user','role','Metrics','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','json','offset','limit','status','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','merge','where','map','key','field','filter','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','find','create'];(function(_0x38c21f,_0x5d27a5){var _0x2e1b03=function(_0x70cc69){while(--_0x70cc69){_0x38c21f['push'](_0x38c21f['shift']());}};_0x2e1b03(++_0x5d27a5);}(_0x4d82,0x1e9));var _0x24d8=function(_0x334688,_0xf68c2c){_0x334688=_0x334688-0x0;var _0x42dc15=_0x4d82[_0x334688];return _0x42dc15;};'use strict';var pdf=require(_0x24d8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x24d8('0x1'));var zipdir=require(_0x24d8('0x2'));var jsonpatch=require(_0x24d8('0x3'));var rp=require('request-promise');var moment=require(_0x24d8('0x4'));var BPromise=require(_0x24d8('0x5'));var Mustache=require('mustache');var util=require(_0x24d8('0x6'));var path=require(_0x24d8('0x7'));var sox=require(_0x24d8('0x8'));var csv=require(_0x24d8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x24d8('0xa'));var squel=require('squel');var crypto=require(_0x24d8('0xb'));var jsforce=require(_0x24d8('0xc'));var deskjs=require(_0x24d8('0xd'));var toCsv=require(_0x24d8('0x9'));var querystring=require(_0x24d8('0xe'));var Papa=require(_0x24d8('0xf'));var Redis=require('ioredis');var authService=require(_0x24d8('0x10'));var qs=require(_0x24d8('0x11'));var hardwareService=require(_0x24d8('0x12'));var logger=require('../../config/logger')(_0x24d8('0x13'));var utils=require('../../config/utils');var config=require(_0x24d8('0x14'));var db=require(_0x24d8('0x15'))['db'];function respondWithStatusCode(_0x4b1c17,_0x2d7afd){_0x2d7afd=_0x2d7afd||0xcc;return function(_0x3c9bb8){if(_0x3c9bb8){return _0x4b1c17['sendStatus'](_0x2d7afd);}return _0x4b1c17['status'](_0x2d7afd)['end']();};}function respondWithResult(_0x5a7276,_0x46ceb4){_0x46ceb4=_0x46ceb4||0xc8;return function(_0x12563a){if(_0x12563a){return _0x5a7276['status'](_0x46ceb4)[_0x24d8('0x16')](_0x12563a);}};}function respondWithFilteredResult(_0x4f4146,_0x3cf7bc){return function(_0x31fcc8){if(_0x31fcc8){var _0x4cae01=_0x31fcc8['count'],_0x219c71=_0x3cf7bc['offset'],_0x13c1a2=_0x3cf7bc[_0x24d8('0x17')]+_0x3cf7bc[_0x24d8('0x18')],_0x1b50d5;if(_0x13c1a2>=_0x4cae01){_0x13c1a2=_0x4cae01;_0x1b50d5=0xc8;}else{_0x1b50d5=0xce;}_0x4f4146[_0x24d8('0x19')](_0x1b50d5);return _0x4f4146[_0x24d8('0x1a')](_0x24d8('0x1b'),_0x219c71+'-'+_0x13c1a2+'/'+_0x4cae01)[_0x24d8('0x16')](_0x31fcc8);}return null;};}function patchUpdates(_0x175503){return function(_0x55de6d){try{jsonpatch[_0x24d8('0x1c')](_0x55de6d,_0x175503,!![]);}catch(_0x15135d){return BPromise['reject'](_0x15135d);}return _0x55de6d[_0x24d8('0x1d')]();};}function saveUpdates(_0x2bf2ac,_0x1421ac){return function(_0x5722ac){if(_0x5722ac){return _0x5722ac[_0x24d8('0x1e')](_0x2bf2ac)[_0x24d8('0x1f')](function(_0x1947cc){return _0x1947cc;});}return null;};}function removeEntity(_0x11a82a,_0xe1a675){return function(_0x3214b2){if(_0x3214b2){return _0x3214b2['destroy']()[_0x24d8('0x1f')](function(){var _0x4a736e=_0x3214b2[_0x24d8('0x20')]({'plain':!![]});var _0x417f09='Metrics';return db[_0x24d8('0x21')][_0x24d8('0x22')]({'where':{'type':_0x417f09,'resourceId':_0x4a736e['id']}})['then'](function(){return _0x3214b2;});})['then'](function(){_0x11a82a[_0x24d8('0x19')](0xcc)[_0x24d8('0x23')]();});}};}function handleEntityNotFound(_0x207fbb,_0x24d719){return function(_0x4d5a46){if(!_0x4d5a46){_0x207fbb[_0x24d8('0x24')](0x194);}return _0x4d5a46;};}function handleError(_0x3f8405,_0x4b9daf){_0x4b9daf=_0x4b9daf||0x1f4;return function(_0x230740){logger[_0x24d8('0x25')](_0x230740[_0x24d8('0x26')]);if(_0x230740[_0x24d8('0x27')]){delete _0x230740[_0x24d8('0x27')];}_0x3f8405[_0x24d8('0x19')](_0x4b9daf)[_0x24d8('0x28')](_0x230740);};}exports[_0x24d8('0x29')]=function(_0x57a122,_0x1fffe3){var _0x27fce0={},_0x565f21={},_0xd4b507={'count':0x0,'rows':[]};var _0x243a4c=db['AnalyticMetric']['rawAttributes'];_0x565f21[_0x24d8('0x2a')]=_[_0x24d8('0x2b')](_0x243a4c);_0x565f21[_0x24d8('0x2c')]=_[_0x24d8('0x2b')](_0x57a122[_0x24d8('0x2c')]);_0x565f21['filters']=_[_0x24d8('0x2d')](_0x565f21[_0x24d8('0x2a')],_0x565f21[_0x24d8('0x2c')]);_0x27fce0[_0x24d8('0x2e')]=_['intersection'](_0x565f21[_0x24d8('0x2a')],qs[_0x24d8('0x2f')](_0x57a122[_0x24d8('0x2c')][_0x24d8('0x2f')]));_0x27fce0[_0x24d8('0x2e')]=_0x27fce0[_0x24d8('0x2e')][_0x24d8('0x30')]?_0x27fce0[_0x24d8('0x2e')]:_0x565f21[_0x24d8('0x2a')];if(!_0x57a122[_0x24d8('0x2c')][_0x24d8('0x31')]('nolimit')){_0x27fce0['limit']=qs['limit'](_0x57a122[_0x24d8('0x2c')][_0x24d8('0x18')]);_0x27fce0[_0x24d8('0x17')]=qs['offset'](_0x57a122[_0x24d8('0x2c')][_0x24d8('0x17')]);}_0x27fce0[_0x24d8('0x32')]=qs['sort'](_0x57a122[_0x24d8('0x2c')][_0x24d8('0x33')]);_0x27fce0['where']=qs[_0x24d8('0x34')](_[_0x24d8('0x35')](_0x57a122[_0x24d8('0x2c')],_0x565f21['filters']));if(_0x57a122[_0x24d8('0x2c')]['filter']){_0x27fce0['where']=_[_0x24d8('0x36')](_0x27fce0[_0x24d8('0x37')],{'$or':_[_0x24d8('0x38')](_0x243a4c,function(_0x3822b3){if(_0x3822b3['type'][_0x24d8('0x39')]!=='VIRTUAL'){var _0x101e81={};_0x101e81[_0x3822b3[_0x24d8('0x3a')]]={'$like':'%'+_0x57a122[_0x24d8('0x2c')][_0x24d8('0x3b')]+'%'};return _0x101e81;}})});}_0x27fce0=_[_0x24d8('0x36')]({},_0x27fce0,_0x57a122[_0x24d8('0x3c')]);var _0xe8ce38={'where':_0x27fce0['where']};return db[_0x24d8('0x3d')][_0x24d8('0x3e')](_0xe8ce38)['then'](function(_0x25ac94){_0xd4b507[_0x24d8('0x3e')]=_0x25ac94;if(_0x57a122[_0x24d8('0x2c')][_0x24d8('0x3f')]){_0x27fce0[_0x24d8('0x40')]=[{'all':!![]}];}return db[_0x24d8('0x3d')][_0x24d8('0x41')](_0x27fce0);})[_0x24d8('0x1f')](function(_0x4d1dfe){_0xd4b507[_0x24d8('0x42')]=_0x4d1dfe;return _0xd4b507;})[_0x24d8('0x1f')](respondWithFilteredResult(_0x1fffe3,_0x27fce0))[_0x24d8('0x43')](handleError(_0x1fffe3,null));};exports[_0x24d8('0x44')]=function(_0x2ddd7d,_0x122470){var _0x454d7f={'raw':!![],'where':{'id':_0x2ddd7d['params']['id']}},_0x3fd04e={};_0x3fd04e['model']=_['keys'](db[_0x24d8('0x3d')]['rawAttributes']);_0x3fd04e['query']=_[_0x24d8('0x2b')](_0x2ddd7d[_0x24d8('0x2c')]);_0x3fd04e[_0x24d8('0x34')]=_[_0x24d8('0x2d')](_0x3fd04e[_0x24d8('0x2a')],_0x3fd04e['query']);_0x454d7f[_0x24d8('0x2e')]=_[_0x24d8('0x2d')](_0x3fd04e[_0x24d8('0x2a')],qs['fields'](_0x2ddd7d[_0x24d8('0x2c')]['fields']));_0x454d7f[_0x24d8('0x2e')]=_0x454d7f[_0x24d8('0x2e')][_0x24d8('0x30')]?_0x454d7f[_0x24d8('0x2e')]:_0x3fd04e[_0x24d8('0x2a')];if(_0x2ddd7d['query'][_0x24d8('0x3f')]){_0x454d7f[_0x24d8('0x40')]=[{'all':!![]}];}_0x454d7f=_[_0x24d8('0x36')]({},_0x454d7f,_0x2ddd7d[_0x24d8('0x3c')]);return db['AnalyticMetric'][_0x24d8('0x45')](_0x454d7f)[_0x24d8('0x1f')](handleEntityNotFound(_0x122470,null))['then'](respondWithResult(_0x122470,null))['catch'](handleError(_0x122470,null));};exports['create']=function(_0x47a332,_0x27da3c){return db[_0x24d8('0x3d')][_0x24d8('0x46')](_0x47a332['body'],{})[_0x24d8('0x1f')](function(_0x282433){var _0x5b286d=_0x47a332[_0x24d8('0x47')][_0x24d8('0x20')]({'plain':!![]});if(!_0x5b286d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b286d[_0x24d8('0x48')]===_0x24d8('0x47')){var _0x3db236=_0x282433['get']({'plain':!![]});var _0x4bea33=_0x24d8('0x49');return db[_0x24d8('0x4a')][_0x24d8('0x45')]({'where':{'name':_0x4bea33,'userProfileId':_0x5b286d[_0x24d8('0x4b')]},'raw':!![]})[_0x24d8('0x1f')](function(_0x546c0a){if(_0x546c0a&&_0x546c0a[_0x24d8('0x4c')]===0x0){return db[_0x24d8('0x21')][_0x24d8('0x46')]({'name':_0x3db236[_0x24d8('0x27')],'resourceId':_0x3db236['id'],'type':_0x546c0a['name'],'sectionId':_0x546c0a['id']},{})[_0x24d8('0x1f')](function(){return _0x282433;});}else{return _0x282433;}})[_0x24d8('0x43')](function(_0x3b3761){logger[_0x24d8('0x25')](_0x24d8('0x4d'),_0x3b3761);throw _0x3b3761;});}return _0x282433;})[_0x24d8('0x1f')](respondWithResult(_0x27da3c,0xc9))[_0x24d8('0x43')](handleError(_0x27da3c,null));};exports[_0x24d8('0x1e')]=function(_0x1fe662,_0x3cf867){if(_0x1fe662['body']['id']){delete _0x1fe662[_0x24d8('0x4e')]['id'];}return db[_0x24d8('0x3d')][_0x24d8('0x45')]({'where':{'id':_0x1fe662[_0x24d8('0x4f')]['id']}})[_0x24d8('0x1f')](handleEntityNotFound(_0x3cf867,null))[_0x24d8('0x1f')](saveUpdates(_0x1fe662['body'],null))[_0x24d8('0x1f')](respondWithResult(_0x3cf867,null))[_0x24d8('0x43')](handleError(_0x3cf867,null));};exports[_0x24d8('0x22')]=function(_0x3df7a5,_0x3ca7c0){return db[_0x24d8('0x3d')]['find']({'where':{'id':_0x3df7a5[_0x24d8('0x4f')]['id']}})[_0x24d8('0x1f')](handleEntityNotFound(_0x3ca7c0,null))[_0x24d8('0x1f')](removeEntity(_0x3ca7c0,null))[_0x24d8('0x43')](handleError(_0x3ca7c0,null));};
\ No newline at end of file
+var _0xf1f2=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','update','destroy','Metrics','then','stack','name','send','index','AnalyticMetric','model','keys','query','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','merge','key','VIRTUAL','field','count','includeAll','findAll','rows','show','params','rawAttributes','length','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf'];(function(_0x209d81,_0x5ae79e){var _0x362983=function(_0x514ba0){while(--_0x514ba0){_0x209d81['push'](_0x209d81['shift']());}};_0x362983(++_0x5ae79e);}(_0xf1f2,0x13f));var _0x2f1f=function(_0x2a276d,_0x482b0c){_0x2a276d=_0x2a276d-0x0;var _0x2914cd=_0xf1f2[_0x2a276d];return _0x2914cd;};'use strict';var pdf=require(_0x2f1f('0x0'));var emlformat=require(_0x2f1f('0x1'));var rimraf=require(_0x2f1f('0x2'));var zipdir=require(_0x2f1f('0x3'));var jsonpatch=require(_0x2f1f('0x4'));var rp=require(_0x2f1f('0x5'));var moment=require(_0x2f1f('0x6'));var BPromise=require(_0x2f1f('0x7'));var Mustache=require(_0x2f1f('0x8'));var util=require(_0x2f1f('0x9'));var path=require('path');var sox=require(_0x2f1f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2f1f('0xb'));var squel=require(_0x2f1f('0xc'));var crypto=require(_0x2f1f('0xd'));var jsforce=require(_0x2f1f('0xe'));var deskjs=require(_0x2f1f('0xf'));var toCsv=require(_0x2f1f('0x10'));var querystring=require('querystring');var Papa=require(_0x2f1f('0x11'));var Redis=require(_0x2f1f('0x12'));var authService=require(_0x2f1f('0x13'));var qs=require(_0x2f1f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f1f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2f1f('0x16'))['db'];function respondWithStatusCode(_0x9e785f,_0x159118){_0x159118=_0x159118||0xcc;return function(_0x3fb867){if(_0x3fb867){return _0x9e785f[_0x2f1f('0x17')](_0x159118);}return _0x9e785f['status'](_0x159118)[_0x2f1f('0x18')]();};}function respondWithResult(_0x49e18a,_0x8274b4){_0x8274b4=_0x8274b4||0xc8;return function(_0x3404a8){if(_0x3404a8){return _0x49e18a[_0x2f1f('0x19')](_0x8274b4)[_0x2f1f('0x1a')](_0x3404a8);}};}function respondWithFilteredResult(_0x3f268b,_0x54f3fb){return function(_0x3bda53){if(_0x3bda53){var _0x42a413=_0x3bda53['count'],_0x195ed5=_0x54f3fb[_0x2f1f('0x1b')],_0x250b08=_0x54f3fb[_0x2f1f('0x1b')]+_0x54f3fb[_0x2f1f('0x1c')],_0x1ae0f9;if(_0x250b08>=_0x42a413){_0x250b08=_0x42a413;_0x1ae0f9=0xc8;}else{_0x1ae0f9=0xce;}_0x3f268b['status'](_0x1ae0f9);return _0x3f268b[_0x2f1f('0x1d')](_0x2f1f('0x1e'),_0x195ed5+'-'+_0x250b08+'/'+_0x42a413)['json'](_0x3bda53);}return null;};}function patchUpdates(_0x5450d2){return function(_0x44afa7){try{jsonpatch[_0x2f1f('0x1f')](_0x44afa7,_0x5450d2,!![]);}catch(_0x36fa06){return BPromise[_0x2f1f('0x20')](_0x36fa06);}return _0x44afa7['save']();};}function saveUpdates(_0x5ca277,_0x14cdd6){return function(_0xe44a37){if(_0xe44a37){return _0xe44a37[_0x2f1f('0x21')](_0x5ca277)['then'](function(_0x15114e){return _0x15114e;});}return null;};}function removeEntity(_0x230f6a,_0x2344b9){return function(_0x14d0bd){if(_0x14d0bd){return _0x14d0bd[_0x2f1f('0x22')]()['then'](function(){var _0x15938d=_0x14d0bd['get']({'plain':!![]});var _0x5dc301=_0x2f1f('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x5dc301,'resourceId':_0x15938d['id']}})[_0x2f1f('0x24')](function(){return _0x14d0bd;});})[_0x2f1f('0x24')](function(){_0x230f6a[_0x2f1f('0x19')](0xcc)[_0x2f1f('0x18')]();});}};}function handleEntityNotFound(_0x46ec1c,_0x4e68f0){return function(_0x533048){if(!_0x533048){_0x46ec1c[_0x2f1f('0x17')](0x194);}return _0x533048;};}function handleError(_0x44f0fa,_0x4564f1){_0x4564f1=_0x4564f1||0x1f4;return function(_0x45b237){logger['error'](_0x45b237[_0x2f1f('0x25')]);if(_0x45b237[_0x2f1f('0x26')]){delete _0x45b237[_0x2f1f('0x26')];}_0x44f0fa[_0x2f1f('0x19')](_0x4564f1)[_0x2f1f('0x27')](_0x45b237);};}exports[_0x2f1f('0x28')]=function(_0x134e95,_0x444fba){var _0x275009={},_0x446857={},_0x533135={'count':0x0,'rows':[]};var _0x5e3366=db[_0x2f1f('0x29')]['rawAttributes'];_0x446857[_0x2f1f('0x2a')]=_[_0x2f1f('0x2b')](_0x5e3366);_0x446857[_0x2f1f('0x2c')]=_[_0x2f1f('0x2b')](_0x134e95[_0x2f1f('0x2c')]);_0x446857[_0x2f1f('0x2d')]=_[_0x2f1f('0x2e')](_0x446857['model'],_0x446857[_0x2f1f('0x2c')]);_0x275009[_0x2f1f('0x2f')]=_[_0x2f1f('0x2e')](_0x446857[_0x2f1f('0x2a')],qs[_0x2f1f('0x30')](_0x134e95[_0x2f1f('0x2c')][_0x2f1f('0x30')]));_0x275009[_0x2f1f('0x2f')]=_0x275009[_0x2f1f('0x2f')]['length']?_0x275009['attributes']:_0x446857[_0x2f1f('0x2a')];if(!_0x134e95[_0x2f1f('0x2c')]['hasOwnProperty'](_0x2f1f('0x31'))){_0x275009[_0x2f1f('0x1c')]=qs[_0x2f1f('0x1c')](_0x134e95[_0x2f1f('0x2c')][_0x2f1f('0x1c')]);_0x275009['offset']=qs[_0x2f1f('0x1b')](_0x134e95[_0x2f1f('0x2c')]['offset']);}_0x275009[_0x2f1f('0x32')]=qs['sort'](_0x134e95[_0x2f1f('0x2c')]['sort']);_0x275009[_0x2f1f('0x33')]=qs[_0x2f1f('0x2d')](_[_0x2f1f('0x34')](_0x134e95['query'],_0x446857[_0x2f1f('0x2d')]));if(_0x134e95[_0x2f1f('0x2c')][_0x2f1f('0x35')]){_0x275009[_0x2f1f('0x33')]=_[_0x2f1f('0x36')](_0x275009['where'],{'$or':_['map'](_0x5e3366,function(_0x2f092c){if(_0x2f092c['type'][_0x2f1f('0x37')]!==_0x2f1f('0x38')){var _0x402b39={};_0x402b39[_0x2f092c[_0x2f1f('0x39')]]={'$like':'%'+_0x134e95[_0x2f1f('0x2c')][_0x2f1f('0x35')]+'%'};return _0x402b39;}})});}_0x275009=_[_0x2f1f('0x36')]({},_0x275009,_0x134e95['options']);var _0x19073b={'where':_0x275009['where']};return db['AnalyticMetric'][_0x2f1f('0x3a')](_0x19073b)[_0x2f1f('0x24')](function(_0x12fb13){_0x533135[_0x2f1f('0x3a')]=_0x12fb13;if(_0x134e95[_0x2f1f('0x2c')][_0x2f1f('0x3b')]){_0x275009['include']=[{'all':!![]}];}return db[_0x2f1f('0x29')][_0x2f1f('0x3c')](_0x275009);})[_0x2f1f('0x24')](function(_0x1007e6){_0x533135[_0x2f1f('0x3d')]=_0x1007e6;return _0x533135;})['then'](respondWithFilteredResult(_0x444fba,_0x275009))['catch'](handleError(_0x444fba,null));};exports[_0x2f1f('0x3e')]=function(_0x5f535e,_0x5e3ff1){var _0x53ccb5={'raw':!![],'where':{'id':_0x5f535e[_0x2f1f('0x3f')]['id']}},_0x2b9fab={};_0x2b9fab[_0x2f1f('0x2a')]=_[_0x2f1f('0x2b')](db[_0x2f1f('0x29')][_0x2f1f('0x40')]);_0x2b9fab[_0x2f1f('0x2c')]=_[_0x2f1f('0x2b')](_0x5f535e[_0x2f1f('0x2c')]);_0x2b9fab[_0x2f1f('0x2d')]=_['intersection'](_0x2b9fab['model'],_0x2b9fab[_0x2f1f('0x2c')]);_0x53ccb5[_0x2f1f('0x2f')]=_[_0x2f1f('0x2e')](_0x2b9fab['model'],qs[_0x2f1f('0x30')](_0x5f535e[_0x2f1f('0x2c')][_0x2f1f('0x30')]));_0x53ccb5['attributes']=_0x53ccb5[_0x2f1f('0x2f')][_0x2f1f('0x41')]?_0x53ccb5[_0x2f1f('0x2f')]:_0x2b9fab[_0x2f1f('0x2a')];if(_0x5f535e[_0x2f1f('0x2c')][_0x2f1f('0x3b')]){_0x53ccb5[_0x2f1f('0x42')]=[{'all':!![]}];}_0x53ccb5=_['merge']({},_0x53ccb5,_0x5f535e[_0x2f1f('0x43')]);return db[_0x2f1f('0x29')][_0x2f1f('0x44')](_0x53ccb5)[_0x2f1f('0x24')](handleEntityNotFound(_0x5e3ff1,null))[_0x2f1f('0x24')](respondWithResult(_0x5e3ff1,null))[_0x2f1f('0x45')](handleError(_0x5e3ff1,null));};exports['create']=function(_0x1b80aa,_0xef7ce9){return db[_0x2f1f('0x29')][_0x2f1f('0x46')](_0x1b80aa[_0x2f1f('0x47')],{})[_0x2f1f('0x24')](function(_0x587f62){var _0xc7b07b=_0x1b80aa[_0x2f1f('0x48')]['get']({'plain':!![]});if(!_0xc7b07b)throw new Error(_0x2f1f('0x49'));if(_0xc7b07b['role']==='user'){var _0x56dcee=_0x587f62[_0x2f1f('0x4a')]({'plain':!![]});var _0x1aa12b=_0x2f1f('0x23');return db[_0x2f1f('0x4b')][_0x2f1f('0x44')]({'where':{'name':_0x1aa12b,'userProfileId':_0xc7b07b[_0x2f1f('0x4c')]},'raw':!![]})[_0x2f1f('0x24')](function(_0x444de5){if(_0x444de5&&_0x444de5[_0x2f1f('0x4d')]===0x0){return db[_0x2f1f('0x4e')][_0x2f1f('0x46')]({'name':_0x56dcee[_0x2f1f('0x26')],'resourceId':_0x56dcee['id'],'type':_0x444de5[_0x2f1f('0x26')],'sectionId':_0x444de5['id']},{})[_0x2f1f('0x24')](function(){return _0x587f62;});}else{return _0x587f62;}})[_0x2f1f('0x45')](function(_0x4066d3){logger['error'](_0x2f1f('0x4f'),_0x4066d3);throw _0x4066d3;});}return _0x587f62;})[_0x2f1f('0x24')](respondWithResult(_0xef7ce9,0xc9))[_0x2f1f('0x45')](handleError(_0xef7ce9,null));};exports[_0x2f1f('0x21')]=function(_0x195d80,_0x4909be){if(_0x195d80['body']['id']){delete _0x195d80['body']['id'];}return db[_0x2f1f('0x29')][_0x2f1f('0x44')]({'where':{'id':_0x195d80[_0x2f1f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4909be,null))['then'](saveUpdates(_0x195d80[_0x2f1f('0x47')],null))[_0x2f1f('0x24')](respondWithResult(_0x4909be,null))[_0x2f1f('0x45')](handleError(_0x4909be,null));};exports[_0x2f1f('0x22')]=function(_0x351ad8,_0x175be3){return db[_0x2f1f('0x29')][_0x2f1f('0x44')]({'where':{'id':_0x351ad8['params']['id']}})[_0x2f1f('0x24')](handleEntityNotFound(_0x175be3,null))[_0x2f1f('0x24')](removeEntity(_0x175be3,null))[_0x2f1f('0x45')](handleError(_0x175be3,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 0eee5eb..434cc4b 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 _0x63ac=['rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','lodash','../../config/logger','api','request-promise','path'];(function(_0x485f74,_0x24de26){var _0x14e0ff=function(_0x407a70){while(--_0x407a70){_0x485f74['push'](_0x485f74['shift']());}};_0x14e0ff(++_0x24de26);}(_0x63ac,0x181));var _0xc63a=function(_0x5458a6,_0x1688c5){_0x5458a6=_0x5458a6-0x0;var _0x2669fc=_0x63ac[_0x5458a6];return _0x2669fc;};'use strict';var _=require(_0xc63a('0x0'));var util=require('util');var logger=require(_0xc63a('0x1'))(_0xc63a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc63a('0x3'));var fs=require('fs');var path=require(_0xc63a('0x4'));var rimraf=require(_0xc63a('0x5'));var config=require(_0xc63a('0x6'));var attributes=require(_0xc63a('0x7'));module[_0xc63a('0x8')]=function(_0x425be2,_0x267a51){return _0x425be2['define'](_0xc63a('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ae8=['AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x2383e1,_0x4b164b){var _0x163549=function(_0x4006f5){while(--_0x4006f5){_0x2383e1['push'](_0x2383e1['shift']());}};_0x163549(++_0x4b164b);}(_0x0ae8,0xb8));var _0x80ae=function(_0x409582,_0x1f0415){_0x409582=_0x409582-0x0;var _0xc9369d=_0x0ae8[_0x409582];return _0xc9369d;};'use strict';var _=require(_0x80ae('0x0'));var util=require(_0x80ae('0x1'));var logger=require(_0x80ae('0x2'))(_0x80ae('0x3'));var moment=require(_0x80ae('0x4'));var BPromise=require(_0x80ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80ae('0x6'));var rimraf=require('rimraf');var config=require(_0x80ae('0x7'));var attributes=require(_0x80ae('0x8'));module[_0x80ae('0x9')]=function(_0x3b1c1d,_0x196b23){return _0x3b1c1d[_0x80ae('0xa')](_0x80ae('0xb'),attributes,{'tableName':_0x80ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index bcb3791..af91092 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 _0x8c99=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x172ed7,_0x3d08fd){var _0xfa8f61=function(_0xe07a21){while(--_0xe07a21){_0x172ed7['push'](_0x172ed7['shift']());}};_0xfa8f61(++_0x3d08fd);}(_0x8c99,0x1a8));var _0x98c9=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0x8c99[_0xb725be];return _0x2f2424;};'use strict';var _=require(_0x98c9('0x0'));var util=require(_0x98c9('0x1'));var moment=require(_0x98c9('0x2'));var BPromise=require(_0x98c9('0x3'));var rs=require(_0x98c9('0x4'));var fs=require('fs');var Redis=require(_0x98c9('0x5'));var db=require(_0x98c9('0x6'))['db'];var utils=require(_0x98c9('0x7'));var logger=require(_0x98c9('0x8'))(_0x98c9('0x9'));var config=require(_0x98c9('0xa'));var jayson=require(_0x98c9('0xb'));var client=jayson['client'][_0x98c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ed2b6,_0x538465,_0x4af8a6){return new BPromise(function(_0x5b983e,_0xc789b1){return client[_0x98c9('0xd')](_0x2ed2b6,_0x4af8a6)[_0x98c9('0xe')](function(_0x4052cf){logger[_0x98c9('0xf')](_0x98c9('0x10'),_0x538465,_0x98c9('0x11'));logger[_0x98c9('0x12')](_0x98c9('0x13'),_0x538465,_0x98c9('0x11'),JSON[_0x98c9('0x14')](_0x4052cf));if(_0x4052cf['error']){if(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x16')]===0x1f4){logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x4052cf['error'][_0x98c9('0x17')]);return _0xc789b1(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x17')]);}logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x4052cf['error'][_0x98c9('0x17')]);return _0x5b983e(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x17')]);}else{logger[_0x98c9('0xf')](_0x98c9('0x10'),_0x538465,_0x98c9('0x11'));_0x5b983e(_0x4052cf[_0x98c9('0x18')][_0x98c9('0x17')]);}})[_0x98c9('0x19')](function(_0x2bb8b6){logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x2bb8b6);_0xc789b1(_0x2bb8b6);});});}
\ No newline at end of file
+var _0xc5ba=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x23a081,_0x14d0cc){var _0x3ba8d2=function(_0x66876b){while(--_0x66876b){_0x23a081['push'](_0x23a081['shift']());}};_0x3ba8d2(++_0x14d0cc);}(_0xc5ba,0xb9));var _0xac5b=function(_0x36ca7f,_0x337025){_0x36ca7f=_0x36ca7f-0x0;var _0x1dedcd=_0xc5ba[_0x36ca7f];return _0x1dedcd;};'use strict';var _=require(_0xac5b('0x0'));var util=require(_0xac5b('0x1'));var moment=require(_0xac5b('0x2'));var BPromise=require(_0xac5b('0x3'));var rs=require(_0xac5b('0x4'));var fs=require('fs');var Redis=require(_0xac5b('0x5'));var db=require(_0xac5b('0x6'))['db'];var utils=require(_0xac5b('0x7'));var logger=require(_0xac5b('0x8'))(_0xac5b('0x9'));var config=require(_0xac5b('0xa'));var jayson=require(_0xac5b('0xb'));var client=jayson[_0xac5b('0xc')][_0xac5b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x38602a,_0xc09fbc,_0xc193a7){return new BPromise(function(_0x4a7fc7,_0x525e20){return client[_0xac5b('0xe')](_0x38602a,_0xc193a7)['then'](function(_0x3c5bd3){logger[_0xac5b('0xf')](_0xac5b('0x10'),_0xc09fbc,_0xac5b('0x11'));logger[_0xac5b('0x12')](_0xac5b('0x13'),_0xc09fbc,_0xac5b('0x11'),JSON[_0xac5b('0x14')](_0x3c5bd3));if(_0x3c5bd3[_0xac5b('0x15')]){if(_0x3c5bd3['error'][_0xac5b('0x16')]===0x1f4){logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);return _0x525e20(_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);}logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);return _0x4a7fc7(_0x3c5bd3[_0xac5b('0x15')]['message']);}else{logger[_0xac5b('0xf')](_0xac5b('0x10'),_0xc09fbc,_0xac5b('0x11'));_0x4a7fc7(_0x3c5bd3[_0xac5b('0x18')][_0xac5b('0x17')]);}})[_0xac5b('0x19')](function(_0x363de5){logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x363de5);_0x525e20(_0x363de5);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index fec8cf3..b710d3f 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 _0xf0f4=['./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','util','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x517244,_0x384ca3){var _0x490086=function(_0x33d25a){while(--_0x33d25a){_0x517244['push'](_0x517244['shift']());}};_0x490086(++_0x384ca3);}(_0xf0f4,0x182));var _0x4f0f=function(_0x433a86,_0x245383){_0x433a86=_0x433a86-0x0;var _0x2f1983=_0xf0f4[_0x433a86];return _0x2f1983;};'use strict';var multer=require('multer');var util=require(_0x4f0f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4f0f('0x1'));var router=express[_0x4f0f('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x4f0f('0x3'));var config=require(_0x4f0f('0x4'));var controller=require(_0x4f0f('0x5'));router[_0x4f0f('0x6')]('/',auth[_0x4f0f('0x7')](),controller[_0x4f0f('0x8')]);router[_0x4f0f('0x6')]('/:id',auth[_0x4f0f('0x7')](),controller[_0x4f0f('0x9')]);router[_0x4f0f('0xa')]('/',auth['isAuthenticated'](),controller[_0x4f0f('0xb')]);router[_0x4f0f('0xc')](_0x4f0f('0xd'),auth[_0x4f0f('0x7')](),controller[_0x4f0f('0xe')]);router[_0x4f0f('0xf')](_0x4f0f('0xd'),auth[_0x4f0f('0x7')](),controller['destroy']);module[_0x4f0f('0x10')]=router;
\ No newline at end of file
+var _0x6ac2=['isAuthenticated','index','get','/:id','show','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x259cb2,_0x1da73f){var _0x7d3865=function(_0x23d951){while(--_0x23d951){_0x259cb2['push'](_0x259cb2['shift']());}};_0x7d3865(++_0x1da73f);}(_0x6ac2,0x184));var _0x26ac=function(_0x33e906,_0x255466){_0x33e906=_0x33e906-0x0;var _0x4d66c5=_0x6ac2[_0x33e906];return _0x4d66c5;};'use strict';var multer=require(_0x26ac('0x0'));var util=require('util');var path=require(_0x26ac('0x1'));var timeout=require(_0x26ac('0x2'));var express=require(_0x26ac('0x3'));var router=express[_0x26ac('0x4')]();var auth=require(_0x26ac('0x5'));var interaction=require(_0x26ac('0x6'));var config=require('../../config/environment');var controller=require(_0x26ac('0x7'));router['get']('/',auth[_0x26ac('0x8')](),controller[_0x26ac('0x9')]);router[_0x26ac('0xa')](_0x26ac('0xb'),auth[_0x26ac('0x8')](),controller[_0x26ac('0xc')]);router[_0x26ac('0xd')]('/',auth[_0x26ac('0x8')](),controller['create']);router['put'](_0x26ac('0xb'),auth[_0x26ac('0x8')](),controller[_0x26ac('0xe')]);router[_0x26ac('0xf')]('/:id',auth[_0x26ac('0x8')](),controller[_0x26ac('0x10')]);module[_0x26ac('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 79eb15a..bb6cd21 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 _0x0cc8=['sequelize','exports','TEXT'];(function(_0x488074,_0x54c391){var _0x1eb231=function(_0x5a95b4){while(--_0x5a95b4){_0x488074['push'](_0x488074['shift']());}};_0x1eb231(++_0x54c391);}(_0x0cc8,0x1ad));var _0x80cc=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0x0cc8[_0x390a19];return _0x5d8230;};'use strict';var Sequelize=require(_0x80cc('0x0'));module[_0x80cc('0x1')]={'tree':{'type':Sequelize[_0x80cc('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x1824=['exports','sequelize'];(function(_0x4ec784,_0x3995d7){var _0x4e3ec3=function(_0x320c60){while(--_0x320c60){_0x4ec784['push'](_0x4ec784['shift']());}};_0x4e3ec3(++_0x3995d7);}(_0x1824,0xb7));var _0x4182=function(_0x3a8d35,_0x1dfc4){_0x3a8d35=_0x3a8d35-0x0;var _0x36cb6d=_0x1824[_0x3a8d35];return _0x36cb6d;};'use strict';var Sequelize=require(_0x4182('0x0'));module[_0x4182('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 662ae2c..127ea85 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 _0x1a80=['json','apply','reject','save','update','then','destroy','name','send','index','AnalyticTreeReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','show','params','options','create','body','catch','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','set','Content-Range'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x1a80,0x11a));var _0x01a8=function(_0x488bf8,_0x36e139){_0x488bf8=_0x488bf8-0x0;var _0x3b57c1=_0x1a80[_0x488bf8];return _0x3b57c1;};'use strict';var pdf=require(_0x01a8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x01a8('0x1'));var zipdir=require(_0x01a8('0x2'));var jsonpatch=require(_0x01a8('0x3'));var rp=require(_0x01a8('0x4'));var moment=require(_0x01a8('0x5'));var BPromise=require(_0x01a8('0x6'));var Mustache=require(_0x01a8('0x7'));var util=require(_0x01a8('0x8'));var path=require(_0x01a8('0x9'));var sox=require(_0x01a8('0xa'));var csv=require(_0x01a8('0xb'));var ejs=require(_0x01a8('0xc'));var fs=require('fs');var _=require(_0x01a8('0xd'));var squel=require(_0x01a8('0xe'));var crypto=require('crypto');var jsforce=require(_0x01a8('0xf'));var deskjs=require(_0x01a8('0x10'));var toCsv=require('to-csv');var querystring=require(_0x01a8('0x11'));var Papa=require(_0x01a8('0x12'));var Redis=require(_0x01a8('0x13'));var authService=require(_0x01a8('0x14'));var qs=require(_0x01a8('0x15'));var hardwareService=require(_0x01a8('0x16'));var logger=require(_0x01a8('0x17'))(_0x01a8('0x18'));var utils=require(_0x01a8('0x19'));var config=require(_0x01a8('0x1a'));var db=require(_0x01a8('0x1b'))['db'];function respondWithStatusCode(_0x2a454e,_0x3054d5){_0x3054d5=_0x3054d5||0xcc;return function(_0x5c9027){if(_0x5c9027){return _0x2a454e[_0x01a8('0x1c')](_0x3054d5);}return _0x2a454e['status'](_0x3054d5)[_0x01a8('0x1d')]();};}function respondWithResult(_0x1c5c10,_0x44560d){_0x44560d=_0x44560d||0xc8;return function(_0x2435c1){if(_0x2435c1){return _0x1c5c10[_0x01a8('0x1e')](_0x44560d)['json'](_0x2435c1);}};}function respondWithFilteredResult(_0x14b755,_0x287ff0){return function(_0x2496a8){if(_0x2496a8){var _0x3bf501=_0x2496a8['count'],_0x3fda37=_0x287ff0[_0x01a8('0x1f')],_0x177255=_0x287ff0[_0x01a8('0x1f')]+_0x287ff0['limit'],_0xb30c6c;if(_0x177255>=_0x3bf501){_0x177255=_0x3bf501;_0xb30c6c=0xc8;}else{_0xb30c6c=0xce;}_0x14b755[_0x01a8('0x1e')](_0xb30c6c);return _0x14b755[_0x01a8('0x20')](_0x01a8('0x21'),_0x3fda37+'-'+_0x177255+'/'+_0x3bf501)[_0x01a8('0x22')](_0x2496a8);}return null;};}function patchUpdates(_0x18df47){return function(_0x36f0c7){try{jsonpatch[_0x01a8('0x23')](_0x36f0c7,_0x18df47,!![]);}catch(_0x546162){return BPromise[_0x01a8('0x24')](_0x546162);}return _0x36f0c7[_0x01a8('0x25')]();};}function saveUpdates(_0x362bbe,_0x34f99d){return function(_0x4fa59a){if(_0x4fa59a){return _0x4fa59a[_0x01a8('0x26')](_0x362bbe)[_0x01a8('0x27')](function(_0x5e8284){return _0x5e8284;});}return null;};}function removeEntity(_0x31019d,_0x5b3b90){return function(_0x51c776){if(_0x51c776){return _0x51c776[_0x01a8('0x28')]()[_0x01a8('0x27')](function(){_0x31019d[_0x01a8('0x1e')](0xcc)[_0x01a8('0x1d')]();});}};}function handleEntityNotFound(_0x53281e,_0x58e7bf){return function(_0x21e825){if(!_0x21e825){_0x53281e[_0x01a8('0x1c')](0x194);}return _0x21e825;};}function handleError(_0x3b5d28,_0x2a78a1){_0x2a78a1=_0x2a78a1||0x1f4;return function(_0x277e86){logger['error'](_0x277e86['stack']);if(_0x277e86['name']){delete _0x277e86[_0x01a8('0x29')];}_0x3b5d28[_0x01a8('0x1e')](_0x2a78a1)[_0x01a8('0x2a')](_0x277e86);};}exports[_0x01a8('0x2b')]=function(_0x56ac35,_0x2e7b46){var _0x1b24b9={},_0x4fd44b={},_0x43312d={'count':0x0,'rows':[]};var _0x301df8=db[_0x01a8('0x2c')][_0x01a8('0x2d')];_0x4fd44b[_0x01a8('0x2e')]=_[_0x01a8('0x2f')](_0x301df8);_0x4fd44b[_0x01a8('0x30')]=_[_0x01a8('0x2f')](_0x56ac35[_0x01a8('0x30')]);_0x4fd44b[_0x01a8('0x31')]=_[_0x01a8('0x32')](_0x4fd44b['model'],_0x4fd44b[_0x01a8('0x30')]);_0x1b24b9[_0x01a8('0x33')]=_[_0x01a8('0x32')](_0x4fd44b[_0x01a8('0x2e')],qs[_0x01a8('0x34')](_0x56ac35[_0x01a8('0x30')]['fields']));_0x1b24b9[_0x01a8('0x33')]=_0x1b24b9[_0x01a8('0x33')]['length']?_0x1b24b9[_0x01a8('0x33')]:_0x4fd44b[_0x01a8('0x2e')];if(!_0x56ac35['query'][_0x01a8('0x35')](_0x01a8('0x36'))){_0x1b24b9['limit']=qs[_0x01a8('0x37')](_0x56ac35[_0x01a8('0x30')][_0x01a8('0x37')]);_0x1b24b9[_0x01a8('0x1f')]=qs[_0x01a8('0x1f')](_0x56ac35['query'][_0x01a8('0x1f')]);}_0x1b24b9[_0x01a8('0x38')]=qs[_0x01a8('0x39')](_0x56ac35[_0x01a8('0x30')]['sort']);_0x1b24b9[_0x01a8('0x3a')]=qs[_0x01a8('0x31')](_[_0x01a8('0x3b')](_0x56ac35[_0x01a8('0x30')],_0x4fd44b[_0x01a8('0x31')]));if(_0x56ac35[_0x01a8('0x30')][_0x01a8('0x3c')]){_0x1b24b9[_0x01a8('0x3a')]=_[_0x01a8('0x3d')](_0x1b24b9['where'],{'$or':_[_0x01a8('0x3e')](_0x301df8,function(_0x3617c8){if(_0x3617c8[_0x01a8('0x3f')][_0x01a8('0x40')]!==_0x01a8('0x41')){var _0x5f066e={};_0x5f066e[_0x3617c8[_0x01a8('0x42')]]={'$like':'%'+_0x56ac35[_0x01a8('0x30')][_0x01a8('0x3c')]+'%'};return _0x5f066e;}})});}_0x1b24b9=_['merge']({},_0x1b24b9,_0x56ac35['options']);var _0x489020={'where':_0x1b24b9[_0x01a8('0x3a')]};return db[_0x01a8('0x2c')][_0x01a8('0x43')](_0x489020)[_0x01a8('0x27')](function(_0x27d35d){_0x43312d['count']=_0x27d35d;if(_0x56ac35[_0x01a8('0x30')][_0x01a8('0x44')]){_0x1b24b9[_0x01a8('0x45')]=[{'all':!![]}];}return db[_0x01a8('0x2c')][_0x01a8('0x46')](_0x1b24b9);})[_0x01a8('0x27')](function(_0x403d00){_0x43312d[_0x01a8('0x47')]=_0x403d00;return _0x43312d;})[_0x01a8('0x27')](respondWithFilteredResult(_0x2e7b46,_0x1b24b9))['catch'](handleError(_0x2e7b46,null));};exports[_0x01a8('0x48')]=function(_0x40cfda,_0x51f203){var _0x205935={'raw':!![],'where':{'id':_0x40cfda[_0x01a8('0x49')]['id']}},_0x38f57c={};_0x38f57c['model']=_[_0x01a8('0x2f')](db[_0x01a8('0x2c')]['rawAttributes']);_0x38f57c[_0x01a8('0x30')]=_[_0x01a8('0x2f')](_0x40cfda[_0x01a8('0x30')]);_0x38f57c[_0x01a8('0x31')]=_[_0x01a8('0x32')](_0x38f57c['model'],_0x38f57c[_0x01a8('0x30')]);_0x205935['attributes']=_[_0x01a8('0x32')](_0x38f57c[_0x01a8('0x2e')],qs[_0x01a8('0x34')](_0x40cfda['query'][_0x01a8('0x34')]));_0x205935[_0x01a8('0x33')]=_0x205935[_0x01a8('0x33')]['length']?_0x205935[_0x01a8('0x33')]:_0x38f57c[_0x01a8('0x2e')];if(_0x40cfda[_0x01a8('0x30')][_0x01a8('0x44')]){_0x205935[_0x01a8('0x45')]=[{'all':!![]}];}_0x205935=_['merge']({},_0x205935,_0x40cfda[_0x01a8('0x4a')]);return db['AnalyticTreeReport']['find'](_0x205935)[_0x01a8('0x27')](handleEntityNotFound(_0x51f203,null))[_0x01a8('0x27')](respondWithResult(_0x51f203,null))['catch'](handleError(_0x51f203,null));};exports[_0x01a8('0x4b')]=function(_0x3520f6,_0x5b6066){return db[_0x01a8('0x2c')]['create'](_0x3520f6[_0x01a8('0x4c')],{})[_0x01a8('0x27')](respondWithResult(_0x5b6066,0xc9))[_0x01a8('0x4d')](handleError(_0x5b6066,null));};exports[_0x01a8('0x26')]=function(_0x1a00cc,_0x1cf469){if(_0x1a00cc[_0x01a8('0x4c')]['id']){delete _0x1a00cc['body']['id'];}return db[_0x01a8('0x2c')][_0x01a8('0x4e')]({'where':{'id':_0x1a00cc[_0x01a8('0x49')]['id']}})['then'](handleEntityNotFound(_0x1cf469,null))[_0x01a8('0x27')](saveUpdates(_0x1a00cc['body'],null))['then'](respondWithResult(_0x1cf469,null))['catch'](handleError(_0x1cf469,null));};exports[_0x01a8('0x28')]=function(_0x5ebd69,_0x530dea){return db['AnalyticTreeReport']['find']({'where':{'id':_0x5ebd69[_0x01a8('0x49')]['id']}})[_0x01a8('0x27')](handleEntityNotFound(_0x530dea,null))['then'](removeEntity(_0x530dea,null))['catch'](handleError(_0x530dea,null));};
\ No newline at end of file
+var _0x2769=['limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','AnalyticTreeReport','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x2b1237,_0xcffa7a){var _0x1a86cc=function(_0x32de42){while(--_0x32de42){_0x2b1237['push'](_0x2b1237['shift']());}};_0x1a86cc(++_0xcffa7a);}(_0x2769,0x149));var _0x9276=function(_0x9943f7,_0x5beafd){_0x9943f7=_0x9943f7-0x0;var _0x3c85b8=_0x2769[_0x9943f7];return _0x3c85b8;};'use strict';var pdf=require(_0x9276('0x0'));var emlformat=require(_0x9276('0x1'));var rimraf=require(_0x9276('0x2'));var zipdir=require(_0x9276('0x3'));var jsonpatch=require(_0x9276('0x4'));var rp=require(_0x9276('0x5'));var moment=require(_0x9276('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x9276('0x7'));var util=require(_0x9276('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x9276('0x9'));var ejs=require(_0x9276('0xa'));var fs=require('fs');var _=require(_0x9276('0xb'));var squel=require('squel');var crypto=require(_0x9276('0xc'));var jsforce=require(_0x9276('0xd'));var deskjs=require(_0x9276('0xe'));var toCsv=require(_0x9276('0x9'));var querystring=require('querystring');var Papa=require(_0x9276('0xf'));var Redis=require(_0x9276('0x10'));var authService=require(_0x9276('0x11'));var qs=require(_0x9276('0x12'));var hardwareService=require(_0x9276('0x13'));var logger=require(_0x9276('0x14'))(_0x9276('0x15'));var utils=require(_0x9276('0x16'));var config=require(_0x9276('0x17'));var db=require(_0x9276('0x18'))['db'];function respondWithStatusCode(_0x88188e,_0x5b0d84){_0x5b0d84=_0x5b0d84||0xcc;return function(_0x449fbd){if(_0x449fbd){return _0x88188e[_0x9276('0x19')](_0x5b0d84);}return _0x88188e[_0x9276('0x1a')](_0x5b0d84)[_0x9276('0x1b')]();};}function respondWithResult(_0x4abfa7,_0x5d119c){_0x5d119c=_0x5d119c||0xc8;return function(_0x322570){if(_0x322570){return _0x4abfa7[_0x9276('0x1a')](_0x5d119c)[_0x9276('0x1c')](_0x322570);}};}function respondWithFilteredResult(_0x359d78,_0x500c52){return function(_0x2a7c9f){if(_0x2a7c9f){var _0x540dba=_0x2a7c9f[_0x9276('0x1d')],_0x9f63f0=_0x500c52[_0x9276('0x1e')],_0x3b2cf1=_0x500c52[_0x9276('0x1e')]+_0x500c52[_0x9276('0x1f')],_0x230c59;if(_0x3b2cf1>=_0x540dba){_0x3b2cf1=_0x540dba;_0x230c59=0xc8;}else{_0x230c59=0xce;}_0x359d78[_0x9276('0x1a')](_0x230c59);return _0x359d78[_0x9276('0x20')](_0x9276('0x21'),_0x9f63f0+'-'+_0x3b2cf1+'/'+_0x540dba)[_0x9276('0x1c')](_0x2a7c9f);}return null;};}function patchUpdates(_0x38c25c){return function(_0x4fb836){try{jsonpatch['apply'](_0x4fb836,_0x38c25c,!![]);}catch(_0x309ef9){return BPromise['reject'](_0x309ef9);}return _0x4fb836[_0x9276('0x22')]();};}function saveUpdates(_0x3996a4,_0x31d5a1){return function(_0x45249c){if(_0x45249c){return _0x45249c[_0x9276('0x23')](_0x3996a4)[_0x9276('0x24')](function(_0x2837ef){return _0x2837ef;});}return null;};}function removeEntity(_0x4d56b3,_0x261169){return function(_0x464892){if(_0x464892){return _0x464892[_0x9276('0x25')]()[_0x9276('0x24')](function(){_0x4d56b3[_0x9276('0x1a')](0xcc)[_0x9276('0x1b')]();});}};}function handleEntityNotFound(_0x57dc93,_0x5b24fb){return function(_0x3c573e){if(!_0x3c573e){_0x57dc93[_0x9276('0x19')](0x194);}return _0x3c573e;};}function handleError(_0x2dc6f9,_0x4e3bbf){_0x4e3bbf=_0x4e3bbf||0x1f4;return function(_0x3a1167){logger[_0x9276('0x26')](_0x3a1167[_0x9276('0x27')]);if(_0x3a1167[_0x9276('0x28')]){delete _0x3a1167[_0x9276('0x28')];}_0x2dc6f9[_0x9276('0x1a')](_0x4e3bbf)[_0x9276('0x29')](_0x3a1167);};}exports['index']=function(_0x19922b,_0x20c3a0){var _0x5d4a14={},_0x450446={},_0x4b8662={'count':0x0,'rows':[]};var _0x44e62a=db[_0x9276('0x2a')][_0x9276('0x2b')];_0x450446[_0x9276('0x2c')]=_['keys'](_0x44e62a);_0x450446[_0x9276('0x2d')]=_[_0x9276('0x2e')](_0x19922b[_0x9276('0x2d')]);_0x450446[_0x9276('0x2f')]=_['intersection'](_0x450446[_0x9276('0x2c')],_0x450446[_0x9276('0x2d')]);_0x5d4a14['attributes']=_[_0x9276('0x30')](_0x450446[_0x9276('0x2c')],qs['fields'](_0x19922b[_0x9276('0x2d')][_0x9276('0x31')]));_0x5d4a14[_0x9276('0x32')]=_0x5d4a14[_0x9276('0x32')][_0x9276('0x33')]?_0x5d4a14[_0x9276('0x32')]:_0x450446[_0x9276('0x2c')];if(!_0x19922b[_0x9276('0x2d')]['hasOwnProperty'](_0x9276('0x34'))){_0x5d4a14[_0x9276('0x1f')]=qs[_0x9276('0x1f')](_0x19922b['query'][_0x9276('0x1f')]);_0x5d4a14[_0x9276('0x1e')]=qs['offset'](_0x19922b[_0x9276('0x2d')][_0x9276('0x1e')]);}_0x5d4a14['order']=qs[_0x9276('0x35')](_0x19922b[_0x9276('0x2d')][_0x9276('0x35')]);_0x5d4a14[_0x9276('0x36')]=qs[_0x9276('0x2f')](_[_0x9276('0x37')](_0x19922b[_0x9276('0x2d')],_0x450446[_0x9276('0x2f')]));if(_0x19922b[_0x9276('0x2d')]['filter']){_0x5d4a14[_0x9276('0x36')]=_[_0x9276('0x38')](_0x5d4a14[_0x9276('0x36')],{'$or':_[_0x9276('0x39')](_0x44e62a,function(_0x5273d7){if(_0x5273d7[_0x9276('0x3a')][_0x9276('0x3b')]!==_0x9276('0x3c')){var _0x57da38={};_0x57da38[_0x5273d7['field']]={'$like':'%'+_0x19922b['query'][_0x9276('0x3d')]+'%'};return _0x57da38;}})});}_0x5d4a14=_['merge']({},_0x5d4a14,_0x19922b[_0x9276('0x3e')]);var _0x182d21={'where':_0x5d4a14['where']};return db[_0x9276('0x2a')]['count'](_0x182d21)[_0x9276('0x24')](function(_0x452124){_0x4b8662['count']=_0x452124;if(_0x19922b[_0x9276('0x2d')][_0x9276('0x3f')]){_0x5d4a14[_0x9276('0x40')]=[{'all':!![]}];}return db[_0x9276('0x2a')]['findAll'](_0x5d4a14);})['then'](function(_0x159765){_0x4b8662[_0x9276('0x41')]=_0x159765;return _0x4b8662;})['then'](respondWithFilteredResult(_0x20c3a0,_0x5d4a14))[_0x9276('0x42')](handleError(_0x20c3a0,null));};exports[_0x9276('0x43')]=function(_0xf2af54,_0x1efbfb){var _0x4c0db8={'raw':!![],'where':{'id':_0xf2af54[_0x9276('0x44')]['id']}},_0x4413f4={};_0x4413f4[_0x9276('0x2c')]=_['keys'](db[_0x9276('0x2a')]['rawAttributes']);_0x4413f4[_0x9276('0x2d')]=_[_0x9276('0x2e')](_0xf2af54[_0x9276('0x2d')]);_0x4413f4[_0x9276('0x2f')]=_[_0x9276('0x30')](_0x4413f4[_0x9276('0x2c')],_0x4413f4[_0x9276('0x2d')]);_0x4c0db8[_0x9276('0x32')]=_['intersection'](_0x4413f4['model'],qs[_0x9276('0x31')](_0xf2af54[_0x9276('0x2d')][_0x9276('0x31')]));_0x4c0db8[_0x9276('0x32')]=_0x4c0db8[_0x9276('0x32')]['length']?_0x4c0db8[_0x9276('0x32')]:_0x4413f4[_0x9276('0x2c')];if(_0xf2af54[_0x9276('0x2d')]['includeAll']){_0x4c0db8[_0x9276('0x40')]=[{'all':!![]}];}_0x4c0db8=_[_0x9276('0x38')]({},_0x4c0db8,_0xf2af54['options']);return db['AnalyticTreeReport'][_0x9276('0x45')](_0x4c0db8)['then'](handleEntityNotFound(_0x1efbfb,null))[_0x9276('0x24')](respondWithResult(_0x1efbfb,null))[_0x9276('0x42')](handleError(_0x1efbfb,null));};exports[_0x9276('0x46')]=function(_0x25f63e,_0x23a7bc){return db[_0x9276('0x2a')][_0x9276('0x46')](_0x25f63e[_0x9276('0x47')],{})['then'](respondWithResult(_0x23a7bc,0xc9))[_0x9276('0x42')](handleError(_0x23a7bc,null));};exports[_0x9276('0x23')]=function(_0xbbbe84,_0x3730a5){if(_0xbbbe84[_0x9276('0x47')]['id']){delete _0xbbbe84[_0x9276('0x47')]['id'];}return db[_0x9276('0x2a')][_0x9276('0x45')]({'where':{'id':_0xbbbe84[_0x9276('0x44')]['id']}})['then'](handleEntityNotFound(_0x3730a5,null))[_0x9276('0x24')](saveUpdates(_0xbbbe84['body'],null))[_0x9276('0x24')](respondWithResult(_0x3730a5,null))[_0x9276('0x42')](handleError(_0x3730a5,null));};exports['destroy']=function(_0x1992dd,_0x5dbfb3){return db[_0x9276('0x2a')][_0x9276('0x45')]({'where':{'id':_0x1992dd[_0x9276('0x44')]['id']}})[_0x9276('0x24')](handleEntityNotFound(_0x5dbfb3,null))[_0x9276('0x24')](removeEntity(_0x5dbfb3,null))['catch'](handleError(_0x5dbfb3,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 2f07ef2..5cda660 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 _0xf350=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees'];(function(_0xe6cbf9,_0x6123c2){var _0x172772=function(_0x32ca7d){while(--_0x32ca7d){_0xe6cbf9['push'](_0xe6cbf9['shift']());}};_0x172772(++_0x6123c2);}(_0xf350,0xab));var _0x0f35=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf350[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0f35('0x0'));var util=require(_0x0f35('0x1'));var logger=require(_0x0f35('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f35('0x3'));var rp=require(_0x0f35('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f35('0x5'));var config=require('../../config/environment');var attributes=require(_0x0f35('0x6'));module['exports']=function(_0xe6e9fa,_0x476df5){return _0xe6e9fa['define'](_0x0f35('0x7'),attributes,{'tableName':_0x0f35('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b59=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','api','moment','bluebird','request-promise'];(function(_0x1d7eef,_0x1bffd6){var _0x16f164=function(_0x10ec82){while(--_0x10ec82){_0x1d7eef['push'](_0x1d7eef['shift']());}};_0x16f164(++_0x1bffd6);}(_0x8b59,0xc2));var _0x98b5=function(_0x5993af,_0x5c013){_0x5993af=_0x5993af-0x0;var _0x3cdd5f=_0x8b59[_0x5993af];return _0x3cdd5f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x98b5('0x0'));var moment=require(_0x98b5('0x1'));var BPromise=require(_0x98b5('0x2'));var rp=require(_0x98b5('0x3'));var fs=require('fs');var path=require(_0x98b5('0x4'));var rimraf=require(_0x98b5('0x5'));var config=require(_0x98b5('0x6'));var attributes=require(_0x98b5('0x7'));module[_0x98b5('0x8')]=function(_0x1f2e7f,_0x4b54e3){return _0x1f2e7f[_0x98b5('0x9')](_0x98b5('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 60db635..34fa8e9 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 _0x6e02=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','AnalyticTreeReport,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x6e02,0x12e));var _0x26e0=function(_0x1d37b5,_0x2b4baf){_0x1d37b5=_0x1d37b5-0x0;var _0xb88348=_0x6e02[_0x1d37b5];return _0xb88348;};'use strict';var _=require(_0x26e0('0x0'));var util=require(_0x26e0('0x1'));var moment=require('moment');var BPromise=require(_0x26e0('0x2'));var rs=require(_0x26e0('0x3'));var fs=require('fs');var Redis=require(_0x26e0('0x4'));var db=require(_0x26e0('0x5'))['db'];var utils=require(_0x26e0('0x6'));var logger=require(_0x26e0('0x7'))(_0x26e0('0x8'));var config=require('../../config/environment');var jayson=require(_0x26e0('0x9'));var client=jayson[_0x26e0('0xa')][_0x26e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11fc5a,_0x490fdf,_0x4b39f2){return new BPromise(function(_0x5ad18d,_0x14ce16){return client[_0x26e0('0xc')](_0x11fc5a,_0x4b39f2)[_0x26e0('0xd')](function(_0x10d24c){logger[_0x26e0('0xe')]('AnalyticTreeReport,\x20%s,\x20%s',_0x490fdf,_0x26e0('0xf'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x490fdf,_0x26e0('0xf'),JSON[_0x26e0('0x10')](_0x10d24c));if(_0x10d24c[_0x26e0('0x11')]){if(_0x10d24c[_0x26e0('0x11')][_0x26e0('0x12')]===0x1f4){logger[_0x26e0('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0x490fdf,_0x10d24c[_0x26e0('0x11')]['message']);return _0x14ce16(_0x10d24c['error'][_0x26e0('0x13')]);}logger[_0x26e0('0x11')](_0x26e0('0x14'),_0x490fdf,_0x10d24c[_0x26e0('0x11')][_0x26e0('0x13')]);return _0x5ad18d(_0x10d24c[_0x26e0('0x11')][_0x26e0('0x13')]);}else{logger[_0x26e0('0xe')](_0x26e0('0x14'),_0x490fdf,'request\x20sent');_0x5ad18d(_0x10d24c['result'][_0x26e0('0x13')]);}})[_0x26e0('0x15')](function(_0x422c32){logger['error'](_0x26e0('0x14'),_0x490fdf,_0x422c32);_0x14ce16(_0x422c32);});});}
\ No newline at end of file
+var _0xfc05=['../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticTreeReport,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2bf799,_0x3d81dc){var _0x220479=function(_0x3ca801){while(--_0x3ca801){_0x2bf799['push'](_0x2bf799['shift']());}};_0x220479(++_0x3d81dc);}(_0xfc05,0x7f));var _0x5fc0=function(_0x34697,_0x4f61cc){_0x34697=_0x34697-0x0;var _0xc15421=_0xfc05[_0x34697];return _0xc15421;};'use strict';var _=require(_0x5fc0('0x0'));var util=require(_0x5fc0('0x1'));var moment=require('moment');var BPromise=require(_0x5fc0('0x2'));var rs=require(_0x5fc0('0x3'));var fs=require('fs');var Redis=require(_0x5fc0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5fc0('0x5'));var logger=require(_0x5fc0('0x6'))(_0x5fc0('0x7'));var config=require('../../config/environment');var jayson=require(_0x5fc0('0x8'));var client=jayson[_0x5fc0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d1328,_0x4eb96b,_0x391572){return new BPromise(function(_0x2f7441,_0x354991){return client[_0x5fc0('0xa')](_0x5d1328,_0x391572)[_0x5fc0('0xb')](function(_0x44ed27){logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0x4eb96b,'request\x20sent');logger['debug'](_0x5fc0('0xc'),_0x4eb96b,_0x5fc0('0xd'),JSON[_0x5fc0('0xe')](_0x44ed27));if(_0x44ed27[_0x5fc0('0xf')]){if(_0x44ed27[_0x5fc0('0xf')]['code']===0x1f4){logger['error'](_0x5fc0('0x10'),_0x4eb96b,_0x44ed27[_0x5fc0('0xf')][_0x5fc0('0x11')]);return _0x354991(_0x44ed27[_0x5fc0('0xf')][_0x5fc0('0x11')]);}logger[_0x5fc0('0xf')](_0x5fc0('0x10'),_0x4eb96b,_0x44ed27[_0x5fc0('0xf')][_0x5fc0('0x11')]);return _0x2f7441(_0x44ed27[_0x5fc0('0xf')][_0x5fc0('0x11')]);}else{logger['info'](_0x5fc0('0x10'),_0x4eb96b,_0x5fc0('0xd'));_0x2f7441(_0x44ed27['result']['message']);}})[_0x5fc0('0x12')](function(_0x3b02a2){logger[_0x5fc0('0xf')](_0x5fc0('0x10'),_0x4eb96b,_0x3b02a2);_0x354991(_0x3b02a2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 2c487f2..d55e576 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 _0x862f=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','delete','destroy','multer','util'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0x862f,0x10e));var _0xf862=function(_0x53baba,_0x2e88e0){_0x53baba=_0x53baba-0x0;var _0x5b1801=_0x862f[_0x53baba];return _0x5b1801;};'use strict';var multer=require(_0xf862('0x0'));var util=require(_0xf862('0x1'));var path=require(_0xf862('0x2'));var timeout=require(_0xf862('0x3'));var express=require(_0xf862('0x4'));var router=express[_0xf862('0x5')]();var auth=require(_0xf862('0x6'));var interaction=require(_0xf862('0x7'));var config=require(_0xf862('0x8'));var controller=require('./analyticTreeReport.controller');router[_0xf862('0x9')]('/',auth[_0xf862('0xa')](),controller['index']);router['get'](_0xf862('0xb'),auth[_0xf862('0xa')](),controller['show']);router[_0xf862('0xc')]('/',auth[_0xf862('0xa')](),controller[_0xf862('0xd')]);router[_0xf862('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf862('0xf')](_0xf862('0xb'),auth['isAuthenticated'](),controller[_0xf862('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x7d2d=['./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','delete','/:id','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x48cc5a,_0x5c5b07){var _0x258471=function(_0x4f4693){while(--_0x4f4693){_0x48cc5a['push'](_0x48cc5a['shift']());}};_0x258471(++_0x5c5b07);}(_0x7d2d,0x16a));var _0xd7d2=function(_0x2e64d4,_0x10b372){_0x2e64d4=_0x2e64d4-0x0;var _0x347261=_0x7d2d[_0x2e64d4];return _0x347261;};'use strict';var multer=require(_0xd7d2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd7d2('0x1'));var express=require(_0xd7d2('0x2'));var router=express[_0xd7d2('0x3')]();var auth=require(_0xd7d2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd7d2('0x5'));var controller=require(_0xd7d2('0x6'));router[_0xd7d2('0x7')]('/',auth[_0xd7d2('0x8')](),controller[_0xd7d2('0x9')]);router[_0xd7d2('0x7')]('/:id',auth[_0xd7d2('0x8')](),controller[_0xd7d2('0xa')]);router[_0xd7d2('0xb')]('/',auth[_0xd7d2('0x8')](),controller[_0xd7d2('0xc')]);router['put']('/:id',auth[_0xd7d2('0x8')](),controller['update']);router[_0xd7d2('0xd')](_0xd7d2('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xd7d2('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index cb1f7aa..fd659eb 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 _0x66b1=['exports','STRING','sequelize'];(function(_0x2866d0,_0x5ace5f){var _0x4f0033=function(_0x2c1231){while(--_0x2c1231){_0x2866d0['push'](_0x2866d0['shift']());}};_0x4f0033(++_0x5ace5f);}(_0x66b1,0xa7));var _0x166b=function(_0x5101c2,_0xea2d47){_0x5101c2=_0x5101c2-0x0;var _0x1ed61b=_0x66b1[_0x5101c2];return _0x1ed61b;};'use strict';var Sequelize=require(_0x166b('0x0'));module[_0x166b('0x1')]={'name':{'type':Sequelize[_0x166b('0x2')]},'basename':{'type':Sequelize[_0x166b('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xaa3f=['STRING'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xaa3f,0x92));var _0xfaa3=function(_0x4f6ad3,_0x9c2509){_0x4f6ad3=_0x4f6ad3-0x0;var _0x518d43=_0xaa3f[_0x4f6ad3];return _0x518d43;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfaa3('0x0')]},'basename':{'type':Sequelize[_0xfaa3('0x0')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 167fb21..95ca9ca 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 _0x1bf2=['bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','sendStatus','end','count','offset','set','json','apply','reject','save','then','destroy','status','name','index','Attachment','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','show','params','includeAll','find','catch','update','body','file','originalname','basename','filename','mimetype','create','download','findOne','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3e6946,_0x29fdd6){var _0x46a25a=function(_0x344719){while(--_0x344719){_0x3e6946['push'](_0x3e6946['shift']());}};_0x46a25a(++_0x29fdd6);}(_0x1bf2,0x94));var _0x21bf=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x1bf2[_0x49ca18];return _0x145d54;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x21bf('0x0'));var rimraf=require(_0x21bf('0x1'));var zipdir=require(_0x21bf('0x2'));var jsonpatch=require(_0x21bf('0x3'));var rp=require(_0x21bf('0x4'));var moment=require(_0x21bf('0x5'));var BPromise=require(_0x21bf('0x6'));var Mustache=require(_0x21bf('0x7'));var util=require(_0x21bf('0x8'));var path=require(_0x21bf('0x9'));var sox=require(_0x21bf('0xa'));var csv=require(_0x21bf('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x21bf('0xc'));var squel=require('squel');var crypto=require(_0x21bf('0xd'));var jsforce=require(_0x21bf('0xe'));var deskjs=require(_0x21bf('0xf'));var toCsv=require(_0x21bf('0xb'));var querystring=require('querystring');var Papa=require(_0x21bf('0x10'));var Redis=require(_0x21bf('0x11'));var authService=require(_0x21bf('0x12'));var qs=require(_0x21bf('0x13'));var hardwareService=require(_0x21bf('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x21bf('0x15'))['db'];function respondWithStatusCode(_0x506020,_0x4c5ec7){_0x4c5ec7=_0x4c5ec7||0xcc;return function(_0x1efe6f){if(_0x1efe6f){return _0x506020[_0x21bf('0x16')](_0x4c5ec7);}return _0x506020['status'](_0x4c5ec7)[_0x21bf('0x17')]();};}function respondWithResult(_0x33fe23,_0x5574d4){_0x5574d4=_0x5574d4||0xc8;return function(_0x4397f5){if(_0x4397f5){return _0x33fe23['status'](_0x5574d4)['json'](_0x4397f5);}};}function respondWithFilteredResult(_0x208ca5,_0x8e6234){return function(_0xa6a432){if(_0xa6a432){var _0x2b35fb=_0xa6a432[_0x21bf('0x18')],_0x247db6=_0x8e6234[_0x21bf('0x19')],_0x557fb5=_0x8e6234[_0x21bf('0x19')]+_0x8e6234['limit'],_0x51bab6;if(_0x557fb5>=_0x2b35fb){_0x557fb5=_0x2b35fb;_0x51bab6=0xc8;}else{_0x51bab6=0xce;}_0x208ca5['status'](_0x51bab6);return _0x208ca5[_0x21bf('0x1a')]('Content-Range',_0x247db6+'-'+_0x557fb5+'/'+_0x2b35fb)[_0x21bf('0x1b')](_0xa6a432);}return null;};}function patchUpdates(_0x5cbc7d){return function(_0x4ecce2){try{jsonpatch[_0x21bf('0x1c')](_0x4ecce2,_0x5cbc7d,!![]);}catch(_0x2d5380){return BPromise[_0x21bf('0x1d')](_0x2d5380);}return _0x4ecce2[_0x21bf('0x1e')]();};}function saveUpdates(_0x16d709,_0x1c3ff2){return function(_0xe73342){if(_0xe73342){return _0xe73342['update'](_0x16d709)[_0x21bf('0x1f')](function(_0xd417d8){return _0xd417d8;});}return null;};}function removeEntity(_0x36b721,_0x3631c7){return function(_0x2f8dc2){if(_0x2f8dc2){return _0x2f8dc2[_0x21bf('0x20')]()[_0x21bf('0x1f')](function(){_0x36b721[_0x21bf('0x21')](0xcc)[_0x21bf('0x17')]();});}};}function handleEntityNotFound(_0x95d434,_0x5c9f62){return function(_0x402ff1){if(!_0x402ff1){_0x95d434[_0x21bf('0x16')](0x194);}return _0x402ff1;};}function handleError(_0x1f9fee,_0x1a73b2){_0x1a73b2=_0x1a73b2||0x1f4;return function(_0x389373){logger['error'](_0x389373['stack']);if(_0x389373[_0x21bf('0x22')]){delete _0x389373[_0x21bf('0x22')];}_0x1f9fee[_0x21bf('0x21')](_0x1a73b2)['send'](_0x389373);};}exports[_0x21bf('0x23')]=function(_0x37abe4,_0x3f1098){var _0x2a6c62={},_0x48fa47={},_0x36ae0f={'count':0x0,'rows':[]};var _0x1d2098=db[_0x21bf('0x24')][_0x21bf('0x25')];_0x48fa47[_0x21bf('0x26')]=_[_0x21bf('0x27')](_0x1d2098);_0x48fa47[_0x21bf('0x28')]=_[_0x21bf('0x27')](_0x37abe4['query']);_0x48fa47[_0x21bf('0x29')]=_[_0x21bf('0x2a')](_0x48fa47['model'],_0x48fa47['query']);_0x2a6c62[_0x21bf('0x2b')]=_[_0x21bf('0x2a')](_0x48fa47['model'],qs['fields'](_0x37abe4[_0x21bf('0x28')][_0x21bf('0x2c')]));_0x2a6c62[_0x21bf('0x2b')]=_0x2a6c62['attributes'][_0x21bf('0x2d')]?_0x2a6c62['attributes']:_0x48fa47[_0x21bf('0x26')];if(!_0x37abe4[_0x21bf('0x28')][_0x21bf('0x2e')](_0x21bf('0x2f'))){_0x2a6c62['limit']=qs[_0x21bf('0x30')](_0x37abe4[_0x21bf('0x28')]['limit']);_0x2a6c62[_0x21bf('0x19')]=qs[_0x21bf('0x19')](_0x37abe4['query'][_0x21bf('0x19')]);}_0x2a6c62[_0x21bf('0x31')]=qs['sort'](_0x37abe4[_0x21bf('0x28')]['sort']);_0x2a6c62[_0x21bf('0x32')]=qs[_0x21bf('0x29')](_['pick'](_0x37abe4['query'],_0x48fa47['filters']));if(_0x37abe4[_0x21bf('0x28')][_0x21bf('0x33')]){_0x2a6c62[_0x21bf('0x32')]=_[_0x21bf('0x34')](_0x2a6c62[_0x21bf('0x32')],{'$or':_[_0x21bf('0x35')](_0x1d2098,function(_0x4461bd){if(_0x4461bd[_0x21bf('0x36')][_0x21bf('0x37')]!==_0x21bf('0x38')){var _0x4620e6={};_0x4620e6[_0x4461bd[_0x21bf('0x39')]]={'$like':'%'+_0x37abe4[_0x21bf('0x28')][_0x21bf('0x33')]+'%'};return _0x4620e6;}})});}_0x2a6c62=_[_0x21bf('0x34')]({},_0x2a6c62,_0x37abe4[_0x21bf('0x3a')]);var _0x2a285c={'where':_0x2a6c62['where']};return db[_0x21bf('0x24')][_0x21bf('0x18')](_0x2a285c)['then'](function(_0x1ada3c){_0x36ae0f['count']=_0x1ada3c;if(_0x37abe4[_0x21bf('0x28')]['includeAll']){_0x2a6c62[_0x21bf('0x3b')]=[{'all':!![]}];}return db[_0x21bf('0x24')][_0x21bf('0x3c')](_0x2a6c62);})[_0x21bf('0x1f')](function(_0x125cdd){_0x36ae0f['rows']=_0x125cdd;return _0x36ae0f;})[_0x21bf('0x1f')](respondWithFilteredResult(_0x3f1098,_0x2a6c62))['catch'](handleError(_0x3f1098,null));};exports[_0x21bf('0x3d')]=function(_0x491f82,_0x1b105a){var _0x1920c8={'raw':!![],'where':{'id':_0x491f82[_0x21bf('0x3e')]['id']}},_0x3c7f56={};_0x3c7f56[_0x21bf('0x26')]=_[_0x21bf('0x27')](db[_0x21bf('0x24')][_0x21bf('0x25')]);_0x3c7f56[_0x21bf('0x28')]=_[_0x21bf('0x27')](_0x491f82['query']);_0x3c7f56[_0x21bf('0x29')]=_[_0x21bf('0x2a')](_0x3c7f56[_0x21bf('0x26')],_0x3c7f56[_0x21bf('0x28')]);_0x1920c8[_0x21bf('0x2b')]=_[_0x21bf('0x2a')](_0x3c7f56[_0x21bf('0x26')],qs[_0x21bf('0x2c')](_0x491f82[_0x21bf('0x28')][_0x21bf('0x2c')]));_0x1920c8['attributes']=_0x1920c8[_0x21bf('0x2b')]['length']?_0x1920c8[_0x21bf('0x2b')]:_0x3c7f56[_0x21bf('0x26')];if(_0x491f82[_0x21bf('0x28')][_0x21bf('0x3f')]){_0x1920c8[_0x21bf('0x3b')]=[{'all':!![]}];}_0x1920c8=_[_0x21bf('0x34')]({},_0x1920c8,_0x491f82[_0x21bf('0x3a')]);return db[_0x21bf('0x24')][_0x21bf('0x40')](_0x1920c8)[_0x21bf('0x1f')](handleEntityNotFound(_0x1b105a,null))[_0x21bf('0x1f')](respondWithResult(_0x1b105a,null))[_0x21bf('0x41')](handleError(_0x1b105a,null));};exports[_0x21bf('0x42')]=function(_0x156fce,_0x5dd61e){if(_0x156fce[_0x21bf('0x43')]['id']){delete _0x156fce[_0x21bf('0x43')]['id'];}return db[_0x21bf('0x24')][_0x21bf('0x40')]({'where':{'id':_0x156fce[_0x21bf('0x3e')]['id']}})[_0x21bf('0x1f')](handleEntityNotFound(_0x5dd61e,null))[_0x21bf('0x1f')](saveUpdates(_0x156fce[_0x21bf('0x43')],null))[_0x21bf('0x1f')](respondWithResult(_0x5dd61e,null))['catch'](handleError(_0x5dd61e,null));};exports['destroy']=function(_0x1bed6c,_0x1290d6){return db['Attachment'][_0x21bf('0x40')]({'where':{'id':_0x1bed6c[_0x21bf('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1290d6,null))['then'](removeEntity(_0x1290d6,null))[_0x21bf('0x41')](handleError(_0x1290d6,null));};exports['create']=function(_0xdcf314,_0x2d4cfd,_0x5d6da2){_0xdcf314['body'][_0x21bf('0x22')]=_0xdcf314[_0x21bf('0x44')][_0x21bf('0x45')];_0xdcf314[_0x21bf('0x43')][_0x21bf('0x46')]=_0xdcf314[_0x21bf('0x44')][_0x21bf('0x47')];_0xdcf314['body'][_0x21bf('0x36')]=_0xdcf314[_0x21bf('0x44')][_0x21bf('0x48')];return db['Attachment'][_0x21bf('0x49')](_0xdcf314[_0x21bf('0x43')])['then'](respondWithResult(_0x2d4cfd,0xc9))[_0x21bf('0x41')](handleError(_0x2d4cfd,null));};exports[_0x21bf('0x4a')]=function(_0x301a2c,_0x54097a,_0x184394){return db[_0x21bf('0x24')][_0x21bf('0x4b')]({'where':{'id':_0x301a2c[_0x21bf('0x3e')]['id']},'raw':!![]})[_0x21bf('0x1f')](handleEntityNotFound(_0x54097a,null))[_0x21bf('0x1f')](function(_0x3c9b58){if(_0x3c9b58){return _0x54097a[_0x21bf('0x4a')](path[_0x21bf('0x4c')](config['root'],'server/files/attachments/',_0x3c9b58[_0x21bf('0x46')]));}})['catch'](handleError(_0x54097a,null));};
\ No newline at end of file
+var _0x6a54=['destroy','create','originalname','basename','file','filename','type','mimetype','download','findOne','join','root','server/files/attachments/','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','stack','name','send','index','Attachment','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','key','VIRTUAL','field','includeAll','findAll','catch','show','include','options','find','body','params'];(function(_0xb29bef,_0x45aff1){var _0x878163=function(_0xa270a1){while(--_0xa270a1){_0xb29bef['push'](_0xb29bef['shift']());}};_0x878163(++_0x45aff1);}(_0x6a54,0xb5));var _0x46a5=function(_0x19415c,_0x2b3093){_0x19415c=_0x19415c-0x0;var _0x4c828c=_0x6a54[_0x19415c];return _0x4c828c;};'use strict';var pdf=require(_0x46a5('0x0'));var emlformat=require(_0x46a5('0x1'));var rimraf=require(_0x46a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46a5('0x3'));var rp=require(_0x46a5('0x4'));var moment=require(_0x46a5('0x5'));var BPromise=require(_0x46a5('0x6'));var Mustache=require(_0x46a5('0x7'));var util=require(_0x46a5('0x8'));var path=require(_0x46a5('0x9'));var sox=require(_0x46a5('0xa'));var csv=require(_0x46a5('0xb'));var ejs=require(_0x46a5('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x46a5('0xd'));var crypto=require(_0x46a5('0xe'));var jsforce=require(_0x46a5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x46a5('0xb'));var querystring=require('querystring');var Papa=require(_0x46a5('0x10'));var Redis=require(_0x46a5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x46a5('0x12'));var hardwareService=require(_0x46a5('0x13'));var logger=require(_0x46a5('0x14'))(_0x46a5('0x15'));var utils=require('../../config/utils');var config=require(_0x46a5('0x16'));var db=require(_0x46a5('0x17'))['db'];function respondWithStatusCode(_0x8ffe3,_0x77df2){_0x77df2=_0x77df2||0xcc;return function(_0x421e45){if(_0x421e45){return _0x8ffe3[_0x46a5('0x18')](_0x77df2);}return _0x8ffe3[_0x46a5('0x19')](_0x77df2)[_0x46a5('0x1a')]();};}function respondWithResult(_0x145043,_0x5b7862){_0x5b7862=_0x5b7862||0xc8;return function(_0x5eee8f){if(_0x5eee8f){return _0x145043[_0x46a5('0x19')](_0x5b7862)[_0x46a5('0x1b')](_0x5eee8f);}};}function respondWithFilteredResult(_0x56264e,_0xb0d5d3){return function(_0x20e9ac){if(_0x20e9ac){var _0x3adbe3=_0x20e9ac[_0x46a5('0x1c')],_0x26df5d=_0xb0d5d3[_0x46a5('0x1d')],_0x5cf5bd=_0xb0d5d3['offset']+_0xb0d5d3[_0x46a5('0x1e')],_0x36dfec;if(_0x5cf5bd>=_0x3adbe3){_0x5cf5bd=_0x3adbe3;_0x36dfec=0xc8;}else{_0x36dfec=0xce;}_0x56264e[_0x46a5('0x19')](_0x36dfec);return _0x56264e['set'](_0x46a5('0x1f'),_0x26df5d+'-'+_0x5cf5bd+'/'+_0x3adbe3)[_0x46a5('0x1b')](_0x20e9ac);}return null;};}function patchUpdates(_0x379317){return function(_0x3ff096){try{jsonpatch[_0x46a5('0x20')](_0x3ff096,_0x379317,!![]);}catch(_0x4535a2){return BPromise[_0x46a5('0x21')](_0x4535a2);}return _0x3ff096['save']();};}function saveUpdates(_0x236968,_0x5a42b0){return function(_0x328e10){if(_0x328e10){return _0x328e10[_0x46a5('0x22')](_0x236968)[_0x46a5('0x23')](function(_0x28bc2f){return _0x28bc2f;});}return null;};}function removeEntity(_0xd76ab2,_0x37c5c6){return function(_0x3391ee){if(_0x3391ee){return _0x3391ee['destroy']()[_0x46a5('0x23')](function(){_0xd76ab2[_0x46a5('0x19')](0xcc)[_0x46a5('0x1a')]();});}};}function handleEntityNotFound(_0x3ef3c8,_0x9da3d3){return function(_0x4d9c59){if(!_0x4d9c59){_0x3ef3c8[_0x46a5('0x18')](0x194);}return _0x4d9c59;};}function handleError(_0x5efe84,_0x82342){_0x82342=_0x82342||0x1f4;return function(_0x1cff3f){logger['error'](_0x1cff3f[_0x46a5('0x24')]);if(_0x1cff3f[_0x46a5('0x25')]){delete _0x1cff3f[_0x46a5('0x25')];}_0x5efe84[_0x46a5('0x19')](_0x82342)[_0x46a5('0x26')](_0x1cff3f);};}exports[_0x46a5('0x27')]=function(_0x1f0ec3,_0x3b16e0){var _0x3042fc={},_0x376832={},_0x355ac1={'count':0x0,'rows':[]};var _0x6f7805=db[_0x46a5('0x28')][_0x46a5('0x29')];_0x376832['model']=_[_0x46a5('0x2a')](_0x6f7805);_0x376832['query']=_['keys'](_0x1f0ec3[_0x46a5('0x2b')]);_0x376832['filters']=_[_0x46a5('0x2c')](_0x376832[_0x46a5('0x2d')],_0x376832[_0x46a5('0x2b')]);_0x3042fc['attributes']=_[_0x46a5('0x2c')](_0x376832[_0x46a5('0x2d')],qs[_0x46a5('0x2e')](_0x1f0ec3[_0x46a5('0x2b')][_0x46a5('0x2e')]));_0x3042fc[_0x46a5('0x2f')]=_0x3042fc[_0x46a5('0x2f')][_0x46a5('0x30')]?_0x3042fc['attributes']:_0x376832[_0x46a5('0x2d')];if(!_0x1f0ec3[_0x46a5('0x2b')][_0x46a5('0x31')](_0x46a5('0x32'))){_0x3042fc[_0x46a5('0x1e')]=qs[_0x46a5('0x1e')](_0x1f0ec3[_0x46a5('0x2b')][_0x46a5('0x1e')]);_0x3042fc[_0x46a5('0x1d')]=qs[_0x46a5('0x1d')](_0x1f0ec3[_0x46a5('0x2b')][_0x46a5('0x1d')]);}_0x3042fc[_0x46a5('0x33')]=qs[_0x46a5('0x34')](_0x1f0ec3[_0x46a5('0x2b')]['sort']);_0x3042fc[_0x46a5('0x35')]=qs['filters'](_[_0x46a5('0x36')](_0x1f0ec3[_0x46a5('0x2b')],_0x376832[_0x46a5('0x37')]));if(_0x1f0ec3[_0x46a5('0x2b')][_0x46a5('0x38')]){_0x3042fc['where']=_[_0x46a5('0x39')](_0x3042fc[_0x46a5('0x35')],{'$or':_[_0x46a5('0x3a')](_0x6f7805,function(_0x18f88c){if(_0x18f88c['type'][_0x46a5('0x3b')]!==_0x46a5('0x3c')){var _0x215aca={};_0x215aca[_0x18f88c[_0x46a5('0x3d')]]={'$like':'%'+_0x1f0ec3[_0x46a5('0x2b')][_0x46a5('0x38')]+'%'};return _0x215aca;}})});}_0x3042fc=_[_0x46a5('0x39')]({},_0x3042fc,_0x1f0ec3['options']);var _0x30db7d={'where':_0x3042fc[_0x46a5('0x35')]};return db[_0x46a5('0x28')][_0x46a5('0x1c')](_0x30db7d)[_0x46a5('0x23')](function(_0x4c6365){_0x355ac1[_0x46a5('0x1c')]=_0x4c6365;if(_0x1f0ec3[_0x46a5('0x2b')][_0x46a5('0x3e')]){_0x3042fc['include']=[{'all':!![]}];}return db['Attachment'][_0x46a5('0x3f')](_0x3042fc);})[_0x46a5('0x23')](function(_0x4ea678){_0x355ac1['rows']=_0x4ea678;return _0x355ac1;})[_0x46a5('0x23')](respondWithFilteredResult(_0x3b16e0,_0x3042fc))[_0x46a5('0x40')](handleError(_0x3b16e0,null));};exports[_0x46a5('0x41')]=function(_0x12e071,_0x32087a){var _0x51e9f7={'raw':!![],'where':{'id':_0x12e071['params']['id']}},_0x114646={};_0x114646[_0x46a5('0x2d')]=_['keys'](db['Attachment'][_0x46a5('0x29')]);_0x114646['query']=_['keys'](_0x12e071[_0x46a5('0x2b')]);_0x114646['filters']=_[_0x46a5('0x2c')](_0x114646['model'],_0x114646['query']);_0x51e9f7[_0x46a5('0x2f')]=_['intersection'](_0x114646[_0x46a5('0x2d')],qs[_0x46a5('0x2e')](_0x12e071['query']['fields']));_0x51e9f7['attributes']=_0x51e9f7[_0x46a5('0x2f')]['length']?_0x51e9f7['attributes']:_0x114646['model'];if(_0x12e071[_0x46a5('0x2b')]['includeAll']){_0x51e9f7[_0x46a5('0x42')]=[{'all':!![]}];}_0x51e9f7=_[_0x46a5('0x39')]({},_0x51e9f7,_0x12e071[_0x46a5('0x43')]);return db[_0x46a5('0x28')][_0x46a5('0x44')](_0x51e9f7)[_0x46a5('0x23')](handleEntityNotFound(_0x32087a,null))[_0x46a5('0x23')](respondWithResult(_0x32087a,null))[_0x46a5('0x40')](handleError(_0x32087a,null));};exports['update']=function(_0x1b467e,_0x564ba8){if(_0x1b467e['body']['id']){delete _0x1b467e[_0x46a5('0x45')]['id'];}return db['Attachment'][_0x46a5('0x44')]({'where':{'id':_0x1b467e[_0x46a5('0x46')]['id']}})[_0x46a5('0x23')](handleEntityNotFound(_0x564ba8,null))['then'](saveUpdates(_0x1b467e[_0x46a5('0x45')],null))[_0x46a5('0x23')](respondWithResult(_0x564ba8,null))[_0x46a5('0x40')](handleError(_0x564ba8,null));};exports[_0x46a5('0x47')]=function(_0x3135d6,_0x18c5cc){return db[_0x46a5('0x28')][_0x46a5('0x44')]({'where':{'id':_0x3135d6[_0x46a5('0x46')]['id']}})[_0x46a5('0x23')](handleEntityNotFound(_0x18c5cc,null))['then'](removeEntity(_0x18c5cc,null))[_0x46a5('0x40')](handleError(_0x18c5cc,null));};exports[_0x46a5('0x48')]=function(_0x5ea6af,_0xc6cd1b,_0x4a5990){_0x5ea6af[_0x46a5('0x45')][_0x46a5('0x25')]=_0x5ea6af['file'][_0x46a5('0x49')];_0x5ea6af[_0x46a5('0x45')][_0x46a5('0x4a')]=_0x5ea6af[_0x46a5('0x4b')][_0x46a5('0x4c')];_0x5ea6af[_0x46a5('0x45')][_0x46a5('0x4d')]=_0x5ea6af[_0x46a5('0x4b')][_0x46a5('0x4e')];return db[_0x46a5('0x28')][_0x46a5('0x48')](_0x5ea6af[_0x46a5('0x45')])[_0x46a5('0x23')](respondWithResult(_0xc6cd1b,0xc9))[_0x46a5('0x40')](handleError(_0xc6cd1b,null));};exports[_0x46a5('0x4f')]=function(_0x4b0014,_0x438140,_0xebef43){return db[_0x46a5('0x28')][_0x46a5('0x50')]({'where':{'id':_0x4b0014[_0x46a5('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x438140,null))[_0x46a5('0x23')](function(_0x31f61b){if(_0x31f61b){return _0x438140[_0x46a5('0x4f')](path[_0x46a5('0x51')](config[_0x46a5('0x52')],_0x46a5('0x53'),_0x31f61b[_0x46a5('0x4a')]));}})['catch'](handleError(_0x438140,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index d1e5373..3b7d897 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 _0xe41f=['../../config/logger','api','path','rimraf','../../config/environment','./attachment.attributes','Attachment','attachments','lodash','util'];(function(_0x594ff5,_0x47aa57){var _0x5042d6=function(_0x58074f){while(--_0x58074f){_0x594ff5['push'](_0x594ff5['shift']());}};_0x5042d6(++_0x47aa57);}(_0xe41f,0x13e));var _0xfe41=function(_0x4f537a,_0x54ef54){_0x4f537a=_0x4f537a-0x0;var _0x5e3b03=_0xe41f[_0x4f537a];return _0x5e3b03;};'use strict';var _=require(_0xfe41('0x0'));var util=require(_0xfe41('0x1'));var logger=require(_0xfe41('0x2'))(_0xfe41('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe41('0x4'));var rimraf=require(_0xfe41('0x5'));var config=require(_0xfe41('0x6'));var attributes=require(_0xfe41('0x7'));module['exports']=function(_0x52d56e,_0x2e8e86){return _0x52d56e['define'](_0xfe41('0x8'),attributes,{'tableName':_0xfe41('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5cd8=['./attachment.attributes','exports','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x48a386,_0x486893){var _0x5c496e=function(_0xe84334){while(--_0xe84334){_0x48a386['push'](_0x48a386['shift']());}};_0x5c496e(++_0x486893);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x30d3ac,_0xde2ac4){_0x30d3ac=_0x30d3ac-0x0;var _0x195c53=_0x5cd8[_0x30d3ac];return _0x195c53;};'use strict';var _=require(_0x85cd('0x0'));var util=require('util');var logger=require(_0x85cd('0x1'))(_0x85cd('0x2'));var moment=require(_0x85cd('0x3'));var BPromise=require(_0x85cd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x85cd('0x5'));var rimraf=require('rimraf');var config=require(_0x85cd('0x6'));var attributes=require(_0x85cd('0x7'));module[_0x85cd('0x8')]=function(_0x322e08,_0xcfad76){return _0x322e08['define'](_0x85cd('0x9'),attributes,{'tableName':_0x85cd('0xa'),'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 ed35fef..4ae0cd8 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 _0x2452=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','lodash'];(function(_0x51c848,_0x31973b){var _0x4d80b0=function(_0x26a767){while(--_0x26a767){_0x51c848['push'](_0x51c848['shift']());}};_0x4d80b0(++_0x31973b);}(_0x2452,0x179));var _0x2245=function(_0x4acdef,_0x3cc14f){_0x4acdef=_0x4acdef-0x0;var _0x3822f3=_0x2452[_0x4acdef];return _0x3822f3;};'use strict';var _=require(_0x2245('0x0'));var util=require(_0x2245('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2245('0x2'));var fs=require('fs');var Redis=require(_0x2245('0x3'));var db=require(_0x2245('0x4'))['db'];var utils=require(_0x2245('0x5'));var logger=require(_0x2245('0x6'))(_0x2245('0x7'));var config=require(_0x2245('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2245('0x9')][_0x2245('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16bb56,_0x39c7c2,_0x2a8daa){return new BPromise(function(_0x5ec659,_0x4ee962){return client[_0x2245('0xb')](_0x16bb56,_0x2a8daa)[_0x2245('0xc')](function(_0x2ef999){logger[_0x2245('0xd')](_0x2245('0xe'),_0x39c7c2,_0x2245('0xf'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x39c7c2,'request\x20sent',JSON[_0x2245('0x10')](_0x2ef999));if(_0x2ef999['error']){if(_0x2ef999[_0x2245('0x11')][_0x2245('0x12')]===0x1f4){logger[_0x2245('0x11')](_0x2245('0xe'),_0x39c7c2,_0x2ef999[_0x2245('0x11')][_0x2245('0x13')]);return _0x4ee962(_0x2ef999[_0x2245('0x11')][_0x2245('0x13')]);}logger[_0x2245('0x11')]('Attachment,\x20%s,\x20%s',_0x39c7c2,_0x2ef999[_0x2245('0x11')][_0x2245('0x13')]);return _0x5ec659(_0x2ef999[_0x2245('0x11')]['message']);}else{logger['info'](_0x2245('0xe'),_0x39c7c2,'request\x20sent');_0x5ec659(_0x2ef999[_0x2245('0x14')][_0x2245('0x13')]);}})[_0x2245('0x15')](function(_0x580630){logger[_0x2245('0x11')](_0x2245('0xe'),_0x39c7c2,_0x580630);_0x4ee962(_0x580630);});});}exports[_0x2245('0x16')]=function(_0xe2c3e1){var _0x14b12f=this;return new Promise(function(_0x208c5f,_0x4857bc){return db[_0x2245('0x17')][_0x2245('0x18')](_0xe2c3e1[_0x2245('0x19')],{'raw':_0xe2c3e1['options']?_0xe2c3e1[_0x2245('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x2245('0xc')](function(_0x3f99e1){logger['info'](_0x2245('0x16'),_0xe2c3e1);logger['debug'](_0x2245('0x16'),_0xe2c3e1,JSON[_0x2245('0x10')](_0x3f99e1));_0x208c5f(_0x3f99e1);})[_0x2245('0x15')](function(_0x479622){logger['error'](_0x2245('0x16'),_0x479622[_0x2245('0x13')],_0xe2c3e1);_0x4857bc(_0x14b12f[_0x2245('0x11')](0x1f4,_0x479622[_0x2245('0x13')]));});});};
\ No newline at end of file
+var _0x9e50=['stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x1c99aa,_0x6a1538){var _0x310f03=function(_0x1f891c){while(--_0x1f891c){_0x1c99aa['push'](_0x1c99aa['shift']());}};_0x310f03(++_0x6a1538);}(_0x9e50,0xdf));var _0x09e5=function(_0xc4e37,_0x4ce536){_0xc4e37=_0xc4e37-0x0;var _0x54e531=_0x9e50[_0xc4e37];return _0x54e531;};'use strict';var _=require(_0x09e5('0x0'));var util=require(_0x09e5('0x1'));var moment=require(_0x09e5('0x2'));var BPromise=require(_0x09e5('0x3'));var rs=require(_0x09e5('0x4'));var fs=require('fs');var Redis=require(_0x09e5('0x5'));var db=require(_0x09e5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x09e5('0x7'))(_0x09e5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x09e5('0x9')][_0x09e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dc0ad,_0x53d3ea,_0x104556){return new BPromise(function(_0x50e6d8,_0x256764){return client[_0x09e5('0xb')](_0x5dc0ad,_0x104556)[_0x09e5('0xc')](function(_0xb9b456){logger[_0x09e5('0xd')](_0x09e5('0xe'),_0x53d3ea,_0x09e5('0xf'));logger['debug'](_0x09e5('0x10'),_0x53d3ea,_0x09e5('0xf'),JSON[_0x09e5('0x11')](_0xb9b456));if(_0xb9b456['error']){if(_0xb9b456[_0x09e5('0x12')][_0x09e5('0x13')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x53d3ea,_0xb9b456[_0x09e5('0x12')][_0x09e5('0x14')]);return _0x256764(_0xb9b456[_0x09e5('0x12')][_0x09e5('0x14')]);}logger[_0x09e5('0x12')](_0x09e5('0xe'),_0x53d3ea,_0xb9b456[_0x09e5('0x12')]['message']);return _0x50e6d8(_0xb9b456['error'][_0x09e5('0x14')]);}else{logger[_0x09e5('0xd')](_0x09e5('0xe'),_0x53d3ea,_0x09e5('0xf'));_0x50e6d8(_0xb9b456[_0x09e5('0x15')][_0x09e5('0x14')]);}})[_0x09e5('0x16')](function(_0x5809d0){logger['error'](_0x09e5('0xe'),_0x53d3ea,_0x5809d0);_0x256764(_0x5809d0);});});}exports[_0x09e5('0x17')]=function(_0x3f1f20){var _0x564749=this;return new Promise(function(_0x188ff2,_0xaa024c){return db[_0x09e5('0x18')][_0x09e5('0x19')](_0x3f1f20[_0x09e5('0x1a')],{'raw':_0x3f1f20[_0x09e5('0x1b')]?_0x3f1f20[_0x09e5('0x1b')][_0x09e5('0x1c')]===undefined?!![]:![]:!![]})[_0x09e5('0xc')](function(_0x472170){logger[_0x09e5('0xd')](_0x09e5('0x17'),_0x3f1f20);logger[_0x09e5('0x1d')](_0x09e5('0x17'),_0x3f1f20,JSON[_0x09e5('0x11')](_0x472170));_0x188ff2(_0x472170);})[_0x09e5('0x16')](function(_0x4c9814){logger[_0x09e5('0x12')](_0x09e5('0x17'),_0x4c9814['message'],_0x3f1f20);_0xaa024c(_0x564749[_0x09e5('0x12')](0x1f4,_0x4c9814[_0x09e5('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 46c5c44..aa3e26a 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 _0x9c2c=['multer','util','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/download','download','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','post','single','file','create','put','update','delete','destroy','exports'];(function(_0x1f302d,_0x29aa8b){var _0x598f9d=function(_0x7f535b){while(--_0x7f535b){_0x1f302d['push'](_0x1f302d['shift']());}};_0x598f9d(++_0x29aa8b);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc9c2('0x0'));var util=require(_0xc9c2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc9c2('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xc9c2('0x3'));var config=require(_0xc9c2('0x4'));var controller=require('./attachment.controller');router['get']('/',auth[_0xc9c2('0x5')](),controller['index']);router[_0xc9c2('0x6')](_0xc9c2('0x7'),auth[_0xc9c2('0x5')](),controller[_0xc9c2('0x8')]);router[_0xc9c2('0x6')](_0xc9c2('0x9'),auth[_0xc9c2('0x5')](),controller[_0xc9c2('0xa')]);var upload=multer({'storage':multer[_0xc9c2('0xb')]({'destination':function(_0x53e18d,_0x342609,_0x530f6a){_0x530f6a(null,path[_0xc9c2('0xc')](config[_0xc9c2('0xd')],_0xc9c2('0xe')));},'filename':function(_0x275b08,_0x5894a4,_0x4f8453){_0x4f8453(null,util[_0xc9c2('0xf')](_0xc9c2('0x10'),Date['now'](),_0x5894a4[_0xc9c2('0x11')][_0xc9c2('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc9c2('0x13')]('/',upload[_0xc9c2('0x14')](_0xc9c2('0x15')),controller[_0xc9c2('0x16')]);router[_0xc9c2('0x17')](_0xc9c2('0x7'),auth[_0xc9c2('0x5')](),controller[_0xc9c2('0x18')]);router[_0xc9c2('0x19')](_0xc9c2('0x7'),auth['isAuthenticated'](),controller[_0xc9c2('0x1a')]);module[_0xc9c2('0x1b')]=router;
\ No newline at end of file
+var _0x1a5c=['format','%s-%s','now','replace','post','single','file','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','diskStorage','root','server/files/attachments/'];(function(_0x1205b9,_0x2c47c0){var _0x16332b=function(_0x6f5643){while(--_0x6f5643){_0x1205b9['push'](_0x1205b9['shift']());}};_0x16332b(++_0x2c47c0);}(_0x1a5c,0x12c));var _0xc1a5=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x1a5c[_0x1cb18a];return _0x22442e;};'use strict';var multer=require(_0xc1a5('0x0'));var util=require(_0xc1a5('0x1'));var path=require(_0xc1a5('0x2'));var timeout=require(_0xc1a5('0x3'));var express=require(_0xc1a5('0x4'));var router=express[_0xc1a5('0x5')]();var auth=require(_0xc1a5('0x6'));var interaction=require(_0xc1a5('0x7'));var config=require(_0xc1a5('0x8'));var controller=require(_0xc1a5('0x9'));router['get']('/',auth[_0xc1a5('0xa')](),controller[_0xc1a5('0xb')]);router[_0xc1a5('0xc')](_0xc1a5('0xd'),auth[_0xc1a5('0xa')](),controller[_0xc1a5('0xe')]);router[_0xc1a5('0xc')](_0xc1a5('0xf'),auth['isAuthenticated'](),controller[_0xc1a5('0x10')]);var upload=multer({'storage':multer[_0xc1a5('0x11')]({'destination':function(_0x4cba0b,_0x176448,_0x481ba4){_0x481ba4(null,path['join'](config[_0xc1a5('0x12')],_0xc1a5('0x13')));},'filename':function(_0x5f29d6,_0x14ac4a,_0x1b4e6b){_0x1b4e6b(null,util[_0xc1a5('0x14')](_0xc1a5('0x15'),Date[_0xc1a5('0x16')](),_0x14ac4a['originalname'][_0xc1a5('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc1a5('0x18')]('/',upload[_0xc1a5('0x19')](_0xc1a5('0x1a')),controller[_0xc1a5('0x1b')]);router[_0xc1a5('0x1c')](_0xc1a5('0xd'),auth[_0xc1a5('0xa')](),controller[_0xc1a5('0x1d')]);router['delete']('/:id',auth[_0xc1a5('0xa')](),controller[_0xc1a5('0x1e')]);module[_0xc1a5('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 15e436e..4b63f04 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 _0xb5bb=['callbackURL','User','find','emails','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password','catch','lodash','passport','passport-google-oauth20','../../mysqldb','../../config/environment','profile','email','authenticate','google','/login','use','clientID','clientSecret','secret'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0xb5bb,0x1ba));var _0xbb5b=function(_0xfe5d19,_0x105d63){_0xfe5d19=_0xfe5d19-0x0;var _0x126180=_0xb5bb[_0xfe5d19];return _0x126180;};'use strict';var _=require(_0xbb5b('0x0'));var passport=require(_0xbb5b('0x1'));var GoogleStrategy=require(_0xbb5b('0x2'))['Strategy'];var db=require(_0xbb5b('0x3'))['db'];var config=require(_0xbb5b('0x4'));var signToken=require('../../components/auth/service')['signToken'];exports['login']=passport['authenticate']('google',{'failureRedirect':'/login','scope':[_0xbb5b('0x5'),_0xbb5b('0x6')],'session':![]});exports['callback']=passport[_0xbb5b('0x7')](_0xbb5b('0x8'),{'failureRedirect':_0xbb5b('0x9'),'session':![]});passport[_0xbb5b('0xa')](new GoogleStrategy({'clientID':config[_0xbb5b('0x8')]?config[_0xbb5b('0x8')][_0xbb5b('0xb')]:'id','clientSecret':config[_0xbb5b('0x8')]?config[_0xbb5b('0x8')][_0xbb5b('0xc')]:_0xbb5b('0xd'),'callbackURL':config[_0xbb5b('0x8')]?config[_0xbb5b('0x8')][_0xbb5b('0xe')]:''},function(_0x10411c,_0x15e47d,_0x26f627,_0xbd6621){db[_0xbb5b('0xf')][_0xbb5b('0x10')]({'where':{'email':_['map'](_0x26f627[_0xbb5b('0x11')],'value'),'role':{'$or':[_0xbb5b('0x12'),_0xbb5b('0x13'),_0xbb5b('0x14')]}}})[_0xbb5b('0x15')](function(_0x5b026b){if(_0x5b026b){return _0xbd6621(null,_0x5b026b);}_0xbd6621(_0xbb5b('0x16'));})[_0xbb5b('0x17')](function(_0x2aecf7){_0xbd6621(_0x2aecf7);});}));
\ No newline at end of file
+var _0x5ff9=['value','admin','agent','then','Incorrect\x20username\x20and/or\x20password','catch','lodash','passport','Strategy','../../mysqldb','signToken','google','/login','email','authenticate','use','clientID','clientSecret','secret','callbackURL','map','emails'];(function(_0x94cfd7,_0xaab212){var _0x3d88aa=function(_0x41ce85){while(--_0x41ce85){_0x94cfd7['push'](_0x94cfd7['shift']());}};_0x3d88aa(++_0xaab212);}(_0x5ff9,0xa0));var _0x95ff=function(_0x25144b,_0x496d6e){_0x25144b=_0x25144b-0x0;var _0x407571=_0x5ff9[_0x25144b];return _0x407571;};'use strict';var _=require(_0x95ff('0x0'));var passport=require(_0x95ff('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0x95ff('0x2')];var db=require(_0x95ff('0x3'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0x95ff('0x4')];exports['login']=passport['authenticate'](_0x95ff('0x5'),{'failureRedirect':_0x95ff('0x6'),'scope':['profile',_0x95ff('0x7')],'session':![]});exports['callback']=passport[_0x95ff('0x8')](_0x95ff('0x5'),{'failureRedirect':'/login','session':![]});passport[_0x95ff('0x9')](new GoogleStrategy({'clientID':config['google']?config[_0x95ff('0x5')][_0x95ff('0xa')]:'id','clientSecret':config['google']?config[_0x95ff('0x5')][_0x95ff('0xb')]:_0x95ff('0xc'),'callbackURL':config['google']?config[_0x95ff('0x5')][_0x95ff('0xd')]:''},function(_0x39d786,_0x2781f3,_0x271896,_0x1220db){db['User']['find']({'where':{'email':_[_0x95ff('0xe')](_0x271896[_0x95ff('0xf')],_0x95ff('0x10')),'role':{'$or':[_0x95ff('0x11'),'user',_0x95ff('0x12')]}}})[_0x95ff('0x13')](function(_0x5aa8c9){if(_0x5aa8c9){return _0x1220db(null,_0x5aa8c9);}_0x1220db(_0x95ff('0x14'));})[_0x95ff('0x15')](function(_0x4cc1f2){_0x1220db(_0x4cc1f2);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 90345e9..721a806 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 _0xad66=['/callback','callback','express','Router','../../components/auth/service','setTokenCookie','get','login'];(function(_0x2a8b5c,_0x429c22){var _0x3bbefe=function(_0xb97fd2){while(--_0xb97fd2){_0x2a8b5c['push'](_0x2a8b5c['shift']());}};_0x3bbefe(++_0x429c22);}(_0xad66,0x1da));var _0x6ad6=function(_0x1199f4,_0x578315){_0x1199f4=_0x1199f4-0x0;var _0x9c268a=_0xad66[_0x1199f4];return _0x9c268a;};'use strict';var express=require(_0x6ad6('0x0'));var passport=require('passport');var router=express[_0x6ad6('0x1')]();var controller=require('./authGoogle.controller');var setTokenCookie=require(_0x6ad6('0x2'))[_0x6ad6('0x3')];router[_0x6ad6('0x4')]('/',controller[_0x6ad6('0x5')]);router[_0x6ad6('0x4')](_0x6ad6('0x6'),controller[_0x6ad6('0x7')],setTokenCookie);module['exports']=router;
\ No newline at end of file
+var _0x384b=['login','/callback','callback','exports','passport','Router','./authGoogle.controller','../../components/auth/service','setTokenCookie'];(function(_0x1b925b,_0x1ab3c9){var _0x275f07=function(_0x2ffbe4){while(--_0x2ffbe4){_0x1b925b['push'](_0x1b925b['shift']());}};_0x275f07(++_0x1ab3c9);}(_0x384b,0x1ab));var _0xb384=function(_0xf07de9,_0xe21df3){_0xf07de9=_0xf07de9-0x0;var _0x7cbd4f=_0x384b[_0xf07de9];return _0x7cbd4f;};'use strict';var express=require('express');var passport=require(_0xb384('0x0'));var router=express[_0xb384('0x1')]();var controller=require(_0xb384('0x2'));var setTokenCookie=require(_0xb384('0x3'))[_0xb384('0x4')];router['get']('/',controller[_0xb384('0x5')]);router['get'](_0xb384('0x6'),controller[_0xb384('0x7')],setTokenCookie);module[_0xb384('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index b5148ad..967b942 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 _0x8716=['status','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','findOne','password','securePassword','resetPasswordToken','util','passport','passport-local','Strategy','bluebird','jayson/promise','lodash','../../config/logger','randomstring','../../components/auth/service','client','agent','User','then','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','admin','user','name','Incorrect\x20username\x20and/or\x20password','authenticate','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x3d05f1,_0x10fab4){var _0x38cafd=function(_0x1c1874){while(--_0x1c1874){_0x3d05f1['push'](_0x3d05f1['shift']());}};_0x38cafd(++_0x10fab4);}(_0x8716,0xb3));var _0x6871=function(_0x269928,_0x5a40b2){_0x269928=_0x269928-0x0;var _0x55bbee=_0x8716[_0x269928];return _0x55bbee;};'use strict';var util=require(_0x6871('0x0'));var passport=require(_0x6871('0x1'));var LocalStrategy=require(_0x6871('0x2'))[_0x6871('0x3')];var BPromise=require(_0x6871('0x4'));var jayson=require(_0x6871('0x5'));var _=require(_0x6871('0x6'));var logger=require(_0x6871('0x7'))('api');var rs=require(_0x6871('0x8'));var db=require('../../mysqldb')['db'];var signToken=require(_0x6871('0x9'))['signToken'];var client=jayson[_0x6871('0xa')]['http']({'port':0x232b});var getLicense=function(_0x188a55){return new BPromise(function(_0x5055dc,_0x5d789e){var _0x5d5851=0x0;_0x188a55['role']!==_0x6871('0xb')&&_0x5055dc(_0x188a55);return db[_0x6871('0xc')]['count']({'where':{'role':_0x6871('0xb'),'online':!![],'id':{'$ne':_0x188a55['id']}}})[_0x6871('0xd')](function(_0x2fb88b){_0x5d5851=_0x2fb88b;return require(_0x6871('0xe'))['getLicense']();})[_0x6871('0xd')](function(_0x227764){if(_0x227764&&_0x227764[_0x6871('0xf')]&&_0x5d5851>=_0x227764[_0x6871('0xf')]){return _0x5d789e({'message':_0x6871('0x10')});}return _0x5055dc(_0x188a55);})[_0x6871('0x11')](function(_0x3b0f4d){return _0x5d789e(_0x3b0f4d);});});};function localAuthenticate(_0x1d5553,_0x297cd4,_0x54d0f7,_0x53ce9e){_0x1d5553[_0x6871('0x12')]({'where':{'name':_0x297cd4,'role':{'$or':[_0x6871('0x13'),_0x6871('0x14'),'agent']}}})[_0x6871('0xd')](function(_0x2651ca){if(!_0x2651ca||_0x2651ca&&_0x2651ca[_0x6871('0x15')]!==_0x297cd4){return _0x53ce9e(null,![],{'message':_0x6871('0x16')});}return getLicense(_0x2651ca);})['then'](function(_0x5c1635){_0x5c1635[_0x6871('0x17')](_0x54d0f7,function(_0x1fb0d0,_0x4df34c){if(_0x1fb0d0){return _0x53ce9e(_0x1fb0d0);}if(!_0x4df34c){return _0x53ce9e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password'});}else{return _0x53ce9e(null,_0x5c1635);}});})[_0x6871('0x11')](function(_0x3eae26){_0x53ce9e(_0x3eae26);});}function sendServiceMail(_0x32a532){return db[_0x6871('0x18')][_0x6871('0x12')]({'where':{'service':!![]},'attributes':['id',_0x6871('0x15'),_0x6871('0x19')],'include':[{'model':db[_0x6871('0x1a')],'as':_0x6871('0x1b')}]})[_0x6871('0xd')](function(_0x384995){if(!_0x384995){throw new Error(_0x6871('0x1c'));}var _0x17b0d6={'tls':{'rejectUnauthorized':![]}};if(_0x384995[_0x6871('0x1b')]['service']){_0x17b0d6[_0x6871('0x1d')]=_0x384995[_0x6871('0x1b')][_0x6871('0x1d')];}else{_0x17b0d6[_0x6871('0x1e')]=_0x384995[_0x6871('0x1b')][_0x6871('0x1e')];_0x17b0d6['port']=_0x384995[_0x6871('0x1b')][_0x6871('0x1f')];_0x17b0d6[_0x6871('0x20')]=_0x384995[_0x6871('0x1b')][_0x6871('0x20')];}if(_0x384995[_0x6871('0x1b')][_0x6871('0x21')]){_0x17b0d6[_0x6871('0x22')]={'user':_0x384995[_0x6871('0x1b')]['user'],'pass':_0x384995[_0x6871('0x1b')][_0x6871('0x23')]};}var _0x3a88f5={'account':_0x17b0d6,'message':_[_0x6871('0x24')]({'from':util[_0x6871('0x25')]('\x22%s\x22\x20<%s>',_0x384995[_0x6871('0x15')],_0x384995[_0x6871('0x19')]||_0x384995[_0x6871('0x1b')][_0x6871('0x14')])},_0x32a532)};return client[_0x6871('0x26')](_0x6871('0x27'),_0x3a88f5);})[_0x6871('0xd')](function(_0x3ab8e0){if(_0x3ab8e0[_0x6871('0x28')]){throw new Error(util['format'](_0x6871('0x29'),_0x3ab8e0[_0x6871('0x28')][_0x6871('0x2a')]||JSON['stringify'](_0x3ab8e0[_0x6871('0x28')])));}return!![];});}function handleError(_0x2f8ca6,_0x174020,_0x286166){return _0x2f8ca6[_0x6871('0x2b')](_0x174020||0x1f4)['send']({'message':_0x286166?_0x286166['message']||_0x286166:''});}function checkPasswordPattern(_0x5ba0dd,_0x5bfc4a,_0x351619){if(_0x351619){var _0x4feb3d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4feb3d[_0x6871('0x2c')](_0x5bfc4a)){return _0x5ba0dd;}else{throw new Error(_0x6871('0x2d'));}}else{return _0x5ba0dd;}}exports['login']=function(_0x1f065b,_0x81a232,_0x5f5ae5){passport[_0x6871('0x17')](_0x6871('0x2e'),function(_0x203d65,_0x3fc52a,_0xfe358a){var _0xc2dd64=_0x203d65||_0xfe358a;if(_0xc2dd64){return handleError(_0x81a232,0x191,_0xc2dd64);}if(!_0x3fc52a){return handleError(_0x81a232,0x194,{'message':_0x6871('0x2f')});}var _0x221401=signToken(_0x3fc52a['id'],_0x3fc52a[_0x6871('0x30')]);_0x81a232[_0x6871('0x31')]({'id':_0x3fc52a['id'],'token':_0x221401,'statusCall':'','isAlreadyLogged':_0x3fc52a[_0x6871('0x32')]});})(_0x1f065b,_0x81a232,_0x5f5ae5);};exports['forgot']=function(_0x124928,_0x53c779,_0x4cd3c0){if(!_0x124928[_0x6871('0x33')]['email']){return handleError(_0x53c779,0x1f4,{'message':_0x6871('0x34')});}var _0x379951=rs[_0x6871('0x35')]();_0x124928[_0x6871('0x33')]['email']=_0x124928['body'][_0x6871('0x19')][_0x6871('0x36')]()[_0x6871('0x37')]();return db[_0x6871('0xc')][_0x6871('0x12')]({'where':{'email':_0x124928[_0x6871('0x33')]['email']}})['then'](function(_0x10003f){if(!_0x10003f){throw new Error(_0x6871('0x38'));}_0x10003f['resetPasswordToken']=_0x379951;_0x10003f[_0x6871('0x39')]=Date[_0x6871('0x3a')]()+0x36ee80;return _0x10003f['save']();})[_0x6871('0xd')](function(){return sendServiceMail({'to':_0x124928[_0x6871('0x33')][_0x6871('0x19')],'subject':_0x6871('0x3b'),'text':_0x6871('0x3c')+_0x6871('0x3d')+_0x6871('0x3e')+_0x124928['headers'][_0x6871('0x1e')]+_0x6871('0x3f')+_0x379951+'\x0a\x0a'+_0x6871('0x40')});})[_0x6871('0xd')](function(){_0x53c779['status'](0xc8)[_0x6871('0x41')]({'message':'Reset\x20Email\x20sent!'});})[_0x6871('0x11')](function(_0xd9b57){return handleError(_0x53c779,0x1f4,_0xd9b57);});};exports[_0x6871('0x42')]=function(_0x243ecc,_0xda01e1,_0x1c46a6){var _0xd11c90;return db[_0x6871('0xc')]['find']({'where':{'resetPasswordToken':_0x243ecc[_0x6871('0x43')][_0x6871('0x44')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x6871('0xd')](function(_0xf725b7){_0xd11c90=_0xf725b7;if(!_0xd11c90){throw new Error(_0x6871('0x45'));}return db['Setting'][_0x6871('0x46')]({'attributes':['id','securePassword']});})[_0x6871('0xd')](function(_0x13d6cb){return checkPasswordPattern(_0x13d6cb,_0x243ecc[_0x6871('0x33')][_0x6871('0x47')],_0x13d6cb[_0x6871('0x48')]);})[_0x6871('0xd')](function(){_0xd11c90[_0x6871('0x47')]=_0x243ecc[_0x6871('0x33')][_0x6871('0x47')];_0xd11c90[_0x6871('0x49')]=null;_0xd11c90[_0x6871('0x39')]=null;return _0xd11c90['save']();})[_0x6871('0xd')](function(){_0xda01e1[_0x6871('0x2b')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x6871('0x11')](function(_0x430269){return handleError(_0xda01e1,0x1f4,_0x430269);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0x6871('0x47')},function(_0x171cf3,_0xf43ad,_0x1ed01d){return localAuthenticate(db[_0x6871('0xc')],_0x171cf3,_0xf43ad,_0x1ed01d);}));
\ No newline at end of file
+var _0x0bf2=['securePassword','password','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','../../config/logger','api','randomstring','../../mysqldb','../../components/auth/service','client','http','role','agent','count','then','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','find','admin','user','name','Incorrect\x20username\x20and/or\x20password','authenticate','catch','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','message','test','local','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','findOne'];(function(_0x2379f6,_0x5d6d34){var _0xb3ef8c=function(_0x5e7d04){while(--_0x5e7d04){_0x2379f6['push'](_0x2379f6['shift']());}};_0xb3ef8c(++_0x5d6d34);}(_0x0bf2,0x12c));var _0x20bf=function(_0x2fa144,_0xab0aee){_0x2fa144=_0x2fa144-0x0;var _0x250fbf=_0x0bf2[_0x2fa144];return _0x250fbf;};'use strict';var util=require(_0x20bf('0x0'));var passport=require(_0x20bf('0x1'));var LocalStrategy=require(_0x20bf('0x2'))['Strategy'];var BPromise=require('bluebird');var jayson=require(_0x20bf('0x3'));var _=require(_0x20bf('0x4'));var logger=require(_0x20bf('0x5'))(_0x20bf('0x6'));var rs=require(_0x20bf('0x7'));var db=require(_0x20bf('0x8'))['db'];var signToken=require(_0x20bf('0x9'))['signToken'];var client=jayson[_0x20bf('0xa')][_0x20bf('0xb')]({'port':0x232b});var getLicense=function(_0x6ce9fe){return new BPromise(function(_0x3e913f,_0x58aded){var _0x5a0a83=0x0;_0x6ce9fe[_0x20bf('0xc')]!==_0x20bf('0xd')&&_0x3e913f(_0x6ce9fe);return db['User'][_0x20bf('0xe')]({'where':{'role':_0x20bf('0xd'),'online':!![],'id':{'$ne':_0x6ce9fe['id']}}})[_0x20bf('0xf')](function(_0xcf1912){_0x5a0a83=_0xcf1912;return require(_0x20bf('0x10'))[_0x20bf('0x11')]();})[_0x20bf('0xf')](function(_0x14d9c3){if(_0x14d9c3&&_0x14d9c3[_0x20bf('0x12')]&&_0x5a0a83>=_0x14d9c3['agents']){return _0x58aded({'message':_0x20bf('0x13')});}return _0x3e913f(_0x6ce9fe);})['catch'](function(_0x49f137){return _0x58aded(_0x49f137);});});};function localAuthenticate(_0x5ac094,_0xf02e6e,_0x31053b,_0x47d911){_0x5ac094[_0x20bf('0x14')]({'where':{'name':_0xf02e6e,'role':{'$or':[_0x20bf('0x15'),_0x20bf('0x16'),_0x20bf('0xd')]}}})[_0x20bf('0xf')](function(_0x436011){if(!_0x436011||_0x436011&&_0x436011[_0x20bf('0x17')]!==_0xf02e6e){return _0x47d911(null,![],{'message':_0x20bf('0x18')});}return getLicense(_0x436011);})['then'](function(_0x400e81){_0x400e81[_0x20bf('0x19')](_0x31053b,function(_0x1d5de5,_0x4887a9){if(_0x1d5de5){return _0x47d911(_0x1d5de5);}if(!_0x4887a9){return _0x47d911(null,![],{'message':_0x20bf('0x18')});}else{return _0x47d911(null,_0x400e81);}});})[_0x20bf('0x1a')](function(_0x276762){_0x47d911(_0x276762);});}function sendServiceMail(_0x564ce2){return db[_0x20bf('0x1b')][_0x20bf('0x14')]({'where':{'service':!![]},'attributes':['id',_0x20bf('0x17'),_0x20bf('0x1c')],'include':[{'model':db[_0x20bf('0x1d')],'as':_0x20bf('0x1e')}]})[_0x20bf('0xf')](function(_0x13d638){if(!_0x13d638){throw new Error(_0x20bf('0x1f'));}var _0x57d376={'tls':{'rejectUnauthorized':![]}};if(_0x13d638[_0x20bf('0x1e')][_0x20bf('0x20')]){_0x57d376[_0x20bf('0x20')]=_0x13d638[_0x20bf('0x1e')][_0x20bf('0x20')];}else{_0x57d376[_0x20bf('0x21')]=_0x13d638['Smtp'][_0x20bf('0x21')];_0x57d376[_0x20bf('0x22')]=_0x13d638[_0x20bf('0x1e')][_0x20bf('0x22')];_0x57d376['secure']=_0x13d638[_0x20bf('0x1e')][_0x20bf('0x23')];}if(_0x13d638[_0x20bf('0x1e')][_0x20bf('0x24')]){_0x57d376[_0x20bf('0x25')]={'user':_0x13d638['Smtp'][_0x20bf('0x16')],'pass':_0x13d638[_0x20bf('0x1e')][_0x20bf('0x26')]};}var _0x434eea={'account':_0x57d376,'message':_[_0x20bf('0x27')]({'from':util[_0x20bf('0x28')](_0x20bf('0x29'),_0x13d638[_0x20bf('0x17')],_0x13d638[_0x20bf('0x1c')]||_0x13d638[_0x20bf('0x1e')][_0x20bf('0x16')])},_0x564ce2)};return client[_0x20bf('0x2a')](_0x20bf('0x2b'),_0x434eea);})[_0x20bf('0xf')](function(_0x364efc){if(_0x364efc[_0x20bf('0x2c')]){throw new Error(util['format'](_0x20bf('0x2d'),_0x364efc['error']['message']||JSON['stringify'](_0x364efc[_0x20bf('0x2c')])));}return!![];});}function handleError(_0x2068fd,_0x1a20bf,_0x296de8){return _0x2068fd[_0x20bf('0x2e')](_0x1a20bf||0x1f4)[_0x20bf('0x2f')]({'message':_0x296de8?_0x296de8[_0x20bf('0x30')]||_0x296de8:''});}function checkPasswordPattern(_0x207883,_0x19c1cf,_0x57511e){if(_0x57511e){var _0x43f1a1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43f1a1[_0x20bf('0x31')](_0x19c1cf)){return _0x207883;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x207883;}}exports['login']=function(_0x40f170,_0x103de4,_0x1f294c){passport[_0x20bf('0x19')](_0x20bf('0x32'),function(_0x86a463,_0x3445cf,_0x461bef){var _0x26cd1c=_0x86a463||_0x461bef;if(_0x26cd1c){return handleError(_0x103de4,0x191,_0x26cd1c);}if(!_0x3445cf){return handleError(_0x103de4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}var _0xf0694b=signToken(_0x3445cf['id'],_0x3445cf[_0x20bf('0xc')]);_0x103de4['json']({'id':_0x3445cf['id'],'token':_0xf0694b,'statusCall':'','isAlreadyLogged':_0x3445cf[_0x20bf('0x33')]});})(_0x40f170,_0x103de4,_0x1f294c);};exports[_0x20bf('0x34')]=function(_0x19214f,_0x3a9518,_0x2cc5d4){if(!_0x19214f[_0x20bf('0x35')]['email']){return handleError(_0x3a9518,0x1f4,{'message':_0x20bf('0x36')});}var _0x3f62f2=rs['generate']();_0x19214f['body'][_0x20bf('0x1c')]=_0x19214f[_0x20bf('0x35')][_0x20bf('0x1c')][_0x20bf('0x37')]()[_0x20bf('0x38')]();return db['User']['find']({'where':{'email':_0x19214f[_0x20bf('0x35')]['email']}})[_0x20bf('0xf')](function(_0x5655e0){if(!_0x5655e0){throw new Error(_0x20bf('0x39'));}_0x5655e0[_0x20bf('0x3a')]=_0x3f62f2;_0x5655e0['resetPasswordExpires']=Date[_0x20bf('0x3b')]()+0x36ee80;return _0x5655e0[_0x20bf('0x3c')]();})[_0x20bf('0xf')](function(){return sendServiceMail({'to':_0x19214f[_0x20bf('0x35')][_0x20bf('0x1c')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x20bf('0x3d')+'http://'+_0x19214f[_0x20bf('0x3e')][_0x20bf('0x21')]+_0x20bf('0x3f')+_0x3f62f2+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x20bf('0xf')](function(){_0x3a9518['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x20bf('0x1a')](function(_0x4f151c){return handleError(_0x3a9518,0x1f4,_0x4f151c);});};exports['reset']=function(_0x4d71f4,_0x391494,_0x2420d3){var _0x4e99a1;return db[_0x20bf('0x40')][_0x20bf('0x14')]({'where':{'resetPasswordToken':_0x4d71f4[_0x20bf('0x41')][_0x20bf('0x42')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x20bf('0xf')](function(_0x3ab3b3){_0x4e99a1=_0x3ab3b3;if(!_0x4e99a1){throw new Error(_0x20bf('0x43'));}return db[_0x20bf('0x44')][_0x20bf('0x45')]({'attributes':['id',_0x20bf('0x46')]});})[_0x20bf('0xf')](function(_0x1734a2){return checkPasswordPattern(_0x1734a2,_0x4d71f4['body']['password'],_0x1734a2[_0x20bf('0x46')]);})['then'](function(){_0x4e99a1[_0x20bf('0x47')]=_0x4d71f4[_0x20bf('0x35')][_0x20bf('0x47')];_0x4e99a1['resetPasswordToken']=null;_0x4e99a1['resetPasswordExpires']=null;return _0x4e99a1[_0x20bf('0x3c')]();})[_0x20bf('0xf')](function(){_0x391494[_0x20bf('0x2e')](0xc8)[_0x20bf('0x2f')]({'message':_0x20bf('0x48')});})[_0x20bf('0x1a')](function(_0x9747b8){return handleError(_0x391494,0x1f4,_0x9747b8);});};passport[_0x20bf('0x49')](new LocalStrategy({'usernameField':_0x20bf('0x17'),'passwordField':_0x20bf('0x47')},function(_0x5c8034,_0x211aea,_0x3d276a){return localAuthenticate(db[_0x20bf('0x40')],_0x5c8034,_0x211aea,_0x3d276a);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 987025a..3fa09f3 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 _0x0824=['./authLocal.controller','login','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0824,0xcd));var _0x4082=function(_0x92c4ab,_0x239dcc){_0x92c4ab=_0x92c4ab-0x0;var _0x5bf271=_0x0824[_0x92c4ab];return _0x5bf271;};'use strict';var express=require(_0x4082('0x0'));var router=express[_0x4082('0x1')]();var controller=require(_0x4082('0x2'));router['post']('/',controller[_0x4082('0x3')]);router['post'](_0x4082('0x4'),controller[_0x4082('0x5')]);router['post'](_0x4082('0x6'),controller[_0x4082('0x7')]);module[_0x4082('0x8')]=router;
\ No newline at end of file
+var _0xe762=['forgot','reset','exports','express','./authLocal.controller','post','/forgot'];(function(_0x4c607f,_0x4b5324){var _0x54d9a1=function(_0x48487c){while(--_0x48487c){_0x4c607f['push'](_0x4c607f['shift']());}};_0x54d9a1(++_0x4b5324);}(_0xe762,0x73));var _0x2e76=function(_0x198fe3,_0x8fb65a){_0x198fe3=_0x198fe3-0x0;var _0x237bd5=_0xe762[_0x198fe3];return _0x237bd5;};'use strict';var express=require(_0x2e76('0x0'));var router=express['Router']();var controller=require(_0x2e76('0x1'));router[_0x2e76('0x2')]('/',controller['login']);router[_0x2e76('0x2')](_0x2e76('0x3'),controller[_0x2e76('0x4')]);router['post']('/reset/:token',controller[_0x2e76('0x5')]);module[_0x2e76('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index d40bac5..597cd1b 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 _0x110f=['sequelize','exports','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x110f,0x1e6));var _0xf110=function(_0x184284,_0x3bc5a8){_0x184284=_0x184284-0x0;var _0x1370a0=_0x110f[_0x184284];return _0x1370a0;};'use strict';var Sequelize=require(_0xf110('0x0'));module[_0xf110('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xf110('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x2d08=['BOOLEAN','sequelize','exports','STRING'];(function(_0x519e1b,_0x58dac3){var _0x4634ed=function(_0x56a44f){while(--_0x56a44f){_0x519e1b['push'](_0x519e1b['shift']());}};_0x4634ed(++_0x58dac3);}(_0x2d08,0x129));var _0x82d0=function(_0x2a9ec5,_0xed23b){_0x2a9ec5=_0x2a9ec5-0x0;var _0x52c7c0=_0x2d08[_0x2a9ec5];return _0x52c7c0;};'use strict';var Sequelize=require(_0x82d0('0x0'));module[_0x82d0('0x1')]={'name':{'type':Sequelize[_0x82d0('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x82d0('0x2')]},'description':{'type':Sequelize[_0x82d0('0x2')]},'status':{'type':Sequelize[_0x82d0('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 08bcf5c..1c4c1a2 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 _0x614c=['limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','field','merge','options','includeAll','rows','catch','params','create','body','update','find','addConditions','Condition','omit','ids','findOne','map','getConditions','addActions','Action','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x614c,0xd2));var _0xc614=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x614c[_0x27af45];return _0x18df21;};'use strict';var pdf=require(_0xc614('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc614('0x1'));var zipdir=require(_0xc614('0x2'));var jsonpatch=require(_0xc614('0x3'));var rp=require(_0xc614('0x4'));var moment=require('moment');var BPromise=require(_0xc614('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc614('0x6'));var sox=require(_0xc614('0x7'));var csv=require(_0xc614('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc614('0x9'));var squel=require(_0xc614('0xa'));var crypto=require(_0xc614('0xb'));var jsforce=require(_0xc614('0xc'));var deskjs=require(_0xc614('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc614('0xe'));var Papa=require(_0xc614('0xf'));var Redis=require('ioredis');var authService=require(_0xc614('0x10'));var qs=require(_0xc614('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc614('0x12'));var utils=require(_0xc614('0x13'));var config=require('../../config/environment');var db=require(_0xc614('0x14'))['db'];function respondWithStatusCode(_0x5db30b,_0x1a664c){_0x1a664c=_0x1a664c||0xcc;return function(_0x561198){if(_0x561198){return _0x5db30b[_0xc614('0x15')](_0x1a664c);}return _0x5db30b[_0xc614('0x16')](_0x1a664c)[_0xc614('0x17')]();};}function respondWithResult(_0x28a082,_0x13e398){_0x13e398=_0x13e398||0xc8;return function(_0x43af8b){if(_0x43af8b){return _0x28a082[_0xc614('0x16')](_0x13e398)[_0xc614('0x18')](_0x43af8b);}};}function respondWithFilteredResult(_0x4d3436,_0x4e41cf){return function(_0x1152fe){if(_0x1152fe){var _0x448e97=_0x1152fe[_0xc614('0x19')],_0xab9119=_0x4e41cf[_0xc614('0x1a')],_0x4a44a5=_0x4e41cf['offset']+_0x4e41cf[_0xc614('0x1b')],_0x5d4d8c;if(_0x4a44a5>=_0x448e97){_0x4a44a5=_0x448e97;_0x5d4d8c=0xc8;}else{_0x5d4d8c=0xce;}_0x4d3436[_0xc614('0x16')](_0x5d4d8c);return _0x4d3436[_0xc614('0x1c')](_0xc614('0x1d'),_0xab9119+'-'+_0x4a44a5+'/'+_0x448e97)[_0xc614('0x18')](_0x1152fe);}return null;};}function patchUpdates(_0x53b6f0){return function(_0x25b4a1){try{jsonpatch[_0xc614('0x1e')](_0x25b4a1,_0x53b6f0,!![]);}catch(_0x44e50e){return BPromise[_0xc614('0x1f')](_0x44e50e);}return _0x25b4a1[_0xc614('0x20')]();};}function saveUpdates(_0x365f38,_0x1b784a){return function(_0x3fade4){if(_0x3fade4){return _0x3fade4['update'](_0x365f38)['then'](function(_0x516509){return _0x516509;});}return null;};}function removeEntity(_0x4e0b02,_0x46685a){return function(_0xeab5bd){if(_0xeab5bd){return _0xeab5bd[_0xc614('0x21')]()[_0xc614('0x22')](function(){_0x4e0b02[_0xc614('0x16')](0xcc)[_0xc614('0x17')]();});}};}function handleEntityNotFound(_0x5b4644,_0x4a02e3){return function(_0xc46c1f){if(!_0xc46c1f){_0x5b4644['sendStatus'](0x194);}return _0xc46c1f;};}function handleError(_0xfd1ebb,_0x2b1783){_0x2b1783=_0x2b1783||0x1f4;return function(_0x29d57d){logger['error'](_0x29d57d[_0xc614('0x23')]);if(_0x29d57d[_0xc614('0x24')]){delete _0x29d57d[_0xc614('0x24')];}_0xfd1ebb[_0xc614('0x16')](_0x2b1783)[_0xc614('0x25')](_0x29d57d);};}exports[_0xc614('0x26')]=function(_0x5f50d5,_0x5f5b3){var _0x35da6c={},_0x3c2fc5={},_0x1ebab4={'count':0x0,'rows':[]};var _0x5efd0d=db[_0xc614('0x27')][_0xc614('0x28')];_0x3c2fc5[_0xc614('0x29')]=_[_0xc614('0x2a')](_0x5efd0d);_0x3c2fc5[_0xc614('0x2b')]=_[_0xc614('0x2a')](_0x5f50d5['query']);_0x3c2fc5[_0xc614('0x2c')]=_[_0xc614('0x2d')](_0x3c2fc5[_0xc614('0x29')],_0x3c2fc5[_0xc614('0x2b')]);_0x35da6c[_0xc614('0x2e')]=_[_0xc614('0x2d')](_0x3c2fc5['model'],qs[_0xc614('0x2f')](_0x5f50d5[_0xc614('0x2b')][_0xc614('0x2f')]));_0x35da6c[_0xc614('0x2e')]=_0x35da6c[_0xc614('0x2e')][_0xc614('0x30')]?_0x35da6c[_0xc614('0x2e')]:_0x3c2fc5['model'];if(!_0x5f50d5['query'][_0xc614('0x31')](_0xc614('0x32'))){_0x35da6c['limit']=qs[_0xc614('0x1b')](_0x5f50d5['query'][_0xc614('0x1b')]);_0x35da6c['offset']=qs['offset'](_0x5f50d5[_0xc614('0x2b')]['offset']);}_0x35da6c[_0xc614('0x33')]=qs['sort'](_0x5f50d5[_0xc614('0x2b')][_0xc614('0x34')]);_0x35da6c[_0xc614('0x35')]=qs[_0xc614('0x2c')](_[_0xc614('0x36')](_0x5f50d5[_0xc614('0x2b')],_0x3c2fc5[_0xc614('0x2c')]));if(_0x5f50d5[_0xc614('0x2b')][_0xc614('0x37')]){_0x35da6c[_0xc614('0x35')]=_['merge'](_0x35da6c[_0xc614('0x35')],{'$or':_['map'](_0x5efd0d,function(_0x3bf285){if(_0x3bf285[_0xc614('0x38')][_0xc614('0x39')]!=='VIRTUAL'){var _0xbf1f4d={};_0xbf1f4d[_0x3bf285[_0xc614('0x3a')]]={'$like':'%'+_0x5f50d5[_0xc614('0x2b')][_0xc614('0x37')]+'%'};return _0xbf1f4d;}})});}_0x35da6c=_[_0xc614('0x3b')]({},_0x35da6c,_0x5f50d5[_0xc614('0x3c')]);var _0x1ea907={'where':_0x35da6c['where']};return db[_0xc614('0x27')][_0xc614('0x19')](_0x1ea907)[_0xc614('0x22')](function(_0x24c80c){_0x1ebab4[_0xc614('0x19')]=_0x24c80c;if(_0x5f50d5[_0xc614('0x2b')][_0xc614('0x3d')]){_0x35da6c['include']=[{'all':!![]}];}return db[_0xc614('0x27')]['findAll'](_0x35da6c);})[_0xc614('0x22')](function(_0x28ac1c){_0x1ebab4[_0xc614('0x3e')]=_0x28ac1c;return _0x1ebab4;})[_0xc614('0x22')](respondWithFilteredResult(_0x5f5b3,_0x35da6c))[_0xc614('0x3f')](handleError(_0x5f5b3,null));};exports['show']=function(_0x48585c,_0x22c92f){var _0x286b11={'raw':![],'where':{'id':_0x48585c[_0xc614('0x40')]['id']}},_0x16971e={};_0x16971e[_0xc614('0x29')]=_['keys'](db['Automation'][_0xc614('0x28')]);_0x16971e['query']=_[_0xc614('0x2a')](_0x48585c[_0xc614('0x2b')]);_0x16971e[_0xc614('0x2c')]=_[_0xc614('0x2d')](_0x16971e['model'],_0x16971e['query']);_0x286b11[_0xc614('0x2e')]=_[_0xc614('0x2d')](_0x16971e[_0xc614('0x29')],qs[_0xc614('0x2f')](_0x48585c[_0xc614('0x2b')][_0xc614('0x2f')]));_0x286b11[_0xc614('0x2e')]=_0x286b11[_0xc614('0x2e')][_0xc614('0x30')]?_0x286b11['attributes']:_0x16971e[_0xc614('0x29')];if(_0x48585c[_0xc614('0x2b')]['includeAll']){_0x286b11['include']=[{'all':!![]}];}_0x286b11=_['merge']({},_0x286b11,_0x48585c[_0xc614('0x3c')]);return db[_0xc614('0x27')]['find'](_0x286b11)[_0xc614('0x22')](handleEntityNotFound(_0x22c92f,null))['then'](respondWithResult(_0x22c92f,null))[_0xc614('0x3f')](handleError(_0x22c92f,null));};exports[_0xc614('0x41')]=function(_0x3aa6ff,_0x278663){return db[_0xc614('0x27')]['create'](_0x3aa6ff[_0xc614('0x42')],{})[_0xc614('0x22')](respondWithResult(_0x278663,0xc9))[_0xc614('0x3f')](handleError(_0x278663,null));};exports[_0xc614('0x43')]=function(_0x4efe32,_0x216b17){if(_0x4efe32[_0xc614('0x42')]['id']){delete _0x4efe32['body']['id'];}return db[_0xc614('0x27')][_0xc614('0x44')]({'where':{'id':_0x4efe32[_0xc614('0x40')]['id']}})[_0xc614('0x22')](handleEntityNotFound(_0x216b17,null))[_0xc614('0x22')](saveUpdates(_0x4efe32[_0xc614('0x42')],null))['then'](respondWithResult(_0x216b17,null))[_0xc614('0x3f')](handleError(_0x216b17,null));};exports[_0xc614('0x21')]=function(_0x160f8a,_0xd8c8c7){return db[_0xc614('0x27')][_0xc614('0x44')]({'where':{'id':_0x160f8a[_0xc614('0x40')]['id']}})['then'](handleEntityNotFound(_0xd8c8c7,null))['then'](removeEntity(_0xd8c8c7,null))[_0xc614('0x3f')](handleError(_0xd8c8c7,null));};exports[_0xc614('0x45')]=function(_0xf8493e,_0x3fb20e,_0xb09fc0){return db[_0xc614('0x46')][_0xc614('0x44')]({'where':{'id':_0xf8493e['params']['id']}})['then'](handleEntityNotFound(_0x3fb20e,null))['then'](function(_0x452167){if(_0x452167){return _0x452167[_0xc614('0x45')](_0xf8493e['body']['ids'],_[_0xc614('0x47')](_0xf8493e[_0xc614('0x42')],[_0xc614('0x48'),'id'])||{});}})[_0xc614('0x22')](respondWithResult(_0x3fb20e,null))[_0xc614('0x3f')](handleError(_0x3fb20e,null));};exports['getConditions']=function(_0x297fde,_0xba5dba,_0x5d1c62){var _0x1a4f52={};var _0x47e50c={};var _0x412a6d;var _0x1f25e8;return db[_0xc614('0x27')][_0xc614('0x49')]({'where':{'id':_0x297fde[_0xc614('0x40')]['id']}})[_0xc614('0x22')](handleEntityNotFound(_0xba5dba,null))[_0xc614('0x22')](function(_0x1a083c){if(_0x1a083c){_0x412a6d=_0x1a083c;_0x47e50c[_0xc614('0x29')]=_['keys'](db[_0xc614('0x46')][_0xc614('0x28')]);_0x47e50c[_0xc614('0x2b')]=_[_0xc614('0x2a')](_0x297fde[_0xc614('0x2b')]);_0x47e50c['filters']=_[_0xc614('0x2d')](_0x47e50c[_0xc614('0x29')],_0x47e50c['query']);_0x1a4f52['attributes']=_[_0xc614('0x2d')](_0x47e50c[_0xc614('0x29')],qs[_0xc614('0x2f')](_0x297fde[_0xc614('0x2b')][_0xc614('0x2f')]));_0x1a4f52[_0xc614('0x2e')]=_0x1a4f52[_0xc614('0x2e')][_0xc614('0x30')]?_0x1a4f52[_0xc614('0x2e')]:_0x47e50c[_0xc614('0x29')];_0x1a4f52[_0xc614('0x33')]=qs[_0xc614('0x34')](_0x297fde['query']['sort']);_0x1a4f52[_0xc614('0x35')]=qs[_0xc614('0x2c')](_[_0xc614('0x36')](_0x297fde[_0xc614('0x2b')],_0x47e50c[_0xc614('0x2c')]));if(_0x297fde[_0xc614('0x2b')][_0xc614('0x37')]){_0x1a4f52['where']=_['merge'](_0x1a4f52[_0xc614('0x35')],{'$or':_[_0xc614('0x4a')](_0x1a4f52[_0xc614('0x2e')],function(_0x2651ea){var _0x379b2d={};_0x379b2d[_0x2651ea]={'$like':'%'+_0x297fde[_0xc614('0x2b')][_0xc614('0x37')]+'%'};return _0x379b2d;})});}_0x1a4f52=_[_0xc614('0x3b')]({},_0x1a4f52,_0x297fde['options']);return _0x412a6d[_0xc614('0x4b')](_0x1a4f52);}})[_0xc614('0x22')](function(_0x4a781e){if(_0x4a781e){_0x1f25e8=_0x4a781e[_0xc614('0x30')];if(!_0x297fde['query'][_0xc614('0x31')](_0xc614('0x32'))){_0x1a4f52[_0xc614('0x1b')]=qs['limit'](_0x297fde[_0xc614('0x2b')][_0xc614('0x1b')]);_0x1a4f52[_0xc614('0x1a')]=qs[_0xc614('0x1a')](_0x297fde[_0xc614('0x2b')][_0xc614('0x1a')]);}return _0x412a6d[_0xc614('0x4b')](_0x1a4f52);}})[_0xc614('0x22')](function(_0x49c82a){if(_0x49c82a){return _0x49c82a?{'count':_0x1f25e8,'rows':_0x49c82a}:null;}})[_0xc614('0x22')](respondWithResult(_0xba5dba,null))[_0xc614('0x3f')](handleError(_0xba5dba,null));};exports[_0xc614('0x4c')]=function(_0x271efe,_0x5cd74c,_0x4fb04d){return db['Action'][_0xc614('0x44')]({'where':{'id':_0x271efe[_0xc614('0x40')]['id']}})['then'](handleEntityNotFound(_0x5cd74c,null))[_0xc614('0x22')](function(_0x5ed6fe){if(_0x5ed6fe){return _0x5ed6fe[_0xc614('0x4c')](_0x271efe[_0xc614('0x42')][_0xc614('0x48')],_[_0xc614('0x47')](_0x271efe['body'],[_0xc614('0x48'),'id'])||{});}})[_0xc614('0x22')](respondWithResult(_0x5cd74c,null))[_0xc614('0x3f')](handleError(_0x5cd74c,null));};exports['getActions']=function(_0xe152ae,_0x36e853,_0x17ba13){var _0x329623={};var _0x42d868={};var _0x3da8db;var _0x171fec;return db[_0xc614('0x27')][_0xc614('0x49')]({'where':{'id':_0xe152ae[_0xc614('0x40')]['id']}})[_0xc614('0x22')](handleEntityNotFound(_0x36e853,null))[_0xc614('0x22')](function(_0x4bfd57){if(_0x4bfd57){_0x3da8db=_0x4bfd57;_0x42d868['model']=_['keys'](db[_0xc614('0x4d')][_0xc614('0x28')]);_0x42d868[_0xc614('0x2b')]=_[_0xc614('0x2a')](_0xe152ae[_0xc614('0x2b')]);_0x42d868[_0xc614('0x2c')]=_[_0xc614('0x2d')](_0x42d868[_0xc614('0x29')],_0x42d868['query']);_0x329623[_0xc614('0x2e')]=_[_0xc614('0x2d')](_0x42d868[_0xc614('0x29')],qs[_0xc614('0x2f')](_0xe152ae['query'][_0xc614('0x2f')]));_0x329623[_0xc614('0x2e')]=_0x329623[_0xc614('0x2e')][_0xc614('0x30')]?_0x329623['attributes']:_0x42d868[_0xc614('0x29')];_0x329623[_0xc614('0x33')]=qs['sort'](_0xe152ae['query'][_0xc614('0x34')]);_0x329623[_0xc614('0x35')]=qs[_0xc614('0x2c')](_[_0xc614('0x36')](_0xe152ae[_0xc614('0x2b')],_0x42d868['filters']));if(_0xe152ae['query'][_0xc614('0x37')]){_0x329623[_0xc614('0x35')]=_['merge'](_0x329623['where'],{'$or':_['map'](_0x329623['attributes'],function(_0x40c34c){var _0x3ad5f8={};_0x3ad5f8[_0x40c34c]={'$like':'%'+_0xe152ae[_0xc614('0x2b')][_0xc614('0x37')]+'%'};return _0x3ad5f8;})});}_0x329623=_[_0xc614('0x3b')]({},_0x329623,_0xe152ae[_0xc614('0x3c')]);return _0x3da8db[_0xc614('0x4e')](_0x329623);}})[_0xc614('0x22')](function(_0x693d1c){if(_0x693d1c){_0x171fec=_0x693d1c['length'];if(!_0xe152ae['query'][_0xc614('0x31')](_0xc614('0x32'))){_0x329623[_0xc614('0x1b')]=qs[_0xc614('0x1b')](_0xe152ae[_0xc614('0x2b')][_0xc614('0x1b')]);_0x329623[_0xc614('0x1a')]=qs[_0xc614('0x1a')](_0xe152ae[_0xc614('0x2b')][_0xc614('0x1a')]);}return _0x3da8db[_0xc614('0x4e')](_0x329623);}})[_0xc614('0x22')](function(_0x1b30a8){if(_0x1b30a8){return _0x1b30a8?{'count':_0x171fec,'rows':_0x1b30a8}:null;}})[_0xc614('0x22')](respondWithResult(_0x36e853,null))[_0xc614('0x3f')](handleError(_0x36e853,null));};
\ No newline at end of file
+var _0x0301=['create','body','destroy','addConditions','Condition','ids','omit','findOne','order','map','getConditions','addActions','Action','getActions','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','apply','reject','update','then','error','stack','name','send','index','Automation','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','count','includeAll','include','rows','catch','show','params','find'];(function(_0x4c7410,_0x43bf77){var _0x2cf87d=function(_0x5f3db0){while(--_0x5f3db0){_0x4c7410['push'](_0x4c7410['shift']());}};_0x2cf87d(++_0x43bf77);}(_0x0301,0x14e));var _0x1030=function(_0x19fa06,_0x14dcc6){_0x19fa06=_0x19fa06-0x0;var _0x278075=_0x0301[_0x19fa06];return _0x278075;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1030('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1030('0x1'));var rp=require('request-promise');var moment=require(_0x1030('0x2'));var BPromise=require(_0x1030('0x3'));var Mustache=require(_0x1030('0x4'));var util=require('util');var path=require(_0x1030('0x5'));var sox=require(_0x1030('0x6'));var csv=require(_0x1030('0x7'));var ejs=require(_0x1030('0x8'));var fs=require('fs');var _=require(_0x1030('0x9'));var squel=require(_0x1030('0xa'));var crypto=require(_0x1030('0xb'));var jsforce=require(_0x1030('0xc'));var deskjs=require(_0x1030('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1030('0xe'));var Papa=require('papaparse');var Redis=require(_0x1030('0xf'));var authService=require(_0x1030('0x10'));var qs=require(_0x1030('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1030('0x12'));var db=require(_0x1030('0x13'))['db'];function respondWithStatusCode(_0x30774b,_0x3d9e4a){_0x3d9e4a=_0x3d9e4a||0xcc;return function(_0x15101c){if(_0x15101c){return _0x30774b[_0x1030('0x14')](_0x3d9e4a);}return _0x30774b[_0x1030('0x15')](_0x3d9e4a)[_0x1030('0x16')]();};}function respondWithResult(_0xf05744,_0x133a48){_0x133a48=_0x133a48||0xc8;return function(_0x2e33b3){if(_0x2e33b3){return _0xf05744[_0x1030('0x15')](_0x133a48)[_0x1030('0x17')](_0x2e33b3);}};}function respondWithFilteredResult(_0x549fb7,_0x3e45ce){return function(_0x2e6c7b){if(_0x2e6c7b){var _0x17ebef=_0x2e6c7b['count'],_0x46fa80=_0x3e45ce[_0x1030('0x18')],_0xedf444=_0x3e45ce[_0x1030('0x18')]+_0x3e45ce['limit'],_0x1cc1c0;if(_0xedf444>=_0x17ebef){_0xedf444=_0x17ebef;_0x1cc1c0=0xc8;}else{_0x1cc1c0=0xce;}_0x549fb7[_0x1030('0x15')](_0x1cc1c0);return _0x549fb7[_0x1030('0x19')]('Content-Range',_0x46fa80+'-'+_0xedf444+'/'+_0x17ebef)['json'](_0x2e6c7b);}return null;};}function patchUpdates(_0x3d7856){return function(_0x313aaa){try{jsonpatch[_0x1030('0x1a')](_0x313aaa,_0x3d7856,!![]);}catch(_0xa19351){return BPromise[_0x1030('0x1b')](_0xa19351);}return _0x313aaa['save']();};}function saveUpdates(_0x51c7e8,_0x384b84){return function(_0x31d1f3){if(_0x31d1f3){return _0x31d1f3[_0x1030('0x1c')](_0x51c7e8)['then'](function(_0x468c41){return _0x468c41;});}return null;};}function removeEntity(_0xdef1c,_0x222554){return function(_0x3ec21b){if(_0x3ec21b){return _0x3ec21b['destroy']()[_0x1030('0x1d')](function(){_0xdef1c[_0x1030('0x15')](0xcc)[_0x1030('0x16')]();});}};}function handleEntityNotFound(_0x1fc190,_0x1709b0){return function(_0x8165ea){if(!_0x8165ea){_0x1fc190[_0x1030('0x14')](0x194);}return _0x8165ea;};}function handleError(_0x589224,_0x55b993){_0x55b993=_0x55b993||0x1f4;return function(_0x1b6c0a){logger[_0x1030('0x1e')](_0x1b6c0a[_0x1030('0x1f')]);if(_0x1b6c0a[_0x1030('0x20')]){delete _0x1b6c0a[_0x1030('0x20')];}_0x589224[_0x1030('0x15')](_0x55b993)[_0x1030('0x21')](_0x1b6c0a);};}exports[_0x1030('0x22')]=function(_0x2cd1ae,_0x4e6126){var _0x3f029c={},_0x1ef0a8={},_0x300808={'count':0x0,'rows':[]};var _0x37dae1=db[_0x1030('0x23')][_0x1030('0x24')];_0x1ef0a8[_0x1030('0x25')]=_['keys'](_0x37dae1);_0x1ef0a8[_0x1030('0x26')]=_[_0x1030('0x27')](_0x2cd1ae['query']);_0x1ef0a8[_0x1030('0x28')]=_[_0x1030('0x29')](_0x1ef0a8[_0x1030('0x25')],_0x1ef0a8[_0x1030('0x26')]);_0x3f029c[_0x1030('0x2a')]=_[_0x1030('0x29')](_0x1ef0a8[_0x1030('0x25')],qs[_0x1030('0x2b')](_0x2cd1ae[_0x1030('0x26')][_0x1030('0x2b')]));_0x3f029c[_0x1030('0x2a')]=_0x3f029c[_0x1030('0x2a')][_0x1030('0x2c')]?_0x3f029c[_0x1030('0x2a')]:_0x1ef0a8[_0x1030('0x25')];if(!_0x2cd1ae[_0x1030('0x26')][_0x1030('0x2d')](_0x1030('0x2e'))){_0x3f029c[_0x1030('0x2f')]=qs['limit'](_0x2cd1ae['query'][_0x1030('0x2f')]);_0x3f029c[_0x1030('0x18')]=qs[_0x1030('0x18')](_0x2cd1ae[_0x1030('0x26')]['offset']);}_0x3f029c['order']=qs[_0x1030('0x30')](_0x2cd1ae[_0x1030('0x26')][_0x1030('0x30')]);_0x3f029c['where']=qs[_0x1030('0x28')](_[_0x1030('0x31')](_0x2cd1ae['query'],_0x1ef0a8[_0x1030('0x28')]));if(_0x2cd1ae[_0x1030('0x26')][_0x1030('0x32')]){_0x3f029c[_0x1030('0x33')]=_[_0x1030('0x34')](_0x3f029c[_0x1030('0x33')],{'$or':_['map'](_0x37dae1,function(_0x1c2dd6){if(_0x1c2dd6[_0x1030('0x35')][_0x1030('0x36')]!==_0x1030('0x37')){var _0xdf4d5={};_0xdf4d5[_0x1c2dd6[_0x1030('0x38')]]={'$like':'%'+_0x2cd1ae['query'][_0x1030('0x32')]+'%'};return _0xdf4d5;}})});}_0x3f029c=_[_0x1030('0x34')]({},_0x3f029c,_0x2cd1ae[_0x1030('0x39')]);var _0x150d14={'where':_0x3f029c[_0x1030('0x33')]};return db[_0x1030('0x23')][_0x1030('0x3a')](_0x150d14)['then'](function(_0x2f71b5){_0x300808['count']=_0x2f71b5;if(_0x2cd1ae[_0x1030('0x26')][_0x1030('0x3b')]){_0x3f029c[_0x1030('0x3c')]=[{'all':!![]}];}return db[_0x1030('0x23')]['findAll'](_0x3f029c);})[_0x1030('0x1d')](function(_0x39ecb1){_0x300808[_0x1030('0x3d')]=_0x39ecb1;return _0x300808;})[_0x1030('0x1d')](respondWithFilteredResult(_0x4e6126,_0x3f029c))[_0x1030('0x3e')](handleError(_0x4e6126,null));};exports[_0x1030('0x3f')]=function(_0x435573,_0x417cf1){var _0x573be0={'raw':![],'where':{'id':_0x435573[_0x1030('0x40')]['id']}},_0x4a30ae={};_0x4a30ae[_0x1030('0x25')]=_[_0x1030('0x27')](db[_0x1030('0x23')][_0x1030('0x24')]);_0x4a30ae['query']=_['keys'](_0x435573[_0x1030('0x26')]);_0x4a30ae[_0x1030('0x28')]=_[_0x1030('0x29')](_0x4a30ae['model'],_0x4a30ae[_0x1030('0x26')]);_0x573be0[_0x1030('0x2a')]=_[_0x1030('0x29')](_0x4a30ae['model'],qs['fields'](_0x435573[_0x1030('0x26')][_0x1030('0x2b')]));_0x573be0[_0x1030('0x2a')]=_0x573be0[_0x1030('0x2a')]['length']?_0x573be0['attributes']:_0x4a30ae[_0x1030('0x25')];if(_0x435573[_0x1030('0x26')][_0x1030('0x3b')]){_0x573be0['include']=[{'all':!![]}];}_0x573be0=_['merge']({},_0x573be0,_0x435573[_0x1030('0x39')]);return db[_0x1030('0x23')][_0x1030('0x41')](_0x573be0)['then'](handleEntityNotFound(_0x417cf1,null))[_0x1030('0x1d')](respondWithResult(_0x417cf1,null))['catch'](handleError(_0x417cf1,null));};exports[_0x1030('0x42')]=function(_0xd6a0f8,_0x9b5773){return db['Automation'][_0x1030('0x42')](_0xd6a0f8['body'],{})[_0x1030('0x1d')](respondWithResult(_0x9b5773,0xc9))['catch'](handleError(_0x9b5773,null));};exports[_0x1030('0x1c')]=function(_0x4f8aed,_0x18e758){if(_0x4f8aed[_0x1030('0x43')]['id']){delete _0x4f8aed['body']['id'];}return db[_0x1030('0x23')][_0x1030('0x41')]({'where':{'id':_0x4f8aed[_0x1030('0x40')]['id']}})[_0x1030('0x1d')](handleEntityNotFound(_0x18e758,null))[_0x1030('0x1d')](saveUpdates(_0x4f8aed['body'],null))[_0x1030('0x1d')](respondWithResult(_0x18e758,null))[_0x1030('0x3e')](handleError(_0x18e758,null));};exports[_0x1030('0x44')]=function(_0x40d635,_0x1ee8d2){return db[_0x1030('0x23')][_0x1030('0x41')]({'where':{'id':_0x40d635['params']['id']}})[_0x1030('0x1d')](handleEntityNotFound(_0x1ee8d2,null))[_0x1030('0x1d')](removeEntity(_0x1ee8d2,null))[_0x1030('0x3e')](handleError(_0x1ee8d2,null));};exports[_0x1030('0x45')]=function(_0x5bf196,_0x5cd2a4,_0x120a42){return db[_0x1030('0x46')][_0x1030('0x41')]({'where':{'id':_0x5bf196[_0x1030('0x40')]['id']}})['then'](handleEntityNotFound(_0x5cd2a4,null))[_0x1030('0x1d')](function(_0x539bd6){if(_0x539bd6){return _0x539bd6[_0x1030('0x45')](_0x5bf196[_0x1030('0x43')][_0x1030('0x47')],_[_0x1030('0x48')](_0x5bf196[_0x1030('0x43')],[_0x1030('0x47'),'id'])||{});}})[_0x1030('0x1d')](respondWithResult(_0x5cd2a4,null))[_0x1030('0x3e')](handleError(_0x5cd2a4,null));};exports['getConditions']=function(_0x37bc72,_0x3d4984,_0x154649){var _0x44cea6={};var _0x11e883={};var _0x562677;var _0x3891ef;return db[_0x1030('0x23')][_0x1030('0x49')]({'where':{'id':_0x37bc72['params']['id']}})['then'](handleEntityNotFound(_0x3d4984,null))[_0x1030('0x1d')](function(_0x84c7e6){if(_0x84c7e6){_0x562677=_0x84c7e6;_0x11e883['model']=_['keys'](db[_0x1030('0x46')][_0x1030('0x24')]);_0x11e883[_0x1030('0x26')]=_[_0x1030('0x27')](_0x37bc72['query']);_0x11e883['filters']=_[_0x1030('0x29')](_0x11e883['model'],_0x11e883['query']);_0x44cea6[_0x1030('0x2a')]=_[_0x1030('0x29')](_0x11e883[_0x1030('0x25')],qs[_0x1030('0x2b')](_0x37bc72[_0x1030('0x26')][_0x1030('0x2b')]));_0x44cea6['attributes']=_0x44cea6[_0x1030('0x2a')][_0x1030('0x2c')]?_0x44cea6[_0x1030('0x2a')]:_0x11e883[_0x1030('0x25')];_0x44cea6[_0x1030('0x4a')]=qs[_0x1030('0x30')](_0x37bc72[_0x1030('0x26')][_0x1030('0x30')]);_0x44cea6[_0x1030('0x33')]=qs['filters'](_[_0x1030('0x31')](_0x37bc72[_0x1030('0x26')],_0x11e883[_0x1030('0x28')]));if(_0x37bc72['query']['filter']){_0x44cea6[_0x1030('0x33')]=_['merge'](_0x44cea6[_0x1030('0x33')],{'$or':_[_0x1030('0x4b')](_0x44cea6[_0x1030('0x2a')],function(_0x5914f9){var _0x1bc452={};_0x1bc452[_0x5914f9]={'$like':'%'+_0x37bc72[_0x1030('0x26')][_0x1030('0x32')]+'%'};return _0x1bc452;})});}_0x44cea6=_['merge']({},_0x44cea6,_0x37bc72[_0x1030('0x39')]);return _0x562677[_0x1030('0x4c')](_0x44cea6);}})[_0x1030('0x1d')](function(_0x5ef941){if(_0x5ef941){_0x3891ef=_0x5ef941[_0x1030('0x2c')];if(!_0x37bc72[_0x1030('0x26')]['hasOwnProperty']('nolimit')){_0x44cea6[_0x1030('0x2f')]=qs[_0x1030('0x2f')](_0x37bc72[_0x1030('0x26')][_0x1030('0x2f')]);_0x44cea6[_0x1030('0x18')]=qs[_0x1030('0x18')](_0x37bc72[_0x1030('0x26')][_0x1030('0x18')]);}return _0x562677['getConditions'](_0x44cea6);}})['then'](function(_0x5b1c82){if(_0x5b1c82){return _0x5b1c82?{'count':_0x3891ef,'rows':_0x5b1c82}:null;}})[_0x1030('0x1d')](respondWithResult(_0x3d4984,null))['catch'](handleError(_0x3d4984,null));};exports[_0x1030('0x4d')]=function(_0x5513c9,_0x4cc042,_0x457ae6){return db[_0x1030('0x4e')][_0x1030('0x41')]({'where':{'id':_0x5513c9[_0x1030('0x40')]['id']}})[_0x1030('0x1d')](handleEntityNotFound(_0x4cc042,null))[_0x1030('0x1d')](function(_0x20ca61){if(_0x20ca61){return _0x20ca61[_0x1030('0x4d')](_0x5513c9[_0x1030('0x43')]['ids'],_[_0x1030('0x48')](_0x5513c9[_0x1030('0x43')],['ids','id'])||{});}})[_0x1030('0x1d')](respondWithResult(_0x4cc042,null))[_0x1030('0x3e')](handleError(_0x4cc042,null));};exports[_0x1030('0x4f')]=function(_0x3689cf,_0x287dc1,_0x3a3e22){var _0x5e2733={};var _0x45937c={};var _0x542b8f;var _0x2f64bd;return db[_0x1030('0x23')][_0x1030('0x49')]({'where':{'id':_0x3689cf[_0x1030('0x40')]['id']}})['then'](handleEntityNotFound(_0x287dc1,null))[_0x1030('0x1d')](function(_0x43263f){if(_0x43263f){_0x542b8f=_0x43263f;_0x45937c[_0x1030('0x25')]=_['keys'](db[_0x1030('0x4e')][_0x1030('0x24')]);_0x45937c[_0x1030('0x26')]=_[_0x1030('0x27')](_0x3689cf[_0x1030('0x26')]);_0x45937c['filters']=_['intersection'](_0x45937c[_0x1030('0x25')],_0x45937c['query']);_0x5e2733['attributes']=_[_0x1030('0x29')](_0x45937c['model'],qs[_0x1030('0x2b')](_0x3689cf['query'][_0x1030('0x2b')]));_0x5e2733[_0x1030('0x2a')]=_0x5e2733[_0x1030('0x2a')][_0x1030('0x2c')]?_0x5e2733['attributes']:_0x45937c[_0x1030('0x25')];_0x5e2733[_0x1030('0x4a')]=qs[_0x1030('0x30')](_0x3689cf['query'][_0x1030('0x30')]);_0x5e2733['where']=qs[_0x1030('0x28')](_[_0x1030('0x31')](_0x3689cf[_0x1030('0x26')],_0x45937c['filters']));if(_0x3689cf[_0x1030('0x26')][_0x1030('0x32')]){_0x5e2733[_0x1030('0x33')]=_[_0x1030('0x34')](_0x5e2733[_0x1030('0x33')],{'$or':_['map'](_0x5e2733['attributes'],function(_0x4a4ccc){var _0xa577f2={};_0xa577f2[_0x4a4ccc]={'$like':'%'+_0x3689cf['query'][_0x1030('0x32')]+'%'};return _0xa577f2;})});}_0x5e2733=_['merge']({},_0x5e2733,_0x3689cf[_0x1030('0x39')]);return _0x542b8f['getActions'](_0x5e2733);}})[_0x1030('0x1d')](function(_0x466808){if(_0x466808){_0x2f64bd=_0x466808[_0x1030('0x2c')];if(!_0x3689cf[_0x1030('0x26')][_0x1030('0x2d')]('nolimit')){_0x5e2733[_0x1030('0x2f')]=qs['limit'](_0x3689cf[_0x1030('0x26')][_0x1030('0x2f')]);_0x5e2733['offset']=qs['offset'](_0x3689cf[_0x1030('0x26')]['offset']);}return _0x542b8f[_0x1030('0x4f')](_0x5e2733);}})['then'](function(_0x421dcd){if(_0x421dcd){return _0x421dcd?{'count':_0x2f64bd,'rows':_0x421dcd}:null;}})[_0x1030('0x1d')](respondWithResult(_0x287dc1,null))[_0x1030('0x3e')](handleError(_0x287dc1,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 5a37d02..55c9929 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 _0xed8d=['bluebird','request-promise','rimraf','./automation.attributes','Automation','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0x3bcd5d,_0x8ae30c){var _0x4c7d6d=function(_0x25fe5d){while(--_0x25fe5d){_0x3bcd5d['push'](_0x3bcd5d['shift']());}};_0x4c7d6d(++_0x8ae30c);}(_0xed8d,0xed));var _0xded8=function(_0x329986,_0x53547d){_0x329986=_0x329986-0x0;var _0x23bda6=_0xed8d[_0x329986];return _0x23bda6;};'use strict';var _=require(_0xded8('0x0'));var util=require(_0xded8('0x1'));var logger=require(_0xded8('0x2'))(_0xded8('0x3'));var moment=require(_0xded8('0x4'));var BPromise=require(_0xded8('0x5'));var rp=require(_0xded8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xded8('0x7'));var config=require('../../config/environment');var attributes=require(_0xded8('0x8'));module['exports']=function(_0x78c662,_0x2d1345){return _0x78c662['define'](_0xded8('0x9'),attributes,{'tableName':_0xded8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd880=['exports','Automation','tools_automations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./automation.attributes'];(function(_0x547b52,_0x5872e1){var _0x2ce8d0=function(_0x225584){while(--_0x225584){_0x547b52['push'](_0x547b52['shift']());}};_0x2ce8d0(++_0x5872e1);}(_0xd880,0xb7));var _0x0d88=function(_0x3f1cbb,_0x36200f){_0x3f1cbb=_0x3f1cbb-0x0;var _0x589317=_0xd880[_0x3f1cbb];return _0x589317;};'use strict';var _=require(_0x0d88('0x0'));var util=require(_0x0d88('0x1'));var logger=require(_0x0d88('0x2'))('api');var moment=require(_0x0d88('0x3'));var BPromise=require(_0x0d88('0x4'));var rp=require(_0x0d88('0x5'));var fs=require('fs');var path=require(_0x0d88('0x6'));var rimraf=require(_0x0d88('0x7'));var config=require('../../config/environment');var attributes=require(_0x0d88('0x8'));module[_0x0d88('0x9')]=function(_0x35f1b5,_0x1d46c2){return _0x35f1b5['define'](_0x0d88('0xa'),attributes,{'tableName':_0x0d88('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 83110b4..a4c96eb 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 _0x07e8=['moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x07e8,0x10f));var _0x807e=function(_0x54cf4b,_0x4c56c3){_0x54cf4b=_0x54cf4b-0x0;var _0x41be1d=_0x07e8[_0x54cf4b];return _0x41be1d;};'use strict';var _=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var moment=require(_0x807e('0x2'));var BPromise=require('bluebird');var rs=require(_0x807e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x807e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x807e('0x5'));var config=require(_0x807e('0x6'));var jayson=require(_0x807e('0x7'));var client=jayson['client'][_0x807e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa12efd,_0x30766c,_0x178efb){return new BPromise(function(_0x1845b3,_0x54e3cb){return client[_0x807e('0x9')](_0xa12efd,_0x178efb)[_0x807e('0xa')](function(_0x400374){logger[_0x807e('0xb')](_0x807e('0xc'),_0x30766c,_0x807e('0xd'));logger[_0x807e('0xe')](_0x807e('0xf'),_0x30766c,_0x807e('0xd'),JSON[_0x807e('0x10')](_0x400374));if(_0x400374[_0x807e('0x11')]){if(_0x400374[_0x807e('0x11')][_0x807e('0x12')]===0x1f4){logger[_0x807e('0x11')]('Automation,\x20%s,\x20%s',_0x30766c,_0x400374[_0x807e('0x11')][_0x807e('0x13')]);return _0x54e3cb(_0x400374[_0x807e('0x11')][_0x807e('0x13')]);}logger[_0x807e('0x11')](_0x807e('0xc'),_0x30766c,_0x400374[_0x807e('0x11')]['message']);return _0x1845b3(_0x400374['error'][_0x807e('0x13')]);}else{logger[_0x807e('0xb')](_0x807e('0xc'),_0x30766c,_0x807e('0xd'));_0x1845b3(_0x400374['result'][_0x807e('0x13')]);}})[_0x807e('0x14')](function(_0x1ffc81){logger[_0x807e('0x11')](_0x807e('0xc'),_0x30766c,_0x1ffc81);_0x54e3cb(_0x1ffc81);});});}
\ No newline at end of file
+var _0x352b=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x4bb48,_0x42f646){var _0x2fa245=function(_0x153eb5){while(--_0x153eb5){_0x4bb48['push'](_0x4bb48['shift']());}};_0x2fa245(++_0x42f646);}(_0x352b,0x1c8));var _0xb352=function(_0x21e161,_0x17d066){_0x21e161=_0x21e161-0x0;var _0x133a20=_0x352b[_0x21e161];return _0x133a20;};'use strict';var _=require(_0xb352('0x0'));var util=require(_0xb352('0x1'));var moment=require('moment');var BPromise=require(_0xb352('0x2'));var rs=require(_0xb352('0x3'));var fs=require('fs');var Redis=require(_0xb352('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb352('0x5'))(_0xb352('0x6'));var config=require(_0xb352('0x7'));var jayson=require(_0xb352('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41258e,_0x5eca7f,_0x2d70d9){return new BPromise(function(_0x4e09cd,_0x5992c4){return client[_0xb352('0x9')](_0x41258e,_0x2d70d9)['then'](function(_0x49d21f){logger['info']('Automation,\x20%s,\x20%s',_0x5eca7f,'request\x20sent');logger[_0xb352('0xa')](_0xb352('0xb'),_0x5eca7f,_0xb352('0xc'),JSON[_0xb352('0xd')](_0x49d21f));if(_0x49d21f[_0xb352('0xe')]){if(_0x49d21f[_0xb352('0xe')][_0xb352('0xf')]===0x1f4){logger[_0xb352('0xe')](_0xb352('0x10'),_0x5eca7f,_0x49d21f['error'][_0xb352('0x11')]);return _0x5992c4(_0x49d21f[_0xb352('0xe')]['message']);}logger[_0xb352('0xe')]('Automation,\x20%s,\x20%s',_0x5eca7f,_0x49d21f['error'][_0xb352('0x11')]);return _0x4e09cd(_0x49d21f[_0xb352('0xe')][_0xb352('0x11')]);}else{logger['info'](_0xb352('0x10'),_0x5eca7f,_0xb352('0xc'));_0x4e09cd(_0x49d21f[_0xb352('0x12')]['message']);}})[_0xb352('0x13')](function(_0x5693cb){logger[_0xb352('0xe')]('Automation,\x20%s,\x20%s',_0x5eca7f,_0x5693cb);_0x5992c4(_0x5693cb);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 816626f..b42486f 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 _0x52f1=['isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x52f1,0x175));var _0x152f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x52f1[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x152f('0x0'));var util=require(_0x152f('0x1'));var path=require(_0x152f('0x2'));var timeout=require(_0x152f('0x3'));var express=require(_0x152f('0x4'));var router=express['Router']();var auth=require(_0x152f('0x5'));var interaction=require(_0x152f('0x6'));var config=require(_0x152f('0x7'));var controller=require(_0x152f('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x152f('0x9')](_0x152f('0xa'),auth[_0x152f('0xb')](),controller[_0x152f('0xc')]);router[_0x152f('0x9')]('/:id/conditions',auth[_0x152f('0xb')](),controller[_0x152f('0xd')]);router[_0x152f('0x9')](_0x152f('0xe'),auth[_0x152f('0xb')](),controller[_0x152f('0xf')]);router[_0x152f('0x10')]('/',auth['isAuthenticated'](),controller[_0x152f('0x11')]);router[_0x152f('0x10')](_0x152f('0x12'),auth[_0x152f('0xb')](),controller[_0x152f('0x13')]);router[_0x152f('0x10')](_0x152f('0xe'),auth[_0x152f('0xb')](),controller[_0x152f('0x14')]);router['put']('/:id',auth[_0x152f('0xb')](),controller[_0x152f('0x15')]);router['delete'](_0x152f('0xa'),auth[_0x152f('0xb')](),controller[_0x152f('0x16')]);module[_0x152f('0x17')]=router;
\ No newline at end of file
+var _0x6149=['addConditions','addActions','put','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','get','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x31d98a,_0x292465){var _0x56e10e=function(_0x54a82f){while(--_0x54a82f){_0x31d98a['push'](_0x31d98a['shift']());}};_0x56e10e(++_0x292465);}(_0x6149,0xc2));var _0x9614=function(_0xa5fdf4,_0x553bc8){_0xa5fdf4=_0xa5fdf4-0x0;var _0x45a73d=_0x6149[_0xa5fdf4];return _0x45a73d;};'use strict';var multer=require(_0x9614('0x0'));var util=require(_0x9614('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9614('0x2'));var router=express[_0x9614('0x3')]();var auth=require(_0x9614('0x4'));var interaction=require(_0x9614('0x5'));var config=require(_0x9614('0x6'));var controller=require('./automation.controller');router['get']('/',auth[_0x9614('0x7')](),controller['index']);router['get'](_0x9614('0x8'),auth[_0x9614('0x7')](),controller['show']);router[_0x9614('0x9')](_0x9614('0xa'),auth[_0x9614('0x7')](),controller[_0x9614('0xb')]);router['get'](_0x9614('0xc'),auth[_0x9614('0x7')](),controller[_0x9614('0xd')]);router[_0x9614('0xe')]('/',auth[_0x9614('0x7')](),controller['create']);router[_0x9614('0xe')](_0x9614('0xa'),auth[_0x9614('0x7')](),controller[_0x9614('0xf')]);router[_0x9614('0xe')](_0x9614('0xc'),auth[_0x9614('0x7')](),controller[_0x9614('0x10')]);router[_0x9614('0x11')](_0x9614('0x8'),auth[_0x9614('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9614('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 0a802c4..b1d354e 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 _0x987f=['STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports'];(function(_0xd54ede,_0x46aec5){var _0x2d6ae3=function(_0x407f68){while(--_0x407f68){_0xd54ede['push'](_0xd54ede['shift']());}};_0x2d6ae3(++_0x46aec5);}(_0x987f,0xbe));var _0xf987=function(_0x141310,_0x4fb243){_0x141310=_0x141310-0x0;var _0x4680ae=_0x987f[_0x141310];return _0x4680ae;};'use strict';var Sequelize=require(_0xf987('0x0'));module[_0xf987('0x1')]={'name':{'type':Sequelize[_0xf987('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf987('0x3')](_0xf987('0x4')),'allowNull':![],'defaultValue':_0xf987('0x4')},'description':{'type':Sequelize[_0xf987('0x2')]},'active':{'type':Sequelize[_0xf987('0x5')],'defaultValue':0x0,'comment':_0xf987('0x6')},'limitCalls':{'type':Sequelize[_0xf987('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf987('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf987('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xf987('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xf987('0x7')](0x3)[_0xf987('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf987('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf987('0x7')](0x5)[_0xf987('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf987('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xf987('0x7')](0x3)[_0xf987('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf987('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf987('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf987('0x7')](0x3)[_0xf987('0x9')],'defaultValue':0x3,'comment':_0xf987('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf987('0x7')](0x5)[_0xf987('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf987('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf987('0xf')},'dialTimezone':{'type':Sequelize[_0xf987('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf987('0x2')],'defaultValue':_0xf987('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xf987('0x3')](_0xf987('0x11'),_0xf987('0x12'),_0xf987('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xf987('0x5')],'defaultValue':0x0,'comment':_0xf987('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf987('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xf987('0x7')](0x9)[_0xf987('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf987('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf987('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf987('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf987('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xf987('0x7')](0x9)[_0xf987('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf987('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf987('0x7')](0x9)[_0xf987('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf987('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf987('0x7')](0x9)[_0xf987('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf987('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf987('0x7')](0x5)[_0xf987('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf987('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf987('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf987('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xf987('0x1d'),'ASC'),'defaultValue':_0xf987('0x1d')},'dialPrefix':{'type':Sequelize[_0xf987('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf987('0x7')](0x3)[_0xf987('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf987('0x1e')},'dialCutDigit':{'type':Sequelize[_0xf987('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf987('0x1f')}};
\ No newline at end of file
+var _0xbd73=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','onlyIfOpen','always','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\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3a3ffa,_0x418c47){var _0x514724=function(_0x11aed5){while(--_0x11aed5){_0x3a3ffa['push'](_0x3a3ffa['shift']());}};_0x514724(++_0x418c47);}(_0xbd73,0x95));var _0x3bd7=function(_0x26535c,_0x341e20){_0x26535c=_0x26535c-0x0;var _0x8e2d52=_0xbd73[_0x26535c];return _0x8e2d52;};'use strict';var Sequelize=require(_0x3bd7('0x0'));module[_0x3bd7('0x1')]={'name':{'type':Sequelize[_0x3bd7('0x2')],'unique':_0x3bd7('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x3bd7('0x4')](_0x3bd7('0x5')),'allowNull':![],'defaultValue':_0x3bd7('0x5')},'description':{'type':Sequelize[_0x3bd7('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3bd7('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3bd7('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3bd7('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3bd7('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3bd7('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3bd7('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3bd7('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3bd7('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3bd7('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3bd7('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x3bd7('0xa')](0x3)[_0x3bd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3bd7('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3bd7('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3bd7('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3bd7('0xa')](0x3)[_0x3bd7('0x8')],'defaultValue':0x3,'comment':_0x3bd7('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3bd7('0xa')](0x5)[_0x3bd7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3bd7('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3bd7('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3bd7('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3bd7('0x2')],'defaultValue':_0x3bd7('0x11')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x3bd7('0x12')),'defaultValue':_0x3bd7('0x13')},'dialAMDActive':{'type':Sequelize[_0x3bd7('0x14')],'defaultValue':0x0,'comment':_0x3bd7('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x3bd7('0xa')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3bd7('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x3bd7('0xa')](0x9)[_0x3bd7('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3bd7('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3bd7('0xa')](0x9)[_0x3bd7('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3bd7('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3bd7('0xa')](0x9)[_0x3bd7('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3bd7('0x19')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3bd7('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3bd7('0xa')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3bd7('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3bd7('0xa')](0x9)[_0x3bd7('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3bd7('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3bd7('0xa')](0x5)[_0x3bd7('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3bd7('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3bd7('0x4')]('DESC','ASC'),'defaultValue':_0x3bd7('0x1e')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x3bd7('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3bd7('0x1f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x3bd7('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3bd7('0x20')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index dfd0f75..8167126 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 _0x6584=['lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','reject','save','then','destroy','get','IvrCampaigns','error','stack','name','index','Campaign','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','options','count','includeAll','include','findAll','show','params','keys','find','catch','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','getHoppers','CampaignId','map','CmHopper','rows','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','toString','NOW()','from','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','cm_contacts','COALESCE(phone,\x27\x27)','fromQuery','ListId\x20=\x20?','push','sequelize','removeLists','ids','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs'];(function(_0x219e9b,_0x295d91){var _0x332e80=function(_0x567792){while(--_0x567792){_0x219e9b['push'](_0x219e9b['shift']());}};_0x332e80(++_0x295d91);}(_0x6584,0x175));var _0x4658=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x6584[_0x15bc81];return _0x59440e;};'use strict';var pdf=require(_0x4658('0x0'));var emlformat=require(_0x4658('0x1'));var rimraf=require(_0x4658('0x2'));var zipdir=require(_0x4658('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4658('0x4'));var moment=require(_0x4658('0x5'));var BPromise=require(_0x4658('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4658('0x7'));var sox=require(_0x4658('0x8'));var csv=require(_0x4658('0x9'));var ejs=require(_0x4658('0xa'));var fs=require('fs');var _=require(_0x4658('0xb'));var squel=require('squel');var crypto=require(_0x4658('0xc'));var jsforce=require(_0x4658('0xd'));var deskjs=require(_0x4658('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4658('0xf'));var Papa=require(_0x4658('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4658('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4658('0x12'))('api');var utils=require(_0x4658('0x13'));var config=require('../../config/environment');var db=require(_0x4658('0x14'))['db'];function respondWithStatusCode(_0x511c40,_0x29a06a){_0x29a06a=_0x29a06a||0xcc;return function(_0x243444){if(_0x243444){return _0x511c40[_0x4658('0x15')](_0x29a06a);}return _0x511c40[_0x4658('0x16')](_0x29a06a)[_0x4658('0x17')]();};}function respondWithResult(_0x41f611,_0x4cbafd){_0x4cbafd=_0x4cbafd||0xc8;return function(_0x4d3821){if(_0x4d3821){return _0x41f611[_0x4658('0x16')](_0x4cbafd)['json'](_0x4d3821);}};}function respondWithFilteredResult(_0x2a7ed1,_0x4ef78b){return function(_0x10c558){if(_0x10c558){var _0x2702b6=_0x10c558['count'],_0x4a506c=_0x4ef78b['offset'],_0x27aede=_0x4ef78b[_0x4658('0x18')]+_0x4ef78b['limit'],_0x56358b;if(_0x27aede>=_0x2702b6){_0x27aede=_0x2702b6;_0x56358b=0xc8;}else{_0x56358b=0xce;}_0x2a7ed1[_0x4658('0x16')](_0x56358b);return _0x2a7ed1[_0x4658('0x19')](_0x4658('0x1a'),_0x4a506c+'-'+_0x27aede+'/'+_0x2702b6)[_0x4658('0x1b')](_0x10c558);}return null;};}function patchUpdates(_0xeabb47){return function(_0x30bf0d){try{jsonpatch['apply'](_0x30bf0d,_0xeabb47,!![]);}catch(_0x5b4c93){return BPromise[_0x4658('0x1c')](_0x5b4c93);}return _0x30bf0d[_0x4658('0x1d')]();};}function saveUpdates(_0xb5b83e,_0x18581f){return function(_0x2e926f){if(_0x2e926f){return _0x2e926f['update'](_0xb5b83e)[_0x4658('0x1e')](function(_0x29a18f){return _0x29a18f;});}return null;};}function removeEntity(_0x2f623f,_0x56bfb1){return function(_0x2eb16d){if(_0x2eb16d){return _0x2eb16d[_0x4658('0x1f')]()[_0x4658('0x1e')](function(){var _0x3d8d65=_0x2eb16d[_0x4658('0x20')]({'plain':!![]});var _0x44f09a=_0x4658('0x21');return db['UserProfileResource'][_0x4658('0x1f')]({'where':{'type':_0x44f09a,'resourceId':_0x3d8d65['id']}})['then'](function(){return _0x2eb16d;});})[_0x4658('0x1e')](function(){_0x2f623f[_0x4658('0x16')](0xcc)[_0x4658('0x17')]();});}};}function handleEntityNotFound(_0x25ccb,_0x2f2f7a){return function(_0x58f99a){if(!_0x58f99a){_0x25ccb[_0x4658('0x15')](0x194);}return _0x58f99a;};}function handleError(_0x20586c,_0x36a9b7){_0x36a9b7=_0x36a9b7||0x1f4;return function(_0x39f885){logger[_0x4658('0x22')](_0x39f885[_0x4658('0x23')]);if(_0x39f885[_0x4658('0x24')]){delete _0x39f885[_0x4658('0x24')];}_0x20586c[_0x4658('0x16')](_0x36a9b7)['send'](_0x39f885);};}exports[_0x4658('0x25')]=function(_0x274edd,_0x36eaaa){var _0xb97c92={},_0x5dfa9c={},_0xb2a131={'count':0x0,'rows':[]};var _0x434e3f=db[_0x4658('0x26')][_0x4658('0x27')];_0x5dfa9c[_0x4658('0x28')]=_['keys'](_0x434e3f);_0x5dfa9c[_0x4658('0x29')]=_['keys'](_0x274edd[_0x4658('0x29')]);_0x5dfa9c[_0x4658('0x2a')]=_[_0x4658('0x2b')](_0x5dfa9c['model'],_0x5dfa9c[_0x4658('0x29')]);_0xb97c92[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0x5dfa9c[_0x4658('0x28')],qs[_0x4658('0x2d')](_0x274edd[_0x4658('0x29')]['fields']));_0xb97c92[_0x4658('0x2c')]=_0xb97c92[_0x4658('0x2c')][_0x4658('0x2e')]?_0xb97c92[_0x4658('0x2c')]:_0x5dfa9c['model'];if(!_0x274edd[_0x4658('0x29')][_0x4658('0x2f')](_0x4658('0x30'))){_0xb97c92['limit']=qs['limit'](_0x274edd[_0x4658('0x29')][_0x4658('0x31')]);_0xb97c92[_0x4658('0x18')]=qs['offset'](_0x274edd[_0x4658('0x29')][_0x4658('0x18')]);}_0xb97c92[_0x4658('0x32')]=qs['sort'](_0x274edd[_0x4658('0x29')][_0x4658('0x33')]);_0xb97c92[_0x4658('0x34')]=qs[_0x4658('0x2a')](_[_0x4658('0x35')](_0x274edd[_0x4658('0x29')],_0x5dfa9c[_0x4658('0x2a')]));if(_0x274edd[_0x4658('0x29')][_0x4658('0x36')]){_0xb97c92[_0x4658('0x34')]=_[_0x4658('0x37')](_0xb97c92[_0x4658('0x34')],{'$or':_['map'](_0x434e3f,function(_0x3ae10d){if(_0x3ae10d[_0x4658('0x38')][_0x4658('0x39')]!=='VIRTUAL'){var _0x3b6177={};_0x3b6177[_0x3ae10d['field']]={'$like':'%'+_0x274edd[_0x4658('0x29')][_0x4658('0x36')]+'%'};return _0x3b6177;}})});}_0xb97c92=_['merge']({},_0xb97c92,_0x274edd[_0x4658('0x3a')]);var _0x2b350a={'where':_0xb97c92[_0x4658('0x34')]};return db[_0x4658('0x26')][_0x4658('0x3b')](_0x2b350a)['then'](function(_0x169602){_0xb2a131['count']=_0x169602;if(_0x274edd[_0x4658('0x29')][_0x4658('0x3c')]){_0xb97c92[_0x4658('0x3d')]=[{'all':!![]}];}return db[_0x4658('0x26')][_0x4658('0x3e')](_0xb97c92);})['then'](function(_0x6ab52d){_0xb2a131['rows']=_0x6ab52d;return _0xb2a131;})[_0x4658('0x1e')](respondWithFilteredResult(_0x36eaaa,_0xb97c92))['catch'](handleError(_0x36eaaa,null));};exports[_0x4658('0x3f')]=function(_0x716f9d,_0x3d2698){var _0x47011a={'raw':![],'where':{'id':_0x716f9d[_0x4658('0x40')]['id']}},_0x1eca32={};_0x1eca32[_0x4658('0x28')]=_['keys'](db[_0x4658('0x26')]['rawAttributes']);_0x1eca32[_0x4658('0x29')]=_[_0x4658('0x41')](_0x716f9d[_0x4658('0x29')]);_0x1eca32['filters']=_[_0x4658('0x2b')](_0x1eca32['model'],_0x1eca32['query']);_0x47011a[_0x4658('0x2c')]=_['intersection'](_0x1eca32[_0x4658('0x28')],qs['fields'](_0x716f9d[_0x4658('0x29')]['fields']));_0x47011a[_0x4658('0x2c')]=_0x47011a[_0x4658('0x2c')]['length']?_0x47011a[_0x4658('0x2c')]:_0x1eca32[_0x4658('0x28')];if(_0x716f9d['query'][_0x4658('0x3c')]){_0x47011a[_0x4658('0x3d')]=[{'all':!![]}];}_0x47011a=_['merge']({},_0x47011a,_0x716f9d[_0x4658('0x3a')]);return db[_0x4658('0x26')][_0x4658('0x42')](_0x47011a)[_0x4658('0x1e')](handleEntityNotFound(_0x3d2698,null))[_0x4658('0x1e')](respondWithResult(_0x3d2698,null))[_0x4658('0x43')](handleError(_0x3d2698,null));};exports[_0x4658('0x44')]=function(_0x474696,_0x1a0d3b){return db[_0x4658('0x26')][_0x4658('0x44')](_0x474696[_0x4658('0x45')],{})[_0x4658('0x1e')](function(_0x5b2156){var _0xe1deda=_0x474696['user']['get']({'plain':!![]});if(!_0xe1deda)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe1deda['role']===_0x4658('0x46')){var _0x3bc7e0=_0x5b2156[_0x4658('0x20')]({'plain':!![]});var _0x33fd80=_0x4658('0x21');return db['UserProfileSection'][_0x4658('0x42')]({'where':{'name':_0x33fd80,'userProfileId':_0xe1deda[_0x4658('0x47')]},'raw':!![]})['then'](function(_0x2a516d){if(_0x2a516d&&_0x2a516d[_0x4658('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x3bc7e0['name'],'resourceId':_0x3bc7e0['id'],'type':_0x2a516d[_0x4658('0x24')],'sectionId':_0x2a516d['id']},{})[_0x4658('0x1e')](function(){return _0x5b2156;});}else{return _0x5b2156;}})[_0x4658('0x43')](function(_0x3f2f06){logger[_0x4658('0x22')](_0x4658('0x49'),_0x3f2f06);throw _0x3f2f06;});}return _0x5b2156;})['then'](respondWithResult(_0x1a0d3b,0xc9))[_0x4658('0x43')](handleError(_0x1a0d3b,null));};exports[_0x4658('0x4a')]=function(_0x2559f9,_0x3dd15d){var _0x2b2fca={'raw':![],'where':{'id':_0x2559f9['params']['id']}},_0x2f527f={};_0x2f527f[_0x4658('0x28')]=_[_0x4658('0x41')](db[_0x4658('0x26')][_0x4658('0x27')]);_0x2b2fca[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0x2f527f[_0x4658('0x28')],qs[_0x4658('0x2d')](_0x2559f9[_0x4658('0x29')][_0x4658('0x2d')]));_0x2b2fca['attributes']=_0x2b2fca[_0x4658('0x2c')][_0x4658('0x2e')]?_0x2b2fca['attributes']:_0x2f527f[_0x4658('0x28')];if(_0x2559f9[_0x4658('0x29')][_0x4658('0x3c')]){_0x2b2fca[_0x4658('0x3d')]=[{'all':!![]}];}_0x2b2fca=_[_0x4658('0x37')]({},_0x2b2fca,_0x2559f9[_0x4658('0x3a')]);return db['Campaign'][_0x4658('0x42')](_0x2b2fca)['then'](handleEntityNotFound(_0x3dd15d,null))['then'](function(_0x7b9a9c){if(_0x7b9a9c){var _0x53bf5f=_0x7b9a9c['get']({'plain':!![]});_0x53bf5f=qs[_0x4658('0x4b')](_0x53bf5f,['id',_0x4658('0x4c'),_0x4658('0x4d')]);_0x2559f9['body']=_['omit'](_0x2559f9[_0x4658('0x45')],['id',_0x4658('0x4c'),_0x4658('0x4d')]);return db['Campaign'][_0x4658('0x44')](_[_0x4658('0x37')](_0x53bf5f,_0x2559f9['body']),{'include':_0x2559f9[_0x4658('0x29')][_0x4658('0x3c')]?[{'all':!![]}]:undefined})[_0x4658('0x1e')](function(_0x270b6b){var _0x351a25=_0x2559f9[_0x4658('0x46')][_0x4658('0x20')]({'plain':!![]});if(!_0x351a25)throw new Error(_0x4658('0x4e'));if(_0x351a25['role']===_0x4658('0x46')){var _0x369620=_0x270b6b[_0x4658('0x20')]({'plain':!![]});var _0x1fdfce=_0x4658('0x21');return db[_0x4658('0x4f')][_0x4658('0x42')]({'where':{'name':_0x1fdfce,'userProfileId':_0x351a25[_0x4658('0x47')]},'raw':!![]})[_0x4658('0x1e')](function(_0x4bbf50){if(_0x4bbf50&&_0x4bbf50[_0x4658('0x48')]===0x0){return db[_0x4658('0x50')][_0x4658('0x44')]({'name':_0x369620[_0x4658('0x24')],'resourceId':_0x369620['id'],'type':_0x4bbf50['name'],'sectionId':_0x4bbf50['id']},{})[_0x4658('0x1e')](function(){return _0x270b6b;});}else{return _0x270b6b;}})['catch'](function(_0x5b0a63){logger[_0x4658('0x22')](_0x4658('0x49'),_0x5b0a63);throw _0x5b0a63;});}return _0x270b6b;});}})['then'](respondWithResult(_0x3dd15d,0xc9))['catch'](handleError(_0x3dd15d,null));};exports['update']=function(_0x2148c5,_0x1ab4b4){if(_0x2148c5[_0x4658('0x45')]['id']){delete _0x2148c5['body']['id'];}return db[_0x4658('0x26')][_0x4658('0x42')]({'where':{'id':_0x2148c5['params']['id']}})['then'](handleEntityNotFound(_0x1ab4b4,null))['then'](saveUpdates(_0x2148c5[_0x4658('0x45')],null))[_0x4658('0x1e')](respondWithResult(_0x1ab4b4,null))[_0x4658('0x43')](handleError(_0x1ab4b4,null));};exports[_0x4658('0x1f')]=function(_0x145ac6,_0x3a93bc){return db['Campaign']['find']({'where':{'id':_0x145ac6[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x3a93bc,null))[_0x4658('0x1e')](removeEntity(_0x3a93bc,null))['catch'](handleError(_0x3a93bc,null));};exports[_0x4658('0x51')]=function(_0x56d6e9,_0x3dd17a,_0xf1c264){var _0x54c47b={'raw':!![],'where':{}};var _0x47ad80={};var _0x590b25={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x56d6e9[_0x4658('0x40')]['id']}})['then'](handleEntityNotFound(_0x3dd17a,null))[_0x4658('0x1e')](function(_0x238a07){if(_0x238a07){_0x47ad80['model']=_[_0x4658('0x41')](db['CmHopper']['rawAttributes']);_0x47ad80[_0x4658('0x29')]=_[_0x4658('0x41')](_0x56d6e9[_0x4658('0x29')]);_0x47ad80[_0x4658('0x2a')]=_[_0x4658('0x2b')](_0x47ad80[_0x4658('0x28')],_0x47ad80[_0x4658('0x29')]);_0x54c47b[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0x47ad80[_0x4658('0x28')],qs[_0x4658('0x2d')](_0x56d6e9[_0x4658('0x29')][_0x4658('0x2d')]));_0x54c47b[_0x4658('0x2c')]=_0x54c47b[_0x4658('0x2c')]['length']?_0x54c47b[_0x4658('0x2c')]:_0x47ad80[_0x4658('0x28')];if(!_0x56d6e9[_0x4658('0x29')][_0x4658('0x2f')](_0x4658('0x30'))){_0x54c47b['limit']=qs['limit'](_0x56d6e9[_0x4658('0x29')][_0x4658('0x31')]);_0x54c47b[_0x4658('0x18')]=qs[_0x4658('0x18')](_0x56d6e9[_0x4658('0x29')][_0x4658('0x18')]);}_0x54c47b['order']=qs['sort'](_0x56d6e9[_0x4658('0x29')][_0x4658('0x33')]);_0x54c47b[_0x4658('0x34')]=qs[_0x4658('0x2a')](_[_0x4658('0x35')](_0x56d6e9[_0x4658('0x29')],_0x47ad80['filters']));_0x54c47b[_0x4658('0x34')][_0x4658('0x52')]=_0x238a07['id'];if(_0x56d6e9[_0x4658('0x29')][_0x4658('0x36')]){_0x54c47b[_0x4658('0x34')]=_[_0x4658('0x37')](_0x54c47b[_0x4658('0x34')],{'$or':_[_0x4658('0x53')](_0x54c47b[_0x4658('0x2c')],function(_0x15d7f8){var _0x5071a1={};_0x5071a1[_0x15d7f8]={'$like':'%'+_0x56d6e9[_0x4658('0x29')][_0x4658('0x36')]+'%'};return _0x5071a1;})});}_0x54c47b=_[_0x4658('0x37')]({},_0x54c47b,_0x56d6e9['options']);return db[_0x4658('0x54')][_0x4658('0x3b')]({'where':_0x54c47b[_0x4658('0x34')]})[_0x4658('0x1e')](function(_0x5ce3bb){_0x590b25[_0x4658('0x3b')]=_0x5ce3bb;if(_0x56d6e9['query']['includeAll']){_0x54c47b[_0x4658('0x3d')]=[{'all':!![]}];}return db[_0x4658('0x54')]['findAll'](_0x54c47b);})['then'](function(_0x109871){_0x590b25[_0x4658('0x55')]=_0x109871;return _0x590b25;});}})[_0x4658('0x1e')](respondWithFilteredResult(_0x3dd17a,_0x54c47b))[_0x4658('0x43')](handleError(_0x3dd17a,null));};exports['getHopperHistories']=function(_0x448bd5,_0x14aecf,_0x30d46e){var _0x39ade1={'raw':!![],'where':{}};var _0xff4f5e={};var _0x26eea8={'count':0x0,'rows':[]};return db[_0x4658('0x26')]['findOne']({'where':{'id':_0x448bd5[_0x4658('0x40')]['id']}})['then'](handleEntityNotFound(_0x14aecf,null))['then'](function(_0x11a625){if(_0x11a625){_0xff4f5e['model']=_['keys'](db[_0x4658('0x56')][_0x4658('0x27')]);_0xff4f5e['query']=_[_0x4658('0x41')](_0x448bd5[_0x4658('0x29')]);_0xff4f5e[_0x4658('0x2a')]=_['intersection'](_0xff4f5e[_0x4658('0x28')],_0xff4f5e[_0x4658('0x29')]);_0x39ade1[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0xff4f5e['model'],qs['fields'](_0x448bd5[_0x4658('0x29')][_0x4658('0x2d')]));_0x39ade1[_0x4658('0x2c')]=_0x39ade1[_0x4658('0x2c')]['length']?_0x39ade1[_0x4658('0x2c')]:_0xff4f5e[_0x4658('0x28')];if(!_0x448bd5['query'][_0x4658('0x2f')](_0x4658('0x30'))){_0x39ade1[_0x4658('0x31')]=qs[_0x4658('0x31')](_0x448bd5[_0x4658('0x29')][_0x4658('0x31')]);_0x39ade1[_0x4658('0x18')]=qs[_0x4658('0x18')](_0x448bd5[_0x4658('0x29')][_0x4658('0x18')]);}_0x39ade1[_0x4658('0x32')]=qs['sort'](_0x448bd5[_0x4658('0x29')][_0x4658('0x33')]);_0x39ade1[_0x4658('0x34')]=qs[_0x4658('0x2a')](_['pick'](_0x448bd5[_0x4658('0x29')],_0xff4f5e['filters']));_0x39ade1[_0x4658('0x34')][_0x4658('0x52')]=_0x11a625['id'];if(_0x448bd5[_0x4658('0x29')][_0x4658('0x36')]){_0x39ade1[_0x4658('0x34')]=_[_0x4658('0x37')](_0x39ade1[_0x4658('0x34')],{'$or':_[_0x4658('0x53')](_0x39ade1['attributes'],function(_0x50f427){var _0x2e9716={};_0x2e9716[_0x50f427]={'$like':'%'+_0x448bd5['query']['filter']+'%'};return _0x2e9716;})});}_0x39ade1=_['merge']({},_0x39ade1,_0x448bd5[_0x4658('0x3a')]);return db[_0x4658('0x56')][_0x4658('0x3b')]({'where':_0x39ade1[_0x4658('0x34')]})[_0x4658('0x1e')](function(_0x3252b0){_0x26eea8[_0x4658('0x3b')]=_0x3252b0;if(_0x448bd5['query'][_0x4658('0x3c')]){_0x39ade1['include']=[{'all':!![]}];}return db[_0x4658('0x56')][_0x4658('0x3e')](_0x39ade1);})['then'](function(_0x295367){_0x26eea8['rows']=_0x295367;return _0x26eea8;});}})[_0x4658('0x1e')](respondWithFilteredResult(_0x14aecf,_0x39ade1))['catch'](handleError(_0x14aecf,null));};exports[_0x4658('0x57')]=function(_0x8d42ee,_0x12c5ac,_0x144eb4){var _0x16848d={'raw':!![],'where':{}};var _0xafb836={};var _0x5413e5={'count':0x0,'rows':[]};return db[_0x4658('0x26')][_0x4658('0x58')]({'where':{'id':_0x8d42ee[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x12c5ac,null))['then'](function(_0x732d3a){if(_0x732d3a){_0xafb836[_0x4658('0x28')]=_[_0x4658('0x41')](db[_0x4658('0x59')][_0x4658('0x27')]);_0xafb836[_0x4658('0x29')]=_['keys'](_0x8d42ee[_0x4658('0x29')]);_0xafb836[_0x4658('0x2a')]=_[_0x4658('0x2b')](_0xafb836[_0x4658('0x28')],_0xafb836[_0x4658('0x29')]);_0x16848d[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0xafb836['model'],qs[_0x4658('0x2d')](_0x8d42ee[_0x4658('0x29')]['fields']));_0x16848d[_0x4658('0x2c')]=_0x16848d[_0x4658('0x2c')][_0x4658('0x2e')]?_0x16848d[_0x4658('0x2c')]:_0xafb836[_0x4658('0x28')];if(!_0x8d42ee['query'][_0x4658('0x2f')](_0x4658('0x30'))){_0x16848d[_0x4658('0x31')]=qs[_0x4658('0x31')](_0x8d42ee['query']['limit']);_0x16848d[_0x4658('0x18')]=qs['offset'](_0x8d42ee[_0x4658('0x29')]['offset']);}_0x16848d[_0x4658('0x32')]=qs['sort'](_0x8d42ee[_0x4658('0x29')][_0x4658('0x33')]);_0x16848d[_0x4658('0x34')]=qs[_0x4658('0x2a')](_['pick'](_0x8d42ee[_0x4658('0x29')],_0xafb836[_0x4658('0x2a')]));_0x16848d[_0x4658('0x34')]['CampaignId']=_0x732d3a['id'];if(_0x8d42ee[_0x4658('0x29')][_0x4658('0x36')]){_0x16848d['where']=_[_0x4658('0x37')](_0x16848d[_0x4658('0x34')],{'$or':_[_0x4658('0x53')](_0x16848d['attributes'],function(_0x19b155){var _0x54b458={};_0x54b458[_0x19b155]={'$like':'%'+_0x8d42ee[_0x4658('0x29')][_0x4658('0x36')]+'%'};return _0x54b458;})});}_0x16848d=_[_0x4658('0x37')]({},_0x16848d,_0x8d42ee[_0x4658('0x3a')]);return db[_0x4658('0x59')]['count']({'where':_0x16848d[_0x4658('0x34')]})[_0x4658('0x1e')](function(_0x53f214){_0x5413e5['count']=_0x53f214;if(_0x8d42ee[_0x4658('0x29')][_0x4658('0x3c')]){_0x16848d[_0x4658('0x3d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x4658('0x3e')](_0x16848d);})[_0x4658('0x1e')](function(_0x518be2){_0x5413e5[_0x4658('0x55')]=_0x518be2;return _0x5413e5;});}})[_0x4658('0x1e')](respondWithFilteredResult(_0x12c5ac,_0x16848d))[_0x4658('0x43')](handleError(_0x12c5ac,null));};exports[_0x4658('0x5a')]=function(_0x33d6ea,_0x4bc89e,_0x442eb5){var _0x103129={'raw':!![],'where':{}};var _0x48e72c={};var _0x3cd969={'count':0x0,'rows':[]};return db[_0x4658('0x26')]['findOne']({'where':{'id':_0x33d6ea['params']['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x4bc89e,null))[_0x4658('0x1e')](function(_0x558f77){if(_0x558f77){_0x48e72c['model']=_[_0x4658('0x41')](db[_0x4658('0x5b')][_0x4658('0x27')]);_0x48e72c[_0x4658('0x29')]=_[_0x4658('0x41')](_0x33d6ea[_0x4658('0x29')]);_0x48e72c['filters']=_['intersection'](_0x48e72c[_0x4658('0x28')],_0x48e72c[_0x4658('0x29')]);_0x103129[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0x48e72c[_0x4658('0x28')],qs[_0x4658('0x2d')](_0x33d6ea[_0x4658('0x29')][_0x4658('0x2d')]));_0x103129[_0x4658('0x2c')]=_0x103129['attributes'][_0x4658('0x2e')]?_0x103129[_0x4658('0x2c')]:_0x48e72c['model'];if(!_0x33d6ea[_0x4658('0x29')][_0x4658('0x2f')]('nolimit')){_0x103129[_0x4658('0x31')]=qs[_0x4658('0x31')](_0x33d6ea['query'][_0x4658('0x31')]);_0x103129['offset']=qs['offset'](_0x33d6ea[_0x4658('0x29')]['offset']);}_0x103129[_0x4658('0x32')]=qs['sort'](_0x33d6ea[_0x4658('0x29')]['sort']);_0x103129[_0x4658('0x34')]=qs[_0x4658('0x2a')](_['pick'](_0x33d6ea[_0x4658('0x29')],_0x48e72c[_0x4658('0x2a')]));_0x103129['where'][_0x4658('0x52')]=_0x558f77['id'];if(_0x33d6ea['query']['filter']){_0x103129[_0x4658('0x34')]=_[_0x4658('0x37')](_0x103129['where'],{'$or':_['map'](_0x103129[_0x4658('0x2c')],function(_0x1a88ea){var _0x509e8c={};_0x509e8c[_0x1a88ea]={'$like':'%'+_0x33d6ea[_0x4658('0x29')]['filter']+'%'};return _0x509e8c;})});}_0x103129=_[_0x4658('0x37')]({},_0x103129,_0x33d6ea[_0x4658('0x3a')]);return db[_0x4658('0x5b')][_0x4658('0x3b')]({'where':_0x103129['where']})[_0x4658('0x1e')](function(_0x39ca44){_0x3cd969[_0x4658('0x3b')]=_0x39ca44;if(_0x33d6ea[_0x4658('0x29')]['includeAll']){_0x103129[_0x4658('0x3d')]=[{'all':!![]}];}return db[_0x4658('0x5b')][_0x4658('0x3e')](_0x103129);})[_0x4658('0x1e')](function(_0x2217e1){_0x3cd969[_0x4658('0x55')]=_0x2217e1;return _0x3cd969;});}})[_0x4658('0x1e')](respondWithFilteredResult(_0x4bc89e,_0x103129))[_0x4658('0x43')](handleError(_0x4bc89e,null));};exports['getLists']=function(_0xb681a5,_0x17f9b5,_0x2ff080){var _0x492044={};var _0x490689={};var _0x6fc227;var _0x17ee93;return db[_0x4658('0x26')][_0x4658('0x58')]({'where':{'id':_0xb681a5[_0x4658('0x40')]['id']}})['then'](handleEntityNotFound(_0x17f9b5,null))[_0x4658('0x1e')](function(_0x40d84e){if(_0x40d84e){_0x6fc227=_0x40d84e;_0x490689[_0x4658('0x28')]=_[_0x4658('0x41')](db['CmList']['rawAttributes']);_0x490689[_0x4658('0x29')]=_[_0x4658('0x41')](_0xb681a5[_0x4658('0x29')]);_0x490689['filters']=_[_0x4658('0x2b')](_0x490689[_0x4658('0x28')],_0x490689[_0x4658('0x29')]);_0x492044[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0x490689['model'],qs['fields'](_0xb681a5[_0x4658('0x29')][_0x4658('0x2d')]));_0x492044['attributes']=_0x492044[_0x4658('0x2c')][_0x4658('0x2e')]?_0x492044[_0x4658('0x2c')]:_0x490689['model'];_0x492044['order']=qs[_0x4658('0x33')](_0xb681a5[_0x4658('0x29')][_0x4658('0x33')]);_0x492044[_0x4658('0x34')]=qs[_0x4658('0x2a')](_[_0x4658('0x35')](_0xb681a5[_0x4658('0x29')],_0x490689['filters']));if(_0xb681a5[_0x4658('0x29')][_0x4658('0x36')]){_0x492044[_0x4658('0x34')]=_[_0x4658('0x37')](_0x492044[_0x4658('0x34')],{'$or':_[_0x4658('0x53')](_0x492044[_0x4658('0x2c')],function(_0x48200f){var _0x2893ba={};_0x2893ba[_0x48200f]={'$like':'%'+_0xb681a5['query'][_0x4658('0x36')]+'%'};return _0x2893ba;})});}_0x492044=_['merge']({},_0x492044,_0xb681a5[_0x4658('0x3a')]);return _0x6fc227[_0x4658('0x5c')](_0x492044);}})[_0x4658('0x1e')](function(_0x322130){if(_0x322130){_0x17ee93=_0x322130['length'];if(!_0xb681a5[_0x4658('0x29')]['hasOwnProperty'](_0x4658('0x30'))){_0x492044['limit']=qs['limit'](_0xb681a5[_0x4658('0x29')][_0x4658('0x31')]);_0x492044[_0x4658('0x18')]=qs[_0x4658('0x18')](_0xb681a5[_0x4658('0x29')]['offset']);}return _0x6fc227[_0x4658('0x5c')](_0x492044);}})[_0x4658('0x1e')](function(_0x3197ff){if(_0x3197ff){return _0x3197ff?{'count':_0x17ee93,'rows':_0x3197ff}:null;}})['then'](respondWithResult(_0x17f9b5,null))[_0x4658('0x43')](handleError(_0x17f9b5,null));};exports['addLists']=function(_0x14505b,_0x5e96c1,_0xf9af2e){var _0x204be9,_0x1de01e;return db['Campaign'][_0x4658('0x42')]({'where':{'id':_0x14505b[_0x4658('0x40')]['id']}})['then'](handleEntityNotFound(_0x5e96c1,null))['then'](function(_0x2dd9cc){if(_0x2dd9cc){_0x1de01e=_0x2dd9cc;return _0x2dd9cc[_0x4658('0x5d')](_0x14505b[_0x4658('0x45')]['ids'],_[_0x4658('0x4b')](_0x14505b[_0x4658('0x45')],['ids','id'])||{});}return null;})[_0x4658('0x5e')](function(_0x37f03b){var _0x4a312e;_0x204be9=_0x37f03b||[];var _0x59b974=[];if(_0x37f03b){for(var _0x4ebd30=0x0;_0x4ebd30<_0x37f03b[_0x4658('0x2e')];_0x4ebd30+=0x1){var _0x159fa8=_0x37f03b[_0x4ebd30][_0x4658('0x20')]({'plain':!![]});_0x1de01e[_0x4658('0x5f')]=_0x14505b[_0x4658('0x45')]['dialCheckDuplicateType']?_0x14505b[_0x4658('0x45')][_0x4658('0x5f')]:_0x1de01e[_0x4658('0x5f')];switch(_0x1de01e[_0x4658('0x5f')]){case _0x4658('0x60'):_0x4a312e=squel[_0x4658('0x61')]()[_0x4658('0x62')](_0x4658('0x63'))['fromQuery']([_0x4658('0x64'),_0x4658('0x65'),_0x4658('0x66'),_0x4658('0x67'),'CampaignId',_0x4658('0x4c'),_0x4658('0x4d')],squel[_0x4658('0x68')]()[_0x4658('0x69')]('phone','phone')[_0x4658('0x69')]('NOW()',_0x4658('0x65'))[_0x4658('0x69')]('id',_0x4658('0x66'))['field'](_0x159fa8['CmListId'][_0x4658('0x6a')](),'ListId')[_0x4658('0x69')](_0x14505b[_0x4658('0x40')]['id'][_0x4658('0x6a')](),_0x4658('0x52'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4c'))[_0x4658('0x69')]('NOW()',_0x4658('0x4d'))[_0x4658('0x6c')]('cm_contacts')[_0x4658('0x34')](_0x4658('0x6d'))[_0x4658('0x34')]('ListId\x20=\x20?',_0x159fa8[_0x4658('0x6e')][_0x4658('0x6a')]())[_0x4658('0x34')](_0x4658('0x6f'))[_0x4658('0x34')](_0x4658('0x70'),squel['select']()[_0x4658('0x69')](_0x4658('0x71'))[_0x4658('0x6c')]('cm_hopper_final')[_0x4658('0x34')](_0x4658('0x72'),_0x14505b[_0x4658('0x40')]['id']['toString']()))[_0x4658('0x34')](_0x4658('0x70'),squel[_0x4658('0x68')]()[_0x4658('0x69')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x4658('0x72'),_0x14505b[_0x4658('0x40')]['id']['toString']())))[_0x4658('0x6a')]();break;case _0x4658('0x73'):_0x4a312e=squel[_0x4658('0x61')]()[_0x4658('0x62')]('cm_hopper')['fromQuery']([_0x4658('0x64'),_0x4658('0x65'),_0x4658('0x66'),'ListId',_0x4658('0x52'),_0x4658('0x4c'),_0x4658('0x4d')],squel[_0x4658('0x68')]()['field']('phone',_0x4658('0x64'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x65'))[_0x4658('0x69')]('id',_0x4658('0x66'))[_0x4658('0x69')](_0x159fa8[_0x4658('0x6e')][_0x4658('0x6a')](),_0x4658('0x67'))[_0x4658('0x69')](_0x14505b['params']['id']['toString'](),_0x4658('0x52'))[_0x4658('0x69')]('NOW()',_0x4658('0x4c'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4d'))['from'](_0x4658('0x74'))['where']('deletedAt\x20IS\x20NULL')[_0x4658('0x34')]('ListId\x20=\x20?',_0x159fa8[_0x4658('0x6e')][_0x4658('0x6a')]())[_0x4658('0x34')](_0x4658('0x6f'))[_0x4658('0x34')](_0x4658('0x70'),squel[_0x4658('0x68')]()[_0x4658('0x69')](_0x4658('0x75'))['from'](_0x4658('0x63'))['where'](_0x4658('0x72'),_0x14505b[_0x4658('0x40')]['id']['toString']())))['toString']();break;default:_0x4a312e=squel[_0x4658('0x61')]()[_0x4658('0x62')](_0x4658('0x63'))[_0x4658('0x76')]([_0x4658('0x64'),_0x4658('0x65'),_0x4658('0x66'),_0x4658('0x67'),_0x4658('0x52'),_0x4658('0x4c'),_0x4658('0x4d')],squel[_0x4658('0x68')]()['field'](_0x4658('0x64'),_0x4658('0x64'))[_0x4658('0x69')]('NOW()',_0x4658('0x65'))[_0x4658('0x69')]('id',_0x4658('0x66'))['field'](_0x159fa8[_0x4658('0x6e')][_0x4658('0x6a')](),_0x4658('0x67'))['field'](_0x14505b['params']['id']['toString'](),_0x4658('0x52'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4c'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4d'))[_0x4658('0x6c')](_0x4658('0x74'))[_0x4658('0x34')](_0x4658('0x6d'))[_0x4658('0x34')](_0x4658('0x77'),_0x159fa8[_0x4658('0x6e')][_0x4658('0x6a')]())[_0x4658('0x34')](_0x4658('0x6f')))[_0x4658('0x6a')]();}_0x59b974[_0x4658('0x78')](db[_0x4658('0x79')][_0x4658('0x29')](_0x4a312e));}return BPromise['all'](_0x59b974);}})['then'](function(){return _0x204be9;})['then'](respondWithResult(_0x5e96c1,null))[_0x4658('0x43')](handleError(_0x5e96c1,null));};exports['removeLists']=function(_0x54d3cc,_0x40f2b5,_0xe19a11){return db[_0x4658('0x26')]['find']({'where':{'id':_0x54d3cc[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x40f2b5,null))[_0x4658('0x1e')](function(_0x3f7d61){if(_0x3f7d61){return _0x3f7d61[_0x4658('0x7a')](_0x54d3cc['query'][_0x4658('0x7b')]);}})[_0x4658('0x1e')](function(_0x3f2776){if(_0x3f2776){return db[_0x4658('0x54')][_0x4658('0x1f')]({'where':{'ListId':_0x54d3cc[_0x4658('0x29')]['ids'],'CampaignId':_0x54d3cc[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](function(){return _0x3f2776;});}})[_0x4658('0x1e')](respondWithStatusCode(_0x40f2b5,null))[_0x4658('0x43')](handleError(_0x40f2b5,null));};exports['getBlackLists']=function(_0x1333b1,_0xfcf7ac,_0x8bc559){var _0x302547={'raw':!![],'where':{}};var _0x497806={};var _0x4e78dd={'count':0x0,'rows':[]};return db[_0x4658('0x26')]['findOne']({'where':{'id':_0x1333b1[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0xfcf7ac,null))[_0x4658('0x1e')](function(_0x508bcc){if(_0x508bcc){_0x497806[_0x4658('0x28')]=_['keys'](db[_0x4658('0x7c')][_0x4658('0x27')]);_0x497806[_0x4658('0x29')]=_[_0x4658('0x41')](_0x1333b1[_0x4658('0x29')]);_0x497806['filters']=_[_0x4658('0x2b')](_0x497806[_0x4658('0x28')],_0x497806[_0x4658('0x29')]);_0x302547['attributes']=_[_0x4658('0x2b')](_0x497806[_0x4658('0x28')],qs[_0x4658('0x2d')](_0x1333b1[_0x4658('0x29')][_0x4658('0x2d')]));_0x302547['attributes']=_0x302547[_0x4658('0x2c')][_0x4658('0x2e')]?_0x302547[_0x4658('0x2c')]:_0x497806['model'];if(!_0x1333b1['query'][_0x4658('0x2f')](_0x4658('0x30'))){_0x302547['limit']=qs[_0x4658('0x31')](_0x1333b1[_0x4658('0x29')][_0x4658('0x31')]);_0x302547['offset']=qs[_0x4658('0x18')](_0x1333b1[_0x4658('0x29')][_0x4658('0x18')]);}_0x302547[_0x4658('0x32')]=qs[_0x4658('0x33')](_0x1333b1[_0x4658('0x29')]['sort']);_0x302547[_0x4658('0x34')]=qs['filters'](_[_0x4658('0x35')](_0x1333b1['query'],_0x497806['filters']));_0x302547['where'][_0x4658('0x52')]=_0x508bcc['id'];if(_0x1333b1[_0x4658('0x29')][_0x4658('0x36')]){_0x302547[_0x4658('0x34')]=_[_0x4658('0x37')](_0x302547[_0x4658('0x34')],{'$or':_[_0x4658('0x53')](_0x302547['attributes'],function(_0x515e56){var _0x4c877b={};_0x4c877b[_0x515e56]={'$like':'%'+_0x1333b1[_0x4658('0x29')][_0x4658('0x36')]+'%'};return _0x4c877b;})});}_0x302547=_[_0x4658('0x37')]({},_0x302547,_0x1333b1[_0x4658('0x3a')]);return db['CmList'][_0x4658('0x3b')]({'where':_0x302547[_0x4658('0x34')]})[_0x4658('0x1e')](function(_0x37baa6){_0x4e78dd['count']=_0x37baa6;if(_0x1333b1[_0x4658('0x29')][_0x4658('0x3c')]){_0x302547[_0x4658('0x3d')]=[{'all':!![]}];}return db[_0x4658('0x7c')][_0x4658('0x3e')](_0x302547);})[_0x4658('0x1e')](function(_0x2ec1a4){_0x4e78dd['rows']=_0x2ec1a4;return _0x4e78dd;});}})[_0x4658('0x1e')](respondWithFilteredResult(_0xfcf7ac,_0x302547))[_0x4658('0x43')](handleError(_0xfcf7ac,null));};exports[_0x4658('0x7d')]=function(_0x58505d,_0x353fab,_0x57b32b){var _0x27ead6,_0x5378b3;return db[_0x4658('0x26')][_0x4658('0x42')]({'where':{'id':_0x58505d[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x353fab,null))[_0x4658('0x1e')](function(_0x3eb9c0){if(_0x3eb9c0){_0x5378b3=_0x3eb9c0;return _0x3eb9c0[_0x4658('0x7d')](_0x58505d[_0x4658('0x45')][_0x4658('0x7b')],_['omit'](_0x58505d[_0x4658('0x45')],[_0x4658('0x7b'),'id'])||{});}return null;})[_0x4658('0x5e')](function(_0x1007bb){var _0x3d1ffd;_0x27ead6=_0x1007bb||[];var _0x5e6ed5=[];if(_0x1007bb){for(var _0x370fac=0x0;_0x370fac<_0x1007bb[_0x4658('0x2e')];_0x370fac+=0x1){var _0x519999=_0x1007bb[_0x370fac]['get']({'plain':!![]});_0x3d1ffd=squel['insert']()[_0x4658('0x62')](_0x4658('0x7e'))[_0x4658('0x76')]([_0x4658('0x64'),'ContactId',_0x4658('0x67'),_0x4658('0x52'),_0x4658('0x4c'),_0x4658('0x4d')],squel[_0x4658('0x68')]()[_0x4658('0x69')](_0x4658('0x64'),_0x4658('0x64'))[_0x4658('0x69')]('id',_0x4658('0x66'))[_0x4658('0x69')](_0x519999[_0x4658('0x6e')][_0x4658('0x6a')](),'ListId')['field'](_0x58505d[_0x4658('0x40')]['id'][_0x4658('0x6a')](),_0x4658('0x52'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4c'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4d'))[_0x4658('0x6c')](_0x4658('0x74'))[_0x4658('0x34')]('deletedAt\x20IS\x20NULL')[_0x4658('0x34')](_0x4658('0x77'),_0x519999[_0x4658('0x6e')][_0x4658('0x6a')]())['where'](_0x4658('0x6f')))['toString']();_0x5e6ed5[_0x4658('0x78')](db[_0x4658('0x79')][_0x4658('0x29')](_0x3d1ffd));}return BPromise['all'](_0x5e6ed5);}})[_0x4658('0x1e')](function(){return _0x27ead6;})[_0x4658('0x1e')](respondWithResult(_0x353fab,null))[_0x4658('0x43')](handleError(_0x353fab,null));};exports[_0x4658('0x7f')]=function(_0x3bcf72,_0x335d92,_0x8e6b14){return db[_0x4658('0x26')][_0x4658('0x42')]({'where':{'id':_0x3bcf72[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x335d92,null))['then'](function(_0x353c26){if(_0x353c26){return _0x353c26[_0x4658('0x7f')](_0x3bcf72[_0x4658('0x29')][_0x4658('0x7b')]);}})['then'](function(_0x173d0b){if(_0x173d0b){return db[_0x4658('0x5b')]['destroy']({'where':{'ListId':_0x3bcf72[_0x4658('0x29')][_0x4658('0x7b')],'CampaignId':_0x3bcf72[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](function(){return _0x173d0b;});}})['then'](respondWithStatusCode(_0x335d92,null))[_0x4658('0x43')](handleError(_0x335d92,null));};
\ No newline at end of file
+var _0x175e=['error','stack','name','send','index','Campaign','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','type','VIRTUAL','merge','options','includeAll','include','rows','show','params','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getHoppers','findOne','CmHopper','CampaignId','filter','findAll','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','fromQuery','push','sequelize','all','removeLists','addBlackLists','cm_hopper_black','ListId\x20=\x20?','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x175e,0xe6));var _0xe175=function(_0x36b0d7,_0x3044c7){_0x36b0d7=_0x36b0d7-0x0;var _0x3ec0c9=_0x175e[_0x36b0d7];return _0x3ec0c9;};'use strict';var pdf=require(_0xe175('0x0'));var emlformat=require(_0xe175('0x1'));var rimraf=require(_0xe175('0x2'));var zipdir=require(_0xe175('0x3'));var jsonpatch=require(_0xe175('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe175('0x5'));var Mustache=require(_0xe175('0x6'));var util=require(_0xe175('0x7'));var path=require(_0xe175('0x8'));var sox=require(_0xe175('0x9'));var csv=require(_0xe175('0xa'));var ejs=require(_0xe175('0xb'));var fs=require('fs');var _=require(_0xe175('0xc'));var squel=require(_0xe175('0xd'));var crypto=require(_0xe175('0xe'));var jsforce=require(_0xe175('0xf'));var deskjs=require(_0xe175('0x10'));var toCsv=require(_0xe175('0xa'));var querystring=require(_0xe175('0x11'));var Papa=require(_0xe175('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe175('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe175('0x14'))(_0xe175('0x15'));var utils=require(_0xe175('0x16'));var config=require(_0xe175('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ebffb,_0x3f4742){_0x3f4742=_0x3f4742||0xcc;return function(_0x4d7c59){if(_0x4d7c59){return _0x4ebffb['sendStatus'](_0x3f4742);}return _0x4ebffb[_0xe175('0x18')](_0x3f4742)[_0xe175('0x19')]();};}function respondWithResult(_0xf92dec,_0x36ee94){_0x36ee94=_0x36ee94||0xc8;return function(_0x439252){if(_0x439252){return _0xf92dec['status'](_0x36ee94)[_0xe175('0x1a')](_0x439252);}};}function respondWithFilteredResult(_0x29885c,_0x406191){return function(_0x297f95){if(_0x297f95){var _0x3a0677=_0x297f95[_0xe175('0x1b')],_0x20660b=_0x406191[_0xe175('0x1c')],_0x20ac70=_0x406191[_0xe175('0x1c')]+_0x406191['limit'],_0x561ee3;if(_0x20ac70>=_0x3a0677){_0x20ac70=_0x3a0677;_0x561ee3=0xc8;}else{_0x561ee3=0xce;}_0x29885c[_0xe175('0x18')](_0x561ee3);return _0x29885c[_0xe175('0x1d')](_0xe175('0x1e'),_0x20660b+'-'+_0x20ac70+'/'+_0x3a0677)[_0xe175('0x1a')](_0x297f95);}return null;};}function patchUpdates(_0x43e1fa){return function(_0x2f5f0d){try{jsonpatch['apply'](_0x2f5f0d,_0x43e1fa,!![]);}catch(_0x466fe9){return BPromise[_0xe175('0x1f')](_0x466fe9);}return _0x2f5f0d[_0xe175('0x20')]();};}function saveUpdates(_0x1b82d0,_0x5350bc){return function(_0x291bc4){if(_0x291bc4){return _0x291bc4[_0xe175('0x21')](_0x1b82d0)[_0xe175('0x22')](function(_0x57dcf9){return _0x57dcf9;});}return null;};}function removeEntity(_0x3c6dc9,_0x1a92fc){return function(_0x57ef02){if(_0x57ef02){return _0x57ef02[_0xe175('0x23')]()['then'](function(){var _0x3e27c3=_0x57ef02[_0xe175('0x24')]({'plain':!![]});var _0x1bc8c9=_0xe175('0x25');return db[_0xe175('0x26')][_0xe175('0x23')]({'where':{'type':_0x1bc8c9,'resourceId':_0x3e27c3['id']}})[_0xe175('0x22')](function(){return _0x57ef02;});})[_0xe175('0x22')](function(){_0x3c6dc9[_0xe175('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c54dd,_0xf7c205){return function(_0x1527fe){if(!_0x1527fe){_0x5c54dd[_0xe175('0x27')](0x194);}return _0x1527fe;};}function handleError(_0x2522e5,_0x12340d){_0x12340d=_0x12340d||0x1f4;return function(_0x336b44){logger[_0xe175('0x28')](_0x336b44[_0xe175('0x29')]);if(_0x336b44[_0xe175('0x2a')]){delete _0x336b44[_0xe175('0x2a')];}_0x2522e5[_0xe175('0x18')](_0x12340d)[_0xe175('0x2b')](_0x336b44);};}exports[_0xe175('0x2c')]=function(_0x207548,_0x5c0ed7){var _0x49b7fa={},_0x4f645c={},_0x266b33={'count':0x0,'rows':[]};var _0x3c0e15=db[_0xe175('0x2d')][_0xe175('0x2e')];_0x4f645c[_0xe175('0x2f')]=_[_0xe175('0x30')](_0x3c0e15);_0x4f645c['query']=_[_0xe175('0x30')](_0x207548[_0xe175('0x31')]);_0x4f645c[_0xe175('0x32')]=_[_0xe175('0x33')](_0x4f645c[_0xe175('0x2f')],_0x4f645c[_0xe175('0x31')]);_0x49b7fa[_0xe175('0x34')]=_[_0xe175('0x33')](_0x4f645c['model'],qs[_0xe175('0x35')](_0x207548[_0xe175('0x31')][_0xe175('0x35')]));_0x49b7fa[_0xe175('0x34')]=_0x49b7fa['attributes'][_0xe175('0x36')]?_0x49b7fa[_0xe175('0x34')]:_0x4f645c['model'];if(!_0x207548['query'][_0xe175('0x37')](_0xe175('0x38'))){_0x49b7fa[_0xe175('0x39')]=qs['limit'](_0x207548[_0xe175('0x31')][_0xe175('0x39')]);_0x49b7fa[_0xe175('0x1c')]=qs[_0xe175('0x1c')](_0x207548[_0xe175('0x31')][_0xe175('0x1c')]);}_0x49b7fa[_0xe175('0x3a')]=qs[_0xe175('0x3b')](_0x207548[_0xe175('0x31')][_0xe175('0x3b')]);_0x49b7fa[_0xe175('0x3c')]=qs[_0xe175('0x32')](_[_0xe175('0x3d')](_0x207548['query'],_0x4f645c['filters']));if(_0x207548[_0xe175('0x31')]['filter']){_0x49b7fa[_0xe175('0x3c')]=_['merge'](_0x49b7fa[_0xe175('0x3c')],{'$or':_[_0xe175('0x3e')](_0x3c0e15,function(_0x5304e3){if(_0x5304e3[_0xe175('0x3f')]['key']!==_0xe175('0x40')){var _0x2a142c={};_0x2a142c[_0x5304e3['field']]={'$like':'%'+_0x207548[_0xe175('0x31')]['filter']+'%'};return _0x2a142c;}})});}_0x49b7fa=_[_0xe175('0x41')]({},_0x49b7fa,_0x207548[_0xe175('0x42')]);var _0x5949e7={'where':_0x49b7fa['where']};return db['Campaign']['count'](_0x5949e7)['then'](function(_0x563ed4){_0x266b33['count']=_0x563ed4;if(_0x207548[_0xe175('0x31')][_0xe175('0x43')]){_0x49b7fa[_0xe175('0x44')]=[{'all':!![]}];}return db[_0xe175('0x2d')]['findAll'](_0x49b7fa);})['then'](function(_0x11f4e9){_0x266b33[_0xe175('0x45')]=_0x11f4e9;return _0x266b33;})[_0xe175('0x22')](respondWithFilteredResult(_0x5c0ed7,_0x49b7fa))['catch'](handleError(_0x5c0ed7,null));};exports[_0xe175('0x46')]=function(_0x3374b6,_0x51528a){var _0x1c5754={'raw':![],'where':{'id':_0x3374b6[_0xe175('0x47')]['id']}},_0x5626c1={};_0x5626c1[_0xe175('0x2f')]=_[_0xe175('0x30')](db['Campaign'][_0xe175('0x2e')]);_0x5626c1[_0xe175('0x31')]=_[_0xe175('0x30')](_0x3374b6[_0xe175('0x31')]);_0x5626c1[_0xe175('0x32')]=_[_0xe175('0x33')](_0x5626c1['model'],_0x5626c1[_0xe175('0x31')]);_0x1c5754[_0xe175('0x34')]=_[_0xe175('0x33')](_0x5626c1['model'],qs['fields'](_0x3374b6[_0xe175('0x31')][_0xe175('0x35')]));_0x1c5754['attributes']=_0x1c5754['attributes']['length']?_0x1c5754['attributes']:_0x5626c1[_0xe175('0x2f')];if(_0x3374b6[_0xe175('0x31')][_0xe175('0x43')]){_0x1c5754[_0xe175('0x44')]=[{'all':!![]}];}_0x1c5754=_[_0xe175('0x41')]({},_0x1c5754,_0x3374b6[_0xe175('0x42')]);return db[_0xe175('0x2d')][_0xe175('0x48')](_0x1c5754)[_0xe175('0x22')](handleEntityNotFound(_0x51528a,null))[_0xe175('0x22')](respondWithResult(_0x51528a,null))['catch'](handleError(_0x51528a,null));};exports[_0xe175('0x49')]=function(_0x3669bb,_0xdbd68){return db['Campaign'][_0xe175('0x49')](_0x3669bb[_0xe175('0x4a')],{})[_0xe175('0x22')](function(_0x4c5f4a){var _0x4d0d9e=_0x3669bb[_0xe175('0x4b')][_0xe175('0x24')]({'plain':!![]});if(!_0x4d0d9e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d0d9e[_0xe175('0x4c')]===_0xe175('0x4b')){var _0x10d06e=_0x4c5f4a['get']({'plain':!![]});var _0x8820e0='IvrCampaigns';return db[_0xe175('0x4d')][_0xe175('0x48')]({'where':{'name':_0x8820e0,'userProfileId':_0x4d0d9e[_0xe175('0x4e')]},'raw':!![]})[_0xe175('0x22')](function(_0x20f8f9){if(_0x20f8f9&&_0x20f8f9['autoAssociation']===0x0){return db[_0xe175('0x26')][_0xe175('0x49')]({'name':_0x10d06e[_0xe175('0x2a')],'resourceId':_0x10d06e['id'],'type':_0x20f8f9[_0xe175('0x2a')],'sectionId':_0x20f8f9['id']},{})[_0xe175('0x22')](function(){return _0x4c5f4a;});}else{return _0x4c5f4a;}})['catch'](function(_0x1c1972){logger[_0xe175('0x28')](_0xe175('0x4f'),_0x1c1972);throw _0x1c1972;});}return _0x4c5f4a;})[_0xe175('0x22')](respondWithResult(_0xdbd68,0xc9))[_0xe175('0x50')](handleError(_0xdbd68,null));};exports[_0xe175('0x51')]=function(_0x4a167c,_0x2114c3){var _0x2b4d5e={'raw':![],'where':{'id':_0x4a167c[_0xe175('0x47')]['id']}},_0x49c584={};_0x49c584[_0xe175('0x2f')]=_[_0xe175('0x30')](db[_0xe175('0x2d')][_0xe175('0x2e')]);_0x2b4d5e[_0xe175('0x34')]=_[_0xe175('0x33')](_0x49c584['model'],qs['fields'](_0x4a167c['query'][_0xe175('0x35')]));_0x2b4d5e[_0xe175('0x34')]=_0x2b4d5e[_0xe175('0x34')][_0xe175('0x36')]?_0x2b4d5e[_0xe175('0x34')]:_0x49c584[_0xe175('0x2f')];if(_0x4a167c[_0xe175('0x31')][_0xe175('0x43')]){_0x2b4d5e['include']=[{'all':!![]}];}_0x2b4d5e=_[_0xe175('0x41')]({},_0x2b4d5e,_0x4a167c[_0xe175('0x42')]);return db['Campaign'][_0xe175('0x48')](_0x2b4d5e)[_0xe175('0x22')](handleEntityNotFound(_0x2114c3,null))[_0xe175('0x22')](function(_0x196b8e){if(_0x196b8e){var _0x45231e=_0x196b8e['get']({'plain':!![]});_0x45231e=qs['omit'](_0x45231e,['id',_0xe175('0x52'),_0xe175('0x53')]);_0x4a167c[_0xe175('0x4a')]=_[_0xe175('0x54')](_0x4a167c[_0xe175('0x4a')],['id',_0xe175('0x52'),_0xe175('0x53')]);return db[_0xe175('0x2d')][_0xe175('0x49')](_['merge'](_0x45231e,_0x4a167c['body']),{'include':_0x4a167c[_0xe175('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0xe175('0x22')](function(_0x2207a7){var _0x4961d4=_0x4a167c[_0xe175('0x4b')][_0xe175('0x24')]({'plain':!![]});if(!_0x4961d4)throw new Error(_0xe175('0x55'));if(_0x4961d4['role']==='user'){var _0x64eeed=_0x2207a7[_0xe175('0x24')]({'plain':!![]});var _0xf73b2a=_0xe175('0x25');return db[_0xe175('0x4d')][_0xe175('0x48')]({'where':{'name':_0xf73b2a,'userProfileId':_0x4961d4[_0xe175('0x4e')]},'raw':!![]})[_0xe175('0x22')](function(_0x141b64){if(_0x141b64&&_0x141b64[_0xe175('0x56')]===0x0){return db['UserProfileResource'][_0xe175('0x49')]({'name':_0x64eeed[_0xe175('0x2a')],'resourceId':_0x64eeed['id'],'type':_0x141b64[_0xe175('0x2a')],'sectionId':_0x141b64['id']},{})[_0xe175('0x22')](function(){return _0x2207a7;});}else{return _0x2207a7;}})[_0xe175('0x50')](function(_0x23d17a){logger[_0xe175('0x28')](_0xe175('0x4f'),_0x23d17a);throw _0x23d17a;});}return _0x2207a7;});}})['then'](respondWithResult(_0x2114c3,0xc9))[_0xe175('0x50')](handleError(_0x2114c3,null));};exports['update']=function(_0x609fc3,_0x4ff651){if(_0x609fc3[_0xe175('0x4a')]['id']){delete _0x609fc3[_0xe175('0x4a')]['id'];}return db[_0xe175('0x2d')][_0xe175('0x48')]({'where':{'id':_0x609fc3['params']['id']}})[_0xe175('0x22')](handleEntityNotFound(_0x4ff651,null))[_0xe175('0x22')](saveUpdates(_0x609fc3[_0xe175('0x4a')],null))[_0xe175('0x22')](respondWithResult(_0x4ff651,null))[_0xe175('0x50')](handleError(_0x4ff651,null));};exports[_0xe175('0x23')]=function(_0x584126,_0x327378){return db[_0xe175('0x2d')]['find']({'where':{'id':_0x584126[_0xe175('0x47')]['id']}})[_0xe175('0x22')](handleEntityNotFound(_0x327378,null))[_0xe175('0x22')](removeEntity(_0x327378,null))[_0xe175('0x50')](handleError(_0x327378,null));};exports[_0xe175('0x57')]=function(_0x124484,_0x33394e,_0x655b04){var _0x50ce66={'raw':!![],'where':{}};var _0x9fe8a7={};var _0xfc1b24={'count':0x0,'rows':[]};return db[_0xe175('0x2d')][_0xe175('0x58')]({'where':{'id':_0x124484['params']['id']}})['then'](handleEntityNotFound(_0x33394e,null))['then'](function(_0x3a215e){if(_0x3a215e){_0x9fe8a7['model']=_[_0xe175('0x30')](db[_0xe175('0x59')]['rawAttributes']);_0x9fe8a7[_0xe175('0x31')]=_[_0xe175('0x30')](_0x124484[_0xe175('0x31')]);_0x9fe8a7[_0xe175('0x32')]=_[_0xe175('0x33')](_0x9fe8a7[_0xe175('0x2f')],_0x9fe8a7['query']);_0x50ce66[_0xe175('0x34')]=_[_0xe175('0x33')](_0x9fe8a7[_0xe175('0x2f')],qs[_0xe175('0x35')](_0x124484[_0xe175('0x31')][_0xe175('0x35')]));_0x50ce66[_0xe175('0x34')]=_0x50ce66['attributes'][_0xe175('0x36')]?_0x50ce66[_0xe175('0x34')]:_0x9fe8a7[_0xe175('0x2f')];if(!_0x124484[_0xe175('0x31')][_0xe175('0x37')](_0xe175('0x38'))){_0x50ce66[_0xe175('0x39')]=qs[_0xe175('0x39')](_0x124484[_0xe175('0x31')][_0xe175('0x39')]);_0x50ce66['offset']=qs[_0xe175('0x1c')](_0x124484['query'][_0xe175('0x1c')]);}_0x50ce66[_0xe175('0x3a')]=qs[_0xe175('0x3b')](_0x124484['query']['sort']);_0x50ce66[_0xe175('0x3c')]=qs[_0xe175('0x32')](_['pick'](_0x124484[_0xe175('0x31')],_0x9fe8a7[_0xe175('0x32')]));_0x50ce66[_0xe175('0x3c')][_0xe175('0x5a')]=_0x3a215e['id'];if(_0x124484[_0xe175('0x31')][_0xe175('0x5b')]){_0x50ce66['where']=_[_0xe175('0x41')](_0x50ce66['where'],{'$or':_[_0xe175('0x3e')](_0x50ce66[_0xe175('0x34')],function(_0xb16e2c){var _0xe45136={};_0xe45136[_0xb16e2c]={'$like':'%'+_0x124484[_0xe175('0x31')][_0xe175('0x5b')]+'%'};return _0xe45136;})});}_0x50ce66=_[_0xe175('0x41')]({},_0x50ce66,_0x124484[_0xe175('0x42')]);return db[_0xe175('0x59')][_0xe175('0x1b')]({'where':_0x50ce66[_0xe175('0x3c')]})[_0xe175('0x22')](function(_0x3d882b){_0xfc1b24[_0xe175('0x1b')]=_0x3d882b;if(_0x124484[_0xe175('0x31')][_0xe175('0x43')]){_0x50ce66[_0xe175('0x44')]=[{'all':!![]}];}return db[_0xe175('0x59')][_0xe175('0x5c')](_0x50ce66);})[_0xe175('0x22')](function(_0x2b033c){_0xfc1b24[_0xe175('0x45')]=_0x2b033c;return _0xfc1b24;});}})[_0xe175('0x22')](respondWithFilteredResult(_0x33394e,_0x50ce66))['catch'](handleError(_0x33394e,null));};exports['getHopperHistories']=function(_0x25f1a7,_0x4ce658,_0x579db9){var _0x1a3f3f={'raw':!![],'where':{}};var _0x5b25c1={};var _0x58be6a={'count':0x0,'rows':[]};return db[_0xe175('0x2d')]['findOne']({'where':{'id':_0x25f1a7['params']['id']}})[_0xe175('0x22')](handleEntityNotFound(_0x4ce658,null))['then'](function(_0x931d31){if(_0x931d31){_0x5b25c1['model']=_[_0xe175('0x30')](db[_0xe175('0x5d')][_0xe175('0x2e')]);_0x5b25c1[_0xe175('0x31')]=_[_0xe175('0x30')](_0x25f1a7[_0xe175('0x31')]);_0x5b25c1['filters']=_[_0xe175('0x33')](_0x5b25c1[_0xe175('0x2f')],_0x5b25c1['query']);_0x1a3f3f['attributes']=_[_0xe175('0x33')](_0x5b25c1['model'],qs[_0xe175('0x35')](_0x25f1a7[_0xe175('0x31')]['fields']));_0x1a3f3f[_0xe175('0x34')]=_0x1a3f3f['attributes']['length']?_0x1a3f3f[_0xe175('0x34')]:_0x5b25c1[_0xe175('0x2f')];if(!_0x25f1a7[_0xe175('0x31')]['hasOwnProperty']('nolimit')){_0x1a3f3f['limit']=qs['limit'](_0x25f1a7[_0xe175('0x31')]['limit']);_0x1a3f3f['offset']=qs[_0xe175('0x1c')](_0x25f1a7[_0xe175('0x31')][_0xe175('0x1c')]);}_0x1a3f3f['order']=qs['sort'](_0x25f1a7[_0xe175('0x31')][_0xe175('0x3b')]);_0x1a3f3f[_0xe175('0x3c')]=qs[_0xe175('0x32')](_[_0xe175('0x3d')](_0x25f1a7[_0xe175('0x31')],_0x5b25c1[_0xe175('0x32')]));_0x1a3f3f[_0xe175('0x3c')][_0xe175('0x5a')]=_0x931d31['id'];if(_0x25f1a7[_0xe175('0x31')][_0xe175('0x5b')]){_0x1a3f3f[_0xe175('0x3c')]=_[_0xe175('0x41')](_0x1a3f3f[_0xe175('0x3c')],{'$or':_[_0xe175('0x3e')](_0x1a3f3f[_0xe175('0x34')],function(_0x413c20){var _0x21622a={};_0x21622a[_0x413c20]={'$like':'%'+_0x25f1a7[_0xe175('0x31')]['filter']+'%'};return _0x21622a;})});}_0x1a3f3f=_[_0xe175('0x41')]({},_0x1a3f3f,_0x25f1a7[_0xe175('0x42')]);return db[_0xe175('0x5d')][_0xe175('0x1b')]({'where':_0x1a3f3f['where']})[_0xe175('0x22')](function(_0x119be8){_0x58be6a[_0xe175('0x1b')]=_0x119be8;if(_0x25f1a7[_0xe175('0x31')]['includeAll']){_0x1a3f3f[_0xe175('0x44')]=[{'all':!![]}];}return db[_0xe175('0x5d')]['findAll'](_0x1a3f3f);})['then'](function(_0x1e53ca){_0x58be6a[_0xe175('0x45')]=_0x1e53ca;return _0x58be6a;});}})['then'](respondWithFilteredResult(_0x4ce658,_0x1a3f3f))[_0xe175('0x50')](handleError(_0x4ce658,null));};exports[_0xe175('0x5e')]=function(_0x4dcd82,_0x5cbc9d,_0x1e8def){var _0x25aa6b={'raw':!![],'where':{}};var _0x2d92e1={};var _0x213704={'count':0x0,'rows':[]};return db[_0xe175('0x2d')]['findOne']({'where':{'id':_0x4dcd82[_0xe175('0x47')]['id']}})['then'](handleEntityNotFound(_0x5cbc9d,null))['then'](function(_0x3b72c5){if(_0x3b72c5){_0x2d92e1['model']=_[_0xe175('0x30')](db[_0xe175('0x5f')][_0xe175('0x2e')]);_0x2d92e1['query']=_[_0xe175('0x30')](_0x4dcd82[_0xe175('0x31')]);_0x2d92e1[_0xe175('0x32')]=_[_0xe175('0x33')](_0x2d92e1['model'],_0x2d92e1[_0xe175('0x31')]);_0x25aa6b['attributes']=_[_0xe175('0x33')](_0x2d92e1['model'],qs[_0xe175('0x35')](_0x4dcd82[_0xe175('0x31')]['fields']));_0x25aa6b[_0xe175('0x34')]=_0x25aa6b[_0xe175('0x34')]['length']?_0x25aa6b[_0xe175('0x34')]:_0x2d92e1[_0xe175('0x2f')];if(!_0x4dcd82[_0xe175('0x31')][_0xe175('0x37')](_0xe175('0x38'))){_0x25aa6b[_0xe175('0x39')]=qs[_0xe175('0x39')](_0x4dcd82[_0xe175('0x31')]['limit']);_0x25aa6b[_0xe175('0x1c')]=qs['offset'](_0x4dcd82['query']['offset']);}_0x25aa6b[_0xe175('0x3a')]=qs['sort'](_0x4dcd82[_0xe175('0x31')]['sort']);_0x25aa6b['where']=qs['filters'](_['pick'](_0x4dcd82[_0xe175('0x31')],_0x2d92e1[_0xe175('0x32')]));_0x25aa6b[_0xe175('0x3c')][_0xe175('0x5a')]=_0x3b72c5['id'];if(_0x4dcd82['query']['filter']){_0x25aa6b[_0xe175('0x3c')]=_[_0xe175('0x41')](_0x25aa6b[_0xe175('0x3c')],{'$or':_['map'](_0x25aa6b[_0xe175('0x34')],function(_0x1caafb){var _0xff5e72={};_0xff5e72[_0x1caafb]={'$like':'%'+_0x4dcd82['query']['filter']+'%'};return _0xff5e72;})});}_0x25aa6b=_[_0xe175('0x41')]({},_0x25aa6b,_0x4dcd82[_0xe175('0x42')]);return db[_0xe175('0x5f')][_0xe175('0x1b')]({'where':_0x25aa6b['where']})['then'](function(_0x2e154d){_0x213704[_0xe175('0x1b')]=_0x2e154d;if(_0x4dcd82[_0xe175('0x31')][_0xe175('0x43')]){_0x25aa6b['include']=[{'all':!![]}];}return db[_0xe175('0x5f')][_0xe175('0x5c')](_0x25aa6b);})[_0xe175('0x22')](function(_0x4d468b){_0x213704[_0xe175('0x45')]=_0x4d468b;return _0x213704;});}})[_0xe175('0x22')](respondWithFilteredResult(_0x5cbc9d,_0x25aa6b))[_0xe175('0x50')](handleError(_0x5cbc9d,null));};exports[_0xe175('0x60')]=function(_0x598dd0,_0x5c3b66,_0xbc27f2){var _0x16b27c={'raw':!![],'where':{}};var _0x4869aa={};var _0x44a013={'count':0x0,'rows':[]};return db[_0xe175('0x2d')][_0xe175('0x58')]({'where':{'id':_0x598dd0[_0xe175('0x47')]['id']}})[_0xe175('0x22')](handleEntityNotFound(_0x5c3b66,null))[_0xe175('0x22')](function(_0x3d0b86){if(_0x3d0b86){_0x4869aa[_0xe175('0x2f')]=_['keys'](db[_0xe175('0x61')][_0xe175('0x2e')]);_0x4869aa[_0xe175('0x31')]=_[_0xe175('0x30')](_0x598dd0[_0xe175('0x31')]);_0x4869aa[_0xe175('0x32')]=_['intersection'](_0x4869aa[_0xe175('0x2f')],_0x4869aa[_0xe175('0x31')]);_0x16b27c[_0xe175('0x34')]=_[_0xe175('0x33')](_0x4869aa[_0xe175('0x2f')],qs[_0xe175('0x35')](_0x598dd0['query'][_0xe175('0x35')]));_0x16b27c[_0xe175('0x34')]=_0x16b27c[_0xe175('0x34')][_0xe175('0x36')]?_0x16b27c[_0xe175('0x34')]:_0x4869aa[_0xe175('0x2f')];if(!_0x598dd0[_0xe175('0x31')][_0xe175('0x37')]('nolimit')){_0x16b27c['limit']=qs[_0xe175('0x39')](_0x598dd0['query'][_0xe175('0x39')]);_0x16b27c['offset']=qs[_0xe175('0x1c')](_0x598dd0['query'][_0xe175('0x1c')]);}_0x16b27c[_0xe175('0x3a')]=qs[_0xe175('0x3b')](_0x598dd0['query'][_0xe175('0x3b')]);_0x16b27c[_0xe175('0x3c')]=qs[_0xe175('0x32')](_['pick'](_0x598dd0['query'],_0x4869aa['filters']));_0x16b27c[_0xe175('0x3c')][_0xe175('0x5a')]=_0x3d0b86['id'];if(_0x598dd0[_0xe175('0x31')][_0xe175('0x5b')]){_0x16b27c['where']=_[_0xe175('0x41')](_0x16b27c[_0xe175('0x3c')],{'$or':_[_0xe175('0x3e')](_0x16b27c[_0xe175('0x34')],function(_0x19c116){var _0x55a88f={};_0x55a88f[_0x19c116]={'$like':'%'+_0x598dd0['query']['filter']+'%'};return _0x55a88f;})});}_0x16b27c=_[_0xe175('0x41')]({},_0x16b27c,_0x598dd0[_0xe175('0x42')]);return db[_0xe175('0x61')][_0xe175('0x1b')]({'where':_0x16b27c['where']})['then'](function(_0x4f79ef){_0x44a013[_0xe175('0x1b')]=_0x4f79ef;if(_0x598dd0[_0xe175('0x31')][_0xe175('0x43')]){_0x16b27c[_0xe175('0x44')]=[{'all':!![]}];}return db[_0xe175('0x61')]['findAll'](_0x16b27c);})[_0xe175('0x22')](function(_0x47684c){_0x44a013[_0xe175('0x45')]=_0x47684c;return _0x44a013;});}})[_0xe175('0x22')](respondWithFilteredResult(_0x5c3b66,_0x16b27c))[_0xe175('0x50')](handleError(_0x5c3b66,null));};exports[_0xe175('0x62')]=function(_0x2dd0e2,_0x1d22ba,_0x21ee2e){var _0x3f25a5={};var _0x351e11={};var _0x22ea0d;var _0x37331b;return db[_0xe175('0x2d')][_0xe175('0x58')]({'where':{'id':_0x2dd0e2[_0xe175('0x47')]['id']}})[_0xe175('0x22')](handleEntityNotFound(_0x1d22ba,null))[_0xe175('0x22')](function(_0x3fcb17){if(_0x3fcb17){_0x22ea0d=_0x3fcb17;_0x351e11[_0xe175('0x2f')]=_[_0xe175('0x30')](db[_0xe175('0x63')][_0xe175('0x2e')]);_0x351e11[_0xe175('0x31')]=_['keys'](_0x2dd0e2[_0xe175('0x31')]);_0x351e11[_0xe175('0x32')]=_[_0xe175('0x33')](_0x351e11['model'],_0x351e11[_0xe175('0x31')]);_0x3f25a5['attributes']=_[_0xe175('0x33')](_0x351e11[_0xe175('0x2f')],qs['fields'](_0x2dd0e2['query'][_0xe175('0x35')]));_0x3f25a5[_0xe175('0x34')]=_0x3f25a5[_0xe175('0x34')][_0xe175('0x36')]?_0x3f25a5[_0xe175('0x34')]:_0x351e11[_0xe175('0x2f')];_0x3f25a5['order']=qs[_0xe175('0x3b')](_0x2dd0e2[_0xe175('0x31')][_0xe175('0x3b')]);_0x3f25a5[_0xe175('0x3c')]=qs[_0xe175('0x32')](_[_0xe175('0x3d')](_0x2dd0e2[_0xe175('0x31')],_0x351e11[_0xe175('0x32')]));if(_0x2dd0e2[_0xe175('0x31')]['filter']){_0x3f25a5[_0xe175('0x3c')]=_['merge'](_0x3f25a5['where'],{'$or':_[_0xe175('0x3e')](_0x3f25a5[_0xe175('0x34')],function(_0x28d461){var _0x41f576={};_0x41f576[_0x28d461]={'$like':'%'+_0x2dd0e2['query'][_0xe175('0x5b')]+'%'};return _0x41f576;})});}_0x3f25a5=_['merge']({},_0x3f25a5,_0x2dd0e2['options']);return _0x22ea0d['getLists'](_0x3f25a5);}})[_0xe175('0x22')](function(_0x18a700){if(_0x18a700){_0x37331b=_0x18a700[_0xe175('0x36')];if(!_0x2dd0e2[_0xe175('0x31')][_0xe175('0x37')](_0xe175('0x38'))){_0x3f25a5[_0xe175('0x39')]=qs['limit'](_0x2dd0e2['query'][_0xe175('0x39')]);_0x3f25a5[_0xe175('0x1c')]=qs[_0xe175('0x1c')](_0x2dd0e2[_0xe175('0x31')][_0xe175('0x1c')]);}return _0x22ea0d[_0xe175('0x62')](_0x3f25a5);}})['then'](function(_0x59da05){if(_0x59da05){return _0x59da05?{'count':_0x37331b,'rows':_0x59da05}:null;}})['then'](respondWithResult(_0x1d22ba,null))[_0xe175('0x50')](handleError(_0x1d22ba,null));};exports[_0xe175('0x64')]=function(_0x32e5de,_0x405003,_0x10410f){var _0x245158,_0x2529ba;return db['Campaign'][_0xe175('0x48')]({'where':{'id':_0x32e5de[_0xe175('0x47')]['id']}})[_0xe175('0x22')](handleEntityNotFound(_0x405003,null))['then'](function(_0x3dce13){if(_0x3dce13){_0x2529ba=_0x3dce13;return _0x3dce13[_0xe175('0x64')](_0x32e5de['body'][_0xe175('0x65')],_[_0xe175('0x54')](_0x32e5de[_0xe175('0x4a')],[_0xe175('0x65'),'id'])||{});}return null;})[_0xe175('0x66')](function(_0x4ad240){var _0x2429a3;_0x245158=_0x4ad240||[];var _0x1f6dbb=[];if(_0x4ad240){for(var _0xf613f9=0x0;_0xf613f9<_0x4ad240[_0xe175('0x36')];_0xf613f9+=0x1){var _0xc1c537=_0x4ad240[_0xf613f9][_0xe175('0x24')]({'plain':!![]});_0x2529ba[_0xe175('0x67')]=_0x32e5de[_0xe175('0x4a')][_0xe175('0x67')]?_0x32e5de[_0xe175('0x4a')][_0xe175('0x67')]:_0x2529ba[_0xe175('0x67')];switch(_0x2529ba[_0xe175('0x67')]){case _0xe175('0x68'):_0x2429a3=squel['insert']()[_0xe175('0x69')](_0xe175('0x6a'))['fromQuery']([_0xe175('0x6b'),_0xe175('0x6c'),_0xe175('0x6d'),_0xe175('0x6e'),'CampaignId',_0xe175('0x52'),_0xe175('0x53')],squel[_0xe175('0x6f')]()[_0xe175('0x70')](_0xe175('0x6b'),_0xe175('0x6b'))[_0xe175('0x70')](_0xe175('0x71'),_0xe175('0x6c'))[_0xe175('0x70')]('id',_0xe175('0x6d'))[_0xe175('0x70')](_0xc1c537[_0xe175('0x72')][_0xe175('0x73')](),_0xe175('0x6e'))[_0xe175('0x70')](_0x32e5de[_0xe175('0x47')]['id'][_0xe175('0x73')](),_0xe175('0x5a'))[_0xe175('0x70')](_0xe175('0x71'),_0xe175('0x52'))[_0xe175('0x70')]('NOW()',_0xe175('0x53'))['from'](_0xe175('0x74'))[_0xe175('0x3c')](_0xe175('0x75'))[_0xe175('0x3c')]('ListId\x20=\x20?',_0xc1c537[_0xe175('0x72')]['toString']())[_0xe175('0x3c')](_0xe175('0x76'))[_0xe175('0x3c')](_0xe175('0x77'),squel[_0xe175('0x6f')]()[_0xe175('0x70')](_0xe175('0x78'))[_0xe175('0x79')](_0xe175('0x7a'))[_0xe175('0x3c')]('CampaignId\x20=\x20?',_0x32e5de[_0xe175('0x47')]['id'][_0xe175('0x73')]()))[_0xe175('0x3c')](_0xe175('0x77'),squel[_0xe175('0x6f')]()[_0xe175('0x70')](_0xe175('0x7b'))[_0xe175('0x79')]('cm_hopper')[_0xe175('0x3c')]('CampaignId\x20=\x20?',_0x32e5de[_0xe175('0x47')]['id'][_0xe175('0x73')]())))[_0xe175('0x73')]();break;case _0xe175('0x7c'):_0x2429a3=squel[_0xe175('0x7d')]()[_0xe175('0x69')](_0xe175('0x6a'))['fromQuery']([_0xe175('0x6b'),_0xe175('0x6c'),_0xe175('0x6d'),'ListId',_0xe175('0x5a'),'createdAt',_0xe175('0x53')],squel[_0xe175('0x6f')]()[_0xe175('0x70')](_0xe175('0x6b'),_0xe175('0x6b'))[_0xe175('0x70')](_0xe175('0x71'),_0xe175('0x6c'))['field']('id',_0xe175('0x6d'))[_0xe175('0x70')](_0xc1c537[_0xe175('0x72')]['toString'](),_0xe175('0x6e'))[_0xe175('0x70')](_0x32e5de[_0xe175('0x47')]['id'][_0xe175('0x73')](),_0xe175('0x5a'))[_0xe175('0x70')]('NOW()',_0xe175('0x52'))[_0xe175('0x70')]('NOW()',_0xe175('0x53'))[_0xe175('0x79')](_0xe175('0x74'))[_0xe175('0x3c')](_0xe175('0x75'))[_0xe175('0x3c')]('ListId\x20=\x20?',_0xc1c537[_0xe175('0x72')][_0xe175('0x73')]())[_0xe175('0x3c')](_0xe175('0x76'))[_0xe175('0x3c')](_0xe175('0x77'),squel[_0xe175('0x6f')]()[_0xe175('0x70')]('COALESCE(phone,\x27\x27)')[_0xe175('0x79')](_0xe175('0x6a'))[_0xe175('0x3c')]('CampaignId\x20=\x20?',_0x32e5de['params']['id']['toString']())))['toString']();break;default:_0x2429a3=squel[_0xe175('0x7d')]()[_0xe175('0x69')]('cm_hopper')[_0xe175('0x7e')]([_0xe175('0x6b'),_0xe175('0x6c'),_0xe175('0x6d'),_0xe175('0x6e'),_0xe175('0x5a'),_0xe175('0x52'),_0xe175('0x53')],squel['select']()[_0xe175('0x70')](_0xe175('0x6b'),'phone')[_0xe175('0x70')](_0xe175('0x71'),_0xe175('0x6c'))[_0xe175('0x70')]('id',_0xe175('0x6d'))[_0xe175('0x70')](_0xc1c537[_0xe175('0x72')][_0xe175('0x73')](),_0xe175('0x6e'))['field'](_0x32e5de[_0xe175('0x47')]['id'][_0xe175('0x73')](),'CampaignId')[_0xe175('0x70')](_0xe175('0x71'),'createdAt')[_0xe175('0x70')](_0xe175('0x71'),_0xe175('0x53'))['from'](_0xe175('0x74'))[_0xe175('0x3c')](_0xe175('0x75'))['where']('ListId\x20=\x20?',_0xc1c537['CmListId']['toString']())[_0xe175('0x3c')](_0xe175('0x76')))['toString']();}_0x1f6dbb[_0xe175('0x7f')](db[_0xe175('0x80')][_0xe175('0x31')](_0x2429a3));}return BPromise[_0xe175('0x81')](_0x1f6dbb);}})['then'](function(){return _0x245158;})[_0xe175('0x22')](respondWithResult(_0x405003,null))[_0xe175('0x50')](handleError(_0x405003,null));};exports[_0xe175('0x82')]=function(_0x43341a,_0x102b07,_0x14211c){return db[_0xe175('0x2d')][_0xe175('0x48')]({'where':{'id':_0x43341a[_0xe175('0x47')]['id']}})['then'](handleEntityNotFound(_0x102b07,null))['then'](function(_0x4031b8){if(_0x4031b8){return _0x4031b8[_0xe175('0x82')](_0x43341a['query'][_0xe175('0x65')]);}})['then'](function(_0x1ae6dc){if(_0x1ae6dc){return db[_0xe175('0x59')][_0xe175('0x23')]({'where':{'ListId':_0x43341a[_0xe175('0x31')][_0xe175('0x65')],'CampaignId':_0x43341a[_0xe175('0x47')]['id']}})[_0xe175('0x22')](function(){return _0x1ae6dc;});}})['then'](respondWithStatusCode(_0x102b07,null))['catch'](handleError(_0x102b07,null));};exports['getBlackLists']=function(_0x36a952,_0x1c8bc2,_0x23c556){var _0x922c3f={'raw':!![],'where':{}};var _0x571272={};var _0x21ebf5={'count':0x0,'rows':[]};return db[_0xe175('0x2d')]['findOne']({'where':{'id':_0x36a952[_0xe175('0x47')]['id']}})[_0xe175('0x22')](handleEntityNotFound(_0x1c8bc2,null))[_0xe175('0x22')](function(_0x2083a3){if(_0x2083a3){_0x571272[_0xe175('0x2f')]=_[_0xe175('0x30')](db['CmList'][_0xe175('0x2e')]);_0x571272[_0xe175('0x31')]=_['keys'](_0x36a952[_0xe175('0x31')]);_0x571272[_0xe175('0x32')]=_[_0xe175('0x33')](_0x571272[_0xe175('0x2f')],_0x571272[_0xe175('0x31')]);_0x922c3f[_0xe175('0x34')]=_[_0xe175('0x33')](_0x571272[_0xe175('0x2f')],qs[_0xe175('0x35')](_0x36a952[_0xe175('0x31')][_0xe175('0x35')]));_0x922c3f['attributes']=_0x922c3f[_0xe175('0x34')][_0xe175('0x36')]?_0x922c3f[_0xe175('0x34')]:_0x571272[_0xe175('0x2f')];if(!_0x36a952[_0xe175('0x31')][_0xe175('0x37')]('nolimit')){_0x922c3f['limit']=qs[_0xe175('0x39')](_0x36a952[_0xe175('0x31')][_0xe175('0x39')]);_0x922c3f['offset']=qs['offset'](_0x36a952[_0xe175('0x31')][_0xe175('0x1c')]);}_0x922c3f[_0xe175('0x3a')]=qs['sort'](_0x36a952['query'][_0xe175('0x3b')]);_0x922c3f[_0xe175('0x3c')]=qs[_0xe175('0x32')](_[_0xe175('0x3d')](_0x36a952[_0xe175('0x31')],_0x571272[_0xe175('0x32')]));_0x922c3f[_0xe175('0x3c')][_0xe175('0x5a')]=_0x2083a3['id'];if(_0x36a952[_0xe175('0x31')][_0xe175('0x5b')]){_0x922c3f[_0xe175('0x3c')]=_[_0xe175('0x41')](_0x922c3f[_0xe175('0x3c')],{'$or':_[_0xe175('0x3e')](_0x922c3f[_0xe175('0x34')],function(_0x15908f){var _0x595e51={};_0x595e51[_0x15908f]={'$like':'%'+_0x36a952[_0xe175('0x31')][_0xe175('0x5b')]+'%'};return _0x595e51;})});}_0x922c3f=_['merge']({},_0x922c3f,_0x36a952[_0xe175('0x42')]);return db[_0xe175('0x63')][_0xe175('0x1b')]({'where':_0x922c3f['where']})[_0xe175('0x22')](function(_0x1d7359){_0x21ebf5[_0xe175('0x1b')]=_0x1d7359;if(_0x36a952['query'][_0xe175('0x43')]){_0x922c3f['include']=[{'all':!![]}];}return db[_0xe175('0x63')][_0xe175('0x5c')](_0x922c3f);})[_0xe175('0x22')](function(_0x4fbb9e){_0x21ebf5['rows']=_0x4fbb9e;return _0x21ebf5;});}})[_0xe175('0x22')](respondWithFilteredResult(_0x1c8bc2,_0x922c3f))[_0xe175('0x50')](handleError(_0x1c8bc2,null));};exports['addBlackLists']=function(_0x373b64,_0x2a10e6,_0x58c11a){var _0x28bae9,_0xa77f00;return db[_0xe175('0x2d')][_0xe175('0x48')]({'where':{'id':_0x373b64[_0xe175('0x47')]['id']}})[_0xe175('0x22')](handleEntityNotFound(_0x2a10e6,null))['then'](function(_0x4e0d0d){if(_0x4e0d0d){_0xa77f00=_0x4e0d0d;return _0x4e0d0d[_0xe175('0x83')](_0x373b64[_0xe175('0x4a')][_0xe175('0x65')],_[_0xe175('0x54')](_0x373b64['body'],['ids','id'])||{});}return null;})[_0xe175('0x66')](function(_0x5ec8d9){var _0x34f204;_0x28bae9=_0x5ec8d9||[];var _0x51d6bb=[];if(_0x5ec8d9){for(var _0x42e1c5=0x0;_0x42e1c5<_0x5ec8d9[_0xe175('0x36')];_0x42e1c5+=0x1){var _0x4cc609=_0x5ec8d9[_0x42e1c5][_0xe175('0x24')]({'plain':!![]});_0x34f204=squel['insert']()[_0xe175('0x69')](_0xe175('0x84'))[_0xe175('0x7e')]([_0xe175('0x6b'),_0xe175('0x6d'),_0xe175('0x6e'),_0xe175('0x5a'),_0xe175('0x52'),'updatedAt'],squel['select']()[_0xe175('0x70')](_0xe175('0x6b'),_0xe175('0x6b'))[_0xe175('0x70')]('id',_0xe175('0x6d'))[_0xe175('0x70')](_0x4cc609[_0xe175('0x72')]['toString'](),'ListId')[_0xe175('0x70')](_0x373b64['params']['id']['toString'](),_0xe175('0x5a'))['field'](_0xe175('0x71'),_0xe175('0x52'))[_0xe175('0x70')](_0xe175('0x71'),_0xe175('0x53'))[_0xe175('0x79')](_0xe175('0x74'))[_0xe175('0x3c')](_0xe175('0x75'))[_0xe175('0x3c')](_0xe175('0x85'),_0x4cc609[_0xe175('0x72')][_0xe175('0x73')]())[_0xe175('0x3c')](_0xe175('0x76')))[_0xe175('0x73')]();_0x51d6bb[_0xe175('0x7f')](db[_0xe175('0x80')][_0xe175('0x31')](_0x34f204));}return BPromise[_0xe175('0x81')](_0x51d6bb);}})[_0xe175('0x22')](function(){return _0x28bae9;})[_0xe175('0x22')](respondWithResult(_0x2a10e6,null))['catch'](handleError(_0x2a10e6,null));};exports[_0xe175('0x86')]=function(_0x57a0de,_0x575ba6,_0x5497e6){return db['Campaign'][_0xe175('0x48')]({'where':{'id':_0x57a0de['params']['id']}})[_0xe175('0x22')](handleEntityNotFound(_0x575ba6,null))['then'](function(_0x26ce17){if(_0x26ce17){return _0x26ce17['removeBlackLists'](_0x57a0de[_0xe175('0x31')][_0xe175('0x65')]);}})[_0xe175('0x22')](function(_0x1aaf16){if(_0x1aaf16){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x57a0de[_0xe175('0x31')][_0xe175('0x65')],'CampaignId':_0x57a0de[_0xe175('0x47')]['id']}})[_0xe175('0x22')](function(){return _0x1aaf16;});}})[_0xe175('0x22')](respondWithStatusCode(_0x575ba6,null))[_0xe175('0x50')](handleError(_0x575ba6,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index c28511f..659efb4 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 _0xfcb6=['../../config/logger','api','moment','request-promise','path','../../config/environment','./campaign.attributes','exports','define','Campaign','campaigns','lodash'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xfcb6,0xa7));var _0x6fcb=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0xfcb6[_0x2caaef];return _0xd011f8;};'use strict';var _=require(_0x6fcb('0x0'));var util=require('util');var logger=require(_0x6fcb('0x1'))(_0x6fcb('0x2'));var moment=require(_0x6fcb('0x3'));var BPromise=require('bluebird');var rp=require(_0x6fcb('0x4'));var fs=require('fs');var path=require(_0x6fcb('0x5'));var rimraf=require('rimraf');var config=require(_0x6fcb('0x6'));var attributes=require(_0x6fcb('0x7'));module[_0x6fcb('0x8')]=function(_0x1b5f17,_0x956bdf){return _0x1b5f17[_0x6fcb('0x9')](_0x6fcb('0xa'),attributes,{'tableName':_0x6fcb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf06d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./campaign.attributes'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xf06d,0xfc));var _0xdf06=function(_0x18afb5,_0x9f0654){_0x18afb5=_0x18afb5-0x0;var _0x2c5a6b=_0xf06d[_0x18afb5];return _0x2c5a6b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdf06('0x0'))(_0xdf06('0x1'));var moment=require(_0xdf06('0x2'));var BPromise=require(_0xdf06('0x3'));var rp=require(_0xdf06('0x4'));var fs=require('fs');var path=require(_0xdf06('0x5'));var rimraf=require(_0xdf06('0x6'));var config=require(_0xdf06('0x7'));var attributes=require(_0xdf06('0x8'));module['exports']=function(_0x50ff44,_0x34a1af){return _0x50ff44['define']('Campaign',attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index e5ba7fb..03e54a4 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 _0x0d74=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','Campaign,\x20%s,\x20%s','info','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment'];(function(_0x35c2ba,_0x6de538){var _0x434b21=function(_0x5da562){while(--_0x5da562){_0x35c2ba['push'](_0x35c2ba['shift']());}};_0x434b21(++_0x6de538);}(_0x0d74,0x15d));var _0x40d7=function(_0x1acf22,_0x52c719){_0x1acf22=_0x1acf22-0x0;var _0x362e9e=_0x0d74[_0x1acf22];return _0x362e9e;};'use strict';var _=require(_0x40d7('0x0'));var util=require(_0x40d7('0x1'));var moment=require(_0x40d7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40d7('0x3'));var db=require(_0x40d7('0x4'))['db'];var utils=require(_0x40d7('0x5'));var logger=require(_0x40d7('0x6'))(_0x40d7('0x7'));var config=require(_0x40d7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x40d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e7a7d,_0x6ce9f9,_0x269657){return new BPromise(function(_0x48aed7,_0x4a1ff6){return client[_0x40d7('0xa')](_0x1e7a7d,_0x269657)[_0x40d7('0xb')](function(_0x309cdb){logger['info']('Campaign,\x20%s,\x20%s',_0x6ce9f9,_0x40d7('0xc'));logger[_0x40d7('0xd')](_0x40d7('0xe'),_0x6ce9f9,_0x40d7('0xc'),JSON['stringify'](_0x309cdb));if(_0x309cdb[_0x40d7('0xf')]){if(_0x309cdb[_0x40d7('0xf')][_0x40d7('0x10')]===0x1f4){logger[_0x40d7('0xf')]('Campaign,\x20%s,\x20%s',_0x6ce9f9,_0x309cdb[_0x40d7('0xf')]['message']);return _0x4a1ff6(_0x309cdb['error'][_0x40d7('0x11')]);}logger[_0x40d7('0xf')](_0x40d7('0x12'),_0x6ce9f9,_0x309cdb[_0x40d7('0xf')][_0x40d7('0x11')]);return _0x48aed7(_0x309cdb[_0x40d7('0xf')][_0x40d7('0x11')]);}else{logger[_0x40d7('0x13')]('Campaign,\x20%s,\x20%s',_0x6ce9f9,_0x40d7('0xc'));_0x48aed7(_0x309cdb['result'][_0x40d7('0x11')]);}})[_0x40d7('0x14')](function(_0x359656){logger[_0x40d7('0xf')](_0x40d7('0x12'),_0x6ce9f9,_0x359656);_0x4a1ff6(_0x359656);});});}exports[_0x40d7('0x15')]=function(_0x4faf1c){var _0x576d9d=this;return new Promise(function(_0x1fcb3d,_0x127d5f){return db[_0x40d7('0x16')][_0x40d7('0x17')]({'raw':_0x4faf1c[_0x40d7('0x18')]?_0x4faf1c[_0x40d7('0x18')][_0x40d7('0x19')]===undefined?!![]:![]:!![],'where':_0x4faf1c['options']?_0x4faf1c[_0x40d7('0x18')][_0x40d7('0x1a')]||null:null,'attributes':_0x4faf1c[_0x40d7('0x18')]?_0x4faf1c[_0x40d7('0x18')][_0x40d7('0x1b')]||null:null,'limit':_0x4faf1c['options']?_0x4faf1c['options'][_0x40d7('0x1c')]||null:null,'include':_0x4faf1c[_0x40d7('0x18')]?_0x4faf1c[_0x40d7('0x18')][_0x40d7('0x1d')]?_[_0x40d7('0x1e')](_0x4faf1c[_0x40d7('0x18')][_0x40d7('0x1d')],function(_0x5753d2){return{'model':db[_0x5753d2['model']],'as':_0x5753d2['as'],'attributes':_0x5753d2[_0x40d7('0x1b')],'include':_0x5753d2['include']?_[_0x40d7('0x1e')](_0x5753d2[_0x40d7('0x1d')],function(_0x35c517){return{'model':db[_0x35c517[_0x40d7('0x1f')]],'as':_0x35c517['as'],'attributes':_0x35c517[_0x40d7('0x1b')],'include':_0x35c517['include']?_['map'](_0x35c517[_0x40d7('0x1d')],function(_0x50e899){return{'model':db[_0x50e899[_0x40d7('0x1f')]],'as':_0x50e899['as'],'attributes':_0x50e899[_0x40d7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x40d7('0xb')](function(_0x38369a){logger[_0x40d7('0x13')](_0x40d7('0x15'),_0x4faf1c);logger['debug']('GetCampaign',_0x4faf1c,JSON['stringify'](_0x38369a));_0x1fcb3d(_0x38369a);})['catch'](function(_0x209b58){logger[_0x40d7('0xf')](_0x40d7('0x15'),_0x209b58[_0x40d7('0x11')],_0x4faf1c);_0x127d5f(_0x576d9d[_0x40d7('0xf')](0x1f4,_0x209b58[_0x40d7('0x11')]));});});};
\ No newline at end of file
+var _0xe054=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCampaign','options','raw','limit','include','map','model','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x32adaa,_0x4334fe){var _0x5b7fa9=function(_0x1bf3ce){while(--_0x1bf3ce){_0x32adaa['push'](_0x32adaa['shift']());}};_0x5b7fa9(++_0x4334fe);}(_0xe054,0x79));var _0x4e05=function(_0x1f43f4,_0x16d500){_0x1f43f4=_0x1f43f4-0x0;var _0x5435b7=_0xe054[_0x1f43f4];return _0x5435b7;};'use strict';var _=require(_0x4e05('0x0'));var util=require(_0x4e05('0x1'));var moment=require(_0x4e05('0x2'));var BPromise=require(_0x4e05('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e05('0x4'));var db=require(_0x4e05('0x5'))['db'];var utils=require(_0x4e05('0x6'));var logger=require(_0x4e05('0x7'))(_0x4e05('0x8'));var config=require(_0x4e05('0x9'));var jayson=require(_0x4e05('0xa'));var client=jayson[_0x4e05('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf3718a,_0x3ccf9b,_0x5acaed){return new BPromise(function(_0x50fc66,_0x25918f){return client['request'](_0xf3718a,_0x5acaed)[_0x4e05('0xc')](function(_0x1913e9){logger[_0x4e05('0xd')](_0x4e05('0xe'),_0x3ccf9b,'request\x20sent');logger[_0x4e05('0xf')](_0x4e05('0x10'),_0x3ccf9b,_0x4e05('0x11'),JSON[_0x4e05('0x12')](_0x1913e9));if(_0x1913e9[_0x4e05('0x13')]){if(_0x1913e9[_0x4e05('0x13')][_0x4e05('0x14')]===0x1f4){logger[_0x4e05('0x13')](_0x4e05('0xe'),_0x3ccf9b,_0x1913e9[_0x4e05('0x13')][_0x4e05('0x15')]);return _0x25918f(_0x1913e9[_0x4e05('0x13')][_0x4e05('0x15')]);}logger[_0x4e05('0x13')](_0x4e05('0xe'),_0x3ccf9b,_0x1913e9[_0x4e05('0x13')][_0x4e05('0x15')]);return _0x50fc66(_0x1913e9[_0x4e05('0x13')]['message']);}else{logger[_0x4e05('0xd')](_0x4e05('0xe'),_0x3ccf9b,_0x4e05('0x11'));_0x50fc66(_0x1913e9[_0x4e05('0x16')][_0x4e05('0x15')]);}})[_0x4e05('0x17')](function(_0x3efb81){logger[_0x4e05('0x13')](_0x4e05('0xe'),_0x3ccf9b,_0x3efb81);_0x25918f(_0x3efb81);});});}exports[_0x4e05('0x18')]=function(_0x29976b){var _0x1e7d49=this;return new Promise(function(_0x6bd89d,_0x51d1c8){return db['Campaign']['findAll']({'raw':_0x29976b['options']?_0x29976b[_0x4e05('0x19')][_0x4e05('0x1a')]===undefined?!![]:![]:!![],'where':_0x29976b[_0x4e05('0x19')]?_0x29976b['options']['where']||null:null,'attributes':_0x29976b[_0x4e05('0x19')]?_0x29976b[_0x4e05('0x19')]['attributes']||null:null,'limit':_0x29976b['options']?_0x29976b[_0x4e05('0x19')][_0x4e05('0x1b')]||null:null,'include':_0x29976b[_0x4e05('0x19')]?_0x29976b[_0x4e05('0x19')][_0x4e05('0x1c')]?_[_0x4e05('0x1d')](_0x29976b[_0x4e05('0x19')][_0x4e05('0x1c')],function(_0x25fd39){return{'model':db[_0x25fd39[_0x4e05('0x1e')]],'as':_0x25fd39['as'],'attributes':_0x25fd39[_0x4e05('0x1f')],'include':_0x25fd39[_0x4e05('0x1c')]?_[_0x4e05('0x1d')](_0x25fd39[_0x4e05('0x1c')],function(_0x110189){return{'model':db[_0x110189[_0x4e05('0x1e')]],'as':_0x110189['as'],'attributes':_0x110189[_0x4e05('0x1f')],'include':_0x110189[_0x4e05('0x1c')]?_['map'](_0x110189[_0x4e05('0x1c')],function(_0x58f668){return{'model':db[_0x58f668['model']],'as':_0x58f668['as'],'attributes':_0x58f668[_0x4e05('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4e05('0xc')](function(_0x49677b){logger[_0x4e05('0xd')](_0x4e05('0x18'),_0x29976b);logger[_0x4e05('0xf')](_0x4e05('0x18'),_0x29976b,JSON[_0x4e05('0x12')](_0x49677b));_0x6bd89d(_0x49677b);})[_0x4e05('0x17')](function(_0x203b24){logger['error'](_0x4e05('0x18'),_0x203b24[_0x4e05('0x15')],_0x29976b);_0x51d1c8(_0x1e7d49[_0x4e05('0x13')](0x1f4,_0x203b24[_0x4e05('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 5257651..3bf88fc 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 _0x1117=['destroy','removeLists','removeBlackLists','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id/hoppers','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','/:id','delete'];(function(_0x1296fe,_0x329852){var _0x10466e=function(_0x2b4b4d){while(--_0x2b4b4d){_0x1296fe['push'](_0x1296fe['shift']());}};_0x10466e(++_0x329852);}(_0x1117,0x143));var _0x7111=function(_0x2feffe,_0x104382){_0x2feffe=_0x2feffe-0x0;var _0x190bb3=_0x1117[_0x2feffe];return _0x190bb3;};'use strict';var multer=require(_0x7111('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7111('0x1'));var express=require(_0x7111('0x2'));var router=express[_0x7111('0x3')]();var auth=require(_0x7111('0x4'));var interaction=require(_0x7111('0x5'));var config=require('../../config/environment');var controller=require(_0x7111('0x6'));router['get']('/',auth[_0x7111('0x7')](),controller[_0x7111('0x8')]);router['get']('/:id',auth[_0x7111('0x7')](),controller['show']);router[_0x7111('0x9')](_0x7111('0xa'),auth[_0x7111('0x7')](),controller['getHoppers']);router[_0x7111('0x9')]('/:id/hopper_histories',auth[_0x7111('0x7')](),controller['getHopperHistories']);router[_0x7111('0x9')]('/:id/hopper_finals',auth[_0x7111('0x7')](),controller['getHopperFinals']);router[_0x7111('0x9')]('/:id/hopper_black',auth[_0x7111('0x7')](),controller[_0x7111('0xb')]);router[_0x7111('0x9')](_0x7111('0xc'),auth['isAuthenticated'](),controller[_0x7111('0xd')]);router[_0x7111('0x9')]('/:id/blacklists',auth[_0x7111('0x7')](),controller[_0x7111('0xe')]);router[_0x7111('0xf')]('/',auth[_0x7111('0x7')](),controller[_0x7111('0x10')]);router[_0x7111('0xf')](_0x7111('0x11'),auth[_0x7111('0x7')](),controller[_0x7111('0x12')]);router['post']('/:id/lists',auth[_0x7111('0x7')](),controller[_0x7111('0x13')]);router[_0x7111('0xf')](_0x7111('0x14'),auth[_0x7111('0x7')](),controller[_0x7111('0x15')]);router[_0x7111('0x16')](_0x7111('0x17'),auth[_0x7111('0x7')](),controller['update']);router[_0x7111('0x18')](_0x7111('0x17'),auth[_0x7111('0x7')](),controller[_0x7111('0x19')]);router[_0x7111('0x18')](_0x7111('0xc'),auth['isAuthenticated'](),controller[_0x7111('0x1a')]);router[_0x7111('0x18')](_0x7111('0x14'),auth[_0x7111('0x7')](),controller[_0x7111('0x1b')]);module[_0x7111('0x1c')]=router;
\ No newline at end of file
+var _0x88ae=['getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','update','destroy','delete','removeLists','removeBlackLists','multer','path','connect-timeout','Router','../../components/auth/service','get','index','/:id','isAuthenticated','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x27d147,_0x5af07c){var _0x1434a6=function(_0x4a3980){while(--_0x4a3980){_0x27d147['push'](_0x27d147['shift']());}};_0x1434a6(++_0x5af07c);}(_0x88ae,0xd2));var _0xe88a=function(_0x398f84,_0x2acdc2){_0x398f84=_0x398f84-0x0;var _0x3b9c80=_0x88ae[_0x398f84];return _0x3b9c80;};'use strict';var multer=require(_0xe88a('0x0'));var util=require('util');var path=require(_0xe88a('0x1'));var timeout=require(_0xe88a('0x2'));var express=require('express');var router=express[_0xe88a('0x3')]();var auth=require(_0xe88a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xe88a('0x5')]('/',auth['isAuthenticated'](),controller[_0xe88a('0x6')]);router[_0xe88a('0x5')](_0xe88a('0x7'),auth[_0xe88a('0x8')](),controller[_0xe88a('0x9')]);router[_0xe88a('0x5')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0xe88a('0x5')](_0xe88a('0xa'),auth['isAuthenticated'](),controller[_0xe88a('0xb')]);router[_0xe88a('0x5')](_0xe88a('0xc'),auth[_0xe88a('0x8')](),controller[_0xe88a('0xd')]);router[_0xe88a('0x5')]('/:id/hopper_black',auth[_0xe88a('0x8')](),controller[_0xe88a('0xe')]);router[_0xe88a('0x5')](_0xe88a('0xf'),auth[_0xe88a('0x8')](),controller['getLists']);router[_0xe88a('0x5')](_0xe88a('0x10'),auth[_0xe88a('0x8')](),controller[_0xe88a('0x11')]);router['post']('/',auth[_0xe88a('0x8')](),controller['create']);router[_0xe88a('0x12')](_0xe88a('0x13'),auth['isAuthenticated'](),controller[_0xe88a('0x14')]);router['post'](_0xe88a('0xf'),auth[_0xe88a('0x8')](),controller[_0xe88a('0x15')]);router[_0xe88a('0x12')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xe88a('0x16')]);router['put'](_0xe88a('0x7'),auth['isAuthenticated'](),controller[_0xe88a('0x17')]);router['delete'](_0xe88a('0x7'),auth[_0xe88a('0x8')](),controller[_0xe88a('0x18')]);router[_0xe88a('0x19')](_0xe88a('0xf'),auth[_0xe88a('0x8')](),controller[_0xe88a('0x1a')]);router[_0xe88a('0x19')](_0xe88a('0x10'),auth['isAuthenticated'](),controller[_0xe88a('0x1b')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 5069dcb..41523af 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 _0x0e04=['STRING','VIRTUAL','getDataValue','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0e04,0x111));var _0x40e0=function(_0x1059e5,_0x455c2e){_0x1059e5=_0x1059e5-0x0;var _0x512fad=_0x0e04[_0x1059e5];return _0x512fad;};'use strict';var Sequelize=require(_0x40e0('0x0'));module[_0x40e0('0x1')]={'key':{'type':Sequelize[_0x40e0('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x40e0('0x2')]},'name':{'type':Sequelize[_0x40e0('0x3')],'get':function(){return this[_0x40e0('0x4')]('key');}}};
\ No newline at end of file
+var _0x9a74=['getDataValue','sequelize','STRING','TEXT'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x9a74,0x9d));var _0x49a7=function(_0x1c3b48,_0x545028){_0x1c3b48=_0x1c3b48-0x0;var _0x2e3466=_0x9a74[_0x1c3b48];return _0x2e3466;};'use strict';var Sequelize=require(_0x49a7('0x0'));module['exports']={'key':{'type':Sequelize[_0x49a7('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x49a7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x49a7('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49a7('0x3')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index a04de8c..76e104f 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 _0x4434=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','CannedAnswers','UserProfileResource','stack','name','send','index','CannedAnswer','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','key','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x370b4d,_0x54e291){var _0x22a295=function(_0x4c8307){while(--_0x4c8307){_0x370b4d['push'](_0x370b4d['shift']());}};_0x22a295(++_0x54e291);}(_0x4434,0x1ae));var _0x4443=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4434[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x4443('0x0'));var emlformat=require(_0x4443('0x1'));var rimraf=require(_0x4443('0x2'));var zipdir=require(_0x4443('0x3'));var jsonpatch=require(_0x4443('0x4'));var rp=require(_0x4443('0x5'));var moment=require(_0x4443('0x6'));var BPromise=require(_0x4443('0x7'));var Mustache=require(_0x4443('0x8'));var util=require(_0x4443('0x9'));var path=require(_0x4443('0xa'));var sox=require(_0x4443('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4443('0xc'));var squel=require('squel');var crypto=require(_0x4443('0xd'));var jsforce=require(_0x4443('0xe'));var deskjs=require(_0x4443('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4443('0x10'));var Papa=require(_0x4443('0x11'));var Redis=require(_0x4443('0x12'));var authService=require(_0x4443('0x13'));var qs=require(_0x4443('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4443('0x15'))(_0x4443('0x16'));var utils=require(_0x4443('0x17'));var config=require('../../config/environment');var db=require(_0x4443('0x18'))['db'];function respondWithStatusCode(_0x365c15,_0x320da7){_0x320da7=_0x320da7||0xcc;return function(_0x31bef8){if(_0x31bef8){return _0x365c15[_0x4443('0x19')](_0x320da7);}return _0x365c15[_0x4443('0x1a')](_0x320da7)[_0x4443('0x1b')]();};}function respondWithResult(_0x5c40f6,_0x31997f){_0x31997f=_0x31997f||0xc8;return function(_0x2767a4){if(_0x2767a4){return _0x5c40f6[_0x4443('0x1a')](_0x31997f)[_0x4443('0x1c')](_0x2767a4);}};}function respondWithFilteredResult(_0x3a3108,_0xd40953){return function(_0x4d58dc){if(_0x4d58dc){var _0x45f0e1=_0x4d58dc[_0x4443('0x1d')],_0x237571=_0xd40953[_0x4443('0x1e')],_0xb8af0c=_0xd40953[_0x4443('0x1e')]+_0xd40953[_0x4443('0x1f')],_0x4f49e6;if(_0xb8af0c>=_0x45f0e1){_0xb8af0c=_0x45f0e1;_0x4f49e6=0xc8;}else{_0x4f49e6=0xce;}_0x3a3108[_0x4443('0x1a')](_0x4f49e6);return _0x3a3108[_0x4443('0x20')](_0x4443('0x21'),_0x237571+'-'+_0xb8af0c+'/'+_0x45f0e1)[_0x4443('0x1c')](_0x4d58dc);}return null;};}function patchUpdates(_0x293470){return function(_0x580bed){try{jsonpatch[_0x4443('0x22')](_0x580bed,_0x293470,!![]);}catch(_0x392118){return BPromise[_0x4443('0x23')](_0x392118);}return _0x580bed[_0x4443('0x24')]();};}function saveUpdates(_0x49bbb9,_0x29dfa8){return function(_0x310d2a){if(_0x310d2a){return _0x310d2a[_0x4443('0x25')](_0x49bbb9)[_0x4443('0x26')](function(_0x470076){return _0x470076;});}return null;};}function removeEntity(_0x15ded0,_0x528513){return function(_0x4a3c25){if(_0x4a3c25){return _0x4a3c25['destroy']()[_0x4443('0x26')](function(){var _0x54eb06=_0x4a3c25[_0x4443('0x27')]({'plain':!![]});var _0x4fba97=_0x4443('0x28');return db[_0x4443('0x29')]['destroy']({'where':{'type':_0x4fba97,'resourceId':_0x54eb06['id']}})[_0x4443('0x26')](function(){return _0x4a3c25;});})['then'](function(){_0x15ded0['status'](0xcc)[_0x4443('0x1b')]();});}};}function handleEntityNotFound(_0x871cf2,_0x48bc7f){return function(_0xcb89a3){if(!_0xcb89a3){_0x871cf2['sendStatus'](0x194);}return _0xcb89a3;};}function handleError(_0x5021be,_0x1db727){_0x1db727=_0x1db727||0x1f4;return function(_0x5434d5){logger['error'](_0x5434d5[_0x4443('0x2a')]);if(_0x5434d5[_0x4443('0x2b')]){delete _0x5434d5[_0x4443('0x2b')];}_0x5021be['status'](_0x1db727)[_0x4443('0x2c')](_0x5434d5);};}exports[_0x4443('0x2d')]=function(_0xda2db2,_0x5e4706){var _0x3b8bca={},_0x22bcab={},_0x57e85a={'count':0x0,'rows':[]};var _0x41b30d=db[_0x4443('0x2e')]['rawAttributes'];_0x22bcab[_0x4443('0x2f')]=_[_0x4443('0x30')](_0x41b30d);_0x22bcab['query']=_[_0x4443('0x30')](_0xda2db2[_0x4443('0x31')]);_0x22bcab[_0x4443('0x32')]=_['intersection'](_0x22bcab[_0x4443('0x2f')],_0x22bcab[_0x4443('0x31')]);_0x3b8bca['attributes']=_[_0x4443('0x33')](_0x22bcab[_0x4443('0x2f')],qs[_0x4443('0x34')](_0xda2db2[_0x4443('0x31')]['fields']));_0x3b8bca['attributes']=_0x3b8bca[_0x4443('0x35')][_0x4443('0x36')]?_0x3b8bca[_0x4443('0x35')]:_0x22bcab[_0x4443('0x2f')];if(!_0xda2db2['query'][_0x4443('0x37')](_0x4443('0x38'))){_0x3b8bca[_0x4443('0x1f')]=qs[_0x4443('0x1f')](_0xda2db2['query'][_0x4443('0x1f')]);_0x3b8bca[_0x4443('0x1e')]=qs['offset'](_0xda2db2['query'][_0x4443('0x1e')]);}_0x3b8bca[_0x4443('0x39')]=qs[_0x4443('0x3a')](_0xda2db2[_0x4443('0x31')][_0x4443('0x3a')]);_0x3b8bca[_0x4443('0x3b')]=qs[_0x4443('0x32')](_['pick'](_0xda2db2['query'],_0x22bcab[_0x4443('0x32')]));if(_0xda2db2['query'][_0x4443('0x3c')]){_0x3b8bca[_0x4443('0x3b')]=_['merge'](_0x3b8bca[_0x4443('0x3b')],{'$or':_['map'](_0x41b30d,function(_0x404126){if(_0x404126[_0x4443('0x3d')][_0x4443('0x3e')]!=='VIRTUAL'){var _0x484ba8={};_0x484ba8[_0x404126['field']]={'$like':'%'+_0xda2db2[_0x4443('0x31')]['filter']+'%'};return _0x484ba8;}})});}_0x3b8bca=_[_0x4443('0x3f')]({},_0x3b8bca,_0xda2db2[_0x4443('0x40')]);var _0x14d577={'where':_0x3b8bca[_0x4443('0x3b')]};return db[_0x4443('0x2e')][_0x4443('0x1d')](_0x14d577)[_0x4443('0x26')](function(_0x4aa8a6){_0x57e85a[_0x4443('0x1d')]=_0x4aa8a6;if(_0xda2db2[_0x4443('0x31')][_0x4443('0x41')]){_0x3b8bca[_0x4443('0x42')]=[{'all':!![]}];}return db[_0x4443('0x2e')][_0x4443('0x43')](_0x3b8bca);})[_0x4443('0x26')](function(_0x4ff0d1){_0x57e85a[_0x4443('0x44')]=_0x4ff0d1;return _0x57e85a;})['then'](respondWithFilteredResult(_0x5e4706,_0x3b8bca))[_0x4443('0x45')](handleError(_0x5e4706,null));};exports[_0x4443('0x46')]=function(_0x106a4c,_0x48212b){var _0x5b4799={'raw':!![],'where':{'id':_0x106a4c[_0x4443('0x47')]['id']}},_0x4814c1={};_0x4814c1[_0x4443('0x2f')]=_[_0x4443('0x30')](db[_0x4443('0x2e')][_0x4443('0x48')]);_0x4814c1[_0x4443('0x31')]=_[_0x4443('0x30')](_0x106a4c['query']);_0x4814c1[_0x4443('0x32')]=_[_0x4443('0x33')](_0x4814c1['model'],_0x4814c1[_0x4443('0x31')]);_0x5b4799['attributes']=_['intersection'](_0x4814c1['model'],qs[_0x4443('0x34')](_0x106a4c['query'][_0x4443('0x34')]));_0x5b4799['attributes']=_0x5b4799['attributes']['length']?_0x5b4799['attributes']:_0x4814c1[_0x4443('0x2f')];if(_0x106a4c[_0x4443('0x31')]['includeAll']){_0x5b4799[_0x4443('0x42')]=[{'all':!![]}];}_0x5b4799=_[_0x4443('0x3f')]({},_0x5b4799,_0x106a4c['options']);return db[_0x4443('0x2e')][_0x4443('0x49')](_0x5b4799)[_0x4443('0x26')](handleEntityNotFound(_0x48212b,null))[_0x4443('0x26')](respondWithResult(_0x48212b,null))[_0x4443('0x45')](handleError(_0x48212b,null));};exports[_0x4443('0x25')]=function(_0x49453d,_0x597c5d){if(_0x49453d[_0x4443('0x4a')]['id']){delete _0x49453d[_0x4443('0x4a')]['id'];}return db[_0x4443('0x2e')]['find']({'where':{'id':_0x49453d[_0x4443('0x47')]['id']}})['then'](handleEntityNotFound(_0x597c5d,null))[_0x4443('0x26')](saveUpdates(_0x49453d[_0x4443('0x4a')],null))[_0x4443('0x26')](respondWithResult(_0x597c5d,null))['catch'](handleError(_0x597c5d,null));};exports[_0x4443('0x4b')]=function(_0x5cbf77,_0x3f0598){return db[_0x4443('0x2e')][_0x4443('0x49')]({'where':{'id':_0x5cbf77[_0x4443('0x47')]['id']}})[_0x4443('0x26')](handleEntityNotFound(_0x3f0598,null))['then'](removeEntity(_0x3f0598,null))[_0x4443('0x45')](handleError(_0x3f0598,null));};exports[_0x4443('0x4c')]=function(_0x238ffa,_0x4103ad){var _0x1690a8={'key':_0x238ffa[_0x4443('0x4a')][_0x4443('0x3e')]};if(_0x238ffa['body'][_0x4443('0x4d')]){_0x1690a8[_0x4443('0x4d')]=_0x238ffa['body'][_0x4443('0x4d')];}else if(_0x238ffa[_0x4443('0x4a')][_0x4443('0x4e')]){_0x1690a8['SmsAccountId']=_0x238ffa['body'][_0x4443('0x4e')];}else if(_0x238ffa[_0x4443('0x4a')][_0x4443('0x4f')]){_0x1690a8[_0x4443('0x4f')]=_0x238ffa[_0x4443('0x4a')][_0x4443('0x4f')];}else if(_0x238ffa[_0x4443('0x4a')][_0x4443('0x50')]){_0x1690a8[_0x4443('0x50')]=_0x238ffa[_0x4443('0x4a')][_0x4443('0x50')];}return db[_0x4443('0x2e')][_0x4443('0x49')]({'where':_0x1690a8})['then'](function(_0x1aee1f){if(_0x1aee1f){throw new db[(_0x4443('0x51'))][(_0x4443('0x52'))](_0x4443('0x53'));}return db[_0x4443('0x2e')]['create'](_0x238ffa[_0x4443('0x4a')]);})[_0x4443('0x26')](function(_0x3ef584){var _0x5aa5d3=_0x238ffa[_0x4443('0x54')][_0x4443('0x27')]({'plain':!![]});if(!_0x5aa5d3)throw new Error(_0x4443('0x55'));if(_0x5aa5d3['role']===_0x4443('0x54')){var _0x514c1e=_0x3ef584[_0x4443('0x27')]({'plain':!![]});return db[_0x4443('0x56')][_0x4443('0x49')]({'where':{'name':_0x4443('0x28'),'userProfileId':_0x5aa5d3[_0x4443('0x57')]},'raw':!![]})[_0x4443('0x26')](function(_0x597ed9){if(_0x597ed9&&_0x597ed9[_0x4443('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x514c1e['name'],'resourceId':_0x514c1e['id'],'type':_0x597ed9[_0x4443('0x2b')],'sectionId':_0x597ed9['id']},{})[_0x4443('0x26')](function(){return _0x3ef584;});}else{return _0x3ef584;}})[_0x4443('0x45')](function(_0x2cd9d3){logger[_0x4443('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cd9d3);throw _0x2cd9d3;});}return _0x3ef584;})['then'](respondWithResult(_0x4103ad,0xc9))[_0x4443('0x45')](handleError(_0x4103ad,null));};
\ No newline at end of file
+var _0x00b1=['CannedAnswer','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','field','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CannedAnswers','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','path','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','stack','name','send'];(function(_0x7b6c92,_0x441ffa){var _0x1170c9=function(_0x477dc4){while(--_0x477dc4){_0x7b6c92['push'](_0x7b6c92['shift']());}};_0x1170c9(++_0x441ffa);}(_0x00b1,0xda));var _0x100b=function(_0x32cafe,_0x28dfca){_0x32cafe=_0x32cafe-0x0;var _0x3cf9ee=_0x00b1[_0x32cafe];return _0x3cf9ee;};'use strict';var pdf=require(_0x100b('0x0'));var emlformat=require(_0x100b('0x1'));var rimraf=require(_0x100b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x100b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x100b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x100b('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x100b('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x100b('0x7'));var crypto=require(_0x100b('0x8'));var jsforce=require(_0x100b('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x100b('0xa'));var querystring=require(_0x100b('0xb'));var Papa=require(_0x100b('0xc'));var Redis=require(_0x100b('0xd'));var authService=require(_0x100b('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x100b('0xf'));var logger=require(_0x100b('0x10'))(_0x100b('0x11'));var utils=require(_0x100b('0x12'));var config=require(_0x100b('0x13'));var db=require(_0x100b('0x14'))['db'];function respondWithStatusCode(_0x120bcd,_0x1040ef){_0x1040ef=_0x1040ef||0xcc;return function(_0x2ae342){if(_0x2ae342){return _0x120bcd[_0x100b('0x15')](_0x1040ef);}return _0x120bcd[_0x100b('0x16')](_0x1040ef)[_0x100b('0x17')]();};}function respondWithResult(_0x3bf680,_0x853150){_0x853150=_0x853150||0xc8;return function(_0x2f7489){if(_0x2f7489){return _0x3bf680[_0x100b('0x16')](_0x853150)[_0x100b('0x18')](_0x2f7489);}};}function respondWithFilteredResult(_0x993de8,_0x5dd620){return function(_0x4d1d04){if(_0x4d1d04){var _0xd78592=_0x4d1d04[_0x100b('0x19')],_0x530440=_0x5dd620[_0x100b('0x1a')],_0x4be965=_0x5dd620[_0x100b('0x1a')]+_0x5dd620[_0x100b('0x1b')],_0x3114af;if(_0x4be965>=_0xd78592){_0x4be965=_0xd78592;_0x3114af=0xc8;}else{_0x3114af=0xce;}_0x993de8[_0x100b('0x16')](_0x3114af);return _0x993de8[_0x100b('0x1c')](_0x100b('0x1d'),_0x530440+'-'+_0x4be965+'/'+_0xd78592)[_0x100b('0x18')](_0x4d1d04);}return null;};}function patchUpdates(_0x4b066e){return function(_0x1f9340){try{jsonpatch[_0x100b('0x1e')](_0x1f9340,_0x4b066e,!![]);}catch(_0x31b440){return BPromise[_0x100b('0x1f')](_0x31b440);}return _0x1f9340[_0x100b('0x20')]();};}function saveUpdates(_0x36e79b,_0x591f2f){return function(_0x494101){if(_0x494101){return _0x494101['update'](_0x36e79b)['then'](function(_0x50c8d4){return _0x50c8d4;});}return null;};}function removeEntity(_0x596204,_0x50e33a){return function(_0x43bb68){if(_0x43bb68){return _0x43bb68[_0x100b('0x21')]()[_0x100b('0x22')](function(){var _0x56a7b0=_0x43bb68[_0x100b('0x23')]({'plain':!![]});var _0x4a26d6='CannedAnswers';return db[_0x100b('0x24')][_0x100b('0x21')]({'where':{'type':_0x4a26d6,'resourceId':_0x56a7b0['id']}})[_0x100b('0x22')](function(){return _0x43bb68;});})['then'](function(){_0x596204['status'](0xcc)[_0x100b('0x17')]();});}};}function handleEntityNotFound(_0x3621a4,_0x1a92fe){return function(_0x148f91){if(!_0x148f91){_0x3621a4[_0x100b('0x15')](0x194);}return _0x148f91;};}function handleError(_0x460d09,_0xdbd062){_0xdbd062=_0xdbd062||0x1f4;return function(_0x34a1de){logger['error'](_0x34a1de[_0x100b('0x25')]);if(_0x34a1de[_0x100b('0x26')]){delete _0x34a1de[_0x100b('0x26')];}_0x460d09['status'](_0xdbd062)[_0x100b('0x27')](_0x34a1de);};}exports['index']=function(_0x6360c7,_0x4df372){var _0x4c66be={},_0x3a1066={},_0x2d93d9={'count':0x0,'rows':[]};var _0x424eb9=db[_0x100b('0x28')]['rawAttributes'];_0x3a1066[_0x100b('0x29')]=_[_0x100b('0x2a')](_0x424eb9);_0x3a1066[_0x100b('0x2b')]=_[_0x100b('0x2a')](_0x6360c7[_0x100b('0x2b')]);_0x3a1066[_0x100b('0x2c')]=_[_0x100b('0x2d')](_0x3a1066[_0x100b('0x29')],_0x3a1066['query']);_0x4c66be[_0x100b('0x2e')]=_[_0x100b('0x2d')](_0x3a1066['model'],qs[_0x100b('0x2f')](_0x6360c7['query']['fields']));_0x4c66be[_0x100b('0x2e')]=_0x4c66be['attributes']['length']?_0x4c66be[_0x100b('0x2e')]:_0x3a1066[_0x100b('0x29')];if(!_0x6360c7['query'][_0x100b('0x30')](_0x100b('0x31'))){_0x4c66be[_0x100b('0x1b')]=qs[_0x100b('0x1b')](_0x6360c7['query']['limit']);_0x4c66be[_0x100b('0x1a')]=qs[_0x100b('0x1a')](_0x6360c7[_0x100b('0x2b')][_0x100b('0x1a')]);}_0x4c66be[_0x100b('0x32')]=qs[_0x100b('0x33')](_0x6360c7[_0x100b('0x2b')][_0x100b('0x33')]);_0x4c66be[_0x100b('0x34')]=qs[_0x100b('0x2c')](_[_0x100b('0x35')](_0x6360c7[_0x100b('0x2b')],_0x3a1066[_0x100b('0x2c')]));if(_0x6360c7['query']['filter']){_0x4c66be[_0x100b('0x34')]=_[_0x100b('0x36')](_0x4c66be[_0x100b('0x34')],{'$or':_[_0x100b('0x37')](_0x424eb9,function(_0x3cdd07){if(_0x3cdd07['type'][_0x100b('0x38')]!=='VIRTUAL'){var _0x4dc737={};_0x4dc737[_0x3cdd07[_0x100b('0x39')]]={'$like':'%'+_0x6360c7[_0x100b('0x2b')][_0x100b('0x3a')]+'%'};return _0x4dc737;}})});}_0x4c66be=_['merge']({},_0x4c66be,_0x6360c7[_0x100b('0x3b')]);var _0x2b492b={'where':_0x4c66be[_0x100b('0x34')]};return db[_0x100b('0x28')][_0x100b('0x19')](_0x2b492b)[_0x100b('0x22')](function(_0x1b0d65){_0x2d93d9[_0x100b('0x19')]=_0x1b0d65;if(_0x6360c7['query'][_0x100b('0x3c')]){_0x4c66be['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x100b('0x3d')](_0x4c66be);})['then'](function(_0x343c0b){_0x2d93d9[_0x100b('0x3e')]=_0x343c0b;return _0x2d93d9;})[_0x100b('0x22')](respondWithFilteredResult(_0x4df372,_0x4c66be))[_0x100b('0x3f')](handleError(_0x4df372,null));};exports[_0x100b('0x40')]=function(_0x3f8c1b,_0x387ae5){var _0x35f1dd={'raw':!![],'where':{'id':_0x3f8c1b[_0x100b('0x41')]['id']}},_0x4712a6={};_0x4712a6[_0x100b('0x29')]=_[_0x100b('0x2a')](db[_0x100b('0x28')][_0x100b('0x42')]);_0x4712a6[_0x100b('0x2b')]=_[_0x100b('0x2a')](_0x3f8c1b[_0x100b('0x2b')]);_0x4712a6['filters']=_[_0x100b('0x2d')](_0x4712a6[_0x100b('0x29')],_0x4712a6[_0x100b('0x2b')]);_0x35f1dd[_0x100b('0x2e')]=_[_0x100b('0x2d')](_0x4712a6[_0x100b('0x29')],qs[_0x100b('0x2f')](_0x3f8c1b['query'][_0x100b('0x2f')]));_0x35f1dd[_0x100b('0x2e')]=_0x35f1dd[_0x100b('0x2e')]['length']?_0x35f1dd[_0x100b('0x2e')]:_0x4712a6[_0x100b('0x29')];if(_0x3f8c1b[_0x100b('0x2b')]['includeAll']){_0x35f1dd[_0x100b('0x43')]=[{'all':!![]}];}_0x35f1dd=_[_0x100b('0x36')]({},_0x35f1dd,_0x3f8c1b[_0x100b('0x3b')]);return db[_0x100b('0x28')][_0x100b('0x44')](_0x35f1dd)[_0x100b('0x22')](handleEntityNotFound(_0x387ae5,null))[_0x100b('0x22')](respondWithResult(_0x387ae5,null))['catch'](handleError(_0x387ae5,null));};exports[_0x100b('0x45')]=function(_0x3defd3,_0x432a35){if(_0x3defd3['body']['id']){delete _0x3defd3[_0x100b('0x46')]['id'];}return db[_0x100b('0x28')]['find']({'where':{'id':_0x3defd3[_0x100b('0x41')]['id']}})['then'](handleEntityNotFound(_0x432a35,null))[_0x100b('0x22')](saveUpdates(_0x3defd3[_0x100b('0x46')],null))[_0x100b('0x22')](respondWithResult(_0x432a35,null))[_0x100b('0x3f')](handleError(_0x432a35,null));};exports[_0x100b('0x21')]=function(_0x3671b8,_0x20bd33){return db[_0x100b('0x28')]['find']({'where':{'id':_0x3671b8[_0x100b('0x41')]['id']}})[_0x100b('0x22')](handleEntityNotFound(_0x20bd33,null))['then'](removeEntity(_0x20bd33,null))[_0x100b('0x3f')](handleError(_0x20bd33,null));};exports[_0x100b('0x47')]=function(_0x1a7a25,_0x35c7ba){var _0x593a10={'key':_0x1a7a25[_0x100b('0x46')][_0x100b('0x38')]};if(_0x1a7a25['body'][_0x100b('0x48')]){_0x593a10[_0x100b('0x48')]=_0x1a7a25[_0x100b('0x46')][_0x100b('0x48')];}else if(_0x1a7a25[_0x100b('0x46')][_0x100b('0x49')]){_0x593a10[_0x100b('0x49')]=_0x1a7a25['body'][_0x100b('0x49')];}else if(_0x1a7a25['body'][_0x100b('0x4a')]){_0x593a10[_0x100b('0x4a')]=_0x1a7a25['body'][_0x100b('0x4a')];}else if(_0x1a7a25[_0x100b('0x46')][_0x100b('0x4b')]){_0x593a10[_0x100b('0x4b')]=_0x1a7a25[_0x100b('0x46')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x100b('0x44')]({'where':_0x593a10})['then'](function(_0x50a276){if(_0x50a276){throw new db[(_0x100b('0x4c'))][(_0x100b('0x4d'))](_0x100b('0x4e'));}return db[_0x100b('0x28')][_0x100b('0x47')](_0x1a7a25[_0x100b('0x46')]);})[_0x100b('0x22')](function(_0x4dc8b3){var _0x288e35=_0x1a7a25['user'][_0x100b('0x23')]({'plain':!![]});if(!_0x288e35)throw new Error(_0x100b('0x4f'));if(_0x288e35[_0x100b('0x50')]===_0x100b('0x51')){var _0x5d055c=_0x4dc8b3[_0x100b('0x23')]({'plain':!![]});return db['UserProfileSection'][_0x100b('0x44')]({'where':{'name':_0x100b('0x52'),'userProfileId':_0x288e35[_0x100b('0x53')]},'raw':!![]})[_0x100b('0x22')](function(_0x23ca79){if(_0x23ca79&&_0x23ca79['autoAssociation']===0x0){return db[_0x100b('0x24')][_0x100b('0x47')]({'name':_0x5d055c[_0x100b('0x26')],'resourceId':_0x5d055c['id'],'type':_0x23ca79[_0x100b('0x26')],'sectionId':_0x23ca79['id']},{})['then'](function(){return _0x4dc8b3;});}else{return _0x4dc8b3;}})[_0x100b('0x3f')](function(_0x1e60c9){logger[_0x100b('0x54')](_0x100b('0x55'),_0x1e60c9);throw _0x1e60c9;});}return _0x4dc8b3;})[_0x100b('0x22')](respondWithResult(_0x35c7ba,0xc9))[_0x100b('0x3f')](handleError(_0x35c7ba,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index d1b6500..e6cee31 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 _0xab63=['request-promise','path','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','../../config/logger','api','bluebird'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xab63,0x11d));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3ab6('0x0'))(_0x3ab6('0x1'));var moment=require('moment');var BPromise=require(_0x3ab6('0x2'));var rp=require(_0x3ab6('0x3'));var fs=require('fs');var path=require(_0x3ab6('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x3ab6('0x5')]=function(_0x439176,_0x5a9a79){return _0x439176['define'](_0x3ab6('0x6'),attributes,{'tableName':_0x3ab6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3ab6('0x8')});};
\ No newline at end of file
+var _0x92ff=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x4e6558,_0x4cf457){var _0x38c93c=function(_0x19e67d){while(--_0x19e67d){_0x4e6558['push'](_0x4e6558['shift']());}};_0x38c93c(++_0x4cf457);}(_0x92ff,0x1a5));var _0xf92f=function(_0x42661a,_0x45f6f8){_0x42661a=_0x42661a-0x0;var _0xa1091c=_0x92ff[_0x42661a];return _0xa1091c;};'use strict';var _=require(_0xf92f('0x0'));var util=require(_0xf92f('0x1'));var logger=require(_0xf92f('0x2'))(_0xf92f('0x3'));var moment=require(_0xf92f('0x4'));var BPromise=require(_0xf92f('0x5'));var rp=require(_0xf92f('0x6'));var fs=require('fs');var path=require(_0xf92f('0x7'));var rimraf=require(_0xf92f('0x8'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xf92f('0x9')]=function(_0x3de7dd,_0x43e51c){return _0x3de7dd[_0xf92f('0xa')](_0xf92f('0xb'),attributes,{'tableName':_0xf92f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf92f('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index a6bf55c..4add564 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 _0xc4f6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird'];(function(_0x41e346,_0x490e1d){var _0x505ce5=function(_0x5ec27b){while(--_0x5ec27b){_0x41e346['push'](_0x41e346['shift']());}};_0x505ce5(++_0x490e1d);}(_0xc4f6,0x1f1));var _0x6c4f=function(_0x15e65d,_0x17c026){_0x15e65d=_0x15e65d-0x0;var _0x412ce1=_0xc4f6[_0x15e65d];return _0x412ce1;};'use strict';var _=require(_0x6c4f('0x0'));var util=require('util');var moment=require(_0x6c4f('0x1'));var BPromise=require(_0x6c4f('0x2'));var rs=require(_0x6c4f('0x3'));var fs=require('fs');var Redis=require(_0x6c4f('0x4'));var db=require(_0x6c4f('0x5'))['db'];var utils=require(_0x6c4f('0x6'));var logger=require(_0x6c4f('0x7'))(_0x6c4f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6c4f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54d847,_0x24f264,_0x47a128){return new BPromise(function(_0x44b533,_0x2e5415){return client[_0x6c4f('0xa')](_0x54d847,_0x47a128)['then'](function(_0x1c8ebe){logger[_0x6c4f('0xb')](_0x6c4f('0xc'),_0x24f264,_0x6c4f('0xd'));logger[_0x6c4f('0xe')](_0x6c4f('0xf'),_0x24f264,_0x6c4f('0xd'),JSON['stringify'](_0x1c8ebe));if(_0x1c8ebe[_0x6c4f('0x10')]){if(_0x1c8ebe[_0x6c4f('0x10')]['code']===0x1f4){logger[_0x6c4f('0x10')](_0x6c4f('0xc'),_0x24f264,_0x1c8ebe[_0x6c4f('0x10')]['message']);return _0x2e5415(_0x1c8ebe[_0x6c4f('0x10')]['message']);}logger[_0x6c4f('0x10')](_0x6c4f('0xc'),_0x24f264,_0x1c8ebe[_0x6c4f('0x10')][_0x6c4f('0x11')]);return _0x44b533(_0x1c8ebe[_0x6c4f('0x10')]['message']);}else{logger[_0x6c4f('0xb')](_0x6c4f('0xc'),_0x24f264,_0x6c4f('0xd'));_0x44b533(_0x1c8ebe[_0x6c4f('0x12')][_0x6c4f('0x11')]);}})[_0x6c4f('0x13')](function(_0x13697a){logger['error'](_0x6c4f('0xc'),_0x24f264,_0x13697a);_0x2e5415(_0x13697a);});});}
\ No newline at end of file
+var _0xdb53=['client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x301efb,_0x21fb1d){var _0xf7fbbb=function(_0x50eb48){while(--_0x50eb48){_0x301efb['push'](_0x301efb['shift']());}};_0xf7fbbb(++_0x21fb1d);}(_0xdb53,0x1da));var _0x3db5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdb53[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3db5('0x0'));var BPromise=require(_0x3db5('0x1'));var rs=require(_0x3db5('0x2'));var fs=require('fs');var Redis=require(_0x3db5('0x3'));var db=require(_0x3db5('0x4'))['db'];var utils=require(_0x3db5('0x5'));var logger=require(_0x3db5('0x6'))('rpc');var config=require(_0x3db5('0x7'));var jayson=require(_0x3db5('0x8'));var client=jayson[_0x3db5('0x9')][_0x3db5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56f3db,_0x117b72,_0xd05e1c){return new BPromise(function(_0x4fe175,_0xe502b8){return client[_0x3db5('0xb')](_0x56f3db,_0xd05e1c)[_0x3db5('0xc')](function(_0x539480){logger[_0x3db5('0xd')](_0x3db5('0xe'),_0x117b72,_0x3db5('0xf'));logger['debug'](_0x3db5('0x10'),_0x117b72,_0x3db5('0xf'),JSON[_0x3db5('0x11')](_0x539480));if(_0x539480[_0x3db5('0x12')]){if(_0x539480['error'][_0x3db5('0x13')]===0x1f4){logger['error'](_0x3db5('0xe'),_0x117b72,_0x539480[_0x3db5('0x12')][_0x3db5('0x14')]);return _0xe502b8(_0x539480[_0x3db5('0x12')][_0x3db5('0x14')]);}logger[_0x3db5('0x12')](_0x3db5('0xe'),_0x117b72,_0x539480[_0x3db5('0x12')]['message']);return _0x4fe175(_0x539480[_0x3db5('0x12')]['message']);}else{logger[_0x3db5('0xd')](_0x3db5('0xe'),_0x117b72,_0x3db5('0xf'));_0x4fe175(_0x539480[_0x3db5('0x15')]['message']);}})[_0x3db5('0x16')](function(_0x2794b5){logger['error'](_0x3db5('0xe'),_0x117b72,_0x2794b5);_0xe502b8(_0x2794b5);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 71ce363..44728eb 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 _0x5ebd=['update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','create','put'];(function(_0xb27972,_0x3c8833){var _0x3bd30f=function(_0x1cc3f0){while(--_0x1cc3f0){_0xb27972['push'](_0xb27972['shift']());}};_0x3bd30f(++_0x3c8833);}(_0x5ebd,0x9c));var _0xd5eb=function(_0x217112,_0x142e2e){_0x217112=_0x217112-0x0;var _0xfecf1d=_0x5ebd[_0x217112];return _0xfecf1d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd5eb('0x0'));var timeout=require(_0xd5eb('0x1'));var express=require(_0xd5eb('0x2'));var router=express[_0xd5eb('0x3')]();var auth=require(_0xd5eb('0x4'));var interaction=require(_0xd5eb('0x5'));var config=require(_0xd5eb('0x6'));var controller=require(_0xd5eb('0x7'));router[_0xd5eb('0x8')]('/',auth['isAuthenticated'](),controller[_0xd5eb('0x9')]);router['get'](_0xd5eb('0xa'),auth[_0xd5eb('0xb')](),controller[_0xd5eb('0xc')]);router['post']('/',auth[_0xd5eb('0xb')](),controller[_0xd5eb('0xd')]);router[_0xd5eb('0xe')](_0xd5eb('0xa'),auth[_0xd5eb('0xb')](),controller[_0xd5eb('0xf')]);router[_0xd5eb('0x10')]('/:id',auth[_0xd5eb('0xb')](),controller[_0xd5eb('0x11')]);module[_0xd5eb('0x12')]=router;
\ No newline at end of file
+var _0x44b4=['isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0x44b4,0x171));var _0x444b=function(_0x113764,_0x4a6b6f){_0x113764=_0x113764-0x0;var _0x43080d=_0x44b4[_0x113764];return _0x43080d;};'use strict';var multer=require(_0x444b('0x0'));var util=require('util');var path=require(_0x444b('0x1'));var timeout=require(_0x444b('0x2'));var express=require(_0x444b('0x3'));var router=express[_0x444b('0x4')]();var auth=require(_0x444b('0x5'));var interaction=require(_0x444b('0x6'));var config=require('../../config/environment');var controller=require(_0x444b('0x7'));router[_0x444b('0x8')]('/',auth[_0x444b('0x9')](),controller['index']);router['get'](_0x444b('0xa'),auth[_0x444b('0x9')](),controller[_0x444b('0xb')]);router[_0x444b('0xc')]('/',auth['isAuthenticated'](),controller[_0x444b('0xd')]);router[_0x444b('0xe')](_0x444b('0xa'),auth[_0x444b('0x9')](),controller[_0x444b('0xf')]);router[_0x444b('0x10')](_0x444b('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x444b('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 247e083..21dfb05 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 _0x1419=['sequelize','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1d5abc,_0x392b36){var _0x68a84f=function(_0x2ea647){while(--_0x2ea647){_0x1d5abc['push'](_0x1d5abc['shift']());}};_0x68a84f(++_0x392b36);}(_0x1419,0x180));var _0x9141=function(_0x362516,_0x30aa64){_0x362516=_0x362516-0x0;var _0x26f00c=_0x1419[_0x362516];return _0x26f00c;};'use strict';var Sequelize=require(_0x9141('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x9141('0x1')},'clid':{'type':Sequelize[_0x9141('0x2')]},'src':{'type':Sequelize[_0x9141('0x2')]},'dst':{'type':Sequelize[_0x9141('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9141('0x2')]},'dstchannel':{'type':Sequelize[_0x9141('0x2')]},'lastapp':{'type':Sequelize[_0x9141('0x2')]},'lastdata':{'type':Sequelize[_0x9141('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9141('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9141('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x9141('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9141('0x2')]},'linkedid':{'type':Sequelize[_0x9141('0x2')]},'sequence':{'type':Sequelize[_0x9141('0x2')]},'peeraccount':{'type':Sequelize[_0x9141('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x9141('0x2')]}};
\ No newline at end of file
+var _0xa9fc=['exports','STRING','INTEGER','sequelize'];(function(_0x4e05d8,_0xab2ee9){var _0x356a48=function(_0x161d87){while(--_0x161d87){_0x4e05d8['push'](_0x4e05d8['shift']());}};_0x356a48(++_0xab2ee9);}(_0xa9fc,0x87));var _0xca9f=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0xa9fc[_0x3de873];return _0x380b8c;};'use strict';var Sequelize=require(_0xca9f('0x0'));module[_0xca9f('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xca9f('0x2')]},'src':{'type':Sequelize[_0xca9f('0x2')]},'dst':{'type':Sequelize[_0xca9f('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xca9f('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xca9f('0x2')]},'lastdata':{'type':Sequelize[_0xca9f('0x2')]},'duration':{'type':Sequelize[_0xca9f('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xca9f('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xca9f('0x2')]},'amaflags':{'type':Sequelize[_0xca9f('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xca9f('0x2')]},'userfield':{'type':Sequelize[_0xca9f('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xca9f('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xca9f('0x2')]},'type':{'type':Sequelize[_0xca9f('0x2')]},'tag':{'type':Sequelize[_0xca9f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index ff2b0a0..de526cf 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 _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','Cdr','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','html-pdf'];(function(_0x24c859,_0x4a65e7){var _0xa5e5bd=function(_0x383cb7){while(--_0x383cb7){_0x24c859['push'](_0x24c859['shift']());}};_0xa5e5bd(++_0x4a65e7);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':!![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['Cdr']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['Cdr'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['update']=function(_0x2458cb,_0x3e787d){if(_0x2458cb[_0x7995('0x46')]['id']){delete _0x2458cb['body']['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x2458cb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x3e787d,null))[_0x7995('0x25')](saveUpdates(_0x2458cb['body'],null))[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports['destroy']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x25')](removeEntity(_0x5843ba,null))[_0x7995('0x43')](handleError(_0x5843ba,null));};exports[_0x7995('0x49')]=function(_0x4d46bc,_0x427dcf){return db[_0x7995('0x2a')][_0x7995('0x49')]()['then'](respondWithResult(_0x427dcf,null))[_0x7995('0x43')](handleError(_0x427dcf,null));};
\ No newline at end of file
+var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','Cdr','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','html-pdf'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':!![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['Cdr']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['Cdr'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['update']=function(_0x2458cb,_0x3e787d){if(_0x2458cb[_0x7995('0x46')]['id']){delete _0x2458cb['body']['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x2458cb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x3e787d,null))[_0x7995('0x25')](saveUpdates(_0x2458cb['body'],null))[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports['destroy']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x25')](removeEntity(_0x5843ba,null))[_0x7995('0x43')](handleError(_0x5843ba,null));};exports[_0x7995('0x49')]=function(_0x4d46bc,_0x427dcf){return db[_0x7995('0x2a')][_0x7995('0x49')]()['then'](respondWithResult(_0x427dcf,null))[_0x7995('0x43')](handleError(_0x427dcf,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index d790678..163effd 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 _0x5ac7=['rimraf','../../config/environment','./cdr.attributes','define','cdr','accountcode','disposition','dst','src','uniqueid','lodash','../../config/logger','bluebird','request-promise'];(function(_0x2e9266,_0x1f0e21){var _0x144c3c=function(_0xb39e01){while(--_0xb39e01){_0x2e9266['push'](_0x2e9266['shift']());}};_0x144c3c(++_0x1f0e21);}(_0x5ac7,0xf8));var _0x75ac=function(_0x542acc,_0x2d1d68){_0x542acc=_0x542acc-0x0;var _0x2f9d89=_0x5ac7[_0x542acc];return _0x2f9d89;};'use strict';var _=require(_0x75ac('0x0'));var util=require('util');var logger=require(_0x75ac('0x1'))('api');var moment=require('moment');var BPromise=require(_0x75ac('0x2'));var rp=require(_0x75ac('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75ac('0x4'));var config=require(_0x75ac('0x5'));var attributes=require(_0x75ac('0x6'));module['exports']=function(_0x4b36e4,_0x5047e7){return _0x4b36e4[_0x75ac('0x7')]('Cdr',attributes,{'tableName':_0x75ac('0x8'),'paranoid':![],'indexes':[{'name':_0x75ac('0x9'),'fields':[_0x75ac('0x9')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x75ac('0xa')]},{'name':_0x75ac('0xb'),'fields':[_0x75ac('0xb')]},{'name':_0x75ac('0xc'),'fields':['src']},{'name':_0x75ac('0xd'),'fields':['uniqueid']}],'timestamps':![]});};
\ No newline at end of file
+var _0xfd37=['bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','Cdr','cdr','accountcode','calldate','disposition','uniqueid','lodash','api','moment'];(function(_0x908eb6,_0x59199b){var _0x511a09=function(_0x376c8b){while(--_0x376c8b){_0x908eb6['push'](_0x908eb6['shift']());}};_0x511a09(++_0x59199b);}(_0xfd37,0x9d));var _0x7fd3=function(_0x1733bc,_0x2a6bbb){_0x1733bc=_0x1733bc-0x0;var _0x2884b1=_0xfd37[_0x1733bc];return _0x2884b1;};'use strict';var _=require(_0x7fd3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7fd3('0x1'));var moment=require(_0x7fd3('0x2'));var BPromise=require(_0x7fd3('0x3'));var rp=require(_0x7fd3('0x4'));var fs=require('fs');var path=require(_0x7fd3('0x5'));var rimraf=require(_0x7fd3('0x6'));var config=require(_0x7fd3('0x7'));var attributes=require(_0x7fd3('0x8'));module[_0x7fd3('0x9')]=function(_0x254d99,_0x58a814){return _0x254d99['define'](_0x7fd3('0xa'),attributes,{'tableName':_0x7fd3('0xb'),'paranoid':![],'indexes':[{'name':_0x7fd3('0xc'),'fields':['accountcode']},{'name':_0x7fd3('0xd'),'fields':['calldate']},{'name':_0x7fd3('0xe'),'fields':[_0x7fd3('0xe')]},{'name':'dst','fields':['dst']},{'name':'src','fields':['src']},{'name':_0x7fd3('0xf'),'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 d31f534..7790bea 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 _0x168a=['Cdr,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x168a,0x7b));var _0xa168=function(_0x2b2e9d,_0x4bb005){_0x2b2e9d=_0x2b2e9d-0x0;var _0x1fd474=_0x168a[_0x2b2e9d];return _0x1fd474;};'use strict';var _=require(_0xa168('0x0'));var util=require(_0xa168('0x1'));var moment=require(_0xa168('0x2'));var BPromise=require('bluebird');var rs=require(_0xa168('0x3'));var fs=require('fs');var Redis=require(_0xa168('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa168('0x5'));var logger=require(_0xa168('0x6'))(_0xa168('0x7'));var config=require(_0xa168('0x8'));var jayson=require(_0xa168('0x9'));var client=jayson[_0xa168('0xa')][_0xa168('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38b2f5,_0x1f6872,_0x1f6d61){return new BPromise(function(_0x69dee5,_0x47868b){return client[_0xa168('0xc')](_0x38b2f5,_0x1f6d61)[_0xa168('0xd')](function(_0x5e7736){logger[_0xa168('0xe')](_0xa168('0xf'),_0x1f6872,'request\x20sent');logger[_0xa168('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x1f6872,_0xa168('0x11'),JSON[_0xa168('0x12')](_0x5e7736));if(_0x5e7736['error']){if(_0x5e7736[_0xa168('0x13')]['code']===0x1f4){logger[_0xa168('0x13')](_0xa168('0xf'),_0x1f6872,_0x5e7736[_0xa168('0x13')][_0xa168('0x14')]);return _0x47868b(_0x5e7736[_0xa168('0x13')][_0xa168('0x14')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x1f6872,_0x5e7736[_0xa168('0x13')][_0xa168('0x14')]);return _0x69dee5(_0x5e7736[_0xa168('0x13')]['message']);}else{logger[_0xa168('0xe')](_0xa168('0xf'),_0x1f6872,'request\x20sent');_0x69dee5(_0x5e7736[_0xa168('0x15')][_0xa168('0x14')]);}})[_0xa168('0x16')](function(_0x6130ea){logger[_0xa168('0x13')]('Cdr,\x20%s,\x20%s',_0x1f6872,_0x6130ea);_0x47868b(_0x6130ea);});});}
\ No newline at end of file
+var _0x7bbb=['Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7bbb,0x12f));var _0xb7bb=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7bbb[_0x2b10c6];return _0x3789d2;};'use strict';var _=require('lodash');var util=require(_0xb7bb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb7bb('0x1'));var fs=require('fs');var Redis=require(_0xb7bb('0x2'));var db=require(_0xb7bb('0x3'))['db'];var utils=require(_0xb7bb('0x4'));var logger=require(_0xb7bb('0x5'))(_0xb7bb('0x6'));var config=require(_0xb7bb('0x7'));var jayson=require(_0xb7bb('0x8'));var client=jayson[_0xb7bb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x241ae6,_0x44862d,_0x18a161){return new BPromise(function(_0x1ebdae,_0x5dcce7){return client[_0xb7bb('0xa')](_0x241ae6,_0x18a161)[_0xb7bb('0xb')](function(_0x7327df){logger['info'](_0xb7bb('0xc'),_0x44862d,_0xb7bb('0xd'));logger['debug'](_0xb7bb('0xe'),_0x44862d,_0xb7bb('0xd'),JSON['stringify'](_0x7327df));if(_0x7327df[_0xb7bb('0xf')]){if(_0x7327df['error'][_0xb7bb('0x10')]===0x1f4){logger['error'](_0xb7bb('0xc'),_0x44862d,_0x7327df[_0xb7bb('0xf')][_0xb7bb('0x11')]);return _0x5dcce7(_0x7327df[_0xb7bb('0xf')][_0xb7bb('0x11')]);}logger[_0xb7bb('0xf')]('Cdr,\x20%s,\x20%s',_0x44862d,_0x7327df[_0xb7bb('0xf')][_0xb7bb('0x11')]);return _0x1ebdae(_0x7327df[_0xb7bb('0xf')]['message']);}else{logger[_0xb7bb('0x12')](_0xb7bb('0xc'),_0x44862d,_0xb7bb('0xd'));_0x1ebdae(_0x7327df[_0xb7bb('0x13')][_0xb7bb('0x11')]);}})[_0xb7bb('0x14')](function(_0xa5daa4){logger[_0xb7bb('0xf')](_0xb7bb('0xc'),_0x44862d,_0xa5daa4);_0x5dcce7(_0xa5daa4);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index ce876b1..7a9c603 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 _0x3649=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','describe','/:id','isAuthenticated','post','create','put'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x3649,0x1d1));var _0x9364=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x3649[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x9364('0x0'));var util=require(_0x9364('0x1'));var path=require(_0x9364('0x2'));var timeout=require(_0x9364('0x3'));var express=require(_0x9364('0x4'));var router=express[_0x9364('0x5')]();var auth=require(_0x9364('0x6'));var interaction=require(_0x9364('0x7'));var config=require(_0x9364('0x8'));var controller=require('./cdr.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9364('0x9')]);router[_0x9364('0xa')](_0x9364('0xb'),auth['isAuthenticated'](),controller[_0x9364('0xc')]);router[_0x9364('0xa')](_0x9364('0xd'),auth[_0x9364('0xe')](),controller['show']);router[_0x9364('0xf')]('/',auth[_0x9364('0xe')](),controller[_0x9364('0x10')]);router[_0x9364('0x11')](_0x9364('0xd'),auth[_0x9364('0xe')](),controller[_0x9364('0x12')]);router['delete'](_0x9364('0xd'),auth['isAuthenticated'](),controller[_0x9364('0x13')]);module[_0x9364('0x14')]=router;
\ No newline at end of file
+var _0xcba0=['destroy','exports','multer','util','path','../../components/auth/service','../../config/environment','./cdr.controller','isAuthenticated','describe','/:id','show','put','update','delete'];(function(_0x2faa83,_0x15959b){var _0x324758=function(_0x5a3b49){while(--_0x5a3b49){_0x2faa83['push'](_0x2faa83['shift']());}};_0x324758(++_0x15959b);}(_0xcba0,0xe3));var _0x0cba=function(_0x54b55b,_0x244874){_0x54b55b=_0x54b55b-0x0;var _0x45cc9c=_0xcba0[_0x54b55b];return _0x45cc9c;};'use strict';var multer=require(_0x0cba('0x0'));var util=require(_0x0cba('0x1'));var path=require(_0x0cba('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x0cba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0cba('0x4'));var controller=require(_0x0cba('0x5'));router['get']('/',auth[_0x0cba('0x6')](),controller['index']);router['get']('/describe',auth[_0x0cba('0x6')](),controller[_0x0cba('0x7')]);router['get'](_0x0cba('0x8'),auth[_0x0cba('0x6')](),controller[_0x0cba('0x9')]);router['post']('/',auth[_0x0cba('0x6')](),controller['create']);router[_0x0cba('0xa')](_0x0cba('0x8'),auth[_0x0cba('0x6')](),controller[_0x0cba('0xb')]);router[_0x0cba('0xc')](_0x0cba('0x8'),auth['isAuthenticated'](),controller[_0x0cba('0xd')]);module[_0x0cba('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index c43f04d..f091630 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 _0xd4ad=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0x55a89e,_0x1a05ab){var _0x3aa2bd=function(_0x4b9d09){while(--_0x4b9d09){_0x55a89e['push'](_0x55a89e['shift']());}};_0x3aa2bd(++_0x1a05ab);}(_0xd4ad,0x158));var _0xdd4a=function(_0x28eb41,_0x29b5fe){_0x28eb41=_0x28eb41-0x0;var _0x3ad285=_0xd4ad[_0x28eb41];return _0x3ad285;};'use strict';var Sequelize=require(_0xdd4a('0x0'));module[_0xdd4a('0x1')]={'priority':{'type':Sequelize[_0xdd4a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdd4a('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdd4a('0x4')]()},'description':{'type':Sequelize[_0xdd4a('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xbc7a=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbc7a,0xa4));var _0xabc7=function(_0x4bb759,_0x2c1ae7){_0x4bb759=_0x4bb759-0x0;var _0x8bbf7c=_0xbc7a[_0x4bb759];return _0x8bbf7c;};'use strict';var Sequelize=require(_0xabc7('0x0'));module[_0xabc7('0x1')]={'priority':{'type':Sequelize[_0xabc7('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xabc7('0x3')},'appdata':{'type':Sequelize[_0xabc7('0x4')]()},'description':{'type':Sequelize[_0xabc7('0x5')]},'interval':{'type':Sequelize[_0xabc7('0x5')],'defaultValue':_0xabc7('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 3012e4c..cbc6ef3 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 _0x3faf=['../../mysqldb','end','status','count','offset','limit','set','json','apply','reject','update','then','sendStatus','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','ChatApplication','find','catch','body','destroy','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x3faf,0x17a));var _0xf3fa=function(_0x30115f,_0x159cb2){_0x30115f=_0x30115f-0x0;var _0x545e81=_0x3faf[_0x30115f];return _0x545e81;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf3fa('0x0'));var rimraf=require(_0xf3fa('0x1'));var zipdir=require(_0xf3fa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3fa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf3fa('0x4'));var util=require(_0xf3fa('0x5'));var path=require(_0xf3fa('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf3fa('0x7'));var fs=require('fs');var _=require(_0xf3fa('0x8'));var squel=require(_0xf3fa('0x9'));var crypto=require(_0xf3fa('0xa'));var jsforce=require(_0xf3fa('0xb'));var deskjs=require(_0xf3fa('0xc'));var toCsv=require(_0xf3fa('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf3fa('0xe'));var authService=require(_0xf3fa('0xf'));var qs=require(_0xf3fa('0x10'));var hardwareService=require(_0xf3fa('0x11'));var logger=require(_0xf3fa('0x12'))('api');var utils=require(_0xf3fa('0x13'));var config=require(_0xf3fa('0x14'));var db=require(_0xf3fa('0x15'))['db'];function respondWithStatusCode(_0x24bcda,_0x526d43){_0x526d43=_0x526d43||0xcc;return function(_0x4b09ce){if(_0x4b09ce){return _0x24bcda['sendStatus'](_0x526d43);}return _0x24bcda['status'](_0x526d43)[_0xf3fa('0x16')]();};}function respondWithResult(_0x4e7944,_0x94065e){_0x94065e=_0x94065e||0xc8;return function(_0x18c55c){if(_0x18c55c){return _0x4e7944[_0xf3fa('0x17')](_0x94065e)['json'](_0x18c55c);}};}function respondWithFilteredResult(_0x172005,_0x11d30d){return function(_0x4fa30d){if(_0x4fa30d){var _0x1297e2=_0x4fa30d[_0xf3fa('0x18')],_0x198eb4=_0x11d30d[_0xf3fa('0x19')],_0x2e69a2=_0x11d30d[_0xf3fa('0x19')]+_0x11d30d[_0xf3fa('0x1a')],_0x3f617c;if(_0x2e69a2>=_0x1297e2){_0x2e69a2=_0x1297e2;_0x3f617c=0xc8;}else{_0x3f617c=0xce;}_0x172005['status'](_0x3f617c);return _0x172005[_0xf3fa('0x1b')]('Content-Range',_0x198eb4+'-'+_0x2e69a2+'/'+_0x1297e2)[_0xf3fa('0x1c')](_0x4fa30d);}return null;};}function patchUpdates(_0x27395f){return function(_0x152bb0){try{jsonpatch[_0xf3fa('0x1d')](_0x152bb0,_0x27395f,!![]);}catch(_0x4fde03){return BPromise[_0xf3fa('0x1e')](_0x4fde03);}return _0x152bb0['save']();};}function saveUpdates(_0x545763,_0x5a122c){return function(_0x379a84){if(_0x379a84){return _0x379a84[_0xf3fa('0x1f')](_0x545763)[_0xf3fa('0x20')](function(_0x491cd0){return _0x491cd0;});}return null;};}function removeEntity(_0x334284,_0x572aeb){return function(_0x5c481d){if(_0x5c481d){return _0x5c481d['destroy']()[_0xf3fa('0x20')](function(){_0x334284[_0xf3fa('0x17')](0xcc)[_0xf3fa('0x16')]();});}};}function handleEntityNotFound(_0x8c9497,_0x1337b8){return function(_0x2c82d8){if(!_0x2c82d8){_0x8c9497[_0xf3fa('0x21')](0x194);}return _0x2c82d8;};}function handleError(_0x3fbc7d,_0x49c0fa){_0x49c0fa=_0x49c0fa||0x1f4;return function(_0x8834c3){logger['error'](_0x8834c3[_0xf3fa('0x22')]);if(_0x8834c3['name']){delete _0x8834c3[_0xf3fa('0x23')];}_0x3fbc7d[_0xf3fa('0x17')](_0x49c0fa)[_0xf3fa('0x24')](_0x8834c3);};}exports[_0xf3fa('0x25')]=function(_0x35b0b7,_0x5e242c){var _0x38ba7e={'raw':!![],'where':{'id':_0x35b0b7[_0xf3fa('0x26')]['id']}},_0xefeef={};_0xefeef[_0xf3fa('0x27')]=_[_0xf3fa('0x28')](db['ChatApplication'][_0xf3fa('0x29')]);_0xefeef[_0xf3fa('0x2a')]=_[_0xf3fa('0x28')](_0x35b0b7[_0xf3fa('0x2a')]);_0xefeef[_0xf3fa('0x2b')]=_[_0xf3fa('0x2c')](_0xefeef[_0xf3fa('0x27')],_0xefeef['query']);_0x38ba7e[_0xf3fa('0x2d')]=_[_0xf3fa('0x2c')](_0xefeef[_0xf3fa('0x27')],qs[_0xf3fa('0x2e')](_0x35b0b7['query'][_0xf3fa('0x2e')]));_0x38ba7e[_0xf3fa('0x2d')]=_0x38ba7e[_0xf3fa('0x2d')][_0xf3fa('0x2f')]?_0x38ba7e['attributes']:_0xefeef[_0xf3fa('0x27')];if(_0x35b0b7[_0xf3fa('0x2a')][_0xf3fa('0x30')]){_0x38ba7e[_0xf3fa('0x31')]=[{'all':!![]}];}_0x38ba7e=_[_0xf3fa('0x32')]({},_0x38ba7e,_0x35b0b7[_0xf3fa('0x33')]);return db[_0xf3fa('0x34')][_0xf3fa('0x35')](_0x38ba7e)[_0xf3fa('0x20')](handleEntityNotFound(_0x5e242c,null))[_0xf3fa('0x20')](respondWithResult(_0x5e242c,null))[_0xf3fa('0x36')](handleError(_0x5e242c,null));};exports[_0xf3fa('0x1f')]=function(_0x34450f,_0x1c3620){if(_0x34450f[_0xf3fa('0x37')]['id']){delete _0x34450f['body']['id'];}return db[_0xf3fa('0x34')][_0xf3fa('0x35')]({'where':{'id':_0x34450f[_0xf3fa('0x26')]['id']}})[_0xf3fa('0x20')](handleEntityNotFound(_0x1c3620,null))[_0xf3fa('0x20')](saveUpdates(_0x34450f[_0xf3fa('0x37')],null))['then'](respondWithResult(_0x1c3620,null))[_0xf3fa('0x36')](handleError(_0x1c3620,null));};exports[_0xf3fa('0x38')]=function(_0x28152b,_0xc95094){return db[_0xf3fa('0x34')][_0xf3fa('0x35')]({'where':{'id':_0x28152b[_0xf3fa('0x26')]['id']}})[_0xf3fa('0x20')](handleEntityNotFound(_0xc95094,null))['then'](removeEntity(_0xc95094,null))[_0xf3fa('0x36')](handleError(_0xc95094,null));};
\ No newline at end of file
+var _0xc4c5=['bluebird','util','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','save','update','destroy','then','end','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','ChatApplication','catch','find','body','html-pdf','eml-format','zip-dir','request-promise','moment'];(function(_0x36b814,_0x129a25){var _0x2e3ee9=function(_0x353399){while(--_0x353399){_0x36b814['push'](_0x36b814['shift']());}};_0x2e3ee9(++_0x129a25);}(_0xc4c5,0x1e1));var _0x5c4c=function(_0x477d83,_0x57d1a3){_0x477d83=_0x477d83-0x0;var _0x45865f=_0xc4c5[_0x477d83];return _0x45865f;};'use strict';var pdf=require(_0x5c4c('0x0'));var emlformat=require(_0x5c4c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5c4c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c4c('0x3'));var moment=require(_0x5c4c('0x4'));var BPromise=require(_0x5c4c('0x5'));var Mustache=require('mustache');var util=require(_0x5c4c('0x6'));var path=require(_0x5c4c('0x7'));var sox=require(_0x5c4c('0x8'));var csv=require(_0x5c4c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5c4c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5c4c('0xb'));var deskjs=require(_0x5c4c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5c4c('0xd'));var Redis=require(_0x5c4c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5c4c('0xf'));var hardwareService=require(_0x5c4c('0x10'));var logger=require(_0x5c4c('0x11'))('api');var utils=require(_0x5c4c('0x12'));var config=require(_0x5c4c('0x13'));var db=require(_0x5c4c('0x14'))['db'];function respondWithStatusCode(_0x16a8c6,_0x1c0864){_0x1c0864=_0x1c0864||0xcc;return function(_0x24197f){if(_0x24197f){return _0x16a8c6[_0x5c4c('0x15')](_0x1c0864);}return _0x16a8c6[_0x5c4c('0x16')](_0x1c0864)['end']();};}function respondWithResult(_0x4edc2f,_0x4ff206){_0x4ff206=_0x4ff206||0xc8;return function(_0x151035){if(_0x151035){return _0x4edc2f['status'](_0x4ff206)[_0x5c4c('0x17')](_0x151035);}};}function respondWithFilteredResult(_0xe21b97,_0x334c44){return function(_0x4d874b){if(_0x4d874b){var _0x4d9710=_0x4d874b['count'],_0x562c39=_0x334c44[_0x5c4c('0x18')],_0xbdf6de=_0x334c44['offset']+_0x334c44[_0x5c4c('0x19')],_0x973cb2;if(_0xbdf6de>=_0x4d9710){_0xbdf6de=_0x4d9710;_0x973cb2=0xc8;}else{_0x973cb2=0xce;}_0xe21b97[_0x5c4c('0x16')](_0x973cb2);return _0xe21b97[_0x5c4c('0x1a')]('Content-Range',_0x562c39+'-'+_0xbdf6de+'/'+_0x4d9710)[_0x5c4c('0x17')](_0x4d874b);}return null;};}function patchUpdates(_0x342f83){return function(_0x1850fe){try{jsonpatch[_0x5c4c('0x1b')](_0x1850fe,_0x342f83,!![]);}catch(_0x110add){return BPromise['reject'](_0x110add);}return _0x1850fe[_0x5c4c('0x1c')]();};}function saveUpdates(_0x18ce92,_0x2ba901){return function(_0x5c314a){if(_0x5c314a){return _0x5c314a[_0x5c4c('0x1d')](_0x18ce92)['then'](function(_0x351c16){return _0x351c16;});}return null;};}function removeEntity(_0x36069c,_0x112660){return function(_0x3f45f3){if(_0x3f45f3){return _0x3f45f3[_0x5c4c('0x1e')]()[_0x5c4c('0x1f')](function(){_0x36069c[_0x5c4c('0x16')](0xcc)[_0x5c4c('0x20')]();});}};}function handleEntityNotFound(_0x31bd2c,_0x19492e){return function(_0x448fc9){if(!_0x448fc9){_0x31bd2c[_0x5c4c('0x15')](0x194);}return _0x448fc9;};}function handleError(_0x46d5d4,_0x3f5a8b){_0x3f5a8b=_0x3f5a8b||0x1f4;return function(_0x487ebf){logger[_0x5c4c('0x21')](_0x487ebf[_0x5c4c('0x22')]);if(_0x487ebf[_0x5c4c('0x23')]){delete _0x487ebf[_0x5c4c('0x23')];}_0x46d5d4[_0x5c4c('0x16')](_0x3f5a8b)[_0x5c4c('0x24')](_0x487ebf);};}exports[_0x5c4c('0x25')]=function(_0x1d7068,_0x5674f7){var _0x1740d7={'raw':!![],'where':{'id':_0x1d7068[_0x5c4c('0x26')]['id']}},_0x5877cd={};_0x5877cd[_0x5c4c('0x27')]=_[_0x5c4c('0x28')](db['ChatApplication'][_0x5c4c('0x29')]);_0x5877cd[_0x5c4c('0x2a')]=_[_0x5c4c('0x28')](_0x1d7068[_0x5c4c('0x2a')]);_0x5877cd[_0x5c4c('0x2b')]=_['intersection'](_0x5877cd[_0x5c4c('0x27')],_0x5877cd['query']);_0x1740d7[_0x5c4c('0x2c')]=_[_0x5c4c('0x2d')](_0x5877cd['model'],qs['fields'](_0x1d7068[_0x5c4c('0x2a')][_0x5c4c('0x2e')]));_0x1740d7['attributes']=_0x1740d7[_0x5c4c('0x2c')][_0x5c4c('0x2f')]?_0x1740d7['attributes']:_0x5877cd[_0x5c4c('0x27')];if(_0x1d7068['query'][_0x5c4c('0x30')]){_0x1740d7[_0x5c4c('0x31')]=[{'all':!![]}];}_0x1740d7=_['merge']({},_0x1740d7,_0x1d7068['options']);return db[_0x5c4c('0x32')]['find'](_0x1740d7)['then'](handleEntityNotFound(_0x5674f7,null))[_0x5c4c('0x1f')](respondWithResult(_0x5674f7,null))[_0x5c4c('0x33')](handleError(_0x5674f7,null));};exports[_0x5c4c('0x1d')]=function(_0x50c5fd,_0x580726){if(_0x50c5fd['body']['id']){delete _0x50c5fd['body']['id'];}return db[_0x5c4c('0x32')][_0x5c4c('0x34')]({'where':{'id':_0x50c5fd[_0x5c4c('0x26')]['id']}})['then'](handleEntityNotFound(_0x580726,null))[_0x5c4c('0x1f')](saveUpdates(_0x50c5fd[_0x5c4c('0x35')],null))[_0x5c4c('0x1f')](respondWithResult(_0x580726,null))[_0x5c4c('0x33')](handleError(_0x580726,null));};exports[_0x5c4c('0x1e')]=function(_0x23a2e8,_0x28e658){return db[_0x5c4c('0x32')][_0x5c4c('0x34')]({'where':{'id':_0x23a2e8[_0x5c4c('0x26')]['id']}})['then'](handleEntityNotFound(_0x28e658,null))[_0x5c4c('0x1f')](removeEntity(_0x28e658,null))['catch'](handleError(_0x28e658,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index e4c4a2e..3462d3d 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 _0xb9e2=['./chatApplication.attributes','exports','define','chat_applications','utf8mb4','lodash','util','bluebird','request-promise','../../config/environment'];(function(_0x17f63f,_0x3d3dc1){var _0x288a54=function(_0x38e731){while(--_0x38e731){_0x17f63f['push'](_0x17f63f['shift']());}};_0x288a54(++_0x3d3dc1);}(_0xb9e2,0x9b));var _0x2b9e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb9e2[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x2b9e('0x0'));var util=require(_0x2b9e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2b9e('0x2'));var rp=require(_0x2b9e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2b9e('0x4'));var attributes=require(_0x2b9e('0x5'));module[_0x2b9e('0x6')]=function(_0x55a169,_0x425211){return _0x55a169[_0x2b9e('0x7')]('ChatApplication',attributes,{'tableName':_0x2b9e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b9e('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x4bd9=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x4c2fff,_0x3b6e6d){var _0x1155c0=function(_0x1b3b05){while(--_0x1b3b05){_0x4c2fff['push'](_0x4c2fff['shift']());}};_0x1155c0(++_0x3b6e6d);}(_0x4bd9,0x1e8));var _0x94bd=function(_0x5d8f6f,_0xcfdf79){_0x5d8f6f=_0x5d8f6f-0x0;var _0x3a0879=_0x4bd9[_0x5d8f6f];return _0x3a0879;};'use strict';var _=require(_0x94bd('0x0'));var util=require(_0x94bd('0x1'));var logger=require(_0x94bd('0x2'))(_0x94bd('0x3'));var moment=require(_0x94bd('0x4'));var BPromise=require('bluebird');var rp=require(_0x94bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94bd('0x6'));var config=require(_0x94bd('0x7'));var attributes=require(_0x94bd('0x8'));module[_0x94bd('0x9')]=function(_0x4a556f,_0x478daf){return _0x4a556f[_0x94bd('0xa')](_0x94bd('0xb'),attributes,{'tableName':_0x94bd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x94bd('0xd'),'collate':_0x94bd('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 6d8d62e..25ad7e0 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 _0x059e=['result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5edb22,_0x136394){var _0x3f9dba=function(_0x9dd4fa){while(--_0x9dd4fa){_0x5edb22['push'](_0x5edb22['shift']());}};_0x3f9dba(++_0x136394);}(_0x059e,0xe6));var _0xe059=function(_0x2d40f0,_0xed5b5){_0x2d40f0=_0x2d40f0-0x0;var _0x3359c6=_0x059e[_0x2d40f0];return _0x3359c6;};'use strict';var _=require(_0xe059('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe059('0x1'));var rs=require(_0xe059('0x2'));var fs=require('fs');var Redis=require(_0xe059('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe059('0x4'));var logger=require(_0xe059('0x5'))('rpc');var config=require(_0xe059('0x6'));var jayson=require(_0xe059('0x7'));var client=jayson['client'][_0xe059('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5467cf,_0x4d717d,_0x3577f4){return new BPromise(function(_0x2fc3e3,_0x1d0c70){return client['request'](_0x5467cf,_0x3577f4)['then'](function(_0x47010b){logger[_0xe059('0x9')](_0xe059('0xa'),_0x4d717d,_0xe059('0xb'));logger[_0xe059('0xc')](_0xe059('0xd'),_0x4d717d,_0xe059('0xb'),JSON['stringify'](_0x47010b));if(_0x47010b['error']){if(_0x47010b[_0xe059('0xe')][_0xe059('0xf')]===0x1f4){logger[_0xe059('0xe')](_0xe059('0xa'),_0x4d717d,_0x47010b['error'][_0xe059('0x10')]);return _0x1d0c70(_0x47010b[_0xe059('0xe')][_0xe059('0x10')]);}logger[_0xe059('0xe')](_0xe059('0xa'),_0x4d717d,_0x47010b['error']['message']);return _0x2fc3e3(_0x47010b[_0xe059('0xe')][_0xe059('0x10')]);}else{logger[_0xe059('0x9')](_0xe059('0xa'),_0x4d717d,'request\x20sent');_0x2fc3e3(_0x47010b[_0xe059('0x11')]['message']);}})[_0xe059('0x12')](function(_0x9268ce){logger[_0xe059('0xe')](_0xe059('0xa'),_0x4d717d,_0x9268ce);_0x1d0c70(_0x9268ce);});});}
\ No newline at end of file
+var _0x2883=['stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x2883,0xc7));var _0x3288=function(_0x20edb1,_0x358d2f){_0x20edb1=_0x20edb1-0x0;var _0xf2b48b=_0x2883[_0x20edb1];return _0xf2b48b;};'use strict';var _=require('lodash');var util=require(_0x3288('0x0'));var moment=require(_0x3288('0x1'));var BPromise=require('bluebird');var rs=require(_0x3288('0x2'));var fs=require('fs');var Redis=require(_0x3288('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3288('0x4'));var logger=require(_0x3288('0x5'))(_0x3288('0x6'));var config=require(_0x3288('0x7'));var jayson=require(_0x3288('0x8'));var client=jayson[_0x3288('0x9')][_0x3288('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d2e80,_0x204407,_0x211e1f){return new BPromise(function(_0x5d7f01,_0x2f108a){return client[_0x3288('0xb')](_0x3d2e80,_0x211e1f)[_0x3288('0xc')](function(_0x590ce9){logger[_0x3288('0xd')]('ChatApplication,\x20%s,\x20%s',_0x204407,_0x3288('0xe'));logger[_0x3288('0xf')](_0x3288('0x10'),_0x204407,_0x3288('0xe'),JSON[_0x3288('0x11')](_0x590ce9));if(_0x590ce9['error']){if(_0x590ce9[_0x3288('0x12')][_0x3288('0x13')]===0x1f4){logger['error'](_0x3288('0x14'),_0x204407,_0x590ce9[_0x3288('0x12')]['message']);return _0x2f108a(_0x590ce9[_0x3288('0x12')][_0x3288('0x15')]);}logger['error'](_0x3288('0x14'),_0x204407,_0x590ce9[_0x3288('0x12')]['message']);return _0x5d7f01(_0x590ce9['error']['message']);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x204407,_0x3288('0xe'));_0x5d7f01(_0x590ce9[_0x3288('0x16')][_0x3288('0x15')]);}})[_0x3288('0x17')](function(_0x314469){logger[_0x3288('0x12')](_0x3288('0x14'),_0x204407,_0x314469);_0x2f108a(_0x314469);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index ede279b..68ee01f 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 _0x9ddf=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9ddf,0x16d));var _0xf9dd=function(_0x221700,_0x57af01){_0x221700=_0x221700-0x0;var _0x185e8f=_0x9ddf[_0x221700];return _0x185e8f;};'use strict';var multer=require(_0xf9dd('0x0'));var util=require(_0xf9dd('0x1'));var path=require(_0xf9dd('0x2'));var timeout=require(_0xf9dd('0x3'));var express=require(_0xf9dd('0x4'));var router=express[_0xf9dd('0x5')]();var auth=require(_0xf9dd('0x6'));var interaction=require(_0xf9dd('0x7'));var config=require(_0xf9dd('0x8'));var controller=require(_0xf9dd('0x9'));router[_0xf9dd('0xa')](_0xf9dd('0xb'),auth[_0xf9dd('0xc')](),controller['show']);router[_0xf9dd('0xd')]('/:id',auth[_0xf9dd('0xc')](),controller[_0xf9dd('0xe')]);router[_0xf9dd('0xf')]('/:id',auth[_0xf9dd('0xc')](),controller[_0xf9dd('0x10')]);module[_0xf9dd('0x11')]=router;
\ No newline at end of file
+var _0x2d83=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','exports','multer','util','path'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0x2d83,0xc9));var _0x32d8=function(_0x1f6bb6,_0x4c6717){_0x1f6bb6=_0x1f6bb6-0x0;var _0x39c18b=_0x2d83[_0x1f6bb6];return _0x39c18b;};'use strict';var multer=require(_0x32d8('0x0'));var util=require(_0x32d8('0x1'));var path=require(_0x32d8('0x2'));var timeout=require(_0x32d8('0x3'));var express=require(_0x32d8('0x4'));var router=express[_0x32d8('0x5')]();var auth=require(_0x32d8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x32d8('0x7'));var controller=require(_0x32d8('0x8'));router[_0x32d8('0x9')](_0x32d8('0xa'),auth['isAuthenticated'](),controller[_0x32d8('0xb')]);router[_0x32d8('0xc')](_0x32d8('0xa'),auth[_0x32d8('0xd')](),controller[_0x32d8('0xe')]);router[_0x32d8('0xf')](_0x32d8('0xa'),auth[_0x32d8('0xd')](),controller['destroy']);module[_0x32d8('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 4c3c78b..888b0de 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 _0x12c9=['STRING','BOOLEAN','exports'];(function(_0x24166f,_0x33e4b8){var _0x280943=function(_0x5301eb){while(--_0x5301eb){_0x24166f['push'](_0x24166f['shift']());}};_0x280943(++_0x33e4b8);}(_0x12c9,0xb9));var _0x912c=function(_0xb69dc5,_0x12c13b){_0xb69dc5=_0xb69dc5-0x0;var _0x532ff8=_0x12c9[_0xb69dc5];return _0x532ff8;};'use strict';var Sequelize=require('sequelize');module[_0x912c('0x0')]={'name':{'type':Sequelize[_0x912c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x912c('0x1')]},'write':{'type':Sequelize[_0x912c('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xd014=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1616a0,_0x8ab67d){var _0x5bcfe3=function(_0x85bc85){while(--_0x85bc85){_0x1616a0['push'](_0x1616a0['shift']());}};_0x5bcfe3(++_0x8ab67d);}(_0xd014,0x1df));var _0x4d01=function(_0x3d18b1,_0x12f69c){_0x3d18b1=_0x3d18b1-0x0;var _0x33bda2=_0xd014[_0x3d18b1];return _0x33bda2;};'use strict';var Sequelize=require(_0x4d01('0x0'));module[_0x4d01('0x1')]={'name':{'type':Sequelize[_0x4d01('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4d01('0x2')]},'write':{'type':Sequelize[_0x4d01('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 3bf1055..2ba5a80 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 _0x0a8d=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','stack','name','send','index','ChatGroup','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','limit','order','where','pick','merge','map','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','User','sort','getMembers','hasOwnProperty','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0xc14df7,_0x163f90){var _0x34a445=function(_0x1bbf28){while(--_0x1bbf28){_0xc14df7['push'](_0xc14df7['shift']());}};_0x34a445(++_0x163f90);}(_0x0a8d,0xcb));var _0xd0a8=function(_0x33ac2d,_0x440704){_0x33ac2d=_0x33ac2d-0x0;var _0x131e81=_0x0a8d[_0x33ac2d];return _0x131e81;};'use strict';var pdf=require(_0xd0a8('0x0'));var emlformat=require(_0xd0a8('0x1'));var rimraf=require(_0xd0a8('0x2'));var zipdir=require(_0xd0a8('0x3'));var jsonpatch=require(_0xd0a8('0x4'));var rp=require(_0xd0a8('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd0a8('0x6'));var util=require(_0xd0a8('0x7'));var path=require(_0xd0a8('0x8'));var sox=require(_0xd0a8('0x9'));var csv=require('to-csv');var ejs=require(_0xd0a8('0xa'));var fs=require('fs');var _=require(_0xd0a8('0xb'));var squel=require(_0xd0a8('0xc'));var crypto=require(_0xd0a8('0xd'));var jsforce=require(_0xd0a8('0xe'));var deskjs=require(_0xd0a8('0xf'));var toCsv=require(_0xd0a8('0x10'));var querystring=require(_0xd0a8('0x11'));var Papa=require(_0xd0a8('0x12'));var Redis=require(_0xd0a8('0x13'));var authService=require(_0xd0a8('0x14'));var qs=require(_0xd0a8('0x15'));var hardwareService=require(_0xd0a8('0x16'));var logger=require(_0xd0a8('0x17'))(_0xd0a8('0x18'));var utils=require(_0xd0a8('0x19'));var config=require('../../config/environment');var db=require(_0xd0a8('0x1a'))['db'];config[_0xd0a8('0x1b')]=_[_0xd0a8('0x1c')](config[_0xd0a8('0x1b')],{'host':_0xd0a8('0x1d'),'port':0x18eb});var socket=require(_0xd0a8('0x1e'))(new Redis(config[_0xd0a8('0x1b')]));require(_0xd0a8('0x1f'))['register'](socket);var jayson=require(_0xd0a8('0x20'));var client=jayson[_0xd0a8('0x21')][_0xd0a8('0x22')]({'port':0x232a});function checkPasswordPattern(_0x257ac0,_0x58d274,_0x3f25fb){if(_0x3f25fb){var _0x40c5b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40c5b2[_0xd0a8('0x23')](_0x58d274)){return _0x257ac0;}else{throw new Error(_0xd0a8('0x24'));}}else{return _0x257ac0;}}function respondWithRpcPromise(_0x27b414,_0x35cf07,_0x37665a,_0x227ab6){return new BPromise(function(_0x579f94,_0x15b0a3){var _0x50c5bb=_0x227ab6||client;return _0x50c5bb['request'](_0x27b414,_0x37665a)[_0xd0a8('0x25')](function(_0x1cf260){logger[_0xd0a8('0x26')](_0xd0a8('0x27'),_0x35cf07,_0xd0a8('0x28'));logger[_0xd0a8('0x29')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x35cf07,_0xd0a8('0x28'),JSON[_0xd0a8('0x2a')](_0x1cf260));if(_0x1cf260[_0xd0a8('0x2b')]){if(_0x1cf260[_0xd0a8('0x2b')][_0xd0a8('0x2c')]===0x1f4){logger[_0xd0a8('0x2b')](_0xd0a8('0x27'),_0x35cf07,_0x1cf260[_0xd0a8('0x2b')][_0xd0a8('0x2d')]);return _0x15b0a3(_0x1cf260[_0xd0a8('0x2b')]['message']);}logger[_0xd0a8('0x2b')](_0xd0a8('0x27'),_0x35cf07,_0x1cf260[_0xd0a8('0x2b')][_0xd0a8('0x2d')]);return _0x579f94(_0x1cf260[_0xd0a8('0x2b')][_0xd0a8('0x2d')]);}else{logger[_0xd0a8('0x26')](_0xd0a8('0x27'),_0x35cf07,_0xd0a8('0x28'));_0x579f94(_0x1cf260['result']['message']);}})[_0xd0a8('0x2e')](function(_0x1da79b){logger[_0xd0a8('0x2b')](_0xd0a8('0x27'),_0x35cf07,_0x1da79b);_0x15b0a3(_0x1da79b);});});}function respondWithStatusCode(_0x35c344,_0x10dac3){_0x10dac3=_0x10dac3||0xcc;return function(_0x46ce5f){if(_0x46ce5f){return _0x35c344[_0xd0a8('0x2f')](_0x10dac3);}return _0x35c344[_0xd0a8('0x30')](_0x10dac3)['end']();};}function respondWithResult(_0x13f1a7,_0x3974c0){_0x3974c0=_0x3974c0||0xc8;return function(_0x35a6e5){if(_0x35a6e5){return _0x13f1a7[_0xd0a8('0x30')](_0x3974c0)[_0xd0a8('0x31')](_0x35a6e5);}};}function respondWithFilteredResult(_0x4909d6,_0x335aa6){return function(_0x32186e){if(_0x32186e){var _0x4f5699=_0x32186e[_0xd0a8('0x32')],_0x37c050=_0x335aa6[_0xd0a8('0x33')],_0x2a0dfc=_0x335aa6[_0xd0a8('0x33')]+_0x335aa6['limit'],_0x511069;if(_0x2a0dfc>=_0x4f5699){_0x2a0dfc=_0x4f5699;_0x511069=0xc8;}else{_0x511069=0xce;}_0x4909d6[_0xd0a8('0x30')](_0x511069);return _0x4909d6[_0xd0a8('0x34')](_0xd0a8('0x35'),_0x37c050+'-'+_0x2a0dfc+'/'+_0x4f5699)[_0xd0a8('0x31')](_0x32186e);}return null;};}function patchUpdates(_0x4ef39c){return function(_0xc59b5f){try{jsonpatch[_0xd0a8('0x36')](_0xc59b5f,_0x4ef39c,!![]);}catch(_0x13a185){return BPromise['reject'](_0x13a185);}return _0xc59b5f[_0xd0a8('0x37')]();};}function saveUpdates(_0x991bd2,_0x358200){return function(_0x25a277){if(_0x25a277){return _0x25a277[_0xd0a8('0x38')](_0x991bd2)[_0xd0a8('0x25')](function(_0x9d90c8){return _0x9d90c8;});}return null;};}function removeEntity(_0x4e69a7,_0x335c9e){return function(_0x172726){if(_0x172726){return _0x172726['destroy']()[_0xd0a8('0x25')](function(){_0x4e69a7[_0xd0a8('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b6bb8,_0x1241b6){return function(_0x15e835){if(!_0x15e835){_0x1b6bb8[_0xd0a8('0x2f')](0x194);}return _0x15e835;};}function handleError(_0x5a64eb,_0x422a15){_0x422a15=_0x422a15||0x1f4;return function(_0x5911c2){logger[_0xd0a8('0x2b')](_0x5911c2[_0xd0a8('0x39')]);if(_0x5911c2['name']){delete _0x5911c2[_0xd0a8('0x3a')];}_0x5a64eb[_0xd0a8('0x30')](_0x422a15)[_0xd0a8('0x3b')](_0x5911c2);};}exports[_0xd0a8('0x3c')]=function(_0x43edb6,_0x3e9b1f){var _0x1e3216={},_0x597c60={},_0x4ff3ec={'count':0x0,'rows':[]};var _0x333cbc=db[_0xd0a8('0x3d')][_0xd0a8('0x3e')];_0x597c60[_0xd0a8('0x3f')]=_[_0xd0a8('0x40')](_0x333cbc);_0x597c60['query']=_[_0xd0a8('0x40')](_0x43edb6[_0xd0a8('0x41')]);_0x597c60[_0xd0a8('0x42')]=_['intersection'](_0x597c60['model'],_0x597c60['query']);_0x1e3216[_0xd0a8('0x43')]=_[_0xd0a8('0x44')](_0x597c60[_0xd0a8('0x3f')],qs[_0xd0a8('0x45')](_0x43edb6[_0xd0a8('0x41')]['fields']));_0x1e3216[_0xd0a8('0x43')]=_0x1e3216[_0xd0a8('0x43')]['length']?_0x1e3216[_0xd0a8('0x43')]:_0x597c60[_0xd0a8('0x3f')];if(!_0x43edb6['query']['hasOwnProperty'](_0xd0a8('0x46'))){_0x1e3216[_0xd0a8('0x47')]=qs[_0xd0a8('0x47')](_0x43edb6['query'][_0xd0a8('0x47')]);_0x1e3216[_0xd0a8('0x33')]=qs['offset'](_0x43edb6[_0xd0a8('0x41')][_0xd0a8('0x33')]);}_0x1e3216[_0xd0a8('0x48')]=qs['sort'](_0x43edb6['query']['sort']);_0x1e3216[_0xd0a8('0x49')]=qs[_0xd0a8('0x42')](_[_0xd0a8('0x4a')](_0x43edb6[_0xd0a8('0x41')],_0x597c60[_0xd0a8('0x42')]));if(_0x43edb6[_0xd0a8('0x41')]['filter']){_0x1e3216[_0xd0a8('0x49')]=_[_0xd0a8('0x4b')](_0x1e3216[_0xd0a8('0x49')],{'$or':_[_0xd0a8('0x4c')](_0x333cbc,function(_0x500b1e){if(_0x500b1e['type'][_0xd0a8('0x4d')]!==_0xd0a8('0x4e')){var _0x4baba4={};_0x4baba4[_0x500b1e['field']]={'$like':'%'+_0x43edb6['query'][_0xd0a8('0x4f')]+'%'};return _0x4baba4;}})});}_0x1e3216=_[_0xd0a8('0x4b')]({},_0x1e3216,_0x43edb6[_0xd0a8('0x50')]);var _0x3a073b={'where':_0x1e3216[_0xd0a8('0x49')]};return db['ChatGroup'][_0xd0a8('0x32')](_0x3a073b)[_0xd0a8('0x25')](function(_0x454bab){_0x4ff3ec['count']=_0x454bab;if(_0x43edb6[_0xd0a8('0x41')][_0xd0a8('0x51')]){_0x1e3216[_0xd0a8('0x52')]=[{'all':!![]}];}return db[_0xd0a8('0x3d')][_0xd0a8('0x53')](_0x1e3216);})[_0xd0a8('0x25')](function(_0x146d8f){_0x4ff3ec[_0xd0a8('0x54')]=_0x146d8f;return _0x4ff3ec;})['then'](respondWithFilteredResult(_0x3e9b1f,_0x1e3216))[_0xd0a8('0x2e')](handleError(_0x3e9b1f,null));};exports[_0xd0a8('0x55')]=function(_0x5151eb,_0x19f634){var _0x4efddc={'raw':!![],'where':{'id':_0x5151eb[_0xd0a8('0x56')]['id']}},_0x4963a7={};_0x4963a7[_0xd0a8('0x3f')]=_['keys'](db[_0xd0a8('0x3d')][_0xd0a8('0x3e')]);_0x4963a7[_0xd0a8('0x41')]=_[_0xd0a8('0x40')](_0x5151eb['query']);_0x4963a7[_0xd0a8('0x42')]=_['intersection'](_0x4963a7['model'],_0x4963a7[_0xd0a8('0x41')]);_0x4efddc[_0xd0a8('0x43')]=_[_0xd0a8('0x44')](_0x4963a7[_0xd0a8('0x3f')],qs[_0xd0a8('0x45')](_0x5151eb[_0xd0a8('0x41')][_0xd0a8('0x45')]));_0x4efddc[_0xd0a8('0x43')]=_0x4efddc['attributes'][_0xd0a8('0x57')]?_0x4efddc[_0xd0a8('0x43')]:_0x4963a7[_0xd0a8('0x3f')];if(_0x5151eb['query'][_0xd0a8('0x51')]){_0x4efddc[_0xd0a8('0x52')]=[{'all':!![]}];}_0x4efddc=_[_0xd0a8('0x4b')]({},_0x4efddc,_0x5151eb[_0xd0a8('0x50')]);return db[_0xd0a8('0x3d')][_0xd0a8('0x58')](_0x4efddc)['then'](handleEntityNotFound(_0x19f634,null))[_0xd0a8('0x25')](respondWithResult(_0x19f634,null))[_0xd0a8('0x2e')](handleError(_0x19f634,null));};exports[_0xd0a8('0x59')]=function(_0x5b7763,_0x18568e){return db['ChatGroup'][_0xd0a8('0x59')](_0x5b7763[_0xd0a8('0x5a')],{})[_0xd0a8('0x25')](respondWithResult(_0x18568e,0xc9))['catch'](handleError(_0x18568e,null));};exports[_0xd0a8('0x38')]=function(_0x5a3263,_0x2ea612){if(_0x5a3263[_0xd0a8('0x5a')]['id']){delete _0x5a3263[_0xd0a8('0x5a')]['id'];}return db[_0xd0a8('0x3d')][_0xd0a8('0x58')]({'where':{'id':_0x5a3263['params']['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x2ea612,null))[_0xd0a8('0x25')](saveUpdates(_0x5a3263['body'],null))[_0xd0a8('0x25')](respondWithResult(_0x2ea612,null))['catch'](handleError(_0x2ea612,null));};exports[_0xd0a8('0x5b')]=function(_0x5fc1f4,_0x42e40f){return db[_0xd0a8('0x3d')][_0xd0a8('0x58')]({'where':{'id':_0x5fc1f4[_0xd0a8('0x56')]['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x42e40f,null))[_0xd0a8('0x25')](removeEntity(_0x42e40f,null))[_0xd0a8('0x2e')](handleError(_0x42e40f,null));};exports[_0xd0a8('0x5c')]=function(_0x4866ee,_0x3d08c3){return db['ChatGroup'][_0xd0a8('0x5c')]()[_0xd0a8('0x25')](respondWithResult(_0x3d08c3,null))[_0xd0a8('0x2e')](handleError(_0x3d08c3,null));};exports[_0xd0a8('0x5d')]=function(_0x30c4ff,_0x2f8512,_0x2c467c){return db[_0xd0a8('0x5e')][_0xd0a8('0x32')]({'where':{'ChatGroupId':_0x30c4ff[_0xd0a8('0x56')]['id'],'ToId':_0x30c4ff['user']['id'],'read':![]}})['then'](function(_0x3bbc66){return{'id':_[_0xd0a8('0x5f')](_0x30c4ff[_0xd0a8('0x56')]['id']),'count':_0x3bbc66};})[_0xd0a8('0x25')](respondWithResult(_0x2f8512,null))['catch'](handleError(_0x2f8512,null));};exports[_0xd0a8('0x60')]=function(_0x154560,_0x45ce93,_0x3ca256){return db['ChatGroup'][_0xd0a8('0x58')]({'where':{'id':_0x154560[_0xd0a8('0x56')]['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x45ce93,null))[_0xd0a8('0x25')](function(_0x1ee5bb){if(_0x1ee5bb){return _0x1ee5bb[_0xd0a8('0x60')](_0x154560[_0xd0a8('0x5a')][_0xd0a8('0x61')],_[_0xd0a8('0x62')](_0x154560[_0xd0a8('0x5a')],['ids','id'])||{});}})[_0xd0a8('0x25')](respondWithResult(_0x45ce93,null))['catch'](handleError(_0x45ce93,null));};exports['getMembers']=function(_0x3a2eec,_0x2c263e,_0x41b056){var _0x3d0073={};var _0x3ebb5f={};var _0x31a0fa;var _0x12a33f;return db['ChatGroup'][_0xd0a8('0x63')]({'where':{'id':_0x3a2eec[_0xd0a8('0x56')]['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x2c263e,null))[_0xd0a8('0x25')](function(_0x5219be){if(_0x5219be){_0x31a0fa=_0x5219be;_0x3ebb5f[_0xd0a8('0x3f')]=_[_0xd0a8('0x40')](db[_0xd0a8('0x64')][_0xd0a8('0x3e')]);_0x3ebb5f[_0xd0a8('0x41')]=_[_0xd0a8('0x40')](_0x3a2eec[_0xd0a8('0x41')]);_0x3ebb5f[_0xd0a8('0x42')]=_[_0xd0a8('0x44')](_0x3ebb5f['model'],_0x3ebb5f[_0xd0a8('0x41')]);_0x3d0073[_0xd0a8('0x43')]=_[_0xd0a8('0x44')](_0x3ebb5f[_0xd0a8('0x3f')],qs[_0xd0a8('0x45')](_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x45')]));_0x3d0073[_0xd0a8('0x43')]=_0x3d0073[_0xd0a8('0x43')][_0xd0a8('0x57')]?_0x3d0073['attributes']:_0x3ebb5f[_0xd0a8('0x3f')];_0x3d0073['order']=qs[_0xd0a8('0x65')](_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x65')]);_0x3d0073['where']=qs[_0xd0a8('0x42')](_[_0xd0a8('0x4a')](_0x3a2eec[_0xd0a8('0x41')],_0x3ebb5f[_0xd0a8('0x42')]));if(_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x4f')]){_0x3d0073[_0xd0a8('0x49')]=_[_0xd0a8('0x4b')](_0x3d0073[_0xd0a8('0x49')],{'$or':_[_0xd0a8('0x4c')](_0x3d0073['attributes'],function(_0x2079e9){var _0x568bc8={};_0x568bc8[_0x2079e9]={'$like':'%'+_0x3a2eec[_0xd0a8('0x41')]['filter']+'%'};return _0x568bc8;})});}_0x3d0073=_[_0xd0a8('0x4b')]({},_0x3d0073,_0x3a2eec[_0xd0a8('0x50')]);return _0x31a0fa[_0xd0a8('0x66')](_0x3d0073);}})['then'](function(_0x50924e){if(_0x50924e){_0x12a33f=_0x50924e['length'];if(!_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x67')](_0xd0a8('0x46'))){_0x3d0073[_0xd0a8('0x47')]=qs['limit'](_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x47')]);_0x3d0073[_0xd0a8('0x33')]=qs[_0xd0a8('0x33')](_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x33')]);}return _0x31a0fa[_0xd0a8('0x66')](_0x3d0073);}})['then'](function(_0x134ead){if(_0x134ead){return _0x134ead?{'count':_0x12a33f,'rows':_0x134ead}:null;}})[_0xd0a8('0x25')](respondWithResult(_0x2c263e,null))[_0xd0a8('0x2e')](handleError(_0x2c263e,null));};exports['removeMembers']=function(_0x2197b2,_0x9335c,_0x45ac16){return db[_0xd0a8('0x3d')][_0xd0a8('0x58')]({'where':{'id':_0x2197b2['params']['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x9335c,null))[_0xd0a8('0x25')](function(_0x2151c7){if(_0x2151c7){return _0x2151c7['removeMembers'](_0x2197b2['query'][_0xd0a8('0x61')]);}})['then'](respondWithStatusCode(_0x9335c,null))['catch'](handleError(_0x9335c,null));};exports[_0xd0a8('0x68')]=function(_0x2db41a,_0x31d537,_0x36a780){if(_0x2db41a[_0xd0a8('0x5a')]['id']){delete _0x2db41a['body']['id'];}return db[_0xd0a8('0x3d')][_0xd0a8('0x58')]({'where':{'id':_0x2db41a[_0xd0a8('0x56')]['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x31d537,null))[_0xd0a8('0x25')](function(_0x22cfcb){if(_0x22cfcb){_0x2db41a['body'][_0xd0a8('0x69')]=_0x22cfcb['id'];return db[_0xd0a8('0x5e')]['create'](_0x2db41a[_0xd0a8('0x5a')]);}})['then'](respondWithResult(_0x31d537,null))[_0xd0a8('0x2e')](handleError(_0x31d537,null));};exports['getMessages']=function(_0x434b4e,_0x87a822,_0x4bfb9d){var _0x10a2aa={};var _0x470f3f={};var _0x593ce5;var _0x5a531f;return db[_0xd0a8('0x3d')][_0xd0a8('0x63')]({'where':{'id':_0x434b4e[_0xd0a8('0x56')]['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x87a822,null))['then'](function(_0x2a866c){if(_0x2a866c){_0x593ce5=_0x2a866c;_0x470f3f[_0xd0a8('0x3f')]=_[_0xd0a8('0x40')](db[_0xd0a8('0x5e')][_0xd0a8('0x3e')]);_0x470f3f[_0xd0a8('0x41')]=_[_0xd0a8('0x40')](_0x434b4e['query']);_0x470f3f['filters']=_[_0xd0a8('0x44')](_0x470f3f[_0xd0a8('0x3f')],_0x470f3f['query']);_0x10a2aa[_0xd0a8('0x43')]=_['intersection'](_0x470f3f[_0xd0a8('0x3f')],qs[_0xd0a8('0x45')](_0x434b4e[_0xd0a8('0x41')][_0xd0a8('0x45')]));_0x10a2aa[_0xd0a8('0x43')]=_0x10a2aa[_0xd0a8('0x43')][_0xd0a8('0x57')]?_0x10a2aa['attributes']:_0x470f3f[_0xd0a8('0x3f')];_0x10a2aa[_0xd0a8('0x48')]=qs[_0xd0a8('0x65')](_0x434b4e[_0xd0a8('0x41')]['sort']);_0x10a2aa['where']=qs[_0xd0a8('0x42')](_[_0xd0a8('0x4a')](_0x434b4e['query'],_0x470f3f['filters']));if(_0x434b4e[_0xd0a8('0x41')][_0xd0a8('0x4f')]){_0x10a2aa[_0xd0a8('0x49')]=_['merge'](_0x10a2aa[_0xd0a8('0x49')],{'$or':_[_0xd0a8('0x4c')](_0x10a2aa[_0xd0a8('0x43')],function(_0x315b69){var _0x1a42eb={};_0x1a42eb[_0x315b69]={'$like':'%'+_0x434b4e['query']['filter']+'%'};return _0x1a42eb;})});}if(_0x434b4e['query'][_0xd0a8('0x6a')]){var _0x17c8ff=_0x434b4e[_0xd0a8('0x41')][_0xd0a8('0x6a')][_0xd0a8('0x6b')](',');var _0x16405b={};_0x16405b[_0x17c8ff[0x0]]={'$gte':moment(_0x17c8ff[0x1])[_0xd0a8('0x6c')](_0xd0a8('0x6d'))};_0x10a2aa[_0xd0a8('0x49')]=_['merge'](_0x10a2aa[_0xd0a8('0x49')],_0x16405b);}_0x10a2aa=_[_0xd0a8('0x4b')]({},_0x10a2aa,_0x434b4e[_0xd0a8('0x50')]);return _0x593ce5[_0xd0a8('0x6e')](_0x10a2aa);}})['then'](function(_0x52042b){if(_0x52042b){_0x5a531f=_0x52042b[_0xd0a8('0x57')];if(!_0x434b4e['query'][_0xd0a8('0x67')](_0xd0a8('0x46'))){_0x10a2aa['limit']=qs[_0xd0a8('0x47')](_0x434b4e[_0xd0a8('0x41')]['limit']);_0x10a2aa[_0xd0a8('0x33')]=qs['offset'](_0x434b4e[_0xd0a8('0x41')][_0xd0a8('0x33')]);}return _0x593ce5['getMessages'](_0x10a2aa);}})[_0xd0a8('0x25')](function(_0x5453d7){if(_0x5453d7){return _0x5453d7?{'count':_0x5a531f,'rows':_0x5453d7}:null;}})[_0xd0a8('0x25')](respondWithResult(_0x87a822,null))[_0xd0a8('0x2e')](handleError(_0x87a822,null));};
\ No newline at end of file
+var _0x0992=['attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','include','findAll','keys','intersection','length','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','params','user','toInteger','addMembers','omit','ids','User','pick','map','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','ChatGroup','rawAttributes','model','query','filters'];(function(_0x3b2c8e,_0x53910b){var _0x3ebe3d=function(_0x57220b){while(--_0x57220b){_0x3b2c8e['push'](_0x3b2c8e['shift']());}};_0x3ebe3d(++_0x53910b);}(_0x0992,0xa1));var _0x2099=function(_0x264d4d,_0x118fb5){_0x264d4d=_0x264d4d-0x0;var _0xc917e2=_0x0992[_0x264d4d];return _0xc917e2;};'use strict';var pdf=require(_0x2099('0x0'));var emlformat=require(_0x2099('0x1'));var rimraf=require(_0x2099('0x2'));var zipdir=require(_0x2099('0x3'));var jsonpatch=require(_0x2099('0x4'));var rp=require('request-promise');var moment=require(_0x2099('0x5'));var BPromise=require(_0x2099('0x6'));var Mustache=require(_0x2099('0x7'));var util=require(_0x2099('0x8'));var path=require('path');var sox=require(_0x2099('0x9'));var csv=require(_0x2099('0xa'));var ejs=require(_0x2099('0xb'));var fs=require('fs');var _=require(_0x2099('0xc'));var squel=require(_0x2099('0xd'));var crypto=require(_0x2099('0xe'));var jsforce=require(_0x2099('0xf'));var deskjs=require(_0x2099('0x10'));var toCsv=require(_0x2099('0xa'));var querystring=require(_0x2099('0x11'));var Papa=require(_0x2099('0x12'));var Redis=require(_0x2099('0x13'));var authService=require(_0x2099('0x14'));var qs=require(_0x2099('0x15'));var hardwareService=require(_0x2099('0x16'));var logger=require('../../config/logger')(_0x2099('0x17'));var utils=require(_0x2099('0x18'));var config=require(_0x2099('0x19'));var db=require(_0x2099('0x1a'))['db'];config[_0x2099('0x1b')]=_[_0x2099('0x1c')](config[_0x2099('0x1b')],{'host':_0x2099('0x1d'),'port':0x18eb});var socket=require(_0x2099('0x1e'))(new Redis(config[_0x2099('0x1b')]));require(_0x2099('0x1f'))[_0x2099('0x20')](socket);var jayson=require(_0x2099('0x21'));var client=jayson[_0x2099('0x22')][_0x2099('0x23')]({'port':0x232a});function checkPasswordPattern(_0x3189fd,_0x428cc9,_0x42b8d1){if(_0x42b8d1){var _0xebe8bd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xebe8bd['test'](_0x428cc9)){return _0x3189fd;}else{throw new Error(_0x2099('0x24'));}}else{return _0x3189fd;}}function respondWithRpcPromise(_0x30fd9a,_0x34096b,_0x520615,_0x43c6e9){return new BPromise(function(_0x153e69,_0x293a02){var _0x518bef=_0x43c6e9||client;return _0x518bef[_0x2099('0x25')](_0x30fd9a,_0x520615)[_0x2099('0x26')](function(_0x1bdf4d){logger[_0x2099('0x27')](_0x2099('0x28'),_0x34096b,_0x2099('0x29'));logger['debug'](_0x2099('0x2a'),_0x34096b,_0x2099('0x29'),JSON[_0x2099('0x2b')](_0x1bdf4d));if(_0x1bdf4d[_0x2099('0x2c')]){if(_0x1bdf4d[_0x2099('0x2c')][_0x2099('0x2d')]===0x1f4){logger[_0x2099('0x2c')](_0x2099('0x28'),_0x34096b,_0x1bdf4d[_0x2099('0x2c')][_0x2099('0x2e')]);return _0x293a02(_0x1bdf4d['error'][_0x2099('0x2e')]);}logger[_0x2099('0x2c')](_0x2099('0x28'),_0x34096b,_0x1bdf4d[_0x2099('0x2c')][_0x2099('0x2e')]);return _0x153e69(_0x1bdf4d['error'][_0x2099('0x2e')]);}else{logger[_0x2099('0x27')](_0x2099('0x28'),_0x34096b,_0x2099('0x29'));_0x153e69(_0x1bdf4d[_0x2099('0x2f')][_0x2099('0x2e')]);}})[_0x2099('0x30')](function(_0x17b8ac){logger['error'](_0x2099('0x28'),_0x34096b,_0x17b8ac);_0x293a02(_0x17b8ac);});});}function respondWithStatusCode(_0xe73780,_0x5cbec6){_0x5cbec6=_0x5cbec6||0xcc;return function(_0x208de0){if(_0x208de0){return _0xe73780[_0x2099('0x31')](_0x5cbec6);}return _0xe73780[_0x2099('0x32')](_0x5cbec6)[_0x2099('0x33')]();};}function respondWithResult(_0xa37625,_0x75aed4){_0x75aed4=_0x75aed4||0xc8;return function(_0x20f14a){if(_0x20f14a){return _0xa37625[_0x2099('0x32')](_0x75aed4)[_0x2099('0x34')](_0x20f14a);}};}function respondWithFilteredResult(_0x2e5d1c,_0x2c679a){return function(_0x4e160d){if(_0x4e160d){var _0x6ff5b5=_0x4e160d[_0x2099('0x35')],_0x343fb1=_0x2c679a[_0x2099('0x36')],_0x21e6fd=_0x2c679a[_0x2099('0x36')]+_0x2c679a['limit'],_0x21f519;if(_0x21e6fd>=_0x6ff5b5){_0x21e6fd=_0x6ff5b5;_0x21f519=0xc8;}else{_0x21f519=0xce;}_0x2e5d1c[_0x2099('0x32')](_0x21f519);return _0x2e5d1c[_0x2099('0x37')](_0x2099('0x38'),_0x343fb1+'-'+_0x21e6fd+'/'+_0x6ff5b5)[_0x2099('0x34')](_0x4e160d);}return null;};}function patchUpdates(_0x21f5de){return function(_0x78df6d){try{jsonpatch[_0x2099('0x39')](_0x78df6d,_0x21f5de,!![]);}catch(_0x13ce43){return BPromise[_0x2099('0x3a')](_0x13ce43);}return _0x78df6d[_0x2099('0x3b')]();};}function saveUpdates(_0x5406f2,_0x53bf5e){return function(_0x95374f){if(_0x95374f){return _0x95374f[_0x2099('0x3c')](_0x5406f2)[_0x2099('0x26')](function(_0x464e6f){return _0x464e6f;});}return null;};}function removeEntity(_0x5227fd,_0x509ee8){return function(_0x53f55c){if(_0x53f55c){return _0x53f55c[_0x2099('0x3d')]()[_0x2099('0x26')](function(){_0x5227fd[_0x2099('0x32')](0xcc)[_0x2099('0x33')]();});}};}function handleEntityNotFound(_0x90e29d,_0x45aca2){return function(_0x17d0ab){if(!_0x17d0ab){_0x90e29d[_0x2099('0x31')](0x194);}return _0x17d0ab;};}function handleError(_0x4685e4,_0x4733a1){_0x4733a1=_0x4733a1||0x1f4;return function(_0x3e4986){logger['error'](_0x3e4986[_0x2099('0x3e')]);if(_0x3e4986['name']){delete _0x3e4986[_0x2099('0x3f')];}_0x4685e4[_0x2099('0x32')](_0x4733a1)['send'](_0x3e4986);};}exports['index']=function(_0xf69433,_0x4be149){var _0x198e2a={},_0x4fa964={},_0x5c04e9={'count':0x0,'rows':[]};var _0x51cc8c=db[_0x2099('0x40')][_0x2099('0x41')];_0x4fa964[_0x2099('0x42')]=_['keys'](_0x51cc8c);_0x4fa964[_0x2099('0x43')]=_['keys'](_0xf69433[_0x2099('0x43')]);_0x4fa964[_0x2099('0x44')]=_['intersection'](_0x4fa964[_0x2099('0x42')],_0x4fa964['query']);_0x198e2a[_0x2099('0x45')]=_['intersection'](_0x4fa964['model'],qs[_0x2099('0x46')](_0xf69433[_0x2099('0x43')][_0x2099('0x46')]));_0x198e2a[_0x2099('0x45')]=_0x198e2a[_0x2099('0x45')]['length']?_0x198e2a[_0x2099('0x45')]:_0x4fa964[_0x2099('0x42')];if(!_0xf69433[_0x2099('0x43')][_0x2099('0x47')](_0x2099('0x48'))){_0x198e2a['limit']=qs[_0x2099('0x49')](_0xf69433[_0x2099('0x43')]['limit']);_0x198e2a['offset']=qs[_0x2099('0x36')](_0xf69433['query']['offset']);}_0x198e2a[_0x2099('0x4a')]=qs[_0x2099('0x4b')](_0xf69433['query'][_0x2099('0x4b')]);_0x198e2a[_0x2099('0x4c')]=qs[_0x2099('0x44')](_['pick'](_0xf69433['query'],_0x4fa964[_0x2099('0x44')]));if(_0xf69433[_0x2099('0x43')][_0x2099('0x4d')]){_0x198e2a[_0x2099('0x4c')]=_[_0x2099('0x4e')](_0x198e2a[_0x2099('0x4c')],{'$or':_['map'](_0x51cc8c,function(_0x345403){if(_0x345403[_0x2099('0x4f')][_0x2099('0x50')]!==_0x2099('0x51')){var _0x55ad3a={};_0x55ad3a[_0x345403[_0x2099('0x52')]]={'$like':'%'+_0xf69433[_0x2099('0x43')][_0x2099('0x4d')]+'%'};return _0x55ad3a;}})});}_0x198e2a=_['merge']({},_0x198e2a,_0xf69433[_0x2099('0x53')]);var _0x1d18bb={'where':_0x198e2a[_0x2099('0x4c')]};return db[_0x2099('0x40')][_0x2099('0x35')](_0x1d18bb)[_0x2099('0x26')](function(_0x5222fb){_0x5c04e9['count']=_0x5222fb;if(_0xf69433[_0x2099('0x43')]['includeAll']){_0x198e2a[_0x2099('0x54')]=[{'all':!![]}];}return db[_0x2099('0x40')][_0x2099('0x55')](_0x198e2a);})[_0x2099('0x26')](function(_0x3931b9){_0x5c04e9['rows']=_0x3931b9;return _0x5c04e9;})[_0x2099('0x26')](respondWithFilteredResult(_0x4be149,_0x198e2a))[_0x2099('0x30')](handleError(_0x4be149,null));};exports['show']=function(_0x699ce4,_0x543451){var _0x5397a9={'raw':!![],'where':{'id':_0x699ce4['params']['id']}},_0x34dd06={};_0x34dd06[_0x2099('0x42')]=_[_0x2099('0x56')](db[_0x2099('0x40')][_0x2099('0x41')]);_0x34dd06[_0x2099('0x43')]=_[_0x2099('0x56')](_0x699ce4[_0x2099('0x43')]);_0x34dd06[_0x2099('0x44')]=_['intersection'](_0x34dd06[_0x2099('0x42')],_0x34dd06[_0x2099('0x43')]);_0x5397a9[_0x2099('0x45')]=_[_0x2099('0x57')](_0x34dd06[_0x2099('0x42')],qs[_0x2099('0x46')](_0x699ce4[_0x2099('0x43')]['fields']));_0x5397a9[_0x2099('0x45')]=_0x5397a9[_0x2099('0x45')][_0x2099('0x58')]?_0x5397a9[_0x2099('0x45')]:_0x34dd06[_0x2099('0x42')];if(_0x699ce4[_0x2099('0x43')][_0x2099('0x59')]){_0x5397a9[_0x2099('0x54')]=[{'all':!![]}];}_0x5397a9=_[_0x2099('0x4e')]({},_0x5397a9,_0x699ce4[_0x2099('0x53')]);return db[_0x2099('0x40')][_0x2099('0x5a')](_0x5397a9)[_0x2099('0x26')](handleEntityNotFound(_0x543451,null))['then'](respondWithResult(_0x543451,null))[_0x2099('0x30')](handleError(_0x543451,null));};exports['create']=function(_0x31ba5d,_0x33acf5){return db[_0x2099('0x40')][_0x2099('0x5b')](_0x31ba5d[_0x2099('0x5c')],{})['then'](respondWithResult(_0x33acf5,0xc9))[_0x2099('0x30')](handleError(_0x33acf5,null));};exports[_0x2099('0x3c')]=function(_0x5f3eed,_0x14f27d){if(_0x5f3eed[_0x2099('0x5c')]['id']){delete _0x5f3eed[_0x2099('0x5c')]['id'];}return db['ChatGroup'][_0x2099('0x5a')]({'where':{'id':_0x5f3eed['params']['id']}})[_0x2099('0x26')](handleEntityNotFound(_0x14f27d,null))[_0x2099('0x26')](saveUpdates(_0x5f3eed[_0x2099('0x5c')],null))[_0x2099('0x26')](respondWithResult(_0x14f27d,null))[_0x2099('0x30')](handleError(_0x14f27d,null));};exports['destroy']=function(_0x28408f,_0x55278b){return db[_0x2099('0x40')][_0x2099('0x5a')]({'where':{'id':_0x28408f['params']['id']}})[_0x2099('0x26')](handleEntityNotFound(_0x55278b,null))[_0x2099('0x26')](removeEntity(_0x55278b,null))[_0x2099('0x30')](handleError(_0x55278b,null));};exports[_0x2099('0x5d')]=function(_0x362f27,_0x59d1e7){return db['ChatGroup'][_0x2099('0x5d')]()['then'](respondWithResult(_0x59d1e7,null))['catch'](handleError(_0x59d1e7,null));};exports[_0x2099('0x5e')]=function(_0x31d1d7,_0x3090cd,_0x58e772){return db[_0x2099('0x5f')][_0x2099('0x35')]({'where':{'ChatGroupId':_0x31d1d7[_0x2099('0x60')]['id'],'ToId':_0x31d1d7[_0x2099('0x61')]['id'],'read':![]}})[_0x2099('0x26')](function(_0x11eb2a){return{'id':_[_0x2099('0x62')](_0x31d1d7[_0x2099('0x60')]['id']),'count':_0x11eb2a};})['then'](respondWithResult(_0x3090cd,null))[_0x2099('0x30')](handleError(_0x3090cd,null));};exports[_0x2099('0x63')]=function(_0x250d47,_0x13c67b,_0x58688c){return db[_0x2099('0x40')][_0x2099('0x5a')]({'where':{'id':_0x250d47['params']['id']}})[_0x2099('0x26')](handleEntityNotFound(_0x13c67b,null))[_0x2099('0x26')](function(_0x1cf24f){if(_0x1cf24f){return _0x1cf24f[_0x2099('0x63')](_0x250d47[_0x2099('0x5c')]['ids'],_[_0x2099('0x64')](_0x250d47['body'],[_0x2099('0x65'),'id'])||{});}})['then'](respondWithResult(_0x13c67b,null))[_0x2099('0x30')](handleError(_0x13c67b,null));};exports['getMembers']=function(_0x34fcd0,_0x21c51c,_0x3ecbae){var _0x2592ff={};var _0x37bd67={};var _0x8c24ad;var _0x14c72c;return db['ChatGroup']['findOne']({'where':{'id':_0x34fcd0[_0x2099('0x60')]['id']}})[_0x2099('0x26')](handleEntityNotFound(_0x21c51c,null))[_0x2099('0x26')](function(_0x34beb3){if(_0x34beb3){_0x8c24ad=_0x34beb3;_0x37bd67[_0x2099('0x42')]=_[_0x2099('0x56')](db[_0x2099('0x66')]['rawAttributes']);_0x37bd67[_0x2099('0x43')]=_[_0x2099('0x56')](_0x34fcd0['query']);_0x37bd67['filters']=_[_0x2099('0x57')](_0x37bd67[_0x2099('0x42')],_0x37bd67[_0x2099('0x43')]);_0x2592ff['attributes']=_[_0x2099('0x57')](_0x37bd67['model'],qs['fields'](_0x34fcd0['query'][_0x2099('0x46')]));_0x2592ff['attributes']=_0x2592ff[_0x2099('0x45')][_0x2099('0x58')]?_0x2592ff['attributes']:_0x37bd67[_0x2099('0x42')];_0x2592ff['order']=qs[_0x2099('0x4b')](_0x34fcd0[_0x2099('0x43')][_0x2099('0x4b')]);_0x2592ff[_0x2099('0x4c')]=qs[_0x2099('0x44')](_[_0x2099('0x67')](_0x34fcd0[_0x2099('0x43')],_0x37bd67[_0x2099('0x44')]));if(_0x34fcd0[_0x2099('0x43')][_0x2099('0x4d')]){_0x2592ff[_0x2099('0x4c')]=_['merge'](_0x2592ff[_0x2099('0x4c')],{'$or':_[_0x2099('0x68')](_0x2592ff['attributes'],function(_0x16a61b){var _0xd96f1={};_0xd96f1[_0x16a61b]={'$like':'%'+_0x34fcd0[_0x2099('0x43')]['filter']+'%'};return _0xd96f1;})});}_0x2592ff=_[_0x2099('0x4e')]({},_0x2592ff,_0x34fcd0['options']);return _0x8c24ad[_0x2099('0x69')](_0x2592ff);}})[_0x2099('0x26')](function(_0x46b75a){if(_0x46b75a){_0x14c72c=_0x46b75a[_0x2099('0x58')];if(!_0x34fcd0[_0x2099('0x43')][_0x2099('0x47')](_0x2099('0x48'))){_0x2592ff[_0x2099('0x49')]=qs[_0x2099('0x49')](_0x34fcd0['query'][_0x2099('0x49')]);_0x2592ff['offset']=qs[_0x2099('0x36')](_0x34fcd0[_0x2099('0x43')]['offset']);}return _0x8c24ad['getMembers'](_0x2592ff);}})[_0x2099('0x26')](function(_0x2ddbe8){if(_0x2ddbe8){return _0x2ddbe8?{'count':_0x14c72c,'rows':_0x2ddbe8}:null;}})[_0x2099('0x26')](respondWithResult(_0x21c51c,null))[_0x2099('0x30')](handleError(_0x21c51c,null));};exports['removeMembers']=function(_0x1eada4,_0x181e22,_0x5b423e){return db[_0x2099('0x40')][_0x2099('0x5a')]({'where':{'id':_0x1eada4[_0x2099('0x60')]['id']}})[_0x2099('0x26')](handleEntityNotFound(_0x181e22,null))[_0x2099('0x26')](function(_0x325872){if(_0x325872){return _0x325872[_0x2099('0x6a')](_0x1eada4[_0x2099('0x43')]['ids']);}})[_0x2099('0x26')](respondWithStatusCode(_0x181e22,null))[_0x2099('0x30')](handleError(_0x181e22,null));};exports[_0x2099('0x6b')]=function(_0x4afe04,_0x286a02,_0x43273f){if(_0x4afe04[_0x2099('0x5c')]['id']){delete _0x4afe04[_0x2099('0x5c')]['id'];}return db['ChatGroup'][_0x2099('0x5a')]({'where':{'id':_0x4afe04[_0x2099('0x60')]['id']}})[_0x2099('0x26')](handleEntityNotFound(_0x286a02,null))[_0x2099('0x26')](function(_0x56aecc){if(_0x56aecc){_0x4afe04[_0x2099('0x5c')][_0x2099('0x6c')]=_0x56aecc['id'];return db[_0x2099('0x5f')]['create'](_0x4afe04[_0x2099('0x5c')]);}})[_0x2099('0x26')](respondWithResult(_0x286a02,null))[_0x2099('0x30')](handleError(_0x286a02,null));};exports[_0x2099('0x6d')]=function(_0x2a4e9c,_0x1f34ca,_0x542650){var _0x2378d9={};var _0x76989a={};var _0x2925c4;var _0x51d4ec;return db[_0x2099('0x40')][_0x2099('0x6e')]({'where':{'id':_0x2a4e9c[_0x2099('0x60')]['id']}})[_0x2099('0x26')](handleEntityNotFound(_0x1f34ca,null))[_0x2099('0x26')](function(_0x4ae44e){if(_0x4ae44e){_0x2925c4=_0x4ae44e;_0x76989a[_0x2099('0x42')]=_[_0x2099('0x56')](db[_0x2099('0x5f')][_0x2099('0x41')]);_0x76989a[_0x2099('0x43')]=_[_0x2099('0x56')](_0x2a4e9c[_0x2099('0x43')]);_0x76989a[_0x2099('0x44')]=_[_0x2099('0x57')](_0x76989a[_0x2099('0x42')],_0x76989a[_0x2099('0x43')]);_0x2378d9[_0x2099('0x45')]=_[_0x2099('0x57')](_0x76989a[_0x2099('0x42')],qs['fields'](_0x2a4e9c[_0x2099('0x43')][_0x2099('0x46')]));_0x2378d9[_0x2099('0x45')]=_0x2378d9['attributes'][_0x2099('0x58')]?_0x2378d9['attributes']:_0x76989a['model'];_0x2378d9[_0x2099('0x4a')]=qs[_0x2099('0x4b')](_0x2a4e9c[_0x2099('0x43')][_0x2099('0x4b')]);_0x2378d9[_0x2099('0x4c')]=qs[_0x2099('0x44')](_[_0x2099('0x67')](_0x2a4e9c[_0x2099('0x43')],_0x76989a['filters']));if(_0x2a4e9c[_0x2099('0x43')][_0x2099('0x4d')]){_0x2378d9[_0x2099('0x4c')]=_[_0x2099('0x4e')](_0x2378d9['where'],{'$or':_['map'](_0x2378d9[_0x2099('0x45')],function(_0x20e9eb){var _0x29ea5e={};_0x29ea5e[_0x20e9eb]={'$like':'%'+_0x2a4e9c[_0x2099('0x43')][_0x2099('0x4d')]+'%'};return _0x29ea5e;})});}if(_0x2a4e9c[_0x2099('0x43')][_0x2099('0x6f')]){var _0x11dd94=_0x2a4e9c['query'][_0x2099('0x6f')][_0x2099('0x70')](',');var _0xd6f7fe={};_0xd6f7fe[_0x11dd94[0x0]]={'$gte':moment(_0x11dd94[0x1])[_0x2099('0x71')](_0x2099('0x72'))};_0x2378d9[_0x2099('0x4c')]=_['merge'](_0x2378d9['where'],_0xd6f7fe);}_0x2378d9=_['merge']({},_0x2378d9,_0x2a4e9c[_0x2099('0x53')]);return _0x2925c4['getMessages'](_0x2378d9);}})[_0x2099('0x26')](function(_0x4a4ddd){if(_0x4a4ddd){_0x51d4ec=_0x4a4ddd['length'];if(!_0x2a4e9c['query']['hasOwnProperty'](_0x2099('0x48'))){_0x2378d9['limit']=qs[_0x2099('0x49')](_0x2a4e9c[_0x2099('0x43')][_0x2099('0x49')]);_0x2378d9[_0x2099('0x36')]=qs[_0x2099('0x36')](_0x2a4e9c[_0x2099('0x43')][_0x2099('0x36')]);}return _0x2925c4['getMessages'](_0x2378d9);}})[_0x2099('0x26')](function(_0x4bb8ca){if(_0x4bb8ca){return _0x4bb8ca?{'count':_0x51d4ec,'rows':_0x4bb8ca}:null;}})[_0x2099('0x26')](respondWithResult(_0x1f34ca,null))[_0x2099('0x30')](handleError(_0x1f34ca,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 639a814..636677f 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 _0x0caf=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x10d8c7,_0xa80d12){var _0x4105b9=function(_0x46684b){while(--_0x46684b){_0x10d8c7['push'](_0x10d8c7['shift']());}};_0x4105b9(++_0xa80d12);}(_0x0caf,0xe5));var _0xf0ca=function(_0x70bcd,_0x48003a){_0x70bcd=_0x70bcd-0x0;var _0xaf627b=_0x0caf[_0x70bcd];return _0xaf627b;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xf0ca('0x0'))['db'][_0xf0ca('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf0ca('0x2')](0x0);var events={'afterCreate':_0xf0ca('0x3'),'afterUpdate':_0xf0ca('0x4'),'afterDestroy':_0xf0ca('0x5')};function emitEvent(_0x986602){return function(_0x2c4c86,_0x405621,_0x48d898){ChatGroupEvents[_0xf0ca('0x6')](_0x986602+':'+_0x2c4c86['id'],_0x2c4c86);ChatGroupEvents['emit'](_0x986602,_0x2c4c86);_0x48d898(null);};}for(var e in events){if(events[_0xf0ca('0x7')](e)){var event=events[e];ChatGroup[_0xf0ca('0x8')](e,emitEvent(event));}}module[_0xf0ca('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x8eb5=['ChatGroup','remove','emit','hasOwnProperty','hook','events'];(function(_0x3aa0c9,_0x58a375){var _0x340993=function(_0x15fa6a){while(--_0x15fa6a){_0x3aa0c9['push'](_0x3aa0c9['shift']());}};_0x340993(++_0x58a375);}(_0x8eb5,0xb3));var _0x58eb=function(_0x4021d9,_0x246b22){_0x4021d9=_0x4021d9-0x0;var _0x2f6588=_0x8eb5[_0x4021d9];return _0x2f6588;};'use strict';var EventEmitter=require(_0x58eb('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x58eb('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x58eb('0x2')};function emitEvent(_0x388a8c){return function(_0x23cc45,_0x5a487,_0x5cac88){ChatGroupEvents[_0x58eb('0x3')](_0x388a8c+':'+_0x23cc45['id'],_0x23cc45);ChatGroupEvents['emit'](_0x388a8c,_0x23cc45);_0x5cac88(null);};}for(var e in events){if(events[_0x58eb('0x4')](e)){var event=events[e];ChatGroup[_0x58eb('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 06cd3fc..fdfaaad 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 _0x0f6a=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash','util'];(function(_0x530a28,_0x5d3743){var _0x51eb29=function(_0x269519){while(--_0x269519){_0x530a28['push'](_0x530a28['shift']());}};_0x51eb29(++_0x5d3743);}(_0x0f6a,0x174));var _0xa0f6=function(_0x40c6bb,_0x54c8b9){_0x40c6bb=_0x40c6bb-0x0;var _0x1fb8c3=_0x0f6a[_0x40c6bb];return _0x1fb8c3;};'use strict';var _=require(_0xa0f6('0x0'));var util=require(_0xa0f6('0x1'));var logger=require(_0xa0f6('0x2'))('api');var moment=require(_0xa0f6('0x3'));var BPromise=require(_0xa0f6('0x4'));var rp=require(_0xa0f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa0f6('0x6'));var attributes=require(_0xa0f6('0x7'));module[_0xa0f6('0x8')]=function(_0x617d7c,_0x3b22cf){return _0x617d7c[_0xa0f6('0x9')](_0xa0f6('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f80=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x1fdfd9,_0x2e3cd1){var _0x3338da=function(_0x34497b){while(--_0x34497b){_0x1fdfd9['push'](_0x1fdfd9['shift']());}};_0x3338da(++_0x2e3cd1);}(_0x8f80,0x9c));var _0x08f8=function(_0xc9f4a6,_0x7f1690){_0xc9f4a6=_0xc9f4a6-0x0;var _0x42af6f=_0x8f80[_0xc9f4a6];return _0x42af6f;};'use strict';var _=require(_0x08f8('0x0'));var util=require('util');var logger=require(_0x08f8('0x1'))(_0x08f8('0x2'));var moment=require(_0x08f8('0x3'));var BPromise=require(_0x08f8('0x4'));var rp=require(_0x08f8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x08f8('0x6'));var config=require(_0x08f8('0x7'));var attributes=require(_0x08f8('0x8'));module[_0x08f8('0x9')]=function(_0x501fd1,_0x4f8075){return _0x501fd1[_0x08f8('0xa')](_0x08f8('0xb'),attributes,{'tableName':'chat_groups','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 5ccfff7..fcd1c6a 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 _0x04de=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x35c465,_0x145c45){var _0x265c03=function(_0x37281b){while(--_0x37281b){_0x35c465['push'](_0x35c465['shift']());}};_0x265c03(++_0x145c45);}(_0x04de,0x107));var _0xe04d=function(_0x2fca23,_0x35e9d7){_0x2fca23=_0x2fca23-0x0;var _0x40ee9a=_0x04de[_0x2fca23];return _0x40ee9a;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var moment=require(_0xe04d('0x2'));var BPromise=require(_0xe04d('0x3'));var rs=require(_0xe04d('0x4'));var fs=require('fs');var Redis=require(_0xe04d('0x5'));var db=require(_0xe04d('0x6'))['db'];var utils=require(_0xe04d('0x7'));var logger=require(_0xe04d('0x8'))(_0xe04d('0x9'));var config=require(_0xe04d('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xe04d('0xb')](config[_0xe04d('0xc')],{'host':_0xe04d('0xd'),'port':0x18eb});var socket=require(_0xe04d('0xe'))(new Redis(config[_0xe04d('0xc')]));require(_0xe04d('0xf'))[_0xe04d('0x10')](socket);function respondWithRpcPromise(_0x433350,_0x562204,_0x160d4f){return new BPromise(function(_0x21c91c,_0x2576b2){return client[_0xe04d('0x11')](_0x433350,_0x160d4f)[_0xe04d('0x12')](function(_0x3e1837){logger[_0xe04d('0x13')](_0xe04d('0x14'),_0x562204,_0xe04d('0x15'));logger['debug'](_0xe04d('0x16'),_0x562204,_0xe04d('0x15'),JSON[_0xe04d('0x17')](_0x3e1837));if(_0x3e1837[_0xe04d('0x18')]){if(_0x3e1837[_0xe04d('0x18')][_0xe04d('0x19')]===0x1f4){logger[_0xe04d('0x18')](_0xe04d('0x14'),_0x562204,_0x3e1837[_0xe04d('0x18')][_0xe04d('0x1a')]);return _0x2576b2(_0x3e1837[_0xe04d('0x18')][_0xe04d('0x1a')]);}logger['error'](_0xe04d('0x14'),_0x562204,_0x3e1837['error'][_0xe04d('0x1a')]);return _0x21c91c(_0x3e1837['error'][_0xe04d('0x1a')]);}else{logger[_0xe04d('0x13')](_0xe04d('0x14'),_0x562204,_0xe04d('0x15'));_0x21c91c(_0x3e1837[_0xe04d('0x1b')][_0xe04d('0x1a')]);}})[_0xe04d('0x1c')](function(_0x399aa0){logger[_0xe04d('0x18')]('ChatGroup,\x20%s,\x20%s',_0x562204,_0x399aa0);_0x2576b2(_0x399aa0);});});}
\ No newline at end of file
+var _0x72b1=['error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2cd6c6,_0x43e28b){var _0x84580f=function(_0x485f80){while(--_0x485f80){_0x2cd6c6['push'](_0x2cd6c6['shift']());}};_0x84580f(++_0x43e28b);}(_0x72b1,0x16e));var _0x172b=function(_0x4a1473,_0x2de7fe){_0x4a1473=_0x4a1473-0x0;var _0x54e45e=_0x72b1[_0x4a1473];return _0x54e45e;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var moment=require(_0x172b('0x1'));var BPromise=require(_0x172b('0x2'));var rs=require(_0x172b('0x3'));var fs=require('fs');var Redis=require(_0x172b('0x4'));var db=require(_0x172b('0x5'))['db'];var utils=require(_0x172b('0x6'));var logger=require(_0x172b('0x7'))('rpc');var config=require(_0x172b('0x8'));var jayson=require(_0x172b('0x9'));var client=jayson[_0x172b('0xa')][_0x172b('0xb')]({'port':0x232a});config['redis']=_[_0x172b('0xc')](config['redis'],{'host':_0x172b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x172b('0xe')]));require(_0x172b('0xf'))[_0x172b('0x10')](socket);function respondWithRpcPromise(_0x392f1e,_0x50e58a,_0x3b6daf){return new BPromise(function(_0x375bde,_0x28aaad){return client[_0x172b('0x11')](_0x392f1e,_0x3b6daf)[_0x172b('0x12')](function(_0x131762){logger[_0x172b('0x13')]('ChatGroup,\x20%s,\x20%s',_0x50e58a,_0x172b('0x14'));logger[_0x172b('0x15')](_0x172b('0x16'),_0x50e58a,'request\x20sent',JSON[_0x172b('0x17')](_0x131762));if(_0x131762['error']){if(_0x131762[_0x172b('0x18')][_0x172b('0x19')]===0x1f4){logger['error'](_0x172b('0x1a'),_0x50e58a,_0x131762[_0x172b('0x18')][_0x172b('0x1b')]);return _0x28aaad(_0x131762[_0x172b('0x18')]['message']);}logger['error'](_0x172b('0x1a'),_0x50e58a,_0x131762[_0x172b('0x18')][_0x172b('0x1b')]);return _0x375bde(_0x131762[_0x172b('0x18')]['message']);}else{logger['info'](_0x172b('0x1a'),_0x50e58a,_0x172b('0x14'));_0x375bde(_0x131762[_0x172b('0x1c')][_0x172b('0x1b')]);}})[_0x172b('0x1d')](function(_0x4e7cb9){logger[_0x172b('0x18')](_0x172b('0x1a'),_0x50e58a,_0x4e7cb9);_0x28aaad(_0x4e7cb9);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 9ffeec8..f8742d1 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 _0x8b04=['removeListener','register','chatGroup:','./chatGroup.events','save','update','emit'];(function(_0x33c10d,_0x52ddc5){var _0x299f91=function(_0x13aff1){while(--_0x13aff1){_0x33c10d['push'](_0x33c10d['shift']());}};_0x299f91(++_0x52ddc5);}(_0x8b04,0x130));var _0x48b0=function(_0x275a65,_0x5cc980){_0x275a65=_0x275a65-0x0;var _0x5cde7c=_0x8b04[_0x275a65];return _0x5cde7c;};'use strict';var ChatGroupEvents=require(_0x48b0('0x0'));var events=[_0x48b0('0x1'),'remove',_0x48b0('0x2')];function createListener(_0x4ffa3a,_0x203457){return function(_0x2d610f){_0x203457[_0x48b0('0x3')](_0x4ffa3a,_0x2d610f);};}function removeListener(_0x468c90,_0x423a40){return function(){ChatGroupEvents[_0x48b0('0x4')](_0x468c90,_0x423a40);};}exports[_0x48b0('0x5')]=function(_0x43e21c){for(var _0x357849=0x0,_0x86b615=events['length'];_0x357849<_0x86b615;_0x357849++){var _0xe04bbe=events[_0x357849];var _0x2fe681=createListener(_0x48b0('0x6')+_0xe04bbe,_0x43e21c);ChatGroupEvents['on'](_0xe04bbe,_0x2fe681);}};
\ No newline at end of file
+var _0x3402=['./chatGroup.events','remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x4daa97,_0x4a1f93){var _0x41bc26=function(_0x2aa904){while(--_0x2aa904){_0x4daa97['push'](_0x4daa97['shift']());}};_0x41bc26(++_0x4a1f93);}(_0x3402,0x1f0));var _0x2340=function(_0x4cd020,_0x14eafd){_0x4cd020=_0x4cd020-0x0;var _0x2f1764=_0x3402[_0x4cd020];return _0x2f1764;};'use strict';var ChatGroupEvents=require(_0x2340('0x0'));var events=['save',_0x2340('0x1'),_0x2340('0x2')];function createListener(_0x3a90e1,_0x5eeb10){return function(_0x5dce8b){_0x5eeb10[_0x2340('0x3')](_0x3a90e1,_0x5dce8b);};}function removeListener(_0x1180ff,_0x87db7f){return function(){ChatGroupEvents[_0x2340('0x4')](_0x1180ff,_0x87db7f);};}exports[_0x2340('0x5')]=function(_0x5dc7e6){for(var _0x5cf949=0x0,_0xc37850=events[_0x2340('0x6')];_0x5cf949<_0xc37850;_0x5cf949++){var _0x16174f=events[_0x5cf949];var _0x225250=createListener(_0x2340('0x7')+_0x16174f,_0x5dc7e6);ChatGroupEvents['on'](_0x16174f,_0x225250);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index e539925..b2682b2 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 _0xa960=['isAuthenticated','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','destroy','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe'];(function(_0x4805a6,_0x466afa){var _0x5f279d=function(_0x86daac){while(--_0x86daac){_0x4805a6['push'](_0x4805a6['shift']());}};_0x5f279d(++_0x466afa);}(_0xa960,0x1f0));var _0x0a96=function(_0x432b41,_0x5cebde){_0x432b41=_0x432b41-0x0;var _0xa9cbf1=_0xa960[_0x432b41];return _0xa9cbf1;};'use strict';var multer=require(_0x0a96('0x0'));var util=require('util');var path=require(_0x0a96('0x1'));var timeout=require(_0x0a96('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0a96('0x3'));var config=require(_0x0a96('0x4'));var controller=require(_0x0a96('0x5'));router[_0x0a96('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0a96('0x6')](_0x0a96('0x7'),auth[_0x0a96('0x8')](),controller[_0x0a96('0x9')]);router['get'](_0x0a96('0xa'),auth[_0x0a96('0x8')](),controller[_0x0a96('0xb')]);router[_0x0a96('0x6')]('/:id/unread',auth['isAuthenticated'](),controller[_0x0a96('0xc')]);router[_0x0a96('0x6')](_0x0a96('0xd'),auth[_0x0a96('0x8')](),controller[_0x0a96('0xe')]);router[_0x0a96('0x6')](_0x0a96('0xf'),auth['isAuthenticated'](),controller[_0x0a96('0x10')]);router[_0x0a96('0x11')]('/',auth[_0x0a96('0x8')](),controller['create']);router[_0x0a96('0x11')](_0x0a96('0xd'),auth['isAuthenticated'](),controller[_0x0a96('0x12')]);router['post']('/:id/messages',auth[_0x0a96('0x8')](),controller[_0x0a96('0x13')]);router[_0x0a96('0x14')](_0x0a96('0xa'),auth[_0x0a96('0x8')](),controller[_0x0a96('0x15')]);router[_0x0a96('0x16')]('/:id',auth[_0x0a96('0x8')](),controller[_0x0a96('0x17')]);router[_0x0a96('0x16')]('/:id/members',auth[_0x0a96('0x8')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0xb061=['Router','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','addMessage','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xb061,0x7d));var _0x1b06=function(_0x453378,_0x2f360c){_0x453378=_0x453378-0x0;var _0xab3d9e=_0xb061[_0x453378];return _0xab3d9e;};'use strict';var multer=require(_0x1b06('0x0'));var util=require(_0x1b06('0x1'));var path=require(_0x1b06('0x2'));var timeout=require(_0x1b06('0x3'));var express=require(_0x1b06('0x4'));var router=express[_0x1b06('0x5')]();var auth=require(_0x1b06('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1b06('0x7'));router[_0x1b06('0x8')]('/',auth[_0x1b06('0x9')](),controller[_0x1b06('0xa')]);router[_0x1b06('0x8')](_0x1b06('0xb'),auth[_0x1b06('0x9')](),controller['describe']);router[_0x1b06('0x8')](_0x1b06('0xc'),auth[_0x1b06('0x9')](),controller[_0x1b06('0xd')]);router[_0x1b06('0x8')]('/:id/unread',auth['isAuthenticated'](),controller[_0x1b06('0xe')]);router[_0x1b06('0x8')](_0x1b06('0xf'),auth[_0x1b06('0x9')](),controller[_0x1b06('0x10')]);router['get'](_0x1b06('0x11'),auth['isAuthenticated'](),controller[_0x1b06('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1b06('0x13')]);router[_0x1b06('0x14')](_0x1b06('0xf'),auth[_0x1b06('0x9')](),controller[_0x1b06('0x15')]);router[_0x1b06('0x14')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1b06('0x16')]);router['put'](_0x1b06('0xc'),auth[_0x1b06('0x9')](),controller['update']);router[_0x1b06('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x1b06('0x18')]);router[_0x1b06('0x17')](_0x1b06('0xf'),auth[_0x1b06('0x9')](),controller['removeMembers']);module[_0x1b06('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index e13d92f..16a2d15 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 _0x6cb4=['long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x282993,_0x4c25ae){var _0x432388=function(_0x374b19){while(--_0x374b19){_0x282993['push'](_0x282993['shift']());}};_0x432388(++_0x4c25ae);}(_0x6cb4,0xff));var _0x46cb=function(_0x2bbbdc,_0x40dfa5){_0x2bbbdc=_0x2bbbdc-0x0;var _0x32b36e=_0x6cb4[_0x2bbbdc];return _0x32b36e;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'closed':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x46cb('0x3')]},'ratingType':{'type':Sequelize[_0x46cb('0x4')](_0x46cb('0x5'),_0x46cb('0x6')),'defaultValue':_0x46cb('0x5')},'ratingMessage':{'type':Sequelize[_0x46cb('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x46cb('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x46cb('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x46cb('0x8')]},'browserVersion':{'type':Sequelize[_0x46cb('0x8')]},'osName':{'type':Sequelize[_0x46cb('0x8')]},'osVersion':{'type':Sequelize[_0x46cb('0x8')]},'deviceModel':{'type':Sequelize[_0x46cb('0x8')]},'deviceVendor':{'type':Sequelize[_0x46cb('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x46cb('0x8')]},'customerIp':{'type':Sequelize[_0x46cb('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x46cb('0x9'))},'read1stAt':{'type':Sequelize[_0x46cb('0xa')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x46cb('0x4')]('in',_0x46cb('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3266=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long','DATE','out','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3266,0x6a));var _0x6326=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x3266[_0x1ebce2];return _0x4a330c;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'closed':{'type':Sequelize[_0x6326('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6326('0x3')]},'ratingType':{'type':Sequelize[_0x6326('0x4')](_0x6326('0x5'),_0x6326('0x6')),'defaultValue':_0x6326('0x5')},'ratingMessage':{'type':Sequelize[_0x6326('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x6326('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6326('0x8')]},'note':{'type':Sequelize[_0x6326('0x8')]},'browserName':{'type':Sequelize[_0x6326('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x6326('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x6326('0x8')]},'deviceVendor':{'type':Sequelize[_0x6326('0x8')]},'deviceType':{'type':Sequelize[_0x6326('0x8')]},'referer':{'type':Sequelize[_0x6326('0x8')]},'customerIp':{'type':Sequelize[_0x6326('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x6326('0x9'))},'read1stAt':{'type':Sequelize[_0x6326('0xa')]},'lastMsgAt':{'type':Sequelize[_0x6326('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x6326('0x4')]('in',_0x6326('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6326('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 051d97b..15d4c59 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 _0x55e0=['me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','user_has_chat_interactions','left_join','chat_interactions','ui.UserId\x20=\x20i.UserId','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','expr','advancedFilter','parse','forEach','createdAt','value','dateStart','startOf','day','format','utc','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','Messages.count','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','c.email','\x20LIKE\x20?','\x20>\x20?','length','\x20IN\x20?','map','hasOwnProperty','filter','isNil','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','$lte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','push','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','Sequelize','QueryTypes','clone','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20IN\x20?','mail_interaction_has_tags','t.id\x20=\x20it.TagId','sequelize','keyBy','merge','ChatInteraction','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','u.fullname','TagIds','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','Users','Tags','rows','catch','show','params','includeAll','options','find','create','describe','customUpdate','body','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','filename','type','mimetype','Attachment','attachmentDownload','findOne','join','server/files/attachments/','basename','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','SendMail','\x22%s\x22\x20<%s>','email','user','addMessage','ids','getMessages','pick','$gte','includeAgent','include','findAll','setTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Account','Owner','get','10px','40px','30px',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','YYYY-MM-DD','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','browserName','osName','referer','customerIp','tail','existsSync','pipe','createWriteStream','out','renderFile','views','downloadInteraction.html','toFile','.pdf','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','end','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','select','field','from','tools_tags','COUNT(*)','chat_messages'];(function(_0x43b92f,_0x41371f){var _0x23cb82=function(_0x241f22){while(--_0x241f22){_0x43b92f['push'](_0x43b92f['shift']());}};_0x23cb82(++_0x41371f);}(_0x55e0,0xdc));var _0x055e=function(_0x210950,_0x12b86c){_0x210950=_0x210950-0x0;var _0x212a5d=_0x55e0[_0x210950];return _0x212a5d;};'use strict';var pdf=require(_0x055e('0x0'));var emlformat=require(_0x055e('0x1'));var rimraf=require(_0x055e('0x2'));var zipdir=require(_0x055e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x055e('0x4'));var BPromise=require(_0x055e('0x5'));var Mustache=require(_0x055e('0x6'));var util=require(_0x055e('0x7'));var path=require(_0x055e('0x8'));var sox=require(_0x055e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x055e('0xa'));var squel=require('squel');var crypto=require(_0x055e('0xb'));var jsforce=require(_0x055e('0xc'));var deskjs=require(_0x055e('0xd'));var toCsv=require(_0x055e('0xe'));var querystring=require(_0x055e('0xf'));var Papa=require('papaparse');var Redis=require(_0x055e('0x10'));var authService=require(_0x055e('0x11'));var qs=require(_0x055e('0x12'));var hardwareService=require(_0x055e('0x13'));var logger=require(_0x055e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x055e('0x15'));var db=require('../../mysqldb')['db'];config[_0x055e('0x16')]=_[_0x055e('0x17')](config[_0x055e('0x16')],{'host':_0x055e('0x18'),'port':0x18eb});var socket=require(_0x055e('0x19'))(new Redis(config[_0x055e('0x16')]));require(_0x055e('0x1a'))['register'](socket);var jayson=require(_0x055e('0x1b'));var client=jayson[_0x055e('0x1c')][_0x055e('0x1d')]({'port':0x232b});var client9004=jayson[_0x055e('0x1c')][_0x055e('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x56af18,_0x230674,_0x2fe55f){if(_0x2fe55f){var _0x111cdb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x111cdb['test'](_0x230674)){return _0x56af18;}else{throw new Error(_0x055e('0x1e'));}}else{return _0x56af18;}}function respondWithRpcPromise(_0x2c377c,_0xb4e6ca,_0x2bad86,_0x2cc84e){return new BPromise(function(_0x4c85dd,_0x36ef10){var _0x2cf3de=_0x2cc84e||client;return _0x2cf3de[_0x055e('0x1f')](_0x2c377c,_0x2bad86)[_0x055e('0x20')](function(_0x5660a7){logger[_0x055e('0x21')](_0x055e('0x22'),_0xb4e6ca,'request\x20sent');logger[_0x055e('0x23')](_0x055e('0x24'),_0xb4e6ca,_0x055e('0x25'),JSON[_0x055e('0x26')](_0x5660a7));if(_0x5660a7[_0x055e('0x27')]){if(_0x5660a7[_0x055e('0x27')]['code']===0x1f4){logger[_0x055e('0x27')](_0x055e('0x22'),_0xb4e6ca,_0x5660a7[_0x055e('0x27')]['message']);return _0x36ef10(_0x5660a7[_0x055e('0x27')][_0x055e('0x28')]);}logger[_0x055e('0x27')](_0x055e('0x22'),_0xb4e6ca,_0x5660a7['error'][_0x055e('0x28')]);return _0x4c85dd(_0x5660a7['error'][_0x055e('0x28')]);}else{logger[_0x055e('0x21')](_0x055e('0x22'),_0xb4e6ca,_0x055e('0x25'));_0x4c85dd(_0x5660a7[_0x055e('0x29')][_0x055e('0x28')]);}})['catch'](function(_0x2fb49b){logger[_0x055e('0x27')](_0x055e('0x22'),_0xb4e6ca,_0x2fb49b);_0x36ef10(_0x2fb49b);});});}function respondWithStatusCode(_0x4b5891,_0x408e38){_0x408e38=_0x408e38||0xcc;return function(_0x29078a){if(_0x29078a){return _0x4b5891[_0x055e('0x2a')](_0x408e38);}return _0x4b5891[_0x055e('0x2b')](_0x408e38)['end']();};}function respondWithResult(_0x27f81a,_0x5958ef){_0x5958ef=_0x5958ef||0xc8;return function(_0x1528c3){if(_0x1528c3){return _0x27f81a[_0x055e('0x2b')](_0x5958ef)[_0x055e('0x2c')](_0x1528c3);}};}function respondWithFilteredResult(_0x7822db,_0x1610f1){return function(_0x5c0e76){if(_0x5c0e76){var _0x99a372=_0x5c0e76[_0x055e('0x2d')],_0x453e5e=_0x1610f1[_0x055e('0x2e')],_0x293062=_0x1610f1[_0x055e('0x2e')]+_0x1610f1[_0x055e('0x2f')],_0x1499e1;if(_0x293062>=_0x99a372){_0x293062=_0x99a372;_0x1499e1=0xc8;}else{_0x1499e1=0xce;}_0x7822db['status'](_0x1499e1);return _0x7822db[_0x055e('0x30')](_0x055e('0x31'),_0x453e5e+'-'+_0x293062+'/'+_0x99a372)['json'](_0x5c0e76);}return null;};}function patchUpdates(_0xd9298d){return function(_0x1319bd){try{jsonpatch[_0x055e('0x32')](_0x1319bd,_0xd9298d,!![]);}catch(_0x20717b){return BPromise[_0x055e('0x33')](_0x20717b);}return _0x1319bd[_0x055e('0x34')]();};}function saveUpdates(_0x5e1a92,_0x5ddf59){return function(_0x25d19d){if(_0x25d19d){return _0x25d19d['update'](_0x5e1a92)['then'](function(_0x55a1ee){return _0x55a1ee;});}return null;};}function removeEntity(_0x31ee60,_0x436a3c){return function(_0x35c6cf){if(_0x35c6cf){return _0x35c6cf[_0x055e('0x35')]()[_0x055e('0x20')](function(){_0x31ee60[_0x055e('0x2b')](0xcc)[_0x055e('0x36')]();});}};}function handleEntityNotFound(_0x106543,_0x42a33e){return function(_0x2f60fa){if(!_0x2f60fa){_0x106543[_0x055e('0x2a')](0x194);}return _0x2f60fa;};}function handleError(_0x263a81,_0x54539e){_0x54539e=_0x54539e||0x1f4;return function(_0x571b75){logger[_0x055e('0x27')](_0x571b75[_0x055e('0x37')]);if(_0x571b75[_0x055e('0x38')]){delete _0x571b75[_0x055e('0x38')];}_0x263a81[_0x055e('0x2b')](_0x54539e)[_0x055e('0x39')](_0x571b75);};}exports[_0x055e('0x3a')]=function(_0x4f24f8,_0x18b88e){var _0x265fed={},_0x3e9d25={},_0x14b6ab={'count':0x0,'rows':[]};var _0x44dbd1=db['ChatInteraction'][_0x055e('0x3b')];_0x3e9d25[_0x055e('0x3c')]=_['keys'](_0x44dbd1);_0x3e9d25[_0x055e('0x3d')]=_[_0x055e('0x3e')](_0x4f24f8['query']);_0x3e9d25[_0x055e('0x3f')]=_[_0x055e('0x40')](_0x3e9d25['model'],_0x3e9d25[_0x055e('0x3d')]);_0x265fed[_0x055e('0x41')]=_['intersection'](_0x3e9d25[_0x055e('0x3c')],qs[_0x055e('0x42')](_0x4f24f8[_0x055e('0x3d')]['fields']));_0x265fed[_0x055e('0x41')]=_0x265fed[_0x055e('0x41')]['length']?_0x265fed[_0x055e('0x41')]:_0x3e9d25[_0x055e('0x3c')];if(!_0x4f24f8[_0x055e('0x3d')]['hasOwnProperty'](_0x055e('0x43'))){_0x265fed[_0x055e('0x2f')]=qs[_0x055e('0x2f')](_0x4f24f8['query']['limit']);_0x265fed[_0x055e('0x2e')]=qs[_0x055e('0x2e')](_0x4f24f8['query'][_0x055e('0x2e')]);}_0x265fed['order']=qs[_0x055e('0x44')](_0x4f24f8['query'][_0x055e('0x44')]);_0x265fed[_0x055e('0x45')]=qs[_0x055e('0x3f')](_['pick'](_0x4f24f8['query'],_0x3e9d25[_0x055e('0x3f')]));var _0x2e90fb=[];var _0x414884=squel[_0x055e('0x46')]()['field']('id')['field'](_0x055e('0x38'))[_0x055e('0x47')]('color')[_0x055e('0x48')](_0x055e('0x49'));var _0xcb7d81=squel[_0x055e('0x46')]()[_0x055e('0x47')](_0x055e('0x4a'))['from'](_0x055e('0x4b'),'me')[_0x055e('0x45')]('me.ChatInteractionId\x20=\x20i.id')[_0x055e('0x45')](_0x055e('0x4c'))[_0x055e('0x45')](_0x055e('0x4d'));var _0x1bade9=squel[_0x055e('0x46')]()[_0x055e('0x47')]('u.id')[_0x055e('0x47')]('ui.ChatInteractionId')[_0x055e('0x48')](_0x055e('0x4e'),'ui')[_0x055e('0x4f')]('users','u','u.id\x20=\x20ui.UserId');var _0x45845e=squel[_0x055e('0x46')]()[_0x055e('0x48')](_0x055e('0x50'),'i')[_0x055e('0x4f')](_0x055e('0x4e'),'ui',_0x055e('0x51'))[_0x055e('0x4f')](_0x055e('0x52'),'u','u.id\x20=\x20ui.UserId')[_0x055e('0x4f')](_0x055e('0x53'),'c',_0x055e('0x54'))[_0x055e('0x4f')](_0x055e('0x52'),'o','o.id\x20=\x20i.UserId')[_0x055e('0x4f')](_0x055e('0x55'),'a',_0x055e('0x56'))['left_join'](_0x055e('0x4b'),'me','me.ChatInteractionId\x20=\x20i.id');var _0x15e442=squel[_0x055e('0x57')]();if(_0x4f24f8['query'][_0x055e('0x58')]){var _0x5349b4=JSON[_0x055e('0x59')](_0x4f24f8['query']['advancedFilter']);_[_0x055e('0x3e')](_0x5349b4)[_0x055e('0x5a')](function(_0x393717){var _0x248e5f=_0x5349b4[_0x393717];if(_0x393717===_0x055e('0x5b')){var _0x2ceb8d=moment(_0x248e5f[_0x055e('0x5c')][_0x055e('0x5d')])[_0x055e('0x5e')](_0x055e('0x5f'))['utc']()[_0x055e('0x60')]();var _0x7f03ed=moment(_0x7f03ed)[_0x055e('0x61')]()[_0x055e('0x62')]('day')[_0x055e('0x60')]();_0x15e442[_0x055e('0x63')](_0x055e('0x64'),_0x2ceb8d,_0x7f03ed);}else{if(_[_0x055e('0x65')](_0x248e5f['condition'])){_0x248e5f['condition'][_0x055e('0x5a')](function(_0xd3a451){switch(_0x248e5f[_0x055e('0x66')][_0x055e('0x5c')]){case'IS':if(_0x393717!==_0x055e('0x67')&&_0x393717!==_0x055e('0x68')){if(_[_0x055e('0x65')](_0x248e5f[_0x055e('0x5c')])&&_0x248e5f['value']['length']>0x1){_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+'\x20IN\x20?',_0x248e5f[_0x055e('0x5c')]);}else{_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x6a'),_0x248e5f['value'][0x0]);}}break;case'=':_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x6a'),_0x248e5f[_0x055e('0x5c')]);break;case _0x055e('0x6b'):if(_0x393717===_0x055e('0x6c')){_0x15e442[_0x055e('0x63')](_0x055e('0x6d')+'\x20LIKE\x20?','%'+_0x248e5f[_0x055e('0x5c')]+'%');_0x15e442['or'](_0x055e('0x6e')+'\x20LIKE\x20?','%'+_0x248e5f[_0x055e('0x5c')]+'%');_0x15e442['or'](_0x055e('0x6f')+_0x055e('0x70'),'%'+_0x248e5f[_0x055e('0x5c')]+'%');}else{_0x15e442['and'](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x70'),'%'+_0x248e5f[_0x055e('0x5c')]+'%');}break;case'>':_0x15e442['and'](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x71'),_0x248e5f[_0x055e('0x5c')]);break;case'<':_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+'\x20<\x20?',_0x248e5f[_0x055e('0x5c')]);break;}});}else{switch(_0x248e5f[_0x055e('0x66')][_0x055e('0x5c')]){case'IS':if(_0x393717!==_0x055e('0x67')&&_0x393717!==_0x055e('0x68')){if(_['isArray'](_0x248e5f[_0x055e('0x5c')])&&_0x248e5f[_0x055e('0x5c')][_0x055e('0x72')]>0x1){_0x15e442['and'](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x73'),_0x248e5f[_0x055e('0x5c')]);}else{_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+'\x20=\x20?',_0x248e5f[_0x055e('0x5c')][0x0]);}}break;case'=':_0x15e442['and'](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x6a'),_0x248e5f['value']);break;case _0x055e('0x6b'):if(_0x393717===_0x055e('0x6c')){_0x15e442[_0x055e('0x63')](_0x055e('0x6d')+'\x20LIKE\x20?','%'+_0x248e5f['value']+'%');_0x15e442['or'](_0x055e('0x6e')+'\x20LIKE\x20?','%'+_0x248e5f[_0x055e('0x5c')]+'%');_0x15e442['or'](_0x055e('0x6f')+_0x055e('0x70'),'%'+_0x248e5f[_0x055e('0x5c')]+'%');}else{_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x70'),'%'+_0x248e5f[_0x055e('0x5c')]+'%');}break;case'>':_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+'\x20>\x20?',_0x248e5f['value']);break;case'<':_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+'\x20<\x20?',_0x248e5f[_0x055e('0x5c')]);break;}}}});}else{var _0x55e1d7=_(Object[_0x055e('0x3e')](_0x4f24f8[_0x055e('0x3d')]))[_0x055e('0x74')](function(_0x23acf1){return _0x44dbd1[_0x055e('0x75')](_0x23acf1)?_0x23acf1:undefined;})[_0x055e('0x76')](function(_0x992681){return!_[_0x055e('0x77')](_0x992681);})['value']();if(!_[_0x055e('0x78')](_0x55e1d7)){_0x55e1d7[_0x055e('0x5a')](function(_0x471e26){if(_0x471e26===_0x055e('0x79')){_0x45845e[_0x055e('0x45')](_0x055e('0x7a'),[][_0x055e('0x7b')](_0x4f24f8[_0x055e('0x3d')][_0x471e26]));}else if(_0x471e26===_0x055e('0x5b')){var _0x5763c7=JSON[_0x055e('0x59')](_0x4f24f8[_0x055e('0x3d')][_0x471e26])['$gte'];var _0x2dbc12=JSON[_0x055e('0x59')](_0x4f24f8[_0x055e('0x3d')][_0x471e26])[_0x055e('0x7c')];_0x45845e['where'](_0x055e('0x64'),_0x5763c7,_0x2dbc12);}else{_0x45845e[_0x055e('0x45')]('i.'+_0x471e26+_0x055e('0x6a'),_0x4f24f8[_0x055e('0x3d')][_0x471e26]);}});}if(_0x4f24f8[_0x055e('0x3d')]['filter']){var _0x256c65=_0x4f24f8[_0x055e('0x3d')][_0x055e('0x76')][_0x055e('0x7d')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x055e('0x7e'));if(qs[_0x055e('0x7f')](_0x256c65)){_0x15e442['or'](_0x055e('0x80'),_0x256c65+'%');}else{var _0x8e92b4=[];_0x256c65[_0x055e('0x81')]('\x20')['forEach'](function(_0x3ec891){_0x8e92b4[_0x055e('0x82')]('+'+_0x3ec891[_0x055e('0x83')]());});var _0x1f3ba4=_0x8e92b4['join']('\x20');_0x15e442['or'](_0x055e('0x84'),_0x1f3ba4)['or'](_0x055e('0x85'),_0x256c65+'%');}}}_0x45845e[_0x055e('0x45')](_0x15e442);if(_0x265fed[_0x055e('0x86')]){_0x265fed['order'][_0x055e('0x5a')](function(_0x8e77e0){_0x45845e[_0x055e('0x86')]('i.'+_0x8e77e0[0x0],_0x8e77e0[0x1]===_0x055e('0x87')?![]:!![]);});}_0x45845e[_0x055e('0x88')]('i.id');var _0x26da8f={'type':db[_0x055e('0x89')][_0x055e('0x8a')]['SELECT'],'raw':!![]};var _0x588aea=_0x45845e[_0x055e('0x8b')]()['field'](_0x055e('0x4a'));if(!_0x4f24f8[_0x055e('0x3d')]['advancedFilter']){if(_0x4f24f8[_0x055e('0x3d')][_0x055e('0x8c')]){if(_0x4f24f8[_0x055e('0x3d')][_0x055e('0x8c')]==0x1){_0x588aea[_0x055e('0x45')](util[_0x055e('0x60')](_0x055e('0x8d'),_0xcb7d81[_0x055e('0x83')]()));_0x45845e[_0x055e('0x8e')](_0x055e('0x8f'));}else{_0x588aea[_0x055e('0x45')](util[_0x055e('0x60')](_0x055e('0x90'),_0xcb7d81[_0x055e('0x83')]()));_0x45845e[_0x055e('0x8e')](_0x055e('0x91'));}}if(_0x4f24f8['query'][_0x055e('0x92')]){var _0x50fd59=_['isArray'](_0x4f24f8[_0x055e('0x3d')][_0x055e('0x92')])?_0x4f24f8[_0x055e('0x3d')]['tag']:new Array(_0x4f24f8[_0x055e('0x3d')][_0x055e('0x92')]);var _0x47ed9c=squel[_0x055e('0x57')]();_0x50fd59[_0x055e('0x5a')](function(_0x5c3210){_0x47ed9c['or'](_0x055e('0x93'),'%,'+_0x5c3210+',%');});_0x45845e['having'](_0x47ed9c);_0x588aea[_0x055e('0x4f')](_0x055e('0x94'),'it',_0x055e('0x95'));_0x588aea[_0x055e('0x4f')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x588aea['where'](_0x055e('0x96'),_0x50fd59);}}else{var _0x5349b4=JSON['parse'](_0x4f24f8[_0x055e('0x3d')]['advancedFilter']);_[_0x055e('0x3e')](_0x5349b4)[_0x055e('0x5a')](function(_0x15a107){var _0x1c3a1a=_0x5349b4[_0x15a107];if(_0x15a107==='TagId'){var _0x4f0209=_0x1c3a1a[_0x055e('0x5c')];var _0x2af129=squel[_0x055e('0x57')]();_0x4f0209[_0x055e('0x5a')](function(_0x422f6f){_0x2af129['or'](_0x055e('0x93'),'%,'+_0x422f6f+',%');});_0x45845e[_0x055e('0x8e')](_0x2af129);_0x588aea['left_join'](_0x055e('0x97'),'it','it.MailInteractionId\x20=\x20i.id');_0x588aea['left_join'](_0x055e('0x49'),'t',_0x055e('0x98'));_0x588aea[_0x055e('0x45')]('t.id\x20IN\x20?',_0x4f0209);}else if(_0x15a107===_0x055e('0x68')){if(_0x1c3a1a[_0x055e('0x5c')][_0x055e('0x72')]===0x1){if(_0x1c3a1a['value'][0x0]===0x1){_0x588aea[_0x055e('0x45')](util[_0x055e('0x60')](_0x055e('0x8d'),_0xcb7d81[_0x055e('0x83')]()));_0x45845e[_0x055e('0x8e')](_0x055e('0x8f'));}else{_0x588aea[_0x055e('0x45')](util[_0x055e('0x60')](_0x055e('0x90'),_0xcb7d81[_0x055e('0x83')]()));_0x45845e[_0x055e('0x8e')](_0x055e('0x91'));}}}});}db[_0x055e('0x99')][_0x055e('0x3d')](_0x588aea[_0x055e('0x83')](),_0x26da8f)[_0x055e('0x20')](function(_0x554ef9){_0x14b6ab[_0x055e('0x2d')]=_0x554ef9[_0x055e('0x72')];if(_0x14b6ab[_0x055e('0x2d')]===0x0)return[];return db['sequelize']['query'](_0x414884['toString'](),_0x26da8f)[_0x055e('0x20')](function(_0x10cee9){_0x2e90fb=_[_0x055e('0x9a')](_0x10cee9,'id');_0x26da8f=_[_0x055e('0x9b')](_0x26da8f,{'model':db[_0x055e('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x45845e[_0x055e('0x47')](_0xcb7d81,_0x055e('0x68'));_0x45845e[_0x055e('0x47')]('a.key',_0x055e('0x9d'));_0x45845e[_0x055e('0x47')](_0x055e('0x9e'));_0x45845e[_0x055e('0x47')](_0x055e('0x6d'),_0x055e('0x9f'));_0x45845e[_0x055e('0x47')](_0x055e('0x6e'),_0x055e('0xa0'));_0x45845e[_0x055e('0x47')](_0x055e('0x6f'),_0x055e('0xa1'));_0x45845e['field']('c.phone',_0x055e('0xa2'));_0x45845e[_0x055e('0x47')](_0x055e('0xa3'),'Contact.mobile');_0x45845e[_0x055e('0x47')](_0x055e('0xa4'),_0x055e('0xa5'));_0x45845e['field'](_0x055e('0xa6'),'User.name');_0x45845e[_0x055e('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x055e('0xa7'));_0x45845e[_0x055e('0x4f')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id');_0x45845e[_0x055e('0x4f')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x45845e[_0x055e('0x2f')](_0x265fed[_0x055e('0x2f')]);_0x45845e[_0x055e('0x2e')](_0x265fed[_0x055e('0x2e')]);return db[_0x055e('0x99')]['query'](_0x45845e[_0x055e('0x83')](),_0x26da8f);})[_0x055e('0x20')](function(_0x51f758){_0x1bade9[_0x055e('0x45')](_0x055e('0xa8'),_[_0x055e('0x74')](_0x51f758,'id'));return db[_0x055e('0x99')][_0x055e('0x3d')](_0x1bade9[_0x055e('0x83')](),_0x26da8f)[_0x055e('0x20')](function(_0x1fd7ba){var _0x4be7a6=_[_0x055e('0xa9')](_0x1fd7ba,_0x055e('0xaa'));_0x51f758[_0x055e('0x5a')](function(_0x20383b){if(_0x4be7a6[_0x20383b['id']]){_0x20383b[_0x055e('0xab')]=_[_0x055e('0x74')](_0x4be7a6[_0x20383b['id']],function(_0xf22117){return{'id':_0xf22117['id']};});}if(_0x20383b[_0x055e('0xa7')]){_0x20383b[_0x055e('0xac')]=[];_0x20383b[_0x055e('0xa7')][_0x055e('0x81')](',')['forEach'](function(_0x42d6db){_0x20383b[_0x055e('0xac')][_0x055e('0x82')](_0x2e90fb[_0x42d6db]);});}delete _0x20383b['TagIds'];});return _0x51f758;});});})['then'](function(_0x35e203){_0x14b6ab[_0x055e('0xad')]=_0x35e203;return _0x14b6ab;})[_0x055e('0x20')](respondWithFilteredResult(_0x18b88e,_0x265fed))[_0x055e('0xae')](handleError(_0x18b88e,null));};exports[_0x055e('0xaf')]=function(_0x3cd8e5,_0x505cc4){var _0x2a7994={'raw':![],'where':{'id':_0x3cd8e5[_0x055e('0xb0')]['id']}},_0x2af8ad={};_0x2af8ad[_0x055e('0x3c')]=_[_0x055e('0x3e')](db[_0x055e('0x9c')][_0x055e('0x3b')]);_0x2af8ad[_0x055e('0x3d')]=_[_0x055e('0x3e')](_0x3cd8e5['query']);_0x2af8ad['filters']=_['intersection'](_0x2af8ad[_0x055e('0x3c')],_0x2af8ad[_0x055e('0x3d')]);_0x2a7994[_0x055e('0x41')]=_['intersection'](_0x2af8ad[_0x055e('0x3c')],qs[_0x055e('0x42')](_0x3cd8e5[_0x055e('0x3d')][_0x055e('0x42')]));_0x2a7994[_0x055e('0x41')]=_0x2a7994[_0x055e('0x41')][_0x055e('0x72')]?_0x2a7994[_0x055e('0x41')]:_0x2af8ad['model'];if(_0x3cd8e5[_0x055e('0x3d')][_0x055e('0xb1')]){_0x2a7994['include']=[{'all':!![]}];}_0x2a7994=_['merge']({},_0x2a7994,_0x3cd8e5[_0x055e('0xb2')]);return db[_0x055e('0x9c')][_0x055e('0xb3')](_0x2a7994)[_0x055e('0x20')](handleEntityNotFound(_0x505cc4,null))['then'](respondWithResult(_0x505cc4,null))['catch'](handleError(_0x505cc4,null));};exports[_0x055e('0xb4')]=function(_0x444091,_0x1ec15a){return db[_0x055e('0x9c')][_0x055e('0xb4')](_0x444091['body'],{})[_0x055e('0x20')](respondWithResult(_0x1ec15a,0xc9))[_0x055e('0xae')](handleError(_0x1ec15a,null));};exports['update']=function(_0xf1ac18,_0x48d2ad){if(_0xf1ac18['body']['id']){delete _0xf1ac18['body']['id'];}return db[_0x055e('0x9c')][_0x055e('0xb3')]({'where':{'id':_0xf1ac18['params']['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x48d2ad,null))[_0x055e('0x20')](saveUpdates(_0xf1ac18['body'],null))[_0x055e('0x20')](respondWithResult(_0x48d2ad,null))['catch'](handleError(_0x48d2ad,null));};exports[_0x055e('0x35')]=function(_0x4d4521,_0x3d5a6){return db[_0x055e('0x9c')][_0x055e('0xb3')]({'where':{'id':_0x4d4521[_0x055e('0xb0')]['id']}})['then'](handleEntityNotFound(_0x3d5a6,null))[_0x055e('0x20')](removeEntity(_0x3d5a6,null))[_0x055e('0xae')](handleError(_0x3d5a6,null));};exports['describe']=function(_0x280aeb,_0x116f84){return db[_0x055e('0x9c')][_0x055e('0xb5')]()[_0x055e('0x20')](respondWithResult(_0x116f84,null))[_0x055e('0xae')](handleError(_0x116f84,null));};exports[_0x055e('0xb6')]=function(_0x3b2401,_0x15792f){if(_0x3b2401[_0x055e('0xb7')]['id']){delete _0x3b2401[_0x055e('0xb7')]['id'];}return db[_0x055e('0x9c')][_0x055e('0xb3')]({'where':{'id':_0x3b2401[_0x055e('0xb0')]['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x15792f,null))[_0x055e('0x20')](saveUpdates(_0x3b2401['body'],null))[_0x055e('0x20')](respondWithResult(_0x15792f,null))['catch'](handleError(_0x15792f,null));};exports[_0x055e('0xb8')]=function(_0x146dfb,_0x5ca835,_0xfb3b6d){if(_0x146dfb['body']['id']){delete _0x146dfb[_0x055e('0xb7')]['id'];}return db['ChatInteraction'][_0x055e('0xb3')]({'where':{'id':_0x146dfb[_0x055e('0xb0')]['id']}})['then'](function(_0x25972f){if(!_0x25972f){logger[_0x055e('0x27')](_0x055e('0xb9'),'abandon',0x194,_0x055e('0xba'));_0x5ca835[_0x055e('0x2a')](0x194);}else{if(_0x25972f[_0x055e('0xbb')]){throw new db[(_0x055e('0x89'))][(_0x055e('0xbc'))](_0x055e('0xbd'));}}return _0x25972f;})['then'](function(_0x41b2af){if(_0x41b2af){return _0x41b2af['update']({'closed':_0x146dfb[_0x055e('0xb7')][_0x055e('0xbe')],'disposition':_0x146dfb['body']['disposition']})[_0x055e('0x20')](function(_0x5cb9f6){return _0x5cb9f6;});}})['then'](function(_0x24b914){return respondWithRpcPromise('AbandonInteraction',_0x055e('0xb8'),_0x146dfb['body'],client9004);})[_0x055e('0x20')](respondWithResult(_0x5ca835,null))[_0x055e('0xae')](handleError(_0x5ca835,null));};exports[_0x055e('0xbf')]=function(_0x1f6d63,_0x21cda6,_0x50dc55){_0x1f6d63['body'][_0x055e('0x38')]=_0x1f6d63[_0x055e('0xc0')][_0x055e('0xc1')];_0x1f6d63[_0x055e('0xb7')]['basename']=_0x1f6d63[_0x055e('0xc0')][_0x055e('0xc2')];_0x1f6d63['body'][_0x055e('0xc3')]=_0x1f6d63[_0x055e('0xc0')][_0x055e('0xc4')];return db[_0x055e('0xc5')][_0x055e('0xb4')](_0x1f6d63[_0x055e('0xb7')])['then'](respondWithResult(_0x21cda6,0xc9))[_0x055e('0xae')](handleError(_0x21cda6,null));};exports[_0x055e('0xc6')]=function(_0x943d86,_0x557c92,_0x38a846){return db[_0x055e('0x9c')][_0x055e('0xc7')]({'where':{'id':_0x943d86['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x557c92,null))[_0x055e('0x20')](function(_0x1152ff){if(_0x1152ff){if(_0x1152ff['closed']){return _0x557c92['status'](0x193)[_0x055e('0x2c')]({'status':0x193,'message':'Unauthorized'});}return db[_0x055e('0xc5')][_0x055e('0xc7')]({'where':{'id':_0x943d86[_0x055e('0x3d')]['attachId']},'raw':!![]})[_0x055e('0x20')](handleEntityNotFound(_0x557c92,null));}})[_0x055e('0x20')](function(_0x330428){if(_0x330428){return _0x557c92['download'](path[_0x055e('0xc8')](config['root'],_0x055e('0xc9'),_0x330428[_0x055e('0xca')]));}})[_0x055e('0xae')](handleError(_0x557c92,null));};exports[_0x055e('0xcb')]=function(_0x27fb93,_0x16533d){var _0x1f54e3=null;var _0x36fe22=null;var _0xd83a95=null;var _0x2b3b85=null;if(_0x27fb93[_0x055e('0xb7')]['id']){delete _0x27fb93['body']['id'];}if(_0x27fb93['body'][_0x055e('0xcc')]){_0x2b3b85=path[_0x055e('0xc8')](config[_0x055e('0xcd')],_0x055e('0xce'),util[_0x055e('0x60')](_0x055e('0xcf'),Date['now']()));_0x27fb93[_0x055e('0xb7')][_0x055e('0xd0')]=_0x2b3b85;}return db[_0x055e('0x9c')][_0x055e('0xb3')]({'where':{'id':_0x27fb93[_0x055e('0xb0')]['id']},'include':[{'model':db[_0x055e('0xd1')],'as':_0x055e('0xd2'),'include':[{'model':db[_0x055e('0xd3')],'as':'User'}]}]})[_0x055e('0x20')](handleEntityNotFound(_0x16533d,null))[_0x055e('0x20')](saveUpdates(_0x27fb93['body'],null))[_0x055e('0x20')](function(_0x27c819){if(_0x27c819){_0x1f54e3=_0x27c819;return db['ChatWebsite'][_0x055e('0xb3')]({'where':{'id':_0x1f54e3[_0x055e('0x79')]}});}})[_0x055e('0x20')](function(_0x478e91){if(_0x478e91){_0xd83a95=_0x478e91;return db[_0x055e('0xd4')]['find']({'where':{'id':_0x1f54e3['ContactId']}});}})[_0x055e('0x20')](function(_0x400ab5){if(_0x400ab5){_0x36fe22=_0x400ab5;if(_0x2b3b85){var _0x324439=null;for(var _0x1b749a=0x1;_0x1b749a<_0x1f54e3[_0x055e('0xd2')][_0x055e('0x72')];++_0x1b749a){_0x324439=_0x1f54e3[_0x055e('0xd2')][_0x1b749a];var _0x144713=_0x324439[_0x055e('0xbb')]?util[_0x055e('0x60')](_0x055e('0xd5'),_0xd83a95[_0x055e('0xd6')],_0x324439['UserId']):_0x055e('0xd7');var _0x19fcbe=_0x27fb93[_0x055e('0xb7')][_0x055e('0xd8')]||util[_0x055e('0x60')](_0x055e('0xd5'),_0x055e('0xd9'),_0x324439['ContactId']);switch(_0xd83a95[_0x055e('0xda')]){case _0x055e('0xdb'):_0x144713=_0x324439[_0x055e('0xbb')]?util[_0x055e('0x60')](_0x055e('0xd5'),_0xd83a95[_0x055e('0xd6')],_0x324439[_0x055e('0xbb')]):_0x055e('0xd7');break;case _0x055e('0xdc'):_0x144713=_0x324439[_0x055e('0xbb')]?_0x324439['User']['alias']||_0x324439[_0x055e('0xd3')][_0x055e('0xdd')]:_0x055e('0xd7');break;case _0x055e('0xde'):_0x144713=_0x324439[_0x055e('0xbb')]?_0x324439['User'][_0x055e('0xdd')]:_0x055e('0xd7');break;default:_0x144713=_0x324439[_0x055e('0xbb')]?util[_0x055e('0x60')](_0x055e('0xd5'),_0xd83a95['agentAlias'],_0x324439[_0x055e('0xbb')]):_0x055e('0xd7');}var _0x187d87=util[_0x055e('0x60')](_0x055e('0xdf'),moment(_0x324439[_0x055e('0x5b')])[_0x055e('0x60')](_0x055e('0xe0')),_0x324439[_0x055e('0xe1')]==='in'?_0x19fcbe:_0x144713,_0x324439[_0x055e('0xb7')]);if(!_0x324439[_0x055e('0xe2')]){fs['appendFileSync'](_0x2b3b85,_0x187d87);}}return db[_0x055e('0xe3')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x055e('0xe4')],'as':_0x055e('0xe5'),'raw':!![]}]});}}})['then'](function(_0x5887c9){if(_0x5887c9&&_0x5887c9['Smtp']&&_0x27fb93[_0x055e('0xb7')]){var _0x3d12ee={'tls':{'rejectUnauthorized':![]}};if(_0x5887c9['Smtp'][_0x055e('0xe6')]){_0x3d12ee[_0x055e('0xe6')]=_0x5887c9[_0x055e('0xe5')][_0x055e('0xe6')];}else{_0x3d12ee[_0x055e('0xe7')]=_0x5887c9[_0x055e('0xe5')]['host'];_0x3d12ee[_0x055e('0xe8')]=_0x5887c9[_0x055e('0xe5')]['port'];_0x3d12ee[_0x055e('0xe9')]=_0x5887c9[_0x055e('0xe5')]['secure'];}if(_0x5887c9[_0x055e('0xe5')][_0x055e('0xea')]){_0x3d12ee['auth']={'user':_0x5887c9[_0x055e('0xe5')]['user'],'pass':_0x5887c9[_0x055e('0xe5')]['pass']};}return respondWithRpcPromise(_0x055e('0xeb'),'sendMail',{'account':_0x3d12ee,'message':{'from':util[_0x055e('0x60')](_0x055e('0xec'),_0x5887c9[_0x055e('0x38')],_0x5887c9[_0x055e('0xed')]||_0x5887c9[_0x055e('0xe5')][_0x055e('0xee')]),'to':_0x27fb93[_0x055e('0xb7')][_0x055e('0xcc')],'subject':'Mail\x20Transcript','text':util[_0x055e('0x60')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x27fb93['body'][_0x055e('0xcc')]),'attachments':[{'path':_0x2b3b85}]}})['then'](function(){return _0x1f54e3;})[_0x055e('0xae')](function(_0x3527b3){console[_0x055e('0x27')](_0x3527b3);});}else{return _0x1f54e3;}})[_0x055e('0x20')](respondWithStatusCode(_0x16533d,0xc8))[_0x055e('0xae')](handleError(_0x16533d,null));};exports[_0x055e('0xef')]=function(_0x2d0361,_0x21e2f1,_0x3c1b2d){return db[_0x055e('0xd1')]['find']({'where':{'id':_0x2d0361[_0x055e('0xb0')]['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x21e2f1,null))[_0x055e('0x20')](function(_0xbce420){if(_0xbce420){return _0xbce420[_0x055e('0xef')](_0x2d0361[_0x055e('0xb7')][_0x055e('0xf0')],_['omit'](_0x2d0361[_0x055e('0xb7')],[_0x055e('0xf0'),'id'])||{});}})['then'](respondWithResult(_0x21e2f1,null))['catch'](handleError(_0x21e2f1,null));};exports[_0x055e('0xf1')]=function(_0x5f1f11,_0x10ddaf,_0x4e2614){var _0xd4c8cf={'raw':![],'where':{}};var _0x50f088={};var _0x29c7a4={'count':0x0,'rows':[]};return db[_0x055e('0x9c')][_0x055e('0xc7')]({'where':{'id':_0x5f1f11['params']['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x10ddaf,null))[_0x055e('0x20')](function(_0x43038c){if(_0x43038c){_0x50f088[_0x055e('0x3c')]=_[_0x055e('0x3e')](db[_0x055e('0xd1')][_0x055e('0x3b')]);_0x50f088[_0x055e('0x3d')]=_[_0x055e('0x3e')](_0x5f1f11['query']);_0x50f088['filters']=_[_0x055e('0x40')](_0x50f088[_0x055e('0x3c')],_0x50f088[_0x055e('0x3d')]);_0xd4c8cf[_0x055e('0x41')]=_['intersection'](_0x50f088[_0x055e('0x3c')],qs['fields'](_0x5f1f11[_0x055e('0x3d')][_0x055e('0x42')]));_0xd4c8cf[_0x055e('0x41')]=_0xd4c8cf[_0x055e('0x41')]['length']?_0xd4c8cf[_0x055e('0x41')]:_0x50f088[_0x055e('0x3c')];if(!_0x5f1f11[_0x055e('0x3d')][_0x055e('0x75')](_0x055e('0x43'))){_0xd4c8cf[_0x055e('0x2f')]=qs['limit'](_0x5f1f11[_0x055e('0x3d')][_0x055e('0x2f')]);_0xd4c8cf[_0x055e('0x2e')]=qs[_0x055e('0x2e')](_0x5f1f11['query'][_0x055e('0x2e')]);}_0xd4c8cf['order']=qs['sort'](_0x5f1f11[_0x055e('0x3d')]['sort']);_0xd4c8cf['where']=qs[_0x055e('0x3f')](_[_0x055e('0xf2')](_0x5f1f11['query'],_0x50f088['filters']));_0xd4c8cf[_0x055e('0x45')][_0x055e('0xaa')]=_0x43038c['id'];if(_0x5f1f11['query'][_0x055e('0x76')]){_0xd4c8cf[_0x055e('0x45')]=_['merge'](_0xd4c8cf[_0x055e('0x45')],{'$or':_[_0x055e('0x74')](_0xd4c8cf[_0x055e('0x41')],function(_0x8557c9){var _0x2ca760={};_0x2ca760[_0x8557c9]={'$like':'%'+_0x5f1f11[_0x055e('0x3d')][_0x055e('0x76')]+'%'};return _0x2ca760;})});}if(_0x5f1f11['query'][_0x055e('0xf3')]){var _0x49d120=_0x5f1f11['query'][_0x055e('0xf3')][_0x055e('0x81')](',');var _0x293731={};_0x293731[_0x49d120[0x0]]={'$gte':moment(_0x49d120[0x1])[_0x055e('0x60')]('YYYY-MM-DD\x20HH:mm:ss')};_0xd4c8cf['where']=_[_0x055e('0x9b')](_0xd4c8cf[_0x055e('0x45')],_0x293731);}_0xd4c8cf=_['merge']({},_0xd4c8cf,_0x5f1f11[_0x055e('0xb2')]);return db[_0x055e('0xd1')]['count']({'where':_0xd4c8cf[_0x055e('0x45')]})[_0x055e('0x20')](function(_0xe4d59){_0x29c7a4['count']=_0xe4d59;if(_0x5f1f11['query'][_0x055e('0xb1')]){_0xd4c8cf['include']=[{'all':!![]}];}return db[_0x055e('0xd1')]['findAll'](_0xd4c8cf);})['then'](function(_0x1fe5b7){_0x29c7a4[_0x055e('0xad')]=_0x1fe5b7;return _0x29c7a4;});}})[_0x055e('0x20')](respondWithFilteredResult(_0x10ddaf,_0xd4c8cf))[_0x055e('0xae')](handleError(_0x10ddaf,null));};exports['getMyMessages']=function(_0x104f2c,_0x56ac62,_0x5af152){var _0xd3a6c={'where':{}},_0x27a4d7={},_0x69ab07={'count':0x0,'rows':[]};return db[_0x055e('0x9c')][_0x055e('0xc7')]({'where':{'id':_0x104f2c[_0x055e('0xb0')]['id']}})['then'](handleEntityNotFound(_0x56ac62,null))[_0x055e('0x20')](function(_0x1f3b3d){if(_0x1f3b3d){_0x27a4d7[_0x055e('0x3c')]=_[_0x055e('0x3e')](db[_0x055e('0xd1')]['rawAttributes']);_0x27a4d7[_0x055e('0x3d')]=_['keys'](_0x104f2c['query']);_0x27a4d7[_0x055e('0x3f')]=_['intersection'](_0x27a4d7[_0x055e('0x3c')],_0x27a4d7[_0x055e('0x3d')]);_0xd3a6c[_0x055e('0x41')]=_['intersection'](_0x27a4d7[_0x055e('0x3c')],qs[_0x055e('0x42')](_0x104f2c['query'][_0x055e('0x42')]));_0xd3a6c[_0x055e('0x41')]=_0xd3a6c[_0x055e('0x41')][_0x055e('0x72')]?_0xd3a6c[_0x055e('0x41')]:_0x27a4d7[_0x055e('0x3c')];if(!_0x104f2c[_0x055e('0x3d')][_0x055e('0x75')](_0x055e('0x43'))){_0xd3a6c[_0x055e('0x2f')]=qs['limit'](_0x104f2c['query']['limit']);_0xd3a6c[_0x055e('0x2e')]=qs['offset'](_0x104f2c[_0x055e('0x3d')]['offset']);}_0xd3a6c['order']=qs[_0x055e('0x44')](_0x104f2c[_0x055e('0x3d')][_0x055e('0x44')]);_0xd3a6c[_0x055e('0x45')]=qs[_0x055e('0x3f')](_[_0x055e('0xf2')](_0x104f2c['query'],_0x27a4d7['filters']));_0xd3a6c[_0x055e('0x45')][_0x055e('0xaa')]=_0x1f3b3d['id'];if(_0x104f2c[_0x055e('0x3d')][_0x055e('0x76')]){_0xd3a6c['where']=_[_0x055e('0x9b')](_0xd3a6c[_0x055e('0x45')],{'$or':_[_0x055e('0x74')](_0xd3a6c[_0x055e('0x41')],function(_0x716344){var _0x3f0bbe={};_0x3f0bbe[_0x716344]={'$like':'%'+_0x104f2c[_0x055e('0x3d')]['filter']+'%'};return _0x3f0bbe;})});}_0xd3a6c[_0x055e('0x45')][_0x055e('0xe2')]=![];if(_0x104f2c[_0x055e('0x3d')]['id']){_0xd3a6c[_0x055e('0x45')]['id']={'$gt':_0x104f2c['query']['id']};}_0xd3a6c=_[_0x055e('0x9b')]({},_0xd3a6c,_0x104f2c[_0x055e('0xb2')]);return db['ChatMessage'][_0x055e('0x2d')]({'where':_0xd3a6c['where']})[_0x055e('0x20')](function(_0xa82e99){_0x69ab07['count']=_0xa82e99;_0xd3a6c['include']=[];if(_0x104f2c[_0x055e('0x3d')][_0x055e('0xf4')]){_0xd3a6c[_0x055e('0xf5')][_0x055e('0x82')]({'model':db['User'],'as':_0x055e('0xd3'),'attributes':['id',_0x055e('0xdd'),'alias']});}if(_0x104f2c[_0x055e('0x3d')][_0x055e('0xb1')]){_0xd3a6c[_0x055e('0xf5')]=[{'all':!![]}];}return db[_0x055e('0xd1')][_0x055e('0xf6')](_0xd3a6c);})[_0x055e('0x20')](function(_0x455f17){_0x69ab07['rows']=_0x455f17;return _0x69ab07;});}})[_0x055e('0x20')](respondWithFilteredResult(_0x56ac62,_0xd3a6c))[_0x055e('0xae')](handleError(_0x56ac62,null));};exports['addTags']=function(_0x5e68a1,_0x2a0732,_0x40b8cf){return db['ChatInteraction']['find']({'where':{'id':_0x5e68a1['params']['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x2a0732,null))[_0x055e('0x20')](function(_0x2e690d){if(_0x2e690d){return _0x2e690d[_0x055e('0xf7')](_0x5e68a1['body'][_0x055e('0xf0')],_[_0x055e('0xf8')](_0x5e68a1[_0x055e('0xb7')],[_0x055e('0xf0'),'id'])||{})[_0x055e('0xf9')](function(){return db[_0x055e('0xfa')][_0x055e('0xf6')]({'attributes':['id',_0x055e('0x38'),_0x055e('0xfb')],'where':{'id':_0x5e68a1[_0x055e('0xb7')][_0x055e('0xf0')]}});})['then'](function(_0x177661){socket[_0x055e('0xfc')](_0x055e('0xfd'),{'id':Number(_0x5e68a1[_0x055e('0xb0')]['id']),'tags':_0x177661||[]});return{'id':Number(_0x5e68a1['params']['id']),'tags':_0x177661||[]};});}})['then'](respondWithResult(_0x2a0732,null))['catch'](handleError(_0x2a0732,null));};exports['removeTags']=function(_0x55bdef,_0x56a608,_0x348631){return db['ChatInteraction']['find']({'where':{'id':_0x55bdef['params']['id']}})['then'](handleEntityNotFound(_0x56a608,null))[_0x055e('0x20')](function(_0x5a6f8e){if(_0x5a6f8e){return _0x5a6f8e[_0x055e('0xfe')](_0x55bdef['query'][_0x055e('0xf0')]);}})['then'](respondWithStatusCode(_0x56a608,null))[_0x055e('0xae')](handleError(_0x56a608,null));};exports['download']=function(_0x132596,_0x17cb4d){var _0x411090=moment()['unix']()[_0x055e('0x83')]();var _0x55e3e8=path[_0x055e('0xc8')](config[_0x055e('0xcd')],_0x055e('0xff'),_0x055e('0x100'),_0x055e('0x101'));var _0x5eee8e=path[_0x055e('0xc8')](config['root'],_0x055e('0xff'),_0x055e('0x100'),_0x055e('0x102'));var _0x2c482b=path['join'](_0x55e3e8,_0x411090);var _0x597e1d=util[_0x055e('0x60')](_0x055e('0x103'),_0x132596[_0x055e('0xb0')]['id'],_0x411090);var _0x197687=path['join'](_0x55e3e8,_0x597e1d);var _0x1f14d1=![];return db['ChatInteraction'][_0x055e('0xb3')]({'where':{'id':_0x132596[_0x055e('0xb0')]['id']},'include':[{'model':db[_0x055e('0xd1')],'as':_0x055e('0xd2'),'attributes':['id',_0x055e('0xb7'),_0x055e('0x5b'),'direction',_0x055e('0xe2')],'include':[{'model':db[_0x055e('0xd3')],'as':_0x055e('0xd3'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x055e('0xd4')],'as':_0x055e('0x104'),'attributes':['id',_0x055e('0x105'),_0x055e('0x106')],'raw':!![]},{'model':db['Attachment'],'as':_0x055e('0xc5'),'raw':!![]}]},{'model':db['ChatWebsite'],'as':_0x055e('0x107'),'attributes':['id',_0x055e('0x38')]},{'model':db[_0x055e('0xd3')],'as':_0x055e('0x108'),'attributes':['id',_0x055e('0xdd')]}]})[_0x055e('0x20')](handleEntityNotFound(_0x17cb4d,null))['then'](function(_0xedd4a7){if(_0xedd4a7){var _0x3971ec=_0xedd4a7[_0x055e('0x109')]({'plain':!![]});_0x1f14d1=!![];var _0x27e111={'format':'A4','border':_0x055e('0x10a'),'header':{'height':_0x055e('0x10b'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
'}},'footer':{'height':_0x055e('0x10c'),'contents':{'default':util['format'](_0x055e('0x10d'),util[_0x055e('0x60')](_0x055e('0x10e'),'Chat',_0x3971ec['id']),moment()[_0x055e('0x60')](_0x055e('0x10f'))['toString']())}}};fs[_0x055e('0x110')](_0x2c482b);var _0x4c8dcf={'channel':_0x055e('0x111'),'account':_0x3971ec[_0x055e('0x107')][_0x055e('0x38')],'agent':_0x3971ec[_0x055e('0x108')]?_0x3971ec[_0x055e('0x108')][_0x055e('0xdd')]:_0x055e('0x112'),'createdAt':moment(_0x3971ec[_0x055e('0x5b')])[_0x055e('0x60')](_0x055e('0x113'))['toString'](),'closedAt':_0x3971ec[_0x055e('0xbe')]?moment(_0x3971ec[_0x055e('0x114')])[_0x055e('0x60')](_0x055e('0x113'))[_0x055e('0x83')]():'','disposition':_0x3971ec[_0x055e('0x115')],'chatInfo':{'browser':_0x3971ec[_0x055e('0x116')],'os':_0x3971ec[_0x055e('0x117')],'referer':_0x3971ec[_0x055e('0x118')],'customerIp':_0x3971ec[_0x055e('0x119')]},'messages':_(_0x3971ec['Messages'])[_0x055e('0x11a')]()[_0x055e('0x76')]({'secret':![]})[_0x055e('0x74')](function(_0x3a14e0){if(_0x3a14e0[_0x055e('0xc5')]){var _0x179782=path[_0x055e('0xc8')](_0x5eee8e,_0x3a14e0['Attachment'][_0x055e('0xca')]);if(fs[_0x055e('0x11b')](_0x179782)){fs['createReadStream'](_0x179782)[_0x055e('0x11c')](fs[_0x055e('0x11d')](path['join'](_0x2c482b,_0x3a14e0[_0x055e('0xc5')][_0x055e('0xca')])));}}return{'date':moment(_0x3a14e0[_0x055e('0x5b')])[_0x055e('0x60')](_0x055e('0x113'))[_0x055e('0x83')](),'sender':_0x3a14e0[_0x055e('0xe1')]==='out'?_0x3a14e0[_0x055e('0xd3')]?_0x3a14e0[_0x055e('0xd3')]['fullname']:_0x055e('0xd7'):_0x3a14e0[_0x055e('0x104')]['firstName']+(_0x3a14e0[_0x055e('0x104')][_0x055e('0x106')]?'\x20'+_0x3a14e0[_0x055e('0x104')][_0x055e('0x106')]:''),'body':_0x3a14e0[_0x055e('0xc5')]?_0x3a14e0[_0x055e('0xc5')]['basename']:_0x3a14e0['body'],'direction':_0x3a14e0['direction']===_0x055e('0x11e')?'A':'C','secret':_0x3a14e0[_0x055e('0xe2')],'attachment':_0x3a14e0['Attachment']};})[_0x055e('0x5c')]()};return ejs[_0x055e('0x11f')](path[_0x055e('0xc8')](config[_0x055e('0xcd')],_0x055e('0xff'),_0x055e('0x120'),_0x055e('0x121')),{'interaction':_0x4c8dcf})['then'](function(_0x516cd1){return new BPromise(function(_0x103006,_0x484ba3){pdf[_0x055e('0xb4')](_0x516cd1,_0x27e111)[_0x055e('0x122')](path['join'](_0x2c482b,'transcript-'+_0x3971ec['id']+'-'+_0x411090+_0x055e('0x123')),function(_0x2e02d0,_0x4f91b1){if(_0x2e02d0)return _0x484ba3(_0x2e02d0);_0x103006(_0x4f91b1);});});});}})[_0x055e('0x20')](function(){if(_0x1f14d1){return new BPromise(function(_0x572f41,_0x5548ae){zipdir(_0x2c482b,{'saveTo':_0x197687},function(_0x21919e,_0x2630d9){if(_0x21919e)return _0x5548ae(_0x21919e);return _0x572f41(_0x2630d9);});})[_0x055e('0x20')](function(){return new BPromise(function(_0x1b2876,_0x34de1a){rimraf(_0x2c482b,function(_0x11088c){if(_0x11088c)_0x34de1a(_0x11088c);return _0x1b2876();});});})[_0x055e('0x20')](function(){return _0x17cb4d[_0x055e('0x124')](_0x197687,_0x597e1d,function(_0x540fd7){if(_0x540fd7){console[_0x055e('0x125')](_0x055e('0x126'),_0x540fd7);}else{fs[_0x055e('0x127')](_0x197687);}});});}else{return _0x17cb4d[_0x055e('0x2a')](0xc8);}})['catch'](handleError(_0x17cb4d,null));};
\ No newline at end of file
+var _0xe706=['isNumeric','i.id\x20LIKE\x20?','split','toString','join','order','QueryTypes','SELECT','clone','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','count','keyBy','merge','a.key','i.*','Contact.firstName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','chat_interaction_has_tags','ui.ChatInteractionId\x20IN\x20?','groupBy','Tags','push','rows','catch','params','includeAll','options','create','body','find','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','basename','filename','mimetype','attachmentDownload','findOne','Unauthorized','Attachment','attachId','download','server/files/attachments/','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','ChatWebsite','%s%d','System','customer','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','sendMail','\x22%s\x22\x20<%s>','email','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','sort','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','secret','addTags','setTags','spread','Tag','emit','removeTags','unix','tmp','server','files','attachments','Contact','firstName','lastName','Account','Owner','get','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Chat','YYYY-MM-DD','mkdirSync','browserName','osName','referer','customerIp','tail','existsSync','createReadStream','createWriteStream','out','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ChatInteraction','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','select','field','color','from','tools_tags','COUNT(*)','chat_messages','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_chat_interactions','left_join','users','chat_interactions','ui.UserId\x20=\x20i.UserId','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','expr','advancedFilter','parse','forEach','createdAt','dateStart','startOf','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','TagId','Messages.count','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','map','filter','isNil','isEmpty','ChatWebsiteId','concat','$gte','replace','\x27\x27\x27\x27'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe706,0xa3));var _0x6e70=function(_0x20410e,_0x11ea83){_0x20410e=_0x20410e-0x0;var _0x18e1cc=_0xe706[_0x20410e];return _0x18e1cc;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var hardwareService=require(_0x6e70('0x17'));var logger=require(_0x6e70('0x18'))(_0x6e70('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6e70('0x1a'))['db'];config[_0x6e70('0x1b')]=_[_0x6e70('0x1c')](config[_0x6e70('0x1b')],{'host':_0x6e70('0x1d'),'port':0x18eb});var socket=require(_0x6e70('0x1e'))(new Redis(config[_0x6e70('0x1b')]));require(_0x6e70('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x6e70('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function checkPasswordPattern(_0x304716,_0x22c50c,_0x5d9263){if(_0x5d9263){var _0x24f3ac=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24f3ac['test'](_0x22c50c)){return _0x304716;}else{throw new Error(_0x6e70('0x21'));}}else{return _0x304716;}}function respondWithRpcPromise(_0x161f23,_0x4ca554,_0x49029f,_0x3bd572){return new BPromise(function(_0x5ea7a5,_0x28a21f){var _0x173afe=_0x3bd572||client;return _0x173afe['request'](_0x161f23,_0x49029f)['then'](function(_0xc238ba){logger[_0x6e70('0x22')](_0x6e70('0x23'),_0x4ca554,_0x6e70('0x24'));logger[_0x6e70('0x25')](_0x6e70('0x26'),_0x4ca554,_0x6e70('0x24'),JSON[_0x6e70('0x27')](_0xc238ba));if(_0xc238ba[_0x6e70('0x28')]){if(_0xc238ba[_0x6e70('0x28')]['code']===0x1f4){logger[_0x6e70('0x28')](_0x6e70('0x23'),_0x4ca554,_0xc238ba[_0x6e70('0x28')]['message']);return _0x28a21f(_0xc238ba[_0x6e70('0x28')][_0x6e70('0x29')]);}logger[_0x6e70('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x4ca554,_0xc238ba[_0x6e70('0x28')]['message']);return _0x5ea7a5(_0xc238ba['error']['message']);}else{logger[_0x6e70('0x22')](_0x6e70('0x23'),_0x4ca554,'request\x20sent');_0x5ea7a5(_0xc238ba[_0x6e70('0x2a')][_0x6e70('0x29')]);}})['catch'](function(_0x338ad6){logger[_0x6e70('0x28')](_0x6e70('0x23'),_0x4ca554,_0x338ad6);_0x28a21f(_0x338ad6);});});}function respondWithStatusCode(_0x4a67ac,_0x54a5fe){_0x54a5fe=_0x54a5fe||0xcc;return function(_0x2c4d37){if(_0x2c4d37){return _0x4a67ac[_0x6e70('0x2b')](_0x54a5fe);}return _0x4a67ac[_0x6e70('0x2c')](_0x54a5fe)[_0x6e70('0x2d')]();};}function respondWithResult(_0x43fee0,_0x5d772a){_0x5d772a=_0x5d772a||0xc8;return function(_0x1952ea){if(_0x1952ea){return _0x43fee0[_0x6e70('0x2c')](_0x5d772a)[_0x6e70('0x2e')](_0x1952ea);}};}function respondWithFilteredResult(_0x2864a0,_0x396a67){return function(_0x20a225){if(_0x20a225){var _0x3f78d2=_0x20a225['count'],_0x24114a=_0x396a67[_0x6e70('0x2f')],_0x3a0821=_0x396a67['offset']+_0x396a67[_0x6e70('0x30')],_0x3a5d30;if(_0x3a0821>=_0x3f78d2){_0x3a0821=_0x3f78d2;_0x3a5d30=0xc8;}else{_0x3a5d30=0xce;}_0x2864a0['status'](_0x3a5d30);return _0x2864a0[_0x6e70('0x31')](_0x6e70('0x32'),_0x24114a+'-'+_0x3a0821+'/'+_0x3f78d2)[_0x6e70('0x2e')](_0x20a225);}return null;};}function patchUpdates(_0x56f6f7){return function(_0x38c40d){try{jsonpatch[_0x6e70('0x33')](_0x38c40d,_0x56f6f7,!![]);}catch(_0x5780a1){return BPromise[_0x6e70('0x34')](_0x5780a1);}return _0x38c40d[_0x6e70('0x35')]();};}function saveUpdates(_0x52b457,_0x10d8f6){return function(_0x3665a1){if(_0x3665a1){return _0x3665a1[_0x6e70('0x36')](_0x52b457)[_0x6e70('0x37')](function(_0x3b4a13){return _0x3b4a13;});}return null;};}function removeEntity(_0x1e3e76,_0x44b19d){return function(_0x3f42bd){if(_0x3f42bd){return _0x3f42bd[_0x6e70('0x38')]()[_0x6e70('0x37')](function(){_0x1e3e76['status'](0xcc)[_0x6e70('0x2d')]();});}};}function handleEntityNotFound(_0x4795a0,_0x23cd1a){return function(_0x3222a2){if(!_0x3222a2){_0x4795a0[_0x6e70('0x2b')](0x194);}return _0x3222a2;};}function handleError(_0x32d12d,_0x233a83){_0x233a83=_0x233a83||0x1f4;return function(_0x989b80){logger[_0x6e70('0x28')](_0x989b80[_0x6e70('0x39')]);if(_0x989b80[_0x6e70('0x3a')]){delete _0x989b80[_0x6e70('0x3a')];}_0x32d12d[_0x6e70('0x2c')](_0x233a83)[_0x6e70('0x3b')](_0x989b80);};}exports[_0x6e70('0x3c')]=function(_0x501b53,_0x5446a2){var _0x5424eb={},_0x155a46={},_0x3841a0={'count':0x0,'rows':[]};var _0x2cb5b0=db[_0x6e70('0x3d')][_0x6e70('0x3e')];_0x155a46[_0x6e70('0x3f')]=_['keys'](_0x2cb5b0);_0x155a46[_0x6e70('0x40')]=_[_0x6e70('0x41')](_0x501b53[_0x6e70('0x40')]);_0x155a46[_0x6e70('0x42')]=_[_0x6e70('0x43')](_0x155a46[_0x6e70('0x3f')],_0x155a46[_0x6e70('0x40')]);_0x5424eb[_0x6e70('0x44')]=_['intersection'](_0x155a46[_0x6e70('0x3f')],qs[_0x6e70('0x45')](_0x501b53[_0x6e70('0x40')][_0x6e70('0x45')]));_0x5424eb[_0x6e70('0x44')]=_0x5424eb[_0x6e70('0x44')][_0x6e70('0x46')]?_0x5424eb['attributes']:_0x155a46['model'];if(!_0x501b53['query'][_0x6e70('0x47')](_0x6e70('0x48'))){_0x5424eb[_0x6e70('0x30')]=qs[_0x6e70('0x30')](_0x501b53[_0x6e70('0x40')]['limit']);_0x5424eb[_0x6e70('0x2f')]=qs[_0x6e70('0x2f')](_0x501b53[_0x6e70('0x40')]['offset']);}_0x5424eb['order']=qs['sort'](_0x501b53[_0x6e70('0x40')]['sort']);_0x5424eb[_0x6e70('0x49')]=qs[_0x6e70('0x42')](_[_0x6e70('0x4a')](_0x501b53[_0x6e70('0x40')],_0x155a46['filters']));var _0x62b925=[];var _0x4d1243=squel[_0x6e70('0x4b')]()[_0x6e70('0x4c')]('id')[_0x6e70('0x4c')](_0x6e70('0x3a'))['field'](_0x6e70('0x4d'))[_0x6e70('0x4e')](_0x6e70('0x4f'));var _0xac87d6=squel[_0x6e70('0x4b')]()[_0x6e70('0x4c')](_0x6e70('0x50'))['from'](_0x6e70('0x51'),'me')[_0x6e70('0x49')](_0x6e70('0x52'))[_0x6e70('0x49')](_0x6e70('0x53'))[_0x6e70('0x49')](_0x6e70('0x54'));var _0x4ab26e=squel[_0x6e70('0x4b')]()['field'](_0x6e70('0x55'))[_0x6e70('0x4c')]('ui.ChatInteractionId')['from'](_0x6e70('0x56'),'ui')[_0x6e70('0x57')](_0x6e70('0x58'),'u','u.id\x20=\x20ui.UserId');var _0x4af9b1=squel[_0x6e70('0x4b')]()[_0x6e70('0x4e')](_0x6e70('0x59'),'i')[_0x6e70('0x57')](_0x6e70('0x56'),'ui',_0x6e70('0x5a'))['left_join'](_0x6e70('0x58'),'u',_0x6e70('0x5b'))[_0x6e70('0x57')](_0x6e70('0x5c'),'c',_0x6e70('0x5d'))['left_join']('users','o',_0x6e70('0x5e'))[_0x6e70('0x57')](_0x6e70('0x5f'),'a',_0x6e70('0x60'))[_0x6e70('0x57')]('chat_messages','me',_0x6e70('0x52'));var _0x232366=squel[_0x6e70('0x61')]();if(_0x501b53[_0x6e70('0x40')][_0x6e70('0x62')]){var _0x4b201f=JSON[_0x6e70('0x63')](_0x501b53[_0x6e70('0x40')][_0x6e70('0x62')]);_[_0x6e70('0x41')](_0x4b201f)[_0x6e70('0x64')](function(_0x3fd03d){var _0x5d2e29=_0x4b201f[_0x3fd03d];if(_0x3fd03d===_0x6e70('0x65')){var _0x8d425d=moment(_0x5d2e29['value'][_0x6e70('0x66')])[_0x6e70('0x67')]('day')[_0x6e70('0x68')]()[_0x6e70('0x69')]();var _0x2134c4=moment(_0x2134c4)[_0x6e70('0x68')]()[_0x6e70('0x6a')]('day')[_0x6e70('0x69')]();_0x232366[_0x6e70('0x6b')](_0x6e70('0x6c'),_0x8d425d,_0x2134c4);}else{if(_[_0x6e70('0x6d')](_0x5d2e29[_0x6e70('0x6e')])){_0x5d2e29[_0x6e70('0x6e')][_0x6e70('0x64')](function(_0x2e2587){switch(_0x5d2e29[_0x6e70('0x6e')][_0x6e70('0x6f')]){case'IS':if(_0x3fd03d!==_0x6e70('0x70')&&_0x3fd03d!==_0x6e70('0x71')){if(_[_0x6e70('0x6d')](_0x5d2e29[_0x6e70('0x6f')])&&_0x5d2e29[_0x6e70('0x6f')][_0x6e70('0x46')]>0x1){_0x232366[_0x6e70('0x6b')](_0x5d2e29[_0x6e70('0x72')]+'.'+_0x3fd03d+_0x6e70('0x73'),_0x5d2e29[_0x6e70('0x6f')]);}else{_0x232366['and'](_0x5d2e29[_0x6e70('0x72')]+'.'+_0x3fd03d+_0x6e70('0x74'),_0x5d2e29[_0x6e70('0x6f')][0x0]);}}break;case'=':_0x232366[_0x6e70('0x6b')](_0x5d2e29[_0x6e70('0x72')]+'.'+_0x3fd03d+_0x6e70('0x74'),_0x5d2e29['value']);break;case _0x6e70('0x75'):if(_0x3fd03d===_0x6e70('0x76')){_0x232366['and'](_0x6e70('0x77')+_0x6e70('0x78'),'%'+_0x5d2e29[_0x6e70('0x6f')]+'%');_0x232366['or']('c.lastName'+'\x20LIKE\x20?','%'+_0x5d2e29[_0x6e70('0x6f')]+'%');_0x232366['or'](_0x6e70('0x79')+_0x6e70('0x78'),'%'+_0x5d2e29[_0x6e70('0x6f')]+'%');}else{_0x232366[_0x6e70('0x6b')](_0x5d2e29[_0x6e70('0x72')]+'.'+_0x3fd03d+_0x6e70('0x78'),'%'+_0x5d2e29['value']+'%');}break;case'>':_0x232366['and'](_0x5d2e29[_0x6e70('0x72')]+'.'+_0x3fd03d+_0x6e70('0x7a'),_0x5d2e29[_0x6e70('0x6f')]);break;case'<':_0x232366[_0x6e70('0x6b')](_0x5d2e29['tableAlias']+'.'+_0x3fd03d+'\x20<\x20?',_0x5d2e29[_0x6e70('0x6f')]);break;}});}else{switch(_0x5d2e29[_0x6e70('0x6e')]['value']){case'IS':if(_0x3fd03d!=='TagId'&&_0x3fd03d!==_0x6e70('0x71')){if(_['isArray'](_0x5d2e29[_0x6e70('0x6f')])&&_0x5d2e29[_0x6e70('0x6f')][_0x6e70('0x46')]>0x1){_0x232366[_0x6e70('0x6b')](_0x5d2e29[_0x6e70('0x72')]+'.'+_0x3fd03d+_0x6e70('0x73'),_0x5d2e29[_0x6e70('0x6f')]);}else{_0x232366[_0x6e70('0x6b')](_0x5d2e29['tableAlias']+'.'+_0x3fd03d+_0x6e70('0x74'),_0x5d2e29[_0x6e70('0x6f')][0x0]);}}break;case'=':_0x232366[_0x6e70('0x6b')](_0x5d2e29[_0x6e70('0x72')]+'.'+_0x3fd03d+_0x6e70('0x74'),_0x5d2e29['value']);break;case'LIKE':if(_0x3fd03d==='ContactId'){_0x232366[_0x6e70('0x6b')](_0x6e70('0x77')+_0x6e70('0x78'),'%'+_0x5d2e29['value']+'%');_0x232366['or']('c.lastName'+_0x6e70('0x78'),'%'+_0x5d2e29[_0x6e70('0x6f')]+'%');_0x232366['or'](_0x6e70('0x79')+_0x6e70('0x78'),'%'+_0x5d2e29[_0x6e70('0x6f')]+'%');}else{_0x232366[_0x6e70('0x6b')](_0x5d2e29['tableAlias']+'.'+_0x3fd03d+_0x6e70('0x78'),'%'+_0x5d2e29[_0x6e70('0x6f')]+'%');}break;case'>':_0x232366[_0x6e70('0x6b')](_0x5d2e29[_0x6e70('0x72')]+'.'+_0x3fd03d+'\x20>\x20?',_0x5d2e29[_0x6e70('0x6f')]);break;case'<':_0x232366['and'](_0x5d2e29['tableAlias']+'.'+_0x3fd03d+_0x6e70('0x7b'),_0x5d2e29[_0x6e70('0x6f')]);break;}}}});}else{var _0x3f37c1=_(Object[_0x6e70('0x41')](_0x501b53[_0x6e70('0x40')]))[_0x6e70('0x7c')](function(_0x4b5b19){return _0x2cb5b0[_0x6e70('0x47')](_0x4b5b19)?_0x4b5b19:undefined;})[_0x6e70('0x7d')](function(_0x186550){return!_[_0x6e70('0x7e')](_0x186550);})[_0x6e70('0x6f')]();if(!_[_0x6e70('0x7f')](_0x3f37c1)){_0x3f37c1[_0x6e70('0x64')](function(_0xd9b4a9){if(_0xd9b4a9===_0x6e70('0x80')){_0x4af9b1[_0x6e70('0x49')]('i.ChatWebsiteId\x20IN\x20?',[][_0x6e70('0x81')](_0x501b53[_0x6e70('0x40')][_0xd9b4a9]));}else if(_0xd9b4a9===_0x6e70('0x65')){var _0x5d398a=JSON['parse'](_0x501b53[_0x6e70('0x40')][_0xd9b4a9])[_0x6e70('0x82')];var _0x25e685=JSON[_0x6e70('0x63')](_0x501b53[_0x6e70('0x40')][_0xd9b4a9])['$lte'];_0x4af9b1['where'](_0x6e70('0x6c'),_0x5d398a,_0x25e685);}else{_0x4af9b1[_0x6e70('0x49')]('i.'+_0xd9b4a9+'\x20=\x20?',_0x501b53[_0x6e70('0x40')][_0xd9b4a9]);}});}if(_0x501b53[_0x6e70('0x40')][_0x6e70('0x7d')]){var _0x3280ea=_0x501b53[_0x6e70('0x40')][_0x6e70('0x7d')][_0x6e70('0x83')]('\x5c','\x5c\x5c')[_0x6e70('0x83')]('\x27\x27',_0x6e70('0x84'));if(qs[_0x6e70('0x85')](_0x3280ea)){_0x232366['or'](_0x6e70('0x86'),_0x3280ea+'%');}else{var _0x1dcfaf=[];_0x3280ea[_0x6e70('0x87')]('\x20')[_0x6e70('0x64')](function(_0x511658){_0x1dcfaf['push']('+'+_0x511658[_0x6e70('0x88')]());});var _0x4be7e4=_0x1dcfaf[_0x6e70('0x89')]('\x20');_0x232366['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x4be7e4)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3280ea+'%');}}}_0x4af9b1[_0x6e70('0x49')](_0x232366);if(_0x5424eb['order']){_0x5424eb['order'][_0x6e70('0x64')](function(_0x21e4c2){_0x4af9b1[_0x6e70('0x8a')]('i.'+_0x21e4c2[0x0],_0x21e4c2[0x1]==='DESC'?![]:!![]);});}_0x4af9b1['group']('i.id');var _0x3e7be7={'type':db['Sequelize'][_0x6e70('0x8b')][_0x6e70('0x8c')],'raw':!![]};var _0xb1b480=_0x4af9b1[_0x6e70('0x8d')]()[_0x6e70('0x4c')](_0x6e70('0x50'));if(!_0x501b53[_0x6e70('0x40')]['advancedFilter']){if(_0x501b53[_0x6e70('0x40')][_0x6e70('0x8e')]){if(_0x501b53[_0x6e70('0x40')]['read']==0x1){_0xb1b480[_0x6e70('0x49')](util[_0x6e70('0x69')](_0x6e70('0x8f'),_0xac87d6[_0x6e70('0x88')]()));_0x4af9b1[_0x6e70('0x90')](_0x6e70('0x91'));}else{_0xb1b480[_0x6e70('0x49')](util[_0x6e70('0x69')](_0x6e70('0x92'),_0xac87d6['toString']()));_0x4af9b1[_0x6e70('0x90')](_0x6e70('0x93'));}}if(_0x501b53['query'][_0x6e70('0x94')]){var _0x3d29e0=_['isArray'](_0x501b53['query'][_0x6e70('0x94')])?_0x501b53['query'][_0x6e70('0x94')]:new Array(_0x501b53['query'][_0x6e70('0x94')]);var _0x459a51=squel[_0x6e70('0x61')]();_0x3d29e0[_0x6e70('0x64')](function(_0x2ffc87){_0x459a51['or'](_0x6e70('0x95'),'%,'+_0x2ffc87+',%');});_0x4af9b1[_0x6e70('0x90')](_0x459a51);_0xb1b480['left_join']('chat_interaction_has_tags','it',_0x6e70('0x96'));_0xb1b480['left_join'](_0x6e70('0x4f'),'t',_0x6e70('0x97'));_0xb1b480[_0x6e70('0x49')](_0x6e70('0x98'),_0x3d29e0);}}else{var _0x4b201f=JSON[_0x6e70('0x63')](_0x501b53['query'][_0x6e70('0x62')]);_[_0x6e70('0x41')](_0x4b201f)[_0x6e70('0x64')](function(_0x44cf73){var _0x35aff6=_0x4b201f[_0x44cf73];if(_0x44cf73===_0x6e70('0x70')){var _0x2c3bf6=_0x35aff6['value'];var _0x1d6acf=squel['expr']();_0x2c3bf6[_0x6e70('0x64')](function(_0x5f1e62){_0x1d6acf['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5f1e62+',%');});_0x4af9b1['having'](_0x1d6acf);_0xb1b480[_0x6e70('0x57')](_0x6e70('0x99'),'it',_0x6e70('0x9a'));_0xb1b480[_0x6e70('0x57')](_0x6e70('0x4f'),'t','t.id\x20=\x20it.TagId');_0xb1b480[_0x6e70('0x49')](_0x6e70('0x98'),_0x2c3bf6);}else if(_0x44cf73==='Messages.count'){if(_0x35aff6[_0x6e70('0x6f')]['length']===0x1){if(_0x35aff6[_0x6e70('0x6f')][0x0]===0x1){_0xb1b480['where'](util['format'](_0x6e70('0x8f'),_0xac87d6[_0x6e70('0x88')]()));_0x4af9b1[_0x6e70('0x90')](_0x6e70('0x91'));}else{_0xb1b480[_0x6e70('0x49')](util[_0x6e70('0x69')](_0x6e70('0x92'),_0xac87d6['toString']()));_0x4af9b1[_0x6e70('0x90')]('`Messages.count`\x20>\x200');}}}});}db[_0x6e70('0x9b')][_0x6e70('0x40')](_0xb1b480[_0x6e70('0x88')](),_0x3e7be7)[_0x6e70('0x37')](function(_0x4764d5){_0x3841a0[_0x6e70('0x9c')]=_0x4764d5[_0x6e70('0x46')];if(_0x3841a0['count']===0x0)return[];return db[_0x6e70('0x9b')]['query'](_0x4d1243[_0x6e70('0x88')](),_0x3e7be7)[_0x6e70('0x37')](function(_0x7d81f){_0x62b925=_[_0x6e70('0x9d')](_0x7d81f,'id');_0x3e7be7=_[_0x6e70('0x9e')](_0x3e7be7,{'model':db[_0x6e70('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4af9b1[_0x6e70('0x4c')](_0xac87d6,_0x6e70('0x71'));_0x4af9b1[_0x6e70('0x4c')](_0x6e70('0x9f'),'Account.key');_0x4af9b1[_0x6e70('0x4c')](_0x6e70('0xa0'));_0x4af9b1[_0x6e70('0x4c')](_0x6e70('0x77'),_0x6e70('0xa1'));_0x4af9b1['field']('c.lastName','Contact.lastName');_0x4af9b1[_0x6e70('0x4c')](_0x6e70('0x79'),_0x6e70('0xa2'));_0x4af9b1[_0x6e70('0x4c')](_0x6e70('0xa3'),_0x6e70('0xa4'));_0x4af9b1[_0x6e70('0x4c')](_0x6e70('0xa5'),_0x6e70('0xa6'));_0x4af9b1[_0x6e70('0x4c')](_0x6e70('0xa7'),_0x6e70('0xa8'));_0x4af9b1[_0x6e70('0x4c')](_0x6e70('0xa9'),_0x6e70('0xaa'));_0x4af9b1['field'](_0x6e70('0xab'),_0x6e70('0xac'));_0x4af9b1[_0x6e70('0x57')](_0x6e70('0xad'),'it',_0x6e70('0x96'));_0x4af9b1[_0x6e70('0x57')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x4af9b1[_0x6e70('0x30')](_0x5424eb[_0x6e70('0x30')]);_0x4af9b1[_0x6e70('0x2f')](_0x5424eb[_0x6e70('0x2f')]);return db[_0x6e70('0x9b')][_0x6e70('0x40')](_0x4af9b1[_0x6e70('0x88')](),_0x3e7be7);})['then'](function(_0x245123){_0x4ab26e['where'](_0x6e70('0xae'),_[_0x6e70('0x7c')](_0x245123,'id'));return db[_0x6e70('0x9b')][_0x6e70('0x40')](_0x4ab26e['toString'](),_0x3e7be7)[_0x6e70('0x37')](function(_0xd12161){var _0x5ee5a5=_[_0x6e70('0xaf')](_0xd12161,'ChatInteractionId');_0x245123[_0x6e70('0x64')](function(_0x47930c){if(_0x5ee5a5[_0x47930c['id']]){_0x47930c['Users']=_[_0x6e70('0x7c')](_0x5ee5a5[_0x47930c['id']],function(_0x455f49){return{'id':_0x455f49['id']};});}if(_0x47930c[_0x6e70('0xac')]){_0x47930c['Tags']=[];_0x47930c[_0x6e70('0xac')][_0x6e70('0x87')](',')['forEach'](function(_0x30acfb){_0x47930c[_0x6e70('0xb0')][_0x6e70('0xb1')](_0x62b925[_0x30acfb]);});}delete _0x47930c[_0x6e70('0xac')];});return _0x245123;});});})[_0x6e70('0x37')](function(_0x2df345){_0x3841a0[_0x6e70('0xb2')]=_0x2df345;return _0x3841a0;})[_0x6e70('0x37')](respondWithFilteredResult(_0x5446a2,_0x5424eb))[_0x6e70('0xb3')](handleError(_0x5446a2,null));};exports['show']=function(_0x4e7a56,_0xb5e3be){var _0x564d55={'raw':![],'where':{'id':_0x4e7a56[_0x6e70('0xb4')]['id']}},_0x1d3e8e={};_0x1d3e8e['model']=_[_0x6e70('0x41')](db[_0x6e70('0x3d')][_0x6e70('0x3e')]);_0x1d3e8e['query']=_[_0x6e70('0x41')](_0x4e7a56[_0x6e70('0x40')]);_0x1d3e8e[_0x6e70('0x42')]=_[_0x6e70('0x43')](_0x1d3e8e[_0x6e70('0x3f')],_0x1d3e8e[_0x6e70('0x40')]);_0x564d55[_0x6e70('0x44')]=_[_0x6e70('0x43')](_0x1d3e8e[_0x6e70('0x3f')],qs[_0x6e70('0x45')](_0x4e7a56[_0x6e70('0x40')][_0x6e70('0x45')]));_0x564d55[_0x6e70('0x44')]=_0x564d55['attributes'][_0x6e70('0x46')]?_0x564d55[_0x6e70('0x44')]:_0x1d3e8e[_0x6e70('0x3f')];if(_0x4e7a56[_0x6e70('0x40')][_0x6e70('0xb5')]){_0x564d55['include']=[{'all':!![]}];}_0x564d55=_[_0x6e70('0x9e')]({},_0x564d55,_0x4e7a56[_0x6e70('0xb6')]);return db[_0x6e70('0x3d')]['find'](_0x564d55)[_0x6e70('0x37')](handleEntityNotFound(_0xb5e3be,null))['then'](respondWithResult(_0xb5e3be,null))['catch'](handleError(_0xb5e3be,null));};exports[_0x6e70('0xb7')]=function(_0x362a2b,_0x324353){return db[_0x6e70('0x3d')]['create'](_0x362a2b[_0x6e70('0xb8')],{})[_0x6e70('0x37')](respondWithResult(_0x324353,0xc9))['catch'](handleError(_0x324353,null));};exports['update']=function(_0x48571f,_0x152a12){if(_0x48571f[_0x6e70('0xb8')]['id']){delete _0x48571f[_0x6e70('0xb8')]['id'];}return db[_0x6e70('0x3d')][_0x6e70('0xb9')]({'where':{'id':_0x48571f[_0x6e70('0xb4')]['id']}})[_0x6e70('0x37')](handleEntityNotFound(_0x152a12,null))['then'](saveUpdates(_0x48571f[_0x6e70('0xb8')],null))[_0x6e70('0x37')](respondWithResult(_0x152a12,null))[_0x6e70('0xb3')](handleError(_0x152a12,null));};exports[_0x6e70('0x38')]=function(_0x3ec6da,_0x3206ad){return db[_0x6e70('0x3d')][_0x6e70('0xb9')]({'where':{'id':_0x3ec6da[_0x6e70('0xb4')]['id']}})[_0x6e70('0x37')](handleEntityNotFound(_0x3206ad,null))[_0x6e70('0x37')](removeEntity(_0x3206ad,null))[_0x6e70('0xb3')](handleError(_0x3206ad,null));};exports['describe']=function(_0x2a1205,_0x1f1b96){return db[_0x6e70('0x3d')]['describe']()[_0x6e70('0x37')](respondWithResult(_0x1f1b96,null))[_0x6e70('0xb3')](handleError(_0x1f1b96,null));};exports[_0x6e70('0xba')]=function(_0x1ff761,_0x34143b){if(_0x1ff761[_0x6e70('0xb8')]['id']){delete _0x1ff761['body']['id'];}return db['ChatInteraction'][_0x6e70('0xb9')]({'where':{'id':_0x1ff761[_0x6e70('0xb4')]['id']}})[_0x6e70('0x37')](handleEntityNotFound(_0x34143b,null))[_0x6e70('0x37')](saveUpdates(_0x1ff761[_0x6e70('0xb8')],null))[_0x6e70('0x37')](respondWithResult(_0x34143b,null))['catch'](handleError(_0x34143b,null));};exports[_0x6e70('0xbb')]=function(_0xdaad1a,_0x34ab4c,_0x154697){if(_0xdaad1a[_0x6e70('0xb8')]['id']){delete _0xdaad1a[_0x6e70('0xb8')]['id'];}return db[_0x6e70('0x3d')][_0x6e70('0xb9')]({'where':{'id':_0xdaad1a[_0x6e70('0xb4')]['id']}})[_0x6e70('0x37')](function(_0xd2d74f){if(!_0xd2d74f){logger[_0x6e70('0x28')](_0x6e70('0xbc'),_0x6e70('0xbb'),0x194,_0x6e70('0xbd'));_0x34ab4c[_0x6e70('0x2b')](0x194);}else{if(_0xd2d74f[_0x6e70('0xbe')]){throw new db['Sequelize']['ValidationError'](_0x6e70('0xbf'));}}return _0xd2d74f;})[_0x6e70('0x37')](function(_0x2d51f8){if(_0x2d51f8){return _0x2d51f8[_0x6e70('0x36')]({'closed':_0xdaad1a[_0x6e70('0xb8')][_0x6e70('0xc0')],'disposition':_0xdaad1a['body'][_0x6e70('0xc1')]})['then'](function(_0x2f05b2){return _0x2f05b2;});}})['then'](function(_0x2f2b92){return respondWithRpcPromise('AbandonInteraction',_0x6e70('0xbb'),_0xdaad1a[_0x6e70('0xb8')],client9004);})[_0x6e70('0x37')](respondWithResult(_0x34ab4c,null))['catch'](handleError(_0x34ab4c,null));};exports[_0x6e70('0xc2')]=function(_0x21209e,_0x20af52,_0x3dbd8b){_0x21209e[_0x6e70('0xb8')][_0x6e70('0x3a')]=_0x21209e[_0x6e70('0xc3')]['originalname'];_0x21209e[_0x6e70('0xb8')][_0x6e70('0xc4')]=_0x21209e['file'][_0x6e70('0xc5')];_0x21209e[_0x6e70('0xb8')]['type']=_0x21209e['file'][_0x6e70('0xc6')];return db['Attachment'][_0x6e70('0xb7')](_0x21209e[_0x6e70('0xb8')])[_0x6e70('0x37')](respondWithResult(_0x20af52,0xc9))[_0x6e70('0xb3')](handleError(_0x20af52,null));};exports[_0x6e70('0xc7')]=function(_0x87a870,_0x1f4da9,_0x40cbdf){return db[_0x6e70('0x3d')][_0x6e70('0xc8')]({'where':{'id':_0x87a870[_0x6e70('0xb4')]['id']},'raw':!![]})[_0x6e70('0x37')](handleEntityNotFound(_0x1f4da9,null))[_0x6e70('0x37')](function(_0x507750){if(_0x507750){if(_0x507750[_0x6e70('0xc0')]){return _0x1f4da9[_0x6e70('0x2c')](0x193)[_0x6e70('0x2e')]({'status':0x193,'message':_0x6e70('0xc9')});}return db[_0x6e70('0xca')][_0x6e70('0xc8')]({'where':{'id':_0x87a870[_0x6e70('0x40')][_0x6e70('0xcb')]},'raw':!![]})[_0x6e70('0x37')](handleEntityNotFound(_0x1f4da9,null));}})['then'](function(_0x4bdcc){if(_0x4bdcc){return _0x1f4da9[_0x6e70('0xcc')](path[_0x6e70('0x89')](config['root'],_0x6e70('0xcd'),_0x4bdcc[_0x6e70('0xc4')]));}})[_0x6e70('0xb3')](handleError(_0x1f4da9,null));};exports[_0x6e70('0xce')]=function(_0x4af0bc,_0x52bacf){var _0x20ac7e=null;var _0x5cfea6=null;var _0x4fa241=null;var _0x34da0c=null;if(_0x4af0bc[_0x6e70('0xb8')]['id']){delete _0x4af0bc[_0x6e70('0xb8')]['id'];}if(_0x4af0bc[_0x6e70('0xb8')][_0x6e70('0xcf')]){_0x34da0c=path[_0x6e70('0x89')](config[_0x6e70('0xd0')],_0x6e70('0xd1'),util[_0x6e70('0x69')](_0x6e70('0xd2'),Date['now']()));_0x4af0bc[_0x6e70('0xb8')][_0x6e70('0xd3')]=_0x34da0c;}return db[_0x6e70('0x3d')][_0x6e70('0xb9')]({'where':{'id':_0x4af0bc[_0x6e70('0xb4')]['id']},'include':[{'model':db[_0x6e70('0xd4')],'as':_0x6e70('0xd5'),'include':[{'model':db[_0x6e70('0xd6')],'as':_0x6e70('0xd6')}]}]})[_0x6e70('0x37')](handleEntityNotFound(_0x52bacf,null))['then'](saveUpdates(_0x4af0bc['body'],null))['then'](function(_0x4f1f65){if(_0x4f1f65){_0x20ac7e=_0x4f1f65;return db[_0x6e70('0xd7')][_0x6e70('0xb9')]({'where':{'id':_0x20ac7e[_0x6e70('0x80')]}});}})['then'](function(_0xff81ac){if(_0xff81ac){_0x4fa241=_0xff81ac;return db['CmContact'][_0x6e70('0xb9')]({'where':{'id':_0x20ac7e['ContactId']}});}})['then'](function(_0xe4b9f8){if(_0xe4b9f8){_0x5cfea6=_0xe4b9f8;if(_0x34da0c){var _0x1721b9=null;for(var _0x3668d5=0x1;_0x3668d5<_0x20ac7e[_0x6e70('0xd5')][_0x6e70('0x46')];++_0x3668d5){_0x1721b9=_0x20ac7e[_0x6e70('0xd5')][_0x3668d5];var _0x2cfb23=_0x1721b9['UserId']?util[_0x6e70('0x69')](_0x6e70('0xd8'),_0x4fa241['agentAlias'],_0x1721b9[_0x6e70('0xbe')]):_0x6e70('0xd9');var _0x151c30=_0x4af0bc['body'][_0x6e70('0xda')]||util[_0x6e70('0x69')]('%s%d','Visitor',_0x1721b9[_0x6e70('0x76')]);switch(_0x4fa241[_0x6e70('0xdb')]){case _0x6e70('0xdc'):_0x2cfb23=_0x1721b9[_0x6e70('0xbe')]?util[_0x6e70('0x69')]('%s%d',_0x4fa241['agentAlias'],_0x1721b9[_0x6e70('0xbe')]):_0x6e70('0xd9');break;case _0x6e70('0xdd'):_0x2cfb23=_0x1721b9['UserId']?_0x1721b9[_0x6e70('0xd6')][_0x6e70('0xde')]||_0x1721b9[_0x6e70('0xd6')][_0x6e70('0xdf')]:_0x6e70('0xd9');break;case _0x6e70('0xe0'):_0x2cfb23=_0x1721b9[_0x6e70('0xbe')]?_0x1721b9[_0x6e70('0xd6')][_0x6e70('0xdf')]:_0x6e70('0xd9');break;default:_0x2cfb23=_0x1721b9['UserId']?util[_0x6e70('0x69')](_0x6e70('0xd8'),_0x4fa241[_0x6e70('0xe1')],_0x1721b9[_0x6e70('0xbe')]):'System';}var _0x7ffbdf=util[_0x6e70('0x69')](_0x6e70('0xe2'),moment(_0x1721b9['createdAt'])[_0x6e70('0x69')](_0x6e70('0xe3')),_0x1721b9[_0x6e70('0xe4')]==='in'?_0x151c30:_0x2cfb23,_0x1721b9[_0x6e70('0xb8')]);if(!_0x1721b9['secret']){fs[_0x6e70('0xe5')](_0x34da0c,_0x7ffbdf);}}return db[_0x6e70('0xe6')][_0x6e70('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x6e70('0xe7')],'as':_0x6e70('0xe8'),'raw':!![]}]});}}})[_0x6e70('0x37')](function(_0xa08f5){if(_0xa08f5&&_0xa08f5[_0x6e70('0xe8')]&&_0x4af0bc[_0x6e70('0xb8')]){var _0x46a4c2={'tls':{'rejectUnauthorized':![]}};if(_0xa08f5['Smtp']['service']){_0x46a4c2[_0x6e70('0xe9')]=_0xa08f5[_0x6e70('0xe8')][_0x6e70('0xe9')];}else{_0x46a4c2[_0x6e70('0xea')]=_0xa08f5[_0x6e70('0xe8')][_0x6e70('0xea')];_0x46a4c2[_0x6e70('0xeb')]=_0xa08f5[_0x6e70('0xe8')][_0x6e70('0xeb')];_0x46a4c2[_0x6e70('0xec')]=_0xa08f5[_0x6e70('0xe8')][_0x6e70('0xec')];}if(_0xa08f5[_0x6e70('0xe8')][_0x6e70('0xed')]){_0x46a4c2[_0x6e70('0xee')]={'user':_0xa08f5['Smtp'][_0x6e70('0xef')],'pass':_0xa08f5[_0x6e70('0xe8')][_0x6e70('0xf0')]};}return respondWithRpcPromise('SendMail',_0x6e70('0xf1'),{'account':_0x46a4c2,'message':{'from':util[_0x6e70('0x69')](_0x6e70('0xf2'),_0xa08f5[_0x6e70('0x3a')],_0xa08f5[_0x6e70('0xf3')]||_0xa08f5[_0x6e70('0xe8')]['user']),'to':_0x4af0bc[_0x6e70('0xb8')][_0x6e70('0xcf')],'subject':'Mail\x20Transcript','text':util[_0x6e70('0x69')](_0x6e70('0xf4'),_0x4af0bc[_0x6e70('0xb8')][_0x6e70('0xcf')]),'attachments':[{'path':_0x34da0c}]}})[_0x6e70('0x37')](function(){return _0x20ac7e;})['catch'](function(_0x4a86c8){console[_0x6e70('0x28')](_0x4a86c8);});}else{return _0x20ac7e;}})['then'](respondWithStatusCode(_0x52bacf,0xc8))[_0x6e70('0xb3')](handleError(_0x52bacf,null));};exports[_0x6e70('0xf5')]=function(_0x1a998b,_0x50b1b0,_0x2afe2e){return db['ChatMessage'][_0x6e70('0xb9')]({'where':{'id':_0x1a998b[_0x6e70('0xb4')]['id']}})[_0x6e70('0x37')](handleEntityNotFound(_0x50b1b0,null))[_0x6e70('0x37')](function(_0x11fe71){if(_0x11fe71){return _0x11fe71[_0x6e70('0xf5')](_0x1a998b['body']['ids'],_[_0x6e70('0xf6')](_0x1a998b[_0x6e70('0xb8')],[_0x6e70('0xf7'),'id'])||{});}})[_0x6e70('0x37')](respondWithResult(_0x50b1b0,null))['catch'](handleError(_0x50b1b0,null));};exports['getMessages']=function(_0x3c7022,_0x30cfe3,_0x548c01){var _0x2d920c={'raw':![],'where':{}};var _0x2daeec={};var _0x282dd1={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x6e70('0xc8')]({'where':{'id':_0x3c7022[_0x6e70('0xb4')]['id']}})['then'](handleEntityNotFound(_0x30cfe3,null))[_0x6e70('0x37')](function(_0x5b4411){if(_0x5b4411){_0x2daeec[_0x6e70('0x3f')]=_[_0x6e70('0x41')](db[_0x6e70('0xd4')]['rawAttributes']);_0x2daeec[_0x6e70('0x40')]=_[_0x6e70('0x41')](_0x3c7022[_0x6e70('0x40')]);_0x2daeec[_0x6e70('0x42')]=_[_0x6e70('0x43')](_0x2daeec['model'],_0x2daeec[_0x6e70('0x40')]);_0x2d920c['attributes']=_[_0x6e70('0x43')](_0x2daeec[_0x6e70('0x3f')],qs[_0x6e70('0x45')](_0x3c7022[_0x6e70('0x40')][_0x6e70('0x45')]));_0x2d920c[_0x6e70('0x44')]=_0x2d920c[_0x6e70('0x44')][_0x6e70('0x46')]?_0x2d920c['attributes']:_0x2daeec[_0x6e70('0x3f')];if(!_0x3c7022['query'][_0x6e70('0x47')](_0x6e70('0x48'))){_0x2d920c[_0x6e70('0x30')]=qs[_0x6e70('0x30')](_0x3c7022['query'][_0x6e70('0x30')]);_0x2d920c['offset']=qs['offset'](_0x3c7022[_0x6e70('0x40')]['offset']);}_0x2d920c[_0x6e70('0x8a')]=qs[_0x6e70('0xf8')](_0x3c7022[_0x6e70('0x40')]['sort']);_0x2d920c['where']=qs[_0x6e70('0x42')](_[_0x6e70('0x4a')](_0x3c7022[_0x6e70('0x40')],_0x2daeec[_0x6e70('0x42')]));_0x2d920c[_0x6e70('0x49')][_0x6e70('0xf9')]=_0x5b4411['id'];if(_0x3c7022['query'][_0x6e70('0x7d')]){_0x2d920c['where']=_['merge'](_0x2d920c['where'],{'$or':_[_0x6e70('0x7c')](_0x2d920c[_0x6e70('0x44')],function(_0x51e4df){var _0x1e479d={};_0x1e479d[_0x51e4df]={'$like':'%'+_0x3c7022['query'][_0x6e70('0x7d')]+'%'};return _0x1e479d;})});}if(_0x3c7022[_0x6e70('0x40')][_0x6e70('0x82')]){var _0x2ecc55=_0x3c7022[_0x6e70('0x40')][_0x6e70('0x82')][_0x6e70('0x87')](',');var _0x31b91f={};_0x31b91f[_0x2ecc55[0x0]]={'$gte':moment(_0x2ecc55[0x1])[_0x6e70('0x69')](_0x6e70('0xfa'))};_0x2d920c[_0x6e70('0x49')]=_[_0x6e70('0x9e')](_0x2d920c['where'],_0x31b91f);}_0x2d920c=_['merge']({},_0x2d920c,_0x3c7022[_0x6e70('0xb6')]);return db[_0x6e70('0xd4')][_0x6e70('0x9c')]({'where':_0x2d920c[_0x6e70('0x49')]})['then'](function(_0x507599){_0x282dd1[_0x6e70('0x9c')]=_0x507599;if(_0x3c7022[_0x6e70('0x40')][_0x6e70('0xb5')]){_0x2d920c[_0x6e70('0xfb')]=[{'all':!![]}];}return db['ChatMessage'][_0x6e70('0xfc')](_0x2d920c);})['then'](function(_0x44799d){_0x282dd1[_0x6e70('0xb2')]=_0x44799d;return _0x282dd1;});}})[_0x6e70('0x37')](respondWithFilteredResult(_0x30cfe3,_0x2d920c))[_0x6e70('0xb3')](handleError(_0x30cfe3,null));};exports[_0x6e70('0xfd')]=function(_0x529358,_0x424407,_0x41426d){var _0x44cf96={'where':{}},_0x48add6={},_0x2ade96={'count':0x0,'rows':[]};return db[_0x6e70('0x3d')][_0x6e70('0xc8')]({'where':{'id':_0x529358[_0x6e70('0xb4')]['id']}})[_0x6e70('0x37')](handleEntityNotFound(_0x424407,null))[_0x6e70('0x37')](function(_0xb12214){if(_0xb12214){_0x48add6[_0x6e70('0x3f')]=_[_0x6e70('0x41')](db[_0x6e70('0xd4')][_0x6e70('0x3e')]);_0x48add6[_0x6e70('0x40')]=_[_0x6e70('0x41')](_0x529358[_0x6e70('0x40')]);_0x48add6[_0x6e70('0x42')]=_[_0x6e70('0x43')](_0x48add6[_0x6e70('0x3f')],_0x48add6[_0x6e70('0x40')]);_0x44cf96[_0x6e70('0x44')]=_[_0x6e70('0x43')](_0x48add6[_0x6e70('0x3f')],qs['fields'](_0x529358[_0x6e70('0x40')]['fields']));_0x44cf96['attributes']=_0x44cf96['attributes']['length']?_0x44cf96[_0x6e70('0x44')]:_0x48add6[_0x6e70('0x3f')];if(!_0x529358[_0x6e70('0x40')][_0x6e70('0x47')](_0x6e70('0x48'))){_0x44cf96[_0x6e70('0x30')]=qs[_0x6e70('0x30')](_0x529358['query'][_0x6e70('0x30')]);_0x44cf96[_0x6e70('0x2f')]=qs['offset'](_0x529358['query'][_0x6e70('0x2f')]);}_0x44cf96[_0x6e70('0x8a')]=qs[_0x6e70('0xf8')](_0x529358[_0x6e70('0x40')][_0x6e70('0xf8')]);_0x44cf96['where']=qs['filters'](_[_0x6e70('0x4a')](_0x529358[_0x6e70('0x40')],_0x48add6[_0x6e70('0x42')]));_0x44cf96['where'][_0x6e70('0xf9')]=_0xb12214['id'];if(_0x529358[_0x6e70('0x40')][_0x6e70('0x7d')]){_0x44cf96['where']=_['merge'](_0x44cf96[_0x6e70('0x49')],{'$or':_[_0x6e70('0x7c')](_0x44cf96[_0x6e70('0x44')],function(_0x3ab8a5){var _0x23c273={};_0x23c273[_0x3ab8a5]={'$like':'%'+_0x529358['query']['filter']+'%'};return _0x23c273;})});}_0x44cf96[_0x6e70('0x49')][_0x6e70('0xfe')]=![];if(_0x529358[_0x6e70('0x40')]['id']){_0x44cf96['where']['id']={'$gt':_0x529358[_0x6e70('0x40')]['id']};}_0x44cf96=_[_0x6e70('0x9e')]({},_0x44cf96,_0x529358[_0x6e70('0xb6')]);return db['ChatMessage'][_0x6e70('0x9c')]({'where':_0x44cf96['where']})[_0x6e70('0x37')](function(_0x450e00){_0x2ade96['count']=_0x450e00;_0x44cf96[_0x6e70('0xfb')]=[];if(_0x529358[_0x6e70('0x40')]['includeAgent']){_0x44cf96[_0x6e70('0xfb')][_0x6e70('0xb1')]({'model':db[_0x6e70('0xd6')],'as':_0x6e70('0xd6'),'attributes':['id',_0x6e70('0xdf'),_0x6e70('0xde')]});}if(_0x529358[_0x6e70('0x40')][_0x6e70('0xb5')]){_0x44cf96[_0x6e70('0xfb')]=[{'all':!![]}];}return db[_0x6e70('0xd4')]['findAll'](_0x44cf96);})['then'](function(_0x1884b6){_0x2ade96['rows']=_0x1884b6;return _0x2ade96;});}})[_0x6e70('0x37')](respondWithFilteredResult(_0x424407,_0x44cf96))[_0x6e70('0xb3')](handleError(_0x424407,null));};exports[_0x6e70('0xff')]=function(_0x2845cd,_0x4634ce,_0x153076){return db[_0x6e70('0x3d')][_0x6e70('0xb9')]({'where':{'id':_0x2845cd[_0x6e70('0xb4')]['id']}})['then'](handleEntityNotFound(_0x4634ce,null))['then'](function(_0x4f8e39){if(_0x4f8e39){return _0x4f8e39[_0x6e70('0x100')](_0x2845cd['body'][_0x6e70('0xf7')],_[_0x6e70('0xf6')](_0x2845cd[_0x6e70('0xb8')],[_0x6e70('0xf7'),'id'])||{})[_0x6e70('0x101')](function(){return db[_0x6e70('0x102')]['findAll']({'attributes':['id',_0x6e70('0x3a'),_0x6e70('0x4d')],'where':{'id':_0x2845cd[_0x6e70('0xb8')][_0x6e70('0xf7')]}});})[_0x6e70('0x37')](function(_0xfa871b){socket[_0x6e70('0x103')]('chatInteractionTags:save',{'id':Number(_0x2845cd[_0x6e70('0xb4')]['id']),'tags':_0xfa871b||[]});return{'id':Number(_0x2845cd[_0x6e70('0xb4')]['id']),'tags':_0xfa871b||[]};});}})['then'](respondWithResult(_0x4634ce,null))[_0x6e70('0xb3')](handleError(_0x4634ce,null));};exports[_0x6e70('0x104')]=function(_0x5734d6,_0x4d712d,_0x1767ff){return db[_0x6e70('0x3d')]['find']({'where':{'id':_0x5734d6[_0x6e70('0xb4')]['id']}})[_0x6e70('0x37')](handleEntityNotFound(_0x4d712d,null))[_0x6e70('0x37')](function(_0x3b6b37){if(_0x3b6b37){return _0x3b6b37[_0x6e70('0x104')](_0x5734d6['query'][_0x6e70('0xf7')]);}})[_0x6e70('0x37')](respondWithStatusCode(_0x4d712d,null))['catch'](handleError(_0x4d712d,null));};exports[_0x6e70('0xcc')]=function(_0x59821a,_0x50e8bd){var _0x5bb1da=moment()[_0x6e70('0x105')]()[_0x6e70('0x88')]();var _0x554b5b=path[_0x6e70('0x89')](config[_0x6e70('0xd0')],'server','files',_0x6e70('0x106'));var _0xc5bf0=path['join'](config[_0x6e70('0xd0')],_0x6e70('0x107'),_0x6e70('0x108'),_0x6e70('0x109'));var _0x57d976=path[_0x6e70('0x89')](_0x554b5b,_0x5bb1da);var _0x5cb9fb=util['format']('transcript-%d-%s.zip',_0x59821a[_0x6e70('0xb4')]['id'],_0x5bb1da);var _0x482646=path[_0x6e70('0x89')](_0x554b5b,_0x5cb9fb);var _0x8fbbf4=![];return db[_0x6e70('0x3d')]['find']({'where':{'id':_0x59821a['params']['id']},'include':[{'model':db[_0x6e70('0xd4')],'as':'Messages','attributes':['id',_0x6e70('0xb8'),_0x6e70('0x65'),_0x6e70('0xe4'),_0x6e70('0xfe')],'include':[{'model':db[_0x6e70('0xd6')],'as':_0x6e70('0xd6'),'attributes':['id',_0x6e70('0xdf')],'raw':!![]},{'model':db['CmContact'],'as':_0x6e70('0x10a'),'attributes':['id',_0x6e70('0x10b'),_0x6e70('0x10c')],'raw':!![]},{'model':db[_0x6e70('0xca')],'as':'Attachment','raw':!![]}]},{'model':db[_0x6e70('0xd7')],'as':_0x6e70('0x10d'),'attributes':['id',_0x6e70('0x3a')]},{'model':db['User'],'as':_0x6e70('0x10e'),'attributes':['id',_0x6e70('0xdf')]}]})[_0x6e70('0x37')](handleEntityNotFound(_0x50e8bd,null))[_0x6e70('0x37')](function(_0x4d5f78){if(_0x4d5f78){var _0x10d727=_0x4d5f78[_0x6e70('0x10f')]({'plain':!![]});_0x8fbbf4=!![];var _0xcd9ad3={'format':'A4','border':_0x6e70('0x110'),'header':{'height':'40px','contents':{'first':_0x6e70('0x111')}},'footer':{'height':_0x6e70('0x112'),'contents':{'default':util[_0x6e70('0x69')](_0x6e70('0x113'),util[_0x6e70('0x69')](_0x6e70('0x114'),_0x6e70('0x115'),_0x10d727['id']),moment()[_0x6e70('0x69')](_0x6e70('0x116'))[_0x6e70('0x88')]())}}};fs[_0x6e70('0x117')](_0x57d976);var _0x851395={'channel':'Chat','account':_0x10d727[_0x6e70('0x10d')][_0x6e70('0x3a')],'agent':_0x10d727[_0x6e70('0x10e')]?_0x10d727[_0x6e70('0x10e')][_0x6e70('0xdf')]:'N.A.','createdAt':moment(_0x10d727['createdAt'])[_0x6e70('0x69')](_0x6e70('0xfa'))[_0x6e70('0x88')](),'closedAt':_0x10d727['closed']?moment(_0x10d727['closedAt'])[_0x6e70('0x69')](_0x6e70('0xfa'))['toString']():'','disposition':_0x10d727[_0x6e70('0xc1')],'chatInfo':{'browser':_0x10d727[_0x6e70('0x118')],'os':_0x10d727[_0x6e70('0x119')],'referer':_0x10d727[_0x6e70('0x11a')],'customerIp':_0x10d727[_0x6e70('0x11b')]},'messages':_(_0x10d727[_0x6e70('0xd5')])[_0x6e70('0x11c')]()[_0x6e70('0x7d')]({'secret':![]})[_0x6e70('0x7c')](function(_0x13dcf2){if(_0x13dcf2[_0x6e70('0xca')]){var _0x44c5d7=path[_0x6e70('0x89')](_0xc5bf0,_0x13dcf2[_0x6e70('0xca')]['basename']);if(fs[_0x6e70('0x11d')](_0x44c5d7)){fs[_0x6e70('0x11e')](_0x44c5d7)['pipe'](fs[_0x6e70('0x11f')](path['join'](_0x57d976,_0x13dcf2[_0x6e70('0xca')]['basename'])));}}return{'date':moment(_0x13dcf2[_0x6e70('0x65')])[_0x6e70('0x69')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6e70('0x88')](),'sender':_0x13dcf2['direction']==='out'?_0x13dcf2[_0x6e70('0xd6')]?_0x13dcf2[_0x6e70('0xd6')][_0x6e70('0xdf')]:_0x6e70('0xd9'):_0x13dcf2[_0x6e70('0x10a')][_0x6e70('0x10b')]+(_0x13dcf2[_0x6e70('0x10a')][_0x6e70('0x10c')]?'\x20'+_0x13dcf2[_0x6e70('0x10a')][_0x6e70('0x10c')]:''),'body':_0x13dcf2[_0x6e70('0xca')]?_0x13dcf2[_0x6e70('0xca')][_0x6e70('0xc4')]:_0x13dcf2[_0x6e70('0xb8')],'direction':_0x13dcf2[_0x6e70('0xe4')]===_0x6e70('0x120')?'A':'C','secret':_0x13dcf2[_0x6e70('0xfe')],'attachment':_0x13dcf2[_0x6e70('0xca')]};})[_0x6e70('0x6f')]()};return ejs['renderFile'](path[_0x6e70('0x89')](config['root'],_0x6e70('0x107'),'views',_0x6e70('0x121')),{'interaction':_0x851395})[_0x6e70('0x37')](function(_0x2c717c){return new BPromise(function(_0x58f1c9,_0x1139cb){pdf[_0x6e70('0xb7')](_0x2c717c,_0xcd9ad3)[_0x6e70('0x122')](path[_0x6e70('0x89')](_0x57d976,_0x6e70('0x123')+_0x10d727['id']+'-'+_0x5bb1da+_0x6e70('0x124')),function(_0x49baa4,_0xdcb1a2){if(_0x49baa4)return _0x1139cb(_0x49baa4);_0x58f1c9(_0xdcb1a2);});});});}})[_0x6e70('0x37')](function(){if(_0x8fbbf4){return new BPromise(function(_0x41270a,_0x533169){zipdir(_0x57d976,{'saveTo':_0x482646},function(_0x545c9c,_0x1b8d8e){if(_0x545c9c)return _0x533169(_0x545c9c);return _0x41270a(_0x1b8d8e);});})[_0x6e70('0x37')](function(){return new BPromise(function(_0x464951,_0x39b760){rimraf(_0x57d976,function(_0x324bce){if(_0x324bce)_0x39b760(_0x324bce);return _0x464951();});});})['then'](function(){return _0x50e8bd[_0x6e70('0xcc')](_0x482646,_0x5cb9fb,function(_0x136a2d){if(_0x136a2d){console[_0x6e70('0x125')](_0x6e70('0x126'),_0x136a2d);}else{fs[_0x6e70('0x127')](_0x482646);}});});}else{return _0x50e8bd[_0x6e70('0x2b')](0xc8);}})[_0x6e70('0xb3')](handleError(_0x50e8bd,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index cfdf499..0c15e08 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 _0x2162=['remove','emit','hasOwnProperty','events','../../mysqldb','ChatInteraction','setMaxListeners','update'];(function(_0x4323b3,_0x5835b6){var _0x285b28=function(_0x165caf){while(--_0x165caf){_0x4323b3['push'](_0x4323b3['shift']());}};_0x285b28(++_0x5835b6);}(_0x2162,0x1b3));var _0x2216=function(_0x3b90cb,_0xe7a4f3){_0x3b90cb=_0x3b90cb-0x0;var _0x3644d3=_0x2162[_0x3b90cb];return _0x3644d3;};'use strict';var EventEmitter=require(_0x2216('0x0'));var ChatInteraction=require(_0x2216('0x1'))['db'][_0x2216('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2216('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2216('0x4'),'afterDestroy':_0x2216('0x5')};function emitEvent(_0x480587){return function(_0xf34c57,_0x3e9702,_0x218f25){ChatInteractionEvents[_0x2216('0x6')](_0x480587+':'+_0xf34c57['id'],_0xf34c57);ChatInteractionEvents['emit'](_0x480587,_0xf34c57);_0x218f25(null);};}for(var e in events){if(events[_0x2216('0x7')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0xcda8=['events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x169fb1,_0x4a50af){var _0x64927c=function(_0x3a52c3){while(--_0x3a52c3){_0x169fb1['push'](_0x169fb1['shift']());}};_0x64927c(++_0x4a50af);}(_0xcda8,0x190));var _0x8cda=function(_0x5ac8ea,_0x1695ee){_0x5ac8ea=_0x5ac8ea-0x0;var _0xaeda0=_0xcda8[_0x5ac8ea];return _0xaeda0;};'use strict';var EventEmitter=require(_0x8cda('0x0'));var ChatInteraction=require(_0x8cda('0x1'))['db'][_0x8cda('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8cda('0x3')](0x0);var events={'afterCreate':_0x8cda('0x4'),'afterUpdate':_0x8cda('0x5'),'afterDestroy':'remove'};function emitEvent(_0x439266){return function(_0x14e404,_0x282869,_0x17944a){ChatInteractionEvents[_0x8cda('0x6')](_0x439266+':'+_0x14e404['id'],_0x14e404);ChatInteractionEvents[_0x8cda('0x6')](_0x439266,_0x14e404);_0x17944a(null);};}for(var e in events){if(events[_0x8cda('0x7')](e)){var event=events[e];ChatInteraction[_0x8cda('0x8')](e,emitEvent(event));}}module[_0x8cda('0x9')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 0316f5a..a7d96b9 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 _0x757a=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x1cad6c,_0x506ef3){var _0x55ce3c=function(_0x46aa5a){while(--_0x46aa5a){_0x1cad6c['push'](_0x1cad6c['shift']());}};_0x55ce3c(++_0x506ef3);}(_0x757a,0xde));var _0xa757=function(_0x545b3a,_0x109c7a){_0x545b3a=_0x545b3a-0x0;var _0x2b9352=_0x757a[_0x545b3a];return _0x2b9352;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatInteraction',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f7793,_0x447344,_0x1a95ee){if(_0x2f7793[_0xa757('0xa')]('closed')){_0x2f7793[_0xa757('0xb')]=moment()[_0xa757('0xc')](_0xa757('0xd'));}_0x1a95ee(null,_0x2f7793);}},'charset':_0xa757('0xe'),'collate':_0xa757('0xf')});};
\ No newline at end of file
+var _0xe706=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xe706,0xa3));var _0x6e70=function(_0x2b2e8c,_0x54f172){_0x2b2e8c=_0x2b2e8c-0x0;var _0x4e8fac=_0xe706[_0x2b2e8c];return _0x4e8fac;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x188ed3,_0x3c4843,_0x449b48){if(_0x188ed3[_0x6e70('0xe')](_0x6e70('0xf'))){_0x188ed3[_0x6e70('0x10')]=moment()[_0x6e70('0x11')](_0x6e70('0x12'));}_0x449b48(null,_0x188ed3);}},'charset':_0x6e70('0x13'),'collate':_0x6e70('0x14')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 1356f67..150fddd 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 _0x5ddf=['catch','update','options','where','limit','UpdateChatInteraction','ChatInteraction','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5ddf,0x124));var _0xf5dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5ddf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf5dd('0x0'));var util=require(_0xf5dd('0x1'));var moment=require(_0xf5dd('0x2'));var BPromise=require(_0xf5dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5dd('0x4'));var db=require(_0xf5dd('0x5'))['db'];var utils=require(_0xf5dd('0x6'));var logger=require(_0xf5dd('0x7'))('rpc');var config=require(_0xf5dd('0x8'));var jayson=require(_0xf5dd('0x9'));var client=jayson[_0xf5dd('0xa')][_0xf5dd('0xb')]({'port':0x232a});config['redis']=_[_0xf5dd('0xc')](config[_0xf5dd('0xd')],{'host':_0xf5dd('0xe'),'port':0x18eb});var socket=require(_0xf5dd('0xf'))(new Redis(config[_0xf5dd('0xd')]));require(_0xf5dd('0x10'))[_0xf5dd('0x11')](socket);function respondWithRpcPromise(_0x280e93,_0x5aae56,_0x12285e){return new BPromise(function(_0x163640,_0x2641d8){return client['request'](_0x280e93,_0x12285e)[_0xf5dd('0x12')](function(_0x3b241c){logger['info'](_0xf5dd('0x13'),_0x5aae56,'request\x20sent');logger[_0xf5dd('0x14')](_0xf5dd('0x15'),_0x5aae56,_0xf5dd('0x16'),JSON[_0xf5dd('0x17')](_0x3b241c));if(_0x3b241c['error']){if(_0x3b241c[_0xf5dd('0x18')]['code']===0x1f4){logger[_0xf5dd('0x18')](_0xf5dd('0x13'),_0x5aae56,_0x3b241c[_0xf5dd('0x18')][_0xf5dd('0x19')]);return _0x2641d8(_0x3b241c[_0xf5dd('0x18')][_0xf5dd('0x19')]);}logger[_0xf5dd('0x18')](_0xf5dd('0x13'),_0x5aae56,_0x3b241c[_0xf5dd('0x18')][_0xf5dd('0x19')]);return _0x163640(_0x3b241c['error'][_0xf5dd('0x19')]);}else{logger[_0xf5dd('0x1a')](_0xf5dd('0x13'),_0x5aae56,'request\x20sent');_0x163640(_0x3b241c[_0xf5dd('0x1b')][_0xf5dd('0x19')]);}})[_0xf5dd('0x1c')](function(_0x2ac6d6){logger[_0xf5dd('0x18')](_0xf5dd('0x13'),_0x5aae56,_0x2ac6d6);_0x2641d8(_0x2ac6d6);});});}exports['UpdateChatInteraction']=function(_0x4473c0){var _0x23725a=this;return new Promise(function(_0x57c86c,_0x32a197){return db['ChatInteraction'][_0xf5dd('0x1d')](_0x4473c0['body'],{'raw':_0x4473c0[_0xf5dd('0x1e')]?_0x4473c0[_0xf5dd('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4473c0['options']?_0x4473c0[_0xf5dd('0x1e')][_0xf5dd('0x1f')]||null:null,'attributes':_0x4473c0['options']?_0x4473c0[_0xf5dd('0x1e')]['attributes']||null:null,'limit':_0x4473c0[_0xf5dd('0x1e')]?_0x4473c0[_0xf5dd('0x1e')][_0xf5dd('0x20')]||null:null})[_0xf5dd('0x12')](function(_0x3f873f){logger[_0xf5dd('0x1a')](_0xf5dd('0x21'),_0x4473c0);logger['debug'](_0xf5dd('0x21'),_0x4473c0,JSON[_0xf5dd('0x17')](_0x3f873f));_0x57c86c(_0x3f873f);})[_0xf5dd('0x1c')](function(_0x24e06f){logger[_0xf5dd('0x18')](_0xf5dd('0x21'),_0x24e06f[_0xf5dd('0x19')],_0x4473c0);_0x32a197(_0x23725a[_0xf5dd('0x18')](0x1f4,_0x24e06f[_0xf5dd('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x3c6c13){return new Promise(function(_0x2eaf0c,_0x4c8404){return db[_0xf5dd('0x22')]['find']({'where':_0x3c6c13['options']?_0x3c6c13[_0xf5dd('0x1e')][_0xf5dd('0x1f')]||null:null})[_0xf5dd('0x12')](function(_0x166141){if(_0x166141){return _0x166141[_0xf5dd('0x23')](_0x3c6c13[_0xf5dd('0x24')][_0xf5dd('0x25')],_['omit'](_0x3c6c13['body'],[_0xf5dd('0x25'),'id'])||{});}})[_0xf5dd('0x26')](function(_0x44c47e){logger[_0xf5dd('0x1a')](_0xf5dd('0x27'),_0x3c6c13);logger['debug']('AddTags',_0x3c6c13,JSON[_0xf5dd('0x17')](_0x44c47e));_0x2eaf0c(_0x44c47e);})[_0xf5dd('0x1c')](function(_0x452fd4){logger[_0xf5dd('0x18')](_0xf5dd('0x27'),_0x452fd4[_0xf5dd('0x19')],_0x3c6c13);_0x4c8404(_this['error'](0x1f4,_0x452fd4[_0xf5dd('0x19')]));});});};
\ No newline at end of file
+var _0x0e13=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0e13,0xfe));var _0x30e1=function(_0x127c7b,_0x1f65e7){_0x127c7b=_0x127c7b-0x0;var _0x1708eb=_0x0e13[_0x127c7b];return _0x1708eb;};'use strict';var _=require(_0x30e1('0x0'));var util=require(_0x30e1('0x1'));var moment=require(_0x30e1('0x2'));var BPromise=require(_0x30e1('0x3'));var rs=require(_0x30e1('0x4'));var fs=require('fs');var Redis=require(_0x30e1('0x5'));var db=require(_0x30e1('0x6'))['db'];var utils=require(_0x30e1('0x7'));var logger=require(_0x30e1('0x8'))(_0x30e1('0x9'));var config=require(_0x30e1('0xa'));var jayson=require(_0x30e1('0xb'));var client=jayson[_0x30e1('0xc')]['http']({'port':0x232a});config[_0x30e1('0xd')]=_[_0x30e1('0xe')](config[_0x30e1('0xd')],{'host':_0x30e1('0xf'),'port':0x18eb});var socket=require(_0x30e1('0x10'))(new Redis(config[_0x30e1('0xd')]));require('./chatInteraction.socket')[_0x30e1('0x11')](socket);function respondWithRpcPromise(_0x4f1cb6,_0x34e0b3,_0x402c9b){return new BPromise(function(_0x23f196,_0x105c81){return client[_0x30e1('0x12')](_0x4f1cb6,_0x402c9b)[_0x30e1('0x13')](function(_0x100dc1){logger[_0x30e1('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x34e0b3,_0x30e1('0x15'));logger[_0x30e1('0x16')](_0x30e1('0x17'),_0x34e0b3,'request\x20sent',JSON[_0x30e1('0x18')](_0x100dc1));if(_0x100dc1['error']){if(_0x100dc1[_0x30e1('0x19')][_0x30e1('0x1a')]===0x1f4){logger[_0x30e1('0x19')](_0x30e1('0x1b'),_0x34e0b3,_0x100dc1['error'][_0x30e1('0x1c')]);return _0x105c81(_0x100dc1[_0x30e1('0x19')][_0x30e1('0x1c')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x34e0b3,_0x100dc1[_0x30e1('0x19')][_0x30e1('0x1c')]);return _0x23f196(_0x100dc1[_0x30e1('0x19')][_0x30e1('0x1c')]);}else{logger[_0x30e1('0x14')](_0x30e1('0x1b'),_0x34e0b3,_0x30e1('0x15'));_0x23f196(_0x100dc1[_0x30e1('0x1d')][_0x30e1('0x1c')]);}})[_0x30e1('0x1e')](function(_0x44501c){logger[_0x30e1('0x19')](_0x30e1('0x1b'),_0x34e0b3,_0x44501c);_0x105c81(_0x44501c);});});}exports[_0x30e1('0x1f')]=function(_0x3acc8f){var _0x53c175=this;return new Promise(function(_0x2e185a,_0x1c6aa2){return db[_0x30e1('0x20')][_0x30e1('0x21')](_0x3acc8f[_0x30e1('0x22')],{'raw':_0x3acc8f[_0x30e1('0x23')]?_0x3acc8f['options'][_0x30e1('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3acc8f[_0x30e1('0x23')]?_0x3acc8f[_0x30e1('0x23')][_0x30e1('0x25')]||null:null,'attributes':_0x3acc8f[_0x30e1('0x23')]?_0x3acc8f[_0x30e1('0x23')][_0x30e1('0x26')]||null:null,'limit':_0x3acc8f[_0x30e1('0x23')]?_0x3acc8f[_0x30e1('0x23')][_0x30e1('0x27')]||null:null})[_0x30e1('0x13')](function(_0x196913){logger['info'](_0x30e1('0x1f'),_0x3acc8f);logger[_0x30e1('0x16')]('UpdateChatInteraction',_0x3acc8f,JSON['stringify'](_0x196913));_0x2e185a(_0x196913);})[_0x30e1('0x1e')](function(_0x4e2a73){logger['error'](_0x30e1('0x1f'),_0x4e2a73[_0x30e1('0x1c')],_0x3acc8f);_0x1c6aa2(_0x53c175[_0x30e1('0x19')](0x1f4,_0x4e2a73[_0x30e1('0x1c')]));});});};exports[_0x30e1('0x28')]=function(_0x2766a9){return new Promise(function(_0x44d8e0,_0x466036){return db[_0x30e1('0x20')][_0x30e1('0x29')]({'where':_0x2766a9[_0x30e1('0x23')]?_0x2766a9[_0x30e1('0x23')]['where']||null:null})[_0x30e1('0x13')](function(_0xb26f06){if(_0xb26f06){return _0xb26f06[_0x30e1('0x2a')](_0x2766a9[_0x30e1('0x22')][_0x30e1('0x2b')],_[_0x30e1('0x2c')](_0x2766a9['body'],['ids','id'])||{});}})['spread'](function(_0x29d0af){logger[_0x30e1('0x14')](_0x30e1('0x2d'),_0x2766a9);logger[_0x30e1('0x16')]('AddTags',_0x2766a9,JSON['stringify'](_0x29d0af));_0x44d8e0(_0x29d0af);})['catch'](function(_0x2e77b0){logger[_0x30e1('0x19')](_0x30e1('0x2d'),_0x2e77b0['message'],_0x2766a9);_0x466036(_this[_0x30e1('0x19')](0x1f4,_0x2e77b0[_0x30e1('0x1c')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 46db272..b992b0d 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 _0x40fd=['removeListener','register','length','chatInteraction:','./chatInteraction.events','remove','emit'];(function(_0xfab7d2,_0x3de01e){var _0x5a804e=function(_0x21213e){while(--_0x21213e){_0xfab7d2['push'](_0xfab7d2['shift']());}};_0x5a804e(++_0x3de01e);}(_0x40fd,0x17e));var _0xd40f=function(_0x45dafa,_0x171e29){_0x45dafa=_0x45dafa-0x0;var _0xeb385a=_0x40fd[_0x45dafa];return _0xeb385a;};'use strict';var ChatInteractionEvents=require(_0xd40f('0x0'));var events=['save',_0xd40f('0x1'),'update'];function createListener(_0x50ad20,_0x4e6315){return function(_0x101fa4){_0x4e6315[_0xd40f('0x2')](_0x50ad20,_0x101fa4);};}function removeListener(_0xbe3839,_0x191e08){return function(){ChatInteractionEvents[_0xd40f('0x3')](_0xbe3839,_0x191e08);};}exports[_0xd40f('0x4')]=function(_0x403279){for(var _0x2d0af6=0x0,_0x491d38=events[_0xd40f('0x5')];_0x2d0af6<_0x491d38;_0x2d0af6++){var _0x836f21=events[_0x2d0af6];var _0x18cadb=createListener(_0xd40f('0x6')+_0x836f21,_0x403279);ChatInteractionEvents['on'](_0x836f21,_0x18cadb);}};
\ No newline at end of file
+var _0x2458=['save','remove','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x2458,0x167));var _0x8245=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x2458[_0x413feb];return _0x40ee88;};'use strict';var ChatInteractionEvents=require(_0x8245('0x0'));var events=[_0x8245('0x1'),_0x8245('0x2'),_0x8245('0x3')];function createListener(_0x40c69e,_0x43019e){return function(_0xca4796){_0x43019e[_0x8245('0x4')](_0x40c69e,_0xca4796);};}function removeListener(_0x2b141c,_0x649754){return function(){ChatInteractionEvents[_0x8245('0x5')](_0x2b141c,_0x649754);};}exports[_0x8245('0x6')]=function(_0xd7f101){for(var _0x2b9d09=0x0,_0x49cf90=events['length'];_0x2b9d09<_0x49cf90;_0x2b9d09++){var _0x499d46=events[_0x2b9d09];var _0x23c92f=createListener(_0x8245('0x7')+_0x499d46,_0xd7f101);ChatInteractionEvents['on'](_0x499d46,_0x23c92f);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 8a8021b..b06c35a 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 _0x0102=['chatinteraction:destroy','destroy','removeTags','util','path','connect-timeout','express','get','isAuthenticated','index','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','create','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','/:id/attachment_upload','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','update','/:id/custom_update','/:id/abandon','put','close','delete'];(function(_0xb1619b,_0x45c457){var _0x5170b3=function(_0x28044f){while(--_0x28044f){_0xb1619b['push'](_0xb1619b['shift']());}};_0x5170b3(++_0x45c457);}(_0x0102,0x186));var _0x2010=function(_0x2af33c,_0x4fb7ea){_0x2af33c=_0x2af33c-0x0;var _0x16f4aa=_0x0102[_0x2af33c];return _0x16f4aa;};'use strict';var multer=require('multer');var util=require(_0x2010('0x0'));var path=require(_0x2010('0x1'));var timeout=require(_0x2010('0x2'));var express=require(_0x2010('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x2010('0x4')]('/',auth[_0x2010('0x5')](),controller[_0x2010('0x6')]);router[_0x2010('0x4')]('/describe',auth[_0x2010('0x5')](),controller['describe']);router[_0x2010('0x4')](_0x2010('0x7'),auth['isChatInteractionAuthorized'](),controller[_0x2010('0x8')]);router[_0x2010('0x4')](_0x2010('0x9'),auth[_0x2010('0xa')](),controller[_0x2010('0xb')]);router[_0x2010('0x4')](_0x2010('0xc'),auth[_0x2010('0x5')](),controller[_0x2010('0xd')]);router[_0x2010('0x4')](_0x2010('0xe'),auth[_0x2010('0xa')](),controller[_0x2010('0xf')]);router[_0x2010('0x4')](_0x2010('0x10'),auth[_0x2010('0x5')](),controller['download']);router['post']('/',auth[_0x2010('0x5')](),controller[_0x2010('0x11')]);var upload=multer({'storage':multer[_0x2010('0x12')]({'destination':function(_0x10b587,_0x32d791,_0x335be4){_0x335be4(null,path['join'](config[_0x2010('0x13')],_0x2010('0x14')));},'filename':function(_0x5ad412,_0x41e267,_0x11c94b){_0x11c94b(null,util[_0x2010('0x15')](_0x2010('0x16'),Date[_0x2010('0x17')](),_0x41e267[_0x2010('0x18')][_0x2010('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2010('0x1a')](_0x2010('0x1b'),upload['single']('file'),controller[_0x2010('0x1c')]);router[_0x2010('0x1a')](_0x2010('0xc'),auth[_0x2010('0xa')](),controller['addMessage']);router['post'](_0x2010('0x1d'),auth[_0x2010('0x5')](),interaction[_0x2010('0x1e')](_0x2010('0x1f'),_0x2010('0x20')),controller[_0x2010('0x21')]);router['put'](_0x2010('0x7'),auth[_0x2010('0x5')](),interaction['tracked']('chat','chatinteraction:update'),controller[_0x2010('0x22')]);router['put'](_0x2010('0x23'),controller['customUpdate']);router['put'](_0x2010('0x24'),auth[_0x2010('0xa')](),controller['abandon']);router[_0x2010('0x25')]('/:id/close',controller[_0x2010('0x26')]);router[_0x2010('0x27')](_0x2010('0x7'),auth[_0x2010('0x5')](),interaction[_0x2010('0x1e')](_0x2010('0x1f'),_0x2010('0x28')),controller[_0x2010('0x29')]);router[_0x2010('0x27')](_0x2010('0x1d'),auth[_0x2010('0x5')](),controller[_0x2010('0x2a')]);module['exports']=router;
\ No newline at end of file
+var _0xed3c=['isAuthenticated','index','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','getMyMessages','/:id/download','download','post','create','join','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','addTags','put','/:id','tracked','chat','/:id/custom_update','customUpdate','abandon','/:id/close','delete','removeTags','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0xed3c,0x1a6));var _0xced3=function(_0xa85dbd,_0x2838a5){_0xa85dbd=_0xa85dbd-0x0;var _0x3be7aa=_0xed3c[_0xa85dbd];return _0x3be7aa;};'use strict';var multer=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var path=require(_0xced3('0x2'));var timeout=require(_0xced3('0x3'));var express=require('express');var router=express[_0xced3('0x4')]();var auth=require(_0xced3('0x5'));var interaction=require(_0xced3('0x6'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0xced3('0x7')]('/',auth[_0xced3('0x8')](),controller[_0xced3('0x9')]);router[_0xced3('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xced3('0x7')]('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router[_0xced3('0x7')](_0xced3('0xa'),auth[_0xced3('0xb')](),controller[_0xced3('0xc')]);router[_0xced3('0x7')]('/:id/messages',auth[_0xced3('0x8')](),controller[_0xced3('0xd')]);router[_0xced3('0x7')]('/:id/my_messages',auth[_0xced3('0xb')](),controller[_0xced3('0xe')]);router[_0xced3('0x7')](_0xced3('0xf'),auth[_0xced3('0x8')](),controller[_0xced3('0x10')]);router[_0xced3('0x11')]('/',auth['isAuthenticated'](),controller[_0xced3('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf2db6f,_0x435616,_0x20d099){_0x20d099(null,path[_0xced3('0x13')](config['root'],_0xced3('0x14')));},'filename':function(_0x322c2d,_0x4acae6,_0x3b5962){_0x3b5962(null,util[_0xced3('0x15')](_0xced3('0x16'),Date[_0xced3('0x17')](),_0x4acae6['originalname'][_0xced3('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xced3('0x19'),upload[_0xced3('0x1a')](_0xced3('0x1b')),controller[_0xced3('0x1c')]);router[_0xced3('0x11')](_0xced3('0x1d'),auth[_0xced3('0xb')](),controller[_0xced3('0x1e')]);router[_0xced3('0x11')](_0xced3('0x1f'),auth[_0xced3('0x8')](),interaction['tracked']('chat','chatinteraction:addtags'),controller[_0xced3('0x20')]);router[_0xced3('0x21')](_0xced3('0x22'),auth['isAuthenticated'](),interaction[_0xced3('0x23')](_0xced3('0x24'),'chatinteraction:update'),controller['update']);router[_0xced3('0x21')](_0xced3('0x25'),controller[_0xced3('0x26')]);router[_0xced3('0x21')]('/:id/abandon',auth[_0xced3('0xb')](),controller[_0xced3('0x27')]);router['put'](_0xced3('0x28'),controller['close']);router[_0xced3('0x29')](_0xced3('0x22'),auth[_0xced3('0x8')](),interaction[_0xced3('0x23')](_0xced3('0x24'),'chatinteraction:destroy'),controller['destroy']);router[_0xced3('0x29')]('/:id/tags',auth[_0xced3('0x8')](),controller[_0xced3('0x2a')]);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 d813391..3cac78b 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 _0xb511=['BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x1a1318,_0x54f540){var _0x53da69=function(_0x5940cc){while(--_0x5940cc){_0x1a1318['push'](_0x1a1318['shift']());}};_0x53da69(++_0x54f540);}(_0xb511,0x165));var _0x1b51=function(_0x1c585c,_0x3a286e){_0x1c585c=_0x1c585c-0x0;var _0x75692a=_0xb511[_0x1c585c];return _0x75692a;};'use strict';var Sequelize=require(_0x1b51('0x0'));module[_0x1b51('0x1')]={'body':{'type':Sequelize[_0x1b51('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1b51('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1b51('0x4')]}};
\ No newline at end of file
+var _0x6c45=['BOOLEAN','INTEGER','sequelize','exports','medium'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6c45,0xb1));var _0x56c4=function(_0x3a935f,_0x5e6aa0){_0x3a935f=_0x3a935f-0x0;var _0xf90ad1=_0x6c45[_0x3a935f];return _0xf90ad1;};'use strict';var Sequelize=require(_0x56c4('0x0'));module[_0x56c4('0x1')]={'body':{'type':Sequelize['TEXT'](_0x56c4('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x56c4('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x56c4('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 20b667d..f8e3228 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 _0x55ca=['socket.io-emitter','sendStatus','status','end','json','count','offset','limit','reject','update','then','error','stack','name','send','index','ChatInternalMessage','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','params','describe','get','lastMessageAt','createdAt','lastMessage','format','getUsers','User','admin','user','fullname','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','type','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','filter','agent','resourceId','push','messages','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x250ce7,_0x502ad3){var _0x416428=function(_0x46564d){while(--_0x46564d){_0x250ce7['push'](_0x250ce7['shift']());}};_0x416428(++_0x502ad3);}(_0x55ca,0x126));var _0xa55c=function(_0x9b5bb2,_0x5db315){_0x9b5bb2=_0x9b5bb2-0x0;var _0x2e1e92=_0x55ca[_0x9b5bb2];return _0x2e1e92;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var hardwareService=require(_0xa55c('0x10'));var logger=require(_0xa55c('0x11'))(_0xa55c('0x12'));var utils=require(_0xa55c('0x13'));var config=require(_0xa55c('0x14'));var db=require(_0xa55c('0x15'))['db'];config[_0xa55c('0x16')]=_[_0xa55c('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa55c('0x18'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xcc;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x19')](_0x3930e4);}return _0x18ee85[_0xa55c('0x1a')](_0x3930e4)[_0xa55c('0x1b')]();};}function respondWithResult(_0x4e0b2f,_0x3ccf65){_0x3ccf65=_0x3ccf65||0xc8;return function(_0x3dcf4f){if(_0x3dcf4f){return _0x4e0b2f[_0xa55c('0x1a')](_0x3ccf65)[_0xa55c('0x1c')](_0x3dcf4f);}};}function respondWithFilteredResult(_0x1c4cfd,_0x3ae86b){return function(_0x51590e){if(_0x51590e){var _0x2d09d8=_0x51590e[_0xa55c('0x1d')],_0x24783b=_0x3ae86b[_0xa55c('0x1e')],_0x4cee3c=_0x3ae86b[_0xa55c('0x1e')]+_0x3ae86b[_0xa55c('0x1f')],_0x3d4c9e;if(_0x4cee3c>=_0x2d09d8){_0x4cee3c=_0x2d09d8;_0x3d4c9e=0xc8;}else{_0x3d4c9e=0xce;}_0x1c4cfd[_0xa55c('0x1a')](_0x3d4c9e);return _0x1c4cfd['set']('Content-Range',_0x24783b+'-'+_0x4cee3c+'/'+_0x2d09d8)[_0xa55c('0x1c')](_0x51590e);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x20')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x21')](_0x187a87)[_0xa55c('0x22')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x22')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x1b')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x19')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x1a')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=db[_0xa55c('0x28')][_0xa55c('0x29')];_0x22f6b6['model']=_[_0xa55c('0x2a')](_0x201941);_0x22f6b6['query']=_[_0xa55c('0x2a')](_0x906caa[_0xa55c('0x2b')]);_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x22f6b6['model'],_0x22f6b6[_0xa55c('0x2b')]);_0x1377b0[_0xa55c('0x2e')]=_[_0xa55c('0x2d')](_0x22f6b6[_0xa55c('0x2f')],qs[_0xa55c('0x30')](_0x906caa[_0xa55c('0x2b')][_0xa55c('0x30')]));_0x1377b0[_0xa55c('0x2e')]=_0x1377b0[_0xa55c('0x2e')][_0xa55c('0x31')]?_0x1377b0[_0xa55c('0x2e')]:_0x22f6b6['model'];if(!_0x906caa['query'][_0xa55c('0x32')](_0xa55c('0x33'))){_0x1377b0['limit']=qs[_0xa55c('0x1f')](_0x906caa[_0xa55c('0x2b')][_0xa55c('0x1f')]);_0x1377b0[_0xa55c('0x1e')]=qs[_0xa55c('0x1e')](_0x906caa[_0xa55c('0x2b')][_0xa55c('0x1e')]);}_0x1377b0[_0xa55c('0x34')]=qs[_0xa55c('0x35')](_0x906caa['query']['sort']);_0x1377b0['where']=qs[_0xa55c('0x2c')](_[_0xa55c('0x36')](_0x906caa[_0xa55c('0x2b')],_0x22f6b6['filters']));if(_0x906caa[_0xa55c('0x2b')]['filter']){_0x1377b0[_0xa55c('0x37')]=_['merge'](_0x1377b0[_0xa55c('0x37')],{'$or':_[_0xa55c('0x38')](_0x201941,function(_0x3c0ec1){if(_0x3c0ec1['type'][_0xa55c('0x39')]!==_0xa55c('0x3a')){var _0x47e93c={};_0x47e93c[_0x3c0ec1[_0xa55c('0x3b')]]={'$like':'%'+_0x906caa[_0xa55c('0x2b')]['filter']+'%'};return _0x47e93c;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa[_0xa55c('0x3c')]);var _0x5d3960={'where':_0x1377b0[_0xa55c('0x37')]};return db[_0xa55c('0x28')]['count'](_0x5d3960)['then'](function(_0x5e50b6){_0x1b8388['count']=_0x5e50b6;if(_0x906caa[_0xa55c('0x2b')][_0xa55c('0x3d')]){_0x1377b0[_0xa55c('0x3e')]=[{'all':!![]}];}return db[_0xa55c('0x28')][_0xa55c('0x3f')](_0x1377b0);})['then'](function(_0x3d52d8){_0x1b8388[_0xa55c('0x40')]=_0x3d52d8;return _0x1b8388;})[_0xa55c('0x22')](respondWithFilteredResult(_0x5d940d,_0x1377b0))[_0xa55c('0x41')](handleError(_0x5d940d,null));};exports[_0xa55c('0x42')]=function(_0x23cef5,_0x554620){var _0x386e34={'raw':!![],'where':{'id':_0x23cef5['params']['id']}},_0x5ee63d={};_0x5ee63d[_0xa55c('0x2f')]=_[_0xa55c('0x2a')](db['ChatInternalMessage'][_0xa55c('0x29')]);_0x5ee63d['query']=_['keys'](_0x23cef5[_0xa55c('0x2b')]);_0x5ee63d[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x5ee63d['model'],_0x5ee63d[_0xa55c('0x2b')]);_0x386e34[_0xa55c('0x2e')]=_['intersection'](_0x5ee63d[_0xa55c('0x2f')],qs['fields'](_0x23cef5[_0xa55c('0x2b')][_0xa55c('0x30')]));_0x386e34['attributes']=_0x386e34[_0xa55c('0x2e')][_0xa55c('0x31')]?_0x386e34['attributes']:_0x5ee63d[_0xa55c('0x2f')];if(_0x23cef5[_0xa55c('0x2b')][_0xa55c('0x3d')]){_0x386e34['include']=[{'all':!![]}];}_0x386e34=_[_0xa55c('0x43')]({},_0x386e34,_0x23cef5['options']);return db[_0xa55c('0x28')][_0xa55c('0x44')](_0x386e34)[_0xa55c('0x22')](handleEntityNotFound(_0x554620,null))['then'](respondWithResult(_0x554620,null))[_0xa55c('0x41')](handleError(_0x554620,null));};exports[_0xa55c('0x45')]=function(_0x592429,_0x3d19f5){return db[_0xa55c('0x28')]['create'](_0x592429[_0xa55c('0x46')],{})[_0xa55c('0x22')](respondWithResult(_0x3d19f5,0xc9))['catch'](handleError(_0x3d19f5,null));};exports[_0xa55c('0x21')]=function(_0x81cee8,_0x219a68){if(_0x81cee8[_0xa55c('0x46')]['id']){delete _0x81cee8['body']['id'];}return db[_0xa55c('0x28')]['find']({'where':{'id':_0x81cee8[_0xa55c('0x47')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x219a68,null))[_0xa55c('0x22')](saveUpdates(_0x81cee8['body'],null))[_0xa55c('0x22')](respondWithResult(_0x219a68,null))[_0xa55c('0x41')](handleError(_0x219a68,null));};exports['destroy']=function(_0x5be06,_0x34de95){return db[_0xa55c('0x28')][_0xa55c('0x44')]({'where':{'id':_0x5be06[_0xa55c('0x47')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x34de95,null))[_0xa55c('0x22')](removeEntity(_0x34de95,null))[_0xa55c('0x41')](handleError(_0x34de95,null));};exports[_0xa55c('0x48')]=function(_0x3376a1,_0x4fc0a9){return db[_0xa55c('0x28')][_0xa55c('0x48')]()[_0xa55c('0x22')](respondWithResult(_0x4fc0a9,null))['catch'](handleError(_0x4fc0a9,null));};function wrapUser(_0x4c3095){return function(_0x35bf0a){var _0x4f5ecd=_0x4c3095[_0xa55c('0x49')]({'plain':!![]});_0x4f5ecd['messages']=[];if(_0x35bf0a){_0x4f5ecd[_0xa55c('0x4a')]=_0x35bf0a[_0xa55c('0x4b')];_0x4f5ecd[_0xa55c('0x4c')]=_0x35bf0a;}else{_0x4f5ecd[_0xa55c('0x4a')]=moment(0x0)[_0xa55c('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f5ecd[_0xa55c('0x4c')]={};}return _0x4f5ecd;};}exports[_0xa55c('0x4e')]=function(_0x4b85cc,_0x3929a6,_0x2291e0){var _0x17f4f8=[];return db[_0xa55c('0x4f')]['findAll']({'where':{'role':['agent',_0xa55c('0x50'),_0xa55c('0x51')]},'attributes':['id',_0xa55c('0x52'),_0xa55c('0x25'),'role',_0xa55c('0x53'),'internal',_0xa55c('0x54'),_0xa55c('0x55'),_0xa55c('0x56'),_0xa55c('0x57')],'order':qs[_0xa55c('0x35')]('-online'),'include':[{'model':db[_0xa55c('0x58')],'as':'VoiceQueues','attributes':['id',_0xa55c('0x25'),_0xa55c('0x59')],'through':{'attributes':[]}}]})[_0xa55c('0x22')](function(_0x1e1c5b){if(_0x1e1c5b){var _0x19aaf5=_0x4b85cc[_0xa55c('0x51')][_0xa55c('0x49')]({'plain':!![]});if(!_0x19aaf5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19aaf5[_0xa55c('0x5a')]===_0xa55c('0x51')){return db[_0xa55c('0x5b')][_0xa55c('0x44')]({'where':{'name':_0xa55c('0x5c'),'userProfileId':_0x19aaf5['userProfileId']},'raw':!![]})[_0xa55c('0x22')](function(_0x3cd40d){if(_0x3cd40d){if(_0x3cd40d[_0xa55c('0x5d')]===0x0){return db[_0xa55c('0x5e')][_0xa55c('0x3f')]({'where':{'sectionId':_0x3cd40d['id']},'raw':!![]})['then'](function(_0xdd92c1){var _0x21725b=[];if(_[_0xa55c('0x5f')](_0xdd92c1)){_0x21725b=_[_0xa55c('0x60')](_0x1e1c5b,function(_0x3ba56d){if(_0x3ba56d['role']!==_0xa55c('0x61')){return _0x3ba56d;}});return _0x21725b;}else{for(var _0x4d94fc=0x0;_0x4d94fc<_0x1e1c5b[_0xa55c('0x31')];_0x4d94fc++){var _0x5e3a28=_0x1e1c5b[_0x4d94fc];if(_0x5e3a28[_0xa55c('0x5a')]==='agent'){var _0x34edc5=_[_0xa55c('0x44')](_0xdd92c1,function(_0x21d6b4){return _0x21d6b4[_0xa55c('0x62')]===_0x5e3a28['id'];});if(_0x34edc5)_0x21725b[_0xa55c('0x63')](_0x5e3a28);}else{_0x21725b[_0xa55c('0x63')](_0x5e3a28);}}return _0x21725b;}});}else{return _0x1e1c5b;}}else{var _0xafaf8c=_[_0xa55c('0x60')](_0x1e1c5b,function(_0x14b515){if(_0x14b515[_0xa55c('0x5a')]!=='agent'){return _0x14b515;}});return _0xafaf8c;}});}else{return _0x1e1c5b;}}})[_0xa55c('0x22')](function(_0x311bb9){var _0x4ef914=[];if(_0x311bb9){_0x17f4f8=_0x311bb9;for(var _0x18b928=0x0;_0x18b928<_0x311bb9[_0xa55c('0x31')];_0x18b928+=0x1){_0x17f4f8[_0x18b928][_0xa55c('0x64')]=[];_0x4ef914[_0xa55c('0x63')](db[_0xa55c('0x28')][_0xa55c('0x44')]({'where':{'FromId':[_0x4b85cc[_0xa55c('0x51')]['id'],_0x311bb9[_0x18b928]['id']],'ToId':[_0x4b85cc[_0xa55c('0x51')]['id'],_0x311bb9[_0x18b928]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xa55c('0x65'),_0xa55c('0x66'),_0xa55c('0x67'),_0xa55c('0x46')],'order':qs[_0xa55c('0x35')](_0xa55c('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa55c('0x22')](wrapUser(_0x311bb9[_0x18b928])));}return BPromise[_0xa55c('0x69')](_0x4ef914);}return[];})[_0xa55c('0x22')](function(_0x4a08ca){return{'rows':_0x4a08ca,'count':_0x4a08ca[_0xa55c('0x31')]};})[_0xa55c('0x22')](respondWithResult(_0x3929a6,null))[_0xa55c('0x41')](handleError(_0x3929a6,null));};
\ No newline at end of file
+var _0x55ca=['socket.io-emitter','sendStatus','status','end','json','count','offset','limit','reject','update','then','error','stack','name','send','index','ChatInternalMessage','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','params','describe','get','lastMessageAt','createdAt','lastMessage','format','getUsers','User','admin','user','fullname','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','type','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','filter','agent','resourceId','push','messages','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x7abd7,_0x1ca3f9){var _0x3a2577=function(_0x18456d){while(--_0x18456d){_0x7abd7['push'](_0x7abd7['shift']());}};_0x3a2577(++_0x1ca3f9);}(_0x55ca,0x126));var _0xa55c=function(_0x302f55,_0x31872f){_0x302f55=_0x302f55-0x0;var _0x55ca94=_0x55ca[_0x302f55];return _0x55ca94;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var hardwareService=require(_0xa55c('0x10'));var logger=require(_0xa55c('0x11'))(_0xa55c('0x12'));var utils=require(_0xa55c('0x13'));var config=require(_0xa55c('0x14'));var db=require(_0xa55c('0x15'))['db'];config[_0xa55c('0x16')]=_[_0xa55c('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa55c('0x18'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xcc;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x19')](_0x3930e4);}return _0x18ee85[_0xa55c('0x1a')](_0x3930e4)[_0xa55c('0x1b')]();};}function respondWithResult(_0x4e0b2f,_0x3ccf65){_0x3ccf65=_0x3ccf65||0xc8;return function(_0x3dcf4f){if(_0x3dcf4f){return _0x4e0b2f[_0xa55c('0x1a')](_0x3ccf65)[_0xa55c('0x1c')](_0x3dcf4f);}};}function respondWithFilteredResult(_0x1c4cfd,_0x3ae86b){return function(_0x51590e){if(_0x51590e){var _0x2d09d8=_0x51590e[_0xa55c('0x1d')],_0x24783b=_0x3ae86b[_0xa55c('0x1e')],_0x4cee3c=_0x3ae86b[_0xa55c('0x1e')]+_0x3ae86b[_0xa55c('0x1f')],_0x3d4c9e;if(_0x4cee3c>=_0x2d09d8){_0x4cee3c=_0x2d09d8;_0x3d4c9e=0xc8;}else{_0x3d4c9e=0xce;}_0x1c4cfd[_0xa55c('0x1a')](_0x3d4c9e);return _0x1c4cfd['set']('Content-Range',_0x24783b+'-'+_0x4cee3c+'/'+_0x2d09d8)[_0xa55c('0x1c')](_0x51590e);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x20')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x21')](_0x187a87)[_0xa55c('0x22')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x22')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x1b')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x19')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x1a')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=db[_0xa55c('0x28')][_0xa55c('0x29')];_0x22f6b6['model']=_[_0xa55c('0x2a')](_0x201941);_0x22f6b6['query']=_[_0xa55c('0x2a')](_0x906caa[_0xa55c('0x2b')]);_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x22f6b6['model'],_0x22f6b6[_0xa55c('0x2b')]);_0x1377b0[_0xa55c('0x2e')]=_[_0xa55c('0x2d')](_0x22f6b6[_0xa55c('0x2f')],qs[_0xa55c('0x30')](_0x906caa[_0xa55c('0x2b')][_0xa55c('0x30')]));_0x1377b0[_0xa55c('0x2e')]=_0x1377b0[_0xa55c('0x2e')][_0xa55c('0x31')]?_0x1377b0[_0xa55c('0x2e')]:_0x22f6b6['model'];if(!_0x906caa['query'][_0xa55c('0x32')](_0xa55c('0x33'))){_0x1377b0['limit']=qs[_0xa55c('0x1f')](_0x906caa[_0xa55c('0x2b')][_0xa55c('0x1f')]);_0x1377b0[_0xa55c('0x1e')]=qs[_0xa55c('0x1e')](_0x906caa[_0xa55c('0x2b')][_0xa55c('0x1e')]);}_0x1377b0[_0xa55c('0x34')]=qs[_0xa55c('0x35')](_0x906caa['query']['sort']);_0x1377b0['where']=qs[_0xa55c('0x2c')](_[_0xa55c('0x36')](_0x906caa[_0xa55c('0x2b')],_0x22f6b6['filters']));if(_0x906caa[_0xa55c('0x2b')]['filter']){_0x1377b0[_0xa55c('0x37')]=_['merge'](_0x1377b0[_0xa55c('0x37')],{'$or':_[_0xa55c('0x38')](_0x201941,function(_0x3c0ec1){if(_0x3c0ec1['type'][_0xa55c('0x39')]!==_0xa55c('0x3a')){var _0x47e93c={};_0x47e93c[_0x3c0ec1[_0xa55c('0x3b')]]={'$like':'%'+_0x906caa[_0xa55c('0x2b')]['filter']+'%'};return _0x47e93c;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa[_0xa55c('0x3c')]);var _0x5d3960={'where':_0x1377b0[_0xa55c('0x37')]};return db[_0xa55c('0x28')]['count'](_0x5d3960)['then'](function(_0x5e50b6){_0x1b8388['count']=_0x5e50b6;if(_0x906caa[_0xa55c('0x2b')][_0xa55c('0x3d')]){_0x1377b0[_0xa55c('0x3e')]=[{'all':!![]}];}return db[_0xa55c('0x28')][_0xa55c('0x3f')](_0x1377b0);})['then'](function(_0x3d52d8){_0x1b8388[_0xa55c('0x40')]=_0x3d52d8;return _0x1b8388;})[_0xa55c('0x22')](respondWithFilteredResult(_0x5d940d,_0x1377b0))[_0xa55c('0x41')](handleError(_0x5d940d,null));};exports[_0xa55c('0x42')]=function(_0x23cef5,_0x554620){var _0x386e34={'raw':!![],'where':{'id':_0x23cef5['params']['id']}},_0x5ee63d={};_0x5ee63d[_0xa55c('0x2f')]=_[_0xa55c('0x2a')](db['ChatInternalMessage'][_0xa55c('0x29')]);_0x5ee63d['query']=_['keys'](_0x23cef5[_0xa55c('0x2b')]);_0x5ee63d[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x5ee63d['model'],_0x5ee63d[_0xa55c('0x2b')]);_0x386e34[_0xa55c('0x2e')]=_['intersection'](_0x5ee63d[_0xa55c('0x2f')],qs['fields'](_0x23cef5[_0xa55c('0x2b')][_0xa55c('0x30')]));_0x386e34['attributes']=_0x386e34[_0xa55c('0x2e')][_0xa55c('0x31')]?_0x386e34['attributes']:_0x5ee63d[_0xa55c('0x2f')];if(_0x23cef5[_0xa55c('0x2b')][_0xa55c('0x3d')]){_0x386e34['include']=[{'all':!![]}];}_0x386e34=_[_0xa55c('0x43')]({},_0x386e34,_0x23cef5['options']);return db[_0xa55c('0x28')][_0xa55c('0x44')](_0x386e34)[_0xa55c('0x22')](handleEntityNotFound(_0x554620,null))['then'](respondWithResult(_0x554620,null))[_0xa55c('0x41')](handleError(_0x554620,null));};exports[_0xa55c('0x45')]=function(_0x592429,_0x3d19f5){return db[_0xa55c('0x28')]['create'](_0x592429[_0xa55c('0x46')],{})[_0xa55c('0x22')](respondWithResult(_0x3d19f5,0xc9))['catch'](handleError(_0x3d19f5,null));};exports[_0xa55c('0x21')]=function(_0x81cee8,_0x219a68){if(_0x81cee8[_0xa55c('0x46')]['id']){delete _0x81cee8['body']['id'];}return db[_0xa55c('0x28')]['find']({'where':{'id':_0x81cee8[_0xa55c('0x47')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x219a68,null))[_0xa55c('0x22')](saveUpdates(_0x81cee8['body'],null))[_0xa55c('0x22')](respondWithResult(_0x219a68,null))[_0xa55c('0x41')](handleError(_0x219a68,null));};exports['destroy']=function(_0x5be06,_0x34de95){return db[_0xa55c('0x28')][_0xa55c('0x44')]({'where':{'id':_0x5be06[_0xa55c('0x47')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x34de95,null))[_0xa55c('0x22')](removeEntity(_0x34de95,null))[_0xa55c('0x41')](handleError(_0x34de95,null));};exports[_0xa55c('0x48')]=function(_0x3376a1,_0x4fc0a9){return db[_0xa55c('0x28')][_0xa55c('0x48')]()[_0xa55c('0x22')](respondWithResult(_0x4fc0a9,null))['catch'](handleError(_0x4fc0a9,null));};function wrapUser(_0x4c3095){return function(_0x35bf0a){var _0x4f5ecd=_0x4c3095[_0xa55c('0x49')]({'plain':!![]});_0x4f5ecd['messages']=[];if(_0x35bf0a){_0x4f5ecd[_0xa55c('0x4a')]=_0x35bf0a[_0xa55c('0x4b')];_0x4f5ecd[_0xa55c('0x4c')]=_0x35bf0a;}else{_0x4f5ecd[_0xa55c('0x4a')]=moment(0x0)[_0xa55c('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f5ecd[_0xa55c('0x4c')]={};}return _0x4f5ecd;};}exports[_0xa55c('0x4e')]=function(_0x4b85cc,_0x3929a6,_0x2291e0){var _0x17f4f8=[];return db[_0xa55c('0x4f')]['findAll']({'where':{'role':['agent',_0xa55c('0x50'),_0xa55c('0x51')]},'attributes':['id',_0xa55c('0x52'),_0xa55c('0x25'),'role',_0xa55c('0x53'),'internal',_0xa55c('0x54'),_0xa55c('0x55'),_0xa55c('0x56'),_0xa55c('0x57')],'order':qs[_0xa55c('0x35')]('-online'),'include':[{'model':db[_0xa55c('0x58')],'as':'VoiceQueues','attributes':['id',_0xa55c('0x25'),_0xa55c('0x59')],'through':{'attributes':[]}}]})[_0xa55c('0x22')](function(_0x1e1c5b){if(_0x1e1c5b){var _0x19aaf5=_0x4b85cc[_0xa55c('0x51')][_0xa55c('0x49')]({'plain':!![]});if(!_0x19aaf5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19aaf5[_0xa55c('0x5a')]===_0xa55c('0x51')){return db[_0xa55c('0x5b')][_0xa55c('0x44')]({'where':{'name':_0xa55c('0x5c'),'userProfileId':_0x19aaf5['userProfileId']},'raw':!![]})[_0xa55c('0x22')](function(_0x3cd40d){if(_0x3cd40d){if(_0x3cd40d[_0xa55c('0x5d')]===0x0){return db[_0xa55c('0x5e')][_0xa55c('0x3f')]({'where':{'sectionId':_0x3cd40d['id']},'raw':!![]})['then'](function(_0xdd92c1){var _0x21725b=[];if(_[_0xa55c('0x5f')](_0xdd92c1)){_0x21725b=_[_0xa55c('0x60')](_0x1e1c5b,function(_0x3ba56d){if(_0x3ba56d['role']!==_0xa55c('0x61')){return _0x3ba56d;}});return _0x21725b;}else{for(var _0x4d94fc=0x0;_0x4d94fc<_0x1e1c5b[_0xa55c('0x31')];_0x4d94fc++){var _0x5e3a28=_0x1e1c5b[_0x4d94fc];if(_0x5e3a28[_0xa55c('0x5a')]==='agent'){var _0x34edc5=_[_0xa55c('0x44')](_0xdd92c1,function(_0x21d6b4){return _0x21d6b4[_0xa55c('0x62')]===_0x5e3a28['id'];});if(_0x34edc5)_0x21725b[_0xa55c('0x63')](_0x5e3a28);}else{_0x21725b[_0xa55c('0x63')](_0x5e3a28);}}return _0x21725b;}});}else{return _0x1e1c5b;}}else{var _0xafaf8c=_[_0xa55c('0x60')](_0x1e1c5b,function(_0x14b515){if(_0x14b515[_0xa55c('0x5a')]!=='agent'){return _0x14b515;}});return _0xafaf8c;}});}else{return _0x1e1c5b;}}})[_0xa55c('0x22')](function(_0x311bb9){var _0x4ef914=[];if(_0x311bb9){_0x17f4f8=_0x311bb9;for(var _0x18b928=0x0;_0x18b928<_0x311bb9[_0xa55c('0x31')];_0x18b928+=0x1){_0x17f4f8[_0x18b928][_0xa55c('0x64')]=[];_0x4ef914[_0xa55c('0x63')](db[_0xa55c('0x28')][_0xa55c('0x44')]({'where':{'FromId':[_0x4b85cc[_0xa55c('0x51')]['id'],_0x311bb9[_0x18b928]['id']],'ToId':[_0x4b85cc[_0xa55c('0x51')]['id'],_0x311bb9[_0x18b928]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xa55c('0x65'),_0xa55c('0x66'),_0xa55c('0x67'),_0xa55c('0x46')],'order':qs[_0xa55c('0x35')](_0xa55c('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa55c('0x22')](wrapUser(_0x311bb9[_0x18b928])));}return BPromise[_0xa55c('0x69')](_0x4ef914);}return[];})[_0xa55c('0x22')](function(_0x4a08ca){return{'rows':_0x4a08ca,'count':_0x4a08ca[_0xa55c('0x31')]};})[_0xa55c('0x22')](respondWithResult(_0x3929a6,null))[_0xa55c('0x41')](handleError(_0x3929a6,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index bb37cd5..1a8bc41 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 _0xc00b=['remove','emit','hook','exports','events','../../mysqldb','ChatInternalMessage','save','update'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0xc00b,0x109));var _0xbc00=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0xc00b[_0x121886];return _0x20ca01;};'use strict';var EventEmitter=require(_0xbc00('0x0'));var ChatInternalMessage=require(_0xbc00('0x1'))['db'][_0xbc00('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbc00('0x3'),'afterUpdate':_0xbc00('0x4'),'afterDestroy':_0xbc00('0x5')};function emitEvent(_0x3377d2){return function(_0x389f9c,_0x341f72,_0xd2e6da){ChatInternalMessageEvents[_0xbc00('0x6')](_0x3377d2+':'+_0x389f9c['id'],_0x389f9c);ChatInternalMessageEvents[_0xbc00('0x6')](_0x3377d2,_0x389f9c);_0xd2e6da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xbc00('0x7')](e,emitEvent(event));}}module[_0xbc00('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe6b0=['hook','setMaxListeners','save','emit'];(function(_0x5bbdd3,_0x3be03b){var _0xbb2c40=function(_0x446bbb){while(--_0x446bbb){_0x5bbdd3['push'](_0x5bbdd3['shift']());}};_0xbb2c40(++_0x3be03b);}(_0xe6b0,0x1e5));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0e6b('0x0')](0x0);var events={'afterCreate':_0x0e6b('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x58de25){return function(_0x18db69,_0xc06c68,_0x13e3f3){ChatInternalMessageEvents[_0x0e6b('0x2')](_0x58de25+':'+_0x18db69['id'],_0x18db69);ChatInternalMessageEvents[_0x0e6b('0x2')](_0x58de25,_0x18db69);_0x13e3f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x0e6b('0x3')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 79360ab..9885add 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 _0x0b41=['./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','../../config/environment'];(function(_0x259c7e,_0x96223a){var _0x15d791=function(_0x5f4198){while(--_0x5f4198){_0x259c7e['push'](_0x259c7e['shift']());}};_0x15d791(++_0x96223a);}(_0x0b41,0x8a));var _0x10b4=function(_0x252c0c,_0x1bf2fc){_0x252c0c=_0x252c0c-0x0;var _0x3d5b1b=_0x0b41[_0x252c0c];return _0x3d5b1b;};'use strict';var _=require('lodash');var util=require(_0x10b4('0x0'));var logger=require('../../config/logger')(_0x10b4('0x1'));var moment=require(_0x10b4('0x2'));var BPromise=require(_0x10b4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x10b4('0x4'));var attributes=require(_0x10b4('0x5'));module['exports']=function(_0x236aff,_0x4be5d8){return _0x236aff[_0x10b4('0x6')](_0x10b4('0x7'),attributes,{'tableName':_0x10b4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x10b4('0x9'),'collate':_0x10b4('0xa')});};
\ No newline at end of file
+var _0x15b7=['rimraf','../../config/environment','exports','define','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3424e1,_0x163c85){var _0x539e76=function(_0x43e32e){while(--_0x43e32e){_0x3424e1['push'](_0x3424e1['shift']());}};_0x539e76(++_0x163c85);}(_0x15b7,0x191));var _0x715b=function(_0x2fe49c,_0x58a5bd){_0x2fe49c=_0x2fe49c-0x0;var _0x30c76d=_0x15b7[_0x2fe49c];return _0x30c76d;};'use strict';var _=require('lodash');var util=require(_0x715b('0x0'));var logger=require(_0x715b('0x1'))(_0x715b('0x2'));var moment=require(_0x715b('0x3'));var BPromise=require(_0x715b('0x4'));var rp=require(_0x715b('0x5'));var fs=require('fs');var path=require(_0x715b('0x6'));var rimraf=require(_0x715b('0x7'));var config=require(_0x715b('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0x715b('0x9')]=function(_0x23dc0d,_0x12011f){return _0x23dc0d[_0x715b('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x715b('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 25c0185..6794854 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 _0xf26f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','lodash','util'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0xf26f,0x142));var _0xff26=function(_0x355188,_0x17d31e){_0x355188=_0x355188-0x0;var _0x1d6a0d=_0xf26f[_0x355188];return _0x1d6a0d;};'use strict';var _=require(_0xff26('0x0'));var util=require(_0xff26('0x1'));var moment=require(_0xff26('0x2'));var BPromise=require(_0xff26('0x3'));var rs=require(_0xff26('0x4'));var fs=require('fs');var Redis=require(_0xff26('0x5'));var db=require(_0xff26('0x6'))['db'];var utils=require(_0xff26('0x7'));var logger=require('../../config/logger')(_0xff26('0x8'));var config=require(_0xff26('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff26('0xa')][_0xff26('0xb')]({'port':0x232a});config[_0xff26('0xc')]=_[_0xff26('0xd')](config['redis'],{'host':_0xff26('0xe'),'port':0x18eb});var socket=require(_0xff26('0xf'))(new Redis(config[_0xff26('0xc')]));require('./chatInternalMessage.socket')[_0xff26('0x10')](socket);function respondWithRpcPromise(_0x4a3651,_0x3b0057,_0x3007c1){return new BPromise(function(_0x5c8569,_0x345534){return client['request'](_0x4a3651,_0x3007c1)[_0xff26('0x11')](function(_0x3f6530){logger['info'](_0xff26('0x12'),_0x3b0057,_0xff26('0x13'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x3b0057,_0xff26('0x13'),JSON[_0xff26('0x14')](_0x3f6530));if(_0x3f6530['error']){if(_0x3f6530['error'][_0xff26('0x15')]===0x1f4){logger[_0xff26('0x16')](_0xff26('0x12'),_0x3b0057,_0x3f6530[_0xff26('0x16')]['message']);return _0x345534(_0x3f6530['error']['message']);}logger['error'](_0xff26('0x12'),_0x3b0057,_0x3f6530['error'][_0xff26('0x17')]);return _0x5c8569(_0x3f6530[_0xff26('0x16')][_0xff26('0x17')]);}else{logger[_0xff26('0x18')](_0xff26('0x12'),_0x3b0057,'request\x20sent');_0x5c8569(_0x3f6530[_0xff26('0x19')][_0xff26('0x17')]);}})[_0xff26('0x1a')](function(_0x2064c3){logger[_0xff26('0x16')](_0xff26('0x12'),_0x3b0057,_0x2064c3);_0x345534(_0x2064c3);});});}
\ No newline at end of file
+var _0xd2af=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','lodash'];(function(_0x4dec04,_0x210072){var _0x226ede=function(_0x9d9be8){while(--_0x9d9be8){_0x4dec04['push'](_0x4dec04['shift']());}};_0x226ede(++_0x210072);}(_0xd2af,0x185));var _0xfd2a=function(_0x52a6e3,_0x4a73b4){_0x52a6e3=_0x52a6e3-0x0;var _0x8910d0=_0xd2af[_0x52a6e3];return _0x8910d0;};'use strict';var _=require(_0xfd2a('0x0'));var util=require(_0xfd2a('0x1'));var moment=require(_0xfd2a('0x2'));var BPromise=require(_0xfd2a('0x3'));var rs=require(_0xfd2a('0x4'));var fs=require('fs');var Redis=require(_0xfd2a('0x5'));var db=require(_0xfd2a('0x6'))['db'];var utils=require(_0xfd2a('0x7'));var logger=require(_0xfd2a('0x8'))('rpc');var config=require(_0xfd2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfd2a('0xa')][_0xfd2a('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfd2a('0xc')],{'host':_0xfd2a('0xd'),'port':0x18eb});var socket=require(_0xfd2a('0xe'))(new Redis(config[_0xfd2a('0xc')]));require(_0xfd2a('0xf'))[_0xfd2a('0x10')](socket);function respondWithRpcPromise(_0x1f4d44,_0x1929bd,_0x2b8474){return new BPromise(function(_0x3b4c32,_0x17e287){return client[_0xfd2a('0x11')](_0x1f4d44,_0x2b8474)['then'](function(_0x5854ce){logger[_0xfd2a('0x12')](_0xfd2a('0x13'),_0x1929bd,_0xfd2a('0x14'));logger[_0xfd2a('0x15')](_0xfd2a('0x16'),_0x1929bd,_0xfd2a('0x14'),JSON['stringify'](_0x5854ce));if(_0x5854ce[_0xfd2a('0x17')]){if(_0x5854ce['error'][_0xfd2a('0x18')]===0x1f4){logger['error'](_0xfd2a('0x13'),_0x1929bd,_0x5854ce[_0xfd2a('0x17')]['message']);return _0x17e287(_0x5854ce[_0xfd2a('0x17')][_0xfd2a('0x19')]);}logger[_0xfd2a('0x17')](_0xfd2a('0x13'),_0x1929bd,_0x5854ce[_0xfd2a('0x17')][_0xfd2a('0x19')]);return _0x3b4c32(_0x5854ce['error'][_0xfd2a('0x19')]);}else{logger[_0xfd2a('0x12')](_0xfd2a('0x13'),_0x1929bd,_0xfd2a('0x14'));_0x3b4c32(_0x5854ce['result'][_0xfd2a('0x19')]);}})['catch'](function(_0x48b0ad){logger[_0xfd2a('0x17')](_0xfd2a('0x13'),_0x1929bd,_0x48b0ad);_0x17e287(_0x48b0ad);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 7b22357..6bd9798 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 _0xd910=['removeListener','register','length','./chatInternalMessage.events','save','remove','emit'];(function(_0x47c492,_0x311a27){var _0x32105d=function(_0x5b0289){while(--_0x5b0289){_0x47c492['push'](_0x47c492['shift']());}};_0x32105d(++_0x311a27);}(_0xd910,0x1c3));var _0x0d91=function(_0x1c5fe1,_0x3355ff){_0x1c5fe1=_0x1c5fe1-0x0;var _0x101cc3=_0xd910[_0x1c5fe1];return _0x101cc3;};'use strict';var ChatInternalMessageEvents=require(_0x0d91('0x0'));var events=[_0x0d91('0x1'),_0x0d91('0x2'),'update'];function createListener(_0x43d761,_0x4f9048){return function(_0x59f69c){_0x4f9048[_0x0d91('0x3')](_0x43d761,_0x59f69c);};}function removeListener(_0x371b63,_0x590422){return function(){ChatInternalMessageEvents[_0x0d91('0x4')](_0x371b63,_0x590422);};}exports[_0x0d91('0x5')]=function(_0x47e005){for(var _0x5e916a=0x0,_0x486563=events[_0x0d91('0x6')];_0x5e916a<_0x486563;_0x5e916a++){var _0x5c6fc1=events[_0x5e916a];var _0x8fdd9f=createListener('chatInternalMessage:'+_0x5c6fc1,_0x47e005);ChatInternalMessageEvents['on'](_0x5c6fc1,_0x8fdd9f);}};
\ No newline at end of file
+var _0x1fc8=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fc8,0x13e));var _0x81fc=function(_0x3244ec,_0x531849){_0x3244ec=_0x3244ec-0x0;var _0x5a1a09=_0x1fc8[_0x3244ec];return _0x5a1a09;};'use strict';var ChatInternalMessageEvents=require(_0x81fc('0x0'));var events=[_0x81fc('0x1'),_0x81fc('0x2'),'update'];function createListener(_0x12d647,_0x2467e1){return function(_0x450cef){_0x2467e1['emit'](_0x12d647,_0x450cef);};}function removeListener(_0x406ee7,_0x5a31eb){return function(){ChatInternalMessageEvents[_0x81fc('0x3')](_0x406ee7,_0x5a31eb);};}exports[_0x81fc('0x4')]=function(_0x5effbc){for(var _0x16a529=0x0,_0x453815=events[_0x81fc('0x5')];_0x16a529<_0x453815;_0x16a529++){var _0x352f00=events[_0x16a529];var _0x1fe9cd=createListener(_0x81fc('0x6')+_0x352f00,_0x5effbc);ChatInternalMessageEvents['on'](_0x352f00,_0x1fe9cd);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index db11954..a0fee16 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 _0xbb3e=['getUsers','/:id','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xbb3e,0x181));var _0xebb3=function(_0x1a3eb7,_0x1d25b3){_0x1a3eb7=_0x1a3eb7-0x0;var _0x4377fa=_0xbb3e[_0x1a3eb7];return _0x4377fa;};'use strict';var multer=require(_0xebb3('0x0'));var util=require(_0xebb3('0x1'));var path=require(_0xebb3('0x2'));var timeout=require(_0xebb3('0x3'));var express=require('express');var router=express[_0xebb3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xebb3('0x5'));var config=require(_0xebb3('0x6'));var controller=require(_0xebb3('0x7'));router[_0xebb3('0x8')]('/',auth[_0xebb3('0x9')](),controller[_0xebb3('0xa')]);router[_0xebb3('0x8')](_0xebb3('0xb'),auth[_0xebb3('0x9')](),controller[_0xebb3('0xc')]);router[_0xebb3('0x8')](_0xebb3('0xd'),auth[_0xebb3('0x9')](),controller[_0xebb3('0xe')]);router[_0xebb3('0x8')](_0xebb3('0xf'),auth[_0xebb3('0x9')](),controller['show']);router[_0xebb3('0x10')]('/',auth[_0xebb3('0x9')](),controller['create']);router[_0xebb3('0x11')](_0xebb3('0xf'),controller[_0xebb3('0x12')]);router['delete']('/:id',auth[_0xebb3('0x9')](),controller[_0xebb3('0x13')]);module[_0xebb3('0x14')]=router;
\ No newline at end of file
+var _0xe225=['get','/describe','isAuthenticated','describe','/users','getUsers','/:id','post','create','put','update','destroy','exports','util','path','../../components/auth/service','../../config/environment','index'];(function(_0x4c03ae,_0x5856b0){var _0x1acaab=function(_0x8c9f5f){while(--_0x8c9f5f){_0x4c03ae['push'](_0x4c03ae['shift']());}};_0x1acaab(++_0x5856b0);}(_0xe225,0x1bd));var _0x5e22=function(_0x473b87,_0x3fb8d3){_0x473b87=_0x473b87-0x0;var _0x41e241=_0xe225[_0x473b87];return _0x41e241;};'use strict';var multer=require('multer');var util=require(_0x5e22('0x0'));var path=require(_0x5e22('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x5e22('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x5e22('0x3'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5e22('0x4')]);router[_0x5e22('0x5')](_0x5e22('0x6'),auth[_0x5e22('0x7')](),controller[_0x5e22('0x8')]);router[_0x5e22('0x5')](_0x5e22('0x9'),auth[_0x5e22('0x7')](),controller[_0x5e22('0xa')]);router[_0x5e22('0x5')](_0x5e22('0xb'),auth[_0x5e22('0x7')](),controller['show']);router[_0x5e22('0xc')]('/',auth['isAuthenticated'](),controller[_0x5e22('0xd')]);router[_0x5e22('0xe')](_0x5e22('0xb'),controller[_0x5e22('0xf')]);router['delete'](_0x5e22('0xb'),auth['isAuthenticated'](),controller[_0x5e22('0x10')]);module[_0x5e22('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 8262824..d04916f 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 _0x12f6=['exports','TEXT','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x3e3151,_0x485564){var _0xa17ff6=function(_0x3cab61){while(--_0x3cab61){_0x3e3151['push'](_0x3e3151['shift']());}};_0xa17ff6(++_0x485564);}(_0x12f6,0x1d4));var _0x612f=function(_0x485fff,_0x33157d){_0x485fff=_0x485fff-0x0;var _0x43fdb0=_0x12f6[_0x485fff];return _0x43fdb0;};'use strict';var Sequelize=require(_0x612f('0x0'));module[_0x612f('0x1')]={'body':{'type':Sequelize[_0x612f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x612f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x612f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x612f('0x4')]('in',_0x612f('0x5')),'defaultValue':_0x612f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x612f('0x6')]}};
\ No newline at end of file
+var _0x2f45=['out','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x2f45,0x127));var _0x52f4=function(_0x4f5530,_0x14d560){_0x4f5530=_0x4f5530-0x0;var _0x122f09=_0x2f45[_0x4f5530];return _0x122f09;};'use strict';var Sequelize=require(_0x52f4('0x0'));module[_0x52f4('0x1')]={'body':{'type':Sequelize[_0x52f4('0x2')](_0x52f4('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x52f4('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x52f4('0x5')]('in',_0x52f4('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 6a30c02..9f2d385 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 _0x6ea5=['VIRTUAL','field','options','include','rows','show','params','create','body','find','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','../../config/logger','agent','ChatInteraction','RejectMessage','rejectMessage','event','rejectmessage','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','http','client','test','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','index','ChatMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','key'];(function(_0x408059,_0x35993c){var _0x411648=function(_0x124879){while(--_0x124879){_0x408059['push'](_0x408059['shift']());}};_0x411648(++_0x35993c);}(_0x6ea5,0xa5));var _0x56ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ea5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x56ea('0x0'));var emlformat=require(_0x56ea('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x56ea('0x2'));var jsonpatch=require(_0x56ea('0x3'));var rp=require('request-promise');var moment=require(_0x56ea('0x4'));var BPromise=require(_0x56ea('0x5'));var Mustache=require('mustache');var util=require(_0x56ea('0x6'));var path=require('path');var sox=require(_0x56ea('0x7'));var csv=require(_0x56ea('0x8'));var ejs=require(_0x56ea('0x9'));var fs=require('fs');var _=require(_0x56ea('0xa'));var squel=require('squel');var crypto=require(_0x56ea('0xb'));var jsforce=require(_0x56ea('0xc'));var deskjs=require(_0x56ea('0xd'));var toCsv=require(_0x56ea('0x8'));var querystring=require('querystring');var Papa=require(_0x56ea('0xe'));var Redis=require(_0x56ea('0xf'));var authService=require(_0x56ea('0x10'));var qs=require(_0x56ea('0x11'));var hardwareService=require(_0x56ea('0x12'));var logger=require('../../config/logger')(_0x56ea('0x13'));var utils=require(_0x56ea('0x14'));var config=require(_0x56ea('0x15'));var db=require(_0x56ea('0x16'))['db'];config['redis']=_[_0x56ea('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x56ea('0x18'))(new Redis(config[_0x56ea('0x19')]));require(_0x56ea('0x1a'))[_0x56ea('0x1b')](socket);var jayson=require(_0x56ea('0x1c'));var client=jayson['client'][_0x56ea('0x1d')]({'port':0x232c});var client9002=jayson[_0x56ea('0x1e')][_0x56ea('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x17f75c,_0x451431,_0x4cea11){if(_0x4cea11){var _0x550645=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x550645[_0x56ea('0x1f')](_0x451431)){return _0x17f75c;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x17f75c;}}function respondWithRpcPromise(_0x208855,_0x34ab0e,_0x2e7e9a,_0x39a5d9){return new BPromise(function(_0x36d2b1,_0x1f9acc){var _0x1d9fbe=_0x39a5d9||client;return _0x1d9fbe[_0x56ea('0x20')](_0x208855,_0x2e7e9a)['then'](function(_0x5da2fa){logger[_0x56ea('0x21')](_0x56ea('0x22'),_0x34ab0e,_0x56ea('0x23'));logger[_0x56ea('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x34ab0e,'request\x20sent',JSON[_0x56ea('0x25')](_0x5da2fa));if(_0x5da2fa[_0x56ea('0x26')]){if(_0x5da2fa[_0x56ea('0x26')][_0x56ea('0x27')]===0x1f4){logger[_0x56ea('0x26')](_0x56ea('0x22'),_0x34ab0e,_0x5da2fa['error'][_0x56ea('0x28')]);return _0x1f9acc(_0x5da2fa[_0x56ea('0x26')][_0x56ea('0x28')]);}logger['error'](_0x56ea('0x22'),_0x34ab0e,_0x5da2fa[_0x56ea('0x26')][_0x56ea('0x28')]);return _0x36d2b1(_0x5da2fa[_0x56ea('0x26')][_0x56ea('0x28')]);}else{logger[_0x56ea('0x21')](_0x56ea('0x22'),_0x34ab0e,'request\x20sent');_0x36d2b1(_0x5da2fa[_0x56ea('0x29')][_0x56ea('0x28')]);}})[_0x56ea('0x2a')](function(_0x1c789b){logger[_0x56ea('0x26')](_0x56ea('0x22'),_0x34ab0e,_0x1c789b);_0x1f9acc(_0x1c789b);});});}function respondWithStatusCode(_0x3d0f10,_0x3e6d04){_0x3e6d04=_0x3e6d04||0xcc;return function(_0x49c933){if(_0x49c933){return _0x3d0f10[_0x56ea('0x2b')](_0x3e6d04);}return _0x3d0f10[_0x56ea('0x2c')](_0x3e6d04)[_0x56ea('0x2d')]();};}function respondWithResult(_0x61f34d,_0x1d0ded){_0x1d0ded=_0x1d0ded||0xc8;return function(_0x24d6ef){if(_0x24d6ef){return _0x61f34d[_0x56ea('0x2c')](_0x1d0ded)['json'](_0x24d6ef);}};}function respondWithFilteredResult(_0x486c67,_0x53d06d){return function(_0x287d14){if(_0x287d14){var _0x54f74a=_0x287d14[_0x56ea('0x2e')],_0x176af1=_0x53d06d['offset'],_0x40decf=_0x53d06d[_0x56ea('0x2f')]+_0x53d06d[_0x56ea('0x30')],_0x5b1ad3;if(_0x40decf>=_0x54f74a){_0x40decf=_0x54f74a;_0x5b1ad3=0xc8;}else{_0x5b1ad3=0xce;}_0x486c67[_0x56ea('0x2c')](_0x5b1ad3);return _0x486c67[_0x56ea('0x31')](_0x56ea('0x32'),_0x176af1+'-'+_0x40decf+'/'+_0x54f74a)['json'](_0x287d14);}return null;};}function patchUpdates(_0x337d3){return function(_0x1afb2d){try{jsonpatch['apply'](_0x1afb2d,_0x337d3,!![]);}catch(_0x88d2cd){return BPromise[_0x56ea('0x33')](_0x88d2cd);}return _0x1afb2d['save']();};}function saveUpdates(_0x18cfe7,_0xfb4e6){return function(_0x2cc3f7){if(_0x2cc3f7){return _0x2cc3f7[_0x56ea('0x34')](_0x18cfe7)[_0x56ea('0x35')](function(_0x1370cc){return _0x1370cc;});}return null;};}function removeEntity(_0x3d54b8,_0x57483e){return function(_0x59dd23){if(_0x59dd23){return _0x59dd23[_0x56ea('0x36')]()[_0x56ea('0x35')](function(){_0x3d54b8[_0x56ea('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40aa56,_0x564d90){return function(_0x16428a){if(!_0x16428a){_0x40aa56[_0x56ea('0x2b')](0x194);}return _0x16428a;};}function handleError(_0x4f0820,_0x3eb2fc){_0x3eb2fc=_0x3eb2fc||0x1f4;return function(_0x49fb91){logger[_0x56ea('0x26')](_0x49fb91[_0x56ea('0x37')]);if(_0x49fb91[_0x56ea('0x38')]){delete _0x49fb91[_0x56ea('0x38')];}_0x4f0820[_0x56ea('0x2c')](_0x3eb2fc)[_0x56ea('0x39')](_0x49fb91);};}exports[_0x56ea('0x3a')]=function(_0x43625b,_0x5bc0e7){var _0x5163db={},_0x1b9e62={},_0x17f6dd={'count':0x0,'rows':[]};var _0x3a717b=db[_0x56ea('0x3b')][_0x56ea('0x3c')];_0x1b9e62[_0x56ea('0x3d')]=_['keys'](_0x3a717b);_0x1b9e62[_0x56ea('0x3e')]=_[_0x56ea('0x3f')](_0x43625b[_0x56ea('0x3e')]);_0x1b9e62[_0x56ea('0x40')]=_[_0x56ea('0x41')](_0x1b9e62[_0x56ea('0x3d')],_0x1b9e62['query']);_0x5163db[_0x56ea('0x42')]=_[_0x56ea('0x41')](_0x1b9e62[_0x56ea('0x3d')],qs['fields'](_0x43625b['query'][_0x56ea('0x43')]));_0x5163db[_0x56ea('0x42')]=_0x5163db[_0x56ea('0x42')][_0x56ea('0x44')]?_0x5163db['attributes']:_0x1b9e62[_0x56ea('0x3d')];if(!_0x43625b[_0x56ea('0x3e')]['hasOwnProperty'](_0x56ea('0x45'))){_0x5163db[_0x56ea('0x30')]=qs[_0x56ea('0x30')](_0x43625b[_0x56ea('0x3e')][_0x56ea('0x30')]);_0x5163db[_0x56ea('0x2f')]=qs[_0x56ea('0x2f')](_0x43625b['query'][_0x56ea('0x2f')]);}_0x5163db['order']=qs[_0x56ea('0x46')](_0x43625b[_0x56ea('0x3e')][_0x56ea('0x46')]);_0x5163db[_0x56ea('0x47')]=qs[_0x56ea('0x40')](_[_0x56ea('0x48')](_0x43625b[_0x56ea('0x3e')],_0x1b9e62[_0x56ea('0x40')]));if(_0x43625b['query'][_0x56ea('0x49')]){_0x5163db[_0x56ea('0x47')]=_[_0x56ea('0x4a')](_0x5163db[_0x56ea('0x47')],{'$or':_['map'](_0x3a717b,function(_0x255398){if(_0x255398[_0x56ea('0x4b')][_0x56ea('0x4c')]!==_0x56ea('0x4d')){var _0x1f99ff={};_0x1f99ff[_0x255398[_0x56ea('0x4e')]]={'$like':'%'+_0x43625b[_0x56ea('0x3e')][_0x56ea('0x49')]+'%'};return _0x1f99ff;}})});}_0x5163db=_[_0x56ea('0x4a')]({},_0x5163db,_0x43625b[_0x56ea('0x4f')]);var _0x269447={'where':_0x5163db[_0x56ea('0x47')]};return db[_0x56ea('0x3b')][_0x56ea('0x2e')](_0x269447)[_0x56ea('0x35')](function(_0x495565){_0x17f6dd[_0x56ea('0x2e')]=_0x495565;if(_0x43625b[_0x56ea('0x3e')]['includeAll']){_0x5163db[_0x56ea('0x50')]=[{'all':!![]}];}return db[_0x56ea('0x3b')]['findAll'](_0x5163db);})[_0x56ea('0x35')](function(_0x97b119){_0x17f6dd[_0x56ea('0x51')]=_0x97b119;return _0x17f6dd;})[_0x56ea('0x35')](respondWithFilteredResult(_0x5bc0e7,_0x5163db))[_0x56ea('0x2a')](handleError(_0x5bc0e7,null));};exports[_0x56ea('0x52')]=function(_0x365e64,_0x74f02f){var _0x1a38dd={'raw':!![],'where':{'id':_0x365e64[_0x56ea('0x53')]['id']}},_0x10a3d2={};_0x10a3d2['model']=_[_0x56ea('0x3f')](db[_0x56ea('0x3b')][_0x56ea('0x3c')]);_0x10a3d2['query']=_['keys'](_0x365e64[_0x56ea('0x3e')]);_0x10a3d2[_0x56ea('0x40')]=_[_0x56ea('0x41')](_0x10a3d2['model'],_0x10a3d2[_0x56ea('0x3e')]);_0x1a38dd['attributes']=_['intersection'](_0x10a3d2[_0x56ea('0x3d')],qs[_0x56ea('0x43')](_0x365e64['query'][_0x56ea('0x43')]));_0x1a38dd[_0x56ea('0x42')]=_0x1a38dd[_0x56ea('0x42')][_0x56ea('0x44')]?_0x1a38dd['attributes']:_0x10a3d2[_0x56ea('0x3d')];if(_0x365e64[_0x56ea('0x3e')]['includeAll']){_0x1a38dd[_0x56ea('0x50')]=[{'all':!![]}];}_0x1a38dd=_['merge']({},_0x1a38dd,_0x365e64['options']);return db[_0x56ea('0x3b')]['find'](_0x1a38dd)['then'](handleEntityNotFound(_0x74f02f,null))[_0x56ea('0x35')](respondWithResult(_0x74f02f,null))[_0x56ea('0x2a')](handleError(_0x74f02f,null));};exports['create']=function(_0x19878b,_0x2c67af){return db[_0x56ea('0x3b')][_0x56ea('0x54')](_0x19878b['body'],{})[_0x56ea('0x35')](respondWithResult(_0x2c67af,0xc9))[_0x56ea('0x2a')](handleError(_0x2c67af,null));};exports[_0x56ea('0x34')]=function(_0x201eaf,_0x9b70e5){if(_0x201eaf['body']['id']){delete _0x201eaf[_0x56ea('0x55')]['id'];}return db[_0x56ea('0x3b')][_0x56ea('0x56')]({'where':{'id':_0x201eaf[_0x56ea('0x53')]['id']}})['then'](handleEntityNotFound(_0x9b70e5,null))[_0x56ea('0x35')](saveUpdates(_0x201eaf[_0x56ea('0x55')],null))['then'](respondWithResult(_0x9b70e5,null))['catch'](handleError(_0x9b70e5,null));};exports['destroy']=function(_0x5d9ccd,_0x4179ce){return db[_0x56ea('0x3b')][_0x56ea('0x56')]({'where':{'id':_0x5d9ccd[_0x56ea('0x53')]['id']}})[_0x56ea('0x35')](handleEntityNotFound(_0x4179ce,null))['then'](removeEntity(_0x4179ce,null))[_0x56ea('0x2a')](handleError(_0x4179ce,null));};exports[_0x56ea('0x57')]=function(_0x2d7850,_0x1a669c){return db['ChatMessage'][_0x56ea('0x57')]()[_0x56ea('0x35')](respondWithResult(_0x1a669c,null))[_0x56ea('0x2a')](handleError(_0x1a669c,null));};var interaction_log=require('../../config/logger')(_0x56ea('0x58'));exports[_0x56ea('0x59')]=function(_0x11675b,_0x207cc4,_0x17ee8d){var _0x5a6e04={'channel':_0x56ea('0x5a')};if(_0x11675b[_0x56ea('0x55')]['id']){delete _0x11675b['body']['id'];}_0x11675b['body'][_0x56ea('0x5b')]=!![];_0x11675b[_0x56ea('0x55')][_0x56ea('0x5c')]=moment()[_0x56ea('0x5d')](_0x56ea('0x5e'));_0x11675b['body'][_0x56ea('0x5f')]=_0x11675b['body'][_0x56ea('0x5f')]||_0x11675b[_0x56ea('0x60')]['id'];return db['ChatMessage']['find']({'where':{'id':_0x11675b[_0x56ea('0x53')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x56ea('0x61')}]})['then'](handleEntityNotFound(_0x207cc4,null))[_0x56ea('0x35')](saveUpdates(_0x11675b['body'],null))[_0x56ea('0x35')](function(_0x1b4fb8){if(_0x1b4fb8){_0x5a6e04[_0x56ea('0x28')]=_0x1b4fb8[_0x56ea('0x62')]({'plain':!![]});return db['ChatInteraction'][_0x56ea('0x56')]({'where':{'id':_0x1b4fb8[_0x56ea('0x63')]}});}return null;})[_0x56ea('0x35')](handleEntityNotFound(_0x207cc4,null))[_0x56ea('0x35')](function(_0x5a2c78){if(_0x5a2c78){return _0x5a2c78[_0x56ea('0x34')]({'UserId':_0x11675b[_0x56ea('0x55')][_0x56ea('0x5f')],'read1stAt':_[_0x56ea('0x64')](_0x5a2c78[_0x56ea('0x65')])?moment()[_0x56ea('0x5d')](_0x56ea('0x5e')):undefined});}return null;})[_0x56ea('0x35')](function(_0x505391){if(_0x505391){_0x5a6e04[_0x56ea('0x66')]=_0x505391[_0x56ea('0x62')]({'plain':!![]});interaction_log['info'](_0x56ea('0x67'),_0x11675b[_0x56ea('0x60')]['id'],_0x11675b[_0x56ea('0x60')][_0x56ea('0x38')],_0x11675b['user'][_0x56ea('0x68')],_0x5a6e04[_0x56ea('0x66')]['id'],_0x11675b['body']?JSON[_0x56ea('0x25')](_0x11675b['body']):_0x56ea('0x69'));return respondWithRpcPromise(_0x56ea('0x6a'),_0x56ea('0x6b'),_0x5a6e04);}return null;})['then'](function(_0xba82ea){if(_0xba82ea){if(_0x11675b['body'][_0x56ea('0x6c')]){_0x5a6e04[_0x56ea('0x28')][_0x56ea('0x6d')]=util['format'](_0x56ea('0x6e'),_0x11675b[_0x56ea('0x60')][_0x56ea('0x38')]);_0x5a6e04['message'][_0x56ea('0x6f')]=_0x5a6e04[_0x56ea('0x6f')];_0x5a6e04['message']['event']='accept';return respondWithRpcPromise(_0x56ea('0x70'),_0x56ea('0x70'),{'event':_0x56ea('0x71'),'message':_['merge'](_0x5a6e04[_0x56ea('0x28')],JSON['parse'](_0x5a6e04['interaction']['formData']))},client9002)[_0x56ea('0x35')](function(){return _0x5a6e04;});}return _0x5a6e04;}return null;})[_0x56ea('0x35')](respondWithResult(_0x207cc4,null))['catch'](handleError(_0x207cc4,null));};var interaction_log=require(_0x56ea('0x72'))(_0x56ea('0x58'));exports[_0x56ea('0x33')]=function(_0xc8ff4e,_0x5c61ee,_0x3b930a){var _0xc5e482={'agent':{},'channel':_0x56ea('0x5a')};if(_0xc8ff4e[_0x56ea('0x55')]['id']){delete _0xc8ff4e[_0x56ea('0x55')]['id'];}_0xc8ff4e[_0x56ea('0x55')][_0x56ea('0x5f')]=_0xc8ff4e[_0x56ea('0x55')][_0x56ea('0x5f')]||_0xc8ff4e[_0x56ea('0x60')]['id'];_0xc5e482[_0x56ea('0x73')]['id']=_0xc8ff4e[_0x56ea('0x55')][_0x56ea('0x5f')];return db[_0x56ea('0x3b')][_0x56ea('0x56')]({'where':{'id':_0xc8ff4e['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c61ee,null))[_0x56ea('0x35')](function(_0x483328){if(_0x483328){_0xc5e482['message']=_0x483328[_0x56ea('0x62')]({'plain':!![]});return db[_0x56ea('0x74')][_0x56ea('0x56')]({'where':{'id':_0x483328[_0x56ea('0x63')]}});}return null;})[_0x56ea('0x35')](handleEntityNotFound(_0x5c61ee,null))[_0x56ea('0x35')](function(_0x970d53){if(_0x970d53){_0xc5e482['interaction']=_0x970d53[_0x56ea('0x62')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xc8ff4e['user']['id'],_0xc8ff4e[_0x56ea('0x60')][_0x56ea('0x38')],_0xc8ff4e[_0x56ea('0x60')][_0x56ea('0x68')],_0xc5e482['interaction']['id'],_0xc8ff4e[_0x56ea('0x55')]?JSON['stringify'](_0xc8ff4e[_0x56ea('0x55')]):'null');return respondWithRpcPromise(_0x56ea('0x75'),_0x56ea('0x76'),_0xc5e482);}return null;})['then'](function(_0x27a256){if(_0x27a256){_0x27a256[_0x56ea('0x28')][_0x56ea('0x6d')]=util['format'](_0x56ea('0x6e'),_0xc8ff4e['user']['name']);_0x27a256[_0x56ea('0x28')][_0x56ea('0x6f')]=_0xc5e482['channel'];_0x27a256['message'][_0x56ea('0x77')]='reject';respondWithRpcPromise(_0x56ea('0x70'),_0x56ea('0x70'),{'event':_0x56ea('0x78'),'message':_0x27a256[_0x56ea('0x28')]},client9002);return _0xc5e482;}return null;})[_0x56ea('0x35')](respondWithResult(_0x5c61ee,null))[_0x56ea('0x2a')](handleError(_0x5c61ee,null));};
\ No newline at end of file
+var _0x3d42=['send','index','ChatMessage','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','rows','show','keys','include','find','create','body','update','params','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','event','accept','EventManager','parse','formData','agent','ChatInteraction','SIP/%s','channel','rejectmessage','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','status','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','end','sendStatus','stack','name'];(function(_0x309385,_0x3ab38f){var _0x45b0f5=function(_0x4fa7e0){while(--_0x4fa7e0){_0x309385['push'](_0x309385['shift']());}};_0x45b0f5(++_0x3ab38f);}(_0x3d42,0xb8));var _0x23d4=function(_0x160c65,_0x33f7b6){_0x160c65=_0x160c65-0x0;var _0x1f3cbf=_0x3d42[_0x160c65];return _0x1f3cbf;};'use strict';var pdf=require(_0x23d4('0x0'));var emlformat=require(_0x23d4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x23d4('0x2'));var jsonpatch=require(_0x23d4('0x3'));var rp=require(_0x23d4('0x4'));var moment=require(_0x23d4('0x5'));var BPromise=require(_0x23d4('0x6'));var Mustache=require(_0x23d4('0x7'));var util=require('util');var path=require(_0x23d4('0x8'));var sox=require(_0x23d4('0x9'));var csv=require('to-csv');var ejs=require(_0x23d4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x23d4('0xb'));var jsforce=require(_0x23d4('0xc'));var deskjs=require(_0x23d4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x23d4('0xe'));var Papa=require('papaparse');var Redis=require(_0x23d4('0xf'));var authService=require(_0x23d4('0x10'));var qs=require(_0x23d4('0x11'));var hardwareService=require(_0x23d4('0x12'));var logger=require(_0x23d4('0x13'))('api');var utils=require(_0x23d4('0x14'));var config=require('../../config/environment');var db=require(_0x23d4('0x15'))['db'];config['redis']=_['defaults'](config[_0x23d4('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x23d4('0x17'))(new Redis(config[_0x23d4('0x16')]));require('./chatMessage.socket')[_0x23d4('0x18')](socket);var jayson=require(_0x23d4('0x19'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x23d4('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x4c42a2,_0x54cb55,_0x3e3997){if(_0x3e3997){var _0x5ab187=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5ab187[_0x23d4('0x1b')](_0x54cb55)){return _0x4c42a2;}else{throw new Error(_0x23d4('0x1c'));}}else{return _0x4c42a2;}}function respondWithRpcPromise(_0x3606ae,_0x4bc0c5,_0x4cec52,_0xfd4a9b){return new BPromise(function(_0x3c4ef2,_0x48f6c4){var _0x5d2501=_0xfd4a9b||client;return _0x5d2501[_0x23d4('0x1d')](_0x3606ae,_0x4cec52)[_0x23d4('0x1e')](function(_0x1de1f0){logger[_0x23d4('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x4bc0c5,_0x23d4('0x20'));logger[_0x23d4('0x21')](_0x23d4('0x22'),_0x4bc0c5,_0x23d4('0x20'),JSON[_0x23d4('0x23')](_0x1de1f0));if(_0x1de1f0[_0x23d4('0x24')]){if(_0x1de1f0[_0x23d4('0x24')][_0x23d4('0x25')]===0x1f4){logger[_0x23d4('0x24')](_0x23d4('0x26'),_0x4bc0c5,_0x1de1f0['error'][_0x23d4('0x27')]);return _0x48f6c4(_0x1de1f0[_0x23d4('0x24')][_0x23d4('0x27')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4bc0c5,_0x1de1f0[_0x23d4('0x24')]['message']);return _0x3c4ef2(_0x1de1f0[_0x23d4('0x24')][_0x23d4('0x27')]);}else{logger[_0x23d4('0x1f')](_0x23d4('0x26'),_0x4bc0c5,_0x23d4('0x20'));_0x3c4ef2(_0x1de1f0['result'][_0x23d4('0x27')]);}})[_0x23d4('0x28')](function(_0x282f7f){logger[_0x23d4('0x24')](_0x23d4('0x26'),_0x4bc0c5,_0x282f7f);_0x48f6c4(_0x282f7f);});});}function respondWithStatusCode(_0x4ba5f4,_0x14d2c4){_0x14d2c4=_0x14d2c4||0xcc;return function(_0x531622){if(_0x531622){return _0x4ba5f4['sendStatus'](_0x14d2c4);}return _0x4ba5f4[_0x23d4('0x29')](_0x14d2c4)['end']();};}function respondWithResult(_0x32510e,_0x8ad855){_0x8ad855=_0x8ad855||0xc8;return function(_0x40cacb){if(_0x40cacb){return _0x32510e[_0x23d4('0x29')](_0x8ad855)['json'](_0x40cacb);}};}function respondWithFilteredResult(_0x51677b,_0xb12d){return function(_0x3ba354){if(_0x3ba354){var _0x3a1a20=_0x3ba354[_0x23d4('0x2a')],_0x3bf1f8=_0xb12d[_0x23d4('0x2b')],_0x85b7b9=_0xb12d[_0x23d4('0x2b')]+_0xb12d[_0x23d4('0x2c')],_0x5151ad;if(_0x85b7b9>=_0x3a1a20){_0x85b7b9=_0x3a1a20;_0x5151ad=0xc8;}else{_0x5151ad=0xce;}_0x51677b['status'](_0x5151ad);return _0x51677b[_0x23d4('0x2d')](_0x23d4('0x2e'),_0x3bf1f8+'-'+_0x85b7b9+'/'+_0x3a1a20)[_0x23d4('0x2f')](_0x3ba354);}return null;};}function patchUpdates(_0x3564c3){return function(_0x54c584){try{jsonpatch[_0x23d4('0x30')](_0x54c584,_0x3564c3,!![]);}catch(_0x6b933e){return BPromise[_0x23d4('0x31')](_0x6b933e);}return _0x54c584[_0x23d4('0x32')]();};}function saveUpdates(_0xec70c0,_0x25c34e){return function(_0x3cdb2e){if(_0x3cdb2e){return _0x3cdb2e['update'](_0xec70c0)[_0x23d4('0x1e')](function(_0x1c4ee8){return _0x1c4ee8;});}return null;};}function removeEntity(_0x1b964b,_0xebc3e0){return function(_0x1eeca7){if(_0x1eeca7){return _0x1eeca7[_0x23d4('0x33')]()[_0x23d4('0x1e')](function(){_0x1b964b[_0x23d4('0x29')](0xcc)[_0x23d4('0x34')]();});}};}function handleEntityNotFound(_0x45feb9,_0x43bdcf){return function(_0x21cb5d){if(!_0x21cb5d){_0x45feb9[_0x23d4('0x35')](0x194);}return _0x21cb5d;};}function handleError(_0x4732e9,_0x5a3c4e){_0x5a3c4e=_0x5a3c4e||0x1f4;return function(_0xc3c837){logger['error'](_0xc3c837[_0x23d4('0x36')]);if(_0xc3c837[_0x23d4('0x37')]){delete _0xc3c837[_0x23d4('0x37')];}_0x4732e9[_0x23d4('0x29')](_0x5a3c4e)[_0x23d4('0x38')](_0xc3c837);};}exports[_0x23d4('0x39')]=function(_0x1f8eb5,_0x3af74f){var _0xd97fa1={},_0x2b41c1={},_0x5ee9f9={'count':0x0,'rows':[]};var _0x3dde13=db[_0x23d4('0x3a')][_0x23d4('0x3b')];_0x2b41c1[_0x23d4('0x3c')]=_['keys'](_0x3dde13);_0x2b41c1[_0x23d4('0x3d')]=_['keys'](_0x1f8eb5[_0x23d4('0x3d')]);_0x2b41c1[_0x23d4('0x3e')]=_[_0x23d4('0x3f')](_0x2b41c1[_0x23d4('0x3c')],_0x2b41c1['query']);_0xd97fa1[_0x23d4('0x40')]=_['intersection'](_0x2b41c1[_0x23d4('0x3c')],qs['fields'](_0x1f8eb5['query'][_0x23d4('0x41')]));_0xd97fa1[_0x23d4('0x40')]=_0xd97fa1[_0x23d4('0x40')][_0x23d4('0x42')]?_0xd97fa1[_0x23d4('0x40')]:_0x2b41c1[_0x23d4('0x3c')];if(!_0x1f8eb5[_0x23d4('0x3d')][_0x23d4('0x43')](_0x23d4('0x44'))){_0xd97fa1[_0x23d4('0x2c')]=qs[_0x23d4('0x2c')](_0x1f8eb5[_0x23d4('0x3d')][_0x23d4('0x2c')]);_0xd97fa1[_0x23d4('0x2b')]=qs[_0x23d4('0x2b')](_0x1f8eb5[_0x23d4('0x3d')][_0x23d4('0x2b')]);}_0xd97fa1['order']=qs[_0x23d4('0x45')](_0x1f8eb5[_0x23d4('0x3d')][_0x23d4('0x45')]);_0xd97fa1[_0x23d4('0x46')]=qs['filters'](_[_0x23d4('0x47')](_0x1f8eb5[_0x23d4('0x3d')],_0x2b41c1['filters']));if(_0x1f8eb5[_0x23d4('0x3d')][_0x23d4('0x48')]){_0xd97fa1[_0x23d4('0x46')]=_[_0x23d4('0x49')](_0xd97fa1[_0x23d4('0x46')],{'$or':_['map'](_0x3dde13,function(_0x159ede){if(_0x159ede[_0x23d4('0x4a')][_0x23d4('0x4b')]!==_0x23d4('0x4c')){var _0x3a0b0c={};_0x3a0b0c[_0x159ede['field']]={'$like':'%'+_0x1f8eb5[_0x23d4('0x3d')][_0x23d4('0x48')]+'%'};return _0x3a0b0c;}})});}_0xd97fa1=_[_0x23d4('0x49')]({},_0xd97fa1,_0x1f8eb5[_0x23d4('0x4d')]);var _0x3ace91={'where':_0xd97fa1[_0x23d4('0x46')]};return db[_0x23d4('0x3a')][_0x23d4('0x2a')](_0x3ace91)['then'](function(_0x3c96a7){_0x5ee9f9[_0x23d4('0x2a')]=_0x3c96a7;if(_0x1f8eb5[_0x23d4('0x3d')][_0x23d4('0x4e')]){_0xd97fa1['include']=[{'all':!![]}];}return db[_0x23d4('0x3a')]['findAll'](_0xd97fa1);})[_0x23d4('0x1e')](function(_0x4ce708){_0x5ee9f9[_0x23d4('0x4f')]=_0x4ce708;return _0x5ee9f9;})['then'](respondWithFilteredResult(_0x3af74f,_0xd97fa1))[_0x23d4('0x28')](handleError(_0x3af74f,null));};exports[_0x23d4('0x50')]=function(_0x58cbbd,_0x4ec38d){var _0x2584e2={'raw':!![],'where':{'id':_0x58cbbd['params']['id']}},_0x198a15={};_0x198a15[_0x23d4('0x3c')]=_[_0x23d4('0x51')](db[_0x23d4('0x3a')][_0x23d4('0x3b')]);_0x198a15['query']=_[_0x23d4('0x51')](_0x58cbbd[_0x23d4('0x3d')]);_0x198a15['filters']=_['intersection'](_0x198a15[_0x23d4('0x3c')],_0x198a15[_0x23d4('0x3d')]);_0x2584e2[_0x23d4('0x40')]=_[_0x23d4('0x3f')](_0x198a15[_0x23d4('0x3c')],qs['fields'](_0x58cbbd[_0x23d4('0x3d')][_0x23d4('0x41')]));_0x2584e2[_0x23d4('0x40')]=_0x2584e2[_0x23d4('0x40')][_0x23d4('0x42')]?_0x2584e2[_0x23d4('0x40')]:_0x198a15['model'];if(_0x58cbbd[_0x23d4('0x3d')]['includeAll']){_0x2584e2[_0x23d4('0x52')]=[{'all':!![]}];}_0x2584e2=_['merge']({},_0x2584e2,_0x58cbbd[_0x23d4('0x4d')]);return db['ChatMessage'][_0x23d4('0x53')](_0x2584e2)[_0x23d4('0x1e')](handleEntityNotFound(_0x4ec38d,null))[_0x23d4('0x1e')](respondWithResult(_0x4ec38d,null))['catch'](handleError(_0x4ec38d,null));};exports[_0x23d4('0x54')]=function(_0x540c95,_0x3f8c26){return db[_0x23d4('0x3a')][_0x23d4('0x54')](_0x540c95[_0x23d4('0x55')],{})[_0x23d4('0x1e')](respondWithResult(_0x3f8c26,0xc9))[_0x23d4('0x28')](handleError(_0x3f8c26,null));};exports[_0x23d4('0x56')]=function(_0x1bfc5c,_0x3ebec7){if(_0x1bfc5c[_0x23d4('0x55')]['id']){delete _0x1bfc5c[_0x23d4('0x55')]['id'];}return db[_0x23d4('0x3a')]['find']({'where':{'id':_0x1bfc5c[_0x23d4('0x57')]['id']}})[_0x23d4('0x1e')](handleEntityNotFound(_0x3ebec7,null))[_0x23d4('0x1e')](saveUpdates(_0x1bfc5c[_0x23d4('0x55')],null))['then'](respondWithResult(_0x3ebec7,null))[_0x23d4('0x28')](handleError(_0x3ebec7,null));};exports['destroy']=function(_0x3795c3,_0x4f1869){return db[_0x23d4('0x3a')][_0x23d4('0x53')]({'where':{'id':_0x3795c3[_0x23d4('0x57')]['id']}})[_0x23d4('0x1e')](handleEntityNotFound(_0x4f1869,null))[_0x23d4('0x1e')](removeEntity(_0x4f1869,null))[_0x23d4('0x28')](handleError(_0x4f1869,null));};exports[_0x23d4('0x58')]=function(_0x12361a,_0xd83a82){return db[_0x23d4('0x3a')][_0x23d4('0x58')]()[_0x23d4('0x1e')](respondWithResult(_0xd83a82,null))[_0x23d4('0x28')](handleError(_0xd83a82,null));};var interaction_log=require(_0x23d4('0x13'))(_0x23d4('0x59'));exports['accept']=function(_0x11caf6,_0xbe5bd7,_0xb3d137){var _0x32fbb3={'channel':_0x23d4('0x5a')};if(_0x11caf6['body']['id']){delete _0x11caf6[_0x23d4('0x55')]['id'];}_0x11caf6['body']['read']=!![];_0x11caf6[_0x23d4('0x55')][_0x23d4('0x5b')]=moment()[_0x23d4('0x5c')](_0x23d4('0x5d'));_0x11caf6['body'][_0x23d4('0x5e')]=_0x11caf6[_0x23d4('0x55')][_0x23d4('0x5e')]||_0x11caf6[_0x23d4('0x5f')]['id'];return db[_0x23d4('0x3a')][_0x23d4('0x53')]({'where':{'id':_0x11caf6['params']['id'],'UserId':null},'include':[{'model':db[_0x23d4('0x60')],'as':_0x23d4('0x61')}]})[_0x23d4('0x1e')](handleEntityNotFound(_0xbe5bd7,null))['then'](saveUpdates(_0x11caf6['body'],null))[_0x23d4('0x1e')](function(_0x47636f){if(_0x47636f){_0x32fbb3[_0x23d4('0x27')]=_0x47636f[_0x23d4('0x62')]({'plain':!![]});return db['ChatInteraction'][_0x23d4('0x53')]({'where':{'id':_0x47636f[_0x23d4('0x63')]}});}return null;})['then'](handleEntityNotFound(_0xbe5bd7,null))[_0x23d4('0x1e')](function(_0x2d3090){if(_0x2d3090){return _0x2d3090['update']({'UserId':_0x11caf6['body'][_0x23d4('0x5e')],'read1stAt':_[_0x23d4('0x64')](_0x2d3090[_0x23d4('0x65')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x23d4('0x1e')](function(_0x424202){if(_0x424202){_0x32fbb3[_0x23d4('0x66')]=_0x424202[_0x23d4('0x62')]({'plain':!![]});interaction_log[_0x23d4('0x1f')](_0x23d4('0x67'),_0x11caf6[_0x23d4('0x5f')]['id'],_0x11caf6[_0x23d4('0x5f')][_0x23d4('0x37')],_0x11caf6['user'][_0x23d4('0x68')],_0x32fbb3[_0x23d4('0x66')]['id'],_0x11caf6[_0x23d4('0x55')]?JSON[_0x23d4('0x23')](_0x11caf6['body']):_0x23d4('0x69'));return respondWithRpcPromise(_0x23d4('0x6a'),_0x23d4('0x6b'),_0x32fbb3);}return null;})['then'](function(_0x3106cf){if(_0x3106cf){if(_0x11caf6[_0x23d4('0x55')][_0x23d4('0x6c')]){_0x32fbb3[_0x23d4('0x27')][_0x23d4('0x6d')]=util[_0x23d4('0x5c')]('SIP/%s',_0x11caf6[_0x23d4('0x5f')][_0x23d4('0x37')]);_0x32fbb3[_0x23d4('0x27')]['channel']=_0x32fbb3['channel'];_0x32fbb3[_0x23d4('0x27')][_0x23d4('0x6e')]=_0x23d4('0x6f');return respondWithRpcPromise(_0x23d4('0x70'),_0x23d4('0x70'),{'event':'acceptmessage','message':_[_0x23d4('0x49')](_0x32fbb3[_0x23d4('0x27')],JSON[_0x23d4('0x71')](_0x32fbb3[_0x23d4('0x66')][_0x23d4('0x72')]))},client9002)[_0x23d4('0x1e')](function(){return _0x32fbb3;});}return _0x32fbb3;}return null;})[_0x23d4('0x1e')](respondWithResult(_0xbe5bd7,null))[_0x23d4('0x28')](handleError(_0xbe5bd7,null));};var interaction_log=require(_0x23d4('0x13'))(_0x23d4('0x59'));exports[_0x23d4('0x31')]=function(_0x4d988d,_0x4542ed,_0x5c6a9f){var _0x433eaa={'agent':{},'channel':_0x23d4('0x5a')};if(_0x4d988d['body']['id']){delete _0x4d988d['body']['id'];}_0x4d988d[_0x23d4('0x55')][_0x23d4('0x5e')]=_0x4d988d[_0x23d4('0x55')][_0x23d4('0x5e')]||_0x4d988d[_0x23d4('0x5f')]['id'];_0x433eaa[_0x23d4('0x73')]['id']=_0x4d988d[_0x23d4('0x55')][_0x23d4('0x5e')];return db[_0x23d4('0x3a')][_0x23d4('0x53')]({'where':{'id':_0x4d988d[_0x23d4('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4542ed,null))['then'](function(_0x2b768d){if(_0x2b768d){_0x433eaa[_0x23d4('0x27')]=_0x2b768d[_0x23d4('0x62')]({'plain':!![]});return db[_0x23d4('0x74')][_0x23d4('0x53')]({'where':{'id':_0x2b768d[_0x23d4('0x63')]}});}return null;})[_0x23d4('0x1e')](handleEntityNotFound(_0x4542ed,null))[_0x23d4('0x1e')](function(_0x32eaff){if(_0x32eaff){_0x433eaa[_0x23d4('0x66')]=_0x32eaff['get']({'plain':!![]});interaction_log[_0x23d4('0x1f')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d988d[_0x23d4('0x5f')]['id'],_0x4d988d[_0x23d4('0x5f')]['name'],_0x4d988d[_0x23d4('0x5f')][_0x23d4('0x68')],_0x433eaa[_0x23d4('0x66')]['id'],_0x4d988d[_0x23d4('0x55')]?JSON[_0x23d4('0x23')](_0x4d988d[_0x23d4('0x55')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x433eaa);}return null;})[_0x23d4('0x1e')](function(_0x47cad5){if(_0x47cad5){_0x47cad5['message'][_0x23d4('0x6d')]=util[_0x23d4('0x5c')](_0x23d4('0x75'),_0x4d988d[_0x23d4('0x5f')][_0x23d4('0x37')]);_0x47cad5['message']['channel']=_0x433eaa[_0x23d4('0x76')];_0x47cad5[_0x23d4('0x27')][_0x23d4('0x6e')]='reject';respondWithRpcPromise('EventManager',_0x23d4('0x70'),{'event':_0x23d4('0x77'),'message':_0x47cad5[_0x23d4('0x27')]},client9002);return _0x433eaa;}return null;})[_0x23d4('0x1e')](respondWithResult(_0x4542ed,null))[_0x23d4('0x28')](handleError(_0x4542ed,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 158fc99..792b302 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 _0x6250=['../../mysqldb','ChatMessage','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1356d5,_0x50edc2){var _0x24ad4c=function(_0x36929c){while(--_0x36929c){_0x1356d5['push'](_0x1356d5['shift']());}};_0x24ad4c(++_0x50edc2);}(_0x6250,0x85));var _0x0625=function(_0x74bd29,_0x42b0ee){_0x74bd29=_0x74bd29-0x0;var _0x3a593f=_0x6250[_0x74bd29];return _0x3a593f;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0625('0x0'))['db'][_0x0625('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0625('0x2')};function emitEvent(_0x501f85){return function(_0x2c4434,_0x345b5a,_0x1a6be8){ChatMessageEvents[_0x0625('0x3')](_0x501f85+':'+_0x2c4434['id'],_0x2c4434);ChatMessageEvents[_0x0625('0x3')](_0x501f85,_0x2c4434);_0x1a6be8(null);};}for(var e in events){if(events[_0x0625('0x4')](e)){var event=events[e];ChatMessage[_0x0625('0x5')](e,emitEvent(event));}}module[_0x0625('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x29e9=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x3bae06,_0x5d2766){var _0x3adbec=function(_0x2ee294){while(--_0x2ee294){_0x3bae06['push'](_0x3bae06['shift']());}};_0x3adbec(++_0x5d2766);}(_0x29e9,0xbb));var _0x929e=function(_0xcd45c4,_0x1de707){_0xcd45c4=_0xcd45c4-0x0;var _0x28675f=_0x29e9[_0xcd45c4];return _0x28675f;};'use strict';var EventEmitter=require(_0x929e('0x0'));var ChatMessage=require(_0x929e('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x929e('0x2'),'afterUpdate':_0x929e('0x3'),'afterDestroy':_0x929e('0x4')};function emitEvent(_0x3a1d9b){return function(_0x110aec,_0x182db6,_0x3657d5){ChatMessageEvents[_0x929e('0x5')](_0x3a1d9b+':'+_0x110aec['id'],_0x110aec);ChatMessageEvents[_0x929e('0x5')](_0x3a1d9b,_0x110aec);_0x3657d5(null);};}for(var e in events){if(events[_0x929e('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 3691b06..57d1cd0 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 _0xff6b=['createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','moment','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','body','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','then','update'];(function(_0x4c8b49,_0x22de7f){var _0x4877b7=function(_0x417fdc){while(--_0x417fdc){_0x4c8b49['push'](_0x4c8b49['shift']());}};_0x4877b7(++_0x22de7f);}(_0xff6b,0x1d8));var _0xbff6=function(_0x23bf21,_0x3fe881){_0x23bf21=_0x23bf21-0x0;var _0x359a1f=_0xff6b[_0x23bf21];return _0x359a1f;};'use strict';var _=require(_0xbff6('0x0'));var util=require(_0xbff6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbff6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbff6('0x3'));var rimraf=require(_0xbff6('0x4'));var config=require(_0xbff6('0x5'));var attributes=require('./chatMessage.attributes');module[_0xbff6('0x6')]=function(_0x100f47,_0x6f2ac6){return _0x100f47[_0xbff6('0x7')](_0xbff6('0x8'),attributes,{'tableName':_0xbff6('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xbff6('0xa')],'type':_0xbff6('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ace1c,_0x3b6888,_0xa56a5d){var _0x30c43e=_0x100f47['models'];var _0x3e0f27=_0x5ace1c[_0xbff6('0xc')]({'plain':!![]});if(_0x3e0f27['direction'][_0xbff6('0xd')]()==='in'||_0x3e0f27[_0xbff6('0xe')][_0xbff6('0xd')]()===_0xbff6('0xf')&&!_0x3e0f27[_0xbff6('0x10')]&&!_[_0xbff6('0x11')](_0x3e0f27[_0xbff6('0x12')])){_0x30c43e[_0xbff6('0x13')]['findOne']({'where':{'id':_0x3e0f27['ChatInteractionId']}})[_0xbff6('0x14')](function(_0x5c9dec){if(_0x5c9dec){_0x5c9dec[_0xbff6('0x15')]({'lastMsgAt':_0x3e0f27[_0xbff6('0x16')],'lastMsgDirection':_0x3e0f27[_0xbff6('0xe')]['toLowerCase']()});}})[_0xbff6('0x17')](function(_0x22c227){console[_0xbff6('0x18')](_0x22c227);});}_0xa56a5d();}},'charset':'utf8mb4','collate':_0xbff6('0x19')});};
\ No newline at end of file
+var _0x11bc=['findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x11bc,0x85));var _0xc11b=function(_0x5f1f0c,_0x38c97c){_0x5f1f0c=_0x5f1f0c-0x0;var _0x12ec32=_0x11bc[_0x5f1f0c];return _0x12ec32;};'use strict';var _=require(_0xc11b('0x0'));var util=require(_0xc11b('0x1'));var logger=require(_0xc11b('0x2'))(_0xc11b('0x3'));var moment=require(_0xc11b('0x4'));var BPromise=require('bluebird');var rp=require(_0xc11b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc11b('0x6'));var attributes=require(_0xc11b('0x7'));module[_0xc11b('0x8')]=function(_0xb7e5c7,_0x590d5c){return _0xb7e5c7['define'](_0xc11b('0x9'),attributes,{'tableName':_0xc11b('0xa'),'paranoid':![],'indexes':[{'name':_0xc11b('0xb'),'fields':['body'],'type':_0xc11b('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f899e,_0x4d39d9,_0x3dfb64){var _0x3ea62b=_0xb7e5c7[_0xc11b('0xd')];var _0x1a787e=_0x1f899e[_0xc11b('0xe')]({'plain':!![]});if(_0x1a787e['direction'][_0xc11b('0xf')]()==='in'||_0x1a787e[_0xc11b('0x10')][_0xc11b('0xf')]()===_0xc11b('0x11')&&!_0x1a787e[_0xc11b('0x12')]&&!_[_0xc11b('0x13')](_0x1a787e[_0xc11b('0x14')])){_0x3ea62b[_0xc11b('0x15')][_0xc11b('0x16')]({'where':{'id':_0x1a787e[_0xc11b('0x17')]}})[_0xc11b('0x18')](function(_0x1d7c8d){if(_0x1d7c8d){_0x1d7c8d[_0xc11b('0x19')]({'lastMsgAt':_0x1a787e[_0xc11b('0x1a')],'lastMsgDirection':_0x1a787e['direction'][_0xc11b('0xf')]()});}})[_0xc11b('0x1b')](function(_0x158ba8){console[_0xc11b('0x1c')](_0x158ba8);});}_0x3dfb64();}},'charset':_0xc11b('0x1d'),'collate':_0xc11b('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 4906ab3..139a2f7 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 _0xf5e6=['result','ChatMessage','create','body','options','raw','CreateChatMessage','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x5e03ca,_0x1f53ef){var _0x381f3e=function(_0x308d9b){while(--_0x308d9b){_0x5e03ca['push'](_0x5e03ca['shift']());}};_0x381f3e(++_0x1f53ef);}(_0xf5e6,0xb2));var _0x6f5e=function(_0x6435b7,_0x3c5389){_0x6435b7=_0x6435b7-0x0;var _0x41d294=_0xf5e6[_0x6435b7];return _0x41d294;};'use strict';var _=require('lodash');var util=require(_0x6f5e('0x0'));var moment=require(_0x6f5e('0x1'));var BPromise=require(_0x6f5e('0x2'));var rs=require(_0x6f5e('0x3'));var fs=require('fs');var Redis=require(_0x6f5e('0x4'));var db=require(_0x6f5e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f5e('0x6'))(_0x6f5e('0x7'));var config=require('../../config/environment');var jayson=require(_0x6f5e('0x8'));var client=jayson[_0x6f5e('0x9')][_0x6f5e('0xa')]({'port':0x232a});config['redis']=_[_0x6f5e('0xb')](config[_0x6f5e('0xc')],{'host':_0x6f5e('0xd'),'port':0x18eb});var socket=require(_0x6f5e('0xe'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x6f5e('0xf')](socket);function respondWithRpcPromise(_0x51746b,_0x12292d,_0x508555){return new BPromise(function(_0x560602,_0x5e92e0){return client[_0x6f5e('0x10')](_0x51746b,_0x508555)[_0x6f5e('0x11')](function(_0x45b60f){logger['info'](_0x6f5e('0x12'),_0x12292d,_0x6f5e('0x13'));logger[_0x6f5e('0x14')](_0x6f5e('0x15'),_0x12292d,_0x6f5e('0x13'),JSON['stringify'](_0x45b60f));if(_0x45b60f[_0x6f5e('0x16')]){if(_0x45b60f[_0x6f5e('0x16')][_0x6f5e('0x17')]===0x1f4){logger[_0x6f5e('0x16')]('ChatMessage,\x20%s,\x20%s',_0x12292d,_0x45b60f['error'][_0x6f5e('0x18')]);return _0x5e92e0(_0x45b60f[_0x6f5e('0x16')]['message']);}logger[_0x6f5e('0x16')](_0x6f5e('0x12'),_0x12292d,_0x45b60f['error'][_0x6f5e('0x18')]);return _0x560602(_0x45b60f[_0x6f5e('0x16')][_0x6f5e('0x18')]);}else{logger[_0x6f5e('0x19')]('ChatMessage,\x20%s,\x20%s',_0x12292d,_0x6f5e('0x13'));_0x560602(_0x45b60f[_0x6f5e('0x1a')][_0x6f5e('0x18')]);}})['catch'](function(_0x35a985){logger[_0x6f5e('0x16')]('ChatMessage,\x20%s,\x20%s',_0x12292d,_0x35a985);_0x5e92e0(_0x35a985);});});}exports['CreateChatMessage']=function(_0x3bb71e){var _0xa573cf=this;return new Promise(function(_0x761980,_0x5206e1){return db[_0x6f5e('0x1b')][_0x6f5e('0x1c')](_0x3bb71e[_0x6f5e('0x1d')],{'raw':_0x3bb71e[_0x6f5e('0x1e')]?_0x3bb71e[_0x6f5e('0x1e')][_0x6f5e('0x1f')]===undefined?!![]:![]:!![]})[_0x6f5e('0x11')](function(_0x3d9300){logger['info'](_0x6f5e('0x20'),_0x3bb71e);logger[_0x6f5e('0x14')](_0x6f5e('0x20'),_0x3bb71e,JSON['stringify'](_0x3d9300));_0x761980(_0x3d9300);})[_0x6f5e('0x21')](function(_0x5bee42){logger[_0x6f5e('0x16')](_0x6f5e('0x20'),_0x5bee42[_0x6f5e('0x18')],_0x3bb71e);_0x5206e1(_0xa573cf[_0x6f5e('0x16')](0x1f4,_0x5bee42[_0x6f5e('0x18')]));});});};
\ No newline at end of file
+var _0x0776=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','request\x20sent','result','CreateChatMessage','ChatMessage','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x4ae938,_0x22fce6){var _0x52ccbd=function(_0x18648d){while(--_0x18648d){_0x4ae938['push'](_0x4ae938['shift']());}};_0x52ccbd(++_0x22fce6);}(_0x0776,0x1dc));var _0x6077=function(_0x1452c6,_0x185732){_0x1452c6=_0x1452c6-0x0;var _0x424958=_0x0776[_0x1452c6];return _0x424958;};'use strict';var _=require(_0x6077('0x0'));var util=require(_0x6077('0x1'));var moment=require(_0x6077('0x2'));var BPromise=require(_0x6077('0x3'));var rs=require(_0x6077('0x4'));var fs=require('fs');var Redis=require(_0x6077('0x5'));var db=require(_0x6077('0x6'))['db'];var utils=require(_0x6077('0x7'));var logger=require(_0x6077('0x8'))(_0x6077('0x9'));var config=require('../../config/environment');var jayson=require(_0x6077('0xa'));var client=jayson[_0x6077('0xb')][_0x6077('0xc')]({'port':0x232a});config[_0x6077('0xd')]=_[_0x6077('0xe')](config[_0x6077('0xd')],{'host':_0x6077('0xf'),'port':0x18eb});var socket=require(_0x6077('0x10'))(new Redis(config[_0x6077('0xd')]));require('./chatMessage.socket')[_0x6077('0x11')](socket);function respondWithRpcPromise(_0x5028f8,_0x23a28b,_0x5d0477){return new BPromise(function(_0x1cd066,_0x51b35a){return client[_0x6077('0x12')](_0x5028f8,_0x5d0477)[_0x6077('0x13')](function(_0x315f87){logger[_0x6077('0x14')]('ChatMessage,\x20%s,\x20%s',_0x23a28b,'request\x20sent');logger['debug'](_0x6077('0x15'),_0x23a28b,'request\x20sent',JSON[_0x6077('0x16')](_0x315f87));if(_0x315f87[_0x6077('0x17')]){if(_0x315f87['error'][_0x6077('0x18')]===0x1f4){logger[_0x6077('0x17')](_0x6077('0x19'),_0x23a28b,_0x315f87[_0x6077('0x17')][_0x6077('0x1a')]);return _0x51b35a(_0x315f87[_0x6077('0x17')][_0x6077('0x1a')]);}logger[_0x6077('0x17')](_0x6077('0x19'),_0x23a28b,_0x315f87[_0x6077('0x17')]['message']);return _0x1cd066(_0x315f87['error'][_0x6077('0x1a')]);}else{logger[_0x6077('0x14')](_0x6077('0x19'),_0x23a28b,_0x6077('0x1b'));_0x1cd066(_0x315f87[_0x6077('0x1c')]['message']);}})['catch'](function(_0x202fd8){logger['error'](_0x6077('0x19'),_0x23a28b,_0x202fd8);_0x51b35a(_0x202fd8);});});}exports[_0x6077('0x1d')]=function(_0x17eeb0){var _0x18edf5=this;return new Promise(function(_0x3ef43b,_0x5af86d){return db[_0x6077('0x1e')][_0x6077('0x1f')](_0x17eeb0[_0x6077('0x20')],{'raw':_0x17eeb0['options']?_0x17eeb0[_0x6077('0x21')][_0x6077('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x541be7){logger[_0x6077('0x14')](_0x6077('0x1d'),_0x17eeb0);logger[_0x6077('0x23')](_0x6077('0x1d'),_0x17eeb0,JSON[_0x6077('0x16')](_0x541be7));_0x3ef43b(_0x541be7);})[_0x6077('0x24')](function(_0x1f01e8){logger[_0x6077('0x17')](_0x6077('0x1d'),_0x1f01e8['message'],_0x17eeb0);_0x5af86d(_0x18edf5[_0x6077('0x17')](0x1f4,_0x1f01e8[_0x6077('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index d2d0249..1d6011b 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 _0x55ca=['removeListener','register','./chatMessage.events','save'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x55ca,0x126));var _0xa55c=function(_0x6d0c3e,_0xbc2aed){_0x6d0c3e=_0x6d0c3e-0x0;var _0x2895ce=_0x55ca[_0x6d0c3e];return _0x2895ce;};'use strict';var ChatMessageEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){ChatMessageEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('chatMessage:'+_0x2121fd,_0x3c97c8);ChatMessageEvents['on'](_0x2121fd,_0x2537f0);}};
\ No newline at end of file
+var _0x9957=['register','length','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0x1e1020,_0xd64a27){var _0x464719=function(_0x376ffa){while(--_0x376ffa){_0x1e1020['push'](_0x1e1020['shift']());}};_0x464719(++_0xd64a27);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var ChatMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){ChatMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);ChatMessageEvents['on'](_0x4996ca,_0x465276);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ab542c2..b52db3d 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 _0xb679=['put','/:id','/:id/accept','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','show','post','chat','chatmessage:create'];(function(_0x17b9af,_0x23f168){var _0x4c6041=function(_0xc8c897){while(--_0xc8c897){_0x17b9af['push'](_0x17b9af['shift']());}};_0x4c6041(++_0x23f168);}(_0xb679,0x127));var _0x9b67=function(_0x19411d,_0x1e7337){_0x19411d=_0x19411d-0x0;var _0x20f014=_0xb679[_0x19411d];return _0x20f014;};'use strict';var multer=require(_0x9b67('0x0'));var util=require(_0x9b67('0x1'));var path=require(_0x9b67('0x2'));var timeout=require(_0x9b67('0x3'));var express=require(_0x9b67('0x4'));var router=express[_0x9b67('0x5')]();var auth=require(_0x9b67('0x6'));var interaction=require(_0x9b67('0x7'));var config=require(_0x9b67('0x8'));var controller=require('./chatMessage.controller');router[_0x9b67('0x9')]('/',auth['isAuthenticated'](),controller[_0x9b67('0xa')]);router[_0x9b67('0x9')]('/describe',auth[_0x9b67('0xb')](),controller[_0x9b67('0xc')]);router[_0x9b67('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9b67('0xd')]);router[_0x9b67('0xe')]('/',auth[_0x9b67('0xb')](),interaction['tracked'](_0x9b67('0xf'),_0x9b67('0x10')),controller['create']);router[_0x9b67('0x11')](_0x9b67('0x12'),controller['update']);router['put'](_0x9b67('0x13'),auth[_0x9b67('0xb')](),controller[_0x9b67('0x14')]);router[_0x9b67('0x11')](_0x9b67('0x15'),auth[_0x9b67('0xb')](),controller[_0x9b67('0x16')]);router['delete'](_0x9b67('0x12'),auth[_0x9b67('0xb')](),controller[_0x9b67('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x6627=['show','tracked','chat','chatmessage:create','create','put','update','/:id/accept','reject','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x255428,_0x3fe117){var _0x574f5c=function(_0x334221){while(--_0x334221){_0x255428['push'](_0x255428['shift']());}};_0x574f5c(++_0x3fe117);}(_0x6627,0xa1));var _0x7662=function(_0x59d957,_0x5dc0cb){_0x59d957=_0x59d957-0x0;var _0x406bdf=_0x6627[_0x59d957];return _0x406bdf;};'use strict';var multer=require(_0x7662('0x0'));var util=require(_0x7662('0x1'));var path=require('path');var timeout=require(_0x7662('0x2'));var express=require(_0x7662('0x3'));var router=express[_0x7662('0x4')]();var auth=require(_0x7662('0x5'));var interaction=require(_0x7662('0x6'));var config=require('../../config/environment');var controller=require(_0x7662('0x7'));router[_0x7662('0x8')]('/',auth['isAuthenticated'](),controller[_0x7662('0x9')]);router[_0x7662('0x8')](_0x7662('0xa'),auth[_0x7662('0xb')](),controller[_0x7662('0xc')]);router[_0x7662('0x8')](_0x7662('0xd'),auth[_0x7662('0xb')](),controller[_0x7662('0xe')]);router['post']('/',auth[_0x7662('0xb')](),interaction[_0x7662('0xf')](_0x7662('0x10'),_0x7662('0x11')),controller[_0x7662('0x12')]);router[_0x7662('0x13')](_0x7662('0xd'),controller[_0x7662('0x14')]);router['put'](_0x7662('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0x7662('0x13')]('/:id/reject',auth[_0x7662('0xb')](),controller[_0x7662('0x16')]);router['delete'](_0x7662('0xd'),auth['isAuthenticated'](),controller[_0x7662('0x17')]);module[_0x7662('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 8b91f34..fd6b7d8 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 _0x1cda=['TEXT','sequelize','exports'];(function(_0x3c5ad6,_0x47b7bf){var _0x3154f2=function(_0x3a24de){while(--_0x3a24de){_0x3c5ad6['push'](_0x3c5ad6['shift']());}};_0x3154f2(++_0x47b7bf);}(_0x1cda,0x91));var _0xa1cd=function(_0x1854d4,_0x12d839){_0x1854d4=_0x1854d4-0x0;var _0x34deb8=_0x1cda[_0x1854d4];return _0x34deb8;};'use strict';var Sequelize=require(_0xa1cd('0x0'));module[_0xa1cd('0x1')]={'body':{'type':Sequelize[_0xa1cd('0x2')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x0f67=['medium','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f67,0xab));var _0x70f6=function(_0x4ec13d,_0x358a8f){_0x4ec13d=_0x4ec13d-0x0;var _0x3c3fa7=_0x0f67[_0x4ec13d];return _0x3c3fa7;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x70f6('0x0')](_0x70f6('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index cb28c0e..4b56367 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 _0xda20=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','update','destroy','then','error','stack','name','send','index','ChatOfflineMessage','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','map','VIRTUAL','field','options','includeAll','include','show','params','find','create','body','catch','describe','html-pdf','rimraf','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel'];(function(_0x272f43,_0x5840b5){var _0x32ea41=function(_0x5819f8){while(--_0x5819f8){_0x272f43['push'](_0x272f43['shift']());}};_0x32ea41(++_0x5840b5);}(_0xda20,0x1d9));var _0x0da2=function(_0x1107c0,_0x59e0ce){_0x1107c0=_0x1107c0-0x0;var _0x2da441=_0xda20[_0x1107c0];return _0x2da441;};'use strict';var pdf=require(_0x0da2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0da2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0da2('0x2'));var moment=require('moment');var BPromise=require(_0x0da2('0x3'));var Mustache=require(_0x0da2('0x4'));var util=require('util');var path=require(_0x0da2('0x5'));var sox=require(_0x0da2('0x6'));var csv=require('to-csv');var ejs=require(_0x0da2('0x7'));var fs=require('fs');var _=require(_0x0da2('0x8'));var squel=require(_0x0da2('0x9'));var crypto=require(_0x0da2('0xa'));var jsforce=require(_0x0da2('0xb'));var deskjs=require(_0x0da2('0xc'));var toCsv=require(_0x0da2('0xd'));var querystring=require(_0x0da2('0xe'));var Papa=require(_0x0da2('0xf'));var Redis=require('ioredis');var authService=require(_0x0da2('0x10'));var qs=require(_0x0da2('0x11'));var hardwareService=require(_0x0da2('0x12'));var logger=require(_0x0da2('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x0da2('0x14'));var db=require(_0x0da2('0x15'))['db'];function respondWithStatusCode(_0x8d21d1,_0x3e50d5){_0x3e50d5=_0x3e50d5||0xcc;return function(_0x19226a){if(_0x19226a){return _0x8d21d1[_0x0da2('0x16')](_0x3e50d5);}return _0x8d21d1[_0x0da2('0x17')](_0x3e50d5)['end']();};}function respondWithResult(_0x7dfc07,_0x570d68){_0x570d68=_0x570d68||0xc8;return function(_0x5496f5){if(_0x5496f5){return _0x7dfc07['status'](_0x570d68)[_0x0da2('0x18')](_0x5496f5);}};}function respondWithFilteredResult(_0x51bb68,_0x1e1e47){return function(_0x4cae2e){if(_0x4cae2e){var _0x5d0f4e=_0x4cae2e[_0x0da2('0x19')],_0xa0613c=_0x1e1e47[_0x0da2('0x1a')],_0x65f77=_0x1e1e47[_0x0da2('0x1a')]+_0x1e1e47['limit'],_0x52c310;if(_0x65f77>=_0x5d0f4e){_0x65f77=_0x5d0f4e;_0x52c310=0xc8;}else{_0x52c310=0xce;}_0x51bb68[_0x0da2('0x17')](_0x52c310);return _0x51bb68[_0x0da2('0x1b')]('Content-Range',_0xa0613c+'-'+_0x65f77+'/'+_0x5d0f4e)['json'](_0x4cae2e);}return null;};}function patchUpdates(_0x2e0f4e){return function(_0x500bf4){try{jsonpatch[_0x0da2('0x1c')](_0x500bf4,_0x2e0f4e,!![]);}catch(_0x569834){return BPromise['reject'](_0x569834);}return _0x500bf4['save']();};}function saveUpdates(_0x5cf40a,_0x109645){return function(_0x1d685c){if(_0x1d685c){return _0x1d685c[_0x0da2('0x1d')](_0x5cf40a)['then'](function(_0x5304af){return _0x5304af;});}return null;};}function removeEntity(_0x52367c,_0x1f22fe){return function(_0x2ce4c4){if(_0x2ce4c4){return _0x2ce4c4[_0x0da2('0x1e')]()[_0x0da2('0x1f')](function(){_0x52367c[_0x0da2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7a3708,_0x113c40){return function(_0x1c3ab0){if(!_0x1c3ab0){_0x7a3708[_0x0da2('0x16')](0x194);}return _0x1c3ab0;};}function handleError(_0x336c76,_0x333835){_0x333835=_0x333835||0x1f4;return function(_0x3ae5a0){logger[_0x0da2('0x20')](_0x3ae5a0[_0x0da2('0x21')]);if(_0x3ae5a0['name']){delete _0x3ae5a0[_0x0da2('0x22')];}_0x336c76['status'](_0x333835)[_0x0da2('0x23')](_0x3ae5a0);};}exports[_0x0da2('0x24')]=function(_0x2aa651,_0x3c0fb0){var _0x4b9333={},_0x1e9ac4={},_0x2a931d={'count':0x0,'rows':[]};var _0x2ea8c2=db[_0x0da2('0x25')][_0x0da2('0x26')];_0x1e9ac4['model']=_[_0x0da2('0x27')](_0x2ea8c2);_0x1e9ac4['query']=_[_0x0da2('0x27')](_0x2aa651[_0x0da2('0x28')]);_0x1e9ac4[_0x0da2('0x29')]=_[_0x0da2('0x2a')](_0x1e9ac4[_0x0da2('0x2b')],_0x1e9ac4[_0x0da2('0x28')]);_0x4b9333[_0x0da2('0x2c')]=_[_0x0da2('0x2a')](_0x1e9ac4[_0x0da2('0x2b')],qs[_0x0da2('0x2d')](_0x2aa651[_0x0da2('0x28')]['fields']));_0x4b9333['attributes']=_0x4b9333['attributes'][_0x0da2('0x2e')]?_0x4b9333[_0x0da2('0x2c')]:_0x1e9ac4['model'];if(!_0x2aa651['query'][_0x0da2('0x2f')](_0x0da2('0x30'))){_0x4b9333[_0x0da2('0x31')]=qs[_0x0da2('0x31')](_0x2aa651['query'][_0x0da2('0x31')]);_0x4b9333['offset']=qs[_0x0da2('0x1a')](_0x2aa651[_0x0da2('0x28')][_0x0da2('0x1a')]);}_0x4b9333[_0x0da2('0x32')]=qs[_0x0da2('0x33')](_0x2aa651[_0x0da2('0x28')][_0x0da2('0x33')]);_0x4b9333['where']=qs[_0x0da2('0x29')](_[_0x0da2('0x34')](_0x2aa651[_0x0da2('0x28')],_0x1e9ac4[_0x0da2('0x29')]));if(_0x2aa651[_0x0da2('0x28')][_0x0da2('0x35')]){_0x4b9333['where']=_[_0x0da2('0x36')](_0x4b9333[_0x0da2('0x37')],{'$or':_[_0x0da2('0x38')](_0x2ea8c2,function(_0x21caef){if(_0x21caef['type']['key']!==_0x0da2('0x39')){var _0x317e09={};_0x317e09[_0x21caef[_0x0da2('0x3a')]]={'$like':'%'+_0x2aa651[_0x0da2('0x28')][_0x0da2('0x35')]+'%'};return _0x317e09;}})});}_0x4b9333=_[_0x0da2('0x36')]({},_0x4b9333,_0x2aa651[_0x0da2('0x3b')]);var _0x306704={'where':_0x4b9333[_0x0da2('0x37')]};return db['ChatOfflineMessage'][_0x0da2('0x19')](_0x306704)[_0x0da2('0x1f')](function(_0x3b7959){_0x2a931d[_0x0da2('0x19')]=_0x3b7959;if(_0x2aa651[_0x0da2('0x28')][_0x0da2('0x3c')]){_0x4b9333[_0x0da2('0x3d')]=[{'all':!![]}];}return db[_0x0da2('0x25')]['findAll'](_0x4b9333);})[_0x0da2('0x1f')](function(_0x528907){_0x2a931d['rows']=_0x528907;return _0x2a931d;})[_0x0da2('0x1f')](respondWithFilteredResult(_0x3c0fb0,_0x4b9333))['catch'](handleError(_0x3c0fb0,null));};exports[_0x0da2('0x3e')]=function(_0xe16564,_0x365075){var _0x1b8d43={'raw':!![],'where':{'id':_0xe16564[_0x0da2('0x3f')]['id']}},_0x5eb2e9={};_0x5eb2e9[_0x0da2('0x2b')]=_[_0x0da2('0x27')](db[_0x0da2('0x25')][_0x0da2('0x26')]);_0x5eb2e9[_0x0da2('0x28')]=_[_0x0da2('0x27')](_0xe16564[_0x0da2('0x28')]);_0x5eb2e9['filters']=_['intersection'](_0x5eb2e9[_0x0da2('0x2b')],_0x5eb2e9['query']);_0x1b8d43[_0x0da2('0x2c')]=_['intersection'](_0x5eb2e9[_0x0da2('0x2b')],qs['fields'](_0xe16564['query']['fields']));_0x1b8d43[_0x0da2('0x2c')]=_0x1b8d43[_0x0da2('0x2c')][_0x0da2('0x2e')]?_0x1b8d43[_0x0da2('0x2c')]:_0x5eb2e9['model'];if(_0xe16564[_0x0da2('0x28')]['includeAll']){_0x1b8d43[_0x0da2('0x3d')]=[{'all':!![]}];}_0x1b8d43=_[_0x0da2('0x36')]({},_0x1b8d43,_0xe16564['options']);return db[_0x0da2('0x25')][_0x0da2('0x40')](_0x1b8d43)[_0x0da2('0x1f')](handleEntityNotFound(_0x365075,null))[_0x0da2('0x1f')](respondWithResult(_0x365075,null))['catch'](handleError(_0x365075,null));};exports[_0x0da2('0x41')]=function(_0x3b0e28,_0x4c2111){return db[_0x0da2('0x25')][_0x0da2('0x41')](_0x3b0e28[_0x0da2('0x42')],{})[_0x0da2('0x1f')](respondWithResult(_0x4c2111,0xc9))['catch'](handleError(_0x4c2111,null));};exports[_0x0da2('0x1d')]=function(_0x5265f2,_0x17ec3f){if(_0x5265f2[_0x0da2('0x42')]['id']){delete _0x5265f2[_0x0da2('0x42')]['id'];}return db[_0x0da2('0x25')][_0x0da2('0x40')]({'where':{'id':_0x5265f2['params']['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x17ec3f,null))[_0x0da2('0x1f')](saveUpdates(_0x5265f2[_0x0da2('0x42')],null))[_0x0da2('0x1f')](respondWithResult(_0x17ec3f,null))['catch'](handleError(_0x17ec3f,null));};exports[_0x0da2('0x1e')]=function(_0x2b50b7,_0x2c9172){return db[_0x0da2('0x25')][_0x0da2('0x40')]({'where':{'id':_0x2b50b7['params']['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x2c9172,null))[_0x0da2('0x1f')](removeEntity(_0x2c9172,null))[_0x0da2('0x43')](handleError(_0x2c9172,null));};exports[_0x0da2('0x44')]=function(_0x11d253,_0x2cf49d){return db[_0x0da2('0x25')]['describe']()[_0x0da2('0x1f')](respondWithResult(_0x2cf49d,null))['catch'](handleError(_0x2cf49d,null));};
\ No newline at end of file
+var _0xb5fb=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','Content-Range','json','apply','reject','update','then','sendStatus','stack','name','send','index','ChatOfflineMessage','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','count','include','findAll','catch','show','includeAll','options','find','create','body','params','destroy','describe'];(function(_0x1dd5b4,_0x357403){var _0x26554c=function(_0x39ced2){while(--_0x39ced2){_0x1dd5b4['push'](_0x1dd5b4['shift']());}};_0x26554c(++_0x357403);}(_0xb5fb,0x172));var _0xbb5f=function(_0x4070fe,_0x4f253b){_0x4070fe=_0x4070fe-0x0;var _0x430c8b=_0xb5fb[_0x4070fe];return _0x430c8b;};'use strict';var pdf=require(_0xbb5f('0x0'));var emlformat=require(_0xbb5f('0x1'));var rimraf=require(_0xbb5f('0x2'));var zipdir=require(_0xbb5f('0x3'));var jsonpatch=require(_0xbb5f('0x4'));var rp=require(_0xbb5f('0x5'));var moment=require(_0xbb5f('0x6'));var BPromise=require(_0xbb5f('0x7'));var Mustache=require(_0xbb5f('0x8'));var util=require(_0xbb5f('0x9'));var path=require(_0xbb5f('0xa'));var sox=require(_0xbb5f('0xb'));var csv=require(_0xbb5f('0xc'));var ejs=require(_0xbb5f('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbb5f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbb5f('0xf'));var toCsv=require(_0xbb5f('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbb5f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb5f('0x11'));var hardwareService=require(_0xbb5f('0x12'));var logger=require(_0xbb5f('0x13'))(_0xbb5f('0x14'));var utils=require(_0xbb5f('0x15'));var config=require(_0xbb5f('0x16'));var db=require(_0xbb5f('0x17'))['db'];function respondWithStatusCode(_0x1c4cb3,_0x5b1ebb){_0x5b1ebb=_0x5b1ebb||0xcc;return function(_0xb6c375){if(_0xb6c375){return _0x1c4cb3['sendStatus'](_0x5b1ebb);}return _0x1c4cb3[_0xbb5f('0x18')](_0x5b1ebb)[_0xbb5f('0x19')]();};}function respondWithResult(_0x245c72,_0x55eca2){_0x55eca2=_0x55eca2||0xc8;return function(_0x4315ba){if(_0x4315ba){return _0x245c72[_0xbb5f('0x18')](_0x55eca2)['json'](_0x4315ba);}};}function respondWithFilteredResult(_0x1159af,_0x2c8873){return function(_0x3078a8){if(_0x3078a8){var _0x4085a1=_0x3078a8['count'],_0x59d9e0=_0x2c8873[_0xbb5f('0x1a')],_0x5cf99d=_0x2c8873[_0xbb5f('0x1a')]+_0x2c8873['limit'],_0x2de1a1;if(_0x5cf99d>=_0x4085a1){_0x5cf99d=_0x4085a1;_0x2de1a1=0xc8;}else{_0x2de1a1=0xce;}_0x1159af[_0xbb5f('0x18')](_0x2de1a1);return _0x1159af['set'](_0xbb5f('0x1b'),_0x59d9e0+'-'+_0x5cf99d+'/'+_0x4085a1)[_0xbb5f('0x1c')](_0x3078a8);}return null;};}function patchUpdates(_0x5944f9){return function(_0x58a688){try{jsonpatch[_0xbb5f('0x1d')](_0x58a688,_0x5944f9,!![]);}catch(_0x82ce7e){return BPromise[_0xbb5f('0x1e')](_0x82ce7e);}return _0x58a688['save']();};}function saveUpdates(_0x2a029d,_0x52ad9e){return function(_0x7ebb8e){if(_0x7ebb8e){return _0x7ebb8e[_0xbb5f('0x1f')](_0x2a029d)[_0xbb5f('0x20')](function(_0x5533c3){return _0x5533c3;});}return null;};}function removeEntity(_0x3aef76,_0x583110){return function(_0x2127d7){if(_0x2127d7){return _0x2127d7['destroy']()[_0xbb5f('0x20')](function(){_0x3aef76['status'](0xcc)[_0xbb5f('0x19')]();});}};}function handleEntityNotFound(_0x488886,_0x3f5f92){return function(_0xb35efe){if(!_0xb35efe){_0x488886[_0xbb5f('0x21')](0x194);}return _0xb35efe;};}function handleError(_0x4d7233,_0x15ad76){_0x15ad76=_0x15ad76||0x1f4;return function(_0x4de835){logger['error'](_0x4de835[_0xbb5f('0x22')]);if(_0x4de835[_0xbb5f('0x23')]){delete _0x4de835[_0xbb5f('0x23')];}_0x4d7233[_0xbb5f('0x18')](_0x15ad76)[_0xbb5f('0x24')](_0x4de835);};}exports[_0xbb5f('0x25')]=function(_0x150e10,_0x4767b8){var _0x16f5bc={},_0x229757={},_0xa87ebb={'count':0x0,'rows':[]};var _0x3277fc=db[_0xbb5f('0x26')][_0xbb5f('0x27')];_0x229757[_0xbb5f('0x28')]=_[_0xbb5f('0x29')](_0x3277fc);_0x229757['query']=_['keys'](_0x150e10[_0xbb5f('0x2a')]);_0x229757[_0xbb5f('0x2b')]=_['intersection'](_0x229757[_0xbb5f('0x28')],_0x229757['query']);_0x16f5bc[_0xbb5f('0x2c')]=_[_0xbb5f('0x2d')](_0x229757[_0xbb5f('0x28')],qs[_0xbb5f('0x2e')](_0x150e10[_0xbb5f('0x2a')][_0xbb5f('0x2e')]));_0x16f5bc['attributes']=_0x16f5bc[_0xbb5f('0x2c')][_0xbb5f('0x2f')]?_0x16f5bc[_0xbb5f('0x2c')]:_0x229757[_0xbb5f('0x28')];if(!_0x150e10[_0xbb5f('0x2a')][_0xbb5f('0x30')](_0xbb5f('0x31'))){_0x16f5bc[_0xbb5f('0x32')]=qs[_0xbb5f('0x32')](_0x150e10[_0xbb5f('0x2a')][_0xbb5f('0x32')]);_0x16f5bc[_0xbb5f('0x1a')]=qs['offset'](_0x150e10[_0xbb5f('0x2a')][_0xbb5f('0x1a')]);}_0x16f5bc['order']=qs[_0xbb5f('0x33')](_0x150e10['query'][_0xbb5f('0x33')]);_0x16f5bc['where']=qs['filters'](_[_0xbb5f('0x34')](_0x150e10[_0xbb5f('0x2a')],_0x229757[_0xbb5f('0x2b')]));if(_0x150e10[_0xbb5f('0x2a')][_0xbb5f('0x35')]){_0x16f5bc[_0xbb5f('0x36')]=_[_0xbb5f('0x37')](_0x16f5bc[_0xbb5f('0x36')],{'$or':_[_0xbb5f('0x38')](_0x3277fc,function(_0x327f05){if(_0x327f05[_0xbb5f('0x39')][_0xbb5f('0x3a')]!==_0xbb5f('0x3b')){var _0x51b693={};_0x51b693[_0x327f05[_0xbb5f('0x3c')]]={'$like':'%'+_0x150e10[_0xbb5f('0x2a')][_0xbb5f('0x35')]+'%'};return _0x51b693;}})});}_0x16f5bc=_[_0xbb5f('0x37')]({},_0x16f5bc,_0x150e10['options']);var _0x365f5d={'where':_0x16f5bc['where']};return db[_0xbb5f('0x26')][_0xbb5f('0x3d')](_0x365f5d)[_0xbb5f('0x20')](function(_0x402159){_0xa87ebb[_0xbb5f('0x3d')]=_0x402159;if(_0x150e10[_0xbb5f('0x2a')]['includeAll']){_0x16f5bc[_0xbb5f('0x3e')]=[{'all':!![]}];}return db[_0xbb5f('0x26')][_0xbb5f('0x3f')](_0x16f5bc);})[_0xbb5f('0x20')](function(_0x58ee73){_0xa87ebb['rows']=_0x58ee73;return _0xa87ebb;})['then'](respondWithFilteredResult(_0x4767b8,_0x16f5bc))[_0xbb5f('0x40')](handleError(_0x4767b8,null));};exports[_0xbb5f('0x41')]=function(_0x96820e,_0x48e960){var _0x2c10d0={'raw':!![],'where':{'id':_0x96820e['params']['id']}},_0x408c84={};_0x408c84[_0xbb5f('0x28')]=_[_0xbb5f('0x29')](db['ChatOfflineMessage'][_0xbb5f('0x27')]);_0x408c84[_0xbb5f('0x2a')]=_[_0xbb5f('0x29')](_0x96820e[_0xbb5f('0x2a')]);_0x408c84[_0xbb5f('0x2b')]=_[_0xbb5f('0x2d')](_0x408c84[_0xbb5f('0x28')],_0x408c84[_0xbb5f('0x2a')]);_0x2c10d0['attributes']=_[_0xbb5f('0x2d')](_0x408c84[_0xbb5f('0x28')],qs[_0xbb5f('0x2e')](_0x96820e[_0xbb5f('0x2a')]['fields']));_0x2c10d0[_0xbb5f('0x2c')]=_0x2c10d0['attributes'][_0xbb5f('0x2f')]?_0x2c10d0['attributes']:_0x408c84[_0xbb5f('0x28')];if(_0x96820e[_0xbb5f('0x2a')][_0xbb5f('0x42')]){_0x2c10d0[_0xbb5f('0x3e')]=[{'all':!![]}];}_0x2c10d0=_[_0xbb5f('0x37')]({},_0x2c10d0,_0x96820e[_0xbb5f('0x43')]);return db['ChatOfflineMessage'][_0xbb5f('0x44')](_0x2c10d0)[_0xbb5f('0x20')](handleEntityNotFound(_0x48e960,null))['then'](respondWithResult(_0x48e960,null))['catch'](handleError(_0x48e960,null));};exports[_0xbb5f('0x45')]=function(_0x24c284,_0x4d87cd){return db[_0xbb5f('0x26')][_0xbb5f('0x45')](_0x24c284[_0xbb5f('0x46')],{})['then'](respondWithResult(_0x4d87cd,0xc9))[_0xbb5f('0x40')](handleError(_0x4d87cd,null));};exports[_0xbb5f('0x1f')]=function(_0x2446a0,_0x5d6301){if(_0x2446a0['body']['id']){delete _0x2446a0[_0xbb5f('0x46')]['id'];}return db[_0xbb5f('0x26')][_0xbb5f('0x44')]({'where':{'id':_0x2446a0[_0xbb5f('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d6301,null))['then'](saveUpdates(_0x2446a0[_0xbb5f('0x46')],null))[_0xbb5f('0x20')](respondWithResult(_0x5d6301,null))['catch'](handleError(_0x5d6301,null));};exports[_0xbb5f('0x48')]=function(_0x3f1fe6,_0x5a21cc){return db[_0xbb5f('0x26')][_0xbb5f('0x44')]({'where':{'id':_0x3f1fe6['params']['id']}})[_0xbb5f('0x20')](handleEntityNotFound(_0x5a21cc,null))[_0xbb5f('0x20')](removeEntity(_0x5a21cc,null))['catch'](handleError(_0x5a21cc,null));};exports['describe']=function(_0x331f25,_0x3b8ed5){return db['ChatOfflineMessage'][_0xbb5f('0x49')]()[_0xbb5f('0x20')](respondWithResult(_0x3b8ed5,null))[_0xbb5f('0x40')](handleError(_0x3b8ed5,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 671f75f..f56a923 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 _0x5baf=['util','api','bluebird','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4_unicode_ci','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5baf,0xba));var _0xf5ba=function(_0x1291bd,_0x1f4c5c){_0x1291bd=_0x1291bd-0x0;var _0x1c1515=_0x5baf[_0x1291bd];return _0x1c1515;};'use strict';var _=require(_0xf5ba('0x0'));var util=require(_0xf5ba('0x1'));var logger=require('../../config/logger')(_0xf5ba('0x2'));var moment=require('moment');var BPromise=require(_0xf5ba('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5ba('0x4'));var rimraf=require('rimraf');var config=require(_0xf5ba('0x5'));var attributes=require(_0xf5ba('0x6'));module[_0xf5ba('0x7')]=function(_0x2f943c,_0xf2dda){return _0x2f943c[_0xf5ba('0x8')](_0xf5ba('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf5ba('0xa')});};
\ No newline at end of file
+var _0x5b37=['bluebird','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0xaaf6b5,_0x3f1ba3){var _0x45cdf4=function(_0x4dd4bc){while(--_0x4dd4bc){_0xaaf6b5['push'](_0xaaf6b5['shift']());}};_0x45cdf4(++_0x3f1ba3);}(_0x5b37,0x106));var _0x75b3=function(_0x6148ee,_0x4d2fca){_0x6148ee=_0x6148ee-0x0;var _0x5afc74=_0x5b37[_0x6148ee];return _0x5afc74;};'use strict';var _=require(_0x75b3('0x0'));var util=require(_0x75b3('0x1'));var logger=require(_0x75b3('0x2'))('api');var moment=require(_0x75b3('0x3'));var BPromise=require(_0x75b3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75b3('0x5'));var rimraf=require('rimraf');var config=require(_0x75b3('0x6'));var attributes=require(_0x75b3('0x7'));module[_0x75b3('0x8')]=function(_0x5014b4,_0x449bde){return _0x5014b4[_0x75b3('0x9')](_0x75b3('0xa'),attributes,{'tableName':_0x75b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x75b3('0xc'),'collate':_0x75b3('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 6409cd9..d7d214b 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 _0xf3d7=['request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x5de818,_0x7c4485){var _0x345670=function(_0x5e268d){while(--_0x5e268d){_0x5de818['push'](_0x5de818['shift']());}};_0x345670(++_0x7c4485);}(_0xf3d7,0x145));var _0x7f3d=function(_0x50d086,_0x4e96e0){_0x50d086=_0x50d086-0x0;var _0x2e9e27=_0xf3d7[_0x50d086];return _0x2e9e27;};'use strict';var _=require(_0x7f3d('0x0'));var util=require(_0x7f3d('0x1'));var moment=require(_0x7f3d('0x2'));var BPromise=require(_0x7f3d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f3d('0x4'));var db=require(_0x7f3d('0x5'))['db'];var utils=require(_0x7f3d('0x6'));var logger=require(_0x7f3d('0x7'))(_0x7f3d('0x8'));var config=require(_0x7f3d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7f3d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x371b30,_0x588d55,_0x199658){return new BPromise(function(_0x373fa9,_0x5260b1){return client[_0x7f3d('0xb')](_0x371b30,_0x199658)[_0x7f3d('0xc')](function(_0x4e6813){logger[_0x7f3d('0xd')](_0x7f3d('0xe'),_0x588d55,_0x7f3d('0xf'));logger[_0x7f3d('0x10')](_0x7f3d('0x11'),_0x588d55,_0x7f3d('0xf'),JSON[_0x7f3d('0x12')](_0x4e6813));if(_0x4e6813['error']){if(_0x4e6813[_0x7f3d('0x13')][_0x7f3d('0x14')]===0x1f4){logger[_0x7f3d('0x13')](_0x7f3d('0xe'),_0x588d55,_0x4e6813[_0x7f3d('0x13')][_0x7f3d('0x15')]);return _0x5260b1(_0x4e6813['error'][_0x7f3d('0x15')]);}logger[_0x7f3d('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x588d55,_0x4e6813[_0x7f3d('0x13')][_0x7f3d('0x15')]);return _0x373fa9(_0x4e6813[_0x7f3d('0x13')][_0x7f3d('0x15')]);}else{logger[_0x7f3d('0xd')](_0x7f3d('0xe'),_0x588d55,'request\x20sent');_0x373fa9(_0x4e6813[_0x7f3d('0x16')]['message']);}})[_0x7f3d('0x17')](function(_0x3d1f29){logger[_0x7f3d('0x13')](_0x7f3d('0xe'),_0x588d55,_0x3d1f29);_0x5260b1(_0x3d1f29);});});}
\ No newline at end of file
+var _0xfd63=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4fa5c0,_0x34e425){var _0x81da33=function(_0x26502e){while(--_0x26502e){_0x4fa5c0['push'](_0x4fa5c0['shift']());}};_0x81da33(++_0x34e425);}(_0xfd63,0x128));var _0x3fd6=function(_0x51b28a,_0xfbaf7a){_0x51b28a=_0x51b28a-0x0;var _0x1504a7=_0xfd63[_0x51b28a];return _0x1504a7;};'use strict';var _=require(_0x3fd6('0x0'));var util=require(_0x3fd6('0x1'));var moment=require(_0x3fd6('0x2'));var BPromise=require(_0x3fd6('0x3'));var rs=require(_0x3fd6('0x4'));var fs=require('fs');var Redis=require(_0x3fd6('0x5'));var db=require(_0x3fd6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3fd6('0x7'))('rpc');var config=require(_0x3fd6('0x8'));var jayson=require(_0x3fd6('0x9'));var client=jayson['client'][_0x3fd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1aa841,_0x342aeb,_0x41a0d0){return new BPromise(function(_0x1d0f96,_0x1ba282){return client[_0x3fd6('0xb')](_0x1aa841,_0x41a0d0)['then'](function(_0x57988c){logger['info'](_0x3fd6('0xc'),_0x342aeb,_0x3fd6('0xd'));logger[_0x3fd6('0xe')](_0x3fd6('0xf'),_0x342aeb,_0x3fd6('0xd'),JSON[_0x3fd6('0x10')](_0x57988c));if(_0x57988c['error']){if(_0x57988c[_0x3fd6('0x11')][_0x3fd6('0x12')]===0x1f4){logger[_0x3fd6('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x342aeb,_0x57988c[_0x3fd6('0x11')]['message']);return _0x1ba282(_0x57988c['error'][_0x3fd6('0x13')]);}logger[_0x3fd6('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x342aeb,_0x57988c[_0x3fd6('0x11')]['message']);return _0x1d0f96(_0x57988c[_0x3fd6('0x11')][_0x3fd6('0x13')]);}else{logger['info'](_0x3fd6('0xc'),_0x342aeb,_0x3fd6('0xd'));_0x1d0f96(_0x57988c['result']['message']);}})[_0x3fd6('0x14')](function(_0x3c5444){logger['error'](_0x3fd6('0xc'),_0x342aeb,_0x3c5444);_0x1ba282(_0x3c5444);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 4cc0728..5d4b95a 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 _0x2cc1=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0xf79003,_0x5a9960){var _0x4bb39c=function(_0x2017eb){while(--_0x2017eb){_0xf79003['push'](_0xf79003['shift']());}};_0x4bb39c(++_0x5a9960);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x243c5c,_0x3dd30c){_0x243c5c=_0x243c5c-0x0;var _0x486e0f=_0x2cc1[_0x243c5c];return _0x486e0f;};'use strict';var multer=require(_0x12cc('0x0'));var util=require(_0x12cc('0x1'));var path=require(_0x12cc('0x2'));var timeout=require(_0x12cc('0x3'));var express=require(_0x12cc('0x4'));var router=express[_0x12cc('0x5')]();var auth=require(_0x12cc('0x6'));var interaction=require(_0x12cc('0x7'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x12cc('0x8')]('/',auth[_0x12cc('0x9')](),controller['index']);router['get'](_0x12cc('0xa'),auth[_0x12cc('0x9')](),controller[_0x12cc('0xb')]);router[_0x12cc('0x8')](_0x12cc('0xc'),auth[_0x12cc('0x9')](),controller[_0x12cc('0xd')]);router[_0x12cc('0xe')]('/',auth[_0x12cc('0x9')](),controller[_0x12cc('0xf')]);router[_0x12cc('0x10')](_0x12cc('0xc'),auth[_0x12cc('0x9')](),controller['update']);router[_0x12cc('0x11')]('/:id',auth[_0x12cc('0x9')](),controller[_0x12cc('0x12')]);module[_0x12cc('0x13')]=router;
\ No newline at end of file
+var _0x8e63=['create','delete','destroy','exports','util','express','Router','../../components/auth/service','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','show','post'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0x8e63,0x7c));var _0x38e6=function(_0x163a85,_0x51b0d4){_0x163a85=_0x163a85-0x0;var _0x2550f4=_0x8e63[_0x163a85];return _0x2550f4;};'use strict';var multer=require('multer');var util=require(_0x38e6('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x38e6('0x1'));var router=express[_0x38e6('0x2')]();var auth=require(_0x38e6('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x38e6('0x4'));router[_0x38e6('0x5')]('/',auth[_0x38e6('0x6')](),controller['index']);router[_0x38e6('0x5')](_0x38e6('0x7'),auth[_0x38e6('0x6')](),controller[_0x38e6('0x8')]);router['get']('/:id',auth[_0x38e6('0x6')](),controller[_0x38e6('0x9')]);router[_0x38e6('0xa')]('/',auth[_0x38e6('0x6')](),controller[_0x38e6('0xb')]);router['put']('/:id',auth[_0x38e6('0x6')](),controller['update']);router[_0x38e6('0xc')]('/:id',auth[_0x38e6('0x6')](),controller[_0x38e6('0xd')]);module[_0x38e6('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index efdf7a2..9e44492 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 _0x4b67=['exports','ENUM','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0x1a8c32,_0x43baa6){var _0x37643c=function(_0x35c084){while(--_0x35c084){_0x1a8c32['push'](_0x1a8c32['shift']());}};_0x37643c(++_0x43baa6);}(_0x4b67,0x1f0));var _0x74b6=function(_0x5f8e70,_0x5f50f8){_0x5f8e70=_0x5f8e70-0x0;var _0x5ebd10=_0x4b67[_0x5f8e70];return _0x5ebd10;};'use strict';var Sequelize=require(_0x74b6('0x0'));module[_0x74b6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x74b6('0x2')](_0x74b6('0x3'),_0x74b6('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x74b6('0x5')]},'timeout':{'type':Sequelize[_0x74b6('0x6')]}};
\ No newline at end of file
+var _0x21ae=['exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x4c692d,_0x421e58){var _0xa81cd1=function(_0x20a6ea){while(--_0x20a6ea){_0x4c692d['push'](_0x4c692d['shift']());}};_0xa81cd1(++_0x421e58);}(_0x21ae,0x1ce));var _0xe21a=function(_0x189b21,_0x4c1465){_0x189b21=_0x189b21-0x0;var _0x2add98=_0x21ae[_0x189b21];return _0x2add98;};'use strict';var Sequelize=require('sequelize');module[_0xe21a('0x0')]={'name':{'type':Sequelize[_0xe21a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe21a('0x2')](_0xe21a('0x3'),_0xe21a('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xe21a('0x1')]},'timeout':{'type':Sequelize[_0xe21a('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index d9a7577..e7c2361 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 _0xec66=['include','merge','options','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','show','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','attributes','fields','length'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xec66,0x12a));var _0x6ec6=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0xec66[_0x39caaa];return _0x9b9c7d;};'use strict';var pdf=require(_0x6ec6('0x0'));var emlformat=require(_0x6ec6('0x1'));var rimraf=require(_0x6ec6('0x2'));var zipdir=require(_0x6ec6('0x3'));var jsonpatch=require(_0x6ec6('0x4'));var rp=require(_0x6ec6('0x5'));var moment=require('moment');var BPromise=require(_0x6ec6('0x6'));var Mustache=require(_0x6ec6('0x7'));var util=require(_0x6ec6('0x8'));var path=require(_0x6ec6('0x9'));var sox=require(_0x6ec6('0xa'));var csv=require('to-csv');var ejs=require(_0x6ec6('0xb'));var fs=require('fs');var _=require(_0x6ec6('0xc'));var squel=require(_0x6ec6('0xd'));var crypto=require(_0x6ec6('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ec6('0xf'));var querystring=require(_0x6ec6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6ec6('0x11'));var qs=require(_0x6ec6('0x12'));var hardwareService=require(_0x6ec6('0x13'));var logger=require(_0x6ec6('0x14'))(_0x6ec6('0x15'));var utils=require(_0x6ec6('0x16'));var config=require(_0x6ec6('0x17'));var db=require(_0x6ec6('0x18'))['db'];function respondWithStatusCode(_0xb2c12c,_0x476cfe){_0x476cfe=_0x476cfe||0xcc;return function(_0x5a3441){if(_0x5a3441){return _0xb2c12c['sendStatus'](_0x476cfe);}return _0xb2c12c[_0x6ec6('0x19')](_0x476cfe)[_0x6ec6('0x1a')]();};}function respondWithResult(_0x5a07d5,_0x28736e){_0x28736e=_0x28736e||0xc8;return function(_0x2a2e42){if(_0x2a2e42){return _0x5a07d5[_0x6ec6('0x19')](_0x28736e)[_0x6ec6('0x1b')](_0x2a2e42);}};}function respondWithFilteredResult(_0x3151ce,_0x305094){return function(_0x77d6c){if(_0x77d6c){var _0x531f10=_0x77d6c['count'],_0x2162fb=_0x305094[_0x6ec6('0x1c')],_0xcaecdf=_0x305094[_0x6ec6('0x1c')]+_0x305094[_0x6ec6('0x1d')],_0x5c21e9;if(_0xcaecdf>=_0x531f10){_0xcaecdf=_0x531f10;_0x5c21e9=0xc8;}else{_0x5c21e9=0xce;}_0x3151ce[_0x6ec6('0x19')](_0x5c21e9);return _0x3151ce['set'](_0x6ec6('0x1e'),_0x2162fb+'-'+_0xcaecdf+'/'+_0x531f10)[_0x6ec6('0x1b')](_0x77d6c);}return null;};}function patchUpdates(_0x3f57a1){return function(_0x3f6f3f){try{jsonpatch[_0x6ec6('0x1f')](_0x3f6f3f,_0x3f57a1,!![]);}catch(_0x4ef352){return BPromise[_0x6ec6('0x20')](_0x4ef352);}return _0x3f6f3f['save']();};}function saveUpdates(_0x7bbc5f,_0x553b0b){return function(_0x20e2ef){if(_0x20e2ef){return _0x20e2ef[_0x6ec6('0x21')](_0x7bbc5f)[_0x6ec6('0x22')](function(_0x563ced){return _0x563ced;});}return null;};}function removeEntity(_0x3663a0,_0x2d572b){return function(_0xf40137){if(_0xf40137){return _0xf40137[_0x6ec6('0x23')]()['then'](function(){_0x3663a0['status'](0xcc)[_0x6ec6('0x1a')]();});}};}function handleEntityNotFound(_0x55108b,_0x5e73d6){return function(_0x4fbc9e){if(!_0x4fbc9e){_0x55108b['sendStatus'](0x194);}return _0x4fbc9e;};}function handleError(_0x493987,_0x36c15b){_0x36c15b=_0x36c15b||0x1f4;return function(_0x1ddba7){logger[_0x6ec6('0x24')](_0x1ddba7[_0x6ec6('0x25')]);if(_0x1ddba7[_0x6ec6('0x26')]){delete _0x1ddba7[_0x6ec6('0x26')];}_0x493987[_0x6ec6('0x19')](_0x36c15b)['send'](_0x1ddba7);};}exports[_0x6ec6('0x27')]=function(_0xcaa8cd,_0x4376d8){var _0x1001c8={'raw':!![],'where':{'id':_0xcaa8cd['params']['id']}},_0x418ab1={};_0x418ab1['model']=_[_0x6ec6('0x28')](db[_0x6ec6('0x29')][_0x6ec6('0x2a')]);_0x418ab1[_0x6ec6('0x2b')]=_['keys'](_0xcaa8cd['query']);_0x418ab1[_0x6ec6('0x2c')]=_[_0x6ec6('0x2d')](_0x418ab1[_0x6ec6('0x2e')],_0x418ab1[_0x6ec6('0x2b')]);_0x1001c8[_0x6ec6('0x2f')]=_[_0x6ec6('0x2d')](_0x418ab1[_0x6ec6('0x2e')],qs['fields'](_0xcaa8cd[_0x6ec6('0x2b')][_0x6ec6('0x30')]));_0x1001c8['attributes']=_0x1001c8[_0x6ec6('0x2f')][_0x6ec6('0x31')]?_0x1001c8[_0x6ec6('0x2f')]:_0x418ab1[_0x6ec6('0x2e')];if(_0xcaa8cd[_0x6ec6('0x2b')]['includeAll']){_0x1001c8[_0x6ec6('0x32')]=[{'all':!![]}];}_0x1001c8=_[_0x6ec6('0x33')]({},_0x1001c8,_0xcaa8cd[_0x6ec6('0x34')]);return db[_0x6ec6('0x29')][_0x6ec6('0x35')](_0x1001c8)['then'](handleEntityNotFound(_0x4376d8,null))[_0x6ec6('0x22')](respondWithResult(_0x4376d8,null))[_0x6ec6('0x36')](handleError(_0x4376d8,null));};exports[_0x6ec6('0x37')]=function(_0x248174,_0x1fee12){return db[_0x6ec6('0x29')][_0x6ec6('0x37')](_0x248174['body'],{})['then'](respondWithResult(_0x1fee12,0xc9))[_0x6ec6('0x36')](handleError(_0x1fee12,null));};exports[_0x6ec6('0x21')]=function(_0x188b63,_0x8af5f4){if(_0x188b63[_0x6ec6('0x38')]['id']){delete _0x188b63[_0x6ec6('0x38')]['id'];}return db[_0x6ec6('0x29')][_0x6ec6('0x35')]({'where':{'id':_0x188b63[_0x6ec6('0x39')]['id']}})['then'](handleEntityNotFound(_0x8af5f4,null))[_0x6ec6('0x22')](saveUpdates(_0x188b63[_0x6ec6('0x38')],null))[_0x6ec6('0x22')](respondWithResult(_0x8af5f4,null))[_0x6ec6('0x36')](handleError(_0x8af5f4,null));};exports[_0x6ec6('0x23')]=function(_0x1c1e4b,_0x19b641){return db[_0x6ec6('0x29')][_0x6ec6('0x35')]({'where':{'id':_0x1c1e4b[_0x6ec6('0x39')]['id']}})['then'](handleEntityNotFound(_0x19b641,null))[_0x6ec6('0x22')](removeEntity(_0x19b641,null))[_0x6ec6('0x36')](handleError(_0x19b641,null));};
\ No newline at end of file
+var _0xad41=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','create','body','find','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash'];(function(_0x28912f,_0x37ae08){var _0x5c824=function(_0x2cdf1b){while(--_0x2cdf1b){_0x28912f['push'](_0x28912f['shift']());}};_0x5c824(++_0x37ae08);}(_0xad41,0x6c));var _0x1ad4=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0xad41[_0x533110];return _0xc3c866;};'use strict';var pdf=require(_0x1ad4('0x0'));var emlformat=require(_0x1ad4('0x1'));var rimraf=require(_0x1ad4('0x2'));var zipdir=require(_0x1ad4('0x3'));var jsonpatch=require(_0x1ad4('0x4'));var rp=require(_0x1ad4('0x5'));var moment=require(_0x1ad4('0x6'));var BPromise=require(_0x1ad4('0x7'));var Mustache=require(_0x1ad4('0x8'));var util=require(_0x1ad4('0x9'));var path=require(_0x1ad4('0xa'));var sox=require('sox');var csv=require(_0x1ad4('0xb'));var ejs=require(_0x1ad4('0xc'));var fs=require('fs');var _=require(_0x1ad4('0xd'));var squel=require('squel');var crypto=require(_0x1ad4('0xe'));var jsforce=require(_0x1ad4('0xf'));var deskjs=require(_0x1ad4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1ad4('0x11'));var Papa=require(_0x1ad4('0x12'));var Redis=require(_0x1ad4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1ad4('0x14'));var hardwareService=require(_0x1ad4('0x15'));var logger=require(_0x1ad4('0x16'))(_0x1ad4('0x17'));var utils=require(_0x1ad4('0x18'));var config=require(_0x1ad4('0x19'));var db=require(_0x1ad4('0x1a'))['db'];function respondWithStatusCode(_0x2526ee,_0x48650b){_0x48650b=_0x48650b||0xcc;return function(_0x407023){if(_0x407023){return _0x2526ee[_0x1ad4('0x1b')](_0x48650b);}return _0x2526ee[_0x1ad4('0x1c')](_0x48650b)[_0x1ad4('0x1d')]();};}function respondWithResult(_0x3dc38b,_0x4737cc){_0x4737cc=_0x4737cc||0xc8;return function(_0x37d464){if(_0x37d464){return _0x3dc38b['status'](_0x4737cc)[_0x1ad4('0x1e')](_0x37d464);}};}function respondWithFilteredResult(_0x5b2c18,_0x5bbeff){return function(_0xc18fb2){if(_0xc18fb2){var _0x3465bd=_0xc18fb2['count'],_0x438406=_0x5bbeff[_0x1ad4('0x1f')],_0xa5b61e=_0x5bbeff[_0x1ad4('0x1f')]+_0x5bbeff[_0x1ad4('0x20')],_0x140557;if(_0xa5b61e>=_0x3465bd){_0xa5b61e=_0x3465bd;_0x140557=0xc8;}else{_0x140557=0xce;}_0x5b2c18[_0x1ad4('0x1c')](_0x140557);return _0x5b2c18[_0x1ad4('0x21')](_0x1ad4('0x22'),_0x438406+'-'+_0xa5b61e+'/'+_0x3465bd)[_0x1ad4('0x1e')](_0xc18fb2);}return null;};}function patchUpdates(_0x5329ad){return function(_0x5d6773){try{jsonpatch[_0x1ad4('0x23')](_0x5d6773,_0x5329ad,!![]);}catch(_0x3cb970){return BPromise[_0x1ad4('0x24')](_0x3cb970);}return _0x5d6773[_0x1ad4('0x25')]();};}function saveUpdates(_0x361d3a,_0xc41389){return function(_0x4c2a1e){if(_0x4c2a1e){return _0x4c2a1e[_0x1ad4('0x26')](_0x361d3a)['then'](function(_0x381dc9){return _0x381dc9;});}return null;};}function removeEntity(_0x384f31,_0x3fbbac){return function(_0x5b066f){if(_0x5b066f){return _0x5b066f['destroy']()[_0x1ad4('0x27')](function(){_0x384f31[_0x1ad4('0x1c')](0xcc)[_0x1ad4('0x1d')]();});}};}function handleEntityNotFound(_0x503fd5,_0x2c452b){return function(_0x5981e7){if(!_0x5981e7){_0x503fd5[_0x1ad4('0x1b')](0x194);}return _0x5981e7;};}function handleError(_0xab7d1d,_0x28f1d7){_0x28f1d7=_0x28f1d7||0x1f4;return function(_0x538e18){logger[_0x1ad4('0x28')](_0x538e18['stack']);if(_0x538e18['name']){delete _0x538e18[_0x1ad4('0x29')];}_0xab7d1d[_0x1ad4('0x1c')](_0x28f1d7)[_0x1ad4('0x2a')](_0x538e18);};}exports['show']=function(_0x54938d,_0x5c07a7){var _0x431b29={'raw':!![],'where':{'id':_0x54938d[_0x1ad4('0x2b')]['id']}},_0x1747a7={};_0x1747a7[_0x1ad4('0x2c')]=_[_0x1ad4('0x2d')](db[_0x1ad4('0x2e')]['rawAttributes']);_0x1747a7[_0x1ad4('0x2f')]=_[_0x1ad4('0x2d')](_0x54938d['query']);_0x1747a7[_0x1ad4('0x30')]=_[_0x1ad4('0x31')](_0x1747a7[_0x1ad4('0x2c')],_0x1747a7['query']);_0x431b29[_0x1ad4('0x32')]=_[_0x1ad4('0x31')](_0x1747a7[_0x1ad4('0x2c')],qs['fields'](_0x54938d[_0x1ad4('0x2f')][_0x1ad4('0x33')]));_0x431b29[_0x1ad4('0x32')]=_0x431b29[_0x1ad4('0x32')][_0x1ad4('0x34')]?_0x431b29[_0x1ad4('0x32')]:_0x1747a7[_0x1ad4('0x2c')];if(_0x54938d[_0x1ad4('0x2f')][_0x1ad4('0x35')]){_0x431b29[_0x1ad4('0x36')]=[{'all':!![]}];}_0x431b29=_[_0x1ad4('0x37')]({},_0x431b29,_0x54938d[_0x1ad4('0x38')]);return db[_0x1ad4('0x2e')]['find'](_0x431b29)['then'](handleEntityNotFound(_0x5c07a7,null))[_0x1ad4('0x27')](respondWithResult(_0x5c07a7,null))['catch'](handleError(_0x5c07a7,null));};exports[_0x1ad4('0x39')]=function(_0x511b08,_0x2cdbc6){return db['ChatProactiveAction'][_0x1ad4('0x39')](_0x511b08[_0x1ad4('0x3a')],{})[_0x1ad4('0x27')](respondWithResult(_0x2cdbc6,0xc9))['catch'](handleError(_0x2cdbc6,null));};exports[_0x1ad4('0x26')]=function(_0x41cb6b,_0x4dface){if(_0x41cb6b[_0x1ad4('0x3a')]['id']){delete _0x41cb6b[_0x1ad4('0x3a')]['id'];}return db[_0x1ad4('0x2e')][_0x1ad4('0x3b')]({'where':{'id':_0x41cb6b[_0x1ad4('0x2b')]['id']}})[_0x1ad4('0x27')](handleEntityNotFound(_0x4dface,null))[_0x1ad4('0x27')](saveUpdates(_0x41cb6b[_0x1ad4('0x3a')],null))[_0x1ad4('0x27')](respondWithResult(_0x4dface,null))['catch'](handleError(_0x4dface,null));};exports[_0x1ad4('0x3c')]=function(_0x692392,_0x5e56a4){return db[_0x1ad4('0x2e')][_0x1ad4('0x3b')]({'where':{'id':_0x692392[_0x1ad4('0x2b')]['id']}})[_0x1ad4('0x27')](handleEntityNotFound(_0x5e56a4,null))[_0x1ad4('0x27')](removeEntity(_0x5e56a4,null))['catch'](handleError(_0x5e56a4,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 8a7c68e..2632446 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 _0xae87=['bluebird','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger'];(function(_0x167bfe,_0x3aced5){var _0x12d0fb=function(_0x3e5cd5){while(--_0x3e5cd5){_0x167bfe['push'](_0x167bfe['shift']());}};_0x12d0fb(++_0x3aced5);}(_0xae87,0x141));var _0x7ae8=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0xae87[_0x326e79];return _0x37eb89;};'use strict';var _=require(_0x7ae8('0x0'));var util=require(_0x7ae8('0x1'));var logger=require(_0x7ae8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7ae8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7ae8('0x4'));var attributes=require(_0x7ae8('0x5'));module[_0x7ae8('0x6')]=function(_0x800673,_0x32c06a){return _0x800673[_0x7ae8('0x7')](_0x7ae8('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e78=['path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x46b22a,_0x5bf83a){var _0x44c2e8=function(_0x21b6fc){while(--_0x21b6fc){_0x46b22a['push'](_0x46b22a['shift']());}};_0x44c2e8(++_0x5bf83a);}(_0x9e78,0xfe));var _0x89e7=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x9e78[_0x503950];return _0x1657a9;};'use strict';var _=require(_0x89e7('0x0'));var util=require(_0x89e7('0x1'));var logger=require(_0x89e7('0x2'))(_0x89e7('0x3'));var moment=require('moment');var BPromise=require(_0x89e7('0x4'));var rp=require(_0x89e7('0x5'));var fs=require('fs');var path=require(_0x89e7('0x6'));var rimraf=require('rimraf');var config=require(_0x89e7('0x7'));var attributes=require(_0x89e7('0x8'));module[_0x89e7('0x9')]=function(_0x15d5b9,_0x2f10c9){return _0x15d5b9[_0x89e7('0xa')](_0x89e7('0xb'),attributes,{'tableName':_0x89e7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 92f1b44..576b6d6 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x27e0d6,_0x15bc55){var _0x1a5282=function(_0x5c45fc){while(--_0x5c45fc){_0x27e0d6['push'](_0x27e0d6['shift']());}};_0x1a5282(++_0x15bc55);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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']('ChatProactiveAction,\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);});});}
\ No newline at end of file
+var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xb3edfd,_0x156ac8){var _0x2a307d=function(_0x4ff783){while(--_0x4ff783){_0xb3edfd['push'](_0xb3edfd['shift']());}};_0x2a307d(++_0x156ac8);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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']('ChatProactiveAction,\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);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index de23305..f7efc8f 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 _0x36ee=['/:id','isAuthenticated','show','post','put','update','delete','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x3e3217,_0x518c13){var _0x425fac=function(_0x22a925){while(--_0x22a925){_0x3e3217['push'](_0x3e3217['shift']());}};_0x425fac(++_0x518c13);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var auth=require(_0xe36e('0x3'));var interaction=require(_0xe36e('0x4'));var config=require(_0xe36e('0x5'));var controller=require(_0xe36e('0x6'));router[_0xe36e('0x7')](_0xe36e('0x8'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0xb')]('/',auth[_0xe36e('0x9')](),controller['create']);router[_0xe36e('0xc')]('/:id',auth[_0xe36e('0x9')](),controller[_0xe36e('0xd')]);router[_0xe36e('0xe')]('/:id',auth[_0xe36e('0x9')](),controller['destroy']);module[_0xe36e('0xf')]=router;
\ No newline at end of file
+var _0xdec3=['./chatProactiveAction.controller','/:id','isAuthenticated','show','post','create','put','update','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3d131a,_0x2ee691){var _0x44c22d=function(_0xa7a9fe){while(--_0xa7a9fe){_0x3d131a['push'](_0x3d131a['shift']());}};_0x44c22d(++_0x2ee691);}(_0xdec3,0x89));var _0x3dec=function(_0x1b7b90,_0x6a0e6b){_0x1b7b90=_0x1b7b90-0x0;var _0x34a9fd=_0xdec3[_0x1b7b90];return _0x34a9fd;};'use strict';var multer=require(_0x3dec('0x0'));var util=require('util');var path=require(_0x3dec('0x1'));var timeout=require(_0x3dec('0x2'));var express=require(_0x3dec('0x3'));var router=express['Router']();var auth=require(_0x3dec('0x4'));var interaction=require(_0x3dec('0x5'));var config=require(_0x3dec('0x6'));var controller=require(_0x3dec('0x7'));router['get'](_0x3dec('0x8'),auth[_0x3dec('0x9')](),controller[_0x3dec('0xa')]);router[_0x3dec('0xb')]('/',auth[_0x3dec('0x9')](),controller[_0x3dec('0xc')]);router[_0x3dec('0xd')]('/:id',auth[_0x3dec('0x9')](),controller[_0x3dec('0xe')]);router['delete'](_0x3dec('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x3dec('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 1cedc02..5da2392 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 _0x6169=['STRING','rrmemory','roundrobin','sequelize','name'];(function(_0x3222f9,_0x4ce984){var _0x4a13b5=function(_0x49cdc4){while(--_0x49cdc4){_0x3222f9['push'](_0x3222f9['shift']());}};_0x4a13b5(++_0x4ce984);}(_0x6169,0x143));var _0x9616=function(_0x321281,_0x2a1dee){_0x321281=_0x321281-0x0;var _0x201640=_0x6169[_0x321281];return _0x201640;};'use strict';var Sequelize=require(_0x9616('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9616('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9616('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9616('0x3'),'beepall',_0x9616('0x4'))}};
\ No newline at end of file
+var _0x9feb=['exports','STRING','INTEGER','beepall'];(function(_0x51e1d5,_0x399588){var _0x105666=function(_0x325128){while(--_0x325128){_0x51e1d5['push'](_0x51e1d5['shift']());}};_0x105666(++_0x399588);}(_0x9feb,0x1e8));var _0xb9fe=function(_0x47fdfb,_0x273baf){_0x47fdfb=_0x47fdfb-0x0;var _0x38f3ee=_0x9feb[_0x47fdfb];return _0x38f3ee;};'use strict';var Sequelize=require('sequelize');module[_0xb9fe('0x0')]={'name':{'type':Sequelize[_0xb9fe('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb9fe('0x1')]},'timeout':{'type':Sequelize[_0xb9fe('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xb9fe('0x3'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 3500d15..c7622a7 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 _0x4d94=['updatedAt','createdAt','format','%s/%s','getTeams','addTeams','teams','Team','User','Agents','voicePause','interface','flatMap','transaction','each','emit','userChatQueue:save','removeTeams','ids','select','tq.TeamId','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','ChatQueues','stack','name','send','index','ChatQueue','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','count','includeAll','findAll','rows','show','params','filters','length','include','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','nolimit','ChatQueueId','UserChatQueue','agent','chatPause'];(function(_0x2d212e,_0x4534ea){var _0x51b1e5=function(_0x530a54){while(--_0x530a54){_0x2d212e['push'](_0x2d212e['shift']());}};_0x51b1e5(++_0x4534ea);}(_0x4d94,0xc5));var _0x44d9=function(_0x17e09f,_0x1e12be){_0x17e09f=_0x17e09f-0x0;var _0x4ac806=_0x4d94[_0x17e09f];return _0x4ac806;};'use strict';var pdf=require(_0x44d9('0x0'));var emlformat=require(_0x44d9('0x1'));var rimraf=require(_0x44d9('0x2'));var zipdir=require(_0x44d9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x44d9('0x4'));var BPromise=require(_0x44d9('0x5'));var Mustache=require(_0x44d9('0x6'));var util=require(_0x44d9('0x7'));var path=require(_0x44d9('0x8'));var sox=require(_0x44d9('0x9'));var csv=require(_0x44d9('0xa'));var ejs=require(_0x44d9('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x44d9('0xc'));var crypto=require(_0x44d9('0xd'));var jsforce=require(_0x44d9('0xe'));var deskjs=require(_0x44d9('0xf'));var toCsv=require(_0x44d9('0xa'));var querystring=require(_0x44d9('0x10'));var Papa=require('papaparse');var Redis=require(_0x44d9('0x11'));var authService=require(_0x44d9('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x44d9('0x13'));var logger=require(_0x44d9('0x14'))(_0x44d9('0x15'));var utils=require(_0x44d9('0x16'));var config=require('../../config/environment');var db=require(_0x44d9('0x17'))['db'];config['redis']=_[_0x44d9('0x18')](config[_0x44d9('0x19')],{'host':_0x44d9('0x1a'),'port':0x18eb});var socket=require(_0x44d9('0x1b'))(new Redis(config[_0x44d9('0x19')]));require(_0x44d9('0x1c'))[_0x44d9('0x1d')](socket);var jayson=require(_0x44d9('0x1e'));var client=jayson[_0x44d9('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x415698,_0x423d3f,_0x52546c){if(_0x52546c){var _0x341ebe=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x341ebe[_0x44d9('0x20')](_0x423d3f)){return _0x415698;}else{throw new Error(_0x44d9('0x21'));}}else{return _0x415698;}}function respondWithRpcPromise(_0x2ef5c7,_0x59eee4,_0x34702b,_0x12eb46){return new BPromise(function(_0x31c56d,_0x1f4064){var _0x420c41=_0x12eb46||client;return _0x420c41[_0x44d9('0x22')](_0x2ef5c7,_0x34702b)['then'](function(_0x191195){logger[_0x44d9('0x23')]('ChatQueue,\x20%s,\x20%s',_0x59eee4,_0x44d9('0x24'));logger[_0x44d9('0x25')](_0x44d9('0x26'),_0x59eee4,_0x44d9('0x24'),JSON['stringify'](_0x191195));if(_0x191195[_0x44d9('0x27')]){if(_0x191195[_0x44d9('0x27')][_0x44d9('0x28')]===0x1f4){logger[_0x44d9('0x27')](_0x44d9('0x29'),_0x59eee4,_0x191195[_0x44d9('0x27')][_0x44d9('0x2a')]);return _0x1f4064(_0x191195[_0x44d9('0x27')][_0x44d9('0x2a')]);}logger[_0x44d9('0x27')](_0x44d9('0x29'),_0x59eee4,_0x191195['error'][_0x44d9('0x2a')]);return _0x31c56d(_0x191195[_0x44d9('0x27')][_0x44d9('0x2a')]);}else{logger['info'](_0x44d9('0x29'),_0x59eee4,'request\x20sent');_0x31c56d(_0x191195[_0x44d9('0x2b')][_0x44d9('0x2a')]);}})[_0x44d9('0x2c')](function(_0x397206){logger[_0x44d9('0x27')](_0x44d9('0x29'),_0x59eee4,_0x397206);_0x1f4064(_0x397206);});});}function respondWithStatusCode(_0x1e7097,_0xaadf3d){_0xaadf3d=_0xaadf3d||0xcc;return function(_0x21de48){if(_0x21de48){return _0x1e7097[_0x44d9('0x2d')](_0xaadf3d);}return _0x1e7097[_0x44d9('0x2e')](_0xaadf3d)['end']();};}function respondWithResult(_0x119380,_0x389214){_0x389214=_0x389214||0xc8;return function(_0x699a2c){if(_0x699a2c){return _0x119380[_0x44d9('0x2e')](_0x389214)['json'](_0x699a2c);}};}function respondWithFilteredResult(_0x4ee65f,_0x45dd0b){return function(_0x3f9001){if(_0x3f9001){var _0x21a746=_0x3f9001['count'],_0x1a7952=_0x45dd0b[_0x44d9('0x2f')],_0x28a967=_0x45dd0b['offset']+_0x45dd0b[_0x44d9('0x30')],_0x28e752;if(_0x28a967>=_0x21a746){_0x28a967=_0x21a746;_0x28e752=0xc8;}else{_0x28e752=0xce;}_0x4ee65f[_0x44d9('0x2e')](_0x28e752);return _0x4ee65f[_0x44d9('0x31')](_0x44d9('0x32'),_0x1a7952+'-'+_0x28a967+'/'+_0x21a746)['json'](_0x3f9001);}return null;};}function patchUpdates(_0x1563c1){return function(_0xd4221c){try{jsonpatch['apply'](_0xd4221c,_0x1563c1,!![]);}catch(_0x360271){return BPromise[_0x44d9('0x33')](_0x360271);}return _0xd4221c[_0x44d9('0x34')]();};}function saveUpdates(_0xce652a,_0x35dfb8){return function(_0x2319e6){if(_0x2319e6){return _0x2319e6[_0x44d9('0x35')](_0xce652a)['then'](function(_0x2e3da5){return _0x2e3da5;});}return null;};}function removeEntity(_0x1776aa,_0xed744a){return function(_0x10d148){if(_0x10d148){return _0x10d148[_0x44d9('0x36')]()[_0x44d9('0x37')](function(){var _0x3a3973=_0x10d148[_0x44d9('0x38')]({'plain':!![]});var _0x102cce=_0x44d9('0x39');return db['UserProfileResource'][_0x44d9('0x36')]({'where':{'type':_0x102cce,'resourceId':_0x3a3973['id']}})[_0x44d9('0x37')](function(){return _0x10d148;});})[_0x44d9('0x37')](function(){_0x1776aa[_0x44d9('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2867c6,_0x6955f8){return function(_0x187762){if(!_0x187762){_0x2867c6[_0x44d9('0x2d')](0x194);}return _0x187762;};}function handleError(_0x4cf222,_0x269b06){_0x269b06=_0x269b06||0x1f4;return function(_0x40d0c5){logger[_0x44d9('0x27')](_0x40d0c5[_0x44d9('0x3a')]);if(_0x40d0c5[_0x44d9('0x3b')]){delete _0x40d0c5[_0x44d9('0x3b')];}_0x4cf222[_0x44d9('0x2e')](_0x269b06)[_0x44d9('0x3c')](_0x40d0c5);};}exports[_0x44d9('0x3d')]=function(_0xcdd29c,_0x1cbeac){var _0xd9bfcb={},_0x5bf1b4={},_0x2d43f0={'count':0x0,'rows':[]};var _0x4b0aba=db[_0x44d9('0x3e')][_0x44d9('0x3f')];_0x5bf1b4[_0x44d9('0x40')]=_[_0x44d9('0x41')](_0x4b0aba);_0x5bf1b4[_0x44d9('0x42')]=_[_0x44d9('0x41')](_0xcdd29c[_0x44d9('0x42')]);_0x5bf1b4['filters']=_[_0x44d9('0x43')](_0x5bf1b4[_0x44d9('0x40')],_0x5bf1b4[_0x44d9('0x42')]);_0xd9bfcb[_0x44d9('0x44')]=_[_0x44d9('0x43')](_0x5bf1b4[_0x44d9('0x40')],qs[_0x44d9('0x45')](_0xcdd29c['query'][_0x44d9('0x45')]));_0xd9bfcb[_0x44d9('0x44')]=_0xd9bfcb[_0x44d9('0x44')]['length']?_0xd9bfcb[_0x44d9('0x44')]:_0x5bf1b4[_0x44d9('0x40')];if(!_0xcdd29c['query'][_0x44d9('0x46')]('nolimit')){_0xd9bfcb[_0x44d9('0x30')]=qs[_0x44d9('0x30')](_0xcdd29c[_0x44d9('0x42')][_0x44d9('0x30')]);_0xd9bfcb[_0x44d9('0x2f')]=qs[_0x44d9('0x2f')](_0xcdd29c['query'][_0x44d9('0x2f')]);}_0xd9bfcb[_0x44d9('0x47')]=qs[_0x44d9('0x48')](_0xcdd29c[_0x44d9('0x42')]['sort']);_0xd9bfcb[_0x44d9('0x49')]=qs['filters'](_[_0x44d9('0x4a')](_0xcdd29c[_0x44d9('0x42')],_0x5bf1b4['filters']));if(_0xcdd29c['query'][_0x44d9('0x4b')]){_0xd9bfcb[_0x44d9('0x49')]=_['merge'](_0xd9bfcb[_0x44d9('0x49')],{'$or':_[_0x44d9('0x4c')](_0x4b0aba,function(_0x5dd1ab){if(_0x5dd1ab[_0x44d9('0x4d')][_0x44d9('0x4e')]!==_0x44d9('0x4f')){var _0x43d4b5={};_0x43d4b5[_0x5dd1ab[_0x44d9('0x50')]]={'$like':'%'+_0xcdd29c[_0x44d9('0x42')][_0x44d9('0x4b')]+'%'};return _0x43d4b5;}})});}_0xd9bfcb=_[_0x44d9('0x51')]({},_0xd9bfcb,_0xcdd29c[_0x44d9('0x52')]);var _0x3583f9={'where':_0xd9bfcb[_0x44d9('0x49')]};return db['ChatQueue']['count'](_0x3583f9)[_0x44d9('0x37')](function(_0x77d865){_0x2d43f0[_0x44d9('0x53')]=_0x77d865;if(_0xcdd29c[_0x44d9('0x42')][_0x44d9('0x54')]){_0xd9bfcb['include']=[{'all':!![]}];}return db[_0x44d9('0x3e')][_0x44d9('0x55')](_0xd9bfcb);})[_0x44d9('0x37')](function(_0x490e8a){_0x2d43f0[_0x44d9('0x56')]=_0x490e8a;return _0x2d43f0;})[_0x44d9('0x37')](respondWithFilteredResult(_0x1cbeac,_0xd9bfcb))[_0x44d9('0x2c')](handleError(_0x1cbeac,null));};exports[_0x44d9('0x57')]=function(_0x31aa02,_0x444c3d){var _0x587db7={'raw':!![],'where':{'id':_0x31aa02[_0x44d9('0x58')]['id']}},_0x1d1ff7={};_0x1d1ff7[_0x44d9('0x40')]=_['keys'](db[_0x44d9('0x3e')][_0x44d9('0x3f')]);_0x1d1ff7['query']=_[_0x44d9('0x41')](_0x31aa02[_0x44d9('0x42')]);_0x1d1ff7[_0x44d9('0x59')]=_[_0x44d9('0x43')](_0x1d1ff7[_0x44d9('0x40')],_0x1d1ff7[_0x44d9('0x42')]);_0x587db7[_0x44d9('0x44')]=_[_0x44d9('0x43')](_0x1d1ff7[_0x44d9('0x40')],qs[_0x44d9('0x45')](_0x31aa02[_0x44d9('0x42')]['fields']));_0x587db7[_0x44d9('0x44')]=_0x587db7['attributes'][_0x44d9('0x5a')]?_0x587db7[_0x44d9('0x44')]:_0x1d1ff7[_0x44d9('0x40')];if(_0x31aa02[_0x44d9('0x42')][_0x44d9('0x54')]){_0x587db7[_0x44d9('0x5b')]=[{'all':!![]}];}_0x587db7=_[_0x44d9('0x51')]({},_0x587db7,_0x31aa02[_0x44d9('0x52')]);return db['ChatQueue']['find'](_0x587db7)[_0x44d9('0x37')](handleEntityNotFound(_0x444c3d,null))[_0x44d9('0x37')](respondWithResult(_0x444c3d,null))[_0x44d9('0x2c')](handleError(_0x444c3d,null));};exports['create']=function(_0x5646f1,_0x502e8c){return db[_0x44d9('0x3e')][_0x44d9('0x5c')](_0x5646f1[_0x44d9('0x5d')],{})['then'](function(_0x3758f6){var _0x169711=_0x5646f1[_0x44d9('0x5e')][_0x44d9('0x38')]({'plain':!![]});if(!_0x169711)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x169711[_0x44d9('0x5f')]===_0x44d9('0x5e')){var _0xd95e53=_0x3758f6[_0x44d9('0x38')]({'plain':!![]});var _0x4352dc=_0x44d9('0x39');return db[_0x44d9('0x60')]['find']({'where':{'name':_0x4352dc,'userProfileId':_0x169711[_0x44d9('0x61')]},'raw':!![]})[_0x44d9('0x37')](function(_0x3f5814){if(_0x3f5814&&_0x3f5814[_0x44d9('0x62')]===0x0){return db[_0x44d9('0x63')][_0x44d9('0x5c')]({'name':_0xd95e53[_0x44d9('0x3b')],'resourceId':_0xd95e53['id'],'type':_0x3f5814[_0x44d9('0x3b')],'sectionId':_0x3f5814['id']},{})['then'](function(){return _0x3758f6;});}else{return _0x3758f6;}})['catch'](function(_0xa1af4b){logger[_0x44d9('0x27')](_0x44d9('0x64'),_0xa1af4b);throw _0xa1af4b;});}return _0x3758f6;})[_0x44d9('0x37')](respondWithResult(_0x502e8c,0xc9))[_0x44d9('0x2c')](handleError(_0x502e8c,null));};exports[_0x44d9('0x35')]=function(_0x1c4498,_0x36d474){if(_0x1c4498[_0x44d9('0x5d')]['id']){delete _0x1c4498[_0x44d9('0x5d')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x1c4498[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x36d474,null))[_0x44d9('0x37')](saveUpdates(_0x1c4498[_0x44d9('0x5d')],null))[_0x44d9('0x37')](respondWithResult(_0x36d474,null))['catch'](handleError(_0x36d474,null));};exports['destroy']=function(_0x1b66f5,_0x5e30af){return db[_0x44d9('0x3e')][_0x44d9('0x65')]({'where':{'id':_0x1b66f5[_0x44d9('0x58')]['id']}})['then'](handleEntityNotFound(_0x5e30af,null))[_0x44d9('0x37')](removeEntity(_0x5e30af,null))[_0x44d9('0x2c')](handleError(_0x5e30af,null));};exports[_0x44d9('0x66')]=function(_0x5397cd,_0x1d5bc3){return db[_0x44d9('0x3e')][_0x44d9('0x66')]()[_0x44d9('0x37')](respondWithResult(_0x1d5bc3,null))[_0x44d9('0x2c')](handleError(_0x1d5bc3,null));};exports['getMembers']=function(_0xcb7087,_0x26e80f,_0x35880b){var _0x43e8c8={'raw':!![],'where':{}},_0xf2692b={},_0x1a81f9;return db['ChatQueue'][_0x44d9('0x67')]({'where':{'id':_0xcb7087[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x26e80f,null))[_0x44d9('0x37')](function(_0xdcbab3){if(_0xdcbab3){_0x1a81f9=_0xdcbab3[_0x44d9('0x38')]({'plain':!![]});_0xf2692b[_0x44d9('0x40')]=_['keys'](db['UserChatQueue']['rawAttributes']);_0xf2692b[_0x44d9('0x42')]=_[_0x44d9('0x41')](_0xcb7087[_0x44d9('0x42')]);_0xf2692b[_0x44d9('0x59')]=_[_0x44d9('0x43')](_0xf2692b[_0x44d9('0x40')],_0xf2692b[_0x44d9('0x42')]);_0x43e8c8['attributes']=_[_0x44d9('0x43')](_0xf2692b[_0x44d9('0x40')],qs[_0x44d9('0x45')](_0xcb7087['query'][_0x44d9('0x45')]));_0x43e8c8['attributes']=_0x43e8c8['attributes'][_0x44d9('0x5a')]?_0x43e8c8[_0x44d9('0x44')]:_0xf2692b[_0x44d9('0x40')];if(!_0xcb7087['query'][_0x44d9('0x46')](_0x44d9('0x68'))){_0x43e8c8[_0x44d9('0x30')]=qs[_0x44d9('0x30')](_0xcb7087[_0x44d9('0x42')][_0x44d9('0x30')]);_0x43e8c8['offset']=qs[_0x44d9('0x2f')](_0xcb7087[_0x44d9('0x42')][_0x44d9('0x2f')]);}_0x43e8c8[_0x44d9('0x47')]=qs[_0x44d9('0x48')](_0xcb7087[_0x44d9('0x42')]['sort']);_0x43e8c8[_0x44d9('0x49')]=qs[_0x44d9('0x59')](_[_0x44d9('0x4a')](_0xcb7087[_0x44d9('0x42')],_0xf2692b[_0x44d9('0x59')]));_0x43e8c8[_0x44d9('0x49')][_0x44d9('0x69')]=_0xdcbab3['id'];if(_0xcb7087['query']['filter']){_0x43e8c8['where']=_[_0x44d9('0x51')](_0x43e8c8[_0x44d9('0x49')],{'$or':_['map'](_0x43e8c8[_0x44d9('0x44')],function(_0x427250){var _0x5e7e01={};_0x5e7e01[_0x427250]={'$like':'%'+_0xcb7087['query']['filter']+'%'};return _0x5e7e01;})});}_0x43e8c8=_[_0x44d9('0x51')]({},_0x43e8c8,_0xcb7087[_0x44d9('0x52')]);return db[_0x44d9('0x6a')][_0x44d9('0x55')](_0x43e8c8);}})[_0x44d9('0x37')](function(_0x1e1539){if(_0x1e1539){return db['User']['findAndCountAll']({'where':{'id':_[_0x44d9('0x4c')](_0x1e1539,'UserId'),'role':_0x44d9('0x6b')},'attributes':['id','name',_0x44d9('0x6c'),_0x44d9('0x6d'),_0x44d9('0x6e')]});}})['then'](function(_0x406bc7){if(_0x406bc7){return{'count':_0x406bc7[_0x44d9('0x53')],'rows':_[_0x44d9('0x4c')](_0x406bc7[_0x44d9('0x56')],function(_0x4f0dda){return{'membername':_0x4f0dda[_0x44d9('0x3b')],'UserId':_0x4f0dda['id'],'queue_name':_0x1a81f9[_0x44d9('0x3b')],'ChatQueueId':_0x1a81f9['id'],'interface':util[_0x44d9('0x6f')](_0x44d9('0x70'),'SIP',_0x4f0dda[_0x44d9('0x3b')]),'penalty':0x0,'paused':_0x4f0dda[_0x44d9('0x6c')],'createdAt':_0x4f0dda[_0x44d9('0x6e')],'updatedAt':_0x4f0dda['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x44d9('0x37')](respondWithFilteredResult(_0x26e80f,_0x43e8c8))[_0x44d9('0x2c')](handleError(_0x26e80f,null));};exports[_0x44d9('0x71')]=function(_0x23db00,_0x3c44fc,_0x12d48c){var _0x3d8ac5={};var _0x3a173b={};var _0x52a836;var _0xea34da;return db[_0x44d9('0x3e')][_0x44d9('0x67')]({'where':{'id':_0x23db00[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x3c44fc,null))['then'](function(_0x55a143){if(_0x55a143){_0x52a836=_0x55a143;_0x3a173b[_0x44d9('0x40')]=_[_0x44d9('0x41')](db['Team'][_0x44d9('0x3f')]);_0x3a173b[_0x44d9('0x42')]=_['keys'](_0x23db00['query']);_0x3a173b[_0x44d9('0x59')]=_[_0x44d9('0x43')](_0x3a173b[_0x44d9('0x40')],_0x3a173b[_0x44d9('0x42')]);_0x3d8ac5[_0x44d9('0x44')]=_[_0x44d9('0x43')](_0x3a173b['model'],qs['fields'](_0x23db00[_0x44d9('0x42')][_0x44d9('0x45')]));_0x3d8ac5[_0x44d9('0x44')]=_0x3d8ac5[_0x44d9('0x44')]['length']?_0x3d8ac5[_0x44d9('0x44')]:_0x3a173b[_0x44d9('0x40')];_0x3d8ac5[_0x44d9('0x47')]=qs['sort'](_0x23db00['query'][_0x44d9('0x48')]);_0x3d8ac5['where']=qs[_0x44d9('0x59')](_[_0x44d9('0x4a')](_0x23db00[_0x44d9('0x42')],_0x3a173b['filters']));if(_0x23db00[_0x44d9('0x42')][_0x44d9('0x4b')]){_0x3d8ac5['where']=_[_0x44d9('0x51')](_0x3d8ac5[_0x44d9('0x49')],{'$or':_[_0x44d9('0x4c')](_0x3d8ac5[_0x44d9('0x44')],function(_0x1e9622){var _0x39908c={};_0x39908c[_0x1e9622]={'$like':'%'+_0x23db00['query']['filter']+'%'};return _0x39908c;})});}_0x3d8ac5=_[_0x44d9('0x51')]({},_0x3d8ac5,_0x23db00[_0x44d9('0x52')]);return _0x52a836[_0x44d9('0x71')](_0x3d8ac5);}})[_0x44d9('0x37')](function(_0x323f83){if(_0x323f83){_0xea34da=_0x323f83[_0x44d9('0x5a')];if(!_0x23db00[_0x44d9('0x42')][_0x44d9('0x46')](_0x44d9('0x68'))){_0x3d8ac5[_0x44d9('0x30')]=qs[_0x44d9('0x30')](_0x23db00[_0x44d9('0x42')][_0x44d9('0x30')]);_0x3d8ac5['offset']=qs['offset'](_0x23db00[_0x44d9('0x42')][_0x44d9('0x2f')]);}return _0x52a836['getTeams'](_0x3d8ac5);}})['then'](function(_0x289c11){if(_0x289c11){return _0x289c11?{'count':_0xea34da,'rows':_0x289c11}:null;}})[_0x44d9('0x37')](respondWithResult(_0x3c44fc,null))[_0x44d9('0x2c')](handleError(_0x3c44fc,null));};exports[_0x44d9('0x72')]=function(_0x35aa4c,_0x13e746,_0x39c94a){var _0x226ace=_0x35aa4c['body'][_0x44d9('0x73')];return db[_0x44d9('0x74')][_0x44d9('0x55')]({'where':{'id':_['map'](_0x226ace,'id')},'attributes':['id'],'include':[{'model':db[_0x44d9('0x75')],'as':_0x44d9('0x76'),'attributes':['id',_0x44d9('0x3b'),'online',_0x44d9('0x77'),_0x44d9('0x78')],'raw':!![]}]})[_0x44d9('0x37')](function(_0x564fee){if(_0x564fee){var _0x1216c4=_[_0x44d9('0x79')](_0x564fee,function(_0x298972){var _0x37954a=_0x298972[_0x44d9('0x38')]({'plain':!![]});return _0x37954a[_0x44d9('0x76')];});return db['ChatQueue'][_0x44d9('0x65')]({'where':{'id':_0x35aa4c[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](function(_0x26f46e){return db['sequelize'][_0x44d9('0x7a')](function(_0x42e0fd){return _0x26f46e[_0x44d9('0x72')](_['map'](_0x226ace,'id'),{'transaction':_0x42e0fd})[_0x44d9('0x37')](function(){return BPromise[_0x44d9('0x7b')](_0x1216c4,function(_0x79fa72){return db[_0x44d9('0x6a')]['findOrCreate']({'where':{'UserId':_0x79fa72['id'],'ChatQueueId':_0x35aa4c[_0x44d9('0x58')]['id']},'transaction':_0x42e0fd});});})['then'](function(){_0x1216c4['forEach'](function(_0x112967){socket[_0x44d9('0x7c')](_0x44d9('0x7d'),{'UserId':_0x112967['id'],'ChatQueueId':_0x26f46e['id']});});});});});}})['then'](respondWithStatusCode(_0x13e746,null))[_0x44d9('0x2c')](handleError(_0x13e746,null));};exports[_0x44d9('0x7e')]=function(_0x596701,_0x496f80,_0x1e9095){return db['Team'][_0x44d9('0x55')]({'where':{'id':_0x596701['query'][_0x44d9('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x496f80,null))[_0x44d9('0x37')](function(_0x259349){var _0x3e975e=_[_0x44d9('0x4c')](_0x259349,'id');var _0xf78b36=[];var _0x56d545=[];var _0x55bbbc=squel[_0x44d9('0x80')]();_0x55bbbc[_0x44d9('0x50')](_0x44d9('0x81'))['from'](_0x44d9('0x82'),'tq')[_0x44d9('0x83')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x44d9('0x49')](_0x44d9('0x84'),_0x596701[_0x44d9('0x58')]['id']);for(var _0x4a96c3=0x0;_0x4a96c3<_0x259349['length'];_0x4a96c3+=0x1){let _0xc251f5=_0x259349[_0x4a96c3];for(var _0x1905a1=0x0;_0x1905a1<_0xc251f5[_0x44d9('0x76')][_0x44d9('0x5a')];_0x1905a1+=0x1){let _0x572de2=_0xc251f5[_0x44d9('0x76')][_0x1905a1];var _0x11e81d=_0x55bbbc[_0x44d9('0x85')]();_0x11e81d[_0x44d9('0x49')](_0x44d9('0x86'),_0x572de2['id']);_0x56d545[_0x44d9('0x87')](db['sequelize']['query'](_0x11e81d[_0x44d9('0x88')](),{'type':db[_0x44d9('0x89')][_0x44d9('0x8a')][_0x44d9('0x8b')]})[_0x44d9('0x37')](function(_0x2c704c){if(_0x2c704c[_0x44d9('0x5a')]===0x1){return _0x572de2['id'];}else{var _0xf1263d=_[_0x44d9('0x8c')](_[_0x44d9('0x4c')](_0x2c704c,'TeamId'),function(_0x1bc165){return _[_0x44d9('0x8d')](_0x3e975e,_0x1bc165);});if(_0xf1263d){return _0x572de2['id'];}}}));}}return BPromise[_0x44d9('0x8e')](_0x56d545)[_0x44d9('0x37')](function(_0x29bf06){_0xf78b36=_(_0xf78b36)[_0x44d9('0x8f')](_0x29bf06)['compact']()[_0x44d9('0x90')]();return db['ChatQueue'][_0x44d9('0x65')]({'where':{'id':_0x596701[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](function(_0x151ecf){return db[_0x44d9('0x89')][_0x44d9('0x7a')](function(_0x4c70b9){return _0x151ecf['removeTeams'](_0x596701['query'][_0x44d9('0x7f')],{'transaction':_0x4c70b9})['then'](function(){if(!_[_0x44d9('0x91')](_0xf78b36)){return _0x151ecf[_0x44d9('0x92')](_0xf78b36,{'transaction':_0x4c70b9});}})[_0x44d9('0x37')](function(){_0xf78b36[_0x44d9('0x93')](function(_0x4c958e){socket[_0x44d9('0x7c')](_0x44d9('0x94'),{'UserId':_0x4c958e,'ChatQueueId':_0x151ecf['id']});});});});});});})[_0x44d9('0x37')](respondWithStatusCode(_0x496f80,null))['catch'](handleError(_0x496f80,null));};exports[_0x44d9('0x95')]=function(_0x311fbe,_0x849095,_0x475519){return db[_0x44d9('0x3e')]['find']({'where':{'id':_0x311fbe[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x849095,null))[_0x44d9('0x37')](function(_0x27223f){if(_0x27223f){return _0x27223f[_0x44d9('0x95')](_0x311fbe[_0x44d9('0x5d')][_0x44d9('0x7f')],_['omit'](_0x311fbe[_0x44d9('0x5d')],['ids','id'])||{})[_0x44d9('0x96')](function(_0x39f12c){for(var _0x4b84cf=0x0;_0x4b84cf<_0x311fbe[_0x44d9('0x5d')][_0x44d9('0x7f')]['length'];_0x4b84cf+=0x1){socket[_0x44d9('0x7c')](_0x44d9('0x7d'),{'UserId':_0x311fbe[_0x44d9('0x5d')][_0x44d9('0x7f')][_0x4b84cf],'ChatQueueId':_0x311fbe[_0x44d9('0x58')]['id']});}return _0x39f12c;});}})[_0x44d9('0x37')](respondWithResult(_0x849095,null))['catch'](handleError(_0x849095,null));};exports['removeAgents']=function(_0x45f726,_0x2cd337,_0xdb0f28){return db[_0x44d9('0x3e')][_0x44d9('0x65')]({'where':{'id':_0x45f726['params']['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x2cd337,null))[_0x44d9('0x37')](function(_0x502118){if(_0x502118){return _0x502118[_0x44d9('0x92')](_0x45f726[_0x44d9('0x42')][_0x44d9('0x7f')])[_0x44d9('0x37')](function(){if(_[_0x44d9('0x97')](_0x45f726[_0x44d9('0x42')][_0x44d9('0x7f')])){for(var _0x3f051a=0x0;_0x3f051a<_0x45f726[_0x44d9('0x42')][_0x44d9('0x7f')][_0x44d9('0x5a')];_0x3f051a+=0x1){socket[_0x44d9('0x7c')](_0x44d9('0x94'),{'UserId':Number(_0x45f726['query'][_0x44d9('0x7f')][_0x3f051a]),'ChatQueueId':Number(_0x45f726[_0x44d9('0x58')]['id'])});}}else{socket['emit'](_0x44d9('0x94'),{'UserId':Number(_0x45f726['query']['ids']),'ChatQueueId':Number(_0x45f726[_0x44d9('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x2cd337,null))[_0x44d9('0x2c')](handleError(_0x2cd337,null));};exports[_0x44d9('0x98')]=function(_0x4cca51,_0x14106a,_0x16f646){var _0x4842e7={};var _0x276197={};var _0x2acbfb;var _0x3895dc;return db['ChatQueue']['findOne']({'where':{'id':_0x4cca51[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x14106a,null))[_0x44d9('0x37')](function(_0x32e826){if(_0x32e826){_0x2acbfb=_0x32e826;_0x276197['model']=_[_0x44d9('0x41')](db[_0x44d9('0x75')][_0x44d9('0x3f')]);_0x276197[_0x44d9('0x42')]=_[_0x44d9('0x41')](_0x4cca51[_0x44d9('0x42')]);_0x276197[_0x44d9('0x59')]=_[_0x44d9('0x43')](_0x276197[_0x44d9('0x40')],_0x276197[_0x44d9('0x42')]);_0x4842e7['attributes']=_[_0x44d9('0x43')](_0x276197[_0x44d9('0x40')],qs[_0x44d9('0x45')](_0x4cca51['query']['fields']));_0x4842e7['attributes']=_0x4842e7[_0x44d9('0x44')][_0x44d9('0x5a')]?_0x4842e7[_0x44d9('0x44')]:_0x276197[_0x44d9('0x40')];_0x4842e7[_0x44d9('0x47')]=qs['sort'](_0x4cca51[_0x44d9('0x42')][_0x44d9('0x48')]);_0x4842e7['where']=qs['filters'](_[_0x44d9('0x4a')](_0x4cca51[_0x44d9('0x42')],_0x276197['filters']));if(_0x4cca51[_0x44d9('0x42')][_0x44d9('0x4b')]){_0x4842e7['where']=_[_0x44d9('0x51')](_0x4842e7[_0x44d9('0x49')],{'$or':_['map'](_0x4842e7[_0x44d9('0x44')],function(_0x1fc56a){var _0x4008f5={};_0x4008f5[_0x1fc56a]={'$like':'%'+_0x4cca51[_0x44d9('0x42')][_0x44d9('0x4b')]+'%'};return _0x4008f5;})});}_0x4842e7=_[_0x44d9('0x51')]({},_0x4842e7,_0x4cca51[_0x44d9('0x52')]);return _0x2acbfb[_0x44d9('0x98')](_0x4842e7);}})[_0x44d9('0x37')](function(_0x5ac316){if(_0x5ac316){_0x3895dc=_0x5ac316[_0x44d9('0x5a')];if(!_0x4cca51[_0x44d9('0x42')][_0x44d9('0x46')](_0x44d9('0x68'))){_0x4842e7[_0x44d9('0x30')]=qs[_0x44d9('0x30')](_0x4cca51[_0x44d9('0x42')][_0x44d9('0x30')]);_0x4842e7[_0x44d9('0x2f')]=qs[_0x44d9('0x2f')](_0x4cca51[_0x44d9('0x42')][_0x44d9('0x2f')]);}return _0x2acbfb[_0x44d9('0x98')](_0x4842e7);}})[_0x44d9('0x37')](function(_0x2d2832){if(_0x2d2832){return _0x2d2832?{'count':_0x3895dc,'rows':_0x2d2832}:null;}})['then'](respondWithResult(_0x14106a,null))[_0x44d9('0x2c')](handleError(_0x14106a,null));};
\ No newline at end of file
+var _0x2457=['map','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','addTeams','teams','Agents','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','removeAgents','userChatQueue:remove','addAgents','userChatQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','json','count','offset','Content-Range','apply','reject','save','then','get','ChatQueues','UserProfileResource','destroy','stack','name','send','ChatQueue','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','pick','filter','where','merge','type','key','VIRTUAL','field','options','include','catch','show','length','includeAll','create','body','user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserChatQueue','order','sort','ChatQueueId'];(function(_0x178221,_0x2f8ff9){var _0x47f8ac=function(_0x56f4ee){while(--_0x56f4ee){_0x178221['push'](_0x178221['shift']());}};_0x47f8ac(++_0x2f8ff9);}(_0x2457,0xc4));var _0x7245=function(_0x4439c8,_0x519537){_0x4439c8=_0x4439c8-0x0;var _0x27df09=_0x2457[_0x4439c8];return _0x27df09;};'use strict';var pdf=require(_0x7245('0x0'));var emlformat=require(_0x7245('0x1'));var rimraf=require(_0x7245('0x2'));var zipdir=require(_0x7245('0x3'));var jsonpatch=require(_0x7245('0x4'));var rp=require(_0x7245('0x5'));var moment=require(_0x7245('0x6'));var BPromise=require(_0x7245('0x7'));var Mustache=require(_0x7245('0x8'));var util=require(_0x7245('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x7245('0xa'));var ejs=require(_0x7245('0xb'));var fs=require('fs');var _=require(_0x7245('0xc'));var squel=require(_0x7245('0xd'));var crypto=require(_0x7245('0xe'));var jsforce=require(_0x7245('0xf'));var deskjs=require(_0x7245('0x10'));var toCsv=require(_0x7245('0xa'));var querystring=require(_0x7245('0x11'));var Papa=require(_0x7245('0x12'));var Redis=require(_0x7245('0x13'));var authService=require(_0x7245('0x14'));var qs=require(_0x7245('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7245('0x16'))(_0x7245('0x17'));var utils=require(_0x7245('0x18'));var config=require('../../config/environment');var db=require(_0x7245('0x19'))['db'];config['redis']=_['defaults'](config[_0x7245('0x1a')],{'host':_0x7245('0x1b'),'port':0x18eb});var socket=require(_0x7245('0x1c'))(new Redis(config[_0x7245('0x1a')]));require(_0x7245('0x1d'))[_0x7245('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7245('0x1f')][_0x7245('0x20')]({'port':0x232a});function checkPasswordPattern(_0x1f5767,_0x229fd3,_0xe1c7df){if(_0xe1c7df){var _0x5acbb4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5acbb4['test'](_0x229fd3)){return _0x1f5767;}else{throw new Error(_0x7245('0x21'));}}else{return _0x1f5767;}}function respondWithRpcPromise(_0x4f2c9f,_0x5024de,_0x16a48c,_0x366e81){return new BPromise(function(_0x4d9f17,_0x3b8a01){var _0x573f22=_0x366e81||client;return _0x573f22[_0x7245('0x22')](_0x4f2c9f,_0x16a48c)['then'](function(_0x3e287d){logger[_0x7245('0x23')](_0x7245('0x24'),_0x5024de,_0x7245('0x25'));logger['debug'](_0x7245('0x26'),_0x5024de,'request\x20sent',JSON[_0x7245('0x27')](_0x3e287d));if(_0x3e287d[_0x7245('0x28')]){if(_0x3e287d[_0x7245('0x28')]['code']===0x1f4){logger[_0x7245('0x28')](_0x7245('0x24'),_0x5024de,_0x3e287d[_0x7245('0x28')][_0x7245('0x29')]);return _0x3b8a01(_0x3e287d['error']['message']);}logger[_0x7245('0x28')](_0x7245('0x24'),_0x5024de,_0x3e287d[_0x7245('0x28')]['message']);return _0x4d9f17(_0x3e287d[_0x7245('0x28')][_0x7245('0x29')]);}else{logger[_0x7245('0x23')](_0x7245('0x24'),_0x5024de,_0x7245('0x25'));_0x4d9f17(_0x3e287d[_0x7245('0x2a')]['message']);}})['catch'](function(_0x44cae5){logger['error'](_0x7245('0x24'),_0x5024de,_0x44cae5);_0x3b8a01(_0x44cae5);});});}function respondWithStatusCode(_0x196dd2,_0x429811){_0x429811=_0x429811||0xcc;return function(_0x5cd64c){if(_0x5cd64c){return _0x196dd2[_0x7245('0x2b')](_0x429811);}return _0x196dd2[_0x7245('0x2c')](_0x429811)['end']();};}function respondWithResult(_0xa66b56,_0x2700c9){_0x2700c9=_0x2700c9||0xc8;return function(_0x1a8cb7){if(_0x1a8cb7){return _0xa66b56['status'](_0x2700c9)[_0x7245('0x2d')](_0x1a8cb7);}};}function respondWithFilteredResult(_0x7e7993,_0x31cf79){return function(_0x328019){if(_0x328019){var _0xb44c3c=_0x328019[_0x7245('0x2e')],_0x140420=_0x31cf79[_0x7245('0x2f')],_0x300e78=_0x31cf79['offset']+_0x31cf79['limit'],_0x51891b;if(_0x300e78>=_0xb44c3c){_0x300e78=_0xb44c3c;_0x51891b=0xc8;}else{_0x51891b=0xce;}_0x7e7993[_0x7245('0x2c')](_0x51891b);return _0x7e7993['set'](_0x7245('0x30'),_0x140420+'-'+_0x300e78+'/'+_0xb44c3c)[_0x7245('0x2d')](_0x328019);}return null;};}function patchUpdates(_0xa41956){return function(_0x294e30){try{jsonpatch[_0x7245('0x31')](_0x294e30,_0xa41956,!![]);}catch(_0x237206){return BPromise[_0x7245('0x32')](_0x237206);}return _0x294e30[_0x7245('0x33')]();};}function saveUpdates(_0x5b0207,_0xeb2475){return function(_0x4891b2){if(_0x4891b2){return _0x4891b2['update'](_0x5b0207)[_0x7245('0x34')](function(_0x580220){return _0x580220;});}return null;};}function removeEntity(_0x4485dc,_0x36e041){return function(_0x5752b2){if(_0x5752b2){return _0x5752b2['destroy']()['then'](function(){var _0x402b8e=_0x5752b2[_0x7245('0x35')]({'plain':!![]});var _0x16cc55=_0x7245('0x36');return db[_0x7245('0x37')][_0x7245('0x38')]({'where':{'type':_0x16cc55,'resourceId':_0x402b8e['id']}})[_0x7245('0x34')](function(){return _0x5752b2;});})['then'](function(){_0x4485dc[_0x7245('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b6da7,_0x5c9a7c){return function(_0x5762b1){if(!_0x5762b1){_0x1b6da7['sendStatus'](0x194);}return _0x5762b1;};}function handleError(_0xbbd8e2,_0x33cbbf){_0x33cbbf=_0x33cbbf||0x1f4;return function(_0x56da3c){logger[_0x7245('0x28')](_0x56da3c[_0x7245('0x39')]);if(_0x56da3c[_0x7245('0x3a')]){delete _0x56da3c[_0x7245('0x3a')];}_0xbbd8e2[_0x7245('0x2c')](_0x33cbbf)[_0x7245('0x3b')](_0x56da3c);};}exports['index']=function(_0x67935,_0x51d170){var _0x4fbdf2={},_0x497359={},_0x1bc073={'count':0x0,'rows':[]};var _0xa297e7=db[_0x7245('0x3c')][_0x7245('0x3d')];_0x497359['model']=_[_0x7245('0x3e')](_0xa297e7);_0x497359['query']=_['keys'](_0x67935[_0x7245('0x3f')]);_0x497359[_0x7245('0x40')]=_[_0x7245('0x41')](_0x497359[_0x7245('0x42')],_0x497359[_0x7245('0x3f')]);_0x4fbdf2[_0x7245('0x43')]=_['intersection'](_0x497359[_0x7245('0x42')],qs[_0x7245('0x44')](_0x67935[_0x7245('0x3f')][_0x7245('0x44')]));_0x4fbdf2[_0x7245('0x43')]=_0x4fbdf2[_0x7245('0x43')]['length']?_0x4fbdf2[_0x7245('0x43')]:_0x497359['model'];if(!_0x67935[_0x7245('0x3f')][_0x7245('0x45')](_0x7245('0x46'))){_0x4fbdf2[_0x7245('0x47')]=qs[_0x7245('0x47')](_0x67935[_0x7245('0x3f')][_0x7245('0x47')]);_0x4fbdf2[_0x7245('0x2f')]=qs[_0x7245('0x2f')](_0x67935['query'][_0x7245('0x2f')]);}_0x4fbdf2['order']=qs['sort'](_0x67935['query']['sort']);_0x4fbdf2['where']=qs[_0x7245('0x40')](_[_0x7245('0x48')](_0x67935[_0x7245('0x3f')],_0x497359[_0x7245('0x40')]));if(_0x67935[_0x7245('0x3f')][_0x7245('0x49')]){_0x4fbdf2[_0x7245('0x4a')]=_[_0x7245('0x4b')](_0x4fbdf2[_0x7245('0x4a')],{'$or':_['map'](_0xa297e7,function(_0x8af16f){if(_0x8af16f[_0x7245('0x4c')][_0x7245('0x4d')]!==_0x7245('0x4e')){var _0x3c7e20={};_0x3c7e20[_0x8af16f[_0x7245('0x4f')]]={'$like':'%'+_0x67935[_0x7245('0x3f')][_0x7245('0x49')]+'%'};return _0x3c7e20;}})});}_0x4fbdf2=_[_0x7245('0x4b')]({},_0x4fbdf2,_0x67935[_0x7245('0x50')]);var _0x3ec319={'where':_0x4fbdf2[_0x7245('0x4a')]};return db[_0x7245('0x3c')][_0x7245('0x2e')](_0x3ec319)[_0x7245('0x34')](function(_0x3ca403){_0x1bc073['count']=_0x3ca403;if(_0x67935[_0x7245('0x3f')]['includeAll']){_0x4fbdf2[_0x7245('0x51')]=[{'all':!![]}];}return db[_0x7245('0x3c')]['findAll'](_0x4fbdf2);})['then'](function(_0x218ff2){_0x1bc073['rows']=_0x218ff2;return _0x1bc073;})[_0x7245('0x34')](respondWithFilteredResult(_0x51d170,_0x4fbdf2))[_0x7245('0x52')](handleError(_0x51d170,null));};exports[_0x7245('0x53')]=function(_0x5c22b6,_0x1d94c5){var _0x5b04e7={'raw':!![],'where':{'id':_0x5c22b6['params']['id']}},_0x3c82a3={};_0x3c82a3[_0x7245('0x42')]=_['keys'](db['ChatQueue'][_0x7245('0x3d')]);_0x3c82a3['query']=_[_0x7245('0x3e')](_0x5c22b6[_0x7245('0x3f')]);_0x3c82a3[_0x7245('0x40')]=_[_0x7245('0x41')](_0x3c82a3['model'],_0x3c82a3['query']);_0x5b04e7[_0x7245('0x43')]=_[_0x7245('0x41')](_0x3c82a3[_0x7245('0x42')],qs[_0x7245('0x44')](_0x5c22b6[_0x7245('0x3f')][_0x7245('0x44')]));_0x5b04e7[_0x7245('0x43')]=_0x5b04e7[_0x7245('0x43')][_0x7245('0x54')]?_0x5b04e7['attributes']:_0x3c82a3[_0x7245('0x42')];if(_0x5c22b6[_0x7245('0x3f')][_0x7245('0x55')]){_0x5b04e7[_0x7245('0x51')]=[{'all':!![]}];}_0x5b04e7=_['merge']({},_0x5b04e7,_0x5c22b6['options']);return db[_0x7245('0x3c')]['find'](_0x5b04e7)['then'](handleEntityNotFound(_0x1d94c5,null))[_0x7245('0x34')](respondWithResult(_0x1d94c5,null))[_0x7245('0x52')](handleError(_0x1d94c5,null));};exports['create']=function(_0x466d04,_0x2f8456){return db['ChatQueue'][_0x7245('0x56')](_0x466d04[_0x7245('0x57')],{})['then'](function(_0xfad74e){var _0x2c4914=_0x466d04[_0x7245('0x58')][_0x7245('0x35')]({'plain':!![]});if(!_0x2c4914)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c4914[_0x7245('0x59')]===_0x7245('0x58')){var _0x1849a2=_0xfad74e[_0x7245('0x35')]({'plain':!![]});var _0x3bf78b='ChatQueues';return db['UserProfileSection'][_0x7245('0x5a')]({'where':{'name':_0x3bf78b,'userProfileId':_0x2c4914['userProfileId']},'raw':!![]})[_0x7245('0x34')](function(_0x4dfdaa){if(_0x4dfdaa&&_0x4dfdaa[_0x7245('0x5b')]===0x0){return db[_0x7245('0x37')][_0x7245('0x56')]({'name':_0x1849a2[_0x7245('0x3a')],'resourceId':_0x1849a2['id'],'type':_0x4dfdaa[_0x7245('0x3a')],'sectionId':_0x4dfdaa['id']},{})[_0x7245('0x34')](function(){return _0xfad74e;});}else{return _0xfad74e;}})[_0x7245('0x52')](function(_0x2f9939){logger[_0x7245('0x28')](_0x7245('0x5c'),_0x2f9939);throw _0x2f9939;});}return _0xfad74e;})[_0x7245('0x34')](respondWithResult(_0x2f8456,0xc9))[_0x7245('0x52')](handleError(_0x2f8456,null));};exports[_0x7245('0x5d')]=function(_0x1eca42,_0x4d6400){if(_0x1eca42['body']['id']){delete _0x1eca42[_0x7245('0x57')]['id'];}return db[_0x7245('0x3c')][_0x7245('0x5a')]({'where':{'id':_0x1eca42[_0x7245('0x5e')]['id']}})[_0x7245('0x34')](handleEntityNotFound(_0x4d6400,null))[_0x7245('0x34')](saveUpdates(_0x1eca42[_0x7245('0x57')],null))['then'](respondWithResult(_0x4d6400,null))[_0x7245('0x52')](handleError(_0x4d6400,null));};exports[_0x7245('0x38')]=function(_0x515ccf,_0x1dedea){return db[_0x7245('0x3c')][_0x7245('0x5a')]({'where':{'id':_0x515ccf[_0x7245('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1dedea,null))[_0x7245('0x34')](removeEntity(_0x1dedea,null))[_0x7245('0x52')](handleError(_0x1dedea,null));};exports[_0x7245('0x5f')]=function(_0x1d3302,_0x1fabd7){return db['ChatQueue'][_0x7245('0x5f')]()[_0x7245('0x34')](respondWithResult(_0x1fabd7,null))[_0x7245('0x52')](handleError(_0x1fabd7,null));};exports[_0x7245('0x60')]=function(_0x5249aa,_0x3d35bb,_0x2b9650){var _0x273697={'raw':!![],'where':{}},_0x299dbd={},_0x5a551d;return db[_0x7245('0x3c')][_0x7245('0x61')]({'where':{'id':_0x5249aa[_0x7245('0x5e')]['id']}})[_0x7245('0x34')](handleEntityNotFound(_0x3d35bb,null))[_0x7245('0x34')](function(_0x2a5fb4){if(_0x2a5fb4){_0x5a551d=_0x2a5fb4['get']({'plain':!![]});_0x299dbd[_0x7245('0x42')]=_[_0x7245('0x3e')](db[_0x7245('0x62')][_0x7245('0x3d')]);_0x299dbd[_0x7245('0x3f')]=_[_0x7245('0x3e')](_0x5249aa[_0x7245('0x3f')]);_0x299dbd['filters']=_[_0x7245('0x41')](_0x299dbd[_0x7245('0x42')],_0x299dbd[_0x7245('0x3f')]);_0x273697[_0x7245('0x43')]=_[_0x7245('0x41')](_0x299dbd[_0x7245('0x42')],qs[_0x7245('0x44')](_0x5249aa[_0x7245('0x3f')][_0x7245('0x44')]));_0x273697['attributes']=_0x273697[_0x7245('0x43')]['length']?_0x273697[_0x7245('0x43')]:_0x299dbd[_0x7245('0x42')];if(!_0x5249aa[_0x7245('0x3f')][_0x7245('0x45')](_0x7245('0x46'))){_0x273697['limit']=qs[_0x7245('0x47')](_0x5249aa[_0x7245('0x3f')][_0x7245('0x47')]);_0x273697[_0x7245('0x2f')]=qs['offset'](_0x5249aa[_0x7245('0x3f')][_0x7245('0x2f')]);}_0x273697[_0x7245('0x63')]=qs[_0x7245('0x64')](_0x5249aa[_0x7245('0x3f')][_0x7245('0x64')]);_0x273697[_0x7245('0x4a')]=qs[_0x7245('0x40')](_['pick'](_0x5249aa[_0x7245('0x3f')],_0x299dbd[_0x7245('0x40')]));_0x273697[_0x7245('0x4a')][_0x7245('0x65')]=_0x2a5fb4['id'];if(_0x5249aa[_0x7245('0x3f')]['filter']){_0x273697[_0x7245('0x4a')]=_[_0x7245('0x4b')](_0x273697[_0x7245('0x4a')],{'$or':_[_0x7245('0x66')](_0x273697['attributes'],function(_0x3566fa){var _0x5e10e9={};_0x5e10e9[_0x3566fa]={'$like':'%'+_0x5249aa[_0x7245('0x3f')][_0x7245('0x49')]+'%'};return _0x5e10e9;})});}_0x273697=_[_0x7245('0x4b')]({},_0x273697,_0x5249aa[_0x7245('0x50')]);return db['UserChatQueue'][_0x7245('0x67')](_0x273697);}})[_0x7245('0x34')](function(_0x2725ab){if(_0x2725ab){return db[_0x7245('0x68')][_0x7245('0x69')]({'where':{'id':_[_0x7245('0x66')](_0x2725ab,_0x7245('0x6a')),'role':_0x7245('0x6b')},'attributes':['id',_0x7245('0x3a'),_0x7245('0x6c'),_0x7245('0x6d'),_0x7245('0x6e')]});}})['then'](function(_0x2422b8){if(_0x2422b8){return{'count':_0x2422b8[_0x7245('0x2e')],'rows':_[_0x7245('0x66')](_0x2422b8[_0x7245('0x6f')],function(_0x5bb5e2){return{'membername':_0x5bb5e2[_0x7245('0x3a')],'UserId':_0x5bb5e2['id'],'queue_name':_0x5a551d['name'],'ChatQueueId':_0x5a551d['id'],'interface':util[_0x7245('0x70')](_0x7245('0x71'),'SIP',_0x5bb5e2[_0x7245('0x3a')]),'penalty':0x0,'paused':_0x5bb5e2['chatPause'],'createdAt':_0x5bb5e2[_0x7245('0x6e')],'updatedAt':_0x5bb5e2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7245('0x34')](respondWithFilteredResult(_0x3d35bb,_0x273697))['catch'](handleError(_0x3d35bb,null));};exports[_0x7245('0x72')]=function(_0x3773c,_0x59fff,_0x2dfa70){var _0x37c3e1={};var _0x1c6625={};var _0xc2ce8e;var _0x47378b;return db[_0x7245('0x3c')]['findOne']({'where':{'id':_0x3773c[_0x7245('0x5e')]['id']}})[_0x7245('0x34')](handleEntityNotFound(_0x59fff,null))['then'](function(_0x5725a4){if(_0x5725a4){_0xc2ce8e=_0x5725a4;_0x1c6625[_0x7245('0x42')]=_['keys'](db[_0x7245('0x73')][_0x7245('0x3d')]);_0x1c6625[_0x7245('0x3f')]=_['keys'](_0x3773c[_0x7245('0x3f')]);_0x1c6625[_0x7245('0x40')]=_[_0x7245('0x41')](_0x1c6625[_0x7245('0x42')],_0x1c6625[_0x7245('0x3f')]);_0x37c3e1[_0x7245('0x43')]=_['intersection'](_0x1c6625['model'],qs[_0x7245('0x44')](_0x3773c['query']['fields']));_0x37c3e1[_0x7245('0x43')]=_0x37c3e1[_0x7245('0x43')][_0x7245('0x54')]?_0x37c3e1[_0x7245('0x43')]:_0x1c6625[_0x7245('0x42')];_0x37c3e1[_0x7245('0x63')]=qs[_0x7245('0x64')](_0x3773c[_0x7245('0x3f')]['sort']);_0x37c3e1[_0x7245('0x4a')]=qs[_0x7245('0x40')](_[_0x7245('0x48')](_0x3773c['query'],_0x1c6625[_0x7245('0x40')]));if(_0x3773c[_0x7245('0x3f')][_0x7245('0x49')]){_0x37c3e1[_0x7245('0x4a')]=_[_0x7245('0x4b')](_0x37c3e1[_0x7245('0x4a')],{'$or':_[_0x7245('0x66')](_0x37c3e1['attributes'],function(_0x58460f){var _0xbe6966={};_0xbe6966[_0x58460f]={'$like':'%'+_0x3773c['query'][_0x7245('0x49')]+'%'};return _0xbe6966;})});}_0x37c3e1=_[_0x7245('0x4b')]({},_0x37c3e1,_0x3773c['options']);return _0xc2ce8e['getTeams'](_0x37c3e1);}})['then'](function(_0x330a47){if(_0x330a47){_0x47378b=_0x330a47['length'];if(!_0x3773c[_0x7245('0x3f')][_0x7245('0x45')]('nolimit')){_0x37c3e1[_0x7245('0x47')]=qs[_0x7245('0x47')](_0x3773c[_0x7245('0x3f')][_0x7245('0x47')]);_0x37c3e1[_0x7245('0x2f')]=qs[_0x7245('0x2f')](_0x3773c[_0x7245('0x3f')][_0x7245('0x2f')]);}return _0xc2ce8e[_0x7245('0x72')](_0x37c3e1);}})[_0x7245('0x34')](function(_0x5e2d5a){if(_0x5e2d5a){return _0x5e2d5a?{'count':_0x47378b,'rows':_0x5e2d5a}:null;}})[_0x7245('0x34')](respondWithResult(_0x59fff,null))[_0x7245('0x52')](handleError(_0x59fff,null));};exports[_0x7245('0x74')]=function(_0x4725f6,_0x404989,_0x4b8f08){var _0x5234a0=_0x4725f6[_0x7245('0x57')][_0x7245('0x75')];return db[_0x7245('0x73')]['findAll']({'where':{'id':_[_0x7245('0x66')](_0x5234a0,'id')},'attributes':['id'],'include':[{'model':db[_0x7245('0x68')],'as':_0x7245('0x76'),'attributes':['id','name','online','voicePause','interface'],'raw':!![]}]})[_0x7245('0x34')](function(_0x366401){if(_0x366401){var _0x417cb7=_[_0x7245('0x77')](_0x366401,function(_0x5163c8){var _0x287af7=_0x5163c8[_0x7245('0x35')]({'plain':!![]});return _0x287af7[_0x7245('0x76')];});return db[_0x7245('0x3c')][_0x7245('0x5a')]({'where':{'id':_0x4725f6[_0x7245('0x5e')]['id']}})[_0x7245('0x34')](function(_0x114cbe){return db['sequelize'][_0x7245('0x78')](function(_0x50087f){return _0x114cbe[_0x7245('0x74')](_[_0x7245('0x66')](_0x5234a0,'id'),{'transaction':_0x50087f})[_0x7245('0x34')](function(){return BPromise[_0x7245('0x79')](_0x417cb7,function(_0x4036ba){return db[_0x7245('0x62')][_0x7245('0x7a')]({'where':{'UserId':_0x4036ba['id'],'ChatQueueId':_0x4725f6[_0x7245('0x5e')]['id']},'transaction':_0x50087f});});})[_0x7245('0x34')](function(){_0x417cb7[_0x7245('0x7b')](function(_0x957b58){socket[_0x7245('0x7c')]('userChatQueue:save',{'UserId':_0x957b58['id'],'ChatQueueId':_0x114cbe['id']});});});});});}})[_0x7245('0x34')](respondWithStatusCode(_0x404989,null))[_0x7245('0x52')](handleError(_0x404989,null));};exports[_0x7245('0x7d')]=function(_0x4673de,_0x514550,_0x32e239){return db[_0x7245('0x73')][_0x7245('0x67')]({'where':{'id':_0x4673de[_0x7245('0x3f')][_0x7245('0x7e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7245('0x76'),'attributes':['id'],'raw':!![]}]})[_0x7245('0x34')](handleEntityNotFound(_0x514550,null))[_0x7245('0x34')](function(_0x6de765){var _0x759c80=_[_0x7245('0x66')](_0x6de765,'id');var _0x48c0b6=[];var _0x4a1c1c=[];var _0x36bce7=squel['select']();_0x36bce7[_0x7245('0x4f')]('tq.TeamId')[_0x7245('0x7f')](_0x7245('0x80'),'tq')[_0x7245('0x81')](_0x7245('0x82'),'ut',_0x7245('0x83'))[_0x7245('0x4a')](_0x7245('0x84'),_0x4673de[_0x7245('0x5e')]['id']);for(var _0x551ce0=0x0;_0x551ce0<_0x6de765[_0x7245('0x54')];_0x551ce0+=0x1){let _0x5a8370=_0x6de765[_0x551ce0];for(var _0x1fae70=0x0;_0x1fae70<_0x5a8370['Agents'][_0x7245('0x54')];_0x1fae70+=0x1){let _0xa19f7e=_0x5a8370['Agents'][_0x1fae70];var _0x3a58cf=_0x36bce7['clone']();_0x3a58cf[_0x7245('0x4a')](_0x7245('0x85'),_0xa19f7e['id']);_0x4a1c1c['push'](db[_0x7245('0x86')]['query'](_0x3a58cf[_0x7245('0x87')](),{'type':db[_0x7245('0x86')][_0x7245('0x88')][_0x7245('0x89')]})[_0x7245('0x34')](function(_0x94cc33){if(_0x94cc33[_0x7245('0x54')]===0x1){return _0xa19f7e['id'];}else{var _0x228d7f=_[_0x7245('0x8a')](_[_0x7245('0x66')](_0x94cc33,_0x7245('0x8b')),function(_0x549e8a){return _[_0x7245('0x8c')](_0x759c80,_0x549e8a);});if(_0x228d7f){return _0xa19f7e['id'];}}}));}}return BPromise[_0x7245('0x8d')](_0x4a1c1c)[_0x7245('0x34')](function(_0x436b8a){_0x48c0b6=_(_0x48c0b6)[_0x7245('0x8e')](_0x436b8a)['compact']()['value']();return db['ChatQueue'][_0x7245('0x5a')]({'where':{'id':_0x4673de[_0x7245('0x5e')]['id']}})[_0x7245('0x34')](function(_0x253aaa){return db['sequelize'][_0x7245('0x78')](function(_0x538b44){return _0x253aaa[_0x7245('0x7d')](_0x4673de[_0x7245('0x3f')][_0x7245('0x7e')],{'transaction':_0x538b44})[_0x7245('0x34')](function(){if(!_['isEmpty'](_0x48c0b6)){return _0x253aaa[_0x7245('0x8f')](_0x48c0b6,{'transaction':_0x538b44});}})[_0x7245('0x34')](function(){_0x48c0b6[_0x7245('0x7b')](function(_0x5aa409){socket[_0x7245('0x7c')](_0x7245('0x90'),{'UserId':_0x5aa409,'ChatQueueId':_0x253aaa['id']});});});});});});})[_0x7245('0x34')](respondWithStatusCode(_0x514550,null))[_0x7245('0x52')](handleError(_0x514550,null));};exports['addAgents']=function(_0x2779b4,_0x154d79,_0x44c297){return db[_0x7245('0x3c')][_0x7245('0x5a')]({'where':{'id':_0x2779b4[_0x7245('0x5e')]['id']}})['then'](handleEntityNotFound(_0x154d79,null))[_0x7245('0x34')](function(_0x2c9047){if(_0x2c9047){return _0x2c9047[_0x7245('0x91')](_0x2779b4[_0x7245('0x57')][_0x7245('0x7e')],_['omit'](_0x2779b4[_0x7245('0x57')],[_0x7245('0x7e'),'id'])||{})['spread'](function(_0x133509){for(var _0x28e96c=0x0;_0x28e96c<_0x2779b4[_0x7245('0x57')][_0x7245('0x7e')][_0x7245('0x54')];_0x28e96c+=0x1){socket['emit'](_0x7245('0x92'),{'UserId':_0x2779b4[_0x7245('0x57')]['ids'][_0x28e96c],'ChatQueueId':_0x2779b4[_0x7245('0x5e')]['id']});}return _0x133509;});}})[_0x7245('0x34')](respondWithResult(_0x154d79,null))['catch'](handleError(_0x154d79,null));};exports[_0x7245('0x8f')]=function(_0x35d628,_0x1690ee,_0x477d52){return db[_0x7245('0x3c')][_0x7245('0x5a')]({'where':{'id':_0x35d628['params']['id']}})[_0x7245('0x34')](handleEntityNotFound(_0x1690ee,null))[_0x7245('0x34')](function(_0x476d09){if(_0x476d09){return _0x476d09[_0x7245('0x8f')](_0x35d628['query']['ids'])[_0x7245('0x34')](function(){if(_[_0x7245('0x93')](_0x35d628[_0x7245('0x3f')][_0x7245('0x7e')])){for(var _0xa4a067=0x0;_0xa4a067<_0x35d628[_0x7245('0x3f')][_0x7245('0x7e')]['length'];_0xa4a067+=0x1){socket[_0x7245('0x7c')]('userChatQueue:remove',{'UserId':Number(_0x35d628[_0x7245('0x3f')]['ids'][_0xa4a067]),'ChatQueueId':Number(_0x35d628[_0x7245('0x5e')]['id'])});}}else{socket[_0x7245('0x7c')](_0x7245('0x90'),{'UserId':Number(_0x35d628[_0x7245('0x3f')][_0x7245('0x7e')]),'ChatQueueId':Number(_0x35d628[_0x7245('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x1690ee,null))['catch'](handleError(_0x1690ee,null));};exports[_0x7245('0x94')]=function(_0x3f9b8e,_0x167c2f,_0x168082){var _0x40bc2d={};var _0x3db46a={};var _0x495a7c;var _0xd36a0b;return db[_0x7245('0x3c')][_0x7245('0x61')]({'where':{'id':_0x3f9b8e[_0x7245('0x5e')]['id']}})['then'](handleEntityNotFound(_0x167c2f,null))[_0x7245('0x34')](function(_0x2bb572){if(_0x2bb572){_0x495a7c=_0x2bb572;_0x3db46a[_0x7245('0x42')]=_[_0x7245('0x3e')](db['User'][_0x7245('0x3d')]);_0x3db46a[_0x7245('0x3f')]=_[_0x7245('0x3e')](_0x3f9b8e[_0x7245('0x3f')]);_0x3db46a[_0x7245('0x40')]=_[_0x7245('0x41')](_0x3db46a[_0x7245('0x42')],_0x3db46a['query']);_0x40bc2d['attributes']=_[_0x7245('0x41')](_0x3db46a[_0x7245('0x42')],qs[_0x7245('0x44')](_0x3f9b8e[_0x7245('0x3f')]['fields']));_0x40bc2d[_0x7245('0x43')]=_0x40bc2d[_0x7245('0x43')][_0x7245('0x54')]?_0x40bc2d['attributes']:_0x3db46a[_0x7245('0x42')];_0x40bc2d['order']=qs['sort'](_0x3f9b8e[_0x7245('0x3f')][_0x7245('0x64')]);_0x40bc2d[_0x7245('0x4a')]=qs[_0x7245('0x40')](_['pick'](_0x3f9b8e[_0x7245('0x3f')],_0x3db46a['filters']));if(_0x3f9b8e[_0x7245('0x3f')][_0x7245('0x49')]){_0x40bc2d[_0x7245('0x4a')]=_[_0x7245('0x4b')](_0x40bc2d[_0x7245('0x4a')],{'$or':_['map'](_0x40bc2d[_0x7245('0x43')],function(_0x1c2361){var _0x59484d={};_0x59484d[_0x1c2361]={'$like':'%'+_0x3f9b8e[_0x7245('0x3f')][_0x7245('0x49')]+'%'};return _0x59484d;})});}_0x40bc2d=_[_0x7245('0x4b')]({},_0x40bc2d,_0x3f9b8e[_0x7245('0x50')]);return _0x495a7c[_0x7245('0x94')](_0x40bc2d);}})[_0x7245('0x34')](function(_0x3e5e79){if(_0x3e5e79){_0xd36a0b=_0x3e5e79['length'];if(!_0x3f9b8e['query'][_0x7245('0x45')]('nolimit')){_0x40bc2d[_0x7245('0x47')]=qs[_0x7245('0x47')](_0x3f9b8e['query'][_0x7245('0x47')]);_0x40bc2d[_0x7245('0x2f')]=qs[_0x7245('0x2f')](_0x3f9b8e[_0x7245('0x3f')]['offset']);}return _0x495a7c[_0x7245('0x94')](_0x40bc2d);}})[_0x7245('0x34')](function(_0x325a25){if(_0x325a25){return _0x325a25?{'count':_0xd36a0b,'rows':_0x325a25}:null;}})[_0x7245('0x34')](respondWithResult(_0x167c2f,null))['catch'](handleError(_0x167c2f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 280ac5e..a7fb4f9 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 _0xf0e8=['remove','emit','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x38c8b5,_0x3dff7a){var _0x49045c=function(_0x3bf717){while(--_0x3bf717){_0x38c8b5['push'](_0x38c8b5['shift']());}};_0x49045c(++_0x3dff7a);}(_0xf0e8,0x81));var _0x8f0e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf0e8[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x8f0e('0x0'));var ChatQueue=require(_0x8f0e('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8f0e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f0e('0x3'),'afterDestroy':_0x8f0e('0x4')};function emitEvent(_0x4861aa){return function(_0x56c7c8,_0x2dc7de,_0x237856){ChatQueueEvents[_0x8f0e('0x5')](_0x4861aa+':'+_0x56c7c8['id'],_0x56c7c8);ChatQueueEvents[_0x8f0e('0x5')](_0x4861aa,_0x56c7c8);_0x237856(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x8f0e('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0xa664=['../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa664,0x132));var _0x4a66=function(_0x26a8d3,_0x3dcea7){_0x26a8d3=_0x26a8d3-0x0;var _0x12b695=_0xa664[_0x26a8d3];return _0x12b695;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x4a66('0x0'))['db'][_0x4a66('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4a66('0x2')](0x0);var events={'afterCreate':_0x4a66('0x3'),'afterUpdate':'update','afterDestroy':_0x4a66('0x4')};function emitEvent(_0x4d0349){return function(_0x49f17c,_0x12b396,_0x19ba72){ChatQueueEvents[_0x4a66('0x5')](_0x4d0349+':'+_0x49f17c['id'],_0x49f17c);ChatQueueEvents[_0x4a66('0x5')](_0x4d0349,_0x49f17c);_0x19ba72(null);};}for(var e in events){if(events[_0x4a66('0x6')](e)){var event=events[e];ChatQueue[_0x4a66('0x7')](e,emitEvent(event));}}module[_0x4a66('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 5fb7ce9..28e0e57 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 _0xbdeb=['api','bluebird','request-promise','path','rimraf','exports','define','util'];(function(_0x414961,_0x168280){var _0x4f2a62=function(_0x298a64){while(--_0x298a64){_0x414961['push'](_0x414961['shift']());}};_0x4f2a62(++_0x168280);}(_0xbdeb,0x6f));var _0xbbde=function(_0x568b19,_0x56e516){_0x568b19=_0x568b19-0x0;var _0x332c05=_0xbdeb[_0x568b19];return _0x332c05;};'use strict';var _=require('lodash');var util=require(_0xbbde('0x0'));var logger=require('../../config/logger')(_0xbbde('0x1'));var moment=require('moment');var BPromise=require(_0xbbde('0x2'));var rp=require(_0xbbde('0x3'));var fs=require('fs');var path=require(_0xbbde('0x4'));var rimraf=require(_0xbbde('0x5'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xbbde('0x6')]=function(_0x1d4042,_0x278651){return _0x1d4042[_0xbbde('0x7')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc06d=['bluebird','request-promise','../../config/environment','exports','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0xdda2f2,_0x227928){var _0x20e9e0=function(_0x5f3550){while(--_0x5f3550){_0xdda2f2['push'](_0xdda2f2['shift']());}};_0x20e9e0(++_0x227928);}(_0xc06d,0x15a));var _0xdc06=function(_0x30b7db,_0x38dc2a){_0x30b7db=_0x30b7db-0x0;var _0x1bc686=_0xc06d[_0x30b7db];return _0x1bc686;};'use strict';var _=require(_0xdc06('0x0'));var util=require(_0xdc06('0x1'));var logger=require(_0xdc06('0x2'))(_0xdc06('0x3'));var moment=require('moment');var BPromise=require(_0xdc06('0x4'));var rp=require(_0xdc06('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdc06('0x6'));var attributes=require('./chatQueue.attributes');module[_0xdc06('0x7')]=function(_0x2f7692,_0x5ce60c){return _0x2f7692['define'](_0xdc06('0x8'),attributes,{'tableName':_0xdc06('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index a83ef27..5d66edf 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 _0x4359=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','GetChatQueue','ChatQueue','findAll','raw','options','where','limit','include','map','model','attributes','debug','ShowChatQueue','find','catch'];(function(_0x458674,_0x3d0b84){var _0x542d8e=function(_0x2e0a14){while(--_0x2e0a14){_0x458674['push'](_0x458674['shift']());}};_0x542d8e(++_0x3d0b84);}(_0x4359,0xa4));var _0x9435=function(_0x51c8b2,_0x105c86){_0x51c8b2=_0x51c8b2-0x0;var _0x9ee93a=_0x4359[_0x51c8b2];return _0x9ee93a;};'use strict';var _=require('lodash');var util=require(_0x9435('0x0'));var moment=require('moment');var BPromise=require(_0x9435('0x1'));var rs=require(_0x9435('0x2'));var fs=require('fs');var Redis=require(_0x9435('0x3'));var db=require(_0x9435('0x4'))['db'];var utils=require(_0x9435('0x5'));var logger=require(_0x9435('0x6'))('rpc');var config=require(_0x9435('0x7'));var jayson=require(_0x9435('0x8'));var client=jayson[_0x9435('0x9')][_0x9435('0xa')]({'port':0x232a});config[_0x9435('0xb')]=_[_0x9435('0xc')](config[_0x9435('0xb')],{'host':_0x9435('0xd'),'port':0x18eb});var socket=require(_0x9435('0xe'))(new Redis(config[_0x9435('0xb')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x509a18,_0x5e9ff5,_0x53e012){return new BPromise(function(_0xd42339,_0x5b4ac6){return client[_0x9435('0xf')](_0x509a18,_0x53e012)[_0x9435('0x10')](function(_0x54fe83){logger[_0x9435('0x11')]('ChatQueue,\x20%s,\x20%s',_0x5e9ff5,_0x9435('0x12'));logger['debug'](_0x9435('0x13'),_0x5e9ff5,_0x9435('0x12'),JSON[_0x9435('0x14')](_0x54fe83));if(_0x54fe83[_0x9435('0x15')]){if(_0x54fe83['error'][_0x9435('0x16')]===0x1f4){logger[_0x9435('0x15')]('ChatQueue,\x20%s,\x20%s',_0x5e9ff5,_0x54fe83[_0x9435('0x15')][_0x9435('0x17')]);return _0x5b4ac6(_0x54fe83[_0x9435('0x15')][_0x9435('0x17')]);}logger['error'](_0x9435('0x18'),_0x5e9ff5,_0x54fe83[_0x9435('0x15')]['message']);return _0xd42339(_0x54fe83[_0x9435('0x15')][_0x9435('0x17')]);}else{logger[_0x9435('0x11')](_0x9435('0x18'),_0x5e9ff5,_0x9435('0x12'));_0xd42339(_0x54fe83[_0x9435('0x19')][_0x9435('0x17')]);}})['catch'](function(_0x4e289f){logger[_0x9435('0x15')](_0x9435('0x18'),_0x5e9ff5,_0x4e289f);_0x5b4ac6(_0x4e289f);});});}exports[_0x9435('0x1a')]=function(_0x3c0d33){var _0x1c995d=this;return new Promise(function(_0xbfd219,_0x514a5b){return db[_0x9435('0x1b')][_0x9435('0x1c')]({'raw':_0x3c0d33['options']?_0x3c0d33['options'][_0x9435('0x1d')]===undefined?!![]:![]:!![],'where':_0x3c0d33[_0x9435('0x1e')]?_0x3c0d33[_0x9435('0x1e')][_0x9435('0x1f')]||null:null,'attributes':_0x3c0d33[_0x9435('0x1e')]?_0x3c0d33[_0x9435('0x1e')]['attributes']||null:null,'limit':_0x3c0d33[_0x9435('0x1e')]?_0x3c0d33[_0x9435('0x1e')][_0x9435('0x20')]||null:null,'include':_0x3c0d33[_0x9435('0x1e')]?_0x3c0d33[_0x9435('0x1e')][_0x9435('0x21')]?_[_0x9435('0x22')](_0x3c0d33['options'][_0x9435('0x21')],function(_0xc6632){return{'model':db[_0xc6632[_0x9435('0x23')]],'as':_0xc6632['as'],'attributes':_0xc6632[_0x9435('0x24')],'include':_0xc6632[_0x9435('0x21')]?_[_0x9435('0x22')](_0xc6632[_0x9435('0x21')],function(_0xab0f42){return{'model':db[_0xab0f42[_0x9435('0x23')]],'as':_0xab0f42['as'],'attributes':_0xab0f42['attributes'],'include':_0xab0f42[_0x9435('0x21')]?_[_0x9435('0x22')](_0xab0f42['include'],function(_0x5c0f97){return{'model':db[_0x5c0f97['model']],'as':_0x5c0f97['as'],'attributes':_0x5c0f97[_0x9435('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9435('0x10')](function(_0x26b9b5){logger['info'](_0x9435('0x1a'),_0x3c0d33);logger[_0x9435('0x25')](_0x9435('0x1a'),_0x3c0d33,JSON[_0x9435('0x14')](_0x26b9b5));_0xbfd219(_0x26b9b5);})['catch'](function(_0x54c07){logger['error'](_0x9435('0x1a'),_0x54c07[_0x9435('0x17')],_0x3c0d33);_0x514a5b(_0x1c995d[_0x9435('0x15')](0x1f4,_0x54c07['message']));});});};exports[_0x9435('0x26')]=function(_0x2e213c){var _0x42f791=this;return new Promise(function(_0x305cb5,_0x145eb5){return db[_0x9435('0x1b')][_0x9435('0x27')]({'raw':_0x2e213c[_0x9435('0x1e')]?_0x2e213c[_0x9435('0x1e')][_0x9435('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e213c['options']?_0x2e213c[_0x9435('0x1e')][_0x9435('0x1f')]||null:null,'attributes':_0x2e213c[_0x9435('0x1e')]?_0x2e213c['options'][_0x9435('0x24')]||null:null,'include':_0x2e213c[_0x9435('0x1e')]?_0x2e213c[_0x9435('0x1e')][_0x9435('0x21')]?_[_0x9435('0x22')](_0x2e213c[_0x9435('0x1e')][_0x9435('0x21')],function(_0x2a663a){return{'model':db[_0x2a663a[_0x9435('0x23')]],'as':_0x2a663a['as'],'attributes':_0x2a663a[_0x9435('0x24')],'include':_0x2a663a[_0x9435('0x21')]?_[_0x9435('0x22')](_0x2a663a[_0x9435('0x21')],function(_0xc8a586){return{'model':db[_0xc8a586[_0x9435('0x23')]],'as':_0xc8a586['as'],'attributes':_0xc8a586[_0x9435('0x24')],'include':_0xc8a586[_0x9435('0x21')]?_['map'](_0xc8a586[_0x9435('0x21')],function(_0x205997){return{'model':db[_0x205997[_0x9435('0x23')]],'as':_0x205997['as'],'attributes':_0x205997[_0x9435('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9435('0x10')](function(_0x1b7d2f){logger['info']('ShowChatQueue',_0x2e213c);logger[_0x9435('0x25')]('ShowChatQueue',_0x2e213c,JSON[_0x9435('0x14')](_0x1b7d2f));_0x305cb5(_0x1b7d2f);})[_0x9435('0x28')](function(_0x3eba1b){logger[_0x9435('0x15')](_0x9435('0x26'),_0x3eba1b['message'],_0x2e213c);_0x145eb5(_0x42f791[_0x9435('0x15')](0x1f4,_0x3eba1b['message']));});});};
\ No newline at end of file
+var _0xde67=['model','attributes','GetChatQueue','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','register','request','then','info','debug','request\x20sent','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','catch','ChatQueue','findAll','options','where','limit','include','map'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0xde67,0x12d));var _0x7de6=function(_0x3f5210,_0x32f195){_0x3f5210=_0x3f5210-0x0;var _0x53c3ab=_0xde67[_0x3f5210];return _0x53c3ab;};'use strict';var _=require(_0x7de6('0x0'));var util=require(_0x7de6('0x1'));var moment=require('moment');var BPromise=require(_0x7de6('0x2'));var rs=require(_0x7de6('0x3'));var fs=require('fs');var Redis=require(_0x7de6('0x4'));var db=require(_0x7de6('0x5'))['db'];var utils=require(_0x7de6('0x6'));var logger=require('../../config/logger')(_0x7de6('0x7'));var config=require('../../config/environment');var jayson=require(_0x7de6('0x8'));var client=jayson[_0x7de6('0x9')]['http']({'port':0x232a});config[_0x7de6('0xa')]=_[_0x7de6('0xb')](config['redis'],{'host':_0x7de6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x7de6('0xd')](socket);function respondWithRpcPromise(_0x545e7c,_0x5213b0,_0x27ff4e){return new BPromise(function(_0xf90fa4,_0x11123f){return client[_0x7de6('0xe')](_0x545e7c,_0x27ff4e)[_0x7de6('0xf')](function(_0x2e59d0){logger[_0x7de6('0x10')]('ChatQueue,\x20%s,\x20%s',_0x5213b0,'request\x20sent');logger[_0x7de6('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5213b0,_0x7de6('0x12'),JSON[_0x7de6('0x13')](_0x2e59d0));if(_0x2e59d0[_0x7de6('0x14')]){if(_0x2e59d0['error']['code']===0x1f4){logger[_0x7de6('0x14')]('ChatQueue,\x20%s,\x20%s',_0x5213b0,_0x2e59d0[_0x7de6('0x14')][_0x7de6('0x15')]);return _0x11123f(_0x2e59d0[_0x7de6('0x14')]['message']);}logger[_0x7de6('0x14')](_0x7de6('0x16'),_0x5213b0,_0x2e59d0['error'][_0x7de6('0x15')]);return _0xf90fa4(_0x2e59d0[_0x7de6('0x14')][_0x7de6('0x15')]);}else{logger[_0x7de6('0x10')](_0x7de6('0x16'),_0x5213b0,'request\x20sent');_0xf90fa4(_0x2e59d0[_0x7de6('0x17')][_0x7de6('0x15')]);}})[_0x7de6('0x18')](function(_0xdc7c0c){logger['error'](_0x7de6('0x16'),_0x5213b0,_0xdc7c0c);_0x11123f(_0xdc7c0c);});});}exports['GetChatQueue']=function(_0x515212){var _0x1cdb62=this;return new Promise(function(_0x1d2233,_0x27fa35){return db[_0x7de6('0x19')][_0x7de6('0x1a')]({'raw':_0x515212[_0x7de6('0x1b')]?_0x515212[_0x7de6('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x515212['options']?_0x515212[_0x7de6('0x1b')][_0x7de6('0x1c')]||null:null,'attributes':_0x515212[_0x7de6('0x1b')]?_0x515212[_0x7de6('0x1b')]['attributes']||null:null,'limit':_0x515212[_0x7de6('0x1b')]?_0x515212[_0x7de6('0x1b')][_0x7de6('0x1d')]||null:null,'include':_0x515212[_0x7de6('0x1b')]?_0x515212[_0x7de6('0x1b')][_0x7de6('0x1e')]?_[_0x7de6('0x1f')](_0x515212[_0x7de6('0x1b')][_0x7de6('0x1e')],function(_0x51e081){return{'model':db[_0x51e081[_0x7de6('0x20')]],'as':_0x51e081['as'],'attributes':_0x51e081['attributes'],'include':_0x51e081['include']?_[_0x7de6('0x1f')](_0x51e081['include'],function(_0x145eca){return{'model':db[_0x145eca[_0x7de6('0x20')]],'as':_0x145eca['as'],'attributes':_0x145eca[_0x7de6('0x21')],'include':_0x145eca[_0x7de6('0x1e')]?_[_0x7de6('0x1f')](_0x145eca[_0x7de6('0x1e')],function(_0x760558){return{'model':db[_0x760558[_0x7de6('0x20')]],'as':_0x760558['as'],'attributes':_0x760558[_0x7de6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7de6('0xf')](function(_0x277ec8){logger['info'](_0x7de6('0x22'),_0x515212);logger[_0x7de6('0x11')]('GetChatQueue',_0x515212,JSON[_0x7de6('0x13')](_0x277ec8));_0x1d2233(_0x277ec8);})['catch'](function(_0x545118){logger[_0x7de6('0x14')](_0x7de6('0x22'),_0x545118['message'],_0x515212);_0x27fa35(_0x1cdb62[_0x7de6('0x14')](0x1f4,_0x545118[_0x7de6('0x15')]));});});};exports['ShowChatQueue']=function(_0x40afcb){var _0x5e5a1c=this;return new Promise(function(_0x45af65,_0x35c563){return db[_0x7de6('0x19')][_0x7de6('0x23')]({'raw':_0x40afcb[_0x7de6('0x1b')]?_0x40afcb[_0x7de6('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x40afcb[_0x7de6('0x1b')]?_0x40afcb[_0x7de6('0x1b')]['where']||null:null,'attributes':_0x40afcb[_0x7de6('0x1b')]?_0x40afcb[_0x7de6('0x1b')][_0x7de6('0x21')]||null:null,'include':_0x40afcb[_0x7de6('0x1b')]?_0x40afcb['options'][_0x7de6('0x1e')]?_[_0x7de6('0x1f')](_0x40afcb['options']['include'],function(_0x2c0eae){return{'model':db[_0x2c0eae['model']],'as':_0x2c0eae['as'],'attributes':_0x2c0eae[_0x7de6('0x21')],'include':_0x2c0eae[_0x7de6('0x1e')]?_[_0x7de6('0x1f')](_0x2c0eae[_0x7de6('0x1e')],function(_0x17c629){return{'model':db[_0x17c629['model']],'as':_0x17c629['as'],'attributes':_0x17c629[_0x7de6('0x21')],'include':_0x17c629[_0x7de6('0x1e')]?_[_0x7de6('0x1f')](_0x17c629[_0x7de6('0x1e')],function(_0xe1e964){return{'model':db[_0xe1e964['model']],'as':_0xe1e964['as'],'attributes':_0xe1e964[_0x7de6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7de6('0xf')](function(_0xbd828d){logger[_0x7de6('0x10')](_0x7de6('0x24'),_0x40afcb);logger['debug']('ShowChatQueue',_0x40afcb,JSON['stringify'](_0xbd828d));_0x45af65(_0xbd828d);})[_0x7de6('0x18')](function(_0x164385){logger[_0x7de6('0x14')]('ShowChatQueue',_0x164385['message'],_0x40afcb);_0x35c563(_0x5e5a1c[_0x7de6('0x14')](0x1f4,_0x164385['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index f928911..911cf6d 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 _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var ChatQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){ChatQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var ChatQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){ChatQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 02b4158..7790d20 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 _0x8836=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','/:id','update','delete','destroy','exports','multer'];(function(_0x56a758,_0x381a41){var _0x4252ef=function(_0x2757b1){while(--_0x2757b1){_0x56a758['push'](_0x56a758['shift']());}};_0x4252ef(++_0x381a41);}(_0x8836,0xc3));var _0x6883=function(_0x3a6e86,_0x504412){_0x3a6e86=_0x3a6e86-0x0;var _0x41a89c=_0x8836[_0x3a6e86];return _0x41a89c;};'use strict';var multer=require(_0x6883('0x0'));var util=require(_0x6883('0x1'));var path=require(_0x6883('0x2'));var timeout=require(_0x6883('0x3'));var express=require(_0x6883('0x4'));var router=express[_0x6883('0x5')]();var auth=require(_0x6883('0x6'));var interaction=require(_0x6883('0x7'));var config=require(_0x6883('0x8'));var controller=require(_0x6883('0x9'));router[_0x6883('0xa')]('/',auth[_0x6883('0xb')](),controller['index']);router[_0x6883('0xa')](_0x6883('0xc'),auth['isAuthenticated'](),controller[_0x6883('0xd')]);router[_0x6883('0xa')]('/:id',auth[_0x6883('0xb')](),controller[_0x6883('0xe')]);router['get'](_0x6883('0xf'),auth[_0x6883('0xb')](),controller[_0x6883('0x10')]);router[_0x6883('0xa')](_0x6883('0x11'),auth[_0x6883('0xb')](),controller['getTeams']);router[_0x6883('0xa')](_0x6883('0x12'),auth['isAuthenticated'](),controller[_0x6883('0x13')]);router[_0x6883('0x14')]('/',auth['isAuthenticated'](),controller[_0x6883('0x15')]);router[_0x6883('0x14')](_0x6883('0x11'),auth[_0x6883('0xb')](),controller['addTeams']);router[_0x6883('0x14')](_0x6883('0x12'),auth[_0x6883('0xb')](),controller[_0x6883('0x16')]);router['put'](_0x6883('0x17'),auth['isAuthenticated'](),controller[_0x6883('0x18')]);router[_0x6883('0x19')](_0x6883('0x17'),auth['isAuthenticated'](),controller[_0x6883('0x1a')]);router['delete'](_0x6883('0x11'),auth[_0x6883('0xb')](),controller['removeTeams']);router[_0x6883('0x19')](_0x6883('0x12'),auth[_0x6883('0xb')](),controller['removeAgents']);module[_0x6883('0x1b')]=router;
\ No newline at end of file
+var _0x7f64=['getAgents','post','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x7f64,0x189));var _0x47f6=function(_0x223b03,_0x4051fb){_0x223b03=_0x223b03-0x0;var _0x4c7dad=_0x7f64[_0x223b03];return _0x4c7dad;};'use strict';var multer=require('multer');var util=require(_0x47f6('0x0'));var path=require('path');var timeout=require(_0x47f6('0x1'));var express=require('express');var router=express[_0x47f6('0x2')]();var auth=require(_0x47f6('0x3'));var interaction=require(_0x47f6('0x4'));var config=require(_0x47f6('0x5'));var controller=require(_0x47f6('0x6'));router[_0x47f6('0x7')]('/',auth[_0x47f6('0x8')](),controller['index']);router[_0x47f6('0x7')](_0x47f6('0x9'),auth[_0x47f6('0x8')](),controller['describe']);router[_0x47f6('0x7')](_0x47f6('0xa'),auth[_0x47f6('0x8')](),controller['show']);router[_0x47f6('0x7')](_0x47f6('0xb'),auth[_0x47f6('0x8')](),controller['getMembers']);router[_0x47f6('0x7')](_0x47f6('0xc'),auth[_0x47f6('0x8')](),controller[_0x47f6('0xd')]);router[_0x47f6('0x7')](_0x47f6('0xe'),auth[_0x47f6('0x8')](),controller[_0x47f6('0xf')]);router[_0x47f6('0x10')]('/',auth[_0x47f6('0x8')](),controller['create']);router[_0x47f6('0x10')](_0x47f6('0xc'),auth[_0x47f6('0x8')](),controller[_0x47f6('0x11')]);router[_0x47f6('0x10')]('/:id/users',auth[_0x47f6('0x8')](),controller[_0x47f6('0x12')]);router[_0x47f6('0x13')](_0x47f6('0xa'),auth[_0x47f6('0x8')](),controller['update']);router['delete'](_0x47f6('0xa'),auth[_0x47f6('0x8')](),controller['destroy']);router[_0x47f6('0x14')](_0x47f6('0xc'),auth[_0x47f6('0x8')](),controller[_0x47f6('0x15')]);router[_0x47f6('0x14')](_0x47f6('0xe'),auth[_0x47f6('0x8')](),controller[_0x47f6('0x16')]);module[_0x47f6('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 9aff951..645aa8d 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 _0xa0c7=['DATE','moment','sequelize','exports','STRING'];(function(_0x202517,_0x47ada9){var _0x72463a=function(_0x452ad4){while(--_0x452ad4){_0x202517['push'](_0x202517['shift']());}};_0x72463a(++_0x47ada9);}(_0xa0c7,0x19b));var _0x7a0c=function(_0x498fa6,_0x52ff74){_0x498fa6=_0x498fa6-0x0;var _0x1af4d5=_0xa0c7[_0x498fa6];return _0x1af4d5;};'use strict';var moment=require(_0x7a0c('0x0'));var Sequelize=require(_0x7a0c('0x1'));module[_0x7a0c('0x2')]={'uniqueid':{'type':Sequelize[_0x7a0c('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7a0c('0x4')]},'leaveAt':{'type':Sequelize[_0x7a0c('0x4')]},'acceptAt':{'type':Sequelize[_0x7a0c('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7a0c('0x3')]}};
\ No newline at end of file
+var _0x0dac=['moment','sequelize','exports','STRING','DATE'];(function(_0x47520e,_0x197691){var _0x2bded6=function(_0x16e355){while(--_0x16e355){_0x47520e['push'](_0x47520e['shift']());}};_0x2bded6(++_0x197691);}(_0x0dac,0x1c2));var _0xc0da=function(_0x4a5d2e,_0x410443){_0x4a5d2e=_0x4a5d2e-0x0;var _0x525023=_0x0dac[_0x4a5d2e];return _0x525023;};'use strict';var moment=require(_0xc0da('0x0'));var Sequelize=require(_0xc0da('0x1'));module[_0xc0da('0x2')]={'uniqueid':{'type':Sequelize[_0xc0da('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc0da('0x3')]},'joinAt':{'type':Sequelize[_0xc0da('0x4')]},'leaveAt':{'type':Sequelize[_0xc0da('0x4')]},'acceptAt':{'type':Sequelize[_0xc0da('0x4')]},'exitAt':{'type':Sequelize[_0xc0da('0x4')]},'reason':{'type':Sequelize[_0xc0da('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 14022d6..b8d21ea 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 _0x9d5b=['params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','status','end','json','count','offset','set','reject','update','then','destroy','error','stack','name','send','ChatQueueReport','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','show'];(function(_0x3ca5df,_0x1da92f){var _0x18ba2d=function(_0x30c9dd){while(--_0x30c9dd){_0x3ca5df['push'](_0x3ca5df['shift']());}};_0x18ba2d(++_0x1da92f);}(_0x9d5b,0x198));var _0xb9d5=function(_0x10d9b3,_0x312fe9){_0x10d9b3=_0x10d9b3-0x0;var _0x779b20=_0x9d5b[_0x10d9b3];return _0x779b20;};'use strict';var pdf=require(_0xb9d5('0x0'));var emlformat=require(_0xb9d5('0x1'));var rimraf=require(_0xb9d5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb9d5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb9d5('0x4'));var util=require(_0xb9d5('0x5'));var path=require(_0xb9d5('0x6'));var sox=require(_0xb9d5('0x7'));var csv=require(_0xb9d5('0x8'));var ejs=require(_0xb9d5('0x9'));var fs=require('fs');var _=require(_0xb9d5('0xa'));var squel=require(_0xb9d5('0xb'));var crypto=require(_0xb9d5('0xc'));var jsforce=require(_0xb9d5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb9d5('0xe'));var Papa=require(_0xb9d5('0xf'));var Redis=require(_0xb9d5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb9d5('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb9d5('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x418afa,_0x2553c1){_0x2553c1=_0x2553c1||0xcc;return function(_0x80f9bd){if(_0x80f9bd){return _0x418afa['sendStatus'](_0x2553c1);}return _0x418afa[_0xb9d5('0x13')](_0x2553c1)[_0xb9d5('0x14')]();};}function respondWithResult(_0x495e58,_0x32ff1a){_0x32ff1a=_0x32ff1a||0xc8;return function(_0x70fc98){if(_0x70fc98){return _0x495e58[_0xb9d5('0x13')](_0x32ff1a)[_0xb9d5('0x15')](_0x70fc98);}};}function respondWithFilteredResult(_0x262c62,_0x5e975d){return function(_0x48f57b){if(_0x48f57b){var _0x347d04=_0x48f57b[_0xb9d5('0x16')],_0xec6bd5=_0x5e975d[_0xb9d5('0x17')],_0x5d5a32=_0x5e975d[_0xb9d5('0x17')]+_0x5e975d['limit'],_0xeccdac;if(_0x5d5a32>=_0x347d04){_0x5d5a32=_0x347d04;_0xeccdac=0xc8;}else{_0xeccdac=0xce;}_0x262c62[_0xb9d5('0x13')](_0xeccdac);return _0x262c62[_0xb9d5('0x18')]('Content-Range',_0xec6bd5+'-'+_0x5d5a32+'/'+_0x347d04)[_0xb9d5('0x15')](_0x48f57b);}return null;};}function patchUpdates(_0x3adb4f){return function(_0x2e7b2d){try{jsonpatch['apply'](_0x2e7b2d,_0x3adb4f,!![]);}catch(_0x5d2c1c){return BPromise[_0xb9d5('0x19')](_0x5d2c1c);}return _0x2e7b2d['save']();};}function saveUpdates(_0x13c0fe,_0x14e95e){return function(_0x8145ba){if(_0x8145ba){return _0x8145ba[_0xb9d5('0x1a')](_0x13c0fe)[_0xb9d5('0x1b')](function(_0x5ac3be){return _0x5ac3be;});}return null;};}function removeEntity(_0x140a0f,_0x49ca58){return function(_0x347571){if(_0x347571){return _0x347571[_0xb9d5('0x1c')]()['then'](function(){_0x140a0f[_0xb9d5('0x13')](0xcc)[_0xb9d5('0x14')]();});}};}function handleEntityNotFound(_0x2e1a60,_0x254529){return function(_0x5bca57){if(!_0x5bca57){_0x2e1a60['sendStatus'](0x194);}return _0x5bca57;};}function handleError(_0x4aa2d9,_0x2c6cc6){_0x2c6cc6=_0x2c6cc6||0x1f4;return function(_0x355e07){logger[_0xb9d5('0x1d')](_0x355e07[_0xb9d5('0x1e')]);if(_0x355e07[_0xb9d5('0x1f')]){delete _0x355e07['name'];}_0x4aa2d9[_0xb9d5('0x13')](_0x2c6cc6)[_0xb9d5('0x20')](_0x355e07);};}exports['index']=function(_0x38c225,_0x141584){var _0x4b8245={},_0x1fcb03={},_0x29b1bb={'count':0x0,'rows':[]};var _0x3cd98b=db[_0xb9d5('0x21')][_0xb9d5('0x22')];_0x1fcb03[_0xb9d5('0x23')]=_['keys'](_0x3cd98b);_0x1fcb03[_0xb9d5('0x24')]=_['keys'](_0x38c225[_0xb9d5('0x24')]);_0x1fcb03['filters']=_[_0xb9d5('0x25')](_0x1fcb03[_0xb9d5('0x23')],_0x1fcb03[_0xb9d5('0x24')]);_0x4b8245[_0xb9d5('0x26')]=_[_0xb9d5('0x25')](_0x1fcb03['model'],qs[_0xb9d5('0x27')](_0x38c225[_0xb9d5('0x24')][_0xb9d5('0x27')]));_0x4b8245['attributes']=_0x4b8245['attributes'][_0xb9d5('0x28')]?_0x4b8245[_0xb9d5('0x26')]:_0x1fcb03[_0xb9d5('0x23')];if(!_0x38c225[_0xb9d5('0x24')][_0xb9d5('0x29')]('nolimit')){_0x4b8245['limit']=qs[_0xb9d5('0x2a')](_0x38c225[_0xb9d5('0x24')]['limit']);_0x4b8245[_0xb9d5('0x17')]=qs[_0xb9d5('0x17')](_0x38c225[_0xb9d5('0x24')]['offset']);}_0x4b8245[_0xb9d5('0x2b')]=qs[_0xb9d5('0x2c')](_0x38c225[_0xb9d5('0x24')]['sort']);_0x4b8245[_0xb9d5('0x2d')]=qs[_0xb9d5('0x2e')](_[_0xb9d5('0x2f')](_0x38c225['query'],_0x1fcb03['filters']));if(_0x38c225[_0xb9d5('0x24')][_0xb9d5('0x30')]){_0x4b8245[_0xb9d5('0x2d')]=_[_0xb9d5('0x31')](_0x4b8245[_0xb9d5('0x2d')],{'$or':_[_0xb9d5('0x32')](_0x3cd98b,function(_0x367d08){if(_0x367d08[_0xb9d5('0x33')][_0xb9d5('0x34')]!=='VIRTUAL'){var _0x39384b={};_0x39384b[_0x367d08[_0xb9d5('0x35')]]={'$like':'%'+_0x38c225[_0xb9d5('0x24')]['filter']+'%'};return _0x39384b;}})});}_0x4b8245=_[_0xb9d5('0x31')]({},_0x4b8245,_0x38c225[_0xb9d5('0x36')]);var _0x264a94={'where':_0x4b8245['where']};return db['ChatQueueReport']['count'](_0x264a94)[_0xb9d5('0x1b')](function(_0x13eb4f){_0x29b1bb[_0xb9d5('0x16')]=_0x13eb4f;if(_0x38c225[_0xb9d5('0x24')][_0xb9d5('0x37')]){_0x4b8245[_0xb9d5('0x38')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xb9d5('0x39')](_0x4b8245);})[_0xb9d5('0x1b')](function(_0x35d2ec){_0x29b1bb[_0xb9d5('0x3a')]=_0x35d2ec;return _0x29b1bb;})[_0xb9d5('0x1b')](respondWithFilteredResult(_0x141584,_0x4b8245))[_0xb9d5('0x3b')](handleError(_0x141584,null));};exports[_0xb9d5('0x3c')]=function(_0x5d4c76,_0x497b0a){var _0x2f9c96={'raw':!![],'where':{'id':_0x5d4c76[_0xb9d5('0x3d')]['id']}},_0x41cdde={};_0x41cdde[_0xb9d5('0x23')]=_[_0xb9d5('0x3e')](db[_0xb9d5('0x21')][_0xb9d5('0x22')]);_0x41cdde['query']=_[_0xb9d5('0x3e')](_0x5d4c76[_0xb9d5('0x24')]);_0x41cdde[_0xb9d5('0x2e')]=_[_0xb9d5('0x25')](_0x41cdde[_0xb9d5('0x23')],_0x41cdde[_0xb9d5('0x24')]);_0x2f9c96['attributes']=_[_0xb9d5('0x25')](_0x41cdde['model'],qs[_0xb9d5('0x27')](_0x5d4c76['query'][_0xb9d5('0x27')]));_0x2f9c96[_0xb9d5('0x26')]=_0x2f9c96[_0xb9d5('0x26')]['length']?_0x2f9c96[_0xb9d5('0x26')]:_0x41cdde['model'];if(_0x5d4c76[_0xb9d5('0x24')][_0xb9d5('0x37')]){_0x2f9c96[_0xb9d5('0x38')]=[{'all':!![]}];}_0x2f9c96=_[_0xb9d5('0x31')]({},_0x2f9c96,_0x5d4c76[_0xb9d5('0x36')]);return db[_0xb9d5('0x21')][_0xb9d5('0x3f')](_0x2f9c96)[_0xb9d5('0x1b')](handleEntityNotFound(_0x497b0a,null))['then'](respondWithResult(_0x497b0a,null))[_0xb9d5('0x3b')](handleError(_0x497b0a,null));};exports[_0xb9d5('0x40')]=function(_0x4461a1,_0x802e6c){return db[_0xb9d5('0x21')][_0xb9d5('0x40')](_0x4461a1[_0xb9d5('0x41')],{})[_0xb9d5('0x1b')](respondWithResult(_0x802e6c,0xc9))[_0xb9d5('0x3b')](handleError(_0x802e6c,null));};exports[_0xb9d5('0x1a')]=function(_0x53db8d,_0x17e19b){if(_0x53db8d[_0xb9d5('0x41')]['id']){delete _0x53db8d[_0xb9d5('0x41')]['id'];}return db[_0xb9d5('0x21')][_0xb9d5('0x3f')]({'where':{'id':_0x53db8d[_0xb9d5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x17e19b,null))[_0xb9d5('0x1b')](saveUpdates(_0x53db8d[_0xb9d5('0x41')],null))[_0xb9d5('0x1b')](respondWithResult(_0x17e19b,null))[_0xb9d5('0x3b')](handleError(_0x17e19b,null));};exports[_0xb9d5('0x1c')]=function(_0x29099e,_0x3e3b07){return db['ChatQueueReport'][_0xb9d5('0x3f')]({'where':{'id':_0x29099e['params']['id']}})[_0xb9d5('0x1b')](handleEntityNotFound(_0x3e3b07,null))[_0xb9d5('0x1b')](removeEntity(_0x3e3b07,null))['catch'](handleError(_0x3e3b07,null));};exports['describe']=function(_0x47c8ea,_0x5eeacf){return db[_0xb9d5('0x21')][_0xb9d5('0x42')]()[_0xb9d5('0x1b')](respondWithResult(_0x5eeacf,null))['catch'](handleError(_0x5eeacf,null));};
\ No newline at end of file
+var _0xf6b5=['then','error','stack','name','index','ChatQueueReport','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x143cdd,_0x53e895){var _0x37a80b=function(_0x3b70d5){while(--_0x3b70d5){_0x143cdd['push'](_0x143cdd['shift']());}};_0x37a80b(++_0x53e895);}(_0xf6b5,0x6f));var _0x5f6b=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xf6b5[_0x9aada2];return _0x196dff;};'use strict';var pdf=require(_0x5f6b('0x0'));var emlformat=require(_0x5f6b('0x1'));var rimraf=require(_0x5f6b('0x2'));var zipdir=require(_0x5f6b('0x3'));var jsonpatch=require(_0x5f6b('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5f6b('0x5'));var Mustache=require(_0x5f6b('0x6'));var util=require(_0x5f6b('0x7'));var path=require('path');var sox=require(_0x5f6b('0x8'));var csv=require(_0x5f6b('0x9'));var ejs=require(_0x5f6b('0xa'));var fs=require('fs');var _=require(_0x5f6b('0xb'));var squel=require(_0x5f6b('0xc'));var crypto=require(_0x5f6b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5f6b('0xe'));var toCsv=require(_0x5f6b('0x9'));var querystring=require(_0x5f6b('0xf'));var Papa=require(_0x5f6b('0x10'));var Redis=require('ioredis');var authService=require(_0x5f6b('0x11'));var qs=require(_0x5f6b('0x12'));var hardwareService=require(_0x5f6b('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5f6b('0x14'));var config=require(_0x5f6b('0x15'));var db=require(_0x5f6b('0x16'))['db'];function respondWithStatusCode(_0x33f054,_0x4156e3){_0x4156e3=_0x4156e3||0xcc;return function(_0x3d6b77){if(_0x3d6b77){return _0x33f054[_0x5f6b('0x17')](_0x4156e3);}return _0x33f054[_0x5f6b('0x18')](_0x4156e3)[_0x5f6b('0x19')]();};}function respondWithResult(_0x46b128,_0x239d3a){_0x239d3a=_0x239d3a||0xc8;return function(_0x1556a0){if(_0x1556a0){return _0x46b128[_0x5f6b('0x18')](_0x239d3a)[_0x5f6b('0x1a')](_0x1556a0);}};}function respondWithFilteredResult(_0x5ec25e,_0x3cab71){return function(_0x4b5394){if(_0x4b5394){var _0x433d12=_0x4b5394[_0x5f6b('0x1b')],_0x2d9517=_0x3cab71[_0x5f6b('0x1c')],_0x57d64d=_0x3cab71[_0x5f6b('0x1c')]+_0x3cab71[_0x5f6b('0x1d')],_0x32798f;if(_0x57d64d>=_0x433d12){_0x57d64d=_0x433d12;_0x32798f=0xc8;}else{_0x32798f=0xce;}_0x5ec25e['status'](_0x32798f);return _0x5ec25e[_0x5f6b('0x1e')](_0x5f6b('0x1f'),_0x2d9517+'-'+_0x57d64d+'/'+_0x433d12)[_0x5f6b('0x1a')](_0x4b5394);}return null;};}function patchUpdates(_0x36ba2b){return function(_0x50f94c){try{jsonpatch[_0x5f6b('0x20')](_0x50f94c,_0x36ba2b,!![]);}catch(_0x1eb622){return BPromise[_0x5f6b('0x21')](_0x1eb622);}return _0x50f94c[_0x5f6b('0x22')]();};}function saveUpdates(_0x455df8,_0x5473e2){return function(_0x5e341e){if(_0x5e341e){return _0x5e341e['update'](_0x455df8)[_0x5f6b('0x23')](function(_0x4693cc){return _0x4693cc;});}return null;};}function removeEntity(_0x5f28a4,_0x4b3d14){return function(_0x531a0a){if(_0x531a0a){return _0x531a0a['destroy']()[_0x5f6b('0x23')](function(){_0x5f28a4[_0x5f6b('0x18')](0xcc)[_0x5f6b('0x19')]();});}};}function handleEntityNotFound(_0x1a67e3,_0x351ff6){return function(_0xb6ae48){if(!_0xb6ae48){_0x1a67e3['sendStatus'](0x194);}return _0xb6ae48;};}function handleError(_0x27f5e6,_0x551a24){_0x551a24=_0x551a24||0x1f4;return function(_0x41b7f3){logger[_0x5f6b('0x24')](_0x41b7f3[_0x5f6b('0x25')]);if(_0x41b7f3['name']){delete _0x41b7f3[_0x5f6b('0x26')];}_0x27f5e6[_0x5f6b('0x18')](_0x551a24)['send'](_0x41b7f3);};}exports[_0x5f6b('0x27')]=function(_0x34d527,_0x88ee1c){var _0x4a684b={},_0x3b6738={},_0x3eccb8={'count':0x0,'rows':[]};var _0x578819=db[_0x5f6b('0x28')][_0x5f6b('0x29')];_0x3b6738[_0x5f6b('0x2a')]=_[_0x5f6b('0x2b')](_0x578819);_0x3b6738[_0x5f6b('0x2c')]=_['keys'](_0x34d527['query']);_0x3b6738['filters']=_[_0x5f6b('0x2d')](_0x3b6738['model'],_0x3b6738['query']);_0x4a684b['attributes']=_['intersection'](_0x3b6738[_0x5f6b('0x2a')],qs[_0x5f6b('0x2e')](_0x34d527[_0x5f6b('0x2c')][_0x5f6b('0x2e')]));_0x4a684b['attributes']=_0x4a684b[_0x5f6b('0x2f')][_0x5f6b('0x30')]?_0x4a684b['attributes']:_0x3b6738[_0x5f6b('0x2a')];if(!_0x34d527['query'][_0x5f6b('0x31')](_0x5f6b('0x32'))){_0x4a684b['limit']=qs[_0x5f6b('0x1d')](_0x34d527[_0x5f6b('0x2c')]['limit']);_0x4a684b['offset']=qs[_0x5f6b('0x1c')](_0x34d527[_0x5f6b('0x2c')]['offset']);}_0x4a684b[_0x5f6b('0x33')]=qs[_0x5f6b('0x34')](_0x34d527[_0x5f6b('0x2c')]['sort']);_0x4a684b[_0x5f6b('0x35')]=qs[_0x5f6b('0x36')](_[_0x5f6b('0x37')](_0x34d527[_0x5f6b('0x2c')],_0x3b6738[_0x5f6b('0x36')]));if(_0x34d527[_0x5f6b('0x2c')][_0x5f6b('0x38')]){_0x4a684b[_0x5f6b('0x35')]=_[_0x5f6b('0x39')](_0x4a684b[_0x5f6b('0x35')],{'$or':_['map'](_0x578819,function(_0x2f0a46){if(_0x2f0a46[_0x5f6b('0x3a')][_0x5f6b('0x3b')]!==_0x5f6b('0x3c')){var _0x46e6cf={};_0x46e6cf[_0x2f0a46['field']]={'$like':'%'+_0x34d527[_0x5f6b('0x2c')][_0x5f6b('0x38')]+'%'};return _0x46e6cf;}})});}_0x4a684b=_[_0x5f6b('0x39')]({},_0x4a684b,_0x34d527[_0x5f6b('0x3d')]);var _0xc39eb4={'where':_0x4a684b['where']};return db[_0x5f6b('0x28')][_0x5f6b('0x1b')](_0xc39eb4)[_0x5f6b('0x23')](function(_0x3e1c11){_0x3eccb8[_0x5f6b('0x1b')]=_0x3e1c11;if(_0x34d527['query'][_0x5f6b('0x3e')]){_0x4a684b[_0x5f6b('0x3f')]=[{'all':!![]}];}return db[_0x5f6b('0x28')][_0x5f6b('0x40')](_0x4a684b);})[_0x5f6b('0x23')](function(_0x4a0420){_0x3eccb8[_0x5f6b('0x41')]=_0x4a0420;return _0x3eccb8;})['then'](respondWithFilteredResult(_0x88ee1c,_0x4a684b))['catch'](handleError(_0x88ee1c,null));};exports[_0x5f6b('0x42')]=function(_0x432939,_0x416b3e){var _0x26e7a7={'raw':!![],'where':{'id':_0x432939[_0x5f6b('0x43')]['id']}},_0x5a1ed2={};_0x5a1ed2['model']=_[_0x5f6b('0x2b')](db[_0x5f6b('0x28')][_0x5f6b('0x29')]);_0x5a1ed2[_0x5f6b('0x2c')]=_[_0x5f6b('0x2b')](_0x432939[_0x5f6b('0x2c')]);_0x5a1ed2['filters']=_['intersection'](_0x5a1ed2['model'],_0x5a1ed2['query']);_0x26e7a7['attributes']=_[_0x5f6b('0x2d')](_0x5a1ed2['model'],qs['fields'](_0x432939[_0x5f6b('0x2c')]['fields']));_0x26e7a7[_0x5f6b('0x2f')]=_0x26e7a7['attributes'][_0x5f6b('0x30')]?_0x26e7a7[_0x5f6b('0x2f')]:_0x5a1ed2['model'];if(_0x432939[_0x5f6b('0x2c')][_0x5f6b('0x3e')]){_0x26e7a7[_0x5f6b('0x3f')]=[{'all':!![]}];}_0x26e7a7=_[_0x5f6b('0x39')]({},_0x26e7a7,_0x432939['options']);return db['ChatQueueReport'][_0x5f6b('0x44')](_0x26e7a7)[_0x5f6b('0x23')](handleEntityNotFound(_0x416b3e,null))[_0x5f6b('0x23')](respondWithResult(_0x416b3e,null))[_0x5f6b('0x45')](handleError(_0x416b3e,null));};exports[_0x5f6b('0x46')]=function(_0x536ccc,_0xc41b41){return db[_0x5f6b('0x28')][_0x5f6b('0x46')](_0x536ccc['body'],{})[_0x5f6b('0x23')](respondWithResult(_0xc41b41,0xc9))[_0x5f6b('0x45')](handleError(_0xc41b41,null));};exports[_0x5f6b('0x47')]=function(_0xbd6f0c,_0x890bb6){if(_0xbd6f0c['body']['id']){delete _0xbd6f0c['body']['id'];}return db[_0x5f6b('0x28')][_0x5f6b('0x44')]({'where':{'id':_0xbd6f0c[_0x5f6b('0x43')]['id']}})[_0x5f6b('0x23')](handleEntityNotFound(_0x890bb6,null))[_0x5f6b('0x23')](saveUpdates(_0xbd6f0c['body'],null))['then'](respondWithResult(_0x890bb6,null))[_0x5f6b('0x45')](handleError(_0x890bb6,null));};exports['destroy']=function(_0x2e14d8,_0x7aa172){return db['ChatQueueReport'][_0x5f6b('0x44')]({'where':{'id':_0x2e14d8[_0x5f6b('0x43')]['id']}})['then'](handleEntityNotFound(_0x7aa172,null))[_0x5f6b('0x23')](removeEntity(_0x7aa172,null))['catch'](handleError(_0x7aa172,null));};exports[_0x5f6b('0x48')]=function(_0x2d3b8e,_0x3aca95){return db['ChatQueueReport'][_0x5f6b('0x48')]()['then'](respondWithResult(_0x3aca95,null))[_0x5f6b('0x45')](handleError(_0x3aca95,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index b093b41..6bc7807 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 _0x31ee=['../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x30d6f0,_0x227961){var _0x51ecad=function(_0x3392d3){while(--_0x3392d3){_0x30d6f0['push'](_0x30d6f0['shift']());}};_0x51ecad(++_0x227961);}(_0x31ee,0xac));var _0xe31e=function(_0x26cf6f,_0x86e045){_0x26cf6f=_0x26cf6f-0x0;var _0x4b9ebd=_0x31ee[_0x26cf6f];return _0x4b9ebd;};'use strict';var _=require(_0xe31e('0x0'));var util=require(_0xe31e('0x1'));var logger=require(_0xe31e('0x2'))(_0xe31e('0x3'));var moment=require(_0xe31e('0x4'));var BPromise=require(_0xe31e('0x5'));var rp=require(_0xe31e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe31e('0x7'));var config=require(_0xe31e('0x8'));var attributes=require(_0xe31e('0x9'));module[_0xe31e('0xa')]=function(_0x208010,_0x1b78b5){return _0x208010[_0xe31e('0xb')](_0xe31e('0xc'),attributes,{'tableName':_0xe31e('0xd'),'paranoid':![],'indexes':[{'name':_0xe31e('0xe'),'fields':[_0xe31e('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8334=['report_chat_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport'];(function(_0x312abc,_0x17f25c){var _0x314298=function(_0x1d2e48){while(--_0x1d2e48){_0x312abc['push'](_0x312abc['shift']());}};_0x314298(++_0x17f25c);}(_0x8334,0x1a2));var _0x4833=function(_0x77cb6a,_0x8bab8b){_0x77cb6a=_0x77cb6a-0x0;var _0x22332=_0x8334[_0x77cb6a];return _0x22332;};'use strict';var _=require(_0x4833('0x0'));var util=require(_0x4833('0x1'));var logger=require(_0x4833('0x2'))(_0x4833('0x3'));var moment=require(_0x4833('0x4'));var BPromise=require(_0x4833('0x5'));var rp=require(_0x4833('0x6'));var fs=require('fs');var path=require(_0x4833('0x7'));var rimraf=require(_0x4833('0x8'));var config=require(_0x4833('0x9'));var attributes=require(_0x4833('0xa'));module[_0x4833('0xb')]=function(_0x47c645,_0x41ab2f){return _0x47c645[_0x4833('0xc')](_0x4833('0xd'),attributes,{'tableName':_0x4833('0xe'),'paranoid':![],'indexes':[{'name':_0x4833('0xf'),'fields':[_0x4833('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index d21e2c9..0254907 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 _0x32df=['create','body','options','then','CreateChatQueueReport','ChatQueueReport','update','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','stringify','error','code','message','info','ChatQueueReport,\x20%s,\x20%s','result','catch'];(function(_0x3cd329,_0x35d2f5){var _0x1e0797=function(_0x2695a9){while(--_0x2695a9){_0x3cd329['push'](_0x3cd329['shift']());}};_0x1e0797(++_0x35d2f5);}(_0x32df,0x109));var _0xf32d=function(_0x54fd80,_0x430280){_0x54fd80=_0x54fd80-0x0;var _0x415018=_0x32df[_0x54fd80];return _0x415018;};'use strict';var _=require(_0xf32d('0x0'));var util=require('util');var moment=require(_0xf32d('0x1'));var BPromise=require(_0xf32d('0x2'));var rs=require(_0xf32d('0x3'));var fs=require('fs');var Redis=require(_0xf32d('0x4'));var db=require(_0xf32d('0x5'))['db'];var utils=require(_0xf32d('0x6'));var logger=require(_0xf32d('0x7'))(_0xf32d('0x8'));var config=require(_0xf32d('0x9'));var jayson=require(_0xf32d('0xa'));var client=jayson['client'][_0xf32d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4535b6,_0x36efae,_0x3920fb){return new BPromise(function(_0x3f7d44,_0xc7e5c8){return client[_0xf32d('0xc')](_0x4535b6,_0x3920fb)['then'](function(_0x31c47d){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x36efae,_0xf32d('0xd'));logger[_0xf32d('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x36efae,'request\x20sent',JSON[_0xf32d('0xf')](_0x31c47d));if(_0x31c47d['error']){if(_0x31c47d[_0xf32d('0x10')][_0xf32d('0x11')]===0x1f4){logger[_0xf32d('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x36efae,_0x31c47d[_0xf32d('0x10')][_0xf32d('0x12')]);return _0xc7e5c8(_0x31c47d[_0xf32d('0x10')][_0xf32d('0x12')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x36efae,_0x31c47d['error'][_0xf32d('0x12')]);return _0x3f7d44(_0x31c47d[_0xf32d('0x10')][_0xf32d('0x12')]);}else{logger[_0xf32d('0x13')](_0xf32d('0x14'),_0x36efae,_0xf32d('0xd'));_0x3f7d44(_0x31c47d[_0xf32d('0x15')][_0xf32d('0x12')]);}})[_0xf32d('0x16')](function(_0x17aa8c){logger[_0xf32d('0x10')](_0xf32d('0x14'),_0x36efae,_0x17aa8c);_0xc7e5c8(_0x17aa8c);});});}exports['CreateChatQueueReport']=function(_0x3ef6d0){var _0x1f3909=this;return new Promise(function(_0x40f0dc,_0x3dc092){return db['ChatQueueReport'][_0xf32d('0x17')](_0x3ef6d0[_0xf32d('0x18')],{'raw':_0x3ef6d0[_0xf32d('0x19')]?_0x3ef6d0['options']['raw']===undefined?!![]:![]:!![]})[_0xf32d('0x1a')](function(_0x4e0080){logger['info'](_0xf32d('0x1b'),_0x3ef6d0);logger[_0xf32d('0xe')](_0xf32d('0x1b'),_0x3ef6d0,JSON[_0xf32d('0xf')](_0x4e0080));_0x40f0dc(_0x4e0080);})[_0xf32d('0x16')](function(_0x454139){logger[_0xf32d('0x10')](_0xf32d('0x1b'),_0x454139[_0xf32d('0x12')],_0x3ef6d0);_0x3dc092(_0x1f3909['error'](0x1f4,_0x454139[_0xf32d('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x43121f){var _0x31a572=this;return new Promise(function(_0x4aa9a7,_0x3103af){return db[_0xf32d('0x1c')][_0xf32d('0x1d')](_0x43121f[_0xf32d('0x18')],{'raw':_0x43121f[_0xf32d('0x19')]?_0x43121f[_0xf32d('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43121f[_0xf32d('0x19')]?_0x43121f[_0xf32d('0x19')]['where']||null:null,'attributes':_0x43121f[_0xf32d('0x19')]?_0x43121f[_0xf32d('0x19')]['attributes']||null:null,'limit':_0x43121f['options']?_0x43121f[_0xf32d('0x19')][_0xf32d('0x1e')]||null:null})[_0xf32d('0x1a')](function(_0x5ed400){logger[_0xf32d('0x13')](_0xf32d('0x1f'),_0x43121f);logger[_0xf32d('0xe')]('UpdateChatQueueReport',_0x43121f,JSON[_0xf32d('0xf')](_0x5ed400));_0x4aa9a7(_0x5ed400);})[_0xf32d('0x16')](function(_0xa4b15b){logger[_0xf32d('0x10')](_0xf32d('0x1f'),_0xa4b15b[_0xf32d('0x12')],_0x43121f);_0x3103af(_0x31a572[_0xf32d('0x10')](0x1f4,_0xa4b15b[_0xf32d('0x12')]));});});};
\ No newline at end of file
+var _0x094e=['client','http','request','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xf364a7,_0x8eccf0){var _0x26ad04=function(_0x5cf6b4){while(--_0x5cf6b4){_0xf364a7['push'](_0xf364a7['shift']());}};_0x26ad04(++_0x8eccf0);}(_0x094e,0x9b));var _0xe094=function(_0x15b0d7,_0x1d45a6){_0x15b0d7=_0x15b0d7-0x0;var _0x2b2321=_0x094e[_0x15b0d7];return _0x2b2321;};'use strict';var _=require(_0xe094('0x0'));var util=require(_0xe094('0x1'));var moment=require(_0xe094('0x2'));var BPromise=require(_0xe094('0x3'));var rs=require(_0xe094('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe094('0x5'));var logger=require(_0xe094('0x6'))(_0xe094('0x7'));var config=require(_0xe094('0x8'));var jayson=require(_0xe094('0x9'));var client=jayson[_0xe094('0xa')][_0xe094('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f9b8a,_0x3fb9d2,_0x471c8e){return new BPromise(function(_0x509d0f,_0x3549e5){return client[_0xe094('0xc')](_0x1f9b8a,_0x471c8e)['then'](function(_0x3d4a50){logger[_0xe094('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x3fb9d2,'request\x20sent');logger[_0xe094('0xe')](_0xe094('0xf'),_0x3fb9d2,_0xe094('0x10'),JSON[_0xe094('0x11')](_0x3d4a50));if(_0x3d4a50[_0xe094('0x12')]){if(_0x3d4a50[_0xe094('0x12')]['code']===0x1f4){logger[_0xe094('0x12')](_0xe094('0x13'),_0x3fb9d2,_0x3d4a50[_0xe094('0x12')][_0xe094('0x14')]);return _0x3549e5(_0x3d4a50['error']['message']);}logger[_0xe094('0x12')](_0xe094('0x13'),_0x3fb9d2,_0x3d4a50[_0xe094('0x12')][_0xe094('0x14')]);return _0x509d0f(_0x3d4a50[_0xe094('0x12')][_0xe094('0x14')]);}else{logger[_0xe094('0xd')](_0xe094('0x13'),_0x3fb9d2,_0xe094('0x10'));_0x509d0f(_0x3d4a50[_0xe094('0x15')][_0xe094('0x14')]);}})[_0xe094('0x16')](function(_0x2257dc){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3fb9d2,_0x2257dc);_0x3549e5(_0x2257dc);});});}exports[_0xe094('0x17')]=function(_0x31d459){var _0x1612c8=this;return new Promise(function(_0x20a72c,_0x2d9c9d){return db[_0xe094('0x18')][_0xe094('0x19')](_0x31d459['body'],{'raw':_0x31d459[_0xe094('0x1a')]?_0x31d459[_0xe094('0x1a')][_0xe094('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x135329){logger['info']('CreateChatQueueReport',_0x31d459);logger[_0xe094('0xe')](_0xe094('0x17'),_0x31d459,JSON[_0xe094('0x11')](_0x135329));_0x20a72c(_0x135329);})[_0xe094('0x16')](function(_0x37d196){logger[_0xe094('0x12')](_0xe094('0x17'),_0x37d196[_0xe094('0x14')],_0x31d459);_0x2d9c9d(_0x1612c8[_0xe094('0x12')](0x1f4,_0x37d196['message']));});});};exports[_0xe094('0x1c')]=function(_0x1c77cd){var _0x3b6544=this;return new Promise(function(_0x3a50af,_0x1d4bc9){return db[_0xe094('0x18')][_0xe094('0x1d')](_0x1c77cd['body'],{'raw':_0x1c77cd[_0xe094('0x1a')]?_0x1c77cd[_0xe094('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c77cd[_0xe094('0x1a')]?_0x1c77cd[_0xe094('0x1a')][_0xe094('0x1e')]||null:null,'attributes':_0x1c77cd[_0xe094('0x1a')]?_0x1c77cd[_0xe094('0x1a')][_0xe094('0x1f')]||null:null,'limit':_0x1c77cd[_0xe094('0x1a')]?_0x1c77cd[_0xe094('0x1a')][_0xe094('0x20')]||null:null})['then'](function(_0x4b5703){logger[_0xe094('0xd')](_0xe094('0x1c'),_0x1c77cd);logger['debug'](_0xe094('0x1c'),_0x1c77cd,JSON[_0xe094('0x11')](_0x4b5703));_0x3a50af(_0x4b5703);})[_0xe094('0x16')](function(_0xf43622){logger['error'](_0xe094('0x1c'),_0xf43622['message'],_0x1c77cd);_0x1d4bc9(_0x3b6544['error'](0x1f4,_0xf43622['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 66e0054..55c09ee 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 _0x4d5e=['post','create','delete','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/:id','show'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x4d5e,0x169));var _0xe4d5=function(_0x9dc979,_0x5d3ac8){_0x9dc979=_0x9dc979-0x0;var _0x532670=_0x4d5e[_0x9dc979];return _0x532670;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe4d5('0x0'));var timeout=require(_0xe4d5('0x1'));var express=require(_0xe4d5('0x2'));var router=express[_0xe4d5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe4d5('0x4'));var config=require(_0xe4d5('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe4d5('0x6')]);router['get'](_0xe4d5('0x7'),auth[_0xe4d5('0x8')](),controller[_0xe4d5('0x9')]);router[_0xe4d5('0xa')](_0xe4d5('0xb'),auth[_0xe4d5('0x8')](),controller[_0xe4d5('0xc')]);router[_0xe4d5('0xd')]('/',auth[_0xe4d5('0x8')](),controller[_0xe4d5('0xe')]);router['put'](_0xe4d5('0xb'),auth[_0xe4d5('0x8')](),controller['update']);router[_0xe4d5('0xf')]('/:id',auth[_0xe4d5('0x8')](),controller['destroy']);module[_0xe4d5('0x10')]=router;
\ No newline at end of file
+var _0x3e27=['put','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create'];(function(_0x1d1385,_0xf41306){var _0x31467e=function(_0x492455){while(--_0x492455){_0x1d1385['push'](_0x1d1385['shift']());}};_0x31467e(++_0xf41306);}(_0x3e27,0xcc));var _0x73e2=function(_0x339517,_0x4c9eb5){_0x339517=_0x339517-0x0;var _0xd9a987=_0x3e27[_0x339517];return _0xd9a987;};'use strict';var multer=require('multer');var util=require(_0x73e2('0x0'));var path=require('path');var timeout=require(_0x73e2('0x1'));var express=require(_0x73e2('0x2'));var router=express[_0x73e2('0x3')]();var auth=require(_0x73e2('0x4'));var interaction=require(_0x73e2('0x5'));var config=require(_0x73e2('0x6'));var controller=require(_0x73e2('0x7'));router[_0x73e2('0x8')]('/',auth[_0x73e2('0x9')](),controller[_0x73e2('0xa')]);router['get'](_0x73e2('0xb'),auth['isAuthenticated'](),controller[_0x73e2('0xc')]);router[_0x73e2('0x8')](_0x73e2('0xd'),auth[_0x73e2('0x9')](),controller['show']);router[_0x73e2('0xe')]('/',auth[_0x73e2('0x9')](),controller[_0x73e2('0xf')]);router[_0x73e2('0x10')](_0x73e2('0xd'),auth[_0x73e2('0x9')](),controller[_0x73e2('0x11')]);router[_0x73e2('0x12')](_0x73e2('0xd'),auth[_0x73e2('0x9')](),controller['destroy']);module[_0x73e2('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 731e156..b93066b 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 _0x3245=['exports','STRING','ENUM','account','agent','queue','DATE','moment','sequelize'];(function(_0x11036e,_0x4e7f46){var _0x5cfc4c=function(_0x1050b7){while(--_0x1050b7){_0x11036e['push'](_0x11036e['shift']());}};_0x5cfc4c(++_0x4e7f46);}(_0x3245,0x11e));var _0x5324=function(_0x3408a7,_0x3ce209){_0x3408a7=_0x3408a7-0x0;var _0x54d552=_0x3245[_0x3408a7];return _0x54d552;};'use strict';var moment=require(_0x5324('0x0'));var Sequelize=require(_0x5324('0x1'));module[_0x5324('0x2')]={'uniqueid':{'type':Sequelize[_0x5324('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5324('0x4')](_0x5324('0x5'),_0x5324('0x6'),'queue'),'allowNull':![],'defaultValue':_0x5324('0x7')},'transferredAt':{'type':Sequelize[_0x5324('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x894a=['sequelize','exports','STRING','ENUM','agent','queue','DATE','NOW','moment'];(function(_0x3d20a3,_0x416806){var _0x44feb5=function(_0x7054bc){while(--_0x7054bc){_0x3d20a3['push'](_0x3d20a3['shift']());}};_0x44feb5(++_0x416806);}(_0x894a,0xb3));var _0xa894=function(_0x55b593,_0x398f56){_0x55b593=_0x55b593-0x0;var _0x49a32f=_0x894a[_0x55b593];return _0x49a32f;};'use strict';var moment=require(_0xa894('0x0'));var Sequelize=require(_0xa894('0x1'));module[_0xa894('0x2')]={'uniqueid':{'type':Sequelize[_0xa894('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa894('0x4')]('account',_0xa894('0x5'),_0xa894('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xa894('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xa894('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 112e331..cab3542 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 _0x042d=['merge','includeAll','rows','catch','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatTransferReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','type','key','VIRTUAL','field'];(function(_0x84ce83,_0x98461d){var _0x4490be=function(_0x3a9a69){while(--_0x3a9a69){_0x84ce83['push'](_0x84ce83['shift']());}};_0x4490be(++_0x98461d);}(_0x042d,0x12b));var _0xd042=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0x042d[_0x2390bd];return _0x3a969d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd042('0x0'));var rimraf=require(_0xd042('0x1'));var zipdir=require(_0xd042('0x2'));var jsonpatch=require(_0xd042('0x3'));var rp=require('request-promise');var moment=require(_0xd042('0x4'));var BPromise=require(_0xd042('0x5'));var Mustache=require('mustache');var util=require(_0xd042('0x6'));var path=require(_0xd042('0x7'));var sox=require(_0xd042('0x8'));var csv=require(_0xd042('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd042('0xa'));var squel=require(_0xd042('0xb'));var crypto=require(_0xd042('0xc'));var jsforce=require(_0xd042('0xd'));var deskjs=require(_0xd042('0xe'));var toCsv=require(_0xd042('0x9'));var querystring=require(_0xd042('0xf'));var Papa=require(_0xd042('0x10'));var Redis=require('ioredis');var authService=require(_0xd042('0x11'));var qs=require(_0xd042('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd042('0x13'))('api');var utils=require(_0xd042('0x14'));var config=require(_0xd042('0x15'));var db=require(_0xd042('0x16'))['db'];function respondWithStatusCode(_0x37b23e,_0x408777){_0x408777=_0x408777||0xcc;return function(_0x4629e9){if(_0x4629e9){return _0x37b23e[_0xd042('0x17')](_0x408777);}return _0x37b23e[_0xd042('0x18')](_0x408777)[_0xd042('0x19')]();};}function respondWithResult(_0x2f8648,_0x27305a){_0x27305a=_0x27305a||0xc8;return function(_0x29dac6){if(_0x29dac6){return _0x2f8648[_0xd042('0x18')](_0x27305a)['json'](_0x29dac6);}};}function respondWithFilteredResult(_0x221123,_0x22a7d6){return function(_0x64a16){if(_0x64a16){var _0xd8a61e=_0x64a16[_0xd042('0x1a')],_0x4635d5=_0x22a7d6['offset'],_0x42654e=_0x22a7d6['offset']+_0x22a7d6[_0xd042('0x1b')],_0x390012;if(_0x42654e>=_0xd8a61e){_0x42654e=_0xd8a61e;_0x390012=0xc8;}else{_0x390012=0xce;}_0x221123[_0xd042('0x18')](_0x390012);return _0x221123[_0xd042('0x1c')](_0xd042('0x1d'),_0x4635d5+'-'+_0x42654e+'/'+_0xd8a61e)['json'](_0x64a16);}return null;};}function patchUpdates(_0x596b76){return function(_0x3436de){try{jsonpatch[_0xd042('0x1e')](_0x3436de,_0x596b76,!![]);}catch(_0x11a298){return BPromise[_0xd042('0x1f')](_0x11a298);}return _0x3436de[_0xd042('0x20')]();};}function saveUpdates(_0x296359,_0x2a6d96){return function(_0x511637){if(_0x511637){return _0x511637[_0xd042('0x21')](_0x296359)[_0xd042('0x22')](function(_0xfb35f1){return _0xfb35f1;});}return null;};}function removeEntity(_0x59f9ff,_0x280260){return function(_0x2a09de){if(_0x2a09de){return _0x2a09de[_0xd042('0x23')]()['then'](function(){_0x59f9ff[_0xd042('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b53c8,_0x17b55d){return function(_0x1d836){if(!_0x1d836){_0x3b53c8[_0xd042('0x17')](0x194);}return _0x1d836;};}function handleError(_0x483fd8,_0x2402c1){_0x2402c1=_0x2402c1||0x1f4;return function(_0x5719d3){logger[_0xd042('0x24')](_0x5719d3[_0xd042('0x25')]);if(_0x5719d3[_0xd042('0x26')]){delete _0x5719d3[_0xd042('0x26')];}_0x483fd8['status'](_0x2402c1)[_0xd042('0x27')](_0x5719d3);};}exports[_0xd042('0x28')]=function(_0x379304,_0x3767cb){var _0x2a0179={},_0x486523={},_0x27f561={'count':0x0,'rows':[]};var _0x41a37f=db[_0xd042('0x29')]['rawAttributes'];_0x486523[_0xd042('0x2a')]=_[_0xd042('0x2b')](_0x41a37f);_0x486523[_0xd042('0x2c')]=_[_0xd042('0x2b')](_0x379304[_0xd042('0x2c')]);_0x486523[_0xd042('0x2d')]=_['intersection'](_0x486523['model'],_0x486523[_0xd042('0x2c')]);_0x2a0179['attributes']=_[_0xd042('0x2e')](_0x486523[_0xd042('0x2a')],qs[_0xd042('0x2f')](_0x379304[_0xd042('0x2c')][_0xd042('0x2f')]));_0x2a0179[_0xd042('0x30')]=_0x2a0179['attributes'][_0xd042('0x31')]?_0x2a0179['attributes']:_0x486523[_0xd042('0x2a')];if(!_0x379304[_0xd042('0x2c')][_0xd042('0x32')](_0xd042('0x33'))){_0x2a0179[_0xd042('0x1b')]=qs[_0xd042('0x1b')](_0x379304[_0xd042('0x2c')][_0xd042('0x1b')]);_0x2a0179[_0xd042('0x34')]=qs['offset'](_0x379304['query'][_0xd042('0x34')]);}_0x2a0179[_0xd042('0x35')]=qs[_0xd042('0x36')](_0x379304['query'][_0xd042('0x36')]);_0x2a0179[_0xd042('0x37')]=qs[_0xd042('0x2d')](_['pick'](_0x379304[_0xd042('0x2c')],_0x486523['filters']));if(_0x379304[_0xd042('0x2c')][_0xd042('0x38')]){_0x2a0179[_0xd042('0x37')]=_['merge'](_0x2a0179[_0xd042('0x37')],{'$or':_['map'](_0x41a37f,function(_0x2ac757){if(_0x2ac757[_0xd042('0x39')][_0xd042('0x3a')]!==_0xd042('0x3b')){var _0x293c56={};_0x293c56[_0x2ac757[_0xd042('0x3c')]]={'$like':'%'+_0x379304[_0xd042('0x2c')][_0xd042('0x38')]+'%'};return _0x293c56;}})});}_0x2a0179=_[_0xd042('0x3d')]({},_0x2a0179,_0x379304['options']);var _0x4a96ce={'where':_0x2a0179['where']};return db['ChatTransferReport']['count'](_0x4a96ce)[_0xd042('0x22')](function(_0x3a5aa7){_0x27f561[_0xd042('0x1a')]=_0x3a5aa7;if(_0x379304[_0xd042('0x2c')][_0xd042('0x3e')]){_0x2a0179['include']=[{'all':!![]}];}return db[_0xd042('0x29')]['findAll'](_0x2a0179);})[_0xd042('0x22')](function(_0x339cb5){_0x27f561[_0xd042('0x3f')]=_0x339cb5;return _0x27f561;})[_0xd042('0x22')](respondWithFilteredResult(_0x3767cb,_0x2a0179))[_0xd042('0x40')](handleError(_0x3767cb,null));};exports['show']=function(_0x240cba,_0x39943e){var _0x3d673d={'raw':!![],'where':{'id':_0x240cba[_0xd042('0x41')]['id']}},_0x4888a9={};_0x4888a9[_0xd042('0x2a')]=_[_0xd042('0x2b')](db[_0xd042('0x29')]['rawAttributes']);_0x4888a9[_0xd042('0x2c')]=_[_0xd042('0x2b')](_0x240cba[_0xd042('0x2c')]);_0x4888a9[_0xd042('0x2d')]=_[_0xd042('0x2e')](_0x4888a9[_0xd042('0x2a')],_0x4888a9[_0xd042('0x2c')]);_0x3d673d['attributes']=_[_0xd042('0x2e')](_0x4888a9[_0xd042('0x2a')],qs[_0xd042('0x2f')](_0x240cba[_0xd042('0x2c')][_0xd042('0x2f')]));_0x3d673d[_0xd042('0x30')]=_0x3d673d[_0xd042('0x30')][_0xd042('0x31')]?_0x3d673d['attributes']:_0x4888a9[_0xd042('0x2a')];if(_0x240cba[_0xd042('0x2c')][_0xd042('0x3e')]){_0x3d673d[_0xd042('0x42')]=[{'all':!![]}];}_0x3d673d=_['merge']({},_0x3d673d,_0x240cba[_0xd042('0x43')]);return db[_0xd042('0x29')][_0xd042('0x44')](_0x3d673d)['then'](handleEntityNotFound(_0x39943e,null))[_0xd042('0x22')](respondWithResult(_0x39943e,null))[_0xd042('0x40')](handleError(_0x39943e,null));};exports[_0xd042('0x45')]=function(_0x6c2606,_0x4b2961){return db[_0xd042('0x29')][_0xd042('0x45')](_0x6c2606[_0xd042('0x46')],{})[_0xd042('0x22')](respondWithResult(_0x4b2961,0xc9))[_0xd042('0x40')](handleError(_0x4b2961,null));};exports[_0xd042('0x21')]=function(_0x4ec83d,_0x5941cd){if(_0x4ec83d[_0xd042('0x46')]['id']){delete _0x4ec83d[_0xd042('0x46')]['id'];}return db[_0xd042('0x29')]['find']({'where':{'id':_0x4ec83d['params']['id']}})[_0xd042('0x22')](handleEntityNotFound(_0x5941cd,null))[_0xd042('0x22')](saveUpdates(_0x4ec83d[_0xd042('0x46')],null))[_0xd042('0x22')](respondWithResult(_0x5941cd,null))[_0xd042('0x40')](handleError(_0x5941cd,null));};exports['destroy']=function(_0x5ea8a,_0x5aa6e8){return db[_0xd042('0x29')][_0xd042('0x44')]({'where':{'id':_0x5ea8a['params']['id']}})['then'](handleEntityNotFound(_0x5aa6e8,null))[_0xd042('0x22')](removeEntity(_0x5aa6e8,null))[_0xd042('0x40')](handleError(_0x5aa6e8,null));};exports[_0xd042('0x47')]=function(_0x1fbd84,_0x4baac7){return db[_0xd042('0x29')][_0xd042('0x47')]()[_0xd042('0x22')](respondWithResult(_0x4baac7,null))[_0xd042('0x40')](handleError(_0x4baac7,null));};
\ No newline at end of file
+var _0xb936=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then','error','name','send','index','ChatTransferReport','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','show','params','model','rawAttributes','include','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x25a0b9,_0x86e28f){var _0x30b9ab=function(_0x883a4){while(--_0x883a4){_0x25a0b9['push'](_0x25a0b9['shift']());}};_0x30b9ab(++_0x86e28f);}(_0xb936,0x122));var _0x6b93=function(_0x4607eb,_0x376a12){_0x4607eb=_0x4607eb-0x0;var _0x12b2cd=_0xb936[_0x4607eb];return _0x12b2cd;};'use strict';var pdf=require(_0x6b93('0x0'));var emlformat=require(_0x6b93('0x1'));var rimraf=require(_0x6b93('0x2'));var zipdir=require(_0x6b93('0x3'));var jsonpatch=require(_0x6b93('0x4'));var rp=require(_0x6b93('0x5'));var moment=require(_0x6b93('0x6'));var BPromise=require(_0x6b93('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6b93('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6b93('0x9'));var fs=require('fs');var _=require(_0x6b93('0xa'));var squel=require(_0x6b93('0xb'));var crypto=require(_0x6b93('0xc'));var jsforce=require(_0x6b93('0xd'));var deskjs=require(_0x6b93('0xe'));var toCsv=require(_0x6b93('0xf'));var querystring=require(_0x6b93('0x10'));var Papa=require(_0x6b93('0x11'));var Redis=require(_0x6b93('0x12'));var authService=require(_0x6b93('0x13'));var qs=require(_0x6b93('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b93('0x15'))(_0x6b93('0x16'));var utils=require(_0x6b93('0x17'));var config=require(_0x6b93('0x18'));var db=require(_0x6b93('0x19'))['db'];function respondWithStatusCode(_0x5013a0,_0x16fb84){_0x16fb84=_0x16fb84||0xcc;return function(_0x3ff897){if(_0x3ff897){return _0x5013a0[_0x6b93('0x1a')](_0x16fb84);}return _0x5013a0[_0x6b93('0x1b')](_0x16fb84)['end']();};}function respondWithResult(_0x11df94,_0x39edd1){_0x39edd1=_0x39edd1||0xc8;return function(_0x5d2e39){if(_0x5d2e39){return _0x11df94['status'](_0x39edd1)[_0x6b93('0x1c')](_0x5d2e39);}};}function respondWithFilteredResult(_0x300a22,_0x324b62){return function(_0x590203){if(_0x590203){var _0x326f99=_0x590203['count'],_0x34c63f=_0x324b62[_0x6b93('0x1d')],_0x3ae029=_0x324b62[_0x6b93('0x1d')]+_0x324b62[_0x6b93('0x1e')],_0x32f3d0;if(_0x3ae029>=_0x326f99){_0x3ae029=_0x326f99;_0x32f3d0=0xc8;}else{_0x32f3d0=0xce;}_0x300a22['status'](_0x32f3d0);return _0x300a22[_0x6b93('0x1f')]('Content-Range',_0x34c63f+'-'+_0x3ae029+'/'+_0x326f99)[_0x6b93('0x1c')](_0x590203);}return null;};}function patchUpdates(_0x1aa356){return function(_0x155683){try{jsonpatch[_0x6b93('0x20')](_0x155683,_0x1aa356,!![]);}catch(_0xa1e42d){return BPromise[_0x6b93('0x21')](_0xa1e42d);}return _0x155683[_0x6b93('0x22')]();};}function saveUpdates(_0x156a55,_0x4857dd){return function(_0x3f00bc){if(_0x3f00bc){return _0x3f00bc[_0x6b93('0x23')](_0x156a55)[_0x6b93('0x24')](function(_0x22821c){return _0x22821c;});}return null;};}function removeEntity(_0x91d0c0,_0x2d4454){return function(_0x37d298){if(_0x37d298){return _0x37d298['destroy']()['then'](function(){_0x91d0c0[_0x6b93('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e0bae,_0x5d506a){return function(_0x510310){if(!_0x510310){_0x4e0bae[_0x6b93('0x1a')](0x194);}return _0x510310;};}function handleError(_0xfff54d,_0x1bd554){_0x1bd554=_0x1bd554||0x1f4;return function(_0x25eab0){logger[_0x6b93('0x25')](_0x25eab0['stack']);if(_0x25eab0[_0x6b93('0x26')]){delete _0x25eab0[_0x6b93('0x26')];}_0xfff54d['status'](_0x1bd554)[_0x6b93('0x27')](_0x25eab0);};}exports[_0x6b93('0x28')]=function(_0x51bddc,_0x18ea7d){var _0x30c990={},_0x1d562a={},_0x5b0c57={'count':0x0,'rows':[]};var _0xe9a932=db[_0x6b93('0x29')]['rawAttributes'];_0x1d562a['model']=_['keys'](_0xe9a932);_0x1d562a['query']=_[_0x6b93('0x2a')](_0x51bddc[_0x6b93('0x2b')]);_0x1d562a[_0x6b93('0x2c')]=_[_0x6b93('0x2d')](_0x1d562a['model'],_0x1d562a[_0x6b93('0x2b')]);_0x30c990[_0x6b93('0x2e')]=_[_0x6b93('0x2d')](_0x1d562a['model'],qs['fields'](_0x51bddc[_0x6b93('0x2b')][_0x6b93('0x2f')]));_0x30c990[_0x6b93('0x2e')]=_0x30c990[_0x6b93('0x2e')][_0x6b93('0x30')]?_0x30c990[_0x6b93('0x2e')]:_0x1d562a['model'];if(!_0x51bddc[_0x6b93('0x2b')][_0x6b93('0x31')](_0x6b93('0x32'))){_0x30c990['limit']=qs[_0x6b93('0x1e')](_0x51bddc['query'][_0x6b93('0x1e')]);_0x30c990[_0x6b93('0x1d')]=qs[_0x6b93('0x1d')](_0x51bddc[_0x6b93('0x2b')]['offset']);}_0x30c990[_0x6b93('0x33')]=qs[_0x6b93('0x34')](_0x51bddc[_0x6b93('0x2b')]['sort']);_0x30c990[_0x6b93('0x35')]=qs[_0x6b93('0x2c')](_[_0x6b93('0x36')](_0x51bddc[_0x6b93('0x2b')],_0x1d562a[_0x6b93('0x2c')]));if(_0x51bddc[_0x6b93('0x2b')][_0x6b93('0x37')]){_0x30c990[_0x6b93('0x35')]=_[_0x6b93('0x38')](_0x30c990['where'],{'$or':_['map'](_0xe9a932,function(_0x43563c){if(_0x43563c[_0x6b93('0x39')][_0x6b93('0x3a')]!==_0x6b93('0x3b')){var _0x37f2cc={};_0x37f2cc[_0x43563c[_0x6b93('0x3c')]]={'$like':'%'+_0x51bddc[_0x6b93('0x2b')]['filter']+'%'};return _0x37f2cc;}})});}_0x30c990=_[_0x6b93('0x38')]({},_0x30c990,_0x51bddc[_0x6b93('0x3d')]);var _0x4438fb={'where':_0x30c990['where']};return db['ChatTransferReport']['count'](_0x4438fb)[_0x6b93('0x24')](function(_0x1a5d7a){_0x5b0c57[_0x6b93('0x3e')]=_0x1a5d7a;if(_0x51bddc[_0x6b93('0x2b')][_0x6b93('0x3f')]){_0x30c990['include']=[{'all':!![]}];}return db[_0x6b93('0x29')][_0x6b93('0x40')](_0x30c990);})['then'](function(_0xa5a0fc){_0x5b0c57[_0x6b93('0x41')]=_0xa5a0fc;return _0x5b0c57;})[_0x6b93('0x24')](respondWithFilteredResult(_0x18ea7d,_0x30c990))[_0x6b93('0x42')](handleError(_0x18ea7d,null));};exports[_0x6b93('0x43')]=function(_0x176ee9,_0x62094a){var _0x1edf59={'raw':!![],'where':{'id':_0x176ee9[_0x6b93('0x44')]['id']}},_0x14ec65={};_0x14ec65[_0x6b93('0x45')]=_['keys'](db['ChatTransferReport'][_0x6b93('0x46')]);_0x14ec65['query']=_[_0x6b93('0x2a')](_0x176ee9[_0x6b93('0x2b')]);_0x14ec65['filters']=_['intersection'](_0x14ec65['model'],_0x14ec65['query']);_0x1edf59['attributes']=_[_0x6b93('0x2d')](_0x14ec65['model'],qs[_0x6b93('0x2f')](_0x176ee9[_0x6b93('0x2b')][_0x6b93('0x2f')]));_0x1edf59['attributes']=_0x1edf59['attributes'][_0x6b93('0x30')]?_0x1edf59[_0x6b93('0x2e')]:_0x14ec65['model'];if(_0x176ee9['query'][_0x6b93('0x3f')]){_0x1edf59[_0x6b93('0x47')]=[{'all':!![]}];}_0x1edf59=_[_0x6b93('0x38')]({},_0x1edf59,_0x176ee9['options']);return db[_0x6b93('0x29')][_0x6b93('0x48')](_0x1edf59)['then'](handleEntityNotFound(_0x62094a,null))[_0x6b93('0x24')](respondWithResult(_0x62094a,null))[_0x6b93('0x42')](handleError(_0x62094a,null));};exports[_0x6b93('0x49')]=function(_0x22a86a,_0x192b58){return db['ChatTransferReport'][_0x6b93('0x49')](_0x22a86a['body'],{})[_0x6b93('0x24')](respondWithResult(_0x192b58,0xc9))[_0x6b93('0x42')](handleError(_0x192b58,null));};exports[_0x6b93('0x23')]=function(_0x15b275,_0x3fa2a8){if(_0x15b275['body']['id']){delete _0x15b275[_0x6b93('0x4a')]['id'];}return db[_0x6b93('0x29')][_0x6b93('0x48')]({'where':{'id':_0x15b275['params']['id']}})[_0x6b93('0x24')](handleEntityNotFound(_0x3fa2a8,null))[_0x6b93('0x24')](saveUpdates(_0x15b275[_0x6b93('0x4a')],null))[_0x6b93('0x24')](respondWithResult(_0x3fa2a8,null))[_0x6b93('0x42')](handleError(_0x3fa2a8,null));};exports[_0x6b93('0x4b')]=function(_0x141fd1,_0xb5b685){return db[_0x6b93('0x29')][_0x6b93('0x48')]({'where':{'id':_0x141fd1[_0x6b93('0x44')]['id']}})[_0x6b93('0x24')](handleEntityNotFound(_0xb5b685,null))[_0x6b93('0x24')](removeEntity(_0xb5b685,null))[_0x6b93('0x42')](handleError(_0xb5b685,null));};exports[_0x6b93('0x4c')]=function(_0x229207,_0x40b056){return db[_0x6b93('0x29')]['describe']()[_0x6b93('0x24')](respondWithResult(_0x40b056,null))['catch'](handleError(_0x40b056,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index b46a33d..04f6df2 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 _0xdb76=['exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes'];(function(_0x72bccf,_0x584e4b){var _0x11b6b6=function(_0x3e7f98){while(--_0x3e7f98){_0x72bccf['push'](_0x72bccf['shift']());}};_0x11b6b6(++_0x584e4b);}(_0xdb76,0x8c));var _0x6db7=function(_0x327f76,_0x56d3c5){_0x327f76=_0x327f76-0x0;var _0x43c29c=_0xdb76[_0x327f76];return _0x43c29c;};'use strict';var _=require(_0x6db7('0x0'));var util=require(_0x6db7('0x1'));var logger=require(_0x6db7('0x2'))(_0x6db7('0x3'));var moment=require(_0x6db7('0x4'));var BPromise=require(_0x6db7('0x5'));var rp=require(_0x6db7('0x6'));var fs=require('fs');var path=require(_0x6db7('0x7'));var rimraf=require('rimraf');var config=require(_0x6db7('0x8'));var attributes=require(_0x6db7('0x9'));module[_0x6db7('0xa')]=function(_0x536d56,_0x1801ba){return _0x536d56[_0x6db7('0xb')](_0x6db7('0xc'),attributes,{'tableName':_0x6db7('0xd'),'paranoid':![],'indexes':[{'name':_0x6db7('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c32=['util','../../config/logger','moment','path','rimraf','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x5945d3,_0x42c4a1){var _0xe3819a=function(_0x41c155){while(--_0x41c155){_0x5945d3['push'](_0x5945d3['shift']());}};_0xe3819a(++_0x42c4a1);}(_0x9c32,0x15d));var _0x29c3=function(_0x15082b,_0x325648){_0x15082b=_0x15082b-0x0;var _0x4c1bf4=_0x9c32[_0x15082b];return _0x4c1bf4;};'use strict';var _=require(_0x29c3('0x0'));var util=require(_0x29c3('0x1'));var logger=require(_0x29c3('0x2'))('api');var moment=require(_0x29c3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x29c3('0x4'));var rimraf=require(_0x29c3('0x5'));var config=require('../../config/environment');var attributes=require(_0x29c3('0x6'));module['exports']=function(_0xd8ab32,_0x597fa9){return _0xd8ab32['define'](_0x29c3('0x7'),attributes,{'tableName':_0x29c3('0x8'),'paranoid':![],'indexes':[{'name':_0x29c3('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 180590b..a6914e6 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 _0x75c5=['info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0xf34924,_0x24da2b){var _0x27f8ec=function(_0x41ad08){while(--_0x41ad08){_0xf34924['push'](_0xf34924['shift']());}};_0x27f8ec(++_0x24da2b);}(_0x75c5,0xfb));var _0x575c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75c5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x575c('0x0'));var util=require(_0x575c('0x1'));var moment=require(_0x575c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x575c('0x3'));var db=require(_0x575c('0x4'))['db'];var utils=require(_0x575c('0x5'));var logger=require(_0x575c('0x6'))(_0x575c('0x7'));var config=require('../../config/environment');var jayson=require(_0x575c('0x8'));var client=jayson[_0x575c('0x9')][_0x575c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc786e7,_0x2d0629,_0x204764){return new BPromise(function(_0x163b31,_0x207199){return client[_0x575c('0xb')](_0xc786e7,_0x204764)[_0x575c('0xc')](function(_0x5b2fb1){logger[_0x575c('0xd')](_0x575c('0xe'),_0x2d0629,'request\x20sent');logger[_0x575c('0xf')](_0x575c('0x10'),_0x2d0629,'request\x20sent',JSON[_0x575c('0x11')](_0x5b2fb1));if(_0x5b2fb1['error']){if(_0x5b2fb1[_0x575c('0x12')][_0x575c('0x13')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2d0629,_0x5b2fb1['error'][_0x575c('0x14')]);return _0x207199(_0x5b2fb1[_0x575c('0x12')][_0x575c('0x14')]);}logger[_0x575c('0x12')](_0x575c('0xe'),_0x2d0629,_0x5b2fb1[_0x575c('0x12')]['message']);return _0x163b31(_0x5b2fb1[_0x575c('0x12')][_0x575c('0x14')]);}else{logger[_0x575c('0xd')](_0x575c('0xe'),_0x2d0629,_0x575c('0x15'));_0x163b31(_0x5b2fb1[_0x575c('0x16')][_0x575c('0x14')]);}})[_0x575c('0x17')](function(_0x4b14fe){logger[_0x575c('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2d0629,_0x4b14fe);_0x207199(_0x4b14fe);});});}
\ No newline at end of file
+var _0x3cb7=['jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x643fd2,_0x70566){var _0x39d43d=function(_0x5ee236){while(--_0x5ee236){_0x643fd2['push'](_0x643fd2['shift']());}};_0x39d43d(++_0x70566);}(_0x3cb7,0x1a8));var _0x73cb=function(_0x18dedd,_0x4cb9e5){_0x18dedd=_0x18dedd-0x0;var _0x35b7e1=_0x3cb7[_0x18dedd];return _0x35b7e1;};'use strict';var _=require(_0x73cb('0x0'));var util=require(_0x73cb('0x1'));var moment=require('moment');var BPromise=require(_0x73cb('0x2'));var rs=require(_0x73cb('0x3'));var fs=require('fs');var Redis=require(_0x73cb('0x4'));var db=require(_0x73cb('0x5'))['db'];var utils=require(_0x73cb('0x6'));var logger=require('../../config/logger')(_0x73cb('0x7'));var config=require('../../config/environment');var jayson=require(_0x73cb('0x8'));var client=jayson[_0x73cb('0x9')][_0x73cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x407413,_0x14373a,_0x1ad272){return new BPromise(function(_0x4a5f08,_0x4111b4){return client[_0x73cb('0xb')](_0x407413,_0x1ad272)[_0x73cb('0xc')](function(_0x1793c9){logger[_0x73cb('0xd')](_0x73cb('0xe'),_0x14373a,_0x73cb('0xf'));logger[_0x73cb('0x10')](_0x73cb('0x11'),_0x14373a,_0x73cb('0xf'),JSON[_0x73cb('0x12')](_0x1793c9));if(_0x1793c9[_0x73cb('0x13')]){if(_0x1793c9[_0x73cb('0x13')][_0x73cb('0x14')]===0x1f4){logger['error'](_0x73cb('0xe'),_0x14373a,_0x1793c9[_0x73cb('0x13')][_0x73cb('0x15')]);return _0x4111b4(_0x1793c9['error']['message']);}logger[_0x73cb('0x13')](_0x73cb('0xe'),_0x14373a,_0x1793c9[_0x73cb('0x13')]['message']);return _0x4a5f08(_0x1793c9[_0x73cb('0x13')][_0x73cb('0x15')]);}else{logger['info'](_0x73cb('0xe'),_0x14373a,'request\x20sent');_0x4a5f08(_0x1793c9[_0x73cb('0x16')][_0x73cb('0x15')]);}})[_0x73cb('0x17')](function(_0x4caaab){logger[_0x73cb('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x14373a,_0x4caaab);_0x4111b4(_0x4caaab);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index e233bf1..cd557dc 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 _0x1c91=['/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0x1c91,0xb8));var _0x11c9=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x1c91[_0x34bc30];return _0x5706de;};'use strict';var multer=require('multer');var util=require(_0x11c9('0x0'));var path=require(_0x11c9('0x1'));var timeout=require(_0x11c9('0x2'));var express=require(_0x11c9('0x3'));var router=express[_0x11c9('0x4')]();var auth=require(_0x11c9('0x5'));var interaction=require(_0x11c9('0x6'));var config=require(_0x11c9('0x7'));var controller=require(_0x11c9('0x8'));router[_0x11c9('0x9')]('/',auth[_0x11c9('0xa')](),controller[_0x11c9('0xb')]);router[_0x11c9('0x9')]('/describe',auth[_0x11c9('0xa')](),controller['describe']);router[_0x11c9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x11c9('0xc')]);router[_0x11c9('0xd')]('/',auth[_0x11c9('0xa')](),controller[_0x11c9('0xe')]);router[_0x11c9('0xf')](_0x11c9('0x10'),auth['isAuthenticated'](),controller[_0x11c9('0x11')]);router[_0x11c9('0x12')](_0x11c9('0x10'),auth[_0x11c9('0xa')](),controller[_0x11c9('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xcd27=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x2f08a6,_0x530dbd){var _0x2c9e73=function(_0x4e29d7){while(--_0x4e29d7){_0x2f08a6['push'](_0x2f08a6['shift']());}};_0x2c9e73(++_0x530dbd);}(_0xcd27,0x1ef));var _0x7cd2=function(_0x366b00,_0x292435){_0x366b00=_0x366b00-0x0;var _0x157733=_0xcd27[_0x366b00];return _0x157733;};'use strict';var multer=require('multer');var util=require(_0x7cd2('0x0'));var path=require(_0x7cd2('0x1'));var timeout=require(_0x7cd2('0x2'));var express=require(_0x7cd2('0x3'));var router=express[_0x7cd2('0x4')]();var auth=require(_0x7cd2('0x5'));var interaction=require(_0x7cd2('0x6'));var config=require(_0x7cd2('0x7'));var controller=require('./chatTransferReport.controller');router[_0x7cd2('0x8')]('/',auth[_0x7cd2('0x9')](),controller[_0x7cd2('0xa')]);router[_0x7cd2('0x8')](_0x7cd2('0xb'),auth[_0x7cd2('0x9')](),controller[_0x7cd2('0xc')]);router[_0x7cd2('0x8')](_0x7cd2('0xd'),auth['isAuthenticated'](),controller[_0x7cd2('0xe')]);router[_0x7cd2('0xf')]('/',auth[_0x7cd2('0x9')](),controller['create']);router[_0x7cd2('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7cd2('0x11')]);router['delete'](_0x7cd2('0xd'),auth[_0x7cd2('0x9')](),controller['destroy']);module[_0x7cd2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index c82ef27..a4ede55 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 _0xc39e=['name','text','onlineForm','parse','getDataValue','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','email','Agent','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','input'];(function(_0x42afab,_0x569319){var _0x4dca57=function(_0x334fce){while(--_0x334fce){_0x42afab['push'](_0x42afab['shift']());}};_0x4dca57(++_0x569319);}(_0xc39e,0xdb));var _0xec39=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0xc39e[_0x498334];return _0x13bb70;};'use strict';var Sequelize=require(_0xec39('0x0'));var rs=require(_0xec39('0x1'));module[_0xec39('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xec39('0x3')]},'mapKey':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x4')},'mapKeyOffline':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x4')},'key':{'type':Sequelize[_0xec39('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x5')},'customerAlias':{'type':Sequelize[_0xec39('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xec39('0x3')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xec39('0x3')],'allowNull':![],'defaultValue':_0xec39('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xec39('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xec39('0x3')]},'animation':{'type':Sequelize[_0xec39('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xec39('0x9'),_0xec39('0xa')),'defaultValue':_0xec39('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0xb')},'start_chat_button':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0xd')},'header_offline':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0xe')},'download_transcript':{'type':Sequelize[_0xec39('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xec39('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xec39('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xec39('0xf')]},'closingQuestion':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x12')},'noteTitle':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x13')},'placeholderMessage':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0xd')},'skipMessageButton':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x16')},'conditionAgreement':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM'](_0xec39('0x17'),_0xec39('0x18')),'defaultValue':_0xec39('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xec39('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xec39('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xec39('0x19'),'variable':null,'config':{'placeholder':_0xec39('0x1a'),'type':_0xec39('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xec39('0x19'),'props':{'title':_0xec39('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xec39('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xec39('0x1c'))?JSON[_0xec39('0x1d')](this[_0xec39('0x1e')](_0xec39('0x1c'))):{};},'set':function(_0x481317){return this[_0xec39('0x1f')](_0xec39('0x1c'),JSON[_0xec39('0x20')](_0x481317));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xec39('0x20')]({'items':[{'type':_0xec39('0x19'),'props':{'title':_0xec39('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xec39('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xec39('0x21')},'props':{'title':'Comments','helpText':_0xec39('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xec39('0x1e')]('offlineForm')?JSON[_0xec39('0x1d')](this[_0xec39('0x1e')](_0xec39('0x23'))):{};},'set':function(_0x933752){return this[_0xec39('0x1f')](_0xec39('0x23'),JSON['stringify'](_0x933752));}},'token':{'type':Sequelize[_0xec39('0x3')],'defaultValue':function(){return rs[_0xec39('0x24')]();}},'autoclose':{'type':Sequelize[_0xec39('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xec39('0x3')]},'forwardOffline':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0x25')},'waitingMessage':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0x27')},'offlineMessageBody':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x29')},'skipUnmanaged':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x16')},'sendUnmanaged':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xec39('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xec39('0x3')]},'notificationTemplate':{'type':Sequelize[_0xec39('0xf')],'defaultValue':function(){return _0xec39('0x2a');}},'notificationSound':{'type':Sequelize[_0xec39('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xec39('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xec39('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xec39('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x2c')},'defaultTitle':{'type':Sequelize[_0xec39('0x3')]},'customerAvatar':{'type':Sequelize[_0xec39('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xec39('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xec39('0x3')],'allowNull':![],'defaultValue':_0xec39('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xec39('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xec39('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xec39('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xec39('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xec39('0x7')],'comment':_0xec39('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xec39('0x2f'),'set':function(_0x4dd674){if(!_0x4dd674)this[_0xec39('0x1f')](_0xec39('0x30'),null);this['setDataValue']('mandatoryDisposition',_0x4dd674);}}};
\ No newline at end of file
+var _0xdcf6=['Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','thumb','star','stringify','input','name','text','getDataValue','onlineForm','textarea','Comments','offlineForm','parse','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Note'];(function(_0x5384ae,_0x32e603){var _0x4bcf2d=function(_0x5c8e1b){while(--_0x5c8e1b){_0x5384ae['push'](_0x5384ae['shift']());}};_0x4bcf2d(++_0x32e603);}(_0xdcf6,0xb4));var _0x6dcf=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0xdcf6[_0x1b1e76];return _0x3d743a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6dcf('0x0'));module[_0x6dcf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6dcf('0x2')],'allowNull':![],'unique':_0x6dcf('0x3')},'description':{'type':Sequelize[_0x6dcf('0x2')]},'mapKey':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x6dcf('0x4')},'key':{'type':Sequelize[_0x6dcf('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6dcf('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6dcf('0x2')],'allowNull':![],'defaultValue':_0x6dcf('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6dcf('0x2')],'allowNull':![],'defaultValue':_0x6dcf('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6dcf('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6dcf('0x2')]},'animation':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6dcf('0x9')](_0x6dcf('0xa'),_0x6dcf('0xb')),'defaultValue':_0x6dcf('0xa')},'header_online':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x6dcf('0xd')},'header_offline':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0xe')},'download_transcript':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6dcf('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6dcf('0x11')]},'closingQuestion':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x13')},'placeholderMessage':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x14')},'closingMessage':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x15')},'closingMessageButton':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0xd')},'skipMessageButton':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingType':{'type':Sequelize[_0x6dcf('0x9')]('star',_0x6dcf('0x17')),'defaultValue':_0x6dcf('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x6dcf('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6dcf('0x11')],'defaultValue':function(){return JSON[_0x6dcf('0x19')]({'items':[{'type':_0x6dcf('0x1a'),'variable':null,'config':{'placeholder':_0x6dcf('0x1b'),'type':_0x6dcf('0x1c'),'required':!![]},'props':{'title':_0x6dcf('0x1b'),'helpText':''}},{'type':_0x6dcf('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6dcf('0x4'),'type':_0x6dcf('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6dcf('0x1d')](_0x6dcf('0x1e'))?JSON['parse'](this[_0x6dcf('0x1d')](_0x6dcf('0x1e'))):{};},'set':function(_0x3d3561){return this['setDataValue'](_0x6dcf('0x1e'),JSON['stringify'](_0x3d3561));}},'offlineForm':{'type':Sequelize[_0x6dcf('0x11')],'defaultValue':function(){return JSON[_0x6dcf('0x19')]({'items':[{'type':_0x6dcf('0x1a'),'props':{'title':_0x6dcf('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x6dcf('0x4'),'type':_0x6dcf('0x4')},'variable':null},{'type':_0x6dcf('0x1f'),'config':{'placeholder':_0x6dcf('0x20')},'props':{'title':_0x6dcf('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x6dcf('0x21'))?JSON[_0x6dcf('0x22')](this[_0x6dcf('0x1d')](_0x6dcf('0x21'))):{};},'set':function(_0x4f28a6){return this[_0x6dcf('0x23')](_0x6dcf('0x21'),JSON[_0x6dcf('0x19')](_0x4f28a6));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6dcf('0x24')]();}},'autoclose':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6dcf('0x2')]},'forwardOffline':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6dcf('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x26')},'offlineMessageBody':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x28')},'skipUnmanaged':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6dcf('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6dcf('0x29');}},'notificationSound':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6dcf('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x2b')},'verticalAlignment':{'type':Sequelize[_0x6dcf('0xf')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':_0x6dcf('0x2c')},'defaultTitle':{'type':Sequelize[_0x6dcf('0x2')]},'customerAvatar':{'type':Sequelize[_0x6dcf('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6dcf('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6dcf('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6dcf('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6dcf('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6dcf('0x2d')},'systemAvatar':{'type':Sequelize[_0x6dcf('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6dcf('0xf')],'comment':_0x6dcf('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6dcf('0x2f'),'set':function(_0x1fe3b8){if(!_0x1fe3b8)this['setDataValue'](_0x6dcf('0x30'),null);this[_0x6dcf('0x23')](_0x6dcf('0x31'),_0x1fe3b8);}}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 00ae048..8395f23 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 _0x54ef=['ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatWebsite.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','count','offset','limit','apply','reject','save','update','get','destroy','sendStatus','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','intersection','find','create','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','order','map','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','sitepic','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','join','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','updatedAt','DESC','ChatApplication','Applications','account','list','applications','orderBy','priority','contact','firstName','lastName','customerIp','referer','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','user','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','readFileSync','server/files/chat/iframe.js','remote','x-forwarded-for','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x54ef,0x112));var _0xf54e=function(_0xd3cb7c,_0xc6110b){_0xd3cb7c=_0xd3cb7c-0x0;var _0x3414e4=_0x54ef[_0xd3cb7c];return _0x3414e4;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var hardwareService=require(_0xf54e('0x13'));var logger=require('../../config/logger')(_0xf54e('0x14'));var utils=require(_0xf54e('0x15'));var config=require(_0xf54e('0x16'));var db=require(_0xf54e('0x17'))['db'];config['redis']=_[_0xf54e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf54e('0x19'))(new Redis(config[_0xf54e('0x1a')]));require(_0xf54e('0x1b'))[_0xf54e('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf54e('0x1d')][_0xf54e('0x1e')]({'port':0x232c});var client9002=jayson[_0xf54e('0x1d')][_0xf54e('0x1e')]({'port':0x232a});var client9003=jayson['client'][_0xf54e('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x389abc,_0x3eb415,_0x5c5d00){if(_0x5c5d00){var _0x4af633=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4af633[_0xf54e('0x1f')](_0x3eb415)){return _0x389abc;}else{throw new Error(_0xf54e('0x20'));}}else{return _0x389abc;}}function respondWithRpcPromise(_0x1c02e7,_0x9647f,_0x15cc48,_0x3e7d96){return new BPromise(function(_0x2e27b6,_0x1ef06e){var _0x1dcc04=_0x3e7d96||client;return _0x1dcc04[_0xf54e('0x21')](_0x1c02e7,_0x15cc48)[_0xf54e('0x22')](function(_0x50fc66){logger['info'](_0xf54e('0x23'),_0x9647f,'request\x20sent');logger[_0xf54e('0x24')](_0xf54e('0x25'),_0x9647f,_0xf54e('0x26'),JSON[_0xf54e('0x27')](_0x50fc66));if(_0x50fc66[_0xf54e('0x28')]){if(_0x50fc66[_0xf54e('0x28')][_0xf54e('0x29')]===0x1f4){logger[_0xf54e('0x28')](_0xf54e('0x23'),_0x9647f,_0x50fc66[_0xf54e('0x28')][_0xf54e('0x2a')]);return _0x1ef06e(_0x50fc66['error'][_0xf54e('0x2a')]);}logger['error'](_0xf54e('0x23'),_0x9647f,_0x50fc66[_0xf54e('0x28')][_0xf54e('0x2a')]);return _0x2e27b6(_0x50fc66[_0xf54e('0x28')][_0xf54e('0x2a')]);}else{logger[_0xf54e('0x2b')](_0xf54e('0x23'),_0x9647f,_0xf54e('0x26'));_0x2e27b6(_0x50fc66[_0xf54e('0x2c')][_0xf54e('0x2a')]);}})[_0xf54e('0x2d')](function(_0x39c0ae){logger[_0xf54e('0x28')]('ChatWebsite,\x20%s,\x20%s',_0x9647f,_0x39c0ae);_0x1ef06e(_0x39c0ae);});});}function respondWithStatusCode(_0xb3706e,_0x4cbf7c){_0x4cbf7c=_0x4cbf7c||0xcc;return function(_0x282c63){if(_0x282c63){return _0xb3706e['sendStatus'](_0x4cbf7c);}return _0xb3706e[_0xf54e('0x2e')](_0x4cbf7c)[_0xf54e('0x2f')]();};}function respondWithResult(_0x21ba00,_0xa13cd0){_0xa13cd0=_0xa13cd0||0xc8;return function(_0x25b643){if(_0x25b643){return _0x21ba00[_0xf54e('0x2e')](_0xa13cd0)[_0xf54e('0x30')](_0x25b643);}};}function respondWithFilteredResult(_0x54bd8f,_0x4b3c73){return function(_0x2f96b1){if(_0x2f96b1){var _0x258d29=_0x2f96b1[_0xf54e('0x31')],_0x2ec92e=_0x4b3c73[_0xf54e('0x32')],_0x16d00f=_0x4b3c73[_0xf54e('0x32')]+_0x4b3c73[_0xf54e('0x33')],_0xb2d4c4;if(_0x16d00f>=_0x258d29){_0x16d00f=_0x258d29;_0xb2d4c4=0xc8;}else{_0xb2d4c4=0xce;}_0x54bd8f[_0xf54e('0x2e')](_0xb2d4c4);return _0x54bd8f['set']('Content-Range',_0x2ec92e+'-'+_0x16d00f+'/'+_0x258d29)[_0xf54e('0x30')](_0x2f96b1);}return null;};}function patchUpdates(_0x3169dd){return function(_0x4d8fdd){try{jsonpatch[_0xf54e('0x34')](_0x4d8fdd,_0x3169dd,!![]);}catch(_0x82e313){return BPromise[_0xf54e('0x35')](_0x82e313);}return _0x4d8fdd[_0xf54e('0x36')]();};}function saveUpdates(_0x576b46,_0x54bea4){return function(_0x4bb173){if(_0x4bb173){return _0x4bb173[_0xf54e('0x37')](_0x576b46)[_0xf54e('0x22')](function(_0x210d6d){return _0x210d6d;});}return null;};}function removeEntity(_0x399e68,_0x29dc39){return function(_0x3a2104){if(_0x3a2104){return _0x3a2104['destroy']()['then'](function(){var _0x530cee=_0x3a2104[_0xf54e('0x38')]({'plain':!![]});var _0x734187='ChatWebsites';return db['UserProfileResource'][_0xf54e('0x39')]({'where':{'type':_0x734187,'resourceId':_0x530cee['id']}})[_0xf54e('0x22')](function(){return _0x3a2104;});})[_0xf54e('0x22')](function(){_0x399e68['status'](0xcc)[_0xf54e('0x2f')]();});}};}function handleEntityNotFound(_0x44a437,_0x50aeca){return function(_0x38d7a0){if(!_0x38d7a0){_0x44a437[_0xf54e('0x3a')](0x194);}return _0x38d7a0;};}function handleError(_0x5af03,_0x1eeeb4){_0x1eeeb4=_0x1eeeb4||0x1f4;return function(_0x12ef97){logger[_0xf54e('0x28')](_0x12ef97['stack']);if(_0x12ef97['name']){delete _0x12ef97[_0xf54e('0x3b')];}_0x5af03[_0xf54e('0x2e')](_0x1eeeb4)[_0xf54e('0x3c')](_0x12ef97);};}exports['index']=function(_0x4533a2,_0x22fa6f){var _0x448054={'include':[{'model':db[_0xf54e('0x3d')],'as':_0xf54e('0x3e')}]},_0x1ee884={},_0x361e4c={'count':0x0,'rows':[]};var _0x1345b0=db[_0xf54e('0x3f')][_0xf54e('0x40')];_0x1ee884[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x1345b0);_0x1ee884[_0xf54e('0x43')]=_[_0xf54e('0x42')](_0x4533a2[_0xf54e('0x43')]);_0x1ee884['filters']=_['intersection'](_0x1ee884['model'],_0x1ee884[_0xf54e('0x43')]);_0x448054[_0xf54e('0x44')]=_['intersection'](_0x1ee884[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x4533a2[_0xf54e('0x43')]['fields']));_0x448054[_0xf54e('0x44')]=_0x448054[_0xf54e('0x44')][_0xf54e('0x46')]?_0x448054[_0xf54e('0x44')]:_0x1ee884[_0xf54e('0x41')];if(!_0x4533a2[_0xf54e('0x43')][_0xf54e('0x47')](_0xf54e('0x48'))){_0x448054[_0xf54e('0x33')]=qs['limit'](_0x4533a2[_0xf54e('0x43')][_0xf54e('0x33')]);_0x448054[_0xf54e('0x32')]=qs[_0xf54e('0x32')](_0x4533a2[_0xf54e('0x43')][_0xf54e('0x32')]);}_0x448054['order']=qs[_0xf54e('0x49')](_0x4533a2['query'][_0xf54e('0x49')]);_0x448054['where']=qs[_0xf54e('0x4a')](_[_0xf54e('0x4b')](_0x4533a2[_0xf54e('0x43')],_0x1ee884['filters']));if(_0x4533a2[_0xf54e('0x43')][_0xf54e('0x4c')]){_0x448054[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0x448054[_0xf54e('0x4d')],{'$or':_['map'](_0x1345b0,function(_0x427799){if(_0x427799[_0xf54e('0x4f')][_0xf54e('0x50')]!==_0xf54e('0x51')){var _0x5f3438={};_0x5f3438[_0x427799[_0xf54e('0x52')]]={'$like':'%'+_0x4533a2[_0xf54e('0x43')]['filter']+'%'};return _0x5f3438;}})});}_0x448054=_[_0xf54e('0x4e')]({},_0x448054,_0x4533a2[_0xf54e('0x53')]);var _0x3d24c7={'where':_0x448054[_0xf54e('0x4d')]};return db['ChatWebsite'][_0xf54e('0x31')](_0x3d24c7)[_0xf54e('0x22')](function(_0x2527f6){_0x361e4c[_0xf54e('0x31')]=_0x2527f6;if(_0x4533a2[_0xf54e('0x43')][_0xf54e('0x54')]){_0x448054[_0xf54e('0x55')]=[{'all':!![]}];}return db[_0xf54e('0x3f')][_0xf54e('0x56')](_0x448054);})[_0xf54e('0x22')](function(_0xaf9bf0){_0x361e4c[_0xf54e('0x57')]=_0xaf9bf0;return _0x361e4c;})[_0xf54e('0x22')](respondWithFilteredResult(_0x22fa6f,_0x448054))[_0xf54e('0x2d')](handleError(_0x22fa6f,null));};exports[_0xf54e('0x58')]=function(_0xa6c305,_0x40d8ab){var _0xe9338b={'raw':![],'where':{'id':_0xa6c305[_0xf54e('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x21fd80={};_0x21fd80[_0xf54e('0x41')]=_[_0xf54e('0x42')](db[_0xf54e('0x3f')][_0xf54e('0x40')]);_0x21fd80[_0xf54e('0x43')]=_[_0xf54e('0x42')](_0xa6c305[_0xf54e('0x43')]);_0x21fd80[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x21fd80[_0xf54e('0x41')],_0x21fd80[_0xf54e('0x43')]);_0xe9338b['attributes']=_[_0xf54e('0x5a')](_0x21fd80[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0xa6c305[_0xf54e('0x43')][_0xf54e('0x45')]));_0xe9338b[_0xf54e('0x44')]=_0xe9338b[_0xf54e('0x44')]['length']?_0xe9338b[_0xf54e('0x44')]:_0x21fd80[_0xf54e('0x41')];if(_0xa6c305[_0xf54e('0x43')]['includeAll']){_0xe9338b[_0xf54e('0x55')]=[{'all':!![]}];}_0xe9338b=_['merge']({},_0xe9338b,_0xa6c305[_0xf54e('0x53')]);return db[_0xf54e('0x3f')][_0xf54e('0x5b')](_0xe9338b)['then'](handleEntityNotFound(_0x40d8ab,null))[_0xf54e('0x22')](respondWithResult(_0x40d8ab,null))[_0xf54e('0x2d')](handleError(_0x40d8ab,null));};exports[_0xf54e('0x5c')]=function(_0x4e5059,_0x3744a4){return db[_0xf54e('0x3f')][_0xf54e('0x5c')](_0x4e5059['body'],{})['then'](function(_0x4270e1){var _0x9ab4c4=_0x4e5059['user'][_0xf54e('0x38')]({'plain':!![]});if(!_0x9ab4c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9ab4c4[_0xf54e('0x5d')]==='user'){var _0x324167=_0x4270e1[_0xf54e('0x38')]({'plain':!![]});var _0x3f4243=_0xf54e('0x5e');return db[_0xf54e('0x5f')][_0xf54e('0x5b')]({'where':{'name':_0x3f4243,'userProfileId':_0x9ab4c4['userProfileId']},'raw':!![]})['then'](function(_0x79345){if(_0x79345&&_0x79345[_0xf54e('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x324167[_0xf54e('0x3b')],'resourceId':_0x324167['id'],'type':_0x79345['name'],'sectionId':_0x79345['id']},{})[_0xf54e('0x22')](function(){return _0x4270e1;});}else{return _0x4270e1;}})[_0xf54e('0x2d')](function(_0x47596c){logger[_0xf54e('0x28')](_0xf54e('0x61'),_0x47596c);throw _0x47596c;});}return _0x4270e1;})[_0xf54e('0x22')](respondWithResult(_0x3744a4,0xc9))[_0xf54e('0x2d')](handleError(_0x3744a4,null));};exports[_0xf54e('0x37')]=function(_0x11732b,_0x4d8040){if(_0x11732b[_0xf54e('0x62')]['id']){delete _0x11732b[_0xf54e('0x62')]['id'];}return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0x11732b['params']['id']},'include':[{'model':db[_0xf54e('0x3d')],'as':_0xf54e('0x3e')}]})[_0xf54e('0x22')](handleEntityNotFound(_0x4d8040,null))[_0xf54e('0x22')](saveUpdates(_0x11732b[_0xf54e('0x62')],null))['then'](respondWithResult(_0x4d8040,null))[_0xf54e('0x2d')](handleError(_0x4d8040,null));};exports[_0xf54e('0x39')]=function(_0x577075,_0x51ec35){return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x577075[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x51ec35,null))[_0xf54e('0x22')](removeEntity(_0x51ec35,null))[_0xf54e('0x2d')](handleError(_0x51ec35,null));};exports['describe']=function(_0x2ecda1,_0x5cdb8c){return db[_0xf54e('0x3f')][_0xf54e('0x63')]()[_0xf54e('0x22')](respondWithResult(_0x5cdb8c,null))['catch'](handleError(_0x5cdb8c,null));};exports[_0xf54e('0x64')]=function(_0x504ec7,_0x3f7224,_0x3e2101){if(_0x504ec7['body']['id']){delete _0x504ec7[_0xf54e('0x62')]['id'];}return db['ChatWebsite'][_0xf54e('0x5b')]({'where':{'id':_0x504ec7[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x3f7224,null))[_0xf54e('0x22')](function(_0x21159f){if(_0x21159f){_0x504ec7['body'][_0xf54e('0x65')]=_0x21159f['id'];return db[_0xf54e('0x66')]['create'](_0x504ec7[_0xf54e('0x62')]);}})[_0xf54e('0x22')](respondWithResult(_0x3f7224,null))['catch'](handleError(_0x3f7224,null));};exports[_0xf54e('0x67')]=function(_0x14aaf7,_0x309895,_0x4c72ef){var _0xf4e4d={'raw':![],'where':{}};var _0x4ae3d0={};var _0x8ed40a={'count':0x0,'rows':[]};return db[_0xf54e('0x3f')]['findOne']({'where':{'id':_0x14aaf7[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x309895,null))[_0xf54e('0x22')](function(_0x3bdf23){if(_0x3bdf23){_0x4ae3d0[_0xf54e('0x41')]=_[_0xf54e('0x42')](db[_0xf54e('0x66')][_0xf54e('0x40')]);_0x4ae3d0[_0xf54e('0x43')]=_[_0xf54e('0x42')](_0x14aaf7[_0xf54e('0x43')]);_0x4ae3d0['filters']=_[_0xf54e('0x5a')](_0x4ae3d0[_0xf54e('0x41')],_0x4ae3d0[_0xf54e('0x43')]);_0xf4e4d['attributes']=_[_0xf54e('0x5a')](_0x4ae3d0[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x14aaf7[_0xf54e('0x43')][_0xf54e('0x45')]));_0xf4e4d[_0xf54e('0x44')]=_0xf4e4d[_0xf54e('0x44')]['length']?_0xf4e4d[_0xf54e('0x44')]:_0x4ae3d0[_0xf54e('0x41')];if(!_0x14aaf7[_0xf54e('0x43')]['hasOwnProperty'](_0xf54e('0x48'))){_0xf4e4d[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x14aaf7[_0xf54e('0x43')]['limit']);_0xf4e4d['offset']=qs[_0xf54e('0x32')](_0x14aaf7[_0xf54e('0x43')][_0xf54e('0x32')]);}_0xf4e4d[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0x14aaf7[_0xf54e('0x43')][_0xf54e('0x49')]);_0xf4e4d[_0xf54e('0x4d')]=qs[_0xf54e('0x4a')](_[_0xf54e('0x4b')](_0x14aaf7['query'],_0x4ae3d0[_0xf54e('0x4a')]));_0xf4e4d[_0xf54e('0x4d')][_0xf54e('0x65')]=_0x3bdf23['id'];if(_0x14aaf7[_0xf54e('0x43')]['filter']){_0xf4e4d[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0xf4e4d[_0xf54e('0x4d')],{'$or':_[_0xf54e('0x69')](_0xf4e4d['attributes'],function(_0x394862){var _0x4876b5={};_0x4876b5[_0x394862]={'$like':'%'+_0x14aaf7[_0xf54e('0x43')]['filter']+'%'};return _0x4876b5;})});}_0xf4e4d=_['merge']({},_0xf4e4d,_0x14aaf7[_0xf54e('0x53')]);return db[_0xf54e('0x66')][_0xf54e('0x31')]({'where':_0xf4e4d[_0xf54e('0x4d')]})[_0xf54e('0x22')](function(_0x14b7fc){_0x8ed40a[_0xf54e('0x31')]=_0x14b7fc;if(_0x14aaf7[_0xf54e('0x43')][_0xf54e('0x54')]){_0xf4e4d['include']=[{'all':!![]}];}return db[_0xf54e('0x66')][_0xf54e('0x56')](_0xf4e4d);})[_0xf54e('0x22')](function(_0x37a61b){_0x8ed40a[_0xf54e('0x57')]=_0x37a61b;return _0x8ed40a;});}})[_0xf54e('0x22')](respondWithFilteredResult(_0x309895,_0xf4e4d))[_0xf54e('0x2d')](handleError(_0x309895,null));};exports[_0xf54e('0x6a')]=function(_0x2fa9bc,_0xe58bec,_0x11dec2){return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x2fa9bc[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0xe58bec,null))['then'](function(_0x4a0614){if(_0x4a0614){return _0x4a0614[_0xf54e('0x6a')](_0x2fa9bc[_0xf54e('0x43')][_0xf54e('0x6b')]);}})[_0xf54e('0x22')](respondWithStatusCode(_0xe58bec,null))[_0xf54e('0x2d')](handleError(_0xe58bec,null));};exports[_0xf54e('0x6c')]=function(_0x1d1d10,_0x403445,_0x244451){if(_0x1d1d10['body']['id']){delete _0x1d1d10[_0xf54e('0x62')]['id'];}return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0x1d1d10['params']['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x403445,null))['then'](function(_0x3830e7){if(_0x3830e7){_0x1d1d10['body'][_0xf54e('0x65')]=_0x3830e7['id'];return db[_0xf54e('0x6d')]['create'](_0x1d1d10['body']);}})[_0xf54e('0x22')](respondWithResult(_0x403445,null))[_0xf54e('0x2d')](handleError(_0x403445,null));};exports[_0xf54e('0x6e')]=function(_0x406261,_0x389f16,_0x486626){var _0x5c008e={'raw':![],'where':{}};var _0x1a358f={};var _0x331e1f={'count':0x0,'rows':[]};return db[_0xf54e('0x3f')][_0xf54e('0x6f')]({'where':{'id':_0x406261[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x389f16,null))[_0xf54e('0x22')](function(_0x138119){if(_0x138119){_0x1a358f[_0xf54e('0x41')]=_[_0xf54e('0x42')](db['CannedAnswer'][_0xf54e('0x40')]);_0x1a358f[_0xf54e('0x43')]=_['keys'](_0x406261['query']);_0x1a358f[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x1a358f[_0xf54e('0x41')],_0x1a358f[_0xf54e('0x43')]);_0x5c008e[_0xf54e('0x44')]=_['intersection'](_0x1a358f[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x406261[_0xf54e('0x43')][_0xf54e('0x45')]));_0x5c008e['attributes']=_0x5c008e[_0xf54e('0x44')][_0xf54e('0x46')]?_0x5c008e[_0xf54e('0x44')]:_0x1a358f[_0xf54e('0x41')];if(!_0x406261['query'][_0xf54e('0x47')](_0xf54e('0x48'))){_0x5c008e[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x406261[_0xf54e('0x43')]['limit']);_0x5c008e[_0xf54e('0x32')]=qs['offset'](_0x406261['query'][_0xf54e('0x32')]);}_0x5c008e[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0x406261[_0xf54e('0x43')][_0xf54e('0x49')]);_0x5c008e[_0xf54e('0x4d')]=qs[_0xf54e('0x4a')](_[_0xf54e('0x4b')](_0x406261[_0xf54e('0x43')],_0x1a358f['filters']));_0x5c008e[_0xf54e('0x4d')][_0xf54e('0x65')]=_0x138119['id'];if(_0x406261[_0xf54e('0x43')][_0xf54e('0x4c')]){_0x5c008e[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0x5c008e['where'],{'$or':_[_0xf54e('0x69')](_0x5c008e[_0xf54e('0x44')],function(_0xd2c60d){var _0x2b46d4={};_0x2b46d4[_0xd2c60d]={'$like':'%'+_0x406261[_0xf54e('0x43')][_0xf54e('0x4c')]+'%'};return _0x2b46d4;})});}_0x5c008e=_['merge']({},_0x5c008e,_0x406261[_0xf54e('0x53')]);return db[_0xf54e('0x6d')][_0xf54e('0x31')]({'where':_0x5c008e[_0xf54e('0x4d')]})['then'](function(_0x4787ea){_0x331e1f[_0xf54e('0x31')]=_0x4787ea;if(_0x406261[_0xf54e('0x43')][_0xf54e('0x54')]){_0x5c008e[_0xf54e('0x55')]=[{'all':!![]}];}return db[_0xf54e('0x6d')][_0xf54e('0x56')](_0x5c008e);})['then'](function(_0x45fb52){_0x331e1f[_0xf54e('0x57')]=_0x45fb52;return _0x331e1f;});}})[_0xf54e('0x22')](respondWithFilteredResult(_0x389f16,_0x5c008e))[_0xf54e('0x2d')](handleError(_0x389f16,null));};exports[_0xf54e('0x70')]=function(_0xa386cc,_0x5b5a0d,_0x33bed6){return db['ChatWebsite'][_0xf54e('0x5b')]({'where':{'id':_0xa386cc['params']['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x5b5a0d,null))[_0xf54e('0x22')](function(_0x1ffad1){if(_0x1ffad1){return _0x1ffad1[_0xf54e('0x70')](_0xa386cc[_0xf54e('0x43')]['ids']);}})[_0xf54e('0x22')](respondWithStatusCode(_0x5b5a0d,null))[_0xf54e('0x2d')](handleError(_0x5b5a0d,null));};exports['addLogo']=function(_0x246309,_0x1b3ca4,_0x42dc85){_0x246309[_0xf54e('0x62')]['sitepic']=_0x246309[_0xf54e('0x71')][_0xf54e('0x72')];return db['ChatWebsite'][_0xf54e('0x5b')]({'where':{'id':_0x246309['params']['id']}})['then'](handleEntityNotFound(_0x1b3ca4,null))[_0xf54e('0x22')](saveUpdates(_0x246309['body'],null))[_0xf54e('0x22')](respondWithResult(_0x1b3ca4,null))[_0xf54e('0x2d')](handleError(_0x1b3ca4,null));};exports[_0xf54e('0x73')]=function(_0x1f1ab0,_0x235124,_0x56f125){_0x1f1ab0[_0xf54e('0x62')][_0xf54e('0x74')]=_0x1f1ab0[_0xf54e('0x71')][_0xf54e('0x72')];return db['ChatWebsite'][_0xf54e('0x5b')]({'where':{'id':_0x1f1ab0['params']['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x235124,null))[_0xf54e('0x22')](saveUpdates(_0x1f1ab0['body'],null))[_0xf54e('0x22')](respondWithResult(_0x235124,null))[_0xf54e('0x2d')](handleError(_0x235124,null));};exports[_0xf54e('0x75')]=function(_0x23a151,_0x5a7eac,_0x31f503){_0x23a151[_0xf54e('0x62')][_0xf54e('0x76')]=_0x23a151['file']['filename'];return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x23a151['params']['id']}})['then'](handleEntityNotFound(_0x5a7eac,null))[_0xf54e('0x22')](saveUpdates(_0x23a151[_0xf54e('0x62')],null))[_0xf54e('0x22')](respondWithResult(_0x5a7eac,null))[_0xf54e('0x2d')](handleError(_0x5a7eac,null));};exports[_0xf54e('0x77')]=function(_0xe97858,_0x427124,_0x2e32f6){_0xe97858[_0xf54e('0x62')]['systemAvatar']=_0xe97858[_0xf54e('0x71')]['filename'];return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0xe97858['params']['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x427124,null))['then'](saveUpdates(_0xe97858[_0xf54e('0x62')],null))[_0xf54e('0x22')](respondWithResult(_0x427124,null))[_0xf54e('0x2d')](handleError(_0x427124,null));};exports[_0xf54e('0x78')]=function(_0x212887,_0x3c499e,_0x4ec250){var _0x4d0131=path['join'](config[_0xf54e('0x79')],'server/files/images/logos/default_logo.png');var _0x2abe2c={'where':{'id':_0x212887[_0xf54e('0x59')]['id']},'attributes':['id',_0xf54e('0x7a')],'raw':!![]};var _0xf24a7c=![];return require(_0xf54e('0x7b'))['getLicense']()[_0xf54e('0x22')](function(_0x9c0c5e){if(_0x9c0c5e){_0xf24a7c=_0x9c0c5e[_0xf54e('0x7c')];}})[_0xf54e('0x22')](function(){return db[_0xf54e('0x3f')][_0xf54e('0x5b')](_0x2abe2c);})['then'](handleEntityNotFound(_0x3c499e,null))[_0xf54e('0x22')](function(_0x811fa7){if(_0x811fa7){if(!_[_0xf54e('0x7d')](_0x811fa7[_0xf54e('0x7a')])){if(fs[_0xf54e('0x7e')](path['join'](config[_0xf54e('0x79')],_0xf54e('0x7f'),_0x811fa7[_0xf54e('0x7a')]))&&_0xf24a7c){_0x4d0131=path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x7f'),_0x811fa7[_0xf54e('0x7a')]);}}return _0x3c499e[_0xf54e('0x81')](_0x4d0131);}})[_0xf54e('0x2d')](handleError(_0x3c499e,null));};exports['getAvatar']=function(_0xb94478,_0x26a293,_0x47d309){var _0x47a1d2=path[_0xf54e('0x80')](config['root'],_0xf54e('0x82'));var _0xd4db77={'where':{'id':_0xb94478[_0xf54e('0x59')]['id']},'attributes':['id',_0xf54e('0x74')],'raw':!![]};return db['ChatWebsite'][_0xf54e('0x5b')](_0xd4db77)[_0xf54e('0x22')](handleEntityNotFound(_0x26a293,null))['then'](function(_0x90ad88){if(_0x90ad88){if(!_[_0xf54e('0x7d')](_0x90ad88[_0xf54e('0x74')])){if(fs[_0xf54e('0x7e')](path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x83'),_0x90ad88[_0xf54e('0x74')]))){_0x47a1d2=path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x83'),_0x90ad88['agentAvatar']);}}return _0x26a293['download'](_0x47a1d2);}})[_0xf54e('0x2d')](handleError(_0x26a293,null));};exports[_0xf54e('0x84')]=function(_0x78860e,_0x961877,_0x27ce38){var _0x4e2143=path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x85'));var _0x213dc5={'where':{'id':_0x78860e['params']['id']},'attributes':['id',_0xf54e('0x76'),_0xf54e('0x86')],'raw':!![]};return db[_0xf54e('0x3f')][_0xf54e('0x5b')](_0x213dc5)[_0xf54e('0x22')](handleEntityNotFound(_0x961877,null))[_0xf54e('0x22')](function(_0x164f3e){if(_0x164f3e){if(!_[_0xf54e('0x7d')](_0x164f3e[_0xf54e('0x76')])){if(fs[_0xf54e('0x7e')](path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x83'),_0x164f3e[_0xf54e('0x76')]))&&_0x164f3e['showCustomerAvatar']){_0x4e2143=path[_0xf54e('0x80')](config['root'],'server/files/images/avatars/',_0x164f3e[_0xf54e('0x76')]);}}return _0x961877[_0xf54e('0x81')](_0x4e2143);}})[_0xf54e('0x2d')](handleError(_0x961877,null));};exports[_0xf54e('0x87')]=function(_0x22d3c1,_0x2609ef,_0x396f98){var _0x113020=path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x88'));var _0x3c77cd={'where':{'id':_0x22d3c1[_0xf54e('0x59')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xf54e('0x3f')][_0xf54e('0x5b')](_0x3c77cd)[_0xf54e('0x22')](handleEntityNotFound(_0x2609ef,null))[_0xf54e('0x22')](function(_0x40bd52){if(_0x40bd52){if(!_['isNil'](_0x40bd52['systemAvatar'])){if(fs[_0xf54e('0x7e')](path[_0xf54e('0x80')](config['root'],'server/files/images/avatars/',_0x40bd52[_0xf54e('0x89')]))){_0x113020=path['join'](config[_0xf54e('0x79')],_0xf54e('0x83'),_0x40bd52[_0xf54e('0x89')]);}}return _0x2609ef[_0xf54e('0x81')](_0x113020);}})[_0xf54e('0x2d')](handleError(_0x2609ef,null));};exports[_0xf54e('0x8a')]=function(_0x50bff9,_0x39fc7d,_0x2e0cf9){var _0x5cf1e4=require(_0xf54e('0x8b'));var _0x37d3ba=new _0x5cf1e4();var _0x529f31=_0x37d3ba[_0xf54e('0x8c')](_0x50bff9[_0xf54e('0x8d')][_0xf54e('0x8e')])['getResult']();var _0x4d463d={'body':_0x50bff9[_0xf54e('0x62')],'channel':_0xf54e('0x8f')};var _0x5316dd=[];var _0x4f6645=[];var _0x4ce631={};var _0x39027b=![];return db[_0xf54e('0x90')][_0xf54e('0x63')]()['then'](function(_0x187b1c){if(!_0x187b1c){throw new db[(_0xf54e('0x91'))][(_0xf54e('0x92'))](_0xf54e('0x93'));}_0x5316dd=_[_0xf54e('0x94')](_['keys'](_0x187b1c),['createdAt','updatedAt']);_0x4f6645=_['difference'](_['keys'](_0x187b1c),[_0xf54e('0x95'),'updatedAt',_0xf54e('0x96'),_0xf54e('0x97')]);if(_0x50bff9['body']['id']){delete _0x50bff9[_0xf54e('0x62')]['id'];}if(_['isNil'](_0x50bff9[_0xf54e('0x62')][_0xf54e('0x98')])){throw new db[(_0xf54e('0x91'))][(_0xf54e('0x92'))](_0xf54e('0x99'));}if(_[_0xf54e('0x7d')](_0x50bff9[_0xf54e('0x62')]['body'])||_0x50bff9[_0xf54e('0x62')][_0xf54e('0x62')]===''){throw new db[(_0xf54e('0x91'))][(_0xf54e('0x92'))](_0xf54e('0x9a'));}if(_['isNil'](_0x50bff9[_0xf54e('0x62')][_0xf54e('0x9b')])){throw new db[(_0xf54e('0x91'))][(_0xf54e('0x92'))](_0xf54e('0x9c')+_0x4f6645);}if(!_[_0xf54e('0x9d')](_0x4f6645,_0x50bff9['body']['mapKey'])){throw new db['Sequelize'][(_0xf54e('0x92'))](_0xf54e('0x9e')+_0x4f6645);}_0x4ce631[_0x50bff9[_0xf54e('0x62')][_0xf54e('0x9b')]]=_0x50bff9[_0xf54e('0x62')]['from'];})[_0xf54e('0x22')](function(){return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x50bff9[_0xf54e('0x59')]['id']},'include':[{'model':db[_0xf54e('0x9f')],'as':_0xf54e('0xa0'),'include':[{'model':db['CmContact'],'as':_0xf54e('0xa1'),'where':_0x4ce631,'limit':0x1,'order':[[_0xf54e('0xa2'),_0xf54e('0xa3')]]}]},{'model':db[_0xf54e('0xa4')],'as':_0xf54e('0xa5')}]});})[_0xf54e('0x22')](handleEntityNotFound(_0x39fc7d,null))[_0xf54e('0x22')](function(_0x370e59){if(_0x370e59&&_0x370e59['List']){_0x4d463d[_0xf54e('0xa6')]=_0x370e59;_0x4d463d['applications']=_0x370e59[_0xf54e('0xa5')];_0x4d463d[_0xf54e('0xa7')]=_0x370e59[_0xf54e('0xa0')];_0x4d463d[_0xf54e('0xa8')]=_[_0xf54e('0xa9')](_0x4d463d[_0xf54e('0xa8')],[_0xf54e('0xaa')],['asc']);if(_0x4d463d['account']['Applications']){delete _0x4d463d[_0xf54e('0xa6')]['Applications'];}if(_0x4d463d[_0xf54e('0xa6')]['List']&&_0x4d463d[_0xf54e('0xa6')][_0xf54e('0xa0')]['Contacts'][_0xf54e('0x46')]){return _0x4d463d[_0xf54e('0xa6')][_0xf54e('0xa0')][_0xf54e('0xa1')][0x0];}var _0x4701b8=_[_0xf54e('0x18')](_0x50bff9[_0xf54e('0x62')],{'firstName':_0x50bff9[_0xf54e('0x62')][_0xf54e('0x98')],'ListId':_0x370e59[_0xf54e('0x97')]});_0x4701b8[_0x50bff9[_0xf54e('0x62')]['mapKey']]=_0x50bff9[_0xf54e('0x62')][_0xf54e('0x98')];return db[_0xf54e('0x90')]['create'](_0x4701b8,{'fields':_0x5316dd,'raw':!![]});}})[_0xf54e('0x22')](handleEntityNotFound(_0x39fc7d,null))['then'](function(_0x2f6bcc){_0x4d463d[_0xf54e('0xab')]=_0x2f6bcc;if(_0x2f6bcc){var _0x9a5d11={'ContactId':_0x2f6bcc['id'],'ChatWebsiteId':_0x50bff9[_0xf54e('0x59')]['id'],'from':(_0x2f6bcc[_0xf54e('0xac')]||'')+'\x20'+(_0x2f6bcc[_0xf54e('0xad')]||''),'customerIp':_0x50bff9[_0xf54e('0x62')][_0xf54e('0xae')],'referer':_0x50bff9[_0xf54e('0x62')][_0xf54e('0xaf')],'browserName':_0x529f31[_0xf54e('0xb0')]['name']&&_0x529f31['browser']['version']?util[_0xf54e('0xb1')](_0xf54e('0xb2'),_0x529f31[_0xf54e('0xb0')]['name'],_0x529f31[_0xf54e('0xb0')][_0xf54e('0xb3')]):'unknown','browserVersion':_0x529f31[_0xf54e('0xb0')][_0xf54e('0xb3')]||_0xf54e('0xb4'),'osName':util[_0xf54e('0xb1')](_0xf54e('0xb2'),_0x529f31['os'][_0xf54e('0x3b')],_0x529f31['os'][_0xf54e('0xb3')]),'osVersion':_0x529f31['os']['version'],'deviceModel':_0x529f31['device'][_0xf54e('0x41')]&&_0x529f31[_0xf54e('0xb5')][_0xf54e('0xb6')]?util[_0xf54e('0xb1')]('%s\x20%s\x20%s',_0x529f31[_0xf54e('0xb5')][_0xf54e('0x41')],_0x529f31['device'][_0xf54e('0xb6')],_0x529f31['device'][_0xf54e('0x4f')]):null,'deviceVendor':_0x529f31[_0xf54e('0xb5')][_0xf54e('0xb6')],'deviceType':_0x529f31[_0xf54e('0xb5')]['type'],'formData':JSON[_0xf54e('0x27')](_0x50bff9['body'])};var _0x2e2ca8={'ChatWebsiteId':_0x50bff9[_0xf54e('0x59')]['id'],'closed':![]};if(_0x50bff9[_0xf54e('0x62')][_0xf54e('0xb7')]){_0x2e2ca8['threadId']=_0x50bff9['body'][_0xf54e('0xb7')];return db[_0xf54e('0xb8')][_0xf54e('0x5b')]({'where':_0x2e2ca8})['then'](function(_0x125ca5){if(_0x125ca5){return[_0x125ca5,![]];}_0x9a5d11[_0xf54e('0xb7')]=_0x50bff9['body'][_0xf54e('0xb7')];_0x9a5d11[_0xf54e('0xb9')]=_0x50bff9[_0xf54e('0x62')][_0xf54e('0xb9')];return db[_0xf54e('0xb8')][_0xf54e('0x5c')](_0x9a5d11)['then'](function(_0x1bf4d5){return[_0x1bf4d5,!![]];});});}_0x2e2ca8[_0xf54e('0xba')]=_0x2f6bcc['id'];if(_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbb')]&&_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbb')]['id']){_0x2e2ca8['id']=_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbb')]['id'];return db[_0xf54e('0xb8')][_0xf54e('0x5b')]({'where':_0x2e2ca8})[_0xf54e('0x22')](function(_0x189f94){if(_0x189f94){return[_0x189f94,![]];}return db[_0xf54e('0xb8')][_0xf54e('0x5c')](_0x9a5d11)[_0xf54e('0x22')](function(_0x3dee01){return[_0x3dee01,!![]];});});}return db[_0xf54e('0xb8')]['create'](_0x9a5d11)[_0xf54e('0x22')](function(_0x11c957){return[_0x11c957,!![]];});}})[_0xf54e('0xbc')](function(_0x4807c9,_0x6b3a1a){if(_0x4807c9){_0x39027b=_0x6b3a1a;if(!_0x6b3a1a){var _0x3b3d45={'from':(_0x4d463d[_0xf54e('0xab')][_0xf54e('0xac')]||'')+'\x20'+(_0x4d463d[_0xf54e('0xab')]['lastName']||'')};if(_0x50bff9[_0xf54e('0x62')]['threadId']&&_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbd')]&&_0x50bff9['body'][_0xf54e('0xb7')]!=_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbd')]){_0x3b3d45[_0xf54e('0xb7')]=_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbd')];}return _0x4807c9[_0xf54e('0x37')](_0x3b3d45);}else{return _0x4807c9;}}})[_0xf54e('0x22')](function(_0x1ad56e){_0x4d463d['interaction']=_0x1ad56e[_0xf54e('0x38')]({'plain':!![]});_0x4d463d['interaction'][_0xf54e('0xbe')]=_0x39027b;if(_0x4d463d[_0xf54e('0xbb')]['created']){if(_0x4d463d[_0xf54e('0xa6')]['autoclose']){_0x4d463d[_0xf54e('0xa8')][_0xf54e('0xbf')]({'id':0x0,'priority':_0x4d463d['applications'][_0xf54e('0x46')]+0x1,'app':_0xf54e('0xc0'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['ChatMessage'][_0xf54e('0x5c')]({'body':_0x50bff9[_0xf54e('0x62')][_0xf54e('0x62')],'ChatWebsiteId':_0x50bff9[_0xf54e('0x59')]['id'],'ChatInteractionId':_0x1ad56e['id'],'direction':'in','ContactId':_0x4d463d[_0xf54e('0xab')]['id'],'AttachmentId':_0x50bff9[_0xf54e('0x62')][_0xf54e('0xc1')]});})[_0xf54e('0x22')](function(_0x5a9400){_0x4d463d['message']=_0x5a9400;if(_0x4d463d[_0xf54e('0xbb')][_0xf54e('0xc2')]){return db[_0xf54e('0xc3')][_0xf54e('0x5b')]({'attributes':['id',_0xf54e('0x3b')],'where':{'id':_0x4d463d['interaction'][_0xf54e('0xc2')]}})['then'](function(_0x4cb711){if(_0x4cb711){_0x4d463d[_0xf54e('0xa8')][_0xf54e('0xc4')]({'id':0x0,'priority':0x0,'app':_0xf54e('0xc5'),'appdata':_0x4cb711[_0xf54e('0x3b')]+','+(_0x4d463d[_0xf54e('0xa6')][_0xf54e('0xc6')]||0xa),'interval':_0xf54e('0xc7')});_0x4d463d['forcedOwnership']=!![];}return respondWithRpcPromise(_0xf54e('0xc8'),_0xf54e('0xc9'),_0x4d463d);});}return respondWithRpcPromise(_0xf54e('0xc8'),_0xf54e('0xc9'),_0x4d463d);})[_0xf54e('0x22')](function(_0x547a00){respondWithRpcPromise(_0xf54e('0xca'),_0xf54e('0xca'),{'event':_0xf54e('0x8a'),'message':_0x547a00},client9002);return _0x547a00;})[_0xf54e('0x22')](respondWithResult(_0x39fc7d,null))[_0xf54e('0x2d')](handleError(_0x39fc7d,null));};exports['offline']=function(_0x5edb38,_0x395bbc,_0x2564f1){var _0x3a7e79,_0x582cde,_0x332f43;var _0x2c2833=[];var _0x2d5264=[];var _0x98eaa={};return db['CmContact'][_0xf54e('0x63')]()[_0xf54e('0x22')](function(_0x3219be){if(!_0x3219be){throw new db['Sequelize'][(_0xf54e('0x92'))](_0xf54e('0x93'));}_0x2d5264=_[_0xf54e('0x94')](_[_0xf54e('0x42')](_0x3219be),[_0xf54e('0x95'),_0xf54e('0xa2')]);_0x2c2833=_[_0xf54e('0x94')](_[_0xf54e('0x42')](_0x3219be),['createdAt',_0xf54e('0xa2'),_0xf54e('0x96'),_0xf54e('0x97')]);if(_0x5edb38[_0xf54e('0x62')]['id']){delete _0x5edb38['body']['id'];}if(_['isNil'](_0x5edb38['body']['from'])){throw _0x395bbc[_0xf54e('0x2e')](0x1f4)[_0xf54e('0x3c')](new db[(_0xf54e('0x91'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xf54e('0x7d')](_0x5edb38['body'][_0xf54e('0x62')])||_0x5edb38['body'][_0xf54e('0x62')]===''){throw _0x395bbc[_0xf54e('0x2e')](0x1f4)[_0xf54e('0x3c')](new db['Sequelize'][(_0xf54e('0x92'))](_0xf54e('0x9a')));}if(_[_0xf54e('0x7d')](_0x5edb38[_0xf54e('0x62')]['mapKeyOffline'])){throw _0x395bbc[_0xf54e('0x2e')](0x1f4)[_0xf54e('0x3c')](new db[(_0xf54e('0x91'))][(_0xf54e('0x92'))](_0xf54e('0xcb')+_0x2c2833));}if(!_[_0xf54e('0x9d')](_0x2c2833,_0x5edb38['body'][_0xf54e('0xcc')])){throw _0x395bbc['status'](0x1f4)['send'](new db[(_0xf54e('0x91'))]['ValidationError'](_0xf54e('0xcd')+_0x2c2833));}_0x98eaa[_0x5edb38[_0xf54e('0x62')]['mapKeyOffline']]=_0x5edb38['body'][_0xf54e('0x98')];})['then'](function(){return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0x5edb38['params']['id']},'include':[{'model':db[_0xf54e('0x9f')],'as':'List'}]});})[_0xf54e('0x22')](handleEntityNotFound(_0x395bbc,null))[_0xf54e('0x22')](function(_0x4f4695){if(_0x4f4695&&_0x4f4695[_0xf54e('0xa0')]){_0x582cde=_0x4f4695;var _0x1cb490=_[_0xf54e('0x18')](_0x5edb38[_0xf54e('0x62')],{'firstName':_0x5edb38[_0xf54e('0x62')][_0xf54e('0x98')],'phone':_0x5edb38[_0xf54e('0x62')][_0xf54e('0x98')],'ListId':_0x4f4695[_0xf54e('0x97')]});_0x1cb490[_0x5edb38['body']['mapKeyOffline']]=_0x5edb38[_0xf54e('0x62')][_0xf54e('0x98')];return db[_0xf54e('0x90')][_0xf54e('0xce')]({'where':_0x98eaa,'defaults':_0x1cb490});}})['spread'](function(_0x143b50){if(_0x143b50){_0x332f43=_0x143b50;var _0x3986ec=fs['readFileSync'](path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0xcf')),_0xf54e('0xd0'));var _0x24e9d6=ejs[_0xf54e('0xd1')](_0x3986ec,{'body':_[_0xf54e('0xd2')](_0x5edb38[_0xf54e('0x62')][_0xf54e('0x62')]),'bodyTitle':_0x582cde[_0xf54e('0xd3')]});return db[_0xf54e('0xd4')]['create']({'body':_0x24e9d6,'ContactId':_0x143b50['id'],'ChatWebsiteId':_0x582cde['id']});}})['then'](function(_0x293905){if(_0x293905){_0x3a7e79=_0x293905;return db[_0xf54e('0xd5')][_0xf54e('0x6f')]({'where':{'service':!![]},'include':[{'model':db[_0xf54e('0xd6')],'as':_0xf54e('0xd7'),'raw':!![]}]});}})[_0xf54e('0x22')](function(_0x53d6f9){if(_0x53d6f9&&_0x53d6f9[_0xf54e('0xd7')]&&_0x582cde[_0xf54e('0xd8')]){var _0x4bf14e={'tls':{'rejectUnauthorized':![]}};if(_0x53d6f9[_0xf54e('0xd7')][_0xf54e('0xd9')]){_0x4bf14e[_0xf54e('0xd9')]=_0x53d6f9[_0xf54e('0xd7')]['service'];}else{_0x4bf14e['host']=_0x53d6f9[_0xf54e('0xd7')][_0xf54e('0xda')];_0x4bf14e[_0xf54e('0xdb')]=_0x53d6f9[_0xf54e('0xd7')]['port'];_0x4bf14e['secure']=_0x53d6f9[_0xf54e('0xd7')][_0xf54e('0xdc')];}if(_0x53d6f9[_0xf54e('0xd7')]['authentication']){_0x4bf14e[_0xf54e('0xdd')]={'user':_0x53d6f9[_0xf54e('0xd7')][_0xf54e('0xde')],'pass':_0x53d6f9[_0xf54e('0xd7')]['pass']};}return respondWithRpcPromise(_0xf54e('0xdf'),'sendMail',{'account':_0x4bf14e,'message':{'from':util[_0xf54e('0xb1')](_0xf54e('0xe0'),_0x53d6f9[_0xf54e('0x3b')],_0x53d6f9[_0xf54e('0xe1')]||_0x53d6f9['Smtp'][_0xf54e('0xde')]),'to':_0x582cde[_0xf54e('0xd8')],'subject':_0x582cde[_0xf54e('0xe2')],'text':_0x3a7e79['body']}},client9003)[_0xf54e('0x22')](function(){return _0x3a7e79;})[_0xf54e('0x2d')](function(_0x40566e){console['error'](_0x40566e);});}})[_0xf54e('0x22')](function(){if(_0x3a7e79){return _0x3a7e79;}})[_0xf54e('0x22')](respondWithResult(_0x395bbc,null))[_0xf54e('0x2d')](handleError(_0x395bbc,null));};exports[_0xf54e('0xe3')]=function(_0x49f298,_0x602a27,_0x51f4b8){return db[_0xf54e('0xb8')][_0xf54e('0x5b')]({'where':{'id':_0x49f298[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x602a27,null))[_0xf54e('0x22')](function(_0x3bc515){if(_0x3bc515){return _0x3bc515[_0xf54e('0xe3')](_0x49f298[_0xf54e('0x62')][_0xf54e('0x6b')],_[_0xf54e('0xe4')](_0x49f298[_0xf54e('0x62')],['ids','id'])||{});}})[_0xf54e('0x22')](respondWithResult(_0x602a27,null))[_0xf54e('0x2d')](handleError(_0x602a27,null));};exports[_0xf54e('0xe5')]=function(_0x116a50,_0xe71353,_0x374187){var _0x2569d7={'raw':![],'where':{}};var _0x3b391f={};var _0x429793={'count':0x0,'rows':[]};return db[_0xf54e('0x3f')][_0xf54e('0x6f')]({'where':{'id':_0x116a50[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0xe71353,null))[_0xf54e('0x22')](function(_0x1c9536){if(_0x1c9536){_0x3b391f[_0xf54e('0x41')]=_['keys'](db[_0xf54e('0xb8')][_0xf54e('0x40')]);_0x3b391f[_0xf54e('0x43')]=_[_0xf54e('0x42')](_0x116a50['query']);_0x3b391f[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x3b391f['model'],_0x3b391f[_0xf54e('0x43')]);_0x2569d7[_0xf54e('0x44')]=_[_0xf54e('0x5a')](_0x3b391f[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x116a50[_0xf54e('0x43')][_0xf54e('0x45')]));_0x2569d7[_0xf54e('0x44')]=_0x2569d7[_0xf54e('0x44')][_0xf54e('0x46')]?_0x2569d7['attributes']:_0x3b391f[_0xf54e('0x41')];if(!_0x116a50[_0xf54e('0x43')][_0xf54e('0x47')](_0xf54e('0x48'))){_0x2569d7[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x116a50[_0xf54e('0x43')]['limit']);_0x2569d7[_0xf54e('0x32')]=qs[_0xf54e('0x32')](_0x116a50[_0xf54e('0x43')][_0xf54e('0x32')]);}_0x2569d7[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0x116a50[_0xf54e('0x43')][_0xf54e('0x49')]);_0x2569d7[_0xf54e('0x4d')]=qs[_0xf54e('0x4a')](_['pick'](_0x116a50[_0xf54e('0x43')],_0x3b391f[_0xf54e('0x4a')]));_0x2569d7['where']['ChatWebsiteId']=_0x1c9536['id'];if(_0x116a50[_0xf54e('0x43')][_0xf54e('0x4c')]){_0x2569d7[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0x2569d7[_0xf54e('0x4d')],{'$or':_[_0xf54e('0x69')](_0x2569d7[_0xf54e('0x44')],function(_0x80aa32){var _0x2fc5ae={};_0x2fc5ae[_0x80aa32]={'$like':'%'+_0x116a50[_0xf54e('0x43')]['filter']+'%'};return _0x2fc5ae;})});}_0x2569d7=_[_0xf54e('0x4e')]({},_0x2569d7,_0x116a50[_0xf54e('0x53')]);return db['ChatInteraction']['count']({'where':_0x2569d7[_0xf54e('0x4d')]})[_0xf54e('0x22')](function(_0x5b640a){_0x429793[_0xf54e('0x31')]=_0x5b640a;if(_0x116a50[_0xf54e('0x43')][_0xf54e('0x54')]){_0x2569d7['include']=[{'model':db['CmContact'],'as':_0xf54e('0xe6'),'required':![]},{'model':db['User'],'as':_0xf54e('0xe7'),'attributes':[_0xf54e('0x3b'),_0xf54e('0xe8'),_0xf54e('0xe9')],'required':![]},{'model':db[_0xf54e('0xea')],'as':'Tags','attributes':['id','name',_0xf54e('0xeb')],'where':_0x116a50[_0xf54e('0x43')]['tag']?{'id':_0x116a50[_0xf54e('0x43')][_0xf54e('0xec')]}:undefined,'required':_0x116a50[_0xf54e('0x43')][_0xf54e('0xec')]?!![]:![]}];}return db[_0xf54e('0xb8')]['findAll'](_0x2569d7);})['then'](function(_0x31e342){_0x429793[_0xf54e('0x57')]=_0x31e342;return _0x429793;});}})[_0xf54e('0x22')](respondWithFilteredResult(_0xe71353,_0x2569d7))[_0xf54e('0x2d')](handleError(_0xe71353,null));};function iftimePromise(_0x2d2593,_0x4bbfe4){return respondWithRpcPromise(_0xf54e('0xed'),_0xf54e('0xee'),{'command':_0x4bbfe4[_0xf54e('0xef')]?util['format']('iftime\x20%s,%s',_0x2d2593['interval'],_0x4bbfe4['timezone']):util['format']('iftime\x20%s',_0x2d2593[_0xf54e('0xf0')])},client9002)[_0xf54e('0x22')](function(_0x57aeaa){var _0x164252=_0x57aeaa&&_0x57aeaa[_0xf54e('0xf1')](_0xf54e('0xf2'))>=0x0?!![]:![];logger[_0xf54e('0x2b')](_0xf54e('0xf3'),_0x4bbfe4['id'],_0x2d2593['id'],_0x2d2593[_0xf54e('0xf0')],_0x164252?_0xf54e('0xf4'):'OFFLINE',_0x4bbfe4['timezone']?_0x4bbfe4['timezone']:_0xf54e('0xf5'));return _0x164252;})[_0xf54e('0x2d')](function(_0x49b62d){logger[_0xf54e('0x28')](_0xf54e('0xf3'),_0x4bbfe4['id'],_0x2d2593['id'],_0x2d2593[_0xf54e('0xf0')],util['inspect'](_0x49b62d,{'showHidden':![],'depth':null}),_0x4bbfe4[_0xf54e('0xef')]?_0x4bbfe4[_0xf54e('0xef')]:_0xf54e('0xf5'));return![];});}exports['getSnippet']=function(_0x2f602e,_0x542d28,_0x3b0de2){var _0x493b9d=0x0;var _0x1c7420=0x0;var _0x4fd3ec=![];var _0x1b27a7;var _0x55d080;return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0x2f602e[_0xf54e('0x59')]['id']},'include':[{'model':db[_0xf54e('0xf6')],'as':_0xf54e('0xf6'),'include':[{'model':db[_0xf54e('0xf6')],'as':'Intervals','attributes':['id',_0xf54e('0xf0')],'raw':!![]}]}]})[_0xf54e('0x22')](handleEntityNotFound(_0x542d28,null))[_0xf54e('0x22')](function(_0x1a058a){if(_0x1a058a){_0x1b27a7=_0x1a058a;return _0x1a058a[_0xf54e('0xf7')]({'raw':!![]});}})[_0xf54e('0x22')](function(_0x4745c7){if(_0x1b27a7){if(_0x4745c7){_0x55d080=_0x4745c7;}}return require(_0xf54e('0x7b'))['getLicense']();})[_0xf54e('0x22')](function(_0xf56dd2){if(_0xf56dd2){_0x1c7420=_0xf56dd2[_0xf54e('0xf8')];_0x4fd3ec=_0xf56dd2[_0xf54e('0x7c')];}})[_0xf54e('0x22')](function(){return db[_0xf54e('0xb8')][_0xf54e('0x31')]({'where':{'closed':![]}});})[_0xf54e('0x22')](function(_0x2ea0bf){_0x493b9d=_0x2ea0bf;if(_0x1c7420&&_0x2ea0bf>_0x1c7420){return db[_0xf54e('0xf9')][_0xf54e('0x6f')]({'where':{'id':0x1}})[_0xf54e('0x22')](function(_0x126d06){if(_0x126d06){_0x126d06[_0xf54e('0xfa')](_0xf54e('0xfb'));}});}})[_0xf54e('0x22')](function(){if(_0x1b27a7[_0xf54e('0xf6')]&&_0x1b27a7['Interval'][_0xf54e('0xfc')]){var _0x28df44=[];for(var _0xc4b0a0=0x0;_0xc4b0a0<_0x1b27a7[_0xf54e('0xf6')][_0xf54e('0xfc')][_0xf54e('0x46')];_0xc4b0a0++){var _0x3c4862=_0x1b27a7[_0xf54e('0xf6')][_0xf54e('0xfc')][_0xc4b0a0][_0xf54e('0x38')]({'plain':!![]});_0x28df44['push'](iftimePromise(_0x3c4862,_0x1b27a7));}return BPromise[_0xf54e('0xfd')](_0x28df44)[_0xf54e('0x22')](function(_0x4b1c5e){return _[_0xf54e('0xfe')](_0x4b1c5e);});}else{return!![];}})[_0xf54e('0x22')](function(_0x154bd1){var _0x1129e2=fs[_0xf54e('0xff')](path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x100')),_0xf54e('0xd0'));var _0x5a982a={'remote':_0x1b27a7[_0xf54e('0x101')],'query':querystring[_0xf54e('0x27')](_['merge'](_0x1b27a7[_0xf54e('0x38')]({'plain':!![]}),{'customerIp':_0x2f602e[_0xf54e('0x8d')][_0xf54e('0x102')]||_0x2f602e[_0xf54e('0x8d')][_0xf54e('0x103')]||_0x2f602e['connection'][_0xf54e('0x104')]||_0x2f602e['ip'],'referer':_0x2f602e[_0xf54e('0x8d')][_0xf54e('0xaf')],'openedInteractions':_0x493b9d,'maxInteractions':_0x1c7420,'virtual':_0x4fd3ec['virtual'],'online':_0x154bd1,'custom':_0x4fd3ec}))[_0xf54e('0x105')](/'/g,'\x5c\x27')};_0x542d28['send'](ejs[_0xf54e('0xd1')](Mustache['render'](_0x1129e2,_0x5a982a),{'proactiveActions':_0x55d080,'alignment':_0x1b27a7[_0xf54e('0x106')],'verticalAlignment':_0x1b27a7[_0xf54e('0x107')]}));})[_0xf54e('0x2d')](handleError(_0x542d28,null));};exports['addApplications']=function(_0x52cc65,_0x57005b,_0x3676e8){return db[_0xf54e('0x3f')][_0xf54e('0x6f')]({'where':{'id':_0x52cc65['params']['id']}})['then'](handleEntityNotFound(_0x57005b,null))[_0xf54e('0x22')](function(_0x5b313b){if(_0x5b313b){return db[_0xf54e('0x108')][_0xf54e('0x109')](function(_0x31700f){return db[_0xf54e('0xa4')][_0xf54e('0x39')]({'where':{'ChatWebsiteId':_0x52cc65[_0xf54e('0x59')]['id']},'transaction':_0x31700f})['then'](function(_0x1e4f68){var _0x50700b=_[_0xf54e('0x69')](_0x52cc65[_0xf54e('0x62')],function(_0x411160){_0x411160[_0xf54e('0x65')]=_0x52cc65[_0xf54e('0x59')]['id'];return _0x411160;});return db['ChatApplication'][_0xf54e('0x10a')](_0x50700b,{'transaction':_0x31700f});});})['then'](function(){return db[_0xf54e('0xa4')][_0xf54e('0x10b')]({'where':{'ChatWebsiteId':_0x52cc65[_0xf54e('0x59')]['id']},'order':_0xf54e('0xaa')});});}})['then'](respondWithResult(_0x57005b,null))[_0xf54e('0x2d')](handleError(_0x57005b,null));};exports[_0xf54e('0x10c')]=function(_0x931112,_0x2e7e95,_0xe98fad){var _0x319fc7={};var _0x1fb0e5={};var _0x49997c;var _0x309fe3;return db['ChatWebsite'][_0xf54e('0x6f')]({'where':{'id':_0x931112[_0xf54e('0x59')]['id']}})['then'](handleEntityNotFound(_0x2e7e95,null))[_0xf54e('0x22')](function(_0xea94a){if(_0xea94a){_0x49997c=_0xea94a;_0x1fb0e5['model']=_[_0xf54e('0x42')](db[_0xf54e('0xa4')][_0xf54e('0x40')]);_0x1fb0e5[_0xf54e('0x43')]=_['keys'](_0x931112[_0xf54e('0x43')]);_0x1fb0e5[_0xf54e('0x4a')]=_['intersection'](_0x1fb0e5[_0xf54e('0x41')],_0x1fb0e5[_0xf54e('0x43')]);_0x319fc7[_0xf54e('0x44')]=_['intersection'](_0x1fb0e5[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x931112[_0xf54e('0x43')][_0xf54e('0x45')]));_0x319fc7[_0xf54e('0x44')]=_0x319fc7[_0xf54e('0x44')]['length']?_0x319fc7[_0xf54e('0x44')]:_0x1fb0e5['model'];_0x319fc7[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0x931112['query'][_0xf54e('0x49')]);_0x319fc7['where']=qs[_0xf54e('0x4a')](_[_0xf54e('0x4b')](_0x931112[_0xf54e('0x43')],_0x1fb0e5['filters']));if(_0x931112[_0xf54e('0x43')]['filter']){_0x319fc7[_0xf54e('0x4d')]=_['merge'](_0x319fc7[_0xf54e('0x4d')],{'$or':_[_0xf54e('0x69')](_0x319fc7[_0xf54e('0x44')],function(_0x3e4e8f){var _0xd1b433={};_0xd1b433[_0x3e4e8f]={'$like':'%'+_0x931112[_0xf54e('0x43')][_0xf54e('0x4c')]+'%'};return _0xd1b433;})});}_0x319fc7=_['merge']({},_0x319fc7,_0x931112[_0xf54e('0x53')]);return _0x49997c[_0xf54e('0x10c')](_0x319fc7);}})[_0xf54e('0x22')](function(_0x10a315){if(_0x10a315){_0x309fe3=_0x10a315['length'];if(!_0x931112[_0xf54e('0x43')][_0xf54e('0x47')]('nolimit')){_0x319fc7[_0xf54e('0x33')]=qs['limit'](_0x931112[_0xf54e('0x43')][_0xf54e('0x33')]);_0x319fc7['offset']=qs[_0xf54e('0x32')](_0x931112['query'][_0xf54e('0x32')]);}return _0x49997c[_0xf54e('0x10c')](_0x319fc7);}})['then'](function(_0x197d79){if(_0x197d79){return _0x197d79?{'count':_0x309fe3,'rows':_0x197d79}:null;}})[_0xf54e('0x22')](respondWithResult(_0x2e7e95,null))[_0xf54e('0x2d')](handleError(_0x2e7e95,null));};exports[_0xf54e('0x10d')]=function(_0x4e91d9,_0x259d22,_0x4cb71f){return db['chatProactiveAction']['find']({'where':{'id':_0x4e91d9[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x259d22,null))[_0xf54e('0x22')](function(_0x208b9b){if(_0x208b9b){return _0x208b9b[_0xf54e('0x10d')](_0x4e91d9[_0xf54e('0x62')][_0xf54e('0x6b')],_[_0xf54e('0xe4')](_0x4e91d9[_0xf54e('0x62')],['ids','id'])||{});}})[_0xf54e('0x22')](respondWithResult(_0x259d22,null))[_0xf54e('0x2d')](handleError(_0x259d22,null));};exports[_0xf54e('0xf7')]=function(_0x36f6ce,_0x35245b,_0x53016b){var _0x37c319={};var _0x50cfe6={};var _0x142f01;var _0x5d4db4;return db[_0xf54e('0x3f')]['findOne']({'where':{'id':_0x36f6ce[_0xf54e('0x59')]['id']}})['then'](handleEntityNotFound(_0x35245b,null))[_0xf54e('0x22')](function(_0x509c2c){if(_0x509c2c){_0x142f01=_0x509c2c;_0x50cfe6[_0xf54e('0x41')]=_[_0xf54e('0x42')](db[_0xf54e('0x10e')]['rawAttributes']);_0x50cfe6[_0xf54e('0x43')]=_[_0xf54e('0x42')](_0x36f6ce['query']);_0x50cfe6[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x50cfe6[_0xf54e('0x41')],_0x50cfe6[_0xf54e('0x43')]);_0x37c319['attributes']=_[_0xf54e('0x5a')](_0x50cfe6[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x36f6ce[_0xf54e('0x43')][_0xf54e('0x45')]));_0x37c319[_0xf54e('0x44')]=_0x37c319[_0xf54e('0x44')][_0xf54e('0x46')]?_0x37c319[_0xf54e('0x44')]:_0x50cfe6[_0xf54e('0x41')];_0x37c319[_0xf54e('0x68')]=qs['sort'](_0x36f6ce[_0xf54e('0x43')]['sort']);_0x37c319['where']=qs[_0xf54e('0x4a')](_['pick'](_0x36f6ce[_0xf54e('0x43')],_0x50cfe6['filters']));if(_0x36f6ce[_0xf54e('0x43')]['filter']){_0x37c319['where']=_[_0xf54e('0x4e')](_0x37c319[_0xf54e('0x4d')],{'$or':_[_0xf54e('0x69')](_0x37c319[_0xf54e('0x44')],function(_0x508162){var _0x2122ec={};_0x2122ec[_0x508162]={'$like':'%'+_0x36f6ce['query']['filter']+'%'};return _0x2122ec;})});}_0x37c319=_[_0xf54e('0x4e')]({},_0x37c319,_0x36f6ce[_0xf54e('0x53')]);return _0x142f01[_0xf54e('0xf7')](_0x37c319);}})['then'](function(_0x26dbfb){if(_0x26dbfb){_0x5d4db4=_0x26dbfb[_0xf54e('0x46')];if(!_0x36f6ce[_0xf54e('0x43')][_0xf54e('0x47')](_0xf54e('0x48'))){_0x37c319[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x36f6ce[_0xf54e('0x43')][_0xf54e('0x33')]);_0x37c319[_0xf54e('0x32')]=qs[_0xf54e('0x32')](_0x36f6ce['query'][_0xf54e('0x32')]);}return _0x142f01[_0xf54e('0xf7')](_0x37c319);}})[_0xf54e('0x22')](function(_0x2ff74d){if(_0x2ff74d){return _0x2ff74d?{'count':_0x5d4db4,'rows':_0x2ff74d}:null;}})['then'](respondWithResult(_0x35245b,null))['catch'](handleError(_0x35245b,null));};exports[_0xf54e('0x10f')]=function(_0xb9c028,_0x2af905,_0x42cc39){var _0x3a3b50=_0xb9c028[_0xf54e('0x43')][_0xf54e('0x110')]===_0xf54e('0x111')?_0xf54e('0x112'):_0xf54e('0x113');return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'attributes':['id',_0x3a3b50],'where':{'id':_0xb9c028[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x2af905,null))[_0xf54e('0x22')](function(_0x15107a){if(_0x15107a){var _0x1a42c=_0x15107a[_0x3a3b50];var _0x2d7c34=_0x1a42c&&_0x1a42c[_0xf54e('0x114')]?_0x1a42c[_0xf54e('0x114')]:[];_0x2af905[_0xf54e('0x3c')]({'fromKey':_['isNil'](_0x1a42c[_0xf54e('0x115')])?undefined:_0x1a42c['fromKey'],'count':_0x2d7c34[_0xf54e('0x46')],'rows':_0x2d7c34});}})[_0xf54e('0x2d')](handleError(_0x2af905,null));};exports[_0xf54e('0x116')]=function(_0x4e466f,_0x145ef1,_0x5042a2){var _0x5df31c={'raw':!![],'where':{}};var _0x26c50f={};var _0x43bf0f={'count':0x0,'rows':[]};return db[_0xf54e('0x3f')][_0xf54e('0x6f')]({'where':{'id':_0x4e466f[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x145ef1,null))[_0xf54e('0x22')](function(_0x55bef6){if(_0x55bef6){_0x26c50f[_0xf54e('0x41')]=_[_0xf54e('0x42')](db[_0xf54e('0xd4')][_0xf54e('0x40')]);_0x26c50f[_0xf54e('0x43')]=_['keys'](_0x4e466f[_0xf54e('0x43')]);_0x26c50f[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x26c50f[_0xf54e('0x41')],_0x26c50f['query']);_0x5df31c['attributes']=_[_0xf54e('0x5a')](_0x26c50f[_0xf54e('0x41')],qs['fields'](_0x4e466f['query'][_0xf54e('0x45')]));_0x5df31c['attributes']=_0x5df31c[_0xf54e('0x44')][_0xf54e('0x46')]?_0x5df31c[_0xf54e('0x44')]:_0x26c50f[_0xf54e('0x41')];if(!_0x4e466f[_0xf54e('0x43')][_0xf54e('0x47')](_0xf54e('0x48'))){_0x5df31c[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x4e466f['query'][_0xf54e('0x33')]);_0x5df31c[_0xf54e('0x32')]=qs[_0xf54e('0x32')](_0x4e466f[_0xf54e('0x43')][_0xf54e('0x32')]);}_0x5df31c[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0x4e466f['query'][_0xf54e('0x49')]);_0x5df31c['where']=qs[_0xf54e('0x4a')](_[_0xf54e('0x4b')](_0x4e466f[_0xf54e('0x43')],_0x26c50f[_0xf54e('0x4a')]));_0x5df31c[_0xf54e('0x4d')][_0xf54e('0x65')]=_0x55bef6['id'];if(_0x4e466f['query'][_0xf54e('0x4c')]){_0x5df31c[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0x5df31c[_0xf54e('0x4d')],{'$or':_['map'](_0x5df31c['attributes'],function(_0x34326c){var _0x148d39={};_0x148d39[_0x34326c]={'$like':'%'+_0x4e466f[_0xf54e('0x43')]['filter']+'%'};return _0x148d39;})});}_0x5df31c=_['merge']({},_0x5df31c,_0x4e466f[_0xf54e('0x53')]);return db[_0xf54e('0xd4')]['count']({'where':_0x5df31c['where']})[_0xf54e('0x22')](function(_0x48b3ef){_0x43bf0f['count']=_0x48b3ef;if(_0x4e466f[_0xf54e('0x43')][_0xf54e('0x54')]){_0x5df31c[_0xf54e('0x55')]=[{'all':!![]}];}return db[_0xf54e('0xd4')]['findAll'](_0x5df31c);})['then'](function(_0x50e7e0){_0x43bf0f['rows']=_0x50e7e0;return _0x43bf0f;});}})[_0xf54e('0x22')](respondWithFilteredResult(_0x145ef1,_0x5df31c))[_0xf54e('0x2d')](handleError(_0x145ef1,null));};exports[_0xf54e('0x117')]=function(_0x48f60d,_0x10c9dd,_0x159608){return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0x48f60d[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x10c9dd,null))['then'](function(_0x4a0820){if(_0x4a0820){return _0x4a0820['addAgents'](_0x48f60d['body'][_0xf54e('0x6b')],_[_0xf54e('0xe4')](_0x48f60d[_0xf54e('0x62')],['ids','id'])||{})['spread'](function(_0x3b0d33){for(var _0x509687=0x0;_0x509687<_0x48f60d[_0xf54e('0x62')][_0xf54e('0x6b')][_0xf54e('0x46')];_0x509687+=0x1){socket[_0xf54e('0x118')]('userChatWebsite:save',{'UserId':_0x48f60d['body'][_0xf54e('0x6b')][_0x509687],'ChatWebsiteId':_0x48f60d['params']['id']});}return _0x3b0d33;});}})['then'](respondWithResult(_0x10c9dd,null))['catch'](handleError(_0x10c9dd,null));};exports[_0xf54e('0x119')]=function(_0x38e4fd,_0xdf7bd5,_0x3e2c26){return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x38e4fd[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0xdf7bd5,null))[_0xf54e('0x22')](function(_0x3ee44d){if(_0x3ee44d){return _0x3ee44d[_0xf54e('0x119')](_0x38e4fd[_0xf54e('0x43')][_0xf54e('0x6b')])[_0xf54e('0x22')](function(){if(_['isArray'](_0x38e4fd[_0xf54e('0x43')][_0xf54e('0x6b')])){for(var _0x37d260=0x0;_0x37d260<_0x38e4fd['query']['ids'][_0xf54e('0x46')];_0x37d260+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x38e4fd['query'][_0xf54e('0x6b')][_0x37d260]),'ChatWebsiteId':Number(_0x38e4fd['params']['id'])});}}else{socket[_0xf54e('0x118')](_0xf54e('0x11a'),{'UserId':Number(_0x38e4fd[_0xf54e('0x43')][_0xf54e('0x6b')]),'ChatWebsiteId':Number(_0x38e4fd[_0xf54e('0x59')]['id'])});}});}})[_0xf54e('0x22')](respondWithStatusCode(_0xdf7bd5,null))[_0xf54e('0x2d')](handleError(_0xdf7bd5,null));};exports[_0xf54e('0x11b')]=function(_0xe68fc9,_0x2546d1,_0x9c42d8){var _0x13c7fd={};var _0x5bffd6={};var _0x4df612;var _0x4bbb17;return db[_0xf54e('0x3f')][_0xf54e('0x6f')]({'where':{'id':_0xe68fc9['params']['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x2546d1,null))[_0xf54e('0x22')](function(_0x39c630){if(_0x39c630){_0x4df612=_0x39c630;_0x5bffd6['model']=_[_0xf54e('0x42')](db[_0xf54e('0xc3')][_0xf54e('0x40')]);_0x5bffd6[_0xf54e('0x43')]=_['keys'](_0xe68fc9[_0xf54e('0x43')]);_0x5bffd6[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x5bffd6['model'],_0x5bffd6[_0xf54e('0x43')]);_0x13c7fd[_0xf54e('0x44')]=_['intersection'](_0x5bffd6[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0xe68fc9['query'][_0xf54e('0x45')]));_0x13c7fd['attributes']=_0x13c7fd[_0xf54e('0x44')][_0xf54e('0x46')]?_0x13c7fd['attributes']:_0x5bffd6[_0xf54e('0x41')];_0x13c7fd[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0xe68fc9[_0xf54e('0x43')][_0xf54e('0x49')]);_0x13c7fd[_0xf54e('0x4d')]=qs['filters'](_[_0xf54e('0x4b')](_0xe68fc9['query'],_0x5bffd6[_0xf54e('0x4a')]));if(_0xe68fc9[_0xf54e('0x43')]['filter']){_0x13c7fd[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0x13c7fd[_0xf54e('0x4d')],{'$or':_['map'](_0x13c7fd[_0xf54e('0x44')],function(_0x116698){var _0x3fbd4d={};_0x3fbd4d[_0x116698]={'$like':'%'+_0xe68fc9['query']['filter']+'%'};return _0x3fbd4d;})});}_0x13c7fd=_[_0xf54e('0x4e')]({},_0x13c7fd,_0xe68fc9[_0xf54e('0x53')]);return _0x4df612[_0xf54e('0x11b')](_0x13c7fd);}})['then'](function(_0x427ce7){if(_0x427ce7){_0x4bbb17=_0x427ce7[_0xf54e('0x46')];if(!_0xe68fc9[_0xf54e('0x43')][_0xf54e('0x47')](_0xf54e('0x48'))){_0x13c7fd[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0xe68fc9[_0xf54e('0x43')]['limit']);_0x13c7fd[_0xf54e('0x32')]=qs[_0xf54e('0x32')](_0xe68fc9[_0xf54e('0x43')]['offset']);}return _0x4df612['getAgents'](_0x13c7fd);}})['then'](function(_0x46460b){if(_0x46460b){return _0x46460b?{'count':_0x4bbb17,'rows':_0x46460b}:null;}})[_0xf54e('0x22')](respondWithResult(_0x2546d1,null))['catch'](handleError(_0x2546d1,null));};
\ No newline at end of file
+var _0x3702=['then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','end','count','offset','status','Content-Range','json','apply','reject','save','destroy','get','ChatWebsites','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','isNil','existsSync','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','customerIp','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','type','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','update','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','addInteraction','omit','Owner','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','custom','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','x-forwarded-for','x-real-ip','remoteAddress','replace','alignment','addApplications','sequelize','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','userChatWebsite:remove','emit','getAgents','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x14f412,_0x3caa78){var _0x3cb477=function(_0x5713cb){while(--_0x5713cb){_0x14f412['push'](_0x14f412['shift']());}};_0x3cb477(++_0x3caa78);}(_0x3702,0xf7));var _0x2370=function(_0x59d692,_0x37a13a){_0x59d692=_0x59d692-0x0;var _0x5b0dee=_0x3702[_0x59d692];return _0x5b0dee;};'use strict';var pdf=require(_0x2370('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2370('0x1'));var jsonpatch=require(_0x2370('0x2'));var rp=require(_0x2370('0x3'));var moment=require('moment');var BPromise=require(_0x2370('0x4'));var Mustache=require('mustache');var util=require(_0x2370('0x5'));var path=require(_0x2370('0x6'));var sox=require(_0x2370('0x7'));var csv=require(_0x2370('0x8'));var ejs=require(_0x2370('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2370('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2370('0xb'));var Papa=require(_0x2370('0xc'));var Redis=require(_0x2370('0xd'));var authService=require(_0x2370('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2370('0xf'));var logger=require(_0x2370('0x10'))(_0x2370('0x11'));var utils=require(_0x2370('0x12'));var config=require(_0x2370('0x13'));var db=require('../../mysqldb')['db'];config[_0x2370('0x14')]=_[_0x2370('0x15')](config['redis'],{'host':_0x2370('0x16'),'port':0x18eb});var socket=require(_0x2370('0x17'))(new Redis(config[_0x2370('0x14')]));require('./chatWebsite.socket')[_0x2370('0x18')](socket);var jayson=require(_0x2370('0x19'));var client=jayson[_0x2370('0x1a')][_0x2370('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x2370('0x1b')]({'port':0x232a});var client9003=jayson[_0x2370('0x1a')]['http']({'port':0x232b});function checkPasswordPattern(_0xca45a,_0x9fb718,_0x2a05c4){if(_0x2a05c4){var _0x2da35d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2da35d[_0x2370('0x1c')](_0x9fb718)){return _0xca45a;}else{throw new Error(_0x2370('0x1d'));}}else{return _0xca45a;}}function respondWithRpcPromise(_0x2d41da,_0x215425,_0x1883cd,_0x2933bc){return new BPromise(function(_0x37f380,_0x2c44bd){var _0x409d09=_0x2933bc||client;return _0x409d09['request'](_0x2d41da,_0x1883cd)[_0x2370('0x1e')](function(_0x55be99){logger[_0x2370('0x1f')](_0x2370('0x20'),_0x215425,'request\x20sent');logger['debug'](_0x2370('0x21'),_0x215425,_0x2370('0x22'),JSON['stringify'](_0x55be99));if(_0x55be99[_0x2370('0x23')]){if(_0x55be99[_0x2370('0x23')][_0x2370('0x24')]===0x1f4){logger[_0x2370('0x23')](_0x2370('0x20'),_0x215425,_0x55be99[_0x2370('0x23')][_0x2370('0x25')]);return _0x2c44bd(_0x55be99['error'][_0x2370('0x25')]);}logger['error'](_0x2370('0x20'),_0x215425,_0x55be99[_0x2370('0x23')][_0x2370('0x25')]);return _0x37f380(_0x55be99[_0x2370('0x23')][_0x2370('0x25')]);}else{logger[_0x2370('0x1f')](_0x2370('0x20'),_0x215425,_0x2370('0x22'));_0x37f380(_0x55be99['result']['message']);}})['catch'](function(_0x5579b2){logger[_0x2370('0x23')](_0x2370('0x20'),_0x215425,_0x5579b2);_0x2c44bd(_0x5579b2);});});}function respondWithStatusCode(_0x3d981a,_0xbe3dc3){_0xbe3dc3=_0xbe3dc3||0xcc;return function(_0xdb773a){if(_0xdb773a){return _0x3d981a[_0x2370('0x26')](_0xbe3dc3);}return _0x3d981a['status'](_0xbe3dc3)[_0x2370('0x27')]();};}function respondWithResult(_0x5023ea,_0x58de09){_0x58de09=_0x58de09||0xc8;return function(_0x382e0f){if(_0x382e0f){return _0x5023ea['status'](_0x58de09)['json'](_0x382e0f);}};}function respondWithFilteredResult(_0x54fd80,_0x2a4dc8){return function(_0x356f11){if(_0x356f11){var _0x13cf1c=_0x356f11[_0x2370('0x28')],_0x588ad9=_0x2a4dc8[_0x2370('0x29')],_0x4c420e=_0x2a4dc8['offset']+_0x2a4dc8['limit'],_0x13a3fa;if(_0x4c420e>=_0x13cf1c){_0x4c420e=_0x13cf1c;_0x13a3fa=0xc8;}else{_0x13a3fa=0xce;}_0x54fd80[_0x2370('0x2a')](_0x13a3fa);return _0x54fd80['set'](_0x2370('0x2b'),_0x588ad9+'-'+_0x4c420e+'/'+_0x13cf1c)[_0x2370('0x2c')](_0x356f11);}return null;};}function patchUpdates(_0x570e90){return function(_0x1d6d3f){try{jsonpatch[_0x2370('0x2d')](_0x1d6d3f,_0x570e90,!![]);}catch(_0x381cd8){return BPromise[_0x2370('0x2e')](_0x381cd8);}return _0x1d6d3f[_0x2370('0x2f')]();};}function saveUpdates(_0x106ffa,_0x3126d8){return function(_0x5ddb16){if(_0x5ddb16){return _0x5ddb16['update'](_0x106ffa)[_0x2370('0x1e')](function(_0x4f8996){return _0x4f8996;});}return null;};}function removeEntity(_0x2e32f6,_0x4de051){return function(_0x26031d){if(_0x26031d){return _0x26031d[_0x2370('0x30')]()[_0x2370('0x1e')](function(){var _0x5031e7=_0x26031d[_0x2370('0x31')]({'plain':!![]});var _0x3cf9b7=_0x2370('0x32');return db['UserProfileResource'][_0x2370('0x30')]({'where':{'type':_0x3cf9b7,'resourceId':_0x5031e7['id']}})[_0x2370('0x1e')](function(){return _0x26031d;});})[_0x2370('0x1e')](function(){_0x2e32f6[_0x2370('0x2a')](0xcc)[_0x2370('0x27')]();});}};}function handleEntityNotFound(_0x51566a,_0x1bef8a){return function(_0x24d20d){if(!_0x24d20d){_0x51566a[_0x2370('0x26')](0x194);}return _0x24d20d;};}function handleError(_0x559e25,_0x438043){_0x438043=_0x438043||0x1f4;return function(_0x5a3250){logger[_0x2370('0x23')](_0x5a3250['stack']);if(_0x5a3250[_0x2370('0x33')]){delete _0x5a3250[_0x2370('0x33')];}_0x559e25[_0x2370('0x2a')](_0x438043)[_0x2370('0x34')](_0x5a3250);};}exports[_0x2370('0x35')]=function(_0x59a067,_0xc32b99){var _0x3ba7e7={'include':[{'model':db[_0x2370('0x36')],'as':_0x2370('0x37')}]},_0x4961d1={},_0xc7a155={'count':0x0,'rows':[]};var _0x46da0c=db[_0x2370('0x38')]['rawAttributes'];_0x4961d1[_0x2370('0x39')]=_[_0x2370('0x3a')](_0x46da0c);_0x4961d1[_0x2370('0x3b')]=_[_0x2370('0x3a')](_0x59a067[_0x2370('0x3b')]);_0x4961d1[_0x2370('0x3c')]=_['intersection'](_0x4961d1['model'],_0x4961d1[_0x2370('0x3b')]);_0x3ba7e7[_0x2370('0x3d')]=_[_0x2370('0x3e')](_0x4961d1[_0x2370('0x39')],qs[_0x2370('0x3f')](_0x59a067[_0x2370('0x3b')]['fields']));_0x3ba7e7['attributes']=_0x3ba7e7[_0x2370('0x3d')][_0x2370('0x40')]?_0x3ba7e7[_0x2370('0x3d')]:_0x4961d1[_0x2370('0x39')];if(!_0x59a067['query'][_0x2370('0x41')](_0x2370('0x42'))){_0x3ba7e7[_0x2370('0x43')]=qs[_0x2370('0x43')](_0x59a067[_0x2370('0x3b')][_0x2370('0x43')]);_0x3ba7e7[_0x2370('0x29')]=qs['offset'](_0x59a067['query'][_0x2370('0x29')]);}_0x3ba7e7['order']=qs[_0x2370('0x44')](_0x59a067['query'][_0x2370('0x44')]);_0x3ba7e7[_0x2370('0x45')]=qs[_0x2370('0x3c')](_[_0x2370('0x46')](_0x59a067[_0x2370('0x3b')],_0x4961d1[_0x2370('0x3c')]));if(_0x59a067[_0x2370('0x3b')][_0x2370('0x47')]){_0x3ba7e7[_0x2370('0x45')]=_[_0x2370('0x48')](_0x3ba7e7[_0x2370('0x45')],{'$or':_[_0x2370('0x49')](_0x46da0c,function(_0x358992){if(_0x358992['type'][_0x2370('0x4a')]!==_0x2370('0x4b')){var _0x5b2722={};_0x5b2722[_0x358992[_0x2370('0x4c')]]={'$like':'%'+_0x59a067[_0x2370('0x3b')]['filter']+'%'};return _0x5b2722;}})});}_0x3ba7e7=_[_0x2370('0x48')]({},_0x3ba7e7,_0x59a067[_0x2370('0x4d')]);var _0x261d26={'where':_0x3ba7e7[_0x2370('0x45')]};return db[_0x2370('0x38')]['count'](_0x261d26)['then'](function(_0x1a6268){_0xc7a155[_0x2370('0x28')]=_0x1a6268;if(_0x59a067[_0x2370('0x3b')][_0x2370('0x4e')]){_0x3ba7e7[_0x2370('0x4f')]=[{'all':!![]}];}return db['ChatWebsite'][_0x2370('0x50')](_0x3ba7e7);})[_0x2370('0x1e')](function(_0x1e628f){_0xc7a155[_0x2370('0x51')]=_0x1e628f;return _0xc7a155;})[_0x2370('0x1e')](respondWithFilteredResult(_0xc32b99,_0x3ba7e7))[_0x2370('0x52')](handleError(_0xc32b99,null));};exports[_0x2370('0x53')]=function(_0x133c3d,_0x36f8fe){var _0x610caa={'raw':![],'where':{'id':_0x133c3d[_0x2370('0x54')]['id']},'include':[{'model':db[_0x2370('0x36')],'as':_0x2370('0x37')}]},_0x276970={};_0x276970[_0x2370('0x39')]=_[_0x2370('0x3a')](db['ChatWebsite'][_0x2370('0x55')]);_0x276970[_0x2370('0x3b')]=_[_0x2370('0x3a')](_0x133c3d[_0x2370('0x3b')]);_0x276970[_0x2370('0x3c')]=_['intersection'](_0x276970[_0x2370('0x39')],_0x276970[_0x2370('0x3b')]);_0x610caa[_0x2370('0x3d')]=_[_0x2370('0x3e')](_0x276970['model'],qs[_0x2370('0x3f')](_0x133c3d[_0x2370('0x3b')][_0x2370('0x3f')]));_0x610caa[_0x2370('0x3d')]=_0x610caa[_0x2370('0x3d')]['length']?_0x610caa[_0x2370('0x3d')]:_0x276970[_0x2370('0x39')];if(_0x133c3d[_0x2370('0x3b')]['includeAll']){_0x610caa[_0x2370('0x4f')]=[{'all':!![]}];}_0x610caa=_[_0x2370('0x48')]({},_0x610caa,_0x133c3d[_0x2370('0x4d')]);return db[_0x2370('0x38')][_0x2370('0x56')](_0x610caa)[_0x2370('0x1e')](handleEntityNotFound(_0x36f8fe,null))[_0x2370('0x1e')](respondWithResult(_0x36f8fe,null))['catch'](handleError(_0x36f8fe,null));};exports[_0x2370('0x57')]=function(_0x5ad896,_0x4042d0){return db[_0x2370('0x38')][_0x2370('0x57')](_0x5ad896['body'],{})[_0x2370('0x1e')](function(_0x41bfb1){var _0x4474c6=_0x5ad896[_0x2370('0x58')][_0x2370('0x31')]({'plain':!![]});if(!_0x4474c6)throw new Error(_0x2370('0x59'));if(_0x4474c6['role']===_0x2370('0x58')){var _0x19a56a=_0x41bfb1[_0x2370('0x31')]({'plain':!![]});var _0xe8d80f=_0x2370('0x32');return db['UserProfileSection'][_0x2370('0x56')]({'where':{'name':_0xe8d80f,'userProfileId':_0x4474c6[_0x2370('0x5a')]},'raw':!![]})[_0x2370('0x1e')](function(_0x45961a){if(_0x45961a&&_0x45961a['autoAssociation']===0x0){return db[_0x2370('0x5b')][_0x2370('0x57')]({'name':_0x19a56a[_0x2370('0x33')],'resourceId':_0x19a56a['id'],'type':_0x45961a[_0x2370('0x33')],'sectionId':_0x45961a['id']},{})[_0x2370('0x1e')](function(){return _0x41bfb1;});}else{return _0x41bfb1;}})[_0x2370('0x52')](function(_0x2f5a1e){logger[_0x2370('0x23')](_0x2370('0x5c'),_0x2f5a1e);throw _0x2f5a1e;});}return _0x41bfb1;})[_0x2370('0x1e')](respondWithResult(_0x4042d0,0xc9))['catch'](handleError(_0x4042d0,null));};exports['update']=function(_0x42945c,_0x3f8dbb){if(_0x42945c['body']['id']){delete _0x42945c[_0x2370('0x5d')]['id'];}return db[_0x2370('0x38')][_0x2370('0x56')]({'where':{'id':_0x42945c[_0x2370('0x54')]['id']},'include':[{'model':db[_0x2370('0x36')],'as':_0x2370('0x37')}]})['then'](handleEntityNotFound(_0x3f8dbb,null))[_0x2370('0x1e')](saveUpdates(_0x42945c[_0x2370('0x5d')],null))[_0x2370('0x1e')](respondWithResult(_0x3f8dbb,null))[_0x2370('0x52')](handleError(_0x3f8dbb,null));};exports[_0x2370('0x30')]=function(_0x3c0279,_0x2bd7e6){return db[_0x2370('0x38')][_0x2370('0x56')]({'where':{'id':_0x3c0279[_0x2370('0x54')]['id']}})['then'](handleEntityNotFound(_0x2bd7e6,null))[_0x2370('0x1e')](removeEntity(_0x2bd7e6,null))[_0x2370('0x52')](handleError(_0x2bd7e6,null));};exports['describe']=function(_0x5cae6a,_0x3e2b74){return db[_0x2370('0x38')][_0x2370('0x5e')]()['then'](respondWithResult(_0x3e2b74,null))['catch'](handleError(_0x3e2b74,null));};exports[_0x2370('0x5f')]=function(_0xde1b04,_0x21e00f,_0x42ba55){if(_0xde1b04[_0x2370('0x5d')]['id']){delete _0xde1b04['body']['id'];}return db[_0x2370('0x38')][_0x2370('0x56')]({'where':{'id':_0xde1b04[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x21e00f,null))[_0x2370('0x1e')](function(_0x2e0e66){if(_0x2e0e66){_0xde1b04[_0x2370('0x5d')][_0x2370('0x60')]=_0x2e0e66['id'];return db[_0x2370('0x61')]['create'](_0xde1b04['body']);}})[_0x2370('0x1e')](respondWithResult(_0x21e00f,null))['catch'](handleError(_0x21e00f,null));};exports[_0x2370('0x62')]=function(_0x15ef6d,_0x156554,_0x2146ab){var _0x548eff={'raw':![],'where':{}};var _0x2c38e8={};var _0x4e81bf={'count':0x0,'rows':[]};return db[_0x2370('0x38')][_0x2370('0x63')]({'where':{'id':_0x15ef6d[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x156554,null))[_0x2370('0x1e')](function(_0x2aab06){if(_0x2aab06){_0x2c38e8[_0x2370('0x39')]=_['keys'](db[_0x2370('0x61')][_0x2370('0x55')]);_0x2c38e8[_0x2370('0x3b')]=_[_0x2370('0x3a')](_0x15ef6d[_0x2370('0x3b')]);_0x2c38e8[_0x2370('0x3c')]=_[_0x2370('0x3e')](_0x2c38e8[_0x2370('0x39')],_0x2c38e8[_0x2370('0x3b')]);_0x548eff[_0x2370('0x3d')]=_['intersection'](_0x2c38e8['model'],qs[_0x2370('0x3f')](_0x15ef6d[_0x2370('0x3b')][_0x2370('0x3f')]));_0x548eff[_0x2370('0x3d')]=_0x548eff[_0x2370('0x3d')][_0x2370('0x40')]?_0x548eff['attributes']:_0x2c38e8['model'];if(!_0x15ef6d[_0x2370('0x3b')][_0x2370('0x41')]('nolimit')){_0x548eff[_0x2370('0x43')]=qs[_0x2370('0x43')](_0x15ef6d[_0x2370('0x3b')][_0x2370('0x43')]);_0x548eff[_0x2370('0x29')]=qs[_0x2370('0x29')](_0x15ef6d[_0x2370('0x3b')]['offset']);}_0x548eff[_0x2370('0x64')]=qs[_0x2370('0x44')](_0x15ef6d[_0x2370('0x3b')][_0x2370('0x44')]);_0x548eff[_0x2370('0x45')]=qs[_0x2370('0x3c')](_['pick'](_0x15ef6d[_0x2370('0x3b')],_0x2c38e8[_0x2370('0x3c')]));_0x548eff[_0x2370('0x45')][_0x2370('0x60')]=_0x2aab06['id'];if(_0x15ef6d[_0x2370('0x3b')][_0x2370('0x47')]){_0x548eff[_0x2370('0x45')]=_[_0x2370('0x48')](_0x548eff['where'],{'$or':_[_0x2370('0x49')](_0x548eff['attributes'],function(_0x19e745){var _0x2e5581={};_0x2e5581[_0x19e745]={'$like':'%'+_0x15ef6d['query'][_0x2370('0x47')]+'%'};return _0x2e5581;})});}_0x548eff=_[_0x2370('0x48')]({},_0x548eff,_0x15ef6d['options']);return db[_0x2370('0x61')][_0x2370('0x28')]({'where':_0x548eff[_0x2370('0x45')]})[_0x2370('0x1e')](function(_0x262fb7){_0x4e81bf[_0x2370('0x28')]=_0x262fb7;if(_0x15ef6d[_0x2370('0x3b')]['includeAll']){_0x548eff[_0x2370('0x4f')]=[{'all':!![]}];}return db[_0x2370('0x61')][_0x2370('0x50')](_0x548eff);})['then'](function(_0x238ff9){_0x4e81bf[_0x2370('0x51')]=_0x238ff9;return _0x4e81bf;});}})['then'](respondWithFilteredResult(_0x156554,_0x548eff))[_0x2370('0x52')](handleError(_0x156554,null));};exports[_0x2370('0x65')]=function(_0x27a1b9,_0x523d33,_0x2d4e15){return db[_0x2370('0x38')]['find']({'where':{'id':_0x27a1b9[_0x2370('0x54')]['id']}})['then'](handleEntityNotFound(_0x523d33,null))[_0x2370('0x1e')](function(_0x10b441){if(_0x10b441){return _0x10b441['removeDispositions'](_0x27a1b9[_0x2370('0x3b')][_0x2370('0x66')]);}})['then'](respondWithStatusCode(_0x523d33,null))['catch'](handleError(_0x523d33,null));};exports[_0x2370('0x67')]=function(_0x5b44af,_0x3e45d7,_0x58a00b){if(_0x5b44af[_0x2370('0x5d')]['id']){delete _0x5b44af['body']['id'];}return db[_0x2370('0x38')][_0x2370('0x56')]({'where':{'id':_0x5b44af[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x3e45d7,null))[_0x2370('0x1e')](function(_0x2cf4b5){if(_0x2cf4b5){_0x5b44af[_0x2370('0x5d')][_0x2370('0x60')]=_0x2cf4b5['id'];return db['CannedAnswer']['create'](_0x5b44af[_0x2370('0x5d')]);}})[_0x2370('0x1e')](respondWithResult(_0x3e45d7,null))['catch'](handleError(_0x3e45d7,null));};exports[_0x2370('0x68')]=function(_0x1cef75,_0x56b9eb,_0x3f26e1){var _0x4f5d20={'raw':![],'where':{}};var _0x5889af={};var _0x437078={'count':0x0,'rows':[]};return db[_0x2370('0x38')][_0x2370('0x63')]({'where':{'id':_0x1cef75[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x56b9eb,null))['then'](function(_0x50d26e){if(_0x50d26e){_0x5889af[_0x2370('0x39')]=_[_0x2370('0x3a')](db[_0x2370('0x69')][_0x2370('0x55')]);_0x5889af[_0x2370('0x3b')]=_[_0x2370('0x3a')](_0x1cef75['query']);_0x5889af[_0x2370('0x3c')]=_[_0x2370('0x3e')](_0x5889af['model'],_0x5889af['query']);_0x4f5d20[_0x2370('0x3d')]=_['intersection'](_0x5889af['model'],qs[_0x2370('0x3f')](_0x1cef75['query']['fields']));_0x4f5d20[_0x2370('0x3d')]=_0x4f5d20[_0x2370('0x3d')][_0x2370('0x40')]?_0x4f5d20[_0x2370('0x3d')]:_0x5889af['model'];if(!_0x1cef75[_0x2370('0x3b')][_0x2370('0x41')]('nolimit')){_0x4f5d20[_0x2370('0x43')]=qs[_0x2370('0x43')](_0x1cef75[_0x2370('0x3b')][_0x2370('0x43')]);_0x4f5d20['offset']=qs[_0x2370('0x29')](_0x1cef75[_0x2370('0x3b')][_0x2370('0x29')]);}_0x4f5d20[_0x2370('0x64')]=qs[_0x2370('0x44')](_0x1cef75[_0x2370('0x3b')][_0x2370('0x44')]);_0x4f5d20[_0x2370('0x45')]=qs['filters'](_['pick'](_0x1cef75[_0x2370('0x3b')],_0x5889af[_0x2370('0x3c')]));_0x4f5d20[_0x2370('0x45')]['ChatWebsiteId']=_0x50d26e['id'];if(_0x1cef75[_0x2370('0x3b')][_0x2370('0x47')]){_0x4f5d20[_0x2370('0x45')]=_[_0x2370('0x48')](_0x4f5d20['where'],{'$or':_['map'](_0x4f5d20[_0x2370('0x3d')],function(_0x203213){var _0x357040={};_0x357040[_0x203213]={'$like':'%'+_0x1cef75[_0x2370('0x3b')]['filter']+'%'};return _0x357040;})});}_0x4f5d20=_[_0x2370('0x48')]({},_0x4f5d20,_0x1cef75[_0x2370('0x4d')]);return db[_0x2370('0x69')][_0x2370('0x28')]({'where':_0x4f5d20[_0x2370('0x45')]})[_0x2370('0x1e')](function(_0x468acb){_0x437078[_0x2370('0x28')]=_0x468acb;if(_0x1cef75['query']['includeAll']){_0x4f5d20[_0x2370('0x4f')]=[{'all':!![]}];}return db[_0x2370('0x69')][_0x2370('0x50')](_0x4f5d20);})[_0x2370('0x1e')](function(_0x393835){_0x437078[_0x2370('0x51')]=_0x393835;return _0x437078;});}})[_0x2370('0x1e')](respondWithFilteredResult(_0x56b9eb,_0x4f5d20))[_0x2370('0x52')](handleError(_0x56b9eb,null));};exports[_0x2370('0x6a')]=function(_0x497775,_0x5dd004,_0x4fba37){return db[_0x2370('0x38')][_0x2370('0x56')]({'where':{'id':_0x497775[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x5dd004,null))[_0x2370('0x1e')](function(_0x74b265){if(_0x74b265){return _0x74b265[_0x2370('0x6a')](_0x497775[_0x2370('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x5dd004,null))['catch'](handleError(_0x5dd004,null));};exports['addLogo']=function(_0x2419f9,_0x5afe5c,_0x11c688){_0x2419f9[_0x2370('0x5d')][_0x2370('0x6b')]=_0x2419f9[_0x2370('0x6c')][_0x2370('0x6d')];return db[_0x2370('0x38')][_0x2370('0x56')]({'where':{'id':_0x2419f9[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x5afe5c,null))[_0x2370('0x1e')](saveUpdates(_0x2419f9[_0x2370('0x5d')],null))[_0x2370('0x1e')](respondWithResult(_0x5afe5c,null))[_0x2370('0x52')](handleError(_0x5afe5c,null));};exports[_0x2370('0x6e')]=function(_0x26eb77,_0x120b85,_0x46397a){_0x26eb77[_0x2370('0x5d')][_0x2370('0x6f')]=_0x26eb77[_0x2370('0x6c')][_0x2370('0x6d')];return db[_0x2370('0x38')][_0x2370('0x56')]({'where':{'id':_0x26eb77['params']['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x120b85,null))[_0x2370('0x1e')](saveUpdates(_0x26eb77[_0x2370('0x5d')],null))[_0x2370('0x1e')](respondWithResult(_0x120b85,null))[_0x2370('0x52')](handleError(_0x120b85,null));};exports[_0x2370('0x70')]=function(_0xcb4628,_0x212f1c,_0x711d53){_0xcb4628[_0x2370('0x5d')][_0x2370('0x71')]=_0xcb4628[_0x2370('0x6c')][_0x2370('0x6d')];return db[_0x2370('0x38')][_0x2370('0x56')]({'where':{'id':_0xcb4628[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x212f1c,null))[_0x2370('0x1e')](saveUpdates(_0xcb4628[_0x2370('0x5d')],null))['then'](respondWithResult(_0x212f1c,null))[_0x2370('0x52')](handleError(_0x212f1c,null));};exports[_0x2370('0x72')]=function(_0xb95f33,_0x99fc8c,_0xe9f4ad){_0xb95f33[_0x2370('0x5d')][_0x2370('0x73')]=_0xb95f33['file']['filename'];return db[_0x2370('0x38')][_0x2370('0x56')]({'where':{'id':_0xb95f33['params']['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x99fc8c,null))[_0x2370('0x1e')](saveUpdates(_0xb95f33['body'],null))[_0x2370('0x1e')](respondWithResult(_0x99fc8c,null))[_0x2370('0x52')](handleError(_0x99fc8c,null));};exports[_0x2370('0x74')]=function(_0x4371d8,_0x2887b1,_0xca1335){var _0xf6c055=path[_0x2370('0x75')](config[_0x2370('0x76')],_0x2370('0x77'));var _0x1cbc47={'where':{'id':_0x4371d8['params']['id']},'attributes':['id',_0x2370('0x6b')],'raw':!![]};var _0x556a14=![];return require(_0x2370('0x78'))['getLicense']()[_0x2370('0x1e')](function(_0x6122c9){if(_0x6122c9){_0x556a14=_0x6122c9['custom'];}})[_0x2370('0x1e')](function(){return db[_0x2370('0x38')][_0x2370('0x56')](_0x1cbc47);})[_0x2370('0x1e')](handleEntityNotFound(_0x2887b1,null))['then'](function(_0x3bab57){if(_0x3bab57){if(!_[_0x2370('0x79')](_0x3bab57[_0x2370('0x6b')])){if(fs[_0x2370('0x7a')](path[_0x2370('0x75')](config['root'],'server/files/images/logos/',_0x3bab57[_0x2370('0x6b')]))&&_0x556a14){_0xf6c055=path[_0x2370('0x75')](config[_0x2370('0x76')],'server/files/images/logos/',_0x3bab57['sitepic']);}}return _0x2887b1[_0x2370('0x7b')](_0xf6c055);}})[_0x2370('0x52')](handleError(_0x2887b1,null));};exports[_0x2370('0x7c')]=function(_0x3f95eb,_0x1d7761,_0x59cb33){var _0x3785d8=path['join'](config[_0x2370('0x76')],_0x2370('0x7d'));var _0x3f5c40={'where':{'id':_0x3f95eb['params']['id']},'attributes':['id',_0x2370('0x6f')],'raw':!![]};return db[_0x2370('0x38')]['find'](_0x3f5c40)[_0x2370('0x1e')](handleEntityNotFound(_0x1d7761,null))[_0x2370('0x1e')](function(_0x3a3f70){if(_0x3a3f70){if(!_[_0x2370('0x79')](_0x3a3f70['agentAvatar'])){if(fs[_0x2370('0x7a')](path[_0x2370('0x75')](config[_0x2370('0x76')],_0x2370('0x7e'),_0x3a3f70[_0x2370('0x6f')]))){_0x3785d8=path[_0x2370('0x75')](config[_0x2370('0x76')],_0x2370('0x7e'),_0x3a3f70['agentAvatar']);}}return _0x1d7761['download'](_0x3785d8);}})[_0x2370('0x52')](handleError(_0x1d7761,null));};exports['getCustomerAvatar']=function(_0x2dde36,_0x58aab4,_0x519c8e){var _0x10f74e=path[_0x2370('0x75')](config[_0x2370('0x76')],_0x2370('0x7f'));var _0x494847={'where':{'id':_0x2dde36['params']['id']},'attributes':['id','customerAvatar',_0x2370('0x80')],'raw':!![]};return db[_0x2370('0x38')]['find'](_0x494847)[_0x2370('0x1e')](handleEntityNotFound(_0x58aab4,null))['then'](function(_0x315b46){if(_0x315b46){if(!_[_0x2370('0x79')](_0x315b46[_0x2370('0x71')])){if(fs[_0x2370('0x7a')](path[_0x2370('0x75')](config['root'],_0x2370('0x7e'),_0x315b46[_0x2370('0x71')]))&&_0x315b46[_0x2370('0x80')]){_0x10f74e=path[_0x2370('0x75')](config[_0x2370('0x76')],_0x2370('0x7e'),_0x315b46[_0x2370('0x71')]);}}return _0x58aab4['download'](_0x10f74e);}})[_0x2370('0x52')](handleError(_0x58aab4,null));};exports['getSystemAvatar']=function(_0x4b41ee,_0x20d410,_0x5fe1a7){var _0x2a5efe=path['join'](config[_0x2370('0x76')],_0x2370('0x81'));var _0x40b690={'where':{'id':_0x4b41ee['params']['id']},'attributes':['id',_0x2370('0x73')],'raw':!![]};return db[_0x2370('0x38')][_0x2370('0x56')](_0x40b690)['then'](handleEntityNotFound(_0x20d410,null))[_0x2370('0x1e')](function(_0x5b94d0){if(_0x5b94d0){if(!_[_0x2370('0x79')](_0x5b94d0[_0x2370('0x73')])){if(fs[_0x2370('0x7a')](path[_0x2370('0x75')](config['root'],_0x2370('0x7e'),_0x5b94d0[_0x2370('0x73')]))){_0x2a5efe=path['join'](config[_0x2370('0x76')],'server/files/images/avatars/',_0x5b94d0[_0x2370('0x73')]);}}return _0x20d410[_0x2370('0x7b')](_0x2a5efe);}})[_0x2370('0x52')](handleError(_0x20d410,null));};exports[_0x2370('0x82')]=function(_0x35cd55,_0x304f41,_0x1fffa3){var _0xa75ea5=require(_0x2370('0x83'));var _0x3ec249=new _0xa75ea5();var _0x457182=_0x3ec249[_0x2370('0x84')](_0x35cd55[_0x2370('0x85')][_0x2370('0x86')])[_0x2370('0x87')]();var _0x420497={'body':_0x35cd55[_0x2370('0x5d')],'channel':_0x2370('0x88')};var _0x296558=[];var _0x13c0f0=[];var _0x40ec43={};var _0x4c975b=![];return db[_0x2370('0x89')][_0x2370('0x5e')]()[_0x2370('0x1e')](function(_0x9d4bb5){if(!_0x9d4bb5){throw new db[(_0x2370('0x8a'))][(_0x2370('0x8b'))](_0x2370('0x8c'));}_0x296558=_[_0x2370('0x8d')](_[_0x2370('0x3a')](_0x9d4bb5),[_0x2370('0x8e'),_0x2370('0x8f')]);_0x13c0f0=_[_0x2370('0x8d')](_[_0x2370('0x3a')](_0x9d4bb5),[_0x2370('0x8e'),_0x2370('0x8f'),'CompanyId',_0x2370('0x90')]);if(_0x35cd55[_0x2370('0x5d')]['id']){delete _0x35cd55[_0x2370('0x5d')]['id'];}if(_[_0x2370('0x79')](_0x35cd55[_0x2370('0x5d')][_0x2370('0x91')])){throw new db[(_0x2370('0x8a'))][(_0x2370('0x8b'))]('from\x20is\x20mandatory');}if(_[_0x2370('0x79')](_0x35cd55[_0x2370('0x5d')][_0x2370('0x5d')])||_0x35cd55['body'][_0x2370('0x5d')]===''){throw new db[(_0x2370('0x8a'))][(_0x2370('0x8b'))](_0x2370('0x92'));}if(_[_0x2370('0x79')](_0x35cd55['body'][_0x2370('0x93')])){throw new db[(_0x2370('0x8a'))][(_0x2370('0x8b'))](_0x2370('0x94')+_0x13c0f0);}if(!_[_0x2370('0x95')](_0x13c0f0,_0x35cd55[_0x2370('0x5d')][_0x2370('0x93')])){throw new db[(_0x2370('0x8a'))][(_0x2370('0x8b'))](_0x2370('0x96')+_0x13c0f0);}_0x40ec43[_0x35cd55[_0x2370('0x5d')]['mapKey']]=_0x35cd55[_0x2370('0x5d')][_0x2370('0x91')];})[_0x2370('0x1e')](function(){return db['ChatWebsite'][_0x2370('0x56')]({'where':{'id':_0x35cd55[_0x2370('0x54')]['id']},'include':[{'model':db[_0x2370('0x97')],'as':_0x2370('0x98'),'include':[{'model':db[_0x2370('0x89')],'as':_0x2370('0x99'),'where':_0x40ec43,'limit':0x1,'order':[[_0x2370('0x8f'),_0x2370('0x9a')]]}]},{'model':db[_0x2370('0x9b')],'as':_0x2370('0x9c')}]});})[_0x2370('0x1e')](handleEntityNotFound(_0x304f41,null))[_0x2370('0x1e')](function(_0x5e1e71){if(_0x5e1e71&&_0x5e1e71[_0x2370('0x98')]){_0x420497[_0x2370('0x9d')]=_0x5e1e71;_0x420497[_0x2370('0x9e')]=_0x5e1e71[_0x2370('0x9c')];_0x420497[_0x2370('0x9f')]=_0x5e1e71['List'];_0x420497[_0x2370('0x9e')]=_[_0x2370('0xa0')](_0x420497['applications'],[_0x2370('0xa1')],[_0x2370('0xa2')]);if(_0x420497[_0x2370('0x9d')][_0x2370('0x9c')]){delete _0x420497['account']['Applications'];}if(_0x420497['account'][_0x2370('0x98')]&&_0x420497[_0x2370('0x9d')][_0x2370('0x98')][_0x2370('0x99')][_0x2370('0x40')]){return _0x420497[_0x2370('0x9d')]['List'][_0x2370('0x99')][0x0];}var _0x16b924=_['defaults'](_0x35cd55[_0x2370('0x5d')],{'firstName':_0x35cd55[_0x2370('0x5d')][_0x2370('0x91')],'ListId':_0x5e1e71[_0x2370('0x90')]});_0x16b924[_0x35cd55[_0x2370('0x5d')][_0x2370('0x93')]]=_0x35cd55[_0x2370('0x5d')][_0x2370('0x91')];return db['CmContact'][_0x2370('0x57')](_0x16b924,{'fields':_0x296558,'raw':!![]});}})[_0x2370('0x1e')](handleEntityNotFound(_0x304f41,null))[_0x2370('0x1e')](function(_0x440e77){_0x420497[_0x2370('0xa3')]=_0x440e77;if(_0x440e77){var _0x530e05={'ContactId':_0x440e77['id'],'ChatWebsiteId':_0x35cd55[_0x2370('0x54')]['id'],'from':(_0x440e77[_0x2370('0xa4')]||'')+'\x20'+(_0x440e77[_0x2370('0xa5')]||''),'customerIp':_0x35cd55[_0x2370('0x5d')][_0x2370('0xa6')],'referer':_0x35cd55[_0x2370('0x5d')][_0x2370('0xa7')],'browserName':_0x457182['browser'][_0x2370('0x33')]&&_0x457182[_0x2370('0xa8')][_0x2370('0xa9')]?util[_0x2370('0xaa')](_0x2370('0xab'),_0x457182[_0x2370('0xa8')][_0x2370('0x33')],_0x457182['browser'][_0x2370('0xa9')]):_0x2370('0xac'),'browserVersion':_0x457182['browser'][_0x2370('0xa9')]||_0x2370('0xac'),'osName':util[_0x2370('0xaa')]('%s\x20%s',_0x457182['os'][_0x2370('0x33')],_0x457182['os']['version']),'osVersion':_0x457182['os']['version'],'deviceModel':_0x457182[_0x2370('0xad')][_0x2370('0x39')]&&_0x457182[_0x2370('0xad')]['vendor']?util['format'](_0x2370('0xae'),_0x457182[_0x2370('0xad')][_0x2370('0x39')],_0x457182['device'][_0x2370('0xaf')],_0x457182['device']['type']):null,'deviceVendor':_0x457182[_0x2370('0xad')][_0x2370('0xaf')],'deviceType':_0x457182['device'][_0x2370('0xb0')],'formData':JSON[_0x2370('0xb1')](_0x35cd55[_0x2370('0x5d')])};var _0x88484={'ChatWebsiteId':_0x35cd55[_0x2370('0x54')]['id'],'closed':![]};if(_0x35cd55[_0x2370('0x5d')][_0x2370('0xb2')]){_0x88484['threadId']=_0x35cd55[_0x2370('0x5d')]['threadId'];return db[_0x2370('0xb3')][_0x2370('0x56')]({'where':_0x88484})[_0x2370('0x1e')](function(_0x2c9974){if(_0x2c9974){return[_0x2c9974,![]];}_0x530e05['threadId']=_0x35cd55[_0x2370('0x5d')][_0x2370('0xb2')];_0x530e05['externalUrl']=_0x35cd55[_0x2370('0x5d')][_0x2370('0xb4')];return db['ChatInteraction'][_0x2370('0x57')](_0x530e05)[_0x2370('0x1e')](function(_0x199f11){return[_0x199f11,!![]];});});}_0x88484[_0x2370('0xb5')]=_0x440e77['id'];if(_0x35cd55[_0x2370('0x5d')][_0x2370('0xb6')]&&_0x35cd55[_0x2370('0x5d')][_0x2370('0xb6')]['id']){_0x88484['id']=_0x35cd55['body'][_0x2370('0xb6')]['id'];return db[_0x2370('0xb3')][_0x2370('0x56')]({'where':_0x88484})[_0x2370('0x1e')](function(_0x1fe3ad){if(_0x1fe3ad){return[_0x1fe3ad,![]];}return db['ChatInteraction'][_0x2370('0x57')](_0x530e05)[_0x2370('0x1e')](function(_0x2037d8){return[_0x2037d8,!![]];});});}return db[_0x2370('0xb3')]['create'](_0x530e05)['then'](function(_0x4ffb89){return[_0x4ffb89,!![]];});}})[_0x2370('0xb7')](function(_0x377794,_0x2563ff){if(_0x377794){_0x4c975b=_0x2563ff;if(!_0x2563ff){var _0x3b3bba={'from':(_0x420497[_0x2370('0xa3')]['firstName']||'')+'\x20'+(_0x420497['contact'][_0x2370('0xa5')]||'')};if(_0x35cd55[_0x2370('0x5d')][_0x2370('0xb2')]&&_0x35cd55[_0x2370('0x5d')][_0x2370('0xb8')]&&_0x35cd55[_0x2370('0x5d')]['threadId']!=_0x35cd55[_0x2370('0x5d')][_0x2370('0xb8')]){_0x3b3bba[_0x2370('0xb2')]=_0x35cd55['body'][_0x2370('0xb8')];}return _0x377794[_0x2370('0xb9')](_0x3b3bba);}else{return _0x377794;}}})['then'](function(_0x4bfe08){_0x420497['interaction']=_0x4bfe08[_0x2370('0x31')]({'plain':!![]});_0x420497[_0x2370('0xb6')][_0x2370('0xba')]=_0x4c975b;if(_0x420497[_0x2370('0xb6')][_0x2370('0xba')]){if(_0x420497[_0x2370('0x9d')][_0x2370('0xbb')]){_0x420497[_0x2370('0x9e')][_0x2370('0xbc')]({'id':0x0,'priority':_0x420497['applications'][_0x2370('0x40')]+0x1,'app':_0x2370('0xbd'),'appdata':_0x2370('0xbe'),'interval':_0x2370('0xbf')});}}return db[_0x2370('0xc0')][_0x2370('0x57')]({'body':_0x35cd55[_0x2370('0x5d')]['body'],'ChatWebsiteId':_0x35cd55[_0x2370('0x54')]['id'],'ChatInteractionId':_0x4bfe08['id'],'direction':'in','ContactId':_0x420497[_0x2370('0xa3')]['id'],'AttachmentId':_0x35cd55['body'][_0x2370('0xc1')]});})[_0x2370('0x1e')](function(_0x1c8d98){_0x420497['message']=_0x1c8d98;if(_0x420497[_0x2370('0xb6')][_0x2370('0xc2')]){return db[_0x2370('0xc3')][_0x2370('0x56')]({'attributes':['id',_0x2370('0x33')],'where':{'id':_0x420497['interaction'][_0x2370('0xc2')]}})[_0x2370('0x1e')](function(_0x1b0f0c){if(_0x1b0f0c){_0x420497[_0x2370('0x9e')][_0x2370('0xc4')]({'id':0x0,'priority':0x0,'app':_0x2370('0xc5'),'appdata':_0x1b0f0c[_0x2370('0x33')]+','+(_0x420497[_0x2370('0x9d')][_0x2370('0xc6')]||0xa),'interval':_0x2370('0xbf')});_0x420497['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x2370('0xc7'),_0x420497);});}return respondWithRpcPromise(_0x2370('0xc8'),'startRouting',_0x420497);})['then'](function(_0x37f697){respondWithRpcPromise(_0x2370('0xc9'),_0x2370('0xc9'),{'event':'notify','message':_0x37f697},client9002);return _0x37f697;})[_0x2370('0x1e')](respondWithResult(_0x304f41,null))['catch'](handleError(_0x304f41,null));};exports['offline']=function(_0x38d795,_0x1f40c3,_0x556db9){var _0x591248,_0xfdd8cb,_0x30bbea;var _0x471904=[];var _0x7b38a0=[];var _0x2a150e={};return db[_0x2370('0x89')][_0x2370('0x5e')]()[_0x2370('0x1e')](function(_0x5aa981){if(!_0x5aa981){throw new db['Sequelize'][(_0x2370('0x8b'))](_0x2370('0x8c'));}_0x7b38a0=_[_0x2370('0x8d')](_[_0x2370('0x3a')](_0x5aa981),['createdAt',_0x2370('0x8f')]);_0x471904=_[_0x2370('0x8d')](_[_0x2370('0x3a')](_0x5aa981),['createdAt',_0x2370('0x8f'),'CompanyId','ListId']);if(_0x38d795[_0x2370('0x5d')]['id']){delete _0x38d795[_0x2370('0x5d')]['id'];}if(_[_0x2370('0x79')](_0x38d795[_0x2370('0x5d')][_0x2370('0x91')])){throw _0x1f40c3[_0x2370('0x2a')](0x1f4)[_0x2370('0x34')](new db[(_0x2370('0x8a'))][(_0x2370('0x8b'))]('from\x20is\x20mandatory'));}if(_[_0x2370('0x79')](_0x38d795[_0x2370('0x5d')]['body'])||_0x38d795['body']['body']===''){throw _0x1f40c3[_0x2370('0x2a')](0x1f4)[_0x2370('0x34')](new db[(_0x2370('0x8a'))]['ValidationError'](_0x2370('0x92')));}if(_[_0x2370('0x79')](_0x38d795[_0x2370('0x5d')][_0x2370('0xca')])){throw _0x1f40c3[_0x2370('0x2a')](0x1f4)[_0x2370('0x34')](new db[(_0x2370('0x8a'))][(_0x2370('0x8b'))](_0x2370('0xcb')+_0x471904));}if(!_[_0x2370('0x95')](_0x471904,_0x38d795[_0x2370('0x5d')][_0x2370('0xca')])){throw _0x1f40c3[_0x2370('0x2a')](0x1f4)['send'](new db['Sequelize'][(_0x2370('0x8b'))](_0x2370('0xcc')+_0x471904));}_0x2a150e[_0x38d795[_0x2370('0x5d')]['mapKeyOffline']]=_0x38d795[_0x2370('0x5d')][_0x2370('0x91')];})[_0x2370('0x1e')](function(){return db[_0x2370('0x38')]['find']({'where':{'id':_0x38d795[_0x2370('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0x2370('0x98')}]});})['then'](handleEntityNotFound(_0x1f40c3,null))[_0x2370('0x1e')](function(_0x3988d9){if(_0x3988d9&&_0x3988d9[_0x2370('0x98')]){_0xfdd8cb=_0x3988d9;var _0x21de0f=_[_0x2370('0x15')](_0x38d795[_0x2370('0x5d')],{'firstName':_0x38d795['body'][_0x2370('0x91')],'phone':_0x38d795['body'][_0x2370('0x91')],'ListId':_0x3988d9['ListId']});_0x21de0f[_0x38d795[_0x2370('0x5d')][_0x2370('0xca')]]=_0x38d795['body'][_0x2370('0x91')];return db['CmContact']['findOrCreate']({'where':_0x2a150e,'defaults':_0x21de0f});}})[_0x2370('0xb7')](function(_0x3b1beb){if(_0x3b1beb){_0x30bbea=_0x3b1beb;var _0x12e497=fs[_0x2370('0xcd')](path['join'](config[_0x2370('0x76')],_0x2370('0xce')),_0x2370('0xcf'));var _0x10fec5=ejs[_0x2370('0xd0')](_0x12e497,{'body':_['toPairs'](_0x38d795['body']['body']),'bodyTitle':_0xfdd8cb[_0x2370('0xd1')]});return db[_0x2370('0xd2')]['create']({'body':_0x10fec5,'ContactId':_0x3b1beb['id'],'ChatWebsiteId':_0xfdd8cb['id']});}})[_0x2370('0x1e')](function(_0x8760ab){if(_0x8760ab){_0x591248=_0x8760ab;return db[_0x2370('0xd3')][_0x2370('0x63')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2370('0xd4'),'raw':!![]}]});}})[_0x2370('0x1e')](function(_0x32a64f){if(_0x32a64f&&_0x32a64f[_0x2370('0xd4')]&&_0xfdd8cb['forwardOfflineAddress']){var _0x1ad61b={'tls':{'rejectUnauthorized':![]}};if(_0x32a64f[_0x2370('0xd4')][_0x2370('0xd5')]){_0x1ad61b[_0x2370('0xd5')]=_0x32a64f['Smtp'][_0x2370('0xd5')];}else{_0x1ad61b[_0x2370('0xd6')]=_0x32a64f[_0x2370('0xd4')][_0x2370('0xd6')];_0x1ad61b[_0x2370('0xd7')]=_0x32a64f[_0x2370('0xd4')][_0x2370('0xd7')];_0x1ad61b[_0x2370('0xd8')]=_0x32a64f[_0x2370('0xd4')][_0x2370('0xd8')];}if(_0x32a64f[_0x2370('0xd4')][_0x2370('0xd9')]){_0x1ad61b[_0x2370('0xda')]={'user':_0x32a64f[_0x2370('0xd4')]['user'],'pass':_0x32a64f[_0x2370('0xd4')]['pass']};}return respondWithRpcPromise(_0x2370('0xdb'),'sendMail',{'account':_0x1ad61b,'message':{'from':util['format'](_0x2370('0xdc'),_0x32a64f[_0x2370('0x33')],_0x32a64f['email']||_0x32a64f[_0x2370('0xd4')][_0x2370('0x58')]),'to':_0xfdd8cb[_0x2370('0xdd')],'subject':_0xfdd8cb[_0x2370('0xde')],'text':_0x591248[_0x2370('0x5d')]}},client9003)['then'](function(){return _0x591248;})[_0x2370('0x52')](function(_0x66795b){console[_0x2370('0x23')](_0x66795b);});}})['then'](function(){if(_0x591248){return _0x591248;}})[_0x2370('0x1e')](respondWithResult(_0x1f40c3,null))[_0x2370('0x52')](handleError(_0x1f40c3,null));};exports[_0x2370('0xdf')]=function(_0x24ca49,_0x5450c5,_0x285bf9){return db[_0x2370('0xb3')]['find']({'where':{'id':_0x24ca49[_0x2370('0x54')]['id']}})['then'](handleEntityNotFound(_0x5450c5,null))['then'](function(_0x1c503b){if(_0x1c503b){return _0x1c503b['addInteraction'](_0x24ca49[_0x2370('0x5d')]['ids'],_[_0x2370('0xe0')](_0x24ca49[_0x2370('0x5d')],[_0x2370('0x66'),'id'])||{});}})[_0x2370('0x1e')](respondWithResult(_0x5450c5,null))[_0x2370('0x52')](handleError(_0x5450c5,null));};exports['getInteractions']=function(_0x23c299,_0x4a18d1,_0x1f9e31){var _0x3c331b={'raw':![],'where':{}};var _0x1c9211={};var _0x41dea9={'count':0x0,'rows':[]};return db[_0x2370('0x38')]['findOne']({'where':{'id':_0x23c299[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x4a18d1,null))['then'](function(_0x3db680){if(_0x3db680){_0x1c9211[_0x2370('0x39')]=_[_0x2370('0x3a')](db['ChatInteraction']['rawAttributes']);_0x1c9211[_0x2370('0x3b')]=_[_0x2370('0x3a')](_0x23c299['query']);_0x1c9211[_0x2370('0x3c')]=_[_0x2370('0x3e')](_0x1c9211['model'],_0x1c9211['query']);_0x3c331b[_0x2370('0x3d')]=_[_0x2370('0x3e')](_0x1c9211[_0x2370('0x39')],qs['fields'](_0x23c299[_0x2370('0x3b')]['fields']));_0x3c331b[_0x2370('0x3d')]=_0x3c331b[_0x2370('0x3d')]['length']?_0x3c331b[_0x2370('0x3d')]:_0x1c9211['model'];if(!_0x23c299[_0x2370('0x3b')][_0x2370('0x41')](_0x2370('0x42'))){_0x3c331b[_0x2370('0x43')]=qs[_0x2370('0x43')](_0x23c299[_0x2370('0x3b')]['limit']);_0x3c331b['offset']=qs[_0x2370('0x29')](_0x23c299[_0x2370('0x3b')][_0x2370('0x29')]);}_0x3c331b[_0x2370('0x64')]=qs[_0x2370('0x44')](_0x23c299['query'][_0x2370('0x44')]);_0x3c331b['where']=qs[_0x2370('0x3c')](_['pick'](_0x23c299[_0x2370('0x3b')],_0x1c9211[_0x2370('0x3c')]));_0x3c331b[_0x2370('0x45')]['ChatWebsiteId']=_0x3db680['id'];if(_0x23c299[_0x2370('0x3b')][_0x2370('0x47')]){_0x3c331b[_0x2370('0x45')]=_[_0x2370('0x48')](_0x3c331b[_0x2370('0x45')],{'$or':_['map'](_0x3c331b[_0x2370('0x3d')],function(_0x185544){var _0x764d68={};_0x764d68[_0x185544]={'$like':'%'+_0x23c299['query'][_0x2370('0x47')]+'%'};return _0x764d68;})});}_0x3c331b=_[_0x2370('0x48')]({},_0x3c331b,_0x23c299[_0x2370('0x4d')]);return db[_0x2370('0xb3')][_0x2370('0x28')]({'where':_0x3c331b['where']})[_0x2370('0x1e')](function(_0xf0ca01){_0x41dea9[_0x2370('0x28')]=_0xf0ca01;if(_0x23c299[_0x2370('0x3b')][_0x2370('0x4e')]){_0x3c331b['include']=[{'model':db[_0x2370('0x89')],'as':'Contact','required':![]},{'model':db[_0x2370('0xc3')],'as':_0x2370('0xe1'),'attributes':[_0x2370('0x33'),'fullname',_0x2370('0xe2')],'required':![]},{'model':db[_0x2370('0xe3')],'as':'Tags','attributes':['id',_0x2370('0x33'),_0x2370('0xe4')],'where':_0x23c299[_0x2370('0x3b')]['tag']?{'id':_0x23c299[_0x2370('0x3b')][_0x2370('0xe5')]}:undefined,'required':_0x23c299[_0x2370('0x3b')][_0x2370('0xe5')]?!![]:![]}];}return db['ChatInteraction'][_0x2370('0x50')](_0x3c331b);})[_0x2370('0x1e')](function(_0x52d0bf){_0x41dea9[_0x2370('0x51')]=_0x52d0bf;return _0x41dea9;});}})['then'](respondWithFilteredResult(_0x4a18d1,_0x3c331b))[_0x2370('0x52')](handleError(_0x4a18d1,null));};function iftimePromise(_0x13d069,_0x1f5a87){return respondWithRpcPromise(_0x2370('0xe6'),_0x2370('0xe7'),{'command':_0x1f5a87[_0x2370('0xe8')]?util[_0x2370('0xaa')](_0x2370('0xe9'),_0x13d069[_0x2370('0xea')],_0x1f5a87[_0x2370('0xe8')]):util[_0x2370('0xaa')](_0x2370('0xeb'),_0x13d069['interval'])},client9002)[_0x2370('0x1e')](function(_0x1aac8d){var _0x4df895=_0x1aac8d&&_0x1aac8d[_0x2370('0xec')](_0x2370('0xed'))>=0x0?!![]:![];logger[_0x2370('0x1f')](_0x2370('0xee'),_0x1f5a87['id'],_0x13d069['id'],_0x13d069[_0x2370('0xea')],_0x4df895?'ONLINE':'OFFLINE',_0x1f5a87['timezone']?_0x1f5a87['timezone']:_0x2370('0xef'));return _0x4df895;})[_0x2370('0x52')](function(_0x319aa2){logger[_0x2370('0x23')](_0x2370('0xee'),_0x1f5a87['id'],_0x13d069['id'],_0x13d069[_0x2370('0xea')],util[_0x2370('0xf0')](_0x319aa2,{'showHidden':![],'depth':null}),_0x1f5a87[_0x2370('0xe8')]?_0x1f5a87[_0x2370('0xe8')]:_0x2370('0xef'));return![];});}exports[_0x2370('0xe7')]=function(_0x4bcab6,_0x3c0d59,_0x29c2b9){var _0x125ad3=0x0;var _0x5571e0=0x0;var _0x12dd21=![];var _0xf0a095;var _0x1fb94e;return db['ChatWebsite'][_0x2370('0x56')]({'where':{'id':_0x4bcab6['params']['id']},'include':[{'model':db[_0x2370('0xf1')],'as':'Interval','include':[{'model':db[_0x2370('0xf1')],'as':_0x2370('0xf2'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x2370('0x1e')](handleEntityNotFound(_0x3c0d59,null))[_0x2370('0x1e')](function(_0x539de2){if(_0x539de2){_0xf0a095=_0x539de2;return _0x539de2[_0x2370('0xf3')]({'raw':!![]});}})['then'](function(_0x17726b){if(_0xf0a095){if(_0x17726b){_0x1fb94e=_0x17726b;}}return require(_0x2370('0x78'))[_0x2370('0xf4')]();})[_0x2370('0x1e')](function(_0x9d368){if(_0x9d368){_0x5571e0=_0x9d368[_0x2370('0xf5')];_0x12dd21=_0x9d368[_0x2370('0xf6')];}})[_0x2370('0x1e')](function(){return db['ChatInteraction'][_0x2370('0x28')]({'where':{'closed':![]}});})['then'](function(_0x151e40){_0x125ad3=_0x151e40;if(_0x5571e0&&_0x151e40>_0x5571e0){return db[_0x2370('0xf7')][_0x2370('0x63')]({'where':{'id':0x1}})[_0x2370('0x1e')](function(_0x1588d6){if(_0x1588d6){_0x1588d6[_0x2370('0xf8')](_0x2370('0xf9'));}});}})[_0x2370('0x1e')](function(){if(_0xf0a095[_0x2370('0xf1')]&&_0xf0a095[_0x2370('0xf1')]['Intervals']){var _0x222c3e=[];for(var _0x40d17f=0x0;_0x40d17f<_0xf0a095[_0x2370('0xf1')][_0x2370('0xf2')][_0x2370('0x40')];_0x40d17f++){var _0x4d0007=_0xf0a095[_0x2370('0xf1')][_0x2370('0xf2')][_0x40d17f]['get']({'plain':!![]});_0x222c3e[_0x2370('0xbc')](iftimePromise(_0x4d0007,_0xf0a095));}return BPromise[_0x2370('0xfa')](_0x222c3e)[_0x2370('0x1e')](function(_0x3a978c){return _[_0x2370('0xfb')](_0x3a978c);});}else{return!![];}})[_0x2370('0x1e')](function(_0x46c855){var _0x248723=fs[_0x2370('0xcd')](path[_0x2370('0x75')](config[_0x2370('0x76')],_0x2370('0xfc')),_0x2370('0xcf'));var _0x4100bd={'remote':_0xf0a095[_0x2370('0xfd')],'query':querystring[_0x2370('0xb1')](_['merge'](_0xf0a095[_0x2370('0x31')]({'plain':!![]}),{'customerIp':_0x4bcab6[_0x2370('0x85')][_0x2370('0xfe')]||_0x4bcab6['headers'][_0x2370('0xff')]||_0x4bcab6['connection'][_0x2370('0x100')]||_0x4bcab6['ip'],'referer':_0x4bcab6[_0x2370('0x85')]['referer'],'openedInteractions':_0x125ad3,'maxInteractions':_0x5571e0,'virtual':_0x12dd21['virtual'],'online':_0x46c855,'custom':_0x12dd21}))[_0x2370('0x101')](/'/g,'\x5c\x27')};_0x3c0d59[_0x2370('0x34')](ejs[_0x2370('0xd0')](Mustache[_0x2370('0xd0')](_0x248723,_0x4100bd),{'proactiveActions':_0x1fb94e,'alignment':_0xf0a095[_0x2370('0x102')],'verticalAlignment':_0xf0a095['verticalAlignment']}));})[_0x2370('0x52')](handleError(_0x3c0d59,null));};exports[_0x2370('0x103')]=function(_0x330e8c,_0x1dad4e,_0xda1c60){return db['ChatWebsite']['findOne']({'where':{'id':_0x330e8c['params']['id']}})['then'](handleEntityNotFound(_0x1dad4e,null))[_0x2370('0x1e')](function(_0x1804c8){if(_0x1804c8){return db[_0x2370('0x104')]['transaction'](function(_0xb97352){return db['ChatApplication'][_0x2370('0x30')]({'where':{'ChatWebsiteId':_0x330e8c['params']['id']},'transaction':_0xb97352})[_0x2370('0x1e')](function(_0x61f897){var _0x29cdb0=_[_0x2370('0x49')](_0x330e8c['body'],function(_0x22ce04){_0x22ce04[_0x2370('0x60')]=_0x330e8c[_0x2370('0x54')]['id'];return _0x22ce04;});return db[_0x2370('0x9b')]['bulkCreate'](_0x29cdb0,{'transaction':_0xb97352});});})[_0x2370('0x1e')](function(){return db[_0x2370('0x9b')][_0x2370('0x105')]({'where':{'ChatWebsiteId':_0x330e8c['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x1dad4e,null))['catch'](handleError(_0x1dad4e,null));};exports['getApplications']=function(_0x19b352,_0x16b903,_0x507dc7){var _0x445c59={};var _0x21faca={};var _0x2c06d5;var _0x54f849;return db[_0x2370('0x38')][_0x2370('0x63')]({'where':{'id':_0x19b352[_0x2370('0x54')]['id']}})['then'](handleEntityNotFound(_0x16b903,null))['then'](function(_0x3f5d24){if(_0x3f5d24){_0x2c06d5=_0x3f5d24;_0x21faca[_0x2370('0x39')]=_[_0x2370('0x3a')](db[_0x2370('0x9b')][_0x2370('0x55')]);_0x21faca['query']=_[_0x2370('0x3a')](_0x19b352[_0x2370('0x3b')]);_0x21faca[_0x2370('0x3c')]=_['intersection'](_0x21faca[_0x2370('0x39')],_0x21faca[_0x2370('0x3b')]);_0x445c59['attributes']=_[_0x2370('0x3e')](_0x21faca[_0x2370('0x39')],qs['fields'](_0x19b352[_0x2370('0x3b')]['fields']));_0x445c59['attributes']=_0x445c59['attributes'][_0x2370('0x40')]?_0x445c59['attributes']:_0x21faca[_0x2370('0x39')];_0x445c59[_0x2370('0x64')]=qs[_0x2370('0x44')](_0x19b352[_0x2370('0x3b')][_0x2370('0x44')]);_0x445c59['where']=qs[_0x2370('0x3c')](_[_0x2370('0x46')](_0x19b352[_0x2370('0x3b')],_0x21faca[_0x2370('0x3c')]));if(_0x19b352[_0x2370('0x3b')]['filter']){_0x445c59[_0x2370('0x45')]=_[_0x2370('0x48')](_0x445c59['where'],{'$or':_[_0x2370('0x49')](_0x445c59[_0x2370('0x3d')],function(_0x2512b9){var _0x176b4f={};_0x176b4f[_0x2512b9]={'$like':'%'+_0x19b352[_0x2370('0x3b')][_0x2370('0x47')]+'%'};return _0x176b4f;})});}_0x445c59=_[_0x2370('0x48')]({},_0x445c59,_0x19b352['options']);return _0x2c06d5[_0x2370('0x106')](_0x445c59);}})[_0x2370('0x1e')](function(_0x16f521){if(_0x16f521){_0x54f849=_0x16f521[_0x2370('0x40')];if(!_0x19b352['query'][_0x2370('0x41')](_0x2370('0x42'))){_0x445c59['limit']=qs[_0x2370('0x43')](_0x19b352[_0x2370('0x3b')][_0x2370('0x43')]);_0x445c59['offset']=qs[_0x2370('0x29')](_0x19b352[_0x2370('0x3b')][_0x2370('0x29')]);}return _0x2c06d5['getApplications'](_0x445c59);}})[_0x2370('0x1e')](function(_0xc2e7ef){if(_0xc2e7ef){return _0xc2e7ef?{'count':_0x54f849,'rows':_0xc2e7ef}:null;}})[_0x2370('0x1e')](respondWithResult(_0x16b903,null))[_0x2370('0x52')](handleError(_0x16b903,null));};exports[_0x2370('0x107')]=function(_0x2be7f7,_0x36ddec,_0x114cda){return db['chatProactiveAction']['find']({'where':{'id':_0x2be7f7[_0x2370('0x54')]['id']}})['then'](handleEntityNotFound(_0x36ddec,null))[_0x2370('0x1e')](function(_0x2a6635){if(_0x2a6635){return _0x2a6635['addProactiveActions'](_0x2be7f7[_0x2370('0x5d')][_0x2370('0x66')],_[_0x2370('0xe0')](_0x2be7f7[_0x2370('0x5d')],[_0x2370('0x66'),'id'])||{});}})[_0x2370('0x1e')](respondWithResult(_0x36ddec,null))[_0x2370('0x52')](handleError(_0x36ddec,null));};exports['getProactiveActions']=function(_0x8ef72a,_0x1198fe,_0x502aa9){var _0xd86f4a={};var _0x5ca923={};var _0x34f4c9;var _0x1de47d;return db[_0x2370('0x38')][_0x2370('0x63')]({'where':{'id':_0x8ef72a[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x1198fe,null))['then'](function(_0x57811c){if(_0x57811c){_0x34f4c9=_0x57811c;_0x5ca923[_0x2370('0x39')]=_[_0x2370('0x3a')](db[_0x2370('0x108')][_0x2370('0x55')]);_0x5ca923[_0x2370('0x3b')]=_[_0x2370('0x3a')](_0x8ef72a[_0x2370('0x3b')]);_0x5ca923[_0x2370('0x3c')]=_[_0x2370('0x3e')](_0x5ca923[_0x2370('0x39')],_0x5ca923[_0x2370('0x3b')]);_0xd86f4a[_0x2370('0x3d')]=_['intersection'](_0x5ca923[_0x2370('0x39')],qs[_0x2370('0x3f')](_0x8ef72a[_0x2370('0x3b')][_0x2370('0x3f')]));_0xd86f4a['attributes']=_0xd86f4a[_0x2370('0x3d')][_0x2370('0x40')]?_0xd86f4a['attributes']:_0x5ca923[_0x2370('0x39')];_0xd86f4a['order']=qs[_0x2370('0x44')](_0x8ef72a[_0x2370('0x3b')][_0x2370('0x44')]);_0xd86f4a[_0x2370('0x45')]=qs['filters'](_['pick'](_0x8ef72a[_0x2370('0x3b')],_0x5ca923['filters']));if(_0x8ef72a['query'][_0x2370('0x47')]){_0xd86f4a['where']=_[_0x2370('0x48')](_0xd86f4a[_0x2370('0x45')],{'$or':_[_0x2370('0x49')](_0xd86f4a['attributes'],function(_0xa923ac){var _0xf69629={};_0xf69629[_0xa923ac]={'$like':'%'+_0x8ef72a[_0x2370('0x3b')]['filter']+'%'};return _0xf69629;})});}_0xd86f4a=_[_0x2370('0x48')]({},_0xd86f4a,_0x8ef72a[_0x2370('0x4d')]);return _0x34f4c9[_0x2370('0xf3')](_0xd86f4a);}})['then'](function(_0x6d57f){if(_0x6d57f){_0x1de47d=_0x6d57f['length'];if(!_0x8ef72a[_0x2370('0x3b')]['hasOwnProperty']('nolimit')){_0xd86f4a['limit']=qs[_0x2370('0x43')](_0x8ef72a[_0x2370('0x3b')]['limit']);_0xd86f4a[_0x2370('0x29')]=qs[_0x2370('0x29')](_0x8ef72a[_0x2370('0x3b')][_0x2370('0x29')]);}return _0x34f4c9[_0x2370('0xf3')](_0xd86f4a);}})[_0x2370('0x1e')](function(_0x4bb4fb){if(_0x4bb4fb){return _0x4bb4fb?{'count':_0x1de47d,'rows':_0x4bb4fb}:null;}})['then'](respondWithResult(_0x1198fe,null))[_0x2370('0x52')](handleError(_0x1198fe,null));};exports[_0x2370('0x109')]=function(_0x119806,_0x20868f,_0x1637d3){var _0x56d327=_0x119806[_0x2370('0x3b')]['online']===_0x2370('0x10a')?_0x2370('0x10b'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x56d327],'where':{'id':_0x119806['params']['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x20868f,null))[_0x2370('0x1e')](function(_0x379062){if(_0x379062){var _0x37c91a=_0x379062[_0x56d327];var _0x494561=_0x37c91a&&_0x37c91a[_0x2370('0x10c')]?_0x37c91a[_0x2370('0x10c')]:[];_0x20868f[_0x2370('0x34')]({'fromKey':_['isNil'](_0x37c91a[_0x2370('0x10d')])?undefined:_0x37c91a[_0x2370('0x10d')],'count':_0x494561[_0x2370('0x40')],'rows':_0x494561});}})['catch'](handleError(_0x20868f,null));};exports[_0x2370('0x10e')]=function(_0x52586d,_0x10f5a7,_0x3d776a){var _0x26e3be={'raw':!![],'where':{}};var _0x4928fe={};var _0x3eca10={'count':0x0,'rows':[]};return db[_0x2370('0x38')][_0x2370('0x63')]({'where':{'id':_0x52586d[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x10f5a7,null))['then'](function(_0x1c204b){if(_0x1c204b){_0x4928fe[_0x2370('0x39')]=_[_0x2370('0x3a')](db[_0x2370('0xd2')][_0x2370('0x55')]);_0x4928fe[_0x2370('0x3b')]=_[_0x2370('0x3a')](_0x52586d[_0x2370('0x3b')]);_0x4928fe['filters']=_[_0x2370('0x3e')](_0x4928fe[_0x2370('0x39')],_0x4928fe[_0x2370('0x3b')]);_0x26e3be[_0x2370('0x3d')]=_['intersection'](_0x4928fe[_0x2370('0x39')],qs[_0x2370('0x3f')](_0x52586d['query'][_0x2370('0x3f')]));_0x26e3be['attributes']=_0x26e3be[_0x2370('0x3d')][_0x2370('0x40')]?_0x26e3be[_0x2370('0x3d')]:_0x4928fe[_0x2370('0x39')];if(!_0x52586d[_0x2370('0x3b')][_0x2370('0x41')](_0x2370('0x42'))){_0x26e3be['limit']=qs['limit'](_0x52586d[_0x2370('0x3b')]['limit']);_0x26e3be[_0x2370('0x29')]=qs[_0x2370('0x29')](_0x52586d[_0x2370('0x3b')]['offset']);}_0x26e3be[_0x2370('0x64')]=qs[_0x2370('0x44')](_0x52586d[_0x2370('0x3b')][_0x2370('0x44')]);_0x26e3be[_0x2370('0x45')]=qs[_0x2370('0x3c')](_[_0x2370('0x46')](_0x52586d[_0x2370('0x3b')],_0x4928fe['filters']));_0x26e3be[_0x2370('0x45')][_0x2370('0x60')]=_0x1c204b['id'];if(_0x52586d[_0x2370('0x3b')][_0x2370('0x47')]){_0x26e3be[_0x2370('0x45')]=_['merge'](_0x26e3be[_0x2370('0x45')],{'$or':_[_0x2370('0x49')](_0x26e3be[_0x2370('0x3d')],function(_0x32e86c){var _0x33838c={};_0x33838c[_0x32e86c]={'$like':'%'+_0x52586d['query'][_0x2370('0x47')]+'%'};return _0x33838c;})});}_0x26e3be=_['merge']({},_0x26e3be,_0x52586d['options']);return db[_0x2370('0xd2')][_0x2370('0x28')]({'where':_0x26e3be[_0x2370('0x45')]})['then'](function(_0x53eba7){_0x3eca10[_0x2370('0x28')]=_0x53eba7;if(_0x52586d['query'][_0x2370('0x4e')]){_0x26e3be[_0x2370('0x4f')]=[{'all':!![]}];}return db[_0x2370('0xd2')]['findAll'](_0x26e3be);})['then'](function(_0x46a05a){_0x3eca10[_0x2370('0x51')]=_0x46a05a;return _0x3eca10;});}})[_0x2370('0x1e')](respondWithFilteredResult(_0x10f5a7,_0x26e3be))[_0x2370('0x52')](handleError(_0x10f5a7,null));};exports[_0x2370('0x10f')]=function(_0x555e1e,_0x39e604,_0x3afcdc){return db[_0x2370('0x38')][_0x2370('0x56')]({'where':{'id':_0x555e1e['params']['id']}})['then'](handleEntityNotFound(_0x39e604,null))[_0x2370('0x1e')](function(_0x27297e){if(_0x27297e){return _0x27297e[_0x2370('0x10f')](_0x555e1e[_0x2370('0x5d')]['ids'],_[_0x2370('0xe0')](_0x555e1e[_0x2370('0x5d')],[_0x2370('0x66'),'id'])||{})[_0x2370('0xb7')](function(_0x37fbd2){for(var _0x57624c=0x0;_0x57624c<_0x555e1e[_0x2370('0x5d')][_0x2370('0x66')][_0x2370('0x40')];_0x57624c+=0x1){socket['emit'](_0x2370('0x110'),{'UserId':_0x555e1e[_0x2370('0x5d')][_0x2370('0x66')][_0x57624c],'ChatWebsiteId':_0x555e1e[_0x2370('0x54')]['id']});}return _0x37fbd2;});}})['then'](respondWithResult(_0x39e604,null))[_0x2370('0x52')](handleError(_0x39e604,null));};exports[_0x2370('0x111')]=function(_0x1ffe8a,_0x3e3654,_0x3f4d47){return db[_0x2370('0x38')][_0x2370('0x56')]({'where':{'id':_0x1ffe8a[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x3e3654,null))[_0x2370('0x1e')](function(_0x56b10b){if(_0x56b10b){return _0x56b10b[_0x2370('0x111')](_0x1ffe8a[_0x2370('0x3b')]['ids'])[_0x2370('0x1e')](function(){if(_['isArray'](_0x1ffe8a[_0x2370('0x3b')][_0x2370('0x66')])){for(var _0x2be760=0x0;_0x2be760<_0x1ffe8a[_0x2370('0x3b')][_0x2370('0x66')][_0x2370('0x40')];_0x2be760+=0x1){socket['emit'](_0x2370('0x112'),{'UserId':Number(_0x1ffe8a[_0x2370('0x3b')]['ids'][_0x2be760]),'ChatWebsiteId':Number(_0x1ffe8a[_0x2370('0x54')]['id'])});}}else{socket[_0x2370('0x113')](_0x2370('0x112'),{'UserId':Number(_0x1ffe8a[_0x2370('0x3b')][_0x2370('0x66')]),'ChatWebsiteId':Number(_0x1ffe8a[_0x2370('0x54')]['id'])});}});}})[_0x2370('0x1e')](respondWithStatusCode(_0x3e3654,null))[_0x2370('0x52')](handleError(_0x3e3654,null));};exports[_0x2370('0x114')]=function(_0x422b09,_0x5d9e06,_0x5f33b5){var _0x3bf209={};var _0x2dde3c={};var _0x36c9ad;var _0x2e7ceb;return db[_0x2370('0x38')][_0x2370('0x63')]({'where':{'id':_0x422b09[_0x2370('0x54')]['id']}})[_0x2370('0x1e')](handleEntityNotFound(_0x5d9e06,null))[_0x2370('0x1e')](function(_0x1fe3cb){if(_0x1fe3cb){_0x36c9ad=_0x1fe3cb;_0x2dde3c[_0x2370('0x39')]=_['keys'](db['User'][_0x2370('0x55')]);_0x2dde3c['query']=_['keys'](_0x422b09['query']);_0x2dde3c[_0x2370('0x3c')]=_[_0x2370('0x3e')](_0x2dde3c[_0x2370('0x39')],_0x2dde3c[_0x2370('0x3b')]);_0x3bf209[_0x2370('0x3d')]=_['intersection'](_0x2dde3c[_0x2370('0x39')],qs[_0x2370('0x3f')](_0x422b09[_0x2370('0x3b')]['fields']));_0x3bf209[_0x2370('0x3d')]=_0x3bf209[_0x2370('0x3d')]['length']?_0x3bf209[_0x2370('0x3d')]:_0x2dde3c['model'];_0x3bf209[_0x2370('0x64')]=qs[_0x2370('0x44')](_0x422b09['query'][_0x2370('0x44')]);_0x3bf209[_0x2370('0x45')]=qs[_0x2370('0x3c')](_[_0x2370('0x46')](_0x422b09[_0x2370('0x3b')],_0x2dde3c[_0x2370('0x3c')]));if(_0x422b09['query']['filter']){_0x3bf209[_0x2370('0x45')]=_['merge'](_0x3bf209[_0x2370('0x45')],{'$or':_[_0x2370('0x49')](_0x3bf209[_0x2370('0x3d')],function(_0x21608c){var _0x26eecf={};_0x26eecf[_0x21608c]={'$like':'%'+_0x422b09[_0x2370('0x3b')][_0x2370('0x47')]+'%'};return _0x26eecf;})});}_0x3bf209=_[_0x2370('0x48')]({},_0x3bf209,_0x422b09['options']);return _0x36c9ad[_0x2370('0x114')](_0x3bf209);}})[_0x2370('0x1e')](function(_0x4e5cfb){if(_0x4e5cfb){_0x2e7ceb=_0x4e5cfb[_0x2370('0x40')];if(!_0x422b09['query']['hasOwnProperty'](_0x2370('0x42'))){_0x3bf209['limit']=qs[_0x2370('0x43')](_0x422b09[_0x2370('0x3b')][_0x2370('0x43')]);_0x3bf209[_0x2370('0x29')]=qs['offset'](_0x422b09[_0x2370('0x3b')]['offset']);}return _0x36c9ad[_0x2370('0x114')](_0x3bf209);}})[_0x2370('0x1e')](function(_0xfb8e57){if(_0xfb8e57){return _0xfb8e57?{'count':_0x2e7ceb,'rows':_0xfb8e57}:null;}})[_0x2370('0x1e')](respondWithResult(_0x5d9e06,null))['catch'](handleError(_0x5d9e06,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 657e309..e779c85 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 _0x47a1=['events','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x5b97ed,_0x40dc6a){var _0x181d96=function(_0x2838db){while(--_0x2838db){_0x5b97ed['push'](_0x5b97ed['shift']());}};_0x181d96(++_0x40dc6a);}(_0x47a1,0xbd));var _0x147a=function(_0x296ab7,_0x29aef5){_0x296ab7=_0x296ab7-0x0;var _0x34e885=_0x47a1[_0x296ab7];return _0x34e885;};'use strict';var EventEmitter=require(_0x147a('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x147a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x147a('0x2'),'afterDestroy':_0x147a('0x3')};function emitEvent(_0x5e69bc){return function(_0xd80e93,_0x66a8e2,_0xc2071d){ChatWebsiteEvents[_0x147a('0x4')](_0x5e69bc+':'+_0xd80e93['id'],_0xd80e93);ChatWebsiteEvents[_0x147a('0x4')](_0x5e69bc,_0xd80e93);_0xc2071d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x147a('0x5')](e,emitEvent(event));}}module[_0x147a('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x1cb9=['exports','events','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0xfbfd03,_0x39ec3a){var _0x2939a0=function(_0x180c8e){while(--_0x180c8e){_0xfbfd03['push'](_0xfbfd03['shift']());}};_0x2939a0(++_0x39ec3a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4785bd,_0x521001){_0x4785bd=_0x4785bd-0x0;var _0x10e678=_0x1cb9[_0x4785bd];return _0x10e678;};'use strict';var EventEmitter=require(_0x91cb('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x91cb('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x91cb('0x2')](0x0);var events={'afterCreate':_0x91cb('0x3'),'afterUpdate':_0x91cb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x42910d){return function(_0x2b7314,_0x5652cd,_0x17c21c){ChatWebsiteEvents[_0x91cb('0x5')](_0x42910d+':'+_0x2b7314['id'],_0x2b7314);ChatWebsiteEvents[_0x91cb('0x5')](_0x42910d,_0x2b7314);_0x17c21c(null);};}for(var e in events){if(events[_0x91cb('0x6')](e)){var event=events[e];ChatWebsite[_0x91cb('0x7')](e,emitEvent(event));}}module[_0x91cb('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 7cb2a47..64a573a 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 _0xd98a=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x3ab0f1,_0x31acba){var _0x2c2fb8=function(_0x5da5c4){while(--_0x5da5c4){_0x3ab0f1['push'](_0x3ab0f1['shift']());}};_0x2c2fb8(++_0x31acba);}(_0xd98a,0xf6));var _0xad98=function(_0x2744f3,_0x299588){_0x2744f3=_0x2744f3-0x0;var _0x364784=_0xd98a[_0x2744f3];return _0x364784;};'use strict';var _=require(_0xad98('0x0'));var util=require(_0xad98('0x1'));var logger=require(_0xad98('0x2'))(_0xad98('0x3'));var moment=require(_0xad98('0x4'));var BPromise=require(_0xad98('0x5'));var rp=require(_0xad98('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad98('0x7'));var attributes=require(_0xad98('0x8'));module[_0xad98('0x9')]=function(_0x34a634,_0x51d5f2){return _0x34a634[_0xad98('0xa')](_0xad98('0xb'),attributes,{'tableName':_0xad98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa484=['bluebird','request-promise','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment'];(function(_0x59626d,_0x27edfa){var _0x2d6f1a=function(_0x2b9840){while(--_0x2b9840){_0x59626d['push'](_0x59626d['shift']());}};_0x2d6f1a(++_0x27edfa);}(_0xa484,0x128));var _0x4a48=function(_0x4bfdea,_0x4c9aee){_0x4bfdea=_0x4bfdea-0x0;var _0x223fe1=_0xa484[_0x4bfdea];return _0x223fe1;};'use strict';var _=require(_0x4a48('0x0'));var util=require('util');var logger=require(_0x4a48('0x1'))(_0x4a48('0x2'));var moment=require(_0x4a48('0x3'));var BPromise=require(_0x4a48('0x4'));var rp=require(_0x4a48('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a48('0x6'));var config=require('../../config/environment');var attributes=require(_0x4a48('0x7'));module[_0x4a48('0x8')]=function(_0x334f33,_0x2dba46){return _0x334f33[_0x4a48('0x9')](_0x4a48('0xa'),attributes,{'tableName':_0x4a48('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index d8ba3bd..86ee9ea 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 _0x0cde=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x0cde,0x1d0));var _0xe0cd=function(_0xa3315e,_0x402cb7){_0xa3315e=_0xa3315e-0x0;var _0x39a3d0=_0x0cde[_0xa3315e];return _0x39a3d0;};'use strict';var _=require('lodash');var util=require(_0xe0cd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe0cd('0x1'));var fs=require('fs');var Redis=require(_0xe0cd('0x2'));var db=require(_0xe0cd('0x3'))['db'];var utils=require(_0xe0cd('0x4'));var logger=require(_0xe0cd('0x5'))(_0xe0cd('0x6'));var config=require(_0xe0cd('0x7'));var jayson=require(_0xe0cd('0x8'));var client=jayson[_0xe0cd('0x9')][_0xe0cd('0xa')]({'port':0x232a});config['redis']=_[_0xe0cd('0xb')](config[_0xe0cd('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe0cd('0xc')]));require(_0xe0cd('0xd'))[_0xe0cd('0xe')](socket);function respondWithRpcPromise(_0x581ae2,_0xbcdca8,_0x1480a4){return new BPromise(function(_0x5e6410,_0xc471b){return client[_0xe0cd('0xf')](_0x581ae2,_0x1480a4)[_0xe0cd('0x10')](function(_0x3489fc){logger[_0xe0cd('0x11')](_0xe0cd('0x12'),_0xbcdca8,_0xe0cd('0x13'));logger['debug'](_0xe0cd('0x14'),_0xbcdca8,_0xe0cd('0x13'),JSON['stringify'](_0x3489fc));if(_0x3489fc[_0xe0cd('0x15')]){if(_0x3489fc[_0xe0cd('0x15')][_0xe0cd('0x16')]===0x1f4){logger[_0xe0cd('0x15')](_0xe0cd('0x12'),_0xbcdca8,_0x3489fc[_0xe0cd('0x15')][_0xe0cd('0x17')]);return _0xc471b(_0x3489fc[_0xe0cd('0x15')][_0xe0cd('0x17')]);}logger[_0xe0cd('0x15')]('ChatWebsite,\x20%s,\x20%s',_0xbcdca8,_0x3489fc[_0xe0cd('0x15')]['message']);return _0x5e6410(_0x3489fc['error'][_0xe0cd('0x17')]);}else{logger['info'](_0xe0cd('0x12'),_0xbcdca8,'request\x20sent');_0x5e6410(_0x3489fc[_0xe0cd('0x18')][_0xe0cd('0x17')]);}})[_0xe0cd('0x19')](function(_0x129966){logger[_0xe0cd('0x15')]('ChatWebsite,\x20%s,\x20%s',_0xbcdca8,_0x129966);_0xc471b(_0x129966);});});}
\ No newline at end of file
+var _0xa96e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x2ccb4f,_0x32996c){var _0x123159=function(_0x4fd63d){while(--_0x4fd63d){_0x2ccb4f['push'](_0x2ccb4f['shift']());}};_0x123159(++_0x32996c);}(_0xa96e,0x127));var _0xea96=function(_0x4ab8df,_0x56831d){_0x4ab8df=_0x4ab8df-0x0;var _0x5a3168=_0xa96e[_0x4ab8df];return _0x5a3168;};'use strict';var _=require(_0xea96('0x0'));var util=require('util');var moment=require(_0xea96('0x1'));var BPromise=require(_0xea96('0x2'));var rs=require(_0xea96('0x3'));var fs=require('fs');var Redis=require(_0xea96('0x4'));var db=require(_0xea96('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xea96('0x6'))('rpc');var config=require(_0xea96('0x7'));var jayson=require(_0xea96('0x8'));var client=jayson[_0xea96('0x9')][_0xea96('0xa')]({'port':0x232a});config[_0xea96('0xb')]=_[_0xea96('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xea96('0xd'))(new Redis(config[_0xea96('0xb')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x3477b6,_0x229542,_0x11f8fe){return new BPromise(function(_0xf3d01c,_0x139b5b){return client[_0xea96('0xe')](_0x3477b6,_0x11f8fe)[_0xea96('0xf')](function(_0x50b511){logger[_0xea96('0x10')](_0xea96('0x11'),_0x229542,'request\x20sent');logger[_0xea96('0x12')](_0xea96('0x13'),_0x229542,_0xea96('0x14'),JSON[_0xea96('0x15')](_0x50b511));if(_0x50b511[_0xea96('0x16')]){if(_0x50b511[_0xea96('0x16')][_0xea96('0x17')]===0x1f4){logger['error'](_0xea96('0x11'),_0x229542,_0x50b511[_0xea96('0x16')]['message']);return _0x139b5b(_0x50b511['error']['message']);}logger[_0xea96('0x16')](_0xea96('0x11'),_0x229542,_0x50b511[_0xea96('0x16')][_0xea96('0x18')]);return _0xf3d01c(_0x50b511[_0xea96('0x16')][_0xea96('0x18')]);}else{logger[_0xea96('0x10')](_0xea96('0x11'),_0x229542,'request\x20sent');_0xf3d01c(_0x50b511[_0xea96('0x19')][_0xea96('0x18')]);}})[_0xea96('0x1a')](function(_0x31acf8){logger[_0xea96('0x16')](_0xea96('0x11'),_0x229542,_0x31acf8);_0x139b5b(_0x31acf8);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 980d415..2b16e32 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 _0xd98a=['./chatWebsite.events','update','emit','register','length','chatWebsite:'];(function(_0x9fc657,_0x3acf5c){var _0x13d152=function(_0x3e55e5){while(--_0x3e55e5){_0x9fc657['push'](_0x9fc657['shift']());}};_0x13d152(++_0x3acf5c);}(_0xd98a,0xfc));var _0xad98=function(_0x5f4f35,_0x598632){_0x5f4f35=_0x5f4f35-0x0;var _0x4bf6f6=_0xd98a[_0x5f4f35];return _0x4bf6f6;};'use strict';var ChatWebsiteEvents=require(_0xad98('0x0'));var events=['save','remove',_0xad98('0x1')];function createListener(_0x10b24d,_0x189f8b){return function(_0x1cc198){_0x189f8b[_0xad98('0x2')](_0x10b24d,_0x1cc198);};}function removeListener(_0x1ab3f6,_0x5b14d4){return function(){ChatWebsiteEvents['removeListener'](_0x1ab3f6,_0x5b14d4);};}exports[_0xad98('0x3')]=function(_0x38f547){for(var _0x17e650=0x0,_0x2cd316=events[_0xad98('0x4')];_0x17e650<_0x2cd316;_0x17e650++){var _0x480c93=events[_0x17e650];var _0x20712b=createListener(_0xad98('0x5')+_0x480c93,_0x38f547);ChatWebsiteEvents['on'](_0x480c93,_0x20712b);}};
\ No newline at end of file
+var _0x0994=['save','update','emit','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x14f967,_0x31f94c){var _0x186fbd=function(_0xaa2c9c){while(--_0xaa2c9c){_0x14f967['push'](_0x14f967['shift']());}};_0x186fbd(++_0x31f94c);}(_0x0994,0xe6));var _0x4099=function(_0x382df4,_0x1ea9ea){_0x382df4=_0x382df4-0x0;var _0x395e81=_0x0994[_0x382df4];return _0x395e81;};'use strict';var ChatWebsiteEvents=require(_0x4099('0x0'));var events=[_0x4099('0x1'),'remove',_0x4099('0x2')];function createListener(_0x6087d2,_0x188b2e){return function(_0x5de394){_0x188b2e[_0x4099('0x3')](_0x6087d2,_0x5de394);};}function removeListener(_0x244c02,_0x4d4f56){return function(){ChatWebsiteEvents['removeListener'](_0x244c02,_0x4d4f56);};}exports[_0x4099('0x4')]=function(_0x114377){for(var _0x5496ff=0x0,_0x3ed054=events[_0x4099('0x5')];_0x5496ff<_0x3ed054;_0x5496ff++){var _0x14db1b=events[_0x5496ff];var _0xd281ef=createListener(_0x4099('0x6')+_0x14db1b,_0x114377);ChatWebsiteEvents['on'](_0x14db1b,_0xd281ef);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index d97028d..01046bd 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 _0x24a6=['getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/users','getAgents','post','create','/:id/canned_answers','join','root','%s-%s','now','single','file','server/files/images/avatars/','originalname','diskStorage','format','addCustomerAvatar','addSystemAvatar','notify','/:id/offline','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeAnswers','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','/:id/applications'];(function(_0x3371e4,_0x18c88f){var _0x55fb77=function(_0x3ae241){while(--_0x3ae241){_0x3371e4['push'](_0x3371e4['shift']());}};_0x55fb77(++_0x18c88f);}(_0x24a6,0x14f));var _0x624a=function(_0x580f33,_0x523227){_0x580f33=_0x580f33-0x0;var _0x17c335=_0x24a6[_0x580f33];return _0x17c335;};'use strict';var multer=require(_0x624a('0x0'));var util=require('util');var path=require(_0x624a('0x1'));var timeout=require(_0x624a('0x2'));var express=require(_0x624a('0x3'));var router=express[_0x624a('0x4')]();var auth=require(_0x624a('0x5'));var interaction=require(_0x624a('0x6'));var config=require(_0x624a('0x7'));var controller=require(_0x624a('0x8'));router[_0x624a('0x9')]('/',auth[_0x624a('0xa')](),controller[_0x624a('0xb')]);router[_0x624a('0x9')](_0x624a('0xc'),auth[_0x624a('0xa')](),controller[_0x624a('0xd')]);router[_0x624a('0x9')](_0x624a('0xe'),auth[_0x624a('0xa')](),controller[_0x624a('0xf')]);router[_0x624a('0x9')](_0x624a('0x10'),auth[_0x624a('0xa')](),controller[_0x624a('0x11')]);router['get']('/:id/canned_answers',auth[_0x624a('0xa')](),controller[_0x624a('0x12')]);router[_0x624a('0x9')]('/:id/logo',controller[_0x624a('0x13')]);router[_0x624a('0x9')]('/:id/avatar',controller['getAvatar']);router['get'](_0x624a('0x14'),controller['getCustomerAvatar']);router[_0x624a('0x9')](_0x624a('0x15'),controller[_0x624a('0x16')]);router[_0x624a('0x9')]('/:id/interactions',auth[_0x624a('0xa')](),controller['getInteractions']);router[_0x624a('0x9')](_0x624a('0x17'),controller['getSnippet']);router[_0x624a('0x9')](_0x624a('0x18'),auth[_0x624a('0xa')](),controller[_0x624a('0x19')]);router[_0x624a('0x9')](_0x624a('0x1a'),auth[_0x624a('0xa')](),controller[_0x624a('0x1b')]);router[_0x624a('0x9')](_0x624a('0x1c'),controller['getFields']);router[_0x624a('0x9')]('/:id/offline_messages',auth[_0x624a('0xa')](),controller['getOfflineMessages']);router[_0x624a('0x9')](_0x624a('0x1d'),auth[_0x624a('0xa')](),controller[_0x624a('0x1e')]);router[_0x624a('0x1f')]('/',auth['isAuthenticated'](),controller[_0x624a('0x20')]);router[_0x624a('0x1f')](_0x624a('0x10'),auth[_0x624a('0xa')](),controller['addDisposition']);router[_0x624a('0x1f')](_0x624a('0x21'),auth[_0x624a('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56834b,_0x29257b,_0x4493bb){_0x4493bb(null,path[_0x624a('0x22')](config[_0x624a('0x23')],'server/files/images/logos/'));},'filename':function(_0x5ca99b,_0x2234dc,_0x15ba91){_0x15ba91(null,util['format'](_0x624a('0x24'),Date[_0x624a('0x25')](),_0x2234dc['originalname']));}})});router['post']('/:id/logo',upload[_0x624a('0x26')](_0x624a('0x27')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x59917f,_0x422c20,_0x35c8d0){_0x35c8d0(null,path[_0x624a('0x22')](config['root'],_0x624a('0x28')));},'filename':function(_0x1ba339,_0x56dfb2,_0x466af4){_0x466af4(null,util['format'](_0x624a('0x24'),Date[_0x624a('0x25')](),_0x56dfb2[_0x624a('0x29')]));}})});router[_0x624a('0x1f')]('/:id/avatar',upload[_0x624a('0x26')](_0x624a('0x27')),controller['addAvatar']);var upload=multer({'storage':multer[_0x624a('0x2a')]({'destination':function(_0x11dcf4,_0x100545,_0x31a242){_0x31a242(null,path[_0x624a('0x22')](config[_0x624a('0x23')],'server/files/images/avatars/'));},'filename':function(_0x55d8f5,_0x45a3c2,_0x3315aa){_0x3315aa(null,util[_0x624a('0x2b')]('%s-%s',Date[_0x624a('0x25')](),_0x45a3c2['originalname']));}})});router['post']('/:id/customer_avatar',upload[_0x624a('0x26')]('file'),controller[_0x624a('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x21df69,_0x50f561,_0x4d9bee){_0x4d9bee(null,path[_0x624a('0x22')](config[_0x624a('0x23')],_0x624a('0x28')));},'filename':function(_0xa7b840,_0x23dd45,_0xe4ae90){_0xe4ae90(null,util[_0x624a('0x2b')](_0x624a('0x24'),Date[_0x624a('0x25')](),_0x23dd45[_0x624a('0x29')]));}})});router['post'](_0x624a('0x15'),upload[_0x624a('0x26')](_0x624a('0x27')),controller[_0x624a('0x2d')]);router[_0x624a('0x1f')]('/:id/notify',controller[_0x624a('0x2e')]);router[_0x624a('0x1f')](_0x624a('0x2f'),controller[_0x624a('0x30')]);router[_0x624a('0x1f')](_0x624a('0x31'),auth['isAuthenticated'](),controller[_0x624a('0x32')]);router[_0x624a('0x1f')](_0x624a('0x18'),auth['isAuthenticated'](),controller[_0x624a('0x33')]);router['post']('/:id/proactive_actions',auth[_0x624a('0xa')](),controller[_0x624a('0x34')]);router[_0x624a('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x624a('0x35')]);router[_0x624a('0x36')]('/:id',auth[_0x624a('0xa')](),controller[_0x624a('0x37')]);router['delete'](_0x624a('0xe'),auth[_0x624a('0xa')](),controller[_0x624a('0x38')]);router[_0x624a('0x39')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x624a('0x39')](_0x624a('0x21'),auth[_0x624a('0xa')](),controller[_0x624a('0x3a')]);router[_0x624a('0x39')](_0x624a('0x1d'),auth[_0x624a('0xa')](),controller['removeAgents']);module[_0x624a('0x3b')]=router;
\ No newline at end of file
+var _0xcabc=['/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages','/:id/users','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','join','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar'];(function(_0x3bbfe4,_0x3d5b26){var _0x25d3e7=function(_0x57a635){while(--_0x57a635){_0x3bbfe4['push'](_0x3bbfe4['shift']());}};_0x25d3e7(++_0x3d5b26);}(_0xcabc,0x16a));var _0xccab=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xcabc[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require(_0xccab('0x0'));var path=require(_0xccab('0x1'));var timeout=require(_0xccab('0x2'));var express=require(_0xccab('0x3'));var router=express[_0xccab('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xccab('0x5'));var config=require(_0xccab('0x6'));var controller=require('./chatWebsite.controller');router[_0xccab('0x7')]('/',auth[_0xccab('0x8')](),controller[_0xccab('0x9')]);router['get'](_0xccab('0xa'),auth[_0xccab('0x8')](),controller[_0xccab('0xb')]);router['get'](_0xccab('0xc'),auth[_0xccab('0x8')](),controller['show']);router[_0xccab('0x7')](_0xccab('0xd'),auth[_0xccab('0x8')](),controller[_0xccab('0xe')]);router[_0xccab('0x7')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xccab('0xf')]);router[_0xccab('0x7')](_0xccab('0x10'),controller[_0xccab('0x11')]);router[_0xccab('0x7')](_0xccab('0x12'),controller[_0xccab('0x13')]);router['get'](_0xccab('0x14'),controller[_0xccab('0x15')]);router['get'](_0xccab('0x16'),controller['getSystemAvatar']);router['get'](_0xccab('0x17'),auth[_0xccab('0x8')](),controller[_0xccab('0x18')]);router['get'](_0xccab('0x19'),controller[_0xccab('0x1a')]);router['get'](_0xccab('0x1b'),auth[_0xccab('0x8')](),controller[_0xccab('0x1c')]);router[_0xccab('0x7')](_0xccab('0x1d'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xccab('0x7')]('/:id/fields',controller[_0xccab('0x1e')]);router[_0xccab('0x7')](_0xccab('0x1f'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0xccab('0x7')](_0xccab('0x20'),auth[_0xccab('0x8')](),controller['getAgents']);router[_0xccab('0x21')]('/',auth['isAuthenticated'](),controller[_0xccab('0x22')]);router[_0xccab('0x21')]('/:id/dispositions',auth[_0xccab('0x8')](),controller[_0xccab('0x23')]);router[_0xccab('0x21')](_0xccab('0x24'),auth[_0xccab('0x8')](),controller[_0xccab('0x25')]);var upload=multer({'storage':multer[_0xccab('0x26')]({'destination':function(_0x427654,_0x325683,_0x286e19){_0x286e19(null,path['join'](config[_0xccab('0x27')],_0xccab('0x28')));},'filename':function(_0x58e32b,_0x41370b,_0x40b88c){_0x40b88c(null,util[_0xccab('0x29')](_0xccab('0x2a'),Date[_0xccab('0x2b')](),_0x41370b[_0xccab('0x2c')]));}})});router[_0xccab('0x21')](_0xccab('0x10'),upload[_0xccab('0x2d')](_0xccab('0x2e')),controller[_0xccab('0x2f')]);var upload=multer({'storage':multer[_0xccab('0x26')]({'destination':function(_0x23912f,_0x381550,_0x2edd0e){_0x2edd0e(null,path['join'](config[_0xccab('0x27')],_0xccab('0x30')));},'filename':function(_0x55da33,_0x28c29b,_0x54b7c9){_0x54b7c9(null,util[_0xccab('0x29')](_0xccab('0x2a'),Date[_0xccab('0x2b')](),_0x28c29b[_0xccab('0x2c')]));}})});router['post'](_0xccab('0x12'),upload[_0xccab('0x2d')](_0xccab('0x2e')),controller[_0xccab('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x103fc9,_0x4cd19d,_0x5ef7bc){_0x5ef7bc(null,path[_0xccab('0x32')](config['root'],_0xccab('0x30')));},'filename':function(_0x5744b0,_0x11034e,_0x59317c){_0x59317c(null,util[_0xccab('0x29')](_0xccab('0x2a'),Date[_0xccab('0x2b')](),_0x11034e[_0xccab('0x2c')]));}})});router['post'](_0xccab('0x14'),upload[_0xccab('0x2d')](_0xccab('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xccab('0x26')]({'destination':function(_0xf5800f,_0x819632,_0x56c8c8){_0x56c8c8(null,path[_0xccab('0x32')](config['root'],_0xccab('0x30')));},'filename':function(_0x50b107,_0x27f1ec,_0x26c68d){_0x26c68d(null,util['format'](_0xccab('0x2a'),Date[_0xccab('0x2b')](),_0x27f1ec[_0xccab('0x2c')]));}})});router[_0xccab('0x21')](_0xccab('0x16'),upload[_0xccab('0x2d')](_0xccab('0x2e')),controller['addSystemAvatar']);router[_0xccab('0x21')]('/:id/notify',controller['notify']);router['post'](_0xccab('0x33'),controller[_0xccab('0x34')]);router[_0xccab('0x21')]('/:id/interactions',auth[_0xccab('0x8')](),controller[_0xccab('0x35')]);router[_0xccab('0x21')](_0xccab('0x1b'),auth[_0xccab('0x8')](),controller[_0xccab('0x36')]);router['post']('/:id/proactive_actions',auth[_0xccab('0x8')](),controller[_0xccab('0x37')]);router[_0xccab('0x21')](_0xccab('0x20'),auth['isAuthenticated'](),controller[_0xccab('0x38')]);router[_0xccab('0x39')](_0xccab('0xc'),auth['isAuthenticated'](),controller[_0xccab('0x3a')]);router[_0xccab('0x3b')](_0xccab('0xc'),auth[_0xccab('0x8')](),controller[_0xccab('0x3c')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xccab('0x3d')]);router[_0xccab('0x3b')]('/:id/canned_answers',auth[_0xccab('0x8')](),controller[_0xccab('0x3e')]);router[_0xccab('0x3b')](_0xccab('0x20'),auth[_0xccab('0x8')](),controller['removeAgents']);module[_0xccab('0x3f')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 2bab548..75a517f 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 _0xfffc=['exports','STRING','name'];(function(_0xc490b4,_0x4f67c1){var _0x4be707=function(_0x39f517){while(--_0x39f517){_0xc490b4['push'](_0xc490b4['shift']());}};_0x4be707(++_0x4f67c1);}(_0xfffc,0xfc));var _0xcfff=function(_0x6cbc20,_0x4ad188){_0x6cbc20=_0x6cbc20-0x0;var _0x1b09e5=_0xfffc[_0x6cbc20];return _0x1b09e5;};'use strict';var Sequelize=require('sequelize');module[_0xcfff('0x0')]={'name':{'type':Sequelize[_0xcfff('0x1')],'unique':_0xcfff('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcfff('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xcfff('0x1')]},'fax':{'type':Sequelize[_0xcfff('0x1')]},'type':{'type':Sequelize[_0xcfff('0x1')]},'street':{'type':Sequelize[_0xcfff('0x1')]},'postalCode':{'type':Sequelize[_0xcfff('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xcfff('0x1')]},'sCity':{'type':Sequelize[_0xcfff('0x1')]},'sCountry':{'type':Sequelize[_0xcfff('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc153=['exports','STRING','name','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc153,0x1e3));var _0x3c15=function(_0x3efadc,_0x970123){_0x3efadc=_0x3efadc-0x0;var _0x5e7e75=_0xc153[_0x3efadc];return _0x5e7e75;};'use strict';var Sequelize=require(_0x3c15('0x0'));module[_0x3c15('0x1')]={'name':{'type':Sequelize[_0x3c15('0x2')],'unique':_0x3c15('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3c15('0x2')]},'companyId':{'type':Sequelize[_0x3c15('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x3c15('0x2')]},'type':{'type':Sequelize[_0x3c15('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x3c15('0x2')]},'city':{'type':Sequelize[_0x3c15('0x2')]},'country':{'type':Sequelize[_0x3c15('0x2')]},'email':{'type':Sequelize[_0x3c15('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x3c15('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x3c15('0x2')]},'sCountry':{'type':Sequelize[_0x3c15('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index ac7ae56..64ebc9f 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 _0x3081=['error','stack','name','send','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','offset','sort','where','filters','pick','merge','map','type','VIRTUAL','field','options','CmCompany','include','findAll','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','addContacts','CmContact','ids','omit','getContacts','findOne','order','filter','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','json','count','limit','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','end'];(function(_0x79dd58,_0x4ec3dc){var _0x32da7d=function(_0x92f90){while(--_0x92f90){_0x79dd58['push'](_0x79dd58['shift']());}};_0x32da7d(++_0x4ec3dc);}(_0x3081,0x1bf));var _0x1308=function(_0x22261c,_0x5ecf89){_0x22261c=_0x22261c-0x0;var _0x30e080=_0x3081[_0x22261c];return _0x30e080;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1308('0x0'));var rimraf=require(_0x1308('0x1'));var zipdir=require(_0x1308('0x2'));var jsonpatch=require(_0x1308('0x3'));var rp=require(_0x1308('0x4'));var moment=require(_0x1308('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1308('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1308('0x7'));var csv=require(_0x1308('0x8'));var ejs=require(_0x1308('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1308('0xa'));var crypto=require(_0x1308('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1308('0x8'));var querystring=require(_0x1308('0xc'));var Papa=require(_0x1308('0xd'));var Redis=require('ioredis');var authService=require(_0x1308('0xe'));var qs=require(_0x1308('0xf'));var hardwareService=require(_0x1308('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x1308('0x11'));var config=require(_0x1308('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xccdce1,_0x4d4842){_0x4d4842=_0x4d4842||0xcc;return function(_0x27d82c){if(_0x27d82c){return _0xccdce1[_0x1308('0x13')](_0x4d4842);}return _0xccdce1['status'](_0x4d4842)['end']();};}function respondWithResult(_0x4592bf,_0x2bb9c6){_0x2bb9c6=_0x2bb9c6||0xc8;return function(_0x4e5242){if(_0x4e5242){return _0x4592bf[_0x1308('0x14')](_0x2bb9c6)[_0x1308('0x15')](_0x4e5242);}};}function respondWithFilteredResult(_0x2fab1c,_0x4efe09){return function(_0x3e2fd2){if(_0x3e2fd2){var _0x3fedc7=_0x3e2fd2[_0x1308('0x16')],_0x54fb65=_0x4efe09['offset'],_0x1c664a=_0x4efe09['offset']+_0x4efe09[_0x1308('0x17')],_0x32a84b;if(_0x1c664a>=_0x3fedc7){_0x1c664a=_0x3fedc7;_0x32a84b=0xc8;}else{_0x32a84b=0xce;}_0x2fab1c['status'](_0x32a84b);return _0x2fab1c['set'](_0x1308('0x18'),_0x54fb65+'-'+_0x1c664a+'/'+_0x3fedc7)[_0x1308('0x15')](_0x3e2fd2);}return null;};}function patchUpdates(_0x303ceb){return function(_0x879cd6){try{jsonpatch[_0x1308('0x19')](_0x879cd6,_0x303ceb,!![]);}catch(_0x53b9e1){return BPromise[_0x1308('0x1a')](_0x53b9e1);}return _0x879cd6['save']();};}function saveUpdates(_0x9f1e72,_0x49ebf0){return function(_0x24baae){if(_0x24baae){return _0x24baae[_0x1308('0x1b')](_0x9f1e72)[_0x1308('0x1c')](function(_0x2acac4){return _0x2acac4;});}return null;};}function removeEntity(_0x4d545c,_0x1903c7){return function(_0x2c3082){if(_0x2c3082){return _0x2c3082['destroy']()['then'](function(){var _0x3cf228=_0x2c3082[_0x1308('0x1d')]({'plain':!![]});var _0xd88e4c='Companies';return db[_0x1308('0x1e')][_0x1308('0x1f')]({'where':{'type':_0xd88e4c,'resourceId':_0x3cf228['id']}})[_0x1308('0x1c')](function(){return _0x2c3082;});})['then'](function(){_0x4d545c[_0x1308('0x14')](0xcc)[_0x1308('0x20')]();});}};}function handleEntityNotFound(_0x3a00ec,_0x1b7e25){return function(_0xc58218){if(!_0xc58218){_0x3a00ec[_0x1308('0x13')](0x194);}return _0xc58218;};}function handleError(_0x58b8db,_0x54a978){_0x54a978=_0x54a978||0x1f4;return function(_0x4b30bb){logger[_0x1308('0x21')](_0x4b30bb[_0x1308('0x22')]);if(_0x4b30bb[_0x1308('0x23')]){delete _0x4b30bb[_0x1308('0x23')];}_0x58b8db[_0x1308('0x14')](_0x54a978)[_0x1308('0x24')](_0x4b30bb);};}exports['index']=function(_0x3f32f7,_0x51db74){var _0x4ab56b={},_0x12272f={},_0x37d5ca={'count':0x0,'rows':[]};var _0x1f757f=db['CmCompany'][_0x1308('0x25')];_0x12272f[_0x1308('0x26')]=_[_0x1308('0x27')](_0x1f757f);_0x12272f[_0x1308('0x28')]=_[_0x1308('0x27')](_0x3f32f7['query']);_0x12272f['filters']=_[_0x1308('0x29')](_0x12272f[_0x1308('0x26')],_0x12272f[_0x1308('0x28')]);_0x4ab56b['attributes']=_[_0x1308('0x29')](_0x12272f['model'],qs[_0x1308('0x2a')](_0x3f32f7[_0x1308('0x28')][_0x1308('0x2a')]));_0x4ab56b[_0x1308('0x2b')]=_0x4ab56b['attributes'][_0x1308('0x2c')]?_0x4ab56b['attributes']:_0x12272f['model'];if(!_0x3f32f7[_0x1308('0x28')][_0x1308('0x2d')]('nolimit')){_0x4ab56b['limit']=qs[_0x1308('0x17')](_0x3f32f7[_0x1308('0x28')][_0x1308('0x17')]);_0x4ab56b[_0x1308('0x2e')]=qs[_0x1308('0x2e')](_0x3f32f7['query'][_0x1308('0x2e')]);}_0x4ab56b['order']=qs[_0x1308('0x2f')](_0x3f32f7[_0x1308('0x28')][_0x1308('0x2f')]);_0x4ab56b[_0x1308('0x30')]=qs[_0x1308('0x31')](_[_0x1308('0x32')](_0x3f32f7[_0x1308('0x28')],_0x12272f[_0x1308('0x31')]));if(_0x3f32f7[_0x1308('0x28')]['filter']){_0x4ab56b[_0x1308('0x30')]=_[_0x1308('0x33')](_0x4ab56b[_0x1308('0x30')],{'$or':_[_0x1308('0x34')](_0x1f757f,function(_0x265726){if(_0x265726[_0x1308('0x35')]['key']!==_0x1308('0x36')){var _0x3c84a4={};_0x3c84a4[_0x265726[_0x1308('0x37')]]={'$like':'%'+_0x3f32f7[_0x1308('0x28')]['filter']+'%'};return _0x3c84a4;}})});}_0x4ab56b=_[_0x1308('0x33')]({},_0x4ab56b,_0x3f32f7[_0x1308('0x38')]);var _0x4e4a5f={'where':_0x4ab56b[_0x1308('0x30')]};return db[_0x1308('0x39')]['count'](_0x4e4a5f)[_0x1308('0x1c')](function(_0x8c2cdb){_0x37d5ca[_0x1308('0x16')]=_0x8c2cdb;if(_0x3f32f7[_0x1308('0x28')]['includeAll']){_0x4ab56b[_0x1308('0x3a')]=[{'all':!![]}];}return db[_0x1308('0x39')][_0x1308('0x3b')](_0x4ab56b);})['then'](function(_0x5353bc){_0x37d5ca['rows']=_0x5353bc;return _0x37d5ca;})[_0x1308('0x1c')](respondWithFilteredResult(_0x51db74,_0x4ab56b))[_0x1308('0x3c')](handleError(_0x51db74,null));};exports[_0x1308('0x3d')]=function(_0x144cbe,_0x2d58e0){var _0x5c1a35={'raw':![],'where':{'id':_0x144cbe[_0x1308('0x3e')]['id']}},_0x149618={};_0x149618[_0x1308('0x26')]=_['keys'](db[_0x1308('0x39')][_0x1308('0x25')]);_0x149618[_0x1308('0x28')]=_[_0x1308('0x27')](_0x144cbe[_0x1308('0x28')]);_0x149618[_0x1308('0x31')]=_['intersection'](_0x149618['model'],_0x149618[_0x1308('0x28')]);_0x5c1a35[_0x1308('0x2b')]=_[_0x1308('0x29')](_0x149618[_0x1308('0x26')],qs[_0x1308('0x2a')](_0x144cbe[_0x1308('0x28')][_0x1308('0x2a')]));_0x5c1a35[_0x1308('0x2b')]=_0x5c1a35['attributes'][_0x1308('0x2c')]?_0x5c1a35[_0x1308('0x2b')]:_0x149618[_0x1308('0x26')];if(_0x144cbe[_0x1308('0x28')][_0x1308('0x3f')]){_0x5c1a35[_0x1308('0x3a')]=[{'all':!![]}];}_0x5c1a35=_[_0x1308('0x33')]({},_0x5c1a35,_0x144cbe['options']);return db['CmCompany']['find'](_0x5c1a35)[_0x1308('0x1c')](handleEntityNotFound(_0x2d58e0,null))['then'](respondWithResult(_0x2d58e0,null))[_0x1308('0x3c')](handleError(_0x2d58e0,null));};exports['create']=function(_0x55cc99,_0x49bc82){return db[_0x1308('0x39')][_0x1308('0x40')](_0x55cc99[_0x1308('0x41')],{})['then'](function(_0x33c812){var _0x24c915=_0x55cc99[_0x1308('0x42')]['get']({'plain':!![]});if(!_0x24c915)throw new Error(_0x1308('0x43'));if(_0x24c915['role']===_0x1308('0x42')){var _0x2224b0=_0x33c812[_0x1308('0x1d')]({'plain':!![]});var _0x3eb63d='Companies';return db['UserProfileSection'][_0x1308('0x44')]({'where':{'name':_0x3eb63d,'userProfileId':_0x24c915[_0x1308('0x45')]},'raw':!![]})[_0x1308('0x1c')](function(_0x4dd6b4){if(_0x4dd6b4&&_0x4dd6b4[_0x1308('0x46')]===0x0){return db[_0x1308('0x1e')][_0x1308('0x40')]({'name':_0x2224b0[_0x1308('0x23')],'resourceId':_0x2224b0['id'],'type':_0x4dd6b4[_0x1308('0x23')],'sectionId':_0x4dd6b4['id']},{})[_0x1308('0x1c')](function(){return _0x33c812;});}else{return _0x33c812;}})[_0x1308('0x3c')](function(_0x547af5){logger[_0x1308('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x547af5);throw _0x547af5;});}return _0x33c812;})[_0x1308('0x1c')](respondWithResult(_0x49bc82,0xc9))[_0x1308('0x3c')](handleError(_0x49bc82,null));};exports[_0x1308('0x1b')]=function(_0x26c391,_0x46967f){if(_0x26c391[_0x1308('0x41')]['id']){delete _0x26c391[_0x1308('0x41')]['id'];}return db[_0x1308('0x39')][_0x1308('0x44')]({'where':{'id':_0x26c391[_0x1308('0x3e')]['id']}})[_0x1308('0x1c')](handleEntityNotFound(_0x46967f,null))['then'](saveUpdates(_0x26c391['body'],null))[_0x1308('0x1c')](respondWithResult(_0x46967f,null))[_0x1308('0x3c')](handleError(_0x46967f,null));};exports[_0x1308('0x1f')]=function(_0x50b952,_0x184bea){return db['CmCompany'][_0x1308('0x44')]({'where':{'id':_0x50b952[_0x1308('0x3e')]['id']}})[_0x1308('0x1c')](handleEntityNotFound(_0x184bea,null))[_0x1308('0x1c')](removeEntity(_0x184bea,null))[_0x1308('0x3c')](handleError(_0x184bea,null));};exports[_0x1308('0x47')]=function(_0x50b06c,_0x5f2a45,_0x324cf5){return db[_0x1308('0x48')][_0x1308('0x44')]({'where':{'id':_0x50b06c[_0x1308('0x3e')]['id']}})[_0x1308('0x1c')](handleEntityNotFound(_0x5f2a45,null))['then'](function(_0x426a58){if(_0x426a58){return _0x426a58[_0x1308('0x47')](_0x50b06c[_0x1308('0x41')][_0x1308('0x49')],_[_0x1308('0x4a')](_0x50b06c[_0x1308('0x41')],[_0x1308('0x49'),'id'])||{});}})[_0x1308('0x1c')](respondWithResult(_0x5f2a45,null))[_0x1308('0x3c')](handleError(_0x5f2a45,null));};exports[_0x1308('0x4b')]=function(_0x3fac72,_0x308de5,_0x151ed5){var _0x494512={};var _0x54f2d0={};var _0x5727cb;var _0x58fe32;return db[_0x1308('0x39')][_0x1308('0x4c')]({'where':{'id':_0x3fac72['params']['id']}})[_0x1308('0x1c')](handleEntityNotFound(_0x308de5,null))[_0x1308('0x1c')](function(_0x12dc1d){if(_0x12dc1d){_0x5727cb=_0x12dc1d;_0x54f2d0[_0x1308('0x26')]=_[_0x1308('0x27')](db[_0x1308('0x48')][_0x1308('0x25')]);_0x54f2d0[_0x1308('0x28')]=_[_0x1308('0x27')](_0x3fac72[_0x1308('0x28')]);_0x54f2d0[_0x1308('0x31')]=_[_0x1308('0x29')](_0x54f2d0[_0x1308('0x26')],_0x54f2d0[_0x1308('0x28')]);_0x494512[_0x1308('0x2b')]=_['intersection'](_0x54f2d0[_0x1308('0x26')],qs[_0x1308('0x2a')](_0x3fac72['query'][_0x1308('0x2a')]));_0x494512[_0x1308('0x2b')]=_0x494512[_0x1308('0x2b')][_0x1308('0x2c')]?_0x494512[_0x1308('0x2b')]:_0x54f2d0[_0x1308('0x26')];_0x494512[_0x1308('0x4d')]=qs[_0x1308('0x2f')](_0x3fac72[_0x1308('0x28')]['sort']);_0x494512[_0x1308('0x30')]=qs['filters'](_[_0x1308('0x32')](_0x3fac72[_0x1308('0x28')],_0x54f2d0['filters']));if(_0x3fac72[_0x1308('0x28')][_0x1308('0x4e')]){_0x494512[_0x1308('0x30')]=_[_0x1308('0x33')](_0x494512['where'],{'$or':_[_0x1308('0x34')](_0x494512[_0x1308('0x2b')],function(_0x2e1391){var _0x864ed1={};_0x864ed1[_0x2e1391]={'$like':'%'+_0x3fac72[_0x1308('0x28')][_0x1308('0x4e')]+'%'};return _0x864ed1;})});}_0x494512=_[_0x1308('0x33')]({},_0x494512,_0x3fac72[_0x1308('0x38')]);return _0x5727cb[_0x1308('0x4b')](_0x494512);}})[_0x1308('0x1c')](function(_0x545b63){if(_0x545b63){_0x58fe32=_0x545b63[_0x1308('0x2c')];if(!_0x3fac72['query'][_0x1308('0x2d')](_0x1308('0x4f'))){_0x494512[_0x1308('0x17')]=qs[_0x1308('0x17')](_0x3fac72[_0x1308('0x28')][_0x1308('0x17')]);_0x494512[_0x1308('0x2e')]=qs[_0x1308('0x2e')](_0x3fac72[_0x1308('0x28')][_0x1308('0x2e')]);}return _0x5727cb[_0x1308('0x4b')](_0x494512);}})[_0x1308('0x1c')](function(_0x50a04c){if(_0x50a04c){return _0x50a04c?{'count':_0x58fe32,'rows':_0x50a04c}:null;}})[_0x1308('0x1c')](respondWithResult(_0x308de5,null))['catch'](handleError(_0x308de5,null));};
\ No newline at end of file
+var _0xde55=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','addContacts','CmContact','omit','getContacts','filter','html-pdf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','map','type','key','merge','CmCompany','includeAll','rows','show','include','options','catch','create'];(function(_0x3abff3,_0x4200ba){var _0x562ae9=function(_0x59ba9b){while(--_0x59ba9b){_0x3abff3['push'](_0x3abff3['shift']());}};_0x562ae9(++_0x4200ba);}(_0xde55,0x104));var _0x5de5=function(_0x55a524,_0x55b899){_0x55a524=_0x55a524-0x0;var _0x4e8f51=_0xde55[_0x55a524];return _0x4e8f51;};'use strict';var pdf=require(_0x5de5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5de5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5de5('0x2'));var moment=require(_0x5de5('0x3'));var BPromise=require(_0x5de5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5de5('0x5'));var sox=require(_0x5de5('0x6'));var csv=require(_0x5de5('0x7'));var ejs=require(_0x5de5('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5de5('0x9'));var crypto=require(_0x5de5('0xa'));var jsforce=require(_0x5de5('0xb'));var deskjs=require(_0x5de5('0xc'));var toCsv=require(_0x5de5('0x7'));var querystring=require('querystring');var Papa=require(_0x5de5('0xd'));var Redis=require(_0x5de5('0xe'));var authService=require(_0x5de5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5de5('0x10'));var logger=require(_0x5de5('0x11'))(_0x5de5('0x12'));var utils=require(_0x5de5('0x13'));var config=require(_0x5de5('0x14'));var db=require(_0x5de5('0x15'))['db'];function respondWithStatusCode(_0x876eea,_0xeb472){_0xeb472=_0xeb472||0xcc;return function(_0x5ced4d){if(_0x5ced4d){return _0x876eea[_0x5de5('0x16')](_0xeb472);}return _0x876eea[_0x5de5('0x17')](_0xeb472)['end']();};}function respondWithResult(_0x1bfb5f,_0x562ece){_0x562ece=_0x562ece||0xc8;return function(_0xc09d1e){if(_0xc09d1e){return _0x1bfb5f[_0x5de5('0x17')](_0x562ece)[_0x5de5('0x18')](_0xc09d1e);}};}function respondWithFilteredResult(_0x389bd8,_0x229846){return function(_0x22fd66){if(_0x22fd66){var _0x556a70=_0x22fd66[_0x5de5('0x19')],_0x36d090=_0x229846[_0x5de5('0x1a')],_0x11d581=_0x229846[_0x5de5('0x1a')]+_0x229846[_0x5de5('0x1b')],_0xeeca63;if(_0x11d581>=_0x556a70){_0x11d581=_0x556a70;_0xeeca63=0xc8;}else{_0xeeca63=0xce;}_0x389bd8[_0x5de5('0x17')](_0xeeca63);return _0x389bd8[_0x5de5('0x1c')]('Content-Range',_0x36d090+'-'+_0x11d581+'/'+_0x556a70)[_0x5de5('0x18')](_0x22fd66);}return null;};}function patchUpdates(_0x3aa335){return function(_0x15b664){try{jsonpatch[_0x5de5('0x1d')](_0x15b664,_0x3aa335,!![]);}catch(_0x2ff490){return BPromise[_0x5de5('0x1e')](_0x2ff490);}return _0x15b664[_0x5de5('0x1f')]();};}function saveUpdates(_0x949c5b,_0x20de2f){return function(_0x43ad38){if(_0x43ad38){return _0x43ad38[_0x5de5('0x20')](_0x949c5b)[_0x5de5('0x21')](function(_0x35badf){return _0x35badf;});}return null;};}function removeEntity(_0x1fbddf,_0x5839c3){return function(_0x52c973){if(_0x52c973){return _0x52c973[_0x5de5('0x22')]()[_0x5de5('0x21')](function(){var _0x1c591d=_0x52c973[_0x5de5('0x23')]({'plain':!![]});var _0x2e9a7b='Companies';return db[_0x5de5('0x24')][_0x5de5('0x22')]({'where':{'type':_0x2e9a7b,'resourceId':_0x1c591d['id']}})[_0x5de5('0x21')](function(){return _0x52c973;});})['then'](function(){_0x1fbddf[_0x5de5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b364b,_0x35106a){return function(_0x3e5737){if(!_0x3e5737){_0x5b364b[_0x5de5('0x16')](0x194);}return _0x3e5737;};}function handleError(_0x4088e1,_0x30462c){_0x30462c=_0x30462c||0x1f4;return function(_0x445780){logger[_0x5de5('0x25')](_0x445780['stack']);if(_0x445780[_0x5de5('0x26')]){delete _0x445780[_0x5de5('0x26')];}_0x4088e1[_0x5de5('0x17')](_0x30462c)[_0x5de5('0x27')](_0x445780);};}exports[_0x5de5('0x28')]=function(_0x533f5a,_0x18d419){var _0x5a4ec2={},_0x25123b={},_0x393585={'count':0x0,'rows':[]};var _0x3661c6=db['CmCompany'][_0x5de5('0x29')];_0x25123b[_0x5de5('0x2a')]=_[_0x5de5('0x2b')](_0x3661c6);_0x25123b[_0x5de5('0x2c')]=_[_0x5de5('0x2b')](_0x533f5a[_0x5de5('0x2c')]);_0x25123b[_0x5de5('0x2d')]=_[_0x5de5('0x2e')](_0x25123b[_0x5de5('0x2a')],_0x25123b['query']);_0x5a4ec2[_0x5de5('0x2f')]=_[_0x5de5('0x2e')](_0x25123b[_0x5de5('0x2a')],qs[_0x5de5('0x30')](_0x533f5a['query'][_0x5de5('0x30')]));_0x5a4ec2[_0x5de5('0x2f')]=_0x5a4ec2[_0x5de5('0x2f')][_0x5de5('0x31')]?_0x5a4ec2['attributes']:_0x25123b['model'];if(!_0x533f5a['query'][_0x5de5('0x32')](_0x5de5('0x33'))){_0x5a4ec2[_0x5de5('0x1b')]=qs[_0x5de5('0x1b')](_0x533f5a[_0x5de5('0x2c')][_0x5de5('0x1b')]);_0x5a4ec2[_0x5de5('0x1a')]=qs[_0x5de5('0x1a')](_0x533f5a[_0x5de5('0x2c')][_0x5de5('0x1a')]);}_0x5a4ec2[_0x5de5('0x34')]=qs['sort'](_0x533f5a[_0x5de5('0x2c')][_0x5de5('0x35')]);_0x5a4ec2['where']=qs[_0x5de5('0x2d')](_[_0x5de5('0x36')](_0x533f5a['query'],_0x25123b['filters']));if(_0x533f5a[_0x5de5('0x2c')]['filter']){_0x5a4ec2[_0x5de5('0x37')]=_['merge'](_0x5a4ec2[_0x5de5('0x37')],{'$or':_[_0x5de5('0x38')](_0x3661c6,function(_0x1ef05f){if(_0x1ef05f[_0x5de5('0x39')][_0x5de5('0x3a')]!=='VIRTUAL'){var _0x44570e={};_0x44570e[_0x1ef05f['field']]={'$like':'%'+_0x533f5a[_0x5de5('0x2c')]['filter']+'%'};return _0x44570e;}})});}_0x5a4ec2=_[_0x5de5('0x3b')]({},_0x5a4ec2,_0x533f5a['options']);var _0x2d1672={'where':_0x5a4ec2[_0x5de5('0x37')]};return db[_0x5de5('0x3c')][_0x5de5('0x19')](_0x2d1672)['then'](function(_0x59d3dd){_0x393585['count']=_0x59d3dd;if(_0x533f5a['query'][_0x5de5('0x3d')]){_0x5a4ec2['include']=[{'all':!![]}];}return db[_0x5de5('0x3c')]['findAll'](_0x5a4ec2);})['then'](function(_0x141c7e){_0x393585[_0x5de5('0x3e')]=_0x141c7e;return _0x393585;})['then'](respondWithFilteredResult(_0x18d419,_0x5a4ec2))['catch'](handleError(_0x18d419,null));};exports[_0x5de5('0x3f')]=function(_0x166e51,_0x1473da){var _0x1e5855={'raw':![],'where':{'id':_0x166e51['params']['id']}},_0x543072={};_0x543072[_0x5de5('0x2a')]=_[_0x5de5('0x2b')](db[_0x5de5('0x3c')][_0x5de5('0x29')]);_0x543072['query']=_[_0x5de5('0x2b')](_0x166e51['query']);_0x543072[_0x5de5('0x2d')]=_[_0x5de5('0x2e')](_0x543072['model'],_0x543072[_0x5de5('0x2c')]);_0x1e5855['attributes']=_[_0x5de5('0x2e')](_0x543072[_0x5de5('0x2a')],qs[_0x5de5('0x30')](_0x166e51[_0x5de5('0x2c')]['fields']));_0x1e5855['attributes']=_0x1e5855[_0x5de5('0x2f')][_0x5de5('0x31')]?_0x1e5855[_0x5de5('0x2f')]:_0x543072[_0x5de5('0x2a')];if(_0x166e51[_0x5de5('0x2c')][_0x5de5('0x3d')]){_0x1e5855[_0x5de5('0x40')]=[{'all':!![]}];}_0x1e5855=_[_0x5de5('0x3b')]({},_0x1e5855,_0x166e51[_0x5de5('0x41')]);return db[_0x5de5('0x3c')]['find'](_0x1e5855)[_0x5de5('0x21')](handleEntityNotFound(_0x1473da,null))[_0x5de5('0x21')](respondWithResult(_0x1473da,null))[_0x5de5('0x42')](handleError(_0x1473da,null));};exports[_0x5de5('0x43')]=function(_0x146700,_0x24d0ed){return db[_0x5de5('0x3c')][_0x5de5('0x43')](_0x146700['body'],{})['then'](function(_0x4f2b7c){var _0x42ffdf=_0x146700[_0x5de5('0x44')][_0x5de5('0x23')]({'plain':!![]});if(!_0x42ffdf)throw new Error(_0x5de5('0x45'));if(_0x42ffdf['role']===_0x5de5('0x44')){var _0x11074c=_0x4f2b7c[_0x5de5('0x23')]({'plain':!![]});var _0x136373=_0x5de5('0x46');return db[_0x5de5('0x47')]['find']({'where':{'name':_0x136373,'userProfileId':_0x42ffdf[_0x5de5('0x48')]},'raw':!![]})['then'](function(_0x2d6f5e){if(_0x2d6f5e&&_0x2d6f5e['autoAssociation']===0x0){return db[_0x5de5('0x24')][_0x5de5('0x43')]({'name':_0x11074c[_0x5de5('0x26')],'resourceId':_0x11074c['id'],'type':_0x2d6f5e[_0x5de5('0x26')],'sectionId':_0x2d6f5e['id']},{})[_0x5de5('0x21')](function(){return _0x4f2b7c;});}else{return _0x4f2b7c;}})['catch'](function(_0x29d2da){logger[_0x5de5('0x25')](_0x5de5('0x49'),_0x29d2da);throw _0x29d2da;});}return _0x4f2b7c;})[_0x5de5('0x21')](respondWithResult(_0x24d0ed,0xc9))[_0x5de5('0x42')](handleError(_0x24d0ed,null));};exports[_0x5de5('0x20')]=function(_0xd634c0,_0x507210){if(_0xd634c0[_0x5de5('0x4a')]['id']){delete _0xd634c0[_0x5de5('0x4a')]['id'];}return db[_0x5de5('0x3c')][_0x5de5('0x4b')]({'where':{'id':_0xd634c0[_0x5de5('0x4c')]['id']}})[_0x5de5('0x21')](handleEntityNotFound(_0x507210,null))[_0x5de5('0x21')](saveUpdates(_0xd634c0[_0x5de5('0x4a')],null))[_0x5de5('0x21')](respondWithResult(_0x507210,null))[_0x5de5('0x42')](handleError(_0x507210,null));};exports['destroy']=function(_0x11a049,_0x4ecf7f){return db[_0x5de5('0x3c')][_0x5de5('0x4b')]({'where':{'id':_0x11a049[_0x5de5('0x4c')]['id']}})[_0x5de5('0x21')](handleEntityNotFound(_0x4ecf7f,null))['then'](removeEntity(_0x4ecf7f,null))[_0x5de5('0x42')](handleError(_0x4ecf7f,null));};exports[_0x5de5('0x4d')]=function(_0x59e867,_0x1b5e66,_0x40fd5e){return db[_0x5de5('0x4e')][_0x5de5('0x4b')]({'where':{'id':_0x59e867[_0x5de5('0x4c')]['id']}})[_0x5de5('0x21')](handleEntityNotFound(_0x1b5e66,null))[_0x5de5('0x21')](function(_0x5cc827){if(_0x5cc827){return _0x5cc827[_0x5de5('0x4d')](_0x59e867[_0x5de5('0x4a')]['ids'],_[_0x5de5('0x4f')](_0x59e867['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1b5e66,null))['catch'](handleError(_0x1b5e66,null));};exports[_0x5de5('0x50')]=function(_0x4201c5,_0x3b84e8,_0x5ebf4a){var _0x2fe3aa={};var _0xe6b2f4={};var _0x355cff;var _0x858685;return db[_0x5de5('0x3c')]['findOne']({'where':{'id':_0x4201c5['params']['id']}})[_0x5de5('0x21')](handleEntityNotFound(_0x3b84e8,null))[_0x5de5('0x21')](function(_0x3b7abd){if(_0x3b7abd){_0x355cff=_0x3b7abd;_0xe6b2f4[_0x5de5('0x2a')]=_[_0x5de5('0x2b')](db['CmContact'][_0x5de5('0x29')]);_0xe6b2f4[_0x5de5('0x2c')]=_['keys'](_0x4201c5[_0x5de5('0x2c')]);_0xe6b2f4['filters']=_[_0x5de5('0x2e')](_0xe6b2f4[_0x5de5('0x2a')],_0xe6b2f4[_0x5de5('0x2c')]);_0x2fe3aa[_0x5de5('0x2f')]=_[_0x5de5('0x2e')](_0xe6b2f4[_0x5de5('0x2a')],qs['fields'](_0x4201c5[_0x5de5('0x2c')][_0x5de5('0x30')]));_0x2fe3aa['attributes']=_0x2fe3aa[_0x5de5('0x2f')]['length']?_0x2fe3aa[_0x5de5('0x2f')]:_0xe6b2f4[_0x5de5('0x2a')];_0x2fe3aa[_0x5de5('0x34')]=qs[_0x5de5('0x35')](_0x4201c5[_0x5de5('0x2c')]['sort']);_0x2fe3aa['where']=qs['filters'](_[_0x5de5('0x36')](_0x4201c5['query'],_0xe6b2f4['filters']));if(_0x4201c5['query']['filter']){_0x2fe3aa[_0x5de5('0x37')]=_['merge'](_0x2fe3aa[_0x5de5('0x37')],{'$or':_[_0x5de5('0x38')](_0x2fe3aa[_0x5de5('0x2f')],function(_0x149098){var _0xea35a6={};_0xea35a6[_0x149098]={'$like':'%'+_0x4201c5['query'][_0x5de5('0x51')]+'%'};return _0xea35a6;})});}_0x2fe3aa=_[_0x5de5('0x3b')]({},_0x2fe3aa,_0x4201c5[_0x5de5('0x41')]);return _0x355cff[_0x5de5('0x50')](_0x2fe3aa);}})[_0x5de5('0x21')](function(_0x57573d){if(_0x57573d){_0x858685=_0x57573d[_0x5de5('0x31')];if(!_0x4201c5[_0x5de5('0x2c')][_0x5de5('0x32')](_0x5de5('0x33'))){_0x2fe3aa[_0x5de5('0x1b')]=qs[_0x5de5('0x1b')](_0x4201c5[_0x5de5('0x2c')][_0x5de5('0x1b')]);_0x2fe3aa[_0x5de5('0x1a')]=qs['offset'](_0x4201c5[_0x5de5('0x2c')][_0x5de5('0x1a')]);}return _0x355cff[_0x5de5('0x50')](_0x2fe3aa);}})['then'](function(_0x582222){if(_0x582222){return _0x582222?{'count':_0x858685,'rows':_0x582222}:null;}})[_0x5de5('0x21')](respondWithResult(_0x3b84e8,null))[_0x5de5('0x42')](handleError(_0x3b84e8,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index b209b5c..c3fd381 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 _0x7d25=['api','moment','bluebird','request-promise','path','define','CmCompany','cm_companies','util','../../config/logger'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0x7d25,0x8a));var _0x57d2=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x7d25[_0x1deb03];return _0x189fe7;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var logger=require(_0x57d2('0x1'))(_0x57d2('0x2'));var moment=require(_0x57d2('0x3'));var BPromise=require(_0x57d2('0x4'));var rp=require(_0x57d2('0x5'));var fs=require('fs');var path=require(_0x57d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module['exports']=function(_0x3c5511,_0x49cc5f){return _0x3c5511[_0x57d2('0x7')](_0x57d2('0x8'),attributes,{'tableName':_0x57d2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd117=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0xd117,0x182));var _0x7d11=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0xd117[_0x27beea];return _0x122645;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),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 74625f5..e368a24 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 _0xf335=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../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','message','result'];(function(_0xef0ad,_0xec64f){var _0x1c7c66=function(_0x3d361f){while(--_0x3d361f){_0xef0ad['push'](_0xef0ad['shift']());}};_0x1c7c66(++_0xec64f);}(_0xf335,0x1c3));var _0x5f33=function(_0x6640ba,_0x1ebe7d){_0x6640ba=_0x6640ba-0x0;var _0x427db6=_0xf335[_0x6640ba];return _0x427db6;};'use strict';var _=require(_0x5f33('0x0'));var util=require(_0x5f33('0x1'));var moment=require('moment');var BPromise=require(_0x5f33('0x2'));var rs=require(_0x5f33('0x3'));var fs=require('fs');var Redis=require(_0x5f33('0x4'));var db=require(_0x5f33('0x5'))['db'];var utils=require(_0x5f33('0x6'));var logger=require(_0x5f33('0x7'))(_0x5f33('0x8'));var config=require(_0x5f33('0x9'));var jayson=require(_0x5f33('0xa'));var client=jayson[_0x5f33('0xb')][_0x5f33('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f0af1,_0xde17ad,_0xc1f9a){return new BPromise(function(_0x16a158,_0x59cd22){return client[_0x5f33('0xd')](_0x2f0af1,_0xc1f9a)[_0x5f33('0xe')](function(_0x17a093){logger[_0x5f33('0xf')](_0x5f33('0x10'),_0xde17ad,_0x5f33('0x11'));logger[_0x5f33('0x12')](_0x5f33('0x13'),_0xde17ad,'request\x20sent',JSON[_0x5f33('0x14')](_0x17a093));if(_0x17a093[_0x5f33('0x15')]){if(_0x17a093[_0x5f33('0x15')]['code']===0x1f4){logger[_0x5f33('0x15')]('CmCompany,\x20%s,\x20%s',_0xde17ad,_0x17a093[_0x5f33('0x15')]['message']);return _0x59cd22(_0x17a093[_0x5f33('0x15')]['message']);}logger['error'](_0x5f33('0x10'),_0xde17ad,_0x17a093['error'][_0x5f33('0x16')]);return _0x16a158(_0x17a093[_0x5f33('0x15')][_0x5f33('0x16')]);}else{logger[_0x5f33('0xf')](_0x5f33('0x10'),_0xde17ad,_0x5f33('0x11'));_0x16a158(_0x17a093[_0x5f33('0x17')][_0x5f33('0x16')]);}})[_0x5f33('0x18')](function(_0x1cd9d2){logger[_0x5f33('0x15')](_0x5f33('0x10'),_0xde17ad,_0x1cd9d2);_0x59cd22(_0x1cd9d2);});});}
\ No newline at end of file
+var _0x7918=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2d0a70,_0x28fe51){var _0x127de3=function(_0x58b165){while(--_0x58b165){_0x2d0a70['push'](_0x2d0a70['shift']());}};_0x127de3(++_0x28fe51);}(_0x7918,0x120));var _0x8791=function(_0x2f7f00,_0x2c7619){_0x2f7f00=_0x2f7f00-0x0;var _0x34c653=_0x7918[_0x2f7f00];return _0x34c653;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8791('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8791('0x1'));var db=require(_0x8791('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8791('0x3'))(_0x8791('0x4'));var config=require('../../config/environment');var jayson=require(_0x8791('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c14e4,_0x566453,_0x4369e1){return new BPromise(function(_0x5ab293,_0x4d3119){return client[_0x8791('0x6')](_0x5c14e4,_0x4369e1)[_0x8791('0x7')](function(_0xa2d45){logger[_0x8791('0x8')](_0x8791('0x9'),_0x566453,_0x8791('0xa'));logger['debug'](_0x8791('0xb'),_0x566453,_0x8791('0xa'),JSON[_0x8791('0xc')](_0xa2d45));if(_0xa2d45[_0x8791('0xd')]){if(_0xa2d45[_0x8791('0xd')][_0x8791('0xe')]===0x1f4){logger[_0x8791('0xd')](_0x8791('0x9'),_0x566453,_0xa2d45[_0x8791('0xd')][_0x8791('0xf')]);return _0x4d3119(_0xa2d45['error']['message']);}logger[_0x8791('0xd')](_0x8791('0x9'),_0x566453,_0xa2d45[_0x8791('0xd')][_0x8791('0xf')]);return _0x5ab293(_0xa2d45[_0x8791('0xd')]['message']);}else{logger[_0x8791('0x8')](_0x8791('0x9'),_0x566453,_0x8791('0xa'));_0x5ab293(_0xa2d45[_0x8791('0x10')][_0x8791('0xf')]);}})[_0x8791('0x11')](function(_0x1343b7){logger[_0x8791('0xd')](_0x8791('0x9'),_0x566453,_0x1343b7);_0x4d3119(_0x1343b7);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 36ec3fc..9a715e8 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 _0xb753=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','get','/:id','isAuthenticated','show','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','exports','multer'];(function(_0x83420c,_0x50fd91){var _0x1057d7=function(_0x80befc){while(--_0x80befc){_0x83420c['push'](_0x83420c['shift']());}};_0x1057d7(++_0x50fd91);}(_0xb753,0x158));var _0x3b75=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xb753[_0x10004e];return _0x5af990;};'use strict';var multer=require(_0x3b75('0x0'));var util=require(_0x3b75('0x1'));var path=require(_0x3b75('0x2'));var timeout=require(_0x3b75('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3b75('0x4'));var interaction=require(_0x3b75('0x5'));var config=require(_0x3b75('0x6'));var controller=require(_0x3b75('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3b75('0x8')]);router[_0x3b75('0x9')](_0x3b75('0xa'),auth[_0x3b75('0xb')](),controller[_0x3b75('0xc')]);router[_0x3b75('0x9')](_0x3b75('0xd'),auth[_0x3b75('0xb')](),controller[_0x3b75('0xe')]);router['post']('/',auth[_0x3b75('0xb')](),controller[_0x3b75('0xf')]);router[_0x3b75('0x10')](_0x3b75('0xd'),auth[_0x3b75('0xb')](),controller[_0x3b75('0x11')]);router[_0x3b75('0x12')](_0x3b75('0xa'),auth[_0x3b75('0xb')](),controller[_0x3b75('0x13')]);router[_0x3b75('0x14')](_0x3b75('0xa'),auth[_0x3b75('0xb')](),controller[_0x3b75('0x15')]);module[_0x3b75('0x16')]=router;
\ No newline at end of file
+var _0x7917=['post','create','addContacts','put','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/:id/contacts','getContacts'];(function(_0x1b9cd5,_0x103dc4){var _0x4c74ca=function(_0x460b5e){while(--_0x460b5e){_0x1b9cd5['push'](_0x1b9cd5['shift']());}};_0x4c74ca(++_0x103dc4);}(_0x7917,0x148));var _0x7791=function(_0x339160,_0x1a68e1){_0x339160=_0x339160-0x0;var _0x565fb6=_0x7917[_0x339160];return _0x565fb6;};'use strict';var multer=require(_0x7791('0x0'));var util=require('util');var path=require(_0x7791('0x1'));var timeout=require('connect-timeout');var express=require(_0x7791('0x2'));var router=express['Router']();var auth=require(_0x7791('0x3'));var interaction=require(_0x7791('0x4'));var config=require(_0x7791('0x5'));var controller=require(_0x7791('0x6'));router['get']('/',auth[_0x7791('0x7')](),controller[_0x7791('0x8')]);router[_0x7791('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7791('0x9')](_0x7791('0xa'),auth['isAuthenticated'](),controller[_0x7791('0xb')]);router[_0x7791('0xc')]('/',auth['isAuthenticated'](),controller[_0x7791('0xd')]);router[_0x7791('0xc')](_0x7791('0xa'),auth[_0x7791('0x7')](),controller[_0x7791('0xe')]);router[_0x7791('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7791('0x10')]);router[_0x7791('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7791('0x12')]);module[_0x7791('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 197f8aa..5f37382 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 _0x1477=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x226802,_0x14c0f1){var _0x5900b9=function(_0x5e1169){while(--_0x5e1169){_0x226802['push'](_0x226802['shift']());}};_0x5900b9(++_0x14c0f1);}(_0x1477,0x1b7));var _0x7147=function(_0x571a92,_0x252001){_0x571a92=_0x571a92-0x0;var _0x98b426=_0x1477[_0x571a92];return _0x98b426;};'use strict';var _=require(_0x7147('0x0'));var Sequelize=require('sequelize');module[_0x7147('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x7147('0x2')]},'postalCode':{'type':Sequelize[_0x7147('0x2')]},'city':{'type':Sequelize[_0x7147('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x7147('0x2')]},'description':{'type':Sequelize[_0x7147('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x7147('0x2')]},'fax':{'type':Sequelize[_0x7147('0x2')]},'email':{'type':Sequelize[_0x7147('0x2')]},'url':{'type':Sequelize[_0x7147('0x2')]},'facebook':{'type':Sequelize[_0x7147('0x2')]},'fb_data':{'type':Sequelize[_0x7147('0x2')]},'twitter':{'type':Sequelize[_0x7147('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x7147('0x2')]},'viber':{'type':Sequelize[_0x7147('0x2')]},'line':{'type':Sequelize[_0x7147('0x2')]},'wechat':{'type':Sequelize[_0x7147('0x2')]},'telegram':{'type':Sequelize[_0x7147('0x2')]},'UserId':{'type':Sequelize[_0x7147('0x4')]},'priority':{'type':Sequelize[_0x7147('0x4')](0x2)[_0x7147('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7147('0x6')],'defaultValue':Sequelize[_0x7147('0x7')]}};
\ No newline at end of file
+var _0x0d58=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x505d86,_0x4fd049){var _0x1e9877=function(_0x3aed32){while(--_0x3aed32){_0x505d86['push'](_0x505d86['shift']());}};_0x1e9877(++_0x4fd049);}(_0x0d58,0x1dc));var _0x80d5=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x0d58[_0x374ccf];return _0x443cde;};'use strict';var _=require(_0x80d5('0x0'));var Sequelize=require(_0x80d5('0x1'));module[_0x80d5('0x2')]={'firstName':{'type':Sequelize[_0x80d5('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x80d5('0x3')]},'street':{'type':Sequelize[_0x80d5('0x3')]},'postalCode':{'type':Sequelize[_0x80d5('0x3')]},'city':{'type':Sequelize[_0x80d5('0x3')]},'country':{'type':Sequelize[_0x80d5('0x3')]},'dateOfBirth':{'type':Sequelize[_0x80d5('0x3')]},'description':{'type':Sequelize[_0x80d5('0x4')]},'phone':{'type':Sequelize[_0x80d5('0x3')]},'mobile':{'type':Sequelize[_0x80d5('0x3')]},'fax':{'type':Sequelize[_0x80d5('0x3')]},'email':{'type':Sequelize[_0x80d5('0x3')]},'url':{'type':Sequelize[_0x80d5('0x3')]},'facebook':{'type':Sequelize[_0x80d5('0x3')]},'fb_data':{'type':Sequelize[_0x80d5('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x80d5('0x3')]},'viber':{'type':Sequelize[_0x80d5('0x3')]},'line':{'type':Sequelize[_0x80d5('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x80d5('0x3')]},'UserId':{'type':Sequelize[_0x80d5('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x80d5('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x80d5('0x7')],'defaultValue':Sequelize[_0x80d5('0x8')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 89d64d4..625b34c 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 _0x7c01=['hasOwnProperty','filter','isNil','isEmpty','c.ListId\x20IN\x20?','concat','replace','\x27\x27\x27\x27','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','order','DESC','group','c.id','Sequelize','QueryTypes','COUNT(*)','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','cm_contact_has_tags','left_join','t.id\x20IN\x20?','sequelize','toString','keyBy','merge','c.*','GROUP_CONCAT(DISTINCT\x20t.id)','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','TagIds','split','Tags','rows','catch','find','describe','startsWith','columnName','displayName','CmCustomField','findAll','cf_','alias','custom','type','values','body','get','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','VoiceCallReport','ChatQueueReport','OpenchannelQueueReport','create','each','duplicates','$or','push','ListId','spread','show','params','Tag','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','text','getTags','findOne','rawAttributes','options','setTags','ids','count','includeAll','getHopperHistories','include','getHopperFinals','CmHopperFinal','getJscriptySessions','JscriptySessionReport','ContactId','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','phone','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','meta','import','User','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmContact','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','c.deletedAt\x20IS\x20NULL','expr','advancedFilter','forEach','condition','isArray','value','and','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','map'];(function(_0x1b5b5d,_0x255772){var _0x38d0fd=function(_0x47a5bc){while(--_0x47a5bc){_0x1b5b5d['push'](_0x1b5b5d['shift']());}};_0x38d0fd(++_0x255772);}(_0x7c01,0x93));var _0x17c0=function(_0x36c04d,_0x52e6d2){_0x36c04d=_0x36c04d-0x0;var _0x45116f=_0x7c01[_0x36c04d];return _0x45116f;};'use strict';var pdf=require(_0x17c0('0x0'));var emlformat=require(_0x17c0('0x1'));var rimraf=require(_0x17c0('0x2'));var zipdir=require(_0x17c0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x17c0('0x4'));var moment=require(_0x17c0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x17c0('0x6'));var util=require(_0x17c0('0x7'));var path=require('path');var sox=require(_0x17c0('0x8'));var csv=require(_0x17c0('0x9'));var ejs=require(_0x17c0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x17c0('0xb'));var crypto=require(_0x17c0('0xc'));var jsforce=require(_0x17c0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x17c0('0x9'));var querystring=require(_0x17c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x17c0('0xf'));var authService=require(_0x17c0('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x17c0('0x11'));var logger=require(_0x17c0('0x12'))(_0x17c0('0x13'));var utils=require(_0x17c0('0x14'));var config=require(_0x17c0('0x15'));var db=require(_0x17c0('0x16'))['db'];config[_0x17c0('0x17')]=_['defaults'](config[_0x17c0('0x17')],{'host':_0x17c0('0x18'),'port':0x18eb});var socket=require(_0x17c0('0x19'))(new Redis(config[_0x17c0('0x17')]));require(_0x17c0('0x1a'))[_0x17c0('0x1b')](socket);function respondWithStatusCode(_0x32f9c4,_0x5e05be){_0x5e05be=_0x5e05be||0xcc;return function(_0x5af7aa){if(_0x5af7aa){return _0x32f9c4[_0x17c0('0x1c')](_0x5e05be);}return _0x32f9c4[_0x17c0('0x1d')](_0x5e05be)[_0x17c0('0x1e')]();};}function respondWithResult(_0x1bf87d,_0xd30255){_0xd30255=_0xd30255||0xc8;return function(_0x5d97bf){if(_0x5d97bf){return _0x1bf87d['status'](_0xd30255)[_0x17c0('0x1f')](_0x5d97bf);}};}function respondWithFilteredResult(_0x163175,_0x1b5455){return function(_0x490cd4){if(_0x490cd4){var _0x5a5c88=_0x490cd4['count'],_0x144817=_0x1b5455[_0x17c0('0x20')],_0x47737f=_0x1b5455[_0x17c0('0x20')]+_0x1b5455[_0x17c0('0x21')],_0x208877;if(_0x47737f>=_0x5a5c88){_0x47737f=_0x5a5c88;_0x208877=0xc8;}else{_0x208877=0xce;}_0x163175[_0x17c0('0x1d')](_0x208877);return _0x163175[_0x17c0('0x22')]('Content-Range',_0x144817+'-'+_0x47737f+'/'+_0x5a5c88)['json'](_0x490cd4);}return null;};}function patchUpdates(_0x2643a2){return function(_0x461a98){try{jsonpatch[_0x17c0('0x23')](_0x461a98,_0x2643a2,!![]);}catch(_0x1a0ae2){return BPromise[_0x17c0('0x24')](_0x1a0ae2);}return _0x461a98[_0x17c0('0x25')]();};}function saveUpdates(_0x4e5f5e,_0x33379d){return function(_0x1d44cf){if(_0x1d44cf){return _0x1d44cf[_0x17c0('0x26')](_0x4e5f5e)[_0x17c0('0x27')](function(_0x320fb9){return _0x320fb9;});}return null;};}function removeEntity(_0x151b99,_0x9a3ded){return function(_0x4d0a08){if(_0x4d0a08){return _0x4d0a08[_0x17c0('0x28')]()[_0x17c0('0x27')](function(){_0x151b99[_0x17c0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a0dd3,_0x510efc){return function(_0x2c6ef3){if(!_0x2c6ef3){_0x3a0dd3[_0x17c0('0x1c')](0x194);}return _0x2c6ef3;};}function handleError(_0x2de054,_0x1f67b2){_0x1f67b2=_0x1f67b2||0x1f4;return function(_0x2f735d){logger[_0x17c0('0x29')](_0x2f735d[_0x17c0('0x2a')]);if(_0x2f735d['name']){delete _0x2f735d[_0x17c0('0x2b')];}_0x2de054['status'](_0x1f67b2)[_0x17c0('0x2c')](_0x2f735d);};}exports[_0x17c0('0x2d')]=function(_0x515ae5,_0x297b07){var _0x4bc4a6={},_0x2a035f={},_0x4f56ec={'count':0x0,'rows':[]};return db[_0x17c0('0x2e')]['describe']()['then'](function(_0x2c5508){_0x2a035f[_0x17c0('0x2f')]=_['keys'](_0x2c5508);_0x2a035f[_0x17c0('0x30')]=_[_0x17c0('0x31')](_0x515ae5[_0x17c0('0x30')]);_0x2a035f[_0x17c0('0x32')]=_[_0x17c0('0x33')](_0x2a035f[_0x17c0('0x2f')],_0x2a035f['query']);_0x4bc4a6[_0x17c0('0x34')]=_[_0x17c0('0x33')](_0x2a035f[_0x17c0('0x2f')],qs['fields'](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x35')]));_0x4bc4a6[_0x17c0('0x34')]=_0x4bc4a6[_0x17c0('0x34')][_0x17c0('0x36')]?_0x4bc4a6[_0x17c0('0x34')]:_0x2a035f[_0x17c0('0x2f')];if(!_0x515ae5[_0x17c0('0x30')]['hasOwnProperty'](_0x17c0('0x37'))){_0x4bc4a6[_0x17c0('0x21')]=qs[_0x17c0('0x21')](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x21')]);_0x4bc4a6[_0x17c0('0x20')]=qs[_0x17c0('0x20')](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x20')]);}_0x4bc4a6['order']=qs['sort'](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x38')]);_0x4bc4a6[_0x17c0('0x39')]=qs[_0x17c0('0x32')](_[_0x17c0('0x3a')](_0x515ae5[_0x17c0('0x30')],_0x2a035f[_0x17c0('0x32')]));var _0x62e551=[];var _0x3b73de=squel[_0x17c0('0x3b')]()[_0x17c0('0x3c')]('id')[_0x17c0('0x3c')](_0x17c0('0x2b'))['field'](_0x17c0('0x3d'))[_0x17c0('0x3e')](_0x17c0('0x3f'));var _0x26177a=squel['select']()[_0x17c0('0x3e')](_0x17c0('0x40'),'c')[_0x17c0('0x39')](_0x17c0('0x41'));var _0x5b7a42=squel[_0x17c0('0x42')]();if(_0x515ae5[_0x17c0('0x30')][_0x17c0('0x43')]){var _0x2f095e=JSON['parse'](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x43')]);_[_0x17c0('0x31')](_0x2f095e)[_0x17c0('0x44')](function(_0x4edfd5){var _0x5eb980=_0x2f095e[_0x4edfd5];switch(_0x5eb980[_0x17c0('0x45')]){case'IS':if(_[_0x17c0('0x46')](_0x5eb980[_0x17c0('0x47')])&&_0x5eb980[_0x17c0('0x47')][_0x17c0('0x36')]>0x1){_0x5b7a42[_0x17c0('0x48')](_0x5eb980[_0x17c0('0x49')]+'.'+_0x4edfd5+_0x17c0('0x4a'),_0x5eb980[_0x17c0('0x47')]);}else{_0x5b7a42[_0x17c0('0x48')](_0x5eb980[_0x17c0('0x49')]+'.'+_0x4edfd5+_0x17c0('0x4b'),_0x5eb980[_0x17c0('0x47')][0x0]);}break;case'=':_0x5b7a42[_0x17c0('0x48')](_0x5eb980['tableAlias']+'.'+_0x4edfd5+_0x17c0('0x4b'),_0x5eb980[_0x17c0('0x47')]);break;case _0x17c0('0x4c'):_0x5b7a42[_0x17c0('0x48')](_0x5eb980[_0x17c0('0x49')]+'.'+_0x4edfd5+_0x17c0('0x4d'),'%'+_0x5eb980[_0x17c0('0x47')]+'%');break;case'>':_0x5b7a42['and'](_0x5eb980['tableAlias']+'.'+_0x4edfd5+_0x17c0('0x4e'),_0x5eb980[_0x17c0('0x47')]);break;case'<':_0x5b7a42[_0x17c0('0x48')](_0x5eb980[_0x17c0('0x49')]+'.'+_0x4edfd5+_0x17c0('0x4f'),_0x5eb980['value']);break;}});}else{var _0x464624=_(Object[_0x17c0('0x31')](_0x515ae5[_0x17c0('0x30')]))[_0x17c0('0x50')](function(_0x14b2e3){return _0x2c5508[_0x17c0('0x51')](_0x14b2e3)?_0x14b2e3:undefined;})[_0x17c0('0x52')](function(_0x3195d1){return!_[_0x17c0('0x53')](_0x3195d1);})['value']();if(!_[_0x17c0('0x54')](_0x464624)){_0x464624[_0x17c0('0x44')](function(_0x62c212){if(_0x62c212==='ListId'){_0x26177a[_0x17c0('0x39')](_0x17c0('0x55'),[][_0x17c0('0x56')](_0x515ae5['query'][_0x62c212]));}else{_0x26177a[_0x17c0('0x39')]('c.'+_0x62c212+_0x17c0('0x4b'),_0x515ae5[_0x17c0('0x30')][_0x62c212]);}});}if(_0x515ae5[_0x17c0('0x30')][_0x17c0('0x52')]){var _0x3d57ee=_0x515ae5[_0x17c0('0x30')][_0x17c0('0x52')][_0x17c0('0x57')]('\x5c','\x5c\x5c')[_0x17c0('0x57')]('\x27\x27',_0x17c0('0x58'));if(qs[_0x17c0('0x59')](_0x3d57ee)){_0x5b7a42['or'](_0x17c0('0x5a'),_0x3d57ee+'%');_0x5b7a42['or'](_0x17c0('0x5b'),_0x3d57ee+'%');_0x5b7a42['or'](_0x17c0('0x5c'),_0x3d57ee+'%');_0x5b7a42['or'](_0x17c0('0x5d'),_0x3d57ee+'%');}else if(qs[_0x17c0('0x5e')](_0x3d57ee)){_0x5b7a42['or'](_0x17c0('0x5f'),_0x3d57ee+'%');}else{_0x5b7a42['or'](_0x17c0('0x5f'),_0x3d57ee+'%');_0x5b7a42['or'](_0x17c0('0x60'),_0x3d57ee+'%');_0x5b7a42['or'](_0x17c0('0x61'),_0x3d57ee+'%');}}}_0x26177a[_0x17c0('0x39')](_0x5b7a42);if(_0x4bc4a6[_0x17c0('0x62')]){_0x4bc4a6[_0x17c0('0x62')][_0x17c0('0x44')](function(_0x324f59){_0x26177a[_0x17c0('0x62')]('c.'+_0x324f59[0x0],_0x324f59[0x1]===_0x17c0('0x63')?![]:!![]);});}_0x26177a[_0x17c0('0x64')](_0x17c0('0x65'));var _0x1f0544={'type':db[_0x17c0('0x66')][_0x17c0('0x67')]['SELECT'],'raw':!![]};var _0x64933b=_0x26177a['clone']()[_0x17c0('0x3c')](_0x17c0('0x68'));if(!_0x515ae5[_0x17c0('0x30')][_0x17c0('0x43')]){if(_0x515ae5[_0x17c0('0x30')][_0x17c0('0x69')]){var _0x3df434=_[_0x17c0('0x46')](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x69')])?_0x515ae5['query']['tag']:new Array(_0x515ae5['query'][_0x17c0('0x69')]);var _0xedc288=squel[_0x17c0('0x42')]();_0x3df434[_0x17c0('0x44')](function(_0x404551){_0xedc288['or'](_0x17c0('0x6a'),'%,'+_0x404551+',%');});_0x26177a[_0x17c0('0x6b')](_0xedc288);_0x64933b['left_join'](_0x17c0('0x6c'),'ct','ct.CmContactId\x20=\x20c.id');_0x64933b[_0x17c0('0x6d')](_0x17c0('0x3f'),'t','t.id\x20=\x20ct.TagId');_0x64933b[_0x17c0('0x39')](_0x17c0('0x6e'),_0x3df434);}}db[_0x17c0('0x6f')][_0x17c0('0x30')](_0x3b73de[_0x17c0('0x70')](),_0x1f0544)[_0x17c0('0x27')](function(_0x25fa41){_0x62e551=_[_0x17c0('0x71')](_0x25fa41,'id');return db[_0x17c0('0x6f')][_0x17c0('0x30')](_0x64933b[_0x17c0('0x70')](),_0x1f0544);})[_0x17c0('0x27')](function(_0x736e1){_0x4f56ec['count']=_0x736e1[_0x17c0('0x36')];_0x1f0544=_[_0x17c0('0x72')](_0x1f0544,{'model':db[_0x17c0('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x26177a[_0x17c0('0x3c')](_0x17c0('0x73'));_0x26177a[_0x17c0('0x3c')](_0x17c0('0x74'),'TagIds');_0x26177a[_0x17c0('0x6d')](_0x17c0('0x6c'),'ct',_0x17c0('0x75'));_0x26177a[_0x17c0('0x6d')]('tools_tags','t',_0x17c0('0x76'));if(_0x4bc4a6[_0x17c0('0x21')]){_0x26177a['limit'](_0x4bc4a6[_0x17c0('0x21')]);}if(_0x4bc4a6[_0x17c0('0x20')]){_0x26177a[_0x17c0('0x20')](_0x4bc4a6[_0x17c0('0x20')]);}db[_0x17c0('0x6f')][_0x17c0('0x30')](_0x26177a[_0x17c0('0x70')](),_0x1f0544)[_0x17c0('0x27')](function(_0xa5a714){_0xa5a714[_0x17c0('0x44')](function(_0x278a5d){if(_0x278a5d[_0x17c0('0x77')]){_0x278a5d['Tags']=[];_0x278a5d[_0x17c0('0x77')][_0x17c0('0x78')](',')[_0x17c0('0x44')](function(_0x5195c2){_0x278a5d[_0x17c0('0x79')]['push'](_0x62e551[_0x5195c2]);});}delete _0x278a5d[_0x17c0('0x77')];});_0x4f56ec[_0x17c0('0x7a')]=_0xa5a714;return _0x4f56ec;})[_0x17c0('0x27')](respondWithFilteredResult(_0x297b07,_0x4bc4a6))[_0x17c0('0x7b')](handleError(_0x297b07,null));});});};exports[_0x17c0('0x28')]=function(_0xfc0cf0,_0x4cad37){return db[_0x17c0('0x2e')][_0x17c0('0x7c')]({'where':{'id':_0xfc0cf0['params']['id']}})['then'](handleEntityNotFound(_0x4cad37,null))[_0x17c0('0x27')](removeEntity(_0x4cad37,null))['catch'](handleError(_0x4cad37,null));};exports[_0x17c0('0x7d')]=function(_0x3e9cb8,_0x17ddd0){return db[_0x17c0('0x2e')]['describe']()[_0x17c0('0x27')](function(_0x31642d){for(var _0x382f2c=0x0;_0x382f2c\x20?','\x20<\x20?','map','hasOwnProperty','isNil','ListId','c.ListId\x20IN\x20?','concat','filter','replace','isNumeric','c.id\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','order','DESC','group','c.id','Sequelize','QueryTypes','SELECT','COUNT(*)','tag','expr','having','cm_contact_has_tags','left_join','tools_tags','t.id\x20IN\x20?','sequelize','toString','keyBy','count','merge','c.*','TagIds','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','forEach','split','Tags','rows','find','params','startsWith','cf_','columnName','CmCustomField','findAll','displayName','alias','custom','type','values','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','OpenchannelQueueReport','JscriptySessionReport','catch','bulkCreate','duplicates','push','findOrCreate','spread','show','Tag','$and','omit','format','pickBy','cf_%d','isEmpty','table','id\x20=\x20?','toParam','phone','findOne','intersection','options','getTags','setTags','getHoppers','rawAttributes','ContactId','includeAll','getHopperHistories','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','server/files/tmp','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','meta','import','User','agent','binding','No\x20firstName\x20column\x20specified','child_process','../../components/import/cm/csv2','stringify','message','exit','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2181,0x1b4));var _0x1218=function(_0x3e5d52,_0x3b159f){_0x3e5d52=_0x3e5d52-0x0;var _0x538d3c=_0x2181[_0x3e5d52];return _0x538d3c;};'use strict';var pdf=require(_0x1218('0x0'));var emlformat=require(_0x1218('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1218('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1218('0x3'));var moment=require(_0x1218('0x4'));var BPromise=require(_0x1218('0x5'));var Mustache=require(_0x1218('0x6'));var util=require('util');var path=require(_0x1218('0x7'));var sox=require('sox');var csv=require(_0x1218('0x8'));var ejs=require(_0x1218('0x9'));var fs=require('fs');var _=require(_0x1218('0xa'));var squel=require(_0x1218('0xb'));var crypto=require(_0x1218('0xc'));var jsforce=require(_0x1218('0xd'));var deskjs=require(_0x1218('0xe'));var toCsv=require(_0x1218('0x8'));var querystring=require('querystring');var Papa=require(_0x1218('0xf'));var Redis=require(_0x1218('0x10'));var authService=require(_0x1218('0x11'));var qs=require(_0x1218('0x12'));var hardwareService=require(_0x1218('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1218('0x14'))['db'];config[_0x1218('0x15')]=_[_0x1218('0x16')](config['redis'],{'host':_0x1218('0x17'),'port':0x18eb});var socket=require(_0x1218('0x18'))(new Redis(config[_0x1218('0x15')]));require(_0x1218('0x19'))[_0x1218('0x1a')](socket);function respondWithStatusCode(_0x55c7a0,_0x38cea0){_0x38cea0=_0x38cea0||0xcc;return function(_0x2a435b){if(_0x2a435b){return _0x55c7a0['sendStatus'](_0x38cea0);}return _0x55c7a0['status'](_0x38cea0)[_0x1218('0x1b')]();};}function respondWithResult(_0x3fd6d3,_0x50ae6d){_0x50ae6d=_0x50ae6d||0xc8;return function(_0x5c2407){if(_0x5c2407){return _0x3fd6d3[_0x1218('0x1c')](_0x50ae6d)['json'](_0x5c2407);}};}function respondWithFilteredResult(_0x3bcd8f,_0x4bea94){return function(_0x1e950d){if(_0x1e950d){var _0x3ea28c=_0x1e950d['count'],_0x38f6c8=_0x4bea94[_0x1218('0x1d')],_0x73240d=_0x4bea94[_0x1218('0x1d')]+_0x4bea94['limit'],_0x2cd308;if(_0x73240d>=_0x3ea28c){_0x73240d=_0x3ea28c;_0x2cd308=0xc8;}else{_0x2cd308=0xce;}_0x3bcd8f[_0x1218('0x1c')](_0x2cd308);return _0x3bcd8f[_0x1218('0x1e')](_0x1218('0x1f'),_0x38f6c8+'-'+_0x73240d+'/'+_0x3ea28c)[_0x1218('0x20')](_0x1e950d);}return null;};}function patchUpdates(_0x5c84ea){return function(_0x51f7ea){try{jsonpatch[_0x1218('0x21')](_0x51f7ea,_0x5c84ea,!![]);}catch(_0x3e2c6c){return BPromise['reject'](_0x3e2c6c);}return _0x51f7ea[_0x1218('0x22')]();};}function saveUpdates(_0x3cba82,_0x48c250){return function(_0x50d5ea){if(_0x50d5ea){return _0x50d5ea[_0x1218('0x23')](_0x3cba82)[_0x1218('0x24')](function(_0x5e5c14){return _0x5e5c14;});}return null;};}function removeEntity(_0x52fecf,_0x55b2ea){return function(_0x5c9dc5){if(_0x5c9dc5){return _0x5c9dc5[_0x1218('0x25')]()[_0x1218('0x24')](function(){_0x52fecf[_0x1218('0x1c')](0xcc)[_0x1218('0x1b')]();});}};}function handleEntityNotFound(_0x445264,_0x16d0a6){return function(_0x5e14a0){if(!_0x5e14a0){_0x445264[_0x1218('0x26')](0x194);}return _0x5e14a0;};}function handleError(_0x247c9b,_0xf833f2){_0xf833f2=_0xf833f2||0x1f4;return function(_0x1fa47b){logger[_0x1218('0x27')](_0x1fa47b[_0x1218('0x28')]);if(_0x1fa47b[_0x1218('0x29')]){delete _0x1fa47b['name'];}_0x247c9b[_0x1218('0x1c')](_0xf833f2)[_0x1218('0x2a')](_0x1fa47b);};}exports[_0x1218('0x2b')]=function(_0x206cc4,_0xc4ccdf){var _0x4b41a0={},_0x4cb6c6={},_0x538f1e={'count':0x0,'rows':[]};return db[_0x1218('0x2c')][_0x1218('0x2d')]()[_0x1218('0x24')](function(_0x30ebf7){_0x4cb6c6[_0x1218('0x2e')]=_[_0x1218('0x2f')](_0x30ebf7);_0x4cb6c6['query']=_['keys'](_0x206cc4['query']);_0x4cb6c6['filters']=_['intersection'](_0x4cb6c6['model'],_0x4cb6c6['query']);_0x4b41a0[_0x1218('0x30')]=_['intersection'](_0x4cb6c6['model'],qs[_0x1218('0x31')](_0x206cc4[_0x1218('0x32')][_0x1218('0x31')]));_0x4b41a0[_0x1218('0x30')]=_0x4b41a0[_0x1218('0x30')][_0x1218('0x33')]?_0x4b41a0[_0x1218('0x30')]:_0x4cb6c6[_0x1218('0x2e')];if(!_0x206cc4[_0x1218('0x32')]['hasOwnProperty'](_0x1218('0x34'))){_0x4b41a0[_0x1218('0x35')]=qs[_0x1218('0x35')](_0x206cc4[_0x1218('0x32')][_0x1218('0x35')]);_0x4b41a0['offset']=qs[_0x1218('0x1d')](_0x206cc4['query']['offset']);}_0x4b41a0['order']=qs[_0x1218('0x36')](_0x206cc4[_0x1218('0x32')][_0x1218('0x36')]);_0x4b41a0[_0x1218('0x37')]=qs['filters'](_[_0x1218('0x38')](_0x206cc4[_0x1218('0x32')],_0x4cb6c6[_0x1218('0x39')]));var _0x21fc3c=[];var _0x430c54=squel[_0x1218('0x3a')]()[_0x1218('0x3b')]('id')[_0x1218('0x3b')]('name')[_0x1218('0x3b')](_0x1218('0x3c'))[_0x1218('0x3d')]('tools_tags');var _0x67900b=squel[_0x1218('0x3a')]()[_0x1218('0x3d')](_0x1218('0x3e'),'c')['where'](_0x1218('0x3f'));var _0x419f49=squel['expr']();if(_0x206cc4['query'][_0x1218('0x40')]){var _0x242cd5=JSON[_0x1218('0x41')](_0x206cc4['query'][_0x1218('0x40')]);_[_0x1218('0x2f')](_0x242cd5)['forEach'](function(_0x5d85c1){var _0x6a728c=_0x242cd5[_0x5d85c1];switch(_0x6a728c[_0x1218('0x42')]){case'IS':if(_[_0x1218('0x43')](_0x6a728c[_0x1218('0x44')])&&_0x6a728c[_0x1218('0x44')][_0x1218('0x33')]>0x1){_0x419f49['and'](_0x6a728c[_0x1218('0x45')]+'.'+_0x5d85c1+_0x1218('0x46'),_0x6a728c[_0x1218('0x44')]);}else{_0x419f49[_0x1218('0x47')](_0x6a728c[_0x1218('0x45')]+'.'+_0x5d85c1+'\x20=\x20?',_0x6a728c[_0x1218('0x44')][0x0]);}break;case'=':_0x419f49['and'](_0x6a728c[_0x1218('0x45')]+'.'+_0x5d85c1+_0x1218('0x48'),_0x6a728c[_0x1218('0x44')]);break;case _0x1218('0x49'):_0x419f49[_0x1218('0x47')](_0x6a728c[_0x1218('0x45')]+'.'+_0x5d85c1+_0x1218('0x4a'),'%'+_0x6a728c[_0x1218('0x44')]+'%');break;case'>':_0x419f49[_0x1218('0x47')](_0x6a728c[_0x1218('0x45')]+'.'+_0x5d85c1+_0x1218('0x4b'),_0x6a728c['value']);break;case'<':_0x419f49[_0x1218('0x47')](_0x6a728c[_0x1218('0x45')]+'.'+_0x5d85c1+_0x1218('0x4c'),_0x6a728c[_0x1218('0x44')]);break;}});}else{var _0x32c431=_(Object[_0x1218('0x2f')](_0x206cc4[_0x1218('0x32')]))[_0x1218('0x4d')](function(_0x453e85){return _0x30ebf7[_0x1218('0x4e')](_0x453e85)?_0x453e85:undefined;})['filter'](function(_0xfd6dce){return!_[_0x1218('0x4f')](_0xfd6dce);})[_0x1218('0x44')]();if(!_['isEmpty'](_0x32c431)){_0x32c431['forEach'](function(_0xfd059){if(_0xfd059===_0x1218('0x50')){_0x67900b[_0x1218('0x37')](_0x1218('0x51'),[][_0x1218('0x52')](_0x206cc4[_0x1218('0x32')][_0xfd059]));}else{_0x67900b[_0x1218('0x37')]('c.'+_0xfd059+'\x20=\x20?',_0x206cc4[_0x1218('0x32')][_0xfd059]);}});}if(_0x206cc4['query']['filter']){var _0x3f04b6=_0x206cc4[_0x1218('0x32')][_0x1218('0x53')][_0x1218('0x54')]('\x5c','\x5c\x5c')[_0x1218('0x54')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x1218('0x55')](_0x3f04b6)){_0x419f49['or'](_0x1218('0x56'),_0x3f04b6+'%');_0x419f49['or']('c.phone\x20LIKE\x20?',_0x3f04b6+'%');_0x419f49['or']('c.mobile\x20LIKE\x20?',_0x3f04b6+'%');_0x419f49['or'](_0x1218('0x57'),_0x3f04b6+'%');}else if(qs[_0x1218('0x58')](_0x3f04b6)){_0x419f49['or']('c.email\x20LIKE\x20?',_0x3f04b6+'%');}else{_0x419f49['or'](_0x1218('0x59'),_0x3f04b6+'%');_0x419f49['or'](_0x1218('0x5a'),_0x3f04b6+'%');_0x419f49['or']('c.lastName\x20LIKE\x20?',_0x3f04b6+'%');}}}_0x67900b[_0x1218('0x37')](_0x419f49);if(_0x4b41a0['order']){_0x4b41a0[_0x1218('0x5b')]['forEach'](function(_0x47b316){_0x67900b[_0x1218('0x5b')]('c.'+_0x47b316[0x0],_0x47b316[0x1]===_0x1218('0x5c')?![]:!![]);});}_0x67900b[_0x1218('0x5d')](_0x1218('0x5e'));var _0x5d352a={'type':db[_0x1218('0x5f')][_0x1218('0x60')][_0x1218('0x61')],'raw':!![]};var _0x434ffb=_0x67900b['clone']()[_0x1218('0x3b')](_0x1218('0x62'));if(!_0x206cc4[_0x1218('0x32')][_0x1218('0x40')]){if(_0x206cc4[_0x1218('0x32')][_0x1218('0x63')]){var _0xe0adbd=_[_0x1218('0x43')](_0x206cc4['query'][_0x1218('0x63')])?_0x206cc4[_0x1218('0x32')]['tag']:new Array(_0x206cc4[_0x1218('0x32')][_0x1218('0x63')]);var _0x101f3f=squel[_0x1218('0x64')]();_0xe0adbd['forEach'](function(_0x1366ca){_0x101f3f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1366ca+',%');});_0x67900b[_0x1218('0x65')](_0x101f3f);_0x434ffb['left_join'](_0x1218('0x66'),'ct','ct.CmContactId\x20=\x20c.id');_0x434ffb[_0x1218('0x67')](_0x1218('0x68'),'t','t.id\x20=\x20ct.TagId');_0x434ffb[_0x1218('0x37')](_0x1218('0x69'),_0xe0adbd);}}db[_0x1218('0x6a')][_0x1218('0x32')](_0x430c54[_0x1218('0x6b')](),_0x5d352a)[_0x1218('0x24')](function(_0x20f33a){_0x21fc3c=_[_0x1218('0x6c')](_0x20f33a,'id');return db[_0x1218('0x6a')][_0x1218('0x32')](_0x434ffb[_0x1218('0x6b')](),_0x5d352a);})['then'](function(_0x41d2bd){_0x538f1e[_0x1218('0x6d')]=_0x41d2bd[_0x1218('0x33')];_0x5d352a=_[_0x1218('0x6e')](_0x5d352a,{'model':db[_0x1218('0x2c')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x67900b['field'](_0x1218('0x6f'));_0x67900b[_0x1218('0x3b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1218('0x70'));_0x67900b[_0x1218('0x67')](_0x1218('0x66'),'ct',_0x1218('0x71'));_0x67900b[_0x1218('0x67')](_0x1218('0x68'),'t',_0x1218('0x72'));if(_0x4b41a0['limit']){_0x67900b['limit'](_0x4b41a0[_0x1218('0x35')]);}if(_0x4b41a0[_0x1218('0x1d')]){_0x67900b[_0x1218('0x1d')](_0x4b41a0[_0x1218('0x1d')]);}db['sequelize'][_0x1218('0x32')](_0x67900b['toString'](),_0x5d352a)['then'](function(_0x4cbc9c){_0x4cbc9c[_0x1218('0x73')](function(_0x2f2e72){if(_0x2f2e72[_0x1218('0x70')]){_0x2f2e72['Tags']=[];_0x2f2e72[_0x1218('0x70')][_0x1218('0x74')](',')[_0x1218('0x73')](function(_0x5016d9){_0x2f2e72[_0x1218('0x75')]['push'](_0x21fc3c[_0x5016d9]);});}delete _0x2f2e72['TagIds'];});_0x538f1e[_0x1218('0x76')]=_0x4cbc9c;return _0x538f1e;})[_0x1218('0x24')](respondWithFilteredResult(_0xc4ccdf,_0x4b41a0))['catch'](handleError(_0xc4ccdf,null));});});};exports[_0x1218('0x25')]=function(_0x1d989d,_0x32515e){return db[_0x1218('0x2c')][_0x1218('0x77')]({'where':{'id':_0x1d989d[_0x1218('0x78')]['id']}})['then'](handleEntityNotFound(_0x32515e,null))[_0x1218('0x24')](removeEntity(_0x32515e,null))['catch'](handleError(_0x32515e,null));};exports[_0x1218('0x2d')]=function(_0x44de9f,_0x198075){return db[_0x1218('0x2c')]['describe']()[_0x1218('0x24')](function(_0x33b54f){for(var _0x203c37=0x0;_0x203c37{}\s\\|]/g,'-');_0xaec856(null,util[_0xf36a('0x1e')](_0xf36a('0x1f'),path[_0xf36a('0x20')](_0x31fd07[_0xf36a('0x1d')],path[_0xf36a('0x21')](_0x31fd07['originalname'])),Date[_0xf36a('0x22')](),path[_0xf36a('0x21')](_0x31fd07['originalname'])));}})});router[_0xf36a('0x14')](_0xf36a('0x23'),upload[_0xf36a('0x24')](_0xf36a('0x25')),controller[_0xf36a('0x26')]);var upload=multer({'storage':multer[_0xf36a('0x19')]({'destination':function(_0x1f5207,_0x997d60,_0x305214){_0x305214(null,path[_0xf36a('0x1a')](config[_0xf36a('0x1b')],_0xf36a('0x1c')));},'filename':function(_0x1813d9,_0x351a6c,_0xed5e89){_0x351a6c[_0xf36a('0x1d')]=_0x351a6c[_0xf36a('0x1d')][_0xf36a('0x27')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xed5e89(null,util['format'](_0xf36a('0x1f'),path[_0xf36a('0x20')](_0x351a6c[_0xf36a('0x1d')],path['extname'](_0x351a6c[_0xf36a('0x1d')])),Date[_0xf36a('0x22')](),path[_0xf36a('0x21')](_0x351a6c[_0xf36a('0x1d')])));}})});router[_0xf36a('0x14')]('/upload',upload['single'](_0xf36a('0x25')),controller[_0xf36a('0x28')]);router[_0xf36a('0x14')](_0xf36a('0x29'),auth['isAuthenticated'](),controller[_0xf36a('0x2a')]);router[_0xf36a('0x2b')](_0xf36a('0x2c'),auth[_0xf36a('0x5')](),controller[_0xf36a('0x2d')]);router['delete'](_0xf36a('0x2c'),auth[_0xf36a('0x5')](),controller['destroy']);module[_0xf36a('0x2e')]=router;
\ No newline at end of file
+var _0xba84=['getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','/create_many','bulkCreate','setTags','diskStorage','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','/csv','single','file','uploadCsv','now','/upload','/upload/:id','import','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','describe','show','/:id/tags','getTags','getHoppers','/:id/hopper_histories'];(function(_0x23e9d4,_0x1063fd){var _0x4ab2b0=function(_0x3ff3e3){while(--_0x3ff3e3){_0x23e9d4['push'](_0x23e9d4['shift']());}};_0x4ab2b0(++_0x1063fd);}(_0xba84,0x1d8));var _0x4ba8=function(_0x395e65,_0x575e81){_0x395e65=_0x395e65-0x0;var _0x219730=_0xba84[_0x395e65];return _0x219730;};'use strict';var multer=require(_0x4ba8('0x0'));var util=require(_0x4ba8('0x1'));var path=require(_0x4ba8('0x2'));var timeout=require(_0x4ba8('0x3'));var express=require('express');var router=express[_0x4ba8('0x4')]();var auth=require(_0x4ba8('0x5'));var interaction=require(_0x4ba8('0x6'));var config=require(_0x4ba8('0x7'));var controller=require(_0x4ba8('0x8'));router[_0x4ba8('0x9')]('/',auth[_0x4ba8('0xa')](),controller['index']);router[_0x4ba8('0x9')](_0x4ba8('0xb'),auth[_0x4ba8('0xa')](),controller[_0x4ba8('0xc')]);router[_0x4ba8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4ba8('0xd')]);router[_0x4ba8('0x9')](_0x4ba8('0xe'),auth[_0x4ba8('0xa')](),controller[_0x4ba8('0xf')]);router[_0x4ba8('0x9')]('/:id/hoppers',auth[_0x4ba8('0xa')](),controller[_0x4ba8('0x10')]);router[_0x4ba8('0x9')](_0x4ba8('0x11'),auth['isAuthenticated'](),controller[_0x4ba8('0x12')]);router[_0x4ba8('0x9')](_0x4ba8('0x13'),auth[_0x4ba8('0xa')](),controller['getHopperFinals']);router[_0x4ba8('0x9')](_0x4ba8('0x14'),auth[_0x4ba8('0xa')](),controller[_0x4ba8('0x15')]);router[_0x4ba8('0x16')](_0x4ba8('0x17'),auth[_0x4ba8('0xa')](),controller[_0x4ba8('0x18')]);router['post']('/',auth[_0x4ba8('0xa')](),controller['create']);router['post'](_0x4ba8('0x19'),auth[_0x4ba8('0xa')](),controller[_0x4ba8('0x1a')]);router['post'](_0x4ba8('0xe'),auth[_0x4ba8('0xa')](),controller[_0x4ba8('0x1b')]);var upload=multer({'storage':multer[_0x4ba8('0x1c')]({'destination':function(_0x403f8f,_0x24aaed,_0x1707e2){_0x1707e2(null,path['join'](config[_0x4ba8('0x1d')],_0x4ba8('0x1e')));},'filename':function(_0x162818,_0x164edb,_0x2e5f1d){_0x164edb[_0x4ba8('0x1f')]=_0x164edb[_0x4ba8('0x1f')][_0x4ba8('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2e5f1d(null,util[_0x4ba8('0x21')](_0x4ba8('0x22'),path[_0x4ba8('0x23')](_0x164edb[_0x4ba8('0x1f')],path[_0x4ba8('0x24')](_0x164edb[_0x4ba8('0x1f')])),Date['now'](),path['extname'](_0x164edb['originalname'])));}})});router[_0x4ba8('0x16')](_0x4ba8('0x25'),upload[_0x4ba8('0x26')](_0x4ba8('0x27')),controller[_0x4ba8('0x28')]);var upload=multer({'storage':multer[_0x4ba8('0x1c')]({'destination':function(_0x1aaeea,_0x448dbd,_0x1c2edf){_0x1c2edf(null,path['join'](config[_0x4ba8('0x1d')],_0x4ba8('0x1e')));},'filename':function(_0x2f88e7,_0x5144ac,_0x50c721){_0x5144ac[_0x4ba8('0x1f')]=_0x5144ac[_0x4ba8('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x50c721(null,util[_0x4ba8('0x21')](_0x4ba8('0x22'),path[_0x4ba8('0x23')](_0x5144ac[_0x4ba8('0x1f')],path[_0x4ba8('0x24')](_0x5144ac['originalname'])),Date[_0x4ba8('0x29')](),path[_0x4ba8('0x24')](_0x5144ac[_0x4ba8('0x1f')])));}})});router[_0x4ba8('0x16')](_0x4ba8('0x2a'),upload[_0x4ba8('0x26')](_0x4ba8('0x27')),controller['upload']);router['post'](_0x4ba8('0x2b'),auth[_0x4ba8('0xa')](),controller[_0x4ba8('0x2c')]);router['put'](_0x4ba8('0x2d'),auth[_0x4ba8('0xa')](),controller[_0x4ba8('0x2e')]);router[_0x4ba8('0x2f')]('/:id',auth[_0x4ba8('0xa')](),controller['destroy']);module[_0x4ba8('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js
index 4f084d0..c8a3e8a 100644
--- a/server/api/cmCustomField/cmCustomField.attributes.js
+++ b/server/api/cmCustomField/cmCustomField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe4a5=['TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','sequelize','lodash','VIRTUAL','alias','STRING','setDataValue','getDataValue','name'];(function(_0x1df5cc,_0x95c5e2){var _0x41caee=function(_0x24ec9f){while(--_0x24ec9f){_0x1df5cc['push'](_0x1df5cc['shift']());}};_0x41caee(++_0x95c5e2);}(_0xe4a5,0xa2));var _0x5e4a=function(_0x27567e,_0x2f60b0){_0x27567e=_0x27567e-0x0;var _0xb71bfe=_0xe4a5[_0x27567e];return _0xb71bfe;};'use strict';var Sequelize=require(_0x5e4a('0x0'));var _=require(_0x5e4a('0x1'));module['exports']={'name':{'type':Sequelize[_0x5e4a('0x2')],'get':function(_0x48717c){return this['getDataValue'](_0x5e4a('0x3'));}},'alias':{'type':Sequelize[_0x5e4a('0x4')],'allowNull':![],'set':function(_0x5349db){this[_0x5e4a('0x5')](_0x5e4a('0x3'),_0x5349db?_0x5349db:this[_0x5e4a('0x6')](_0x5e4a('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x5e4a('0x8')](_0x5e4a('0x9')),'get':function(){if(this[_0x5e4a('0x6')](_0x5e4a('0xa'))===_0x5e4a('0xb')){return JSON[_0x5e4a('0xc')](this[_0x5e4a('0x6')](_0x5e4a('0xd')));}else{return this['getDataValue'](_0x5e4a('0xd'));}},'set':function(_0x585ed0){if(Array[_0x5e4a('0xe')](_0x585ed0)){this[_0x5e4a('0x5')](_0x5e4a('0xd'),JSON[_0x5e4a('0xf')](_0x585ed0));}else{this[_0x5e4a('0x5')](_0x5e4a('0xd'),_0x585ed0);}}},'required':{'type':Sequelize[_0x5e4a('0x10')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf93c=['sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','type','parse','values','isArray','stringify','BOOLEAN'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xf93c,0x1b0));var _0xcf93=function(_0x4d9ee3,_0x50b873){_0x4d9ee3=_0x4d9ee3-0x0;var _0x28cd97=_0xf93c[_0x4d9ee3];return _0x28cd97;};'use strict';var Sequelize=require(_0xcf93('0x0'));var _=require(_0xcf93('0x1'));module[_0xcf93('0x2')]={'name':{'type':Sequelize[_0xcf93('0x3')],'get':function(_0x3afbea){return this[_0xcf93('0x4')]('alias');}},'alias':{'type':Sequelize[_0xcf93('0x5')],'allowNull':![],'set':function(_0x5afd72){this[_0xcf93('0x6')](_0xcf93('0x7'),_0x5afd72?_0x5afd72:this[_0xcf93('0x4')](_0xcf93('0x8')));}},'type':{'type':Sequelize[_0xcf93('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xcf93('0x9')]('long'),'get':function(){if(this['getDataValue'](_0xcf93('0xa'))==='select'){return JSON[_0xcf93('0xb')](this[_0xcf93('0x4')](_0xcf93('0xc')));}else{return this[_0xcf93('0x4')](_0xcf93('0xc'));}},'set':function(_0x1f10d1){if(Array[_0xcf93('0xd')](_0x1f10d1)){this['setDataValue'](_0xcf93('0xc'),JSON[_0xcf93('0xe')](_0x1f10d1));}else{this[_0xcf93('0x6')](_0xcf93('0xc'),_0x1f10d1);}}},'required':{'type':Sequelize[_0xcf93('0xf')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js
index e1a12aa..91305c2 100644
--- a/server/api/cmCustomField/cmCustomField.controller.js
+++ b/server/api/cmCustomField/cmCustomField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x01d4=['error','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','field','options','includeAll','include','CmCustomField','findAll','rows','catch','find','create','sequelize','transaction','body','update','params','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then'];(function(_0x1e84e3,_0x281bc1){var _0x487b5a=function(_0x512ae5){while(--_0x512ae5){_0x1e84e3['push'](_0x1e84e3['shift']());}};_0x487b5a(++_0x281bc1);}(_0x01d4,0x6e));var _0x401d=function(_0x39b44b,_0x1a3bb2){_0x39b44b=_0x39b44b-0x0;var _0xf21df2=_0x01d4[_0x39b44b];return _0xf21df2;};'use strict';var pdf=require(_0x401d('0x0'));var emlformat=require(_0x401d('0x1'));var rimraf=require(_0x401d('0x2'));var zipdir=require(_0x401d('0x3'));var jsonpatch=require(_0x401d('0x4'));var rp=require(_0x401d('0x5'));var moment=require(_0x401d('0x6'));var BPromise=require(_0x401d('0x7'));var Mustache=require(_0x401d('0x8'));var util=require(_0x401d('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x401d('0xa'));var ejs=require(_0x401d('0xb'));var fs=require('fs');var _=require(_0x401d('0xc'));var squel=require(_0x401d('0xd'));var crypto=require('crypto');var jsforce=require(_0x401d('0xe'));var deskjs=require(_0x401d('0xf'));var toCsv=require(_0x401d('0xa'));var querystring=require(_0x401d('0x10'));var Papa=require(_0x401d('0x11'));var Redis=require(_0x401d('0x12'));var authService=require(_0x401d('0x13'));var qs=require(_0x401d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x401d('0x15'));var utils=require(_0x401d('0x16'));var config=require(_0x401d('0x17'));var db=require(_0x401d('0x18'))['db'];function respondWithStatusCode(_0x2714ae,_0x33d4f1){_0x33d4f1=_0x33d4f1||0xcc;return function(_0x5c1341){if(_0x5c1341){return _0x2714ae[_0x401d('0x19')](_0x33d4f1);}return _0x2714ae['status'](_0x33d4f1)[_0x401d('0x1a')]();};}function respondWithResult(_0x1d315e,_0x5c6fc3){_0x5c6fc3=_0x5c6fc3||0xc8;return function(_0x535939){if(_0x535939){return _0x1d315e['status'](_0x5c6fc3)[_0x401d('0x1b')](_0x535939);}};}function respondWithFilteredResult(_0x2c730d,_0x5a99c0){return function(_0x464d27){if(_0x464d27){var _0x1a318d=_0x464d27[_0x401d('0x1c')],_0x150600=_0x5a99c0[_0x401d('0x1d')],_0x438ca9=_0x5a99c0[_0x401d('0x1d')]+_0x5a99c0[_0x401d('0x1e')],_0x1cc647;if(_0x438ca9>=_0x1a318d){_0x438ca9=_0x1a318d;_0x1cc647=0xc8;}else{_0x1cc647=0xce;}_0x2c730d[_0x401d('0x1f')](_0x1cc647);return _0x2c730d[_0x401d('0x20')](_0x401d('0x21'),_0x150600+'-'+_0x438ca9+'/'+_0x1a318d)[_0x401d('0x1b')](_0x464d27);}return null;};}function patchUpdates(_0x48c0cd){return function(_0x1d42be){try{jsonpatch[_0x401d('0x22')](_0x1d42be,_0x48c0cd,!![]);}catch(_0x5b6879){return BPromise[_0x401d('0x23')](_0x5b6879);}return _0x1d42be[_0x401d('0x24')]();};}function saveUpdates(_0x262c55,_0x11d890){return function(_0xecb589){if(_0xecb589){return _0xecb589['update'](_0x262c55)[_0x401d('0x25')](function(_0x2ac33d){return _0x2ac33d;});}return null;};}function removeEntity(_0x4b002a,_0x3941d3){return function(_0x6250e4){if(_0x6250e4){return _0x6250e4['destroy']()[_0x401d('0x25')](function(){_0x4b002a[_0x401d('0x1f')](0xcc)[_0x401d('0x1a')]();});}};}function handleEntityNotFound(_0x52cc38,_0x20bc0b){return function(_0x476de8){if(!_0x476de8){_0x52cc38[_0x401d('0x19')](0x194);}return _0x476de8;};}function handleError(_0x3bb783,_0x24a08c){_0x24a08c=_0x24a08c||0x1f4;return function(_0x3dd2d1){logger[_0x401d('0x26')](_0x3dd2d1['stack']);if(_0x3dd2d1[_0x401d('0x27')]){delete _0x3dd2d1[_0x401d('0x27')];}_0x3bb783['status'](_0x24a08c)[_0x401d('0x28')](_0x3dd2d1);};}exports[_0x401d('0x29')]=function(_0x55757c,_0x54a5ad){var _0x4b8ea4={},_0x5dc152={},_0x98110f={'count':0x0,'rows':[]};var _0x164f35=db['CmCustomField'][_0x401d('0x2a')];_0x5dc152[_0x401d('0x2b')]=_['differenceBy'](_['keys'](_0x164f35),[_0x401d('0x27')]);_0x5dc152['query']=_[_0x401d('0x2c')](_0x55757c[_0x401d('0x2d')]);_0x5dc152[_0x401d('0x2e')]=_[_0x401d('0x2f')](_0x5dc152['model'],_0x5dc152[_0x401d('0x2d')]);_0x4b8ea4[_0x401d('0x30')]=_['intersection'](_0x5dc152[_0x401d('0x2b')],qs['fields'](_0x55757c[_0x401d('0x2d')][_0x401d('0x31')]));_0x4b8ea4[_0x401d('0x30')]=_0x4b8ea4[_0x401d('0x30')]['length']?_0x4b8ea4[_0x401d('0x30')]:_0x5dc152[_0x401d('0x2b')];if(!_0x55757c['query'][_0x401d('0x32')](_0x401d('0x33'))){_0x4b8ea4[_0x401d('0x1e')]=qs[_0x401d('0x1e')](_0x55757c['query'][_0x401d('0x1e')]);_0x4b8ea4[_0x401d('0x1d')]=qs['offset'](_0x55757c[_0x401d('0x2d')][_0x401d('0x1d')]);}_0x4b8ea4['order']=qs[_0x401d('0x34')](_0x55757c['query'][_0x401d('0x34')]);_0x4b8ea4[_0x401d('0x35')]=qs['filters'](_['pick'](_0x55757c['query'],_0x5dc152[_0x401d('0x2e')]));if(_0x55757c['query'][_0x401d('0x36')]){_0x4b8ea4[_0x401d('0x35')]=_[_0x401d('0x37')](_0x4b8ea4['where'],{'$or':_[_0x401d('0x38')](_0x164f35,function(_0x4b1cc1){if(_0x4b1cc1[_0x401d('0x39')]['key']!=='VIRTUAL'){var _0x2c38d9={};_0x2c38d9[_0x4b1cc1[_0x401d('0x3a')]]={'$like':'%'+_0x55757c[_0x401d('0x2d')][_0x401d('0x36')]+'%'};return _0x2c38d9;}})});}_0x4b8ea4=_[_0x401d('0x37')]({},_0x4b8ea4,_0x55757c[_0x401d('0x3b')]);var _0x4bd651={'where':_0x4b8ea4['where']};return db['CmCustomField'][_0x401d('0x1c')](_0x4bd651)['then'](function(_0x4385a9){_0x98110f[_0x401d('0x1c')]=_0x4385a9;if(_0x55757c[_0x401d('0x2d')][_0x401d('0x3c')]){_0x4b8ea4[_0x401d('0x3d')]=[{'all':!![]}];}return db[_0x401d('0x3e')][_0x401d('0x3f')](_0x4b8ea4);})[_0x401d('0x25')](function(_0x18f7d0){_0x98110f[_0x401d('0x40')]=_0x18f7d0;return _0x98110f;})[_0x401d('0x25')](respondWithFilteredResult(_0x54a5ad,_0x4b8ea4))[_0x401d('0x41')](handleError(_0x54a5ad,null));};exports['show']=function(_0x184eef,_0x429184){var _0x5d78c5={'raw':!![],'where':{'id':_0x184eef['params']['id']}},_0x55edfd={};_0x55edfd[_0x401d('0x2b')]=_['keys'](db['CmCustomField']['rawAttributes']);_0x55edfd[_0x401d('0x2d')]=_[_0x401d('0x2c')](_0x184eef[_0x401d('0x2d')]);_0x55edfd[_0x401d('0x2e')]=_[_0x401d('0x2f')](_0x55edfd['model'],_0x55edfd[_0x401d('0x2d')]);_0x5d78c5[_0x401d('0x30')]=_[_0x401d('0x2f')](_0x55edfd[_0x401d('0x2b')],qs[_0x401d('0x31')](_0x184eef[_0x401d('0x2d')][_0x401d('0x31')]));_0x5d78c5['attributes']=_0x5d78c5[_0x401d('0x30')]['length']?_0x5d78c5[_0x401d('0x30')]:_0x55edfd[_0x401d('0x2b')];if(_0x184eef[_0x401d('0x2d')][_0x401d('0x3c')]){_0x5d78c5[_0x401d('0x3d')]=[{'all':!![]}];}_0x5d78c5=_[_0x401d('0x37')]({},_0x5d78c5,_0x184eef[_0x401d('0x3b')]);return db[_0x401d('0x3e')][_0x401d('0x42')](_0x5d78c5)[_0x401d('0x25')](handleEntityNotFound(_0x429184,null))['then'](respondWithResult(_0x429184,null))[_0x401d('0x41')](handleError(_0x429184,null));};exports[_0x401d('0x43')]=function(_0x444b74,_0x2ee5f1){return db[_0x401d('0x44')][_0x401d('0x45')](function(_0x312f9a){return db[_0x401d('0x3e')]['create'](_0x444b74[_0x401d('0x46')],{'transaction':_0x312f9a});})[_0x401d('0x25')](respondWithResult(_0x2ee5f1,0xc9))[_0x401d('0x41')](handleError(_0x2ee5f1,null));};exports[_0x401d('0x47')]=function(_0x2b55c1,_0x145092){if(_0x2b55c1[_0x401d('0x46')]['id']){delete _0x2b55c1[_0x401d('0x46')]['id'];}return db[_0x401d('0x3e')][_0x401d('0x42')]({'where':{'id':_0x2b55c1[_0x401d('0x48')]['id']}})['then'](handleEntityNotFound(_0x145092,null))['then'](saveUpdates(_0x2b55c1[_0x401d('0x46')],null))[_0x401d('0x25')](respondWithResult(_0x145092,null))[_0x401d('0x41')](handleError(_0x145092,null));};exports[_0x401d('0x49')]=function(_0x29858f,_0x26ae91){return db[_0x401d('0x3e')]['find']({'where':{'id':_0x29858f['params']['id']}})['then'](handleEntityNotFound(_0x26ae91,null))[_0x401d('0x25')](removeEntity(_0x26ae91,null))[_0x401d('0x41')](handleError(_0x26ae91,null));};
\ No newline at end of file
+var _0xd053=['html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','type','key','VIRTUAL','filter','CmCustomField','includeAll','include','findAll','rows','show','params','merge','catch','create','transaction','body','find'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0xd053,0xe7));var _0x3d05=function(_0x3284cd,_0x2e10a2){_0x3284cd=_0x3284cd-0x0;var _0xe92280=_0xd053[_0x3284cd];return _0xe92280;};'use strict';var pdf=require(_0x3d05('0x0'));var emlformat=require(_0x3d05('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3d05('0x2'));var jsonpatch=require(_0x3d05('0x3'));var rp=require(_0x3d05('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3d05('0x5'));var util=require(_0x3d05('0x6'));var path=require('path');var sox=require(_0x3d05('0x7'));var csv=require(_0x3d05('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3d05('0x9'));var squel=require(_0x3d05('0xa'));var crypto=require(_0x3d05('0xb'));var jsforce=require(_0x3d05('0xc'));var deskjs=require(_0x3d05('0xd'));var toCsv=require(_0x3d05('0x8'));var querystring=require(_0x3d05('0xe'));var Papa=require(_0x3d05('0xf'));var Redis=require(_0x3d05('0x10'));var authService=require(_0x3d05('0x11'));var qs=require(_0x3d05('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d05('0x13'))(_0x3d05('0x14'));var utils=require(_0x3d05('0x15'));var config=require(_0x3d05('0x16'));var db=require(_0x3d05('0x17'))['db'];function respondWithStatusCode(_0x1f4e9d,_0x1d3132){_0x1d3132=_0x1d3132||0xcc;return function(_0x1ab1dd){if(_0x1ab1dd){return _0x1f4e9d[_0x3d05('0x18')](_0x1d3132);}return _0x1f4e9d['status'](_0x1d3132)[_0x3d05('0x19')]();};}function respondWithResult(_0x2d62d7,_0x34f8b5){_0x34f8b5=_0x34f8b5||0xc8;return function(_0x3131e3){if(_0x3131e3){return _0x2d62d7['status'](_0x34f8b5)[_0x3d05('0x1a')](_0x3131e3);}};}function respondWithFilteredResult(_0x486b37,_0x566cf4){return function(_0x41f12c){if(_0x41f12c){var _0x527c55=_0x41f12c[_0x3d05('0x1b')],_0x20a85c=_0x566cf4[_0x3d05('0x1c')],_0x5bd384=_0x566cf4[_0x3d05('0x1c')]+_0x566cf4[_0x3d05('0x1d')],_0x5a2daf;if(_0x5bd384>=_0x527c55){_0x5bd384=_0x527c55;_0x5a2daf=0xc8;}else{_0x5a2daf=0xce;}_0x486b37[_0x3d05('0x1e')](_0x5a2daf);return _0x486b37[_0x3d05('0x1f')](_0x3d05('0x20'),_0x20a85c+'-'+_0x5bd384+'/'+_0x527c55)[_0x3d05('0x1a')](_0x41f12c);}return null;};}function patchUpdates(_0x156baf){return function(_0xcf3bac){try{jsonpatch[_0x3d05('0x21')](_0xcf3bac,_0x156baf,!![]);}catch(_0xe034){return BPromise['reject'](_0xe034);}return _0xcf3bac[_0x3d05('0x22')]();};}function saveUpdates(_0x4adae2,_0x32071c){return function(_0x1e698f){if(_0x1e698f){return _0x1e698f[_0x3d05('0x23')](_0x4adae2)[_0x3d05('0x24')](function(_0x241f0c){return _0x241f0c;});}return null;};}function removeEntity(_0x301689,_0x4298f5){return function(_0x111575){if(_0x111575){return _0x111575[_0x3d05('0x25')]()[_0x3d05('0x24')](function(){_0x301689[_0x3d05('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38dd54,_0x2b0d61){return function(_0x14ab54){if(!_0x14ab54){_0x38dd54[_0x3d05('0x18')](0x194);}return _0x14ab54;};}function handleError(_0x538cd4,_0x4bb63e){_0x4bb63e=_0x4bb63e||0x1f4;return function(_0x30d62c){logger[_0x3d05('0x26')](_0x30d62c[_0x3d05('0x27')]);if(_0x30d62c['name']){delete _0x30d62c[_0x3d05('0x28')];}_0x538cd4[_0x3d05('0x1e')](_0x4bb63e)[_0x3d05('0x29')](_0x30d62c);};}exports[_0x3d05('0x2a')]=function(_0x4f04d6,_0x5cba9b){var _0x164d58={},_0x2c07d8={},_0xaf57dd={'count':0x0,'rows':[]};var _0x358e67=db['CmCustomField'][_0x3d05('0x2b')];_0x2c07d8[_0x3d05('0x2c')]=_[_0x3d05('0x2d')](_['keys'](_0x358e67),[_0x3d05('0x28')]);_0x2c07d8[_0x3d05('0x2e')]=_[_0x3d05('0x2f')](_0x4f04d6[_0x3d05('0x2e')]);_0x2c07d8['filters']=_[_0x3d05('0x30')](_0x2c07d8[_0x3d05('0x2c')],_0x2c07d8[_0x3d05('0x2e')]);_0x164d58[_0x3d05('0x31')]=_[_0x3d05('0x30')](_0x2c07d8[_0x3d05('0x2c')],qs[_0x3d05('0x32')](_0x4f04d6[_0x3d05('0x2e')][_0x3d05('0x32')]));_0x164d58[_0x3d05('0x31')]=_0x164d58[_0x3d05('0x31')][_0x3d05('0x33')]?_0x164d58[_0x3d05('0x31')]:_0x2c07d8[_0x3d05('0x2c')];if(!_0x4f04d6['query'][_0x3d05('0x34')](_0x3d05('0x35'))){_0x164d58[_0x3d05('0x1d')]=qs[_0x3d05('0x1d')](_0x4f04d6[_0x3d05('0x2e')]['limit']);_0x164d58[_0x3d05('0x1c')]=qs[_0x3d05('0x1c')](_0x4f04d6[_0x3d05('0x2e')][_0x3d05('0x1c')]);}_0x164d58[_0x3d05('0x36')]=qs['sort'](_0x4f04d6[_0x3d05('0x2e')][_0x3d05('0x37')]);_0x164d58[_0x3d05('0x38')]=qs[_0x3d05('0x39')](_[_0x3d05('0x3a')](_0x4f04d6[_0x3d05('0x2e')],_0x2c07d8[_0x3d05('0x39')]));if(_0x4f04d6['query']['filter']){_0x164d58['where']=_['merge'](_0x164d58[_0x3d05('0x38')],{'$or':_[_0x3d05('0x3b')](_0x358e67,function(_0x542e41){if(_0x542e41[_0x3d05('0x3c')][_0x3d05('0x3d')]!==_0x3d05('0x3e')){var _0x379ee9={};_0x379ee9[_0x542e41['field']]={'$like':'%'+_0x4f04d6[_0x3d05('0x2e')][_0x3d05('0x3f')]+'%'};return _0x379ee9;}})});}_0x164d58=_['merge']({},_0x164d58,_0x4f04d6['options']);var _0x4aecea={'where':_0x164d58['where']};return db[_0x3d05('0x40')][_0x3d05('0x1b')](_0x4aecea)[_0x3d05('0x24')](function(_0x2a20ec){_0xaf57dd[_0x3d05('0x1b')]=_0x2a20ec;if(_0x4f04d6[_0x3d05('0x2e')][_0x3d05('0x41')]){_0x164d58[_0x3d05('0x42')]=[{'all':!![]}];}return db[_0x3d05('0x40')][_0x3d05('0x43')](_0x164d58);})['then'](function(_0xc132f6){_0xaf57dd[_0x3d05('0x44')]=_0xc132f6;return _0xaf57dd;})[_0x3d05('0x24')](respondWithFilteredResult(_0x5cba9b,_0x164d58))['catch'](handleError(_0x5cba9b,null));};exports[_0x3d05('0x45')]=function(_0x658506,_0x4ae296){var _0x5d2398={'raw':!![],'where':{'id':_0x658506[_0x3d05('0x46')]['id']}},_0x2758bb={};_0x2758bb[_0x3d05('0x2c')]=_[_0x3d05('0x2f')](db[_0x3d05('0x40')][_0x3d05('0x2b')]);_0x2758bb[_0x3d05('0x2e')]=_[_0x3d05('0x2f')](_0x658506['query']);_0x2758bb['filters']=_[_0x3d05('0x30')](_0x2758bb[_0x3d05('0x2c')],_0x2758bb['query']);_0x5d2398['attributes']=_['intersection'](_0x2758bb[_0x3d05('0x2c')],qs[_0x3d05('0x32')](_0x658506[_0x3d05('0x2e')][_0x3d05('0x32')]));_0x5d2398[_0x3d05('0x31')]=_0x5d2398['attributes'][_0x3d05('0x33')]?_0x5d2398['attributes']:_0x2758bb[_0x3d05('0x2c')];if(_0x658506[_0x3d05('0x2e')][_0x3d05('0x41')]){_0x5d2398['include']=[{'all':!![]}];}_0x5d2398=_[_0x3d05('0x47')]({},_0x5d2398,_0x658506['options']);return db[_0x3d05('0x40')]['find'](_0x5d2398)['then'](handleEntityNotFound(_0x4ae296,null))['then'](respondWithResult(_0x4ae296,null))[_0x3d05('0x48')](handleError(_0x4ae296,null));};exports[_0x3d05('0x49')]=function(_0x864b19,_0x2181c1){return db['sequelize'][_0x3d05('0x4a')](function(_0x2a2e6b){return db[_0x3d05('0x40')][_0x3d05('0x49')](_0x864b19[_0x3d05('0x4b')],{'transaction':_0x2a2e6b});})['then'](respondWithResult(_0x2181c1,0xc9))[_0x3d05('0x48')](handleError(_0x2181c1,null));};exports[_0x3d05('0x23')]=function(_0x94309c,_0x4b39af){if(_0x94309c[_0x3d05('0x4b')]['id']){delete _0x94309c[_0x3d05('0x4b')]['id'];}return db[_0x3d05('0x40')]['find']({'where':{'id':_0x94309c[_0x3d05('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b39af,null))[_0x3d05('0x24')](saveUpdates(_0x94309c[_0x3d05('0x4b')],null))['then'](respondWithResult(_0x4b39af,null))[_0x3d05('0x48')](handleError(_0x4b39af,null));};exports[_0x3d05('0x25')]=function(_0xa42ad2,_0x2c54b4){return db[_0x3d05('0x40')][_0x3d05('0x4c')]({'where':{'id':_0xa42ad2[_0x3d05('0x46')]['id']}})[_0x3d05('0x24')](handleEntityNotFound(_0x2c54b4,null))[_0x3d05('0x24')](removeEntity(_0x2c54b4,null))['catch'](handleError(_0x2c54b4,null));};
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js
index ab2f3fe..2328301 100644
--- a/server/api/cmCustomField/cmCustomField.model.js
+++ b/server/api/cmCustomField/cmCustomField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7845=['exports','define','get','transaction','type','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','cf_%d','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x52ac78,_0xf5a50c){var _0x4a9f09=function(_0x202619){while(--_0x202619){_0x52ac78['push'](_0x52ac78['shift']());}};_0x4a9f09(++_0xf5a50c);}(_0x7845,0xc5));var _0x5784=function(_0x55c338,_0x31fcdf){_0x55c338=_0x55c338-0x0;var _0x1c1016=_0x7845[_0x55c338];return _0x1c1016;};'use strict';var _=require(_0x5784('0x0'));var util=require(_0x5784('0x1'));var logger=require(_0x5784('0x2'))(_0x5784('0x3'));var moment=require(_0x5784('0x4'));var BPromise=require(_0x5784('0x5'));var rp=require(_0x5784('0x6'));var fs=require('fs');var path=require(_0x5784('0x7'));var rimraf=require(_0x5784('0x8'));var config=require(_0x5784('0x9'));var attributes=require(_0x5784('0xa'));module[_0x5784('0xb')]=function(_0x2064f1,_0x5e35e5){return _0x2064f1[_0x5784('0xc')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a10ac,_0x2509b8,_0x523ad3){var _0x34b619=_0x2a10ac[_0x5784('0xd')]({'plain':!![]});var _0x17d111={'type':_0x5e35e5['TEXT'],'transaction':_0x2509b8[_0x5784('0xe')]};switch(_0x34b619[_0x5784('0xf')]){case _0x5784('0x10'):_0x17d111[_0x5784('0xf')]=_0x5e35e5['TEXT'];break;case _0x5784('0x11'):_0x17d111[_0x5784('0xf')]=_0x5e35e5[_0x5784('0x12')];break;case _0x5784('0x13'):_0x17d111[_0x5784('0xf')]=_0x5e35e5[_0x5784('0x14')];_0x17d111[_0x5784('0x15')]=![];break;}_0x2064f1[_0x5784('0x16')]['addColumn'](_0x5784('0x17'),util[_0x5784('0x18')](_0x5784('0x19'),_0x34b619['id']),_0x17d111);_0x523ad3();}}});};
\ No newline at end of file
+var _0xa3bc=['TEXT','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','get','type','text'];(function(_0x1683cf,_0x20b3cb){var _0x1159ad=function(_0x241e90){while(--_0x241e90){_0x1683cf['push'](_0x1683cf['shift']());}};_0x1159ad(++_0x20b3cb);}(_0xa3bc,0x15b));var _0xca3b=function(_0x5d0484,_0xdede92){_0x5d0484=_0x5d0484-0x0;var _0x4e105b=_0xa3bc[_0x5d0484];return _0x4e105b;};'use strict';var _=require(_0xca3b('0x0'));var util=require(_0xca3b('0x1'));var logger=require(_0xca3b('0x2'))('api');var moment=require(_0xca3b('0x3'));var BPromise=require(_0xca3b('0x4'));var rp=require(_0xca3b('0x5'));var fs=require('fs');var path=require(_0xca3b('0x6'));var rimraf=require(_0xca3b('0x7'));var config=require(_0xca3b('0x8'));var attributes=require(_0xca3b('0x9'));module[_0xca3b('0xa')]=function(_0x8eb839,_0x50ee6d){return _0x8eb839[_0xca3b('0xb')](_0xca3b('0xc'),attributes,{'tableName':_0xca3b('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x30bd77,_0x48037f,_0x3cf5a8){var _0xb549ad=_0x30bd77[_0xca3b('0xe')]({'plain':!![]});var _0x191a92={'type':_0x50ee6d['TEXT'],'transaction':_0x48037f['transaction']};switch(_0xb549ad[_0xca3b('0xf')]){case _0xca3b('0x10'):_0x191a92['type']=_0x50ee6d[_0xca3b('0x11')];break;case'number':_0x191a92[_0xca3b('0xf')]=_0x50ee6d[_0xca3b('0x12')];break;case _0xca3b('0x13'):_0x191a92[_0xca3b('0xf')]=_0x50ee6d['BOOLEAN'];_0x191a92[_0xca3b('0x14')]=![];break;}_0x8eb839[_0xca3b('0x15')][_0xca3b('0x16')](_0xca3b('0x17'),util[_0xca3b('0x18')](_0xca3b('0x19'),_0xb549ad['id']),_0x191a92);_0x3cf5a8();}}});};
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js
index 8d1208b..28302a0 100644
--- a/server/api/cmCustomField/cmCustomField.rpc.js
+++ b/server/api/cmCustomField/cmCustomField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5c68=['request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x5c68,0x14d));var _0x85c6=function(_0x33aa8d,_0x5d6fe2){_0x33aa8d=_0x33aa8d-0x0;var _0x314cf7=_0x5c68[_0x33aa8d];return _0x314cf7;};'use strict';var _=require(_0x85c6('0x0'));var util=require('util');var moment=require(_0x85c6('0x1'));var BPromise=require(_0x85c6('0x2'));var rs=require(_0x85c6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x85c6('0x4'))['db'];var utils=require(_0x85c6('0x5'));var logger=require(_0x85c6('0x6'))(_0x85c6('0x7'));var config=require(_0x85c6('0x8'));var jayson=require(_0x85c6('0x9'));var client=jayson[_0x85c6('0xa')][_0x85c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47cbe4,_0x498d11,_0x770217){return new BPromise(function(_0x69d956,_0xc2dde0){return client[_0x85c6('0xc')](_0x47cbe4,_0x770217)['then'](function(_0x4b607f){logger[_0x85c6('0xd')](_0x85c6('0xe'),_0x498d11,_0x85c6('0xf'));logger['debug'](_0x85c6('0x10'),_0x498d11,_0x85c6('0xf'),JSON[_0x85c6('0x11')](_0x4b607f));if(_0x4b607f[_0x85c6('0x12')]){if(_0x4b607f[_0x85c6('0x12')][_0x85c6('0x13')]===0x1f4){logger['error'](_0x85c6('0xe'),_0x498d11,_0x4b607f[_0x85c6('0x12')][_0x85c6('0x14')]);return _0xc2dde0(_0x4b607f['error'][_0x85c6('0x14')]);}logger[_0x85c6('0x12')](_0x85c6('0xe'),_0x498d11,_0x4b607f[_0x85c6('0x12')][_0x85c6('0x14')]);return _0x69d956(_0x4b607f[_0x85c6('0x12')][_0x85c6('0x14')]);}else{logger[_0x85c6('0xd')]('CmCustomField,\x20%s,\x20%s',_0x498d11,_0x85c6('0xf'));_0x69d956(_0x4b607f[_0x85c6('0x15')][_0x85c6('0x14')]);}})[_0x85c6('0x16')](function(_0x68a2c7){logger[_0x85c6('0x12')](_0x85c6('0xe'),_0x498d11,_0x68a2c7);_0xc2dde0(_0x68a2c7);});});}
\ No newline at end of file
+var _0xf461=['moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util'];(function(_0x5a5380,_0x440bd1){var _0x41a587=function(_0x240e51){while(--_0x240e51){_0x5a5380['push'](_0x5a5380['shift']());}};_0x41a587(++_0x440bd1);}(_0xf461,0xaa));var _0x1f46=function(_0x136a17,_0x5338fc){_0x136a17=_0x136a17-0x0;var _0x18db28=_0xf461[_0x136a17];return _0x18db28;};'use strict';var _=require('lodash');var util=require(_0x1f46('0x0'));var moment=require(_0x1f46('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f46('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f46('0x3'));var logger=require('../../config/logger')(_0x1f46('0x4'));var config=require(_0x1f46('0x5'));var jayson=require(_0x1f46('0x6'));var client=jayson[_0x1f46('0x7')][_0x1f46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x375e4c,_0x22c1f6,_0x5e39ca){return new BPromise(function(_0x4f3dca,_0x3ea619){return client[_0x1f46('0x9')](_0x375e4c,_0x5e39ca)[_0x1f46('0xa')](function(_0x57d68b){logger[_0x1f46('0xb')](_0x1f46('0xc'),_0x22c1f6,'request\x20sent');logger[_0x1f46('0xd')](_0x1f46('0xe'),_0x22c1f6,_0x1f46('0xf'),JSON['stringify'](_0x57d68b));if(_0x57d68b[_0x1f46('0x10')]){if(_0x57d68b[_0x1f46('0x10')]['code']===0x1f4){logger[_0x1f46('0x10')]('CmCustomField,\x20%s,\x20%s',_0x22c1f6,_0x57d68b[_0x1f46('0x10')]['message']);return _0x3ea619(_0x57d68b[_0x1f46('0x10')][_0x1f46('0x11')]);}logger[_0x1f46('0x10')](_0x1f46('0xc'),_0x22c1f6,_0x57d68b[_0x1f46('0x10')]['message']);return _0x4f3dca(_0x57d68b[_0x1f46('0x10')][_0x1f46('0x11')]);}else{logger[_0x1f46('0xb')](_0x1f46('0xc'),_0x22c1f6,_0x1f46('0xf'));_0x4f3dca(_0x57d68b['result'][_0x1f46('0x11')]);}})[_0x1f46('0x12')](function(_0x198e2b){logger[_0x1f46('0x10')](_0x1f46('0xc'),_0x22c1f6,_0x198e2b);_0x3ea619(_0x198e2b);});});}
\ No newline at end of file
diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js
index bc941e0..f1338bc 100644
--- a/server/api/cmCustomField/index.js
+++ b/server/api/cmCustomField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a93=['create','put','update','delete','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x40a6b5,_0x2ef12f){var _0x4bab77=function(_0x303e52){while(--_0x303e52){_0x40a6b5['push'](_0x40a6b5['shift']());}};_0x4bab77(++_0x2ef12f);}(_0x2a93,0xfd));var _0x32a9=function(_0x7a9abb,_0x57ea72){_0x7a9abb=_0x7a9abb-0x0;var _0xd04225=_0x2a93[_0x7a9abb];return _0xd04225;};'use strict';var multer=require('multer');var util=require(_0x32a9('0x0'));var path=require(_0x32a9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x32a9('0x2')]();var auth=require(_0x32a9('0x3'));var interaction=require(_0x32a9('0x4'));var config=require(_0x32a9('0x5'));var controller=require(_0x32a9('0x6'));router[_0x32a9('0x7')]('/',auth[_0x32a9('0x8')](),controller[_0x32a9('0x9')]);router[_0x32a9('0x7')](_0x32a9('0xa'),auth[_0x32a9('0x8')](),controller[_0x32a9('0xb')]);router[_0x32a9('0xc')]('/',auth['isAuthenticated'](),controller[_0x32a9('0xd')]);router[_0x32a9('0xe')](_0x32a9('0xa'),auth[_0x32a9('0x8')](),controller[_0x32a9('0xf')]);router[_0x32a9('0x10')](_0x32a9('0xa'),auth[_0x32a9('0x8')](),controller[_0x32a9('0x11')]);module[_0x32a9('0x12')]=router;
\ No newline at end of file
+var _0x8fd2=['isAuthenticated','index','/:id','show','create','put','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8fd2,0x89));var _0x28fd=function(_0x1b4aab,_0x101164){_0x1b4aab=_0x1b4aab-0x0;var _0x5997c4=_0x8fd2[_0x1b4aab];return _0x5997c4;};'use strict';var multer=require('multer');var util=require(_0x28fd('0x0'));var path=require(_0x28fd('0x1'));var timeout=require(_0x28fd('0x2'));var express=require('express');var router=express[_0x28fd('0x3')]();var auth=require(_0x28fd('0x4'));var interaction=require(_0x28fd('0x5'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0x28fd('0x6')]('/',auth[_0x28fd('0x7')](),controller[_0x28fd('0x8')]);router['get'](_0x28fd('0x9'),auth[_0x28fd('0x7')](),controller[_0x28fd('0xa')]);router['post']('/',auth[_0x28fd('0x7')](),controller[_0x28fd('0xb')]);router[_0x28fd('0xc')](_0x28fd('0x9'),auth[_0x28fd('0x7')](),controller[_0x28fd('0xd')]);router[_0x28fd('0xe')](_0x28fd('0x9'),auth[_0x28fd('0x7')](),controller['destroy']);module[_0x28fd('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js
index 707a03f..2a5b642 100644
--- a/server/api/cmHopper/cmHopper.attributes.js
+++ b/server/api/cmHopper/cmHopper.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdd9=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','STRING','contactListQueue','moment','sequelize','exports','DATE','format'];(function(_0xd4cc66,_0x10c57f){var _0x17fbef=function(_0x205d60){while(--_0x205d60){_0xd4cc66['push'](_0xd4cc66['shift']());}};_0x17fbef(++_0x10c57f);}(_0xbdd9,0xc3));var _0x9bdd=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0xbdd9[_0x240261];return _0x45c332;};'use strict';var moment=require(_0x9bdd('0x0'));var Sequelize=require(_0x9bdd('0x1'));module[_0x9bdd('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9bdd('0x3')],'defaultValue':moment()[_0x9bdd('0x4')](_0x9bdd('0x5'))},'countbusyretry':{'type':Sequelize[_0x9bdd('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9bdd('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9bdd('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9bdd('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9bdd('0x3')]},'priority':{'type':Sequelize[_0x9bdd('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9bdd('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x9bdd('0x9')},'ListId':{'type':Sequelize[_0x9bdd('0x6')],'unique':_0x9bdd('0x9')},'UserId':{'type':Sequelize[_0x9bdd('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x3e6b=['sequelize','exports','STRING','BOOLEAN','DATE','format','INTEGER','contactListQueue','moment'];(function(_0xb34556,_0x4c21b3){var _0x1ffc81=function(_0x31817c){while(--_0x31817c){_0xb34556['push'](_0xb34556['shift']());}};_0x1ffc81(++_0x4c21b3);}(_0x3e6b,0xe0));var _0xb3e6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3e6b[_0x4b369d];return _0x571a98;};'use strict';var moment=require(_0xb3e6('0x0'));var Sequelize=require(_0xb3e6('0x1'));module[_0xb3e6('0x2')]={'phone':{'type':Sequelize[_0xb3e6('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xb3e6('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb3e6('0x5')],'defaultValue':moment()[_0xb3e6('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb3e6('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb3e6('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb3e6('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb3e6('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb3e6('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb3e6('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb3e6('0x7')],'unique':_0xb3e6('0x8')},'ListId':{'type':Sequelize[_0xb3e6('0x7')],'unique':_0xb3e6('0x8')},'UserId':{'type':Sequelize[_0xb3e6('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xb3e6('0x8')},'CampaignId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js
index 6b8b31c..3b6e579 100644
--- a/server/api/cmHopper/cmHopper.controller.js
+++ b/server/api/cmHopper/cmHopper.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x966b=['literal','findOne','scheduledat','LOCK','UPDATE','Contact','List','VoiceQueue','Queue','dialActive','outbound','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','end','json','count','offset','limit','status','apply','save','update','then','destroy','stack','send','index','CmHopper','rawAttributes','model','keys','query','filters','concat','$gt','$lt','$lte','$ne','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','VoiceQueueId','CampaignId','Campaign','name','omit','dataValues','createdAt','updatedAt','statedesc','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','sequelize','transaction','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x966b,0x120));var _0xb966=function(_0x99d9ea,_0x14baff){_0x99d9ea=_0x99d9ea-0x0;var _0x23ae97=_0x966b[_0x99d9ea];return _0x23ae97;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb966('0x0'));var jsonpatch=require(_0xb966('0x1'));var rp=require(_0xb966('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb966('0x3'));var util=require('util');var path=require(_0xb966('0x4'));var sox=require('sox');var csv=require(_0xb966('0x5'));var ejs=require(_0xb966('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb966('0x7'));var crypto=require(_0xb966('0x8'));var jsforce=require(_0xb966('0x9'));var deskjs=require(_0xb966('0xa'));var toCsv=require(_0xb966('0x5'));var querystring=require(_0xb966('0xb'));var Papa=require(_0xb966('0xc'));var Redis=require('ioredis');var authService=require(_0xb966('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb966('0xe'));var logger=require('../../config/logger')(_0xb966('0xf'));var utils=require(_0xb966('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2befaf,_0x513965){_0x513965=_0x513965||0xcc;return function(_0x2dbdbd){if(_0x2dbdbd){return _0x2befaf[_0xb966('0x11')](_0x513965);}return _0x2befaf['status'](_0x513965)[_0xb966('0x12')]();};}function respondWithResult(_0x5dfbea,_0x5c778e){_0x5c778e=_0x5c778e||0xc8;return function(_0xc14ab){if(_0xc14ab){return _0x5dfbea['status'](_0x5c778e)[_0xb966('0x13')](_0xc14ab);}};}function respondWithFilteredResult(_0xf2953d,_0x404ec4){return function(_0x2499a9){if(_0x2499a9){var _0x56c8df=_0x2499a9[_0xb966('0x14')],_0x486ae1=_0x404ec4[_0xb966('0x15')],_0x42e861=_0x404ec4[_0xb966('0x15')]+_0x404ec4[_0xb966('0x16')],_0x189ef3;if(_0x42e861>=_0x56c8df){_0x42e861=_0x56c8df;_0x189ef3=0xc8;}else{_0x189ef3=0xce;}_0xf2953d[_0xb966('0x17')](_0x189ef3);return _0xf2953d['set']('Content-Range',_0x486ae1+'-'+_0x42e861+'/'+_0x56c8df)[_0xb966('0x13')](_0x2499a9);}return null;};}function patchUpdates(_0x173773){return function(_0x2cf541){try{jsonpatch[_0xb966('0x18')](_0x2cf541,_0x173773,!![]);}catch(_0x15848d){return BPromise['reject'](_0x15848d);}return _0x2cf541[_0xb966('0x19')]();};}function saveUpdates(_0x5d5956,_0x37e91e){return function(_0x2263d0){if(_0x2263d0){return _0x2263d0[_0xb966('0x1a')](_0x5d5956)[_0xb966('0x1b')](function(_0x37659b){return _0x37659b;});}return null;};}function removeEntity(_0x4c0a7e,_0x2370bb){return function(_0x4d054d){if(_0x4d054d){return _0x4d054d[_0xb966('0x1c')]()[_0xb966('0x1b')](function(){_0x4c0a7e['status'](0xcc)[_0xb966('0x12')]();});}};}function handleEntityNotFound(_0x4be77d,_0x55cb32){return function(_0x3fd9e8){if(!_0x3fd9e8){_0x4be77d[_0xb966('0x11')](0x194);}return _0x3fd9e8;};}function handleError(_0x2d9c9b,_0x51c3d7){_0x51c3d7=_0x51c3d7||0x1f4;return function(_0x364bb4){logger['error'](_0x364bb4[_0xb966('0x1d')]);if(_0x364bb4['name']){delete _0x364bb4['name'];}_0x2d9c9b['status'](_0x51c3d7)[_0xb966('0x1e')](_0x364bb4);};}exports[_0xb966('0x1f')]=function(_0x2dedf3,_0x42d074){var _0x9cf8c1={},_0x43a998={},_0x31d9d7={'count':0x0,'rows':[]};var _0x15a092=db[_0xb966('0x20')][_0xb966('0x21')];_0x43a998[_0xb966('0x22')]=_[_0xb966('0x23')](_0x15a092);_0x43a998[_0xb966('0x24')]=_[_0xb966('0x23')](_0x2dedf3[_0xb966('0x24')]);_0x43a998['filters']=_['intersection'](_0x43a998[_0xb966('0x22')],_0x43a998[_0xb966('0x24')]);_0x43a998[_0xb966('0x25')]=_[_0xb966('0x26')](_0x43a998[_0xb966('0x25')],['$and','$or',_0xb966('0x27'),'$gte',_0xb966('0x28'),_0xb966('0x29'),_0xb966('0x2a'),'$eq','$not',_0xb966('0x2b'),_0xb966('0x2c'),_0xb966('0x2d'),'$notIn',_0xb966('0x2e'),_0xb966('0x2f'),_0xb966('0x30'),_0xb966('0x31'),'$like','$overlap',_0xb966('0x32'),_0xb966('0x33'),_0xb966('0x34')]);_0x9cf8c1[_0xb966('0x35')]=_[_0xb966('0x36')](_0x43a998['model'],qs['fields'](_0x2dedf3[_0xb966('0x24')][_0xb966('0x37')]));_0x9cf8c1[_0xb966('0x35')]=_0x9cf8c1['attributes'][_0xb966('0x38')]?_0x9cf8c1[_0xb966('0x35')]:_0x43a998['model'];if(!_0x2dedf3[_0xb966('0x24')][_0xb966('0x39')](_0xb966('0x3a'))){_0x9cf8c1[_0xb966('0x16')]=qs['limit'](_0x2dedf3['query']['limit']);_0x9cf8c1['offset']=qs['offset'](_0x2dedf3[_0xb966('0x24')][_0xb966('0x15')]);}_0x9cf8c1['order']=qs[_0xb966('0x3b')](_0x2dedf3['query'][_0xb966('0x3b')]);_0x9cf8c1[_0xb966('0x3c')]=qs[_0xb966('0x25')](_[_0xb966('0x3d')](_0x2dedf3[_0xb966('0x24')],_0x43a998[_0xb966('0x25')]));if(_0x2dedf3['query'][_0xb966('0x3e')]){_0x9cf8c1[_0xb966('0x3c')]=_[_0xb966('0x3f')](_0x9cf8c1[_0xb966('0x3c')],{'$or':_[_0xb966('0x40')](_0x15a092,function(_0x2becbd){if(_0x2becbd[_0xb966('0x41')][_0xb966('0x42')]!==_0xb966('0x43')){var _0x6eb94a={};_0x6eb94a[_0x2becbd[_0xb966('0x44')]]={'$like':'%'+_0x2dedf3['query'][_0xb966('0x3e')]+'%'};return _0x6eb94a;}})});}_0x9cf8c1=_[_0xb966('0x3f')]({},_0x9cf8c1,_0x2dedf3[_0xb966('0x45')]);var _0x194599={'where':_0x9cf8c1[_0xb966('0x3c')]};return db[_0xb966('0x20')][_0xb966('0x14')](_0x194599)[_0xb966('0x1b')](function(_0x4177cc){_0x31d9d7['count']=_0x4177cc;if(_0x2dedf3[_0xb966('0x24')][_0xb966('0x46')]){_0x9cf8c1[_0xb966('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0xb966('0x48')](_0x9cf8c1);})[_0xb966('0x1b')](function(_0x301468){_0x31d9d7[_0xb966('0x49')]=_0x301468;return _0x31d9d7;})['then'](respondWithFilteredResult(_0x42d074,_0x9cf8c1))[_0xb966('0x4a')](handleError(_0x42d074,null));};exports['show']=function(_0x50b2eb,_0x126eee){var _0x1670f3={'raw':!![],'where':{'id':_0x50b2eb[_0xb966('0x4b')]['id']}},_0x57e971={};_0x57e971[_0xb966('0x22')]=_[_0xb966('0x23')](db[_0xb966('0x20')]['rawAttributes']);_0x57e971[_0xb966('0x24')]=_['keys'](_0x50b2eb[_0xb966('0x24')]);_0x57e971['filters']=_[_0xb966('0x36')](_0x57e971[_0xb966('0x22')],_0x57e971['query']);_0x1670f3[_0xb966('0x35')]=_['intersection'](_0x57e971[_0xb966('0x22')],qs[_0xb966('0x37')](_0x50b2eb['query'][_0xb966('0x37')]));_0x1670f3[_0xb966('0x35')]=_0x1670f3[_0xb966('0x35')][_0xb966('0x38')]?_0x1670f3[_0xb966('0x35')]:_0x57e971[_0xb966('0x22')];if(_0x50b2eb[_0xb966('0x24')][_0xb966('0x46')]){_0x1670f3[_0xb966('0x47')]=[{'all':!![]}];}_0x1670f3=_[_0xb966('0x3f')]({},_0x1670f3,_0x50b2eb[_0xb966('0x45')]);return db[_0xb966('0x20')][_0xb966('0x4c')](_0x1670f3)[_0xb966('0x1b')](handleEntityNotFound(_0x126eee,null))['then'](respondWithResult(_0x126eee,null))[_0xb966('0x4a')](handleError(_0x126eee,null));};exports['create']=function(_0x51d089,_0x586267){return db[_0xb966('0x20')][_0xb966('0x4d')](_0x51d089[_0xb966('0x4e')],{})[_0xb966('0x1b')](respondWithResult(_0x586267,0xc9))['catch'](handleError(_0x586267,null));};exports[_0xb966('0x1a')]=function(_0x3d8853,_0x4d067c){if(_0x3d8853['body']['id']){delete _0x3d8853[_0xb966('0x4e')]['id'];}return db[_0xb966('0x20')][_0xb966('0x4c')]({'where':{'id':_0x3d8853[_0xb966('0x4b')]['id']}})[_0xb966('0x1b')](handleEntityNotFound(_0x4d067c,null))[_0xb966('0x1b')](saveUpdates(_0x3d8853[_0xb966('0x4e')],null))[_0xb966('0x1b')](respondWithResult(_0x4d067c,null))[_0xb966('0x4a')](handleError(_0x4d067c,null));};exports['describe']=function(_0x1f74b1,_0x391875){return db[_0xb966('0x20')][_0xb966('0x4f')]()['then'](respondWithResult(_0x391875,null))['catch'](handleError(_0x391875,null));};exports[_0xb966('0x1c')]=function(_0x13c54b,_0x1c8c3d){var _0x221530;return db['CmHopper']['find']({'where':{'id':_0x13c54b[_0xb966('0x4b')]['id']}})[_0xb966('0x1b')](handleEntityNotFound(_0x1c8c3d,null))[_0xb966('0x1b')](function(_0x38d4b6){if(_0x38d4b6){return _0x38d4b6['destroy']()[_0xb966('0x1b')](function(_0x404b1a){return _0x404b1a;});}})[_0xb966('0x1b')](function(_0x1b3b75){_0x221530=_0x1b3b75;if(_0x1b3b75){if(_0x1b3b75[_0xb966('0x50')]||_0x1b3b75[_0xb966('0x51')]){return db[_0x1b3b75['VoiceQueueId']?'VoiceQueue':_0xb966('0x52')][_0xb966('0x4c')]({'where':{'id':_0x1b3b75[_0xb966('0x50')]?_0x1b3b75['VoiceQueueId']:_0x1b3b75[_0xb966('0x51')]},'attributes':['id',_0xb966('0x53')],'raw':!![]});}}})['then'](function(_0x33da68){var _0x284e34={};if(_0x33da68){_[_0xb966('0x3f')](_0x284e34,_[_0xb966('0x54')](_0x221530[_0xb966('0x55')],[_0xb966('0x56'),_0xb966('0x57'),'id']));_0x284e34['state']=0x15;_0x284e34[_0xb966('0x58')]='deleted';_0x284e34[_0xb966('0x59')]=_0x33da68['name'];_0x284e34[_0xb966('0x5a')]=_0x13c54b[_0xb966('0x5b')][_0xb966('0x53')];_0x284e34[_0xb966('0x5c')]=_0x13c54b[_0xb966('0x5b')]['id'];_0x284e34[_0xb966('0x5d')]=!![];_0x284e34[_0xb966('0x5e')]=moment()[_0xb966('0x5f')](_0xb966('0x60'));_0x284e34[_0xb966('0x61')]=_0x221530[_0xb966('0x62')];_0x284e34[_0xb966('0x63')]=_0x221530[_0xb966('0x50')]?_0xb966('0x64'):'ivr';return db[_0xb966('0x65')][_0xb966('0x4c')]({'where':{'id':_0x284e34['ContactId']},'attributes':[_0xb966('0x66'),_0xb966('0x67')]})[_0xb966('0x1b')](function(_0x2091fd){if(!_[_0xb966('0x68')](_0x1c8c3d)&&!_['isNil'](_0x2091fd[_0xb966('0x66')])){_0x284e34[_0xb966('0x69')]=_0x2091fd[_0xb966('0x66')];if(!_[_0xb966('0x68')](_0x2091fd['lastName'])){_0x284e34[_0xb966('0x69')]+='\x20'+_0x2091fd['lastName'];}}})['finally'](function(){return db[_0xb966('0x6a')][_0xb966('0x4d')](_0x284e34);});}})[_0xb966('0x1b')](function(){return _0x1c8c3d['status'](0xcc)[_0xb966('0x12')]();})[_0xb966('0x4a')](handleError(_0x1c8c3d,null));};exports[_0xb966('0x6b')]=function(_0x2c18aa,_0x46c8a5,_0xe903f0){var _0x112bb9=[];return db[_0xb966('0x65')][_0xb966('0x4f')]()[_0xb966('0x1b')](function(_0x2f40ee){_0x112bb9=_[_0xb966('0x23')](_0x2f40ee);return _0x2c18aa['user'][_0xb966('0x6c')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xb966('0x6d')},'attributes':['id',_0xb966('0x6e')],'raw':!![]});})[_0xb966('0x1b')](function(_0x2f78c2){if(_0x2f78c2&&_0x2f78c2[_0xb966('0x38')]){return db[_0xb966('0x6f')][_0xb966('0x70')](function(_0x49c982){var _0xf6688={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb966('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xb966('0x40')](_0x2f78c2,'id')},'$or':[{'UserId':null},{'UserId':_0x2c18aa[_0xb966('0x5b')]['id']}]};var _0x52574b=[];if(_0x2c18aa[_0xb966('0x4e')][_0xb966('0x71')]&&_0x2c18aa[_0xb966('0x4e')][_0xb966('0x71')]==='prev'){if(!_[_0xb966('0x72')](_0x2c18aa[_0xb966('0x4e')][_0xb966('0x73')])){_0xf6688['id']={'$in':_0x2c18aa[_0xb966('0x4e')]['hopperIds']};}_0x52574b=[[_0xb966('0x74'),_0xb966('0x75')],[_0xb966('0x76'),_0x2f78c2[0x0]['dialOrderByScheduledAt']===_0xb966('0x75')?_0xb966('0x77'):_0xb966('0x75')],db[_0xb966('0x6f')][_0xb966('0x78')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xb966('0x77')]];}else{if(!_[_0xb966('0x72')](_0x2c18aa[_0xb966('0x4e')][_0xb966('0x73')])){_0xf6688['id']={'$notIn':_0x2c18aa[_0xb966('0x4e')][_0xb966('0x73')]};}_0x52574b=[['priority','DESC'],['scheduledAt',_0x2f78c2[0x0][_0xb966('0x6e')]],db['sequelize'][_0xb966('0x78')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xb966('0x75')]];}return db[_0xb966('0x20')][_0xb966('0x79')]({'attributes':['id',_0xb966('0x7a')],'where':_0xf6688,'order':_0x52574b,'transaction':_0x49c982,'lock':_0x49c982[_0xb966('0x7b')][_0xb966('0x7c')],'include':[{'model':db[_0xb966('0x65')],'as':_0xb966('0x7d'),'attributes':_0x112bb9,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':_0xb966('0x7e'),'attributes':['id','name']},{'model':db[_0xb966('0x7f')],'as':_0xb966('0x80'),'attributes':['id','name',_0xb966('0x81')]}]})[_0xb966('0x1b')](function(_0x973325){if(_0x973325){return _0x973325[_0xb966('0x1a')]({'UserId':_0x2c18aa[_0xb966('0x5b')]['id']},{'transaction':_0x49c982});}});});}})[_0xb966('0x1b')](handleEntityNotFound(_0x46c8a5,null))[_0xb966('0x1b')](respondWithResult(_0x46c8a5,null))[_0xb966('0x4a')](handleError(_0x46c8a5,null));};exports['getOpenContacts']=function(_0xb0021,_0xdb4b98,_0x48fba){return _0xb0021[_0xb966('0x5b')][_0xb966('0x6c')]({'where':{'type':_0xb966('0x82'),'dialActive':!![],'dialMethod':_0xb966('0x6d')},'attributes':['id'],'raw':!![]})[_0xb966('0x1b')](function(_0x4a0d71){if(_0x4a0d71&&_0x4a0d71[_0xb966('0x38')]){return db['CmHopper'][_0xb966('0x14')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb966('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xb966('0x40')](_0x4a0d71,'id')},'$or':[{'UserId':null},{'UserId':_0xb0021['user']['id']}]}});}return 0x0;})[_0xb966('0x1b')](function(_0x250a21){if(!_[_0xb966('0x68')](_0x250a21)&&_[_0xb966('0x83')](_0x250a21)){return _0xdb4b98[_0xb966('0x17')](0xc8)[_0xb966('0x13')]({'contacts':_0x250a21});}else{logger[_0xb966('0x84')](_0xb966('0x85'),_0xb966('0x86'),0x194,_0xb966('0x87'));_0xdb4b98['sendStatus'](0x194);}})['catch'](handleError(_0xdb4b98,null));};
\ No newline at end of file
+var _0x66f5=['updatedAt','state','statedesc','deleted','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','literal','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','isNumber','getOpenContacts','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','rawAttributes','keys','query','filters','concat','$and','$gte','$lt','$ne','$eq','$not','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','key','field','options','include','CmHopper','rows','params','intersection','includeAll','find','catch','create','body','update','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x66f5,0xbd));var _0x566f=function(_0x76d023,_0x102685){_0x76d023=_0x76d023-0x0;var _0x53d654=_0x66f5[_0x76d023];return _0x53d654;};'use strict';var pdf=require(_0x566f('0x0'));var emlformat=require(_0x566f('0x1'));var rimraf=require(_0x566f('0x2'));var zipdir=require(_0x566f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x566f('0x4'));var moment=require('moment');var BPromise=require(_0x566f('0x5'));var Mustache=require(_0x566f('0x6'));var util=require(_0x566f('0x7'));var path=require(_0x566f('0x8'));var sox=require(_0x566f('0x9'));var csv=require(_0x566f('0xa'));var ejs=require(_0x566f('0xb'));var fs=require('fs');var _=require(_0x566f('0xc'));var squel=require('squel');var crypto=require(_0x566f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x566f('0xe'));var toCsv=require(_0x566f('0xa'));var querystring=require(_0x566f('0xf'));var Papa=require(_0x566f('0x10'));var Redis=require(_0x566f('0x11'));var authService=require(_0x566f('0x12'));var qs=require(_0x566f('0x13'));var hardwareService=require(_0x566f('0x14'));var logger=require(_0x566f('0x15'))('api');var utils=require(_0x566f('0x16'));var config=require(_0x566f('0x17'));var db=require(_0x566f('0x18'))['db'];function respondWithStatusCode(_0x246c37,_0x3b2cf9){_0x3b2cf9=_0x3b2cf9||0xcc;return function(_0x3c356f){if(_0x3c356f){return _0x246c37[_0x566f('0x19')](_0x3b2cf9);}return _0x246c37[_0x566f('0x1a')](_0x3b2cf9)[_0x566f('0x1b')]();};}function respondWithResult(_0x54b6ad,_0x537926){_0x537926=_0x537926||0xc8;return function(_0x3e81af){if(_0x3e81af){return _0x54b6ad[_0x566f('0x1a')](_0x537926)[_0x566f('0x1c')](_0x3e81af);}};}function respondWithFilteredResult(_0x30e95a,_0x4a5a3f){return function(_0x32e9c6){if(_0x32e9c6){var _0x78d329=_0x32e9c6[_0x566f('0x1d')],_0x5b2d84=_0x4a5a3f[_0x566f('0x1e')],_0x51b7a1=_0x4a5a3f[_0x566f('0x1e')]+_0x4a5a3f[_0x566f('0x1f')],_0xa81fb3;if(_0x51b7a1>=_0x78d329){_0x51b7a1=_0x78d329;_0xa81fb3=0xc8;}else{_0xa81fb3=0xce;}_0x30e95a[_0x566f('0x1a')](_0xa81fb3);return _0x30e95a[_0x566f('0x20')](_0x566f('0x21'),_0x5b2d84+'-'+_0x51b7a1+'/'+_0x78d329)[_0x566f('0x1c')](_0x32e9c6);}return null;};}function patchUpdates(_0x44e89a){return function(_0x7ec63c){try{jsonpatch[_0x566f('0x22')](_0x7ec63c,_0x44e89a,!![]);}catch(_0x5559dd){return BPromise[_0x566f('0x23')](_0x5559dd);}return _0x7ec63c[_0x566f('0x24')]();};}function saveUpdates(_0x4e8b52,_0x58d614){return function(_0x3481cd){if(_0x3481cd){return _0x3481cd['update'](_0x4e8b52)[_0x566f('0x25')](function(_0x4fca21){return _0x4fca21;});}return null;};}function removeEntity(_0x18c5ec,_0x67d470){return function(_0x4cba88){if(_0x4cba88){return _0x4cba88[_0x566f('0x26')]()[_0x566f('0x25')](function(){_0x18c5ec[_0x566f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x498396,_0x82e38c){return function(_0x371ff4){if(!_0x371ff4){_0x498396[_0x566f('0x19')](0x194);}return _0x371ff4;};}function handleError(_0xc83eaf,_0x59c32a){_0x59c32a=_0x59c32a||0x1f4;return function(_0x33842f){logger[_0x566f('0x27')](_0x33842f['stack']);if(_0x33842f['name']){delete _0x33842f[_0x566f('0x28')];}_0xc83eaf['status'](_0x59c32a)[_0x566f('0x29')](_0x33842f);};}exports[_0x566f('0x2a')]=function(_0xb97a84,_0x59433a){var _0x5c4ad8={},_0x4fa19f={},_0x2d0072={'count':0x0,'rows':[]};var _0x4bc3ac=db['CmHopper'][_0x566f('0x2b')];_0x4fa19f['model']=_[_0x566f('0x2c')](_0x4bc3ac);_0x4fa19f[_0x566f('0x2d')]=_[_0x566f('0x2c')](_0xb97a84[_0x566f('0x2d')]);_0x4fa19f['filters']=_['intersection'](_0x4fa19f['model'],_0x4fa19f[_0x566f('0x2d')]);_0x4fa19f[_0x566f('0x2e')]=_[_0x566f('0x2f')](_0x4fa19f['filters'],[_0x566f('0x30'),'$or','$gt',_0x566f('0x31'),_0x566f('0x32'),'$lte',_0x566f('0x33'),_0x566f('0x34'),_0x566f('0x35'),'$between','$notBetween',_0x566f('0x36'),_0x566f('0x37'),_0x566f('0x38'),_0x566f('0x39'),_0x566f('0x3a'),_0x566f('0x3b'),_0x566f('0x38'),'$overlap',_0x566f('0x3c'),_0x566f('0x3d'),'$any']);_0x5c4ad8['attributes']=_['intersection'](_0x4fa19f[_0x566f('0x3e')],qs[_0x566f('0x3f')](_0xb97a84[_0x566f('0x2d')][_0x566f('0x3f')]));_0x5c4ad8[_0x566f('0x40')]=_0x5c4ad8[_0x566f('0x40')][_0x566f('0x41')]?_0x5c4ad8[_0x566f('0x40')]:_0x4fa19f[_0x566f('0x3e')];if(!_0xb97a84[_0x566f('0x2d')][_0x566f('0x42')](_0x566f('0x43'))){_0x5c4ad8[_0x566f('0x1f')]=qs[_0x566f('0x1f')](_0xb97a84[_0x566f('0x2d')][_0x566f('0x1f')]);_0x5c4ad8[_0x566f('0x1e')]=qs[_0x566f('0x1e')](_0xb97a84[_0x566f('0x2d')][_0x566f('0x1e')]);}_0x5c4ad8['order']=qs[_0x566f('0x44')](_0xb97a84['query'][_0x566f('0x44')]);_0x5c4ad8[_0x566f('0x45')]=qs['filters'](_[_0x566f('0x46')](_0xb97a84[_0x566f('0x2d')],_0x4fa19f[_0x566f('0x2e')]));if(_0xb97a84['query'][_0x566f('0x47')]){_0x5c4ad8['where']=_[_0x566f('0x48')](_0x5c4ad8['where'],{'$or':_[_0x566f('0x49')](_0x4bc3ac,function(_0x5da032){if(_0x5da032['type'][_0x566f('0x4a')]!=='VIRTUAL'){var _0x160500={};_0x160500[_0x5da032[_0x566f('0x4b')]]={'$like':'%'+_0xb97a84[_0x566f('0x2d')][_0x566f('0x47')]+'%'};return _0x160500;}})});}_0x5c4ad8=_[_0x566f('0x48')]({},_0x5c4ad8,_0xb97a84[_0x566f('0x4c')]);var _0x4e1b8f={'where':_0x5c4ad8[_0x566f('0x45')]};return db['CmHopper'][_0x566f('0x1d')](_0x4e1b8f)[_0x566f('0x25')](function(_0x337171){_0x2d0072[_0x566f('0x1d')]=_0x337171;if(_0xb97a84[_0x566f('0x2d')]['includeAll']){_0x5c4ad8[_0x566f('0x4d')]=[{'all':!![]}];}return db[_0x566f('0x4e')]['findAll'](_0x5c4ad8);})[_0x566f('0x25')](function(_0xe58575){_0x2d0072[_0x566f('0x4f')]=_0xe58575;return _0x2d0072;})[_0x566f('0x25')](respondWithFilteredResult(_0x59433a,_0x5c4ad8))['catch'](handleError(_0x59433a,null));};exports['show']=function(_0x4dd90e,_0xcd4259){var _0x298412={'raw':!![],'where':{'id':_0x4dd90e[_0x566f('0x50')]['id']}},_0x1bcf1f={};_0x1bcf1f['model']=_[_0x566f('0x2c')](db[_0x566f('0x4e')][_0x566f('0x2b')]);_0x1bcf1f[_0x566f('0x2d')]=_['keys'](_0x4dd90e[_0x566f('0x2d')]);_0x1bcf1f[_0x566f('0x2e')]=_[_0x566f('0x51')](_0x1bcf1f[_0x566f('0x3e')],_0x1bcf1f[_0x566f('0x2d')]);_0x298412['attributes']=_[_0x566f('0x51')](_0x1bcf1f['model'],qs['fields'](_0x4dd90e[_0x566f('0x2d')][_0x566f('0x3f')]));_0x298412[_0x566f('0x40')]=_0x298412[_0x566f('0x40')][_0x566f('0x41')]?_0x298412['attributes']:_0x1bcf1f['model'];if(_0x4dd90e[_0x566f('0x2d')][_0x566f('0x52')]){_0x298412[_0x566f('0x4d')]=[{'all':!![]}];}_0x298412=_[_0x566f('0x48')]({},_0x298412,_0x4dd90e[_0x566f('0x4c')]);return db[_0x566f('0x4e')][_0x566f('0x53')](_0x298412)['then'](handleEntityNotFound(_0xcd4259,null))[_0x566f('0x25')](respondWithResult(_0xcd4259,null))[_0x566f('0x54')](handleError(_0xcd4259,null));};exports[_0x566f('0x55')]=function(_0x40060f,_0x2f2bfe){return db['CmHopper'][_0x566f('0x55')](_0x40060f[_0x566f('0x56')],{})[_0x566f('0x25')](respondWithResult(_0x2f2bfe,0xc9))[_0x566f('0x54')](handleError(_0x2f2bfe,null));};exports[_0x566f('0x57')]=function(_0x11d138,_0x3c329c){if(_0x11d138[_0x566f('0x56')]['id']){delete _0x11d138[_0x566f('0x56')]['id'];}return db[_0x566f('0x4e')][_0x566f('0x53')]({'where':{'id':_0x11d138[_0x566f('0x50')]['id']}})['then'](handleEntityNotFound(_0x3c329c,null))['then'](saveUpdates(_0x11d138[_0x566f('0x56')],null))['then'](respondWithResult(_0x3c329c,null))[_0x566f('0x54')](handleError(_0x3c329c,null));};exports['describe']=function(_0x634c64,_0x32375a){return db[_0x566f('0x4e')][_0x566f('0x58')]()[_0x566f('0x25')](respondWithResult(_0x32375a,null))[_0x566f('0x54')](handleError(_0x32375a,null));};exports[_0x566f('0x26')]=function(_0x59cddd,_0x183b59){var _0xcf73bf;return db[_0x566f('0x4e')][_0x566f('0x53')]({'where':{'id':_0x59cddd[_0x566f('0x50')]['id']}})[_0x566f('0x25')](handleEntityNotFound(_0x183b59,null))[_0x566f('0x25')](function(_0x3b2ca2){if(_0x3b2ca2){return _0x3b2ca2[_0x566f('0x26')]()['then'](function(_0x48b126){return _0x48b126;});}})['then'](function(_0x41dbbb){_0xcf73bf=_0x41dbbb;if(_0x41dbbb){if(_0x41dbbb[_0x566f('0x59')]||_0x41dbbb[_0x566f('0x5a')]){return db[_0x41dbbb[_0x566f('0x59')]?_0x566f('0x5b'):'Campaign'][_0x566f('0x53')]({'where':{'id':_0x41dbbb[_0x566f('0x59')]?_0x41dbbb[_0x566f('0x59')]:_0x41dbbb[_0x566f('0x5a')]},'attributes':['id',_0x566f('0x28')],'raw':!![]});}}})[_0x566f('0x25')](function(_0x21ca8a){var _0xb6cec6={};if(_0x21ca8a){_['merge'](_0xb6cec6,_[_0x566f('0x5c')](_0xcf73bf[_0x566f('0x5d')],[_0x566f('0x5e'),_0x566f('0x5f'),'id']));_0xb6cec6[_0x566f('0x60')]=0x15;_0xb6cec6[_0x566f('0x61')]=_0x566f('0x62');_0xb6cec6['campaign']=_0x21ca8a[_0x566f('0x28')];_0xb6cec6[_0x566f('0x63')]=_0x59cddd[_0x566f('0x64')]['name'];_0xb6cec6['UserId']=_0x59cddd[_0x566f('0x64')]['id'];_0xb6cec6['deleted']=!![];_0xb6cec6[_0x566f('0x65')]=moment()[_0x566f('0x66')](_0x566f('0x67'));_0xb6cec6[_0x566f('0x68')]=_0xcf73bf[_0x566f('0x69')];_0xb6cec6[_0x566f('0x6a')]=_0xcf73bf[_0x566f('0x59')]?_0x566f('0x6b'):'ivr';return db[_0x566f('0x6c')][_0x566f('0x53')]({'where':{'id':_0xb6cec6[_0x566f('0x6d')]},'attributes':[_0x566f('0x6e'),_0x566f('0x6f')]})[_0x566f('0x25')](function(_0xf2f799){if(!_[_0x566f('0x70')](_0x183b59)&&!_['isNil'](_0xf2f799[_0x566f('0x6e')])){_0xb6cec6[_0x566f('0x71')]=_0xf2f799[_0x566f('0x6e')];if(!_[_0x566f('0x70')](_0xf2f799[_0x566f('0x6f')])){_0xb6cec6[_0x566f('0x71')]+='\x20'+_0xf2f799[_0x566f('0x6f')];}}})[_0x566f('0x72')](function(){return db[_0x566f('0x73')]['create'](_0xb6cec6);});}})[_0x566f('0x25')](function(){return _0x183b59['status'](0xcc)[_0x566f('0x1b')]();})[_0x566f('0x54')](handleError(_0x183b59,null));};exports[_0x566f('0x74')]=function(_0x5afdb5,_0x4d3460,_0x343fa1){var _0xb01c2b=[];return db[_0x566f('0x6c')][_0x566f('0x58')]()[_0x566f('0x25')](function(_0x58ef0a){_0xb01c2b=_[_0x566f('0x2c')](_0x58ef0a);return _0x5afdb5[_0x566f('0x64')]['getVoiceQueues']({'where':{'type':_0x566f('0x75'),'dialActive':!![],'dialMethod':_0x566f('0x76')},'attributes':['id',_0x566f('0x77')],'raw':!![]});})[_0x566f('0x25')](function(_0x3b46da){if(_0x3b46da&&_0x3b46da[_0x566f('0x41')]){return db[_0x566f('0x78')][_0x566f('0x79')](function(_0x26e719){var _0x4ddc09={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x566f('0x66')](_0x566f('0x67'))},'VoiceQueueId':{'$in':_[_0x566f('0x49')](_0x3b46da,'id')},'$or':[{'UserId':null},{'UserId':_0x5afdb5['user']['id']}]};var _0x411d35=[];if(_0x5afdb5[_0x566f('0x56')][_0x566f('0x7a')]&&_0x5afdb5[_0x566f('0x56')][_0x566f('0x7a')]===_0x566f('0x7b')){if(!_[_0x566f('0x7c')](_0x5afdb5[_0x566f('0x56')][_0x566f('0x7d')])){_0x4ddc09['id']={'$in':_0x5afdb5[_0x566f('0x56')]['hopperIds']};}_0x411d35=[[_0x566f('0x7e'),_0x566f('0x7f')],['scheduledAt',_0x3b46da[0x0][_0x566f('0x77')]==='ASC'?'DESC':'ASC'],db[_0x566f('0x78')]['literal'](_0x566f('0x80')),['id','DESC']];}else{if(!_[_0x566f('0x7c')](_0x5afdb5[_0x566f('0x56')][_0x566f('0x7d')])){_0x4ddc09['id']={'$notIn':_0x5afdb5['body'][_0x566f('0x7d')]};}_0x411d35=[[_0x566f('0x7e'),'DESC'],[_0x566f('0x81'),_0x3b46da[0x0]['dialOrderByScheduledAt']],db[_0x566f('0x78')][_0x566f('0x82')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x566f('0x7f')]];}return db[_0x566f('0x4e')][_0x566f('0x83')]({'attributes':['id','scheduledat'],'where':_0x4ddc09,'order':_0x411d35,'transaction':_0x26e719,'lock':_0x26e719[_0x566f('0x84')][_0x566f('0x85')],'include':[{'model':db['CmContact'],'as':_0x566f('0x86'),'attributes':_0xb01c2b,'include':[{'model':db[_0x566f('0x87')],'as':_0x566f('0x88'),'attributes':['id','name']}]},{'model':db[_0x566f('0x89')],'as':_0x566f('0x8a'),'attributes':['id',_0x566f('0x28')]},{'model':db[_0x566f('0x5b')],'as':'Queue','attributes':['id',_0x566f('0x28'),_0x566f('0x8b')]}]})[_0x566f('0x25')](function(_0x537330){if(_0x537330){return _0x537330['update']({'UserId':_0x5afdb5[_0x566f('0x64')]['id']},{'transaction':_0x26e719});}});});}})[_0x566f('0x25')](handleEntityNotFound(_0x4d3460,null))['then'](respondWithResult(_0x4d3460,null))[_0x566f('0x54')](handleError(_0x4d3460,null));};exports['getOpenContacts']=function(_0x5811fd,_0x46d59f,_0x270eb2){return _0x5811fd['user']['getVoiceQueues']({'where':{'type':_0x566f('0x75'),'dialActive':!![],'dialMethod':_0x566f('0x76')},'attributes':['id'],'raw':!![]})[_0x566f('0x25')](function(_0x32a96b){if(_0x32a96b&&_0x32a96b[_0x566f('0x41')]){return db[_0x566f('0x4e')][_0x566f('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x566f('0x66')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x566f('0x49')](_0x32a96b,'id')},'$or':[{'UserId':null},{'UserId':_0x5811fd['user']['id']}]}});}return 0x0;})[_0x566f('0x25')](function(_0x4801c9){if(!_[_0x566f('0x70')](_0x4801c9)&&_[_0x566f('0x8c')](_0x4801c9)){return _0x46d59f['status'](0xc8)[_0x566f('0x1c')]({'contacts':_0x4801c9});}else{logger[_0x566f('0x27')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x566f('0x8d'),0x194,'entity\x20not\x20found');_0x46d59f[_0x566f('0x19')](0x194);}})[_0x566f('0x54')](handleError(_0x46d59f,null));};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js
index ffe482e..37795c1 100644
--- a/server/api/cmHopper/cmHopper.model.js
+++ b/server/api/cmHopper/cmHopper.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde2c=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash'];(function(_0x185032,_0x5cacd6){var _0xbc1fb8=function(_0x1b0445){while(--_0x1b0445){_0x185032['push'](_0x185032['shift']());}};_0xbc1fb8(++_0x5cacd6);}(_0xde2c,0x7f));var _0xcde2=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xde2c[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var logger=require(_0xcde2('0x2'))(_0xcde2('0x3'));var moment=require(_0xcde2('0x4'));var BPromise=require(_0xcde2('0x5'));var rp=require(_0xcde2('0x6'));var fs=require('fs');var path=require(_0xcde2('0x7'));var rimraf=require('rimraf');var config=require(_0xcde2('0x8'));var attributes=require(_0xcde2('0x9'));module[_0xcde2('0xa')]=function(_0x1398de,_0x401b16){return _0x1398de['define'](_0xcde2('0xb'),attributes,{'tableName':_0xcde2('0xc'),'paranoid':![],'indexes':[{'name':_0xcde2('0xd'),'fields':['scheduledat']},{'name':'phone','fields':[_0xcde2('0xe')]},{'name':_0xcde2('0xf'),'fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcea2=['request-promise','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','moment','bluebird'];(function(_0x220bb1,_0x494cac){var _0x57bce6=function(_0x2a6418){while(--_0x2a6418){_0x220bb1['push'](_0x220bb1['shift']());}};_0x57bce6(++_0x494cac);}(_0xcea2,0x15a));var _0x2cea=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xcea2[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x2cea('0x0'));var util=require('util');var logger=require(_0x2cea('0x1'))('api');var moment=require(_0x2cea('0x2'));var BPromise=require(_0x2cea('0x3'));var rp=require(_0x2cea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var attributes=require(_0x2cea('0x7'));module['exports']=function(_0x34f0f2,_0x485c26){return _0x34f0f2[_0x2cea('0x8')](_0x2cea('0x9'),attributes,{'tableName':_0x2cea('0xa'),'paranoid':![],'indexes':[{'name':_0x2cea('0xb'),'fields':[_0x2cea('0xb')]},{'name':_0x2cea('0xc'),'fields':['phone']},{'name':_0x2cea('0xd'),'fields':[_0x2cea('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js
index a797448..661ba0f 100644
--- a/server/api/cmHopper/cmHopper.rpc.js
+++ b/server/api/cmHopper/cmHopper.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3b13=['LOCK','UPDATE','Contact','keys','length','push','all','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','update','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','CmHopper','findAll','options','raw','where','limit','include','model','map','attributes','GetCmHopper','stringify','ShowCmHopper','debug','create','body','CreateCmHopper','UpdateCmHopper','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order'];(function(_0x456b45,_0x273834){var _0xe3627d=function(_0x3a6f59){while(--_0x3a6f59){_0x456b45['push'](_0x456b45['shift']());}};_0xe3627d(++_0x273834);}(_0x3b13,0x91));var _0x33b1=function(_0x447b8f,_0x396387){_0x447b8f=_0x447b8f-0x0;var _0x237474=_0x3b13[_0x447b8f];return _0x237474;};'use strict';var _=require('lodash');var util=require(_0x33b1('0x0'));var moment=require(_0x33b1('0x1'));var BPromise=require(_0x33b1('0x2'));var rs=require(_0x33b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x33b1('0x4'));var logger=require(_0x33b1('0x5'))(_0x33b1('0x6'));var config=require('../../config/environment');var jayson=require(_0x33b1('0x7'));var client=jayson[_0x33b1('0x8')][_0x33b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x322616,_0x5b5ded,_0x37efab){return new BPromise(function(_0x39ef67,_0x36a0ab){return client['request'](_0x322616,_0x37efab)[_0x33b1('0xa')](function(_0x5b4ef4){logger[_0x33b1('0xb')](_0x33b1('0xc'),_0x5b5ded,'request\x20sent');logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x5b5ded,_0x33b1('0xd'),JSON['stringify'](_0x5b4ef4));if(_0x5b4ef4['error']){if(_0x5b4ef4['error'][_0x33b1('0xe')]===0x1f4){logger[_0x33b1('0xf')](_0x33b1('0xc'),_0x5b5ded,_0x5b4ef4[_0x33b1('0xf')][_0x33b1('0x10')]);return _0x36a0ab(_0x5b4ef4[_0x33b1('0xf')][_0x33b1('0x10')]);}logger['error'](_0x33b1('0xc'),_0x5b5ded,_0x5b4ef4['error'][_0x33b1('0x10')]);return _0x39ef67(_0x5b4ef4[_0x33b1('0xf')]['message']);}else{logger['info'](_0x33b1('0xc'),_0x5b5ded,_0x33b1('0xd'));_0x39ef67(_0x5b4ef4[_0x33b1('0x11')][_0x33b1('0x10')]);}})[_0x33b1('0x12')](function(_0x3d620f){logger[_0x33b1('0xf')](_0x33b1('0xc'),_0x5b5ded,_0x3d620f);_0x36a0ab(_0x3d620f);});});}exports['GetCmHopper']=function(_0x30883a){var _0x4f97f1=this;return new Promise(function(_0x9b78db,_0x47eb4c){return db[_0x33b1('0x13')][_0x33b1('0x14')]({'raw':_0x30883a[_0x33b1('0x15')]?_0x30883a[_0x33b1('0x15')][_0x33b1('0x16')]===undefined?!![]:![]:!![],'where':_0x30883a[_0x33b1('0x15')]?_0x30883a[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'attributes':_0x30883a[_0x33b1('0x15')]?_0x30883a['options']['attributes']||null:null,'limit':_0x30883a[_0x33b1('0x15')]?_0x30883a[_0x33b1('0x15')][_0x33b1('0x18')]||null:null,'include':_0x30883a[_0x33b1('0x15')]?_0x30883a[_0x33b1('0x15')][_0x33b1('0x19')]?_['map'](_0x30883a[_0x33b1('0x15')][_0x33b1('0x19')],function(_0x2f42a0){return{'model':db[_0x2f42a0[_0x33b1('0x1a')]],'as':_0x2f42a0['as'],'attributes':_0x2f42a0['attributes'],'include':_0x2f42a0[_0x33b1('0x19')]?_[_0x33b1('0x1b')](_0x2f42a0['include'],function(_0x2e9e7f){return{'model':db[_0x2e9e7f[_0x33b1('0x1a')]],'as':_0x2e9e7f['as'],'attributes':_0x2e9e7f[_0x33b1('0x1c')],'include':_0x2e9e7f[_0x33b1('0x19')]?_[_0x33b1('0x1b')](_0x2e9e7f[_0x33b1('0x19')],function(_0x750020){return{'model':db[_0x750020['model']],'as':_0x750020['as'],'attributes':_0x750020[_0x33b1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b6334){logger['info'](_0x33b1('0x1d'),_0x30883a);logger['debug'](_0x33b1('0x1d'),_0x30883a,JSON[_0x33b1('0x1e')](_0x4b6334));_0x9b78db(_0x4b6334);})['catch'](function(_0x23fa12){logger[_0x33b1('0xf')](_0x33b1('0x1d'),_0x23fa12[_0x33b1('0x10')],_0x30883a);_0x47eb4c(_0x4f97f1['error'](0x1f4,_0x23fa12['message']));});});};exports[_0x33b1('0x1f')]=function(_0x128071){var _0x48d90c=this;return new Promise(function(_0x22536e,_0x283514){return db[_0x33b1('0x13')]['find']({'raw':_0x128071[_0x33b1('0x15')]?_0x128071[_0x33b1('0x15')][_0x33b1('0x16')]===undefined?!![]:![]:!![],'where':_0x128071[_0x33b1('0x15')]?_0x128071[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'attributes':_0x128071[_0x33b1('0x15')]?_0x128071['options'][_0x33b1('0x1c')]||null:null,'include':_0x128071['options']?_0x128071[_0x33b1('0x15')][_0x33b1('0x19')]?_[_0x33b1('0x1b')](_0x128071[_0x33b1('0x15')][_0x33b1('0x19')],function(_0x5c7c54){return{'model':db[_0x5c7c54[_0x33b1('0x1a')]],'as':_0x5c7c54['as'],'attributes':_0x5c7c54[_0x33b1('0x1c')],'include':_0x5c7c54['include']?_[_0x33b1('0x1b')](_0x5c7c54[_0x33b1('0x19')],function(_0x49021e){return{'model':db[_0x49021e[_0x33b1('0x1a')]],'as':_0x49021e['as'],'attributes':_0x49021e[_0x33b1('0x1c')],'include':_0x49021e['include']?_['map'](_0x49021e[_0x33b1('0x19')],function(_0x599364){return{'model':db[_0x599364[_0x33b1('0x1a')]],'as':_0x599364['as'],'attributes':_0x599364[_0x33b1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5db223){logger['info']('ShowCmHopper',_0x128071);logger[_0x33b1('0x20')](_0x33b1('0x1f'),_0x128071,JSON[_0x33b1('0x1e')](_0x5db223));_0x22536e(_0x5db223);})[_0x33b1('0x12')](function(_0x2dcbaa){logger[_0x33b1('0xf')](_0x33b1('0x1f'),_0x2dcbaa[_0x33b1('0x10')],_0x128071);_0x283514(_0x48d90c[_0x33b1('0xf')](0x1f4,_0x2dcbaa['message']));});});};exports['CreateCmHopper']=function(_0x4e2cc9){var _0x1df6ad=this;return new Promise(function(_0x52fdb7,_0x52d271){return db[_0x33b1('0x13')][_0x33b1('0x21')](_0x4e2cc9[_0x33b1('0x22')],{'raw':_0x4e2cc9['options']?_0x4e2cc9['options']['raw']===undefined?!![]:![]:!![]})[_0x33b1('0xa')](function(_0x141dea){logger[_0x33b1('0xb')](_0x33b1('0x23'),_0x4e2cc9);logger[_0x33b1('0x20')](_0x33b1('0x23'),_0x4e2cc9,JSON[_0x33b1('0x1e')](_0x141dea));_0x52fdb7(_0x141dea);})[_0x33b1('0x12')](function(_0x1d7532){logger['error'](_0x33b1('0x23'),_0x1d7532[_0x33b1('0x10')],_0x4e2cc9);_0x52d271(_0x1df6ad['error'](0x1f4,_0x1d7532[_0x33b1('0x10')]));});});};exports[_0x33b1('0x24')]=function(_0xf7291a){var _0x2f9760=this;return new Promise(function(_0x49871d,_0x17f932){return db[_0x33b1('0x13')]['update'](_0xf7291a[_0x33b1('0x22')],{'raw':_0xf7291a['options']?_0xf7291a[_0x33b1('0x15')][_0x33b1('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf7291a[_0x33b1('0x15')]?_0xf7291a[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'attributes':_0xf7291a[_0x33b1('0x15')]?_0xf7291a[_0x33b1('0x15')][_0x33b1('0x1c')]||null:null,'limit':_0xf7291a[_0x33b1('0x15')]?_0xf7291a[_0x33b1('0x15')][_0x33b1('0x18')]||null:null})[_0x33b1('0xa')](function(_0x183f3f){logger[_0x33b1('0xb')]('UpdateCmHopper',_0xf7291a);logger[_0x33b1('0x20')](_0x33b1('0x24'),_0xf7291a,JSON[_0x33b1('0x1e')](_0x183f3f));_0x49871d(_0x183f3f);})[_0x33b1('0x12')](function(_0x1f957a){logger[_0x33b1('0xf')](_0x33b1('0x24'),_0x1f957a['message'],_0xf7291a);_0x17f932(_0x2f9760[_0x33b1('0xf')](0x1f4,_0x1f957a[_0x33b1('0x10')]));});});};exports[_0x33b1('0x25')]=function(_0x166500){var _0x370410=this;return new Promise(function(_0x2109b1,_0x44bc53){return db[_0x33b1('0x13')]['destroy']({'where':_0x166500[_0x33b1('0x15')]?_0x166500['options'][_0x33b1('0x17')]||null:null})[_0x33b1('0xa')](function(_0xc7acb4){logger[_0x33b1('0xb')]('DestroyCmHopper',_0x166500);logger[_0x33b1('0x20')](_0x33b1('0x25'),_0x166500,JSON['stringify'](_0xc7acb4));_0x2109b1(_0xc7acb4);})['catch'](function(_0x35e257){logger[_0x33b1('0xf')]('DestroyCmHopper',_0x35e257[_0x33b1('0x10')],_0x166500);_0x44bc53(_0x370410[_0x33b1('0xf')](0x1f4,_0x35e257[_0x33b1('0x10')]));});});};exports[_0x33b1('0x26')]=function(_0x2783be){var _0x406bb1=this;return new Promise(function(_0x5967da,_0x5162c4){return db[_0x33b1('0x27')][_0x33b1('0x28')]()[_0x33b1('0xa')](function(_0x3f83c0){return db[_0x33b1('0x29')][_0x33b1('0x2a')](function(_0x371618){return db[_0x33b1('0x13')]['findAll']({'where':_0x2783be['options']?_0x2783be[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'attributes':_0x2783be[_0x33b1('0x15')]?_0x2783be['options']['attributes']||null:null,'limit':_0x2783be[_0x33b1('0x15')]?_0x2783be[_0x33b1('0x15')][_0x33b1('0x18')]||null:null,'order':_0x2783be[_0x33b1('0x15')]?_0x2783be[_0x33b1('0x15')][_0x33b1('0x2b')]||null:null,'transaction':_0x371618,'lock':_0x371618[_0x33b1('0x2c')][_0x33b1('0x2d')],'include':[{'model':db[_0x33b1('0x27')],'as':_0x33b1('0x2e'),'attributes':_[_0x33b1('0x2f')](_0x3f83c0)}]})[_0x33b1('0xa')](function(_0x56a509){var _0x1fbfe0=[];for(var _0x5e3dfc=0x0;_0x5e3dfc<_0x56a509[_0x33b1('0x30')];_0x5e3dfc+=0x1){_0x1fbfe0[_0x33b1('0x31')](_0x56a509[_0x5e3dfc]['update'](_0x2783be[_0x33b1('0x22')],{'transaction':_0x371618}));}return BPromise[_0x33b1('0x32')](_0x1fbfe0);});})['then'](function(_0x2b032a){logger[_0x33b1('0xb')]('GetContactDialer',_0x2783be);logger[_0x33b1('0x20')](_0x33b1('0x26'),_0x2783be,JSON['stringify'](_0x2b032a));_0x5967da(_0x2b032a);})['catch'](function(_0x2a6696){logger['error'](_0x33b1('0x26'),_0x2a6696[_0x33b1('0x10')],_0x2783be);_0x5162c4(_0x406bb1[_0x33b1('0xf')](0x1f4,_0x2a6696['message']));});});});};exports[_0x33b1('0x33')]=function(_0x2f0ef4){var _0x22b1cd=this;return new Promise(function(_0x318d00,_0x57a56d){return db['sequelize'][_0x33b1('0x2a')](function(_0x37cdab){return db['CmHopperFinal'][_0x33b1('0x21')](_0x2f0ef4[_0x33b1('0x22')],{'raw':_0x2f0ef4[_0x33b1('0x15')]?_0x2f0ef4[_0x33b1('0x15')][_0x33b1('0x16')]===undefined?!![]:![]:!![],'transaction':_0x37cdab})[_0x33b1('0xa')](function(){return db[_0x33b1('0x13')]['destroy']({'where':_0x2f0ef4[_0x33b1('0x15')]?_0x2f0ef4[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'transaction':_0x37cdab});});})['then'](function(_0x33072f){logger[_0x33b1('0xb')](_0x33b1('0x33'),_0x2f0ef4);logger[_0x33b1('0x20')](_0x33b1('0x33'),_0x2f0ef4,JSON[_0x33b1('0x1e')](_0x33072f));_0x318d00(_0x33072f);})[_0x33b1('0x12')](function(_0x315728){logger[_0x33b1('0xf')](_0x33b1('0x33'),_0x315728[_0x33b1('0x10')],_0x2f0ef4);_0x57a56d(_0x22b1cd[_0x33b1('0xf')](0x1f4,_0x315728['message']));});});};exports[_0x33b1('0x34')]=function(_0xb0f9af){var _0x5a1691=this;return new Promise(function(_0x20fce3,_0x579d1c){return db['CmHopper'][_0x33b1('0x14')]({'raw':_0xb0f9af[_0x33b1('0x15')]?_0xb0f9af[_0x33b1('0x15')][_0x33b1('0x16')]===undefined?!![]:![]:!![],'where':_0xb0f9af[_0x33b1('0x15')]?_0xb0f9af[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'attributes':[[db[_0x33b1('0x29')]['fn'](_0x33b1('0x35'),db[_0x33b1('0x29')]['fn']('IF',db[_0x33b1('0x29')][_0x33b1('0x36')](_0x33b1('0x37')+util[_0x33b1('0x38')](_0x33b1('0x39'),moment()[_0x33b1('0x38')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x33b1('0x3a')))),_0x33b1('0x3b')]]})[_0x33b1('0xa')](function(_0x581ddb){logger[_0x33b1('0xb')](_0x33b1('0x34'),_0xb0f9af);logger['debug'](_0x33b1('0x34'),_0xb0f9af,JSON[_0x33b1('0x1e')](_0x581ddb));_0x20fce3(_0x581ddb);})[_0x33b1('0x12')](function(_0x4edd54){logger[_0x33b1('0xf')](_0x33b1('0x34'),_0x4edd54['message'],_0xb0f9af);_0x579d1c(_0x5a1691['error'](0x1f4,_0x4edd54['message']));});});};exports[_0x33b1('0x3c')]=function(_0x596be9){var _0x2d7504=this;return new Promise(function(_0xc87f53,_0x362419){return db[_0x33b1('0x27')][_0x33b1('0x28')]()[_0x33b1('0xa')](function(_0x5ec812){return db[_0x33b1('0x29')][_0x33b1('0x2a')](function(_0xcd733){return db[_0x33b1('0x13')][_0x33b1('0x14')]({'where':_0x596be9[_0x33b1('0x15')]?_0x596be9[_0x33b1('0x15')]['where']||null:null,'attributes':_0x596be9[_0x33b1('0x15')]?_0x596be9[_0x33b1('0x15')]['attributes']||null:null,'limit':0x1,'order':_0x596be9[_0x33b1('0x15')]?_0x596be9[_0x33b1('0x15')][_0x33b1('0x2b')]||null:null,'group':db[_0x33b1('0x13')][_0x33b1('0x3d')],'transaction':_0xcd733,'lock':_0xcd733[_0x33b1('0x2c')][_0x33b1('0x2d')],'include':_0x596be9['options']?_0x596be9[_0x33b1('0x15')][_0x33b1('0x19')]?_['map'](_0x596be9[_0x33b1('0x15')]['include'],function(_0x212e7b){return{'model':db[_0x212e7b[_0x33b1('0x1a')]],'as':_0x212e7b['as'],'attributes':_0x212e7b[_0x33b1('0x1c')],'include':_0x212e7b[_0x33b1('0x19')]?_[_0x33b1('0x1b')](_0x212e7b[_0x33b1('0x19')],function(_0x49da56){return{'model':db[_0x49da56[_0x33b1('0x1a')]],'as':_0x49da56['as'],'attributes':_0x49da56[_0x33b1('0x1c')],'include':_0x49da56[_0x33b1('0x19')]?_[_0x33b1('0x1b')](_0x49da56[_0x33b1('0x19')],function(_0x5aa7e3){return{'model':db[_0x5aa7e3[_0x33b1('0x1a')]],'as':_0x5aa7e3['as'],'attributes':_0x5aa7e3[_0x33b1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x301d2b){var _0x1bea70=[];for(var _0x2dd431=0x0;_0x2dd431<_0x301d2b['length'];_0x2dd431+=0x1){_0x1bea70['push'](_0x301d2b[_0x2dd431][_0x33b1('0x3e')](_0x596be9['body'],{'transaction':_0xcd733}));}return BPromise['all'](_0x1bea70);});})[_0x33b1('0xa')](function(_0x3f0d0b){logger[_0x33b1('0xb')](_0x33b1('0x3c'),_0x596be9);logger[_0x33b1('0x20')](_0x33b1('0x3c'),_0x596be9,JSON[_0x33b1('0x1e')](_0x3f0d0b));_0xc87f53(_0x3f0d0b);})[_0x33b1('0x12')](function(_0x521fb4){logger[_0x33b1('0xf')](_0x33b1('0x3c'),_0x521fb4[_0x33b1('0x10')],_0x596be9);_0x362419(_0x2d7504[_0x33b1('0xf')](0x1f4,_0x521fb4[_0x33b1('0x10')]));});});});};
\ No newline at end of file
+var _0x889c=['info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopper','CmHopper','findAll','options','where','attributes','include','map','model','debug','catch','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','update','raw','limit','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','keys','length','push','all','CmHopperFinal','create','MoveContactManagedDialer','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','GetContactRecallMe','order','UserId','UPDATE','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x889c,0xed));var _0xc889=function(_0x20785c,_0x22cd28){_0x20785c=_0x20785c-0x0;var _0x38dccd=_0x889c[_0x20785c];return _0x38dccd;};'use strict';var _=require('lodash');var util=require(_0xc889('0x0'));var moment=require(_0xc889('0x1'));var BPromise=require('bluebird');var rs=require(_0xc889('0x2'));var fs=require('fs');var Redis=require(_0xc889('0x3'));var db=require(_0xc889('0x4'))['db'];var utils=require(_0xc889('0x5'));var logger=require(_0xc889('0x6'))(_0xc889('0x7'));var config=require('../../config/environment');var jayson=require(_0xc889('0x8'));var client=jayson['client'][_0xc889('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24ada9,_0x4da78d,_0x4dc5f0){return new BPromise(function(_0x466ea5,_0x33f72f){return client['request'](_0x24ada9,_0x4dc5f0)[_0xc889('0xa')](function(_0x1173b8){logger[_0xc889('0xb')](_0xc889('0xc'),_0x4da78d,_0xc889('0xd'));logger['debug'](_0xc889('0xe'),_0x4da78d,_0xc889('0xd'),JSON[_0xc889('0xf')](_0x1173b8));if(_0x1173b8['error']){if(_0x1173b8[_0xc889('0x10')][_0xc889('0x11')]===0x1f4){logger[_0xc889('0x10')]('CmHopper,\x20%s,\x20%s',_0x4da78d,_0x1173b8['error'][_0xc889('0x12')]);return _0x33f72f(_0x1173b8[_0xc889('0x10')][_0xc889('0x12')]);}logger[_0xc889('0x10')](_0xc889('0xc'),_0x4da78d,_0x1173b8[_0xc889('0x10')][_0xc889('0x12')]);return _0x466ea5(_0x1173b8['error'][_0xc889('0x12')]);}else{logger[_0xc889('0xb')](_0xc889('0xc'),_0x4da78d,'request\x20sent');_0x466ea5(_0x1173b8[_0xc889('0x13')][_0xc889('0x12')]);}})['catch'](function(_0x412d7b){logger['error'](_0xc889('0xc'),_0x4da78d,_0x412d7b);_0x33f72f(_0x412d7b);});});}exports[_0xc889('0x14')]=function(_0xa4a495){var _0x1e3aec=this;return new Promise(function(_0x67c45a,_0x315d88){return db[_0xc889('0x15')][_0xc889('0x16')]({'raw':_0xa4a495['options']?_0xa4a495[_0xc889('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xa4a495[_0xc889('0x17')]?_0xa4a495[_0xc889('0x17')][_0xc889('0x18')]||null:null,'attributes':_0xa4a495[_0xc889('0x17')]?_0xa4a495[_0xc889('0x17')][_0xc889('0x19')]||null:null,'limit':_0xa4a495[_0xc889('0x17')]?_0xa4a495['options']['limit']||null:null,'include':_0xa4a495['options']?_0xa4a495[_0xc889('0x17')][_0xc889('0x1a')]?_[_0xc889('0x1b')](_0xa4a495[_0xc889('0x17')][_0xc889('0x1a')],function(_0x5ab915){return{'model':db[_0x5ab915[_0xc889('0x1c')]],'as':_0x5ab915['as'],'attributes':_0x5ab915[_0xc889('0x19')],'include':_0x5ab915[_0xc889('0x1a')]?_[_0xc889('0x1b')](_0x5ab915[_0xc889('0x1a')],function(_0x38e882){return{'model':db[_0x38e882[_0xc889('0x1c')]],'as':_0x38e882['as'],'attributes':_0x38e882[_0xc889('0x19')],'include':_0x38e882[_0xc889('0x1a')]?_['map'](_0x38e882[_0xc889('0x1a')],function(_0x419e9d){return{'model':db[_0x419e9d[_0xc889('0x1c')]],'as':_0x419e9d['as'],'attributes':_0x419e9d[_0xc889('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53845b){logger[_0xc889('0xb')]('GetCmHopper',_0xa4a495);logger[_0xc889('0x1d')](_0xc889('0x14'),_0xa4a495,JSON[_0xc889('0xf')](_0x53845b));_0x67c45a(_0x53845b);})[_0xc889('0x1e')](function(_0x45a3d8){logger[_0xc889('0x10')]('GetCmHopper',_0x45a3d8[_0xc889('0x12')],_0xa4a495);_0x315d88(_0x1e3aec[_0xc889('0x10')](0x1f4,_0x45a3d8['message']));});});};exports['ShowCmHopper']=function(_0x2de937){var _0x1cc7ec=this;return new Promise(function(_0x728364,_0x44c3a2){return db['CmHopper']['find']({'raw':_0x2de937[_0xc889('0x17')]?_0x2de937[_0xc889('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2de937[_0xc889('0x17')]?_0x2de937[_0xc889('0x17')][_0xc889('0x18')]||null:null,'attributes':_0x2de937[_0xc889('0x17')]?_0x2de937[_0xc889('0x17')][_0xc889('0x19')]||null:null,'include':_0x2de937[_0xc889('0x17')]?_0x2de937[_0xc889('0x17')][_0xc889('0x1a')]?_[_0xc889('0x1b')](_0x2de937['options'][_0xc889('0x1a')],function(_0x155ca8){return{'model':db[_0x155ca8[_0xc889('0x1c')]],'as':_0x155ca8['as'],'attributes':_0x155ca8[_0xc889('0x19')],'include':_0x155ca8[_0xc889('0x1a')]?_[_0xc889('0x1b')](_0x155ca8[_0xc889('0x1a')],function(_0x567641){return{'model':db[_0x567641['model']],'as':_0x567641['as'],'attributes':_0x567641[_0xc889('0x19')],'include':_0x567641[_0xc889('0x1a')]?_[_0xc889('0x1b')](_0x567641[_0xc889('0x1a')],function(_0x2871be){return{'model':db[_0x2871be['model']],'as':_0x2871be['as'],'attributes':_0x2871be['attributes']};}):[]};}):[]};}):[]:[]})[_0xc889('0xa')](function(_0x23a0ee){logger[_0xc889('0xb')](_0xc889('0x1f'),_0x2de937);logger['debug'](_0xc889('0x1f'),_0x2de937,JSON[_0xc889('0xf')](_0x23a0ee));_0x728364(_0x23a0ee);})[_0xc889('0x1e')](function(_0x365dfe){logger[_0xc889('0x10')](_0xc889('0x1f'),_0x365dfe[_0xc889('0x12')],_0x2de937);_0x44c3a2(_0x1cc7ec[_0xc889('0x10')](0x1f4,_0x365dfe[_0xc889('0x12')]));});});};exports[_0xc889('0x20')]=function(_0x16f931){var _0x27ae7a=this;return new Promise(function(_0x5ad950,_0x552588){return db['CmHopper']['create'](_0x16f931[_0xc889('0x21')],{'raw':_0x16f931[_0xc889('0x17')]?_0x16f931[_0xc889('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xc889('0xa')](function(_0x224989){logger[_0xc889('0xb')]('CreateCmHopper',_0x16f931);logger[_0xc889('0x1d')]('CreateCmHopper',_0x16f931,JSON[_0xc889('0xf')](_0x224989));_0x5ad950(_0x224989);})[_0xc889('0x1e')](function(_0x282bd7){logger['error'](_0xc889('0x20'),_0x282bd7['message'],_0x16f931);_0x552588(_0x27ae7a[_0xc889('0x10')](0x1f4,_0x282bd7['message']));});});};exports[_0xc889('0x22')]=function(_0x11fce2){var _0x528f06=this;return new Promise(function(_0x1d0f76,_0x48ed43){return db[_0xc889('0x15')][_0xc889('0x23')](_0x11fce2['body'],{'raw':_0x11fce2['options']?_0x11fce2[_0xc889('0x17')][_0xc889('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11fce2[_0xc889('0x17')]?_0x11fce2['options'][_0xc889('0x18')]||null:null,'attributes':_0x11fce2[_0xc889('0x17')]?_0x11fce2[_0xc889('0x17')]['attributes']||null:null,'limit':_0x11fce2[_0xc889('0x17')]?_0x11fce2['options'][_0xc889('0x25')]||null:null})[_0xc889('0xa')](function(_0x62e59f){logger[_0xc889('0xb')](_0xc889('0x22'),_0x11fce2);logger[_0xc889('0x1d')](_0xc889('0x22'),_0x11fce2,JSON[_0xc889('0xf')](_0x62e59f));_0x1d0f76(_0x62e59f);})[_0xc889('0x1e')](function(_0x54cfa7){logger[_0xc889('0x10')](_0xc889('0x22'),_0x54cfa7[_0xc889('0x12')],_0x11fce2);_0x48ed43(_0x528f06[_0xc889('0x10')](0x1f4,_0x54cfa7['message']));});});};exports[_0xc889('0x26')]=function(_0x7646b2){var _0x1dfaf0=this;return new Promise(function(_0x44b21b,_0x237681){return db[_0xc889('0x15')][_0xc889('0x27')]({'where':_0x7646b2[_0xc889('0x17')]?_0x7646b2[_0xc889('0x17')]['where']||null:null})[_0xc889('0xa')](function(_0x5aa55b){logger[_0xc889('0xb')](_0xc889('0x26'),_0x7646b2);logger[_0xc889('0x1d')](_0xc889('0x26'),_0x7646b2,JSON[_0xc889('0xf')](_0x5aa55b));_0x44b21b(_0x5aa55b);})[_0xc889('0x1e')](function(_0x272995){logger['error'](_0xc889('0x26'),_0x272995[_0xc889('0x12')],_0x7646b2);_0x237681(_0x1dfaf0[_0xc889('0x10')](0x1f4,_0x272995[_0xc889('0x12')]));});});};exports[_0xc889('0x28')]=function(_0x34c067){var _0x3eec16=this;return new Promise(function(_0x52a21a,_0xb1fb88){return db[_0xc889('0x29')][_0xc889('0x2a')]()[_0xc889('0xa')](function(_0x981980){return db[_0xc889('0x2b')][_0xc889('0x2c')](function(_0x2eee8f){return db[_0xc889('0x15')][_0xc889('0x16')]({'where':_0x34c067[_0xc889('0x17')]?_0x34c067[_0xc889('0x17')][_0xc889('0x18')]||null:null,'attributes':_0x34c067['options']?_0x34c067[_0xc889('0x17')][_0xc889('0x19')]||null:null,'limit':_0x34c067['options']?_0x34c067[_0xc889('0x17')][_0xc889('0x25')]||null:null,'order':_0x34c067[_0xc889('0x17')]?_0x34c067['options']['order']||null:null,'transaction':_0x2eee8f,'lock':_0x2eee8f[_0xc889('0x2d')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0xc889('0x2e')](_0x981980)}]})[_0xc889('0xa')](function(_0x335f78){var _0x236593=[];for(var _0x24921c=0x0;_0x24921c<_0x335f78[_0xc889('0x2f')];_0x24921c+=0x1){_0x236593[_0xc889('0x30')](_0x335f78[_0x24921c]['update'](_0x34c067['body'],{'transaction':_0x2eee8f}));}return BPromise[_0xc889('0x31')](_0x236593);});})[_0xc889('0xa')](function(_0x416b1d){logger[_0xc889('0xb')](_0xc889('0x28'),_0x34c067);logger['debug']('GetContactDialer',_0x34c067,JSON[_0xc889('0xf')](_0x416b1d));_0x52a21a(_0x416b1d);})[_0xc889('0x1e')](function(_0x2ed665){logger[_0xc889('0x10')](_0xc889('0x28'),_0x2ed665[_0xc889('0x12')],_0x34c067);_0xb1fb88(_0x3eec16[_0xc889('0x10')](0x1f4,_0x2ed665['message']));});});});};exports['MoveContactManagedDialer']=function(_0x3649a2){var _0x5d8dc1=this;return new Promise(function(_0x254401,_0x5a4f48){return db[_0xc889('0x2b')]['transaction'](function(_0xa1f70a){return db[_0xc889('0x32')][_0xc889('0x33')](_0x3649a2[_0xc889('0x21')],{'raw':_0x3649a2[_0xc889('0x17')]?_0x3649a2[_0xc889('0x17')][_0xc889('0x24')]===undefined?!![]:![]:!![],'transaction':_0xa1f70a})[_0xc889('0xa')](function(){return db[_0xc889('0x15')][_0xc889('0x27')]({'where':_0x3649a2['options']?_0x3649a2[_0xc889('0x17')][_0xc889('0x18')]||null:null,'transaction':_0xa1f70a});});})[_0xc889('0xa')](function(_0x1f9e11){logger[_0xc889('0xb')](_0xc889('0x34'),_0x3649a2);logger[_0xc889('0x1d')](_0xc889('0x34'),_0x3649a2,JSON['stringify'](_0x1f9e11));_0x254401(_0x1f9e11);})[_0xc889('0x1e')](function(_0x598527){logger['error'](_0xc889('0x34'),_0x598527[_0xc889('0x12')],_0x3649a2);_0x5a4f48(_0x5d8dc1[_0xc889('0x10')](0x1f4,_0x598527[_0xc889('0x12')]));});});};exports['CountReScheduled']=function(_0x5b7179){var _0x45f59b=this;return new Promise(function(_0x5e2c3d,_0x555a7f){return db[_0xc889('0x15')][_0xc889('0x16')]({'raw':_0x5b7179[_0xc889('0x17')]?_0x5b7179[_0xc889('0x17')][_0xc889('0x24')]===undefined?!![]:![]:!![],'where':_0x5b7179[_0xc889('0x17')]?_0x5b7179['options'][_0xc889('0x18')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xc889('0x35')+util['format']('\x22%s\x22',moment()[_0xc889('0x36')](_0xc889('0x37')))+_0xc889('0x38')))),'contactsRescheduled']]})[_0xc889('0xa')](function(_0x2e265d){logger['info'](_0xc889('0x39'),_0x5b7179);logger['debug']('CountReScheduled',_0x5b7179,JSON[_0xc889('0xf')](_0x2e265d));_0x5e2c3d(_0x2e265d);})[_0xc889('0x1e')](function(_0x325105){logger[_0xc889('0x10')](_0xc889('0x39'),_0x325105[_0xc889('0x12')],_0x5b7179);_0x555a7f(_0x45f59b[_0xc889('0x10')](0x1f4,_0x325105[_0xc889('0x12')]));});});};exports[_0xc889('0x3a')]=function(_0x42e96f){var _0x3cd819=this;return new Promise(function(_0xd522ca,_0x732967){return db[_0xc889('0x29')][_0xc889('0x2a')]()['then'](function(_0x37ce55){return db['sequelize']['transaction'](function(_0x17df85){return db['CmHopper'][_0xc889('0x16')]({'where':_0x42e96f[_0xc889('0x17')]?_0x42e96f[_0xc889('0x17')][_0xc889('0x18')]||null:null,'attributes':_0x42e96f['options']?_0x42e96f[_0xc889('0x17')][_0xc889('0x19')]||null:null,'limit':0x1,'order':_0x42e96f['options']?_0x42e96f[_0xc889('0x17')][_0xc889('0x3b')]||null:null,'group':db[_0xc889('0x15')][_0xc889('0x3c')],'transaction':_0x17df85,'lock':_0x17df85[_0xc889('0x2d')][_0xc889('0x3d')],'include':_0x42e96f['options']?_0x42e96f['options'][_0xc889('0x1a')]?_[_0xc889('0x1b')](_0x42e96f['options'][_0xc889('0x1a')],function(_0x28da17){return{'model':db[_0x28da17['model']],'as':_0x28da17['as'],'attributes':_0x28da17['attributes'],'include':_0x28da17['include']?_[_0xc889('0x1b')](_0x28da17[_0xc889('0x1a')],function(_0x1d54ef){return{'model':db[_0x1d54ef[_0xc889('0x1c')]],'as':_0x1d54ef['as'],'attributes':_0x1d54ef[_0xc889('0x19')],'include':_0x1d54ef[_0xc889('0x1a')]?_['map'](_0x1d54ef[_0xc889('0x1a')],function(_0xfc1e18){return{'model':db[_0xfc1e18[_0xc889('0x1c')]],'as':_0xfc1e18['as'],'attributes':_0xfc1e18[_0xc889('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc889('0xa')](function(_0x366024){var _0xae392a=[];for(var _0x56bf35=0x0;_0x56bf35<_0x366024['length'];_0x56bf35+=0x1){_0xae392a[_0xc889('0x30')](_0x366024[_0x56bf35][_0xc889('0x23')](_0x42e96f[_0xc889('0x21')],{'transaction':_0x17df85}));}return BPromise['all'](_0xae392a);});})[_0xc889('0xa')](function(_0x4d6b46){logger['info'](_0xc889('0x3a'),_0x42e96f);logger[_0xc889('0x1d')](_0xc889('0x3a'),_0x42e96f,JSON[_0xc889('0xf')](_0x4d6b46));_0xd522ca(_0x4d6b46);})[_0xc889('0x1e')](function(_0x4f22c9){logger[_0xc889('0x10')](_0xc889('0x3a'),_0x4f22c9[_0xc889('0x12')],_0x42e96f);_0x732967(_0x3cd819[_0xc889('0x10')](0x1f4,_0x4f22c9[_0xc889('0x12')]));});});});};
\ No newline at end of file
diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js
index 1486c71..b3fa7c4 100644
--- a/server/api/cmHopper/index.js
+++ b/server/api/cmHopper/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x4a82bd,_0x2c2754){var _0x1babe9=function(_0x10772f){while(--_0x10772f){_0x4a82bd['push'](_0x4a82bd['shift']());}};_0x1babe9(++_0x2c2754);}(_0x7a54,0x106));var _0x47a5=function(_0x4d7033,_0x4515cd){_0x4d7033=_0x4d7033-0x0;var _0x25ac99=_0x7a54[_0x4d7033];return _0x25ac99;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router;
\ No newline at end of file
+var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x5a5455,_0x32fa33){var _0x248e59=function(_0x275c26){while(--_0x275c26){_0x5a5455['push'](_0x5a5455['shift']());}};_0x248e59(++_0x32fa33);}(_0x7a54,0x106));var _0x47a5=function(_0x3fde7e,_0x3a7dd5){_0x3fde7e=_0x3fde7e-0x0;var _0x13cc8b=_0x7a54[_0x3fde7e];return _0x13cc8b;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js
index 03391bf..cd931e8 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.attributes.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd7ac=['sequelize','STRING','INTEGER','contactListQueue','moment'];(function(_0x62d0e3,_0x42bd6d){var _0x4579dc=function(_0x809f34){while(--_0x809f34){_0x62d0e3['push'](_0x62d0e3['shift']());}};_0x4579dc(++_0x42bd6d);}(_0xd7ac,0x13a));var _0xcd7a=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xd7ac[_0x12fc8d];return _0x3f9d04;};'use strict';var moment=require(_0xcd7a('0x0'));var Sequelize=require(_0xcd7a('0x1'));module['exports']={'phone':{'type':Sequelize[_0xcd7a('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xcd7a('0x3')],'unique':_0xcd7a('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xcd7a('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xcd7a('0x4')}};
\ No newline at end of file
+var _0xae4f=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x451b29,_0x2124e9){var _0x34d2e7=function(_0x2864cc){while(--_0x2864cc){_0x451b29['push'](_0x451b29['shift']());}};_0x34d2e7(++_0x2124e9);}(_0xae4f,0xca));var _0xfae4=function(_0x25806e,_0x529560){_0x25806e=_0x25806e-0x0;var _0x33364e=_0xae4f[_0x25806e];return _0x33364e;};'use strict';var moment=require(_0xfae4('0x0'));var Sequelize=require(_0xfae4('0x1'));module[_0xfae4('0x2')]={'phone':{'type':Sequelize[_0xfae4('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xfae4('0x4')],'unique':_0xfae4('0x5')},'ListId':{'type':Sequelize[_0xfae4('0x4')],'unique':_0xfae4('0x5')},'VoiceQueueId':{'type':Sequelize[_0xfae4('0x4')],'unique':_0xfae4('0x5')}};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js
index 0270980..c80bd22 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.controller.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d42=['eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','CmHopperBlack','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','key','VIRTUAL','field','merge','options','includeAll','include','findAll','show','rawAttributes','body','find','params','catch','describe','html-pdf'];(function(_0x3060e3,_0x14f2c6){var _0x497d2c=function(_0x2a274a){while(--_0x2a274a){_0x3060e3['push'](_0x3060e3['shift']());}};_0x497d2c(++_0x14f2c6);}(_0x4d42,0x1c1));var _0x24d4=function(_0x37bb50,_0x2444c5){_0x37bb50=_0x37bb50-0x0;var _0x521751=_0x4d42[_0x37bb50];return _0x521751;};'use strict';var pdf=require(_0x24d4('0x0'));var emlformat=require(_0x24d4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x24d4('0x2'));var jsonpatch=require(_0x24d4('0x3'));var rp=require('request-promise');var moment=require(_0x24d4('0x4'));var BPromise=require(_0x24d4('0x5'));var Mustache=require(_0x24d4('0x6'));var util=require(_0x24d4('0x7'));var path=require(_0x24d4('0x8'));var sox=require(_0x24d4('0x9'));var csv=require(_0x24d4('0xa'));var ejs=require(_0x24d4('0xb'));var fs=require('fs');var _=require(_0x24d4('0xc'));var squel=require(_0x24d4('0xd'));var crypto=require(_0x24d4('0xe'));var jsforce=require(_0x24d4('0xf'));var deskjs=require(_0x24d4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x24d4('0x11'));var Papa=require(_0x24d4('0x12'));var Redis=require('ioredis');var authService=require(_0x24d4('0x13'));var qs=require(_0x24d4('0x14'));var hardwareService=require(_0x24d4('0x15'));var logger=require(_0x24d4('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x24d4('0x17'))['db'];function respondWithStatusCode(_0x414401,_0x500efd){_0x500efd=_0x500efd||0xcc;return function(_0x207415){if(_0x207415){return _0x414401[_0x24d4('0x18')](_0x500efd);}return _0x414401[_0x24d4('0x19')](_0x500efd)[_0x24d4('0x1a')]();};}function respondWithResult(_0x443bfb,_0x58a3a3){_0x58a3a3=_0x58a3a3||0xc8;return function(_0xd01689){if(_0xd01689){return _0x443bfb[_0x24d4('0x19')](_0x58a3a3)[_0x24d4('0x1b')](_0xd01689);}};}function respondWithFilteredResult(_0x21dde7,_0x15f0c8){return function(_0x1cd03c){if(_0x1cd03c){var _0x32deb7=_0x1cd03c[_0x24d4('0x1c')],_0x3a12d9=_0x15f0c8['offset'],_0x3b9bfd=_0x15f0c8[_0x24d4('0x1d')]+_0x15f0c8[_0x24d4('0x1e')],_0x59ad84;if(_0x3b9bfd>=_0x32deb7){_0x3b9bfd=_0x32deb7;_0x59ad84=0xc8;}else{_0x59ad84=0xce;}_0x21dde7['status'](_0x59ad84);return _0x21dde7[_0x24d4('0x1f')](_0x24d4('0x20'),_0x3a12d9+'-'+_0x3b9bfd+'/'+_0x32deb7)['json'](_0x1cd03c);}return null;};}function patchUpdates(_0x522d20){return function(_0x1b71e2){try{jsonpatch[_0x24d4('0x21')](_0x1b71e2,_0x522d20,!![]);}catch(_0x4f86c1){return BPromise[_0x24d4('0x22')](_0x4f86c1);}return _0x1b71e2[_0x24d4('0x23')]();};}function saveUpdates(_0x1fe835,_0x502c03){return function(_0x1d6a44){if(_0x1d6a44){return _0x1d6a44[_0x24d4('0x24')](_0x1fe835)[_0x24d4('0x25')](function(_0x49d39c){return _0x49d39c;});}return null;};}function removeEntity(_0x51767d,_0x22b2cb){return function(_0x8b4567){if(_0x8b4567){return _0x8b4567[_0x24d4('0x26')]()[_0x24d4('0x25')](function(){_0x51767d['status'](0xcc)[_0x24d4('0x1a')]();});}};}function handleEntityNotFound(_0x235783,_0x31bfdd){return function(_0x46974f){if(!_0x46974f){_0x235783[_0x24d4('0x18')](0x194);}return _0x46974f;};}function handleError(_0x5041eb,_0x507d56){_0x507d56=_0x507d56||0x1f4;return function(_0x3164ae){logger['error'](_0x3164ae[_0x24d4('0x27')]);if(_0x3164ae[_0x24d4('0x28')]){delete _0x3164ae[_0x24d4('0x28')];}_0x5041eb[_0x24d4('0x19')](_0x507d56)[_0x24d4('0x29')](_0x3164ae);};}exports[_0x24d4('0x2a')]=function(_0x39cddb,_0x344cfb){var _0x10cf8e={},_0x367dde={},_0x406921={'count':0x0,'rows':[]};var _0x517d1a=db[_0x24d4('0x2b')]['rawAttributes'];_0x367dde[_0x24d4('0x2c')]=_['keys'](_0x517d1a);_0x367dde[_0x24d4('0x2d')]=_[_0x24d4('0x2e')](_0x39cddb['query']);_0x367dde[_0x24d4('0x2f')]=_[_0x24d4('0x30')](_0x367dde['model'],_0x367dde[_0x24d4('0x2d')]);_0x10cf8e[_0x24d4('0x31')]=_[_0x24d4('0x30')](_0x367dde['model'],qs[_0x24d4('0x32')](_0x39cddb['query'][_0x24d4('0x32')]));_0x10cf8e[_0x24d4('0x31')]=_0x10cf8e[_0x24d4('0x31')][_0x24d4('0x33')]?_0x10cf8e[_0x24d4('0x31')]:_0x367dde[_0x24d4('0x2c')];if(!_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x34')](_0x24d4('0x35'))){_0x10cf8e[_0x24d4('0x1e')]=qs['limit'](_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x1e')]);_0x10cf8e['offset']=qs[_0x24d4('0x1d')](_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x1d')]);}_0x10cf8e[_0x24d4('0x36')]=qs['sort'](_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x37')]);_0x10cf8e['where']=qs[_0x24d4('0x2f')](_[_0x24d4('0x38')](_0x39cddb[_0x24d4('0x2d')],_0x367dde[_0x24d4('0x2f')]));if(_0x39cddb['query'][_0x24d4('0x39')]){_0x10cf8e[_0x24d4('0x3a')]=_['merge'](_0x10cf8e[_0x24d4('0x3a')],{'$or':_[_0x24d4('0x3b')](_0x517d1a,function(_0x44ee85){if(_0x44ee85['type'][_0x24d4('0x3c')]!==_0x24d4('0x3d')){var _0x43040f={};_0x43040f[_0x44ee85[_0x24d4('0x3e')]]={'$like':'%'+_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x39')]+'%'};return _0x43040f;}})});}_0x10cf8e=_[_0x24d4('0x3f')]({},_0x10cf8e,_0x39cddb[_0x24d4('0x40')]);var _0x5c654d={'where':_0x10cf8e[_0x24d4('0x3a')]};return db[_0x24d4('0x2b')][_0x24d4('0x1c')](_0x5c654d)['then'](function(_0x388243){_0x406921['count']=_0x388243;if(_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x41')]){_0x10cf8e[_0x24d4('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x24d4('0x43')](_0x10cf8e);})[_0x24d4('0x25')](function(_0x269c39){_0x406921['rows']=_0x269c39;return _0x406921;})[_0x24d4('0x25')](respondWithFilteredResult(_0x344cfb,_0x10cf8e))['catch'](handleError(_0x344cfb,null));};exports[_0x24d4('0x44')]=function(_0x5e778b,_0x2a3d92){var _0x7feae8={'raw':!![],'where':{'id':_0x5e778b['params']['id']}},_0x1cc1b9={};_0x1cc1b9[_0x24d4('0x2c')]=_[_0x24d4('0x2e')](db['CmHopperBlack'][_0x24d4('0x45')]);_0x1cc1b9[_0x24d4('0x2d')]=_[_0x24d4('0x2e')](_0x5e778b[_0x24d4('0x2d')]);_0x1cc1b9[_0x24d4('0x2f')]=_[_0x24d4('0x30')](_0x1cc1b9[_0x24d4('0x2c')],_0x1cc1b9['query']);_0x7feae8[_0x24d4('0x31')]=_[_0x24d4('0x30')](_0x1cc1b9[_0x24d4('0x2c')],qs[_0x24d4('0x32')](_0x5e778b['query'][_0x24d4('0x32')]));_0x7feae8[_0x24d4('0x31')]=_0x7feae8[_0x24d4('0x31')][_0x24d4('0x33')]?_0x7feae8[_0x24d4('0x31')]:_0x1cc1b9[_0x24d4('0x2c')];if(_0x5e778b['query'][_0x24d4('0x41')]){_0x7feae8['include']=[{'all':!![]}];}_0x7feae8=_[_0x24d4('0x3f')]({},_0x7feae8,_0x5e778b[_0x24d4('0x40')]);return db['CmHopperBlack']['find'](_0x7feae8)['then'](handleEntityNotFound(_0x2a3d92,null))[_0x24d4('0x25')](respondWithResult(_0x2a3d92,null))['catch'](handleError(_0x2a3d92,null));};exports[_0x24d4('0x24')]=function(_0x5cb312,_0x335472){if(_0x5cb312[_0x24d4('0x46')]['id']){delete _0x5cb312[_0x24d4('0x46')]['id'];}return db['CmHopperBlack'][_0x24d4('0x47')]({'where':{'id':_0x5cb312[_0x24d4('0x48')]['id']}})[_0x24d4('0x25')](handleEntityNotFound(_0x335472,null))[_0x24d4('0x25')](saveUpdates(_0x5cb312[_0x24d4('0x46')],null))['then'](respondWithResult(_0x335472,null))[_0x24d4('0x49')](handleError(_0x335472,null));};exports[_0x24d4('0x26')]=function(_0xecea73,_0x39bca1){return db[_0x24d4('0x2b')][_0x24d4('0x47')]({'where':{'id':_0xecea73[_0x24d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x39bca1,null))['then'](removeEntity(_0x39bca1,null))['catch'](handleError(_0x39bca1,null));};exports[_0x24d4('0x4a')]=function(_0x212051,_0x3a9d64){return db[_0x24d4('0x2b')][_0x24d4('0x4a')]()[_0x24d4('0x25')](respondWithResult(_0x3a9d64,null))[_0x24d4('0x49')](handleError(_0x3a9d64,null));};
\ No newline at end of file
+var _0x8fb2=['length','find','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','map','key','field','filter','includeAll','findAll','rows','catch','show','params'];(function(_0x28546d,_0x180ba8){var _0x4b2831=function(_0x4a302c){while(--_0x4a302c){_0x28546d['push'](_0x28546d['shift']());}};_0x4b2831(++_0x180ba8);}(_0x8fb2,0x162));var _0x28fb=function(_0x481844,_0x259b1f){_0x481844=_0x481844-0x0;var _0x2afc17=_0x8fb2[_0x481844];return _0x2afc17;};'use strict';var pdf=require(_0x28fb('0x0'));var emlformat=require(_0x28fb('0x1'));var rimraf=require(_0x28fb('0x2'));var zipdir=require(_0x28fb('0x3'));var jsonpatch=require(_0x28fb('0x4'));var rp=require(_0x28fb('0x5'));var moment=require(_0x28fb('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x28fb('0x7'));var util=require(_0x28fb('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x28fb('0x9'));var squel=require(_0x28fb('0xa'));var crypto=require('crypto');var jsforce=require(_0x28fb('0xb'));var deskjs=require(_0x28fb('0xc'));var toCsv=require(_0x28fb('0xd'));var querystring=require(_0x28fb('0xe'));var Papa=require('papaparse');var Redis=require(_0x28fb('0xf'));var authService=require(_0x28fb('0x10'));var qs=require(_0x28fb('0x11'));var hardwareService=require(_0x28fb('0x12'));var logger=require(_0x28fb('0x13'))(_0x28fb('0x14'));var utils=require(_0x28fb('0x15'));var config=require('../../config/environment');var db=require(_0x28fb('0x16'))['db'];function respondWithStatusCode(_0x41a6b6,_0x494e52){_0x494e52=_0x494e52||0xcc;return function(_0x353705){if(_0x353705){return _0x41a6b6['sendStatus'](_0x494e52);}return _0x41a6b6['status'](_0x494e52)['end']();};}function respondWithResult(_0x319f3c,_0x5e39c2){_0x5e39c2=_0x5e39c2||0xc8;return function(_0x3a1b8b){if(_0x3a1b8b){return _0x319f3c[_0x28fb('0x17')](_0x5e39c2)[_0x28fb('0x18')](_0x3a1b8b);}};}function respondWithFilteredResult(_0x4160b6,_0x4dad4c){return function(_0xa73e5){if(_0xa73e5){var _0x59ba3c=_0xa73e5[_0x28fb('0x19')],_0x1e7318=_0x4dad4c[_0x28fb('0x1a')],_0x54163c=_0x4dad4c[_0x28fb('0x1a')]+_0x4dad4c[_0x28fb('0x1b')],_0xe5c12e;if(_0x54163c>=_0x59ba3c){_0x54163c=_0x59ba3c;_0xe5c12e=0xc8;}else{_0xe5c12e=0xce;}_0x4160b6['status'](_0xe5c12e);return _0x4160b6[_0x28fb('0x1c')](_0x28fb('0x1d'),_0x1e7318+'-'+_0x54163c+'/'+_0x59ba3c)['json'](_0xa73e5);}return null;};}function patchUpdates(_0x50beca){return function(_0x1e5c73){try{jsonpatch[_0x28fb('0x1e')](_0x1e5c73,_0x50beca,!![]);}catch(_0x3a5b8a){return BPromise[_0x28fb('0x1f')](_0x3a5b8a);}return _0x1e5c73[_0x28fb('0x20')]();};}function saveUpdates(_0x56d162,_0x16c1cd){return function(_0x30a076){if(_0x30a076){return _0x30a076[_0x28fb('0x21')](_0x56d162)[_0x28fb('0x22')](function(_0x5bebb8){return _0x5bebb8;});}return null;};}function removeEntity(_0x2e1013,_0x1f2946){return function(_0xb1c51a){if(_0xb1c51a){return _0xb1c51a[_0x28fb('0x23')]()[_0x28fb('0x22')](function(){_0x2e1013['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4afd97,_0x226a43){return function(_0x6dba9c){if(!_0x6dba9c){_0x4afd97['sendStatus'](0x194);}return _0x6dba9c;};}function handleError(_0xb3b15c,_0x3e8b64){_0x3e8b64=_0x3e8b64||0x1f4;return function(_0xd5c9db){logger[_0x28fb('0x24')](_0xd5c9db[_0x28fb('0x25')]);if(_0xd5c9db[_0x28fb('0x26')]){delete _0xd5c9db['name'];}_0xb3b15c[_0x28fb('0x17')](_0x3e8b64)[_0x28fb('0x27')](_0xd5c9db);};}exports[_0x28fb('0x28')]=function(_0x24e3e4,_0x12dd49){var _0x25778e={},_0x491f8a={},_0x4199ef={'count':0x0,'rows':[]};var _0x1bca82=db[_0x28fb('0x29')][_0x28fb('0x2a')];_0x491f8a[_0x28fb('0x2b')]=_[_0x28fb('0x2c')](_0x1bca82);_0x491f8a['query']=_[_0x28fb('0x2c')](_0x24e3e4[_0x28fb('0x2d')]);_0x491f8a[_0x28fb('0x2e')]=_[_0x28fb('0x2f')](_0x491f8a['model'],_0x491f8a[_0x28fb('0x2d')]);_0x25778e['attributes']=_[_0x28fb('0x2f')](_0x491f8a['model'],qs['fields'](_0x24e3e4[_0x28fb('0x2d')][_0x28fb('0x30')]));_0x25778e[_0x28fb('0x31')]=_0x25778e[_0x28fb('0x31')]['length']?_0x25778e[_0x28fb('0x31')]:_0x491f8a[_0x28fb('0x2b')];if(!_0x24e3e4[_0x28fb('0x2d')][_0x28fb('0x32')]('nolimit')){_0x25778e['limit']=qs[_0x28fb('0x1b')](_0x24e3e4['query'][_0x28fb('0x1b')]);_0x25778e[_0x28fb('0x1a')]=qs[_0x28fb('0x1a')](_0x24e3e4['query'][_0x28fb('0x1a')]);}_0x25778e[_0x28fb('0x33')]=qs[_0x28fb('0x34')](_0x24e3e4[_0x28fb('0x2d')]['sort']);_0x25778e[_0x28fb('0x35')]=qs[_0x28fb('0x2e')](_[_0x28fb('0x36')](_0x24e3e4[_0x28fb('0x2d')],_0x491f8a[_0x28fb('0x2e')]));if(_0x24e3e4[_0x28fb('0x2d')]['filter']){_0x25778e[_0x28fb('0x35')]=_[_0x28fb('0x37')](_0x25778e[_0x28fb('0x35')],{'$or':_[_0x28fb('0x38')](_0x1bca82,function(_0x254c95){if(_0x254c95['type'][_0x28fb('0x39')]!=='VIRTUAL'){var _0x204d2b={};_0x204d2b[_0x254c95[_0x28fb('0x3a')]]={'$like':'%'+_0x24e3e4[_0x28fb('0x2d')][_0x28fb('0x3b')]+'%'};return _0x204d2b;}})});}_0x25778e=_['merge']({},_0x25778e,_0x24e3e4['options']);var _0x37f6e0={'where':_0x25778e['where']};return db[_0x28fb('0x29')]['count'](_0x37f6e0)['then'](function(_0x27cba9){_0x4199ef[_0x28fb('0x19')]=_0x27cba9;if(_0x24e3e4['query'][_0x28fb('0x3c')]){_0x25778e['include']=[{'all':!![]}];}return db[_0x28fb('0x29')][_0x28fb('0x3d')](_0x25778e);})['then'](function(_0x31259b){_0x4199ef[_0x28fb('0x3e')]=_0x31259b;return _0x4199ef;})[_0x28fb('0x22')](respondWithFilteredResult(_0x12dd49,_0x25778e))[_0x28fb('0x3f')](handleError(_0x12dd49,null));};exports[_0x28fb('0x40')]=function(_0x390218,_0x1a5543){var _0x3c4e01={'raw':!![],'where':{'id':_0x390218[_0x28fb('0x41')]['id']}},_0x3d62ed={};_0x3d62ed[_0x28fb('0x2b')]=_['keys'](db['CmHopperBlack'][_0x28fb('0x2a')]);_0x3d62ed['query']=_[_0x28fb('0x2c')](_0x390218[_0x28fb('0x2d')]);_0x3d62ed['filters']=_[_0x28fb('0x2f')](_0x3d62ed[_0x28fb('0x2b')],_0x3d62ed[_0x28fb('0x2d')]);_0x3c4e01[_0x28fb('0x31')]=_[_0x28fb('0x2f')](_0x3d62ed[_0x28fb('0x2b')],qs[_0x28fb('0x30')](_0x390218[_0x28fb('0x2d')][_0x28fb('0x30')]));_0x3c4e01['attributes']=_0x3c4e01[_0x28fb('0x31')][_0x28fb('0x42')]?_0x3c4e01[_0x28fb('0x31')]:_0x3d62ed['model'];if(_0x390218[_0x28fb('0x2d')][_0x28fb('0x3c')]){_0x3c4e01['include']=[{'all':!![]}];}_0x3c4e01=_[_0x28fb('0x37')]({},_0x3c4e01,_0x390218['options']);return db[_0x28fb('0x29')][_0x28fb('0x43')](_0x3c4e01)[_0x28fb('0x22')](handleEntityNotFound(_0x1a5543,null))[_0x28fb('0x22')](respondWithResult(_0x1a5543,null))[_0x28fb('0x3f')](handleError(_0x1a5543,null));};exports[_0x28fb('0x21')]=function(_0x4daaa0,_0x5d3dde){if(_0x4daaa0[_0x28fb('0x44')]['id']){delete _0x4daaa0[_0x28fb('0x44')]['id'];}return db[_0x28fb('0x29')][_0x28fb('0x43')]({'where':{'id':_0x4daaa0['params']['id']}})[_0x28fb('0x22')](handleEntityNotFound(_0x5d3dde,null))[_0x28fb('0x22')](saveUpdates(_0x4daaa0['body'],null))['then'](respondWithResult(_0x5d3dde,null))[_0x28fb('0x3f')](handleError(_0x5d3dde,null));};exports['destroy']=function(_0x1c4846,_0x54d5a4){return db[_0x28fb('0x29')][_0x28fb('0x43')]({'where':{'id':_0x1c4846[_0x28fb('0x41')]['id']}})[_0x28fb('0x22')](handleEntityNotFound(_0x54d5a4,null))[_0x28fb('0x22')](removeEntity(_0x54d5a4,null))['catch'](handleError(_0x54d5a4,null));};exports[_0x28fb('0x45')]=function(_0x95b5af,_0x909f10){return db[_0x28fb('0x29')][_0x28fb('0x45')]()[_0x28fb('0x22')](respondWithResult(_0x909f10,null))[_0x28fb('0x3f')](handleError(_0x909f10,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js
index 89ff080..85c5bdc 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.model.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb43b=['rimraf','../../config/environment','./cmHopperBlack.attributes','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird','path'];(function(_0x377f7f,_0x2e41b){var _0x134b17=function(_0x250d39){while(--_0x250d39){_0x377f7f['push'](_0x377f7f['shift']());}};_0x134b17(++_0x2e41b);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3ca499,_0x1724f0){_0x3ca499=_0x3ca499-0x0;var _0x4cbcd8=_0xb43b[_0x3ca499];return _0x4cbcd8;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb821=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','bluebird'];(function(_0x6da2d8,_0x4dc198){var _0x594160=function(_0x2bc441){while(--_0x2bc441){_0x6da2d8['push'](_0x6da2d8['shift']());}};_0x594160(++_0x4dc198);}(_0xb821,0xa7));var _0x1b82=function(_0x1d4865,_0x32efc7){_0x1d4865=_0x1d4865-0x0;var _0x57aa8b=_0xb821[_0x1d4865];return _0x57aa8b;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js
index b49479f..9a28752 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.rpc.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfe7f=['lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperBlack','findAll','options','where','limit','map','include','model','attributes','GetCmHopperBlack','debug','UpdateCmHopperBlack','update','body','destroy','DestroyCmHopperBlack'];(function(_0x4f6c38,_0x4850dd){var _0x4d5d79=function(_0x136ef4){while(--_0x136ef4){_0x4f6c38['push'](_0x4f6c38['shift']());}};_0x4d5d79(++_0x4850dd);}(_0xfe7f,0x111));var _0xffe7=function(_0x57a342,_0x292014){_0x57a342=_0x57a342-0x0;var _0xc3d159=_0xfe7f[_0x57a342];return _0xc3d159;};'use strict';var _=require(_0xffe7('0x0'));var util=require(_0xffe7('0x1'));var moment=require('moment');var BPromise=require(_0xffe7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffe7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xffe7('0x4'));var logger=require(_0xffe7('0x5'))(_0xffe7('0x6'));var config=require(_0xffe7('0x7'));var jayson=require(_0xffe7('0x8'));var client=jayson[_0xffe7('0x9')][_0xffe7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x589105,_0x16e830,_0x354903){return new BPromise(function(_0x43eeb6,_0x2f9946){return client[_0xffe7('0xb')](_0x589105,_0x354903)[_0xffe7('0xc')](function(_0x3b23f9){logger[_0xffe7('0xd')](_0xffe7('0xe'),_0x16e830,_0xffe7('0xf'));logger['debug'](_0xffe7('0x10'),_0x16e830,_0xffe7('0xf'),JSON[_0xffe7('0x11')](_0x3b23f9));if(_0x3b23f9[_0xffe7('0x12')]){if(_0x3b23f9[_0xffe7('0x12')][_0xffe7('0x13')]===0x1f4){logger[_0xffe7('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x16e830,_0x3b23f9[_0xffe7('0x12')][_0xffe7('0x14')]);return _0x2f9946(_0x3b23f9[_0xffe7('0x12')]['message']);}logger['error'](_0xffe7('0xe'),_0x16e830,_0x3b23f9[_0xffe7('0x12')]['message']);return _0x43eeb6(_0x3b23f9[_0xffe7('0x12')][_0xffe7('0x14')]);}else{logger['info'](_0xffe7('0xe'),_0x16e830,_0xffe7('0xf'));_0x43eeb6(_0x3b23f9[_0xffe7('0x15')]['message']);}})[_0xffe7('0x16')](function(_0x303372){logger[_0xffe7('0x12')](_0xffe7('0xe'),_0x16e830,_0x303372);_0x2f9946(_0x303372);});});}exports['GetCmHopperBlack']=function(_0x543565){var _0x5c0be1=this;return new Promise(function(_0x13d404,_0x2a2900){return db[_0xffe7('0x17')][_0xffe7('0x18')]({'raw':_0x543565['options']?_0x543565['options']['raw']===undefined?!![]:![]:!![],'where':_0x543565[_0xffe7('0x19')]?_0x543565['options'][_0xffe7('0x1a')]||null:null,'attributes':_0x543565[_0xffe7('0x19')]?_0x543565[_0xffe7('0x19')]['attributes']||null:null,'limit':_0x543565[_0xffe7('0x19')]?_0x543565['options'][_0xffe7('0x1b')]||null:null,'include':_0x543565['options']?_0x543565['options']['include']?_[_0xffe7('0x1c')](_0x543565[_0xffe7('0x19')][_0xffe7('0x1d')],function(_0x575950){return{'model':db[_0x575950[_0xffe7('0x1e')]],'as':_0x575950['as'],'attributes':_0x575950[_0xffe7('0x1f')],'include':_0x575950[_0xffe7('0x1d')]?_[_0xffe7('0x1c')](_0x575950['include'],function(_0x327e7b){return{'model':db[_0x327e7b[_0xffe7('0x1e')]],'as':_0x327e7b['as'],'attributes':_0x327e7b[_0xffe7('0x1f')],'include':_0x327e7b[_0xffe7('0x1d')]?_[_0xffe7('0x1c')](_0x327e7b[_0xffe7('0x1d')],function(_0x2b9012){return{'model':db[_0x2b9012[_0xffe7('0x1e')]],'as':_0x2b9012['as'],'attributes':_0x2b9012[_0xffe7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8aedec){logger[_0xffe7('0xd')](_0xffe7('0x20'),_0x543565);logger[_0xffe7('0x21')](_0xffe7('0x20'),_0x543565,JSON[_0xffe7('0x11')](_0x8aedec));_0x13d404(_0x8aedec);})[_0xffe7('0x16')](function(_0x2a8d85){logger[_0xffe7('0x12')](_0xffe7('0x20'),_0x2a8d85['message'],_0x543565);_0x2a2900(_0x5c0be1[_0xffe7('0x12')](0x1f4,_0x2a8d85[_0xffe7('0x14')]));});});};exports[_0xffe7('0x22')]=function(_0x979d10){var _0x5e512f=this;return new Promise(function(_0x3e64f8,_0x4ddeb1){return db[_0xffe7('0x17')][_0xffe7('0x23')](_0x979d10[_0xffe7('0x24')],{'raw':_0x979d10[_0xffe7('0x19')]?_0x979d10[_0xffe7('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x979d10[_0xffe7('0x19')]?_0x979d10['options']['where']||null:null,'attributes':_0x979d10['options']?_0x979d10[_0xffe7('0x19')][_0xffe7('0x1f')]||null:null,'limit':_0x979d10[_0xffe7('0x19')]?_0x979d10[_0xffe7('0x19')][_0xffe7('0x1b')]||null:null})['then'](function(_0x1d1df9){logger[_0xffe7('0xd')](_0xffe7('0x22'),_0x979d10);logger['debug'](_0xffe7('0x22'),_0x979d10,JSON[_0xffe7('0x11')](_0x1d1df9));_0x3e64f8(_0x1d1df9);})[_0xffe7('0x16')](function(_0x2d0d6e){logger[_0xffe7('0x12')](_0xffe7('0x22'),_0x2d0d6e[_0xffe7('0x14')],_0x979d10);_0x4ddeb1(_0x5e512f[_0xffe7('0x12')](0x1f4,_0x2d0d6e['message']));});});};exports['DestroyCmHopperBlack']=function(_0xd7315c){var _0x23732d=this;return new Promise(function(_0xed836,_0x25c76c){return db['CmHopperBlack'][_0xffe7('0x25')]({'where':_0xd7315c[_0xffe7('0x19')]?_0xd7315c['options'][_0xffe7('0x1a')]||null:null})[_0xffe7('0xc')](function(_0x561437){logger['info'](_0xffe7('0x26'),_0xd7315c);logger[_0xffe7('0x21')]('DestroyCmHopperBlack',_0xd7315c,JSON[_0xffe7('0x11')](_0x561437));_0xed836(_0x561437);})['catch'](function(_0x29e83d){logger[_0xffe7('0x12')](_0xffe7('0x26'),_0x29e83d[_0xffe7('0x14')],_0xd7315c);_0x25c76c(_0x23732d['error'](0x1f4,_0x29e83d[_0xffe7('0x14')]));});});};
\ No newline at end of file
+var _0x1bb0=['http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','model','attributes','map','debug','UpdateCmHopperBlack','update','destroy','DestroyCmHopperBlack','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5a1ca2,_0x2d03ad){var _0x3b1bed=function(_0x264303){while(--_0x264303){_0x5a1ca2['push'](_0x5a1ca2['shift']());}};_0x3b1bed(++_0x2d03ad);}(_0x1bb0,0x172));var _0x01bb=function(_0x412f50,_0x1b585d){_0x412f50=_0x412f50-0x0;var _0x20e0c2=_0x1bb0[_0x412f50];return _0x20e0c2;};'use strict';var _=require(_0x01bb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x01bb('0x1'));var rs=require(_0x01bb('0x2'));var fs=require('fs');var Redis=require(_0x01bb('0x3'));var db=require(_0x01bb('0x4'))['db'];var utils=require(_0x01bb('0x5'));var logger=require(_0x01bb('0x6'))(_0x01bb('0x7'));var config=require(_0x01bb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x01bb('0x9')][_0x01bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f1a3c,_0x311065,_0x4c45c0){return new BPromise(function(_0x17e801,_0x38b006){return client[_0x01bb('0xb')](_0x5f1a3c,_0x4c45c0)[_0x01bb('0xc')](function(_0x3622ba){logger[_0x01bb('0xd')](_0x01bb('0xe'),_0x311065,_0x01bb('0xf'));logger['debug'](_0x01bb('0x10'),_0x311065,_0x01bb('0xf'),JSON[_0x01bb('0x11')](_0x3622ba));if(_0x3622ba[_0x01bb('0x12')]){if(_0x3622ba[_0x01bb('0x12')][_0x01bb('0x13')]===0x1f4){logger['error'](_0x01bb('0xe'),_0x311065,_0x3622ba[_0x01bb('0x12')]['message']);return _0x38b006(_0x3622ba['error'][_0x01bb('0x14')]);}logger[_0x01bb('0x12')](_0x01bb('0xe'),_0x311065,_0x3622ba[_0x01bb('0x12')][_0x01bb('0x14')]);return _0x17e801(_0x3622ba[_0x01bb('0x12')][_0x01bb('0x14')]);}else{logger[_0x01bb('0xd')](_0x01bb('0xe'),_0x311065,_0x01bb('0xf'));_0x17e801(_0x3622ba['result']['message']);}})[_0x01bb('0x15')](function(_0x5bf8c6){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x311065,_0x5bf8c6);_0x38b006(_0x5bf8c6);});});}exports[_0x01bb('0x16')]=function(_0x4a46de){var _0x2c047f=this;return new Promise(function(_0x4808b4,_0x216cba){return db[_0x01bb('0x17')][_0x01bb('0x18')]({'raw':_0x4a46de[_0x01bb('0x19')]?_0x4a46de[_0x01bb('0x19')][_0x01bb('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a46de[_0x01bb('0x19')]?_0x4a46de[_0x01bb('0x19')][_0x01bb('0x1b')]||null:null,'attributes':_0x4a46de[_0x01bb('0x19')]?_0x4a46de['options']['attributes']||null:null,'limit':_0x4a46de[_0x01bb('0x19')]?_0x4a46de[_0x01bb('0x19')][_0x01bb('0x1c')]||null:null,'include':_0x4a46de[_0x01bb('0x19')]?_0x4a46de[_0x01bb('0x19')][_0x01bb('0x1d')]?_['map'](_0x4a46de[_0x01bb('0x19')][_0x01bb('0x1d')],function(_0x409b35){return{'model':db[_0x409b35[_0x01bb('0x1e')]],'as':_0x409b35['as'],'attributes':_0x409b35[_0x01bb('0x1f')],'include':_0x409b35['include']?_[_0x01bb('0x20')](_0x409b35[_0x01bb('0x1d')],function(_0x3c579f){return{'model':db[_0x3c579f[_0x01bb('0x1e')]],'as':_0x3c579f['as'],'attributes':_0x3c579f[_0x01bb('0x1f')],'include':_0x3c579f[_0x01bb('0x1d')]?_['map'](_0x3c579f[_0x01bb('0x1d')],function(_0x47f748){return{'model':db[_0x47f748['model']],'as':_0x47f748['as'],'attributes':_0x47f748[_0x01bb('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4baaae){logger[_0x01bb('0xd')]('GetCmHopperBlack',_0x4a46de);logger[_0x01bb('0x21')](_0x01bb('0x16'),_0x4a46de,JSON[_0x01bb('0x11')](_0x4baaae));_0x4808b4(_0x4baaae);})[_0x01bb('0x15')](function(_0x43d986){logger['error'](_0x01bb('0x16'),_0x43d986[_0x01bb('0x14')],_0x4a46de);_0x216cba(_0x2c047f['error'](0x1f4,_0x43d986[_0x01bb('0x14')]));});});};exports[_0x01bb('0x22')]=function(_0x1538ac){var _0x27dd93=this;return new Promise(function(_0x155e49,_0x505676){return db[_0x01bb('0x17')][_0x01bb('0x23')](_0x1538ac['body'],{'raw':_0x1538ac[_0x01bb('0x19')]?_0x1538ac[_0x01bb('0x19')][_0x01bb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1538ac[_0x01bb('0x19')]?_0x1538ac[_0x01bb('0x19')][_0x01bb('0x1b')]||null:null,'attributes':_0x1538ac[_0x01bb('0x19')]?_0x1538ac[_0x01bb('0x19')][_0x01bb('0x1f')]||null:null,'limit':_0x1538ac['options']?_0x1538ac[_0x01bb('0x19')][_0x01bb('0x1c')]||null:null})[_0x01bb('0xc')](function(_0x24ff90){logger['info'](_0x01bb('0x22'),_0x1538ac);logger[_0x01bb('0x21')]('UpdateCmHopperBlack',_0x1538ac,JSON[_0x01bb('0x11')](_0x24ff90));_0x155e49(_0x24ff90);})[_0x01bb('0x15')](function(_0x463572){logger[_0x01bb('0x12')](_0x01bb('0x22'),_0x463572[_0x01bb('0x14')],_0x1538ac);_0x505676(_0x27dd93[_0x01bb('0x12')](0x1f4,_0x463572[_0x01bb('0x14')]));});});};exports['DestroyCmHopperBlack']=function(_0x429f55){var _0x9000ac=this;return new Promise(function(_0x738aea,_0x6a7aed){return db[_0x01bb('0x17')][_0x01bb('0x24')]({'where':_0x429f55[_0x01bb('0x19')]?_0x429f55[_0x01bb('0x19')][_0x01bb('0x1b')]||null:null})[_0x01bb('0xc')](function(_0x5aa7bf){logger['info'](_0x01bb('0x25'),_0x429f55);logger[_0x01bb('0x21')](_0x01bb('0x25'),_0x429f55,JSON[_0x01bb('0x11')](_0x5aa7bf));_0x738aea(_0x5aa7bf);})[_0x01bb('0x15')](function(_0x526f31){logger[_0x01bb('0x12')]('DestroyCmHopperBlack',_0x526f31[_0x01bb('0x14')],_0x429f55);_0x6a7aed(_0x9000ac[_0x01bb('0x12')](0x1f4,_0x526f31[_0x01bb('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js
index 9551c54..3c371a0 100644
--- a/server/api/cmHopperBlack/index.js
+++ b/server/api/cmHopperBlack/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2da1=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','update','delete','destroy','multer','util'];(function(_0x34b819,_0x2db518){var _0x463ab2=function(_0x2a8a29){while(--_0x2a8a29){_0x34b819['push'](_0x34b819['shift']());}};_0x463ab2(++_0x2db518);}(_0x2da1,0xca));var _0x12da=function(_0x44edb0,_0x7a1d21){_0x44edb0=_0x44edb0-0x0;var _0x38dbd0=_0x2da1[_0x44edb0];return _0x38dbd0;};'use strict';var multer=require(_0x12da('0x0'));var util=require(_0x12da('0x1'));var path=require('path');var timeout=require(_0x12da('0x2'));var express=require('express');var router=express[_0x12da('0x3')]();var auth=require(_0x12da('0x4'));var interaction=require(_0x12da('0x5'));var config=require(_0x12da('0x6'));var controller=require('./cmHopperBlack.controller');router[_0x12da('0x7')]('/',auth[_0x12da('0x8')](),controller[_0x12da('0x9')]);router[_0x12da('0x7')](_0x12da('0xa'),auth[_0x12da('0x8')](),controller[_0x12da('0xb')]);router['get'](_0x12da('0xc'),auth[_0x12da('0x8')](),controller[_0x12da('0xd')]);router['put'](_0x12da('0xc'),auth[_0x12da('0x8')](),controller[_0x12da('0xe')]);router[_0x12da('0xf')](_0x12da('0xc'),auth['isAuthenticated'](),controller[_0x12da('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x2fb5=['multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','/:id','put','update','delete','destroy'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x2fb5,0xff));var _0x52fb=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0x2fb5[_0x595bd1];return _0xd0344f;};'use strict';var multer=require(_0x52fb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x52fb('0x1'));var express=require(_0x52fb('0x2'));var router=express[_0x52fb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x52fb('0x4'));var config=require(_0x52fb('0x5'));var controller=require(_0x52fb('0x6'));router[_0x52fb('0x7')]('/',auth['isAuthenticated'](),controller[_0x52fb('0x8')]);router['get'](_0x52fb('0x9'),auth[_0x52fb('0xa')](),controller[_0x52fb('0xb')]);router[_0x52fb('0x7')](_0x52fb('0xc'),auth[_0x52fb('0xa')](),controller['show']);router[_0x52fb('0xd')]('/:id',auth[_0x52fb('0xa')](),controller[_0x52fb('0xe')]);router[_0x52fb('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x52fb('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js
index 03a35c5..d7cfd0e 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.attributes.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb11a=['seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff'];(function(_0x85c4ac,_0x1930fd){var _0x53a7dd=function(_0x73a84d){while(--_0x73a84d){_0x85c4ac['push'](_0x85c4ac['shift']());}};_0x53a7dd(++_0x1930fd);}(_0xb11a,0x81));var _0xab11=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xb11a[_0x231e16];return _0x570a7c;};'use strict';var Sequelize=require(_0xab11('0x0'));var moment=require(_0xab11('0x1'));module[_0xab11('0x2')]={'state':{'type':Sequelize[_0xab11('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xab11('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xab11('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xab11('0x4')]},'originatecalleridname':{'type':Sequelize[_0xab11('0x4')]},'calleridnum':{'type':Sequelize[_0xab11('0x4')]},'calleridname':{'type':Sequelize[_0xab11('0x4')]},'starttime':{'type':Sequelize[_0xab11('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xab11('0x5')]},'droptime':{'type':Sequelize[_0xab11('0x5')]},'endtime':{'type':Sequelize[_0xab11('0x5')]},'ringtime':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xab11('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xab11('0x5')],'set':function(_0x206820){var _0x458704=this[_0xab11('0x6')](_0xab11('0x7'));if(_0x458704&&_0x206820){this[_0xab11('0x8')](_0xab11('0x9'),moment(_0x206820)[_0xab11('0xa')](moment(_0x458704),_0xab11('0xb')));}return this[_0xab11('0x8')](_0xab11('0xc'),_0x206820);}},'amd':{'type':Sequelize[_0xab11('0xd')],'defaultValue':![]},'fax':{'type':Sequelize[_0xab11('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xab11('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xab11('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xab11('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xab11('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xab11('0x5')]},'deleted':{'type':Sequelize[_0xab11('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xab11('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xab11('0x5')]}};
\ No newline at end of file
+var _0xbbd0=['getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE'];(function(_0x2fab53,_0x5c322c){var _0x2092e2=function(_0x82e039){while(--_0x82e039){_0x2fab53['push'](_0x2fab53['shift']());}};_0x2092e2(++_0x5c322c);}(_0xbbd0,0x96));var _0x0bbd=function(_0x137024,_0x1751d6){_0x137024=_0x137024-0x0;var _0x357726=_0xbbd0[_0x137024];return _0x357726;};'use strict';var Sequelize=require(_0x0bbd('0x0'));var moment=require(_0x0bbd('0x1'));module[_0x0bbd('0x2')]={'state':{'type':Sequelize[_0x0bbd('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x0bbd('0x4')]},'scheduledat':{'type':Sequelize[_0x0bbd('0x5')]},'countbusyretry':{'type':Sequelize[_0x0bbd('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0bbd('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0bbd('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0bbd('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x0bbd('0x4')]},'originatecalleridname':{'type':Sequelize[_0x0bbd('0x4')]},'calleridnum':{'type':Sequelize[_0x0bbd('0x4')]},'calleridname':{'type':Sequelize[_0x0bbd('0x4')]},'starttime':{'type':Sequelize[_0x0bbd('0x5')]},'responsetime':{'type':Sequelize[_0x0bbd('0x5')]},'answertime':{'type':Sequelize[_0x0bbd('0x5')]},'droptime':{'type':Sequelize[_0x0bbd('0x5')]},'endtime':{'type':Sequelize[_0x0bbd('0x5')]},'ringtime':{'type':Sequelize[_0x0bbd('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0bbd('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0bbd('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0bbd('0x4')]},'campaign':{'type':Sequelize[_0x0bbd('0x4')]},'campaigntype':{'type':Sequelize[_0x0bbd('0x4')]},'membername':{'type':Sequelize[_0x0bbd('0x4')]},'reason':{'type':Sequelize[_0x0bbd('0x4')]},'disposition':{'type':Sequelize[_0x0bbd('0x4')]},'dispositionat':{'type':Sequelize[_0x0bbd('0x5')],'set':function(_0x245951){var _0x18ec75=this[_0x0bbd('0x6')](_0x0bbd('0x7'));if(_0x18ec75&&_0x245951){this[_0x0bbd('0x8')](_0x0bbd('0x9'),moment(_0x245951)[_0x0bbd('0xa')](moment(_0x18ec75),_0x0bbd('0xb')));}return this[_0x0bbd('0x8')]('dispositionat',_0x245951);}},'amd':{'type':Sequelize[_0x0bbd('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0bbd('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0bbd('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0bbd('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x0bbd('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0bbd('0x5')]},'deleted':{'type':Sequelize[_0x0bbd('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0bbd('0x5')]},'recallme':{'type':Sequelize[_0x0bbd('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0bbd('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js
index d525211..f298d70 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.controller.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x25d4=['literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','ContactId','VoiceQueueId','select','ANY_VALUE(calleridnum)','phone','NOW()','scheduledAt','field','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','createdAt','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','VoiceQueueId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','updatedAt','ANY_VALUE(CampaignId)','state\x20=\x20?','checkContactHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','key','options','CmHopperFinal','includeAll','include','findAll','catch','params','length','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT'];(function(_0x5464ab,_0x329d11){var _0x15432c=function(_0x451994){while(--_0x451994){_0x5464ab['push'](_0x5464ab['shift']());}};_0x15432c(++_0x329d11);}(_0x25d4,0xb1));var _0x425d=function(_0x395635,_0x18927d){_0x395635=_0x395635-0x0;var _0xf99470=_0x25d4[_0x395635];return _0xf99470;};'use strict';var pdf=require(_0x425d('0x0'));var emlformat=require(_0x425d('0x1'));var rimraf=require(_0x425d('0x2'));var zipdir=require(_0x425d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x425d('0x4'));var moment=require(_0x425d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x425d('0x6'));var util=require('util');var path=require(_0x425d('0x7'));var sox=require(_0x425d('0x8'));var csv=require(_0x425d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x425d('0xa'));var squel=require('squel');var crypto=require(_0x425d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x425d('0x9'));var querystring=require(_0x425d('0xc'));var Papa=require(_0x425d('0xd'));var Redis=require(_0x425d('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x425d('0xf'));var logger=require('../../config/logger')(_0x425d('0x10'));var utils=require('../../config/utils');var config=require(_0x425d('0x11'));var db=require(_0x425d('0x12'))['db'];function respondWithStatusCode(_0x194056,_0x299d14){_0x299d14=_0x299d14||0xcc;return function(_0x295a13){if(_0x295a13){return _0x194056[_0x425d('0x13')](_0x299d14);}return _0x194056[_0x425d('0x14')](_0x299d14)[_0x425d('0x15')]();};}function respondWithResult(_0x4b697c,_0x2729b8){_0x2729b8=_0x2729b8||0xc8;return function(_0x22a390){if(_0x22a390){return _0x4b697c[_0x425d('0x14')](_0x2729b8)[_0x425d('0x16')](_0x22a390);}};}function respondWithFilteredResult(_0x2573c3,_0x36b7eb){return function(_0x2fe443){if(_0x2fe443){var _0x10ea9c=_0x2fe443[_0x425d('0x17')],_0x359454=_0x36b7eb[_0x425d('0x18')],_0xb03bf=_0x36b7eb[_0x425d('0x18')]+_0x36b7eb[_0x425d('0x19')],_0x523a81;if(_0xb03bf>=_0x10ea9c){_0xb03bf=_0x10ea9c;_0x523a81=0xc8;}else{_0x523a81=0xce;}_0x2573c3[_0x425d('0x14')](_0x523a81);return _0x2573c3[_0x425d('0x1a')](_0x425d('0x1b'),_0x359454+'-'+_0xb03bf+'/'+_0x10ea9c)[_0x425d('0x16')](_0x2fe443);}return null;};}function patchUpdates(_0x1be86c){return function(_0x597c14){try{jsonpatch['apply'](_0x597c14,_0x1be86c,!![]);}catch(_0x98f68e){return BPromise[_0x425d('0x1c')](_0x98f68e);}return _0x597c14[_0x425d('0x1d')]();};}function saveUpdates(_0x4368ab,_0x402dec){return function(_0xd8765b){if(_0xd8765b){return _0xd8765b[_0x425d('0x1e')](_0x4368ab)[_0x425d('0x1f')](function(_0x2e0257){return _0x2e0257;});}return null;};}function removeEntity(_0x4fe28b,_0x2a2e22){return function(_0x3bd80c){if(_0x3bd80c){return _0x3bd80c[_0x425d('0x20')]()[_0x425d('0x1f')](function(){_0x4fe28b[_0x425d('0x14')](0xcc)[_0x425d('0x15')]();});}};}function handleEntityNotFound(_0xb63164,_0x205738){return function(_0x3a8169){if(!_0x3a8169){_0xb63164[_0x425d('0x13')](0x194);}return _0x3a8169;};}function handleError(_0x33639b,_0xae083f){_0xae083f=_0xae083f||0x1f4;return function(_0x1ff3f7){logger[_0x425d('0x21')](_0x1ff3f7['stack']);if(_0x1ff3f7[_0x425d('0x22')]){delete _0x1ff3f7[_0x425d('0x22')];}_0x33639b[_0x425d('0x14')](_0xae083f)[_0x425d('0x23')](_0x1ff3f7);};}exports[_0x425d('0x24')]=function(_0x434a62,_0x3332c8){var _0x10b6ea={},_0x4c891b={},_0xe62b86={'count':0x0,'rows':[]};var _0x46feb8=db['CmHopperFinal'][_0x425d('0x25')];_0x4c891b[_0x425d('0x26')]=_[_0x425d('0x27')](_0x46feb8);_0x4c891b[_0x425d('0x28')]=_[_0x425d('0x27')](_0x434a62[_0x425d('0x28')]);_0x4c891b[_0x425d('0x29')]=_['intersection'](_0x4c891b[_0x425d('0x26')],_0x4c891b[_0x425d('0x28')]);_0x10b6ea[_0x425d('0x2a')]=_[_0x425d('0x2b')](_0x4c891b['model'],qs[_0x425d('0x2c')](_0x434a62[_0x425d('0x28')]['fields']));_0x10b6ea[_0x425d('0x2a')]=_0x10b6ea['attributes']['length']?_0x10b6ea[_0x425d('0x2a')]:_0x4c891b[_0x425d('0x26')];if(!_0x434a62['query'][_0x425d('0x2d')](_0x425d('0x2e'))){_0x10b6ea['limit']=qs['limit'](_0x434a62[_0x425d('0x28')][_0x425d('0x19')]);_0x10b6ea[_0x425d('0x18')]=qs[_0x425d('0x18')](_0x434a62[_0x425d('0x28')][_0x425d('0x18')]);}_0x10b6ea['order']=qs['sort'](_0x434a62[_0x425d('0x28')][_0x425d('0x2f')]);_0x10b6ea[_0x425d('0x30')]=qs[_0x425d('0x29')](_[_0x425d('0x31')](_0x434a62[_0x425d('0x28')],_0x4c891b[_0x425d('0x29')]));if(_0x434a62[_0x425d('0x28')][_0x425d('0x32')]){_0x10b6ea[_0x425d('0x30')]=_[_0x425d('0x33')](_0x10b6ea[_0x425d('0x30')],{'$or':_[_0x425d('0x34')](_0x46feb8,function(_0x126a37){if(_0x126a37['type'][_0x425d('0x35')]!=='VIRTUAL'){var _0x3f2cdf={};_0x3f2cdf[_0x126a37['field']]={'$like':'%'+_0x434a62[_0x425d('0x28')][_0x425d('0x32')]+'%'};return _0x3f2cdf;}})});}_0x10b6ea=_['merge']({},_0x10b6ea,_0x434a62[_0x425d('0x36')]);var _0x3f803d={'where':_0x10b6ea['where']};return db[_0x425d('0x37')][_0x425d('0x17')](_0x3f803d)[_0x425d('0x1f')](function(_0x265e11){_0xe62b86['count']=_0x265e11;if(_0x434a62[_0x425d('0x28')][_0x425d('0x38')]){_0x10b6ea[_0x425d('0x39')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x425d('0x3a')](_0x10b6ea);})[_0x425d('0x1f')](function(_0x8a09cc){_0xe62b86['rows']=_0x8a09cc;return _0xe62b86;})['then'](respondWithFilteredResult(_0x3332c8,_0x10b6ea))[_0x425d('0x3b')](handleError(_0x3332c8,null));};exports['show']=function(_0x29eba2,_0x2c16a8){var _0x223462={'raw':!![],'where':{'id':_0x29eba2[_0x425d('0x3c')]['id']}},_0x2c7afc={};_0x2c7afc['model']=_[_0x425d('0x27')](db[_0x425d('0x37')][_0x425d('0x25')]);_0x2c7afc['query']=_[_0x425d('0x27')](_0x29eba2[_0x425d('0x28')]);_0x2c7afc[_0x425d('0x29')]=_['intersection'](_0x2c7afc[_0x425d('0x26')],_0x2c7afc[_0x425d('0x28')]);_0x223462[_0x425d('0x2a')]=_[_0x425d('0x2b')](_0x2c7afc[_0x425d('0x26')],qs['fields'](_0x29eba2['query']['fields']));_0x223462['attributes']=_0x223462[_0x425d('0x2a')][_0x425d('0x3d')]?_0x223462[_0x425d('0x2a')]:_0x2c7afc['model'];if(_0x29eba2['query'][_0x425d('0x38')]){_0x223462[_0x425d('0x39')]=[{'all':!![]}];}_0x223462=_[_0x425d('0x33')]({},_0x223462,_0x29eba2[_0x425d('0x36')]);return db[_0x425d('0x37')]['find'](_0x223462)[_0x425d('0x1f')](handleEntityNotFound(_0x2c16a8,null))[_0x425d('0x1f')](respondWithResult(_0x2c16a8,null))[_0x425d('0x3b')](handleError(_0x2c16a8,null));};exports[_0x425d('0x3e')]=function(_0xb70748,_0x1dfda5){return db[_0x425d('0x37')][_0x425d('0x3e')]()[_0x425d('0x1f')](respondWithResult(_0x1dfda5,null))['catch'](handleError(_0x1dfda5,null));};exports[_0x425d('0x1e')]=function(_0x1d64b5,_0x132cac){if(_0x1d64b5[_0x425d('0x3f')]['uniqueid']){delete _0x1d64b5[_0x425d('0x3f')][_0x425d('0x40')];}return db[_0x425d('0x37')][_0x425d('0x41')]({'where':{'uniqueid':_0x1d64b5[_0x425d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x132cac,null))[_0x425d('0x1f')](saveUpdates(_0x1d64b5[_0x425d('0x3f')],null))[_0x425d('0x1f')](respondWithResult(_0x132cac,null))['catch'](handleError(_0x132cac,null));};exports[_0x425d('0x42')]=function(_0x21a943,_0x101fef,_0x2dcfbd){return db[_0x425d('0x37')][_0x425d('0x3a')]({'raw':![],'where':{'VoiceQueueId':_0x21a943[_0x425d('0x3c')]['id']},'attributes':[[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x46')))),_0x425d('0x47')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db['sequelize'][_0x425d('0x45')](_0x425d('0x48')))),'noAnswerContacts'],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x49')))),_0x425d('0x4a')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db['sequelize'][_0x425d('0x45')](_0x425d('0x4b')))),_0x425d('0x4c')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x4d')))),_0x425d('0x4e')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x425d('0x4f')))),_0x425d('0x50')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db['sequelize'][_0x425d('0x45')](_0x425d('0x51')))),_0x425d('0x52')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x53')))),_0x425d('0x54')]]})[_0x425d('0x1f')](handleEntityNotFound(_0x101fef,null))[_0x425d('0x1f')](respondWithResult(_0x101fef,null))[_0x425d('0x3b')](handleError(_0x101fef,null));};exports[_0x425d('0x55')]=function(_0x1d30ab,_0x5b1115,_0x5d0a3f){return db['CmHopperFinal'][_0x425d('0x3a')]({'raw':![],'where':{'CampaignId':_0x1d30ab[_0x425d('0x3c')]['id']},'attributes':[[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db[_0x425d('0x43')]['literal'](_0x425d('0x46')))),'noSuchContacts'],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')]('`state`\x20=\x203,\x201,\x20null'))),_0x425d('0x56')],[db['sequelize']['fn']('COUNT',db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x425d('0x4a')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')]('`state`\x20=\x208,\x201,\x20null'))),_0x425d('0x4c')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db['sequelize'][_0x425d('0x45')](_0x425d('0x4d')))),'dropContacts'],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x4f')))),'abandonedContacts'],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x51')))),'reCallContacts'],[db['sequelize']['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x53')))),_0x425d('0x54')]]})[_0x425d('0x1f')](handleEntityNotFound(_0x5b1115,null))[_0x425d('0x1f')](respondWithResult(_0x5b1115,null))[_0x425d('0x3b')](handleError(_0x5b1115,null));};exports[_0x425d('0x57')]=function(_0x127854,_0x251c40,_0xa8c839){return db[_0x425d('0x58')]['find']({'where':{'id':_0x127854[_0x425d('0x3c')]['id']}})[_0x425d('0x1f')](handleEntityNotFound(_0x251c40,null))['then'](function(_0x1ca879){var _0x5260fa;if(_0x1ca879){_0x5260fa=squel[_0x425d('0x59')]()['into'](_0x425d('0x5a'))[_0x425d('0x5b')](['phone','scheduledAt',_0x425d('0x5c'),'ListId',_0x425d('0x5d'),'createdAt','updatedAt'],squel[_0x425d('0x5e')]()['field'](_0x425d('0x5f'),_0x425d('0x60'))['field'](_0x425d('0x61'),_0x425d('0x62'))[_0x425d('0x63')](_0x425d('0x64'),_0x425d('0x5c'))['field']('ANY_VALUE(ListId)',_0x425d('0x65'))['field'](_0x425d('0x66'),_0x425d('0x5d'))[_0x425d('0x63')]('NOW()',_0x425d('0x67'))[_0x425d('0x63')](_0x425d('0x61'),'updatedAt')[_0x425d('0x68')](_0x425d('0x69'))[_0x425d('0x30')]('VoiceQueueId\x20=\x20?',_0x127854[_0x425d('0x3c')]['id'][_0x425d('0x6a')]())[_0x425d('0x30')]('state\x20=\x20?',_0x127854['body'][_0x425d('0x6b')][_0x425d('0x6a')]())[_0x425d('0x30')](_0x425d('0x6c'))[_0x425d('0x30')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x425d('0x5e')]()[_0x425d('0x63')](_0x425d('0x60'))[_0x425d('0x68')]('cm_hopper')[_0x425d('0x30')](_0x425d('0x6d'),_0x127854['params']['id']['toString']()))[_0x425d('0x30')](_0x425d('0x6e'),squel[_0x425d('0x5e')]()[_0x425d('0x63')](_0x425d('0x6f'))[_0x425d('0x68')](_0x425d('0x69'))['where'](_0x425d('0x6d'),_0x127854[_0x425d('0x3c')]['id'][_0x425d('0x6a')]())[_0x425d('0x30')](_0x425d('0x70')))[_0x425d('0x71')](_0x425d('0x5c')))[_0x425d('0x6a')]();return db['sequelize'][_0x425d('0x28')](_0x5260fa);}return[];})['then'](respondWithResult(_0x251c40,null))[_0x425d('0x3b')](handleError(_0x251c40,null));};exports[_0x425d('0x72')]=function(_0x537644,_0x3a550a,_0x445d92){return db[_0x425d('0x73')]['find']({'where':{'id':_0x537644[_0x425d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3a550a,null))[_0x425d('0x1f')](function(_0x10d9b7){var _0x44152e;if(_0x10d9b7){_0x44152e=squel[_0x425d('0x59')]()[_0x425d('0x74')](_0x425d('0x5a'))[_0x425d('0x5b')]([_0x425d('0x60'),_0x425d('0x62'),_0x425d('0x5c'),'ListId',_0x425d('0x75'),_0x425d('0x67'),_0x425d('0x76')],squel[_0x425d('0x5e')]()[_0x425d('0x63')](_0x425d('0x5f'),_0x425d('0x60'))[_0x425d('0x63')](_0x425d('0x61'),'scheduledAt')['field'](_0x425d('0x64'),'ContactId')[_0x425d('0x63')]('ANY_VALUE(ListId)',_0x425d('0x65'))[_0x425d('0x63')](_0x425d('0x77'),_0x425d('0x75'))[_0x425d('0x63')](_0x425d('0x61'),_0x425d('0x67'))[_0x425d('0x63')](_0x425d('0x61'),'updatedAt')[_0x425d('0x68')](_0x425d('0x69'))[_0x425d('0x30')]('CampaignId\x20=\x20?',_0x537644[_0x425d('0x3c')]['id'][_0x425d('0x6a')]())['where'](_0x425d('0x78'),_0x537644[_0x425d('0x3f')][_0x425d('0x6b')]['toString']())['where'](_0x425d('0x6c'))[_0x425d('0x30')](_0x425d('0x6e'),squel[_0x425d('0x5e')]()['field'](_0x425d('0x60'))[_0x425d('0x68')](_0x425d('0x5a'))[_0x425d('0x30')]('CampaignId\x20=\x20?',_0x537644['params']['id'][_0x425d('0x6a')]()))[_0x425d('0x30')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x425d('0x63')]('calleridnum')['from'](_0x425d('0x69'))[_0x425d('0x30')]('CampaignId\x20=\x20?',_0x537644[_0x425d('0x3c')]['id'][_0x425d('0x6a')]())[_0x425d('0x30')]('state\x20=\x204'))[_0x425d('0x71')](_0x425d('0x5c')))[_0x425d('0x6a')]();return db[_0x425d('0x43')][_0x425d('0x28')](_0x44152e);}return[];})[_0x425d('0x1f')](respondWithResult(_0x3a550a,null))['catch'](handleError(_0x3a550a,null));};exports[_0x425d('0x79')]=function(_0x133594,_0x42e26a,_0x4eaf66){return db['CmHopper'][_0x425d('0x7a')]({'where':{'VoiceQueueId':_0x133594[_0x425d('0x3f')][_0x425d('0x5d')],'CampaignId':_0x133594[_0x425d('0x3f')][_0x425d('0x75')],'ContactId':_0x133594[_0x425d('0x3f')][_0x425d('0x5c')]}})[_0x425d('0x1f')](handleEntityNotFound(_0x42e26a,null))[_0x425d('0x1f')](function(_0x1edeaf){if(_0x1edeaf){return _0x1edeaf;}return null;})['then'](respondWithResult(_0x42e26a,null))['catch'](handleError(_0x42e26a,null));};
\ No newline at end of file
+var _0x14ad=['into','ListId','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','error','stack','name','send','index','CmHopperFinal','rawAttributes','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','params','model','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','literal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','ContactId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','from','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign'];(function(_0x403484,_0x33b8ba){var _0x55b2bc=function(_0x1f9b3a){while(--_0x1f9b3a){_0x403484['push'](_0x403484['shift']());}};_0x55b2bc(++_0x33b8ba);}(_0x14ad,0x8b));var _0xd14a=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x14ad[_0x6cf19c];return _0xce14f3;};'use strict';var pdf=require(_0xd14a('0x0'));var emlformat=require(_0xd14a('0x1'));var rimraf=require(_0xd14a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd14a('0x3'));var BPromise=require(_0xd14a('0x4'));var Mustache=require(_0xd14a('0x5'));var util=require('util');var path=require(_0xd14a('0x6'));var sox=require(_0xd14a('0x7'));var csv=require(_0xd14a('0x8'));var ejs=require(_0xd14a('0x9'));var fs=require('fs');var _=require(_0xd14a('0xa'));var squel=require(_0xd14a('0xb'));var crypto=require(_0xd14a('0xc'));var jsforce=require(_0xd14a('0xd'));var deskjs=require(_0xd14a('0xe'));var toCsv=require(_0xd14a('0x8'));var querystring=require('querystring');var Papa=require(_0xd14a('0xf'));var Redis=require('ioredis');var authService=require(_0xd14a('0x10'));var qs=require(_0xd14a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd14a('0x12'))(_0xd14a('0x13'));var utils=require(_0xd14a('0x14'));var config=require(_0xd14a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27052c,_0x2dc009){_0x2dc009=_0x2dc009||0xcc;return function(_0x2a24d7){if(_0x2a24d7){return _0x27052c[_0xd14a('0x16')](_0x2dc009);}return _0x27052c[_0xd14a('0x17')](_0x2dc009)[_0xd14a('0x18')]();};}function respondWithResult(_0x298ef1,_0x4feeb5){_0x4feeb5=_0x4feeb5||0xc8;return function(_0x2f0b66){if(_0x2f0b66){return _0x298ef1['status'](_0x4feeb5)[_0xd14a('0x19')](_0x2f0b66);}};}function respondWithFilteredResult(_0x4fa89a,_0x53983e){return function(_0x2af33f){if(_0x2af33f){var _0x43623f=_0x2af33f[_0xd14a('0x1a')],_0x43b579=_0x53983e[_0xd14a('0x1b')],_0x33c308=_0x53983e['offset']+_0x53983e[_0xd14a('0x1c')],_0x235472;if(_0x33c308>=_0x43623f){_0x33c308=_0x43623f;_0x235472=0xc8;}else{_0x235472=0xce;}_0x4fa89a[_0xd14a('0x17')](_0x235472);return _0x4fa89a[_0xd14a('0x1d')](_0xd14a('0x1e'),_0x43b579+'-'+_0x33c308+'/'+_0x43623f)[_0xd14a('0x19')](_0x2af33f);}return null;};}function patchUpdates(_0x489745){return function(_0x1c226e){try{jsonpatch['apply'](_0x1c226e,_0x489745,!![]);}catch(_0x599f75){return BPromise[_0xd14a('0x1f')](_0x599f75);}return _0x1c226e[_0xd14a('0x20')]();};}function saveUpdates(_0xee670e,_0x58526c){return function(_0x409a09){if(_0x409a09){return _0x409a09[_0xd14a('0x21')](_0xee670e)['then'](function(_0x588d18){return _0x588d18;});}return null;};}function removeEntity(_0x5994c5,_0x2b6f06){return function(_0x281171){if(_0x281171){return _0x281171['destroy']()['then'](function(){_0x5994c5[_0xd14a('0x17')](0xcc)[_0xd14a('0x18')]();});}};}function handleEntityNotFound(_0x508bb3,_0x4ef99a){return function(_0x542c35){if(!_0x542c35){_0x508bb3[_0xd14a('0x16')](0x194);}return _0x542c35;};}function handleError(_0x575e27,_0x1cece2){_0x1cece2=_0x1cece2||0x1f4;return function(_0x45ee3f){logger[_0xd14a('0x22')](_0x45ee3f[_0xd14a('0x23')]);if(_0x45ee3f[_0xd14a('0x24')]){delete _0x45ee3f[_0xd14a('0x24')];}_0x575e27[_0xd14a('0x17')](_0x1cece2)[_0xd14a('0x25')](_0x45ee3f);};}exports[_0xd14a('0x26')]=function(_0xc153ca,_0x5b4ffc){var _0x4220f6={},_0x354367={},_0xda5cfc={'count':0x0,'rows':[]};var _0xf14431=db[_0xd14a('0x27')][_0xd14a('0x28')];_0x354367['model']=_[_0xd14a('0x29')](_0xf14431);_0x354367[_0xd14a('0x2a')]=_['keys'](_0xc153ca[_0xd14a('0x2a')]);_0x354367[_0xd14a('0x2b')]=_[_0xd14a('0x2c')](_0x354367['model'],_0x354367[_0xd14a('0x2a')]);_0x4220f6[_0xd14a('0x2d')]=_[_0xd14a('0x2c')](_0x354367['model'],qs['fields'](_0xc153ca[_0xd14a('0x2a')][_0xd14a('0x2e')]));_0x4220f6['attributes']=_0x4220f6['attributes']['length']?_0x4220f6[_0xd14a('0x2d')]:_0x354367['model'];if(!_0xc153ca[_0xd14a('0x2a')][_0xd14a('0x2f')](_0xd14a('0x30'))){_0x4220f6[_0xd14a('0x1c')]=qs[_0xd14a('0x1c')](_0xc153ca[_0xd14a('0x2a')][_0xd14a('0x1c')]);_0x4220f6['offset']=qs[_0xd14a('0x1b')](_0xc153ca['query'][_0xd14a('0x1b')]);}_0x4220f6[_0xd14a('0x31')]=qs[_0xd14a('0x32')](_0xc153ca[_0xd14a('0x2a')][_0xd14a('0x32')]);_0x4220f6[_0xd14a('0x33')]=qs[_0xd14a('0x2b')](_[_0xd14a('0x34')](_0xc153ca[_0xd14a('0x2a')],_0x354367[_0xd14a('0x2b')]));if(_0xc153ca[_0xd14a('0x2a')][_0xd14a('0x35')]){_0x4220f6[_0xd14a('0x33')]=_[_0xd14a('0x36')](_0x4220f6[_0xd14a('0x33')],{'$or':_[_0xd14a('0x37')](_0xf14431,function(_0xc09216){if(_0xc09216[_0xd14a('0x38')][_0xd14a('0x39')]!==_0xd14a('0x3a')){var _0x175ef7={};_0x175ef7[_0xc09216['field']]={'$like':'%'+_0xc153ca[_0xd14a('0x2a')]['filter']+'%'};return _0x175ef7;}})});}_0x4220f6=_[_0xd14a('0x36')]({},_0x4220f6,_0xc153ca[_0xd14a('0x3b')]);var _0x46a19c={'where':_0x4220f6[_0xd14a('0x33')]};return db[_0xd14a('0x27')]['count'](_0x46a19c)['then'](function(_0x29b56e){_0xda5cfc[_0xd14a('0x1a')]=_0x29b56e;if(_0xc153ca[_0xd14a('0x2a')][_0xd14a('0x3c')]){_0x4220f6[_0xd14a('0x3d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd14a('0x3e')](_0x4220f6);})[_0xd14a('0x3f')](function(_0x3dea0d){_0xda5cfc[_0xd14a('0x40')]=_0x3dea0d;return _0xda5cfc;})[_0xd14a('0x3f')](respondWithFilteredResult(_0x5b4ffc,_0x4220f6))[_0xd14a('0x41')](handleError(_0x5b4ffc,null));};exports[_0xd14a('0x42')]=function(_0x236fdd,_0x454c98){var _0x372582={'raw':!![],'where':{'id':_0x236fdd[_0xd14a('0x43')]['id']}},_0x3e75a3={};_0x3e75a3[_0xd14a('0x44')]=_[_0xd14a('0x29')](db['CmHopperFinal'][_0xd14a('0x28')]);_0x3e75a3[_0xd14a('0x2a')]=_[_0xd14a('0x29')](_0x236fdd[_0xd14a('0x2a')]);_0x3e75a3[_0xd14a('0x2b')]=_[_0xd14a('0x2c')](_0x3e75a3[_0xd14a('0x44')],_0x3e75a3[_0xd14a('0x2a')]);_0x372582[_0xd14a('0x2d')]=_[_0xd14a('0x2c')](_0x3e75a3[_0xd14a('0x44')],qs[_0xd14a('0x2e')](_0x236fdd[_0xd14a('0x2a')][_0xd14a('0x2e')]));_0x372582[_0xd14a('0x2d')]=_0x372582['attributes']['length']?_0x372582[_0xd14a('0x2d')]:_0x3e75a3[_0xd14a('0x44')];if(_0x236fdd[_0xd14a('0x2a')][_0xd14a('0x3c')]){_0x372582[_0xd14a('0x3d')]=[{'all':!![]}];}_0x372582=_['merge']({},_0x372582,_0x236fdd['options']);return db[_0xd14a('0x27')][_0xd14a('0x45')](_0x372582)[_0xd14a('0x3f')](handleEntityNotFound(_0x454c98,null))[_0xd14a('0x3f')](respondWithResult(_0x454c98,null))['catch'](handleError(_0x454c98,null));};exports[_0xd14a('0x46')]=function(_0x37f06e,_0x4837a7){return db[_0xd14a('0x27')][_0xd14a('0x46')]()[_0xd14a('0x3f')](respondWithResult(_0x4837a7,null))[_0xd14a('0x41')](handleError(_0x4837a7,null));};exports[_0xd14a('0x21')]=function(_0x33e270,_0x89afbd){if(_0x33e270[_0xd14a('0x47')][_0xd14a('0x48')]){delete _0x33e270[_0xd14a('0x47')][_0xd14a('0x48')];}return db[_0xd14a('0x27')][_0xd14a('0x45')]({'where':{'uniqueid':_0x33e270[_0xd14a('0x43')]['id']}})[_0xd14a('0x3f')](handleEntityNotFound(_0x89afbd,null))[_0xd14a('0x3f')](saveUpdates(_0x33e270['body'],null))[_0xd14a('0x3f')](respondWithResult(_0x89afbd,null))[_0xd14a('0x41')](handleError(_0x89afbd,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0xf68c0c,_0x22d0d8,_0x5a399b){return db[_0xd14a('0x27')][_0xd14a('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0xf68c0c['params']['id']},'attributes':[[db[_0xd14a('0x49')]['fn'](_0xd14a('0x4a'),db[_0xd14a('0x49')]['fn']('IF',db[_0xd14a('0x49')]['literal'](_0xd14a('0x4b')))),_0xd14a('0x4c')],[db[_0xd14a('0x49')]['fn'](_0xd14a('0x4a'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xd14a('0x4d')],[db[_0xd14a('0x49')]['fn'](_0xd14a('0x4a'),db[_0xd14a('0x49')]['fn']('IF',db[_0xd14a('0x49')][_0xd14a('0x4e')](_0xd14a('0x4f')))),'busyContacts'],[db[_0xd14a('0x49')]['fn'](_0xd14a('0x4a'),db[_0xd14a('0x49')]['fn']('IF',db[_0xd14a('0x49')][_0xd14a('0x4e')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn'](_0xd14a('0x4a'),db[_0xd14a('0x49')]['fn']('IF',db['sequelize']['literal'](_0xd14a('0x50')))),_0xd14a('0x51')],[db[_0xd14a('0x49')]['fn'](_0xd14a('0x4a'),db[_0xd14a('0x49')]['fn']('IF',db[_0xd14a('0x49')]['literal'](_0xd14a('0x52')))),_0xd14a('0x53')],[db[_0xd14a('0x49')]['fn'](_0xd14a('0x4a'),db[_0xd14a('0x49')]['fn']('IF',db[_0xd14a('0x49')][_0xd14a('0x4e')](_0xd14a('0x54')))),_0xd14a('0x55')],[db['sequelize']['fn'](_0xd14a('0x4a'),db[_0xd14a('0x49')]['fn']('IF',db[_0xd14a('0x49')][_0xd14a('0x4e')](_0xd14a('0x56')))),_0xd14a('0x57')]]})['then'](handleEntityNotFound(_0x22d0d8,null))[_0xd14a('0x3f')](respondWithResult(_0x22d0d8,null))[_0xd14a('0x41')](handleError(_0x22d0d8,null));};exports[_0xd14a('0x58')]=function(_0x1d7cc9,_0x2f7cb5,_0x91dcf1){return db[_0xd14a('0x27')]['findAll']({'raw':![],'where':{'CampaignId':_0x1d7cc9[_0xd14a('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0xd14a('0x4a'),db[_0xd14a('0x49')]['fn']('IF',db[_0xd14a('0x49')][_0xd14a('0x4e')](_0xd14a('0x4b')))),'noSuchContacts'],[db[_0xd14a('0x49')]['fn'](_0xd14a('0x4a'),db[_0xd14a('0x49')]['fn']('IF',db[_0xd14a('0x49')][_0xd14a('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0xd14a('0x4d')],[db['sequelize']['fn'](_0xd14a('0x4a'),db['sequelize']['fn']('IF',db[_0xd14a('0x49')][_0xd14a('0x4e')](_0xd14a('0x4f')))),_0xd14a('0x59')],[db[_0xd14a('0x49')]['fn']('COUNT',db[_0xd14a('0x49')]['fn']('IF',db['sequelize'][_0xd14a('0x4e')](_0xd14a('0x5a')))),'congestionContacts'],[db[_0xd14a('0x49')]['fn']('COUNT',db[_0xd14a('0x49')]['fn']('IF',db['sequelize'][_0xd14a('0x4e')](_0xd14a('0x50')))),_0xd14a('0x51')],[db[_0xd14a('0x49')]['fn'](_0xd14a('0x4a'),db['sequelize']['fn']('IF',db[_0xd14a('0x49')][_0xd14a('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xd14a('0x53')],[db[_0xd14a('0x49')]['fn']('COUNT',db[_0xd14a('0x49')]['fn']('IF',db[_0xd14a('0x49')][_0xd14a('0x4e')](_0xd14a('0x54')))),_0xd14a('0x55')],[db[_0xd14a('0x49')]['fn']('COUNT',db[_0xd14a('0x49')]['fn']('IF',db[_0xd14a('0x49')][_0xd14a('0x4e')](_0xd14a('0x56')))),_0xd14a('0x57')]]})[_0xd14a('0x3f')](handleEntityNotFound(_0x2f7cb5,null))[_0xd14a('0x3f')](respondWithResult(_0x2f7cb5,null))['catch'](handleError(_0x2f7cb5,null));};exports[_0xd14a('0x5b')]=function(_0x244eb3,_0x14200f,_0x28d6e4){return db[_0xd14a('0x5c')][_0xd14a('0x45')]({'where':{'id':_0x244eb3[_0xd14a('0x43')]['id']}})['then'](handleEntityNotFound(_0x14200f,null))[_0xd14a('0x3f')](function(_0x900ca0){var _0x512582;if(_0x900ca0){_0x512582=squel[_0xd14a('0x5d')]()['into'](_0xd14a('0x5e'))[_0xd14a('0x5f')]([_0xd14a('0x60'),'scheduledAt',_0xd14a('0x61'),'ListId','VoiceQueueId',_0xd14a('0x62'),_0xd14a('0x63')],squel[_0xd14a('0x64')]()[_0xd14a('0x65')](_0xd14a('0x66'),'phone')[_0xd14a('0x65')](_0xd14a('0x67'),_0xd14a('0x68'))[_0xd14a('0x65')](_0xd14a('0x69'),_0xd14a('0x61'))[_0xd14a('0x65')](_0xd14a('0x6a'),'ListId')[_0xd14a('0x65')](_0xd14a('0x6b'),_0xd14a('0x6c'))[_0xd14a('0x65')](_0xd14a('0x67'),_0xd14a('0x62'))[_0xd14a('0x65')]('NOW()','updatedAt')['from']('cm_hopper_final')[_0xd14a('0x33')](_0xd14a('0x6d'),_0x244eb3[_0xd14a('0x43')]['id'][_0xd14a('0x6e')]())[_0xd14a('0x33')](_0xd14a('0x6f'),_0x244eb3[_0xd14a('0x47')][_0xd14a('0x70')][_0xd14a('0x6e')]())[_0xd14a('0x33')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xd14a('0x33')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xd14a('0x65')](_0xd14a('0x60'))[_0xd14a('0x71')]('cm_hopper')[_0xd14a('0x33')]('VoiceQueueId\x20=\x20?',_0x244eb3['params']['id'][_0xd14a('0x6e')]()))[_0xd14a('0x33')](_0xd14a('0x72'),squel['select']()['field'](_0xd14a('0x73'))[_0xd14a('0x71')](_0xd14a('0x74'))[_0xd14a('0x33')](_0xd14a('0x6d'),_0x244eb3['params']['id'][_0xd14a('0x6e')]())[_0xd14a('0x33')](_0xd14a('0x75')))[_0xd14a('0x76')]('ContactId'))['toString']();return db['sequelize'][_0xd14a('0x2a')](_0x512582);}return[];})[_0xd14a('0x3f')](respondWithResult(_0x14200f,null))[_0xd14a('0x41')](handleError(_0x14200f,null));};exports[_0xd14a('0x77')]=function(_0xeb0cf9,_0x59351d,_0x30fbc4){return db[_0xd14a('0x78')][_0xd14a('0x45')]({'where':{'id':_0xeb0cf9[_0xd14a('0x43')]['id']}})[_0xd14a('0x3f')](handleEntityNotFound(_0x59351d,null))[_0xd14a('0x3f')](function(_0x2c6870){var _0x7320d5;if(_0x2c6870){_0x7320d5=squel[_0xd14a('0x5d')]()[_0xd14a('0x79')](_0xd14a('0x5e'))[_0xd14a('0x5f')]([_0xd14a('0x60'),_0xd14a('0x68'),'ContactId',_0xd14a('0x7a'),_0xd14a('0x7b'),'createdAt',_0xd14a('0x63')],squel[_0xd14a('0x64')]()[_0xd14a('0x65')](_0xd14a('0x66'),_0xd14a('0x60'))[_0xd14a('0x65')](_0xd14a('0x67'),_0xd14a('0x68'))[_0xd14a('0x65')](_0xd14a('0x69'),'ContactId')[_0xd14a('0x65')](_0xd14a('0x6a'),_0xd14a('0x7a'))['field'](_0xd14a('0x7c'),_0xd14a('0x7b'))['field'](_0xd14a('0x67'),_0xd14a('0x62'))[_0xd14a('0x65')](_0xd14a('0x67'),_0xd14a('0x63'))[_0xd14a('0x71')](_0xd14a('0x74'))[_0xd14a('0x33')](_0xd14a('0x7d'),_0xeb0cf9[_0xd14a('0x43')]['id'][_0xd14a('0x6e')]())['where'](_0xd14a('0x6f'),_0xeb0cf9[_0xd14a('0x47')][_0xd14a('0x70')]['toString']())[_0xd14a('0x33')](_0xd14a('0x7e'))['where'](_0xd14a('0x72'),squel['select']()[_0xd14a('0x65')]('phone')[_0xd14a('0x71')]('cm_hopper')['where'](_0xd14a('0x7d'),_0xeb0cf9[_0xd14a('0x43')]['id'][_0xd14a('0x6e')]()))[_0xd14a('0x33')](_0xd14a('0x72'),squel['select']()[_0xd14a('0x65')]('calleridnum')[_0xd14a('0x71')](_0xd14a('0x74'))[_0xd14a('0x33')](_0xd14a('0x7d'),_0xeb0cf9[_0xd14a('0x43')]['id'][_0xd14a('0x6e')]())['where'](_0xd14a('0x75')))['group']('ContactId'))['toString']();return db[_0xd14a('0x49')][_0xd14a('0x2a')](_0x7320d5);}return[];})[_0xd14a('0x3f')](respondWithResult(_0x59351d,null))['catch'](handleError(_0x59351d,null));};exports[_0xd14a('0x7f')]=function(_0x210146,_0x2b6c4c,_0x25ba8e){return db[_0xd14a('0x80')][_0xd14a('0x81')]({'where':{'VoiceQueueId':_0x210146[_0xd14a('0x47')][_0xd14a('0x6c')],'CampaignId':_0x210146[_0xd14a('0x47')][_0xd14a('0x7b')],'ContactId':_0x210146['body']['ContactId']}})['then'](handleEntityNotFound(_0x2b6c4c,null))[_0xd14a('0x3f')](function(_0x3a3707){if(_0x3a3707){return _0x3a3707;}return null;})['then'](respondWithResult(_0x2b6c4c,null))[_0xd14a('0x41')](handleError(_0x2b6c4c,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js
index abe31dc..d730b7b 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.model.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa3dc=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x53dd63,_0x5e1852){var _0x460c0a=function(_0x599511){while(--_0x599511){_0x53dd63['push'](_0x53dd63['shift']());}};_0x460c0a(++_0x5e1852);}(_0xa3dc,0x128));var _0xca3d=function(_0x47f994,_0x253e96){_0x47f994=_0x47f994-0x0;var _0x2d5ba3=_0xa3dc[_0x47f994];return _0x2d5ba3;};'use strict';var _=require(_0xca3d('0x0'));var util=require(_0xca3d('0x1'));var logger=require(_0xca3d('0x2'))('api');var moment=require(_0xca3d('0x3'));var BPromise=require(_0xca3d('0x4'));var rp=require(_0xca3d('0x5'));var fs=require('fs');var path=require(_0xca3d('0x6'));var rimraf=require(_0xca3d('0x7'));var config=require(_0xca3d('0x8'));var attributes=require(_0xca3d('0x9'));module[_0xca3d('0xa')]=function(_0x4c0cec,_0x441a8d){return _0x4c0cec['define'](_0xca3d('0xb'),attributes,{'tableName':_0xca3d('0xc'),'paranoid':![],'indexes':[{'name':_0xca3d('0xd'),'fields':[_0xca3d('0xd')]},{'name':_0xca3d('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x70e2=['rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5d87d9,_0x322111){var _0xfdd25a=function(_0x4328a3){while(--_0x4328a3){_0x5d87d9['push'](_0x5d87d9['shift']());}};_0xfdd25a(++_0x322111);}(_0x70e2,0x119));var _0x270e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x70e2[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x270e('0x0'));var util=require(_0x270e('0x1'));var logger=require(_0x270e('0x2'))(_0x270e('0x3'));var moment=require(_0x270e('0x4'));var BPromise=require(_0x270e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x270e('0x6'));var rimraf=require(_0x270e('0x7'));var config=require(_0x270e('0x8'));var attributes=require(_0x270e('0x9'));module[_0x270e('0xa')]=function(_0x51bee4,_0x413c32){return _0x51bee4[_0x270e('0xb')](_0x270e('0xc'),attributes,{'tableName':_0x270e('0xd'),'paranoid':![],'indexes':[{'name':_0x270e('0xe'),'fields':[_0x270e('0xe')]},{'name':_0x270e('0xf'),'fields':[_0x270e('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js
index 398d7e5..532f0ff 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb9a7=['jayson/promise','client','http','request','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','then','debug','catch','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xed9f18,_0x1baf0f){var _0x40fc54=function(_0x5748a6){while(--_0x5748a6){_0xed9f18['push'](_0xed9f18['shift']());}};_0x40fc54(++_0x1baf0f);}(_0xb9a7,0x112));var _0x7b9a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xb9a7[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9a('0x2'));var logger=require(_0x7b9a('0x3'))(_0x7b9a('0x4'));var config=require(_0x7b9a('0x5'));var jayson=require(_0x7b9a('0x6'));var client=jayson[_0x7b9a('0x7')][_0x7b9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7019fd,_0x37ce81,_0x3e51f0){return new BPromise(function(_0x4d3f20,_0x43d8e2){return client[_0x7b9a('0x9')](_0x7019fd,_0x3e51f0)['then'](function(_0x511e28){logger['info'](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));logger['debug'](_0x7b9a('0xc'),_0x37ce81,'request\x20sent',JSON[_0x7b9a('0xd')](_0x511e28));if(_0x511e28['error']){if(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0xf')]===0x1f4){logger[_0x7b9a('0xe')]('CmHopperFinal,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x43d8e2(_0x511e28['error'][_0x7b9a('0x10')]);}logger[_0x7b9a('0xe')]('CmHopperFinal,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x4d3f20(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);}else{logger[_0x7b9a('0x11')](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));_0x4d3f20(_0x511e28[_0x7b9a('0x12')][_0x7b9a('0x10')]);}})['catch'](function(_0x34a82d){logger['error'](_0x7b9a('0xa'),_0x37ce81,_0x34a82d);_0x43d8e2(_0x34a82d);});});}exports[_0x7b9a('0x13')]=function(_0x271263){var _0x169d16=this;return new Promise(function(_0x44a232,_0x180a67){return db[_0x7b9a('0x14')][_0x7b9a('0x15')](_0x271263[_0x7b9a('0x16')],{'raw':_0x271263[_0x7b9a('0x17')]?_0x271263[_0x7b9a('0x17')][_0x7b9a('0x18')]===undefined?!![]:![]:!![]})[_0x7b9a('0x19')](function(_0x58aed7){logger[_0x7b9a('0x11')]('CreateCmHopperFinal',_0x271263);logger[_0x7b9a('0x1a')]('CreateCmHopperFinal',_0x271263,JSON[_0x7b9a('0xd')](_0x58aed7));_0x44a232(_0x58aed7);})[_0x7b9a('0x1b')](function(_0x23d812){logger['error'](_0x7b9a('0x13'),_0x23d812[_0x7b9a('0x10')],_0x271263);_0x180a67(_0x169d16['error'](0x1f4,_0x23d812[_0x7b9a('0x10')]));});});};
\ No newline at end of file
+var _0xbfcc=['ioredis','../../mysqldb','jayson/promise','client','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','create','options','raw','then','CreateCmHopperFinal','catch','lodash','bluebird','randomstring'];(function(_0x48793a,_0x360b1e){var _0x40bc05=function(_0x124fac){while(--_0x124fac){_0x48793a['push'](_0x48793a['shift']());}};_0x40bc05(++_0x360b1e);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xbfcc[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbfc('0x1'));var rs=require(_0xcbfc('0x2'));var fs=require('fs');var Redis=require(_0xcbfc('0x3'));var db=require(_0xcbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbfc('0x5'));var client=jayson[_0xcbfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3917,_0x5a2be0,_0x2ea130){return new BPromise(function(_0x1f8b71,_0x1b1377){return client[_0xcbfc('0x7')](_0x1b3917,_0x2ea130)['then'](function(_0x2e7097){logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));logger[_0xcbfc('0xb')](_0xcbfc('0xc'),_0x5a2be0,'request\x20sent',JSON[_0xcbfc('0xd')](_0x2e7097));if(_0x2e7097[_0xcbfc('0xe')]){if(_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0xf')]===0x1f4){logger[_0xcbfc('0xe')]('CmHopperFinal,\x20%s,\x20%s',_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1b1377(_0x2e7097[_0xcbfc('0xe')]['message']);}logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1f8b71(_0x2e7097[_0xcbfc('0xe')]['message']);}else{logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));_0x1f8b71(_0x2e7097[_0xcbfc('0x11')]['message']);}})['catch'](function(_0x418f18){logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x418f18);_0x1b1377(_0x418f18);});});}exports['CreateCmHopperFinal']=function(_0x5b078f){var _0x33f731=this;return new Promise(function(_0x99b59d,_0x344510){return db['CmHopperFinal'][_0xcbfc('0x12')](_0x5b078f['body'],{'raw':_0x5b078f[_0xcbfc('0x13')]?_0x5b078f[_0xcbfc('0x13')][_0xcbfc('0x14')]===undefined?!![]:![]:!![]})[_0xcbfc('0x15')](function(_0x25c167){logger[_0xcbfc('0x8')]('CreateCmHopperFinal',_0x5b078f);logger[_0xcbfc('0xb')](_0xcbfc('0x16'),_0x5b078f,JSON['stringify'](_0x25c167));_0x99b59d(_0x25c167);})[_0xcbfc('0x17')](function(_0x5a449b){logger['error']('CreateCmHopperFinal',_0x5a449b[_0xcbfc('0x10')],_0x5b078f);_0x344510(_0x33f731['error'](0x1f4,_0x5a449b['message']));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js
index 6bf6f6c..7dcb76e 100644
--- a/server/api/cmHopperFinal/index.js
+++ b/server/api/cmHopperFinal/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x8')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')]('/voice/queue/moveContacts/:id',auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x12')](_0x7995('0x14'),auth[_0x7995('0x9')](),controller[_0x7995('0x15')]);router[_0x7995('0x12')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x18')]);module[_0x7995('0x19')]=router;
\ No newline at end of file
+var _0x3e74=['isAuthenticated','index','describe','/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','update','exports','multer','path','connect-timeout','express','../../components/interaction/service','./cmHopperFinal.controller','get'];(function(_0xf55e73,_0x3fecc5){var _0x116b99=function(_0x314e0c){while(--_0x314e0c){_0xf55e73['push'](_0xf55e73['shift']());}};_0x116b99(++_0x3fecc5);}(_0x3e74,0x175));var _0x43e7=function(_0x2a5c3b,_0x574a69){_0x2a5c3b=_0x2a5c3b-0x0;var _0x5ec60d=_0x3e74[_0x2a5c3b];return _0x5ec60d;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0x6')]('/campaign/countAttributes/:id',auth[_0x43e7('0x7')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x43e7('0xc')](_0x43e7('0xd'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xc')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0x43e7('0x10'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);router['put']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x12')]);module[_0x43e7('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js
index 0b66d85..d6709af 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.attributes.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x5be29f,_0x588b70){var _0x5f3875=function(_0x39f052){while(--_0x39f052){_0x5be29f['push'](_0x5be29f['shift']());}};_0x5f3875(++_0x588b70);}(_0x5fc3,0xa8));var _0x35fc=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0x5fc3[_0x168127];return _0x4c99ad;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x35fc('0x2')]},'scheduledat':{'type':Sequelize[_0x35fc('0x3')]},'countbusyretry':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x35fc('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x35fc('0x2')]},'originatecalleridname':{'type':Sequelize[_0x35fc('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x35fc('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x35fc('0x3')]},'droptime':{'type':Sequelize[_0x35fc('0x3')]},'endtime':{'type':Sequelize[_0x35fc('0x3')]},'ringtime':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x35fc('0x2')]},'campaigntype':{'type':Sequelize[_0x35fc('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x35fc('0x2')]},'amd':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x35fc('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x35fc('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x83d3=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0x83d3,0x17c));var _0x383d=function(_0x51af96,_0x42104c){_0x51af96=_0x51af96-0x0;var _0x2bb16b=_0x83d3[_0x51af96];return _0x2bb16b;};'use strict';var Sequelize=require(_0x383d('0x0'));module[_0x383d('0x1')]={'state':{'type':Sequelize[_0x383d('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x383d('0x3')]},'scheduledat':{'type':Sequelize[_0x383d('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x383d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x383d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x383d('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x383d('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x383d('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x383d('0x4')]},'responsetime':{'type':Sequelize[_0x383d('0x4')]},'answertime':{'type':Sequelize[_0x383d('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x383d('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x383d('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x383d('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x383d('0x3')]},'campaigntype':{'type':Sequelize[_0x383d('0x3')]},'membername':{'type':Sequelize[_0x383d('0x3')]},'reason':{'type':Sequelize[_0x383d('0x3')]},'amd':{'type':Sequelize[_0x383d('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x383d('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x383d('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x383d('0x5')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js
index dea9083..b172f07 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.controller.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x168a=['body','describe','uniqueid','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','then','error','name','send','index','CmHopperHistory','rawAttributes','model','keys','filters','intersection','attributes','fields','query','length','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','findAll','rows','show','params','includeAll','include','find','catch','create'];(function(_0x14405c,_0x12b9b9){var _0x5d54ba=function(_0x5eaba7){while(--_0x5eaba7){_0x14405c['push'](_0x14405c['shift']());}};_0x5d54ba(++_0x12b9b9);}(_0x168a,0x15c));var _0xa168=function(_0x49f911,_0x128351){_0x49f911=_0x49f911-0x0;var _0x39e6c0=_0x168a[_0x49f911];return _0x39e6c0;};'use strict';var pdf=require(_0xa168('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa168('0x1'));var jsonpatch=require(_0xa168('0x2'));var rp=require(_0xa168('0x3'));var moment=require(_0xa168('0x4'));var BPromise=require(_0xa168('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa168('0x6'));var sox=require(_0xa168('0x7'));var csv=require(_0xa168('0x8'));var ejs=require(_0xa168('0x9'));var fs=require('fs');var _=require(_0xa168('0xa'));var squel=require(_0xa168('0xb'));var crypto=require(_0xa168('0xc'));var jsforce=require(_0xa168('0xd'));var deskjs=require(_0xa168('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa168('0xf'));var Redis=require(_0xa168('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa168('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa168('0x12'));var utils=require('../../config/utils');var config=require(_0xa168('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e46d7,_0x52b52c){_0x52b52c=_0x52b52c||0xcc;return function(_0x46683a){if(_0x46683a){return _0x3e46d7[_0xa168('0x14')](_0x52b52c);}return _0x3e46d7[_0xa168('0x15')](_0x52b52c)[_0xa168('0x16')]();};}function respondWithResult(_0x4d2221,_0x26c506){_0x26c506=_0x26c506||0xc8;return function(_0x3b90c6){if(_0x3b90c6){return _0x4d2221['status'](_0x26c506)[_0xa168('0x17')](_0x3b90c6);}};}function respondWithFilteredResult(_0xc1192a,_0x2f7097){return function(_0x1e043b){if(_0x1e043b){var _0x290c53=_0x1e043b[_0xa168('0x18')],_0x298a4c=_0x2f7097['offset'],_0x3dd3fe=_0x2f7097[_0xa168('0x19')]+_0x2f7097['limit'],_0x2cb145;if(_0x3dd3fe>=_0x290c53){_0x3dd3fe=_0x290c53;_0x2cb145=0xc8;}else{_0x2cb145=0xce;}_0xc1192a['status'](_0x2cb145);return _0xc1192a['set'](_0xa168('0x1a'),_0x298a4c+'-'+_0x3dd3fe+'/'+_0x290c53)[_0xa168('0x17')](_0x1e043b);}return null;};}function patchUpdates(_0x2803c4){return function(_0x486f80){try{jsonpatch['apply'](_0x486f80,_0x2803c4,!![]);}catch(_0x47474b){return BPromise[_0xa168('0x1b')](_0x47474b);}return _0x486f80[_0xa168('0x1c')]();};}function saveUpdates(_0x3cfb44,_0x5b7d1b){return function(_0x19935d){if(_0x19935d){return _0x19935d[_0xa168('0x1d')](_0x3cfb44)[_0xa168('0x1e')](function(_0x98677b){return _0x98677b;});}return null;};}function removeEntity(_0x16bf51,_0x405473){return function(_0x3b0555){if(_0x3b0555){return _0x3b0555['destroy']()[_0xa168('0x1e')](function(){_0x16bf51[_0xa168('0x15')](0xcc)[_0xa168('0x16')]();});}};}function handleEntityNotFound(_0x1a58b1,_0x16cd55){return function(_0x5a6425){if(!_0x5a6425){_0x1a58b1[_0xa168('0x14')](0x194);}return _0x5a6425;};}function handleError(_0x4fadc6,_0x445977){_0x445977=_0x445977||0x1f4;return function(_0x990f50){logger[_0xa168('0x1f')](_0x990f50['stack']);if(_0x990f50[_0xa168('0x20')]){delete _0x990f50[_0xa168('0x20')];}_0x4fadc6[_0xa168('0x15')](_0x445977)[_0xa168('0x21')](_0x990f50);};}exports[_0xa168('0x22')]=function(_0x2fe7f3,_0x228f90){var _0x1eb592={},_0x20cf58={},_0x5bab88={'count':0x0,'rows':[]};var _0x5d9c9d=db[_0xa168('0x23')][_0xa168('0x24')];_0x20cf58[_0xa168('0x25')]=_[_0xa168('0x26')](_0x5d9c9d);_0x20cf58['query']=_[_0xa168('0x26')](_0x2fe7f3['query']);_0x20cf58[_0xa168('0x27')]=_[_0xa168('0x28')](_0x20cf58['model'],_0x20cf58['query']);_0x1eb592[_0xa168('0x29')]=_['intersection'](_0x20cf58['model'],qs[_0xa168('0x2a')](_0x2fe7f3[_0xa168('0x2b')]['fields']));_0x1eb592[_0xa168('0x29')]=_0x1eb592[_0xa168('0x29')][_0xa168('0x2c')]?_0x1eb592[_0xa168('0x29')]:_0x20cf58[_0xa168('0x25')];if(!_0x2fe7f3['query']['hasOwnProperty']('nolimit')){_0x1eb592[_0xa168('0x2d')]=qs[_0xa168('0x2d')](_0x2fe7f3['query'][_0xa168('0x2d')]);_0x1eb592[_0xa168('0x19')]=qs[_0xa168('0x19')](_0x2fe7f3['query'][_0xa168('0x19')]);}_0x1eb592['order']=qs[_0xa168('0x2e')](_0x2fe7f3['query'][_0xa168('0x2e')]);_0x1eb592[_0xa168('0x2f')]=qs[_0xa168('0x27')](_[_0xa168('0x30')](_0x2fe7f3[_0xa168('0x2b')],_0x20cf58[_0xa168('0x27')]));if(_0x2fe7f3[_0xa168('0x2b')][_0xa168('0x31')]){_0x1eb592['where']=_[_0xa168('0x32')](_0x1eb592[_0xa168('0x2f')],{'$or':_[_0xa168('0x33')](_0x5d9c9d,function(_0xbabd92){if(_0xbabd92[_0xa168('0x34')][_0xa168('0x35')]!==_0xa168('0x36')){var _0x2a9724={};_0x2a9724[_0xbabd92[_0xa168('0x37')]]={'$like':'%'+_0x2fe7f3[_0xa168('0x2b')]['filter']+'%'};return _0x2a9724;}})});}_0x1eb592=_[_0xa168('0x32')]({},_0x1eb592,_0x2fe7f3[_0xa168('0x38')]);var _0x428298={'where':_0x1eb592['where']};return db[_0xa168('0x23')][_0xa168('0x18')](_0x428298)['then'](function(_0x209216){_0x5bab88[_0xa168('0x18')]=_0x209216;if(_0x2fe7f3[_0xa168('0x2b')]['includeAll']){_0x1eb592['include']=[{'all':!![]}];}return db[_0xa168('0x23')][_0xa168('0x39')](_0x1eb592);})[_0xa168('0x1e')](function(_0x3c7309){_0x5bab88[_0xa168('0x3a')]=_0x3c7309;return _0x5bab88;})[_0xa168('0x1e')](respondWithFilteredResult(_0x228f90,_0x1eb592))['catch'](handleError(_0x228f90,null));};exports[_0xa168('0x3b')]=function(_0x3eba91,_0x34426a){var _0x259559={'raw':!![],'where':{'id':_0x3eba91[_0xa168('0x3c')]['id']}},_0x3c3c5c={};_0x3c3c5c[_0xa168('0x25')]=_['keys'](db[_0xa168('0x23')][_0xa168('0x24')]);_0x3c3c5c['query']=_['keys'](_0x3eba91[_0xa168('0x2b')]);_0x3c3c5c['filters']=_['intersection'](_0x3c3c5c['model'],_0x3c3c5c[_0xa168('0x2b')]);_0x259559[_0xa168('0x29')]=_[_0xa168('0x28')](_0x3c3c5c[_0xa168('0x25')],qs[_0xa168('0x2a')](_0x3eba91[_0xa168('0x2b')]['fields']));_0x259559['attributes']=_0x259559[_0xa168('0x29')]['length']?_0x259559[_0xa168('0x29')]:_0x3c3c5c[_0xa168('0x25')];if(_0x3eba91['query'][_0xa168('0x3d')]){_0x259559[_0xa168('0x3e')]=[{'all':!![]}];}_0x259559=_['merge']({},_0x259559,_0x3eba91[_0xa168('0x38')]);return db['CmHopperHistory'][_0xa168('0x3f')](_0x259559)[_0xa168('0x1e')](handleEntityNotFound(_0x34426a,null))['then'](respondWithResult(_0x34426a,null))[_0xa168('0x40')](handleError(_0x34426a,null));};exports[_0xa168('0x41')]=function(_0x5abcbd,_0x50c172){return db[_0xa168('0x23')][_0xa168('0x41')](_0x5abcbd[_0xa168('0x42')],{})['then'](respondWithResult(_0x50c172,0xc9))[_0xa168('0x40')](handleError(_0x50c172,null));};exports[_0xa168('0x43')]=function(_0x786a85,_0x46196e){return db[_0xa168('0x23')][_0xa168('0x43')]()[_0xa168('0x1e')](respondWithResult(_0x46196e,null))[_0xa168('0x40')](handleError(_0x46196e,null));};exports['update']=function(_0xe85d98,_0x4a1fd0){if(_0xe85d98[_0xa168('0x42')][_0xa168('0x44')]){delete _0xe85d98[_0xa168('0x42')]['uniqueid'];}return db[_0xa168('0x23')][_0xa168('0x3f')]({'where':{'uniqueid':_0xe85d98[_0xa168('0x3c')]['id']}})[_0xa168('0x1e')](handleEntityNotFound(_0x4a1fd0,null))['then'](saveUpdates(_0xe85d98['body'],null))['then'](respondWithResult(_0x4a1fd0,null))[_0xa168('0x40')](handleError(_0x4a1fd0,null));};
\ No newline at end of file
+var _0xc50b=['mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','json','apply','reject','save','update','destroy','then','stack','name','send','CmHopperHistory','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','key','VIRTUAL','field','filter','options','includeAll','rows','catch','show','params','include','find','create','describe','uniqueid','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0xeb54bb,_0x2d8002){var _0x4d430f=function(_0x16bdd3){while(--_0x16bdd3){_0xeb54bb['push'](_0xeb54bb['shift']());}};_0x4d430f(++_0x2d8002);}(_0xc50b,0x1a3));var _0xbc50=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xc50b[_0x2763f2];return _0x3ef471;};'use strict';var pdf=require(_0xbc50('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbc50('0x1'));var zipdir=require(_0xbc50('0x2'));var jsonpatch=require(_0xbc50('0x3'));var rp=require(_0xbc50('0x4'));var moment=require(_0xbc50('0x5'));var BPromise=require(_0xbc50('0x6'));var Mustache=require(_0xbc50('0x7'));var util=require('util');var path=require(_0xbc50('0x8'));var sox=require('sox');var csv=require(_0xbc50('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbc50('0xa'));var squel=require(_0xbc50('0xb'));var crypto=require(_0xbc50('0xc'));var jsforce=require(_0xbc50('0xd'));var deskjs=require(_0xbc50('0xe'));var toCsv=require(_0xbc50('0x9'));var querystring=require(_0xbc50('0xf'));var Papa=require(_0xbc50('0x10'));var Redis=require(_0xbc50('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbc50('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc50('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xbc50('0x14'));var db=require(_0xbc50('0x15'))['db'];function respondWithStatusCode(_0x3fbee8,_0x1731e6){_0x1731e6=_0x1731e6||0xcc;return function(_0x17e581){if(_0x17e581){return _0x3fbee8[_0xbc50('0x16')](_0x1731e6);}return _0x3fbee8[_0xbc50('0x17')](_0x1731e6)[_0xbc50('0x18')]();};}function respondWithResult(_0x4e332d,_0x2813ac){_0x2813ac=_0x2813ac||0xc8;return function(_0x3e18e3){if(_0x3e18e3){return _0x4e332d[_0xbc50('0x17')](_0x2813ac)['json'](_0x3e18e3);}};}function respondWithFilteredResult(_0x41a132,_0x333a82){return function(_0xea728e){if(_0xea728e){var _0x5e1c9b=_0xea728e[_0xbc50('0x19')],_0x45ed17=_0x333a82[_0xbc50('0x1a')],_0x2323c9=_0x333a82[_0xbc50('0x1a')]+_0x333a82[_0xbc50('0x1b')],_0x4402c6;if(_0x2323c9>=_0x5e1c9b){_0x2323c9=_0x5e1c9b;_0x4402c6=0xc8;}else{_0x4402c6=0xce;}_0x41a132[_0xbc50('0x17')](_0x4402c6);return _0x41a132['set']('Content-Range',_0x45ed17+'-'+_0x2323c9+'/'+_0x5e1c9b)[_0xbc50('0x1c')](_0xea728e);}return null;};}function patchUpdates(_0x288c5a){return function(_0x87e093){try{jsonpatch[_0xbc50('0x1d')](_0x87e093,_0x288c5a,!![]);}catch(_0x34e21d){return BPromise[_0xbc50('0x1e')](_0x34e21d);}return _0x87e093[_0xbc50('0x1f')]();};}function saveUpdates(_0x4d7836,_0x3eb40a){return function(_0x359740){if(_0x359740){return _0x359740[_0xbc50('0x20')](_0x4d7836)['then'](function(_0x42dafe){return _0x42dafe;});}return null;};}function removeEntity(_0x43cd0c,_0x1d759a){return function(_0x1f92f6){if(_0x1f92f6){return _0x1f92f6[_0xbc50('0x21')]()[_0xbc50('0x22')](function(){_0x43cd0c['status'](0xcc)[_0xbc50('0x18')]();});}};}function handleEntityNotFound(_0x469230,_0x1f5da6){return function(_0x4a098a){if(!_0x4a098a){_0x469230[_0xbc50('0x16')](0x194);}return _0x4a098a;};}function handleError(_0x50d26f,_0x5b46df){_0x5b46df=_0x5b46df||0x1f4;return function(_0x548c59){logger['error'](_0x548c59[_0xbc50('0x23')]);if(_0x548c59[_0xbc50('0x24')]){delete _0x548c59[_0xbc50('0x24')];}_0x50d26f[_0xbc50('0x17')](_0x5b46df)[_0xbc50('0x25')](_0x548c59);};}exports['index']=function(_0x4ce9cc,_0x320026){var _0x596c89={},_0x11226c={},_0x34a3f0={'count':0x0,'rows':[]};var _0x530a03=db[_0xbc50('0x26')][_0xbc50('0x27')];_0x11226c[_0xbc50('0x28')]=_[_0xbc50('0x29')](_0x530a03);_0x11226c[_0xbc50('0x2a')]=_['keys'](_0x4ce9cc['query']);_0x11226c[_0xbc50('0x2b')]=_[_0xbc50('0x2c')](_0x11226c['model'],_0x11226c[_0xbc50('0x2a')]);_0x596c89[_0xbc50('0x2d')]=_[_0xbc50('0x2c')](_0x11226c[_0xbc50('0x28')],qs['fields'](_0x4ce9cc['query'][_0xbc50('0x2e')]));_0x596c89[_0xbc50('0x2d')]=_0x596c89[_0xbc50('0x2d')][_0xbc50('0x2f')]?_0x596c89[_0xbc50('0x2d')]:_0x11226c[_0xbc50('0x28')];if(!_0x4ce9cc[_0xbc50('0x2a')][_0xbc50('0x30')](_0xbc50('0x31'))){_0x596c89[_0xbc50('0x1b')]=qs[_0xbc50('0x1b')](_0x4ce9cc[_0xbc50('0x2a')][_0xbc50('0x1b')]);_0x596c89[_0xbc50('0x1a')]=qs['offset'](_0x4ce9cc[_0xbc50('0x2a')][_0xbc50('0x1a')]);}_0x596c89[_0xbc50('0x32')]=qs[_0xbc50('0x33')](_0x4ce9cc[_0xbc50('0x2a')][_0xbc50('0x33')]);_0x596c89[_0xbc50('0x34')]=qs[_0xbc50('0x2b')](_['pick'](_0x4ce9cc['query'],_0x11226c[_0xbc50('0x2b')]));if(_0x4ce9cc['query']['filter']){_0x596c89[_0xbc50('0x34')]=_[_0xbc50('0x35')](_0x596c89['where'],{'$or':_['map'](_0x530a03,function(_0x4a9a43){if(_0x4a9a43[_0xbc50('0x36')][_0xbc50('0x37')]!==_0xbc50('0x38')){var _0x5e4c4b={};_0x5e4c4b[_0x4a9a43[_0xbc50('0x39')]]={'$like':'%'+_0x4ce9cc[_0xbc50('0x2a')][_0xbc50('0x3a')]+'%'};return _0x5e4c4b;}})});}_0x596c89=_[_0xbc50('0x35')]({},_0x596c89,_0x4ce9cc[_0xbc50('0x3b')]);var _0x14d718={'where':_0x596c89[_0xbc50('0x34')]};return db['CmHopperHistory'][_0xbc50('0x19')](_0x14d718)[_0xbc50('0x22')](function(_0x52d017){_0x34a3f0[_0xbc50('0x19')]=_0x52d017;if(_0x4ce9cc[_0xbc50('0x2a')][_0xbc50('0x3c')]){_0x596c89['include']=[{'all':!![]}];}return db[_0xbc50('0x26')]['findAll'](_0x596c89);})[_0xbc50('0x22')](function(_0xbcae96){_0x34a3f0[_0xbc50('0x3d')]=_0xbcae96;return _0x34a3f0;})[_0xbc50('0x22')](respondWithFilteredResult(_0x320026,_0x596c89))[_0xbc50('0x3e')](handleError(_0x320026,null));};exports[_0xbc50('0x3f')]=function(_0x25991b,_0x950fa7){var _0x321402={'raw':!![],'where':{'id':_0x25991b[_0xbc50('0x40')]['id']}},_0x255e23={};_0x255e23[_0xbc50('0x28')]=_['keys'](db[_0xbc50('0x26')][_0xbc50('0x27')]);_0x255e23[_0xbc50('0x2a')]=_[_0xbc50('0x29')](_0x25991b['query']);_0x255e23[_0xbc50('0x2b')]=_[_0xbc50('0x2c')](_0x255e23[_0xbc50('0x28')],_0x255e23['query']);_0x321402[_0xbc50('0x2d')]=_[_0xbc50('0x2c')](_0x255e23[_0xbc50('0x28')],qs[_0xbc50('0x2e')](_0x25991b[_0xbc50('0x2a')][_0xbc50('0x2e')]));_0x321402[_0xbc50('0x2d')]=_0x321402[_0xbc50('0x2d')][_0xbc50('0x2f')]?_0x321402[_0xbc50('0x2d')]:_0x255e23[_0xbc50('0x28')];if(_0x25991b[_0xbc50('0x2a')][_0xbc50('0x3c')]){_0x321402[_0xbc50('0x41')]=[{'all':!![]}];}_0x321402=_['merge']({},_0x321402,_0x25991b['options']);return db['CmHopperHistory'][_0xbc50('0x42')](_0x321402)[_0xbc50('0x22')](handleEntityNotFound(_0x950fa7,null))[_0xbc50('0x22')](respondWithResult(_0x950fa7,null))[_0xbc50('0x3e')](handleError(_0x950fa7,null));};exports[_0xbc50('0x43')]=function(_0x5779e7,_0x25220e){return db['CmHopperHistory'][_0xbc50('0x43')](_0x5779e7['body'],{})['then'](respondWithResult(_0x25220e,0xc9))[_0xbc50('0x3e')](handleError(_0x25220e,null));};exports[_0xbc50('0x44')]=function(_0x2ddb0e,_0x3cabdb){return db[_0xbc50('0x26')][_0xbc50('0x44')]()[_0xbc50('0x22')](respondWithResult(_0x3cabdb,null))[_0xbc50('0x3e')](handleError(_0x3cabdb,null));};exports[_0xbc50('0x20')]=function(_0x169ad9,_0x332a80){if(_0x169ad9['body'][_0xbc50('0x45')]){delete _0x169ad9[_0xbc50('0x46')][_0xbc50('0x45')];}return db[_0xbc50('0x26')]['find']({'where':{'uniqueid':_0x169ad9[_0xbc50('0x40')]['id']}})['then'](handleEntityNotFound(_0x332a80,null))[_0xbc50('0x22')](saveUpdates(_0x169ad9[_0xbc50('0x46')],null))[_0xbc50('0x22')](respondWithResult(_0x332a80,null))[_0xbc50('0x3e')](handleError(_0x332a80,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js
index 7254e8d..1e00bc9 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.model.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['define','CmHopperHistory','endtime','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x4b8138,_0x6326be){var _0x3ef46d=function(_0x1aa903){while(--_0x1aa903){_0x4b8138['push'](_0x4b8138['shift']());}};_0x3ef46d(++_0x6326be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0a9e('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x16b3d2,_0xbf875e){var _0xb51e37=function(_0x396b62){while(--_0x396b62){_0x16b3d2['push'](_0x16b3d2['shift']());}};_0xb51e37(++_0xbf875e);}(_0xe706,0xa3));var _0x6e70=function(_0x153c6c,_0x5aa22f){_0x153c6c=_0x153c6c-0x0;var _0x3c85d3=_0xe706[_0x153c6c];return _0x3c85d3;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]},{'name':_0x6e70('0xf'),'fields':[_0x6e70('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js
index 3a5d4d1..e1f8840 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaaa2=['predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','then','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','result','CreateCmHopperHistory','create','body','options','catch','AvgHandleTime','CmHopperHistory','findAll','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null'];(function(_0x211576,_0xcc41af){var _0x3ce235=function(_0x28bd8a){while(--_0x28bd8a){_0x211576['push'](_0x211576['shift']());}};_0x3ce235(++_0xcc41af);}(_0xaaa2,0xac));var _0x2aaa=function(_0x4f2494,_0x57f683){_0x4f2494=_0x4f2494-0x0;var _0x40f3e0=_0xaaa2[_0x4f2494];return _0x40f3e0;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var moment=require(_0x2aaa('0x2'));var BPromise=require(_0x2aaa('0x3'));var rs=require(_0x2aaa('0x4'));var fs=require('fs');var Redis=require(_0x2aaa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2aaa('0x6'));var logger=require('../../config/logger')(_0x2aaa('0x7'));var config=require(_0x2aaa('0x8'));var jayson=require(_0x2aaa('0x9'));var client=jayson[_0x2aaa('0xa')][_0x2aaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106af9,_0x4f51e6,_0x2f16d7){return new BPromise(function(_0x514c32,_0x505fe8){return client[_0x2aaa('0xc')](_0x106af9,_0x2f16d7)['then'](function(_0x1ad6e9){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));logger[_0x2aaa('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'),JSON[_0x2aaa('0xf')](_0x1ad6e9));if(_0x1ad6e9[_0x2aaa('0x10')]){if(_0x1ad6e9['error'][_0x2aaa('0x11')]===0x1f4){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x505fe8(_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);}logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x514c32(_0x1ad6e9[_0x2aaa('0x10')]['message']);}else{logger[_0x2aaa('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));_0x514c32(_0x1ad6e9[_0x2aaa('0x15')]['message']);}})['catch'](function(_0x50a767){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x50a767);_0x505fe8(_0x50a767);});});}exports[_0x2aaa('0x16')]=function(_0x3b94bf){var _0x1cae3e=this;return new Promise(function(_0xdaa445,_0x38a049){return db['CmHopperHistory'][_0x2aaa('0x17')](_0x3b94bf[_0x2aaa('0x18')],{'raw':_0x3b94bf['options']?_0x3b94bf[_0x2aaa('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1ec32e){logger[_0x2aaa('0x14')](_0x2aaa('0x16'),_0x3b94bf);logger[_0x2aaa('0xe')](_0x2aaa('0x16'),_0x3b94bf,JSON[_0x2aaa('0xf')](_0x1ec32e));_0xdaa445(_0x1ec32e);})[_0x2aaa('0x1a')](function(_0x24da1e){logger['error'](_0x2aaa('0x16'),_0x24da1e[_0x2aaa('0x13')],_0x3b94bf);_0x38a049(_0x1cae3e['error'](0x1f4,_0x24da1e['message']));});});};exports[_0x2aaa('0x1b')]=function(_0x4d7151){var _0x37474f=this;return new Promise(function(_0x3606bf,_0x4e41ee){return db[_0x2aaa('0x1c')][_0x2aaa('0x1d')]({'raw':_0x4d7151['options']?_0x4d7151[_0x2aaa('0x19')][_0x2aaa('0x1e')]===undefined?!![]:![]:!![],'where':_0x4d7151[_0x2aaa('0x19')]?_0x4d7151['options'][_0x2aaa('0x1f')]||null:null,'attributes':[[db[_0x2aaa('0x20')]['fn']('COUNT',db['sequelize'][_0x2aaa('0x21')]('id')),_0x2aaa('0x22')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x25')))),_0x2aaa('0x26')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db['sequelize'][_0x2aaa('0x24')]('`state`\x20=\x2010,\x201,\x20null'))),_0x2aaa('0x27')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x28')))),_0x2aaa('0x29')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x2a'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x2a'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x2b')))),_0x2aaa('0x2c')]]})[_0x2aaa('0x2d')](function(_0x5e9fdf){logger[_0x2aaa('0x14')](_0x2aaa('0x1b'),_0x4d7151);logger['debug'](_0x2aaa('0x1b'),_0x4d7151,JSON[_0x2aaa('0xf')](_0x5e9fdf));_0x3606bf(_0x5e9fdf);})['catch'](function(_0x39f8aa){logger[_0x2aaa('0x10')](_0x2aaa('0x1b'),_0x39f8aa[_0x2aaa('0x13')],_0x4d7151);_0x4e41ee(_0x37474f[_0x2aaa('0x10')](0x1f4,_0x39f8aa[_0x2aaa('0x13')]));});});};exports[_0x2aaa('0x2e')]=function(_0x4d9e9b){var _0x496b10=this;return new Promise(function(_0xa9054b,_0x4dc768){return db[_0x2aaa('0x1c')][_0x2aaa('0x1d')]({'raw':_0x4d9e9b['options']?_0x4d9e9b[_0x2aaa('0x19')][_0x2aaa('0x1e')]===undefined?!![]:![]:!![],'where':_0x4d9e9b[_0x2aaa('0x19')]?_0x4d9e9b['options'][_0x2aaa('0x1f')]||null:null,'attributes':[[_0x2aaa('0x2f'),_0x2aaa('0x30')],[db[_0x2aaa('0x20')]['fn']('COUNT',db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x31')))),_0x2aaa('0x32')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x33')))),_0x2aaa('0x34')],[db[_0x2aaa('0x20')]['fn']('COUNT',db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x2aaa('0x35')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x36')))),'outboundBusyCallsDay'],[db['sequelize']['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')]['literal'](_0x2aaa('0x37')))),_0x2aaa('0x38')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x39')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db[_0x2aaa('0x20')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')]('`state`\x20=\x2012,\x201,\x20null'))),_0x2aaa('0x3a')],[db['sequelize']['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db['sequelize'][_0x2aaa('0x24')](_0x2aaa('0x3b')))),_0x2aaa('0x3c')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x2aaa('0x3d')))),_0x2aaa('0x3e')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x3f')))),_0x2aaa('0x40')],[db['sequelize']['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')]('`state`\x20=\x2016,\x201,\x20null'))),_0x2aaa('0x41')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0x2aaa('0x24')](_0x2aaa('0x42')))),_0x2aaa('0x40')],[db[_0x2aaa('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x2aaa('0x43')))),_0x2aaa('0x44')]],'group':[_0x2aaa('0x2f')]})['then'](function(_0x1e690d){logger[_0x2aaa('0x14')](_0x2aaa('0x2e'),_0x4d9e9b);logger[_0x2aaa('0xe')](_0x2aaa('0x2e'),_0x4d9e9b,JSON[_0x2aaa('0xf')](_0x1e690d));_0xa9054b(_0x1e690d);})[_0x2aaa('0x1a')](function(_0x5f3ebb){logger[_0x2aaa('0x10')]('GetVoiceQueueHopperHistory',_0x5f3ebb['message'],_0x4d9e9b);_0x4dc768(_0x496b10[_0x2aaa('0x10')](0x1f4,_0x5f3ebb[_0x2aaa('0x13')]));});});};exports[_0x2aaa('0x45')]=function(_0x10b4bb){var _0x163ab9=this;return new Promise(function(_0x558d9d,_0x27a08c){return db[_0x2aaa('0x1c')][_0x2aaa('0x1d')]({'raw':_0x10b4bb[_0x2aaa('0x19')]?_0x10b4bb[_0x2aaa('0x19')][_0x2aaa('0x1e')]===undefined?!![]:![]:!![],'where':_0x10b4bb[_0x2aaa('0x19')]?_0x10b4bb[_0x2aaa('0x19')][_0x2aaa('0x1f')]||null:null,'attributes':[[_0x2aaa('0x2f'),_0x2aaa('0x30')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')][_0x2aaa('0x21')]('id')),'ivrTotalCallsDays'],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db[_0x2aaa('0x20')]['literal'](_0x2aaa('0x25')))),_0x2aaa('0x46')]],'group':['campaign']})[_0x2aaa('0x2d')](function(_0x3f446a){logger[_0x2aaa('0x14')](_0x2aaa('0x45'),_0x10b4bb);logger['debug'](_0x2aaa('0x45'),_0x10b4bb,JSON['stringify'](_0x3f446a));_0x558d9d(_0x3f446a);})[_0x2aaa('0x1a')](function(_0x359359){logger['error'](_0x2aaa('0x45'),_0x359359[_0x2aaa('0x13')],_0x10b4bb);_0x27a08c(_0x163ab9[_0x2aaa('0x10')](0x1f4,_0x359359[_0x2aaa('0x13')]));});});};
\ No newline at end of file
+var _0x65b3=['outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateCmHopperHistory','create','options','raw','then','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundAnswerAgiCallsDay'];(function(_0x3c1627,_0x16eca1){var _0x48f76a=function(_0xfa80a2){while(--_0xfa80a2){_0x3c1627['push'](_0x3c1627['shift']());}};_0x48f76a(++_0x16eca1);}(_0x65b3,0xc6));var _0x365b=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x65b3[_0x28611e];return _0x530f69;};'use strict';var _=require(_0x365b('0x0'));var util=require(_0x365b('0x1'));var moment=require(_0x365b('0x2'));var BPromise=require(_0x365b('0x3'));var rs=require(_0x365b('0x4'));var fs=require('fs');var Redis=require(_0x365b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x365b('0x6'));var logger=require(_0x365b('0x7'))(_0x365b('0x8'));var config=require('../../config/environment');var jayson=require(_0x365b('0x9'));var client=jayson[_0x365b('0xa')][_0x365b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b7869,_0x160565,_0xe6670a){return new BPromise(function(_0x2ed50a,_0x3f95c1){return client[_0x365b('0xc')](_0x5b7869,_0xe6670a)['then'](function(_0x36afc2){logger[_0x365b('0xd')](_0x365b('0xe'),_0x160565,_0x365b('0xf'));logger[_0x365b('0x10')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x160565,_0x365b('0xf'),JSON[_0x365b('0x11')](_0x36afc2));if(_0x36afc2[_0x365b('0x12')]){if(_0x36afc2[_0x365b('0x12')]['code']===0x1f4){logger['error'](_0x365b('0xe'),_0x160565,_0x36afc2[_0x365b('0x12')][_0x365b('0x13')]);return _0x3f95c1(_0x36afc2['error'][_0x365b('0x13')]);}logger['error'](_0x365b('0xe'),_0x160565,_0x36afc2[_0x365b('0x12')][_0x365b('0x13')]);return _0x2ed50a(_0x36afc2[_0x365b('0x12')][_0x365b('0x13')]);}else{logger[_0x365b('0xd')](_0x365b('0xe'),_0x160565,_0x365b('0xf'));_0x2ed50a(_0x36afc2[_0x365b('0x14')][_0x365b('0x13')]);}})[_0x365b('0x15')](function(_0x13403b){logger[_0x365b('0x12')](_0x365b('0xe'),_0x160565,_0x13403b);_0x3f95c1(_0x13403b);});});}exports[_0x365b('0x16')]=function(_0x1cf7a3){var _0xafd00e=this;return new Promise(function(_0x2ac7ba,_0x1de77b){return db['CmHopperHistory'][_0x365b('0x17')](_0x1cf7a3['body'],{'raw':_0x1cf7a3[_0x365b('0x18')]?_0x1cf7a3[_0x365b('0x18')][_0x365b('0x19')]===undefined?!![]:![]:!![]})[_0x365b('0x1a')](function(_0x16dc0e){logger[_0x365b('0xd')](_0x365b('0x16'),_0x1cf7a3);logger[_0x365b('0x10')](_0x365b('0x16'),_0x1cf7a3,JSON[_0x365b('0x11')](_0x16dc0e));_0x2ac7ba(_0x16dc0e);})[_0x365b('0x15')](function(_0x53f762){logger[_0x365b('0x12')](_0x365b('0x16'),_0x53f762[_0x365b('0x13')],_0x1cf7a3);_0x1de77b(_0xafd00e[_0x365b('0x12')](0x1f4,_0x53f762['message']));});});};exports[_0x365b('0x1b')]=function(_0x39c6ac){var _0xdf632f=this;return new Promise(function(_0x39ad9f,_0x265e83){return db['CmHopperHistory'][_0x365b('0x1c')]({'raw':_0x39c6ac[_0x365b('0x18')]?_0x39c6ac[_0x365b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x39c6ac[_0x365b('0x18')]?_0x39c6ac[_0x365b('0x18')][_0x365b('0x1d')]||null:null,'attributes':[[db[_0x365b('0x1e')]['fn'](_0x365b('0x1f'),db[_0x365b('0x1e')][_0x365b('0x20')]('id')),_0x365b('0x21')],[db[_0x365b('0x1e')]['fn']('COUNT',db[_0x365b('0x1e')]['fn']('IF',db['sequelize'][_0x365b('0x22')](_0x365b('0x23')))),'predictiveIntervalAnsweredCalls'],[db[_0x365b('0x1e')]['fn'](_0x365b('0x1f'),db[_0x365b('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x365b('0x24')))),_0x365b('0x25')],[db[_0x365b('0x1e')]['fn'](_0x365b('0x1f'),db['sequelize']['fn']('IF',db[_0x365b('0x1e')][_0x365b('0x22')](_0x365b('0x26')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0x365b('0x27'),db[_0x365b('0x1e')]['fn']('IF',db['sequelize'][_0x365b('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x365b('0x1e')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x365b('0x1e')][_0x365b('0x22')](_0x365b('0x28')))),_0x365b('0x29')]]})['then'](function(_0x3c7612){logger[_0x365b('0xd')](_0x365b('0x1b'),_0x39c6ac);logger['debug']('AvgHandleTime',_0x39c6ac,JSON[_0x365b('0x11')](_0x3c7612));_0x39ad9f(_0x3c7612);})[_0x365b('0x15')](function(_0x4f90f9){logger['error'](_0x365b('0x1b'),_0x4f90f9['message'],_0x39c6ac);_0x265e83(_0xdf632f['error'](0x1f4,_0x4f90f9[_0x365b('0x13')]));});});};exports[_0x365b('0x2a')]=function(_0x342ae6){var _0x14b31d=this;return new Promise(function(_0x477d26,_0x2ff7ef){return db[_0x365b('0x2b')][_0x365b('0x1c')]({'raw':_0x342ae6[_0x365b('0x18')]?_0x342ae6[_0x365b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x342ae6[_0x365b('0x18')]?_0x342ae6[_0x365b('0x18')][_0x365b('0x1d')]||null:null,'attributes':[['campaign',_0x365b('0x2c')],[db[_0x365b('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x365b('0x1e')][_0x365b('0x22')](_0x365b('0x2d')))),_0x365b('0x2e')],[db[_0x365b('0x1e')]['fn'](_0x365b('0x1f'),db['sequelize']['fn']('IF',db[_0x365b('0x1e')][_0x365b('0x22')](_0x365b('0x2f')))),'outboundNoAnswerCallsDay'],[db[_0x365b('0x1e')]['fn'](_0x365b('0x1f'),db[_0x365b('0x1e')]['fn']('IF',db['sequelize'][_0x365b('0x22')](_0x365b('0x23')))),'outboundAnswerCallsDay'],[db[_0x365b('0x1e')]['fn']('COUNT',db[_0x365b('0x1e')]['fn']('IF',db[_0x365b('0x1e')][_0x365b('0x22')]('`state`\x20=\x205,\x201,\x20null'))),_0x365b('0x30')],[db['sequelize']['fn'](_0x365b('0x1f'),db[_0x365b('0x1e')]['fn']('IF',db['sequelize'][_0x365b('0x22')](_0x365b('0x31')))),_0x365b('0x32')],[db[_0x365b('0x1e')]['fn']('COUNT',db[_0x365b('0x1e')]['fn']('IF',db[_0x365b('0x1e')][_0x365b('0x22')](_0x365b('0x33')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x365b('0x1f'),db[_0x365b('0x1e')]['fn']('IF',db['sequelize'][_0x365b('0x22')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x365b('0x34')],[db['sequelize']['fn'](_0x365b('0x1f'),db[_0x365b('0x1e')]['fn']('IF',db['sequelize'][_0x365b('0x22')](_0x365b('0x35')))),_0x365b('0x36')],[db[_0x365b('0x1e')]['fn'](_0x365b('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x365b('0x22')](_0x365b('0x37')))),'outboundBlacklistCallsDay'],[db[_0x365b('0x1e')]['fn']('COUNT',db[_0x365b('0x1e')]['fn']('IF',db[_0x365b('0x1e')][_0x365b('0x22')](_0x365b('0x38')))),'outboundOriginateFailureCallsDay'],[db[_0x365b('0x1e')]['fn']('COUNT',db[_0x365b('0x1e')]['fn']('IF',db[_0x365b('0x1e')][_0x365b('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x365b('0x1e')]['fn'](_0x365b('0x1f'),db[_0x365b('0x1e')]['fn']('IF',db[_0x365b('0x1e')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0x365b('0x39')],[db[_0x365b('0x1e')]['fn'](_0x365b('0x1f'),db[_0x365b('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x365b('0x3a')],[db[_0x365b('0x1e')]['fn'](_0x365b('0x1f'),db[_0x365b('0x1e')]['fn']('IF',db['sequelize'][_0x365b('0x22')](_0x365b('0x3b')))),_0x365b('0x3c')]],'group':[_0x365b('0x3d')]})[_0x365b('0x1a')](function(_0x58bad1){logger[_0x365b('0xd')]('GetVoiceQueueHopperHistory',_0x342ae6);logger['debug'](_0x365b('0x2a'),_0x342ae6,JSON['stringify'](_0x58bad1));_0x477d26(_0x58bad1);})[_0x365b('0x15')](function(_0x6f8194){logger[_0x365b('0x12')](_0x365b('0x2a'),_0x6f8194[_0x365b('0x13')],_0x342ae6);_0x2ff7ef(_0x14b31d[_0x365b('0x12')](0x1f4,_0x6f8194[_0x365b('0x13')]));});});};exports[_0x365b('0x3e')]=function(_0x35f3d3){var _0x3afd8a=this;return new Promise(function(_0x1a5fb0,_0x4acea8){return db[_0x365b('0x2b')][_0x365b('0x1c')]({'raw':_0x35f3d3[_0x365b('0x18')]?_0x35f3d3[_0x365b('0x18')][_0x365b('0x19')]===undefined?!![]:![]:!![],'where':_0x35f3d3[_0x365b('0x18')]?_0x35f3d3[_0x365b('0x18')][_0x365b('0x1d')]||null:null,'attributes':[[_0x365b('0x3d'),_0x365b('0x2c')],[db[_0x365b('0x1e')]['fn']('COUNT',db[_0x365b('0x1e')][_0x365b('0x20')]('id')),_0x365b('0x3f')],[db['sequelize']['fn']('COUNT',db[_0x365b('0x1e')]['fn']('IF',db[_0x365b('0x1e')][_0x365b('0x22')](_0x365b('0x23')))),'ivrAnswerCallsDay']],'group':[_0x365b('0x3d')]})['then'](function(_0x5eaff2){logger[_0x365b('0xd')](_0x365b('0x3e'),_0x35f3d3);logger[_0x365b('0x10')](_0x365b('0x3e'),_0x35f3d3,JSON[_0x365b('0x11')](_0x5eaff2));_0x1a5fb0(_0x5eaff2);})[_0x365b('0x15')](function(_0x415a26){logger[_0x365b('0x12')](_0x365b('0x3e'),_0x415a26[_0x365b('0x13')],_0x35f3d3);_0x4acea8(_0x3afd8a['error'](0x1f4,_0x415a26['message']));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js
index 1560fe1..0c2edf8 100644
--- a/server/api/cmHopperHistory/index.js
+++ b/server/api/cmHopperHistory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdefc=['exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/:id','put','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdefc,0x1b3));var _0xcdef=function(_0x3d7de8,_0x2a2ec4){_0x3d7de8=_0x3d7de8-0x0;var _0x5e9a0c=_0xdefc[_0x3d7de8];return _0x5e9a0c;};'use strict';var multer=require(_0xcdef('0x0'));var util=require(_0xcdef('0x1'));var path=require(_0xcdef('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcdef('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xcdef('0x4'));var config=require(_0xcdef('0x5'));var controller=require(_0xcdef('0x6'));router[_0xcdef('0x7')]('/',auth[_0xcdef('0x8')](),controller[_0xcdef('0x9')]);router[_0xcdef('0x7')]('/describe',auth[_0xcdef('0x8')](),controller['describe']);router[_0xcdef('0x7')](_0xcdef('0xa'),auth[_0xcdef('0x8')](),controller['show']);router['post']('/',auth[_0xcdef('0x8')](),controller['create']);router[_0xcdef('0xb')](_0xcdef('0xa'),auth[_0xcdef('0x8')](),controller[_0xcdef('0xc')]);module[_0xcdef('0xd')]=router;
\ No newline at end of file
+var _0x943c=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','exports','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x1dc237,_0x22a58e){var _0x8e4d58=function(_0x47ce92){while(--_0x47ce92){_0x1dc237['push'](_0x1dc237['shift']());}};_0x8e4d58(++_0x22a58e);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc943('0x0'));var util=require(_0xc943('0x1'));var path=require(_0xc943('0x2'));var timeout=require(_0xc943('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xc943('0x4'));var interaction=require(_0xc943('0x5'));var config=require(_0xc943('0x6'));var controller=require('./cmHopperHistory.controller');router[_0xc943('0x7')]('/',auth[_0xc943('0x8')](),controller[_0xc943('0x9')]);router[_0xc943('0x7')](_0xc943('0xa'),auth[_0xc943('0x8')](),controller[_0xc943('0xb')]);router['get'](_0xc943('0xc'),auth[_0xc943('0x8')](),controller[_0xc943('0xd')]);router[_0xc943('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc943('0xf')](_0xc943('0xc'),auth['isAuthenticated'](),controller['update']);module[_0xc943('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js
index bb73d2f..a66a361 100644
--- a/server/api/cmList/cmList.attributes.js
+++ b/server/api/cmList/cmList.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6aa7=['name','sequelize','STRING'];(function(_0x303797,_0x371c62){var _0x36635a=function(_0x878d21){while(--_0x878d21){_0x303797['push'](_0x303797['shift']());}};_0x36635a(++_0x371c62);}(_0x6aa7,0x178));var _0x76aa=function(_0x53482c,_0x522389){_0x53482c=_0x53482c-0x0;var _0x52c4d4=_0x6aa7[_0x53482c];return _0x52c4d4;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'unique':_0x76aa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x76aa('0x1')]},'dialPrefix':{'type':Sequelize[_0x76aa('0x1')]}};
\ No newline at end of file
+var _0x46ed=['sequelize','exports','name','STRING'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x46ed,0x168));var _0xd46e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x46ed[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd46e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd46e('0x3')]},'dialPrefix':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js
index 517f653..41d1759 100644
--- a/server/api/cmList/cmList.controller.js
+++ b/server/api/cmList/cmList.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34e8=['html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./cmList.socket','register','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','Lists','stack','name','send','index','CmList','model','query','keys','filters','intersection','attributes','fields','limit','sort','where','filter','merge','map','key','field','include','rows','catch','show','length','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','nolimit','pick','ListId','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','omit','success','dataValues','errors','push','message','getContacts','CustomFields','concat','format','cf_%d','hasOwnProperty','raw','CmCustomField','order','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','type','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User'];(function(_0x4282fc,_0x3e6b7e){var _0x264eab=function(_0xc73071){while(--_0xc73071){_0x4282fc['push'](_0x4282fc['shift']());}};_0x264eab(++_0x3e6b7e);}(_0x34e8,0x12c));var _0x834e=function(_0x4b54cd,_0x127553){_0x4b54cd=_0x4b54cd-0x0;var _0x38b2ed=_0x34e8[_0x4b54cd];return _0x38b2ed;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];config[_0x834e('0x1c')]=_['defaults'](config[_0x834e('0x1c')],{'host':_0x834e('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x834e('0x1c')]));require(_0x834e('0x1e'))[_0x834e('0x1f')](socket);function respondWithStatusCode(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xcc;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x20')](_0x50e860);}return _0x21cc0a['status'](_0x50e860)[_0x834e('0x21')]();};}function respondWithResult(_0x4a9cdc,_0x38a8cd){_0x38a8cd=_0x38a8cd||0xc8;return function(_0x36d443){if(_0x36d443){return _0x4a9cdc['status'](_0x38a8cd)[_0x834e('0x22')](_0x36d443);}};}function respondWithFilteredResult(_0x22106e,_0x370fb5){return function(_0x50b3f6){if(_0x50b3f6){var _0x283e56=_0x50b3f6[_0x834e('0x23')],_0x211e9a=_0x370fb5[_0x834e('0x24')],_0x34e41a=_0x370fb5[_0x834e('0x24')]+_0x370fb5['limit'],_0xb993a1;if(_0x34e41a>=_0x283e56){_0x34e41a=_0x283e56;_0xb993a1=0xc8;}else{_0xb993a1=0xce;}_0x22106e[_0x834e('0x25')](_0xb993a1);return _0x22106e[_0x834e('0x26')](_0x834e('0x27'),_0x211e9a+'-'+_0x34e41a+'/'+_0x283e56)[_0x834e('0x22')](_0x50b3f6);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x28')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x29')](_0x5a05c0);}return _0x45a630[_0x834e('0x2a')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x2b')](_0x8d406e)[_0x834e('0x2c')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2d')]()[_0x834e('0x2c')](function(){var _0x338636=_0x58f4fd['get']({'plain':!![]});var _0x24fcf7=_0x834e('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x24fcf7,'resourceId':_0x338636['id']}})[_0x834e('0x2c')](function(){return _0x58f4fd;});})['then'](function(){_0x25ee1d[_0x834e('0x25')](0xcc)[_0x834e('0x21')]();});}};}function handleEntityNotFound(_0x3db026,_0x2cc2eb){return function(_0x3cd928){if(!_0x3cd928){_0x3db026[_0x834e('0x20')](0x194);}return _0x3cd928;};}function handleError(_0x491919,_0x510780){_0x510780=_0x510780||0x1f4;return function(_0x4dc64a){logger['error'](_0x4dc64a[_0x834e('0x2f')]);if(_0x4dc64a[_0x834e('0x30')]){delete _0x4dc64a[_0x834e('0x30')];}_0x491919['status'](_0x510780)[_0x834e('0x31')](_0x4dc64a);};}exports[_0x834e('0x32')]=function(_0x1f3671,_0x1e026a){var _0x4551f5={},_0x390119={},_0x3d149d={'count':0x0,'rows':[]};var _0xfaf716=db[_0x834e('0x33')]['rawAttributes'];_0x390119[_0x834e('0x34')]=_['keys'](_0xfaf716);_0x390119[_0x834e('0x35')]=_[_0x834e('0x36')](_0x1f3671[_0x834e('0x35')]);_0x390119[_0x834e('0x37')]=_[_0x834e('0x38')](_0x390119[_0x834e('0x34')],_0x390119[_0x834e('0x35')]);_0x4551f5[_0x834e('0x39')]=_[_0x834e('0x38')](_0x390119[_0x834e('0x34')],qs['fields'](_0x1f3671[_0x834e('0x35')][_0x834e('0x3a')]));_0x4551f5[_0x834e('0x39')]=_0x4551f5[_0x834e('0x39')]['length']?_0x4551f5[_0x834e('0x39')]:_0x390119[_0x834e('0x34')];if(!_0x1f3671['query']['hasOwnProperty']('nolimit')){_0x4551f5[_0x834e('0x3b')]=qs[_0x834e('0x3b')](_0x1f3671[_0x834e('0x35')][_0x834e('0x3b')]);_0x4551f5[_0x834e('0x24')]=qs[_0x834e('0x24')](_0x1f3671['query'][_0x834e('0x24')]);}_0x4551f5['order']=qs[_0x834e('0x3c')](_0x1f3671[_0x834e('0x35')]['sort']);_0x4551f5[_0x834e('0x3d')]=qs[_0x834e('0x37')](_['pick'](_0x1f3671['query'],_0x390119[_0x834e('0x37')]));if(_0x1f3671[_0x834e('0x35')][_0x834e('0x3e')]){_0x4551f5[_0x834e('0x3d')]=_[_0x834e('0x3f')](_0x4551f5['where'],{'$or':_[_0x834e('0x40')](_0xfaf716,function(_0x548d1d){if(_0x548d1d['type'][_0x834e('0x41')]!=='VIRTUAL'){var _0x2e5239={};_0x2e5239[_0x548d1d[_0x834e('0x42')]]={'$like':'%'+_0x1f3671[_0x834e('0x35')][_0x834e('0x3e')]+'%'};return _0x2e5239;}})});}_0x4551f5=_[_0x834e('0x3f')]({},_0x4551f5,_0x1f3671['options']);var _0x207523={'where':_0x4551f5[_0x834e('0x3d')]};return db[_0x834e('0x33')]['count'](_0x207523)[_0x834e('0x2c')](function(_0x16ac45){_0x3d149d['count']=_0x16ac45;if(_0x1f3671[_0x834e('0x35')]['includeAll']){_0x4551f5[_0x834e('0x43')]=[{'all':!![]}];}return db[_0x834e('0x33')]['findAll'](_0x4551f5);})['then'](function(_0x22ea21){_0x3d149d[_0x834e('0x44')]=_0x22ea21;return _0x3d149d;})[_0x834e('0x2c')](respondWithFilteredResult(_0x1e026a,_0x4551f5))[_0x834e('0x45')](handleError(_0x1e026a,null));};exports[_0x834e('0x46')]=function(_0x23feea,_0x195204){var _0x4a3381={'raw':![],'where':{'id':_0x23feea['params']['id']}},_0x13d45a={};_0x13d45a[_0x834e('0x34')]=_['keys'](db[_0x834e('0x33')]['rawAttributes']);_0x13d45a[_0x834e('0x35')]=_[_0x834e('0x36')](_0x23feea['query']);_0x13d45a[_0x834e('0x37')]=_[_0x834e('0x38')](_0x13d45a[_0x834e('0x34')],_0x13d45a[_0x834e('0x35')]);_0x4a3381[_0x834e('0x39')]=_[_0x834e('0x38')](_0x13d45a[_0x834e('0x34')],qs[_0x834e('0x3a')](_0x23feea[_0x834e('0x35')][_0x834e('0x3a')]));_0x4a3381['attributes']=_0x4a3381[_0x834e('0x39')][_0x834e('0x47')]?_0x4a3381['attributes']:_0x13d45a[_0x834e('0x34')];if(_0x23feea[_0x834e('0x35')][_0x834e('0x48')]){_0x4a3381[_0x834e('0x43')]=[{'all':!![]}];}_0x4a3381=_[_0x834e('0x3f')]({},_0x4a3381,_0x23feea[_0x834e('0x49')]);return db['CmList']['find'](_0x4a3381)[_0x834e('0x2c')](handleEntityNotFound(_0x195204,null))[_0x834e('0x2c')](respondWithResult(_0x195204,null))[_0x834e('0x45')](handleError(_0x195204,null));};exports[_0x834e('0x4a')]=function(_0x3da408,_0xd1d83b){return db[_0x834e('0x33')][_0x834e('0x4a')](_0x3da408[_0x834e('0x4b')],{})[_0x834e('0x2c')](function(_0xf02f0d){var _0x385435=_0x3da408[_0x834e('0x4c')][_0x834e('0x4d')]({'plain':!![]});if(!_0x385435)throw new Error(_0x834e('0x4e'));if(_0x385435[_0x834e('0x4f')]===_0x834e('0x4c')){var _0x32b8f7=_0xf02f0d[_0x834e('0x4d')]({'plain':!![]});var _0x1adf86='Lists';return db[_0x834e('0x50')][_0x834e('0x51')]({'where':{'name':_0x1adf86,'userProfileId':_0x385435['userProfileId']},'raw':!![]})[_0x834e('0x2c')](function(_0x3b0988){if(_0x3b0988&&_0x3b0988['autoAssociation']===0x0){return db[_0x834e('0x52')][_0x834e('0x4a')]({'name':_0x32b8f7[_0x834e('0x30')],'resourceId':_0x32b8f7['id'],'type':_0x3b0988[_0x834e('0x30')],'sectionId':_0x3b0988['id']},{})[_0x834e('0x2c')](function(){return _0xf02f0d;});}else{return _0xf02f0d;}})[_0x834e('0x45')](function(_0x4549ba){logger['error'](_0x834e('0x53'),_0x4549ba);throw _0x4549ba;});}return _0xf02f0d;})[_0x834e('0x2c')](respondWithResult(_0xd1d83b,0xc9))[_0x834e('0x45')](handleError(_0xd1d83b,null));};exports[_0x834e('0x2b')]=function(_0x86ad2b,_0x396bbe){if(_0x86ad2b[_0x834e('0x4b')]['id']){delete _0x86ad2b[_0x834e('0x4b')]['id'];}return db['CmList'][_0x834e('0x51')]({'where':{'id':_0x86ad2b['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x396bbe,null))['then'](saveUpdates(_0x86ad2b[_0x834e('0x4b')],null))['then'](respondWithResult(_0x396bbe,null))['catch'](handleError(_0x396bbe,null));};exports[_0x834e('0x2d')]=function(_0x3e1bee,_0x5291ae){return db['CmList'][_0x834e('0x51')]({'where':{'id':_0x3e1bee[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x5291ae,null))[_0x834e('0x2c')](removeEntity(_0x5291ae,null))[_0x834e('0x45')](handleError(_0x5291ae,null));};exports[_0x834e('0x55')]=function(_0x3d3f2b,_0x4273f1){return db['CmList'][_0x834e('0x55')]()[_0x834e('0x2c')](respondWithResult(_0x4273f1,null))['catch'](handleError(_0x4273f1,null));};exports[_0x834e('0x56')]=function(_0x4e2b22,_0x3e58ef,_0x45eceb){if(_0x4e2b22['body']['id']){delete _0x4e2b22[_0x834e('0x4b')]['id'];}return db[_0x834e('0x33')][_0x834e('0x51')]({'where':{'id':_0x4e2b22[_0x834e('0x54')]['id']}})['then'](handleEntityNotFound(_0x3e58ef,null))[_0x834e('0x2c')](function(_0x438f75){if(_0x438f75){_0x4e2b22[_0x834e('0x4b')]['ListId']=_0x438f75['id'];return db[_0x834e('0x57')][_0x834e('0x4a')](_0x4e2b22[_0x834e('0x4b')]);}})[_0x834e('0x2c')](respondWithResult(_0x3e58ef,null))[_0x834e('0x45')](handleError(_0x3e58ef,null));};exports[_0x834e('0x58')]=function(_0x3a1426,_0x1def00,_0x208c21){var _0xfcccd8={'raw':![],'where':{}};var _0x1e4310={};var _0x1dfa95={'count':0x0,'rows':[]};return db[_0x834e('0x33')][_0x834e('0x59')]({'where':{'id':_0x3a1426[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x1def00,null))[_0x834e('0x2c')](function(_0x14ed83){if(_0x14ed83){_0x1e4310[_0x834e('0x34')]=_[_0x834e('0x36')](db[_0x834e('0x57')][_0x834e('0x5a')]);_0x1e4310['query']=_[_0x834e('0x36')](_0x3a1426[_0x834e('0x35')]);_0x1e4310[_0x834e('0x37')]=_[_0x834e('0x38')](_0x1e4310['model'],_0x1e4310[_0x834e('0x35')]);_0xfcccd8['attributes']=_['intersection'](_0x1e4310[_0x834e('0x34')],qs[_0x834e('0x3a')](_0x3a1426[_0x834e('0x35')][_0x834e('0x3a')]));_0xfcccd8[_0x834e('0x39')]=_0xfcccd8[_0x834e('0x39')][_0x834e('0x47')]?_0xfcccd8[_0x834e('0x39')]:_0x1e4310['model'];if(!_0x3a1426[_0x834e('0x35')]['hasOwnProperty'](_0x834e('0x5b'))){_0xfcccd8[_0x834e('0x3b')]=qs['limit'](_0x3a1426['query'][_0x834e('0x3b')]);_0xfcccd8[_0x834e('0x24')]=qs[_0x834e('0x24')](_0x3a1426[_0x834e('0x35')][_0x834e('0x24')]);}_0xfcccd8['order']=qs[_0x834e('0x3c')](_0x3a1426[_0x834e('0x35')][_0x834e('0x3c')]);_0xfcccd8[_0x834e('0x3d')]=qs[_0x834e('0x37')](_[_0x834e('0x5c')](_0x3a1426[_0x834e('0x35')],_0x1e4310[_0x834e('0x37')]));_0xfcccd8[_0x834e('0x3d')][_0x834e('0x5d')]=_0x14ed83['id'];if(_0x3a1426['query'][_0x834e('0x3e')]){_0xfcccd8[_0x834e('0x3d')]=_[_0x834e('0x3f')](_0xfcccd8[_0x834e('0x3d')],{'$or':_['map'](_0xfcccd8[_0x834e('0x39')],function(_0x4ac5f2){var _0x5ce8b0={};_0x5ce8b0[_0x4ac5f2]={'$like':'%'+_0x3a1426['query'][_0x834e('0x3e')]+'%'};return _0x5ce8b0;})});}_0xfcccd8=_[_0x834e('0x3f')]({},_0xfcccd8,_0x3a1426['options']);return db[_0x834e('0x57')][_0x834e('0x23')]({'where':_0xfcccd8['where']})[_0x834e('0x2c')](function(_0x18ccb2){_0x1dfa95['count']=_0x18ccb2;if(_0x3a1426['query'][_0x834e('0x48')]){_0xfcccd8[_0x834e('0x43')]=[{'all':!![]}];}return db[_0x834e('0x57')][_0x834e('0x5e')](_0xfcccd8);})[_0x834e('0x2c')](function(_0x493239){_0x1dfa95[_0x834e('0x44')]=_0x493239;return _0x1dfa95;});}})['then'](respondWithFilteredResult(_0x1def00,_0xfcccd8))[_0x834e('0x45')](handleError(_0x1def00,null));};exports[_0x834e('0x5f')]=function(_0x2c758c,_0x5afb41,_0x33a3cd){return db[_0x834e('0x33')]['find']({'where':{'id':_0x2c758c[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x5afb41,null))[_0x834e('0x2c')](function(_0x50d0a3){if(_0x50d0a3){return _0x50d0a3[_0x834e('0x5f')](_0x2c758c[_0x834e('0x35')][_0x834e('0x60')]);}})[_0x834e('0x2c')](respondWithStatusCode(_0x5afb41,null))[_0x834e('0x45')](handleError(_0x5afb41,null));};exports[_0x834e('0x61')]=function(_0x1372dd,_0x23b5d9,_0xd49002){return db[_0x834e('0x33')]['find']({'where':{'id':_0x1372dd['params']['id']}})['then'](handleEntityNotFound(_0x23b5d9,null))[_0x834e('0x2c')](function(_0x1135a5){if(_0x1135a5){var _0x313c03=[];var _0x37fa2c={'success':[],'errors':[]};return db[_0x834e('0x62')]['describe']()['then'](function(_0x4520fc){if(_0x1372dd[_0x834e('0x4b')][_0x834e('0x63')]&&_[_0x834e('0x64')](_0x1372dd[_0x834e('0x4b')]['tags'])){if(_0x1372dd[_0x834e('0x4b')][_0x834e('0x63')][_0x834e('0x47')]){_0x1372dd['body'][_0x834e('0x63')]=_0x1372dd[_0x834e('0x4b')][_0x834e('0x63')][_0x834e('0x65')](';')+';';}else{_0x1372dd[_0x834e('0x4b')]['tags']=null;}}else{_0x1372dd['body'][_0x834e('0x63')]=null;}if(_0x1372dd[_0x834e('0x4b')]&&_['isArray'](_0x1372dd[_0x834e('0x4b')])){for(var _0x509427=0x0;_0x509427<_0x1372dd[_0x834e('0x4b')][_0x834e('0x47')];_0x509427+=0x1){_0x1372dd[_0x834e('0x4b')][_0x509427]['ListId']=_0x1372dd[_0x834e('0x54')]['id'];_0x313c03['push'](_0x1372dd['body'][_0x509427]);}return BPromise['each'](_0x313c03,function(_0x6735e6){return db[_0x834e('0x62')][_0x834e('0x4a')](_[_0x834e('0x66')](_0x6735e6,[_0x834e('0x60'),'id'])||{},{'fields':_[_0x834e('0x36')](_0x4520fc),'raw':!![]})[_0x834e('0x2c')](function(_0x179892){_0x37fa2c[_0x834e('0x67')]['push'](_0x179892[_0x834e('0x68')]);})['catch'](function(_0x11a9f7){_0x37fa2c[_0x834e('0x69')][_0x834e('0x6a')]({'data':_0x6735e6,'error':_0x11a9f7[_0x834e('0x6b')]});});})[_0x834e('0x2c')](function(_0x116830){return _0x37fa2c;})['catch'](function(_0x56d0f8){return _0x56d0f8;});}else{_0x23b5d9[_0x834e('0x25')](0x190)[_0x834e('0x22')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x834e('0x2c')](respondWithResult(_0x23b5d9,null))[_0x834e('0x45')](handleError(_0x23b5d9,null));};exports[_0x834e('0x6c')]=function(_0x1e225f,_0xc75f5e,_0x5a75e3){var _0x29839d;return db[_0x834e('0x33')]['find']({'where':{'id':_0x1e225f['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x834e('0x6d')}]})[_0x834e('0x2c')](handleEntityNotFound(_0xc75f5e,null))['then'](function(_0x23ce49){if(_0x23ce49){_0x29839d=_0x23ce49;return db[_0x834e('0x62')]['rawAttributes'];}})[_0x834e('0x2c')](function(_0x49eed7){if(_0x49eed7){var _0x4813a8={};var _0x41dfd9={};_0x41dfd9[_0x834e('0x34')]=_[_0x834e('0x6e')](_[_0x834e('0x36')](_0x49eed7),_['map'](_0x29839d[_0x834e('0x6d')],function(_0x34ecc8){return util[_0x834e('0x6f')](_0x834e('0x70'),_0x34ecc8['id']);}));_0x41dfd9[_0x834e('0x35')]=_[_0x834e('0x36')](_0x1e225f[_0x834e('0x35')]);_0x41dfd9[_0x834e('0x37')]=_[_0x834e('0x38')](_0x41dfd9[_0x834e('0x34')],_0x41dfd9[_0x834e('0x35')]);_0x4813a8[_0x834e('0x39')]=_[_0x834e('0x38')](_0x41dfd9[_0x834e('0x34')],qs[_0x834e('0x3a')](_0x1e225f[_0x834e('0x35')][_0x834e('0x3a')]));_0x4813a8[_0x834e('0x39')]=_0x4813a8[_0x834e('0x39')][_0x834e('0x47')]?_0x4813a8[_0x834e('0x39')]:_0x41dfd9[_0x834e('0x34')];if(!_0x1e225f['query'][_0x834e('0x71')](_0x834e('0x5b'))){_0x4813a8[_0x834e('0x3b')]=qs[_0x834e('0x3b')](_0x1e225f[_0x834e('0x35')][_0x834e('0x3b')]);_0x4813a8[_0x834e('0x24')]=qs[_0x834e('0x24')](_0x1e225f[_0x834e('0x35')]['offset']);}_0x4813a8['order']=qs['sort'](_0x1e225f[_0x834e('0x35')]['sort']);_0x4813a8[_0x834e('0x3d')]=qs[_0x834e('0x37')](_[_0x834e('0x5c')](_0x1e225f['query'],_0x41dfd9[_0x834e('0x37')]));_0x4813a8[_0x834e('0x72')]=!![];if(_0x1e225f[_0x834e('0x35')][_0x834e('0x3e')]){_0x4813a8[_0x834e('0x3d')]=_[_0x834e('0x3f')](_0x4813a8['where'],{'$or':_[_0x834e('0x40')](_0x4813a8[_0x834e('0x39')],function(_0x24ff45){var _0x430973={};_0x430973[_0x24ff45]={'$like':'%'+_0x1e225f[_0x834e('0x35')]['filter']+'%'};return _0x430973;})});}_0x4813a8=_['merge']({},_0x4813a8,_0x1e225f['options']);return _0x29839d['getContacts'](_0x4813a8);}})[_0x834e('0x2c')](respondWithResult(_0xc75f5e,null))[_0x834e('0x45')](handleError(_0xc75f5e,null));};exports['getContactsCsv']=function(_0x3bd1e7,_0xf9fec9,_0x4fb709){var _0x296629;return db[_0x834e('0x33')][_0x834e('0x51')]({'where':{'id':_0x3bd1e7[_0x834e('0x54')]['id']},'include':[{'model':db[_0x834e('0x73')],'as':_0x834e('0x6d')}]})['then'](handleEntityNotFound(_0xf9fec9,null))['then'](function(_0x43b92f){if(_0x43b92f){_0x296629=_0x43b92f;return db[_0x834e('0x62')][_0x834e('0x5a')];}})['then'](function(_0x34fb30){if(_0x34fb30){var _0x3753cc={};var _0x582b24={};_0x582b24[_0x834e('0x34')]=_[_0x834e('0x6e')](_[_0x834e('0x36')](_0x34fb30),_[_0x834e('0x40')](_0x296629['CustomFields'],function(_0x366a9f){return util['format']('cf_%d',_0x366a9f['id']);}));_0x582b24[_0x834e('0x35')]=_[_0x834e('0x36')](_0x3bd1e7[_0x834e('0x35')]);_0x582b24[_0x834e('0x37')]=_[_0x834e('0x38')](_0x582b24[_0x834e('0x34')],_0x582b24['query']);_0x3753cc['attributes']=_[_0x834e('0x38')](_0x582b24[_0x834e('0x34')],qs[_0x834e('0x3a')](_0x3bd1e7[_0x834e('0x35')][_0x834e('0x3a')]));_0x3753cc[_0x834e('0x39')]=_0x3753cc[_0x834e('0x39')]['length']?_0x3753cc[_0x834e('0x39')]:_0x582b24[_0x834e('0x34')];if(!_0x3bd1e7['query'][_0x834e('0x71')](_0x834e('0x5b'))){_0x3753cc[_0x834e('0x3b')]=qs[_0x834e('0x3b')](_0x3bd1e7[_0x834e('0x35')][_0x834e('0x3b')]);_0x3753cc[_0x834e('0x24')]=qs[_0x834e('0x24')](_0x3bd1e7[_0x834e('0x35')][_0x834e('0x24')]);}_0x3753cc[_0x834e('0x74')]=qs[_0x834e('0x3c')](_0x3bd1e7[_0x834e('0x35')][_0x834e('0x3c')]);_0x3753cc['where']=qs[_0x834e('0x37')](_[_0x834e('0x5c')](_0x3bd1e7['query'],_0x582b24[_0x834e('0x37')]));_0x3753cc['raw']=!![];if(_0x3bd1e7[_0x834e('0x35')]['filter']){_0x3753cc[_0x834e('0x3d')]=_['merge'](_0x3753cc[_0x834e('0x3d')],{'$or':_[_0x834e('0x40')](_0x3753cc[_0x834e('0x39')],function(_0x1aac37){var _0x57ee25={};_0x57ee25[_0x1aac37]={'$like':'%'+_0x3bd1e7[_0x834e('0x35')][_0x834e('0x3e')]+'%'};return _0x57ee25;})});}_0x3753cc=_[_0x834e('0x3f')]({},_0x3753cc,_0x3bd1e7[_0x834e('0x49')]);return _0x296629[_0x834e('0x6c')](_0x3753cc);}})[_0x834e('0x2c')](function(_0x2f6f97){if(!_[_0x834e('0x75')](_0x2f6f97)){var _0x2aa430=toCsv(_0x2f6f97);var _0x214c73=Date[_0x834e('0x76')]();fs[_0x834e('0x77')](util[_0x834e('0x6f')](_0x834e('0x78'),_0x296629['id'],_0x214c73),_0x2aa430);_0xf9fec9[_0x834e('0x79')](_0x834e('0x7a'),_0x834e('0x7b')+util['format']('list_%d_%s.csv',_0x296629['id'],_0x214c73));_0xf9fec9[_0x834e('0x79')](_0x834e('0x7c'),_0x834e('0x7d'));return _0xf9fec9[_0x834e('0x7e')](util[_0x834e('0x6f')](_0x834e('0x78'),_0x296629['id'],_0x214c73));}else{return _0xf9fec9[_0x834e('0x20')](0xcc);}})[_0x834e('0x45')](handleError(_0xf9fec9,null));};exports[_0x834e('0x7f')]=function(_0x58cd3b,_0x25f1f9,_0x32645e){var _0x513d9e;delete _0x58cd3b[_0x834e('0x4b')]['id'];return db['CmList'][_0x834e('0x59')]({'where':{'id':_0x58cd3b[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x25f1f9,null))['then'](function(_0x1a65b4){if(_0x1a65b4){return db[_0x834e('0x80')]['transaction'](function(_0x4f7c62){return db[_0x834e('0x73')][_0x834e('0x4a')](_0x58cd3b['body'],{'transaction':_0x4f7c62})[_0x834e('0x2c')](function(_0x132edd){_0x513d9e=_0x132edd;return _0x1a65b4[_0x834e('0x81')](_0x132edd,{'transaction':_0x4f7c62});})[_0x834e('0x2c')](function(){var _0x170ec2={'type':db['Sequelize']['TEXT'],'transaction':_0x4f7c62};switch(_0x58cd3b[_0x834e('0x4b')]['type']){case'text':_0x170ec2['type']=db[_0x834e('0x82')][_0x834e('0x83')];break;case'number':_0x170ec2[_0x834e('0x84')]=db[_0x834e('0x82')][_0x834e('0x85')];break;case _0x834e('0x86'):_0x170ec2['type']=db[_0x834e('0x82')][_0x834e('0x87')];_0x170ec2[_0x834e('0x88')]=![];break;default:}return db['sequelize'][_0x834e('0x89')]['addColumn'](_0x834e('0x8a'),util['format'](_0x834e('0x8b'),_0x513d9e['id']),_0x170ec2);})[_0x834e('0x2c')](function(){return _0x513d9e;});});}})['then'](respondWithResult(_0x25f1f9,null))[_0x834e('0x45')](handleError(_0x25f1f9,null));};exports[_0x834e('0x8c')]=function(_0x41e7a8,_0x1b81ca,_0x410895){var _0x24d77c={};var _0x5bb5ff={};var _0x2d4b29;var _0x464339;return db[_0x834e('0x33')][_0x834e('0x59')]({'where':{'id':_0x41e7a8[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x1b81ca,null))['then'](function(_0x448420){if(_0x448420){_0x2d4b29=_0x448420;_0x5bb5ff['model']=_['keys'](db[_0x834e('0x73')]['rawAttributes']);_0x5bb5ff['query']=_[_0x834e('0x36')](_0x41e7a8[_0x834e('0x35')]);_0x5bb5ff[_0x834e('0x37')]=_[_0x834e('0x38')](_0x5bb5ff[_0x834e('0x34')],_0x5bb5ff[_0x834e('0x35')]);_0x24d77c[_0x834e('0x39')]=_[_0x834e('0x38')](_0x5bb5ff[_0x834e('0x34')],qs[_0x834e('0x3a')](_0x41e7a8[_0x834e('0x35')][_0x834e('0x3a')]));_0x24d77c[_0x834e('0x39')]=_0x24d77c[_0x834e('0x39')]['length']?_0x24d77c[_0x834e('0x39')]:_0x5bb5ff['model'];_0x24d77c[_0x834e('0x74')]=qs[_0x834e('0x3c')](_0x41e7a8[_0x834e('0x35')][_0x834e('0x3c')]);_0x24d77c['where']=qs['filters'](_[_0x834e('0x5c')](_0x41e7a8[_0x834e('0x35')],_0x5bb5ff['filters']));_0x24d77c[_0x834e('0x3d')]=_[_0x834e('0x3f')](_0x24d77c['where'],{'$or':[{'ListId':_0x448420['id']},{'ListId':null}]});if(_0x41e7a8[_0x834e('0x35')][_0x834e('0x3e')]){_0x24d77c[_0x834e('0x3d')]=_[_0x834e('0x3f')](_0x24d77c['where'],{'$or':_['map'](_0x24d77c['attributes'],function(_0x48e14c){var _0x3baa81={};_0x3baa81[_0x48e14c]={'$like':'%'+_0x41e7a8[_0x834e('0x35')]['filter']+'%'};return _0x3baa81;})});}_0x24d77c=_[_0x834e('0x3f')]({},_0x24d77c,_0x41e7a8['options']);return db[_0x834e('0x73')][_0x834e('0x8d')](_0x24d77c);}})[_0x834e('0x2c')](respondWithResult(_0x1b81ca,null))[_0x834e('0x45')](handleError(_0x1b81ca,null));};exports[_0x834e('0x8e')]=function(_0xfa6cdb,_0x3c775f,_0x4fc61d){return db[_0x834e('0x33')][_0x834e('0x51')]({'where':{'id':_0xfa6cdb['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x3c775f,null))[_0x834e('0x2c')](function(_0x536f66){if(_0x536f66){return _0x536f66['addAgents'](_0xfa6cdb['body'][_0x834e('0x60')],_[_0x834e('0x66')](_0xfa6cdb[_0x834e('0x4b')],['ids','id'])||{})[_0x834e('0x8f')](function(_0x45d444){for(var _0xbd0346=0x0;_0xbd0346<_0xfa6cdb[_0x834e('0x4b')][_0x834e('0x60')][_0x834e('0x47')];_0xbd0346+=0x1){socket[_0x834e('0x90')](_0x834e('0x91'),{'UserId':_0xfa6cdb[_0x834e('0x4b')][_0x834e('0x60')][_0xbd0346],'CmListId':_0xfa6cdb['params']['id']});}return _0x45d444;});}})['then'](respondWithResult(_0x3c775f,null))[_0x834e('0x45')](handleError(_0x3c775f,null));};exports[_0x834e('0x92')]=function(_0xbc7704,_0x3eda93,_0x4303a6){return db[_0x834e('0x33')][_0x834e('0x51')]({'where':{'id':_0xbc7704[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x3eda93,null))[_0x834e('0x2c')](function(_0x264adc){if(_0x264adc){return _0x264adc[_0x834e('0x92')](_0xbc7704[_0x834e('0x35')]['ids'])[_0x834e('0x2c')](function(){if(_[_0x834e('0x64')](_0xbc7704[_0x834e('0x35')][_0x834e('0x60')])){for(var _0x495697=0x0;_0x495697<_0xbc7704['query']['ids'][_0x834e('0x47')];_0x495697+=0x1){socket[_0x834e('0x90')](_0x834e('0x93'),{'UserId':Number(_0xbc7704[_0x834e('0x35')][_0x834e('0x60')][_0x495697]),'CmListId':Number(_0xbc7704[_0x834e('0x54')]['id'])});}}else{socket[_0x834e('0x90')](_0x834e('0x93'),{'UserId':Number(_0xbc7704['query']['ids']),'CmListId':Number(_0xbc7704['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3eda93,null))[_0x834e('0x45')](handleError(_0x3eda93,null));};exports[_0x834e('0x94')]=function(_0x37defd,_0x30d669,_0x72f950){var _0x386e10={};var _0x3bee40={};var _0x29ef2f;var _0x33757d;return db['CmList']['findOne']({'where':{'id':_0x37defd['params']['id']}})['then'](handleEntityNotFound(_0x30d669,null))[_0x834e('0x2c')](function(_0x17025e){if(_0x17025e){_0x29ef2f=_0x17025e;_0x3bee40[_0x834e('0x34')]=_[_0x834e('0x36')](db[_0x834e('0x95')][_0x834e('0x5a')]);_0x3bee40[_0x834e('0x35')]=_[_0x834e('0x36')](_0x37defd[_0x834e('0x35')]);_0x3bee40[_0x834e('0x37')]=_[_0x834e('0x38')](_0x3bee40[_0x834e('0x34')],_0x3bee40[_0x834e('0x35')]);_0x386e10[_0x834e('0x39')]=_[_0x834e('0x38')](_0x3bee40[_0x834e('0x34')],qs['fields'](_0x37defd[_0x834e('0x35')]['fields']));_0x386e10[_0x834e('0x39')]=_0x386e10[_0x834e('0x39')][_0x834e('0x47')]?_0x386e10['attributes']:_0x3bee40[_0x834e('0x34')];_0x386e10[_0x834e('0x74')]=qs['sort'](_0x37defd['query'][_0x834e('0x3c')]);_0x386e10[_0x834e('0x3d')]=qs[_0x834e('0x37')](_[_0x834e('0x5c')](_0x37defd[_0x834e('0x35')],_0x3bee40[_0x834e('0x37')]));if(_0x37defd[_0x834e('0x35')][_0x834e('0x3e')]){_0x386e10['where']=_[_0x834e('0x3f')](_0x386e10[_0x834e('0x3d')],{'$or':_[_0x834e('0x40')](_0x386e10[_0x834e('0x39')],function(_0x1912e6){var _0x614e15={};_0x614e15[_0x1912e6]={'$like':'%'+_0x37defd[_0x834e('0x35')]['filter']+'%'};return _0x614e15;})});}_0x386e10=_[_0x834e('0x3f')]({},_0x386e10,_0x37defd['options']);return _0x29ef2f['getAgents'](_0x386e10);}})[_0x834e('0x2c')](function(_0x1e0bc9){if(_0x1e0bc9){_0x33757d=_0x1e0bc9['length'];if(!_0x37defd[_0x834e('0x35')][_0x834e('0x71')]('nolimit')){_0x386e10[_0x834e('0x3b')]=qs[_0x834e('0x3b')](_0x37defd['query']['limit']);_0x386e10[_0x834e('0x24')]=qs[_0x834e('0x24')](_0x37defd['query']['offset']);}return _0x29ef2f[_0x834e('0x94')](_0x386e10);}})[_0x834e('0x2c')](function(_0x5d6f5e){if(_0x5d6f5e){return _0x5d6f5e?{'count':_0x33757d,'rows':_0x5d6f5e}:null;}})['then'](respondWithResult(_0x30d669,null))['catch'](handleError(_0x30d669,null));};
\ No newline at end of file
+var _0x54ef=['to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./cmList.socket','register','sendStatus','status','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','error','stack','name','CmList','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','catch','show','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','describe','ListId','findOne','Disposition','nolimit','map','rows','removeDispositions','ids','isArray','tags','join','push','each','CmContact','omit','dataValues','errors','message','json','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','hasOwnProperty','raw','getContacts','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','userCmList:save','emit','userCmList:remove','User','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce'];(function(_0x33dd26,_0x2ec7fd){var _0x89d408=function(_0x3b33e5){while(--_0x3b33e5){_0x33dd26['push'](_0x33dd26['shift']());}};_0x89d408(++_0x2ec7fd);}(_0x54ef,0x112));var _0xf54e=function(_0x2aef54,_0x5eb04f){_0x2aef54=_0x2aef54-0x0;var _0x546a70=_0x54ef[_0x2aef54];return _0x546a70;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var hardwareService=require(_0xf54e('0x13'));var logger=require('../../config/logger')(_0xf54e('0x14'));var utils=require(_0xf54e('0x15'));var config=require(_0xf54e('0x16'));var db=require(_0xf54e('0x17'))['db'];config['redis']=_[_0xf54e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf54e('0x19'))(new Redis(config[_0xf54e('0x1a')]));require(_0xf54e('0x1b'))[_0xf54e('0x1c')](socket);function respondWithStatusCode(_0x5644aa,_0x331732){_0x331732=_0x331732||0xcc;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1d')](_0x331732);}return _0x5644aa[_0xf54e('0x1e')](_0x331732)['end']();};}function respondWithResult(_0x2366ee,_0x389abc){_0x389abc=_0x389abc||0xc8;return function(_0x3eb415){if(_0x3eb415){return _0x2366ee['status'](_0x389abc)['json'](_0x3eb415);}};}function respondWithFilteredResult(_0xd87020,_0x41fb35){return function(_0x1c02e7){if(_0x1c02e7){var _0x9647f=_0x1c02e7[_0xf54e('0x1f')],_0x15cc48=_0x41fb35[_0xf54e('0x20')],_0x3e7d96=_0x41fb35[_0xf54e('0x20')]+_0x41fb35[_0xf54e('0x21')],_0x2e27b6;if(_0x3e7d96>=_0x9647f){_0x3e7d96=_0x9647f;_0x2e27b6=0xc8;}else{_0x2e27b6=0xce;}_0xd87020['status'](_0x2e27b6);return _0xd87020['set'](_0xf54e('0x22'),_0x15cc48+'-'+_0x3e7d96+'/'+_0x9647f)['json'](_0x1c02e7);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x23')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x24')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x25')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x26')](_0x388aa0)[_0xf54e('0x27')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x28')]()[_0xf54e('0x27')](function(){var _0x474b61=_0x264a8f[_0xf54e('0x29')]({'plain':!![]});var _0x160160=_0xf54e('0x2a');return db[_0xf54e('0x2b')][_0xf54e('0x28')]({'where':{'type':_0x160160,'resourceId':_0x474b61['id']}})[_0xf54e('0x27')](function(){return _0x264a8f;});})[_0xf54e('0x27')](function(){_0x6f6d29[_0xf54e('0x1e')](0xcc)[_0xf54e('0x2c')]();});}};}function handleEntityNotFound(_0x5390b8,_0xb3706e){return function(_0x4cbf7c){if(!_0x4cbf7c){_0x5390b8[_0xf54e('0x1d')](0x194);}return _0x4cbf7c;};}function handleError(_0x5e63f4,_0x15b888){_0x15b888=_0x15b888||0x1f4;return function(_0x269f47){logger[_0xf54e('0x2d')](_0x269f47[_0xf54e('0x2e')]);if(_0x269f47[_0xf54e('0x2f')]){delete _0x269f47[_0xf54e('0x2f')];}_0x5e63f4[_0xf54e('0x1e')](_0x15b888)['send'](_0x269f47);};}exports['index']=function(_0x2f96b1,_0x258d29){var _0x2ec92e={},_0x16d00f={},_0xb2d4c4={'count':0x0,'rows':[]};var _0x133cd7=db[_0xf54e('0x30')][_0xf54e('0x31')];_0x16d00f[_0xf54e('0x32')]=_[_0xf54e('0x33')](_0x133cd7);_0x16d00f['query']=_['keys'](_0x2f96b1[_0xf54e('0x34')]);_0x16d00f[_0xf54e('0x35')]=_['intersection'](_0x16d00f[_0xf54e('0x32')],_0x16d00f[_0xf54e('0x34')]);_0x2ec92e[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x16d00f['model'],qs['fields'](_0x2f96b1['query'][_0xf54e('0x38')]));_0x2ec92e[_0xf54e('0x36')]=_0x2ec92e[_0xf54e('0x36')][_0xf54e('0x39')]?_0x2ec92e[_0xf54e('0x36')]:_0x16d00f[_0xf54e('0x32')];if(!_0x2f96b1['query']['hasOwnProperty']('nolimit')){_0x2ec92e[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x2f96b1['query']['limit']);_0x2ec92e[_0xf54e('0x20')]=qs[_0xf54e('0x20')](_0x2f96b1[_0xf54e('0x34')]['offset']);}_0x2ec92e[_0xf54e('0x3a')]=qs[_0xf54e('0x3b')](_0x2f96b1['query'][_0xf54e('0x3b')]);_0x2ec92e[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x2f96b1[_0xf54e('0x34')],_0x16d00f[_0xf54e('0x35')]));if(_0x2f96b1['query']['filter']){_0x2ec92e[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x2ec92e[_0xf54e('0x3c')],{'$or':_['map'](_0x133cd7,function(_0x4533a2){if(_0x4533a2[_0xf54e('0x3f')][_0xf54e('0x40')]!==_0xf54e('0x41')){var _0x361e4c={};_0x361e4c[_0x4533a2[_0xf54e('0x42')]]={'$like':'%'+_0x2f96b1[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x361e4c;}})});}_0x2ec92e=_[_0xf54e('0x3e')]({},_0x2ec92e,_0x2f96b1[_0xf54e('0x44')]);var _0x1c1f0d={'where':_0x2ec92e[_0xf54e('0x3c')]};return db[_0xf54e('0x30')][_0xf54e('0x1f')](_0x1c1f0d)[_0xf54e('0x27')](function(_0x5085c1){_0xb2d4c4['count']=_0x5085c1;if(_0x2f96b1['query'][_0xf54e('0x45')]){_0x2ec92e[_0xf54e('0x46')]=[{'all':!![]}];}return db['CmList'][_0xf54e('0x47')](_0x2ec92e);})[_0xf54e('0x27')](function(_0x381c03){_0xb2d4c4['rows']=_0x381c03;return _0xb2d4c4;})[_0xf54e('0x27')](respondWithFilteredResult(_0x258d29,_0x2ec92e))[_0xf54e('0x48')](handleError(_0x258d29,null));};exports[_0xf54e('0x49')]=function(_0x794be7,_0x4b1931){var _0x143a39={'raw':![],'where':{'id':_0x794be7[_0xf54e('0x4a')]['id']}},_0x14ce90={};_0x14ce90[_0xf54e('0x32')]=_['keys'](db[_0xf54e('0x30')][_0xf54e('0x31')]);_0x14ce90[_0xf54e('0x34')]=_[_0xf54e('0x33')](_0x794be7[_0xf54e('0x34')]);_0x14ce90[_0xf54e('0x35')]=_['intersection'](_0x14ce90[_0xf54e('0x32')],_0x14ce90['query']);_0x143a39[_0xf54e('0x36')]=_['intersection'](_0x14ce90[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x794be7[_0xf54e('0x34')]['fields']));_0x143a39[_0xf54e('0x36')]=_0x143a39[_0xf54e('0x36')][_0xf54e('0x39')]?_0x143a39[_0xf54e('0x36')]:_0x14ce90[_0xf54e('0x32')];if(_0x794be7['query'][_0xf54e('0x45')]){_0x143a39[_0xf54e('0x46')]=[{'all':!![]}];}_0x143a39=_[_0xf54e('0x3e')]({},_0x143a39,_0x794be7[_0xf54e('0x44')]);return db['CmList'][_0xf54e('0x4b')](_0x143a39)[_0xf54e('0x27')](handleEntityNotFound(_0x4b1931,null))['then'](respondWithResult(_0x4b1931,null))[_0xf54e('0x48')](handleError(_0x4b1931,null));};exports[_0xf54e('0x4c')]=function(_0x3d24c7,_0xca0141){return db['CmList'][_0xf54e('0x4c')](_0x3d24c7[_0xf54e('0x4d')],{})[_0xf54e('0x27')](function(_0xb4654f){var _0x346fc9=_0x3d24c7[_0xf54e('0x4e')][_0xf54e('0x29')]({'plain':!![]});if(!_0x346fc9)throw new Error(_0xf54e('0x4f'));if(_0x346fc9[_0xf54e('0x50')]===_0xf54e('0x4e')){var _0xaf9bf0=_0xb4654f[_0xf54e('0x29')]({'plain':!![]});var _0x2deb0c=_0xf54e('0x2a');return db[_0xf54e('0x51')][_0xf54e('0x4b')]({'where':{'name':_0x2deb0c,'userProfileId':_0x346fc9[_0xf54e('0x52')]},'raw':!![]})[_0xf54e('0x27')](function(_0x21fd80){if(_0x21fd80&&_0x21fd80[_0xf54e('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0xaf9bf0[_0xf54e('0x2f')],'resourceId':_0xaf9bf0['id'],'type':_0x21fd80[_0xf54e('0x2f')],'sectionId':_0x21fd80['id']},{})[_0xf54e('0x27')](function(){return _0xb4654f;});}else{return _0xb4654f;}})[_0xf54e('0x48')](function(_0xba297c){logger[_0xf54e('0x2d')](_0xf54e('0x54'),_0xba297c);throw _0xba297c;});}return _0xb4654f;})[_0xf54e('0x27')](respondWithResult(_0xca0141,0xc9))[_0xf54e('0x48')](handleError(_0xca0141,null));};exports[_0xf54e('0x26')]=function(_0x1df308,_0x59c313){if(_0x1df308[_0xf54e('0x4d')]['id']){delete _0x1df308[_0xf54e('0x4d')]['id'];}return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x1df308[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x59c313,null))[_0xf54e('0x27')](saveUpdates(_0x1df308['body'],null))[_0xf54e('0x27')](respondWithResult(_0x59c313,null))[_0xf54e('0x48')](handleError(_0x59c313,null));};exports[_0xf54e('0x28')]=function(_0x48a5c8,_0x3ce832){return db['CmList'][_0xf54e('0x4b')]({'where':{'id':_0x48a5c8[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x3ce832,null))['then'](removeEntity(_0x3ce832,null))[_0xf54e('0x48')](handleError(_0x3ce832,null));};exports[_0xf54e('0x55')]=function(_0x2096e5,_0x4e5059){return db[_0xf54e('0x30')][_0xf54e('0x55')]()[_0xf54e('0x27')](respondWithResult(_0x4e5059,null))['catch'](handleError(_0x4e5059,null));};exports['addDisposition']=function(_0x4270e1,_0x9ab4c4,_0x4f17dd){if(_0x4270e1[_0xf54e('0x4d')]['id']){delete _0x4270e1['body']['id'];}return db[_0xf54e('0x30')]['find']({'where':{'id':_0x4270e1[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x9ab4c4,null))[_0xf54e('0x27')](function(_0x241198){if(_0x241198){_0x4270e1[_0xf54e('0x4d')][_0xf54e('0x56')]=_0x241198['id'];return db['Disposition']['create'](_0x4270e1[_0xf54e('0x4d')]);}})[_0xf54e('0x27')](respondWithResult(_0x9ab4c4,null))['catch'](handleError(_0x9ab4c4,null));};exports['getDispositions']=function(_0x2a5e54,_0x511a99,_0x2b616a){var _0x43f9bf={'raw':![],'where':{}};var _0x47596c={};var _0x2b11f8={'count':0x0,'rows':[]};return db[_0xf54e('0x30')][_0xf54e('0x57')]({'where':{'id':_0x2a5e54[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x511a99,null))[_0xf54e('0x27')](function(_0x4d8040){if(_0x4d8040){_0x47596c[_0xf54e('0x32')]=_[_0xf54e('0x33')](db[_0xf54e('0x58')][_0xf54e('0x31')]);_0x47596c['query']=_[_0xf54e('0x33')](_0x2a5e54[_0xf54e('0x34')]);_0x47596c[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x47596c[_0xf54e('0x32')],_0x47596c['query']);_0x43f9bf[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x47596c['model'],qs['fields'](_0x2a5e54[_0xf54e('0x34')]['fields']));_0x43f9bf[_0xf54e('0x36')]=_0x43f9bf[_0xf54e('0x36')][_0xf54e('0x39')]?_0x43f9bf[_0xf54e('0x36')]:_0x47596c['model'];if(!_0x2a5e54[_0xf54e('0x34')]['hasOwnProperty'](_0xf54e('0x59'))){_0x43f9bf[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x2a5e54['query'][_0xf54e('0x21')]);_0x43f9bf['offset']=qs[_0xf54e('0x20')](_0x2a5e54[_0xf54e('0x34')]['offset']);}_0x43f9bf[_0xf54e('0x3a')]=qs['sort'](_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x3b')]);_0x43f9bf[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x2a5e54['query'],_0x47596c[_0xf54e('0x35')]));_0x43f9bf[_0xf54e('0x3c')]['ListId']=_0x4d8040['id'];if(_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x43')]){_0x43f9bf['where']=_[_0xf54e('0x3e')](_0x43f9bf[_0xf54e('0x3c')],{'$or':_[_0xf54e('0x5a')](_0x43f9bf['attributes'],function(_0xf4e4d){var _0x4ae3d0={};_0x4ae3d0[_0xf4e4d]={'$like':'%'+_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x4ae3d0;})});}_0x43f9bf=_['merge']({},_0x43f9bf,_0x2a5e54[_0xf54e('0x44')]);return db[_0xf54e('0x58')][_0xf54e('0x1f')]({'where':_0x43f9bf[_0xf54e('0x3c')]})[_0xf54e('0x27')](function(_0xfc1e){_0x2b11f8[_0xf54e('0x1f')]=_0xfc1e;if(_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x45')]){_0x43f9bf[_0xf54e('0x46')]=[{'all':!![]}];}return db[_0xf54e('0x58')]['findAll'](_0x43f9bf);})[_0xf54e('0x27')](function(_0x2c20b5){_0x2b11f8[_0xf54e('0x5b')]=_0x2c20b5;return _0x2b11f8;});}})['then'](respondWithFilteredResult(_0x511a99,_0x43f9bf))[_0xf54e('0x48')](handleError(_0x511a99,null));};exports[_0xf54e('0x5c')]=function(_0x2bf430,_0x13db3e,_0x47339e){return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x2bf430['params']['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x13db3e,null))[_0xf54e('0x27')](function(_0x261c39){if(_0x261c39){return _0x261c39['removeDispositions'](_0x2bf430[_0xf54e('0x34')][_0xf54e('0x5d')]);}})[_0xf54e('0x27')](respondWithStatusCode(_0x13db3e,null))[_0xf54e('0x48')](handleError(_0x13db3e,null));};exports['addContacts']=function(_0x4a6dee,_0x25d05e,_0x45c5ff){return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x4a6dee[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x25d05e,null))[_0xf54e('0x27')](function(_0x3b2a3e){if(_0x3b2a3e){var _0xf5108b=[];var _0x205b47={'success':[],'errors':[]};return db['CmContact'][_0xf54e('0x55')]()[_0xf54e('0x27')](function(_0x2b026a){if(_0x4a6dee[_0xf54e('0x4d')]['tags']&&_[_0xf54e('0x5e')](_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')])){if(_0x4a6dee[_0xf54e('0x4d')]['tags'][_0xf54e('0x39')]){_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')]=_0x4a6dee['body']['tags'][_0xf54e('0x60')](';')+';';}else{_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')]=null;}}else{_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')]=null;}if(_0x4a6dee[_0xf54e('0x4d')]&&_[_0xf54e('0x5e')](_0x4a6dee[_0xf54e('0x4d')])){for(var _0x8093bc=0x0;_0x8093bc<_0x4a6dee['body'][_0xf54e('0x39')];_0x8093bc+=0x1){_0x4a6dee[_0xf54e('0x4d')][_0x8093bc][_0xf54e('0x56')]=_0x4a6dee[_0xf54e('0x4a')]['id'];_0xf5108b[_0xf54e('0x61')](_0x4a6dee[_0xf54e('0x4d')][_0x8093bc]);}return BPromise[_0xf54e('0x62')](_0xf5108b,function(_0x9a8f4f){return db[_0xf54e('0x63')][_0xf54e('0x4c')](_[_0xf54e('0x64')](_0x9a8f4f,[_0xf54e('0x5d'),'id'])||{},{'fields':_['keys'](_0x2b026a),'raw':!![]})[_0xf54e('0x27')](function(_0x1cfa09){_0x205b47['success']['push'](_0x1cfa09[_0xf54e('0x65')]);})[_0xf54e('0x48')](function(_0x44687a){_0x205b47[_0xf54e('0x66')][_0xf54e('0x61')]({'data':_0x9a8f4f,'error':_0x44687a[_0xf54e('0x67')]});});})[_0xf54e('0x27')](function(_0x403445){return _0x205b47;})[_0xf54e('0x48')](function(_0x570c3a){return _0x570c3a;});}else{_0x25d05e[_0xf54e('0x1e')](0x190)[_0xf54e('0x68')]({'message':_0xf54e('0x69')});}});}})['then'](respondWithResult(_0x25d05e,null))[_0xf54e('0x48')](handleError(_0x25d05e,null));};exports['getContacts']=function(_0x3830e7,_0x57bc6f,_0xfe35d8){var _0x35da10;return db['CmList']['find']({'where':{'id':_0x3830e7[_0xf54e('0x4a')]['id']},'include':[{'model':db[_0xf54e('0x6a')],'as':_0xf54e('0x6b')}]})[_0xf54e('0x27')](handleEntityNotFound(_0x57bc6f,null))[_0xf54e('0x27')](function(_0x486626){if(_0x486626){_0x35da10=_0x486626;return db['CmContact'][_0xf54e('0x31')];}})[_0xf54e('0x27')](function(_0x456159){if(_0x456159){var _0xc31d53={};var _0x9afe5={};_0x9afe5[_0xf54e('0x32')]=_[_0xf54e('0x6c')](_[_0xf54e('0x33')](_0x456159),_[_0xf54e('0x5a')](_0x35da10[_0xf54e('0x6b')],function(_0x54c13f){return util[_0xf54e('0x6d')](_0xf54e('0x6e'),_0x54c13f['id']);}));_0x9afe5['query']=_['keys'](_0x3830e7[_0xf54e('0x34')]);_0x9afe5[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x9afe5[_0xf54e('0x32')],_0x9afe5[_0xf54e('0x34')]);_0xc31d53['attributes']=_[_0xf54e('0x37')](_0x9afe5[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x3830e7[_0xf54e('0x34')]['fields']));_0xc31d53[_0xf54e('0x36')]=_0xc31d53[_0xf54e('0x36')][_0xf54e('0x39')]?_0xc31d53[_0xf54e('0x36')]:_0x9afe5['model'];if(!_0x3830e7[_0xf54e('0x34')][_0xf54e('0x6f')](_0xf54e('0x59'))){_0xc31d53[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x3830e7['query'][_0xf54e('0x21')]);_0xc31d53['offset']=qs['offset'](_0x3830e7[_0xf54e('0x34')][_0xf54e('0x20')]);}_0xc31d53[_0xf54e('0x3a')]=qs[_0xf54e('0x3b')](_0x3830e7[_0xf54e('0x34')][_0xf54e('0x3b')]);_0xc31d53[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x3830e7['query'],_0x9afe5[_0xf54e('0x35')]));_0xc31d53[_0xf54e('0x70')]=!![];if(_0x3830e7[_0xf54e('0x34')][_0xf54e('0x43')]){_0xc31d53[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0xc31d53['where'],{'$or':_[_0xf54e('0x5a')](_0xc31d53[_0xf54e('0x36')],function(_0xd2c60d){var _0x2b46d4={};_0x2b46d4[_0xd2c60d]={'$like':'%'+_0x3830e7[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x2b46d4;})});}_0xc31d53=_['merge']({},_0xc31d53,_0x3830e7[_0xf54e('0x44')]);return _0x35da10[_0xf54e('0x71')](_0xc31d53);}})[_0xf54e('0x27')](respondWithResult(_0x57bc6f,null))[_0xf54e('0x48')](handleError(_0x57bc6f,null));};exports['getContactsCsv']=function(_0x4787ea,_0x2feaff,_0x1a5050){var _0x13dec5;return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x4787ea[_0xf54e('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xf54e('0x6b')}]})[_0xf54e('0x27')](handleEntityNotFound(_0x2feaff,null))[_0xf54e('0x27')](function(_0x2136c2){if(_0x2136c2){_0x13dec5=_0x2136c2;return db[_0xf54e('0x63')][_0xf54e('0x31')];}})['then'](function(_0x33bed6){if(_0x33bed6){var _0x4dde1d={};var _0x385b43={};_0x385b43['model']=_[_0xf54e('0x6c')](_[_0xf54e('0x33')](_0x33bed6),_[_0xf54e('0x5a')](_0x13dec5[_0xf54e('0x6b')],function(_0x19796f){return util['format'](_0xf54e('0x6e'),_0x19796f['id']);}));_0x385b43[_0xf54e('0x34')]=_['keys'](_0x4787ea[_0xf54e('0x34')]);_0x385b43[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x385b43[_0xf54e('0x32')],_0x385b43['query']);_0x4dde1d[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x385b43['model'],qs[_0xf54e('0x38')](_0x4787ea['query']['fields']));_0x4dde1d[_0xf54e('0x36')]=_0x4dde1d['attributes'][_0xf54e('0x39')]?_0x4dde1d[_0xf54e('0x36')]:_0x385b43[_0xf54e('0x32')];if(!_0x4787ea[_0xf54e('0x34')][_0xf54e('0x6f')]('nolimit')){_0x4dde1d[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x4787ea[_0xf54e('0x34')][_0xf54e('0x21')]);_0x4dde1d['offset']=qs[_0xf54e('0x20')](_0x4787ea['query'][_0xf54e('0x20')]);}_0x4dde1d[_0xf54e('0x3a')]=qs['sort'](_0x4787ea[_0xf54e('0x34')][_0xf54e('0x3b')]);_0x4dde1d[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_['pick'](_0x4787ea[_0xf54e('0x34')],_0x385b43[_0xf54e('0x35')]));_0x4dde1d[_0xf54e('0x70')]=!![];if(_0x4787ea['query']['filter']){_0x4dde1d[_0xf54e('0x3c')]=_['merge'](_0x4dde1d['where'],{'$or':_['map'](_0x4dde1d[_0xf54e('0x36')],function(_0x146a6a){var _0x7c17a={};_0x7c17a[_0x146a6a]={'$like':'%'+_0x4787ea[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x7c17a;})});}_0x4dde1d=_[_0xf54e('0x3e')]({},_0x4dde1d,_0x4787ea[_0xf54e('0x44')]);return _0x13dec5[_0xf54e('0x71')](_0x4dde1d);}})[_0xf54e('0x27')](function(_0x558d5f){if(!_[_0xf54e('0x72')](_0x558d5f)){var _0x523171=toCsv(_0x558d5f);var _0x7cd726=Date[_0xf54e('0x73')]();fs['writeFileSync'](util[_0xf54e('0x6d')]('/tmp/list_%d_%s.csv',_0x13dec5['id'],_0x7cd726),_0x523171);_0x2feaff[_0xf54e('0x74')](_0xf54e('0x75'),_0xf54e('0x76')+util[_0xf54e('0x6d')](_0xf54e('0x77'),_0x13dec5['id'],_0x7cd726));_0x2feaff[_0xf54e('0x74')]('Content-type','text/csv');return _0x2feaff['download'](util[_0xf54e('0x6d')]('/tmp/list_%d_%s.csv',_0x13dec5['id'],_0x7cd726));}else{return _0x2feaff[_0xf54e('0x1d')](0xcc);}})[_0xf54e('0x48')](handleError(_0x2feaff,null));};exports[_0xf54e('0x78')]=function(_0xf24a7c,_0xf92db2,_0x5e5e50){var _0x40a68c;delete _0xf24a7c[_0xf54e('0x4d')]['id'];return db[_0xf54e('0x30')][_0xf54e('0x57')]({'where':{'id':_0xf24a7c[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0xf92db2,null))['then'](function(_0x996df5){if(_0x996df5){return db[_0xf54e('0x79')][_0xf54e('0x7a')](function(_0x3c3b44){return db[_0xf54e('0x6a')]['create'](_0xf24a7c[_0xf54e('0x4d')],{'transaction':_0x3c3b44})[_0xf54e('0x27')](function(_0x26631d){_0x40a68c=_0x26631d;return _0x996df5[_0xf54e('0x7b')](_0x26631d,{'transaction':_0x3c3b44});})[_0xf54e('0x27')](function(){var _0xea4112={'type':db[_0xf54e('0x7c')][_0xf54e('0x7d')],'transaction':_0x3c3b44};switch(_0xf24a7c[_0xf54e('0x4d')]['type']){case _0xf54e('0x7e'):_0xea4112[_0xf54e('0x3f')]=db['Sequelize']['TEXT'];break;case _0xf54e('0x7f'):_0xea4112['type']=db[_0xf54e('0x7c')][_0xf54e('0x80')];break;case _0xf54e('0x81'):_0xea4112[_0xf54e('0x3f')]=db['Sequelize'][_0xf54e('0x82')];_0xea4112[_0xf54e('0x83')]=![];break;default:}return db['sequelize'][_0xf54e('0x84')][_0xf54e('0x85')](_0xf54e('0x86'),util[_0xf54e('0x6d')](_0xf54e('0x87'),_0x40a68c['id']),_0xea4112);})[_0xf54e('0x27')](function(){return _0x40a68c;});});}})[_0xf54e('0x27')](respondWithResult(_0xf92db2,null))[_0xf54e('0x48')](handleError(_0xf92db2,null));};exports[_0xf54e('0x88')]=function(_0x3634bc,_0x4931b8,_0x5168a8){var _0x4bb13e={};var _0x246cdd={};var _0x2ef7e4;var _0x78860e;return db[_0xf54e('0x30')][_0xf54e('0x57')]({'where':{'id':_0x3634bc['params']['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x4931b8,null))[_0xf54e('0x27')](function(_0x3a9def){if(_0x3a9def){_0x2ef7e4=_0x3a9def;_0x246cdd[_0xf54e('0x32')]=_['keys'](db[_0xf54e('0x6a')][_0xf54e('0x31')]);_0x246cdd[_0xf54e('0x34')]=_[_0xf54e('0x33')](_0x3634bc[_0xf54e('0x34')]);_0x246cdd[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x246cdd[_0xf54e('0x32')],_0x246cdd[_0xf54e('0x34')]);_0x4bb13e[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x246cdd[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x3634bc[_0xf54e('0x34')]['fields']));_0x4bb13e[_0xf54e('0x36')]=_0x4bb13e['attributes']['length']?_0x4bb13e[_0xf54e('0x36')]:_0x246cdd[_0xf54e('0x32')];_0x4bb13e[_0xf54e('0x3a')]=qs[_0xf54e('0x3b')](_0x3634bc[_0xf54e('0x34')][_0xf54e('0x3b')]);_0x4bb13e[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x3634bc[_0xf54e('0x34')],_0x246cdd[_0xf54e('0x35')]));_0x4bb13e[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x4bb13e['where'],{'$or':[{'ListId':_0x3a9def['id']},{'ListId':null}]});if(_0x3634bc[_0xf54e('0x34')][_0xf54e('0x43')]){_0x4bb13e[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x4bb13e[_0xf54e('0x3c')],{'$or':_['map'](_0x4bb13e['attributes'],function(_0x16956a){var _0xcc86ca={};_0xcc86ca[_0x16956a]={'$like':'%'+_0x3634bc['query']['filter']+'%'};return _0xcc86ca;})});}_0x4bb13e=_[_0xf54e('0x3e')]({},_0x4bb13e,_0x3634bc['options']);return db[_0xf54e('0x6a')][_0xf54e('0x89')](_0x4bb13e);}})[_0xf54e('0x27')](respondWithResult(_0x4931b8,null))[_0xf54e('0x48')](handleError(_0x4931b8,null));};exports[_0xf54e('0x8a')]=function(_0x1f9d18,_0x50bff9,_0x39fc7d){return db[_0xf54e('0x30')]['find']({'where':{'id':_0x1f9d18[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x50bff9,null))['then'](function(_0x337fac){if(_0x337fac){return _0x337fac[_0xf54e('0x8a')](_0x1f9d18[_0xf54e('0x4d')]['ids'],_['omit'](_0x1f9d18[_0xf54e('0x4d')],[_0xf54e('0x5d'),'id'])||{})['spread'](function(_0x4f6645){for(var _0x4ce631=0x0;_0x4ce631<_0x1f9d18[_0xf54e('0x4d')][_0xf54e('0x5d')][_0xf54e('0x39')];_0x4ce631+=0x1){socket['emit'](_0xf54e('0x8b'),{'UserId':_0x1f9d18[_0xf54e('0x4d')][_0xf54e('0x5d')][_0x4ce631],'CmListId':_0x1f9d18[_0xf54e('0x4a')]['id']});}return _0x4f6645;});}})[_0xf54e('0x27')](respondWithResult(_0x50bff9,null))['catch'](handleError(_0x50bff9,null));};exports['removeAgents']=function(_0x54a86a,_0x484acd,_0x5458f0){return db[_0xf54e('0x30')]['find']({'where':{'id':_0x54a86a[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x484acd,null))['then'](function(_0x2d5256){if(_0x2d5256){return _0x2d5256['removeAgents'](_0x54a86a[_0xf54e('0x34')][_0xf54e('0x5d')])[_0xf54e('0x27')](function(){if(_[_0xf54e('0x5e')](_0x54a86a[_0xf54e('0x34')][_0xf54e('0x5d')])){for(var _0x1b632d=0x0;_0x1b632d<_0x54a86a['query'][_0xf54e('0x5d')][_0xf54e('0x39')];_0x1b632d+=0x1){socket[_0xf54e('0x8c')](_0xf54e('0x8d'),{'UserId':Number(_0x54a86a[_0xf54e('0x34')]['ids'][_0x1b632d]),'CmListId':Number(_0x54a86a[_0xf54e('0x4a')]['id'])});}}else{socket[_0xf54e('0x8c')](_0xf54e('0x8d'),{'UserId':Number(_0x54a86a[_0xf54e('0x34')][_0xf54e('0x5d')]),'CmListId':Number(_0x54a86a[_0xf54e('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x484acd,null))['catch'](handleError(_0x484acd,null));};exports['getAgents']=function(_0x40da4d,_0x32f8f4,_0x261d91){var _0x21cb51={};var _0x2acc8c={};var _0x51be69;var _0x31b2d6;return db[_0xf54e('0x30')]['findOne']({'where':{'id':_0x40da4d[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x32f8f4,null))[_0xf54e('0x27')](function(_0x5b5d32){if(_0x5b5d32){_0x51be69=_0x5b5d32;_0x2acc8c[_0xf54e('0x32')]=_[_0xf54e('0x33')](db[_0xf54e('0x8e')][_0xf54e('0x31')]);_0x2acc8c[_0xf54e('0x34')]=_[_0xf54e('0x33')](_0x40da4d[_0xf54e('0x34')]);_0x2acc8c[_0xf54e('0x35')]=_['intersection'](_0x2acc8c[_0xf54e('0x32')],_0x2acc8c['query']);_0x21cb51[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x2acc8c[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x40da4d[_0xf54e('0x34')][_0xf54e('0x38')]));_0x21cb51[_0xf54e('0x36')]=_0x21cb51['attributes']['length']?_0x21cb51['attributes']:_0x2acc8c[_0xf54e('0x32')];_0x21cb51['order']=qs[_0xf54e('0x3b')](_0x40da4d['query'][_0xf54e('0x3b')]);_0x21cb51[_0xf54e('0x3c')]=qs['filters'](_[_0xf54e('0x3d')](_0x40da4d[_0xf54e('0x34')],_0x2acc8c[_0xf54e('0x35')]));if(_0x40da4d[_0xf54e('0x34')][_0xf54e('0x43')]){_0x21cb51[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x21cb51[_0xf54e('0x3c')],{'$or':_[_0xf54e('0x5a')](_0x21cb51[_0xf54e('0x36')],function(_0x3351a3){var _0x5bc7ed={};_0x5bc7ed[_0x3351a3]={'$like':'%'+_0x40da4d[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x5bc7ed;})});}_0x21cb51=_[_0xf54e('0x3e')]({},_0x21cb51,_0x40da4d['options']);return _0x51be69[_0xf54e('0x8f')](_0x21cb51);}})['then'](function(_0x2f6bcc){if(_0x2f6bcc){_0x31b2d6=_0x2f6bcc[_0xf54e('0x39')];if(!_0x40da4d[_0xf54e('0x34')][_0xf54e('0x6f')](_0xf54e('0x59'))){_0x21cb51[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x40da4d[_0xf54e('0x34')][_0xf54e('0x21')]);_0x21cb51[_0xf54e('0x20')]=qs[_0xf54e('0x20')](_0x40da4d['query']['offset']);}return _0x51be69['getAgents'](_0x21cb51);}})[_0xf54e('0x27')](function(_0x3cc581){if(_0x3cc581){return _0x3cc581?{'count':_0x31b2d6,'rows':_0x3cc581}:null;}})[_0xf54e('0x27')](respondWithResult(_0x32f8f4,null))['catch'](handleError(_0x32f8f4,null));};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js
index 6867337..6a8ee19 100644
--- a/server/api/cmList/cmList.events.js
+++ b/server/api/cmList/cmList.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6df=['remove','hook','exports','events','setMaxListeners','save','update'];(function(_0x335202,_0x16d8a7){var _0x93ca72=function(_0x3074a1){while(--_0x3074a1){_0x335202['push'](_0x335202['shift']());}};_0x93ca72(++_0x16d8a7);}(_0xa6df,0x145));var _0xfa6d=function(_0x5002cb,_0x3325ae){_0x5002cb=_0x5002cb-0x0;var _0x591955=_0xa6df[_0x5002cb];return _0x591955;};'use strict';var EventEmitter=require(_0xfa6d('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xfa6d('0x1')](0x0);var events={'afterCreate':_0xfa6d('0x2'),'afterUpdate':_0xfa6d('0x3'),'afterDestroy':_0xfa6d('0x4')};function emitEvent(_0x3e52a3){return function(_0x449ec4,_0x4a3055,_0x57e1b9){CmListEvents['emit'](_0x3e52a3+':'+_0x449ec4['id'],_0x449ec4);CmListEvents['emit'](_0x3e52a3,_0x449ec4);_0x57e1b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xfa6d('0x5')](e,emitEvent(event));}}module[_0xfa6d('0x6')]=CmListEvents;
\ No newline at end of file
+var _0xdf4d=['events','../../mysqldb','CmList','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xc998b5,_0x57929f){var _0x360fdf=function(_0x4106a6){while(--_0x4106a6){_0xc998b5['push'](_0xc998b5['shift']());}};_0x360fdf(++_0x57929f);}(_0xdf4d,0x1d0));var _0xddf4=function(_0x7b1b27,_0x5dfdf8){_0x7b1b27=_0x7b1b27-0x0;var _0x59b268=_0xdf4d[_0x7b1b27];return _0x59b268;};'use strict';var EventEmitter=require(_0xddf4('0x0'));var CmList=require(_0xddf4('0x1'))['db'][_0xddf4('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xddf4('0x3')](0x0);var events={'afterCreate':_0xddf4('0x4'),'afterUpdate':_0xddf4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x29f8c6){return function(_0x416c2a,_0x3004d7,_0x358991){CmListEvents[_0xddf4('0x6')](_0x29f8c6+':'+_0x416c2a['id'],_0x416c2a);CmListEvents[_0xddf4('0x6')](_0x29f8c6,_0x416c2a);_0x358991(null);};}for(var e in events){if(events[_0xddf4('0x7')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js
index 8a61c12..1a34892 100644
--- a/server/api/cmList/cmList.model.js
+++ b/server/api/cmList/cmList.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x09dd=['exports','CmList','cm_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x09dd,0x81));var _0xd09d=function(_0x338581,_0x85c756){_0x338581=_0x338581-0x0;var _0x306123=_0x09dd[_0x338581];return _0x306123;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var logger=require(_0xd09d('0x2'))(_0xd09d('0x3'));var moment=require(_0xd09d('0x4'));var BPromise=require(_0xd09d('0x5'));var rp=require(_0xd09d('0x6'));var fs=require('fs');var path=require(_0xd09d('0x7'));var rimraf=require(_0xd09d('0x8'));var config=require(_0xd09d('0x9'));var attributes=require(_0xd09d('0xa'));module[_0xd09d('0xb')]=function(_0x3410c4,_0x2034af){return _0x3410c4['define'](_0xd09d('0xc'),attributes,{'tableName':_0xd09d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe31=['cm_lists','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmList'];(function(_0x704b39,_0x17ba2a){var _0x26b43c=function(_0x515820){while(--_0x515820){_0x704b39['push'](_0x704b39['shift']());}};_0x26b43c(++_0x17ba2a);}(_0xbe31,0x83));var _0x1be3=function(_0x4421db,_0x23cb15){_0x4421db=_0x4421db-0x0;var _0xecb851=_0xbe31[_0x4421db];return _0xecb851;};'use strict';var _=require('lodash');var util=require(_0x1be3('0x0'));var logger=require(_0x1be3('0x1'))(_0x1be3('0x2'));var moment=require(_0x1be3('0x3'));var BPromise=require(_0x1be3('0x4'));var rp=require(_0x1be3('0x5'));var fs=require('fs');var path=require(_0x1be3('0x6'));var rimraf=require(_0x1be3('0x7'));var config=require(_0x1be3('0x8'));var attributes=require('./cmList.attributes');module[_0x1be3('0x9')]=function(_0x57e6b0,_0x1f09ec){return _0x57e6b0[_0x1be3('0xa')](_0x1be3('0xb'),attributes,{'tableName':_0x1be3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js
index 9c4938f..6795c97 100644
--- a/server/api/cmList/cmList.rpc.js
+++ b/server/api/cmList/cmList.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x304a=['then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x304a,0x168));var _0xa304=function(_0x572474,_0x54b9ae){_0x572474=_0x572474-0x0;var _0x252d0b=_0x304a[_0x572474];return _0x252d0b;};'use strict';var _=require(_0xa304('0x0'));var util=require(_0xa304('0x1'));var moment=require(_0xa304('0x2'));var BPromise=require('bluebird');var rs=require(_0xa304('0x3'));var fs=require('fs');var Redis=require(_0xa304('0x4'));var db=require(_0xa304('0x5'))['db'];var utils=require(_0xa304('0x6'));var logger=require(_0xa304('0x7'))('rpc');var config=require(_0xa304('0x8'));var jayson=require(_0xa304('0x9'));var client=jayson[_0xa304('0xa')][_0xa304('0xb')]({'port':0x232a});config[_0xa304('0xc')]=_[_0xa304('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa304('0xe'))(new Redis(config[_0xa304('0xc')]));require('./cmList.socket')[_0xa304('0xf')](socket);function respondWithRpcPromise(_0x3adc68,_0x530ee1,_0x5ec2c0){return new BPromise(function(_0x29e184,_0x28e465){return client[_0xa304('0x10')](_0x3adc68,_0x5ec2c0)[_0xa304('0x11')](function(_0x4fa458){logger[_0xa304('0x12')](_0xa304('0x13'),_0x530ee1,_0xa304('0x14'));logger[_0xa304('0x15')](_0xa304('0x16'),_0x530ee1,_0xa304('0x14'),JSON[_0xa304('0x17')](_0x4fa458));if(_0x4fa458['error']){if(_0x4fa458[_0xa304('0x18')][_0xa304('0x19')]===0x1f4){logger[_0xa304('0x18')](_0xa304('0x13'),_0x530ee1,_0x4fa458['error'][_0xa304('0x1a')]);return _0x28e465(_0x4fa458[_0xa304('0x18')][_0xa304('0x1a')]);}logger[_0xa304('0x18')]('CmList,\x20%s,\x20%s',_0x530ee1,_0x4fa458[_0xa304('0x18')][_0xa304('0x1a')]);return _0x29e184(_0x4fa458[_0xa304('0x18')][_0xa304('0x1a')]);}else{logger[_0xa304('0x12')](_0xa304('0x13'),_0x530ee1,_0xa304('0x14'));_0x29e184(_0x4fa458[_0xa304('0x1b')]['message']);}})[_0xa304('0x1c')](function(_0x2384ee){logger[_0xa304('0x18')](_0xa304('0x13'),_0x530ee1,_0x2384ee);_0x28e465(_0x2384ee);});});}
\ No newline at end of file
+var _0x65f9=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x65f9,0xd9));var _0x965f=function(_0x1020af,_0x21d01c){_0x1020af=_0x1020af-0x0;var _0x41b8f1=_0x65f9[_0x1020af];return _0x41b8f1;};'use strict';var _=require('lodash');var util=require(_0x965f('0x0'));var moment=require(_0x965f('0x1'));var BPromise=require(_0x965f('0x2'));var rs=require(_0x965f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x965f('0x4'))['db'];var utils=require(_0x965f('0x5'));var logger=require(_0x965f('0x6'))(_0x965f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x965f('0x8')][_0x965f('0x9')]({'port':0x232a});config[_0x965f('0xa')]=_[_0x965f('0xb')](config[_0x965f('0xa')],{'host':_0x965f('0xc'),'port':0x18eb});var socket=require(_0x965f('0xd'))(new Redis(config[_0x965f('0xa')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0xd6f1ff,_0x2fced4,_0xa8e55b){return new BPromise(function(_0x330be0,_0x392675){return client['request'](_0xd6f1ff,_0xa8e55b)['then'](function(_0x1cce93){logger[_0x965f('0xe')](_0x965f('0xf'),_0x2fced4,_0x965f('0x10'));logger[_0x965f('0x11')](_0x965f('0x12'),_0x2fced4,_0x965f('0x10'),JSON[_0x965f('0x13')](_0x1cce93));if(_0x1cce93[_0x965f('0x14')]){if(_0x1cce93['error']['code']===0x1f4){logger[_0x965f('0x14')]('CmList,\x20%s,\x20%s',_0x2fced4,_0x1cce93[_0x965f('0x14')]['message']);return _0x392675(_0x1cce93['error'][_0x965f('0x15')]);}logger['error'](_0x965f('0xf'),_0x2fced4,_0x1cce93[_0x965f('0x14')][_0x965f('0x15')]);return _0x330be0(_0x1cce93[_0x965f('0x14')][_0x965f('0x15')]);}else{logger['info'](_0x965f('0xf'),_0x2fced4,_0x965f('0x10'));_0x330be0(_0x1cce93[_0x965f('0x16')][_0x965f('0x15')]);}})[_0x965f('0x17')](function(_0x5c43e9){logger[_0x965f('0x14')](_0x965f('0xf'),_0x2fced4,_0x5c43e9);_0x392675(_0x5c43e9);});});}
\ No newline at end of file
diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js
index cad0225..dd68ff9 100644
--- a/server/api/cmList/cmList.socket.js
+++ b/server/api/cmList/cmList.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x936d=['cmList:','./cmList.events','remove','update','register','length'];(function(_0x5a4ac1,_0xb9eb0b){var _0x11dc18=function(_0x49d481){while(--_0x49d481){_0x5a4ac1['push'](_0x5a4ac1['shift']());}};_0x11dc18(++_0xb9eb0b);}(_0x936d,0x127));var _0xd936=function(_0x5d0279,_0xa9cd93){_0x5d0279=_0x5d0279-0x0;var _0x123e57=_0x936d[_0x5d0279];return _0x123e57;};'use strict';var CmListEvents=require(_0xd936('0x0'));var events=['save',_0xd936('0x1'),_0xd936('0x2')];function createListener(_0x5532fc,_0x465c1c){return function(_0x3a9cf6){_0x465c1c['emit'](_0x5532fc,_0x3a9cf6);};}function removeListener(_0x319f4c,_0x592aca){return function(){CmListEvents['removeListener'](_0x319f4c,_0x592aca);};}exports[_0xd936('0x3')]=function(_0x424ea7){for(var _0x1517b3=0x0,_0x52c701=events[_0xd936('0x4')];_0x1517b3<_0x52c701;_0x1517b3++){var _0x258699=events[_0x1517b3];var _0x167476=createListener(_0xd936('0x5')+_0x258699,_0x424ea7);CmListEvents['on'](_0x258699,_0x167476);}};
\ No newline at end of file
+var _0x84d1=['./cmList.events','save','remove','update','removeListener','register','length','cmList:'];(function(_0xbf400c,_0x37e1e7){var _0x2ee697=function(_0x3c2668){while(--_0x3c2668){_0xbf400c['push'](_0xbf400c['shift']());}};_0x2ee697(++_0x37e1e7);}(_0x84d1,0x178));var _0x184d=function(_0x3fa296,_0x2bd315){_0x3fa296=_0x3fa296-0x0;var _0x10b19f=_0x84d1[_0x3fa296];return _0x10b19f;};'use strict';var CmListEvents=require(_0x184d('0x0'));var events=[_0x184d('0x1'),_0x184d('0x2'),_0x184d('0x3')];function createListener(_0x448102,_0x5121b3){return function(_0x434196){_0x5121b3['emit'](_0x448102,_0x434196);};}function removeListener(_0x1dbb68,_0x569cf3){return function(){CmListEvents[_0x184d('0x4')](_0x1dbb68,_0x569cf3);};}exports[_0x184d('0x5')]=function(_0x95fbb){for(var _0x329411=0x0,_0xa4d517=events[_0x184d('0x6')];_0x329411<_0xa4d517;_0x329411++){var _0x6b807f=events[_0x329411];var _0xf8c7eb=createListener(_0x184d('0x7')+_0x6b807f,_0x95fbb);CmListEvents['on'](_0x6b807f,_0xf8c7eb);}};
\ No newline at end of file
diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js
index 4cd580c..aa0574a 100644
--- a/server/api/cmList/index.js
+++ b/server/api/cmList/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbc9=['isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/users','getAgents','post','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','delete','destroy','removeDispositions','removeAgents','exports','multer','path','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x7a491b,_0xb598f3){var _0x8a295e=function(_0x4637b7){while(--_0x4637b7){_0x7a491b['push'](_0x7a491b['shift']());}};_0x8a295e(++_0xb598f3);}(_0xdbc9,0x14a));var _0x9dbc=function(_0x5317d3,_0xc5d2b){_0x5317d3=_0x5317d3-0x0;var _0x437eda=_0xdbc9[_0x5317d3];return _0x437eda;};'use strict';var multer=require(_0x9dbc('0x0'));var util=require('util');var path=require(_0x9dbc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9dbc('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x9dbc('0x3'));var config=require(_0x9dbc('0x4'));var controller=require('./cmList.controller');router[_0x9dbc('0x5')]('/',auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x7')]);router['get'](_0x9dbc('0x8'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x9')]);router[_0x9dbc('0x5')](_0x9dbc('0xa'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0xb')]);router[_0x9dbc('0x5')](_0x9dbc('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x9dbc('0x5')](_0x9dbc('0xd'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0xe')]);router['get']('/:id/contacts/csv',auth[_0x9dbc('0x6')](),controller['getContactsCsv']);router['get']('/:id/fields',auth[_0x9dbc('0x6')](),controller['getCustomFields']);router['get'](_0x9dbc('0xf'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x10')]);router[_0x9dbc('0x11')]('/',auth[_0x9dbc('0x6')](),controller['create']);router[_0x9dbc('0x11')]('/:id/dispositions',auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x12')]);router[_0x9dbc('0x11')](_0x9dbc('0xd'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x13')]);router[_0x9dbc('0x11')](_0x9dbc('0x14'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x15')]);router[_0x9dbc('0x11')](_0x9dbc('0xf'),auth['isAuthenticated'](),controller[_0x9dbc('0x16')]);router['put'](_0x9dbc('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x9dbc('0x17')](_0x9dbc('0xa'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x18')]);router[_0x9dbc('0x17')](_0x9dbc('0xc'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x19')]);router['delete'](_0x9dbc('0xf'),auth['isAuthenticated'](),controller[_0x9dbc('0x1a')]);module[_0x9dbc('0x1b')]=router;
\ No newline at end of file
+var _0x8a4a=['getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addContacts','addAgents','delete','exports','util','path','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','describe','/:id','/:id/dispositions','getContacts'];(function(_0x5e6b3d,_0xc33ea4){var _0x4698b7=function(_0x17e95c){while(--_0x17e95c){_0x5e6b3d['push'](_0x5e6b3d['shift']());}};_0x4698b7(++_0xc33ea4);}(_0x8a4a,0x6d));var _0xa8a4=function(_0x57a402,_0x40596b){_0x57a402=_0x57a402-0x0;var _0x753a36=_0x8a4a[_0x57a402];return _0x753a36;};'use strict';var multer=require('multer');var util=require(_0xa8a4('0x0'));var path=require(_0xa8a4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa8a4('0x2'));var config=require(_0xa8a4('0x3'));var controller=require(_0xa8a4('0x4'));router[_0xa8a4('0x5')]('/',auth[_0xa8a4('0x6')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa8a4('0x7')]);router[_0xa8a4('0x5')](_0xa8a4('0x8'),auth[_0xa8a4('0x6')](),controller['show']);router[_0xa8a4('0x5')](_0xa8a4('0x9'),auth[_0xa8a4('0x6')](),controller['getDispositions']);router[_0xa8a4('0x5')]('/:id/contacts',auth[_0xa8a4('0x6')](),controller[_0xa8a4('0xa')]);router[_0xa8a4('0x5')]('/:id/contacts/csv',auth[_0xa8a4('0x6')](),controller[_0xa8a4('0xb')]);router[_0xa8a4('0x5')](_0xa8a4('0xc'),auth[_0xa8a4('0x6')](),controller[_0xa8a4('0xd')]);router[_0xa8a4('0x5')](_0xa8a4('0xe'),auth[_0xa8a4('0x6')](),controller[_0xa8a4('0xf')]);router[_0xa8a4('0x10')]('/',auth[_0xa8a4('0x6')](),controller[_0xa8a4('0x11')]);router[_0xa8a4('0x10')]('/:id/dispositions',auth[_0xa8a4('0x6')](),controller[_0xa8a4('0x12')]);router[_0xa8a4('0x10')](_0xa8a4('0x13'),auth[_0xa8a4('0x6')](),controller[_0xa8a4('0x14')]);router['post'](_0xa8a4('0xc'),auth[_0xa8a4('0x6')](),controller['addCustomField']);router[_0xa8a4('0x10')](_0xa8a4('0xe'),auth['isAuthenticated'](),controller[_0xa8a4('0x15')]);router['put'](_0xa8a4('0x8'),auth[_0xa8a4('0x6')](),controller['update']);router[_0xa8a4('0x16')](_0xa8a4('0x8'),auth[_0xa8a4('0x6')](),controller['destroy']);router['delete'](_0xa8a4('0x9'),auth[_0xa8a4('0x6')](),controller['removeDispositions']);router[_0xa8a4('0x16')](_0xa8a4('0xe'),auth[_0xa8a4('0x6')](),controller['removeAgents']);module[_0xa8a4('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js
index 6243a22..ec5d929 100644
--- a/server/api/condition/condition.attributes.js
+++ b/server/api/condition/condition.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x955d=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x6ae0a2,_0x2a81f){var _0x1be156=function(_0x327ba6){while(--_0x327ba6){_0x6ae0a2['push'](_0x6ae0a2['shift']());}};_0x1be156(++_0x2a81f);}(_0x955d,0x1a9));var _0xd955=function(_0x5ff914,_0x3f6d9b){_0x5ff914=_0x5ff914-0x0;var _0x3f5e1d=_0x955d[_0x5ff914];return _0x3f5e1d;};'use strict';var Sequelize=require(_0xd955('0x0'));module[_0xd955('0x1')]={'name':{'type':Sequelize[_0xd955('0x2')],'get':function(_0x5879a9){return this[_0xd955('0x3')](_0xd955('0x4'));}},'field':{'type':Sequelize[_0xd955('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xd955('0x5')],'allowNull':![]}};
\ No newline at end of file
+var _0x5765=['exports','VIRTUAL','getDataValue','STRING'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0x5765,0x1b8));var _0x5576=function(_0x2d4661,_0x2da65c){_0x2d4661=_0x2d4661-0x0;var _0x42ed1e=_0x5765[_0x2d4661];return _0x42ed1e;};'use strict';var Sequelize=require('sequelize');module[_0x5576('0x0')]={'name':{'type':Sequelize[_0x5576('0x1')],'get':function(_0x35ea43){return this[_0x5576('0x2')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x5576('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x5576('0x3')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js
index 111b0c0..fcb93a0 100644
--- a/server/api/condition/condition.controller.js
+++ b/server/api/condition/condition.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd88d=['destroy','stack','name','send','body','Condition','catch','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then'];(function(_0x99e09f,_0x24dbed){var _0x2ac8c1=function(_0x8f0dab){while(--_0x8f0dab){_0x99e09f['push'](_0x99e09f['shift']());}};_0x2ac8c1(++_0x24dbed);}(_0xd88d,0x81));var _0xdd88=function(_0x27a696,_0x1518fe){_0x27a696=_0x27a696-0x0;var _0x1faa3f=_0xd88d[_0x27a696];return _0x1faa3f;};'use strict';var pdf=require(_0xdd88('0x0'));var emlformat=require(_0xdd88('0x1'));var rimraf=require(_0xdd88('0x2'));var zipdir=require(_0xdd88('0x3'));var jsonpatch=require(_0xdd88('0x4'));var rp=require(_0xdd88('0x5'));var moment=require(_0xdd88('0x6'));var BPromise=require(_0xdd88('0x7'));var Mustache=require(_0xdd88('0x8'));var util=require(_0xdd88('0x9'));var path=require('path');var sox=require(_0xdd88('0xa'));var csv=require(_0xdd88('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdd88('0xc'));var squel=require(_0xdd88('0xd'));var crypto=require(_0xdd88('0xe'));var jsforce=require(_0xdd88('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdd88('0xb'));var querystring=require('querystring');var Papa=require(_0xdd88('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdd88('0x11'));var config=require(_0xdd88('0x12'));var db=require(_0xdd88('0x13'))['db'];function respondWithStatusCode(_0x7482e7,_0x3d3d47){_0x3d3d47=_0x3d3d47||0xcc;return function(_0xa76d03){if(_0xa76d03){return _0x7482e7[_0xdd88('0x14')](_0x3d3d47);}return _0x7482e7[_0xdd88('0x15')](_0x3d3d47)['end']();};}function respondWithResult(_0x476a4d,_0x16a088){_0x16a088=_0x16a088||0xc8;return function(_0x172194){if(_0x172194){return _0x476a4d[_0xdd88('0x15')](_0x16a088)[_0xdd88('0x16')](_0x172194);}};}function respondWithFilteredResult(_0x2eacde,_0x313452){return function(_0x2a9a46){if(_0x2a9a46){var _0x43556e=_0x2a9a46[_0xdd88('0x17')],_0x481ecd=_0x313452['offset'],_0x1fbbb2=_0x313452[_0xdd88('0x18')]+_0x313452[_0xdd88('0x19')],_0x280afe;if(_0x1fbbb2>=_0x43556e){_0x1fbbb2=_0x43556e;_0x280afe=0xc8;}else{_0x280afe=0xce;}_0x2eacde[_0xdd88('0x15')](_0x280afe);return _0x2eacde[_0xdd88('0x1a')]('Content-Range',_0x481ecd+'-'+_0x1fbbb2+'/'+_0x43556e)['json'](_0x2a9a46);}return null;};}function patchUpdates(_0x4688cc){return function(_0xa8f7b3){try{jsonpatch[_0xdd88('0x1b')](_0xa8f7b3,_0x4688cc,!![]);}catch(_0x3af84d){return BPromise[_0xdd88('0x1c')](_0x3af84d);}return _0xa8f7b3['save']();};}function saveUpdates(_0x36a0f7,_0x4b17c5){return function(_0x5517f3){if(_0x5517f3){return _0x5517f3[_0xdd88('0x1d')](_0x36a0f7)[_0xdd88('0x1e')](function(_0x192b0a){return _0x192b0a;});}return null;};}function removeEntity(_0x33823f,_0x1acf1f){return function(_0x173742){if(_0x173742){return _0x173742[_0xdd88('0x1f')]()[_0xdd88('0x1e')](function(){_0x33823f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10238b,_0x6c44ab){return function(_0x3fb735){if(!_0x3fb735){_0x10238b[_0xdd88('0x14')](0x194);}return _0x3fb735;};}function handleError(_0xb3dda0,_0x497a49){_0x497a49=_0x497a49||0x1f4;return function(_0x43c86d){logger['error'](_0x43c86d[_0xdd88('0x20')]);if(_0x43c86d[_0xdd88('0x21')]){delete _0x43c86d['name'];}_0xb3dda0[_0xdd88('0x15')](_0x497a49)[_0xdd88('0x22')](_0x43c86d);};}exports['update']=function(_0x4c6f3,_0x54876c){if(_0x4c6f3[_0xdd88('0x23')]['id']){delete _0x4c6f3[_0xdd88('0x23')]['id'];}return db[_0xdd88('0x24')]['find']({'where':{'id':_0x4c6f3['params']['id']}})[_0xdd88('0x1e')](handleEntityNotFound(_0x54876c,null))[_0xdd88('0x1e')](saveUpdates(_0x4c6f3[_0xdd88('0x23')],null))[_0xdd88('0x1e')](respondWithResult(_0x54876c,null))[_0xdd88('0x25')](handleError(_0x54876c,null));};exports[_0xdd88('0x1f')]=function(_0xa42c54,_0x5e8601){return db[_0xdd88('0x24')][_0xdd88('0x26')]({'where':{'id':_0xa42c54[_0xdd88('0x27')]['id']}})[_0xdd88('0x1e')](handleEntityNotFound(_0x5e8601,null))[_0xdd88('0x1e')](removeEntity(_0x5e8601,null))[_0xdd88('0x25')](handleError(_0x5e8601,null));};
\ No newline at end of file
+var _0xc89c=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','body','Condition','find','params','catch','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x599c86,_0x57bb30){var _0x1073a8=function(_0x143374){while(--_0x143374){_0x599c86['push'](_0x599c86['shift']());}};_0x1073a8(++_0x57bb30);}(_0xc89c,0x1f1));var _0xcc89=function(_0xf48bb8,_0x5d9863){_0xf48bb8=_0xf48bb8-0x0;var _0x3ada42=_0xc89c[_0xf48bb8];return _0x3ada42;};'use strict';var pdf=require(_0xcc89('0x0'));var emlformat=require(_0xcc89('0x1'));var rimraf=require(_0xcc89('0x2'));var zipdir=require(_0xcc89('0x3'));var jsonpatch=require(_0xcc89('0x4'));var rp=require(_0xcc89('0x5'));var moment=require(_0xcc89('0x6'));var BPromise=require(_0xcc89('0x7'));var Mustache=require('mustache');var util=require(_0xcc89('0x8'));var path=require('path');var sox=require(_0xcc89('0x9'));var csv=require(_0xcc89('0xa'));var ejs=require(_0xcc89('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc89('0xc'));var jsforce=require(_0xcc89('0xd'));var deskjs=require(_0xcc89('0xe'));var toCsv=require(_0xcc89('0xa'));var querystring=require(_0xcc89('0xf'));var Papa=require(_0xcc89('0x10'));var Redis=require(_0xcc89('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcc89('0x12'));var hardwareService=require(_0xcc89('0x13'));var logger=require('../../config/logger')(_0xcc89('0x14'));var utils=require(_0xcc89('0x15'));var config=require(_0xcc89('0x16'));var db=require(_0xcc89('0x17'))['db'];function respondWithStatusCode(_0x36d646,_0x332cb2){_0x332cb2=_0x332cb2||0xcc;return function(_0x20d743){if(_0x20d743){return _0x36d646[_0xcc89('0x18')](_0x332cb2);}return _0x36d646['status'](_0x332cb2)[_0xcc89('0x19')]();};}function respondWithResult(_0x308afe,_0x49040a){_0x49040a=_0x49040a||0xc8;return function(_0x316ce0){if(_0x316ce0){return _0x308afe[_0xcc89('0x1a')](_0x49040a)[_0xcc89('0x1b')](_0x316ce0);}};}function respondWithFilteredResult(_0xcacf0a,_0x4babd4){return function(_0x25b1d6){if(_0x25b1d6){var _0x93ac70=_0x25b1d6[_0xcc89('0x1c')],_0x3bb313=_0x4babd4[_0xcc89('0x1d')],_0x2a35a9=_0x4babd4[_0xcc89('0x1d')]+_0x4babd4[_0xcc89('0x1e')],_0x5ad4bc;if(_0x2a35a9>=_0x93ac70){_0x2a35a9=_0x93ac70;_0x5ad4bc=0xc8;}else{_0x5ad4bc=0xce;}_0xcacf0a['status'](_0x5ad4bc);return _0xcacf0a[_0xcc89('0x1f')](_0xcc89('0x20'),_0x3bb313+'-'+_0x2a35a9+'/'+_0x93ac70)['json'](_0x25b1d6);}return null;};}function patchUpdates(_0x5cb7ce){return function(_0x1b5781){try{jsonpatch[_0xcc89('0x21')](_0x1b5781,_0x5cb7ce,!![]);}catch(_0x47619b){return BPromise[_0xcc89('0x22')](_0x47619b);}return _0x1b5781[_0xcc89('0x23')]();};}function saveUpdates(_0x508eba,_0x472e0f){return function(_0x27c9cc){if(_0x27c9cc){return _0x27c9cc[_0xcc89('0x24')](_0x508eba)[_0xcc89('0x25')](function(_0x7013fa){return _0x7013fa;});}return null;};}function removeEntity(_0x1141ad,_0xd1e9e9){return function(_0xa2ff2){if(_0xa2ff2){return _0xa2ff2['destroy']()[_0xcc89('0x25')](function(){_0x1141ad[_0xcc89('0x1a')](0xcc)[_0xcc89('0x19')]();});}};}function handleEntityNotFound(_0x4acc9f,_0x8fa576){return function(_0x2fe1e2){if(!_0x2fe1e2){_0x4acc9f[_0xcc89('0x18')](0x194);}return _0x2fe1e2;};}function handleError(_0x2cdcfc,_0x4c93d5){_0x4c93d5=_0x4c93d5||0x1f4;return function(_0x2cff30){logger[_0xcc89('0x26')](_0x2cff30[_0xcc89('0x27')]);if(_0x2cff30[_0xcc89('0x28')]){delete _0x2cff30['name'];}_0x2cdcfc[_0xcc89('0x1a')](_0x4c93d5)['send'](_0x2cff30);};}exports[_0xcc89('0x24')]=function(_0x307bb9,_0x4aa77c){if(_0x307bb9[_0xcc89('0x29')]['id']){delete _0x307bb9[_0xcc89('0x29')]['id'];}return db[_0xcc89('0x2a')][_0xcc89('0x2b')]({'where':{'id':_0x307bb9[_0xcc89('0x2c')]['id']}})[_0xcc89('0x25')](handleEntityNotFound(_0x4aa77c,null))[_0xcc89('0x25')](saveUpdates(_0x307bb9['body'],null))['then'](respondWithResult(_0x4aa77c,null))[_0xcc89('0x2d')](handleError(_0x4aa77c,null));};exports[_0xcc89('0x2e')]=function(_0x174eab,_0x1aee93){return db[_0xcc89('0x2a')][_0xcc89('0x2b')]({'where':{'id':_0x174eab['params']['id']}})[_0xcc89('0x25')](handleEntityNotFound(_0x1aee93,null))[_0xcc89('0x25')](removeEntity(_0x1aee93,null))['catch'](handleError(_0x1aee93,null));};
\ No newline at end of file
diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js
index 4273253..59bd370 100644
--- a/server/api/condition/condition.model.js
+++ b/server/api/condition/condition.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9ffd=['../../config/environment','exports','define','util','api','bluebird','request-promise','path'];(function(_0x3f1eb8,_0x644a0c){var _0x10ad09=function(_0x2911c0){while(--_0x2911c0){_0x3f1eb8['push'](_0x3f1eb8['shift']());}};_0x10ad09(++_0x644a0c);}(_0x9ffd,0xfb));var _0xd9ff=function(_0x5a7579,_0x20a36d){_0x5a7579=_0x5a7579-0x0;var _0x3c527e=_0x9ffd[_0x5a7579];return _0x3c527e;};'use strict';var _=require('lodash');var util=require(_0xd9ff('0x0'));var logger=require('../../config/logger')(_0xd9ff('0x1'));var moment=require('moment');var BPromise=require(_0xd9ff('0x2'));var rp=require(_0xd9ff('0x3'));var fs=require('fs');var path=require(_0xd9ff('0x4'));var rimraf=require('rimraf');var config=require(_0xd9ff('0x5'));var attributes=require('./condition.attributes');module[_0xd9ff('0x6')]=function(_0x20fb0a,_0x12f575){return _0x20fb0a[_0xd9ff('0x7')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef1b=['tools_conditions','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./condition.attributes','exports','define'];(function(_0x3dd78f,_0x5e0d83){var _0x44cb13=function(_0x2ecb5f){while(--_0x2ecb5f){_0x3dd78f['push'](_0x3dd78f['shift']());}};_0x44cb13(++_0x5e0d83);}(_0xef1b,0x11f));var _0xbef1=function(_0xe8f77e,_0xcab56d){_0xe8f77e=_0xe8f77e-0x0;var _0x2cae92=_0xef1b[_0xe8f77e];return _0x2cae92;};'use strict';var _=require(_0xbef1('0x0'));var util=require(_0xbef1('0x1'));var logger=require(_0xbef1('0x2'))('api');var moment=require(_0xbef1('0x3'));var BPromise=require(_0xbef1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbef1('0x5'));var rimraf=require('rimraf');var config=require(_0xbef1('0x6'));var attributes=require(_0xbef1('0x7'));module[_0xbef1('0x8')]=function(_0x1e1235,_0x1b4787){return _0x1e1235[_0xbef1('0x9')]('Condition',attributes,{'tableName':_0xbef1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js
index 83161a2..32b43e3 100644
--- a/server/api/condition/condition.rpc.js
+++ b/server/api/condition/condition.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa5c4=['randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa5c4,0x89));var _0x4a5c=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0xa5c4[_0x54b062];return _0x255e41;};'use strict';var _=require(_0x4a5c('0x0'));var util=require('util');var moment=require(_0x4a5c('0x1'));var BPromise=require(_0x4a5c('0x2'));var rs=require(_0x4a5c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a5c('0x4'))['db'];var utils=require(_0x4a5c('0x5'));var logger=require(_0x4a5c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4a5c('0x7'));var client=jayson[_0x4a5c('0x8')][_0x4a5c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5be796,_0x57186b,_0x12b1f5){return new BPromise(function(_0xcd4690,_0x5c6f59){return client[_0x4a5c('0xa')](_0x5be796,_0x12b1f5)[_0x4a5c('0xb')](function(_0x5aca47){logger['info'](_0x4a5c('0xc'),_0x57186b,'request\x20sent');logger[_0x4a5c('0xd')](_0x4a5c('0xe'),_0x57186b,_0x4a5c('0xf'),JSON[_0x4a5c('0x10')](_0x5aca47));if(_0x5aca47[_0x4a5c('0x11')]){if(_0x5aca47[_0x4a5c('0x11')]['code']===0x1f4){logger['error'](_0x4a5c('0xc'),_0x57186b,_0x5aca47[_0x4a5c('0x11')][_0x4a5c('0x12')]);return _0x5c6f59(_0x5aca47[_0x4a5c('0x11')][_0x4a5c('0x12')]);}logger[_0x4a5c('0x11')](_0x4a5c('0xc'),_0x57186b,_0x5aca47[_0x4a5c('0x11')]['message']);return _0xcd4690(_0x5aca47['error'][_0x4a5c('0x12')]);}else{logger['info'](_0x4a5c('0xc'),_0x57186b,'request\x20sent');_0xcd4690(_0x5aca47[_0x4a5c('0x13')][_0x4a5c('0x12')]);}})['catch'](function(_0x10be92){logger['error'](_0x4a5c('0xc'),_0x57186b,_0x10be92);_0x5c6f59(_0x10be92);});});}
\ No newline at end of file
+var _0xcbdf=['message','Condition,\x20%s,\x20%s','request\x20sent','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','debug','Condition,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3094c6,_0x31b543){var _0xae239d=function(_0x3658cf){while(--_0x3658cf){_0x3094c6['push'](_0x3094c6['shift']());}};_0xae239d(++_0x31b543);}(_0xcbdf,0xb7));var _0xfcbd=function(_0x3fe725,_0x149de0){_0x3fe725=_0x3fe725-0x0;var _0x3d54b0=_0xcbdf[_0x3fe725];return _0x3d54b0;};'use strict';var _=require(_0xfcbd('0x0'));var util=require(_0xfcbd('0x1'));var moment=require('moment');var BPromise=require(_0xfcbd('0x2'));var rs=require(_0xfcbd('0x3'));var fs=require('fs');var Redis=require(_0xfcbd('0x4'));var db=require(_0xfcbd('0x5'))['db'];var utils=require(_0xfcbd('0x6'));var logger=require('../../config/logger')(_0xfcbd('0x7'));var config=require('../../config/environment');var jayson=require(_0xfcbd('0x8'));var client=jayson[_0xfcbd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x565d72,_0x2a886e,_0x43bd05){return new BPromise(function(_0x3731bf,_0x2ba2dc){return client[_0xfcbd('0xa')](_0x565d72,_0x43bd05)[_0xfcbd('0xb')](function(_0x4b3c37){logger[_0xfcbd('0xc')]('Condition,\x20%s,\x20%s',_0x2a886e,'request\x20sent');logger[_0xfcbd('0xd')](_0xfcbd('0xe'),_0x2a886e,'request\x20sent',JSON['stringify'](_0x4b3c37));if(_0x4b3c37['error']){if(_0x4b3c37[_0xfcbd('0xf')][_0xfcbd('0x10')]===0x1f4){logger[_0xfcbd('0xf')]('Condition,\x20%s,\x20%s',_0x2a886e,_0x4b3c37[_0xfcbd('0xf')]['message']);return _0x2ba2dc(_0x4b3c37[_0xfcbd('0xf')][_0xfcbd('0x11')]);}logger[_0xfcbd('0xf')](_0xfcbd('0x12'),_0x2a886e,_0x4b3c37[_0xfcbd('0xf')][_0xfcbd('0x11')]);return _0x3731bf(_0x4b3c37[_0xfcbd('0xf')][_0xfcbd('0x11')]);}else{logger[_0xfcbd('0xc')](_0xfcbd('0x12'),_0x2a886e,_0xfcbd('0x13'));_0x3731bf(_0x4b3c37['result'][_0xfcbd('0x11')]);}})['catch'](function(_0x581a97){logger[_0xfcbd('0xf')](_0xfcbd('0x12'),_0x2a886e,_0x581a97);_0x2ba2dc(_0x581a97);});});}
\ No newline at end of file
diff --git a/server/api/condition/index.js b/server/api/condition/index.js
index 7020429..d9aab16 100644
--- a/server/api/condition/index.js
+++ b/server/api/condition/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6c7f=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','/:id','update','delete','destroy','exports','util'];(function(_0x190681,_0x590f58){var _0x4f2ada=function(_0x4556db){while(--_0x4556db){_0x190681['push'](_0x190681['shift']());}};_0x4f2ada(++_0x590f58);}(_0x6c7f,0x154));var _0xf6c7=function(_0x42c6f1,_0x338d7b){_0x42c6f1=_0x42c6f1-0x0;var _0x3c7398=_0x6c7f[_0x42c6f1];return _0x3c7398;};'use strict';var multer=require('multer');var util=require(_0xf6c7('0x0'));var path=require(_0xf6c7('0x1'));var timeout=require(_0xf6c7('0x2'));var express=require('express');var router=express[_0xf6c7('0x3')]();var auth=require(_0xf6c7('0x4'));var interaction=require(_0xf6c7('0x5'));var config=require('../../config/environment');var controller=require('./condition.controller');router['put'](_0xf6c7('0x6'),auth['isAuthenticated'](),controller[_0xf6c7('0x7')]);router[_0xf6c7('0x8')](_0xf6c7('0x6'),auth['isAuthenticated'](),controller[_0xf6c7('0x9')]);module[_0xf6c7('0xa')]=router;
\ No newline at end of file
+var _0xa9fc=['put','update','delete','/:id','isAuthenticated','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2de1ef,_0x19c7f9){var _0x287375=function(_0xcad6fd){while(--_0xcad6fd){_0x2de1ef['push'](_0x2de1ef['shift']());}};_0x287375(++_0x19c7f9);}(_0xa9fc,0xa0));var _0xca9f=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xa9fc[_0x32b542];return _0x554d54;};'use strict';var multer=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var path=require('path');var timeout=require(_0xca9f('0x2'));var express=require(_0xca9f('0x3'));var router=express[_0xca9f('0x4')]();var auth=require(_0xca9f('0x5'));var interaction=require(_0xca9f('0x6'));var config=require(_0xca9f('0x7'));var controller=require('./condition.controller');router[_0xca9f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xca9f('0x9')]);router[_0xca9f('0xa')](_0xca9f('0xb'),auth[_0xca9f('0xc')](),controller[_0xca9f('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js
index 9118fa0..5674b7a 100644
--- a/server/api/dashboard/dashboard.attributes.js
+++ b/server/api/dashboard/dashboard.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d14=['STRING','sequelize','exports'];(function(_0x244753,_0x45d986){var _0x1124fc=function(_0x156aff){while(--_0x156aff){_0x244753['push'](_0x244753['shift']());}};_0x1124fc(++_0x45d986);}(_0x0d14,0x187));var _0x40d1=function(_0xf3b53f,_0x55b917){_0xf3b53f=_0xf3b53f-0x0;var _0x8b238=_0x0d14[_0xf3b53f];return _0x8b238;};'use strict';var Sequelize=require(_0x40d1('0x0'));module[_0x40d1('0x1')]={'name':{'type':Sequelize[_0x40d1('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x40d1('0x2')]}};
\ No newline at end of file
+var _0x1790=['name','STRING','sequelize','exports'];(function(_0x10db24,_0x53b47b){var _0x32dc51=function(_0x2999be){while(--_0x2999be){_0x10db24['push'](_0x10db24['shift']());}};_0x32dc51(++_0x53b47b);}(_0x1790,0x82));var _0x0179=function(_0x1709bc,_0x2a5d72){_0x1709bc=_0x1709bc-0x0;var _0x23f400=_0x1790[_0x1709bc];return _0x23f400;};'use strict';var Sequelize=require(_0x0179('0x0'));module[_0x0179('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0179('0x2')},'description':{'type':Sequelize[_0x0179('0x3')]}};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js
index 93b7663..c8db49d 100644
--- a/server/api/dashboard/dashboard.controller.js
+++ b/server/api/dashboard/dashboard.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x10ca=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','update','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','pick','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','end','json','count','offset','limit','status','set','Content-Range','save','then','get','destroy','error','stack','name','send','index','Dashboard','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','key','VIRTUAL','field','filter','options','includeAll','findAll','rows','params','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation'];(function(_0x1e89ed,_0x1cf7de){var _0x3e3e2c=function(_0x27e6b2){while(--_0x27e6b2){_0x1e89ed['push'](_0x1e89ed['shift']());}};_0x3e3e2c(++_0x1cf7de);}(_0x10ca,0x1a7));var _0xa10c=function(_0x68f9f,_0x4f8e85){_0x68f9f=_0x68f9f-0x0;var _0x10f944=_0x10ca[_0x68f9f];return _0x10f944;};'use strict';var pdf=require(_0xa10c('0x0'));var emlformat=require(_0xa10c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa10c('0x2'));var jsonpatch=require(_0xa10c('0x3'));var rp=require('request-promise');var moment=require(_0xa10c('0x4'));var BPromise=require(_0xa10c('0x5'));var Mustache=require(_0xa10c('0x6'));var util=require(_0xa10c('0x7'));var path=require(_0xa10c('0x8'));var sox=require(_0xa10c('0x9'));var csv=require('to-csv');var ejs=require(_0xa10c('0xa'));var fs=require('fs');var _=require(_0xa10c('0xb'));var squel=require(_0xa10c('0xc'));var crypto=require(_0xa10c('0xd'));var jsforce=require(_0xa10c('0xe'));var deskjs=require(_0xa10c('0xf'));var toCsv=require(_0xa10c('0x10'));var querystring=require(_0xa10c('0x11'));var Papa=require(_0xa10c('0x12'));var Redis=require(_0xa10c('0x13'));var authService=require(_0xa10c('0x14'));var qs=require(_0xa10c('0x15'));var hardwareService=require(_0xa10c('0x16'));var logger=require('../../config/logger')(_0xa10c('0x17'));var utils=require('../../config/utils');var config=require(_0xa10c('0x18'));var db=require(_0xa10c('0x19'))['db'];config[_0xa10c('0x1a')]=_[_0xa10c('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa10c('0x1c'))(new Redis(config[_0xa10c('0x1a')]));require(_0xa10c('0x1d'))[_0xa10c('0x1e')](socket);function respondWithStatusCode(_0x5a06e2,_0x741664){_0x741664=_0x741664||0xcc;return function(_0x50fba5){if(_0x50fba5){return _0x5a06e2[_0xa10c('0x1f')](_0x741664);}return _0x5a06e2['status'](_0x741664)[_0xa10c('0x20')]();};}function respondWithResult(_0xf3ac9e,_0xa07a08){_0xa07a08=_0xa07a08||0xc8;return function(_0x969bd9){if(_0x969bd9){return _0xf3ac9e['status'](_0xa07a08)[_0xa10c('0x21')](_0x969bd9);}};}function respondWithFilteredResult(_0x31f8a2,_0x5a39bf){return function(_0x1814c2){if(_0x1814c2){var _0x23f2de=_0x1814c2[_0xa10c('0x22')],_0x1b552b=_0x5a39bf[_0xa10c('0x23')],_0x4c2269=_0x5a39bf[_0xa10c('0x23')]+_0x5a39bf[_0xa10c('0x24')],_0x2af1fa;if(_0x4c2269>=_0x23f2de){_0x4c2269=_0x23f2de;_0x2af1fa=0xc8;}else{_0x2af1fa=0xce;}_0x31f8a2[_0xa10c('0x25')](_0x2af1fa);return _0x31f8a2[_0xa10c('0x26')](_0xa10c('0x27'),_0x1b552b+'-'+_0x4c2269+'/'+_0x23f2de)[_0xa10c('0x21')](_0x1814c2);}return null;};}function patchUpdates(_0x48b5eb){return function(_0x3cedf7){try{jsonpatch['apply'](_0x3cedf7,_0x48b5eb,!![]);}catch(_0x37497f){return BPromise['reject'](_0x37497f);}return _0x3cedf7[_0xa10c('0x28')]();};}function saveUpdates(_0x34b439,_0x1dbe3d){return function(_0x57d39a){if(_0x57d39a){return _0x57d39a['update'](_0x34b439)[_0xa10c('0x29')](function(_0x24117c){return _0x24117c;});}return null;};}function removeEntity(_0x56ea7c,_0x3cb9fb){return function(_0x43b1c0){if(_0x43b1c0){return _0x43b1c0['destroy']()[_0xa10c('0x29')](function(){var _0x391e6e=_0x43b1c0[_0xa10c('0x2a')]({'plain':!![]});var _0x50765d='CustomDashboards';return db['UserProfileResource'][_0xa10c('0x2b')]({'where':{'type':_0x50765d,'resourceId':_0x391e6e['id']}})[_0xa10c('0x29')](function(){return _0x43b1c0;});})[_0xa10c('0x29')](function(){_0x56ea7c[_0xa10c('0x25')](0xcc)[_0xa10c('0x20')]();});}};}function handleEntityNotFound(_0x3447ab,_0x5f1ff6){return function(_0x4fba1e){if(!_0x4fba1e){_0x3447ab[_0xa10c('0x1f')](0x194);}return _0x4fba1e;};}function handleError(_0x2e3631,_0x349e41){_0x349e41=_0x349e41||0x1f4;return function(_0x5b4c7e){logger[_0xa10c('0x2c')](_0x5b4c7e[_0xa10c('0x2d')]);if(_0x5b4c7e['name']){delete _0x5b4c7e[_0xa10c('0x2e')];}_0x2e3631[_0xa10c('0x25')](_0x349e41)[_0xa10c('0x2f')](_0x5b4c7e);};}exports[_0xa10c('0x30')]=function(_0x2cc5e3,_0x4af802){var _0x440d85={},_0x564199={},_0x174933={'count':0x0,'rows':[]};var _0xe0f6a6=db[_0xa10c('0x31')][_0xa10c('0x32')];_0x564199[_0xa10c('0x33')]=_[_0xa10c('0x34')](_0xe0f6a6);_0x564199[_0xa10c('0x35')]=_[_0xa10c('0x34')](_0x2cc5e3[_0xa10c('0x35')]);_0x564199[_0xa10c('0x36')]=_[_0xa10c('0x37')](_0x564199[_0xa10c('0x33')],_0x564199[_0xa10c('0x35')]);_0x440d85[_0xa10c('0x38')]=_[_0xa10c('0x37')](_0x564199['model'],qs['fields'](_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x39')]));_0x440d85[_0xa10c('0x38')]=_0x440d85[_0xa10c('0x38')][_0xa10c('0x3a')]?_0x440d85[_0xa10c('0x38')]:_0x564199[_0xa10c('0x33')];if(!_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x3b')]('nolimit')){_0x440d85[_0xa10c('0x24')]=qs[_0xa10c('0x24')](_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x24')]);_0x440d85[_0xa10c('0x23')]=qs['offset'](_0x2cc5e3['query']['offset']);}_0x440d85[_0xa10c('0x3c')]=qs[_0xa10c('0x3d')](_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x3d')]);_0x440d85[_0xa10c('0x3e')]=qs[_0xa10c('0x36')](_['pick'](_0x2cc5e3[_0xa10c('0x35')],_0x564199[_0xa10c('0x36')]));if(_0x2cc5e3[_0xa10c('0x35')]['filter']){_0x440d85[_0xa10c('0x3e')]=_[_0xa10c('0x3f')](_0x440d85['where'],{'$or':_[_0xa10c('0x40')](_0xe0f6a6,function(_0x1e65ca){if(_0x1e65ca['type'][_0xa10c('0x41')]!==_0xa10c('0x42')){var _0xdf5a3={};_0xdf5a3[_0x1e65ca[_0xa10c('0x43')]]={'$like':'%'+_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x44')]+'%'};return _0xdf5a3;}})});}_0x440d85=_[_0xa10c('0x3f')]({},_0x440d85,_0x2cc5e3[_0xa10c('0x45')]);var _0x271f28={'where':_0x440d85[_0xa10c('0x3e')]};return db['Dashboard'][_0xa10c('0x22')](_0x271f28)[_0xa10c('0x29')](function(_0x4b14bc){_0x174933[_0xa10c('0x22')]=_0x4b14bc;if(_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x46')]){_0x440d85['include']=[{'all':!![]}];}return db[_0xa10c('0x31')][_0xa10c('0x47')](_0x440d85);})['then'](function(_0x1122a7){_0x174933[_0xa10c('0x48')]=_0x1122a7;return _0x174933;})[_0xa10c('0x29')](respondWithFilteredResult(_0x4af802,_0x440d85))['catch'](handleError(_0x4af802,null));};exports['show']=function(_0x39920c,_0x2d5673){var _0x41d5fb={'raw':![],'where':{'id':_0x39920c[_0xa10c('0x49')]['id']}},_0x2370c1={};_0x2370c1[_0xa10c('0x33')]=_[_0xa10c('0x34')](db[_0xa10c('0x31')]['rawAttributes']);_0x2370c1[_0xa10c('0x35')]=_[_0xa10c('0x34')](_0x39920c[_0xa10c('0x35')]);_0x2370c1[_0xa10c('0x36')]=_[_0xa10c('0x37')](_0x2370c1[_0xa10c('0x33')],_0x2370c1[_0xa10c('0x35')]);_0x41d5fb[_0xa10c('0x38')]=_[_0xa10c('0x37')](_0x2370c1['model'],qs['fields'](_0x39920c['query']['fields']));_0x41d5fb['attributes']=_0x41d5fb['attributes'][_0xa10c('0x3a')]?_0x41d5fb['attributes']:_0x2370c1[_0xa10c('0x33')];if(_0x39920c[_0xa10c('0x35')][_0xa10c('0x46')]){_0x41d5fb[_0xa10c('0x4a')]=[{'all':!![]}];}_0x41d5fb=_[_0xa10c('0x3f')]({},_0x41d5fb,_0x39920c[_0xa10c('0x45')]);return db['Dashboard'][_0xa10c('0x4b')](_0x41d5fb)[_0xa10c('0x29')](handleEntityNotFound(_0x2d5673,null))[_0xa10c('0x29')](respondWithResult(_0x2d5673,null))[_0xa10c('0x4c')](handleError(_0x2d5673,null));};exports[_0xa10c('0x4d')]=function(_0x41d903,_0x55fc21){return db[_0xa10c('0x31')][_0xa10c('0x4d')](_0x41d903['body'],{})[_0xa10c('0x29')](function(_0x184da8){var _0x28c2a2=_0x41d903[_0xa10c('0x4e')][_0xa10c('0x2a')]({'plain':!![]});if(!_0x28c2a2)throw new Error(_0xa10c('0x4f'));if(_0x28c2a2[_0xa10c('0x50')]===_0xa10c('0x4e')){var _0x52a99a=_0x184da8[_0xa10c('0x2a')]({'plain':!![]});var _0x14560b=_0xa10c('0x51');return db[_0xa10c('0x52')][_0xa10c('0x4b')]({'where':{'name':_0x14560b,'userProfileId':_0x28c2a2[_0xa10c('0x53')]},'raw':!![]})[_0xa10c('0x29')](function(_0xe22a7d){if(_0xe22a7d&&_0xe22a7d[_0xa10c('0x54')]===0x0){return db[_0xa10c('0x55')][_0xa10c('0x4d')]({'name':_0x52a99a[_0xa10c('0x2e')],'resourceId':_0x52a99a['id'],'type':_0xe22a7d['name'],'sectionId':_0xe22a7d['id']},{})[_0xa10c('0x29')](function(){return _0x184da8;});}else{return _0x184da8;}})[_0xa10c('0x4c')](function(_0x4fede0){logger['error'](_0xa10c('0x56'),_0x4fede0);throw _0x4fede0;});}return _0x184da8;})[_0xa10c('0x29')](respondWithResult(_0x55fc21,0xc9))[_0xa10c('0x4c')](handleError(_0x55fc21,null));};exports[_0xa10c('0x57')]=function(_0x238241,_0x84e122){var _0x1c37b8={'raw':![],'where':{'id':_0x238241[_0xa10c('0x49')]['id']}},_0x5ab7f1={};_0x5ab7f1[_0xa10c('0x33')]=_[_0xa10c('0x34')](db[_0xa10c('0x31')][_0xa10c('0x32')]);_0x1c37b8[_0xa10c('0x38')]=_[_0xa10c('0x37')](_0x5ab7f1[_0xa10c('0x33')],qs[_0xa10c('0x39')](_0x238241['query']['fields']));_0x1c37b8['attributes']=_0x1c37b8['attributes']['length']?_0x1c37b8['attributes']:_0x5ab7f1[_0xa10c('0x33')];if(_0x238241[_0xa10c('0x35')]['includeAll']){_0x1c37b8['include']=[{'all':!![]}];}_0x1c37b8=_['merge']({},_0x1c37b8,_0x238241[_0xa10c('0x45')]);return db[_0xa10c('0x31')][_0xa10c('0x4b')](_0x1c37b8)[_0xa10c('0x29')](handleEntityNotFound(_0x84e122,null))[_0xa10c('0x29')](function(_0x2f5f9d){if(_0x2f5f9d){var _0x13a4ae=_0x2f5f9d[_0xa10c('0x2a')]({'plain':!![]});_0x13a4ae=qs[_0xa10c('0x58')](_0x13a4ae,['id','createdAt',_0xa10c('0x59')]);_0x238241['body']=_[_0xa10c('0x58')](_0x238241[_0xa10c('0x5a')],['id',_0xa10c('0x5b'),'updatedAt']);return db[_0xa10c('0x31')][_0xa10c('0x4d')](_[_0xa10c('0x3f')](_0x13a4ae,_0x238241[_0xa10c('0x5a')]),{'include':_0x238241['query'][_0xa10c('0x46')]?[{'all':!![]}]:undefined})[_0xa10c('0x29')](function(_0xdcfb67){var _0x3766a9=_0x238241[_0xa10c('0x4e')][_0xa10c('0x2a')]({'plain':!![]});if(!_0x3766a9)throw new Error(_0xa10c('0x4f'));if(_0x3766a9[_0xa10c('0x50')]===_0xa10c('0x4e')){var _0x357e8c=_0xdcfb67[_0xa10c('0x2a')]({'plain':!![]});var _0x1b582f='CustomDashboards';return db[_0xa10c('0x52')][_0xa10c('0x4b')]({'where':{'name':_0x1b582f,'userProfileId':_0x3766a9[_0xa10c('0x53')]},'raw':!![]})[_0xa10c('0x29')](function(_0x2e701f){if(_0x2e701f&&_0x2e701f[_0xa10c('0x54')]===0x0){return db['UserProfileResource'][_0xa10c('0x4d')]({'name':_0x357e8c['name'],'resourceId':_0x357e8c['id'],'type':_0x2e701f[_0xa10c('0x2e')],'sectionId':_0x2e701f['id']},{})[_0xa10c('0x29')](function(){return _0xdcfb67;});}else{return _0xdcfb67;}})[_0xa10c('0x4c')](function(_0x38c2b8){logger[_0xa10c('0x2c')](_0xa10c('0x56'),_0x38c2b8);throw _0x38c2b8;});}return _0xdcfb67;});}})['then'](respondWithResult(_0x84e122,0xc9))[_0xa10c('0x4c')](handleError(_0x84e122,null));};exports[_0xa10c('0x5c')]=function(_0xb3b855,_0x151b7f){if(_0xb3b855[_0xa10c('0x5a')]['id']){delete _0xb3b855['body']['id'];}return db[_0xa10c('0x31')][_0xa10c('0x4b')]({'where':{'id':_0xb3b855[_0xa10c('0x49')]['id']}})[_0xa10c('0x29')](handleEntityNotFound(_0x151b7f,null))[_0xa10c('0x29')](saveUpdates(_0xb3b855[_0xa10c('0x5a')],null))[_0xa10c('0x29')](respondWithResult(_0x151b7f,null))[_0xa10c('0x4c')](handleError(_0x151b7f,null));};exports[_0xa10c('0x2b')]=function(_0x44b98c,_0x200c3d){return db[_0xa10c('0x31')]['find']({'where':{'id':_0x44b98c[_0xa10c('0x49')]['id']}})[_0xa10c('0x29')](handleEntityNotFound(_0x200c3d,null))['then'](removeEntity(_0x200c3d,null))[_0xa10c('0x4c')](handleError(_0x200c3d,null));};function widgetAttributes(_0x112d54){try{switch(_0x112d54['type']){case _0xa10c('0x5d'):return[{'name':'attrUrl','value':_0x112d54[_0xa10c('0x5e')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54[_0xa10c('0x5f')][0x0][_0xa10c('0x60')]:undefined)||_0xa10c('0x61')}];case _0xa10c('0x62'):return[{'name':_0xa10c('0x63'),'value':_0x112d54['attrPath']||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54[_0xa10c('0x5f')][0x0]['value']:undefined)||''}];case _0xa10c('0x64'):return[{'name':_0xa10c('0x65'),'value':_0x112d54[_0xa10c('0x65')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54['attrs'][0x0]?_0x112d54[_0xa10c('0x5f')][0x0][_0xa10c('0x60')]:undefined)||_0xa10c('0x66')},{'name':_0xa10c('0x67'),'value':_0x112d54[_0xa10c('0x67')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x1]?_0x112d54['attrs'][0x1][_0xa10c('0x60')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x112d54['attrFontSize']||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54['attrs'][0x2]?_0x112d54[_0xa10c('0x5f')][0x2][_0xa10c('0x60')]:undefined)||0xc}];case'counter':return[{'name':_0xa10c('0x68'),'value':_0x112d54[_0xa10c('0x68')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54[_0xa10c('0x5f')][0x0][_0xa10c('0x60')]:undefined)||_0xa10c('0x69')},{'name':_0xa10c('0x6a'),'value':_0x112d54[_0xa10c('0x6a')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54['attrs'][0x1]?_0x112d54[_0xa10c('0x5f')][0x1][_0xa10c('0x60')]:undefined)||[]},{'name':_0xa10c('0x6b'),'value':_0x112d54['attrFontSize']||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x2]?_0x112d54['attrs'][0x2]['value']:undefined)||0x14}];case _0xa10c('0x6c'):case _0xa10c('0x6d'):return[{'name':_0xa10c('0x6e'),'value':_0x112d54['attrSerie1']||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54['attrs'][0x0][_0xa10c('0x60')]:undefined)||'total'},{'name':'attrSerie2','value':_0x112d54[_0xa10c('0x6f')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x1]?_0x112d54[_0xa10c('0x5f')][0x1]['value']:undefined)||null},{'name':_0xa10c('0x70'),'value':_0x112d54[_0xa10c('0x70')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x2]?_0x112d54[_0xa10c('0x5f')][0x2][_0xa10c('0x60')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x112d54[_0xa10c('0x6a')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x3]?_0x112d54[_0xa10c('0x5f')][0x3][_0xa10c('0x60')]:undefined)||[]}];case _0xa10c('0x71'):return[{'name':_0xa10c('0x72'),'type':_0x112d54[_0xa10c('0x73')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54[_0xa10c('0x5f')][0x0][_0xa10c('0x74')]:undefined)||null,'value':_0x112d54[_0xa10c('0x72')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54[_0xa10c('0x5f')][0x0][_0xa10c('0x60')]:undefined)||null},{'name':_0xa10c('0x75'),'value':_0x112d54[_0xa10c('0x75')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x1]?_0x112d54[_0xa10c('0x5f')][0x1][_0xa10c('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x58767a){logger[_0xa10c('0x2c')](_0xa10c('0x76'),JSON[_0xa10c('0x77')](_0x58767a));return[];}}exports[_0xa10c('0x78')]=function(_0x4892c3,_0x5cabf6,_0x48d662){if(_0x4892c3['body']['id']){delete _0x4892c3['body']['id'];}return db[_0xa10c('0x31')][_0xa10c('0x4b')]({'where':{'id':_0x4892c3[_0xa10c('0x49')]['id']}})[_0xa10c('0x29')](handleEntityNotFound(_0x5cabf6,null))[_0xa10c('0x29')](function(_0x269fd4){if(_0x269fd4){_0x4892c3[_0xa10c('0x5a')][_0xa10c('0x79')]=_0x269fd4['id'];_0x4892c3[_0xa10c('0x5a')][_0xa10c('0x5f')]=widgetAttributes(_0x4892c3[_0xa10c('0x5a')]);return db['DashboardItem'][_0xa10c('0x4d')](_0x4892c3[_0xa10c('0x5a')]);}})[_0xa10c('0x29')](respondWithResult(_0x5cabf6,null))['catch'](handleError(_0x5cabf6,null));};exports[_0xa10c('0x7a')]=function(_0x8938f1,_0x3e0b18,_0x108d06){var _0x382285={};var _0x1d8d16={};var _0x21b76e;var _0x26be97;return db[_0xa10c('0x31')][_0xa10c('0x7b')]({'where':{'id':_0x8938f1['params']['id']}})[_0xa10c('0x29')](handleEntityNotFound(_0x3e0b18,null))[_0xa10c('0x29')](function(_0x19b3ff){if(_0x19b3ff){_0x21b76e=_0x19b3ff;_0x1d8d16[_0xa10c('0x33')]=_['keys'](db[_0xa10c('0x7c')][_0xa10c('0x32')]);_0x1d8d16[_0xa10c('0x35')]=_[_0xa10c('0x34')](_0x8938f1['query']);_0x1d8d16[_0xa10c('0x36')]=_[_0xa10c('0x37')](_0x1d8d16[_0xa10c('0x33')],_0x1d8d16[_0xa10c('0x35')]);_0x382285[_0xa10c('0x38')]=_[_0xa10c('0x37')](_0x1d8d16[_0xa10c('0x33')],qs[_0xa10c('0x39')](_0x8938f1[_0xa10c('0x35')][_0xa10c('0x39')]));_0x382285[_0xa10c('0x38')]=_0x382285[_0xa10c('0x38')][_0xa10c('0x3a')]?_0x382285['attributes']:_0x1d8d16[_0xa10c('0x33')];_0x382285['order']=qs[_0xa10c('0x3d')](_0x8938f1[_0xa10c('0x35')]['sort']);_0x382285['where']=qs['filters'](_[_0xa10c('0x7d')](_0x8938f1['query'],_0x1d8d16[_0xa10c('0x36')]));if(_0x8938f1[_0xa10c('0x35')][_0xa10c('0x44')]){_0x382285[_0xa10c('0x3e')]=_[_0xa10c('0x3f')](_0x382285[_0xa10c('0x3e')],{'$or':_[_0xa10c('0x40')](_0x382285['attributes'],function(_0x300526){var _0x2869e3={};_0x2869e3[_0x300526]={'$like':'%'+_0x8938f1[_0xa10c('0x35')][_0xa10c('0x44')]+'%'};return _0x2869e3;})});}_0x382285=_[_0xa10c('0x3f')]({},_0x382285,_0x8938f1['options']);return _0x21b76e[_0xa10c('0x7a')](_0x382285);}})[_0xa10c('0x29')](function(_0x19749e){if(_0x19749e){_0x26be97=_0x19749e[_0xa10c('0x3a')];if(!_0x8938f1[_0xa10c('0x35')][_0xa10c('0x3b')](_0xa10c('0x7e'))){_0x382285[_0xa10c('0x24')]=qs[_0xa10c('0x24')](_0x8938f1[_0xa10c('0x35')]['limit']);_0x382285[_0xa10c('0x23')]=qs[_0xa10c('0x23')](_0x8938f1['query']['offset']);}return _0x21b76e['getItems'](_0x382285);}})[_0xa10c('0x29')](function(_0x47376a){if(_0x47376a){return _0x47376a?{'count':_0x26be97,'rows':_0x47376a}:null;}})[_0xa10c('0x29')](respondWithResult(_0x3e0b18,null))[_0xa10c('0x4c')](handleError(_0x3e0b18,null));};
\ No newline at end of file
+var _0xd807=['attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','getItems','DashboardItem','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','count','offset','limit','apply','reject','update','then','get','CustomDashboards','UserProfileResource','destroy','error','stack','name','send','index','Dashboard','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','catch','show','params','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','options','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','iframe','attrUrl'];(function(_0x3b6d93,_0x39edc1){var _0x29859e=function(_0x4f27f2){while(--_0x4f27f2){_0x3b6d93['push'](_0x3b6d93['shift']());}};_0x29859e(++_0x39edc1);}(_0xd807,0x90));var _0x7d80=function(_0x24ce81,_0x34f1f0){_0x24ce81=_0x24ce81-0x0;var _0x4e3efb=_0xd807[_0x24ce81];return _0x4e3efb;};'use strict';var pdf=require(_0x7d80('0x0'));var emlformat=require(_0x7d80('0x1'));var rimraf=require(_0x7d80('0x2'));var zipdir=require(_0x7d80('0x3'));var jsonpatch=require(_0x7d80('0x4'));var rp=require(_0x7d80('0x5'));var moment=require(_0x7d80('0x6'));var BPromise=require(_0x7d80('0x7'));var Mustache=require(_0x7d80('0x8'));var util=require(_0x7d80('0x9'));var path=require(_0x7d80('0xa'));var sox=require(_0x7d80('0xb'));var csv=require(_0x7d80('0xc'));var ejs=require(_0x7d80('0xd'));var fs=require('fs');var _=require(_0x7d80('0xe'));var squel=require(_0x7d80('0xf'));var crypto=require(_0x7d80('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7d80('0xc'));var querystring=require(_0x7d80('0x11'));var Papa=require(_0x7d80('0x12'));var Redis=require('ioredis');var authService=require(_0x7d80('0x13'));var qs=require(_0x7d80('0x14'));var hardwareService=require(_0x7d80('0x15'));var logger=require(_0x7d80('0x16'))(_0x7d80('0x17'));var utils=require(_0x7d80('0x18'));var config=require('../../config/environment');var db=require(_0x7d80('0x19'))['db'];config[_0x7d80('0x1a')]=_[_0x7d80('0x1b')](config[_0x7d80('0x1a')],{'host':_0x7d80('0x1c'),'port':0x18eb});var socket=require(_0x7d80('0x1d'))(new Redis(config['redis']));require(_0x7d80('0x1e'))['register'](socket);function respondWithStatusCode(_0x4bfb5c,_0x355355){_0x355355=_0x355355||0xcc;return function(_0x4968f5){if(_0x4968f5){return _0x4bfb5c[_0x7d80('0x1f')](_0x355355);}return _0x4bfb5c[_0x7d80('0x20')](_0x355355)[_0x7d80('0x21')]();};}function respondWithResult(_0x35950d,_0x12b9f7){_0x12b9f7=_0x12b9f7||0xc8;return function(_0x54f395){if(_0x54f395){return _0x35950d['status'](_0x12b9f7)[_0x7d80('0x22')](_0x54f395);}};}function respondWithFilteredResult(_0x1ea7c7,_0x4410d4){return function(_0xcb0da6){if(_0xcb0da6){var _0x501d41=_0xcb0da6[_0x7d80('0x23')],_0x1b426e=_0x4410d4[_0x7d80('0x24')],_0x152ae3=_0x4410d4[_0x7d80('0x24')]+_0x4410d4[_0x7d80('0x25')],_0x5357c0;if(_0x152ae3>=_0x501d41){_0x152ae3=_0x501d41;_0x5357c0=0xc8;}else{_0x5357c0=0xce;}_0x1ea7c7[_0x7d80('0x20')](_0x5357c0);return _0x1ea7c7['set']('Content-Range',_0x1b426e+'-'+_0x152ae3+'/'+_0x501d41)[_0x7d80('0x22')](_0xcb0da6);}return null;};}function patchUpdates(_0x239400){return function(_0x20f235){try{jsonpatch[_0x7d80('0x26')](_0x20f235,_0x239400,!![]);}catch(_0x4b0c6e){return BPromise[_0x7d80('0x27')](_0x4b0c6e);}return _0x20f235['save']();};}function saveUpdates(_0x13ae1e,_0x11fb81){return function(_0x3c9ed6){if(_0x3c9ed6){return _0x3c9ed6[_0x7d80('0x28')](_0x13ae1e)[_0x7d80('0x29')](function(_0x4477a2){return _0x4477a2;});}return null;};}function removeEntity(_0x4d499b,_0x2495e8){return function(_0x17bc06){if(_0x17bc06){return _0x17bc06['destroy']()[_0x7d80('0x29')](function(){var _0x342018=_0x17bc06[_0x7d80('0x2a')]({'plain':!![]});var _0x276da1=_0x7d80('0x2b');return db[_0x7d80('0x2c')][_0x7d80('0x2d')]({'where':{'type':_0x276da1,'resourceId':_0x342018['id']}})[_0x7d80('0x29')](function(){return _0x17bc06;});})[_0x7d80('0x29')](function(){_0x4d499b[_0x7d80('0x20')](0xcc)[_0x7d80('0x21')]();});}};}function handleEntityNotFound(_0x17371a,_0x369c2a){return function(_0xe526e3){if(!_0xe526e3){_0x17371a['sendStatus'](0x194);}return _0xe526e3;};}function handleError(_0x4d7dc4,_0x3b39ed){_0x3b39ed=_0x3b39ed||0x1f4;return function(_0x52dec0){logger[_0x7d80('0x2e')](_0x52dec0[_0x7d80('0x2f')]);if(_0x52dec0['name']){delete _0x52dec0[_0x7d80('0x30')];}_0x4d7dc4[_0x7d80('0x20')](_0x3b39ed)[_0x7d80('0x31')](_0x52dec0);};}exports[_0x7d80('0x32')]=function(_0x183021,_0x4db185){var _0x236a30={},_0x2fc514={},_0x351a5f={'count':0x0,'rows':[]};var _0x3a8170=db[_0x7d80('0x33')][_0x7d80('0x34')];_0x2fc514[_0x7d80('0x35')]=_['keys'](_0x3a8170);_0x2fc514['query']=_[_0x7d80('0x36')](_0x183021[_0x7d80('0x37')]);_0x2fc514[_0x7d80('0x38')]=_[_0x7d80('0x39')](_0x2fc514[_0x7d80('0x35')],_0x2fc514['query']);_0x236a30[_0x7d80('0x3a')]=_[_0x7d80('0x39')](_0x2fc514['model'],qs[_0x7d80('0x3b')](_0x183021[_0x7d80('0x37')][_0x7d80('0x3b')]));_0x236a30[_0x7d80('0x3a')]=_0x236a30[_0x7d80('0x3a')]['length']?_0x236a30['attributes']:_0x2fc514[_0x7d80('0x35')];if(!_0x183021[_0x7d80('0x37')][_0x7d80('0x3c')]('nolimit')){_0x236a30[_0x7d80('0x25')]=qs[_0x7d80('0x25')](_0x183021[_0x7d80('0x37')][_0x7d80('0x25')]);_0x236a30[_0x7d80('0x24')]=qs[_0x7d80('0x24')](_0x183021[_0x7d80('0x37')][_0x7d80('0x24')]);}_0x236a30[_0x7d80('0x3d')]=qs['sort'](_0x183021[_0x7d80('0x37')][_0x7d80('0x3e')]);_0x236a30[_0x7d80('0x3f')]=qs[_0x7d80('0x38')](_[_0x7d80('0x40')](_0x183021[_0x7d80('0x37')],_0x2fc514[_0x7d80('0x38')]));if(_0x183021[_0x7d80('0x37')][_0x7d80('0x41')]){_0x236a30[_0x7d80('0x3f')]=_[_0x7d80('0x42')](_0x236a30[_0x7d80('0x3f')],{'$or':_[_0x7d80('0x43')](_0x3a8170,function(_0x587a28){if(_0x587a28[_0x7d80('0x44')][_0x7d80('0x45')]!==_0x7d80('0x46')){var _0x37790a={};_0x37790a[_0x587a28[_0x7d80('0x47')]]={'$like':'%'+_0x183021[_0x7d80('0x37')][_0x7d80('0x41')]+'%'};return _0x37790a;}})});}_0x236a30=_[_0x7d80('0x42')]({},_0x236a30,_0x183021['options']);var _0x20dfb8={'where':_0x236a30[_0x7d80('0x3f')]};return db[_0x7d80('0x33')][_0x7d80('0x23')](_0x20dfb8)[_0x7d80('0x29')](function(_0xa97bb6){_0x351a5f[_0x7d80('0x23')]=_0xa97bb6;if(_0x183021[_0x7d80('0x37')][_0x7d80('0x48')]){_0x236a30[_0x7d80('0x49')]=[{'all':!![]}];}return db[_0x7d80('0x33')]['findAll'](_0x236a30);})['then'](function(_0x45650f){_0x351a5f[_0x7d80('0x4a')]=_0x45650f;return _0x351a5f;})['then'](respondWithFilteredResult(_0x4db185,_0x236a30))[_0x7d80('0x4b')](handleError(_0x4db185,null));};exports[_0x7d80('0x4c')]=function(_0x2dd6c0,_0x2c859f){var _0x4a10cb={'raw':![],'where':{'id':_0x2dd6c0[_0x7d80('0x4d')]['id']}},_0x4cdf52={};_0x4cdf52[_0x7d80('0x35')]=_['keys'](db[_0x7d80('0x33')][_0x7d80('0x34')]);_0x4cdf52[_0x7d80('0x37')]=_['keys'](_0x2dd6c0[_0x7d80('0x37')]);_0x4cdf52[_0x7d80('0x38')]=_[_0x7d80('0x39')](_0x4cdf52[_0x7d80('0x35')],_0x4cdf52[_0x7d80('0x37')]);_0x4a10cb[_0x7d80('0x3a')]=_[_0x7d80('0x39')](_0x4cdf52[_0x7d80('0x35')],qs[_0x7d80('0x3b')](_0x2dd6c0['query'][_0x7d80('0x3b')]));_0x4a10cb[_0x7d80('0x3a')]=_0x4a10cb[_0x7d80('0x3a')]['length']?_0x4a10cb[_0x7d80('0x3a')]:_0x4cdf52[_0x7d80('0x35')];if(_0x2dd6c0[_0x7d80('0x37')][_0x7d80('0x48')]){_0x4a10cb[_0x7d80('0x49')]=[{'all':!![]}];}_0x4a10cb=_['merge']({},_0x4a10cb,_0x2dd6c0['options']);return db[_0x7d80('0x33')]['find'](_0x4a10cb)[_0x7d80('0x29')](handleEntityNotFound(_0x2c859f,null))['then'](respondWithResult(_0x2c859f,null))['catch'](handleError(_0x2c859f,null));};exports[_0x7d80('0x4e')]=function(_0xb833e6,_0x157b01){return db[_0x7d80('0x33')][_0x7d80('0x4e')](_0xb833e6['body'],{})[_0x7d80('0x29')](function(_0x1bbb53){var _0x590438=_0xb833e6[_0x7d80('0x4f')][_0x7d80('0x2a')]({'plain':!![]});if(!_0x590438)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590438[_0x7d80('0x50')]===_0x7d80('0x4f')){var _0x480255=_0x1bbb53[_0x7d80('0x2a')]({'plain':!![]});var _0x2ff180=_0x7d80('0x2b');return db[_0x7d80('0x51')][_0x7d80('0x52')]({'where':{'name':_0x2ff180,'userProfileId':_0x590438[_0x7d80('0x53')]},'raw':!![]})[_0x7d80('0x29')](function(_0x3d3b16){if(_0x3d3b16&&_0x3d3b16[_0x7d80('0x54')]===0x0){return db[_0x7d80('0x2c')][_0x7d80('0x4e')]({'name':_0x480255[_0x7d80('0x30')],'resourceId':_0x480255['id'],'type':_0x3d3b16[_0x7d80('0x30')],'sectionId':_0x3d3b16['id']},{})[_0x7d80('0x29')](function(){return _0x1bbb53;});}else{return _0x1bbb53;}})['catch'](function(_0x450022){logger[_0x7d80('0x2e')](_0x7d80('0x55'),_0x450022);throw _0x450022;});}return _0x1bbb53;})[_0x7d80('0x29')](respondWithResult(_0x157b01,0xc9))[_0x7d80('0x4b')](handleError(_0x157b01,null));};exports['clone']=function(_0x4220fb,_0x3e4853){var _0x2d0e80={'raw':![],'where':{'id':_0x4220fb['params']['id']}},_0x4b03fb={};_0x4b03fb[_0x7d80('0x35')]=_[_0x7d80('0x36')](db[_0x7d80('0x33')]['rawAttributes']);_0x2d0e80[_0x7d80('0x3a')]=_[_0x7d80('0x39')](_0x4b03fb[_0x7d80('0x35')],qs['fields'](_0x4220fb['query'][_0x7d80('0x3b')]));_0x2d0e80['attributes']=_0x2d0e80[_0x7d80('0x3a')]['length']?_0x2d0e80[_0x7d80('0x3a')]:_0x4b03fb['model'];if(_0x4220fb[_0x7d80('0x37')][_0x7d80('0x48')]){_0x2d0e80[_0x7d80('0x49')]=[{'all':!![]}];}_0x2d0e80=_[_0x7d80('0x42')]({},_0x2d0e80,_0x4220fb[_0x7d80('0x56')]);return db[_0x7d80('0x33')][_0x7d80('0x52')](_0x2d0e80)['then'](handleEntityNotFound(_0x3e4853,null))[_0x7d80('0x29')](function(_0x508748){if(_0x508748){var _0x4e366a=_0x508748[_0x7d80('0x2a')]({'plain':!![]});_0x4e366a=qs[_0x7d80('0x57')](_0x4e366a,['id',_0x7d80('0x58'),_0x7d80('0x59')]);_0x4220fb['body']=_[_0x7d80('0x57')](_0x4220fb[_0x7d80('0x5a')],['id',_0x7d80('0x58'),_0x7d80('0x59')]);return db[_0x7d80('0x33')][_0x7d80('0x4e')](_['merge'](_0x4e366a,_0x4220fb[_0x7d80('0x5a')]),{'include':_0x4220fb[_0x7d80('0x37')][_0x7d80('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x5e4a9f){var _0x29498b=_0x4220fb[_0x7d80('0x4f')][_0x7d80('0x2a')]({'plain':!![]});if(!_0x29498b)throw new Error(_0x7d80('0x5b'));if(_0x29498b[_0x7d80('0x50')]===_0x7d80('0x4f')){var _0x380d25=_0x5e4a9f[_0x7d80('0x2a')]({'plain':!![]});var _0x1ddb06=_0x7d80('0x2b');return db[_0x7d80('0x51')][_0x7d80('0x52')]({'where':{'name':_0x1ddb06,'userProfileId':_0x29498b[_0x7d80('0x53')]},'raw':!![]})['then'](function(_0x8ed3a3){if(_0x8ed3a3&&_0x8ed3a3[_0x7d80('0x54')]===0x0){return db['UserProfileResource'][_0x7d80('0x4e')]({'name':_0x380d25[_0x7d80('0x30')],'resourceId':_0x380d25['id'],'type':_0x8ed3a3[_0x7d80('0x30')],'sectionId':_0x8ed3a3['id']},{})[_0x7d80('0x29')](function(){return _0x5e4a9f;});}else{return _0x5e4a9f;}})[_0x7d80('0x4b')](function(_0x3cb66d){logger[_0x7d80('0x2e')](_0x7d80('0x55'),_0x3cb66d);throw _0x3cb66d;});}return _0x5e4a9f;});}})[_0x7d80('0x29')](respondWithResult(_0x3e4853,0xc9))[_0x7d80('0x4b')](handleError(_0x3e4853,null));};exports['update']=function(_0x5e77ab,_0x33bf9a){if(_0x5e77ab[_0x7d80('0x5a')]['id']){delete _0x5e77ab[_0x7d80('0x5a')]['id'];}return db[_0x7d80('0x33')][_0x7d80('0x52')]({'where':{'id':_0x5e77ab[_0x7d80('0x4d')]['id']}})['then'](handleEntityNotFound(_0x33bf9a,null))[_0x7d80('0x29')](saveUpdates(_0x5e77ab[_0x7d80('0x5a')],null))[_0x7d80('0x29')](respondWithResult(_0x33bf9a,null))['catch'](handleError(_0x33bf9a,null));};exports['destroy']=function(_0x55b77c,_0x506e92){return db[_0x7d80('0x33')]['find']({'where':{'id':_0x55b77c[_0x7d80('0x4d')]['id']}})[_0x7d80('0x29')](handleEntityNotFound(_0x506e92,null))['then'](removeEntity(_0x506e92,null))[_0x7d80('0x4b')](handleError(_0x506e92,null));};function widgetAttributes(_0x440d77){try{switch(_0x440d77[_0x7d80('0x44')]){case _0x7d80('0x5c'):return[{'name':'attrUrl','value':_0x440d77[_0x7d80('0x5d')]||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77['attrs'][0x0]?_0x440d77['attrs'][0x0]['value']:undefined)||_0x7d80('0x5f')}];case'custom':return[{'name':_0x7d80('0x60'),'value':_0x440d77['attrPath']||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77[_0x7d80('0x5e')][0x0]?_0x440d77[_0x7d80('0x5e')][0x0][_0x7d80('0x61')]:undefined)||''}];case _0x7d80('0x62'):return[{'name':_0x7d80('0x63'),'value':_0x440d77['attrHourFormat']||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77[_0x7d80('0x5e')][0x0]?_0x440d77[_0x7d80('0x5e')][0x0][_0x7d80('0x61')]:undefined)||_0x7d80('0x64')},{'name':_0x7d80('0x65'),'value':_0x440d77[_0x7d80('0x65')]||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77[_0x7d80('0x5e')][0x1]?_0x440d77[_0x7d80('0x5e')][0x1]['value']:undefined)||_0x7d80('0x66')},{'name':_0x7d80('0x67'),'value':_0x440d77[_0x7d80('0x67')]||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77[_0x7d80('0x5e')][0x2]?_0x440d77[_0x7d80('0x5e')][0x2][_0x7d80('0x61')]:undefined)||0xc}];case _0x7d80('0x68'):return[{'name':_0x7d80('0x69'),'value':_0x440d77[_0x7d80('0x69')]||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77[_0x7d80('0x5e')][0x0]?_0x440d77[_0x7d80('0x5e')][0x0][_0x7d80('0x61')]:undefined)||_0x7d80('0x6a')},{'name':_0x7d80('0x6b'),'value':_0x440d77[_0x7d80('0x6b')]||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77[_0x7d80('0x5e')][0x1]?_0x440d77['attrs'][0x1][_0x7d80('0x61')]:undefined)||[]},{'name':'attrFontSize','value':_0x440d77[_0x7d80('0x67')]||(_0x440d77['attrs']&&_0x440d77['attrs'][0x2]?_0x440d77[_0x7d80('0x5e')][0x2][_0x7d80('0x61')]:undefined)||0x14}];case _0x7d80('0x6c'):case'pie-chart':return[{'name':_0x7d80('0x6d'),'value':_0x440d77[_0x7d80('0x6d')]||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77[_0x7d80('0x5e')][0x0]?_0x440d77[_0x7d80('0x5e')][0x0][_0x7d80('0x61')]:undefined)||'total'},{'name':_0x7d80('0x6e'),'value':_0x440d77[_0x7d80('0x6e')]||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77[_0x7d80('0x5e')][0x1]?_0x440d77[_0x7d80('0x5e')][0x1][_0x7d80('0x61')]:undefined)||null},{'name':'attrSerie3','value':_0x440d77['attrSerie3']||(_0x440d77['attrs']&&_0x440d77[_0x7d80('0x5e')][0x2]?_0x440d77['attrs'][0x2][_0x7d80('0x61')]:undefined)||null},{'name':_0x7d80('0x6b'),'value':_0x440d77[_0x7d80('0x6b')]||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77[_0x7d80('0x5e')][0x3]?_0x440d77[_0x7d80('0x5e')][0x3]['value']:undefined)||[]}];case _0x7d80('0x6f'):return[{'name':_0x7d80('0x70'),'type':_0x440d77[_0x7d80('0x71')]||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77['attrs'][0x0]?_0x440d77[_0x7d80('0x5e')][0x0][_0x7d80('0x44')]:undefined)||null,'value':_0x440d77[_0x7d80('0x70')]||(_0x440d77['attrs']&&_0x440d77[_0x7d80('0x5e')][0x0]?_0x440d77[_0x7d80('0x5e')][0x0][_0x7d80('0x61')]:undefined)||null},{'name':'attrRefresh','value':_0x440d77[_0x7d80('0x72')]||(_0x440d77[_0x7d80('0x5e')]&&_0x440d77['attrs'][0x1]?_0x440d77[_0x7d80('0x5e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x577f15){logger[_0x7d80('0x2e')](_0x7d80('0x73'),JSON[_0x7d80('0x74')](_0x577f15));return[];}}exports['addItem']=function(_0x320562,_0x3cda6a,_0x5d06d9){if(_0x320562[_0x7d80('0x5a')]['id']){delete _0x320562['body']['id'];}return db[_0x7d80('0x33')][_0x7d80('0x52')]({'where':{'id':_0x320562[_0x7d80('0x4d')]['id']}})[_0x7d80('0x29')](handleEntityNotFound(_0x3cda6a,null))[_0x7d80('0x29')](function(_0x1c4e10){if(_0x1c4e10){_0x320562[_0x7d80('0x5a')]['DashboardId']=_0x1c4e10['id'];_0x320562[_0x7d80('0x5a')][_0x7d80('0x5e')]=widgetAttributes(_0x320562[_0x7d80('0x5a')]);return db['DashboardItem'][_0x7d80('0x4e')](_0x320562[_0x7d80('0x5a')]);}})[_0x7d80('0x29')](respondWithResult(_0x3cda6a,null))[_0x7d80('0x4b')](handleError(_0x3cda6a,null));};exports[_0x7d80('0x75')]=function(_0x43d1ca,_0x1750c9,_0x36a316){var _0x204c51={};var _0x15701b={};var _0x3491f1;var _0x112c4c;return db[_0x7d80('0x33')]['findOne']({'where':{'id':_0x43d1ca[_0x7d80('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1750c9,null))[_0x7d80('0x29')](function(_0x4b09d8){if(_0x4b09d8){_0x3491f1=_0x4b09d8;_0x15701b[_0x7d80('0x35')]=_[_0x7d80('0x36')](db[_0x7d80('0x76')][_0x7d80('0x34')]);_0x15701b[_0x7d80('0x37')]=_['keys'](_0x43d1ca[_0x7d80('0x37')]);_0x15701b[_0x7d80('0x38')]=_[_0x7d80('0x39')](_0x15701b[_0x7d80('0x35')],_0x15701b[_0x7d80('0x37')]);_0x204c51['attributes']=_[_0x7d80('0x39')](_0x15701b[_0x7d80('0x35')],qs[_0x7d80('0x3b')](_0x43d1ca['query'][_0x7d80('0x3b')]));_0x204c51[_0x7d80('0x3a')]=_0x204c51['attributes']['length']?_0x204c51['attributes']:_0x15701b['model'];_0x204c51[_0x7d80('0x3d')]=qs['sort'](_0x43d1ca[_0x7d80('0x37')][_0x7d80('0x3e')]);_0x204c51[_0x7d80('0x3f')]=qs['filters'](_[_0x7d80('0x40')](_0x43d1ca[_0x7d80('0x37')],_0x15701b[_0x7d80('0x38')]));if(_0x43d1ca['query'][_0x7d80('0x41')]){_0x204c51[_0x7d80('0x3f')]=_[_0x7d80('0x42')](_0x204c51[_0x7d80('0x3f')],{'$or':_[_0x7d80('0x43')](_0x204c51[_0x7d80('0x3a')],function(_0x46c29){var _0x2147f6={};_0x2147f6[_0x46c29]={'$like':'%'+_0x43d1ca[_0x7d80('0x37')][_0x7d80('0x41')]+'%'};return _0x2147f6;})});}_0x204c51=_[_0x7d80('0x42')]({},_0x204c51,_0x43d1ca[_0x7d80('0x56')]);return _0x3491f1[_0x7d80('0x75')](_0x204c51);}})[_0x7d80('0x29')](function(_0xf8988f){if(_0xf8988f){_0x112c4c=_0xf8988f['length'];if(!_0x43d1ca[_0x7d80('0x37')][_0x7d80('0x3c')]('nolimit')){_0x204c51[_0x7d80('0x25')]=qs['limit'](_0x43d1ca[_0x7d80('0x37')][_0x7d80('0x25')]);_0x204c51[_0x7d80('0x24')]=qs[_0x7d80('0x24')](_0x43d1ca['query'][_0x7d80('0x24')]);}return _0x3491f1['getItems'](_0x204c51);}})[_0x7d80('0x29')](function(_0x465b41){if(_0x465b41){return _0x465b41?{'count':_0x112c4c,'rows':_0x465b41}:null;}})[_0x7d80('0x29')](respondWithResult(_0x1750c9,null))[_0x7d80('0x4b')](handleError(_0x1750c9,null));};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js
index 9e9bb19..8086721 100644
--- a/server/api/dashboard/dashboard.events.js
+++ b/server/api/dashboard/dashboard.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf98a=['emit','hasOwnProperty','hook','exports','Dashboard','setMaxListeners','save'];(function(_0x123d01,_0x413cfa){var _0x2ad989=function(_0x3450cb){while(--_0x3450cb){_0x123d01['push'](_0x123d01['shift']());}};_0x2ad989(++_0x413cfa);}(_0xf98a,0x162));var _0xaf98=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xf98a[_0xfcbcb8];return _0x1b1f97;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0xaf98('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xaf98('0x1')](0x0);var events={'afterCreate':_0xaf98('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xcbc000){return function(_0x4b9abf,_0x115ee7,_0x3189b6){DashboardEvents[_0xaf98('0x3')](_0xcbc000+':'+_0x4b9abf['id'],_0x4b9abf);DashboardEvents[_0xaf98('0x3')](_0xcbc000,_0x4b9abf);_0x3189b6(null);};}for(var e in events){if(events[_0xaf98('0x4')](e)){var event=events[e];Dashboard[_0xaf98('0x5')](e,emitEvent(event));}}module[_0xaf98('0x6')]=DashboardEvents;
\ No newline at end of file
+var _0xf5af=['hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit'];(function(_0x40cdfa,_0x1cf634){var _0x2c5e4d=function(_0x1a666c){while(--_0x1a666c){_0x40cdfa['push'](_0x40cdfa['shift']());}};_0x2c5e4d(++_0x1cf634);}(_0xf5af,0x1b0));var _0xff5a=function(_0x2e7f96,_0x2ffe43){_0x2e7f96=_0x2e7f96-0x0;var _0x315277=_0xf5af[_0x2e7f96];return _0x315277;};'use strict';var EventEmitter=require(_0xff5a('0x0'));var Dashboard=require(_0xff5a('0x1'))['db'][_0xff5a('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xff5a('0x3')](0x0);var events={'afterCreate':_0xff5a('0x4'),'afterUpdate':_0xff5a('0x5'),'afterDestroy':_0xff5a('0x6')};function emitEvent(_0x398372){return function(_0x11e43e,_0x31e8d4,_0x220608){DashboardEvents['emit'](_0x398372+':'+_0x11e43e['id'],_0x11e43e);DashboardEvents[_0xff5a('0x7')](_0x398372,_0x11e43e);_0x220608(null);};}for(var e in events){if(events[_0xff5a('0x8')](e)){var event=events[e];Dashboard[_0xff5a('0x9')](e,emitEvent(event));}}module[_0xff5a('0xa')]=DashboardEvents;
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js
index ae64774..21483a7 100644
--- a/server/api/dashboard/dashboard.model.js
+++ b/server/api/dashboard/dashboard.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd90b=['lodash','api','request-promise','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards'];(function(_0x9648db,_0x588d6e){var _0x2ce466=function(_0x4a47d9){while(--_0x4a47d9){_0x9648db['push'](_0x9648db['shift']());}};_0x2ce466(++_0x588d6e);}(_0xd90b,0xbd));var _0xbd90=function(_0x5a8899,_0x521ad0){_0x5a8899=_0x5a8899-0x0;var _0x548638=_0xd90b[_0x5a8899];return _0x548638;};'use strict';var _=require(_0xbd90('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbd90('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd90('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd90('0x3'));var config=require(_0xbd90('0x4'));var attributes=require(_0xbd90('0x5'));module[_0xbd90('0x6')]=function(_0x448c24,_0x257fd3){return _0x448c24['define'](_0xbd90('0x7'),attributes,{'tableName':_0xbd90('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa947=['util','../../config/logger','api','moment','bluebird','request-promise','./dashboard.attributes','define','Dashboard','dashboards','lodash'];(function(_0x38cb84,_0x569c52){var _0x8471fe=function(_0x46fea6){while(--_0x46fea6){_0x38cb84['push'](_0x38cb84['shift']());}};_0x8471fe(++_0x569c52);}(_0xa947,0x11d));var _0x7a94=function(_0x5d2672,_0x47adc0){_0x5d2672=_0x5d2672-0x0;var _0x483c1e=_0xa947[_0x5d2672];return _0x483c1e;};'use strict';var _=require(_0x7a94('0x0'));var util=require(_0x7a94('0x1'));var logger=require(_0x7a94('0x2'))(_0x7a94('0x3'));var moment=require(_0x7a94('0x4'));var BPromise=require(_0x7a94('0x5'));var rp=require(_0x7a94('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7a94('0x7'));module['exports']=function(_0x2ea02c,_0x281dc9){return _0x2ea02c[_0x7a94('0x8')](_0x7a94('0x9'),attributes,{'tableName':_0x7a94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js
index a1fd531..7b625a4 100644
--- a/server/api/dashboard/dashboard.rpc.js
+++ b/server/api/dashboard/dashboard.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55e6=['socket.io-emitter','./dashboard.socket','register','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','Dashboard,\x20%s,\x20%s','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','http','defaults','redis'];(function(_0x186e6c,_0x11567f){var _0x111ba7=function(_0x4297af){while(--_0x4297af){_0x186e6c['push'](_0x186e6c['shift']());}};_0x111ba7(++_0x11567f);}(_0x55e6,0x6f));var _0x655e=function(_0x1304c5,_0x359ed9){_0x1304c5=_0x1304c5-0x0;var _0x3a05ee=_0x55e6[_0x1304c5];return _0x3a05ee;};'use strict';var _=require('lodash');var util=require(_0x655e('0x0'));var moment=require(_0x655e('0x1'));var BPromise=require(_0x655e('0x2'));var rs=require(_0x655e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x655e('0x4'));var logger=require(_0x655e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x655e('0x6')]({'port':0x232a});config['redis']=_[_0x655e('0x7')](config[_0x655e('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x655e('0x9'))(new Redis(config[_0x655e('0x8')]));require(_0x655e('0xa'))[_0x655e('0xb')](socket);function respondWithRpcPromise(_0x435e6d,_0x28c468,_0x389659){return new BPromise(function(_0x501d5f,_0x2d55a8){return client['request'](_0x435e6d,_0x389659)['then'](function(_0x1f6722){logger[_0x655e('0xc')]('Dashboard,\x20%s,\x20%s',_0x28c468,_0x655e('0xd'));logger[_0x655e('0xe')](_0x655e('0xf'),_0x28c468,_0x655e('0xd'),JSON['stringify'](_0x1f6722));if(_0x1f6722[_0x655e('0x10')]){if(_0x1f6722[_0x655e('0x10')][_0x655e('0x11')]===0x1f4){logger[_0x655e('0x10')]('Dashboard,\x20%s,\x20%s',_0x28c468,_0x1f6722[_0x655e('0x10')][_0x655e('0x12')]);return _0x2d55a8(_0x1f6722[_0x655e('0x10')][_0x655e('0x12')]);}logger[_0x655e('0x10')](_0x655e('0x13'),_0x28c468,_0x1f6722['error']['message']);return _0x501d5f(_0x1f6722[_0x655e('0x10')][_0x655e('0x12')]);}else{logger[_0x655e('0xc')]('Dashboard,\x20%s,\x20%s',_0x28c468,'request\x20sent');_0x501d5f(_0x1f6722['result']['message']);}})['catch'](function(_0x39e802){logger[_0x655e('0x10')](_0x655e('0x13'),_0x28c468,_0x39e802);_0x2d55a8(_0x39e802);});});}
\ No newline at end of file
+var _0x229b=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x229b,0x119));var _0xb229=function(_0x1fe948,_0xcb7732){_0x1fe948=_0x1fe948-0x0;var _0x5d283c=_0x229b[_0x1fe948];return _0x5d283c;};'use strict';var _=require(_0xb229('0x0'));var util=require(_0xb229('0x1'));var moment=require(_0xb229('0x2'));var BPromise=require(_0xb229('0x3'));var rs=require(_0xb229('0x4'));var fs=require('fs');var Redis=require(_0xb229('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb229('0x6'));var logger=require(_0xb229('0x7'))(_0xb229('0x8'));var config=require(_0xb229('0x9'));var jayson=require(_0xb229('0xa'));var client=jayson[_0xb229('0xb')][_0xb229('0xc')]({'port':0x232a});config[_0xb229('0xd')]=_[_0xb229('0xe')](config['redis'],{'host':_0xb229('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb229('0xd')]));require(_0xb229('0x10'))[_0xb229('0x11')](socket);function respondWithRpcPromise(_0x5d513f,_0x4e60c5,_0xed3b92){return new BPromise(function(_0x81b49,_0x55cfa4){return client[_0xb229('0x12')](_0x5d513f,_0xed3b92)[_0xb229('0x13')](function(_0x5ad854){logger[_0xb229('0x14')](_0xb229('0x15'),_0x4e60c5,_0xb229('0x16'));logger[_0xb229('0x17')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x4e60c5,_0xb229('0x16'),JSON['stringify'](_0x5ad854));if(_0x5ad854[_0xb229('0x18')]){if(_0x5ad854[_0xb229('0x18')][_0xb229('0x19')]===0x1f4){logger[_0xb229('0x18')]('Dashboard,\x20%s,\x20%s',_0x4e60c5,_0x5ad854[_0xb229('0x18')][_0xb229('0x1a')]);return _0x55cfa4(_0x5ad854[_0xb229('0x18')][_0xb229('0x1a')]);}logger[_0xb229('0x18')]('Dashboard,\x20%s,\x20%s',_0x4e60c5,_0x5ad854[_0xb229('0x18')]['message']);return _0x81b49(_0x5ad854[_0xb229('0x18')][_0xb229('0x1a')]);}else{logger[_0xb229('0x14')](_0xb229('0x15'),_0x4e60c5,_0xb229('0x16'));_0x81b49(_0x5ad854[_0xb229('0x1b')][_0xb229('0x1a')]);}})['catch'](function(_0x105d7b){logger[_0xb229('0x18')](_0xb229('0x15'),_0x4e60c5,_0x105d7b);_0x55cfa4(_0x105d7b);});});}
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js
index 4a47082..78b6845 100644
--- a/server/api/dashboard/dashboard.socket.js
+++ b/server/api/dashboard/dashboard.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb122=['update','emit','removeListener','register','length','dashboard:','./dashboard.events','save','remove'];(function(_0x8878eb,_0x30f31b){var _0x5bc4f5=function(_0x370037){while(--_0x370037){_0x8878eb['push'](_0x8878eb['shift']());}};_0x5bc4f5(++_0x30f31b);}(_0xb122,0x69));var _0x2b12=function(_0x227b5c,_0x52a170){_0x227b5c=_0x227b5c-0x0;var _0x1eba10=_0xb122[_0x227b5c];return _0x1eba10;};'use strict';var DashboardEvents=require(_0x2b12('0x0'));var events=[_0x2b12('0x1'),_0x2b12('0x2'),_0x2b12('0x3')];function createListener(_0x4d7bca,_0x2c30fe){return function(_0x1c6b3a){_0x2c30fe[_0x2b12('0x4')](_0x4d7bca,_0x1c6b3a);};}function removeListener(_0x236505,_0x445d42){return function(){DashboardEvents[_0x2b12('0x5')](_0x236505,_0x445d42);};}exports[_0x2b12('0x6')]=function(_0x2cb51b){for(var _0x5cba3f=0x0,_0x14646a=events[_0x2b12('0x7')];_0x5cba3f<_0x14646a;_0x5cba3f++){var _0x5b1ad5=events[_0x5cba3f];var _0x3e52b4=createListener(_0x2b12('0x8')+_0x5b1ad5,_0x2cb51b);DashboardEvents['on'](_0x5b1ad5,_0x3e52b4);}};
\ No newline at end of file
+var _0x59d3=['./dashboard.events','save','remove','update','removeListener','length','dashboard:'];(function(_0x25dc76,_0xfae587){var _0x478c85=function(_0x263ae8){while(--_0x263ae8){_0x25dc76['push'](_0x25dc76['shift']());}};_0x478c85(++_0xfae587);}(_0x59d3,0x1ea));var _0x359d=function(_0x565e79,_0x4c2789){_0x565e79=_0x565e79-0x0;var _0x531a55=_0x59d3[_0x565e79];return _0x531a55;};'use strict';var DashboardEvents=require(_0x359d('0x0'));var events=[_0x359d('0x1'),_0x359d('0x2'),_0x359d('0x3')];function createListener(_0x4685cd,_0x1b8323){return function(_0x1c02f7){_0x1b8323['emit'](_0x4685cd,_0x1c02f7);};}function removeListener(_0x314a6a,_0x4cce9b){return function(){DashboardEvents[_0x359d('0x4')](_0x314a6a,_0x4cce9b);};}exports['register']=function(_0x4ccea5){for(var _0x1bf627=0x0,_0x2a7c7a=events[_0x359d('0x5')];_0x1bf627<_0x2a7c7a;_0x1bf627++){var _0x255f70=events[_0x1bf627];var _0x350090=createListener(_0x359d('0x6')+_0x255f70,_0x4ccea5);DashboardEvents['on'](_0x255f70,_0x350090);}};
\ No newline at end of file
diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js
index 84dc0cd..bfee6fe 100644
--- a/server/api/dashboard/index.js
+++ b/server/api/dashboard/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa33a=['show','/:id/items','getItems','create','post','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id'];(function(_0x23981d,_0x1729ca){var _0xdb582f=function(_0xa1dd7c){while(--_0xa1dd7c){_0x23981d['push'](_0x23981d['shift']());}};_0xdb582f(++_0x1729ca);}(_0xa33a,0x68));var _0xaa33=function(_0x4d2216,_0x1f3826){_0x4d2216=_0x4d2216-0x0;var _0x44a375=_0xa33a[_0x4d2216];return _0x44a375;};'use strict';var multer=require(_0xaa33('0x0'));var util=require(_0xaa33('0x1'));var path=require(_0xaa33('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa33('0x3')]();var auth=require(_0xaa33('0x4'));var interaction=require(_0xaa33('0x5'));var config=require('../../config/environment');var controller=require(_0xaa33('0x6'));router[_0xaa33('0x7')]('/',auth[_0xaa33('0x8')](),controller[_0xaa33('0x9')]);router[_0xaa33('0x7')](_0xaa33('0xa'),auth[_0xaa33('0x8')](),controller[_0xaa33('0xb')]);router[_0xaa33('0x7')](_0xaa33('0xc'),auth[_0xaa33('0x8')](),controller[_0xaa33('0xd')]);router['post']('/',auth[_0xaa33('0x8')](),controller[_0xaa33('0xe')]);router[_0xaa33('0xf')](_0xaa33('0x10'),auth['isAuthenticated'](),controller['clone']);router[_0xaa33('0xf')](_0xaa33('0xc'),auth[_0xaa33('0x8')](),controller[_0xaa33('0x11')]);router[_0xaa33('0x12')](_0xaa33('0xa'),auth[_0xaa33('0x8')](),controller[_0xaa33('0x13')]);router[_0xaa33('0x14')](_0xaa33('0xa'),auth[_0xaa33('0x8')](),controller[_0xaa33('0x15')]);module[_0xaa33('0x16')]=router;
\ No newline at end of file
+var _0x391b=['create','/:id/clone','clone','addItem','put','update','delete','destroy','path','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','/:id/items','getItems','post'];(function(_0x29a8e0,_0x1cfe44){var _0x42ea7c=function(_0xb49452){while(--_0xb49452){_0x29a8e0['push'](_0x29a8e0['shift']());}};_0x42ea7c(++_0x1cfe44);}(_0x391b,0x10c));var _0xb391=function(_0x3dedad,_0x435b1f){_0x3dedad=_0x3dedad-0x0;var _0x5470ba=_0x391b[_0x3dedad];return _0x5470ba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb391('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb391('0x1'));var config=require(_0xb391('0x2'));var controller=require(_0xb391('0x3'));router[_0xb391('0x4')]('/',auth['isAuthenticated'](),controller[_0xb391('0x5')]);router[_0xb391('0x4')](_0xb391('0x6'),auth[_0xb391('0x7')](),controller[_0xb391('0x8')]);router[_0xb391('0x4')](_0xb391('0x9'),auth[_0xb391('0x7')](),controller[_0xb391('0xa')]);router[_0xb391('0xb')]('/',auth['isAuthenticated'](),controller[_0xb391('0xc')]);router[_0xb391('0xb')](_0xb391('0xd'),auth[_0xb391('0x7')](),controller[_0xb391('0xe')]);router[_0xb391('0xb')](_0xb391('0x9'),auth[_0xb391('0x7')](),controller[_0xb391('0xf')]);router[_0xb391('0x10')](_0xb391('0x6'),auth['isAuthenticated'](),controller[_0xb391('0x11')]);router[_0xb391('0x12')]('/:id',auth[_0xb391('0x7')](),controller[_0xb391('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js
index c49d9df..cd0af91 100644
--- a/server/api/dashboardItem/dashboardItem.attributes.js
+++ b/server/api/dashboardItem/dashboardItem.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3cee=['sequelize','STRING','parse','getDataValue','setDataValue','attrs','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x4c273f,_0x37e69b){var _0x46533a=function(_0x9e1894){while(--_0x9e1894){_0x4c273f['push'](_0x4c273f['shift']());}};_0x46533a(++_0x37e69b);}(_0x3cee,0x136));var _0xe3ce=function(_0x3db3b1,_0x4c1516){_0x3db3b1=_0x3db3b1-0x0;var _0x1aefda=_0x3cee[_0x3db3b1];return _0x1aefda;};'use strict';var Sequelize=require(_0xe3ce('0x0'));var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0xe3ce('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe3ce('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON[_0xe3ce('0x2')](this[_0xe3ce('0x3')]('attrs'));}catch(_0x242de4){return[];}},'set':function(_0x296eb9){try{this[_0xe3ce('0x4')](_0xe3ce('0x5'),JSON[_0xe3ce('0x6')](_0x296eb9));}catch(_0xccf378){this[_0xe3ce('0x4')](_0xe3ce('0x5'),JSON[_0xe3ce('0x6')]([]));}}},'sizeX':{'type':Sequelize[_0xe3ce('0x7')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xe3ce('0x7')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xe3ce('0x7')]},'col':{'type':Sequelize[_0xe3ce('0x7')]},'background':{'type':Sequelize[_0xe3ce('0x1')],'allowNull':![],'defaultValue':_0xe3ce('0x8'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe3ce('0x9'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xe3ce('0x1')]}};
\ No newline at end of file
+var _0xb637=['#ffffff','squel','lodash','STRING','long','parse','attrs','setDataValue','stringify','INTEGER'];(function(_0x129968,_0x2111e1){var _0x41e22d=function(_0x579681){while(--_0x579681){_0x129968['push'](_0x129968['shift']());}};_0x41e22d(++_0x2111e1);}(_0xb637,0x6f));var _0x7b63=function(_0x2add7b,_0x52ba55){_0x2add7b=_0x2add7b-0x0;var _0x5cb6ca=_0xb637[_0x2add7b];return _0x5cb6ca;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x7b63('0x0'));var _=require(_0x7b63('0x1'));module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7b63('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x7b63('0x3')),'get':function(){try{return JSON[_0x7b63('0x4')](this['getDataValue'](_0x7b63('0x5')));}catch(_0x56e55d){return[];}},'set':function(_0x36edca){try{this[_0x7b63('0x6')](_0x7b63('0x5'),JSON[_0x7b63('0x7')](_0x36edca));}catch(_0x184d72){this[_0x7b63('0x6')]('attrs',JSON[_0x7b63('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x7b63('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7b63('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x7b63('0x2')],'allowNull':![],'defaultValue':_0x7b63('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x7b63('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7b63('0x2')]}};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js
index 9213bb0..59e396b 100644
--- a/server/api/dashboardItem/dashboardItem.controller.js
+++ b/server/api/dashboardItem/dashboardItem.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['find','catch','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrRefresh','stringify','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','stack','name','send','show','params','DashboardItem','rawAttributes','query','keys','model','attributes','fields','length','includeAll','include','merge','options'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5def3c,_0x4cadf7){_0x5def3c=_0x5def3c-0x0;var _0x4e568f=_0x5f2f[_0x5def3c];return _0x4e568f;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf5f2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf5f2('0x14'));var config=require(_0xf5f2('0x15'));var db=require('../../mysqldb')['db'];config[_0xf5f2('0x16')]=_[_0xf5f2('0x17')](config[_0xf5f2('0x16')],{'host':_0xf5f2('0x18'),'port':0x18eb});var socket=require(_0xf5f2('0x19'))(new Redis(config[_0xf5f2('0x16')]));require('./dashboardItem.socket')[_0xf5f2('0x1a')](socket);function respondWithStatusCode(_0xea612c,_0x269909){_0x269909=_0x269909||0xcc;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1b')](_0x269909);}return _0xea612c['status'](_0x269909)[_0xf5f2('0x1c')]();};}function respondWithResult(_0x286197,_0x17d656){_0x17d656=_0x17d656||0xc8;return function(_0x1b6dd2){if(_0x1b6dd2){return _0x286197[_0xf5f2('0x1d')](_0x17d656)[_0xf5f2('0x1e')](_0x1b6dd2);}};}function respondWithFilteredResult(_0xdb61b3,_0x395a5a){return function(_0x11f702){if(_0x11f702){var _0x228ace=_0x11f702[_0xf5f2('0x1f')],_0x20fccd=_0x395a5a[_0xf5f2('0x20')],_0x28e097=_0x395a5a[_0xf5f2('0x20')]+_0x395a5a[_0xf5f2('0x21')],_0x4ff59b;if(_0x28e097>=_0x228ace){_0x28e097=_0x228ace;_0x4ff59b=0xc8;}else{_0x4ff59b=0xce;}_0xdb61b3['status'](_0x4ff59b);return _0xdb61b3[_0xf5f2('0x22')](_0xf5f2('0x23'),_0x20fccd+'-'+_0x28e097+'/'+_0x228ace)['json'](_0x11f702);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x24')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x25')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x26')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x27')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1d')](0xcc)[_0xf5f2('0x1c')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x1b')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x28')]);if(_0x294414[_0xf5f2('0x29')]){delete _0x294414[_0xf5f2('0x29')];}_0x13a3be[_0xf5f2('0x1d')](_0x281ec8)[_0xf5f2('0x2a')](_0x294414);};}exports[_0xf5f2('0x2b')]=function(_0x5b6672,_0x53cb96){var _0x22c826={'raw':![],'where':{'id':_0x5b6672[_0xf5f2('0x2c')]['id']}},_0x14c829={};_0x14c829['model']=_['keys'](db[_0xf5f2('0x2d')][_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x5b6672[_0xf5f2('0x2f')]);_0x14c829['filters']=_['intersection'](_0x14c829[_0xf5f2('0x31')],_0x14c829['query']);_0x22c826[_0xf5f2('0x32')]=_['intersection'](_0x14c829[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x5b6672[_0xf5f2('0x2f')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829['model'];if(_0x5b6672[_0xf5f2('0x2f')][_0xf5f2('0x35')]){_0x22c826[_0xf5f2('0x36')]=[{'all':!![]}];}_0x22c826=_[_0xf5f2('0x37')]({},_0x22c826,_0x5b6672[_0xf5f2('0x38')]);return db[_0xf5f2('0x2d')][_0xf5f2('0x39')](_0x22c826)['then'](handleEntityNotFound(_0x53cb96,null))[_0xf5f2('0x27')](respondWithResult(_0x53cb96,null))[_0xf5f2('0x3a')](handleError(_0x53cb96,null));};exports['destroy']=function(_0x3fc168,_0x4b8c42){return db[_0xf5f2('0x2d')][_0xf5f2('0x39')]({'where':{'id':_0x3fc168[_0xf5f2('0x2c')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x4b8c42,null))['then'](removeEntity(_0x4b8c42,null))['catch'](handleError(_0x4b8c42,null));};function widgetAttributes(_0x41088b){try{switch(_0x41088b[_0xf5f2('0x3b')]){case _0xf5f2('0x3c'):return[{'name':'attrUrl','value':_0x41088b[_0xf5f2('0x3d')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b['attrs'][0x0][_0xf5f2('0x3f')]:undefined)||_0xf5f2('0x40')}];case'custom':return[{'name':_0xf5f2('0x41'),'value':_0x41088b[_0xf5f2('0x41')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b['attrs'][0x0]['value']:undefined)||''}];case _0xf5f2('0x42'):return[{'name':_0xf5f2('0x43'),'value':_0x41088b[_0xf5f2('0x43')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0][_0xf5f2('0x3f')]:undefined)||'HH:mm:ss'},{'name':_0xf5f2('0x44'),'value':_0x41088b[_0xf5f2('0x44')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b[_0xf5f2('0x3e')][0x1][_0xf5f2('0x3f')]:undefined)||_0xf5f2('0x45')},{'name':_0xf5f2('0x46'),'value':_0x41088b[_0xf5f2('0x46')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x2]?_0x41088b['attrs'][0x2][_0xf5f2('0x3f')]:undefined)||0xc}];case _0xf5f2('0x47'):return[{'name':_0xf5f2('0x48'),'value':_0x41088b['attrMetric']||(_0x41088b['attrs']&&_0x41088b['attrs'][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0][_0xf5f2('0x3f')]:undefined)||'total'},{'name':_0xf5f2('0x49'),'value':_0x41088b[_0xf5f2('0x49')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b[_0xf5f2('0x3e')][0x1][_0xf5f2('0x3f')]:undefined)||[]},{'name':_0xf5f2('0x46'),'value':_0x41088b[_0xf5f2('0x46')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x2]?_0x41088b[_0xf5f2('0x3e')][0x2][_0xf5f2('0x3f')]:undefined)||0x14}];case _0xf5f2('0x4a'):case _0xf5f2('0x4b'):return[{'name':'attrSerie1','value':_0x41088b[_0xf5f2('0x4c')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0][_0xf5f2('0x3f')]:undefined)||_0xf5f2('0x4d')},{'name':_0xf5f2('0x4e'),'value':_0x41088b[_0xf5f2('0x4e')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b[_0xf5f2('0x3e')][0x1][_0xf5f2('0x3f')]:undefined)||null},{'name':_0xf5f2('0x4f'),'value':_0x41088b[_0xf5f2('0x4f')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x2]?_0x41088b[_0xf5f2('0x3e')][0x2]['value']:undefined)||null},{'name':_0xf5f2('0x49'),'value':_0x41088b[_0xf5f2('0x49')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b['attrs'][0x3]?_0x41088b[_0xf5f2('0x3e')][0x3][_0xf5f2('0x3f')]:undefined)||[]}];case _0xf5f2('0x50'):return[{'name':'attrReport','type':_0x41088b['reportType']||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b['attrs'][0x0][_0xf5f2('0x3b')]:undefined)||null,'value':_0x41088b['attrReport']||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b['attrs'][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0]['value']:undefined)||null},{'name':_0xf5f2('0x51'),'value':_0x41088b[_0xf5f2('0x51')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b['attrs'][0x1][_0xf5f2('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x2b782f){logger['error']('widgetAttributes:\x20%s',JSON[_0xf5f2('0x52')](_0x2b782f));return[];}}exports[_0xf5f2('0x53')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x54')]){_0x57782c[_0xf5f2('0x54')][_0xf5f2('0x3e')]=widgetAttributes(_0x57782c['body']);}return db['DashboardItem'][_0xf5f2('0x53')](_0x57782c[_0xf5f2('0x54')],{})['then'](respondWithResult(_0x22b645,0xc9))[_0xf5f2('0x3a')](handleError(_0x22b645,null));};exports[_0xf5f2('0x55')]=function(_0x255125,_0x14029e){if(_0x255125[_0xf5f2('0x54')]['id']){delete _0x255125[_0xf5f2('0x54')]['id'];}_0x255125[_0xf5f2('0x54')]['attrs']=widgetAttributes(_0x255125['body']);return db[_0xf5f2('0x2d')][_0xf5f2('0x39')]({'where':{'id':_0x255125[_0xf5f2('0x2c')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x14029e,null))[_0xf5f2('0x27')](saveUpdates(_0x255125['body'],null))[_0xf5f2('0x27')](respondWithResult(_0x14029e,null))[_0xf5f2('0x3a')](handleError(_0x14029e,null));};
\ No newline at end of file
+var _0x7a54=['web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','DashboardItem','query','keys','intersection','attributes','fields','length','includeAll','include','catch','find','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues'];(function(_0x4c9f42,_0x3a89ee){var _0xfb0823=function(_0x53acde){while(--_0x53acde){_0x4c9f42['push'](_0x4c9f42['shift']());}};_0xfb0823(++_0x3a89ee);}(_0x7a54,0x106));var _0x47a5=function(_0x4b35d1,_0x4df02d){_0x4b35d1=_0x4b35d1-0x0;var _0x47add8=_0x7a54[_0x4b35d1];return _0x47add8;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);function respondWithStatusCode(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xcc;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x19')](_0x139f25);}return _0x711793[_0x47a5('0x1a')](_0x139f25)['end']();};}function respondWithResult(_0x362359,_0x11faf5){_0x11faf5=_0x11faf5||0xc8;return function(_0x3b001e){if(_0x3b001e){return _0x362359[_0x47a5('0x1a')](_0x11faf5)[_0x47a5('0x1b')](_0x3b001e);}};}function respondWithFilteredResult(_0x574af6,_0x549de3){return function(_0x138bc0){if(_0x138bc0){var _0x4b966e=_0x138bc0[_0x47a5('0x1c')],_0x5247fd=_0x549de3[_0x47a5('0x1d')],_0x423a81=_0x549de3[_0x47a5('0x1d')]+_0x549de3[_0x47a5('0x1e')],_0xaf70a6;if(_0x423a81>=_0x4b966e){_0x423a81=_0x4b966e;_0xaf70a6=0xc8;}else{_0xaf70a6=0xce;}_0x574af6[_0x47a5('0x1a')](_0xaf70a6);return _0x574af6[_0x47a5('0x1f')](_0x47a5('0x20'),_0x5247fd+'-'+_0x423a81+'/'+_0x4b966e)['json'](_0x138bc0);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x21')](_0x2b0360);}return _0xf160ba[_0x47a5('0x22')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x23')](_0x4c5910)[_0x47a5('0x24')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x25')]()[_0x47a5('0x24')](function(){_0xe2dea9[_0x47a5('0x1a')](0xcc)[_0x47a5('0x26')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x19')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x27')](_0x5b6c4e[_0x47a5('0x28')]);if(_0x5b6c4e[_0x47a5('0x29')]){delete _0x5b6c4e[_0x47a5('0x29')];}_0x5686db[_0x47a5('0x1a')](_0x1ea9c8)[_0x47a5('0x2a')](_0x5b6c4e);};}exports[_0x47a5('0x2b')]=function(_0x136b14,_0x16631f){var _0x361bfa={'raw':![],'where':{'id':_0x136b14[_0x47a5('0x2c')]['id']}},_0x1127f8={};_0x1127f8[_0x47a5('0x2d')]=_['keys'](db[_0x47a5('0x2e')]['rawAttributes']);_0x1127f8[_0x47a5('0x2f')]=_[_0x47a5('0x30')](_0x136b14[_0x47a5('0x2f')]);_0x1127f8['filters']=_[_0x47a5('0x31')](_0x1127f8[_0x47a5('0x2d')],_0x1127f8[_0x47a5('0x2f')]);_0x361bfa[_0x47a5('0x32')]=_['intersection'](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14[_0x47a5('0x2f')]['fields']));_0x361bfa['attributes']=_0x361bfa[_0x47a5('0x32')][_0x47a5('0x34')]?_0x361bfa['attributes']:_0x1127f8[_0x47a5('0x2d')];if(_0x136b14['query'][_0x47a5('0x35')]){_0x361bfa[_0x47a5('0x36')]=[{'all':!![]}];}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);return db[_0x47a5('0x2e')]['find'](_0x361bfa)[_0x47a5('0x24')](handleEntityNotFound(_0x16631f,null))[_0x47a5('0x24')](respondWithResult(_0x16631f,null))[_0x47a5('0x37')](handleError(_0x16631f,null));};exports['destroy']=function(_0x18f7e9,_0x50c086){return db['DashboardItem'][_0x47a5('0x38')]({'where':{'id':_0x18f7e9['params']['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x50c086,null))['then'](removeEntity(_0x50c086,null))[_0x47a5('0x37')](handleError(_0x50c086,null));};function widgetAttributes(_0x3534cb){try{switch(_0x3534cb[_0x47a5('0x39')]){case _0x47a5('0x3a'):return[{'name':_0x47a5('0x3b'),'value':_0x3534cb[_0x47a5('0x3b')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0]['value']:undefined)||_0x47a5('0x3d')}];case _0x47a5('0x3e'):return[{'name':'attrPath','value':_0x3534cb[_0x47a5('0x3f')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb['attrs'][0x0][_0x47a5('0x40')]:undefined)||''}];case _0x47a5('0x41'):return[{'name':'attrHourFormat','value':_0x3534cb[_0x47a5('0x42')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb['attrs'][0x0]?_0x3534cb['attrs'][0x0]['value']:undefined)||_0x47a5('0x43')},{'name':'attrTimezone','value':_0x3534cb[_0x47a5('0x44')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||_0x47a5('0x45')},{'name':_0x47a5('0x46'),'value':_0x3534cb[_0x47a5('0x46')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2][_0x47a5('0x40')]:undefined)||0xc}];case _0x47a5('0x47'):return[{'name':'attrMetric','value':_0x3534cb[_0x47a5('0x48')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0]['value']:undefined)||_0x47a5('0x49')},{'name':'attrVoiceQueues','value':_0x3534cb['attrVoiceQueues']||(_0x3534cb['attrs']&&_0x3534cb['attrs'][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1]['value']:undefined)||[]},{'name':_0x47a5('0x46'),'value':_0x3534cb[_0x47a5('0x46')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb['attrs'][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2][_0x47a5('0x40')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0x47a5('0x4a'),'value':_0x3534cb['attrSerie1']||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0][_0x47a5('0x40')]:undefined)||_0x47a5('0x49')},{'name':_0x47a5('0x4b'),'value':_0x3534cb[_0x47a5('0x4b')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||null},{'name':_0x47a5('0x4c'),'value':_0x3534cb[_0x47a5('0x4c')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2]['value']:undefined)||null},{'name':_0x47a5('0x4d'),'value':_0x3534cb[_0x47a5('0x4d')]||(_0x3534cb['attrs']&&_0x3534cb['attrs'][0x3]?_0x3534cb[_0x47a5('0x3c')][0x3]['value']:undefined)||[]}];case _0x47a5('0x4e'):return[{'name':_0x47a5('0x4f'),'type':_0x3534cb['reportType']||(_0x3534cb['attrs']&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb['attrs'][0x0][_0x47a5('0x39')]:undefined)||null,'value':_0x3534cb[_0x47a5('0x4f')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0][_0x47a5('0x40')]:undefined)||null},{'name':_0x47a5('0x50'),'value':_0x3534cb['attrRefresh']||(_0x3534cb['attrs']&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x9ea93e){logger[_0x47a5('0x27')](_0x47a5('0x51'),JSON[_0x47a5('0x52')](_0x9ea93e));return[];}}exports['create']=function(_0x45cca5,_0x1c9a62){if(_0x45cca5[_0x47a5('0x53')]){_0x45cca5['body'][_0x47a5('0x3c')]=widgetAttributes(_0x45cca5['body']);}return db[_0x47a5('0x2e')][_0x47a5('0x54')](_0x45cca5[_0x47a5('0x53')],{})[_0x47a5('0x24')](respondWithResult(_0x1c9a62,0xc9))['catch'](handleError(_0x1c9a62,null));};exports[_0x47a5('0x23')]=function(_0x1e6de3,_0x2f66e9){if(_0x1e6de3[_0x47a5('0x53')]['id']){delete _0x1e6de3[_0x47a5('0x53')]['id'];}_0x1e6de3[_0x47a5('0x53')][_0x47a5('0x3c')]=widgetAttributes(_0x1e6de3['body']);return db[_0x47a5('0x2e')][_0x47a5('0x38')]({'where':{'id':_0x1e6de3[_0x47a5('0x2c')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x2f66e9,null))[_0x47a5('0x24')](saveUpdates(_0x1e6de3[_0x47a5('0x53')],null))['then'](respondWithResult(_0x2f66e9,null))[_0x47a5('0x37')](handleError(_0x2f66e9,null));};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js
index cf5e569..545274f 100644
--- a/server/api/dashboardItem/dashboardItem.events.js
+++ b/server/api/dashboardItem/dashboardItem.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5047=['exports','events','../../mysqldb','save','remove','hook'];(function(_0x3287f4,_0x131a75){var _0x4f6d7e=function(_0x431e12){while(--_0x431e12){_0x3287f4['push'](_0x3287f4['shift']());}};_0x4f6d7e(++_0x131a75);}(_0x5047,0x1c3));var _0x7504=function(_0x11ba46,_0x1d6752){_0x11ba46=_0x11ba46-0x0;var _0x1c8c6f=_0x5047[_0x11ba46];return _0x1c8c6f;};'use strict';var EventEmitter=require(_0x7504('0x0'));var DashboardItem=require(_0x7504('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7504('0x2'),'afterUpdate':'update','afterDestroy':_0x7504('0x3')};function emitEvent(_0x59b5f9){return function(_0x2e4b11,_0x83425a,_0x4f8ec2){DashboardItemEvents['emit'](_0x59b5f9+':'+_0x2e4b11['id'],_0x2e4b11);DashboardItemEvents['emit'](_0x59b5f9,_0x2e4b11);_0x4f8ec2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x7504('0x4')](e,emitEvent(event));}}module[_0x7504('0x5')]=DashboardItemEvents;
\ No newline at end of file
+var _0x2af5=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x2af5,0x191));var _0x52af=function(_0x1cd4ff,_0x1ab3f8){_0x1cd4ff=_0x1cd4ff-0x0;var _0x1ef3f7=_0x2af5[_0x1cd4ff];return _0x1ef3f7;};'use strict';var EventEmitter=require(_0x52af('0x0'));var DashboardItem=require(_0x52af('0x1'))['db'][_0x52af('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x52af('0x3')](0x0);var events={'afterCreate':_0x52af('0x4'),'afterUpdate':_0x52af('0x5'),'afterDestroy':_0x52af('0x6')};function emitEvent(_0x4f63c7){return function(_0x271d7b,_0x4bc859,_0x274352){DashboardItemEvents[_0x52af('0x7')](_0x4f63c7+':'+_0x271d7b['id'],_0x271d7b);DashboardItemEvents[_0x52af('0x7')](_0x4f63c7,_0x271d7b);_0x274352(null);};}for(var e in events){if(events[_0x52af('0x8')](e)){var event=events[e];DashboardItem[_0x52af('0x9')](e,emitEvent(event));}}module[_0x52af('0xa')]=DashboardItemEvents;
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js
index 9a8c83f..27e3186 100644
--- a/server/api/dashboardItem/dashboardItem.model.js
+++ b/server/api/dashboardItem/dashboardItem.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2086=['moment','request-promise','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api'];(function(_0x3a6922,_0xc728be){var _0x9c1b44=function(_0x4ffb5e){while(--_0x4ffb5e){_0x3a6922['push'](_0x3a6922['shift']());}};_0x9c1b44(++_0xc728be);}(_0x2086,0x1c4));var _0x6208=function(_0x112a34,_0x5cf88f){_0x112a34=_0x112a34-0x0;var _0x1e64ba=_0x2086[_0x112a34];return _0x1e64ba;};'use strict';var _=require(_0x6208('0x0'));var util=require(_0x6208('0x1'));var logger=require(_0x6208('0x2'))(_0x6208('0x3'));var moment=require(_0x6208('0x4'));var BPromise=require('bluebird');var rp=require(_0x6208('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6208('0x6'));var config=require(_0x6208('0x7'));var attributes=require('./dashboardItem.attributes');module[_0x6208('0x8')]=function(_0x5ad8ae,_0x4165b8){return _0x5ad8ae[_0x6208('0x9')](_0x6208('0xa'),attributes,{'tableName':_0x6208('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf41d=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','dashboard_items'];(function(_0x61bb6b,_0x1b1a13){var _0x303936=function(_0x4459ae){while(--_0x4459ae){_0x61bb6b['push'](_0x61bb6b['shift']());}};_0x303936(++_0x1b1a13);}(_0xf41d,0x78));var _0xdf41=function(_0x40e60f,_0x5365e1){_0x40e60f=_0x40e60f-0x0;var _0x35511f=_0xf41d[_0x40e60f];return _0x35511f;};'use strict';var _=require(_0xdf41('0x0'));var util=require(_0xdf41('0x1'));var logger=require(_0xdf41('0x2'))('api');var moment=require(_0xdf41('0x3'));var BPromise=require(_0xdf41('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf41('0x5'));var rimraf=require(_0xdf41('0x6'));var config=require(_0xdf41('0x7'));var attributes=require(_0xdf41('0x8'));module[_0xdf41('0x9')]=function(_0x2c9807,_0x1fe9b6){return _0x2c9807[_0xdf41('0xa')]('DashboardItem',attributes,{'tableName':_0xdf41('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js
index 414f40c..33524f3 100644
--- a/server/api/dashboardItem/dashboardItem.rpc.js
+++ b/server/api/dashboardItem/dashboardItem.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x057c=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x057c,0x1ac));var _0xc057=function(_0x51f854,_0x5208a3){_0x51f854=_0x51f854-0x0;var _0x2611f2=_0x057c[_0x51f854];return _0x2611f2;};'use strict';var _=require(_0xc057('0x0'));var util=require(_0xc057('0x1'));var moment=require(_0xc057('0x2'));var BPromise=require(_0xc057('0x3'));var rs=require(_0xc057('0x4'));var fs=require('fs');var Redis=require(_0xc057('0x5'));var db=require(_0xc057('0x6'))['db'];var utils=require(_0xc057('0x7'));var logger=require('../../config/logger')(_0xc057('0x8'));var config=require('../../config/environment');var jayson=require(_0xc057('0x9'));var client=jayson[_0xc057('0xa')][_0xc057('0xb')]({'port':0x232a});config[_0xc057('0xc')]=_[_0xc057('0xd')](config[_0xc057('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc057('0xe'))(new Redis(config[_0xc057('0xc')]));require(_0xc057('0xf'))['register'](socket);function respondWithRpcPromise(_0x324c36,_0x4b27a0,_0x43959f){return new BPromise(function(_0x49304d,_0x3d2ac3){return client[_0xc057('0x10')](_0x324c36,_0x43959f)[_0xc057('0x11')](function(_0xd40a7c){logger[_0xc057('0x12')](_0xc057('0x13'),_0x4b27a0,_0xc057('0x14'));logger[_0xc057('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x4b27a0,'request\x20sent',JSON[_0xc057('0x16')](_0xd40a7c));if(_0xd40a7c[_0xc057('0x17')]){if(_0xd40a7c[_0xc057('0x17')][_0xc057('0x18')]===0x1f4){logger[_0xc057('0x17')](_0xc057('0x13'),_0x4b27a0,_0xd40a7c[_0xc057('0x17')][_0xc057('0x19')]);return _0x3d2ac3(_0xd40a7c[_0xc057('0x17')][_0xc057('0x19')]);}logger[_0xc057('0x17')]('DashboardItem,\x20%s,\x20%s',_0x4b27a0,_0xd40a7c[_0xc057('0x17')][_0xc057('0x19')]);return _0x49304d(_0xd40a7c[_0xc057('0x17')]['message']);}else{logger[_0xc057('0x12')](_0xc057('0x13'),_0x4b27a0,'request\x20sent');_0x49304d(_0xd40a7c[_0xc057('0x1a')]['message']);}})[_0xc057('0x1b')](function(_0x1b3f71){logger[_0xc057('0x17')](_0xc057('0x13'),_0x4b27a0,_0x1b3f71);_0x3d2ac3(_0x1b3f71);});});}
\ No newline at end of file
+var _0x12fc=['info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./dashboardItem.socket','register','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5cc3d4,_0xbcbf9b){var _0x17ca31=function(_0x5dbd6d){while(--_0x5dbd6d){_0x5cc3d4['push'](_0x5cc3d4['shift']());}};_0x17ca31(++_0xbcbf9b);}(_0x12fc,0x155));var _0xc12f=function(_0x2f4928,_0x5b0c59){_0x2f4928=_0x2f4928-0x0;var _0x35c622=_0x12fc[_0x2f4928];return _0x35c622;};'use strict';var _=require(_0xc12f('0x0'));var util=require('util');var moment=require(_0xc12f('0x1'));var BPromise=require(_0xc12f('0x2'));var rs=require(_0xc12f('0x3'));var fs=require('fs');var Redis=require(_0xc12f('0x4'));var db=require(_0xc12f('0x5'))['db'];var utils=require(_0xc12f('0x6'));var logger=require('../../config/logger')(_0xc12f('0x7'));var config=require(_0xc12f('0x8'));var jayson=require(_0xc12f('0x9'));var client=jayson[_0xc12f('0xa')][_0xc12f('0xb')]({'port':0x232a});config[_0xc12f('0xc')]=_[_0xc12f('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc12f('0xc')]));require(_0xc12f('0xe'))[_0xc12f('0xf')](socket);function respondWithRpcPromise(_0x50066a,_0x9448ff,_0x50db45){return new BPromise(function(_0x1402ef,_0x1f96a2){return client['request'](_0x50066a,_0x50db45)['then'](function(_0x2c962c){logger['info'](_0xc12f('0x10'),_0x9448ff,_0xc12f('0x11'));logger[_0xc12f('0x12')](_0xc12f('0x13'),_0x9448ff,'request\x20sent',JSON[_0xc12f('0x14')](_0x2c962c));if(_0x2c962c['error']){if(_0x2c962c[_0xc12f('0x15')]['code']===0x1f4){logger[_0xc12f('0x15')](_0xc12f('0x10'),_0x9448ff,_0x2c962c[_0xc12f('0x15')]['message']);return _0x1f96a2(_0x2c962c[_0xc12f('0x15')][_0xc12f('0x16')]);}logger['error'](_0xc12f('0x10'),_0x9448ff,_0x2c962c[_0xc12f('0x15')][_0xc12f('0x16')]);return _0x1402ef(_0x2c962c[_0xc12f('0x15')][_0xc12f('0x16')]);}else{logger[_0xc12f('0x17')](_0xc12f('0x10'),_0x9448ff,'request\x20sent');_0x1402ef(_0x2c962c[_0xc12f('0x18')][_0xc12f('0x16')]);}})[_0xc12f('0x19')](function(_0x1534e6){logger[_0xc12f('0x15')](_0xc12f('0x10'),_0x9448ff,_0x1534e6);_0x1f96a2(_0x1534e6);});});}
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js
index a247c07..dca005b 100644
--- a/server/api/dashboardItem/dashboardItem.socket.js
+++ b/server/api/dashboardItem/dashboardItem.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedd9=['removeListener','register','length','dashboardItem:','save','remove','update','emit'];(function(_0x26bede,_0x52421f){var _0x42a1b6=function(_0x482003){while(--_0x482003){_0x26bede['push'](_0x26bede['shift']());}};_0x42a1b6(++_0x52421f);}(_0xedd9,0xfc));var _0x9edd=function(_0x18d945,_0x11e617){_0x18d945=_0x18d945-0x0;var _0x44328b=_0xedd9[_0x18d945];return _0x44328b;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){DashboardItemEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);DashboardItemEvents['on'](_0x571af9,_0x172522);}};
\ No newline at end of file
+var _0x9c44=['emit','removeListener','length','dashboardItem:','remove','update'];(function(_0x10114d,_0x389bad){var _0x2ada5b=function(_0x59fd84){while(--_0x59fd84){_0x10114d['push'](_0x10114d['shift']());}};_0x2ada5b(++_0x389bad);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){DashboardItemEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);DashboardItemEvents['on'](_0x436234,_0x511d53);}};
\ No newline at end of file
diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js
index b8eba71..74c4bd1 100644
--- a/server/api/dashboardItem/index.js
+++ b/server/api/dashboardItem/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1956=['post','create','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1956,0x194));var _0x6195=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x1956[_0x34843e];return _0x598f7f;};'use strict';var multer=require(_0x6195('0x0'));var util=require(_0x6195('0x1'));var path=require(_0x6195('0x2'));var timeout=require(_0x6195('0x3'));var express=require(_0x6195('0x4'));var router=express[_0x6195('0x5')]();var auth=require(_0x6195('0x6'));var interaction=require(_0x6195('0x7'));var config=require(_0x6195('0x8'));var controller=require('./dashboardItem.controller');router['get'](_0x6195('0x9'),auth[_0x6195('0xa')](),controller[_0x6195('0xb')]);router[_0x6195('0xc')]('/',auth[_0x6195('0xa')](),controller[_0x6195('0xd')]);router[_0x6195('0xe')](_0x6195('0x9'),auth['isAuthenticated'](),controller[_0x6195('0xf')]);router['delete'](_0x6195('0x9'),auth[_0x6195('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x638f=['put','update','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x522294,_0x3df1a3){var _0x49ada5=function(_0x1633e6){while(--_0x1633e6){_0x522294['push'](_0x522294['shift']());}};_0x49ada5(++_0x3df1a3);}(_0x638f,0xee));var _0xf638=function(_0x13f4b4,_0x32ab4d){_0x13f4b4=_0x13f4b4-0x0;var _0x56b42c=_0x638f[_0x13f4b4];return _0x56b42c;};'use strict';var multer=require(_0xf638('0x0'));var util=require(_0xf638('0x1'));var path=require(_0xf638('0x2'));var timeout=require('connect-timeout');var express=require(_0xf638('0x3'));var router=express[_0xf638('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf638('0x5'));var config=require(_0xf638('0x6'));var controller=require(_0xf638('0x7'));router[_0xf638('0x8')](_0xf638('0x9'),auth[_0xf638('0xa')](),controller[_0xf638('0xb')]);router[_0xf638('0xc')]('/',auth[_0xf638('0xa')](),controller[_0xf638('0xd')]);router[_0xf638('0xe')](_0xf638('0x9'),auth['isAuthenticated'](),controller[_0xf638('0xf')]);router['delete'](_0xf638('0x9'),auth[_0xf638('0xa')](),controller[_0xf638('0x10')]);module[_0xf638('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js
index 294e336..40f68bc 100644
--- a/server/api/disposition/disposition.attributes.js
+++ b/server/api/disposition/disposition.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d9f=['sequelize','exports'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x3d9f,0x152));var _0xf3d9=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x3d9f[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xf3d9('0x0'));module[_0xf3d9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xc485=['exports','STRING'];(function(_0x49645a,_0x4ce084){var _0x38087f=function(_0x28ce81){while(--_0x28ce81){_0x49645a['push'](_0x49645a['shift']());}};_0x38087f(++_0x4ce084);}(_0xc485,0xa8));var _0x5c48=function(_0x59a1a0,_0x45d4a8){_0x59a1a0=_0x59a1a0-0x0;var _0x442238=_0xc485[_0x59a1a0];return _0x442238;};'use strict';var Sequelize=require('sequelize');module[_0x5c48('0x0')]={'name':{'type':Sequelize[_0x5c48('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js
index 6b56145..9e4b942 100644
--- a/server/api/disposition/disposition.controller.js
+++ b/server/api/disposition/disposition.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d67=['options','rows','show','params','includeAll','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','sendStatus','error','name','send','index','Disposition','rawAttributes','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field'];(function(_0x25948f,_0x4ac7e4){var _0x2b1976=function(_0x1ee63a){while(--_0x1ee63a){_0x25948f['push'](_0x25948f['shift']());}};_0x2b1976(++_0x4ac7e4);}(_0x6d67,0xb5));var _0x76d6=function(_0x5b7468,_0x2f21c7){_0x5b7468=_0x5b7468-0x0;var _0x466de5=_0x6d67[_0x5b7468];return _0x466de5;};'use strict';var pdf=require(_0x76d6('0x0'));var emlformat=require(_0x76d6('0x1'));var rimraf=require(_0x76d6('0x2'));var zipdir=require(_0x76d6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76d6('0x4'));var moment=require(_0x76d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x76d6('0x6'));var util=require('util');var path=require(_0x76d6('0x7'));var sox=require(_0x76d6('0x8'));var csv=require(_0x76d6('0x9'));var ejs=require(_0x76d6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x76d6('0xb'));var crypto=require(_0x76d6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x76d6('0xd'));var toCsv=require(_0x76d6('0x9'));var querystring=require(_0x76d6('0xe'));var Papa=require('papaparse');var Redis=require(_0x76d6('0xf'));var authService=require(_0x76d6('0x10'));var qs=require(_0x76d6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x76d6('0x12'))(_0x76d6('0x13'));var utils=require('../../config/utils');var config=require(_0x76d6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26addd,_0x283a1b){_0x283a1b=_0x283a1b||0xcc;return function(_0x1efab5){if(_0x1efab5){return _0x26addd['sendStatus'](_0x283a1b);}return _0x26addd[_0x76d6('0x15')](_0x283a1b)[_0x76d6('0x16')]();};}function respondWithResult(_0x40ea91,_0x556472){_0x556472=_0x556472||0xc8;return function(_0x4ae7ff){if(_0x4ae7ff){return _0x40ea91[_0x76d6('0x15')](_0x556472)['json'](_0x4ae7ff);}};}function respondWithFilteredResult(_0x78b44b,_0x17ba38){return function(_0x19614f){if(_0x19614f){var _0x3fb191=_0x19614f[_0x76d6('0x17')],_0x31fab4=_0x17ba38[_0x76d6('0x18')],_0x1d07b0=_0x17ba38[_0x76d6('0x18')]+_0x17ba38[_0x76d6('0x19')],_0x565e3d;if(_0x1d07b0>=_0x3fb191){_0x1d07b0=_0x3fb191;_0x565e3d=0xc8;}else{_0x565e3d=0xce;}_0x78b44b[_0x76d6('0x15')](_0x565e3d);return _0x78b44b['set'](_0x76d6('0x1a'),_0x31fab4+'-'+_0x1d07b0+'/'+_0x3fb191)[_0x76d6('0x1b')](_0x19614f);}return null;};}function patchUpdates(_0x571216){return function(_0x39c385){try{jsonpatch[_0x76d6('0x1c')](_0x39c385,_0x571216,!![]);}catch(_0x5bc83a){return BPromise[_0x76d6('0x1d')](_0x5bc83a);}return _0x39c385[_0x76d6('0x1e')]();};}function saveUpdates(_0x188bc3,_0x4c6e40){return function(_0x357687){if(_0x357687){return _0x357687[_0x76d6('0x1f')](_0x188bc3)[_0x76d6('0x20')](function(_0x280f8e){return _0x280f8e;});}return null;};}function removeEntity(_0x5192cf,_0x5b193f){return function(_0x5ae029){if(_0x5ae029){return _0x5ae029[_0x76d6('0x21')]()[_0x76d6('0x20')](function(){var _0x4505dc=_0x5ae029[_0x76d6('0x22')]({'plain':!![]});var _0x4c66bf=_0x76d6('0x23');return db[_0x76d6('0x24')][_0x76d6('0x21')]({'where':{'type':_0x4c66bf,'resourceId':_0x4505dc['id']}})['then'](function(){return _0x5ae029;});})[_0x76d6('0x20')](function(){_0x5192cf[_0x76d6('0x15')](0xcc)[_0x76d6('0x16')]();});}};}function handleEntityNotFound(_0x3c4f4a,_0x122a4f){return function(_0x928f4){if(!_0x928f4){_0x3c4f4a[_0x76d6('0x25')](0x194);}return _0x928f4;};}function handleError(_0x6423e7,_0x1b5045){_0x1b5045=_0x1b5045||0x1f4;return function(_0x472ebd){logger[_0x76d6('0x26')](_0x472ebd['stack']);if(_0x472ebd[_0x76d6('0x27')]){delete _0x472ebd[_0x76d6('0x27')];}_0x6423e7['status'](_0x1b5045)[_0x76d6('0x28')](_0x472ebd);};}exports[_0x76d6('0x29')]=function(_0x399500,_0x9592ba){var _0x4eeaa7={},_0x42a6a8={},_0x519724={'count':0x0,'rows':[]};var _0x4313f9=db[_0x76d6('0x2a')][_0x76d6('0x2b')];_0x42a6a8['model']=_[_0x76d6('0x2c')](_0x4313f9);_0x42a6a8[_0x76d6('0x2d')]=_[_0x76d6('0x2c')](_0x399500['query']);_0x42a6a8['filters']=_[_0x76d6('0x2e')](_0x42a6a8['model'],_0x42a6a8[_0x76d6('0x2d')]);_0x4eeaa7[_0x76d6('0x2f')]=_['intersection'](_0x42a6a8[_0x76d6('0x30')],qs[_0x76d6('0x31')](_0x399500['query']['fields']));_0x4eeaa7[_0x76d6('0x2f')]=_0x4eeaa7[_0x76d6('0x2f')][_0x76d6('0x32')]?_0x4eeaa7[_0x76d6('0x2f')]:_0x42a6a8[_0x76d6('0x30')];if(!_0x399500[_0x76d6('0x2d')][_0x76d6('0x33')](_0x76d6('0x34'))){_0x4eeaa7[_0x76d6('0x19')]=qs[_0x76d6('0x19')](_0x399500[_0x76d6('0x2d')][_0x76d6('0x19')]);_0x4eeaa7['offset']=qs[_0x76d6('0x18')](_0x399500[_0x76d6('0x2d')]['offset']);}_0x4eeaa7[_0x76d6('0x35')]=qs['sort'](_0x399500['query'][_0x76d6('0x36')]);_0x4eeaa7[_0x76d6('0x37')]=qs[_0x76d6('0x38')](_[_0x76d6('0x39')](_0x399500['query'],_0x42a6a8[_0x76d6('0x38')]));if(_0x399500['query'][_0x76d6('0x3a')]){_0x4eeaa7[_0x76d6('0x37')]=_[_0x76d6('0x3b')](_0x4eeaa7[_0x76d6('0x37')],{'$or':_[_0x76d6('0x3c')](_0x4313f9,function(_0x389235){if(_0x389235[_0x76d6('0x3d')][_0x76d6('0x3e')]!==_0x76d6('0x3f')){var _0x5cafbd={};_0x5cafbd[_0x389235[_0x76d6('0x40')]]={'$like':'%'+_0x399500['query'][_0x76d6('0x3a')]+'%'};return _0x5cafbd;}})});}_0x4eeaa7=_['merge']({},_0x4eeaa7,_0x399500[_0x76d6('0x41')]);var _0x3ecba6={'where':_0x4eeaa7[_0x76d6('0x37')]};return db['Disposition'][_0x76d6('0x17')](_0x3ecba6)['then'](function(_0x4cde9e){_0x519724[_0x76d6('0x17')]=_0x4cde9e;if(_0x399500[_0x76d6('0x2d')]['includeAll']){_0x4eeaa7['include']=[{'all':!![]}];}return db[_0x76d6('0x2a')]['findAll'](_0x4eeaa7);})['then'](function(_0x5e70d7){_0x519724[_0x76d6('0x42')]=_0x5e70d7;return _0x519724;})['then'](respondWithFilteredResult(_0x9592ba,_0x4eeaa7))['catch'](handleError(_0x9592ba,null));};exports[_0x76d6('0x43')]=function(_0x45c7df,_0x492829){var _0x94f953={'raw':!![],'where':{'id':_0x45c7df[_0x76d6('0x44')]['id']}},_0x5878ea={};_0x5878ea[_0x76d6('0x30')]=_[_0x76d6('0x2c')](db[_0x76d6('0x2a')][_0x76d6('0x2b')]);_0x5878ea[_0x76d6('0x2d')]=_[_0x76d6('0x2c')](_0x45c7df['query']);_0x5878ea[_0x76d6('0x38')]=_['intersection'](_0x5878ea['model'],_0x5878ea[_0x76d6('0x2d')]);_0x94f953[_0x76d6('0x2f')]=_[_0x76d6('0x2e')](_0x5878ea['model'],qs['fields'](_0x45c7df[_0x76d6('0x2d')][_0x76d6('0x31')]));_0x94f953[_0x76d6('0x2f')]=_0x94f953['attributes']['length']?_0x94f953['attributes']:_0x5878ea[_0x76d6('0x30')];if(_0x45c7df[_0x76d6('0x2d')][_0x76d6('0x45')]){_0x94f953[_0x76d6('0x46')]=[{'all':!![]}];}_0x94f953=_[_0x76d6('0x3b')]({},_0x94f953,_0x45c7df[_0x76d6('0x41')]);return db[_0x76d6('0x2a')][_0x76d6('0x47')](_0x94f953)[_0x76d6('0x20')](handleEntityNotFound(_0x492829,null))['then'](respondWithResult(_0x492829,null))[_0x76d6('0x48')](handleError(_0x492829,null));};exports['create']=function(_0x29a0da,_0x571005){return db[_0x76d6('0x2a')][_0x76d6('0x49')](_0x29a0da['body'],{})[_0x76d6('0x20')](function(_0x810099){var _0xa55b64=_0x29a0da[_0x76d6('0x4a')][_0x76d6('0x22')]({'plain':!![]});if(!_0xa55b64)throw new Error(_0x76d6('0x4b'));if(_0xa55b64[_0x76d6('0x4c')]===_0x76d6('0x4a')){var _0x2e6125=_0x810099[_0x76d6('0x22')]({'plain':!![]});var _0x538868=_0x76d6('0x23');return db[_0x76d6('0x4d')][_0x76d6('0x47')]({'where':{'name':_0x538868,'userProfileId':_0xa55b64[_0x76d6('0x4e')]},'raw':!![]})[_0x76d6('0x20')](function(_0x260a26){if(_0x260a26&&_0x260a26[_0x76d6('0x4f')]===0x0){return db[_0x76d6('0x24')][_0x76d6('0x49')]({'name':_0x2e6125[_0x76d6('0x27')],'resourceId':_0x2e6125['id'],'type':_0x260a26[_0x76d6('0x27')],'sectionId':_0x260a26['id']},{})[_0x76d6('0x20')](function(){return _0x810099;});}else{return _0x810099;}})['catch'](function(_0x5273ce){logger[_0x76d6('0x26')](_0x76d6('0x50'),_0x5273ce);throw _0x5273ce;});}return _0x810099;})[_0x76d6('0x20')](respondWithResult(_0x571005,0xc9))[_0x76d6('0x48')](handleError(_0x571005,null));};exports['update']=function(_0x4c9a40,_0x5530e3){if(_0x4c9a40[_0x76d6('0x51')]['id']){delete _0x4c9a40['body']['id'];}return db['Disposition'][_0x76d6('0x47')]({'where':{'id':_0x4c9a40[_0x76d6('0x44')]['id']}})[_0x76d6('0x20')](handleEntityNotFound(_0x5530e3,null))[_0x76d6('0x20')](saveUpdates(_0x4c9a40[_0x76d6('0x51')],null))[_0x76d6('0x20')](respondWithResult(_0x5530e3,null))[_0x76d6('0x48')](handleError(_0x5530e3,null));};exports[_0x76d6('0x21')]=function(_0x131335,_0x2e4040){return db[_0x76d6('0x2a')][_0x76d6('0x47')]({'where':{'id':_0x131335[_0x76d6('0x44')]['id']}})[_0x76d6('0x20')](handleEntityNotFound(_0x2e4040,null))[_0x76d6('0x20')](removeEntity(_0x2e4040,null))['catch'](handleError(_0x2e4040,null));};
\ No newline at end of file
+var _0xcb2b=['userProfileId','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Dispositions','UserProfileResource','destroy','error','name','send','index','Disposition','rawAttributes','model','keys','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','count','findAll','rows','catch','show','fields','length','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection'];(function(_0x59c009,_0x267f6a){var _0x1543f0=function(_0x3dd107){while(--_0x3dd107){_0x59c009['push'](_0x59c009['shift']());}};_0x1543f0(++_0x267f6a);}(_0xcb2b,0x156));var _0xbcb2=function(_0x3af955,_0x21431c){_0x3af955=_0x3af955-0x0;var _0x167de5=_0xcb2b[_0x3af955];return _0x167de5;};'use strict';var pdf=require(_0xbcb2('0x0'));var emlformat=require(_0xbcb2('0x1'));var rimraf=require(_0xbcb2('0x2'));var zipdir=require(_0xbcb2('0x3'));var jsonpatch=require(_0xbcb2('0x4'));var rp=require(_0xbcb2('0x5'));var moment=require(_0xbcb2('0x6'));var BPromise=require(_0xbcb2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbcb2('0x8'));var sox=require('sox');var csv=require(_0xbcb2('0x9'));var ejs=require(_0xbcb2('0xa'));var fs=require('fs');var _=require(_0xbcb2('0xb'));var squel=require(_0xbcb2('0xc'));var crypto=require(_0xbcb2('0xd'));var jsforce=require(_0xbcb2('0xe'));var deskjs=require(_0xbcb2('0xf'));var toCsv=require(_0xbcb2('0x9'));var querystring=require(_0xbcb2('0x10'));var Papa=require(_0xbcb2('0x11'));var Redis=require('ioredis');var authService=require(_0xbcb2('0x12'));var qs=require(_0xbcb2('0x13'));var hardwareService=require(_0xbcb2('0x14'));var logger=require(_0xbcb2('0x15'))('api');var utils=require(_0xbcb2('0x16'));var config=require(_0xbcb2('0x17'));var db=require(_0xbcb2('0x18'))['db'];function respondWithStatusCode(_0x11f37e,_0x51cf93){_0x51cf93=_0x51cf93||0xcc;return function(_0x473d92){if(_0x473d92){return _0x11f37e[_0xbcb2('0x19')](_0x51cf93);}return _0x11f37e[_0xbcb2('0x1a')](_0x51cf93)[_0xbcb2('0x1b')]();};}function respondWithResult(_0x3a52f9,_0x5272f6){_0x5272f6=_0x5272f6||0xc8;return function(_0x1334bd){if(_0x1334bd){return _0x3a52f9['status'](_0x5272f6)[_0xbcb2('0x1c')](_0x1334bd);}};}function respondWithFilteredResult(_0x19a13a,_0xd3ece9){return function(_0x3f59fb){if(_0x3f59fb){var _0x386930=_0x3f59fb['count'],_0x45a13c=_0xd3ece9[_0xbcb2('0x1d')],_0x3443c7=_0xd3ece9[_0xbcb2('0x1d')]+_0xd3ece9[_0xbcb2('0x1e')],_0x1b33e1;if(_0x3443c7>=_0x386930){_0x3443c7=_0x386930;_0x1b33e1=0xc8;}else{_0x1b33e1=0xce;}_0x19a13a[_0xbcb2('0x1a')](_0x1b33e1);return _0x19a13a[_0xbcb2('0x1f')](_0xbcb2('0x20'),_0x45a13c+'-'+_0x3443c7+'/'+_0x386930)[_0xbcb2('0x1c')](_0x3f59fb);}return null;};}function patchUpdates(_0x571e04){return function(_0x5ba7b8){try{jsonpatch[_0xbcb2('0x21')](_0x5ba7b8,_0x571e04,!![]);}catch(_0x281e86){return BPromise[_0xbcb2('0x22')](_0x281e86);}return _0x5ba7b8[_0xbcb2('0x23')]();};}function saveUpdates(_0x531ea4,_0x3cf2cb){return function(_0x1f0a1c){if(_0x1f0a1c){return _0x1f0a1c[_0xbcb2('0x24')](_0x531ea4)[_0xbcb2('0x25')](function(_0x21cd99){return _0x21cd99;});}return null;};}function removeEntity(_0x121b83,_0x5a6910){return function(_0x27bb4f){if(_0x27bb4f){return _0x27bb4f['destroy']()[_0xbcb2('0x25')](function(){var _0x47d0b5=_0x27bb4f[_0xbcb2('0x26')]({'plain':!![]});var _0x72afc1=_0xbcb2('0x27');return db[_0xbcb2('0x28')][_0xbcb2('0x29')]({'where':{'type':_0x72afc1,'resourceId':_0x47d0b5['id']}})[_0xbcb2('0x25')](function(){return _0x27bb4f;});})[_0xbcb2('0x25')](function(){_0x121b83['status'](0xcc)[_0xbcb2('0x1b')]();});}};}function handleEntityNotFound(_0x32692d,_0x47e5b3){return function(_0x20e965){if(!_0x20e965){_0x32692d[_0xbcb2('0x19')](0x194);}return _0x20e965;};}function handleError(_0x34f632,_0x5b4e15){_0x5b4e15=_0x5b4e15||0x1f4;return function(_0x40f72f){logger[_0xbcb2('0x2a')](_0x40f72f['stack']);if(_0x40f72f[_0xbcb2('0x2b')]){delete _0x40f72f[_0xbcb2('0x2b')];}_0x34f632['status'](_0x5b4e15)[_0xbcb2('0x2c')](_0x40f72f);};}exports[_0xbcb2('0x2d')]=function(_0x442539,_0x63da5e){var _0x5e6866={},_0x298696={},_0x452713={'count':0x0,'rows':[]};var _0x509b8b=db[_0xbcb2('0x2e')][_0xbcb2('0x2f')];_0x298696[_0xbcb2('0x30')]=_[_0xbcb2('0x31')](_0x509b8b);_0x298696[_0xbcb2('0x32')]=_['keys'](_0x442539[_0xbcb2('0x32')]);_0x298696['filters']=_[_0xbcb2('0x33')](_0x298696[_0xbcb2('0x30')],_0x298696[_0xbcb2('0x32')]);_0x5e6866[_0xbcb2('0x34')]=_[_0xbcb2('0x33')](_0x298696[_0xbcb2('0x30')],qs['fields'](_0x442539[_0xbcb2('0x32')]['fields']));_0x5e6866['attributes']=_0x5e6866[_0xbcb2('0x34')]['length']?_0x5e6866[_0xbcb2('0x34')]:_0x298696[_0xbcb2('0x30')];if(!_0x442539['query'][_0xbcb2('0x35')](_0xbcb2('0x36'))){_0x5e6866[_0xbcb2('0x1e')]=qs[_0xbcb2('0x1e')](_0x442539[_0xbcb2('0x32')]['limit']);_0x5e6866[_0xbcb2('0x1d')]=qs[_0xbcb2('0x1d')](_0x442539[_0xbcb2('0x32')][_0xbcb2('0x1d')]);}_0x5e6866[_0xbcb2('0x37')]=qs[_0xbcb2('0x38')](_0x442539[_0xbcb2('0x32')]['sort']);_0x5e6866['where']=qs[_0xbcb2('0x39')](_[_0xbcb2('0x3a')](_0x442539[_0xbcb2('0x32')],_0x298696[_0xbcb2('0x39')]));if(_0x442539['query']['filter']){_0x5e6866[_0xbcb2('0x3b')]=_[_0xbcb2('0x3c')](_0x5e6866['where'],{'$or':_[_0xbcb2('0x3d')](_0x509b8b,function(_0x3c7ecf){if(_0x3c7ecf[_0xbcb2('0x3e')][_0xbcb2('0x3f')]!==_0xbcb2('0x40')){var _0x319665={};_0x319665[_0x3c7ecf[_0xbcb2('0x41')]]={'$like':'%'+_0x442539['query'][_0xbcb2('0x42')]+'%'};return _0x319665;}})});}_0x5e6866=_[_0xbcb2('0x3c')]({},_0x5e6866,_0x442539[_0xbcb2('0x43')]);var _0x21e111={'where':_0x5e6866[_0xbcb2('0x3b')]};return db[_0xbcb2('0x2e')][_0xbcb2('0x44')](_0x21e111)[_0xbcb2('0x25')](function(_0x57b4f6){_0x452713[_0xbcb2('0x44')]=_0x57b4f6;if(_0x442539[_0xbcb2('0x32')]['includeAll']){_0x5e6866['include']=[{'all':!![]}];}return db[_0xbcb2('0x2e')][_0xbcb2('0x45')](_0x5e6866);})['then'](function(_0x43af7a){_0x452713[_0xbcb2('0x46')]=_0x43af7a;return _0x452713;})[_0xbcb2('0x25')](respondWithFilteredResult(_0x63da5e,_0x5e6866))[_0xbcb2('0x47')](handleError(_0x63da5e,null));};exports[_0xbcb2('0x48')]=function(_0x37d6b5,_0x32b732){var _0x3952d5={'raw':!![],'where':{'id':_0x37d6b5['params']['id']}},_0x44f176={};_0x44f176[_0xbcb2('0x30')]=_[_0xbcb2('0x31')](db[_0xbcb2('0x2e')][_0xbcb2('0x2f')]);_0x44f176[_0xbcb2('0x32')]=_[_0xbcb2('0x31')](_0x37d6b5[_0xbcb2('0x32')]);_0x44f176[_0xbcb2('0x39')]=_[_0xbcb2('0x33')](_0x44f176['model'],_0x44f176[_0xbcb2('0x32')]);_0x3952d5[_0xbcb2('0x34')]=_[_0xbcb2('0x33')](_0x44f176[_0xbcb2('0x30')],qs[_0xbcb2('0x49')](_0x37d6b5['query'][_0xbcb2('0x49')]));_0x3952d5[_0xbcb2('0x34')]=_0x3952d5['attributes'][_0xbcb2('0x4a')]?_0x3952d5['attributes']:_0x44f176['model'];if(_0x37d6b5['query'][_0xbcb2('0x4b')]){_0x3952d5[_0xbcb2('0x4c')]=[{'all':!![]}];}_0x3952d5=_[_0xbcb2('0x3c')]({},_0x3952d5,_0x37d6b5[_0xbcb2('0x43')]);return db[_0xbcb2('0x2e')][_0xbcb2('0x4d')](_0x3952d5)[_0xbcb2('0x25')](handleEntityNotFound(_0x32b732,null))['then'](respondWithResult(_0x32b732,null))[_0xbcb2('0x47')](handleError(_0x32b732,null));};exports[_0xbcb2('0x4e')]=function(_0x19bc5e,_0x5e5303){return db['Disposition'][_0xbcb2('0x4e')](_0x19bc5e[_0xbcb2('0x4f')],{})['then'](function(_0x199690){var _0x47b376=_0x19bc5e['user'][_0xbcb2('0x26')]({'plain':!![]});if(!_0x47b376)throw new Error(_0xbcb2('0x50'));if(_0x47b376['role']===_0xbcb2('0x51')){var _0x30c8f8=_0x199690[_0xbcb2('0x26')]({'plain':!![]});var _0x3075a0=_0xbcb2('0x27');return db[_0xbcb2('0x52')][_0xbcb2('0x4d')]({'where':{'name':_0x3075a0,'userProfileId':_0x47b376[_0xbcb2('0x53')]},'raw':!![]})[_0xbcb2('0x25')](function(_0x3ffb8f){if(_0x3ffb8f&&_0x3ffb8f['autoAssociation']===0x0){return db[_0xbcb2('0x28')]['create']({'name':_0x30c8f8[_0xbcb2('0x2b')],'resourceId':_0x30c8f8['id'],'type':_0x3ffb8f['name'],'sectionId':_0x3ffb8f['id']},{})[_0xbcb2('0x25')](function(){return _0x199690;});}else{return _0x199690;}})[_0xbcb2('0x47')](function(_0xbfa20d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbfa20d);throw _0xbfa20d;});}return _0x199690;})[_0xbcb2('0x25')](respondWithResult(_0x5e5303,0xc9))['catch'](handleError(_0x5e5303,null));};exports[_0xbcb2('0x24')]=function(_0x118690,_0x5e5e1a){if(_0x118690['body']['id']){delete _0x118690['body']['id'];}return db[_0xbcb2('0x2e')][_0xbcb2('0x4d')]({'where':{'id':_0x118690[_0xbcb2('0x54')]['id']}})[_0xbcb2('0x25')](handleEntityNotFound(_0x5e5e1a,null))[_0xbcb2('0x25')](saveUpdates(_0x118690['body'],null))[_0xbcb2('0x25')](respondWithResult(_0x5e5e1a,null))[_0xbcb2('0x47')](handleError(_0x5e5e1a,null));};exports[_0xbcb2('0x29')]=function(_0x31d524,_0x54e842){return db['Disposition'][_0xbcb2('0x4d')]({'where':{'id':_0x31d524[_0xbcb2('0x54')]['id']}})[_0xbcb2('0x25')](handleEntityNotFound(_0x54e842,null))[_0xbcb2('0x25')](removeEntity(_0x54e842,null))[_0xbcb2('0x47')](handleError(_0x54e842,null));};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js
index 25eafe8..7b1dcd4 100644
--- a/server/api/disposition/disposition.model.js
+++ b/server/api/disposition/disposition.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe097=['lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./disposition.attributes','define','Disposition','name_voice','name','ListId','name_chat','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId'];(function(_0x54f0d6,_0x542e24){var _0x16313e=function(_0x228122){while(--_0x228122){_0x54f0d6['push'](_0x54f0d6['shift']());}};_0x16313e(++_0x542e24);}(_0xe097,0x1b9));var _0x7e09=function(_0x479466,_0x3e9b31){_0x479466=_0x479466-0x0;var _0xb5cee9=_0xe097[_0x479466];return _0xb5cee9;};'use strict';var _=require(_0x7e09('0x0'));var util=require(_0x7e09('0x1'));var logger=require(_0x7e09('0x2'))(_0x7e09('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7e09('0x4'));var fs=require('fs');var path=require(_0x7e09('0x5'));var rimraf=require('rimraf');var config=require(_0x7e09('0x6'));var attributes=require(_0x7e09('0x7'));module['exports']=function(_0x279f56,_0x1f0449){return _0x279f56[_0x7e09('0x8')](_0x7e09('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x7e09('0xa'),'fields':[_0x7e09('0xb'),_0x7e09('0xc')]},{'unique':!![],'name':_0x7e09('0xd'),'fields':[_0x7e09('0xb'),'ChatWebsiteId']},{'unique':!![],'name':_0x7e09('0xe'),'fields':[_0x7e09('0xb'),_0x7e09('0xf')]},{'unique':!![],'name':_0x7e09('0x10'),'fields':[_0x7e09('0xb'),'SmsAccountId']},{'unique':!![],'name':_0x7e09('0x11'),'fields':[_0x7e09('0xb'),_0x7e09('0x12')]},{'unique':!![],'name':_0x7e09('0x13'),'fields':[_0x7e09('0xb'),_0x7e09('0x14')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a87=['api','bluebird','request-promise','path','rimraf','exports','tools_dispositions','name','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','FaxAccountId','name_openchannel','lodash','util','../../config/logger'];(function(_0x150397,_0x258581){var _0x5cadab=function(_0x3052d6){while(--_0x3052d6){_0x150397['push'](_0x150397['shift']());}};_0x5cadab(++_0x258581);}(_0x4a87,0x69));var _0x74a8=function(_0x5248db,_0x18ca02){_0x5248db=_0x5248db-0x0;var _0x57340d=_0x4a87[_0x5248db];return _0x57340d;};'use strict';var _=require(_0x74a8('0x0'));var util=require(_0x74a8('0x1'));var logger=require(_0x74a8('0x2'))(_0x74a8('0x3'));var moment=require('moment');var BPromise=require(_0x74a8('0x4'));var rp=require(_0x74a8('0x5'));var fs=require('fs');var path=require(_0x74a8('0x6'));var rimraf=require(_0x74a8('0x7'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x74a8('0x8')]=function(_0x4b09b2,_0x3eddba){return _0x4b09b2['define']('Disposition',attributes,{'tableName':_0x74a8('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x74a8('0xa'),'ListId']},{'unique':!![],'name':_0x74a8('0xb'),'fields':['name',_0x74a8('0xc')]},{'unique':!![],'name':_0x74a8('0xd'),'fields':[_0x74a8('0xa'),_0x74a8('0xe')]},{'unique':!![],'name':_0x74a8('0xf'),'fields':['name','SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x74a8('0xa'),_0x74a8('0x10')]},{'unique':!![],'name':_0x74a8('0x11'),'fields':[_0x74a8('0xa'),'OpenchannelAccountId']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js
index ab4d223..6a33d82 100644
--- a/server/api/disposition/disposition.rpc.js
+++ b/server/api/disposition/disposition.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x99c9=['code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x199d99,_0x48eb55){var _0x3ff508=function(_0x33a888){while(--_0x33a888){_0x199d99['push'](_0x199d99['shift']());}};_0x3ff508(++_0x48eb55);}(_0x99c9,0x13c));var _0x999c=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x99c9[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var moment=require(_0x999c('0x2'));var BPromise=require(_0x999c('0x3'));var rs=require(_0x999c('0x4'));var fs=require('fs');var Redis=require(_0x999c('0x5'));var db=require(_0x999c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x999c('0x7'))(_0x999c('0x8'));var config=require(_0x999c('0x9'));var jayson=require(_0x999c('0xa'));var client=jayson[_0x999c('0xb')][_0x999c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34f100,_0x651b7e,_0xc8a6b5){return new BPromise(function(_0xb88ec1,_0x329252){return client[_0x999c('0xd')](_0x34f100,_0xc8a6b5)[_0x999c('0xe')](function(_0x395321){logger['info'](_0x999c('0xf'),_0x651b7e,_0x999c('0x10'));logger['debug'](_0x999c('0x11'),_0x651b7e,_0x999c('0x10'),JSON[_0x999c('0x12')](_0x395321));if(_0x395321[_0x999c('0x13')]){if(_0x395321[_0x999c('0x13')][_0x999c('0x14')]===0x1f4){logger[_0x999c('0x13')](_0x999c('0xf'),_0x651b7e,_0x395321[_0x999c('0x13')][_0x999c('0x15')]);return _0x329252(_0x395321[_0x999c('0x13')][_0x999c('0x15')]);}logger['error'](_0x999c('0xf'),_0x651b7e,_0x395321[_0x999c('0x13')]['message']);return _0xb88ec1(_0x395321['error']['message']);}else{logger[_0x999c('0x16')](_0x999c('0xf'),_0x651b7e,_0x999c('0x10'));_0xb88ec1(_0x395321[_0x999c('0x17')][_0x999c('0x15')]);}})['catch'](function(_0x226437){logger[_0x999c('0x13')](_0x999c('0xf'),_0x651b7e,_0x226437);_0x329252(_0x226437);});});}
\ No newline at end of file
+var _0x106f=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird'];(function(_0x23a29d,_0x4a4466){var _0xe4a40b=function(_0x14526f){while(--_0x14526f){_0x23a29d['push'](_0x23a29d['shift']());}};_0xe4a40b(++_0x4a4466);}(_0x106f,0x162));var _0xf106=function(_0x115a22,_0x30657c){_0x115a22=_0x115a22-0x0;var _0xe5d5c1=_0x106f[_0x115a22];return _0xe5d5c1;};'use strict';var _=require(_0xf106('0x0'));var util=require(_0xf106('0x1'));var moment=require('moment');var BPromise=require(_0xf106('0x2'));var rs=require(_0xf106('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf106('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf106('0x5'))(_0xf106('0x6'));var config=require(_0xf106('0x7'));var jayson=require(_0xf106('0x8'));var client=jayson[_0xf106('0x9')][_0xf106('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc9588d,_0x546acc,_0x4ea3b8){return new BPromise(function(_0x3ac1bd,_0x5ea4f0){return client['request'](_0xc9588d,_0x4ea3b8)['then'](function(_0x4bd78d){logger['info'](_0xf106('0xb'),_0x546acc,_0xf106('0xc'));logger[_0xf106('0xd')](_0xf106('0xe'),_0x546acc,_0xf106('0xc'),JSON[_0xf106('0xf')](_0x4bd78d));if(_0x4bd78d[_0xf106('0x10')]){if(_0x4bd78d[_0xf106('0x10')][_0xf106('0x11')]===0x1f4){logger[_0xf106('0x10')](_0xf106('0xb'),_0x546acc,_0x4bd78d['error'][_0xf106('0x12')]);return _0x5ea4f0(_0x4bd78d[_0xf106('0x10')]['message']);}logger['error'](_0xf106('0xb'),_0x546acc,_0x4bd78d[_0xf106('0x10')][_0xf106('0x12')]);return _0x3ac1bd(_0x4bd78d['error'][_0xf106('0x12')]);}else{logger[_0xf106('0x13')](_0xf106('0xb'),_0x546acc,'request\x20sent');_0x3ac1bd(_0x4bd78d[_0xf106('0x14')][_0xf106('0x12')]);}})['catch'](function(_0x134f6d){logger[_0xf106('0x10')](_0xf106('0xb'),_0x546acc,_0x134f6d);_0x5ea4f0(_0x134f6d);});});}
\ No newline at end of file
diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js
index 1b17cc0..4b5211d 100644
--- a/server/api/disposition/index.js
+++ b/server/api/disposition/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa928=['express','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x167c46,_0x3e47b7){var _0x5b4f09=function(_0x32583f){while(--_0x32583f){_0x167c46['push'](_0x167c46['shift']());}};_0x5b4f09(++_0x3e47b7);}(_0xa928,0x1ac));var _0x8a92=function(_0x2c75bd,_0x4d24ec){_0x2c75bd=_0x2c75bd-0x0;var _0xc27f91=_0xa928[_0x2c75bd];return _0xc27f91;};'use strict';var multer=require(_0x8a92('0x0'));var util=require(_0x8a92('0x1'));var path=require(_0x8a92('0x2'));var timeout=require(_0x8a92('0x3'));var express=require(_0x8a92('0x4'));var router=express['Router']();var auth=require(_0x8a92('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a92('0x6'));var controller=require('./disposition.controller');router[_0x8a92('0x7')]('/',auth['isAuthenticated'](),controller[_0x8a92('0x8')]);router[_0x8a92('0x7')](_0x8a92('0x9'),auth[_0x8a92('0xa')](),controller[_0x8a92('0xb')]);router[_0x8a92('0xc')]('/',auth[_0x8a92('0xa')](),controller['create']);router[_0x8a92('0xd')](_0x8a92('0x9'),auth[_0x8a92('0xa')](),controller['update']);router[_0x8a92('0xe')](_0x8a92('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x8a92('0xf')]=router;
\ No newline at end of file
+var _0xe324=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get'];(function(_0x2480e0,_0x291db4){var _0x397756=function(_0x199868){while(--_0x199868){_0x2480e0['push'](_0x2480e0['shift']());}};_0x397756(++_0x291db4);}(_0xe324,0x6f));var _0x4e32=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0xe324[_0x564821];return _0x2b604d;};'use strict';var multer=require(_0x4e32('0x0'));var util=require(_0x4e32('0x1'));var path=require('path');var timeout=require(_0x4e32('0x2'));var express=require('express');var router=express[_0x4e32('0x3')]();var auth=require(_0x4e32('0x4'));var interaction=require(_0x4e32('0x5'));var config=require(_0x4e32('0x6'));var controller=require(_0x4e32('0x7'));router[_0x4e32('0x8')]('/',auth[_0x4e32('0x9')](),controller[_0x4e32('0xa')]);router['get'](_0x4e32('0xb'),auth[_0x4e32('0x9')](),controller[_0x4e32('0xc')]);router[_0x4e32('0xd')]('/',auth[_0x4e32('0x9')](),controller[_0x4e32('0xe')]);router[_0x4e32('0xf')](_0x4e32('0xb'),auth[_0x4e32('0x9')](),controller[_0x4e32('0x10')]);router[_0x4e32('0x11')]('/:id',auth[_0x4e32('0x9')](),controller[_0x4e32('0x12')]);module[_0x4e32('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js
index 7b958cb..30803ef 100644
--- a/server/api/faxAccount/faxAccount.attributes.js
+++ b/server/api/faxAccount/faxAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc55=['7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800'];(function(_0x3a6fba,_0x5b3507){var _0x5c3019=function(_0x1d87d0){while(--_0x1d87d0){_0x3a6fba['push'](_0x3a6fba['shift']());}};_0x5c3019(++_0x5b3507);}(_0xbc55,0x177));var _0x5bc5=function(_0x16d5e9,_0x44e7e4){_0x16d5e9=_0x16d5e9-0x0;var _0x49e1b6=_0xbc55[_0x16d5e9];return _0x49e1b6;};'use strict';var Sequelize=require(_0x5bc5('0x0'));module[_0x5bc5('0x1')]={'name':{'type':Sequelize[_0x5bc5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x5bc5('0x3')]('yes','no'),'defaultValue':_0x5bc5('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x5bc5('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x5bc5('0x6')},'minrate':{'type':Sequelize[_0x5bc5('0x3')](_0x5bc5('0x7'),_0x5bc5('0x8'),_0x5bc5('0x9'),_0x5bc5('0xa'),_0x5bc5('0xb'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x5bc5('0x7'),_0x5bc5('0x8'),'7200',_0x5bc5('0xa'),_0x5bc5('0xb'),_0x5bc5('0xc')),'defaultValue':_0x5bc5('0xc')},'modem':{'type':Sequelize[_0x5bc5('0x2')],'defaultValue':_0x5bc5('0xd')},'gateway':{'type':Sequelize[_0x5bc5('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5bc5('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5bc5('0x3')](_0x5bc5('0xf'),_0x5bc5('0x10'),_0x5bc5('0x11'),_0x5bc5('0x12')),'defaultValue':_0x5bc5('0xf')},'key':{'type':Sequelize[_0x5bc5('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5bc5('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5bc5('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5bc5('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5bc5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5bc5('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5bc5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5bc5('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5bc5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5bc5('0xe')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5bc5('0x14')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1b6f61){if(!_0x1b6f61)this[_0x5bc5('0x15')](_0x5bc5('0x16'),null);this[_0x5bc5('0x15')](_0x5bc5('0x17'),_0x1b6f61);}}};
\ No newline at end of file
+var _0x8abf=['12000','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400'];(function(_0x2048cb,_0x3c9545){var _0x1b6162=function(_0x5a37a5){while(--_0x5a37a5){_0x2048cb['push'](_0x2048cb['shift']());}};_0x1b6162(++_0x3c9545);}(_0x8abf,0xe4));var _0xf8ab=function(_0x2ee456,_0x15e78a){_0x2ee456=_0x2ee456-0x0;var _0x226cb0=_0x8abf[_0x2ee456];return _0x226cb0;};'use strict';var Sequelize=require(_0xf8ab('0x0'));module[_0xf8ab('0x1')]={'name':{'type':Sequelize[_0xf8ab('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xf8ab('0x3')]('yes','no'),'defaultValue':_0xf8ab('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xf8ab('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xf8ab('0x6')},'minrate':{'type':Sequelize[_0xf8ab('0x3')](_0xf8ab('0x7'),_0xf8ab('0x8'),_0xf8ab('0x9'),_0xf8ab('0xa'),'12000',_0xf8ab('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM']('2400',_0xf8ab('0x8'),_0xf8ab('0x9'),_0xf8ab('0xa'),_0xf8ab('0xc'),_0xf8ab('0xb')),'defaultValue':_0xf8ab('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xf8ab('0xd')},'gateway':{'type':Sequelize[_0xf8ab('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xf8ab('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf8ab('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xf8ab('0x3')](_0xf8ab('0xf'),'IAX',_0xf8ab('0x10'),_0xf8ab('0x11')),'defaultValue':_0xf8ab('0xf')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf8ab('0x12')],'defaultValue':function(){return _0xf8ab('0x13');}},'notificationSound':{'type':Sequelize[_0xf8ab('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf8ab('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf8ab('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf8ab('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf8ab('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf8ab('0xe')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf8ab('0x15'),'set':function(_0x533525){if(!_0x533525)this[_0xf8ab('0x16')](_0xf8ab('0x17'),null);this[_0xf8ab('0x16')]('mandatoryDisposition',_0x533525);}}};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js
index b0abac2..fcaa538 100644
--- a/server/api/faxAccount/faxAccount.controller.js
+++ b/server/api/faxAccount/faxAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb6a9=['appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','headerinfo','maxrate','minrate','modem','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','CmContact','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','dataValues','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','end','status','json','count','offset','limit','set','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','keys','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','filter','merge','where','type','field','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','find','describe','addDisposition','Disposition','getDispositions','findOne','pick','FaxAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','map','removeAnswers','addInteraction','FaxInteraction','omit','hasOwnProperty','Contact','User','Owner','fullname','Tags','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb6a9,0x1b6));var _0x9b6a=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb6a9[_0x4b2863];return _0x567d67;};'use strict';var pdf=require(_0x9b6a('0x0'));var emlformat=require(_0x9b6a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9b6a('0x2'));var jsonpatch=require(_0x9b6a('0x3'));var rp=require(_0x9b6a('0x4'));var moment=require(_0x9b6a('0x5'));var BPromise=require(_0x9b6a('0x6'));var Mustache=require(_0x9b6a('0x7'));var util=require(_0x9b6a('0x8'));var path=require(_0x9b6a('0x9'));var sox=require(_0x9b6a('0xa'));var csv=require('to-csv');var ejs=require(_0x9b6a('0xb'));var fs=require('fs');var _=require(_0x9b6a('0xc'));var squel=require(_0x9b6a('0xd'));var crypto=require(_0x9b6a('0xe'));var jsforce=require(_0x9b6a('0xf'));var deskjs=require(_0x9b6a('0x10'));var toCsv=require(_0x9b6a('0x11'));var querystring=require(_0x9b6a('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9b6a('0x13'));var qs=require(_0x9b6a('0x14'));var hardwareService=require(_0x9b6a('0x15'));var logger=require(_0x9b6a('0x16'))(_0x9b6a('0x17'));var utils=require(_0x9b6a('0x18'));var config=require(_0x9b6a('0x19'));var db=require(_0x9b6a('0x1a'))['db'];config[_0x9b6a('0x1b')]=_['defaults'](config[_0x9b6a('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x9b6a('0x1c'))(new Redis(config[_0x9b6a('0x1b')]));require(_0x9b6a('0x1d'))['register'](socket);var jayson=require(_0x9b6a('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x9b6a('0x1f')][_0x9b6a('0x20')]({'port':0x232a});function checkPasswordPattern(_0x3f0f9c,_0x594c1a,_0x4d422b){if(_0x4d422b){var _0x575c09=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x575c09['test'](_0x594c1a)){return _0x3f0f9c;}else{throw new Error(_0x9b6a('0x21'));}}else{return _0x3f0f9c;}}function respondWithRpcPromise(_0x297e8a,_0x5130ce,_0x18ded5,_0xff120){return new BPromise(function(_0x3723ac,_0x36b169){var _0x38ce7e=_0xff120||client;return _0x38ce7e['request'](_0x297e8a,_0x18ded5)[_0x9b6a('0x22')](function(_0x469cf0){logger['info'](_0x9b6a('0x23'),_0x5130ce,'request\x20sent');logger['debug'](_0x9b6a('0x24'),_0x5130ce,_0x9b6a('0x25'),JSON[_0x9b6a('0x26')](_0x469cf0));if(_0x469cf0[_0x9b6a('0x27')]){if(_0x469cf0[_0x9b6a('0x27')][_0x9b6a('0x28')]===0x1f4){logger['error'](_0x9b6a('0x23'),_0x5130ce,_0x469cf0[_0x9b6a('0x27')][_0x9b6a('0x29')]);return _0x36b169(_0x469cf0[_0x9b6a('0x27')][_0x9b6a('0x29')]);}logger['error'](_0x9b6a('0x23'),_0x5130ce,_0x469cf0['error'][_0x9b6a('0x29')]);return _0x3723ac(_0x469cf0[_0x9b6a('0x27')][_0x9b6a('0x29')]);}else{logger[_0x9b6a('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x5130ce,_0x9b6a('0x25'));_0x3723ac(_0x469cf0[_0x9b6a('0x2b')][_0x9b6a('0x29')]);}})['catch'](function(_0x494a4b){logger[_0x9b6a('0x27')](_0x9b6a('0x23'),_0x5130ce,_0x494a4b);_0x36b169(_0x494a4b);});});}function respondWithStatusCode(_0x52c787,_0x1d80d0){_0x1d80d0=_0x1d80d0||0xcc;return function(_0x31d0e3){if(_0x31d0e3){return _0x52c787['sendStatus'](_0x1d80d0);}return _0x52c787['status'](_0x1d80d0)[_0x9b6a('0x2c')]();};}function respondWithResult(_0xd6914d,_0x2291a0){_0x2291a0=_0x2291a0||0xc8;return function(_0xabdaf1){if(_0xabdaf1){return _0xd6914d[_0x9b6a('0x2d')](_0x2291a0)[_0x9b6a('0x2e')](_0xabdaf1);}};}function respondWithFilteredResult(_0x52cc71,_0x133719){return function(_0x458458){if(_0x458458){var _0x36dc81=_0x458458[_0x9b6a('0x2f')],_0x3f6539=_0x133719[_0x9b6a('0x30')],_0x3907bb=_0x133719[_0x9b6a('0x30')]+_0x133719[_0x9b6a('0x31')],_0x48a436;if(_0x3907bb>=_0x36dc81){_0x3907bb=_0x36dc81;_0x48a436=0xc8;}else{_0x48a436=0xce;}_0x52cc71['status'](_0x48a436);return _0x52cc71[_0x9b6a('0x32')]('Content-Range',_0x3f6539+'-'+_0x3907bb+'/'+_0x36dc81)[_0x9b6a('0x2e')](_0x458458);}return null;};}function patchUpdates(_0x22e446){return function(_0x2aef9a){try{jsonpatch['apply'](_0x2aef9a,_0x22e446,!![]);}catch(_0x3ddd53){return BPromise[_0x9b6a('0x33')](_0x3ddd53);}return _0x2aef9a[_0x9b6a('0x34')]();};}function saveUpdates(_0x1fcf47,_0x2f1351){return function(_0x2480a9){if(_0x2480a9){return _0x2480a9[_0x9b6a('0x35')](_0x1fcf47)[_0x9b6a('0x22')](function(_0x34d56c){return _0x34d56c;});}return null;};}function removeEntity(_0x57d5bb,_0x2f4d49){return function(_0x2c00f4){if(_0x2c00f4){return _0x2c00f4[_0x9b6a('0x36')]()[_0x9b6a('0x22')](function(){var _0x44eee6=_0x2c00f4[_0x9b6a('0x37')]({'plain':!![]});var _0x5684c8=_0x9b6a('0x38');return db[_0x9b6a('0x39')][_0x9b6a('0x36')]({'where':{'type':_0x5684c8,'resourceId':_0x44eee6['id']}})[_0x9b6a('0x22')](function(){return _0x2c00f4;});})['then'](function(){_0x57d5bb[_0x9b6a('0x2d')](0xcc)[_0x9b6a('0x2c')]();});}};}function handleEntityNotFound(_0x46b5fd,_0x39aa59){return function(_0x7cd99a){if(!_0x7cd99a){_0x46b5fd[_0x9b6a('0x3a')](0x194);}return _0x7cd99a;};}function handleError(_0x2506e8,_0x54a132){_0x54a132=_0x54a132||0x1f4;return function(_0x43a5fa){logger[_0x9b6a('0x27')](_0x43a5fa['stack']);if(_0x43a5fa[_0x9b6a('0x3b')]){delete _0x43a5fa['name'];}_0x2506e8[_0x9b6a('0x2d')](_0x54a132)[_0x9b6a('0x3c')](_0x43a5fa);};}exports[_0x9b6a('0x3d')]=function(_0x359a21,_0x2aa5b4){var _0xe9bad4={'include':[{'model':db[_0x9b6a('0x3e')],'as':_0x9b6a('0x3f')}]},_0x53e6c0={},_0x490ee1={'count':0x0,'rows':[]};var _0x59b43e=db[_0x9b6a('0x40')][_0x9b6a('0x41')];_0x53e6c0['model']=_[_0x9b6a('0x42')](_0x59b43e);_0x53e6c0[_0x9b6a('0x43')]=_[_0x9b6a('0x42')](_0x359a21['query']);_0x53e6c0[_0x9b6a('0x44')]=_['intersection'](_0x53e6c0[_0x9b6a('0x45')],_0x53e6c0[_0x9b6a('0x43')]);_0xe9bad4['attributes']=_[_0x9b6a('0x46')](_0x53e6c0[_0x9b6a('0x45')],qs[_0x9b6a('0x47')](_0x359a21[_0x9b6a('0x43')]['fields']));_0xe9bad4[_0x9b6a('0x48')]=_0xe9bad4['attributes'][_0x9b6a('0x49')]?_0xe9bad4[_0x9b6a('0x48')]:_0x53e6c0[_0x9b6a('0x45')];if(!_0x359a21[_0x9b6a('0x43')]['hasOwnProperty'](_0x9b6a('0x4a'))){_0xe9bad4[_0x9b6a('0x31')]=qs[_0x9b6a('0x31')](_0x359a21['query'][_0x9b6a('0x31')]);_0xe9bad4['offset']=qs[_0x9b6a('0x30')](_0x359a21['query'][_0x9b6a('0x30')]);}_0xe9bad4[_0x9b6a('0x4b')]=qs[_0x9b6a('0x4c')](_0x359a21[_0x9b6a('0x43')][_0x9b6a('0x4c')]);_0xe9bad4['where']=qs['filters'](_['pick'](_0x359a21[_0x9b6a('0x43')],_0x53e6c0[_0x9b6a('0x44')]));if(_0x359a21['query'][_0x9b6a('0x4d')]){_0xe9bad4['where']=_[_0x9b6a('0x4e')](_0xe9bad4[_0x9b6a('0x4f')],{'$or':_['map'](_0x59b43e,function(_0x18563b){if(_0x18563b[_0x9b6a('0x50')]['key']!=='VIRTUAL'){var _0x43c1bb={};_0x43c1bb[_0x18563b[_0x9b6a('0x51')]]={'$like':'%'+_0x359a21[_0x9b6a('0x43')][_0x9b6a('0x4d')]+'%'};return _0x43c1bb;}})});}_0xe9bad4=_[_0x9b6a('0x4e')]({},_0xe9bad4,_0x359a21[_0x9b6a('0x52')]);var _0x20ec22={'where':_0xe9bad4[_0x9b6a('0x4f')]};return db[_0x9b6a('0x40')][_0x9b6a('0x2f')](_0x20ec22)[_0x9b6a('0x22')](function(_0x502053){_0x490ee1[_0x9b6a('0x2f')]=_0x502053;if(_0x359a21[_0x9b6a('0x43')][_0x9b6a('0x53')]){_0xe9bad4[_0x9b6a('0x54')]=[{'all':!![]}];}return db[_0x9b6a('0x40')][_0x9b6a('0x55')](_0xe9bad4);})['then'](function(_0x126e03){_0x490ee1[_0x9b6a('0x56')]=_0x126e03;return _0x490ee1;})['then'](respondWithFilteredResult(_0x2aa5b4,_0xe9bad4))[_0x9b6a('0x57')](handleError(_0x2aa5b4,null));};exports[_0x9b6a('0x58')]=function(_0x270693,_0xfd6733){var _0x224455={'raw':![],'where':{'id':_0x270693[_0x9b6a('0x59')]['id']},'include':[{'model':db[_0x9b6a('0x3e')],'as':_0x9b6a('0x3f')}]},_0x14c351={};_0x14c351[_0x9b6a('0x45')]=_[_0x9b6a('0x42')](db[_0x9b6a('0x40')][_0x9b6a('0x41')]);_0x14c351[_0x9b6a('0x43')]=_[_0x9b6a('0x42')](_0x270693['query']);_0x14c351['filters']=_['intersection'](_0x14c351[_0x9b6a('0x45')],_0x14c351['query']);_0x224455['attributes']=_[_0x9b6a('0x46')](_0x14c351[_0x9b6a('0x45')],qs[_0x9b6a('0x47')](_0x270693[_0x9b6a('0x43')][_0x9b6a('0x47')]));_0x224455[_0x9b6a('0x48')]=_0x224455['attributes'][_0x9b6a('0x49')]?_0x224455['attributes']:_0x14c351[_0x9b6a('0x45')];if(_0x270693['query'][_0x9b6a('0x53')]){_0x224455['include']=[{'all':!![]}];}_0x224455=_['merge']({},_0x224455,_0x270693[_0x9b6a('0x52')]);return db['FaxAccount']['find'](_0x224455)[_0x9b6a('0x22')](handleEntityNotFound(_0xfd6733,null))[_0x9b6a('0x22')](respondWithResult(_0xfd6733,null))['catch'](handleError(_0xfd6733,null));};exports[_0x9b6a('0x5a')]=function(_0x3eb883,_0x9bf585){return db['FaxAccount'][_0x9b6a('0x5a')](_0x3eb883[_0x9b6a('0x5b')],{})[_0x9b6a('0x22')](function(_0xf46887){var _0x29dac5=_0x3eb883[_0x9b6a('0x5c')][_0x9b6a('0x37')]({'plain':!![]});if(!_0x29dac5)throw new Error(_0x9b6a('0x5d'));if(_0x29dac5[_0x9b6a('0x5e')]===_0x9b6a('0x5c')){var _0x1297bb=_0xf46887[_0x9b6a('0x37')]({'plain':!![]});var _0x5c2526=_0x9b6a('0x38');return db[_0x9b6a('0x5f')]['find']({'where':{'name':_0x5c2526,'userProfileId':_0x29dac5[_0x9b6a('0x60')]},'raw':!![]})['then'](function(_0x59d3eb){if(_0x59d3eb&&_0x59d3eb[_0x9b6a('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x1297bb[_0x9b6a('0x3b')],'resourceId':_0x1297bb['id'],'type':_0x59d3eb[_0x9b6a('0x3b')],'sectionId':_0x59d3eb['id']},{})[_0x9b6a('0x22')](function(){return _0xf46887;});}else{return _0xf46887;}})[_0x9b6a('0x57')](function(_0x56cdf1){logger[_0x9b6a('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56cdf1);throw _0x56cdf1;});}return _0xf46887;})[_0x9b6a('0x22')](respondWithResult(_0x9bf585,0xc9))[_0x9b6a('0x57')](handleError(_0x9bf585,null));};exports['update']=function(_0x26d397,_0x5f48a8){if(_0x26d397['body']['id']){delete _0x26d397[_0x9b6a('0x5b')]['id'];}return db[_0x9b6a('0x40')]['find']({'where':{'id':_0x26d397[_0x9b6a('0x59')]['id']},'include':[{'model':db[_0x9b6a('0x3e')],'as':_0x9b6a('0x3f')}]})[_0x9b6a('0x22')](handleEntityNotFound(_0x5f48a8,null))[_0x9b6a('0x22')](saveUpdates(_0x26d397[_0x9b6a('0x5b')],null))[_0x9b6a('0x22')](respondWithResult(_0x5f48a8,null))[_0x9b6a('0x57')](handleError(_0x5f48a8,null));};exports[_0x9b6a('0x36')]=function(_0x3c5a64,_0x12082c){return db[_0x9b6a('0x40')][_0x9b6a('0x62')]({'where':{'id':_0x3c5a64[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x12082c,null))['then'](removeEntity(_0x12082c,null))['catch'](handleError(_0x12082c,null));};exports[_0x9b6a('0x63')]=function(_0x206ad4,_0x4e79e3){return db[_0x9b6a('0x40')][_0x9b6a('0x63')]()[_0x9b6a('0x22')](respondWithResult(_0x4e79e3,null))[_0x9b6a('0x57')](handleError(_0x4e79e3,null));};exports[_0x9b6a('0x64')]=function(_0x2cff13,_0x2c177b,_0x489570){if(_0x2cff13['body']['id']){delete _0x2cff13[_0x9b6a('0x5b')]['id'];}return db[_0x9b6a('0x40')][_0x9b6a('0x62')]({'where':{'id':_0x2cff13[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x2c177b,null))[_0x9b6a('0x22')](function(_0x4c56cf){if(_0x4c56cf){_0x2cff13['body']['FaxAccountId']=_0x4c56cf['id'];return db[_0x9b6a('0x65')][_0x9b6a('0x5a')](_0x2cff13[_0x9b6a('0x5b')]);}})[_0x9b6a('0x22')](respondWithResult(_0x2c177b,null))[_0x9b6a('0x57')](handleError(_0x2c177b,null));};exports[_0x9b6a('0x66')]=function(_0x4b8b7d,_0x118735,_0x3d0d61){var _0x4d3714={'raw':![],'where':{}};var _0x4dc8b3={};var _0x118a0a={'count':0x0,'rows':[]};return db[_0x9b6a('0x40')][_0x9b6a('0x67')]({'where':{'id':_0x4b8b7d[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x118735,null))[_0x9b6a('0x22')](function(_0x1ff9c1){if(_0x1ff9c1){_0x4dc8b3[_0x9b6a('0x45')]=_[_0x9b6a('0x42')](db['Disposition'][_0x9b6a('0x41')]);_0x4dc8b3['query']=_[_0x9b6a('0x42')](_0x4b8b7d[_0x9b6a('0x43')]);_0x4dc8b3[_0x9b6a('0x44')]=_[_0x9b6a('0x46')](_0x4dc8b3['model'],_0x4dc8b3[_0x9b6a('0x43')]);_0x4d3714[_0x9b6a('0x48')]=_['intersection'](_0x4dc8b3['model'],qs['fields'](_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x47')]));_0x4d3714['attributes']=_0x4d3714['attributes'][_0x9b6a('0x49')]?_0x4d3714[_0x9b6a('0x48')]:_0x4dc8b3['model'];if(!_0x4b8b7d[_0x9b6a('0x43')]['hasOwnProperty'](_0x9b6a('0x4a'))){_0x4d3714[_0x9b6a('0x31')]=qs['limit'](_0x4b8b7d[_0x9b6a('0x43')]['limit']);_0x4d3714[_0x9b6a('0x30')]=qs[_0x9b6a('0x30')](_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x30')]);}_0x4d3714[_0x9b6a('0x4b')]=qs[_0x9b6a('0x4c')](_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x4c')]);_0x4d3714['where']=qs[_0x9b6a('0x44')](_[_0x9b6a('0x68')](_0x4b8b7d[_0x9b6a('0x43')],_0x4dc8b3['filters']));_0x4d3714[_0x9b6a('0x4f')][_0x9b6a('0x69')]=_0x1ff9c1['id'];if(_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x4d')]){_0x4d3714[_0x9b6a('0x4f')]=_[_0x9b6a('0x4e')](_0x4d3714[_0x9b6a('0x4f')],{'$or':_['map'](_0x4d3714['attributes'],function(_0x348035){var _0x592df2={};_0x592df2[_0x348035]={'$like':'%'+_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x4d')]+'%'};return _0x592df2;})});}_0x4d3714=_[_0x9b6a('0x4e')]({},_0x4d3714,_0x4b8b7d[_0x9b6a('0x52')]);return db[_0x9b6a('0x65')][_0x9b6a('0x2f')]({'where':_0x4d3714[_0x9b6a('0x4f')]})[_0x9b6a('0x22')](function(_0x3d753b){_0x118a0a[_0x9b6a('0x2f')]=_0x3d753b;if(_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x53')]){_0x4d3714['include']=[{'all':!![]}];}return db['Disposition'][_0x9b6a('0x55')](_0x4d3714);})[_0x9b6a('0x22')](function(_0x85b630){_0x118a0a['rows']=_0x85b630;return _0x118a0a;});}})[_0x9b6a('0x22')](respondWithFilteredResult(_0x118735,_0x4d3714))[_0x9b6a('0x57')](handleError(_0x118735,null));};exports[_0x9b6a('0x6a')]=function(_0x53dfb6,_0xfc1be7,_0x57d9fd){return db['FaxAccount'][_0x9b6a('0x62')]({'where':{'id':_0x53dfb6[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0xfc1be7,null))[_0x9b6a('0x22')](function(_0x383f77){if(_0x383f77){return _0x383f77[_0x9b6a('0x6a')](_0x53dfb6['query'][_0x9b6a('0x6b')]);}})[_0x9b6a('0x22')](respondWithStatusCode(_0xfc1be7,null))[_0x9b6a('0x57')](handleError(_0xfc1be7,null));};exports[_0x9b6a('0x6c')]=function(_0x3b0855,_0x2f8a45,_0x3cb1b2){if(_0x3b0855[_0x9b6a('0x5b')]['id']){delete _0x3b0855[_0x9b6a('0x5b')]['id'];}return db[_0x9b6a('0x40')]['find']({'where':{'id':_0x3b0855[_0x9b6a('0x59')]['id']}})['then'](handleEntityNotFound(_0x2f8a45,null))['then'](function(_0x30a85){if(_0x30a85){_0x3b0855['body'][_0x9b6a('0x69')]=_0x30a85['id'];return db['CannedAnswer'][_0x9b6a('0x5a')](_0x3b0855[_0x9b6a('0x5b')]);}})['then'](respondWithResult(_0x2f8a45,null))[_0x9b6a('0x57')](handleError(_0x2f8a45,null));};exports[_0x9b6a('0x6d')]=function(_0x39b139,_0x5d08fe,_0x1a3a3c){var _0x58b486={'raw':![],'where':{}};var _0xc4b3d4={};var _0x4272d0={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9b6a('0x67')]({'where':{'id':_0x39b139[_0x9b6a('0x59')]['id']}})['then'](handleEntityNotFound(_0x5d08fe,null))['then'](function(_0x1a333f){if(_0x1a333f){_0xc4b3d4[_0x9b6a('0x45')]=_[_0x9b6a('0x42')](db[_0x9b6a('0x6e')][_0x9b6a('0x41')]);_0xc4b3d4[_0x9b6a('0x43')]=_[_0x9b6a('0x42')](_0x39b139['query']);_0xc4b3d4[_0x9b6a('0x44')]=_[_0x9b6a('0x46')](_0xc4b3d4[_0x9b6a('0x45')],_0xc4b3d4[_0x9b6a('0x43')]);_0x58b486['attributes']=_[_0x9b6a('0x46')](_0xc4b3d4['model'],qs[_0x9b6a('0x47')](_0x39b139[_0x9b6a('0x43')]['fields']));_0x58b486['attributes']=_0x58b486[_0x9b6a('0x48')]['length']?_0x58b486[_0x9b6a('0x48')]:_0xc4b3d4[_0x9b6a('0x45')];if(!_0x39b139[_0x9b6a('0x43')]['hasOwnProperty'](_0x9b6a('0x4a'))){_0x58b486['limit']=qs[_0x9b6a('0x31')](_0x39b139['query'][_0x9b6a('0x31')]);_0x58b486[_0x9b6a('0x30')]=qs['offset'](_0x39b139[_0x9b6a('0x43')]['offset']);}_0x58b486['order']=qs[_0x9b6a('0x4c')](_0x39b139[_0x9b6a('0x43')]['sort']);_0x58b486[_0x9b6a('0x4f')]=qs[_0x9b6a('0x44')](_[_0x9b6a('0x68')](_0x39b139[_0x9b6a('0x43')],_0xc4b3d4[_0x9b6a('0x44')]));_0x58b486[_0x9b6a('0x4f')][_0x9b6a('0x69')]=_0x1a333f['id'];if(_0x39b139['query']['filter']){_0x58b486['where']=_[_0x9b6a('0x4e')](_0x58b486[_0x9b6a('0x4f')],{'$or':_[_0x9b6a('0x6f')](_0x58b486[_0x9b6a('0x48')],function(_0x56e4ac){var _0x2c71fe={};_0x2c71fe[_0x56e4ac]={'$like':'%'+_0x39b139['query'][_0x9b6a('0x4d')]+'%'};return _0x2c71fe;})});}_0x58b486=_['merge']({},_0x58b486,_0x39b139[_0x9b6a('0x52')]);return db[_0x9b6a('0x6e')]['count']({'where':_0x58b486[_0x9b6a('0x4f')]})['then'](function(_0x86907){_0x4272d0[_0x9b6a('0x2f')]=_0x86907;if(_0x39b139[_0x9b6a('0x43')][_0x9b6a('0x53')]){_0x58b486[_0x9b6a('0x54')]=[{'all':!![]}];}return db[_0x9b6a('0x6e')][_0x9b6a('0x55')](_0x58b486);})[_0x9b6a('0x22')](function(_0x1d3cea){_0x4272d0[_0x9b6a('0x56')]=_0x1d3cea;return _0x4272d0;});}})[_0x9b6a('0x22')](respondWithFilteredResult(_0x5d08fe,_0x58b486))['catch'](handleError(_0x5d08fe,null));};exports[_0x9b6a('0x70')]=function(_0x8c3b2c,_0x47e702,_0x42de76){return db['FaxAccount'][_0x9b6a('0x62')]({'where':{'id':_0x8c3b2c[_0x9b6a('0x59')]['id']}})['then'](handleEntityNotFound(_0x47e702,null))[_0x9b6a('0x22')](function(_0x17b076){if(_0x17b076){return _0x17b076[_0x9b6a('0x70')](_0x8c3b2c[_0x9b6a('0x43')][_0x9b6a('0x6b')]);}})['then'](respondWithStatusCode(_0x47e702,null))['catch'](handleError(_0x47e702,null));};exports[_0x9b6a('0x71')]=function(_0xcbdb5a,_0x16e2db,_0x24992b){return db[_0x9b6a('0x72')][_0x9b6a('0x62')]({'where':{'id':_0xcbdb5a[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x16e2db,null))[_0x9b6a('0x22')](function(_0x1e3a09){if(_0x1e3a09){return _0x1e3a09['addInteraction'](_0xcbdb5a[_0x9b6a('0x5b')][_0x9b6a('0x6b')],_[_0x9b6a('0x73')](_0xcbdb5a[_0x9b6a('0x5b')],[_0x9b6a('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x16e2db,null))[_0x9b6a('0x57')](handleError(_0x16e2db,null));};exports['getInteractions']=function(_0x198e0a,_0x1f7a57,_0x2f98c4){var _0x1bbb5c={'raw':![],'where':{}};var _0x515385={};var _0x502dba={'count':0x0,'rows':[]};return db[_0x9b6a('0x40')][_0x9b6a('0x67')]({'where':{'id':_0x198e0a[_0x9b6a('0x59')]['id']}})['then'](handleEntityNotFound(_0x1f7a57,null))[_0x9b6a('0x22')](function(_0x29c4f4){if(_0x29c4f4){_0x515385['model']=_['keys'](db['FaxInteraction']['rawAttributes']);_0x515385[_0x9b6a('0x43')]=_['keys'](_0x198e0a['query']);_0x515385[_0x9b6a('0x44')]=_[_0x9b6a('0x46')](_0x515385[_0x9b6a('0x45')],_0x515385['query']);_0x1bbb5c[_0x9b6a('0x48')]=_[_0x9b6a('0x46')](_0x515385[_0x9b6a('0x45')],qs[_0x9b6a('0x47')](_0x198e0a['query'][_0x9b6a('0x47')]));_0x1bbb5c['attributes']=_0x1bbb5c[_0x9b6a('0x48')]['length']?_0x1bbb5c['attributes']:_0x515385[_0x9b6a('0x45')];if(!_0x198e0a['query'][_0x9b6a('0x74')](_0x9b6a('0x4a'))){_0x1bbb5c[_0x9b6a('0x31')]=qs[_0x9b6a('0x31')](_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x31')]);_0x1bbb5c[_0x9b6a('0x30')]=qs[_0x9b6a('0x30')](_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x30')]);}_0x1bbb5c[_0x9b6a('0x4b')]=qs['sort'](_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x4c')]);_0x1bbb5c[_0x9b6a('0x4f')]=qs[_0x9b6a('0x44')](_[_0x9b6a('0x68')](_0x198e0a['query'],_0x515385['filters']));_0x1bbb5c[_0x9b6a('0x4f')][_0x9b6a('0x69')]=_0x29c4f4['id'];if(_0x198e0a[_0x9b6a('0x43')]['filter']){_0x1bbb5c[_0x9b6a('0x4f')]=_[_0x9b6a('0x4e')](_0x1bbb5c[_0x9b6a('0x4f')],{'$or':_[_0x9b6a('0x6f')](_0x1bbb5c[_0x9b6a('0x48')],function(_0x11ffb8){var _0x2b4a53={};_0x2b4a53[_0x11ffb8]={'$like':'%'+_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x4d')]+'%'};return _0x2b4a53;})});}_0x1bbb5c=_['merge']({},_0x1bbb5c,_0x198e0a[_0x9b6a('0x52')]);return db['FaxInteraction'][_0x9b6a('0x2f')]({'where':_0x1bbb5c[_0x9b6a('0x4f')]})[_0x9b6a('0x22')](function(_0x75df4d){_0x502dba['count']=_0x75df4d;if(_0x198e0a[_0x9b6a('0x43')]['includeAll']){_0x1bbb5c[_0x9b6a('0x54')]=[{'model':db['CmContact'],'as':_0x9b6a('0x75'),'required':![]},{'model':db[_0x9b6a('0x76')],'as':_0x9b6a('0x77'),'attributes':['name',_0x9b6a('0x78'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x9b6a('0x79'),'attributes':['id','name','color'],'where':_0x198e0a[_0x9b6a('0x43')]['tag']?{'id':_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x7a')]}:undefined,'required':_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x7a')]?!![]:![]}];}return db[_0x9b6a('0x72')]['findAll'](_0x1bbb5c);})['then'](function(_0x215461){_0x502dba[_0x9b6a('0x56')]=_0x215461;return _0x502dba;});}})[_0x9b6a('0x22')](respondWithFilteredResult(_0x1f7a57,_0x1bbb5c))[_0x9b6a('0x57')](handleError(_0x1f7a57,null));};exports['addApplications']=function(_0x30d212,_0x56b026,_0xf130ef){return db[_0x9b6a('0x40')][_0x9b6a('0x67')]({'where':{'id':_0x30d212[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x56b026,null))[_0x9b6a('0x22')](function(_0x2423a7){if(_0x2423a7){return db[_0x9b6a('0x7b')][_0x9b6a('0x7c')](function(_0x59027f){return db[_0x9b6a('0x7d')]['destroy']({'where':{'FaxAccountId':_0x30d212[_0x9b6a('0x59')]['id']},'transaction':_0x59027f})[_0x9b6a('0x22')](function(_0x4c0589){var _0x2f3f98=_['map'](_0x30d212[_0x9b6a('0x5b')],function(_0x309d6f){_0x309d6f['FaxAccountId']=_0x30d212[_0x9b6a('0x59')]['id'];return _0x309d6f;});return db[_0x9b6a('0x7d')][_0x9b6a('0x7e')](_0x2f3f98,{'transaction':_0x59027f});});})[_0x9b6a('0x22')](function(){return db[_0x9b6a('0x7d')][_0x9b6a('0x7f')]({'where':{'FaxAccountId':_0x30d212[_0x9b6a('0x59')]['id']},'order':_0x9b6a('0x80')});});}})[_0x9b6a('0x22')](respondWithResult(_0x56b026,null))[_0x9b6a('0x57')](handleError(_0x56b026,null));};exports[_0x9b6a('0x81')]=function(_0x2dc6a6,_0x1d511d,_0x4f460b){var _0x10fa01={};var _0x358a06={};var _0x240388;var _0x380787;return db[_0x9b6a('0x40')][_0x9b6a('0x67')]({'where':{'id':_0x2dc6a6[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x1d511d,null))[_0x9b6a('0x22')](function(_0x1baf50){if(_0x1baf50){_0x240388=_0x1baf50;_0x358a06[_0x9b6a('0x45')]=_[_0x9b6a('0x42')](db[_0x9b6a('0x7d')][_0x9b6a('0x41')]);_0x358a06[_0x9b6a('0x43')]=_['keys'](_0x2dc6a6[_0x9b6a('0x43')]);_0x358a06[_0x9b6a('0x44')]=_['intersection'](_0x358a06[_0x9b6a('0x45')],_0x358a06[_0x9b6a('0x43')]);_0x10fa01['attributes']=_[_0x9b6a('0x46')](_0x358a06[_0x9b6a('0x45')],qs[_0x9b6a('0x47')](_0x2dc6a6[_0x9b6a('0x43')][_0x9b6a('0x47')]));_0x10fa01[_0x9b6a('0x48')]=_0x10fa01[_0x9b6a('0x48')][_0x9b6a('0x49')]?_0x10fa01[_0x9b6a('0x48')]:_0x358a06[_0x9b6a('0x45')];_0x10fa01['order']=qs[_0x9b6a('0x4c')](_0x2dc6a6['query'][_0x9b6a('0x4c')]);_0x10fa01[_0x9b6a('0x4f')]=qs['filters'](_[_0x9b6a('0x68')](_0x2dc6a6[_0x9b6a('0x43')],_0x358a06[_0x9b6a('0x44')]));if(_0x2dc6a6['query'][_0x9b6a('0x4d')]){_0x10fa01[_0x9b6a('0x4f')]=_[_0x9b6a('0x4e')](_0x10fa01[_0x9b6a('0x4f')],{'$or':_[_0x9b6a('0x6f')](_0x10fa01['attributes'],function(_0x20b4dc){var _0x5a37a6={};_0x5a37a6[_0x20b4dc]={'$like':'%'+_0x2dc6a6[_0x9b6a('0x43')][_0x9b6a('0x4d')]+'%'};return _0x5a37a6;})});}_0x10fa01=_[_0x9b6a('0x4e')]({},_0x10fa01,_0x2dc6a6[_0x9b6a('0x52')]);return _0x240388[_0x9b6a('0x81')](_0x10fa01);}})[_0x9b6a('0x22')](function(_0x38b486){if(_0x38b486){_0x380787=_0x38b486[_0x9b6a('0x49')];if(!_0x2dc6a6[_0x9b6a('0x43')][_0x9b6a('0x74')](_0x9b6a('0x4a'))){_0x10fa01['limit']=qs[_0x9b6a('0x31')](_0x2dc6a6[_0x9b6a('0x43')][_0x9b6a('0x31')]);_0x10fa01[_0x9b6a('0x30')]=qs['offset'](_0x2dc6a6[_0x9b6a('0x43')][_0x9b6a('0x30')]);}return _0x240388[_0x9b6a('0x81')](_0x10fa01);}})[_0x9b6a('0x22')](function(_0x1e6be6){if(_0x1e6be6){return _0x1e6be6?{'count':_0x380787,'rows':_0x1e6be6}:null;}})[_0x9b6a('0x22')](respondWithResult(_0x1d511d,null))[_0x9b6a('0x57')](handleError(_0x1d511d,null));};function Extension(_0x5d4d06,_0x5b02bc,_0x23ddaf,_0xd2c0d8){this[_0x9b6a('0x82')]=_0x9b6a('0x83');this[_0x9b6a('0x84')]=_0x5d4d06[_0x9b6a('0x85')];this[_0x9b6a('0x86')]=_0xd2c0d8;this[_0x9b6a('0x50')]=_0x9b6a('0x87');this[_0x9b6a('0x88')]=_0x9b6a('0x89');this[_0x9b6a('0x69')]=_0x5d4d06['id'];this[_0x9b6a('0x80')]=_0x5b02bc;this[_0x9b6a('0x8a')]=_0x23ddaf;}function createExtensionsReciveFax(_0x5b3810){var _0x1d0ee7=0x1;var _0x150285=[];_0x150285[_0x9b6a('0x8b')](new Extension(_0x5b3810,_0x1d0ee7,'',_0x9b6a('0x8c')));_0x1d0ee7+=0x1;_0x150285[_0x9b6a('0x8b')](new Extension(_0x5b3810,_0x1d0ee7,_0x9b6a('0x8d'),_0x9b6a('0x8e')));_0x1d0ee7+=0x1;for(var _0x54edcd in _0x5b3810){if(_0x5b3810[_0x9b6a('0x74')](_0x54edcd)&&(_0x54edcd==='ecm'||_0x54edcd===_0x9b6a('0x85')||_0x54edcd===_0x9b6a('0x8f')||_0x54edcd==='faxdetect'||_0x54edcd===_0x9b6a('0x90')||_0x54edcd===_0x9b6a('0x91')||_0x54edcd===_0x9b6a('0x92')||_0x54edcd===_0x9b6a('0x93')||_0x54edcd==='t38timeout')){_0x150285[_0x9b6a('0x8b')](new Extension(_0x5b3810,_0x1d0ee7,_0x9b6a('0x94')+_0x54edcd+')='+_0x5b3810[_0x54edcd],_0x9b6a('0x8e')));_0x1d0ee7+=0x1;}}_0x150285['push'](new Extension(_0x5b3810,_0x1d0ee7,'6',_0x9b6a('0x95')));_0x1d0ee7+=0x1;_0x150285[_0x9b6a('0x8b')](new Extension(_0x5b3810,_0x1d0ee7,_0x9b6a('0x96'),'ReceiveFax'));_0x1d0ee7=0x0;return _0x150285;}exports[_0x9b6a('0x97')]=function(_0x77777d,_0x2ea2f0,_0xb2d4a8){var _0x217a93;return db[_0x9b6a('0x7b')][_0x9b6a('0x7c')](function(_0x2638ed){return db[_0x9b6a('0x40')]['create'](_0x77777d[_0x9b6a('0x5b')],{'transaction':_0x2638ed})[_0x9b6a('0x22')](function(_0x263361){_0x217a93=_0x263361[_0x9b6a('0x37')]({'plain':!![]});return db[_0x9b6a('0x98')]['bulkCreate'](createExtensionsReciveFax(_0x217a93),{'transaction':_0x2638ed});});})[_0x9b6a('0x22')](function(){return _0x217a93;})[_0x9b6a('0x22')](respondWithResult(_0x2ea2f0,null))[_0x9b6a('0x57')](handleError(_0x2ea2f0,null));};exports[_0x9b6a('0x99')]=function(_0x5a8b25,_0x51d3b8,_0x4a37ee){var _0x31e504;return db[_0x9b6a('0x7b')][_0x9b6a('0x7c')](function(_0x37ca1b){return db[_0x9b6a('0x40')][_0x9b6a('0x35')](_0x5a8b25[_0x9b6a('0x5b')],{'where':{'id':_0x5a8b25[_0x9b6a('0x5b')]['id']},'transaction':_0x37ca1b})[_0x9b6a('0x22')](function(_0x9d8d31){return db[_0x9b6a('0x98')][_0x9b6a('0x36')]({'where':{'FaxAccountId':_0x5a8b25[_0x9b6a('0x5b')]['id']},'transaction':_0x37ca1b})['then'](function(_0x589ef0){return db[_0x9b6a('0x98')][_0x9b6a('0x7e')](createExtensionsReciveFax(_[_0x9b6a('0x73')](_0x5a8b25[_0x9b6a('0x5b')],['tech',_0x9b6a('0x9a'),_0x9b6a('0x9b'),_0x9b6a('0x9c'),_0x9b6a('0x9d'),_0x9b6a('0x9e')])),{'transaction':_0x37ca1b});});});})['then'](function(){return db['FaxAccount'][_0x9b6a('0x9f')](_0x5a8b25['body']['id']);})[_0x9b6a('0x22')](respondWithResult(_0x51d3b8,null))[_0x9b6a('0x57')](handleError(_0x51d3b8,null));};exports[_0x9b6a('0xa0')]=function(_0x27d6d5,_0x33e967,_0x36906a){var _0x1aab31={'raw':!![],'where':{}};var _0x415d17={};var _0x291dec={'count':0x0,'rows':[]};return db[_0x9b6a('0x40')][_0x9b6a('0x67')]({'where':{'id':_0x27d6d5[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x33e967,null))[_0x9b6a('0x22')](function(_0x2e911a){if(_0x2e911a){_0x415d17['model']=_[_0x9b6a('0x42')](db[_0x9b6a('0xa1')][_0x9b6a('0x41')]);_0x415d17['query']=_[_0x9b6a('0x42')](_0x27d6d5[_0x9b6a('0x43')]);_0x415d17[_0x9b6a('0x44')]=_['intersection'](_0x415d17[_0x9b6a('0x45')],_0x415d17[_0x9b6a('0x43')]);_0x1aab31['attributes']=_[_0x9b6a('0x46')](_0x415d17[_0x9b6a('0x45')],qs['fields'](_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0x47')]));_0x1aab31['attributes']=_0x1aab31['attributes'][_0x9b6a('0x49')]?_0x1aab31[_0x9b6a('0x48')]:_0x415d17['model'];if(!_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0x74')](_0x9b6a('0x4a'))){_0x1aab31[_0x9b6a('0x31')]=qs[_0x9b6a('0x31')](_0x27d6d5['query']['limit']);_0x1aab31[_0x9b6a('0x30')]=qs[_0x9b6a('0x30')](_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0x30')]);}_0x1aab31[_0x9b6a('0x4b')]=qs[_0x9b6a('0x4c')](_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0x4c')]);_0x1aab31[_0x9b6a('0x4f')]=qs[_0x9b6a('0x44')](_[_0x9b6a('0x68')](_0x27d6d5[_0x9b6a('0x43')],_0x415d17['filters']));_0x1aab31[_0x9b6a('0x4f')][_0x9b6a('0x69')]=_0x2e911a['id'];if(_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0x4d')]){_0x1aab31[_0x9b6a('0x4f')]=_[_0x9b6a('0x4e')](_0x1aab31[_0x9b6a('0x4f')],{'$or':_[_0x9b6a('0x6f')](_0x1aab31[_0x9b6a('0x48')],function(_0x53195b){var _0x574813={};_0x574813[_0x53195b]={'$like':'%'+_0x27d6d5[_0x9b6a('0x43')]['filter']+'%'};return _0x574813;})});}if(_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0xa2')]){var _0xf098db=_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0xa2')][_0x9b6a('0xa3')](',');var _0x5e51ab={};_0x5e51ab[_0xf098db[0x0]]={'$gte':moment(_0xf098db[0x1])[_0x9b6a('0xa4')](_0x9b6a('0xa5'))};_0x1aab31['where']=_['merge'](_0x1aab31['where'],_0x5e51ab);}_0x1aab31=_['merge']({},_0x1aab31,_0x27d6d5[_0x9b6a('0x52')]);return db[_0x9b6a('0xa1')][_0x9b6a('0x2f')]({'where':_0x1aab31[_0x9b6a('0x4f')]})[_0x9b6a('0x22')](function(_0x2bf4da){_0x291dec[_0x9b6a('0x2f')]=_0x2bf4da;if(_0x27d6d5['query']['includeAll']){_0x1aab31['include']=[{'all':!![]}];}return db[_0x9b6a('0xa1')][_0x9b6a('0x55')](_0x1aab31);})[_0x9b6a('0x22')](function(_0x4f1d54){_0x291dec[_0x9b6a('0x56')]=_0x4f1d54;return _0x291dec;});}})['then'](respondWithFilteredResult(_0x33e967,_0x1aab31))[_0x9b6a('0x57')](handleError(_0x33e967,null));};exports[_0x9b6a('0x3c')]=function(_0x5c4181,_0x404078,_0x461520){var _0x35faa2,_0x438981={},_0x428b86;if(_0x5c4181['body']['to']){_0x428b86=_0x5c4181[_0x9b6a('0x5b')]['to'][0x0];}return db[_0x9b6a('0x40')]['find']({'where':{'id':_0x5c4181[_0x9b6a('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0x9b6a('0xa6'),'include':[{'model':db['CmContact'],'as':_0x9b6a('0xa7'),'where':{'fax':_0x428b86},'limit':0x1,'order':[[_0x9b6a('0x9c'),'DESC']]}]}]})[_0x9b6a('0x22')](handleEntityNotFound(_0x404078,null))['then'](function(_0x399f10){_0x35faa2=_0x399f10;if(_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')]&&_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][_0x9b6a('0x49')]){for(var _0x1bfed0=0x0;_0x1bfed0<_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][_0x9b6a('0x49')];_0x1bfed0+=0x1){_0x5c4181['body']['attachments'][_0x1bfed0]={'filename':_0x5c4181[_0x9b6a('0x5b')]['attachments'][_0x1bfed0]['name'],'id':_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][_0x1bfed0]['id'],'path':path['join'](config[_0x9b6a('0xa9')],_0x9b6a('0xaa'),_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][_0x1bfed0][_0x9b6a('0xab')])};}}return respondWithRpcPromise(_0x9b6a('0xac'),'CheckAfterSend',{'FaxAccountId':_[_0x9b6a('0xad')](_0x5c4181[_0x9b6a('0x59')]['id'])?undefined:_0x5c4181[_0x9b6a('0x59')]['id'],'path':_[_0x9b6a('0xad')](_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0]['path'])?undefined:_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0][_0x9b6a('0x9')],'fax':_[_0x9b6a('0xad')](_0x5c4181[_0x9b6a('0x5b')]['to'][0x0])?undefined:_0x5c4181[_0x9b6a('0x5b')]['to'][0x0]},client9002);})[_0x9b6a('0x22')](function(){if(_0x35faa2){if(_['isNil'](_0x5c4181[_0x9b6a('0x5b')]['from'])){_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xae')]=util[_0x9b6a('0xa4')]('\x22%s\x22\x20<%s>',_0x35faa2[_0x9b6a('0x3b')],_0x35faa2[_0x9b6a('0xaf')]);}if(_0x35faa2[_0x9b6a('0xa6')]){if(_0x35faa2[_0x9b6a('0xa6')][_0x9b6a('0xa7')]['length']){return _0x35faa2[_0x9b6a('0xa6')]['Contacts'][0x0];}else{return db[_0x9b6a('0xb0')][_0x9b6a('0x5a')](_['defaults'](_0x5c4181['body'],{'firstName':_0x5c4181[_0x9b6a('0x5b')]['to'][0x0],'phone':_0x5c4181[_0x9b6a('0x5b')]['to'][0x0],'fax':_0x5c4181[_0x9b6a('0x5b')]['to'][0x0],'ListId':_0x35faa2['ListId']}));}}else{throw new Error(_0x9b6a('0xb1'));}}else{throw new Error(_0x9b6a('0xb2'));}})[_0x9b6a('0x22')](function(_0x2c010c){if(_0x2c010c){return db[_0x9b6a('0x72')][_0x9b6a('0x62')]({'where':{'ContactId':_0x2c010c['id'],'closed':![],'FaxAccountId':_0x35faa2['id']}})[_0x9b6a('0x22')](function(_0x5d03a9){if(_0x5d03a9){return[_0x5d03a9,![]];}return db['FaxInteraction'][_0x9b6a('0x5a')]({'UserId':_0x5c4181[_0x9b6a('0x5c')]['id'],'ContactId':_0x2c010c['id'],'FaxAccountId':_0x35faa2['id'],'fax':_0x5c4181[_0x9b6a('0x5b')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x9b6a('0x4e')](_0x5c4181[_0x9b6a('0x5b')],{'read':![],'body':_0x5c4181['body'][_0x9b6a('0xa8')][0x0][_0x9b6a('0xb3')],'FaxAccountId':_0x35faa2['id'],'UserId':_0x5c4181[_0x9b6a('0x5c')]['id'],'ContactId':_0x2c010c['id'],'AttachmentId':_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0x9b6a('0xa1')],'as':_0x9b6a('0xb4')}]})[_0x9b6a('0x22')](function(_0x45616c){return[_0x45616c,!![]];});});}else{throw new Error(_0x9b6a('0xb5'));}})[_0x9b6a('0xb6')](function(_0x25ae99,_0x27fd37){if(_0x27fd37){return _0x25ae99;}return db['FaxMessage'][_0x9b6a('0x5a')]({'direction':_0x9b6a('0xb7'),'read':![],'body':_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0][_0x9b6a('0xb3')],'FaxAccountId':_0x35faa2['id'],'FaxInteractionId':_0x25ae99['id'],'UserId':_0x5c4181['user']['id'],'ContactId':_0x25ae99['ContactId'],'AttachmentId':_0x5c4181['body'][_0x9b6a('0xa8')][0x0]['id']})['then'](function(_0x6628bd){_0x25ae99[_0x9b6a('0xb8')][_0x9b6a('0xb4')]=[];_0x25ae99['dataValues'][_0x9b6a('0xb4')][_0x9b6a('0x8b')](_0x6628bd[_0x9b6a('0xb8')]);return _0x25ae99;});})[_0x9b6a('0x22')](function(_0x1a97f8){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x9b6a('0xad')](_0x5c4181['params']['id'])?undefined:_0x5c4181['params']['id'],'path':_[_0x9b6a('0xad')](_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0][_0x9b6a('0x9')])?undefined:_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0][_0x9b6a('0x9')],'fax':_[_0x9b6a('0xad')](_0x5c4181[_0x9b6a('0x5b')]['to'][0x0])?undefined:_0x5c4181[_0x9b6a('0x5b')]['to'][0x0],'AttachmentId':_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0]['id']},client9002)[_0x9b6a('0x22')](function(_0x218432){logger[_0x9b6a('0x2a')](_0x9b6a('0xb9'),_0x218432);})['catch'](function(_0x5eb35c){logger['info'](_0x9b6a('0xb9'),_0x5eb35c);});return _0x1a97f8;})[_0x9b6a('0x22')](respondWithResult(_0x404078,null))[_0x9b6a('0x57')](handleError(_0x404078,null));};exports[_0x9b6a('0xba')]=function(_0x21d20e,_0x27bf24,_0x386277){return db[_0x9b6a('0x40')][_0x9b6a('0x62')]({'where':{'id':_0x21d20e[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x27bf24,null))[_0x9b6a('0x22')](function(_0x328f74){if(_0x328f74){return _0x328f74['addAgents'](_0x21d20e[_0x9b6a('0x5b')][_0x9b6a('0x6b')],_[_0x9b6a('0x73')](_0x21d20e[_0x9b6a('0x5b')],['ids','id'])||{})[_0x9b6a('0xb6')](function(_0x388377){for(var _0x291b2c=0x0;_0x291b2c<_0x21d20e[_0x9b6a('0x5b')]['ids'][_0x9b6a('0x49')];_0x291b2c+=0x1){socket[_0x9b6a('0xbb')]('userFaxAccount:save',{'UserId':_0x21d20e[_0x9b6a('0x5b')][_0x9b6a('0x6b')][_0x291b2c],'FaxAccountId':_0x21d20e[_0x9b6a('0x59')]['id']});}return _0x388377;});}})[_0x9b6a('0x22')](respondWithResult(_0x27bf24,null))[_0x9b6a('0x57')](handleError(_0x27bf24,null));};exports[_0x9b6a('0xbc')]=function(_0x435d70,_0x5184f6,_0x51aea1){return db[_0x9b6a('0x40')][_0x9b6a('0x62')]({'where':{'id':_0x435d70[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x5184f6,null))[_0x9b6a('0x22')](function(_0x4a348a){if(_0x4a348a){return _0x4a348a['removeAgents'](_0x435d70[_0x9b6a('0x43')][_0x9b6a('0x6b')])['then'](function(){if(_[_0x9b6a('0xbd')](_0x435d70[_0x9b6a('0x43')][_0x9b6a('0x6b')])){for(var _0x3c7d79=0x0;_0x3c7d79<_0x435d70[_0x9b6a('0x43')]['ids'][_0x9b6a('0x49')];_0x3c7d79+=0x1){socket[_0x9b6a('0xbb')](_0x9b6a('0xbe'),{'UserId':Number(_0x435d70[_0x9b6a('0x43')]['ids'][_0x3c7d79]),'FaxAccountId':Number(_0x435d70['params']['id'])});}}else{socket[_0x9b6a('0xbb')](_0x9b6a('0xbe'),{'UserId':Number(_0x435d70[_0x9b6a('0x43')][_0x9b6a('0x6b')]),'FaxAccountId':Number(_0x435d70[_0x9b6a('0x59')]['id'])});}});}})[_0x9b6a('0x22')](respondWithStatusCode(_0x5184f6,null))[_0x9b6a('0x57')](handleError(_0x5184f6,null));};exports[_0x9b6a('0xbf')]=function(_0x5f2469,_0x5a43f8,_0x31e516){var _0x5717a2={};var _0x28e485={};var _0x35f748;var _0x3799f9;return db['FaxAccount'][_0x9b6a('0x67')]({'where':{'id':_0x5f2469[_0x9b6a('0x59')]['id']}})['then'](handleEntityNotFound(_0x5a43f8,null))['then'](function(_0xa1a505){if(_0xa1a505){_0x35f748=_0xa1a505;_0x28e485['model']=_[_0x9b6a('0x42')](db['User'][_0x9b6a('0x41')]);_0x28e485[_0x9b6a('0x43')]=_['keys'](_0x5f2469[_0x9b6a('0x43')]);_0x28e485[_0x9b6a('0x44')]=_['intersection'](_0x28e485[_0x9b6a('0x45')],_0x28e485['query']);_0x5717a2[_0x9b6a('0x48')]=_['intersection'](_0x28e485['model'],qs[_0x9b6a('0x47')](_0x5f2469['query'][_0x9b6a('0x47')]));_0x5717a2['attributes']=_0x5717a2[_0x9b6a('0x48')]['length']?_0x5717a2['attributes']:_0x28e485[_0x9b6a('0x45')];_0x5717a2['order']=qs[_0x9b6a('0x4c')](_0x5f2469['query']['sort']);_0x5717a2[_0x9b6a('0x4f')]=qs[_0x9b6a('0x44')](_[_0x9b6a('0x68')](_0x5f2469[_0x9b6a('0x43')],_0x28e485[_0x9b6a('0x44')]));if(_0x5f2469[_0x9b6a('0x43')][_0x9b6a('0x4d')]){_0x5717a2[_0x9b6a('0x4f')]=_[_0x9b6a('0x4e')](_0x5717a2['where'],{'$or':_[_0x9b6a('0x6f')](_0x5717a2[_0x9b6a('0x48')],function(_0x11da13){var _0x1d9ab={};_0x1d9ab[_0x11da13]={'$like':'%'+_0x5f2469[_0x9b6a('0x43')][_0x9b6a('0x4d')]+'%'};return _0x1d9ab;})});}_0x5717a2=_[_0x9b6a('0x4e')]({},_0x5717a2,_0x5f2469['options']);return _0x35f748[_0x9b6a('0xbf')](_0x5717a2);}})['then'](function(_0x1c8a6e){if(_0x1c8a6e){_0x3799f9=_0x1c8a6e[_0x9b6a('0x49')];if(!_0x5f2469[_0x9b6a('0x43')]['hasOwnProperty'](_0x9b6a('0x4a'))){_0x5717a2[_0x9b6a('0x31')]=qs[_0x9b6a('0x31')](_0x5f2469[_0x9b6a('0x43')][_0x9b6a('0x31')]);_0x5717a2[_0x9b6a('0x30')]=qs['offset'](_0x5f2469[_0x9b6a('0x43')][_0x9b6a('0x30')]);}return _0x35f748[_0x9b6a('0xbf')](_0x5717a2);}})[_0x9b6a('0x22')](function(_0x29fd58){if(_0x29fd58){return _0x29fd58?{'count':_0x3799f9,'rows':_0x29fd58}:null;}})[_0x9b6a('0x22')](respondWithResult(_0x5a43f8,null))[_0x9b6a('0x57')](handleError(_0x5a43f8,null));};
\ No newline at end of file
+var _0x847d=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','FaxAccountId','Disposition','getDispositions','nolimit','pick','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','fullname','internal','Tag','color','tag','addApplications','sequelize','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','localstationid','app','system','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','minrate','modem','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','updateAccountApplications','VoiceExtension','tech','key','createdAt','ListId','findById','getMessages','FaxMessage','$gte','split','format','send','CmList','Contacts','updatedAt','DESC','attachments','root','basename','CheckAfterSend','isNil','from','List','defaults','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','userFaxAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','update','then','destroy','get','FaxAccounts','end','stack','name','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','VIRTUAL','options','count','include','findAll','rows','show','params','includeAll'];(function(_0x16066e,_0x31e151){var _0x52a12e=function(_0x3e6bed){while(--_0x3e6bed){_0x16066e['push'](_0x16066e['shift']());}};_0x52a12e(++_0x31e151);}(_0x847d,0x125));var _0xd847=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x847d[_0x3203a1];return _0x24215e;};'use strict';var pdf=require(_0xd847('0x0'));var emlformat=require(_0xd847('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd847('0x2'));var jsonpatch=require(_0xd847('0x3'));var rp=require(_0xd847('0x4'));var moment=require(_0xd847('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd847('0x6'));var util=require(_0xd847('0x7'));var path=require(_0xd847('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd847('0x9'));var fs=require('fs');var _=require(_0xd847('0xa'));var squel=require(_0xd847('0xb'));var crypto=require(_0xd847('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd847('0xd'));var querystring=require('querystring');var Papa=require(_0xd847('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd847('0xf'));var hardwareService=require(_0xd847('0x10'));var logger=require(_0xd847('0x11'))(_0xd847('0x12'));var utils=require(_0xd847('0x13'));var config=require(_0xd847('0x14'));var db=require(_0xd847('0x15'))['db'];config[_0xd847('0x16')]=_['defaults'](config[_0xd847('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xd847('0x17'))(new Redis(config[_0xd847('0x16')]));require(_0xd847('0x18'))[_0xd847('0x19')](socket);var jayson=require(_0xd847('0x1a'));var client=jayson[_0xd847('0x1b')][_0xd847('0x1c')]({'port':0x232c});var client9002=jayson[_0xd847('0x1b')][_0xd847('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x110f34,_0x4817ad,_0x3951e1){if(_0x3951e1){var _0x378e1d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x378e1d[_0xd847('0x1d')](_0x4817ad)){return _0x110f34;}else{throw new Error(_0xd847('0x1e'));}}else{return _0x110f34;}}function respondWithRpcPromise(_0x569613,_0xef6536,_0xef0dcd,_0x566aae){return new BPromise(function(_0x3da20b,_0x306dc6){var _0x3d5fc4=_0x566aae||client;return _0x3d5fc4[_0xd847('0x1f')](_0x569613,_0xef0dcd)['then'](function(_0x27ba8a){logger[_0xd847('0x20')](_0xd847('0x21'),_0xef6536,'request\x20sent');logger[_0xd847('0x22')](_0xd847('0x23'),_0xef6536,_0xd847('0x24'),JSON[_0xd847('0x25')](_0x27ba8a));if(_0x27ba8a[_0xd847('0x26')]){if(_0x27ba8a[_0xd847('0x26')][_0xd847('0x27')]===0x1f4){logger[_0xd847('0x26')](_0xd847('0x21'),_0xef6536,_0x27ba8a['error']['message']);return _0x306dc6(_0x27ba8a[_0xd847('0x26')][_0xd847('0x28')]);}logger[_0xd847('0x26')](_0xd847('0x21'),_0xef6536,_0x27ba8a[_0xd847('0x26')][_0xd847('0x28')]);return _0x3da20b(_0x27ba8a['error']['message']);}else{logger[_0xd847('0x20')](_0xd847('0x21'),_0xef6536,_0xd847('0x24'));_0x3da20b(_0x27ba8a[_0xd847('0x29')]['message']);}})[_0xd847('0x2a')](function(_0x32411a){logger['error']('FaxAccount,\x20%s,\x20%s',_0xef6536,_0x32411a);_0x306dc6(_0x32411a);});});}function respondWithStatusCode(_0x5bfa71,_0x1174ec){_0x1174ec=_0x1174ec||0xcc;return function(_0x8fa3e3){if(_0x8fa3e3){return _0x5bfa71[_0xd847('0x2b')](_0x1174ec);}return _0x5bfa71[_0xd847('0x2c')](_0x1174ec)['end']();};}function respondWithResult(_0xc3a2c9,_0x12f9c5){_0x12f9c5=_0x12f9c5||0xc8;return function(_0xb999b5){if(_0xb999b5){return _0xc3a2c9[_0xd847('0x2c')](_0x12f9c5)[_0xd847('0x2d')](_0xb999b5);}};}function respondWithFilteredResult(_0x364c85,_0x582d41){return function(_0xc14568){if(_0xc14568){var _0x1bedd4=_0xc14568['count'],_0x344b8e=_0x582d41['offset'],_0x5c90b4=_0x582d41[_0xd847('0x2e')]+_0x582d41[_0xd847('0x2f')],_0x3f3102;if(_0x5c90b4>=_0x1bedd4){_0x5c90b4=_0x1bedd4;_0x3f3102=0xc8;}else{_0x3f3102=0xce;}_0x364c85[_0xd847('0x2c')](_0x3f3102);return _0x364c85[_0xd847('0x30')](_0xd847('0x31'),_0x344b8e+'-'+_0x5c90b4+'/'+_0x1bedd4)['json'](_0xc14568);}return null;};}function patchUpdates(_0x4586de){return function(_0x50b636){try{jsonpatch[_0xd847('0x32')](_0x50b636,_0x4586de,!![]);}catch(_0x47654c){return BPromise['reject'](_0x47654c);}return _0x50b636['save']();};}function saveUpdates(_0x3e7975,_0x56666a){return function(_0x58534b){if(_0x58534b){return _0x58534b[_0xd847('0x33')](_0x3e7975)[_0xd847('0x34')](function(_0x42049a){return _0x42049a;});}return null;};}function removeEntity(_0xe52066,_0x47aeeb){return function(_0x1abac1){if(_0x1abac1){return _0x1abac1[_0xd847('0x35')]()[_0xd847('0x34')](function(){var _0x4f17f5=_0x1abac1[_0xd847('0x36')]({'plain':!![]});var _0x359295=_0xd847('0x37');return db['UserProfileResource'][_0xd847('0x35')]({'where':{'type':_0x359295,'resourceId':_0x4f17f5['id']}})['then'](function(){return _0x1abac1;});})['then'](function(){_0xe52066[_0xd847('0x2c')](0xcc)[_0xd847('0x38')]();});}};}function handleEntityNotFound(_0x1c7ab7,_0x328c97){return function(_0x4d2eb1){if(!_0x4d2eb1){_0x1c7ab7['sendStatus'](0x194);}return _0x4d2eb1;};}function handleError(_0xf7ed4a,_0x35acbf){_0x35acbf=_0x35acbf||0x1f4;return function(_0x13cced){logger[_0xd847('0x26')](_0x13cced[_0xd847('0x39')]);if(_0x13cced[_0xd847('0x3a')]){delete _0x13cced[_0xd847('0x3a')];}_0xf7ed4a[_0xd847('0x2c')](_0x35acbf)['send'](_0x13cced);};}exports[_0xd847('0x3b')]=function(_0x1327a7,_0x1bfbed){var _0xf63fe8={'include':[{'model':db[_0xd847('0x3c')],'as':_0xd847('0x3d')}]},_0x4d34eb={},_0x1ff308={'count':0x0,'rows':[]};var _0x9824de=db[_0xd847('0x3e')][_0xd847('0x3f')];_0x4d34eb[_0xd847('0x40')]=_[_0xd847('0x41')](_0x9824de);_0x4d34eb[_0xd847('0x42')]=_[_0xd847('0x41')](_0x1327a7[_0xd847('0x42')]);_0x4d34eb['filters']=_[_0xd847('0x43')](_0x4d34eb[_0xd847('0x40')],_0x4d34eb[_0xd847('0x42')]);_0xf63fe8[_0xd847('0x44')]=_[_0xd847('0x43')](_0x4d34eb[_0xd847('0x40')],qs[_0xd847('0x45')](_0x1327a7[_0xd847('0x42')][_0xd847('0x45')]));_0xf63fe8[_0xd847('0x44')]=_0xf63fe8['attributes'][_0xd847('0x46')]?_0xf63fe8[_0xd847('0x44')]:_0x4d34eb['model'];if(!_0x1327a7['query'][_0xd847('0x47')]('nolimit')){_0xf63fe8['limit']=qs[_0xd847('0x2f')](_0x1327a7[_0xd847('0x42')][_0xd847('0x2f')]);_0xf63fe8[_0xd847('0x2e')]=qs[_0xd847('0x2e')](_0x1327a7['query'][_0xd847('0x2e')]);}_0xf63fe8[_0xd847('0x48')]=qs[_0xd847('0x49')](_0x1327a7['query'][_0xd847('0x49')]);_0xf63fe8['where']=qs[_0xd847('0x4a')](_['pick'](_0x1327a7[_0xd847('0x42')],_0x4d34eb[_0xd847('0x4a')]));if(_0x1327a7[_0xd847('0x42')][_0xd847('0x4b')]){_0xf63fe8['where']=_[_0xd847('0x4c')](_0xf63fe8[_0xd847('0x4d')],{'$or':_[_0xd847('0x4e')](_0x9824de,function(_0x278c96){if(_0x278c96[_0xd847('0x4f')]['key']!==_0xd847('0x50')){var _0x9a1bb6={};_0x9a1bb6[_0x278c96['field']]={'$like':'%'+_0x1327a7[_0xd847('0x42')]['filter']+'%'};return _0x9a1bb6;}})});}_0xf63fe8=_[_0xd847('0x4c')]({},_0xf63fe8,_0x1327a7[_0xd847('0x51')]);var _0x2aa29d={'where':_0xf63fe8[_0xd847('0x4d')]};return db['FaxAccount'][_0xd847('0x52')](_0x2aa29d)[_0xd847('0x34')](function(_0x1d5f09){_0x1ff308[_0xd847('0x52')]=_0x1d5f09;if(_0x1327a7[_0xd847('0x42')]['includeAll']){_0xf63fe8[_0xd847('0x53')]=[{'all':!![]}];}return db[_0xd847('0x3e')][_0xd847('0x54')](_0xf63fe8);})[_0xd847('0x34')](function(_0xaf071){_0x1ff308[_0xd847('0x55')]=_0xaf071;return _0x1ff308;})[_0xd847('0x34')](respondWithFilteredResult(_0x1bfbed,_0xf63fe8))[_0xd847('0x2a')](handleError(_0x1bfbed,null));};exports[_0xd847('0x56')]=function(_0x49a0cc,_0x4c23af){var _0x51052c={'raw':![],'where':{'id':_0x49a0cc[_0xd847('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x52e187={};_0x52e187[_0xd847('0x40')]=_['keys'](db[_0xd847('0x3e')][_0xd847('0x3f')]);_0x52e187[_0xd847('0x42')]=_[_0xd847('0x41')](_0x49a0cc[_0xd847('0x42')]);_0x52e187[_0xd847('0x4a')]=_['intersection'](_0x52e187[_0xd847('0x40')],_0x52e187[_0xd847('0x42')]);_0x51052c[_0xd847('0x44')]=_['intersection'](_0x52e187[_0xd847('0x40')],qs[_0xd847('0x45')](_0x49a0cc[_0xd847('0x42')][_0xd847('0x45')]));_0x51052c[_0xd847('0x44')]=_0x51052c[_0xd847('0x44')][_0xd847('0x46')]?_0x51052c[_0xd847('0x44')]:_0x52e187[_0xd847('0x40')];if(_0x49a0cc['query'][_0xd847('0x58')]){_0x51052c[_0xd847('0x53')]=[{'all':!![]}];}_0x51052c=_[_0xd847('0x4c')]({},_0x51052c,_0x49a0cc[_0xd847('0x51')]);return db[_0xd847('0x3e')][_0xd847('0x59')](_0x51052c)[_0xd847('0x34')](handleEntityNotFound(_0x4c23af,null))['then'](respondWithResult(_0x4c23af,null))[_0xd847('0x2a')](handleError(_0x4c23af,null));};exports[_0xd847('0x5a')]=function(_0x82e01c,_0x4f1035){return db['FaxAccount'][_0xd847('0x5a')](_0x82e01c[_0xd847('0x5b')],{})['then'](function(_0x33e5b9){var _0x4639d3=_0x82e01c[_0xd847('0x5c')]['get']({'plain':!![]});if(!_0x4639d3)throw new Error(_0xd847('0x5d'));if(_0x4639d3[_0xd847('0x5e')]===_0xd847('0x5c')){var _0x1c679a=_0x33e5b9['get']({'plain':!![]});var _0xef6ab0=_0xd847('0x37');return db['UserProfileSection'][_0xd847('0x59')]({'where':{'name':_0xef6ab0,'userProfileId':_0x4639d3[_0xd847('0x5f')]},'raw':!![]})[_0xd847('0x34')](function(_0x55d2e0){if(_0x55d2e0&&_0x55d2e0[_0xd847('0x60')]===0x0){return db[_0xd847('0x61')][_0xd847('0x5a')]({'name':_0x1c679a[_0xd847('0x3a')],'resourceId':_0x1c679a['id'],'type':_0x55d2e0[_0xd847('0x3a')],'sectionId':_0x55d2e0['id']},{})[_0xd847('0x34')](function(){return _0x33e5b9;});}else{return _0x33e5b9;}})['catch'](function(_0x16791b){logger[_0xd847('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16791b);throw _0x16791b;});}return _0x33e5b9;})[_0xd847('0x34')](respondWithResult(_0x4f1035,0xc9))['catch'](handleError(_0x4f1035,null));};exports[_0xd847('0x33')]=function(_0x568515,_0x2d87fc){if(_0x568515[_0xd847('0x5b')]['id']){delete _0x568515[_0xd847('0x5b')]['id'];}return db[_0xd847('0x3e')][_0xd847('0x59')]({'where':{'id':_0x568515[_0xd847('0x57')]['id']},'include':[{'model':db[_0xd847('0x3c')],'as':_0xd847('0x3d')}]})['then'](handleEntityNotFound(_0x2d87fc,null))[_0xd847('0x34')](saveUpdates(_0x568515['body'],null))[_0xd847('0x34')](respondWithResult(_0x2d87fc,null))[_0xd847('0x2a')](handleError(_0x2d87fc,null));};exports[_0xd847('0x35')]=function(_0x572b13,_0x43c14d){return db[_0xd847('0x3e')][_0xd847('0x59')]({'where':{'id':_0x572b13[_0xd847('0x57')]['id']}})[_0xd847('0x34')](handleEntityNotFound(_0x43c14d,null))[_0xd847('0x34')](removeEntity(_0x43c14d,null))['catch'](handleError(_0x43c14d,null));};exports[_0xd847('0x62')]=function(_0x827503,_0x51f498){return db[_0xd847('0x3e')][_0xd847('0x62')]()[_0xd847('0x34')](respondWithResult(_0x51f498,null))[_0xd847('0x2a')](handleError(_0x51f498,null));};exports[_0xd847('0x63')]=function(_0x1cd503,_0x52b627,_0x10a117){if(_0x1cd503[_0xd847('0x5b')]['id']){delete _0x1cd503[_0xd847('0x5b')]['id'];}return db[_0xd847('0x3e')][_0xd847('0x59')]({'where':{'id':_0x1cd503[_0xd847('0x57')]['id']}})[_0xd847('0x34')](handleEntityNotFound(_0x52b627,null))[_0xd847('0x34')](function(_0x1194f9){if(_0x1194f9){_0x1cd503['body'][_0xd847('0x64')]=_0x1194f9['id'];return db[_0xd847('0x65')][_0xd847('0x5a')](_0x1cd503[_0xd847('0x5b')]);}})['then'](respondWithResult(_0x52b627,null))[_0xd847('0x2a')](handleError(_0x52b627,null));};exports[_0xd847('0x66')]=function(_0x304256,_0x4d0c45,_0x152a8c){var _0x5f0cbf={'raw':![],'where':{}};var _0x33d188={};var _0x3f16b2={'count':0x0,'rows':[]};return db[_0xd847('0x3e')]['findOne']({'where':{'id':_0x304256[_0xd847('0x57')]['id']}})[_0xd847('0x34')](handleEntityNotFound(_0x4d0c45,null))['then'](function(_0x16ffb1){if(_0x16ffb1){_0x33d188['model']=_[_0xd847('0x41')](db['Disposition'][_0xd847('0x3f')]);_0x33d188[_0xd847('0x42')]=_[_0xd847('0x41')](_0x304256[_0xd847('0x42')]);_0x33d188[_0xd847('0x4a')]=_[_0xd847('0x43')](_0x33d188[_0xd847('0x40')],_0x33d188[_0xd847('0x42')]);_0x5f0cbf[_0xd847('0x44')]=_[_0xd847('0x43')](_0x33d188['model'],qs[_0xd847('0x45')](_0x304256[_0xd847('0x42')][_0xd847('0x45')]));_0x5f0cbf[_0xd847('0x44')]=_0x5f0cbf[_0xd847('0x44')]['length']?_0x5f0cbf['attributes']:_0x33d188['model'];if(!_0x304256[_0xd847('0x42')][_0xd847('0x47')](_0xd847('0x67'))){_0x5f0cbf['limit']=qs[_0xd847('0x2f')](_0x304256[_0xd847('0x42')][_0xd847('0x2f')]);_0x5f0cbf[_0xd847('0x2e')]=qs['offset'](_0x304256['query'][_0xd847('0x2e')]);}_0x5f0cbf[_0xd847('0x48')]=qs['sort'](_0x304256[_0xd847('0x42')]['sort']);_0x5f0cbf[_0xd847('0x4d')]=qs[_0xd847('0x4a')](_[_0xd847('0x68')](_0x304256[_0xd847('0x42')],_0x33d188[_0xd847('0x4a')]));_0x5f0cbf['where'][_0xd847('0x64')]=_0x16ffb1['id'];if(_0x304256[_0xd847('0x42')]['filter']){_0x5f0cbf[_0xd847('0x4d')]=_[_0xd847('0x4c')](_0x5f0cbf['where'],{'$or':_[_0xd847('0x4e')](_0x5f0cbf[_0xd847('0x44')],function(_0x2aaf28){var _0xbd0268={};_0xbd0268[_0x2aaf28]={'$like':'%'+_0x304256[_0xd847('0x42')][_0xd847('0x4b')]+'%'};return _0xbd0268;})});}_0x5f0cbf=_[_0xd847('0x4c')]({},_0x5f0cbf,_0x304256['options']);return db['Disposition']['count']({'where':_0x5f0cbf['where']})[_0xd847('0x34')](function(_0xe92b32){_0x3f16b2[_0xd847('0x52')]=_0xe92b32;if(_0x304256[_0xd847('0x42')][_0xd847('0x58')]){_0x5f0cbf[_0xd847('0x53')]=[{'all':!![]}];}return db[_0xd847('0x65')]['findAll'](_0x5f0cbf);})[_0xd847('0x34')](function(_0x23c10f){_0x3f16b2['rows']=_0x23c10f;return _0x3f16b2;});}})[_0xd847('0x34')](respondWithFilteredResult(_0x4d0c45,_0x5f0cbf))[_0xd847('0x2a')](handleError(_0x4d0c45,null));};exports['removeDispositions']=function(_0x39fcd7,_0x536095,_0xc53b86){return db[_0xd847('0x3e')]['find']({'where':{'id':_0x39fcd7[_0xd847('0x57')]['id']}})[_0xd847('0x34')](handleEntityNotFound(_0x536095,null))['then'](function(_0xb6a2a6){if(_0xb6a2a6){return _0xb6a2a6[_0xd847('0x69')](_0x39fcd7[_0xd847('0x42')][_0xd847('0x6a')]);}})[_0xd847('0x34')](respondWithStatusCode(_0x536095,null))[_0xd847('0x2a')](handleError(_0x536095,null));};exports[_0xd847('0x6b')]=function(_0x163856,_0x134ddf,_0x545a94){if(_0x163856[_0xd847('0x5b')]['id']){delete _0x163856[_0xd847('0x5b')]['id'];}return db[_0xd847('0x3e')]['find']({'where':{'id':_0x163856[_0xd847('0x57')]['id']}})['then'](handleEntityNotFound(_0x134ddf,null))['then'](function(_0x42b4be){if(_0x42b4be){_0x163856[_0xd847('0x5b')][_0xd847('0x64')]=_0x42b4be['id'];return db['CannedAnswer'][_0xd847('0x5a')](_0x163856[_0xd847('0x5b')]);}})[_0xd847('0x34')](respondWithResult(_0x134ddf,null))[_0xd847('0x2a')](handleError(_0x134ddf,null));};exports[_0xd847('0x6c')]=function(_0x1dc5c3,_0x46b365,_0x3cda53){var _0x542b6f={'raw':![],'where':{}};var _0x1707f9={};var _0x526b69={'count':0x0,'rows':[]};return db[_0xd847('0x3e')][_0xd847('0x6d')]({'where':{'id':_0x1dc5c3[_0xd847('0x57')]['id']}})[_0xd847('0x34')](handleEntityNotFound(_0x46b365,null))[_0xd847('0x34')](function(_0x334851){if(_0x334851){_0x1707f9[_0xd847('0x40')]=_[_0xd847('0x41')](db[_0xd847('0x6e')][_0xd847('0x3f')]);_0x1707f9[_0xd847('0x42')]=_['keys'](_0x1dc5c3[_0xd847('0x42')]);_0x1707f9[_0xd847('0x4a')]=_[_0xd847('0x43')](_0x1707f9[_0xd847('0x40')],_0x1707f9[_0xd847('0x42')]);_0x542b6f[_0xd847('0x44')]=_[_0xd847('0x43')](_0x1707f9[_0xd847('0x40')],qs[_0xd847('0x45')](_0x1dc5c3['query']['fields']));_0x542b6f[_0xd847('0x44')]=_0x542b6f[_0xd847('0x44')][_0xd847('0x46')]?_0x542b6f[_0xd847('0x44')]:_0x1707f9['model'];if(!_0x1dc5c3[_0xd847('0x42')][_0xd847('0x47')](_0xd847('0x67'))){_0x542b6f[_0xd847('0x2f')]=qs[_0xd847('0x2f')](_0x1dc5c3[_0xd847('0x42')][_0xd847('0x2f')]);_0x542b6f[_0xd847('0x2e')]=qs[_0xd847('0x2e')](_0x1dc5c3[_0xd847('0x42')][_0xd847('0x2e')]);}_0x542b6f['order']=qs['sort'](_0x1dc5c3[_0xd847('0x42')][_0xd847('0x49')]);_0x542b6f['where']=qs[_0xd847('0x4a')](_[_0xd847('0x68')](_0x1dc5c3[_0xd847('0x42')],_0x1707f9[_0xd847('0x4a')]));_0x542b6f[_0xd847('0x4d')]['FaxAccountId']=_0x334851['id'];if(_0x1dc5c3['query'][_0xd847('0x4b')]){_0x542b6f[_0xd847('0x4d')]=_[_0xd847('0x4c')](_0x542b6f[_0xd847('0x4d')],{'$or':_['map'](_0x542b6f[_0xd847('0x44')],function(_0x584f54){var _0x4c8302={};_0x4c8302[_0x584f54]={'$like':'%'+_0x1dc5c3[_0xd847('0x42')]['filter']+'%'};return _0x4c8302;})});}_0x542b6f=_[_0xd847('0x4c')]({},_0x542b6f,_0x1dc5c3[_0xd847('0x51')]);return db['CannedAnswer']['count']({'where':_0x542b6f[_0xd847('0x4d')]})['then'](function(_0x4cad8d){_0x526b69[_0xd847('0x52')]=_0x4cad8d;if(_0x1dc5c3[_0xd847('0x42')]['includeAll']){_0x542b6f[_0xd847('0x53')]=[{'all':!![]}];}return db[_0xd847('0x6e')]['findAll'](_0x542b6f);})[_0xd847('0x34')](function(_0x33d6bd){_0x526b69['rows']=_0x33d6bd;return _0x526b69;});}})[_0xd847('0x34')](respondWithFilteredResult(_0x46b365,_0x542b6f))[_0xd847('0x2a')](handleError(_0x46b365,null));};exports[_0xd847('0x6f')]=function(_0x53a3dd,_0x52179c,_0x443ea2){return db[_0xd847('0x3e')][_0xd847('0x59')]({'where':{'id':_0x53a3dd['params']['id']}})[_0xd847('0x34')](handleEntityNotFound(_0x52179c,null))['then'](function(_0x1d5e65){if(_0x1d5e65){return _0x1d5e65[_0xd847('0x6f')](_0x53a3dd[_0xd847('0x42')][_0xd847('0x6a')]);}})[_0xd847('0x34')](respondWithStatusCode(_0x52179c,null))[_0xd847('0x2a')](handleError(_0x52179c,null));};exports[_0xd847('0x70')]=function(_0x348d0d,_0x356cbd,_0x1cc00f){return db[_0xd847('0x71')]['find']({'where':{'id':_0x348d0d['params']['id']}})['then'](handleEntityNotFound(_0x356cbd,null))[_0xd847('0x34')](function(_0x56330f){if(_0x56330f){return _0x56330f['addInteraction'](_0x348d0d['body'][_0xd847('0x6a')],_[_0xd847('0x72')](_0x348d0d['body'],[_0xd847('0x6a'),'id'])||{});}})[_0xd847('0x34')](respondWithResult(_0x356cbd,null))[_0xd847('0x2a')](handleError(_0x356cbd,null));};exports[_0xd847('0x73')]=function(_0x108641,_0x5269a8,_0x1b4dc3){var _0x1dcc19={'raw':![],'where':{}};var _0x1221d2={};var _0x1719f1={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd847('0x6d')]({'where':{'id':_0x108641[_0xd847('0x57')]['id']}})[_0xd847('0x34')](handleEntityNotFound(_0x5269a8,null))[_0xd847('0x34')](function(_0x4cba5e){if(_0x4cba5e){_0x1221d2[_0xd847('0x40')]=_[_0xd847('0x41')](db['FaxInteraction'][_0xd847('0x3f')]);_0x1221d2[_0xd847('0x42')]=_['keys'](_0x108641[_0xd847('0x42')]);_0x1221d2[_0xd847('0x4a')]=_[_0xd847('0x43')](_0x1221d2[_0xd847('0x40')],_0x1221d2[_0xd847('0x42')]);_0x1dcc19[_0xd847('0x44')]=_[_0xd847('0x43')](_0x1221d2[_0xd847('0x40')],qs['fields'](_0x108641['query'][_0xd847('0x45')]));_0x1dcc19[_0xd847('0x44')]=_0x1dcc19[_0xd847('0x44')]['length']?_0x1dcc19[_0xd847('0x44')]:_0x1221d2['model'];if(!_0x108641['query'][_0xd847('0x47')](_0xd847('0x67'))){_0x1dcc19[_0xd847('0x2f')]=qs['limit'](_0x108641['query'][_0xd847('0x2f')]);_0x1dcc19[_0xd847('0x2e')]=qs[_0xd847('0x2e')](_0x108641['query'][_0xd847('0x2e')]);}_0x1dcc19[_0xd847('0x48')]=qs[_0xd847('0x49')](_0x108641[_0xd847('0x42')][_0xd847('0x49')]);_0x1dcc19['where']=qs[_0xd847('0x4a')](_[_0xd847('0x68')](_0x108641[_0xd847('0x42')],_0x1221d2['filters']));_0x1dcc19[_0xd847('0x4d')][_0xd847('0x64')]=_0x4cba5e['id'];if(_0x108641['query'][_0xd847('0x4b')]){_0x1dcc19['where']=_[_0xd847('0x4c')](_0x1dcc19[_0xd847('0x4d')],{'$or':_[_0xd847('0x4e')](_0x1dcc19[_0xd847('0x44')],function(_0xe4b4b7){var _0x5c466e={};_0x5c466e[_0xe4b4b7]={'$like':'%'+_0x108641[_0xd847('0x42')][_0xd847('0x4b')]+'%'};return _0x5c466e;})});}_0x1dcc19=_[_0xd847('0x4c')]({},_0x1dcc19,_0x108641[_0xd847('0x51')]);return db['FaxInteraction'][_0xd847('0x52')]({'where':_0x1dcc19['where']})[_0xd847('0x34')](function(_0x3bc629){_0x1719f1[_0xd847('0x52')]=_0x3bc629;if(_0x108641[_0xd847('0x42')][_0xd847('0x58')]){_0x1dcc19[_0xd847('0x53')]=[{'model':db[_0xd847('0x74')],'as':'Contact','required':![]},{'model':db[_0xd847('0x75')],'as':'Owner','attributes':[_0xd847('0x3a'),_0xd847('0x76'),_0xd847('0x77')],'required':![]},{'model':db[_0xd847('0x78')],'as':'Tags','attributes':['id',_0xd847('0x3a'),_0xd847('0x79')],'where':_0x108641[_0xd847('0x42')][_0xd847('0x7a')]?{'id':_0x108641['query'][_0xd847('0x7a')]}:undefined,'required':_0x108641[_0xd847('0x42')][_0xd847('0x7a')]?!![]:![]}];}return db[_0xd847('0x71')][_0xd847('0x54')](_0x1dcc19);})['then'](function(_0x3aab65){_0x1719f1['rows']=_0x3aab65;return _0x1719f1;});}})['then'](respondWithFilteredResult(_0x5269a8,_0x1dcc19))[_0xd847('0x2a')](handleError(_0x5269a8,null));};exports[_0xd847('0x7b')]=function(_0x17d5b5,_0x41a759,_0x5acde0){return db[_0xd847('0x3e')][_0xd847('0x6d')]({'where':{'id':_0x17d5b5[_0xd847('0x57')]['id']}})[_0xd847('0x34')](handleEntityNotFound(_0x41a759,null))[_0xd847('0x34')](function(_0x49a2a6){if(_0x49a2a6){return db[_0xd847('0x7c')]['transaction'](function(_0x4bf3df){return db[_0xd847('0x7d')][_0xd847('0x35')]({'where':{'FaxAccountId':_0x17d5b5['params']['id']},'transaction':_0x4bf3df})[_0xd847('0x34')](function(_0x2fecd7){var _0x38b712=_[_0xd847('0x4e')](_0x17d5b5[_0xd847('0x5b')],function(_0x365e56){_0x365e56[_0xd847('0x64')]=_0x17d5b5['params']['id'];return _0x365e56;});return db[_0xd847('0x7d')][_0xd847('0x7e')](_0x38b712,{'transaction':_0x4bf3df});});})[_0xd847('0x34')](function(){return db[_0xd847('0x7d')][_0xd847('0x7f')]({'where':{'FaxAccountId':_0x17d5b5[_0xd847('0x57')]['id']},'order':'priority'});});}})[_0xd847('0x34')](respondWithResult(_0x41a759,null))[_0xd847('0x2a')](handleError(_0x41a759,null));};exports[_0xd847('0x80')]=function(_0x156778,_0x3444ac,_0x44ff3f){var _0x41a94f={};var _0x49e544={};var _0x29c74f;var _0x501702;return db[_0xd847('0x3e')]['findOne']({'where':{'id':_0x156778[_0xd847('0x57')]['id']}})[_0xd847('0x34')](handleEntityNotFound(_0x3444ac,null))[_0xd847('0x34')](function(_0x5d0c34){if(_0x5d0c34){_0x29c74f=_0x5d0c34;_0x49e544[_0xd847('0x40')]=_[_0xd847('0x41')](db['FaxApplication'][_0xd847('0x3f')]);_0x49e544[_0xd847('0x42')]=_[_0xd847('0x41')](_0x156778['query']);_0x49e544[_0xd847('0x4a')]=_[_0xd847('0x43')](_0x49e544[_0xd847('0x40')],_0x49e544['query']);_0x41a94f[_0xd847('0x44')]=_['intersection'](_0x49e544[_0xd847('0x40')],qs['fields'](_0x156778[_0xd847('0x42')][_0xd847('0x45')]));_0x41a94f[_0xd847('0x44')]=_0x41a94f[_0xd847('0x44')][_0xd847('0x46')]?_0x41a94f['attributes']:_0x49e544['model'];_0x41a94f[_0xd847('0x48')]=qs[_0xd847('0x49')](_0x156778['query']['sort']);_0x41a94f[_0xd847('0x4d')]=qs[_0xd847('0x4a')](_[_0xd847('0x68')](_0x156778[_0xd847('0x42')],_0x49e544[_0xd847('0x4a')]));if(_0x156778[_0xd847('0x42')]['filter']){_0x41a94f[_0xd847('0x4d')]=_['merge'](_0x41a94f[_0xd847('0x4d')],{'$or':_[_0xd847('0x4e')](_0x41a94f[_0xd847('0x44')],function(_0x5e5827){var _0x3811e2={};_0x3811e2[_0x5e5827]={'$like':'%'+_0x156778[_0xd847('0x42')][_0xd847('0x4b')]+'%'};return _0x3811e2;})});}_0x41a94f=_[_0xd847('0x4c')]({},_0x41a94f,_0x156778[_0xd847('0x51')]);return _0x29c74f[_0xd847('0x80')](_0x41a94f);}})[_0xd847('0x34')](function(_0x2955fe){if(_0x2955fe){_0x501702=_0x2955fe[_0xd847('0x46')];if(!_0x156778[_0xd847('0x42')]['hasOwnProperty'](_0xd847('0x67'))){_0x41a94f[_0xd847('0x2f')]=qs['limit'](_0x156778['query'][_0xd847('0x2f')]);_0x41a94f[_0xd847('0x2e')]=qs[_0xd847('0x2e')](_0x156778[_0xd847('0x42')][_0xd847('0x2e')]);}return _0x29c74f[_0xd847('0x80')](_0x41a94f);}})['then'](function(_0x555b9d){if(_0x555b9d){return _0x555b9d?{'count':_0x501702,'rows':_0x555b9d}:null;}})[_0xd847('0x34')](respondWithResult(_0x3444ac,null))['catch'](handleError(_0x3444ac,null));};function Extension(_0x205e6b,_0x2b049d,_0x28a285,_0x278f64){this[_0xd847('0x81')]=_0xd847('0x82');this['exten']=_0x205e6b[_0xd847('0x83')];this[_0xd847('0x84')]=_0x278f64;this[_0xd847('0x4f')]=_0xd847('0x85');this[_0xd847('0x86')]='Fax\x20Extension';this[_0xd847('0x64')]=_0x205e6b['id'];this['priority']=_0x2b049d;this[_0xd847('0x87')]=_0x28a285;}function createExtensionsReciveFax(_0x22b530){var _0x55a80c=0x1;var _0x1413ed=[];_0x1413ed[_0xd847('0x88')](new Extension(_0x22b530,_0x55a80c,'',_0xd847('0x89')));_0x55a80c+=0x1;_0x1413ed[_0xd847('0x88')](new Extension(_0x22b530,_0x55a80c,_0xd847('0x8a'),_0xd847('0x8b')));_0x55a80c+=0x1;for(var _0x11bdd3 in _0x22b530){if(_0x22b530[_0xd847('0x47')](_0x11bdd3)&&(_0x11bdd3===_0xd847('0x8c')||_0x11bdd3===_0xd847('0x83')||_0x11bdd3===_0xd847('0x8d')||_0x11bdd3===_0xd847('0x8e')||_0x11bdd3==='headerinfo'||_0x11bdd3===_0xd847('0x8f')||_0x11bdd3===_0xd847('0x90')||_0x11bdd3===_0xd847('0x91')||_0x11bdd3==='t38timeout')){_0x1413ed[_0xd847('0x88')](new Extension(_0x22b530,_0x55a80c,_0xd847('0x92')+_0x11bdd3+')='+_0x22b530[_0x11bdd3],_0xd847('0x8b')));_0x55a80c+=0x1;}}_0x1413ed[_0xd847('0x88')](new Extension(_0x22b530,_0x55a80c,'6',_0xd847('0x93')));_0x55a80c+=0x1;_0x1413ed[_0xd847('0x88')](new Extension(_0x22b530,_0x55a80c,_0xd847('0x94'),_0xd847('0x95')));_0x55a80c=0x0;return _0x1413ed;}exports[_0xd847('0x96')]=function(_0x7d8a5a,_0x509abd,_0x5f0899){var _0x347cd0;return db['sequelize'][_0xd847('0x97')](function(_0x52abd3){return db[_0xd847('0x3e')][_0xd847('0x5a')](_0x7d8a5a[_0xd847('0x5b')],{'transaction':_0x52abd3})['then'](function(_0x206bdb){_0x347cd0=_0x206bdb['get']({'plain':!![]});return db['VoiceExtension'][_0xd847('0x7e')](createExtensionsReciveFax(_0x347cd0),{'transaction':_0x52abd3});});})[_0xd847('0x34')](function(){return _0x347cd0;})[_0xd847('0x34')](respondWithResult(_0x509abd,null))['catch'](handleError(_0x509abd,null));};exports[_0xd847('0x98')]=function(_0xa6c221,_0x247c5c,_0x3fd666){var _0x17d19e;return db['sequelize'][_0xd847('0x97')](function(_0x2d1582){return db[_0xd847('0x3e')][_0xd847('0x33')](_0xa6c221[_0xd847('0x5b')],{'where':{'id':_0xa6c221['body']['id']},'transaction':_0x2d1582})[_0xd847('0x34')](function(_0x1d276a){return db['VoiceExtension'][_0xd847('0x35')]({'where':{'FaxAccountId':_0xa6c221['body']['id']},'transaction':_0x2d1582})['then'](function(_0x40c6a4){return db[_0xd847('0x99')][_0xd847('0x7e')](createExtensionsReciveFax(_['omit'](_0xa6c221['body'],[_0xd847('0x9a'),_0xd847('0x9b'),_0xd847('0x9c'),'updatedAt','TrunkId',_0xd847('0x9d')])),{'transaction':_0x2d1582});});});})[_0xd847('0x34')](function(){return db['FaxAccount'][_0xd847('0x9e')](_0xa6c221[_0xd847('0x5b')]['id']);})[_0xd847('0x34')](respondWithResult(_0x247c5c,null))[_0xd847('0x2a')](handleError(_0x247c5c,null));};exports[_0xd847('0x9f')]=function(_0x27f140,_0xdcd62b,_0x487536){var _0x1791ed={'raw':!![],'where':{}};var _0x26075d={};var _0x357b11={'count':0x0,'rows':[]};return db[_0xd847('0x3e')][_0xd847('0x6d')]({'where':{'id':_0x27f140[_0xd847('0x57')]['id']}})['then'](handleEntityNotFound(_0xdcd62b,null))[_0xd847('0x34')](function(_0x33f027){if(_0x33f027){_0x26075d['model']=_[_0xd847('0x41')](db[_0xd847('0xa0')][_0xd847('0x3f')]);_0x26075d[_0xd847('0x42')]=_['keys'](_0x27f140['query']);_0x26075d[_0xd847('0x4a')]=_[_0xd847('0x43')](_0x26075d[_0xd847('0x40')],_0x26075d[_0xd847('0x42')]);_0x1791ed[_0xd847('0x44')]=_[_0xd847('0x43')](_0x26075d[_0xd847('0x40')],qs['fields'](_0x27f140[_0xd847('0x42')][_0xd847('0x45')]));_0x1791ed['attributes']=_0x1791ed['attributes'][_0xd847('0x46')]?_0x1791ed[_0xd847('0x44')]:_0x26075d[_0xd847('0x40')];if(!_0x27f140['query'][_0xd847('0x47')](_0xd847('0x67'))){_0x1791ed[_0xd847('0x2f')]=qs[_0xd847('0x2f')](_0x27f140[_0xd847('0x42')]['limit']);_0x1791ed['offset']=qs['offset'](_0x27f140[_0xd847('0x42')][_0xd847('0x2e')]);}_0x1791ed[_0xd847('0x48')]=qs['sort'](_0x27f140['query'][_0xd847('0x49')]);_0x1791ed[_0xd847('0x4d')]=qs['filters'](_[_0xd847('0x68')](_0x27f140[_0xd847('0x42')],_0x26075d['filters']));_0x1791ed[_0xd847('0x4d')][_0xd847('0x64')]=_0x33f027['id'];if(_0x27f140['query'][_0xd847('0x4b')]){_0x1791ed[_0xd847('0x4d')]=_[_0xd847('0x4c')](_0x1791ed[_0xd847('0x4d')],{'$or':_[_0xd847('0x4e')](_0x1791ed[_0xd847('0x44')],function(_0x51a3a8){var _0x5d6e75={};_0x5d6e75[_0x51a3a8]={'$like':'%'+_0x27f140['query'][_0xd847('0x4b')]+'%'};return _0x5d6e75;})});}if(_0x27f140['query']['$gte']){var _0xb702a=_0x27f140['query'][_0xd847('0xa1')][_0xd847('0xa2')](',');var _0x1de834={};_0x1de834[_0xb702a[0x0]]={'$gte':moment(_0xb702a[0x1])[_0xd847('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1791ed[_0xd847('0x4d')]=_['merge'](_0x1791ed[_0xd847('0x4d')],_0x1de834);}_0x1791ed=_[_0xd847('0x4c')]({},_0x1791ed,_0x27f140[_0xd847('0x51')]);return db[_0xd847('0xa0')][_0xd847('0x52')]({'where':_0x1791ed['where']})[_0xd847('0x34')](function(_0xed12ab){_0x357b11['count']=_0xed12ab;if(_0x27f140[_0xd847('0x42')]['includeAll']){_0x1791ed[_0xd847('0x53')]=[{'all':!![]}];}return db[_0xd847('0xa0')]['findAll'](_0x1791ed);})['then'](function(_0x621c52){_0x357b11['rows']=_0x621c52;return _0x357b11;});}})[_0xd847('0x34')](respondWithFilteredResult(_0xdcd62b,_0x1791ed))['catch'](handleError(_0xdcd62b,null));};exports[_0xd847('0xa4')]=function(_0x56db08,_0x192db2,_0x44a1f0){var _0x3c913,_0x130fbe={},_0x2f8e40;if(_0x56db08[_0xd847('0x5b')]['to']){_0x2f8e40=_0x56db08[_0xd847('0x5b')]['to'][0x0];}return db[_0xd847('0x3e')][_0xd847('0x59')]({'where':{'id':_0x56db08[_0xd847('0x57')]['id']},'include':[{'model':db[_0xd847('0xa5')],'as':'List','include':[{'model':db['CmContact'],'as':_0xd847('0xa6'),'where':{'fax':_0x2f8e40},'limit':0x1,'order':[[_0xd847('0xa7'),_0xd847('0xa8')]]}]}]})[_0xd847('0x34')](handleEntityNotFound(_0x192db2,null))['then'](function(_0xe8d49a){_0x3c913=_0xe8d49a;if(_0x56db08[_0xd847('0x5b')][_0xd847('0xa9')]&&_0x56db08['body'][_0xd847('0xa9')][_0xd847('0x46')]){for(var _0xf0da06=0x0;_0xf0da06<_0x56db08['body']['attachments'][_0xd847('0x46')];_0xf0da06+=0x1){_0x56db08[_0xd847('0x5b')][_0xd847('0xa9')][_0xf0da06]={'filename':_0x56db08[_0xd847('0x5b')][_0xd847('0xa9')][_0xf0da06][_0xd847('0x3a')],'id':_0x56db08[_0xd847('0x5b')][_0xd847('0xa9')][_0xf0da06]['id'],'path':path['join'](config[_0xd847('0xaa')],'server/files/attachments',_0x56db08[_0xd847('0x5b')]['attachments'][_0xf0da06][_0xd847('0xab')])};}}return respondWithRpcPromise('CheckAfterSend',_0xd847('0xac'),{'FaxAccountId':_[_0xd847('0xad')](_0x56db08['params']['id'])?undefined:_0x56db08[_0xd847('0x57')]['id'],'path':_[_0xd847('0xad')](_0x56db08[_0xd847('0x5b')]['attachments'][0x0][_0xd847('0x8')])?undefined:_0x56db08[_0xd847('0x5b')][_0xd847('0xa9')][0x0][_0xd847('0x8')],'fax':_[_0xd847('0xad')](_0x56db08[_0xd847('0x5b')]['to'][0x0])?undefined:_0x56db08['body']['to'][0x0]},client9002);})['then'](function(){if(_0x3c913){if(_[_0xd847('0xad')](_0x56db08[_0xd847('0x5b')][_0xd847('0xae')])){_0x56db08[_0xd847('0x5b')][_0xd847('0xae')]=util['format']('\x22%s\x22\x20<%s>',_0x3c913['name'],_0x3c913['fax']);}if(_0x3c913[_0xd847('0xaf')]){if(_0x3c913[_0xd847('0xaf')]['Contacts']['length']){return _0x3c913[_0xd847('0xaf')]['Contacts'][0x0];}else{return db[_0xd847('0x74')][_0xd847('0x5a')](_[_0xd847('0xb0')](_0x56db08['body'],{'firstName':_0x56db08[_0xd847('0x5b')]['to'][0x0],'phone':_0x56db08[_0xd847('0x5b')]['to'][0x0],'fax':_0x56db08['body']['to'][0x0],'ListId':_0x3c913[_0xd847('0x9d')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xd847('0xb1'));}})[_0xd847('0x34')](function(_0x1e698d){if(_0x1e698d){return db[_0xd847('0x71')][_0xd847('0x59')]({'where':{'ContactId':_0x1e698d['id'],'closed':![],'FaxAccountId':_0x3c913['id']}})[_0xd847('0x34')](function(_0x52dc85){if(_0x52dc85){return[_0x52dc85,![]];}return db[_0xd847('0x71')][_0xd847('0x5a')]({'UserId':_0x56db08[_0xd847('0x5c')]['id'],'ContactId':_0x1e698d['id'],'FaxAccountId':_0x3c913['id'],'fax':_0x56db08['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x56db08[_0xd847('0x5b')],{'read':![],'body':_0x56db08[_0xd847('0x5b')][_0xd847('0xa9')][0x0][_0xd847('0xb2')],'FaxAccountId':_0x3c913['id'],'UserId':_0x56db08['user']['id'],'ContactId':_0x1e698d['id'],'AttachmentId':_0x56db08[_0xd847('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xd847('0xb3')}]})[_0xd847('0x34')](function(_0x522ca1){return[_0x522ca1,!![]];});});}else{throw new Error(_0xd847('0xb4'));}})[_0xd847('0xb5')](function(_0x4849a5,_0x182b47){if(_0x182b47){return _0x4849a5;}return db[_0xd847('0xa0')][_0xd847('0x5a')]({'direction':'out','read':![],'body':_0x56db08[_0xd847('0x5b')][_0xd847('0xa9')][0x0][_0xd847('0xb2')],'FaxAccountId':_0x3c913['id'],'FaxInteractionId':_0x4849a5['id'],'UserId':_0x56db08[_0xd847('0x5c')]['id'],'ContactId':_0x4849a5[_0xd847('0xb6')],'AttachmentId':_0x56db08[_0xd847('0x5b')][_0xd847('0xa9')][0x0]['id']})[_0xd847('0x34')](function(_0x5724aa){_0x4849a5[_0xd847('0xb7')][_0xd847('0xb3')]=[];_0x4849a5[_0xd847('0xb7')][_0xd847('0xb3')][_0xd847('0x88')](_0x5724aa[_0xd847('0xb7')]);return _0x4849a5;});})['then'](function(_0x25b836){respondWithRpcPromise(_0xd847('0xb8'),_0xd847('0xb8'),{'FaxAccountId':_[_0xd847('0xad')](_0x56db08[_0xd847('0x57')]['id'])?undefined:_0x56db08[_0xd847('0x57')]['id'],'path':_['isNil'](_0x56db08['body'][_0xd847('0xa9')][0x0]['path'])?undefined:_0x56db08['body'][_0xd847('0xa9')][0x0][_0xd847('0x8')],'fax':_[_0xd847('0xad')](_0x56db08[_0xd847('0x5b')]['to'][0x0])?undefined:_0x56db08[_0xd847('0x5b')]['to'][0x0],'AttachmentId':_0x56db08[_0xd847('0x5b')]['attachments'][0x0]['id']},client9002)[_0xd847('0x34')](function(_0x1f2f27){logger[_0xd847('0x20')](_0xd847('0xb9'),_0x1f2f27);})[_0xd847('0x2a')](function(_0x27de80){logger[_0xd847('0x20')](_0xd847('0xb9'),_0x27de80);});return _0x25b836;})[_0xd847('0x34')](respondWithResult(_0x192db2,null))[_0xd847('0x2a')](handleError(_0x192db2,null));};exports[_0xd847('0xba')]=function(_0x244829,_0xc1916e,_0x23ccb9){return db['FaxAccount'][_0xd847('0x59')]({'where':{'id':_0x244829['params']['id']}})['then'](handleEntityNotFound(_0xc1916e,null))[_0xd847('0x34')](function(_0xcd967){if(_0xcd967){return _0xcd967[_0xd847('0xba')](_0x244829['body'][_0xd847('0x6a')],_[_0xd847('0x72')](_0x244829[_0xd847('0x5b')],['ids','id'])||{})[_0xd847('0xb5')](function(_0x34269e){for(var _0x5155ac=0x0;_0x5155ac<_0x244829[_0xd847('0x5b')][_0xd847('0x6a')][_0xd847('0x46')];_0x5155ac+=0x1){socket[_0xd847('0xbb')](_0xd847('0xbc'),{'UserId':_0x244829['body']['ids'][_0x5155ac],'FaxAccountId':_0x244829[_0xd847('0x57')]['id']});}return _0x34269e;});}})['then'](respondWithResult(_0xc1916e,null))[_0xd847('0x2a')](handleError(_0xc1916e,null));};exports['removeAgents']=function(_0x1a24ad,_0x1f350f,_0x24da49){return db[_0xd847('0x3e')][_0xd847('0x59')]({'where':{'id':_0x1a24ad[_0xd847('0x57')]['id']}})['then'](handleEntityNotFound(_0x1f350f,null))[_0xd847('0x34')](function(_0x35d651){if(_0x35d651){return _0x35d651['removeAgents'](_0x1a24ad[_0xd847('0x42')][_0xd847('0x6a')])['then'](function(){if(_['isArray'](_0x1a24ad[_0xd847('0x42')][_0xd847('0x6a')])){for(var _0x5c978b=0x0;_0x5c978b<_0x1a24ad[_0xd847('0x42')][_0xd847('0x6a')][_0xd847('0x46')];_0x5c978b+=0x1){socket['emit'](_0xd847('0xbd'),{'UserId':Number(_0x1a24ad[_0xd847('0x42')][_0xd847('0x6a')][_0x5c978b]),'FaxAccountId':Number(_0x1a24ad[_0xd847('0x57')]['id'])});}}else{socket['emit'](_0xd847('0xbd'),{'UserId':Number(_0x1a24ad[_0xd847('0x42')][_0xd847('0x6a')]),'FaxAccountId':Number(_0x1a24ad[_0xd847('0x57')]['id'])});}});}})[_0xd847('0x34')](respondWithStatusCode(_0x1f350f,null))[_0xd847('0x2a')](handleError(_0x1f350f,null));};exports['getAgents']=function(_0x5dedf8,_0x50aca2,_0x509c05){var _0x5553b3={};var _0xcc3106={};var _0xe52456;var _0x3e72ef;return db['FaxAccount'][_0xd847('0x6d')]({'where':{'id':_0x5dedf8[_0xd847('0x57')]['id']}})[_0xd847('0x34')](handleEntityNotFound(_0x50aca2,null))['then'](function(_0x5082cd){if(_0x5082cd){_0xe52456=_0x5082cd;_0xcc3106[_0xd847('0x40')]=_[_0xd847('0x41')](db[_0xd847('0x75')]['rawAttributes']);_0xcc3106['query']=_[_0xd847('0x41')](_0x5dedf8[_0xd847('0x42')]);_0xcc3106[_0xd847('0x4a')]=_[_0xd847('0x43')](_0xcc3106[_0xd847('0x40')],_0xcc3106[_0xd847('0x42')]);_0x5553b3[_0xd847('0x44')]=_['intersection'](_0xcc3106[_0xd847('0x40')],qs[_0xd847('0x45')](_0x5dedf8['query'][_0xd847('0x45')]));_0x5553b3['attributes']=_0x5553b3[_0xd847('0x44')][_0xd847('0x46')]?_0x5553b3[_0xd847('0x44')]:_0xcc3106['model'];_0x5553b3[_0xd847('0x48')]=qs['sort'](_0x5dedf8[_0xd847('0x42')][_0xd847('0x49')]);_0x5553b3['where']=qs[_0xd847('0x4a')](_['pick'](_0x5dedf8['query'],_0xcc3106[_0xd847('0x4a')]));if(_0x5dedf8[_0xd847('0x42')][_0xd847('0x4b')]){_0x5553b3[_0xd847('0x4d')]=_[_0xd847('0x4c')](_0x5553b3[_0xd847('0x4d')],{'$or':_[_0xd847('0x4e')](_0x5553b3[_0xd847('0x44')],function(_0x2709d6){var _0x269820={};_0x269820[_0x2709d6]={'$like':'%'+_0x5dedf8['query']['filter']+'%'};return _0x269820;})});}_0x5553b3=_[_0xd847('0x4c')]({},_0x5553b3,_0x5dedf8['options']);return _0xe52456[_0xd847('0xbe')](_0x5553b3);}})[_0xd847('0x34')](function(_0x250fa5){if(_0x250fa5){_0x3e72ef=_0x250fa5[_0xd847('0x46')];if(!_0x5dedf8[_0xd847('0x42')]['hasOwnProperty']('nolimit')){_0x5553b3[_0xd847('0x2f')]=qs[_0xd847('0x2f')](_0x5dedf8[_0xd847('0x42')][_0xd847('0x2f')]);_0x5553b3[_0xd847('0x2e')]=qs[_0xd847('0x2e')](_0x5dedf8['query'][_0xd847('0x2e')]);}return _0xe52456[_0xd847('0xbe')](_0x5553b3);}})[_0xd847('0x34')](function(_0x2b89aa){if(_0x2b89aa){return _0x2b89aa?{'count':_0x3e72ef,'rows':_0x2b89aa}:null;}})[_0xd847('0x34')](respondWithResult(_0x50aca2,null))[_0xd847('0x2a')](handleError(_0x50aca2,null));};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js
index a755f93..7cec00c 100644
--- a/server/api/faxAccount/faxAccount.events.js
+++ b/server/api/faxAccount/faxAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xacb6=['update','remove','emit','hasOwnProperty','hook','FaxAccount','setMaxListeners','save'];(function(_0x5bc345,_0x3ea6da){var _0x503c70=function(_0x5e0941){while(--_0x5e0941){_0x5bc345['push'](_0x5bc345['shift']());}};_0x503c70(++_0x3ea6da);}(_0xacb6,0x10d));var _0x6acb=function(_0x132487,_0x5d12f1){_0x132487=_0x132487-0x0;var _0x574190=_0xacb6[_0x132487];return _0x574190;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x6acb('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6acb('0x1')](0x0);var events={'afterCreate':_0x6acb('0x2'),'afterUpdate':_0x6acb('0x3'),'afterDestroy':_0x6acb('0x4')};function emitEvent(_0x540fb6){return function(_0x27008b,_0x45efa3,_0x5d162d){FaxAccountEvents[_0x6acb('0x5')](_0x540fb6+':'+_0x27008b['id'],_0x27008b);FaxAccountEvents[_0x6acb('0x5')](_0x540fb6,_0x27008b);_0x5d162d(null);};}for(var e in events){if(events[_0x6acb('0x6')](e)){var event=events[e];FaxAccount[_0x6acb('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
+var _0x793d=['hook','exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x249eda,_0x420de3){var _0x112bb1=function(_0x162378){while(--_0x162378){_0x249eda['push'](_0x249eda['shift']());}};_0x112bb1(++_0x420de3);}(_0x793d,0xf2));var _0xd793=function(_0xc63c02,_0x92d4c7){_0xc63c02=_0xc63c02-0x0;var _0x55dcec=_0x793d[_0xc63c02];return _0x55dcec;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xd793('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xd793('0x1')](0x0);var events={'afterCreate':_0xd793('0x2'),'afterUpdate':_0xd793('0x3'),'afterDestroy':'remove'};function emitEvent(_0x160987){return function(_0xccea40,_0x1f187a,_0x23c5ca){FaxAccountEvents[_0xd793('0x4')](_0x160987+':'+_0xccea40['id'],_0xccea40);FaxAccountEvents[_0xd793('0x4')](_0x160987,_0xccea40);_0x23c5ca(null);};}for(var e in events){if(events[_0xd793('0x5')](e)){var event=events[e];FaxAccount[_0xd793('0x6')](e,emitEvent(event));}}module[_0xd793('0x7')]=FaxAccountEvents;
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js
index b60a5f5..28e7cec 100644
--- a/server/api/faxAccount/faxAccount.model.js
+++ b/server/api/faxAccount/faxAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5dd9=['util','api','moment','bluebird','path','rimraf','./faxAccount.attributes','exports','FaxAccount'];(function(_0x5dbe76,_0x44c28b){var _0x50ed81=function(_0x23f254){while(--_0x23f254){_0x5dbe76['push'](_0x5dbe76['shift']());}};_0x50ed81(++_0x44c28b);}(_0x5dd9,0x1e6));var _0x95dd=function(_0x7aef09,_0x192202){_0x7aef09=_0x7aef09-0x0;var _0x224203=_0x5dd9[_0x7aef09];return _0x224203;};'use strict';var _=require('lodash');var util=require(_0x95dd('0x0'));var logger=require('../../config/logger')(_0x95dd('0x1'));var moment=require(_0x95dd('0x2'));var BPromise=require(_0x95dd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x95dd('0x4'));var rimraf=require(_0x95dd('0x5'));var config=require('../../config/environment');var attributes=require(_0x95dd('0x6'));module[_0x95dd('0x7')]=function(_0x554402,_0x372e57){return _0x554402['define'](_0x95dd('0x8'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e17=['exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x0e17,0xd6));var _0x70e1=function(_0x312df0,_0x3642d9){_0x312df0=_0x312df0-0x0;var _0x509cc1=_0x0e17[_0x312df0];return _0x509cc1;};'use strict';var _=require(_0x70e1('0x0'));var util=require(_0x70e1('0x1'));var logger=require(_0x70e1('0x2'))(_0x70e1('0x3'));var moment=require(_0x70e1('0x4'));var BPromise=require(_0x70e1('0x5'));var rp=require(_0x70e1('0x6'));var fs=require('fs');var path=require(_0x70e1('0x7'));var rimraf=require(_0x70e1('0x8'));var config=require(_0x70e1('0x9'));var attributes=require(_0x70e1('0xa'));module[_0x70e1('0xb')]=function(_0x4cb0b1,_0xc64213){return _0x4cb0b1[_0x70e1('0xc')](_0x70e1('0xd'),attributes,{'tableName':_0x70e1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js
index 8ec9ca9..3b0a3d5 100644
--- a/server/api/faxAccount/faxAccount.rpc.js
+++ b/server/api/faxAccount/faxAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0776=['no\x20available\x20attributes','keys','createdAt','updatedAt','ListId','body','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','CmList','List','Contacts','FaxApplication','Applications','get','account','list','applications','orderBy','asc','length','create','contact','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','register','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','findAll','options','raw','attributes','include','model','map','then','GetFaxAccount','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError'];(function(_0x5be0ea,_0x2b6121){var _0x26b02b=function(_0x1ef3a1){while(--_0x1ef3a1){_0x5be0ea['push'](_0x5be0ea['shift']());}};_0x26b02b(++_0x2b6121);}(_0x0776,0x128));var _0x6077=function(_0x1f7883,_0x5c9df7){_0x1f7883=_0x1f7883-0x0;var _0x5d8c6b=_0x0776[_0x1f7883];return _0x5d8c6b;};'use strict';var _=require(_0x6077('0x0'));var util=require(_0x6077('0x1'));var moment=require(_0x6077('0x2'));var BPromise=require(_0x6077('0x3'));var rs=require(_0x6077('0x4'));var fs=require('fs');var Redis=require(_0x6077('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6077('0x6'));var logger=require(_0x6077('0x7'))(_0x6077('0x8'));var config=require('../../config/environment');var jayson=require(_0x6077('0x9'));var client=jayson[_0x6077('0xa')]['http']({'port':0x232c});config[_0x6077('0xb')]=_['defaults'](config[_0x6077('0xb')],{'host':_0x6077('0xc'),'port':0x18eb});var socket=require(_0x6077('0xd'))(new Redis(config[_0x6077('0xb')]));require('./faxAccount.socket')[_0x6077('0xe')](socket);function respondWithRpcPromise(_0x1c4c12,_0x2d171d,_0x96c78f){return new BPromise(function(_0x116717,_0x5b7820){return client['request'](_0x1c4c12,_0x96c78f)['then'](function(_0x59f78c){logger['info']('FaxAccount,\x20%s,\x20%s',_0x2d171d,_0x6077('0xf'));logger['debug'](_0x6077('0x10'),_0x2d171d,'request\x20sent',JSON[_0x6077('0x11')](_0x59f78c));if(_0x59f78c[_0x6077('0x12')]){if(_0x59f78c[_0x6077('0x12')][_0x6077('0x13')]===0x1f4){logger[_0x6077('0x12')](_0x6077('0x14'),_0x2d171d,_0x59f78c['error'][_0x6077('0x15')]);return _0x5b7820(_0x59f78c[_0x6077('0x12')][_0x6077('0x15')]);}logger[_0x6077('0x12')]('FaxAccount,\x20%s,\x20%s',_0x2d171d,_0x59f78c[_0x6077('0x12')][_0x6077('0x15')]);return _0x116717(_0x59f78c['error'][_0x6077('0x15')]);}else{logger[_0x6077('0x16')](_0x6077('0x14'),_0x2d171d,'request\x20sent');_0x116717(_0x59f78c[_0x6077('0x17')][_0x6077('0x15')]);}})[_0x6077('0x18')](function(_0x1bcfee){logger[_0x6077('0x12')](_0x6077('0x14'),_0x2d171d,_0x1bcfee);_0x5b7820(_0x1bcfee);});});}exports['GetFaxAccount']=function(_0x32f6a4){var _0x4b5e42=this;return new Promise(function(_0x203174,_0x20382f){return db['FaxAccount'][_0x6077('0x19')]({'raw':_0x32f6a4[_0x6077('0x1a')]?_0x32f6a4['options'][_0x6077('0x1b')]===undefined?!![]:![]:!![],'where':_0x32f6a4[_0x6077('0x1a')]?_0x32f6a4['options']['where']||null:null,'attributes':_0x32f6a4[_0x6077('0x1a')]?_0x32f6a4[_0x6077('0x1a')][_0x6077('0x1c')]||null:null,'limit':_0x32f6a4[_0x6077('0x1a')]?_0x32f6a4[_0x6077('0x1a')]['limit']||null:null,'include':_0x32f6a4[_0x6077('0x1a')]?_0x32f6a4[_0x6077('0x1a')][_0x6077('0x1d')]?_['map'](_0x32f6a4['options'][_0x6077('0x1d')],function(_0x54720a){return{'model':db[_0x54720a[_0x6077('0x1e')]],'as':_0x54720a['as'],'attributes':_0x54720a['attributes'],'include':_0x54720a['include']?_[_0x6077('0x1f')](_0x54720a[_0x6077('0x1d')],function(_0x454162){return{'model':db[_0x454162[_0x6077('0x1e')]],'as':_0x454162['as'],'attributes':_0x454162[_0x6077('0x1c')],'include':_0x454162[_0x6077('0x1d')]?_[_0x6077('0x1f')](_0x454162[_0x6077('0x1d')],function(_0x4e408c){return{'model':db[_0x4e408c[_0x6077('0x1e')]],'as':_0x4e408c['as'],'attributes':_0x4e408c[_0x6077('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6077('0x20')](function(_0x51f101){logger[_0x6077('0x16')](_0x6077('0x21'),_0x32f6a4);logger['debug']('GetFaxAccount',_0x32f6a4,JSON[_0x6077('0x11')](_0x51f101));_0x203174(_0x51f101);})[_0x6077('0x18')](function(_0x20830b){logger['error']('GetFaxAccount',_0x20830b[_0x6077('0x15')],_0x32f6a4);_0x20382f(_0x4b5e42[_0x6077('0x12')](0x1f4,_0x20830b['message']));});});};exports[_0x6077('0x22')]=function(_0x54179d,_0x3a6929,_0x437cc0){var _0x8e3fa=this;return new Promise(function(_0x42e2e8,_0x4602e9){var _0x23b645={'body':_0x54179d['body'],'channel':_0x6077('0x23')};var _0x1472d4=[];var _0x3d6294=[];var _0x38726b={};return db[_0x6077('0x24')][_0x6077('0x25')]()[_0x6077('0x20')](function(_0x16a8e1){if(!_0x16a8e1){throw new db[(_0x6077('0x26'))][(_0x6077('0x27'))](_0x6077('0x28'));}_0x1472d4=_['difference'](_[_0x6077('0x29')](_0x16a8e1),[_0x6077('0x2a'),_0x6077('0x2b')]);_0x3d6294=_['difference'](_[_0x6077('0x29')](_0x16a8e1),['createdAt','updatedAt','CompanyId',_0x6077('0x2c')]);if(_0x54179d['body']['id']){delete _0x54179d[_0x6077('0x2d')]['id'];}if(_['isNil'](_0x54179d[_0x6077('0x2d')]['from'])){throw new db['Sequelize'][(_0x6077('0x27'))](_0x6077('0x2e'));}if(_['isNil'](_0x54179d[_0x6077('0x2d')][_0x6077('0x2d')])||_0x54179d[_0x6077('0x2d')][_0x6077('0x2d')]===''){throw new db[(_0x6077('0x26'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x54179d[_0x6077('0x2d')][_0x6077('0x2f')])){throw new db['Sequelize'][(_0x6077('0x27'))](_0x6077('0x30')+_0x3d6294);}if(!_['includes'](_0x3d6294,_0x54179d[_0x6077('0x2d')][_0x6077('0x2f')])){throw new db[(_0x6077('0x26'))][(_0x6077('0x27'))](_0x6077('0x31')+_0x3d6294);}_0x38726b[_0x54179d[_0x6077('0x2d')]['mapKey']]=_0x54179d[_0x6077('0x2d')][_0x6077('0x32')];})['then'](function(){return db[_0x6077('0x33')]['find']({'where':{'id':_0x54179d['account']['id']},'include':[{'model':db[_0x6077('0x34')],'as':_0x6077('0x35'),'include':[{'model':db['CmContact'],'as':_0x6077('0x36'),'where':_0x38726b,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x6077('0x37')],'as':_0x6077('0x38')}]});})[_0x6077('0x20')](function(_0x3256b9){if(_0x3256b9&&_0x3256b9['List']){var _0x23ae08=_0x3256b9[_0x6077('0x39')]({'plain':!![]});_0x23b645[_0x6077('0x3a')]=_0x23ae08;_0x23b645['applications']=_0x23ae08[_0x6077('0x38')];_0x23b645[_0x6077('0x3b')]=_0x23ae08['List'];_0x23b645[_0x6077('0x3c')]=_[_0x6077('0x3d')](_0x23b645[_0x6077('0x3c')],['priority'],[_0x6077('0x3e')]);if(_0x23b645['account']['Applications']){delete _0x23b645[_0x6077('0x3a')][_0x6077('0x38')];}if(_0x23b645['account'][_0x6077('0x35')]&&_0x23b645[_0x6077('0x3a')][_0x6077('0x35')][_0x6077('0x36')][_0x6077('0x3f')]){return _0x23b645[_0x6077('0x3a')][_0x6077('0x35')]['Contacts'][0x0];}var _0x444248=_['defaults'](_0x54179d[_0x6077('0x2d')],{'firstName':_0x54179d[_0x6077('0x2d')]['from'],'ListId':_0x23ae08[_0x6077('0x2c')]});_0x444248[_0x54179d[_0x6077('0x2d')]['mapKey']]=_0x54179d['body'][_0x6077('0x32')];return db[_0x6077('0x24')][_0x6077('0x40')](_0x444248,{'fields':_0x1472d4,'raw':!![]});}})[_0x6077('0x20')](function(_0x9be374){_0x23b645[_0x6077('0x41')]=_0x9be374;if(_0x9be374){var _0x3c0f91={'ContactId':_0x9be374['id'],'FaxAccountId':_0x54179d[_0x6077('0x3a')]['id'],'fax':_0x9be374[_0x6077('0x23')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x9be374['id'],'closed':![],'FaxAccountId':_0x54179d[_0x6077('0x3a')]['id']}})[_0x6077('0x20')](function(_0x14c643){if(_0x14c643){return[_0x14c643,![]];}return db['FaxInteraction'][_0x6077('0x40')](_0x3c0f91)[_0x6077('0x20')](function(_0x4ebc0e){return[_0x4ebc0e,!![]];});});}else{throw new Error(_0x6077('0x42'));}})[_0x6077('0x43')](function(_0x4e626b,_0x9c91de){var _0x2342d0=_0x4e626b[_0x6077('0x39')]({'plain':!![]});if(_0x9c91de){if(_0x23b645[_0x6077('0x3a')]['autoclose']){_0x23b645[_0x6077('0x3c')][_0x6077('0x44')]({'id':0x0,'priority':_0x23b645[_0x6077('0x3c')][_0x6077('0x3f')]+0x1,'app':_0x6077('0x45'),'appdata':_0x6077('0x46'),'interval':_0x6077('0x47')});}_0x2342d0[_0x6077('0x48')]=!![];}else{_0x2342d0[_0x6077('0x48')]=![];}_0x23b645[_0x6077('0x49')]=_0x2342d0;return db[_0x6077('0x4a')][_0x6077('0x40')]({'body':_0x54179d[_0x6077('0x2d')]['body'],'FaxAccountId':_0x54179d[_0x6077('0x3a')]['id'],'FaxInteractionId':_0x4e626b['id'],'direction':'in','ContactId':_0x4e626b[_0x6077('0x4b')],'AttachmentId':_0x54179d[_0x6077('0x2d')][_0x6077('0x4c')]});})['then'](function(_0x7d0892){_0x23b645[_0x6077('0x15')]=_0x7d0892;if(_0x23b645[_0x6077('0x49')]['UserId']){return db[_0x6077('0x4d')]['find']({'attributes':['id',_0x6077('0x4e')],'where':{'id':_0x23b645[_0x6077('0x49')]['UserId']}})[_0x6077('0x20')](function(_0xed61f7){if(_0xed61f7){_0x23b645['applications'][_0x6077('0x4f')]({'id':0x0,'priority':0x0,'app':_0x6077('0x50'),'appdata':_0xed61f7[_0x6077('0x4e')]+','+(_0x23b645[_0x6077('0x3a')][_0x6077('0x51')]||0xa),'interval':_0x6077('0x47')});}return respondWithRpcPromise(_0x6077('0x52'),_0x6077('0x53'),_0x23b645);});}return respondWithRpcPromise(_0x6077('0x52'),_0x6077('0x53'),_0x23b645);})['then'](function(_0x42c680){_0x42e2e8(_0x42c680);})[_0x6077('0x18')](function(_0x24326a){_0x4602e9(_0x8e3fa[_0x6077('0x12')](0x1f4,_0x24326a[_0x6077('0x15')]));});});};
\ No newline at end of file
+var _0x25ee=['http','redis','defaults','localhost','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','FaxAccount','options','attributes','limit','include','model','map','debug','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','FaxApplication','Applications','get','applications','orderBy','priority','asc','length','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','created','interaction','create','UserId','unshift','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5730d7,_0x879667){var _0x12a967=function(_0x50c2d3){while(--_0x50c2d3){_0x5730d7['push'](_0x5730d7['shift']());}};_0x12a967(++_0x879667);}(_0x25ee,0x14f));var _0xe25e=function(_0xf49716,_0x121b65){_0xf49716=_0xf49716-0x0;var _0x252aa8=_0x25ee[_0xf49716];return _0x252aa8;};'use strict';var _=require(_0xe25e('0x0'));var util=require(_0xe25e('0x1'));var moment=require(_0xe25e('0x2'));var BPromise=require('bluebird');var rs=require(_0xe25e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe25e('0x4'));var logger=require(_0xe25e('0x5'))('rpc');var config=require(_0xe25e('0x6'));var jayson=require(_0xe25e('0x7'));var client=jayson[_0xe25e('0x8')][_0xe25e('0x9')]({'port':0x232c});config[_0xe25e('0xa')]=_[_0xe25e('0xb')](config[_0xe25e('0xa')],{'host':_0xe25e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe25e('0xa')]));require('./faxAccount.socket')[_0xe25e('0xd')](socket);function respondWithRpcPromise(_0x1f642c,_0x238605,_0x4bd934){return new BPromise(function(_0x17316b,_0x29768a){return client[_0xe25e('0xe')](_0x1f642c,_0x4bd934)[_0xe25e('0xf')](function(_0x5264a7){logger[_0xe25e('0x10')](_0xe25e('0x11'),_0x238605,_0xe25e('0x12'));logger['debug'](_0xe25e('0x13'),_0x238605,'request\x20sent',JSON[_0xe25e('0x14')](_0x5264a7));if(_0x5264a7[_0xe25e('0x15')]){if(_0x5264a7[_0xe25e('0x15')][_0xe25e('0x16')]===0x1f4){logger[_0xe25e('0x15')](_0xe25e('0x11'),_0x238605,_0x5264a7[_0xe25e('0x15')]['message']);return _0x29768a(_0x5264a7['error'][_0xe25e('0x17')]);}logger['error'](_0xe25e('0x11'),_0x238605,_0x5264a7['error']['message']);return _0x17316b(_0x5264a7[_0xe25e('0x15')][_0xe25e('0x17')]);}else{logger[_0xe25e('0x10')](_0xe25e('0x11'),_0x238605,_0xe25e('0x12'));_0x17316b(_0x5264a7[_0xe25e('0x18')][_0xe25e('0x17')]);}})['catch'](function(_0x5b59eb){logger[_0xe25e('0x15')](_0xe25e('0x11'),_0x238605,_0x5b59eb);_0x29768a(_0x5b59eb);});});}exports[_0xe25e('0x19')]=function(_0x24258c){var _0x45baf6=this;return new Promise(function(_0x1d6a46,_0x359e28){return db[_0xe25e('0x1a')]['findAll']({'raw':_0x24258c[_0xe25e('0x1b')]?_0x24258c[_0xe25e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x24258c[_0xe25e('0x1b')]?_0x24258c[_0xe25e('0x1b')]['where']||null:null,'attributes':_0x24258c[_0xe25e('0x1b')]?_0x24258c[_0xe25e('0x1b')][_0xe25e('0x1c')]||null:null,'limit':_0x24258c['options']?_0x24258c['options'][_0xe25e('0x1d')]||null:null,'include':_0x24258c[_0xe25e('0x1b')]?_0x24258c[_0xe25e('0x1b')]['include']?_['map'](_0x24258c['options'][_0xe25e('0x1e')],function(_0x48df75){return{'model':db[_0x48df75[_0xe25e('0x1f')]],'as':_0x48df75['as'],'attributes':_0x48df75[_0xe25e('0x1c')],'include':_0x48df75[_0xe25e('0x1e')]?_['map'](_0x48df75[_0xe25e('0x1e')],function(_0x4a2d82){return{'model':db[_0x4a2d82[_0xe25e('0x1f')]],'as':_0x4a2d82['as'],'attributes':_0x4a2d82[_0xe25e('0x1c')],'include':_0x4a2d82[_0xe25e('0x1e')]?_[_0xe25e('0x20')](_0x4a2d82[_0xe25e('0x1e')],function(_0x1c75d7){return{'model':db[_0x1c75d7['model']],'as':_0x1c75d7['as'],'attributes':_0x1c75d7[_0xe25e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe25e('0xf')](function(_0x50a9d3){logger['info'](_0xe25e('0x19'),_0x24258c);logger[_0xe25e('0x21')]('GetFaxAccount',_0x24258c,JSON['stringify'](_0x50a9d3));_0x1d6a46(_0x50a9d3);})[_0xe25e('0x22')](function(_0x13a034){logger[_0xe25e('0x15')]('GetFaxAccount',_0x13a034[_0xe25e('0x17')],_0x24258c);_0x359e28(_0x45baf6[_0xe25e('0x15')](0x1f4,_0x13a034[_0xe25e('0x17')]));});});};exports[_0xe25e('0x23')]=function(_0x455246,_0x3baeb1,_0x1829de){var _0x20ee2b=this;return new Promise(function(_0xe462c6,_0x2033e7){var _0x864a13={'body':_0x455246[_0xe25e('0x24')],'channel':_0xe25e('0x25')};var _0x29cad5=[];var _0x5d5f19=[];var _0x5aa020={};return db[_0xe25e('0x26')][_0xe25e('0x27')]()[_0xe25e('0xf')](function(_0x8c45ec){if(!_0x8c45ec){throw new db[(_0xe25e('0x28'))][(_0xe25e('0x29'))](_0xe25e('0x2a'));}_0x29cad5=_['difference'](_['keys'](_0x8c45ec),['createdAt',_0xe25e('0x2b')]);_0x5d5f19=_[_0xe25e('0x2c')](_['keys'](_0x8c45ec),[_0xe25e('0x2d'),'updatedAt',_0xe25e('0x2e'),_0xe25e('0x2f')]);if(_0x455246[_0xe25e('0x24')]['id']){delete _0x455246['body']['id'];}if(_[_0xe25e('0x30')](_0x455246[_0xe25e('0x24')][_0xe25e('0x31')])){throw new db[(_0xe25e('0x28'))]['ValidationError'](_0xe25e('0x32'));}if(_[_0xe25e('0x30')](_0x455246[_0xe25e('0x24')]['body'])||_0x455246[_0xe25e('0x24')][_0xe25e('0x24')]===''){throw new db[(_0xe25e('0x28'))][(_0xe25e('0x29'))](_0xe25e('0x33'));}if(_['isNil'](_0x455246[_0xe25e('0x24')][_0xe25e('0x34')])){throw new db[(_0xe25e('0x28'))][(_0xe25e('0x29'))](_0xe25e('0x35')+_0x5d5f19);}if(!_[_0xe25e('0x36')](_0x5d5f19,_0x455246['body'][_0xe25e('0x34')])){throw new db[(_0xe25e('0x28'))][(_0xe25e('0x29'))](_0xe25e('0x37')+_0x5d5f19);}_0x5aa020[_0x455246[_0xe25e('0x24')][_0xe25e('0x34')]]=_0x455246[_0xe25e('0x24')][_0xe25e('0x31')];})[_0xe25e('0xf')](function(){return db[_0xe25e('0x1a')][_0xe25e('0x38')]({'where':{'id':_0x455246[_0xe25e('0x39')]['id']},'include':[{'model':db[_0xe25e('0x3a')],'as':_0xe25e('0x3b'),'include':[{'model':db['CmContact'],'as':_0xe25e('0x3c'),'where':_0x5aa020,'limit':0x1,'order':[[_0xe25e('0x2b'),'DESC']]}]},{'model':db[_0xe25e('0x3d')],'as':_0xe25e('0x3e')}]});})[_0xe25e('0xf')](function(_0x26e38b){if(_0x26e38b&&_0x26e38b[_0xe25e('0x3b')]){var _0x43c828=_0x26e38b[_0xe25e('0x3f')]({'plain':!![]});_0x864a13[_0xe25e('0x39')]=_0x43c828;_0x864a13['applications']=_0x43c828['Applications'];_0x864a13['list']=_0x43c828['List'];_0x864a13[_0xe25e('0x40')]=_[_0xe25e('0x41')](_0x864a13['applications'],[_0xe25e('0x42')],[_0xe25e('0x43')]);if(_0x864a13[_0xe25e('0x39')][_0xe25e('0x3e')]){delete _0x864a13['account'][_0xe25e('0x3e')];}if(_0x864a13[_0xe25e('0x39')][_0xe25e('0x3b')]&&_0x864a13[_0xe25e('0x39')][_0xe25e('0x3b')]['Contacts'][_0xe25e('0x44')]){return _0x864a13[_0xe25e('0x39')][_0xe25e('0x3b')][_0xe25e('0x3c')][0x0];}var _0x39868a=_[_0xe25e('0xb')](_0x455246[_0xe25e('0x24')],{'firstName':_0x455246[_0xe25e('0x24')][_0xe25e('0x31')],'ListId':_0x43c828[_0xe25e('0x2f')]});_0x39868a[_0x455246[_0xe25e('0x24')][_0xe25e('0x34')]]=_0x455246[_0xe25e('0x24')][_0xe25e('0x31')];return db[_0xe25e('0x26')]['create'](_0x39868a,{'fields':_0x29cad5,'raw':!![]});}})[_0xe25e('0xf')](function(_0x36c7e0){_0x864a13[_0xe25e('0x45')]=_0x36c7e0;if(_0x36c7e0){var _0x369b2c={'ContactId':_0x36c7e0['id'],'FaxAccountId':_0x455246['account']['id'],'fax':_0x36c7e0[_0xe25e('0x25')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x36c7e0['id'],'closed':![],'FaxAccountId':_0x455246[_0xe25e('0x39')]['id']}})[_0xe25e('0xf')](function(_0x24d449){if(_0x24d449){return[_0x24d449,![]];}return db[_0xe25e('0x46')]['create'](_0x369b2c)[_0xe25e('0xf')](function(_0x7ab796){return[_0x7ab796,!![]];});});}else{throw new Error(_0xe25e('0x47'));}})[_0xe25e('0x48')](function(_0x14f974,_0x1ca589){var _0x19e57d=_0x14f974[_0xe25e('0x3f')]({'plain':!![]});if(_0x1ca589){if(_0x864a13[_0xe25e('0x39')][_0xe25e('0x49')]){_0x864a13[_0xe25e('0x40')][_0xe25e('0x4a')]({'id':0x0,'priority':_0x864a13['applications'][_0xe25e('0x44')]+0x1,'app':_0xe25e('0x4b'),'appdata':_0xe25e('0x4c'),'interval':'*,*,*,*'});}_0x19e57d[_0xe25e('0x4d')]=!![];}else{_0x19e57d[_0xe25e('0x4d')]=![];}_0x864a13[_0xe25e('0x4e')]=_0x19e57d;return db['FaxMessage'][_0xe25e('0x4f')]({'body':_0x455246['body'][_0xe25e('0x24')],'FaxAccountId':_0x455246[_0xe25e('0x39')]['id'],'FaxInteractionId':_0x14f974['id'],'direction':'in','ContactId':_0x14f974['ContactId'],'AttachmentId':_0x455246['body']['AttachmentId']});})[_0xe25e('0xf')](function(_0x19cf42){_0x864a13[_0xe25e('0x17')]=_0x19cf42;if(_0x864a13[_0xe25e('0x4e')][_0xe25e('0x50')]){return db['User'][_0xe25e('0x38')]({'attributes':['id','name'],'where':{'id':_0x864a13[_0xe25e('0x4e')][_0xe25e('0x50')]}})[_0xe25e('0xf')](function(_0x4430dc){if(_0x4430dc){_0x864a13[_0xe25e('0x40')][_0xe25e('0x51')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4430dc[_0xe25e('0x52')]+','+(_0x864a13[_0xe25e('0x39')][_0xe25e('0x53')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xe25e('0x54'),_0xe25e('0x55'),_0x864a13);});}return respondWithRpcPromise(_0xe25e('0x54'),_0xe25e('0x55'),_0x864a13);})[_0xe25e('0xf')](function(_0x17b757){_0xe462c6(_0x17b757);})[_0xe25e('0x22')](function(_0x568c8f){_0x2033e7(_0x20ee2b[_0xe25e('0x15')](0x1f4,_0x568c8f[_0xe25e('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js
index d9a3064..e7295f0 100644
--- a/server/api/faxAccount/faxAccount.socket.js
+++ b/server/api/faxAccount/faxAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6dfe=['save','remove','emit','removeListener','register','faxAccount:','./faxAccount.events'];(function(_0x6cb5b8,_0x14cc50){var _0x445115=function(_0x200d97){while(--_0x200d97){_0x6cb5b8['push'](_0x6cb5b8['shift']());}};_0x445115(++_0x14cc50);}(_0x6dfe,0x1b1));var _0xe6df=function(_0x5b4623,_0x785913){_0x5b4623=_0x5b4623-0x0;var _0x25f1b1=_0x6dfe[_0x5b4623];return _0x25f1b1;};'use strict';var FaxAccountEvents=require(_0xe6df('0x0'));var events=[_0xe6df('0x1'),_0xe6df('0x2'),'update'];function createListener(_0x3568e1,_0x394a19){return function(_0x11d9d8){_0x394a19[_0xe6df('0x3')](_0x3568e1,_0x11d9d8);};}function removeListener(_0x5f5c9e,_0x23522a){return function(){FaxAccountEvents[_0xe6df('0x4')](_0x5f5c9e,_0x23522a);};}exports[_0xe6df('0x5')]=function(_0x4f0d38){for(var _0x2c8ce4=0x0,_0x286ed5=events['length'];_0x2c8ce4<_0x286ed5;_0x2c8ce4++){var _0x37e6af=events[_0x2c8ce4];var _0x37aee2=createListener(_0xe6df('0x6')+_0x37e6af,_0x4f0d38);FaxAccountEvents['on'](_0x37e6af,_0x37aee2);}};
\ No newline at end of file
+var _0x9989=['faxAccount:','./faxAccount.events','save','remove','emit','removeListener','register','length'];(function(_0x3547a5,_0xa6fa3f){var _0x3bfbce=function(_0x30dcf4){while(--_0x30dcf4){_0x3547a5['push'](_0x3547a5['shift']());}};_0x3bfbce(++_0xa6fa3f);}(_0x9989,0x91));var _0x9998=function(_0x5d99a2,_0xaa49d6){_0x5d99a2=_0x5d99a2-0x0;var _0x2cd82d=_0x9989[_0x5d99a2];return _0x2cd82d;};'use strict';var FaxAccountEvents=require(_0x9998('0x0'));var events=[_0x9998('0x1'),_0x9998('0x2'),'update'];function createListener(_0x5a349a,_0x5f306b){return function(_0x396dc5){_0x5f306b[_0x9998('0x3')](_0x5a349a,_0x396dc5);};}function removeListener(_0x3c1eb8,_0x31199d){return function(){FaxAccountEvents[_0x9998('0x4')](_0x3c1eb8,_0x31199d);};}exports[_0x9998('0x5')]=function(_0x57dcc7){for(var _0x4f2f46=0x0,_0x5ebc0b=events[_0x9998('0x6')];_0x4f2f46<_0x5ebc0b;_0x4f2f46++){var _0x11b0a6=events[_0x4f2f46];var _0x42cc90=createListener(_0x9998('0x7')+_0x11b0a6,_0x57dcc7);FaxAccountEvents['on'](_0x11b0a6,_0x42cc90);}};
\ No newline at end of file
diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js
index 6a33a41..7c21fd8 100644
--- a/server/api/faxAccount/index.js
+++ b/server/api/faxAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8b17=['/:id/dispositions','removeDispositions','/:id/users','removeAgents','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','getInteractions','getApplications','/:id/messages','getAgents','post','create','addAnswer','addInteraction','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','addAgents','update','delete'];(function(_0x438434,_0x36f21f){var _0x3b97c9=function(_0x1ecb7b){while(--_0x1ecb7b){_0x438434['push'](_0x438434['shift']());}};_0x3b97c9(++_0x36f21f);}(_0x8b17,0x151));var _0x78b1=function(_0x14b090,_0x3367cc){_0x14b090=_0x14b090-0x0;var _0x5d3efb=_0x8b17[_0x14b090];return _0x5d3efb;};'use strict';var multer=require('multer');var util=require(_0x78b1('0x0'));var path=require(_0x78b1('0x1'));var timeout=require(_0x78b1('0x2'));var express=require('express');var router=express[_0x78b1('0x3')]();var auth=require(_0x78b1('0x4'));var interaction=require(_0x78b1('0x5'));var config=require(_0x78b1('0x6'));var controller=require('./faxAccount.controller');router[_0x78b1('0x7')]('/',auth[_0x78b1('0x8')](),controller[_0x78b1('0x9')]);router['get'](_0x78b1('0xa'),auth[_0x78b1('0x8')](),controller[_0x78b1('0xb')]);router[_0x78b1('0x7')](_0x78b1('0xc'),auth[_0x78b1('0x8')](),controller[_0x78b1('0xd')]);router['get']('/:id/dispositions',auth[_0x78b1('0x8')](),controller['getDispositions']);router[_0x78b1('0x7')](_0x78b1('0xe'),auth[_0x78b1('0x8')](),controller[_0x78b1('0xf')]);router[_0x78b1('0x7')]('/:id/interactions',auth[_0x78b1('0x8')](),controller[_0x78b1('0x10')]);router['get']('/:id/applications',auth[_0x78b1('0x8')](),controller[_0x78b1('0x11')]);router['get'](_0x78b1('0x12'),auth[_0x78b1('0x8')](),controller['getMessages']);router[_0x78b1('0x7')]('/:id/users',auth[_0x78b1('0x8')](),controller[_0x78b1('0x13')]);router[_0x78b1('0x14')]('/',auth[_0x78b1('0x8')](),controller[_0x78b1('0x15')]);router[_0x78b1('0x14')]('/:id/dispositions',auth[_0x78b1('0x8')](),controller['addDisposition']);router[_0x78b1('0x14')](_0x78b1('0xe'),auth[_0x78b1('0x8')](),controller[_0x78b1('0x16')]);router[_0x78b1('0x14')]('/:id/interactions',auth[_0x78b1('0x8')](),controller[_0x78b1('0x17')]);router[_0x78b1('0x14')](_0x78b1('0x18'),auth[_0x78b1('0x8')](),controller[_0x78b1('0x19')]);router[_0x78b1('0x14')](_0x78b1('0x1a'),auth[_0x78b1('0x8')](),controller[_0x78b1('0x1b')]);router['post'](_0x78b1('0x1c'),auth[_0x78b1('0x8')](),controller['updateAccountApplications']);router['post'](_0x78b1('0x1d'),auth[_0x78b1('0x8')](),controller['send']);router[_0x78b1('0x14')]('/:id/users',auth[_0x78b1('0x8')](),controller[_0x78b1('0x1e')]);router['put'](_0x78b1('0xc'),auth['isAuthenticated'](),controller[_0x78b1('0x1f')]);router[_0x78b1('0x20')](_0x78b1('0xc'),auth[_0x78b1('0x8')](),controller['destroy']);router[_0x78b1('0x20')](_0x78b1('0x21'),auth[_0x78b1('0x8')](),controller[_0x78b1('0x22')]);router[_0x78b1('0x20')](_0x78b1('0xe'),auth[_0x78b1('0x8')](),controller['removeAnswers']);router[_0x78b1('0x20')](_0x78b1('0x23'),auth[_0x78b1('0x8')](),controller[_0x78b1('0x24')]);module['exports']=router;
\ No newline at end of file
+var _0x9557=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','addAnswer','addInteraction','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','put','update','delete','destroy','removeAnswers','removeAgents'];(function(_0x1dfc00,_0x38b3fb){var _0x168aca=function(_0x45bcb8){while(--_0x45bcb8){_0x1dfc00['push'](_0x1dfc00['shift']());}};_0x168aca(++_0x38b3fb);}(_0x9557,0xa1));var _0x7955=function(_0x5b0bf3,_0x2ed9fc){_0x5b0bf3=_0x5b0bf3-0x0;var _0x5d0064=_0x9557[_0x5b0bf3];return _0x5d0064;};'use strict';var multer=require('multer');var util=require(_0x7955('0x0'));var path=require(_0x7955('0x1'));var timeout=require(_0x7955('0x2'));var express=require(_0x7955('0x3'));var router=express[_0x7955('0x4')]();var auth=require(_0x7955('0x5'));var interaction=require(_0x7955('0x6'));var config=require('../../config/environment');var controller=require('./faxAccount.controller');router['get']('/',auth[_0x7955('0x7')](),controller[_0x7955('0x8')]);router[_0x7955('0x9')](_0x7955('0xa'),auth[_0x7955('0x7')](),controller[_0x7955('0xb')]);router[_0x7955('0x9')](_0x7955('0xc'),auth[_0x7955('0x7')](),controller[_0x7955('0xd')]);router['get'](_0x7955('0xe'),auth[_0x7955('0x7')](),controller['getDispositions']);router[_0x7955('0x9')](_0x7955('0xf'),auth['isAuthenticated'](),controller[_0x7955('0x10')]);router[_0x7955('0x9')](_0x7955('0x11'),auth[_0x7955('0x7')](),controller['getInteractions']);router[_0x7955('0x9')]('/:id/applications',auth[_0x7955('0x7')](),controller['getApplications']);router[_0x7955('0x9')](_0x7955('0x12'),auth[_0x7955('0x7')](),controller[_0x7955('0x13')]);router[_0x7955('0x9')](_0x7955('0x14'),auth['isAuthenticated'](),controller[_0x7955('0x15')]);router[_0x7955('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7955('0x16')](_0x7955('0xe'),auth[_0x7955('0x7')](),controller[_0x7955('0x17')]);router['post'](_0x7955('0xf'),auth[_0x7955('0x7')](),controller[_0x7955('0x18')]);router[_0x7955('0x16')](_0x7955('0x11'),auth[_0x7955('0x7')](),controller[_0x7955('0x19')]);router[_0x7955('0x16')](_0x7955('0x1a'),auth[_0x7955('0x7')](),controller[_0x7955('0x1b')]);router[_0x7955('0x16')](_0x7955('0x1c'),auth['isAuthenticated'](),controller[_0x7955('0x1d')]);router[_0x7955('0x16')](_0x7955('0x1e'),auth[_0x7955('0x7')](),controller[_0x7955('0x1f')]);router[_0x7955('0x16')](_0x7955('0x20'),auth[_0x7955('0x7')](),controller['send']);router[_0x7955('0x16')](_0x7955('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7955('0x21')](_0x7955('0xc'),auth[_0x7955('0x7')](),controller[_0x7955('0x22')]);router[_0x7955('0x23')](_0x7955('0xc'),auth[_0x7955('0x7')](),controller[_0x7955('0x24')]);router[_0x7955('0x23')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x7955('0x23')](_0x7955('0xf'),auth['isAuthenticated'](),controller[_0x7955('0x25')]);router[_0x7955('0x23')](_0x7955('0x14'),auth['isAuthenticated'](),controller[_0x7955('0x26')]);module[_0x7955('0x27')]=router;
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js
index 5cc99fb..8c11d17 100644
--- a/server/api/faxApplication/faxApplication.attributes.js
+++ b/server/api/faxApplication/faxApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa817=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x558cb5,_0x58ce98){var _0x4a46f5=function(_0x62df49){while(--_0x62df49){_0x558cb5['push'](_0x558cb5['shift']());}};_0x4a46f5(++_0x58ce98);}(_0xa817,0x7b));var _0x7a81=function(_0x520470,_0x484dc0){_0x520470=_0x520470-0x0;var _0x31674e=_0xa817[_0x520470];return _0x31674e;};'use strict';var Sequelize=require(_0x7a81('0x0'));module[_0x7a81('0x1')]={'priority':{'type':Sequelize[_0x7a81('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7a81('0x3')],'allowNull':![],'defaultValue':_0x7a81('0x4')},'appdata':{'type':Sequelize[_0x7a81('0x5')]()},'description':{'type':Sequelize[_0x7a81('0x3')]},'interval':{'type':Sequelize[_0x7a81('0x3')],'defaultValue':_0x7a81('0x6')}};
\ No newline at end of file
+var _0x349f=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x349f,0xa8));var _0xf349=function(_0x1e84a0,_0x5cd1f9){_0x1e84a0=_0x1e84a0-0x0;var _0xeb5c19=_0x349f[_0x1e84a0];return _0xeb5c19;};'use strict';var Sequelize=require(_0xf349('0x0'));module[_0xf349('0x1')]={'priority':{'type':Sequelize[_0xf349('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf349('0x3')},'appdata':{'type':Sequelize[_0xf349('0x4')]()},'description':{'type':Sequelize[_0xf349('0x5')]},'interval':{'type':Sequelize[_0xf349('0x5')],'defaultValue':_0xf349('0x6')}};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js
index 119ba5b..e9dd834 100644
--- a/server/api/faxApplication/faxApplication.controller.js
+++ b/server/api/faxApplication/faxApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc6ac=['api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','FaxApplication','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','pick','merge','type','key','VIRTUAL','field','filter','options','count','findAll','rows','catch','show','rawAttributes','includeAll','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x441033,_0x3d7e06){var _0x2f137f=function(_0x4a0708){while(--_0x4a0708){_0x441033['push'](_0x441033['shift']());}};_0x2f137f(++_0x3d7e06);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2417f2,_0x2c944e){_0x2417f2=_0x2417f2-0x0;var _0x1b7f57=_0xc6ac[_0x2417f2];return _0x1b7f57;};'use strict';var pdf=require(_0xcc6a('0x0'));var emlformat=require(_0xcc6a('0x1'));var rimraf=require(_0xcc6a('0x2'));var zipdir=require(_0xcc6a('0x3'));var jsonpatch=require(_0xcc6a('0x4'));var rp=require(_0xcc6a('0x5'));var moment=require(_0xcc6a('0x6'));var BPromise=require(_0xcc6a('0x7'));var Mustache=require(_0xcc6a('0x8'));var util=require(_0xcc6a('0x9'));var path=require(_0xcc6a('0xa'));var sox=require(_0xcc6a('0xb'));var csv=require(_0xcc6a('0xc'));var ejs=require(_0xcc6a('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xc'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xcc6a('0x15'));var logger=require(_0xcc6a('0x16'))(_0xcc6a('0x17'));var utils=require('../../config/utils');var config=require(_0xcc6a('0x18'));var db=require(_0xcc6a('0x19'))['db'];function respondWithStatusCode(_0x27b63a,_0x55af93){_0x55af93=_0x55af93||0xcc;return function(_0x59ce6d){if(_0x59ce6d){return _0x27b63a[_0xcc6a('0x1a')](_0x55af93);}return _0x27b63a[_0xcc6a('0x1b')](_0x55af93)[_0xcc6a('0x1c')]();};}function respondWithResult(_0x559a0a,_0x483ed4){_0x483ed4=_0x483ed4||0xc8;return function(_0x369dc1){if(_0x369dc1){return _0x559a0a[_0xcc6a('0x1b')](_0x483ed4)[_0xcc6a('0x1d')](_0x369dc1);}};}function respondWithFilteredResult(_0x348af7,_0x96f9de){return function(_0x337ec5){if(_0x337ec5){var _0x4133fa=_0x337ec5['count'],_0x403b18=_0x96f9de[_0xcc6a('0x1e')],_0x56ffb0=_0x96f9de[_0xcc6a('0x1e')]+_0x96f9de[_0xcc6a('0x1f')],_0x4e628f;if(_0x56ffb0>=_0x4133fa){_0x56ffb0=_0x4133fa;_0x4e628f=0xc8;}else{_0x4e628f=0xce;}_0x348af7[_0xcc6a('0x1b')](_0x4e628f);return _0x348af7[_0xcc6a('0x20')](_0xcc6a('0x21'),_0x403b18+'-'+_0x56ffb0+'/'+_0x4133fa)[_0xcc6a('0x1d')](_0x337ec5);}return null;};}function patchUpdates(_0x412bc7){return function(_0x374e51){try{jsonpatch[_0xcc6a('0x22')](_0x374e51,_0x412bc7,!![]);}catch(_0x1d20a3){return BPromise['reject'](_0x1d20a3);}return _0x374e51[_0xcc6a('0x23')]();};}function saveUpdates(_0x3e1fda,_0x355b6f){return function(_0x368a6e){if(_0x368a6e){return _0x368a6e[_0xcc6a('0x24')](_0x3e1fda)[_0xcc6a('0x25')](function(_0x36c80f){return _0x36c80f;});}return null;};}function removeEntity(_0x43f510,_0x2254a8){return function(_0x19d32c){if(_0x19d32c){return _0x19d32c[_0xcc6a('0x26')]()[_0xcc6a('0x25')](function(){_0x43f510['status'](0xcc)[_0xcc6a('0x1c')]();});}};}function handleEntityNotFound(_0x3a081e,_0x38f812){return function(_0x581aae){if(!_0x581aae){_0x3a081e[_0xcc6a('0x1a')](0x194);}return _0x581aae;};}function handleError(_0x294486,_0x3a00e5){_0x3a00e5=_0x3a00e5||0x1f4;return function(_0x3ed7ce){logger[_0xcc6a('0x27')](_0x3ed7ce[_0xcc6a('0x28')]);if(_0x3ed7ce['name']){delete _0x3ed7ce[_0xcc6a('0x29')];}_0x294486[_0xcc6a('0x1b')](_0x3a00e5)[_0xcc6a('0x2a')](_0x3ed7ce);};}exports['index']=function(_0x3afb3a,_0x3dad72){var _0x4da301={},_0xb377de={},_0x8b1b2b={'count':0x0,'rows':[]};var _0x3233d1=db[_0xcc6a('0x2b')]['rawAttributes'];_0xb377de[_0xcc6a('0x2c')]=_[_0xcc6a('0x2d')](_0x3233d1);_0xb377de[_0xcc6a('0x2e')]=_['keys'](_0x3afb3a[_0xcc6a('0x2e')]);_0xb377de['filters']=_['intersection'](_0xb377de[_0xcc6a('0x2c')],_0xb377de[_0xcc6a('0x2e')]);_0x4da301[_0xcc6a('0x2f')]=_[_0xcc6a('0x30')](_0xb377de[_0xcc6a('0x2c')],qs[_0xcc6a('0x31')](_0x3afb3a['query'][_0xcc6a('0x31')]));_0x4da301[_0xcc6a('0x2f')]=_0x4da301[_0xcc6a('0x2f')][_0xcc6a('0x32')]?_0x4da301[_0xcc6a('0x2f')]:_0xb377de[_0xcc6a('0x2c')];if(!_0x3afb3a[_0xcc6a('0x2e')][_0xcc6a('0x33')]('nolimit')){_0x4da301[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x3afb3a[_0xcc6a('0x2e')][_0xcc6a('0x1f')]);_0x4da301[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x3afb3a[_0xcc6a('0x2e')]['offset']);}_0x4da301[_0xcc6a('0x34')]=qs['sort'](_0x3afb3a['query']['sort']);_0x4da301[_0xcc6a('0x35')]=qs[_0xcc6a('0x36')](_[_0xcc6a('0x37')](_0x3afb3a[_0xcc6a('0x2e')],_0xb377de[_0xcc6a('0x36')]));if(_0x3afb3a['query']['filter']){_0x4da301[_0xcc6a('0x35')]=_[_0xcc6a('0x38')](_0x4da301[_0xcc6a('0x35')],{'$or':_['map'](_0x3233d1,function(_0x382283){if(_0x382283[_0xcc6a('0x39')][_0xcc6a('0x3a')]!==_0xcc6a('0x3b')){var _0x73bf0d={};_0x73bf0d[_0x382283[_0xcc6a('0x3c')]]={'$like':'%'+_0x3afb3a[_0xcc6a('0x2e')][_0xcc6a('0x3d')]+'%'};return _0x73bf0d;}})});}_0x4da301=_[_0xcc6a('0x38')]({},_0x4da301,_0x3afb3a[_0xcc6a('0x3e')]);var _0x5b11c8={'where':_0x4da301[_0xcc6a('0x35')]};return db[_0xcc6a('0x2b')][_0xcc6a('0x3f')](_0x5b11c8)[_0xcc6a('0x25')](function(_0x33e8c8){_0x8b1b2b[_0xcc6a('0x3f')]=_0x33e8c8;if(_0x3afb3a[_0xcc6a('0x2e')]['includeAll']){_0x4da301['include']=[{'all':!![]}];}return db[_0xcc6a('0x2b')][_0xcc6a('0x40')](_0x4da301);})[_0xcc6a('0x25')](function(_0x1fd8e1){_0x8b1b2b[_0xcc6a('0x41')]=_0x1fd8e1;return _0x8b1b2b;})[_0xcc6a('0x25')](respondWithFilteredResult(_0x3dad72,_0x4da301))[_0xcc6a('0x42')](handleError(_0x3dad72,null));};exports[_0xcc6a('0x43')]=function(_0x49b65c,_0x56bc7d){var _0x470e3b={'raw':!![],'where':{'id':_0x49b65c['params']['id']}},_0x4a4c4d={};_0x4a4c4d['model']=_[_0xcc6a('0x2d')](db[_0xcc6a('0x2b')][_0xcc6a('0x44')]);_0x4a4c4d[_0xcc6a('0x2e')]=_[_0xcc6a('0x2d')](_0x49b65c['query']);_0x4a4c4d[_0xcc6a('0x36')]=_[_0xcc6a('0x30')](_0x4a4c4d[_0xcc6a('0x2c')],_0x4a4c4d[_0xcc6a('0x2e')]);_0x470e3b[_0xcc6a('0x2f')]=_[_0xcc6a('0x30')](_0x4a4c4d['model'],qs[_0xcc6a('0x31')](_0x49b65c[_0xcc6a('0x2e')][_0xcc6a('0x31')]));_0x470e3b[_0xcc6a('0x2f')]=_0x470e3b['attributes'][_0xcc6a('0x32')]?_0x470e3b['attributes']:_0x4a4c4d[_0xcc6a('0x2c')];if(_0x49b65c[_0xcc6a('0x2e')][_0xcc6a('0x45')]){_0x470e3b['include']=[{'all':!![]}];}_0x470e3b=_[_0xcc6a('0x38')]({},_0x470e3b,_0x49b65c[_0xcc6a('0x3e')]);return db[_0xcc6a('0x2b')]['find'](_0x470e3b)['then'](handleEntityNotFound(_0x56bc7d,null))[_0xcc6a('0x25')](respondWithResult(_0x56bc7d,null))[_0xcc6a('0x42')](handleError(_0x56bc7d,null));};exports[_0xcc6a('0x46')]=function(_0x3d1e6b,_0x345e94){return db['FaxApplication'][_0xcc6a('0x46')](_0x3d1e6b[_0xcc6a('0x47')],{})['then'](respondWithResult(_0x345e94,0xc9))[_0xcc6a('0x42')](handleError(_0x345e94,null));};exports[_0xcc6a('0x24')]=function(_0x42ffcc,_0x12a594){if(_0x42ffcc[_0xcc6a('0x47')]['id']){delete _0x42ffcc[_0xcc6a('0x47')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x42ffcc['params']['id']}})[_0xcc6a('0x25')](handleEntityNotFound(_0x12a594,null))[_0xcc6a('0x25')](saveUpdates(_0x42ffcc[_0xcc6a('0x47')],null))[_0xcc6a('0x25')](respondWithResult(_0x12a594,null))['catch'](handleError(_0x12a594,null));};exports[_0xcc6a('0x26')]=function(_0x5e7bab,_0x3aa7dd){return db[_0xcc6a('0x2b')][_0xcc6a('0x48')]({'where':{'id':_0x5e7bab[_0xcc6a('0x49')]['id']}})[_0xcc6a('0x25')](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x25')](removeEntity(_0x3aa7dd,null))['catch'](handleError(_0x3aa7dd,null));};
\ No newline at end of file
+var _0x524e=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','FaxApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','limit','sort','where','pick','filter','merge','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x30df7d,_0x321184){var _0x3d39a0=function(_0x374ec0){while(--_0x374ec0){_0x30df7d['push'](_0x30df7d['shift']());}};_0x3d39a0(++_0x321184);}(_0x524e,0x15e));var _0xe524=function(_0x4bf29d,_0x529e9f){_0x4bf29d=_0x4bf29d-0x0;var _0x51d928=_0x524e[_0x4bf29d];return _0x51d928;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe524('0x0'));var zipdir=require(_0xe524('0x1'));var jsonpatch=require(_0xe524('0x2'));var rp=require(_0xe524('0x3'));var moment=require(_0xe524('0x4'));var BPromise=require(_0xe524('0x5'));var Mustache=require(_0xe524('0x6'));var util=require(_0xe524('0x7'));var path=require(_0xe524('0x8'));var sox=require(_0xe524('0x9'));var csv=require('to-csv');var ejs=require(_0xe524('0xa'));var fs=require('fs');var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0xf'));var querystring=require(_0xe524('0x10'));var Papa=require(_0xe524('0x11'));var Redis=require(_0xe524('0x12'));var authService=require(_0xe524('0x13'));var qs=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var db=require(_0xe524('0x1a'))['db'];function respondWithStatusCode(_0x1bdcee,_0x26cc77){_0x26cc77=_0x26cc77||0xcc;return function(_0x5077c1){if(_0x5077c1){return _0x1bdcee['sendStatus'](_0x26cc77);}return _0x1bdcee[_0xe524('0x1b')](_0x26cc77)[_0xe524('0x1c')]();};}function respondWithResult(_0x11adbc,_0xf4c00d){_0xf4c00d=_0xf4c00d||0xc8;return function(_0x20a852){if(_0x20a852){return _0x11adbc['status'](_0xf4c00d)[_0xe524('0x1d')](_0x20a852);}};}function respondWithFilteredResult(_0x51e9fe,_0x19f013){return function(_0x1b0af6){if(_0x1b0af6){var _0x48165e=_0x1b0af6['count'],_0x569660=_0x19f013[_0xe524('0x1e')],_0x488fce=_0x19f013['offset']+_0x19f013['limit'],_0x109795;if(_0x488fce>=_0x48165e){_0x488fce=_0x48165e;_0x109795=0xc8;}else{_0x109795=0xce;}_0x51e9fe['status'](_0x109795);return _0x51e9fe[_0xe524('0x1f')]('Content-Range',_0x569660+'-'+_0x488fce+'/'+_0x48165e)[_0xe524('0x1d')](_0x1b0af6);}return null;};}function patchUpdates(_0x238f8f){return function(_0x278de9){try{jsonpatch[_0xe524('0x20')](_0x278de9,_0x238f8f,!![]);}catch(_0x5d7b17){return BPromise[_0xe524('0x21')](_0x5d7b17);}return _0x278de9[_0xe524('0x22')]();};}function saveUpdates(_0x49d104,_0x467c2a){return function(_0x309f85){if(_0x309f85){return _0x309f85[_0xe524('0x23')](_0x49d104)[_0xe524('0x24')](function(_0x1c4194){return _0x1c4194;});}return null;};}function removeEntity(_0x1cab6c,_0xbf059b){return function(_0x375219){if(_0x375219){return _0x375219[_0xe524('0x25')]()['then'](function(){_0x1cab6c[_0xe524('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x577d1f,_0x2d2f83){return function(_0x23df5e){if(!_0x23df5e){_0x577d1f[_0xe524('0x26')](0x194);}return _0x23df5e;};}function handleError(_0x85fc51,_0x599d5d){_0x599d5d=_0x599d5d||0x1f4;return function(_0x158f07){logger['error'](_0x158f07[_0xe524('0x27')]);if(_0x158f07[_0xe524('0x28')]){delete _0x158f07[_0xe524('0x28')];}_0x85fc51[_0xe524('0x1b')](_0x599d5d)[_0xe524('0x29')](_0x158f07);};}exports[_0xe524('0x2a')]=function(_0x2141db,_0x583cc3){var _0x58a896={},_0x283f18={},_0x45abad={'count':0x0,'rows':[]};var _0x476572=db[_0xe524('0x2b')][_0xe524('0x2c')];_0x283f18['model']=_['keys'](_0x476572);_0x283f18[_0xe524('0x2d')]=_[_0xe524('0x2e')](_0x2141db[_0xe524('0x2d')]);_0x283f18[_0xe524('0x2f')]=_[_0xe524('0x30')](_0x283f18['model'],_0x283f18[_0xe524('0x2d')]);_0x58a896[_0xe524('0x31')]=_['intersection'](_0x283f18['model'],qs[_0xe524('0x32')](_0x2141db[_0xe524('0x2d')]['fields']));_0x58a896[_0xe524('0x31')]=_0x58a896['attributes'][_0xe524('0x33')]?_0x58a896['attributes']:_0x283f18[_0xe524('0x34')];if(!_0x2141db[_0xe524('0x2d')][_0xe524('0x35')]('nolimit')){_0x58a896[_0xe524('0x36')]=qs['limit'](_0x2141db[_0xe524('0x2d')][_0xe524('0x36')]);_0x58a896[_0xe524('0x1e')]=qs['offset'](_0x2141db[_0xe524('0x2d')][_0xe524('0x1e')]);}_0x58a896['order']=qs[_0xe524('0x37')](_0x2141db[_0xe524('0x2d')][_0xe524('0x37')]);_0x58a896[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x2141db[_0xe524('0x2d')],_0x283f18[_0xe524('0x2f')]));if(_0x2141db[_0xe524('0x2d')][_0xe524('0x3a')]){_0x58a896[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x58a896[_0xe524('0x38')],{'$or':_['map'](_0x476572,function(_0x150a9f){if(_0x150a9f['type'][_0xe524('0x3c')]!==_0xe524('0x3d')){var _0x51cafc={};_0x51cafc[_0x150a9f[_0xe524('0x3e')]]={'$like':'%'+_0x2141db['query'][_0xe524('0x3a')]+'%'};return _0x51cafc;}})});}_0x58a896=_[_0xe524('0x3b')]({},_0x58a896,_0x2141db[_0xe524('0x3f')]);var _0x3103e9={'where':_0x58a896[_0xe524('0x38')]};return db[_0xe524('0x2b')][_0xe524('0x40')](_0x3103e9)[_0xe524('0x24')](function(_0x5e8e64){_0x45abad[_0xe524('0x40')]=_0x5e8e64;if(_0x2141db[_0xe524('0x2d')][_0xe524('0x41')]){_0x58a896[_0xe524('0x42')]=[{'all':!![]}];}return db[_0xe524('0x2b')][_0xe524('0x43')](_0x58a896);})[_0xe524('0x24')](function(_0x158d45){_0x45abad['rows']=_0x158d45;return _0x45abad;})[_0xe524('0x24')](respondWithFilteredResult(_0x583cc3,_0x58a896))[_0xe524('0x44')](handleError(_0x583cc3,null));};exports[_0xe524('0x45')]=function(_0x59781b,_0x238673){var _0x5213ed={'raw':!![],'where':{'id':_0x59781b[_0xe524('0x46')]['id']}},_0x2574a2={};_0x2574a2[_0xe524('0x34')]=_[_0xe524('0x2e')](db[_0xe524('0x2b')][_0xe524('0x2c')]);_0x2574a2[_0xe524('0x2d')]=_['keys'](_0x59781b[_0xe524('0x2d')]);_0x2574a2[_0xe524('0x2f')]=_[_0xe524('0x30')](_0x2574a2[_0xe524('0x34')],_0x2574a2[_0xe524('0x2d')]);_0x5213ed[_0xe524('0x31')]=_['intersection'](_0x2574a2[_0xe524('0x34')],qs[_0xe524('0x32')](_0x59781b[_0xe524('0x2d')]['fields']));_0x5213ed[_0xe524('0x31')]=_0x5213ed['attributes']['length']?_0x5213ed[_0xe524('0x31')]:_0x2574a2[_0xe524('0x34')];if(_0x59781b['query'][_0xe524('0x41')]){_0x5213ed[_0xe524('0x42')]=[{'all':!![]}];}_0x5213ed=_[_0xe524('0x3b')]({},_0x5213ed,_0x59781b[_0xe524('0x3f')]);return db['FaxApplication']['find'](_0x5213ed)[_0xe524('0x24')](handleEntityNotFound(_0x238673,null))[_0xe524('0x24')](respondWithResult(_0x238673,null))['catch'](handleError(_0x238673,null));};exports[_0xe524('0x47')]=function(_0x4e3809,_0x472519){return db[_0xe524('0x2b')][_0xe524('0x47')](_0x4e3809[_0xe524('0x48')],{})[_0xe524('0x24')](respondWithResult(_0x472519,0xc9))[_0xe524('0x44')](handleError(_0x472519,null));};exports[_0xe524('0x23')]=function(_0x22fb42,_0x1642a7){if(_0x22fb42[_0xe524('0x48')]['id']){delete _0x22fb42[_0xe524('0x48')]['id'];}return db[_0xe524('0x2b')][_0xe524('0x49')]({'where':{'id':_0x22fb42[_0xe524('0x46')]['id']}})[_0xe524('0x24')](handleEntityNotFound(_0x1642a7,null))['then'](saveUpdates(_0x22fb42[_0xe524('0x48')],null))['then'](respondWithResult(_0x1642a7,null))['catch'](handleError(_0x1642a7,null));};exports[_0xe524('0x25')]=function(_0x59fe6b,_0x232cf0){return db[_0xe524('0x2b')]['find']({'where':{'id':_0x59fe6b[_0xe524('0x46')]['id']}})['then'](handleEntityNotFound(_0x232cf0,null))['then'](removeEntity(_0x232cf0,null))[_0xe524('0x44')](handleError(_0x232cf0,null));};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js
index 2ae98eb..84eb5d7 100644
--- a/server/api/faxApplication/faxApplication.model.js
+++ b/server/api/faxApplication/faxApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['rimraf','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7995('0xc'),'collate':_0x7995('0xd')});};
\ No newline at end of file
+var _0x5c12=['request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c12,0x188));var _0x25c1=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0x5c12[_0xcfeda9];return _0x4826c7;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var logger=require(_0x25c1('0x1'))('api');var moment=require(_0x25c1('0x2'));var BPromise=require(_0x25c1('0x3'));var rp=require(_0x25c1('0x4'));var fs=require('fs');var path=require(_0x25c1('0x5'));var rimraf=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var attributes=require(_0x25c1('0x8'));module['exports']=function(_0x204287,_0x42ac16){return _0x204287[_0x25c1('0x9')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x25c1('0xa'),'collate':_0x25c1('0xb')});};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js
index 0664fec..5a7c250 100644
--- a/server/api/faxApplication/faxApplication.rpc.js
+++ b/server/api/faxApplication/faxApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9393=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxApplication','update','body','options','where','attributes','limit','UpdateFaxApplication','catch','lodash','util','moment','bluebird'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0x9393,0x1cd));var _0x3939=function(_0x128b3c,_0x3190da){_0x128b3c=_0x128b3c-0x0;var _0x33f5b5=_0x9393[_0x128b3c];return _0x33f5b5;};'use strict';var _=require(_0x3939('0x0'));var util=require(_0x3939('0x1'));var moment=require(_0x3939('0x2'));var BPromise=require(_0x3939('0x3'));var rs=require(_0x3939('0x4'));var fs=require('fs');var Redis=require(_0x3939('0x5'));var db=require(_0x3939('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3939('0x7'))(_0x3939('0x8'));var config=require('../../config/environment');var jayson=require(_0x3939('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8957,_0x17cfe1,_0x476b76){return new BPromise(function(_0x478198,_0x3a88b5){return client[_0x3939('0xa')](_0x5a8957,_0x476b76)[_0x3939('0xb')](function(_0x46b3f6){logger[_0x3939('0xc')](_0x3939('0xd'),_0x17cfe1,_0x3939('0xe'));logger[_0x3939('0xf')](_0x3939('0x10'),_0x17cfe1,'request\x20sent',JSON[_0x3939('0x11')](_0x46b3f6));if(_0x46b3f6[_0x3939('0x12')]){if(_0x46b3f6[_0x3939('0x12')][_0x3939('0x13')]===0x1f4){logger[_0x3939('0x12')](_0x3939('0xd'),_0x17cfe1,_0x46b3f6[_0x3939('0x12')][_0x3939('0x14')]);return _0x3a88b5(_0x46b3f6['error'][_0x3939('0x14')]);}logger[_0x3939('0x12')](_0x3939('0xd'),_0x17cfe1,_0x46b3f6[_0x3939('0x12')]['message']);return _0x478198(_0x46b3f6[_0x3939('0x12')][_0x3939('0x14')]);}else{logger[_0x3939('0xc')](_0x3939('0xd'),_0x17cfe1,_0x3939('0xe'));_0x478198(_0x46b3f6[_0x3939('0x15')][_0x3939('0x14')]);}})['catch'](function(_0x3b4494){logger[_0x3939('0x12')](_0x3939('0xd'),_0x17cfe1,_0x3b4494);_0x3a88b5(_0x3b4494);});});}exports['UpdateFaxApplication']=function(_0x4e3ec0){var _0x4b2b1e=this;return new Promise(function(_0x64ba82,_0x2f2d8f){return db[_0x3939('0x16')][_0x3939('0x17')](_0x4e3ec0[_0x3939('0x18')],{'raw':_0x4e3ec0[_0x3939('0x19')]?_0x4e3ec0[_0x3939('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e3ec0[_0x3939('0x19')]?_0x4e3ec0[_0x3939('0x19')][_0x3939('0x1a')]||null:null,'attributes':_0x4e3ec0['options']?_0x4e3ec0[_0x3939('0x19')][_0x3939('0x1b')]||null:null,'limit':_0x4e3ec0['options']?_0x4e3ec0[_0x3939('0x19')][_0x3939('0x1c')]||null:null})['then'](function(_0xa79dc9){logger['info'](_0x3939('0x1d'),_0x4e3ec0);logger[_0x3939('0xf')](_0x3939('0x1d'),_0x4e3ec0,JSON[_0x3939('0x11')](_0xa79dc9));_0x64ba82(_0xa79dc9);})[_0x3939('0x1e')](function(_0x232021){logger[_0x3939('0x12')]('UpdateFaxApplication',_0x232021['message'],_0x4e3ec0);_0x2f2d8f(_0x4b2b1e[_0x3939('0x12')](0x1f4,_0x232021['message']));});});};
\ No newline at end of file
+var _0xa752=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','where'];(function(_0x28d76b,_0x54c715){var _0x17f3d5=function(_0x46a522){while(--_0x46a522){_0x28d76b['push'](_0x28d76b['shift']());}};_0x17f3d5(++_0x54c715);}(_0xa752,0xcc));var _0x2a75=function(_0x410bf4,_0x4dd646){_0x410bf4=_0x410bf4-0x0;var _0x35fd77=_0xa752[_0x410bf4];return _0x35fd77;};'use strict';var _=require(_0x2a75('0x0'));var util=require(_0x2a75('0x1'));var moment=require(_0x2a75('0x2'));var BPromise=require(_0x2a75('0x3'));var rs=require(_0x2a75('0x4'));var fs=require('fs');var Redis=require(_0x2a75('0x5'));var db=require(_0x2a75('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a75('0x7'));var config=require('../../config/environment');var jayson=require(_0x2a75('0x8'));var client=jayson[_0x2a75('0x9')][_0x2a75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xebefbf,_0x4af6f5,_0x3d1cd5){return new BPromise(function(_0x3b53a3,_0x1372f5){return client[_0x2a75('0xb')](_0xebefbf,_0x3d1cd5)[_0x2a75('0xc')](function(_0x224a5b){logger[_0x2a75('0xd')](_0x2a75('0xe'),_0x4af6f5,_0x2a75('0xf'));logger[_0x2a75('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x4af6f5,'request\x20sent',JSON['stringify'](_0x224a5b));if(_0x224a5b['error']){if(_0x224a5b['error'][_0x2a75('0x11')]===0x1f4){logger[_0x2a75('0x12')](_0x2a75('0xe'),_0x4af6f5,_0x224a5b[_0x2a75('0x12')][_0x2a75('0x13')]);return _0x1372f5(_0x224a5b['error']['message']);}logger[_0x2a75('0x12')](_0x2a75('0xe'),_0x4af6f5,_0x224a5b[_0x2a75('0x12')][_0x2a75('0x13')]);return _0x3b53a3(_0x224a5b[_0x2a75('0x12')][_0x2a75('0x13')]);}else{logger[_0x2a75('0xd')](_0x2a75('0xe'),_0x4af6f5,_0x2a75('0xf'));_0x3b53a3(_0x224a5b[_0x2a75('0x14')][_0x2a75('0x13')]);}})[_0x2a75('0x15')](function(_0x5d4c10){logger[_0x2a75('0x12')](_0x2a75('0xe'),_0x4af6f5,_0x5d4c10);_0x1372f5(_0x5d4c10);});});}exports[_0x2a75('0x16')]=function(_0x5481ce){var _0xdf2e7f=this;return new Promise(function(_0x1fe019,_0x11bdc8){return db[_0x2a75('0x17')][_0x2a75('0x18')](_0x5481ce[_0x2a75('0x19')],{'raw':_0x5481ce[_0x2a75('0x1a')]?_0x5481ce['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5481ce[_0x2a75('0x1a')]?_0x5481ce['options'][_0x2a75('0x1b')]||null:null,'attributes':_0x5481ce[_0x2a75('0x1a')]?_0x5481ce[_0x2a75('0x1a')]['attributes']||null:null,'limit':_0x5481ce[_0x2a75('0x1a')]?_0x5481ce[_0x2a75('0x1a')]['limit']||null:null})[_0x2a75('0xc')](function(_0x51deaf){logger[_0x2a75('0xd')](_0x2a75('0x16'),_0x5481ce);logger['debug'](_0x2a75('0x16'),_0x5481ce,JSON[_0x2a75('0x1c')](_0x51deaf));_0x1fe019(_0x51deaf);})[_0x2a75('0x15')](function(_0x437c04){logger[_0x2a75('0x12')](_0x2a75('0x16'),_0x437c04[_0x2a75('0x13')],_0x5481ce);_0x11bdc8(_0xdf2e7f[_0x2a75('0x12')](0x1f4,_0x437c04[_0x2a75('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js
index f38f097..8a1f6bc 100644
--- a/server/api/faxApplication/index.js
+++ b/server/api/faxApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd914=['get','index','/:id','isAuthenticated','show','post','create','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1771f8,_0x76adec){var _0x7845ec=function(_0x192a32){while(--_0x192a32){_0x1771f8['push'](_0x1771f8['shift']());}};_0x7845ec(++_0x76adec);}(_0xd914,0x17f));var _0x4d91=function(_0x5817e6,_0x44a2d0){_0x5817e6=_0x5817e6-0x0;var _0x51916a=_0xd914[_0x5817e6];return _0x51916a;};'use strict';var multer=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var path=require('path');var timeout=require(_0x4d91('0x2'));var express=require(_0x4d91('0x3'));var router=express[_0x4d91('0x4')]();var auth=require(_0x4d91('0x5'));var interaction=require(_0x4d91('0x6'));var config=require(_0x4d91('0x7'));var controller=require('./faxApplication.controller');router[_0x4d91('0x8')]('/',auth['isAuthenticated'](),controller[_0x4d91('0x9')]);router[_0x4d91('0x8')](_0x4d91('0xa'),auth[_0x4d91('0xb')](),controller[_0x4d91('0xc')]);router[_0x4d91('0xd')]('/',auth[_0x4d91('0xb')](),controller[_0x4d91('0xe')]);router['put'](_0x4d91('0xa'),auth[_0x4d91('0xb')](),controller[_0x4d91('0xf')]);router[_0x4d91('0x10')](_0x4d91('0xa'),auth[_0x4d91('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x97c1=['util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer'];(function(_0x8b3778,_0x4453db){var _0x53bdc8=function(_0x34941b){while(--_0x34941b){_0x8b3778['push'](_0x8b3778['shift']());}};_0x53bdc8(++_0x4453db);}(_0x97c1,0xdf));var _0x197c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x97c1[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var path=require('path');var timeout=require(_0x197c('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x197c('0x3'));var interaction=require(_0x197c('0x4'));var config=require(_0x197c('0x5'));var controller=require(_0x197c('0x6'));router[_0x197c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x197c('0x7')](_0x197c('0x8'),auth[_0x197c('0x9')](),controller[_0x197c('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x197c('0xb')]);router['put'](_0x197c('0x8'),auth[_0x197c('0x9')](),controller[_0x197c('0xc')]);router[_0x197c('0xd')]('/:id',auth[_0x197c('0x9')](),controller[_0x197c('0xe')]);module[_0x197c('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js
index 7b25cb2..4f0dcc2 100644
--- a/server/api/faxInteraction/faxInteraction.attributes.js
+++ b/server/api/faxInteraction/faxInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb819=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xb819,0x137));var _0x9b81=function(_0x1cf5f3,_0x43bb33){_0x1cf5f3=_0x1cf5f3-0x0;var _0x180387=_0xb819[_0x1cf5f3];return _0x180387;};'use strict';var Sequelize=require(_0x9b81('0x0'));module['exports']={'closed':{'type':Sequelize[_0x9b81('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9b81('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9b81('0x3')]},'read1stAt':{'type':Sequelize[_0x9b81('0x2')]},'fax':{'type':Sequelize[_0x9b81('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9b81('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9b81('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9b81('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xe2ea=['out','exports','DATE','ENUM'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xe2ea,0x101));var _0xae2e=function(_0x1376bf,_0xb930d2){_0x1376bf=_0x1376bf-0x0;var _0x1ef322=_0xe2ea[_0x1376bf];return _0x1ef322;};'use strict';var Sequelize=require('sequelize');module[_0xae2e('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xae2e('0x1')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xae2e('0x1')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xae2e('0x2')]('in',_0xae2e('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xae2e('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xae2e('0x3')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js
index 0576827..b5b118c 100644
--- a/server/api/faxInteraction/faxInteraction.controller.js
+++ b/server/api/faxInteraction/faxInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0cb6=['isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$lte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','i.id','Sequelize','SELECT','read','%s\x20=\x200','toString','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','sequelize','keyBy','merge','a.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.mobile','c.fax','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','groupBy','FaxInteractionId','Users','split','Tags','rows','params','includeAll','options','find','catch','create','body','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','Tag','emit','faxInteractionTags:save','removeTags','unix','join','server','files','attachments','interaction-%s.zip','Attachment','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','FaxInteraction','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','me.FaxInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.FaxInteractionId','users','left_join','user_has_fax_interactions','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_messages','advancedFilter','parse','forEach','createdAt','dateStart','day','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','TagId','Messages.count','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20<\x20?','\x20>\x20?','map','filter'];(function(_0x23ce49,_0x5bcdec){var _0x4f111c=function(_0x44e94e){while(--_0x44e94e){_0x23ce49['push'](_0x23ce49['shift']());}};_0x4f111c(++_0x5bcdec);}(_0x0cb6,0x120));var _0x60cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cb6[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x60cb('0x0'));var emlformat=require(_0x60cb('0x1'));var rimraf=require(_0x60cb('0x2'));var zipdir=require(_0x60cb('0x3'));var jsonpatch=require(_0x60cb('0x4'));var rp=require(_0x60cb('0x5'));var moment=require(_0x60cb('0x6'));var BPromise=require(_0x60cb('0x7'));var Mustache=require(_0x60cb('0x8'));var util=require(_0x60cb('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x60cb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x60cb('0xb'));var squel=require(_0x60cb('0xc'));var crypto=require(_0x60cb('0xd'));var jsforce=require(_0x60cb('0xe'));var deskjs=require(_0x60cb('0xf'));var toCsv=require(_0x60cb('0xa'));var querystring=require('querystring');var Papa=require(_0x60cb('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x60cb('0x11'));var hardwareService=require(_0x60cb('0x12'));var logger=require(_0x60cb('0x13'))(_0x60cb('0x14'));var utils=require(_0x60cb('0x15'));var config=require(_0x60cb('0x16'));var db=require(_0x60cb('0x17'))['db'];config[_0x60cb('0x18')]=_['defaults'](config[_0x60cb('0x18')],{'host':_0x60cb('0x19'),'port':0x18eb});var socket=require(_0x60cb('0x1a'))(new Redis(config[_0x60cb('0x18')]));require(_0x60cb('0x1b'))['register'](socket);function respondWithStatusCode(_0x5f5393,_0x49010d){_0x49010d=_0x49010d||0xcc;return function(_0x2d1426){if(_0x2d1426){return _0x5f5393[_0x60cb('0x1c')](_0x49010d);}return _0x5f5393[_0x60cb('0x1d')](_0x49010d)[_0x60cb('0x1e')]();};}function respondWithResult(_0x49fe2b,_0x13bd04){_0x13bd04=_0x13bd04||0xc8;return function(_0x2012b2){if(_0x2012b2){return _0x49fe2b[_0x60cb('0x1d')](_0x13bd04)[_0x60cb('0x1f')](_0x2012b2);}};}function respondWithFilteredResult(_0x17dfe5,_0x25f422){return function(_0x1efd59){if(_0x1efd59){var _0x8bdf60=_0x1efd59[_0x60cb('0x20')],_0x5c5b20=_0x25f422[_0x60cb('0x21')],_0x2f9219=_0x25f422['offset']+_0x25f422['limit'],_0xad11f2;if(_0x2f9219>=_0x8bdf60){_0x2f9219=_0x8bdf60;_0xad11f2=0xc8;}else{_0xad11f2=0xce;}_0x17dfe5['status'](_0xad11f2);return _0x17dfe5['set'](_0x60cb('0x22'),_0x5c5b20+'-'+_0x2f9219+'/'+_0x8bdf60)[_0x60cb('0x1f')](_0x1efd59);}return null;};}function patchUpdates(_0x6d06e7){return function(_0x166b59){try{jsonpatch[_0x60cb('0x23')](_0x166b59,_0x6d06e7,!![]);}catch(_0x5ecc4b){return BPromise[_0x60cb('0x24')](_0x5ecc4b);}return _0x166b59[_0x60cb('0x25')]();};}function saveUpdates(_0x1ce72f,_0x20a81d){return function(_0x522961){if(_0x522961){return _0x522961[_0x60cb('0x26')](_0x1ce72f)[_0x60cb('0x27')](function(_0x3054c9){return _0x3054c9;});}return null;};}function removeEntity(_0x4407bb,_0x5a2a1a){return function(_0x2c9341){if(_0x2c9341){return _0x2c9341[_0x60cb('0x28')]()['then'](function(){_0x4407bb[_0x60cb('0x1d')](0xcc)[_0x60cb('0x1e')]();});}};}function handleEntityNotFound(_0x233665,_0x56ce46){return function(_0x5ac10d){if(!_0x5ac10d){_0x233665[_0x60cb('0x1c')](0x194);}return _0x5ac10d;};}function handleError(_0x46657b,_0x1a124d){_0x1a124d=_0x1a124d||0x1f4;return function(_0x1b1c4d){logger[_0x60cb('0x29')](_0x1b1c4d['stack']);if(_0x1b1c4d[_0x60cb('0x2a')]){delete _0x1b1c4d[_0x60cb('0x2a')];}_0x46657b['status'](_0x1a124d)['send'](_0x1b1c4d);};}exports['index']=function(_0x456654,_0x479ea9){var _0x33c73f={},_0xf63f={},_0x387f98={'count':0x0,'rows':[]};var _0x504604=db[_0x60cb('0x2b')][_0x60cb('0x2c')];_0xf63f[_0x60cb('0x2d')]=_['keys'](_0x504604);_0xf63f['query']=_[_0x60cb('0x2e')](_0x456654['query']);_0xf63f[_0x60cb('0x2f')]=_[_0x60cb('0x30')](_0xf63f['model'],_0xf63f[_0x60cb('0x31')]);_0x33c73f[_0x60cb('0x32')]=_[_0x60cb('0x30')](_0xf63f['model'],qs[_0x60cb('0x33')](_0x456654['query']['fields']));_0x33c73f[_0x60cb('0x32')]=_0x33c73f[_0x60cb('0x32')][_0x60cb('0x34')]?_0x33c73f[_0x60cb('0x32')]:_0xf63f[_0x60cb('0x2d')];if(!_0x456654['query'][_0x60cb('0x35')](_0x60cb('0x36'))){_0x33c73f['limit']=qs[_0x60cb('0x37')](_0x456654[_0x60cb('0x31')][_0x60cb('0x37')]);_0x33c73f[_0x60cb('0x21')]=qs[_0x60cb('0x21')](_0x456654[_0x60cb('0x31')][_0x60cb('0x21')]);}_0x33c73f[_0x60cb('0x38')]=qs['sort'](_0x456654[_0x60cb('0x31')][_0x60cb('0x39')]);_0x33c73f[_0x60cb('0x3a')]=qs[_0x60cb('0x2f')](_[_0x60cb('0x3b')](_0x456654[_0x60cb('0x31')],_0xf63f[_0x60cb('0x2f')]));var _0x56b6fb=[];var _0x5a5e77=squel[_0x60cb('0x3c')]()[_0x60cb('0x3d')]('id')[_0x60cb('0x3d')](_0x60cb('0x2a'))['field'](_0x60cb('0x3e'))[_0x60cb('0x3f')](_0x60cb('0x40'));var _0xfc4d0a=squel[_0x60cb('0x3c')]()['field'](_0x60cb('0x41'))[_0x60cb('0x3f')]('fax_messages','me')[_0x60cb('0x3a')](_0x60cb('0x42'))[_0x60cb('0x3a')](_0x60cb('0x43'))['where'](_0x60cb('0x44'));var _0x3dc030=squel['select']()[_0x60cb('0x3d')](_0x60cb('0x45'))['field'](_0x60cb('0x46'))[_0x60cb('0x3f')]('user_has_fax_interactions','ui')['left_join'](_0x60cb('0x47'),'u','u.id\x20=\x20ui.UserId');var _0x1957c8=squel['select']()[_0x60cb('0x3f')]('fax_interactions','i')[_0x60cb('0x48')](_0x60cb('0x49'),'ui','ui.UserId\x20=\x20i.UserId')[_0x60cb('0x48')]('users','u',_0x60cb('0x4a'))[_0x60cb('0x48')]('cm_contacts','c',_0x60cb('0x4b'))['left_join'](_0x60cb('0x47'),'o',_0x60cb('0x4c'))[_0x60cb('0x48')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')[_0x60cb('0x48')](_0x60cb('0x4d'),'me','me.FaxInteractionId\x20=\x20i.id');var _0x3a3d08=squel['expr']();if(_0x456654['query'][_0x60cb('0x4e')]){var _0x29ce23=JSON[_0x60cb('0x4f')](_0x456654[_0x60cb('0x31')][_0x60cb('0x4e')]);_['keys'](_0x29ce23)[_0x60cb('0x50')](function(_0x502c22){var _0x858f25=_0x29ce23[_0x502c22];if(_0x502c22===_0x60cb('0x51')){var _0x5da96b=moment(_0x858f25['value'][_0x60cb('0x52')])['startOf'](_0x60cb('0x53'))['utc']()[_0x60cb('0x54')]();var _0x56916e=moment(_0x56916e)['utc']()[_0x60cb('0x55')]('day')[_0x60cb('0x54')]();_0x3a3d08[_0x60cb('0x56')](_0x60cb('0x57'),_0x5da96b,_0x56916e);}else{if(_[_0x60cb('0x58')](_0x858f25['condition'])){_0x858f25[_0x60cb('0x59')][_0x60cb('0x50')](function(_0x19e87a){switch(_0x858f25[_0x60cb('0x59')][_0x60cb('0x5a')]){case'IS':if(_0x502c22!==_0x60cb('0x5b')&&_0x502c22!==_0x60cb('0x5c')){if(_[_0x60cb('0x58')](_0x858f25[_0x60cb('0x5a')])&&_0x858f25['value']['length']>0x1){_0x3a3d08['and'](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x5e'),_0x858f25['value']);}else{_0x3a3d08[_0x60cb('0x56')](_0x858f25['tableAlias']+'.'+_0x502c22+_0x60cb('0x5f'),_0x858f25[_0x60cb('0x5a')][0x0]);}}break;case'=':_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+'\x20=\x20?',_0x858f25[_0x60cb('0x5a')]);break;case _0x60cb('0x60'):if(_0x502c22===_0x60cb('0x61')){_0x3a3d08[_0x60cb('0x56')](_0x60cb('0x62')+_0x60cb('0x63'),'%'+_0x858f25[_0x60cb('0x5a')]+'%');_0x3a3d08['or'](_0x60cb('0x64')+_0x60cb('0x63'),'%'+_0x858f25[_0x60cb('0x5a')]+'%');_0x3a3d08['or'](_0x60cb('0x65')+'\x20LIKE\x20?','%'+_0x858f25['value']+'%');}else{_0x3a3d08['and'](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+'\x20LIKE\x20?','%'+_0x858f25[_0x60cb('0x5a')]+'%');}break;case'>':_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+'\x20>\x20?',_0x858f25['value']);break;case'<':_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x66'),_0x858f25['value']);break;}});}else{switch(_0x858f25['condition'][_0x60cb('0x5a')]){case'IS':if(_0x502c22!==_0x60cb('0x5b')&&_0x502c22!=='Messages.count'){if(_[_0x60cb('0x58')](_0x858f25[_0x60cb('0x5a')])&&_0x858f25['value']['length']>0x1){_0x3a3d08[_0x60cb('0x56')](_0x858f25['tableAlias']+'.'+_0x502c22+_0x60cb('0x5e'),_0x858f25[_0x60cb('0x5a')]);}else{_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x5f'),_0x858f25[_0x60cb('0x5a')][0x0]);}}break;case'=':_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+'\x20=\x20?',_0x858f25[_0x60cb('0x5a')]);break;case'LIKE':if(_0x502c22===_0x60cb('0x61')){_0x3a3d08[_0x60cb('0x56')](_0x60cb('0x62')+_0x60cb('0x63'),'%'+_0x858f25[_0x60cb('0x5a')]+'%');_0x3a3d08['or'](_0x60cb('0x64')+'\x20LIKE\x20?','%'+_0x858f25[_0x60cb('0x5a')]+'%');_0x3a3d08['or'](_0x60cb('0x65')+_0x60cb('0x63'),'%'+_0x858f25['value']+'%');}else{_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x63'),'%'+_0x858f25[_0x60cb('0x5a')]+'%');}break;case'>':_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x67'),_0x858f25['value']);break;case'<':_0x3a3d08['and'](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x66'),_0x858f25[_0x60cb('0x5a')]);break;}}}});}else{var _0x46356b=_(Object[_0x60cb('0x2e')](_0x456654['query']))[_0x60cb('0x68')](function(_0x1cfcd5){return _0x504604[_0x60cb('0x35')](_0x1cfcd5)?_0x1cfcd5:undefined;})[_0x60cb('0x69')](function(_0x1a41f7){return!_[_0x60cb('0x6a')](_0x1a41f7);})[_0x60cb('0x5a')]();if(!_[_0x60cb('0x6b')](_0x46356b)){_0x46356b['forEach'](function(_0xa27ca7){if(_0xa27ca7===_0x60cb('0x6c')){_0x1957c8[_0x60cb('0x3a')](_0x60cb('0x6d'),[][_0x60cb('0x6e')](_0x456654[_0x60cb('0x31')][_0xa27ca7]));}else if(_0xa27ca7===_0x60cb('0x51')){var _0x2a61cc=JSON[_0x60cb('0x4f')](_0x456654['query'][_0xa27ca7])['$gte'];var _0x47e72b=JSON['parse'](_0x456654['query'][_0xa27ca7])[_0x60cb('0x6f')];_0x1957c8[_0x60cb('0x3a')](_0x60cb('0x57'),_0x2a61cc,_0x47e72b);}else{_0x1957c8[_0x60cb('0x3a')]('i.'+_0xa27ca7+_0x60cb('0x5f'),_0x456654[_0x60cb('0x31')][_0xa27ca7]);}});}if(_0x456654[_0x60cb('0x31')]['filter']){var _0x2f5685=_0x456654['query'][_0x60cb('0x69')][_0x60cb('0x70')]('\x5c','\x5c\x5c')[_0x60cb('0x70')]('\x27\x27',_0x60cb('0x71'));if(qs[_0x60cb('0x72')](_0x2f5685)){_0x3a3d08['or'](_0x60cb('0x73'),_0x2f5685+'%')['or'](_0x60cb('0x74'),_0x2f5685+'%');}_0x3a3d08['or'](_0x60cb('0x75'),_0x2f5685+'%');}}_0x1957c8['where'](_0x3a3d08);if(_0x33c73f[_0x60cb('0x38')]){_0x33c73f[_0x60cb('0x38')][_0x60cb('0x50')](function(_0x582134){_0x1957c8['order']('i.'+_0x582134[0x0],_0x582134[0x1]===_0x60cb('0x76')?![]:!![]);});}_0x1957c8['group'](_0x60cb('0x77'));var _0x313f8b={'type':db[_0x60cb('0x78')]['QueryTypes'][_0x60cb('0x79')],'raw':!![]};var _0x38ea34=_0x1957c8['clone']()[_0x60cb('0x3d')](_0x60cb('0x41'));if(!_0x456654[_0x60cb('0x31')][_0x60cb('0x4e')]){if(_0x456654['query']['read']){if(_0x456654['query'][_0x60cb('0x7a')]==0x1){_0x38ea34[_0x60cb('0x3a')](util['format'](_0x60cb('0x7b'),_0xfc4d0a[_0x60cb('0x7c')]()));_0x1957c8[_0x60cb('0x7d')](_0x60cb('0x7e'));}else{_0x38ea34[_0x60cb('0x3a')](util[_0x60cb('0x54')](_0x60cb('0x7f'),_0xfc4d0a[_0x60cb('0x7c')]()));_0x1957c8['having'](_0x60cb('0x80'));}}if(_0x456654[_0x60cb('0x31')][_0x60cb('0x81')]){var _0x3b85bb=_[_0x60cb('0x58')](_0x456654[_0x60cb('0x31')][_0x60cb('0x81')])?_0x456654['query'][_0x60cb('0x81')]:new Array(_0x456654[_0x60cb('0x31')][_0x60cb('0x81')]);var _0xbc0a70=squel[_0x60cb('0x82')]();_0x3b85bb[_0x60cb('0x50')](function(_0xa5c9c5){_0xbc0a70['or'](_0x60cb('0x83'),'%,'+_0xa5c9c5+',%');});_0x1957c8[_0x60cb('0x7d')](_0xbc0a70);_0x38ea34['left_join'](_0x60cb('0x84'),'it',_0x60cb('0x85'));_0x38ea34[_0x60cb('0x48')]('tools_tags','t',_0x60cb('0x86'));_0x38ea34[_0x60cb('0x3a')]('t.id\x20IN\x20?',_0x3b85bb);}}else{var _0x29ce23=JSON[_0x60cb('0x4f')](_0x456654[_0x60cb('0x31')][_0x60cb('0x4e')]);_[_0x60cb('0x2e')](_0x29ce23)[_0x60cb('0x50')](function(_0x3454af){var _0xf33d48=_0x29ce23[_0x3454af];if(_0x3454af==='TagId'){var _0x104de3=_0xf33d48[_0x60cb('0x5a')];var _0x5f1656=squel[_0x60cb('0x82')]();_0x104de3[_0x60cb('0x50')](function(_0xf300b8){_0x5f1656['or'](_0x60cb('0x83'),'%,'+_0xf300b8+',%');});_0x1957c8['having'](_0x5f1656);_0x38ea34[_0x60cb('0x48')]('mail_interaction_has_tags','it',_0x60cb('0x87'));_0x38ea34[_0x60cb('0x48')](_0x60cb('0x40'),'t',_0x60cb('0x86'));_0x38ea34[_0x60cb('0x3a')](_0x60cb('0x88'),_0x104de3);}else if(_0x3454af===_0x60cb('0x5c')){if(_0xf33d48[_0x60cb('0x5a')][_0x60cb('0x34')]===0x1){if(_0xf33d48[_0x60cb('0x5a')][0x0]===0x1){_0x38ea34[_0x60cb('0x3a')](util[_0x60cb('0x54')](_0x60cb('0x7b'),_0xfc4d0a[_0x60cb('0x7c')]()));_0x1957c8['having'](_0x60cb('0x7e'));}else{_0x38ea34[_0x60cb('0x3a')](util[_0x60cb('0x54')](_0x60cb('0x7f'),_0xfc4d0a[_0x60cb('0x7c')]()));_0x1957c8[_0x60cb('0x7d')](_0x60cb('0x80'));}}}});}db['sequelize'][_0x60cb('0x31')](_0x38ea34[_0x60cb('0x7c')](),_0x313f8b)[_0x60cb('0x27')](function(_0x3de4a2){_0x387f98[_0x60cb('0x20')]=_0x3de4a2[_0x60cb('0x34')];if(_0x387f98['count']===0x0)return[];return db[_0x60cb('0x89')][_0x60cb('0x31')](_0x5a5e77['toString'](),_0x313f8b)[_0x60cb('0x27')](function(_0x3da2e8){_0x56b6fb=_[_0x60cb('0x8a')](_0x3da2e8,'id');_0x313f8b=_[_0x60cb('0x8b')](_0x313f8b,{'model':db[_0x60cb('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1957c8['field'](_0xfc4d0a,_0x60cb('0x5c'));_0x1957c8['field'](_0x60cb('0x8c'),'Account.key');_0x1957c8[_0x60cb('0x3d')](_0x60cb('0x8d'));_0x1957c8['field'](_0x60cb('0x62'),_0x60cb('0x8e'));_0x1957c8['field'](_0x60cb('0x64'),_0x60cb('0x8f'));_0x1957c8[_0x60cb('0x3d')](_0x60cb('0x65'),_0x60cb('0x90'));_0x1957c8[_0x60cb('0x3d')]('c.phone','Contact.phone');_0x1957c8[_0x60cb('0x3d')](_0x60cb('0x91'),'Contact.mobile');_0x1957c8[_0x60cb('0x3d')](_0x60cb('0x92'),'Contact.fax');_0x1957c8['field'](_0x60cb('0x93'),_0x60cb('0x94'));_0x1957c8[_0x60cb('0x3d')](_0x60cb('0x95'),_0x60cb('0x96'));_0x1957c8[_0x60cb('0x48')]('fax_interaction_has_tags','it',_0x60cb('0x85'));_0x1957c8[_0x60cb('0x48')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x1957c8[_0x60cb('0x37')](_0x33c73f[_0x60cb('0x37')]);_0x1957c8[_0x60cb('0x21')](_0x33c73f[_0x60cb('0x21')]);return db[_0x60cb('0x89')][_0x60cb('0x31')](_0x1957c8[_0x60cb('0x7c')](),_0x313f8b);})[_0x60cb('0x27')](function(_0x233ae3){_0x3dc030[_0x60cb('0x3a')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x233ae3,'id'));return db['sequelize'][_0x60cb('0x31')](_0x3dc030[_0x60cb('0x7c')](),_0x313f8b)['then'](function(_0xb3be68){var _0x36337c=_[_0x60cb('0x97')](_0xb3be68,_0x60cb('0x98'));_0x233ae3[_0x60cb('0x50')](function(_0x4e4377){if(_0x36337c[_0x4e4377['id']]){_0x4e4377[_0x60cb('0x99')]=_[_0x60cb('0x68')](_0x36337c[_0x4e4377['id']],function(_0x31df7d){return{'id':_0x31df7d['id']};});}if(_0x4e4377[_0x60cb('0x96')]){_0x4e4377['Tags']=[];_0x4e4377[_0x60cb('0x96')][_0x60cb('0x9a')](',')[_0x60cb('0x50')](function(_0x55b818){_0x4e4377[_0x60cb('0x9b')]['push'](_0x56b6fb[_0x55b818]);});}delete _0x4e4377['TagIds'];});return _0x233ae3;});});})['then'](function(_0x3b711a){_0x387f98[_0x60cb('0x9c')]=_0x3b711a;return _0x387f98;})[_0x60cb('0x27')](respondWithFilteredResult(_0x479ea9,_0x33c73f))['catch'](handleError(_0x479ea9,null));};exports['show']=function(_0x221389,_0x59aade){var _0xc36723={'raw':![],'where':{'id':_0x221389[_0x60cb('0x9d')]['id']}},_0x3cfc82={};_0x3cfc82[_0x60cb('0x2d')]=_[_0x60cb('0x2e')](db[_0x60cb('0x2b')][_0x60cb('0x2c')]);_0x3cfc82[_0x60cb('0x31')]=_[_0x60cb('0x2e')](_0x221389[_0x60cb('0x31')]);_0x3cfc82[_0x60cb('0x2f')]=_[_0x60cb('0x30')](_0x3cfc82['model'],_0x3cfc82['query']);_0xc36723[_0x60cb('0x32')]=_[_0x60cb('0x30')](_0x3cfc82[_0x60cb('0x2d')],qs[_0x60cb('0x33')](_0x221389[_0x60cb('0x31')][_0x60cb('0x33')]));_0xc36723[_0x60cb('0x32')]=_0xc36723['attributes'][_0x60cb('0x34')]?_0xc36723[_0x60cb('0x32')]:_0x3cfc82['model'];if(_0x221389['query'][_0x60cb('0x9e')]){_0xc36723['include']=[{'all':!![]}];}_0xc36723=_[_0x60cb('0x8b')]({},_0xc36723,_0x221389[_0x60cb('0x9f')]);return db[_0x60cb('0x2b')][_0x60cb('0xa0')](_0xc36723)[_0x60cb('0x27')](handleEntityNotFound(_0x59aade,null))[_0x60cb('0x27')](respondWithResult(_0x59aade,null))[_0x60cb('0xa1')](handleError(_0x59aade,null));};exports['create']=function(_0x531ffd,_0x5514c6){return db[_0x60cb('0x2b')][_0x60cb('0xa2')](_0x531ffd[_0x60cb('0xa3')],{})[_0x60cb('0x27')](respondWithResult(_0x5514c6,0xc9))['catch'](handleError(_0x5514c6,null));};exports[_0x60cb('0x26')]=function(_0x5cc30c,_0x5507f8){if(_0x5cc30c[_0x60cb('0xa3')]['id']){delete _0x5cc30c[_0x60cb('0xa3')]['id'];}return db[_0x60cb('0x2b')][_0x60cb('0xa0')]({'where':{'id':_0x5cc30c[_0x60cb('0x9d')]['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x5507f8,null))['then'](saveUpdates(_0x5cc30c[_0x60cb('0xa3')],null))[_0x60cb('0x27')](respondWithResult(_0x5507f8,null))[_0x60cb('0xa1')](handleError(_0x5507f8,null));};exports[_0x60cb('0x28')]=function(_0x4995d2,_0x858a58){return db[_0x60cb('0x2b')][_0x60cb('0xa0')]({'where':{'id':_0x4995d2['params']['id']}})['then'](handleEntityNotFound(_0x858a58,null))['then'](removeEntity(_0x858a58,null))[_0x60cb('0xa1')](handleError(_0x858a58,null));};exports[_0x60cb('0xa4')]=function(_0x438fae,_0xd802cb){return db[_0x60cb('0x2b')][_0x60cb('0xa4')]()[_0x60cb('0x27')](respondWithResult(_0xd802cb,null))['catch'](handleError(_0xd802cb,null));};exports['addMessage']=function(_0x1cc4cb,_0x8f061f,_0x4d4076){return db[_0x60cb('0xa5')][_0x60cb('0xa0')]({'where':{'id':_0x1cc4cb[_0x60cb('0x9d')]['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x8f061f,null))[_0x60cb('0x27')](function(_0x435f5a){if(_0x435f5a){return _0x435f5a[_0x60cb('0xa6')](_0x1cc4cb[_0x60cb('0xa3')][_0x60cb('0xa7')],_[_0x60cb('0xa8')](_0x1cc4cb['body'],[_0x60cb('0xa7'),'id'])||{});}})[_0x60cb('0x27')](respondWithResult(_0x8f061f,null))[_0x60cb('0xa1')](handleError(_0x8f061f,null));};exports[_0x60cb('0xa9')]=function(_0xd1b922,_0x2de9bb,_0x4819e6){var _0x163020={'raw':![],'where':{}};var _0x1f4ba5={};var _0x41422f={'count':0x0,'rows':[]};return db[_0x60cb('0x2b')][_0x60cb('0xaa')]({'where':{'id':_0xd1b922[_0x60cb('0x9d')]['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x2de9bb,null))[_0x60cb('0x27')](function(_0x54069d){if(_0x54069d){_0x1f4ba5[_0x60cb('0x2d')]=_[_0x60cb('0x2e')](db[_0x60cb('0xa5')][_0x60cb('0x2c')]);_0x1f4ba5[_0x60cb('0x31')]=_[_0x60cb('0x2e')](_0xd1b922[_0x60cb('0x31')]);_0x1f4ba5['filters']=_[_0x60cb('0x30')](_0x1f4ba5['model'],_0x1f4ba5[_0x60cb('0x31')]);_0x163020['attributes']=_['intersection'](_0x1f4ba5[_0x60cb('0x2d')],qs['fields'](_0xd1b922[_0x60cb('0x31')][_0x60cb('0x33')]));_0x163020['attributes']=_0x163020['attributes'][_0x60cb('0x34')]?_0x163020[_0x60cb('0x32')]:_0x1f4ba5[_0x60cb('0x2d')];if(!_0xd1b922[_0x60cb('0x31')][_0x60cb('0x35')](_0x60cb('0x36'))){_0x163020[_0x60cb('0x37')]=qs[_0x60cb('0x37')](_0xd1b922[_0x60cb('0x31')][_0x60cb('0x37')]);_0x163020['offset']=qs[_0x60cb('0x21')](_0xd1b922[_0x60cb('0x31')]['offset']);}_0x163020[_0x60cb('0x38')]=qs[_0x60cb('0x39')](_0xd1b922[_0x60cb('0x31')]['sort']);_0x163020['where']=qs[_0x60cb('0x2f')](_[_0x60cb('0x3b')](_0xd1b922[_0x60cb('0x31')],_0x1f4ba5['filters']));_0x163020[_0x60cb('0x3a')]['FaxInteractionId']=_0x54069d['id'];if(_0xd1b922['query'][_0x60cb('0x69')]){_0x163020['where']=_['merge'](_0x163020[_0x60cb('0x3a')],{'$or':_[_0x60cb('0x68')](_0x163020['attributes'],function(_0x1d4a4d){var _0x18e237={};_0x18e237[_0x1d4a4d]={'$like':'%'+_0xd1b922[_0x60cb('0x31')][_0x60cb('0x69')]+'%'};return _0x18e237;})});}if(_0xd1b922[_0x60cb('0x31')][_0x60cb('0xab')]){var _0x355e5a=_0xd1b922[_0x60cb('0x31')][_0x60cb('0xab')]['split'](',');var _0x52fb23={};_0x52fb23[_0x355e5a[0x0]]={'$gte':moment(_0x355e5a[0x1])['format'](_0x60cb('0xac'))};_0x163020[_0x60cb('0x3a')]=_[_0x60cb('0x8b')](_0x163020[_0x60cb('0x3a')],_0x52fb23);}_0x163020=_['merge']({},_0x163020,_0xd1b922['options']);return db[_0x60cb('0xa5')][_0x60cb('0x20')]({'where':_0x163020['where']})[_0x60cb('0x27')](function(_0x4e18ed){_0x41422f[_0x60cb('0x20')]=_0x4e18ed;if(_0xd1b922[_0x60cb('0x31')][_0x60cb('0x9e')]){_0x163020[_0x60cb('0xad')]=[{'all':!![]}];}return db[_0x60cb('0xa5')][_0x60cb('0xae')](_0x163020);})[_0x60cb('0x27')](function(_0x7a6921){_0x41422f[_0x60cb('0x9c')]=_0x7a6921;return _0x41422f;});}})[_0x60cb('0x27')](respondWithFilteredResult(_0x2de9bb,_0x163020))[_0x60cb('0xa1')](handleError(_0x2de9bb,null));};exports['addTags']=function(_0x536f3e,_0x3d500d,_0x22d922){return db['FaxInteraction'][_0x60cb('0xa0')]({'where':{'id':_0x536f3e['params']['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x3d500d,null))[_0x60cb('0x27')](function(_0x458d98){if(_0x458d98){return _0x458d98[_0x60cb('0xaf')](_0x536f3e[_0x60cb('0xa3')][_0x60cb('0xa7')],_[_0x60cb('0xa8')](_0x536f3e[_0x60cb('0xa3')],[_0x60cb('0xa7'),'id'])||{})['spread'](function(){return db[_0x60cb('0xb0')][_0x60cb('0xae')]({'attributes':['id',_0x60cb('0x2a'),'color'],'where':{'id':_0x536f3e['body'][_0x60cb('0xa7')]}});})[_0x60cb('0x27')](function(_0x2d1cff){socket[_0x60cb('0xb1')](_0x60cb('0xb2'),{'id':Number(_0x536f3e[_0x60cb('0x9d')]['id']),'tags':_0x2d1cff||[]});return{'id':Number(_0x536f3e[_0x60cb('0x9d')]['id']),'tags':_0x2d1cff||[]};});}})['then'](respondWithResult(_0x3d500d,null))[_0x60cb('0xa1')](handleError(_0x3d500d,null));};exports[_0x60cb('0xb3')]=function(_0x15db92,_0x4c26f1,_0x44fecf){return db[_0x60cb('0x2b')][_0x60cb('0xa0')]({'where':{'id':_0x15db92[_0x60cb('0x9d')]['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x4c26f1,null))[_0x60cb('0x27')](function(_0x4a75e4){if(_0x4a75e4){return _0x4a75e4[_0x60cb('0xb3')](_0x15db92[_0x60cb('0x31')]['ids']);}})[_0x60cb('0x27')](respondWithStatusCode(_0x4c26f1,null))[_0x60cb('0xa1')](handleError(_0x4c26f1,null));};exports['download']=function(_0x252231,_0x517068){var _0x1ab651=moment()[_0x60cb('0xb4')]()[_0x60cb('0x7c')]();var _0x3be449=path[_0x60cb('0xb5')](config['root'],_0x60cb('0xb6'),_0x60cb('0xb7'),_0x60cb('0xb8'));var _0xcdc772=path[_0x60cb('0xb5')](config['root'],'server',_0x60cb('0xb7'),'tmp');var _0x30e755=path[_0x60cb('0xb5')](_0xcdc772,_0x1ab651);var _0x34efc8=util['format'](_0x60cb('0xb9'),_0x1ab651);var _0x44f3e1=path[_0x60cb('0xb5')](_0xcdc772,_0x34efc8);var _0x32c43d=![];return db[_0x60cb('0x2b')]['find']({'where':{'id':_0x252231[_0x60cb('0x9d')]['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x517068,null))[_0x60cb('0x27')](function(_0xbb8b60){if(_0xbb8b60){return _0xbb8b60[_0x60cb('0xa9')]({'attributes':['id',_0x60cb('0xa3'),'createdAt'],'include':[{'model':db['Attachment'],'as':_0x60cb('0xba')}]});}return[];})['then'](function(_0x31c476){_0x32c43d=_0x31c476[_0x60cb('0x34')];if(_0x31c476[_0x60cb('0x34')]){fs[_0x60cb('0xbb')](_0x30e755);for(var _0x3d44b2=0x0;_0x3d44b2<_0x31c476[_0x60cb('0x34')];_0x3d44b2++){var _0x4185e5=_0x31c476[_0x3d44b2];var _0x4a85d9=_0x4185e5[_0x60cb('0xba')];if(_0x4a85d9){var _0x16a4b2=path['join'](_0x3be449,_0x4a85d9[_0x60cb('0xbc')]);if(fs[_0x60cb('0xbd')](_0x16a4b2)){fs[_0x60cb('0xbe')](_0x16a4b2)[_0x60cb('0xbf')](fs[_0x60cb('0xc0')](path[_0x60cb('0xb5')](_0x30e755,_0x4a85d9['basename'])));}}}}})[_0x60cb('0x27')](function(){if(_0x32c43d){return new BPromise(function(_0x296a59,_0x1e6a9b){zipdir(_0x30e755,{'saveTo':_0x44f3e1},function(_0x2ff197,_0x329adb){if(_0x2ff197)return _0x1e6a9b(_0x2ff197);return _0x296a59(_0x329adb);});});}})[_0x60cb('0x27')](function(){if(_0x32c43d){return new BPromise(function(_0x3f8dc7,_0x6b0968){rimraf(_0x30e755,function(_0x22005e){if(_0x22005e)_0x6b0968(_0x22005e);return _0x3f8dc7();});});}})['then'](function(){if(_0x32c43d){return _0x517068[_0x60cb('0xc1')](_0x44f3e1,_0x34efc8,function(_0x5e1b38){if(_0x5e1b38){console[_0x60cb('0xc2')](_0x60cb('0xc3'),_0x5e1b38);}else{fs[_0x60cb('0xc4')](_0x44f3e1);}});}else{return _0x517068[_0x60cb('0x1c')](0xc8);}})['catch'](handleError(_0x517068,null));};
\ No newline at end of file
+var _0xf98b=['split','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','addTags','setTags','spread','Tag','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','tmp','interaction-%s.zip','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','json','count','offset','limit','status','set','apply','reject','update','then','destroy','stack','name','send','index','FaxInteraction','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','ui.UserId\x20=\x20i.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','expr','advancedFilter','parse','forEach','createdAt','value','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','length','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','Messages.count','ContactId','map','filter','isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$gte','$lte','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','order','i.id','QueryTypes','read','%s\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','having','toString','sequelize','keyBy','merge','Account.key','i.*','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','fax_interaction_has_tags','ui.FaxInteractionId\x20IN\x20?','groupBy','Tags','push','catch','params','includeAll','include','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','nolimit'];(function(_0x39c2ea,_0x3d7d7d){var _0x519fff=function(_0x1e6d1f){while(--_0x1e6d1f){_0x39c2ea['push'](_0x39c2ea['shift']());}};_0x519fff(++_0x3d7d7d);}(_0xf98b,0xe3));var _0xbf98=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf98b[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbf98('0x0'));var rimraf=require(_0xbf98('0x1'));var zipdir=require(_0xbf98('0x2'));var jsonpatch=require(_0xbf98('0x3'));var rp=require(_0xbf98('0x4'));var moment=require('moment');var BPromise=require(_0xbf98('0x5'));var Mustache=require('mustache');var util=require(_0xbf98('0x6'));var path=require(_0xbf98('0x7'));var sox=require(_0xbf98('0x8'));var csv=require(_0xbf98('0x9'));var ejs=require(_0xbf98('0xa'));var fs=require('fs');var _=require(_0xbf98('0xb'));var squel=require(_0xbf98('0xc'));var crypto=require('crypto');var jsforce=require(_0xbf98('0xd'));var deskjs=require(_0xbf98('0xe'));var toCsv=require(_0xbf98('0x9'));var querystring=require(_0xbf98('0xf'));var Papa=require(_0xbf98('0x10'));var Redis=require(_0xbf98('0x11'));var authService=require(_0xbf98('0x12'));var qs=require(_0xbf98('0x13'));var hardwareService=require(_0xbf98('0x14'));var logger=require('../../config/logger')(_0xbf98('0x15'));var utils=require(_0xbf98('0x16'));var config=require(_0xbf98('0x17'));var db=require(_0xbf98('0x18'))['db'];config[_0xbf98('0x19')]=_['defaults'](config[_0xbf98('0x19')],{'host':_0xbf98('0x1a'),'port':0x18eb});var socket=require(_0xbf98('0x1b'))(new Redis(config['redis']));require(_0xbf98('0x1c'))[_0xbf98('0x1d')](socket);function respondWithStatusCode(_0x20750b,_0x4c6607){_0x4c6607=_0x4c6607||0xcc;return function(_0x2a9b2f){if(_0x2a9b2f){return _0x20750b[_0xbf98('0x1e')](_0x4c6607);}return _0x20750b['status'](_0x4c6607)[_0xbf98('0x1f')]();};}function respondWithResult(_0x5b22b4,_0x38f7f7){_0x38f7f7=_0x38f7f7||0xc8;return function(_0x276bd1){if(_0x276bd1){return _0x5b22b4['status'](_0x38f7f7)[_0xbf98('0x20')](_0x276bd1);}};}function respondWithFilteredResult(_0xabc42,_0x36c3a8){return function(_0x526add){if(_0x526add){var _0x9ffa47=_0x526add[_0xbf98('0x21')],_0x5023a6=_0x36c3a8['offset'],_0x1ebef5=_0x36c3a8[_0xbf98('0x22')]+_0x36c3a8[_0xbf98('0x23')],_0xe03a8e;if(_0x1ebef5>=_0x9ffa47){_0x1ebef5=_0x9ffa47;_0xe03a8e=0xc8;}else{_0xe03a8e=0xce;}_0xabc42[_0xbf98('0x24')](_0xe03a8e);return _0xabc42[_0xbf98('0x25')]('Content-Range',_0x5023a6+'-'+_0x1ebef5+'/'+_0x9ffa47)[_0xbf98('0x20')](_0x526add);}return null;};}function patchUpdates(_0x37af8a){return function(_0x90bde3){try{jsonpatch[_0xbf98('0x26')](_0x90bde3,_0x37af8a,!![]);}catch(_0x5c3b77){return BPromise[_0xbf98('0x27')](_0x5c3b77);}return _0x90bde3['save']();};}function saveUpdates(_0x54cea8,_0x3f03c2){return function(_0x330794){if(_0x330794){return _0x330794[_0xbf98('0x28')](_0x54cea8)[_0xbf98('0x29')](function(_0x2e07aa){return _0x2e07aa;});}return null;};}function removeEntity(_0x501e2d,_0x5dd97e){return function(_0x848800){if(_0x848800){return _0x848800[_0xbf98('0x2a')]()[_0xbf98('0x29')](function(){_0x501e2d['status'](0xcc)[_0xbf98('0x1f')]();});}};}function handleEntityNotFound(_0x2c5281,_0x1343d6){return function(_0x38f99d){if(!_0x38f99d){_0x2c5281[_0xbf98('0x1e')](0x194);}return _0x38f99d;};}function handleError(_0x48bc11,_0x135591){_0x135591=_0x135591||0x1f4;return function(_0x585e41){logger['error'](_0x585e41[_0xbf98('0x2b')]);if(_0x585e41['name']){delete _0x585e41[_0xbf98('0x2c')];}_0x48bc11[_0xbf98('0x24')](_0x135591)[_0xbf98('0x2d')](_0x585e41);};}exports[_0xbf98('0x2e')]=function(_0x2a6554,_0xd32f){var _0x27a62d={},_0x342404={},_0x4a3787={'count':0x0,'rows':[]};var _0x4e7423=db[_0xbf98('0x2f')][_0xbf98('0x30')];_0x342404[_0xbf98('0x31')]=_[_0xbf98('0x32')](_0x4e7423);_0x342404[_0xbf98('0x33')]=_['keys'](_0x2a6554[_0xbf98('0x33')]);_0x342404[_0xbf98('0x34')]=_[_0xbf98('0x35')](_0x342404[_0xbf98('0x31')],_0x342404[_0xbf98('0x33')]);_0x27a62d['attributes']=_[_0xbf98('0x35')](_0x342404['model'],qs[_0xbf98('0x36')](_0x2a6554[_0xbf98('0x33')][_0xbf98('0x36')]));_0x27a62d[_0xbf98('0x37')]=_0x27a62d[_0xbf98('0x37')]['length']?_0x27a62d[_0xbf98('0x37')]:_0x342404[_0xbf98('0x31')];if(!_0x2a6554[_0xbf98('0x33')][_0xbf98('0x38')]('nolimit')){_0x27a62d[_0xbf98('0x23')]=qs[_0xbf98('0x23')](_0x2a6554['query'][_0xbf98('0x23')]);_0x27a62d['offset']=qs['offset'](_0x2a6554[_0xbf98('0x33')][_0xbf98('0x22')]);}_0x27a62d['order']=qs[_0xbf98('0x39')](_0x2a6554[_0xbf98('0x33')][_0xbf98('0x39')]);_0x27a62d[_0xbf98('0x3a')]=qs[_0xbf98('0x34')](_[_0xbf98('0x3b')](_0x2a6554[_0xbf98('0x33')],_0x342404[_0xbf98('0x34')]));var _0x5198f8=[];var _0x115539=squel[_0xbf98('0x3c')]()[_0xbf98('0x3d')]('id')[_0xbf98('0x3d')](_0xbf98('0x2c'))[_0xbf98('0x3d')](_0xbf98('0x3e'))[_0xbf98('0x3f')](_0xbf98('0x40'));var _0x28ee68=squel[_0xbf98('0x3c')]()[_0xbf98('0x3d')](_0xbf98('0x41'))[_0xbf98('0x3f')]('fax_messages','me')['where']('me.FaxInteractionId\x20=\x20i.id')[_0xbf98('0x3a')](_0xbf98('0x42'))['where'](_0xbf98('0x43'));var _0x4b3fb2=squel[_0xbf98('0x3c')]()[_0xbf98('0x3d')](_0xbf98('0x44'))[_0xbf98('0x3d')]('ui.FaxInteractionId')[_0xbf98('0x3f')](_0xbf98('0x45'),'ui')[_0xbf98('0x46')](_0xbf98('0x47'),'u',_0xbf98('0x48'));var _0x362708=squel[_0xbf98('0x3c')]()[_0xbf98('0x3f')](_0xbf98('0x49'),'i')[_0xbf98('0x46')](_0xbf98('0x45'),'ui',_0xbf98('0x4a'))[_0xbf98('0x46')](_0xbf98('0x47'),'u',_0xbf98('0x48'))[_0xbf98('0x46')]('cm_contacts','c',_0xbf98('0x4b'))[_0xbf98('0x46')](_0xbf98('0x47'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xbf98('0x4c'),'a',_0xbf98('0x4d'))[_0xbf98('0x46')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id');var _0x2fe6fe=squel[_0xbf98('0x4e')]();if(_0x2a6554[_0xbf98('0x33')][_0xbf98('0x4f')]){var _0x3b2d45=JSON[_0xbf98('0x50')](_0x2a6554[_0xbf98('0x33')]['advancedFilter']);_['keys'](_0x3b2d45)[_0xbf98('0x51')](function(_0x251ff1){var _0xe1b87e=_0x3b2d45[_0x251ff1];if(_0x251ff1===_0xbf98('0x52')){var _0x126117=moment(_0xe1b87e[_0xbf98('0x53')]['dateStart'])[_0xbf98('0x54')](_0xbf98('0x55'))[_0xbf98('0x56')]()[_0xbf98('0x57')]();var _0x28c676=moment(_0x28c676)[_0xbf98('0x56')]()[_0xbf98('0x58')]('day')[_0xbf98('0x57')]();_0x2fe6fe[_0xbf98('0x59')](_0xbf98('0x5a'),_0x126117,_0x28c676);}else{if(_[_0xbf98('0x5b')](_0xe1b87e[_0xbf98('0x5c')])){_0xe1b87e[_0xbf98('0x5c')][_0xbf98('0x51')](function(_0x441732){switch(_0xe1b87e[_0xbf98('0x5c')][_0xbf98('0x53')]){case'IS':if(_0x251ff1!==_0xbf98('0x5d')&&_0x251ff1!=='Messages.count'){if(_[_0xbf98('0x5b')](_0xe1b87e[_0xbf98('0x53')])&&_0xe1b87e[_0xbf98('0x53')][_0xbf98('0x5e')]>0x1){_0x2fe6fe[_0xbf98('0x59')](_0xe1b87e['tableAlias']+'.'+_0x251ff1+_0xbf98('0x5f'),_0xe1b87e[_0xbf98('0x53')]);}else{_0x2fe6fe[_0xbf98('0x59')](_0xe1b87e[_0xbf98('0x60')]+'.'+_0x251ff1+_0xbf98('0x61'),_0xe1b87e['value'][0x0]);}}break;case'=':_0x2fe6fe[_0xbf98('0x59')](_0xe1b87e[_0xbf98('0x60')]+'.'+_0x251ff1+'\x20=\x20?',_0xe1b87e[_0xbf98('0x53')]);break;case _0xbf98('0x62'):if(_0x251ff1==='ContactId'){_0x2fe6fe[_0xbf98('0x59')](_0xbf98('0x63')+_0xbf98('0x64'),'%'+_0xe1b87e[_0xbf98('0x53')]+'%');_0x2fe6fe['or'](_0xbf98('0x65')+'\x20LIKE\x20?','%'+_0xe1b87e['value']+'%');_0x2fe6fe['or'](_0xbf98('0x66')+_0xbf98('0x64'),'%'+_0xe1b87e[_0xbf98('0x53')]+'%');}else{_0x2fe6fe[_0xbf98('0x59')](_0xe1b87e[_0xbf98('0x60')]+'.'+_0x251ff1+'\x20LIKE\x20?','%'+_0xe1b87e[_0xbf98('0x53')]+'%');}break;case'>':_0x2fe6fe['and'](_0xe1b87e[_0xbf98('0x60')]+'.'+_0x251ff1+_0xbf98('0x67'),_0xe1b87e['value']);break;case'<':_0x2fe6fe[_0xbf98('0x59')](_0xe1b87e[_0xbf98('0x60')]+'.'+_0x251ff1+_0xbf98('0x68'),_0xe1b87e[_0xbf98('0x53')]);break;}});}else{switch(_0xe1b87e[_0xbf98('0x5c')][_0xbf98('0x53')]){case'IS':if(_0x251ff1!==_0xbf98('0x5d')&&_0x251ff1!==_0xbf98('0x69')){if(_[_0xbf98('0x5b')](_0xe1b87e[_0xbf98('0x53')])&&_0xe1b87e[_0xbf98('0x53')][_0xbf98('0x5e')]>0x1){_0x2fe6fe['and'](_0xe1b87e[_0xbf98('0x60')]+'.'+_0x251ff1+_0xbf98('0x5f'),_0xe1b87e[_0xbf98('0x53')]);}else{_0x2fe6fe[_0xbf98('0x59')](_0xe1b87e['tableAlias']+'.'+_0x251ff1+_0xbf98('0x61'),_0xe1b87e[_0xbf98('0x53')][0x0]);}}break;case'=':_0x2fe6fe[_0xbf98('0x59')](_0xe1b87e[_0xbf98('0x60')]+'.'+_0x251ff1+_0xbf98('0x61'),_0xe1b87e['value']);break;case _0xbf98('0x62'):if(_0x251ff1===_0xbf98('0x6a')){_0x2fe6fe[_0xbf98('0x59')](_0xbf98('0x63')+_0xbf98('0x64'),'%'+_0xe1b87e[_0xbf98('0x53')]+'%');_0x2fe6fe['or'](_0xbf98('0x65')+'\x20LIKE\x20?','%'+_0xe1b87e[_0xbf98('0x53')]+'%');_0x2fe6fe['or']('c.email'+'\x20LIKE\x20?','%'+_0xe1b87e[_0xbf98('0x53')]+'%');}else{_0x2fe6fe['and'](_0xe1b87e[_0xbf98('0x60')]+'.'+_0x251ff1+_0xbf98('0x64'),'%'+_0xe1b87e['value']+'%');}break;case'>':_0x2fe6fe['and'](_0xe1b87e[_0xbf98('0x60')]+'.'+_0x251ff1+_0xbf98('0x67'),_0xe1b87e[_0xbf98('0x53')]);break;case'<':_0x2fe6fe[_0xbf98('0x59')](_0xe1b87e[_0xbf98('0x60')]+'.'+_0x251ff1+_0xbf98('0x68'),_0xe1b87e[_0xbf98('0x53')]);break;}}}});}else{var _0x8c6c7=_(Object['keys'](_0x2a6554[_0xbf98('0x33')]))[_0xbf98('0x6b')](function(_0x389210){return _0x4e7423['hasOwnProperty'](_0x389210)?_0x389210:undefined;})[_0xbf98('0x6c')](function(_0x32d3f6){return!_[_0xbf98('0x6d')](_0x32d3f6);})[_0xbf98('0x53')]();if(!_[_0xbf98('0x6e')](_0x8c6c7)){_0x8c6c7[_0xbf98('0x51')](function(_0x5c0723){if(_0x5c0723===_0xbf98('0x6f')){_0x362708[_0xbf98('0x3a')](_0xbf98('0x70'),[][_0xbf98('0x71')](_0x2a6554[_0xbf98('0x33')][_0x5c0723]));}else if(_0x5c0723===_0xbf98('0x52')){var _0x4c6d49=JSON[_0xbf98('0x50')](_0x2a6554['query'][_0x5c0723])[_0xbf98('0x72')];var _0x550339=JSON[_0xbf98('0x50')](_0x2a6554[_0xbf98('0x33')][_0x5c0723])[_0xbf98('0x73')];_0x362708[_0xbf98('0x3a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4c6d49,_0x550339);}else{_0x362708['where']('i.'+_0x5c0723+_0xbf98('0x61'),_0x2a6554[_0xbf98('0x33')][_0x5c0723]);}});}if(_0x2a6554['query'][_0xbf98('0x6c')]){var _0x34d96e=_0x2a6554[_0xbf98('0x33')][_0xbf98('0x6c')][_0xbf98('0x74')]('\x5c','\x5c\x5c')[_0xbf98('0x74')]('\x27\x27',_0xbf98('0x75'));if(qs['isNumeric'](_0x34d96e)){_0x2fe6fe['or'](_0xbf98('0x76'),_0x34d96e+'%')['or'](_0xbf98('0x77'),_0x34d96e+'%');}_0x2fe6fe['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x34d96e+'%');}}_0x362708[_0xbf98('0x3a')](_0x2fe6fe);if(_0x27a62d['order']){_0x27a62d[_0xbf98('0x78')][_0xbf98('0x51')](function(_0x4d4697){_0x362708[_0xbf98('0x78')]('i.'+_0x4d4697[0x0],_0x4d4697[0x1]==='DESC'?![]:!![]);});}_0x362708['group'](_0xbf98('0x79'));var _0x1105f2={'type':db['Sequelize'][_0xbf98('0x7a')]['SELECT'],'raw':!![]};var _0x5105e3=_0x362708['clone']()[_0xbf98('0x3d')](_0xbf98('0x41'));if(!_0x2a6554['query'][_0xbf98('0x4f')]){if(_0x2a6554['query'][_0xbf98('0x7b')]){if(_0x2a6554[_0xbf98('0x33')]['read']==0x1){_0x5105e3[_0xbf98('0x3a')](util[_0xbf98('0x57')](_0xbf98('0x7c'),_0x28ee68['toString']()));_0x362708['having']('`Messages.count`\x20=\x200');}else{_0x5105e3[_0xbf98('0x3a')](util[_0xbf98('0x57')](_0xbf98('0x7d'),_0x28ee68['toString']()));_0x362708['having'](_0xbf98('0x7e'));}}if(_0x2a6554['query'][_0xbf98('0x7f')]){var _0xb01e0=_[_0xbf98('0x5b')](_0x2a6554[_0xbf98('0x33')][_0xbf98('0x7f')])?_0x2a6554[_0xbf98('0x33')][_0xbf98('0x7f')]:new Array(_0x2a6554[_0xbf98('0x33')][_0xbf98('0x7f')]);var _0x3d558c=squel[_0xbf98('0x4e')]();_0xb01e0[_0xbf98('0x51')](function(_0x4a9f86){_0x3d558c['or'](_0xbf98('0x80'),'%,'+_0x4a9f86+',%');});_0x362708['having'](_0x3d558c);_0x5105e3[_0xbf98('0x46')]('fax_interaction_has_tags','it',_0xbf98('0x81'));_0x5105e3[_0xbf98('0x46')](_0xbf98('0x40'),'t',_0xbf98('0x82'));_0x5105e3['where'](_0xbf98('0x83'),_0xb01e0);}}else{var _0x3b2d45=JSON[_0xbf98('0x50')](_0x2a6554[_0xbf98('0x33')]['advancedFilter']);_[_0xbf98('0x32')](_0x3b2d45)[_0xbf98('0x51')](function(_0x269759){var _0x634493=_0x3b2d45[_0x269759];if(_0x269759===_0xbf98('0x5d')){var _0x590837=_0x634493[_0xbf98('0x53')];var _0x3462d4=squel[_0xbf98('0x4e')]();_0x590837['forEach'](function(_0xbbf56d){_0x3462d4['or'](_0xbf98('0x80'),'%,'+_0xbbf56d+',%');});_0x362708[_0xbf98('0x84')](_0x3462d4);_0x5105e3[_0xbf98('0x46')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x5105e3[_0xbf98('0x46')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x5105e3['where'](_0xbf98('0x83'),_0x590837);}else if(_0x269759==='Messages.count'){if(_0x634493[_0xbf98('0x53')][_0xbf98('0x5e')]===0x1){if(_0x634493[_0xbf98('0x53')][0x0]===0x1){_0x5105e3['where'](util[_0xbf98('0x57')](_0xbf98('0x7c'),_0x28ee68[_0xbf98('0x85')]()));_0x362708[_0xbf98('0x84')]('`Messages.count`\x20=\x200');}else{_0x5105e3[_0xbf98('0x3a')](util[_0xbf98('0x57')]('%s\x20>\x200',_0x28ee68[_0xbf98('0x85')]()));_0x362708[_0xbf98('0x84')](_0xbf98('0x7e'));}}}});}db['sequelize'][_0xbf98('0x33')](_0x5105e3[_0xbf98('0x85')](),_0x1105f2)[_0xbf98('0x29')](function(_0x1b87c4){_0x4a3787[_0xbf98('0x21')]=_0x1b87c4[_0xbf98('0x5e')];if(_0x4a3787[_0xbf98('0x21')]===0x0)return[];return db[_0xbf98('0x86')][_0xbf98('0x33')](_0x115539[_0xbf98('0x85')](),_0x1105f2)['then'](function(_0xa02bee){_0x5198f8=_[_0xbf98('0x87')](_0xa02bee,'id');_0x1105f2=_[_0xbf98('0x88')](_0x1105f2,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x362708['field'](_0x28ee68,_0xbf98('0x69'));_0x362708['field']('a.key',_0xbf98('0x89'));_0x362708[_0xbf98('0x3d')](_0xbf98('0x8a'));_0x362708[_0xbf98('0x3d')](_0xbf98('0x63'),'Contact.firstName');_0x362708[_0xbf98('0x3d')](_0xbf98('0x65'),_0xbf98('0x8b'));_0x362708[_0xbf98('0x3d')](_0xbf98('0x66'),_0xbf98('0x8c'));_0x362708['field']('c.phone',_0xbf98('0x8d'));_0x362708[_0xbf98('0x3d')](_0xbf98('0x8e'),_0xbf98('0x8f'));_0x362708[_0xbf98('0x3d')]('c.fax',_0xbf98('0x90'));_0x362708[_0xbf98('0x3d')](_0xbf98('0x91'),_0xbf98('0x92'));_0x362708[_0xbf98('0x3d')](_0xbf98('0x93'),_0xbf98('0x94'));_0x362708[_0xbf98('0x46')](_0xbf98('0x95'),'it',_0xbf98('0x81'));_0x362708[_0xbf98('0x46')](_0xbf98('0x40'),'t',_0xbf98('0x82'));_0x362708['limit'](_0x27a62d[_0xbf98('0x23')]);_0x362708['offset'](_0x27a62d[_0xbf98('0x22')]);return db[_0xbf98('0x86')][_0xbf98('0x33')](_0x362708[_0xbf98('0x85')](),_0x1105f2);})['then'](function(_0x4e472f){_0x4b3fb2[_0xbf98('0x3a')](_0xbf98('0x96'),_[_0xbf98('0x6b')](_0x4e472f,'id'));return db['sequelize'][_0xbf98('0x33')](_0x4b3fb2[_0xbf98('0x85')](),_0x1105f2)[_0xbf98('0x29')](function(_0x4f0c70){var _0x2529a5=_[_0xbf98('0x97')](_0x4f0c70,'FaxInteractionId');_0x4e472f[_0xbf98('0x51')](function(_0xa0ab9b){if(_0x2529a5[_0xa0ab9b['id']]){_0xa0ab9b['Users']=_[_0xbf98('0x6b')](_0x2529a5[_0xa0ab9b['id']],function(_0x474d6f){return{'id':_0x474d6f['id']};});}if(_0xa0ab9b[_0xbf98('0x94')]){_0xa0ab9b[_0xbf98('0x98')]=[];_0xa0ab9b['TagIds']['split'](',')['forEach'](function(_0x5d6616){_0xa0ab9b[_0xbf98('0x98')][_0xbf98('0x99')](_0x5198f8[_0x5d6616]);});}delete _0xa0ab9b[_0xbf98('0x94')];});return _0x4e472f;});});})[_0xbf98('0x29')](function(_0x28e7c5){_0x4a3787['rows']=_0x28e7c5;return _0x4a3787;})[_0xbf98('0x29')](respondWithFilteredResult(_0xd32f,_0x27a62d))[_0xbf98('0x9a')](handleError(_0xd32f,null));};exports['show']=function(_0x1bfaa5,_0xf37e59){var _0x4838e1={'raw':![],'where':{'id':_0x1bfaa5[_0xbf98('0x9b')]['id']}},_0x1c53be={};_0x1c53be['model']=_[_0xbf98('0x32')](db['FaxInteraction'][_0xbf98('0x30')]);_0x1c53be[_0xbf98('0x33')]=_[_0xbf98('0x32')](_0x1bfaa5[_0xbf98('0x33')]);_0x1c53be[_0xbf98('0x34')]=_['intersection'](_0x1c53be['model'],_0x1c53be[_0xbf98('0x33')]);_0x4838e1[_0xbf98('0x37')]=_[_0xbf98('0x35')](_0x1c53be[_0xbf98('0x31')],qs[_0xbf98('0x36')](_0x1bfaa5[_0xbf98('0x33')][_0xbf98('0x36')]));_0x4838e1['attributes']=_0x4838e1['attributes']['length']?_0x4838e1['attributes']:_0x1c53be['model'];if(_0x1bfaa5[_0xbf98('0x33')][_0xbf98('0x9c')]){_0x4838e1[_0xbf98('0x9d')]=[{'all':!![]}];}_0x4838e1=_['merge']({},_0x4838e1,_0x1bfaa5['options']);return db[_0xbf98('0x2f')][_0xbf98('0x9e')](_0x4838e1)[_0xbf98('0x29')](handleEntityNotFound(_0xf37e59,null))[_0xbf98('0x29')](respondWithResult(_0xf37e59,null))[_0xbf98('0x9a')](handleError(_0xf37e59,null));};exports[_0xbf98('0x9f')]=function(_0x433a52,_0x2bc045){return db[_0xbf98('0x2f')][_0xbf98('0x9f')](_0x433a52[_0xbf98('0xa0')],{})['then'](respondWithResult(_0x2bc045,0xc9))[_0xbf98('0x9a')](handleError(_0x2bc045,null));};exports['update']=function(_0x150e44,_0x2de377){if(_0x150e44['body']['id']){delete _0x150e44[_0xbf98('0xa0')]['id'];}return db['FaxInteraction'][_0xbf98('0x9e')]({'where':{'id':_0x150e44[_0xbf98('0x9b')]['id']}})[_0xbf98('0x29')](handleEntityNotFound(_0x2de377,null))[_0xbf98('0x29')](saveUpdates(_0x150e44[_0xbf98('0xa0')],null))[_0xbf98('0x29')](respondWithResult(_0x2de377,null))[_0xbf98('0x9a')](handleError(_0x2de377,null));};exports[_0xbf98('0x2a')]=function(_0x2244b7,_0x500cf3){return db[_0xbf98('0x2f')][_0xbf98('0x9e')]({'where':{'id':_0x2244b7[_0xbf98('0x9b')]['id']}})[_0xbf98('0x29')](handleEntityNotFound(_0x500cf3,null))[_0xbf98('0x29')](removeEntity(_0x500cf3,null))[_0xbf98('0x9a')](handleError(_0x500cf3,null));};exports[_0xbf98('0xa1')]=function(_0x4c0cf0,_0x482151){return db[_0xbf98('0x2f')][_0xbf98('0xa1')]()[_0xbf98('0x29')](respondWithResult(_0x482151,null))[_0xbf98('0x9a')](handleError(_0x482151,null));};exports[_0xbf98('0xa2')]=function(_0x352357,_0xc58b38,_0x2ba2d7){return db['FaxMessage'][_0xbf98('0x9e')]({'where':{'id':_0x352357[_0xbf98('0x9b')]['id']}})[_0xbf98('0x29')](handleEntityNotFound(_0xc58b38,null))[_0xbf98('0x29')](function(_0x305a45){if(_0x305a45){return _0x305a45[_0xbf98('0xa2')](_0x352357['body'][_0xbf98('0xa3')],_[_0xbf98('0xa4')](_0x352357[_0xbf98('0xa0')],[_0xbf98('0xa3'),'id'])||{});}})[_0xbf98('0x29')](respondWithResult(_0xc58b38,null))['catch'](handleError(_0xc58b38,null));};exports[_0xbf98('0xa5')]=function(_0x52c100,_0x185d14,_0xe2298a){var _0x43f349={'raw':![],'where':{}};var _0x38619c={};var _0x1cce8d={'count':0x0,'rows':[]};return db[_0xbf98('0x2f')][_0xbf98('0xa6')]({'where':{'id':_0x52c100[_0xbf98('0x9b')]['id']}})[_0xbf98('0x29')](handleEntityNotFound(_0x185d14,null))[_0xbf98('0x29')](function(_0x35499c){if(_0x35499c){_0x38619c['model']=_[_0xbf98('0x32')](db[_0xbf98('0xa7')][_0xbf98('0x30')]);_0x38619c[_0xbf98('0x33')]=_[_0xbf98('0x32')](_0x52c100[_0xbf98('0x33')]);_0x38619c['filters']=_['intersection'](_0x38619c[_0xbf98('0x31')],_0x38619c[_0xbf98('0x33')]);_0x43f349[_0xbf98('0x37')]=_[_0xbf98('0x35')](_0x38619c['model'],qs[_0xbf98('0x36')](_0x52c100['query'][_0xbf98('0x36')]));_0x43f349[_0xbf98('0x37')]=_0x43f349[_0xbf98('0x37')]['length']?_0x43f349[_0xbf98('0x37')]:_0x38619c['model'];if(!_0x52c100[_0xbf98('0x33')][_0xbf98('0x38')](_0xbf98('0xa8'))){_0x43f349[_0xbf98('0x23')]=qs[_0xbf98('0x23')](_0x52c100['query'][_0xbf98('0x23')]);_0x43f349['offset']=qs[_0xbf98('0x22')](_0x52c100['query'][_0xbf98('0x22')]);}_0x43f349['order']=qs['sort'](_0x52c100['query'][_0xbf98('0x39')]);_0x43f349[_0xbf98('0x3a')]=qs[_0xbf98('0x34')](_['pick'](_0x52c100[_0xbf98('0x33')],_0x38619c[_0xbf98('0x34')]));_0x43f349[_0xbf98('0x3a')]['FaxInteractionId']=_0x35499c['id'];if(_0x52c100[_0xbf98('0x33')][_0xbf98('0x6c')]){_0x43f349[_0xbf98('0x3a')]=_['merge'](_0x43f349[_0xbf98('0x3a')],{'$or':_[_0xbf98('0x6b')](_0x43f349[_0xbf98('0x37')],function(_0x11f800){var _0x40ad5c={};_0x40ad5c[_0x11f800]={'$like':'%'+_0x52c100['query'][_0xbf98('0x6c')]+'%'};return _0x40ad5c;})});}if(_0x52c100[_0xbf98('0x33')][_0xbf98('0x72')]){var _0x11a8c2=_0x52c100[_0xbf98('0x33')][_0xbf98('0x72')][_0xbf98('0xa9')](',');var _0x224686={};_0x224686[_0x11a8c2[0x0]]={'$gte':moment(_0x11a8c2[0x1])['format'](_0xbf98('0xaa'))};_0x43f349[_0xbf98('0x3a')]=_['merge'](_0x43f349[_0xbf98('0x3a')],_0x224686);}_0x43f349=_[_0xbf98('0x88')]({},_0x43f349,_0x52c100[_0xbf98('0xab')]);return db[_0xbf98('0xa7')][_0xbf98('0x21')]({'where':_0x43f349[_0xbf98('0x3a')]})['then'](function(_0x6a9767){_0x1cce8d['count']=_0x6a9767;if(_0x52c100[_0xbf98('0x33')][_0xbf98('0x9c')]){_0x43f349[_0xbf98('0x9d')]=[{'all':!![]}];}return db[_0xbf98('0xa7')][_0xbf98('0xac')](_0x43f349);})[_0xbf98('0x29')](function(_0x5f5045){_0x1cce8d[_0xbf98('0xad')]=_0x5f5045;return _0x1cce8d;});}})[_0xbf98('0x29')](respondWithFilteredResult(_0x185d14,_0x43f349))[_0xbf98('0x9a')](handleError(_0x185d14,null));};exports[_0xbf98('0xae')]=function(_0x37617b,_0x10de54,_0x7e1c87){return db[_0xbf98('0x2f')][_0xbf98('0x9e')]({'where':{'id':_0x37617b[_0xbf98('0x9b')]['id']}})[_0xbf98('0x29')](handleEntityNotFound(_0x10de54,null))[_0xbf98('0x29')](function(_0xe2d8cf){if(_0xe2d8cf){return _0xe2d8cf[_0xbf98('0xaf')](_0x37617b[_0xbf98('0xa0')][_0xbf98('0xa3')],_[_0xbf98('0xa4')](_0x37617b[_0xbf98('0xa0')],[_0xbf98('0xa3'),'id'])||{})[_0xbf98('0xb0')](function(){return db[_0xbf98('0xb1')][_0xbf98('0xac')]({'attributes':['id',_0xbf98('0x2c'),_0xbf98('0x3e')],'where':{'id':_0x37617b['body'][_0xbf98('0xa3')]}});})['then'](function(_0x21ff74){socket[_0xbf98('0xb2')](_0xbf98('0xb3'),{'id':Number(_0x37617b[_0xbf98('0x9b')]['id']),'tags':_0x21ff74||[]});return{'id':Number(_0x37617b[_0xbf98('0x9b')]['id']),'tags':_0x21ff74||[]};});}})[_0xbf98('0x29')](respondWithResult(_0x10de54,null))[_0xbf98('0x9a')](handleError(_0x10de54,null));};exports['removeTags']=function(_0x4bc301,_0x322be9,_0x47f7da){return db[_0xbf98('0x2f')][_0xbf98('0x9e')]({'where':{'id':_0x4bc301[_0xbf98('0x9b')]['id']}})[_0xbf98('0x29')](handleEntityNotFound(_0x322be9,null))[_0xbf98('0x29')](function(_0x11500b){if(_0x11500b){return _0x11500b[_0xbf98('0xb4')](_0x4bc301[_0xbf98('0x33')][_0xbf98('0xa3')]);}})[_0xbf98('0x29')](respondWithStatusCode(_0x322be9,null))[_0xbf98('0x9a')](handleError(_0x322be9,null));};exports[_0xbf98('0xb5')]=function(_0x50b1d6,_0x266047){var _0x51f68a=moment()[_0xbf98('0xb6')]()[_0xbf98('0x85')]();var _0xcdae3d=path[_0xbf98('0xb7')](config[_0xbf98('0xb8')],_0xbf98('0xb9'),_0xbf98('0xba'),_0xbf98('0xbb'));var _0x59f219=path['join'](config[_0xbf98('0xb8')],'server',_0xbf98('0xba'),_0xbf98('0xbc'));var _0x431309=path[_0xbf98('0xb7')](_0x59f219,_0x51f68a);var _0x799efd=util['format'](_0xbf98('0xbd'),_0x51f68a);var _0x19cbd9=path['join'](_0x59f219,_0x799efd);var _0x5e0f51=![];return db['FaxInteraction']['find']({'where':{'id':_0x50b1d6[_0xbf98('0x9b')]['id']}})[_0xbf98('0x29')](handleEntityNotFound(_0x266047,null))[_0xbf98('0x29')](function(_0x39d18f){if(_0x39d18f){return _0x39d18f['getMessages']({'attributes':['id',_0xbf98('0xa0'),_0xbf98('0x52')],'include':[{'model':db[_0xbf98('0xbe')],'as':_0xbf98('0xbe')}]});}return[];})['then'](function(_0x1e15cd){_0x5e0f51=_0x1e15cd[_0xbf98('0x5e')];if(_0x1e15cd['length']){fs['mkdirSync'](_0x431309);for(var _0x3f30fb=0x0;_0x3f30fb<_0x1e15cd[_0xbf98('0x5e')];_0x3f30fb++){var _0x23a097=_0x1e15cd[_0x3f30fb];var _0x36a08d=_0x23a097['Attachment'];if(_0x36a08d){var _0x3d5ae8=path[_0xbf98('0xb7')](_0xcdae3d,_0x36a08d[_0xbf98('0xbf')]);if(fs[_0xbf98('0xc0')](_0x3d5ae8)){fs[_0xbf98('0xc1')](_0x3d5ae8)[_0xbf98('0xc2')](fs[_0xbf98('0xc3')](path[_0xbf98('0xb7')](_0x431309,_0x36a08d[_0xbf98('0xbf')])));}}}}})['then'](function(){if(_0x5e0f51){return new BPromise(function(_0x3d9db8,_0xf4e71c){zipdir(_0x431309,{'saveTo':_0x19cbd9},function(_0x4cb4ae,_0x8a8d87){if(_0x4cb4ae)return _0xf4e71c(_0x4cb4ae);return _0x3d9db8(_0x8a8d87);});});}})['then'](function(){if(_0x5e0f51){return new BPromise(function(_0x437bb6,_0x24ae1d){rimraf(_0x431309,function(_0x278177){if(_0x278177)_0x24ae1d(_0x278177);return _0x437bb6();});});}})['then'](function(){if(_0x5e0f51){return _0x266047[_0xbf98('0xb5')](_0x19cbd9,_0x799efd,function(_0x260517){if(_0x260517){console[_0xbf98('0xc4')](_0xbf98('0xc5'),_0x260517);}else{fs['unlinkSync'](_0x19cbd9);}});}else{return _0x266047[_0xbf98('0x1e')](0xc8);}})['catch'](handleError(_0x266047,null));};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js
index c05140c..a98020c 100644
--- a/server/api/faxInteraction/faxInteraction.events.js
+++ b/server/api/faxInteraction/faxInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2547=['hasOwnProperty','exports','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','emit'];(function(_0x67143c,_0x433024){var _0x1dbbc3=function(_0x35a77f){while(--_0x35a77f){_0x67143c['push'](_0x67143c['shift']());}};_0x1dbbc3(++_0x433024);}(_0x2547,0x1cd));var _0x7254=function(_0x924bbd,_0x590775){_0x924bbd=_0x924bbd-0x0;var _0x3e15e=_0x2547[_0x924bbd];return _0x3e15e;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x7254('0x0'))['db'][_0x7254('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7254('0x2')](0x0);var events={'afterCreate':_0x7254('0x3'),'afterUpdate':_0x7254('0x4'),'afterDestroy':_0x7254('0x5')};function emitEvent(_0x9f3435){return function(_0x265ebf,_0x53a02f,_0x2ddeae){FaxInteractionEvents[_0x7254('0x6')](_0x9f3435+':'+_0x265ebf['id'],_0x265ebf);FaxInteractionEvents[_0x7254('0x6')](_0x9f3435,_0x265ebf);_0x2ddeae(null);};}for(var e in events){if(events[_0x7254('0x7')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x7254('0x8')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x1be1=['FaxInteraction','setMaxListeners','update','remove','emit','hook'];(function(_0x5cdebc,_0x2b44ff){var _0x1461b8=function(_0xa959d){while(--_0xa959d){_0x5cdebc['push'](_0x5cdebc['shift']());}};_0x1461b8(++_0x2b44ff);}(_0x1be1,0x192));var _0x11be=function(_0x2bad46,_0x57195e){_0x2bad46=_0x2bad46-0x0;var _0x282c18=_0x1be1[_0x2bad46];return _0x282c18;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0x11be('0x0')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x11be('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11be('0x2'),'afterDestroy':_0x11be('0x3')};function emitEvent(_0x200b2a){return function(_0x318d41,_0x504d3a,_0x3ce56d){FaxInteractionEvents[_0x11be('0x4')](_0x200b2a+':'+_0x318d41['id'],_0x318d41);FaxInteractionEvents[_0x11be('0x4')](_0x200b2a,_0x318d41);_0x3ce56d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x11be('0x5')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js
index 6ee9273..09dec3f 100644
--- a/server/api/faxInteraction/faxInteraction.model.js
+++ b/server/api/faxInteraction/faxInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9d81=['fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','define'];(function(_0x56e828,_0x40b17b){var _0x24300b=function(_0xce649a){while(--_0xce649a){_0x56e828['push'](_0x56e828['shift']());}};_0x24300b(++_0x40b17b);}(_0x9d81,0x19c));var _0x19d8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9d81[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x19d8('0x0'));var util=require('util');var logger=require(_0x19d8('0x1'))(_0x19d8('0x2'));var moment=require(_0x19d8('0x3'));var BPromise=require(_0x19d8('0x4'));var rp=require(_0x19d8('0x5'));var fs=require('fs');var path=require(_0x19d8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x144afb,_0x14a8bd){return _0x144afb[_0x19d8('0x7')]('FaxInteraction',attributes,{'tableName':_0x19d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e3e18,_0x3388e0,_0x2a116b){if(_0x2e3e18[_0x19d8('0x9')](_0x19d8('0xa'))){_0x2e3e18[_0x19d8('0xb')]=moment()[_0x19d8('0xc')](_0x19d8('0xd'));}_0x2a116b(null,_0x2e3e18);}}});};
\ No newline at end of file
+var _0x9a4e=['path','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','bluebird','request-promise'];(function(_0xdf7b0d,_0x2af488){var _0x24380a=function(_0x2a2367){while(--_0x2a2367){_0xdf7b0d['push'](_0xdf7b0d['shift']());}};_0x24380a(++_0x2af488);}(_0x9a4e,0x176));var _0xe9a4=function(_0x415da0,_0x26b9ec){_0x415da0=_0x415da0-0x0;var _0x59f257=_0x9a4e[_0x415da0];return _0x59f257;};'use strict';var _=require('lodash');var util=require(_0xe9a4('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe9a4('0x1'));var rp=require(_0xe9a4('0x2'));var fs=require('fs');var path=require(_0xe9a4('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe9a4('0x4'));module[_0xe9a4('0x5')]=function(_0x3309eb,_0x1fd10f){return _0x3309eb[_0xe9a4('0x6')](_0xe9a4('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x16922e,_0x44d6dc,_0x1d35d0){if(_0x16922e[_0xe9a4('0x8')](_0xe9a4('0x9'))){_0x16922e[_0xe9a4('0xa')]=moment()[_0xe9a4('0xb')](_0xe9a4('0xc'));}_0x1d35d0(null,_0x16922e);}}});};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js
index 0773298..3de9793 100644
--- a/server/api/faxInteraction/faxInteraction.rpc.js
+++ b/server/api/faxInteraction/faxInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d6a=['attributes','limit','debug','AddTagsToFaxInteraction','find','where','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw'];(function(_0x53ea20,_0x56ac6d){var _0x4a93e8=function(_0x1c39b5){while(--_0x1c39b5){_0x53ea20['push'](_0x53ea20['shift']());}};_0x4a93e8(++_0x56ac6d);}(_0x3d6a,0xe0));var _0xa3d6=function(_0x53dcde,_0x4650ff){_0x53dcde=_0x53dcde-0x0;var _0x40be2c=_0x3d6a[_0x53dcde];return _0x40be2c;};'use strict';var _=require(_0xa3d6('0x0'));var util=require(_0xa3d6('0x1'));var moment=require(_0xa3d6('0x2'));var BPromise=require(_0xa3d6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3d6('0x4'));var db=require(_0xa3d6('0x5'))['db'];var utils=require(_0xa3d6('0x6'));var logger=require(_0xa3d6('0x7'))(_0xa3d6('0x8'));var config=require(_0xa3d6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa3d6('0xa')][_0xa3d6('0xb')]({'port':0x232a});config['redis']=_[_0xa3d6('0xc')](config[_0xa3d6('0xd')],{'host':_0xa3d6('0xe'),'port':0x18eb});var socket=require(_0xa3d6('0xf'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xa3d6('0x10')](socket);function respondWithRpcPromise(_0x601d5e,_0x465efa,_0x298337){return new BPromise(function(_0x35eaab,_0x10a0cb){return client[_0xa3d6('0x11')](_0x601d5e,_0x298337)['then'](function(_0x116dab){logger[_0xa3d6('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x465efa,_0xa3d6('0x13'));logger['debug'](_0xa3d6('0x14'),_0x465efa,_0xa3d6('0x13'),JSON[_0xa3d6('0x15')](_0x116dab));if(_0x116dab['error']){if(_0x116dab[_0xa3d6('0x16')][_0xa3d6('0x17')]===0x1f4){logger[_0xa3d6('0x16')](_0xa3d6('0x18'),_0x465efa,_0x116dab[_0xa3d6('0x16')][_0xa3d6('0x19')]);return _0x10a0cb(_0x116dab['error'][_0xa3d6('0x19')]);}logger[_0xa3d6('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x465efa,_0x116dab['error'][_0xa3d6('0x19')]);return _0x35eaab(_0x116dab[_0xa3d6('0x16')][_0xa3d6('0x19')]);}else{logger[_0xa3d6('0x12')](_0xa3d6('0x18'),_0x465efa,_0xa3d6('0x13'));_0x35eaab(_0x116dab[_0xa3d6('0x1a')][_0xa3d6('0x19')]);}})[_0xa3d6('0x1b')](function(_0x893322){logger[_0xa3d6('0x16')](_0xa3d6('0x18'),_0x465efa,_0x893322);_0x10a0cb(_0x893322);});});}exports[_0xa3d6('0x1c')]=function(_0x2df2d7){var _0xbcd1cf=this;return new Promise(function(_0x3a166b,_0x1b7160){return db[_0xa3d6('0x1d')][_0xa3d6('0x1e')](_0x2df2d7[_0xa3d6('0x1f')],{'raw':_0x2df2d7[_0xa3d6('0x20')]?_0x2df2d7[_0xa3d6('0x20')][_0xa3d6('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2df2d7['options']?_0x2df2d7[_0xa3d6('0x20')]['where']||null:null,'attributes':_0x2df2d7[_0xa3d6('0x20')]?_0x2df2d7[_0xa3d6('0x20')][_0xa3d6('0x22')]||null:null,'limit':_0x2df2d7[_0xa3d6('0x20')]?_0x2df2d7['options'][_0xa3d6('0x23')]||null:null})['then'](function(_0x41b6f1){logger[_0xa3d6('0x12')](_0xa3d6('0x1c'),_0x2df2d7);logger[_0xa3d6('0x24')]('UpdateFaxInteraction',_0x2df2d7,JSON[_0xa3d6('0x15')](_0x41b6f1));_0x3a166b(_0x41b6f1);})[_0xa3d6('0x1b')](function(_0x126307){logger[_0xa3d6('0x16')]('UpdateFaxInteraction',_0x126307[_0xa3d6('0x19')],_0x2df2d7);_0x1b7160(_0xbcd1cf[_0xa3d6('0x16')](0x1f4,_0x126307[_0xa3d6('0x19')]));});});};exports[_0xa3d6('0x25')]=function(_0x84d33d){return new Promise(function(_0x33eb36,_0x42a757){return db[_0xa3d6('0x1d')][_0xa3d6('0x26')]({'where':_0x84d33d['options']?_0x84d33d[_0xa3d6('0x20')][_0xa3d6('0x27')]||null:null})['then'](function(_0x3a1df9){if(_0x3a1df9){return _0x3a1df9['addTags'](_0x84d33d[_0xa3d6('0x1f')]['ids'],_[_0xa3d6('0x28')](_0x84d33d[_0xa3d6('0x1f')],['ids','id'])||{});}})[_0xa3d6('0x29')](function(_0x26945f){logger[_0xa3d6('0x12')](_0xa3d6('0x2a'),_0x84d33d);logger[_0xa3d6('0x24')](_0xa3d6('0x2a'),_0x84d33d,JSON[_0xa3d6('0x15')](_0x26945f));_0x33eb36(_0x26945f);})['catch'](function(_0x3342b9){logger[_0xa3d6('0x16')](_0xa3d6('0x2a'),_0x3342b9['message'],_0x84d33d);_0x42a757(_this['error'](0x1f4,_0x3342b9[_0xa3d6('0x19')]));});});};
\ No newline at end of file
+var _0x930e=['redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x291aaf,_0x4c6d8d){var _0x5571e6=function(_0x1b4fec){while(--_0x1b4fec){_0x291aaf['push'](_0x291aaf['shift']());}};_0x5571e6(++_0x4c6d8d);}(_0x930e,0xfd));var _0xe930=function(_0x7389f2,_0x4fae5c){_0x7389f2=_0x7389f2-0x0;var _0x1c3722=_0x930e[_0x7389f2];return _0x1c3722;};'use strict';var _=require(_0xe930('0x0'));var util=require('util');var moment=require(_0xe930('0x1'));var BPromise=require(_0xe930('0x2'));var rs=require(_0xe930('0x3'));var fs=require('fs');var Redis=require(_0xe930('0x4'));var db=require(_0xe930('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe930('0x6'))(_0xe930('0x7'));var config=require(_0xe930('0x8'));var jayson=require(_0xe930('0x9'));var client=jayson['client'][_0xe930('0xa')]({'port':0x232a});config[_0xe930('0xb')]=_[_0xe930('0xc')](config[_0xe930('0xb')],{'host':_0xe930('0xd'),'port':0x18eb});var socket=require(_0xe930('0xe'))(new Redis(config[_0xe930('0xb')]));require(_0xe930('0xf'))['register'](socket);function respondWithRpcPromise(_0x4384b4,_0x105fe7,_0x1b2978){return new BPromise(function(_0xd46c1b,_0x1a55f0){return client[_0xe930('0x10')](_0x4384b4,_0x1b2978)[_0xe930('0x11')](function(_0x26ae86){logger[_0xe930('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x105fe7,_0xe930('0x13'));logger[_0xe930('0x14')](_0xe930('0x15'),_0x105fe7,_0xe930('0x13'),JSON[_0xe930('0x16')](_0x26ae86));if(_0x26ae86[_0xe930('0x17')]){if(_0x26ae86[_0xe930('0x17')]['code']===0x1f4){logger['error'](_0xe930('0x18'),_0x105fe7,_0x26ae86[_0xe930('0x17')]['message']);return _0x1a55f0(_0x26ae86[_0xe930('0x17')][_0xe930('0x19')]);}logger[_0xe930('0x17')](_0xe930('0x18'),_0x105fe7,_0x26ae86[_0xe930('0x17')]['message']);return _0xd46c1b(_0x26ae86[_0xe930('0x17')][_0xe930('0x19')]);}else{logger[_0xe930('0x12')](_0xe930('0x18'),_0x105fe7,'request\x20sent');_0xd46c1b(_0x26ae86[_0xe930('0x1a')][_0xe930('0x19')]);}})['catch'](function(_0x1ed2fd){logger[_0xe930('0x17')](_0xe930('0x18'),_0x105fe7,_0x1ed2fd);_0x1a55f0(_0x1ed2fd);});});}exports[_0xe930('0x1b')]=function(_0x59be36){var _0x2a1d57=this;return new Promise(function(_0x176514,_0x53cbf8){return db[_0xe930('0x1c')][_0xe930('0x1d')](_0x59be36[_0xe930('0x1e')],{'raw':_0x59be36[_0xe930('0x1f')]?_0x59be36[_0xe930('0x1f')][_0xe930('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59be36['options']?_0x59be36['options'][_0xe930('0x21')]||null:null,'attributes':_0x59be36[_0xe930('0x1f')]?_0x59be36[_0xe930('0x1f')][_0xe930('0x22')]||null:null,'limit':_0x59be36[_0xe930('0x1f')]?_0x59be36['options'][_0xe930('0x23')]||null:null})[_0xe930('0x11')](function(_0x476f68){logger[_0xe930('0x12')]('UpdateFaxInteraction',_0x59be36);logger[_0xe930('0x14')](_0xe930('0x1b'),_0x59be36,JSON[_0xe930('0x16')](_0x476f68));_0x176514(_0x476f68);})[_0xe930('0x24')](function(_0x590e5d){logger[_0xe930('0x17')](_0xe930('0x1b'),_0x590e5d[_0xe930('0x19')],_0x59be36);_0x53cbf8(_0x2a1d57['error'](0x1f4,_0x590e5d[_0xe930('0x19')]));});});};exports[_0xe930('0x25')]=function(_0x4f4786){return new Promise(function(_0xd50ad1,_0x570918){return db[_0xe930('0x1c')][_0xe930('0x26')]({'where':_0x4f4786['options']?_0x4f4786[_0xe930('0x1f')][_0xe930('0x21')]||null:null})[_0xe930('0x11')](function(_0x4049b3){if(_0x4049b3){return _0x4049b3[_0xe930('0x27')](_0x4f4786[_0xe930('0x1e')][_0xe930('0x28')],_[_0xe930('0x29')](_0x4f4786[_0xe930('0x1e')],[_0xe930('0x28'),'id'])||{});}})[_0xe930('0x2a')](function(_0x396852){logger[_0xe930('0x12')](_0xe930('0x2b'),_0x4f4786);logger[_0xe930('0x14')](_0xe930('0x2b'),_0x4f4786,JSON[_0xe930('0x16')](_0x396852));_0xd50ad1(_0x396852);})[_0xe930('0x24')](function(_0x295552){logger[_0xe930('0x17')]('AddTags',_0x295552[_0xe930('0x19')],_0x4f4786);_0x570918(_this[_0xe930('0x17')](0x1f4,_0x295552[_0xe930('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js
index 7b18e88..bb11a6a 100644
--- a/server/api/faxInteraction/faxInteraction.socket.js
+++ b/server/api/faxInteraction/faxInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8568=['update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8568,0x1a4));var _0x8856=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x8568[_0x292f93];return _0x5a94b1;};'use strict';var FaxInteractionEvents=require(_0x8856('0x0'));var events=[_0x8856('0x1'),_0x8856('0x2'),_0x8856('0x3')];function createListener(_0x1ff806,_0x30ce4f){return function(_0x2a38dc){_0x30ce4f[_0x8856('0x4')](_0x1ff806,_0x2a38dc);};}function removeListener(_0x285418,_0x281b81){return function(){FaxInteractionEvents[_0x8856('0x5')](_0x285418,_0x281b81);};}exports[_0x8856('0x6')]=function(_0x280f4d){for(var _0x561d50=0x0,_0x373fb0=events[_0x8856('0x7')];_0x561d50<_0x373fb0;_0x561d50++){var _0x4ac6e1=events[_0x561d50];var _0x57210c=createListener(_0x8856('0x8')+_0x4ac6e1,_0x280f4d);FaxInteractionEvents['on'](_0x4ac6e1,_0x57210c);}};
\ No newline at end of file
+var _0x458f=['removeListener','register','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0xe56a81,_0x211068){var _0xde5222=function(_0x2da866){while(--_0x2da866){_0xe56a81['push'](_0xe56a81['shift']());}};_0xde5222(++_0x211068);}(_0x458f,0x1c3));var _0xf458=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x458f[_0x59ee6f];return _0x4c0979;};'use strict';var FaxInteractionEvents=require(_0xf458('0x0'));var events=[_0xf458('0x1'),_0xf458('0x2'),_0xf458('0x3')];function createListener(_0x2c310f,_0x504951){return function(_0x4fb7dc){_0x504951[_0xf458('0x4')](_0x2c310f,_0x4fb7dc);};}function removeListener(_0x56dbb6,_0x498878){return function(){FaxInteractionEvents[_0xf458('0x5')](_0x56dbb6,_0x498878);};}exports[_0xf458('0x6')]=function(_0x4130eb){for(var _0x2b8323=0x0,_0x206dbc=events['length'];_0x2b8323<_0x206dbc;_0x2b8323++){var _0x39d963=events[_0x2b8323];var _0x537f5d=createListener(_0xf458('0x7')+_0x39d963,_0x4130eb);FaxInteractionEvents['on'](_0x39d963,_0x537f5d);}};
\ No newline at end of file
diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js
index a1cc66b..12618fe 100644
--- a/server/api/faxInteraction/index.js
+++ b/server/api/faxInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0639=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','fax','faxinteraction:addtags','addTags','put','tracked','faxinteraction:update','update','faxinteraction:destroy','delete','/:id/tags','removeTags','exports','util'];(function(_0x173afe,_0x12eb14){var _0xb3e606=function(_0xee5442){while(--_0xee5442){_0x173afe['push'](_0x173afe['shift']());}};_0xb3e606(++_0x12eb14);}(_0x0639,0x7f));var _0x9063=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x0639[_0x2b9b7f];return _0x4ed19a;};'use strict';var multer=require('multer');var util=require(_0x9063('0x0'));var path=require(_0x9063('0x1'));var timeout=require(_0x9063('0x2'));var express=require(_0x9063('0x3'));var router=express['Router']();var auth=require(_0x9063('0x4'));var interaction=require(_0x9063('0x5'));var config=require(_0x9063('0x6'));var controller=require(_0x9063('0x7'));router['get']('/',auth[_0x9063('0x8')](),controller[_0x9063('0x9')]);router[_0x9063('0xa')](_0x9063('0xb'),auth[_0x9063('0x8')](),controller[_0x9063('0xc')]);router[_0x9063('0xa')](_0x9063('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9063('0xa')](_0x9063('0xe'),auth['isAuthenticated'](),controller[_0x9063('0xf')]);router[_0x9063('0xa')](_0x9063('0x10'),auth[_0x9063('0x8')](),controller[_0x9063('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9063('0x12')]);router['post'](_0x9063('0xe'),auth[_0x9063('0x8')](),controller[_0x9063('0x13')]);router['post']('/:id/tags',auth[_0x9063('0x8')](),interaction['tracked'](_0x9063('0x14'),_0x9063('0x15')),controller[_0x9063('0x16')]);router[_0x9063('0x17')](_0x9063('0xd'),auth[_0x9063('0x8')](),interaction[_0x9063('0x18')](_0x9063('0x14'),_0x9063('0x19')),controller[_0x9063('0x1a')]);router['delete']('/:id',auth[_0x9063('0x8')](),interaction[_0x9063('0x18')](_0x9063('0x14'),_0x9063('0x1b')),controller['destroy']);router[_0x9063('0x1c')](_0x9063('0x1d'),auth[_0x9063('0x8')](),controller[_0x9063('0x1e')]);module[_0x9063('0x1f')]=router;
\ No newline at end of file
+var _0x0afa=['update','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','faxinteraction:addtags','addTags','put','tracked','fax','faxinteraction:update'];(function(_0x357f0a,_0x37aa60){var _0x10d41b=function(_0x3ef2e1){while(--_0x3ef2e1){_0x357f0a['push'](_0x357f0a['shift']());}};_0x10d41b(++_0x37aa60);}(_0x0afa,0x126));var _0xa0af=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0afa[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xa0af('0x0'));var util=require(_0xa0af('0x1'));var path=require(_0xa0af('0x2'));var timeout=require(_0xa0af('0x3'));var express=require('express');var router=express[_0xa0af('0x4')]();var auth=require(_0xa0af('0x5'));var interaction=require(_0xa0af('0x6'));var config=require(_0xa0af('0x7'));var controller=require('./faxInteraction.controller');router[_0xa0af('0x8')]('/',auth[_0xa0af('0x9')](),controller[_0xa0af('0xa')]);router[_0xa0af('0x8')](_0xa0af('0xb'),auth[_0xa0af('0x9')](),controller[_0xa0af('0xc')]);router[_0xa0af('0x8')](_0xa0af('0xd'),auth[_0xa0af('0x9')](),controller[_0xa0af('0xe')]);router[_0xa0af('0x8')](_0xa0af('0xf'),auth[_0xa0af('0x9')](),controller[_0xa0af('0x10')]);router[_0xa0af('0x8')](_0xa0af('0x11'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xa0af('0x9')](),controller[_0xa0af('0x12')]);router['post'](_0xa0af('0xf'),auth[_0xa0af('0x9')](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction['tracked']('fax',_0xa0af('0x13')),controller[_0xa0af('0x14')]);router[_0xa0af('0x15')]('/:id',auth[_0xa0af('0x9')](),interaction[_0xa0af('0x16')](_0xa0af('0x17'),_0xa0af('0x18')),controller[_0xa0af('0x19')]);router['delete'](_0xa0af('0xd'),auth['isAuthenticated'](),interaction[_0xa0af('0x16')](_0xa0af('0x17'),'faxinteraction:destroy'),controller[_0xa0af('0x1a')]);router['delete']('/:id/tags',auth[_0xa0af('0x9')](),controller[_0xa0af('0x1b')]);module[_0xa0af('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js
index 39dd1d4..e555e9d 100644
--- a/server/api/faxMessage/faxMessage.attributes.js
+++ b/server/api/faxMessage/faxMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1cb1=['DATE','sequelize','exports','out'];(function(_0x3ffcfe,_0x569da1){var _0x3fbbfc=function(_0x3d418b){while(--_0x3d418b){_0x3ffcfe['push'](_0x3ffcfe['shift']());}};_0x3fbbfc(++_0x569da1);}(_0x1cb1,0x149));var _0x11cb=function(_0x551967,_0xf2dc7e){_0x551967=_0x551967-0x0;var _0x272036=_0x1cb1[_0x551967];return _0x272036;};'use strict';var Sequelize=require(_0x11cb('0x0'));module[_0x11cb('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x11cb('0x2'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x11cb('0x3')]}};
\ No newline at end of file
+var _0x7ab0=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x2bb80d,_0x4625ec){var _0xe89d2c=function(_0xca3e00){while(--_0xca3e00){_0x2bb80d['push'](_0x2bb80d['shift']());}};_0xe89d2c(++_0x4625ec);}(_0x7ab0,0x135));var _0x07ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7ab0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x07ab('0x0'));module[_0x07ab('0x1')]={'body':{'type':Sequelize[_0x07ab('0x2')](_0x07ab('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x07ab('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x07ab('0x5')]('in','out'),'defaultValue':_0x07ab('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x07ab('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x07ab('0x7')]}};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js
index 4eed879..418fa94 100644
--- a/server/api/faxMessage/faxMessage.controller.js
+++ b/server/api/faxMessage/faxMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc511=['accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','interface','rejectmessage','create','findOne','ContactId','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','server','attachments','Attachment','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./faxMessage.socket','register','jayson/promise','client','http','test','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','FaxMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','rows','show','find','body','params','describe','fax-interactions'];(function(_0x40fb7b,_0x3af7b9){var _0x47e53e=function(_0x1d90ca){while(--_0x1d90ca){_0x40fb7b['push'](_0x40fb7b['shift']());}};_0x47e53e(++_0x3af7b9);}(_0xc511,0x137));var _0x1c51=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0xc511[_0x2a0183];return _0x158c3a;};'use strict';var pdf=require(_0x1c51('0x0'));var emlformat=require(_0x1c51('0x1'));var rimraf=require(_0x1c51('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c51('0x3'));var rp=require(_0x1c51('0x4'));var moment=require(_0x1c51('0x5'));var BPromise=require(_0x1c51('0x6'));var Mustache=require(_0x1c51('0x7'));var util=require(_0x1c51('0x8'));var path=require('path');var sox=require(_0x1c51('0x9'));var csv=require(_0x1c51('0xa'));var ejs=require(_0x1c51('0xb'));var fs=require('fs');var _=require(_0x1c51('0xc'));var squel=require(_0x1c51('0xd'));var crypto=require('crypto');var jsforce=require(_0x1c51('0xe'));var deskjs=require(_0x1c51('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1c51('0x10'));var Papa=require(_0x1c51('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1c51('0x12'));var hardwareService=require(_0x1c51('0x13'));var logger=require(_0x1c51('0x14'))('api');var utils=require(_0x1c51('0x15'));var config=require(_0x1c51('0x16'));var db=require(_0x1c51('0x17'))['db'];config[_0x1c51('0x18')]=_['defaults'](config[_0x1c51('0x18')],{'host':_0x1c51('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c51('0x18')]));require(_0x1c51('0x1a'))[_0x1c51('0x1b')](socket);var jayson=require(_0x1c51('0x1c'));var client=jayson[_0x1c51('0x1d')][_0x1c51('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x192e73,_0x4b6b36,_0x20ac4a){if(_0x20ac4a){var _0x5a9e92=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a9e92[_0x1c51('0x1f')](_0x4b6b36)){return _0x192e73;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x192e73;}}function respondWithRpcPromise(_0x122cf5,_0x4aaf26,_0x400799,_0x31ff0d){return new BPromise(function(_0x3431cc,_0x3897f0){var _0xa2d18e=_0x31ff0d||client;return _0xa2d18e[_0x1c51('0x20')](_0x122cf5,_0x400799)[_0x1c51('0x21')](function(_0x3b23ba){logger[_0x1c51('0x22')](_0x1c51('0x23'),_0x4aaf26,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4aaf26,_0x1c51('0x24'),JSON[_0x1c51('0x25')](_0x3b23ba));if(_0x3b23ba['error']){if(_0x3b23ba[_0x1c51('0x26')][_0x1c51('0x27')]===0x1f4){logger[_0x1c51('0x26')](_0x1c51('0x23'),_0x4aaf26,_0x3b23ba[_0x1c51('0x26')][_0x1c51('0x28')]);return _0x3897f0(_0x3b23ba['error'][_0x1c51('0x28')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x4aaf26,_0x3b23ba['error']['message']);return _0x3431cc(_0x3b23ba[_0x1c51('0x26')]['message']);}else{logger['info'](_0x1c51('0x23'),_0x4aaf26,_0x1c51('0x24'));_0x3431cc(_0x3b23ba[_0x1c51('0x29')][_0x1c51('0x28')]);}})[_0x1c51('0x2a')](function(_0x30ef5c){logger[_0x1c51('0x26')]('FaxMessage,\x20%s,\x20%s',_0x4aaf26,_0x30ef5c);_0x3897f0(_0x30ef5c);});});}function respondWithStatusCode(_0x583bd2,_0x280a01){_0x280a01=_0x280a01||0xcc;return function(_0x436126){if(_0x436126){return _0x583bd2[_0x1c51('0x2b')](_0x280a01);}return _0x583bd2[_0x1c51('0x2c')](_0x280a01)[_0x1c51('0x2d')]();};}function respondWithResult(_0x51e464,_0x178845){_0x178845=_0x178845||0xc8;return function(_0x1121e6){if(_0x1121e6){return _0x51e464[_0x1c51('0x2c')](_0x178845)[_0x1c51('0x2e')](_0x1121e6);}};}function respondWithFilteredResult(_0x17ebb5,_0x524c1d){return function(_0x337073){if(_0x337073){var _0x56f8dd=_0x337073[_0x1c51('0x2f')],_0x3103ca=_0x524c1d['offset'],_0x322687=_0x524c1d[_0x1c51('0x30')]+_0x524c1d[_0x1c51('0x31')],_0x2996d4;if(_0x322687>=_0x56f8dd){_0x322687=_0x56f8dd;_0x2996d4=0xc8;}else{_0x2996d4=0xce;}_0x17ebb5[_0x1c51('0x2c')](_0x2996d4);return _0x17ebb5[_0x1c51('0x32')](_0x1c51('0x33'),_0x3103ca+'-'+_0x322687+'/'+_0x56f8dd)[_0x1c51('0x2e')](_0x337073);}return null;};}function patchUpdates(_0x11dc11){return function(_0x1a1e1b){try{jsonpatch[_0x1c51('0x34')](_0x1a1e1b,_0x11dc11,!![]);}catch(_0x3f3d7e){return BPromise[_0x1c51('0x35')](_0x3f3d7e);}return _0x1a1e1b[_0x1c51('0x36')]();};}function saveUpdates(_0x5b0bbb,_0x45b156){return function(_0x50d260){if(_0x50d260){return _0x50d260[_0x1c51('0x37')](_0x5b0bbb)['then'](function(_0x474f76){return _0x474f76;});}return null;};}function removeEntity(_0x558720,_0x2834e8){return function(_0x6c2ffa){if(_0x6c2ffa){return _0x6c2ffa[_0x1c51('0x38')]()[_0x1c51('0x21')](function(){_0x558720[_0x1c51('0x2c')](0xcc)[_0x1c51('0x2d')]();});}};}function handleEntityNotFound(_0x3804f9,_0x3a084f){return function(_0x1bf2d1){if(!_0x1bf2d1){_0x3804f9['sendStatus'](0x194);}return _0x1bf2d1;};}function handleError(_0x4e0928,_0x4c8fcd){_0x4c8fcd=_0x4c8fcd||0x1f4;return function(_0x142c0b){logger[_0x1c51('0x26')](_0x142c0b['stack']);if(_0x142c0b['name']){delete _0x142c0b[_0x1c51('0x39')];}_0x4e0928['status'](_0x4c8fcd)[_0x1c51('0x3a')](_0x142c0b);};}exports[_0x1c51('0x3b')]=function(_0x4821f8,_0x18bb41){var _0x39ceac={},_0x355206={},_0x4c7ffb={'count':0x0,'rows':[]};var _0x25286e=db[_0x1c51('0x3c')][_0x1c51('0x3d')];_0x355206[_0x1c51('0x3e')]=_[_0x1c51('0x3f')](_0x25286e);_0x355206[_0x1c51('0x40')]=_['keys'](_0x4821f8[_0x1c51('0x40')]);_0x355206[_0x1c51('0x41')]=_[_0x1c51('0x42')](_0x355206['model'],_0x355206[_0x1c51('0x40')]);_0x39ceac[_0x1c51('0x43')]=_[_0x1c51('0x42')](_0x355206[_0x1c51('0x3e')],qs[_0x1c51('0x44')](_0x4821f8[_0x1c51('0x40')]['fields']));_0x39ceac[_0x1c51('0x43')]=_0x39ceac[_0x1c51('0x43')][_0x1c51('0x45')]?_0x39ceac['attributes']:_0x355206[_0x1c51('0x3e')];if(!_0x4821f8['query'][_0x1c51('0x46')]('nolimit')){_0x39ceac[_0x1c51('0x31')]=qs[_0x1c51('0x31')](_0x4821f8[_0x1c51('0x40')][_0x1c51('0x31')]);_0x39ceac[_0x1c51('0x30')]=qs[_0x1c51('0x30')](_0x4821f8[_0x1c51('0x40')][_0x1c51('0x30')]);}_0x39ceac[_0x1c51('0x47')]=qs['sort'](_0x4821f8[_0x1c51('0x40')][_0x1c51('0x48')]);_0x39ceac[_0x1c51('0x49')]=qs[_0x1c51('0x41')](_[_0x1c51('0x4a')](_0x4821f8[_0x1c51('0x40')],_0x355206[_0x1c51('0x41')]));if(_0x4821f8['query'][_0x1c51('0x4b')]){_0x39ceac[_0x1c51('0x49')]=_['merge'](_0x39ceac[_0x1c51('0x49')],{'$or':_[_0x1c51('0x4c')](_0x25286e,function(_0x1566ea){if(_0x1566ea[_0x1c51('0x4d')][_0x1c51('0x4e')]!==_0x1c51('0x4f')){var _0x563ad3={};_0x563ad3[_0x1566ea[_0x1c51('0x50')]]={'$like':'%'+_0x4821f8['query'][_0x1c51('0x4b')]+'%'};return _0x563ad3;}})});}_0x39ceac=_[_0x1c51('0x51')]({},_0x39ceac,_0x4821f8[_0x1c51('0x52')]);var _0x4adab8={'where':_0x39ceac[_0x1c51('0x49')]};return db['FaxMessage'][_0x1c51('0x2f')](_0x4adab8)['then'](function(_0x44398a){_0x4c7ffb[_0x1c51('0x2f')]=_0x44398a;if(_0x4821f8[_0x1c51('0x40')][_0x1c51('0x53')]){_0x39ceac['include']=[{'all':!![]}];}return db[_0x1c51('0x3c')]['findAll'](_0x39ceac);})[_0x1c51('0x21')](function(_0x24e8b3){_0x4c7ffb[_0x1c51('0x54')]=_0x24e8b3;return _0x4c7ffb;})['then'](respondWithFilteredResult(_0x18bb41,_0x39ceac))['catch'](handleError(_0x18bb41,null));};exports[_0x1c51('0x55')]=function(_0x20e240,_0x529928){var _0x28fa81={'raw':!![],'where':{'id':_0x20e240['params']['id']}},_0x4f50a6={};_0x4f50a6[_0x1c51('0x3e')]=_[_0x1c51('0x3f')](db['FaxMessage'][_0x1c51('0x3d')]);_0x4f50a6[_0x1c51('0x40')]=_[_0x1c51('0x3f')](_0x20e240[_0x1c51('0x40')]);_0x4f50a6[_0x1c51('0x41')]=_['intersection'](_0x4f50a6['model'],_0x4f50a6[_0x1c51('0x40')]);_0x28fa81['attributes']=_[_0x1c51('0x42')](_0x4f50a6[_0x1c51('0x3e')],qs['fields'](_0x20e240[_0x1c51('0x40')]['fields']));_0x28fa81[_0x1c51('0x43')]=_0x28fa81['attributes'][_0x1c51('0x45')]?_0x28fa81[_0x1c51('0x43')]:_0x4f50a6[_0x1c51('0x3e')];if(_0x20e240[_0x1c51('0x40')][_0x1c51('0x53')]){_0x28fa81['include']=[{'all':!![]}];}_0x28fa81=_[_0x1c51('0x51')]({},_0x28fa81,_0x20e240[_0x1c51('0x52')]);return db[_0x1c51('0x3c')][_0x1c51('0x56')](_0x28fa81)[_0x1c51('0x21')](handleEntityNotFound(_0x529928,null))[_0x1c51('0x21')](respondWithResult(_0x529928,null))[_0x1c51('0x2a')](handleError(_0x529928,null));};exports[_0x1c51('0x37')]=function(_0x4ebbd4,_0x4b34f8){if(_0x4ebbd4[_0x1c51('0x57')]['id']){delete _0x4ebbd4[_0x1c51('0x57')]['id'];}return db[_0x1c51('0x3c')][_0x1c51('0x56')]({'where':{'id':_0x4ebbd4['params']['id']}})['then'](handleEntityNotFound(_0x4b34f8,null))[_0x1c51('0x21')](saveUpdates(_0x4ebbd4[_0x1c51('0x57')],null))[_0x1c51('0x21')](respondWithResult(_0x4b34f8,null))[_0x1c51('0x2a')](handleError(_0x4b34f8,null));};exports[_0x1c51('0x38')]=function(_0x5877a9,_0x5dc3d9){return db['FaxMessage']['find']({'where':{'id':_0x5877a9[_0x1c51('0x58')]['id']}})[_0x1c51('0x21')](handleEntityNotFound(_0x5dc3d9,null))['then'](removeEntity(_0x5dc3d9,null))['catch'](handleError(_0x5dc3d9,null));};exports[_0x1c51('0x59')]=function(_0x44b5e0,_0x1ffba5){return db['FaxMessage'][_0x1c51('0x59')]()[_0x1c51('0x21')](respondWithResult(_0x1ffba5,null))[_0x1c51('0x2a')](handleError(_0x1ffba5,null));};var interaction_log=require(_0x1c51('0x14'))(_0x1c51('0x5a'));exports[_0x1c51('0x5b')]=function(_0x529197,_0x156d0d,_0x37f8c9){var _0x528a41={'channel':_0x1c51('0x5c')};if(_0x529197['body']['id']){delete _0x529197[_0x1c51('0x57')]['id'];}_0x529197['body'][_0x1c51('0x5d')]=!![];_0x529197[_0x1c51('0x57')][_0x1c51('0x5e')]=moment()[_0x1c51('0x5f')](_0x1c51('0x60'));_0x529197['body'][_0x1c51('0x61')]=_0x529197[_0x1c51('0x57')]['UserId']||_0x529197[_0x1c51('0x62')]['id'];return db[_0x1c51('0x3c')]['find']({'where':{'id':_0x529197[_0x1c51('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x1c51('0x63')],'as':_0x1c51('0x64')}]})[_0x1c51('0x21')](handleEntityNotFound(_0x156d0d,null))[_0x1c51('0x21')](saveUpdates(_0x529197[_0x1c51('0x57')],null))[_0x1c51('0x21')](function(_0x6bfb17){if(_0x6bfb17){_0x528a41[_0x1c51('0x28')]=_0x6bfb17[_0x1c51('0x65')]({'plain':!![]});return db[_0x1c51('0x66')][_0x1c51('0x56')]({'where':{'id':_0x6bfb17[_0x1c51('0x67')]}});}return null;})[_0x1c51('0x21')](handleEntityNotFound(_0x156d0d,null))[_0x1c51('0x21')](function(_0x3fd78c){if(_0x3fd78c){return _0x3fd78c[_0x1c51('0x37')]({'UserId':_0x529197[_0x1c51('0x57')]['UserId'],'read1stAt':_[_0x1c51('0x68')](_0x3fd78c[_0x1c51('0x69')])?moment()[_0x1c51('0x5f')](_0x1c51('0x60')):undefined});}return null;})[_0x1c51('0x21')](function(_0x21d5b4){if(_0x21d5b4){_0x528a41[_0x1c51('0x6a')]=_0x21d5b4['get']({'plain':!![]});interaction_log[_0x1c51('0x22')](_0x1c51('0x6b'),_0x529197[_0x1c51('0x62')]['id'],_0x529197[_0x1c51('0x62')]['name'],_0x529197[_0x1c51('0x62')][_0x1c51('0x6c')],_0x528a41[_0x1c51('0x6a')]['id'],_0x529197[_0x1c51('0x57')]?JSON[_0x1c51('0x25')](_0x529197[_0x1c51('0x57')]):'null');return respondWithRpcPromise(_0x1c51('0x6d'),'acceptMessage',_0x528a41);}return null;})[_0x1c51('0x21')](function(_0x559db4){if(_0x559db4){if(_0x529197[_0x1c51('0x57')]['manual']){_0x528a41[_0x1c51('0x28')]['interface']=util[_0x1c51('0x5f')](_0x1c51('0x6e'),_0x529197[_0x1c51('0x62')][_0x1c51('0x39')]);_0x528a41['message'][_0x1c51('0x6f')]=_0x528a41[_0x1c51('0x6f')];_0x528a41['message'][_0x1c51('0x70')]=_0x1c51('0x5b');return respondWithRpcPromise('EventManager',_0x1c51('0x71'),{'event':_0x1c51('0x72'),'message':_0x528a41[_0x1c51('0x28')]},client9002)[_0x1c51('0x21')](function(){return _0x528a41;});}return _0x528a41;}return null;})[_0x1c51('0x21')](respondWithResult(_0x156d0d,null))[_0x1c51('0x2a')](handleError(_0x156d0d,null));};var interaction_log=require(_0x1c51('0x14'))(_0x1c51('0x5a'));exports[_0x1c51('0x35')]=function(_0x5b351c,_0x1b81f6,_0x3cab16){var _0x3f26ae={'agent':{},'channel':_0x1c51('0x5c')};if(_0x5b351c[_0x1c51('0x57')]['id']){delete _0x5b351c[_0x1c51('0x57')]['id'];}_0x5b351c[_0x1c51('0x57')][_0x1c51('0x61')]=_0x5b351c[_0x1c51('0x57')][_0x1c51('0x61')]||_0x5b351c[_0x1c51('0x62')]['id'];_0x3f26ae[_0x1c51('0x73')]['id']=_0x5b351c[_0x1c51('0x57')][_0x1c51('0x61')];return db[_0x1c51('0x3c')][_0x1c51('0x56')]({'where':{'id':_0x5b351c[_0x1c51('0x58')]['id'],'UserId':null}})[_0x1c51('0x21')](handleEntityNotFound(_0x1b81f6,null))[_0x1c51('0x21')](function(_0x322c39){if(_0x322c39){_0x3f26ae[_0x1c51('0x28')]=_0x322c39[_0x1c51('0x65')]({'plain':!![]});return db[_0x1c51('0x66')][_0x1c51('0x56')]({'where':{'id':_0x322c39[_0x1c51('0x67')]}});}return null;})[_0x1c51('0x21')](handleEntityNotFound(_0x1b81f6,null))['then'](function(_0x3921a3){if(_0x3921a3){_0x3f26ae[_0x1c51('0x6a')]=_0x3921a3['get']({'plain':!![]});interaction_log['info'](_0x1c51('0x74'),_0x5b351c[_0x1c51('0x62')]['id'],_0x5b351c[_0x1c51('0x62')][_0x1c51('0x39')],_0x5b351c[_0x1c51('0x62')][_0x1c51('0x6c')],_0x3f26ae[_0x1c51('0x6a')]['id'],_0x5b351c[_0x1c51('0x57')]?JSON[_0x1c51('0x25')](_0x5b351c[_0x1c51('0x57')]):_0x1c51('0x75'));return respondWithRpcPromise(_0x1c51('0x76'),_0x1c51('0x77'),_0x3f26ae);}return null;})[_0x1c51('0x21')](function(_0x12fbc7){if(_0x12fbc7){_0x12fbc7[_0x1c51('0x28')][_0x1c51('0x78')]=util['format']('SIP/%s',_0x5b351c[_0x1c51('0x62')]['name']);_0x12fbc7[_0x1c51('0x28')][_0x1c51('0x6f')]=_0x3f26ae['channel'];_0x12fbc7[_0x1c51('0x28')][_0x1c51('0x70')]=_0x1c51('0x35');respondWithRpcPromise(_0x1c51('0x71'),_0x1c51('0x71'),{'event':_0x1c51('0x79'),'message':_0x12fbc7['message']},client9002);return _0x3f26ae;}return null;})['then'](respondWithResult(_0x1b81f6,null))['catch'](handleError(_0x1b81f6,null));};exports['create']=function(_0x2dccfe,_0xa86c83){var _0x4180bb;return db['FaxMessage'][_0x1c51('0x7a')](_0x2dccfe[_0x1c51('0x57')],{})[_0x1c51('0x21')](function(_0x259265){_0x4180bb=_0x259265;return db['CmContact'][_0x1c51('0x7b')]({'where':{'id':_0x4180bb[_0x1c51('0x7c')]}});})['then'](function(_0x42b414){if(_['isNil'](_0x42b414)){return;}else{_0x4180bb['fax']=_0x42b414[_0x1c51('0x5c')];return db['Attachment'][_0x1c51('0x7b')]({'where':{'id':_0x4180bb['AttachmentId']}});}})['then'](function(_0x429882){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x1c51('0x68')](_0x2dccfe[_0x1c51('0x57')])?undefined:_0x2dccfe[_0x1c51('0x57')][_0x1c51('0x7d')],'path':_[_0x1c51('0x68')](_0x429882)?undefined:util[_0x1c51('0x5f')](_0x1c51('0x7e'),_0x429882[_0x1c51('0x7f')]),'fax':_[_0x1c51('0x68')](_0x4180bb[_0x1c51('0x5c')])?undefined:_0x4180bb[_0x1c51('0x5c')],'AttachmentId':_0x4180bb[_0x1c51('0x80')]},client9002);})[_0x1c51('0x21')](respondWithResult(_0xa86c83,0xc9))[_0x1c51('0x2a')](handleError(_0xa86c83,null));};exports[_0x1c51('0x81')]=function(_0x25880d,_0x4bbb19){var _0x5579db=path[_0x1c51('0x82')](config['root'],_0x1c51('0x83'),'files',_0x1c51('0x84'));return db[_0x1c51('0x3c')]['find']({'where':{'id':_0x25880d[_0x1c51('0x58')]['id']},'include':[{'model':db[_0x1c51('0x85')],'as':_0x1c51('0x85')}]})[_0x1c51('0x21')](handleEntityNotFound(_0x4bbb19,null))[_0x1c51('0x21')](function(_0x1aed2b){if(_0x1aed2b){return _0x4bbb19[_0x1c51('0x81')](path[_0x1c51('0x82')](_0x5579db,_0x1aed2b[_0x1c51('0x85')]['basename']));}})[_0x1c51('0x2a')](handleError(_0x4bbb19,null));};
\ No newline at end of file
+var _0x9fcb=['where','merge','map','type','VIRTUAL','field','options','includeAll','rows','catch','show','include','find','body','params','describe','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','format','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','interface','SIP/%s','rejectmessage','create','CmContact','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','basename','download','join','root','server','attachments','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','count','offset','limit','apply','reject','update','then','destroy','stack','name','send','FaxMessage','keys','filters','model','query','intersection','fields','length','attributes','hasOwnProperty','order','sort','pick'];(function(_0x48322a,_0x2efd60){var _0x40ba4f=function(_0x24f2da){while(--_0x24f2da){_0x48322a['push'](_0x48322a['shift']());}};_0x40ba4f(++_0x2efd60);}(_0x9fcb,0xba));var _0xb9fc=function(_0x1d4de7,_0x860867){_0x1d4de7=_0x1d4de7-0x0;var _0xc9ff37=_0x9fcb[_0x1d4de7];return _0xc9ff37;};'use strict';var pdf=require(_0xb9fc('0x0'));var emlformat=require(_0xb9fc('0x1'));var rimraf=require(_0xb9fc('0x2'));var zipdir=require(_0xb9fc('0x3'));var jsonpatch=require(_0xb9fc('0x4'));var rp=require(_0xb9fc('0x5'));var moment=require(_0xb9fc('0x6'));var BPromise=require(_0xb9fc('0x7'));var Mustache=require(_0xb9fc('0x8'));var util=require('util');var path=require(_0xb9fc('0x9'));var sox=require(_0xb9fc('0xa'));var csv=require(_0xb9fc('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb9fc('0xc'));var squel=require('squel');var crypto=require(_0xb9fc('0xd'));var jsforce=require(_0xb9fc('0xe'));var deskjs=require(_0xb9fc('0xf'));var toCsv=require(_0xb9fc('0xb'));var querystring=require(_0xb9fc('0x10'));var Papa=require(_0xb9fc('0x11'));var Redis=require('ioredis');var authService=require(_0xb9fc('0x12'));var qs=require(_0xb9fc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9fc('0x14'))('api');var utils=require(_0xb9fc('0x15'));var config=require(_0xb9fc('0x16'));var db=require('../../mysqldb')['db'];config[_0xb9fc('0x17')]=_[_0xb9fc('0x18')](config['redis'],{'host':_0xb9fc('0x19'),'port':0x18eb});var socket=require(_0xb9fc('0x1a'))(new Redis(config[_0xb9fc('0x17')]));require(_0xb9fc('0x1b'))['register'](socket);var jayson=require(_0xb9fc('0x1c'));var client=jayson[_0xb9fc('0x1d')][_0xb9fc('0x1e')]({'port':0x232c});var client9002=jayson[_0xb9fc('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x1768d7,_0x6d9232,_0xf078ac){if(_0xf078ac){var _0x53e79c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53e79c[_0xb9fc('0x1f')](_0x6d9232)){return _0x1768d7;}else{throw new Error(_0xb9fc('0x20'));}}else{return _0x1768d7;}}function respondWithRpcPromise(_0x46d078,_0x19b113,_0x4f7701,_0x4b9098){return new BPromise(function(_0x28114d,_0x13f81b){var _0x326042=_0x4b9098||client;return _0x326042[_0xb9fc('0x21')](_0x46d078,_0x4f7701)['then'](function(_0x5ed4f6){logger[_0xb9fc('0x22')](_0xb9fc('0x23'),_0x19b113,_0xb9fc('0x24'));logger[_0xb9fc('0x25')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x19b113,_0xb9fc('0x24'),JSON[_0xb9fc('0x26')](_0x5ed4f6));if(_0x5ed4f6['error']){if(_0x5ed4f6[_0xb9fc('0x27')][_0xb9fc('0x28')]===0x1f4){logger[_0xb9fc('0x27')](_0xb9fc('0x23'),_0x19b113,_0x5ed4f6['error']['message']);return _0x13f81b(_0x5ed4f6[_0xb9fc('0x27')][_0xb9fc('0x29')]);}logger[_0xb9fc('0x27')](_0xb9fc('0x23'),_0x19b113,_0x5ed4f6[_0xb9fc('0x27')][_0xb9fc('0x29')]);return _0x28114d(_0x5ed4f6[_0xb9fc('0x27')]['message']);}else{logger['info'](_0xb9fc('0x23'),_0x19b113,_0xb9fc('0x24'));_0x28114d(_0x5ed4f6[_0xb9fc('0x2a')][_0xb9fc('0x29')]);}})['catch'](function(_0x39ecd8){logger[_0xb9fc('0x27')]('FaxMessage,\x20%s,\x20%s',_0x19b113,_0x39ecd8);_0x13f81b(_0x39ecd8);});});}function respondWithStatusCode(_0x1eb78c,_0x347c51){_0x347c51=_0x347c51||0xcc;return function(_0x365b01){if(_0x365b01){return _0x1eb78c[_0xb9fc('0x2b')](_0x347c51);}return _0x1eb78c[_0xb9fc('0x2c')](_0x347c51)[_0xb9fc('0x2d')]();};}function respondWithResult(_0x1acdc6,_0x316b9c){_0x316b9c=_0x316b9c||0xc8;return function(_0x5de3b1){if(_0x5de3b1){return _0x1acdc6[_0xb9fc('0x2c')](_0x316b9c)['json'](_0x5de3b1);}};}function respondWithFilteredResult(_0x205c42,_0x1ea1a7){return function(_0x4a20f6){if(_0x4a20f6){var _0x508f7b=_0x4a20f6[_0xb9fc('0x2e')],_0x2fd595=_0x1ea1a7[_0xb9fc('0x2f')],_0x5b3ce3=_0x1ea1a7['offset']+_0x1ea1a7[_0xb9fc('0x30')],_0x2c8898;if(_0x5b3ce3>=_0x508f7b){_0x5b3ce3=_0x508f7b;_0x2c8898=0xc8;}else{_0x2c8898=0xce;}_0x205c42[_0xb9fc('0x2c')](_0x2c8898);return _0x205c42['set']('Content-Range',_0x2fd595+'-'+_0x5b3ce3+'/'+_0x508f7b)['json'](_0x4a20f6);}return null;};}function patchUpdates(_0x2515dc){return function(_0x1cf3ab){try{jsonpatch[_0xb9fc('0x31')](_0x1cf3ab,_0x2515dc,!![]);}catch(_0x302f9d){return BPromise[_0xb9fc('0x32')](_0x302f9d);}return _0x1cf3ab['save']();};}function saveUpdates(_0x42b0a7,_0x52cc6d){return function(_0x3d746e){if(_0x3d746e){return _0x3d746e[_0xb9fc('0x33')](_0x42b0a7)[_0xb9fc('0x34')](function(_0x4f8c05){return _0x4f8c05;});}return null;};}function removeEntity(_0x234606,_0x34b1d5){return function(_0x494ed6){if(_0x494ed6){return _0x494ed6[_0xb9fc('0x35')]()[_0xb9fc('0x34')](function(){_0x234606[_0xb9fc('0x2c')](0xcc)[_0xb9fc('0x2d')]();});}};}function handleEntityNotFound(_0x4d6b29,_0x4fda46){return function(_0x16e53f){if(!_0x16e53f){_0x4d6b29[_0xb9fc('0x2b')](0x194);}return _0x16e53f;};}function handleError(_0x451b0c,_0x512201){_0x512201=_0x512201||0x1f4;return function(_0x21fb11){logger['error'](_0x21fb11[_0xb9fc('0x36')]);if(_0x21fb11[_0xb9fc('0x37')]){delete _0x21fb11[_0xb9fc('0x37')];}_0x451b0c[_0xb9fc('0x2c')](_0x512201)[_0xb9fc('0x38')](_0x21fb11);};}exports['index']=function(_0x11ac19,_0x356b00){var _0x4601f2={},_0x7fc995={},_0x270811={'count':0x0,'rows':[]};var _0x424fa5=db[_0xb9fc('0x39')]['rawAttributes'];_0x7fc995['model']=_[_0xb9fc('0x3a')](_0x424fa5);_0x7fc995['query']=_[_0xb9fc('0x3a')](_0x11ac19['query']);_0x7fc995[_0xb9fc('0x3b')]=_['intersection'](_0x7fc995[_0xb9fc('0x3c')],_0x7fc995[_0xb9fc('0x3d')]);_0x4601f2['attributes']=_[_0xb9fc('0x3e')](_0x7fc995[_0xb9fc('0x3c')],qs[_0xb9fc('0x3f')](_0x11ac19[_0xb9fc('0x3d')][_0xb9fc('0x3f')]));_0x4601f2['attributes']=_0x4601f2['attributes'][_0xb9fc('0x40')]?_0x4601f2[_0xb9fc('0x41')]:_0x7fc995[_0xb9fc('0x3c')];if(!_0x11ac19[_0xb9fc('0x3d')][_0xb9fc('0x42')]('nolimit')){_0x4601f2[_0xb9fc('0x30')]=qs[_0xb9fc('0x30')](_0x11ac19[_0xb9fc('0x3d')][_0xb9fc('0x30')]);_0x4601f2['offset']=qs[_0xb9fc('0x2f')](_0x11ac19[_0xb9fc('0x3d')]['offset']);}_0x4601f2[_0xb9fc('0x43')]=qs['sort'](_0x11ac19[_0xb9fc('0x3d')][_0xb9fc('0x44')]);_0x4601f2['where']=qs[_0xb9fc('0x3b')](_[_0xb9fc('0x45')](_0x11ac19[_0xb9fc('0x3d')],_0x7fc995[_0xb9fc('0x3b')]));if(_0x11ac19[_0xb9fc('0x3d')]['filter']){_0x4601f2[_0xb9fc('0x46')]=_[_0xb9fc('0x47')](_0x4601f2[_0xb9fc('0x46')],{'$or':_[_0xb9fc('0x48')](_0x424fa5,function(_0x6a02ae){if(_0x6a02ae[_0xb9fc('0x49')]['key']!==_0xb9fc('0x4a')){var _0x3bbf81={};_0x3bbf81[_0x6a02ae[_0xb9fc('0x4b')]]={'$like':'%'+_0x11ac19[_0xb9fc('0x3d')]['filter']+'%'};return _0x3bbf81;}})});}_0x4601f2=_[_0xb9fc('0x47')]({},_0x4601f2,_0x11ac19[_0xb9fc('0x4c')]);var _0xd9e1c9={'where':_0x4601f2[_0xb9fc('0x46')]};return db[_0xb9fc('0x39')][_0xb9fc('0x2e')](_0xd9e1c9)[_0xb9fc('0x34')](function(_0x239a97){_0x270811[_0xb9fc('0x2e')]=_0x239a97;if(_0x11ac19[_0xb9fc('0x3d')][_0xb9fc('0x4d')]){_0x4601f2['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x4601f2);})['then'](function(_0x4675b2){_0x270811[_0xb9fc('0x4e')]=_0x4675b2;return _0x270811;})['then'](respondWithFilteredResult(_0x356b00,_0x4601f2))[_0xb9fc('0x4f')](handleError(_0x356b00,null));};exports[_0xb9fc('0x50')]=function(_0x1c7c41,_0x157d9c){var _0x56beaf={'raw':!![],'where':{'id':_0x1c7c41['params']['id']}},_0x38a508={};_0x38a508[_0xb9fc('0x3c')]=_[_0xb9fc('0x3a')](db[_0xb9fc('0x39')]['rawAttributes']);_0x38a508[_0xb9fc('0x3d')]=_[_0xb9fc('0x3a')](_0x1c7c41[_0xb9fc('0x3d')]);_0x38a508[_0xb9fc('0x3b')]=_[_0xb9fc('0x3e')](_0x38a508[_0xb9fc('0x3c')],_0x38a508[_0xb9fc('0x3d')]);_0x56beaf[_0xb9fc('0x41')]=_[_0xb9fc('0x3e')](_0x38a508[_0xb9fc('0x3c')],qs['fields'](_0x1c7c41[_0xb9fc('0x3d')][_0xb9fc('0x3f')]));_0x56beaf['attributes']=_0x56beaf['attributes'][_0xb9fc('0x40')]?_0x56beaf[_0xb9fc('0x41')]:_0x38a508[_0xb9fc('0x3c')];if(_0x1c7c41['query'][_0xb9fc('0x4d')]){_0x56beaf[_0xb9fc('0x51')]=[{'all':!![]}];}_0x56beaf=_[_0xb9fc('0x47')]({},_0x56beaf,_0x1c7c41[_0xb9fc('0x4c')]);return db[_0xb9fc('0x39')][_0xb9fc('0x52')](_0x56beaf)[_0xb9fc('0x34')](handleEntityNotFound(_0x157d9c,null))[_0xb9fc('0x34')](respondWithResult(_0x157d9c,null))[_0xb9fc('0x4f')](handleError(_0x157d9c,null));};exports[_0xb9fc('0x33')]=function(_0x2a9ff2,_0x4a2f00){if(_0x2a9ff2[_0xb9fc('0x53')]['id']){delete _0x2a9ff2[_0xb9fc('0x53')]['id'];}return db[_0xb9fc('0x39')][_0xb9fc('0x52')]({'where':{'id':_0x2a9ff2['params']['id']}})['then'](handleEntityNotFound(_0x4a2f00,null))[_0xb9fc('0x34')](saveUpdates(_0x2a9ff2[_0xb9fc('0x53')],null))[_0xb9fc('0x34')](respondWithResult(_0x4a2f00,null))['catch'](handleError(_0x4a2f00,null));};exports[_0xb9fc('0x35')]=function(_0x40768f,_0x5be15e){return db[_0xb9fc('0x39')][_0xb9fc('0x52')]({'where':{'id':_0x40768f[_0xb9fc('0x54')]['id']}})['then'](handleEntityNotFound(_0x5be15e,null))['then'](removeEntity(_0x5be15e,null))[_0xb9fc('0x4f')](handleError(_0x5be15e,null));};exports[_0xb9fc('0x55')]=function(_0x19335d,_0x3c68b6){return db[_0xb9fc('0x39')]['describe']()[_0xb9fc('0x34')](respondWithResult(_0x3c68b6,null))['catch'](handleError(_0x3c68b6,null));};var interaction_log=require(_0xb9fc('0x14'))(_0xb9fc('0x56'));exports[_0xb9fc('0x57')]=function(_0x40a885,_0x3ca065,_0x6d90b1){var _0x4abe30={'channel':_0xb9fc('0x58')};if(_0x40a885[_0xb9fc('0x53')]['id']){delete _0x40a885[_0xb9fc('0x53')]['id'];}_0x40a885['body'][_0xb9fc('0x59')]=!![];_0x40a885[_0xb9fc('0x53')][_0xb9fc('0x5a')]=moment()['format'](_0xb9fc('0x5b'));_0x40a885[_0xb9fc('0x53')][_0xb9fc('0x5c')]=_0x40a885[_0xb9fc('0x53')][_0xb9fc('0x5c')]||_0x40a885[_0xb9fc('0x5d')]['id'];return db[_0xb9fc('0x39')][_0xb9fc('0x52')]({'where':{'id':_0x40a885[_0xb9fc('0x54')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xb9fc('0x5e')}]})['then'](handleEntityNotFound(_0x3ca065,null))[_0xb9fc('0x34')](saveUpdates(_0x40a885[_0xb9fc('0x53')],null))[_0xb9fc('0x34')](function(_0x350bca){if(_0x350bca){_0x4abe30[_0xb9fc('0x29')]=_0x350bca['get']({'plain':!![]});return db[_0xb9fc('0x5f')][_0xb9fc('0x52')]({'where':{'id':_0x350bca[_0xb9fc('0x60')]}});}return null;})[_0xb9fc('0x34')](handleEntityNotFound(_0x3ca065,null))[_0xb9fc('0x34')](function(_0x99c283){if(_0x99c283){return _0x99c283[_0xb9fc('0x33')]({'UserId':_0x40a885[_0xb9fc('0x53')][_0xb9fc('0x5c')],'read1stAt':_[_0xb9fc('0x61')](_0x99c283[_0xb9fc('0x62')])?moment()['format'](_0xb9fc('0x5b')):undefined});}return null;})['then'](function(_0x3b75c1){if(_0x3b75c1){_0x4abe30[_0xb9fc('0x63')]=_0x3b75c1[_0xb9fc('0x64')]({'plain':!![]});interaction_log[_0xb9fc('0x22')](_0xb9fc('0x65'),_0x40a885[_0xb9fc('0x5d')]['id'],_0x40a885[_0xb9fc('0x5d')][_0xb9fc('0x37')],_0x40a885[_0xb9fc('0x5d')]['role'],_0x4abe30[_0xb9fc('0x63')]['id'],_0x40a885['body']?JSON['stringify'](_0x40a885['body']):_0xb9fc('0x66'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x4abe30);}return null;})[_0xb9fc('0x34')](function(_0x213aa9){if(_0x213aa9){if(_0x40a885[_0xb9fc('0x53')]['manual']){_0x4abe30[_0xb9fc('0x29')]['interface']=util[_0xb9fc('0x67')]('SIP/%s',_0x40a885[_0xb9fc('0x5d')]['name']);_0x4abe30['message'][_0xb9fc('0x68')]=_0x4abe30[_0xb9fc('0x68')];_0x4abe30[_0xb9fc('0x29')][_0xb9fc('0x69')]=_0xb9fc('0x57');return respondWithRpcPromise('EventManager',_0xb9fc('0x6a'),{'event':_0xb9fc('0x6b'),'message':_0x4abe30[_0xb9fc('0x29')]},client9002)['then'](function(){return _0x4abe30;});}return _0x4abe30;}return null;})[_0xb9fc('0x34')](respondWithResult(_0x3ca065,null))[_0xb9fc('0x4f')](handleError(_0x3ca065,null));};var interaction_log=require(_0xb9fc('0x14'))(_0xb9fc('0x56'));exports[_0xb9fc('0x32')]=function(_0x4e79a9,_0x86edca,_0x1f41d0){var _0x48bb38={'agent':{},'channel':_0xb9fc('0x58')};if(_0x4e79a9[_0xb9fc('0x53')]['id']){delete _0x4e79a9[_0xb9fc('0x53')]['id'];}_0x4e79a9[_0xb9fc('0x53')][_0xb9fc('0x5c')]=_0x4e79a9[_0xb9fc('0x53')][_0xb9fc('0x5c')]||_0x4e79a9[_0xb9fc('0x5d')]['id'];_0x48bb38['agent']['id']=_0x4e79a9[_0xb9fc('0x53')]['UserId'];return db[_0xb9fc('0x39')][_0xb9fc('0x52')]({'where':{'id':_0x4e79a9[_0xb9fc('0x54')]['id'],'UserId':null}})[_0xb9fc('0x34')](handleEntityNotFound(_0x86edca,null))['then'](function(_0xa6a683){if(_0xa6a683){_0x48bb38['message']=_0xa6a683[_0xb9fc('0x64')]({'plain':!![]});return db[_0xb9fc('0x5f')]['find']({'where':{'id':_0xa6a683[_0xb9fc('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x86edca,null))[_0xb9fc('0x34')](function(_0x12089c){if(_0x12089c){_0x48bb38[_0xb9fc('0x63')]=_0x12089c['get']({'plain':!![]});interaction_log[_0xb9fc('0x22')](_0xb9fc('0x6c'),_0x4e79a9[_0xb9fc('0x5d')]['id'],_0x4e79a9['user']['name'],_0x4e79a9[_0xb9fc('0x5d')][_0xb9fc('0x6d')],_0x48bb38['interaction']['id'],_0x4e79a9[_0xb9fc('0x53')]?JSON[_0xb9fc('0x26')](_0x4e79a9['body']):'null');return respondWithRpcPromise('RejectMessage',_0xb9fc('0x6e'),_0x48bb38);}return null;})[_0xb9fc('0x34')](function(_0x5f3e83){if(_0x5f3e83){_0x5f3e83[_0xb9fc('0x29')][_0xb9fc('0x6f')]=util[_0xb9fc('0x67')](_0xb9fc('0x70'),_0x4e79a9[_0xb9fc('0x5d')][_0xb9fc('0x37')]);_0x5f3e83[_0xb9fc('0x29')][_0xb9fc('0x68')]=_0x48bb38['channel'];_0x5f3e83['message'][_0xb9fc('0x69')]='reject';respondWithRpcPromise(_0xb9fc('0x6a'),_0xb9fc('0x6a'),{'event':_0xb9fc('0x71'),'message':_0x5f3e83[_0xb9fc('0x29')]},client9002);return _0x48bb38;}return null;})[_0xb9fc('0x34')](respondWithResult(_0x86edca,null))[_0xb9fc('0x4f')](handleError(_0x86edca,null));};exports[_0xb9fc('0x72')]=function(_0x579190,_0x1c746f){var _0x4f4396;return db[_0xb9fc('0x39')][_0xb9fc('0x72')](_0x579190[_0xb9fc('0x53')],{})[_0xb9fc('0x34')](function(_0x2c6898){_0x4f4396=_0x2c6898;return db[_0xb9fc('0x73')][_0xb9fc('0x74')]({'where':{'id':_0x4f4396[_0xb9fc('0x75')]}});})[_0xb9fc('0x34')](function(_0x215600){if(_['isNil'](_0x215600)){return;}else{_0x4f4396[_0xb9fc('0x58')]=_0x215600['fax'];return db[_0xb9fc('0x76')]['findOne']({'where':{'id':_0x4f4396[_0xb9fc('0x77')]}});}})[_0xb9fc('0x34')](function(_0x3abf5a){return respondWithRpcPromise('SendFax',_0xb9fc('0x78'),{'FaxAccountId':_[_0xb9fc('0x61')](_0x579190[_0xb9fc('0x53')])?undefined:_0x579190[_0xb9fc('0x53')][_0xb9fc('0x79')],'path':_[_0xb9fc('0x61')](_0x3abf5a)?undefined:util[_0xb9fc('0x67')]('/var/opt/motion2/server/files/attachments/%s',_0x3abf5a[_0xb9fc('0x7a')]),'fax':_['isNil'](_0x4f4396[_0xb9fc('0x58')])?undefined:_0x4f4396[_0xb9fc('0x58')],'AttachmentId':_0x4f4396[_0xb9fc('0x77')]},client9002);})[_0xb9fc('0x34')](respondWithResult(_0x1c746f,0xc9))[_0xb9fc('0x4f')](handleError(_0x1c746f,null));};exports[_0xb9fc('0x7b')]=function(_0x3cac6c,_0x36a3a7){var _0x27f91b=path[_0xb9fc('0x7c')](config[_0xb9fc('0x7d')],_0xb9fc('0x7e'),'files',_0xb9fc('0x7f'));return db[_0xb9fc('0x39')][_0xb9fc('0x52')]({'where':{'id':_0x3cac6c[_0xb9fc('0x54')]['id']},'include':[{'model':db[_0xb9fc('0x76')],'as':_0xb9fc('0x76')}]})['then'](handleEntityNotFound(_0x36a3a7,null))[_0xb9fc('0x34')](function(_0x5a487b){if(_0x5a487b){return _0x36a3a7[_0xb9fc('0x7b')](path['join'](_0x27f91b,_0x5a487b[_0xb9fc('0x76')][_0xb9fc('0x7a')]));}})[_0xb9fc('0x4f')](handleError(_0x36a3a7,null));};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js
index a581a6f..ce43145 100644
--- a/server/api/faxMessage/faxMessage.events.js
+++ b/server/api/faxMessage/faxMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd7c5=['../../mysqldb','FaxMessage','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xd7c5,0x8f));var _0x5d7c=function(_0xa81c45,_0x1a4550){_0xa81c45=_0xa81c45-0x0;var _0x3d3c9e=_0xd7c5[_0xa81c45];return _0x3d3c9e;};'use strict';var EventEmitter=require(_0x5d7c('0x0'));var FaxMessage=require(_0x5d7c('0x1'))['db'][_0x5d7c('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5d7c('0x3'),'afterUpdate':'update','afterDestroy':_0x5d7c('0x4')};function emitEvent(_0x1cf5dc){return function(_0x17afee,_0xe5d176,_0x1da620){FaxMessageEvents[_0x5d7c('0x5')](_0x1cf5dc+':'+_0x17afee['id'],_0x17afee);FaxMessageEvents['emit'](_0x1cf5dc,_0x17afee);_0x1da620(null);};}for(var e in events){if(events[_0x5d7c('0x6')](e)){var event=events[e];FaxMessage[_0x5d7c('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
+var _0x89b0=['setMaxListeners','save','update','remove','emit','hook','events','FaxMessage'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x89b0,0x1ee));var _0x089b=function(_0x30cea6,_0xcf0bb0){_0x30cea6=_0x30cea6-0x0;var _0x235994=_0x89b0[_0x30cea6];return _0x235994;};'use strict';var EventEmitter=require(_0x089b('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x089b('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x089b('0x2')](0x0);var events={'afterCreate':_0x089b('0x3'),'afterUpdate':_0x089b('0x4'),'afterDestroy':_0x089b('0x5')};function emitEvent(_0x1bab05){return function(_0x55ecfd,_0x40bb16,_0x4e5f7c){FaxMessageEvents[_0x089b('0x6')](_0x1bab05+':'+_0x55ecfd['id'],_0x55ecfd);FaxMessageEvents[_0x089b('0x6')](_0x1bab05,_0x55ecfd);_0x4e5f7c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x089b('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js
index e6d3323..58169a6 100644
--- a/server/api/faxMessage/faxMessage.model.js
+++ b/server/api/faxMessage/faxMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6509=['define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxMessage.attributes','exports'];(function(_0x44e923,_0x7ee877){var _0x10ddb4=function(_0x9f2a50){while(--_0x9f2a50){_0x44e923['push'](_0x44e923['shift']());}};_0x10ddb4(++_0x7ee877);}(_0x6509,0x16a));var _0x9650=function(_0x3b1106,_0x4bd523){_0x3b1106=_0x3b1106-0x0;var _0x1fbeef=_0x6509[_0x3b1106];return _0x1fbeef;};'use strict';var _=require(_0x9650('0x0'));var util=require(_0x9650('0x1'));var logger=require(_0x9650('0x2'))(_0x9650('0x3'));var moment=require(_0x9650('0x4'));var BPromise=require('bluebird');var rp=require(_0x9650('0x5'));var fs=require('fs');var path=require(_0x9650('0x6'));var rimraf=require('rimraf');var config=require(_0x9650('0x7'));var attributes=require(_0x9650('0x8'));module[_0x9650('0x9')]=function(_0x171c89,_0x3b053d){return _0x171c89[_0x9650('0xa')](_0x9650('0xb'),attributes,{'tableName':_0x9650('0xc'),'paranoid':![],'indexes':[{'name':_0x9650('0xd'),'fields':[_0x9650('0xe')],'type':_0x9650('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d0a38,_0x2337be,_0x3f5904){var _0x34f82a=_0x171c89[_0x9650('0x10')];var _0x1b5608=_0x5d0a38[_0x9650('0x11')]({'plain':!![]});if(_0x1b5608[_0x9650('0x12')][_0x9650('0x13')]()==='in'||_0x1b5608[_0x9650('0x12')]['toLowerCase']()===_0x9650('0x14')&&!_0x1b5608[_0x9650('0x15')]&&!_[_0x9650('0x16')](_0x1b5608[_0x9650('0x17')])){_0x34f82a['FaxInteraction'][_0x9650('0x18')]({'where':{'id':_0x1b5608[_0x9650('0x19')]}})['then'](function(_0x56031f){if(_0x56031f){_0x56031f[_0x9650('0x1a')]({'lastMsgAt':_0x1b5608['createdAt'],'lastMsgDirection':_0x1b5608['direction']['toLowerCase']()});}})[_0x9650('0x1b')](function(_0xc6e49c){console[_0x9650('0x1c')](_0xc6e49c);});}_0x3f5904();}},'charset':_0x9650('0x1d'),'collate':_0x9650('0x1e')});};
\ No newline at end of file
+var _0xb98d=['FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId'];(function(_0x301df5,_0x5a9692){var _0x54c3cd=function(_0x1a400c){while(--_0x1a400c){_0x301df5['push'](_0x301df5['shift']());}};_0x54c3cd(++_0x5a9692);}(_0xb98d,0x171));var _0xdb98=function(_0x209651,_0x5d3b72){_0x209651=_0x209651-0x0;var _0x9ed604=_0xb98d[_0x209651];return _0x9ed604;};'use strict';var _=require(_0xdb98('0x0'));var util=require(_0xdb98('0x1'));var logger=require(_0xdb98('0x2'))(_0xdb98('0x3'));var moment=require(_0xdb98('0x4'));var BPromise=require(_0xdb98('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb98('0x6'));var rimraf=require('rimraf');var config=require(_0xdb98('0x7'));var attributes=require(_0xdb98('0x8'));module[_0xdb98('0x9')]=function(_0x4b3709,_0x2cc94a){return _0x4b3709['define'](_0xdb98('0xa'),attributes,{'tableName':_0xdb98('0xb'),'paranoid':![],'indexes':[{'name':_0xdb98('0xc'),'fields':[_0xdb98('0xd')],'type':_0xdb98('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49a559,_0x2bf159,_0xd34e77){var _0x857990=_0x4b3709[_0xdb98('0xf')];var _0x5e5cf1=_0x49a559['get']({'plain':!![]});if(_0x5e5cf1[_0xdb98('0x10')][_0xdb98('0x11')]()==='in'||_0x5e5cf1['direction'][_0xdb98('0x11')]()===_0xdb98('0x12')&&!_0x5e5cf1['secret']&&!_[_0xdb98('0x13')](_0x5e5cf1[_0xdb98('0x14')])){_0x857990[_0xdb98('0x15')][_0xdb98('0x16')]({'where':{'id':_0x5e5cf1[_0xdb98('0x17')]}})[_0xdb98('0x18')](function(_0x5b1aaa){if(_0x5b1aaa){_0x5b1aaa[_0xdb98('0x19')]({'lastMsgAt':_0x5e5cf1[_0xdb98('0x1a')],'lastMsgDirection':_0x5e5cf1[_0xdb98('0x10')]['toLowerCase']()});}})[_0xdb98('0x1b')](function(_0x27d1e4){console['error'](_0x27d1e4);});}_0xd34e77();}},'charset':_0xdb98('0x1c'),'collate':_0xdb98('0x1d')});};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js
index 2423f81..b823f2e 100644
--- a/server/api/faxMessage/faxMessage.rpc.js
+++ b/server/api/faxMessage/faxMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7923=['options','raw','debug','UpdateFaxMessage','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','socket.io-emitter','register','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x7923,0x8f));var _0x3792=function(_0x8c4071,_0x3891cf){_0x8c4071=_0x8c4071-0x0;var _0x184184=_0x7923[_0x8c4071];return _0x184184;};'use strict';var _=require(_0x3792('0x0'));var util=require(_0x3792('0x1'));var moment=require(_0x3792('0x2'));var BPromise=require(_0x3792('0x3'));var rs=require(_0x3792('0x4'));var fs=require('fs');var Redis=require(_0x3792('0x5'));var db=require(_0x3792('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3792('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3792('0x8'));var client=jayson['client'][_0x3792('0x9')]({'port':0x232a});config[_0x3792('0xa')]=_[_0x3792('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3792('0xc'))(new Redis(config[_0x3792('0xa')]));require('./faxMessage.socket')[_0x3792('0xd')](socket);function respondWithRpcPromise(_0x39eafb,_0x4c1a32,_0xebb0d0){return new BPromise(function(_0x23e626,_0x216ddd){return client['request'](_0x39eafb,_0xebb0d0)['then'](function(_0x8ed062){logger[_0x3792('0xe')](_0x3792('0xf'),_0x4c1a32,_0x3792('0x10'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4c1a32,_0x3792('0x10'),JSON[_0x3792('0x11')](_0x8ed062));if(_0x8ed062[_0x3792('0x12')]){if(_0x8ed062[_0x3792('0x12')][_0x3792('0x13')]===0x1f4){logger[_0x3792('0x12')](_0x3792('0xf'),_0x4c1a32,_0x8ed062[_0x3792('0x12')][_0x3792('0x14')]);return _0x216ddd(_0x8ed062[_0x3792('0x12')][_0x3792('0x14')]);}logger[_0x3792('0x12')](_0x3792('0xf'),_0x4c1a32,_0x8ed062[_0x3792('0x12')][_0x3792('0x14')]);return _0x23e626(_0x8ed062[_0x3792('0x12')][_0x3792('0x14')]);}else{logger['info'](_0x3792('0xf'),_0x4c1a32,_0x3792('0x10'));_0x23e626(_0x8ed062[_0x3792('0x15')][_0x3792('0x14')]);}})[_0x3792('0x16')](function(_0x5a9f56){logger[_0x3792('0x12')](_0x3792('0xf'),_0x4c1a32,_0x5a9f56);_0x216ddd(_0x5a9f56);});});}exports[_0x3792('0x17')]=function(_0x3c36b5){var _0x35eee8=this;return new Promise(function(_0x5647ac,_0x4cd50b){return db[_0x3792('0x18')][_0x3792('0x19')](_0x3c36b5[_0x3792('0x1a')],{'raw':_0x3c36b5[_0x3792('0x1b')]?_0x3c36b5[_0x3792('0x1b')][_0x3792('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4ca818){logger[_0x3792('0xe')](_0x3792('0x17'),_0x3c36b5);logger[_0x3792('0x1d')](_0x3792('0x17'),_0x3c36b5,JSON['stringify'](_0x4ca818));_0x5647ac(_0x4ca818);})[_0x3792('0x16')](function(_0x48f41c){logger[_0x3792('0x12')](_0x3792('0x17'),_0x48f41c['message'],_0x3c36b5);_0x4cd50b(_0x35eee8['error'](0x1f4,_0x48f41c[_0x3792('0x14')]));});});};exports[_0x3792('0x1e')]=function(_0x401080){var _0x516929=this;return new Promise(function(_0x54f42a,_0x44499b){return db[_0x3792('0x18')]['update'](_0x401080['body'],{'raw':_0x401080[_0x3792('0x1b')]?_0x401080[_0x3792('0x1b')][_0x3792('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x401080[_0x3792('0x1b')]?_0x401080['options']['where']||null:null,'attributes':_0x401080[_0x3792('0x1b')]?_0x401080[_0x3792('0x1b')][_0x3792('0x1f')]||null:null,'limit':_0x401080[_0x3792('0x1b')]?_0x401080[_0x3792('0x1b')][_0x3792('0x20')]||null:null})[_0x3792('0x21')](function(_0x44cc37){logger[_0x3792('0xe')]('UpdateFaxMessage',_0x401080);logger[_0x3792('0x1d')](_0x3792('0x1e'),_0x401080,JSON[_0x3792('0x11')](_0x44cc37));_0x54f42a(_0x44cc37);})[_0x3792('0x16')](function(_0x904b3b){logger['error']('UpdateFaxMessage',_0x904b3b['message'],_0x401080);_0x44499b(_0x516929[_0x3792('0x12')](0x1f4,_0x904b3b['message']));});});};
\ No newline at end of file
+var _0xea81=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where','attributes','limit','debug','stringify','lodash'];(function(_0x422ad7,_0x451535){var _0x3c28f6=function(_0x131c2b){while(--_0x131c2b){_0x422ad7['push'](_0x422ad7['shift']());}};_0x3c28f6(++_0x451535);}(_0xea81,0x1ed));var _0x1ea8=function(_0xac42d2,_0x34deb6){_0xac42d2=_0xac42d2-0x0;var _0x128cc4=_0xea81[_0xac42d2];return _0x128cc4;};'use strict';var _=require(_0x1ea8('0x0'));var util=require(_0x1ea8('0x1'));var moment=require(_0x1ea8('0x2'));var BPromise=require(_0x1ea8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ea8('0x4'))['db'];var utils=require(_0x1ea8('0x5'));var logger=require(_0x1ea8('0x6'))(_0x1ea8('0x7'));var config=require(_0x1ea8('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x1ea8('0x9')]=_[_0x1ea8('0xa')](config[_0x1ea8('0x9')],{'host':_0x1ea8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ea8('0x9')]));require(_0x1ea8('0xc'))[_0x1ea8('0xd')](socket);function respondWithRpcPromise(_0x432447,_0x495092,_0x5732b5){return new BPromise(function(_0x5be789,_0x5bd5dc){return client[_0x1ea8('0xe')](_0x432447,_0x5732b5)[_0x1ea8('0xf')](function(_0x5a327){logger[_0x1ea8('0x10')](_0x1ea8('0x11'),_0x495092,'request\x20sent');logger['debug'](_0x1ea8('0x12'),_0x495092,_0x1ea8('0x13'),JSON['stringify'](_0x5a327));if(_0x5a327[_0x1ea8('0x14')]){if(_0x5a327[_0x1ea8('0x14')][_0x1ea8('0x15')]===0x1f4){logger[_0x1ea8('0x14')](_0x1ea8('0x11'),_0x495092,_0x5a327['error'][_0x1ea8('0x16')]);return _0x5bd5dc(_0x5a327[_0x1ea8('0x14')][_0x1ea8('0x16')]);}logger['error'](_0x1ea8('0x11'),_0x495092,_0x5a327[_0x1ea8('0x14')]['message']);return _0x5be789(_0x5a327['error'][_0x1ea8('0x16')]);}else{logger['info'](_0x1ea8('0x11'),_0x495092,'request\x20sent');_0x5be789(_0x5a327[_0x1ea8('0x17')][_0x1ea8('0x16')]);}})[_0x1ea8('0x18')](function(_0xc24384){logger[_0x1ea8('0x14')](_0x1ea8('0x11'),_0x495092,_0xc24384);_0x5bd5dc(_0xc24384);});});}exports[_0x1ea8('0x19')]=function(_0x346a1e){var _0x5344ca=this;return new Promise(function(_0x45db99,_0x2a3b4c){return db[_0x1ea8('0x1a')][_0x1ea8('0x1b')](_0x346a1e[_0x1ea8('0x1c')],{'raw':_0x346a1e[_0x1ea8('0x1d')]?_0x346a1e[_0x1ea8('0x1d')][_0x1ea8('0x1e')]===undefined?!![]:![]:!![]})[_0x1ea8('0xf')](function(_0x247a47){logger['info'](_0x1ea8('0x19'),_0x346a1e);logger['debug'](_0x1ea8('0x19'),_0x346a1e,JSON['stringify'](_0x247a47));_0x45db99(_0x247a47);})[_0x1ea8('0x18')](function(_0x528ede){logger[_0x1ea8('0x14')]('CreateFaxMessage',_0x528ede['message'],_0x346a1e);_0x2a3b4c(_0x5344ca[_0x1ea8('0x14')](0x1f4,_0x528ede[_0x1ea8('0x16')]));});});};exports[_0x1ea8('0x1f')]=function(_0x51d493){var _0x5b3d5c=this;return new Promise(function(_0x3a79bf,_0x386dce){return db[_0x1ea8('0x1a')][_0x1ea8('0x20')](_0x51d493[_0x1ea8('0x1c')],{'raw':_0x51d493[_0x1ea8('0x1d')]?_0x51d493[_0x1ea8('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51d493[_0x1ea8('0x1d')]?_0x51d493['options'][_0x1ea8('0x21')]||null:null,'attributes':_0x51d493['options']?_0x51d493[_0x1ea8('0x1d')][_0x1ea8('0x22')]||null:null,'limit':_0x51d493['options']?_0x51d493[_0x1ea8('0x1d')][_0x1ea8('0x23')]||null:null})[_0x1ea8('0xf')](function(_0x3831c4){logger[_0x1ea8('0x10')](_0x1ea8('0x1f'),_0x51d493);logger[_0x1ea8('0x24')](_0x1ea8('0x1f'),_0x51d493,JSON[_0x1ea8('0x25')](_0x3831c4));_0x3a79bf(_0x3831c4);})[_0x1ea8('0x18')](function(_0x3e236e){logger[_0x1ea8('0x14')](_0x1ea8('0x1f'),_0x3e236e[_0x1ea8('0x16')],_0x51d493);_0x386dce(_0x5b3d5c[_0x1ea8('0x14')](0x1f4,_0x3e236e['message']));});});};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js
index 4be9ecb..15c0518 100644
--- a/server/api/faxMessage/faxMessage.socket.js
+++ b/server/api/faxMessage/faxMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce50=['save','remove','update','register'];(function(_0x5d23a6,_0x10da71){var _0x137b85=function(_0x2fdde3){while(--_0x2fdde3){_0x5d23a6['push'](_0x5d23a6['shift']());}};_0x137b85(++_0x10da71);}(_0xce50,0x1d8));var _0x0ce5=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xce50[_0x2dadb9];return _0x2f0097;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x0ce5('0x0'),_0x0ce5('0x1'),_0x0ce5('0x2')];function createListener(_0x363236,_0x1eddd3){return function(_0x563b79){_0x1eddd3['emit'](_0x363236,_0x563b79);};}function removeListener(_0x11f9e0,_0x52a2f1){return function(){FaxMessageEvents['removeListener'](_0x11f9e0,_0x52a2f1);};}exports[_0x0ce5('0x3')]=function(_0x42fadd){for(var _0x69892c=0x0,_0x3eb5b2=events['length'];_0x69892c<_0x3eb5b2;_0x69892c++){var _0x32610d=events[_0x69892c];var _0x8d611f=createListener('faxMessage:'+_0x32610d,_0x42fadd);FaxMessageEvents['on'](_0x32610d,_0x8d611f);}};
\ No newline at end of file
+var _0x6e0d=['length','faxMessage:','./faxMessage.events','save','remove','update'];(function(_0x4a25eb,_0x1dd8bb){var _0x179882=function(_0x3a22a7){while(--_0x3a22a7){_0x4a25eb['push'](_0x4a25eb['shift']());}};_0x179882(++_0x1dd8bb);}(_0x6e0d,0x11c));var _0xd6e0=function(_0x554b08,_0x59d701){_0x554b08=_0x554b08-0x0;var _0x42f363=_0x6e0d[_0x554b08];return _0x42f363;};'use strict';var FaxMessageEvents=require(_0xd6e0('0x0'));var events=[_0xd6e0('0x1'),_0xd6e0('0x2'),_0xd6e0('0x3')];function createListener(_0x4e3660,_0x63eadf){return function(_0x5c1016){_0x63eadf['emit'](_0x4e3660,_0x5c1016);};}function removeListener(_0x5f2ddc,_0x39a23c){return function(){FaxMessageEvents['removeListener'](_0x5f2ddc,_0x39a23c);};}exports['register']=function(_0x56bad4){for(var _0x97b7c1=0x0,_0x16c96d=events[_0xd6e0('0x4')];_0x97b7c1<_0x16c96d;_0x97b7c1++){var _0x1515da=events[_0x97b7c1];var _0x22ce6d=createListener(_0xd6e0('0x5')+_0x1515da,_0x56bad4);FaxMessageEvents['on'](_0x1515da,_0x22ce6d);}};
\ No newline at end of file
diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js
index b1776ac..b3986a5 100644
--- a/server/api/faxMessage/index.js
+++ b/server/api/faxMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4fb4=['../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x4fb4,0x190));var _0x44fb=function(_0x596d42,_0x3156c8){_0x596d42=_0x596d42-0x0;var _0x55b49c=_0x4fb4[_0x596d42];return _0x55b49c;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var auth=require(_0x44fb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x44fb('0x6'));var controller=require(_0x44fb('0x7'));router[_0x44fb('0x8')]('/',auth[_0x44fb('0x9')](),controller[_0x44fb('0xa')]);router[_0x44fb('0x8')](_0x44fb('0xb'),auth[_0x44fb('0x9')](),controller['describe']);router[_0x44fb('0x8')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x8')](_0x44fb('0xe'),auth[_0x44fb('0x9')](),controller[_0x44fb('0xf')]);router[_0x44fb('0x10')]('/',auth[_0x44fb('0x9')](),interaction[_0x44fb('0x11')](_0x44fb('0x12'),_0x44fb('0x13')),controller['create']);router[_0x44fb('0x14')](_0x44fb('0xc'),auth[_0x44fb('0x9')](),controller[_0x44fb('0x15')]);router[_0x44fb('0x14')]('/:id/accept',auth[_0x44fb('0x9')](),controller[_0x44fb('0x16')]);router[_0x44fb('0x14')](_0x44fb('0x17'),auth[_0x44fb('0x9')](),controller['reject']);router[_0x44fb('0x18')](_0x44fb('0xc'),auth[_0x44fb('0x9')](),controller[_0x44fb('0x19')]);module[_0x44fb('0x1a')]=router;
\ No newline at end of file
+var _0x0a6b=['update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id/download','download','tracked','faxmessage:create','create','put','/:id'];(function(_0x19cfa5,_0x1135fa){var _0x198e5f=function(_0x5b57be){while(--_0x5b57be){_0x19cfa5['push'](_0x19cfa5['shift']());}};_0x198e5f(++_0x1135fa);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x6fabdb,_0x168fcd){_0x6fabdb=_0x6fabdb-0x0;var _0x58c0c2=_0x0a6b[_0x6fabdb];return _0x58c0c2;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var auth=require(_0xb0a6('0x2'));var interaction=require(_0xb0a6('0x3'));var config=require(_0xb0a6('0x4'));var controller=require('./faxMessage.controller');router[_0xb0a6('0x5')]('/',auth['isAuthenticated'](),controller[_0xb0a6('0x6')]);router[_0xb0a6('0x5')]('/describe',auth[_0xb0a6('0x7')](),controller[_0xb0a6('0x8')]);router[_0xb0a6('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb0a6('0x5')](_0xb0a6('0x9'),auth[_0xb0a6('0x7')](),controller[_0xb0a6('0xa')]);router['post']('/',auth[_0xb0a6('0x7')](),interaction[_0xb0a6('0xb')]('fax',_0xb0a6('0xc')),controller[_0xb0a6('0xd')]);router[_0xb0a6('0xe')](_0xb0a6('0xf'),auth[_0xb0a6('0x7')](),controller[_0xb0a6('0x10')]);router[_0xb0a6('0xe')](_0xb0a6('0x11'),auth[_0xb0a6('0x7')](),controller[_0xb0a6('0x12')]);router['put'](_0xb0a6('0x13'),auth['isAuthenticated'](),controller[_0xb0a6('0x14')]);router['delete'](_0xb0a6('0xf'),auth['isAuthenticated'](),controller[_0xb0a6('0x15')]);module[_0xb0a6('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js
index a232b37..d1062d3 100644
--- a/server/api/faxQueue/faxQueue.attributes.js
+++ b/server/api/faxQueue/faxQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1297=['exports','STRING','ENUM','rrmemory','beepall','roundrobin','INTEGER','sequelize'];(function(_0x121985,_0x252db3){var _0x20bc79=function(_0x30889b){while(--_0x30889b){_0x121985['push'](_0x121985['shift']());}};_0x20bc79(++_0x252db3);}(_0x1297,0x157));var _0x7129=function(_0x3fd782,_0x4540ad){_0x3fd782=_0x3fd782-0x0;var _0x57008f=_0x1297[_0x3fd782];return _0x57008f;};'use strict';var Sequelize=require(_0x7129('0x0'));module[_0x7129('0x1')]={'name':{'type':Sequelize[_0x7129('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7129('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7129('0x3')](_0x7129('0x4'),_0x7129('0x5'),_0x7129('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7129('0x7')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xb0ee=['name','INTEGER','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x29d730,_0x3026a6){var _0xb2f47f=function(_0x1abfa0){while(--_0x1abfa0){_0x29d730['push'](_0x29d730['shift']());}};_0xb2f47f(++_0x3026a6);}(_0xb0ee,0x132));var _0xeb0e=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xb0ee[_0x36884e];return _0x1cc367;};'use strict';var Sequelize=require('sequelize');module[_0xeb0e('0x0')]={'name':{'type':Sequelize[_0xeb0e('0x1')],'unique':_0xeb0e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeb0e('0x1')]},'timeout':{'type':Sequelize[_0xeb0e('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xeb0e('0x4'),_0xeb0e('0x5'),_0xeb0e('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xeb0e('0x3')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js
index 963cff2..5ce1d36 100644
--- a/server/api/faxQueue/faxQueue.controller.js
+++ b/server/api/faxQueue/faxQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc03e=['count','findAll','catch','show','params','fields','include','merge','options','create','body','user','get','role','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','order','FaxQueueId','User','findAndCountAll','UserId','faxPause','updatedAt','rows','createdAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','value','isEmpty','omit','userFaxQueue:save','removeAgents','isArray','userFaxQueue:remove','getAgents','findOne','html-pdf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','FaxQueues','UserProfileResource','destroy','stack','name','send','index','FaxQueue','rawAttributes','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field'];(function(_0x51d92a,_0x49d811){var _0x1236b0=function(_0x46c098){while(--_0x46c098){_0x51d92a['push'](_0x51d92a['shift']());}};_0x1236b0(++_0x49d811);}(_0xc03e,0x15a));var _0xec03=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0xc03e[_0xcfeff4];return _0xb2fadc;};'use strict';var pdf=require(_0xec03('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xec03('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec03('0x2'));var moment=require('moment');var BPromise=require(_0xec03('0x3'));var Mustache=require(_0xec03('0x4'));var util=require(_0xec03('0x5'));var path=require(_0xec03('0x6'));var sox=require(_0xec03('0x7'));var csv=require(_0xec03('0x8'));var ejs=require(_0xec03('0x9'));var fs=require('fs');var _=require(_0xec03('0xa'));var squel=require(_0xec03('0xb'));var crypto=require('crypto');var jsforce=require(_0xec03('0xc'));var deskjs=require(_0xec03('0xd'));var toCsv=require(_0xec03('0x8'));var querystring=require(_0xec03('0xe'));var Papa=require('papaparse');var Redis=require(_0xec03('0xf'));var authService=require(_0xec03('0x10'));var qs=require(_0xec03('0x11'));var hardwareService=require(_0xec03('0x12'));var logger=require(_0xec03('0x13'))(_0xec03('0x14'));var utils=require(_0xec03('0x15'));var config=require(_0xec03('0x16'));var db=require('../../mysqldb')['db'];config[_0xec03('0x17')]=_[_0xec03('0x18')](config[_0xec03('0x17')],{'host':_0xec03('0x19'),'port':0x18eb});var socket=require(_0xec03('0x1a'))(new Redis(config[_0xec03('0x17')]));require(_0xec03('0x1b'))[_0xec03('0x1c')](socket);function respondWithStatusCode(_0x4ba43a,_0x555447){_0x555447=_0x555447||0xcc;return function(_0x5ca0e2){if(_0x5ca0e2){return _0x4ba43a[_0xec03('0x1d')](_0x555447);}return _0x4ba43a[_0xec03('0x1e')](_0x555447)[_0xec03('0x1f')]();};}function respondWithResult(_0x515680,_0x28bb4f){_0x28bb4f=_0x28bb4f||0xc8;return function(_0xbe85e6){if(_0xbe85e6){return _0x515680[_0xec03('0x1e')](_0x28bb4f)[_0xec03('0x20')](_0xbe85e6);}};}function respondWithFilteredResult(_0x5c2f1a,_0x1fae17){return function(_0x52f6ae){if(_0x52f6ae){var _0x46a669=_0x52f6ae['count'],_0x5e8ae2=_0x1fae17[_0xec03('0x21')],_0x25292d=_0x1fae17[_0xec03('0x21')]+_0x1fae17[_0xec03('0x22')],_0x5b3e04;if(_0x25292d>=_0x46a669){_0x25292d=_0x46a669;_0x5b3e04=0xc8;}else{_0x5b3e04=0xce;}_0x5c2f1a[_0xec03('0x1e')](_0x5b3e04);return _0x5c2f1a['set'](_0xec03('0x23'),_0x5e8ae2+'-'+_0x25292d+'/'+_0x46a669)['json'](_0x52f6ae);}return null;};}function patchUpdates(_0x16ade3){return function(_0x253910){try{jsonpatch[_0xec03('0x24')](_0x253910,_0x16ade3,!![]);}catch(_0x33a167){return BPromise[_0xec03('0x25')](_0x33a167);}return _0x253910[_0xec03('0x26')]();};}function saveUpdates(_0x3a44df,_0x3b6ddf){return function(_0x5df6cc){if(_0x5df6cc){return _0x5df6cc[_0xec03('0x27')](_0x3a44df)[_0xec03('0x28')](function(_0xa16d53){return _0xa16d53;});}return null;};}function removeEntity(_0x76b813,_0x33de1e){return function(_0x15ef87){if(_0x15ef87){return _0x15ef87['destroy']()[_0xec03('0x28')](function(){var _0x3ab7a1=_0x15ef87['get']({'plain':!![]});var _0x2bfcf6=_0xec03('0x29');return db[_0xec03('0x2a')][_0xec03('0x2b')]({'where':{'type':_0x2bfcf6,'resourceId':_0x3ab7a1['id']}})[_0xec03('0x28')](function(){return _0x15ef87;});})['then'](function(){_0x76b813[_0xec03('0x1e')](0xcc)[_0xec03('0x1f')]();});}};}function handleEntityNotFound(_0x3eefe0,_0x11a6b6){return function(_0x29e904){if(!_0x29e904){_0x3eefe0['sendStatus'](0x194);}return _0x29e904;};}function handleError(_0x15cb11,_0x141db0){_0x141db0=_0x141db0||0x1f4;return function(_0x49f9ab){logger['error'](_0x49f9ab[_0xec03('0x2c')]);if(_0x49f9ab[_0xec03('0x2d')]){delete _0x49f9ab[_0xec03('0x2d')];}_0x15cb11[_0xec03('0x1e')](_0x141db0)[_0xec03('0x2e')](_0x49f9ab);};}exports[_0xec03('0x2f')]=function(_0xda963b,_0x28753c){var _0x51fad6={},_0x28f60c={},_0x31c08d={'count':0x0,'rows':[]};var _0x2bd889=db[_0xec03('0x30')][_0xec03('0x31')];_0x28f60c[_0xec03('0x32')]=_[_0xec03('0x33')](_0x2bd889);_0x28f60c[_0xec03('0x34')]=_[_0xec03('0x33')](_0xda963b['query']);_0x28f60c['filters']=_['intersection'](_0x28f60c[_0xec03('0x32')],_0x28f60c[_0xec03('0x34')]);_0x51fad6[_0xec03('0x35')]=_[_0xec03('0x36')](_0x28f60c['model'],qs['fields'](_0xda963b['query']['fields']));_0x51fad6[_0xec03('0x35')]=_0x51fad6[_0xec03('0x35')][_0xec03('0x37')]?_0x51fad6[_0xec03('0x35')]:_0x28f60c[_0xec03('0x32')];if(!_0xda963b[_0xec03('0x34')][_0xec03('0x38')](_0xec03('0x39'))){_0x51fad6[_0xec03('0x22')]=qs[_0xec03('0x22')](_0xda963b[_0xec03('0x34')][_0xec03('0x22')]);_0x51fad6['offset']=qs[_0xec03('0x21')](_0xda963b[_0xec03('0x34')][_0xec03('0x21')]);}_0x51fad6['order']=qs[_0xec03('0x3a')](_0xda963b[_0xec03('0x34')][_0xec03('0x3a')]);_0x51fad6[_0xec03('0x3b')]=qs[_0xec03('0x3c')](_[_0xec03('0x3d')](_0xda963b[_0xec03('0x34')],_0x28f60c[_0xec03('0x3c')]));if(_0xda963b[_0xec03('0x34')][_0xec03('0x3e')]){_0x51fad6[_0xec03('0x3b')]=_['merge'](_0x51fad6[_0xec03('0x3b')],{'$or':_[_0xec03('0x3f')](_0x2bd889,function(_0x37819a){if(_0x37819a[_0xec03('0x40')][_0xec03('0x41')]!==_0xec03('0x42')){var _0x2ba220={};_0x2ba220[_0x37819a[_0xec03('0x43')]]={'$like':'%'+_0xda963b['query'][_0xec03('0x3e')]+'%'};return _0x2ba220;}})});}_0x51fad6=_['merge']({},_0x51fad6,_0xda963b['options']);var _0x1c2d46={'where':_0x51fad6['where']};return db['FaxQueue'][_0xec03('0x44')](_0x1c2d46)[_0xec03('0x28')](function(_0x5aec1c){_0x31c08d[_0xec03('0x44')]=_0x5aec1c;if(_0xda963b['query']['includeAll']){_0x51fad6['include']=[{'all':!![]}];}return db[_0xec03('0x30')][_0xec03('0x45')](_0x51fad6);})[_0xec03('0x28')](function(_0xf3d24e){_0x31c08d['rows']=_0xf3d24e;return _0x31c08d;})[_0xec03('0x28')](respondWithFilteredResult(_0x28753c,_0x51fad6))[_0xec03('0x46')](handleError(_0x28753c,null));};exports[_0xec03('0x47')]=function(_0x14a429,_0x5f9bb6){var _0x419e15={'raw':!![],'where':{'id':_0x14a429[_0xec03('0x48')]['id']}},_0x1ee5b7={};_0x1ee5b7[_0xec03('0x32')]=_['keys'](db[_0xec03('0x30')][_0xec03('0x31')]);_0x1ee5b7[_0xec03('0x34')]=_[_0xec03('0x33')](_0x14a429['query']);_0x1ee5b7[_0xec03('0x3c')]=_[_0xec03('0x36')](_0x1ee5b7[_0xec03('0x32')],_0x1ee5b7[_0xec03('0x34')]);_0x419e15[_0xec03('0x35')]=_[_0xec03('0x36')](_0x1ee5b7['model'],qs['fields'](_0x14a429[_0xec03('0x34')][_0xec03('0x49')]));_0x419e15[_0xec03('0x35')]=_0x419e15[_0xec03('0x35')][_0xec03('0x37')]?_0x419e15['attributes']:_0x1ee5b7['model'];if(_0x14a429[_0xec03('0x34')]['includeAll']){_0x419e15[_0xec03('0x4a')]=[{'all':!![]}];}_0x419e15=_[_0xec03('0x4b')]({},_0x419e15,_0x14a429[_0xec03('0x4c')]);return db[_0xec03('0x30')]['find'](_0x419e15)[_0xec03('0x28')](handleEntityNotFound(_0x5f9bb6,null))[_0xec03('0x28')](respondWithResult(_0x5f9bb6,null))[_0xec03('0x46')](handleError(_0x5f9bb6,null));};exports[_0xec03('0x4d')]=function(_0x54a2d4,_0x128935){return db['FaxQueue'][_0xec03('0x4d')](_0x54a2d4[_0xec03('0x4e')],{})[_0xec03('0x28')](function(_0x1c6b87){var _0x2eba66=_0x54a2d4[_0xec03('0x4f')][_0xec03('0x50')]({'plain':!![]});if(!_0x2eba66)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2eba66[_0xec03('0x51')]===_0xec03('0x4f')){var _0x3eacdf=_0x1c6b87[_0xec03('0x50')]({'plain':!![]});var _0x53a51e=_0xec03('0x29');return db['UserProfileSection'][_0xec03('0x52')]({'where':{'name':_0x53a51e,'userProfileId':_0x2eba66[_0xec03('0x53')]},'raw':!![]})[_0xec03('0x28')](function(_0x2e13c6){if(_0x2e13c6&&_0x2e13c6['autoAssociation']===0x0){return db[_0xec03('0x2a')][_0xec03('0x4d')]({'name':_0x3eacdf[_0xec03('0x2d')],'resourceId':_0x3eacdf['id'],'type':_0x2e13c6[_0xec03('0x2d')],'sectionId':_0x2e13c6['id']},{})[_0xec03('0x28')](function(){return _0x1c6b87;});}else{return _0x1c6b87;}})['catch'](function(_0x1170fa){logger[_0xec03('0x54')](_0xec03('0x55'),_0x1170fa);throw _0x1170fa;});}return _0x1c6b87;})['then'](respondWithResult(_0x128935,0xc9))['catch'](handleError(_0x128935,null));};exports[_0xec03('0x27')]=function(_0x3932ba,_0x29929d){if(_0x3932ba[_0xec03('0x4e')]['id']){delete _0x3932ba['body']['id'];}return db[_0xec03('0x30')][_0xec03('0x52')]({'where':{'id':_0x3932ba[_0xec03('0x48')]['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x29929d,null))['then'](saveUpdates(_0x3932ba[_0xec03('0x4e')],null))[_0xec03('0x28')](respondWithResult(_0x29929d,null))[_0xec03('0x46')](handleError(_0x29929d,null));};exports[_0xec03('0x2b')]=function(_0x1fc401,_0x3d41b2){return db[_0xec03('0x30')][_0xec03('0x52')]({'where':{'id':_0x1fc401['params']['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x3d41b2,null))[_0xec03('0x28')](removeEntity(_0x3d41b2,null))[_0xec03('0x46')](handleError(_0x3d41b2,null));};exports[_0xec03('0x56')]=function(_0x4ddc6f,_0x17ce61){return db[_0xec03('0x30')][_0xec03('0x56')]()[_0xec03('0x28')](respondWithResult(_0x17ce61,null))['catch'](handleError(_0x17ce61,null));};exports[_0xec03('0x57')]=function(_0x286156,_0x13fae4,_0x22e1da){var _0x7715b0={'raw':!![],'where':{}},_0x19272d={},_0x1f9272;return db[_0xec03('0x30')]['findOne']({'where':{'id':_0x286156[_0xec03('0x48')]['id']}})['then'](handleEntityNotFound(_0x13fae4,null))[_0xec03('0x28')](function(_0x5befb7){if(_0x5befb7){_0x1f9272=_0x5befb7[_0xec03('0x50')]({'plain':!![]});_0x19272d[_0xec03('0x32')]=_[_0xec03('0x33')](db[_0xec03('0x58')][_0xec03('0x31')]);_0x19272d[_0xec03('0x34')]=_[_0xec03('0x33')](_0x286156[_0xec03('0x34')]);_0x19272d['filters']=_[_0xec03('0x36')](_0x19272d[_0xec03('0x32')],_0x19272d['query']);_0x7715b0[_0xec03('0x35')]=_[_0xec03('0x36')](_0x19272d['model'],qs['fields'](_0x286156[_0xec03('0x34')][_0xec03('0x49')]));_0x7715b0[_0xec03('0x35')]=_0x7715b0[_0xec03('0x35')][_0xec03('0x37')]?_0x7715b0[_0xec03('0x35')]:_0x19272d[_0xec03('0x32')];if(!_0x286156[_0xec03('0x34')][_0xec03('0x38')](_0xec03('0x39'))){_0x7715b0[_0xec03('0x22')]=qs[_0xec03('0x22')](_0x286156[_0xec03('0x34')][_0xec03('0x22')]);_0x7715b0[_0xec03('0x21')]=qs['offset'](_0x286156[_0xec03('0x34')]['offset']);}_0x7715b0[_0xec03('0x59')]=qs[_0xec03('0x3a')](_0x286156[_0xec03('0x34')][_0xec03('0x3a')]);_0x7715b0[_0xec03('0x3b')]=qs[_0xec03('0x3c')](_['pick'](_0x286156[_0xec03('0x34')],_0x19272d[_0xec03('0x3c')]));_0x7715b0[_0xec03('0x3b')][_0xec03('0x5a')]=_0x5befb7['id'];if(_0x286156[_0xec03('0x34')][_0xec03('0x3e')]){_0x7715b0[_0xec03('0x3b')]=_[_0xec03('0x4b')](_0x7715b0['where'],{'$or':_[_0xec03('0x3f')](_0x7715b0[_0xec03('0x35')],function(_0x4a5e18){var _0x1537f1={};_0x1537f1[_0x4a5e18]={'$like':'%'+_0x286156[_0xec03('0x34')][_0xec03('0x3e')]+'%'};return _0x1537f1;})});}_0x7715b0=_[_0xec03('0x4b')]({},_0x7715b0,_0x286156[_0xec03('0x4c')]);return db['UserFaxQueue'][_0xec03('0x45')](_0x7715b0);}})[_0xec03('0x28')](function(_0x39d2a6){if(_0x39d2a6){return db[_0xec03('0x5b')][_0xec03('0x5c')]({'where':{'id':_[_0xec03('0x3f')](_0x39d2a6,_0xec03('0x5d')),'role':'agent'},'attributes':['id',_0xec03('0x2d'),_0xec03('0x5e'),_0xec03('0x5f'),'createdAt']});}})[_0xec03('0x28')](function(_0x52c0f3){if(_0x52c0f3){return{'count':_0x52c0f3['count'],'rows':_[_0xec03('0x3f')](_0x52c0f3[_0xec03('0x60')],function(_0x338beb){return{'membername':_0x338beb[_0xec03('0x2d')],'UserId':_0x338beb['id'],'queue_name':_0x1f9272[_0xec03('0x2d')],'FaxQueueId':_0x1f9272['id'],'interface':util['format']('%s/%s','SIP',_0x338beb[_0xec03('0x2d')]),'penalty':0x0,'paused':_0x338beb[_0xec03('0x5e')],'createdAt':_0x338beb[_0xec03('0x61')],'updatedAt':_0x338beb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x13fae4,_0x7715b0))[_0xec03('0x46')](handleError(_0x13fae4,null));};exports['getTeams']=function(_0x34c58c,_0x3bf499,_0x1a0bae){var _0x4de4eb={};var _0x3559cf={};var _0x5648a6;var _0x274425;return db['FaxQueue']['findOne']({'where':{'id':_0x34c58c['params']['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x3bf499,null))[_0xec03('0x28')](function(_0xba5495){if(_0xba5495){_0x5648a6=_0xba5495;_0x3559cf[_0xec03('0x32')]=_[_0xec03('0x33')](db[_0xec03('0x62')][_0xec03('0x31')]);_0x3559cf['query']=_[_0xec03('0x33')](_0x34c58c[_0xec03('0x34')]);_0x3559cf['filters']=_[_0xec03('0x36')](_0x3559cf['model'],_0x3559cf[_0xec03('0x34')]);_0x4de4eb[_0xec03('0x35')]=_[_0xec03('0x36')](_0x3559cf['model'],qs[_0xec03('0x49')](_0x34c58c[_0xec03('0x34')]['fields']));_0x4de4eb['attributes']=_0x4de4eb[_0xec03('0x35')][_0xec03('0x37')]?_0x4de4eb[_0xec03('0x35')]:_0x3559cf[_0xec03('0x32')];_0x4de4eb[_0xec03('0x59')]=qs[_0xec03('0x3a')](_0x34c58c[_0xec03('0x34')][_0xec03('0x3a')]);_0x4de4eb[_0xec03('0x3b')]=qs['filters'](_[_0xec03('0x3d')](_0x34c58c[_0xec03('0x34')],_0x3559cf[_0xec03('0x3c')]));if(_0x34c58c[_0xec03('0x34')][_0xec03('0x3e')]){_0x4de4eb['where']=_['merge'](_0x4de4eb['where'],{'$or':_[_0xec03('0x3f')](_0x4de4eb['attributes'],function(_0x1c75bc){var _0x1048c2={};_0x1048c2[_0x1c75bc]={'$like':'%'+_0x34c58c[_0xec03('0x34')][_0xec03('0x3e')]+'%'};return _0x1048c2;})});}_0x4de4eb=_['merge']({},_0x4de4eb,_0x34c58c[_0xec03('0x4c')]);return _0x5648a6[_0xec03('0x63')](_0x4de4eb);}})['then'](function(_0x2d3172){if(_0x2d3172){_0x274425=_0x2d3172['length'];if(!_0x34c58c[_0xec03('0x34')][_0xec03('0x38')](_0xec03('0x39'))){_0x4de4eb['limit']=qs['limit'](_0x34c58c[_0xec03('0x34')][_0xec03('0x22')]);_0x4de4eb[_0xec03('0x21')]=qs[_0xec03('0x21')](_0x34c58c[_0xec03('0x34')][_0xec03('0x21')]);}return _0x5648a6['getTeams'](_0x4de4eb);}})[_0xec03('0x28')](function(_0x152b93){if(_0x152b93){return _0x152b93?{'count':_0x274425,'rows':_0x152b93}:null;}})[_0xec03('0x28')](respondWithResult(_0x3bf499,null))[_0xec03('0x46')](handleError(_0x3bf499,null));};exports[_0xec03('0x64')]=function(_0x28be4d,_0x30a8da,_0x54dcf5){var _0x3384f0=_0x28be4d[_0xec03('0x4e')]['teams'];return db['Team'][_0xec03('0x45')]({'where':{'id':_['map'](_0x3384f0,'id')},'attributes':['id'],'include':[{'model':db[_0xec03('0x5b')],'as':_0xec03('0x65'),'attributes':['id',_0xec03('0x2d'),_0xec03('0x66'),_0xec03('0x67'),_0xec03('0x68')],'raw':!![]}]})['then'](function(_0x5f3a8b){if(_0x5f3a8b){var _0x1a6bc2=_[_0xec03('0x69')](_0x5f3a8b,function(_0x2cebb0){var _0x204e48=_0x2cebb0[_0xec03('0x50')]({'plain':!![]});return _0x204e48[_0xec03('0x65')];});return db[_0xec03('0x30')][_0xec03('0x52')]({'where':{'id':_0x28be4d[_0xec03('0x48')]['id']}})[_0xec03('0x28')](function(_0x498fd2){return db[_0xec03('0x6a')][_0xec03('0x6b')](function(_0x39b38b){return _0x498fd2[_0xec03('0x64')](_[_0xec03('0x3f')](_0x3384f0,'id'),{'transaction':_0x39b38b})[_0xec03('0x28')](function(){return BPromise[_0xec03('0x6c')](_0x1a6bc2,function(_0x3d6e22){return db[_0xec03('0x58')][_0xec03('0x6d')]({'where':{'UserId':_0x3d6e22['id'],'FaxQueueId':_0x28be4d[_0xec03('0x48')]['id']},'transaction':_0x39b38b});});})['then'](function(){_0x1a6bc2[_0xec03('0x6e')](function(_0x599c1a){socket[_0xec03('0x6f')]('userFaxQueue:save',{'UserId':_0x599c1a['id'],'FaxQueueId':_0x498fd2['id']});});});});});}})[_0xec03('0x28')](respondWithStatusCode(_0x30a8da,null))[_0xec03('0x46')](handleError(_0x30a8da,null));};exports[_0xec03('0x70')]=function(_0x48f53e,_0x1fbed5,_0x255110){return db[_0xec03('0x62')]['findAll']({'where':{'id':_0x48f53e[_0xec03('0x34')][_0xec03('0x71')]},'attributes':['id'],'include':[{'model':db[_0xec03('0x5b')],'as':_0xec03('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1fbed5,null))[_0xec03('0x28')](function(_0x1f0a79){var _0x7f975=_[_0xec03('0x3f')](_0x1f0a79,'id');var _0x27cc93=[];var _0x141902=[];var _0xd0b9c=squel[_0xec03('0x72')]();_0xd0b9c['field']('tq.TeamId')[_0xec03('0x73')](_0xec03('0x74'),'tq')[_0xec03('0x75')](_0xec03('0x76'),'ut',_0xec03('0x77'))[_0xec03('0x3b')]('FaxQueueId\x20=\x20?',_0x48f53e[_0xec03('0x48')]['id']);for(var _0x2e8e8b=0x0;_0x2e8e8b<_0x1f0a79[_0xec03('0x37')];_0x2e8e8b+=0x1){let _0x395d68=_0x1f0a79[_0x2e8e8b];for(var _0x7dd42d=0x0;_0x7dd42d<_0x395d68[_0xec03('0x65')][_0xec03('0x37')];_0x7dd42d+=0x1){let _0x26321e=_0x395d68['Agents'][_0x7dd42d];var _0x2ce92b=_0xd0b9c[_0xec03('0x78')]();_0x2ce92b[_0xec03('0x3b')](_0xec03('0x79'),_0x26321e['id']);_0x141902[_0xec03('0x7a')](db[_0xec03('0x6a')]['query'](_0x2ce92b[_0xec03('0x7b')](),{'type':db[_0xec03('0x6a')]['QueryTypes'][_0xec03('0x7c')]})[_0xec03('0x28')](function(_0x5d0897){if(_0x5d0897[_0xec03('0x37')]===0x1){return _0x26321e['id'];}else{var _0x1f231b=_['every'](_[_0xec03('0x3f')](_0x5d0897,_0xec03('0x7d')),function(_0x31a702){return _['includes'](_0x7f975,_0x31a702);});if(_0x1f231b){return _0x26321e['id'];}}}));}}return BPromise[_0xec03('0x7e')](_0x141902)[_0xec03('0x28')](function(_0x388280){_0x27cc93=_(_0x27cc93)[_0xec03('0x7f')](_0x388280)[_0xec03('0x80')]()[_0xec03('0x81')]();return db[_0xec03('0x30')][_0xec03('0x52')]({'where':{'id':_0x48f53e['params']['id']}})[_0xec03('0x28')](function(_0x9f9172){return db['sequelize'][_0xec03('0x6b')](function(_0x369d56){return _0x9f9172[_0xec03('0x70')](_0x48f53e[_0xec03('0x34')][_0xec03('0x71')],{'transaction':_0x369d56})[_0xec03('0x28')](function(){if(!_[_0xec03('0x82')](_0x27cc93)){return _0x9f9172['removeAgents'](_0x27cc93,{'transaction':_0x369d56});}})[_0xec03('0x28')](function(){_0x27cc93[_0xec03('0x6e')](function(_0x45c246){socket[_0xec03('0x6f')]('userFaxQueue:remove',{'UserId':_0x45c246,'FaxQueueId':_0x9f9172['id']});});});});});});})['then'](respondWithStatusCode(_0x1fbed5,null))[_0xec03('0x46')](handleError(_0x1fbed5,null));};exports['addAgents']=function(_0x376777,_0x1a9445,_0xba2cd5){return db['FaxQueue'][_0xec03('0x52')]({'where':{'id':_0x376777[_0xec03('0x48')]['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x1a9445,null))[_0xec03('0x28')](function(_0x549faf){if(_0x549faf){return _0x549faf['addAgents'](_0x376777[_0xec03('0x4e')][_0xec03('0x71')],_[_0xec03('0x83')](_0x376777[_0xec03('0x4e')],[_0xec03('0x71'),'id'])||{})['spread'](function(_0x30cd0c){for(var _0x16fb71=0x0;_0x16fb71<_0x376777[_0xec03('0x4e')][_0xec03('0x71')][_0xec03('0x37')];_0x16fb71+=0x1){socket[_0xec03('0x6f')](_0xec03('0x84'),{'UserId':_0x376777[_0xec03('0x4e')][_0xec03('0x71')][_0x16fb71],'FaxQueueId':_0x376777[_0xec03('0x48')]['id']});}return _0x30cd0c;});}})[_0xec03('0x28')](respondWithResult(_0x1a9445,null))['catch'](handleError(_0x1a9445,null));};exports['removeAgents']=function(_0x5dd652,_0x1f1e14,_0xa77f71){return db[_0xec03('0x30')][_0xec03('0x52')]({'where':{'id':_0x5dd652[_0xec03('0x48')]['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x1f1e14,null))[_0xec03('0x28')](function(_0x5c4a27){if(_0x5c4a27){return _0x5c4a27[_0xec03('0x85')](_0x5dd652[_0xec03('0x34')][_0xec03('0x71')])['then'](function(){if(_[_0xec03('0x86')](_0x5dd652[_0xec03('0x34')]['ids'])){for(var _0x22686d=0x0;_0x22686d<_0x5dd652['query'][_0xec03('0x71')]['length'];_0x22686d+=0x1){socket['emit'](_0xec03('0x87'),{'UserId':Number(_0x5dd652['query'][_0xec03('0x71')][_0x22686d]),'FaxQueueId':Number(_0x5dd652[_0xec03('0x48')]['id'])});}}else{socket[_0xec03('0x6f')](_0xec03('0x87'),{'UserId':Number(_0x5dd652[_0xec03('0x34')][_0xec03('0x71')]),'FaxQueueId':Number(_0x5dd652[_0xec03('0x48')]['id'])});}});}})[_0xec03('0x28')](respondWithStatusCode(_0x1f1e14,null))[_0xec03('0x46')](handleError(_0x1f1e14,null));};exports[_0xec03('0x88')]=function(_0x291ae5,_0x18ede3,_0x58db82){var _0x5901c1={};var _0x5396e8={};var _0x5e7627;var _0x1faf17;return db['FaxQueue'][_0xec03('0x89')]({'where':{'id':_0x291ae5[_0xec03('0x48')]['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x18ede3,null))['then'](function(_0x3de217){if(_0x3de217){_0x5e7627=_0x3de217;_0x5396e8[_0xec03('0x32')]=_[_0xec03('0x33')](db['User'][_0xec03('0x31')]);_0x5396e8[_0xec03('0x34')]=_[_0xec03('0x33')](_0x291ae5['query']);_0x5396e8[_0xec03('0x3c')]=_[_0xec03('0x36')](_0x5396e8[_0xec03('0x32')],_0x5396e8[_0xec03('0x34')]);_0x5901c1[_0xec03('0x35')]=_[_0xec03('0x36')](_0x5396e8[_0xec03('0x32')],qs['fields'](_0x291ae5[_0xec03('0x34')][_0xec03('0x49')]));_0x5901c1[_0xec03('0x35')]=_0x5901c1[_0xec03('0x35')][_0xec03('0x37')]?_0x5901c1[_0xec03('0x35')]:_0x5396e8['model'];_0x5901c1[_0xec03('0x59')]=qs[_0xec03('0x3a')](_0x291ae5[_0xec03('0x34')][_0xec03('0x3a')]);_0x5901c1[_0xec03('0x3b')]=qs['filters'](_[_0xec03('0x3d')](_0x291ae5[_0xec03('0x34')],_0x5396e8['filters']));if(_0x291ae5[_0xec03('0x34')][_0xec03('0x3e')]){_0x5901c1[_0xec03('0x3b')]=_[_0xec03('0x4b')](_0x5901c1[_0xec03('0x3b')],{'$or':_[_0xec03('0x3f')](_0x5901c1[_0xec03('0x35')],function(_0x4a106a){var _0x1dd07d={};_0x1dd07d[_0x4a106a]={'$like':'%'+_0x291ae5[_0xec03('0x34')][_0xec03('0x3e')]+'%'};return _0x1dd07d;})});}_0x5901c1=_[_0xec03('0x4b')]({},_0x5901c1,_0x291ae5['options']);return _0x5e7627[_0xec03('0x88')](_0x5901c1);}})[_0xec03('0x28')](function(_0x4589d3){if(_0x4589d3){_0x1faf17=_0x4589d3['length'];if(!_0x291ae5[_0xec03('0x34')][_0xec03('0x38')](_0xec03('0x39'))){_0x5901c1[_0xec03('0x22')]=qs[_0xec03('0x22')](_0x291ae5[_0xec03('0x34')][_0xec03('0x22')]);_0x5901c1[_0xec03('0x21')]=qs[_0xec03('0x21')](_0x291ae5[_0xec03('0x34')][_0xec03('0x21')]);}return _0x5e7627[_0xec03('0x88')](_0x5901c1);}})[_0xec03('0x28')](function(_0x2dc38f){if(_0x2dc38f){return _0x2dc38f?{'count':_0x1faf17,'rows':_0x2dc38f}:null;}})[_0xec03('0x28')](respondWithResult(_0x18ede3,null))[_0xec03('0x46')](handleError(_0x18ede3,null));};
\ No newline at end of file
+var _0x7da7=['all','union','value','ids','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','./faxQueue.socket','sendStatus','end','status','json','count','offset','limit','apply','reject','update','then','destroy','get','FaxQueues','UserProfileResource','name','send','index','FaxQueue','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','field','filter','options','include','findAll','rows','catch','show','rawAttributes','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserFaxQueue','nolimit','map','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','interface','flatMap','Agents','sequelize','transaction','each','forEach','userFaxQueue:save','removeTeams','select','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId'];(function(_0x57ac32,_0xd63c46){var _0x5f2c41=function(_0x55ac64){while(--_0x55ac64){_0x57ac32['push'](_0x57ac32['shift']());}};_0x5f2c41(++_0xd63c46);}(_0x7da7,0x10d));var _0x77da=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x7da7[_0x34843e];return _0x598f7f;};'use strict';var pdf=require(_0x77da('0x0'));var emlformat=require(_0x77da('0x1'));var rimraf=require(_0x77da('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x77da('0x3'));var moment=require(_0x77da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77da('0x5'));var util=require(_0x77da('0x6'));var path=require('path');var sox=require(_0x77da('0x7'));var csv=require(_0x77da('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x8'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77da('0x11'))(_0x77da('0x12'));var utils=require(_0x77da('0x13'));var config=require(_0x77da('0x14'));var db=require('../../mysqldb')['db'];config[_0x77da('0x15')]=_[_0x77da('0x16')](config[_0x77da('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x77da('0x15')]));require(_0x77da('0x17'))['register'](socket);function respondWithStatusCode(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xcc;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0);}return _0x3b0ff2['status'](_0x369df0)[_0x77da('0x19')]();};}function respondWithResult(_0x4e130c,_0x29cd7b){_0x29cd7b=_0x29cd7b||0xc8;return function(_0x366443){if(_0x366443){return _0x4e130c[_0x77da('0x1a')](_0x29cd7b)[_0x77da('0x1b')](_0x366443);}};}function respondWithFilteredResult(_0x4ecd98,_0x5c07da){return function(_0x514016){if(_0x514016){var _0x482b87=_0x514016[_0x77da('0x1c')],_0x103e46=_0x5c07da[_0x77da('0x1d')],_0x295bef=_0x5c07da[_0x77da('0x1d')]+_0x5c07da[_0x77da('0x1e')],_0x289887;if(_0x295bef>=_0x482b87){_0x295bef=_0x482b87;_0x289887=0xc8;}else{_0x289887=0xce;}_0x4ecd98[_0x77da('0x1a')](_0x289887);return _0x4ecd98['set']('Content-Range',_0x103e46+'-'+_0x295bef+'/'+_0x482b87)[_0x77da('0x1b')](_0x514016);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1f')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x20')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x21')](_0x58270c)[_0x77da('0x22')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x23')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x24')]({'plain':!![]});var _0x2d009f=_0x77da('0x25');return db[_0x77da('0x26')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x22')](function(){return _0x270318;});})[_0x77da('0x22')](function(){_0x27b6c7[_0x77da('0x1a')](0xcc)[_0x77da('0x19')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x18')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x1a')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=db[_0x77da('0x2a')]['rawAttributes'];_0x356bfb[_0x77da('0x2b')]=_[_0x77da('0x2c')](_0x1e7853);_0x356bfb[_0x77da('0x2d')]=_[_0x77da('0x2c')](_0x4eeb99[_0x77da('0x2d')]);_0x356bfb[_0x77da('0x2e')]=_[_0x77da('0x2f')](_0x356bfb[_0x77da('0x2b')],_0x356bfb['query']);_0x26f5a0['attributes']=_[_0x77da('0x2f')](_0x356bfb[_0x77da('0x2b')],qs['fields'](_0x4eeb99[_0x77da('0x2d')][_0x77da('0x30')]));_0x26f5a0[_0x77da('0x31')]=_0x26f5a0[_0x77da('0x31')][_0x77da('0x32')]?_0x26f5a0[_0x77da('0x31')]:_0x356bfb[_0x77da('0x2b')];if(!_0x4eeb99['query'][_0x77da('0x33')]('nolimit')){_0x26f5a0['limit']=qs['limit'](_0x4eeb99[_0x77da('0x2d')]['limit']);_0x26f5a0[_0x77da('0x1d')]=qs[_0x77da('0x1d')](_0x4eeb99[_0x77da('0x2d')][_0x77da('0x1d')]);}_0x26f5a0[_0x77da('0x34')]=qs[_0x77da('0x35')](_0x4eeb99[_0x77da('0x2d')]['sort']);_0x26f5a0[_0x77da('0x36')]=qs[_0x77da('0x2e')](_[_0x77da('0x37')](_0x4eeb99[_0x77da('0x2d')],_0x356bfb[_0x77da('0x2e')]));if(_0x4eeb99[_0x77da('0x2d')]['filter']){_0x26f5a0[_0x77da('0x36')]=_[_0x77da('0x38')](_0x26f5a0[_0x77da('0x36')],{'$or':_['map'](_0x1e7853,function(_0xc5f0b8){if(_0xc5f0b8['type']['key']!=='VIRTUAL'){var _0x59abca={};_0x59abca[_0xc5f0b8[_0x77da('0x39')]]={'$like':'%'+_0x4eeb99[_0x77da('0x2d')][_0x77da('0x3a')]+'%'};return _0x59abca;}})});}_0x26f5a0=_['merge']({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x5b7e63={'where':_0x26f5a0[_0x77da('0x36')]};return db['FaxQueue'][_0x77da('0x1c')](_0x5b7e63)[_0x77da('0x22')](function(_0x290667){_0x1d381b[_0x77da('0x1c')]=_0x290667;if(_0x4eeb99[_0x77da('0x2d')]['includeAll']){_0x26f5a0[_0x77da('0x3c')]=[{'all':!![]}];}return db[_0x77da('0x2a')][_0x77da('0x3d')](_0x26f5a0);})[_0x77da('0x22')](function(_0x32a9c4){_0x1d381b[_0x77da('0x3e')]=_0x32a9c4;return _0x1d381b;})['then'](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x3f')](handleError(_0x350b4e,null));};exports[_0x77da('0x40')]=function(_0x21de41,_0x2dfeca){var _0x7d11f9={'raw':!![],'where':{'id':_0x21de41['params']['id']}},_0x25f65f={};_0x25f65f[_0x77da('0x2b')]=_['keys'](db[_0x77da('0x2a')][_0x77da('0x41')]);_0x25f65f[_0x77da('0x2d')]=_['keys'](_0x21de41[_0x77da('0x2d')]);_0x25f65f[_0x77da('0x2e')]=_[_0x77da('0x2f')](_0x25f65f[_0x77da('0x2b')],_0x25f65f[_0x77da('0x2d')]);_0x7d11f9[_0x77da('0x31')]=_[_0x77da('0x2f')](_0x25f65f[_0x77da('0x2b')],qs[_0x77da('0x30')](_0x21de41['query'][_0x77da('0x30')]));_0x7d11f9[_0x77da('0x31')]=_0x7d11f9[_0x77da('0x31')][_0x77da('0x32')]?_0x7d11f9[_0x77da('0x31')]:_0x25f65f[_0x77da('0x2b')];if(_0x21de41['query']['includeAll']){_0x7d11f9[_0x77da('0x3c')]=[{'all':!![]}];}_0x7d11f9=_[_0x77da('0x38')]({},_0x7d11f9,_0x21de41[_0x77da('0x3b')]);return db[_0x77da('0x2a')][_0x77da('0x42')](_0x7d11f9)[_0x77da('0x22')](handleEntityNotFound(_0x2dfeca,null))['then'](respondWithResult(_0x2dfeca,null))[_0x77da('0x3f')](handleError(_0x2dfeca,null));};exports[_0x77da('0x43')]=function(_0x332f80,_0x73eaf8){return db['FaxQueue'][_0x77da('0x43')](_0x332f80['body'],{})['then'](function(_0x36263b){var _0x176f01=_0x332f80[_0x77da('0x44')][_0x77da('0x24')]({'plain':!![]});if(!_0x176f01)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x176f01[_0x77da('0x45')]===_0x77da('0x44')){var _0x56a3d9=_0x36263b[_0x77da('0x24')]({'plain':!![]});var _0x3c2d89='FaxQueues';return db[_0x77da('0x46')][_0x77da('0x42')]({'where':{'name':_0x3c2d89,'userProfileId':_0x176f01[_0x77da('0x47')]},'raw':!![]})[_0x77da('0x22')](function(_0xfc13ed){if(_0xfc13ed&&_0xfc13ed[_0x77da('0x48')]===0x0){return db[_0x77da('0x26')][_0x77da('0x43')]({'name':_0x56a3d9[_0x77da('0x27')],'resourceId':_0x56a3d9['id'],'type':_0xfc13ed[_0x77da('0x27')],'sectionId':_0xfc13ed['id']},{})['then'](function(){return _0x36263b;});}else{return _0x36263b;}})[_0x77da('0x3f')](function(_0x513017){logger[_0x77da('0x49')](_0x77da('0x4a'),_0x513017);throw _0x513017;});}return _0x36263b;})[_0x77da('0x22')](respondWithResult(_0x73eaf8,0xc9))[_0x77da('0x3f')](handleError(_0x73eaf8,null));};exports[_0x77da('0x21')]=function(_0x8b377d,_0x3a78d2){if(_0x8b377d['body']['id']){delete _0x8b377d[_0x77da('0x4b')]['id'];}return db[_0x77da('0x2a')][_0x77da('0x42')]({'where':{'id':_0x8b377d[_0x77da('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3a78d2,null))[_0x77da('0x22')](saveUpdates(_0x8b377d[_0x77da('0x4b')],null))[_0x77da('0x22')](respondWithResult(_0x3a78d2,null))['catch'](handleError(_0x3a78d2,null));};exports['destroy']=function(_0x332763,_0x3a0396){return db[_0x77da('0x2a')][_0x77da('0x42')]({'where':{'id':_0x332763[_0x77da('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3a0396,null))['then'](removeEntity(_0x3a0396,null))[_0x77da('0x3f')](handleError(_0x3a0396,null));};exports[_0x77da('0x4d')]=function(_0x52d13d,_0xf385e8){return db[_0x77da('0x2a')][_0x77da('0x4d')]()['then'](respondWithResult(_0xf385e8,null))[_0x77da('0x3f')](handleError(_0xf385e8,null));};exports[_0x77da('0x4e')]=function(_0x5a5309,_0x3ae855,_0x27aa8c){var _0xfb06b5={'raw':!![],'where':{}},_0x1a4bab={},_0x20cce1;return db[_0x77da('0x2a')][_0x77da('0x4f')]({'where':{'id':_0x5a5309[_0x77da('0x4c')]['id']}})[_0x77da('0x22')](handleEntityNotFound(_0x3ae855,null))['then'](function(_0x3076ea){if(_0x3076ea){_0x20cce1=_0x3076ea[_0x77da('0x24')]({'plain':!![]});_0x1a4bab[_0x77da('0x2b')]=_[_0x77da('0x2c')](db[_0x77da('0x50')][_0x77da('0x41')]);_0x1a4bab['query']=_[_0x77da('0x2c')](_0x5a5309[_0x77da('0x2d')]);_0x1a4bab[_0x77da('0x2e')]=_['intersection'](_0x1a4bab[_0x77da('0x2b')],_0x1a4bab[_0x77da('0x2d')]);_0xfb06b5[_0x77da('0x31')]=_[_0x77da('0x2f')](_0x1a4bab[_0x77da('0x2b')],qs[_0x77da('0x30')](_0x5a5309[_0x77da('0x2d')]['fields']));_0xfb06b5[_0x77da('0x31')]=_0xfb06b5['attributes'][_0x77da('0x32')]?_0xfb06b5[_0x77da('0x31')]:_0x1a4bab[_0x77da('0x2b')];if(!_0x5a5309['query'][_0x77da('0x33')](_0x77da('0x51'))){_0xfb06b5[_0x77da('0x1e')]=qs[_0x77da('0x1e')](_0x5a5309['query']['limit']);_0xfb06b5['offset']=qs[_0x77da('0x1d')](_0x5a5309[_0x77da('0x2d')][_0x77da('0x1d')]);}_0xfb06b5[_0x77da('0x34')]=qs[_0x77da('0x35')](_0x5a5309[_0x77da('0x2d')][_0x77da('0x35')]);_0xfb06b5[_0x77da('0x36')]=qs[_0x77da('0x2e')](_[_0x77da('0x37')](_0x5a5309['query'],_0x1a4bab[_0x77da('0x2e')]));_0xfb06b5[_0x77da('0x36')]['FaxQueueId']=_0x3076ea['id'];if(_0x5a5309['query'][_0x77da('0x3a')]){_0xfb06b5['where']=_[_0x77da('0x38')](_0xfb06b5[_0x77da('0x36')],{'$or':_[_0x77da('0x52')](_0xfb06b5['attributes'],function(_0x138b30){var _0xcba64c={};_0xcba64c[_0x138b30]={'$like':'%'+_0x5a5309[_0x77da('0x2d')][_0x77da('0x3a')]+'%'};return _0xcba64c;})});}_0xfb06b5=_[_0x77da('0x38')]({},_0xfb06b5,_0x5a5309['options']);return db[_0x77da('0x50')][_0x77da('0x3d')](_0xfb06b5);}})['then'](function(_0x3fdde1){if(_0x3fdde1){return db[_0x77da('0x53')][_0x77da('0x54')]({'where':{'id':_[_0x77da('0x52')](_0x3fdde1,_0x77da('0x55')),'role':_0x77da('0x56')},'attributes':['id',_0x77da('0x27'),'faxPause',_0x77da('0x57'),'createdAt']});}})[_0x77da('0x22')](function(_0xca2fbc){if(_0xca2fbc){return{'count':_0xca2fbc[_0x77da('0x1c')],'rows':_[_0x77da('0x52')](_0xca2fbc[_0x77da('0x3e')],function(_0x44538d){return{'membername':_0x44538d[_0x77da('0x27')],'UserId':_0x44538d['id'],'queue_name':_0x20cce1[_0x77da('0x27')],'FaxQueueId':_0x20cce1['id'],'interface':util[_0x77da('0x58')](_0x77da('0x59'),_0x77da('0x5a'),_0x44538d[_0x77da('0x27')]),'penalty':0x0,'paused':_0x44538d['faxPause'],'createdAt':_0x44538d[_0x77da('0x5b')],'updatedAt':_0x44538d[_0x77da('0x57')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x77da('0x22')](respondWithFilteredResult(_0x3ae855,_0xfb06b5))[_0x77da('0x3f')](handleError(_0x3ae855,null));};exports['getTeams']=function(_0x293b5c,_0x1e8d2c,_0x16c7b7){var _0x4f3479={};var _0x132d14={};var _0x4912d6;var _0x579314;return db[_0x77da('0x2a')][_0x77da('0x4f')]({'where':{'id':_0x293b5c[_0x77da('0x4c')]['id']}})[_0x77da('0x22')](handleEntityNotFound(_0x1e8d2c,null))[_0x77da('0x22')](function(_0x337621){if(_0x337621){_0x4912d6=_0x337621;_0x132d14[_0x77da('0x2b')]=_[_0x77da('0x2c')](db[_0x77da('0x5c')]['rawAttributes']);_0x132d14[_0x77da('0x2d')]=_[_0x77da('0x2c')](_0x293b5c[_0x77da('0x2d')]);_0x132d14[_0x77da('0x2e')]=_[_0x77da('0x2f')](_0x132d14['model'],_0x132d14[_0x77da('0x2d')]);_0x4f3479[_0x77da('0x31')]=_[_0x77da('0x2f')](_0x132d14[_0x77da('0x2b')],qs[_0x77da('0x30')](_0x293b5c[_0x77da('0x2d')][_0x77da('0x30')]));_0x4f3479[_0x77da('0x31')]=_0x4f3479[_0x77da('0x31')][_0x77da('0x32')]?_0x4f3479['attributes']:_0x132d14['model'];_0x4f3479['order']=qs[_0x77da('0x35')](_0x293b5c[_0x77da('0x2d')][_0x77da('0x35')]);_0x4f3479['where']=qs['filters'](_[_0x77da('0x37')](_0x293b5c[_0x77da('0x2d')],_0x132d14[_0x77da('0x2e')]));if(_0x293b5c[_0x77da('0x2d')][_0x77da('0x3a')]){_0x4f3479[_0x77da('0x36')]=_[_0x77da('0x38')](_0x4f3479[_0x77da('0x36')],{'$or':_[_0x77da('0x52')](_0x4f3479[_0x77da('0x31')],function(_0x27a462){var _0x4cbd40={};_0x4cbd40[_0x27a462]={'$like':'%'+_0x293b5c[_0x77da('0x2d')]['filter']+'%'};return _0x4cbd40;})});}_0x4f3479=_['merge']({},_0x4f3479,_0x293b5c[_0x77da('0x3b')]);return _0x4912d6['getTeams'](_0x4f3479);}})['then'](function(_0x22de60){if(_0x22de60){_0x579314=_0x22de60[_0x77da('0x32')];if(!_0x293b5c[_0x77da('0x2d')]['hasOwnProperty']('nolimit')){_0x4f3479[_0x77da('0x1e')]=qs['limit'](_0x293b5c[_0x77da('0x2d')][_0x77da('0x1e')]);_0x4f3479['offset']=qs[_0x77da('0x1d')](_0x293b5c['query'][_0x77da('0x1d')]);}return _0x4912d6[_0x77da('0x5d')](_0x4f3479);}})[_0x77da('0x22')](function(_0x256ca9){if(_0x256ca9){return _0x256ca9?{'count':_0x579314,'rows':_0x256ca9}:null;}})['then'](respondWithResult(_0x1e8d2c,null))[_0x77da('0x3f')](handleError(_0x1e8d2c,null));};exports[_0x77da('0x5e')]=function(_0x8454b3,_0x597ddc,_0x3fd7c8){var _0x227739=_0x8454b3[_0x77da('0x4b')]['teams'];return db['Team'][_0x77da('0x3d')]({'where':{'id':_[_0x77da('0x52')](_0x227739,'id')},'attributes':['id'],'include':[{'model':db[_0x77da('0x53')],'as':'Agents','attributes':['id','name','online','voicePause',_0x77da('0x5f')],'raw':!![]}]})[_0x77da('0x22')](function(_0x395fb8){if(_0x395fb8){var _0x4d459d=_[_0x77da('0x60')](_0x395fb8,function(_0x552cf6){var _0x39de26=_0x552cf6['get']({'plain':!![]});return _0x39de26[_0x77da('0x61')];});return db['FaxQueue'][_0x77da('0x42')]({'where':{'id':_0x8454b3[_0x77da('0x4c')]['id']}})['then'](function(_0x3e541e){return db[_0x77da('0x62')][_0x77da('0x63')](function(_0x8334ab){return _0x3e541e[_0x77da('0x5e')](_[_0x77da('0x52')](_0x227739,'id'),{'transaction':_0x8334ab})[_0x77da('0x22')](function(){return BPromise[_0x77da('0x64')](_0x4d459d,function(_0x3cbcc7){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x3cbcc7['id'],'FaxQueueId':_0x8454b3['params']['id']},'transaction':_0x8334ab});});})[_0x77da('0x22')](function(){_0x4d459d[_0x77da('0x65')](function(_0x81476e){socket['emit'](_0x77da('0x66'),{'UserId':_0x81476e['id'],'FaxQueueId':_0x3e541e['id']});});});});});}})['then'](respondWithStatusCode(_0x597ddc,null))['catch'](handleError(_0x597ddc,null));};exports[_0x77da('0x67')]=function(_0x297482,_0x5ee882,_0x47d98a){return db[_0x77da('0x5c')][_0x77da('0x3d')]({'where':{'id':_0x297482[_0x77da('0x2d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x77da('0x53')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x77da('0x22')](handleEntityNotFound(_0x5ee882,null))[_0x77da('0x22')](function(_0x112907){var _0x1ad741=_[_0x77da('0x52')](_0x112907,'id');var _0x363b7b=[];var _0x4fe785=[];var _0x304029=squel[_0x77da('0x68')]();_0x304029[_0x77da('0x39')](_0x77da('0x69'))['from'](_0x77da('0x6a'),'tq')['join'](_0x77da('0x6b'),'ut',_0x77da('0x6c'))[_0x77da('0x36')](_0x77da('0x6d'),_0x297482[_0x77da('0x4c')]['id']);for(var _0x2c3bcc=0x0;_0x2c3bcc<_0x112907[_0x77da('0x32')];_0x2c3bcc+=0x1){let _0x3d0583=_0x112907[_0x2c3bcc];for(var _0x4aec90=0x0;_0x4aec90<_0x3d0583[_0x77da('0x61')][_0x77da('0x32')];_0x4aec90+=0x1){let _0x275e4e=_0x3d0583[_0x77da('0x61')][_0x4aec90];var _0x384cff=_0x304029[_0x77da('0x6e')]();_0x384cff[_0x77da('0x36')](_0x77da('0x6f'),_0x275e4e['id']);_0x4fe785['push'](db['sequelize'][_0x77da('0x2d')](_0x384cff[_0x77da('0x70')](),{'type':db[_0x77da('0x62')]['QueryTypes'][_0x77da('0x71')]})['then'](function(_0x259366){if(_0x259366[_0x77da('0x32')]===0x1){return _0x275e4e['id'];}else{var _0x2214c7=_['every'](_['map'](_0x259366,_0x77da('0x72')),function(_0x48bd19){return _['includes'](_0x1ad741,_0x48bd19);});if(_0x2214c7){return _0x275e4e['id'];}}}));}}return BPromise[_0x77da('0x73')](_0x4fe785)[_0x77da('0x22')](function(_0x8532a2){_0x363b7b=_(_0x363b7b)[_0x77da('0x74')](_0x8532a2)['compact']()[_0x77da('0x75')]();return db['FaxQueue']['find']({'where':{'id':_0x297482['params']['id']}})[_0x77da('0x22')](function(_0x3a4050){return db[_0x77da('0x62')][_0x77da('0x63')](function(_0x19d036){return _0x3a4050[_0x77da('0x67')](_0x297482[_0x77da('0x2d')][_0x77da('0x76')],{'transaction':_0x19d036})['then'](function(){if(!_[_0x77da('0x77')](_0x363b7b)){return _0x3a4050[_0x77da('0x78')](_0x363b7b,{'transaction':_0x19d036});}})['then'](function(){_0x363b7b[_0x77da('0x65')](function(_0x5177ba){socket[_0x77da('0x79')](_0x77da('0x7a'),{'UserId':_0x5177ba,'FaxQueueId':_0x3a4050['id']});});});});});});})[_0x77da('0x22')](respondWithStatusCode(_0x5ee882,null))[_0x77da('0x3f')](handleError(_0x5ee882,null));};exports[_0x77da('0x7b')]=function(_0x5cb951,_0x26ccf8,_0x244f06){return db['FaxQueue'][_0x77da('0x42')]({'where':{'id':_0x5cb951['params']['id']}})['then'](handleEntityNotFound(_0x26ccf8,null))[_0x77da('0x22')](function(_0x502581){if(_0x502581){return _0x502581['addAgents'](_0x5cb951[_0x77da('0x4b')][_0x77da('0x76')],_[_0x77da('0x7c')](_0x5cb951[_0x77da('0x4b')],['ids','id'])||{})[_0x77da('0x7d')](function(_0x540ab8){for(var _0x199a0b=0x0;_0x199a0b<_0x5cb951['body']['ids'][_0x77da('0x32')];_0x199a0b+=0x1){socket['emit'](_0x77da('0x66'),{'UserId':_0x5cb951[_0x77da('0x4b')]['ids'][_0x199a0b],'FaxQueueId':_0x5cb951[_0x77da('0x4c')]['id']});}return _0x540ab8;});}})[_0x77da('0x22')](respondWithResult(_0x26ccf8,null))[_0x77da('0x3f')](handleError(_0x26ccf8,null));};exports['removeAgents']=function(_0x5adafe,_0x364b78,_0x41b6d7){return db[_0x77da('0x2a')]['find']({'where':{'id':_0x5adafe[_0x77da('0x4c')]['id']}})['then'](handleEntityNotFound(_0x364b78,null))[_0x77da('0x22')](function(_0x15a94a){if(_0x15a94a){return _0x15a94a[_0x77da('0x78')](_0x5adafe[_0x77da('0x2d')][_0x77da('0x76')])[_0x77da('0x22')](function(){if(_[_0x77da('0x7e')](_0x5adafe[_0x77da('0x2d')][_0x77da('0x76')])){for(var _0x2dee4d=0x0;_0x2dee4d<_0x5adafe[_0x77da('0x2d')][_0x77da('0x76')][_0x77da('0x32')];_0x2dee4d+=0x1){socket['emit'](_0x77da('0x7a'),{'UserId':Number(_0x5adafe['query']['ids'][_0x2dee4d]),'FaxQueueId':Number(_0x5adafe[_0x77da('0x4c')]['id'])});}}else{socket['emit'](_0x77da('0x7a'),{'UserId':Number(_0x5adafe[_0x77da('0x2d')]['ids']),'FaxQueueId':Number(_0x5adafe[_0x77da('0x4c')]['id'])});}});}})[_0x77da('0x22')](respondWithStatusCode(_0x364b78,null))[_0x77da('0x3f')](handleError(_0x364b78,null));};exports[_0x77da('0x7f')]=function(_0x2d2552,_0x44d2fd,_0xf31a48){var _0x36a6b5={};var _0xce5548={};var _0x2e7460;var _0x41d7e2;return db[_0x77da('0x2a')][_0x77da('0x4f')]({'where':{'id':_0x2d2552['params']['id']}})[_0x77da('0x22')](handleEntityNotFound(_0x44d2fd,null))[_0x77da('0x22')](function(_0x5bd170){if(_0x5bd170){_0x2e7460=_0x5bd170;_0xce5548['model']=_[_0x77da('0x2c')](db['User'][_0x77da('0x41')]);_0xce5548['query']=_[_0x77da('0x2c')](_0x2d2552['query']);_0xce5548[_0x77da('0x2e')]=_[_0x77da('0x2f')](_0xce5548[_0x77da('0x2b')],_0xce5548['query']);_0x36a6b5['attributes']=_[_0x77da('0x2f')](_0xce5548[_0x77da('0x2b')],qs['fields'](_0x2d2552[_0x77da('0x2d')][_0x77da('0x30')]));_0x36a6b5[_0x77da('0x31')]=_0x36a6b5[_0x77da('0x31')][_0x77da('0x32')]?_0x36a6b5[_0x77da('0x31')]:_0xce5548[_0x77da('0x2b')];_0x36a6b5[_0x77da('0x34')]=qs[_0x77da('0x35')](_0x2d2552[_0x77da('0x2d')][_0x77da('0x35')]);_0x36a6b5[_0x77da('0x36')]=qs[_0x77da('0x2e')](_['pick'](_0x2d2552[_0x77da('0x2d')],_0xce5548['filters']));if(_0x2d2552['query'][_0x77da('0x3a')]){_0x36a6b5[_0x77da('0x36')]=_[_0x77da('0x38')](_0x36a6b5[_0x77da('0x36')],{'$or':_['map'](_0x36a6b5[_0x77da('0x31')],function(_0x20af30){var _0x5cd4fa={};_0x5cd4fa[_0x20af30]={'$like':'%'+_0x2d2552[_0x77da('0x2d')][_0x77da('0x3a')]+'%'};return _0x5cd4fa;})});}_0x36a6b5=_[_0x77da('0x38')]({},_0x36a6b5,_0x2d2552[_0x77da('0x3b')]);return _0x2e7460[_0x77da('0x7f')](_0x36a6b5);}})[_0x77da('0x22')](function(_0x56c44a){if(_0x56c44a){_0x41d7e2=_0x56c44a[_0x77da('0x32')];if(!_0x2d2552['query'][_0x77da('0x33')](_0x77da('0x51'))){_0x36a6b5['limit']=qs[_0x77da('0x1e')](_0x2d2552['query']['limit']);_0x36a6b5[_0x77da('0x1d')]=qs[_0x77da('0x1d')](_0x2d2552[_0x77da('0x2d')]['offset']);}return _0x2e7460['getAgents'](_0x36a6b5);}})['then'](function(_0x11d6ae){if(_0x11d6ae){return _0x11d6ae?{'count':_0x41d7e2,'rows':_0x11d6ae}:null;}})[_0x77da('0x22')](respondWithResult(_0x44d2fd,null))[_0x77da('0x3f')](handleError(_0x44d2fd,null));};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js
index da4f2c5..47fa88f 100644
--- a/server/api/faxQueue/faxQueue.events.js
+++ b/server/api/faxQueue/faxQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf873=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','FaxQueue'];(function(_0x1a3243,_0x201872){var _0x33f2ca=function(_0x59d32e){while(--_0x59d32e){_0x1a3243['push'](_0x1a3243['shift']());}};_0x33f2ca(++_0x201872);}(_0xf873,0xb2));var _0x3f87=function(_0x982d77,_0x5e9b3d){_0x982d77=_0x982d77-0x0;var _0x1f7c16=_0xf873[_0x982d77];return _0x1f7c16;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x3f87('0x0'))['db'][_0x3f87('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3f87('0x2')](0x0);var events={'afterCreate':_0x3f87('0x3'),'afterUpdate':_0x3f87('0x4'),'afterDestroy':_0x3f87('0x5')};function emitEvent(_0x2fbb4f){return function(_0x1d68dd,_0x3c80d6,_0x4a909e){FaxQueueEvents[_0x3f87('0x6')](_0x2fbb4f+':'+_0x1d68dd['id'],_0x1d68dd);FaxQueueEvents[_0x3f87('0x6')](_0x2fbb4f,_0x1d68dd);_0x4a909e(null);};}for(var e in events){if(events[_0x3f87('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x3f87('0x8')]=FaxQueueEvents;
\ No newline at end of file
+var _0x5636=['hook','exports','events','../../mysqldb','update','remove','emit','hasOwnProperty'];(function(_0x1e9dcc,_0x461662){var _0x49637d=function(_0x872eeb){while(--_0x872eeb){_0x1e9dcc['push'](_0x1e9dcc['shift']());}};_0x49637d(++_0x461662);}(_0x5636,0x102));var _0x6563=function(_0x2cd4b0,_0x2a3a14){_0x2cd4b0=_0x2cd4b0-0x0;var _0x4b1348=_0x5636[_0x2cd4b0];return _0x4b1348;};'use strict';var EventEmitter=require(_0x6563('0x0'));var FaxQueue=require(_0x6563('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6563('0x2'),'afterDestroy':_0x6563('0x3')};function emitEvent(_0x115cc1){return function(_0x4ac653,_0x166a58,_0x12f62f){FaxQueueEvents[_0x6563('0x4')](_0x115cc1+':'+_0x4ac653['id'],_0x4ac653);FaxQueueEvents[_0x6563('0x4')](_0x115cc1,_0x4ac653);_0x12f62f(null);};}for(var e in events){if(events[_0x6563('0x5')](e)){var event=events[e];FaxQueue[_0x6563('0x6')](e,emitEvent(event));}}module[_0x6563('0x7')]=FaxQueueEvents;
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js
index b465bc8..63fd11d 100644
--- a/server/api/faxQueue/faxQueue.model.js
+++ b/server/api/faxQueue/faxQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['bluebird','request-promise','path','./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','api','moment'];(function(_0x5c5a69,_0x3eed00){var _0x13bb8a=function(_0x37a48d){while(--_0x37a48d){_0x5c5a69['push'](_0x5c5a69['shift']());}};_0x13bb8a(++_0x3eed00);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1c3bb6,_0x33bac8){_0x1c3bb6=_0x1c3bb6-0x0;var _0x440675=_0x5f2f[_0x1c3bb6];return _0x440675;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','../../config/logger'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xb10b,0x12a));var _0xbb10=function(_0x405778,_0xa4dd3b){_0x405778=_0x405778-0x0;var _0x341735=_0xb10b[_0x405778];return _0x341735;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('FaxQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js
index 764acb5..25d34f1 100644
--- a/server/api/faxQueue/faxQueue.rpc.js
+++ b/server/api/faxQueue/faxQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf54=['request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','map','model','include','then','ShowFaxQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','info'];(function(_0x2fd83f,_0x3d0c4f){var _0x3f0cfd=function(_0xdcccb9){while(--_0xdcccb9){_0x2fd83f['push'](_0x2fd83f['shift']());}};_0x3f0cfd(++_0x3d0c4f);}(_0xaf54,0x1dc));var _0x4af5=function(_0x5090d4,_0x1950a7){_0x5090d4=_0x5090d4-0x0;var _0x56c310=_0xaf54[_0x5090d4];return _0x56c310;};'use strict';var _=require(_0x4af5('0x0'));var util=require(_0x4af5('0x1'));var moment=require(_0x4af5('0x2'));var BPromise=require('bluebird');var rs=require(_0x4af5('0x3'));var fs=require('fs');var Redis=require(_0x4af5('0x4'));var db=require(_0x4af5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4af5('0x6'));var config=require(_0x4af5('0x7'));var jayson=require(_0x4af5('0x8'));var client=jayson[_0x4af5('0x9')][_0x4af5('0xa')]({'port':0x232a});config[_0x4af5('0xb')]=_[_0x4af5('0xc')](config[_0x4af5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4af5('0xd'))(new Redis(config[_0x4af5('0xb')]));require(_0x4af5('0xe'))[_0x4af5('0xf')](socket);function respondWithRpcPromise(_0x1c72e8,_0x3be486,_0x5aab45){return new BPromise(function(_0x29a4d7,_0x18a70b){return client[_0x4af5('0x10')](_0x1c72e8,_0x5aab45)['then'](function(_0x25bdcc){logger[_0x4af5('0x11')]('FaxQueue,\x20%s,\x20%s',_0x3be486,_0x4af5('0x12'));logger[_0x4af5('0x13')](_0x4af5('0x14'),_0x3be486,'request\x20sent',JSON[_0x4af5('0x15')](_0x25bdcc));if(_0x25bdcc[_0x4af5('0x16')]){if(_0x25bdcc['error']['code']===0x1f4){logger[_0x4af5('0x16')](_0x4af5('0x17'),_0x3be486,_0x25bdcc[_0x4af5('0x16')][_0x4af5('0x18')]);return _0x18a70b(_0x25bdcc[_0x4af5('0x16')]['message']);}logger[_0x4af5('0x16')]('FaxQueue,\x20%s,\x20%s',_0x3be486,_0x25bdcc['error'][_0x4af5('0x18')]);return _0x29a4d7(_0x25bdcc[_0x4af5('0x16')][_0x4af5('0x18')]);}else{logger[_0x4af5('0x11')]('FaxQueue,\x20%s,\x20%s',_0x3be486,_0x4af5('0x12'));_0x29a4d7(_0x25bdcc['result'][_0x4af5('0x18')]);}})[_0x4af5('0x19')](function(_0x35abbb){logger[_0x4af5('0x16')]('FaxQueue,\x20%s,\x20%s',_0x3be486,_0x35abbb);_0x18a70b(_0x35abbb);});});}exports[_0x4af5('0x1a')]=function(_0x429944){var _0x598395=this;return new Promise(function(_0x56ea7f,_0x2eec34){return db['FaxQueue'][_0x4af5('0x1b')]({'raw':_0x429944[_0x4af5('0x1c')]?_0x429944['options'][_0x4af5('0x1d')]===undefined?!![]:![]:!![],'where':_0x429944[_0x4af5('0x1c')]?_0x429944[_0x4af5('0x1c')][_0x4af5('0x1e')]||null:null,'attributes':_0x429944[_0x4af5('0x1c')]?_0x429944[_0x4af5('0x1c')][_0x4af5('0x1f')]||null:null,'limit':_0x429944[_0x4af5('0x1c')]?_0x429944[_0x4af5('0x1c')][_0x4af5('0x20')]||null:null,'include':_0x429944['options']?_0x429944['options']['include']?_[_0x4af5('0x21')](_0x429944['options']['include'],function(_0x3f1fec){return{'model':db[_0x3f1fec[_0x4af5('0x22')]],'as':_0x3f1fec['as'],'attributes':_0x3f1fec[_0x4af5('0x1f')],'include':_0x3f1fec[_0x4af5('0x23')]?_['map'](_0x3f1fec['include'],function(_0x13bd1f){return{'model':db[_0x13bd1f[_0x4af5('0x22')]],'as':_0x13bd1f['as'],'attributes':_0x13bd1f[_0x4af5('0x1f')],'include':_0x13bd1f['include']?_[_0x4af5('0x21')](_0x13bd1f['include'],function(_0x25fc16){return{'model':db[_0x25fc16[_0x4af5('0x22')]],'as':_0x25fc16['as'],'attributes':_0x25fc16['attributes']};}):[]};}):[]};}):[]:[]})[_0x4af5('0x24')](function(_0xccab4b){logger['info']('GetFaxQueue',_0x429944);logger['debug'](_0x4af5('0x1a'),_0x429944,JSON['stringify'](_0xccab4b));_0x56ea7f(_0xccab4b);})['catch'](function(_0x307cfe){logger[_0x4af5('0x16')](_0x4af5('0x1a'),_0x307cfe[_0x4af5('0x18')],_0x429944);_0x2eec34(_0x598395[_0x4af5('0x16')](0x1f4,_0x307cfe['message']));});});};exports[_0x4af5('0x25')]=function(_0x1f3215){var _0x16c041=this;return new Promise(function(_0x4a0c0f,_0x338486){return db['FaxQueue']['find']({'raw':_0x1f3215[_0x4af5('0x1c')]?_0x1f3215[_0x4af5('0x1c')][_0x4af5('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f3215[_0x4af5('0x1c')]?_0x1f3215[_0x4af5('0x1c')][_0x4af5('0x1e')]||null:null,'attributes':_0x1f3215['options']?_0x1f3215[_0x4af5('0x1c')][_0x4af5('0x1f')]||null:null,'include':_0x1f3215[_0x4af5('0x1c')]?_0x1f3215['options'][_0x4af5('0x23')]?_['map'](_0x1f3215[_0x4af5('0x1c')][_0x4af5('0x23')],function(_0xa59128){return{'model':db[_0xa59128[_0x4af5('0x22')]],'as':_0xa59128['as'],'attributes':_0xa59128[_0x4af5('0x1f')],'include':_0xa59128[_0x4af5('0x23')]?_[_0x4af5('0x21')](_0xa59128[_0x4af5('0x23')],function(_0xd778a6){return{'model':db[_0xd778a6[_0x4af5('0x22')]],'as':_0xd778a6['as'],'attributes':_0xd778a6[_0x4af5('0x1f')],'include':_0xd778a6[_0x4af5('0x23')]?_[_0x4af5('0x21')](_0xd778a6['include'],function(_0x953093){return{'model':db[_0x953093[_0x4af5('0x22')]],'as':_0x953093['as'],'attributes':_0x953093[_0x4af5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4af5('0x24')](function(_0x785567){logger[_0x4af5('0x11')](_0x4af5('0x25'),_0x1f3215);logger['debug'](_0x4af5('0x25'),_0x1f3215,JSON[_0x4af5('0x15')](_0x785567));_0x4a0c0f(_0x785567);})[_0x4af5('0x19')](function(_0x47e910){logger['error'](_0x4af5('0x25'),_0x47e910[_0x4af5('0x18')],_0x1f3215);_0x338486(_0x16c041['error'](0x1f4,_0x47e910[_0x4af5('0x18')]));});});};
\ No newline at end of file
+var _0x06ed=['GetFaxQueue','debug','stringify','FaxQueue','find','ShowFaxQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','findAll','options','raw','where','limit','include','map','model','attributes'];(function(_0x2be8bb,_0x444b42){var _0xfa418a=function(_0x2e5b92){while(--_0x2e5b92){_0x2be8bb['push'](_0x2be8bb['shift']());}};_0xfa418a(++_0x444b42);}(_0x06ed,0x18c));var _0xd06e=function(_0x578824,_0x344e07){_0x578824=_0x578824-0x0;var _0x62e5bf=_0x06ed[_0x578824];return _0x62e5bf;};'use strict';var _=require(_0xd06e('0x0'));var util=require(_0xd06e('0x1'));var moment=require(_0xd06e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd06e('0x3'));var db=require(_0xd06e('0x4'))['db'];var utils=require(_0xd06e('0x5'));var logger=require(_0xd06e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd06e('0x7'));var client=jayson[_0xd06e('0x8')][_0xd06e('0x9')]({'port':0x232a});config[_0xd06e('0xa')]=_[_0xd06e('0xb')](config[_0xd06e('0xa')],{'host':_0xd06e('0xc'),'port':0x18eb});var socket=require(_0xd06e('0xd'))(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x42765d,_0x1f3c8b,_0x11bd57){return new BPromise(function(_0x35b370,_0x53c22d){return client[_0xd06e('0xe')](_0x42765d,_0x11bd57)[_0xd06e('0xf')](function(_0x3739af){logger[_0xd06e('0x10')](_0xd06e('0x11'),_0x1f3c8b,_0xd06e('0x12'));logger['debug'](_0xd06e('0x13'),_0x1f3c8b,_0xd06e('0x12'),JSON['stringify'](_0x3739af));if(_0x3739af[_0xd06e('0x14')]){if(_0x3739af[_0xd06e('0x14')]['code']===0x1f4){logger[_0xd06e('0x14')](_0xd06e('0x11'),_0x1f3c8b,_0x3739af[_0xd06e('0x14')][_0xd06e('0x15')]);return _0x53c22d(_0x3739af['error'][_0xd06e('0x15')]);}logger[_0xd06e('0x14')]('FaxQueue,\x20%s,\x20%s',_0x1f3c8b,_0x3739af[_0xd06e('0x14')][_0xd06e('0x15')]);return _0x35b370(_0x3739af[_0xd06e('0x14')]['message']);}else{logger[_0xd06e('0x10')](_0xd06e('0x11'),_0x1f3c8b,_0xd06e('0x12'));_0x35b370(_0x3739af[_0xd06e('0x16')]['message']);}})[_0xd06e('0x17')](function(_0x167b65){logger[_0xd06e('0x14')]('FaxQueue,\x20%s,\x20%s',_0x1f3c8b,_0x167b65);_0x53c22d(_0x167b65);});});}exports['GetFaxQueue']=function(_0xa3f1d3){var _0x1986fb=this;return new Promise(function(_0x1de4ec,_0x308b3c){return db['FaxQueue'][_0xd06e('0x18')]({'raw':_0xa3f1d3[_0xd06e('0x19')]?_0xa3f1d3[_0xd06e('0x19')][_0xd06e('0x1a')]===undefined?!![]:![]:!![],'where':_0xa3f1d3[_0xd06e('0x19')]?_0xa3f1d3[_0xd06e('0x19')][_0xd06e('0x1b')]||null:null,'attributes':_0xa3f1d3['options']?_0xa3f1d3[_0xd06e('0x19')]['attributes']||null:null,'limit':_0xa3f1d3[_0xd06e('0x19')]?_0xa3f1d3[_0xd06e('0x19')][_0xd06e('0x1c')]||null:null,'include':_0xa3f1d3[_0xd06e('0x19')]?_0xa3f1d3['options'][_0xd06e('0x1d')]?_[_0xd06e('0x1e')](_0xa3f1d3['options'][_0xd06e('0x1d')],function(_0x391700){return{'model':db[_0x391700[_0xd06e('0x1f')]],'as':_0x391700['as'],'attributes':_0x391700[_0xd06e('0x20')],'include':_0x391700[_0xd06e('0x1d')]?_[_0xd06e('0x1e')](_0x391700[_0xd06e('0x1d')],function(_0xb1ef42){return{'model':db[_0xb1ef42[_0xd06e('0x1f')]],'as':_0xb1ef42['as'],'attributes':_0xb1ef42['attributes'],'include':_0xb1ef42[_0xd06e('0x1d')]?_[_0xd06e('0x1e')](_0xb1ef42[_0xd06e('0x1d')],function(_0x4a4c91){return{'model':db[_0x4a4c91[_0xd06e('0x1f')]],'as':_0x4a4c91['as'],'attributes':_0x4a4c91[_0xd06e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd06e('0xf')](function(_0x9d4080){logger[_0xd06e('0x10')](_0xd06e('0x21'),_0xa3f1d3);logger[_0xd06e('0x22')](_0xd06e('0x21'),_0xa3f1d3,JSON[_0xd06e('0x23')](_0x9d4080));_0x1de4ec(_0x9d4080);})[_0xd06e('0x17')](function(_0x4360d4){logger[_0xd06e('0x14')](_0xd06e('0x21'),_0x4360d4[_0xd06e('0x15')],_0xa3f1d3);_0x308b3c(_0x1986fb['error'](0x1f4,_0x4360d4['message']));});});};exports['ShowFaxQueue']=function(_0x24075f){var _0x299756=this;return new Promise(function(_0x18bd2c,_0x2a5ec2){return db[_0xd06e('0x24')][_0xd06e('0x25')]({'raw':_0x24075f[_0xd06e('0x19')]?_0x24075f[_0xd06e('0x19')][_0xd06e('0x1a')]===undefined?!![]:![]:!![],'where':_0x24075f[_0xd06e('0x19')]?_0x24075f[_0xd06e('0x19')][_0xd06e('0x1b')]||null:null,'attributes':_0x24075f[_0xd06e('0x19')]?_0x24075f[_0xd06e('0x19')]['attributes']||null:null,'include':_0x24075f[_0xd06e('0x19')]?_0x24075f[_0xd06e('0x19')][_0xd06e('0x1d')]?_['map'](_0x24075f['options'][_0xd06e('0x1d')],function(_0x487d33){return{'model':db[_0x487d33[_0xd06e('0x1f')]],'as':_0x487d33['as'],'attributes':_0x487d33[_0xd06e('0x20')],'include':_0x487d33['include']?_[_0xd06e('0x1e')](_0x487d33[_0xd06e('0x1d')],function(_0x343d45){return{'model':db[_0x343d45[_0xd06e('0x1f')]],'as':_0x343d45['as'],'attributes':_0x343d45[_0xd06e('0x20')],'include':_0x343d45['include']?_[_0xd06e('0x1e')](_0x343d45['include'],function(_0x3e7211){return{'model':db[_0x3e7211[_0xd06e('0x1f')]],'as':_0x3e7211['as'],'attributes':_0x3e7211[_0xd06e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd06e('0xf')](function(_0x5ae90d){logger['info'](_0xd06e('0x26'),_0x24075f);logger[_0xd06e('0x22')](_0xd06e('0x26'),_0x24075f,JSON[_0xd06e('0x23')](_0x5ae90d));_0x18bd2c(_0x5ae90d);})[_0xd06e('0x17')](function(_0xf0f4b2){logger[_0xd06e('0x14')](_0xd06e('0x26'),_0xf0f4b2[_0xd06e('0x15')],_0x24075f);_0x2a5ec2(_0x299756[_0xd06e('0x14')](0x1f4,_0xf0f4b2[_0xd06e('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js
index ac8965d..5479e0a 100644
--- a/server/api/faxQueue/faxQueue.socket.js
+++ b/server/api/faxQueue/faxQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf7cf=['register','length','remove','update','emit','removeListener'];(function(_0x200a2e,_0x57d4b3){var _0x8985b6=function(_0x26f0ed){while(--_0x26f0ed){_0x200a2e['push'](_0x200a2e['shift']());}};_0x8985b6(++_0x57d4b3);}(_0xf7cf,0x8c));var _0xff7c=function(_0x15bc2f,_0x25e563){_0x15bc2f=_0x15bc2f-0x0;var _0x574008=_0xf7cf[_0x15bc2f];return _0x574008;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0xff7c('0x0'),_0xff7c('0x1')];function createListener(_0xb0cc3a,_0xb49978){return function(_0x11e6b6){_0xb49978[_0xff7c('0x2')](_0xb0cc3a,_0x11e6b6);};}function removeListener(_0x1eae69,_0x5c7c1a){return function(){FaxQueueEvents[_0xff7c('0x3')](_0x1eae69,_0x5c7c1a);};}exports[_0xff7c('0x4')]=function(_0x15059f){for(var _0xc7e3a7=0x0,_0x4a7002=events[_0xff7c('0x5')];_0xc7e3a7<_0x4a7002;_0xc7e3a7++){var _0x37d9c5=events[_0xc7e3a7];var _0x3f4dea=createListener('faxQueue:'+_0x37d9c5,_0x15059f);FaxQueueEvents['on'](_0x37d9c5,_0x3f4dea);}};
\ No newline at end of file
+var _0x8406=['save','remove','update','emit','removeListener','length','faxQueue:'];(function(_0x1f0d71,_0x46505c){var _0x24bac9=function(_0x47857c){while(--_0x47857c){_0x1f0d71['push'](_0x1f0d71['shift']());}};_0x24bac9(++_0x46505c);}(_0x8406,0x1f1));var _0x6840=function(_0x1ac939,_0x1d9453){_0x1ac939=_0x1ac939-0x0;var _0x26c41e=_0x8406[_0x1ac939];return _0x26c41e;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x6840('0x0'),_0x6840('0x1'),_0x6840('0x2')];function createListener(_0x4e9c87,_0x3f11fa){return function(_0x1b1bdc){_0x3f11fa[_0x6840('0x3')](_0x4e9c87,_0x1b1bdc);};}function removeListener(_0x3b8441,_0x5d6e69){return function(){FaxQueueEvents[_0x6840('0x4')](_0x3b8441,_0x5d6e69);};}exports['register']=function(_0x20857b){for(var _0xa153a5=0x0,_0x240af3=events[_0x6840('0x5')];_0xa153a5<_0x240af3;_0xa153a5++){var _0x4d8cd7=events[_0xa153a5];var _0x1f7535=createListener(_0x6840('0x6')+_0x4d8cd7,_0x20857b);FaxQueueEvents['on'](_0x4d8cd7,_0x1f7535);}};
\ No newline at end of file
diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js
index 2533dbf..fc8c08d 100644
--- a/server/api/faxQueue/index.js
+++ b/server/api/faxQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x54a4=['removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./faxQueue.controller','isAuthenticated','get','describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','addAgents','put','destroy','removeTeams','delete'];(function(_0x34331d,_0x1aabf1){var _0x2e1300=function(_0x46dbaa){while(--_0x46dbaa){_0x34331d['push'](_0x34331d['shift']());}};_0x2e1300(++_0x1aabf1);}(_0x54a4,0x18a));var _0x454a=function(_0x203b52,_0x50d5a3){_0x203b52=_0x203b52-0x0;var _0x48e947=_0x54a4[_0x203b52];return _0x48e947;};'use strict';var multer=require(_0x454a('0x0'));var util=require(_0x454a('0x1'));var path=require(_0x454a('0x2'));var timeout=require(_0x454a('0x3'));var express=require(_0x454a('0x4'));var router=express['Router']();var auth=require(_0x454a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x454a('0x6'));var controller=require(_0x454a('0x7'));router['get']('/',auth[_0x454a('0x8')](),controller['index']);router[_0x454a('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x454a('0xa')]);router['get'](_0x454a('0xb'),auth['isAuthenticated'](),controller[_0x454a('0xc')]);router[_0x454a('0x9')](_0x454a('0xd'),auth[_0x454a('0x8')](),controller['getMembers']);router[_0x454a('0x9')](_0x454a('0xe'),auth[_0x454a('0x8')](),controller[_0x454a('0xf')]);router[_0x454a('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x454a('0x10')]);router['post']('/',auth[_0x454a('0x8')](),controller[_0x454a('0x11')]);router[_0x454a('0x12')](_0x454a('0xe'),auth[_0x454a('0x8')](),controller[_0x454a('0x13')]);router['post'](_0x454a('0x14'),auth['isAuthenticated'](),controller[_0x454a('0x15')]);router[_0x454a('0x16')](_0x454a('0xb'),auth[_0x454a('0x8')](),controller['update']);router['delete'](_0x454a('0xb'),auth[_0x454a('0x8')](),controller[_0x454a('0x17')]);router['delete'](_0x454a('0xe'),auth['isAuthenticated'](),controller[_0x454a('0x18')]);router[_0x454a('0x19')](_0x454a('0x14'),auth[_0x454a('0x8')](),controller[_0x454a('0x1a')]);module[_0x454a('0x1b')]=router;
\ No newline at end of file
+var _0xb906=['express','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout'];(function(_0x5a64a3,_0x5ada15){var _0x16f569=function(_0x5cf171){while(--_0x5cf171){_0x5a64a3['push'](_0x5a64a3['shift']());}};_0x16f569(++_0x5ada15);}(_0xb906,0x8e));var _0x6b90=function(_0x3cafd5,_0x1da46e){_0x3cafd5=_0x3cafd5-0x0;var _0x4e5452=_0xb906[_0x3cafd5];return _0x4e5452;};'use strict';var multer=require(_0x6b90('0x0'));var util=require('util');var path=require(_0x6b90('0x1'));var timeout=require(_0x6b90('0x2'));var express=require(_0x6b90('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6b90('0x4'));var config=require('../../config/environment');var controller=require(_0x6b90('0x5'));router[_0x6b90('0x6')]('/',auth[_0x6b90('0x7')](),controller[_0x6b90('0x8')]);router[_0x6b90('0x6')](_0x6b90('0x9'),auth[_0x6b90('0x7')](),controller[_0x6b90('0xa')]);router[_0x6b90('0x6')]('/:id',auth[_0x6b90('0x7')](),controller['show']);router[_0x6b90('0x6')](_0x6b90('0xb'),auth[_0x6b90('0x7')](),controller[_0x6b90('0xc')]);router[_0x6b90('0x6')](_0x6b90('0xd'),auth[_0x6b90('0x7')](),controller[_0x6b90('0xe')]);router['get'](_0x6b90('0xf'),auth[_0x6b90('0x7')](),controller[_0x6b90('0x10')]);router[_0x6b90('0x11')]('/',auth[_0x6b90('0x7')](),controller[_0x6b90('0x12')]);router['post'](_0x6b90('0xd'),auth[_0x6b90('0x7')](),controller[_0x6b90('0x13')]);router['post']('/:id/users',auth[_0x6b90('0x7')](),controller[_0x6b90('0x14')]);router[_0x6b90('0x15')]('/:id',auth[_0x6b90('0x7')](),controller[_0x6b90('0x16')]);router[_0x6b90('0x17')](_0x6b90('0x18'),auth[_0x6b90('0x7')](),controller[_0x6b90('0x19')]);router['delete'](_0x6b90('0xd'),auth[_0x6b90('0x7')](),controller[_0x6b90('0x1a')]);router[_0x6b90('0x17')](_0x6b90('0xf'),auth[_0x6b90('0x7')](),controller[_0x6b90('0x1b')]);module[_0x6b90('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js
index a780f5a..d0a127b 100644
--- a/server/api/faxQueueReport/faxQueueReport.attributes.js
+++ b/server/api/faxQueueReport/faxQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x43dd=['moment','sequelize','exports','STRING','DATE'];(function(_0x288de3,_0x2c5398){var _0x31b661=function(_0xbb99b4){while(--_0xbb99b4){_0x288de3['push'](_0x288de3['shift']());}};_0x31b661(++_0x2c5398);}(_0x43dd,0x11d));var _0xd43d=function(_0xeac928,_0x253cd6){_0xeac928=_0xeac928-0x0;var _0x345cff=_0x43dd[_0xeac928];return _0x345cff;};'use strict';var moment=require(_0xd43d('0x0'));var Sequelize=require(_0xd43d('0x1'));module[_0xd43d('0x2')]={'uniqueid':{'type':Sequelize[_0xd43d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd43d('0x3')]},'joinAt':{'type':Sequelize[_0xd43d('0x4')]},'leaveAt':{'type':Sequelize[_0xd43d('0x4')]},'acceptAt':{'type':Sequelize[_0xd43d('0x4')]},'exitAt':{'type':Sequelize[_0xd43d('0x4')]},'reason':{'type':Sequelize[_0xd43d('0x3')]}};
\ No newline at end of file
+var _0x5701=['DATE','moment','exports','STRING'];(function(_0x337d75,_0x32b32d){var _0x1251e7=function(_0x438259){while(--_0x438259){_0x337d75['push'](_0x337d75['shift']());}};_0x1251e7(++_0x32b32d);}(_0x5701,0x7d));var _0x1570=function(_0x3a0825,_0x2d6d6d){_0x3a0825=_0x3a0825-0x0;var _0x5a69de=_0x5701[_0x3a0825];return _0x5a69de;};'use strict';var moment=require(_0x1570('0x0'));var Sequelize=require('sequelize');module[_0x1570('0x1')]={'uniqueid':{'type':Sequelize[_0x1570('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1570('0x2')]},'joinAt':{'type':Sequelize[_0x1570('0x3')]},'leaveAt':{'type':Sequelize[_0x1570('0x3')]},'acceptAt':{'type':Sequelize[_0x1570('0x3')]},'exitAt':{'type':Sequelize[_0x1570('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js
index 3ec9ebd..5e50161 100644
--- a/server/api/faxQueueReport/faxQueueReport.controller.js
+++ b/server/api/faxQueueReport/faxQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7097=['findAll','rows','catch','show','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','FaxQueueReport','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','merge','where','map','type','key','VIRTUAL','field','includeAll','include'];(function(_0x306aa3,_0x521e99){var _0x2d1a2a=function(_0x315428){while(--_0x315428){_0x306aa3['push'](_0x306aa3['shift']());}};_0x2d1a2a(++_0x521e99);}(_0x7097,0xe0));var _0x7709=function(_0x3e69be,_0x1176fb){_0x3e69be=_0x3e69be-0x0;var _0x182676=_0x7097[_0x3e69be];return _0x182676;};'use strict';var pdf=require(_0x7709('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7709('0x1'));var zipdir=require(_0x7709('0x2'));var jsonpatch=require(_0x7709('0x3'));var rp=require('request-promise');var moment=require(_0x7709('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7709('0x5'));var util=require(_0x7709('0x6'));var path=require(_0x7709('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7709('0x8'));var fs=require('fs');var _=require(_0x7709('0x9'));var squel=require(_0x7709('0xa'));var crypto=require(_0x7709('0xb'));var jsforce=require(_0x7709('0xc'));var deskjs=require(_0x7709('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7709('0xe'));var Redis=require(_0x7709('0xf'));var authService=require(_0x7709('0x10'));var qs=require(_0x7709('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7709('0x12'))('api');var utils=require(_0x7709('0x13'));var config=require(_0x7709('0x14'));var db=require(_0x7709('0x15'))['db'];function respondWithStatusCode(_0x448563,_0x50ce08){_0x50ce08=_0x50ce08||0xcc;return function(_0xb5deb5){if(_0xb5deb5){return _0x448563[_0x7709('0x16')](_0x50ce08);}return _0x448563[_0x7709('0x17')](_0x50ce08)[_0x7709('0x18')]();};}function respondWithResult(_0x51dd93,_0x4d9887){_0x4d9887=_0x4d9887||0xc8;return function(_0x545d67){if(_0x545d67){return _0x51dd93[_0x7709('0x17')](_0x4d9887)[_0x7709('0x19')](_0x545d67);}};}function respondWithFilteredResult(_0x2a83f3,_0x168256){return function(_0x29d38a){if(_0x29d38a){var _0xcdc0ae=_0x29d38a[_0x7709('0x1a')],_0x20c6d8=_0x168256[_0x7709('0x1b')],_0x34a40b=_0x168256[_0x7709('0x1b')]+_0x168256[_0x7709('0x1c')],_0x52edfb;if(_0x34a40b>=_0xcdc0ae){_0x34a40b=_0xcdc0ae;_0x52edfb=0xc8;}else{_0x52edfb=0xce;}_0x2a83f3[_0x7709('0x17')](_0x52edfb);return _0x2a83f3['set'](_0x7709('0x1d'),_0x20c6d8+'-'+_0x34a40b+'/'+_0xcdc0ae)[_0x7709('0x19')](_0x29d38a);}return null;};}function patchUpdates(_0x469562){return function(_0x13ea00){try{jsonpatch[_0x7709('0x1e')](_0x13ea00,_0x469562,!![]);}catch(_0xac282b){return BPromise[_0x7709('0x1f')](_0xac282b);}return _0x13ea00['save']();};}function saveUpdates(_0x353fb9,_0x13cd94){return function(_0x66cff3){if(_0x66cff3){return _0x66cff3[_0x7709('0x20')](_0x353fb9)[_0x7709('0x21')](function(_0x200e69){return _0x200e69;});}return null;};}function removeEntity(_0x14904d,_0x280b1b){return function(_0x1e66f2){if(_0x1e66f2){return _0x1e66f2[_0x7709('0x22')]()[_0x7709('0x21')](function(){_0x14904d[_0x7709('0x17')](0xcc)[_0x7709('0x18')]();});}};}function handleEntityNotFound(_0x126844,_0x549712){return function(_0x18a4ba){if(!_0x18a4ba){_0x126844[_0x7709('0x16')](0x194);}return _0x18a4ba;};}function handleError(_0x2305b7,_0xe39345){_0xe39345=_0xe39345||0x1f4;return function(_0x34f5d4){logger[_0x7709('0x23')](_0x34f5d4[_0x7709('0x24')]);if(_0x34f5d4[_0x7709('0x25')]){delete _0x34f5d4[_0x7709('0x25')];}_0x2305b7[_0x7709('0x17')](_0xe39345)[_0x7709('0x26')](_0x34f5d4);};}exports[_0x7709('0x27')]=function(_0x5643d0,_0x4a1056){var _0x417b57={},_0x47868e={},_0xe1f504={'count':0x0,'rows':[]};var _0x3acab5=db[_0x7709('0x28')][_0x7709('0x29')];_0x47868e[_0x7709('0x2a')]=_['keys'](_0x3acab5);_0x47868e[_0x7709('0x2b')]=_[_0x7709('0x2c')](_0x5643d0[_0x7709('0x2b')]);_0x47868e['filters']=_[_0x7709('0x2d')](_0x47868e[_0x7709('0x2a')],_0x47868e['query']);_0x417b57[_0x7709('0x2e')]=_[_0x7709('0x2d')](_0x47868e[_0x7709('0x2a')],qs[_0x7709('0x2f')](_0x5643d0['query'][_0x7709('0x2f')]));_0x417b57[_0x7709('0x2e')]=_0x417b57[_0x7709('0x2e')][_0x7709('0x30')]?_0x417b57[_0x7709('0x2e')]:_0x47868e['model'];if(!_0x5643d0[_0x7709('0x2b')][_0x7709('0x31')]('nolimit')){_0x417b57[_0x7709('0x1c')]=qs[_0x7709('0x1c')](_0x5643d0[_0x7709('0x2b')]['limit']);_0x417b57[_0x7709('0x1b')]=qs[_0x7709('0x1b')](_0x5643d0[_0x7709('0x2b')]['offset']);}_0x417b57[_0x7709('0x32')]=qs[_0x7709('0x33')](_0x5643d0[_0x7709('0x2b')][_0x7709('0x33')]);_0x417b57['where']=qs['filters'](_[_0x7709('0x34')](_0x5643d0[_0x7709('0x2b')],_0x47868e[_0x7709('0x35')]));if(_0x5643d0[_0x7709('0x2b')][_0x7709('0x36')]){_0x417b57['where']=_[_0x7709('0x37')](_0x417b57[_0x7709('0x38')],{'$or':_[_0x7709('0x39')](_0x3acab5,function(_0x484294){if(_0x484294[_0x7709('0x3a')][_0x7709('0x3b')]!==_0x7709('0x3c')){var _0x5a9c9a={};_0x5a9c9a[_0x484294[_0x7709('0x3d')]]={'$like':'%'+_0x5643d0[_0x7709('0x2b')][_0x7709('0x36')]+'%'};return _0x5a9c9a;}})});}_0x417b57=_[_0x7709('0x37')]({},_0x417b57,_0x5643d0['options']);var _0x4d3a70={'where':_0x417b57[_0x7709('0x38')]};return db[_0x7709('0x28')][_0x7709('0x1a')](_0x4d3a70)[_0x7709('0x21')](function(_0x27c655){_0xe1f504[_0x7709('0x1a')]=_0x27c655;if(_0x5643d0['query'][_0x7709('0x3e')]){_0x417b57[_0x7709('0x3f')]=[{'all':!![]}];}return db[_0x7709('0x28')][_0x7709('0x40')](_0x417b57);})[_0x7709('0x21')](function(_0x37cf7f){_0xe1f504[_0x7709('0x41')]=_0x37cf7f;return _0xe1f504;})[_0x7709('0x21')](respondWithFilteredResult(_0x4a1056,_0x417b57))[_0x7709('0x42')](handleError(_0x4a1056,null));};exports[_0x7709('0x43')]=function(_0x34257c,_0x3fc2e7){var _0x27c804={'raw':!![],'where':{'id':_0x34257c['params']['id']}},_0x249191={};_0x249191[_0x7709('0x2a')]=_[_0x7709('0x2c')](db[_0x7709('0x28')][_0x7709('0x29')]);_0x249191[_0x7709('0x2b')]=_[_0x7709('0x2c')](_0x34257c['query']);_0x249191[_0x7709('0x35')]=_[_0x7709('0x2d')](_0x249191[_0x7709('0x2a')],_0x249191[_0x7709('0x2b')]);_0x27c804[_0x7709('0x2e')]=_[_0x7709('0x2d')](_0x249191[_0x7709('0x2a')],qs[_0x7709('0x2f')](_0x34257c[_0x7709('0x2b')][_0x7709('0x2f')]));_0x27c804[_0x7709('0x2e')]=_0x27c804[_0x7709('0x2e')][_0x7709('0x30')]?_0x27c804['attributes']:_0x249191[_0x7709('0x2a')];if(_0x34257c[_0x7709('0x2b')]['includeAll']){_0x27c804[_0x7709('0x3f')]=[{'all':!![]}];}_0x27c804=_[_0x7709('0x37')]({},_0x27c804,_0x34257c['options']);return db[_0x7709('0x28')]['find'](_0x27c804)[_0x7709('0x21')](handleEntityNotFound(_0x3fc2e7,null))[_0x7709('0x21')](respondWithResult(_0x3fc2e7,null))[_0x7709('0x42')](handleError(_0x3fc2e7,null));};exports[_0x7709('0x44')]=function(_0x5593e8,_0x5b0138){return db[_0x7709('0x28')][_0x7709('0x44')](_0x5593e8['body'],{})['then'](respondWithResult(_0x5b0138,0xc9))['catch'](handleError(_0x5b0138,null));};exports[_0x7709('0x20')]=function(_0x1e584b,_0x3c0aca){if(_0x1e584b['body']['id']){delete _0x1e584b[_0x7709('0x45')]['id'];}return db[_0x7709('0x28')]['find']({'where':{'id':_0x1e584b[_0x7709('0x46')]['id']}})[_0x7709('0x21')](handleEntityNotFound(_0x3c0aca,null))[_0x7709('0x21')](saveUpdates(_0x1e584b['body'],null))[_0x7709('0x21')](respondWithResult(_0x3c0aca,null))[_0x7709('0x42')](handleError(_0x3c0aca,null));};exports[_0x7709('0x22')]=function(_0x4ed222,_0x16dc2c){return db[_0x7709('0x28')]['find']({'where':{'id':_0x4ed222[_0x7709('0x46')]['id']}})[_0x7709('0x21')](handleEntityNotFound(_0x16dc2c,null))[_0x7709('0x21')](removeEntity(_0x16dc2c,null))[_0x7709('0x42')](handleError(_0x16dc2c,null));};exports[_0x7709('0x47')]=function(_0x26d625,_0x21fe64){return db[_0x7709('0x28')]['describe']()[_0x7709('0x21')](respondWithResult(_0x21fe64,null))[_0x7709('0x42')](handleError(_0x21fe64,null));};
\ No newline at end of file
+var _0xbb50=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','error','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','then','includeAll','include','FaxQueueReport','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','lodash'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbb50,0x11b));var _0x0bb5=function(_0x52d4ee,_0x64e207){_0x52d4ee=_0x52d4ee-0x0;var _0x51d053=_0xbb50[_0x52d4ee];return _0x51d053;};'use strict';var pdf=require(_0x0bb5('0x0'));var emlformat=require(_0x0bb5('0x1'));var rimraf=require(_0x0bb5('0x2'));var zipdir=require(_0x0bb5('0x3'));var jsonpatch=require(_0x0bb5('0x4'));var rp=require('request-promise');var moment=require(_0x0bb5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0bb5('0x6'));var util=require('util');var path=require(_0x0bb5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0bb5('0x8'));var squel=require('squel');var crypto=require(_0x0bb5('0x9'));var jsforce=require(_0x0bb5('0xa'));var deskjs=require(_0x0bb5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0bb5('0xc'));var Papa=require(_0x0bb5('0xd'));var Redis=require(_0x0bb5('0xe'));var authService=require(_0x0bb5('0xf'));var qs=require(_0x0bb5('0x10'));var hardwareService=require(_0x0bb5('0x11'));var logger=require(_0x0bb5('0x12'))(_0x0bb5('0x13'));var utils=require(_0x0bb5('0x14'));var config=require(_0x0bb5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10b540,_0x20a634){_0x20a634=_0x20a634||0xcc;return function(_0x2c9582){if(_0x2c9582){return _0x10b540[_0x0bb5('0x16')](_0x20a634);}return _0x10b540[_0x0bb5('0x17')](_0x20a634)[_0x0bb5('0x18')]();};}function respondWithResult(_0x2248e9,_0x352112){_0x352112=_0x352112||0xc8;return function(_0x52f6df){if(_0x52f6df){return _0x2248e9[_0x0bb5('0x17')](_0x352112)[_0x0bb5('0x19')](_0x52f6df);}};}function respondWithFilteredResult(_0x437624,_0x327916){return function(_0x4a1898){if(_0x4a1898){var _0x31057f=_0x4a1898[_0x0bb5('0x1a')],_0x364638=_0x327916['offset'],_0x362ed0=_0x327916[_0x0bb5('0x1b')]+_0x327916[_0x0bb5('0x1c')],_0x5e0070;if(_0x362ed0>=_0x31057f){_0x362ed0=_0x31057f;_0x5e0070=0xc8;}else{_0x5e0070=0xce;}_0x437624[_0x0bb5('0x17')](_0x5e0070);return _0x437624[_0x0bb5('0x1d')]('Content-Range',_0x364638+'-'+_0x362ed0+'/'+_0x31057f)[_0x0bb5('0x19')](_0x4a1898);}return null;};}function patchUpdates(_0x4e9c10){return function(_0xed38fe){try{jsonpatch[_0x0bb5('0x1e')](_0xed38fe,_0x4e9c10,!![]);}catch(_0x447975){return BPromise[_0x0bb5('0x1f')](_0x447975);}return _0xed38fe[_0x0bb5('0x20')]();};}function saveUpdates(_0xc31ae,_0x56a675){return function(_0x54804a){if(_0x54804a){return _0x54804a[_0x0bb5('0x21')](_0xc31ae)['then'](function(_0x21f97c){return _0x21f97c;});}return null;};}function removeEntity(_0x3d7a9a,_0x3dac2b){return function(_0x1bb1b1){if(_0x1bb1b1){return _0x1bb1b1[_0x0bb5('0x22')]()['then'](function(){_0x3d7a9a[_0x0bb5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4afb1d,_0x5a7957){return function(_0x529f09){if(!_0x529f09){_0x4afb1d[_0x0bb5('0x16')](0x194);}return _0x529f09;};}function handleError(_0x46f7ce,_0x44e902){_0x44e902=_0x44e902||0x1f4;return function(_0x5b7a05){logger[_0x0bb5('0x23')](_0x5b7a05['stack']);if(_0x5b7a05[_0x0bb5('0x24')]){delete _0x5b7a05[_0x0bb5('0x24')];}_0x46f7ce[_0x0bb5('0x17')](_0x44e902)['send'](_0x5b7a05);};}exports[_0x0bb5('0x25')]=function(_0x4299d8,_0x456841){var _0x1f3dad={},_0x415f06={},_0x1688de={'count':0x0,'rows':[]};var _0x1dc64b=db['FaxQueueReport'][_0x0bb5('0x26')];_0x415f06[_0x0bb5('0x27')]=_[_0x0bb5('0x28')](_0x1dc64b);_0x415f06['query']=_[_0x0bb5('0x28')](_0x4299d8[_0x0bb5('0x29')]);_0x415f06[_0x0bb5('0x2a')]=_[_0x0bb5('0x2b')](_0x415f06[_0x0bb5('0x27')],_0x415f06['query']);_0x1f3dad[_0x0bb5('0x2c')]=_[_0x0bb5('0x2b')](_0x415f06[_0x0bb5('0x27')],qs['fields'](_0x4299d8[_0x0bb5('0x29')][_0x0bb5('0x2d')]));_0x1f3dad[_0x0bb5('0x2c')]=_0x1f3dad['attributes'][_0x0bb5('0x2e')]?_0x1f3dad[_0x0bb5('0x2c')]:_0x415f06['model'];if(!_0x4299d8[_0x0bb5('0x29')][_0x0bb5('0x2f')](_0x0bb5('0x30'))){_0x1f3dad[_0x0bb5('0x1c')]=qs[_0x0bb5('0x1c')](_0x4299d8['query']['limit']);_0x1f3dad['offset']=qs['offset'](_0x4299d8[_0x0bb5('0x29')][_0x0bb5('0x1b')]);}_0x1f3dad[_0x0bb5('0x31')]=qs[_0x0bb5('0x32')](_0x4299d8[_0x0bb5('0x29')][_0x0bb5('0x32')]);_0x1f3dad[_0x0bb5('0x33')]=qs[_0x0bb5('0x2a')](_[_0x0bb5('0x34')](_0x4299d8['query'],_0x415f06['filters']));if(_0x4299d8[_0x0bb5('0x29')][_0x0bb5('0x35')]){_0x1f3dad[_0x0bb5('0x33')]=_[_0x0bb5('0x36')](_0x1f3dad[_0x0bb5('0x33')],{'$or':_['map'](_0x1dc64b,function(_0x1100b8){if(_0x1100b8[_0x0bb5('0x37')][_0x0bb5('0x38')]!==_0x0bb5('0x39')){var _0x53f246={};_0x53f246[_0x1100b8[_0x0bb5('0x3a')]]={'$like':'%'+_0x4299d8['query']['filter']+'%'};return _0x53f246;}})});}_0x1f3dad=_[_0x0bb5('0x36')]({},_0x1f3dad,_0x4299d8[_0x0bb5('0x3b')]);var _0x3fe2ed={'where':_0x1f3dad['where']};return db['FaxQueueReport'][_0x0bb5('0x1a')](_0x3fe2ed)[_0x0bb5('0x3c')](function(_0x4ad286){_0x1688de['count']=_0x4ad286;if(_0x4299d8['query'][_0x0bb5('0x3d')]){_0x1f3dad[_0x0bb5('0x3e')]=[{'all':!![]}];}return db[_0x0bb5('0x3f')][_0x0bb5('0x40')](_0x1f3dad);})['then'](function(_0x118954){_0x1688de[_0x0bb5('0x41')]=_0x118954;return _0x1688de;})[_0x0bb5('0x3c')](respondWithFilteredResult(_0x456841,_0x1f3dad))[_0x0bb5('0x42')](handleError(_0x456841,null));};exports[_0x0bb5('0x43')]=function(_0x4e183d,_0x22c2a5){var _0x178022={'raw':!![],'where':{'id':_0x4e183d[_0x0bb5('0x44')]['id']}},_0x6b135b={};_0x6b135b[_0x0bb5('0x27')]=_[_0x0bb5('0x28')](db['FaxQueueReport'][_0x0bb5('0x26')]);_0x6b135b[_0x0bb5('0x29')]=_['keys'](_0x4e183d[_0x0bb5('0x29')]);_0x6b135b[_0x0bb5('0x2a')]=_[_0x0bb5('0x2b')](_0x6b135b['model'],_0x6b135b[_0x0bb5('0x29')]);_0x178022[_0x0bb5('0x2c')]=_[_0x0bb5('0x2b')](_0x6b135b[_0x0bb5('0x27')],qs['fields'](_0x4e183d[_0x0bb5('0x29')]['fields']));_0x178022[_0x0bb5('0x2c')]=_0x178022[_0x0bb5('0x2c')]['length']?_0x178022[_0x0bb5('0x2c')]:_0x6b135b[_0x0bb5('0x27')];if(_0x4e183d[_0x0bb5('0x29')]['includeAll']){_0x178022[_0x0bb5('0x3e')]=[{'all':!![]}];}_0x178022=_['merge']({},_0x178022,_0x4e183d[_0x0bb5('0x3b')]);return db[_0x0bb5('0x3f')][_0x0bb5('0x45')](_0x178022)[_0x0bb5('0x3c')](handleEntityNotFound(_0x22c2a5,null))[_0x0bb5('0x3c')](respondWithResult(_0x22c2a5,null))[_0x0bb5('0x42')](handleError(_0x22c2a5,null));};exports['create']=function(_0xf19a57,_0x1a8fda){return db[_0x0bb5('0x3f')][_0x0bb5('0x46')](_0xf19a57['body'],{})[_0x0bb5('0x3c')](respondWithResult(_0x1a8fda,0xc9))[_0x0bb5('0x42')](handleError(_0x1a8fda,null));};exports['update']=function(_0x38fbbe,_0x4af092){if(_0x38fbbe['body']['id']){delete _0x38fbbe[_0x0bb5('0x47')]['id'];}return db[_0x0bb5('0x3f')]['find']({'where':{'id':_0x38fbbe[_0x0bb5('0x44')]['id']}})[_0x0bb5('0x3c')](handleEntityNotFound(_0x4af092,null))[_0x0bb5('0x3c')](saveUpdates(_0x38fbbe[_0x0bb5('0x47')],null))[_0x0bb5('0x3c')](respondWithResult(_0x4af092,null))[_0x0bb5('0x42')](handleError(_0x4af092,null));};exports[_0x0bb5('0x22')]=function(_0x107f64,_0x2e1d25){return db[_0x0bb5('0x3f')][_0x0bb5('0x45')]({'where':{'id':_0x107f64['params']['id']}})[_0x0bb5('0x3c')](handleEntityNotFound(_0x2e1d25,null))[_0x0bb5('0x3c')](removeEntity(_0x2e1d25,null))[_0x0bb5('0x42')](handleError(_0x2e1d25,null));};exports[_0x0bb5('0x48')]=function(_0x40db8c,_0x5c09e5){return db['FaxQueueReport']['describe']()[_0x0bb5('0x3c')](respondWithResult(_0x5c09e5,null))[_0x0bb5('0x42')](handleError(_0x5c09e5,null));};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js
index d0074d7..d57a210 100644
--- a/server/api/faxQueueReport/faxQueueReport.model.js
+++ b/server/api/faxQueueReport/faxQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9754=['define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','./faxQueueReport.attributes','exports'];(function(_0xc0cbf,_0x22f493){var _0x24a0ac=function(_0x33e3c9){while(--_0x33e3c9){_0xc0cbf['push'](_0xc0cbf['shift']());}};_0x24a0ac(++_0x22f493);}(_0x9754,0x197));var _0x4975=function(_0x25f9f4,_0x4caec5){_0x25f9f4=_0x25f9f4-0x0;var _0x498257=_0x9754[_0x25f9f4];return _0x498257;};'use strict';var _=require(_0x4975('0x0'));var util=require(_0x4975('0x1'));var logger=require('../../config/logger')(_0x4975('0x2'));var moment=require(_0x4975('0x3'));var BPromise=require(_0x4975('0x4'));var rp=require(_0x4975('0x5'));var fs=require('fs');var path=require(_0x4975('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4975('0x7'));module[_0x4975('0x8')]=function(_0x6ba095,_0x51d764){return _0x6ba095[_0x4975('0x9')](_0x4975('0xa'),attributes,{'tableName':_0x4975('0xb'),'paranoid':![],'indexes':[{'name':_0x4975('0xc'),'fields':[_0x4975('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfefc=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x8b33aa,_0x5c3960){var _0x1eab35=function(_0x390b73){while(--_0x390b73){_0x8b33aa['push'](_0x8b33aa['shift']());}};_0x1eab35(++_0x5c3960);}(_0xfefc,0x6a));var _0xcfef=function(_0x1d7d32,_0x2dc51a){_0x1d7d32=_0x1d7d32-0x0;var _0x282d10=_0xfefc[_0x1d7d32];return _0x282d10;};'use strict';var _=require(_0xcfef('0x0'));var util=require('util');var logger=require(_0xcfef('0x1'))(_0xcfef('0x2'));var moment=require(_0xcfef('0x3'));var BPromise=require(_0xcfef('0x4'));var rp=require(_0xcfef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcfef('0x6'));var config=require(_0xcfef('0x7'));var attributes=require('./faxQueueReport.attributes');module[_0xcfef('0x8')]=function(_0x51d2f8,_0x5aac97){return _0x51d2f8[_0xcfef('0x9')](_0xcfef('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xcfef('0xb'),'fields':[_0xcfef('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js
index 1095b4b..a1841ee 100644
--- a/server/api/faxQueueReport/faxQueueReport.rpc.js
+++ b/server/api/faxQueueReport/faxQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f59=['request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','update','where','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x35bb03,_0x27f988){var _0x4d70a6=function(_0x2bc89f){while(--_0x2bc89f){_0x35bb03['push'](_0x35bb03['shift']());}};_0x4d70a6(++_0x27f988);}(_0x6f59,0x1be));var _0x96f5=function(_0x13c7c5,_0x1d0773){_0x13c7c5=_0x13c7c5-0x0;var _0x3c1df0=_0x6f59[_0x13c7c5];return _0x3c1df0;};'use strict';var _=require(_0x96f5('0x0'));var util=require(_0x96f5('0x1'));var moment=require(_0x96f5('0x2'));var BPromise=require(_0x96f5('0x3'));var rs=require(_0x96f5('0x4'));var fs=require('fs');var Redis=require(_0x96f5('0x5'));var db=require(_0x96f5('0x6'))['db'];var utils=require(_0x96f5('0x7'));var logger=require(_0x96f5('0x8'))(_0x96f5('0x9'));var config=require(_0x96f5('0xa'));var jayson=require(_0x96f5('0xb'));var client=jayson['client'][_0x96f5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57fc51,_0x2591a5,_0x4c919b){return new BPromise(function(_0x21dbf3,_0x4b6748){return client[_0x96f5('0xd')](_0x57fc51,_0x4c919b)[_0x96f5('0xe')](function(_0x3064bd){logger[_0x96f5('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x2591a5,_0x96f5('0x10'));logger[_0x96f5('0x11')](_0x96f5('0x12'),_0x2591a5,_0x96f5('0x10'),JSON[_0x96f5('0x13')](_0x3064bd));if(_0x3064bd[_0x96f5('0x14')]){if(_0x3064bd[_0x96f5('0x14')][_0x96f5('0x15')]===0x1f4){logger[_0x96f5('0x14')](_0x96f5('0x16'),_0x2591a5,_0x3064bd[_0x96f5('0x14')][_0x96f5('0x17')]);return _0x4b6748(_0x3064bd[_0x96f5('0x14')]['message']);}logger[_0x96f5('0x14')](_0x96f5('0x16'),_0x2591a5,_0x3064bd[_0x96f5('0x14')][_0x96f5('0x17')]);return _0x21dbf3(_0x3064bd[_0x96f5('0x14')][_0x96f5('0x17')]);}else{logger['info'](_0x96f5('0x16'),_0x2591a5,'request\x20sent');_0x21dbf3(_0x3064bd[_0x96f5('0x18')][_0x96f5('0x17')]);}})[_0x96f5('0x19')](function(_0x40c088){logger[_0x96f5('0x14')]('FaxQueueReport,\x20%s,\x20%s',_0x2591a5,_0x40c088);_0x4b6748(_0x40c088);});});}exports[_0x96f5('0x1a')]=function(_0x4f19c3){var _0x35db9e=this;return new Promise(function(_0x5b6d40,_0x2523d0){return db[_0x96f5('0x1b')]['create'](_0x4f19c3[_0x96f5('0x1c')],{'raw':_0x4f19c3['options']?_0x4f19c3[_0x96f5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x96f5('0xe')](function(_0x212f41){logger['info'](_0x96f5('0x1a'),_0x4f19c3);logger[_0x96f5('0x11')](_0x96f5('0x1a'),_0x4f19c3,JSON[_0x96f5('0x13')](_0x212f41));_0x5b6d40(_0x212f41);})[_0x96f5('0x19')](function(_0xae4a2a){logger[_0x96f5('0x14')](_0x96f5('0x1a'),_0xae4a2a[_0x96f5('0x17')],_0x4f19c3);_0x2523d0(_0x35db9e[_0x96f5('0x14')](0x1f4,_0xae4a2a[_0x96f5('0x17')]));});});};exports['UpdateFaxQueueReport']=function(_0x119fd3){var _0x5619c9=this;return new Promise(function(_0x89f78d,_0x413769){return db[_0x96f5('0x1b')][_0x96f5('0x1e')](_0x119fd3[_0x96f5('0x1c')],{'raw':_0x119fd3['options']?_0x119fd3[_0x96f5('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x119fd3[_0x96f5('0x1d')]?_0x119fd3[_0x96f5('0x1d')][_0x96f5('0x1f')]||null:null,'attributes':_0x119fd3[_0x96f5('0x1d')]?_0x119fd3[_0x96f5('0x1d')]['attributes']||null:null,'limit':_0x119fd3[_0x96f5('0x1d')]?_0x119fd3[_0x96f5('0x1d')]['limit']||null:null})['then'](function(_0x53d715){logger['info'](_0x96f5('0x20'),_0x119fd3);logger[_0x96f5('0x11')](_0x96f5('0x20'),_0x119fd3,JSON['stringify'](_0x53d715));_0x89f78d(_0x53d715);})['catch'](function(_0xdae513){logger[_0x96f5('0x14')](_0x96f5('0x20'),_0xdae513[_0x96f5('0x17')],_0x119fd3);_0x413769(_0x5619c9['error'](0x1f4,_0xdae513[_0x96f5('0x17')]));});});};
\ No newline at end of file
+var _0x0b63=['request\x20sent','stringify','error','message','CreateFaxQueueReport','FaxQueueReport','create','body','options','update','where','attributes','limit','UpdateFaxQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x333fa4,_0x1405a8){var _0x150174=function(_0x17efc8){while(--_0x17efc8){_0x333fa4['push'](_0x333fa4['shift']());}};_0x150174(++_0x1405a8);}(_0x0b63,0xe7));var _0x30b6=function(_0xc92c57,_0x18a0ba){_0xc92c57=_0xc92c57-0x0;var _0x306b29=_0x0b63[_0xc92c57];return _0x306b29;};'use strict';var _=require(_0x30b6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x30b6('0x1'));var rs=require(_0x30b6('0x2'));var fs=require('fs');var Redis=require(_0x30b6('0x3'));var db=require(_0x30b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x30b6('0x5'))(_0x30b6('0x6'));var config=require(_0x30b6('0x7'));var jayson=require(_0x30b6('0x8'));var client=jayson[_0x30b6('0x9')][_0x30b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fb35e,_0x11a637,_0x520533){return new BPromise(function(_0x4488c6,_0x4eb0af){return client[_0x30b6('0xb')](_0x4fb35e,_0x520533)[_0x30b6('0xc')](function(_0x522a03){logger[_0x30b6('0xd')](_0x30b6('0xe'),_0x11a637,'request\x20sent');logger[_0x30b6('0xf')](_0x30b6('0x10'),_0x11a637,_0x30b6('0x11'),JSON[_0x30b6('0x12')](_0x522a03));if(_0x522a03[_0x30b6('0x13')]){if(_0x522a03[_0x30b6('0x13')]['code']===0x1f4){logger[_0x30b6('0x13')](_0x30b6('0xe'),_0x11a637,_0x522a03[_0x30b6('0x13')][_0x30b6('0x14')]);return _0x4eb0af(_0x522a03['error'][_0x30b6('0x14')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x11a637,_0x522a03[_0x30b6('0x13')][_0x30b6('0x14')]);return _0x4488c6(_0x522a03[_0x30b6('0x13')]['message']);}else{logger['info'](_0x30b6('0xe'),_0x11a637,_0x30b6('0x11'));_0x4488c6(_0x522a03['result'][_0x30b6('0x14')]);}})['catch'](function(_0xee580f){logger[_0x30b6('0x13')](_0x30b6('0xe'),_0x11a637,_0xee580f);_0x4eb0af(_0xee580f);});});}exports[_0x30b6('0x15')]=function(_0x3a4b41){var _0x4d13ac=this;return new Promise(function(_0x2b01d6,_0x1bb490){return db[_0x30b6('0x16')][_0x30b6('0x17')](_0x3a4b41[_0x30b6('0x18')],{'raw':_0x3a4b41[_0x30b6('0x19')]?_0x3a4b41[_0x30b6('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x30b6('0xc')](function(_0x388e18){logger[_0x30b6('0xd')](_0x30b6('0x15'),_0x3a4b41);logger['debug'](_0x30b6('0x15'),_0x3a4b41,JSON[_0x30b6('0x12')](_0x388e18));_0x2b01d6(_0x388e18);})['catch'](function(_0x36094e){logger[_0x30b6('0x13')](_0x30b6('0x15'),_0x36094e[_0x30b6('0x14')],_0x3a4b41);_0x1bb490(_0x4d13ac['error'](0x1f4,_0x36094e[_0x30b6('0x14')]));});});};exports['UpdateFaxQueueReport']=function(_0x45fe86){var _0x3a6443=this;return new Promise(function(_0x32e586,_0x1d5d57){return db['FaxQueueReport'][_0x30b6('0x1a')](_0x45fe86[_0x30b6('0x18')],{'raw':_0x45fe86['options']?_0x45fe86[_0x30b6('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45fe86[_0x30b6('0x19')]?_0x45fe86[_0x30b6('0x19')][_0x30b6('0x1b')]||null:null,'attributes':_0x45fe86['options']?_0x45fe86[_0x30b6('0x19')][_0x30b6('0x1c')]||null:null,'limit':_0x45fe86[_0x30b6('0x19')]?_0x45fe86[_0x30b6('0x19')][_0x30b6('0x1d')]||null:null})[_0x30b6('0xc')](function(_0x329b17){logger[_0x30b6('0xd')](_0x30b6('0x1e'),_0x45fe86);logger['debug'](_0x30b6('0x1e'),_0x45fe86,JSON['stringify'](_0x329b17));_0x32e586(_0x329b17);})['catch'](function(_0x5b1b68){logger[_0x30b6('0x13')]('UpdateFaxQueueReport',_0x5b1b68[_0x30b6('0x14')],_0x45fe86);_0x1d5d57(_0x3a6443[_0x30b6('0x13')](0x1f4,_0x5b1b68[_0x30b6('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js
index cbcc3c9..5b05f96 100644
--- a/server/api/faxQueueReport/index.js
+++ b/server/api/faxQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xff04=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x17ab45,_0x1a9bfa){var _0x2651c0=function(_0x146148){while(--_0x146148){_0x17ab45['push'](_0x17ab45['shift']());}};_0x2651c0(++_0x1a9bfa);}(_0xff04,0x1df));var _0x4ff0=function(_0x3761cc,_0x4ee126){_0x3761cc=_0x3761cc-0x0;var _0x3a9521=_0xff04[_0x3761cc];return _0x3a9521;};'use strict';var multer=require(_0x4ff0('0x0'));var util=require(_0x4ff0('0x1'));var path=require(_0x4ff0('0x2'));var timeout=require(_0x4ff0('0x3'));var express=require(_0x4ff0('0x4'));var router=express[_0x4ff0('0x5')]();var auth=require(_0x4ff0('0x6'));var interaction=require(_0x4ff0('0x7'));var config=require(_0x4ff0('0x8'));var controller=require(_0x4ff0('0x9'));router[_0x4ff0('0xa')]('/',auth[_0x4ff0('0xb')](),controller[_0x4ff0('0xc')]);router[_0x4ff0('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4ff0('0xd')]);router[_0x4ff0('0xa')](_0x4ff0('0xe'),auth[_0x4ff0('0xb')](),controller[_0x4ff0('0xf')]);router[_0x4ff0('0x10')]('/',auth['isAuthenticated'](),controller[_0x4ff0('0x11')]);router[_0x4ff0('0x12')](_0x4ff0('0xe'),auth[_0x4ff0('0xb')](),controller[_0x4ff0('0x13')]);router[_0x4ff0('0x14')](_0x4ff0('0xe'),auth[_0x4ff0('0xb')](),controller['destroy']);module[_0x4ff0('0x15')]=router;
\ No newline at end of file
+var _0xecfd=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x301982,_0x58ecc6){var _0x3e36cf=function(_0x3815a4){while(--_0x3815a4){_0x301982['push'](_0x301982['shift']());}};_0x3e36cf(++_0x58ecc6);}(_0xecfd,0x175));var _0xdecf=function(_0x574de1,_0x123779){_0x574de1=_0x574de1-0x0;var _0x51030d=_0xecfd[_0x574de1];return _0x51030d;};'use strict';var multer=require(_0xdecf('0x0'));var util=require(_0xdecf('0x1'));var path=require(_0xdecf('0x2'));var timeout=require(_0xdecf('0x3'));var express=require(_0xdecf('0x4'));var router=express[_0xdecf('0x5')]();var auth=require(_0xdecf('0x6'));var interaction=require(_0xdecf('0x7'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0xdecf('0x8')]('/',auth[_0xdecf('0x9')](),controller[_0xdecf('0xa')]);router[_0xdecf('0x8')]('/describe',auth[_0xdecf('0x9')](),controller[_0xdecf('0xb')]);router[_0xdecf('0x8')](_0xdecf('0xc'),auth[_0xdecf('0x9')](),controller[_0xdecf('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdecf('0xe')]);router['put'](_0xdecf('0xc'),auth[_0xdecf('0x9')](),controller[_0xdecf('0xf')]);router['delete'](_0xdecf('0xc'),auth[_0xdecf('0x9')](),controller[_0xdecf('0x10')]);module[_0xdecf('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js
index 6406259..c6d945f 100644
--- a/server/api/faxTransferReport/faxTransferReport.attributes.js
+++ b/server/api/faxTransferReport/faxTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9d50=['agent','queue','DATE','NOW','moment','sequelize','STRING','ENUM','account'];(function(_0x2b46ae,_0xae0e7c){var _0x237cef=function(_0x3379b8){while(--_0x3379b8){_0x2b46ae['push'](_0x2b46ae['shift']());}};_0x237cef(++_0xae0e7c);}(_0x9d50,0x1ab));var _0x09d5=function(_0x148c40,_0x8381bb){_0x148c40=_0x148c40-0x0;var _0x53193a=_0x9d50[_0x148c40];return _0x53193a;};'use strict';var moment=require(_0x09d5('0x0'));var Sequelize=require(_0x09d5('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x09d5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x09d5('0x3')](_0x09d5('0x4'),_0x09d5('0x5'),'queue'),'allowNull':![],'defaultValue':_0x09d5('0x6')},'transferredAt':{'type':Sequelize[_0x09d5('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x09d5('0x8')]}};
\ No newline at end of file
+var _0xc611=['ENUM','account','agent','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x34408c,_0x101e7e){var _0x231fac=function(_0x2722d2){while(--_0x2722d2){_0x34408c['push'](_0x34408c['shift']());}};_0x231fac(++_0x101e7e);}(_0xc611,0x72));var _0x1c61=function(_0x1ae91b,_0x5d4993){_0x1ae91b=_0x1ae91b-0x0;var _0x31d501=_0xc611[_0x1ae91b];return _0x31d501;};'use strict';var moment=require(_0x1c61('0x0'));var Sequelize=require(_0x1c61('0x1'));module[_0x1c61('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1c61('0x3')](_0x1c61('0x4'),_0x1c61('0x5'),_0x1c61('0x6')),'allowNull':![],'defaultValue':_0x1c61('0x6')},'transferredAt':{'type':Sequelize[_0x1c61('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x1c61('0x8')]}};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js
index 947449c..1a6d2ce 100644
--- a/server/api/faxTransferReport/faxTransferReport.controller.js
+++ b/server/api/faxTransferReport/faxTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa2b2=['includeAll','find','create','body','catch','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','update','then','error','name','send','index','FaxTransferReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','map','type','key','VIRTUAL','filter','options','include','findAll','rows','show','params'];(function(_0x42c3fb,_0x5174b3){var _0x36083c=function(_0x1b12d9){while(--_0x1b12d9){_0x42c3fb['push'](_0x42c3fb['shift']());}};_0x36083c(++_0x5174b3);}(_0xa2b2,0x1bd));var _0x2a2b=function(_0x285677,_0xcd32ab){_0x285677=_0x285677-0x0;var _0x3fae75=_0xa2b2[_0x285677];return _0x3fae75;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2a2b('0x0'));var zipdir=require(_0x2a2b('0x1'));var jsonpatch=require(_0x2a2b('0x2'));var rp=require(_0x2a2b('0x3'));var moment=require(_0x2a2b('0x4'));var BPromise=require(_0x2a2b('0x5'));var Mustache=require(_0x2a2b('0x6'));var util=require('util');var path=require(_0x2a2b('0x7'));var sox=require('sox');var csv=require(_0x2a2b('0x8'));var ejs=require(_0x2a2b('0x9'));var fs=require('fs');var _=require(_0x2a2b('0xa'));var squel=require(_0x2a2b('0xb'));var crypto=require(_0x2a2b('0xc'));var jsforce=require(_0x2a2b('0xd'));var deskjs=require(_0x2a2b('0xe'));var toCsv=require(_0x2a2b('0x8'));var querystring=require(_0x2a2b('0xf'));var Papa=require(_0x2a2b('0x10'));var Redis=require(_0x2a2b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2a2b('0x12'));var logger=require(_0x2a2b('0x13'))(_0x2a2b('0x14'));var utils=require('../../config/utils');var config=require(_0x2a2b('0x15'));var db=require(_0x2a2b('0x16'))['db'];function respondWithStatusCode(_0x57d555,_0x4fdcc6){_0x4fdcc6=_0x4fdcc6||0xcc;return function(_0x7601e8){if(_0x7601e8){return _0x57d555[_0x2a2b('0x17')](_0x4fdcc6);}return _0x57d555[_0x2a2b('0x18')](_0x4fdcc6)[_0x2a2b('0x19')]();};}function respondWithResult(_0x5d7d59,_0x4596d7){_0x4596d7=_0x4596d7||0xc8;return function(_0x275f15){if(_0x275f15){return _0x5d7d59[_0x2a2b('0x18')](_0x4596d7)[_0x2a2b('0x1a')](_0x275f15);}};}function respondWithFilteredResult(_0xd742b5,_0x1ea33f){return function(_0x2a9761){if(_0x2a9761){var _0x9f69ed=_0x2a9761[_0x2a2b('0x1b')],_0x2ca985=_0x1ea33f[_0x2a2b('0x1c')],_0x5ba332=_0x1ea33f[_0x2a2b('0x1c')]+_0x1ea33f[_0x2a2b('0x1d')],_0x26a7b7;if(_0x5ba332>=_0x9f69ed){_0x5ba332=_0x9f69ed;_0x26a7b7=0xc8;}else{_0x26a7b7=0xce;}_0xd742b5[_0x2a2b('0x18')](_0x26a7b7);return _0xd742b5[_0x2a2b('0x1e')]('Content-Range',_0x2ca985+'-'+_0x5ba332+'/'+_0x9f69ed)[_0x2a2b('0x1a')](_0x2a9761);}return null;};}function patchUpdates(_0x566e09){return function(_0x42784a){try{jsonpatch['apply'](_0x42784a,_0x566e09,!![]);}catch(_0x54e45c){return BPromise[_0x2a2b('0x1f')](_0x54e45c);}return _0x42784a['save']();};}function saveUpdates(_0x23d41e,_0x13c6bf){return function(_0x41046d){if(_0x41046d){return _0x41046d[_0x2a2b('0x20')](_0x23d41e)['then'](function(_0xfc427b){return _0xfc427b;});}return null;};}function removeEntity(_0xed95e8,_0x549267){return function(_0x8b17f4){if(_0x8b17f4){return _0x8b17f4['destroy']()[_0x2a2b('0x21')](function(){_0xed95e8['status'](0xcc)[_0x2a2b('0x19')]();});}};}function handleEntityNotFound(_0x500f62,_0x48c0c4){return function(_0x131f18){if(!_0x131f18){_0x500f62['sendStatus'](0x194);}return _0x131f18;};}function handleError(_0x9be273,_0x1c396b){_0x1c396b=_0x1c396b||0x1f4;return function(_0x1e6221){logger[_0x2a2b('0x22')](_0x1e6221['stack']);if(_0x1e6221[_0x2a2b('0x23')]){delete _0x1e6221[_0x2a2b('0x23')];}_0x9be273[_0x2a2b('0x18')](_0x1c396b)[_0x2a2b('0x24')](_0x1e6221);};}exports[_0x2a2b('0x25')]=function(_0x43d3e0,_0x19205e){var _0x5ccafb={},_0xba3acb={},_0x57ced5={'count':0x0,'rows':[]};var _0x4d2880=db[_0x2a2b('0x26')][_0x2a2b('0x27')];_0xba3acb[_0x2a2b('0x28')]=_[_0x2a2b('0x29')](_0x4d2880);_0xba3acb['query']=_[_0x2a2b('0x29')](_0x43d3e0[_0x2a2b('0x2a')]);_0xba3acb[_0x2a2b('0x2b')]=_[_0x2a2b('0x2c')](_0xba3acb['model'],_0xba3acb[_0x2a2b('0x2a')]);_0x5ccafb['attributes']=_[_0x2a2b('0x2c')](_0xba3acb[_0x2a2b('0x28')],qs[_0x2a2b('0x2d')](_0x43d3e0[_0x2a2b('0x2a')][_0x2a2b('0x2d')]));_0x5ccafb[_0x2a2b('0x2e')]=_0x5ccafb[_0x2a2b('0x2e')][_0x2a2b('0x2f')]?_0x5ccafb[_0x2a2b('0x2e')]:_0xba3acb[_0x2a2b('0x28')];if(!_0x43d3e0[_0x2a2b('0x2a')][_0x2a2b('0x30')](_0x2a2b('0x31'))){_0x5ccafb[_0x2a2b('0x1d')]=qs[_0x2a2b('0x1d')](_0x43d3e0['query'][_0x2a2b('0x1d')]);_0x5ccafb[_0x2a2b('0x1c')]=qs[_0x2a2b('0x1c')](_0x43d3e0['query'][_0x2a2b('0x1c')]);}_0x5ccafb[_0x2a2b('0x32')]=qs['sort'](_0x43d3e0['query'][_0x2a2b('0x33')]);_0x5ccafb['where']=qs[_0x2a2b('0x2b')](_[_0x2a2b('0x34')](_0x43d3e0[_0x2a2b('0x2a')],_0xba3acb[_0x2a2b('0x2b')]));if(_0x43d3e0['query']['filter']){_0x5ccafb['where']=_[_0x2a2b('0x35')](_0x5ccafb[_0x2a2b('0x36')],{'$or':_[_0x2a2b('0x37')](_0x4d2880,function(_0x24293f){if(_0x24293f[_0x2a2b('0x38')][_0x2a2b('0x39')]!==_0x2a2b('0x3a')){var _0x2a72b6={};_0x2a72b6[_0x24293f['field']]={'$like':'%'+_0x43d3e0['query'][_0x2a2b('0x3b')]+'%'};return _0x2a72b6;}})});}_0x5ccafb=_[_0x2a2b('0x35')]({},_0x5ccafb,_0x43d3e0[_0x2a2b('0x3c')]);var _0x34d715={'where':_0x5ccafb[_0x2a2b('0x36')]};return db['FaxTransferReport']['count'](_0x34d715)['then'](function(_0x4bac9d){_0x57ced5[_0x2a2b('0x1b')]=_0x4bac9d;if(_0x43d3e0['query']['includeAll']){_0x5ccafb[_0x2a2b('0x3d')]=[{'all':!![]}];}return db[_0x2a2b('0x26')][_0x2a2b('0x3e')](_0x5ccafb);})['then'](function(_0x214412){_0x57ced5[_0x2a2b('0x3f')]=_0x214412;return _0x57ced5;})[_0x2a2b('0x21')](respondWithFilteredResult(_0x19205e,_0x5ccafb))['catch'](handleError(_0x19205e,null));};exports[_0x2a2b('0x40')]=function(_0x2bef9b,_0x2a5c53){var _0x45b4ee={'raw':!![],'where':{'id':_0x2bef9b[_0x2a2b('0x41')]['id']}},_0x218e18={};_0x218e18[_0x2a2b('0x28')]=_[_0x2a2b('0x29')](db[_0x2a2b('0x26')][_0x2a2b('0x27')]);_0x218e18[_0x2a2b('0x2a')]=_['keys'](_0x2bef9b[_0x2a2b('0x2a')]);_0x218e18[_0x2a2b('0x2b')]=_[_0x2a2b('0x2c')](_0x218e18[_0x2a2b('0x28')],_0x218e18['query']);_0x45b4ee[_0x2a2b('0x2e')]=_['intersection'](_0x218e18[_0x2a2b('0x28')],qs['fields'](_0x2bef9b[_0x2a2b('0x2a')][_0x2a2b('0x2d')]));_0x45b4ee[_0x2a2b('0x2e')]=_0x45b4ee['attributes']['length']?_0x45b4ee[_0x2a2b('0x2e')]:_0x218e18[_0x2a2b('0x28')];if(_0x2bef9b[_0x2a2b('0x2a')][_0x2a2b('0x42')]){_0x45b4ee[_0x2a2b('0x3d')]=[{'all':!![]}];}_0x45b4ee=_[_0x2a2b('0x35')]({},_0x45b4ee,_0x2bef9b[_0x2a2b('0x3c')]);return db[_0x2a2b('0x26')][_0x2a2b('0x43')](_0x45b4ee)[_0x2a2b('0x21')](handleEntityNotFound(_0x2a5c53,null))[_0x2a2b('0x21')](respondWithResult(_0x2a5c53,null))['catch'](handleError(_0x2a5c53,null));};exports[_0x2a2b('0x44')]=function(_0x1a89d4,_0x5ada1f){return db[_0x2a2b('0x26')][_0x2a2b('0x44')](_0x1a89d4['body'],{})[_0x2a2b('0x21')](respondWithResult(_0x5ada1f,0xc9))['catch'](handleError(_0x5ada1f,null));};exports[_0x2a2b('0x20')]=function(_0x1aeb19,_0x5a27d4){if(_0x1aeb19[_0x2a2b('0x45')]['id']){delete _0x1aeb19['body']['id'];}return db[_0x2a2b('0x26')][_0x2a2b('0x43')]({'where':{'id':_0x1aeb19['params']['id']}})[_0x2a2b('0x21')](handleEntityNotFound(_0x5a27d4,null))[_0x2a2b('0x21')](saveUpdates(_0x1aeb19[_0x2a2b('0x45')],null))['then'](respondWithResult(_0x5a27d4,null))[_0x2a2b('0x46')](handleError(_0x5a27d4,null));};exports[_0x2a2b('0x47')]=function(_0x2ab9b5,_0x536215){return db[_0x2a2b('0x26')][_0x2a2b('0x43')]({'where':{'id':_0x2ab9b5[_0x2a2b('0x41')]['id']}})[_0x2a2b('0x21')](handleEntityNotFound(_0x536215,null))[_0x2a2b('0x21')](removeEntity(_0x536215,null))[_0x2a2b('0x46')](handleError(_0x536215,null));};exports[_0x2a2b('0x48')]=function(_0x549aa0,_0x1b6db2){return db[_0x2a2b('0x26')][_0x2a2b('0x48')]()[_0x2a2b('0x21')](respondWithResult(_0x1b6db2,null))[_0x2a2b('0x46')](handleError(_0x1b6db2,null));};
\ No newline at end of file
+var _0x8610=['length','hasOwnProperty','sort','filters','pick','filter','where','merge','map','key','field','count','findAll','rows','show','params','keys','includeAll','include','options','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FaxTransferReport','rawAttributes','model','query','intersection','attributes','fields'];(function(_0x5de840,_0x37b17a){var _0x241733=function(_0x23f55c){while(--_0x23f55c){_0x5de840['push'](_0x5de840['shift']());}};_0x241733(++_0x37b17a);}(_0x8610,0xf1));var _0x0861=function(_0x5e25e9,_0x521c9d){_0x5e25e9=_0x5e25e9-0x0;var _0x4d4318=_0x8610[_0x5e25e9];return _0x4d4318;};'use strict';var pdf=require(_0x0861('0x0'));var emlformat=require(_0x0861('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0861('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0861('0x3'));var Mustache=require('mustache');var util=require(_0x0861('0x4'));var path=require(_0x0861('0x5'));var sox=require('sox');var csv=require(_0x0861('0x6'));var ejs=require(_0x0861('0x7'));var fs=require('fs');var _=require(_0x0861('0x8'));var squel=require(_0x0861('0x9'));var crypto=require(_0x0861('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0861('0xb'));var toCsv=require(_0x0861('0x6'));var querystring=require(_0x0861('0xc'));var Papa=require(_0x0861('0xd'));var Redis=require(_0x0861('0xe'));var authService=require(_0x0861('0xf'));var qs=require(_0x0861('0x10'));var hardwareService=require(_0x0861('0x11'));var logger=require('../../config/logger')(_0x0861('0x12'));var utils=require('../../config/utils');var config=require(_0x0861('0x13'));var db=require(_0x0861('0x14'))['db'];function respondWithStatusCode(_0x28482f,_0x3c1646){_0x3c1646=_0x3c1646||0xcc;return function(_0x2816a9){if(_0x2816a9){return _0x28482f[_0x0861('0x15')](_0x3c1646);}return _0x28482f[_0x0861('0x16')](_0x3c1646)[_0x0861('0x17')]();};}function respondWithResult(_0x16f29a,_0x1b9553){_0x1b9553=_0x1b9553||0xc8;return function(_0x4780bd){if(_0x4780bd){return _0x16f29a[_0x0861('0x16')](_0x1b9553)[_0x0861('0x18')](_0x4780bd);}};}function respondWithFilteredResult(_0x3836a5,_0x4222a7){return function(_0x40e548){if(_0x40e548){var _0x1c264b=_0x40e548['count'],_0x418668=_0x4222a7['offset'],_0x546145=_0x4222a7[_0x0861('0x19')]+_0x4222a7[_0x0861('0x1a')],_0x3bab33;if(_0x546145>=_0x1c264b){_0x546145=_0x1c264b;_0x3bab33=0xc8;}else{_0x3bab33=0xce;}_0x3836a5[_0x0861('0x16')](_0x3bab33);return _0x3836a5[_0x0861('0x1b')](_0x0861('0x1c'),_0x418668+'-'+_0x546145+'/'+_0x1c264b)[_0x0861('0x18')](_0x40e548);}return null;};}function patchUpdates(_0x204a49){return function(_0x17ce18){try{jsonpatch[_0x0861('0x1d')](_0x17ce18,_0x204a49,!![]);}catch(_0xe4cd49){return BPromise[_0x0861('0x1e')](_0xe4cd49);}return _0x17ce18[_0x0861('0x1f')]();};}function saveUpdates(_0xae21a9,_0x558807){return function(_0xd206dd){if(_0xd206dd){return _0xd206dd[_0x0861('0x20')](_0xae21a9)[_0x0861('0x21')](function(_0x2cf642){return _0x2cf642;});}return null;};}function removeEntity(_0x4c5296,_0x1a0f25){return function(_0x1893c8){if(_0x1893c8){return _0x1893c8[_0x0861('0x22')]()[_0x0861('0x21')](function(){_0x4c5296[_0x0861('0x16')](0xcc)[_0x0861('0x17')]();});}};}function handleEntityNotFound(_0x4281f4,_0x99a740){return function(_0x3fd705){if(!_0x3fd705){_0x4281f4[_0x0861('0x15')](0x194);}return _0x3fd705;};}function handleError(_0x354e03,_0x2adb8d){_0x2adb8d=_0x2adb8d||0x1f4;return function(_0x4cd468){logger[_0x0861('0x23')](_0x4cd468[_0x0861('0x24')]);if(_0x4cd468['name']){delete _0x4cd468[_0x0861('0x25')];}_0x354e03[_0x0861('0x16')](_0x2adb8d)[_0x0861('0x26')](_0x4cd468);};}exports[_0x0861('0x27')]=function(_0x521da1,_0x331b55){var _0x2ebe1b={},_0x381532={},_0x539d59={'count':0x0,'rows':[]};var _0x5887ad=db[_0x0861('0x28')][_0x0861('0x29')];_0x381532[_0x0861('0x2a')]=_['keys'](_0x5887ad);_0x381532[_0x0861('0x2b')]=_['keys'](_0x521da1[_0x0861('0x2b')]);_0x381532['filters']=_[_0x0861('0x2c')](_0x381532[_0x0861('0x2a')],_0x381532['query']);_0x2ebe1b[_0x0861('0x2d')]=_[_0x0861('0x2c')](_0x381532[_0x0861('0x2a')],qs[_0x0861('0x2e')](_0x521da1[_0x0861('0x2b')]['fields']));_0x2ebe1b['attributes']=_0x2ebe1b[_0x0861('0x2d')][_0x0861('0x2f')]?_0x2ebe1b[_0x0861('0x2d')]:_0x381532['model'];if(!_0x521da1[_0x0861('0x2b')][_0x0861('0x30')]('nolimit')){_0x2ebe1b[_0x0861('0x1a')]=qs[_0x0861('0x1a')](_0x521da1[_0x0861('0x2b')][_0x0861('0x1a')]);_0x2ebe1b['offset']=qs[_0x0861('0x19')](_0x521da1['query']['offset']);}_0x2ebe1b['order']=qs[_0x0861('0x31')](_0x521da1['query']['sort']);_0x2ebe1b['where']=qs[_0x0861('0x32')](_[_0x0861('0x33')](_0x521da1[_0x0861('0x2b')],_0x381532['filters']));if(_0x521da1[_0x0861('0x2b')][_0x0861('0x34')]){_0x2ebe1b[_0x0861('0x35')]=_[_0x0861('0x36')](_0x2ebe1b[_0x0861('0x35')],{'$or':_[_0x0861('0x37')](_0x5887ad,function(_0x2d0db9){if(_0x2d0db9['type'][_0x0861('0x38')]!=='VIRTUAL'){var _0x139850={};_0x139850[_0x2d0db9[_0x0861('0x39')]]={'$like':'%'+_0x521da1['query']['filter']+'%'};return _0x139850;}})});}_0x2ebe1b=_[_0x0861('0x36')]({},_0x2ebe1b,_0x521da1['options']);var _0x183094={'where':_0x2ebe1b[_0x0861('0x35')]};return db['FaxTransferReport'][_0x0861('0x3a')](_0x183094)[_0x0861('0x21')](function(_0x304580){_0x539d59[_0x0861('0x3a')]=_0x304580;if(_0x521da1[_0x0861('0x2b')]['includeAll']){_0x2ebe1b['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x0861('0x3b')](_0x2ebe1b);})[_0x0861('0x21')](function(_0xb2357d){_0x539d59[_0x0861('0x3c')]=_0xb2357d;return _0x539d59;})[_0x0861('0x21')](respondWithFilteredResult(_0x331b55,_0x2ebe1b))['catch'](handleError(_0x331b55,null));};exports[_0x0861('0x3d')]=function(_0x130a2f,_0x99a986){var _0x1d2e91={'raw':!![],'where':{'id':_0x130a2f[_0x0861('0x3e')]['id']}},_0xc0ac36={};_0xc0ac36[_0x0861('0x2a')]=_[_0x0861('0x3f')](db[_0x0861('0x28')][_0x0861('0x29')]);_0xc0ac36['query']=_[_0x0861('0x3f')](_0x130a2f[_0x0861('0x2b')]);_0xc0ac36[_0x0861('0x32')]=_[_0x0861('0x2c')](_0xc0ac36[_0x0861('0x2a')],_0xc0ac36[_0x0861('0x2b')]);_0x1d2e91[_0x0861('0x2d')]=_[_0x0861('0x2c')](_0xc0ac36[_0x0861('0x2a')],qs[_0x0861('0x2e')](_0x130a2f[_0x0861('0x2b')][_0x0861('0x2e')]));_0x1d2e91[_0x0861('0x2d')]=_0x1d2e91['attributes']['length']?_0x1d2e91[_0x0861('0x2d')]:_0xc0ac36[_0x0861('0x2a')];if(_0x130a2f[_0x0861('0x2b')][_0x0861('0x40')]){_0x1d2e91[_0x0861('0x41')]=[{'all':!![]}];}_0x1d2e91=_[_0x0861('0x36')]({},_0x1d2e91,_0x130a2f[_0x0861('0x42')]);return db[_0x0861('0x28')][_0x0861('0x43')](_0x1d2e91)[_0x0861('0x21')](handleEntityNotFound(_0x99a986,null))[_0x0861('0x21')](respondWithResult(_0x99a986,null))[_0x0861('0x44')](handleError(_0x99a986,null));};exports[_0x0861('0x45')]=function(_0x2e7bd3,_0x98de4d){return db[_0x0861('0x28')][_0x0861('0x45')](_0x2e7bd3[_0x0861('0x46')],{})[_0x0861('0x21')](respondWithResult(_0x98de4d,0xc9))[_0x0861('0x44')](handleError(_0x98de4d,null));};exports[_0x0861('0x20')]=function(_0x3f9c1d,_0x19e1a0){if(_0x3f9c1d[_0x0861('0x46')]['id']){delete _0x3f9c1d[_0x0861('0x46')]['id'];}return db[_0x0861('0x28')][_0x0861('0x43')]({'where':{'id':_0x3f9c1d[_0x0861('0x3e')]['id']}})[_0x0861('0x21')](handleEntityNotFound(_0x19e1a0,null))[_0x0861('0x21')](saveUpdates(_0x3f9c1d[_0x0861('0x46')],null))[_0x0861('0x21')](respondWithResult(_0x19e1a0,null))[_0x0861('0x44')](handleError(_0x19e1a0,null));};exports[_0x0861('0x22')]=function(_0x30af3f,_0x205f4f){return db[_0x0861('0x28')]['find']({'where':{'id':_0x30af3f[_0x0861('0x3e')]['id']}})[_0x0861('0x21')](handleEntityNotFound(_0x205f4f,null))[_0x0861('0x21')](removeEntity(_0x205f4f,null))[_0x0861('0x44')](handleError(_0x205f4f,null));};exports[_0x0861('0x47')]=function(_0x1f3d40,_0xaed7d1){return db[_0x0861('0x28')][_0x0861('0x47')]()[_0x0861('0x21')](respondWithResult(_0xaed7d1,null))['catch'](handleError(_0xaed7d1,null));};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js
index c264a4f..1e87fdb 100644
--- a/server/api/faxTransferReport/faxTransferReport.model.js
+++ b/server/api/faxTransferReport/faxTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c82=['../../config/logger','moment','bluebird','request-promise','path','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util'];(function(_0x1a116d,_0x30acd0){var _0x10bd1b=function(_0x545a9a){while(--_0x545a9a){_0x1a116d['push'](_0x1a116d['shift']());}};_0x10bd1b(++_0x30acd0);}(_0x3c82,0xe2));var _0x23c8=function(_0x348a50,_0xe211f1){_0x348a50=_0x348a50-0x0;var _0x29beb2=_0x3c82[_0x348a50];return _0x29beb2;};'use strict';var _=require(_0x23c8('0x0'));var util=require(_0x23c8('0x1'));var logger=require(_0x23c8('0x2'))('api');var moment=require(_0x23c8('0x3'));var BPromise=require(_0x23c8('0x4'));var rp=require(_0x23c8('0x5'));var fs=require('fs');var path=require(_0x23c8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x23c8('0x7'));module[_0x23c8('0x8')]=function(_0x3aa15e,_0xeaae97){return _0x3aa15e[_0x23c8('0x9')](_0x23c8('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x23c8('0xb'),'fields':[_0x23c8('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x88d0=['request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1b6563,_0x3bf0f1){var _0xdea7b8=function(_0x49e6c6){while(--_0x49e6c6){_0x1b6563['push'](_0x1b6563['shift']());}};_0xdea7b8(++_0x3bf0f1);}(_0x88d0,0x19f));var _0x088d=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x88d0[_0xbb14db];return _0x36bed7;};'use strict';var _=require(_0x088d('0x0'));var util=require('util');var logger=require(_0x088d('0x1'))(_0x088d('0x2'));var moment=require(_0x088d('0x3'));var BPromise=require(_0x088d('0x4'));var rp=require(_0x088d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x088d('0x6'));var config=require(_0x088d('0x7'));var attributes=require(_0x088d('0x8'));module[_0x088d('0x9')]=function(_0x1790fd,_0x174378){return _0x1790fd[_0x088d('0xa')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x088d('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js
index 37809bd..dd995cd 100644
--- a/server/api/faxTransferReport/faxTransferReport.rpc.js
+++ b/server/api/faxTransferReport/faxTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1e3d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x10f9e1,_0x4c7e0b){var _0x371f06=function(_0x475661){while(--_0x475661){_0x10f9e1['push'](_0x10f9e1['shift']());}};_0x371f06(++_0x4c7e0b);}(_0x1e3d,0x134));var _0xd1e3=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x1e3d[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xd1e3('0x0'));var util=require(_0xd1e3('0x1'));var moment=require(_0xd1e3('0x2'));var BPromise=require(_0xd1e3('0x3'));var rs=require(_0xd1e3('0x4'));var fs=require('fs');var Redis=require(_0xd1e3('0x5'));var db=require(_0xd1e3('0x6'))['db'];var utils=require(_0xd1e3('0x7'));var logger=require(_0xd1e3('0x8'))('rpc');var config=require(_0xd1e3('0x9'));var jayson=require(_0xd1e3('0xa'));var client=jayson[_0xd1e3('0xb')][_0xd1e3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a89bf,_0x440b71,_0x3d060b){return new BPromise(function(_0x53166e,_0x45c35e){return client[_0xd1e3('0xd')](_0x2a89bf,_0x3d060b)['then'](function(_0x13e2d5){logger[_0xd1e3('0xe')](_0xd1e3('0xf'),_0x440b71,_0xd1e3('0x10'));logger[_0xd1e3('0x11')](_0xd1e3('0x12'),_0x440b71,_0xd1e3('0x10'),JSON[_0xd1e3('0x13')](_0x13e2d5));if(_0x13e2d5[_0xd1e3('0x14')]){if(_0x13e2d5['error']['code']===0x1f4){logger[_0xd1e3('0x14')](_0xd1e3('0xf'),_0x440b71,_0x13e2d5[_0xd1e3('0x14')][_0xd1e3('0x15')]);return _0x45c35e(_0x13e2d5[_0xd1e3('0x14')][_0xd1e3('0x15')]);}logger['error'](_0xd1e3('0xf'),_0x440b71,_0x13e2d5[_0xd1e3('0x14')]['message']);return _0x53166e(_0x13e2d5[_0xd1e3('0x14')][_0xd1e3('0x15')]);}else{logger[_0xd1e3('0xe')](_0xd1e3('0xf'),_0x440b71,'request\x20sent');_0x53166e(_0x13e2d5[_0xd1e3('0x16')][_0xd1e3('0x15')]);}})[_0xd1e3('0x17')](function(_0x4cf328){logger['error'](_0xd1e3('0xf'),_0x440b71,_0x4cf328);_0x45c35e(_0x4cf328);});});}
\ No newline at end of file
+var _0x0a77=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','FaxTransferReport,\x20%s,\x20%s','info'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0x0a77,0x142));var _0x70a7=function(_0x547212,_0x688ffc){_0x547212=_0x547212-0x0;var _0x5c260d=_0x0a77[_0x547212];return _0x5c260d;};'use strict';var _=require('lodash');var util=require(_0x70a7('0x0'));var moment=require(_0x70a7('0x1'));var BPromise=require(_0x70a7('0x2'));var rs=require(_0x70a7('0x3'));var fs=require('fs');var Redis=require(_0x70a7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x70a7('0x5'));var logger=require('../../config/logger')(_0x70a7('0x6'));var config=require('../../config/environment');var jayson=require(_0x70a7('0x7'));var client=jayson[_0x70a7('0x8')][_0x70a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ecda5,_0x17aa7e,_0x30e9d3){return new BPromise(function(_0x1d17fd,_0x49c0bb){return client[_0x70a7('0xa')](_0x5ecda5,_0x30e9d3)['then'](function(_0x4c06e4){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x17aa7e,'request\x20sent');logger['debug'](_0x70a7('0xb'),_0x17aa7e,_0x70a7('0xc'),JSON['stringify'](_0x4c06e4));if(_0x4c06e4[_0x70a7('0xd')]){if(_0x4c06e4[_0x70a7('0xd')][_0x70a7('0xe')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x17aa7e,_0x4c06e4[_0x70a7('0xd')][_0x70a7('0xf')]);return _0x49c0bb(_0x4c06e4['error'][_0x70a7('0xf')]);}logger[_0x70a7('0xd')](_0x70a7('0x10'),_0x17aa7e,_0x4c06e4[_0x70a7('0xd')][_0x70a7('0xf')]);return _0x1d17fd(_0x4c06e4[_0x70a7('0xd')][_0x70a7('0xf')]);}else{logger[_0x70a7('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x17aa7e,_0x70a7('0xc'));_0x1d17fd(_0x4c06e4[_0x70a7('0x12')][_0x70a7('0xf')]);}})[_0x70a7('0x13')](function(_0x4d7588){logger[_0x70a7('0xd')](_0x70a7('0x10'),_0x17aa7e,_0x4d7588);_0x49c0bb(_0x4d7588);});});}
\ No newline at end of file
diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js
index f15b105..6e0b9a6 100644
--- a/server/api/faxTransferReport/index.js
+++ b/server/api/faxTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac31=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put'];(function(_0x358df8,_0x4cb3e7){var _0x58320c=function(_0x4f36e4){while(--_0x4f36e4){_0x358df8['push'](_0x358df8['shift']());}};_0x58320c(++_0x4cb3e7);}(_0xac31,0xca));var _0x1ac3=function(_0xc9c87a,_0x507f97){_0xc9c87a=_0xc9c87a-0x0;var _0x38e1c9=_0xac31[_0xc9c87a];return _0x38e1c9;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var auth=require(_0x1ac3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ac3('0x7'));var controller=require(_0x1ac3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ac3('0x9')]);router[_0x1ac3('0xa')](_0x1ac3('0xb'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0xd')]);router['get'](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0x10')]('/',auth[_0x1ac3('0xc')](),controller['create']);router[_0x1ac3('0x11')](_0x1ac3('0xe'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0x12')]);router[_0x1ac3('0x13')](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0x14')]);module[_0x1ac3('0x15')]=router;
\ No newline at end of file
+var _0x0e85=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0e85,0x7c));var _0x50e8=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x0e85[_0x1a72f3];return _0x57ef47;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x50e8('0x4'));var controller=require('./faxTransferReport.controller');router[_0x50e8('0x5')]('/',auth[_0x50e8('0x6')](),controller[_0x50e8('0x7')]);router[_0x50e8('0x5')]('/describe',auth[_0x50e8('0x6')](),controller[_0x50e8('0x8')]);router[_0x50e8('0x5')](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xa')]);router['post']('/',auth[_0x50e8('0x6')](),controller[_0x50e8('0xb')]);router[_0x50e8('0xc')](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xd')]);router[_0x50e8('0xe')](_0x50e8('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x50e8('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js
index d63fc22..c10eae2 100644
--- a/server/api/intDeskAccount/index.js
+++ b/server/api/intDeskAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd36=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index'];(function(_0x15876c,_0x510dd4){var _0x39d91b=function(_0x2a692c){while(--_0x2a692c){_0x15876c['push'](_0x15876c['shift']());}};_0x39d91b(++_0x510dd4);}(_0xcd36,0x15f));var _0x6cd3=function(_0x55f84e,_0x193da0){_0x55f84e=_0x55f84e-0x0;var _0x4e6d3a=_0xcd36[_0x55f84e];return _0x4e6d3a;};'use strict';var multer=require(_0x6cd3('0x0'));var util=require(_0x6cd3('0x1'));var path=require(_0x6cd3('0x2'));var timeout=require(_0x6cd3('0x3'));var express=require(_0x6cd3('0x4'));var router=express[_0x6cd3('0x5')]();var auth=require(_0x6cd3('0x6'));var interaction=require(_0x6cd3('0x7'));var config=require(_0x6cd3('0x8'));var controller=require(_0x6cd3('0x9'));router[_0x6cd3('0xa')]('/',auth[_0x6cd3('0xb')](),controller[_0x6cd3('0xc')]);router[_0x6cd3('0xa')](_0x6cd3('0xd'),auth[_0x6cd3('0xb')](),controller[_0x6cd3('0xe')]);router[_0x6cd3('0xa')](_0x6cd3('0xf'),auth['isAuthenticated'](),controller[_0x6cd3('0x10')]);router[_0x6cd3('0xa')](_0x6cd3('0x11'),auth['isAuthenticated'](),controller[_0x6cd3('0x12')]);router[_0x6cd3('0x13')]('/',auth[_0x6cd3('0xb')](),controller[_0x6cd3('0x14')]);router[_0x6cd3('0x13')](_0x6cd3('0xf'),auth[_0x6cd3('0xb')](),controller[_0x6cd3('0x15')]);router[_0x6cd3('0x16')](_0x6cd3('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6cd3('0x17')](_0x6cd3('0xd'),auth['isAuthenticated'](),controller[_0x6cd3('0x18')]);module[_0x6cd3('0x19')]=router;
\ No newline at end of file
+var _0x2e10=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','update','delete'];(function(_0x1de7c6,_0x50fea1){var _0x2eec14=function(_0x2204dc){while(--_0x2204dc){_0x1de7c6['push'](_0x1de7c6['shift']());}};_0x2eec14(++_0x50fea1);}(_0x2e10,0x162));var _0x02e1=function(_0x590b41,_0x12a434){_0x590b41=_0x590b41-0x0;var _0x17884b=_0x2e10[_0x590b41];return _0x17884b;};'use strict';var multer=require(_0x02e1('0x0'));var util=require(_0x02e1('0x1'));var path=require(_0x02e1('0x2'));var timeout=require(_0x02e1('0x3'));var express=require(_0x02e1('0x4'));var router=express['Router']();var auth=require(_0x02e1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x02e1('0x6'));var controller=require(_0x02e1('0x7'));router[_0x02e1('0x8')]('/',auth[_0x02e1('0x9')](),controller[_0x02e1('0xa')]);router[_0x02e1('0x8')](_0x02e1('0xb'),auth[_0x02e1('0x9')](),controller['show']);router[_0x02e1('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x02e1('0xc')]);router[_0x02e1('0x8')]('/:id/fields',auth[_0x02e1('0x9')](),controller[_0x02e1('0xd')]);router[_0x02e1('0xe')]('/',auth[_0x02e1('0x9')](),controller['create']);router['post'](_0x02e1('0xf'),auth[_0x02e1('0x9')](),controller[_0x02e1('0x10')]);router[_0x02e1('0x11')](_0x02e1('0xb'),auth['isAuthenticated'](),controller[_0x02e1('0x12')]);router[_0x02e1('0x13')](_0x02e1('0xb'),auth[_0x02e1('0x9')](),controller[_0x02e1('0x14')]);module[_0x02e1('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js
index 9db1efe..60d705a 100644
--- a/server/api/intDeskAccount/intDeskAccount.attributes.js
+++ b/server/api/intDeskAccount/intDeskAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ddc=['ENUM','basic','integrationTab','sequelize','exports','STRING'];(function(_0x5daaf2,_0x4c0150){var _0x202d70=function(_0x55c0fe){while(--_0x55c0fe){_0x5daaf2['push'](_0x5daaf2['shift']());}};_0x202d70(++_0x4c0150);}(_0x4ddc,0xe1));var _0xc4dd=function(_0x143f0d,_0x3f2e29){_0x143f0d=_0x143f0d-0x0;var _0x2c3801=_0x4ddc[_0x143f0d];return _0x2c3801;};'use strict';var Sequelize=require(_0xc4dd('0x0'));module[_0xc4dd('0x1')]={'name':{'type':Sequelize[_0xc4dd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc4dd('0x2')]},'remoteUri':{'type':Sequelize[_0xc4dd('0x2')]},'authType':{'type':Sequelize[_0xc4dd('0x3')]('basic'),'defaultValue':_0xc4dd('0x4')},'password':{'type':Sequelize[_0xc4dd('0x2')]},'consumerKey':{'type':Sequelize[_0xc4dd('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc4dd('0x2')]},'tokenSecret':{'type':Sequelize[_0xc4dd('0x2')]},'serverUrl':{'type':Sequelize[_0xc4dd('0x2')]},'type':{'type':Sequelize[_0xc4dd('0x3')](_0xc4dd('0x5'),'newTab'),'defaultValue':_0xc4dd('0x5')}};
\ No newline at end of file
+var _0xbdb7=['basic','integrationTab','sequelize','STRING','ENUM'];(function(_0x2eebb8,_0xaa7269){var _0x6bc75d=function(_0x38b499){while(--_0x38b499){_0x2eebb8['push'](_0x2eebb8['shift']());}};_0x6bc75d(++_0xaa7269);}(_0xbdb7,0x1e7));var _0x7bdb=function(_0x5b6375,_0x563718){_0x5b6375=_0x5b6375-0x0;var _0x4045b4=_0xbdb7[_0x5b6375];return _0x4045b4;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module['exports']={'name':{'type':Sequelize[_0x7bdb('0x1')]},'description':{'type':Sequelize[_0x7bdb('0x1')]},'username':{'type':Sequelize[_0x7bdb('0x1')]},'remoteUri':{'type':Sequelize[_0x7bdb('0x1')]},'authType':{'type':Sequelize[_0x7bdb('0x2')](_0x7bdb('0x3')),'defaultValue':_0x7bdb('0x3')},'password':{'type':Sequelize[_0x7bdb('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x7bdb('0x1')]},'token':{'type':Sequelize[_0x7bdb('0x1')]},'tokenSecret':{'type':Sequelize[_0x7bdb('0x1')]},'serverUrl':{'type':Sequelize[_0x7bdb('0x1')]},'type':{'type':Sequelize[_0x7bdb('0x2')](_0x7bdb('0x4'),'newTab'),'defaultValue':_0x7bdb('0x4')}};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js
index 27e1b12..82b3fe9 100644
--- a/server/api/intDeskAccount/intDeskAccount.controller.js
+++ b/server/api/intDeskAccount/intDeskAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});};
\ No newline at end of file
+var _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js
index 0fa0e6c..78d921d 100644
--- a/server/api/intDeskAccount/intDeskAccount.model.js
+++ b/server/api/intDeskAccount/intDeskAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x668b=['request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x668b,0x140));var _0xb668=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x668b[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var logger=require('../../config/logger')(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require('bluebird');var rp=require(_0xb668('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var attributes=require(_0xb668('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xb668('0x8')]=function(_0x296fa9,_0x3be92e){return _0x296fa9[_0xb668('0x9')](_0xb668('0xa'),attributes,{'tableName':_0xb668('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4522=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts'];(function(_0x46eeb7,_0x2838e8){var _0x65c058=function(_0x2b7aef){while(--_0x2b7aef){_0x46eeb7['push'](_0x46eeb7['shift']());}};_0x65c058(++_0x2838e8);}(_0x4522,0x1a0));var _0x2452=function(_0x35e83a,_0x2c6e73){_0x35e83a=_0x35e83a-0x0;var _0x511947=_0x4522[_0x35e83a];return _0x511947;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2452('0x0'))(_0x2452('0x1'));var moment=require(_0x2452('0x2'));var BPromise=require('bluebird');var rp=require(_0x2452('0x3'));var fs=require('fs');var path=require(_0x2452('0x4'));var rimraf=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var attributes=require(_0x2452('0x7'));var integrations=require(_0x2452('0x8'));module[_0x2452('0x9')]=function(_0x226578,_0x2f0139){return _0x226578[_0x2452('0xa')](_0x2452('0xb'),attributes,{'tableName':_0x2452('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js
index 7e5bd66..43bdee3 100644
--- a/server/api/intDeskAccount/intDeskAccount.rpc.js
+++ b/server/api/intDeskAccount/intDeskAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb5f3=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message','result','GetDeskAccount','DeskAccount','findAll','raw','options','where','attributes','limit','map','include','model','catch','ShowDeskAccount','find','lodash','util','moment','randomstring'];(function(_0x262957,_0x34c699){var _0x27e221=function(_0x49e5cf){while(--_0x49e5cf){_0x262957['push'](_0x262957['shift']());}};_0x27e221(++_0x34c699);}(_0xb5f3,0x137));var _0x3b5f=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0xb5f3[_0x2f4c1c];return _0x25e0f2;};'use strict';var _=require(_0x3b5f('0x0'));var util=require(_0x3b5f('0x1'));var moment=require(_0x3b5f('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b5f('0x3'));var fs=require('fs');var Redis=require(_0x3b5f('0x4'));var db=require(_0x3b5f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b5f('0x6'));var config=require(_0x3b5f('0x7'));var jayson=require(_0x3b5f('0x8'));var client=jayson[_0x3b5f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2db4ad,_0x1b6d67,_0x4edb1a){return new BPromise(function(_0x2e213c,_0x48597e){return client[_0x3b5f('0xa')](_0x2db4ad,_0x4edb1a)[_0x3b5f('0xb')](function(_0x2c37f6){logger[_0x3b5f('0xc')]('DeskAccount,\x20%s,\x20%s',_0x1b6d67,_0x3b5f('0xd'));logger[_0x3b5f('0xe')](_0x3b5f('0xf'),_0x1b6d67,_0x3b5f('0xd'),JSON[_0x3b5f('0x10')](_0x2c37f6));if(_0x2c37f6['error']){if(_0x2c37f6['error']['code']===0x1f4){logger[_0x3b5f('0x11')](_0x3b5f('0x12'),_0x1b6d67,_0x2c37f6[_0x3b5f('0x11')][_0x3b5f('0x13')]);return _0x48597e(_0x2c37f6[_0x3b5f('0x11')][_0x3b5f('0x13')]);}logger[_0x3b5f('0x11')](_0x3b5f('0x12'),_0x1b6d67,_0x2c37f6['error'][_0x3b5f('0x13')]);return _0x2e213c(_0x2c37f6[_0x3b5f('0x11')][_0x3b5f('0x13')]);}else{logger['info'](_0x3b5f('0x12'),_0x1b6d67,'request\x20sent');_0x2e213c(_0x2c37f6[_0x3b5f('0x14')][_0x3b5f('0x13')]);}})['catch'](function(_0x28b6c1){logger[_0x3b5f('0x11')](_0x3b5f('0x12'),_0x1b6d67,_0x28b6c1);_0x48597e(_0x28b6c1);});});}exports[_0x3b5f('0x15')]=function(_0x5ed046){var _0x2db25f=this;return new Promise(function(_0x4933c8,_0x2d3848){return db[_0x3b5f('0x16')][_0x3b5f('0x17')]({'raw':_0x5ed046['options']?_0x5ed046['options'][_0x3b5f('0x18')]===undefined?!![]:![]:!![],'where':_0x5ed046[_0x3b5f('0x19')]?_0x5ed046[_0x3b5f('0x19')][_0x3b5f('0x1a')]||null:null,'attributes':_0x5ed046['options']?_0x5ed046[_0x3b5f('0x19')][_0x3b5f('0x1b')]||null:null,'limit':_0x5ed046[_0x3b5f('0x19')]?_0x5ed046[_0x3b5f('0x19')][_0x3b5f('0x1c')]||null:null,'include':_0x5ed046[_0x3b5f('0x19')]?_0x5ed046['options']['include']?_[_0x3b5f('0x1d')](_0x5ed046[_0x3b5f('0x19')][_0x3b5f('0x1e')],function(_0x25bcf6){return{'model':db[_0x25bcf6[_0x3b5f('0x1f')]],'as':_0x25bcf6['as'],'attributes':_0x25bcf6[_0x3b5f('0x1b')],'include':_0x25bcf6[_0x3b5f('0x1e')]?_[_0x3b5f('0x1d')](_0x25bcf6[_0x3b5f('0x1e')],function(_0x3267b8){return{'model':db[_0x3267b8['model']],'as':_0x3267b8['as'],'attributes':_0x3267b8['attributes'],'include':_0x3267b8[_0x3b5f('0x1e')]?_[_0x3b5f('0x1d')](_0x3267b8[_0x3b5f('0x1e')],function(_0x26c1e0){return{'model':db[_0x26c1e0[_0x3b5f('0x1f')]],'as':_0x26c1e0['as'],'attributes':_0x26c1e0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b5f('0xb')](function(_0x2d5ba1){logger[_0x3b5f('0xc')](_0x3b5f('0x15'),_0x5ed046);logger['debug']('GetDeskAccount',_0x5ed046,JSON[_0x3b5f('0x10')](_0x2d5ba1));_0x4933c8(_0x2d5ba1);})[_0x3b5f('0x20')](function(_0x1533ea){logger['error']('GetDeskAccount',_0x1533ea[_0x3b5f('0x13')],_0x5ed046);_0x2d3848(_0x2db25f[_0x3b5f('0x11')](0x1f4,_0x1533ea['message']));});});};exports[_0x3b5f('0x21')]=function(_0x562f95){var _0xa10ddb=this;return new Promise(function(_0xc266d0,_0x4be2e2){return db['DeskAccount'][_0x3b5f('0x22')]({'raw':_0x562f95[_0x3b5f('0x19')]?_0x562f95[_0x3b5f('0x19')][_0x3b5f('0x18')]===undefined?!![]:![]:!![],'where':_0x562f95[_0x3b5f('0x19')]?_0x562f95[_0x3b5f('0x19')][_0x3b5f('0x1a')]||null:null,'attributes':_0x562f95[_0x3b5f('0x19')]?_0x562f95['options'][_0x3b5f('0x1b')]||null:null,'include':_0x562f95[_0x3b5f('0x19')]?_0x562f95[_0x3b5f('0x19')]['include']?_[_0x3b5f('0x1d')](_0x562f95[_0x3b5f('0x19')][_0x3b5f('0x1e')],function(_0x214dee){return{'model':db[_0x214dee[_0x3b5f('0x1f')]],'as':_0x214dee['as'],'attributes':_0x214dee['attributes'],'include':_0x214dee['include']?_['map'](_0x214dee[_0x3b5f('0x1e')],function(_0x1f660a){return{'model':db[_0x1f660a[_0x3b5f('0x1f')]],'as':_0x1f660a['as'],'attributes':_0x1f660a[_0x3b5f('0x1b')],'include':_0x1f660a[_0x3b5f('0x1e')]?_[_0x3b5f('0x1d')](_0x1f660a['include'],function(_0x185afb){return{'model':db[_0x185afb[_0x3b5f('0x1f')]],'as':_0x185afb['as'],'attributes':_0x185afb[_0x3b5f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x511671){logger[_0x3b5f('0xc')]('ShowDeskAccount',_0x562f95);logger['debug']('ShowDeskAccount',_0x562f95,JSON[_0x3b5f('0x10')](_0x511671));_0xc266d0(_0x511671);})['catch'](function(_0x2a4356){logger[_0x3b5f('0x11')](_0x3b5f('0x21'),_0x2a4356['message'],_0x562f95);_0x4be2e2(_0xa10ddb[_0x3b5f('0x11')](0x1f4,_0x2a4356['message']));});});};
\ No newline at end of file
+var _0xaf97=['request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','map','include','model','ShowDeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x7caa5b,_0x35e10a){var _0x2141e7=function(_0x4572b6){while(--_0x4572b6){_0x7caa5b['push'](_0x7caa5b['shift']());}};_0x2141e7(++_0x35e10a);}(_0xaf97,0x15a));var _0x7af9=function(_0x16f11e,_0xb28359){_0x16f11e=_0x16f11e-0x0;var _0x9df4a2=_0xaf97[_0x16f11e];return _0x9df4a2;};'use strict';var _=require(_0x7af9('0x0'));var util=require(_0x7af9('0x1'));var moment=require(_0x7af9('0x2'));var BPromise=require(_0x7af9('0x3'));var rs=require(_0x7af9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7af9('0x5'))['db'];var utils=require(_0x7af9('0x6'));var logger=require(_0x7af9('0x7'))(_0x7af9('0x8'));var config=require('../../config/environment');var jayson=require(_0x7af9('0x9'));var client=jayson[_0x7af9('0xa')][_0x7af9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x369746,_0x5c98b8,_0x1e9ccc){return new BPromise(function(_0x2055c2,_0x2963b7){return client[_0x7af9('0xc')](_0x369746,_0x1e9ccc)[_0x7af9('0xd')](function(_0x44867d){logger['info']('DeskAccount,\x20%s,\x20%s',_0x5c98b8,_0x7af9('0xe'));logger[_0x7af9('0xf')](_0x7af9('0x10'),_0x5c98b8,'request\x20sent',JSON[_0x7af9('0x11')](_0x44867d));if(_0x44867d[_0x7af9('0x12')]){if(_0x44867d[_0x7af9('0x12')]['code']===0x1f4){logger[_0x7af9('0x12')](_0x7af9('0x13'),_0x5c98b8,_0x44867d[_0x7af9('0x12')][_0x7af9('0x14')]);return _0x2963b7(_0x44867d[_0x7af9('0x12')]['message']);}logger[_0x7af9('0x12')](_0x7af9('0x13'),_0x5c98b8,_0x44867d[_0x7af9('0x12')][_0x7af9('0x14')]);return _0x2055c2(_0x44867d['error'][_0x7af9('0x14')]);}else{logger[_0x7af9('0x15')](_0x7af9('0x13'),_0x5c98b8,_0x7af9('0xe'));_0x2055c2(_0x44867d[_0x7af9('0x16')][_0x7af9('0x14')]);}})[_0x7af9('0x17')](function(_0x238814){logger['error']('DeskAccount,\x20%s,\x20%s',_0x5c98b8,_0x238814);_0x2963b7(_0x238814);});});}exports[_0x7af9('0x18')]=function(_0x383d4a){var _0x306982=this;return new Promise(function(_0x44534f,_0xda9840){return db[_0x7af9('0x19')][_0x7af9('0x1a')]({'raw':_0x383d4a[_0x7af9('0x1b')]?_0x383d4a['options']['raw']===undefined?!![]:![]:!![],'where':_0x383d4a[_0x7af9('0x1b')]?_0x383d4a[_0x7af9('0x1b')][_0x7af9('0x1c')]||null:null,'attributes':_0x383d4a[_0x7af9('0x1b')]?_0x383d4a['options'][_0x7af9('0x1d')]||null:null,'limit':_0x383d4a[_0x7af9('0x1b')]?_0x383d4a[_0x7af9('0x1b')]['limit']||null:null,'include':_0x383d4a[_0x7af9('0x1b')]?_0x383d4a[_0x7af9('0x1b')]['include']?_[_0x7af9('0x1e')](_0x383d4a['options'][_0x7af9('0x1f')],function(_0x5c44ac){return{'model':db[_0x5c44ac[_0x7af9('0x20')]],'as':_0x5c44ac['as'],'attributes':_0x5c44ac[_0x7af9('0x1d')],'include':_0x5c44ac[_0x7af9('0x1f')]?_[_0x7af9('0x1e')](_0x5c44ac['include'],function(_0x2f5b78){return{'model':db[_0x2f5b78[_0x7af9('0x20')]],'as':_0x2f5b78['as'],'attributes':_0x2f5b78[_0x7af9('0x1d')],'include':_0x2f5b78[_0x7af9('0x1f')]?_['map'](_0x2f5b78[_0x7af9('0x1f')],function(_0x256b47){return{'model':db[_0x256b47[_0x7af9('0x20')]],'as':_0x256b47['as'],'attributes':_0x256b47[_0x7af9('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x301f0e){logger[_0x7af9('0x15')](_0x7af9('0x18'),_0x383d4a);logger['debug'](_0x7af9('0x18'),_0x383d4a,JSON[_0x7af9('0x11')](_0x301f0e));_0x44534f(_0x301f0e);})[_0x7af9('0x17')](function(_0x4595e9){logger[_0x7af9('0x12')](_0x7af9('0x18'),_0x4595e9[_0x7af9('0x14')],_0x383d4a);_0xda9840(_0x306982[_0x7af9('0x12')](0x1f4,_0x4595e9[_0x7af9('0x14')]));});});};exports[_0x7af9('0x21')]=function(_0x23b0e2){var _0x239114=this;return new Promise(function(_0x53e592,_0x20705a){return db[_0x7af9('0x19')][_0x7af9('0x22')]({'raw':_0x23b0e2[_0x7af9('0x1b')]?_0x23b0e2['options'][_0x7af9('0x23')]===undefined?!![]:![]:!![],'where':_0x23b0e2[_0x7af9('0x1b')]?_0x23b0e2[_0x7af9('0x1b')]['where']||null:null,'attributes':_0x23b0e2['options']?_0x23b0e2[_0x7af9('0x1b')][_0x7af9('0x1d')]||null:null,'include':_0x23b0e2[_0x7af9('0x1b')]?_0x23b0e2[_0x7af9('0x1b')][_0x7af9('0x1f')]?_[_0x7af9('0x1e')](_0x23b0e2[_0x7af9('0x1b')][_0x7af9('0x1f')],function(_0x3a4200){return{'model':db[_0x3a4200[_0x7af9('0x20')]],'as':_0x3a4200['as'],'attributes':_0x3a4200[_0x7af9('0x1d')],'include':_0x3a4200['include']?_[_0x7af9('0x1e')](_0x3a4200[_0x7af9('0x1f')],function(_0x5cfa0b){return{'model':db[_0x5cfa0b[_0x7af9('0x20')]],'as':_0x5cfa0b['as'],'attributes':_0x5cfa0b[_0x7af9('0x1d')],'include':_0x5cfa0b[_0x7af9('0x1f')]?_['map'](_0x5cfa0b[_0x7af9('0x1f')],function(_0x1c9e89){return{'model':db[_0x1c9e89[_0x7af9('0x20')]],'as':_0x1c9e89['as'],'attributes':_0x1c9e89[_0x7af9('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1aaa45){logger[_0x7af9('0x15')](_0x7af9('0x21'),_0x23b0e2);logger['debug']('ShowDeskAccount',_0x23b0e2,JSON[_0x7af9('0x11')](_0x1aaa45));_0x53e592(_0x1aaa45);})[_0x7af9('0x17')](function(_0x10c830){logger[_0x7af9('0x12')]('ShowDeskAccount',_0x10c830[_0x7af9('0x14')],_0x23b0e2);_0x20705a(_0x239114[_0x7af9('0x12')](0x1f4,_0x10c830[_0x7af9('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js
index 123ac68..fc30b0a 100644
--- a/server/api/intDeskConfiguration/index.js
+++ b/server/api/intDeskConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab91=['show','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','delete','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x59fb6d,_0x2ddf05){var _0x17191f=function(_0x1d72ed){while(--_0x1d72ed){_0x59fb6d['push'](_0x59fb6d['shift']());}};_0x17191f(++_0x2ddf05);}(_0xab91,0xc4));var _0x1ab9=function(_0x44e4a1,_0x3d053a){_0x44e4a1=_0x44e4a1-0x0;var _0x546ad3=_0xab91[_0x44e4a1];return _0x546ad3;};'use strict';var multer=require(_0x1ab9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1ab9('0x1'));var express=require(_0x1ab9('0x2'));var router=express['Router']();var auth=require(_0x1ab9('0x3'));var interaction=require(_0x1ab9('0x4'));var config=require(_0x1ab9('0x5'));var controller=require(_0x1ab9('0x6'));router[_0x1ab9('0x7')]('/',auth[_0x1ab9('0x8')](),controller[_0x1ab9('0x9')]);router[_0x1ab9('0x7')](_0x1ab9('0xa'),auth[_0x1ab9('0x8')](),controller[_0x1ab9('0xb')]);router['get']('/:id/fields',auth[_0x1ab9('0x8')](),controller[_0x1ab9('0xc')]);router[_0x1ab9('0x7')]('/:id/subjects',auth[_0x1ab9('0x8')](),controller[_0x1ab9('0xd')]);router[_0x1ab9('0x7')](_0x1ab9('0xe'),auth[_0x1ab9('0x8')](),controller[_0x1ab9('0xf')]);router[_0x1ab9('0x7')](_0x1ab9('0x10'),auth['isAuthenticated'](),controller['getTags']);router[_0x1ab9('0x11')]('/',auth[_0x1ab9('0x8')](),controller[_0x1ab9('0x12')]);router['post'](_0x1ab9('0x10'),auth['isAuthenticated'](),controller['setTags']);router[_0x1ab9('0x13')]('/:id',auth[_0x1ab9('0x8')](),controller[_0x1ab9('0x14')]);router[_0x1ab9('0x15')](_0x1ab9('0xa'),auth[_0x1ab9('0x8')](),controller['destroy']);module[_0x1ab9('0x16')]=router;
\ No newline at end of file
+var _0x1998=['getSubjects','/:id/descriptions','/:id/tags','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x2f30c3,_0x48192b){var _0x270817=function(_0x1d85f2){while(--_0x1d85f2){_0x2f30c3['push'](_0x2f30c3['shift']());}};_0x270817(++_0x48192b);}(_0x1998,0x1ba));var _0x8199=function(_0x138357,_0x4b54cb){_0x138357=_0x138357-0x0;var _0x3de044=_0x1998[_0x138357];return _0x3de044;};'use strict';var multer=require(_0x8199('0x0'));var util=require(_0x8199('0x1'));var path=require(_0x8199('0x2'));var timeout=require(_0x8199('0x3'));var express=require(_0x8199('0x4'));var router=express[_0x8199('0x5')]();var auth=require(_0x8199('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8199('0x7'));var controller=require(_0x8199('0x8'));router[_0x8199('0x9')]('/',auth[_0x8199('0xa')](),controller[_0x8199('0xb')]);router[_0x8199('0x9')](_0x8199('0xc'),auth['isAuthenticated'](),controller[_0x8199('0xd')]);router[_0x8199('0x9')](_0x8199('0xe'),auth[_0x8199('0xa')](),controller[_0x8199('0xf')]);router['get'](_0x8199('0x10'),auth[_0x8199('0xa')](),controller[_0x8199('0x11')]);router[_0x8199('0x9')](_0x8199('0x12'),auth[_0x8199('0xa')](),controller['getDescriptions']);router[_0x8199('0x9')](_0x8199('0x13'),auth[_0x8199('0xa')](),controller['getTags']);router[_0x8199('0x14')]('/',auth['isAuthenticated'](),controller[_0x8199('0x15')]);router[_0x8199('0x14')]('/:id/tags',auth[_0x8199('0xa')](),controller['setTags']);router[_0x8199('0x16')]('/:id',auth[_0x8199('0xa')](),controller[_0x8199('0x17')]);router[_0x8199('0x18')](_0x8199('0xc'),auth['isAuthenticated'](),controller[_0x8199('0x19')]);module[_0x8199('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
index f6024be..846a875 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x78ae=['exports','STRING','sequelize'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x78ae,0xd7));var _0xe78a=function(_0x2c2d11,_0x4308ac){_0x2c2d11=_0x2c2d11-0x0;var _0x255f24=_0x78ae[_0x2c2d11];return _0x255f24;};'use strict';var Sequelize=require(_0xe78a('0x0'));module[_0xe78a('0x1')]={'name':{'type':Sequelize[_0xe78a('0x2')]},'description':{'type':Sequelize[_0xe78a('0x2')]}};
\ No newline at end of file
+var _0xfc99=['sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfc99,0x7a));var _0x9fc9=function(_0x446aa2,_0x8c82f7){_0x446aa2=_0x446aa2-0x0;var _0x3b8e6d=_0xfc99[_0x446aa2];return _0x3b8e6d;};'use strict';var Sequelize=require(_0x9fc9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js
index c6f7670..428936a 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2335=['rawAttributes','keys','query','filters','attributes','intersection','fields','model','hasOwnProperty','where','pick','type','key','VIRTUAL','field','filter','merge','options','DeskConfiguration','count','include','findAll','show','params','includeAll','find','create','body','getFields','findOne','DeskField','order','sort','map','length','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','end','status','json','offset','limit','set','Content-Range','apply','reject','destroy','sendStatus','stack','name'];(function(_0x4aa863,_0x1b8858){var _0x1974cf=function(_0x34884a){while(--_0x34884a){_0x4aa863['push'](_0x4aa863['shift']());}};_0x1974cf(++_0x1b8858);}(_0x2335,0x199));var _0x5233=function(_0x5e9e57,_0x34e826){_0x5e9e57=_0x5e9e57-0x0;var _0x57a971=_0x2335[_0x5e9e57];return _0x57a971;};'use strict';var pdf=require(_0x5233('0x0'));var emlformat=require(_0x5233('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5233('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5233('0x3'));var moment=require(_0x5233('0x4'));var BPromise=require(_0x5233('0x5'));var Mustache=require(_0x5233('0x6'));var util=require(_0x5233('0x7'));var path=require('path');var sox=require(_0x5233('0x8'));var csv=require(_0x5233('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5233('0xa'));var squel=require('squel');var crypto=require(_0x5233('0xb'));var jsforce=require(_0x5233('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5233('0xd'));var Papa=require(_0x5233('0xe'));var Redis=require('ioredis');var authService=require(_0x5233('0xf'));var qs=require(_0x5233('0x10'));var hardwareService=require(_0x5233('0x11'));var logger=require(_0x5233('0x12'))(_0x5233('0x13'));var utils=require(_0x5233('0x14'));var config=require('../../config/environment');var db=require(_0x5233('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x5233('0x16')][_0x5233('0x17')]({'port':0x232a});function checkPasswordPattern(_0x55c782,_0x514079,_0x307c8f){if(_0x307c8f){var _0x3006db=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3006db[_0x5233('0x18')](_0x514079)){return _0x55c782;}else{throw new Error(_0x5233('0x19'));}}else{return _0x55c782;}}function respondWithRpcPromise(_0x2d05a8,_0x2903cc,_0x4af6f0,_0x172052){return new BPromise(function(_0x545507,_0x1f7e49){var _0x1bc852=_0x172052||client;return _0x1bc852[_0x5233('0x1a')](_0x2d05a8,_0x4af6f0)[_0x5233('0x1b')](function(_0x2f6404){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x2903cc,'request\x20sent');logger[_0x5233('0x1c')](_0x5233('0x1d'),_0x2903cc,'request\x20sent',JSON[_0x5233('0x1e')](_0x2f6404));if(_0x2f6404[_0x5233('0x1f')]){if(_0x2f6404[_0x5233('0x1f')][_0x5233('0x20')]===0x1f4){logger['error'](_0x5233('0x21'),_0x2903cc,_0x2f6404['error']['message']);return _0x1f7e49(_0x2f6404[_0x5233('0x1f')][_0x5233('0x22')]);}logger['error'](_0x5233('0x21'),_0x2903cc,_0x2f6404[_0x5233('0x1f')]['message']);return _0x545507(_0x2f6404['error'][_0x5233('0x22')]);}else{logger[_0x5233('0x23')](_0x5233('0x21'),_0x2903cc,'request\x20sent');_0x545507(_0x2f6404[_0x5233('0x24')][_0x5233('0x22')]);}})[_0x5233('0x25')](function(_0x33f283){logger[_0x5233('0x1f')]('DeskConfiguration,\x20%s,\x20%s',_0x2903cc,_0x33f283);_0x1f7e49(_0x33f283);});});}function respondWithStatusCode(_0x681a00,_0x5afe15){_0x5afe15=_0x5afe15||0xcc;return function(_0x4112f3){if(_0x4112f3){return _0x681a00['sendStatus'](_0x5afe15);}return _0x681a00['status'](_0x5afe15)[_0x5233('0x26')]();};}function respondWithResult(_0x4d0f1b,_0x4b0e31){_0x4b0e31=_0x4b0e31||0xc8;return function(_0x24f3bc){if(_0x24f3bc){return _0x4d0f1b[_0x5233('0x27')](_0x4b0e31)[_0x5233('0x28')](_0x24f3bc);}};}function respondWithFilteredResult(_0x48005b,_0x4e4dae){return function(_0x55c1c7){if(_0x55c1c7){var _0x2a1ee4=_0x55c1c7['count'],_0x29fc5e=_0x4e4dae[_0x5233('0x29')],_0x35e8fe=_0x4e4dae['offset']+_0x4e4dae[_0x5233('0x2a')],_0x4d1bc9;if(_0x35e8fe>=_0x2a1ee4){_0x35e8fe=_0x2a1ee4;_0x4d1bc9=0xc8;}else{_0x4d1bc9=0xce;}_0x48005b['status'](_0x4d1bc9);return _0x48005b[_0x5233('0x2b')](_0x5233('0x2c'),_0x29fc5e+'-'+_0x35e8fe+'/'+_0x2a1ee4)[_0x5233('0x28')](_0x55c1c7);}return null;};}function patchUpdates(_0x3319b9){return function(_0xa24ede){try{jsonpatch[_0x5233('0x2d')](_0xa24ede,_0x3319b9,!![]);}catch(_0x307a47){return BPromise[_0x5233('0x2e')](_0x307a47);}return _0xa24ede['save']();};}function saveUpdates(_0x2613a1,_0x230ef0){return function(_0x3d3e58){if(_0x3d3e58){return _0x3d3e58['update'](_0x2613a1)[_0x5233('0x1b')](function(_0x24171e){return _0x24171e;});}return null;};}function removeEntity(_0x2ad7e9,_0x404f6e){return function(_0x593935){if(_0x593935){return _0x593935[_0x5233('0x2f')]()[_0x5233('0x1b')](function(){_0x2ad7e9[_0x5233('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c1ccc,_0xc7732a){return function(_0x2f2cc2){if(!_0x2f2cc2){_0x1c1ccc[_0x5233('0x30')](0x194);}return _0x2f2cc2;};}function handleError(_0xa13bb7,_0x5ed48d){_0x5ed48d=_0x5ed48d||0x1f4;return function(_0x4289e1){logger[_0x5233('0x1f')](_0x4289e1[_0x5233('0x31')]);if(_0x4289e1[_0x5233('0x32')]){delete _0x4289e1[_0x5233('0x32')];}_0xa13bb7[_0x5233('0x27')](_0x5ed48d)['send'](_0x4289e1);};}exports['index']=function(_0x3fc27d,_0x31e11c){var _0x22683c={},_0x460f9f={},_0x1aa5d6={'count':0x0,'rows':[]};var _0x3e41a1=db['DeskConfiguration'][_0x5233('0x33')];_0x460f9f['model']=_[_0x5233('0x34')](_0x3e41a1);_0x460f9f[_0x5233('0x35')]=_['keys'](_0x3fc27d[_0x5233('0x35')]);_0x460f9f[_0x5233('0x36')]=_['intersection'](_0x460f9f['model'],_0x460f9f[_0x5233('0x35')]);_0x22683c[_0x5233('0x37')]=_[_0x5233('0x38')](_0x460f9f['model'],qs['fields'](_0x3fc27d[_0x5233('0x35')][_0x5233('0x39')]));_0x22683c['attributes']=_0x22683c['attributes']['length']?_0x22683c[_0x5233('0x37')]:_0x460f9f[_0x5233('0x3a')];if(!_0x3fc27d[_0x5233('0x35')][_0x5233('0x3b')]('nolimit')){_0x22683c['limit']=qs[_0x5233('0x2a')](_0x3fc27d[_0x5233('0x35')][_0x5233('0x2a')]);_0x22683c[_0x5233('0x29')]=qs[_0x5233('0x29')](_0x3fc27d[_0x5233('0x35')][_0x5233('0x29')]);}_0x22683c['order']=qs['sort'](_0x3fc27d[_0x5233('0x35')]['sort']);_0x22683c[_0x5233('0x3c')]=qs[_0x5233('0x36')](_[_0x5233('0x3d')](_0x3fc27d[_0x5233('0x35')],_0x460f9f[_0x5233('0x36')]));if(_0x3fc27d[_0x5233('0x35')]['filter']){_0x22683c[_0x5233('0x3c')]=_['merge'](_0x22683c[_0x5233('0x3c')],{'$or':_['map'](_0x3e41a1,function(_0x238e42){if(_0x238e42[_0x5233('0x3e')][_0x5233('0x3f')]!==_0x5233('0x40')){var _0x3319a0={};_0x3319a0[_0x238e42[_0x5233('0x41')]]={'$like':'%'+_0x3fc27d[_0x5233('0x35')][_0x5233('0x42')]+'%'};return _0x3319a0;}})});}_0x22683c=_[_0x5233('0x43')]({},_0x22683c,_0x3fc27d[_0x5233('0x44')]);var _0x22d535={'where':_0x22683c['where']};return db[_0x5233('0x45')][_0x5233('0x46')](_0x22d535)[_0x5233('0x1b')](function(_0x14eb80){_0x1aa5d6[_0x5233('0x46')]=_0x14eb80;if(_0x3fc27d[_0x5233('0x35')]['includeAll']){_0x22683c[_0x5233('0x47')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x5233('0x48')](_0x22683c);})['then'](function(_0x50ef35){_0x1aa5d6['rows']=_0x50ef35;return _0x1aa5d6;})[_0x5233('0x1b')](respondWithFilteredResult(_0x31e11c,_0x22683c))[_0x5233('0x25')](handleError(_0x31e11c,null));};exports[_0x5233('0x49')]=function(_0x40598c,_0x14f673){var _0x53de8e={'raw':![],'where':{'id':_0x40598c[_0x5233('0x4a')]['id']}},_0x24bbe2={};_0x24bbe2['model']=_['keys'](db[_0x5233('0x45')][_0x5233('0x33')]);_0x24bbe2['query']=_[_0x5233('0x34')](_0x40598c[_0x5233('0x35')]);_0x24bbe2[_0x5233('0x36')]=_[_0x5233('0x38')](_0x24bbe2[_0x5233('0x3a')],_0x24bbe2[_0x5233('0x35')]);_0x53de8e[_0x5233('0x37')]=_[_0x5233('0x38')](_0x24bbe2[_0x5233('0x3a')],qs[_0x5233('0x39')](_0x40598c[_0x5233('0x35')][_0x5233('0x39')]));_0x53de8e[_0x5233('0x37')]=_0x53de8e['attributes']['length']?_0x53de8e['attributes']:_0x24bbe2['model'];if(_0x40598c[_0x5233('0x35')][_0x5233('0x4b')]){_0x53de8e[_0x5233('0x47')]=[{'all':!![]}];}_0x53de8e=_[_0x5233('0x43')]({},_0x53de8e,_0x40598c['options']);return db['DeskConfiguration'][_0x5233('0x4c')](_0x53de8e)[_0x5233('0x1b')](handleEntityNotFound(_0x14f673,null))[_0x5233('0x1b')](respondWithResult(_0x14f673,null))[_0x5233('0x25')](handleError(_0x14f673,null));};exports[_0x5233('0x4d')]=function(_0x2dd607,_0x2dff88){return db['DeskConfiguration']['create'](_0x2dd607['body'],{})[_0x5233('0x1b')](respondWithResult(_0x2dff88,0xc9))[_0x5233('0x25')](handleError(_0x2dff88,null));};exports['update']=function(_0x3a12f7,_0x132767){if(_0x3a12f7[_0x5233('0x4e')]['id']){delete _0x3a12f7[_0x5233('0x4e')]['id'];}return db[_0x5233('0x45')][_0x5233('0x4c')]({'where':{'id':_0x3a12f7[_0x5233('0x4a')]['id']}})[_0x5233('0x1b')](handleEntityNotFound(_0x132767,null))['then'](saveUpdates(_0x3a12f7[_0x5233('0x4e')],null))[_0x5233('0x1b')](respondWithResult(_0x132767,null))[_0x5233('0x25')](handleError(_0x132767,null));};exports[_0x5233('0x2f')]=function(_0x4d0143,_0x5a286b){return db[_0x5233('0x45')][_0x5233('0x4c')]({'where':{'id':_0x4d0143[_0x5233('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a286b,null))['then'](removeEntity(_0x5a286b,null))[_0x5233('0x25')](handleError(_0x5a286b,null));};exports[_0x5233('0x4f')]=function(_0x5194cf,_0x10d3b9,_0x4e78fc){var _0x362a3a={};var _0x5c205d={};var _0x31f767;var _0x34881a;return db[_0x5233('0x45')][_0x5233('0x50')]({'where':{'id':_0x5194cf[_0x5233('0x4a')]['id']}})[_0x5233('0x1b')](handleEntityNotFound(_0x10d3b9,null))[_0x5233('0x1b')](function(_0x48d66f){if(_0x48d66f){_0x31f767=_0x48d66f;_0x5c205d['model']=_['keys'](db[_0x5233('0x51')][_0x5233('0x33')]);_0x5c205d['query']=_[_0x5233('0x34')](_0x5194cf['query']);_0x5c205d['filters']=_[_0x5233('0x38')](_0x5c205d[_0x5233('0x3a')],_0x5c205d[_0x5233('0x35')]);_0x362a3a[_0x5233('0x37')]=_[_0x5233('0x38')](_0x5c205d[_0x5233('0x3a')],qs[_0x5233('0x39')](_0x5194cf[_0x5233('0x35')]['fields']));_0x362a3a[_0x5233('0x37')]=_0x362a3a[_0x5233('0x37')]['length']?_0x362a3a['attributes']:_0x5c205d[_0x5233('0x3a')];_0x362a3a[_0x5233('0x52')]=qs[_0x5233('0x53')](_0x5194cf[_0x5233('0x35')]['sort']);_0x362a3a[_0x5233('0x3c')]=qs[_0x5233('0x36')](_[_0x5233('0x3d')](_0x5194cf[_0x5233('0x35')],_0x5c205d[_0x5233('0x36')]));if(_0x5194cf['query'][_0x5233('0x42')]){_0x362a3a['where']=_[_0x5233('0x43')](_0x362a3a[_0x5233('0x3c')],{'$or':_[_0x5233('0x54')](_0x362a3a[_0x5233('0x37')],function(_0x25a36f){var _0x1174b2={};_0x1174b2[_0x25a36f]={'$like':'%'+_0x5194cf[_0x5233('0x35')][_0x5233('0x42')]+'%'};return _0x1174b2;})});}_0x362a3a=_['merge']({},_0x362a3a,_0x5194cf[_0x5233('0x44')]);return _0x31f767[_0x5233('0x4f')](_0x362a3a);}})[_0x5233('0x1b')](function(_0x527d6e){if(_0x527d6e){_0x34881a=_0x527d6e[_0x5233('0x55')];if(!_0x5194cf[_0x5233('0x35')]['hasOwnProperty'](_0x5233('0x56'))){_0x362a3a[_0x5233('0x2a')]=qs[_0x5233('0x2a')](_0x5194cf[_0x5233('0x35')][_0x5233('0x2a')]);_0x362a3a[_0x5233('0x29')]=qs['offset'](_0x5194cf[_0x5233('0x35')]['offset']);}return _0x31f767[_0x5233('0x4f')](_0x362a3a);}})['then'](function(_0x26c092){if(_0x26c092){return _0x26c092?{'count':_0x34881a,'rows':_0x26c092}:null;}})[_0x5233('0x1b')](respondWithResult(_0x10d3b9,null))[_0x5233('0x25')](handleError(_0x10d3b9,null));};exports[_0x5233('0x57')]=function(_0x114936,_0x218b14,_0x406e25){var _0x4f108b={};var _0x6c535c={};var _0x59cd61;var _0x11afd7;return db['DeskConfiguration'][_0x5233('0x50')]({'where':{'id':_0x114936['params']['id']}})['then'](handleEntityNotFound(_0x218b14,null))[_0x5233('0x1b')](function(_0x377546){if(_0x377546){_0x59cd61=_0x377546;_0x6c535c[_0x5233('0x3a')]=_[_0x5233('0x34')](db[_0x5233('0x51')][_0x5233('0x33')]);_0x6c535c[_0x5233('0x35')]=_[_0x5233('0x34')](_0x114936[_0x5233('0x35')]);_0x6c535c[_0x5233('0x36')]=_['intersection'](_0x6c535c[_0x5233('0x3a')],_0x6c535c[_0x5233('0x35')]);_0x4f108b[_0x5233('0x37')]=_[_0x5233('0x38')](_0x6c535c[_0x5233('0x3a')],qs['fields'](_0x114936[_0x5233('0x35')]['fields']));_0x4f108b[_0x5233('0x37')]=_0x4f108b[_0x5233('0x37')][_0x5233('0x55')]?_0x4f108b[_0x5233('0x37')]:_0x6c535c[_0x5233('0x3a')];_0x4f108b[_0x5233('0x52')]=qs['sort'](_0x114936['query'][_0x5233('0x53')]);_0x4f108b[_0x5233('0x3c')]=qs[_0x5233('0x36')](_[_0x5233('0x3d')](_0x114936[_0x5233('0x35')],_0x6c535c['filters']));if(_0x114936['query'][_0x5233('0x42')]){_0x4f108b[_0x5233('0x3c')]=_['merge'](_0x4f108b[_0x5233('0x3c')],{'$or':_[_0x5233('0x54')](_0x4f108b[_0x5233('0x37')],function(_0x574d21){var _0x3d78d7={};_0x3d78d7[_0x574d21]={'$like':'%'+_0x114936[_0x5233('0x35')][_0x5233('0x42')]+'%'};return _0x3d78d7;})});}_0x4f108b=_[_0x5233('0x43')]({},_0x4f108b,_0x114936['options']);return _0x59cd61[_0x5233('0x57')](_0x4f108b);}})[_0x5233('0x1b')](function(_0x326fc4){if(_0x326fc4){_0x11afd7=_0x326fc4[_0x5233('0x55')];if(!_0x114936[_0x5233('0x35')][_0x5233('0x3b')](_0x5233('0x56'))){_0x4f108b['limit']=qs[_0x5233('0x2a')](_0x114936[_0x5233('0x35')]['limit']);_0x4f108b[_0x5233('0x29')]=qs['offset'](_0x114936['query'][_0x5233('0x29')]);}return _0x59cd61[_0x5233('0x57')](_0x4f108b);}})[_0x5233('0x1b')](function(_0x14d620){if(_0x14d620){return _0x14d620?{'count':_0x11afd7,'rows':_0x14d620}:null;}})[_0x5233('0x1b')](respondWithResult(_0x218b14,null))[_0x5233('0x25')](handleError(_0x218b14,null));};exports[_0x5233('0x58')]=function(_0x507e68,_0x476e4e,_0x399872){var _0x4988ba={};var _0x54ecbf={};var _0xf6c964;var _0x3a6a5d;return db[_0x5233('0x45')][_0x5233('0x50')]({'where':{'id':_0x507e68[_0x5233('0x4a')]['id']}})[_0x5233('0x1b')](handleEntityNotFound(_0x476e4e,null))['then'](function(_0x2637f3){if(_0x2637f3){_0xf6c964=_0x2637f3;_0x54ecbf[_0x5233('0x3a')]=_['keys'](db['DeskField']['rawAttributes']);_0x54ecbf[_0x5233('0x35')]=_[_0x5233('0x34')](_0x507e68[_0x5233('0x35')]);_0x54ecbf['filters']=_[_0x5233('0x38')](_0x54ecbf[_0x5233('0x3a')],_0x54ecbf[_0x5233('0x35')]);_0x4988ba[_0x5233('0x37')]=_[_0x5233('0x38')](_0x54ecbf[_0x5233('0x3a')],qs[_0x5233('0x39')](_0x507e68['query'][_0x5233('0x39')]));_0x4988ba['attributes']=_0x4988ba['attributes'][_0x5233('0x55')]?_0x4988ba[_0x5233('0x37')]:_0x54ecbf['model'];_0x4988ba[_0x5233('0x52')]=qs['sort'](_0x507e68[_0x5233('0x35')][_0x5233('0x53')]);_0x4988ba[_0x5233('0x3c')]=qs[_0x5233('0x36')](_[_0x5233('0x3d')](_0x507e68[_0x5233('0x35')],_0x54ecbf[_0x5233('0x36')]));if(_0x507e68[_0x5233('0x35')][_0x5233('0x42')]){_0x4988ba[_0x5233('0x3c')]=_['merge'](_0x4988ba[_0x5233('0x3c')],{'$or':_['map'](_0x4988ba['attributes'],function(_0x26d6d5){var _0x35922c={};_0x35922c[_0x26d6d5]={'$like':'%'+_0x507e68[_0x5233('0x35')][_0x5233('0x42')]+'%'};return _0x35922c;})});}_0x4988ba=_[_0x5233('0x43')]({},_0x4988ba,_0x507e68[_0x5233('0x44')]);return _0xf6c964[_0x5233('0x58')](_0x4988ba);}})['then'](function(_0x556489){if(_0x556489){_0x3a6a5d=_0x556489['length'];if(!_0x507e68[_0x5233('0x35')]['hasOwnProperty']('nolimit')){_0x4988ba[_0x5233('0x2a')]=qs[_0x5233('0x2a')](_0x507e68['query'][_0x5233('0x2a')]);_0x4988ba['offset']=qs[_0x5233('0x29')](_0x507e68[_0x5233('0x35')]['offset']);}return _0xf6c964[_0x5233('0x58')](_0x4988ba);}})['then'](function(_0x18121a){if(_0x18121a){return _0x18121a?{'count':_0x3a6a5d,'rows':_0x18121a}:null;}})[_0x5233('0x1b')](respondWithResult(_0x476e4e,null))[_0x5233('0x25')](handleError(_0x476e4e,null));};exports['getTags']=function(_0x29ec89,_0x40246f,_0x22eb94){var _0x518d23={};var _0x58279f={};var _0x233d76;var _0x4f6ad0;return db[_0x5233('0x45')][_0x5233('0x50')]({'where':{'id':_0x29ec89[_0x5233('0x4a')]['id']}})['then'](handleEntityNotFound(_0x40246f,null))[_0x5233('0x1b')](function(_0x529b33){if(_0x529b33){_0x233d76=_0x529b33;_0x58279f['model']=_['keys'](db[_0x5233('0x59')][_0x5233('0x33')]);_0x58279f[_0x5233('0x35')]=_[_0x5233('0x34')](_0x29ec89['query']);_0x58279f[_0x5233('0x36')]=_['intersection'](_0x58279f['model'],_0x58279f[_0x5233('0x35')]);_0x518d23[_0x5233('0x37')]=_[_0x5233('0x38')](_0x58279f['model'],qs[_0x5233('0x39')](_0x29ec89['query']['fields']));_0x518d23[_0x5233('0x37')]=_0x518d23['attributes'][_0x5233('0x55')]?_0x518d23[_0x5233('0x37')]:_0x58279f[_0x5233('0x3a')];_0x518d23['order']=qs['sort'](_0x29ec89[_0x5233('0x35')]['sort']);_0x518d23[_0x5233('0x3c')]=qs[_0x5233('0x36')](_[_0x5233('0x3d')](_0x29ec89[_0x5233('0x35')],_0x58279f[_0x5233('0x36')]));if(_0x29ec89[_0x5233('0x35')]['filter']){_0x518d23[_0x5233('0x3c')]=_[_0x5233('0x43')](_0x518d23[_0x5233('0x3c')],{'$or':_['map'](_0x518d23['attributes'],function(_0x4b2b3f){var _0x5cf61c={};_0x5cf61c[_0x4b2b3f]={'$like':'%'+_0x29ec89[_0x5233('0x35')][_0x5233('0x42')]+'%'};return _0x5cf61c;})});}_0x518d23=_[_0x5233('0x43')]({},_0x518d23,_0x29ec89[_0x5233('0x44')]);return _0x233d76[_0x5233('0x5a')](_0x518d23);}})['then'](function(_0x191b51){if(_0x191b51){_0x4f6ad0=_0x191b51['length'];if(!_0x29ec89[_0x5233('0x35')]['hasOwnProperty'](_0x5233('0x56'))){_0x518d23[_0x5233('0x2a')]=qs['limit'](_0x29ec89[_0x5233('0x35')][_0x5233('0x2a')]);_0x518d23['offset']=qs['offset'](_0x29ec89['query']['offset']);}return _0x233d76['getTags'](_0x518d23);}})[_0x5233('0x1b')](function(_0x409c19){if(_0x409c19){return _0x409c19?{'count':_0x4f6ad0,'rows':_0x409c19}:null;}})[_0x5233('0x1b')](respondWithResult(_0x40246f,null))[_0x5233('0x25')](handleError(_0x40246f,null));};exports[_0x5233('0x5b')]=function(_0x373ee9,_0x3b60a4,_0x66db74){if(_0x373ee9['body']['id']){delete _0x373ee9[_0x5233('0x4e')]['id'];}return db[_0x5233('0x45')][_0x5233('0x50')]({'where':{'id':_0x373ee9[_0x5233('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b60a4,null))[_0x5233('0x1b')](function(_0x26018f){if(_0x26018f){return _0x26018f['setTags'](_0x373ee9[_0x5233('0x4e')]['ids']||[]);}return null;})['then'](respondWithResult(_0x3b60a4,null))[_0x5233('0x25')](handleError(_0x3b60a4,null));};
\ No newline at end of file
+var _0x253f=['Tag','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','jayson/promise','http','test','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','count','offset','limit','set','apply','reject','update','sendStatus','stack','name','send','index','DeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','params','find','create','body','destroy','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags'];(function(_0x19684b,_0x5117d6){var _0x46325d=function(_0xe29fe7){while(--_0xe29fe7){_0x19684b['push'](_0x19684b['shift']());}};_0x46325d(++_0x5117d6);}(_0x253f,0x110));var _0xf253=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x253f[_0x465028];return _0xb783d4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf253('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf253('0x1'));var jsonpatch=require(_0xf253('0x2'));var rp=require(_0xf253('0x3'));var moment=require(_0xf253('0x4'));var BPromise=require(_0xf253('0x5'));var Mustache=require(_0xf253('0x6'));var util=require(_0xf253('0x7'));var path=require(_0xf253('0x8'));var sox=require(_0xf253('0x9'));var csv=require(_0xf253('0xa'));var ejs=require(_0xf253('0xb'));var fs=require('fs');var _=require(_0xf253('0xc'));var squel=require('squel');var crypto=require(_0xf253('0xd'));var jsforce=require(_0xf253('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf253('0xa'));var querystring=require(_0xf253('0xf'));var Papa=require(_0xf253('0x10'));var Redis=require(_0xf253('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf253('0x12'));var logger=require(_0xf253('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf253('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf253('0x15'));var client=jayson['client'][_0xf253('0x16')]({'port':0x232a});function checkPasswordPattern(_0x4d3fd3,_0x29bf6e,_0x19212b){if(_0x19212b){var _0x5e993c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e993c[_0xf253('0x17')](_0x29bf6e)){return _0x4d3fd3;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4d3fd3;}}function respondWithRpcPromise(_0x12df19,_0x233017,_0x225bde,_0x23ddfe){return new BPromise(function(_0x5a7c54,_0x12e106){var _0x42f4f9=_0x23ddfe||client;return _0x42f4f9[_0xf253('0x18')](_0x12df19,_0x225bde)[_0xf253('0x19')](function(_0x55f7d2){logger[_0xf253('0x1a')](_0xf253('0x1b'),_0x233017,_0xf253('0x1c'));logger[_0xf253('0x1d')](_0xf253('0x1e'),_0x233017,_0xf253('0x1c'),JSON[_0xf253('0x1f')](_0x55f7d2));if(_0x55f7d2['error']){if(_0x55f7d2[_0xf253('0x20')]['code']===0x1f4){logger[_0xf253('0x20')](_0xf253('0x1b'),_0x233017,_0x55f7d2[_0xf253('0x20')][_0xf253('0x21')]);return _0x12e106(_0x55f7d2[_0xf253('0x20')][_0xf253('0x21')]);}logger['error'](_0xf253('0x1b'),_0x233017,_0x55f7d2[_0xf253('0x20')]['message']);return _0x5a7c54(_0x55f7d2['error'][_0xf253('0x21')]);}else{logger[_0xf253('0x1a')](_0xf253('0x1b'),_0x233017,_0xf253('0x1c'));_0x5a7c54(_0x55f7d2[_0xf253('0x22')][_0xf253('0x21')]);}})[_0xf253('0x23')](function(_0x42965a){logger[_0xf253('0x20')]('DeskConfiguration,\x20%s,\x20%s',_0x233017,_0x42965a);_0x12e106(_0x42965a);});});}function respondWithStatusCode(_0x32fefe,_0x74e1e3){_0x74e1e3=_0x74e1e3||0xcc;return function(_0x578116){if(_0x578116){return _0x32fefe['sendStatus'](_0x74e1e3);}return _0x32fefe[_0xf253('0x24')](_0x74e1e3)[_0xf253('0x25')]();};}function respondWithResult(_0x2b46a5,_0x33b117){_0x33b117=_0x33b117||0xc8;return function(_0x5eb8dd){if(_0x5eb8dd){return _0x2b46a5['status'](_0x33b117)[_0xf253('0x26')](_0x5eb8dd);}};}function respondWithFilteredResult(_0x1bf659,_0x2e8696){return function(_0x3661e6){if(_0x3661e6){var _0x346478=_0x3661e6[_0xf253('0x27')],_0x223966=_0x2e8696['offset'],_0x2d8541=_0x2e8696[_0xf253('0x28')]+_0x2e8696[_0xf253('0x29')],_0x470e9e;if(_0x2d8541>=_0x346478){_0x2d8541=_0x346478;_0x470e9e=0xc8;}else{_0x470e9e=0xce;}_0x1bf659['status'](_0x470e9e);return _0x1bf659[_0xf253('0x2a')]('Content-Range',_0x223966+'-'+_0x2d8541+'/'+_0x346478)[_0xf253('0x26')](_0x3661e6);}return null;};}function patchUpdates(_0x158481){return function(_0x2206cb){try{jsonpatch[_0xf253('0x2b')](_0x2206cb,_0x158481,!![]);}catch(_0x2715dd){return BPromise[_0xf253('0x2c')](_0x2715dd);}return _0x2206cb['save']();};}function saveUpdates(_0x6fd7af,_0x524271){return function(_0xbc28db){if(_0xbc28db){return _0xbc28db[_0xf253('0x2d')](_0x6fd7af)[_0xf253('0x19')](function(_0x17e91d){return _0x17e91d;});}return null;};}function removeEntity(_0x1666f1,_0x3efbf5){return function(_0x1f7183){if(_0x1f7183){return _0x1f7183['destroy']()[_0xf253('0x19')](function(){_0x1666f1[_0xf253('0x24')](0xcc)[_0xf253('0x25')]();});}};}function handleEntityNotFound(_0x2c1bef,_0x413ce5){return function(_0xf007e7){if(!_0xf007e7){_0x2c1bef[_0xf253('0x2e')](0x194);}return _0xf007e7;};}function handleError(_0x17477e,_0x2270cf){_0x2270cf=_0x2270cf||0x1f4;return function(_0x274585){logger[_0xf253('0x20')](_0x274585[_0xf253('0x2f')]);if(_0x274585['name']){delete _0x274585[_0xf253('0x30')];}_0x17477e['status'](_0x2270cf)[_0xf253('0x31')](_0x274585);};}exports[_0xf253('0x32')]=function(_0x262778,_0x4a3491){var _0x572544={},_0x4761cb={},_0x38ee12={'count':0x0,'rows':[]};var _0x4b6f1a=db[_0xf253('0x33')][_0xf253('0x34')];_0x4761cb[_0xf253('0x35')]=_[_0xf253('0x36')](_0x4b6f1a);_0x4761cb[_0xf253('0x37')]=_[_0xf253('0x36')](_0x262778[_0xf253('0x37')]);_0x4761cb[_0xf253('0x38')]=_[_0xf253('0x39')](_0x4761cb[_0xf253('0x35')],_0x4761cb[_0xf253('0x37')]);_0x572544[_0xf253('0x3a')]=_[_0xf253('0x39')](_0x4761cb[_0xf253('0x35')],qs['fields'](_0x262778[_0xf253('0x37')][_0xf253('0x3b')]));_0x572544['attributes']=_0x572544[_0xf253('0x3a')][_0xf253('0x3c')]?_0x572544[_0xf253('0x3a')]:_0x4761cb[_0xf253('0x35')];if(!_0x262778[_0xf253('0x37')][_0xf253('0x3d')](_0xf253('0x3e'))){_0x572544['limit']=qs['limit'](_0x262778['query']['limit']);_0x572544[_0xf253('0x28')]=qs[_0xf253('0x28')](_0x262778[_0xf253('0x37')][_0xf253('0x28')]);}_0x572544[_0xf253('0x3f')]=qs[_0xf253('0x40')](_0x262778[_0xf253('0x37')][_0xf253('0x40')]);_0x572544[_0xf253('0x41')]=qs[_0xf253('0x38')](_[_0xf253('0x42')](_0x262778[_0xf253('0x37')],_0x4761cb['filters']));if(_0x262778[_0xf253('0x37')][_0xf253('0x43')]){_0x572544[_0xf253('0x41')]=_[_0xf253('0x44')](_0x572544[_0xf253('0x41')],{'$or':_[_0xf253('0x45')](_0x4b6f1a,function(_0x1bde1){if(_0x1bde1[_0xf253('0x46')]['key']!==_0xf253('0x47')){var _0x140a60={};_0x140a60[_0x1bde1[_0xf253('0x48')]]={'$like':'%'+_0x262778['query'][_0xf253('0x43')]+'%'};return _0x140a60;}})});}_0x572544=_[_0xf253('0x44')]({},_0x572544,_0x262778[_0xf253('0x49')]);var _0x5b5390={'where':_0x572544[_0xf253('0x41')]};return db[_0xf253('0x33')]['count'](_0x5b5390)['then'](function(_0x5da528){_0x38ee12['count']=_0x5da528;if(_0x262778[_0xf253('0x37')][_0xf253('0x4a')]){_0x572544[_0xf253('0x4b')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x572544);})[_0xf253('0x19')](function(_0xb95949){_0x38ee12[_0xf253('0x4c')]=_0xb95949;return _0x38ee12;})[_0xf253('0x19')](respondWithFilteredResult(_0x4a3491,_0x572544))[_0xf253('0x23')](handleError(_0x4a3491,null));};exports['show']=function(_0x3c7450,_0x404be9){var _0x67b00e={'raw':![],'where':{'id':_0x3c7450[_0xf253('0x4d')]['id']}},_0x28cb28={};_0x28cb28[_0xf253('0x35')]=_[_0xf253('0x36')](db[_0xf253('0x33')]['rawAttributes']);_0x28cb28[_0xf253('0x37')]=_[_0xf253('0x36')](_0x3c7450['query']);_0x28cb28['filters']=_[_0xf253('0x39')](_0x28cb28['model'],_0x28cb28[_0xf253('0x37')]);_0x67b00e[_0xf253('0x3a')]=_[_0xf253('0x39')](_0x28cb28[_0xf253('0x35')],qs[_0xf253('0x3b')](_0x3c7450[_0xf253('0x37')][_0xf253('0x3b')]));_0x67b00e[_0xf253('0x3a')]=_0x67b00e[_0xf253('0x3a')]['length']?_0x67b00e[_0xf253('0x3a')]:_0x28cb28[_0xf253('0x35')];if(_0x3c7450['query'][_0xf253('0x4a')]){_0x67b00e['include']=[{'all':!![]}];}_0x67b00e=_[_0xf253('0x44')]({},_0x67b00e,_0x3c7450[_0xf253('0x49')]);return db['DeskConfiguration'][_0xf253('0x4e')](_0x67b00e)[_0xf253('0x19')](handleEntityNotFound(_0x404be9,null))[_0xf253('0x19')](respondWithResult(_0x404be9,null))[_0xf253('0x23')](handleError(_0x404be9,null));};exports[_0xf253('0x4f')]=function(_0x1e4890,_0x536822){return db[_0xf253('0x33')][_0xf253('0x4f')](_0x1e4890[_0xf253('0x50')],{})[_0xf253('0x19')](respondWithResult(_0x536822,0xc9))[_0xf253('0x23')](handleError(_0x536822,null));};exports[_0xf253('0x2d')]=function(_0x596d8f,_0x1f26e7){if(_0x596d8f[_0xf253('0x50')]['id']){delete _0x596d8f['body']['id'];}return db[_0xf253('0x33')][_0xf253('0x4e')]({'where':{'id':_0x596d8f[_0xf253('0x4d')]['id']}})[_0xf253('0x19')](handleEntityNotFound(_0x1f26e7,null))['then'](saveUpdates(_0x596d8f[_0xf253('0x50')],null))[_0xf253('0x19')](respondWithResult(_0x1f26e7,null))[_0xf253('0x23')](handleError(_0x1f26e7,null));};exports[_0xf253('0x51')]=function(_0x5f3c05,_0x5889a4){return db[_0xf253('0x33')]['find']({'where':{'id':_0x5f3c05[_0xf253('0x4d')]['id']}})[_0xf253('0x19')](handleEntityNotFound(_0x5889a4,null))[_0xf253('0x19')](removeEntity(_0x5889a4,null))['catch'](handleError(_0x5889a4,null));};exports[_0xf253('0x52')]=function(_0x410e83,_0x1fbb41,_0x3c559a){var _0x459f51={};var _0x5df2ef={};var _0x12e6d1;var _0x4ba4ac;return db[_0xf253('0x33')][_0xf253('0x53')]({'where':{'id':_0x410e83[_0xf253('0x4d')]['id']}})[_0xf253('0x19')](handleEntityNotFound(_0x1fbb41,null))['then'](function(_0x54b185){if(_0x54b185){_0x12e6d1=_0x54b185;_0x5df2ef['model']=_[_0xf253('0x36')](db[_0xf253('0x54')][_0xf253('0x34')]);_0x5df2ef[_0xf253('0x37')]=_[_0xf253('0x36')](_0x410e83[_0xf253('0x37')]);_0x5df2ef[_0xf253('0x38')]=_[_0xf253('0x39')](_0x5df2ef['model'],_0x5df2ef[_0xf253('0x37')]);_0x459f51[_0xf253('0x3a')]=_['intersection'](_0x5df2ef[_0xf253('0x35')],qs['fields'](_0x410e83[_0xf253('0x37')][_0xf253('0x3b')]));_0x459f51[_0xf253('0x3a')]=_0x459f51[_0xf253('0x3a')][_0xf253('0x3c')]?_0x459f51[_0xf253('0x3a')]:_0x5df2ef[_0xf253('0x35')];_0x459f51[_0xf253('0x3f')]=qs[_0xf253('0x40')](_0x410e83[_0xf253('0x37')][_0xf253('0x40')]);_0x459f51['where']=qs[_0xf253('0x38')](_[_0xf253('0x42')](_0x410e83[_0xf253('0x37')],_0x5df2ef['filters']));if(_0x410e83[_0xf253('0x37')][_0xf253('0x43')]){_0x459f51['where']=_['merge'](_0x459f51[_0xf253('0x41')],{'$or':_[_0xf253('0x45')](_0x459f51[_0xf253('0x3a')],function(_0x8bfa08){var _0x50eb95={};_0x50eb95[_0x8bfa08]={'$like':'%'+_0x410e83['query'][_0xf253('0x43')]+'%'};return _0x50eb95;})});}_0x459f51=_[_0xf253('0x44')]({},_0x459f51,_0x410e83['options']);return _0x12e6d1[_0xf253('0x52')](_0x459f51);}})['then'](function(_0x4fe203){if(_0x4fe203){_0x4ba4ac=_0x4fe203[_0xf253('0x3c')];if(!_0x410e83[_0xf253('0x37')]['hasOwnProperty'](_0xf253('0x3e'))){_0x459f51[_0xf253('0x29')]=qs['limit'](_0x410e83[_0xf253('0x37')][_0xf253('0x29')]);_0x459f51[_0xf253('0x28')]=qs['offset'](_0x410e83[_0xf253('0x37')]['offset']);}return _0x12e6d1[_0xf253('0x52')](_0x459f51);}})['then'](function(_0x39d359){if(_0x39d359){return _0x39d359?{'count':_0x4ba4ac,'rows':_0x39d359}:null;}})[_0xf253('0x19')](respondWithResult(_0x1fbb41,null))[_0xf253('0x23')](handleError(_0x1fbb41,null));};exports[_0xf253('0x55')]=function(_0x413523,_0x191c12,_0xd33fac){var _0x537c42={};var _0xea229b={};var _0x748e4f;var _0x265427;return db[_0xf253('0x33')]['findOne']({'where':{'id':_0x413523['params']['id']}})[_0xf253('0x19')](handleEntityNotFound(_0x191c12,null))['then'](function(_0x3d8862){if(_0x3d8862){_0x748e4f=_0x3d8862;_0xea229b[_0xf253('0x35')]=_['keys'](db['DeskField'][_0xf253('0x34')]);_0xea229b['query']=_['keys'](_0x413523['query']);_0xea229b[_0xf253('0x38')]=_[_0xf253('0x39')](_0xea229b['model'],_0xea229b[_0xf253('0x37')]);_0x537c42[_0xf253('0x3a')]=_[_0xf253('0x39')](_0xea229b[_0xf253('0x35')],qs[_0xf253('0x3b')](_0x413523['query']['fields']));_0x537c42[_0xf253('0x3a')]=_0x537c42[_0xf253('0x3a')][_0xf253('0x3c')]?_0x537c42['attributes']:_0xea229b[_0xf253('0x35')];_0x537c42[_0xf253('0x3f')]=qs['sort'](_0x413523[_0xf253('0x37')][_0xf253('0x40')]);_0x537c42[_0xf253('0x41')]=qs[_0xf253('0x38')](_[_0xf253('0x42')](_0x413523['query'],_0xea229b[_0xf253('0x38')]));if(_0x413523[_0xf253('0x37')][_0xf253('0x43')]){_0x537c42[_0xf253('0x41')]=_[_0xf253('0x44')](_0x537c42[_0xf253('0x41')],{'$or':_[_0xf253('0x45')](_0x537c42[_0xf253('0x3a')],function(_0x3633e5){var _0x2f02f6={};_0x2f02f6[_0x3633e5]={'$like':'%'+_0x413523[_0xf253('0x37')]['filter']+'%'};return _0x2f02f6;})});}_0x537c42=_[_0xf253('0x44')]({},_0x537c42,_0x413523['options']);return _0x748e4f[_0xf253('0x55')](_0x537c42);}})[_0xf253('0x19')](function(_0x2774ed){if(_0x2774ed){_0x265427=_0x2774ed[_0xf253('0x3c')];if(!_0x413523[_0xf253('0x37')][_0xf253('0x3d')](_0xf253('0x3e'))){_0x537c42[_0xf253('0x29')]=qs[_0xf253('0x29')](_0x413523[_0xf253('0x37')][_0xf253('0x29')]);_0x537c42[_0xf253('0x28')]=qs[_0xf253('0x28')](_0x413523['query']['offset']);}return _0x748e4f[_0xf253('0x55')](_0x537c42);}})[_0xf253('0x19')](function(_0x35bdd4){if(_0x35bdd4){return _0x35bdd4?{'count':_0x265427,'rows':_0x35bdd4}:null;}})[_0xf253('0x19')](respondWithResult(_0x191c12,null))['catch'](handleError(_0x191c12,null));};exports[_0xf253('0x56')]=function(_0x132402,_0x1384d2,_0x1103d5){var _0x18d8a2={};var _0x851903={};var _0x403ec;var _0x59c8c2;return db['DeskConfiguration'][_0xf253('0x53')]({'where':{'id':_0x132402['params']['id']}})[_0xf253('0x19')](handleEntityNotFound(_0x1384d2,null))[_0xf253('0x19')](function(_0x5f0e62){if(_0x5f0e62){_0x403ec=_0x5f0e62;_0x851903[_0xf253('0x35')]=_['keys'](db[_0xf253('0x54')]['rawAttributes']);_0x851903['query']=_[_0xf253('0x36')](_0x132402[_0xf253('0x37')]);_0x851903[_0xf253('0x38')]=_[_0xf253('0x39')](_0x851903['model'],_0x851903[_0xf253('0x37')]);_0x18d8a2[_0xf253('0x3a')]=_['intersection'](_0x851903[_0xf253('0x35')],qs[_0xf253('0x3b')](_0x132402[_0xf253('0x37')]['fields']));_0x18d8a2['attributes']=_0x18d8a2[_0xf253('0x3a')][_0xf253('0x3c')]?_0x18d8a2['attributes']:_0x851903[_0xf253('0x35')];_0x18d8a2['order']=qs['sort'](_0x132402[_0xf253('0x37')]['sort']);_0x18d8a2[_0xf253('0x41')]=qs['filters'](_[_0xf253('0x42')](_0x132402[_0xf253('0x37')],_0x851903[_0xf253('0x38')]));if(_0x132402[_0xf253('0x37')][_0xf253('0x43')]){_0x18d8a2['where']=_[_0xf253('0x44')](_0x18d8a2[_0xf253('0x41')],{'$or':_[_0xf253('0x45')](_0x18d8a2[_0xf253('0x3a')],function(_0x1efdff){var _0x561662={};_0x561662[_0x1efdff]={'$like':'%'+_0x132402[_0xf253('0x37')][_0xf253('0x43')]+'%'};return _0x561662;})});}_0x18d8a2=_[_0xf253('0x44')]({},_0x18d8a2,_0x132402[_0xf253('0x49')]);return _0x403ec['getDescriptions'](_0x18d8a2);}})['then'](function(_0x30aaf7){if(_0x30aaf7){_0x59c8c2=_0x30aaf7[_0xf253('0x3c')];if(!_0x132402[_0xf253('0x37')]['hasOwnProperty']('nolimit')){_0x18d8a2[_0xf253('0x29')]=qs[_0xf253('0x29')](_0x132402[_0xf253('0x37')]['limit']);_0x18d8a2[_0xf253('0x28')]=qs[_0xf253('0x28')](_0x132402[_0xf253('0x37')][_0xf253('0x28')]);}return _0x403ec[_0xf253('0x56')](_0x18d8a2);}})[_0xf253('0x19')](function(_0x3ae216){if(_0x3ae216){return _0x3ae216?{'count':_0x59c8c2,'rows':_0x3ae216}:null;}})[_0xf253('0x19')](respondWithResult(_0x1384d2,null))[_0xf253('0x23')](handleError(_0x1384d2,null));};exports[_0xf253('0x57')]=function(_0x589222,_0x2d0b75,_0x585d67){var _0x2ba69a={};var _0xeadcff={};var _0x1d76a4;var _0x56e27c;return db[_0xf253('0x33')][_0xf253('0x53')]({'where':{'id':_0x589222[_0xf253('0x4d')]['id']}})[_0xf253('0x19')](handleEntityNotFound(_0x2d0b75,null))[_0xf253('0x19')](function(_0x563ff4){if(_0x563ff4){_0x1d76a4=_0x563ff4;_0xeadcff[_0xf253('0x35')]=_[_0xf253('0x36')](db[_0xf253('0x58')]['rawAttributes']);_0xeadcff[_0xf253('0x37')]=_[_0xf253('0x36')](_0x589222['query']);_0xeadcff[_0xf253('0x38')]=_[_0xf253('0x39')](_0xeadcff[_0xf253('0x35')],_0xeadcff[_0xf253('0x37')]);_0x2ba69a['attributes']=_[_0xf253('0x39')](_0xeadcff[_0xf253('0x35')],qs[_0xf253('0x3b')](_0x589222[_0xf253('0x37')][_0xf253('0x3b')]));_0x2ba69a[_0xf253('0x3a')]=_0x2ba69a[_0xf253('0x3a')][_0xf253('0x3c')]?_0x2ba69a[_0xf253('0x3a')]:_0xeadcff[_0xf253('0x35')];_0x2ba69a['order']=qs[_0xf253('0x40')](_0x589222[_0xf253('0x37')]['sort']);_0x2ba69a[_0xf253('0x41')]=qs['filters'](_[_0xf253('0x42')](_0x589222['query'],_0xeadcff[_0xf253('0x38')]));if(_0x589222[_0xf253('0x37')][_0xf253('0x43')]){_0x2ba69a[_0xf253('0x41')]=_['merge'](_0x2ba69a[_0xf253('0x41')],{'$or':_[_0xf253('0x45')](_0x2ba69a[_0xf253('0x3a')],function(_0x4e1f39){var _0x41bead={};_0x41bead[_0x4e1f39]={'$like':'%'+_0x589222[_0xf253('0x37')][_0xf253('0x43')]+'%'};return _0x41bead;})});}_0x2ba69a=_[_0xf253('0x44')]({},_0x2ba69a,_0x589222['options']);return _0x1d76a4[_0xf253('0x57')](_0x2ba69a);}})[_0xf253('0x19')](function(_0x521648){if(_0x521648){_0x56e27c=_0x521648[_0xf253('0x3c')];if(!_0x589222[_0xf253('0x37')][_0xf253('0x3d')](_0xf253('0x3e'))){_0x2ba69a[_0xf253('0x29')]=qs['limit'](_0x589222[_0xf253('0x37')][_0xf253('0x29')]);_0x2ba69a[_0xf253('0x28')]=qs['offset'](_0x589222[_0xf253('0x37')][_0xf253('0x28')]);}return _0x1d76a4[_0xf253('0x57')](_0x2ba69a);}})['then'](function(_0xe7821a){if(_0xe7821a){return _0xe7821a?{'count':_0x56e27c,'rows':_0xe7821a}:null;}})[_0xf253('0x19')](respondWithResult(_0x2d0b75,null))[_0xf253('0x23')](handleError(_0x2d0b75,null));};exports['setTags']=function(_0x4b1527,_0x331afe,_0x6a3a77){if(_0x4b1527[_0xf253('0x50')]['id']){delete _0x4b1527['body']['id'];}return db['DeskConfiguration'][_0xf253('0x53')]({'where':{'id':_0x4b1527['params']['id']}})[_0xf253('0x19')](handleEntityNotFound(_0x331afe,null))[_0xf253('0x19')](function(_0x5ac095){if(_0x5ac095){return _0x5ac095['setTags'](_0x4b1527[_0xf253('0x50')][_0xf253('0x59')]||[]);}return null;})[_0xf253('0x19')](respondWithResult(_0x331afe,null))[_0xf253('0x23')](handleError(_0x331afe,null));};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js
index 2ae3718..9b69d60 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.model.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c5b=['exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xfa4bc6,_0xededcd){var _0xf6a411=function(_0x143a79){while(--_0x143a79){_0xfa4bc6['push'](_0xfa4bc6['shift']());}};_0xf6a411(++_0xededcd);}(_0x0c5b,0x1a8));var _0xb0c5=function(_0xb7e0eb,_0x4d078d){_0xb7e0eb=_0xb7e0eb-0x0;var _0x5f26bb=_0x0c5b[_0xb7e0eb];return _0x5f26bb;};'use strict';var _=require(_0xb0c5('0x0'));var util=require(_0xb0c5('0x1'));var logger=require('../../config/logger')(_0xb0c5('0x2'));var moment=require(_0xb0c5('0x3'));var BPromise=require(_0xb0c5('0x4'));var rp=require(_0xb0c5('0x5'));var fs=require('fs');var path=require(_0xb0c5('0x6'));var rimraf=require('rimraf');var config=require(_0xb0c5('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xb0c5('0x8')]=function(_0x175e43,_0x5cf3a4){return _0x175e43[_0xb0c5('0x9')](_0xb0c5('0xa'),attributes,{'tableName':_0xb0c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x620f=['DeskConfiguration','int_desk_configurations','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x2e2600,_0x390165){var _0x23c82c=function(_0x30057f){while(--_0x30057f){_0x2e2600['push'](_0x2e2600['shift']());}};_0x23c82c(++_0x390165);}(_0x620f,0x199));var _0xf620=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x620f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0xf620('0x0'));var logger=require(_0xf620('0x1'))(_0xf620('0x2'));var moment=require('moment');var BPromise=require(_0xf620('0x3'));var rp=require(_0xf620('0x4'));var fs=require('fs');var path=require(_0xf620('0x5'));var rimraf=require('rimraf');var config=require(_0xf620('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0xf620('0x7')]=function(_0x40920c,_0x362763){return _0x40920c[_0xf620('0x8')](_0xf620('0x9'),attributes,{'tableName':_0xf620('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
index 4078c3f..85fdb8f 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0xf1ed9f,_0x54694e){_0xf1ed9f=_0xf1ed9f-0x0;var _0x412f7d=_0x4975[_0xf1ed9f];return _0x412f7d;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
+var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0xf494,0x1c6));var _0x4f49=function(_0x4b33d1,_0x2414e1){_0x4b33d1=_0x4b33d1-0x0;var _0x9e7221=_0xf494[_0x4b33d1];return _0x9e7221;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js
index f782137..2a7c56b 100644
--- a/server/api/intDeskField/index.js
+++ b/server/api/intDeskField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2326=['../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x53f347,_0x28efae){var _0x5ed3eb=function(_0x296c91){while(--_0x296c91){_0x53f347['push'](_0x53f347['shift']());}};_0x5ed3eb(++_0x28efae);}(_0x2326,0x1d9));var _0x6232=function(_0xc91d83,_0x319e8a){_0xc91d83=_0xc91d83-0x0;var _0x33970e=_0x2326[_0xc91d83];return _0x33970e;};'use strict';var multer=require(_0x6232('0x0'));var util=require(_0x6232('0x1'));var path=require(_0x6232('0x2'));var timeout=require('connect-timeout');var express=require(_0x6232('0x3'));var router=express[_0x6232('0x4')]();var auth=require(_0x6232('0x5'));var interaction=require(_0x6232('0x6'));var config=require(_0x6232('0x7'));var controller=require(_0x6232('0x8'));router[_0x6232('0x9')]('/',auth[_0x6232('0xa')](),controller[_0x6232('0xb')]);router[_0x6232('0x9')](_0x6232('0xc'),auth[_0x6232('0xa')](),controller[_0x6232('0xd')]);router['post']('/',auth[_0x6232('0xa')](),controller[_0x6232('0xe')]);router[_0x6232('0xf')](_0x6232('0xc'),auth[_0x6232('0xa')](),controller[_0x6232('0x10')]);router[_0x6232('0x11')]('/:id',auth[_0x6232('0xa')](),controller[_0x6232('0x12')]);module[_0x6232('0x13')]=router;
\ No newline at end of file
+var _0x84d2=['../../components/auth/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','/:id','create','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x84d2,0x1dc));var _0x284d=function(_0x1e042f,_0x4ce4e3){_0x1e042f=_0x1e042f-0x0;var _0x173d9f=_0x84d2[_0x1e042f];return _0x173d9f;};'use strict';var multer=require('multer');var util=require(_0x284d('0x0'));var path=require('path');var timeout=require(_0x284d('0x1'));var express=require(_0x284d('0x2'));var router=express[_0x284d('0x3')]();var auth=require(_0x284d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x284d('0x5'));var controller=require(_0x284d('0x6'));router['get']('/',auth[_0x284d('0x7')](),controller[_0x284d('0x8')]);router['get'](_0x284d('0x9'),auth[_0x284d('0x7')](),controller['show']);router['post']('/',auth[_0x284d('0x7')](),controller[_0x284d('0xa')]);router['put']('/:id',auth[_0x284d('0x7')](),controller[_0x284d('0xb')]);router[_0x284d('0xc')](_0x284d('0x9'),auth[_0x284d('0x7')](),controller[_0x284d('0xd')]);module[_0x284d('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js
index 32f7ff7..17096c9 100644
--- a/server/api/intDeskField/intDeskField.attributes.js
+++ b/server/api/intDeskField/intDeskField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x22fb=['string','STRING','BOOLEAN','ENUM','variable','customVariable','keyValue'];(function(_0x29de0c,_0x22b09c){var _0x578e2c=function(_0x39cea4){while(--_0x39cea4){_0x29de0c['push'](_0x29de0c['shift']());}};_0x578e2c(++_0x22b09c);}(_0x22fb,0x192));var _0xb22f=function(_0x4e599d,_0x4eab2c){_0x4e599d=_0x4e599d-0x0;var _0x322c3d=_0x22fb[_0x4e599d];return _0x322c3d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb22f('0x0')]('string',_0xb22f('0x1'),_0xb22f('0x2'),_0xb22f('0x3')),'defaultValue':_0xb22f('0x4')},'content':{'type':Sequelize[_0xb22f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb22f('0x0')](_0xb22f('0x4'),_0xb22f('0x1'),_0xb22f('0x2'))},'keyContent':{'type':Sequelize[_0xb22f('0x5')]},'idField':{'type':Sequelize[_0xb22f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb22f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb22f('0x5')]}};
\ No newline at end of file
+var _0x6324=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','STRING'];(function(_0x22c6d6,_0x586596){var _0x1f2467=function(_0x242364){while(--_0x242364){_0x22c6d6['push'](_0x22c6d6['shift']());}};_0x1f2467(++_0x586596);}(_0x6324,0x142));var _0x4632=function(_0x53816b,_0x2f9ba3){_0x53816b=_0x53816b-0x0;var _0x7f2259=_0x6324[_0x53816b];return _0x7f2259;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'type':{'type':Sequelize[_0x4632('0x2')](_0x4632('0x3'),'variable',_0x4632('0x4'),'keyValue'),'defaultValue':_0x4632('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4632('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x4632('0x3'),_0x4632('0x6'),_0x4632('0x4'))},'keyContent':{'type':Sequelize[_0x4632('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4632('0x5')]},'customField':{'type':Sequelize[_0x4632('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4632('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js
index 4242e45..4f00b8f 100644
--- a/server/api/intDeskField/intDeskField.controller.js
+++ b/server/api/intDeskField/intDeskField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4c4e=['end','error','name','index','rawAttributes','model','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','DeskField','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0xe34092,_0x2f01b3){var _0x153313=function(_0x346221){while(--_0x346221){_0xe34092['push'](_0xe34092['shift']());}};_0x153313(++_0x2f01b3);}(_0x4c4e,0x152));var _0xe4c4=function(_0x2db903,_0x1672a9){_0x2db903=_0x2db903-0x0;var _0x132516=_0x4c4e[_0x2db903];return _0x132516;};'use strict';var pdf=require(_0xe4c4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe4c4('0x1'));var zipdir=require(_0xe4c4('0x2'));var jsonpatch=require(_0xe4c4('0x3'));var rp=require('request-promise');var moment=require(_0xe4c4('0x4'));var BPromise=require(_0xe4c4('0x5'));var Mustache=require(_0xe4c4('0x6'));var util=require('util');var path=require(_0xe4c4('0x7'));var sox=require('sox');var csv=require(_0xe4c4('0x8'));var ejs=require(_0xe4c4('0x9'));var fs=require('fs');var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0xf'));var authService=require(_0xe4c4('0x10'));var qs=require(_0xe4c4('0x11'));var hardwareService=require(_0xe4c4('0x12'));var logger=require(_0xe4c4('0x13'))(_0xe4c4('0x14'));var utils=require('../../config/utils');var config=require(_0xe4c4('0x15'));var db=require(_0xe4c4('0x16'))['db'];function respondWithStatusCode(_0x3805c5,_0x2483d0){_0x2483d0=_0x2483d0||0xcc;return function(_0x50bfab){if(_0x50bfab){return _0x3805c5[_0xe4c4('0x17')](_0x2483d0);}return _0x3805c5[_0xe4c4('0x18')](_0x2483d0)['end']();};}function respondWithResult(_0xe485ca,_0x1a44e5){_0x1a44e5=_0x1a44e5||0xc8;return function(_0x5aa89b){if(_0x5aa89b){return _0xe485ca[_0xe4c4('0x18')](_0x1a44e5)[_0xe4c4('0x19')](_0x5aa89b);}};}function respondWithFilteredResult(_0x5e263c,_0x307aa8){return function(_0x465c9b){if(_0x465c9b){var _0x26ea05=_0x465c9b[_0xe4c4('0x1a')],_0x40a36e=_0x307aa8[_0xe4c4('0x1b')],_0x19e59b=_0x307aa8[_0xe4c4('0x1b')]+_0x307aa8[_0xe4c4('0x1c')],_0x882be2;if(_0x19e59b>=_0x26ea05){_0x19e59b=_0x26ea05;_0x882be2=0xc8;}else{_0x882be2=0xce;}_0x5e263c[_0xe4c4('0x18')](_0x882be2);return _0x5e263c[_0xe4c4('0x1d')](_0xe4c4('0x1e'),_0x40a36e+'-'+_0x19e59b+'/'+_0x26ea05)[_0xe4c4('0x19')](_0x465c9b);}return null;};}function patchUpdates(_0x376585){return function(_0x5a32b5){try{jsonpatch[_0xe4c4('0x1f')](_0x5a32b5,_0x376585,!![]);}catch(_0x24f946){return BPromise[_0xe4c4('0x20')](_0x24f946);}return _0x5a32b5[_0xe4c4('0x21')]();};}function saveUpdates(_0x5da165,_0x3d5856){return function(_0x1cad5d){if(_0x1cad5d){return _0x1cad5d[_0xe4c4('0x22')](_0x5da165)[_0xe4c4('0x23')](function(_0x2c5aea){return _0x2c5aea;});}return null;};}function removeEntity(_0x435940,_0x1d4597){return function(_0x393c96){if(_0x393c96){return _0x393c96[_0xe4c4('0x24')]()[_0xe4c4('0x23')](function(){_0x435940[_0xe4c4('0x18')](0xcc)[_0xe4c4('0x25')]();});}};}function handleEntityNotFound(_0x138ead,_0x1db719){return function(_0x15873e){if(!_0x15873e){_0x138ead['sendStatus'](0x194);}return _0x15873e;};}function handleError(_0x49cadc,_0x403a2c){_0x403a2c=_0x403a2c||0x1f4;return function(_0x4dc8cc){logger[_0xe4c4('0x26')](_0x4dc8cc['stack']);if(_0x4dc8cc[_0xe4c4('0x27')]){delete _0x4dc8cc['name'];}_0x49cadc[_0xe4c4('0x18')](_0x403a2c)['send'](_0x4dc8cc);};}exports[_0xe4c4('0x28')]=function(_0x4a0199,_0x5a2adb){var _0x4cea1f={},_0x5d66ab={},_0x3221cd={'count':0x0,'rows':[]};var _0x48cfe0=db['DeskField'][_0xe4c4('0x29')];_0x5d66ab[_0xe4c4('0x2a')]=_['keys'](_0x48cfe0);_0x5d66ab['query']=_[_0xe4c4('0x2b')](_0x4a0199[_0xe4c4('0x2c')]);_0x5d66ab['filters']=_[_0xe4c4('0x2d')](_0x5d66ab[_0xe4c4('0x2a')],_0x5d66ab[_0xe4c4('0x2c')]);_0x4cea1f['attributes']=_['intersection'](_0x5d66ab[_0xe4c4('0x2a')],qs[_0xe4c4('0x2e')](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x2e')]));_0x4cea1f['attributes']=_0x4cea1f['attributes'][_0xe4c4('0x2f')]?_0x4cea1f[_0xe4c4('0x30')]:_0x5d66ab['model'];if(!_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x31')](_0xe4c4('0x32'))){_0x4cea1f['limit']=qs[_0xe4c4('0x1c')](_0x4a0199['query'][_0xe4c4('0x1c')]);_0x4cea1f[_0xe4c4('0x1b')]=qs[_0xe4c4('0x1b')](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x1b')]);}_0x4cea1f[_0xe4c4('0x33')]=qs[_0xe4c4('0x34')](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x34')]);_0x4cea1f[_0xe4c4('0x35')]=qs[_0xe4c4('0x36')](_[_0xe4c4('0x37')](_0x4a0199['query'],_0x5d66ab[_0xe4c4('0x36')]));if(_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x38')]){_0x4cea1f['where']=_[_0xe4c4('0x39')](_0x4cea1f[_0xe4c4('0x35')],{'$or':_[_0xe4c4('0x3a')](_0x48cfe0,function(_0x53eb5b){if(_0x53eb5b[_0xe4c4('0x3b')][_0xe4c4('0x3c')]!==_0xe4c4('0x3d')){var _0x1de955={};_0x1de955[_0x53eb5b[_0xe4c4('0x3e')]]={'$like':'%'+_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x38')]+'%'};return _0x1de955;}})});}_0x4cea1f=_[_0xe4c4('0x39')]({},_0x4cea1f,_0x4a0199[_0xe4c4('0x3f')]);var _0x8b5bf3={'where':_0x4cea1f['where']};return db[_0xe4c4('0x40')][_0xe4c4('0x1a')](_0x8b5bf3)[_0xe4c4('0x23')](function(_0x3c16a5){_0x3221cd['count']=_0x3c16a5;if(_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x41')]){_0x4cea1f['include']=[{'all':!![]}];}return db[_0xe4c4('0x40')][_0xe4c4('0x42')](_0x4cea1f);})['then'](function(_0x433f0c){_0x3221cd[_0xe4c4('0x43')]=_0x433f0c;return _0x3221cd;})[_0xe4c4('0x23')](respondWithFilteredResult(_0x5a2adb,_0x4cea1f))[_0xe4c4('0x44')](handleError(_0x5a2adb,null));};exports[_0xe4c4('0x45')]=function(_0xe7a882,_0x96dd48){var _0x43201e={'raw':!![],'where':{'id':_0xe7a882[_0xe4c4('0x46')]['id']}},_0x1e457c={};_0x1e457c[_0xe4c4('0x2a')]=_[_0xe4c4('0x2b')](db['DeskField'][_0xe4c4('0x29')]);_0x1e457c[_0xe4c4('0x2c')]=_[_0xe4c4('0x2b')](_0xe7a882[_0xe4c4('0x2c')]);_0x1e457c[_0xe4c4('0x36')]=_[_0xe4c4('0x2d')](_0x1e457c['model'],_0x1e457c[_0xe4c4('0x2c')]);_0x43201e['attributes']=_[_0xe4c4('0x2d')](_0x1e457c[_0xe4c4('0x2a')],qs[_0xe4c4('0x2e')](_0xe7a882[_0xe4c4('0x2c')][_0xe4c4('0x2e')]));_0x43201e['attributes']=_0x43201e['attributes'][_0xe4c4('0x2f')]?_0x43201e[_0xe4c4('0x30')]:_0x1e457c[_0xe4c4('0x2a')];if(_0xe7a882['query'][_0xe4c4('0x41')]){_0x43201e[_0xe4c4('0x47')]=[{'all':!![]}];}_0x43201e=_[_0xe4c4('0x39')]({},_0x43201e,_0xe7a882[_0xe4c4('0x3f')]);return db['DeskField'][_0xe4c4('0x48')](_0x43201e)[_0xe4c4('0x23')](handleEntityNotFound(_0x96dd48,null))[_0xe4c4('0x23')](respondWithResult(_0x96dd48,null))[_0xe4c4('0x44')](handleError(_0x96dd48,null));};exports[_0xe4c4('0x49')]=function(_0x1e459e,_0x1eda5e){return db[_0xe4c4('0x40')][_0xe4c4('0x49')](_0x1e459e['body'],{})[_0xe4c4('0x23')](respondWithResult(_0x1eda5e,0xc9))['catch'](handleError(_0x1eda5e,null));};exports[_0xe4c4('0x22')]=function(_0x7a40c2,_0x396f7a){if(_0x7a40c2[_0xe4c4('0x4a')]['id']){delete _0x7a40c2[_0xe4c4('0x4a')]['id'];}return db[_0xe4c4('0x40')][_0xe4c4('0x48')]({'where':{'id':_0x7a40c2[_0xe4c4('0x46')]['id']}})[_0xe4c4('0x23')](handleEntityNotFound(_0x396f7a,null))[_0xe4c4('0x23')](saveUpdates(_0x7a40c2[_0xe4c4('0x4a')],null))[_0xe4c4('0x23')](respondWithResult(_0x396f7a,null))[_0xe4c4('0x44')](handleError(_0x396f7a,null));};exports[_0xe4c4('0x24')]=function(_0x535bcc,_0x4922f5){return db[_0xe4c4('0x40')][_0xe4c4('0x48')]({'where':{'id':_0x535bcc['params']['id']}})[_0xe4c4('0x23')](handleEntityNotFound(_0x4922f5,null))[_0xe4c4('0x23')](removeEntity(_0x4922f5,null))[_0xe4c4('0x44')](handleError(_0x4922f5,null));};
\ No newline at end of file
+var _0xbf6e=['../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','DeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','filter','map','type','key','merge','options','includeAll','include','rows','catch','show','params','length','create','body','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x1ecd12,_0x5826dd){var _0x348b09=function(_0x45243b){while(--_0x45243b){_0x1ecd12['push'](_0x1ecd12['shift']());}};_0x348b09(++_0x5826dd);}(_0xbf6e,0x149));var _0xebf6=function(_0x865e28,_0x3de135){_0x865e28=_0x865e28-0x0;var _0x3c97d9=_0xbf6e[_0x865e28];return _0x3c97d9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xebf6('0x0'));var zipdir=require(_0xebf6('0x1'));var jsonpatch=require(_0xebf6('0x2'));var rp=require(_0xebf6('0x3'));var moment=require(_0xebf6('0x4'));var BPromise=require(_0xebf6('0x5'));var Mustache=require(_0xebf6('0x6'));var util=require('util');var path=require(_0xebf6('0x7'));var sox=require(_0xebf6('0x8'));var csv=require(_0xebf6('0x9'));var ejs=require(_0xebf6('0xa'));var fs=require('fs');var _=require(_0xebf6('0xb'));var squel=require(_0xebf6('0xc'));var crypto=require(_0xebf6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xebf6('0xe'));var toCsv=require(_0xebf6('0x9'));var querystring=require(_0xebf6('0xf'));var Papa=require('papaparse');var Redis=require(_0xebf6('0x10'));var authService=require(_0xebf6('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xebf6('0x12'));var logger=require(_0xebf6('0x13'))(_0xebf6('0x14'));var utils=require(_0xebf6('0x15'));var config=require(_0xebf6('0x16'));var db=require(_0xebf6('0x17'))['db'];function respondWithStatusCode(_0x47ee12,_0x26fe9c){_0x26fe9c=_0x26fe9c||0xcc;return function(_0xedc361){if(_0xedc361){return _0x47ee12['sendStatus'](_0x26fe9c);}return _0x47ee12[_0xebf6('0x18')](_0x26fe9c)[_0xebf6('0x19')]();};}function respondWithResult(_0x20c9ce,_0x165b56){_0x165b56=_0x165b56||0xc8;return function(_0x3f69e6){if(_0x3f69e6){return _0x20c9ce['status'](_0x165b56)['json'](_0x3f69e6);}};}function respondWithFilteredResult(_0x56b8f8,_0x4cecbc){return function(_0x1ae2f7){if(_0x1ae2f7){var _0x50d80f=_0x1ae2f7[_0xebf6('0x1a')],_0x35570e=_0x4cecbc[_0xebf6('0x1b')],_0x2c980f=_0x4cecbc[_0xebf6('0x1b')]+_0x4cecbc[_0xebf6('0x1c')],_0xb164a1;if(_0x2c980f>=_0x50d80f){_0x2c980f=_0x50d80f;_0xb164a1=0xc8;}else{_0xb164a1=0xce;}_0x56b8f8[_0xebf6('0x18')](_0xb164a1);return _0x56b8f8[_0xebf6('0x1d')](_0xebf6('0x1e'),_0x35570e+'-'+_0x2c980f+'/'+_0x50d80f)['json'](_0x1ae2f7);}return null;};}function patchUpdates(_0x496dea){return function(_0xe03844){try{jsonpatch[_0xebf6('0x1f')](_0xe03844,_0x496dea,!![]);}catch(_0x10051e){return BPromise[_0xebf6('0x20')](_0x10051e);}return _0xe03844[_0xebf6('0x21')]();};}function saveUpdates(_0x1a848a,_0x35f739){return function(_0x80f523){if(_0x80f523){return _0x80f523['update'](_0x1a848a)[_0xebf6('0x22')](function(_0x81fdb3){return _0x81fdb3;});}return null;};}function removeEntity(_0x377934,_0x23d487){return function(_0x6303ac){if(_0x6303ac){return _0x6303ac[_0xebf6('0x23')]()[_0xebf6('0x22')](function(){_0x377934[_0xebf6('0x18')](0xcc)[_0xebf6('0x19')]();});}};}function handleEntityNotFound(_0x2e32c6,_0x232074){return function(_0x2dd2ed){if(!_0x2dd2ed){_0x2e32c6[_0xebf6('0x24')](0x194);}return _0x2dd2ed;};}function handleError(_0x3b8bc1,_0x2f6e5d){_0x2f6e5d=_0x2f6e5d||0x1f4;return function(_0x1d0078){logger[_0xebf6('0x25')](_0x1d0078[_0xebf6('0x26')]);if(_0x1d0078[_0xebf6('0x27')]){delete _0x1d0078['name'];}_0x3b8bc1['status'](_0x2f6e5d)[_0xebf6('0x28')](_0x1d0078);};}exports['index']=function(_0x230d84,_0x430eb7){var _0x5a01ea={},_0x4f39eb={},_0x37950c={'count':0x0,'rows':[]};var _0x40ae57=db[_0xebf6('0x29')][_0xebf6('0x2a')];_0x4f39eb[_0xebf6('0x2b')]=_[_0xebf6('0x2c')](_0x40ae57);_0x4f39eb[_0xebf6('0x2d')]=_[_0xebf6('0x2c')](_0x230d84['query']);_0x4f39eb[_0xebf6('0x2e')]=_[_0xebf6('0x2f')](_0x4f39eb['model'],_0x4f39eb[_0xebf6('0x2d')]);_0x5a01ea[_0xebf6('0x30')]=_['intersection'](_0x4f39eb[_0xebf6('0x2b')],qs[_0xebf6('0x31')](_0x230d84[_0xebf6('0x2d')][_0xebf6('0x31')]));_0x5a01ea[_0xebf6('0x30')]=_0x5a01ea[_0xebf6('0x30')]['length']?_0x5a01ea[_0xebf6('0x30')]:_0x4f39eb[_0xebf6('0x2b')];if(!_0x230d84['query']['hasOwnProperty'](_0xebf6('0x32'))){_0x5a01ea[_0xebf6('0x1c')]=qs['limit'](_0x230d84[_0xebf6('0x2d')][_0xebf6('0x1c')]);_0x5a01ea['offset']=qs[_0xebf6('0x1b')](_0x230d84[_0xebf6('0x2d')][_0xebf6('0x1b')]);}_0x5a01ea['order']=qs[_0xebf6('0x33')](_0x230d84[_0xebf6('0x2d')][_0xebf6('0x33')]);_0x5a01ea[_0xebf6('0x34')]=qs['filters'](_['pick'](_0x230d84[_0xebf6('0x2d')],_0x4f39eb[_0xebf6('0x2e')]));if(_0x230d84['query'][_0xebf6('0x35')]){_0x5a01ea[_0xebf6('0x34')]=_['merge'](_0x5a01ea[_0xebf6('0x34')],{'$or':_[_0xebf6('0x36')](_0x40ae57,function(_0x24c8a0){if(_0x24c8a0[_0xebf6('0x37')][_0xebf6('0x38')]!=='VIRTUAL'){var _0x1b0aa5={};_0x1b0aa5[_0x24c8a0['field']]={'$like':'%'+_0x230d84[_0xebf6('0x2d')]['filter']+'%'};return _0x1b0aa5;}})});}_0x5a01ea=_[_0xebf6('0x39')]({},_0x5a01ea,_0x230d84[_0xebf6('0x3a')]);var _0x3c248e={'where':_0x5a01ea[_0xebf6('0x34')]};return db[_0xebf6('0x29')][_0xebf6('0x1a')](_0x3c248e)['then'](function(_0x406c29){_0x37950c[_0xebf6('0x1a')]=_0x406c29;if(_0x230d84[_0xebf6('0x2d')][_0xebf6('0x3b')]){_0x5a01ea[_0xebf6('0x3c')]=[{'all':!![]}];}return db[_0xebf6('0x29')]['findAll'](_0x5a01ea);})[_0xebf6('0x22')](function(_0x2782a5){_0x37950c[_0xebf6('0x3d')]=_0x2782a5;return _0x37950c;})[_0xebf6('0x22')](respondWithFilteredResult(_0x430eb7,_0x5a01ea))[_0xebf6('0x3e')](handleError(_0x430eb7,null));};exports[_0xebf6('0x3f')]=function(_0x4887a8,_0x582730){var _0x4fa782={'raw':!![],'where':{'id':_0x4887a8[_0xebf6('0x40')]['id']}},_0xd4d5f4={};_0xd4d5f4[_0xebf6('0x2b')]=_['keys'](db[_0xebf6('0x29')][_0xebf6('0x2a')]);_0xd4d5f4[_0xebf6('0x2d')]=_['keys'](_0x4887a8[_0xebf6('0x2d')]);_0xd4d5f4[_0xebf6('0x2e')]=_['intersection'](_0xd4d5f4[_0xebf6('0x2b')],_0xd4d5f4[_0xebf6('0x2d')]);_0x4fa782[_0xebf6('0x30')]=_['intersection'](_0xd4d5f4[_0xebf6('0x2b')],qs['fields'](_0x4887a8['query'][_0xebf6('0x31')]));_0x4fa782[_0xebf6('0x30')]=_0x4fa782[_0xebf6('0x30')][_0xebf6('0x41')]?_0x4fa782['attributes']:_0xd4d5f4[_0xebf6('0x2b')];if(_0x4887a8['query'][_0xebf6('0x3b')]){_0x4fa782[_0xebf6('0x3c')]=[{'all':!![]}];}_0x4fa782=_[_0xebf6('0x39')]({},_0x4fa782,_0x4887a8[_0xebf6('0x3a')]);return db[_0xebf6('0x29')]['find'](_0x4fa782)['then'](handleEntityNotFound(_0x582730,null))[_0xebf6('0x22')](respondWithResult(_0x582730,null))[_0xebf6('0x3e')](handleError(_0x582730,null));};exports[_0xebf6('0x42')]=function(_0x39d153,_0x51890e){return db[_0xebf6('0x29')][_0xebf6('0x42')](_0x39d153[_0xebf6('0x43')],{})[_0xebf6('0x22')](respondWithResult(_0x51890e,0xc9))[_0xebf6('0x3e')](handleError(_0x51890e,null));};exports[_0xebf6('0x44')]=function(_0x45e0f1,_0x550bd8){if(_0x45e0f1[_0xebf6('0x43')]['id']){delete _0x45e0f1[_0xebf6('0x43')]['id'];}return db[_0xebf6('0x29')][_0xebf6('0x45')]({'where':{'id':_0x45e0f1[_0xebf6('0x40')]['id']}})[_0xebf6('0x22')](handleEntityNotFound(_0x550bd8,null))[_0xebf6('0x22')](saveUpdates(_0x45e0f1['body'],null))[_0xebf6('0x22')](respondWithResult(_0x550bd8,null))['catch'](handleError(_0x550bd8,null));};exports[_0xebf6('0x23')]=function(_0x31d8ba,_0x5d84ac){return db[_0xebf6('0x29')]['find']({'where':{'id':_0x31d8ba[_0xebf6('0x40')]['id']}})[_0xebf6('0x22')](handleEntityNotFound(_0x5d84ac,null))[_0xebf6('0x22')](removeEntity(_0x5d84ac,null))[_0xebf6('0x3e')](handleError(_0x5d84ac,null));};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js
index 7170cfa..18afabe 100644
--- a/server/api/intDeskField/intDeskField.model.js
+++ b/server/api/intDeskField/intDeskField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5b28=['util','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','desk_unique_index','idField','lodash'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0x5b28,0x1e0));var _0x85b2=function(_0x55f216,_0x58f60b){_0x55f216=_0x55f216-0x0;var _0x1d288=_0x5b28[_0x55f216];return _0x1d288;};'use strict';var _=require(_0x85b2('0x0'));var util=require(_0x85b2('0x1'));var logger=require('../../config/logger')(_0x85b2('0x2'));var moment=require(_0x85b2('0x3'));var BPromise=require(_0x85b2('0x4'));var rp=require(_0x85b2('0x5'));var fs=require('fs');var path=require(_0x85b2('0x6'));var rimraf=require(_0x85b2('0x7'));var config=require('../../config/environment');var attributes=require(_0x85b2('0x8'));module[_0x85b2('0x9')]=function(_0x3f59c7,_0x2f8991){return _0x3f59c7[_0x85b2('0xa')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x85b2('0xb'),'fields':[_0x85b2('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd121=['FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0xd121,0x191));var _0x1d12=function(_0x5a6b16,_0x4c22ef){_0x5a6b16=_0x5a6b16-0x0;var _0x54f033=_0xd121[_0x5a6b16];return _0x54f033;};'use strict';var _=require(_0x1d12('0x0'));var util=require(_0x1d12('0x1'));var logger=require(_0x1d12('0x2'))(_0x1d12('0x3'));var moment=require('moment');var BPromise=require(_0x1d12('0x4'));var rp=require(_0x1d12('0x5'));var fs=require('fs');var path=require(_0x1d12('0x6'));var rimraf=require(_0x1d12('0x7'));var config=require(_0x1d12('0x8'));var attributes=require(_0x1d12('0x9'));module[_0x1d12('0xa')]=function(_0x1540e2,_0x21f611){return _0x1540e2[_0x1d12('0xb')](_0x1d12('0xc'),attributes,{'tableName':_0x1d12('0xd'),'paranoid':![],'indexes':[{'name':_0x1d12('0xe'),'fields':['idField',_0x1d12('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js
index 041c26c..9ea0f61 100644
--- a/server/api/intDeskField/intDeskField.rpc.js
+++ b/server/api/intDeskField/intDeskField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x668b=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5b9c0e,_0x3e0c45){var _0x236b66=function(_0x57b7a8){while(--_0x57b7a8){_0x5b9c0e['push'](_0x5b9c0e['shift']());}};_0x236b66(++_0x3e0c45);}(_0x668b,0x140));var _0xb668=function(_0x485f53,_0x104081){_0x485f53=_0x485f53-0x0;var _0x480f1e=_0x668b[_0x485f53];return _0x480f1e;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3be92e,_0x2778e9,_0x20b749){return new BPromise(function(_0x3f01bc,_0x517fc5){return client[_0xb668('0xa')](_0x3be92e,_0x20b749)[_0xb668('0xb')](function(_0x128cf5){logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));logger[_0xb668('0xf')](_0xb668('0x10'),_0x2778e9,'request\x20sent',JSON[_0xb668('0x11')](_0x128cf5));if(_0x128cf5[_0xb668('0x12')]){if(_0x128cf5[_0xb668('0x12')][_0xb668('0x13')]===0x1f4){logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x517fc5(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x3f01bc(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}else{logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));_0x3f01bc(_0x128cf5[_0xb668('0x15')][_0xb668('0x14')]);}})[_0xb668('0x16')](function(_0x4ab137){logger[_0xb668('0x12')]('DeskField,\x20%s,\x20%s',_0x2778e9,_0x4ab137);_0x517fc5(_0x4ab137);});});}
\ No newline at end of file
+var _0x5ff3=['message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','DeskField,\x20%s,\x20%s'];(function(_0x37aa43,_0x283dad){var _0x424570=function(_0x3e888b){while(--_0x3e888b){_0x37aa43['push'](_0x37aa43['shift']());}};_0x424570(++_0x283dad);}(_0x5ff3,0x17d));var _0x35ff=function(_0x45a0bf,_0x5430cd){_0x45a0bf=_0x45a0bf-0x0;var _0x1eed87=_0x5ff3[_0x45a0bf];return _0x1eed87;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var moment=require('moment');var BPromise=require(_0x35ff('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ff('0x2'));var db=require(_0x35ff('0x3'))['db'];var utils=require(_0x35ff('0x4'));var logger=require(_0x35ff('0x5'))('rpc');var config=require(_0x35ff('0x6'));var jayson=require(_0x35ff('0x7'));var client=jayson[_0x35ff('0x8')][_0x35ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30c3ff,_0x495c31,_0x92b403){return new BPromise(function(_0x4c9fab,_0x2e7470){return client[_0x35ff('0xa')](_0x30c3ff,_0x92b403)[_0x35ff('0xb')](function(_0x51967a){logger[_0x35ff('0xc')]('DeskField,\x20%s,\x20%s',_0x495c31,_0x35ff('0xd'));logger[_0x35ff('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x495c31,'request\x20sent',JSON[_0x35ff('0xf')](_0x51967a));if(_0x51967a['error']){if(_0x51967a['error']['code']===0x1f4){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);return _0x2e7470(_0x51967a['error'][_0x35ff('0x12')]);}logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a['error'][_0x35ff('0x12')]);return _0x4c9fab(_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);}else{logger[_0x35ff('0xc')](_0x35ff('0x11'),_0x495c31,_0x35ff('0xd'));_0x4c9fab(_0x51967a[_0x35ff('0x13')][_0x35ff('0x12')]);}})[_0x35ff('0x14')](function(_0x2f3456){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x2f3456);_0x2e7470(_0x2f3456);});});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js
index 7f235f9..77bcc24 100644
--- a/server/api/intDynamics365Account/index.js
+++ b/server/api/intDynamics365Account/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf229=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x502a8e,_0x238224){var _0x5c7054=function(_0x2915f1){while(--_0x2915f1){_0x502a8e['push'](_0x502a8e['shift']());}};_0x5c7054(++_0x238224);}(_0xf229,0x14a));var _0x9f22=function(_0x43cc7d,_0x8e14a2){_0x43cc7d=_0x43cc7d-0x0;var _0x36bd75=_0xf229[_0x43cc7d];return _0x36bd75;};'use strict';var multer=require(_0x9f22('0x0'));var util=require(_0x9f22('0x1'));var path=require(_0x9f22('0x2'));var timeout=require(_0x9f22('0x3'));var express=require('express');var router=express[_0x9f22('0x4')]();var auth=require(_0x9f22('0x5'));var interaction=require(_0x9f22('0x6'));var config=require('../../config/environment');var controller=require(_0x9f22('0x7'));router[_0x9f22('0x8')]('/',auth['isAuthenticated'](),controller[_0x9f22('0x9')]);router[_0x9f22('0x8')](_0x9f22('0xa'),auth[_0x9f22('0xb')](),controller[_0x9f22('0xc')]);router['get'](_0x9f22('0xd'),auth['isAuthenticated'](),controller[_0x9f22('0xe')]);router[_0x9f22('0x8')](_0x9f22('0xf'),auth[_0x9f22('0xb')](),controller[_0x9f22('0x10')]);router[_0x9f22('0x11')]('/',auth['isAuthenticated'](),controller[_0x9f22('0x12')]);router['post'](_0x9f22('0xd'),auth[_0x9f22('0xb')](),controller[_0x9f22('0x13')]);router[_0x9f22('0x14')](_0x9f22('0xa'),auth[_0x9f22('0xb')](),controller[_0x9f22('0x15')]);router[_0x9f22('0x16')](_0x9f22('0xa'),auth[_0x9f22('0xb')](),controller[_0x9f22('0x17')]);module[_0x9f22('0x18')]=router;
\ No newline at end of file
+var _0xf97f=['../../components/interaction/service','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x28d334,_0x5237c1){var _0xafd4dc=function(_0x5eb990){while(--_0x5eb990){_0x28d334['push'](_0x28d334['shift']());}};_0xafd4dc(++_0x5237c1);}(_0xf97f,0x118));var _0xff97=function(_0x4ae9f4,_0x2e6eb8){_0x4ae9f4=_0x4ae9f4-0x0;var _0x186041=_0xf97f[_0x4ae9f4];return _0x186041;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xff97('0x0'));var timeout=require(_0xff97('0x1'));var express=require(_0xff97('0x2'));var router=express[_0xff97('0x3')]();var auth=require(_0xff97('0x4'));var interaction=require(_0xff97('0x5'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xff97('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xff97('0x6')](_0xff97('0x7'),auth[_0xff97('0x8')](),controller['show']);router[_0xff97('0x6')](_0xff97('0x9'),auth[_0xff97('0x8')](),controller[_0xff97('0xa')]);router['get'](_0xff97('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0xff97('0xc')]('/',auth[_0xff97('0x8')](),controller[_0xff97('0xd')]);router[_0xff97('0xc')](_0xff97('0x9'),auth[_0xff97('0x8')](),controller[_0xff97('0xe')]);router['put'](_0xff97('0x7'),auth[_0xff97('0x8')](),controller[_0xff97('0xf')]);router[_0xff97('0x10')](_0xff97('0x7'),auth[_0xff97('0x8')](),controller[_0xff97('0x11')]);module[_0xff97('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js
index c8200eb..739ea11 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.attributes.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5c9c=['sequelize','exports','STRING'];(function(_0x3ae8f4,_0x2920f4){var _0x367312=function(_0x4dffbf){while(--_0x4dffbf){_0x3ae8f4['push'](_0x3ae8f4['shift']());}};_0x367312(++_0x2920f4);}(_0x5c9c,0x111));var _0xc5c9=function(_0x249cc6,_0x6373f){_0x249cc6=_0x249cc6-0x0;var _0x153294=_0x5c9c[_0x249cc6];return _0x153294;};'use strict';var Sequelize=require(_0xc5c9('0x0'));module[_0xc5c9('0x1')]={'name':{'type':Sequelize[_0xc5c9('0x2')]},'username':{'type':Sequelize[_0xc5c9('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc5c9('0x2')]},'tenantId':{'type':Sequelize[_0xc5c9('0x2')]},'clientId':{'type':Sequelize[_0xc5c9('0x2')]},'clientSecret':{'type':Sequelize[_0xc5c9('0x2')]},'serverUrl':{'type':Sequelize[_0xc5c9('0x2')]},'description':{'type':Sequelize[_0xc5c9('0x2')]}};
\ No newline at end of file
+var _0xf1a7=['STRING','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf1a7,0x11f));var _0x7f1a=function(_0x210cbd,_0x100c65){_0x210cbd=_0x210cbd-0x0;var _0x56356b=_0xf1a7[_0x210cbd];return _0x56356b;};'use strict';var Sequelize=require('sequelize');module[_0x7f1a('0x0')]={'name':{'type':Sequelize[_0x7f1a('0x1')]},'username':{'type':Sequelize[_0x7f1a('0x1')]},'password':{'type':Sequelize[_0x7f1a('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x7f1a('0x1')]},'clientId':{'type':Sequelize[_0x7f1a('0x1')]},'clientSecret':{'type':Sequelize[_0x7f1a('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js
index aed9a5b..a9811b1 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.controller.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e54=['prioritycodename','productidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','versionnumber','concat','remoteUri','tenantId','clientSecret','substring','lastIndexOf','format','POST','/oauth2/token','clientId','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','LogicalName','DisplayName','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','end','stack','name','send','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','Dynamics365Account','includeAll','include','findAll','show','params','rawAttributes','find','create','body','destroy','getConfigurations','Dynamics365Configuration','map','addConfiguration','AccountId','Subjects','channel','getDescriptions','getFields','ticketType','incident','PhoneCall','title','subject','phonenumber','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame'];(function(_0x1f776a,_0x19602d){var _0x2a6b35=function(_0x81f169){while(--_0x81f169){_0x1f776a['push'](_0x1f776a['shift']());}};_0x2a6b35(++_0x19602d);}(_0x2e54,0x1dd));var _0x42e5=function(_0x439625,_0x49ff1c){_0x439625=_0x439625-0x0;var _0x37e743=_0x2e54[_0x439625];return _0x37e743;};'use strict';var pdf=require(_0x42e5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x42e5('0x1'));var jsonpatch=require(_0x42e5('0x2'));var rp=require(_0x42e5('0x3'));var moment=require(_0x42e5('0x4'));var BPromise=require(_0x42e5('0x5'));var Mustache=require(_0x42e5('0x6'));var util=require(_0x42e5('0x7'));var path=require('path');var sox=require(_0x42e5('0x8'));var csv=require(_0x42e5('0x9'));var ejs=require(_0x42e5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x9'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var hardwareService=require(_0x42e5('0x12'));var logger=require(_0x42e5('0x13'))(_0x42e5('0x14'));var utils=require('../../config/utils');var config=require(_0x42e5('0x15'));var db=require(_0x42e5('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x42e5('0x17'));var client=jayson[_0x42e5('0x18')][_0x42e5('0x19')]({'port':0x232a});function checkPasswordPattern(_0x41598d,_0x144fb4,_0x1faafc){if(_0x1faafc){var _0x2c18f7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c18f7[_0x42e5('0x1a')](_0x144fb4)){return _0x41598d;}else{throw new Error(_0x42e5('0x1b'));}}else{return _0x41598d;}}function respondWithRpcPromise(_0x23957f,_0x51b2f4,_0x3b3dd9,_0x1d8e52){return new BPromise(function(_0x4034bd,_0x388300){var _0x2f4999=_0x1d8e52||client;return _0x2f4999[_0x42e5('0x1c')](_0x23957f,_0x3b3dd9)[_0x42e5('0x1d')](function(_0x3abe3d){logger[_0x42e5('0x1e')](_0x42e5('0x1f'),_0x51b2f4,_0x42e5('0x20'));logger[_0x42e5('0x21')](_0x42e5('0x22'),_0x51b2f4,_0x42e5('0x20'),JSON['stringify'](_0x3abe3d));if(_0x3abe3d[_0x42e5('0x23')]){if(_0x3abe3d['error']['code']===0x1f4){logger[_0x42e5('0x23')](_0x42e5('0x1f'),_0x51b2f4,_0x3abe3d['error'][_0x42e5('0x24')]);return _0x388300(_0x3abe3d[_0x42e5('0x23')][_0x42e5('0x24')]);}logger[_0x42e5('0x23')](_0x42e5('0x1f'),_0x51b2f4,_0x3abe3d[_0x42e5('0x23')][_0x42e5('0x24')]);return _0x4034bd(_0x3abe3d['error']['message']);}else{logger[_0x42e5('0x1e')]('Dynamics365Account,\x20%s,\x20%s',_0x51b2f4,_0x42e5('0x20'));_0x4034bd(_0x3abe3d[_0x42e5('0x25')][_0x42e5('0x24')]);}})[_0x42e5('0x26')](function(_0x32380f){logger['error'](_0x42e5('0x1f'),_0x51b2f4,_0x32380f);_0x388300(_0x32380f);});});}function respondWithStatusCode(_0xf29221,_0x14640d){_0x14640d=_0x14640d||0xcc;return function(_0x275c80){if(_0x275c80){return _0xf29221[_0x42e5('0x27')](_0x14640d);}return _0xf29221['status'](_0x14640d)['end']();};}function respondWithResult(_0x3115e4,_0x534a26){_0x534a26=_0x534a26||0xc8;return function(_0x56f812){if(_0x56f812){return _0x3115e4[_0x42e5('0x28')](_0x534a26)['json'](_0x56f812);}};}function respondWithFilteredResult(_0x392c6b,_0x2d9e65){return function(_0x4fd119){if(_0x4fd119){var _0x1c8ee4=_0x4fd119[_0x42e5('0x29')],_0x27ae27=_0x2d9e65[_0x42e5('0x2a')],_0x2f1edc=_0x2d9e65[_0x42e5('0x2a')]+_0x2d9e65[_0x42e5('0x2b')],_0x59a46b;if(_0x2f1edc>=_0x1c8ee4){_0x2f1edc=_0x1c8ee4;_0x59a46b=0xc8;}else{_0x59a46b=0xce;}_0x392c6b[_0x42e5('0x28')](_0x59a46b);return _0x392c6b[_0x42e5('0x2c')](_0x42e5('0x2d'),_0x27ae27+'-'+_0x2f1edc+'/'+_0x1c8ee4)[_0x42e5('0x2e')](_0x4fd119);}return null;};}function patchUpdates(_0x5a4930){return function(_0x2ba9ef){try{jsonpatch[_0x42e5('0x2f')](_0x2ba9ef,_0x5a4930,!![]);}catch(_0x3d9e8b){return BPromise[_0x42e5('0x30')](_0x3d9e8b);}return _0x2ba9ef['save']();};}function saveUpdates(_0x293403,_0xf5a3dc){return function(_0x14c8fd){if(_0x14c8fd){return _0x14c8fd[_0x42e5('0x31')](_0x293403)['then'](function(_0x539254){return _0x539254;});}return null;};}function removeEntity(_0x21d933,_0x59f8d6){return function(_0x45f402){if(_0x45f402){return _0x45f402['destroy']()[_0x42e5('0x1d')](function(){_0x21d933[_0x42e5('0x28')](0xcc)[_0x42e5('0x32')]();});}};}function handleEntityNotFound(_0x49a22e,_0x29b9fd){return function(_0x3a8d1c){if(!_0x3a8d1c){_0x49a22e['sendStatus'](0x194);}return _0x3a8d1c;};}function handleError(_0x1ae59c,_0x57558d){_0x57558d=_0x57558d||0x1f4;return function(_0x470ac5){logger[_0x42e5('0x23')](_0x470ac5[_0x42e5('0x33')]);if(_0x470ac5[_0x42e5('0x34')]){delete _0x470ac5[_0x42e5('0x34')];}_0x1ae59c[_0x42e5('0x28')](_0x57558d)[_0x42e5('0x35')](_0x470ac5);};}exports['index']=function(_0x5a18cc,_0xba86e2){var _0xd41feb={},_0x8cf7a8={},_0x4a1a8a={'count':0x0,'rows':[]};var _0x56804a=db['Dynamics365Account']['rawAttributes'];_0x8cf7a8[_0x42e5('0x36')]=_[_0x42e5('0x37')](_0x56804a);_0x8cf7a8[_0x42e5('0x38')]=_[_0x42e5('0x37')](_0x5a18cc[_0x42e5('0x38')]);_0x8cf7a8[_0x42e5('0x39')]=_[_0x42e5('0x3a')](_0x8cf7a8[_0x42e5('0x36')],_0x8cf7a8['query']);_0xd41feb[_0x42e5('0x3b')]=_['intersection'](_0x8cf7a8[_0x42e5('0x36')],qs[_0x42e5('0x3c')](_0x5a18cc[_0x42e5('0x38')][_0x42e5('0x3c')]));_0xd41feb[_0x42e5('0x3b')]=_0xd41feb[_0x42e5('0x3b')][_0x42e5('0x3d')]?_0xd41feb['attributes']:_0x8cf7a8[_0x42e5('0x36')];if(!_0x5a18cc[_0x42e5('0x38')]['hasOwnProperty'](_0x42e5('0x3e'))){_0xd41feb['limit']=qs['limit'](_0x5a18cc['query'][_0x42e5('0x2b')]);_0xd41feb[_0x42e5('0x2a')]=qs[_0x42e5('0x2a')](_0x5a18cc[_0x42e5('0x38')][_0x42e5('0x2a')]);}_0xd41feb[_0x42e5('0x3f')]=qs[_0x42e5('0x40')](_0x5a18cc['query'][_0x42e5('0x40')]);_0xd41feb[_0x42e5('0x41')]=qs['filters'](_[_0x42e5('0x42')](_0x5a18cc[_0x42e5('0x38')],_0x8cf7a8['filters']));if(_0x5a18cc[_0x42e5('0x38')][_0x42e5('0x43')]){_0xd41feb[_0x42e5('0x41')]=_[_0x42e5('0x44')](_0xd41feb[_0x42e5('0x41')],{'$or':_['map'](_0x56804a,function(_0x41e1fd){if(_0x41e1fd[_0x42e5('0x45')][_0x42e5('0x46')]!==_0x42e5('0x47')){var _0x4ba2c3={};_0x4ba2c3[_0x41e1fd[_0x42e5('0x48')]]={'$like':'%'+_0x5a18cc[_0x42e5('0x38')][_0x42e5('0x43')]+'%'};return _0x4ba2c3;}})});}_0xd41feb=_[_0x42e5('0x44')]({},_0xd41feb,_0x5a18cc[_0x42e5('0x49')]);var _0x68ad9b={'where':_0xd41feb[_0x42e5('0x41')]};return db[_0x42e5('0x4a')]['count'](_0x68ad9b)[_0x42e5('0x1d')](function(_0x5b27f6){_0x4a1a8a['count']=_0x5b27f6;if(_0x5a18cc[_0x42e5('0x38')][_0x42e5('0x4b')]){_0xd41feb[_0x42e5('0x4c')]=[{'all':!![]}];}return db[_0x42e5('0x4a')][_0x42e5('0x4d')](_0xd41feb);})[_0x42e5('0x1d')](function(_0x271bbb){_0x4a1a8a['rows']=_0x271bbb;return _0x4a1a8a;})[_0x42e5('0x1d')](respondWithFilteredResult(_0xba86e2,_0xd41feb))[_0x42e5('0x26')](handleError(_0xba86e2,null));};exports[_0x42e5('0x4e')]=function(_0x21a047,_0x1086b2){var _0xc8de4d={'raw':![],'where':{'id':_0x21a047[_0x42e5('0x4f')]['id']}},_0x3d910a={};_0x3d910a['model']=_[_0x42e5('0x37')](db[_0x42e5('0x4a')][_0x42e5('0x50')]);_0x3d910a[_0x42e5('0x38')]=_[_0x42e5('0x37')](_0x21a047[_0x42e5('0x38')]);_0x3d910a[_0x42e5('0x39')]=_[_0x42e5('0x3a')](_0x3d910a[_0x42e5('0x36')],_0x3d910a['query']);_0xc8de4d[_0x42e5('0x3b')]=_['intersection'](_0x3d910a[_0x42e5('0x36')],qs[_0x42e5('0x3c')](_0x21a047[_0x42e5('0x38')]['fields']));_0xc8de4d['attributes']=_0xc8de4d['attributes'][_0x42e5('0x3d')]?_0xc8de4d[_0x42e5('0x3b')]:_0x3d910a[_0x42e5('0x36')];if(_0x21a047[_0x42e5('0x38')]['includeAll']){_0xc8de4d[_0x42e5('0x4c')]=[{'all':!![]}];}_0xc8de4d=_[_0x42e5('0x44')]({},_0xc8de4d,_0x21a047[_0x42e5('0x49')]);return db['Dynamics365Account'][_0x42e5('0x51')](_0xc8de4d)['then'](handleEntityNotFound(_0x1086b2,null))[_0x42e5('0x1d')](respondWithResult(_0x1086b2,null))[_0x42e5('0x26')](handleError(_0x1086b2,null));};exports['create']=function(_0x2588e6,_0x18509a){return db[_0x42e5('0x4a')][_0x42e5('0x52')](_0x2588e6[_0x42e5('0x53')],{})[_0x42e5('0x1d')](respondWithResult(_0x18509a,0xc9))[_0x42e5('0x26')](handleError(_0x18509a,null));};exports[_0x42e5('0x31')]=function(_0x1ddd4c,_0x16efb2){if(_0x1ddd4c['body']['id']){delete _0x1ddd4c[_0x42e5('0x53')]['id'];}return db[_0x42e5('0x4a')][_0x42e5('0x51')]({'where':{'id':_0x1ddd4c[_0x42e5('0x4f')]['id']}})[_0x42e5('0x1d')](handleEntityNotFound(_0x16efb2,null))['then'](saveUpdates(_0x1ddd4c[_0x42e5('0x53')],null))[_0x42e5('0x1d')](respondWithResult(_0x16efb2,null))[_0x42e5('0x26')](handleError(_0x16efb2,null));};exports[_0x42e5('0x54')]=function(_0x5ac909,_0x5ec79a){return db['Dynamics365Account'][_0x42e5('0x51')]({'where':{'id':_0x5ac909[_0x42e5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5ec79a,null))[_0x42e5('0x1d')](removeEntity(_0x5ec79a,null))[_0x42e5('0x26')](handleError(_0x5ec79a,null));};exports[_0x42e5('0x55')]=function(_0x2ced33,_0xb1cd9e,_0x4361cb){var _0x2ec142={};var _0x2c76e0={};var _0x3692fc;var _0x5688a4;return db[_0x42e5('0x4a')]['findOne']({'where':{'id':_0x2ced33[_0x42e5('0x4f')]['id']}})[_0x42e5('0x1d')](handleEntityNotFound(_0xb1cd9e,null))[_0x42e5('0x1d')](function(_0x3b4836){if(_0x3b4836){_0x3692fc=_0x3b4836;_0x2c76e0[_0x42e5('0x36')]=_[_0x42e5('0x37')](db[_0x42e5('0x56')][_0x42e5('0x50')]);_0x2c76e0[_0x42e5('0x38')]=_[_0x42e5('0x37')](_0x2ced33[_0x42e5('0x38')]);_0x2c76e0['filters']=_[_0x42e5('0x3a')](_0x2c76e0['model'],_0x2c76e0[_0x42e5('0x38')]);_0x2ec142['attributes']=_[_0x42e5('0x3a')](_0x2c76e0[_0x42e5('0x36')],qs['fields'](_0x2ced33[_0x42e5('0x38')][_0x42e5('0x3c')]));_0x2ec142['attributes']=_0x2ec142[_0x42e5('0x3b')][_0x42e5('0x3d')]?_0x2ec142['attributes']:_0x2c76e0[_0x42e5('0x36')];_0x2ec142[_0x42e5('0x3f')]=qs[_0x42e5('0x40')](_0x2ced33['query'][_0x42e5('0x40')]);_0x2ec142[_0x42e5('0x41')]=qs[_0x42e5('0x39')](_[_0x42e5('0x42')](_0x2ced33['query'],_0x2c76e0[_0x42e5('0x39')]));if(_0x2ced33['query'][_0x42e5('0x43')]){_0x2ec142[_0x42e5('0x41')]=_[_0x42e5('0x44')](_0x2ec142[_0x42e5('0x41')],{'$or':_[_0x42e5('0x57')](_0x2ec142[_0x42e5('0x3b')],function(_0x15ff42){var _0x590f7b={};_0x590f7b[_0x15ff42]={'$like':'%'+_0x2ced33[_0x42e5('0x38')][_0x42e5('0x43')]+'%'};return _0x590f7b;})});}_0x2ec142=_[_0x42e5('0x44')]({},_0x2ec142,_0x2ced33[_0x42e5('0x49')]);return _0x3692fc[_0x42e5('0x55')](_0x2ec142);}})[_0x42e5('0x1d')](function(_0xfef629){if(_0xfef629){_0x5688a4=_0xfef629[_0x42e5('0x3d')];if(!_0x2ced33[_0x42e5('0x38')]['hasOwnProperty'](_0x42e5('0x3e'))){_0x2ec142[_0x42e5('0x2b')]=qs[_0x42e5('0x2b')](_0x2ced33[_0x42e5('0x38')]['limit']);_0x2ec142[_0x42e5('0x2a')]=qs[_0x42e5('0x2a')](_0x2ced33[_0x42e5('0x38')][_0x42e5('0x2a')]);}return _0x3692fc['getConfigurations'](_0x2ec142);}})['then'](function(_0x4ef0b0){if(_0x4ef0b0){return _0x4ef0b0?{'count':_0x5688a4,'rows':_0x4ef0b0}:null;}})[_0x42e5('0x1d')](respondWithResult(_0xb1cd9e,null))[_0x42e5('0x26')](handleError(_0xb1cd9e,null));};exports[_0x42e5('0x58')]=function(_0x2ce1d4,_0xb198d,_0x14d111){if(_0x2ce1d4[_0x42e5('0x53')]['id']){delete _0x2ce1d4[_0x42e5('0x53')]['id'];}return db[_0x42e5('0x4a')]['findOne']({'where':{'id':_0x2ce1d4[_0x42e5('0x4f')]['id']}})[_0x42e5('0x1d')](handleEntityNotFound(_0xb198d,null))[_0x42e5('0x1d')](function(_0x398391){if(_0x398391){_0x2ce1d4[_0x42e5('0x53')][_0x42e5('0x59')]=_0x398391['id'];_0x2ce1d4[_0x42e5('0x53')][_0x42e5('0x5a')]=integrations['getSubjects'](_0x2ce1d4['body'][_0x42e5('0x5b')],_0x2ce1d4[_0x42e5('0x53')]['type']);_0x2ce1d4['body']['Descriptions']=integrations[_0x42e5('0x5c')](_0x2ce1d4[_0x42e5('0x53')]['channel'],_0x2ce1d4[_0x42e5('0x53')][_0x42e5('0x45')]);return db['Dynamics365Configuration'][_0x42e5('0x52')](_0x2ce1d4[_0x42e5('0x53')],{'include':[{'model':db['Dynamics365Field'],'as':_0x42e5('0x5a')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0xb198d,null))['catch'](handleError(_0xb198d,null));};exports[_0x42e5('0x5d')]=function(_0x234e29,_0x4c7cc5,_0x1be0ce){var _0x3e4d9c=_0x234e29[_0x42e5('0x38')][_0x42e5('0x5e')];var _0x1d7c2a=_0x3e4d9c===_0x42e5('0x5f')?'Incident':_0x42e5('0x60');var _0xe0f6ab='';var _0x51a05e='';var _0x598661='';var _0x2faf9b='';var _0xfa822e='';var _0x2dbba9='';var _0xef49d2='';var _0x1e2fa7='';var _0xacf060=[_0x42e5('0x61'),'description','customerid','ownerid','caseorigincode',_0x42e5('0x62'),_0x42e5('0x63'),'regardingobjectid',_0x42e5('0x64'),'phonecall_activity_parties'];var _0x19aeca=[_0x42e5('0x65'),_0x42e5('0x66'),_0x42e5('0x67'),_0x42e5('0x68'),_0x42e5('0x69'),_0x42e5('0x6a'),_0x42e5('0x6b'),_0x42e5('0x6c'),_0x42e5('0x6d'),_0x42e5('0x6e'),_0x42e5('0x6f'),_0x42e5('0x70'),_0x42e5('0x71'),_0x42e5('0x72'),_0x42e5('0x73'),_0x42e5('0x74'),_0x42e5('0x75'),'customeridyominame',_0x42e5('0x76'),_0x42e5('0x77'),_0x42e5('0x78'),_0x42e5('0x79'),_0x42e5('0x7a'),_0x42e5('0x7b'),_0x42e5('0x7c'),_0x42e5('0x7d'),'importsequencenumber',_0x42e5('0x7e'),_0x42e5('0x7f'),_0x42e5('0x80'),_0x42e5('0x81'),_0x42e5('0x82'),'modifiedbyexternalpartyyominame','modifiedbyname',_0x42e5('0x83'),_0x42e5('0x84'),_0x42e5('0x85'),_0x42e5('0x86'),_0x42e5('0x87'),_0x42e5('0x88'),_0x42e5('0x89'),_0x42e5('0x8a'),_0x42e5('0x8b'),'owneridname',_0x42e5('0x8c'),_0x42e5('0x8d'),'parentcaseidname',_0x42e5('0x8e'),_0x42e5('0x8f'),_0x42e5('0x90'),_0x42e5('0x91'),'productserialnumber','resolveby','resolvebykpiidname',_0x42e5('0x92'),_0x42e5('0x93'),_0x42e5('0x94'),_0x42e5('0x95'),_0x42e5('0x96'),_0x42e5('0x97'),_0x42e5('0x98'),'statecode',_0x42e5('0x99'),_0x42e5('0x9a'),_0x42e5('0x9b'),'timezoneruleversionnumber',_0x42e5('0x9c'),'traversedpath','utcconversiontimezonecode',_0x42e5('0x9d')];var _0x1e1d32=_0xacf060[_0x42e5('0x9e')](_0x19aeca);return db['Dynamics365Account']['findOne']({'where':{'id':_0x234e29[_0x42e5('0x4f')]['id']},'attributes':['id','username','password',_0x42e5('0x9f'),_0x42e5('0xa0'),'clientId',_0x42e5('0xa1')]})[_0x42e5('0x1d')](handleEntityNotFound(_0x4c7cc5,null))[_0x42e5('0x1d')](function(_0x161f3d){if(_0x161f3d){_0x1e2fa7=_0x161f3d[_0x42e5('0x9f')];var _0x44aa72=_0x1e2fa7['slice'](-0x1);if(_0x44aa72==='/'){_0x1e2fa7=_0x1e2fa7[_0x42e5('0xa2')](0x0,_0x1e2fa7[_0x42e5('0xa3')](_0x44aa72));}_0xef49d2=util[_0x42e5('0xa4')]('%s/api/data/v9.0/',_0x1e2fa7);var _0x27ee6e={'method':_0x42e5('0xa5'),'uri':'https://login.microsoftonline.com/'+_0x161f3d[_0x42e5('0xa0')]+_0x42e5('0xa6'),'form':{'client_id':_0x161f3d[_0x42e5('0xa7')],'resource':_0x1e2fa7,'username':_0x161f3d['username'],'password':_0x161f3d[_0x42e5('0xa8')],'grant_type':_0x42e5('0xa8'),'client_secret':_0x161f3d['clientSecret']},'json':!![]};return rp(_0x27ee6e);}})['then'](function(_0x3a539d){_0x2dbba9=_0x3a539d['access_token'];var _0x290083={'method':_0x42e5('0xa9'),'uri':encodeURI(_0xef49d2+_0x42e5('0xaa')+_0x1d7c2a+'\x27'),'headers':{'Authorization':_0x42e5('0xab')+_0x2dbba9,'If-None-Match':null,'OData-Version':_0x42e5('0xac')},'json':!![]};return rp(_0x290083);})['then'](function(_0xeee19d){var _0x34d888=_0xeee19d[_0x42e5('0xad')][0x0];var _0x4e1188=_0x34d888[_0x42e5('0xae')];var _0x1d02f7={'method':_0x42e5('0xa9'),'uri':_0xef49d2+_0x42e5('0xaf')+_0x4e1188+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x42e5('0xab')+_0x2dbba9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1d02f7);})['then'](function(_0x14494d){_0xe0f6ab=_0x14494d;_0x51a05e=_0xe0f6ab[_0x42e5('0xb0')];_0x51a05e=_[_0x42e5('0xb1')](_0x51a05e,function(_0x3c613b){return!_0x1e1d32[_0x42e5('0xb2')](_0x3c613b['LogicalName']);});var _0x35c329=[];var _0x1d6ee2=[];_0x51a05e[_0x42e5('0xb3')](function(_0x3114a9){if(_0x3114a9[_0x42e5('0xb4')]){var _0x79691=_0x3114a9[_0x42e5('0xb4')][_0x42e5('0xa2')](_0x3114a9[_0x42e5('0xb4')]['lastIndexOf']('.')+0x1);if(_0x79691===_0x42e5('0xb5')){_0x35c329[_0x42e5('0xb6')](getSelectList(_0xef49d2,_0x3e4d9c,_0x1d6ee2,_0xe0f6ab[_0x42e5('0xae')],_0x3114a9[_0x42e5('0xae')],_0x2dbba9));}}});return Promise[_0x42e5('0xb7')](_0x35c329);})[_0x42e5('0x1d')](function(_0x39c46){_0x598661=_0x39c46[0x0];var _0x432105=[];var _0x33deb3=[];_0x51a05e[_0x42e5('0xb3')](function(_0x4ea39f){if(!_['isNil'](_0x4ea39f['@odata.type'])){var _0x5cbf7=_0x4ea39f[_0x42e5('0xb4')]['substring'](_0x4ea39f[_0x42e5('0xb4')]['lastIndexOf']('.')+0x1);if(_0x5cbf7===_0x42e5('0xb8')){_0x432105['push'](getBooleanList(_0xef49d2,_0x3e4d9c,_0x33deb3,_0xe0f6ab['MetadataId'],_0x4ea39f['MetadataId'],_0x2dbba9));}}});return Promise[_0x42e5('0xb7')](_0x432105);})[_0x42e5('0x1d')](function(_0x26ee9c){_0x2faf9b=_0x26ee9c[0x0];var _0x36ca4c=[];var _0x3f7dd1=[];_0x51a05e['forEach'](function(_0x4b5500){if(_0x4b5500[_0x42e5('0xb4')]){var _0x3bcde9=_0x4b5500[_0x42e5('0xb4')][_0x42e5('0xa2')](_0x4b5500[_0x42e5('0xb4')]['lastIndexOf']('.')+0x1);if(_0x3bcde9===_0x42e5('0xb9')||_0x3bcde9===_0x42e5('0xba')||_0x3bcde9===_0x42e5('0xbb')||_0x3bcde9==='IntegerAttributeMetadata'||_0x3bcde9==='MemoAttributeMetadata'||_0x3bcde9==='DateTimeAttributeMetadata'||_0x3bcde9===_0x42e5('0xbc')||_0x3bcde9==='EntityNameAttributeMetadata'||_0x3bcde9===_0x42e5('0xbd')||_0x3bcde9===_0x42e5('0xbe')){_0x36ca4c['push'](getInputList(_0xef49d2,_0x3e4d9c,_0x3bcde9,_0x3f7dd1,_0xe0f6ab[_0x42e5('0xae')],_0x4b5500[_0x42e5('0xae')],_0x2dbba9));}}});return Promise[_0x42e5('0xb7')](_0x36ca4c);})['then'](function(_0x106257){_0xfa822e=_0x106257[0x0];var _0xa1efc=_0x598661[_0x42e5('0x9e')](_0x2faf9b)[_0x42e5('0x9e')](_0xfa822e);var _0x3439d7={'count':_0xa1efc['length'],'rows':_0xa1efc};return _0x3439d7;})[_0x42e5('0x1d')](respondWithResult(_0x4c7cc5,null))[_0x42e5('0x26')](function(_0xca0d13){console[_0x42e5('0xbf')](_0x42e5('0xc0')+_0xca0d13);var _0x59a32e=_0x234e29[_0x42e5('0x38')][_0x42e5('0x1a')]?0x1f4:_0xca0d13['statusCode']||0x1f4;logger[_0x42e5('0x23')](_0xca0d13[_0x42e5('0x33')]);delete _0xca0d13[_0x42e5('0x34')];if(_0x59a32e===0x191){_0x59a32e=0x190;}_0x4c7cc5[_0x42e5('0x28')](_0x59a32e)[_0x42e5('0x35')](_0x234e29[_0x42e5('0x38')][_0x42e5('0x1a')]?{'message':_0x42e5('0xc1'),'statusCode':_0xca0d13['statusCode']}:_0xca0d13);});};function getSelectList(_0x71237a,_0x56f112,_0x1ae1b5,_0x318d1d,_0x24dfeb,_0x5cca6d){var _0x47a704={'method':_0x42e5('0xa9'),'uri':_0x71237a+_0x42e5('0xaf')+_0x318d1d+_0x42e5('0xc2')+_0x24dfeb+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x42e5('0xc3'),'headers':{'Authorization':_0x42e5('0xab')+_0x5cca6d,'If-None-Match':null,'OData-Version':_0x42e5('0xac')},'json':!![]};return rp(_0x47a704)[_0x42e5('0x1d')](function(_0x2fbf4f){var _0x9610a9=[];var _0x15de56=_0x2fbf4f[_0x42e5('0xc4')][_0x42e5('0xc5')];_0x15de56[_0x42e5('0xb3')](function(_0x5b0da1){_0x9610a9[_0x42e5('0xb6')]({'name':_0x5b0da1['Label'][_0x42e5('0xc6')]['Label'],'value':String(_0x5b0da1['Value'])});});var _0x1fd5b9={'id':_0x56f112+'_'+_0x2fbf4f[_0x42e5('0xc7')],'name':_0x2fbf4f[_0x42e5('0xc8')][_0x42e5('0xc6')][_0x42e5('0xc9')],'custom':![],'options':_0x9610a9};_0x1ae1b5[_0x42e5('0xb6')](_0x1fd5b9);return _0x1ae1b5;});}function getBooleanList(_0x375661,_0x99dbde,_0x1cf1a6,_0x25264b,_0x4331b4,_0xb6ff9a){var _0x1385dd={'method':_0x42e5('0xa9'),'uri':_0x375661+'EntityDefinitions('+_0x25264b+_0x42e5('0xc2')+_0x4331b4+_0x42e5('0xca'),'headers':{'Authorization':_0x42e5('0xab')+_0xb6ff9a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1385dd)[_0x42e5('0x1d')](function(_0x5d9764){var _0x506914=[];_0x506914[_0x42e5('0xb6')]({'name':_0x5d9764[_0x42e5('0xc4')]['TrueOption'][_0x42e5('0xc9')][_0x42e5('0xc6')][_0x42e5('0xc9')],'value':'true'},{'name':_0x5d9764[_0x42e5('0xc4')][_0x42e5('0xcb')][_0x42e5('0xc9')]['UserLocalizedLabel'][_0x42e5('0xc9')],'value':_0x42e5('0xcc')});var _0x530101={'id':_0x99dbde+'_'+_0x5d9764[_0x42e5('0xc7')],'name':_0x5d9764[_0x42e5('0xc8')][_0x42e5('0xc6')]['Label'],'custom':![],'options':_0x506914};_0x1cf1a6[_0x42e5('0xb6')](_0x530101);return _0x1cf1a6;});}function getInputList(_0x250356,_0x587e30,_0x270889,_0x4e3875,_0x3ceac8,_0x3ddb84,_0x5eb50f){var _0x3a178d={'method':_0x42e5('0xa9'),'uri':_0x250356+_0x42e5('0xaf')+_0x3ceac8+_0x42e5('0xc2')+_0x3ddb84+_0x42e5('0xcd')+_0x270889+_0x42e5('0xce'),'headers':{'Authorization':_0x42e5('0xab')+_0x5eb50f,'If-None-Match':null,'OData-Version':_0x42e5('0xac')},'json':!![]};return rp(_0x3a178d)[_0x42e5('0x1d')](function(_0x1d312c){var _0xe589e5={'id':_0x587e30+'_'+_0x1d312c[_0x42e5('0xc7')],'name':_0x1d312c[_0x42e5('0xc8')]['UserLocalizedLabel']?_0x1d312c['DisplayName'][_0x42e5('0xc6')][_0x42e5('0xc9')]:_0x1d312c[_0x42e5('0xc7')],'custom':![],'options':[]};_0x4e3875[_0x42e5('0xb6')](_0xe589e5);return _0x4e3875;});}
\ No newline at end of file
+var _0x4dfc=['$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','DisplayName','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','then','destroy','stack','name','send','index','Dynamics365Account','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','key','includeAll','rows','rawAttributes','length','include','options','find','catch','create','body','params','getConfigurations','Dynamics365Configuration','map','findOne','Subjects','getSubjects','channel','Descriptions','type','getFields','incident','Incident','PhoneCall','description','customerid','ownerid','subject','phonenumber','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','prioritycodename','productidname','productserialnumber','responseby','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientSecret','remoteUri','substring','lastIndexOf','POST','/oauth2/token','clientId','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','isNil','BooleanAttributeMetadata','all','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StateAttributeMetadata','log','Dynamics365\x20error:\x20','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'];(function(_0x3fdec8,_0x275412){var _0x167f5f=function(_0x2ac58f){while(--_0x2ac58f){_0x3fdec8['push'](_0x3fdec8['shift']());}};_0x167f5f(++_0x275412);}(_0x4dfc,0xda));var _0xc4df=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0x4dfc[_0x4a96ca];return _0x2aed48;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc4df('0x0'));var jsonpatch=require(_0xc4df('0x1'));var rp=require(_0xc4df('0x2'));var moment=require(_0xc4df('0x3'));var BPromise=require(_0xc4df('0x4'));var Mustache=require(_0xc4df('0x5'));var util=require(_0xc4df('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc4df('0x7'));var fs=require('fs');var _=require(_0xc4df('0x8'));var squel=require('squel');var crypto=require(_0xc4df('0x9'));var jsforce=require(_0xc4df('0xa'));var deskjs=require(_0xc4df('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc4df('0xc'));var Papa=require(_0xc4df('0xd'));var Redis=require(_0xc4df('0xe'));var authService=require(_0xc4df('0xf'));var qs=require(_0xc4df('0x10'));var hardwareService=require(_0xc4df('0x11'));var logger=require(_0xc4df('0x12'))(_0xc4df('0x13'));var utils=require('../../config/utils');var config=require(_0xc4df('0x14'));var db=require(_0xc4df('0x15'))['db'];var integrations=require(_0xc4df('0x16'));var jayson=require(_0xc4df('0x17'));var client=jayson[_0xc4df('0x18')][_0xc4df('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3599c1,_0x1359a6,_0x908d2f){if(_0x908d2f){var _0x1f3384=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f3384[_0xc4df('0x1a')](_0x1359a6)){return _0x3599c1;}else{throw new Error(_0xc4df('0x1b'));}}else{return _0x3599c1;}}function respondWithRpcPromise(_0x2d1005,_0x25cfbf,_0x814661,_0x8ac080){return new BPromise(function(_0x5eeb1e,_0xd72cc7){var _0xc62bfa=_0x8ac080||client;return _0xc62bfa['request'](_0x2d1005,_0x814661)['then'](function(_0x112bd3){logger[_0xc4df('0x1c')](_0xc4df('0x1d'),_0x25cfbf,_0xc4df('0x1e'));logger[_0xc4df('0x1f')](_0xc4df('0x20'),_0x25cfbf,_0xc4df('0x1e'),JSON[_0xc4df('0x21')](_0x112bd3));if(_0x112bd3[_0xc4df('0x22')]){if(_0x112bd3['error'][_0xc4df('0x23')]===0x1f4){logger[_0xc4df('0x22')](_0xc4df('0x1d'),_0x25cfbf,_0x112bd3[_0xc4df('0x22')][_0xc4df('0x24')]);return _0xd72cc7(_0x112bd3[_0xc4df('0x22')][_0xc4df('0x24')]);}logger[_0xc4df('0x22')](_0xc4df('0x1d'),_0x25cfbf,_0x112bd3[_0xc4df('0x22')][_0xc4df('0x24')]);return _0x5eeb1e(_0x112bd3[_0xc4df('0x22')]['message']);}else{logger[_0xc4df('0x1c')]('Dynamics365Account,\x20%s,\x20%s',_0x25cfbf,_0xc4df('0x1e'));_0x5eeb1e(_0x112bd3['result']['message']);}})['catch'](function(_0x547c5b){logger[_0xc4df('0x22')](_0xc4df('0x1d'),_0x25cfbf,_0x547c5b);_0xd72cc7(_0x547c5b);});});}function respondWithStatusCode(_0x553345,_0x59044f){_0x59044f=_0x59044f||0xcc;return function(_0x3ee721){if(_0x3ee721){return _0x553345[_0xc4df('0x25')](_0x59044f);}return _0x553345[_0xc4df('0x26')](_0x59044f)[_0xc4df('0x27')]();};}function respondWithResult(_0x572bc5,_0x1ce177){_0x1ce177=_0x1ce177||0xc8;return function(_0x34da17){if(_0x34da17){return _0x572bc5[_0xc4df('0x26')](_0x1ce177)[_0xc4df('0x28')](_0x34da17);}};}function respondWithFilteredResult(_0x4c9f87,_0x21eef3){return function(_0x41b91d){if(_0x41b91d){var _0x308749=_0x41b91d[_0xc4df('0x29')],_0x43e84f=_0x21eef3[_0xc4df('0x2a')],_0x2ce795=_0x21eef3[_0xc4df('0x2a')]+_0x21eef3['limit'],_0x533b31;if(_0x2ce795>=_0x308749){_0x2ce795=_0x308749;_0x533b31=0xc8;}else{_0x533b31=0xce;}_0x4c9f87[_0xc4df('0x26')](_0x533b31);return _0x4c9f87['set'](_0xc4df('0x2b'),_0x43e84f+'-'+_0x2ce795+'/'+_0x308749)['json'](_0x41b91d);}return null;};}function patchUpdates(_0x1cfbfb){return function(_0x309181){try{jsonpatch[_0xc4df('0x2c')](_0x309181,_0x1cfbfb,!![]);}catch(_0x1f6b30){return BPromise['reject'](_0x1f6b30);}return _0x309181[_0xc4df('0x2d')]();};}function saveUpdates(_0x530560,_0x22e231){return function(_0x29b841){if(_0x29b841){return _0x29b841[_0xc4df('0x2e')](_0x530560)[_0xc4df('0x2f')](function(_0x55e4e5){return _0x55e4e5;});}return null;};}function removeEntity(_0x4a495d,_0x52a960){return function(_0x4f070a){if(_0x4f070a){return _0x4f070a[_0xc4df('0x30')]()[_0xc4df('0x2f')](function(){_0x4a495d[_0xc4df('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e4306,_0x3ddc76){return function(_0x1e2104){if(!_0x1e2104){_0x5e4306[_0xc4df('0x25')](0x194);}return _0x1e2104;};}function handleError(_0x15d88a,_0x280545){_0x280545=_0x280545||0x1f4;return function(_0x4b756d){logger[_0xc4df('0x22')](_0x4b756d[_0xc4df('0x31')]);if(_0x4b756d[_0xc4df('0x32')]){delete _0x4b756d[_0xc4df('0x32')];}_0x15d88a[_0xc4df('0x26')](_0x280545)[_0xc4df('0x33')](_0x4b756d);};}exports[_0xc4df('0x34')]=function(_0x177c77,_0x17add6){var _0x17b003={},_0x4c3ec7={},_0x47959a={'count':0x0,'rows':[]};var _0x21910d=db[_0xc4df('0x35')]['rawAttributes'];_0x4c3ec7[_0xc4df('0x36')]=_[_0xc4df('0x37')](_0x21910d);_0x4c3ec7['query']=_['keys'](_0x177c77[_0xc4df('0x38')]);_0x4c3ec7[_0xc4df('0x39')]=_[_0xc4df('0x3a')](_0x4c3ec7[_0xc4df('0x36')],_0x4c3ec7[_0xc4df('0x38')]);_0x17b003['attributes']=_[_0xc4df('0x3a')](_0x4c3ec7['model'],qs['fields'](_0x177c77[_0xc4df('0x38')][_0xc4df('0x3b')]));_0x17b003[_0xc4df('0x3c')]=_0x17b003['attributes']['length']?_0x17b003[_0xc4df('0x3c')]:_0x4c3ec7[_0xc4df('0x36')];if(!_0x177c77[_0xc4df('0x38')][_0xc4df('0x3d')](_0xc4df('0x3e'))){_0x17b003['limit']=qs[_0xc4df('0x3f')](_0x177c77['query'][_0xc4df('0x3f')]);_0x17b003[_0xc4df('0x2a')]=qs['offset'](_0x177c77[_0xc4df('0x38')]['offset']);}_0x17b003[_0xc4df('0x40')]=qs[_0xc4df('0x41')](_0x177c77[_0xc4df('0x38')][_0xc4df('0x41')]);_0x17b003['where']=qs['filters'](_[_0xc4df('0x42')](_0x177c77[_0xc4df('0x38')],_0x4c3ec7['filters']));if(_0x177c77['query'][_0xc4df('0x43')]){_0x17b003[_0xc4df('0x44')]=_[_0xc4df('0x45')](_0x17b003[_0xc4df('0x44')],{'$or':_['map'](_0x21910d,function(_0x1118b4){if(_0x1118b4['type'][_0xc4df('0x46')]!=='VIRTUAL'){var _0x52cf65={};_0x52cf65[_0x1118b4['field']]={'$like':'%'+_0x177c77[_0xc4df('0x38')]['filter']+'%'};return _0x52cf65;}})});}_0x17b003=_[_0xc4df('0x45')]({},_0x17b003,_0x177c77['options']);var _0x3c1820={'where':_0x17b003[_0xc4df('0x44')]};return db[_0xc4df('0x35')]['count'](_0x3c1820)[_0xc4df('0x2f')](function(_0x29de47){_0x47959a['count']=_0x29de47;if(_0x177c77[_0xc4df('0x38')][_0xc4df('0x47')]){_0x17b003['include']=[{'all':!![]}];}return db[_0xc4df('0x35')]['findAll'](_0x17b003);})['then'](function(_0x26140b){_0x47959a[_0xc4df('0x48')]=_0x26140b;return _0x47959a;})[_0xc4df('0x2f')](respondWithFilteredResult(_0x17add6,_0x17b003))['catch'](handleError(_0x17add6,null));};exports['show']=function(_0x5aabf6,_0x2c30cb){var _0x136b07={'raw':![],'where':{'id':_0x5aabf6['params']['id']}},_0x5473b7={};_0x5473b7[_0xc4df('0x36')]=_[_0xc4df('0x37')](db[_0xc4df('0x35')][_0xc4df('0x49')]);_0x5473b7[_0xc4df('0x38')]=_['keys'](_0x5aabf6[_0xc4df('0x38')]);_0x5473b7['filters']=_[_0xc4df('0x3a')](_0x5473b7[_0xc4df('0x36')],_0x5473b7[_0xc4df('0x38')]);_0x136b07[_0xc4df('0x3c')]=_['intersection'](_0x5473b7['model'],qs[_0xc4df('0x3b')](_0x5aabf6[_0xc4df('0x38')][_0xc4df('0x3b')]));_0x136b07[_0xc4df('0x3c')]=_0x136b07[_0xc4df('0x3c')][_0xc4df('0x4a')]?_0x136b07[_0xc4df('0x3c')]:_0x5473b7[_0xc4df('0x36')];if(_0x5aabf6[_0xc4df('0x38')]['includeAll']){_0x136b07[_0xc4df('0x4b')]=[{'all':!![]}];}_0x136b07=_[_0xc4df('0x45')]({},_0x136b07,_0x5aabf6[_0xc4df('0x4c')]);return db[_0xc4df('0x35')][_0xc4df('0x4d')](_0x136b07)[_0xc4df('0x2f')](handleEntityNotFound(_0x2c30cb,null))[_0xc4df('0x2f')](respondWithResult(_0x2c30cb,null))[_0xc4df('0x4e')](handleError(_0x2c30cb,null));};exports[_0xc4df('0x4f')]=function(_0x2bfe1f,_0x5a3150){return db[_0xc4df('0x35')][_0xc4df('0x4f')](_0x2bfe1f[_0xc4df('0x50')],{})['then'](respondWithResult(_0x5a3150,0xc9))[_0xc4df('0x4e')](handleError(_0x5a3150,null));};exports[_0xc4df('0x2e')]=function(_0x42b2eb,_0xf3c182){if(_0x42b2eb['body']['id']){delete _0x42b2eb['body']['id'];}return db[_0xc4df('0x35')][_0xc4df('0x4d')]({'where':{'id':_0x42b2eb[_0xc4df('0x51')]['id']}})['then'](handleEntityNotFound(_0xf3c182,null))[_0xc4df('0x2f')](saveUpdates(_0x42b2eb[_0xc4df('0x50')],null))[_0xc4df('0x2f')](respondWithResult(_0xf3c182,null))[_0xc4df('0x4e')](handleError(_0xf3c182,null));};exports['destroy']=function(_0x2bf34f,_0x5f0cf6){return db[_0xc4df('0x35')][_0xc4df('0x4d')]({'where':{'id':_0x2bf34f[_0xc4df('0x51')]['id']}})[_0xc4df('0x2f')](handleEntityNotFound(_0x5f0cf6,null))[_0xc4df('0x2f')](removeEntity(_0x5f0cf6,null))[_0xc4df('0x4e')](handleError(_0x5f0cf6,null));};exports[_0xc4df('0x52')]=function(_0x5b8ce3,_0x555380,_0x344ec9){var _0x1d1661={};var _0x546fd0={};var _0x230b18;var _0x4ee438;return db['Dynamics365Account']['findOne']({'where':{'id':_0x5b8ce3['params']['id']}})[_0xc4df('0x2f')](handleEntityNotFound(_0x555380,null))[_0xc4df('0x2f')](function(_0x4655e7){if(_0x4655e7){_0x230b18=_0x4655e7;_0x546fd0[_0xc4df('0x36')]=_[_0xc4df('0x37')](db[_0xc4df('0x53')][_0xc4df('0x49')]);_0x546fd0[_0xc4df('0x38')]=_[_0xc4df('0x37')](_0x5b8ce3[_0xc4df('0x38')]);_0x546fd0[_0xc4df('0x39')]=_[_0xc4df('0x3a')](_0x546fd0[_0xc4df('0x36')],_0x546fd0[_0xc4df('0x38')]);_0x1d1661[_0xc4df('0x3c')]=_['intersection'](_0x546fd0[_0xc4df('0x36')],qs[_0xc4df('0x3b')](_0x5b8ce3[_0xc4df('0x38')][_0xc4df('0x3b')]));_0x1d1661[_0xc4df('0x3c')]=_0x1d1661[_0xc4df('0x3c')][_0xc4df('0x4a')]?_0x1d1661['attributes']:_0x546fd0[_0xc4df('0x36')];_0x1d1661[_0xc4df('0x40')]=qs[_0xc4df('0x41')](_0x5b8ce3[_0xc4df('0x38')][_0xc4df('0x41')]);_0x1d1661[_0xc4df('0x44')]=qs['filters'](_[_0xc4df('0x42')](_0x5b8ce3[_0xc4df('0x38')],_0x546fd0[_0xc4df('0x39')]));if(_0x5b8ce3[_0xc4df('0x38')][_0xc4df('0x43')]){_0x1d1661[_0xc4df('0x44')]=_[_0xc4df('0x45')](_0x1d1661[_0xc4df('0x44')],{'$or':_[_0xc4df('0x54')](_0x1d1661['attributes'],function(_0x1cbbad){var _0x10e847={};_0x10e847[_0x1cbbad]={'$like':'%'+_0x5b8ce3[_0xc4df('0x38')][_0xc4df('0x43')]+'%'};return _0x10e847;})});}_0x1d1661=_[_0xc4df('0x45')]({},_0x1d1661,_0x5b8ce3['options']);return _0x230b18[_0xc4df('0x52')](_0x1d1661);}})[_0xc4df('0x2f')](function(_0x416e86){if(_0x416e86){_0x4ee438=_0x416e86[_0xc4df('0x4a')];if(!_0x5b8ce3[_0xc4df('0x38')][_0xc4df('0x3d')](_0xc4df('0x3e'))){_0x1d1661['limit']=qs[_0xc4df('0x3f')](_0x5b8ce3[_0xc4df('0x38')][_0xc4df('0x3f')]);_0x1d1661[_0xc4df('0x2a')]=qs[_0xc4df('0x2a')](_0x5b8ce3['query'][_0xc4df('0x2a')]);}return _0x230b18[_0xc4df('0x52')](_0x1d1661);}})[_0xc4df('0x2f')](function(_0x5d0350){if(_0x5d0350){return _0x5d0350?{'count':_0x4ee438,'rows':_0x5d0350}:null;}})['then'](respondWithResult(_0x555380,null))[_0xc4df('0x4e')](handleError(_0x555380,null));};exports['addConfiguration']=function(_0x3b22ff,_0x1a28c7,_0x4c50f5){if(_0x3b22ff[_0xc4df('0x50')]['id']){delete _0x3b22ff[_0xc4df('0x50')]['id'];}return db[_0xc4df('0x35')][_0xc4df('0x55')]({'where':{'id':_0x3b22ff[_0xc4df('0x51')]['id']}})[_0xc4df('0x2f')](handleEntityNotFound(_0x1a28c7,null))['then'](function(_0x2146d0){if(_0x2146d0){_0x3b22ff[_0xc4df('0x50')]['AccountId']=_0x2146d0['id'];_0x3b22ff[_0xc4df('0x50')][_0xc4df('0x56')]=integrations[_0xc4df('0x57')](_0x3b22ff[_0xc4df('0x50')][_0xc4df('0x58')],_0x3b22ff[_0xc4df('0x50')]['type']);_0x3b22ff[_0xc4df('0x50')][_0xc4df('0x59')]=integrations['getDescriptions'](_0x3b22ff[_0xc4df('0x50')][_0xc4df('0x58')],_0x3b22ff['body'][_0xc4df('0x5a')]);return db[_0xc4df('0x53')][_0xc4df('0x4f')](_0x3b22ff[_0xc4df('0x50')],{'include':[{'model':db['Dynamics365Field'],'as':_0xc4df('0x56')},{'model':db['Dynamics365Field'],'as':_0xc4df('0x59')}]});}return null;})[_0xc4df('0x2f')](respondWithResult(_0x1a28c7,null))['catch'](handleError(_0x1a28c7,null));};exports[_0xc4df('0x5b')]=function(_0x2422ec,_0x296de3,_0x23e32d){var _0x395835=_0x2422ec['query']['ticketType'];var _0x41e5ce=_0x395835===_0xc4df('0x5c')?_0xc4df('0x5d'):_0xc4df('0x5e');var _0x960969='';var _0x118456='';var _0x15a324='';var _0x59ae7d='';var _0x1218df='';var _0x1fdfac='';var _0x233a66='';var _0x253fea='';var _0x50f054=['title',_0xc4df('0x5f'),_0xc4df('0x60'),_0xc4df('0x61'),'caseorigincode',_0xc4df('0x62'),_0xc4df('0x63'),'regardingobjectid',_0xc4df('0x64'),_0xc4df('0x65')];var _0x397e2a=['accountidname',_0xc4df('0x66'),_0xc4df('0x67'),'billedserviceunits',_0xc4df('0x68'),_0xc4df('0x69'),_0xc4df('0x6a'),_0xc4df('0x6b'),'createdbyexternalpartyname',_0xc4df('0x6c'),'createdbyname',_0xc4df('0x6d'),_0xc4df('0x6e'),_0xc4df('0x6f'),_0xc4df('0x70'),_0xc4df('0x71'),_0xc4df('0x72'),'customeridyominame',_0xc4df('0x73'),_0xc4df('0x74'),_0xc4df('0x75'),_0xc4df('0x76'),_0xc4df('0x77'),_0xc4df('0x78'),_0xc4df('0x79'),'followupby',_0xc4df('0x7a'),_0xc4df('0x7b'),_0xc4df('0x7c'),_0xc4df('0x7d'),_0xc4df('0x7e'),'modifiedbyexternalpartyname',_0xc4df('0x7f'),_0xc4df('0x80'),_0xc4df('0x81'),_0xc4df('0x82'),'modifiedonbehalfbyname',_0xc4df('0x83'),_0xc4df('0x84'),_0xc4df('0x85'),'numberofchildincidents',_0xc4df('0x86'),_0xc4df('0x87'),'owneridname',_0xc4df('0x88'),_0xc4df('0x89'),_0xc4df('0x8a'),'primarycontactidname','primarycontactidyominame',_0xc4df('0x8b'),_0xc4df('0x8c'),_0xc4df('0x8d'),'resolveby','resolvebykpiidname',_0xc4df('0x8e'),'responsiblecontactidname','responsiblecontactidyominame',_0xc4df('0x8f'),_0xc4df('0x90'),_0xc4df('0x91'),_0xc4df('0x92'),_0xc4df('0x93'),_0xc4df('0x94'),'subjectidname',_0xc4df('0x95'),'timezoneruleversionnumber',_0xc4df('0x96'),_0xc4df('0x97'),_0xc4df('0x98'),_0xc4df('0x99')];var _0x1c7b81=_0x50f054[_0xc4df('0x9a')](_0x397e2a);return db[_0xc4df('0x35')][_0xc4df('0x55')]({'where':{'id':_0x2422ec[_0xc4df('0x51')]['id']},'attributes':['id',_0xc4df('0x9b'),_0xc4df('0x9c'),'remoteUri',_0xc4df('0x9d'),'clientId',_0xc4df('0x9e')]})[_0xc4df('0x2f')](handleEntityNotFound(_0x296de3,null))['then'](function(_0x49eb65){if(_0x49eb65){_0x253fea=_0x49eb65[_0xc4df('0x9f')];var _0x578195=_0x253fea['slice'](-0x1);if(_0x578195==='/'){_0x253fea=_0x253fea[_0xc4df('0xa0')](0x0,_0x253fea[_0xc4df('0xa1')](_0x578195));}_0x233a66=util['format']('%s/api/data/v9.0/',_0x253fea);var _0x5d5202={'method':_0xc4df('0xa2'),'uri':'https://login.microsoftonline.com/'+_0x49eb65[_0xc4df('0x9d')]+_0xc4df('0xa3'),'form':{'client_id':_0x49eb65[_0xc4df('0xa4')],'resource':_0x253fea,'username':_0x49eb65[_0xc4df('0x9b')],'password':_0x49eb65[_0xc4df('0x9c')],'grant_type':_0xc4df('0x9c'),'client_secret':_0x49eb65['clientSecret']},'json':!![]};return rp(_0x5d5202);}})['then'](function(_0x5e9d04){_0x1fdfac=_0x5e9d04[_0xc4df('0xa5')];var _0x301605={'method':_0xc4df('0xa6'),'uri':encodeURI(_0x233a66+_0xc4df('0xa7')+_0x41e5ce+'\x27'),'headers':{'Authorization':_0xc4df('0xa8')+_0x1fdfac,'If-None-Match':null,'OData-Version':_0xc4df('0xa9')},'json':!![]};return rp(_0x301605);})[_0xc4df('0x2f')](function(_0x28d6f0){var _0x1e46ca=_0x28d6f0[_0xc4df('0xaa')][0x0];var _0x5f0144=_0x1e46ca['MetadataId'];var _0x50bddd={'method':_0xc4df('0xa6'),'uri':_0x233a66+_0xc4df('0xab')+_0x5f0144+_0xc4df('0xac'),'headers':{'Authorization':_0xc4df('0xa8')+_0x1fdfac,'If-None-Match':null,'OData-Version':_0xc4df('0xa9')},'json':!![]};return rp(_0x50bddd);})[_0xc4df('0x2f')](function(_0x18d3e2){_0x960969=_0x18d3e2;_0x118456=_0x960969[_0xc4df('0xad')];_0x118456=_[_0xc4df('0xae')](_0x118456,function(_0x59aaf0){return!_0x1c7b81[_0xc4df('0xaf')](_0x59aaf0[_0xc4df('0xb0')]);});var _0x2e76cb=[];var _0x72c99=[];_0x118456[_0xc4df('0xb1')](function(_0x4e3b1f){if(_0x4e3b1f[_0xc4df('0xb2')]){var _0x2f5aab=_0x4e3b1f['@odata.type'][_0xc4df('0xa0')](_0x4e3b1f[_0xc4df('0xb2')][_0xc4df('0xa1')]('.')+0x1);if(_0x2f5aab===_0xc4df('0xb3')){_0x2e76cb[_0xc4df('0xb4')](getSelectList(_0x233a66,_0x395835,_0x72c99,_0x960969[_0xc4df('0xb5')],_0x4e3b1f[_0xc4df('0xb5')],_0x1fdfac));}}});return Promise['all'](_0x2e76cb);})[_0xc4df('0x2f')](function(_0x25cd82){_0x15a324=_0x25cd82[0x0];var _0x1e6dc8=[];var _0x58c0a9=[];_0x118456['forEach'](function(_0x2af758){if(!_[_0xc4df('0xb6')](_0x2af758['@odata.type'])){var _0x1c1128=_0x2af758['@odata.type'][_0xc4df('0xa0')](_0x2af758['@odata.type'][_0xc4df('0xa1')]('.')+0x1);if(_0x1c1128===_0xc4df('0xb7')){_0x1e6dc8[_0xc4df('0xb4')](getBooleanList(_0x233a66,_0x395835,_0x58c0a9,_0x960969[_0xc4df('0xb5')],_0x2af758[_0xc4df('0xb5')],_0x1fdfac));}}});return Promise[_0xc4df('0xb8')](_0x1e6dc8);})[_0xc4df('0x2f')](function(_0x58ae3f){_0x59ae7d=_0x58ae3f[0x0];var _0xde4809=[];var _0x5e270f=[];_0x118456[_0xc4df('0xb1')](function(_0x2d87ef){if(_0x2d87ef[_0xc4df('0xb2')]){var _0x4096b5=_0x2d87ef['@odata.type'][_0xc4df('0xa0')](_0x2d87ef[_0xc4df('0xb2')][_0xc4df('0xa1')]('.')+0x1);if(_0x4096b5==='StringAttributeMetadata'||_0x4096b5===_0xc4df('0xb9')||_0x4096b5===_0xc4df('0xba')||_0x4096b5===_0xc4df('0xbb')||_0x4096b5===_0xc4df('0xbc')||_0x4096b5===_0xc4df('0xbd')||_0x4096b5==='StatusAttributeMetadata'||_0x4096b5==='EntityNameAttributeMetadata'||_0x4096b5===_0xc4df('0xbe')||_0x4096b5==='DecimalAttributeMetadata'){_0xde4809['push'](getInputList(_0x233a66,_0x395835,_0x4096b5,_0x5e270f,_0x960969[_0xc4df('0xb5')],_0x2d87ef[_0xc4df('0xb5')],_0x1fdfac));}}});return Promise[_0xc4df('0xb8')](_0xde4809);})[_0xc4df('0x2f')](function(_0x35a547){_0x1218df=_0x35a547[0x0];var _0x4b2b41=_0x15a324[_0xc4df('0x9a')](_0x59ae7d)['concat'](_0x1218df);var _0x579a3a={'count':_0x4b2b41['length'],'rows':_0x4b2b41};return _0x579a3a;})[_0xc4df('0x2f')](respondWithResult(_0x296de3,null))[_0xc4df('0x4e')](function(_0x23077b){console[_0xc4df('0xbf')](_0xc4df('0xc0')+_0x23077b);var _0x450261=_0x2422ec[_0xc4df('0x38')][_0xc4df('0x1a')]?0x1f4:_0x23077b['statusCode']||0x1f4;logger['error'](_0x23077b[_0xc4df('0x31')]);delete _0x23077b[_0xc4df('0x32')];if(_0x450261===0x191){_0x450261=0x190;}_0x296de3[_0xc4df('0x26')](_0x450261)[_0xc4df('0x33')](_0x2422ec[_0xc4df('0x38')]['test']?{'message':_0xc4df('0xc1'),'statusCode':_0x23077b['statusCode']}:_0x23077b);});};function getSelectList(_0x2c892a,_0x5ef9e3,_0x55d604,_0x3fff65,_0x8b6e29,_0x2c277d){var _0x47b742={'method':_0xc4df('0xa6'),'uri':_0x2c892a+'EntityDefinitions('+_0x3fff65+_0xc4df('0xc2')+_0x8b6e29+_0xc4df('0xc3')+_0xc4df('0xc4'),'headers':{'Authorization':_0xc4df('0xa8')+_0x2c277d,'If-None-Match':null,'OData-Version':_0xc4df('0xa9')},'json':!![]};return rp(_0x47b742)[_0xc4df('0x2f')](function(_0x36b808){var _0x5cfef=[];var _0x3e99e8=_0x36b808[_0xc4df('0xc5')][_0xc4df('0xc6')];_0x3e99e8[_0xc4df('0xb1')](function(_0x143345){_0x5cfef[_0xc4df('0xb4')]({'name':_0x143345[_0xc4df('0xc7')][_0xc4df('0xc8')]['Label'],'value':String(_0x143345[_0xc4df('0xc9')])});});var _0x476c96={'id':_0x5ef9e3+'_'+_0x36b808[_0xc4df('0xb0')],'name':_0x36b808['DisplayName'][_0xc4df('0xc8')]['Label'],'custom':![],'options':_0x5cfef};_0x55d604[_0xc4df('0xb4')](_0x476c96);return _0x55d604;});}function getBooleanList(_0x4564ef,_0x91dd1f,_0x243073,_0x311a32,_0x169ddf,_0x381dff){var _0x3202ae={'method':_0xc4df('0xa6'),'uri':_0x4564ef+_0xc4df('0xab')+_0x311a32+_0xc4df('0xc2')+_0x169ddf+_0xc4df('0xca'),'headers':{'Authorization':_0xc4df('0xa8')+_0x381dff,'If-None-Match':null,'OData-Version':_0xc4df('0xa9')},'json':!![]};return rp(_0x3202ae)[_0xc4df('0x2f')](function(_0x25dc90){var _0x4f8153=[];_0x4f8153[_0xc4df('0xb4')]({'name':_0x25dc90['OptionSet']['TrueOption'][_0xc4df('0xc7')]['UserLocalizedLabel'][_0xc4df('0xc7')],'value':'true'},{'name':_0x25dc90[_0xc4df('0xc5')]['FalseOption'][_0xc4df('0xc7')]['UserLocalizedLabel'][_0xc4df('0xc7')],'value':_0xc4df('0xcb')});var _0x57d04f={'id':_0x91dd1f+'_'+_0x25dc90[_0xc4df('0xb0')],'name':_0x25dc90['DisplayName']['UserLocalizedLabel'][_0xc4df('0xc7')],'custom':![],'options':_0x4f8153};_0x243073[_0xc4df('0xb4')](_0x57d04f);return _0x243073;});}function getInputList(_0x475d80,_0x33a44a,_0x5165bb,_0x2a1dc9,_0x7d5b8e,_0x3ae22c,_0x2e7a6e){var _0x17ac19={'method':'GET','uri':_0x475d80+'EntityDefinitions('+_0x7d5b8e+')/Attributes('+_0x3ae22c+_0xc4df('0xcc')+_0x5165bb+_0xc4df('0xcd'),'headers':{'Authorization':_0xc4df('0xa8')+_0x2e7a6e,'If-None-Match':null,'OData-Version':_0xc4df('0xa9')},'json':!![]};return rp(_0x17ac19)[_0xc4df('0x2f')](function(_0x28bcec){var _0x42b8e1={'id':_0x33a44a+'_'+_0x28bcec[_0xc4df('0xb0')],'name':_0x28bcec[_0xc4df('0xce')][_0xc4df('0xc8')]?_0x28bcec[_0xc4df('0xce')]['UserLocalizedLabel'][_0xc4df('0xc7')]:_0x28bcec['LogicalName'],'custom':![],'options':[]};_0x2a1dc9['push'](_0x42b8e1);return _0x2a1dc9;});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js
index d81e142..dd8c67e 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.model.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdacd=['moment','request-promise','path','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','int_dynamics365_accounts','lodash','../../config/logger','api'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0xdacd,0xe1));var _0xddac=function(_0x4ffdcc,_0x4e7fec){_0x4ffdcc=_0x4ffdcc-0x0;var _0x4e66c8=_0xdacd[_0x4ffdcc];return _0x4e66c8;};'use strict';var _=require(_0xddac('0x0'));var util=require('util');var logger=require(_0xddac('0x1'))(_0xddac('0x2'));var moment=require(_0xddac('0x3'));var BPromise=require('bluebird');var rp=require(_0xddac('0x4'));var fs=require('fs');var path=require(_0xddac('0x5'));var rimraf=require('rimraf');var config=require(_0xddac('0x6'));var attributes=require(_0xddac('0x7'));var integrations=require(_0xddac('0x8'));module[_0xddac('0x9')]=function(_0x40499f,_0x40c0cc){return _0x40499f[_0xddac('0xa')]('Dynamics365Account',attributes,{'tableName':_0xddac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf475=['rimraf','../../config/environment','./intDynamics365Account.attributes','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xf475,0x15a));var _0x5f47=function(_0x26fc9e,_0x3c879a){_0x26fc9e=_0x26fc9e-0x0;var _0x4e8458=_0xf475[_0x26fc9e];return _0x4e8458;};'use strict';var _=require(_0x5f47('0x0'));var util=require(_0x5f47('0x1'));var logger=require(_0x5f47('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5f47('0x3'));var rp=require(_0x5f47('0x4'));var fs=require('fs');var path=require(_0x5f47('0x5'));var rimraf=require(_0x5f47('0x6'));var config=require(_0x5f47('0x7'));var attributes=require(_0x5f47('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x19e260,_0x14a390){return _0x19e260['define'](_0x5f47('0x9'),attributes,{'tableName':_0x5f47('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js
index aca409b..98f38a6 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.rpc.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55aa=['Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','result','catch','Dynamics365Account','options','raw','where','attributes','include','model','map','GetDynamics365Account','ShowDynamics365Account','find','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x507310,_0x127555){var _0x5340ea=function(_0x4160e3){while(--_0x4160e3){_0x507310['push'](_0x507310['shift']());}};_0x5340ea(++_0x127555);}(_0x55aa,0xd2));var _0xa55a=function(_0x43c9fc,_0x41a681){_0x43c9fc=_0x43c9fc-0x0;var _0x253674=_0x55aa[_0x43c9fc];return _0x253674;};'use strict';var _=require('lodash');var util=require(_0xa55a('0x0'));var moment=require('moment');var BPromise=require(_0xa55a('0x1'));var rs=require(_0xa55a('0x2'));var fs=require('fs');var Redis=require(_0xa55a('0x3'));var db=require(_0xa55a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa55a('0x5'));var config=require(_0xa55a('0x6'));var jayson=require(_0xa55a('0x7'));var client=jayson['client'][_0xa55a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26bb1a,_0x1ce896,_0x52b9c9){return new BPromise(function(_0x1b6379,_0x4ff5f4){return client[_0xa55a('0x9')](_0x26bb1a,_0x52b9c9)[_0xa55a('0xa')](function(_0x3d2f0c){logger[_0xa55a('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x1ce896,_0xa55a('0xc'));logger[_0xa55a('0xd')](_0xa55a('0xe'),_0x1ce896,_0xa55a('0xc'),JSON[_0xa55a('0xf')](_0x3d2f0c));if(_0x3d2f0c[_0xa55a('0x10')]){if(_0x3d2f0c['error']['code']===0x1f4){logger['error'](_0xa55a('0x11'),_0x1ce896,_0x3d2f0c[_0xa55a('0x10')][_0xa55a('0x12')]);return _0x4ff5f4(_0x3d2f0c[_0xa55a('0x10')]['message']);}logger['error'](_0xa55a('0x11'),_0x1ce896,_0x3d2f0c['error'][_0xa55a('0x12')]);return _0x1b6379(_0x3d2f0c['error'][_0xa55a('0x12')]);}else{logger['info'](_0xa55a('0x11'),_0x1ce896,_0xa55a('0xc'));_0x1b6379(_0x3d2f0c[_0xa55a('0x13')][_0xa55a('0x12')]);}})[_0xa55a('0x14')](function(_0x176620){logger[_0xa55a('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x1ce896,_0x176620);_0x4ff5f4(_0x176620);});});}exports['GetDynamics365Account']=function(_0x2bf2ea){var _0x41f125=this;return new Promise(function(_0x4eb289,_0x2aa8ee){return db[_0xa55a('0x15')]['findAll']({'raw':_0x2bf2ea['options']?_0x2bf2ea[_0xa55a('0x16')][_0xa55a('0x17')]===undefined?!![]:![]:!![],'where':_0x2bf2ea[_0xa55a('0x16')]?_0x2bf2ea[_0xa55a('0x16')][_0xa55a('0x18')]||null:null,'attributes':_0x2bf2ea[_0xa55a('0x16')]?_0x2bf2ea[_0xa55a('0x16')][_0xa55a('0x19')]||null:null,'limit':_0x2bf2ea['options']?_0x2bf2ea[_0xa55a('0x16')]['limit']||null:null,'include':_0x2bf2ea[_0xa55a('0x16')]?_0x2bf2ea['options'][_0xa55a('0x1a')]?_['map'](_0x2bf2ea[_0xa55a('0x16')][_0xa55a('0x1a')],function(_0x1fcfd3){return{'model':db[_0x1fcfd3[_0xa55a('0x1b')]],'as':_0x1fcfd3['as'],'attributes':_0x1fcfd3[_0xa55a('0x19')],'include':_0x1fcfd3[_0xa55a('0x1a')]?_[_0xa55a('0x1c')](_0x1fcfd3[_0xa55a('0x1a')],function(_0x3870c5){return{'model':db[_0x3870c5[_0xa55a('0x1b')]],'as':_0x3870c5['as'],'attributes':_0x3870c5['attributes'],'include':_0x3870c5[_0xa55a('0x1a')]?_[_0xa55a('0x1c')](_0x3870c5[_0xa55a('0x1a')],function(_0x10fed1){return{'model':db[_0x10fed1[_0xa55a('0x1b')]],'as':_0x10fed1['as'],'attributes':_0x10fed1['attributes']};}):[]};}):[]};}):[]:[]})[_0xa55a('0xa')](function(_0xff5954){logger[_0xa55a('0xb')](_0xa55a('0x1d'),_0x2bf2ea);logger[_0xa55a('0xd')](_0xa55a('0x1d'),_0x2bf2ea,JSON[_0xa55a('0xf')](_0xff5954));_0x4eb289(_0xff5954);})[_0xa55a('0x14')](function(_0x15b417){logger[_0xa55a('0x10')](_0xa55a('0x1d'),_0x15b417[_0xa55a('0x12')],_0x2bf2ea);_0x2aa8ee(_0x41f125[_0xa55a('0x10')](0x1f4,_0x15b417[_0xa55a('0x12')]));});});};exports[_0xa55a('0x1e')]=function(_0x560705){var _0x38ee21=this;return new Promise(function(_0x4ebd6d,_0x30dda5){return db[_0xa55a('0x15')][_0xa55a('0x1f')]({'raw':_0x560705[_0xa55a('0x16')]?_0x560705[_0xa55a('0x16')][_0xa55a('0x17')]===undefined?!![]:![]:!![],'where':_0x560705[_0xa55a('0x16')]?_0x560705[_0xa55a('0x16')][_0xa55a('0x18')]||null:null,'attributes':_0x560705[_0xa55a('0x16')]?_0x560705[_0xa55a('0x16')]['attributes']||null:null,'include':_0x560705['options']?_0x560705[_0xa55a('0x16')]['include']?_[_0xa55a('0x1c')](_0x560705[_0xa55a('0x16')][_0xa55a('0x1a')],function(_0x520898){return{'model':db[_0x520898[_0xa55a('0x1b')]],'as':_0x520898['as'],'attributes':_0x520898[_0xa55a('0x19')],'include':_0x520898[_0xa55a('0x1a')]?_[_0xa55a('0x1c')](_0x520898['include'],function(_0x56c022){return{'model':db[_0x56c022['model']],'as':_0x56c022['as'],'attributes':_0x56c022[_0xa55a('0x19')],'include':_0x56c022[_0xa55a('0x1a')]?_['map'](_0x56c022[_0xa55a('0x1a')],function(_0x3acedf){return{'model':db[_0x3acedf[_0xa55a('0x1b')]],'as':_0x3acedf['as'],'attributes':_0x3acedf[_0xa55a('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa55a('0xa')](function(_0x27d10f){logger['info'](_0xa55a('0x1e'),_0x560705);logger[_0xa55a('0xd')](_0xa55a('0x1e'),_0x560705,JSON[_0xa55a('0xf')](_0x27d10f));_0x4ebd6d(_0x27d10f);})[_0xa55a('0x14')](function(_0x59584e){logger['error']('ShowDynamics365Account',_0x59584e[_0xa55a('0x12')],_0x560705);_0x30dda5(_0x38ee21[_0xa55a('0x10')](0x1f4,_0x59584e[_0xa55a('0x12')]));});});};
\ No newline at end of file
+var _0xa1ce=['attributes','limit','map','include','model','GetDynamics365Account','ShowDynamics365Account','find','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','catch','Dynamics365Account','findAll','options','where'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0xa1ce,0x1b6));var _0xea1c=function(_0x255889,_0x31e354){_0x255889=_0x255889-0x0;var _0x4ca582=_0xa1ce[_0x255889];return _0x4ca582;};'use strict';var _=require(_0xea1c('0x0'));var util=require(_0xea1c('0x1'));var moment=require(_0xea1c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea1c('0x3'));var db=require(_0xea1c('0x4'))['db'];var utils=require(_0xea1c('0x5'));var logger=require(_0xea1c('0x6'))(_0xea1c('0x7'));var config=require(_0xea1c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xea1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x378115,_0x379842,_0x107ba1){return new BPromise(function(_0x31a8a5,_0x5ab9df){return client[_0xea1c('0xa')](_0x378115,_0x107ba1)[_0xea1c('0xb')](function(_0x260d4e){logger[_0xea1c('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x379842,_0xea1c('0xd'));logger[_0xea1c('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x379842,_0xea1c('0xd'),JSON[_0xea1c('0xf')](_0x260d4e));if(_0x260d4e[_0xea1c('0x10')]){if(_0x260d4e['error']['code']===0x1f4){logger[_0xea1c('0x10')](_0xea1c('0x11'),_0x379842,_0x260d4e[_0xea1c('0x10')][_0xea1c('0x12')]);return _0x5ab9df(_0x260d4e[_0xea1c('0x10')]['message']);}logger[_0xea1c('0x10')](_0xea1c('0x11'),_0x379842,_0x260d4e['error'][_0xea1c('0x12')]);return _0x31a8a5(_0x260d4e[_0xea1c('0x10')][_0xea1c('0x12')]);}else{logger['info'](_0xea1c('0x11'),_0x379842,_0xea1c('0xd'));_0x31a8a5(_0x260d4e['result'][_0xea1c('0x12')]);}})[_0xea1c('0x13')](function(_0x2242d1){logger[_0xea1c('0x10')](_0xea1c('0x11'),_0x379842,_0x2242d1);_0x5ab9df(_0x2242d1);});});}exports['GetDynamics365Account']=function(_0x3523cb){var _0x43e759=this;return new Promise(function(_0x2d993a,_0x2f9d15){return db[_0xea1c('0x14')][_0xea1c('0x15')]({'raw':_0x3523cb[_0xea1c('0x16')]?_0x3523cb['options']['raw']===undefined?!![]:![]:!![],'where':_0x3523cb[_0xea1c('0x16')]?_0x3523cb[_0xea1c('0x16')][_0xea1c('0x17')]||null:null,'attributes':_0x3523cb[_0xea1c('0x16')]?_0x3523cb[_0xea1c('0x16')][_0xea1c('0x18')]||null:null,'limit':_0x3523cb[_0xea1c('0x16')]?_0x3523cb[_0xea1c('0x16')][_0xea1c('0x19')]||null:null,'include':_0x3523cb[_0xea1c('0x16')]?_0x3523cb[_0xea1c('0x16')]['include']?_[_0xea1c('0x1a')](_0x3523cb[_0xea1c('0x16')][_0xea1c('0x1b')],function(_0x213740){return{'model':db[_0x213740[_0xea1c('0x1c')]],'as':_0x213740['as'],'attributes':_0x213740[_0xea1c('0x18')],'include':_0x213740[_0xea1c('0x1b')]?_[_0xea1c('0x1a')](_0x213740[_0xea1c('0x1b')],function(_0x494cac){return{'model':db[_0x494cac['model']],'as':_0x494cac['as'],'attributes':_0x494cac[_0xea1c('0x18')],'include':_0x494cac['include']?_['map'](_0x494cac[_0xea1c('0x1b')],function(_0x54858f){return{'model':db[_0x54858f['model']],'as':_0x54858f['as'],'attributes':_0x54858f['attributes']};}):[]};}):[]};}):[]:[]})[_0xea1c('0xb')](function(_0x2a1ff3){logger[_0xea1c('0xc')](_0xea1c('0x1d'),_0x3523cb);logger['debug'](_0xea1c('0x1d'),_0x3523cb,JSON['stringify'](_0x2a1ff3));_0x2d993a(_0x2a1ff3);})[_0xea1c('0x13')](function(_0x55cf38){logger['error'](_0xea1c('0x1d'),_0x55cf38['message'],_0x3523cb);_0x2f9d15(_0x43e759[_0xea1c('0x10')](0x1f4,_0x55cf38['message']));});});};exports[_0xea1c('0x1e')]=function(_0x593b07){var _0x5a0782=this;return new Promise(function(_0x19bbb6,_0x44ab33){return db['Dynamics365Account'][_0xea1c('0x1f')]({'raw':_0x593b07[_0xea1c('0x16')]?_0x593b07[_0xea1c('0x16')][_0xea1c('0x20')]===undefined?!![]:![]:!![],'where':_0x593b07[_0xea1c('0x16')]?_0x593b07['options'][_0xea1c('0x17')]||null:null,'attributes':_0x593b07[_0xea1c('0x16')]?_0x593b07[_0xea1c('0x16')][_0xea1c('0x18')]||null:null,'include':_0x593b07[_0xea1c('0x16')]?_0x593b07['options'][_0xea1c('0x1b')]?_[_0xea1c('0x1a')](_0x593b07[_0xea1c('0x16')][_0xea1c('0x1b')],function(_0x5b1467){return{'model':db[_0x5b1467[_0xea1c('0x1c')]],'as':_0x5b1467['as'],'attributes':_0x5b1467[_0xea1c('0x18')],'include':_0x5b1467['include']?_['map'](_0x5b1467[_0xea1c('0x1b')],function(_0x2a3192){return{'model':db[_0x2a3192[_0xea1c('0x1c')]],'as':_0x2a3192['as'],'attributes':_0x2a3192[_0xea1c('0x18')],'include':_0x2a3192[_0xea1c('0x1b')]?_['map'](_0x2a3192[_0xea1c('0x1b')],function(_0x23be61){return{'model':db[_0x23be61[_0xea1c('0x1c')]],'as':_0x23be61['as'],'attributes':_0x23be61['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f6c29){logger[_0xea1c('0xc')](_0xea1c('0x1e'),_0x593b07);logger[_0xea1c('0xe')]('ShowDynamics365Account',_0x593b07,JSON[_0xea1c('0xf')](_0x5f6c29));_0x19bbb6(_0x5f6c29);})[_0xea1c('0x13')](function(_0x573e2f){logger[_0xea1c('0x10')](_0xea1c('0x1e'),_0x573e2f[_0xea1c('0x12')],_0x593b07);_0x44ab33(_0x5a0782[_0xea1c('0x10')](0x1f4,_0x573e2f[_0xea1c('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js
index e834dad..06993a0 100644
--- a/server/api/intDynamics365Configuration/index.js
+++ b/server/api/intDynamics365Configuration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f81=['util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id','/:id/fields','isAuthenticated','getFields','/:id/subjects','getDescriptions','post','create','put','update','destroy','exports'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x9f81,0x12c));var _0x19f8=function(_0xdcee45,_0x6231f1){_0xdcee45=_0xdcee45-0x0;var _0x1bb790=_0x9f81[_0xdcee45];return _0x1bb790;};'use strict';var multer=require('multer');var util=require(_0x19f8('0x0'));var path=require('path');var timeout=require(_0x19f8('0x1'));var express=require('express');var router=express[_0x19f8('0x2')]();var auth=require(_0x19f8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x19f8('0x4'));var controller=require(_0x19f8('0x5'));router[_0x19f8('0x6')]('/',auth['isAuthenticated'](),controller[_0x19f8('0x7')]);router[_0x19f8('0x6')](_0x19f8('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x19f8('0x6')](_0x19f8('0x9'),auth[_0x19f8('0xa')](),controller[_0x19f8('0xb')]);router[_0x19f8('0x6')](_0x19f8('0xc'),auth[_0x19f8('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x19f8('0xa')](),controller[_0x19f8('0xd')]);router[_0x19f8('0xe')]('/',auth[_0x19f8('0xa')](),controller[_0x19f8('0xf')]);router[_0x19f8('0x10')](_0x19f8('0x8'),auth[_0x19f8('0xa')](),controller[_0x19f8('0x11')]);router['delete']('/:id',auth[_0x19f8('0xa')](),controller[_0x19f8('0x12')]);module[_0x19f8('0x13')]=router;
\ No newline at end of file
+var _0xa303=['destroy','util','connect-timeout','express','Router','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete'];(function(_0x571024,_0x576664){var _0x5e3915=function(_0x28f94c){while(--_0x28f94c){_0x571024['push'](_0x571024['shift']());}};_0x5e3915(++_0x576664);}(_0xa303,0x177));var _0x3a30=function(_0x1f94fd,_0x8bde8e){_0x1f94fd=_0x1f94fd-0x0;var _0x3744b2=_0xa303[_0x1f94fd];return _0x3744b2;};'use strict';var multer=require('multer');var util=require(_0x3a30('0x0'));var path=require('path');var timeout=require(_0x3a30('0x1'));var express=require(_0x3a30('0x2'));var router=express[_0x3a30('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3a30('0x4'));var controller=require(_0x3a30('0x5'));router[_0x3a30('0x6')]('/',auth[_0x3a30('0x7')](),controller[_0x3a30('0x8')]);router[_0x3a30('0x6')](_0x3a30('0x9'),auth[_0x3a30('0x7')](),controller[_0x3a30('0xa')]);router['get']('/:id/fields',auth[_0x3a30('0x7')](),controller[_0x3a30('0xb')]);router['get'](_0x3a30('0xc'),auth[_0x3a30('0x7')](),controller[_0x3a30('0xd')]);router[_0x3a30('0x6')](_0x3a30('0xe'),auth[_0x3a30('0x7')](),controller[_0x3a30('0xf')]);router[_0x3a30('0x10')]('/',auth[_0x3a30('0x7')](),controller[_0x3a30('0x11')]);router[_0x3a30('0x12')](_0x3a30('0x9'),auth['isAuthenticated'](),controller[_0x3a30('0x13')]);router[_0x3a30('0x14')](_0x3a30('0x9'),auth[_0x3a30('0x7')](),controller[_0x3a30('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
index 83f2b58..67093e3 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef5c=['STRING','ENUM','incident','phonecall','sequelize','exports'];(function(_0x1830a9,_0x1583bd){var _0x2b6166=function(_0x4cf0e6){while(--_0x4cf0e6){_0x1830a9['push'](_0x1830a9['shift']());}};_0x2b6166(++_0x1583bd);}(_0xef5c,0x1ea));var _0xcef5=function(_0x549a2b,_0x14a025){_0x549a2b=_0x549a2b-0x0;var _0x26e876=_0xef5c[_0x549a2b];return _0x26e876;};'use strict';var Sequelize=require(_0xcef5('0x0'));module[_0xcef5('0x1')]={'name':{'type':Sequelize[_0xcef5('0x2')]},'description':{'type':Sequelize[_0xcef5('0x2')]},'ticketType':{'type':Sequelize[_0xcef5('0x3')](_0xcef5('0x4'),_0xcef5('0x5')),'defaultValue':_0xcef5('0x4')}};
\ No newline at end of file
+var _0x8ade=['sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x5be652,_0x129d44){var _0x3c89da=function(_0x2f01ac){while(--_0x2f01ac){_0x5be652['push'](_0x5be652['shift']());}};_0x3c89da(++_0x129d44);}(_0x8ade,0x84));var _0xe8ad=function(_0x460c81,_0x42c0a8){_0x460c81=_0x460c81-0x0;var _0x54cbd5=_0x8ade[_0x460c81];return _0x54cbd5;};'use strict';var Sequelize=require(_0xe8ad('0x0'));module[_0xe8ad('0x1')]={'name':{'type':Sequelize[_0xe8ad('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xe8ad('0x3')](_0xe8ad('0x4'),_0xe8ad('0x5')),'defaultValue':_0xe8ad('0x4')}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
index 8583a3d..8daa7be 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f4b=['api','../../config/utils','../../config/environment','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','count','offset','set','json','apply','reject','save','update','destroy','name','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','Dynamics365Configuration','include','findAll','rows','show','find','body','params','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x35b99a,_0x12f6c3){var _0x72bf53=function(_0x30bfa3){while(--_0x30bfa3){_0x35b99a['push'](_0x35b99a['shift']());}};_0x72bf53(++_0x12f6c3);}(_0x5f4b,0x13e));var _0xb5f4=function(_0x217550,_0x80b968){_0x217550=_0x217550-0x0;var _0x5ba928=_0x5f4b[_0x217550];return _0x5ba928;};'use strict';var pdf=require(_0xb5f4('0x0'));var emlformat=require(_0xb5f4('0x1'));var rimraf=require(_0xb5f4('0x2'));var zipdir=require(_0xb5f4('0x3'));var jsonpatch=require(_0xb5f4('0x4'));var rp=require(_0xb5f4('0x5'));var moment=require(_0xb5f4('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb5f4('0x7'));var util=require(_0xb5f4('0x8'));var path=require(_0xb5f4('0x9'));var sox=require(_0xb5f4('0xa'));var csv=require(_0xb5f4('0xb'));var ejs=require(_0xb5f4('0xc'));var fs=require('fs');var _=require(_0xb5f4('0xd'));var squel=require(_0xb5f4('0xe'));var crypto=require(_0xb5f4('0xf'));var jsforce=require(_0xb5f4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb5f4('0xb'));var querystring=require(_0xb5f4('0x11'));var Papa=require(_0xb5f4('0x12'));var Redis=require('ioredis');var authService=require(_0xb5f4('0x13'));var qs=require(_0xb5f4('0x14'));var hardwareService=require(_0xb5f4('0x15'));var logger=require('../../config/logger')(_0xb5f4('0x16'));var utils=require(_0xb5f4('0x17'));var config=require(_0xb5f4('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb5f4('0x19'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3c5ffc,_0x3cea5c,_0x3deed1){if(_0x3deed1){var _0xcac048=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcac048[_0xb5f4('0x1a')](_0x3cea5c)){return _0x3c5ffc;}else{throw new Error(_0xb5f4('0x1b'));}}else{return _0x3c5ffc;}}function respondWithRpcPromise(_0x5f0ea2,_0x1d00fc,_0x136261,_0x4be7e7){return new BPromise(function(_0x14cd71,_0x2f8d12){var _0x547aed=_0x4be7e7||client;return _0x547aed['request'](_0x5f0ea2,_0x136261)[_0xb5f4('0x1c')](function(_0x1c576d){logger['info'](_0xb5f4('0x1d'),_0x1d00fc,'request\x20sent');logger['debug'](_0xb5f4('0x1e'),_0x1d00fc,_0xb5f4('0x1f'),JSON[_0xb5f4('0x20')](_0x1c576d));if(_0x1c576d[_0xb5f4('0x21')]){if(_0x1c576d[_0xb5f4('0x21')]['code']===0x1f4){logger[_0xb5f4('0x21')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1d00fc,_0x1c576d[_0xb5f4('0x21')]['message']);return _0x2f8d12(_0x1c576d[_0xb5f4('0x21')][_0xb5f4('0x22')]);}logger[_0xb5f4('0x21')](_0xb5f4('0x1d'),_0x1d00fc,_0x1c576d[_0xb5f4('0x21')]['message']);return _0x14cd71(_0x1c576d['error'][_0xb5f4('0x22')]);}else{logger[_0xb5f4('0x23')](_0xb5f4('0x1d'),_0x1d00fc,_0xb5f4('0x1f'));_0x14cd71(_0x1c576d[_0xb5f4('0x24')][_0xb5f4('0x22')]);}})[_0xb5f4('0x25')](function(_0x4a1368){logger[_0xb5f4('0x21')](_0xb5f4('0x1d'),_0x1d00fc,_0x4a1368);_0x2f8d12(_0x4a1368);});});}function respondWithStatusCode(_0x1fc3bf,_0x574c77){_0x574c77=_0x574c77||0xcc;return function(_0x46f2bc){if(_0x46f2bc){return _0x1fc3bf[_0xb5f4('0x26')](_0x574c77);}return _0x1fc3bf['status'](_0x574c77)['end']();};}function respondWithResult(_0x436bb8,_0x383dd3){_0x383dd3=_0x383dd3||0xc8;return function(_0x34cad3){if(_0x34cad3){return _0x436bb8[_0xb5f4('0x27')](_0x383dd3)['json'](_0x34cad3);}};}function respondWithFilteredResult(_0x34e20c,_0x282278){return function(_0x46ef2a){if(_0x46ef2a){var _0x26484d=_0x46ef2a[_0xb5f4('0x28')],_0x53d225=_0x282278[_0xb5f4('0x29')],_0x1fe7b3=_0x282278['offset']+_0x282278['limit'],_0x24336c;if(_0x1fe7b3>=_0x26484d){_0x1fe7b3=_0x26484d;_0x24336c=0xc8;}else{_0x24336c=0xce;}_0x34e20c[_0xb5f4('0x27')](_0x24336c);return _0x34e20c[_0xb5f4('0x2a')]('Content-Range',_0x53d225+'-'+_0x1fe7b3+'/'+_0x26484d)[_0xb5f4('0x2b')](_0x46ef2a);}return null;};}function patchUpdates(_0x361f49){return function(_0x394499){try{jsonpatch[_0xb5f4('0x2c')](_0x394499,_0x361f49,!![]);}catch(_0x4c84e4){return BPromise[_0xb5f4('0x2d')](_0x4c84e4);}return _0x394499[_0xb5f4('0x2e')]();};}function saveUpdates(_0x20eb3e,_0x10ecf9){return function(_0xe2791e){if(_0xe2791e){return _0xe2791e[_0xb5f4('0x2f')](_0x20eb3e)['then'](function(_0x28daba){return _0x28daba;});}return null;};}function removeEntity(_0x3e1add,_0x50cec3){return function(_0x12bb88){if(_0x12bb88){return _0x12bb88[_0xb5f4('0x30')]()[_0xb5f4('0x1c')](function(){_0x3e1add[_0xb5f4('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x483193,_0x553fb2){return function(_0x303595){if(!_0x303595){_0x483193[_0xb5f4('0x26')](0x194);}return _0x303595;};}function handleError(_0x826e46,_0x2c2145){_0x2c2145=_0x2c2145||0x1f4;return function(_0x2d2eec){logger[_0xb5f4('0x21')](_0x2d2eec['stack']);if(_0x2d2eec[_0xb5f4('0x31')]){delete _0x2d2eec['name'];}_0x826e46['status'](_0x2c2145)['send'](_0x2d2eec);};}exports['index']=function(_0x9887c7,_0x5b4371){var _0x466727={},_0x4f271c={},_0x35b411={'count':0x0,'rows':[]};var _0x5b1a13=db['Dynamics365Configuration'][_0xb5f4('0x32')];_0x4f271c[_0xb5f4('0x33')]=_[_0xb5f4('0x34')](_0x5b1a13);_0x4f271c[_0xb5f4('0x35')]=_['keys'](_0x9887c7['query']);_0x4f271c[_0xb5f4('0x36')]=_['intersection'](_0x4f271c['model'],_0x4f271c['query']);_0x466727[_0xb5f4('0x37')]=_[_0xb5f4('0x38')](_0x4f271c[_0xb5f4('0x33')],qs['fields'](_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x39')]));_0x466727[_0xb5f4('0x37')]=_0x466727[_0xb5f4('0x37')][_0xb5f4('0x3a')]?_0x466727[_0xb5f4('0x37')]:_0x4f271c[_0xb5f4('0x33')];if(!_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x3b')](_0xb5f4('0x3c'))){_0x466727[_0xb5f4('0x3d')]=qs[_0xb5f4('0x3d')](_0x9887c7['query'][_0xb5f4('0x3d')]);_0x466727[_0xb5f4('0x29')]=qs['offset'](_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x29')]);}_0x466727[_0xb5f4('0x3e')]=qs[_0xb5f4('0x3f')](_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x3f')]);_0x466727[_0xb5f4('0x40')]=qs[_0xb5f4('0x36')](_[_0xb5f4('0x41')](_0x9887c7[_0xb5f4('0x35')],_0x4f271c[_0xb5f4('0x36')]));if(_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x42')]){_0x466727[_0xb5f4('0x40')]=_['merge'](_0x466727[_0xb5f4('0x40')],{'$or':_[_0xb5f4('0x43')](_0x5b1a13,function(_0x52a952){if(_0x52a952[_0xb5f4('0x44')]['key']!==_0xb5f4('0x45')){var _0x581a4a={};_0x581a4a[_0x52a952['field']]={'$like':'%'+_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x42')]+'%'};return _0x581a4a;}})});}_0x466727=_[_0xb5f4('0x46')]({},_0x466727,_0x9887c7[_0xb5f4('0x47')]);var _0x1cf66a={'where':_0x466727[_0xb5f4('0x40')]};return db[_0xb5f4('0x48')][_0xb5f4('0x28')](_0x1cf66a)['then'](function(_0x1f7cb5){_0x35b411[_0xb5f4('0x28')]=_0x1f7cb5;if(_0x9887c7[_0xb5f4('0x35')]['includeAll']){_0x466727[_0xb5f4('0x49')]=[{'all':!![]}];}return db[_0xb5f4('0x48')][_0xb5f4('0x4a')](_0x466727);})[_0xb5f4('0x1c')](function(_0x4a907a){_0x35b411[_0xb5f4('0x4b')]=_0x4a907a;return _0x35b411;})[_0xb5f4('0x1c')](respondWithFilteredResult(_0x5b4371,_0x466727))[_0xb5f4('0x25')](handleError(_0x5b4371,null));};exports[_0xb5f4('0x4c')]=function(_0x35dd5a,_0x3a6b4b){var _0x5033f6={'raw':![],'where':{'id':_0x35dd5a['params']['id']}},_0x38574c={};_0x38574c['model']=_['keys'](db[_0xb5f4('0x48')][_0xb5f4('0x32')]);_0x38574c['query']=_[_0xb5f4('0x34')](_0x35dd5a[_0xb5f4('0x35')]);_0x38574c[_0xb5f4('0x36')]=_['intersection'](_0x38574c[_0xb5f4('0x33')],_0x38574c['query']);_0x5033f6[_0xb5f4('0x37')]=_[_0xb5f4('0x38')](_0x38574c[_0xb5f4('0x33')],qs[_0xb5f4('0x39')](_0x35dd5a[_0xb5f4('0x35')]['fields']));_0x5033f6['attributes']=_0x5033f6[_0xb5f4('0x37')][_0xb5f4('0x3a')]?_0x5033f6[_0xb5f4('0x37')]:_0x38574c[_0xb5f4('0x33')];if(_0x35dd5a['query']['includeAll']){_0x5033f6[_0xb5f4('0x49')]=[{'all':!![]}];}_0x5033f6=_[_0xb5f4('0x46')]({},_0x5033f6,_0x35dd5a['options']);return db['Dynamics365Configuration'][_0xb5f4('0x4d')](_0x5033f6)[_0xb5f4('0x1c')](handleEntityNotFound(_0x3a6b4b,null))[_0xb5f4('0x1c')](respondWithResult(_0x3a6b4b,null))[_0xb5f4('0x25')](handleError(_0x3a6b4b,null));};exports['create']=function(_0x26a2d3,_0x106829){return db[_0xb5f4('0x48')]['create'](_0x26a2d3[_0xb5f4('0x4e')],{})['then'](respondWithResult(_0x106829,0xc9))[_0xb5f4('0x25')](handleError(_0x106829,null));};exports[_0xb5f4('0x2f')]=function(_0x454696,_0xd458ba){if(_0x454696[_0xb5f4('0x4e')]['id']){delete _0x454696['body']['id'];}return db[_0xb5f4('0x48')]['find']({'where':{'id':_0x454696[_0xb5f4('0x4f')]['id']}})['then'](handleEntityNotFound(_0xd458ba,null))['then'](saveUpdates(_0x454696[_0xb5f4('0x4e')],null))[_0xb5f4('0x1c')](respondWithResult(_0xd458ba,null))['catch'](handleError(_0xd458ba,null));};exports[_0xb5f4('0x30')]=function(_0x302ebe,_0x408383){return db[_0xb5f4('0x48')][_0xb5f4('0x4d')]({'where':{'id':_0x302ebe[_0xb5f4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x408383,null))[_0xb5f4('0x1c')](removeEntity(_0x408383,null))[_0xb5f4('0x25')](handleError(_0x408383,null));};exports[_0xb5f4('0x50')]=function(_0x4f9330,_0x273f23,_0x1bc6c0){var _0x590ef4={};var _0x5248f1={};var _0x4045af;var _0x498cef;return db[_0xb5f4('0x48')][_0xb5f4('0x51')]({'where':{'id':_0x4f9330['params']['id']}})['then'](handleEntityNotFound(_0x273f23,null))['then'](function(_0x46dcdf){if(_0x46dcdf){_0x4045af=_0x46dcdf;_0x5248f1[_0xb5f4('0x33')]=_[_0xb5f4('0x34')](db[_0xb5f4('0x52')]['rawAttributes']);_0x5248f1[_0xb5f4('0x35')]=_['keys'](_0x4f9330[_0xb5f4('0x35')]);_0x5248f1['filters']=_['intersection'](_0x5248f1[_0xb5f4('0x33')],_0x5248f1[_0xb5f4('0x35')]);_0x590ef4[_0xb5f4('0x37')]=_[_0xb5f4('0x38')](_0x5248f1[_0xb5f4('0x33')],qs[_0xb5f4('0x39')](_0x4f9330[_0xb5f4('0x35')][_0xb5f4('0x39')]));_0x590ef4[_0xb5f4('0x37')]=_0x590ef4['attributes']['length']?_0x590ef4['attributes']:_0x5248f1[_0xb5f4('0x33')];_0x590ef4[_0xb5f4('0x3e')]=qs[_0xb5f4('0x3f')](_0x4f9330['query'][_0xb5f4('0x3f')]);_0x590ef4[_0xb5f4('0x40')]=qs[_0xb5f4('0x36')](_['pick'](_0x4f9330[_0xb5f4('0x35')],_0x5248f1[_0xb5f4('0x36')]));if(_0x4f9330['query']['filter']){_0x590ef4[_0xb5f4('0x40')]=_[_0xb5f4('0x46')](_0x590ef4[_0xb5f4('0x40')],{'$or':_[_0xb5f4('0x43')](_0x590ef4['attributes'],function(_0x12714d){var _0x501a89={};_0x501a89[_0x12714d]={'$like':'%'+_0x4f9330[_0xb5f4('0x35')]['filter']+'%'};return _0x501a89;})});}_0x590ef4=_['merge']({},_0x590ef4,_0x4f9330[_0xb5f4('0x47')]);return _0x4045af[_0xb5f4('0x50')](_0x590ef4);}})[_0xb5f4('0x1c')](function(_0x32985e){if(_0x32985e){_0x498cef=_0x32985e[_0xb5f4('0x3a')];if(!_0x4f9330[_0xb5f4('0x35')][_0xb5f4('0x3b')](_0xb5f4('0x3c'))){_0x590ef4[_0xb5f4('0x3d')]=qs['limit'](_0x4f9330['query'][_0xb5f4('0x3d')]);_0x590ef4[_0xb5f4('0x29')]=qs[_0xb5f4('0x29')](_0x4f9330[_0xb5f4('0x35')][_0xb5f4('0x29')]);}return _0x4045af['getFields'](_0x590ef4);}})[_0xb5f4('0x1c')](function(_0x1a220d){if(_0x1a220d){return _0x1a220d?{'count':_0x498cef,'rows':_0x1a220d}:null;}})[_0xb5f4('0x1c')](respondWithResult(_0x273f23,null))[_0xb5f4('0x25')](handleError(_0x273f23,null));};exports['getSubjects']=function(_0x49d85e,_0x2aacd7,_0x2d7235){var _0x5ebbaa={};var _0x40f690={};var _0x2ccd45;var _0x3f0386;return db[_0xb5f4('0x48')][_0xb5f4('0x51')]({'where':{'id':_0x49d85e['params']['id']}})[_0xb5f4('0x1c')](handleEntityNotFound(_0x2aacd7,null))[_0xb5f4('0x1c')](function(_0x568a77){if(_0x568a77){_0x2ccd45=_0x568a77;_0x40f690[_0xb5f4('0x33')]=_[_0xb5f4('0x34')](db[_0xb5f4('0x52')][_0xb5f4('0x32')]);_0x40f690[_0xb5f4('0x35')]=_['keys'](_0x49d85e[_0xb5f4('0x35')]);_0x40f690[_0xb5f4('0x36')]=_['intersection'](_0x40f690[_0xb5f4('0x33')],_0x40f690['query']);_0x5ebbaa[_0xb5f4('0x37')]=_['intersection'](_0x40f690[_0xb5f4('0x33')],qs['fields'](_0x49d85e[_0xb5f4('0x35')][_0xb5f4('0x39')]));_0x5ebbaa[_0xb5f4('0x37')]=_0x5ebbaa[_0xb5f4('0x37')]['length']?_0x5ebbaa[_0xb5f4('0x37')]:_0x40f690[_0xb5f4('0x33')];_0x5ebbaa[_0xb5f4('0x3e')]=qs['sort'](_0x49d85e['query'][_0xb5f4('0x3f')]);_0x5ebbaa[_0xb5f4('0x40')]=qs['filters'](_[_0xb5f4('0x41')](_0x49d85e[_0xb5f4('0x35')],_0x40f690['filters']));if(_0x49d85e['query']['filter']){_0x5ebbaa[_0xb5f4('0x40')]=_[_0xb5f4('0x46')](_0x5ebbaa[_0xb5f4('0x40')],{'$or':_[_0xb5f4('0x43')](_0x5ebbaa[_0xb5f4('0x37')],function(_0x687572){var _0x45be99={};_0x45be99[_0x687572]={'$like':'%'+_0x49d85e[_0xb5f4('0x35')][_0xb5f4('0x42')]+'%'};return _0x45be99;})});}_0x5ebbaa=_[_0xb5f4('0x46')]({},_0x5ebbaa,_0x49d85e[_0xb5f4('0x47')]);return _0x2ccd45[_0xb5f4('0x53')](_0x5ebbaa);}})['then'](function(_0x498049){if(_0x498049){_0x3f0386=_0x498049[_0xb5f4('0x3a')];if(!_0x49d85e[_0xb5f4('0x35')][_0xb5f4('0x3b')]('nolimit')){_0x5ebbaa[_0xb5f4('0x3d')]=qs[_0xb5f4('0x3d')](_0x49d85e[_0xb5f4('0x35')][_0xb5f4('0x3d')]);_0x5ebbaa[_0xb5f4('0x29')]=qs[_0xb5f4('0x29')](_0x49d85e[_0xb5f4('0x35')][_0xb5f4('0x29')]);}return _0x2ccd45[_0xb5f4('0x53')](_0x5ebbaa);}})['then'](function(_0x2bd287){if(_0x2bd287){return _0x2bd287?{'count':_0x3f0386,'rows':_0x2bd287}:null;}})['then'](respondWithResult(_0x2aacd7,null))[_0xb5f4('0x25')](handleError(_0x2aacd7,null));};exports[_0xb5f4('0x54')]=function(_0x3423bb,_0x4cb1fd,_0x470b6f){var _0x1f95ad={};var _0x5874f4={};var _0x54e90f;var _0x31a39a;return db[_0xb5f4('0x48')][_0xb5f4('0x51')]({'where':{'id':_0x3423bb[_0xb5f4('0x4f')]['id']}})[_0xb5f4('0x1c')](handleEntityNotFound(_0x4cb1fd,null))['then'](function(_0x319d1e){if(_0x319d1e){_0x54e90f=_0x319d1e;_0x5874f4[_0xb5f4('0x33')]=_[_0xb5f4('0x34')](db[_0xb5f4('0x52')][_0xb5f4('0x32')]);_0x5874f4[_0xb5f4('0x35')]=_[_0xb5f4('0x34')](_0x3423bb[_0xb5f4('0x35')]);_0x5874f4[_0xb5f4('0x36')]=_[_0xb5f4('0x38')](_0x5874f4[_0xb5f4('0x33')],_0x5874f4[_0xb5f4('0x35')]);_0x1f95ad['attributes']=_[_0xb5f4('0x38')](_0x5874f4['model'],qs['fields'](_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x39')]));_0x1f95ad[_0xb5f4('0x37')]=_0x1f95ad[_0xb5f4('0x37')]['length']?_0x1f95ad[_0xb5f4('0x37')]:_0x5874f4[_0xb5f4('0x33')];_0x1f95ad['order']=qs[_0xb5f4('0x3f')](_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x3f')]);_0x1f95ad[_0xb5f4('0x40')]=qs[_0xb5f4('0x36')](_['pick'](_0x3423bb[_0xb5f4('0x35')],_0x5874f4[_0xb5f4('0x36')]));if(_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x42')]){_0x1f95ad['where']=_[_0xb5f4('0x46')](_0x1f95ad[_0xb5f4('0x40')],{'$or':_[_0xb5f4('0x43')](_0x1f95ad[_0xb5f4('0x37')],function(_0x233372){var _0x56e0c1={};_0x56e0c1[_0x233372]={'$like':'%'+_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x42')]+'%'};return _0x56e0c1;})});}_0x1f95ad=_[_0xb5f4('0x46')]({},_0x1f95ad,_0x3423bb[_0xb5f4('0x47')]);return _0x54e90f['getDescriptions'](_0x1f95ad);}})[_0xb5f4('0x1c')](function(_0x1c64f9){if(_0x1c64f9){_0x31a39a=_0x1c64f9[_0xb5f4('0x3a')];if(!_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x3b')](_0xb5f4('0x3c'))){_0x1f95ad['limit']=qs[_0xb5f4('0x3d')](_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x3d')]);_0x1f95ad[_0xb5f4('0x29')]=qs[_0xb5f4('0x29')](_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x29')]);}return _0x54e90f[_0xb5f4('0x54')](_0x1f95ad);}})[_0xb5f4('0x1c')](function(_0x4a1802){if(_0x4a1802){return _0x4a1802?{'count':_0x31a39a,'rows':_0x4a1802}:null;}})['then'](respondWithResult(_0x4cb1fd,null))['catch'](handleError(_0x4cb1fd,null));};
\ No newline at end of file
+var _0xc818=['merge','map','key','VIRTUAL','field','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','getFields','findOne','Dynamics365Field','sort','nolimit','getSubjects','pick','hasOwnProperty','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','code','error','message','result','sendStatus','end','status','count','offset','limit','Content-Range','apply','reject','save','update','destroy','name','send','index','Dynamics365Configuration','keys','query','filters','intersection','attributes','model','fields','length','order','where','filter'];(function(_0x469567,_0x38031d){var _0x45bd21=function(_0x2b0320){while(--_0x2b0320){_0x469567['push'](_0x469567['shift']());}};_0x45bd21(++_0x38031d);}(_0xc818,0x1da));var _0x8c81=function(_0x11ddbf,_0x36d005){_0x11ddbf=_0x11ddbf-0x0;var _0x319eb3=_0xc818[_0x11ddbf];return _0x319eb3;};'use strict';var pdf=require(_0x8c81('0x0'));var emlformat=require(_0x8c81('0x1'));var rimraf=require(_0x8c81('0x2'));var zipdir=require(_0x8c81('0x3'));var jsonpatch=require(_0x8c81('0x4'));var rp=require('request-promise');var moment=require(_0x8c81('0x5'));var BPromise=require(_0x8c81('0x6'));var Mustache=require(_0x8c81('0x7'));var util=require('util');var path=require(_0x8c81('0x8'));var sox=require('sox');var csv=require(_0x8c81('0x9'));var ejs=require(_0x8c81('0xa'));var fs=require('fs');var _=require(_0x8c81('0xb'));var squel=require(_0x8c81('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c81('0xd'));var deskjs=require(_0x8c81('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8c81('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8c81('0x10'));var qs=require(_0x8c81('0x11'));var hardwareService=require(_0x8c81('0x12'));var logger=require(_0x8c81('0x13'))(_0x8c81('0x14'));var utils=require(_0x8c81('0x15'));var config=require(_0x8c81('0x16'));var db=require(_0x8c81('0x17'))['db'];var jayson=require(_0x8c81('0x18'));var client=jayson['client'][_0x8c81('0x19')]({'port':0x232a});function checkPasswordPattern(_0x17292c,_0x5eb732,_0x11ff02){if(_0x11ff02){var _0x53b984=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53b984[_0x8c81('0x1a')](_0x5eb732)){return _0x17292c;}else{throw new Error(_0x8c81('0x1b'));}}else{return _0x17292c;}}function respondWithRpcPromise(_0x4131c9,_0x586ecb,_0xc506a4,_0xb9afc3){return new BPromise(function(_0x501b91,_0xe4ffed){var _0x13351f=_0xb9afc3||client;return _0x13351f[_0x8c81('0x1c')](_0x4131c9,_0xc506a4)[_0x8c81('0x1d')](function(_0x3b5d38){logger[_0x8c81('0x1e')](_0x8c81('0x1f'),_0x586ecb,_0x8c81('0x20'));logger[_0x8c81('0x21')](_0x8c81('0x22'),_0x586ecb,_0x8c81('0x20'),JSON['stringify'](_0x3b5d38));if(_0x3b5d38['error']){if(_0x3b5d38['error'][_0x8c81('0x23')]===0x1f4){logger[_0x8c81('0x24')](_0x8c81('0x1f'),_0x586ecb,_0x3b5d38[_0x8c81('0x24')][_0x8c81('0x25')]);return _0xe4ffed(_0x3b5d38['error'][_0x8c81('0x25')]);}logger[_0x8c81('0x24')](_0x8c81('0x1f'),_0x586ecb,_0x3b5d38[_0x8c81('0x24')][_0x8c81('0x25')]);return _0x501b91(_0x3b5d38['error'][_0x8c81('0x25')]);}else{logger[_0x8c81('0x1e')](_0x8c81('0x1f'),_0x586ecb,_0x8c81('0x20'));_0x501b91(_0x3b5d38[_0x8c81('0x26')][_0x8c81('0x25')]);}})['catch'](function(_0x486b17){logger[_0x8c81('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x586ecb,_0x486b17);_0xe4ffed(_0x486b17);});});}function respondWithStatusCode(_0x151847,_0x4cf002){_0x4cf002=_0x4cf002||0xcc;return function(_0x5e8625){if(_0x5e8625){return _0x151847[_0x8c81('0x27')](_0x4cf002);}return _0x151847['status'](_0x4cf002)[_0x8c81('0x28')]();};}function respondWithResult(_0x5d9b79,_0xccbdcb){_0xccbdcb=_0xccbdcb||0xc8;return function(_0x574810){if(_0x574810){return _0x5d9b79[_0x8c81('0x29')](_0xccbdcb)['json'](_0x574810);}};}function respondWithFilteredResult(_0x2068b7,_0x3652cb){return function(_0x4d5e84){if(_0x4d5e84){var _0x556584=_0x4d5e84[_0x8c81('0x2a')],_0x22e0b3=_0x3652cb[_0x8c81('0x2b')],_0x1484eb=_0x3652cb[_0x8c81('0x2b')]+_0x3652cb[_0x8c81('0x2c')],_0x143db8;if(_0x1484eb>=_0x556584){_0x1484eb=_0x556584;_0x143db8=0xc8;}else{_0x143db8=0xce;}_0x2068b7[_0x8c81('0x29')](_0x143db8);return _0x2068b7['set'](_0x8c81('0x2d'),_0x22e0b3+'-'+_0x1484eb+'/'+_0x556584)['json'](_0x4d5e84);}return null;};}function patchUpdates(_0x15fc74){return function(_0x1768ee){try{jsonpatch[_0x8c81('0x2e')](_0x1768ee,_0x15fc74,!![]);}catch(_0x1398e4){return BPromise[_0x8c81('0x2f')](_0x1398e4);}return _0x1768ee[_0x8c81('0x30')]();};}function saveUpdates(_0x9a90d9,_0x5c995b){return function(_0x32e41d){if(_0x32e41d){return _0x32e41d[_0x8c81('0x31')](_0x9a90d9)[_0x8c81('0x1d')](function(_0x5253a7){return _0x5253a7;});}return null;};}function removeEntity(_0x2c4f17,_0x51178c){return function(_0x9ec72c){if(_0x9ec72c){return _0x9ec72c[_0x8c81('0x32')]()['then'](function(){_0x2c4f17[_0x8c81('0x29')](0xcc)[_0x8c81('0x28')]();});}};}function handleEntityNotFound(_0x3d092d,_0x1207da){return function(_0x26ca41){if(!_0x26ca41){_0x3d092d[_0x8c81('0x27')](0x194);}return _0x26ca41;};}function handleError(_0x44d01,_0x115862){_0x115862=_0x115862||0x1f4;return function(_0x24df45){logger[_0x8c81('0x24')](_0x24df45['stack']);if(_0x24df45['name']){delete _0x24df45[_0x8c81('0x33')];}_0x44d01[_0x8c81('0x29')](_0x115862)[_0x8c81('0x34')](_0x24df45);};}exports[_0x8c81('0x35')]=function(_0x37d825,_0x108738){var _0x5f105d={},_0x20b718={},_0xce6b0={'count':0x0,'rows':[]};var _0x5e84f7=db[_0x8c81('0x36')]['rawAttributes'];_0x20b718['model']=_[_0x8c81('0x37')](_0x5e84f7);_0x20b718[_0x8c81('0x38')]=_[_0x8c81('0x37')](_0x37d825[_0x8c81('0x38')]);_0x20b718[_0x8c81('0x39')]=_[_0x8c81('0x3a')](_0x20b718['model'],_0x20b718[_0x8c81('0x38')]);_0x5f105d[_0x8c81('0x3b')]=_[_0x8c81('0x3a')](_0x20b718[_0x8c81('0x3c')],qs[_0x8c81('0x3d')](_0x37d825[_0x8c81('0x38')]['fields']));_0x5f105d['attributes']=_0x5f105d[_0x8c81('0x3b')][_0x8c81('0x3e')]?_0x5f105d[_0x8c81('0x3b')]:_0x20b718[_0x8c81('0x3c')];if(!_0x37d825[_0x8c81('0x38')]['hasOwnProperty']('nolimit')){_0x5f105d[_0x8c81('0x2c')]=qs[_0x8c81('0x2c')](_0x37d825['query']['limit']);_0x5f105d[_0x8c81('0x2b')]=qs[_0x8c81('0x2b')](_0x37d825[_0x8c81('0x38')][_0x8c81('0x2b')]);}_0x5f105d[_0x8c81('0x3f')]=qs['sort'](_0x37d825[_0x8c81('0x38')]['sort']);_0x5f105d[_0x8c81('0x40')]=qs[_0x8c81('0x39')](_['pick'](_0x37d825[_0x8c81('0x38')],_0x20b718[_0x8c81('0x39')]));if(_0x37d825[_0x8c81('0x38')][_0x8c81('0x41')]){_0x5f105d[_0x8c81('0x40')]=_[_0x8c81('0x42')](_0x5f105d[_0x8c81('0x40')],{'$or':_[_0x8c81('0x43')](_0x5e84f7,function(_0x30d7e7){if(_0x30d7e7['type'][_0x8c81('0x44')]!==_0x8c81('0x45')){var _0x4d7782={};_0x4d7782[_0x30d7e7[_0x8c81('0x46')]]={'$like':'%'+_0x37d825[_0x8c81('0x38')][_0x8c81('0x41')]+'%'};return _0x4d7782;}})});}_0x5f105d=_[_0x8c81('0x42')]({},_0x5f105d,_0x37d825[_0x8c81('0x47')]);var _0x1d3f71={'where':_0x5f105d[_0x8c81('0x40')]};return db[_0x8c81('0x36')][_0x8c81('0x2a')](_0x1d3f71)[_0x8c81('0x1d')](function(_0x377e92){_0xce6b0[_0x8c81('0x2a')]=_0x377e92;if(_0x37d825[_0x8c81('0x38')][_0x8c81('0x48')]){_0x5f105d[_0x8c81('0x49')]=[{'all':!![]}];}return db[_0x8c81('0x36')]['findAll'](_0x5f105d);})[_0x8c81('0x1d')](function(_0x177fbf){_0xce6b0[_0x8c81('0x4a')]=_0x177fbf;return _0xce6b0;})[_0x8c81('0x1d')](respondWithFilteredResult(_0x108738,_0x5f105d))[_0x8c81('0x4b')](handleError(_0x108738,null));};exports['show']=function(_0x380064,_0x22821a){var _0x2c1cb0={'raw':![],'where':{'id':_0x380064[_0x8c81('0x4c')]['id']}},_0x7575e9={};_0x7575e9[_0x8c81('0x3c')]=_[_0x8c81('0x37')](db[_0x8c81('0x36')][_0x8c81('0x4d')]);_0x7575e9[_0x8c81('0x38')]=_[_0x8c81('0x37')](_0x380064[_0x8c81('0x38')]);_0x7575e9[_0x8c81('0x39')]=_[_0x8c81('0x3a')](_0x7575e9['model'],_0x7575e9[_0x8c81('0x38')]);_0x2c1cb0[_0x8c81('0x3b')]=_['intersection'](_0x7575e9[_0x8c81('0x3c')],qs['fields'](_0x380064['query'][_0x8c81('0x3d')]));_0x2c1cb0[_0x8c81('0x3b')]=_0x2c1cb0[_0x8c81('0x3b')]['length']?_0x2c1cb0[_0x8c81('0x3b')]:_0x7575e9['model'];if(_0x380064[_0x8c81('0x38')][_0x8c81('0x48')]){_0x2c1cb0[_0x8c81('0x49')]=[{'all':!![]}];}_0x2c1cb0=_[_0x8c81('0x42')]({},_0x2c1cb0,_0x380064[_0x8c81('0x47')]);return db['Dynamics365Configuration'][_0x8c81('0x4e')](_0x2c1cb0)[_0x8c81('0x1d')](handleEntityNotFound(_0x22821a,null))[_0x8c81('0x1d')](respondWithResult(_0x22821a,null))[_0x8c81('0x4b')](handleError(_0x22821a,null));};exports[_0x8c81('0x4f')]=function(_0x7bb85b,_0x4c8fad){return db[_0x8c81('0x36')][_0x8c81('0x4f')](_0x7bb85b[_0x8c81('0x50')],{})[_0x8c81('0x1d')](respondWithResult(_0x4c8fad,0xc9))[_0x8c81('0x4b')](handleError(_0x4c8fad,null));};exports[_0x8c81('0x31')]=function(_0xf4af8a,_0x574890){if(_0xf4af8a['body']['id']){delete _0xf4af8a['body']['id'];}return db[_0x8c81('0x36')][_0x8c81('0x4e')]({'where':{'id':_0xf4af8a['params']['id']}})[_0x8c81('0x1d')](handleEntityNotFound(_0x574890,null))[_0x8c81('0x1d')](saveUpdates(_0xf4af8a[_0x8c81('0x50')],null))[_0x8c81('0x1d')](respondWithResult(_0x574890,null))[_0x8c81('0x4b')](handleError(_0x574890,null));};exports[_0x8c81('0x32')]=function(_0x5596a3,_0x310839){return db[_0x8c81('0x36')][_0x8c81('0x4e')]({'where':{'id':_0x5596a3[_0x8c81('0x4c')]['id']}})[_0x8c81('0x1d')](handleEntityNotFound(_0x310839,null))[_0x8c81('0x1d')](removeEntity(_0x310839,null))[_0x8c81('0x4b')](handleError(_0x310839,null));};exports[_0x8c81('0x51')]=function(_0x4082a2,_0x421334,_0x53d2f3){var _0x104f86={};var _0x1a3ba3={};var _0x1b091e;var _0x1bac54;return db[_0x8c81('0x36')][_0x8c81('0x52')]({'where':{'id':_0x4082a2[_0x8c81('0x4c')]['id']}})['then'](handleEntityNotFound(_0x421334,null))[_0x8c81('0x1d')](function(_0x40393f){if(_0x40393f){_0x1b091e=_0x40393f;_0x1a3ba3[_0x8c81('0x3c')]=_['keys'](db[_0x8c81('0x53')]['rawAttributes']);_0x1a3ba3[_0x8c81('0x38')]=_[_0x8c81('0x37')](_0x4082a2[_0x8c81('0x38')]);_0x1a3ba3['filters']=_['intersection'](_0x1a3ba3[_0x8c81('0x3c')],_0x1a3ba3[_0x8c81('0x38')]);_0x104f86[_0x8c81('0x3b')]=_[_0x8c81('0x3a')](_0x1a3ba3[_0x8c81('0x3c')],qs['fields'](_0x4082a2[_0x8c81('0x38')]['fields']));_0x104f86[_0x8c81('0x3b')]=_0x104f86[_0x8c81('0x3b')]['length']?_0x104f86['attributes']:_0x1a3ba3[_0x8c81('0x3c')];_0x104f86[_0x8c81('0x3f')]=qs[_0x8c81('0x54')](_0x4082a2['query'][_0x8c81('0x54')]);_0x104f86[_0x8c81('0x40')]=qs[_0x8c81('0x39')](_['pick'](_0x4082a2[_0x8c81('0x38')],_0x1a3ba3[_0x8c81('0x39')]));if(_0x4082a2[_0x8c81('0x38')][_0x8c81('0x41')]){_0x104f86[_0x8c81('0x40')]=_[_0x8c81('0x42')](_0x104f86[_0x8c81('0x40')],{'$or':_['map'](_0x104f86[_0x8c81('0x3b')],function(_0x2d5564){var _0xe97767={};_0xe97767[_0x2d5564]={'$like':'%'+_0x4082a2[_0x8c81('0x38')][_0x8c81('0x41')]+'%'};return _0xe97767;})});}_0x104f86=_[_0x8c81('0x42')]({},_0x104f86,_0x4082a2[_0x8c81('0x47')]);return _0x1b091e['getFields'](_0x104f86);}})['then'](function(_0x38b9c5){if(_0x38b9c5){_0x1bac54=_0x38b9c5[_0x8c81('0x3e')];if(!_0x4082a2[_0x8c81('0x38')]['hasOwnProperty'](_0x8c81('0x55'))){_0x104f86['limit']=qs[_0x8c81('0x2c')](_0x4082a2[_0x8c81('0x38')][_0x8c81('0x2c')]);_0x104f86[_0x8c81('0x2b')]=qs[_0x8c81('0x2b')](_0x4082a2[_0x8c81('0x38')][_0x8c81('0x2b')]);}return _0x1b091e[_0x8c81('0x51')](_0x104f86);}})[_0x8c81('0x1d')](function(_0x29ed3e){if(_0x29ed3e){return _0x29ed3e?{'count':_0x1bac54,'rows':_0x29ed3e}:null;}})['then'](respondWithResult(_0x421334,null))['catch'](handleError(_0x421334,null));};exports[_0x8c81('0x56')]=function(_0x2d1abe,_0x38b774,_0xf65d4f){var _0x2ce917={};var _0x454c9c={};var _0x42e8c3;var _0x5130e2;return db[_0x8c81('0x36')][_0x8c81('0x52')]({'where':{'id':_0x2d1abe[_0x8c81('0x4c')]['id']}})['then'](handleEntityNotFound(_0x38b774,null))['then'](function(_0xcf1d80){if(_0xcf1d80){_0x42e8c3=_0xcf1d80;_0x454c9c[_0x8c81('0x3c')]=_['keys'](db[_0x8c81('0x53')][_0x8c81('0x4d')]);_0x454c9c[_0x8c81('0x38')]=_[_0x8c81('0x37')](_0x2d1abe[_0x8c81('0x38')]);_0x454c9c[_0x8c81('0x39')]=_[_0x8c81('0x3a')](_0x454c9c[_0x8c81('0x3c')],_0x454c9c[_0x8c81('0x38')]);_0x2ce917[_0x8c81('0x3b')]=_['intersection'](_0x454c9c[_0x8c81('0x3c')],qs[_0x8c81('0x3d')](_0x2d1abe[_0x8c81('0x38')]['fields']));_0x2ce917['attributes']=_0x2ce917[_0x8c81('0x3b')][_0x8c81('0x3e')]?_0x2ce917[_0x8c81('0x3b')]:_0x454c9c['model'];_0x2ce917['order']=qs[_0x8c81('0x54')](_0x2d1abe[_0x8c81('0x38')][_0x8c81('0x54')]);_0x2ce917[_0x8c81('0x40')]=qs[_0x8c81('0x39')](_[_0x8c81('0x57')](_0x2d1abe['query'],_0x454c9c[_0x8c81('0x39')]));if(_0x2d1abe[_0x8c81('0x38')][_0x8c81('0x41')]){_0x2ce917[_0x8c81('0x40')]=_['merge'](_0x2ce917['where'],{'$or':_[_0x8c81('0x43')](_0x2ce917[_0x8c81('0x3b')],function(_0x194e11){var _0x1227fd={};_0x1227fd[_0x194e11]={'$like':'%'+_0x2d1abe[_0x8c81('0x38')][_0x8c81('0x41')]+'%'};return _0x1227fd;})});}_0x2ce917=_[_0x8c81('0x42')]({},_0x2ce917,_0x2d1abe[_0x8c81('0x47')]);return _0x42e8c3[_0x8c81('0x56')](_0x2ce917);}})['then'](function(_0xcff838){if(_0xcff838){_0x5130e2=_0xcff838['length'];if(!_0x2d1abe['query'][_0x8c81('0x58')]('nolimit')){_0x2ce917[_0x8c81('0x2c')]=qs[_0x8c81('0x2c')](_0x2d1abe[_0x8c81('0x38')][_0x8c81('0x2c')]);_0x2ce917[_0x8c81('0x2b')]=qs[_0x8c81('0x2b')](_0x2d1abe[_0x8c81('0x38')][_0x8c81('0x2b')]);}return _0x42e8c3[_0x8c81('0x56')](_0x2ce917);}})['then'](function(_0xd85cde){if(_0xd85cde){return _0xd85cde?{'count':_0x5130e2,'rows':_0xd85cde}:null;}})[_0x8c81('0x1d')](respondWithResult(_0x38b774,null))[_0x8c81('0x4b')](handleError(_0x38b774,null));};exports[_0x8c81('0x59')]=function(_0xe22e58,_0x5ea356,_0x4c9201){var _0x565fcb={};var _0x23328d={};var _0xb8e25d;var _0x3c37ea;return db[_0x8c81('0x36')][_0x8c81('0x52')]({'where':{'id':_0xe22e58[_0x8c81('0x4c')]['id']}})[_0x8c81('0x1d')](handleEntityNotFound(_0x5ea356,null))['then'](function(_0x267e0f){if(_0x267e0f){_0xb8e25d=_0x267e0f;_0x23328d[_0x8c81('0x3c')]=_[_0x8c81('0x37')](db[_0x8c81('0x53')][_0x8c81('0x4d')]);_0x23328d[_0x8c81('0x38')]=_['keys'](_0xe22e58[_0x8c81('0x38')]);_0x23328d[_0x8c81('0x39')]=_['intersection'](_0x23328d['model'],_0x23328d[_0x8c81('0x38')]);_0x565fcb[_0x8c81('0x3b')]=_['intersection'](_0x23328d[_0x8c81('0x3c')],qs[_0x8c81('0x3d')](_0xe22e58['query'][_0x8c81('0x3d')]));_0x565fcb['attributes']=_0x565fcb[_0x8c81('0x3b')]['length']?_0x565fcb[_0x8c81('0x3b')]:_0x23328d[_0x8c81('0x3c')];_0x565fcb[_0x8c81('0x3f')]=qs[_0x8c81('0x54')](_0xe22e58[_0x8c81('0x38')]['sort']);_0x565fcb[_0x8c81('0x40')]=qs[_0x8c81('0x39')](_[_0x8c81('0x57')](_0xe22e58[_0x8c81('0x38')],_0x23328d[_0x8c81('0x39')]));if(_0xe22e58[_0x8c81('0x38')][_0x8c81('0x41')]){_0x565fcb[_0x8c81('0x40')]=_['merge'](_0x565fcb[_0x8c81('0x40')],{'$or':_[_0x8c81('0x43')](_0x565fcb['attributes'],function(_0x48352b){var _0x18c9aa={};_0x18c9aa[_0x48352b]={'$like':'%'+_0xe22e58[_0x8c81('0x38')][_0x8c81('0x41')]+'%'};return _0x18c9aa;})});}_0x565fcb=_[_0x8c81('0x42')]({},_0x565fcb,_0xe22e58[_0x8c81('0x47')]);return _0xb8e25d[_0x8c81('0x59')](_0x565fcb);}})[_0x8c81('0x1d')](function(_0x388557){if(_0x388557){_0x3c37ea=_0x388557['length'];if(!_0xe22e58[_0x8c81('0x38')][_0x8c81('0x58')]('nolimit')){_0x565fcb[_0x8c81('0x2c')]=qs[_0x8c81('0x2c')](_0xe22e58[_0x8c81('0x38')][_0x8c81('0x2c')]);_0x565fcb['offset']=qs[_0x8c81('0x2b')](_0xe22e58['query'][_0x8c81('0x2b')]);}return _0xb8e25d[_0x8c81('0x59')](_0x565fcb);}})[_0x8c81('0x1d')](function(_0xee152c){if(_0xee152c){return _0xee152c?{'count':_0x3c37ea,'rows':_0xee152c}:null;}})['then'](respondWithResult(_0x5ea356,null))[_0x8c81('0x4b')](handleError(_0x5ea356,null));};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
index 54a4ef6..8b978a6 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb3f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb3f,0x195));var _0xfcb3=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xcb3f[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xfcb3('0x0'));var util=require(_0xfcb3('0x1'));var logger=require(_0xfcb3('0x2'))(_0xfcb3('0x3'));var moment=require(_0xfcb3('0x4'));var BPromise=require(_0xfcb3('0x5'));var rp=require(_0xfcb3('0x6'));var fs=require('fs');var path=require(_0xfcb3('0x7'));var rimraf=require(_0xfcb3('0x8'));var config=require('../../config/environment');var attributes=require(_0xfcb3('0x9'));module[_0xfcb3('0xa')]=function(_0x46e5f2,_0x257e58){return _0x46e5f2[_0xfcb3('0xb')](_0xfcb3('0xc'),attributes,{'tableName':_0xfcb3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f89=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x8f89,0x111));var _0x98f8=function(_0x472e4c,_0x18a177){_0x472e4c=_0x472e4c-0x0;var _0x261e2d=_0x8f89[_0x472e4c];return _0x261e2d;};'use strict';var _=require(_0x98f8('0x0'));var util=require(_0x98f8('0x1'));var logger=require(_0x98f8('0x2'))(_0x98f8('0x3'));var moment=require(_0x98f8('0x4'));var BPromise=require(_0x98f8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98f8('0x6'));var rimraf=require(_0x98f8('0x7'));var config=require(_0x98f8('0x8'));var attributes=require(_0x98f8('0x9'));module[_0x98f8('0xa')]=function(_0x1fa686,_0x305594){return _0x1fa686[_0x98f8('0xb')](_0x98f8('0xc'),attributes,{'tableName':_0x98f8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
index 752bd05..d43981e 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x08da=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x08da,0xf5));var _0xa08d=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x08da[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xa08d('0x0'));var util=require(_0xa08d('0x1'));var moment=require(_0xa08d('0x2'));var BPromise=require('bluebird');var rs=require(_0xa08d('0x3'));var fs=require('fs');var Redis=require(_0xa08d('0x4'));var db=require(_0xa08d('0x5'))['db'];var utils=require(_0xa08d('0x6'));var logger=require(_0xa08d('0x7'))(_0xa08d('0x8'));var config=require(_0xa08d('0x9'));var jayson=require(_0xa08d('0xa'));var client=jayson[_0xa08d('0xb')][_0xa08d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16a415,_0x2d6bcf,_0x2a6c06){return new BPromise(function(_0x735948,_0x192c33){return client[_0xa08d('0xd')](_0x16a415,_0x2a6c06)[_0xa08d('0xe')](function(_0x3eeff5){logger[_0xa08d('0xf')](_0xa08d('0x10'),_0x2d6bcf,_0xa08d('0x11'));logger[_0xa08d('0x12')](_0xa08d('0x13'),_0x2d6bcf,_0xa08d('0x11'),JSON[_0xa08d('0x14')](_0x3eeff5));if(_0x3eeff5[_0xa08d('0x15')]){if(_0x3eeff5[_0xa08d('0x15')][_0xa08d('0x16')]===0x1f4){logger[_0xa08d('0x15')](_0xa08d('0x10'),_0x2d6bcf,_0x3eeff5['error'][_0xa08d('0x17')]);return _0x192c33(_0x3eeff5[_0xa08d('0x15')][_0xa08d('0x17')]);}logger[_0xa08d('0x15')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2d6bcf,_0x3eeff5[_0xa08d('0x15')]['message']);return _0x735948(_0x3eeff5['error'][_0xa08d('0x17')]);}else{logger[_0xa08d('0xf')](_0xa08d('0x10'),_0x2d6bcf,_0xa08d('0x11'));_0x735948(_0x3eeff5['result']['message']);}})[_0xa08d('0x18')](function(_0x19eeb9){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x2d6bcf,_0x19eeb9);_0x192c33(_0x19eeb9);});});}
\ No newline at end of file
+var _0x9ba1=['error','code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','moment','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify'];(function(_0x2e0af5,_0x4cb388){var _0x2cab27=function(_0x4da11c){while(--_0x4da11c){_0x2e0af5['push'](_0x2e0af5['shift']());}};_0x2cab27(++_0x4cb388);}(_0x9ba1,0x1f2));var _0x19ba=function(_0x46e93d,_0x126d65){_0x46e93d=_0x46e93d-0x0;var _0x4fd987=_0x9ba1[_0x46e93d];return _0x4fd987;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x19ba('0x0'));var BPromise=require('bluebird');var rs=require(_0x19ba('0x1'));var fs=require('fs');var Redis=require(_0x19ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x19ba('0x3'));var jayson=require(_0x19ba('0x4'));var client=jayson[_0x19ba('0x5')][_0x19ba('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x255895,_0x8df5ce,_0x562d5f){return new BPromise(function(_0xb2e1ce,_0x1f3800){return client[_0x19ba('0x7')](_0x255895,_0x562d5f)[_0x19ba('0x8')](function(_0x42196b){logger[_0x19ba('0x9')]('Dynamics365Configuration,\x20%s,\x20%s',_0x8df5ce,_0x19ba('0xa'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x8df5ce,_0x19ba('0xa'),JSON[_0x19ba('0xb')](_0x42196b));if(_0x42196b['error']){if(_0x42196b[_0x19ba('0xc')][_0x19ba('0xd')]===0x1f4){logger[_0x19ba('0xc')](_0x19ba('0xe'),_0x8df5ce,_0x42196b[_0x19ba('0xc')]['message']);return _0x1f3800(_0x42196b[_0x19ba('0xc')][_0x19ba('0xf')]);}logger[_0x19ba('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x8df5ce,_0x42196b['error'][_0x19ba('0xf')]);return _0xb2e1ce(_0x42196b['error'][_0x19ba('0xf')]);}else{logger['info'](_0x19ba('0xe'),_0x8df5ce,_0x19ba('0xa'));_0xb2e1ce(_0x42196b['result'][_0x19ba('0xf')]);}})[_0x19ba('0x10')](function(_0x57402f){logger[_0x19ba('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x8df5ce,_0x57402f);_0x1f3800(_0x57402f);});});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js
index 8fe0fa2..0dbe33f 100644
--- a/server/api/intDynamics365Field/index.js
+++ b/server/api/intDynamics365Field/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3bbd=['index','/:id','isAuthenticated','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0x3bbd,0x88));var _0xd3bb=function(_0x439fe0,_0x3a50d8){_0x439fe0=_0x439fe0-0x0;var _0x3ebf90=_0x3bbd[_0x439fe0];return _0x3ebf90;};'use strict';var multer=require('multer');var util=require(_0xd3bb('0x0'));var path=require(_0xd3bb('0x1'));var timeout=require(_0xd3bb('0x2'));var express=require(_0xd3bb('0x3'));var router=express[_0xd3bb('0x4')]();var auth=require(_0xd3bb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd3bb('0x6'));var controller=require(_0xd3bb('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd3bb('0x8')]);router['get'](_0xd3bb('0x9'),auth[_0xd3bb('0xa')](),controller['show']);router['post']('/',auth[_0xd3bb('0xa')](),controller[_0xd3bb('0xb')]);router['put'](_0xd3bb('0x9'),auth[_0xd3bb('0xa')](),controller[_0xd3bb('0xc')]);router[_0xd3bb('0xd')](_0xd3bb('0x9'),auth[_0xd3bb('0xa')](),controller[_0xd3bb('0xe')]);module[_0xd3bb('0xf')]=router;
\ No newline at end of file
+var _0x44f5=['create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','post'];(function(_0x56ffe0,_0x3b1f85){var _0x19e017=function(_0x1a311a){while(--_0x1a311a){_0x56ffe0['push'](_0x56ffe0['shift']());}};_0x19e017(++_0x3b1f85);}(_0x44f5,0xa8));var _0x544f=function(_0x3f1688,_0x34b8ad){_0x3f1688=_0x3f1688-0x0;var _0x5390e8=_0x44f5[_0x3f1688];return _0x5390e8;};'use strict';var multer=require(_0x544f('0x0'));var util=require(_0x544f('0x1'));var path=require(_0x544f('0x2'));var timeout=require('connect-timeout');var express=require(_0x544f('0x3'));var router=express['Router']();var auth=require(_0x544f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x544f('0x5'));var controller=require(_0x544f('0x6'));router['get']('/',auth[_0x544f('0x7')](),controller[_0x544f('0x8')]);router[_0x544f('0x9')](_0x544f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x544f('0xb')]('/',auth[_0x544f('0x7')](),controller[_0x544f('0xc')]);router[_0x544f('0xd')]('/:id',auth[_0x544f('0x7')](),controller[_0x544f('0xe')]);router[_0x544f('0xf')](_0x544f('0xa'),auth[_0x544f('0x7')](),controller[_0x544f('0x10')]);module[_0x544f('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js
index 6907c7a..8e661af 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.attributes.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5c00=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x450813,_0x1eb1ba){var _0x246705=function(_0x36fb9d){while(--_0x36fb9d){_0x450813['push'](_0x450813['shift']());}};_0x246705(++_0x1eb1ba);}(_0x5c00,0x17e));var _0x05c0=function(_0x5a12ff,_0x2e18db){_0x5a12ff=_0x5a12ff-0x0;var _0x285f8d=_0x5c00[_0x5a12ff];return _0x285f8d;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'type':{'type':Sequelize[_0x05c0('0x2')]('string',_0x05c0('0x3'),'customVariable',_0x05c0('0x4')),'defaultValue':_0x05c0('0x5')},'content':{'type':Sequelize[_0x05c0('0x6')]},'key':{'type':Sequelize[_0x05c0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x05c0('0x5'),_0x05c0('0x3'),_0x05c0('0x7'))},'keyContent':{'type':Sequelize[_0x05c0('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x05c0('0x6')]},'customField':{'type':Sequelize[_0x05c0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x05c0('0x6')]}};
\ No newline at end of file
+var _0x41bb=['exports','string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN','sequelize'];(function(_0x2ed153,_0x2c4817){var _0x57e035=function(_0xba80ca){while(--_0xba80ca){_0x2ed153['push'](_0x2ed153['shift']());}};_0x57e035(++_0x2c4817);}(_0x41bb,0xc5));var _0xb41b=function(_0x4eb4c0,_0x3a228f){_0x4eb4c0=_0x4eb4c0-0x0;var _0xf21d77=_0x41bb[_0x4eb4c0];return _0xf21d77;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb41b('0x2'),'variable',_0xb41b('0x3'),_0xb41b('0x4')),'defaultValue':_0xb41b('0x2')},'content':{'type':Sequelize[_0xb41b('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb41b('0x6')](_0xb41b('0x2'),_0xb41b('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb41b('0x5')]},'customField':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js
index 300c5f6..84362c0 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.controller.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3dc3=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','error','stack','name','send','Dynamics365Field','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','include','findAll','rows','params','includeAll','catch','create','body','find','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x3dc3,0x76));var _0x33dc=function(_0x2a6015,_0x4d4716){_0x2a6015=_0x2a6015-0x0;var _0x27bc1f=_0x3dc3[_0x2a6015];return _0x27bc1f;};'use strict';var pdf=require(_0x33dc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x33dc('0x1'));var zipdir=require(_0x33dc('0x2'));var jsonpatch=require(_0x33dc('0x3'));var rp=require(_0x33dc('0x4'));var moment=require(_0x33dc('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x33dc('0x6'));var path=require(_0x33dc('0x7'));var sox=require(_0x33dc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x33dc('0x9'));var squel=require('squel');var crypto=require(_0x33dc('0xa'));var jsforce=require(_0x33dc('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x33dc('0xc'));var Papa=require(_0x33dc('0xd'));var Redis=require(_0x33dc('0xe'));var authService=require(_0x33dc('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x33dc('0x10'));var logger=require(_0x33dc('0x11'))('api');var utils=require(_0x33dc('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x148558,_0x51911b){_0x51911b=_0x51911b||0xcc;return function(_0xca615f){if(_0xca615f){return _0x148558[_0x33dc('0x13')](_0x51911b);}return _0x148558[_0x33dc('0x14')](_0x51911b)[_0x33dc('0x15')]();};}function respondWithResult(_0x524b72,_0x1f65e6){_0x1f65e6=_0x1f65e6||0xc8;return function(_0x158ed2){if(_0x158ed2){return _0x524b72['status'](_0x1f65e6)['json'](_0x158ed2);}};}function respondWithFilteredResult(_0x355cba,_0x2a1443){return function(_0x284d4d){if(_0x284d4d){var _0x19916c=_0x284d4d[_0x33dc('0x16')],_0x5e8820=_0x2a1443[_0x33dc('0x17')],_0x4c9f46=_0x2a1443[_0x33dc('0x17')]+_0x2a1443[_0x33dc('0x18')],_0x2f60bf;if(_0x4c9f46>=_0x19916c){_0x4c9f46=_0x19916c;_0x2f60bf=0xc8;}else{_0x2f60bf=0xce;}_0x355cba['status'](_0x2f60bf);return _0x355cba[_0x33dc('0x19')]('Content-Range',_0x5e8820+'-'+_0x4c9f46+'/'+_0x19916c)[_0x33dc('0x1a')](_0x284d4d);}return null;};}function patchUpdates(_0x2b1568){return function(_0x967565){try{jsonpatch[_0x33dc('0x1b')](_0x967565,_0x2b1568,!![]);}catch(_0x214339){return BPromise[_0x33dc('0x1c')](_0x214339);}return _0x967565[_0x33dc('0x1d')]();};}function saveUpdates(_0x2de3ee,_0x5b9019){return function(_0x3c252f){if(_0x3c252f){return _0x3c252f[_0x33dc('0x1e')](_0x2de3ee)[_0x33dc('0x1f')](function(_0x5d3eda){return _0x5d3eda;});}return null;};}function removeEntity(_0xdc929f,_0x2cbc1d){return function(_0x2daec4){if(_0x2daec4){return _0x2daec4['destroy']()['then'](function(){_0xdc929f[_0x33dc('0x14')](0xcc)[_0x33dc('0x15')]();});}};}function handleEntityNotFound(_0x32202f,_0x552f4e){return function(_0x5ea3af){if(!_0x5ea3af){_0x32202f[_0x33dc('0x13')](0x194);}return _0x5ea3af;};}function handleError(_0x5b238b,_0x19ff18){_0x19ff18=_0x19ff18||0x1f4;return function(_0x2ac8e1){logger[_0x33dc('0x20')](_0x2ac8e1[_0x33dc('0x21')]);if(_0x2ac8e1[_0x33dc('0x22')]){delete _0x2ac8e1[_0x33dc('0x22')];}_0x5b238b[_0x33dc('0x14')](_0x19ff18)[_0x33dc('0x23')](_0x2ac8e1);};}exports['index']=function(_0x184bbe,_0xce782d){var _0xf9a4e7={},_0xe1d92b={},_0x3d3d1c={'count':0x0,'rows':[]};var _0x3e1f31=db[_0x33dc('0x24')][_0x33dc('0x25')];_0xe1d92b[_0x33dc('0x26')]=_[_0x33dc('0x27')](_0x3e1f31);_0xe1d92b[_0x33dc('0x28')]=_[_0x33dc('0x27')](_0x184bbe[_0x33dc('0x28')]);_0xe1d92b[_0x33dc('0x29')]=_[_0x33dc('0x2a')](_0xe1d92b[_0x33dc('0x26')],_0xe1d92b[_0x33dc('0x28')]);_0xf9a4e7['attributes']=_[_0x33dc('0x2a')](_0xe1d92b[_0x33dc('0x26')],qs['fields'](_0x184bbe[_0x33dc('0x28')][_0x33dc('0x2b')]));_0xf9a4e7[_0x33dc('0x2c')]=_0xf9a4e7['attributes'][_0x33dc('0x2d')]?_0xf9a4e7[_0x33dc('0x2c')]:_0xe1d92b[_0x33dc('0x26')];if(!_0x184bbe[_0x33dc('0x28')]['hasOwnProperty'](_0x33dc('0x2e'))){_0xf9a4e7[_0x33dc('0x18')]=qs['limit'](_0x184bbe['query']['limit']);_0xf9a4e7[_0x33dc('0x17')]=qs[_0x33dc('0x17')](_0x184bbe[_0x33dc('0x28')][_0x33dc('0x17')]);}_0xf9a4e7[_0x33dc('0x2f')]=qs[_0x33dc('0x30')](_0x184bbe[_0x33dc('0x28')][_0x33dc('0x30')]);_0xf9a4e7[_0x33dc('0x31')]=qs[_0x33dc('0x29')](_['pick'](_0x184bbe[_0x33dc('0x28')],_0xe1d92b[_0x33dc('0x29')]));if(_0x184bbe[_0x33dc('0x28')][_0x33dc('0x32')]){_0xf9a4e7[_0x33dc('0x31')]=_[_0x33dc('0x33')](_0xf9a4e7[_0x33dc('0x31')],{'$or':_['map'](_0x3e1f31,function(_0x6823d1){if(_0x6823d1[_0x33dc('0x34')][_0x33dc('0x35')]!==_0x33dc('0x36')){var _0x1c4864={};_0x1c4864[_0x6823d1[_0x33dc('0x37')]]={'$like':'%'+_0x184bbe['query'][_0x33dc('0x32')]+'%'};return _0x1c4864;}})});}_0xf9a4e7=_[_0x33dc('0x33')]({},_0xf9a4e7,_0x184bbe['options']);var _0x10e5c2={'where':_0xf9a4e7['where']};return db[_0x33dc('0x24')][_0x33dc('0x16')](_0x10e5c2)[_0x33dc('0x1f')](function(_0x2ff4ae){_0x3d3d1c[_0x33dc('0x16')]=_0x2ff4ae;if(_0x184bbe[_0x33dc('0x28')]['includeAll']){_0xf9a4e7[_0x33dc('0x38')]=[{'all':!![]}];}return db[_0x33dc('0x24')][_0x33dc('0x39')](_0xf9a4e7);})[_0x33dc('0x1f')](function(_0x324983){_0x3d3d1c[_0x33dc('0x3a')]=_0x324983;return _0x3d3d1c;})[_0x33dc('0x1f')](respondWithFilteredResult(_0xce782d,_0xf9a4e7))['catch'](handleError(_0xce782d,null));};exports['show']=function(_0x14a052,_0x2b83d9){var _0x4d9f9a={'raw':!![],'where':{'id':_0x14a052[_0x33dc('0x3b')]['id']}},_0x541197={};_0x541197[_0x33dc('0x26')]=_[_0x33dc('0x27')](db['Dynamics365Field'][_0x33dc('0x25')]);_0x541197[_0x33dc('0x28')]=_[_0x33dc('0x27')](_0x14a052['query']);_0x541197[_0x33dc('0x29')]=_['intersection'](_0x541197[_0x33dc('0x26')],_0x541197[_0x33dc('0x28')]);_0x4d9f9a[_0x33dc('0x2c')]=_['intersection'](_0x541197['model'],qs['fields'](_0x14a052[_0x33dc('0x28')][_0x33dc('0x2b')]));_0x4d9f9a[_0x33dc('0x2c')]=_0x4d9f9a[_0x33dc('0x2c')][_0x33dc('0x2d')]?_0x4d9f9a[_0x33dc('0x2c')]:_0x541197['model'];if(_0x14a052[_0x33dc('0x28')][_0x33dc('0x3c')]){_0x4d9f9a[_0x33dc('0x38')]=[{'all':!![]}];}_0x4d9f9a=_[_0x33dc('0x33')]({},_0x4d9f9a,_0x14a052['options']);return db['Dynamics365Field']['find'](_0x4d9f9a)['then'](handleEntityNotFound(_0x2b83d9,null))[_0x33dc('0x1f')](respondWithResult(_0x2b83d9,null))[_0x33dc('0x3d')](handleError(_0x2b83d9,null));};exports[_0x33dc('0x3e')]=function(_0x2eb6b9,_0x58c980){return db['Dynamics365Field'][_0x33dc('0x3e')](_0x2eb6b9[_0x33dc('0x3f')],{})[_0x33dc('0x1f')](respondWithResult(_0x58c980,0xc9))[_0x33dc('0x3d')](handleError(_0x58c980,null));};exports['update']=function(_0x4312c3,_0x497989){if(_0x4312c3[_0x33dc('0x3f')]['id']){delete _0x4312c3[_0x33dc('0x3f')]['id'];}return db[_0x33dc('0x24')][_0x33dc('0x40')]({'where':{'id':_0x4312c3[_0x33dc('0x3b')]['id']}})[_0x33dc('0x1f')](handleEntityNotFound(_0x497989,null))[_0x33dc('0x1f')](saveUpdates(_0x4312c3['body'],null))[_0x33dc('0x1f')](respondWithResult(_0x497989,null))[_0x33dc('0x3d')](handleError(_0x497989,null));};exports[_0x33dc('0x41')]=function(_0x45b855,_0x171118){return db[_0x33dc('0x24')][_0x33dc('0x40')]({'where':{'id':_0x45b855[_0x33dc('0x3b')]['id']}})[_0x33dc('0x1f')](handleEntityNotFound(_0x171118,null))[_0x33dc('0x1f')](removeEntity(_0x171118,null))['catch'](handleError(_0x171118,null));};
\ No newline at end of file
+var _0x9997=['sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','catch','show','params','intersection','find','create','body','eml-format','zip-dir','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','count','offset','limit','set','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','Dynamics365Field','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x43d466,_0x34117){var _0x1439e5=function(_0x4a385b){while(--_0x4a385b){_0x43d466['push'](_0x43d466['shift']());}};_0x1439e5(++_0x34117);}(_0x9997,0x1f0));var _0x7999=function(_0x35e75a,_0x5ed225){_0x35e75a=_0x35e75a-0x0;var _0xb23c7f=_0x9997[_0x35e75a];return _0xb23c7f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7999('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7999('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7999('0x2'));var util=require(_0x7999('0x3'));var path=require('path');var sox=require(_0x7999('0x4'));var csv=require(_0x7999('0x5'));var ejs=require(_0x7999('0x6'));var fs=require('fs');var _=require(_0x7999('0x7'));var squel=require(_0x7999('0x8'));var crypto=require(_0x7999('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7999('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7999('0xb'));var Papa=require(_0x7999('0xc'));var Redis=require(_0x7999('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7999('0xe'));var logger=require(_0x7999('0xf'))(_0x7999('0x10'));var utils=require('../../config/utils');var config=require(_0x7999('0x11'));var db=require(_0x7999('0x12'))['db'];function respondWithStatusCode(_0x50dc78,_0xafc6af){_0xafc6af=_0xafc6af||0xcc;return function(_0x2fea5d){if(_0x2fea5d){return _0x50dc78[_0x7999('0x13')](_0xafc6af);}return _0x50dc78['status'](_0xafc6af)['end']();};}function respondWithResult(_0x22ff56,_0x42e690){_0x42e690=_0x42e690||0xc8;return function(_0xd424d0){if(_0xd424d0){return _0x22ff56['status'](_0x42e690)['json'](_0xd424d0);}};}function respondWithFilteredResult(_0x3c88bd,_0x36ba7c){return function(_0x493b43){if(_0x493b43){var _0x1f00da=_0x493b43[_0x7999('0x14')],_0x336842=_0x36ba7c['offset'],_0x551d61=_0x36ba7c[_0x7999('0x15')]+_0x36ba7c[_0x7999('0x16')],_0x46a4a7;if(_0x551d61>=_0x1f00da){_0x551d61=_0x1f00da;_0x46a4a7=0xc8;}else{_0x46a4a7=0xce;}_0x3c88bd['status'](_0x46a4a7);return _0x3c88bd[_0x7999('0x17')]('Content-Range',_0x336842+'-'+_0x551d61+'/'+_0x1f00da)[_0x7999('0x18')](_0x493b43);}return null;};}function patchUpdates(_0x554a91){return function(_0x5e6223){try{jsonpatch[_0x7999('0x19')](_0x5e6223,_0x554a91,!![]);}catch(_0x43f535){return BPromise[_0x7999('0x1a')](_0x43f535);}return _0x5e6223[_0x7999('0x1b')]();};}function saveUpdates(_0xf87cb9,_0x51f4ed){return function(_0x3789ca){if(_0x3789ca){return _0x3789ca[_0x7999('0x1c')](_0xf87cb9)[_0x7999('0x1d')](function(_0x301593){return _0x301593;});}return null;};}function removeEntity(_0xf68c9b,_0xe1c5e1){return function(_0x4c849a){if(_0x4c849a){return _0x4c849a[_0x7999('0x1e')]()['then'](function(){_0xf68c9b['status'](0xcc)[_0x7999('0x1f')]();});}};}function handleEntityNotFound(_0x4973ce,_0x1b3ad1){return function(_0x2a2ee6){if(!_0x2a2ee6){_0x4973ce[_0x7999('0x13')](0x194);}return _0x2a2ee6;};}function handleError(_0x4e5fd1,_0xc2161f){_0xc2161f=_0xc2161f||0x1f4;return function(_0x5df387){logger[_0x7999('0x20')](_0x5df387[_0x7999('0x21')]);if(_0x5df387['name']){delete _0x5df387[_0x7999('0x22')];}_0x4e5fd1['status'](_0xc2161f)[_0x7999('0x23')](_0x5df387);};}exports[_0x7999('0x24')]=function(_0x266995,_0x56864c){var _0x532291={},_0x2bc726={},_0x4bf6ee={'count':0x0,'rows':[]};var _0x3cf7bd=db[_0x7999('0x25')][_0x7999('0x26')];_0x2bc726[_0x7999('0x27')]=_[_0x7999('0x28')](_0x3cf7bd);_0x2bc726[_0x7999('0x29')]=_['keys'](_0x266995[_0x7999('0x29')]);_0x2bc726[_0x7999('0x2a')]=_['intersection'](_0x2bc726['model'],_0x2bc726['query']);_0x532291[_0x7999('0x2b')]=_['intersection'](_0x2bc726[_0x7999('0x27')],qs[_0x7999('0x2c')](_0x266995[_0x7999('0x29')]['fields']));_0x532291['attributes']=_0x532291[_0x7999('0x2b')][_0x7999('0x2d')]?_0x532291[_0x7999('0x2b')]:_0x2bc726[_0x7999('0x27')];if(!_0x266995[_0x7999('0x29')][_0x7999('0x2e')](_0x7999('0x2f'))){_0x532291['limit']=qs[_0x7999('0x16')](_0x266995['query'][_0x7999('0x16')]);_0x532291[_0x7999('0x15')]=qs[_0x7999('0x15')](_0x266995['query'][_0x7999('0x15')]);}_0x532291['order']=qs['sort'](_0x266995['query'][_0x7999('0x30')]);_0x532291[_0x7999('0x31')]=qs[_0x7999('0x2a')](_[_0x7999('0x32')](_0x266995[_0x7999('0x29')],_0x2bc726[_0x7999('0x2a')]));if(_0x266995[_0x7999('0x29')][_0x7999('0x33')]){_0x532291[_0x7999('0x31')]=_[_0x7999('0x34')](_0x532291[_0x7999('0x31')],{'$or':_[_0x7999('0x35')](_0x3cf7bd,function(_0x486e60){if(_0x486e60[_0x7999('0x36')][_0x7999('0x37')]!==_0x7999('0x38')){var _0x21bae8={};_0x21bae8[_0x486e60[_0x7999('0x39')]]={'$like':'%'+_0x266995['query'][_0x7999('0x33')]+'%'};return _0x21bae8;}})});}_0x532291=_['merge']({},_0x532291,_0x266995['options']);var _0x575eb7={'where':_0x532291['where']};return db['Dynamics365Field']['count'](_0x575eb7)[_0x7999('0x1d')](function(_0x556ed4){_0x4bf6ee[_0x7999('0x14')]=_0x556ed4;if(_0x266995['query'][_0x7999('0x3a')]){_0x532291[_0x7999('0x3b')]=[{'all':!![]}];}return db[_0x7999('0x25')]['findAll'](_0x532291);})[_0x7999('0x1d')](function(_0x2f185e){_0x4bf6ee[_0x7999('0x3c')]=_0x2f185e;return _0x4bf6ee;})[_0x7999('0x1d')](respondWithFilteredResult(_0x56864c,_0x532291))[_0x7999('0x3d')](handleError(_0x56864c,null));};exports[_0x7999('0x3e')]=function(_0x424684,_0x4e2c8e){var _0x51f080={'raw':!![],'where':{'id':_0x424684[_0x7999('0x3f')]['id']}},_0x5050f6={};_0x5050f6['model']=_[_0x7999('0x28')](db[_0x7999('0x25')][_0x7999('0x26')]);_0x5050f6[_0x7999('0x29')]=_['keys'](_0x424684[_0x7999('0x29')]);_0x5050f6[_0x7999('0x2a')]=_[_0x7999('0x40')](_0x5050f6[_0x7999('0x27')],_0x5050f6[_0x7999('0x29')]);_0x51f080[_0x7999('0x2b')]=_[_0x7999('0x40')](_0x5050f6[_0x7999('0x27')],qs['fields'](_0x424684[_0x7999('0x29')]['fields']));_0x51f080['attributes']=_0x51f080[_0x7999('0x2b')][_0x7999('0x2d')]?_0x51f080['attributes']:_0x5050f6[_0x7999('0x27')];if(_0x424684[_0x7999('0x29')]['includeAll']){_0x51f080[_0x7999('0x3b')]=[{'all':!![]}];}_0x51f080=_[_0x7999('0x34')]({},_0x51f080,_0x424684['options']);return db[_0x7999('0x25')][_0x7999('0x41')](_0x51f080)['then'](handleEntityNotFound(_0x4e2c8e,null))['then'](respondWithResult(_0x4e2c8e,null))['catch'](handleError(_0x4e2c8e,null));};exports['create']=function(_0xd1bc06,_0x575b1){return db[_0x7999('0x25')][_0x7999('0x42')](_0xd1bc06[_0x7999('0x43')],{})[_0x7999('0x1d')](respondWithResult(_0x575b1,0xc9))[_0x7999('0x3d')](handleError(_0x575b1,null));};exports[_0x7999('0x1c')]=function(_0x2626ce,_0x578941){if(_0x2626ce['body']['id']){delete _0x2626ce[_0x7999('0x43')]['id'];}return db[_0x7999('0x25')]['find']({'where':{'id':_0x2626ce[_0x7999('0x3f')]['id']}})[_0x7999('0x1d')](handleEntityNotFound(_0x578941,null))[_0x7999('0x1d')](saveUpdates(_0x2626ce[_0x7999('0x43')],null))[_0x7999('0x1d')](respondWithResult(_0x578941,null))[_0x7999('0x3d')](handleError(_0x578941,null));};exports[_0x7999('0x1e')]=function(_0x241525,_0x3bee47){return db[_0x7999('0x25')]['find']({'where':{'id':_0x241525[_0x7999('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3bee47,null))['then'](removeEntity(_0x3bee47,null))[_0x7999('0x3d')](handleError(_0x3bee47,null));};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js
index 7c0000c..08218c4 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.model.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x6dbd4c,_0x46aa71){var _0x5a7048=function(_0x5842dc){while(--_0x5842dc){_0x6dbd4c['push'](_0x6dbd4c['shift']());}};_0x5a7048(++_0x46aa71);}(_0x7a54,0x106));var _0x47a5=function(_0x1fd721,_0x372b31){_0x1fd721=_0x1fd721-0x0;var _0x44d9e9=_0x7a54[_0x1fd721];return _0x44d9e9;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x3e83ee,_0x821b00){var _0x91bc81=function(_0x1ebcb4){while(--_0x1ebcb4){_0x3e83ee['push'](_0x3e83ee['shift']());}};_0x91bc81(++_0x821b00);}(_0x7a54,0x106));var _0x47a5=function(_0x2a5658,_0x1eac1c){_0x2a5658=_0x2a5658-0x0;var _0x42f686=_0x7a54[_0x2a5658];return _0x42f686;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js
index a1e7fcd..6aeefca 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.rpc.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf3aa=['catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x4ef0cb,_0x525e34){var _0x576e26=function(_0x275fd2){while(--_0x275fd2){_0x4ef0cb['push'](_0x4ef0cb['shift']());}};_0x576e26(++_0x525e34);}(_0xf3aa,0xf1));var _0xaf3a=function(_0x1c288b,_0x377b72){_0x1c288b=_0x1c288b-0x0;var _0x5d9225=_0xf3aa[_0x1c288b];return _0x5d9225;};'use strict';var _=require(_0xaf3a('0x0'));var util=require(_0xaf3a('0x1'));var moment=require(_0xaf3a('0x2'));var BPromise=require(_0xaf3a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf3a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaf3a('0x5'))(_0xaf3a('0x6'));var config=require(_0xaf3a('0x7'));var jayson=require(_0xaf3a('0x8'));var client=jayson[_0xaf3a('0x9')][_0xaf3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb009f0,_0x135eda,_0x560ca4){return new BPromise(function(_0x4e5041,_0x3c304e){return client[_0xaf3a('0xb')](_0xb009f0,_0x560ca4)[_0xaf3a('0xc')](function(_0x499643){logger['info'](_0xaf3a('0xd'),_0x135eda,_0xaf3a('0xe'));logger[_0xaf3a('0xf')](_0xaf3a('0x10'),_0x135eda,_0xaf3a('0xe'),JSON['stringify'](_0x499643));if(_0x499643[_0xaf3a('0x11')]){if(_0x499643[_0xaf3a('0x11')]['code']===0x1f4){logger[_0xaf3a('0x11')](_0xaf3a('0xd'),_0x135eda,_0x499643[_0xaf3a('0x11')]['message']);return _0x3c304e(_0x499643[_0xaf3a('0x11')][_0xaf3a('0x12')]);}logger['error'](_0xaf3a('0xd'),_0x135eda,_0x499643['error']['message']);return _0x4e5041(_0x499643[_0xaf3a('0x11')][_0xaf3a('0x12')]);}else{logger['info'](_0xaf3a('0xd'),_0x135eda,_0xaf3a('0xe'));_0x4e5041(_0x499643['result'][_0xaf3a('0x12')]);}})[_0xaf3a('0x13')](function(_0x2505ec){logger[_0xaf3a('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x135eda,_0x2505ec);_0x3c304e(_0x2505ec);});});}
\ No newline at end of file
+var _0x1280=['message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x28b660,_0x159233){var _0x522239=function(_0x301fe8){while(--_0x301fe8){_0x28b660['push'](_0x28b660['shift']());}};_0x522239(++_0x159233);}(_0x1280,0xac));var _0x0128=function(_0x4ef734,_0x5826d){_0x4ef734=_0x4ef734-0x0;var _0x33a7cb=_0x1280[_0x4ef734];return _0x33a7cb;};'use strict';var _=require(_0x0128('0x0'));var util=require('util');var moment=require(_0x0128('0x1'));var BPromise=require(_0x0128('0x2'));var rs=require(_0x0128('0x3'));var fs=require('fs');var Redis=require(_0x0128('0x4'));var db=require(_0x0128('0x5'))['db'];var utils=require(_0x0128('0x6'));var logger=require('../../config/logger')(_0x0128('0x7'));var config=require(_0x0128('0x8'));var jayson=require(_0x0128('0x9'));var client=jayson[_0x0128('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e74fe,_0x1d647f,_0x134abd){return new BPromise(function(_0x2b8b86,_0x43a105){return client['request'](_0x4e74fe,_0x134abd)[_0x0128('0xb')](function(_0x2fa9cb){logger['info'](_0x0128('0xc'),_0x1d647f,_0x0128('0xd'));logger[_0x0128('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x1d647f,'request\x20sent',JSON[_0x0128('0xf')](_0x2fa9cb));if(_0x2fa9cb[_0x0128('0x10')]){if(_0x2fa9cb[_0x0128('0x10')]['code']===0x1f4){logger[_0x0128('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x1d647f,_0x2fa9cb[_0x0128('0x10')]['message']);return _0x43a105(_0x2fa9cb[_0x0128('0x10')]['message']);}logger[_0x0128('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x1d647f,_0x2fa9cb[_0x0128('0x10')][_0x0128('0x11')]);return _0x2b8b86(_0x2fa9cb[_0x0128('0x10')][_0x0128('0x11')]);}else{logger[_0x0128('0x12')](_0x0128('0xc'),_0x1d647f,'request\x20sent');_0x2b8b86(_0x2fa9cb[_0x0128('0x13')][_0x0128('0x11')]);}})[_0x0128('0x14')](function(_0x16a4b7){logger[_0x0128('0x10')](_0x0128('0xc'),_0x1d647f,_0x16a4b7);_0x43a105(_0x16a4b7);});});}
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js
index deab2e6..1e0ba57 100644
--- a/server/api/intFreshdeskAccount/index.js
+++ b/server/api/intFreshdeskAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb8e=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x456ccb,_0x36a51a){var _0x1f9a0b=function(_0x51c972){while(--_0x51c972){_0x456ccb['push'](_0x456ccb['shift']());}};_0x1f9a0b(++_0x36a51a);}(_0xfb8e,0xfe));var _0xefb8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfb8e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xefb8('0x0'));var path=require(_0xefb8('0x1'));var timeout=require(_0xefb8('0x2'));var express=require(_0xefb8('0x3'));var router=express[_0xefb8('0x4')]();var auth=require(_0xefb8('0x5'));var interaction=require(_0xefb8('0x6'));var config=require(_0xefb8('0x7'));var controller=require(_0xefb8('0x8'));router['get']('/',auth[_0xefb8('0x9')](),controller['index']);router[_0xefb8('0xa')](_0xefb8('0xb'),auth[_0xefb8('0x9')](),controller[_0xefb8('0xc')]);router[_0xefb8('0xa')](_0xefb8('0xd'),auth[_0xefb8('0x9')](),controller[_0xefb8('0xe')]);router[_0xefb8('0xa')](_0xefb8('0xf'),auth['isAuthenticated'](),controller[_0xefb8('0x10')]);router[_0xefb8('0x11')]('/',auth[_0xefb8('0x9')](),controller[_0xefb8('0x12')]);router[_0xefb8('0x11')](_0xefb8('0xd'),auth[_0xefb8('0x9')](),controller[_0xefb8('0x13')]);router[_0xefb8('0x14')](_0xefb8('0xb'),auth[_0xefb8('0x9')](),controller[_0xefb8('0x15')]);router[_0xefb8('0x16')]('/:id',auth[_0xefb8('0x9')](),controller[_0xefb8('0x17')]);module[_0xefb8('0x18')]=router;
\ No newline at end of file
+var _0x8187=['getFields','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields'];(function(_0xccc9c7,_0x6303de){var _0x422f9d=function(_0x519c03){while(--_0x519c03){_0xccc9c7['push'](_0xccc9c7['shift']());}};_0x422f9d(++_0x6303de);}(_0x8187,0x126));var _0x7818=function(_0x2444af,_0x11f831){_0x2444af=_0x2444af-0x0;var _0x19615e=_0x8187[_0x2444af];return _0x19615e;};'use strict';var multer=require(_0x7818('0x0'));var util=require(_0x7818('0x1'));var path=require('path');var timeout=require(_0x7818('0x2'));var express=require(_0x7818('0x3'));var router=express[_0x7818('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7818('0x5'));var config=require(_0x7818('0x6'));var controller=require(_0x7818('0x7'));router[_0x7818('0x8')]('/',auth[_0x7818('0x9')](),controller[_0x7818('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7818('0xb')]);router['get'](_0x7818('0xc'),auth[_0x7818('0x9')](),controller['getConfigurations']);router[_0x7818('0x8')](_0x7818('0xd'),auth[_0x7818('0x9')](),controller[_0x7818('0xe')]);router[_0x7818('0xf')]('/',auth['isAuthenticated'](),controller[_0x7818('0x10')]);router[_0x7818('0xf')](_0x7818('0xc'),auth[_0x7818('0x9')](),controller['addConfiguration']);router[_0x7818('0x11')](_0x7818('0x12'),auth['isAuthenticated'](),controller[_0x7818('0x13')]);router['delete'](_0x7818('0x12'),auth['isAuthenticated'](),controller[_0x7818('0x14')]);module[_0x7818('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
index 7caa86b..6d5a130 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6ff5=['exports','STRING','username','remoteUri'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6ff5,0x1d0));var _0x56ff=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x6ff5[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require('sequelize');module[_0x56ff('0x0')]={'name':{'type':Sequelize[_0x56ff('0x1')]},'description':{'type':Sequelize[_0x56ff('0x1')]},'username':{'type':Sequelize[_0x56ff('0x1')],'unique':_0x56ff('0x2')},'apiKey':{'type':Sequelize[_0x56ff('0x1')]},'remoteUri':{'type':Sequelize[_0x56ff('0x1')],'unique':_0x56ff('0x3')},'serverUrl':{'type':Sequelize[_0x56ff('0x1')]}};
\ No newline at end of file
+var _0xbb09=['STRING','username','remoteUri','sequelize','exports'];(function(_0x46c5d7,_0x13ec1f){var _0x512f9b=function(_0x300723){while(--_0x300723){_0x46c5d7['push'](_0x46c5d7['shift']());}};_0x512f9b(++_0x13ec1f);}(_0xbb09,0x1a7));var _0x9bb0=function(_0x596f6e,_0x3f8857){_0x596f6e=_0x596f6e-0x0;var _0x1e0803=_0xbb09[_0x596f6e];return _0x1e0803;};'use strict';var Sequelize=require(_0x9bb0('0x0'));module[_0x9bb0('0x1')]={'name':{'type':Sequelize[_0x9bb0('0x2')]},'description':{'type':Sequelize[_0x9bb0('0x2')]},'username':{'type':Sequelize[_0x9bb0('0x2')],'unique':_0x9bb0('0x3')},'apiKey':{'type':Sequelize[_0x9bb0('0x2')]},'remoteUri':{'type':Sequelize[_0x9bb0('0x2')],'unique':_0x9bb0('0x4')},'serverUrl':{'type':Sequelize[_0x9bb0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
index 0728eb0..91d742b 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedf1=['includeAll','include','findAll','rows','show','params','length','find','create','body','update','map','getConfigurations','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','findOne','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','format','Basic\x20%s','%s:X','toString','base64','subject','agent','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','save','then','destroy','stack','name','send','index','FreshdeskAccount','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xedf1,0xb2));var _0x1edf=function(_0xae01de,_0x15e954){_0xae01de=_0xae01de-0x0;var _0x44a581=_0xedf1[_0xae01de];return _0x44a581;};'use strict';var pdf=require(_0x1edf('0x0'));var emlformat=require(_0x1edf('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1edf('0x2'));var rp=require(_0x1edf('0x3'));var moment=require(_0x1edf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1edf('0x5'));var util=require(_0x1edf('0x6'));var path=require(_0x1edf('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1edf('0x8'));var fs=require('fs');var _=require(_0x1edf('0x9'));var squel=require(_0x1edf('0xa'));var crypto=require(_0x1edf('0xb'));var jsforce=require(_0x1edf('0xc'));var deskjs=require(_0x1edf('0xd'));var toCsv=require(_0x1edf('0xe'));var querystring=require(_0x1edf('0xf'));var Papa=require(_0x1edf('0x10'));var Redis=require('ioredis');var authService=require(_0x1edf('0x11'));var qs=require(_0x1edf('0x12'));var hardwareService=require(_0x1edf('0x13'));var logger=require(_0x1edf('0x14'))('api');var utils=require(_0x1edf('0x15'));var config=require('../../config/environment');var db=require(_0x1edf('0x16'))['db'];var integrations=require(_0x1edf('0x17'));var jayson=require(_0x1edf('0x18'));var client=jayson[_0x1edf('0x19')][_0x1edf('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3ec2bb,_0x277fc4,_0xfccc06){if(_0xfccc06){var _0x34811f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x34811f['test'](_0x277fc4)){return _0x3ec2bb;}else{throw new Error(_0x1edf('0x1b'));}}else{return _0x3ec2bb;}}function respondWithRpcPromise(_0x212a02,_0x545dd9,_0x1ab562,_0x4551d4){return new BPromise(function(_0x2dc46a,_0x2a0a78){var _0x1dfa91=_0x4551d4||client;return _0x1dfa91[_0x1edf('0x1c')](_0x212a02,_0x1ab562)['then'](function(_0x4f2584){logger[_0x1edf('0x1d')](_0x1edf('0x1e'),_0x545dd9,_0x1edf('0x1f'));logger[_0x1edf('0x20')](_0x1edf('0x21'),_0x545dd9,'request\x20sent',JSON[_0x1edf('0x22')](_0x4f2584));if(_0x4f2584['error']){if(_0x4f2584[_0x1edf('0x23')][_0x1edf('0x24')]===0x1f4){logger[_0x1edf('0x23')](_0x1edf('0x1e'),_0x545dd9,_0x4f2584[_0x1edf('0x23')][_0x1edf('0x25')]);return _0x2a0a78(_0x4f2584[_0x1edf('0x23')][_0x1edf('0x25')]);}logger[_0x1edf('0x23')](_0x1edf('0x1e'),_0x545dd9,_0x4f2584[_0x1edf('0x23')][_0x1edf('0x25')]);return _0x2dc46a(_0x4f2584[_0x1edf('0x23')]['message']);}else{logger[_0x1edf('0x1d')](_0x1edf('0x1e'),_0x545dd9,_0x1edf('0x1f'));_0x2dc46a(_0x4f2584['result'][_0x1edf('0x25')]);}})[_0x1edf('0x26')](function(_0x343624){logger[_0x1edf('0x23')](_0x1edf('0x1e'),_0x545dd9,_0x343624);_0x2a0a78(_0x343624);});});}function respondWithStatusCode(_0xedefd7,_0x2f51c0){_0x2f51c0=_0x2f51c0||0xcc;return function(_0x2865ca){if(_0x2865ca){return _0xedefd7[_0x1edf('0x27')](_0x2f51c0);}return _0xedefd7[_0x1edf('0x28')](_0x2f51c0)[_0x1edf('0x29')]();};}function respondWithResult(_0x2ca8a7,_0x386cdd){_0x386cdd=_0x386cdd||0xc8;return function(_0x532e36){if(_0x532e36){return _0x2ca8a7['status'](_0x386cdd)[_0x1edf('0x2a')](_0x532e36);}};}function respondWithFilteredResult(_0x362e79,_0xd8bb8c){return function(_0x23fb7d){if(_0x23fb7d){var _0x105640=_0x23fb7d[_0x1edf('0x2b')],_0x16fb85=_0xd8bb8c[_0x1edf('0x2c')],_0x25b91f=_0xd8bb8c[_0x1edf('0x2c')]+_0xd8bb8c[_0x1edf('0x2d')],_0x1bcf3e;if(_0x25b91f>=_0x105640){_0x25b91f=_0x105640;_0x1bcf3e=0xc8;}else{_0x1bcf3e=0xce;}_0x362e79[_0x1edf('0x28')](_0x1bcf3e);return _0x362e79[_0x1edf('0x2e')]('Content-Range',_0x16fb85+'-'+_0x25b91f+'/'+_0x105640)[_0x1edf('0x2a')](_0x23fb7d);}return null;};}function patchUpdates(_0x4f7a50){return function(_0x942631){try{jsonpatch[_0x1edf('0x2f')](_0x942631,_0x4f7a50,!![]);}catch(_0x3e13c9){return BPromise['reject'](_0x3e13c9);}return _0x942631[_0x1edf('0x30')]();};}function saveUpdates(_0x49e2b1,_0x400464){return function(_0xad9370){if(_0xad9370){return _0xad9370['update'](_0x49e2b1)[_0x1edf('0x31')](function(_0x454930){return _0x454930;});}return null;};}function removeEntity(_0x15cbad,_0x1f40d7){return function(_0x15e5ef){if(_0x15e5ef){return _0x15e5ef[_0x1edf('0x32')]()[_0x1edf('0x31')](function(){_0x15cbad[_0x1edf('0x28')](0xcc)[_0x1edf('0x29')]();});}};}function handleEntityNotFound(_0x37b9d5,_0x412f92){return function(_0x49cabe){if(!_0x49cabe){_0x37b9d5[_0x1edf('0x27')](0x194);}return _0x49cabe;};}function handleError(_0x467530,_0x3b3423){_0x3b3423=_0x3b3423||0x1f4;return function(_0x16798c){logger[_0x1edf('0x23')](_0x16798c[_0x1edf('0x33')]);if(_0x16798c[_0x1edf('0x34')]){delete _0x16798c[_0x1edf('0x34')];}_0x467530[_0x1edf('0x28')](_0x3b3423)[_0x1edf('0x35')](_0x16798c);};}exports[_0x1edf('0x36')]=function(_0x2be392,_0x4a4156){var _0x3aeca6={},_0x2ce5da={},_0x4cd819={'count':0x0,'rows':[]};var _0x58b084=db[_0x1edf('0x37')][_0x1edf('0x38')];_0x2ce5da[_0x1edf('0x39')]=_[_0x1edf('0x3a')](_0x58b084);_0x2ce5da[_0x1edf('0x3b')]=_[_0x1edf('0x3a')](_0x2be392[_0x1edf('0x3b')]);_0x2ce5da['filters']=_[_0x1edf('0x3c')](_0x2ce5da[_0x1edf('0x39')],_0x2ce5da[_0x1edf('0x3b')]);_0x3aeca6[_0x1edf('0x3d')]=_[_0x1edf('0x3c')](_0x2ce5da[_0x1edf('0x39')],qs[_0x1edf('0x3e')](_0x2be392[_0x1edf('0x3b')][_0x1edf('0x3e')]));_0x3aeca6[_0x1edf('0x3d')]=_0x3aeca6[_0x1edf('0x3d')]['length']?_0x3aeca6[_0x1edf('0x3d')]:_0x2ce5da[_0x1edf('0x39')];if(!_0x2be392[_0x1edf('0x3b')]['hasOwnProperty'](_0x1edf('0x3f'))){_0x3aeca6[_0x1edf('0x2d')]=qs[_0x1edf('0x2d')](_0x2be392[_0x1edf('0x3b')][_0x1edf('0x2d')]);_0x3aeca6[_0x1edf('0x2c')]=qs[_0x1edf('0x2c')](_0x2be392[_0x1edf('0x3b')][_0x1edf('0x2c')]);}_0x3aeca6[_0x1edf('0x40')]=qs[_0x1edf('0x41')](_0x2be392['query']['sort']);_0x3aeca6[_0x1edf('0x42')]=qs[_0x1edf('0x43')](_[_0x1edf('0x44')](_0x2be392[_0x1edf('0x3b')],_0x2ce5da[_0x1edf('0x43')]));if(_0x2be392[_0x1edf('0x3b')][_0x1edf('0x45')]){_0x3aeca6[_0x1edf('0x42')]=_[_0x1edf('0x46')](_0x3aeca6[_0x1edf('0x42')],{'$or':_['map'](_0x58b084,function(_0xcef674){if(_0xcef674[_0x1edf('0x47')][_0x1edf('0x48')]!==_0x1edf('0x49')){var _0x11a04e={};_0x11a04e[_0xcef674[_0x1edf('0x4a')]]={'$like':'%'+_0x2be392[_0x1edf('0x3b')][_0x1edf('0x45')]+'%'};return _0x11a04e;}})});}_0x3aeca6=_[_0x1edf('0x46')]({},_0x3aeca6,_0x2be392[_0x1edf('0x4b')]);var _0x4b9163={'where':_0x3aeca6['where']};return db[_0x1edf('0x37')]['count'](_0x4b9163)[_0x1edf('0x31')](function(_0x438218){_0x4cd819[_0x1edf('0x2b')]=_0x438218;if(_0x2be392[_0x1edf('0x3b')][_0x1edf('0x4c')]){_0x3aeca6[_0x1edf('0x4d')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x1edf('0x4e')](_0x3aeca6);})['then'](function(_0x454392){_0x4cd819[_0x1edf('0x4f')]=_0x454392;return _0x4cd819;})['then'](respondWithFilteredResult(_0x4a4156,_0x3aeca6))[_0x1edf('0x26')](handleError(_0x4a4156,null));};exports[_0x1edf('0x50')]=function(_0x3af225,_0x437c9e){var _0x4617a0={'raw':![],'where':{'id':_0x3af225[_0x1edf('0x51')]['id']}},_0x2af9a8={};_0x2af9a8[_0x1edf('0x39')]=_[_0x1edf('0x3a')](db[_0x1edf('0x37')]['rawAttributes']);_0x2af9a8[_0x1edf('0x3b')]=_['keys'](_0x3af225[_0x1edf('0x3b')]);_0x2af9a8[_0x1edf('0x43')]=_[_0x1edf('0x3c')](_0x2af9a8[_0x1edf('0x39')],_0x2af9a8[_0x1edf('0x3b')]);_0x4617a0['attributes']=_[_0x1edf('0x3c')](_0x2af9a8[_0x1edf('0x39')],qs['fields'](_0x3af225['query'][_0x1edf('0x3e')]));_0x4617a0[_0x1edf('0x3d')]=_0x4617a0[_0x1edf('0x3d')][_0x1edf('0x52')]?_0x4617a0[_0x1edf('0x3d')]:_0x2af9a8[_0x1edf('0x39')];if(_0x3af225[_0x1edf('0x3b')]['includeAll']){_0x4617a0[_0x1edf('0x4d')]=[{'all':!![]}];}_0x4617a0=_[_0x1edf('0x46')]({},_0x4617a0,_0x3af225['options']);return db['FreshdeskAccount'][_0x1edf('0x53')](_0x4617a0)[_0x1edf('0x31')](handleEntityNotFound(_0x437c9e,null))[_0x1edf('0x31')](respondWithResult(_0x437c9e,null))[_0x1edf('0x26')](handleError(_0x437c9e,null));};exports[_0x1edf('0x54')]=function(_0x45b073,_0xa9f933){return db['FreshdeskAccount']['create'](_0x45b073[_0x1edf('0x55')],{})['then'](respondWithResult(_0xa9f933,0xc9))[_0x1edf('0x26')](handleError(_0xa9f933,null));};exports[_0x1edf('0x56')]=function(_0x466068,_0x4122b1){if(_0x466068[_0x1edf('0x55')]['id']){delete _0x466068[_0x1edf('0x55')]['id'];}return db[_0x1edf('0x37')]['find']({'where':{'id':_0x466068['params']['id']}})[_0x1edf('0x31')](handleEntityNotFound(_0x4122b1,null))[_0x1edf('0x31')](saveUpdates(_0x466068['body'],null))['then'](respondWithResult(_0x4122b1,null))['catch'](handleError(_0x4122b1,null));};exports[_0x1edf('0x32')]=function(_0x14adc6,_0x6720aa){return db['FreshdeskAccount'][_0x1edf('0x53')]({'where':{'id':_0x14adc6[_0x1edf('0x51')]['id']}})[_0x1edf('0x31')](handleEntityNotFound(_0x6720aa,null))[_0x1edf('0x31')](removeEntity(_0x6720aa,null))['catch'](handleError(_0x6720aa,null));};exports['getConfigurations']=function(_0x1a0eb9,_0x31c002,_0x5948ee){var _0x14b4c3={};var _0x55d894={};var _0x1c322d;var _0x244fe1;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x1a0eb9[_0x1edf('0x51')]['id']}})[_0x1edf('0x31')](handleEntityNotFound(_0x31c002,null))['then'](function(_0x4372c7){if(_0x4372c7){_0x1c322d=_0x4372c7;_0x55d894[_0x1edf('0x39')]=_[_0x1edf('0x3a')](db['FreshdeskConfiguration']['rawAttributes']);_0x55d894[_0x1edf('0x3b')]=_[_0x1edf('0x3a')](_0x1a0eb9[_0x1edf('0x3b')]);_0x55d894['filters']=_[_0x1edf('0x3c')](_0x55d894[_0x1edf('0x39')],_0x55d894[_0x1edf('0x3b')]);_0x14b4c3[_0x1edf('0x3d')]=_[_0x1edf('0x3c')](_0x55d894[_0x1edf('0x39')],qs[_0x1edf('0x3e')](_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x3e')]));_0x14b4c3[_0x1edf('0x3d')]=_0x14b4c3[_0x1edf('0x3d')]['length']?_0x14b4c3['attributes']:_0x55d894[_0x1edf('0x39')];_0x14b4c3[_0x1edf('0x40')]=qs[_0x1edf('0x41')](_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x41')]);_0x14b4c3[_0x1edf('0x42')]=qs[_0x1edf('0x43')](_[_0x1edf('0x44')](_0x1a0eb9[_0x1edf('0x3b')],_0x55d894[_0x1edf('0x43')]));if(_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x45')]){_0x14b4c3[_0x1edf('0x42')]=_[_0x1edf('0x46')](_0x14b4c3[_0x1edf('0x42')],{'$or':_[_0x1edf('0x57')](_0x14b4c3['attributes'],function(_0x477f1c){var _0xbadd41={};_0xbadd41[_0x477f1c]={'$like':'%'+_0x1a0eb9[_0x1edf('0x3b')]['filter']+'%'};return _0xbadd41;})});}_0x14b4c3=_[_0x1edf('0x46')]({},_0x14b4c3,_0x1a0eb9[_0x1edf('0x4b')]);return _0x1c322d[_0x1edf('0x58')](_0x14b4c3);}})[_0x1edf('0x31')](function(_0x3cb9e4){if(_0x3cb9e4){_0x244fe1=_0x3cb9e4[_0x1edf('0x52')];if(!_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x59')](_0x1edf('0x3f'))){_0x14b4c3[_0x1edf('0x2d')]=qs[_0x1edf('0x2d')](_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x2d')]);_0x14b4c3[_0x1edf('0x2c')]=qs[_0x1edf('0x2c')](_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x2c')]);}return _0x1c322d['getConfigurations'](_0x14b4c3);}})['then'](function(_0x5086a7){if(_0x5086a7){return _0x5086a7?{'count':_0x244fe1,'rows':_0x5086a7}:null;}})[_0x1edf('0x31')](respondWithResult(_0x31c002,null))[_0x1edf('0x26')](handleError(_0x31c002,null));};exports[_0x1edf('0x5a')]=function(_0x2b43c0,_0x1d8b6f,_0x33d98b){if(_0x2b43c0[_0x1edf('0x55')]['id']){delete _0x2b43c0[_0x1edf('0x55')]['id'];}return db[_0x1edf('0x37')]['findOne']({'where':{'id':_0x2b43c0[_0x1edf('0x51')]['id']}})[_0x1edf('0x31')](handleEntityNotFound(_0x1d8b6f,null))[_0x1edf('0x31')](function(_0x358e0f){if(_0x358e0f){_0x2b43c0[_0x1edf('0x55')]['AccountId']=_0x358e0f['id'];_0x2b43c0['body'][_0x1edf('0x5b')]=integrations[_0x1edf('0x5c')](_0x2b43c0[_0x1edf('0x55')][_0x1edf('0x5d')],_0x2b43c0[_0x1edf('0x55')][_0x1edf('0x47')]);_0x2b43c0[_0x1edf('0x55')][_0x1edf('0x5e')]=integrations['getDescriptions'](_0x2b43c0[_0x1edf('0x55')][_0x1edf('0x5d')],_0x2b43c0[_0x1edf('0x55')][_0x1edf('0x47')]);return db[_0x1edf('0x5f')][_0x1edf('0x54')](_0x2b43c0[_0x1edf('0x55')],{'include':[{'model':db[_0x1edf('0x60')],'as':_0x1edf('0x5b')},{'model':db[_0x1edf('0x60')],'as':_0x1edf('0x5e')}]});}return null;})[_0x1edf('0x31')](respondWithResult(_0x1d8b6f,null))[_0x1edf('0x26')](handleError(_0x1d8b6f,null));};exports[_0x1edf('0x61')]=function(_0x219fa0,_0x260bd7,_0x463a99){var _0xdb37b5='';return db['FreshdeskAccount'][_0x1edf('0x62')]({'where':{'id':_0x219fa0[_0x1edf('0x51')]['id']},'attributes':['id',_0x1edf('0x63'),_0x1edf('0x64')]})['then'](handleEntityNotFound(_0x260bd7,null))['then'](function(_0x414e69){if(_0x414e69){_0xdb37b5=_0x414e69[_0x1edf('0x63')];var _0x1d4011=_0xdb37b5[_0x1edf('0x65')](-0x1);if(_0x1d4011==='/'){_0xdb37b5=_0xdb37b5[_0x1edf('0x66')](0x0,_0xdb37b5[_0x1edf('0x67')](_0x1d4011));}return rp({'method':_0x1edf('0x68'),'uri':util['format'](_0x1edf('0x69'),_0xdb37b5,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x1edf('0x6a')](_0x1edf('0x6b'),new Buffer(util['format'](_0x1edf('0x6c'),_0x414e69[_0x1edf('0x64')]))[_0x1edf('0x6d')](_0x1edf('0x6e')))},'json':!![]});}})[_0x1edf('0x31')](function(_0x328d25){if(_0x328d25){var _0x172b6a=['requester',_0x1edf('0x6f'),_0x1edf('0x70'),'description','status',_0x1edf('0x71'),_0x1edf('0x72'),'source',_0x1edf('0x73'),_0x1edf('0x72'),_0x1edf('0x74')];_[_0x1edf('0x75')](_0x328d25,function(_0x4f53bc){return _0x172b6a[_0x1edf('0x76')](_0x4f53bc['name'])||!_0x4f53bc[_0x1edf('0x77')]&&_0x4f53bc['type']!==_0x1edf('0x78')&&_0x4f53bc['type']!==_0x1edf('0x79');});return{'count':_0x328d25['length'],'rows':_['map'](_0x328d25,function(_0x43d2d){return{'id':_0x43d2d[_0x1edf('0x34')],'name':_0x43d2d['label'],'custom':!_0x43d2d[_0x1edf('0x77')],'options':_0x43d2d[_0x1edf('0x7a')]?_['map'](_0x43d2d[_0x1edf('0x7a')],function(_0x27519b){return{'name':_[_0x1edf('0x7b')](_0x27519b),'value':_0x27519b};}):[]};})};}})[_0x1edf('0x31')](respondWithResult(_0x260bd7,null))[_0x1edf('0x26')](function(_0x568591){var _0x32400b=_0x219fa0['query'][_0x1edf('0x7c')]?0x1f4:_0x568591['statusCode']||0x1f4;logger[_0x1edf('0x23')](_0x1edf('0x7d'),_0x1edf('0x61'),_0x32400b,JSON[_0x1edf('0x22')](_0x568591));delete _0x568591[_0x1edf('0x34')];if(_0x32400b===0x191){_0x32400b=0x190;}_0x260bd7[_0x1edf('0x28')](_0x32400b)[_0x1edf('0x35')](_0x219fa0['query'][_0x1edf('0x7c')]?{'message':_0x1edf('0x7e'),'statusCode':_0x568591['statusCode']}:_0x568591);});};
\ No newline at end of file
+var _0x6b72=['sort','where','filters','pick','filter','type','key','VIRTUAL','FreshdeskAccount','count','includeAll','rows','show','params','keys','include','merge','options','find','catch','create','body','getConfigurations','findOne','map','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','toString','base64','requester','agent','group','source','company','remove','includes','default','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','stack','name','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x489f6e,_0x5a7a29){var _0x2c676c=function(_0x2704e1){while(--_0x2704e1){_0x489f6e['push'](_0x489f6e['shift']());}};_0x2c676c(++_0x5a7a29);}(_0x6b72,0x19d));var _0x26b7=function(_0x12078f,_0xee409f){_0x12078f=_0x12078f-0x0;var _0x1b5894=_0x6b72[_0x12078f];return _0x1b5894;};'use strict';var pdf=require(_0x26b7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x26b7('0x1'));var zipdir=require(_0x26b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x26b7('0x3'));var moment=require(_0x26b7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x26b7('0x5'));var path=require(_0x26b7('0x6'));var sox=require(_0x26b7('0x7'));var csv=require(_0x26b7('0x8'));var ejs=require(_0x26b7('0x9'));var fs=require('fs');var _=require(_0x26b7('0xa'));var squel=require(_0x26b7('0xb'));var crypto=require(_0x26b7('0xc'));var jsforce=require(_0x26b7('0xd'));var deskjs=require(_0x26b7('0xe'));var toCsv=require(_0x26b7('0x8'));var querystring=require('querystring');var Papa=require(_0x26b7('0xf'));var Redis=require(_0x26b7('0x10'));var authService=require(_0x26b7('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x26b7('0x12'));var logger=require('../../config/logger')(_0x26b7('0x13'));var utils=require('../../config/utils');var config=require(_0x26b7('0x14'));var db=require(_0x26b7('0x15'))['db'];var integrations=require(_0x26b7('0x16'));var jayson=require(_0x26b7('0x17'));var client=jayson['client'][_0x26b7('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3def02,_0x28cf6d,_0x3a8d9d){if(_0x3a8d9d){var _0x2bf049=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2bf049[_0x26b7('0x19')](_0x28cf6d)){return _0x3def02;}else{throw new Error(_0x26b7('0x1a'));}}else{return _0x3def02;}}function respondWithRpcPromise(_0xf54dee,_0x21094d,_0x20af5f,_0x57cae7){return new BPromise(function(_0x3304b1,_0x42f377){var _0x1ed5c0=_0x57cae7||client;return _0x1ed5c0[_0x26b7('0x1b')](_0xf54dee,_0x20af5f)['then'](function(_0x298ca4){logger[_0x26b7('0x1c')](_0x26b7('0x1d'),_0x21094d,_0x26b7('0x1e'));logger[_0x26b7('0x1f')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x21094d,_0x26b7('0x1e'),JSON[_0x26b7('0x20')](_0x298ca4));if(_0x298ca4[_0x26b7('0x21')]){if(_0x298ca4['error']['code']===0x1f4){logger[_0x26b7('0x21')](_0x26b7('0x1d'),_0x21094d,_0x298ca4[_0x26b7('0x21')][_0x26b7('0x22')]);return _0x42f377(_0x298ca4['error'][_0x26b7('0x22')]);}logger[_0x26b7('0x21')]('FreshdeskAccount,\x20%s,\x20%s',_0x21094d,_0x298ca4['error']['message']);return _0x3304b1(_0x298ca4[_0x26b7('0x21')][_0x26b7('0x22')]);}else{logger[_0x26b7('0x1c')](_0x26b7('0x1d'),_0x21094d,_0x26b7('0x1e'));_0x3304b1(_0x298ca4['result']['message']);}})['catch'](function(_0x105036){logger[_0x26b7('0x21')](_0x26b7('0x1d'),_0x21094d,_0x105036);_0x42f377(_0x105036);});});}function respondWithStatusCode(_0x2f751b,_0x15414b){_0x15414b=_0x15414b||0xcc;return function(_0x3bc867){if(_0x3bc867){return _0x2f751b[_0x26b7('0x23')](_0x15414b);}return _0x2f751b[_0x26b7('0x24')](_0x15414b)[_0x26b7('0x25')]();};}function respondWithResult(_0x5042f3,_0x49eade){_0x49eade=_0x49eade||0xc8;return function(_0x16562d){if(_0x16562d){return _0x5042f3['status'](_0x49eade)[_0x26b7('0x26')](_0x16562d);}};}function respondWithFilteredResult(_0x203e0f,_0x172760){return function(_0xc16640){if(_0xc16640){var _0x2c2618=_0xc16640['count'],_0x39b567=_0x172760['offset'],_0x1fbfe1=_0x172760[_0x26b7('0x27')]+_0x172760[_0x26b7('0x28')],_0x38dff9;if(_0x1fbfe1>=_0x2c2618){_0x1fbfe1=_0x2c2618;_0x38dff9=0xc8;}else{_0x38dff9=0xce;}_0x203e0f[_0x26b7('0x24')](_0x38dff9);return _0x203e0f[_0x26b7('0x29')](_0x26b7('0x2a'),_0x39b567+'-'+_0x1fbfe1+'/'+_0x2c2618)[_0x26b7('0x26')](_0xc16640);}return null;};}function patchUpdates(_0x2edc29){return function(_0x100954){try{jsonpatch[_0x26b7('0x2b')](_0x100954,_0x2edc29,!![]);}catch(_0x555669){return BPromise['reject'](_0x555669);}return _0x100954[_0x26b7('0x2c')]();};}function saveUpdates(_0x9822c6,_0x5f0335){return function(_0x3d206c){if(_0x3d206c){return _0x3d206c[_0x26b7('0x2d')](_0x9822c6)[_0x26b7('0x2e')](function(_0x3382f3){return _0x3382f3;});}return null;};}function removeEntity(_0x332216,_0x30398c){return function(_0x514628){if(_0x514628){return _0x514628['destroy']()[_0x26b7('0x2e')](function(){_0x332216[_0x26b7('0x24')](0xcc)[_0x26b7('0x25')]();});}};}function handleEntityNotFound(_0x5a93d3,_0x9b1ba1){return function(_0x38e9d8){if(!_0x38e9d8){_0x5a93d3[_0x26b7('0x23')](0x194);}return _0x38e9d8;};}function handleError(_0x28a85f,_0x3c530f){_0x3c530f=_0x3c530f||0x1f4;return function(_0x5786f3){logger[_0x26b7('0x21')](_0x5786f3[_0x26b7('0x2f')]);if(_0x5786f3[_0x26b7('0x30')]){delete _0x5786f3[_0x26b7('0x30')];}_0x28a85f[_0x26b7('0x24')](_0x3c530f)['send'](_0x5786f3);};}exports['index']=function(_0xf4d7dc,_0x5839fb){var _0x49f4e3={},_0x35f888={},_0x3c6c56={'count':0x0,'rows':[]};var _0x176930=db['FreshdeskAccount'][_0x26b7('0x31')];_0x35f888[_0x26b7('0x32')]=_['keys'](_0x176930);_0x35f888['query']=_['keys'](_0xf4d7dc[_0x26b7('0x33')]);_0x35f888['filters']=_[_0x26b7('0x34')](_0x35f888[_0x26b7('0x32')],_0x35f888[_0x26b7('0x33')]);_0x49f4e3[_0x26b7('0x35')]=_[_0x26b7('0x34')](_0x35f888['model'],qs[_0x26b7('0x36')](_0xf4d7dc[_0x26b7('0x33')][_0x26b7('0x36')]));_0x49f4e3['attributes']=_0x49f4e3['attributes'][_0x26b7('0x37')]?_0x49f4e3[_0x26b7('0x35')]:_0x35f888['model'];if(!_0xf4d7dc[_0x26b7('0x33')][_0x26b7('0x38')](_0x26b7('0x39'))){_0x49f4e3[_0x26b7('0x28')]=qs[_0x26b7('0x28')](_0xf4d7dc[_0x26b7('0x33')][_0x26b7('0x28')]);_0x49f4e3[_0x26b7('0x27')]=qs[_0x26b7('0x27')](_0xf4d7dc[_0x26b7('0x33')][_0x26b7('0x27')]);}_0x49f4e3[_0x26b7('0x3a')]=qs[_0x26b7('0x3b')](_0xf4d7dc[_0x26b7('0x33')]['sort']);_0x49f4e3[_0x26b7('0x3c')]=qs[_0x26b7('0x3d')](_[_0x26b7('0x3e')](_0xf4d7dc[_0x26b7('0x33')],_0x35f888[_0x26b7('0x3d')]));if(_0xf4d7dc[_0x26b7('0x33')][_0x26b7('0x3f')]){_0x49f4e3[_0x26b7('0x3c')]=_['merge'](_0x49f4e3[_0x26b7('0x3c')],{'$or':_['map'](_0x176930,function(_0x5f3891){if(_0x5f3891[_0x26b7('0x40')][_0x26b7('0x41')]!==_0x26b7('0x42')){var _0x45c6a0={};_0x45c6a0[_0x5f3891['field']]={'$like':'%'+_0xf4d7dc[_0x26b7('0x33')]['filter']+'%'};return _0x45c6a0;}})});}_0x49f4e3=_['merge']({},_0x49f4e3,_0xf4d7dc['options']);var _0x236ca4={'where':_0x49f4e3[_0x26b7('0x3c')]};return db[_0x26b7('0x43')][_0x26b7('0x44')](_0x236ca4)[_0x26b7('0x2e')](function(_0x13824d){_0x3c6c56[_0x26b7('0x44')]=_0x13824d;if(_0xf4d7dc[_0x26b7('0x33')][_0x26b7('0x45')]){_0x49f4e3['include']=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x49f4e3);})[_0x26b7('0x2e')](function(_0x57359e){_0x3c6c56[_0x26b7('0x46')]=_0x57359e;return _0x3c6c56;})['then'](respondWithFilteredResult(_0x5839fb,_0x49f4e3))['catch'](handleError(_0x5839fb,null));};exports[_0x26b7('0x47')]=function(_0x185c6e,_0x492cdb){var _0x42d1ac={'raw':![],'where':{'id':_0x185c6e[_0x26b7('0x48')]['id']}},_0x3716a9={};_0x3716a9[_0x26b7('0x32')]=_['keys'](db[_0x26b7('0x43')][_0x26b7('0x31')]);_0x3716a9[_0x26b7('0x33')]=_[_0x26b7('0x49')](_0x185c6e[_0x26b7('0x33')]);_0x3716a9['filters']=_[_0x26b7('0x34')](_0x3716a9[_0x26b7('0x32')],_0x3716a9['query']);_0x42d1ac['attributes']=_[_0x26b7('0x34')](_0x3716a9[_0x26b7('0x32')],qs[_0x26b7('0x36')](_0x185c6e[_0x26b7('0x33')][_0x26b7('0x36')]));_0x42d1ac[_0x26b7('0x35')]=_0x42d1ac['attributes']['length']?_0x42d1ac[_0x26b7('0x35')]:_0x3716a9[_0x26b7('0x32')];if(_0x185c6e[_0x26b7('0x33')][_0x26b7('0x45')]){_0x42d1ac[_0x26b7('0x4a')]=[{'all':!![]}];}_0x42d1ac=_[_0x26b7('0x4b')]({},_0x42d1ac,_0x185c6e[_0x26b7('0x4c')]);return db['FreshdeskAccount'][_0x26b7('0x4d')](_0x42d1ac)[_0x26b7('0x2e')](handleEntityNotFound(_0x492cdb,null))[_0x26b7('0x2e')](respondWithResult(_0x492cdb,null))[_0x26b7('0x4e')](handleError(_0x492cdb,null));};exports['create']=function(_0x1fe056,_0x2a49f1){return db[_0x26b7('0x43')][_0x26b7('0x4f')](_0x1fe056[_0x26b7('0x50')],{})['then'](respondWithResult(_0x2a49f1,0xc9))[_0x26b7('0x4e')](handleError(_0x2a49f1,null));};exports[_0x26b7('0x2d')]=function(_0x2b7b0e,_0x42f4b3){if(_0x2b7b0e[_0x26b7('0x50')]['id']){delete _0x2b7b0e[_0x26b7('0x50')]['id'];}return db[_0x26b7('0x43')][_0x26b7('0x4d')]({'where':{'id':_0x2b7b0e[_0x26b7('0x48')]['id']}})[_0x26b7('0x2e')](handleEntityNotFound(_0x42f4b3,null))[_0x26b7('0x2e')](saveUpdates(_0x2b7b0e[_0x26b7('0x50')],null))[_0x26b7('0x2e')](respondWithResult(_0x42f4b3,null))[_0x26b7('0x4e')](handleError(_0x42f4b3,null));};exports['destroy']=function(_0x2c8129,_0x2edc77){return db[_0x26b7('0x43')][_0x26b7('0x4d')]({'where':{'id':_0x2c8129['params']['id']}})[_0x26b7('0x2e')](handleEntityNotFound(_0x2edc77,null))[_0x26b7('0x2e')](removeEntity(_0x2edc77,null))['catch'](handleError(_0x2edc77,null));};exports[_0x26b7('0x51')]=function(_0xe10eb,_0x2594b2,_0x18463f){var _0x283815={};var _0x222469={};var _0x955d79;var _0x45a0f8;return db['FreshdeskAccount'][_0x26b7('0x52')]({'where':{'id':_0xe10eb[_0x26b7('0x48')]['id']}})[_0x26b7('0x2e')](handleEntityNotFound(_0x2594b2,null))['then'](function(_0x276659){if(_0x276659){_0x955d79=_0x276659;_0x222469[_0x26b7('0x32')]=_[_0x26b7('0x49')](db['FreshdeskConfiguration'][_0x26b7('0x31')]);_0x222469[_0x26b7('0x33')]=_[_0x26b7('0x49')](_0xe10eb[_0x26b7('0x33')]);_0x222469[_0x26b7('0x3d')]=_[_0x26b7('0x34')](_0x222469[_0x26b7('0x32')],_0x222469[_0x26b7('0x33')]);_0x283815['attributes']=_['intersection'](_0x222469[_0x26b7('0x32')],qs[_0x26b7('0x36')](_0xe10eb['query'][_0x26b7('0x36')]));_0x283815[_0x26b7('0x35')]=_0x283815[_0x26b7('0x35')][_0x26b7('0x37')]?_0x283815[_0x26b7('0x35')]:_0x222469[_0x26b7('0x32')];_0x283815[_0x26b7('0x3a')]=qs['sort'](_0xe10eb[_0x26b7('0x33')][_0x26b7('0x3b')]);_0x283815['where']=qs['filters'](_[_0x26b7('0x3e')](_0xe10eb[_0x26b7('0x33')],_0x222469[_0x26b7('0x3d')]));if(_0xe10eb[_0x26b7('0x33')][_0x26b7('0x3f')]){_0x283815[_0x26b7('0x3c')]=_['merge'](_0x283815[_0x26b7('0x3c')],{'$or':_[_0x26b7('0x53')](_0x283815['attributes'],function(_0x4f5b9f){var _0x366320={};_0x366320[_0x4f5b9f]={'$like':'%'+_0xe10eb[_0x26b7('0x33')][_0x26b7('0x3f')]+'%'};return _0x366320;})});}_0x283815=_[_0x26b7('0x4b')]({},_0x283815,_0xe10eb[_0x26b7('0x4c')]);return _0x955d79[_0x26b7('0x51')](_0x283815);}})['then'](function(_0x5545d2){if(_0x5545d2){_0x45a0f8=_0x5545d2['length'];if(!_0xe10eb[_0x26b7('0x33')][_0x26b7('0x38')](_0x26b7('0x39'))){_0x283815[_0x26b7('0x28')]=qs[_0x26b7('0x28')](_0xe10eb[_0x26b7('0x33')][_0x26b7('0x28')]);_0x283815[_0x26b7('0x27')]=qs[_0x26b7('0x27')](_0xe10eb['query'][_0x26b7('0x27')]);}return _0x955d79[_0x26b7('0x51')](_0x283815);}})[_0x26b7('0x2e')](function(_0x57b493){if(_0x57b493){return _0x57b493?{'count':_0x45a0f8,'rows':_0x57b493}:null;}})[_0x26b7('0x2e')](respondWithResult(_0x2594b2,null))['catch'](handleError(_0x2594b2,null));};exports[_0x26b7('0x54')]=function(_0x1b219c,_0x2ba693,_0x302868){if(_0x1b219c['body']['id']){delete _0x1b219c[_0x26b7('0x50')]['id'];}return db[_0x26b7('0x43')]['findOne']({'where':{'id':_0x1b219c[_0x26b7('0x48')]['id']}})[_0x26b7('0x2e')](handleEntityNotFound(_0x2ba693,null))[_0x26b7('0x2e')](function(_0x513de3){if(_0x513de3){_0x1b219c[_0x26b7('0x50')][_0x26b7('0x55')]=_0x513de3['id'];_0x1b219c[_0x26b7('0x50')][_0x26b7('0x56')]=integrations[_0x26b7('0x57')](_0x1b219c[_0x26b7('0x50')][_0x26b7('0x58')],_0x1b219c[_0x26b7('0x50')][_0x26b7('0x40')]);_0x1b219c['body'][_0x26b7('0x59')]=integrations[_0x26b7('0x5a')](_0x1b219c['body'][_0x26b7('0x58')],_0x1b219c[_0x26b7('0x50')][_0x26b7('0x40')]);return db[_0x26b7('0x5b')][_0x26b7('0x4f')](_0x1b219c[_0x26b7('0x50')],{'include':[{'model':db[_0x26b7('0x5c')],'as':_0x26b7('0x56')},{'model':db[_0x26b7('0x5c')],'as':_0x26b7('0x59')}]});}return null;})['then'](respondWithResult(_0x2ba693,null))[_0x26b7('0x4e')](handleError(_0x2ba693,null));};exports['getFields']=function(_0x248e1c,_0x239196,_0x2e994e){var _0x39f570='';return db['FreshdeskAccount'][_0x26b7('0x52')]({'where':{'id':_0x248e1c['params']['id']},'attributes':['id',_0x26b7('0x5d'),_0x26b7('0x5e')]})[_0x26b7('0x2e')](handleEntityNotFound(_0x239196,null))[_0x26b7('0x2e')](function(_0x53cacc){if(_0x53cacc){_0x39f570=_0x53cacc[_0x26b7('0x5d')];var _0x201223=_0x39f570[_0x26b7('0x5f')](-0x1);if(_0x201223==='/'){_0x39f570=_0x39f570['substring'](0x0,_0x39f570[_0x26b7('0x60')](_0x201223));}return rp({'method':_0x26b7('0x61'),'uri':util[_0x26b7('0x62')](_0x26b7('0x63'),_0x39f570,_0x26b7('0x64')),'headers':{'Authorization':util[_0x26b7('0x62')]('Basic\x20%s',new Buffer(util[_0x26b7('0x62')]('%s:X',_0x53cacc['apiKey']))[_0x26b7('0x65')](_0x26b7('0x66')))},'json':!![]});}})[_0x26b7('0x2e')](function(_0x50576b){if(_0x50576b){var _0x297138=[_0x26b7('0x67'),'subject',_0x26b7('0x68'),'description',_0x26b7('0x24'),'priority',_0x26b7('0x69'),_0x26b7('0x6a'),'ticket_type',_0x26b7('0x69'),_0x26b7('0x6b')];_[_0x26b7('0x6c')](_0x50576b,function(_0x5dafd5){return _0x297138[_0x26b7('0x6d')](_0x5dafd5[_0x26b7('0x30')])||!_0x5dafd5[_0x26b7('0x6e')]&&_0x5dafd5[_0x26b7('0x40')]!=='custom_text'&&_0x5dafd5['type']!==_0x26b7('0x6f');});return{'count':_0x50576b[_0x26b7('0x37')],'rows':_[_0x26b7('0x53')](_0x50576b,function(_0xd11307){return{'id':_0xd11307[_0x26b7('0x30')],'name':_0xd11307[_0x26b7('0x70')],'custom':!_0xd11307[_0x26b7('0x6e')],'options':_0xd11307[_0x26b7('0x71')]?_[_0x26b7('0x53')](_0xd11307[_0x26b7('0x71')],function(_0x39286b){return{'name':_[_0x26b7('0x72')](_0x39286b),'value':_0x39286b};}):[]};})};}})[_0x26b7('0x2e')](respondWithResult(_0x239196,null))[_0x26b7('0x4e')](function(_0x26dff2){var _0x45b744=_0x248e1c[_0x26b7('0x33')][_0x26b7('0x19')]?0x1f4:_0x26dff2[_0x26b7('0x73')]||0x1f4;logger[_0x26b7('0x21')](_0x26b7('0x74'),'getFields',_0x45b744,JSON[_0x26b7('0x20')](_0x26dff2));delete _0x26dff2[_0x26b7('0x30')];if(_0x45b744===0x191){_0x45b744=0x190;}_0x239196[_0x26b7('0x24')](_0x45b744)['send'](_0x248e1c[_0x26b7('0x33')][_0x26b7('0x19')]?{'message':_0x26b7('0x75'),'statusCode':_0x26dff2[_0x26b7('0x73')]}:_0x26dff2);});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
index 1d9c1cf..99c80db 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3acc=['path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x203cf5,_0x8421e0){var _0x17a51d=function(_0x466b7a){while(--_0x466b7a){_0x203cf5['push'](_0x203cf5['shift']());}};_0x17a51d(++_0x8421e0);}(_0x3acc,0x119));var _0xc3ac=function(_0x11e9d7,_0x4a2024){_0x11e9d7=_0x11e9d7-0x0;var _0x35f9d7=_0x3acc[_0x11e9d7];return _0x35f9d7;};'use strict';var _=require(_0xc3ac('0x0'));var util=require(_0xc3ac('0x1'));var logger=require(_0xc3ac('0x2'))(_0xc3ac('0x3'));var moment=require(_0xc3ac('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3ac('0x5'));var rimraf=require('rimraf');var config=require(_0xc3ac('0x6'));var attributes=require(_0xc3ac('0x7'));var integrations=require(_0xc3ac('0x8'));module[_0xc3ac('0x9')]=function(_0x23f229,_0x27058b){return _0x23f229[_0xc3ac('0xa')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf239=['../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','./intFreshdeskAccount.attributes'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xf239,0xd4));var _0x9f23=function(_0x4d2263,_0x3fbf0d){_0x4d2263=_0x4d2263-0x0;var _0x24aba0=_0xf239[_0x4d2263];return _0x24aba0;};'use strict';var _=require(_0x9f23('0x0'));var util=require(_0x9f23('0x1'));var logger=require(_0x9f23('0x2'))(_0x9f23('0x3'));var moment=require('moment');var BPromise=require(_0x9f23('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f23('0x5'));var rimraf=require(_0x9f23('0x6'));var config=require('../../config/environment');var attributes=require(_0x9f23('0x7'));var integrations=require(_0x9f23('0x8'));module['exports']=function(_0x4b18b1,_0x49c919){return _0x4b18b1['define'](_0x9f23('0x9'),attributes,{'tableName':_0x9f23('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
index 6890ba1..dd2d227 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda76=['jayson/promise','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetFreshdeskAccount','ShowFreshdeskAccount','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5e6508,_0x226aa6){var _0x45bad8=function(_0x4007dd){while(--_0x4007dd){_0x5e6508['push'](_0x5e6508['shift']());}};_0x45bad8(++_0x226aa6);}(_0xda76,0xc9));var _0x6da7=function(_0x55cb38,_0xd758bf){_0x55cb38=_0x55cb38-0x0;var _0xc89025=_0xda76[_0x55cb38];return _0xc89025;};'use strict';var _=require(_0x6da7('0x0'));var util=require(_0x6da7('0x1'));var moment=require(_0x6da7('0x2'));var BPromise=require(_0x6da7('0x3'));var rs=require(_0x6da7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6da7('0x5'))['db'];var utils=require(_0x6da7('0x6'));var logger=require(_0x6da7('0x7'))(_0x6da7('0x8'));var config=require('../../config/environment');var jayson=require(_0x6da7('0x9'));var client=jayson['client'][_0x6da7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5058f1,_0x40ad1a,_0x35c93c){return new BPromise(function(_0x500a50,_0x43bbdb){return client[_0x6da7('0xb')](_0x5058f1,_0x35c93c)['then'](function(_0x562b37){logger[_0x6da7('0xc')](_0x6da7('0xd'),_0x40ad1a,_0x6da7('0xe'));logger[_0x6da7('0xf')](_0x6da7('0x10'),_0x40ad1a,'request\x20sent',JSON[_0x6da7('0x11')](_0x562b37));if(_0x562b37[_0x6da7('0x12')]){if(_0x562b37[_0x6da7('0x12')][_0x6da7('0x13')]===0x1f4){logger[_0x6da7('0x12')](_0x6da7('0xd'),_0x40ad1a,_0x562b37['error'][_0x6da7('0x14')]);return _0x43bbdb(_0x562b37[_0x6da7('0x12')][_0x6da7('0x14')]);}logger[_0x6da7('0x12')](_0x6da7('0xd'),_0x40ad1a,_0x562b37[_0x6da7('0x12')][_0x6da7('0x14')]);return _0x500a50(_0x562b37[_0x6da7('0x12')]['message']);}else{logger[_0x6da7('0xc')](_0x6da7('0xd'),_0x40ad1a,'request\x20sent');_0x500a50(_0x562b37['result'][_0x6da7('0x14')]);}})['catch'](function(_0x3ed245){logger['error'](_0x6da7('0xd'),_0x40ad1a,_0x3ed245);_0x43bbdb(_0x3ed245);});});}exports['GetFreshdeskAccount']=function(_0xb15933){var _0x3a0cc7=this;return new Promise(function(_0x291ddb,_0x106778){return db[_0x6da7('0x15')][_0x6da7('0x16')]({'raw':_0xb15933[_0x6da7('0x17')]?_0xb15933[_0x6da7('0x17')][_0x6da7('0x18')]===undefined?!![]:![]:!![],'where':_0xb15933['options']?_0xb15933['options']['where']||null:null,'attributes':_0xb15933[_0x6da7('0x17')]?_0xb15933[_0x6da7('0x17')][_0x6da7('0x19')]||null:null,'limit':_0xb15933[_0x6da7('0x17')]?_0xb15933[_0x6da7('0x17')][_0x6da7('0x1a')]||null:null,'include':_0xb15933[_0x6da7('0x17')]?_0xb15933[_0x6da7('0x17')][_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0xb15933[_0x6da7('0x17')][_0x6da7('0x1b')],function(_0x5064d7){return{'model':db[_0x5064d7[_0x6da7('0x1d')]],'as':_0x5064d7['as'],'attributes':_0x5064d7[_0x6da7('0x19')],'include':_0x5064d7[_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0x5064d7[_0x6da7('0x1b')],function(_0x13c89b){return{'model':db[_0x13c89b[_0x6da7('0x1d')]],'as':_0x13c89b['as'],'attributes':_0x13c89b['attributes'],'include':_0x13c89b[_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0x13c89b['include'],function(_0xc79383){return{'model':db[_0xc79383[_0x6da7('0x1d')]],'as':_0xc79383['as'],'attributes':_0xc79383[_0x6da7('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6da7('0x1e')](function(_0x10a9d4){logger[_0x6da7('0xc')](_0x6da7('0x1f'),_0xb15933);logger[_0x6da7('0xf')]('GetFreshdeskAccount',_0xb15933,JSON[_0x6da7('0x11')](_0x10a9d4));_0x291ddb(_0x10a9d4);})['catch'](function(_0x37a466){logger[_0x6da7('0x12')](_0x6da7('0x1f'),_0x37a466['message'],_0xb15933);_0x106778(_0x3a0cc7['error'](0x1f4,_0x37a466[_0x6da7('0x14')]));});});};exports[_0x6da7('0x20')]=function(_0x5ae449){var _0x50f1dd=this;return new Promise(function(_0x43d0d3,_0x1b83e5){return db[_0x6da7('0x15')][_0x6da7('0x21')]({'raw':_0x5ae449[_0x6da7('0x17')]?_0x5ae449[_0x6da7('0x17')][_0x6da7('0x18')]===undefined?!![]:![]:!![],'where':_0x5ae449['options']?_0x5ae449[_0x6da7('0x17')][_0x6da7('0x22')]||null:null,'attributes':_0x5ae449[_0x6da7('0x17')]?_0x5ae449[_0x6da7('0x17')][_0x6da7('0x19')]||null:null,'include':_0x5ae449[_0x6da7('0x17')]?_0x5ae449[_0x6da7('0x17')][_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0x5ae449[_0x6da7('0x17')][_0x6da7('0x1b')],function(_0x1b5e00){return{'model':db[_0x1b5e00['model']],'as':_0x1b5e00['as'],'attributes':_0x1b5e00['attributes'],'include':_0x1b5e00[_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0x1b5e00[_0x6da7('0x1b')],function(_0x16030f){return{'model':db[_0x16030f[_0x6da7('0x1d')]],'as':_0x16030f['as'],'attributes':_0x16030f[_0x6da7('0x19')],'include':_0x16030f[_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0x16030f[_0x6da7('0x1b')],function(_0x437364){return{'model':db[_0x437364['model']],'as':_0x437364['as'],'attributes':_0x437364[_0x6da7('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bb8a3){logger[_0x6da7('0xc')](_0x6da7('0x20'),_0x5ae449);logger[_0x6da7('0xf')]('ShowFreshdeskAccount',_0x5ae449,JSON[_0x6da7('0x11')](_0x4bb8a3));_0x43d0d3(_0x4bb8a3);})['catch'](function(_0x4d214d){logger[_0x6da7('0x12')]('ShowFreshdeskAccount',_0x4d214d[_0x6da7('0x14')],_0x5ae449);_0x1b83e5(_0x50f1dd[_0x6da7('0x12')](0x1f4,_0x4d214d[_0x6da7('0x14')]));});});};
\ No newline at end of file
+var _0x13f3=['../../mysqldb','../../config/utils','rpc','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','FreshdeskAccount','findAll','options','where','attributes','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1f92ce,_0xed9ab){var _0xb0729a=function(_0x263c31){while(--_0x263c31){_0x1f92ce['push'](_0x1f92ce['shift']());}};_0xb0729a(++_0xed9ab);}(_0x13f3,0x135));var _0x313f=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0x13f3[_0x4605dc];return _0x5d3e81;};'use strict';var _=require(_0x313f('0x0'));var util=require(_0x313f('0x1'));var moment=require(_0x313f('0x2'));var BPromise=require(_0x313f('0x3'));var rs=require(_0x313f('0x4'));var fs=require('fs');var Redis=require(_0x313f('0x5'));var db=require(_0x313f('0x6'))['db'];var utils=require(_0x313f('0x7'));var logger=require('../../config/logger')(_0x313f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x313f('0x9')][_0x313f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50526a,_0x755ec1,_0x3638ab){return new BPromise(function(_0x359d13,_0x4f810f){return client[_0x313f('0xb')](_0x50526a,_0x3638ab)[_0x313f('0xc')](function(_0x21d5fd){logger[_0x313f('0xd')](_0x313f('0xe'),_0x755ec1,'request\x20sent');logger[_0x313f('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x755ec1,'request\x20sent',JSON[_0x313f('0x10')](_0x21d5fd));if(_0x21d5fd[_0x313f('0x11')]){if(_0x21d5fd[_0x313f('0x11')][_0x313f('0x12')]===0x1f4){logger[_0x313f('0x11')](_0x313f('0xe'),_0x755ec1,_0x21d5fd[_0x313f('0x11')][_0x313f('0x13')]);return _0x4f810f(_0x21d5fd[_0x313f('0x11')]['message']);}logger[_0x313f('0x11')](_0x313f('0xe'),_0x755ec1,_0x21d5fd[_0x313f('0x11')][_0x313f('0x13')]);return _0x359d13(_0x21d5fd[_0x313f('0x11')][_0x313f('0x13')]);}else{logger[_0x313f('0xd')](_0x313f('0xe'),_0x755ec1,_0x313f('0x14'));_0x359d13(_0x21d5fd[_0x313f('0x15')]['message']);}})[_0x313f('0x16')](function(_0x2cee80){logger[_0x313f('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x755ec1,_0x2cee80);_0x4f810f(_0x2cee80);});});}exports['GetFreshdeskAccount']=function(_0x327778){var _0x14ab79=this;return new Promise(function(_0x110e66,_0x462223){return db[_0x313f('0x17')][_0x313f('0x18')]({'raw':_0x327778[_0x313f('0x19')]?_0x327778['options']['raw']===undefined?!![]:![]:!![],'where':_0x327778[_0x313f('0x19')]?_0x327778[_0x313f('0x19')][_0x313f('0x1a')]||null:null,'attributes':_0x327778[_0x313f('0x19')]?_0x327778[_0x313f('0x19')][_0x313f('0x1b')]||null:null,'limit':_0x327778[_0x313f('0x19')]?_0x327778[_0x313f('0x19')]['limit']||null:null,'include':_0x327778['options']?_0x327778[_0x313f('0x19')][_0x313f('0x1c')]?_[_0x313f('0x1d')](_0x327778[_0x313f('0x19')][_0x313f('0x1c')],function(_0x28c3da){return{'model':db[_0x28c3da[_0x313f('0x1e')]],'as':_0x28c3da['as'],'attributes':_0x28c3da['attributes'],'include':_0x28c3da[_0x313f('0x1c')]?_[_0x313f('0x1d')](_0x28c3da[_0x313f('0x1c')],function(_0x2d3296){return{'model':db[_0x2d3296[_0x313f('0x1e')]],'as':_0x2d3296['as'],'attributes':_0x2d3296[_0x313f('0x1b')],'include':_0x2d3296[_0x313f('0x1c')]?_[_0x313f('0x1d')](_0x2d3296[_0x313f('0x1c')],function(_0xa5c965){return{'model':db[_0xa5c965[_0x313f('0x1e')]],'as':_0xa5c965['as'],'attributes':_0xa5c965[_0x313f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x313f('0xc')](function(_0x3c7a8d){logger[_0x313f('0xd')](_0x313f('0x1f'),_0x327778);logger['debug'](_0x313f('0x1f'),_0x327778,JSON[_0x313f('0x10')](_0x3c7a8d));_0x110e66(_0x3c7a8d);})['catch'](function(_0x22de12){logger[_0x313f('0x11')](_0x313f('0x1f'),_0x22de12[_0x313f('0x13')],_0x327778);_0x462223(_0x14ab79[_0x313f('0x11')](0x1f4,_0x22de12[_0x313f('0x13')]));});});};exports[_0x313f('0x20')]=function(_0x2ee730){var _0x3c60eb=this;return new Promise(function(_0x4472e8,_0x22f39a){return db[_0x313f('0x17')][_0x313f('0x21')]({'raw':_0x2ee730[_0x313f('0x19')]?_0x2ee730['options'][_0x313f('0x22')]===undefined?!![]:![]:!![],'where':_0x2ee730[_0x313f('0x19')]?_0x2ee730[_0x313f('0x19')][_0x313f('0x1a')]||null:null,'attributes':_0x2ee730[_0x313f('0x19')]?_0x2ee730[_0x313f('0x19')]['attributes']||null:null,'include':_0x2ee730['options']?_0x2ee730[_0x313f('0x19')][_0x313f('0x1c')]?_[_0x313f('0x1d')](_0x2ee730['options'][_0x313f('0x1c')],function(_0x2d5e39){return{'model':db[_0x2d5e39['model']],'as':_0x2d5e39['as'],'attributes':_0x2d5e39[_0x313f('0x1b')],'include':_0x2d5e39[_0x313f('0x1c')]?_[_0x313f('0x1d')](_0x2d5e39[_0x313f('0x1c')],function(_0x5dd949){return{'model':db[_0x5dd949[_0x313f('0x1e')]],'as':_0x5dd949['as'],'attributes':_0x5dd949['attributes'],'include':_0x5dd949[_0x313f('0x1c')]?_['map'](_0x5dd949[_0x313f('0x1c')],function(_0x5c8edd){return{'model':db[_0x5c8edd[_0x313f('0x1e')]],'as':_0x5c8edd['as'],'attributes':_0x5c8edd['attributes']};}):[]};}):[]};}):[]:[]})[_0x313f('0xc')](function(_0x1e550f){logger[_0x313f('0xd')](_0x313f('0x20'),_0x2ee730);logger['debug'](_0x313f('0x20'),_0x2ee730,JSON[_0x313f('0x10')](_0x1e550f));_0x4472e8(_0x1e550f);})[_0x313f('0x16')](function(_0x27aad4){logger[_0x313f('0x11')](_0x313f('0x20'),_0x27aad4[_0x313f('0x13')],_0x2ee730);_0x22f39a(_0x3c60eb[_0x313f('0x11')](0x1f4,_0x27aad4['message']));});});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js
index 6fe0d05..65cb4b5 100644
--- a/server/api/intFreshdeskConfiguration/index.js
+++ b/server/api/intFreshdeskConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd13e=['update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags'];(function(_0x586885,_0x393c14){var _0x4f9133=function(_0x2d3c80){while(--_0x2d3c80){_0x586885['push'](_0x586885['shift']());}};_0x4f9133(++_0x393c14);}(_0xd13e,0x193));var _0xed13=function(_0xbb7c1c,_0x1bfa20){_0xbb7c1c=_0xbb7c1c-0x0;var _0x4ce4d4=_0xd13e[_0xbb7c1c];return _0x4ce4d4;};'use strict';var multer=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var path=require(_0xed13('0x2'));var timeout=require(_0xed13('0x3'));var express=require('express');var router=express[_0xed13('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xed13('0x5'));var config=require('../../config/environment');var controller=require(_0xed13('0x6'));router[_0xed13('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xed13('0x8'),auth[_0xed13('0x9')](),controller[_0xed13('0xa')]);router[_0xed13('0x7')](_0xed13('0xb'),auth[_0xed13('0x9')](),controller[_0xed13('0xc')]);router[_0xed13('0x7')](_0xed13('0xd'),auth['isAuthenticated'](),controller[_0xed13('0xe')]);router[_0xed13('0x7')](_0xed13('0xf'),auth[_0xed13('0x9')](),controller[_0xed13('0x10')]);router['get'](_0xed13('0x11'),auth[_0xed13('0x9')](),controller[_0xed13('0x12')]);router[_0xed13('0x13')]('/',auth[_0xed13('0x9')](),controller[_0xed13('0x14')]);router['post'](_0xed13('0x11'),auth['isAuthenticated'](),controller[_0xed13('0x15')]);router['put'](_0xed13('0x8'),auth['isAuthenticated'](),controller[_0xed13('0x16')]);router['delete'](_0xed13('0x8'),auth[_0xed13('0x9')](),controller[_0xed13('0x17')]);module[_0xed13('0x18')]=router;
\ No newline at end of file
+var _0xc978=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','update','delete','/:id','destroy','exports','multer','util','path'];(function(_0x4aa350,_0x12a9eb){var _0x32a16f=function(_0x658038){while(--_0x658038){_0x4aa350['push'](_0x4aa350['shift']());}};_0x32a16f(++_0x12a9eb);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var path=require(_0x8c97('0x2'));var timeout=require(_0x8c97('0x3'));var express=require(_0x8c97('0x4'));var router=express[_0x8c97('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x8c97('0x6'));var config=require(_0x8c97('0x7'));var controller=require(_0x8c97('0x8'));router[_0x8c97('0x9')]('/',auth[_0x8c97('0xa')](),controller[_0x8c97('0xb')]);router[_0x8c97('0x9')]('/:id',auth[_0x8c97('0xa')](),controller[_0x8c97('0xc')]);router[_0x8c97('0x9')](_0x8c97('0xd'),auth[_0x8c97('0xa')](),controller[_0x8c97('0xe')]);router[_0x8c97('0x9')]('/:id/subjects',auth[_0x8c97('0xa')](),controller[_0x8c97('0xf')]);router[_0x8c97('0x9')](_0x8c97('0x10'),auth[_0x8c97('0xa')](),controller[_0x8c97('0x11')]);router[_0x8c97('0x9')](_0x8c97('0x12'),auth[_0x8c97('0xa')](),controller['getTags']);router[_0x8c97('0x13')]('/',auth[_0x8c97('0xa')](),controller['create']);router[_0x8c97('0x13')](_0x8c97('0x12'),auth['isAuthenticated'](),controller[_0x8c97('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8c97('0x15')]);router[_0x8c97('0x16')](_0x8c97('0x17'),auth[_0x8c97('0xa')](),controller[_0x8c97('0x18')]);module[_0x8c97('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
index fd80b3f..6d905fd 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc79f=['exports','STRING','sequelize'];(function(_0x43dc3f,_0x322886){var _0x43a1ea=function(_0x1fd750){while(--_0x1fd750){_0x43dc3f['push'](_0x43dc3f['shift']());}};_0x43a1ea(++_0x322886);}(_0xc79f,0x8f));var _0xfc79=function(_0x370397,_0x4f2b07){_0x370397=_0x370397-0x0;var _0x2420ef=_0xc79f[_0x370397];return _0x2420ef;};'use strict';var Sequelize=require(_0xfc79('0x0'));module[_0xfc79('0x1')]={'name':{'type':Sequelize[_0xfc79('0x2')]},'description':{'type':Sequelize[_0xfc79('0x2')]}};
\ No newline at end of file
+var _0x73ea=['STRING','sequelize','exports'];(function(_0x39a2d6,_0x477459){var _0x23af66=function(_0x2eb95e){while(--_0x2eb95e){_0x39a2d6['push'](_0x39a2d6['shift']());}};_0x23af66(++_0x477459);}(_0x73ea,0x13c));var _0xa73e=function(_0x4e8735,_0x3dd2ec){_0x4e8735=_0x4e8735-0x0;var _0x164515=_0x73ea[_0x4e8735];return _0x164515;};'use strict';var Sequelize=require(_0xa73e('0x0'));module[_0xa73e('0x1')]={'name':{'type':Sequelize[_0xa73e('0x2')]},'description':{'type':Sequelize[_0xa73e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
index b54cd8f..14412c6 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4dfd=['model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','include','findAll','params','intersection','length','merge','find','create','body','update','getFields','findOne','FreshdeskField','options','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','stack','name','send','index','FreshdeskConfiguration','rawAttributes'];(function(_0x18efb0,_0x402155){var _0x463641=function(_0x7f44b1){while(--_0x7f44b1){_0x18efb0['push'](_0x18efb0['shift']());}};_0x463641(++_0x402155);}(_0x4dfd,0xde));var _0xd4df=function(_0x35a389,_0x22f0b1){_0x35a389=_0x35a389-0x0;var _0x1af60b=_0x4dfd[_0x35a389];return _0x1af60b;};'use strict';var pdf=require(_0xd4df('0x0'));var emlformat=require(_0xd4df('0x1'));var rimraf=require(_0xd4df('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4df('0x3'));var rp=require(_0xd4df('0x4'));var moment=require(_0xd4df('0x5'));var BPromise=require(_0xd4df('0x6'));var Mustache=require(_0xd4df('0x7'));var util=require('util');var path=require(_0xd4df('0x8'));var sox=require(_0xd4df('0x9'));var csv=require(_0xd4df('0xa'));var ejs=require(_0xd4df('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd4df('0xc'));var jsforce=require(_0xd4df('0xd'));var deskjs=require(_0xd4df('0xe'));var toCsv=require(_0xd4df('0xa'));var querystring=require('querystring');var Papa=require(_0xd4df('0xf'));var Redis=require(_0xd4df('0x10'));var authService=require(_0xd4df('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4df('0x12'))(_0xd4df('0x13'));var utils=require('../../config/utils');var config=require(_0xd4df('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd4df('0x15'));var client=jayson[_0xd4df('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x347f8b,_0x33a802,_0x4ef82a){if(_0x4ef82a){var _0xb85522=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb85522[_0xd4df('0x17')](_0x33a802)){return _0x347f8b;}else{throw new Error(_0xd4df('0x18'));}}else{return _0x347f8b;}}function respondWithRpcPromise(_0x56b02f,_0x34791f,_0x365a00,_0xb5c09e){return new BPromise(function(_0x1c8e07,_0x4ed131){var _0xa6eb41=_0xb5c09e||client;return _0xa6eb41['request'](_0x56b02f,_0x365a00)[_0xd4df('0x19')](function(_0x173d03){logger[_0xd4df('0x1a')](_0xd4df('0x1b'),_0x34791f,_0xd4df('0x1c'));logger[_0xd4df('0x1d')](_0xd4df('0x1e'),_0x34791f,_0xd4df('0x1c'),JSON['stringify'](_0x173d03));if(_0x173d03[_0xd4df('0x1f')]){if(_0x173d03[_0xd4df('0x1f')][_0xd4df('0x20')]===0x1f4){logger[_0xd4df('0x1f')](_0xd4df('0x1b'),_0x34791f,_0x173d03['error'][_0xd4df('0x21')]);return _0x4ed131(_0x173d03['error'][_0xd4df('0x21')]);}logger['error'](_0xd4df('0x1b'),_0x34791f,_0x173d03[_0xd4df('0x1f')]['message']);return _0x1c8e07(_0x173d03[_0xd4df('0x1f')][_0xd4df('0x21')]);}else{logger['info'](_0xd4df('0x1b'),_0x34791f,'request\x20sent');_0x1c8e07(_0x173d03[_0xd4df('0x22')][_0xd4df('0x21')]);}})[_0xd4df('0x23')](function(_0x60336a){logger[_0xd4df('0x1f')](_0xd4df('0x1b'),_0x34791f,_0x60336a);_0x4ed131(_0x60336a);});});}function respondWithStatusCode(_0x1afb4e,_0x523367){_0x523367=_0x523367||0xcc;return function(_0x4e0b18){if(_0x4e0b18){return _0x1afb4e[_0xd4df('0x24')](_0x523367);}return _0x1afb4e[_0xd4df('0x25')](_0x523367)[_0xd4df('0x26')]();};}function respondWithResult(_0x145d70,_0x438277){_0x438277=_0x438277||0xc8;return function(_0x50eacd){if(_0x50eacd){return _0x145d70[_0xd4df('0x25')](_0x438277)[_0xd4df('0x27')](_0x50eacd);}};}function respondWithFilteredResult(_0x34a7c0,_0x514d9d){return function(_0xeea21b){if(_0xeea21b){var _0x546978=_0xeea21b[_0xd4df('0x28')],_0x398802=_0x514d9d[_0xd4df('0x29')],_0x384cd0=_0x514d9d[_0xd4df('0x29')]+_0x514d9d[_0xd4df('0x2a')],_0x5da9a3;if(_0x384cd0>=_0x546978){_0x384cd0=_0x546978;_0x5da9a3=0xc8;}else{_0x5da9a3=0xce;}_0x34a7c0[_0xd4df('0x25')](_0x5da9a3);return _0x34a7c0[_0xd4df('0x2b')](_0xd4df('0x2c'),_0x398802+'-'+_0x384cd0+'/'+_0x546978)['json'](_0xeea21b);}return null;};}function patchUpdates(_0x4a993b){return function(_0x2d24e6){try{jsonpatch[_0xd4df('0x2d')](_0x2d24e6,_0x4a993b,!![]);}catch(_0x371c27){return BPromise['reject'](_0x371c27);}return _0x2d24e6[_0xd4df('0x2e')]();};}function saveUpdates(_0xe171d7,_0x243fc4){return function(_0x37ac26){if(_0x37ac26){return _0x37ac26['update'](_0xe171d7)[_0xd4df('0x19')](function(_0x5760e3){return _0x5760e3;});}return null;};}function removeEntity(_0x32c706,_0x1c0759){return function(_0x2417c8){if(_0x2417c8){return _0x2417c8[_0xd4df('0x2f')]()['then'](function(){_0x32c706[_0xd4df('0x25')](0xcc)[_0xd4df('0x26')]();});}};}function handleEntityNotFound(_0x574288,_0x597b92){return function(_0x25ee73){if(!_0x25ee73){_0x574288[_0xd4df('0x24')](0x194);}return _0x25ee73;};}function handleError(_0x820f63,_0x38506c){_0x38506c=_0x38506c||0x1f4;return function(_0x597f88){logger['error'](_0x597f88[_0xd4df('0x30')]);if(_0x597f88[_0xd4df('0x31')]){delete _0x597f88[_0xd4df('0x31')];}_0x820f63['status'](_0x38506c)[_0xd4df('0x32')](_0x597f88);};}exports[_0xd4df('0x33')]=function(_0x29b04e,_0x51ec07){var _0x118994={},_0x7c9b60={},_0x463371={'count':0x0,'rows':[]};var _0x49d348=db[_0xd4df('0x34')][_0xd4df('0x35')];_0x7c9b60[_0xd4df('0x36')]=_[_0xd4df('0x37')](_0x49d348);_0x7c9b60[_0xd4df('0x38')]=_[_0xd4df('0x37')](_0x29b04e[_0xd4df('0x38')]);_0x7c9b60['filters']=_['intersection'](_0x7c9b60[_0xd4df('0x36')],_0x7c9b60[_0xd4df('0x38')]);_0x118994[_0xd4df('0x39')]=_['intersection'](_0x7c9b60[_0xd4df('0x36')],qs[_0xd4df('0x3a')](_0x29b04e[_0xd4df('0x38')][_0xd4df('0x3a')]));_0x118994[_0xd4df('0x39')]=_0x118994[_0xd4df('0x39')]['length']?_0x118994[_0xd4df('0x39')]:_0x7c9b60['model'];if(!_0x29b04e[_0xd4df('0x38')][_0xd4df('0x3b')](_0xd4df('0x3c'))){_0x118994['limit']=qs['limit'](_0x29b04e[_0xd4df('0x38')][_0xd4df('0x2a')]);_0x118994['offset']=qs[_0xd4df('0x29')](_0x29b04e[_0xd4df('0x38')][_0xd4df('0x29')]);}_0x118994[_0xd4df('0x3d')]=qs[_0xd4df('0x3e')](_0x29b04e['query'][_0xd4df('0x3e')]);_0x118994[_0xd4df('0x3f')]=qs[_0xd4df('0x40')](_[_0xd4df('0x41')](_0x29b04e[_0xd4df('0x38')],_0x7c9b60[_0xd4df('0x40')]));if(_0x29b04e[_0xd4df('0x38')][_0xd4df('0x42')]){_0x118994[_0xd4df('0x3f')]=_['merge'](_0x118994[_0xd4df('0x3f')],{'$or':_[_0xd4df('0x43')](_0x49d348,function(_0x2f3096){if(_0x2f3096[_0xd4df('0x44')][_0xd4df('0x45')]!==_0xd4df('0x46')){var _0x2e02ff={};_0x2e02ff[_0x2f3096[_0xd4df('0x47')]]={'$like':'%'+_0x29b04e['query'][_0xd4df('0x42')]+'%'};return _0x2e02ff;}})});}_0x118994=_['merge']({},_0x118994,_0x29b04e['options']);var _0x3361f4={'where':_0x118994[_0xd4df('0x3f')]};return db[_0xd4df('0x34')][_0xd4df('0x28')](_0x3361f4)[_0xd4df('0x19')](function(_0x5eaae2){_0x463371[_0xd4df('0x28')]=_0x5eaae2;if(_0x29b04e[_0xd4df('0x38')]['includeAll']){_0x118994[_0xd4df('0x48')]=[{'all':!![]}];}return db[_0xd4df('0x34')][_0xd4df('0x49')](_0x118994);})[_0xd4df('0x19')](function(_0x4f6565){_0x463371['rows']=_0x4f6565;return _0x463371;})[_0xd4df('0x19')](respondWithFilteredResult(_0x51ec07,_0x118994))[_0xd4df('0x23')](handleError(_0x51ec07,null));};exports['show']=function(_0x284e1d,_0x94c230){var _0x5105e1={'raw':![],'where':{'id':_0x284e1d[_0xd4df('0x4a')]['id']}},_0x251d29={};_0x251d29[_0xd4df('0x36')]=_[_0xd4df('0x37')](db['FreshdeskConfiguration']['rawAttributes']);_0x251d29[_0xd4df('0x38')]=_[_0xd4df('0x37')](_0x284e1d[_0xd4df('0x38')]);_0x251d29['filters']=_[_0xd4df('0x4b')](_0x251d29[_0xd4df('0x36')],_0x251d29[_0xd4df('0x38')]);_0x5105e1[_0xd4df('0x39')]=_['intersection'](_0x251d29[_0xd4df('0x36')],qs['fields'](_0x284e1d[_0xd4df('0x38')]['fields']));_0x5105e1['attributes']=_0x5105e1[_0xd4df('0x39')][_0xd4df('0x4c')]?_0x5105e1[_0xd4df('0x39')]:_0x251d29[_0xd4df('0x36')];if(_0x284e1d[_0xd4df('0x38')]['includeAll']){_0x5105e1[_0xd4df('0x48')]=[{'all':!![]}];}_0x5105e1=_[_0xd4df('0x4d')]({},_0x5105e1,_0x284e1d['options']);return db[_0xd4df('0x34')][_0xd4df('0x4e')](_0x5105e1)[_0xd4df('0x19')](handleEntityNotFound(_0x94c230,null))[_0xd4df('0x19')](respondWithResult(_0x94c230,null))[_0xd4df('0x23')](handleError(_0x94c230,null));};exports['create']=function(_0x55e541,_0x171311){return db['FreshdeskConfiguration'][_0xd4df('0x4f')](_0x55e541[_0xd4df('0x50')],{})['then'](respondWithResult(_0x171311,0xc9))[_0xd4df('0x23')](handleError(_0x171311,null));};exports[_0xd4df('0x51')]=function(_0x4afab1,_0x1ece70){if(_0x4afab1[_0xd4df('0x50')]['id']){delete _0x4afab1[_0xd4df('0x50')]['id'];}return db[_0xd4df('0x34')]['find']({'where':{'id':_0x4afab1[_0xd4df('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ece70,null))[_0xd4df('0x19')](saveUpdates(_0x4afab1['body'],null))['then'](respondWithResult(_0x1ece70,null))[_0xd4df('0x23')](handleError(_0x1ece70,null));};exports['destroy']=function(_0xd54c91,_0x3d9eeb){return db[_0xd4df('0x34')][_0xd4df('0x4e')]({'where':{'id':_0xd54c91[_0xd4df('0x4a')]['id']}})[_0xd4df('0x19')](handleEntityNotFound(_0x3d9eeb,null))[_0xd4df('0x19')](removeEntity(_0x3d9eeb,null))[_0xd4df('0x23')](handleError(_0x3d9eeb,null));};exports[_0xd4df('0x52')]=function(_0x9b883b,_0x26558d,_0x4f1e54){var _0x129898={};var _0x2534e1={};var _0x2ac705;var _0x3a7a46;return db[_0xd4df('0x34')][_0xd4df('0x53')]({'where':{'id':_0x9b883b['params']['id']}})[_0xd4df('0x19')](handleEntityNotFound(_0x26558d,null))['then'](function(_0x4289be){if(_0x4289be){_0x2ac705=_0x4289be;_0x2534e1[_0xd4df('0x36')]=_['keys'](db[_0xd4df('0x54')][_0xd4df('0x35')]);_0x2534e1['query']=_['keys'](_0x9b883b[_0xd4df('0x38')]);_0x2534e1[_0xd4df('0x40')]=_['intersection'](_0x2534e1[_0xd4df('0x36')],_0x2534e1[_0xd4df('0x38')]);_0x129898[_0xd4df('0x39')]=_[_0xd4df('0x4b')](_0x2534e1[_0xd4df('0x36')],qs[_0xd4df('0x3a')](_0x9b883b[_0xd4df('0x38')][_0xd4df('0x3a')]));_0x129898[_0xd4df('0x39')]=_0x129898[_0xd4df('0x39')][_0xd4df('0x4c')]?_0x129898[_0xd4df('0x39')]:_0x2534e1[_0xd4df('0x36')];_0x129898[_0xd4df('0x3d')]=qs[_0xd4df('0x3e')](_0x9b883b[_0xd4df('0x38')]['sort']);_0x129898[_0xd4df('0x3f')]=qs[_0xd4df('0x40')](_['pick'](_0x9b883b[_0xd4df('0x38')],_0x2534e1[_0xd4df('0x40')]));if(_0x9b883b[_0xd4df('0x38')][_0xd4df('0x42')]){_0x129898['where']=_[_0xd4df('0x4d')](_0x129898['where'],{'$or':_['map'](_0x129898['attributes'],function(_0x13ab71){var _0x1ac70d={};_0x1ac70d[_0x13ab71]={'$like':'%'+_0x9b883b[_0xd4df('0x38')]['filter']+'%'};return _0x1ac70d;})});}_0x129898=_[_0xd4df('0x4d')]({},_0x129898,_0x9b883b[_0xd4df('0x55')]);return _0x2ac705[_0xd4df('0x52')](_0x129898);}})[_0xd4df('0x19')](function(_0x3e08ba){if(_0x3e08ba){_0x3a7a46=_0x3e08ba[_0xd4df('0x4c')];if(!_0x9b883b[_0xd4df('0x38')][_0xd4df('0x3b')]('nolimit')){_0x129898['limit']=qs['limit'](_0x9b883b[_0xd4df('0x38')][_0xd4df('0x2a')]);_0x129898['offset']=qs['offset'](_0x9b883b['query'][_0xd4df('0x29')]);}return _0x2ac705[_0xd4df('0x52')](_0x129898);}})[_0xd4df('0x19')](function(_0x1d3bc5){if(_0x1d3bc5){return _0x1d3bc5?{'count':_0x3a7a46,'rows':_0x1d3bc5}:null;}})[_0xd4df('0x19')](respondWithResult(_0x26558d,null))[_0xd4df('0x23')](handleError(_0x26558d,null));};exports[_0xd4df('0x56')]=function(_0x1fb932,_0x4cf069,_0xeb60db){var _0x21cf08={};var _0x53bec1={};var _0x384623;var _0x3c01bd;return db[_0xd4df('0x34')][_0xd4df('0x53')]({'where':{'id':_0x1fb932[_0xd4df('0x4a')]['id']}})[_0xd4df('0x19')](handleEntityNotFound(_0x4cf069,null))[_0xd4df('0x19')](function(_0x299bfe){if(_0x299bfe){_0x384623=_0x299bfe;_0x53bec1[_0xd4df('0x36')]=_[_0xd4df('0x37')](db['FreshdeskField'][_0xd4df('0x35')]);_0x53bec1['query']=_[_0xd4df('0x37')](_0x1fb932['query']);_0x53bec1[_0xd4df('0x40')]=_[_0xd4df('0x4b')](_0x53bec1[_0xd4df('0x36')],_0x53bec1[_0xd4df('0x38')]);_0x21cf08[_0xd4df('0x39')]=_[_0xd4df('0x4b')](_0x53bec1[_0xd4df('0x36')],qs['fields'](_0x1fb932['query'][_0xd4df('0x3a')]));_0x21cf08['attributes']=_0x21cf08[_0xd4df('0x39')][_0xd4df('0x4c')]?_0x21cf08['attributes']:_0x53bec1['model'];_0x21cf08[_0xd4df('0x3d')]=qs[_0xd4df('0x3e')](_0x1fb932[_0xd4df('0x38')][_0xd4df('0x3e')]);_0x21cf08[_0xd4df('0x3f')]=qs[_0xd4df('0x40')](_[_0xd4df('0x41')](_0x1fb932[_0xd4df('0x38')],_0x53bec1[_0xd4df('0x40')]));if(_0x1fb932['query'][_0xd4df('0x42')]){_0x21cf08[_0xd4df('0x3f')]=_[_0xd4df('0x4d')](_0x21cf08[_0xd4df('0x3f')],{'$or':_['map'](_0x21cf08[_0xd4df('0x39')],function(_0x58fc86){var _0x4f459e={};_0x4f459e[_0x58fc86]={'$like':'%'+_0x1fb932['query'][_0xd4df('0x42')]+'%'};return _0x4f459e;})});}_0x21cf08=_[_0xd4df('0x4d')]({},_0x21cf08,_0x1fb932[_0xd4df('0x55')]);return _0x384623['getSubjects'](_0x21cf08);}})[_0xd4df('0x19')](function(_0x2b96bc){if(_0x2b96bc){_0x3c01bd=_0x2b96bc[_0xd4df('0x4c')];if(!_0x1fb932[_0xd4df('0x38')][_0xd4df('0x3b')]('nolimit')){_0x21cf08[_0xd4df('0x2a')]=qs['limit'](_0x1fb932['query']['limit']);_0x21cf08[_0xd4df('0x29')]=qs[_0xd4df('0x29')](_0x1fb932[_0xd4df('0x38')][_0xd4df('0x29')]);}return _0x384623[_0xd4df('0x56')](_0x21cf08);}})[_0xd4df('0x19')](function(_0x13ddbc){if(_0x13ddbc){return _0x13ddbc?{'count':_0x3c01bd,'rows':_0x13ddbc}:null;}})[_0xd4df('0x19')](respondWithResult(_0x4cf069,null))[_0xd4df('0x23')](handleError(_0x4cf069,null));};exports[_0xd4df('0x57')]=function(_0x4f58ce,_0x590016,_0xf7c30b){var _0x24c294={};var _0x5934b1={};var _0x4fadef;var _0x4b469a;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4f58ce[_0xd4df('0x4a')]['id']}})[_0xd4df('0x19')](handleEntityNotFound(_0x590016,null))['then'](function(_0x4577ec){if(_0x4577ec){_0x4fadef=_0x4577ec;_0x5934b1[_0xd4df('0x36')]=_['keys'](db[_0xd4df('0x54')][_0xd4df('0x35')]);_0x5934b1['query']=_[_0xd4df('0x37')](_0x4f58ce[_0xd4df('0x38')]);_0x5934b1[_0xd4df('0x40')]=_[_0xd4df('0x4b')](_0x5934b1[_0xd4df('0x36')],_0x5934b1[_0xd4df('0x38')]);_0x24c294[_0xd4df('0x39')]=_['intersection'](_0x5934b1['model'],qs[_0xd4df('0x3a')](_0x4f58ce['query']['fields']));_0x24c294['attributes']=_0x24c294[_0xd4df('0x39')][_0xd4df('0x4c')]?_0x24c294[_0xd4df('0x39')]:_0x5934b1[_0xd4df('0x36')];_0x24c294[_0xd4df('0x3d')]=qs[_0xd4df('0x3e')](_0x4f58ce[_0xd4df('0x38')][_0xd4df('0x3e')]);_0x24c294[_0xd4df('0x3f')]=qs['filters'](_[_0xd4df('0x41')](_0x4f58ce[_0xd4df('0x38')],_0x5934b1[_0xd4df('0x40')]));if(_0x4f58ce[_0xd4df('0x38')][_0xd4df('0x42')]){_0x24c294[_0xd4df('0x3f')]=_[_0xd4df('0x4d')](_0x24c294[_0xd4df('0x3f')],{'$or':_[_0xd4df('0x43')](_0x24c294['attributes'],function(_0x2374f7){var _0x4ee28e={};_0x4ee28e[_0x2374f7]={'$like':'%'+_0x4f58ce[_0xd4df('0x38')][_0xd4df('0x42')]+'%'};return _0x4ee28e;})});}_0x24c294=_[_0xd4df('0x4d')]({},_0x24c294,_0x4f58ce[_0xd4df('0x55')]);return _0x4fadef[_0xd4df('0x57')](_0x24c294);}})[_0xd4df('0x19')](function(_0xa8935){if(_0xa8935){_0x4b469a=_0xa8935['length'];if(!_0x4f58ce[_0xd4df('0x38')][_0xd4df('0x3b')]('nolimit')){_0x24c294[_0xd4df('0x2a')]=qs[_0xd4df('0x2a')](_0x4f58ce['query'][_0xd4df('0x2a')]);_0x24c294[_0xd4df('0x29')]=qs['offset'](_0x4f58ce[_0xd4df('0x38')][_0xd4df('0x29')]);}return _0x4fadef[_0xd4df('0x57')](_0x24c294);}})[_0xd4df('0x19')](function(_0x11af33){if(_0x11af33){return _0x11af33?{'count':_0x4b469a,'rows':_0x11af33}:null;}})['then'](respondWithResult(_0x590016,null))[_0xd4df('0x23')](handleError(_0x590016,null));};exports[_0xd4df('0x58')]=function(_0x343bca,_0x339723,_0x2101ae){var _0x3d39ed={};var _0x10b0e2={};var _0x39ab9e;var _0x968b3;return db[_0xd4df('0x34')][_0xd4df('0x53')]({'where':{'id':_0x343bca[_0xd4df('0x4a')]['id']}})['then'](handleEntityNotFound(_0x339723,null))['then'](function(_0xa299e3){if(_0xa299e3){_0x39ab9e=_0xa299e3;_0x10b0e2['model']=_[_0xd4df('0x37')](db[_0xd4df('0x59')]['rawAttributes']);_0x10b0e2[_0xd4df('0x38')]=_['keys'](_0x343bca[_0xd4df('0x38')]);_0x10b0e2[_0xd4df('0x40')]=_['intersection'](_0x10b0e2[_0xd4df('0x36')],_0x10b0e2[_0xd4df('0x38')]);_0x3d39ed[_0xd4df('0x39')]=_[_0xd4df('0x4b')](_0x10b0e2['model'],qs[_0xd4df('0x3a')](_0x343bca[_0xd4df('0x38')][_0xd4df('0x3a')]));_0x3d39ed[_0xd4df('0x39')]=_0x3d39ed['attributes']['length']?_0x3d39ed[_0xd4df('0x39')]:_0x10b0e2['model'];_0x3d39ed[_0xd4df('0x3d')]=qs[_0xd4df('0x3e')](_0x343bca[_0xd4df('0x38')][_0xd4df('0x3e')]);_0x3d39ed['where']=qs[_0xd4df('0x40')](_[_0xd4df('0x41')](_0x343bca[_0xd4df('0x38')],_0x10b0e2[_0xd4df('0x40')]));if(_0x343bca[_0xd4df('0x38')][_0xd4df('0x42')]){_0x3d39ed[_0xd4df('0x3f')]=_[_0xd4df('0x4d')](_0x3d39ed['where'],{'$or':_[_0xd4df('0x43')](_0x3d39ed[_0xd4df('0x39')],function(_0x3fbfca){var _0x5f543={};_0x5f543[_0x3fbfca]={'$like':'%'+_0x343bca[_0xd4df('0x38')][_0xd4df('0x42')]+'%'};return _0x5f543;})});}_0x3d39ed=_['merge']({},_0x3d39ed,_0x343bca[_0xd4df('0x55')]);return _0x39ab9e[_0xd4df('0x58')](_0x3d39ed);}})[_0xd4df('0x19')](function(_0x18ac97){if(_0x18ac97){_0x968b3=_0x18ac97[_0xd4df('0x4c')];if(!_0x343bca['query'][_0xd4df('0x3b')](_0xd4df('0x3c'))){_0x3d39ed[_0xd4df('0x2a')]=qs[_0xd4df('0x2a')](_0x343bca[_0xd4df('0x38')][_0xd4df('0x2a')]);_0x3d39ed[_0xd4df('0x29')]=qs[_0xd4df('0x29')](_0x343bca['query'][_0xd4df('0x29')]);}return _0x39ab9e['getTags'](_0x3d39ed);}})[_0xd4df('0x19')](function(_0x499af3){if(_0x499af3){return _0x499af3?{'count':_0x968b3,'rows':_0x499af3}:null;}})[_0xd4df('0x19')](respondWithResult(_0x339723,null))['catch'](handleError(_0x339723,null));};exports[_0xd4df('0x5a')]=function(_0x49b8fe,_0x43fb38,_0x567f45){if(_0x49b8fe[_0xd4df('0x50')]['id']){delete _0x49b8fe[_0xd4df('0x50')]['id'];}return db['FreshdeskConfiguration'][_0xd4df('0x53')]({'where':{'id':_0x49b8fe['params']['id']}})[_0xd4df('0x19')](handleEntityNotFound(_0x43fb38,null))[_0xd4df('0x19')](function(_0x2ccf15){if(_0x2ccf15){return _0x2ccf15['setTags'](_0x49b8fe[_0xd4df('0x50')][_0xd4df('0x5b')]||[]);}return null;})[_0xd4df('0x19')](respondWithResult(_0x43fb38,null))[_0xd4df('0x23')](handleError(_0x43fb38,null));};
\ No newline at end of file
+var _0xe683=['length','includeAll','find','body','getFields','FreshdeskField','getSubjects','getDescriptions','findOne','getTags','setTags','ids','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','FreshdeskConfiguration','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','key','options','include','findAll','rows','show','params'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xe683,0xca));var _0x3e68=function(_0x16fbcb,_0x272b1e){_0x16fbcb=_0x16fbcb-0x0;var _0x4bb8da=_0xe683[_0x16fbcb];return _0x4bb8da;};'use strict';var pdf=require(_0x3e68('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3e68('0x1'));var jsonpatch=require(_0x3e68('0x2'));var rp=require(_0x3e68('0x3'));var moment=require(_0x3e68('0x4'));var BPromise=require(_0x3e68('0x5'));var Mustache=require('mustache');var util=require(_0x3e68('0x6'));var path=require(_0x3e68('0x7'));var sox=require(_0x3e68('0x8'));var csv=require(_0x3e68('0x9'));var ejs=require(_0x3e68('0xa'));var fs=require('fs');var _=require(_0x3e68('0xb'));var squel=require(_0x3e68('0xc'));var crypto=require(_0x3e68('0xd'));var jsforce=require(_0x3e68('0xe'));var deskjs=require(_0x3e68('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3e68('0x10'));var Papa=require(_0x3e68('0x11'));var Redis=require(_0x3e68('0x12'));var authService=require(_0x3e68('0x13'));var qs=require(_0x3e68('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e68('0x15'));var utils=require('../../config/utils');var config=require(_0x3e68('0x16'));var db=require(_0x3e68('0x17'))['db'];var jayson=require(_0x3e68('0x18'));var client=jayson[_0x3e68('0x19')][_0x3e68('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2ac90b,_0x148e21,_0x1fb9a3){if(_0x1fb9a3){var _0x1ea111=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ea111[_0x3e68('0x1b')](_0x148e21)){return _0x2ac90b;}else{throw new Error(_0x3e68('0x1c'));}}else{return _0x2ac90b;}}function respondWithRpcPromise(_0x11c6af,_0x4463a1,_0x222afa,_0x23bd4f){return new BPromise(function(_0x18181d,_0x1929e9){var _0x135521=_0x23bd4f||client;return _0x135521['request'](_0x11c6af,_0x222afa)['then'](function(_0x355ad7){logger[_0x3e68('0x1d')](_0x3e68('0x1e'),_0x4463a1,_0x3e68('0x1f'));logger[_0x3e68('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4463a1,_0x3e68('0x1f'),JSON['stringify'](_0x355ad7));if(_0x355ad7[_0x3e68('0x21')]){if(_0x355ad7[_0x3e68('0x21')][_0x3e68('0x22')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4463a1,_0x355ad7[_0x3e68('0x21')][_0x3e68('0x23')]);return _0x1929e9(_0x355ad7[_0x3e68('0x21')][_0x3e68('0x23')]);}logger[_0x3e68('0x21')](_0x3e68('0x1e'),_0x4463a1,_0x355ad7[_0x3e68('0x21')][_0x3e68('0x23')]);return _0x18181d(_0x355ad7[_0x3e68('0x21')][_0x3e68('0x23')]);}else{logger[_0x3e68('0x1d')](_0x3e68('0x1e'),_0x4463a1,_0x3e68('0x1f'));_0x18181d(_0x355ad7[_0x3e68('0x24')][_0x3e68('0x23')]);}})[_0x3e68('0x25')](function(_0x157a0f){logger[_0x3e68('0x21')](_0x3e68('0x1e'),_0x4463a1,_0x157a0f);_0x1929e9(_0x157a0f);});});}function respondWithStatusCode(_0x48e9ca,_0x14ab64){_0x14ab64=_0x14ab64||0xcc;return function(_0x53531e){if(_0x53531e){return _0x48e9ca[_0x3e68('0x26')](_0x14ab64);}return _0x48e9ca['status'](_0x14ab64)[_0x3e68('0x27')]();};}function respondWithResult(_0x456525,_0xe55cb9){_0xe55cb9=_0xe55cb9||0xc8;return function(_0x1d3e78){if(_0x1d3e78){return _0x456525[_0x3e68('0x28')](_0xe55cb9)['json'](_0x1d3e78);}};}function respondWithFilteredResult(_0x1acc81,_0x3dd47b){return function(_0x5d4074){if(_0x5d4074){var _0x1d8180=_0x5d4074[_0x3e68('0x29')],_0x5b20b7=_0x3dd47b[_0x3e68('0x2a')],_0x28733d=_0x3dd47b[_0x3e68('0x2a')]+_0x3dd47b[_0x3e68('0x2b')],_0x45d3d5;if(_0x28733d>=_0x1d8180){_0x28733d=_0x1d8180;_0x45d3d5=0xc8;}else{_0x45d3d5=0xce;}_0x1acc81[_0x3e68('0x28')](_0x45d3d5);return _0x1acc81[_0x3e68('0x2c')](_0x3e68('0x2d'),_0x5b20b7+'-'+_0x28733d+'/'+_0x1d8180)[_0x3e68('0x2e')](_0x5d4074);}return null;};}function patchUpdates(_0x33d379){return function(_0x4662f9){try{jsonpatch[_0x3e68('0x2f')](_0x4662f9,_0x33d379,!![]);}catch(_0x5abcdf){return BPromise[_0x3e68('0x30')](_0x5abcdf);}return _0x4662f9[_0x3e68('0x31')]();};}function saveUpdates(_0x37d627,_0x5d47cc){return function(_0x497e74){if(_0x497e74){return _0x497e74[_0x3e68('0x32')](_0x37d627)['then'](function(_0x4f19e6){return _0x4f19e6;});}return null;};}function removeEntity(_0xe3ae3b,_0x557ba8){return function(_0x1d51da){if(_0x1d51da){return _0x1d51da[_0x3e68('0x33')]()[_0x3e68('0x34')](function(){_0xe3ae3b[_0x3e68('0x28')](0xcc)[_0x3e68('0x27')]();});}};}function handleEntityNotFound(_0x5704ae,_0x1a794b){return function(_0x301fdc){if(!_0x301fdc){_0x5704ae[_0x3e68('0x26')](0x194);}return _0x301fdc;};}function handleError(_0x212eb5,_0x466348){_0x466348=_0x466348||0x1f4;return function(_0x4c184f){logger[_0x3e68('0x21')](_0x4c184f[_0x3e68('0x35')]);if(_0x4c184f[_0x3e68('0x36')]){delete _0x4c184f[_0x3e68('0x36')];}_0x212eb5[_0x3e68('0x28')](_0x466348)[_0x3e68('0x37')](_0x4c184f);};}exports[_0x3e68('0x38')]=function(_0x478775,_0x3793b8){var _0x3894a4={},_0x48c514={},_0xa9a3cf={'count':0x0,'rows':[]};var _0x5a43e9=db[_0x3e68('0x39')][_0x3e68('0x3a')];_0x48c514[_0x3e68('0x3b')]=_[_0x3e68('0x3c')](_0x5a43e9);_0x48c514[_0x3e68('0x3d')]=_[_0x3e68('0x3c')](_0x478775[_0x3e68('0x3d')]);_0x48c514['filters']=_[_0x3e68('0x3e')](_0x48c514['model'],_0x48c514[_0x3e68('0x3d')]);_0x3894a4['attributes']=_[_0x3e68('0x3e')](_0x48c514['model'],qs[_0x3e68('0x3f')](_0x478775[_0x3e68('0x3d')][_0x3e68('0x3f')]));_0x3894a4[_0x3e68('0x40')]=_0x3894a4[_0x3e68('0x40')]['length']?_0x3894a4['attributes']:_0x48c514[_0x3e68('0x3b')];if(!_0x478775['query'][_0x3e68('0x41')](_0x3e68('0x42'))){_0x3894a4[_0x3e68('0x2b')]=qs[_0x3e68('0x2b')](_0x478775[_0x3e68('0x3d')][_0x3e68('0x2b')]);_0x3894a4[_0x3e68('0x2a')]=qs[_0x3e68('0x2a')](_0x478775[_0x3e68('0x3d')]['offset']);}_0x3894a4[_0x3e68('0x43')]=qs[_0x3e68('0x44')](_0x478775[_0x3e68('0x3d')]['sort']);_0x3894a4[_0x3e68('0x45')]=qs['filters'](_[_0x3e68('0x46')](_0x478775[_0x3e68('0x3d')],_0x48c514[_0x3e68('0x47')]));if(_0x478775[_0x3e68('0x3d')][_0x3e68('0x48')]){_0x3894a4[_0x3e68('0x45')]=_[_0x3e68('0x49')](_0x3894a4[_0x3e68('0x45')],{'$or':_[_0x3e68('0x4a')](_0x5a43e9,function(_0x620df9){if(_0x620df9[_0x3e68('0x4b')][_0x3e68('0x4c')]!=='VIRTUAL'){var _0x392ba5={};_0x392ba5[_0x620df9['field']]={'$like':'%'+_0x478775[_0x3e68('0x3d')][_0x3e68('0x48')]+'%'};return _0x392ba5;}})});}_0x3894a4=_[_0x3e68('0x49')]({},_0x3894a4,_0x478775[_0x3e68('0x4d')]);var _0x3ca613={'where':_0x3894a4[_0x3e68('0x45')]};return db['FreshdeskConfiguration'][_0x3e68('0x29')](_0x3ca613)[_0x3e68('0x34')](function(_0x419150){_0xa9a3cf[_0x3e68('0x29')]=_0x419150;if(_0x478775[_0x3e68('0x3d')]['includeAll']){_0x3894a4[_0x3e68('0x4e')]=[{'all':!![]}];}return db[_0x3e68('0x39')][_0x3e68('0x4f')](_0x3894a4);})['then'](function(_0x82371e){_0xa9a3cf[_0x3e68('0x50')]=_0x82371e;return _0xa9a3cf;})[_0x3e68('0x34')](respondWithFilteredResult(_0x3793b8,_0x3894a4))[_0x3e68('0x25')](handleError(_0x3793b8,null));};exports[_0x3e68('0x51')]=function(_0x1f678c,_0x19121d){var _0x55cf7f={'raw':![],'where':{'id':_0x1f678c[_0x3e68('0x52')]['id']}},_0xf3028f={};_0xf3028f['model']=_['keys'](db[_0x3e68('0x39')][_0x3e68('0x3a')]);_0xf3028f['query']=_[_0x3e68('0x3c')](_0x1f678c[_0x3e68('0x3d')]);_0xf3028f[_0x3e68('0x47')]=_['intersection'](_0xf3028f[_0x3e68('0x3b')],_0xf3028f[_0x3e68('0x3d')]);_0x55cf7f['attributes']=_['intersection'](_0xf3028f[_0x3e68('0x3b')],qs[_0x3e68('0x3f')](_0x1f678c['query'][_0x3e68('0x3f')]));_0x55cf7f['attributes']=_0x55cf7f[_0x3e68('0x40')][_0x3e68('0x53')]?_0x55cf7f[_0x3e68('0x40')]:_0xf3028f[_0x3e68('0x3b')];if(_0x1f678c[_0x3e68('0x3d')][_0x3e68('0x54')]){_0x55cf7f[_0x3e68('0x4e')]=[{'all':!![]}];}_0x55cf7f=_['merge']({},_0x55cf7f,_0x1f678c[_0x3e68('0x4d')]);return db['FreshdeskConfiguration'][_0x3e68('0x55')](_0x55cf7f)[_0x3e68('0x34')](handleEntityNotFound(_0x19121d,null))[_0x3e68('0x34')](respondWithResult(_0x19121d,null))['catch'](handleError(_0x19121d,null));};exports['create']=function(_0x3c2f77,_0x123dbd){return db[_0x3e68('0x39')]['create'](_0x3c2f77[_0x3e68('0x56')],{})[_0x3e68('0x34')](respondWithResult(_0x123dbd,0xc9))[_0x3e68('0x25')](handleError(_0x123dbd,null));};exports[_0x3e68('0x32')]=function(_0x259db4,_0x19a1f2){if(_0x259db4[_0x3e68('0x56')]['id']){delete _0x259db4[_0x3e68('0x56')]['id'];}return db['FreshdeskConfiguration'][_0x3e68('0x55')]({'where':{'id':_0x259db4[_0x3e68('0x52')]['id']}})[_0x3e68('0x34')](handleEntityNotFound(_0x19a1f2,null))[_0x3e68('0x34')](saveUpdates(_0x259db4[_0x3e68('0x56')],null))[_0x3e68('0x34')](respondWithResult(_0x19a1f2,null))[_0x3e68('0x25')](handleError(_0x19a1f2,null));};exports[_0x3e68('0x33')]=function(_0x35f18c,_0x59c383){return db[_0x3e68('0x39')]['find']({'where':{'id':_0x35f18c['params']['id']}})['then'](handleEntityNotFound(_0x59c383,null))[_0x3e68('0x34')](removeEntity(_0x59c383,null))[_0x3e68('0x25')](handleError(_0x59c383,null));};exports[_0x3e68('0x57')]=function(_0x5a9ccc,_0x4c6fb7,_0x5471a4){var _0x2f4607={};var _0xc545b7={};var _0x1b386a;var _0x3379a7;return db[_0x3e68('0x39')]['findOne']({'where':{'id':_0x5a9ccc['params']['id']}})['then'](handleEntityNotFound(_0x4c6fb7,null))['then'](function(_0x4dd659){if(_0x4dd659){_0x1b386a=_0x4dd659;_0xc545b7[_0x3e68('0x3b')]=_[_0x3e68('0x3c')](db[_0x3e68('0x58')]['rawAttributes']);_0xc545b7[_0x3e68('0x3d')]=_['keys'](_0x5a9ccc[_0x3e68('0x3d')]);_0xc545b7[_0x3e68('0x47')]=_[_0x3e68('0x3e')](_0xc545b7[_0x3e68('0x3b')],_0xc545b7[_0x3e68('0x3d')]);_0x2f4607['attributes']=_[_0x3e68('0x3e')](_0xc545b7[_0x3e68('0x3b')],qs[_0x3e68('0x3f')](_0x5a9ccc['query'][_0x3e68('0x3f')]));_0x2f4607[_0x3e68('0x40')]=_0x2f4607['attributes'][_0x3e68('0x53')]?_0x2f4607[_0x3e68('0x40')]:_0xc545b7[_0x3e68('0x3b')];_0x2f4607['order']=qs[_0x3e68('0x44')](_0x5a9ccc[_0x3e68('0x3d')][_0x3e68('0x44')]);_0x2f4607[_0x3e68('0x45')]=qs[_0x3e68('0x47')](_[_0x3e68('0x46')](_0x5a9ccc['query'],_0xc545b7['filters']));if(_0x5a9ccc[_0x3e68('0x3d')]['filter']){_0x2f4607[_0x3e68('0x45')]=_[_0x3e68('0x49')](_0x2f4607['where'],{'$or':_[_0x3e68('0x4a')](_0x2f4607[_0x3e68('0x40')],function(_0x3645da){var _0x12740a={};_0x12740a[_0x3645da]={'$like':'%'+_0x5a9ccc[_0x3e68('0x3d')][_0x3e68('0x48')]+'%'};return _0x12740a;})});}_0x2f4607=_[_0x3e68('0x49')]({},_0x2f4607,_0x5a9ccc[_0x3e68('0x4d')]);return _0x1b386a[_0x3e68('0x57')](_0x2f4607);}})[_0x3e68('0x34')](function(_0x2d8dfe){if(_0x2d8dfe){_0x3379a7=_0x2d8dfe[_0x3e68('0x53')];if(!_0x5a9ccc[_0x3e68('0x3d')][_0x3e68('0x41')](_0x3e68('0x42'))){_0x2f4607['limit']=qs[_0x3e68('0x2b')](_0x5a9ccc['query'][_0x3e68('0x2b')]);_0x2f4607[_0x3e68('0x2a')]=qs['offset'](_0x5a9ccc[_0x3e68('0x3d')][_0x3e68('0x2a')]);}return _0x1b386a[_0x3e68('0x57')](_0x2f4607);}})['then'](function(_0x342abc){if(_0x342abc){return _0x342abc?{'count':_0x3379a7,'rows':_0x342abc}:null;}})[_0x3e68('0x34')](respondWithResult(_0x4c6fb7,null))['catch'](handleError(_0x4c6fb7,null));};exports['getSubjects']=function(_0x435f95,_0xc829ba,_0x4b4bee){var _0x1c3997={};var _0x43064e={};var _0x988228;var _0x1aa768;return db[_0x3e68('0x39')]['findOne']({'where':{'id':_0x435f95['params']['id']}})[_0x3e68('0x34')](handleEntityNotFound(_0xc829ba,null))[_0x3e68('0x34')](function(_0x8c20e3){if(_0x8c20e3){_0x988228=_0x8c20e3;_0x43064e[_0x3e68('0x3b')]=_[_0x3e68('0x3c')](db[_0x3e68('0x58')][_0x3e68('0x3a')]);_0x43064e[_0x3e68('0x3d')]=_['keys'](_0x435f95[_0x3e68('0x3d')]);_0x43064e['filters']=_[_0x3e68('0x3e')](_0x43064e[_0x3e68('0x3b')],_0x43064e[_0x3e68('0x3d')]);_0x1c3997[_0x3e68('0x40')]=_[_0x3e68('0x3e')](_0x43064e[_0x3e68('0x3b')],qs[_0x3e68('0x3f')](_0x435f95[_0x3e68('0x3d')][_0x3e68('0x3f')]));_0x1c3997[_0x3e68('0x40')]=_0x1c3997['attributes']['length']?_0x1c3997[_0x3e68('0x40')]:_0x43064e[_0x3e68('0x3b')];_0x1c3997[_0x3e68('0x43')]=qs[_0x3e68('0x44')](_0x435f95['query'][_0x3e68('0x44')]);_0x1c3997['where']=qs[_0x3e68('0x47')](_['pick'](_0x435f95[_0x3e68('0x3d')],_0x43064e[_0x3e68('0x47')]));if(_0x435f95['query'][_0x3e68('0x48')]){_0x1c3997[_0x3e68('0x45')]=_[_0x3e68('0x49')](_0x1c3997['where'],{'$or':_['map'](_0x1c3997[_0x3e68('0x40')],function(_0x5d49b7){var _0x250c6f={};_0x250c6f[_0x5d49b7]={'$like':'%'+_0x435f95[_0x3e68('0x3d')][_0x3e68('0x48')]+'%'};return _0x250c6f;})});}_0x1c3997=_[_0x3e68('0x49')]({},_0x1c3997,_0x435f95[_0x3e68('0x4d')]);return _0x988228[_0x3e68('0x59')](_0x1c3997);}})[_0x3e68('0x34')](function(_0x185614){if(_0x185614){_0x1aa768=_0x185614['length'];if(!_0x435f95[_0x3e68('0x3d')][_0x3e68('0x41')](_0x3e68('0x42'))){_0x1c3997['limit']=qs[_0x3e68('0x2b')](_0x435f95['query'][_0x3e68('0x2b')]);_0x1c3997[_0x3e68('0x2a')]=qs[_0x3e68('0x2a')](_0x435f95[_0x3e68('0x3d')][_0x3e68('0x2a')]);}return _0x988228[_0x3e68('0x59')](_0x1c3997);}})[_0x3e68('0x34')](function(_0x22760a){if(_0x22760a){return _0x22760a?{'count':_0x1aa768,'rows':_0x22760a}:null;}})[_0x3e68('0x34')](respondWithResult(_0xc829ba,null))['catch'](handleError(_0xc829ba,null));};exports[_0x3e68('0x5a')]=function(_0x14fc35,_0x433878,_0x5bf995){var _0x2e4d84={};var _0x2bd1f8={};var _0x400e34;var _0x1c8ad6;return db['FreshdeskConfiguration'][_0x3e68('0x5b')]({'where':{'id':_0x14fc35['params']['id']}})[_0x3e68('0x34')](handleEntityNotFound(_0x433878,null))[_0x3e68('0x34')](function(_0x304857){if(_0x304857){_0x400e34=_0x304857;_0x2bd1f8[_0x3e68('0x3b')]=_[_0x3e68('0x3c')](db[_0x3e68('0x58')][_0x3e68('0x3a')]);_0x2bd1f8[_0x3e68('0x3d')]=_[_0x3e68('0x3c')](_0x14fc35[_0x3e68('0x3d')]);_0x2bd1f8[_0x3e68('0x47')]=_[_0x3e68('0x3e')](_0x2bd1f8[_0x3e68('0x3b')],_0x2bd1f8[_0x3e68('0x3d')]);_0x2e4d84['attributes']=_['intersection'](_0x2bd1f8[_0x3e68('0x3b')],qs[_0x3e68('0x3f')](_0x14fc35[_0x3e68('0x3d')][_0x3e68('0x3f')]));_0x2e4d84[_0x3e68('0x40')]=_0x2e4d84['attributes'][_0x3e68('0x53')]?_0x2e4d84['attributes']:_0x2bd1f8[_0x3e68('0x3b')];_0x2e4d84[_0x3e68('0x43')]=qs['sort'](_0x14fc35[_0x3e68('0x3d')][_0x3e68('0x44')]);_0x2e4d84['where']=qs[_0x3e68('0x47')](_[_0x3e68('0x46')](_0x14fc35[_0x3e68('0x3d')],_0x2bd1f8['filters']));if(_0x14fc35['query'][_0x3e68('0x48')]){_0x2e4d84[_0x3e68('0x45')]=_[_0x3e68('0x49')](_0x2e4d84[_0x3e68('0x45')],{'$or':_['map'](_0x2e4d84[_0x3e68('0x40')],function(_0x1e9164){var _0x4b19b8={};_0x4b19b8[_0x1e9164]={'$like':'%'+_0x14fc35[_0x3e68('0x3d')][_0x3e68('0x48')]+'%'};return _0x4b19b8;})});}_0x2e4d84=_[_0x3e68('0x49')]({},_0x2e4d84,_0x14fc35[_0x3e68('0x4d')]);return _0x400e34[_0x3e68('0x5a')](_0x2e4d84);}})[_0x3e68('0x34')](function(_0x36eb24){if(_0x36eb24){_0x1c8ad6=_0x36eb24[_0x3e68('0x53')];if(!_0x14fc35[_0x3e68('0x3d')][_0x3e68('0x41')]('nolimit')){_0x2e4d84['limit']=qs[_0x3e68('0x2b')](_0x14fc35[_0x3e68('0x3d')][_0x3e68('0x2b')]);_0x2e4d84[_0x3e68('0x2a')]=qs[_0x3e68('0x2a')](_0x14fc35[_0x3e68('0x3d')][_0x3e68('0x2a')]);}return _0x400e34[_0x3e68('0x5a')](_0x2e4d84);}})[_0x3e68('0x34')](function(_0x480973){if(_0x480973){return _0x480973?{'count':_0x1c8ad6,'rows':_0x480973}:null;}})[_0x3e68('0x34')](respondWithResult(_0x433878,null))[_0x3e68('0x25')](handleError(_0x433878,null));};exports[_0x3e68('0x5c')]=function(_0xea4805,_0x364bee,_0x1b31df){var _0xbd4909={};var _0x57314a={};var _0x2343c2;var _0x57bef9;return db['FreshdeskConfiguration'][_0x3e68('0x5b')]({'where':{'id':_0xea4805[_0x3e68('0x52')]['id']}})[_0x3e68('0x34')](handleEntityNotFound(_0x364bee,null))[_0x3e68('0x34')](function(_0x26e1a8){if(_0x26e1a8){_0x2343c2=_0x26e1a8;_0x57314a[_0x3e68('0x3b')]=_[_0x3e68('0x3c')](db['Tag']['rawAttributes']);_0x57314a[_0x3e68('0x3d')]=_['keys'](_0xea4805[_0x3e68('0x3d')]);_0x57314a[_0x3e68('0x47')]=_[_0x3e68('0x3e')](_0x57314a['model'],_0x57314a['query']);_0xbd4909[_0x3e68('0x40')]=_['intersection'](_0x57314a['model'],qs[_0x3e68('0x3f')](_0xea4805[_0x3e68('0x3d')]['fields']));_0xbd4909[_0x3e68('0x40')]=_0xbd4909[_0x3e68('0x40')][_0x3e68('0x53')]?_0xbd4909[_0x3e68('0x40')]:_0x57314a[_0x3e68('0x3b')];_0xbd4909[_0x3e68('0x43')]=qs[_0x3e68('0x44')](_0xea4805['query'][_0x3e68('0x44')]);_0xbd4909['where']=qs[_0x3e68('0x47')](_[_0x3e68('0x46')](_0xea4805[_0x3e68('0x3d')],_0x57314a['filters']));if(_0xea4805['query']['filter']){_0xbd4909[_0x3e68('0x45')]=_['merge'](_0xbd4909[_0x3e68('0x45')],{'$or':_[_0x3e68('0x4a')](_0xbd4909['attributes'],function(_0x5d428f){var _0x18fc9d={};_0x18fc9d[_0x5d428f]={'$like':'%'+_0xea4805[_0x3e68('0x3d')][_0x3e68('0x48')]+'%'};return _0x18fc9d;})});}_0xbd4909=_[_0x3e68('0x49')]({},_0xbd4909,_0xea4805[_0x3e68('0x4d')]);return _0x2343c2[_0x3e68('0x5c')](_0xbd4909);}})['then'](function(_0x32aa2a){if(_0x32aa2a){_0x57bef9=_0x32aa2a[_0x3e68('0x53')];if(!_0xea4805[_0x3e68('0x3d')]['hasOwnProperty'](_0x3e68('0x42'))){_0xbd4909[_0x3e68('0x2b')]=qs['limit'](_0xea4805[_0x3e68('0x3d')]['limit']);_0xbd4909[_0x3e68('0x2a')]=qs[_0x3e68('0x2a')](_0xea4805[_0x3e68('0x3d')][_0x3e68('0x2a')]);}return _0x2343c2['getTags'](_0xbd4909);}})[_0x3e68('0x34')](function(_0x1f6f8d){if(_0x1f6f8d){return _0x1f6f8d?{'count':_0x57bef9,'rows':_0x1f6f8d}:null;}})['then'](respondWithResult(_0x364bee,null))[_0x3e68('0x25')](handleError(_0x364bee,null));};exports[_0x3e68('0x5d')]=function(_0x44e57d,_0x5954f6,_0x2522e8){if(_0x44e57d[_0x3e68('0x56')]['id']){delete _0x44e57d[_0x3e68('0x56')]['id'];}return db[_0x3e68('0x39')][_0x3e68('0x5b')]({'where':{'id':_0x44e57d[_0x3e68('0x52')]['id']}})['then'](handleEntityNotFound(_0x5954f6,null))[_0x3e68('0x34')](function(_0xff1be4){if(_0xff1be4){return _0xff1be4[_0x3e68('0x5d')](_0x44e57d[_0x3e68('0x56')][_0x3e68('0x5e')]||[]);}return null;})[_0x3e68('0x34')](respondWithResult(_0x5954f6,null))[_0x3e68('0x25')](handleError(_0x5954f6,null));};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
index 0a09f68..e8b7992 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x39e6=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash'];(function(_0x2cb46b,_0x494af0){var _0x3ec2c7=function(_0x3728a3){while(--_0x3728a3){_0x2cb46b['push'](_0x2cb46b['shift']());}};_0x3ec2c7(++_0x494af0);}(_0x39e6,0x173));var _0x639e=function(_0x2f4022,_0x35dc81){_0x2f4022=_0x2f4022-0x0;var _0x266444=_0x39e6[_0x2f4022];return _0x266444;};'use strict';var _=require(_0x639e('0x0'));var util=require(_0x639e('0x1'));var logger=require(_0x639e('0x2'))(_0x639e('0x3'));var moment=require(_0x639e('0x4'));var BPromise=require('bluebird');var rp=require(_0x639e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x639e('0x6'));var config=require(_0x639e('0x7'));var attributes=require(_0x639e('0x8'));module[_0x639e('0x9')]=function(_0x1bb298,_0x3dfef1){return _0x1bb298[_0x639e('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0x639e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd48=['api','moment','bluebird','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util'];(function(_0x294471,_0x406621){var _0x4f19de=function(_0x2c27e2){while(--_0x2c27e2){_0x294471['push'](_0x294471['shift']());}};_0x4f19de(++_0x406621);}(_0xdd48,0xba));var _0x8dd4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xdd48[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x8dd4('0x0'));var logger=require('../../config/logger')(_0x8dd4('0x1'));var moment=require(_0x8dd4('0x2'));var BPromise=require(_0x8dd4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dd4('0x4'));var rimraf=require('rimraf');var config=require(_0x8dd4('0x5'));var attributes=require(_0x8dd4('0x6'));module[_0x8dd4('0x7')]=function(_0x4958ec,_0x1bdbb4){return _0x4958ec[_0x8dd4('0x8')](_0x8dd4('0x9'),attributes,{'tableName':_0x8dd4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
index 345c7ea..682fe5c 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf4c=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf4c,0x163));var _0xccf4=function(_0xc2c7e,_0x55a9fe){_0xc2c7e=_0xc2c7e-0x0;var _0x54d105=_0xcf4c[_0xc2c7e];return _0x54d105;};'use strict';var _=require(_0xccf4('0x0'));var util=require(_0xccf4('0x1'));var moment=require(_0xccf4('0x2'));var BPromise=require(_0xccf4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccf4('0x4'));var db=require(_0xccf4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xccf4('0x6'))(_0xccf4('0x7'));var config=require(_0xccf4('0x8'));var jayson=require(_0xccf4('0x9'));var client=jayson[_0xccf4('0xa')][_0xccf4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x318b45,_0xeb4169,_0x3e1725){return new BPromise(function(_0x44d1a6,_0x134fc7){return client['request'](_0x318b45,_0x3e1725)[_0xccf4('0xc')](function(_0x417e92){logger[_0xccf4('0xd')](_0xccf4('0xe'),_0xeb4169,_0xccf4('0xf'));logger[_0xccf4('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0xeb4169,'request\x20sent',JSON[_0xccf4('0x11')](_0x417e92));if(_0x417e92[_0xccf4('0x12')]){if(_0x417e92['error']['code']===0x1f4){logger[_0xccf4('0x12')](_0xccf4('0xe'),_0xeb4169,_0x417e92[_0xccf4('0x12')][_0xccf4('0x13')]);return _0x134fc7(_0x417e92['error'][_0xccf4('0x13')]);}logger[_0xccf4('0x12')](_0xccf4('0xe'),_0xeb4169,_0x417e92['error'][_0xccf4('0x13')]);return _0x44d1a6(_0x417e92[_0xccf4('0x12')]['message']);}else{logger[_0xccf4('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xeb4169,_0xccf4('0xf'));_0x44d1a6(_0x417e92[_0xccf4('0x14')][_0xccf4('0x13')]);}})['catch'](function(_0x549966){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0xeb4169,_0x549966);_0x134fc7(_0x549966);});});}
\ No newline at end of file
+var _0xdad0=['bluebird','randomstring','ioredis','../../config/utils','../../config/environment','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x3b2c40,_0x462fc5){var _0x3307e8=function(_0x5e1553){while(--_0x5e1553){_0x3b2c40['push'](_0x3b2c40['shift']());}};_0x3307e8(++_0x462fc5);}(_0xdad0,0xe3));var _0x0dad=function(_0x8315a,_0x18b96e){_0x8315a=_0x8315a-0x0;var _0x1f0229=_0xdad0[_0x8315a];return _0x1f0229;};'use strict';var _=require(_0x0dad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0dad('0x1'));var rs=require(_0x0dad('0x2'));var fs=require('fs');var Redis=require(_0x0dad('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0dad('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0dad('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0dad('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3f3de4,_0x115dc4,_0x1e5cd0){return new BPromise(function(_0x4931f1,_0x5622cf){return client[_0x0dad('0x7')](_0x3f3de4,_0x1e5cd0)[_0x0dad('0x8')](function(_0x191b0b){logger[_0x0dad('0x9')](_0x0dad('0xa'),_0x115dc4,_0x0dad('0xb'));logger[_0x0dad('0xc')](_0x0dad('0xd'),_0x115dc4,_0x0dad('0xb'),JSON[_0x0dad('0xe')](_0x191b0b));if(_0x191b0b['error']){if(_0x191b0b['error']['code']===0x1f4){logger[_0x0dad('0xf')](_0x0dad('0xa'),_0x115dc4,_0x191b0b[_0x0dad('0xf')]['message']);return _0x5622cf(_0x191b0b['error'][_0x0dad('0x10')]);}logger[_0x0dad('0xf')](_0x0dad('0xa'),_0x115dc4,_0x191b0b[_0x0dad('0xf')][_0x0dad('0x10')]);return _0x4931f1(_0x191b0b['error'][_0x0dad('0x10')]);}else{logger[_0x0dad('0x9')](_0x0dad('0xa'),_0x115dc4,_0x0dad('0xb'));_0x4931f1(_0x191b0b[_0x0dad('0x11')][_0x0dad('0x10')]);}})[_0x0dad('0x12')](function(_0x2c473f){logger[_0x0dad('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x115dc4,_0x2c473f);_0x5622cf(_0x2c473f);});});}
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js
index 12ee4c1..61682c4 100644
--- a/server/api/intFreshdeskField/index.js
+++ b/server/api/intFreshdeskField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9039=['/:id','show','post','create','update','destroy','exports','util','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index'];(function(_0x97eeef,_0xab42c5){var _0x5d8a3b=function(_0xeb3910){while(--_0xeb3910){_0x97eeef['push'](_0x97eeef['shift']());}};_0x5d8a3b(++_0xab42c5);}(_0x9039,0x1ab));var _0x9903=function(_0x22beab,_0x410db5){_0x22beab=_0x22beab-0x0;var _0x39f010=_0x9039[_0x22beab];return _0x39f010;};'use strict';var multer=require('multer');var util=require(_0x9903('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9903('0x1'));var router=express['Router']();var auth=require(_0x9903('0x2'));var interaction=require(_0x9903('0x3'));var config=require('../../config/environment');var controller=require(_0x9903('0x4'));router[_0x9903('0x5')]('/',auth[_0x9903('0x6')](),controller[_0x9903('0x7')]);router['get'](_0x9903('0x8'),auth[_0x9903('0x6')](),controller[_0x9903('0x9')]);router[_0x9903('0xa')]('/',auth[_0x9903('0x6')](),controller[_0x9903('0xb')]);router['put'](_0x9903('0x8'),auth[_0x9903('0x6')](),controller[_0x9903('0xc')]);router['delete'](_0x9903('0x8'),auth[_0x9903('0x6')](),controller[_0x9903('0xd')]);module[_0x9903('0xe')]=router;
\ No newline at end of file
+var _0xb2d4=['get','isAuthenticated','index','/:id','post','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x8d40e4,_0x1dd16f){var _0x36c491=function(_0x2b9415){while(--_0x2b9415){_0x8d40e4['push'](_0x8d40e4['shift']());}};_0x36c491(++_0x1dd16f);}(_0xb2d4,0x1a8));var _0x4b2d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb2d4[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x4b2d('0x0'));var util=require(_0x4b2d('0x1'));var path=require(_0x4b2d('0x2'));var timeout=require(_0x4b2d('0x3'));var express=require(_0x4b2d('0x4'));var router=express[_0x4b2d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4b2d('0x6'));var config=require(_0x4b2d('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x4b2d('0x8')]('/',auth[_0x4b2d('0x9')](),controller[_0x4b2d('0xa')]);router[_0x4b2d('0x8')](_0x4b2d('0xb'),auth[_0x4b2d('0x9')](),controller['show']);router[_0x4b2d('0xc')]('/',auth[_0x4b2d('0x9')](),controller['create']);router['put'](_0x4b2d('0xb'),auth['isAuthenticated'](),controller[_0x4b2d('0xd')]);router[_0x4b2d('0xe')](_0x4b2d('0xb'),auth[_0x4b2d('0x9')](),controller['destroy']);module[_0x4b2d('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js
index c8d2c4e..234576a 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.attributes.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe5b5=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0xe5b5,0x12b));var _0x5e5b=function(_0xe719ec,_0x5a280e){_0xe719ec=_0xe719ec-0x0;var _0x4842a1=_0xe5b5[_0xe719ec];return _0x4842a1;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'type':{'type':Sequelize[_0x5e5b('0x2')](_0x5e5b('0x3'),_0x5e5b('0x4'),_0x5e5b('0x5'),_0x5e5b('0x6')),'defaultValue':_0x5e5b('0x3')},'content':{'type':Sequelize[_0x5e5b('0x7')]},'key':{'type':Sequelize[_0x5e5b('0x7')]},'keyType':{'type':Sequelize[_0x5e5b('0x2')](_0x5e5b('0x3'),_0x5e5b('0x4'),_0x5e5b('0x5'))},'keyContent':{'type':Sequelize[_0x5e5b('0x7')]},'idField':{'type':Sequelize[_0x5e5b('0x7')]},'nameField':{'type':Sequelize[_0x5e5b('0x7')]},'customField':{'type':Sequelize[_0x5e5b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5e5b('0x7')]}};
\ No newline at end of file
+var _0x41bb=['exports','string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN','sequelize'];(function(_0x423433,_0x3309da){var _0x34fa95=function(_0xea3c12){while(--_0xea3c12){_0x423433['push'](_0x423433['shift']());}};_0x34fa95(++_0x3309da);}(_0x41bb,0xc5));var _0xb41b=function(_0x26e650,_0x509e29){_0x26e650=_0x26e650-0x0;var _0x5058cb=_0x41bb[_0x26e650];return _0x5058cb;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb41b('0x2'),'variable',_0xb41b('0x3'),_0xb41b('0x4')),'defaultValue':_0xb41b('0x2')},'content':{'type':Sequelize[_0xb41b('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb41b('0x6')](_0xb41b('0x2'),_0xb41b('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb41b('0x5')]},'customField':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js
index faa4717..c8822e1 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.controller.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6437=['squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','error','stack','name','FreshdeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','key','VIRTUAL','field','options','include','catch','show','includeAll','find','create','body','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash'];(function(_0x32d7e8,_0x2ad5d8){var _0x33f098=function(_0x490c3a){while(--_0x490c3a){_0x32d7e8['push'](_0x32d7e8['shift']());}};_0x33f098(++_0x2ad5d8);}(_0x6437,0x152));var _0x7643=function(_0xcf2509,_0x585310){_0xcf2509=_0xcf2509-0x0;var _0x280016=_0x6437[_0xcf2509];return _0x280016;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7643('0x0'));var rimraf=require(_0x7643('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7643('0x2'));var rp=require(_0x7643('0x3'));var moment=require(_0x7643('0x4'));var BPromise=require(_0x7643('0x5'));var Mustache=require(_0x7643('0x6'));var util=require('util');var path=require(_0x7643('0x7'));var sox=require(_0x7643('0x8'));var csv=require(_0x7643('0x9'));var ejs=require(_0x7643('0xa'));var fs=require('fs');var _=require(_0x7643('0xb'));var squel=require(_0x7643('0xc'));var crypto=require('crypto');var jsforce=require(_0x7643('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7643('0x9'));var querystring=require(_0x7643('0xe'));var Papa=require(_0x7643('0xf'));var Redis=require(_0x7643('0x10'));var authService=require(_0x7643('0x11'));var qs=require(_0x7643('0x12'));var hardwareService=require(_0x7643('0x13'));var logger=require(_0x7643('0x14'))(_0x7643('0x15'));var utils=require(_0x7643('0x16'));var config=require(_0x7643('0x17'));var db=require(_0x7643('0x18'))['db'];function respondWithStatusCode(_0x24b164,_0x16e76e){_0x16e76e=_0x16e76e||0xcc;return function(_0x2527b9){if(_0x2527b9){return _0x24b164[_0x7643('0x19')](_0x16e76e);}return _0x24b164[_0x7643('0x1a')](_0x16e76e)[_0x7643('0x1b')]();};}function respondWithResult(_0x420b95,_0x41f5d8){_0x41f5d8=_0x41f5d8||0xc8;return function(_0x5d3e98){if(_0x5d3e98){return _0x420b95['status'](_0x41f5d8)[_0x7643('0x1c')](_0x5d3e98);}};}function respondWithFilteredResult(_0x5a2a39,_0x311f12){return function(_0x3edabc){if(_0x3edabc){var _0x3469a7=_0x3edabc[_0x7643('0x1d')],_0x12a751=_0x311f12[_0x7643('0x1e')],_0x3f46d3=_0x311f12[_0x7643('0x1e')]+_0x311f12[_0x7643('0x1f')],_0x38e045;if(_0x3f46d3>=_0x3469a7){_0x3f46d3=_0x3469a7;_0x38e045=0xc8;}else{_0x38e045=0xce;}_0x5a2a39[_0x7643('0x1a')](_0x38e045);return _0x5a2a39[_0x7643('0x20')]('Content-Range',_0x12a751+'-'+_0x3f46d3+'/'+_0x3469a7)[_0x7643('0x1c')](_0x3edabc);}return null;};}function patchUpdates(_0x2cc517){return function(_0x1aefa6){try{jsonpatch[_0x7643('0x21')](_0x1aefa6,_0x2cc517,!![]);}catch(_0x3efadb){return BPromise[_0x7643('0x22')](_0x3efadb);}return _0x1aefa6[_0x7643('0x23')]();};}function saveUpdates(_0x17e6c2,_0x5867cf){return function(_0xad22ce){if(_0xad22ce){return _0xad22ce['update'](_0x17e6c2)[_0x7643('0x24')](function(_0x1e7a91){return _0x1e7a91;});}return null;};}function removeEntity(_0x44442,_0xc6da2e){return function(_0x2c1008){if(_0x2c1008){return _0x2c1008[_0x7643('0x25')]()[_0x7643('0x24')](function(){_0x44442['status'](0xcc)[_0x7643('0x1b')]();});}};}function handleEntityNotFound(_0x39d942,_0x36e2b3){return function(_0x31c1a9){if(!_0x31c1a9){_0x39d942[_0x7643('0x19')](0x194);}return _0x31c1a9;};}function handleError(_0x58189d,_0x4732b0){_0x4732b0=_0x4732b0||0x1f4;return function(_0x41d73c){logger[_0x7643('0x26')](_0x41d73c[_0x7643('0x27')]);if(_0x41d73c[_0x7643('0x28')]){delete _0x41d73c['name'];}_0x58189d['status'](_0x4732b0)['send'](_0x41d73c);};}exports['index']=function(_0x3a8abc,_0x4f4030){var _0x4a8162={},_0x5ca0fb={},_0x54ecd7={'count':0x0,'rows':[]};var _0x53bbc0=db[_0x7643('0x29')][_0x7643('0x2a')];_0x5ca0fb[_0x7643('0x2b')]=_[_0x7643('0x2c')](_0x53bbc0);_0x5ca0fb['query']=_[_0x7643('0x2c')](_0x3a8abc[_0x7643('0x2d')]);_0x5ca0fb[_0x7643('0x2e')]=_[_0x7643('0x2f')](_0x5ca0fb[_0x7643('0x2b')],_0x5ca0fb['query']);_0x4a8162[_0x7643('0x30')]=_['intersection'](_0x5ca0fb[_0x7643('0x2b')],qs[_0x7643('0x31')](_0x3a8abc[_0x7643('0x2d')][_0x7643('0x31')]));_0x4a8162[_0x7643('0x30')]=_0x4a8162[_0x7643('0x30')][_0x7643('0x32')]?_0x4a8162['attributes']:_0x5ca0fb[_0x7643('0x2b')];if(!_0x3a8abc['query']['hasOwnProperty'](_0x7643('0x33'))){_0x4a8162['limit']=qs[_0x7643('0x1f')](_0x3a8abc[_0x7643('0x2d')][_0x7643('0x1f')]);_0x4a8162['offset']=qs['offset'](_0x3a8abc[_0x7643('0x2d')]['offset']);}_0x4a8162[_0x7643('0x34')]=qs[_0x7643('0x35')](_0x3a8abc[_0x7643('0x2d')][_0x7643('0x35')]);_0x4a8162['where']=qs[_0x7643('0x2e')](_['pick'](_0x3a8abc[_0x7643('0x2d')],_0x5ca0fb[_0x7643('0x2e')]));if(_0x3a8abc['query'][_0x7643('0x36')]){_0x4a8162[_0x7643('0x37')]=_[_0x7643('0x38')](_0x4a8162[_0x7643('0x37')],{'$or':_['map'](_0x53bbc0,function(_0x54948f){if(_0x54948f['type'][_0x7643('0x39')]!==_0x7643('0x3a')){var _0x19f741={};_0x19f741[_0x54948f[_0x7643('0x3b')]]={'$like':'%'+_0x3a8abc[_0x7643('0x2d')][_0x7643('0x36')]+'%'};return _0x19f741;}})});}_0x4a8162=_[_0x7643('0x38')]({},_0x4a8162,_0x3a8abc[_0x7643('0x3c')]);var _0xdc64f4={'where':_0x4a8162[_0x7643('0x37')]};return db['FreshdeskField']['count'](_0xdc64f4)[_0x7643('0x24')](function(_0x40db2a){_0x54ecd7['count']=_0x40db2a;if(_0x3a8abc[_0x7643('0x2d')]['includeAll']){_0x4a8162[_0x7643('0x3d')]=[{'all':!![]}];}return db[_0x7643('0x29')]['findAll'](_0x4a8162);})[_0x7643('0x24')](function(_0x5636cb){_0x54ecd7['rows']=_0x5636cb;return _0x54ecd7;})[_0x7643('0x24')](respondWithFilteredResult(_0x4f4030,_0x4a8162))[_0x7643('0x3e')](handleError(_0x4f4030,null));};exports[_0x7643('0x3f')]=function(_0x4660ee,_0x3c5cb9){var _0x4784b4={'raw':!![],'where':{'id':_0x4660ee['params']['id']}},_0x840e24={};_0x840e24['model']=_['keys'](db[_0x7643('0x29')]['rawAttributes']);_0x840e24['query']=_[_0x7643('0x2c')](_0x4660ee[_0x7643('0x2d')]);_0x840e24[_0x7643('0x2e')]=_[_0x7643('0x2f')](_0x840e24[_0x7643('0x2b')],_0x840e24['query']);_0x4784b4[_0x7643('0x30')]=_[_0x7643('0x2f')](_0x840e24['model'],qs['fields'](_0x4660ee[_0x7643('0x2d')][_0x7643('0x31')]));_0x4784b4[_0x7643('0x30')]=_0x4784b4[_0x7643('0x30')][_0x7643('0x32')]?_0x4784b4['attributes']:_0x840e24[_0x7643('0x2b')];if(_0x4660ee[_0x7643('0x2d')][_0x7643('0x40')]){_0x4784b4[_0x7643('0x3d')]=[{'all':!![]}];}_0x4784b4=_[_0x7643('0x38')]({},_0x4784b4,_0x4660ee['options']);return db[_0x7643('0x29')][_0x7643('0x41')](_0x4784b4)['then'](handleEntityNotFound(_0x3c5cb9,null))[_0x7643('0x24')](respondWithResult(_0x3c5cb9,null))['catch'](handleError(_0x3c5cb9,null));};exports[_0x7643('0x42')]=function(_0x1feb30,_0x12f9c6){return db[_0x7643('0x29')][_0x7643('0x42')](_0x1feb30[_0x7643('0x43')],{})[_0x7643('0x24')](respondWithResult(_0x12f9c6,0xc9))[_0x7643('0x3e')](handleError(_0x12f9c6,null));};exports[_0x7643('0x44')]=function(_0x2df794,_0x249c2d){if(_0x2df794[_0x7643('0x43')]['id']){delete _0x2df794[_0x7643('0x43')]['id'];}return db[_0x7643('0x29')]['find']({'where':{'id':_0x2df794['params']['id']}})[_0x7643('0x24')](handleEntityNotFound(_0x249c2d,null))[_0x7643('0x24')](saveUpdates(_0x2df794[_0x7643('0x43')],null))['then'](respondWithResult(_0x249c2d,null))[_0x7643('0x3e')](handleError(_0x249c2d,null));};exports['destroy']=function(_0x29dd88,_0x2fb258){return db[_0x7643('0x29')]['find']({'where':{'id':_0x29dd88[_0x7643('0x45')]['id']}})[_0x7643('0x24')](handleEntityNotFound(_0x2fb258,null))[_0x7643('0x24')](removeEntity(_0x2fb258,null))['catch'](handleError(_0x2fb258,null));};
\ No newline at end of file
+var _0x4a20=['set','Content-Range','reject','save','update','then','error','stack','name','index','FreshdeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit'];(function(_0x5e3c7c,_0x2d533d){var _0x352d5c=function(_0x26a4d8){while(--_0x26a4d8){_0x5e3c7c['push'](_0x5e3c7c['shift']());}};_0x352d5c(++_0x2d533d);}(_0x4a20,0x75));var _0x04a2=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x4a20[_0xa148b7];return _0x51efd3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x04a2('0x0'));var rimraf=require(_0x04a2('0x1'));var zipdir=require(_0x04a2('0x2'));var jsonpatch=require(_0x04a2('0x3'));var rp=require('request-promise');var moment=require(_0x04a2('0x4'));var BPromise=require(_0x04a2('0x5'));var Mustache=require(_0x04a2('0x6'));var util=require(_0x04a2('0x7'));var path=require(_0x04a2('0x8'));var sox=require(_0x04a2('0x9'));var csv=require('to-csv');var ejs=require(_0x04a2('0xa'));var fs=require('fs');var _=require(_0x04a2('0xb'));var squel=require(_0x04a2('0xc'));var crypto=require(_0x04a2('0xd'));var jsforce=require(_0x04a2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x04a2('0xf'));var querystring=require('querystring');var Papa=require(_0x04a2('0x10'));var Redis=require(_0x04a2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x04a2('0x12'));var hardwareService=require(_0x04a2('0x13'));var logger=require('../../config/logger')(_0x04a2('0x14'));var utils=require(_0x04a2('0x15'));var config=require(_0x04a2('0x16'));var db=require(_0x04a2('0x17'))['db'];function respondWithStatusCode(_0x339d52,_0x35145b){_0x35145b=_0x35145b||0xcc;return function(_0x24d0a0){if(_0x24d0a0){return _0x339d52[_0x04a2('0x18')](_0x35145b);}return _0x339d52['status'](_0x35145b)[_0x04a2('0x19')]();};}function respondWithResult(_0x5a24a6,_0x5af73f){_0x5af73f=_0x5af73f||0xc8;return function(_0x57e406){if(_0x57e406){return _0x5a24a6[_0x04a2('0x1a')](_0x5af73f)[_0x04a2('0x1b')](_0x57e406);}};}function respondWithFilteredResult(_0xf77071,_0xae6c7a){return function(_0x48345d){if(_0x48345d){var _0x56679f=_0x48345d[_0x04a2('0x1c')],_0x106966=_0xae6c7a['offset'],_0x4b1a29=_0xae6c7a[_0x04a2('0x1d')]+_0xae6c7a[_0x04a2('0x1e')],_0x585023;if(_0x4b1a29>=_0x56679f){_0x4b1a29=_0x56679f;_0x585023=0xc8;}else{_0x585023=0xce;}_0xf77071[_0x04a2('0x1a')](_0x585023);return _0xf77071[_0x04a2('0x1f')](_0x04a2('0x20'),_0x106966+'-'+_0x4b1a29+'/'+_0x56679f)[_0x04a2('0x1b')](_0x48345d);}return null;};}function patchUpdates(_0x30d306){return function(_0x194c40){try{jsonpatch['apply'](_0x194c40,_0x30d306,!![]);}catch(_0x58713f){return BPromise[_0x04a2('0x21')](_0x58713f);}return _0x194c40[_0x04a2('0x22')]();};}function saveUpdates(_0x2f5b16,_0x2d5681){return function(_0x2e9db8){if(_0x2e9db8){return _0x2e9db8[_0x04a2('0x23')](_0x2f5b16)[_0x04a2('0x24')](function(_0x570a8f){return _0x570a8f;});}return null;};}function removeEntity(_0x175bc1,_0x229ce0){return function(_0x199d1a){if(_0x199d1a){return _0x199d1a['destroy']()[_0x04a2('0x24')](function(){_0x175bc1[_0x04a2('0x1a')](0xcc)[_0x04a2('0x19')]();});}};}function handleEntityNotFound(_0x121697,_0x401983){return function(_0x43746c){if(!_0x43746c){_0x121697[_0x04a2('0x18')](0x194);}return _0x43746c;};}function handleError(_0xfa4f3e,_0x380e6d){_0x380e6d=_0x380e6d||0x1f4;return function(_0x522834){logger[_0x04a2('0x25')](_0x522834[_0x04a2('0x26')]);if(_0x522834['name']){delete _0x522834[_0x04a2('0x27')];}_0xfa4f3e[_0x04a2('0x1a')](_0x380e6d)['send'](_0x522834);};}exports[_0x04a2('0x28')]=function(_0x5559f9,_0x240ffa){var _0x41d1fa={},_0x19bbbe={},_0x3731c8={'count':0x0,'rows':[]};var _0x232b38=db[_0x04a2('0x29')][_0x04a2('0x2a')];_0x19bbbe[_0x04a2('0x2b')]=_['keys'](_0x232b38);_0x19bbbe['query']=_[_0x04a2('0x2c')](_0x5559f9[_0x04a2('0x2d')]);_0x19bbbe[_0x04a2('0x2e')]=_[_0x04a2('0x2f')](_0x19bbbe[_0x04a2('0x2b')],_0x19bbbe['query']);_0x41d1fa[_0x04a2('0x30')]=_[_0x04a2('0x2f')](_0x19bbbe[_0x04a2('0x2b')],qs[_0x04a2('0x31')](_0x5559f9[_0x04a2('0x2d')][_0x04a2('0x31')]));_0x41d1fa['attributes']=_0x41d1fa[_0x04a2('0x30')][_0x04a2('0x32')]?_0x41d1fa['attributes']:_0x19bbbe[_0x04a2('0x2b')];if(!_0x5559f9[_0x04a2('0x2d')]['hasOwnProperty'](_0x04a2('0x33'))){_0x41d1fa[_0x04a2('0x1e')]=qs[_0x04a2('0x1e')](_0x5559f9['query'][_0x04a2('0x1e')]);_0x41d1fa[_0x04a2('0x1d')]=qs[_0x04a2('0x1d')](_0x5559f9[_0x04a2('0x2d')][_0x04a2('0x1d')]);}_0x41d1fa[_0x04a2('0x34')]=qs[_0x04a2('0x35')](_0x5559f9[_0x04a2('0x2d')][_0x04a2('0x35')]);_0x41d1fa[_0x04a2('0x36')]=qs[_0x04a2('0x2e')](_[_0x04a2('0x37')](_0x5559f9[_0x04a2('0x2d')],_0x19bbbe[_0x04a2('0x2e')]));if(_0x5559f9['query']['filter']){_0x41d1fa[_0x04a2('0x36')]=_[_0x04a2('0x38')](_0x41d1fa[_0x04a2('0x36')],{'$or':_[_0x04a2('0x39')](_0x232b38,function(_0x4ceb00){if(_0x4ceb00[_0x04a2('0x3a')][_0x04a2('0x3b')]!==_0x04a2('0x3c')){var _0x12957b={};_0x12957b[_0x4ceb00[_0x04a2('0x3d')]]={'$like':'%'+_0x5559f9[_0x04a2('0x2d')][_0x04a2('0x3e')]+'%'};return _0x12957b;}})});}_0x41d1fa=_[_0x04a2('0x38')]({},_0x41d1fa,_0x5559f9[_0x04a2('0x3f')]);var _0x17d981={'where':_0x41d1fa[_0x04a2('0x36')]};return db['FreshdeskField'][_0x04a2('0x1c')](_0x17d981)['then'](function(_0x29a532){_0x3731c8[_0x04a2('0x1c')]=_0x29a532;if(_0x5559f9[_0x04a2('0x2d')][_0x04a2('0x40')]){_0x41d1fa[_0x04a2('0x41')]=[{'all':!![]}];}return db[_0x04a2('0x29')][_0x04a2('0x42')](_0x41d1fa);})['then'](function(_0x34a3f6){_0x3731c8[_0x04a2('0x43')]=_0x34a3f6;return _0x3731c8;})['then'](respondWithFilteredResult(_0x240ffa,_0x41d1fa))[_0x04a2('0x44')](handleError(_0x240ffa,null));};exports[_0x04a2('0x45')]=function(_0x1d537d,_0x3cd6ea){var _0x582863={'raw':!![],'where':{'id':_0x1d537d['params']['id']}},_0x425b62={};_0x425b62['model']=_[_0x04a2('0x2c')](db[_0x04a2('0x29')][_0x04a2('0x2a')]);_0x425b62[_0x04a2('0x2d')]=_[_0x04a2('0x2c')](_0x1d537d[_0x04a2('0x2d')]);_0x425b62[_0x04a2('0x2e')]=_[_0x04a2('0x2f')](_0x425b62[_0x04a2('0x2b')],_0x425b62['query']);_0x582863['attributes']=_[_0x04a2('0x2f')](_0x425b62[_0x04a2('0x2b')],qs[_0x04a2('0x31')](_0x1d537d['query'][_0x04a2('0x31')]));_0x582863[_0x04a2('0x30')]=_0x582863[_0x04a2('0x30')]['length']?_0x582863[_0x04a2('0x30')]:_0x425b62['model'];if(_0x1d537d[_0x04a2('0x2d')][_0x04a2('0x40')]){_0x582863[_0x04a2('0x41')]=[{'all':!![]}];}_0x582863=_[_0x04a2('0x38')]({},_0x582863,_0x1d537d[_0x04a2('0x3f')]);return db[_0x04a2('0x29')][_0x04a2('0x46')](_0x582863)[_0x04a2('0x24')](handleEntityNotFound(_0x3cd6ea,null))[_0x04a2('0x24')](respondWithResult(_0x3cd6ea,null))[_0x04a2('0x44')](handleError(_0x3cd6ea,null));};exports[_0x04a2('0x47')]=function(_0x2823b9,_0x172a3b){return db['FreshdeskField'][_0x04a2('0x47')](_0x2823b9[_0x04a2('0x48')],{})[_0x04a2('0x24')](respondWithResult(_0x172a3b,0xc9))['catch'](handleError(_0x172a3b,null));};exports[_0x04a2('0x23')]=function(_0x11ccb2,_0xf34aa4){if(_0x11ccb2[_0x04a2('0x48')]['id']){delete _0x11ccb2[_0x04a2('0x48')]['id'];}return db[_0x04a2('0x29')][_0x04a2('0x46')]({'where':{'id':_0x11ccb2[_0x04a2('0x49')]['id']}})[_0x04a2('0x24')](handleEntityNotFound(_0xf34aa4,null))[_0x04a2('0x24')](saveUpdates(_0x11ccb2[_0x04a2('0x48')],null))[_0x04a2('0x24')](respondWithResult(_0xf34aa4,null))[_0x04a2('0x44')](handleError(_0xf34aa4,null));};exports['destroy']=function(_0x2f9afd,_0x594ca5){return db[_0x04a2('0x29')][_0x04a2('0x46')]({'where':{'id':_0x2f9afd['params']['id']}})[_0x04a2('0x24')](handleEntityNotFound(_0x594ca5,null))[_0x04a2('0x24')](removeEntity(_0x594ca5,null))['catch'](handleError(_0x594ca5,null));};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js
index a6e08eb..11322e5 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.model.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x61a0=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','api','request-promise','rimraf','./intFreshdeskField.attributes','exports'];(function(_0x366ac7,_0x1b3148){var _0xed932a=function(_0x531fff){while(--_0x531fff){_0x366ac7['push'](_0x366ac7['shift']());}};_0xed932a(++_0x1b3148);}(_0x61a0,0x1a9));var _0x061a=function(_0x4b573a,_0x13828a){_0x4b573a=_0x4b573a-0x0;var _0x1ae343=_0x61a0[_0x4b573a];return _0x1ae343;};'use strict';var _=require(_0x061a('0x0'));var util=require(_0x061a('0x1'));var logger=require('../../config/logger')(_0x061a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x061a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x061a('0x4'));var config=require('../../config/environment');var attributes=require(_0x061a('0x5'));module[_0x061a('0x6')]=function(_0xd2d139,_0x71e24e){return _0xd2d139[_0x061a('0x7')](_0x061a('0x8'),attributes,{'tableName':_0x061a('0x9'),'paranoid':![],'indexes':[{'name':_0x061a('0xa'),'fields':['idField',_0x061a('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x22dc=['request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x324019,_0x77c7fe){var _0x59b3ec=function(_0x168be6){while(--_0x168be6){_0x324019['push'](_0x324019['shift']());}};_0x59b3ec(++_0x77c7fe);}(_0x22dc,0x10a));var _0xc22d=function(_0x307394,_0x820b68){_0x307394=_0x307394-0x0;var _0x3b866c=_0x22dc[_0x307394];return _0x3b866c;};'use strict';var _=require(_0xc22d('0x0'));var util=require(_0xc22d('0x1'));var logger=require(_0xc22d('0x2'))(_0xc22d('0x3'));var moment=require(_0xc22d('0x4'));var BPromise=require(_0xc22d('0x5'));var rp=require(_0xc22d('0x6'));var fs=require('fs');var path=require(_0xc22d('0x7'));var rimraf=require(_0xc22d('0x8'));var config=require('../../config/environment');var attributes=require(_0xc22d('0x9'));module[_0xc22d('0xa')]=function(_0x303fdb,_0x48e850){return _0x303fdb[_0xc22d('0xb')](_0xc22d('0xc'),attributes,{'tableName':_0xc22d('0xd'),'paranoid':![],'indexes':[{'name':_0xc22d('0xe'),'fields':['idField',_0xc22d('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js
index 3303f44..fe72ee3 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec56=['http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xec56,0x1bd));var _0x6ec5=function(_0x537f56,_0x5055ef){_0x537f56=_0x537f56-0x0;var _0x317172=_0xec56[_0x537f56];return _0x317172;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ec5('0x1'));var rs=require(_0x6ec5('0x2'));var fs=require('fs');var Redis=require(_0x6ec5('0x3'));var db=require(_0x6ec5('0x4'))['db'];var utils=require(_0x6ec5('0x5'));var logger=require(_0x6ec5('0x6'))(_0x6ec5('0x7'));var config=require(_0x6ec5('0x8'));var jayson=require(_0x6ec5('0x9'));var client=jayson[_0x6ec5('0xa')][_0x6ec5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bb683,_0x35be4e,_0x1f59cd){return new BPromise(function(_0x3dd891,_0x225d2f){return client[_0x6ec5('0xc')](_0x3bb683,_0x1f59cd)[_0x6ec5('0xd')](function(_0x3ff17c){logger['info'](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));logger[_0x6ec5('0x10')](_0x6ec5('0x11'),_0x35be4e,_0x6ec5('0xf'),JSON[_0x6ec5('0x12')](_0x3ff17c));if(_0x3ff17c[_0x6ec5('0x13')]){if(_0x3ff17c['error'][_0x6ec5('0x14')]===0x1f4){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);return _0x225d2f(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}logger[_0x6ec5('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x35be4e,_0x3ff17c[_0x6ec5('0x13')]['message']);return _0x3dd891(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}else{logger[_0x6ec5('0x16')](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));_0x3dd891(_0x3ff17c['result'][_0x6ec5('0x15')]);}})[_0x6ec5('0x17')](function(_0x125ae6){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x125ae6);_0x225d2f(_0x125ae6);});});}
\ No newline at end of file
+var _0xb647=['request','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x260e2f,_0x1de771){var _0x4b93f9=function(_0x2fb8ed){while(--_0x2fb8ed){_0x260e2f['push'](_0x260e2f['shift']());}};_0x4b93f9(++_0x1de771);}(_0xb647,0xdb));var _0x7b64=function(_0x266346,_0x536a12){_0x266346=_0x266346-0x0;var _0x1fd095=_0xb647[_0x266346];return _0x1fd095;};'use strict';var _=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var moment=require(_0x7b64('0x2'));var BPromise=require(_0x7b64('0x3'));var rs=require(_0x7b64('0x4'));var fs=require('fs');var Redis=require(_0x7b64('0x5'));var db=require(_0x7b64('0x6'))['db'];var utils=require(_0x7b64('0x7'));var logger=require('../../config/logger')(_0x7b64('0x8'));var config=require('../../config/environment');var jayson=require(_0x7b64('0x9'));var client=jayson[_0x7b64('0xa')][_0x7b64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x80721a,_0xcdec41,_0x22eca3){return new BPromise(function(_0x727684,_0x2ff650){return client[_0x7b64('0xc')](_0x80721a,_0x22eca3)['then'](function(_0x1b8b2a){logger['info'](_0x7b64('0xd'),_0xcdec41,'request\x20sent');logger['debug'](_0x7b64('0xe'),_0xcdec41,_0x7b64('0xf'),JSON['stringify'](_0x1b8b2a));if(_0x1b8b2a[_0x7b64('0x10')]){if(_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x11')]===0x1f4){logger[_0x7b64('0x10')](_0x7b64('0xd'),_0xcdec41,_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);return _0x2ff650(_0x1b8b2a['error'][_0x7b64('0x12')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0xcdec41,_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);return _0x727684(_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);}else{logger[_0x7b64('0x13')](_0x7b64('0xd'),_0xcdec41,_0x7b64('0xf'));_0x727684(_0x1b8b2a['result'][_0x7b64('0x12')]);}})[_0x7b64('0x14')](function(_0x16ff72){logger[_0x7b64('0x10')](_0x7b64('0xd'),_0xcdec41,_0x16ff72);_0x2ff650(_0x16ff72);});});}
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js
index 2ad0b26..9beba86 100644
--- a/server/api/intSalesforceAccount/index.js
+++ b/server/api/intSalesforceAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8107=['get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','isAuthenticated','index'];(function(_0x1afaec,_0x1a69f1){var _0x14db6e=function(_0x1240a2){while(--_0x1240a2){_0x1afaec['push'](_0x1afaec['shift']());}};_0x14db6e(++_0x1a69f1);}(_0x8107,0x1bd));var _0x7810=function(_0x5aa1e2,_0x2b5adb){_0x5aa1e2=_0x5aa1e2-0x0;var _0x399098=_0x8107[_0x5aa1e2];return _0x399098;};'use strict';var multer=require(_0x7810('0x0'));var util=require(_0x7810('0x1'));var path=require('path');var timeout=require(_0x7810('0x2'));var express=require(_0x7810('0x3'));var router=express[_0x7810('0x4')]();var auth=require(_0x7810('0x5'));var interaction=require(_0x7810('0x6'));var config=require(_0x7810('0x7'));var controller=require(_0x7810('0x8'));router['get']('/',auth[_0x7810('0x9')](),controller[_0x7810('0xa')]);router[_0x7810('0xb')](_0x7810('0xc'),auth[_0x7810('0x9')](),controller[_0x7810('0xd')]);router['get'](_0x7810('0xe'),auth[_0x7810('0x9')](),controller[_0x7810('0xf')]);router['get'](_0x7810('0x10'),auth['isAuthenticated'](),controller[_0x7810('0x11')]);router[_0x7810('0x12')]('/',auth[_0x7810('0x9')](),controller[_0x7810('0x13')]);router[_0x7810('0x12')](_0x7810('0xe'),auth[_0x7810('0x9')](),controller[_0x7810('0x14')]);router[_0x7810('0x15')](_0x7810('0xc'),auth[_0x7810('0x9')](),controller['update']);router[_0x7810('0x16')](_0x7810('0xc'),auth[_0x7810('0x9')](),controller[_0x7810('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xe791=['/:id','/:id/configurations','/:id/fields','create','post','put','update','delete','destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','isAuthenticated','index','get'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xe791,0x1be));var _0x1e79=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xe791[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0x1e79('0x0'));var util=require(_0x1e79('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1e79('0x2'));var router=express['Router']();var auth=require(_0x1e79('0x3'));var interaction=require(_0x1e79('0x4'));var config=require(_0x1e79('0x5'));var controller=require(_0x1e79('0x6'));router['get']('/',auth[_0x1e79('0x7')](),controller[_0x1e79('0x8')]);router[_0x1e79('0x9')](_0x1e79('0xa'),auth[_0x1e79('0x7')](),controller['show']);router[_0x1e79('0x9')](_0x1e79('0xb'),auth[_0x1e79('0x7')](),controller['getConfigurations']);router[_0x1e79('0x9')](_0x1e79('0xc'),auth[_0x1e79('0x7')](),controller['getFields']);router['post']('/',auth[_0x1e79('0x7')](),controller[_0x1e79('0xd')]);router[_0x1e79('0xe')]('/:id/configurations',auth[_0x1e79('0x7')](),controller['addConfiguration']);router[_0x1e79('0xf')](_0x1e79('0xa'),auth[_0x1e79('0x7')](),controller[_0x1e79('0x10')]);router[_0x1e79('0x11')](_0x1e79('0xa'),auth[_0x1e79('0x7')](),controller[_0x1e79('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
index 66fb99e..1993c74 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd6c4=['newTab','sequelize','exports','STRING','ENUM','integrationTab'];(function(_0x465f8f,_0x19eaa9){var _0x30198d=function(_0x57dd48){while(--_0x57dd48){_0x465f8f['push'](_0x465f8f['shift']());}};_0x30198d(++_0x19eaa9);}(_0xd6c4,0xfd));var _0x4d6c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd6c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4d6c('0x0'));module[_0x4d6c('0x1')]={'name':{'type':Sequelize[_0x4d6c('0x2')]},'description':{'type':Sequelize[_0x4d6c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x4d6c('0x2')]},'password':{'type':Sequelize[_0x4d6c('0x2')]},'clientId':{'type':Sequelize[_0x4d6c('0x2')]},'clientSecret':{'type':Sequelize[_0x4d6c('0x2')]},'securityToken':{'type':Sequelize[_0x4d6c('0x2')]},'serverUrl':{'type':Sequelize[_0x4d6c('0x2')]},'type':{'type':Sequelize[_0x4d6c('0x3')](_0x4d6c('0x4'),_0x4d6c('0x5')),'defaultValue':_0x4d6c('0x4')}};
\ No newline at end of file
+var _0xc54b=['STRING','integrationTab','sequelize','exports'];(function(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0xc54b,0x13a));var _0xbc54=function(_0x539386,_0x4cbc27){_0x539386=_0x539386-0x0;var _0x3d370c=_0xc54b[_0x539386];return _0x3d370c;};'use strict';var Sequelize=require(_0xbc54('0x0'));module[_0xbc54('0x1')]={'name':{'type':Sequelize[_0xbc54('0x2')]},'description':{'type':Sequelize[_0xbc54('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xbc54('0x2')]},'password':{'type':Sequelize[_0xbc54('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xbc54('0x3'),'newTab'),'defaultValue':'integrationTab'}};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js
index 03ef1eb..e144303 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac84=['username','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Type','Case','Origin','Reason','IsEscalated','SuppliedCompany','map','custom','picklistValues','label','value','boolean','True','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','name','send','index','SalesforceAccount','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','key','VIRTUAL','options','includeAll','rows','catch','show','params','keys','find','create','body','destroy','getConfigurations','findOne','rawAttributes','order','pick','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret'];(function(_0x113cc2,_0x4b0509){var _0x59a3df=function(_0x15c2b0){while(--_0x15c2b0){_0x113cc2['push'](_0x113cc2['shift']());}};_0x59a3df(++_0x4b0509);}(_0xac84,0xb1));var _0x4ac8=function(_0x1a7fc9,_0x1ceb8d){_0x1a7fc9=_0x1a7fc9-0x0;var _0x30990f=_0xac84[_0x1a7fc9];return _0x30990f;};'use strict';var pdf=require(_0x4ac8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4ac8('0x1'));var zipdir=require(_0x4ac8('0x2'));var jsonpatch=require(_0x4ac8('0x3'));var rp=require(_0x4ac8('0x4'));var moment=require(_0x4ac8('0x5'));var BPromise=require(_0x4ac8('0x6'));var Mustache=require(_0x4ac8('0x7'));var util=require('util');var path=require(_0x4ac8('0x8'));var sox=require(_0x4ac8('0x9'));var csv=require(_0x4ac8('0xa'));var ejs=require(_0x4ac8('0xb'));var fs=require('fs');var _=require(_0x4ac8('0xc'));var squel=require(_0x4ac8('0xd'));var crypto=require('crypto');var jsforce=require(_0x4ac8('0xe'));var deskjs=require(_0x4ac8('0xf'));var toCsv=require(_0x4ac8('0xa'));var querystring=require(_0x4ac8('0x10'));var Papa=require(_0x4ac8('0x11'));var Redis=require(_0x4ac8('0x12'));var authService=require(_0x4ac8('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4ac8('0x14'));var logger=require(_0x4ac8('0x15'))('api');var utils=require(_0x4ac8('0x16'));var config=require(_0x4ac8('0x17'));var db=require(_0x4ac8('0x18'))['db'];var integrations=require(_0x4ac8('0x19'));var jayson=require(_0x4ac8('0x1a'));var client=jayson[_0x4ac8('0x1b')][_0x4ac8('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x199212,_0x5696d2,_0x213d50){if(_0x213d50){var _0x48f226=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x48f226[_0x4ac8('0x1d')](_0x5696d2)){return _0x199212;}else{throw new Error(_0x4ac8('0x1e'));}}else{return _0x199212;}}function respondWithRpcPromise(_0x33d3c1,_0x36b8d4,_0x1993aa,_0x179f5c){return new BPromise(function(_0x3f8374,_0x216853){var _0x40cea2=_0x179f5c||client;return _0x40cea2[_0x4ac8('0x1f')](_0x33d3c1,_0x1993aa)[_0x4ac8('0x20')](function(_0x1a439a){logger[_0x4ac8('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0x36b8d4,_0x4ac8('0x22'));logger[_0x4ac8('0x23')](_0x4ac8('0x24'),_0x36b8d4,'request\x20sent',JSON[_0x4ac8('0x25')](_0x1a439a));if(_0x1a439a[_0x4ac8('0x26')]){if(_0x1a439a[_0x4ac8('0x26')]['code']===0x1f4){logger['error'](_0x4ac8('0x27'),_0x36b8d4,_0x1a439a[_0x4ac8('0x26')][_0x4ac8('0x28')]);return _0x216853(_0x1a439a['error'][_0x4ac8('0x28')]);}logger[_0x4ac8('0x26')]('SalesforceAccount,\x20%s,\x20%s',_0x36b8d4,_0x1a439a[_0x4ac8('0x26')][_0x4ac8('0x28')]);return _0x3f8374(_0x1a439a[_0x4ac8('0x26')][_0x4ac8('0x28')]);}else{logger[_0x4ac8('0x21')](_0x4ac8('0x27'),_0x36b8d4,_0x4ac8('0x22'));_0x3f8374(_0x1a439a[_0x4ac8('0x29')][_0x4ac8('0x28')]);}})['catch'](function(_0x37a819){logger[_0x4ac8('0x26')](_0x4ac8('0x27'),_0x36b8d4,_0x37a819);_0x216853(_0x37a819);});});}function respondWithStatusCode(_0x41fa06,_0x44e116){_0x44e116=_0x44e116||0xcc;return function(_0x1ad704){if(_0x1ad704){return _0x41fa06[_0x4ac8('0x2a')](_0x44e116);}return _0x41fa06[_0x4ac8('0x2b')](_0x44e116)[_0x4ac8('0x2c')]();};}function respondWithResult(_0x1936a2,_0x3c3d57){_0x3c3d57=_0x3c3d57||0xc8;return function(_0x6cc531){if(_0x6cc531){return _0x1936a2[_0x4ac8('0x2b')](_0x3c3d57)[_0x4ac8('0x2d')](_0x6cc531);}};}function respondWithFilteredResult(_0xf41d57,_0x2ffe19){return function(_0x1b88d2){if(_0x1b88d2){var _0x4066af=_0x1b88d2[_0x4ac8('0x2e')],_0x2862d6=_0x2ffe19[_0x4ac8('0x2f')],_0x31afa5=_0x2ffe19['offset']+_0x2ffe19[_0x4ac8('0x30')],_0x38a41e;if(_0x31afa5>=_0x4066af){_0x31afa5=_0x4066af;_0x38a41e=0xc8;}else{_0x38a41e=0xce;}_0xf41d57[_0x4ac8('0x2b')](_0x38a41e);return _0xf41d57[_0x4ac8('0x31')](_0x4ac8('0x32'),_0x2862d6+'-'+_0x31afa5+'/'+_0x4066af)[_0x4ac8('0x2d')](_0x1b88d2);}return null;};}function patchUpdates(_0x499fe2){return function(_0x4ec86c){try{jsonpatch['apply'](_0x4ec86c,_0x499fe2,!![]);}catch(_0x4c3862){return BPromise[_0x4ac8('0x33')](_0x4c3862);}return _0x4ec86c['save']();};}function saveUpdates(_0x306460,_0x4bf7b6){return function(_0x4230fc){if(_0x4230fc){return _0x4230fc[_0x4ac8('0x34')](_0x306460)[_0x4ac8('0x20')](function(_0x58be0c){return _0x58be0c;});}return null;};}function removeEntity(_0x7dd6f0,_0x32142a){return function(_0x3edbd1){if(_0x3edbd1){return _0x3edbd1['destroy']()[_0x4ac8('0x20')](function(){_0x7dd6f0['status'](0xcc)[_0x4ac8('0x2c')]();});}};}function handleEntityNotFound(_0x24991d,_0x16a4c3){return function(_0x3eea68){if(!_0x3eea68){_0x24991d[_0x4ac8('0x2a')](0x194);}return _0x3eea68;};}function handleError(_0x574c7a,_0x5db6a7){_0x5db6a7=_0x5db6a7||0x1f4;return function(_0x1f6bea){logger['error'](_0x1f6bea['stack']);if(_0x1f6bea['name']){delete _0x1f6bea[_0x4ac8('0x35')];}_0x574c7a[_0x4ac8('0x2b')](_0x5db6a7)[_0x4ac8('0x36')](_0x1f6bea);};}exports[_0x4ac8('0x37')]=function(_0x5204b4,_0x2acd30){var _0x3a1dfc={},_0x2021ae={},_0x407e09={'count':0x0,'rows':[]};var _0x12032d=db[_0x4ac8('0x38')]['rawAttributes'];_0x2021ae[_0x4ac8('0x39')]=_['keys'](_0x12032d);_0x2021ae[_0x4ac8('0x3a')]=_['keys'](_0x5204b4[_0x4ac8('0x3a')]);_0x2021ae[_0x4ac8('0x3b')]=_[_0x4ac8('0x3c')](_0x2021ae[_0x4ac8('0x39')],_0x2021ae['query']);_0x3a1dfc[_0x4ac8('0x3d')]=_[_0x4ac8('0x3c')](_0x2021ae['model'],qs[_0x4ac8('0x3e')](_0x5204b4[_0x4ac8('0x3a')]['fields']));_0x3a1dfc[_0x4ac8('0x3d')]=_0x3a1dfc[_0x4ac8('0x3d')][_0x4ac8('0x3f')]?_0x3a1dfc['attributes']:_0x2021ae['model'];if(!_0x5204b4[_0x4ac8('0x3a')][_0x4ac8('0x40')](_0x4ac8('0x41'))){_0x3a1dfc[_0x4ac8('0x30')]=qs['limit'](_0x5204b4[_0x4ac8('0x3a')]['limit']);_0x3a1dfc[_0x4ac8('0x2f')]=qs[_0x4ac8('0x2f')](_0x5204b4[_0x4ac8('0x3a')][_0x4ac8('0x2f')]);}_0x3a1dfc['order']=qs[_0x4ac8('0x42')](_0x5204b4[_0x4ac8('0x3a')][_0x4ac8('0x42')]);_0x3a1dfc['where']=qs['filters'](_['pick'](_0x5204b4['query'],_0x2021ae['filters']));if(_0x5204b4[_0x4ac8('0x3a')][_0x4ac8('0x43')]){_0x3a1dfc[_0x4ac8('0x44')]=_[_0x4ac8('0x45')](_0x3a1dfc[_0x4ac8('0x44')],{'$or':_['map'](_0x12032d,function(_0x4d4e40){if(_0x4d4e40[_0x4ac8('0x46')][_0x4ac8('0x47')]!==_0x4ac8('0x48')){var _0x2ba582={};_0x2ba582[_0x4d4e40['field']]={'$like':'%'+_0x5204b4['query'][_0x4ac8('0x43')]+'%'};return _0x2ba582;}})});}_0x3a1dfc=_[_0x4ac8('0x45')]({},_0x3a1dfc,_0x5204b4[_0x4ac8('0x49')]);var _0xfed540={'where':_0x3a1dfc['where']};return db['SalesforceAccount'][_0x4ac8('0x2e')](_0xfed540)[_0x4ac8('0x20')](function(_0x3d571e){_0x407e09['count']=_0x3d571e;if(_0x5204b4['query'][_0x4ac8('0x4a')]){_0x3a1dfc['include']=[{'all':!![]}];}return db[_0x4ac8('0x38')]['findAll'](_0x3a1dfc);})[_0x4ac8('0x20')](function(_0x3642f0){_0x407e09[_0x4ac8('0x4b')]=_0x3642f0;return _0x407e09;})[_0x4ac8('0x20')](respondWithFilteredResult(_0x2acd30,_0x3a1dfc))[_0x4ac8('0x4c')](handleError(_0x2acd30,null));};exports[_0x4ac8('0x4d')]=function(_0x8494f9,_0x450a61){var _0x3b7427={'raw':![],'where':{'id':_0x8494f9[_0x4ac8('0x4e')]['id']}},_0x494471={};_0x494471['model']=_[_0x4ac8('0x4f')](db[_0x4ac8('0x38')]['rawAttributes']);_0x494471['query']=_[_0x4ac8('0x4f')](_0x8494f9[_0x4ac8('0x3a')]);_0x494471[_0x4ac8('0x3b')]=_[_0x4ac8('0x3c')](_0x494471[_0x4ac8('0x39')],_0x494471[_0x4ac8('0x3a')]);_0x3b7427[_0x4ac8('0x3d')]=_[_0x4ac8('0x3c')](_0x494471[_0x4ac8('0x39')],qs[_0x4ac8('0x3e')](_0x8494f9[_0x4ac8('0x3a')]['fields']));_0x3b7427[_0x4ac8('0x3d')]=_0x3b7427[_0x4ac8('0x3d')]['length']?_0x3b7427[_0x4ac8('0x3d')]:_0x494471[_0x4ac8('0x39')];if(_0x8494f9['query'][_0x4ac8('0x4a')]){_0x3b7427['include']=[{'all':!![]}];}_0x3b7427=_[_0x4ac8('0x45')]({},_0x3b7427,_0x8494f9[_0x4ac8('0x49')]);return db[_0x4ac8('0x38')][_0x4ac8('0x50')](_0x3b7427)['then'](handleEntityNotFound(_0x450a61,null))[_0x4ac8('0x20')](respondWithResult(_0x450a61,null))[_0x4ac8('0x4c')](handleError(_0x450a61,null));};exports[_0x4ac8('0x51')]=function(_0x530531,_0x39ddd6){return db['SalesforceAccount']['create'](_0x530531['body'],{})[_0x4ac8('0x20')](respondWithResult(_0x39ddd6,0xc9))[_0x4ac8('0x4c')](handleError(_0x39ddd6,null));};exports['update']=function(_0x1e6440,_0x335f74){if(_0x1e6440[_0x4ac8('0x52')]['id']){delete _0x1e6440['body']['id'];}return db['SalesforceAccount'][_0x4ac8('0x50')]({'where':{'id':_0x1e6440[_0x4ac8('0x4e')]['id']}})[_0x4ac8('0x20')](handleEntityNotFound(_0x335f74,null))[_0x4ac8('0x20')](saveUpdates(_0x1e6440['body'],null))[_0x4ac8('0x20')](respondWithResult(_0x335f74,null))['catch'](handleError(_0x335f74,null));};exports[_0x4ac8('0x53')]=function(_0x26d053,_0x31db3f){return db[_0x4ac8('0x38')][_0x4ac8('0x50')]({'where':{'id':_0x26d053[_0x4ac8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x31db3f,null))[_0x4ac8('0x20')](removeEntity(_0x31db3f,null))['catch'](handleError(_0x31db3f,null));};exports[_0x4ac8('0x54')]=function(_0x3f59f8,_0x33c7f8,_0x273055){var _0x1be5ba={};var _0x5d775b={};var _0x13464d;var _0x424f2f;return db[_0x4ac8('0x38')][_0x4ac8('0x55')]({'where':{'id':_0x3f59f8[_0x4ac8('0x4e')]['id']}})[_0x4ac8('0x20')](handleEntityNotFound(_0x33c7f8,null))[_0x4ac8('0x20')](function(_0x59480c){if(_0x59480c){_0x13464d=_0x59480c;_0x5d775b[_0x4ac8('0x39')]=_[_0x4ac8('0x4f')](db['SalesforceConfiguration'][_0x4ac8('0x56')]);_0x5d775b[_0x4ac8('0x3a')]=_[_0x4ac8('0x4f')](_0x3f59f8[_0x4ac8('0x3a')]);_0x5d775b[_0x4ac8('0x3b')]=_[_0x4ac8('0x3c')](_0x5d775b['model'],_0x5d775b[_0x4ac8('0x3a')]);_0x1be5ba[_0x4ac8('0x3d')]=_[_0x4ac8('0x3c')](_0x5d775b[_0x4ac8('0x39')],qs[_0x4ac8('0x3e')](_0x3f59f8[_0x4ac8('0x3a')]['fields']));_0x1be5ba['attributes']=_0x1be5ba[_0x4ac8('0x3d')][_0x4ac8('0x3f')]?_0x1be5ba[_0x4ac8('0x3d')]:_0x5d775b[_0x4ac8('0x39')];_0x1be5ba[_0x4ac8('0x57')]=qs[_0x4ac8('0x42')](_0x3f59f8[_0x4ac8('0x3a')][_0x4ac8('0x42')]);_0x1be5ba[_0x4ac8('0x44')]=qs['filters'](_[_0x4ac8('0x58')](_0x3f59f8['query'],_0x5d775b[_0x4ac8('0x3b')]));if(_0x3f59f8['query'][_0x4ac8('0x43')]){_0x1be5ba['where']=_[_0x4ac8('0x45')](_0x1be5ba[_0x4ac8('0x44')],{'$or':_['map'](_0x1be5ba['attributes'],function(_0x1a0038){var _0x5b8e14={};_0x5b8e14[_0x1a0038]={'$like':'%'+_0x3f59f8[_0x4ac8('0x3a')][_0x4ac8('0x43')]+'%'};return _0x5b8e14;})});}_0x1be5ba=_[_0x4ac8('0x45')]({},_0x1be5ba,_0x3f59f8[_0x4ac8('0x49')]);return _0x13464d[_0x4ac8('0x54')](_0x1be5ba);}})[_0x4ac8('0x20')](function(_0x3a011f){if(_0x3a011f){_0x424f2f=_0x3a011f[_0x4ac8('0x3f')];if(!_0x3f59f8[_0x4ac8('0x3a')][_0x4ac8('0x40')]('nolimit')){_0x1be5ba[_0x4ac8('0x30')]=qs[_0x4ac8('0x30')](_0x3f59f8['query']['limit']);_0x1be5ba[_0x4ac8('0x2f')]=qs['offset'](_0x3f59f8[_0x4ac8('0x3a')]['offset']);}return _0x13464d[_0x4ac8('0x54')](_0x1be5ba);}})[_0x4ac8('0x20')](function(_0x474247){if(_0x474247){return _0x474247?{'count':_0x424f2f,'rows':_0x474247}:null;}})[_0x4ac8('0x20')](respondWithResult(_0x33c7f8,null))[_0x4ac8('0x4c')](handleError(_0x33c7f8,null));};exports['addConfiguration']=function(_0x13ee4d,_0x56429d,_0x200b61){if(_0x13ee4d[_0x4ac8('0x52')]['id']){delete _0x13ee4d[_0x4ac8('0x52')]['id'];}return db[_0x4ac8('0x38')][_0x4ac8('0x55')]({'where':{'id':_0x13ee4d[_0x4ac8('0x4e')]['id']}})[_0x4ac8('0x20')](handleEntityNotFound(_0x56429d,null))[_0x4ac8('0x20')](function(_0x24d67b){if(_0x24d67b){_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x59')]=_0x24d67b['id'];_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x5a')]=integrations[_0x4ac8('0x5b')](_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x5c')],_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x46')]);_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x5d')]=integrations['getDescriptions'](_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x5c')],_0x13ee4d[_0x4ac8('0x52')]['type']);return db[_0x4ac8('0x5e')]['create'](_0x13ee4d['body'],{'include':[{'model':db[_0x4ac8('0x5f')],'as':_0x4ac8('0x5a')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x4ac8('0x20')](respondWithResult(_0x56429d,null))[_0x4ac8('0x4c')](handleError(_0x56429d,null));};exports[_0x4ac8('0x60')]=function(_0x256ba2,_0x45a254,_0xb2fe52){var _0x2ccf65;var _0x5b6c84='';var _0x291ecf=_0x4ac8('0x61');return db['SalesforceAccount'][_0x4ac8('0x55')]({'where':{'id':_0x256ba2[_0x4ac8('0x4e')]['id']},'attributes':['id',_0x4ac8('0x62'),_0x4ac8('0x63'),_0x4ac8('0x64'),_0x4ac8('0x65'),'password',_0x4ac8('0x66')]})['then'](handleEntityNotFound(_0x45a254,null))['then'](function(_0x277148){if(_0x277148){_0x5b6c84=_0x277148[_0x4ac8('0x62')];var _0x1ff083=_0x5b6c84[_0x4ac8('0x67')](-0x1);if(_0x1ff083==='/'){_0x5b6c84=_0x5b6c84[_0x4ac8('0x68')](0x0,_0x5b6c84[_0x4ac8('0x69')](_0x1ff083));}_0x2ccf65=new jsforce[(_0x4ac8('0x6a'))]({'oauth2':{'loginUrl':_0x5b6c84,'clientId':_0x277148[_0x4ac8('0x63')],'clientSecret':_0x277148[_0x4ac8('0x64')]}});return _0x2ccf65[_0x4ac8('0x6b')](_0x277148[_0x4ac8('0x65')],_0x277148['password'][_0x4ac8('0x6c')](_0x277148[_0x4ac8('0x66')]));}})[_0x4ac8('0x20')](function(_0x1012a6){if(_0x1012a6){if(!_[_0x4ac8('0x6d')](_0x256ba2['query'][_0x4ac8('0x6e')])){_0x291ecf=_0x256ba2[_0x4ac8('0x3a')][_0x4ac8('0x6e')];}return _0x2ccf65[_0x4ac8('0x6f')](_0x291ecf)[_0x4ac8('0x70')]();}})[_0x4ac8('0x20')](function(_0x20c2db){var _0x9d86cd=[_0x4ac8('0x71'),_0x4ac8('0x72'),_0x4ac8('0x73'),_0x4ac8('0x74'),_0x4ac8('0x75'),_0x4ac8('0x76'),_0x4ac8('0x77'),_0x4ac8('0x78')];if(!_[_0x4ac8('0x6d')](_0x256ba2[_0x4ac8('0x3a')]['ticketType'])&&_0x256ba2[_0x4ac8('0x3a')]['ticketType']===_0x4ac8('0x79')){_0x9d86cd=[_0x4ac8('0x78'),_0x4ac8('0x7a'),_0x4ac8('0x7b'),'Status',_0x4ac8('0x76'),_0x4ac8('0x7c'),'SuppliedName',_0x4ac8('0x7d')];}if(_0x20c2db){_['remove'](_0x20c2db[_0x4ac8('0x3e')],function(_0x34093b){return _0x34093b['custom']===![]&&!_0x9d86cd['includes'](_0x34093b[_0x4ac8('0x35')]);});return{'count':_0x20c2db[_0x4ac8('0x3e')][_0x4ac8('0x3f')],'rows':_[_0x4ac8('0x7e')](_0x20c2db[_0x4ac8('0x3e')],function(_0x304324){return{'id':_0x304324[_0x4ac8('0x35')],'name':_0x304324['label'],'custom':_0x304324[_0x4ac8('0x7f')],'options':_0x304324[_0x4ac8('0x80')][_0x4ac8('0x3f')]>0x0?_[_0x4ac8('0x7e')](_0x304324[_0x4ac8('0x80')],function(_0x58f2cd){return{'name':_0x58f2cd[_0x4ac8('0x81')],'value':_0x58f2cd[_0x4ac8('0x82')]};}):_0x304324[_0x4ac8('0x46')]==_0x4ac8('0x83')?[{'name':_0x4ac8('0x84'),'value':_0x4ac8('0x85')},{'name':_0x4ac8('0x86'),'value':_0x4ac8('0x87')}]:[]};})};}})[_0x4ac8('0x20')](respondWithResult(_0x45a254,null))[_0x4ac8('0x4c')](function(_0xf70e3c){var _0x2fdc33=_0x256ba2['query'][_0x4ac8('0x1d')]?0x1f4:_0xf70e3c[_0x4ac8('0x88')]||0x1f4;logger['error'](_0x4ac8('0x89'),_0x4ac8('0x60'),_0x2fdc33,JSON[_0x4ac8('0x25')](_0xf70e3c));delete _0xf70e3c[_0x4ac8('0x35')];if(_0x2fdc33===0x191){_0x2fdc33=0x190;}_0x45a254[_0x4ac8('0x2b')](_0x2fdc33)[_0x4ac8('0x36')](_0x256ba2[_0x4ac8('0x3a')][_0x4ac8('0x1d')]?{'message':_0x4ac8('0x8a'),'statusCode':_0xf70e3c[_0x4ac8('0x88')]}:_0xf70e3c);});};
\ No newline at end of file
+var _0x759e=['create','body','destroy','findOne','SalesforceConfiguration','order','getConfigurations','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','substring','Connection','login','password','concat','ticketType','describe','CallDisposition','CallObject','CallType','IsArchived','Priority','Status','Type','Reason','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','boolean','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','end','stack','name','send','index','SalesforceAccount','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','pick','filter','where','map','key','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','rawAttributes','include','find'];(function(_0x9b64b2,_0x28fbc7){var _0x1ca2ad=function(_0x163cbd){while(--_0x163cbd){_0x9b64b2['push'](_0x9b64b2['shift']());}};_0x1ca2ad(++_0x28fbc7);}(_0x759e,0x143));var _0xe759=function(_0x2233ed,_0x4e050f){_0x2233ed=_0x2233ed-0x0;var _0x41007e=_0x759e[_0x2233ed];return _0x41007e;};'use strict';var pdf=require(_0xe759('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe759('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe759('0x2'));var rp=require('request-promise');var moment=require(_0xe759('0x3'));var BPromise=require(_0xe759('0x4'));var Mustache=require(_0xe759('0x5'));var util=require(_0xe759('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe759('0x7'));var ejs=require(_0xe759('0x8'));var fs=require('fs');var _=require(_0xe759('0x9'));var squel=require(_0xe759('0xa'));var crypto=require(_0xe759('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe759('0xc'));var toCsv=require(_0xe759('0x7'));var querystring=require(_0xe759('0xd'));var Papa=require(_0xe759('0xe'));var Redis=require(_0xe759('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe759('0x10'));var hardwareService=require(_0xe759('0x11'));var logger=require(_0xe759('0x12'))('api');var utils=require(_0xe759('0x13'));var config=require(_0xe759('0x14'));var db=require(_0xe759('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xe759('0x16'));var client=jayson['client'][_0xe759('0x17')]({'port':0x232a});function checkPasswordPattern(_0x105cce,_0x2bc941,_0x2c9e06){if(_0x2c9e06){var _0x13a5f8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x13a5f8['test'](_0x2bc941)){return _0x105cce;}else{throw new Error(_0xe759('0x18'));}}else{return _0x105cce;}}function respondWithRpcPromise(_0x141c25,_0x2a984f,_0x14c945,_0x5374a3){return new BPromise(function(_0x5d59d6,_0x1af83f){var _0x54e656=_0x5374a3||client;return _0x54e656[_0xe759('0x19')](_0x141c25,_0x14c945)[_0xe759('0x1a')](function(_0x222005){logger[_0xe759('0x1b')](_0xe759('0x1c'),_0x2a984f,_0xe759('0x1d'));logger[_0xe759('0x1e')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x2a984f,'request\x20sent',JSON[_0xe759('0x1f')](_0x222005));if(_0x222005[_0xe759('0x20')]){if(_0x222005[_0xe759('0x20')][_0xe759('0x21')]===0x1f4){logger['error'](_0xe759('0x1c'),_0x2a984f,_0x222005[_0xe759('0x20')][_0xe759('0x22')]);return _0x1af83f(_0x222005[_0xe759('0x20')][_0xe759('0x22')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x2a984f,_0x222005[_0xe759('0x20')][_0xe759('0x22')]);return _0x5d59d6(_0x222005[_0xe759('0x20')][_0xe759('0x22')]);}else{logger['info'](_0xe759('0x1c'),_0x2a984f,_0xe759('0x1d'));_0x5d59d6(_0x222005[_0xe759('0x23')][_0xe759('0x22')]);}})[_0xe759('0x24')](function(_0x5054e2){logger['error'](_0xe759('0x1c'),_0x2a984f,_0x5054e2);_0x1af83f(_0x5054e2);});});}function respondWithStatusCode(_0x26a31e,_0xd5d5ad){_0xd5d5ad=_0xd5d5ad||0xcc;return function(_0x596e53){if(_0x596e53){return _0x26a31e[_0xe759('0x25')](_0xd5d5ad);}return _0x26a31e[_0xe759('0x26')](_0xd5d5ad)['end']();};}function respondWithResult(_0x3e5dae,_0x5bc0a0){_0x5bc0a0=_0x5bc0a0||0xc8;return function(_0x2814b8){if(_0x2814b8){return _0x3e5dae[_0xe759('0x26')](_0x5bc0a0)[_0xe759('0x27')](_0x2814b8);}};}function respondWithFilteredResult(_0x3e8363,_0x53ed98){return function(_0x399826){if(_0x399826){var _0x14e846=_0x399826[_0xe759('0x28')],_0x1a895a=_0x53ed98[_0xe759('0x29')],_0x79c952=_0x53ed98['offset']+_0x53ed98[_0xe759('0x2a')],_0x2cedbe;if(_0x79c952>=_0x14e846){_0x79c952=_0x14e846;_0x2cedbe=0xc8;}else{_0x2cedbe=0xce;}_0x3e8363[_0xe759('0x26')](_0x2cedbe);return _0x3e8363[_0xe759('0x2b')](_0xe759('0x2c'),_0x1a895a+'-'+_0x79c952+'/'+_0x14e846)[_0xe759('0x27')](_0x399826);}return null;};}function patchUpdates(_0x201e31){return function(_0xc4948){try{jsonpatch['apply'](_0xc4948,_0x201e31,!![]);}catch(_0x19deda){return BPromise[_0xe759('0x2d')](_0x19deda);}return _0xc4948['save']();};}function saveUpdates(_0x4caf44,_0x131b01){return function(_0x56361a){if(_0x56361a){return _0x56361a[_0xe759('0x2e')](_0x4caf44)['then'](function(_0x50a6c7){return _0x50a6c7;});}return null;};}function removeEntity(_0x475db7,_0x525106){return function(_0x3797b2){if(_0x3797b2){return _0x3797b2['destroy']()[_0xe759('0x1a')](function(){_0x475db7[_0xe759('0x26')](0xcc)[_0xe759('0x2f')]();});}};}function handleEntityNotFound(_0x5ed41e,_0x29fa74){return function(_0x44b2be){if(!_0x44b2be){_0x5ed41e[_0xe759('0x25')](0x194);}return _0x44b2be;};}function handleError(_0x5e5f75,_0x452338){_0x452338=_0x452338||0x1f4;return function(_0x43fe21){logger[_0xe759('0x20')](_0x43fe21[_0xe759('0x30')]);if(_0x43fe21['name']){delete _0x43fe21[_0xe759('0x31')];}_0x5e5f75[_0xe759('0x26')](_0x452338)[_0xe759('0x32')](_0x43fe21);};}exports[_0xe759('0x33')]=function(_0x398983,_0x14334c){var _0x33c298={},_0x482816={},_0x4e26db={'count':0x0,'rows':[]};var _0x13596a=db[_0xe759('0x34')]['rawAttributes'];_0x482816['model']=_[_0xe759('0x35')](_0x13596a);_0x482816['query']=_['keys'](_0x398983[_0xe759('0x36')]);_0x482816[_0xe759('0x37')]=_[_0xe759('0x38')](_0x482816['model'],_0x482816[_0xe759('0x36')]);_0x33c298[_0xe759('0x39')]=_[_0xe759('0x38')](_0x482816['model'],qs[_0xe759('0x3a')](_0x398983['query'][_0xe759('0x3a')]));_0x33c298[_0xe759('0x39')]=_0x33c298[_0xe759('0x39')][_0xe759('0x3b')]?_0x33c298[_0xe759('0x39')]:_0x482816[_0xe759('0x3c')];if(!_0x398983[_0xe759('0x36')][_0xe759('0x3d')](_0xe759('0x3e'))){_0x33c298['limit']=qs[_0xe759('0x2a')](_0x398983[_0xe759('0x36')][_0xe759('0x2a')]);_0x33c298[_0xe759('0x29')]=qs[_0xe759('0x29')](_0x398983[_0xe759('0x36')][_0xe759('0x29')]);}_0x33c298['order']=qs['sort'](_0x398983[_0xe759('0x36')]['sort']);_0x33c298['where']=qs[_0xe759('0x37')](_[_0xe759('0x3f')](_0x398983[_0xe759('0x36')],_0x482816['filters']));if(_0x398983['query'][_0xe759('0x40')]){_0x33c298[_0xe759('0x41')]=_['merge'](_0x33c298[_0xe759('0x41')],{'$or':_[_0xe759('0x42')](_0x13596a,function(_0x567c76){if(_0x567c76['type'][_0xe759('0x43')]!==_0xe759('0x44')){var _0xc67125={};_0xc67125[_0x567c76['field']]={'$like':'%'+_0x398983[_0xe759('0x36')]['filter']+'%'};return _0xc67125;}})});}_0x33c298=_[_0xe759('0x45')]({},_0x33c298,_0x398983[_0xe759('0x46')]);var _0xd00b07={'where':_0x33c298[_0xe759('0x41')]};return db['SalesforceAccount'][_0xe759('0x28')](_0xd00b07)[_0xe759('0x1a')](function(_0x3eb3e3){_0x4e26db[_0xe759('0x28')]=_0x3eb3e3;if(_0x398983[_0xe759('0x36')][_0xe759('0x47')]){_0x33c298['include']=[{'all':!![]}];}return db[_0xe759('0x34')][_0xe759('0x48')](_0x33c298);})[_0xe759('0x1a')](function(_0x3aed59){_0x4e26db[_0xe759('0x49')]=_0x3aed59;return _0x4e26db;})['then'](respondWithFilteredResult(_0x14334c,_0x33c298))[_0xe759('0x24')](handleError(_0x14334c,null));};exports[_0xe759('0x4a')]=function(_0x47f9a9,_0x3a78fb){var _0x4d1958={'raw':![],'where':{'id':_0x47f9a9[_0xe759('0x4b')]['id']}},_0x3fcfa9={};_0x3fcfa9[_0xe759('0x3c')]=_[_0xe759('0x35')](db[_0xe759('0x34')][_0xe759('0x4c')]);_0x3fcfa9[_0xe759('0x36')]=_[_0xe759('0x35')](_0x47f9a9[_0xe759('0x36')]);_0x3fcfa9[_0xe759('0x37')]=_[_0xe759('0x38')](_0x3fcfa9[_0xe759('0x3c')],_0x3fcfa9[_0xe759('0x36')]);_0x4d1958['attributes']=_[_0xe759('0x38')](_0x3fcfa9[_0xe759('0x3c')],qs[_0xe759('0x3a')](_0x47f9a9[_0xe759('0x36')][_0xe759('0x3a')]));_0x4d1958[_0xe759('0x39')]=_0x4d1958[_0xe759('0x39')]['length']?_0x4d1958[_0xe759('0x39')]:_0x3fcfa9[_0xe759('0x3c')];if(_0x47f9a9[_0xe759('0x36')][_0xe759('0x47')]){_0x4d1958[_0xe759('0x4d')]=[{'all':!![]}];}_0x4d1958=_[_0xe759('0x45')]({},_0x4d1958,_0x47f9a9[_0xe759('0x46')]);return db['SalesforceAccount'][_0xe759('0x4e')](_0x4d1958)[_0xe759('0x1a')](handleEntityNotFound(_0x3a78fb,null))[_0xe759('0x1a')](respondWithResult(_0x3a78fb,null))[_0xe759('0x24')](handleError(_0x3a78fb,null));};exports[_0xe759('0x4f')]=function(_0x1751f7,_0x2e1740){return db[_0xe759('0x34')][_0xe759('0x4f')](_0x1751f7[_0xe759('0x50')],{})['then'](respondWithResult(_0x2e1740,0xc9))['catch'](handleError(_0x2e1740,null));};exports[_0xe759('0x2e')]=function(_0x3e7f93,_0x4cd6e5){if(_0x3e7f93['body']['id']){delete _0x3e7f93[_0xe759('0x50')]['id'];}return db['SalesforceAccount'][_0xe759('0x4e')]({'where':{'id':_0x3e7f93[_0xe759('0x4b')]['id']}})[_0xe759('0x1a')](handleEntityNotFound(_0x4cd6e5,null))[_0xe759('0x1a')](saveUpdates(_0x3e7f93[_0xe759('0x50')],null))['then'](respondWithResult(_0x4cd6e5,null))[_0xe759('0x24')](handleError(_0x4cd6e5,null));};exports[_0xe759('0x51')]=function(_0x8090fe,_0x4a077b){return db[_0xe759('0x34')][_0xe759('0x4e')]({'where':{'id':_0x8090fe[_0xe759('0x4b')]['id']}})[_0xe759('0x1a')](handleEntityNotFound(_0x4a077b,null))[_0xe759('0x1a')](removeEntity(_0x4a077b,null))['catch'](handleError(_0x4a077b,null));};exports['getConfigurations']=function(_0x80e1e4,_0x14fd5e,_0x3b0cda){var _0x18a311={};var _0x5162={};var _0x199c87;var _0x1c876a;return db[_0xe759('0x34')][_0xe759('0x52')]({'where':{'id':_0x80e1e4['params']['id']}})[_0xe759('0x1a')](handleEntityNotFound(_0x14fd5e,null))[_0xe759('0x1a')](function(_0x47eae5){if(_0x47eae5){_0x199c87=_0x47eae5;_0x5162[_0xe759('0x3c')]=_[_0xe759('0x35')](db[_0xe759('0x53')][_0xe759('0x4c')]);_0x5162[_0xe759('0x36')]=_[_0xe759('0x35')](_0x80e1e4[_0xe759('0x36')]);_0x5162[_0xe759('0x37')]=_[_0xe759('0x38')](_0x5162[_0xe759('0x3c')],_0x5162['query']);_0x18a311[_0xe759('0x39')]=_[_0xe759('0x38')](_0x5162[_0xe759('0x3c')],qs['fields'](_0x80e1e4[_0xe759('0x36')][_0xe759('0x3a')]));_0x18a311[_0xe759('0x39')]=_0x18a311['attributes'][_0xe759('0x3b')]?_0x18a311['attributes']:_0x5162[_0xe759('0x3c')];_0x18a311[_0xe759('0x54')]=qs['sort'](_0x80e1e4['query']['sort']);_0x18a311[_0xe759('0x41')]=qs[_0xe759('0x37')](_[_0xe759('0x3f')](_0x80e1e4[_0xe759('0x36')],_0x5162[_0xe759('0x37')]));if(_0x80e1e4[_0xe759('0x36')][_0xe759('0x40')]){_0x18a311[_0xe759('0x41')]=_[_0xe759('0x45')](_0x18a311[_0xe759('0x41')],{'$or':_[_0xe759('0x42')](_0x18a311[_0xe759('0x39')],function(_0x360f9f){var _0x417b3a={};_0x417b3a[_0x360f9f]={'$like':'%'+_0x80e1e4[_0xe759('0x36')]['filter']+'%'};return _0x417b3a;})});}_0x18a311=_[_0xe759('0x45')]({},_0x18a311,_0x80e1e4[_0xe759('0x46')]);return _0x199c87[_0xe759('0x55')](_0x18a311);}})[_0xe759('0x1a')](function(_0x99f9c5){if(_0x99f9c5){_0x1c876a=_0x99f9c5[_0xe759('0x3b')];if(!_0x80e1e4[_0xe759('0x36')][_0xe759('0x3d')](_0xe759('0x3e'))){_0x18a311[_0xe759('0x2a')]=qs[_0xe759('0x2a')](_0x80e1e4[_0xe759('0x36')][_0xe759('0x2a')]);_0x18a311[_0xe759('0x29')]=qs[_0xe759('0x29')](_0x80e1e4[_0xe759('0x36')]['offset']);}return _0x199c87[_0xe759('0x55')](_0x18a311);}})['then'](function(_0x4e55a8){if(_0x4e55a8){return _0x4e55a8?{'count':_0x1c876a,'rows':_0x4e55a8}:null;}})[_0xe759('0x1a')](respondWithResult(_0x14fd5e,null))[_0xe759('0x24')](handleError(_0x14fd5e,null));};exports['addConfiguration']=function(_0x334154,_0x28dad8,_0x1b0705){if(_0x334154[_0xe759('0x50')]['id']){delete _0x334154[_0xe759('0x50')]['id'];}return db[_0xe759('0x34')][_0xe759('0x52')]({'where':{'id':_0x334154['params']['id']}})['then'](handleEntityNotFound(_0x28dad8,null))[_0xe759('0x1a')](function(_0x123703){if(_0x123703){_0x334154['body'][_0xe759('0x56')]=_0x123703['id'];_0x334154['body'][_0xe759('0x57')]=integrations[_0xe759('0x58')](_0x334154[_0xe759('0x50')][_0xe759('0x59')],_0x334154[_0xe759('0x50')][_0xe759('0x5a')]);_0x334154[_0xe759('0x50')][_0xe759('0x5b')]=integrations[_0xe759('0x5c')](_0x334154[_0xe759('0x50')][_0xe759('0x59')],_0x334154[_0xe759('0x50')]['type']);return db[_0xe759('0x53')]['create'](_0x334154[_0xe759('0x50')],{'include':[{'model':db[_0xe759('0x5d')],'as':_0xe759('0x57')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xe759('0x1a')](respondWithResult(_0x28dad8,null))[_0xe759('0x24')](handleError(_0x28dad8,null));};exports[_0xe759('0x5e')]=function(_0x215cd9,_0x323641,_0x17708e){var _0x294597;var _0x504622='';var _0x4fc5ec=_0xe759('0x5f');return db[_0xe759('0x34')][_0xe759('0x52')]({'where':{'id':_0x215cd9['params']['id']},'attributes':['id',_0xe759('0x60'),_0xe759('0x61'),_0xe759('0x62'),_0xe759('0x63'),'password',_0xe759('0x64')]})[_0xe759('0x1a')](handleEntityNotFound(_0x323641,null))[_0xe759('0x1a')](function(_0x54b152){if(_0x54b152){_0x504622=_0x54b152['remoteUri'];var _0x457e96=_0x504622['slice'](-0x1);if(_0x457e96==='/'){_0x504622=_0x504622[_0xe759('0x65')](0x0,_0x504622['lastIndexOf'](_0x457e96));}_0x294597=new jsforce[(_0xe759('0x66'))]({'oauth2':{'loginUrl':_0x504622,'clientId':_0x54b152[_0xe759('0x61')],'clientSecret':_0x54b152[_0xe759('0x62')]}});return _0x294597[_0xe759('0x67')](_0x54b152[_0xe759('0x63')],_0x54b152[_0xe759('0x68')][_0xe759('0x69')](_0x54b152[_0xe759('0x64')]));}})[_0xe759('0x1a')](function(_0x40d87a){if(_0x40d87a){if(!_['isNil'](_0x215cd9[_0xe759('0x36')]['ticketType'])){_0x4fc5ec=_0x215cd9[_0xe759('0x36')][_0xe759('0x6a')];}return _0x294597['sobject'](_0x4fc5ec)[_0xe759('0x6b')]();}})[_0xe759('0x1a')](function(_0x2d00ea){var _0x1b9575=[_0xe759('0x6c'),'CallDurationInSeconds',_0xe759('0x6d'),_0xe759('0x6e'),_0xe759('0x6f'),_0xe759('0x70'),_0xe759('0x71'),_0xe759('0x72')];if(!_['isNil'](_0x215cd9[_0xe759('0x36')][_0xe759('0x6a')])&&_0x215cd9['query'][_0xe759('0x6a')]==='Case'){_0x1b9575=[_0xe759('0x72'),'Origin',_0xe759('0x73'),_0xe759('0x71'),'Priority',_0xe759('0x74'),_0xe759('0x75'),_0xe759('0x76')];}if(_0x2d00ea){_[_0xe759('0x77')](_0x2d00ea['fields'],function(_0x132cb6){return _0x132cb6[_0xe759('0x78')]===![]&&!_0x1b9575[_0xe759('0x79')](_0x132cb6[_0xe759('0x31')]);});return{'count':_0x2d00ea[_0xe759('0x3a')][_0xe759('0x3b')],'rows':_[_0xe759('0x42')](_0x2d00ea[_0xe759('0x3a')],function(_0x26ce3b){return{'id':_0x26ce3b['name'],'name':_0x26ce3b[_0xe759('0x7a')],'custom':_0x26ce3b[_0xe759('0x78')],'options':_0x26ce3b[_0xe759('0x7b')]['length']>0x0?_[_0xe759('0x42')](_0x26ce3b[_0xe759('0x7b')],function(_0x2d932c){return{'name':_0x2d932c[_0xe759('0x7a')],'value':_0x2d932c[_0xe759('0x7c')]};}):_0x26ce3b['type']==_0xe759('0x7d')?[{'name':_0xe759('0x7e'),'value':_0xe759('0x7f')},{'name':_0xe759('0x80'),'value':_0xe759('0x81')}]:[]};})};}})[_0xe759('0x1a')](respondWithResult(_0x323641,null))[_0xe759('0x24')](function(_0x449454){var _0x3af7ef=_0x215cd9['query'][_0xe759('0x82')]?0x1f4:_0x449454[_0xe759('0x83')]||0x1f4;logger['error'](_0xe759('0x84'),'getFields',_0x3af7ef,JSON[_0xe759('0x1f')](_0x449454));delete _0x449454['name'];if(_0x3af7ef===0x191){_0x3af7ef=0x190;}_0x323641[_0xe759('0x26')](_0x3af7ef)[_0xe759('0x32')](_0x215cd9[_0xe759('0x36')][_0xe759('0x82')]?{'message':_0xe759('0x85'),'statusCode':_0x449454[_0xe759('0x83')]}:_0x449454);});};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js
index 3737ebf..6248826 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x049e=['api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util'];(function(_0x186edd,_0x16afae){var _0x447af8=function(_0x280a1b){while(--_0x280a1b){_0x186edd['push'](_0x186edd['shift']());}};_0x447af8(++_0x16afae);}(_0x049e,0x16a));var _0xe049=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x049e[_0x5311e8];return _0x582ad8;};'use strict';var _=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var logger=require('../../config/logger')(_0xe049('0x2'));var moment=require('moment');var BPromise=require(_0xe049('0x3'));var rp=require(_0xe049('0x4'));var fs=require('fs');var path=require(_0xe049('0x5'));var rimraf=require(_0xe049('0x6'));var config=require(_0xe049('0x7'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xe049('0x8'));module[_0xe049('0x9')]=function(_0x22e8f5,_0x221a5f){return _0x22e8f5[_0xe049('0xa')](_0xe049('0xb'),attributes,{'tableName':_0xe049('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x087b=['path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','moment','request-promise'];(function(_0x49dc18,_0x1d73f1){var _0x176165=function(_0x38ced5){while(--_0x38ced5){_0x49dc18['push'](_0x49dc18['shift']());}};_0x176165(++_0x1d73f1);}(_0x087b,0x11a));var _0xb087=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x087b[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb087('0x2'));var BPromise=require('bluebird');var rp=require(_0xb087('0x3'));var fs=require('fs');var path=require(_0xb087('0x4'));var rimraf=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var attributes=require(_0xb087('0x7'));var integrations=require(_0xb087('0x8'));module[_0xb087('0x9')]=function(_0x17d6e8,_0xecf080){return _0x17d6e8[_0xb087('0xa')](_0xb087('0xb'),attributes,{'tableName':_0xb087('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
index 64c8239..be53a83 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fb3=['GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x59f429,_0x2dfa26){var _0x396be4=function(_0x5033c5){while(--_0x5033c5){_0x59f429['push'](_0x59f429['shift']());}};_0x396be4(++_0x2dfa26);}(_0x5fb3,0x10f));var _0x35fb=function(_0x19b034,_0x220fde){_0x19b034=_0x19b034-0x0;var _0x2c9c76=_0x5fb3[_0x19b034];return _0x2c9c76;};'use strict';var _=require(_0x35fb('0x0'));var util=require(_0x35fb('0x1'));var moment=require(_0x35fb('0x2'));var BPromise=require('bluebird');var rs=require(_0x35fb('0x3'));var fs=require('fs');var Redis=require(_0x35fb('0x4'));var db=require(_0x35fb('0x5'))['db'];var utils=require(_0x35fb('0x6'));var logger=require(_0x35fb('0x7'))(_0x35fb('0x8'));var config=require(_0x35fb('0x9'));var jayson=require(_0x35fb('0xa'));var client=jayson['client'][_0x35fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x404e5e,_0x38c29d,_0xb30a59){return new BPromise(function(_0x103a39,_0xf577ea){return client[_0x35fb('0xc')](_0x404e5e,_0xb30a59)[_0x35fb('0xd')](function(_0x58c301){logger[_0x35fb('0xe')](_0x35fb('0xf'),_0x38c29d,'request\x20sent');logger[_0x35fb('0x10')](_0x35fb('0x11'),_0x38c29d,_0x35fb('0x12'),JSON[_0x35fb('0x13')](_0x58c301));if(_0x58c301[_0x35fb('0x14')]){if(_0x58c301['error'][_0x35fb('0x15')]===0x1f4){logger[_0x35fb('0x14')](_0x35fb('0xf'),_0x38c29d,_0x58c301[_0x35fb('0x14')][_0x35fb('0x16')]);return _0xf577ea(_0x58c301['error'][_0x35fb('0x16')]);}logger[_0x35fb('0x14')](_0x35fb('0xf'),_0x38c29d,_0x58c301[_0x35fb('0x14')][_0x35fb('0x16')]);return _0x103a39(_0x58c301[_0x35fb('0x14')]['message']);}else{logger[_0x35fb('0xe')](_0x35fb('0xf'),_0x38c29d,'request\x20sent');_0x103a39(_0x58c301[_0x35fb('0x17')][_0x35fb('0x16')]);}})[_0x35fb('0x18')](function(_0x48ec1d){logger[_0x35fb('0x14')](_0x35fb('0xf'),_0x38c29d,_0x48ec1d);_0xf577ea(_0x48ec1d);});});}exports[_0x35fb('0x19')]=function(_0x301fe9){var _0x14959c=this;return new Promise(function(_0x333d2f,_0x55db69){return db[_0x35fb('0x1a')]['findAll']({'raw':_0x301fe9['options']?_0x301fe9[_0x35fb('0x1b')][_0x35fb('0x1c')]===undefined?!![]:![]:!![],'where':_0x301fe9[_0x35fb('0x1b')]?_0x301fe9['options'][_0x35fb('0x1d')]||null:null,'attributes':_0x301fe9[_0x35fb('0x1b')]?_0x301fe9[_0x35fb('0x1b')][_0x35fb('0x1e')]||null:null,'limit':_0x301fe9[_0x35fb('0x1b')]?_0x301fe9[_0x35fb('0x1b')][_0x35fb('0x1f')]||null:null,'include':_0x301fe9[_0x35fb('0x1b')]?_0x301fe9[_0x35fb('0x1b')][_0x35fb('0x20')]?_[_0x35fb('0x21')](_0x301fe9['options'][_0x35fb('0x20')],function(_0x32a468){return{'model':db[_0x32a468[_0x35fb('0x22')]],'as':_0x32a468['as'],'attributes':_0x32a468[_0x35fb('0x1e')],'include':_0x32a468['include']?_[_0x35fb('0x21')](_0x32a468[_0x35fb('0x20')],function(_0x143c92){return{'model':db[_0x143c92[_0x35fb('0x22')]],'as':_0x143c92['as'],'attributes':_0x143c92['attributes'],'include':_0x143c92[_0x35fb('0x20')]?_[_0x35fb('0x21')](_0x143c92[_0x35fb('0x20')],function(_0x5071e7){return{'model':db[_0x5071e7[_0x35fb('0x22')]],'as':_0x5071e7['as'],'attributes':_0x5071e7['attributes']};}):[]};}):[]};}):[]:[]})[_0x35fb('0xd')](function(_0xdf3c54){logger[_0x35fb('0xe')](_0x35fb('0x19'),_0x301fe9);logger['debug'](_0x35fb('0x19'),_0x301fe9,JSON[_0x35fb('0x13')](_0xdf3c54));_0x333d2f(_0xdf3c54);})[_0x35fb('0x18')](function(_0x53503b){logger[_0x35fb('0x14')](_0x35fb('0x19'),_0x53503b[_0x35fb('0x16')],_0x301fe9);_0x55db69(_0x14959c[_0x35fb('0x14')](0x1f4,_0x53503b[_0x35fb('0x16')]));});});};exports[_0x35fb('0x23')]=function(_0x19705e){var _0x19c115=this;return new Promise(function(_0x4bd2e4,_0x33e378){return db['SalesforceAccount'][_0x35fb('0x24')]({'raw':_0x19705e['options']?_0x19705e[_0x35fb('0x1b')][_0x35fb('0x1c')]===undefined?!![]:![]:!![],'where':_0x19705e[_0x35fb('0x1b')]?_0x19705e['options'][_0x35fb('0x1d')]||null:null,'attributes':_0x19705e[_0x35fb('0x1b')]?_0x19705e[_0x35fb('0x1b')]['attributes']||null:null,'include':_0x19705e[_0x35fb('0x1b')]?_0x19705e[_0x35fb('0x1b')][_0x35fb('0x20')]?_['map'](_0x19705e[_0x35fb('0x1b')][_0x35fb('0x20')],function(_0xdec94f){return{'model':db[_0xdec94f[_0x35fb('0x22')]],'as':_0xdec94f['as'],'attributes':_0xdec94f['attributes'],'include':_0xdec94f[_0x35fb('0x20')]?_[_0x35fb('0x21')](_0xdec94f[_0x35fb('0x20')],function(_0x2f6cf6){return{'model':db[_0x2f6cf6[_0x35fb('0x22')]],'as':_0x2f6cf6['as'],'attributes':_0x2f6cf6[_0x35fb('0x1e')],'include':_0x2f6cf6['include']?_[_0x35fb('0x21')](_0x2f6cf6[_0x35fb('0x20')],function(_0x20871f){return{'model':db[_0x20871f[_0x35fb('0x22')]],'as':_0x20871f['as'],'attributes':_0x20871f[_0x35fb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x35fb('0xd')](function(_0x4ed9e6){logger['info']('ShowSalesforceAccount',_0x19705e);logger[_0x35fb('0x10')](_0x35fb('0x23'),_0x19705e,JSON['stringify'](_0x4ed9e6));_0x4bd2e4(_0x4ed9e6);})[_0x35fb('0x18')](function(_0x19c538){logger[_0x35fb('0x14')](_0x35fb('0x23'),_0x19c538['message'],_0x19705e);_0x33e378(_0x19c115[_0x35fb('0x14')](0x1f4,_0x19c538['message']));});});};
\ No newline at end of file
+var _0xe07b=['attributes','ShowSalesforceAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','map','model'];(function(_0x1bbfe6,_0x3dd9fd){var _0x57c56d=function(_0x580061){while(--_0x580061){_0x1bbfe6['push'](_0x1bbfe6['shift']());}};_0x57c56d(++_0x3dd9fd);}(_0xe07b,0x104));var _0xbe07=function(_0x4eebfb,_0x256cdc){_0x4eebfb=_0x4eebfb-0x0;var _0x54f760=_0xe07b[_0x4eebfb];return _0x54f760;};'use strict';var _=require(_0xbe07('0x0'));var util=require(_0xbe07('0x1'));var moment=require(_0xbe07('0x2'));var BPromise=require(_0xbe07('0x3'));var rs=require(_0xbe07('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe07('0x5'))['db'];var utils=require(_0xbe07('0x6'));var logger=require(_0xbe07('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbe07('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x305749,_0x3f0ae1,_0xcbeaf0){return new BPromise(function(_0x542e31,_0x14e9c7){return client[_0xbe07('0x9')](_0x305749,_0xcbeaf0)[_0xbe07('0xa')](function(_0x30f5e2){logger['info'](_0xbe07('0xb'),_0x3f0ae1,_0xbe07('0xc'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x3f0ae1,_0xbe07('0xc'),JSON[_0xbe07('0xd')](_0x30f5e2));if(_0x30f5e2['error']){if(_0x30f5e2[_0xbe07('0xe')][_0xbe07('0xf')]===0x1f4){logger[_0xbe07('0xe')](_0xbe07('0xb'),_0x3f0ae1,_0x30f5e2[_0xbe07('0xe')][_0xbe07('0x10')]);return _0x14e9c7(_0x30f5e2['error'][_0xbe07('0x10')]);}logger[_0xbe07('0xe')](_0xbe07('0xb'),_0x3f0ae1,_0x30f5e2[_0xbe07('0xe')][_0xbe07('0x10')]);return _0x542e31(_0x30f5e2['error'][_0xbe07('0x10')]);}else{logger[_0xbe07('0x11')](_0xbe07('0xb'),_0x3f0ae1,_0xbe07('0xc'));_0x542e31(_0x30f5e2['result'][_0xbe07('0x10')]);}})[_0xbe07('0x12')](function(_0x19586c){logger[_0xbe07('0xe')](_0xbe07('0xb'),_0x3f0ae1,_0x19586c);_0x14e9c7(_0x19586c);});});}exports[_0xbe07('0x13')]=function(_0x518591){var _0x4326c4=this;return new Promise(function(_0x4357d1,_0x31304e){return db[_0xbe07('0x14')][_0xbe07('0x15')]({'raw':_0x518591['options']?_0x518591[_0xbe07('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x518591[_0xbe07('0x16')]?_0x518591[_0xbe07('0x16')][_0xbe07('0x17')]||null:null,'attributes':_0x518591[_0xbe07('0x16')]?_0x518591['options']['attributes']||null:null,'limit':_0x518591['options']?_0x518591[_0xbe07('0x16')][_0xbe07('0x18')]||null:null,'include':_0x518591[_0xbe07('0x16')]?_0x518591['options'][_0xbe07('0x19')]?_[_0xbe07('0x1a')](_0x518591[_0xbe07('0x16')][_0xbe07('0x19')],function(_0x489302){return{'model':db[_0x489302[_0xbe07('0x1b')]],'as':_0x489302['as'],'attributes':_0x489302[_0xbe07('0x1c')],'include':_0x489302['include']?_[_0xbe07('0x1a')](_0x489302[_0xbe07('0x19')],function(_0x36bcba){return{'model':db[_0x36bcba[_0xbe07('0x1b')]],'as':_0x36bcba['as'],'attributes':_0x36bcba[_0xbe07('0x1c')],'include':_0x36bcba[_0xbe07('0x19')]?_['map'](_0x36bcba[_0xbe07('0x19')],function(_0xfc2621){return{'model':db[_0xfc2621[_0xbe07('0x1b')]],'as':_0xfc2621['as'],'attributes':_0xfc2621['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe07('0xa')](function(_0x14435c){logger[_0xbe07('0x11')](_0xbe07('0x13'),_0x518591);logger['debug']('GetSalesforceAccount',_0x518591,JSON[_0xbe07('0xd')](_0x14435c));_0x4357d1(_0x14435c);})[_0xbe07('0x12')](function(_0x3baf8f){logger[_0xbe07('0xe')](_0xbe07('0x13'),_0x3baf8f['message'],_0x518591);_0x31304e(_0x4326c4[_0xbe07('0xe')](0x1f4,_0x3baf8f[_0xbe07('0x10')]));});});};exports[_0xbe07('0x1d')]=function(_0x5bf596){var _0xe175e1=this;return new Promise(function(_0x15533b,_0x5b32b3){return db[_0xbe07('0x14')][_0xbe07('0x1e')]({'raw':_0x5bf596[_0xbe07('0x16')]?_0x5bf596[_0xbe07('0x16')][_0xbe07('0x1f')]===undefined?!![]:![]:!![],'where':_0x5bf596['options']?_0x5bf596[_0xbe07('0x16')][_0xbe07('0x17')]||null:null,'attributes':_0x5bf596['options']?_0x5bf596[_0xbe07('0x16')][_0xbe07('0x1c')]||null:null,'include':_0x5bf596['options']?_0x5bf596[_0xbe07('0x16')][_0xbe07('0x19')]?_[_0xbe07('0x1a')](_0x5bf596[_0xbe07('0x16')][_0xbe07('0x19')],function(_0x46c1d9){return{'model':db[_0x46c1d9['model']],'as':_0x46c1d9['as'],'attributes':_0x46c1d9[_0xbe07('0x1c')],'include':_0x46c1d9[_0xbe07('0x19')]?_[_0xbe07('0x1a')](_0x46c1d9['include'],function(_0x3a963e){return{'model':db[_0x3a963e['model']],'as':_0x3a963e['as'],'attributes':_0x3a963e[_0xbe07('0x1c')],'include':_0x3a963e[_0xbe07('0x19')]?_[_0xbe07('0x1a')](_0x3a963e[_0xbe07('0x19')],function(_0x3630ef){return{'model':db[_0x3630ef[_0xbe07('0x1b')]],'as':_0x3630ef['as'],'attributes':_0x3630ef[_0xbe07('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbe07('0xa')](function(_0x11fa4a){logger[_0xbe07('0x11')](_0xbe07('0x1d'),_0x5bf596);logger['debug'](_0xbe07('0x1d'),_0x5bf596,JSON[_0xbe07('0xd')](_0x11fa4a));_0x15533b(_0x11fa4a);})[_0xbe07('0x12')](function(_0x5b48f1){logger['error'](_0xbe07('0x1d'),_0x5b48f1[_0xbe07('0x10')],_0x5bf596);_0x5b32b3(_0xe175e1['error'](0x1f4,_0x5b48f1[_0xbe07('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js
index a300a2b..dd197b2 100644
--- a/server/api/intSalesforceConfiguration/index.js
+++ b/server/api/intSalesforceConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f2f=['put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x4330ab,_0x141abd){var _0x1d764d=function(_0x187d84){while(--_0x187d84){_0x4330ab['push'](_0x4330ab['shift']());}};_0x1d764d(++_0x141abd);}(_0x2f2f,0x161));var _0xf2f2=function(_0x4e3ead,_0x24b267){_0x4e3ead=_0x4e3ead-0x0;var _0x3a80ea=_0x2f2f[_0x4e3ead];return _0x3a80ea;};'use strict';var multer=require(_0xf2f2('0x0'));var util=require(_0xf2f2('0x1'));var path=require(_0xf2f2('0x2'));var timeout=require(_0xf2f2('0x3'));var express=require(_0xf2f2('0x4'));var router=express[_0xf2f2('0x5')]();var auth=require(_0xf2f2('0x6'));var interaction=require(_0xf2f2('0x7'));var config=require(_0xf2f2('0x8'));var controller=require(_0xf2f2('0x9'));router[_0xf2f2('0xa')]('/',auth[_0xf2f2('0xb')](),controller[_0xf2f2('0xc')]);router['get'](_0xf2f2('0xd'),auth[_0xf2f2('0xb')](),controller[_0xf2f2('0xe')]);router[_0xf2f2('0xa')](_0xf2f2('0xf'),auth['isAuthenticated'](),controller[_0xf2f2('0x10')]);router[_0xf2f2('0xa')]('/:id/subjects',auth[_0xf2f2('0xb')](),controller[_0xf2f2('0x11')]);router[_0xf2f2('0xa')](_0xf2f2('0x12'),auth[_0xf2f2('0xb')](),controller[_0xf2f2('0x13')]);router[_0xf2f2('0x14')]('/',auth[_0xf2f2('0xb')](),controller[_0xf2f2('0x15')]);router[_0xf2f2('0x16')](_0xf2f2('0xd'),auth[_0xf2f2('0xb')](),controller[_0xf2f2('0x17')]);router[_0xf2f2('0x18')](_0xf2f2('0xd'),auth[_0xf2f2('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3089=['./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','exports','util','path','Router','../../components/auth/service','../../config/environment'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x3089,0xd7));var _0x9308=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x3089[_0xc6be3a];return _0x56a310;};'use strict';var multer=require('multer');var util=require(_0x9308('0x0'));var path=require(_0x9308('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9308('0x2')]();var auth=require(_0x9308('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9308('0x4'));var controller=require(_0x9308('0x5'));router[_0x9308('0x6')]('/',auth[_0x9308('0x7')](),controller[_0x9308('0x8')]);router[_0x9308('0x6')](_0x9308('0x9'),auth[_0x9308('0x7')](),controller[_0x9308('0xa')]);router[_0x9308('0x6')](_0x9308('0xb'),auth[_0x9308('0x7')](),controller[_0x9308('0xc')]);router[_0x9308('0x6')](_0x9308('0xd'),auth[_0x9308('0x7')](),controller[_0x9308('0xe')]);router[_0x9308('0x6')](_0x9308('0xf'),auth[_0x9308('0x7')](),controller[_0x9308('0x10')]);router['post']('/',auth[_0x9308('0x7')](),controller[_0x9308('0x11')]);router[_0x9308('0x12')](_0x9308('0x9'),auth[_0x9308('0x7')](),controller[_0x9308('0x13')]);router[_0x9308('0x14')](_0x9308('0x9'),auth[_0x9308('0x7')](),controller['destroy']);module[_0x9308('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
index 3a64578..4f5e7ec 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x98fe=['contact','lead','contact_lead','nothing','sequelize','exports','STRING','ENUM','Task','Case'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x98fe,0x1ee));var _0xe98f=function(_0x37219e,_0x5e06b4){_0x37219e=_0x37219e-0x0;var _0x2a4ea6=_0x98fe[_0x37219e];return _0x2a4ea6;};'use strict';var Sequelize=require(_0xe98f('0x0'));module[_0xe98f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe98f('0x2')]},'ticketType':{'type':Sequelize[_0xe98f('0x3')](_0xe98f('0x4'),_0xe98f('0x5')),'defaultValue':_0xe98f('0x4')},'moduleSearch':{'type':Sequelize[_0xe98f('0x3')]('contact_lead',_0xe98f('0x6'),_0xe98f('0x7')),'defaultValue':_0xe98f('0x8')},'moduleCreate':{'type':Sequelize[_0xe98f('0x3')](_0xe98f('0x9'),_0xe98f('0x6'),_0xe98f('0x7')),'defaultValue':_0xe98f('0x7')}};
\ No newline at end of file
+var _0xc1bb=['nothing','sequelize','exports','STRING','ENUM','Case','Task','contact_lead','contact','lead'];(function(_0x25b56c,_0x37afa6){var _0x529989=function(_0x283dbb){while(--_0x283dbb){_0x25b56c['push'](_0x25b56c['shift']());}};_0x529989(++_0x37afa6);}(_0xc1bb,0x155));var _0xbc1b=function(_0x46ea66,_0xf7dfc6){_0x46ea66=_0x46ea66-0x0;var _0x312e7e=_0xc1bb[_0x46ea66];return _0x312e7e;};'use strict';var Sequelize=require(_0xbc1b('0x0'));module[_0xbc1b('0x1')]={'name':{'type':Sequelize[_0xbc1b('0x2')]},'description':{'type':Sequelize[_0xbc1b('0x2')]},'ticketType':{'type':Sequelize[_0xbc1b('0x3')]('Task',_0xbc1b('0x4')),'defaultValue':_0xbc1b('0x5')},'moduleSearch':{'type':Sequelize[_0xbc1b('0x3')](_0xbc1b('0x6'),_0xbc1b('0x7'),_0xbc1b('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xbc1b('0x3')](_0xbc1b('0x9'),_0xbc1b('0x7'),_0xbc1b('0x8')),'defaultValue':_0xbc1b('0x8')}};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
index 129dc91..3f60b74 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5401=['mustache','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','http','test','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','update','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','field','merge','SalesforceConfiguration','includeAll','include','rows','show','params','options','find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0xb0099a,_0x29ad2f){var _0x66c25e=function(_0x78f20e){while(--_0x78f20e){_0xb0099a['push'](_0xb0099a['shift']());}};_0x66c25e(++_0x29ad2f);}(_0x5401,0xfd));var _0x1540=function(_0x50ad01,_0x31cfed){_0x50ad01=_0x50ad01-0x0;var _0x31a9bd=_0x5401[_0x50ad01];return _0x31a9bd;};'use strict';var pdf=require(_0x1540('0x0'));var emlformat=require(_0x1540('0x1'));var rimraf=require(_0x1540('0x2'));var zipdir=require(_0x1540('0x3'));var jsonpatch=require(_0x1540('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1540('0x5'));var util=require('util');var path=require(_0x1540('0x6'));var sox=require(_0x1540('0x7'));var csv=require('to-csv');var ejs=require(_0x1540('0x8'));var fs=require('fs');var _=require(_0x1540('0x9'));var squel=require(_0x1540('0xa'));var crypto=require(_0x1540('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1540('0xc'));var querystring=require(_0x1540('0xd'));var Papa=require(_0x1540('0xe'));var Redis=require('ioredis');var authService=require(_0x1540('0xf'));var qs=require(_0x1540('0x10'));var hardwareService=require(_0x1540('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x1540('0x12'));var config=require('../../config/environment');var db=require(_0x1540('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x1540('0x14')]({'port':0x232a});function checkPasswordPattern(_0x324124,_0x5eea0e,_0x17a7ba){if(_0x17a7ba){var _0x332ea2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x332ea2[_0x1540('0x15')](_0x5eea0e)){return _0x324124;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x324124;}}function respondWithRpcPromise(_0x51f216,_0x54d7b3,_0xf99a64,_0x4ffdd8){return new BPromise(function(_0x5cf80d,_0x5db018){var _0x4bd586=_0x4ffdd8||client;return _0x4bd586[_0x1540('0x16')](_0x51f216,_0xf99a64)[_0x1540('0x17')](function(_0x5f4c01){logger['info'](_0x1540('0x18'),_0x54d7b3,_0x1540('0x19'));logger[_0x1540('0x1a')](_0x1540('0x1b'),_0x54d7b3,_0x1540('0x19'),JSON[_0x1540('0x1c')](_0x5f4c01));if(_0x5f4c01['error']){if(_0x5f4c01['error'][_0x1540('0x1d')]===0x1f4){logger[_0x1540('0x1e')](_0x1540('0x18'),_0x54d7b3,_0x5f4c01['error']['message']);return _0x5db018(_0x5f4c01[_0x1540('0x1e')][_0x1540('0x1f')]);}logger['error'](_0x1540('0x18'),_0x54d7b3,_0x5f4c01[_0x1540('0x1e')][_0x1540('0x1f')]);return _0x5cf80d(_0x5f4c01['error']['message']);}else{logger[_0x1540('0x20')](_0x1540('0x18'),_0x54d7b3,_0x1540('0x19'));_0x5cf80d(_0x5f4c01[_0x1540('0x21')][_0x1540('0x1f')]);}})[_0x1540('0x22')](function(_0x514a3c){logger[_0x1540('0x1e')](_0x1540('0x18'),_0x54d7b3,_0x514a3c);_0x5db018(_0x514a3c);});});}function respondWithStatusCode(_0x568e7e,_0x177f38){_0x177f38=_0x177f38||0xcc;return function(_0x30e76c){if(_0x30e76c){return _0x568e7e[_0x1540('0x23')](_0x177f38);}return _0x568e7e[_0x1540('0x24')](_0x177f38)[_0x1540('0x25')]();};}function respondWithResult(_0x11830a,_0x5916a){_0x5916a=_0x5916a||0xc8;return function(_0x4af9e3){if(_0x4af9e3){return _0x11830a['status'](_0x5916a)['json'](_0x4af9e3);}};}function respondWithFilteredResult(_0x59808e,_0x3255bf){return function(_0x491e5b){if(_0x491e5b){var _0x3801b9=_0x491e5b[_0x1540('0x26')],_0x5229e2=_0x3255bf[_0x1540('0x27')],_0x12a9a8=_0x3255bf[_0x1540('0x27')]+_0x3255bf[_0x1540('0x28')],_0xd0b6cd;if(_0x12a9a8>=_0x3801b9){_0x12a9a8=_0x3801b9;_0xd0b6cd=0xc8;}else{_0xd0b6cd=0xce;}_0x59808e[_0x1540('0x24')](_0xd0b6cd);return _0x59808e['set'](_0x1540('0x29'),_0x5229e2+'-'+_0x12a9a8+'/'+_0x3801b9)[_0x1540('0x2a')](_0x491e5b);}return null;};}function patchUpdates(_0x4664c0){return function(_0xe4cc0a){try{jsonpatch[_0x1540('0x2b')](_0xe4cc0a,_0x4664c0,!![]);}catch(_0x1497a7){return BPromise[_0x1540('0x2c')](_0x1497a7);}return _0xe4cc0a['save']();};}function saveUpdates(_0x593bb6,_0x2c15b8){return function(_0x400119){if(_0x400119){return _0x400119[_0x1540('0x2d')](_0x593bb6)[_0x1540('0x17')](function(_0x4e5f67){return _0x4e5f67;});}return null;};}function removeEntity(_0xf6b03e,_0x1ae5bb){return function(_0x5ece9f){if(_0x5ece9f){return _0x5ece9f[_0x1540('0x2e')]()[_0x1540('0x17')](function(){_0xf6b03e[_0x1540('0x24')](0xcc)[_0x1540('0x25')]();});}};}function handleEntityNotFound(_0x59ab77,_0x33bd35){return function(_0x1675a9){if(!_0x1675a9){_0x59ab77[_0x1540('0x23')](0x194);}return _0x1675a9;};}function handleError(_0x58ade3,_0x19b1c8){_0x19b1c8=_0x19b1c8||0x1f4;return function(_0x1b5736){logger[_0x1540('0x1e')](_0x1b5736[_0x1540('0x2f')]);if(_0x1b5736[_0x1540('0x30')]){delete _0x1b5736['name'];}_0x58ade3['status'](_0x19b1c8)[_0x1540('0x31')](_0x1b5736);};}exports[_0x1540('0x32')]=function(_0x1f07fe,_0xd2222f){var _0x1d2701={},_0x5db603={},_0x18e8c3={'count':0x0,'rows':[]};var _0x3d0e8a=db['SalesforceConfiguration'][_0x1540('0x33')];_0x5db603[_0x1540('0x34')]=_[_0x1540('0x35')](_0x3d0e8a);_0x5db603[_0x1540('0x36')]=_[_0x1540('0x35')](_0x1f07fe[_0x1540('0x36')]);_0x5db603[_0x1540('0x37')]=_[_0x1540('0x38')](_0x5db603[_0x1540('0x34')],_0x5db603[_0x1540('0x36')]);_0x1d2701[_0x1540('0x39')]=_[_0x1540('0x38')](_0x5db603[_0x1540('0x34')],qs[_0x1540('0x3a')](_0x1f07fe['query'][_0x1540('0x3a')]));_0x1d2701['attributes']=_0x1d2701['attributes'][_0x1540('0x3b')]?_0x1d2701[_0x1540('0x39')]:_0x5db603[_0x1540('0x34')];if(!_0x1f07fe[_0x1540('0x36')][_0x1540('0x3c')](_0x1540('0x3d'))){_0x1d2701['limit']=qs['limit'](_0x1f07fe[_0x1540('0x36')][_0x1540('0x28')]);_0x1d2701[_0x1540('0x27')]=qs[_0x1540('0x27')](_0x1f07fe[_0x1540('0x36')]['offset']);}_0x1d2701[_0x1540('0x3e')]=qs['sort'](_0x1f07fe[_0x1540('0x36')][_0x1540('0x3f')]);_0x1d2701[_0x1540('0x40')]=qs[_0x1540('0x37')](_[_0x1540('0x41')](_0x1f07fe['query'],_0x5db603[_0x1540('0x37')]));if(_0x1f07fe[_0x1540('0x36')][_0x1540('0x42')]){_0x1d2701[_0x1540('0x40')]=_['merge'](_0x1d2701[_0x1540('0x40')],{'$or':_[_0x1540('0x43')](_0x3d0e8a,function(_0x21b2c4){if(_0x21b2c4['type'][_0x1540('0x44')]!=='VIRTUAL'){var _0x10b73a={};_0x10b73a[_0x21b2c4[_0x1540('0x45')]]={'$like':'%'+_0x1f07fe[_0x1540('0x36')][_0x1540('0x42')]+'%'};return _0x10b73a;}})});}_0x1d2701=_[_0x1540('0x46')]({},_0x1d2701,_0x1f07fe['options']);var _0x47a819={'where':_0x1d2701[_0x1540('0x40')]};return db[_0x1540('0x47')][_0x1540('0x26')](_0x47a819)[_0x1540('0x17')](function(_0x168f62){_0x18e8c3[_0x1540('0x26')]=_0x168f62;if(_0x1f07fe['query'][_0x1540('0x48')]){_0x1d2701[_0x1540('0x49')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x1d2701);})['then'](function(_0x1d66dd){_0x18e8c3[_0x1540('0x4a')]=_0x1d66dd;return _0x18e8c3;})[_0x1540('0x17')](respondWithFilteredResult(_0xd2222f,_0x1d2701))['catch'](handleError(_0xd2222f,null));};exports[_0x1540('0x4b')]=function(_0x154525,_0x215a65){var _0x1a7e70={'raw':![],'where':{'id':_0x154525[_0x1540('0x4c')]['id']}},_0x17d397={};_0x17d397[_0x1540('0x34')]=_[_0x1540('0x35')](db[_0x1540('0x47')][_0x1540('0x33')]);_0x17d397[_0x1540('0x36')]=_['keys'](_0x154525[_0x1540('0x36')]);_0x17d397[_0x1540('0x37')]=_[_0x1540('0x38')](_0x17d397[_0x1540('0x34')],_0x17d397[_0x1540('0x36')]);_0x1a7e70[_0x1540('0x39')]=_['intersection'](_0x17d397[_0x1540('0x34')],qs[_0x1540('0x3a')](_0x154525[_0x1540('0x36')][_0x1540('0x3a')]));_0x1a7e70[_0x1540('0x39')]=_0x1a7e70[_0x1540('0x39')][_0x1540('0x3b')]?_0x1a7e70[_0x1540('0x39')]:_0x17d397['model'];if(_0x154525[_0x1540('0x36')][_0x1540('0x48')]){_0x1a7e70['include']=[{'all':!![]}];}_0x1a7e70=_[_0x1540('0x46')]({},_0x1a7e70,_0x154525[_0x1540('0x4d')]);return db['SalesforceConfiguration'][_0x1540('0x4e')](_0x1a7e70)[_0x1540('0x17')](handleEntityNotFound(_0x215a65,null))['then'](respondWithResult(_0x215a65,null))[_0x1540('0x22')](handleError(_0x215a65,null));};exports[_0x1540('0x4f')]=function(_0x49ecf6,_0x312a0c){return db[_0x1540('0x47')][_0x1540('0x4f')](_0x49ecf6['body'],{})[_0x1540('0x17')](respondWithResult(_0x312a0c,0xc9))['catch'](handleError(_0x312a0c,null));};exports[_0x1540('0x2d')]=function(_0x37af93,_0x22cfa0){if(_0x37af93[_0x1540('0x50')]['id']){delete _0x37af93[_0x1540('0x50')]['id'];}return db[_0x1540('0x47')][_0x1540('0x4e')]({'where':{'id':_0x37af93[_0x1540('0x4c')]['id']}})[_0x1540('0x17')](handleEntityNotFound(_0x22cfa0,null))[_0x1540('0x17')](saveUpdates(_0x37af93['body'],null))[_0x1540('0x17')](respondWithResult(_0x22cfa0,null))[_0x1540('0x22')](handleError(_0x22cfa0,null));};exports['destroy']=function(_0x1dde65,_0x257a05){return db[_0x1540('0x47')][_0x1540('0x4e')]({'where':{'id':_0x1dde65[_0x1540('0x4c')]['id']}})['then'](handleEntityNotFound(_0x257a05,null))[_0x1540('0x17')](removeEntity(_0x257a05,null))[_0x1540('0x22')](handleError(_0x257a05,null));};exports[_0x1540('0x51')]=function(_0x9a1f25,_0x1ad085,_0x555d79){var _0x1ad498={};var _0x363bce={};var _0x528119;var _0x50c3a0;return db[_0x1540('0x47')][_0x1540('0x52')]({'where':{'id':_0x9a1f25['params']['id']}})[_0x1540('0x17')](handleEntityNotFound(_0x1ad085,null))[_0x1540('0x17')](function(_0xdf2d8c){if(_0xdf2d8c){_0x528119=_0xdf2d8c;_0x363bce['model']=_['keys'](db[_0x1540('0x53')][_0x1540('0x33')]);_0x363bce[_0x1540('0x36')]=_[_0x1540('0x35')](_0x9a1f25[_0x1540('0x36')]);_0x363bce['filters']=_[_0x1540('0x38')](_0x363bce[_0x1540('0x34')],_0x363bce['query']);_0x1ad498['attributes']=_[_0x1540('0x38')](_0x363bce[_0x1540('0x34')],qs[_0x1540('0x3a')](_0x9a1f25[_0x1540('0x36')][_0x1540('0x3a')]));_0x1ad498[_0x1540('0x39')]=_0x1ad498[_0x1540('0x39')][_0x1540('0x3b')]?_0x1ad498[_0x1540('0x39')]:_0x363bce[_0x1540('0x34')];_0x1ad498[_0x1540('0x3e')]=qs[_0x1540('0x3f')](_0x9a1f25['query'][_0x1540('0x3f')]);_0x1ad498[_0x1540('0x40')]=qs[_0x1540('0x37')](_[_0x1540('0x41')](_0x9a1f25[_0x1540('0x36')],_0x363bce[_0x1540('0x37')]));if(_0x9a1f25['query'][_0x1540('0x42')]){_0x1ad498[_0x1540('0x40')]=_[_0x1540('0x46')](_0x1ad498[_0x1540('0x40')],{'$or':_[_0x1540('0x43')](_0x1ad498['attributes'],function(_0x512edb){var _0x17cbac={};_0x17cbac[_0x512edb]={'$like':'%'+_0x9a1f25['query'][_0x1540('0x42')]+'%'};return _0x17cbac;})});}_0x1ad498=_[_0x1540('0x46')]({},_0x1ad498,_0x9a1f25['options']);return _0x528119[_0x1540('0x51')](_0x1ad498);}})[_0x1540('0x17')](function(_0x349f08){if(_0x349f08){_0x50c3a0=_0x349f08[_0x1540('0x3b')];if(!_0x9a1f25[_0x1540('0x36')][_0x1540('0x3c')](_0x1540('0x3d'))){_0x1ad498[_0x1540('0x28')]=qs[_0x1540('0x28')](_0x9a1f25[_0x1540('0x36')]['limit']);_0x1ad498[_0x1540('0x27')]=qs['offset'](_0x9a1f25[_0x1540('0x36')]['offset']);}return _0x528119['getFields'](_0x1ad498);}})[_0x1540('0x17')](function(_0x4d34b8){if(_0x4d34b8){return _0x4d34b8?{'count':_0x50c3a0,'rows':_0x4d34b8}:null;}})['then'](respondWithResult(_0x1ad085,null))[_0x1540('0x22')](handleError(_0x1ad085,null));};exports[_0x1540('0x54')]=function(_0x49484a,_0x309bb8,_0x5871b4){var _0xd5ac72={};var _0x385a7b={};var _0x18d052;var _0x320b66;return db[_0x1540('0x47')][_0x1540('0x52')]({'where':{'id':_0x49484a[_0x1540('0x4c')]['id']}})[_0x1540('0x17')](handleEntityNotFound(_0x309bb8,null))['then'](function(_0x3db5e1){if(_0x3db5e1){_0x18d052=_0x3db5e1;_0x385a7b[_0x1540('0x34')]=_['keys'](db[_0x1540('0x53')][_0x1540('0x33')]);_0x385a7b[_0x1540('0x36')]=_[_0x1540('0x35')](_0x49484a[_0x1540('0x36')]);_0x385a7b[_0x1540('0x37')]=_[_0x1540('0x38')](_0x385a7b['model'],_0x385a7b[_0x1540('0x36')]);_0xd5ac72[_0x1540('0x39')]=_['intersection'](_0x385a7b[_0x1540('0x34')],qs[_0x1540('0x3a')](_0x49484a['query']['fields']));_0xd5ac72[_0x1540('0x39')]=_0xd5ac72[_0x1540('0x39')][_0x1540('0x3b')]?_0xd5ac72[_0x1540('0x39')]:_0x385a7b[_0x1540('0x34')];_0xd5ac72[_0x1540('0x3e')]=qs[_0x1540('0x3f')](_0x49484a[_0x1540('0x36')]['sort']);_0xd5ac72[_0x1540('0x40')]=qs[_0x1540('0x37')](_[_0x1540('0x41')](_0x49484a[_0x1540('0x36')],_0x385a7b['filters']));if(_0x49484a[_0x1540('0x36')]['filter']){_0xd5ac72[_0x1540('0x40')]=_[_0x1540('0x46')](_0xd5ac72[_0x1540('0x40')],{'$or':_[_0x1540('0x43')](_0xd5ac72[_0x1540('0x39')],function(_0x5cb0e0){var _0x21bb4c={};_0x21bb4c[_0x5cb0e0]={'$like':'%'+_0x49484a['query'][_0x1540('0x42')]+'%'};return _0x21bb4c;})});}_0xd5ac72=_[_0x1540('0x46')]({},_0xd5ac72,_0x49484a[_0x1540('0x4d')]);return _0x18d052['getSubjects'](_0xd5ac72);}})[_0x1540('0x17')](function(_0x16fa91){if(_0x16fa91){_0x320b66=_0x16fa91[_0x1540('0x3b')];if(!_0x49484a['query'][_0x1540('0x3c')](_0x1540('0x3d'))){_0xd5ac72[_0x1540('0x28')]=qs['limit'](_0x49484a['query']['limit']);_0xd5ac72[_0x1540('0x27')]=qs[_0x1540('0x27')](_0x49484a['query'][_0x1540('0x27')]);}return _0x18d052[_0x1540('0x54')](_0xd5ac72);}})[_0x1540('0x17')](function(_0xea26d5){if(_0xea26d5){return _0xea26d5?{'count':_0x320b66,'rows':_0xea26d5}:null;}})[_0x1540('0x17')](respondWithResult(_0x309bb8,null))['catch'](handleError(_0x309bb8,null));};exports[_0x1540('0x55')]=function(_0x48c0b2,_0x2f2a46,_0x4f7e44){var _0x165e80={};var _0x25662a={};var _0x9f8a60;var _0x51bbff;return db[_0x1540('0x47')][_0x1540('0x52')]({'where':{'id':_0x48c0b2[_0x1540('0x4c')]['id']}})[_0x1540('0x17')](handleEntityNotFound(_0x2f2a46,null))[_0x1540('0x17')](function(_0x49de71){if(_0x49de71){_0x9f8a60=_0x49de71;_0x25662a[_0x1540('0x34')]=_['keys'](db[_0x1540('0x53')][_0x1540('0x33')]);_0x25662a['query']=_['keys'](_0x48c0b2[_0x1540('0x36')]);_0x25662a[_0x1540('0x37')]=_[_0x1540('0x38')](_0x25662a[_0x1540('0x34')],_0x25662a[_0x1540('0x36')]);_0x165e80['attributes']=_['intersection'](_0x25662a['model'],qs[_0x1540('0x3a')](_0x48c0b2[_0x1540('0x36')]['fields']));_0x165e80[_0x1540('0x39')]=_0x165e80[_0x1540('0x39')][_0x1540('0x3b')]?_0x165e80['attributes']:_0x25662a[_0x1540('0x34')];_0x165e80[_0x1540('0x3e')]=qs['sort'](_0x48c0b2[_0x1540('0x36')]['sort']);_0x165e80[_0x1540('0x40')]=qs[_0x1540('0x37')](_['pick'](_0x48c0b2[_0x1540('0x36')],_0x25662a[_0x1540('0x37')]));if(_0x48c0b2['query']['filter']){_0x165e80[_0x1540('0x40')]=_[_0x1540('0x46')](_0x165e80[_0x1540('0x40')],{'$or':_[_0x1540('0x43')](_0x165e80['attributes'],function(_0x56b04e){var _0xf78bab={};_0xf78bab[_0x56b04e]={'$like':'%'+_0x48c0b2[_0x1540('0x36')][_0x1540('0x42')]+'%'};return _0xf78bab;})});}_0x165e80=_[_0x1540('0x46')]({},_0x165e80,_0x48c0b2[_0x1540('0x4d')]);return _0x9f8a60[_0x1540('0x55')](_0x165e80);}})[_0x1540('0x17')](function(_0x3e8e57){if(_0x3e8e57){_0x51bbff=_0x3e8e57[_0x1540('0x3b')];if(!_0x48c0b2[_0x1540('0x36')]['hasOwnProperty'](_0x1540('0x3d'))){_0x165e80[_0x1540('0x28')]=qs['limit'](_0x48c0b2[_0x1540('0x36')][_0x1540('0x28')]);_0x165e80[_0x1540('0x27')]=qs[_0x1540('0x27')](_0x48c0b2[_0x1540('0x36')]['offset']);}return _0x9f8a60['getDescriptions'](_0x165e80);}})['then'](function(_0x473b07){if(_0x473b07){return _0x473b07?{'count':_0x51bbff,'rows':_0x473b07}:null;}})[_0x1540('0x17')](respondWithResult(_0x2f2a46,null))['catch'](handleError(_0x2f2a46,null));};
\ No newline at end of file
+var _0xa457=['test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','status','end','count','offset','limit','Content-Range','json','apply','save','update','destroy','sendStatus','stack','name','send','SalesforceConfiguration','rawAttributes','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','type','key','VIRTUAL','options','findAll','rows','show','params','catch','create','body','find','findOne','SalesforceField','pick','map','getFields','getSubjects','hasOwnProperty','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0xd0c66f,_0x5f557c){var _0xe29d01=function(_0x1a54c3){while(--_0x1a54c3){_0xd0c66f['push'](_0xd0c66f['shift']());}};_0xe29d01(++_0x5f557c);}(_0xa457,0x1d7));var _0x7a45=function(_0x487d96,_0x252238){_0x487d96=_0x487d96-0x0;var _0x15944e=_0xa457[_0x487d96];return _0x15944e;};'use strict';var pdf=require(_0x7a45('0x0'));var emlformat=require(_0x7a45('0x1'));var rimraf=require(_0x7a45('0x2'));var zipdir=require(_0x7a45('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7a45('0x4'));var Mustache=require('mustache');var util=require(_0x7a45('0x5'));var path=require(_0x7a45('0x6'));var sox=require(_0x7a45('0x7'));var csv=require(_0x7a45('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7a45('0x9'));var squel=require(_0x7a45('0xa'));var crypto=require('crypto');var jsforce=require(_0x7a45('0xb'));var deskjs=require(_0x7a45('0xc'));var toCsv=require(_0x7a45('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7a45('0xd'));var hardwareService=require(_0x7a45('0xe'));var logger=require(_0x7a45('0xf'))('api');var utils=require(_0x7a45('0x10'));var config=require(_0x7a45('0x11'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7a45('0x12'));var client=jayson[_0x7a45('0x13')][_0x7a45('0x14')]({'port':0x232a});function checkPasswordPattern(_0x156ff5,_0x4cfeb3,_0x1b4958){if(_0x1b4958){var _0x58f42a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58f42a[_0x7a45('0x15')](_0x4cfeb3)){return _0x156ff5;}else{throw new Error(_0x7a45('0x16'));}}else{return _0x156ff5;}}function respondWithRpcPromise(_0x5b8926,_0x40a25c,_0x2fcd8a,_0x5e5a64){return new BPromise(function(_0x30ca07,_0x5b00e6){var _0x4028a1=_0x5e5a64||client;return _0x4028a1['request'](_0x5b8926,_0x2fcd8a)[_0x7a45('0x17')](function(_0xb5cb16){logger[_0x7a45('0x18')](_0x7a45('0x19'),_0x40a25c,'request\x20sent');logger[_0x7a45('0x1a')](_0x7a45('0x1b'),_0x40a25c,'request\x20sent',JSON['stringify'](_0xb5cb16));if(_0xb5cb16[_0x7a45('0x1c')]){if(_0xb5cb16[_0x7a45('0x1c')]['code']===0x1f4){logger[_0x7a45('0x1c')]('SalesforceConfiguration,\x20%s,\x20%s',_0x40a25c,_0xb5cb16[_0x7a45('0x1c')][_0x7a45('0x1d')]);return _0x5b00e6(_0xb5cb16[_0x7a45('0x1c')][_0x7a45('0x1d')]);}logger[_0x7a45('0x1c')](_0x7a45('0x19'),_0x40a25c,_0xb5cb16[_0x7a45('0x1c')]['message']);return _0x30ca07(_0xb5cb16[_0x7a45('0x1c')][_0x7a45('0x1d')]);}else{logger[_0x7a45('0x18')](_0x7a45('0x19'),_0x40a25c,_0x7a45('0x1e'));_0x30ca07(_0xb5cb16['result']['message']);}})['catch'](function(_0x2b1c7d){logger['error'](_0x7a45('0x19'),_0x40a25c,_0x2b1c7d);_0x5b00e6(_0x2b1c7d);});});}function respondWithStatusCode(_0x52ba7e,_0x12582f){_0x12582f=_0x12582f||0xcc;return function(_0x2498a8){if(_0x2498a8){return _0x52ba7e['sendStatus'](_0x12582f);}return _0x52ba7e[_0x7a45('0x1f')](_0x12582f)[_0x7a45('0x20')]();};}function respondWithResult(_0x5a781b,_0x16e414){_0x16e414=_0x16e414||0xc8;return function(_0x1254c3){if(_0x1254c3){return _0x5a781b[_0x7a45('0x1f')](_0x16e414)['json'](_0x1254c3);}};}function respondWithFilteredResult(_0x12d519,_0x387fe2){return function(_0x26ca7a){if(_0x26ca7a){var _0x4cebc0=_0x26ca7a[_0x7a45('0x21')],_0x395d6c=_0x387fe2[_0x7a45('0x22')],_0x306eba=_0x387fe2[_0x7a45('0x22')]+_0x387fe2[_0x7a45('0x23')],_0x198c16;if(_0x306eba>=_0x4cebc0){_0x306eba=_0x4cebc0;_0x198c16=0xc8;}else{_0x198c16=0xce;}_0x12d519[_0x7a45('0x1f')](_0x198c16);return _0x12d519['set'](_0x7a45('0x24'),_0x395d6c+'-'+_0x306eba+'/'+_0x4cebc0)[_0x7a45('0x25')](_0x26ca7a);}return null;};}function patchUpdates(_0xe562cc){return function(_0x3ec2c0){try{jsonpatch[_0x7a45('0x26')](_0x3ec2c0,_0xe562cc,!![]);}catch(_0x4c5853){return BPromise['reject'](_0x4c5853);}return _0x3ec2c0[_0x7a45('0x27')]();};}function saveUpdates(_0x780d76,_0x38c1e7){return function(_0x58ed3c){if(_0x58ed3c){return _0x58ed3c[_0x7a45('0x28')](_0x780d76)['then'](function(_0x51e5b4){return _0x51e5b4;});}return null;};}function removeEntity(_0x2602df,_0x426619){return function(_0x1603a6){if(_0x1603a6){return _0x1603a6[_0x7a45('0x29')]()[_0x7a45('0x17')](function(){_0x2602df[_0x7a45('0x1f')](0xcc)[_0x7a45('0x20')]();});}};}function handleEntityNotFound(_0x5b2387,_0x254c42){return function(_0xa85e04){if(!_0xa85e04){_0x5b2387[_0x7a45('0x2a')](0x194);}return _0xa85e04;};}function handleError(_0x4b1f91,_0x254e32){_0x254e32=_0x254e32||0x1f4;return function(_0x566d26){logger[_0x7a45('0x1c')](_0x566d26[_0x7a45('0x2b')]);if(_0x566d26[_0x7a45('0x2c')]){delete _0x566d26[_0x7a45('0x2c')];}_0x4b1f91[_0x7a45('0x1f')](_0x254e32)[_0x7a45('0x2d')](_0x566d26);};}exports['index']=function(_0x302e27,_0x3a59e8){var _0x5b1c26={},_0xeb2fd4={},_0x42cdd1={'count':0x0,'rows':[]};var _0x500b55=db[_0x7a45('0x2e')][_0x7a45('0x2f')];_0xeb2fd4['model']=_[_0x7a45('0x30')](_0x500b55);_0xeb2fd4['query']=_[_0x7a45('0x30')](_0x302e27[_0x7a45('0x31')]);_0xeb2fd4['filters']=_[_0x7a45('0x32')](_0xeb2fd4[_0x7a45('0x33')],_0xeb2fd4[_0x7a45('0x31')]);_0x5b1c26[_0x7a45('0x34')]=_['intersection'](_0xeb2fd4['model'],qs['fields'](_0x302e27[_0x7a45('0x31')][_0x7a45('0x35')]));_0x5b1c26[_0x7a45('0x34')]=_0x5b1c26[_0x7a45('0x34')][_0x7a45('0x36')]?_0x5b1c26['attributes']:_0xeb2fd4[_0x7a45('0x33')];if(!_0x302e27[_0x7a45('0x31')]['hasOwnProperty'](_0x7a45('0x37'))){_0x5b1c26[_0x7a45('0x23')]=qs['limit'](_0x302e27['query'][_0x7a45('0x23')]);_0x5b1c26['offset']=qs[_0x7a45('0x22')](_0x302e27[_0x7a45('0x31')]['offset']);}_0x5b1c26[_0x7a45('0x38')]=qs[_0x7a45('0x39')](_0x302e27[_0x7a45('0x31')][_0x7a45('0x39')]);_0x5b1c26[_0x7a45('0x3a')]=qs[_0x7a45('0x3b')](_['pick'](_0x302e27[_0x7a45('0x31')],_0xeb2fd4[_0x7a45('0x3b')]));if(_0x302e27[_0x7a45('0x31')][_0x7a45('0x3c')]){_0x5b1c26[_0x7a45('0x3a')]=_[_0x7a45('0x3d')](_0x5b1c26['where'],{'$or':_['map'](_0x500b55,function(_0x384c84){if(_0x384c84[_0x7a45('0x3e')][_0x7a45('0x3f')]!==_0x7a45('0x40')){var _0x2bbde1={};_0x2bbde1[_0x384c84['field']]={'$like':'%'+_0x302e27[_0x7a45('0x31')][_0x7a45('0x3c')]+'%'};return _0x2bbde1;}})});}_0x5b1c26=_[_0x7a45('0x3d')]({},_0x5b1c26,_0x302e27[_0x7a45('0x41')]);var _0x13bd56={'where':_0x5b1c26[_0x7a45('0x3a')]};return db[_0x7a45('0x2e')]['count'](_0x13bd56)['then'](function(_0x2c5426){_0x42cdd1[_0x7a45('0x21')]=_0x2c5426;if(_0x302e27[_0x7a45('0x31')]['includeAll']){_0x5b1c26['include']=[{'all':!![]}];}return db[_0x7a45('0x2e')][_0x7a45('0x42')](_0x5b1c26);})[_0x7a45('0x17')](function(_0x2c9888){_0x42cdd1[_0x7a45('0x43')]=_0x2c9888;return _0x42cdd1;})[_0x7a45('0x17')](respondWithFilteredResult(_0x3a59e8,_0x5b1c26))['catch'](handleError(_0x3a59e8,null));};exports[_0x7a45('0x44')]=function(_0xbeb076,_0x3a0c0e){var _0x4a1666={'raw':![],'where':{'id':_0xbeb076[_0x7a45('0x45')]['id']}},_0xaed1f={};_0xaed1f[_0x7a45('0x33')]=_['keys'](db['SalesforceConfiguration'][_0x7a45('0x2f')]);_0xaed1f[_0x7a45('0x31')]=_[_0x7a45('0x30')](_0xbeb076['query']);_0xaed1f[_0x7a45('0x3b')]=_['intersection'](_0xaed1f[_0x7a45('0x33')],_0xaed1f[_0x7a45('0x31')]);_0x4a1666['attributes']=_[_0x7a45('0x32')](_0xaed1f[_0x7a45('0x33')],qs[_0x7a45('0x35')](_0xbeb076[_0x7a45('0x31')][_0x7a45('0x35')]));_0x4a1666[_0x7a45('0x34')]=_0x4a1666[_0x7a45('0x34')]['length']?_0x4a1666[_0x7a45('0x34')]:_0xaed1f[_0x7a45('0x33')];if(_0xbeb076[_0x7a45('0x31')]['includeAll']){_0x4a1666['include']=[{'all':!![]}];}_0x4a1666=_[_0x7a45('0x3d')]({},_0x4a1666,_0xbeb076[_0x7a45('0x41')]);return db[_0x7a45('0x2e')]['find'](_0x4a1666)['then'](handleEntityNotFound(_0x3a0c0e,null))[_0x7a45('0x17')](respondWithResult(_0x3a0c0e,null))[_0x7a45('0x46')](handleError(_0x3a0c0e,null));};exports[_0x7a45('0x47')]=function(_0x37dd2f,_0x32c21a){return db[_0x7a45('0x2e')][_0x7a45('0x47')](_0x37dd2f['body'],{})[_0x7a45('0x17')](respondWithResult(_0x32c21a,0xc9))[_0x7a45('0x46')](handleError(_0x32c21a,null));};exports[_0x7a45('0x28')]=function(_0x1e3aa2,_0x1a5b3e){if(_0x1e3aa2['body']['id']){delete _0x1e3aa2[_0x7a45('0x48')]['id'];}return db[_0x7a45('0x2e')]['find']({'where':{'id':_0x1e3aa2[_0x7a45('0x45')]['id']}})[_0x7a45('0x17')](handleEntityNotFound(_0x1a5b3e,null))[_0x7a45('0x17')](saveUpdates(_0x1e3aa2[_0x7a45('0x48')],null))[_0x7a45('0x17')](respondWithResult(_0x1a5b3e,null))[_0x7a45('0x46')](handleError(_0x1a5b3e,null));};exports[_0x7a45('0x29')]=function(_0x358820,_0x54c22e){return db[_0x7a45('0x2e')][_0x7a45('0x49')]({'where':{'id':_0x358820[_0x7a45('0x45')]['id']}})['then'](handleEntityNotFound(_0x54c22e,null))[_0x7a45('0x17')](removeEntity(_0x54c22e,null))[_0x7a45('0x46')](handleError(_0x54c22e,null));};exports['getFields']=function(_0x49e8cb,_0x12ba9a,_0x1e4295){var _0x24a3e2={};var _0x1f4105={};var _0x382e8e;var _0x1f42f2;return db[_0x7a45('0x2e')][_0x7a45('0x4a')]({'where':{'id':_0x49e8cb[_0x7a45('0x45')]['id']}})[_0x7a45('0x17')](handleEntityNotFound(_0x12ba9a,null))[_0x7a45('0x17')](function(_0x4f2f29){if(_0x4f2f29){_0x382e8e=_0x4f2f29;_0x1f4105[_0x7a45('0x33')]=_[_0x7a45('0x30')](db[_0x7a45('0x4b')][_0x7a45('0x2f')]);_0x1f4105[_0x7a45('0x31')]=_[_0x7a45('0x30')](_0x49e8cb[_0x7a45('0x31')]);_0x1f4105[_0x7a45('0x3b')]=_[_0x7a45('0x32')](_0x1f4105['model'],_0x1f4105[_0x7a45('0x31')]);_0x24a3e2[_0x7a45('0x34')]=_[_0x7a45('0x32')](_0x1f4105[_0x7a45('0x33')],qs[_0x7a45('0x35')](_0x49e8cb[_0x7a45('0x31')][_0x7a45('0x35')]));_0x24a3e2[_0x7a45('0x34')]=_0x24a3e2[_0x7a45('0x34')][_0x7a45('0x36')]?_0x24a3e2[_0x7a45('0x34')]:_0x1f4105[_0x7a45('0x33')];_0x24a3e2[_0x7a45('0x38')]=qs[_0x7a45('0x39')](_0x49e8cb[_0x7a45('0x31')][_0x7a45('0x39')]);_0x24a3e2['where']=qs[_0x7a45('0x3b')](_[_0x7a45('0x4c')](_0x49e8cb[_0x7a45('0x31')],_0x1f4105[_0x7a45('0x3b')]));if(_0x49e8cb['query'][_0x7a45('0x3c')]){_0x24a3e2[_0x7a45('0x3a')]=_['merge'](_0x24a3e2['where'],{'$or':_[_0x7a45('0x4d')](_0x24a3e2[_0x7a45('0x34')],function(_0x5646ff){var _0x335593={};_0x335593[_0x5646ff]={'$like':'%'+_0x49e8cb[_0x7a45('0x31')]['filter']+'%'};return _0x335593;})});}_0x24a3e2=_[_0x7a45('0x3d')]({},_0x24a3e2,_0x49e8cb[_0x7a45('0x41')]);return _0x382e8e['getFields'](_0x24a3e2);}})['then'](function(_0x572e11){if(_0x572e11){_0x1f42f2=_0x572e11['length'];if(!_0x49e8cb['query']['hasOwnProperty'](_0x7a45('0x37'))){_0x24a3e2[_0x7a45('0x23')]=qs['limit'](_0x49e8cb['query'][_0x7a45('0x23')]);_0x24a3e2[_0x7a45('0x22')]=qs['offset'](_0x49e8cb[_0x7a45('0x31')][_0x7a45('0x22')]);}return _0x382e8e[_0x7a45('0x4e')](_0x24a3e2);}})['then'](function(_0x241be5){if(_0x241be5){return _0x241be5?{'count':_0x1f42f2,'rows':_0x241be5}:null;}})[_0x7a45('0x17')](respondWithResult(_0x12ba9a,null))[_0x7a45('0x46')](handleError(_0x12ba9a,null));};exports[_0x7a45('0x4f')]=function(_0xb1ee8b,_0x340213,_0x1a576e){var _0x2afb7b={};var _0x42d6a5={};var _0x9c6a3a;var _0x4f0706;return db['SalesforceConfiguration'][_0x7a45('0x4a')]({'where':{'id':_0xb1ee8b[_0x7a45('0x45')]['id']}})[_0x7a45('0x17')](handleEntityNotFound(_0x340213,null))['then'](function(_0x77d62f){if(_0x77d62f){_0x9c6a3a=_0x77d62f;_0x42d6a5[_0x7a45('0x33')]=_[_0x7a45('0x30')](db['SalesforceField'][_0x7a45('0x2f')]);_0x42d6a5[_0x7a45('0x31')]=_[_0x7a45('0x30')](_0xb1ee8b[_0x7a45('0x31')]);_0x42d6a5[_0x7a45('0x3b')]=_[_0x7a45('0x32')](_0x42d6a5[_0x7a45('0x33')],_0x42d6a5[_0x7a45('0x31')]);_0x2afb7b[_0x7a45('0x34')]=_['intersection'](_0x42d6a5[_0x7a45('0x33')],qs['fields'](_0xb1ee8b[_0x7a45('0x31')][_0x7a45('0x35')]));_0x2afb7b[_0x7a45('0x34')]=_0x2afb7b[_0x7a45('0x34')][_0x7a45('0x36')]?_0x2afb7b['attributes']:_0x42d6a5[_0x7a45('0x33')];_0x2afb7b[_0x7a45('0x38')]=qs[_0x7a45('0x39')](_0xb1ee8b['query'][_0x7a45('0x39')]);_0x2afb7b['where']=qs[_0x7a45('0x3b')](_[_0x7a45('0x4c')](_0xb1ee8b[_0x7a45('0x31')],_0x42d6a5[_0x7a45('0x3b')]));if(_0xb1ee8b['query'][_0x7a45('0x3c')]){_0x2afb7b[_0x7a45('0x3a')]=_[_0x7a45('0x3d')](_0x2afb7b[_0x7a45('0x3a')],{'$or':_['map'](_0x2afb7b[_0x7a45('0x34')],function(_0x4d19c7){var _0x3a0700={};_0x3a0700[_0x4d19c7]={'$like':'%'+_0xb1ee8b['query'][_0x7a45('0x3c')]+'%'};return _0x3a0700;})});}_0x2afb7b=_[_0x7a45('0x3d')]({},_0x2afb7b,_0xb1ee8b[_0x7a45('0x41')]);return _0x9c6a3a[_0x7a45('0x4f')](_0x2afb7b);}})[_0x7a45('0x17')](function(_0x2e6527){if(_0x2e6527){_0x4f0706=_0x2e6527[_0x7a45('0x36')];if(!_0xb1ee8b[_0x7a45('0x31')][_0x7a45('0x50')](_0x7a45('0x37'))){_0x2afb7b[_0x7a45('0x23')]=qs[_0x7a45('0x23')](_0xb1ee8b[_0x7a45('0x31')][_0x7a45('0x23')]);_0x2afb7b['offset']=qs['offset'](_0xb1ee8b[_0x7a45('0x31')]['offset']);}return _0x9c6a3a[_0x7a45('0x4f')](_0x2afb7b);}})[_0x7a45('0x17')](function(_0x1c5a32){if(_0x1c5a32){return _0x1c5a32?{'count':_0x4f0706,'rows':_0x1c5a32}:null;}})[_0x7a45('0x17')](respondWithResult(_0x340213,null))[_0x7a45('0x46')](handleError(_0x340213,null));};exports[_0x7a45('0x51')]=function(_0x5dfc5a,_0x2c8406,_0xc41e5b){var _0x2b974a={};var _0x433192={};var _0x59fb56;var _0x53f15e;return db[_0x7a45('0x2e')][_0x7a45('0x4a')]({'where':{'id':_0x5dfc5a[_0x7a45('0x45')]['id']}})[_0x7a45('0x17')](handleEntityNotFound(_0x2c8406,null))[_0x7a45('0x17')](function(_0x1af0e7){if(_0x1af0e7){_0x59fb56=_0x1af0e7;_0x433192[_0x7a45('0x33')]=_[_0x7a45('0x30')](db['SalesforceField']['rawAttributes']);_0x433192['query']=_[_0x7a45('0x30')](_0x5dfc5a[_0x7a45('0x31')]);_0x433192[_0x7a45('0x3b')]=_[_0x7a45('0x32')](_0x433192[_0x7a45('0x33')],_0x433192[_0x7a45('0x31')]);_0x2b974a['attributes']=_[_0x7a45('0x32')](_0x433192[_0x7a45('0x33')],qs[_0x7a45('0x35')](_0x5dfc5a[_0x7a45('0x31')]['fields']));_0x2b974a[_0x7a45('0x34')]=_0x2b974a[_0x7a45('0x34')]['length']?_0x2b974a[_0x7a45('0x34')]:_0x433192['model'];_0x2b974a[_0x7a45('0x38')]=qs[_0x7a45('0x39')](_0x5dfc5a[_0x7a45('0x31')]['sort']);_0x2b974a[_0x7a45('0x3a')]=qs[_0x7a45('0x3b')](_[_0x7a45('0x4c')](_0x5dfc5a[_0x7a45('0x31')],_0x433192[_0x7a45('0x3b')]));if(_0x5dfc5a[_0x7a45('0x31')][_0x7a45('0x3c')]){_0x2b974a[_0x7a45('0x3a')]=_[_0x7a45('0x3d')](_0x2b974a[_0x7a45('0x3a')],{'$or':_[_0x7a45('0x4d')](_0x2b974a[_0x7a45('0x34')],function(_0x2abe79){var _0x58e1c0={};_0x58e1c0[_0x2abe79]={'$like':'%'+_0x5dfc5a[_0x7a45('0x31')][_0x7a45('0x3c')]+'%'};return _0x58e1c0;})});}_0x2b974a=_[_0x7a45('0x3d')]({},_0x2b974a,_0x5dfc5a[_0x7a45('0x41')]);return _0x59fb56[_0x7a45('0x51')](_0x2b974a);}})[_0x7a45('0x17')](function(_0x99da5c){if(_0x99da5c){_0x53f15e=_0x99da5c[_0x7a45('0x36')];if(!_0x5dfc5a[_0x7a45('0x31')]['hasOwnProperty'](_0x7a45('0x37'))){_0x2b974a[_0x7a45('0x23')]=qs[_0x7a45('0x23')](_0x5dfc5a['query'][_0x7a45('0x23')]);_0x2b974a[_0x7a45('0x22')]=qs[_0x7a45('0x22')](_0x5dfc5a[_0x7a45('0x31')][_0x7a45('0x22')]);}return _0x59fb56[_0x7a45('0x51')](_0x2b974a);}})['then'](function(_0x14b739){if(_0x14b739){return _0x14b739?{'count':_0x53f15e,'rows':_0x14b739}:null;}})[_0x7a45('0x17')](respondWithResult(_0x2c8406,null))[_0x7a45('0x46')](handleError(_0x2c8406,null));};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
index cea6a8a..dc877dd 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4feb=['moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api'];(function(_0x188dd3,_0x1aa2ef){var _0x1edca0=function(_0x2ed731){while(--_0x2ed731){_0x188dd3['push'](_0x188dd3['shift']());}};_0x1edca0(++_0x1aa2ef);}(_0x4feb,0xf9));var _0xb4fe=function(_0x539e3e,_0x573ca1){_0x539e3e=_0x539e3e-0x0;var _0x4a7ff0=_0x4feb[_0x539e3e];return _0x4a7ff0;};'use strict';var _=require(_0xb4fe('0x0'));var util=require('util');var logger=require(_0xb4fe('0x1'))(_0xb4fe('0x2'));var moment=require(_0xb4fe('0x3'));var BPromise=require(_0xb4fe('0x4'));var rp=require(_0xb4fe('0x5'));var fs=require('fs');var path=require(_0xb4fe('0x6'));var rimraf=require('rimraf');var config=require(_0xb4fe('0x7'));var attributes=require(_0xb4fe('0x8'));module[_0xb4fe('0x9')]=function(_0x324672,_0x32ada7){return _0x324672['define'](_0xb4fe('0xa'),attributes,{'tableName':_0xb4fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x43ab=['exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x307313,_0x3930e6){var _0x26e356=function(_0x29ce0b){while(--_0x29ce0b){_0x307313['push'](_0x307313['shift']());}};_0x26e356(++_0x3930e6);}(_0x43ab,0xd4));var _0xb43a=function(_0x275a78,_0x7617e5){_0x275a78=_0x275a78-0x0;var _0x33528a=_0x43ab[_0x275a78];return _0x33528a;};'use strict';var _=require(_0xb43a('0x0'));var util=require(_0xb43a('0x1'));var logger=require(_0xb43a('0x2'))(_0xb43a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb43a('0x4'));var fs=require('fs');var path=require(_0xb43a('0x5'));var rimraf=require(_0xb43a('0x6'));var config=require(_0xb43a('0x7'));var attributes=require(_0xb43a('0x8'));module[_0xb43a('0x9')]=function(_0x46f525,_0x31dd98){return _0x46f525[_0xb43a('0xa')](_0xb43a('0xb'),attributes,{'tableName':_0xb43a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
index 3e7ef92..99fc504 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['info','SalesforceConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x53ed7a,_0x7fad75){_0x53ed7a=_0x53ed7a-0x0;var _0x3b6bbf=_0x7a54[_0x53ed7a];return _0x3b6bbf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x1261=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x15d82c,_0x53a3d4){var _0x2a2b09=function(_0x106aaa){while(--_0x106aaa){_0x15d82c['push'](_0x15d82c['shift']());}};_0x2a2b09(++_0x53a3d4);}(_0x1261,0x144));var _0x1126=function(_0x59008b,_0x75ea97){_0x59008b=_0x59008b-0x0;var _0x20359c=_0x1261[_0x59008b];return _0x20359c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js
index ae851e1..e8d86c6 100644
--- a/server/api/intSalesforceField/index.js
+++ b/server/api/intSalesforceField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x30e5=['index','/:id','isAuthenticated','show','post','create','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4beb7a,_0x246983){var _0x50c7dd=function(_0x4c006c){while(--_0x4c006c){_0x4beb7a['push'](_0x4beb7a['shift']());}};_0x50c7dd(++_0x246983);}(_0x30e5,0x14c));var _0x530e=function(_0x5d706f,_0x107ecc){_0x5d706f=_0x5d706f-0x0;var _0xe30a47=_0x30e5[_0x5d706f];return _0xe30a47;};'use strict';var multer=require(_0x530e('0x0'));var util=require(_0x530e('0x1'));var path=require(_0x530e('0x2'));var timeout=require(_0x530e('0x3'));var express=require(_0x530e('0x4'));var router=express[_0x530e('0x5')]();var auth=require(_0x530e('0x6'));var interaction=require(_0x530e('0x7'));var config=require(_0x530e('0x8'));var controller=require('./intSalesforceField.controller');router[_0x530e('0x9')]('/',auth['isAuthenticated'](),controller[_0x530e('0xa')]);router[_0x530e('0x9')](_0x530e('0xb'),auth[_0x530e('0xc')](),controller[_0x530e('0xd')]);router[_0x530e('0xe')]('/',auth['isAuthenticated'](),controller[_0x530e('0xf')]);router[_0x530e('0x10')]('/:id',auth[_0x530e('0xc')](),controller[_0x530e('0x11')]);router['delete'](_0x530e('0xb'),auth[_0x530e('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xfab0=['../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x39dd10,_0x134622){var _0x35bd8a=function(_0x156710){while(--_0x156710){_0x39dd10['push'](_0x39dd10['shift']());}};_0x35bd8a(++_0x134622);}(_0xfab0,0x139));var _0x0fab=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xfab0[_0x1406ae];return _0x23a076;};'use strict';var multer=require(_0x0fab('0x0'));var util=require(_0x0fab('0x1'));var path=require(_0x0fab('0x2'));var timeout=require(_0x0fab('0x3'));var express=require(_0x0fab('0x4'));var router=express[_0x0fab('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x0fab('0x6'));var config=require(_0x0fab('0x7'));var controller=require(_0x0fab('0x8'));router[_0x0fab('0x9')]('/',auth[_0x0fab('0xa')](),controller[_0x0fab('0xb')]);router[_0x0fab('0x9')](_0x0fab('0xc'),auth[_0x0fab('0xa')](),controller[_0x0fab('0xd')]);router[_0x0fab('0xe')]('/',auth[_0x0fab('0xa')](),controller['create']);router[_0x0fab('0xf')](_0x0fab('0xc'),auth[_0x0fab('0xa')](),controller[_0x0fab('0x10')]);router[_0x0fab('0x11')](_0x0fab('0xc'),auth[_0x0fab('0xa')](),controller[_0x0fab('0x12')]);module[_0x0fab('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js
index 6e3400f..8fe6e5e 100644
--- a/server/api/intSalesforceField/intSalesforceField.attributes.js
+++ b/server/api/intSalesforceField/intSalesforceField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa0da=['keyValue','STRING','sequelize','exports','string','variable','customVariable'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa0da,0x1bb));var _0xaa0d=function(_0xe470b2,_0x13d3be){_0xe470b2=_0xe470b2-0x0;var _0x373fd7=_0xa0da[_0xe470b2];return _0x373fd7;};'use strict';var Sequelize=require(_0xaa0d('0x0'));module[_0xaa0d('0x1')]={'type':{'type':Sequelize['ENUM'](_0xaa0d('0x2'),_0xaa0d('0x3'),_0xaa0d('0x4'),_0xaa0d('0x5')),'defaultValue':_0xaa0d('0x2')},'content':{'type':Sequelize[_0xaa0d('0x6')]},'key':{'type':Sequelize[_0xaa0d('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xaa0d('0x3'),_0xaa0d('0x4'))},'keyContent':{'type':Sequelize[_0xaa0d('0x6')]},'idField':{'type':Sequelize[_0xaa0d('0x6')]},'variableName':{'type':Sequelize[_0xaa0d('0x6')]}};
\ No newline at end of file
+var _0x9e3c=['string','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x10e6cb,_0x3b7d6d){var _0x366584=function(_0x4d0a0d){while(--_0x4d0a0d){_0x10e6cb['push'](_0x10e6cb['shift']());}};_0x366584(++_0x3b7d6d);}(_0x9e3c,0x11c));var _0xc9e3=function(_0xdc3756,_0x12752e){_0xdc3756=_0xdc3756-0x0;var _0x3047ec=_0x9e3c[_0xdc3756];return _0x3047ec;};'use strict';var Sequelize=require(_0xc9e3('0x0'));module[_0xc9e3('0x1')]={'type':{'type':Sequelize[_0xc9e3('0x2')](_0xc9e3('0x3'),'variable',_0xc9e3('0x4'),_0xc9e3('0x5')),'defaultValue':_0xc9e3('0x3')},'content':{'type':Sequelize[_0xc9e3('0x6')]},'key':{'type':Sequelize[_0xc9e3('0x6')]},'keyType':{'type':Sequelize[_0xc9e3('0x2')](_0xc9e3('0x3'),'variable',_0xc9e3('0x4'))},'keyContent':{'type':Sequelize[_0xc9e3('0x6')]},'idField':{'type':Sequelize[_0xc9e3('0x6')]},'variableName':{'type':Sequelize[_0xc9e3('0x6')]}};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js
index 2fdca05..5a2b6c9 100644
--- a/server/api/intSalesforceField/intSalesforceField.controller.js
+++ b/server/api/intSalesforceField/intSalesforceField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b8f=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','SalesforceField','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xbc32a1,_0x1d698b){var _0x1787cb=function(_0x315c4c){while(--_0x315c4c){_0xbc32a1['push'](_0xbc32a1['shift']());}};_0x1787cb(++_0x1d698b);}(_0x4b8f,0x168));var _0xf4b8=function(_0x1258a1,_0x44ec6b){_0x1258a1=_0x1258a1-0x0;var _0x280307=_0x4b8f[_0x1258a1];return _0x280307;};'use strict';var pdf=require(_0xf4b8('0x0'));var emlformat=require(_0xf4b8('0x1'));var rimraf=require(_0xf4b8('0x2'));var zipdir=require(_0xf4b8('0x3'));var jsonpatch=require(_0xf4b8('0x4'));var rp=require(_0xf4b8('0x5'));var moment=require(_0xf4b8('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf4b8('0x7'));var util=require(_0xf4b8('0x8'));var path=require(_0xf4b8('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf4b8('0xa'));var fs=require('fs');var _=require(_0xf4b8('0xb'));var squel=require('squel');var crypto=require(_0xf4b8('0xc'));var jsforce=require(_0xf4b8('0xd'));var deskjs=require(_0xf4b8('0xe'));var toCsv=require(_0xf4b8('0xf'));var querystring=require(_0xf4b8('0x10'));var Papa=require(_0xf4b8('0x11'));var Redis=require(_0xf4b8('0x12'));var authService=require(_0xf4b8('0x13'));var qs=require(_0xf4b8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4b8('0x15'))(_0xf4b8('0x16'));var utils=require(_0xf4b8('0x17'));var config=require(_0xf4b8('0x18'));var db=require(_0xf4b8('0x19'))['db'];function respondWithStatusCode(_0x431513,_0x5d4429){_0x5d4429=_0x5d4429||0xcc;return function(_0x25572b){if(_0x25572b){return _0x431513[_0xf4b8('0x1a')](_0x5d4429);}return _0x431513[_0xf4b8('0x1b')](_0x5d4429)['end']();};}function respondWithResult(_0x54aa28,_0x505b2a){_0x505b2a=_0x505b2a||0xc8;return function(_0x1d28ac){if(_0x1d28ac){return _0x54aa28[_0xf4b8('0x1b')](_0x505b2a)[_0xf4b8('0x1c')](_0x1d28ac);}};}function respondWithFilteredResult(_0x2c9079,_0x58c258){return function(_0x2d1d77){if(_0x2d1d77){var _0x7c6b14=_0x2d1d77[_0xf4b8('0x1d')],_0x5878ff=_0x58c258[_0xf4b8('0x1e')],_0x2547a6=_0x58c258[_0xf4b8('0x1e')]+_0x58c258['limit'],_0xd67e2b;if(_0x2547a6>=_0x7c6b14){_0x2547a6=_0x7c6b14;_0xd67e2b=0xc8;}else{_0xd67e2b=0xce;}_0x2c9079['status'](_0xd67e2b);return _0x2c9079[_0xf4b8('0x1f')](_0xf4b8('0x20'),_0x5878ff+'-'+_0x2547a6+'/'+_0x7c6b14)[_0xf4b8('0x1c')](_0x2d1d77);}return null;};}function patchUpdates(_0x4a363f){return function(_0x8576b6){try{jsonpatch[_0xf4b8('0x21')](_0x8576b6,_0x4a363f,!![]);}catch(_0x27dc78){return BPromise[_0xf4b8('0x22')](_0x27dc78);}return _0x8576b6[_0xf4b8('0x23')]();};}function saveUpdates(_0x813caf,_0x467172){return function(_0x828730){if(_0x828730){return _0x828730[_0xf4b8('0x24')](_0x813caf)[_0xf4b8('0x25')](function(_0x558f55){return _0x558f55;});}return null;};}function removeEntity(_0x1259c6,_0x2cbde8){return function(_0x310e){if(_0x310e){return _0x310e[_0xf4b8('0x26')]()[_0xf4b8('0x25')](function(){_0x1259c6['status'](0xcc)[_0xf4b8('0x27')]();});}};}function handleEntityNotFound(_0x3e2986,_0x593169){return function(_0x349206){if(!_0x349206){_0x3e2986[_0xf4b8('0x1a')](0x194);}return _0x349206;};}function handleError(_0x20777c,_0x34b512){_0x34b512=_0x34b512||0x1f4;return function(_0x54ac96){logger['error'](_0x54ac96['stack']);if(_0x54ac96[_0xf4b8('0x28')]){delete _0x54ac96[_0xf4b8('0x28')];}_0x20777c[_0xf4b8('0x1b')](_0x34b512)[_0xf4b8('0x29')](_0x54ac96);};}exports['index']=function(_0x40ceef,_0x41e486){var _0x24cc21={},_0x268361={},_0x3fbfbb={'count':0x0,'rows':[]};var _0x2e2587=db[_0xf4b8('0x2a')][_0xf4b8('0x2b')];_0x268361[_0xf4b8('0x2c')]=_['keys'](_0x2e2587);_0x268361[_0xf4b8('0x2d')]=_['keys'](_0x40ceef['query']);_0x268361[_0xf4b8('0x2e')]=_[_0xf4b8('0x2f')](_0x268361[_0xf4b8('0x2c')],_0x268361[_0xf4b8('0x2d')]);_0x24cc21[_0xf4b8('0x30')]=_[_0xf4b8('0x2f')](_0x268361[_0xf4b8('0x2c')],qs[_0xf4b8('0x31')](_0x40ceef[_0xf4b8('0x2d')][_0xf4b8('0x31')]));_0x24cc21[_0xf4b8('0x30')]=_0x24cc21[_0xf4b8('0x30')][_0xf4b8('0x32')]?_0x24cc21[_0xf4b8('0x30')]:_0x268361['model'];if(!_0x40ceef[_0xf4b8('0x2d')][_0xf4b8('0x33')]('nolimit')){_0x24cc21['limit']=qs[_0xf4b8('0x34')](_0x40ceef['query'][_0xf4b8('0x34')]);_0x24cc21[_0xf4b8('0x1e')]=qs['offset'](_0x40ceef[_0xf4b8('0x2d')][_0xf4b8('0x1e')]);}_0x24cc21[_0xf4b8('0x35')]=qs[_0xf4b8('0x36')](_0x40ceef['query'][_0xf4b8('0x36')]);_0x24cc21['where']=qs[_0xf4b8('0x2e')](_[_0xf4b8('0x37')](_0x40ceef[_0xf4b8('0x2d')],_0x268361[_0xf4b8('0x2e')]));if(_0x40ceef[_0xf4b8('0x2d')]['filter']){_0x24cc21[_0xf4b8('0x38')]=_[_0xf4b8('0x39')](_0x24cc21[_0xf4b8('0x38')],{'$or':_[_0xf4b8('0x3a')](_0x2e2587,function(_0x159e70){if(_0x159e70[_0xf4b8('0x3b')][_0xf4b8('0x3c')]!==_0xf4b8('0x3d')){var _0x6328a9={};_0x6328a9[_0x159e70[_0xf4b8('0x3e')]]={'$like':'%'+_0x40ceef[_0xf4b8('0x2d')][_0xf4b8('0x3f')]+'%'};return _0x6328a9;}})});}_0x24cc21=_['merge']({},_0x24cc21,_0x40ceef[_0xf4b8('0x40')]);var _0x47e0ac={'where':_0x24cc21[_0xf4b8('0x38')]};return db[_0xf4b8('0x2a')][_0xf4b8('0x1d')](_0x47e0ac)['then'](function(_0x2a49ac){_0x3fbfbb[_0xf4b8('0x1d')]=_0x2a49ac;if(_0x40ceef['query'][_0xf4b8('0x41')]){_0x24cc21[_0xf4b8('0x42')]=[{'all':!![]}];}return db[_0xf4b8('0x2a')][_0xf4b8('0x43')](_0x24cc21);})[_0xf4b8('0x25')](function(_0x3e660c){_0x3fbfbb[_0xf4b8('0x44')]=_0x3e660c;return _0x3fbfbb;})[_0xf4b8('0x25')](respondWithFilteredResult(_0x41e486,_0x24cc21))[_0xf4b8('0x45')](handleError(_0x41e486,null));};exports[_0xf4b8('0x46')]=function(_0x380b87,_0xa5b908){var _0x56e68e={'raw':!![],'where':{'id':_0x380b87[_0xf4b8('0x47')]['id']}},_0x4b2793={};_0x4b2793[_0xf4b8('0x2c')]=_['keys'](db['SalesforceField'][_0xf4b8('0x2b')]);_0x4b2793[_0xf4b8('0x2d')]=_[_0xf4b8('0x48')](_0x380b87[_0xf4b8('0x2d')]);_0x4b2793[_0xf4b8('0x2e')]=_[_0xf4b8('0x2f')](_0x4b2793[_0xf4b8('0x2c')],_0x4b2793[_0xf4b8('0x2d')]);_0x56e68e[_0xf4b8('0x30')]=_[_0xf4b8('0x2f')](_0x4b2793[_0xf4b8('0x2c')],qs['fields'](_0x380b87[_0xf4b8('0x2d')][_0xf4b8('0x31')]));_0x56e68e[_0xf4b8('0x30')]=_0x56e68e[_0xf4b8('0x30')][_0xf4b8('0x32')]?_0x56e68e['attributes']:_0x4b2793['model'];if(_0x380b87[_0xf4b8('0x2d')][_0xf4b8('0x41')]){_0x56e68e['include']=[{'all':!![]}];}_0x56e68e=_[_0xf4b8('0x39')]({},_0x56e68e,_0x380b87[_0xf4b8('0x40')]);return db[_0xf4b8('0x2a')][_0xf4b8('0x49')](_0x56e68e)[_0xf4b8('0x25')](handleEntityNotFound(_0xa5b908,null))[_0xf4b8('0x25')](respondWithResult(_0xa5b908,null))[_0xf4b8('0x45')](handleError(_0xa5b908,null));};exports[_0xf4b8('0x4a')]=function(_0x2ce919,_0x500c0e){return db[_0xf4b8('0x2a')][_0xf4b8('0x4a')](_0x2ce919[_0xf4b8('0x4b')],{})['then'](respondWithResult(_0x500c0e,0xc9))[_0xf4b8('0x45')](handleError(_0x500c0e,null));};exports[_0xf4b8('0x24')]=function(_0x223370,_0x3034dd){if(_0x223370[_0xf4b8('0x4b')]['id']){delete _0x223370[_0xf4b8('0x4b')]['id'];}return db[_0xf4b8('0x2a')][_0xf4b8('0x49')]({'where':{'id':_0x223370[_0xf4b8('0x47')]['id']}})[_0xf4b8('0x25')](handleEntityNotFound(_0x3034dd,null))['then'](saveUpdates(_0x223370[_0xf4b8('0x4b')],null))['then'](respondWithResult(_0x3034dd,null))[_0xf4b8('0x45')](handleError(_0x3034dd,null));};exports[_0xf4b8('0x26')]=function(_0x291155,_0x47caa5){return db[_0xf4b8('0x2a')]['find']({'where':{'id':_0x291155['params']['id']}})[_0xf4b8('0x25')](handleEntityNotFound(_0x47caa5,null))[_0xf4b8('0x25')](removeEntity(_0x47caa5,null))['catch'](handleError(_0x47caa5,null));};
\ No newline at end of file
+var _0xbdcd=['length','nolimit','order','sort','filters','filter','where','map','type','key','VIRTUAL','merge','options','include','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','SalesforceField','rawAttributes','keys','query','intersection','model','attributes','fields'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xbdcd,0xdb));var _0xdbdc=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0xbdcd[_0x350182];return _0x4a0892;};'use strict';var pdf=require(_0xdbdc('0x0'));var emlformat=require(_0xdbdc('0x1'));var rimraf=require(_0xdbdc('0x2'));var zipdir=require(_0xdbdc('0x3'));var jsonpatch=require(_0xdbdc('0x4'));var rp=require('request-promise');var moment=require(_0xdbdc('0x5'));var BPromise=require(_0xdbdc('0x6'));var Mustache=require('mustache');var util=require(_0xdbdc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdbdc('0x8'));var ejs=require(_0xdbdc('0x9'));var fs=require('fs');var _=require(_0xdbdc('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdbdc('0xb'));var deskjs=require(_0xdbdc('0xc'));var toCsv=require(_0xdbdc('0x8'));var querystring=require('querystring');var Papa=require(_0xdbdc('0xd'));var Redis=require(_0xdbdc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xdbdc('0xf'));var logger=require(_0xdbdc('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xdbdc('0x11'));var db=require(_0xdbdc('0x12'))['db'];function respondWithStatusCode(_0x1c7d9d,_0x4b1ce0){_0x4b1ce0=_0x4b1ce0||0xcc;return function(_0x268293){if(_0x268293){return _0x1c7d9d['sendStatus'](_0x4b1ce0);}return _0x1c7d9d[_0xdbdc('0x13')](_0x4b1ce0)[_0xdbdc('0x14')]();};}function respondWithResult(_0x412f51,_0x2af997){_0x2af997=_0x2af997||0xc8;return function(_0x1c8c5a){if(_0x1c8c5a){return _0x412f51[_0xdbdc('0x13')](_0x2af997)[_0xdbdc('0x15')](_0x1c8c5a);}};}function respondWithFilteredResult(_0x5c6563,_0x48a146){return function(_0x260d9c){if(_0x260d9c){var _0x191a70=_0x260d9c[_0xdbdc('0x16')],_0x37f29a=_0x48a146['offset'],_0x1e84a0=_0x48a146[_0xdbdc('0x17')]+_0x48a146[_0xdbdc('0x18')],_0x35a576;if(_0x1e84a0>=_0x191a70){_0x1e84a0=_0x191a70;_0x35a576=0xc8;}else{_0x35a576=0xce;}_0x5c6563['status'](_0x35a576);return _0x5c6563['set'](_0xdbdc('0x19'),_0x37f29a+'-'+_0x1e84a0+'/'+_0x191a70)[_0xdbdc('0x15')](_0x260d9c);}return null;};}function patchUpdates(_0x3fe17a){return function(_0x452824){try{jsonpatch[_0xdbdc('0x1a')](_0x452824,_0x3fe17a,!![]);}catch(_0x28a9ae){return BPromise['reject'](_0x28a9ae);}return _0x452824[_0xdbdc('0x1b')]();};}function saveUpdates(_0x4a7d68,_0x355599){return function(_0x58c71f){if(_0x58c71f){return _0x58c71f[_0xdbdc('0x1c')](_0x4a7d68)[_0xdbdc('0x1d')](function(_0x15c20f){return _0x15c20f;});}return null;};}function removeEntity(_0x41feb4,_0x13f915){return function(_0x19d9ce){if(_0x19d9ce){return _0x19d9ce[_0xdbdc('0x1e')]()[_0xdbdc('0x1d')](function(){_0x41feb4[_0xdbdc('0x13')](0xcc)[_0xdbdc('0x14')]();});}};}function handleEntityNotFound(_0x46c52a,_0x1a5516){return function(_0x154c98){if(!_0x154c98){_0x46c52a[_0xdbdc('0x1f')](0x194);}return _0x154c98;};}function handleError(_0x102688,_0x10cbbf){_0x10cbbf=_0x10cbbf||0x1f4;return function(_0x2801ff){logger[_0xdbdc('0x20')](_0x2801ff[_0xdbdc('0x21')]);if(_0x2801ff[_0xdbdc('0x22')]){delete _0x2801ff[_0xdbdc('0x22')];}_0x102688['status'](_0x10cbbf)[_0xdbdc('0x23')](_0x2801ff);};}exports[_0xdbdc('0x24')]=function(_0x3468b6,_0x5507d2){var _0x35c4db={},_0x3d2b9f={},_0x14bfaf={'count':0x0,'rows':[]};var _0x3978f2=db[_0xdbdc('0x25')][_0xdbdc('0x26')];_0x3d2b9f['model']=_[_0xdbdc('0x27')](_0x3978f2);_0x3d2b9f[_0xdbdc('0x28')]=_[_0xdbdc('0x27')](_0x3468b6[_0xdbdc('0x28')]);_0x3d2b9f['filters']=_[_0xdbdc('0x29')](_0x3d2b9f[_0xdbdc('0x2a')],_0x3d2b9f[_0xdbdc('0x28')]);_0x35c4db[_0xdbdc('0x2b')]=_[_0xdbdc('0x29')](_0x3d2b9f[_0xdbdc('0x2a')],qs[_0xdbdc('0x2c')](_0x3468b6[_0xdbdc('0x28')][_0xdbdc('0x2c')]));_0x35c4db['attributes']=_0x35c4db[_0xdbdc('0x2b')][_0xdbdc('0x2d')]?_0x35c4db[_0xdbdc('0x2b')]:_0x3d2b9f['model'];if(!_0x3468b6['query']['hasOwnProperty'](_0xdbdc('0x2e'))){_0x35c4db[_0xdbdc('0x18')]=qs[_0xdbdc('0x18')](_0x3468b6[_0xdbdc('0x28')][_0xdbdc('0x18')]);_0x35c4db[_0xdbdc('0x17')]=qs[_0xdbdc('0x17')](_0x3468b6[_0xdbdc('0x28')][_0xdbdc('0x17')]);}_0x35c4db[_0xdbdc('0x2f')]=qs[_0xdbdc('0x30')](_0x3468b6['query'][_0xdbdc('0x30')]);_0x35c4db['where']=qs[_0xdbdc('0x31')](_['pick'](_0x3468b6[_0xdbdc('0x28')],_0x3d2b9f[_0xdbdc('0x31')]));if(_0x3468b6[_0xdbdc('0x28')][_0xdbdc('0x32')]){_0x35c4db[_0xdbdc('0x33')]=_['merge'](_0x35c4db[_0xdbdc('0x33')],{'$or':_[_0xdbdc('0x34')](_0x3978f2,function(_0x6a8d5a){if(_0x6a8d5a[_0xdbdc('0x35')][_0xdbdc('0x36')]!==_0xdbdc('0x37')){var _0x2233eb={};_0x2233eb[_0x6a8d5a['field']]={'$like':'%'+_0x3468b6[_0xdbdc('0x28')][_0xdbdc('0x32')]+'%'};return _0x2233eb;}})});}_0x35c4db=_[_0xdbdc('0x38')]({},_0x35c4db,_0x3468b6[_0xdbdc('0x39')]);var _0x48522a={'where':_0x35c4db['where']};return db[_0xdbdc('0x25')][_0xdbdc('0x16')](_0x48522a)[_0xdbdc('0x1d')](function(_0x582d33){_0x14bfaf['count']=_0x582d33;if(_0x3468b6['query']['includeAll']){_0x35c4db[_0xdbdc('0x3a')]=[{'all':!![]}];}return db[_0xdbdc('0x25')]['findAll'](_0x35c4db);})[_0xdbdc('0x1d')](function(_0x2bd3b6){_0x14bfaf[_0xdbdc('0x3b')]=_0x2bd3b6;return _0x14bfaf;})['then'](respondWithFilteredResult(_0x5507d2,_0x35c4db))[_0xdbdc('0x3c')](handleError(_0x5507d2,null));};exports[_0xdbdc('0x3d')]=function(_0x84060d,_0x3ea4be){var _0x3318af={'raw':!![],'where':{'id':_0x84060d[_0xdbdc('0x3e')]['id']}},_0xc57b7={};_0xc57b7['model']=_[_0xdbdc('0x27')](db['SalesforceField'][_0xdbdc('0x26')]);_0xc57b7[_0xdbdc('0x28')]=_[_0xdbdc('0x27')](_0x84060d[_0xdbdc('0x28')]);_0xc57b7[_0xdbdc('0x31')]=_[_0xdbdc('0x29')](_0xc57b7[_0xdbdc('0x2a')],_0xc57b7[_0xdbdc('0x28')]);_0x3318af['attributes']=_['intersection'](_0xc57b7[_0xdbdc('0x2a')],qs[_0xdbdc('0x2c')](_0x84060d[_0xdbdc('0x28')][_0xdbdc('0x2c')]));_0x3318af[_0xdbdc('0x2b')]=_0x3318af[_0xdbdc('0x2b')][_0xdbdc('0x2d')]?_0x3318af[_0xdbdc('0x2b')]:_0xc57b7[_0xdbdc('0x2a')];if(_0x84060d['query']['includeAll']){_0x3318af[_0xdbdc('0x3a')]=[{'all':!![]}];}_0x3318af=_[_0xdbdc('0x38')]({},_0x3318af,_0x84060d[_0xdbdc('0x39')]);return db[_0xdbdc('0x25')][_0xdbdc('0x3f')](_0x3318af)[_0xdbdc('0x1d')](handleEntityNotFound(_0x3ea4be,null))[_0xdbdc('0x1d')](respondWithResult(_0x3ea4be,null))[_0xdbdc('0x3c')](handleError(_0x3ea4be,null));};exports['create']=function(_0x5b6aff,_0x537d58){return db[_0xdbdc('0x25')][_0xdbdc('0x40')](_0x5b6aff[_0xdbdc('0x41')],{})[_0xdbdc('0x1d')](respondWithResult(_0x537d58,0xc9))[_0xdbdc('0x3c')](handleError(_0x537d58,null));};exports['update']=function(_0x30c6ca,_0x529df0){if(_0x30c6ca[_0xdbdc('0x41')]['id']){delete _0x30c6ca[_0xdbdc('0x41')]['id'];}return db[_0xdbdc('0x25')][_0xdbdc('0x3f')]({'where':{'id':_0x30c6ca[_0xdbdc('0x3e')]['id']}})[_0xdbdc('0x1d')](handleEntityNotFound(_0x529df0,null))['then'](saveUpdates(_0x30c6ca[_0xdbdc('0x41')],null))[_0xdbdc('0x1d')](respondWithResult(_0x529df0,null))[_0xdbdc('0x3c')](handleError(_0x529df0,null));};exports[_0xdbdc('0x1e')]=function(_0xa0c50e,_0x5875f7){return db['SalesforceField'][_0xdbdc('0x3f')]({'where':{'id':_0xa0c50e[_0xdbdc('0x3e')]['id']}})[_0xdbdc('0x1d')](handleEntityNotFound(_0x5875f7,null))[_0xdbdc('0x1d')](removeEntity(_0x5875f7,null))[_0xdbdc('0x3c')](handleError(_0x5875f7,null));};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js
index af2abba..7e395ec 100644
--- a/server/api/intSalesforceField/intSalesforceField.model.js
+++ b/server/api/intSalesforceField/intSalesforceField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0e14=['salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SalesforceField','int_salesforce_fields'];(function(_0x3ceac4,_0xf57186){var _0x9e4fe8=function(_0x439e4f){while(--_0x439e4f){_0x3ceac4['push'](_0x3ceac4['shift']());}};_0x9e4fe8(++_0xf57186);}(_0x0e14,0x113));var _0x40e1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0e14[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x40e1('0x0'));var util=require(_0x40e1('0x1'));var logger=require(_0x40e1('0x2'))(_0x40e1('0x3'));var moment=require(_0x40e1('0x4'));var BPromise=require(_0x40e1('0x5'));var rp=require(_0x40e1('0x6'));var fs=require('fs');var path=require(_0x40e1('0x7'));var rimraf=require(_0x40e1('0x8'));var config=require(_0x40e1('0x9'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x53ec52,_0x10316a){return _0x53ec52[_0x40e1('0xa')](_0x40e1('0xb'),attributes,{'tableName':_0x40e1('0xc'),'paranoid':![],'indexes':[{'name':_0x40e1('0xd'),'fields':[_0x40e1('0xe'),_0x40e1('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d8d=['moment','bluebird','path','rimraf','../../config/environment','exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0x24639e,_0x2069ee){var _0x12a9f5=function(_0x151831){while(--_0x151831){_0x24639e['push'](_0x24639e['shift']());}};_0x12a9f5(++_0x2069ee);}(_0x1d8d,0x131));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd1d8('0x0'));var logger=require(_0xd1d8('0x1'))(_0xd1d8('0x2'));var moment=require(_0xd1d8('0x3'));var BPromise=require(_0xd1d8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd1d8('0x5'));var rimraf=require(_0xd1d8('0x6'));var config=require(_0xd1d8('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0xd1d8('0x8')]=function(_0x17500c,_0x2ca21c){return _0x17500c[_0xd1d8('0x9')]('SalesforceField',attributes,{'tableName':_0xd1d8('0xa'),'paranoid':![],'indexes':[{'name':_0xd1d8('0xb'),'fields':[_0xd1d8('0xc'),_0xd1d8('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js
index f74018c..8cb96fa 100644
--- a/server/api/intSalesforceField/intSalesforceField.rpc.js
+++ b/server/api/intSalesforceField/intSalesforceField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b41=['info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x30ed3c,_0x516d8f){var _0x3fbb53=function(_0x461935){while(--_0x461935){_0x30ed3c['push'](_0x30ed3c['shift']());}};_0x3fbb53(++_0x516d8f);}(_0x1b41,0x1ba));var _0x11b4=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x1b41[_0x401676];return _0x4f13fe;};'use strict';var _=require(_0x11b4('0x0'));var util=require(_0x11b4('0x1'));var moment=require(_0x11b4('0x2'));var BPromise=require(_0x11b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11b4('0x4'));var db=require(_0x11b4('0x5'))['db'];var utils=require(_0x11b4('0x6'));var logger=require(_0x11b4('0x7'))(_0x11b4('0x8'));var config=require('../../config/environment');var jayson=require(_0x11b4('0x9'));var client=jayson[_0x11b4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf591da,_0x565258,_0x1abffc){return new BPromise(function(_0x5d3bd3,_0xaf91a4){return client[_0x11b4('0xb')](_0xf591da,_0x1abffc)['then'](function(_0x5714a3){logger['info'](_0x11b4('0xc'),_0x565258,'request\x20sent');logger[_0x11b4('0xd')](_0x11b4('0xe'),_0x565258,_0x11b4('0xf'),JSON[_0x11b4('0x10')](_0x5714a3));if(_0x5714a3[_0x11b4('0x11')]){if(_0x5714a3[_0x11b4('0x11')][_0x11b4('0x12')]===0x1f4){logger[_0x11b4('0x11')](_0x11b4('0xc'),_0x565258,_0x5714a3['error'][_0x11b4('0x13')]);return _0xaf91a4(_0x5714a3[_0x11b4('0x11')][_0x11b4('0x13')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x565258,_0x5714a3[_0x11b4('0x11')][_0x11b4('0x13')]);return _0x5d3bd3(_0x5714a3[_0x11b4('0x11')]['message']);}else{logger[_0x11b4('0x14')]('SalesforceField,\x20%s,\x20%s',_0x565258,_0x11b4('0xf'));_0x5d3bd3(_0x5714a3[_0x11b4('0x15')][_0x11b4('0x13')]);}})['catch'](function(_0x40f9c6){logger['error'](_0x11b4('0xc'),_0x565258,_0x40f9c6);_0xaf91a4(_0x40f9c6);});});}
\ No newline at end of file
+var _0xa6d1=['debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','SalesforceField,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent'];(function(_0x31d231,_0x962378){var _0x3827c8=function(_0x2ffe99){while(--_0x2ffe99){_0x31d231['push'](_0x31d231['shift']());}};_0x3827c8(++_0x962378);}(_0xa6d1,0x195));var _0x1a6d=function(_0x4c29e4,_0x5dc161){_0x4c29e4=_0x4c29e4-0x0;var _0x18206b=_0xa6d1[_0x4c29e4];return _0x18206b;};'use strict';var _=require('lodash');var util=require(_0x1a6d('0x0'));var moment=require(_0x1a6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a6d('0x2'));var fs=require('fs');var Redis=require(_0x1a6d('0x3'));var db=require(_0x1a6d('0x4'))['db'];var utils=require(_0x1a6d('0x5'));var logger=require(_0x1a6d('0x6'))(_0x1a6d('0x7'));var config=require(_0x1a6d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1a6d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35eb1e,_0x21b13c,_0x2a3a10){return new BPromise(function(_0x561a6e,_0x2cdf69){return client[_0x1a6d('0xa')](_0x35eb1e,_0x2a3a10)['then'](function(_0x3a1172){logger[_0x1a6d('0xb')]('SalesforceField,\x20%s,\x20%s',_0x21b13c,_0x1a6d('0xc'));logger[_0x1a6d('0xd')](_0x1a6d('0xe'),_0x21b13c,'request\x20sent',JSON[_0x1a6d('0xf')](_0x3a1172));if(_0x3a1172['error']){if(_0x3a1172['error'][_0x1a6d('0x10')]===0x1f4){logger[_0x1a6d('0x11')]('SalesforceField,\x20%s,\x20%s',_0x21b13c,_0x3a1172['error'][_0x1a6d('0x12')]);return _0x2cdf69(_0x3a1172[_0x1a6d('0x11')][_0x1a6d('0x12')]);}logger[_0x1a6d('0x11')](_0x1a6d('0x13'),_0x21b13c,_0x3a1172[_0x1a6d('0x11')][_0x1a6d('0x12')]);return _0x561a6e(_0x3a1172[_0x1a6d('0x11')][_0x1a6d('0x12')]);}else{logger['info'](_0x1a6d('0x13'),_0x21b13c,_0x1a6d('0xc'));_0x561a6e(_0x3a1172[_0x1a6d('0x14')]['message']);}})[_0x1a6d('0x15')](function(_0x52a091){logger['error'](_0x1a6d('0x13'),_0x21b13c,_0x52a091);_0x2cdf69(_0x52a091);});});}
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js
index ac550c2..03916cc 100644
--- a/server/api/intServicenowAccount/index.js
+++ b/server/api/intServicenowAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf003=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration'];(function(_0x37f906,_0x3ae89f){var _0x529bbe=function(_0x317c56){while(--_0x317c56){_0x37f906['push'](_0x37f906['shift']());}};_0x529bbe(++_0x3ae89f);}(_0xf003,0x1b4));var _0x3f00=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0xf003[_0x218972];return _0x1bb1a8;};'use strict';var multer=require(_0x3f00('0x0'));var util=require(_0x3f00('0x1'));var path=require(_0x3f00('0x2'));var timeout=require(_0x3f00('0x3'));var express=require(_0x3f00('0x4'));var router=express[_0x3f00('0x5')]();var auth=require(_0x3f00('0x6'));var interaction=require(_0x3f00('0x7'));var config=require(_0x3f00('0x8'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x3f00('0x9')](),controller[_0x3f00('0xa')]);router[_0x3f00('0xb')](_0x3f00('0xc'),auth['isAuthenticated'](),controller[_0x3f00('0xd')]);router['get'](_0x3f00('0xe'),auth['isAuthenticated'](),controller[_0x3f00('0xf')]);router[_0x3f00('0xb')](_0x3f00('0x10'),auth['isAuthenticated'](),controller[_0x3f00('0x11')]);router[_0x3f00('0x12')]('/',auth[_0x3f00('0x9')](),controller['create']);router['post'](_0x3f00('0xe'),auth[_0x3f00('0x9')](),controller[_0x3f00('0x13')]);router[_0x3f00('0x14')](_0x3f00('0xc'),auth[_0x3f00('0x9')](),controller[_0x3f00('0x15')]);router['delete'](_0x3f00('0xc'),auth[_0x3f00('0x9')](),controller[_0x3f00('0x16')]);module[_0x3f00('0x17')]=router;
\ No newline at end of file
+var _0x2acc=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x30f910,_0x8e3a23){var _0x836515=function(_0x1742eb){while(--_0x1742eb){_0x30f910['push'](_0x30f910['shift']());}};_0x836515(++_0x8e3a23);}(_0x2acc,0x15b));var _0xc2ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2acc[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc2ac('0x0'));var util=require(_0xc2ac('0x1'));var path=require('path');var timeout=require(_0xc2ac('0x2'));var express=require(_0xc2ac('0x3'));var router=express[_0xc2ac('0x4')]();var auth=require(_0xc2ac('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc2ac('0x6'));var controller=require(_0xc2ac('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc2ac('0x8')]);router[_0xc2ac('0x9')](_0xc2ac('0xa'),auth[_0xc2ac('0xb')](),controller[_0xc2ac('0xc')]);router['get'](_0xc2ac('0xd'),auth[_0xc2ac('0xb')](),controller[_0xc2ac('0xe')]);router[_0xc2ac('0x9')](_0xc2ac('0xf'),auth['isAuthenticated'](),controller[_0xc2ac('0x10')]);router[_0xc2ac('0x11')]('/',auth[_0xc2ac('0xb')](),controller[_0xc2ac('0x12')]);router[_0xc2ac('0x11')](_0xc2ac('0xd'),auth[_0xc2ac('0xb')](),controller[_0xc2ac('0x13')]);router[_0xc2ac('0x14')](_0xc2ac('0xa'),auth[_0xc2ac('0xb')](),controller['update']);router['delete'](_0xc2ac('0xa'),auth[_0xc2ac('0xb')](),controller[_0xc2ac('0x15')]);module[_0xc2ac('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js
index 7dea53f..d248862 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.attributes.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbee3=['remoteUri','exports','STRING','username'];(function(_0x2f9bc9,_0x44bfea){var _0x2bf5a1=function(_0x546cb3){while(--_0x546cb3){_0x2f9bc9['push'](_0x2f9bc9['shift']());}};_0x2bf5a1(++_0x44bfea);}(_0xbee3,0xd5));var _0x3bee=function(_0x3e4a34,_0x452723){_0x3e4a34=_0x3e4a34-0x0;var _0x2d2d2e=_0xbee3[_0x3e4a34];return _0x2d2d2e;};'use strict';var Sequelize=require('sequelize');module[_0x3bee('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3bee('0x1')],'unique':_0x3bee('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3bee('0x1')]},'remoteUri':{'type':Sequelize[_0x3bee('0x1')],'unique':_0x3bee('0x3')},'serverUrl':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf72b=['remoteUri','sequelize','STRING','username'];(function(_0x1557ae,_0x7dbdeb){var _0x4c9840=function(_0x25f683){while(--_0x25f683){_0x1557ae['push'](_0x1557ae['shift']());}};_0x4c9840(++_0x7dbdeb);}(_0xf72b,0x1d9));var _0xbf72=function(_0x3d86bb,_0x3d97cb){_0x3d86bb=_0x3d86bb-0x0;var _0x324dac=_0xf72b[_0x3d86bb];return _0x324dac;};'use strict';var Sequelize=require(_0xbf72('0x0'));module['exports']={'name':{'type':Sequelize[_0xbf72('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xbf72('0x1')],'unique':_0xbf72('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xbf72('0x1')]},'remoteUri':{'type':Sequelize[_0xbf72('0x1')],'unique':_0xbf72('0x3')},'serverUrl':{'type':Sequelize[_0xbf72('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js
index 1a04ed9..3323a1d 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.controller.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x362e=['channel','Descriptions','Subjects','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','order','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','problem_id','assigned_to','comments','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','test','statusCode','Wrong\x20credentials','boolean','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','count','offset','limit','Content-Range','apply','reject','save','update','stack','name','send','index','ServicenowAccount','rawAttributes','keys','query','filters','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','getConfigurations','ServicenowConfiguration','nolimit','addConfiguration','findOne','AccountId','getSubjects'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x362e,0x1e6));var _0xe362=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x362e[_0x373dee];return _0x46798f;};'use strict';var pdf=require(_0xe362('0x0'));var emlformat=require(_0xe362('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe362('0x2'));var jsonpatch=require(_0xe362('0x3'));var rp=require('request-promise');var moment=require(_0xe362('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe362('0x5'));var path=require('path');var sox=require(_0xe362('0x6'));var csv=require(_0xe362('0x7'));var ejs=require(_0xe362('0x8'));var fs=require('fs');var _=require(_0xe362('0x9'));var squel=require(_0xe362('0xa'));var crypto=require(_0xe362('0xb'));var jsforce=require(_0xe362('0xc'));var deskjs=require(_0xe362('0xd'));var toCsv=require(_0xe362('0x7'));var querystring=require(_0xe362('0xe'));var Papa=require('papaparse');var Redis=require(_0xe362('0xf'));var authService=require(_0xe362('0x10'));var qs=require(_0xe362('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe362('0x12'))('api');var utils=require(_0xe362('0x13'));var config=require(_0xe362('0x14'));var db=require(_0xe362('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xe362('0x16'));var client=jayson[_0xe362('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x2b7837,_0xce87c0,_0x513268){if(_0x513268){var _0x182d92=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x182d92['test'](_0xce87c0)){return _0x2b7837;}else{throw new Error(_0xe362('0x18'));}}else{return _0x2b7837;}}function respondWithRpcPromise(_0x271059,_0x10b7da,_0x6d3bdc,_0x1f8a88){return new BPromise(function(_0x456dbf,_0x5db958){var _0x235385=_0x1f8a88||client;return _0x235385['request'](_0x271059,_0x6d3bdc)[_0xe362('0x19')](function(_0x132155){logger[_0xe362('0x1a')](_0xe362('0x1b'),_0x10b7da,_0xe362('0x1c'));logger[_0xe362('0x1d')](_0xe362('0x1e'),_0x10b7da,_0xe362('0x1c'),JSON[_0xe362('0x1f')](_0x132155));if(_0x132155[_0xe362('0x20')]){if(_0x132155['error'][_0xe362('0x21')]===0x1f4){logger[_0xe362('0x20')](_0xe362('0x1b'),_0x10b7da,_0x132155['error']['message']);return _0x5db958(_0x132155[_0xe362('0x20')][_0xe362('0x22')]);}logger[_0xe362('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x10b7da,_0x132155['error'][_0xe362('0x22')]);return _0x456dbf(_0x132155['error']['message']);}else{logger[_0xe362('0x1a')](_0xe362('0x1b'),_0x10b7da,_0xe362('0x1c'));_0x456dbf(_0x132155[_0xe362('0x23')][_0xe362('0x22')]);}})['catch'](function(_0x2a7771){logger[_0xe362('0x20')](_0xe362('0x1b'),_0x10b7da,_0x2a7771);_0x5db958(_0x2a7771);});});}function respondWithStatusCode(_0x38ecc6,_0x186fdb){_0x186fdb=_0x186fdb||0xcc;return function(_0x4dfcb6){if(_0x4dfcb6){return _0x38ecc6['sendStatus'](_0x186fdb);}return _0x38ecc6[_0xe362('0x24')](_0x186fdb)['end']();};}function respondWithResult(_0x517eb0,_0x57dde5){_0x57dde5=_0x57dde5||0xc8;return function(_0xc50baa){if(_0xc50baa){return _0x517eb0[_0xe362('0x24')](_0x57dde5)['json'](_0xc50baa);}};}function respondWithFilteredResult(_0x518c9d,_0x556df5){return function(_0x2e0554){if(_0x2e0554){var _0x55b2eb=_0x2e0554[_0xe362('0x25')],_0x3e5f05=_0x556df5[_0xe362('0x26')],_0x89f160=_0x556df5['offset']+_0x556df5[_0xe362('0x27')],_0x3c218a;if(_0x89f160>=_0x55b2eb){_0x89f160=_0x55b2eb;_0x3c218a=0xc8;}else{_0x3c218a=0xce;}_0x518c9d[_0xe362('0x24')](_0x3c218a);return _0x518c9d['set'](_0xe362('0x28'),_0x3e5f05+'-'+_0x89f160+'/'+_0x55b2eb)['json'](_0x2e0554);}return null;};}function patchUpdates(_0x3d28a8){return function(_0x280516){try{jsonpatch[_0xe362('0x29')](_0x280516,_0x3d28a8,!![]);}catch(_0x132c48){return BPromise[_0xe362('0x2a')](_0x132c48);}return _0x280516[_0xe362('0x2b')]();};}function saveUpdates(_0x520bc3,_0x2ace7a){return function(_0x71f953){if(_0x71f953){return _0x71f953[_0xe362('0x2c')](_0x520bc3)['then'](function(_0x2198f7){return _0x2198f7;});}return null;};}function removeEntity(_0xfee47d,_0x425c94){return function(_0x36fd6f){if(_0x36fd6f){return _0x36fd6f['destroy']()[_0xe362('0x19')](function(){_0xfee47d[_0xe362('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7efc,_0x2a9b20){return function(_0x1879cf){if(!_0x1879cf){_0x2c7efc['sendStatus'](0x194);}return _0x1879cf;};}function handleError(_0x581bb7,_0x770d26){_0x770d26=_0x770d26||0x1f4;return function(_0x2aaabf){logger[_0xe362('0x20')](_0x2aaabf[_0xe362('0x2d')]);if(_0x2aaabf['name']){delete _0x2aaabf[_0xe362('0x2e')];}_0x581bb7[_0xe362('0x24')](_0x770d26)[_0xe362('0x2f')](_0x2aaabf);};}exports[_0xe362('0x30')]=function(_0x19b8d0,_0x58546a){var _0x16afb5={},_0x7a7aa2={},_0x553c06={'count':0x0,'rows':[]};var _0x28a205=db[_0xe362('0x31')][_0xe362('0x32')];_0x7a7aa2['model']=_[_0xe362('0x33')](_0x28a205);_0x7a7aa2['query']=_[_0xe362('0x33')](_0x19b8d0[_0xe362('0x34')]);_0x7a7aa2[_0xe362('0x35')]=_['intersection'](_0x7a7aa2[_0xe362('0x36')],_0x7a7aa2[_0xe362('0x34')]);_0x16afb5[_0xe362('0x37')]=_['intersection'](_0x7a7aa2[_0xe362('0x36')],qs['fields'](_0x19b8d0['query'][_0xe362('0x38')]));_0x16afb5['attributes']=_0x16afb5['attributes'][_0xe362('0x39')]?_0x16afb5['attributes']:_0x7a7aa2[_0xe362('0x36')];if(!_0x19b8d0[_0xe362('0x34')][_0xe362('0x3a')]('nolimit')){_0x16afb5['limit']=qs[_0xe362('0x27')](_0x19b8d0[_0xe362('0x34')]['limit']);_0x16afb5[_0xe362('0x26')]=qs['offset'](_0x19b8d0[_0xe362('0x34')][_0xe362('0x26')]);}_0x16afb5['order']=qs[_0xe362('0x3b')](_0x19b8d0['query'][_0xe362('0x3b')]);_0x16afb5['where']=qs['filters'](_[_0xe362('0x3c')](_0x19b8d0[_0xe362('0x34')],_0x7a7aa2[_0xe362('0x35')]));if(_0x19b8d0['query'][_0xe362('0x3d')]){_0x16afb5[_0xe362('0x3e')]=_['merge'](_0x16afb5[_0xe362('0x3e')],{'$or':_[_0xe362('0x3f')](_0x28a205,function(_0x3d886d){if(_0x3d886d[_0xe362('0x40')][_0xe362('0x41')]!==_0xe362('0x42')){var _0x40791f={};_0x40791f[_0x3d886d[_0xe362('0x43')]]={'$like':'%'+_0x19b8d0['query'][_0xe362('0x3d')]+'%'};return _0x40791f;}})});}_0x16afb5=_[_0xe362('0x44')]({},_0x16afb5,_0x19b8d0[_0xe362('0x45')]);var _0x3fdbc4={'where':_0x16afb5[_0xe362('0x3e')]};return db[_0xe362('0x31')][_0xe362('0x25')](_0x3fdbc4)[_0xe362('0x19')](function(_0x3bf151){_0x553c06[_0xe362('0x25')]=_0x3bf151;if(_0x19b8d0['query'][_0xe362('0x46')]){_0x16afb5[_0xe362('0x47')]=[{'all':!![]}];}return db[_0xe362('0x31')][_0xe362('0x48')](_0x16afb5);})[_0xe362('0x19')](function(_0x30458c){_0x553c06[_0xe362('0x49')]=_0x30458c;return _0x553c06;})[_0xe362('0x19')](respondWithFilteredResult(_0x58546a,_0x16afb5))[_0xe362('0x4a')](handleError(_0x58546a,null));};exports['show']=function(_0x27aa7c,_0x4a0ac0){var _0x15ecbf={'raw':![],'where':{'id':_0x27aa7c[_0xe362('0x4b')]['id']}},_0x31333c={};_0x31333c[_0xe362('0x36')]=_[_0xe362('0x33')](db[_0xe362('0x31')][_0xe362('0x32')]);_0x31333c[_0xe362('0x34')]=_[_0xe362('0x33')](_0x27aa7c[_0xe362('0x34')]);_0x31333c[_0xe362('0x35')]=_['intersection'](_0x31333c[_0xe362('0x36')],_0x31333c[_0xe362('0x34')]);_0x15ecbf['attributes']=_[_0xe362('0x4c')](_0x31333c['model'],qs[_0xe362('0x38')](_0x27aa7c['query'][_0xe362('0x38')]));_0x15ecbf[_0xe362('0x37')]=_0x15ecbf[_0xe362('0x37')]['length']?_0x15ecbf['attributes']:_0x31333c[_0xe362('0x36')];if(_0x27aa7c[_0xe362('0x34')][_0xe362('0x46')]){_0x15ecbf[_0xe362('0x47')]=[{'all':!![]}];}_0x15ecbf=_[_0xe362('0x44')]({},_0x15ecbf,_0x27aa7c['options']);return db[_0xe362('0x31')][_0xe362('0x4d')](_0x15ecbf)['then'](handleEntityNotFound(_0x4a0ac0,null))[_0xe362('0x19')](respondWithResult(_0x4a0ac0,null))['catch'](handleError(_0x4a0ac0,null));};exports[_0xe362('0x4e')]=function(_0x183ecb,_0x3960cb){return db[_0xe362('0x31')][_0xe362('0x4e')](_0x183ecb[_0xe362('0x4f')],{})[_0xe362('0x19')](respondWithResult(_0x3960cb,0xc9))[_0xe362('0x4a')](handleError(_0x3960cb,null));};exports[_0xe362('0x2c')]=function(_0x3eed26,_0x2a3c65){if(_0x3eed26[_0xe362('0x4f')]['id']){delete _0x3eed26[_0xe362('0x4f')]['id'];}return db[_0xe362('0x31')]['find']({'where':{'id':_0x3eed26[_0xe362('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a3c65,null))[_0xe362('0x19')](saveUpdates(_0x3eed26['body'],null))[_0xe362('0x19')](respondWithResult(_0x2a3c65,null))[_0xe362('0x4a')](handleError(_0x2a3c65,null));};exports['destroy']=function(_0x32d02f,_0x1dcbee){return db[_0xe362('0x31')][_0xe362('0x4d')]({'where':{'id':_0x32d02f[_0xe362('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1dcbee,null))[_0xe362('0x19')](removeEntity(_0x1dcbee,null))['catch'](handleError(_0x1dcbee,null));};exports[_0xe362('0x50')]=function(_0x13aa5e,_0x4759bc,_0x32ae78){var _0x3d7f00={};var _0x39c0d0={};var _0x2984c2;var _0xab0958;return db['ServicenowAccount']['findOne']({'where':{'id':_0x13aa5e[_0xe362('0x4b')]['id']}})[_0xe362('0x19')](handleEntityNotFound(_0x4759bc,null))[_0xe362('0x19')](function(_0x32a417){if(_0x32a417){_0x2984c2=_0x32a417;_0x39c0d0[_0xe362('0x36')]=_['keys'](db[_0xe362('0x51')][_0xe362('0x32')]);_0x39c0d0['query']=_[_0xe362('0x33')](_0x13aa5e[_0xe362('0x34')]);_0x39c0d0[_0xe362('0x35')]=_[_0xe362('0x4c')](_0x39c0d0[_0xe362('0x36')],_0x39c0d0[_0xe362('0x34')]);_0x3d7f00[_0xe362('0x37')]=_['intersection'](_0x39c0d0[_0xe362('0x36')],qs[_0xe362('0x38')](_0x13aa5e[_0xe362('0x34')][_0xe362('0x38')]));_0x3d7f00[_0xe362('0x37')]=_0x3d7f00[_0xe362('0x37')]['length']?_0x3d7f00[_0xe362('0x37')]:_0x39c0d0['model'];_0x3d7f00['order']=qs[_0xe362('0x3b')](_0x13aa5e[_0xe362('0x34')][_0xe362('0x3b')]);_0x3d7f00[_0xe362('0x3e')]=qs['filters'](_[_0xe362('0x3c')](_0x13aa5e['query'],_0x39c0d0[_0xe362('0x35')]));if(_0x13aa5e[_0xe362('0x34')][_0xe362('0x3d')]){_0x3d7f00['where']=_[_0xe362('0x44')](_0x3d7f00[_0xe362('0x3e')],{'$or':_['map'](_0x3d7f00['attributes'],function(_0x127af3){var _0x320d78={};_0x320d78[_0x127af3]={'$like':'%'+_0x13aa5e[_0xe362('0x34')][_0xe362('0x3d')]+'%'};return _0x320d78;})});}_0x3d7f00=_[_0xe362('0x44')]({},_0x3d7f00,_0x13aa5e[_0xe362('0x45')]);return _0x2984c2[_0xe362('0x50')](_0x3d7f00);}})[_0xe362('0x19')](function(_0x10126d){if(_0x10126d){_0xab0958=_0x10126d[_0xe362('0x39')];if(!_0x13aa5e['query'][_0xe362('0x3a')](_0xe362('0x52'))){_0x3d7f00[_0xe362('0x27')]=qs['limit'](_0x13aa5e[_0xe362('0x34')][_0xe362('0x27')]);_0x3d7f00['offset']=qs[_0xe362('0x26')](_0x13aa5e[_0xe362('0x34')][_0xe362('0x26')]);}return _0x2984c2['getConfigurations'](_0x3d7f00);}})[_0xe362('0x19')](function(_0x5df270){if(_0x5df270){return _0x5df270?{'count':_0xab0958,'rows':_0x5df270}:null;}})['then'](respondWithResult(_0x4759bc,null))[_0xe362('0x4a')](handleError(_0x4759bc,null));};exports[_0xe362('0x53')]=function(_0x28df6b,_0x39a3cc,_0x4f9c65){if(_0x28df6b[_0xe362('0x4f')]['id']){delete _0x28df6b['body']['id'];}return db['ServicenowAccount'][_0xe362('0x54')]({'where':{'id':_0x28df6b['params']['id']}})[_0xe362('0x19')](handleEntityNotFound(_0x39a3cc,null))[_0xe362('0x19')](function(_0x490f18){if(_0x490f18){_0x28df6b['body'][_0xe362('0x55')]=_0x490f18['id'];_0x28df6b[_0xe362('0x4f')]['Subjects']=integrations[_0xe362('0x56')](_0x28df6b[_0xe362('0x4f')][_0xe362('0x57')],_0x28df6b[_0xe362('0x4f')][_0xe362('0x40')]);_0x28df6b[_0xe362('0x4f')][_0xe362('0x58')]=integrations['getDescriptions'](_0x28df6b[_0xe362('0x4f')]['channel'],_0x28df6b[_0xe362('0x4f')][_0xe362('0x40')]);return db[_0xe362('0x51')][_0xe362('0x4e')](_0x28df6b[_0xe362('0x4f')],{'include':[{'model':db['ServicenowField'],'as':_0xe362('0x59')},{'model':db[_0xe362('0x5a')],'as':_0xe362('0x58')}]});}return null;})[_0xe362('0x19')](respondWithResult(_0x39a3cc,null))[_0xe362('0x4a')](handleError(_0x39a3cc,null));};exports['getFields']=function(_0x199cf0,_0xce993e,_0x410ebb){var _0x2eebae=[_0xe362('0x5b'),_0xe362('0x5c'),_0xe362('0x5d'),_0xe362('0x5e'),_0xe362('0x5f'),_0xe362('0x60'),_0xe362('0x61'),_0xe362('0x62'),_0xe362('0x63')];var _0x59bf13=[_0xe362('0x64'),'made_sla',_0xe362('0x65'),_0xe362('0x66'),_0xe362('0x67'),_0xe362('0x68'),_0xe362('0x69'),_0xe362('0x5c'),'approval_history',_0xe362('0x6a'),_0xe362('0x6b'),_0xe362('0x6c'),_0xe362('0x6d'),_0xe362('0x6e'),_0xe362('0x6f'),_0xe362('0x70'),_0xe362('0x71'),_0xe362('0x72'),_0xe362('0x5d'),_0xe362('0x73'),_0xe362('0x74'),_0xe362('0x75'),_0xe362('0x76'),_0xe362('0x77'),_0xe362('0x78'),_0xe362('0x79'),_0xe362('0x7a'),_0xe362('0x7b'),'priority',_0xe362('0x7c'),_0xe362('0x7d'),_0xe362('0x7e'),'expected_start',_0xe362('0x7f'),_0xe362('0x80'),_0xe362('0x81'),_0xe362('0x82'),_0xe362('0x83'),_0xe362('0x84'),_0xe362('0x85'),_0xe362('0x86'),_0xe362('0x5e'),_0xe362('0x87'),'short_description',_0xe362('0x5f'),_0xe362('0x88'),_0xe362('0x89'),_0xe362('0x8a'),_0xe362('0x8b'),'business_stc','additional_assignee_list',_0xe362('0x8c'),_0xe362('0x8d'),'notify',_0xe362('0x8e'),_0xe362('0x8f'),_0xe362('0x90'),_0xe362('0x91'),_0xe362('0x92'),'sys_id',_0xe362('0x93'),_0xe362('0x94'),_0xe362('0x61'),'urgency',_0xe362('0x95'),'company','reassignment_count','activity_due',_0xe362('0x96'),_0xe362('0x62'),_0xe362('0x97'),'sla_due','approval',_0xe362('0x98'),_0xe362('0x99'),_0xe362('0x9a'),_0xe362('0x9b'),_0xe362('0x9c'),'escalation',_0xe362('0x9d'),_0xe362('0x9e'),_0xe362('0x9f'),_0xe362('0x63')];var _0x4dde57='';var _0x1580d5='';var _0xfed8e5=[];var _0x2cf2e8='';var _0x5d5239='';var _0x426d01=[];var _0x56d2e1='';var _0x5c27a9='';var _0x262c17={};var _0x3335f9='';return db['ServicenowAccount'][_0xe362('0x54')]({'where':{'id':_0x199cf0[_0xe362('0x4b')]['id']},'attributes':['id',_0xe362('0xa0'),_0xe362('0xa1'),_0xe362('0xa2'),_0xe362('0xa3'),_0xe362('0xa4')]})[_0xe362('0x19')](handleEntityNotFound(_0xce993e,null))[_0xe362('0x19')](function(_0x4d2ea3){if(_0x4d2ea3){_0x3335f9=_0x4d2ea3[_0xe362('0xa3')];var _0x585b8f=_0x3335f9[_0xe362('0xa5')](-0x1);if(_0x585b8f==='/'){_0x3335f9=_0x3335f9[_0xe362('0xa6')](0x0,_0x3335f9['lastIndexOf'](_0x585b8f));}_0x5c27a9=util[_0xe362('0xa7')](_0xe362('0xa8'),_0x3335f9);_0x56d2e1=util['format']('%s/api/now/table/',_0x3335f9);_0x262c17={'user':_0x4d2ea3[_0xe362('0xa0')],'pass':_0x4d2ea3[_0xe362('0xa1')]};var _0x5950a8={'method':_0xe362('0xa9'),'uri':_0x5c27a9+_0xe362('0xaa'),'auth':_0x262c17,'json':!![]};return rp(_0x5950a8);}})[_0xe362('0x19')](function(_0x19c47c){if(_0x19c47c[_0xe362('0x23')][_0xe362('0x39')]>0x0){_0x4dde57=_0x19c47c[_0xe362('0x23')];}console[_0xe362('0xab')](_0xe362('0xac'),_0x4dde57);_0x426d01=[];_0x1580d5=Object[_0xe362('0xad')]([],_0x4dde57);_['remove'](_0x1580d5,function(_0x53e670){return!_0x2eebae[_0xe362('0xae')](_0x53e670['name']);});_0x1580d5[_0xe362('0xaf')](function(_0x36e22a){var _0x1d1065=createFieldObject(_0x56d2e1,_0x262c17,_0x36e22a[_0xe362('0xb0')],_0x36e22a[_0xe362('0x2e')],_0x36e22a[_0xe362('0xb1')],![]);_0x426d01[_0xe362('0xb2')](_0x1d1065);});return Promise['all'](_0x426d01);})[_0xe362('0x19')](function(_0x39c659){_0xfed8e5=_0x39c659;_0x2cf2e8=Object[_0xe362('0xad')]([],_0x4dde57);console[_0xe362('0xab')](_0xe362('0xb3'),_0x4dde57);_['remove'](_0x2cf2e8,function(_0x24746d){return _0x59bf13['includes'](_0x24746d[_0xe362('0x2e')]);});console[_0xe362('0xab')](_0xe362('0xb4'),_0x2cf2e8);_0x426d01=[];_0x2cf2e8[_0xe362('0xaf')](function(_0x1704da){var _0x3f617e=createFieldObject(_0x56d2e1,_0x262c17,_0x1704da['internalType'],_0x1704da[_0xe362('0x2e')],_0x1704da[_0xe362('0xb1')],!![]);_0x426d01[_0xe362('0xb2')](_0x3f617e);});return Promise[_0xe362('0xb5')](_0x426d01);})['then'](function(_0xe786b8){_0x5d5239=_0xe786b8;var _0x43f042=_0xfed8e5[_0xe362('0xb6')](_0x5d5239);return{'count':_0x43f042[_0xe362('0x39')],'rows':_0x43f042};})[_0xe362('0x19')](respondWithResult(_0xce993e,null))[_0xe362('0x4a')](function(_0x19ad8e){console[_0xe362('0xab')]('ServiceNow\x20error:\x20'+_0x19ad8e);var _0x1bfa90=_0x199cf0[_0xe362('0x34')][_0xe362('0xb7')]?0x1f4:_0x19ad8e[_0xe362('0xb8')]||0x1f4;logger[_0xe362('0x20')](_0x19ad8e['stack']);delete _0x19ad8e['name'];if(_0x1bfa90===0x191){_0x1bfa90=0x190;}_0xce993e['status'](_0x1bfa90)['send'](_0x199cf0[_0xe362('0x34')][_0xe362('0xb7')]?{'message':_0xe362('0xb9'),'statusCode':_0x19ad8e['statusCode']}:_0x19ad8e);});};function createFieldObject(_0x5b6932,_0x454602,_0x3d1832,_0x25a40b,_0x473d84,_0x39a6e2){return new Promise(function(_0xb82339,_0x4fc426){var _0x268057={'id':_0x25a40b,'name':_0x473d84,'custom':_0x39a6e2};if(_0x3d1832===_0xe362('0xba')){_0x268057['options']=[{'name':'True','value':'true'},{'name':'False','value':_0xe362('0xbb')}];_0xb82339(_0x268057);}else{var _0x4735f0={'method':_0xe362('0xa9'),'uri':_0x5b6932+_0xe362('0xbc')+_0x25a40b,'auth':_0x454602,'json':!![]};return rp(_0x4735f0)[_0xe362('0x19')](function(_0x16cf9a){var _0x5c0670=[];if(_0x16cf9a['result'][_0xe362('0x39')]>0x0){_0x16cf9a['result']['forEach'](function(_0x38a48a){if(_0x38a48a[_0xe362('0xbd')]===_0xe362('0xbb')){var _0x48d3fc={'name':_0x38a48a['label'],'value':_0x38a48a[_0xe362('0xbe')]};_0x5c0670[_0xe362('0xb2')](_0x48d3fc);}});}_0x268057[_0xe362('0x45')]=_0x5c0670;if(_0x268057[_0xe362('0x45')][_0xe362('0x39')]>0x0){_0xb82339(_0x268057);}else{if(_0x39a6e2==![]){_0xb82339();}else{_0xb82339(_0x268057);}}});}});}
\ No newline at end of file
+var _0xa7ac=['status','json','offset','limit','Content-Range','apply','reject','update','destroy','end','name','send','index','ServicenowAccount','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','options','count','includeAll','include','findAll','rows','length','find','body','params','getConfigurations','findOne','ServicenowConfiguration','rawAttributes','addConfiguration','getSubjects','getDescriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','delivery_plan','active','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','comments','sla_due','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','includes','forEach','internalType','push','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','all','ServiceNow\x20error:\x20','statusCode','stack','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus'];(function(_0x31ceda,_0x276555){var _0x3fc4b4=function(_0x100164){while(--_0x100164){_0x31ceda['push'](_0x31ceda['shift']());}};_0x3fc4b4(++_0x276555);}(_0xa7ac,0x159));var _0xca7a=function(_0x95ff72,_0x15f3f7){_0x95ff72=_0x95ff72-0x0;var _0x606709=_0xa7ac[_0x95ff72];return _0x606709;};'use strict';var pdf=require(_0xca7a('0x0'));var emlformat=require(_0xca7a('0x1'));var rimraf=require(_0xca7a('0x2'));var zipdir=require(_0xca7a('0x3'));var jsonpatch=require(_0xca7a('0x4'));var rp=require(_0xca7a('0x5'));var moment=require(_0xca7a('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xca7a('0x7'));var util=require('util');var path=require(_0xca7a('0x8'));var sox=require(_0xca7a('0x9'));var csv=require(_0xca7a('0xa'));var ejs=require(_0xca7a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xca7a('0xc'));var toCsv=require(_0xca7a('0xa'));var querystring=require(_0xca7a('0xd'));var Papa=require(_0xca7a('0xe'));var Redis=require(_0xca7a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca7a('0x10'));var hardwareService=require(_0xca7a('0x11'));var logger=require(_0xca7a('0x12'))(_0xca7a('0x13'));var utils=require(_0xca7a('0x14'));var config=require(_0xca7a('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xca7a('0x16'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2c190f,_0x4bae00,_0x2a91d7){if(_0x2a91d7){var _0x30135d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30135d[_0xca7a('0x17')](_0x4bae00)){return _0x2c190f;}else{throw new Error(_0xca7a('0x18'));}}else{return _0x2c190f;}}function respondWithRpcPromise(_0x574a2c,_0x3763eb,_0x12cdd0,_0x5424e3){return new BPromise(function(_0x260cb2,_0x3175a5){var _0x3780fc=_0x5424e3||client;return _0x3780fc[_0xca7a('0x19')](_0x574a2c,_0x12cdd0)[_0xca7a('0x1a')](function(_0x507507){logger[_0xca7a('0x1b')](_0xca7a('0x1c'),_0x3763eb,_0xca7a('0x1d'));logger[_0xca7a('0x1e')](_0xca7a('0x1f'),_0x3763eb,_0xca7a('0x1d'),JSON[_0xca7a('0x20')](_0x507507));if(_0x507507[_0xca7a('0x21')]){if(_0x507507['error'][_0xca7a('0x22')]===0x1f4){logger[_0xca7a('0x21')]('ServicenowAccount,\x20%s,\x20%s',_0x3763eb,_0x507507[_0xca7a('0x21')][_0xca7a('0x23')]);return _0x3175a5(_0x507507['error'][_0xca7a('0x23')]);}logger[_0xca7a('0x21')](_0xca7a('0x1c'),_0x3763eb,_0x507507['error'][_0xca7a('0x23')]);return _0x260cb2(_0x507507[_0xca7a('0x21')][_0xca7a('0x23')]);}else{logger['info'](_0xca7a('0x1c'),_0x3763eb,_0xca7a('0x1d'));_0x260cb2(_0x507507[_0xca7a('0x24')][_0xca7a('0x23')]);}})[_0xca7a('0x25')](function(_0x4455d0){logger[_0xca7a('0x21')](_0xca7a('0x1c'),_0x3763eb,_0x4455d0);_0x3175a5(_0x4455d0);});});}function respondWithStatusCode(_0x2303db,_0x3090db){_0x3090db=_0x3090db||0xcc;return function(_0x29b2ca){if(_0x29b2ca){return _0x2303db[_0xca7a('0x26')](_0x3090db);}return _0x2303db[_0xca7a('0x27')](_0x3090db)['end']();};}function respondWithResult(_0x2ca2eb,_0xf619ed){_0xf619ed=_0xf619ed||0xc8;return function(_0x49a092){if(_0x49a092){return _0x2ca2eb[_0xca7a('0x27')](_0xf619ed)[_0xca7a('0x28')](_0x49a092);}};}function respondWithFilteredResult(_0xa19ea9,_0x165f31){return function(_0x7a681b){if(_0x7a681b){var _0x19e908=_0x7a681b['count'],_0x5d06b5=_0x165f31[_0xca7a('0x29')],_0x59ee53=_0x165f31['offset']+_0x165f31[_0xca7a('0x2a')],_0x2e2d8e;if(_0x59ee53>=_0x19e908){_0x59ee53=_0x19e908;_0x2e2d8e=0xc8;}else{_0x2e2d8e=0xce;}_0xa19ea9['status'](_0x2e2d8e);return _0xa19ea9['set'](_0xca7a('0x2b'),_0x5d06b5+'-'+_0x59ee53+'/'+_0x19e908)['json'](_0x7a681b);}return null;};}function patchUpdates(_0x2c7490){return function(_0x9d986a){try{jsonpatch[_0xca7a('0x2c')](_0x9d986a,_0x2c7490,!![]);}catch(_0x5a5ead){return BPromise[_0xca7a('0x2d')](_0x5a5ead);}return _0x9d986a['save']();};}function saveUpdates(_0x1aba6f,_0x332583){return function(_0x510c68){if(_0x510c68){return _0x510c68[_0xca7a('0x2e')](_0x1aba6f)[_0xca7a('0x1a')](function(_0x57e230){return _0x57e230;});}return null;};}function removeEntity(_0x2c9b27,_0x2fc6e3){return function(_0x55b9db){if(_0x55b9db){return _0x55b9db[_0xca7a('0x2f')]()['then'](function(){_0x2c9b27[_0xca7a('0x27')](0xcc)[_0xca7a('0x30')]();});}};}function handleEntityNotFound(_0x34fb60,_0xaf5f4f){return function(_0x28a50d){if(!_0x28a50d){_0x34fb60[_0xca7a('0x26')](0x194);}return _0x28a50d;};}function handleError(_0x227c8c,_0x25a3e2){_0x25a3e2=_0x25a3e2||0x1f4;return function(_0x2a6241){logger[_0xca7a('0x21')](_0x2a6241['stack']);if(_0x2a6241['name']){delete _0x2a6241[_0xca7a('0x31')];}_0x227c8c[_0xca7a('0x27')](_0x25a3e2)[_0xca7a('0x32')](_0x2a6241);};}exports[_0xca7a('0x33')]=function(_0x481302,_0xe357b1){var _0x58944b={},_0x142097={},_0x251f87={'count':0x0,'rows':[]};var _0x5a86ac=db[_0xca7a('0x34')]['rawAttributes'];_0x142097[_0xca7a('0x35')]=_[_0xca7a('0x36')](_0x5a86ac);_0x142097[_0xca7a('0x37')]=_['keys'](_0x481302[_0xca7a('0x37')]);_0x142097['filters']=_[_0xca7a('0x38')](_0x142097['model'],_0x142097['query']);_0x58944b[_0xca7a('0x39')]=_[_0xca7a('0x38')](_0x142097[_0xca7a('0x35')],qs[_0xca7a('0x3a')](_0x481302[_0xca7a('0x37')][_0xca7a('0x3a')]));_0x58944b[_0xca7a('0x39')]=_0x58944b['attributes']['length']?_0x58944b['attributes']:_0x142097['model'];if(!_0x481302[_0xca7a('0x37')][_0xca7a('0x3b')](_0xca7a('0x3c'))){_0x58944b[_0xca7a('0x2a')]=qs['limit'](_0x481302[_0xca7a('0x37')]['limit']);_0x58944b['offset']=qs[_0xca7a('0x29')](_0x481302[_0xca7a('0x37')][_0xca7a('0x29')]);}_0x58944b[_0xca7a('0x3d')]=qs[_0xca7a('0x3e')](_0x481302[_0xca7a('0x37')][_0xca7a('0x3e')]);_0x58944b[_0xca7a('0x3f')]=qs[_0xca7a('0x40')](_[_0xca7a('0x41')](_0x481302[_0xca7a('0x37')],_0x142097[_0xca7a('0x40')]));if(_0x481302[_0xca7a('0x37')][_0xca7a('0x42')]){_0x58944b['where']=_[_0xca7a('0x43')](_0x58944b[_0xca7a('0x3f')],{'$or':_[_0xca7a('0x44')](_0x5a86ac,function(_0x3abfbb){if(_0x3abfbb[_0xca7a('0x45')][_0xca7a('0x46')]!=='VIRTUAL'){var _0x2caa0a={};_0x2caa0a[_0x3abfbb['field']]={'$like':'%'+_0x481302[_0xca7a('0x37')]['filter']+'%'};return _0x2caa0a;}})});}_0x58944b=_[_0xca7a('0x43')]({},_0x58944b,_0x481302[_0xca7a('0x47')]);var _0x17f9c6={'where':_0x58944b[_0xca7a('0x3f')]};return db['ServicenowAccount'][_0xca7a('0x48')](_0x17f9c6)['then'](function(_0x1cf7a2){_0x251f87[_0xca7a('0x48')]=_0x1cf7a2;if(_0x481302[_0xca7a('0x37')][_0xca7a('0x49')]){_0x58944b[_0xca7a('0x4a')]=[{'all':!![]}];}return db[_0xca7a('0x34')][_0xca7a('0x4b')](_0x58944b);})[_0xca7a('0x1a')](function(_0x4fe4d9){_0x251f87[_0xca7a('0x4c')]=_0x4fe4d9;return _0x251f87;})[_0xca7a('0x1a')](respondWithFilteredResult(_0xe357b1,_0x58944b))[_0xca7a('0x25')](handleError(_0xe357b1,null));};exports['show']=function(_0x3ac6ca,_0x2e1e69){var _0xd415b7={'raw':![],'where':{'id':_0x3ac6ca['params']['id']}},_0x24aff0={};_0x24aff0[_0xca7a('0x35')]=_[_0xca7a('0x36')](db[_0xca7a('0x34')]['rawAttributes']);_0x24aff0['query']=_[_0xca7a('0x36')](_0x3ac6ca[_0xca7a('0x37')]);_0x24aff0[_0xca7a('0x40')]=_['intersection'](_0x24aff0['model'],_0x24aff0[_0xca7a('0x37')]);_0xd415b7[_0xca7a('0x39')]=_[_0xca7a('0x38')](_0x24aff0[_0xca7a('0x35')],qs['fields'](_0x3ac6ca[_0xca7a('0x37')][_0xca7a('0x3a')]));_0xd415b7[_0xca7a('0x39')]=_0xd415b7['attributes'][_0xca7a('0x4d')]?_0xd415b7[_0xca7a('0x39')]:_0x24aff0[_0xca7a('0x35')];if(_0x3ac6ca[_0xca7a('0x37')][_0xca7a('0x49')]){_0xd415b7[_0xca7a('0x4a')]=[{'all':!![]}];}_0xd415b7=_[_0xca7a('0x43')]({},_0xd415b7,_0x3ac6ca['options']);return db[_0xca7a('0x34')][_0xca7a('0x4e')](_0xd415b7)['then'](handleEntityNotFound(_0x2e1e69,null))[_0xca7a('0x1a')](respondWithResult(_0x2e1e69,null))['catch'](handleError(_0x2e1e69,null));};exports['create']=function(_0xa4652,_0x534f2f){return db['ServicenowAccount']['create'](_0xa4652[_0xca7a('0x4f')],{})[_0xca7a('0x1a')](respondWithResult(_0x534f2f,0xc9))[_0xca7a('0x25')](handleError(_0x534f2f,null));};exports[_0xca7a('0x2e')]=function(_0x42f3b7,_0x250bb3){if(_0x42f3b7[_0xca7a('0x4f')]['id']){delete _0x42f3b7[_0xca7a('0x4f')]['id'];}return db['ServicenowAccount'][_0xca7a('0x4e')]({'where':{'id':_0x42f3b7[_0xca7a('0x50')]['id']}})[_0xca7a('0x1a')](handleEntityNotFound(_0x250bb3,null))[_0xca7a('0x1a')](saveUpdates(_0x42f3b7[_0xca7a('0x4f')],null))[_0xca7a('0x1a')](respondWithResult(_0x250bb3,null))[_0xca7a('0x25')](handleError(_0x250bb3,null));};exports[_0xca7a('0x2f')]=function(_0x3e03dd,_0x13ce4a){return db[_0xca7a('0x34')][_0xca7a('0x4e')]({'where':{'id':_0x3e03dd[_0xca7a('0x50')]['id']}})[_0xca7a('0x1a')](handleEntityNotFound(_0x13ce4a,null))[_0xca7a('0x1a')](removeEntity(_0x13ce4a,null))[_0xca7a('0x25')](handleError(_0x13ce4a,null));};exports[_0xca7a('0x51')]=function(_0xad5eb6,_0x1ac3eb,_0x5135e8){var _0x5a1afb={};var _0x5949b8={};var _0x12ce19;var _0x547904;return db[_0xca7a('0x34')][_0xca7a('0x52')]({'where':{'id':_0xad5eb6['params']['id']}})[_0xca7a('0x1a')](handleEntityNotFound(_0x1ac3eb,null))[_0xca7a('0x1a')](function(_0x83ecb9){if(_0x83ecb9){_0x12ce19=_0x83ecb9;_0x5949b8[_0xca7a('0x35')]=_['keys'](db[_0xca7a('0x53')][_0xca7a('0x54')]);_0x5949b8['query']=_[_0xca7a('0x36')](_0xad5eb6['query']);_0x5949b8[_0xca7a('0x40')]=_[_0xca7a('0x38')](_0x5949b8[_0xca7a('0x35')],_0x5949b8[_0xca7a('0x37')]);_0x5a1afb[_0xca7a('0x39')]=_[_0xca7a('0x38')](_0x5949b8[_0xca7a('0x35')],qs['fields'](_0xad5eb6[_0xca7a('0x37')][_0xca7a('0x3a')]));_0x5a1afb[_0xca7a('0x39')]=_0x5a1afb['attributes'][_0xca7a('0x4d')]?_0x5a1afb[_0xca7a('0x39')]:_0x5949b8['model'];_0x5a1afb['order']=qs[_0xca7a('0x3e')](_0xad5eb6[_0xca7a('0x37')]['sort']);_0x5a1afb[_0xca7a('0x3f')]=qs[_0xca7a('0x40')](_[_0xca7a('0x41')](_0xad5eb6['query'],_0x5949b8['filters']));if(_0xad5eb6[_0xca7a('0x37')][_0xca7a('0x42')]){_0x5a1afb[_0xca7a('0x3f')]=_[_0xca7a('0x43')](_0x5a1afb[_0xca7a('0x3f')],{'$or':_[_0xca7a('0x44')](_0x5a1afb[_0xca7a('0x39')],function(_0x55c268){var _0x57771e={};_0x57771e[_0x55c268]={'$like':'%'+_0xad5eb6[_0xca7a('0x37')][_0xca7a('0x42')]+'%'};return _0x57771e;})});}_0x5a1afb=_['merge']({},_0x5a1afb,_0xad5eb6[_0xca7a('0x47')]);return _0x12ce19[_0xca7a('0x51')](_0x5a1afb);}})['then'](function(_0x4435fb){if(_0x4435fb){_0x547904=_0x4435fb['length'];if(!_0xad5eb6[_0xca7a('0x37')][_0xca7a('0x3b')](_0xca7a('0x3c'))){_0x5a1afb[_0xca7a('0x2a')]=qs[_0xca7a('0x2a')](_0xad5eb6[_0xca7a('0x37')][_0xca7a('0x2a')]);_0x5a1afb[_0xca7a('0x29')]=qs['offset'](_0xad5eb6[_0xca7a('0x37')][_0xca7a('0x29')]);}return _0x12ce19[_0xca7a('0x51')](_0x5a1afb);}})[_0xca7a('0x1a')](function(_0xdb9183){if(_0xdb9183){return _0xdb9183?{'count':_0x547904,'rows':_0xdb9183}:null;}})['then'](respondWithResult(_0x1ac3eb,null))[_0xca7a('0x25')](handleError(_0x1ac3eb,null));};exports[_0xca7a('0x55')]=function(_0x8c5ea3,_0x3e48d7,_0x1fba09){if(_0x8c5ea3[_0xca7a('0x4f')]['id']){delete _0x8c5ea3[_0xca7a('0x4f')]['id'];}return db[_0xca7a('0x34')][_0xca7a('0x52')]({'where':{'id':_0x8c5ea3[_0xca7a('0x50')]['id']}})['then'](handleEntityNotFound(_0x3e48d7,null))[_0xca7a('0x1a')](function(_0x532552){if(_0x532552){_0x8c5ea3[_0xca7a('0x4f')]['AccountId']=_0x532552['id'];_0x8c5ea3[_0xca7a('0x4f')]['Subjects']=integrations[_0xca7a('0x56')](_0x8c5ea3[_0xca7a('0x4f')]['channel'],_0x8c5ea3[_0xca7a('0x4f')][_0xca7a('0x45')]);_0x8c5ea3['body']['Descriptions']=integrations[_0xca7a('0x57')](_0x8c5ea3['body']['channel'],_0x8c5ea3['body'][_0xca7a('0x45')]);return db[_0xca7a('0x53')]['create'](_0x8c5ea3[_0xca7a('0x4f')],{'include':[{'model':db[_0xca7a('0x58')],'as':_0xca7a('0x59')},{'model':db[_0xca7a('0x58')],'as':'Descriptions'}]});}return null;})[_0xca7a('0x1a')](respondWithResult(_0x3e48d7,null))[_0xca7a('0x25')](handleError(_0x3e48d7,null));};exports[_0xca7a('0x5a')]=function(_0x1ad7e8,_0x21965a,_0x185faa){var _0x34b5a7=[_0xca7a('0x5b'),_0xca7a('0x5c'),_0xca7a('0x5d'),_0xca7a('0x5e'),_0xca7a('0x5f'),_0xca7a('0x60'),_0xca7a('0x61'),_0xca7a('0x62'),_0xca7a('0x63')];var _0x398e91=['parent',_0xca7a('0x5b'),_0xca7a('0x64'),_0xca7a('0x65'),'upon_reject',_0xca7a('0x66'),_0xca7a('0x67'),_0xca7a('0x5c'),_0xca7a('0x68'),_0xca7a('0x69'),'resolved_by',_0xca7a('0x6a'),_0xca7a('0x6b'),_0xca7a('0x6c'),_0xca7a('0x6d'),'sys_domain',_0xca7a('0x6e'),_0xca7a('0x6f'),_0xca7a('0x5d'),_0xca7a('0x3d'),_0xca7a('0x70'),_0xca7a('0x71'),'cmdb_ci',_0xca7a('0x72'),'impact',_0xca7a('0x73'),'work_notes_list','business_service','priority',_0xca7a('0x74'),_0xca7a('0x75'),_0xca7a('0x76'),_0xca7a('0x77'),_0xca7a('0x78'),_0xca7a('0x79'),_0xca7a('0x7a'),_0xca7a('0x7b'),_0xca7a('0x7c'),_0xca7a('0x7d'),_0xca7a('0x7e'),_0xca7a('0x7f'),'subcategory',_0xca7a('0x80'),_0xca7a('0x81'),_0xca7a('0x5f'),_0xca7a('0x82'),'delivery_task',_0xca7a('0x83'),'assignment_group',_0xca7a('0x84'),_0xca7a('0x85'),_0xca7a('0x86'),_0xca7a('0x87'),_0xca7a('0x60'),_0xca7a('0x88'),_0xca7a('0x89'),_0xca7a('0x8a'),_0xca7a('0x8b'),_0xca7a('0x8c'),_0xca7a('0x8d'),_0xca7a('0x8e'),_0xca7a('0x8f'),_0xca7a('0x61'),_0xca7a('0x90'),'problem_id',_0xca7a('0x91'),_0xca7a('0x92'),_0xca7a('0x93'),_0xca7a('0x94'),'severity',_0xca7a('0x95'),_0xca7a('0x96'),'approval','comments_and_work_notes',_0xca7a('0x97'),_0xca7a('0x98'),'reopen_count',_0xca7a('0x99'),_0xca7a('0x9a'),_0xca7a('0x9b'),_0xca7a('0x9c'),_0xca7a('0x9d'),'category'];var _0x4365f2='';var _0x4915e1='';var _0x1ba12b=[];var _0x200891='';var _0x220349='';var _0x39f17b=[];var _0x5b6573='';var _0x50dd04='';var _0x3b853f={};var _0x59147='';return db[_0xca7a('0x34')][_0xca7a('0x52')]({'where':{'id':_0x1ad7e8[_0xca7a('0x50')]['id']},'attributes':['id',_0xca7a('0x9e'),'password',_0xca7a('0x9f'),_0xca7a('0xa0'),_0xca7a('0xa1')]})[_0xca7a('0x1a')](handleEntityNotFound(_0x21965a,null))[_0xca7a('0x1a')](function(_0x466e96){if(_0x466e96){_0x59147=_0x466e96[_0xca7a('0xa0')];var _0xb66918=_0x59147[_0xca7a('0xa2')](-0x1);if(_0xb66918==='/'){_0x59147=_0x59147['substring'](0x0,_0x59147[_0xca7a('0xa3')](_0xb66918));}_0x50dd04=util[_0xca7a('0xa4')](_0xca7a('0xa5'),_0x59147);_0x5b6573=util[_0xca7a('0xa4')](_0xca7a('0xa6'),_0x59147);_0x3b853f={'user':_0x466e96['username'],'pass':_0x466e96[_0xca7a('0xa7')]};var _0x49b825={'method':_0xca7a('0xa8'),'uri':_0x50dd04+_0xca7a('0xa9'),'auth':_0x3b853f,'json':!![]};return rp(_0x49b825);}})['then'](function(_0x1b1bf6){if(_0x1b1bf6['result'][_0xca7a('0x4d')]>0x0){_0x4365f2=_0x1b1bf6[_0xca7a('0x24')];}console[_0xca7a('0xaa')](_0xca7a('0xab'),_0x4365f2);_0x39f17b=[];_0x4915e1=Object[_0xca7a('0xac')]([],_0x4365f2);_['remove'](_0x4915e1,function(_0x4655aa){return!_0x34b5a7[_0xca7a('0xad')](_0x4655aa['name']);});_0x4915e1[_0xca7a('0xae')](function(_0x5eeeb8){var _0x2542a4=createFieldObject(_0x5b6573,_0x3b853f,_0x5eeeb8[_0xca7a('0xaf')],_0x5eeeb8[_0xca7a('0x31')],_0x5eeeb8['label'],![]);_0x39f17b[_0xca7a('0xb0')](_0x2542a4);});return Promise['all'](_0x39f17b);})['then'](function(_0x159d7c){_0x1ba12b=_0x159d7c;_0x200891=Object[_0xca7a('0xac')]([],_0x4365f2);console['log'](_0xca7a('0xb1'),_0x4365f2);_[_0xca7a('0xb2')](_0x200891,function(_0x3f7d1e){return _0x398e91[_0xca7a('0xad')](_0x3f7d1e['name']);});console[_0xca7a('0xaa')](_0xca7a('0xb3'),_0x200891);_0x39f17b=[];_0x200891['forEach'](function(_0x4d27f6){var _0x5c0e0f=createFieldObject(_0x5b6573,_0x3b853f,_0x4d27f6[_0xca7a('0xaf')],_0x4d27f6[_0xca7a('0x31')],_0x4d27f6[_0xca7a('0xb4')],!![]);_0x39f17b[_0xca7a('0xb0')](_0x5c0e0f);});return Promise[_0xca7a('0xb5')](_0x39f17b);})['then'](function(_0x5bd750){_0x220349=_0x5bd750;var _0x489073=_0x1ba12b['concat'](_0x220349);return{'count':_0x489073[_0xca7a('0x4d')],'rows':_0x489073};})[_0xca7a('0x1a')](respondWithResult(_0x21965a,null))[_0xca7a('0x25')](function(_0x5f19e2){console[_0xca7a('0xaa')](_0xca7a('0xb6')+_0x5f19e2);var _0x115bfd=_0x1ad7e8[_0xca7a('0x37')][_0xca7a('0x17')]?0x1f4:_0x5f19e2[_0xca7a('0xb7')]||0x1f4;logger[_0xca7a('0x21')](_0x5f19e2[_0xca7a('0xb8')]);delete _0x5f19e2[_0xca7a('0x31')];if(_0x115bfd===0x191){_0x115bfd=0x190;}_0x21965a[_0xca7a('0x27')](_0x115bfd)['send'](_0x1ad7e8[_0xca7a('0x37')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5f19e2['statusCode']}:_0x5f19e2);});};function createFieldObject(_0x50c19a,_0x5ecb61,_0x3a4537,_0x41f5a0,_0x2b6eb0,_0x51a412){return new Promise(function(_0x181111,_0x55bcdd){var _0x1ed0d2={'id':_0x41f5a0,'name':_0x2b6eb0,'custom':_0x51a412};if(_0x3a4537===_0xca7a('0xb9')){_0x1ed0d2[_0xca7a('0x47')]=[{'name':_0xca7a('0xba'),'value':_0xca7a('0xbb')},{'name':_0xca7a('0xbc'),'value':_0xca7a('0xbd')}];_0x181111(_0x1ed0d2);}else{var _0x322e0b={'method':_0xca7a('0xa8'),'uri':_0x50c19a+_0xca7a('0xbe')+_0x41f5a0,'auth':_0x5ecb61,'json':!![]};return rp(_0x322e0b)[_0xca7a('0x1a')](function(_0x1fa58c){var _0x2da1ff=[];if(_0x1fa58c['result']['length']>0x0){_0x1fa58c[_0xca7a('0x24')]['forEach'](function(_0x17a382){if(_0x17a382[_0xca7a('0xbf')]==='false'){var _0x50bece={'name':_0x17a382['label'],'value':_0x17a382['value']};_0x2da1ff['push'](_0x50bece);}});}_0x1ed0d2[_0xca7a('0x47')]=_0x2da1ff;if(_0x1ed0d2[_0xca7a('0x47')][_0xca7a('0x4d')]>0x0){_0x181111(_0x1ed0d2);}else{if(_0x51a412==![]){_0x181111();}else{_0x181111(_0x1ed0d2);}}});}});}
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js
index ef2a366..decabd7 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.model.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x1167dd,_0x1a8011){var _0xd37e5b=function(_0x2439be){while(--_0x2439be){_0x1167dd['push'](_0x1167dd['shift']());}};_0xd37e5b(++_0x1a8011);}(_0x814b,0x1a2));var _0xb814=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x814b[_0x2a56ad];return _0x425175;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x7a54,0x106));var _0x47a5=function(_0x20ecb4,_0x3c6af1){_0x20ecb4=_0x20ecb4-0x0;var _0x1fd61c=_0x7a54[_0x20ecb4];return _0x1fd61c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js
index e6e87d2..787684a 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.rpc.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1551=['ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','GetServicenowAccount','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x1ff6d1,_0x52f903){var _0x1554cd=function(_0x233f9d){while(--_0x233f9d){_0x1ff6d1['push'](_0x1ff6d1['shift']());}};_0x1554cd(++_0x52f903);}(_0x1551,0x12c));var _0x1155=function(_0x3a04ab,_0x31b9fd){_0x3a04ab=_0x3a04ab-0x0;var _0x4bff6d=_0x1551[_0x3a04ab];return _0x4bff6d;};'use strict';var _=require(_0x1155('0x0'));var util=require(_0x1155('0x1'));var moment=require(_0x1155('0x2'));var BPromise=require(_0x1155('0x3'));var rs=require(_0x1155('0x4'));var fs=require('fs');var Redis=require(_0x1155('0x5'));var db=require(_0x1155('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1155('0x7'))(_0x1155('0x8'));var config=require(_0x1155('0x9'));var jayson=require(_0x1155('0xa'));var client=jayson['client'][_0x1155('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29b0d2,_0x404ccb,_0x329307){return new BPromise(function(_0x4b572c,_0x1084f8){return client[_0x1155('0xc')](_0x29b0d2,_0x329307)[_0x1155('0xd')](function(_0x5ac777){logger[_0x1155('0xe')](_0x1155('0xf'),_0x404ccb,_0x1155('0x10'));logger[_0x1155('0x11')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x404ccb,_0x1155('0x10'),JSON[_0x1155('0x12')](_0x5ac777));if(_0x5ac777[_0x1155('0x13')]){if(_0x5ac777[_0x1155('0x13')]['code']===0x1f4){logger[_0x1155('0x13')](_0x1155('0xf'),_0x404ccb,_0x5ac777['error']['message']);return _0x1084f8(_0x5ac777['error'][_0x1155('0x14')]);}logger['error'](_0x1155('0xf'),_0x404ccb,_0x5ac777[_0x1155('0x13')][_0x1155('0x14')]);return _0x4b572c(_0x5ac777[_0x1155('0x13')][_0x1155('0x14')]);}else{logger[_0x1155('0xe')](_0x1155('0xf'),_0x404ccb,_0x1155('0x10'));_0x4b572c(_0x5ac777[_0x1155('0x15')][_0x1155('0x14')]);}})[_0x1155('0x16')](function(_0x4a3e59){logger[_0x1155('0x13')](_0x1155('0xf'),_0x404ccb,_0x4a3e59);_0x1084f8(_0x4a3e59);});});}exports['GetServicenowAccount']=function(_0x30c6ac){var _0x1db795=this;return new Promise(function(_0x1938cc,_0x249831){return db[_0x1155('0x17')][_0x1155('0x18')]({'raw':_0x30c6ac['options']?_0x30c6ac[_0x1155('0x19')][_0x1155('0x1a')]===undefined?!![]:![]:!![],'where':_0x30c6ac[_0x1155('0x19')]?_0x30c6ac[_0x1155('0x19')][_0x1155('0x1b')]||null:null,'attributes':_0x30c6ac[_0x1155('0x19')]?_0x30c6ac[_0x1155('0x19')][_0x1155('0x1c')]||null:null,'limit':_0x30c6ac[_0x1155('0x19')]?_0x30c6ac[_0x1155('0x19')]['limit']||null:null,'include':_0x30c6ac[_0x1155('0x19')]?_0x30c6ac[_0x1155('0x19')][_0x1155('0x1d')]?_['map'](_0x30c6ac[_0x1155('0x19')]['include'],function(_0x2420e3){return{'model':db[_0x2420e3['model']],'as':_0x2420e3['as'],'attributes':_0x2420e3['attributes'],'include':_0x2420e3[_0x1155('0x1d')]?_[_0x1155('0x1e')](_0x2420e3[_0x1155('0x1d')],function(_0x55374e){return{'model':db[_0x55374e[_0x1155('0x1f')]],'as':_0x55374e['as'],'attributes':_0x55374e[_0x1155('0x1c')],'include':_0x55374e['include']?_[_0x1155('0x1e')](_0x55374e[_0x1155('0x1d')],function(_0x3248cb){return{'model':db[_0x3248cb[_0x1155('0x1f')]],'as':_0x3248cb['as'],'attributes':_0x3248cb['attributes']};}):[]};}):[]};}):[]:[]})[_0x1155('0xd')](function(_0x298ade){logger['info'](_0x1155('0x20'),_0x30c6ac);logger[_0x1155('0x11')](_0x1155('0x20'),_0x30c6ac,JSON[_0x1155('0x12')](_0x298ade));_0x1938cc(_0x298ade);})[_0x1155('0x16')](function(_0x2cbe63){logger[_0x1155('0x13')](_0x1155('0x20'),_0x2cbe63[_0x1155('0x14')],_0x30c6ac);_0x249831(_0x1db795[_0x1155('0x13')](0x1f4,_0x2cbe63[_0x1155('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x2c7567){var _0x2496b2=this;return new Promise(function(_0x16e1ea,_0x3c9d7d){return db[_0x1155('0x17')][_0x1155('0x21')]({'raw':_0x2c7567[_0x1155('0x19')]?_0x2c7567[_0x1155('0x19')][_0x1155('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c7567[_0x1155('0x19')]?_0x2c7567[_0x1155('0x19')][_0x1155('0x1b')]||null:null,'attributes':_0x2c7567[_0x1155('0x19')]?_0x2c7567['options']['attributes']||null:null,'include':_0x2c7567[_0x1155('0x19')]?_0x2c7567[_0x1155('0x19')][_0x1155('0x1d')]?_[_0x1155('0x1e')](_0x2c7567['options'][_0x1155('0x1d')],function(_0x1c8df8){return{'model':db[_0x1c8df8[_0x1155('0x1f')]],'as':_0x1c8df8['as'],'attributes':_0x1c8df8['attributes'],'include':_0x1c8df8['include']?_['map'](_0x1c8df8['include'],function(_0x2a249f){return{'model':db[_0x2a249f[_0x1155('0x1f')]],'as':_0x2a249f['as'],'attributes':_0x2a249f['attributes'],'include':_0x2a249f[_0x1155('0x1d')]?_['map'](_0x2a249f['include'],function(_0x5310df){return{'model':db[_0x5310df[_0x1155('0x1f')]],'as':_0x5310df['as'],'attributes':_0x5310df['attributes']};}):[]};}):[]};}):[]:[]})[_0x1155('0xd')](function(_0x5f1ed4){logger[_0x1155('0xe')](_0x1155('0x22'),_0x2c7567);logger[_0x1155('0x11')](_0x1155('0x22'),_0x2c7567,JSON[_0x1155('0x12')](_0x5f1ed4));_0x16e1ea(_0x5f1ed4);})[_0x1155('0x16')](function(_0x4e84f8){logger['error'](_0x1155('0x22'),_0x4e84f8[_0x1155('0x14')],_0x2c7567);_0x3c9d7d(_0x2496b2[_0x1155('0x13')](0x1f4,_0x4e84f8[_0x1155('0x14')]));});});};
\ No newline at end of file
+var _0x6d6c=['info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x17b687,_0x5d1555){var _0x3d61e0=function(_0x5857ed){while(--_0x5857ed){_0x17b687['push'](_0x17b687['shift']());}};_0x3d61e0(++_0x5d1555);}(_0x6d6c,0x8d));var _0xc6d6=function(_0x38a3d6,_0x52e305){_0x38a3d6=_0x38a3d6-0x0;var _0x3768d7=_0x6d6c[_0x38a3d6];return _0x3768d7;};'use strict';var _=require(_0xc6d6('0x0'));var util=require(_0xc6d6('0x1'));var moment=require(_0xc6d6('0x2'));var BPromise=require(_0xc6d6('0x3'));var rs=require(_0xc6d6('0x4'));var fs=require('fs');var Redis=require(_0xc6d6('0x5'));var db=require(_0xc6d6('0x6'))['db'];var utils=require(_0xc6d6('0x7'));var logger=require(_0xc6d6('0x8'))('rpc');var config=require(_0xc6d6('0x9'));var jayson=require(_0xc6d6('0xa'));var client=jayson[_0xc6d6('0xb')][_0xc6d6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f7918,_0x18a19e,_0x328ad9){return new BPromise(function(_0x5bd935,_0xa69022){return client[_0xc6d6('0xd')](_0x4f7918,_0x328ad9)[_0xc6d6('0xe')](function(_0x4c284d){logger[_0xc6d6('0xf')](_0xc6d6('0x10'),_0x18a19e,_0xc6d6('0x11'));logger[_0xc6d6('0x12')](_0xc6d6('0x13'),_0x18a19e,'request\x20sent',JSON['stringify'](_0x4c284d));if(_0x4c284d[_0xc6d6('0x14')]){if(_0x4c284d['error'][_0xc6d6('0x15')]===0x1f4){logger[_0xc6d6('0x14')](_0xc6d6('0x10'),_0x18a19e,_0x4c284d[_0xc6d6('0x14')][_0xc6d6('0x16')]);return _0xa69022(_0x4c284d[_0xc6d6('0x14')][_0xc6d6('0x16')]);}logger[_0xc6d6('0x14')](_0xc6d6('0x10'),_0x18a19e,_0x4c284d[_0xc6d6('0x14')][_0xc6d6('0x16')]);return _0x5bd935(_0x4c284d['error']['message']);}else{logger[_0xc6d6('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x18a19e,_0xc6d6('0x11'));_0x5bd935(_0x4c284d[_0xc6d6('0x17')][_0xc6d6('0x16')]);}})[_0xc6d6('0x18')](function(_0x64186e){logger[_0xc6d6('0x14')](_0xc6d6('0x10'),_0x18a19e,_0x64186e);_0xa69022(_0x64186e);});});}exports[_0xc6d6('0x19')]=function(_0x46075a){var _0x4f1405=this;return new Promise(function(_0x575412,_0x2ae36d){return db[_0xc6d6('0x1a')][_0xc6d6('0x1b')]({'raw':_0x46075a[_0xc6d6('0x1c')]?_0x46075a[_0xc6d6('0x1c')][_0xc6d6('0x1d')]===undefined?!![]:![]:!![],'where':_0x46075a[_0xc6d6('0x1c')]?_0x46075a[_0xc6d6('0x1c')][_0xc6d6('0x1e')]||null:null,'attributes':_0x46075a[_0xc6d6('0x1c')]?_0x46075a[_0xc6d6('0x1c')][_0xc6d6('0x1f')]||null:null,'limit':_0x46075a['options']?_0x46075a[_0xc6d6('0x1c')][_0xc6d6('0x20')]||null:null,'include':_0x46075a[_0xc6d6('0x1c')]?_0x46075a[_0xc6d6('0x1c')]['include']?_[_0xc6d6('0x21')](_0x46075a[_0xc6d6('0x1c')][_0xc6d6('0x22')],function(_0x5876c3){return{'model':db[_0x5876c3['model']],'as':_0x5876c3['as'],'attributes':_0x5876c3['attributes'],'include':_0x5876c3[_0xc6d6('0x22')]?_['map'](_0x5876c3[_0xc6d6('0x22')],function(_0x468000){return{'model':db[_0x468000[_0xc6d6('0x23')]],'as':_0x468000['as'],'attributes':_0x468000[_0xc6d6('0x1f')],'include':_0x468000[_0xc6d6('0x22')]?_[_0xc6d6('0x21')](_0x468000[_0xc6d6('0x22')],function(_0xa2a778){return{'model':db[_0xa2a778['model']],'as':_0xa2a778['as'],'attributes':_0xa2a778[_0xc6d6('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f1000){logger[_0xc6d6('0xf')](_0xc6d6('0x19'),_0x46075a);logger['debug'](_0xc6d6('0x19'),_0x46075a,JSON[_0xc6d6('0x24')](_0x2f1000));_0x575412(_0x2f1000);})[_0xc6d6('0x18')](function(_0x332de4){logger[_0xc6d6('0x14')]('GetServicenowAccount',_0x332de4[_0xc6d6('0x16')],_0x46075a);_0x2ae36d(_0x4f1405[_0xc6d6('0x14')](0x1f4,_0x332de4[_0xc6d6('0x16')]));});});};exports[_0xc6d6('0x25')]=function(_0x5ccd39){var _0x2c7989=this;return new Promise(function(_0xac43e8,_0xb2c547){return db[_0xc6d6('0x1a')][_0xc6d6('0x26')]({'raw':_0x5ccd39[_0xc6d6('0x1c')]?_0x5ccd39['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ccd39[_0xc6d6('0x1c')]?_0x5ccd39[_0xc6d6('0x1c')][_0xc6d6('0x1e')]||null:null,'attributes':_0x5ccd39[_0xc6d6('0x1c')]?_0x5ccd39['options'][_0xc6d6('0x1f')]||null:null,'include':_0x5ccd39['options']?_0x5ccd39[_0xc6d6('0x1c')][_0xc6d6('0x22')]?_[_0xc6d6('0x21')](_0x5ccd39['options']['include'],function(_0x4bff2f){return{'model':db[_0x4bff2f[_0xc6d6('0x23')]],'as':_0x4bff2f['as'],'attributes':_0x4bff2f[_0xc6d6('0x1f')],'include':_0x4bff2f[_0xc6d6('0x22')]?_[_0xc6d6('0x21')](_0x4bff2f['include'],function(_0x2a1506){return{'model':db[_0x2a1506[_0xc6d6('0x23')]],'as':_0x2a1506['as'],'attributes':_0x2a1506[_0xc6d6('0x1f')],'include':_0x2a1506[_0xc6d6('0x22')]?_['map'](_0x2a1506[_0xc6d6('0x22')],function(_0x182431){return{'model':db[_0x182431[_0xc6d6('0x23')]],'as':_0x182431['as'],'attributes':_0x182431[_0xc6d6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc6d6('0xe')](function(_0x2835ad){logger[_0xc6d6('0xf')](_0xc6d6('0x25'),_0x5ccd39);logger[_0xc6d6('0x12')]('ShowServicenowAccount',_0x5ccd39,JSON['stringify'](_0x2835ad));_0xac43e8(_0x2835ad);})['catch'](function(_0x5f342c){logger[_0xc6d6('0x14')]('ShowServicenowAccount',_0x5f342c['message'],_0x5ccd39);_0xb2c547(_0x2c7989['error'](0x1f4,_0x5f342c[_0xc6d6('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js
index b363847..e01ec85 100644
--- a/server/api/intServicenowConfiguration/index.js
+++ b/server/api/intServicenowConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x90b7=['index','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get'];(function(_0x4712ef,_0x3e5e22){var _0x30ec75=function(_0x237589){while(--_0x237589){_0x4712ef['push'](_0x4712ef['shift']());}};_0x30ec75(++_0x3e5e22);}(_0x90b7,0x99));var _0x790b=function(_0x3b5984,_0x44dd34){_0x3b5984=_0x3b5984-0x0;var _0x3fcbf3=_0x90b7[_0x3b5984];return _0x3fcbf3;};'use strict';var multer=require('multer');var util=require(_0x790b('0x0'));var path=require(_0x790b('0x1'));var timeout=require(_0x790b('0x2'));var express=require('express');var router=express[_0x790b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x790b('0x4'));var config=require(_0x790b('0x5'));var controller=require(_0x790b('0x6'));router[_0x790b('0x7')]('/',auth['isAuthenticated'](),controller[_0x790b('0x8')]);router['get']('/:id',auth[_0x790b('0x9')](),controller[_0x790b('0xa')]);router['get']('/:id/fields',auth[_0x790b('0x9')](),controller[_0x790b('0xb')]);router[_0x790b('0x7')](_0x790b('0xc'),auth['isAuthenticated'](),controller[_0x790b('0xd')]);router[_0x790b('0x7')](_0x790b('0xe'),auth[_0x790b('0x9')](),controller[_0x790b('0xf')]);router[_0x790b('0x10')]('/',auth[_0x790b('0x9')](),controller[_0x790b('0x11')]);router['put']('/:id',auth[_0x790b('0x9')](),controller[_0x790b('0x12')]);router[_0x790b('0x13')](_0x790b('0x14'),auth['isAuthenticated'](),controller[_0x790b('0x15')]);module[_0x790b('0x16')]=router;
\ No newline at end of file
+var _0xb0fa=['getSubjects','getDescriptions','post','create','put','update','destroy','multer','util','connect-timeout','Router','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x1dd8bb,_0x189308){var _0x52ccbf=function(_0x428238){while(--_0x428238){_0x1dd8bb['push'](_0x1dd8bb['shift']());}};_0x52ccbf(++_0x189308);}(_0xb0fa,0x16c));var _0xab0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0fa[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xab0f('0x0'));var util=require(_0xab0f('0x1'));var path=require('path');var timeout=require(_0xab0f('0x2'));var express=require('express');var router=express[_0xab0f('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xab0f('0x4'));var controller=require(_0xab0f('0x5'));router[_0xab0f('0x6')]('/',auth[_0xab0f('0x7')](),controller[_0xab0f('0x8')]);router['get'](_0xab0f('0x9'),auth[_0xab0f('0x7')](),controller[_0xab0f('0xa')]);router[_0xab0f('0x6')](_0xab0f('0xb'),auth['isAuthenticated'](),controller[_0xab0f('0xc')]);router[_0xab0f('0x6')](_0xab0f('0xd'),auth[_0xab0f('0x7')](),controller[_0xab0f('0xe')]);router[_0xab0f('0x6')]('/:id/descriptions',auth[_0xab0f('0x7')](),controller[_0xab0f('0xf')]);router[_0xab0f('0x10')]('/',auth[_0xab0f('0x7')](),controller[_0xab0f('0x11')]);router[_0xab0f('0x12')](_0xab0f('0x9'),auth[_0xab0f('0x7')](),controller[_0xab0f('0x13')]);router['delete'](_0xab0f('0x9'),auth[_0xab0f('0x7')](),controller[_0xab0f('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
index 7b3d82a..7c61045 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8b88=['exports','STRING','sequelize'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x8b88,0x17f));var _0x88b8=function(_0xc52705,_0x842a2c){_0xc52705=_0xc52705-0x0;var _0x59dfa5=_0x8b88[_0xc52705];return _0x59dfa5;};'use strict';var Sequelize=require(_0x88b8('0x0'));module[_0x88b8('0x1')]={'name':{'type':Sequelize[_0x88b8('0x2')]},'description':{'type':Sequelize[_0x88b8('0x2')]}};
\ No newline at end of file
+var _0xc0fb=['sequelize','STRING'];(function(_0x592a9a,_0x1d4355){var _0x2814d1=function(_0x4ade1d){while(--_0x4ade1d){_0x592a9a['push'](_0x592a9a['shift']());}};_0x2814d1(++_0x1d4355);}(_0xc0fb,0x134));var _0xbc0f=function(_0x5743e6,_0x98a50f){_0x5743e6=_0x5743e6-0x0;var _0x6f3cde=_0xc0fb[_0x5743e6];return _0x6f3cde;};'use strict';var Sequelize=require(_0xbc0f('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc0f('0x1')]},'description':{'type':Sequelize[_0xbc0f('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
index 095cb92..de65a91 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['params','options','find','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','ServicenowConfiguration,\x20%s,\x20%s','message','catch','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','sendStatus','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','ServicenowConfiguration','includeAll','include','findAll','show'];(function(_0x40c4a5,_0xa7bba7){var _0x4717e3=function(_0x1bdb37){while(--_0x1bdb37){_0x40c4a5['push'](_0x40c4a5['shift']());}};_0x4717e3(++_0xa7bba7);}(_0x2ef3,0xba));var _0x32ef=function(_0x1debf6,_0x47f160){_0x1debf6=_0x1debf6-0x0;var _0x44be6f=_0x2ef3[_0x1debf6];return _0x44be6f;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x32ef('0x18'));var client=jayson['client'][_0x32ef('0x19')]({'port':0x232a});function checkPasswordPattern(_0x49d590,_0x3e98df,_0x1ef1ae){if(_0x1ef1ae){var _0x5c3eb9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c3eb9['test'](_0x3e98df)){return _0x49d590;}else{throw new Error(_0x32ef('0x1a'));}}else{return _0x49d590;}}function respondWithRpcPromise(_0x4d8009,_0x326fce,_0x40a6e6,_0x93d492){return new BPromise(function(_0x54c7f5,_0x57aff1){var _0x55bf0b=_0x93d492||client;return _0x55bf0b['request'](_0x4d8009,_0x40a6e6)[_0x32ef('0x1b')](function(_0x3950e6){logger[_0x32ef('0x1c')]('ServicenowConfiguration,\x20%s,\x20%s',_0x326fce,'request\x20sent');logger[_0x32ef('0x1d')](_0x32ef('0x1e'),_0x326fce,_0x32ef('0x1f'),JSON['stringify'](_0x3950e6));if(_0x3950e6[_0x32ef('0x20')]){if(_0x3950e6[_0x32ef('0x20')]['code']===0x1f4){logger[_0x32ef('0x20')](_0x32ef('0x21'),_0x326fce,_0x3950e6[_0x32ef('0x20')][_0x32ef('0x22')]);return _0x57aff1(_0x3950e6[_0x32ef('0x20')][_0x32ef('0x22')]);}logger['error'](_0x32ef('0x21'),_0x326fce,_0x3950e6['error'][_0x32ef('0x22')]);return _0x54c7f5(_0x3950e6[_0x32ef('0x20')]['message']);}else{logger[_0x32ef('0x1c')](_0x32ef('0x21'),_0x326fce,_0x32ef('0x1f'));_0x54c7f5(_0x3950e6['result']['message']);}})[_0x32ef('0x23')](function(_0xb30fab){logger[_0x32ef('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x326fce,_0xb30fab);_0x57aff1(_0xb30fab);});});}function respondWithStatusCode(_0x59585f,_0x19ea6){_0x19ea6=_0x19ea6||0xcc;return function(_0x4d584b){if(_0x4d584b){return _0x59585f['sendStatus'](_0x19ea6);}return _0x59585f[_0x32ef('0x24')](_0x19ea6)[_0x32ef('0x25')]();};}function respondWithResult(_0x371540,_0x1dbe98){_0x1dbe98=_0x1dbe98||0xc8;return function(_0x15ce54){if(_0x15ce54){return _0x371540[_0x32ef('0x24')](_0x1dbe98)[_0x32ef('0x26')](_0x15ce54);}};}function respondWithFilteredResult(_0x38aed5,_0x338f19){return function(_0x2f52d7){if(_0x2f52d7){var _0x1335e2=_0x2f52d7[_0x32ef('0x27')],_0xba4b3f=_0x338f19['offset'],_0x5a88a5=_0x338f19[_0x32ef('0x28')]+_0x338f19[_0x32ef('0x29')],_0xd65fde;if(_0x5a88a5>=_0x1335e2){_0x5a88a5=_0x1335e2;_0xd65fde=0xc8;}else{_0xd65fde=0xce;}_0x38aed5[_0x32ef('0x24')](_0xd65fde);return _0x38aed5[_0x32ef('0x2a')]('Content-Range',_0xba4b3f+'-'+_0x5a88a5+'/'+_0x1335e2)[_0x32ef('0x26')](_0x2f52d7);}return null;};}function patchUpdates(_0x22bf86){return function(_0x31dbc3){try{jsonpatch[_0x32ef('0x2b')](_0x31dbc3,_0x22bf86,!![]);}catch(_0x1b668a){return BPromise[_0x32ef('0x2c')](_0x1b668a);}return _0x31dbc3[_0x32ef('0x2d')]();};}function saveUpdates(_0x575f3e,_0x36ac37){return function(_0x537214){if(_0x537214){return _0x537214[_0x32ef('0x2e')](_0x575f3e)[_0x32ef('0x1b')](function(_0x5a9565){return _0x5a9565;});}return null;};}function removeEntity(_0xcc2efb,_0x17e4d1){return function(_0x3b00ad){if(_0x3b00ad){return _0x3b00ad[_0x32ef('0x2f')]()[_0x32ef('0x1b')](function(){_0xcc2efb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5eb5,_0x5dadf7){return function(_0x643dc4){if(!_0x643dc4){_0x2a5eb5[_0x32ef('0x30')](0x194);}return _0x643dc4;};}function handleError(_0x2f1349,_0x390670){_0x390670=_0x390670||0x1f4;return function(_0x389583){logger[_0x32ef('0x20')](_0x389583['stack']);if(_0x389583['name']){delete _0x389583['name'];}_0x2f1349[_0x32ef('0x24')](_0x390670)[_0x32ef('0x31')](_0x389583);};}exports[_0x32ef('0x32')]=function(_0x5f2443,_0x4fb402){var _0x1c3633={},_0x2bd8a9={},_0x410334={'count':0x0,'rows':[]};var _0x480348=db['ServicenowConfiguration'][_0x32ef('0x33')];_0x2bd8a9[_0x32ef('0x34')]=_[_0x32ef('0x35')](_0x480348);_0x2bd8a9[_0x32ef('0x36')]=_[_0x32ef('0x35')](_0x5f2443[_0x32ef('0x36')]);_0x2bd8a9[_0x32ef('0x37')]=_[_0x32ef('0x38')](_0x2bd8a9[_0x32ef('0x34')],_0x2bd8a9['query']);_0x1c3633[_0x32ef('0x39')]=_[_0x32ef('0x38')](_0x2bd8a9[_0x32ef('0x34')],qs['fields'](_0x5f2443[_0x32ef('0x36')][_0x32ef('0x3a')]));_0x1c3633[_0x32ef('0x39')]=_0x1c3633[_0x32ef('0x39')][_0x32ef('0x3b')]?_0x1c3633[_0x32ef('0x39')]:_0x2bd8a9[_0x32ef('0x34')];if(!_0x5f2443[_0x32ef('0x36')][_0x32ef('0x3c')](_0x32ef('0x3d'))){_0x1c3633[_0x32ef('0x29')]=qs[_0x32ef('0x29')](_0x5f2443['query'][_0x32ef('0x29')]);_0x1c3633[_0x32ef('0x28')]=qs[_0x32ef('0x28')](_0x5f2443[_0x32ef('0x36')][_0x32ef('0x28')]);}_0x1c3633[_0x32ef('0x3e')]=qs[_0x32ef('0x3f')](_0x5f2443['query']['sort']);_0x1c3633[_0x32ef('0x40')]=qs[_0x32ef('0x37')](_[_0x32ef('0x41')](_0x5f2443[_0x32ef('0x36')],_0x2bd8a9['filters']));if(_0x5f2443[_0x32ef('0x36')][_0x32ef('0x42')]){_0x1c3633['where']=_[_0x32ef('0x43')](_0x1c3633['where'],{'$or':_[_0x32ef('0x44')](_0x480348,function(_0x100ec7){if(_0x100ec7[_0x32ef('0x45')][_0x32ef('0x46')]!==_0x32ef('0x47')){var _0x2310ae={};_0x2310ae[_0x100ec7[_0x32ef('0x48')]]={'$like':'%'+_0x5f2443[_0x32ef('0x36')][_0x32ef('0x42')]+'%'};return _0x2310ae;}})});}_0x1c3633=_[_0x32ef('0x43')]({},_0x1c3633,_0x5f2443['options']);var _0x18b943={'where':_0x1c3633['where']};return db[_0x32ef('0x49')][_0x32ef('0x27')](_0x18b943)[_0x32ef('0x1b')](function(_0x4d8393){_0x410334[_0x32ef('0x27')]=_0x4d8393;if(_0x5f2443[_0x32ef('0x36')][_0x32ef('0x4a')]){_0x1c3633[_0x32ef('0x4b')]=[{'all':!![]}];}return db[_0x32ef('0x49')][_0x32ef('0x4c')](_0x1c3633);})[_0x32ef('0x1b')](function(_0x47dbe1){_0x410334['rows']=_0x47dbe1;return _0x410334;})[_0x32ef('0x1b')](respondWithFilteredResult(_0x4fb402,_0x1c3633))[_0x32ef('0x23')](handleError(_0x4fb402,null));};exports[_0x32ef('0x4d')]=function(_0x13b270,_0x209361){var _0xd67dc9={'raw':![],'where':{'id':_0x13b270[_0x32ef('0x4e')]['id']}},_0x44ad11={};_0x44ad11[_0x32ef('0x34')]=_[_0x32ef('0x35')](db[_0x32ef('0x49')][_0x32ef('0x33')]);_0x44ad11[_0x32ef('0x36')]=_['keys'](_0x13b270[_0x32ef('0x36')]);_0x44ad11[_0x32ef('0x37')]=_[_0x32ef('0x38')](_0x44ad11[_0x32ef('0x34')],_0x44ad11[_0x32ef('0x36')]);_0xd67dc9[_0x32ef('0x39')]=_[_0x32ef('0x38')](_0x44ad11[_0x32ef('0x34')],qs[_0x32ef('0x3a')](_0x13b270[_0x32ef('0x36')][_0x32ef('0x3a')]));_0xd67dc9[_0x32ef('0x39')]=_0xd67dc9[_0x32ef('0x39')][_0x32ef('0x3b')]?_0xd67dc9[_0x32ef('0x39')]:_0x44ad11[_0x32ef('0x34')];if(_0x13b270[_0x32ef('0x36')][_0x32ef('0x4a')]){_0xd67dc9['include']=[{'all':!![]}];}_0xd67dc9=_['merge']({},_0xd67dc9,_0x13b270[_0x32ef('0x4f')]);return db[_0x32ef('0x49')][_0x32ef('0x50')](_0xd67dc9)[_0x32ef('0x1b')](handleEntityNotFound(_0x209361,null))[_0x32ef('0x1b')](respondWithResult(_0x209361,null))[_0x32ef('0x23')](handleError(_0x209361,null));};exports[_0x32ef('0x51')]=function(_0x1f105a,_0x15b640){return db[_0x32ef('0x49')][_0x32ef('0x51')](_0x1f105a['body'],{})[_0x32ef('0x1b')](respondWithResult(_0x15b640,0xc9))[_0x32ef('0x23')](handleError(_0x15b640,null));};exports[_0x32ef('0x2e')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x52')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x49')][_0x32ef('0x50')]({'where':{'id':_0x3fe01f[_0x32ef('0x4e')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x1b')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x1b')](respondWithResult(_0x38314a,null))[_0x32ef('0x23')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x49')][_0x32ef('0x50')]({'where':{'id':_0x206ad5[_0x32ef('0x4e')]['id']}})[_0x32ef('0x1b')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x1b')](removeEntity(_0x59e5f9,null))[_0x32ef('0x23')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x53')]=function(_0x56260f,_0x56cc75,_0xdfa103){var _0x52232a={};var _0x4fbab6={};var _0xb519e9;var _0x89d0b3;return db[_0x32ef('0x49')][_0x32ef('0x54')]({'where':{'id':_0x56260f[_0x32ef('0x4e')]['id']}})[_0x32ef('0x1b')](handleEntityNotFound(_0x56cc75,null))[_0x32ef('0x1b')](function(_0x4249c3){if(_0x4249c3){_0xb519e9=_0x4249c3;_0x4fbab6[_0x32ef('0x34')]=_[_0x32ef('0x35')](db['ServicenowField']['rawAttributes']);_0x4fbab6[_0x32ef('0x36')]=_[_0x32ef('0x35')](_0x56260f['query']);_0x4fbab6[_0x32ef('0x37')]=_[_0x32ef('0x38')](_0x4fbab6[_0x32ef('0x34')],_0x4fbab6['query']);_0x52232a[_0x32ef('0x39')]=_[_0x32ef('0x38')](_0x4fbab6[_0x32ef('0x34')],qs['fields'](_0x56260f['query'][_0x32ef('0x3a')]));_0x52232a['attributes']=_0x52232a[_0x32ef('0x39')]['length']?_0x52232a['attributes']:_0x4fbab6[_0x32ef('0x34')];_0x52232a[_0x32ef('0x3e')]=qs[_0x32ef('0x3f')](_0x56260f['query'][_0x32ef('0x3f')]);_0x52232a[_0x32ef('0x40')]=qs[_0x32ef('0x37')](_['pick'](_0x56260f[_0x32ef('0x36')],_0x4fbab6[_0x32ef('0x37')]));if(_0x56260f['query']['filter']){_0x52232a[_0x32ef('0x40')]=_[_0x32ef('0x43')](_0x52232a[_0x32ef('0x40')],{'$or':_[_0x32ef('0x44')](_0x52232a[_0x32ef('0x39')],function(_0x40700e){var _0x4c89e8={};_0x4c89e8[_0x40700e]={'$like':'%'+_0x56260f[_0x32ef('0x36')][_0x32ef('0x42')]+'%'};return _0x4c89e8;})});}_0x52232a=_[_0x32ef('0x43')]({},_0x52232a,_0x56260f[_0x32ef('0x4f')]);return _0xb519e9[_0x32ef('0x53')](_0x52232a);}})[_0x32ef('0x1b')](function(_0x1dc755){if(_0x1dc755){_0x89d0b3=_0x1dc755[_0x32ef('0x3b')];if(!_0x56260f[_0x32ef('0x36')]['hasOwnProperty'](_0x32ef('0x3d'))){_0x52232a[_0x32ef('0x29')]=qs[_0x32ef('0x29')](_0x56260f[_0x32ef('0x36')][_0x32ef('0x29')]);_0x52232a['offset']=qs['offset'](_0x56260f[_0x32ef('0x36')][_0x32ef('0x28')]);}return _0xb519e9[_0x32ef('0x53')](_0x52232a);}})[_0x32ef('0x1b')](function(_0x1a8bad){if(_0x1a8bad){return _0x1a8bad?{'count':_0x89d0b3,'rows':_0x1a8bad}:null;}})['then'](respondWithResult(_0x56cc75,null))[_0x32ef('0x23')](handleError(_0x56cc75,null));};exports['getSubjects']=function(_0x216e2f,_0x1ee66b,_0x48b6f4){var _0x5402b4={};var _0x2c9f7a={};var _0x1538d0;var _0x2e0873;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x216e2f[_0x32ef('0x4e')]['id']}})[_0x32ef('0x1b')](handleEntityNotFound(_0x1ee66b,null))[_0x32ef('0x1b')](function(_0x416e62){if(_0x416e62){_0x1538d0=_0x416e62;_0x2c9f7a['model']=_[_0x32ef('0x35')](db[_0x32ef('0x55')][_0x32ef('0x33')]);_0x2c9f7a[_0x32ef('0x36')]=_[_0x32ef('0x35')](_0x216e2f[_0x32ef('0x36')]);_0x2c9f7a[_0x32ef('0x37')]=_[_0x32ef('0x38')](_0x2c9f7a[_0x32ef('0x34')],_0x2c9f7a[_0x32ef('0x36')]);_0x5402b4[_0x32ef('0x39')]=_[_0x32ef('0x38')](_0x2c9f7a['model'],qs['fields'](_0x216e2f[_0x32ef('0x36')][_0x32ef('0x3a')]));_0x5402b4['attributes']=_0x5402b4[_0x32ef('0x39')]['length']?_0x5402b4[_0x32ef('0x39')]:_0x2c9f7a[_0x32ef('0x34')];_0x5402b4[_0x32ef('0x3e')]=qs['sort'](_0x216e2f[_0x32ef('0x36')]['sort']);_0x5402b4[_0x32ef('0x40')]=qs[_0x32ef('0x37')](_['pick'](_0x216e2f['query'],_0x2c9f7a[_0x32ef('0x37')]));if(_0x216e2f['query'][_0x32ef('0x42')]){_0x5402b4['where']=_[_0x32ef('0x43')](_0x5402b4[_0x32ef('0x40')],{'$or':_[_0x32ef('0x44')](_0x5402b4['attributes'],function(_0x48b35e){var _0x4f1b94={};_0x4f1b94[_0x48b35e]={'$like':'%'+_0x216e2f[_0x32ef('0x36')]['filter']+'%'};return _0x4f1b94;})});}_0x5402b4=_[_0x32ef('0x43')]({},_0x5402b4,_0x216e2f[_0x32ef('0x4f')]);return _0x1538d0[_0x32ef('0x56')](_0x5402b4);}})[_0x32ef('0x1b')](function(_0x339184){if(_0x339184){_0x2e0873=_0x339184[_0x32ef('0x3b')];if(!_0x216e2f['query'][_0x32ef('0x3c')]('nolimit')){_0x5402b4['limit']=qs[_0x32ef('0x29')](_0x216e2f['query'][_0x32ef('0x29')]);_0x5402b4[_0x32ef('0x28')]=qs['offset'](_0x216e2f[_0x32ef('0x36')][_0x32ef('0x28')]);}return _0x1538d0[_0x32ef('0x56')](_0x5402b4);}})[_0x32ef('0x1b')](function(_0x1fa36d){if(_0x1fa36d){return _0x1fa36d?{'count':_0x2e0873,'rows':_0x1fa36d}:null;}})[_0x32ef('0x1b')](respondWithResult(_0x1ee66b,null))['catch'](handleError(_0x1ee66b,null));};exports['getDescriptions']=function(_0x35b10d,_0x5e0b55,_0x41bbe1){var _0x266688={};var _0x114d8e={};var _0x1782a5;var _0x238e4d;return db[_0x32ef('0x49')]['findOne']({'where':{'id':_0x35b10d[_0x32ef('0x4e')]['id']}})[_0x32ef('0x1b')](handleEntityNotFound(_0x5e0b55,null))[_0x32ef('0x1b')](function(_0x2aeb11){if(_0x2aeb11){_0x1782a5=_0x2aeb11;_0x114d8e[_0x32ef('0x34')]=_['keys'](db['ServicenowField'][_0x32ef('0x33')]);_0x114d8e[_0x32ef('0x36')]=_['keys'](_0x35b10d[_0x32ef('0x36')]);_0x114d8e[_0x32ef('0x37')]=_[_0x32ef('0x38')](_0x114d8e[_0x32ef('0x34')],_0x114d8e[_0x32ef('0x36')]);_0x266688[_0x32ef('0x39')]=_[_0x32ef('0x38')](_0x114d8e[_0x32ef('0x34')],qs[_0x32ef('0x3a')](_0x35b10d['query'][_0x32ef('0x3a')]));_0x266688[_0x32ef('0x39')]=_0x266688['attributes'][_0x32ef('0x3b')]?_0x266688['attributes']:_0x114d8e[_0x32ef('0x34')];_0x266688['order']=qs[_0x32ef('0x3f')](_0x35b10d[_0x32ef('0x36')][_0x32ef('0x3f')]);_0x266688[_0x32ef('0x40')]=qs['filters'](_[_0x32ef('0x41')](_0x35b10d[_0x32ef('0x36')],_0x114d8e[_0x32ef('0x37')]));if(_0x35b10d['query']['filter']){_0x266688['where']=_[_0x32ef('0x43')](_0x266688[_0x32ef('0x40')],{'$or':_[_0x32ef('0x44')](_0x266688[_0x32ef('0x39')],function(_0x3cc90c){var _0x5a1696={};_0x5a1696[_0x3cc90c]={'$like':'%'+_0x35b10d[_0x32ef('0x36')]['filter']+'%'};return _0x5a1696;})});}_0x266688=_[_0x32ef('0x43')]({},_0x266688,_0x35b10d[_0x32ef('0x4f')]);return _0x1782a5[_0x32ef('0x57')](_0x266688);}})['then'](function(_0x14399d){if(_0x14399d){_0x238e4d=_0x14399d[_0x32ef('0x3b')];if(!_0x35b10d[_0x32ef('0x36')][_0x32ef('0x3c')](_0x32ef('0x3d'))){_0x266688['limit']=qs[_0x32ef('0x29')](_0x35b10d['query'][_0x32ef('0x29')]);_0x266688[_0x32ef('0x28')]=qs['offset'](_0x35b10d['query'][_0x32ef('0x28')]);}return _0x1782a5[_0x32ef('0x57')](_0x266688);}})[_0x32ef('0x1b')](function(_0x3b9896){if(_0x3b9896){return _0x3b9896?{'count':_0x238e4d,'rows':_0x3b9896}:null;}})['then'](respondWithResult(_0x5e0b55,null))[_0x32ef('0x23')](handleError(_0x5e0b55,null));};
\ No newline at end of file
+var _0xadb5=['request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','index','rawAttributes','keys','filters','intersection','query','model','fields','attributes','length','where','pick','filter','map','type','key','VIRTUAL','field','ServicenowConfiguration','count','includeAll','include','show','params','options','find','create','body','destroy','getFields','findOne','ServicenowField','sort','merge','order','getSubjects','hasOwnProperty','getDescriptions','nolimit','eml-format','zip-dir','fast-json-patch'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xadb5,0xad));var _0x5adb=function(_0x31f0f9,_0x5c7656){_0x31f0f9=_0x31f0f9-0x0;var _0x39b24b=_0xadb5[_0x31f0f9];return _0x39b24b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5adb('0x14'));var utils=require(_0x5adb('0x15'));var config=require(_0x5adb('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5adb('0x17'));var client=jayson['client'][_0x5adb('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5433bf,_0x8cfcc6,_0x39a0b3){if(_0x39a0b3){var _0x44abe3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44abe3['test'](_0x8cfcc6)){return _0x5433bf;}else{throw new Error(_0x5adb('0x19'));}}else{return _0x5433bf;}}function respondWithRpcPromise(_0x34af2c,_0xf82f72,_0x5263ec,_0x2312de){return new BPromise(function(_0x518823,_0x367d82){var _0x42a482=_0x2312de||client;return _0x42a482[_0x5adb('0x1a')](_0x34af2c,_0x5263ec)[_0x5adb('0x1b')](function(_0x1c0f97){logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));logger[_0x5adb('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0xf82f72,_0x5adb('0x1e'),JSON['stringify'](_0x1c0f97));if(_0x1c0f97[_0x5adb('0x20')]){if(_0x1c0f97['error'][_0x5adb('0x21')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);return _0x367d82(_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);}logger[_0x5adb('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')]['message']);return _0x518823(_0x1c0f97['error'][_0x5adb('0x22')]);}else{logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));_0x518823(_0x1c0f97[_0x5adb('0x23')][_0x5adb('0x22')]);}})[_0x5adb('0x24')](function(_0x4ca150){logger[_0x5adb('0x20')](_0x5adb('0x1d'),_0xf82f72,_0x4ca150);_0x367d82(_0x4ca150);});});}function respondWithStatusCode(_0x3220cd,_0x3839fb){_0x3839fb=_0x3839fb||0xcc;return function(_0xeb556c){if(_0xeb556c){return _0x3220cd['sendStatus'](_0x3839fb);}return _0x3220cd[_0x5adb('0x25')](_0x3839fb)[_0x5adb('0x26')]();};}function respondWithResult(_0x5aed76,_0x1feecf){_0x1feecf=_0x1feecf||0xc8;return function(_0x1ded9f){if(_0x1ded9f){return _0x5aed76[_0x5adb('0x25')](_0x1feecf)['json'](_0x1ded9f);}};}function respondWithFilteredResult(_0x13ad1d,_0xbe21b1){return function(_0x3a4fca){if(_0x3a4fca){var _0x2c64a3=_0x3a4fca['count'],_0x36459b=_0xbe21b1['offset'],_0x1c06c4=_0xbe21b1[_0x5adb('0x27')]+_0xbe21b1[_0x5adb('0x28')],_0x4a5d46;if(_0x1c06c4>=_0x2c64a3){_0x1c06c4=_0x2c64a3;_0x4a5d46=0xc8;}else{_0x4a5d46=0xce;}_0x13ad1d[_0x5adb('0x25')](_0x4a5d46);return _0x13ad1d[_0x5adb('0x29')](_0x5adb('0x2a'),_0x36459b+'-'+_0x1c06c4+'/'+_0x2c64a3)['json'](_0x3a4fca);}return null;};}function patchUpdates(_0x11ec2a){return function(_0x34b793){try{jsonpatch[_0x5adb('0x2b')](_0x34b793,_0x11ec2a,!![]);}catch(_0x3b1fed){return BPromise[_0x5adb('0x2c')](_0x3b1fed);}return _0x34b793[_0x5adb('0x2d')]();};}function saveUpdates(_0x28190d,_0x28bf1f){return function(_0x138bf6){if(_0x138bf6){return _0x138bf6[_0x5adb('0x2e')](_0x28190d)['then'](function(_0x2e46ce){return _0x2e46ce;});}return null;};}function removeEntity(_0x4c8b2e,_0x12424d){return function(_0x20cde6){if(_0x20cde6){return _0x20cde6['destroy']()[_0x5adb('0x1b')](function(){_0x4c8b2e[_0x5adb('0x25')](0xcc)[_0x5adb('0x26')]();});}};}function handleEntityNotFound(_0x4a3661,_0x173789){return function(_0x14cf00){if(!_0x14cf00){_0x4a3661['sendStatus'](0x194);}return _0x14cf00;};}function handleError(_0x5bb227,_0x1ed9ea){_0x1ed9ea=_0x1ed9ea||0x1f4;return function(_0x49dd03){logger[_0x5adb('0x20')](_0x49dd03[_0x5adb('0x2f')]);if(_0x49dd03[_0x5adb('0x30')]){delete _0x49dd03[_0x5adb('0x30')];}_0x5bb227[_0x5adb('0x25')](_0x1ed9ea)['send'](_0x49dd03);};}exports[_0x5adb('0x31')]=function(_0x215b88,_0x1c3a5c){var _0x54851b={},_0x4c8870={},_0x32eb69={'count':0x0,'rows':[]};var _0x5d1baa=db['ServicenowConfiguration'][_0x5adb('0x32')];_0x4c8870['model']=_[_0x5adb('0x33')](_0x5d1baa);_0x4c8870['query']=_[_0x5adb('0x33')](_0x215b88['query']);_0x4c8870[_0x5adb('0x34')]=_[_0x5adb('0x35')](_0x4c8870['model'],_0x4c8870[_0x5adb('0x36')]);_0x54851b['attributes']=_[_0x5adb('0x35')](_0x4c8870[_0x5adb('0x37')],qs[_0x5adb('0x38')](_0x215b88['query'][_0x5adb('0x38')]));_0x54851b[_0x5adb('0x39')]=_0x54851b[_0x5adb('0x39')][_0x5adb('0x3a')]?_0x54851b[_0x5adb('0x39')]:_0x4c8870['model'];if(!_0x215b88['query']['hasOwnProperty']('nolimit')){_0x54851b[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x28')]);_0x54851b[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x27')]);}_0x54851b['order']=qs['sort'](_0x215b88[_0x5adb('0x36')]['sort']);_0x54851b[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_[_0x5adb('0x3c')](_0x215b88[_0x5adb('0x36')],_0x4c8870[_0x5adb('0x34')]));if(_0x215b88['query'][_0x5adb('0x3d')]){_0x54851b[_0x5adb('0x3b')]=_['merge'](_0x54851b[_0x5adb('0x3b')],{'$or':_[_0x5adb('0x3e')](_0x5d1baa,function(_0x5833c8){if(_0x5833c8[_0x5adb('0x3f')][_0x5adb('0x40')]!==_0x5adb('0x41')){var _0x35c379={};_0x35c379[_0x5833c8[_0x5adb('0x42')]]={'$like':'%'+_0x215b88[_0x5adb('0x36')][_0x5adb('0x3d')]+'%'};return _0x35c379;}})});}_0x54851b=_['merge']({},_0x54851b,_0x215b88['options']);var _0x26a656={'where':_0x54851b[_0x5adb('0x3b')]};return db[_0x5adb('0x43')][_0x5adb('0x44')](_0x26a656)['then'](function(_0x507e48){_0x32eb69[_0x5adb('0x44')]=_0x507e48;if(_0x215b88[_0x5adb('0x36')][_0x5adb('0x45')]){_0x54851b[_0x5adb('0x46')]=[{'all':!![]}];}return db[_0x5adb('0x43')]['findAll'](_0x54851b);})[_0x5adb('0x1b')](function(_0x437f52){_0x32eb69['rows']=_0x437f52;return _0x32eb69;})[_0x5adb('0x1b')](respondWithFilteredResult(_0x1c3a5c,_0x54851b))[_0x5adb('0x24')](handleError(_0x1c3a5c,null));};exports[_0x5adb('0x47')]=function(_0x24758f,_0x186bd2){var _0x3a5409={'raw':![],'where':{'id':_0x24758f[_0x5adb('0x48')]['id']}},_0x39840e={};_0x39840e['model']=_[_0x5adb('0x33')](db['ServicenowConfiguration']['rawAttributes']);_0x39840e['query']=_[_0x5adb('0x33')](_0x24758f[_0x5adb('0x36')]);_0x39840e[_0x5adb('0x34')]=_['intersection'](_0x39840e[_0x5adb('0x37')],_0x39840e['query']);_0x3a5409[_0x5adb('0x39')]=_[_0x5adb('0x35')](_0x39840e[_0x5adb('0x37')],qs['fields'](_0x24758f[_0x5adb('0x36')]['fields']));_0x3a5409[_0x5adb('0x39')]=_0x3a5409[_0x5adb('0x39')]['length']?_0x3a5409[_0x5adb('0x39')]:_0x39840e[_0x5adb('0x37')];if(_0x24758f[_0x5adb('0x36')][_0x5adb('0x45')]){_0x3a5409[_0x5adb('0x46')]=[{'all':!![]}];}_0x3a5409=_['merge']({},_0x3a5409,_0x24758f[_0x5adb('0x49')]);return db[_0x5adb('0x43')][_0x5adb('0x4a')](_0x3a5409)[_0x5adb('0x1b')](handleEntityNotFound(_0x186bd2,null))['then'](respondWithResult(_0x186bd2,null))[_0x5adb('0x24')](handleError(_0x186bd2,null));};exports[_0x5adb('0x4b')]=function(_0x3b4794,_0x4d98d0){return db[_0x5adb('0x43')][_0x5adb('0x4b')](_0x3b4794[_0x5adb('0x4c')],{})[_0x5adb('0x1b')](respondWithResult(_0x4d98d0,0xc9))['catch'](handleError(_0x4d98d0,null));};exports[_0x5adb('0x2e')]=function(_0x91775c,_0x28b291){if(_0x91775c[_0x5adb('0x4c')]['id']){delete _0x91775c[_0x5adb('0x4c')]['id'];}return db['ServicenowConfiguration'][_0x5adb('0x4a')]({'where':{'id':_0x91775c['params']['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x28b291,null))['then'](saveUpdates(_0x91775c[_0x5adb('0x4c')],null))[_0x5adb('0x1b')](respondWithResult(_0x28b291,null))[_0x5adb('0x24')](handleError(_0x28b291,null));};exports[_0x5adb('0x4d')]=function(_0x59b512,_0x18f95c){return db[_0x5adb('0x43')][_0x5adb('0x4a')]({'where':{'id':_0x59b512['params']['id']}})['then'](handleEntityNotFound(_0x18f95c,null))['then'](removeEntity(_0x18f95c,null))[_0x5adb('0x24')](handleError(_0x18f95c,null));};exports[_0x5adb('0x4e')]=function(_0xa5ecc0,_0x12a146,_0xa833f4){var _0xb06bee={};var _0x204b9b={};var _0x8d7810;var _0xc880af;return db[_0x5adb('0x43')][_0x5adb('0x4f')]({'where':{'id':_0xa5ecc0[_0x5adb('0x48')]['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x12a146,null))['then'](function(_0x49f4c8){if(_0x49f4c8){_0x8d7810=_0x49f4c8;_0x204b9b[_0x5adb('0x37')]=_[_0x5adb('0x33')](db[_0x5adb('0x50')][_0x5adb('0x32')]);_0x204b9b['query']=_[_0x5adb('0x33')](_0xa5ecc0[_0x5adb('0x36')]);_0x204b9b['filters']=_[_0x5adb('0x35')](_0x204b9b[_0x5adb('0x37')],_0x204b9b[_0x5adb('0x36')]);_0xb06bee['attributes']=_[_0x5adb('0x35')](_0x204b9b[_0x5adb('0x37')],qs[_0x5adb('0x38')](_0xa5ecc0[_0x5adb('0x36')][_0x5adb('0x38')]));_0xb06bee[_0x5adb('0x39')]=_0xb06bee['attributes'][_0x5adb('0x3a')]?_0xb06bee[_0x5adb('0x39')]:_0x204b9b[_0x5adb('0x37')];_0xb06bee['order']=qs[_0x5adb('0x51')](_0xa5ecc0[_0x5adb('0x36')][_0x5adb('0x51')]);_0xb06bee['where']=qs[_0x5adb('0x34')](_['pick'](_0xa5ecc0[_0x5adb('0x36')],_0x204b9b[_0x5adb('0x34')]));if(_0xa5ecc0[_0x5adb('0x36')]['filter']){_0xb06bee[_0x5adb('0x3b')]=_[_0x5adb('0x52')](_0xb06bee['where'],{'$or':_[_0x5adb('0x3e')](_0xb06bee[_0x5adb('0x39')],function(_0x248739){var _0x3fcad5={};_0x3fcad5[_0x248739]={'$like':'%'+_0xa5ecc0['query'][_0x5adb('0x3d')]+'%'};return _0x3fcad5;})});}_0xb06bee=_[_0x5adb('0x52')]({},_0xb06bee,_0xa5ecc0[_0x5adb('0x49')]);return _0x8d7810[_0x5adb('0x4e')](_0xb06bee);}})['then'](function(_0x53a4bc){if(_0x53a4bc){_0xc880af=_0x53a4bc[_0x5adb('0x3a')];if(!_0xa5ecc0['query']['hasOwnProperty']('nolimit')){_0xb06bee[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0xa5ecc0['query'][_0x5adb('0x28')]);_0xb06bee[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0xa5ecc0[_0x5adb('0x36')][_0x5adb('0x27')]);}return _0x8d7810[_0x5adb('0x4e')](_0xb06bee);}})[_0x5adb('0x1b')](function(_0x1ffcd3){if(_0x1ffcd3){return _0x1ffcd3?{'count':_0xc880af,'rows':_0x1ffcd3}:null;}})['then'](respondWithResult(_0x12a146,null))['catch'](handleError(_0x12a146,null));};exports['getSubjects']=function(_0x347b7b,_0x4357a6,_0x3a0d1b){var _0x2a55a3={};var _0x1f59bb={};var _0x2f6ef7;var _0x386c76;return db[_0x5adb('0x43')]['findOne']({'where':{'id':_0x347b7b['params']['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x4357a6,null))[_0x5adb('0x1b')](function(_0x114ee4){if(_0x114ee4){_0x2f6ef7=_0x114ee4;_0x1f59bb[_0x5adb('0x37')]=_[_0x5adb('0x33')](db[_0x5adb('0x50')][_0x5adb('0x32')]);_0x1f59bb[_0x5adb('0x36')]=_[_0x5adb('0x33')](_0x347b7b[_0x5adb('0x36')]);_0x1f59bb['filters']=_[_0x5adb('0x35')](_0x1f59bb[_0x5adb('0x37')],_0x1f59bb[_0x5adb('0x36')]);_0x2a55a3['attributes']=_[_0x5adb('0x35')](_0x1f59bb[_0x5adb('0x37')],qs['fields'](_0x347b7b[_0x5adb('0x36')]['fields']));_0x2a55a3[_0x5adb('0x39')]=_0x2a55a3[_0x5adb('0x39')]['length']?_0x2a55a3[_0x5adb('0x39')]:_0x1f59bb[_0x5adb('0x37')];_0x2a55a3[_0x5adb('0x53')]=qs[_0x5adb('0x51')](_0x347b7b[_0x5adb('0x36')][_0x5adb('0x51')]);_0x2a55a3[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_['pick'](_0x347b7b[_0x5adb('0x36')],_0x1f59bb[_0x5adb('0x34')]));if(_0x347b7b[_0x5adb('0x36')]['filter']){_0x2a55a3['where']=_[_0x5adb('0x52')](_0x2a55a3['where'],{'$or':_[_0x5adb('0x3e')](_0x2a55a3[_0x5adb('0x39')],function(_0xd6cc89){var _0x50600f={};_0x50600f[_0xd6cc89]={'$like':'%'+_0x347b7b[_0x5adb('0x36')][_0x5adb('0x3d')]+'%'};return _0x50600f;})});}_0x2a55a3=_[_0x5adb('0x52')]({},_0x2a55a3,_0x347b7b[_0x5adb('0x49')]);return _0x2f6ef7[_0x5adb('0x54')](_0x2a55a3);}})['then'](function(_0x2a3084){if(_0x2a3084){_0x386c76=_0x2a3084[_0x5adb('0x3a')];if(!_0x347b7b[_0x5adb('0x36')][_0x5adb('0x55')]('nolimit')){_0x2a55a3[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0x347b7b[_0x5adb('0x36')][_0x5adb('0x28')]);_0x2a55a3[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x347b7b[_0x5adb('0x36')]['offset']);}return _0x2f6ef7[_0x5adb('0x54')](_0x2a55a3);}})[_0x5adb('0x1b')](function(_0x5f36ec){if(_0x5f36ec){return _0x5f36ec?{'count':_0x386c76,'rows':_0x5f36ec}:null;}})[_0x5adb('0x1b')](respondWithResult(_0x4357a6,null))[_0x5adb('0x24')](handleError(_0x4357a6,null));};exports['getDescriptions']=function(_0x462fa0,_0x50f8ed,_0x372354){var _0x268df2={};var _0x4a2ebc={};var _0x167432;var _0x54c2c8;return db[_0x5adb('0x43')][_0x5adb('0x4f')]({'where':{'id':_0x462fa0[_0x5adb('0x48')]['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x50f8ed,null))[_0x5adb('0x1b')](function(_0x4dbcd9){if(_0x4dbcd9){_0x167432=_0x4dbcd9;_0x4a2ebc[_0x5adb('0x37')]=_[_0x5adb('0x33')](db[_0x5adb('0x50')][_0x5adb('0x32')]);_0x4a2ebc['query']=_['keys'](_0x462fa0[_0x5adb('0x36')]);_0x4a2ebc[_0x5adb('0x34')]=_[_0x5adb('0x35')](_0x4a2ebc[_0x5adb('0x37')],_0x4a2ebc[_0x5adb('0x36')]);_0x268df2[_0x5adb('0x39')]=_[_0x5adb('0x35')](_0x4a2ebc['model'],qs[_0x5adb('0x38')](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x38')]));_0x268df2[_0x5adb('0x39')]=_0x268df2['attributes'][_0x5adb('0x3a')]?_0x268df2[_0x5adb('0x39')]:_0x4a2ebc[_0x5adb('0x37')];_0x268df2[_0x5adb('0x53')]=qs[_0x5adb('0x51')](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x51')]);_0x268df2[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_['pick'](_0x462fa0[_0x5adb('0x36')],_0x4a2ebc[_0x5adb('0x34')]));if(_0x462fa0['query'][_0x5adb('0x3d')]){_0x268df2[_0x5adb('0x3b')]=_[_0x5adb('0x52')](_0x268df2[_0x5adb('0x3b')],{'$or':_[_0x5adb('0x3e')](_0x268df2[_0x5adb('0x39')],function(_0x450516){var _0x350bb1={};_0x350bb1[_0x450516]={'$like':'%'+_0x462fa0['query'][_0x5adb('0x3d')]+'%'};return _0x350bb1;})});}_0x268df2=_[_0x5adb('0x52')]({},_0x268df2,_0x462fa0['options']);return _0x167432[_0x5adb('0x56')](_0x268df2);}})[_0x5adb('0x1b')](function(_0x14d4a7){if(_0x14d4a7){_0x54c2c8=_0x14d4a7['length'];if(!_0x462fa0['query'][_0x5adb('0x55')](_0x5adb('0x57'))){_0x268df2[_0x5adb('0x28')]=qs['limit'](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x28')]);_0x268df2[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x27')]);}return _0x167432[_0x5adb('0x56')](_0x268df2);}})[_0x5adb('0x1b')](function(_0x28bd33){if(_0x28bd33){return _0x28bd33?{'count':_0x54c2c8,'rows':_0x28bd33}:null;}})[_0x5adb('0x1b')](respondWithResult(_0x50f8ed,null))[_0x5adb('0x24')](handleError(_0x50f8ed,null));};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
index 5db1bee..98c192f 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b38=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ca35f,_0x2b9ce9){var _0x179d47=function(_0x24c655){while(--_0x24c655){_0x3ca35f['push'](_0x3ca35f['shift']());}};_0x179d47(++_0x2b9ce9);}(_0x0b38,0x19b));var _0x80b3=function(_0x1c2028,_0x249c33){_0x1c2028=_0x1c2028-0x0;var _0x59922e=_0x0b38[_0x1c2028];return _0x59922e;};'use strict';var _=require('lodash');var util=require(_0x80b3('0x0'));var logger=require(_0x80b3('0x1'))(_0x80b3('0x2'));var moment=require(_0x80b3('0x3'));var BPromise=require(_0x80b3('0x4'));var rp=require(_0x80b3('0x5'));var fs=require('fs');var path=require(_0x80b3('0x6'));var rimraf=require(_0x80b3('0x7'));var config=require(_0x80b3('0x8'));var attributes=require(_0x80b3('0x9'));module[_0x80b3('0xa')]=function(_0x3437f3,_0x2ddf23){return _0x3437f3[_0x80b3('0xb')](_0x80b3('0xc'),attributes,{'tableName':_0x80b3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x19ed=['lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intServicenowConfiguration.attributes','define','int_servicenow_configurations'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x19ed,0x1d6));var _0xd19e=function(_0x11c8e5,_0x2876e1){_0x11c8e5=_0x11c8e5-0x0;var _0x46689a=_0x19ed[_0x11c8e5];return _0x46689a;};'use strict';var _=require(_0xd19e('0x0'));var util=require(_0xd19e('0x1'));var logger=require(_0xd19e('0x2'))(_0xd19e('0x3'));var moment=require('moment');var BPromise=require(_0xd19e('0x4'));var rp=require(_0xd19e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd19e('0x6'));var attributes=require(_0xd19e('0x7'));module['exports']=function(_0x2016ef,_0x31fb44){return _0x2016ef[_0xd19e('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0xd19e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
index ebfc2d3..4225052 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb73=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x553a24,_0x6b5c46){var _0x4f9856=function(_0x42a8cc){while(--_0x42a8cc){_0x553a24['push'](_0x553a24['shift']());}};_0x4f9856(++_0x6b5c46);}(_0xfb73,0x1c4));var _0x3fb7=function(_0x366390,_0x16f4b0){_0x366390=_0x366390-0x0;var _0x526701=_0xfb73[_0x366390];return _0x526701;};'use strict';var _=require(_0x3fb7('0x0'));var util=require('util');var moment=require(_0x3fb7('0x1'));var BPromise=require(_0x3fb7('0x2'));var rs=require(_0x3fb7('0x3'));var fs=require('fs');var Redis=require(_0x3fb7('0x4'));var db=require(_0x3fb7('0x5'))['db'];var utils=require(_0x3fb7('0x6'));var logger=require('../../config/logger')(_0x3fb7('0x7'));var config=require(_0x3fb7('0x8'));var jayson=require(_0x3fb7('0x9'));var client=jayson[_0x3fb7('0xa')][_0x3fb7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x103119,_0x5753c2,_0x38c9d8){return new BPromise(function(_0x5884dd,_0x5f54a5){return client['request'](_0x103119,_0x38c9d8)[_0x3fb7('0xc')](function(_0x1ffc76){logger[_0x3fb7('0xd')](_0x3fb7('0xe'),_0x5753c2,_0x3fb7('0xf'));logger[_0x3fb7('0x10')](_0x3fb7('0x11'),_0x5753c2,'request\x20sent',JSON[_0x3fb7('0x12')](_0x1ffc76));if(_0x1ffc76['error']){if(_0x1ffc76[_0x3fb7('0x13')][_0x3fb7('0x14')]===0x1f4){logger['error'](_0x3fb7('0xe'),_0x5753c2,_0x1ffc76[_0x3fb7('0x13')][_0x3fb7('0x15')]);return _0x5f54a5(_0x1ffc76[_0x3fb7('0x13')][_0x3fb7('0x15')]);}logger[_0x3fb7('0x13')](_0x3fb7('0xe'),_0x5753c2,_0x1ffc76['error'][_0x3fb7('0x15')]);return _0x5884dd(_0x1ffc76[_0x3fb7('0x13')][_0x3fb7('0x15')]);}else{logger[_0x3fb7('0xd')](_0x3fb7('0xe'),_0x5753c2,_0x3fb7('0xf'));_0x5884dd(_0x1ffc76[_0x3fb7('0x16')]['message']);}})[_0x3fb7('0x17')](function(_0x46a6f1){logger[_0x3fb7('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5753c2,_0x46a6f1);_0x5f54a5(_0x46a6f1);});});}
\ No newline at end of file
+var _0xe894=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe894,0x7a));var _0x4e89=function(_0x154cb5,_0x1a8d5a){_0x154cb5=_0x154cb5-0x0;var _0x3f574f=_0xe894[_0x154cb5];return _0x3f574f;};'use strict';var _=require(_0x4e89('0x0'));var util=require('util');var moment=require(_0x4e89('0x1'));var BPromise=require(_0x4e89('0x2'));var rs=require(_0x4e89('0x3'));var fs=require('fs');var Redis=require(_0x4e89('0x4'));var db=require(_0x4e89('0x5'))['db'];var utils=require(_0x4e89('0x6'));var logger=require(_0x4e89('0x7'))('rpc');var config=require(_0x4e89('0x8'));var jayson=require(_0x4e89('0x9'));var client=jayson[_0x4e89('0xa')][_0x4e89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58df55,_0x1d2cc7,_0x1b7159){return new BPromise(function(_0x2e9bfe,_0x2d2924){return client[_0x4e89('0xc')](_0x58df55,_0x1b7159)[_0x4e89('0xd')](function(_0x20473c){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x1d2cc7,_0x4e89('0xe'));logger[_0x4e89('0xf')](_0x4e89('0x10'),_0x1d2cc7,_0x4e89('0xe'),JSON[_0x4e89('0x11')](_0x20473c));if(_0x20473c[_0x4e89('0x12')]){if(_0x20473c[_0x4e89('0x12')][_0x4e89('0x13')]===0x1f4){logger['error'](_0x4e89('0x14'),_0x1d2cc7,_0x20473c[_0x4e89('0x12')][_0x4e89('0x15')]);return _0x2d2924(_0x20473c[_0x4e89('0x12')]['message']);}logger[_0x4e89('0x12')](_0x4e89('0x14'),_0x1d2cc7,_0x20473c[_0x4e89('0x12')]['message']);return _0x2e9bfe(_0x20473c[_0x4e89('0x12')][_0x4e89('0x15')]);}else{logger[_0x4e89('0x16')](_0x4e89('0x14'),_0x1d2cc7,'request\x20sent');_0x2e9bfe(_0x20473c[_0x4e89('0x17')][_0x4e89('0x15')]);}})[_0x4e89('0x18')](function(_0x56fc07){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x1d2cc7,_0x56fc07);_0x2d2924(_0x56fc07);});});}
\ No newline at end of file
diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js
index 9016d0d..44d3373 100644
--- a/server/api/intServicenowField/index.js
+++ b/server/api/intServicenowField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x81a6=['create','put','delete','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post'];(function(_0x15e6f4,_0x52f862){var _0x59f9f2=function(_0x53e1d3){while(--_0x53e1d3){_0x15e6f4['push'](_0x15e6f4['shift']());}};_0x59f9f2(++_0x52f862);}(_0x81a6,0x9a));var _0x681a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x81a6[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require(_0x681a('0x0'));var util=require('util');var path=require(_0x681a('0x1'));var timeout=require('connect-timeout');var express=require(_0x681a('0x2'));var router=express[_0x681a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x681a('0x4'));var config=require(_0x681a('0x5'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x681a('0x6')](),controller[_0x681a('0x7')]);router['get'](_0x681a('0x8'),auth[_0x681a('0x6')](),controller[_0x681a('0x9')]);router[_0x681a('0xa')]('/',auth[_0x681a('0x6')](),controller[_0x681a('0xb')]);router[_0x681a('0xc')]('/:id',auth[_0x681a('0x6')](),controller['update']);router[_0x681a('0xd')](_0x681a('0x8'),auth[_0x681a('0x6')](),controller['destroy']);module[_0x681a('0xe')]=router;
\ No newline at end of file
+var _0xe92c=['../../components/auth/service','../../config/environment','./intServicenowField.controller','/:id','isAuthenticated','show','post','create','delete','multer','util','connect-timeout','express','Router'];(function(_0x20295a,_0x33e98f){var _0x5d821d=function(_0x3677ae){while(--_0x3677ae){_0x20295a['push'](_0x20295a['shift']());}};_0x5d821d(++_0x33e98f);}(_0xe92c,0x6b));var _0xce92=function(_0x4a9a50,_0x5568f6){_0x4a9a50=_0x4a9a50-0x0;var _0x182e4b=_0xe92c[_0x4a9a50];return _0x182e4b;};'use strict';var multer=require(_0xce92('0x0'));var util=require(_0xce92('0x1'));var path=require('path');var timeout=require(_0xce92('0x2'));var express=require(_0xce92('0x3'));var router=express[_0xce92('0x4')]();var auth=require(_0xce92('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xce92('0x6'));var controller=require(_0xce92('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xce92('0x8'),auth[_0xce92('0x9')](),controller[_0xce92('0xa')]);router[_0xce92('0xb')]('/',auth['isAuthenticated'](),controller[_0xce92('0xc')]);router['put'](_0xce92('0x8'),auth[_0xce92('0x9')](),controller['update']);router[_0xce92('0xd')](_0xce92('0x8'),auth[_0xce92('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js
index 181a363..089b8b9 100644
--- a/server/api/intServicenowField/intServicenowField.attributes.js
+++ b/server/api/intServicenowField/intServicenowField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb58b=['BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x385ed5,_0x449f76){var _0x27f199=function(_0x47d08f){while(--_0x47d08f){_0x385ed5['push'](_0x385ed5['shift']());}};_0x27f199(++_0x449f76);}(_0xb58b,0x1f1));var _0xbb58=function(_0x578a6b,_0xe0d001){_0x578a6b=_0x578a6b-0x0;var _0x10ea80=_0xb58b[_0x578a6b];return _0x10ea80;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'type':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),'variable',_0xbb58('0x3'),_0xbb58('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbb58('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),_0xbb58('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xbb58('0x5')]},'idField':{'type':Sequelize[_0xbb58('0x5')]},'nameField':{'type':Sequelize[_0xbb58('0x5')]},'customField':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb58('0x5')]}};
\ No newline at end of file
+var _0x55e0=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x55e0,0xdc));var _0x055e=function(_0x4cf88f,_0x31e654){_0x4cf88f=_0x4cf88f-0x0;var _0x3be1b3=_0x55e0[_0x4cf88f];return _0x3be1b3;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'type':{'type':Sequelize[_0x055e('0x2')](_0x055e('0x3'),'variable','customVariable',_0x055e('0x4')),'defaultValue':_0x055e('0x3')},'content':{'type':Sequelize[_0x055e('0x5')]},'key':{'type':Sequelize[_0x055e('0x5')]},'keyType':{'type':Sequelize[_0x055e('0x2')](_0x055e('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x055e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x055e('0x5')]},'customField':{'type':Sequelize[_0x055e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x055e('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js
index bf90eca..8c9f063 100644
--- a/server/api/intServicenowField/intServicenowField.controller.js
+++ b/server/api/intServicenowField/intServicenowField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4975=['jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','key','field','merge','options','ServicenowField','includeAll','include','rows','catch','show','params','rawAttributes','fields','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0x3f2e3d,_0x3acada){_0x3f2e3d=_0x3f2e3d-0x0;var _0x75beb7=_0x4975[_0x3f2e3d];return _0x75beb7;};'use strict';var pdf=require(_0x5497('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5497('0x1'));var zipdir=require(_0x5497('0x2'));var jsonpatch=require(_0x5497('0x3'));var rp=require(_0x5497('0x4'));var moment=require(_0x5497('0x5'));var BPromise=require(_0x5497('0x6'));var Mustache=require(_0x5497('0x7'));var util=require(_0x5497('0x8'));var path=require(_0x5497('0x9'));var sox=require(_0x5497('0xa'));var csv=require('to-csv');var ejs=require(_0x5497('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xf'));var querystring=require('querystring');var Papa=require(_0x5497('0x10'));var Redis=require(_0x5497('0x11'));var authService=require(_0x5497('0x12'));var qs=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require(_0x5497('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b1162,_0xc250bb){_0xc250bb=_0xc250bb||0xcc;return function(_0x1b23df){if(_0x1b23df){return _0x5b1162[_0x5497('0x18')](_0xc250bb);}return _0x5b1162[_0x5497('0x19')](_0xc250bb)[_0x5497('0x1a')]();};}function respondWithResult(_0x365144,_0x1f7169){_0x1f7169=_0x1f7169||0xc8;return function(_0xaca97d){if(_0xaca97d){return _0x365144[_0x5497('0x19')](_0x1f7169)[_0x5497('0x1b')](_0xaca97d);}};}function respondWithFilteredResult(_0x55f590,_0x11b0a9){return function(_0x4fb8e9){if(_0x4fb8e9){var _0x4237a9=_0x4fb8e9[_0x5497('0x1c')],_0x2bfd8a=_0x11b0a9[_0x5497('0x1d')],_0x19e5f3=_0x11b0a9[_0x5497('0x1d')]+_0x11b0a9['limit'],_0x3ce50b;if(_0x19e5f3>=_0x4237a9){_0x19e5f3=_0x4237a9;_0x3ce50b=0xc8;}else{_0x3ce50b=0xce;}_0x55f590['status'](_0x3ce50b);return _0x55f590[_0x5497('0x1e')](_0x5497('0x1f'),_0x2bfd8a+'-'+_0x19e5f3+'/'+_0x4237a9)[_0x5497('0x1b')](_0x4fb8e9);}return null;};}function patchUpdates(_0x5d9e24){return function(_0xbf1ba7){try{jsonpatch[_0x5497('0x20')](_0xbf1ba7,_0x5d9e24,!![]);}catch(_0x18e8a8){return BPromise[_0x5497('0x21')](_0x18e8a8);}return _0xbf1ba7[_0x5497('0x22')]();};}function saveUpdates(_0x1f6f18,_0x16d378){return function(_0x10226f){if(_0x10226f){return _0x10226f[_0x5497('0x23')](_0x1f6f18)[_0x5497('0x24')](function(_0x186065){return _0x186065;});}return null;};}function removeEntity(_0x52c049,_0x720767){return function(_0x4d1b27){if(_0x4d1b27){return _0x4d1b27[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x52c049[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x35ecd9,_0x3b2fbc){return function(_0x5018fa){if(!_0x5018fa){_0x35ecd9['sendStatus'](0x194);}return _0x5018fa;};}function handleError(_0x1eefce,_0x34b97f){_0x34b97f=_0x34b97f||0x1f4;return function(_0x24482a){logger[_0x5497('0x26')](_0x24482a['stack']);if(_0x24482a[_0x5497('0x27')]){delete _0x24482a['name'];}_0x1eefce[_0x5497('0x19')](_0x34b97f)[_0x5497('0x28')](_0x24482a);};}exports[_0x5497('0x29')]=function(_0x34a1a5,_0x163a30){var _0x31cd01={},_0x48b835={},_0x4af5f4={'count':0x0,'rows':[]};var _0x5406e2=db['ServicenowField']['rawAttributes'];_0x48b835[_0x5497('0x2a')]=_['keys'](_0x5406e2);_0x48b835['query']=_[_0x5497('0x2b')](_0x34a1a5[_0x5497('0x2c')]);_0x48b835[_0x5497('0x2d')]=_['intersection'](_0x48b835['model'],_0x48b835['query']);_0x31cd01[_0x5497('0x2e')]=_[_0x5497('0x2f')](_0x48b835[_0x5497('0x2a')],qs['fields'](_0x34a1a5['query']['fields']));_0x31cd01[_0x5497('0x2e')]=_0x31cd01['attributes'][_0x5497('0x30')]?_0x31cd01[_0x5497('0x2e')]:_0x48b835[_0x5497('0x2a')];if(!_0x34a1a5['query'][_0x5497('0x31')](_0x5497('0x32'))){_0x31cd01['limit']=qs[_0x5497('0x33')](_0x34a1a5[_0x5497('0x2c')][_0x5497('0x33')]);_0x31cd01['offset']=qs[_0x5497('0x1d')](_0x34a1a5[_0x5497('0x2c')][_0x5497('0x1d')]);}_0x31cd01[_0x5497('0x34')]=qs[_0x5497('0x35')](_0x34a1a5['query'][_0x5497('0x35')]);_0x31cd01[_0x5497('0x36')]=qs['filters'](_[_0x5497('0x37')](_0x34a1a5[_0x5497('0x2c')],_0x48b835[_0x5497('0x2d')]));if(_0x34a1a5[_0x5497('0x2c')][_0x5497('0x38')]){_0x31cd01[_0x5497('0x36')]=_['merge'](_0x31cd01[_0x5497('0x36')],{'$or':_['map'](_0x5406e2,function(_0x7880e4){if(_0x7880e4[_0x5497('0x39')][_0x5497('0x3a')]!=='VIRTUAL'){var _0x4ec5f7={};_0x4ec5f7[_0x7880e4[_0x5497('0x3b')]]={'$like':'%'+_0x34a1a5[_0x5497('0x2c')][_0x5497('0x38')]+'%'};return _0x4ec5f7;}})});}_0x31cd01=_[_0x5497('0x3c')]({},_0x31cd01,_0x34a1a5[_0x5497('0x3d')]);var _0xc8a689={'where':_0x31cd01['where']};return db[_0x5497('0x3e')][_0x5497('0x1c')](_0xc8a689)[_0x5497('0x24')](function(_0x2bd07a){_0x4af5f4[_0x5497('0x1c')]=_0x2bd07a;if(_0x34a1a5[_0x5497('0x2c')][_0x5497('0x3f')]){_0x31cd01[_0x5497('0x40')]=[{'all':!![]}];}return db[_0x5497('0x3e')]['findAll'](_0x31cd01);})[_0x5497('0x24')](function(_0x32fa2b){_0x4af5f4[_0x5497('0x41')]=_0x32fa2b;return _0x4af5f4;})[_0x5497('0x24')](respondWithFilteredResult(_0x163a30,_0x31cd01))[_0x5497('0x42')](handleError(_0x163a30,null));};exports[_0x5497('0x43')]=function(_0x4299be,_0x59ed13){var _0x3e5f7d={'raw':!![],'where':{'id':_0x4299be[_0x5497('0x44')]['id']}},_0x95d7d6={};_0x95d7d6[_0x5497('0x2a')]=_[_0x5497('0x2b')](db[_0x5497('0x3e')][_0x5497('0x45')]);_0x95d7d6['query']=_[_0x5497('0x2b')](_0x4299be[_0x5497('0x2c')]);_0x95d7d6[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0x95d7d6[_0x5497('0x2a')],_0x95d7d6[_0x5497('0x2c')]);_0x3e5f7d[_0x5497('0x2e')]=_[_0x5497('0x2f')](_0x95d7d6[_0x5497('0x2a')],qs[_0x5497('0x46')](_0x4299be['query'][_0x5497('0x46')]));_0x3e5f7d['attributes']=_0x3e5f7d[_0x5497('0x2e')][_0x5497('0x30')]?_0x3e5f7d[_0x5497('0x2e')]:_0x95d7d6[_0x5497('0x2a')];if(_0x4299be[_0x5497('0x2c')]['includeAll']){_0x3e5f7d[_0x5497('0x40')]=[{'all':!![]}];}_0x3e5f7d=_[_0x5497('0x3c')]({},_0x3e5f7d,_0x4299be['options']);return db[_0x5497('0x3e')]['find'](_0x3e5f7d)[_0x5497('0x24')](handleEntityNotFound(_0x59ed13,null))['then'](respondWithResult(_0x59ed13,null))[_0x5497('0x42')](handleError(_0x59ed13,null));};exports[_0x5497('0x47')]=function(_0x2e8c6a,_0x3a852a){return db[_0x5497('0x3e')]['create'](_0x2e8c6a['body'],{})['then'](respondWithResult(_0x3a852a,0xc9))['catch'](handleError(_0x3a852a,null));};exports[_0x5497('0x23')]=function(_0x43c430,_0x417f31){if(_0x43c430[_0x5497('0x48')]['id']){delete _0x43c430[_0x5497('0x48')]['id'];}return db[_0x5497('0x3e')][_0x5497('0x49')]({'where':{'id':_0x43c430[_0x5497('0x44')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x417f31,null))['then'](saveUpdates(_0x43c430[_0x5497('0x48')],null))[_0x5497('0x24')](respondWithResult(_0x417f31,null))[_0x5497('0x42')](handleError(_0x417f31,null));};exports['destroy']=function(_0x3e4da2,_0x530475){return db[_0x5497('0x3e')][_0x5497('0x49')]({'where':{'id':_0x3e4da2[_0x5497('0x44')]['id']}})['then'](handleEntityNotFound(_0x530475,null))[_0x5497('0x24')](removeEntity(_0x530475,null))[_0x5497('0x42')](handleError(_0x530475,null));};
\ No newline at end of file
+var _0x1a85=['order','sort','where','pick','filter','type','key','VIRTUAL','field','merge','includeAll','include','findAll','show','params','fields','options','find','catch','create','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','ServicenowField','rawAttributes','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit'];(function(_0x2539e6,_0x595d36){var _0xe83570=function(_0x2a8b2e){while(--_0x2a8b2e){_0x2539e6['push'](_0x2539e6['shift']());}};_0xe83570(++_0x595d36);}(_0x1a85,0x178));var _0x51a8=function(_0x53aaf8,_0x863bcb){_0x53aaf8=_0x53aaf8-0x0;var _0x1fedb1=_0x1a85[_0x53aaf8];return _0x1fedb1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x51a8('0x0'));var zipdir=require(_0x51a8('0x1'));var jsonpatch=require(_0x51a8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51a8('0x3'));var Mustache=require(_0x51a8('0x4'));var util=require(_0x51a8('0x5'));var path=require('path');var sox=require(_0x51a8('0x6'));var csv=require('to-csv');var ejs=require(_0x51a8('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var hardwareService=require(_0x51a8('0xf'));var logger=require(_0x51a8('0x10'))(_0x51a8('0x11'));var utils=require(_0x51a8('0x12'));var config=require(_0x51a8('0x13'));var db=require(_0x51a8('0x14'))['db'];function respondWithStatusCode(_0xc7c203,_0xc46d7){_0xc46d7=_0xc46d7||0xcc;return function(_0x38a1d2){if(_0x38a1d2){return _0xc7c203[_0x51a8('0x15')](_0xc46d7);}return _0xc7c203[_0x51a8('0x16')](_0xc46d7)[_0x51a8('0x17')]();};}function respondWithResult(_0x2de2f9,_0x47b988){_0x47b988=_0x47b988||0xc8;return function(_0x461f5c){if(_0x461f5c){return _0x2de2f9[_0x51a8('0x16')](_0x47b988)[_0x51a8('0x18')](_0x461f5c);}};}function respondWithFilteredResult(_0x50d992,_0xf4eb6e){return function(_0x547d40){if(_0x547d40){var _0x10584b=_0x547d40[_0x51a8('0x19')],_0x2b8d37=_0xf4eb6e[_0x51a8('0x1a')],_0x39cd45=_0xf4eb6e[_0x51a8('0x1a')]+_0xf4eb6e['limit'],_0x2b0521;if(_0x39cd45>=_0x10584b){_0x39cd45=_0x10584b;_0x2b0521=0xc8;}else{_0x2b0521=0xce;}_0x50d992[_0x51a8('0x16')](_0x2b0521);return _0x50d992[_0x51a8('0x1b')](_0x51a8('0x1c'),_0x2b8d37+'-'+_0x39cd45+'/'+_0x10584b)[_0x51a8('0x18')](_0x547d40);}return null;};}function patchUpdates(_0x3bc1a2){return function(_0x544886){try{jsonpatch['apply'](_0x544886,_0x3bc1a2,!![]);}catch(_0x1df8c2){return BPromise[_0x51a8('0x1d')](_0x1df8c2);}return _0x544886[_0x51a8('0x1e')]();};}function saveUpdates(_0x2f2681,_0x2a4c4c){return function(_0x3bc044){if(_0x3bc044){return _0x3bc044[_0x51a8('0x1f')](_0x2f2681)[_0x51a8('0x20')](function(_0x5ac1c0){return _0x5ac1c0;});}return null;};}function removeEntity(_0xf80fa9,_0x53438c){return function(_0xfe0ddb){if(_0xfe0ddb){return _0xfe0ddb[_0x51a8('0x21')]()[_0x51a8('0x20')](function(){_0xf80fa9[_0x51a8('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xae3588,_0x4b9cdd){return function(_0x47f063){if(!_0x47f063){_0xae3588[_0x51a8('0x15')](0x194);}return _0x47f063;};}function handleError(_0x52e503,_0x384d25){_0x384d25=_0x384d25||0x1f4;return function(_0x78d3d6){logger[_0x51a8('0x22')](_0x78d3d6[_0x51a8('0x23')]);if(_0x78d3d6[_0x51a8('0x24')]){delete _0x78d3d6[_0x51a8('0x24')];}_0x52e503[_0x51a8('0x16')](_0x384d25)[_0x51a8('0x25')](_0x78d3d6);};}exports['index']=function(_0x273ce2,_0x1b7577){var _0xca5746={},_0x3da187={},_0x1c150d={'count':0x0,'rows':[]};var _0x11aefc=db[_0x51a8('0x26')][_0x51a8('0x27')];_0x3da187[_0x51a8('0x28')]=_[_0x51a8('0x29')](_0x11aefc);_0x3da187[_0x51a8('0x2a')]=_[_0x51a8('0x29')](_0x273ce2['query']);_0x3da187[_0x51a8('0x2b')]=_['intersection'](_0x3da187[_0x51a8('0x28')],_0x3da187[_0x51a8('0x2a')]);_0xca5746[_0x51a8('0x2c')]=_[_0x51a8('0x2d')](_0x3da187[_0x51a8('0x28')],qs['fields'](_0x273ce2[_0x51a8('0x2a')]['fields']));_0xca5746[_0x51a8('0x2c')]=_0xca5746[_0x51a8('0x2c')][_0x51a8('0x2e')]?_0xca5746['attributes']:_0x3da187[_0x51a8('0x28')];if(!_0x273ce2['query'][_0x51a8('0x2f')](_0x51a8('0x30'))){_0xca5746[_0x51a8('0x31')]=qs[_0x51a8('0x31')](_0x273ce2[_0x51a8('0x2a')]['limit']);_0xca5746[_0x51a8('0x1a')]=qs['offset'](_0x273ce2[_0x51a8('0x2a')][_0x51a8('0x1a')]);}_0xca5746[_0x51a8('0x32')]=qs['sort'](_0x273ce2[_0x51a8('0x2a')][_0x51a8('0x33')]);_0xca5746[_0x51a8('0x34')]=qs[_0x51a8('0x2b')](_[_0x51a8('0x35')](_0x273ce2['query'],_0x3da187['filters']));if(_0x273ce2['query'][_0x51a8('0x36')]){_0xca5746[_0x51a8('0x34')]=_['merge'](_0xca5746[_0x51a8('0x34')],{'$or':_['map'](_0x11aefc,function(_0x13723b){if(_0x13723b[_0x51a8('0x37')][_0x51a8('0x38')]!==_0x51a8('0x39')){var _0x256cda={};_0x256cda[_0x13723b[_0x51a8('0x3a')]]={'$like':'%'+_0x273ce2['query']['filter']+'%'};return _0x256cda;}})});}_0xca5746=_[_0x51a8('0x3b')]({},_0xca5746,_0x273ce2['options']);var _0x5d7214={'where':_0xca5746['where']};return db[_0x51a8('0x26')][_0x51a8('0x19')](_0x5d7214)[_0x51a8('0x20')](function(_0x5956b8){_0x1c150d[_0x51a8('0x19')]=_0x5956b8;if(_0x273ce2[_0x51a8('0x2a')][_0x51a8('0x3c')]){_0xca5746[_0x51a8('0x3d')]=[{'all':!![]}];}return db['ServicenowField'][_0x51a8('0x3e')](_0xca5746);})[_0x51a8('0x20')](function(_0x1b0333){_0x1c150d['rows']=_0x1b0333;return _0x1c150d;})[_0x51a8('0x20')](respondWithFilteredResult(_0x1b7577,_0xca5746))['catch'](handleError(_0x1b7577,null));};exports[_0x51a8('0x3f')]=function(_0x1e637a,_0x2a98bd){var _0x37d50b={'raw':!![],'where':{'id':_0x1e637a[_0x51a8('0x40')]['id']}},_0x5c44a9={};_0x5c44a9[_0x51a8('0x28')]=_[_0x51a8('0x29')](db[_0x51a8('0x26')][_0x51a8('0x27')]);_0x5c44a9[_0x51a8('0x2a')]=_[_0x51a8('0x29')](_0x1e637a[_0x51a8('0x2a')]);_0x5c44a9[_0x51a8('0x2b')]=_['intersection'](_0x5c44a9[_0x51a8('0x28')],_0x5c44a9[_0x51a8('0x2a')]);_0x37d50b['attributes']=_['intersection'](_0x5c44a9[_0x51a8('0x28')],qs[_0x51a8('0x41')](_0x1e637a[_0x51a8('0x2a')][_0x51a8('0x41')]));_0x37d50b[_0x51a8('0x2c')]=_0x37d50b[_0x51a8('0x2c')][_0x51a8('0x2e')]?_0x37d50b[_0x51a8('0x2c')]:_0x5c44a9[_0x51a8('0x28')];if(_0x1e637a[_0x51a8('0x2a')]['includeAll']){_0x37d50b[_0x51a8('0x3d')]=[{'all':!![]}];}_0x37d50b=_[_0x51a8('0x3b')]({},_0x37d50b,_0x1e637a[_0x51a8('0x42')]);return db[_0x51a8('0x26')][_0x51a8('0x43')](_0x37d50b)[_0x51a8('0x20')](handleEntityNotFound(_0x2a98bd,null))['then'](respondWithResult(_0x2a98bd,null))[_0x51a8('0x44')](handleError(_0x2a98bd,null));};exports['create']=function(_0xa215ab,_0x3a33f3){return db[_0x51a8('0x26')][_0x51a8('0x45')](_0xa215ab[_0x51a8('0x46')],{})['then'](respondWithResult(_0x3a33f3,0xc9))['catch'](handleError(_0x3a33f3,null));};exports[_0x51a8('0x1f')]=function(_0x3ce04e,_0x41cfda){if(_0x3ce04e[_0x51a8('0x46')]['id']){delete _0x3ce04e[_0x51a8('0x46')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x3ce04e[_0x51a8('0x40')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x41cfda,null))[_0x51a8('0x20')](saveUpdates(_0x3ce04e[_0x51a8('0x46')],null))[_0x51a8('0x20')](respondWithResult(_0x41cfda,null))[_0x51a8('0x44')](handleError(_0x41cfda,null));};exports[_0x51a8('0x21')]=function(_0x1103a3,_0x301578){return db['ServicenowField']['find']({'where':{'id':_0x1103a3['params']['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x301578,null))[_0x51a8('0x20')](removeEntity(_0x301578,null))[_0x51a8('0x44')](handleError(_0x301578,null));};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js
index 9e03d97..fbcec91 100644
--- a/server/api/intServicenowField/intServicenowField.model.js
+++ b/server/api/intServicenowField/intServicenowField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x11b2=['moment','bluebird','request-promise','path','../../config/environment','./intServicenowField.attributes','define','idField','lodash','util','../../config/logger','api'];(function(_0x5b3ede,_0x749e34){var _0x51814d=function(_0x3821b9){while(--_0x3821b9){_0x5b3ede['push'](_0x5b3ede['shift']());}};_0x51814d(++_0x749e34);}(_0x11b2,0x170));var _0x211b=function(_0x5f26a8,_0x5b9294){_0x5f26a8=_0x5f26a8-0x0;var _0x5c37eb=_0x11b2[_0x5f26a8];return _0x5c37eb;};'use strict';var _=require(_0x211b('0x0'));var util=require(_0x211b('0x1'));var logger=require(_0x211b('0x2'))(_0x211b('0x3'));var moment=require(_0x211b('0x4'));var BPromise=require(_0x211b('0x5'));var rp=require(_0x211b('0x6'));var fs=require('fs');var path=require(_0x211b('0x7'));var rimraf=require('rimraf');var config=require(_0x211b('0x8'));var attributes=require(_0x211b('0x9'));module['exports']=function(_0x3e2270,_0x368043){return _0x3e2270[_0x211b('0xa')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x211b('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf682=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x3bfacf,_0x2de1ef){var _0x52130f=function(_0x4af192){while(--_0x4af192){_0x3bfacf['push'](_0x3bfacf['shift']());}};_0x52130f(++_0x2de1ef);}(_0xf682,0xd7));var _0x2f68=function(_0x580951,_0x2d241b){_0x580951=_0x580951-0x0;var _0x165219=_0xf682[_0x580951];return _0x165219;};'use strict';var _=require(_0x2f68('0x0'));var util=require(_0x2f68('0x1'));var logger=require(_0x2f68('0x2'))(_0x2f68('0x3'));var moment=require(_0x2f68('0x4'));var BPromise=require(_0x2f68('0x5'));var rp=require(_0x2f68('0x6'));var fs=require('fs');var path=require(_0x2f68('0x7'));var rimraf=require(_0x2f68('0x8'));var config=require(_0x2f68('0x9'));var attributes=require(_0x2f68('0xa'));module[_0x2f68('0xb')]=function(_0xe075a5,_0x50a09d){return _0xe075a5[_0x2f68('0xc')](_0x2f68('0xd'),attributes,{'tableName':_0x2f68('0xe'),'paranoid':![],'indexes':[{'name':_0x2f68('0xf'),'fields':[_0x2f68('0x10'),_0x2f68('0x11')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js
index 958e421..62d2662 100644
--- a/server/api/intServicenowField/intServicenowField.rpc.js
+++ b/server/api/intServicenowField/intServicenowField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6343=['message','result','catch','moment','bluebird','../../config/logger','rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x5b7237,_0x165af2){var _0x868337=function(_0x310c23){while(--_0x310c23){_0x5b7237['push'](_0x5b7237['shift']());}};_0x868337(++_0x165af2);}(_0x6343,0x168));var _0x3634=function(_0x1483e7,_0x10ab97){_0x1483e7=_0x1483e7-0x0;var _0x3267ea=_0x6343[_0x1483e7];return _0x3267ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3634('0x0'));var BPromise=require(_0x3634('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3634('0x2'))(_0x3634('0x3'));var config=require('../../config/environment');var jayson=require(_0x3634('0x4'));var client=jayson[_0x3634('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302828,_0xd40513,_0x4e6d71){return new BPromise(function(_0x5affba,_0x19170a){return client[_0x3634('0x6')](_0x302828,_0x4e6d71)[_0x3634('0x7')](function(_0x3c813b){logger[_0x3634('0x8')](_0x3634('0x9'),_0xd40513,'request\x20sent');logger['debug'](_0x3634('0xa'),_0xd40513,_0x3634('0xb'),JSON['stringify'](_0x3c813b));if(_0x3c813b[_0x3634('0xc')]){if(_0x3c813b[_0x3634('0xc')][_0x3634('0xd')]===0x1f4){logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x19170a(_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);}logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x5affba(_0x3c813b[_0x3634('0xc')]['message']);}else{logger[_0x3634('0x8')]('ServicenowField,\x20%s,\x20%s',_0xd40513,_0x3634('0xb'));_0x5affba(_0x3c813b[_0x3634('0xf')][_0x3634('0xe')]);}})[_0x3634('0x10')](function(_0x91061e){logger['error'](_0x3634('0x9'),_0xd40513,_0x91061e);_0x19170a(_0x91061e);});});}
\ No newline at end of file
+var _0xfcbb=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5483c6,_0x5d6b1c){var _0x381814=function(_0x45db8d){while(--_0x45db8d){_0x5483c6['push'](_0x5483c6['shift']());}};_0x381814(++_0x5d6b1c);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x524922,_0x4b038a){_0x524922=_0x524922-0x0;var _0x5da942=_0xfcbb[_0x524922];return _0x5da942;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('ServicenowField,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js
index 3f2dcd9..67f44a0 100644
--- a/server/api/intSugarcrmAccount/index.js
+++ b/server/api/intSugarcrmAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x04e6=['/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x3dc070,_0x8bc4eb){var _0x1040dd=function(_0x20d422){while(--_0x20d422){_0x3dc070['push'](_0x3dc070['shift']());}};_0x1040dd(++_0x8bc4eb);}(_0x04e6,0xea));var _0x604e=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x04e6[_0x4d82ea];return _0x257f4a;};'use strict';var multer=require(_0x604e('0x0'));var util=require(_0x604e('0x1'));var path=require(_0x604e('0x2'));var timeout=require(_0x604e('0x3'));var express=require(_0x604e('0x4'));var router=express[_0x604e('0x5')]();var auth=require(_0x604e('0x6'));var interaction=require(_0x604e('0x7'));var config=require(_0x604e('0x8'));var controller=require(_0x604e('0x9'));router[_0x604e('0xa')]('/',auth[_0x604e('0xb')](),controller['index']);router[_0x604e('0xa')](_0x604e('0xc'),auth[_0x604e('0xb')](),controller[_0x604e('0xd')]);router[_0x604e('0xa')](_0x604e('0xe'),auth[_0x604e('0xb')](),controller[_0x604e('0xf')]);router[_0x604e('0xa')](_0x604e('0x10'),auth[_0x604e('0xb')](),controller[_0x604e('0x11')]);router[_0x604e('0x12')]('/',auth[_0x604e('0xb')](),controller[_0x604e('0x13')]);router[_0x604e('0x12')](_0x604e('0xe'),auth[_0x604e('0xb')](),controller[_0x604e('0x14')]);router[_0x604e('0x15')]('/:id',auth[_0x604e('0xb')](),controller['update']);router[_0x604e('0x16')](_0x604e('0xc'),auth[_0x604e('0xb')](),controller[_0x604e('0x17')]);module[_0x604e('0x18')]=router;
\ No newline at end of file
+var _0xb5da=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xb5da,0x14c));var _0xab5d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb5da[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require(_0xab5d('0x0'));var path=require(_0xab5d('0x1'));var timeout=require(_0xab5d('0x2'));var express=require(_0xab5d('0x3'));var router=express[_0xab5d('0x4')]();var auth=require(_0xab5d('0x5'));var interaction=require(_0xab5d('0x6'));var config=require(_0xab5d('0x7'));var controller=require(_0xab5d('0x8'));router[_0xab5d('0x9')]('/',auth[_0xab5d('0xa')](),controller[_0xab5d('0xb')]);router[_0xab5d('0x9')](_0xab5d('0xc'),auth[_0xab5d('0xa')](),controller[_0xab5d('0xd')]);router[_0xab5d('0x9')](_0xab5d('0xe'),auth[_0xab5d('0xa')](),controller['getConfigurations']);router[_0xab5d('0x9')]('/:id/fields',auth[_0xab5d('0xa')](),controller[_0xab5d('0xf')]);router[_0xab5d('0x10')]('/',auth[_0xab5d('0xa')](),controller[_0xab5d('0x11')]);router['post'](_0xab5d('0xe'),auth['isAuthenticated'](),controller[_0xab5d('0x12')]);router[_0xab5d('0x13')]('/:id',auth[_0xab5d('0xa')](),controller[_0xab5d('0x14')]);router[_0xab5d('0x15')](_0xab5d('0xc'),auth[_0xab5d('0xa')](),controller[_0xab5d('0x16')]);module[_0xab5d('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
index a245598..809d5f0 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2285=['STRING','remoteUri','exports'];(function(_0x2a3c0a,_0x163f5c){var _0x1703a2=function(_0x471dfe){while(--_0x471dfe){_0x2a3c0a['push'](_0x2a3c0a['shift']());}};_0x1703a2(++_0x163f5c);}(_0x2285,0x80));var _0x5228=function(_0x5a34e5,_0x2aa9e9){_0x5a34e5=_0x5a34e5-0x0;var _0x3f98a5=_0x2285[_0x5a34e5];return _0x3f98a5;};'use strict';var Sequelize=require('sequelize');module[_0x5228('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5228('0x1')]},'username':{'type':Sequelize[_0x5228('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x5228('0x1')]},'remoteUri':{'type':Sequelize[_0x5228('0x1')],'unique':_0x5228('0x2')},'serverUrl':{'type':Sequelize[_0x5228('0x1')]}};
\ No newline at end of file
+var _0x6409=['exports','STRING','username','remoteUri'];(function(_0x3d2438,_0x2e7922){var _0xd18de5=function(_0xe8a130){while(--_0xe8a130){_0x3d2438['push'](_0x3d2438['shift']());}};_0xd18de5(++_0x2e7922);}(_0x6409,0x118));var _0x9640=function(_0x10a4b2,_0x2d9f07){_0x10a4b2=_0x10a4b2-0x0;var _0x453cf7=_0x6409[_0x10a4b2];return _0x453cf7;};'use strict';var Sequelize=require('sequelize');module[_0x9640('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9640('0x1')]},'username':{'type':Sequelize[_0x9640('0x1')],'unique':_0x9640('0x2')},'password':{'type':Sequelize[_0x9640('0x1')]},'remoteUri':{'type':Sequelize[_0x9640('0x1')],'unique':_0x9640('0x3')},'serverUrl':{'type':Sequelize[_0x9640('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
index 4f0f747..dd33a84 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x559d=['http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','index','SugarcrmAccount','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options','count','includeAll','include','findAll','show','params','rawAttributes','find','create','body','findOne','SugarcrmConfiguration','getConfigurations','AccountId','getSubjects','channel','getDescriptions','SugarcrmField','Subjects','Descriptions','getFields','created_by','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','format','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','%s%s','get_module_fields','Calls','values','module_fields','remove','label','endsWith','value','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client'];(function(_0x28b880,_0x2049c4){var _0x4f6d65=function(_0x20748f){while(--_0x20748f){_0x28b880['push'](_0x28b880['shift']());}};_0x4f6d65(++_0x2049c4);}(_0x559d,0x1e9));var _0xd559=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x559d[_0x37cc52];return _0x2b4a90;};'use strict';var pdf=require(_0xd559('0x0'));var emlformat=require(_0xd559('0x1'));var rimraf=require(_0xd559('0x2'));var zipdir=require(_0xd559('0x3'));var jsonpatch=require(_0xd559('0x4'));var rp=require(_0xd559('0x5'));var moment=require(_0xd559('0x6'));var BPromise=require(_0xd559('0x7'));var Mustache=require(_0xd559('0x8'));var util=require(_0xd559('0x9'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd559('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd559('0xb'));var crypto=require('crypto');var jsforce=require(_0xd559('0xc'));var deskjs=require(_0xd559('0xd'));var toCsv=require(_0xd559('0xe'));var querystring=require(_0xd559('0xf'));var Papa=require(_0xd559('0x10'));var Redis=require('ioredis');var authService=require(_0xd559('0x11'));var qs=require(_0xd559('0x12'));var hardwareService=require(_0xd559('0x13'));var logger=require(_0xd559('0x14'))(_0xd559('0x15'));var utils=require(_0xd559('0x16'));var config=require(_0xd559('0x17'));var db=require(_0xd559('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xd559('0x19'));var client=jayson[_0xd559('0x1a')][_0xd559('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x439745,_0x3d7fa6,_0x5d5e09){if(_0x5d5e09){var _0x6158f8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6158f8[_0xd559('0x1c')](_0x3d7fa6)){return _0x439745;}else{throw new Error(_0xd559('0x1d'));}}else{return _0x439745;}}function respondWithRpcPromise(_0x28f23e,_0x439cf9,_0x5e78dd,_0xa135a9){return new BPromise(function(_0x41a62a,_0x452374){var _0x2a61ef=_0xa135a9||client;return _0x2a61ef[_0xd559('0x1e')](_0x28f23e,_0x5e78dd)['then'](function(_0x1b555b){logger[_0xd559('0x1f')](_0xd559('0x20'),_0x439cf9,_0xd559('0x21'));logger[_0xd559('0x22')](_0xd559('0x23'),_0x439cf9,_0xd559('0x21'),JSON[_0xd559('0x24')](_0x1b555b));if(_0x1b555b[_0xd559('0x25')]){if(_0x1b555b[_0xd559('0x25')]['code']===0x1f4){logger[_0xd559('0x25')]('SugarcrmAccount,\x20%s,\x20%s',_0x439cf9,_0x1b555b[_0xd559('0x25')][_0xd559('0x26')]);return _0x452374(_0x1b555b[_0xd559('0x25')]['message']);}logger[_0xd559('0x25')](_0xd559('0x20'),_0x439cf9,_0x1b555b[_0xd559('0x25')]['message']);return _0x41a62a(_0x1b555b[_0xd559('0x25')]['message']);}else{logger[_0xd559('0x1f')](_0xd559('0x20'),_0x439cf9,_0xd559('0x21'));_0x41a62a(_0x1b555b['result']['message']);}})[_0xd559('0x27')](function(_0xac3d39){logger[_0xd559('0x25')](_0xd559('0x20'),_0x439cf9,_0xac3d39);_0x452374(_0xac3d39);});});}function respondWithStatusCode(_0x964430,_0x4d5993){_0x4d5993=_0x4d5993||0xcc;return function(_0x3a501b){if(_0x3a501b){return _0x964430[_0xd559('0x28')](_0x4d5993);}return _0x964430[_0xd559('0x29')](_0x4d5993)[_0xd559('0x2a')]();};}function respondWithResult(_0x1d526d,_0x174ed0){_0x174ed0=_0x174ed0||0xc8;return function(_0xa9faf6){if(_0xa9faf6){return _0x1d526d['status'](_0x174ed0)[_0xd559('0x2b')](_0xa9faf6);}};}function respondWithFilteredResult(_0xc44eb9,_0x23965f){return function(_0x25736){if(_0x25736){var _0x12daf9=_0x25736['count'],_0x4a4a92=_0x23965f[_0xd559('0x2c')],_0x21b099=_0x23965f['offset']+_0x23965f[_0xd559('0x2d')],_0x46b51d;if(_0x21b099>=_0x12daf9){_0x21b099=_0x12daf9;_0x46b51d=0xc8;}else{_0x46b51d=0xce;}_0xc44eb9['status'](_0x46b51d);return _0xc44eb9[_0xd559('0x2e')](_0xd559('0x2f'),_0x4a4a92+'-'+_0x21b099+'/'+_0x12daf9)[_0xd559('0x2b')](_0x25736);}return null;};}function patchUpdates(_0x1e4942){return function(_0x53df3d){try{jsonpatch[_0xd559('0x30')](_0x53df3d,_0x1e4942,!![]);}catch(_0x3e7c8f){return BPromise['reject'](_0x3e7c8f);}return _0x53df3d['save']();};}function saveUpdates(_0x30d3e2,_0xa69fba){return function(_0x4431dc){if(_0x4431dc){return _0x4431dc[_0xd559('0x31')](_0x30d3e2)[_0xd559('0x32')](function(_0x39c3f4){return _0x39c3f4;});}return null;};}function removeEntity(_0x1b83f4,_0x54db2b){return function(_0x5135b8){if(_0x5135b8){return _0x5135b8[_0xd559('0x33')]()[_0xd559('0x32')](function(){_0x1b83f4[_0xd559('0x29')](0xcc)[_0xd559('0x2a')]();});}};}function handleEntityNotFound(_0x354501,_0x1eab12){return function(_0x5db070){if(!_0x5db070){_0x354501[_0xd559('0x28')](0x194);}return _0x5db070;};}function handleError(_0x2d9e90,_0x1d917d){_0x1d917d=_0x1d917d||0x1f4;return function(_0x2983a7){logger[_0xd559('0x25')](_0x2983a7[_0xd559('0x34')]);if(_0x2983a7[_0xd559('0x35')]){delete _0x2983a7[_0xd559('0x35')];}_0x2d9e90[_0xd559('0x29')](_0x1d917d)[_0xd559('0x36')](_0x2983a7);};}exports[_0xd559('0x37')]=function(_0x142546,_0x5cecc4){var _0x4e9ca0={},_0x3f1d50={},_0x3af0e7={'count':0x0,'rows':[]};var _0x47e85=db[_0xd559('0x38')]['rawAttributes'];_0x3f1d50['model']=_[_0xd559('0x39')](_0x47e85);_0x3f1d50[_0xd559('0x3a')]=_[_0xd559('0x39')](_0x142546[_0xd559('0x3a')]);_0x3f1d50[_0xd559('0x3b')]=_[_0xd559('0x3c')](_0x3f1d50['model'],_0x3f1d50[_0xd559('0x3a')]);_0x4e9ca0['attributes']=_[_0xd559('0x3c')](_0x3f1d50['model'],qs[_0xd559('0x3d')](_0x142546['query'][_0xd559('0x3d')]));_0x4e9ca0[_0xd559('0x3e')]=_0x4e9ca0[_0xd559('0x3e')][_0xd559('0x3f')]?_0x4e9ca0['attributes']:_0x3f1d50[_0xd559('0x40')];if(!_0x142546[_0xd559('0x3a')][_0xd559('0x41')](_0xd559('0x42'))){_0x4e9ca0['limit']=qs['limit'](_0x142546[_0xd559('0x3a')][_0xd559('0x2d')]);_0x4e9ca0[_0xd559('0x2c')]=qs[_0xd559('0x2c')](_0x142546[_0xd559('0x3a')]['offset']);}_0x4e9ca0[_0xd559('0x43')]=qs[_0xd559('0x44')](_0x142546['query'][_0xd559('0x44')]);_0x4e9ca0[_0xd559('0x45')]=qs[_0xd559('0x3b')](_[_0xd559('0x46')](_0x142546[_0xd559('0x3a')],_0x3f1d50[_0xd559('0x3b')]));if(_0x142546[_0xd559('0x3a')][_0xd559('0x47')]){_0x4e9ca0['where']=_[_0xd559('0x48')](_0x4e9ca0['where'],{'$or':_[_0xd559('0x49')](_0x47e85,function(_0x30e853){if(_0x30e853[_0xd559('0x4a')]['key']!=='VIRTUAL'){var _0x5d07ca={};_0x5d07ca[_0x30e853[_0xd559('0x4b')]]={'$like':'%'+_0x142546[_0xd559('0x3a')][_0xd559('0x47')]+'%'};return _0x5d07ca;}})});}_0x4e9ca0=_[_0xd559('0x48')]({},_0x4e9ca0,_0x142546[_0xd559('0x4c')]);var _0x56b5d4={'where':_0x4e9ca0[_0xd559('0x45')]};return db['SugarcrmAccount'][_0xd559('0x4d')](_0x56b5d4)[_0xd559('0x32')](function(_0xd2502f){_0x3af0e7[_0xd559('0x4d')]=_0xd2502f;if(_0x142546[_0xd559('0x3a')][_0xd559('0x4e')]){_0x4e9ca0[_0xd559('0x4f')]=[{'all':!![]}];}return db[_0xd559('0x38')][_0xd559('0x50')](_0x4e9ca0);})['then'](function(_0x559bc3){_0x3af0e7['rows']=_0x559bc3;return _0x3af0e7;})['then'](respondWithFilteredResult(_0x5cecc4,_0x4e9ca0))['catch'](handleError(_0x5cecc4,null));};exports[_0xd559('0x51')]=function(_0x2be99c,_0x377855){var _0x2c6ff5={'raw':![],'where':{'id':_0x2be99c[_0xd559('0x52')]['id']}},_0x45bc72={};_0x45bc72[_0xd559('0x40')]=_[_0xd559('0x39')](db[_0xd559('0x38')][_0xd559('0x53')]);_0x45bc72[_0xd559('0x3a')]=_[_0xd559('0x39')](_0x2be99c[_0xd559('0x3a')]);_0x45bc72['filters']=_[_0xd559('0x3c')](_0x45bc72['model'],_0x45bc72[_0xd559('0x3a')]);_0x2c6ff5[_0xd559('0x3e')]=_[_0xd559('0x3c')](_0x45bc72[_0xd559('0x40')],qs[_0xd559('0x3d')](_0x2be99c[_0xd559('0x3a')][_0xd559('0x3d')]));_0x2c6ff5['attributes']=_0x2c6ff5[_0xd559('0x3e')][_0xd559('0x3f')]?_0x2c6ff5[_0xd559('0x3e')]:_0x45bc72[_0xd559('0x40')];if(_0x2be99c[_0xd559('0x3a')][_0xd559('0x4e')]){_0x2c6ff5[_0xd559('0x4f')]=[{'all':!![]}];}_0x2c6ff5=_[_0xd559('0x48')]({},_0x2c6ff5,_0x2be99c[_0xd559('0x4c')]);return db['SugarcrmAccount'][_0xd559('0x54')](_0x2c6ff5)[_0xd559('0x32')](handleEntityNotFound(_0x377855,null))[_0xd559('0x32')](respondWithResult(_0x377855,null))[_0xd559('0x27')](handleError(_0x377855,null));};exports[_0xd559('0x55')]=function(_0x20a33c,_0x5a1f86){return db[_0xd559('0x38')][_0xd559('0x55')](_0x20a33c[_0xd559('0x56')],{})[_0xd559('0x32')](respondWithResult(_0x5a1f86,0xc9))[_0xd559('0x27')](handleError(_0x5a1f86,null));};exports[_0xd559('0x31')]=function(_0x170291,_0x1ca676){if(_0x170291[_0xd559('0x56')]['id']){delete _0x170291['body']['id'];}return db[_0xd559('0x38')][_0xd559('0x54')]({'where':{'id':_0x170291[_0xd559('0x52')]['id']}})[_0xd559('0x32')](handleEntityNotFound(_0x1ca676,null))[_0xd559('0x32')](saveUpdates(_0x170291[_0xd559('0x56')],null))[_0xd559('0x32')](respondWithResult(_0x1ca676,null))[_0xd559('0x27')](handleError(_0x1ca676,null));};exports[_0xd559('0x33')]=function(_0x2e9425,_0x400a8a){return db[_0xd559('0x38')][_0xd559('0x54')]({'where':{'id':_0x2e9425[_0xd559('0x52')]['id']}})[_0xd559('0x32')](handleEntityNotFound(_0x400a8a,null))[_0xd559('0x32')](removeEntity(_0x400a8a,null))[_0xd559('0x27')](handleError(_0x400a8a,null));};exports['getConfigurations']=function(_0x4b1251,_0x5cf9d7,_0x82e7c9){var _0x71c985={};var _0x2decd7={};var _0x892e6c;var _0x423c1b;return db['SugarcrmAccount'][_0xd559('0x57')]({'where':{'id':_0x4b1251[_0xd559('0x52')]['id']}})[_0xd559('0x32')](handleEntityNotFound(_0x5cf9d7,null))[_0xd559('0x32')](function(_0xb66933){if(_0xb66933){_0x892e6c=_0xb66933;_0x2decd7['model']=_[_0xd559('0x39')](db[_0xd559('0x58')]['rawAttributes']);_0x2decd7[_0xd559('0x3a')]=_[_0xd559('0x39')](_0x4b1251[_0xd559('0x3a')]);_0x2decd7[_0xd559('0x3b')]=_[_0xd559('0x3c')](_0x2decd7[_0xd559('0x40')],_0x2decd7[_0xd559('0x3a')]);_0x71c985[_0xd559('0x3e')]=_[_0xd559('0x3c')](_0x2decd7['model'],qs[_0xd559('0x3d')](_0x4b1251[_0xd559('0x3a')][_0xd559('0x3d')]));_0x71c985['attributes']=_0x71c985[_0xd559('0x3e')][_0xd559('0x3f')]?_0x71c985[_0xd559('0x3e')]:_0x2decd7[_0xd559('0x40')];_0x71c985[_0xd559('0x43')]=qs[_0xd559('0x44')](_0x4b1251[_0xd559('0x3a')][_0xd559('0x44')]);_0x71c985[_0xd559('0x45')]=qs[_0xd559('0x3b')](_['pick'](_0x4b1251[_0xd559('0x3a')],_0x2decd7['filters']));if(_0x4b1251[_0xd559('0x3a')][_0xd559('0x47')]){_0x71c985[_0xd559('0x45')]=_[_0xd559('0x48')](_0x71c985['where'],{'$or':_[_0xd559('0x49')](_0x71c985['attributes'],function(_0x36fac1){var _0x45406c={};_0x45406c[_0x36fac1]={'$like':'%'+_0x4b1251['query'][_0xd559('0x47')]+'%'};return _0x45406c;})});}_0x71c985=_['merge']({},_0x71c985,_0x4b1251[_0xd559('0x4c')]);return _0x892e6c[_0xd559('0x59')](_0x71c985);}})[_0xd559('0x32')](function(_0x1326a1){if(_0x1326a1){_0x423c1b=_0x1326a1[_0xd559('0x3f')];if(!_0x4b1251['query'][_0xd559('0x41')](_0xd559('0x42'))){_0x71c985[_0xd559('0x2d')]=qs[_0xd559('0x2d')](_0x4b1251[_0xd559('0x3a')]['limit']);_0x71c985[_0xd559('0x2c')]=qs[_0xd559('0x2c')](_0x4b1251['query'][_0xd559('0x2c')]);}return _0x892e6c[_0xd559('0x59')](_0x71c985);}})[_0xd559('0x32')](function(_0x1f662d){if(_0x1f662d){return _0x1f662d?{'count':_0x423c1b,'rows':_0x1f662d}:null;}})[_0xd559('0x32')](respondWithResult(_0x5cf9d7,null))[_0xd559('0x27')](handleError(_0x5cf9d7,null));};exports['addConfiguration']=function(_0x117926,_0x2c6cb0,_0x17d660){if(_0x117926['body']['id']){delete _0x117926[_0xd559('0x56')]['id'];}return db[_0xd559('0x38')]['findOne']({'where':{'id':_0x117926[_0xd559('0x52')]['id']}})[_0xd559('0x32')](handleEntityNotFound(_0x2c6cb0,null))['then'](function(_0x48f59f){if(_0x48f59f){_0x117926[_0xd559('0x56')][_0xd559('0x5a')]=_0x48f59f['id'];_0x117926[_0xd559('0x56')]['Subjects']=integrations[_0xd559('0x5b')](_0x117926[_0xd559('0x56')][_0xd559('0x5c')],_0x117926[_0xd559('0x56')]['type']);_0x117926[_0xd559('0x56')]['Descriptions']=integrations[_0xd559('0x5d')](_0x117926[_0xd559('0x56')][_0xd559('0x5c')],_0x117926[_0xd559('0x56')][_0xd559('0x4a')]);return db[_0xd559('0x58')][_0xd559('0x55')](_0x117926[_0xd559('0x56')],{'include':[{'model':db[_0xd559('0x5e')],'as':_0xd559('0x5f')},{'model':db[_0xd559('0x5e')],'as':_0xd559('0x60')}]});}return null;})[_0xd559('0x32')](respondWithResult(_0x2c6cb0,null))[_0xd559('0x27')](handleError(_0x2c6cb0,null));};exports[_0xd559('0x61')]=function(_0x477510,_0x48cd6d,_0x179190){var _0x189ae1='';var _0x5c704e=['id',_0xd559('0x35'),'assigned_user_id',_0xd559('0x62'),'description',_0xd559('0x63'),_0xd559('0x64'),'duration_minutes',_0xd559('0x65'),_0xd559('0x66'),_0xd559('0x67'),_0xd559('0x68')];return db[_0xd559('0x38')][_0xd559('0x57')]({'where':{'id':_0x477510[_0xd559('0x52')]['id']},'attributes':['id',_0xd559('0x69'),_0xd559('0x6a'),_0xd559('0x6b')]})[_0xd559('0x32')](handleEntityNotFound(_0x48cd6d,null))['then'](function(_0x1bd14f){if(_0x1bd14f){_0x189ae1=_0x1bd14f[_0xd559('0x6b')];var _0x181699=_0x189ae1[_0xd559('0x6c')](-0x1);if(_0x181699==='/'){_0x189ae1=_0x189ae1['substring'](0x0,_0x189ae1['lastIndexOf'](_0x181699));}return rp({'method':'POST','uri':util[_0xd559('0x6d')]('%s%s',_0x189ae1,_0xd559('0x6e')),'json':!![],'form':{'method':_0xd559('0x6f'),'input_type':'JSON','response_type':_0xd559('0x70'),'rest_data':JSON[_0xd559('0x24')]({'user_auth':{'user_name':_0x1bd14f[_0xd559('0x69')],'password':_0x1bd14f['password'],'encryption':_0xd559('0x71')},'application':_0xd559('0x72')})}});}})[_0xd559('0x32')](function(_0x109df7){if(_0x109df7&&_0x109df7[_0xd559('0x35')]!==_0xd559('0x73')&&_0x109df7['name']!==_0xd559('0x74')){return rp({'method':_0xd559('0x75'),'uri':util[_0xd559('0x6d')](_0xd559('0x76'),_0x189ae1,_0xd559('0x6e')),'json':!![],'form':{'method':_0xd559('0x77'),'input_type':'JSON','response_type':_0xd559('0x70'),'rest_data':JSON[_0xd559('0x24')]({'session':_0x109df7['id'],'module_name':_0xd559('0x78')})}})[_0xd559('0x32')](function(_0x512b88){if(_0x512b88){var _0x2e9b66=_[_0xd559('0x79')](_0x512b88[_0xd559('0x7a')]);_[_0xd559('0x7b')](_0x2e9b66,function(_0x5aa379){return _0x5c704e['includes'](_0x5aa379[_0xd559('0x35')]);});return{'count':_0x2e9b66[_0xd559('0x3f')],'rows':_[_0xd559('0x49')](_0x2e9b66,function(_0x267ba2){return{'id':_0x267ba2[_0xd559('0x35')],'name':_0x267ba2[_0xd559('0x7c')],'custom':_[_0xd559('0x7d')](_0x267ba2['name'],'_c')?!![]:![],'options':_0x267ba2['options']?_['map'](_[_0xd559('0x79')](_0x267ba2['options']),function(_0x19d06a){return{'name':_0x19d06a[_0xd559('0x7e')],'value':_0x19d06a[_0xd559('0x35')]};}):[]};})};}})[_0xd559('0x32')](respondWithResult(_0x48cd6d,null))[_0xd559('0x27')](function(_0x23b408){var _0x1a6953=_0x477510[_0xd559('0x3a')][_0xd559('0x1c')]?0x1f4:_0x23b408[_0xd559('0x7f')]||0x1f4;logger[_0xd559('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xd559('0x61'),_0x1a6953,JSON[_0xd559('0x24')](_0x23b408));delete _0x23b408['name'];if(_0x1a6953===0x191){_0x1a6953=0x190;}_0x48cd6d[_0xd559('0x29')](_0x1a6953)[_0xd559('0x36')](_0x477510[_0xd559('0x3a')][_0xd559('0x1c')]?{'message':_0xd559('0x80'),'statusCode':_0x23b408[_0xd559('0x7f')]}:_0x23b408);});}else{var _0x5a8a78=0x1f4;_0x48cd6d[_0xd559('0x29')](_0x5a8a78)[_0xd559('0x36')]({'message':_0xd559('0x80'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0xc690=['name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','merge','options','includeAll','include','SugarcrmAccount','findAll','rows','show','params','create','body','update','find','SugarcrmConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Descriptions','getDescriptions','channel','getFields','assigned_user_id','description','duration_hours','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','POST','%s%s','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','values','module_fields','remove','includes','label','endsWith','value','statusCode','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then'];(function(_0x337449,_0x783e2f){var _0xed97ef=function(_0x13b255){while(--_0x13b255){_0x337449['push'](_0x337449['shift']());}};_0xed97ef(++_0x783e2f);}(_0xc690,0x1b8));var _0x0c69=function(_0x5524e7,_0x3b6a9c){_0x5524e7=_0x5524e7-0x0;var _0x225eb8=_0xc690[_0x5524e7];return _0x225eb8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0c69('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0c69('0x1'));var rp=require(_0x0c69('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0c69('0x3'));var util=require('util');var path=require(_0x0c69('0x4'));var sox=require(_0x0c69('0x5'));var csv=require(_0x0c69('0x6'));var ejs=require(_0x0c69('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0c69('0x8'));var jsforce=require(_0x0c69('0x9'));var deskjs=require(_0x0c69('0xa'));var toCsv=require(_0x0c69('0x6'));var querystring=require(_0x0c69('0xb'));var Papa=require('papaparse');var Redis=require(_0x0c69('0xc'));var authService=require(_0x0c69('0xd'));var qs=require(_0x0c69('0xe'));var hardwareService=require(_0x0c69('0xf'));var logger=require(_0x0c69('0x10'))(_0x0c69('0x11'));var utils=require('../../config/utils');var config=require(_0x0c69('0x12'));var db=require(_0x0c69('0x13'))['db'];var integrations=require(_0x0c69('0x14'));var jayson=require(_0x0c69('0x15'));var client=jayson['client'][_0x0c69('0x16')]({'port':0x232a});function checkPasswordPattern(_0x534ed9,_0x58dcf5,_0x5ee666){if(_0x5ee666){var _0x3c9467=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3c9467[_0x0c69('0x17')](_0x58dcf5)){return _0x534ed9;}else{throw new Error(_0x0c69('0x18'));}}else{return _0x534ed9;}}function respondWithRpcPromise(_0x2f2be0,_0x1545cf,_0x28db70,_0x267dd6){return new BPromise(function(_0x16b6c5,_0x1ad0b3){var _0x16da0e=_0x267dd6||client;return _0x16da0e[_0x0c69('0x19')](_0x2f2be0,_0x28db70)['then'](function(_0x367dba){logger[_0x0c69('0x1a')](_0x0c69('0x1b'),_0x1545cf,_0x0c69('0x1c'));logger[_0x0c69('0x1d')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1545cf,'request\x20sent',JSON['stringify'](_0x367dba));if(_0x367dba[_0x0c69('0x1e')]){if(_0x367dba['error'][_0x0c69('0x1f')]===0x1f4){logger[_0x0c69('0x1e')](_0x0c69('0x1b'),_0x1545cf,_0x367dba[_0x0c69('0x1e')][_0x0c69('0x20')]);return _0x1ad0b3(_0x367dba[_0x0c69('0x1e')]['message']);}logger[_0x0c69('0x1e')]('SugarcrmAccount,\x20%s,\x20%s',_0x1545cf,_0x367dba[_0x0c69('0x1e')][_0x0c69('0x20')]);return _0x16b6c5(_0x367dba['error'][_0x0c69('0x20')]);}else{logger[_0x0c69('0x1a')](_0x0c69('0x1b'),_0x1545cf,_0x0c69('0x1c'));_0x16b6c5(_0x367dba['result'][_0x0c69('0x20')]);}})[_0x0c69('0x21')](function(_0xb3ddbc){logger[_0x0c69('0x1e')](_0x0c69('0x1b'),_0x1545cf,_0xb3ddbc);_0x1ad0b3(_0xb3ddbc);});});}function respondWithStatusCode(_0x3bf54b,_0x512c03){_0x512c03=_0x512c03||0xcc;return function(_0x3ce1da){if(_0x3ce1da){return _0x3bf54b[_0x0c69('0x22')](_0x512c03);}return _0x3bf54b[_0x0c69('0x23')](_0x512c03)[_0x0c69('0x24')]();};}function respondWithResult(_0x50550a,_0x38f734){_0x38f734=_0x38f734||0xc8;return function(_0x2fab14){if(_0x2fab14){return _0x50550a[_0x0c69('0x23')](_0x38f734)[_0x0c69('0x25')](_0x2fab14);}};}function respondWithFilteredResult(_0x2cf105,_0x53113a){return function(_0x3a13fa){if(_0x3a13fa){var _0x5ad1e7=_0x3a13fa[_0x0c69('0x26')],_0x3a80ed=_0x53113a[_0x0c69('0x27')],_0xd21feb=_0x53113a[_0x0c69('0x27')]+_0x53113a[_0x0c69('0x28')],_0x3b817;if(_0xd21feb>=_0x5ad1e7){_0xd21feb=_0x5ad1e7;_0x3b817=0xc8;}else{_0x3b817=0xce;}_0x2cf105[_0x0c69('0x23')](_0x3b817);return _0x2cf105[_0x0c69('0x29')](_0x0c69('0x2a'),_0x3a80ed+'-'+_0xd21feb+'/'+_0x5ad1e7)[_0x0c69('0x25')](_0x3a13fa);}return null;};}function patchUpdates(_0x1cbeb4){return function(_0x49016f){try{jsonpatch[_0x0c69('0x2b')](_0x49016f,_0x1cbeb4,!![]);}catch(_0x32aeeb){return BPromise[_0x0c69('0x2c')](_0x32aeeb);}return _0x49016f[_0x0c69('0x2d')]();};}function saveUpdates(_0x23e587,_0x62785){return function(_0x46a84c){if(_0x46a84c){return _0x46a84c['update'](_0x23e587)['then'](function(_0x2db44c){return _0x2db44c;});}return null;};}function removeEntity(_0x6dc200,_0x3e3441){return function(_0x58c471){if(_0x58c471){return _0x58c471[_0x0c69('0x2e')]()[_0x0c69('0x2f')](function(){_0x6dc200[_0x0c69('0x23')](0xcc)[_0x0c69('0x24')]();});}};}function handleEntityNotFound(_0x2ed545,_0x385022){return function(_0xd31e4){if(!_0xd31e4){_0x2ed545[_0x0c69('0x22')](0x194);}return _0xd31e4;};}function handleError(_0x18b4a9,_0x12e920){_0x12e920=_0x12e920||0x1f4;return function(_0x3b7a42){logger[_0x0c69('0x1e')](_0x3b7a42['stack']);if(_0x3b7a42[_0x0c69('0x30')]){delete _0x3b7a42[_0x0c69('0x30')];}_0x18b4a9[_0x0c69('0x23')](_0x12e920)[_0x0c69('0x31')](_0x3b7a42);};}exports[_0x0c69('0x32')]=function(_0x2e5644,_0x106fa6){var _0x4894e9={},_0x45da52={},_0xc45125={'count':0x0,'rows':[]};var _0x5ba8fd=db['SugarcrmAccount'][_0x0c69('0x33')];_0x45da52[_0x0c69('0x34')]=_[_0x0c69('0x35')](_0x5ba8fd);_0x45da52[_0x0c69('0x36')]=_[_0x0c69('0x35')](_0x2e5644[_0x0c69('0x36')]);_0x45da52[_0x0c69('0x37')]=_[_0x0c69('0x38')](_0x45da52[_0x0c69('0x34')],_0x45da52[_0x0c69('0x36')]);_0x4894e9[_0x0c69('0x39')]=_['intersection'](_0x45da52[_0x0c69('0x34')],qs[_0x0c69('0x3a')](_0x2e5644[_0x0c69('0x36')][_0x0c69('0x3a')]));_0x4894e9['attributes']=_0x4894e9['attributes'][_0x0c69('0x3b')]?_0x4894e9['attributes']:_0x45da52[_0x0c69('0x34')];if(!_0x2e5644['query'][_0x0c69('0x3c')](_0x0c69('0x3d'))){_0x4894e9['limit']=qs[_0x0c69('0x28')](_0x2e5644[_0x0c69('0x36')][_0x0c69('0x28')]);_0x4894e9[_0x0c69('0x27')]=qs[_0x0c69('0x27')](_0x2e5644[_0x0c69('0x36')][_0x0c69('0x27')]);}_0x4894e9[_0x0c69('0x3e')]=qs[_0x0c69('0x3f')](_0x2e5644[_0x0c69('0x36')]['sort']);_0x4894e9[_0x0c69('0x40')]=qs[_0x0c69('0x37')](_[_0x0c69('0x41')](_0x2e5644['query'],_0x45da52['filters']));if(_0x2e5644[_0x0c69('0x36')][_0x0c69('0x42')]){_0x4894e9['where']=_['merge'](_0x4894e9[_0x0c69('0x40')],{'$or':_[_0x0c69('0x43')](_0x5ba8fd,function(_0x3427c8){if(_0x3427c8[_0x0c69('0x44')][_0x0c69('0x45')]!==_0x0c69('0x46')){var _0x1fbde0={};_0x1fbde0[_0x3427c8['field']]={'$like':'%'+_0x2e5644[_0x0c69('0x36')][_0x0c69('0x42')]+'%'};return _0x1fbde0;}})});}_0x4894e9=_[_0x0c69('0x47')]({},_0x4894e9,_0x2e5644[_0x0c69('0x48')]);var _0x1476e1={'where':_0x4894e9[_0x0c69('0x40')]};return db['SugarcrmAccount'][_0x0c69('0x26')](_0x1476e1)[_0x0c69('0x2f')](function(_0x2976f7){_0xc45125[_0x0c69('0x26')]=_0x2976f7;if(_0x2e5644[_0x0c69('0x36')][_0x0c69('0x49')]){_0x4894e9[_0x0c69('0x4a')]=[{'all':!![]}];}return db[_0x0c69('0x4b')][_0x0c69('0x4c')](_0x4894e9);})[_0x0c69('0x2f')](function(_0x30f7f0){_0xc45125[_0x0c69('0x4d')]=_0x30f7f0;return _0xc45125;})[_0x0c69('0x2f')](respondWithFilteredResult(_0x106fa6,_0x4894e9))[_0x0c69('0x21')](handleError(_0x106fa6,null));};exports[_0x0c69('0x4e')]=function(_0x580596,_0x28a8bb){var _0x2de180={'raw':![],'where':{'id':_0x580596[_0x0c69('0x4f')]['id']}},_0x1bce85={};_0x1bce85['model']=_[_0x0c69('0x35')](db[_0x0c69('0x4b')]['rawAttributes']);_0x1bce85[_0x0c69('0x36')]=_[_0x0c69('0x35')](_0x580596[_0x0c69('0x36')]);_0x1bce85[_0x0c69('0x37')]=_[_0x0c69('0x38')](_0x1bce85[_0x0c69('0x34')],_0x1bce85[_0x0c69('0x36')]);_0x2de180[_0x0c69('0x39')]=_[_0x0c69('0x38')](_0x1bce85[_0x0c69('0x34')],qs[_0x0c69('0x3a')](_0x580596[_0x0c69('0x36')][_0x0c69('0x3a')]));_0x2de180[_0x0c69('0x39')]=_0x2de180[_0x0c69('0x39')]['length']?_0x2de180['attributes']:_0x1bce85[_0x0c69('0x34')];if(_0x580596[_0x0c69('0x36')][_0x0c69('0x49')]){_0x2de180[_0x0c69('0x4a')]=[{'all':!![]}];}_0x2de180=_[_0x0c69('0x47')]({},_0x2de180,_0x580596['options']);return db[_0x0c69('0x4b')]['find'](_0x2de180)['then'](handleEntityNotFound(_0x28a8bb,null))[_0x0c69('0x2f')](respondWithResult(_0x28a8bb,null))[_0x0c69('0x21')](handleError(_0x28a8bb,null));};exports[_0x0c69('0x50')]=function(_0x3814ba,_0x183fce){return db[_0x0c69('0x4b')][_0x0c69('0x50')](_0x3814ba[_0x0c69('0x51')],{})['then'](respondWithResult(_0x183fce,0xc9))[_0x0c69('0x21')](handleError(_0x183fce,null));};exports[_0x0c69('0x52')]=function(_0x41cb5e,_0x208fa8){if(_0x41cb5e[_0x0c69('0x51')]['id']){delete _0x41cb5e[_0x0c69('0x51')]['id'];}return db[_0x0c69('0x4b')]['find']({'where':{'id':_0x41cb5e[_0x0c69('0x4f')]['id']}})[_0x0c69('0x2f')](handleEntityNotFound(_0x208fa8,null))['then'](saveUpdates(_0x41cb5e[_0x0c69('0x51')],null))[_0x0c69('0x2f')](respondWithResult(_0x208fa8,null))[_0x0c69('0x21')](handleError(_0x208fa8,null));};exports[_0x0c69('0x2e')]=function(_0x447f6b,_0xf4c18d){return db[_0x0c69('0x4b')][_0x0c69('0x53')]({'where':{'id':_0x447f6b[_0x0c69('0x4f')]['id']}})[_0x0c69('0x2f')](handleEntityNotFound(_0xf4c18d,null))[_0x0c69('0x2f')](removeEntity(_0xf4c18d,null))[_0x0c69('0x21')](handleError(_0xf4c18d,null));};exports['getConfigurations']=function(_0x1f4b3f,_0x1b6006,_0x5bd148){var _0x3171cf={};var _0x2f63a1={};var _0x2e7756;var _0xf2e996;return db[_0x0c69('0x4b')]['findOne']({'where':{'id':_0x1f4b3f[_0x0c69('0x4f')]['id']}})[_0x0c69('0x2f')](handleEntityNotFound(_0x1b6006,null))[_0x0c69('0x2f')](function(_0x1d30f6){if(_0x1d30f6){_0x2e7756=_0x1d30f6;_0x2f63a1[_0x0c69('0x34')]=_['keys'](db[_0x0c69('0x54')][_0x0c69('0x33')]);_0x2f63a1[_0x0c69('0x36')]=_[_0x0c69('0x35')](_0x1f4b3f[_0x0c69('0x36')]);_0x2f63a1[_0x0c69('0x37')]=_[_0x0c69('0x38')](_0x2f63a1[_0x0c69('0x34')],_0x2f63a1[_0x0c69('0x36')]);_0x3171cf[_0x0c69('0x39')]=_[_0x0c69('0x38')](_0x2f63a1[_0x0c69('0x34')],qs[_0x0c69('0x3a')](_0x1f4b3f[_0x0c69('0x36')][_0x0c69('0x3a')]));_0x3171cf[_0x0c69('0x39')]=_0x3171cf[_0x0c69('0x39')][_0x0c69('0x3b')]?_0x3171cf[_0x0c69('0x39')]:_0x2f63a1[_0x0c69('0x34')];_0x3171cf[_0x0c69('0x3e')]=qs[_0x0c69('0x3f')](_0x1f4b3f[_0x0c69('0x36')][_0x0c69('0x3f')]);_0x3171cf[_0x0c69('0x40')]=qs[_0x0c69('0x37')](_[_0x0c69('0x41')](_0x1f4b3f[_0x0c69('0x36')],_0x2f63a1['filters']));if(_0x1f4b3f[_0x0c69('0x36')]['filter']){_0x3171cf[_0x0c69('0x40')]=_['merge'](_0x3171cf[_0x0c69('0x40')],{'$or':_['map'](_0x3171cf['attributes'],function(_0x3e2881){var _0x70bf9d={};_0x70bf9d[_0x3e2881]={'$like':'%'+_0x1f4b3f[_0x0c69('0x36')][_0x0c69('0x42')]+'%'};return _0x70bf9d;})});}_0x3171cf=_[_0x0c69('0x47')]({},_0x3171cf,_0x1f4b3f['options']);return _0x2e7756[_0x0c69('0x55')](_0x3171cf);}})['then'](function(_0x3f8579){if(_0x3f8579){_0xf2e996=_0x3f8579[_0x0c69('0x3b')];if(!_0x1f4b3f[_0x0c69('0x36')][_0x0c69('0x3c')]('nolimit')){_0x3171cf[_0x0c69('0x28')]=qs[_0x0c69('0x28')](_0x1f4b3f[_0x0c69('0x36')]['limit']);_0x3171cf[_0x0c69('0x27')]=qs[_0x0c69('0x27')](_0x1f4b3f[_0x0c69('0x36')]['offset']);}return _0x2e7756['getConfigurations'](_0x3171cf);}})[_0x0c69('0x2f')](function(_0x12e813){if(_0x12e813){return _0x12e813?{'count':_0xf2e996,'rows':_0x12e813}:null;}})[_0x0c69('0x2f')](respondWithResult(_0x1b6006,null))[_0x0c69('0x21')](handleError(_0x1b6006,null));};exports[_0x0c69('0x56')]=function(_0x55ce38,_0x3ba08a,_0x27f356){if(_0x55ce38[_0x0c69('0x51')]['id']){delete _0x55ce38[_0x0c69('0x51')]['id'];}return db[_0x0c69('0x4b')][_0x0c69('0x57')]({'where':{'id':_0x55ce38[_0x0c69('0x4f')]['id']}})[_0x0c69('0x2f')](handleEntityNotFound(_0x3ba08a,null))[_0x0c69('0x2f')](function(_0x5089ea){if(_0x5089ea){_0x55ce38['body'][_0x0c69('0x58')]=_0x5089ea['id'];_0x55ce38[_0x0c69('0x51')]['Subjects']=integrations['getSubjects'](_0x55ce38['body']['channel'],_0x55ce38[_0x0c69('0x51')][_0x0c69('0x44')]);_0x55ce38[_0x0c69('0x51')][_0x0c69('0x59')]=integrations[_0x0c69('0x5a')](_0x55ce38['body'][_0x0c69('0x5b')],_0x55ce38[_0x0c69('0x51')][_0x0c69('0x44')]);return db[_0x0c69('0x54')][_0x0c69('0x50')](_0x55ce38[_0x0c69('0x51')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0x0c69('0x2f')](respondWithResult(_0x3ba08a,null))[_0x0c69('0x21')](handleError(_0x3ba08a,null));};exports[_0x0c69('0x5c')]=function(_0x525def,_0x2ca74c,_0x19bf5b){var _0x4e7091='';var _0x4b0f18=['id','name',_0x0c69('0x5d'),'created_by',_0x0c69('0x5e'),'date_start',_0x0c69('0x5f'),'duration_minutes',_0x0c69('0x60'),'parent_type',_0x0c69('0x61'),_0x0c69('0x62')];return db['SugarcrmAccount'][_0x0c69('0x57')]({'where':{'id':_0x525def[_0x0c69('0x4f')]['id']},'attributes':['id',_0x0c69('0x63'),_0x0c69('0x64'),_0x0c69('0x65')]})[_0x0c69('0x2f')](handleEntityNotFound(_0x2ca74c,null))[_0x0c69('0x2f')](function(_0x4901de){if(_0x4901de){_0x4e7091=_0x4901de[_0x0c69('0x65')];var _0x8c367a=_0x4e7091[_0x0c69('0x66')](-0x1);if(_0x8c367a==='/'){_0x4e7091=_0x4e7091[_0x0c69('0x67')](0x0,_0x4e7091['lastIndexOf'](_0x8c367a));}return rp({'method':_0x0c69('0x68'),'uri':util['format'](_0x0c69('0x69'),_0x4e7091,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x0c69('0x6a'),'response_type':_0x0c69('0x6a'),'rest_data':JSON[_0x0c69('0x6b')]({'user_auth':{'user_name':_0x4901de[_0x0c69('0x63')],'password':_0x4901de[_0x0c69('0x64')],'encryption':_0x0c69('0x6c')},'application':_0x0c69('0x6d')})}});}})[_0x0c69('0x2f')](function(_0x268e10){if(_0x268e10&&_0x268e10[_0x0c69('0x30')]!=='Invalid\x20Login'&&_0x268e10[_0x0c69('0x30')]!==_0x0c69('0x6e')){return rp({'method':_0x0c69('0x68'),'uri':util['format'](_0x0c69('0x69'),_0x4e7091,_0x0c69('0x6f')),'json':!![],'form':{'method':_0x0c69('0x70'),'input_type':'JSON','response_type':_0x0c69('0x6a'),'rest_data':JSON[_0x0c69('0x6b')]({'session':_0x268e10['id'],'module_name':'Calls'})}})[_0x0c69('0x2f')](function(_0x5b0e8b){if(_0x5b0e8b){var _0x219ec1=_[_0x0c69('0x71')](_0x5b0e8b[_0x0c69('0x72')]);_[_0x0c69('0x73')](_0x219ec1,function(_0x2b7a32){return _0x4b0f18[_0x0c69('0x74')](_0x2b7a32[_0x0c69('0x30')]);});return{'count':_0x219ec1[_0x0c69('0x3b')],'rows':_[_0x0c69('0x43')](_0x219ec1,function(_0x4ce416){return{'id':_0x4ce416[_0x0c69('0x30')],'name':_0x4ce416[_0x0c69('0x75')],'custom':_[_0x0c69('0x76')](_0x4ce416[_0x0c69('0x30')],'_c')?!![]:![],'options':_0x4ce416[_0x0c69('0x48')]?_[_0x0c69('0x43')](_['values'](_0x4ce416[_0x0c69('0x48')]),function(_0x40064a){return{'name':_0x40064a[_0x0c69('0x77')],'value':_0x40064a[_0x0c69('0x30')]};}):[]};})};}})[_0x0c69('0x2f')](respondWithResult(_0x2ca74c,null))['catch'](function(_0x3cb4a1){var _0x4e2c66=_0x525def[_0x0c69('0x36')][_0x0c69('0x17')]?0x1f4:_0x3cb4a1[_0x0c69('0x78')]||0x1f4;logger[_0x0c69('0x1e')]('getFields,\x20%s,\x20%s,\x20%s',_0x0c69('0x5c'),_0x4e2c66,JSON[_0x0c69('0x6b')](_0x3cb4a1));delete _0x3cb4a1['name'];if(_0x4e2c66===0x191){_0x4e2c66=0x190;}_0x2ca74c[_0x0c69('0x23')](_0x4e2c66)['send'](_0x525def[_0x0c69('0x36')][_0x0c69('0x17')]?{'message':_0x0c69('0x79'),'statusCode':_0x3cb4a1[_0x0c69('0x78')]}:_0x3cb4a1);});}else{var _0x498c85=0x1f4;_0x2ca74c[_0x0c69('0x23')](_0x498c85)[_0x0c69('0x31')]({'message':_0x0c69('0x79'),'statusCode':0x190});}});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
index 22a2705..a30ab64 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x19a7=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4961f3,_0x56e337){var _0x523b41=function(_0x510b94){while(--_0x510b94){_0x4961f3['push'](_0x4961f3['shift']());}};_0x523b41(++_0x56e337);}(_0x19a7,0x1c7));var _0x719a=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x19a7[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x719a('0x0'));var util=require(_0x719a('0x1'));var logger=require(_0x719a('0x2'))(_0x719a('0x3'));var moment=require(_0x719a('0x4'));var BPromise=require(_0x719a('0x5'));var rp=require(_0x719a('0x6'));var fs=require('fs');var path=require(_0x719a('0x7'));var rimraf=require(_0x719a('0x8'));var config=require(_0x719a('0x9'));var attributes=require(_0x719a('0xa'));var integrations=require(_0x719a('0xb'));module['exports']=function(_0x16d898,_0x2c10b5){return _0x16d898[_0x719a('0xc')](_0x719a('0xd'),attributes,{'tableName':_0x719a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b95=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount'];(function(_0x170a48,_0x4b10f7){var _0x4141ca=function(_0x334595){while(--_0x334595){_0x170a48['push'](_0x170a48['shift']());}};_0x4141ca(++_0x4b10f7);}(_0x2b95,0xd0));var _0x52b9=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0x2b95[_0x324fe8];return _0x4a1cd9;};'use strict';var _=require(_0x52b9('0x0'));var util=require(_0x52b9('0x1'));var logger=require(_0x52b9('0x2'))('api');var moment=require(_0x52b9('0x3'));var BPromise=require(_0x52b9('0x4'));var rp=require(_0x52b9('0x5'));var fs=require('fs');var path=require(_0x52b9('0x6'));var rimraf=require(_0x52b9('0x7'));var config=require(_0x52b9('0x8'));var attributes=require(_0x52b9('0x9'));var integrations=require(_0x52b9('0xa'));module['exports']=function(_0x47db94,_0x5cb1d7){return _0x47db94[_0x52b9('0xb')](_0x52b9('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
index 050a876..d04d1e4 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f75=['ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','limit','include','map','model','attributes','debug','stringify','find','where','ShowSugarcrmAccount','lodash','moment','bluebird','randomstring'];(function(_0x2cd1d9,_0x151a1e){var _0x5abf9a=function(_0x2c294f){while(--_0x2c294f){_0x2cd1d9['push'](_0x2cd1d9['shift']());}};_0x5abf9a(++_0x151a1e);}(_0x3f75,0xc8));var _0x53f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f75[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x53f7('0x0'));var util=require('util');var moment=require(_0x53f7('0x1'));var BPromise=require(_0x53f7('0x2'));var rs=require(_0x53f7('0x3'));var fs=require('fs');var Redis=require(_0x53f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x53f7('0x5'))(_0x53f7('0x6'));var config=require('../../config/environment');var jayson=require(_0x53f7('0x7'));var client=jayson[_0x53f7('0x8')][_0x53f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x197120,_0x5af833,_0x108b7e){return new BPromise(function(_0x4f6384,_0x21a2a7){return client[_0x53f7('0xa')](_0x197120,_0x108b7e)[_0x53f7('0xb')](function(_0x1f1d64){logger[_0x53f7('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x5af833,_0x53f7('0xd'));logger['debug'](_0x53f7('0xe'),_0x5af833,'request\x20sent',JSON['stringify'](_0x1f1d64));if(_0x1f1d64[_0x53f7('0xf')]){if(_0x1f1d64[_0x53f7('0xf')][_0x53f7('0x10')]===0x1f4){logger[_0x53f7('0xf')](_0x53f7('0x11'),_0x5af833,_0x1f1d64[_0x53f7('0xf')][_0x53f7('0x12')]);return _0x21a2a7(_0x1f1d64['error'][_0x53f7('0x12')]);}logger['error'](_0x53f7('0x11'),_0x5af833,_0x1f1d64['error'][_0x53f7('0x12')]);return _0x4f6384(_0x1f1d64[_0x53f7('0xf')][_0x53f7('0x12')]);}else{logger[_0x53f7('0xc')](_0x53f7('0x11'),_0x5af833,_0x53f7('0xd'));_0x4f6384(_0x1f1d64[_0x53f7('0x13')][_0x53f7('0x12')]);}})['catch'](function(_0x120af2){logger[_0x53f7('0xf')](_0x53f7('0x11'),_0x5af833,_0x120af2);_0x21a2a7(_0x120af2);});});}exports[_0x53f7('0x14')]=function(_0x30b108){var _0x4c4466=this;return new Promise(function(_0x164169,_0xe4c9fb){return db[_0x53f7('0x15')][_0x53f7('0x16')]({'raw':_0x30b108[_0x53f7('0x17')]?_0x30b108[_0x53f7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x30b108[_0x53f7('0x17')]?_0x30b108[_0x53f7('0x17')]['where']||null:null,'attributes':_0x30b108[_0x53f7('0x17')]?_0x30b108[_0x53f7('0x17')]['attributes']||null:null,'limit':_0x30b108['options']?_0x30b108[_0x53f7('0x17')][_0x53f7('0x18')]||null:null,'include':_0x30b108[_0x53f7('0x17')]?_0x30b108[_0x53f7('0x17')][_0x53f7('0x19')]?_[_0x53f7('0x1a')](_0x30b108[_0x53f7('0x17')]['include'],function(_0x40f6e0){return{'model':db[_0x40f6e0[_0x53f7('0x1b')]],'as':_0x40f6e0['as'],'attributes':_0x40f6e0[_0x53f7('0x1c')],'include':_0x40f6e0[_0x53f7('0x19')]?_[_0x53f7('0x1a')](_0x40f6e0['include'],function(_0x22a69a){return{'model':db[_0x22a69a[_0x53f7('0x1b')]],'as':_0x22a69a['as'],'attributes':_0x22a69a[_0x53f7('0x1c')],'include':_0x22a69a[_0x53f7('0x19')]?_[_0x53f7('0x1a')](_0x22a69a[_0x53f7('0x19')],function(_0x45342f){return{'model':db[_0x45342f[_0x53f7('0x1b')]],'as':_0x45342f['as'],'attributes':_0x45342f[_0x53f7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x53f7('0xb')](function(_0x1c72bc){logger[_0x53f7('0xc')](_0x53f7('0x14'),_0x30b108);logger[_0x53f7('0x1d')]('GetSugarcrmAccount',_0x30b108,JSON[_0x53f7('0x1e')](_0x1c72bc));_0x164169(_0x1c72bc);})['catch'](function(_0x831942){logger[_0x53f7('0xf')](_0x53f7('0x14'),_0x831942[_0x53f7('0x12')],_0x30b108);_0xe4c9fb(_0x4c4466[_0x53f7('0xf')](0x1f4,_0x831942[_0x53f7('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x2b5928){var _0x12ef1c=this;return new Promise(function(_0x2b9be2,_0x4b7713){return db[_0x53f7('0x15')][_0x53f7('0x1f')]({'raw':_0x2b5928[_0x53f7('0x17')]?_0x2b5928[_0x53f7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2b5928[_0x53f7('0x17')]?_0x2b5928[_0x53f7('0x17')][_0x53f7('0x20')]||null:null,'attributes':_0x2b5928['options']?_0x2b5928[_0x53f7('0x17')][_0x53f7('0x1c')]||null:null,'include':_0x2b5928[_0x53f7('0x17')]?_0x2b5928[_0x53f7('0x17')][_0x53f7('0x19')]?_[_0x53f7('0x1a')](_0x2b5928['options'][_0x53f7('0x19')],function(_0x20524f){return{'model':db[_0x20524f[_0x53f7('0x1b')]],'as':_0x20524f['as'],'attributes':_0x20524f['attributes'],'include':_0x20524f['include']?_[_0x53f7('0x1a')](_0x20524f[_0x53f7('0x19')],function(_0x5bfc82){return{'model':db[_0x5bfc82[_0x53f7('0x1b')]],'as':_0x5bfc82['as'],'attributes':_0x5bfc82[_0x53f7('0x1c')],'include':_0x5bfc82[_0x53f7('0x19')]?_[_0x53f7('0x1a')](_0x5bfc82[_0x53f7('0x19')],function(_0x36fe83){return{'model':db[_0x36fe83[_0x53f7('0x1b')]],'as':_0x36fe83['as'],'attributes':_0x36fe83[_0x53f7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x53f7('0xb')](function(_0x237d97){logger[_0x53f7('0xc')](_0x53f7('0x21'),_0x2b5928);logger[_0x53f7('0x1d')](_0x53f7('0x21'),_0x2b5928,JSON[_0x53f7('0x1e')](_0x237d97));_0x2b9be2(_0x237d97);})['catch'](function(_0x407fdb){logger[_0x53f7('0xf')](_0x53f7('0x21'),_0x407fdb[_0x53f7('0x12')],_0x2b5928);_0x4b7713(_0x12ef1c[_0x53f7('0xf')](0x1f4,_0x407fdb[_0x53f7('0x12')]));});});};
\ No newline at end of file
+var _0xefb7=['jayson/promise','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','map','include','model','then','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0xefb7,0x14b));var _0x7efb=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0xefb7[_0x1db831];return _0x39ba56;};'use strict';var _=require(_0x7efb('0x0'));var util=require(_0x7efb('0x1'));var moment=require(_0x7efb('0x2'));var BPromise=require(_0x7efb('0x3'));var rs=require(_0x7efb('0x4'));var fs=require('fs');var Redis=require(_0x7efb('0x5'));var db=require(_0x7efb('0x6'))['db'];var utils=require(_0x7efb('0x7'));var logger=require(_0x7efb('0x8'))(_0x7efb('0x9'));var config=require(_0x7efb('0xa'));var jayson=require(_0x7efb('0xb'));var client=jayson['client'][_0x7efb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6bb752,_0x33e354,_0x16b98f){return new BPromise(function(_0x598abd,_0x434ee5){return client[_0x7efb('0xd')](_0x6bb752,_0x16b98f)['then'](function(_0x1f361e){logger[_0x7efb('0xe')](_0x7efb('0xf'),_0x33e354,_0x7efb('0x10'));logger[_0x7efb('0x11')](_0x7efb('0x12'),_0x33e354,_0x7efb('0x10'),JSON[_0x7efb('0x13')](_0x1f361e));if(_0x1f361e[_0x7efb('0x14')]){if(_0x1f361e[_0x7efb('0x14')][_0x7efb('0x15')]===0x1f4){logger[_0x7efb('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x33e354,_0x1f361e['error'][_0x7efb('0x16')]);return _0x434ee5(_0x1f361e[_0x7efb('0x14')][_0x7efb('0x16')]);}logger['error'](_0x7efb('0xf'),_0x33e354,_0x1f361e[_0x7efb('0x14')]['message']);return _0x598abd(_0x1f361e[_0x7efb('0x14')][_0x7efb('0x16')]);}else{logger[_0x7efb('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x33e354,_0x7efb('0x10'));_0x598abd(_0x1f361e[_0x7efb('0x17')][_0x7efb('0x16')]);}})[_0x7efb('0x18')](function(_0x2f7c05){logger['error'](_0x7efb('0xf'),_0x33e354,_0x2f7c05);_0x434ee5(_0x2f7c05);});});}exports[_0x7efb('0x19')]=function(_0x1d2b92){var _0x163e28=this;return new Promise(function(_0x1bd995,_0x5e3f13){return db[_0x7efb('0x1a')][_0x7efb('0x1b')]({'raw':_0x1d2b92[_0x7efb('0x1c')]?_0x1d2b92['options'][_0x7efb('0x1d')]===undefined?!![]:![]:!![],'where':_0x1d2b92[_0x7efb('0x1c')]?_0x1d2b92[_0x7efb('0x1c')]['where']||null:null,'attributes':_0x1d2b92[_0x7efb('0x1c')]?_0x1d2b92[_0x7efb('0x1c')][_0x7efb('0x1e')]||null:null,'limit':_0x1d2b92[_0x7efb('0x1c')]?_0x1d2b92[_0x7efb('0x1c')][_0x7efb('0x1f')]||null:null,'include':_0x1d2b92[_0x7efb('0x1c')]?_0x1d2b92[_0x7efb('0x1c')]['include']?_[_0x7efb('0x20')](_0x1d2b92['options'][_0x7efb('0x21')],function(_0x53fb36){return{'model':db[_0x53fb36[_0x7efb('0x22')]],'as':_0x53fb36['as'],'attributes':_0x53fb36[_0x7efb('0x1e')],'include':_0x53fb36[_0x7efb('0x21')]?_['map'](_0x53fb36[_0x7efb('0x21')],function(_0x3f4db5){return{'model':db[_0x3f4db5[_0x7efb('0x22')]],'as':_0x3f4db5['as'],'attributes':_0x3f4db5[_0x7efb('0x1e')],'include':_0x3f4db5[_0x7efb('0x21')]?_[_0x7efb('0x20')](_0x3f4db5['include'],function(_0x17622a){return{'model':db[_0x17622a['model']],'as':_0x17622a['as'],'attributes':_0x17622a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7efb('0x23')](function(_0x4bead3){logger['info'](_0x7efb('0x19'),_0x1d2b92);logger[_0x7efb('0x11')](_0x7efb('0x19'),_0x1d2b92,JSON['stringify'](_0x4bead3));_0x1bd995(_0x4bead3);})[_0x7efb('0x18')](function(_0x4b3c39){logger[_0x7efb('0x14')](_0x7efb('0x19'),_0x4b3c39[_0x7efb('0x16')],_0x1d2b92);_0x5e3f13(_0x163e28[_0x7efb('0x14')](0x1f4,_0x4b3c39[_0x7efb('0x16')]));});});};exports['ShowSugarcrmAccount']=function(_0x1bb94b){var _0x35361b=this;return new Promise(function(_0x47bc07,_0x52eb68){return db[_0x7efb('0x1a')][_0x7efb('0x24')]({'raw':_0x1bb94b[_0x7efb('0x1c')]?_0x1bb94b[_0x7efb('0x1c')][_0x7efb('0x1d')]===undefined?!![]:![]:!![],'where':_0x1bb94b[_0x7efb('0x1c')]?_0x1bb94b[_0x7efb('0x1c')]['where']||null:null,'attributes':_0x1bb94b['options']?_0x1bb94b[_0x7efb('0x1c')][_0x7efb('0x1e')]||null:null,'include':_0x1bb94b[_0x7efb('0x1c')]?_0x1bb94b[_0x7efb('0x1c')]['include']?_[_0x7efb('0x20')](_0x1bb94b[_0x7efb('0x1c')][_0x7efb('0x21')],function(_0x4688bf){return{'model':db[_0x4688bf['model']],'as':_0x4688bf['as'],'attributes':_0x4688bf[_0x7efb('0x1e')],'include':_0x4688bf[_0x7efb('0x21')]?_[_0x7efb('0x20')](_0x4688bf[_0x7efb('0x21')],function(_0x2bdffa){return{'model':db[_0x2bdffa[_0x7efb('0x22')]],'as':_0x2bdffa['as'],'attributes':_0x2bdffa['attributes'],'include':_0x2bdffa[_0x7efb('0x21')]?_['map'](_0x2bdffa['include'],function(_0x3769b8){return{'model':db[_0x3769b8[_0x7efb('0x22')]],'as':_0x3769b8['as'],'attributes':_0x3769b8[_0x7efb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7efb('0x23')](function(_0x4831a5){logger[_0x7efb('0xe')](_0x7efb('0x25'),_0x1bb94b);logger[_0x7efb('0x11')](_0x7efb('0x25'),_0x1bb94b,JSON[_0x7efb('0x13')](_0x4831a5));_0x47bc07(_0x4831a5);})['catch'](function(_0x39e08f){logger['error'](_0x7efb('0x25'),_0x39e08f[_0x7efb('0x16')],_0x1bb94b);_0x52eb68(_0x35361b[_0x7efb('0x14')](0x1f4,_0x39e08f[_0x7efb('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js
index d036e1c..6c48081 100644
--- a/server/api/intSugarcrmConfiguration/index.js
+++ b/server/api/intSugarcrmConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2516=['/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x2516,0x9d));var _0x6251=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2516[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x6251('0x0'));var util=require(_0x6251('0x1'));var path=require(_0x6251('0x2'));var timeout=require(_0x6251('0x3'));var express=require(_0x6251('0x4'));var router=express['Router']();var auth=require(_0x6251('0x5'));var interaction=require(_0x6251('0x6'));var config=require(_0x6251('0x7'));var controller=require(_0x6251('0x8'));router[_0x6251('0x9')]('/',auth[_0x6251('0xa')](),controller[_0x6251('0xb')]);router[_0x6251('0x9')](_0x6251('0xc'),auth[_0x6251('0xa')](),controller[_0x6251('0xd')]);router[_0x6251('0x9')](_0x6251('0xe'),auth[_0x6251('0xa')](),controller[_0x6251('0xf')]);router[_0x6251('0x9')](_0x6251('0x10'),auth['isAuthenticated'](),controller[_0x6251('0x11')]);router[_0x6251('0x9')](_0x6251('0x12'),auth[_0x6251('0xa')](),controller[_0x6251('0x13')]);router[_0x6251('0x14')]('/',auth[_0x6251('0xa')](),controller['create']);router[_0x6251('0x15')](_0x6251('0xc'),auth[_0x6251('0xa')](),controller[_0x6251('0x16')]);router[_0x6251('0x17')](_0x6251('0xc'),auth[_0x6251('0xa')](),controller[_0x6251('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xe79a=['Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create','put','update','delete','exports','path','express'];(function(_0x3f59b1,_0x25cdbe){var _0x11d2e8=function(_0x37b3fc){while(--_0x37b3fc){_0x3f59b1['push'](_0x3f59b1['shift']());}};_0x11d2e8(++_0x25cdbe);}(_0xe79a,0x70));var _0xae79=function(_0xb1b7b,_0x13eaa0){_0xb1b7b=_0xb1b7b-0x0;var _0x339c3b=_0xe79a[_0xb1b7b];return _0x339c3b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xae79('0x0'));var timeout=require('connect-timeout');var express=require(_0xae79('0x1'));var router=express[_0xae79('0x2')]();var auth=require(_0xae79('0x3'));var interaction=require(_0xae79('0x4'));var config=require('../../config/environment');var controller=require(_0xae79('0x5'));router[_0xae79('0x6')]('/',auth[_0xae79('0x7')](),controller['index']);router[_0xae79('0x6')](_0xae79('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xae79('0x6')](_0xae79('0x9'),auth['isAuthenticated'](),controller[_0xae79('0xa')]);router['get'](_0xae79('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xae79('0x6')](_0xae79('0xc'),auth[_0xae79('0x7')](),controller['getDescriptions']);router[_0xae79('0xd')]('/',auth[_0xae79('0x7')](),controller[_0xae79('0xe')]);router[_0xae79('0xf')](_0xae79('0x8'),auth[_0xae79('0x7')](),controller[_0xae79('0x10')]);router[_0xae79('0x11')](_0xae79('0x8'),auth[_0xae79('0x7')](),controller['destroy']);module[_0xae79('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
index 8f8bbfb..9eaf12a 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f27=['exports','STRING'];(function(_0x373f3c,_0x44e12b){var _0x555326=function(_0x5dd8d9){while(--_0x5dd8d9){_0x373f3c['push'](_0x373f3c['shift']());}};_0x555326(++_0x44e12b);}(_0x2f27,0x6a));var _0x72f2=function(_0xfba891,_0x34e86c){_0xfba891=_0xfba891-0x0;var _0x44e262=_0x2f27[_0xfba891];return _0x44e262;};'use strict';var Sequelize=require('sequelize');module[_0x72f2('0x0')]={'name':{'type':Sequelize[_0x72f2('0x1')]},'description':{'type':Sequelize[_0x72f2('0x1')]}};
\ No newline at end of file
+var _0xa48d=['STRING'];(function(_0x5b31c7,_0x431d42){var _0xc31e2e=function(_0x2f256c){while(--_0x2f256c){_0x5b31c7['push'](_0x5b31c7['shift']());}};_0xc31e2e(++_0x431d42);}(_0xa48d,0x1d6));var _0xda48=function(_0xbac6d9,_0xe18aeb){_0xbac6d9=_0xbac6d9-0x0;var _0x9a9e17=_0xa48d[_0xbac6d9];return _0x9a9e17;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xda48('0x0')]},'description':{'type':Sequelize[_0xda48('0x0')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
index ebffe42..0aa109a 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','count','offset','Content-Range','apply','destroy','end','stack','name','send','SugarcrmConfiguration','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','key','VIRTUAL','field','options','findAll','rows','show','params','keys','includeAll','find','create','body','update','getFields','findOne','SugarcrmField','filter','map','pick','getSubjects','getDescriptions','html-pdf','eml-format','request-promise'];(function(_0x261cc4,_0x3f9aa1){var _0x5c1cba=function(_0x38764a){while(--_0x38764a){_0x261cc4['push'](_0x261cc4['shift']());}};_0x5c1cba(++_0x3f9aa1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var hardwareService=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];var jayson=require(_0x0d8b('0x15'));var client=jayson[_0x0d8b('0x16')][_0x0d8b('0x17')]({'port':0x232a});function checkPasswordPattern(_0x35a07b,_0x32bb1a,_0x15dd0f){if(_0x15dd0f){var _0x31a8cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31a8cc[_0x0d8b('0x18')](_0x32bb1a)){return _0x35a07b;}else{throw new Error(_0x0d8b('0x19'));}}else{return _0x35a07b;}}function respondWithRpcPromise(_0x5ad086,_0xe65334,_0x1567ce,_0x2d4e1c){return new BPromise(function(_0x4f6f21,_0x23eb7b){var _0xa86349=_0x2d4e1c||client;return _0xa86349[_0x0d8b('0x1a')](_0x5ad086,_0x1567ce)[_0x0d8b('0x1b')](function(_0x2cb03c){logger['info'](_0x0d8b('0x1c'),_0xe65334,_0x0d8b('0x1d'));logger[_0x0d8b('0x1e')](_0x0d8b('0x1f'),_0xe65334,_0x0d8b('0x1d'),JSON[_0x0d8b('0x20')](_0x2cb03c));if(_0x2cb03c[_0x0d8b('0x21')]){if(_0x2cb03c[_0x0d8b('0x21')]['code']===0x1f4){logger[_0x0d8b('0x21')](_0x0d8b('0x1c'),_0xe65334,_0x2cb03c[_0x0d8b('0x21')][_0x0d8b('0x22')]);return _0x23eb7b(_0x2cb03c[_0x0d8b('0x21')][_0x0d8b('0x22')]);}logger[_0x0d8b('0x21')](_0x0d8b('0x1c'),_0xe65334,_0x2cb03c['error']['message']);return _0x4f6f21(_0x2cb03c[_0x0d8b('0x21')]['message']);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0xe65334,_0x0d8b('0x1d'));_0x4f6f21(_0x2cb03c[_0x0d8b('0x23')][_0x0d8b('0x22')]);}})[_0x0d8b('0x24')](function(_0x221071){logger[_0x0d8b('0x21')](_0x0d8b('0x1c'),_0xe65334,_0x221071);_0x23eb7b(_0x221071);});});}function respondWithStatusCode(_0x4562cb,_0x27b695){_0x27b695=_0x27b695||0xcc;return function(_0x5e5bc3){if(_0x5e5bc3){return _0x4562cb[_0x0d8b('0x25')](_0x27b695);}return _0x4562cb[_0x0d8b('0x26')](_0x27b695)['end']();};}function respondWithResult(_0xe1ef20,_0x4a0ae4){_0x4a0ae4=_0x4a0ae4||0xc8;return function(_0x3dd149){if(_0x3dd149){return _0xe1ef20[_0x0d8b('0x26')](_0x4a0ae4)[_0x0d8b('0x27')](_0x3dd149);}};}function respondWithFilteredResult(_0x4fe6f9,_0x59a905){return function(_0x28f639){if(_0x28f639){var _0x3ef745=_0x28f639[_0x0d8b('0x28')],_0x4c05ee=_0x59a905['offset'],_0xcbc4ac=_0x59a905[_0x0d8b('0x29')]+_0x59a905['limit'],_0x59aa83;if(_0xcbc4ac>=_0x3ef745){_0xcbc4ac=_0x3ef745;_0x59aa83=0xc8;}else{_0x59aa83=0xce;}_0x4fe6f9[_0x0d8b('0x26')](_0x59aa83);return _0x4fe6f9['set'](_0x0d8b('0x2a'),_0x4c05ee+'-'+_0xcbc4ac+'/'+_0x3ef745)['json'](_0x28f639);}return null;};}function patchUpdates(_0x3c8887){return function(_0x106e4c){try{jsonpatch[_0x0d8b('0x2b')](_0x106e4c,_0x3c8887,!![]);}catch(_0x56120a){return BPromise['reject'](_0x56120a);}return _0x106e4c['save']();};}function saveUpdates(_0x4e8992,_0x5515d2){return function(_0x3cdf3c){if(_0x3cdf3c){return _0x3cdf3c['update'](_0x4e8992)['then'](function(_0x36017a){return _0x36017a;});}return null;};}function removeEntity(_0x1b6920,_0x109c14){return function(_0xdeee5d){if(_0xdeee5d){return _0xdeee5d[_0x0d8b('0x2c')]()[_0x0d8b('0x1b')](function(){_0x1b6920[_0x0d8b('0x26')](0xcc)[_0x0d8b('0x2d')]();});}};}function handleEntityNotFound(_0x553e03,_0x37ca42){return function(_0x3ef48d){if(!_0x3ef48d){_0x553e03['sendStatus'](0x194);}return _0x3ef48d;};}function handleError(_0xb18586,_0x23f7f6){_0x23f7f6=_0x23f7f6||0x1f4;return function(_0x18a905){logger['error'](_0x18a905[_0x0d8b('0x2e')]);if(_0x18a905[_0x0d8b('0x2f')]){delete _0x18a905[_0x0d8b('0x2f')];}_0xb18586[_0x0d8b('0x26')](_0x23f7f6)[_0x0d8b('0x30')](_0x18a905);};}exports['index']=function(_0x3f1cb3,_0x1649fc){var _0x5ad0fe={},_0x1180ac={},_0x3cc3ee={'count':0x0,'rows':[]};var _0x188af2=db[_0x0d8b('0x31')][_0x0d8b('0x32')];_0x1180ac['model']=_['keys'](_0x188af2);_0x1180ac[_0x0d8b('0x33')]=_['keys'](_0x3f1cb3['query']);_0x1180ac[_0x0d8b('0x34')]=_[_0x0d8b('0x35')](_0x1180ac[_0x0d8b('0x36')],_0x1180ac[_0x0d8b('0x33')]);_0x5ad0fe[_0x0d8b('0x37')]=_[_0x0d8b('0x35')](_0x1180ac['model'],qs[_0x0d8b('0x38')](_0x3f1cb3[_0x0d8b('0x33')][_0x0d8b('0x38')]));_0x5ad0fe[_0x0d8b('0x37')]=_0x5ad0fe[_0x0d8b('0x37')][_0x0d8b('0x39')]?_0x5ad0fe[_0x0d8b('0x37')]:_0x1180ac['model'];if(!_0x3f1cb3[_0x0d8b('0x33')][_0x0d8b('0x3a')](_0x0d8b('0x3b'))){_0x5ad0fe[_0x0d8b('0x3c')]=qs['limit'](_0x3f1cb3[_0x0d8b('0x33')]['limit']);_0x5ad0fe[_0x0d8b('0x29')]=qs[_0x0d8b('0x29')](_0x3f1cb3[_0x0d8b('0x33')][_0x0d8b('0x29')]);}_0x5ad0fe[_0x0d8b('0x3d')]=qs[_0x0d8b('0x3e')](_0x3f1cb3[_0x0d8b('0x33')][_0x0d8b('0x3e')]);_0x5ad0fe[_0x0d8b('0x3f')]=qs[_0x0d8b('0x34')](_['pick'](_0x3f1cb3['query'],_0x1180ac['filters']));if(_0x3f1cb3['query']['filter']){_0x5ad0fe[_0x0d8b('0x3f')]=_[_0x0d8b('0x40')](_0x5ad0fe[_0x0d8b('0x3f')],{'$or':_['map'](_0x188af2,function(_0x4a76a3){if(_0x4a76a3[_0x0d8b('0x41')][_0x0d8b('0x42')]!==_0x0d8b('0x43')){var _0x513b93={};_0x513b93[_0x4a76a3[_0x0d8b('0x44')]]={'$like':'%'+_0x3f1cb3[_0x0d8b('0x33')]['filter']+'%'};return _0x513b93;}})});}_0x5ad0fe=_['merge']({},_0x5ad0fe,_0x3f1cb3[_0x0d8b('0x45')]);var _0x495870={'where':_0x5ad0fe[_0x0d8b('0x3f')]};return db['SugarcrmConfiguration']['count'](_0x495870)[_0x0d8b('0x1b')](function(_0x194f17){_0x3cc3ee['count']=_0x194f17;if(_0x3f1cb3['query']['includeAll']){_0x5ad0fe['include']=[{'all':!![]}];}return db[_0x0d8b('0x31')][_0x0d8b('0x46')](_0x5ad0fe);})[_0x0d8b('0x1b')](function(_0x490eda){_0x3cc3ee[_0x0d8b('0x47')]=_0x490eda;return _0x3cc3ee;})[_0x0d8b('0x1b')](respondWithFilteredResult(_0x1649fc,_0x5ad0fe))[_0x0d8b('0x24')](handleError(_0x1649fc,null));};exports[_0x0d8b('0x48')]=function(_0x423ecd,_0x2d5246){var _0x11d22b={'raw':![],'where':{'id':_0x423ecd[_0x0d8b('0x49')]['id']}},_0x1d5067={};_0x1d5067[_0x0d8b('0x36')]=_[_0x0d8b('0x4a')](db[_0x0d8b('0x31')][_0x0d8b('0x32')]);_0x1d5067[_0x0d8b('0x33')]=_[_0x0d8b('0x4a')](_0x423ecd[_0x0d8b('0x33')]);_0x1d5067[_0x0d8b('0x34')]=_[_0x0d8b('0x35')](_0x1d5067[_0x0d8b('0x36')],_0x1d5067['query']);_0x11d22b[_0x0d8b('0x37')]=_['intersection'](_0x1d5067['model'],qs[_0x0d8b('0x38')](_0x423ecd[_0x0d8b('0x33')][_0x0d8b('0x38')]));_0x11d22b[_0x0d8b('0x37')]=_0x11d22b['attributes'][_0x0d8b('0x39')]?_0x11d22b[_0x0d8b('0x37')]:_0x1d5067[_0x0d8b('0x36')];if(_0x423ecd[_0x0d8b('0x33')][_0x0d8b('0x4b')]){_0x11d22b['include']=[{'all':!![]}];}_0x11d22b=_['merge']({},_0x11d22b,_0x423ecd['options']);return db['SugarcrmConfiguration'][_0x0d8b('0x4c')](_0x11d22b)[_0x0d8b('0x1b')](handleEntityNotFound(_0x2d5246,null))['then'](respondWithResult(_0x2d5246,null))['catch'](handleError(_0x2d5246,null));};exports[_0x0d8b('0x4d')]=function(_0x3d3cb6,_0x5c5bd7){return db['SugarcrmConfiguration'][_0x0d8b('0x4d')](_0x3d3cb6[_0x0d8b('0x4e')],{})[_0x0d8b('0x1b')](respondWithResult(_0x5c5bd7,0xc9))[_0x0d8b('0x24')](handleError(_0x5c5bd7,null));};exports[_0x0d8b('0x4f')]=function(_0x506a79,_0x2de903){if(_0x506a79[_0x0d8b('0x4e')]['id']){delete _0x506a79['body']['id'];}return db['SugarcrmConfiguration'][_0x0d8b('0x4c')]({'where':{'id':_0x506a79[_0x0d8b('0x49')]['id']}})['then'](handleEntityNotFound(_0x2de903,null))['then'](saveUpdates(_0x506a79[_0x0d8b('0x4e')],null))[_0x0d8b('0x1b')](respondWithResult(_0x2de903,null))[_0x0d8b('0x24')](handleError(_0x2de903,null));};exports[_0x0d8b('0x2c')]=function(_0x4a2989,_0x356b3d){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x4a2989[_0x0d8b('0x49')]['id']}})[_0x0d8b('0x1b')](handleEntityNotFound(_0x356b3d,null))['then'](removeEntity(_0x356b3d,null))['catch'](handleError(_0x356b3d,null));};exports[_0x0d8b('0x50')]=function(_0x3d7161,_0xccc2a9,_0x2c1eb0){var _0x3afc3a={};var _0xb66e76={};var _0x3978e5;var _0x3bead7;return db['SugarcrmConfiguration'][_0x0d8b('0x51')]({'where':{'id':_0x3d7161[_0x0d8b('0x49')]['id']}})[_0x0d8b('0x1b')](handleEntityNotFound(_0xccc2a9,null))[_0x0d8b('0x1b')](function(_0x3fb9ea){if(_0x3fb9ea){_0x3978e5=_0x3fb9ea;_0xb66e76[_0x0d8b('0x36')]=_[_0x0d8b('0x4a')](db[_0x0d8b('0x52')][_0x0d8b('0x32')]);_0xb66e76['query']=_[_0x0d8b('0x4a')](_0x3d7161[_0x0d8b('0x33')]);_0xb66e76[_0x0d8b('0x34')]=_[_0x0d8b('0x35')](_0xb66e76[_0x0d8b('0x36')],_0xb66e76['query']);_0x3afc3a[_0x0d8b('0x37')]=_[_0x0d8b('0x35')](_0xb66e76[_0x0d8b('0x36')],qs[_0x0d8b('0x38')](_0x3d7161[_0x0d8b('0x33')]['fields']));_0x3afc3a['attributes']=_0x3afc3a[_0x0d8b('0x37')][_0x0d8b('0x39')]?_0x3afc3a[_0x0d8b('0x37')]:_0xb66e76[_0x0d8b('0x36')];_0x3afc3a['order']=qs[_0x0d8b('0x3e')](_0x3d7161[_0x0d8b('0x33')][_0x0d8b('0x3e')]);_0x3afc3a['where']=qs[_0x0d8b('0x34')](_['pick'](_0x3d7161[_0x0d8b('0x33')],_0xb66e76[_0x0d8b('0x34')]));if(_0x3d7161[_0x0d8b('0x33')][_0x0d8b('0x53')]){_0x3afc3a[_0x0d8b('0x3f')]=_[_0x0d8b('0x40')](_0x3afc3a['where'],{'$or':_[_0x0d8b('0x54')](_0x3afc3a['attributes'],function(_0x71e8d8){var _0x4577c8={};_0x4577c8[_0x71e8d8]={'$like':'%'+_0x3d7161[_0x0d8b('0x33')][_0x0d8b('0x53')]+'%'};return _0x4577c8;})});}_0x3afc3a=_['merge']({},_0x3afc3a,_0x3d7161[_0x0d8b('0x45')]);return _0x3978e5[_0x0d8b('0x50')](_0x3afc3a);}})[_0x0d8b('0x1b')](function(_0x2332fc){if(_0x2332fc){_0x3bead7=_0x2332fc[_0x0d8b('0x39')];if(!_0x3d7161[_0x0d8b('0x33')][_0x0d8b('0x3a')](_0x0d8b('0x3b'))){_0x3afc3a[_0x0d8b('0x3c')]=qs[_0x0d8b('0x3c')](_0x3d7161['query']['limit']);_0x3afc3a[_0x0d8b('0x29')]=qs[_0x0d8b('0x29')](_0x3d7161['query'][_0x0d8b('0x29')]);}return _0x3978e5['getFields'](_0x3afc3a);}})['then'](function(_0x22ee20){if(_0x22ee20){return _0x22ee20?{'count':_0x3bead7,'rows':_0x22ee20}:null;}})[_0x0d8b('0x1b')](respondWithResult(_0xccc2a9,null))['catch'](handleError(_0xccc2a9,null));};exports['getSubjects']=function(_0x1900e3,_0x1c007b,_0x70e4b2){var _0x435090={};var _0x2ab72b={};var _0x156859;var _0x40d265;return db['SugarcrmConfiguration'][_0x0d8b('0x51')]({'where':{'id':_0x1900e3['params']['id']}})[_0x0d8b('0x1b')](handleEntityNotFound(_0x1c007b,null))[_0x0d8b('0x1b')](function(_0x2bb690){if(_0x2bb690){_0x156859=_0x2bb690;_0x2ab72b[_0x0d8b('0x36')]=_['keys'](db[_0x0d8b('0x52')]['rawAttributes']);_0x2ab72b[_0x0d8b('0x33')]=_[_0x0d8b('0x4a')](_0x1900e3[_0x0d8b('0x33')]);_0x2ab72b[_0x0d8b('0x34')]=_[_0x0d8b('0x35')](_0x2ab72b[_0x0d8b('0x36')],_0x2ab72b[_0x0d8b('0x33')]);_0x435090[_0x0d8b('0x37')]=_[_0x0d8b('0x35')](_0x2ab72b[_0x0d8b('0x36')],qs['fields'](_0x1900e3[_0x0d8b('0x33')]['fields']));_0x435090[_0x0d8b('0x37')]=_0x435090[_0x0d8b('0x37')]['length']?_0x435090[_0x0d8b('0x37')]:_0x2ab72b['model'];_0x435090[_0x0d8b('0x3d')]=qs[_0x0d8b('0x3e')](_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x3e')]);_0x435090[_0x0d8b('0x3f')]=qs[_0x0d8b('0x34')](_[_0x0d8b('0x55')](_0x1900e3[_0x0d8b('0x33')],_0x2ab72b['filters']));if(_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x53')]){_0x435090['where']=_[_0x0d8b('0x40')](_0x435090[_0x0d8b('0x3f')],{'$or':_[_0x0d8b('0x54')](_0x435090[_0x0d8b('0x37')],function(_0x16141a){var _0x9e44b4={};_0x9e44b4[_0x16141a]={'$like':'%'+_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x53')]+'%'};return _0x9e44b4;})});}_0x435090=_[_0x0d8b('0x40')]({},_0x435090,_0x1900e3[_0x0d8b('0x45')]);return _0x156859[_0x0d8b('0x56')](_0x435090);}})[_0x0d8b('0x1b')](function(_0x50c0ff){if(_0x50c0ff){_0x40d265=_0x50c0ff[_0x0d8b('0x39')];if(!_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x3a')]('nolimit')){_0x435090['limit']=qs[_0x0d8b('0x3c')](_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x3c')]);_0x435090['offset']=qs['offset'](_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x29')]);}return _0x156859[_0x0d8b('0x56')](_0x435090);}})[_0x0d8b('0x1b')](function(_0x2a2b58){if(_0x2a2b58){return _0x2a2b58?{'count':_0x40d265,'rows':_0x2a2b58}:null;}})[_0x0d8b('0x1b')](respondWithResult(_0x1c007b,null))[_0x0d8b('0x24')](handleError(_0x1c007b,null));};exports[_0x0d8b('0x57')]=function(_0x20a3dd,_0x3a5aea,_0x195901){var _0x291336={};var _0x3b060e={};var _0x5dbc6b;var _0x3d3b0b;return db[_0x0d8b('0x31')]['findOne']({'where':{'id':_0x20a3dd['params']['id']}})[_0x0d8b('0x1b')](handleEntityNotFound(_0x3a5aea,null))[_0x0d8b('0x1b')](function(_0x3573b4){if(_0x3573b4){_0x5dbc6b=_0x3573b4;_0x3b060e[_0x0d8b('0x36')]=_[_0x0d8b('0x4a')](db[_0x0d8b('0x52')]['rawAttributes']);_0x3b060e['query']=_['keys'](_0x20a3dd[_0x0d8b('0x33')]);_0x3b060e[_0x0d8b('0x34')]=_[_0x0d8b('0x35')](_0x3b060e[_0x0d8b('0x36')],_0x3b060e[_0x0d8b('0x33')]);_0x291336[_0x0d8b('0x37')]=_['intersection'](_0x3b060e[_0x0d8b('0x36')],qs[_0x0d8b('0x38')](_0x20a3dd['query'][_0x0d8b('0x38')]));_0x291336['attributes']=_0x291336[_0x0d8b('0x37')][_0x0d8b('0x39')]?_0x291336[_0x0d8b('0x37')]:_0x3b060e[_0x0d8b('0x36')];_0x291336[_0x0d8b('0x3d')]=qs[_0x0d8b('0x3e')](_0x20a3dd[_0x0d8b('0x33')][_0x0d8b('0x3e')]);_0x291336[_0x0d8b('0x3f')]=qs[_0x0d8b('0x34')](_[_0x0d8b('0x55')](_0x20a3dd[_0x0d8b('0x33')],_0x3b060e['filters']));if(_0x20a3dd['query'][_0x0d8b('0x53')]){_0x291336[_0x0d8b('0x3f')]=_[_0x0d8b('0x40')](_0x291336[_0x0d8b('0x3f')],{'$or':_[_0x0d8b('0x54')](_0x291336[_0x0d8b('0x37')],function(_0xeadc0c){var _0x54674f={};_0x54674f[_0xeadc0c]={'$like':'%'+_0x20a3dd[_0x0d8b('0x33')]['filter']+'%'};return _0x54674f;})});}_0x291336=_[_0x0d8b('0x40')]({},_0x291336,_0x20a3dd['options']);return _0x5dbc6b['getDescriptions'](_0x291336);}})[_0x0d8b('0x1b')](function(_0x460a36){if(_0x460a36){_0x3d3b0b=_0x460a36[_0x0d8b('0x39')];if(!_0x20a3dd[_0x0d8b('0x33')][_0x0d8b('0x3a')](_0x0d8b('0x3b'))){_0x291336[_0x0d8b('0x3c')]=qs[_0x0d8b('0x3c')](_0x20a3dd[_0x0d8b('0x33')][_0x0d8b('0x3c')]);_0x291336[_0x0d8b('0x29')]=qs[_0x0d8b('0x29')](_0x20a3dd['query'][_0x0d8b('0x29')]);}return _0x5dbc6b[_0x0d8b('0x57')](_0x291336);}})[_0x0d8b('0x1b')](function(_0x5eba19){if(_0x5eba19){return _0x5eba19?{'count':_0x3d3b0b,'rows':_0x5eba19}:null;}})['then'](respondWithResult(_0x3a5aea,null))[_0x0d8b('0x24')](handleError(_0x3a5aea,null));};
\ No newline at end of file
+var _0x4fc2=['getSubjects','getDescriptions','SugarcrmField','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','limit','set','reject','save','update','destroy','stack','name','send','index','SugarcrmConfiguration','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','field','options','includeAll','findAll','rows','show','params','include','merge','find','catch','create','body','getFields','findOne'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fc2,0x111));var _0x24fc=function(_0x1da281,_0x2f0276){_0x1da281=_0x1da281-0x0;var _0x281637=_0x4fc2[_0x1da281];return _0x281637;};'use strict';var pdf=require(_0x24fc('0x0'));var emlformat=require(_0x24fc('0x1'));var rimraf=require(_0x24fc('0x2'));var zipdir=require(_0x24fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fc('0x4'));var moment=require(_0x24fc('0x5'));var BPromise=require(_0x24fc('0x6'));var Mustache=require('mustache');var util=require(_0x24fc('0x7'));var path=require(_0x24fc('0x8'));var sox=require('sox');var csv=require(_0x24fc('0x9'));var ejs=require(_0x24fc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0x9'));var querystring=require(_0x24fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x10'));var authService=require(_0x24fc('0x11'));var qs=require(_0x24fc('0x12'));var hardwareService=require(_0x24fc('0x13'));var logger=require(_0x24fc('0x14'))(_0x24fc('0x15'));var utils=require(_0x24fc('0x16'));var config=require(_0x24fc('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x24fc('0x18'));var client=jayson[_0x24fc('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x306873,_0x76cb25,_0x3f6d8b){if(_0x3f6d8b){var _0x3bc30b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bc30b[_0x24fc('0x1a')](_0x76cb25)){return _0x306873;}else{throw new Error(_0x24fc('0x1b'));}}else{return _0x306873;}}function respondWithRpcPromise(_0x537b5c,_0x2a0971,_0x18c0a7,_0x2ffed3){return new BPromise(function(_0x42cbe8,_0x4acd36){var _0x2ac989=_0x2ffed3||client;return _0x2ac989['request'](_0x537b5c,_0x18c0a7)[_0x24fc('0x1c')](function(_0x3385c7){logger[_0x24fc('0x1d')](_0x24fc('0x1e'),_0x2a0971,_0x24fc('0x1f'));logger['debug'](_0x24fc('0x20'),_0x2a0971,_0x24fc('0x1f'),JSON[_0x24fc('0x21')](_0x3385c7));if(_0x3385c7[_0x24fc('0x22')]){if(_0x3385c7['error'][_0x24fc('0x23')]===0x1f4){logger[_0x24fc('0x22')](_0x24fc('0x1e'),_0x2a0971,_0x3385c7['error'][_0x24fc('0x24')]);return _0x4acd36(_0x3385c7[_0x24fc('0x22')][_0x24fc('0x24')]);}logger[_0x24fc('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2a0971,_0x3385c7[_0x24fc('0x22')]['message']);return _0x42cbe8(_0x3385c7[_0x24fc('0x22')]['message']);}else{logger[_0x24fc('0x1d')](_0x24fc('0x1e'),_0x2a0971,_0x24fc('0x1f'));_0x42cbe8(_0x3385c7['result'][_0x24fc('0x24')]);}})['catch'](function(_0x35a9c7){logger[_0x24fc('0x22')](_0x24fc('0x1e'),_0x2a0971,_0x35a9c7);_0x4acd36(_0x35a9c7);});});}function respondWithStatusCode(_0x34b5b2,_0x3296fc){_0x3296fc=_0x3296fc||0xcc;return function(_0x262e11){if(_0x262e11){return _0x34b5b2[_0x24fc('0x25')](_0x3296fc);}return _0x34b5b2[_0x24fc('0x26')](_0x3296fc)[_0x24fc('0x27')]();};}function respondWithResult(_0x2a5c4b,_0x568441){_0x568441=_0x568441||0xc8;return function(_0x11c913){if(_0x11c913){return _0x2a5c4b[_0x24fc('0x26')](_0x568441)[_0x24fc('0x28')](_0x11c913);}};}function respondWithFilteredResult(_0x5bb4c8,_0xf2f77d){return function(_0x3d1ec8){if(_0x3d1ec8){var _0x35f9f9=_0x3d1ec8['count'],_0x290f84=_0xf2f77d[_0x24fc('0x29')],_0x8f2528=_0xf2f77d[_0x24fc('0x29')]+_0xf2f77d[_0x24fc('0x2a')],_0x443796;if(_0x8f2528>=_0x35f9f9){_0x8f2528=_0x35f9f9;_0x443796=0xc8;}else{_0x443796=0xce;}_0x5bb4c8[_0x24fc('0x26')](_0x443796);return _0x5bb4c8[_0x24fc('0x2b')]('Content-Range',_0x290f84+'-'+_0x8f2528+'/'+_0x35f9f9)['json'](_0x3d1ec8);}return null;};}function patchUpdates(_0x4e6f73){return function(_0x3df6f4){try{jsonpatch['apply'](_0x3df6f4,_0x4e6f73,!![]);}catch(_0x3f2464){return BPromise[_0x24fc('0x2c')](_0x3f2464);}return _0x3df6f4[_0x24fc('0x2d')]();};}function saveUpdates(_0x2086c0,_0x4dbd52){return function(_0x66eec0){if(_0x66eec0){return _0x66eec0[_0x24fc('0x2e')](_0x2086c0)['then'](function(_0xf46cd5){return _0xf46cd5;});}return null;};}function removeEntity(_0x1b174d,_0x4d756f){return function(_0x48c62a){if(_0x48c62a){return _0x48c62a[_0x24fc('0x2f')]()['then'](function(){_0x1b174d[_0x24fc('0x26')](0xcc)[_0x24fc('0x27')]();});}};}function handleEntityNotFound(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(!_0x33bbf2){_0x5491b0[_0x24fc('0x25')](0x194);}return _0x33bbf2;};}function handleError(_0x1f7f8d,_0x1c5874){_0x1c5874=_0x1c5874||0x1f4;return function(_0x1e205d){logger[_0x24fc('0x22')](_0x1e205d[_0x24fc('0x30')]);if(_0x1e205d[_0x24fc('0x31')]){delete _0x1e205d['name'];}_0x1f7f8d[_0x24fc('0x26')](_0x1c5874)[_0x24fc('0x32')](_0x1e205d);};}exports[_0x24fc('0x33')]=function(_0x316aa2,_0x242bd5){var _0x5781d2={},_0x56a9bd={},_0xd52d10={'count':0x0,'rows':[]};var _0x5d48fe=db[_0x24fc('0x34')][_0x24fc('0x35')];_0x56a9bd[_0x24fc('0x36')]=_[_0x24fc('0x37')](_0x5d48fe);_0x56a9bd['query']=_[_0x24fc('0x37')](_0x316aa2['query']);_0x56a9bd[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x56a9bd[_0x24fc('0x36')],_0x56a9bd[_0x24fc('0x3a')]);_0x5781d2[_0x24fc('0x3b')]=_['intersection'](_0x56a9bd[_0x24fc('0x36')],qs[_0x24fc('0x3c')](_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x5781d2['attributes']=_0x5781d2[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x5781d2['attributes']:_0x56a9bd[_0x24fc('0x36')];if(!_0x316aa2['query'][_0x24fc('0x3e')](_0x24fc('0x3f'))){_0x5781d2[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x2a')]);_0x5781d2[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x316aa2['query'][_0x24fc('0x29')]);}_0x5781d2[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x316aa2['query'][_0x24fc('0x41')]);_0x5781d2[_0x24fc('0x42')]=qs['filters'](_[_0x24fc('0x43')](_0x316aa2[_0x24fc('0x3a')],_0x56a9bd[_0x24fc('0x38')]));if(_0x316aa2['query'][_0x24fc('0x44')]){_0x5781d2[_0x24fc('0x42')]=_['merge'](_0x5781d2[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x5d48fe,function(_0x158f7b){if(_0x158f7b[_0x24fc('0x46')]['key']!==_0x24fc('0x47')){var _0x9bc56a={};_0x9bc56a[_0x158f7b[_0x24fc('0x48')]]={'$like':'%'+_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x9bc56a;}})});}_0x5781d2=_['merge']({},_0x5781d2,_0x316aa2[_0x24fc('0x49')]);var _0x1b9c90={'where':_0x5781d2[_0x24fc('0x42')]};return db[_0x24fc('0x34')]['count'](_0x1b9c90)[_0x24fc('0x1c')](function(_0x253358){_0xd52d10['count']=_0x253358;if(_0x316aa2['query'][_0x24fc('0x4a')]){_0x5781d2['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x24fc('0x4b')](_0x5781d2);})['then'](function(_0x281194){_0xd52d10[_0x24fc('0x4c')]=_0x281194;return _0xd52d10;})[_0x24fc('0x1c')](respondWithFilteredResult(_0x242bd5,_0x5781d2))['catch'](handleError(_0x242bd5,null));};exports[_0x24fc('0x4d')]=function(_0x23c1d4,_0x1b1f1c){var _0x1ad8d6={'raw':![],'where':{'id':_0x23c1d4[_0x24fc('0x4e')]['id']}},_0x39873d={};_0x39873d[_0x24fc('0x36')]=_[_0x24fc('0x37')](db['SugarcrmConfiguration']['rawAttributes']);_0x39873d[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x23c1d4[_0x24fc('0x3a')]);_0x39873d['filters']=_['intersection'](_0x39873d[_0x24fc('0x36')],_0x39873d[_0x24fc('0x3a')]);_0x1ad8d6[_0x24fc('0x3b')]=_[_0x24fc('0x39')](_0x39873d[_0x24fc('0x36')],qs[_0x24fc('0x3c')](_0x23c1d4[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x1ad8d6[_0x24fc('0x3b')]=_0x1ad8d6[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x1ad8d6[_0x24fc('0x3b')]:_0x39873d['model'];if(_0x23c1d4[_0x24fc('0x3a')][_0x24fc('0x4a')]){_0x1ad8d6[_0x24fc('0x4f')]=[{'all':!![]}];}_0x1ad8d6=_[_0x24fc('0x50')]({},_0x1ad8d6,_0x23c1d4[_0x24fc('0x49')]);return db['SugarcrmConfiguration'][_0x24fc('0x51')](_0x1ad8d6)['then'](handleEntityNotFound(_0x1b1f1c,null))[_0x24fc('0x1c')](respondWithResult(_0x1b1f1c,null))[_0x24fc('0x52')](handleError(_0x1b1f1c,null));};exports[_0x24fc('0x53')]=function(_0x41ddfb,_0x40f42b){return db[_0x24fc('0x34')]['create'](_0x41ddfb[_0x24fc('0x54')],{})[_0x24fc('0x1c')](respondWithResult(_0x40f42b,0xc9))[_0x24fc('0x52')](handleError(_0x40f42b,null));};exports[_0x24fc('0x2e')]=function(_0x28f799,_0x870767){if(_0x28f799['body']['id']){delete _0x28f799[_0x24fc('0x54')]['id'];}return db[_0x24fc('0x34')][_0x24fc('0x51')]({'where':{'id':_0x28f799[_0x24fc('0x4e')]['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x870767,null))[_0x24fc('0x1c')](saveUpdates(_0x28f799[_0x24fc('0x54')],null))['then'](respondWithResult(_0x870767,null))[_0x24fc('0x52')](handleError(_0x870767,null));};exports[_0x24fc('0x2f')]=function(_0x4ae720,_0x1368f6){return db[_0x24fc('0x34')][_0x24fc('0x51')]({'where':{'id':_0x4ae720[_0x24fc('0x4e')]['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x1368f6,null))[_0x24fc('0x1c')](removeEntity(_0x1368f6,null))['catch'](handleError(_0x1368f6,null));};exports[_0x24fc('0x55')]=function(_0x4a0524,_0x3e9644,_0x8c9649){var _0x50e5b0={};var _0x435442={};var _0x5c1a92;var _0x1c1f74;return db['SugarcrmConfiguration'][_0x24fc('0x56')]({'where':{'id':_0x4a0524[_0x24fc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3e9644,null))[_0x24fc('0x1c')](function(_0x5d6539){if(_0x5d6539){_0x5c1a92=_0x5d6539;_0x435442[_0x24fc('0x36')]=_[_0x24fc('0x37')](db['SugarcrmField'][_0x24fc('0x35')]);_0x435442[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x4a0524[_0x24fc('0x3a')]);_0x435442[_0x24fc('0x38')]=_['intersection'](_0x435442[_0x24fc('0x36')],_0x435442[_0x24fc('0x3a')]);_0x50e5b0[_0x24fc('0x3b')]=_[_0x24fc('0x39')](_0x435442[_0x24fc('0x36')],qs['fields'](_0x4a0524['query'][_0x24fc('0x3c')]));_0x50e5b0[_0x24fc('0x3b')]=_0x50e5b0['attributes']['length']?_0x50e5b0[_0x24fc('0x3b')]:_0x435442[_0x24fc('0x36')];_0x50e5b0[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x4a0524['query'][_0x24fc('0x41')]);_0x50e5b0[_0x24fc('0x42')]=qs[_0x24fc('0x38')](_[_0x24fc('0x43')](_0x4a0524[_0x24fc('0x3a')],_0x435442[_0x24fc('0x38')]));if(_0x4a0524[_0x24fc('0x3a')][_0x24fc('0x44')]){_0x50e5b0[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x50e5b0[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x50e5b0[_0x24fc('0x3b')],function(_0x24ca4b){var _0x354fc6={};_0x354fc6[_0x24ca4b]={'$like':'%'+_0x4a0524['query'][_0x24fc('0x44')]+'%'};return _0x354fc6;})});}_0x50e5b0=_[_0x24fc('0x50')]({},_0x50e5b0,_0x4a0524[_0x24fc('0x49')]);return _0x5c1a92[_0x24fc('0x55')](_0x50e5b0);}})[_0x24fc('0x1c')](function(_0x2eb6dc){if(_0x2eb6dc){_0x1c1f74=_0x2eb6dc[_0x24fc('0x3d')];if(!_0x4a0524[_0x24fc('0x3a')]['hasOwnProperty'](_0x24fc('0x3f'))){_0x50e5b0[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x4a0524[_0x24fc('0x3a')]['limit']);_0x50e5b0[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x4a0524['query']['offset']);}return _0x5c1a92['getFields'](_0x50e5b0);}})[_0x24fc('0x1c')](function(_0x698283){if(_0x698283){return _0x698283?{'count':_0x1c1f74,'rows':_0x698283}:null;}})[_0x24fc('0x1c')](respondWithResult(_0x3e9644,null))[_0x24fc('0x52')](handleError(_0x3e9644,null));};exports[_0x24fc('0x57')]=function(_0x1d0f06,_0x52e1aa,_0x11bafd){var _0x15e8a3={};var _0x5a2c09={};var _0x51b1c0;var _0xfc6b7f;return db[_0x24fc('0x34')][_0x24fc('0x56')]({'where':{'id':_0x1d0f06['params']['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x52e1aa,null))[_0x24fc('0x1c')](function(_0x33f04e){if(_0x33f04e){_0x51b1c0=_0x33f04e;_0x5a2c09['model']=_['keys'](db['SugarcrmField']['rawAttributes']);_0x5a2c09['query']=_[_0x24fc('0x37')](_0x1d0f06[_0x24fc('0x3a')]);_0x5a2c09[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x5a2c09['model'],_0x5a2c09[_0x24fc('0x3a')]);_0x15e8a3['attributes']=_[_0x24fc('0x39')](_0x5a2c09['model'],qs[_0x24fc('0x3c')](_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x15e8a3[_0x24fc('0x3b')]=_0x15e8a3[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x15e8a3[_0x24fc('0x3b')]:_0x5a2c09['model'];_0x15e8a3[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x1d0f06[_0x24fc('0x3a')]['sort']);_0x15e8a3['where']=qs[_0x24fc('0x38')](_[_0x24fc('0x43')](_0x1d0f06['query'],_0x5a2c09[_0x24fc('0x38')]));if(_0x1d0f06[_0x24fc('0x3a')]['filter']){_0x15e8a3[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x15e8a3['where'],{'$or':_[_0x24fc('0x45')](_0x15e8a3[_0x24fc('0x3b')],function(_0x24e717){var _0x1efe4e={};_0x1efe4e[_0x24e717]={'$like':'%'+_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x1efe4e;})});}_0x15e8a3=_['merge']({},_0x15e8a3,_0x1d0f06['options']);return _0x51b1c0[_0x24fc('0x57')](_0x15e8a3);}})['then'](function(_0x29bd9f){if(_0x29bd9f){_0xfc6b7f=_0x29bd9f['length'];if(!_0x1d0f06['query'][_0x24fc('0x3e')](_0x24fc('0x3f'))){_0x15e8a3[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x2a')]);_0x15e8a3[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x1d0f06['query'][_0x24fc('0x29')]);}return _0x51b1c0[_0x24fc('0x57')](_0x15e8a3);}})['then'](function(_0x47e22f){if(_0x47e22f){return _0x47e22f?{'count':_0xfc6b7f,'rows':_0x47e22f}:null;}})[_0x24fc('0x1c')](respondWithResult(_0x52e1aa,null))[_0x24fc('0x52')](handleError(_0x52e1aa,null));};exports[_0x24fc('0x58')]=function(_0x1b2a97,_0xd1e6,_0x5de0ea){var _0x216781={};var _0xcb7986={};var _0x5ca35b;var _0x13ab57;return db[_0x24fc('0x34')][_0x24fc('0x56')]({'where':{'id':_0x1b2a97['params']['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0xd1e6,null))[_0x24fc('0x1c')](function(_0x3399fe){if(_0x3399fe){_0x5ca35b=_0x3399fe;_0xcb7986[_0x24fc('0x36')]=_[_0x24fc('0x37')](db[_0x24fc('0x59')][_0x24fc('0x35')]);_0xcb7986[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x1b2a97['query']);_0xcb7986[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0xcb7986[_0x24fc('0x36')],_0xcb7986['query']);_0x216781['attributes']=_['intersection'](_0xcb7986[_0x24fc('0x36')],qs['fields'](_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x216781['attributes']=_0x216781[_0x24fc('0x3b')]['length']?_0x216781[_0x24fc('0x3b')]:_0xcb7986['model'];_0x216781[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x41')]);_0x216781[_0x24fc('0x42')]=qs[_0x24fc('0x38')](_['pick'](_0x1b2a97[_0x24fc('0x3a')],_0xcb7986[_0x24fc('0x38')]));if(_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x44')]){_0x216781[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x216781[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x216781[_0x24fc('0x3b')],function(_0x5f4ec2){var _0x2c9119={};_0x2c9119[_0x5f4ec2]={'$like':'%'+_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x2c9119;})});}_0x216781=_[_0x24fc('0x50')]({},_0x216781,_0x1b2a97['options']);return _0x5ca35b[_0x24fc('0x58')](_0x216781);}})[_0x24fc('0x1c')](function(_0xc2be0f){if(_0xc2be0f){_0x13ab57=_0xc2be0f['length'];if(!_0x1b2a97[_0x24fc('0x3a')]['hasOwnProperty']('nolimit')){_0x216781['limit']=qs[_0x24fc('0x2a')](_0x1b2a97['query'][_0x24fc('0x2a')]);_0x216781[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x1b2a97[_0x24fc('0x3a')]['offset']);}return _0x5ca35b[_0x24fc('0x58')](_0x216781);}})[_0x24fc('0x1c')](function(_0x3d8394){if(_0x3d8394){return _0x3d8394?{'count':_0x13ab57,'rows':_0x3d8394}:null;}})[_0x24fc('0x1c')](respondWithResult(_0xd1e6,null))[_0x24fc('0x52')](handleError(_0xd1e6,null));};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
index 00f1b61..5bb8733 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9417=['./intSugarcrmConfiguration.attributes','exports','define','lodash','util','api','bluebird','request-promise','path'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0x9417,0xc0));var _0x7941=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0x9417[_0x2e3545];return _0xcf18f;};'use strict';var _=require(_0x7941('0x0'));var util=require(_0x7941('0x1'));var logger=require('../../config/logger')(_0x7941('0x2'));var moment=require('moment');var BPromise=require(_0x7941('0x3'));var rp=require(_0x7941('0x4'));var fs=require('fs');var path=require(_0x7941('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7941('0x6'));module[_0x7941('0x7')]=function(_0x17f3d1,_0x561929){return _0x17f3d1[_0x7941('0x8')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc578=['bluebird','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','../../config/logger','api','moment'];(function(_0x4937e9,_0x1b4f12){var _0xeb2083=function(_0x4216de){while(--_0x4216de){_0x4937e9['push'](_0x4937e9['shift']());}};_0xeb2083(++_0x1b4f12);}(_0xc578,0x189));var _0x8c57=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc578[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c57('0x0'))(_0x8c57('0x1'));var moment=require(_0x8c57('0x2'));var BPromise=require(_0x8c57('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c57('0x4'));var rimraf=require(_0x8c57('0x5'));var config=require(_0x8c57('0x6'));var attributes=require(_0x8c57('0x7'));module[_0x8c57('0x8')]=function(_0x5836f0,_0xabf300){return _0x5836f0[_0x8c57('0x9')]('SugarcrmConfiguration',attributes,{'tableName':_0x8c57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
index ba1ef84..94bb703 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe56c=['../../config/logger','rpc','client','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe56c,0xa1));var _0xce56=function(_0x1c7fc9,_0x561e62){_0x1c7fc9=_0x1c7fc9-0x0;var _0x5b0bf1=_0xe56c[_0x1c7fc9];return _0x5b0bf1;};'use strict';var _=require('lodash');var util=require(_0xce56('0x0'));var moment=require(_0xce56('0x1'));var BPromise=require(_0xce56('0x2'));var rs=require(_0xce56('0x3'));var fs=require('fs');var Redis=require(_0xce56('0x4'));var db=require(_0xce56('0x5'))['db'];var utils=require(_0xce56('0x6'));var logger=require(_0xce56('0x7'))(_0xce56('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xce56('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ce4fa,_0x139689,_0x1095f8){return new BPromise(function(_0x374565,_0x4e6e31){return client[_0xce56('0xa')](_0x1ce4fa,_0x1095f8)['then'](function(_0x497a26){logger[_0xce56('0xb')](_0xce56('0xc'),_0x139689,_0xce56('0xd'));logger[_0xce56('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x139689,_0xce56('0xd'),JSON[_0xce56('0xf')](_0x497a26));if(_0x497a26[_0xce56('0x10')]){if(_0x497a26[_0xce56('0x10')][_0xce56('0x11')]===0x1f4){logger[_0xce56('0x10')](_0xce56('0xc'),_0x139689,_0x497a26['error']['message']);return _0x4e6e31(_0x497a26[_0xce56('0x10')][_0xce56('0x12')]);}logger['error'](_0xce56('0xc'),_0x139689,_0x497a26[_0xce56('0x10')][_0xce56('0x12')]);return _0x374565(_0x497a26[_0xce56('0x10')][_0xce56('0x12')]);}else{logger[_0xce56('0xb')](_0xce56('0xc'),_0x139689,_0xce56('0xd'));_0x374565(_0x497a26[_0xce56('0x13')][_0xce56('0x12')]);}})[_0xce56('0x14')](function(_0x2c764e){logger[_0xce56('0x10')](_0xce56('0xc'),_0x139689,_0x2c764e);_0x4e6e31(_0x2c764e);});});}
\ No newline at end of file
+var _0x181e=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x4ee0ec,_0x2ee9f8){var _0x5f5adc=function(_0x520745){while(--_0x520745){_0x4ee0ec['push'](_0x4ee0ec['shift']());}};_0x5f5adc(++_0x2ee9f8);}(_0x181e,0x17d));var _0xe181=function(_0x2be1ab,_0x2fe1fc){_0x2be1ab=_0x2be1ab-0x0;var _0x4c616d=_0x181e[_0x2be1ab];return _0x4c616d;};'use strict';var _=require(_0xe181('0x0'));var util=require(_0xe181('0x1'));var moment=require(_0xe181('0x2'));var BPromise=require(_0xe181('0x3'));var rs=require(_0xe181('0x4'));var fs=require('fs');var Redis=require(_0xe181('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe181('0x6'));var logger=require(_0xe181('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe181('0x8'));var client=jayson['client'][_0xe181('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e35fa,_0x58b960,_0x3af03b){return new BPromise(function(_0x3bd212,_0x3b486a){return client[_0xe181('0xa')](_0x4e35fa,_0x3af03b)['then'](function(_0x167573){logger[_0xe181('0xb')](_0xe181('0xc'),_0x58b960,'request\x20sent');logger['debug'](_0xe181('0xd'),_0x58b960,_0xe181('0xe'),JSON['stringify'](_0x167573));if(_0x167573['error']){if(_0x167573[_0xe181('0xf')][_0xe181('0x10')]===0x1f4){logger['error'](_0xe181('0xc'),_0x58b960,_0x167573[_0xe181('0xf')]['message']);return _0x3b486a(_0x167573[_0xe181('0xf')][_0xe181('0x11')]);}logger[_0xe181('0xf')](_0xe181('0xc'),_0x58b960,_0x167573['error'][_0xe181('0x11')]);return _0x3bd212(_0x167573[_0xe181('0xf')][_0xe181('0x11')]);}else{logger[_0xe181('0xb')](_0xe181('0xc'),_0x58b960,_0xe181('0xe'));_0x3bd212(_0x167573[_0xe181('0x12')][_0xe181('0x11')]);}})[_0xe181('0x13')](function(_0xf22e62){logger[_0xe181('0xf')](_0xe181('0xc'),_0x58b960,_0xf22e62);_0x3b486a(_0xf22e62);});});}
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js
index e504275..146a3ca 100644
--- a/server/api/intSugarcrmField/index.js
+++ b/server/api/intSugarcrmField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x12fe=['get','index','/:id','isAuthenticated','put','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller'];(function(_0x53d743,_0x4ac86f){var _0xab2a7=function(_0x302bdf){while(--_0x302bdf){_0x53d743['push'](_0x53d743['shift']());}};_0xab2a7(++_0x4ac86f);}(_0x12fe,0x1e8));var _0xe12f=function(_0x122366,_0x3cd609){_0x122366=_0x122366-0x0;var _0xfdf8ee=_0x12fe[_0x122366];return _0xfdf8ee;};'use strict';var multer=require('multer');var util=require(_0xe12f('0x0'));var path=require('path');var timeout=require(_0xe12f('0x1'));var express=require(_0xe12f('0x2'));var router=express[_0xe12f('0x3')]();var auth=require(_0xe12f('0x4'));var interaction=require(_0xe12f('0x5'));var config=require('../../config/environment');var controller=require(_0xe12f('0x6'));router[_0xe12f('0x7')]('/',auth['isAuthenticated'](),controller[_0xe12f('0x8')]);router[_0xe12f('0x7')](_0xe12f('0x9'),auth[_0xe12f('0xa')](),controller['show']);router['post']('/',auth[_0xe12f('0xa')](),controller['create']);router[_0xe12f('0xb')](_0xe12f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xe12f('0xc')](_0xe12f('0x9'),auth[_0xe12f('0xa')](),controller[_0xe12f('0xd')]);module[_0xe12f('0xe')]=router;
\ No newline at end of file
+var _0x9dfd=['index','/:id','post','create','put','update','exports','multer','express','Router','../../config/environment','get','isAuthenticated'];(function(_0x4de7f5,_0xb0b2bb){var _0x23d7de=function(_0x551147){while(--_0x551147){_0x4de7f5['push'](_0x4de7f5['shift']());}};_0x23d7de(++_0xb0b2bb);}(_0x9dfd,0x1e8));var _0xd9df=function(_0x2cefb2,_0x1a9f17){_0x2cefb2=_0x2cefb2-0x0;var _0x1fed1d=_0x9dfd[_0x2cefb2];return _0x1fed1d;};'use strict';var multer=require(_0xd9df('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd9df('0x1'));var router=express[_0xd9df('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd9df('0x3'));var controller=require('./intSugarcrmField.controller');router[_0xd9df('0x4')]('/',auth[_0xd9df('0x5')](),controller[_0xd9df('0x6')]);router[_0xd9df('0x4')](_0xd9df('0x7'),auth[_0xd9df('0x5')](),controller['show']);router[_0xd9df('0x8')]('/',auth[_0xd9df('0x5')](),controller[_0xd9df('0x9')]);router[_0xd9df('0xa')](_0xd9df('0x7'),auth['isAuthenticated'](),controller[_0xd9df('0xb')]);router['delete'](_0xd9df('0x7'),auth[_0xd9df('0x5')](),controller['destroy']);module[_0xd9df('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js
index aeb3ce8..4a2dce9 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.attributes.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x91a7=['STRING','exports','ENUM','string','customVariable'];(function(_0x2712c3,_0x37d83c){var _0x177596=function(_0x2f414b){while(--_0x2f414b){_0x2712c3['push'](_0x2712c3['shift']());}};_0x177596(++_0x37d83c);}(_0x91a7,0xe7));var _0x791a=function(_0x17b460,_0x4bb923){_0x17b460=_0x17b460-0x0;var _0x5e15a7=_0x91a7[_0x17b460];return _0x5e15a7;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'type':{'type':Sequelize[_0x791a('0x1')](_0x791a('0x2'),'variable',_0x791a('0x3'),'keyValue'),'defaultValue':_0x791a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x791a('0x1')](_0x791a('0x2'),'variable',_0x791a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x791a('0x4')]},'nameField':{'type':Sequelize[_0x791a('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x791a('0x4')]}};
\ No newline at end of file
+var _0xbdb7=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x358f87,_0x5a4d20){_0x358f87=_0x358f87-0x0;var _0x4b2fdb=_0xbdb7[_0x358f87];return _0x4b2fdb;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'type':{'type':Sequelize[_0x7bdb('0x2')](_0x7bdb('0x3'),_0x7bdb('0x4'),_0x7bdb('0x5'),_0x7bdb('0x6')),'defaultValue':_0x7bdb('0x3')},'content':{'type':Sequelize[_0x7bdb('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7bdb('0x2')]('string','variable',_0x7bdb('0x5'))},'keyContent':{'type':Sequelize[_0x7bdb('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7bdb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7bdb('0x7')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js
index b459b0d..e82ce29 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.controller.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc94=['params','keys','options','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','index','SugarcrmField','rawAttributes','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','catch','show'];(function(_0x361858,_0x5435fa){var _0x49961e=function(_0x5214e1){while(--_0x5214e1){_0x361858['push'](_0x361858['shift']());}};_0x49961e(++_0x5435fa);}(_0xbc94,0x151));var _0x4bc9=function(_0x382d8e,_0x2a5761){_0x382d8e=_0x382d8e-0x0;var _0x23993d=_0xbc94[_0x382d8e];return _0x23993d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4bc9('0x0'));var rimraf=require(_0x4bc9('0x1'));var zipdir=require(_0x4bc9('0x2'));var jsonpatch=require(_0x4bc9('0x3'));var rp=require('request-promise');var moment=require(_0x4bc9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4bc9('0x5'));var util=require(_0x4bc9('0x6'));var path=require(_0x4bc9('0x7'));var sox=require('sox');var csv=require(_0x4bc9('0x8'));var ejs=require(_0x4bc9('0x9'));var fs=require('fs');var _=require(_0x4bc9('0xa'));var squel=require(_0x4bc9('0xb'));var crypto=require(_0x4bc9('0xc'));var jsforce=require(_0x4bc9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4bc9('0xe'));var authService=require(_0x4bc9('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4bc9('0x10'));var db=require(_0x4bc9('0x11'))['db'];function respondWithStatusCode(_0x11f8b5,_0x4526dc){_0x4526dc=_0x4526dc||0xcc;return function(_0xc7257a){if(_0xc7257a){return _0x11f8b5['sendStatus'](_0x4526dc);}return _0x11f8b5['status'](_0x4526dc)[_0x4bc9('0x12')]();};}function respondWithResult(_0x39b9b5,_0x4cab3e){_0x4cab3e=_0x4cab3e||0xc8;return function(_0x2dc921){if(_0x2dc921){return _0x39b9b5['status'](_0x4cab3e)[_0x4bc9('0x13')](_0x2dc921);}};}function respondWithFilteredResult(_0x567cd4,_0x3c84b1){return function(_0x4d9686){if(_0x4d9686){var _0x1b16e8=_0x4d9686[_0x4bc9('0x14')],_0xb7ff1d=_0x3c84b1[_0x4bc9('0x15')],_0x5ad67e=_0x3c84b1['offset']+_0x3c84b1[_0x4bc9('0x16')],_0x5be0b6;if(_0x5ad67e>=_0x1b16e8){_0x5ad67e=_0x1b16e8;_0x5be0b6=0xc8;}else{_0x5be0b6=0xce;}_0x567cd4[_0x4bc9('0x17')](_0x5be0b6);return _0x567cd4[_0x4bc9('0x18')](_0x4bc9('0x19'),_0xb7ff1d+'-'+_0x5ad67e+'/'+_0x1b16e8)['json'](_0x4d9686);}return null;};}function patchUpdates(_0x4dbffc){return function(_0x1728c0){try{jsonpatch[_0x4bc9('0x1a')](_0x1728c0,_0x4dbffc,!![]);}catch(_0x22bcd6){return BPromise['reject'](_0x22bcd6);}return _0x1728c0[_0x4bc9('0x1b')]();};}function saveUpdates(_0x362612,_0x2ff675){return function(_0x3d21d3){if(_0x3d21d3){return _0x3d21d3['update'](_0x362612)['then'](function(_0x515bf9){return _0x515bf9;});}return null;};}function removeEntity(_0x32b103,_0x12b744){return function(_0xa7c91d){if(_0xa7c91d){return _0xa7c91d[_0x4bc9('0x1c')]()[_0x4bc9('0x1d')](function(){_0x32b103[_0x4bc9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1654e0,_0x394132){return function(_0x5a5de2){if(!_0x5a5de2){_0x1654e0[_0x4bc9('0x1e')](0x194);}return _0x5a5de2;};}function handleError(_0x29c07e,_0x191594){_0x191594=_0x191594||0x1f4;return function(_0x2c5e98){logger[_0x4bc9('0x1f')](_0x2c5e98[_0x4bc9('0x20')]);if(_0x2c5e98[_0x4bc9('0x21')]){delete _0x2c5e98['name'];}_0x29c07e['status'](_0x191594)['send'](_0x2c5e98);};}exports[_0x4bc9('0x22')]=function(_0x6718c2,_0x17fcb7){var _0x144509={},_0xc3b62d={},_0x4ac3e4={'count':0x0,'rows':[]};var _0x44e9e6=db[_0x4bc9('0x23')][_0x4bc9('0x24')];_0xc3b62d[_0x4bc9('0x25')]=_['keys'](_0x44e9e6);_0xc3b62d['query']=_['keys'](_0x6718c2[_0x4bc9('0x26')]);_0xc3b62d[_0x4bc9('0x27')]=_[_0x4bc9('0x28')](_0xc3b62d[_0x4bc9('0x25')],_0xc3b62d['query']);_0x144509['attributes']=_[_0x4bc9('0x28')](_0xc3b62d[_0x4bc9('0x25')],qs[_0x4bc9('0x29')](_0x6718c2[_0x4bc9('0x26')]['fields']));_0x144509[_0x4bc9('0x2a')]=_0x144509['attributes'][_0x4bc9('0x2b')]?_0x144509[_0x4bc9('0x2a')]:_0xc3b62d[_0x4bc9('0x25')];if(!_0x6718c2[_0x4bc9('0x26')]['hasOwnProperty'](_0x4bc9('0x2c'))){_0x144509[_0x4bc9('0x16')]=qs[_0x4bc9('0x16')](_0x6718c2[_0x4bc9('0x26')][_0x4bc9('0x16')]);_0x144509[_0x4bc9('0x15')]=qs['offset'](_0x6718c2[_0x4bc9('0x26')][_0x4bc9('0x15')]);}_0x144509[_0x4bc9('0x2d')]=qs['sort'](_0x6718c2[_0x4bc9('0x26')][_0x4bc9('0x2e')]);_0x144509[_0x4bc9('0x2f')]=qs[_0x4bc9('0x27')](_['pick'](_0x6718c2[_0x4bc9('0x26')],_0xc3b62d[_0x4bc9('0x27')]));if(_0x6718c2[_0x4bc9('0x26')]['filter']){_0x144509[_0x4bc9('0x2f')]=_[_0x4bc9('0x30')](_0x144509[_0x4bc9('0x2f')],{'$or':_[_0x4bc9('0x31')](_0x44e9e6,function(_0x3391d0){if(_0x3391d0[_0x4bc9('0x32')][_0x4bc9('0x33')]!==_0x4bc9('0x34')){var _0x5ac5d0={};_0x5ac5d0[_0x3391d0[_0x4bc9('0x35')]]={'$like':'%'+_0x6718c2[_0x4bc9('0x26')]['filter']+'%'};return _0x5ac5d0;}})});}_0x144509=_[_0x4bc9('0x30')]({},_0x144509,_0x6718c2['options']);var _0x5df915={'where':_0x144509['where']};return db['SugarcrmField'][_0x4bc9('0x14')](_0x5df915)[_0x4bc9('0x1d')](function(_0x2dddba){_0x4ac3e4['count']=_0x2dddba;if(_0x6718c2['query'][_0x4bc9('0x36')]){_0x144509[_0x4bc9('0x37')]=[{'all':!![]}];}return db[_0x4bc9('0x23')]['findAll'](_0x144509);})[_0x4bc9('0x1d')](function(_0x4b0f07){_0x4ac3e4[_0x4bc9('0x38')]=_0x4b0f07;return _0x4ac3e4;})[_0x4bc9('0x1d')](respondWithFilteredResult(_0x17fcb7,_0x144509))[_0x4bc9('0x39')](handleError(_0x17fcb7,null));};exports[_0x4bc9('0x3a')]=function(_0x2bf529,_0xb5c55){var _0xd32cd1={'raw':!![],'where':{'id':_0x2bf529[_0x4bc9('0x3b')]['id']}},_0x56b615={};_0x56b615[_0x4bc9('0x25')]=_['keys'](db[_0x4bc9('0x23')]['rawAttributes']);_0x56b615[_0x4bc9('0x26')]=_[_0x4bc9('0x3c')](_0x2bf529['query']);_0x56b615[_0x4bc9('0x27')]=_[_0x4bc9('0x28')](_0x56b615['model'],_0x56b615[_0x4bc9('0x26')]);_0xd32cd1[_0x4bc9('0x2a')]=_['intersection'](_0x56b615[_0x4bc9('0x25')],qs[_0x4bc9('0x29')](_0x2bf529[_0x4bc9('0x26')][_0x4bc9('0x29')]));_0xd32cd1[_0x4bc9('0x2a')]=_0xd32cd1[_0x4bc9('0x2a')][_0x4bc9('0x2b')]?_0xd32cd1[_0x4bc9('0x2a')]:_0x56b615[_0x4bc9('0x25')];if(_0x2bf529['query'][_0x4bc9('0x36')]){_0xd32cd1[_0x4bc9('0x37')]=[{'all':!![]}];}_0xd32cd1=_[_0x4bc9('0x30')]({},_0xd32cd1,_0x2bf529[_0x4bc9('0x3d')]);return db['SugarcrmField']['find'](_0xd32cd1)[_0x4bc9('0x1d')](handleEntityNotFound(_0xb5c55,null))[_0x4bc9('0x1d')](respondWithResult(_0xb5c55,null))[_0x4bc9('0x39')](handleError(_0xb5c55,null));};exports[_0x4bc9('0x3e')]=function(_0x38f792,_0x5a7899){return db[_0x4bc9('0x23')]['create'](_0x38f792[_0x4bc9('0x3f')],{})[_0x4bc9('0x1d')](respondWithResult(_0x5a7899,0xc9))[_0x4bc9('0x39')](handleError(_0x5a7899,null));};exports[_0x4bc9('0x40')]=function(_0xe37839,_0xb6361){if(_0xe37839[_0x4bc9('0x3f')]['id']){delete _0xe37839[_0x4bc9('0x3f')]['id'];}return db[_0x4bc9('0x23')][_0x4bc9('0x41')]({'where':{'id':_0xe37839['params']['id']}})[_0x4bc9('0x1d')](handleEntityNotFound(_0xb6361,null))[_0x4bc9('0x1d')](saveUpdates(_0xe37839['body'],null))[_0x4bc9('0x1d')](respondWithResult(_0xb6361,null))['catch'](handleError(_0xb6361,null));};exports['destroy']=function(_0x53fb72,_0x1d0713){return db[_0x4bc9('0x23')]['find']({'where':{'id':_0x53fb72['params']['id']}})['then'](handleEntityNotFound(_0x1d0713,null))[_0x4bc9('0x1d')](removeEntity(_0x1d0713,null))[_0x4bc9('0x39')](handleError(_0x1d0713,null));};
\ No newline at end of file
+var _0x35a9=['sort','where','pick','filter','merge','key','field','options','count','includeAll','findAll','rows','catch','show','include','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','SugarcrmField','rawAttributes','model','keys','filters','intersection','query','fields','length','attributes','hasOwnProperty','nolimit','order'];(function(_0x493bad,_0x11fd62){var _0x237376=function(_0x441827){while(--_0x441827){_0x493bad['push'](_0x493bad['shift']());}};_0x237376(++_0x11fd62);}(_0x35a9,0x14e));var _0x935a=function(_0x1f1ae5,_0x3512be){_0x1f1ae5=_0x1f1ae5-0x0;var _0x167511=_0x35a9[_0x1f1ae5];return _0x167511;};'use strict';var pdf=require(_0x935a('0x0'));var emlformat=require(_0x935a('0x1'));var rimraf=require(_0x935a('0x2'));var zipdir=require(_0x935a('0x3'));var jsonpatch=require(_0x935a('0x4'));var rp=require(_0x935a('0x5'));var moment=require(_0x935a('0x6'));var BPromise=require(_0x935a('0x7'));var Mustache=require(_0x935a('0x8'));var util=require(_0x935a('0x9'));var path=require(_0x935a('0xa'));var sox=require(_0x935a('0xb'));var csv=require('to-csv');var ejs=require(_0x935a('0xc'));var fs=require('fs');var _=require(_0x935a('0xd'));var squel=require(_0x935a('0xe'));var crypto=require(_0x935a('0xf'));var jsforce=require(_0x935a('0x10'));var deskjs=require(_0x935a('0x11'));var toCsv=require(_0x935a('0x12'));var querystring=require(_0x935a('0x13'));var Papa=require(_0x935a('0x14'));var Redis=require(_0x935a('0x15'));var authService=require(_0x935a('0x16'));var qs=require(_0x935a('0x17'));var hardwareService=require(_0x935a('0x18'));var logger=require(_0x935a('0x19'))(_0x935a('0x1a'));var utils=require(_0x935a('0x1b'));var config=require(_0x935a('0x1c'));var db=require(_0x935a('0x1d'))['db'];function respondWithStatusCode(_0x5e4ac4,_0x447566){_0x447566=_0x447566||0xcc;return function(_0x56471c){if(_0x56471c){return _0x5e4ac4['sendStatus'](_0x447566);}return _0x5e4ac4[_0x935a('0x1e')](_0x447566)[_0x935a('0x1f')]();};}function respondWithResult(_0x1a11fa,_0x4559a1){_0x4559a1=_0x4559a1||0xc8;return function(_0x430176){if(_0x430176){return _0x1a11fa[_0x935a('0x1e')](_0x4559a1)[_0x935a('0x20')](_0x430176);}};}function respondWithFilteredResult(_0x588b3e,_0x261f45){return function(_0x4e1498){if(_0x4e1498){var _0x5e5e15=_0x4e1498['count'],_0x484ad8=_0x261f45[_0x935a('0x21')],_0x3b9435=_0x261f45[_0x935a('0x21')]+_0x261f45[_0x935a('0x22')],_0x550dea;if(_0x3b9435>=_0x5e5e15){_0x3b9435=_0x5e5e15;_0x550dea=0xc8;}else{_0x550dea=0xce;}_0x588b3e['status'](_0x550dea);return _0x588b3e[_0x935a('0x23')](_0x935a('0x24'),_0x484ad8+'-'+_0x3b9435+'/'+_0x5e5e15)['json'](_0x4e1498);}return null;};}function patchUpdates(_0x43c594){return function(_0x46c724){try{jsonpatch[_0x935a('0x25')](_0x46c724,_0x43c594,!![]);}catch(_0x364014){return BPromise[_0x935a('0x26')](_0x364014);}return _0x46c724[_0x935a('0x27')]();};}function saveUpdates(_0x401fac,_0x9a5cf){return function(_0x26a760){if(_0x26a760){return _0x26a760[_0x935a('0x28')](_0x401fac)[_0x935a('0x29')](function(_0x520c16){return _0x520c16;});}return null;};}function removeEntity(_0x1f1a97,_0xa308af){return function(_0xd7c779){if(_0xd7c779){return _0xd7c779[_0x935a('0x2a')]()[_0x935a('0x29')](function(){_0x1f1a97[_0x935a('0x1e')](0xcc)[_0x935a('0x1f')]();});}};}function handleEntityNotFound(_0x3c4873,_0x2657e5){return function(_0x5f2779){if(!_0x5f2779){_0x3c4873[_0x935a('0x2b')](0x194);}return _0x5f2779;};}function handleError(_0x47626f,_0x56da39){_0x56da39=_0x56da39||0x1f4;return function(_0x5b9fb7){logger[_0x935a('0x2c')](_0x5b9fb7[_0x935a('0x2d')]);if(_0x5b9fb7[_0x935a('0x2e')]){delete _0x5b9fb7[_0x935a('0x2e')];}_0x47626f[_0x935a('0x1e')](_0x56da39)[_0x935a('0x2f')](_0x5b9fb7);};}exports['index']=function(_0x3c73c7,_0x59eab0){var _0x4a7b17={},_0x1a3a31={},_0x158271={'count':0x0,'rows':[]};var _0x1ac6ad=db[_0x935a('0x30')][_0x935a('0x31')];_0x1a3a31[_0x935a('0x32')]=_[_0x935a('0x33')](_0x1ac6ad);_0x1a3a31['query']=_[_0x935a('0x33')](_0x3c73c7['query']);_0x1a3a31[_0x935a('0x34')]=_[_0x935a('0x35')](_0x1a3a31[_0x935a('0x32')],_0x1a3a31[_0x935a('0x36')]);_0x4a7b17['attributes']=_[_0x935a('0x35')](_0x1a3a31[_0x935a('0x32')],qs['fields'](_0x3c73c7[_0x935a('0x36')][_0x935a('0x37')]));_0x4a7b17['attributes']=_0x4a7b17['attributes'][_0x935a('0x38')]?_0x4a7b17[_0x935a('0x39')]:_0x1a3a31['model'];if(!_0x3c73c7[_0x935a('0x36')][_0x935a('0x3a')](_0x935a('0x3b'))){_0x4a7b17['limit']=qs[_0x935a('0x22')](_0x3c73c7[_0x935a('0x36')]['limit']);_0x4a7b17[_0x935a('0x21')]=qs[_0x935a('0x21')](_0x3c73c7[_0x935a('0x36')][_0x935a('0x21')]);}_0x4a7b17[_0x935a('0x3c')]=qs[_0x935a('0x3d')](_0x3c73c7[_0x935a('0x36')][_0x935a('0x3d')]);_0x4a7b17[_0x935a('0x3e')]=qs[_0x935a('0x34')](_[_0x935a('0x3f')](_0x3c73c7['query'],_0x1a3a31[_0x935a('0x34')]));if(_0x3c73c7[_0x935a('0x36')][_0x935a('0x40')]){_0x4a7b17[_0x935a('0x3e')]=_[_0x935a('0x41')](_0x4a7b17[_0x935a('0x3e')],{'$or':_['map'](_0x1ac6ad,function(_0x3d30bf){if(_0x3d30bf['type'][_0x935a('0x42')]!=='VIRTUAL'){var _0x36a080={};_0x36a080[_0x3d30bf[_0x935a('0x43')]]={'$like':'%'+_0x3c73c7[_0x935a('0x36')]['filter']+'%'};return _0x36a080;}})});}_0x4a7b17=_['merge']({},_0x4a7b17,_0x3c73c7[_0x935a('0x44')]);var _0xb54be9={'where':_0x4a7b17[_0x935a('0x3e')]};return db[_0x935a('0x30')][_0x935a('0x45')](_0xb54be9)[_0x935a('0x29')](function(_0x1bfa89){_0x158271[_0x935a('0x45')]=_0x1bfa89;if(_0x3c73c7[_0x935a('0x36')][_0x935a('0x46')]){_0x4a7b17['include']=[{'all':!![]}];}return db[_0x935a('0x30')][_0x935a('0x47')](_0x4a7b17);})[_0x935a('0x29')](function(_0xfd5d97){_0x158271[_0x935a('0x48')]=_0xfd5d97;return _0x158271;})[_0x935a('0x29')](respondWithFilteredResult(_0x59eab0,_0x4a7b17))[_0x935a('0x49')](handleError(_0x59eab0,null));};exports[_0x935a('0x4a')]=function(_0x3d83f5,_0x5a96c7){var _0x39cbb0={'raw':!![],'where':{'id':_0x3d83f5['params']['id']}},_0x553c8e={};_0x553c8e[_0x935a('0x32')]=_[_0x935a('0x33')](db[_0x935a('0x30')]['rawAttributes']);_0x553c8e[_0x935a('0x36')]=_[_0x935a('0x33')](_0x3d83f5[_0x935a('0x36')]);_0x553c8e[_0x935a('0x34')]=_[_0x935a('0x35')](_0x553c8e['model'],_0x553c8e['query']);_0x39cbb0[_0x935a('0x39')]=_[_0x935a('0x35')](_0x553c8e[_0x935a('0x32')],qs['fields'](_0x3d83f5['query'][_0x935a('0x37')]));_0x39cbb0[_0x935a('0x39')]=_0x39cbb0[_0x935a('0x39')][_0x935a('0x38')]?_0x39cbb0[_0x935a('0x39')]:_0x553c8e['model'];if(_0x3d83f5[_0x935a('0x36')][_0x935a('0x46')]){_0x39cbb0[_0x935a('0x4b')]=[{'all':!![]}];}_0x39cbb0=_[_0x935a('0x41')]({},_0x39cbb0,_0x3d83f5[_0x935a('0x44')]);return db[_0x935a('0x30')]['find'](_0x39cbb0)[_0x935a('0x29')](handleEntityNotFound(_0x5a96c7,null))['then'](respondWithResult(_0x5a96c7,null))[_0x935a('0x49')](handleError(_0x5a96c7,null));};exports['create']=function(_0x4f4a94,_0x54a576){return db['SugarcrmField'][_0x935a('0x4c')](_0x4f4a94[_0x935a('0x4d')],{})[_0x935a('0x29')](respondWithResult(_0x54a576,0xc9))['catch'](handleError(_0x54a576,null));};exports[_0x935a('0x28')]=function(_0x1207c6,_0x3083f2){if(_0x1207c6[_0x935a('0x4d')]['id']){delete _0x1207c6[_0x935a('0x4d')]['id'];}return db[_0x935a('0x30')]['find']({'where':{'id':_0x1207c6['params']['id']}})[_0x935a('0x29')](handleEntityNotFound(_0x3083f2,null))['then'](saveUpdates(_0x1207c6[_0x935a('0x4d')],null))[_0x935a('0x29')](respondWithResult(_0x3083f2,null))[_0x935a('0x49')](handleError(_0x3083f2,null));};exports[_0x935a('0x2a')]=function(_0x16d39a,_0x2f1e76){return db['SugarcrmField'][_0x935a('0x4e')]({'where':{'id':_0x16d39a['params']['id']}})[_0x935a('0x29')](handleEntityNotFound(_0x2f1e76,null))[_0x935a('0x29')](removeEntity(_0x2f1e76,null))['catch'](handleError(_0x2f1e76,null));};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js
index 32c0c06..298bb15 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.model.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x22b1=['path','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','../../config/logger','moment','bluebird'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0x22b1,0x170));var _0x122b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x22b1[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x122b('0x0'));var util=require('util');var logger=require(_0x122b('0x1'))('api');var moment=require(_0x122b('0x2'));var BPromise=require(_0x122b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x122b('0x4'));var rimraf=require('rimraf');var config=require(_0x122b('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0x122b('0x6')]=function(_0x50153c,_0x5d0295){return _0x50153c[_0x122b('0x7')](_0x122b('0x8'),attributes,{'tableName':_0x122b('0x9'),'paranoid':![],'indexes':[{'name':_0x122b('0xa'),'fields':[_0x122b('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc638=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xc638,0x147));var _0x8c63=function(_0x6ea8a2,_0x561d6c){_0x6ea8a2=_0x6ea8a2-0x0;var _0x4fe938=_0xc638[_0x6ea8a2];return _0x4fe938;};'use strict';var _=require(_0x8c63('0x0'));var util=require(_0x8c63('0x1'));var logger=require(_0x8c63('0x2'))('api');var moment=require(_0x8c63('0x3'));var BPromise=require(_0x8c63('0x4'));var rp=require(_0x8c63('0x5'));var fs=require('fs');var path=require(_0x8c63('0x6'));var rimraf=require(_0x8c63('0x7'));var config=require(_0x8c63('0x8'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x3cfadc,_0x34475e){return _0x3cfadc[_0x8c63('0x9')](_0x8c63('0xa'),attributes,{'tableName':_0x8c63('0xb'),'paranoid':![],'indexes':[{'name':_0x8c63('0xc'),'fields':[_0x8c63('0xd'),_0x8c63('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js
index 0e3e892..cd2e11a 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb89=['ioredis','rpc','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring'];(function(_0x4d7dc1,_0x5c630f){var _0x9ea7f0=function(_0x2d1c1){while(--_0x2d1c1){_0x4d7dc1['push'](_0x4d7dc1['shift']());}};_0x9ea7f0(++_0x5c630f);}(_0xfb89,0x1f3));var _0x9fb8=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0xfb89[_0x252328];return _0xaa85b7;};'use strict';var _=require(_0x9fb8('0x0'));var util=require(_0x9fb8('0x1'));var moment=require(_0x9fb8('0x2'));var BPromise=require(_0x9fb8('0x3'));var rs=require(_0x9fb8('0x4'));var fs=require('fs');var Redis=require(_0x9fb8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9fb8('0x6'));var config=require('../../config/environment');var jayson=require(_0x9fb8('0x7'));var client=jayson[_0x9fb8('0x8')][_0x9fb8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3287aa,_0x5e078a,_0x54b4b1){return new BPromise(function(_0x132a40,_0x5a1067){return client[_0x9fb8('0xa')](_0x3287aa,_0x54b4b1)[_0x9fb8('0xb')](function(_0x485e3b){logger[_0x9fb8('0xc')](_0x9fb8('0xd'),_0x5e078a,_0x9fb8('0xe'));logger[_0x9fb8('0xf')](_0x9fb8('0x10'),_0x5e078a,_0x9fb8('0xe'),JSON[_0x9fb8('0x11')](_0x485e3b));if(_0x485e3b[_0x9fb8('0x12')]){if(_0x485e3b[_0x9fb8('0x12')][_0x9fb8('0x13')]===0x1f4){logger[_0x9fb8('0x12')](_0x9fb8('0xd'),_0x5e078a,_0x485e3b['error'][_0x9fb8('0x14')]);return _0x5a1067(_0x485e3b[_0x9fb8('0x12')][_0x9fb8('0x14')]);}logger[_0x9fb8('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x5e078a,_0x485e3b['error'][_0x9fb8('0x14')]);return _0x132a40(_0x485e3b[_0x9fb8('0x12')][_0x9fb8('0x14')]);}else{logger[_0x9fb8('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x5e078a,'request\x20sent');_0x132a40(_0x485e3b['result'][_0x9fb8('0x14')]);}})['catch'](function(_0x58e349){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x5e078a,_0x58e349);_0x5a1067(_0x58e349);});});}
\ No newline at end of file
+var _0xb2b8=['then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x2e8291,_0x5f3f60){var _0x4eea3d=function(_0x49e413){while(--_0x49e413){_0x2e8291['push'](_0x2e8291['shift']());}};_0x4eea3d(++_0x5f3f60);}(_0xb2b8,0x14c));var _0x8b2b=function(_0x3bbb0f,_0x57fdd3){_0x3bbb0f=_0x3bbb0f-0x0;var _0x1cc1e8=_0xb2b8[_0x3bbb0f];return _0x1cc1e8;};'use strict';var _=require('lodash');var util=require(_0x8b2b('0x0'));var moment=require(_0x8b2b('0x1'));var BPromise=require(_0x8b2b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8b2b('0x3'));var logger=require(_0x8b2b('0x4'))(_0x8b2b('0x5'));var config=require('../../config/environment');var jayson=require(_0x8b2b('0x6'));var client=jayson[_0x8b2b('0x7')][_0x8b2b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307631,_0x11ca19,_0x5e9a61){return new BPromise(function(_0x39df70,_0x57ddbe){return client[_0x8b2b('0x9')](_0x307631,_0x5e9a61)[_0x8b2b('0xa')](function(_0x360c92){logger['info'](_0x8b2b('0xb'),_0x11ca19,_0x8b2b('0xc'));logger[_0x8b2b('0xd')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x11ca19,_0x8b2b('0xc'),JSON['stringify'](_0x360c92));if(_0x360c92[_0x8b2b('0xe')]){if(_0x360c92[_0x8b2b('0xe')]['code']===0x1f4){logger[_0x8b2b('0xe')](_0x8b2b('0xb'),_0x11ca19,_0x360c92[_0x8b2b('0xe')]['message']);return _0x57ddbe(_0x360c92[_0x8b2b('0xe')][_0x8b2b('0xf')]);}logger['error'](_0x8b2b('0xb'),_0x11ca19,_0x360c92[_0x8b2b('0xe')][_0x8b2b('0xf')]);return _0x39df70(_0x360c92[_0x8b2b('0xe')][_0x8b2b('0xf')]);}else{logger[_0x8b2b('0x10')](_0x8b2b('0xb'),_0x11ca19,_0x8b2b('0xc'));_0x39df70(_0x360c92['result'][_0x8b2b('0xf')]);}})[_0x8b2b('0x11')](function(_0x4a97c1){logger[_0x8b2b('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x11ca19,_0x4a97c1);_0x57ddbe(_0x4a97c1);});});}
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js
index 7158aac..e21e939 100644
--- a/server/api/intVtigerAccount/index.js
+++ b/server/api/intVtigerAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x44f4=['delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','get','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration','put','update'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0x44f4,0x178));var _0x444f=function(_0x1de14f,_0x55464a){_0x1de14f=_0x1de14f-0x0;var _0x283d61=_0x44f4[_0x1de14f];return _0x283d61;};'use strict';var multer=require(_0x444f('0x0'));var util=require(_0x444f('0x1'));var path=require('path');var timeout=require(_0x444f('0x2'));var express=require(_0x444f('0x3'));var router=express[_0x444f('0x4')]();var auth=require(_0x444f('0x5'));var interaction=require(_0x444f('0x6'));var config=require(_0x444f('0x7'));var controller=require(_0x444f('0x8'));router['get']('/',auth[_0x444f('0x9')](),controller['index']);router[_0x444f('0xa')](_0x444f('0xb'),auth[_0x444f('0x9')](),controller[_0x444f('0xc')]);router[_0x444f('0xa')]('/:id/configurations',auth[_0x444f('0x9')](),controller[_0x444f('0xd')]);router[_0x444f('0xa')](_0x444f('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x444f('0xf')]('/',auth['isAuthenticated'](),controller[_0x444f('0x10')]);router[_0x444f('0xf')]('/:id/configurations',auth[_0x444f('0x9')](),controller[_0x444f('0x11')]);router[_0x444f('0x12')](_0x444f('0xb'),auth['isAuthenticated'](),controller[_0x444f('0x13')]);router[_0x444f('0x14')](_0x444f('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x444f('0x15')]=router;
\ No newline at end of file
+var _0xa179=['getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa179,0x1c1));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9a17('0x0'));var util=require(_0x9a17('0x1'));var path=require('path');var timeout=require(_0x9a17('0x2'));var express=require(_0x9a17('0x3'));var router=express['Router']();var auth=require(_0x9a17('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9a17('0x5'));var controller=require(_0x9a17('0x6'));router[_0x9a17('0x7')]('/',auth[_0x9a17('0x8')](),controller[_0x9a17('0x9')]);router['get'](_0x9a17('0xa'),auth[_0x9a17('0x8')](),controller[_0x9a17('0xb')]);router[_0x9a17('0x7')](_0x9a17('0xc'),auth[_0x9a17('0x8')](),controller[_0x9a17('0xd')]);router[_0x9a17('0x7')](_0x9a17('0xe'),auth[_0x9a17('0x8')](),controller['getFields']);router[_0x9a17('0xf')]('/',auth[_0x9a17('0x8')](),controller['create']);router[_0x9a17('0xf')](_0x9a17('0xc'),auth[_0x9a17('0x8')](),controller[_0x9a17('0x10')]);router[_0x9a17('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9a17('0x12')]);router[_0x9a17('0x13')]('/:id',auth[_0x9a17('0x8')](),controller[_0x9a17('0x14')]);module[_0x9a17('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js
index 8572ddf..e5118cc 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.attributes.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e15=['exports','STRING','sequelize'];(function(_0x4f0fc1,_0x521e45){var _0x182520=function(_0x2a0a3a){while(--_0x2a0a3a){_0x4f0fc1['push'](_0x4f0fc1['shift']());}};_0x182520(++_0x521e45);}(_0x3e15,0x137));var _0x53e1=function(_0x594aad,_0x3e9fa2){_0x594aad=_0x594aad-0x0;var _0x4eff94=_0x3e15[_0x594aad];return _0x4eff94;};'use strict';var Sequelize=require(_0x53e1('0x0'));module[_0x53e1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x53e1('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x53e1('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x53e1('0x2')]},'accessKey':{'type':Sequelize[_0x53e1('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x7850=['exports','STRING','HelpDesk','sequelize'];(function(_0x241503,_0x367f77){var _0x90f2ca=function(_0x197b3a){while(--_0x197b3a){_0x241503['push'](_0x241503['shift']());}};_0x90f2ca(++_0x367f77);}(_0x7850,0x1bf));var _0x0785=function(_0x24d1b5,_0x4997e0){_0x24d1b5=_0x24d1b5-0x0;var _0x5f2cbe=_0x7850[_0x24d1b5];return _0x5f2cbe;};'use strict';var Sequelize=require(_0x0785('0x0'));module[_0x0785('0x1')]={'name':{'type':Sequelize[_0x0785('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0785('0x2')]},'username':{'type':Sequelize[_0x0785('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0785('0x2')],'allowNull':![],'defaultValue':_0x0785('0x3')},'remoteUri':{'type':Sequelize[_0x0785('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0785('0x2')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js
index bfac2dc..dd7f203 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.controller.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x80ae=['includeAll','include','rows','show','params','find','create','body','getConfigurations','VtigerConfiguration','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','findOne','description','remoteUri','serverUrl','accessKey','username','moduleName','lastIndexOf','format','GET','getchallenge','success','POST','login','describe','sessionName','reference','owner','remove','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','stringify','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','sendStatus','name','send','index','VtigerAccount','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','map','type','key','field','merge','options'];(function(_0x3878b3,_0x3d44ec){var _0x2eed44=function(_0x333d20){while(--_0x333d20){_0x3878b3['push'](_0x3878b3['shift']());}};_0x2eed44(++_0x3d44ec);}(_0x80ae,0x1b6));var _0xe80a=function(_0x3a04ab,_0x31b9fd){_0x3a04ab=_0x3a04ab-0x0;var _0x4bff6d=_0x80ae[_0x3a04ab];return _0x4bff6d;};'use strict';var pdf=require(_0xe80a('0x0'));var emlformat=require(_0xe80a('0x1'));var rimraf=require(_0xe80a('0x2'));var zipdir=require(_0xe80a('0x3'));var jsonpatch=require(_0xe80a('0x4'));var rp=require(_0xe80a('0x5'));var moment=require(_0xe80a('0x6'));var BPromise=require(_0xe80a('0x7'));var Mustache=require('mustache');var util=require(_0xe80a('0x8'));var path=require(_0xe80a('0x9'));var sox=require(_0xe80a('0xa'));var csv=require(_0xe80a('0xb'));var ejs=require(_0xe80a('0xc'));var fs=require('fs');var _=require(_0xe80a('0xd'));var squel=require(_0xe80a('0xe'));var crypto=require('crypto');var jsforce=require(_0xe80a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe80a('0xb'));var querystring=require(_0xe80a('0x10'));var Papa=require(_0xe80a('0x11'));var Redis=require(_0xe80a('0x12'));var authService=require(_0xe80a('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe80a('0x14'));var logger=require(_0xe80a('0x15'))(_0xe80a('0x16'));var utils=require(_0xe80a('0x17'));var config=require(_0xe80a('0x18'));var db=require(_0xe80a('0x19'))['db'];var integrations=require(_0xe80a('0x1a'));var jayson=require(_0xe80a('0x1b'));var client=jayson[_0xe80a('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x157d67,_0x14e5cb,_0x516a21){if(_0x516a21){var _0x280773=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x280773[_0xe80a('0x1d')](_0x14e5cb)){return _0x157d67;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x157d67;}}function respondWithRpcPromise(_0x5418ef,_0x35c106,_0x4d5f02,_0x2fee9a){return new BPromise(function(_0x474767,_0x219fd0){var _0x1777e6=_0x2fee9a||client;return _0x1777e6['request'](_0x5418ef,_0x4d5f02)['then'](function(_0x1d8232){logger[_0xe80a('0x1e')](_0xe80a('0x1f'),_0x35c106,_0xe80a('0x20'));logger[_0xe80a('0x21')](_0xe80a('0x22'),_0x35c106,_0xe80a('0x20'),JSON['stringify'](_0x1d8232));if(_0x1d8232[_0xe80a('0x23')]){if(_0x1d8232['error'][_0xe80a('0x24')]===0x1f4){logger[_0xe80a('0x23')](_0xe80a('0x1f'),_0x35c106,_0x1d8232[_0xe80a('0x23')][_0xe80a('0x25')]);return _0x219fd0(_0x1d8232['error']['message']);}logger[_0xe80a('0x23')]('VtigerAccount,\x20%s,\x20%s',_0x35c106,_0x1d8232[_0xe80a('0x23')][_0xe80a('0x25')]);return _0x474767(_0x1d8232[_0xe80a('0x23')]['message']);}else{logger[_0xe80a('0x1e')]('VtigerAccount,\x20%s,\x20%s',_0x35c106,_0xe80a('0x20'));_0x474767(_0x1d8232[_0xe80a('0x26')]['message']);}})[_0xe80a('0x27')](function(_0x4d5622){logger[_0xe80a('0x23')](_0xe80a('0x1f'),_0x35c106,_0x4d5622);_0x219fd0(_0x4d5622);});});}function respondWithStatusCode(_0x1ed446,_0x30f878){_0x30f878=_0x30f878||0xcc;return function(_0x2a7af4){if(_0x2a7af4){return _0x1ed446['sendStatus'](_0x30f878);}return _0x1ed446[_0xe80a('0x28')](_0x30f878)['end']();};}function respondWithResult(_0x4a534d,_0xbbdfaa){_0xbbdfaa=_0xbbdfaa||0xc8;return function(_0x16fe24){if(_0x16fe24){return _0x4a534d[_0xe80a('0x28')](_0xbbdfaa)[_0xe80a('0x29')](_0x16fe24);}};}function respondWithFilteredResult(_0x365922,_0x235f7c){return function(_0x2c1aec){if(_0x2c1aec){var _0xb68eb0=_0x2c1aec[_0xe80a('0x2a')],_0x381c25=_0x235f7c[_0xe80a('0x2b')],_0x6e6b91=_0x235f7c[_0xe80a('0x2b')]+_0x235f7c[_0xe80a('0x2c')],_0x10dcc5;if(_0x6e6b91>=_0xb68eb0){_0x6e6b91=_0xb68eb0;_0x10dcc5=0xc8;}else{_0x10dcc5=0xce;}_0x365922['status'](_0x10dcc5);return _0x365922[_0xe80a('0x2d')]('Content-Range',_0x381c25+'-'+_0x6e6b91+'/'+_0xb68eb0)[_0xe80a('0x29')](_0x2c1aec);}return null;};}function patchUpdates(_0x3a99c5){return function(_0x398eca){try{jsonpatch[_0xe80a('0x2e')](_0x398eca,_0x3a99c5,!![]);}catch(_0x542d72){return BPromise[_0xe80a('0x2f')](_0x542d72);}return _0x398eca[_0xe80a('0x30')]();};}function saveUpdates(_0x16207c,_0x152a01){return function(_0x2710f4){if(_0x2710f4){return _0x2710f4[_0xe80a('0x31')](_0x16207c)[_0xe80a('0x32')](function(_0xf4c766){return _0xf4c766;});}return null;};}function removeEntity(_0x336f38,_0x5b80c3){return function(_0x2e5931){if(_0x2e5931){return _0x2e5931[_0xe80a('0x33')]()['then'](function(){_0x336f38[_0xe80a('0x28')](0xcc)[_0xe80a('0x34')]();});}};}function handleEntityNotFound(_0x37dd30,_0x2a7c97){return function(_0x2afd3a){if(!_0x2afd3a){_0x37dd30[_0xe80a('0x35')](0x194);}return _0x2afd3a;};}function handleError(_0x5be04e,_0x3975d2){_0x3975d2=_0x3975d2||0x1f4;return function(_0x4eb5b1){logger[_0xe80a('0x23')](_0x4eb5b1['stack']);if(_0x4eb5b1[_0xe80a('0x36')]){delete _0x4eb5b1[_0xe80a('0x36')];}_0x5be04e[_0xe80a('0x28')](_0x3975d2)[_0xe80a('0x37')](_0x4eb5b1);};}exports[_0xe80a('0x38')]=function(_0xdc51bc,_0x58f94a){var _0x15d559={},_0x3a4559={},_0x3087b9={'count':0x0,'rows':[]};var _0x2fe4ae=db[_0xe80a('0x39')][_0xe80a('0x3a')];_0x3a4559['model']=_[_0xe80a('0x3b')](_0x2fe4ae);_0x3a4559[_0xe80a('0x3c')]=_[_0xe80a('0x3b')](_0xdc51bc['query']);_0x3a4559[_0xe80a('0x3d')]=_['intersection'](_0x3a4559[_0xe80a('0x3e')],_0x3a4559[_0xe80a('0x3c')]);_0x15d559[_0xe80a('0x3f')]=_[_0xe80a('0x40')](_0x3a4559[_0xe80a('0x3e')],qs[_0xe80a('0x41')](_0xdc51bc[_0xe80a('0x3c')][_0xe80a('0x41')]));_0x15d559['attributes']=_0x15d559['attributes'][_0xe80a('0x42')]?_0x15d559[_0xe80a('0x3f')]:_0x3a4559['model'];if(!_0xdc51bc[_0xe80a('0x3c')]['hasOwnProperty'](_0xe80a('0x43'))){_0x15d559['limit']=qs[_0xe80a('0x2c')](_0xdc51bc['query'][_0xe80a('0x2c')]);_0x15d559[_0xe80a('0x2b')]=qs[_0xe80a('0x2b')](_0xdc51bc[_0xe80a('0x3c')]['offset']);}_0x15d559[_0xe80a('0x44')]=qs[_0xe80a('0x45')](_0xdc51bc[_0xe80a('0x3c')][_0xe80a('0x45')]);_0x15d559[_0xe80a('0x46')]=qs[_0xe80a('0x3d')](_['pick'](_0xdc51bc[_0xe80a('0x3c')],_0x3a4559[_0xe80a('0x3d')]));if(_0xdc51bc[_0xe80a('0x3c')][_0xe80a('0x47')]){_0x15d559[_0xe80a('0x46')]=_['merge'](_0x15d559[_0xe80a('0x46')],{'$or':_[_0xe80a('0x48')](_0x2fe4ae,function(_0x342bb2){if(_0x342bb2[_0xe80a('0x49')][_0xe80a('0x4a')]!=='VIRTUAL'){var _0x5c09c4={};_0x5c09c4[_0x342bb2[_0xe80a('0x4b')]]={'$like':'%'+_0xdc51bc[_0xe80a('0x3c')][_0xe80a('0x47')]+'%'};return _0x5c09c4;}})});}_0x15d559=_[_0xe80a('0x4c')]({},_0x15d559,_0xdc51bc[_0xe80a('0x4d')]);var _0x582bbd={'where':_0x15d559['where']};return db['VtigerAccount'][_0xe80a('0x2a')](_0x582bbd)['then'](function(_0x5f289e){_0x3087b9['count']=_0x5f289e;if(_0xdc51bc[_0xe80a('0x3c')][_0xe80a('0x4e')]){_0x15d559[_0xe80a('0x4f')]=[{'all':!![]}];}return db[_0xe80a('0x39')]['findAll'](_0x15d559);})[_0xe80a('0x32')](function(_0x3a747d){_0x3087b9[_0xe80a('0x50')]=_0x3a747d;return _0x3087b9;})[_0xe80a('0x32')](respondWithFilteredResult(_0x58f94a,_0x15d559))['catch'](handleError(_0x58f94a,null));};exports[_0xe80a('0x51')]=function(_0x530ed3,_0x23f771){var _0x57275c={'raw':![],'where':{'id':_0x530ed3[_0xe80a('0x52')]['id']}},_0x4abfe0={};_0x4abfe0['model']=_[_0xe80a('0x3b')](db[_0xe80a('0x39')][_0xe80a('0x3a')]);_0x4abfe0[_0xe80a('0x3c')]=_[_0xe80a('0x3b')](_0x530ed3['query']);_0x4abfe0['filters']=_[_0xe80a('0x40')](_0x4abfe0[_0xe80a('0x3e')],_0x4abfe0['query']);_0x57275c['attributes']=_[_0xe80a('0x40')](_0x4abfe0['model'],qs[_0xe80a('0x41')](_0x530ed3['query'][_0xe80a('0x41')]));_0x57275c[_0xe80a('0x3f')]=_0x57275c[_0xe80a('0x3f')][_0xe80a('0x42')]?_0x57275c[_0xe80a('0x3f')]:_0x4abfe0['model'];if(_0x530ed3[_0xe80a('0x3c')][_0xe80a('0x4e')]){_0x57275c[_0xe80a('0x4f')]=[{'all':!![]}];}_0x57275c=_[_0xe80a('0x4c')]({},_0x57275c,_0x530ed3[_0xe80a('0x4d')]);return db['VtigerAccount'][_0xe80a('0x53')](_0x57275c)[_0xe80a('0x32')](handleEntityNotFound(_0x23f771,null))[_0xe80a('0x32')](respondWithResult(_0x23f771,null))[_0xe80a('0x27')](handleError(_0x23f771,null));};exports['create']=function(_0x1671df,_0x383163){return db[_0xe80a('0x39')][_0xe80a('0x54')](_0x1671df[_0xe80a('0x55')],{})['then'](respondWithResult(_0x383163,0xc9))[_0xe80a('0x27')](handleError(_0x383163,null));};exports[_0xe80a('0x31')]=function(_0x1cc2d9,_0x31c71f){if(_0x1cc2d9[_0xe80a('0x55')]['id']){delete _0x1cc2d9[_0xe80a('0x55')]['id'];}return db[_0xe80a('0x39')]['find']({'where':{'id':_0x1cc2d9['params']['id']}})[_0xe80a('0x32')](handleEntityNotFound(_0x31c71f,null))['then'](saveUpdates(_0x1cc2d9['body'],null))['then'](respondWithResult(_0x31c71f,null))[_0xe80a('0x27')](handleError(_0x31c71f,null));};exports[_0xe80a('0x33')]=function(_0x19c18b,_0x462bf3){return db['VtigerAccount'][_0xe80a('0x53')]({'where':{'id':_0x19c18b[_0xe80a('0x52')]['id']}})['then'](handleEntityNotFound(_0x462bf3,null))['then'](removeEntity(_0x462bf3,null))['catch'](handleError(_0x462bf3,null));};exports[_0xe80a('0x56')]=function(_0x3306ef,_0xd90601,_0x5ba939){var _0x385e0a={};var _0x49f712={};var _0x4458fd;var _0x5162a0;return db[_0xe80a('0x39')]['findOne']({'where':{'id':_0x3306ef['params']['id']}})[_0xe80a('0x32')](handleEntityNotFound(_0xd90601,null))[_0xe80a('0x32')](function(_0x2b1f02){if(_0x2b1f02){_0x4458fd=_0x2b1f02;_0x49f712[_0xe80a('0x3e')]=_[_0xe80a('0x3b')](db[_0xe80a('0x57')][_0xe80a('0x3a')]);_0x49f712[_0xe80a('0x3c')]=_['keys'](_0x3306ef[_0xe80a('0x3c')]);_0x49f712[_0xe80a('0x3d')]=_[_0xe80a('0x40')](_0x49f712['model'],_0x49f712[_0xe80a('0x3c')]);_0x385e0a[_0xe80a('0x3f')]=_['intersection'](_0x49f712[_0xe80a('0x3e')],qs[_0xe80a('0x41')](_0x3306ef[_0xe80a('0x3c')]['fields']));_0x385e0a[_0xe80a('0x3f')]=_0x385e0a['attributes'][_0xe80a('0x42')]?_0x385e0a[_0xe80a('0x3f')]:_0x49f712[_0xe80a('0x3e')];_0x385e0a['order']=qs[_0xe80a('0x45')](_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x45')]);_0x385e0a[_0xe80a('0x46')]=qs[_0xe80a('0x3d')](_[_0xe80a('0x58')](_0x3306ef[_0xe80a('0x3c')],_0x49f712[_0xe80a('0x3d')]));if(_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x47')]){_0x385e0a[_0xe80a('0x46')]=_['merge'](_0x385e0a['where'],{'$or':_[_0xe80a('0x48')](_0x385e0a[_0xe80a('0x3f')],function(_0x55fcd7){var _0x23f835={};_0x23f835[_0x55fcd7]={'$like':'%'+_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x47')]+'%'};return _0x23f835;})});}_0x385e0a=_['merge']({},_0x385e0a,_0x3306ef[_0xe80a('0x4d')]);return _0x4458fd[_0xe80a('0x56')](_0x385e0a);}})[_0xe80a('0x32')](function(_0x424929){if(_0x424929){_0x5162a0=_0x424929[_0xe80a('0x42')];if(!_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x59')](_0xe80a('0x43'))){_0x385e0a[_0xe80a('0x2c')]=qs[_0xe80a('0x2c')](_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x2c')]);_0x385e0a[_0xe80a('0x2b')]=qs[_0xe80a('0x2b')](_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x2b')]);}return _0x4458fd['getConfigurations'](_0x385e0a);}})[_0xe80a('0x32')](function(_0x340f52){if(_0x340f52){return _0x340f52?{'count':_0x5162a0,'rows':_0x340f52}:null;}})[_0xe80a('0x32')](respondWithResult(_0xd90601,null))[_0xe80a('0x27')](handleError(_0xd90601,null));};exports[_0xe80a('0x5a')]=function(_0x37278e,_0x49f459,_0x154837){if(_0x37278e['body']['id']){delete _0x37278e[_0xe80a('0x55')]['id'];}return db[_0xe80a('0x39')]['findOne']({'where':{'id':_0x37278e[_0xe80a('0x52')]['id']}})['then'](handleEntityNotFound(_0x49f459,null))[_0xe80a('0x32')](function(_0x175b91){if(_0x175b91){_0x37278e['body']['AccountId']=_0x175b91['id'];_0x37278e[_0xe80a('0x55')][_0xe80a('0x5b')]=integrations[_0xe80a('0x5c')](_0x37278e[_0xe80a('0x55')][_0xe80a('0x5d')],_0x37278e[_0xe80a('0x55')][_0xe80a('0x49')]);_0x37278e[_0xe80a('0x55')][_0xe80a('0x5e')]=integrations[_0xe80a('0x5f')](_0x37278e[_0xe80a('0x55')][_0xe80a('0x5d')],_0x37278e[_0xe80a('0x55')][_0xe80a('0x49')]);return db[_0xe80a('0x57')]['create'](_0x37278e[_0xe80a('0x55')],{'include':[{'model':db[_0xe80a('0x60')],'as':'Subjects'},{'model':db[_0xe80a('0x60')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x49f459,null))[_0xe80a('0x27')](handleError(_0x49f459,null));};var md5=require(_0xe80a('0x61'));exports[_0xe80a('0x62')]=function(_0x23b9c7,_0x45817f,_0x1bd769){var _0x3d4a81=null;var _0x15c6e7=null;var _0x604214=null;var _0x321c3d=null;var _0x10101b='';return db['VtigerAccount'][_0xe80a('0x63')]({'where':{'id':_0x23b9c7['params']['id']},'attributes':['id',_0xe80a('0x36'),'username',_0xe80a('0x64'),'moduleName',_0xe80a('0x65'),_0xe80a('0x66'),_0xe80a('0x67')]})['then'](handleEntityNotFound(_0x45817f,null))['then'](function(_0x12948e){if(_0x12948e){_0x3d4a81=_0x12948e[_0xe80a('0x68')];_0x15c6e7=_0x12948e[_0xe80a('0x67')];_0x604214=_0x12948e[_0xe80a('0x69')];_0x10101b=_0x12948e['remoteUri'];var _0x3a9915=_0x10101b['slice'](-0x1);if(_0x3a9915==='/'){_0x10101b=_0x10101b['substring'](0x0,_0x10101b[_0xe80a('0x6a')](_0x3a9915));}_0x321c3d=util[_0xe80a('0x6b')]('%s/webservice.php',_0x10101b);var _0x573164={'method':_0xe80a('0x6c'),'uri':_0x321c3d,'qs':{'operation':_0xe80a('0x6d'),'username':_0x12948e[_0xe80a('0x68')]},'json':!![]};return rp(_0x573164);}})[_0xe80a('0x32')](function(_0x24acfb){if(_0x24acfb[_0xe80a('0x6e')]){var _0xe1f48f={'method':_0xe80a('0x6f'),'uri':_0x321c3d,'form':{'operation':_0xe80a('0x70'),'username':_0x3d4a81,'accessKey':md5(_0x24acfb[_0xe80a('0x26')]['token']+_0x15c6e7)},'json':!![]};return rp(_0xe1f48f);}})[_0xe80a('0x32')](function(_0x2c0eb8){if(_0x2c0eb8['success']){var _0x2770da={'method':'GET','uri':_0x321c3d,'qs':{'operation':_0xe80a('0x71'),'username':_0x3d4a81,'sessionName':_0x2c0eb8[_0xe80a('0x26')][_0xe80a('0x72')],'elementType':_0x604214},'json':!![]};return rp(_0x2770da);}})[_0xe80a('0x32')](function(_0x58ef32){if(_0x58ef32['success']){var _0x592898=['autogenerated',_0xe80a('0x73'),_0xe80a('0x74')];_[_0xe80a('0x75')](_0x58ef32[_0xe80a('0x26')][_0xe80a('0x41')],function(_0x254366){return _0x592898['includes'](_0x254366['type'][_0xe80a('0x36')]);});_['remove'](_0x58ef32[_0xe80a('0x26')][_0xe80a('0x41')],function(_0x8354d5){return _0x8354d5['editable']==='false';});return{'count':_0x58ef32[_0xe80a('0x26')][_0xe80a('0x41')]['length'],'rows':_[_0xe80a('0x48')](_0x58ef32[_0xe80a('0x26')][_0xe80a('0x41')],function(_0xdbc823){return{'id':_0xdbc823['name'],'name':_0xdbc823[_0xe80a('0x76')],'custom':_[_0xe80a('0x77')](_0xdbc823[_0xe80a('0x36')],_0xe80a('0x78'))?!![]:![],'options':_0xdbc823[_0xe80a('0x49')][_0xe80a('0x36')]===_0xe80a('0x79')&&_0xdbc823[_0xe80a('0x49')][_0xe80a('0x7a')][_0xe80a('0x42')]>0x0?_[_0xe80a('0x48')](_0xdbc823[_0xe80a('0x49')]['picklistValues'],function(_0x50da52){return{'name':_0x50da52[_0xe80a('0x76')],'value':_0x50da52[_0xe80a('0x7b')]};}):[]};})};}})['then'](respondWithResult(_0x45817f,null))[_0xe80a('0x27')](function(_0x3e91d4){console[_0xe80a('0x7c')](_0xe80a('0x7d')+_0x3e91d4);var _0x5d5843=_0x23b9c7[_0xe80a('0x3c')]['test']?0x1f4:_0x3e91d4['statusCode']||0x1f4;logger[_0xe80a('0x23')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5d5843,JSON[_0xe80a('0x7e')](_0x3e91d4));delete _0x3e91d4[_0xe80a('0x36')];if(_0x5d5843===0x191){_0x5d5843=0x190;}_0x45817f[_0xe80a('0x28')](_0x5d5843)[_0xe80a('0x37')](_0x23b9c7[_0xe80a('0x3c')]['test']?{'message':_0xe80a('0x7f'),'statusCode':_0x3e91d4[_0xe80a('0x80')]}:_0x3e91d4);});};
\ No newline at end of file
+var _0xf2a0=['picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','../../components/integrations/configuration','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','stack','name','VtigerAccount','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','key','field','options','include','findAll','rows','show','params','intersection','includeAll','body','find','findOne','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','create','Subjects','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','POST','token','describe','autogenerated','reference','owner','includes','editable','false','label','startsWith','cf_'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf2a0,0x88));var _0x0f2a=function(_0x37cc4c,_0x288c26){_0x37cc4c=_0x37cc4c-0x0;var _0x425695=_0xf2a0[_0x37cc4c];return _0x425695;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0f2a('0x0'));var rimraf=require(_0x0f2a('0x1'));var zipdir=require(_0x0f2a('0x2'));var jsonpatch=require(_0x0f2a('0x3'));var rp=require(_0x0f2a('0x4'));var moment=require(_0x0f2a('0x5'));var BPromise=require(_0x0f2a('0x6'));var Mustache=require(_0x0f2a('0x7'));var util=require(_0x0f2a('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x0f2a('0x9'));var ejs=require(_0x0f2a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0f2a('0xb'));var crypto=require(_0x0f2a('0xc'));var jsforce=require(_0x0f2a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0f2a('0xe'));var Papa=require(_0x0f2a('0xf'));var Redis=require(_0x0f2a('0x10'));var authService=require(_0x0f2a('0x11'));var qs=require(_0x0f2a('0x12'));var hardwareService=require(_0x0f2a('0x13'));var logger=require(_0x0f2a('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0f2a('0x15'))['db'];var integrations=require(_0x0f2a('0x16'));var jayson=require('jayson/promise');var client=jayson[_0x0f2a('0x17')][_0x0f2a('0x18')]({'port':0x232a});function checkPasswordPattern(_0x377f9e,_0x35d834,_0x4c2175){if(_0x4c2175){var _0x2c0093=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c0093[_0x0f2a('0x19')](_0x35d834)){return _0x377f9e;}else{throw new Error(_0x0f2a('0x1a'));}}else{return _0x377f9e;}}function respondWithRpcPromise(_0x5c7ae1,_0x427570,_0x1c4800,_0xe6870d){return new BPromise(function(_0x28114c,_0x2a3fc5){var _0x4ba06f=_0xe6870d||client;return _0x4ba06f[_0x0f2a('0x1b')](_0x5c7ae1,_0x1c4800)[_0x0f2a('0x1c')](function(_0x3bc902){logger[_0x0f2a('0x1d')](_0x0f2a('0x1e'),_0x427570,_0x0f2a('0x1f'));logger[_0x0f2a('0x20')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x427570,_0x0f2a('0x1f'),JSON[_0x0f2a('0x21')](_0x3bc902));if(_0x3bc902[_0x0f2a('0x22')]){if(_0x3bc902[_0x0f2a('0x22')][_0x0f2a('0x23')]===0x1f4){logger[_0x0f2a('0x22')](_0x0f2a('0x1e'),_0x427570,_0x3bc902['error']['message']);return _0x2a3fc5(_0x3bc902[_0x0f2a('0x22')][_0x0f2a('0x24')]);}logger['error'](_0x0f2a('0x1e'),_0x427570,_0x3bc902[_0x0f2a('0x22')][_0x0f2a('0x24')]);return _0x28114c(_0x3bc902[_0x0f2a('0x22')]['message']);}else{logger[_0x0f2a('0x1d')](_0x0f2a('0x1e'),_0x427570,_0x0f2a('0x1f'));_0x28114c(_0x3bc902[_0x0f2a('0x25')][_0x0f2a('0x24')]);}})[_0x0f2a('0x26')](function(_0x2f8308){logger[_0x0f2a('0x22')]('VtigerAccount,\x20%s,\x20%s',_0x427570,_0x2f8308);_0x2a3fc5(_0x2f8308);});});}function respondWithStatusCode(_0x2e32dc,_0x5470b3){_0x5470b3=_0x5470b3||0xcc;return function(_0x392c4b){if(_0x392c4b){return _0x2e32dc[_0x0f2a('0x27')](_0x5470b3);}return _0x2e32dc[_0x0f2a('0x28')](_0x5470b3)[_0x0f2a('0x29')]();};}function respondWithResult(_0x532865,_0x390af6){_0x390af6=_0x390af6||0xc8;return function(_0x417874){if(_0x417874){return _0x532865[_0x0f2a('0x28')](_0x390af6)[_0x0f2a('0x2a')](_0x417874);}};}function respondWithFilteredResult(_0x3fd725,_0x28cb95){return function(_0x2bf394){if(_0x2bf394){var _0x58a692=_0x2bf394[_0x0f2a('0x2b')],_0x56ecb3=_0x28cb95[_0x0f2a('0x2c')],_0x367bca=_0x28cb95['offset']+_0x28cb95[_0x0f2a('0x2d')],_0x25a915;if(_0x367bca>=_0x58a692){_0x367bca=_0x58a692;_0x25a915=0xc8;}else{_0x25a915=0xce;}_0x3fd725[_0x0f2a('0x28')](_0x25a915);return _0x3fd725[_0x0f2a('0x2e')](_0x0f2a('0x2f'),_0x56ecb3+'-'+_0x367bca+'/'+_0x58a692)[_0x0f2a('0x2a')](_0x2bf394);}return null;};}function patchUpdates(_0x3edc44){return function(_0x59a5d9){try{jsonpatch[_0x0f2a('0x30')](_0x59a5d9,_0x3edc44,!![]);}catch(_0x112e66){return BPromise['reject'](_0x112e66);}return _0x59a5d9['save']();};}function saveUpdates(_0x5902b0,_0x2a5c68){return function(_0x2edec4){if(_0x2edec4){return _0x2edec4[_0x0f2a('0x31')](_0x5902b0)[_0x0f2a('0x1c')](function(_0x10cfa5){return _0x10cfa5;});}return null;};}function removeEntity(_0x3fde33,_0x34ee71){return function(_0x640383){if(_0x640383){return _0x640383[_0x0f2a('0x32')]()[_0x0f2a('0x1c')](function(){_0x3fde33[_0x0f2a('0x28')](0xcc)[_0x0f2a('0x29')]();});}};}function handleEntityNotFound(_0x2e0e03,_0x1857e7){return function(_0x58a982){if(!_0x58a982){_0x2e0e03['sendStatus'](0x194);}return _0x58a982;};}function handleError(_0x354897,_0x371f8e){_0x371f8e=_0x371f8e||0x1f4;return function(_0x383be6){logger[_0x0f2a('0x22')](_0x383be6[_0x0f2a('0x33')]);if(_0x383be6[_0x0f2a('0x34')]){delete _0x383be6[_0x0f2a('0x34')];}_0x354897['status'](_0x371f8e)['send'](_0x383be6);};}exports['index']=function(_0x328e38,_0x468f0f){var _0x3b8981={},_0x26cf80={},_0x557fce={'count':0x0,'rows':[]};var _0x788965=db[_0x0f2a('0x35')][_0x0f2a('0x36')];_0x26cf80[_0x0f2a('0x37')]=_[_0x0f2a('0x38')](_0x788965);_0x26cf80['query']=_[_0x0f2a('0x38')](_0x328e38['query']);_0x26cf80['filters']=_['intersection'](_0x26cf80[_0x0f2a('0x37')],_0x26cf80[_0x0f2a('0x39')]);_0x3b8981[_0x0f2a('0x3a')]=_['intersection'](_0x26cf80['model'],qs[_0x0f2a('0x3b')](_0x328e38['query']['fields']));_0x3b8981[_0x0f2a('0x3a')]=_0x3b8981[_0x0f2a('0x3a')][_0x0f2a('0x3c')]?_0x3b8981[_0x0f2a('0x3a')]:_0x26cf80[_0x0f2a('0x37')];if(!_0x328e38[_0x0f2a('0x39')][_0x0f2a('0x3d')](_0x0f2a('0x3e'))){_0x3b8981[_0x0f2a('0x2d')]=qs[_0x0f2a('0x2d')](_0x328e38['query']['limit']);_0x3b8981[_0x0f2a('0x2c')]=qs[_0x0f2a('0x2c')](_0x328e38[_0x0f2a('0x39')][_0x0f2a('0x2c')]);}_0x3b8981[_0x0f2a('0x3f')]=qs[_0x0f2a('0x40')](_0x328e38['query'][_0x0f2a('0x40')]);_0x3b8981['where']=qs[_0x0f2a('0x41')](_[_0x0f2a('0x42')](_0x328e38[_0x0f2a('0x39')],_0x26cf80[_0x0f2a('0x41')]));if(_0x328e38['query'][_0x0f2a('0x43')]){_0x3b8981[_0x0f2a('0x44')]=_[_0x0f2a('0x45')](_0x3b8981[_0x0f2a('0x44')],{'$or':_[_0x0f2a('0x46')](_0x788965,function(_0x2c44f3){if(_0x2c44f3[_0x0f2a('0x47')][_0x0f2a('0x48')]!=='VIRTUAL'){var _0x3510e1={};_0x3510e1[_0x2c44f3[_0x0f2a('0x49')]]={'$like':'%'+_0x328e38[_0x0f2a('0x39')][_0x0f2a('0x43')]+'%'};return _0x3510e1;}})});}_0x3b8981=_[_0x0f2a('0x45')]({},_0x3b8981,_0x328e38[_0x0f2a('0x4a')]);var _0x18b1de={'where':_0x3b8981[_0x0f2a('0x44')]};return db[_0x0f2a('0x35')][_0x0f2a('0x2b')](_0x18b1de)['then'](function(_0x5c9511){_0x557fce[_0x0f2a('0x2b')]=_0x5c9511;if(_0x328e38[_0x0f2a('0x39')]['includeAll']){_0x3b8981[_0x0f2a('0x4b')]=[{'all':!![]}];}return db[_0x0f2a('0x35')][_0x0f2a('0x4c')](_0x3b8981);})['then'](function(_0x9ba286){_0x557fce[_0x0f2a('0x4d')]=_0x9ba286;return _0x557fce;})['then'](respondWithFilteredResult(_0x468f0f,_0x3b8981))[_0x0f2a('0x26')](handleError(_0x468f0f,null));};exports[_0x0f2a('0x4e')]=function(_0x44057c,_0x3f03e4){var _0x1b0645={'raw':![],'where':{'id':_0x44057c[_0x0f2a('0x4f')]['id']}},_0x3fbee3={};_0x3fbee3['model']=_[_0x0f2a('0x38')](db[_0x0f2a('0x35')][_0x0f2a('0x36')]);_0x3fbee3['query']=_['keys'](_0x44057c[_0x0f2a('0x39')]);_0x3fbee3['filters']=_[_0x0f2a('0x50')](_0x3fbee3[_0x0f2a('0x37')],_0x3fbee3[_0x0f2a('0x39')]);_0x1b0645[_0x0f2a('0x3a')]=_['intersection'](_0x3fbee3['model'],qs[_0x0f2a('0x3b')](_0x44057c[_0x0f2a('0x39')][_0x0f2a('0x3b')]));_0x1b0645[_0x0f2a('0x3a')]=_0x1b0645[_0x0f2a('0x3a')]['length']?_0x1b0645['attributes']:_0x3fbee3[_0x0f2a('0x37')];if(_0x44057c[_0x0f2a('0x39')][_0x0f2a('0x51')]){_0x1b0645['include']=[{'all':!![]}];}_0x1b0645=_['merge']({},_0x1b0645,_0x44057c['options']);return db[_0x0f2a('0x35')]['find'](_0x1b0645)['then'](handleEntityNotFound(_0x3f03e4,null))[_0x0f2a('0x1c')](respondWithResult(_0x3f03e4,null))['catch'](handleError(_0x3f03e4,null));};exports['create']=function(_0x2c6653,_0x30bca9){return db[_0x0f2a('0x35')]['create'](_0x2c6653[_0x0f2a('0x52')],{})[_0x0f2a('0x1c')](respondWithResult(_0x30bca9,0xc9))[_0x0f2a('0x26')](handleError(_0x30bca9,null));};exports[_0x0f2a('0x31')]=function(_0x3e30a5,_0xd20773){if(_0x3e30a5[_0x0f2a('0x52')]['id']){delete _0x3e30a5['body']['id'];}return db[_0x0f2a('0x35')][_0x0f2a('0x53')]({'where':{'id':_0x3e30a5['params']['id']}})[_0x0f2a('0x1c')](handleEntityNotFound(_0xd20773,null))[_0x0f2a('0x1c')](saveUpdates(_0x3e30a5[_0x0f2a('0x52')],null))[_0x0f2a('0x1c')](respondWithResult(_0xd20773,null))[_0x0f2a('0x26')](handleError(_0xd20773,null));};exports[_0x0f2a('0x32')]=function(_0x15c8b0,_0x58b1f5){return db[_0x0f2a('0x35')][_0x0f2a('0x53')]({'where':{'id':_0x15c8b0[_0x0f2a('0x4f')]['id']}})[_0x0f2a('0x1c')](handleEntityNotFound(_0x58b1f5,null))[_0x0f2a('0x1c')](removeEntity(_0x58b1f5,null))[_0x0f2a('0x26')](handleError(_0x58b1f5,null));};exports['getConfigurations']=function(_0x5d8106,_0x1cafdb,_0x5e4588){var _0x126368={};var _0x3c9f2f={};var _0xaa6fbc;var _0x29118b;return db[_0x0f2a('0x35')][_0x0f2a('0x54')]({'where':{'id':_0x5d8106[_0x0f2a('0x4f')]['id']}})[_0x0f2a('0x1c')](handleEntityNotFound(_0x1cafdb,null))[_0x0f2a('0x1c')](function(_0x4e4bc1){if(_0x4e4bc1){_0xaa6fbc=_0x4e4bc1;_0x3c9f2f[_0x0f2a('0x37')]=_[_0x0f2a('0x38')](db['VtigerConfiguration'][_0x0f2a('0x36')]);_0x3c9f2f[_0x0f2a('0x39')]=_[_0x0f2a('0x38')](_0x5d8106['query']);_0x3c9f2f[_0x0f2a('0x41')]=_[_0x0f2a('0x50')](_0x3c9f2f[_0x0f2a('0x37')],_0x3c9f2f[_0x0f2a('0x39')]);_0x126368[_0x0f2a('0x3a')]=_[_0x0f2a('0x50')](_0x3c9f2f[_0x0f2a('0x37')],qs[_0x0f2a('0x3b')](_0x5d8106[_0x0f2a('0x39')][_0x0f2a('0x3b')]));_0x126368[_0x0f2a('0x3a')]=_0x126368[_0x0f2a('0x3a')]['length']?_0x126368[_0x0f2a('0x3a')]:_0x3c9f2f['model'];_0x126368[_0x0f2a('0x3f')]=qs[_0x0f2a('0x40')](_0x5d8106[_0x0f2a('0x39')][_0x0f2a('0x40')]);_0x126368['where']=qs['filters'](_['pick'](_0x5d8106['query'],_0x3c9f2f[_0x0f2a('0x41')]));if(_0x5d8106[_0x0f2a('0x39')][_0x0f2a('0x43')]){_0x126368[_0x0f2a('0x44')]=_[_0x0f2a('0x45')](_0x126368[_0x0f2a('0x44')],{'$or':_[_0x0f2a('0x46')](_0x126368[_0x0f2a('0x3a')],function(_0x5aabef){var _0x495f73={};_0x495f73[_0x5aabef]={'$like':'%'+_0x5d8106[_0x0f2a('0x39')][_0x0f2a('0x43')]+'%'};return _0x495f73;})});}_0x126368=_[_0x0f2a('0x45')]({},_0x126368,_0x5d8106[_0x0f2a('0x4a')]);return _0xaa6fbc['getConfigurations'](_0x126368);}})[_0x0f2a('0x1c')](function(_0x4b828f){if(_0x4b828f){_0x29118b=_0x4b828f[_0x0f2a('0x3c')];if(!_0x5d8106['query']['hasOwnProperty']('nolimit')){_0x126368[_0x0f2a('0x2d')]=qs[_0x0f2a('0x2d')](_0x5d8106[_0x0f2a('0x39')][_0x0f2a('0x2d')]);_0x126368[_0x0f2a('0x2c')]=qs[_0x0f2a('0x2c')](_0x5d8106[_0x0f2a('0x39')]['offset']);}return _0xaa6fbc[_0x0f2a('0x55')](_0x126368);}})['then'](function(_0x16dc2c){if(_0x16dc2c){return _0x16dc2c?{'count':_0x29118b,'rows':_0x16dc2c}:null;}})[_0x0f2a('0x1c')](respondWithResult(_0x1cafdb,null))[_0x0f2a('0x26')](handleError(_0x1cafdb,null));};exports[_0x0f2a('0x56')]=function(_0xfc2e58,_0x47e94a,_0x512e7e){if(_0xfc2e58[_0x0f2a('0x52')]['id']){delete _0xfc2e58[_0x0f2a('0x52')]['id'];}return db[_0x0f2a('0x35')][_0x0f2a('0x54')]({'where':{'id':_0xfc2e58[_0x0f2a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47e94a,null))['then'](function(_0x278a1e){if(_0x278a1e){_0xfc2e58[_0x0f2a('0x52')][_0x0f2a('0x57')]=_0x278a1e['id'];_0xfc2e58['body']['Subjects']=integrations[_0x0f2a('0x58')](_0xfc2e58['body'][_0x0f2a('0x59')],_0xfc2e58[_0x0f2a('0x52')]['type']);_0xfc2e58[_0x0f2a('0x52')][_0x0f2a('0x5a')]=integrations[_0x0f2a('0x5b')](_0xfc2e58[_0x0f2a('0x52')]['channel'],_0xfc2e58['body'][_0x0f2a('0x47')]);return db[_0x0f2a('0x5c')][_0x0f2a('0x5d')](_0xfc2e58[_0x0f2a('0x52')],{'include':[{'model':db['VtigerField'],'as':_0x0f2a('0x5e')},{'model':db['VtigerField'],'as':_0x0f2a('0x5a')}]});}return null;})[_0x0f2a('0x1c')](respondWithResult(_0x47e94a,null))[_0x0f2a('0x26')](handleError(_0x47e94a,null));};var md5=require(_0x0f2a('0x5f'));exports[_0x0f2a('0x60')]=function(_0xc1d11d,_0x566fdd,_0x352bd8){var _0x4d4f28=null;var _0x50a93d=null;var _0x1ec633=null;var _0x5b8afe=null;var _0x1eb837='';return db[_0x0f2a('0x35')][_0x0f2a('0x54')]({'where':{'id':_0xc1d11d[_0x0f2a('0x4f')]['id']},'attributes':['id',_0x0f2a('0x34'),_0x0f2a('0x61'),_0x0f2a('0x62'),_0x0f2a('0x63'),_0x0f2a('0x64'),_0x0f2a('0x65'),'accessKey']})['then'](handleEntityNotFound(_0x566fdd,null))[_0x0f2a('0x1c')](function(_0x54afb9){if(_0x54afb9){_0x4d4f28=_0x54afb9[_0x0f2a('0x61')];_0x50a93d=_0x54afb9[_0x0f2a('0x66')];_0x1ec633=_0x54afb9[_0x0f2a('0x63')];_0x1eb837=_0x54afb9[_0x0f2a('0x64')];var _0x1037ab=_0x1eb837[_0x0f2a('0x67')](-0x1);if(_0x1037ab==='/'){_0x1eb837=_0x1eb837[_0x0f2a('0x68')](0x0,_0x1eb837[_0x0f2a('0x69')](_0x1037ab));}_0x5b8afe=util[_0x0f2a('0x6a')](_0x0f2a('0x6b'),_0x1eb837);var _0x23cee9={'method':'GET','uri':_0x5b8afe,'qs':{'operation':_0x0f2a('0x6c'),'username':_0x54afb9[_0x0f2a('0x61')]},'json':!![]};return rp(_0x23cee9);}})[_0x0f2a('0x1c')](function(_0x4df0bb){if(_0x4df0bb[_0x0f2a('0x6d')]){var _0x4f4e35={'method':_0x0f2a('0x6e'),'uri':_0x5b8afe,'form':{'operation':'login','username':_0x4d4f28,'accessKey':md5(_0x4df0bb[_0x0f2a('0x25')][_0x0f2a('0x6f')]+_0x50a93d)},'json':!![]};return rp(_0x4f4e35);}})[_0x0f2a('0x1c')](function(_0x4e4af9){if(_0x4e4af9[_0x0f2a('0x6d')]){var _0x2039a7={'method':'GET','uri':_0x5b8afe,'qs':{'operation':_0x0f2a('0x70'),'username':_0x4d4f28,'sessionName':_0x4e4af9[_0x0f2a('0x25')]['sessionName'],'elementType':_0x1ec633},'json':!![]};return rp(_0x2039a7);}})[_0x0f2a('0x1c')](function(_0x40a71e){if(_0x40a71e[_0x0f2a('0x6d')]){var _0x22f794=[_0x0f2a('0x71'),_0x0f2a('0x72'),_0x0f2a('0x73')];_['remove'](_0x40a71e['result'][_0x0f2a('0x3b')],function(_0x58ea20){return _0x22f794[_0x0f2a('0x74')](_0x58ea20['type']['name']);});_['remove'](_0x40a71e[_0x0f2a('0x25')][_0x0f2a('0x3b')],function(_0x5ba021){return _0x5ba021[_0x0f2a('0x75')]===_0x0f2a('0x76');});return{'count':_0x40a71e[_0x0f2a('0x25')][_0x0f2a('0x3b')][_0x0f2a('0x3c')],'rows':_[_0x0f2a('0x46')](_0x40a71e[_0x0f2a('0x25')]['fields'],function(_0x2b7408){return{'id':_0x2b7408[_0x0f2a('0x34')],'name':_0x2b7408[_0x0f2a('0x77')],'custom':_[_0x0f2a('0x78')](_0x2b7408[_0x0f2a('0x34')],_0x0f2a('0x79'))?!![]:![],'options':_0x2b7408[_0x0f2a('0x47')][_0x0f2a('0x34')]==='picklist'&&_0x2b7408['type'][_0x0f2a('0x7a')][_0x0f2a('0x3c')]>0x0?_['map'](_0x2b7408['type'][_0x0f2a('0x7a')],function(_0x21cbe4){return{'name':_0x21cbe4[_0x0f2a('0x77')],'value':_0x21cbe4[_0x0f2a('0x7b')]};}):[]};})};}})[_0x0f2a('0x1c')](respondWithResult(_0x566fdd,null))[_0x0f2a('0x26')](function(_0x2c2632){console[_0x0f2a('0x7c')](_0x0f2a('0x7d')+_0x2c2632);var _0x285ef3=_0xc1d11d[_0x0f2a('0x39')]['test']?0x1f4:_0x2c2632[_0x0f2a('0x7e')]||0x1f4;logger[_0x0f2a('0x22')](_0x0f2a('0x7f'),_0x0f2a('0x60'),_0x285ef3,JSON[_0x0f2a('0x21')](_0x2c2632));delete _0x2c2632[_0x0f2a('0x34')];if(_0x285ef3===0x191){_0x285ef3=0x190;}_0x566fdd[_0x0f2a('0x28')](_0x285ef3)['send'](_0xc1d11d[_0x0f2a('0x39')][_0x0f2a('0x19')]?{'message':_0x0f2a('0x80'),'statusCode':_0x2c2632[_0x0f2a('0x7e')]}:_0x2c2632);});};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js
index 70f7d35..29ef3e3 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.model.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcfcb=['../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x29560f,_0x1621cc){var _0x49606e=function(_0x44649b){while(--_0x44649b){_0x29560f['push'](_0x29560f['shift']());}};_0x49606e(++_0x1621cc);}(_0xcfcb,0x7a));var _0xbcfc=function(_0x284174,_0x1dd400){_0x284174=_0x284174-0x0;var _0x58b7fb=_0xcfcb[_0x284174];return _0x58b7fb;};'use strict';var _=require(_0xbcfc('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbcfc('0x1'));var BPromise=require(_0xbcfc('0x2'));var rp=require(_0xbcfc('0x3'));var fs=require('fs');var path=require(_0xbcfc('0x4'));var rimraf=require(_0xbcfc('0x5'));var config=require(_0xbcfc('0x6'));var attributes=require(_0xbcfc('0x7'));var integrations=require(_0xbcfc('0x8'));module[_0xbcfc('0x9')]=function(_0x255243,_0x4056a8){return _0x255243[_0xbcfc('0xa')](_0xbcfc('0xb'),attributes,{'tableName':_0xbcfc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5c9=['util','../../config/logger','api','request-promise','path','../../components/integrations/configuration','exports','VtigerAccount','lodash'];(function(_0x5f49c0,_0x27a1b4){var _0x5ab653=function(_0x4de962){while(--_0x4de962){_0x5f49c0['push'](_0x5f49c0['shift']());}};_0x5ab653(++_0x27a1b4);}(_0xa5c9,0x143));var _0x9a5c=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0xa5c9[_0x593564];return _0x211a89;};'use strict';var _=require(_0x9a5c('0x0'));var util=require(_0x9a5c('0x1'));var logger=require(_0x9a5c('0x2'))(_0x9a5c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9a5c('0x4'));var fs=require('fs');var path=require(_0x9a5c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x9a5c('0x6'));module[_0x9a5c('0x7')]=function(_0x2cac2a,_0x3bb6f2){return _0x2cac2a['define'](_0x9a5c('0x8'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js
index 924d5c0..5f2bf60 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1771=['request','then','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x5a9126,_0xc1c87e){var _0x1134ed=function(_0x359696){while(--_0x359696){_0x5a9126['push'](_0x5a9126['shift']());}};_0x1134ed(++_0xc1c87e);}(_0x1771,0xbb));var _0x1177=function(_0x2fac31,_0x556be2){_0x2fac31=_0x2fac31-0x0;var _0x2073a0=_0x1771[_0x2fac31];return _0x2073a0;};'use strict';var _=require(_0x1177('0x0'));var util=require(_0x1177('0x1'));var moment=require(_0x1177('0x2'));var BPromise=require(_0x1177('0x3'));var rs=require(_0x1177('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1177('0x5'))['db'];var utils=require(_0x1177('0x6'));var logger=require(_0x1177('0x7'))(_0x1177('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1177('0x9')][_0x1177('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bc79f,_0x256055,_0x14f802){return new BPromise(function(_0x45a86c,_0x2db099){return client[_0x1177('0xb')](_0x3bc79f,_0x14f802)[_0x1177('0xc')](function(_0x3a5e44){logger[_0x1177('0xd')](_0x1177('0xe'),_0x256055,'request\x20sent');logger['debug'](_0x1177('0xf'),_0x256055,'request\x20sent',JSON['stringify'](_0x3a5e44));if(_0x3a5e44[_0x1177('0x10')]){if(_0x3a5e44['error']['code']===0x1f4){logger[_0x1177('0x10')](_0x1177('0xe'),_0x256055,_0x3a5e44['error'][_0x1177('0x11')]);return _0x2db099(_0x3a5e44[_0x1177('0x10')][_0x1177('0x11')]);}logger[_0x1177('0x10')](_0x1177('0xe'),_0x256055,_0x3a5e44['error']['message']);return _0x45a86c(_0x3a5e44[_0x1177('0x10')][_0x1177('0x11')]);}else{logger['info'](_0x1177('0xe'),_0x256055,_0x1177('0x12'));_0x45a86c(_0x3a5e44['result'][_0x1177('0x11')]);}})[_0x1177('0x13')](function(_0x3726cd){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x256055,_0x3726cd);_0x2db099(_0x3726cd);});});}exports[_0x1177('0x14')]=function(_0x2a89ef){var _0x30409e=this;return new Promise(function(_0x33d5ce,_0x3a4973){return db[_0x1177('0x15')][_0x1177('0x16')]({'raw':_0x2a89ef[_0x1177('0x17')]?_0x2a89ef[_0x1177('0x17')][_0x1177('0x18')]===undefined?!![]:![]:!![],'where':_0x2a89ef[_0x1177('0x17')]?_0x2a89ef['options'][_0x1177('0x19')]||null:null,'attributes':_0x2a89ef['options']?_0x2a89ef[_0x1177('0x17')]['attributes']||null:null,'limit':_0x2a89ef[_0x1177('0x17')]?_0x2a89ef[_0x1177('0x17')][_0x1177('0x1a')]||null:null,'include':_0x2a89ef['options']?_0x2a89ef['options'][_0x1177('0x1b')]?_[_0x1177('0x1c')](_0x2a89ef[_0x1177('0x17')][_0x1177('0x1b')],function(_0x43b990){return{'model':db[_0x43b990[_0x1177('0x1d')]],'as':_0x43b990['as'],'attributes':_0x43b990['attributes'],'include':_0x43b990[_0x1177('0x1b')]?_['map'](_0x43b990[_0x1177('0x1b')],function(_0x345425){return{'model':db[_0x345425[_0x1177('0x1d')]],'as':_0x345425['as'],'attributes':_0x345425[_0x1177('0x1e')],'include':_0x345425[_0x1177('0x1b')]?_[_0x1177('0x1c')](_0x345425[_0x1177('0x1b')],function(_0x25bd53){return{'model':db[_0x25bd53[_0x1177('0x1d')]],'as':_0x25bd53['as'],'attributes':_0x25bd53['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x108436){logger['info'](_0x1177('0x14'),_0x2a89ef);logger[_0x1177('0x1f')](_0x1177('0x14'),_0x2a89ef,JSON['stringify'](_0x108436));_0x33d5ce(_0x108436);})[_0x1177('0x13')](function(_0xbfaff){logger['error']('GetVtigerAccount',_0xbfaff[_0x1177('0x11')],_0x2a89ef);_0x3a4973(_0x30409e[_0x1177('0x10')](0x1f4,_0xbfaff[_0x1177('0x11')]));});});};exports[_0x1177('0x20')]=function(_0x20f02d){var _0x585e13=this;return new Promise(function(_0xcc104f,_0x5537bf){return db[_0x1177('0x15')]['find']({'raw':_0x20f02d[_0x1177('0x17')]?_0x20f02d['options'][_0x1177('0x18')]===undefined?!![]:![]:!![],'where':_0x20f02d['options']?_0x20f02d['options'][_0x1177('0x19')]||null:null,'attributes':_0x20f02d[_0x1177('0x17')]?_0x20f02d[_0x1177('0x17')]['attributes']||null:null,'include':_0x20f02d[_0x1177('0x17')]?_0x20f02d[_0x1177('0x17')][_0x1177('0x1b')]?_['map'](_0x20f02d[_0x1177('0x17')][_0x1177('0x1b')],function(_0x432134){return{'model':db[_0x432134[_0x1177('0x1d')]],'as':_0x432134['as'],'attributes':_0x432134[_0x1177('0x1e')],'include':_0x432134[_0x1177('0x1b')]?_[_0x1177('0x1c')](_0x432134[_0x1177('0x1b')],function(_0x3eadda){return{'model':db[_0x3eadda[_0x1177('0x1d')]],'as':_0x3eadda['as'],'attributes':_0x3eadda['attributes'],'include':_0x3eadda[_0x1177('0x1b')]?_[_0x1177('0x1c')](_0x3eadda[_0x1177('0x1b')],function(_0x44ee17){return{'model':db[_0x44ee17[_0x1177('0x1d')]],'as':_0x44ee17['as'],'attributes':_0x44ee17[_0x1177('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1177('0xc')](function(_0x2c6542){logger['info'](_0x1177('0x20'),_0x20f02d);logger[_0x1177('0x1f')](_0x1177('0x20'),_0x20f02d,JSON['stringify'](_0x2c6542));_0xcc104f(_0x2c6542);})[_0x1177('0x13')](function(_0x11425b){logger[_0x1177('0x10')](_0x1177('0x20'),_0x11425b[_0x1177('0x11')],_0x20f02d);_0x5537bf(_0x585e13[_0x1177('0x10')](0x1f4,_0x11425b[_0x1177('0x11')]));});});};
\ No newline at end of file
+var _0xde6c=['include','model','map','catch','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit'];(function(_0x3732e1,_0x304dc1){var _0x51e120=function(_0x33c129){while(--_0x33c129){_0x3732e1['push'](_0x3732e1['shift']());}};_0x51e120(++_0x304dc1);}(_0xde6c,0x164));var _0xcde6=function(_0x157712,_0xc29e01){_0x157712=_0x157712-0x0;var _0x23e9d9=_0xde6c[_0x157712];return _0x23e9d9;};'use strict';var _=require(_0xcde6('0x0'));var util=require(_0xcde6('0x1'));var moment=require(_0xcde6('0x2'));var BPromise=require(_0xcde6('0x3'));var rs=require(_0xcde6('0x4'));var fs=require('fs');var Redis=require(_0xcde6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcde6('0x6'));var logger=require(_0xcde6('0x7'))(_0xcde6('0x8'));var config=require(_0xcde6('0x9'));var jayson=require(_0xcde6('0xa'));var client=jayson[_0xcde6('0xb')][_0xcde6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6fbda8,_0x8303fa,_0x46eaa7){return new BPromise(function(_0x5f8dad,_0x53d854){return client['request'](_0x6fbda8,_0x46eaa7)[_0xcde6('0xd')](function(_0x1b5148){logger[_0xcde6('0xe')](_0xcde6('0xf'),_0x8303fa,'request\x20sent');logger[_0xcde6('0x10')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x8303fa,'request\x20sent',JSON[_0xcde6('0x11')](_0x1b5148));if(_0x1b5148[_0xcde6('0x12')]){if(_0x1b5148[_0xcde6('0x12')][_0xcde6('0x13')]===0x1f4){logger['error'](_0xcde6('0xf'),_0x8303fa,_0x1b5148['error']['message']);return _0x53d854(_0x1b5148[_0xcde6('0x12')][_0xcde6('0x14')]);}logger[_0xcde6('0x12')](_0xcde6('0xf'),_0x8303fa,_0x1b5148['error'][_0xcde6('0x14')]);return _0x5f8dad(_0x1b5148[_0xcde6('0x12')][_0xcde6('0x14')]);}else{logger['info'](_0xcde6('0xf'),_0x8303fa,_0xcde6('0x15'));_0x5f8dad(_0x1b5148['result'][_0xcde6('0x14')]);}})['catch'](function(_0xdbc71c){logger[_0xcde6('0x12')](_0xcde6('0xf'),_0x8303fa,_0xdbc71c);_0x53d854(_0xdbc71c);});});}exports[_0xcde6('0x16')]=function(_0x1822a7){var _0x4caeed=this;return new Promise(function(_0x22845a,_0x16e7be){return db[_0xcde6('0x17')][_0xcde6('0x18')]({'raw':_0x1822a7[_0xcde6('0x19')]?_0x1822a7['options']['raw']===undefined?!![]:![]:!![],'where':_0x1822a7[_0xcde6('0x19')]?_0x1822a7[_0xcde6('0x19')][_0xcde6('0x1a')]||null:null,'attributes':_0x1822a7[_0xcde6('0x19')]?_0x1822a7[_0xcde6('0x19')][_0xcde6('0x1b')]||null:null,'limit':_0x1822a7['options']?_0x1822a7[_0xcde6('0x19')][_0xcde6('0x1c')]||null:null,'include':_0x1822a7[_0xcde6('0x19')]?_0x1822a7['options'][_0xcde6('0x1d')]?_['map'](_0x1822a7[_0xcde6('0x19')][_0xcde6('0x1d')],function(_0x4b1a4a){return{'model':db[_0x4b1a4a[_0xcde6('0x1e')]],'as':_0x4b1a4a['as'],'attributes':_0x4b1a4a[_0xcde6('0x1b')],'include':_0x4b1a4a[_0xcde6('0x1d')]?_['map'](_0x4b1a4a[_0xcde6('0x1d')],function(_0x1d6398){return{'model':db[_0x1d6398[_0xcde6('0x1e')]],'as':_0x1d6398['as'],'attributes':_0x1d6398[_0xcde6('0x1b')],'include':_0x1d6398['include']?_[_0xcde6('0x1f')](_0x1d6398['include'],function(_0x1c9b5d){return{'model':db[_0x1c9b5d[_0xcde6('0x1e')]],'as':_0x1c9b5d['as'],'attributes':_0x1c9b5d[_0xcde6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcde6('0xd')](function(_0x1f985d){logger['info']('GetVtigerAccount',_0x1822a7);logger[_0xcde6('0x10')]('GetVtigerAccount',_0x1822a7,JSON[_0xcde6('0x11')](_0x1f985d));_0x22845a(_0x1f985d);})[_0xcde6('0x20')](function(_0x182bed){logger[_0xcde6('0x12')](_0xcde6('0x16'),_0x182bed[_0xcde6('0x14')],_0x1822a7);_0x16e7be(_0x4caeed[_0xcde6('0x12')](0x1f4,_0x182bed[_0xcde6('0x14')]));});});};exports[_0xcde6('0x21')]=function(_0xd0078a){var _0xaadedf=this;return new Promise(function(_0x33f843,_0xc62e3f){return db[_0xcde6('0x17')][_0xcde6('0x22')]({'raw':_0xd0078a['options']?_0xd0078a[_0xcde6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xd0078a[_0xcde6('0x19')]?_0xd0078a[_0xcde6('0x19')][_0xcde6('0x1a')]||null:null,'attributes':_0xd0078a[_0xcde6('0x19')]?_0xd0078a[_0xcde6('0x19')][_0xcde6('0x1b')]||null:null,'include':_0xd0078a[_0xcde6('0x19')]?_0xd0078a[_0xcde6('0x19')][_0xcde6('0x1d')]?_['map'](_0xd0078a[_0xcde6('0x19')][_0xcde6('0x1d')],function(_0x59014b){return{'model':db[_0x59014b['model']],'as':_0x59014b['as'],'attributes':_0x59014b[_0xcde6('0x1b')],'include':_0x59014b[_0xcde6('0x1d')]?_[_0xcde6('0x1f')](_0x59014b[_0xcde6('0x1d')],function(_0x573070){return{'model':db[_0x573070['model']],'as':_0x573070['as'],'attributes':_0x573070['attributes'],'include':_0x573070[_0xcde6('0x1d')]?_[_0xcde6('0x1f')](_0x573070[_0xcde6('0x1d')],function(_0x42d597){return{'model':db[_0x42d597[_0xcde6('0x1e')]],'as':_0x42d597['as'],'attributes':_0x42d597[_0xcde6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcde6('0xd')](function(_0xef16ed){logger[_0xcde6('0xe')](_0xcde6('0x21'),_0xd0078a);logger['debug'](_0xcde6('0x21'),_0xd0078a,JSON[_0xcde6('0x11')](_0xef16ed));_0x33f843(_0xef16ed);})[_0xcde6('0x20')](function(_0x1abae7){logger['error']('ShowVtigerAccount',_0x1abae7[_0xcde6('0x14')],_0xd0078a);_0xc62e3f(_0xaadedf[_0xcde6('0x12')](0x1f4,_0x1abae7[_0xcde6('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js
index e52a68c..0051d49 100644
--- a/server/api/intVtigerConfiguration/index.js
+++ b/server/api/intVtigerConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x4b6507,_0x5518b5){var _0x2001ec=function(_0x330ddf){while(--_0x330ddf){_0x4b6507['push'](_0x4b6507['shift']());}};_0x2001ec(++_0x5518b5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router;
\ No newline at end of file
+var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x21671,_0x3eaaac){var _0x20aae4=function(_0x13ed48){while(--_0x13ed48){_0x21671['push'](_0x21671['shift']());}};_0x20aae4(++_0x3eaaac);}(_0xb10b,0x12a));var _0xbb10=function(_0xd9caad,_0x5856b7){_0xd9caad=_0xd9caad-0x0;var _0x3127e6=_0xb10b[_0xd9caad];return _0x3127e6;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
index a68f9ab..268b6d2 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7220=['sequelize','STRING'];(function(_0x4e0dac,_0x43cb93){var _0x2de6a4=function(_0x1c27fe){while(--_0x1c27fe){_0x4e0dac['push'](_0x4e0dac['shift']());}};_0x2de6a4(++_0x43cb93);}(_0x7220,0x180));var _0x0722=function(_0x2ae17e,_0x4b406e){_0x2ae17e=_0x2ae17e-0x0;var _0x4dc529=_0x7220[_0x2ae17e];return _0x4dc529;};'use strict';var Sequelize=require(_0x0722('0x0'));module['exports']={'name':{'type':Sequelize[_0x0722('0x1')]},'description':{'type':Sequelize[_0x0722('0x1')]}};
\ No newline at end of file
+var _0x8084=['sequelize','exports','STRING'];(function(_0x1e16e8,_0x57e4bc){var _0x2e0183=function(_0x2d48e0){while(--_0x2d48e0){_0x1e16e8['push'](_0x1e16e8['shift']());}};_0x2e0183(++_0x57e4bc);}(_0x8084,0xb7));var _0x4808=function(_0x7f98b9,_0x794a5e){_0x7f98b9=_0x7f98b9-0x0;var _0x2ab7fd=_0x8084[_0x7f98b9];return _0x2ab7fd;};'use strict';var Sequelize=require(_0x4808('0x0'));module[_0x4808('0x1')]={'name':{'type':Sequelize[_0x4808('0x2')]},'description':{'type':Sequelize[_0x4808('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
index 7a09fed..4a2c107 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x92f0=['show','params','includeAll','find','create','body','destroy','getFields','findOne','VtigerField','rawAttributes','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','count','offset','Content-Range','json','apply','update','name','index','VtigerConfiguration','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','include','findAll'];(function(_0x12de61,_0x4b56a4){var _0xb3684f=function(_0x27fa50){while(--_0x27fa50){_0x12de61['push'](_0x12de61['shift']());}};_0xb3684f(++_0x4b56a4);}(_0x92f0,0x10d));var _0x092f=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0x92f0[_0x879e31];return _0x3467e8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x092f('0x0'));var rimraf=require(_0x092f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x092f('0x2'));var rp=require(_0x092f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x092f('0x4'));var util=require(_0x092f('0x5'));var path=require(_0x092f('0x6'));var sox=require(_0x092f('0x7'));var csv=require(_0x092f('0x8'));var ejs=require(_0x092f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x092f('0xa'));var crypto=require('crypto');var jsforce=require(_0x092f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x092f('0x8'));var querystring=require('querystring');var Papa=require(_0x092f('0xc'));var Redis=require('ioredis');var authService=require(_0x092f('0xd'));var qs=require(_0x092f('0xe'));var hardwareService=require(_0x092f('0xf'));var logger=require('../../config/logger')(_0x092f('0x10'));var utils=require(_0x092f('0x11'));var config=require(_0x092f('0x12'));var db=require(_0x092f('0x13'))['db'];var jayson=require(_0x092f('0x14'));var client=jayson['client'][_0x092f('0x15')]({'port':0x232a});function checkPasswordPattern(_0x3e9305,_0x5c6d22,_0x1f395e){if(_0x1f395e){var _0x1b19fb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b19fb[_0x092f('0x16')](_0x5c6d22)){return _0x3e9305;}else{throw new Error(_0x092f('0x17'));}}else{return _0x3e9305;}}function respondWithRpcPromise(_0x954956,_0x3b1f34,_0x1984df,_0x272ea5){return new BPromise(function(_0x4e4d0f,_0x352456){var _0x346c68=_0x272ea5||client;return _0x346c68[_0x092f('0x18')](_0x954956,_0x1984df)[_0x092f('0x19')](function(_0x57e911){logger['info'](_0x092f('0x1a'),_0x3b1f34,_0x092f('0x1b'));logger[_0x092f('0x1c')](_0x092f('0x1d'),_0x3b1f34,_0x092f('0x1b'),JSON['stringify'](_0x57e911));if(_0x57e911['error']){if(_0x57e911[_0x092f('0x1e')][_0x092f('0x1f')]===0x1f4){logger[_0x092f('0x1e')](_0x092f('0x1a'),_0x3b1f34,_0x57e911[_0x092f('0x1e')]['message']);return _0x352456(_0x57e911[_0x092f('0x1e')]['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x3b1f34,_0x57e911[_0x092f('0x1e')]['message']);return _0x4e4d0f(_0x57e911['error'][_0x092f('0x20')]);}else{logger[_0x092f('0x21')](_0x092f('0x1a'),_0x3b1f34,'request\x20sent');_0x4e4d0f(_0x57e911[_0x092f('0x22')]['message']);}})[_0x092f('0x23')](function(_0x1528c0){logger[_0x092f('0x1e')](_0x092f('0x1a'),_0x3b1f34,_0x1528c0);_0x352456(_0x1528c0);});});}function respondWithStatusCode(_0x2a8543,_0xc1eb8d){_0xc1eb8d=_0xc1eb8d||0xcc;return function(_0x42ac28){if(_0x42ac28){return _0x2a8543[_0x092f('0x24')](_0xc1eb8d);}return _0x2a8543[_0x092f('0x25')](_0xc1eb8d)[_0x092f('0x26')]();};}function respondWithResult(_0x27004c,_0x43f5c0){_0x43f5c0=_0x43f5c0||0xc8;return function(_0x29ac64){if(_0x29ac64){return _0x27004c[_0x092f('0x25')](_0x43f5c0)['json'](_0x29ac64);}};}function respondWithFilteredResult(_0x2c0524,_0x459140){return function(_0x58a5a7){if(_0x58a5a7){var _0x32f0a8=_0x58a5a7[_0x092f('0x27')],_0x598e69=_0x459140[_0x092f('0x28')],_0x4dd349=_0x459140[_0x092f('0x28')]+_0x459140['limit'],_0xea4c6;if(_0x4dd349>=_0x32f0a8){_0x4dd349=_0x32f0a8;_0xea4c6=0xc8;}else{_0xea4c6=0xce;}_0x2c0524[_0x092f('0x25')](_0xea4c6);return _0x2c0524['set'](_0x092f('0x29'),_0x598e69+'-'+_0x4dd349+'/'+_0x32f0a8)[_0x092f('0x2a')](_0x58a5a7);}return null;};}function patchUpdates(_0x372327){return function(_0x2eeb50){try{jsonpatch[_0x092f('0x2b')](_0x2eeb50,_0x372327,!![]);}catch(_0x3f8351){return BPromise['reject'](_0x3f8351);}return _0x2eeb50['save']();};}function saveUpdates(_0x4f74c8,_0x23aea7){return function(_0x57ec44){if(_0x57ec44){return _0x57ec44[_0x092f('0x2c')](_0x4f74c8)['then'](function(_0x3466ef){return _0x3466ef;});}return null;};}function removeEntity(_0xa97ece,_0x5a0b57){return function(_0x2c4c69){if(_0x2c4c69){return _0x2c4c69['destroy']()[_0x092f('0x19')](function(){_0xa97ece[_0x092f('0x25')](0xcc)[_0x092f('0x26')]();});}};}function handleEntityNotFound(_0x2f697f,_0x46beb2){return function(_0xa06c5e){if(!_0xa06c5e){_0x2f697f['sendStatus'](0x194);}return _0xa06c5e;};}function handleError(_0x1b6f41,_0x1c6903){_0x1c6903=_0x1c6903||0x1f4;return function(_0x3beaad){logger[_0x092f('0x1e')](_0x3beaad['stack']);if(_0x3beaad[_0x092f('0x2d')]){delete _0x3beaad[_0x092f('0x2d')];}_0x1b6f41[_0x092f('0x25')](_0x1c6903)['send'](_0x3beaad);};}exports[_0x092f('0x2e')]=function(_0x3a842e,_0x1e1807){var _0x45447e={},_0x141e31={},_0x4029a7={'count':0x0,'rows':[]};var _0x3f447b=db[_0x092f('0x2f')]['rawAttributes'];_0x141e31['model']=_[_0x092f('0x30')](_0x3f447b);_0x141e31['query']=_[_0x092f('0x30')](_0x3a842e[_0x092f('0x31')]);_0x141e31[_0x092f('0x32')]=_[_0x092f('0x33')](_0x141e31[_0x092f('0x34')],_0x141e31[_0x092f('0x31')]);_0x45447e['attributes']=_[_0x092f('0x33')](_0x141e31[_0x092f('0x34')],qs[_0x092f('0x35')](_0x3a842e[_0x092f('0x31')][_0x092f('0x35')]));_0x45447e[_0x092f('0x36')]=_0x45447e[_0x092f('0x36')][_0x092f('0x37')]?_0x45447e[_0x092f('0x36')]:_0x141e31[_0x092f('0x34')];if(!_0x3a842e['query'][_0x092f('0x38')]('nolimit')){_0x45447e['limit']=qs['limit'](_0x3a842e[_0x092f('0x31')][_0x092f('0x39')]);_0x45447e[_0x092f('0x28')]=qs[_0x092f('0x28')](_0x3a842e[_0x092f('0x31')][_0x092f('0x28')]);}_0x45447e[_0x092f('0x3a')]=qs['sort'](_0x3a842e['query'][_0x092f('0x3b')]);_0x45447e['where']=qs[_0x092f('0x32')](_[_0x092f('0x3c')](_0x3a842e['query'],_0x141e31[_0x092f('0x32')]));if(_0x3a842e[_0x092f('0x31')][_0x092f('0x3d')]){_0x45447e[_0x092f('0x3e')]=_[_0x092f('0x3f')](_0x45447e[_0x092f('0x3e')],{'$or':_[_0x092f('0x40')](_0x3f447b,function(_0x22d596){if(_0x22d596['type'][_0x092f('0x41')]!==_0x092f('0x42')){var _0x3ddda2={};_0x3ddda2[_0x22d596[_0x092f('0x43')]]={'$like':'%'+_0x3a842e[_0x092f('0x31')][_0x092f('0x3d')]+'%'};return _0x3ddda2;}})});}_0x45447e=_['merge']({},_0x45447e,_0x3a842e[_0x092f('0x44')]);var _0x55ba85={'where':_0x45447e[_0x092f('0x3e')]};return db[_0x092f('0x2f')][_0x092f('0x27')](_0x55ba85)[_0x092f('0x19')](function(_0x24d228){_0x4029a7['count']=_0x24d228;if(_0x3a842e[_0x092f('0x31')]['includeAll']){_0x45447e[_0x092f('0x45')]=[{'all':!![]}];}return db[_0x092f('0x2f')][_0x092f('0x46')](_0x45447e);})[_0x092f('0x19')](function(_0x497473){_0x4029a7['rows']=_0x497473;return _0x4029a7;})[_0x092f('0x19')](respondWithFilteredResult(_0x1e1807,_0x45447e))['catch'](handleError(_0x1e1807,null));};exports[_0x092f('0x47')]=function(_0x1c1f37,_0x51c5ee){var _0x285eb3={'raw':![],'where':{'id':_0x1c1f37[_0x092f('0x48')]['id']}},_0x6b9cb6={};_0x6b9cb6[_0x092f('0x34')]=_[_0x092f('0x30')](db[_0x092f('0x2f')]['rawAttributes']);_0x6b9cb6[_0x092f('0x31')]=_[_0x092f('0x30')](_0x1c1f37[_0x092f('0x31')]);_0x6b9cb6[_0x092f('0x32')]=_[_0x092f('0x33')](_0x6b9cb6['model'],_0x6b9cb6['query']);_0x285eb3[_0x092f('0x36')]=_[_0x092f('0x33')](_0x6b9cb6[_0x092f('0x34')],qs['fields'](_0x1c1f37[_0x092f('0x31')][_0x092f('0x35')]));_0x285eb3[_0x092f('0x36')]=_0x285eb3[_0x092f('0x36')][_0x092f('0x37')]?_0x285eb3[_0x092f('0x36')]:_0x6b9cb6[_0x092f('0x34')];if(_0x1c1f37['query'][_0x092f('0x49')]){_0x285eb3[_0x092f('0x45')]=[{'all':!![]}];}_0x285eb3=_[_0x092f('0x3f')]({},_0x285eb3,_0x1c1f37[_0x092f('0x44')]);return db[_0x092f('0x2f')][_0x092f('0x4a')](_0x285eb3)[_0x092f('0x19')](handleEntityNotFound(_0x51c5ee,null))['then'](respondWithResult(_0x51c5ee,null))[_0x092f('0x23')](handleError(_0x51c5ee,null));};exports[_0x092f('0x4b')]=function(_0x18f1d,_0x3e60c1){return db['VtigerConfiguration'][_0x092f('0x4b')](_0x18f1d[_0x092f('0x4c')],{})['then'](respondWithResult(_0x3e60c1,0xc9))[_0x092f('0x23')](handleError(_0x3e60c1,null));};exports['update']=function(_0x4d1569,_0x2be736){if(_0x4d1569[_0x092f('0x4c')]['id']){delete _0x4d1569['body']['id'];}return db['VtigerConfiguration'][_0x092f('0x4a')]({'where':{'id':_0x4d1569[_0x092f('0x48')]['id']}})[_0x092f('0x19')](handleEntityNotFound(_0x2be736,null))[_0x092f('0x19')](saveUpdates(_0x4d1569[_0x092f('0x4c')],null))[_0x092f('0x19')](respondWithResult(_0x2be736,null))['catch'](handleError(_0x2be736,null));};exports[_0x092f('0x4d')]=function(_0x1784a9,_0xbedced){return db['VtigerConfiguration']['find']({'where':{'id':_0x1784a9[_0x092f('0x48')]['id']}})['then'](handleEntityNotFound(_0xbedced,null))[_0x092f('0x19')](removeEntity(_0xbedced,null))[_0x092f('0x23')](handleError(_0xbedced,null));};exports[_0x092f('0x4e')]=function(_0x36fae3,_0x1552f9,_0x1b5393){var _0x5dd786={};var _0x2bf463={};var _0x423bf2;var _0x44386e;return db['VtigerConfiguration'][_0x092f('0x4f')]({'where':{'id':_0x36fae3['params']['id']}})['then'](handleEntityNotFound(_0x1552f9,null))['then'](function(_0x3b09aa){if(_0x3b09aa){_0x423bf2=_0x3b09aa;_0x2bf463[_0x092f('0x34')]=_[_0x092f('0x30')](db[_0x092f('0x50')][_0x092f('0x51')]);_0x2bf463[_0x092f('0x31')]=_[_0x092f('0x30')](_0x36fae3[_0x092f('0x31')]);_0x2bf463['filters']=_[_0x092f('0x33')](_0x2bf463[_0x092f('0x34')],_0x2bf463[_0x092f('0x31')]);_0x5dd786[_0x092f('0x36')]=_['intersection'](_0x2bf463[_0x092f('0x34')],qs[_0x092f('0x35')](_0x36fae3[_0x092f('0x31')][_0x092f('0x35')]));_0x5dd786[_0x092f('0x36')]=_0x5dd786['attributes'][_0x092f('0x37')]?_0x5dd786[_0x092f('0x36')]:_0x2bf463[_0x092f('0x34')];_0x5dd786[_0x092f('0x3a')]=qs[_0x092f('0x3b')](_0x36fae3[_0x092f('0x31')]['sort']);_0x5dd786[_0x092f('0x3e')]=qs[_0x092f('0x32')](_[_0x092f('0x3c')](_0x36fae3[_0x092f('0x31')],_0x2bf463['filters']));if(_0x36fae3[_0x092f('0x31')][_0x092f('0x3d')]){_0x5dd786[_0x092f('0x3e')]=_[_0x092f('0x3f')](_0x5dd786[_0x092f('0x3e')],{'$or':_[_0x092f('0x40')](_0x5dd786['attributes'],function(_0x44ed91){var _0x521f83={};_0x521f83[_0x44ed91]={'$like':'%'+_0x36fae3[_0x092f('0x31')][_0x092f('0x3d')]+'%'};return _0x521f83;})});}_0x5dd786=_['merge']({},_0x5dd786,_0x36fae3[_0x092f('0x44')]);return _0x423bf2['getFields'](_0x5dd786);}})[_0x092f('0x19')](function(_0x16c622){if(_0x16c622){_0x44386e=_0x16c622[_0x092f('0x37')];if(!_0x36fae3[_0x092f('0x31')][_0x092f('0x38')](_0x092f('0x52'))){_0x5dd786[_0x092f('0x39')]=qs[_0x092f('0x39')](_0x36fae3['query'][_0x092f('0x39')]);_0x5dd786[_0x092f('0x28')]=qs[_0x092f('0x28')](_0x36fae3[_0x092f('0x31')]['offset']);}return _0x423bf2['getFields'](_0x5dd786);}})[_0x092f('0x19')](function(_0x321d5a){if(_0x321d5a){return _0x321d5a?{'count':_0x44386e,'rows':_0x321d5a}:null;}})[_0x092f('0x19')](respondWithResult(_0x1552f9,null))[_0x092f('0x23')](handleError(_0x1552f9,null));};exports[_0x092f('0x53')]=function(_0xf0dff3,_0x2f4983,_0x59ca53){var _0x2cf40e={};var _0x431ded={};var _0x1911a8;var _0x24e766;return db[_0x092f('0x2f')][_0x092f('0x4f')]({'where':{'id':_0xf0dff3['params']['id']}})[_0x092f('0x19')](handleEntityNotFound(_0x2f4983,null))['then'](function(_0x39f551){if(_0x39f551){_0x1911a8=_0x39f551;_0x431ded[_0x092f('0x34')]=_['keys'](db[_0x092f('0x50')][_0x092f('0x51')]);_0x431ded[_0x092f('0x31')]=_[_0x092f('0x30')](_0xf0dff3['query']);_0x431ded['filters']=_[_0x092f('0x33')](_0x431ded[_0x092f('0x34')],_0x431ded[_0x092f('0x31')]);_0x2cf40e['attributes']=_[_0x092f('0x33')](_0x431ded[_0x092f('0x34')],qs[_0x092f('0x35')](_0xf0dff3[_0x092f('0x31')][_0x092f('0x35')]));_0x2cf40e[_0x092f('0x36')]=_0x2cf40e[_0x092f('0x36')][_0x092f('0x37')]?_0x2cf40e['attributes']:_0x431ded[_0x092f('0x34')];_0x2cf40e[_0x092f('0x3a')]=qs[_0x092f('0x3b')](_0xf0dff3[_0x092f('0x31')][_0x092f('0x3b')]);_0x2cf40e[_0x092f('0x3e')]=qs['filters'](_[_0x092f('0x3c')](_0xf0dff3[_0x092f('0x31')],_0x431ded[_0x092f('0x32')]));if(_0xf0dff3['query'][_0x092f('0x3d')]){_0x2cf40e['where']=_[_0x092f('0x3f')](_0x2cf40e[_0x092f('0x3e')],{'$or':_[_0x092f('0x40')](_0x2cf40e['attributes'],function(_0x2644d3){var _0x1ea876={};_0x1ea876[_0x2644d3]={'$like':'%'+_0xf0dff3['query'][_0x092f('0x3d')]+'%'};return _0x1ea876;})});}_0x2cf40e=_['merge']({},_0x2cf40e,_0xf0dff3[_0x092f('0x44')]);return _0x1911a8['getSubjects'](_0x2cf40e);}})[_0x092f('0x19')](function(_0x55807e){if(_0x55807e){_0x24e766=_0x55807e['length'];if(!_0xf0dff3[_0x092f('0x31')][_0x092f('0x38')]('nolimit')){_0x2cf40e[_0x092f('0x39')]=qs[_0x092f('0x39')](_0xf0dff3[_0x092f('0x31')][_0x092f('0x39')]);_0x2cf40e['offset']=qs[_0x092f('0x28')](_0xf0dff3[_0x092f('0x31')][_0x092f('0x28')]);}return _0x1911a8['getSubjects'](_0x2cf40e);}})['then'](function(_0x3f86fd){if(_0x3f86fd){return _0x3f86fd?{'count':_0x24e766,'rows':_0x3f86fd}:null;}})[_0x092f('0x19')](respondWithResult(_0x2f4983,null))['catch'](handleError(_0x2f4983,null));};exports[_0x092f('0x54')]=function(_0x2f1db2,_0x197e5d,_0x2e4d47){var _0x9f597c={};var _0x3aea42={};var _0x2ba759;var _0x4049f4;return db[_0x092f('0x2f')][_0x092f('0x4f')]({'where':{'id':_0x2f1db2['params']['id']}})['then'](handleEntityNotFound(_0x197e5d,null))[_0x092f('0x19')](function(_0x23e69a){if(_0x23e69a){_0x2ba759=_0x23e69a;_0x3aea42['model']=_[_0x092f('0x30')](db[_0x092f('0x50')][_0x092f('0x51')]);_0x3aea42[_0x092f('0x31')]=_[_0x092f('0x30')](_0x2f1db2[_0x092f('0x31')]);_0x3aea42[_0x092f('0x32')]=_[_0x092f('0x33')](_0x3aea42[_0x092f('0x34')],_0x3aea42[_0x092f('0x31')]);_0x9f597c[_0x092f('0x36')]=_[_0x092f('0x33')](_0x3aea42[_0x092f('0x34')],qs[_0x092f('0x35')](_0x2f1db2[_0x092f('0x31')][_0x092f('0x35')]));_0x9f597c[_0x092f('0x36')]=_0x9f597c[_0x092f('0x36')]['length']?_0x9f597c[_0x092f('0x36')]:_0x3aea42[_0x092f('0x34')];_0x9f597c['order']=qs[_0x092f('0x3b')](_0x2f1db2['query'][_0x092f('0x3b')]);_0x9f597c[_0x092f('0x3e')]=qs[_0x092f('0x32')](_['pick'](_0x2f1db2[_0x092f('0x31')],_0x3aea42[_0x092f('0x32')]));if(_0x2f1db2[_0x092f('0x31')][_0x092f('0x3d')]){_0x9f597c[_0x092f('0x3e')]=_[_0x092f('0x3f')](_0x9f597c[_0x092f('0x3e')],{'$or':_['map'](_0x9f597c['attributes'],function(_0x2b1f5f){var _0x1c1f26={};_0x1c1f26[_0x2b1f5f]={'$like':'%'+_0x2f1db2[_0x092f('0x31')][_0x092f('0x3d')]+'%'};return _0x1c1f26;})});}_0x9f597c=_[_0x092f('0x3f')]({},_0x9f597c,_0x2f1db2['options']);return _0x2ba759[_0x092f('0x54')](_0x9f597c);}})['then'](function(_0x4616b0){if(_0x4616b0){_0x4049f4=_0x4616b0[_0x092f('0x37')];if(!_0x2f1db2[_0x092f('0x31')]['hasOwnProperty'](_0x092f('0x52'))){_0x9f597c['limit']=qs[_0x092f('0x39')](_0x2f1db2[_0x092f('0x31')][_0x092f('0x39')]);_0x9f597c[_0x092f('0x28')]=qs[_0x092f('0x28')](_0x2f1db2[_0x092f('0x31')]['offset']);}return _0x2ba759[_0x092f('0x54')](_0x9f597c);}})[_0x092f('0x19')](function(_0x4424c5){if(_0x4424c5){return _0x4424c5?{'count':_0x4049f4,'rows':_0x4424c5}:null;}})[_0x092f('0x19')](respondWithResult(_0x197e5d,null))[_0x092f('0x23')](handleError(_0x197e5d,null));};
\ No newline at end of file
+var _0xb13b=['apply','reject','update','destroy','name','send','VtigerConfiguration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','params','find','create','body','getFields','findOne','length','order','pick','getSubjects','VtigerField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xb13b,0x1de));var _0xbb13=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb13b[_0x4b2436];return _0x4f5ab2;};'use strict';var pdf=require(_0xbb13('0x0'));var emlformat=require(_0xbb13('0x1'));var rimraf=require(_0xbb13('0x2'));var zipdir=require(_0xbb13('0x3'));var jsonpatch=require(_0xbb13('0x4'));var rp=require('request-promise');var moment=require(_0xbb13('0x5'));var BPromise=require(_0xbb13('0x6'));var Mustache=require('mustache');var util=require(_0xbb13('0x7'));var path=require(_0xbb13('0x8'));var sox=require(_0xbb13('0x9'));var csv=require(_0xbb13('0xa'));var ejs=require(_0xbb13('0xb'));var fs=require('fs');var _=require(_0xbb13('0xc'));var squel=require(_0xbb13('0xd'));var crypto=require(_0xbb13('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbb13('0xa'));var querystring=require(_0xbb13('0xf'));var Papa=require(_0xbb13('0x10'));var Redis=require(_0xbb13('0x11'));var authService=require(_0xbb13('0x12'));var qs=require(_0xbb13('0x13'));var hardwareService=require(_0xbb13('0x14'));var logger=require('../../config/logger')(_0xbb13('0x15'));var utils=require(_0xbb13('0x16'));var config=require(_0xbb13('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xbb13('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3c033f,_0x3613c8,_0xb696b9){if(_0xb696b9){var _0x1531af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1531af['test'](_0x3613c8)){return _0x3c033f;}else{throw new Error(_0xbb13('0x19'));}}else{return _0x3c033f;}}function respondWithRpcPromise(_0x58f59d,_0x3eda54,_0x5f1473,_0x111035){return new BPromise(function(_0x5f3ab1,_0x1ee7a6){var _0x4a35c4=_0x111035||client;return _0x4a35c4[_0xbb13('0x1a')](_0x58f59d,_0x5f1473)[_0xbb13('0x1b')](function(_0x25150b){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x3eda54,'request\x20sent');logger[_0xbb13('0x1c')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3eda54,'request\x20sent',JSON['stringify'](_0x25150b));if(_0x25150b[_0xbb13('0x1d')]){if(_0x25150b[_0xbb13('0x1d')][_0xbb13('0x1e')]===0x1f4){logger[_0xbb13('0x1d')](_0xbb13('0x1f'),_0x3eda54,_0x25150b[_0xbb13('0x1d')]['message']);return _0x1ee7a6(_0x25150b[_0xbb13('0x1d')][_0xbb13('0x20')]);}logger[_0xbb13('0x1d')](_0xbb13('0x1f'),_0x3eda54,_0x25150b['error']['message']);return _0x5f3ab1(_0x25150b[_0xbb13('0x1d')][_0xbb13('0x20')]);}else{logger[_0xbb13('0x21')](_0xbb13('0x1f'),_0x3eda54,'request\x20sent');_0x5f3ab1(_0x25150b[_0xbb13('0x22')][_0xbb13('0x20')]);}})[_0xbb13('0x23')](function(_0x4d64b7){logger[_0xbb13('0x1d')]('VtigerConfiguration,\x20%s,\x20%s',_0x3eda54,_0x4d64b7);_0x1ee7a6(_0x4d64b7);});});}function respondWithStatusCode(_0x4c9ae2,_0x37a04c){_0x37a04c=_0x37a04c||0xcc;return function(_0x2a41a1){if(_0x2a41a1){return _0x4c9ae2[_0xbb13('0x24')](_0x37a04c);}return _0x4c9ae2[_0xbb13('0x25')](_0x37a04c)[_0xbb13('0x26')]();};}function respondWithResult(_0x2acde5,_0xb1063d){_0xb1063d=_0xb1063d||0xc8;return function(_0x3872f3){if(_0x3872f3){return _0x2acde5[_0xbb13('0x25')](_0xb1063d)[_0xbb13('0x27')](_0x3872f3);}};}function respondWithFilteredResult(_0x13ad27,_0x49fe85){return function(_0x5157fe){if(_0x5157fe){var _0x4d3d89=_0x5157fe[_0xbb13('0x28')],_0x4348ae=_0x49fe85[_0xbb13('0x29')],_0x39d436=_0x49fe85[_0xbb13('0x29')]+_0x49fe85[_0xbb13('0x2a')],_0x1531cf;if(_0x39d436>=_0x4d3d89){_0x39d436=_0x4d3d89;_0x1531cf=0xc8;}else{_0x1531cf=0xce;}_0x13ad27[_0xbb13('0x25')](_0x1531cf);return _0x13ad27[_0xbb13('0x2b')]('Content-Range',_0x4348ae+'-'+_0x39d436+'/'+_0x4d3d89)[_0xbb13('0x27')](_0x5157fe);}return null;};}function patchUpdates(_0x1fbb8a){return function(_0x157bfb){try{jsonpatch[_0xbb13('0x2c')](_0x157bfb,_0x1fbb8a,!![]);}catch(_0x485b27){return BPromise[_0xbb13('0x2d')](_0x485b27);}return _0x157bfb['save']();};}function saveUpdates(_0x40b0d4,_0x1a1654){return function(_0x50d62f){if(_0x50d62f){return _0x50d62f[_0xbb13('0x2e')](_0x40b0d4)['then'](function(_0x338470){return _0x338470;});}return null;};}function removeEntity(_0x1fdfb0,_0x2192b0){return function(_0x1dd82b){if(_0x1dd82b){return _0x1dd82b[_0xbb13('0x2f')]()[_0xbb13('0x1b')](function(){_0x1fdfb0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4554a1,_0x396d09){return function(_0x45586f){if(!_0x45586f){_0x4554a1[_0xbb13('0x24')](0x194);}return _0x45586f;};}function handleError(_0x53853b,_0x5bd9e3){_0x5bd9e3=_0x5bd9e3||0x1f4;return function(_0x3b53ff){logger[_0xbb13('0x1d')](_0x3b53ff['stack']);if(_0x3b53ff[_0xbb13('0x30')]){delete _0x3b53ff['name'];}_0x53853b[_0xbb13('0x25')](_0x5bd9e3)[_0xbb13('0x31')](_0x3b53ff);};}exports['index']=function(_0x509708,_0x416737){var _0x399cc5={},_0x51e236={},_0x29e86d={'count':0x0,'rows':[]};var _0x33dd55=db[_0xbb13('0x32')][_0xbb13('0x33')];_0x51e236[_0xbb13('0x34')]=_[_0xbb13('0x35')](_0x33dd55);_0x51e236[_0xbb13('0x36')]=_[_0xbb13('0x35')](_0x509708[_0xbb13('0x36')]);_0x51e236[_0xbb13('0x37')]=_[_0xbb13('0x38')](_0x51e236[_0xbb13('0x34')],_0x51e236[_0xbb13('0x36')]);_0x399cc5['attributes']=_[_0xbb13('0x38')](_0x51e236['model'],qs['fields'](_0x509708[_0xbb13('0x36')][_0xbb13('0x39')]));_0x399cc5[_0xbb13('0x3a')]=_0x399cc5[_0xbb13('0x3a')]['length']?_0x399cc5[_0xbb13('0x3a')]:_0x51e236['model'];if(!_0x509708[_0xbb13('0x36')][_0xbb13('0x3b')](_0xbb13('0x3c'))){_0x399cc5[_0xbb13('0x2a')]=qs[_0xbb13('0x2a')](_0x509708[_0xbb13('0x36')][_0xbb13('0x2a')]);_0x399cc5[_0xbb13('0x29')]=qs[_0xbb13('0x29')](_0x509708[_0xbb13('0x36')][_0xbb13('0x29')]);}_0x399cc5['order']=qs['sort'](_0x509708[_0xbb13('0x36')][_0xbb13('0x3d')]);_0x399cc5[_0xbb13('0x3e')]=qs[_0xbb13('0x37')](_['pick'](_0x509708['query'],_0x51e236['filters']));if(_0x509708[_0xbb13('0x36')][_0xbb13('0x3f')]){_0x399cc5[_0xbb13('0x3e')]=_[_0xbb13('0x40')](_0x399cc5['where'],{'$or':_[_0xbb13('0x41')](_0x33dd55,function(_0x4d25f4){if(_0x4d25f4[_0xbb13('0x42')][_0xbb13('0x43')]!=='VIRTUAL'){var _0xbc5522={};_0xbc5522[_0x4d25f4[_0xbb13('0x44')]]={'$like':'%'+_0x509708[_0xbb13('0x36')][_0xbb13('0x3f')]+'%'};return _0xbc5522;}})});}_0x399cc5=_['merge']({},_0x399cc5,_0x509708[_0xbb13('0x45')]);var _0x22091d={'where':_0x399cc5[_0xbb13('0x3e')]};return db['VtigerConfiguration'][_0xbb13('0x28')](_0x22091d)[_0xbb13('0x1b')](function(_0x2195c8){_0x29e86d[_0xbb13('0x28')]=_0x2195c8;if(_0x509708[_0xbb13('0x36')][_0xbb13('0x46')]){_0x399cc5[_0xbb13('0x47')]=[{'all':!![]}];}return db[_0xbb13('0x32')][_0xbb13('0x48')](_0x399cc5);})[_0xbb13('0x1b')](function(_0x27f211){_0x29e86d[_0xbb13('0x49')]=_0x27f211;return _0x29e86d;})[_0xbb13('0x1b')](respondWithFilteredResult(_0x416737,_0x399cc5))['catch'](handleError(_0x416737,null));};exports[_0xbb13('0x4a')]=function(_0x418fb1,_0x19facf){var _0xd03995={'raw':![],'where':{'id':_0x418fb1[_0xbb13('0x4b')]['id']}},_0x42bea6={};_0x42bea6[_0xbb13('0x34')]=_['keys'](db[_0xbb13('0x32')][_0xbb13('0x33')]);_0x42bea6[_0xbb13('0x36')]=_[_0xbb13('0x35')](_0x418fb1[_0xbb13('0x36')]);_0x42bea6[_0xbb13('0x37')]=_[_0xbb13('0x38')](_0x42bea6[_0xbb13('0x34')],_0x42bea6[_0xbb13('0x36')]);_0xd03995[_0xbb13('0x3a')]=_[_0xbb13('0x38')](_0x42bea6[_0xbb13('0x34')],qs[_0xbb13('0x39')](_0x418fb1[_0xbb13('0x36')][_0xbb13('0x39')]));_0xd03995[_0xbb13('0x3a')]=_0xd03995[_0xbb13('0x3a')]['length']?_0xd03995[_0xbb13('0x3a')]:_0x42bea6[_0xbb13('0x34')];if(_0x418fb1[_0xbb13('0x36')][_0xbb13('0x46')]){_0xd03995[_0xbb13('0x47')]=[{'all':!![]}];}_0xd03995=_[_0xbb13('0x40')]({},_0xd03995,_0x418fb1[_0xbb13('0x45')]);return db[_0xbb13('0x32')][_0xbb13('0x4c')](_0xd03995)['then'](handleEntityNotFound(_0x19facf,null))[_0xbb13('0x1b')](respondWithResult(_0x19facf,null))[_0xbb13('0x23')](handleError(_0x19facf,null));};exports[_0xbb13('0x4d')]=function(_0x42d34b,_0x80c2a6){return db['VtigerConfiguration'][_0xbb13('0x4d')](_0x42d34b['body'],{})['then'](respondWithResult(_0x80c2a6,0xc9))[_0xbb13('0x23')](handleError(_0x80c2a6,null));};exports[_0xbb13('0x2e')]=function(_0x45ac80,_0x56fb7f){if(_0x45ac80['body']['id']){delete _0x45ac80['body']['id'];}return db[_0xbb13('0x32')][_0xbb13('0x4c')]({'where':{'id':_0x45ac80['params']['id']}})[_0xbb13('0x1b')](handleEntityNotFound(_0x56fb7f,null))[_0xbb13('0x1b')](saveUpdates(_0x45ac80[_0xbb13('0x4e')],null))[_0xbb13('0x1b')](respondWithResult(_0x56fb7f,null))[_0xbb13('0x23')](handleError(_0x56fb7f,null));};exports['destroy']=function(_0x3a664d,_0x590a9f){return db['VtigerConfiguration'][_0xbb13('0x4c')]({'where':{'id':_0x3a664d[_0xbb13('0x4b')]['id']}})[_0xbb13('0x1b')](handleEntityNotFound(_0x590a9f,null))[_0xbb13('0x1b')](removeEntity(_0x590a9f,null))[_0xbb13('0x23')](handleError(_0x590a9f,null));};exports[_0xbb13('0x4f')]=function(_0x47e944,_0x22040b,_0xab14f7){var _0x138322={};var _0x4485fe={};var _0xa837d4;var _0x231fa9;return db[_0xbb13('0x32')][_0xbb13('0x50')]({'where':{'id':_0x47e944['params']['id']}})[_0xbb13('0x1b')](handleEntityNotFound(_0x22040b,null))['then'](function(_0x58616a){if(_0x58616a){_0xa837d4=_0x58616a;_0x4485fe[_0xbb13('0x34')]=_[_0xbb13('0x35')](db['VtigerField'][_0xbb13('0x33')]);_0x4485fe[_0xbb13('0x36')]=_[_0xbb13('0x35')](_0x47e944['query']);_0x4485fe[_0xbb13('0x37')]=_[_0xbb13('0x38')](_0x4485fe[_0xbb13('0x34')],_0x4485fe[_0xbb13('0x36')]);_0x138322['attributes']=_[_0xbb13('0x38')](_0x4485fe[_0xbb13('0x34')],qs[_0xbb13('0x39')](_0x47e944['query']['fields']));_0x138322['attributes']=_0x138322['attributes'][_0xbb13('0x51')]?_0x138322[_0xbb13('0x3a')]:_0x4485fe[_0xbb13('0x34')];_0x138322[_0xbb13('0x52')]=qs[_0xbb13('0x3d')](_0x47e944[_0xbb13('0x36')]['sort']);_0x138322[_0xbb13('0x3e')]=qs['filters'](_[_0xbb13('0x53')](_0x47e944['query'],_0x4485fe[_0xbb13('0x37')]));if(_0x47e944['query'][_0xbb13('0x3f')]){_0x138322[_0xbb13('0x3e')]=_[_0xbb13('0x40')](_0x138322[_0xbb13('0x3e')],{'$or':_[_0xbb13('0x41')](_0x138322[_0xbb13('0x3a')],function(_0x443fe5){var _0x1e61cd={};_0x1e61cd[_0x443fe5]={'$like':'%'+_0x47e944[_0xbb13('0x36')][_0xbb13('0x3f')]+'%'};return _0x1e61cd;})});}_0x138322=_['merge']({},_0x138322,_0x47e944[_0xbb13('0x45')]);return _0xa837d4[_0xbb13('0x4f')](_0x138322);}})[_0xbb13('0x1b')](function(_0x28cdf2){if(_0x28cdf2){_0x231fa9=_0x28cdf2[_0xbb13('0x51')];if(!_0x47e944[_0xbb13('0x36')][_0xbb13('0x3b')](_0xbb13('0x3c'))){_0x138322[_0xbb13('0x2a')]=qs['limit'](_0x47e944[_0xbb13('0x36')]['limit']);_0x138322[_0xbb13('0x29')]=qs['offset'](_0x47e944[_0xbb13('0x36')][_0xbb13('0x29')]);}return _0xa837d4['getFields'](_0x138322);}})[_0xbb13('0x1b')](function(_0x532d85){if(_0x532d85){return _0x532d85?{'count':_0x231fa9,'rows':_0x532d85}:null;}})[_0xbb13('0x1b')](respondWithResult(_0x22040b,null))[_0xbb13('0x23')](handleError(_0x22040b,null));};exports[_0xbb13('0x54')]=function(_0x219de1,_0x3b28d4,_0x2c8c09){var _0x44ec8a={};var _0x491a32={};var _0x374c27;var _0x141f24;return db[_0xbb13('0x32')]['findOne']({'where':{'id':_0x219de1[_0xbb13('0x4b')]['id']}})[_0xbb13('0x1b')](handleEntityNotFound(_0x3b28d4,null))['then'](function(_0x41e16e){if(_0x41e16e){_0x374c27=_0x41e16e;_0x491a32[_0xbb13('0x34')]=_[_0xbb13('0x35')](db[_0xbb13('0x55')][_0xbb13('0x33')]);_0x491a32[_0xbb13('0x36')]=_[_0xbb13('0x35')](_0x219de1[_0xbb13('0x36')]);_0x491a32[_0xbb13('0x37')]=_[_0xbb13('0x38')](_0x491a32[_0xbb13('0x34')],_0x491a32['query']);_0x44ec8a[_0xbb13('0x3a')]=_['intersection'](_0x491a32['model'],qs['fields'](_0x219de1[_0xbb13('0x36')][_0xbb13('0x39')]));_0x44ec8a[_0xbb13('0x3a')]=_0x44ec8a[_0xbb13('0x3a')][_0xbb13('0x51')]?_0x44ec8a[_0xbb13('0x3a')]:_0x491a32[_0xbb13('0x34')];_0x44ec8a['order']=qs[_0xbb13('0x3d')](_0x219de1['query']['sort']);_0x44ec8a[_0xbb13('0x3e')]=qs['filters'](_[_0xbb13('0x53')](_0x219de1[_0xbb13('0x36')],_0x491a32[_0xbb13('0x37')]));if(_0x219de1[_0xbb13('0x36')][_0xbb13('0x3f')]){_0x44ec8a['where']=_['merge'](_0x44ec8a[_0xbb13('0x3e')],{'$or':_['map'](_0x44ec8a[_0xbb13('0x3a')],function(_0x24f781){var _0x5d6d28={};_0x5d6d28[_0x24f781]={'$like':'%'+_0x219de1[_0xbb13('0x36')][_0xbb13('0x3f')]+'%'};return _0x5d6d28;})});}_0x44ec8a=_[_0xbb13('0x40')]({},_0x44ec8a,_0x219de1['options']);return _0x374c27[_0xbb13('0x54')](_0x44ec8a);}})[_0xbb13('0x1b')](function(_0x582155){if(_0x582155){_0x141f24=_0x582155['length'];if(!_0x219de1['query'][_0xbb13('0x3b')](_0xbb13('0x3c'))){_0x44ec8a[_0xbb13('0x2a')]=qs[_0xbb13('0x2a')](_0x219de1[_0xbb13('0x36')][_0xbb13('0x2a')]);_0x44ec8a[_0xbb13('0x29')]=qs[_0xbb13('0x29')](_0x219de1[_0xbb13('0x36')][_0xbb13('0x29')]);}return _0x374c27[_0xbb13('0x54')](_0x44ec8a);}})[_0xbb13('0x1b')](function(_0x17108f){if(_0x17108f){return _0x17108f?{'count':_0x141f24,'rows':_0x17108f}:null;}})[_0xbb13('0x1b')](respondWithResult(_0x3b28d4,null))['catch'](handleError(_0x3b28d4,null));};exports[_0xbb13('0x56')]=function(_0x6828e3,_0x36ef38,_0x33aad1){var _0x36f0a0={};var _0x4be6a7={};var _0x5bb7a4;var _0x5b49a7;return db[_0xbb13('0x32')]['findOne']({'where':{'id':_0x6828e3['params']['id']}})[_0xbb13('0x1b')](handleEntityNotFound(_0x36ef38,null))['then'](function(_0x13d9fe){if(_0x13d9fe){_0x5bb7a4=_0x13d9fe;_0x4be6a7[_0xbb13('0x34')]=_[_0xbb13('0x35')](db[_0xbb13('0x55')][_0xbb13('0x33')]);_0x4be6a7[_0xbb13('0x36')]=_['keys'](_0x6828e3['query']);_0x4be6a7['filters']=_[_0xbb13('0x38')](_0x4be6a7[_0xbb13('0x34')],_0x4be6a7['query']);_0x36f0a0['attributes']=_[_0xbb13('0x38')](_0x4be6a7[_0xbb13('0x34')],qs['fields'](_0x6828e3[_0xbb13('0x36')][_0xbb13('0x39')]));_0x36f0a0[_0xbb13('0x3a')]=_0x36f0a0['attributes'][_0xbb13('0x51')]?_0x36f0a0[_0xbb13('0x3a')]:_0x4be6a7[_0xbb13('0x34')];_0x36f0a0[_0xbb13('0x52')]=qs[_0xbb13('0x3d')](_0x6828e3[_0xbb13('0x36')][_0xbb13('0x3d')]);_0x36f0a0[_0xbb13('0x3e')]=qs[_0xbb13('0x37')](_[_0xbb13('0x53')](_0x6828e3[_0xbb13('0x36')],_0x4be6a7[_0xbb13('0x37')]));if(_0x6828e3[_0xbb13('0x36')]['filter']){_0x36f0a0[_0xbb13('0x3e')]=_[_0xbb13('0x40')](_0x36f0a0[_0xbb13('0x3e')],{'$or':_[_0xbb13('0x41')](_0x36f0a0[_0xbb13('0x3a')],function(_0x30357c){var _0x5aacea={};_0x5aacea[_0x30357c]={'$like':'%'+_0x6828e3[_0xbb13('0x36')][_0xbb13('0x3f')]+'%'};return _0x5aacea;})});}_0x36f0a0=_[_0xbb13('0x40')]({},_0x36f0a0,_0x6828e3['options']);return _0x5bb7a4[_0xbb13('0x56')](_0x36f0a0);}})[_0xbb13('0x1b')](function(_0x16e956){if(_0x16e956){_0x5b49a7=_0x16e956[_0xbb13('0x51')];if(!_0x6828e3[_0xbb13('0x36')][_0xbb13('0x3b')](_0xbb13('0x3c'))){_0x36f0a0[_0xbb13('0x2a')]=qs[_0xbb13('0x2a')](_0x6828e3['query']['limit']);_0x36f0a0[_0xbb13('0x29')]=qs[_0xbb13('0x29')](_0x6828e3[_0xbb13('0x36')][_0xbb13('0x29')]);}return _0x5bb7a4[_0xbb13('0x56')](_0x36f0a0);}})[_0xbb13('0x1b')](function(_0x1e579b){if(_0x1e579b){return _0x1e579b?{'count':_0x5b49a7,'rows':_0x1e579b}:null;}})[_0xbb13('0x1b')](respondWithResult(_0x36ef38,null))[_0xbb13('0x23')](handleError(_0x36ef38,null));};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
index 5243ae4..a51ed80 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4217c2,_0x7b64a3){var _0x580b64=function(_0x309e9a){while(--_0x309e9a){_0x4217c2['push'](_0x4217c2['shift']());}};_0x580b64(++_0x7b64a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1c05b0,_0x2f6f89){var _0x311372=function(_0x196c6f){while(--_0x196c6f){_0x1c05b0['push'](_0x1c05b0['shift']());}};_0x311372(++_0x2f6f89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
index 7775be1..b3bb6b8 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9642=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x9642,0x13e));var _0x2964=function(_0x5a470d,_0x57b379){_0x5a470d=_0x5a470d-0x0;var _0x4bfc10=_0x9642[_0x5a470d];return _0x4bfc10;};'use strict';var _=require(_0x2964('0x0'));var util=require('util');var moment=require(_0x2964('0x1'));var BPromise=require(_0x2964('0x2'));var rs=require(_0x2964('0x3'));var fs=require('fs');var Redis=require(_0x2964('0x4'));var db=require(_0x2964('0x5'))['db'];var utils=require(_0x2964('0x6'));var logger=require('../../config/logger')(_0x2964('0x7'));var config=require(_0x2964('0x8'));var jayson=require(_0x2964('0x9'));var client=jayson[_0x2964('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x600e2a,_0x52d2ee,_0x5b0f39){return new BPromise(function(_0x414af9,_0x482970){return client[_0x2964('0xb')](_0x600e2a,_0x5b0f39)['then'](function(_0xf17ade){logger[_0x2964('0xc')](_0x2964('0xd'),_0x52d2ee,_0x2964('0xe'));logger['debug'](_0x2964('0xf'),_0x52d2ee,'request\x20sent',JSON[_0x2964('0x10')](_0xf17ade));if(_0xf17ade['error']){if(_0xf17ade[_0x2964('0x11')][_0x2964('0x12')]===0x1f4){logger[_0x2964('0x11')](_0x2964('0xd'),_0x52d2ee,_0xf17ade[_0x2964('0x11')][_0x2964('0x13')]);return _0x482970(_0xf17ade['error']['message']);}logger[_0x2964('0x11')](_0x2964('0xd'),_0x52d2ee,_0xf17ade[_0x2964('0x11')][_0x2964('0x13')]);return _0x414af9(_0xf17ade['error']['message']);}else{logger[_0x2964('0xc')](_0x2964('0xd'),_0x52d2ee,_0x2964('0xe'));_0x414af9(_0xf17ade['result']['message']);}})['catch'](function(_0x1f0937){logger[_0x2964('0x11')](_0x2964('0xd'),_0x52d2ee,_0x1f0937);_0x482970(_0x1f0937);});});}
\ No newline at end of file
+var _0x1977=['stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4e170e,_0x207e58){var _0x338291=function(_0x4cb198){while(--_0x4cb198){_0x4e170e['push'](_0x4e170e['shift']());}};_0x338291(++_0x207e58);}(_0x1977,0xae));var _0x7197=function(_0x1a1d95,_0x14e413){_0x1a1d95=_0x1a1d95-0x0;var _0x23b208=_0x1977[_0x1a1d95];return _0x23b208;};'use strict';var _=require('lodash');var util=require(_0x7197('0x0'));var moment=require(_0x7197('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7197('0x2'));var db=require(_0x7197('0x3'))['db'];var utils=require(_0x7197('0x4'));var logger=require(_0x7197('0x5'))('rpc');var config=require(_0x7197('0x6'));var jayson=require(_0x7197('0x7'));var client=jayson[_0x7197('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x119279,_0x359b48,_0xe2123f){return new BPromise(function(_0x39949b,_0x3579b4){return client[_0x7197('0x9')](_0x119279,_0xe2123f)[_0x7197('0xa')](function(_0x2f928b){logger['info'](_0x7197('0xb'),_0x359b48,_0x7197('0xc'));logger[_0x7197('0xd')](_0x7197('0xe'),_0x359b48,_0x7197('0xc'),JSON[_0x7197('0xf')](_0x2f928b));if(_0x2f928b[_0x7197('0x10')]){if(_0x2f928b[_0x7197('0x10')][_0x7197('0x11')]===0x1f4){logger['error'](_0x7197('0xb'),_0x359b48,_0x2f928b['error'][_0x7197('0x12')]);return _0x3579b4(_0x2f928b[_0x7197('0x10')][_0x7197('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x359b48,_0x2f928b[_0x7197('0x10')][_0x7197('0x12')]);return _0x39949b(_0x2f928b[_0x7197('0x10')][_0x7197('0x12')]);}else{logger['info'](_0x7197('0xb'),_0x359b48,_0x7197('0xc'));_0x39949b(_0x2f928b[_0x7197('0x13')][_0x7197('0x12')]);}})[_0x7197('0x14')](function(_0x11e779){logger['error'](_0x7197('0xb'),_0x359b48,_0x11e779);_0x3579b4(_0x11e779);});});}
\ No newline at end of file
diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js
index 9a4223a..edf1c28 100644
--- a/server/api/intVtigerField/index.js
+++ b/server/api/intVtigerField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb587=['put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','/:id','show','create'];(function(_0xf89c3,_0x351bf1){var _0x274fc8=function(_0x5e0c91){while(--_0x5e0c91){_0xf89c3['push'](_0xf89c3['shift']());}};_0x274fc8(++_0x351bf1);}(_0xb587,0x74));var _0x7b58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb587[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7b58('0x0'));var util=require(_0x7b58('0x1'));var path=require(_0x7b58('0x2'));var timeout=require(_0x7b58('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x7b58('0x4'));var interaction=require(_0x7b58('0x5'));var config=require(_0x7b58('0x6'));var controller=require(_0x7b58('0x7'));router['get']('/',auth[_0x7b58('0x8')](),controller['index']);router['get'](_0x7b58('0x9'),auth[_0x7b58('0x8')](),controller[_0x7b58('0xa')]);router['post']('/',auth[_0x7b58('0x8')](),controller[_0x7b58('0xb')]);router[_0x7b58('0xc')](_0x7b58('0x9'),auth[_0x7b58('0x8')](),controller[_0x7b58('0xd')]);router['delete'](_0x7b58('0x9'),auth[_0x7b58('0x8')](),controller[_0x7b58('0xe')]);module[_0x7b58('0xf')]=router;
\ No newline at end of file
+var _0xa7cf=['../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','multer','util','path','express','../../components/interaction/service'];(function(_0x4acac7,_0x3bae3b){var _0x538a97=function(_0x18a4bb){while(--_0x18a4bb){_0x4acac7['push'](_0x4acac7['shift']());}};_0x538a97(++_0x3bae3b);}(_0xa7cf,0xcb));var _0xfa7c=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0xa7cf[_0x32f9ca];return _0x52e083;};'use strict';var multer=require(_0xfa7c('0x0'));var util=require(_0xfa7c('0x1'));var path=require(_0xfa7c('0x2'));var timeout=require('connect-timeout');var express=require(_0xfa7c('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfa7c('0x4'));var config=require(_0xfa7c('0x5'));var controller=require(_0xfa7c('0x6'));router[_0xfa7c('0x7')]('/',auth[_0xfa7c('0x8')](),controller[_0xfa7c('0x9')]);router['get'](_0xfa7c('0xa'),auth[_0xfa7c('0x8')](),controller[_0xfa7c('0xb')]);router[_0xfa7c('0xc')]('/',auth['isAuthenticated'](),controller[_0xfa7c('0xd')]);router[_0xfa7c('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xfa7c('0xf')]);router['delete'](_0xfa7c('0xa'),auth[_0xfa7c('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js
index 7800a27..1cc49e5 100644
--- a/server/api/intVtigerField/intVtigerField.attributes.js
+++ b/server/api/intVtigerField/intVtigerField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3071('0x0')](_0x3071('0x1'),_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3071('0x5')]},'key':{'type':Sequelize[_0x3071('0x5')]},'keyType':{'type':Sequelize[_0x3071('0x0')](_0x3071('0x1'),_0x3071('0x2'),_0x3071('0x3'))},'keyContent':{'type':Sequelize[_0x3071('0x5')]},'idField':{'type':Sequelize[_0x3071('0x5')]},'nameField':{'type':Sequelize[_0x3071('0x5')]},'customField':{'type':Sequelize[_0x3071('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3071('0x5')]}};
\ No newline at end of file
+var _0x9bde=['BOOLEAN','exports','string','customVariable','keyValue','STRING','ENUM'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x9bde,0xe1));var _0xe9bd=function(_0x442ddc,_0x4b456d){_0x442ddc=_0x442ddc-0x0;var _0x1d231e=_0x9bde[_0x442ddc];return _0x1d231e;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'type':{'type':Sequelize['ENUM'](_0xe9bd('0x1'),'variable',_0xe9bd('0x2'),_0xe9bd('0x3')),'defaultValue':_0xe9bd('0x1')},'content':{'type':Sequelize[_0xe9bd('0x4')]},'key':{'type':Sequelize[_0xe9bd('0x4')]},'keyType':{'type':Sequelize[_0xe9bd('0x5')](_0xe9bd('0x1'),'variable',_0xe9bd('0x2'))},'keyContent':{'type':Sequelize[_0xe9bd('0x4')]},'idField':{'type':Sequelize[_0xe9bd('0x4')]},'nameField':{'type':Sequelize[_0xe9bd('0x4')]},'customField':{'type':Sequelize[_0xe9bd('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe9bd('0x4')]}};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js
index 00b2c5d..7477b97 100644
--- a/server/api/intVtigerField/intVtigerField.controller.js
+++ b/server/api/intVtigerField/intVtigerField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x24ca=['show','find','create','body','update','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','Content-Range','reject','save','then','destroy','end','error','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','options','VtigerField','count','includeAll','include','findAll','rows','catch'];(function(_0x53ca0a,_0x2264cc){var _0x457ff2=function(_0xde79b0){while(--_0xde79b0){_0x53ca0a['push'](_0x53ca0a['shift']());}};_0x457ff2(++_0x2264cc);}(_0x24ca,0x1bc));var _0xa24c=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x24ca[_0x11a220];return _0x20d8fe;};'use strict';var pdf=require(_0xa24c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa24c('0x1'));var zipdir=require(_0xa24c('0x2'));var jsonpatch=require(_0xa24c('0x3'));var rp=require('request-promise');var moment=require(_0xa24c('0x4'));var BPromise=require(_0xa24c('0x5'));var Mustache=require(_0xa24c('0x6'));var util=require(_0xa24c('0x7'));var path=require(_0xa24c('0x8'));var sox=require(_0xa24c('0x9'));var csv=require(_0xa24c('0xa'));var ejs=require(_0xa24c('0xb'));var fs=require('fs');var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0xa'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var hardwareService=require(_0xa24c('0x14'));var logger=require(_0xa24c('0x15'))(_0xa24c('0x16'));var utils=require(_0xa24c('0x17'));var config=require(_0xa24c('0x18'));var db=require(_0xa24c('0x19'))['db'];function respondWithStatusCode(_0x5aa811,_0x43bcd3){_0x43bcd3=_0x43bcd3||0xcc;return function(_0x11090c){if(_0x11090c){return _0x5aa811[_0xa24c('0x1a')](_0x43bcd3);}return _0x5aa811[_0xa24c('0x1b')](_0x43bcd3)['end']();};}function respondWithResult(_0x3ad0bf,_0x3c23fc){_0x3c23fc=_0x3c23fc||0xc8;return function(_0x26ff28){if(_0x26ff28){return _0x3ad0bf[_0xa24c('0x1b')](_0x3c23fc)[_0xa24c('0x1c')](_0x26ff28);}};}function respondWithFilteredResult(_0x2d185c,_0x448275){return function(_0x5d4727){if(_0x5d4727){var _0x47a063=_0x5d4727['count'],_0xb80781=_0x448275[_0xa24c('0x1d')],_0x87aa90=_0x448275[_0xa24c('0x1d')]+_0x448275['limit'],_0x49ce53;if(_0x87aa90>=_0x47a063){_0x87aa90=_0x47a063;_0x49ce53=0xc8;}else{_0x49ce53=0xce;}_0x2d185c[_0xa24c('0x1b')](_0x49ce53);return _0x2d185c['set'](_0xa24c('0x1e'),_0xb80781+'-'+_0x87aa90+'/'+_0x47a063)[_0xa24c('0x1c')](_0x5d4727);}return null;};}function patchUpdates(_0x1fcd4b){return function(_0xefdbd9){try{jsonpatch['apply'](_0xefdbd9,_0x1fcd4b,!![]);}catch(_0x16d363){return BPromise[_0xa24c('0x1f')](_0x16d363);}return _0xefdbd9[_0xa24c('0x20')]();};}function saveUpdates(_0x4d4bab,_0x48a768){return function(_0x506424){if(_0x506424){return _0x506424['update'](_0x4d4bab)[_0xa24c('0x21')](function(_0x174b69){return _0x174b69;});}return null;};}function removeEntity(_0x26e9c3,_0x180297){return function(_0x51a275){if(_0x51a275){return _0x51a275[_0xa24c('0x22')]()['then'](function(){_0x26e9c3[_0xa24c('0x1b')](0xcc)[_0xa24c('0x23')]();});}};}function handleEntityNotFound(_0x4a1cda,_0x346ee8){return function(_0x363d52){if(!_0x363d52){_0x4a1cda[_0xa24c('0x1a')](0x194);}return _0x363d52;};}function handleError(_0x188ee2,_0x14cc65){_0x14cc65=_0x14cc65||0x1f4;return function(_0x47e0eb){logger[_0xa24c('0x24')](_0x47e0eb['stack']);if(_0x47e0eb[_0xa24c('0x25')]){delete _0x47e0eb[_0xa24c('0x25')];}_0x188ee2[_0xa24c('0x1b')](_0x14cc65)['send'](_0x47e0eb);};}exports[_0xa24c('0x26')]=function(_0x31c4d9,_0x14fd5a){var _0x314121={},_0x11e4e0={},_0x3ad0e6={'count':0x0,'rows':[]};var _0x39609a=db['VtigerField'][_0xa24c('0x27')];_0x11e4e0[_0xa24c('0x28')]=_[_0xa24c('0x29')](_0x39609a);_0x11e4e0[_0xa24c('0x2a')]=_['keys'](_0x31c4d9[_0xa24c('0x2a')]);_0x11e4e0[_0xa24c('0x2b')]=_[_0xa24c('0x2c')](_0x11e4e0['model'],_0x11e4e0[_0xa24c('0x2a')]);_0x314121[_0xa24c('0x2d')]=_[_0xa24c('0x2c')](_0x11e4e0['model'],qs[_0xa24c('0x2e')](_0x31c4d9['query'][_0xa24c('0x2e')]));_0x314121[_0xa24c('0x2d')]=_0x314121[_0xa24c('0x2d')]['length']?_0x314121[_0xa24c('0x2d')]:_0x11e4e0[_0xa24c('0x28')];if(!_0x31c4d9[_0xa24c('0x2a')]['hasOwnProperty'](_0xa24c('0x2f'))){_0x314121['limit']=qs[_0xa24c('0x30')](_0x31c4d9[_0xa24c('0x2a')]['limit']);_0x314121['offset']=qs[_0xa24c('0x1d')](_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x1d')]);}_0x314121[_0xa24c('0x31')]=qs[_0xa24c('0x32')](_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x32')]);_0x314121['where']=qs[_0xa24c('0x2b')](_[_0xa24c('0x33')](_0x31c4d9[_0xa24c('0x2a')],_0x11e4e0[_0xa24c('0x2b')]));if(_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x34')]){_0x314121[_0xa24c('0x35')]=_[_0xa24c('0x36')](_0x314121[_0xa24c('0x35')],{'$or':_[_0xa24c('0x37')](_0x39609a,function(_0x4c7a30){if(_0x4c7a30[_0xa24c('0x38')][_0xa24c('0x39')]!==_0xa24c('0x3a')){var _0x1b0757={};_0x1b0757[_0x4c7a30['field']]={'$like':'%'+_0x31c4d9['query'][_0xa24c('0x34')]+'%'};return _0x1b0757;}})});}_0x314121=_['merge']({},_0x314121,_0x31c4d9[_0xa24c('0x3b')]);var _0x13f272={'where':_0x314121[_0xa24c('0x35')]};return db[_0xa24c('0x3c')][_0xa24c('0x3d')](_0x13f272)['then'](function(_0x532875){_0x3ad0e6[_0xa24c('0x3d')]=_0x532875;if(_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x3e')]){_0x314121[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x3c')][_0xa24c('0x40')](_0x314121);})['then'](function(_0x56f392){_0x3ad0e6[_0xa24c('0x41')]=_0x56f392;return _0x3ad0e6;})[_0xa24c('0x21')](respondWithFilteredResult(_0x14fd5a,_0x314121))[_0xa24c('0x42')](handleError(_0x14fd5a,null));};exports[_0xa24c('0x43')]=function(_0x43beff,_0x4c5b7e){var _0x171c51={'raw':!![],'where':{'id':_0x43beff['params']['id']}},_0x7895e={};_0x7895e['model']=_[_0xa24c('0x29')](db[_0xa24c('0x3c')][_0xa24c('0x27')]);_0x7895e['query']=_['keys'](_0x43beff[_0xa24c('0x2a')]);_0x7895e[_0xa24c('0x2b')]=_[_0xa24c('0x2c')](_0x7895e[_0xa24c('0x28')],_0x7895e[_0xa24c('0x2a')]);_0x171c51[_0xa24c('0x2d')]=_[_0xa24c('0x2c')](_0x7895e[_0xa24c('0x28')],qs['fields'](_0x43beff['query'][_0xa24c('0x2e')]));_0x171c51[_0xa24c('0x2d')]=_0x171c51[_0xa24c('0x2d')]['length']?_0x171c51[_0xa24c('0x2d')]:_0x7895e[_0xa24c('0x28')];if(_0x43beff[_0xa24c('0x2a')][_0xa24c('0x3e')]){_0x171c51[_0xa24c('0x3f')]=[{'all':!![]}];}_0x171c51=_[_0xa24c('0x36')]({},_0x171c51,_0x43beff[_0xa24c('0x3b')]);return db[_0xa24c('0x3c')][_0xa24c('0x44')](_0x171c51)[_0xa24c('0x21')](handleEntityNotFound(_0x4c5b7e,null))['then'](respondWithResult(_0x4c5b7e,null))[_0xa24c('0x42')](handleError(_0x4c5b7e,null));};exports[_0xa24c('0x45')]=function(_0x39a6cd,_0x5aa2b2){return db[_0xa24c('0x3c')][_0xa24c('0x45')](_0x39a6cd[_0xa24c('0x46')],{})[_0xa24c('0x21')](respondWithResult(_0x5aa2b2,0xc9))[_0xa24c('0x42')](handleError(_0x5aa2b2,null));};exports[_0xa24c('0x47')]=function(_0x1a20bd,_0x46f725){if(_0x1a20bd[_0xa24c('0x46')]['id']){delete _0x1a20bd[_0xa24c('0x46')]['id'];}return db[_0xa24c('0x3c')]['find']({'where':{'id':_0x1a20bd[_0xa24c('0x48')]['id']}})[_0xa24c('0x21')](handleEntityNotFound(_0x46f725,null))[_0xa24c('0x21')](saveUpdates(_0x1a20bd[_0xa24c('0x46')],null))[_0xa24c('0x21')](respondWithResult(_0x46f725,null))[_0xa24c('0x42')](handleError(_0x46f725,null));};exports[_0xa24c('0x22')]=function(_0x2250b9,_0x184179){return db['VtigerField']['find']({'where':{'id':_0x2250b9[_0xa24c('0x48')]['id']}})['then'](handleEntityNotFound(_0x184179,null))[_0xa24c('0x21')](removeEntity(_0x184179,null))[_0xa24c('0x42')](handleError(_0x184179,null));};
\ No newline at end of file
+var _0x1670=['params','rawAttributes','find','catch','create','body','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','set','apply','reject','save','update','then','error','stack','name','send','index','VtigerField','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','pick','filter','where','merge','map','type','VIRTUAL','field','options','include','findAll','rows','show'];(function(_0x5bd0cb,_0x39b3ad){var _0x53f1cd=function(_0x33cd02){while(--_0x33cd02){_0x5bd0cb['push'](_0x5bd0cb['shift']());}};_0x53f1cd(++_0x39b3ad);}(_0x1670,0x9a));var _0x0167=function(_0x287e0f,_0x5638e7){_0x287e0f=_0x287e0f-0x0;var _0x4dd42a=_0x1670[_0x287e0f];return _0x4dd42a;};'use strict';var pdf=require(_0x0167('0x0'));var emlformat=require(_0x0167('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0167('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0167('0x3'));var moment=require(_0x0167('0x4'));var BPromise=require(_0x0167('0x5'));var Mustache=require(_0x0167('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0167('0x7'));var csv=require(_0x0167('0x8'));var ejs=require(_0x0167('0x9'));var fs=require('fs');var _=require(_0x0167('0xa'));var squel=require(_0x0167('0xb'));var crypto=require(_0x0167('0xc'));var jsforce=require(_0x0167('0xd'));var deskjs=require(_0x0167('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0167('0xf'));var Redis=require(_0x0167('0x10'));var authService=require(_0x0167('0x11'));var qs=require(_0x0167('0x12'));var hardwareService=require(_0x0167('0x13'));var logger=require(_0x0167('0x14'))(_0x0167('0x15'));var utils=require(_0x0167('0x16'));var config=require(_0x0167('0x17'));var db=require(_0x0167('0x18'))['db'];function respondWithStatusCode(_0x88e059,_0x45810b){_0x45810b=_0x45810b||0xcc;return function(_0x34ac02){if(_0x34ac02){return _0x88e059[_0x0167('0x19')](_0x45810b);}return _0x88e059['status'](_0x45810b)[_0x0167('0x1a')]();};}function respondWithResult(_0x4e2c53,_0x25e5d4){_0x25e5d4=_0x25e5d4||0xc8;return function(_0x5eb5f9){if(_0x5eb5f9){return _0x4e2c53[_0x0167('0x1b')](_0x25e5d4)[_0x0167('0x1c')](_0x5eb5f9);}};}function respondWithFilteredResult(_0x3fc778,_0x57c0e0){return function(_0x50c1a3){if(_0x50c1a3){var _0x547dea=_0x50c1a3[_0x0167('0x1d')],_0x2eeaa7=_0x57c0e0['offset'],_0x7ae6e7=_0x57c0e0['offset']+_0x57c0e0[_0x0167('0x1e')],_0x4c4cc7;if(_0x7ae6e7>=_0x547dea){_0x7ae6e7=_0x547dea;_0x4c4cc7=0xc8;}else{_0x4c4cc7=0xce;}_0x3fc778['status'](_0x4c4cc7);return _0x3fc778[_0x0167('0x1f')]('Content-Range',_0x2eeaa7+'-'+_0x7ae6e7+'/'+_0x547dea)[_0x0167('0x1c')](_0x50c1a3);}return null;};}function patchUpdates(_0x2740b5){return function(_0x170207){try{jsonpatch[_0x0167('0x20')](_0x170207,_0x2740b5,!![]);}catch(_0xc3f9fe){return BPromise[_0x0167('0x21')](_0xc3f9fe);}return _0x170207[_0x0167('0x22')]();};}function saveUpdates(_0x3cd14f,_0x35ed6a){return function(_0x7c626){if(_0x7c626){return _0x7c626[_0x0167('0x23')](_0x3cd14f)[_0x0167('0x24')](function(_0x5ba3d0){return _0x5ba3d0;});}return null;};}function removeEntity(_0x1c47f2,_0xa9ae2d){return function(_0x2375ff){if(_0x2375ff){return _0x2375ff['destroy']()[_0x0167('0x24')](function(){_0x1c47f2[_0x0167('0x1b')](0xcc)[_0x0167('0x1a')]();});}};}function handleEntityNotFound(_0x3c0a58,_0x5d25df){return function(_0x38e811){if(!_0x38e811){_0x3c0a58['sendStatus'](0x194);}return _0x38e811;};}function handleError(_0x19e191,_0x20feab){_0x20feab=_0x20feab||0x1f4;return function(_0x36ffc7){logger[_0x0167('0x25')](_0x36ffc7[_0x0167('0x26')]);if(_0x36ffc7[_0x0167('0x27')]){delete _0x36ffc7[_0x0167('0x27')];}_0x19e191['status'](_0x20feab)[_0x0167('0x28')](_0x36ffc7);};}exports[_0x0167('0x29')]=function(_0x23a863,_0x4d9e86){var _0x11728b={},_0x12e14a={},_0x4d612f={'count':0x0,'rows':[]};var _0xda7d5f=db[_0x0167('0x2a')]['rawAttributes'];_0x12e14a[_0x0167('0x2b')]=_[_0x0167('0x2c')](_0xda7d5f);_0x12e14a[_0x0167('0x2d')]=_['keys'](_0x23a863[_0x0167('0x2d')]);_0x12e14a[_0x0167('0x2e')]=_['intersection'](_0x12e14a['model'],_0x12e14a[_0x0167('0x2d')]);_0x11728b[_0x0167('0x2f')]=_[_0x0167('0x30')](_0x12e14a[_0x0167('0x2b')],qs['fields'](_0x23a863['query'][_0x0167('0x31')]));_0x11728b['attributes']=_0x11728b['attributes'][_0x0167('0x32')]?_0x11728b[_0x0167('0x2f')]:_0x12e14a[_0x0167('0x2b')];if(!_0x23a863[_0x0167('0x2d')][_0x0167('0x33')](_0x0167('0x34'))){_0x11728b[_0x0167('0x1e')]=qs['limit'](_0x23a863['query'][_0x0167('0x1e')]);_0x11728b[_0x0167('0x35')]=qs[_0x0167('0x35')](_0x23a863[_0x0167('0x2d')][_0x0167('0x35')]);}_0x11728b[_0x0167('0x36')]=qs['sort'](_0x23a863[_0x0167('0x2d')]['sort']);_0x11728b['where']=qs[_0x0167('0x2e')](_[_0x0167('0x37')](_0x23a863[_0x0167('0x2d')],_0x12e14a['filters']));if(_0x23a863[_0x0167('0x2d')][_0x0167('0x38')]){_0x11728b[_0x0167('0x39')]=_[_0x0167('0x3a')](_0x11728b['where'],{'$or':_[_0x0167('0x3b')](_0xda7d5f,function(_0x355070){if(_0x355070[_0x0167('0x3c')]['key']!==_0x0167('0x3d')){var _0x98ac41={};_0x98ac41[_0x355070[_0x0167('0x3e')]]={'$like':'%'+_0x23a863[_0x0167('0x2d')][_0x0167('0x38')]+'%'};return _0x98ac41;}})});}_0x11728b=_['merge']({},_0x11728b,_0x23a863[_0x0167('0x3f')]);var _0x20c182={'where':_0x11728b['where']};return db[_0x0167('0x2a')][_0x0167('0x1d')](_0x20c182)[_0x0167('0x24')](function(_0x1399e2){_0x4d612f[_0x0167('0x1d')]=_0x1399e2;if(_0x23a863[_0x0167('0x2d')]['includeAll']){_0x11728b[_0x0167('0x40')]=[{'all':!![]}];}return db[_0x0167('0x2a')][_0x0167('0x41')](_0x11728b);})[_0x0167('0x24')](function(_0x49dc4d){_0x4d612f[_0x0167('0x42')]=_0x49dc4d;return _0x4d612f;})[_0x0167('0x24')](respondWithFilteredResult(_0x4d9e86,_0x11728b))['catch'](handleError(_0x4d9e86,null));};exports[_0x0167('0x43')]=function(_0x3c393a,_0x3a22f7){var _0x4aec07={'raw':!![],'where':{'id':_0x3c393a[_0x0167('0x44')]['id']}},_0xd9dfc={};_0xd9dfc[_0x0167('0x2b')]=_[_0x0167('0x2c')](db[_0x0167('0x2a')][_0x0167('0x45')]);_0xd9dfc[_0x0167('0x2d')]=_[_0x0167('0x2c')](_0x3c393a['query']);_0xd9dfc[_0x0167('0x2e')]=_['intersection'](_0xd9dfc[_0x0167('0x2b')],_0xd9dfc[_0x0167('0x2d')]);_0x4aec07[_0x0167('0x2f')]=_['intersection'](_0xd9dfc['model'],qs['fields'](_0x3c393a[_0x0167('0x2d')][_0x0167('0x31')]));_0x4aec07[_0x0167('0x2f')]=_0x4aec07[_0x0167('0x2f')][_0x0167('0x32')]?_0x4aec07[_0x0167('0x2f')]:_0xd9dfc['model'];if(_0x3c393a['query']['includeAll']){_0x4aec07[_0x0167('0x40')]=[{'all':!![]}];}_0x4aec07=_['merge']({},_0x4aec07,_0x3c393a[_0x0167('0x3f')]);return db[_0x0167('0x2a')][_0x0167('0x46')](_0x4aec07)[_0x0167('0x24')](handleEntityNotFound(_0x3a22f7,null))['then'](respondWithResult(_0x3a22f7,null))[_0x0167('0x47')](handleError(_0x3a22f7,null));};exports[_0x0167('0x48')]=function(_0x205721,_0x431cb7){return db[_0x0167('0x2a')][_0x0167('0x48')](_0x205721[_0x0167('0x49')],{})[_0x0167('0x24')](respondWithResult(_0x431cb7,0xc9))[_0x0167('0x47')](handleError(_0x431cb7,null));};exports[_0x0167('0x23')]=function(_0x5732ac,_0x4b4385){if(_0x5732ac[_0x0167('0x49')]['id']){delete _0x5732ac['body']['id'];}return db[_0x0167('0x2a')]['find']({'where':{'id':_0x5732ac[_0x0167('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b4385,null))[_0x0167('0x24')](saveUpdates(_0x5732ac[_0x0167('0x49')],null))['then'](respondWithResult(_0x4b4385,null))['catch'](handleError(_0x4b4385,null));};exports['destroy']=function(_0x174a7a,_0x55aaa0){return db['VtigerField'][_0x0167('0x46')]({'where':{'id':_0x174a7a['params']['id']}})[_0x0167('0x24')](handleEntityNotFound(_0x55aaa0,null))[_0x0167('0x24')](removeEntity(_0x55aaa0,null))[_0x0167('0x47')](handleError(_0x55aaa0,null));};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js
index e17e3a5..d5a7389 100644
--- a/server/api/intVtigerField/intVtigerField.model.js
+++ b/server/api/intVtigerField/intVtigerField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c1f=['VtigerField','vtiger_unique_index','idField','FieldId','util','../../config/logger','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','exports','define'];(function(_0x11a5f0,_0x1f323b){var _0x14be6a=function(_0x3135b6){while(--_0x3135b6){_0x11a5f0['push'](_0x11a5f0['shift']());}};_0x14be6a(++_0x1f323b);}(_0x3c1f,0x170));var _0xf3c1=function(_0x28cf9c,_0x5bfe56){_0x28cf9c=_0x28cf9c-0x0;var _0x29abdd=_0x3c1f[_0x28cf9c];return _0x29abdd;};'use strict';var _=require('lodash');var util=require(_0xf3c1('0x0'));var logger=require(_0xf3c1('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf3c1('0x2'));var rp=require(_0xf3c1('0x3'));var fs=require('fs');var path=require(_0xf3c1('0x4'));var rimraf=require(_0xf3c1('0x5'));var config=require('../../config/environment');var attributes=require(_0xf3c1('0x6'));module[_0xf3c1('0x7')]=function(_0x197330,_0x4b4bec){return _0x197330[_0xf3c1('0x8')](_0xf3c1('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xf3c1('0xa'),'fields':[_0xf3c1('0xb'),_0xf3c1('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3759=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash'];(function(_0xe5337a,_0x122384){var _0x5f2bc6=function(_0x4753df){while(--_0x4753df){_0xe5337a['push'](_0xe5337a['shift']());}};_0x5f2bc6(++_0x122384);}(_0x3759,0x1b1));var _0x9375=function(_0x2e361e,_0x49d80a){_0x2e361e=_0x2e361e-0x0;var _0x2cca08=_0x3759[_0x2e361e];return _0x2cca08;};'use strict';var _=require(_0x9375('0x0'));var util=require(_0x9375('0x1'));var logger=require('../../config/logger')(_0x9375('0x2'));var moment=require(_0x9375('0x3'));var BPromise=require(_0x9375('0x4'));var rp=require(_0x9375('0x5'));var fs=require('fs');var path=require(_0x9375('0x6'));var rimraf=require(_0x9375('0x7'));var config=require(_0x9375('0x8'));var attributes=require(_0x9375('0x9'));module['exports']=function(_0x28f9a1,_0x167780){return _0x28f9a1['define'](_0x9375('0xa'),attributes,{'tableName':_0x9375('0xb'),'paranoid':![],'indexes':[{'name':_0x9375('0xc'),'fields':['idField',_0x9375('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js
index bec753a..121238f 100644
--- a/server/api/intVtigerField/intVtigerField.rpc.js
+++ b/server/api/intVtigerField/intVtigerField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x79e8=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x112cd5,_0x192331){var _0x4523ef=function(_0x543888){while(--_0x543888){_0x112cd5['push'](_0x112cd5['shift']());}};_0x4523ef(++_0x192331);}(_0x79e8,0x1c8));var _0x879e=function(_0x5da648,_0x488b53){_0x5da648=_0x5da648-0x0;var _0x8f765d=_0x79e8[_0x5da648];return _0x8f765d;};'use strict';var _=require(_0x879e('0x0'));var util=require(_0x879e('0x1'));var moment=require(_0x879e('0x2'));var BPromise=require(_0x879e('0x3'));var rs=require(_0x879e('0x4'));var fs=require('fs');var Redis=require(_0x879e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x879e('0x6'))('rpc');var config=require(_0x879e('0x7'));var jayson=require(_0x879e('0x8'));var client=jayson['client'][_0x879e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x967957,_0x1aae1e,_0x148095){return new BPromise(function(_0x1bbd70,_0xd35aa){return client[_0x879e('0xa')](_0x967957,_0x148095)[_0x879e('0xb')](function(_0x20f4cf){logger[_0x879e('0xc')](_0x879e('0xd'),_0x1aae1e,_0x879e('0xe'));logger[_0x879e('0xf')](_0x879e('0x10'),_0x1aae1e,_0x879e('0xe'),JSON['stringify'](_0x20f4cf));if(_0x20f4cf[_0x879e('0x11')]){if(_0x20f4cf[_0x879e('0x11')][_0x879e('0x12')]===0x1f4){logger['error'](_0x879e('0xd'),_0x1aae1e,_0x20f4cf[_0x879e('0x11')][_0x879e('0x13')]);return _0xd35aa(_0x20f4cf[_0x879e('0x11')]['message']);}logger['error']('VtigerField,\x20%s,\x20%s',_0x1aae1e,_0x20f4cf[_0x879e('0x11')][_0x879e('0x13')]);return _0x1bbd70(_0x20f4cf[_0x879e('0x11')]['message']);}else{logger['info'](_0x879e('0xd'),_0x1aae1e,_0x879e('0xe'));_0x1bbd70(_0x20f4cf[_0x879e('0x14')][_0x879e('0x13')]);}})[_0x879e('0x15')](function(_0x1d76c2){logger[_0x879e('0x11')](_0x879e('0xd'),_0x1aae1e,_0x1d76c2);_0xd35aa(_0x1d76c2);});});}
\ No newline at end of file
+var _0x10ef=['../../config/logger','rpc','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x10ef,0x9b));var _0xf10e=function(_0x5870ce,_0x347c07){_0x5870ce=_0x5870ce-0x0;var _0x2d45fc=_0x10ef[_0x5870ce];return _0x2d45fc;};'use strict';var _=require(_0xf10e('0x0'));var util=require(_0xf10e('0x1'));var moment=require(_0xf10e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf10e('0x3'));var fs=require('fs');var Redis=require(_0xf10e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf10e('0x5'));var logger=require(_0xf10e('0x6'))(_0xf10e('0x7'));var config=require('../../config/environment');var jayson=require(_0xf10e('0x8'));var client=jayson[_0xf10e('0x9')][_0xf10e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d8385,_0x28d965,_0x42614f){return new BPromise(function(_0x2010b4,_0x2a2835){return client[_0xf10e('0xb')](_0x5d8385,_0x42614f)[_0xf10e('0xc')](function(_0x1a75dd){logger['info'](_0xf10e('0xd'),_0x28d965,'request\x20sent');logger[_0xf10e('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x28d965,_0xf10e('0xf'),JSON[_0xf10e('0x10')](_0x1a75dd));if(_0x1a75dd[_0xf10e('0x11')]){if(_0x1a75dd[_0xf10e('0x11')][_0xf10e('0x12')]===0x1f4){logger[_0xf10e('0x11')](_0xf10e('0xd'),_0x28d965,_0x1a75dd[_0xf10e('0x11')][_0xf10e('0x13')]);return _0x2a2835(_0x1a75dd[_0xf10e('0x11')][_0xf10e('0x13')]);}logger[_0xf10e('0x11')]('VtigerField,\x20%s,\x20%s',_0x28d965,_0x1a75dd[_0xf10e('0x11')][_0xf10e('0x13')]);return _0x2010b4(_0x1a75dd[_0xf10e('0x11')][_0xf10e('0x13')]);}else{logger[_0xf10e('0x14')](_0xf10e('0xd'),_0x28d965,_0xf10e('0xf'));_0x2010b4(_0x1a75dd[_0xf10e('0x15')][_0xf10e('0x13')]);}})[_0xf10e('0x16')](function(_0x54904b){logger['error']('VtigerField,\x20%s,\x20%s',_0x28d965,_0x54904b);_0x2a2835(_0x54904b);});});}
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js
index ac8dc73..2179ea5 100644
--- a/server/api/intZendeskAccount/index.js
+++ b/server/api/intZendeskAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xddd6=['Router','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','/:id/configurations','post','addConfiguration','put','/:id','destroy','exports','multer','path','connect-timeout','express'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0xddd6,0x12e));var _0x6ddd=function(_0x4cde1b,_0x28c2bc){_0x4cde1b=_0x4cde1b-0x0;var _0x394e8e=_0xddd6[_0x4cde1b];return _0x394e8e;};'use strict';var multer=require(_0x6ddd('0x0'));var util=require('util');var path=require(_0x6ddd('0x1'));var timeout=require(_0x6ddd('0x2'));var express=require(_0x6ddd('0x3'));var router=express[_0x6ddd('0x4')]();var auth=require(_0x6ddd('0x5'));var interaction=require(_0x6ddd('0x6'));var config=require('../../config/environment');var controller=require(_0x6ddd('0x7'));router[_0x6ddd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x6ddd('0x9')](),controller['show']);router[_0x6ddd('0x8')](_0x6ddd('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x6ddd('0x8')]('/:id/fields',auth[_0x6ddd('0x9')](),controller['getFields']);router[_0x6ddd('0xb')]('/',auth[_0x6ddd('0x9')](),controller['create']);router[_0x6ddd('0xb')](_0x6ddd('0xa'),auth[_0x6ddd('0x9')](),controller[_0x6ddd('0xc')]);router[_0x6ddd('0xd')](_0x6ddd('0xe'),auth[_0x6ddd('0x9')](),controller['update']);router['delete'](_0x6ddd('0xe'),auth[_0x6ddd('0x9')](),controller[_0x6ddd('0xf')]);module[_0x6ddd('0x10')]=router;
\ No newline at end of file
+var _0x68a9=['../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x149fa2,_0x3d1347){var _0x2f0a06=function(_0x4277f1){while(--_0x4277f1){_0x149fa2['push'](_0x149fa2['shift']());}};_0x2f0a06(++_0x3d1347);}(_0x68a9,0xf6));var _0x968a=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x68a9[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x968a('0x0'));var path=require(_0x968a('0x1'));var timeout=require(_0x968a('0x2'));var express=require(_0x968a('0x3'));var router=express[_0x968a('0x4')]();var auth=require(_0x968a('0x5'));var interaction=require(_0x968a('0x6'));var config=require(_0x968a('0x7'));var controller=require(_0x968a('0x8'));router['get']('/',auth[_0x968a('0x9')](),controller[_0x968a('0xa')]);router[_0x968a('0xb')](_0x968a('0xc'),auth[_0x968a('0x9')](),controller['show']);router[_0x968a('0xb')](_0x968a('0xd'),auth[_0x968a('0x9')](),controller[_0x968a('0xe')]);router[_0x968a('0xb')](_0x968a('0xf'),auth[_0x968a('0x9')](),controller['getFields']);router['post']('/',auth[_0x968a('0x9')](),controller[_0x968a('0x10')]);router[_0x968a('0x11')](_0x968a('0xd'),auth[_0x968a('0x9')](),controller[_0x968a('0x12')]);router[_0x968a('0x13')](_0x968a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x968a('0x14')](_0x968a('0xc'),auth['isAuthenticated'](),controller[_0x968a('0x15')]);module[_0x968a('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js
index 459f130..9febcfe 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.attributes.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4bff=['STRING','username','remoteUri','ENUM','password','integrationTab'];(function(_0x4f8b44,_0x4eda31){var _0x45727b=function(_0x566b10){while(--_0x566b10){_0x4f8b44['push'](_0x4f8b44['shift']());}};_0x45727b(++_0x4eda31);}(_0x4bff,0x84));var _0xf4bf=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x4bff[_0x16771d];return _0x386f11;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf4bf('0x0')]},'description':{'type':Sequelize[_0xf4bf('0x0')]},'username':{'type':Sequelize[_0xf4bf('0x0')],'unique':_0xf4bf('0x1')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf4bf('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xf4bf('0x2')},'authType':{'type':Sequelize[_0xf4bf('0x3')](_0xf4bf('0x4'),'token'),'defaultValue':_0xf4bf('0x4')},'serverUrl':{'type':Sequelize[_0xf4bf('0x0')]},'type':{'type':Sequelize[_0xf4bf('0x3')](_0xf4bf('0x5'),'newTab'),'defaultValue':_0xf4bf('0x5')}};
\ No newline at end of file
+var _0x4169=['username','remoteUri','ENUM','password','token','integrationTab','exports','STRING'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0x4169,0x14e));var _0x9416=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4169[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x9416('0x0')]={'name':{'type':Sequelize[_0x9416('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9416('0x1')],'unique':_0x9416('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x9416('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9416('0x3')},'authType':{'type':Sequelize[_0x9416('0x4')](_0x9416('0x5'),_0x9416('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x9416('0x1')]},'type':{'type':Sequelize['ENUM'](_0x9416('0x7'),'newTab'),'defaultValue':_0x9416('0x7')}};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js
index 5328c99..0ecb3f9 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.controller.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7836=['Descriptions','username','token','authType','remoteUri','slice','substring','lastIndexOf','%s/%s','ticket_fields','password','headers','format','toString','Basic\x20%s','%s/token:%s','base64','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','status','count','offset','set','Content-Range','json','reject','save','update','destroy','end','stack','name','send','index','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','ZendeskAccount','includeAll','include','rows','show','rawAttributes','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','filters','map','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x7836,0x123));var _0x6783=function(_0x57d232,_0x1eb10c){_0x57d232=_0x57d232-0x0;var _0x4c7e6d=_0x7836[_0x57d232];return _0x4c7e6d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6783('0x0'));var rimraf=require(_0x6783('0x1'));var zipdir=require(_0x6783('0x2'));var jsonpatch=require(_0x6783('0x3'));var rp=require(_0x6783('0x4'));var moment=require(_0x6783('0x5'));var BPromise=require(_0x6783('0x6'));var Mustache=require(_0x6783('0x7'));var util=require(_0x6783('0x8'));var path=require('path');var sox=require(_0x6783('0x9'));var csv=require('to-csv');var ejs=require(_0x6783('0xa'));var fs=require('fs');var _=require(_0x6783('0xb'));var squel=require('squel');var crypto=require(_0x6783('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6783('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6783('0xe'));var Papa=require(_0x6783('0xf'));var Redis=require(_0x6783('0x10'));var authService=require(_0x6783('0x11'));var qs=require(_0x6783('0x12'));var hardwareService=require(_0x6783('0x13'));var logger=require('../../config/logger')(_0x6783('0x14'));var utils=require(_0x6783('0x15'));var config=require(_0x6783('0x16'));var db=require(_0x6783('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x6783('0x18'));var client=jayson['client'][_0x6783('0x19')]({'port':0x232a});function checkPasswordPattern(_0xb3fc21,_0x62e6e0,_0x18a5f8){if(_0x18a5f8){var _0x3a2482=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a2482[_0x6783('0x1a')](_0x62e6e0)){return _0xb3fc21;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xb3fc21;}}function respondWithRpcPromise(_0x391ad6,_0x478ccf,_0x15231d,_0x2d7ce9){return new BPromise(function(_0x2cce8b,_0x3d877e){var _0x21384d=_0x2d7ce9||client;return _0x21384d[_0x6783('0x1b')](_0x391ad6,_0x15231d)[_0x6783('0x1c')](function(_0x1b019c){logger[_0x6783('0x1d')]('ZendeskAccount,\x20%s,\x20%s',_0x478ccf,_0x6783('0x1e'));logger[_0x6783('0x1f')](_0x6783('0x20'),_0x478ccf,_0x6783('0x1e'),JSON[_0x6783('0x21')](_0x1b019c));if(_0x1b019c[_0x6783('0x22')]){if(_0x1b019c['error'][_0x6783('0x23')]===0x1f4){logger[_0x6783('0x22')](_0x6783('0x24'),_0x478ccf,_0x1b019c[_0x6783('0x22')][_0x6783('0x25')]);return _0x3d877e(_0x1b019c[_0x6783('0x22')][_0x6783('0x25')]);}logger[_0x6783('0x22')](_0x6783('0x24'),_0x478ccf,_0x1b019c[_0x6783('0x22')]['message']);return _0x2cce8b(_0x1b019c[_0x6783('0x22')][_0x6783('0x25')]);}else{logger[_0x6783('0x1d')](_0x6783('0x24'),_0x478ccf,'request\x20sent');_0x2cce8b(_0x1b019c[_0x6783('0x26')]['message']);}})[_0x6783('0x27')](function(_0xd2c02){logger[_0x6783('0x22')](_0x6783('0x24'),_0x478ccf,_0xd2c02);_0x3d877e(_0xd2c02);});});}function respondWithStatusCode(_0x3743ef,_0x503086){_0x503086=_0x503086||0xcc;return function(_0x247c17){if(_0x247c17){return _0x3743ef['sendStatus'](_0x503086);}return _0x3743ef[_0x6783('0x28')](_0x503086)['end']();};}function respondWithResult(_0x4f8f1d,_0x239d6e){_0x239d6e=_0x239d6e||0xc8;return function(_0x61f2b9){if(_0x61f2b9){return _0x4f8f1d['status'](_0x239d6e)['json'](_0x61f2b9);}};}function respondWithFilteredResult(_0x3157bc,_0x1729a4){return function(_0x3011a7){if(_0x3011a7){var _0x1d5066=_0x3011a7[_0x6783('0x29')],_0x23d4fa=_0x1729a4['offset'],_0x4bc865=_0x1729a4[_0x6783('0x2a')]+_0x1729a4['limit'],_0x4c10a9;if(_0x4bc865>=_0x1d5066){_0x4bc865=_0x1d5066;_0x4c10a9=0xc8;}else{_0x4c10a9=0xce;}_0x3157bc[_0x6783('0x28')](_0x4c10a9);return _0x3157bc[_0x6783('0x2b')](_0x6783('0x2c'),_0x23d4fa+'-'+_0x4bc865+'/'+_0x1d5066)[_0x6783('0x2d')](_0x3011a7);}return null;};}function patchUpdates(_0x4c6a37){return function(_0x2f4bff){try{jsonpatch['apply'](_0x2f4bff,_0x4c6a37,!![]);}catch(_0x366d40){return BPromise[_0x6783('0x2e')](_0x366d40);}return _0x2f4bff[_0x6783('0x2f')]();};}function saveUpdates(_0xea4c15,_0x5d853a){return function(_0x408b65){if(_0x408b65){return _0x408b65[_0x6783('0x30')](_0xea4c15)[_0x6783('0x1c')](function(_0x33ee06){return _0x33ee06;});}return null;};}function removeEntity(_0x17e45d,_0xd9b963){return function(_0x5085f4){if(_0x5085f4){return _0x5085f4[_0x6783('0x31')]()['then'](function(){_0x17e45d[_0x6783('0x28')](0xcc)[_0x6783('0x32')]();});}};}function handleEntityNotFound(_0x1efebe,_0x2e23e8){return function(_0x52a078){if(!_0x52a078){_0x1efebe['sendStatus'](0x194);}return _0x52a078;};}function handleError(_0x521427,_0x2af97b){_0x2af97b=_0x2af97b||0x1f4;return function(_0x24da57){logger[_0x6783('0x22')](_0x24da57[_0x6783('0x33')]);if(_0x24da57['name']){delete _0x24da57[_0x6783('0x34')];}_0x521427['status'](_0x2af97b)[_0x6783('0x35')](_0x24da57);};}exports[_0x6783('0x36')]=function(_0x472f74,_0x2d121a){var _0x55b6cd={},_0x346109={},_0x2bf029={'count':0x0,'rows':[]};var _0x54335e=db['ZendeskAccount']['rawAttributes'];_0x346109[_0x6783('0x37')]=_['keys'](_0x54335e);_0x346109[_0x6783('0x38')]=_[_0x6783('0x39')](_0x472f74[_0x6783('0x38')]);_0x346109['filters']=_['intersection'](_0x346109[_0x6783('0x37')],_0x346109[_0x6783('0x38')]);_0x55b6cd[_0x6783('0x3a')]=_[_0x6783('0x3b')](_0x346109[_0x6783('0x37')],qs[_0x6783('0x3c')](_0x472f74[_0x6783('0x38')]['fields']));_0x55b6cd[_0x6783('0x3a')]=_0x55b6cd[_0x6783('0x3a')][_0x6783('0x3d')]?_0x55b6cd[_0x6783('0x3a')]:_0x346109['model'];if(!_0x472f74[_0x6783('0x38')][_0x6783('0x3e')](_0x6783('0x3f'))){_0x55b6cd['limit']=qs[_0x6783('0x40')](_0x472f74['query'][_0x6783('0x40')]);_0x55b6cd[_0x6783('0x2a')]=qs[_0x6783('0x2a')](_0x472f74['query'][_0x6783('0x2a')]);}_0x55b6cd[_0x6783('0x41')]=qs[_0x6783('0x42')](_0x472f74['query']['sort']);_0x55b6cd[_0x6783('0x43')]=qs['filters'](_[_0x6783('0x44')](_0x472f74[_0x6783('0x38')],_0x346109['filters']));if(_0x472f74[_0x6783('0x38')][_0x6783('0x45')]){_0x55b6cd[_0x6783('0x43')]=_[_0x6783('0x46')](_0x55b6cd[_0x6783('0x43')],{'$or':_['map'](_0x54335e,function(_0x1bbcd8){if(_0x1bbcd8[_0x6783('0x47')][_0x6783('0x48')]!==_0x6783('0x49')){var _0x222426={};_0x222426[_0x1bbcd8['field']]={'$like':'%'+_0x472f74[_0x6783('0x38')][_0x6783('0x45')]+'%'};return _0x222426;}})});}_0x55b6cd=_[_0x6783('0x46')]({},_0x55b6cd,_0x472f74[_0x6783('0x4a')]);var _0x4641d4={'where':_0x55b6cd['where']};return db[_0x6783('0x4b')][_0x6783('0x29')](_0x4641d4)['then'](function(_0x4d850c){_0x2bf029[_0x6783('0x29')]=_0x4d850c;if(_0x472f74[_0x6783('0x38')][_0x6783('0x4c')]){_0x55b6cd[_0x6783('0x4d')]=[{'all':!![]}];}return db[_0x6783('0x4b')]['findAll'](_0x55b6cd);})[_0x6783('0x1c')](function(_0x1ec033){_0x2bf029[_0x6783('0x4e')]=_0x1ec033;return _0x2bf029;})['then'](respondWithFilteredResult(_0x2d121a,_0x55b6cd))[_0x6783('0x27')](handleError(_0x2d121a,null));};exports[_0x6783('0x4f')]=function(_0x2295d0,_0x36bea4){var _0x4a51e9={'raw':![],'where':{'id':_0x2295d0['params']['id']}},_0x4aa0ea={};_0x4aa0ea[_0x6783('0x37')]=_[_0x6783('0x39')](db[_0x6783('0x4b')][_0x6783('0x50')]);_0x4aa0ea[_0x6783('0x38')]=_[_0x6783('0x39')](_0x2295d0['query']);_0x4aa0ea['filters']=_[_0x6783('0x3b')](_0x4aa0ea[_0x6783('0x37')],_0x4aa0ea[_0x6783('0x38')]);_0x4a51e9['attributes']=_['intersection'](_0x4aa0ea[_0x6783('0x37')],qs[_0x6783('0x3c')](_0x2295d0[_0x6783('0x38')][_0x6783('0x3c')]));_0x4a51e9[_0x6783('0x3a')]=_0x4a51e9['attributes'][_0x6783('0x3d')]?_0x4a51e9[_0x6783('0x3a')]:_0x4aa0ea['model'];if(_0x2295d0[_0x6783('0x38')][_0x6783('0x4c')]){_0x4a51e9[_0x6783('0x4d')]=[{'all':!![]}];}_0x4a51e9=_[_0x6783('0x46')]({},_0x4a51e9,_0x2295d0[_0x6783('0x4a')]);return db[_0x6783('0x4b')][_0x6783('0x51')](_0x4a51e9)['then'](handleEntityNotFound(_0x36bea4,null))[_0x6783('0x1c')](respondWithResult(_0x36bea4,null))[_0x6783('0x27')](handleError(_0x36bea4,null));};exports['create']=function(_0x1792a8,_0xc17a15){return db['ZendeskAccount'][_0x6783('0x52')](_0x1792a8[_0x6783('0x53')],{})[_0x6783('0x1c')](respondWithResult(_0xc17a15,0xc9))[_0x6783('0x27')](handleError(_0xc17a15,null));};exports[_0x6783('0x30')]=function(_0x550301,_0x4b08c2){if(_0x550301[_0x6783('0x53')]['id']){delete _0x550301[_0x6783('0x53')]['id'];}return db[_0x6783('0x4b')][_0x6783('0x51')]({'where':{'id':_0x550301['params']['id']}})[_0x6783('0x1c')](handleEntityNotFound(_0x4b08c2,null))['then'](saveUpdates(_0x550301[_0x6783('0x53')],null))[_0x6783('0x1c')](respondWithResult(_0x4b08c2,null))[_0x6783('0x27')](handleError(_0x4b08c2,null));};exports[_0x6783('0x31')]=function(_0x479f17,_0x30a60b){return db[_0x6783('0x4b')]['find']({'where':{'id':_0x479f17[_0x6783('0x54')]['id']}})[_0x6783('0x1c')](handleEntityNotFound(_0x30a60b,null))[_0x6783('0x1c')](removeEntity(_0x30a60b,null))['catch'](handleError(_0x30a60b,null));};exports[_0x6783('0x55')]=function(_0x22ed9b,_0x4cbecf,_0x108969){var _0x1c000c={};var _0x1521be={};var _0x10f4d2;var _0xee1ac;return db[_0x6783('0x4b')][_0x6783('0x56')]({'where':{'id':_0x22ed9b[_0x6783('0x54')]['id']}})[_0x6783('0x1c')](handleEntityNotFound(_0x4cbecf,null))[_0x6783('0x1c')](function(_0x457f3b){if(_0x457f3b){_0x10f4d2=_0x457f3b;_0x1521be['model']=_[_0x6783('0x39')](db[_0x6783('0x57')]['rawAttributes']);_0x1521be['query']=_[_0x6783('0x39')](_0x22ed9b[_0x6783('0x38')]);_0x1521be[_0x6783('0x58')]=_['intersection'](_0x1521be['model'],_0x1521be[_0x6783('0x38')]);_0x1c000c[_0x6783('0x3a')]=_[_0x6783('0x3b')](_0x1521be[_0x6783('0x37')],qs[_0x6783('0x3c')](_0x22ed9b[_0x6783('0x38')]['fields']));_0x1c000c[_0x6783('0x3a')]=_0x1c000c[_0x6783('0x3a')][_0x6783('0x3d')]?_0x1c000c[_0x6783('0x3a')]:_0x1521be[_0x6783('0x37')];_0x1c000c['order']=qs[_0x6783('0x42')](_0x22ed9b[_0x6783('0x38')]['sort']);_0x1c000c[_0x6783('0x43')]=qs[_0x6783('0x58')](_[_0x6783('0x44')](_0x22ed9b[_0x6783('0x38')],_0x1521be[_0x6783('0x58')]));if(_0x22ed9b['query'][_0x6783('0x45')]){_0x1c000c[_0x6783('0x43')]=_[_0x6783('0x46')](_0x1c000c[_0x6783('0x43')],{'$or':_[_0x6783('0x59')](_0x1c000c[_0x6783('0x3a')],function(_0xcd2879){var _0x49849e={};_0x49849e[_0xcd2879]={'$like':'%'+_0x22ed9b[_0x6783('0x38')][_0x6783('0x45')]+'%'};return _0x49849e;})});}_0x1c000c=_[_0x6783('0x46')]({},_0x1c000c,_0x22ed9b[_0x6783('0x4a')]);return _0x10f4d2['getConfigurations'](_0x1c000c);}})[_0x6783('0x1c')](function(_0x3dac62){if(_0x3dac62){_0xee1ac=_0x3dac62[_0x6783('0x3d')];if(!_0x22ed9b[_0x6783('0x38')][_0x6783('0x3e')]('nolimit')){_0x1c000c[_0x6783('0x40')]=qs[_0x6783('0x40')](_0x22ed9b['query']['limit']);_0x1c000c[_0x6783('0x2a')]=qs['offset'](_0x22ed9b[_0x6783('0x38')][_0x6783('0x2a')]);}return _0x10f4d2['getConfigurations'](_0x1c000c);}})[_0x6783('0x1c')](function(_0x2c8deb){if(_0x2c8deb){return _0x2c8deb?{'count':_0xee1ac,'rows':_0x2c8deb}:null;}})[_0x6783('0x1c')](respondWithResult(_0x4cbecf,null))['catch'](handleError(_0x4cbecf,null));};exports[_0x6783('0x5a')]=function(_0x174089,_0x428350,_0x3206ba){if(_0x174089[_0x6783('0x53')]['id']){delete _0x174089[_0x6783('0x53')]['id'];}return db[_0x6783('0x4b')]['findOne']({'where':{'id':_0x174089[_0x6783('0x54')]['id']}})[_0x6783('0x1c')](handleEntityNotFound(_0x428350,null))[_0x6783('0x1c')](function(_0x33257d){if(_0x33257d){_0x174089['body'][_0x6783('0x5b')]=_0x33257d['id'];_0x174089[_0x6783('0x53')][_0x6783('0x5c')]=integrations[_0x6783('0x5d')](_0x174089[_0x6783('0x53')][_0x6783('0x5e')],_0x174089[_0x6783('0x53')]['type']);_0x174089[_0x6783('0x53')]['Descriptions']=integrations[_0x6783('0x5f')](_0x174089[_0x6783('0x53')][_0x6783('0x5e')],_0x174089[_0x6783('0x53')][_0x6783('0x47')]);return db[_0x6783('0x57')][_0x6783('0x52')](_0x174089[_0x6783('0x53')],{'include':[{'model':db['ZendeskField'],'as':_0x6783('0x5c')},{'model':db['ZendeskField'],'as':_0x6783('0x60')}]});}return null;})[_0x6783('0x1c')](respondWithResult(_0x428350,null))[_0x6783('0x27')](handleError(_0x428350,null));};exports['getFields']=function(_0x5a5fb8,_0x142b30,_0x307eff){var _0x447b88='';return db[_0x6783('0x4b')][_0x6783('0x56')]({'where':{'id':_0x5a5fb8[_0x6783('0x54')]['id']},'attributes':['id',_0x6783('0x61'),'password',_0x6783('0x62'),_0x6783('0x63'),_0x6783('0x64')]})[_0x6783('0x1c')](handleEntityNotFound(_0x142b30,null))[_0x6783('0x1c')](function(_0x1cef78){if(_0x1cef78){_0x447b88=_0x1cef78[_0x6783('0x64')];var _0x17ffcb=_0x447b88[_0x6783('0x65')](-0x1);if(_0x17ffcb==='/'){_0x447b88=_0x447b88[_0x6783('0x66')](0x0,_0x447b88[_0x6783('0x67')](_0x17ffcb));}var _0x34a34f={'method':'GET','uri':util['format'](_0x6783('0x68'),_0x447b88,_0x6783('0x69')),'json':!![]};switch(_0x1cef78[_0x6783('0x63')]){case _0x6783('0x6a'):_0x34a34f[_0x6783('0x6b')]={'Authorization':util[_0x6783('0x6c')]('Basic\x20%s',new Buffer(util[_0x6783('0x6c')]('%s:%s',_0x1cef78['username'],_0x1cef78[_0x6783('0x6a')]))[_0x6783('0x6d')]('base64'))};break;case'token':_0x34a34f[_0x6783('0x6b')]={'Authorization':util['format'](_0x6783('0x6e'),new Buffer(util['format'](_0x6783('0x6f'),_0x1cef78['username'],_0x1cef78[_0x6783('0x62')]))['toString'](_0x6783('0x70')))};break;default:throw new db['Sequelize'][(_0x6783('0x71'))](_0x6783('0x72'));}return rp(_0x34a34f);}})['then'](function(_0x24db8f){if(_0x24db8f){var _0x3687cf=[_0x6783('0x73'),_0x6783('0x74'),_0x6783('0x75'),_0x6783('0x76')];_[_0x6783('0x77')](_0x24db8f[_0x6783('0x69')],function(_0x3d7ea0){return _0x3687cf[_0x6783('0x78')](_0x3d7ea0[_0x6783('0x47')]);});return{'count':_0x24db8f[_0x6783('0x69')]['length'],'rows':_['map'](_0x24db8f[_0x6783('0x69')],function(_0x2dc0cb){return{'id':_0x2dc0cb['id'],'name':_0x2dc0cb[_0x6783('0x79')]>0x7?_0x2dc0cb[_0x6783('0x7a')]:_0x2dc0cb[_0x6783('0x47')],'custom':_0x2dc0cb[_0x6783('0x79')]>0x7?!![]:![],'options':_0x2dc0cb[_0x6783('0x7b')]?_0x2dc0cb[_0x6783('0x7b')]:_0x2dc0cb[_0x6783('0x7c')]?_0x2dc0cb[_0x6783('0x7c')]:[]};})};}})[_0x6783('0x1c')](respondWithResult(_0x142b30,null))[_0x6783('0x27')](function(_0x4ef776){var _0x56b15f=_0x5a5fb8[_0x6783('0x38')][_0x6783('0x1a')]?0x1f4:_0x4ef776[_0x6783('0x7d')]||0x1f4;logger[_0x6783('0x22')](_0x6783('0x7e'),_0x6783('0x7f'),_0x56b15f,JSON[_0x6783('0x21')](_0x4ef776));delete _0x4ef776[_0x6783('0x34')];if(_0x56b15f===0x191){_0x56b15f=0x190;}_0x142b30['status'](_0x56b15f)['send'](_0x5a5fb8[_0x6783('0x38')]['test']?{'message':_0x6783('0x80'),'statusCode':_0x4ef776[_0x6783('0x7d')]}:_0x4ef776);});};
\ No newline at end of file
+var _0xd31f=['Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','title','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','json','reject','update','destroy','stack','name','index','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','key','VIRTUAL','field','options','includeAll','ZendeskAccount','params','rawAttributes','include','find','create','body','getConfigurations','findOne','pick','map','addConfiguration','getSubjects','channel','type','Descriptions','ZendeskConfiguration','Subjects','ZendeskField','getFields','username','password','authType','remoteUri','slice','substring','format','%s/%s','ticket_fields','%s:%s','base64','token','headers','Basic\x20%s','toString','Sequelize'];(function(_0xe68a6b,_0x45de20){var _0x4e068f=function(_0x121dfb){while(--_0x121dfb){_0xe68a6b['push'](_0xe68a6b['shift']());}};_0x4e068f(++_0x45de20);}(_0xd31f,0x179));var _0xfd31=function(_0x1cbbbf,_0x5cd81b){_0x1cbbbf=_0x1cbbbf-0x0;var _0x4e5de6=_0xd31f[_0x1cbbbf];return _0x4e5de6;};'use strict';var pdf=require(_0xfd31('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfd31('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfd31('0x2'));var rp=require(_0xfd31('0x3'));var moment=require(_0xfd31('0x4'));var BPromise=require(_0xfd31('0x5'));var Mustache=require('mustache');var util=require(_0xfd31('0x6'));var path=require('path');var sox=require(_0xfd31('0x7'));var csv=require(_0xfd31('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfd31('0x9'));var crypto=require('crypto');var jsforce=require(_0xfd31('0xa'));var deskjs=require(_0xfd31('0xb'));var toCsv=require(_0xfd31('0x8'));var querystring=require(_0xfd31('0xc'));var Papa=require(_0xfd31('0xd'));var Redis=require(_0xfd31('0xe'));var authService=require(_0xfd31('0xf'));var qs=require(_0xfd31('0x10'));var hardwareService=require(_0xfd31('0x11'));var logger=require(_0xfd31('0x12'))('api');var utils=require(_0xfd31('0x13'));var config=require(_0xfd31('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfd31('0x15'));var jayson=require(_0xfd31('0x16'));var client=jayson[_0xfd31('0x17')][_0xfd31('0x18')]({'port':0x232a});function checkPasswordPattern(_0x1be273,_0x37e7be,_0x127882){if(_0x127882){var _0x384655=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x384655['test'](_0x37e7be)){return _0x1be273;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1be273;}}function respondWithRpcPromise(_0x467a19,_0x10ffe1,_0x3075cf,_0x9c647d){return new BPromise(function(_0x28ce4f,_0x5346bb){var _0x1508e2=_0x9c647d||client;return _0x1508e2[_0xfd31('0x19')](_0x467a19,_0x3075cf)[_0xfd31('0x1a')](function(_0x4c1aaf){logger[_0xfd31('0x1b')]('ZendeskAccount,\x20%s,\x20%s',_0x10ffe1,'request\x20sent');logger[_0xfd31('0x1c')](_0xfd31('0x1d'),_0x10ffe1,_0xfd31('0x1e'),JSON[_0xfd31('0x1f')](_0x4c1aaf));if(_0x4c1aaf['error']){if(_0x4c1aaf[_0xfd31('0x20')][_0xfd31('0x21')]===0x1f4){logger[_0xfd31('0x20')](_0xfd31('0x22'),_0x10ffe1,_0x4c1aaf[_0xfd31('0x20')]['message']);return _0x5346bb(_0x4c1aaf[_0xfd31('0x20')]['message']);}logger[_0xfd31('0x20')]('ZendeskAccount,\x20%s,\x20%s',_0x10ffe1,_0x4c1aaf['error']['message']);return _0x28ce4f(_0x4c1aaf[_0xfd31('0x20')][_0xfd31('0x23')]);}else{logger['info'](_0xfd31('0x22'),_0x10ffe1,_0xfd31('0x1e'));_0x28ce4f(_0x4c1aaf[_0xfd31('0x24')]['message']);}})[_0xfd31('0x25')](function(_0x8d18bd){logger[_0xfd31('0x20')](_0xfd31('0x22'),_0x10ffe1,_0x8d18bd);_0x5346bb(_0x8d18bd);});});}function respondWithStatusCode(_0x5daa9c,_0x103f53){_0x103f53=_0x103f53||0xcc;return function(_0xb208fc){if(_0xb208fc){return _0x5daa9c[_0xfd31('0x26')](_0x103f53);}return _0x5daa9c[_0xfd31('0x27')](_0x103f53)[_0xfd31('0x28')]();};}function respondWithResult(_0x13f601,_0x2c3475){_0x2c3475=_0x2c3475||0xc8;return function(_0x27b6c3){if(_0x27b6c3){return _0x13f601['status'](_0x2c3475)['json'](_0x27b6c3);}};}function respondWithFilteredResult(_0x97f977,_0x276a13){return function(_0x159302){if(_0x159302){var _0x5c7640=_0x159302[_0xfd31('0x29')],_0xc98cfa=_0x276a13[_0xfd31('0x2a')],_0x2e30d2=_0x276a13[_0xfd31('0x2a')]+_0x276a13[_0xfd31('0x2b')],_0x53f0c6;if(_0x2e30d2>=_0x5c7640){_0x2e30d2=_0x5c7640;_0x53f0c6=0xc8;}else{_0x53f0c6=0xce;}_0x97f977['status'](_0x53f0c6);return _0x97f977['set']('Content-Range',_0xc98cfa+'-'+_0x2e30d2+'/'+_0x5c7640)[_0xfd31('0x2c')](_0x159302);}return null;};}function patchUpdates(_0x34d89f){return function(_0x32365b){try{jsonpatch['apply'](_0x32365b,_0x34d89f,!![]);}catch(_0xa347f){return BPromise[_0xfd31('0x2d')](_0xa347f);}return _0x32365b['save']();};}function saveUpdates(_0x3330ce,_0x1f9f09){return function(_0x1cc1c6){if(_0x1cc1c6){return _0x1cc1c6[_0xfd31('0x2e')](_0x3330ce)['then'](function(_0x2c7821){return _0x2c7821;});}return null;};}function removeEntity(_0x55b7ba,_0x1538b8){return function(_0x4c8b07){if(_0x4c8b07){return _0x4c8b07[_0xfd31('0x2f')]()['then'](function(){_0x55b7ba[_0xfd31('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1db184,_0x200455){return function(_0x191b6c){if(!_0x191b6c){_0x1db184['sendStatus'](0x194);}return _0x191b6c;};}function handleError(_0x3c9583,_0x42ea3a){_0x42ea3a=_0x42ea3a||0x1f4;return function(_0x4b9412){logger['error'](_0x4b9412[_0xfd31('0x30')]);if(_0x4b9412[_0xfd31('0x31')]){delete _0x4b9412[_0xfd31('0x31')];}_0x3c9583['status'](_0x42ea3a)['send'](_0x4b9412);};}exports[_0xfd31('0x32')]=function(_0x13cf0e,_0x4dcbd5){var _0x2e18a2={},_0x4b1ad0={},_0x571fbc={'count':0x0,'rows':[]};var _0x2bce2c=db['ZendeskAccount']['rawAttributes'];_0x4b1ad0['model']=_['keys'](_0x2bce2c);_0x4b1ad0[_0xfd31('0x33')]=_[_0xfd31('0x34')](_0x13cf0e[_0xfd31('0x33')]);_0x4b1ad0[_0xfd31('0x35')]=_['intersection'](_0x4b1ad0['model'],_0x4b1ad0['query']);_0x2e18a2[_0xfd31('0x36')]=_[_0xfd31('0x37')](_0x4b1ad0[_0xfd31('0x38')],qs[_0xfd31('0x39')](_0x13cf0e[_0xfd31('0x33')][_0xfd31('0x39')]));_0x2e18a2[_0xfd31('0x36')]=_0x2e18a2[_0xfd31('0x36')][_0xfd31('0x3a')]?_0x2e18a2[_0xfd31('0x36')]:_0x4b1ad0[_0xfd31('0x38')];if(!_0x13cf0e['query'][_0xfd31('0x3b')](_0xfd31('0x3c'))){_0x2e18a2['limit']=qs[_0xfd31('0x2b')](_0x13cf0e[_0xfd31('0x33')]['limit']);_0x2e18a2[_0xfd31('0x2a')]=qs['offset'](_0x13cf0e['query'][_0xfd31('0x2a')]);}_0x2e18a2[_0xfd31('0x3d')]=qs[_0xfd31('0x3e')](_0x13cf0e[_0xfd31('0x33')]['sort']);_0x2e18a2[_0xfd31('0x3f')]=qs['filters'](_['pick'](_0x13cf0e[_0xfd31('0x33')],_0x4b1ad0[_0xfd31('0x35')]));if(_0x13cf0e['query'][_0xfd31('0x40')]){_0x2e18a2[_0xfd31('0x3f')]=_[_0xfd31('0x41')](_0x2e18a2['where'],{'$or':_['map'](_0x2bce2c,function(_0x5510de){if(_0x5510de['type'][_0xfd31('0x42')]!==_0xfd31('0x43')){var _0x34784f={};_0x34784f[_0x5510de[_0xfd31('0x44')]]={'$like':'%'+_0x13cf0e[_0xfd31('0x33')]['filter']+'%'};return _0x34784f;}})});}_0x2e18a2=_[_0xfd31('0x41')]({},_0x2e18a2,_0x13cf0e[_0xfd31('0x45')]);var _0x24855f={'where':_0x2e18a2[_0xfd31('0x3f')]};return db['ZendeskAccount'][_0xfd31('0x29')](_0x24855f)[_0xfd31('0x1a')](function(_0x2d5ce4){_0x571fbc['count']=_0x2d5ce4;if(_0x13cf0e[_0xfd31('0x33')][_0xfd31('0x46')]){_0x2e18a2['include']=[{'all':!![]}];}return db[_0xfd31('0x47')]['findAll'](_0x2e18a2);})[_0xfd31('0x1a')](function(_0x18ad38){_0x571fbc['rows']=_0x18ad38;return _0x571fbc;})[_0xfd31('0x1a')](respondWithFilteredResult(_0x4dcbd5,_0x2e18a2))['catch'](handleError(_0x4dcbd5,null));};exports['show']=function(_0x382ee4,_0x458319){var _0x290b2a={'raw':![],'where':{'id':_0x382ee4[_0xfd31('0x48')]['id']}},_0xa8b4a9={};_0xa8b4a9[_0xfd31('0x38')]=_[_0xfd31('0x34')](db[_0xfd31('0x47')][_0xfd31('0x49')]);_0xa8b4a9[_0xfd31('0x33')]=_[_0xfd31('0x34')](_0x382ee4[_0xfd31('0x33')]);_0xa8b4a9[_0xfd31('0x35')]=_['intersection'](_0xa8b4a9[_0xfd31('0x38')],_0xa8b4a9[_0xfd31('0x33')]);_0x290b2a['attributes']=_[_0xfd31('0x37')](_0xa8b4a9[_0xfd31('0x38')],qs[_0xfd31('0x39')](_0x382ee4['query']['fields']));_0x290b2a['attributes']=_0x290b2a[_0xfd31('0x36')][_0xfd31('0x3a')]?_0x290b2a[_0xfd31('0x36')]:_0xa8b4a9[_0xfd31('0x38')];if(_0x382ee4['query'][_0xfd31('0x46')]){_0x290b2a[_0xfd31('0x4a')]=[{'all':!![]}];}_0x290b2a=_[_0xfd31('0x41')]({},_0x290b2a,_0x382ee4['options']);return db[_0xfd31('0x47')][_0xfd31('0x4b')](_0x290b2a)[_0xfd31('0x1a')](handleEntityNotFound(_0x458319,null))['then'](respondWithResult(_0x458319,null))['catch'](handleError(_0x458319,null));};exports[_0xfd31('0x4c')]=function(_0x29279b,_0x158416){return db[_0xfd31('0x47')][_0xfd31('0x4c')](_0x29279b[_0xfd31('0x4d')],{})[_0xfd31('0x1a')](respondWithResult(_0x158416,0xc9))['catch'](handleError(_0x158416,null));};exports['update']=function(_0x3660cd,_0x4f5ad5){if(_0x3660cd['body']['id']){delete _0x3660cd['body']['id'];}return db[_0xfd31('0x47')][_0xfd31('0x4b')]({'where':{'id':_0x3660cd[_0xfd31('0x48')]['id']}})[_0xfd31('0x1a')](handleEntityNotFound(_0x4f5ad5,null))['then'](saveUpdates(_0x3660cd[_0xfd31('0x4d')],null))[_0xfd31('0x1a')](respondWithResult(_0x4f5ad5,null))[_0xfd31('0x25')](handleError(_0x4f5ad5,null));};exports[_0xfd31('0x2f')]=function(_0x4b14de,_0x526371){return db[_0xfd31('0x47')][_0xfd31('0x4b')]({'where':{'id':_0x4b14de[_0xfd31('0x48')]['id']}})[_0xfd31('0x1a')](handleEntityNotFound(_0x526371,null))[_0xfd31('0x1a')](removeEntity(_0x526371,null))[_0xfd31('0x25')](handleError(_0x526371,null));};exports[_0xfd31('0x4e')]=function(_0x184fee,_0x257df4,_0x30b15c){var _0xe760a={};var _0xea948c={};var _0x32408a;var _0x122350;return db[_0xfd31('0x47')][_0xfd31('0x4f')]({'where':{'id':_0x184fee['params']['id']}})[_0xfd31('0x1a')](handleEntityNotFound(_0x257df4,null))[_0xfd31('0x1a')](function(_0x5e5fed){if(_0x5e5fed){_0x32408a=_0x5e5fed;_0xea948c[_0xfd31('0x38')]=_[_0xfd31('0x34')](db['ZendeskConfiguration'][_0xfd31('0x49')]);_0xea948c[_0xfd31('0x33')]=_[_0xfd31('0x34')](_0x184fee[_0xfd31('0x33')]);_0xea948c[_0xfd31('0x35')]=_['intersection'](_0xea948c['model'],_0xea948c[_0xfd31('0x33')]);_0xe760a[_0xfd31('0x36')]=_[_0xfd31('0x37')](_0xea948c[_0xfd31('0x38')],qs['fields'](_0x184fee['query'][_0xfd31('0x39')]));_0xe760a[_0xfd31('0x36')]=_0xe760a[_0xfd31('0x36')][_0xfd31('0x3a')]?_0xe760a[_0xfd31('0x36')]:_0xea948c[_0xfd31('0x38')];_0xe760a[_0xfd31('0x3d')]=qs['sort'](_0x184fee[_0xfd31('0x33')][_0xfd31('0x3e')]);_0xe760a[_0xfd31('0x3f')]=qs[_0xfd31('0x35')](_[_0xfd31('0x50')](_0x184fee[_0xfd31('0x33')],_0xea948c[_0xfd31('0x35')]));if(_0x184fee[_0xfd31('0x33')][_0xfd31('0x40')]){_0xe760a[_0xfd31('0x3f')]=_['merge'](_0xe760a[_0xfd31('0x3f')],{'$or':_[_0xfd31('0x51')](_0xe760a[_0xfd31('0x36')],function(_0x38ef7c){var _0x2c7568={};_0x2c7568[_0x38ef7c]={'$like':'%'+_0x184fee[_0xfd31('0x33')][_0xfd31('0x40')]+'%'};return _0x2c7568;})});}_0xe760a=_['merge']({},_0xe760a,_0x184fee[_0xfd31('0x45')]);return _0x32408a[_0xfd31('0x4e')](_0xe760a);}})[_0xfd31('0x1a')](function(_0xa62808){if(_0xa62808){_0x122350=_0xa62808[_0xfd31('0x3a')];if(!_0x184fee[_0xfd31('0x33')][_0xfd31('0x3b')]('nolimit')){_0xe760a[_0xfd31('0x2b')]=qs[_0xfd31('0x2b')](_0x184fee[_0xfd31('0x33')][_0xfd31('0x2b')]);_0xe760a[_0xfd31('0x2a')]=qs[_0xfd31('0x2a')](_0x184fee[_0xfd31('0x33')]['offset']);}return _0x32408a[_0xfd31('0x4e')](_0xe760a);}})['then'](function(_0x18cfbd){if(_0x18cfbd){return _0x18cfbd?{'count':_0x122350,'rows':_0x18cfbd}:null;}})['then'](respondWithResult(_0x257df4,null))[_0xfd31('0x25')](handleError(_0x257df4,null));};exports[_0xfd31('0x52')]=function(_0x162fb3,_0x19439a,_0x42d467){if(_0x162fb3[_0xfd31('0x4d')]['id']){delete _0x162fb3[_0xfd31('0x4d')]['id'];}return db['ZendeskAccount'][_0xfd31('0x4f')]({'where':{'id':_0x162fb3[_0xfd31('0x48')]['id']}})[_0xfd31('0x1a')](handleEntityNotFound(_0x19439a,null))[_0xfd31('0x1a')](function(_0x25f9d3){if(_0x25f9d3){_0x162fb3['body']['AccountId']=_0x25f9d3['id'];_0x162fb3[_0xfd31('0x4d')]['Subjects']=integrations[_0xfd31('0x53')](_0x162fb3[_0xfd31('0x4d')][_0xfd31('0x54')],_0x162fb3['body'][_0xfd31('0x55')]);_0x162fb3['body'][_0xfd31('0x56')]=integrations['getDescriptions'](_0x162fb3['body'][_0xfd31('0x54')],_0x162fb3[_0xfd31('0x4d')][_0xfd31('0x55')]);return db[_0xfd31('0x57')][_0xfd31('0x4c')](_0x162fb3[_0xfd31('0x4d')],{'include':[{'model':db['ZendeskField'],'as':_0xfd31('0x58')},{'model':db[_0xfd31('0x59')],'as':_0xfd31('0x56')}]});}return null;})['then'](respondWithResult(_0x19439a,null))[_0xfd31('0x25')](handleError(_0x19439a,null));};exports[_0xfd31('0x5a')]=function(_0x2386a9,_0x3d3e14,_0x175d3f){var _0x46f017='';return db['ZendeskAccount'][_0xfd31('0x4f')]({'where':{'id':_0x2386a9[_0xfd31('0x48')]['id']},'attributes':['id',_0xfd31('0x5b'),_0xfd31('0x5c'),'token',_0xfd31('0x5d'),_0xfd31('0x5e')]})['then'](handleEntityNotFound(_0x3d3e14,null))[_0xfd31('0x1a')](function(_0x591a0a){if(_0x591a0a){_0x46f017=_0x591a0a[_0xfd31('0x5e')];var _0x2b8440=_0x46f017[_0xfd31('0x5f')](-0x1);if(_0x2b8440==='/'){_0x46f017=_0x46f017[_0xfd31('0x60')](0x0,_0x46f017['lastIndexOf'](_0x2b8440));}var _0x46d44d={'method':'GET','uri':util[_0xfd31('0x61')](_0xfd31('0x62'),_0x46f017,_0xfd31('0x63')),'json':!![]};switch(_0x591a0a[_0xfd31('0x5d')]){case _0xfd31('0x5c'):_0x46d44d['headers']={'Authorization':util[_0xfd31('0x61')]('Basic\x20%s',new Buffer(util[_0xfd31('0x61')](_0xfd31('0x64'),_0x591a0a['username'],_0x591a0a[_0xfd31('0x5c')]))['toString'](_0xfd31('0x65')))};break;case _0xfd31('0x66'):_0x46d44d[_0xfd31('0x67')]={'Authorization':util[_0xfd31('0x61')](_0xfd31('0x68'),new Buffer(util['format']('%s/token:%s',_0x591a0a[_0xfd31('0x5b')],_0x591a0a[_0xfd31('0x66')]))[_0xfd31('0x69')](_0xfd31('0x65')))};break;default:throw new db[(_0xfd31('0x6a'))]['ValidationError'](_0xfd31('0x6b'));}return rp(_0x46d44d);}})[_0xfd31('0x1a')](function(_0x2642ee){if(_0x2642ee){var _0x5c746e=[_0xfd31('0x6c'),_0xfd31('0x6d'),_0xfd31('0x6e'),_0xfd31('0x6f')];_[_0xfd31('0x70')](_0x2642ee[_0xfd31('0x63')],function(_0x21c1d4){return _0x5c746e[_0xfd31('0x71')](_0x21c1d4[_0xfd31('0x55')]);});return{'count':_0x2642ee['ticket_fields']['length'],'rows':_['map'](_0x2642ee[_0xfd31('0x63')],function(_0x6c0720){return{'id':_0x6c0720['id'],'name':_0x6c0720['position']>0x7?_0x6c0720[_0xfd31('0x72')]:_0x6c0720[_0xfd31('0x55')],'custom':_0x6c0720[_0xfd31('0x73')]>0x7?!![]:![],'options':_0x6c0720['system_field_options']?_0x6c0720[_0xfd31('0x74')]:_0x6c0720[_0xfd31('0x75')]?_0x6c0720[_0xfd31('0x75')]:[]};})};}})['then'](respondWithResult(_0x3d3e14,null))[_0xfd31('0x25')](function(_0x494814){var _0x2bd819=_0x2386a9['query']['test']?0x1f4:_0x494814[_0xfd31('0x76')]||0x1f4;logger[_0xfd31('0x20')](_0xfd31('0x77'),'getFields',_0x2bd819,JSON[_0xfd31('0x1f')](_0x494814));delete _0x494814[_0xfd31('0x31')];if(_0x2bd819===0x191){_0x2bd819=0x190;}_0x3d3e14['status'](_0x2bd819)['send'](_0x2386a9['query'][_0xfd31('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x494814[_0xfd31('0x76')]}:_0x494814);});};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js
index 25a8a89..bf80350 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.model.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x687b=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x15022b,_0x100ec0){var _0xd23271=function(_0x28d732){while(--_0x28d732){_0x15022b['push'](_0x15022b['shift']());}};_0xd23271(++_0x100ec0);}(_0x687b,0x14a));var _0xb687=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x687b[_0x1d5400];return _0x21d9fe;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('ZendeskAccount',attributes,{'tableName':_0xb687('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef66=['path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0xef66,0x1db));var _0x6ef6=function(_0x30d92c,_0x6a9c0f){_0x30d92c=_0x30d92c-0x0;var _0x130fee=_0xef66[_0x30d92c];return _0x130fee;};'use strict';var _=require(_0x6ef6('0x0'));var util=require(_0x6ef6('0x1'));var logger=require(_0x6ef6('0x2'))(_0x6ef6('0x3'));var moment=require(_0x6ef6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ef6('0x5'));var rimraf=require(_0x6ef6('0x6'));var config=require(_0x6ef6('0x7'));var attributes=require(_0x6ef6('0x8'));var integrations=require(_0x6ef6('0x9'));module[_0x6ef6('0xa')]=function(_0x32baa0,_0x1830aa){return _0x32baa0[_0x6ef6('0xb')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js
index d594fc0..d08f94b 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc8ca=['http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','findAll','options','raw','where','limit','include','map','attributes','model','catch','ShowZendeskAccount','ZendeskAccount','find','lodash','util','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x92ca24,_0x505f51){var _0x88ecdb=function(_0x21f5fd){while(--_0x21f5fd){_0x92ca24['push'](_0x92ca24['shift']());}};_0x88ecdb(++_0x505f51);}(_0xc8ca,0x1b3));var _0xac8c=function(_0x4d5a08,_0x31d500){_0x4d5a08=_0x4d5a08-0x0;var _0x20922e=_0xc8ca[_0x4d5a08];return _0x20922e;};'use strict';var _=require(_0xac8c('0x0'));var util=require(_0xac8c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac8c('0x2'))['db'];var utils=require(_0xac8c('0x3'));var logger=require('../../config/logger')(_0xac8c('0x4'));var config=require(_0xac8c('0x5'));var jayson=require(_0xac8c('0x6'));var client=jayson['client'][_0xac8c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6b2f26,_0x544755,_0x35756f){return new BPromise(function(_0x51ecd9,_0x378215){return client[_0xac8c('0x8')](_0x6b2f26,_0x35756f)[_0xac8c('0x9')](function(_0x4eea78){logger[_0xac8c('0xa')](_0xac8c('0xb'),_0x544755,_0xac8c('0xc'));logger[_0xac8c('0xd')](_0xac8c('0xe'),_0x544755,_0xac8c('0xc'),JSON[_0xac8c('0xf')](_0x4eea78));if(_0x4eea78[_0xac8c('0x10')]){if(_0x4eea78['error'][_0xac8c('0x11')]===0x1f4){logger[_0xac8c('0x10')](_0xac8c('0xb'),_0x544755,_0x4eea78[_0xac8c('0x10')][_0xac8c('0x12')]);return _0x378215(_0x4eea78['error']['message']);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x544755,_0x4eea78['error'][_0xac8c('0x12')]);return _0x51ecd9(_0x4eea78[_0xac8c('0x10')][_0xac8c('0x12')]);}else{logger[_0xac8c('0xa')](_0xac8c('0xb'),_0x544755,_0xac8c('0xc'));_0x51ecd9(_0x4eea78[_0xac8c('0x13')]['message']);}})['catch'](function(_0x34725b){logger[_0xac8c('0x10')](_0xac8c('0xb'),_0x544755,_0x34725b);_0x378215(_0x34725b);});});}exports[_0xac8c('0x14')]=function(_0x310e19){var _0x520f3f=this;return new Promise(function(_0x158322,_0x2150dc){return db['ZendeskAccount'][_0xac8c('0x15')]({'raw':_0x310e19[_0xac8c('0x16')]?_0x310e19[_0xac8c('0x16')][_0xac8c('0x17')]===undefined?!![]:![]:!![],'where':_0x310e19[_0xac8c('0x16')]?_0x310e19[_0xac8c('0x16')][_0xac8c('0x18')]||null:null,'attributes':_0x310e19['options']?_0x310e19[_0xac8c('0x16')]['attributes']||null:null,'limit':_0x310e19[_0xac8c('0x16')]?_0x310e19['options'][_0xac8c('0x19')]||null:null,'include':_0x310e19[_0xac8c('0x16')]?_0x310e19[_0xac8c('0x16')][_0xac8c('0x1a')]?_[_0xac8c('0x1b')](_0x310e19['options'][_0xac8c('0x1a')],function(_0x114038){return{'model':db[_0x114038['model']],'as':_0x114038['as'],'attributes':_0x114038[_0xac8c('0x1c')],'include':_0x114038[_0xac8c('0x1a')]?_[_0xac8c('0x1b')](_0x114038[_0xac8c('0x1a')],function(_0x14a89e){return{'model':db[_0x14a89e['model']],'as':_0x14a89e['as'],'attributes':_0x14a89e[_0xac8c('0x1c')],'include':_0x14a89e[_0xac8c('0x1a')]?_[_0xac8c('0x1b')](_0x14a89e[_0xac8c('0x1a')],function(_0x505e33){return{'model':db[_0x505e33[_0xac8c('0x1d')]],'as':_0x505e33['as'],'attributes':_0x505e33[_0xac8c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xac8c('0x9')](function(_0x5a42e8){logger[_0xac8c('0xa')](_0xac8c('0x14'),_0x310e19);logger[_0xac8c('0xd')](_0xac8c('0x14'),_0x310e19,JSON[_0xac8c('0xf')](_0x5a42e8));_0x158322(_0x5a42e8);})[_0xac8c('0x1e')](function(_0xb638ee){logger[_0xac8c('0x10')](_0xac8c('0x14'),_0xb638ee[_0xac8c('0x12')],_0x310e19);_0x2150dc(_0x520f3f[_0xac8c('0x10')](0x1f4,_0xb638ee['message']));});});};exports[_0xac8c('0x1f')]=function(_0x49b89d){var _0x2b5f4e=this;return new Promise(function(_0x113e9c,_0x1cf426){return db[_0xac8c('0x20')][_0xac8c('0x21')]({'raw':_0x49b89d[_0xac8c('0x16')]?_0x49b89d[_0xac8c('0x16')][_0xac8c('0x17')]===undefined?!![]:![]:!![],'where':_0x49b89d['options']?_0x49b89d[_0xac8c('0x16')][_0xac8c('0x18')]||null:null,'attributes':_0x49b89d['options']?_0x49b89d[_0xac8c('0x16')][_0xac8c('0x1c')]||null:null,'include':_0x49b89d[_0xac8c('0x16')]?_0x49b89d[_0xac8c('0x16')][_0xac8c('0x1a')]?_['map'](_0x49b89d[_0xac8c('0x16')][_0xac8c('0x1a')],function(_0x31f89d){return{'model':db[_0x31f89d[_0xac8c('0x1d')]],'as':_0x31f89d['as'],'attributes':_0x31f89d[_0xac8c('0x1c')],'include':_0x31f89d[_0xac8c('0x1a')]?_['map'](_0x31f89d[_0xac8c('0x1a')],function(_0x2cd9f8){return{'model':db[_0x2cd9f8[_0xac8c('0x1d')]],'as':_0x2cd9f8['as'],'attributes':_0x2cd9f8['attributes'],'include':_0x2cd9f8[_0xac8c('0x1a')]?_[_0xac8c('0x1b')](_0x2cd9f8[_0xac8c('0x1a')],function(_0x5ddb10){return{'model':db[_0x5ddb10[_0xac8c('0x1d')]],'as':_0x5ddb10['as'],'attributes':_0x5ddb10[_0xac8c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xac8c('0x9')](function(_0x48703b){logger[_0xac8c('0xa')](_0xac8c('0x1f'),_0x49b89d);logger[_0xac8c('0xd')]('ShowZendeskAccount',_0x49b89d,JSON[_0xac8c('0xf')](_0x48703b));_0x113e9c(_0x48703b);})['catch'](function(_0x6155c5){logger[_0xac8c('0x10')]('ShowZendeskAccount',_0x6155c5[_0xac8c('0x12')],_0x49b89d);_0x1cf426(_0x2b5f4e[_0xac8c('0x10')](0x1f4,_0x6155c5[_0xac8c('0x12')]));});});};
\ No newline at end of file
+var _0xb681=['GetZendeskAccount','ZendeskAccount','findAll','options','attributes','limit','include','model','map','then','stringify','ShowZendeskAccount','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x60fa35,_0x12abc6){var _0x2d9933=function(_0x310304){while(--_0x310304){_0x60fa35['push'](_0x60fa35['shift']());}};_0x2d9933(++_0x12abc6);}(_0xb681,0x153));var _0x1b68=function(_0x2ff0ea,_0x251145){_0x2ff0ea=_0x2ff0ea-0x0;var _0x501f04=_0xb681[_0x2ff0ea];return _0x501f04;};'use strict';var _=require(_0x1b68('0x0'));var util=require(_0x1b68('0x1'));var moment=require(_0x1b68('0x2'));var BPromise=require(_0x1b68('0x3'));var rs=require(_0x1b68('0x4'));var fs=require('fs');var Redis=require(_0x1b68('0x5'));var db=require(_0x1b68('0x6'))['db'];var utils=require(_0x1b68('0x7'));var logger=require(_0x1b68('0x8'))(_0x1b68('0x9'));var config=require('../../config/environment');var jayson=require(_0x1b68('0xa'));var client=jayson['client'][_0x1b68('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x103d40,_0x1166ab,_0x536e88){return new BPromise(function(_0x5b3ebb,_0x54c76f){return client['request'](_0x103d40,_0x536e88)['then'](function(_0x1f0f1b){logger[_0x1b68('0xc')](_0x1b68('0xd'),_0x1166ab,_0x1b68('0xe'));logger[_0x1b68('0xf')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x1166ab,_0x1b68('0xe'),JSON['stringify'](_0x1f0f1b));if(_0x1f0f1b[_0x1b68('0x10')]){if(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x11')]===0x1f4){logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);return _0x54c76f(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);}logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);return _0x5b3ebb(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);}else{logger['info'](_0x1b68('0xd'),_0x1166ab,_0x1b68('0xe'));_0x5b3ebb(_0x1f0f1b[_0x1b68('0x13')][_0x1b68('0x12')]);}})[_0x1b68('0x14')](function(_0x2255cf){logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x2255cf);_0x54c76f(_0x2255cf);});});}exports[_0x1b68('0x15')]=function(_0x11569b){var _0x8d4ea8=this;return new Promise(function(_0x448841,_0x2b28f3){return db[_0x1b68('0x16')][_0x1b68('0x17')]({'raw':_0x11569b['options']?_0x11569b['options']['raw']===undefined?!![]:![]:!![],'where':_0x11569b[_0x1b68('0x18')]?_0x11569b[_0x1b68('0x18')]['where']||null:null,'attributes':_0x11569b[_0x1b68('0x18')]?_0x11569b[_0x1b68('0x18')][_0x1b68('0x19')]||null:null,'limit':_0x11569b[_0x1b68('0x18')]?_0x11569b[_0x1b68('0x18')][_0x1b68('0x1a')]||null:null,'include':_0x11569b['options']?_0x11569b[_0x1b68('0x18')]['include']?_['map'](_0x11569b['options'][_0x1b68('0x1b')],function(_0x2c4ecb){return{'model':db[_0x2c4ecb[_0x1b68('0x1c')]],'as':_0x2c4ecb['as'],'attributes':_0x2c4ecb[_0x1b68('0x19')],'include':_0x2c4ecb[_0x1b68('0x1b')]?_[_0x1b68('0x1d')](_0x2c4ecb[_0x1b68('0x1b')],function(_0x4b99f8){return{'model':db[_0x4b99f8[_0x1b68('0x1c')]],'as':_0x4b99f8['as'],'attributes':_0x4b99f8[_0x1b68('0x19')],'include':_0x4b99f8['include']?_[_0x1b68('0x1d')](_0x4b99f8[_0x1b68('0x1b')],function(_0xe2f765){return{'model':db[_0xe2f765['model']],'as':_0xe2f765['as'],'attributes':_0xe2f765['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b68('0x1e')](function(_0x191cc7){logger[_0x1b68('0xc')](_0x1b68('0x15'),_0x11569b);logger[_0x1b68('0xf')](_0x1b68('0x15'),_0x11569b,JSON[_0x1b68('0x1f')](_0x191cc7));_0x448841(_0x191cc7);})[_0x1b68('0x14')](function(_0x42260f){logger[_0x1b68('0x10')](_0x1b68('0x15'),_0x42260f[_0x1b68('0x12')],_0x11569b);_0x2b28f3(_0x8d4ea8[_0x1b68('0x10')](0x1f4,_0x42260f['message']));});});};exports[_0x1b68('0x20')]=function(_0x39deb5){var _0x341cb3=this;return new Promise(function(_0x57edb5,_0x8b12fa){return db[_0x1b68('0x16')][_0x1b68('0x21')]({'raw':_0x39deb5[_0x1b68('0x18')]?_0x39deb5[_0x1b68('0x18')][_0x1b68('0x22')]===undefined?!![]:![]:!![],'where':_0x39deb5[_0x1b68('0x18')]?_0x39deb5[_0x1b68('0x18')][_0x1b68('0x23')]||null:null,'attributes':_0x39deb5[_0x1b68('0x18')]?_0x39deb5['options'][_0x1b68('0x19')]||null:null,'include':_0x39deb5[_0x1b68('0x18')]?_0x39deb5[_0x1b68('0x18')]['include']?_[_0x1b68('0x1d')](_0x39deb5[_0x1b68('0x18')][_0x1b68('0x1b')],function(_0x4aa7b1){return{'model':db[_0x4aa7b1[_0x1b68('0x1c')]],'as':_0x4aa7b1['as'],'attributes':_0x4aa7b1[_0x1b68('0x19')],'include':_0x4aa7b1[_0x1b68('0x1b')]?_[_0x1b68('0x1d')](_0x4aa7b1[_0x1b68('0x1b')],function(_0x55022d){return{'model':db[_0x55022d[_0x1b68('0x1c')]],'as':_0x55022d['as'],'attributes':_0x55022d['attributes'],'include':_0x55022d[_0x1b68('0x1b')]?_[_0x1b68('0x1d')](_0x55022d[_0x1b68('0x1b')],function(_0x2ca010){return{'model':db[_0x2ca010[_0x1b68('0x1c')]],'as':_0x2ca010['as'],'attributes':_0x2ca010[_0x1b68('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1b68('0x1e')](function(_0x13e31a){logger[_0x1b68('0xc')]('ShowZendeskAccount',_0x39deb5);logger[_0x1b68('0xf')](_0x1b68('0x20'),_0x39deb5,JSON[_0x1b68('0x1f')](_0x13e31a));_0x57edb5(_0x13e31a);})['catch'](function(_0x365a45){logger[_0x1b68('0x10')](_0x1b68('0x20'),_0x365a45['message'],_0x39deb5);_0x8b12fa(_0x341cb3['error'](0x1f4,_0x365a45['message']));});});};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js
index 553eaae..a90d735 100644
--- a/server/api/intZendeskConfiguration/index.js
+++ b/server/api/intZendeskConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x12fe=['isAuthenticated','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x5ab846,_0x4bfcb9){var _0x5a745a=function(_0x4c8595){while(--_0x4c8595){_0x5ab846['push'](_0x5ab846['shift']());}};_0x5a745a(++_0x4bfcb9);}(_0x12fe,0x122));var _0xe12f=function(_0x6d0ecf,_0x30e024){_0x6d0ecf=_0x6d0ecf-0x0;var _0x599b89=_0x12fe[_0x6d0ecf];return _0x599b89;};'use strict';var multer=require(_0xe12f('0x0'));var util=require(_0xe12f('0x1'));var path=require(_0xe12f('0x2'));var timeout=require(_0xe12f('0x3'));var express=require(_0xe12f('0x4'));var router=express[_0xe12f('0x5')]();var auth=require(_0xe12f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe12f('0x7'));var controller=require(_0xe12f('0x8'));router[_0xe12f('0x9')]('/',auth[_0xe12f('0xa')](),controller['index']);router['get'](_0xe12f('0xb'),auth[_0xe12f('0xa')](),controller['show']);router[_0xe12f('0x9')](_0xe12f('0xc'),auth['isAuthenticated'](),controller[_0xe12f('0xd')]);router[_0xe12f('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xe12f('0xe')]);router[_0xe12f('0x9')](_0xe12f('0xf'),auth[_0xe12f('0xa')](),controller[_0xe12f('0x10')]);router[_0xe12f('0x9')](_0xe12f('0x11'),auth[_0xe12f('0xa')](),controller['getTags']);router[_0xe12f('0x12')]('/',auth[_0xe12f('0xa')](),controller['create']);router[_0xe12f('0x12')](_0xe12f('0x11'),auth['isAuthenticated'](),controller[_0xe12f('0x13')]);router[_0xe12f('0x14')](_0xe12f('0xb'),auth['isAuthenticated'](),controller[_0xe12f('0x15')]);router[_0xe12f('0x16')](_0xe12f('0xb'),auth[_0xe12f('0xa')](),controller[_0xe12f('0x17')]);module[_0xe12f('0x18')]=router;
\ No newline at end of file
+var _0x9209=['path','connect-timeout','../../components/auth/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','update','delete','exports','multer','util'];(function(_0x50d254,_0x56bdf7){var _0x3c1b5f=function(_0xe5c9f6){while(--_0xe5c9f6){_0x50d254['push'](_0x50d254['shift']());}};_0x3c1b5f(++_0x56bdf7);}(_0x9209,0x8e));var _0x9920=function(_0x4f56e6,_0x52134c){_0x4f56e6=_0x4f56e6-0x0;var _0x262a43=_0x9209[_0x4f56e6];return _0x262a43;};'use strict';var multer=require(_0x9920('0x0'));var util=require(_0x9920('0x1'));var path=require(_0x9920('0x2'));var timeout=require(_0x9920('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x9920('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9920('0x5'));router[_0x9920('0x6')]('/',auth[_0x9920('0x7')](),controller[_0x9920('0x8')]);router['get'](_0x9920('0x9'),auth['isAuthenticated'](),controller[_0x9920('0xa')]);router[_0x9920('0x6')](_0x9920('0xb'),auth[_0x9920('0x7')](),controller['getFields']);router['get'](_0x9920('0xc'),auth['isAuthenticated'](),controller[_0x9920('0xd')]);router[_0x9920('0x6')](_0x9920('0xe'),auth[_0x9920('0x7')](),controller[_0x9920('0xf')]);router['get'](_0x9920('0x10'),auth[_0x9920('0x7')](),controller[_0x9920('0x11')]);router[_0x9920('0x12')]('/',auth[_0x9920('0x7')](),controller[_0x9920('0x13')]);router[_0x9920('0x12')]('/:id/tags',auth[_0x9920('0x7')](),controller[_0x9920('0x14')]);router['put'](_0x9920('0x9'),auth['isAuthenticated'](),controller[_0x9920('0x15')]);router[_0x9920('0x16')]('/:id',auth[_0x9920('0x7')](),controller['destroy']);module[_0x9920('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
index bda7f55..8c5d257 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0389=['sequelize','exports','STRING'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x0389,0xd2));var _0x9038=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0x0389[_0xe84805];return _0x398efd;};'use strict';var Sequelize=require(_0x9038('0x0'));module[_0x9038('0x1')]={'name':{'type':Sequelize[_0x9038('0x2')]},'description':{'type':Sequelize[_0x9038('0x2')]}};
\ No newline at end of file
+var _0xd493=['sequelize','exports','STRING'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0xd493,0x18c));var _0x3d49=function(_0x1182eb,_0x106397){_0x1182eb=_0x1182eb-0x0;var _0x214627=_0xd493[_0x1182eb];return _0x214627;};'use strict';var Sequelize=require(_0x3d49('0x0'));module[_0x3d49('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3d49('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
index bda67ad..51d1862 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1045=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','end','status','offset','set','Content-Range','json','apply','reject','save','update','stack','name','send','index','ZendeskConfiguration','rawAttributes','keys','filters','intersection','model','query','fields','attributes','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','length','find','create','body','destroy','getFields','ZendeskField','hasOwnProperty','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0xb40c54,_0xdfaffa){var _0x29e943=function(_0x430e7d){while(--_0x430e7d){_0xb40c54['push'](_0xb40c54['shift']());}};_0x29e943(++_0xdfaffa);}(_0x1045,0x177));var _0x5104=function(_0x4cf162,_0x245c3f){_0x4cf162=_0x4cf162-0x0;var _0x5b0339=_0x1045[_0x4cf162];return _0x5b0339;};'use strict';var pdf=require(_0x5104('0x0'));var emlformat=require(_0x5104('0x1'));var rimraf=require(_0x5104('0x2'));var zipdir=require(_0x5104('0x3'));var jsonpatch=require(_0x5104('0x4'));var rp=require(_0x5104('0x5'));var moment=require(_0x5104('0x6'));var BPromise=require(_0x5104('0x7'));var Mustache=require(_0x5104('0x8'));var util=require('util');var path=require(_0x5104('0x9'));var sox=require('sox');var csv=require(_0x5104('0xa'));var ejs=require(_0x5104('0xb'));var fs=require('fs');var _=require(_0x5104('0xc'));var squel=require(_0x5104('0xd'));var crypto=require(_0x5104('0xe'));var jsforce=require(_0x5104('0xf'));var deskjs=require(_0x5104('0x10'));var toCsv=require(_0x5104('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5104('0x11'));var authService=require(_0x5104('0x12'));var qs=require(_0x5104('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5104('0x14'))('api');var utils=require(_0x5104('0x15'));var config=require(_0x5104('0x16'));var db=require(_0x5104('0x17'))['db'];var jayson=require(_0x5104('0x18'));var client=jayson[_0x5104('0x19')][_0x5104('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x48924a,_0x417a3b,_0x4141e0){if(_0x4141e0){var _0x215fa9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x215fa9[_0x5104('0x1b')](_0x417a3b)){return _0x48924a;}else{throw new Error(_0x5104('0x1c'));}}else{return _0x48924a;}}function respondWithRpcPromise(_0x17e9eb,_0x2f4372,_0x33a47f,_0x5c12f4){return new BPromise(function(_0x3485e3,_0x1dd6a3){var _0xc2fb1e=_0x5c12f4||client;return _0xc2fb1e[_0x5104('0x1d')](_0x17e9eb,_0x33a47f)[_0x5104('0x1e')](function(_0x540316){logger[_0x5104('0x1f')](_0x5104('0x20'),_0x2f4372,_0x5104('0x21'));logger[_0x5104('0x22')](_0x5104('0x23'),_0x2f4372,'request\x20sent',JSON['stringify'](_0x540316));if(_0x540316[_0x5104('0x24')]){if(_0x540316[_0x5104('0x24')][_0x5104('0x25')]===0x1f4){logger[_0x5104('0x24')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2f4372,_0x540316[_0x5104('0x24')][_0x5104('0x26')]);return _0x1dd6a3(_0x540316[_0x5104('0x24')][_0x5104('0x26')]);}logger[_0x5104('0x24')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2f4372,_0x540316[_0x5104('0x24')][_0x5104('0x26')]);return _0x3485e3(_0x540316['error']['message']);}else{logger['info'](_0x5104('0x20'),_0x2f4372,_0x5104('0x21'));_0x3485e3(_0x540316['result'][_0x5104('0x26')]);}})['catch'](function(_0x1cd808){logger[_0x5104('0x24')](_0x5104('0x20'),_0x2f4372,_0x1cd808);_0x1dd6a3(_0x1cd808);});});}function respondWithStatusCode(_0x245a9f,_0x48b3ec){_0x48b3ec=_0x48b3ec||0xcc;return function(_0x595902){if(_0x595902){return _0x245a9f[_0x5104('0x27')](_0x48b3ec);}return _0x245a9f['status'](_0x48b3ec)[_0x5104('0x28')]();};}function respondWithResult(_0x52ca70,_0x1a8d89){_0x1a8d89=_0x1a8d89||0xc8;return function(_0x14a513){if(_0x14a513){return _0x52ca70[_0x5104('0x29')](_0x1a8d89)['json'](_0x14a513);}};}function respondWithFilteredResult(_0x42d0d2,_0x4301c9){return function(_0x78d5a8){if(_0x78d5a8){var _0x2e05f7=_0x78d5a8['count'],_0x1840a9=_0x4301c9[_0x5104('0x2a')],_0x262c74=_0x4301c9['offset']+_0x4301c9['limit'],_0x2cc311;if(_0x262c74>=_0x2e05f7){_0x262c74=_0x2e05f7;_0x2cc311=0xc8;}else{_0x2cc311=0xce;}_0x42d0d2['status'](_0x2cc311);return _0x42d0d2[_0x5104('0x2b')](_0x5104('0x2c'),_0x1840a9+'-'+_0x262c74+'/'+_0x2e05f7)[_0x5104('0x2d')](_0x78d5a8);}return null;};}function patchUpdates(_0xcaf102){return function(_0x4ff320){try{jsonpatch[_0x5104('0x2e')](_0x4ff320,_0xcaf102,!![]);}catch(_0x31568f){return BPromise[_0x5104('0x2f')](_0x31568f);}return _0x4ff320[_0x5104('0x30')]();};}function saveUpdates(_0x5634b8,_0x163900){return function(_0x1dba1e){if(_0x1dba1e){return _0x1dba1e[_0x5104('0x31')](_0x5634b8)[_0x5104('0x1e')](function(_0x4c40cc){return _0x4c40cc;});}return null;};}function removeEntity(_0x2f64a0,_0x2f34de){return function(_0x1662a8){if(_0x1662a8){return _0x1662a8['destroy']()[_0x5104('0x1e')](function(){_0x2f64a0[_0x5104('0x29')](0xcc)[_0x5104('0x28')]();});}};}function handleEntityNotFound(_0x28f12d,_0x1c9d41){return function(_0x5ea29b){if(!_0x5ea29b){_0x28f12d[_0x5104('0x27')](0x194);}return _0x5ea29b;};}function handleError(_0x53107e,_0x65755f){_0x65755f=_0x65755f||0x1f4;return function(_0x47b9b4){logger[_0x5104('0x24')](_0x47b9b4[_0x5104('0x32')]);if(_0x47b9b4[_0x5104('0x33')]){delete _0x47b9b4['name'];}_0x53107e[_0x5104('0x29')](_0x65755f)[_0x5104('0x34')](_0x47b9b4);};}exports[_0x5104('0x35')]=function(_0x3dbc4f,_0x5561d3){var _0x53aef8={},_0x164847={},_0x1b419f={'count':0x0,'rows':[]};var _0x18913a=db[_0x5104('0x36')][_0x5104('0x37')];_0x164847['model']=_[_0x5104('0x38')](_0x18913a);_0x164847['query']=_[_0x5104('0x38')](_0x3dbc4f['query']);_0x164847[_0x5104('0x39')]=_[_0x5104('0x3a')](_0x164847[_0x5104('0x3b')],_0x164847[_0x5104('0x3c')]);_0x53aef8['attributes']=_['intersection'](_0x164847['model'],qs[_0x5104('0x3d')](_0x3dbc4f[_0x5104('0x3c')]['fields']));_0x53aef8['attributes']=_0x53aef8[_0x5104('0x3e')]['length']?_0x53aef8['attributes']:_0x164847[_0x5104('0x3b')];if(!_0x3dbc4f[_0x5104('0x3c')]['hasOwnProperty'](_0x5104('0x3f'))){_0x53aef8['limit']=qs[_0x5104('0x40')](_0x3dbc4f[_0x5104('0x3c')][_0x5104('0x40')]);_0x53aef8[_0x5104('0x2a')]=qs[_0x5104('0x2a')](_0x3dbc4f['query'][_0x5104('0x2a')]);}_0x53aef8[_0x5104('0x41')]=qs[_0x5104('0x42')](_0x3dbc4f[_0x5104('0x3c')]['sort']);_0x53aef8[_0x5104('0x43')]=qs['filters'](_[_0x5104('0x44')](_0x3dbc4f[_0x5104('0x3c')],_0x164847[_0x5104('0x39')]));if(_0x3dbc4f[_0x5104('0x3c')][_0x5104('0x45')]){_0x53aef8[_0x5104('0x43')]=_[_0x5104('0x46')](_0x53aef8[_0x5104('0x43')],{'$or':_[_0x5104('0x47')](_0x18913a,function(_0x4109ad){if(_0x4109ad['type'][_0x5104('0x48')]!==_0x5104('0x49')){var _0x17a4f8={};_0x17a4f8[_0x4109ad[_0x5104('0x4a')]]={'$like':'%'+_0x3dbc4f[_0x5104('0x3c')]['filter']+'%'};return _0x17a4f8;}})});}_0x53aef8=_[_0x5104('0x46')]({},_0x53aef8,_0x3dbc4f[_0x5104('0x4b')]);var _0x152859={'where':_0x53aef8[_0x5104('0x43')]};return db[_0x5104('0x36')][_0x5104('0x4c')](_0x152859)[_0x5104('0x1e')](function(_0x440691){_0x1b419f[_0x5104('0x4c')]=_0x440691;if(_0x3dbc4f['query'][_0x5104('0x4d')]){_0x53aef8[_0x5104('0x4e')]=[{'all':!![]}];}return db[_0x5104('0x36')][_0x5104('0x4f')](_0x53aef8);})[_0x5104('0x1e')](function(_0x642736){_0x1b419f['rows']=_0x642736;return _0x1b419f;})[_0x5104('0x1e')](respondWithFilteredResult(_0x5561d3,_0x53aef8))[_0x5104('0x50')](handleError(_0x5561d3,null));};exports[_0x5104('0x51')]=function(_0x73f7bd,_0x4ec4b6){var _0x1aced5={'raw':![],'where':{'id':_0x73f7bd[_0x5104('0x52')]['id']}},_0x1a1c95={};_0x1a1c95[_0x5104('0x3b')]=_[_0x5104('0x38')](db[_0x5104('0x36')][_0x5104('0x37')]);_0x1a1c95[_0x5104('0x3c')]=_[_0x5104('0x38')](_0x73f7bd[_0x5104('0x3c')]);_0x1a1c95[_0x5104('0x39')]=_['intersection'](_0x1a1c95[_0x5104('0x3b')],_0x1a1c95['query']);_0x1aced5[_0x5104('0x3e')]=_['intersection'](_0x1a1c95[_0x5104('0x3b')],qs[_0x5104('0x3d')](_0x73f7bd[_0x5104('0x3c')][_0x5104('0x3d')]));_0x1aced5['attributes']=_0x1aced5[_0x5104('0x3e')][_0x5104('0x53')]?_0x1aced5['attributes']:_0x1a1c95[_0x5104('0x3b')];if(_0x73f7bd[_0x5104('0x3c')]['includeAll']){_0x1aced5[_0x5104('0x4e')]=[{'all':!![]}];}_0x1aced5=_[_0x5104('0x46')]({},_0x1aced5,_0x73f7bd[_0x5104('0x4b')]);return db[_0x5104('0x36')][_0x5104('0x54')](_0x1aced5)[_0x5104('0x1e')](handleEntityNotFound(_0x4ec4b6,null))[_0x5104('0x1e')](respondWithResult(_0x4ec4b6,null))[_0x5104('0x50')](handleError(_0x4ec4b6,null));};exports[_0x5104('0x55')]=function(_0x1521cf,_0x5ad59a){return db[_0x5104('0x36')][_0x5104('0x55')](_0x1521cf[_0x5104('0x56')],{})['then'](respondWithResult(_0x5ad59a,0xc9))[_0x5104('0x50')](handleError(_0x5ad59a,null));};exports[_0x5104('0x31')]=function(_0x3cd625,_0xf583f6){if(_0x3cd625['body']['id']){delete _0x3cd625[_0x5104('0x56')]['id'];}return db[_0x5104('0x36')][_0x5104('0x54')]({'where':{'id':_0x3cd625[_0x5104('0x52')]['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0xf583f6,null))[_0x5104('0x1e')](saveUpdates(_0x3cd625[_0x5104('0x56')],null))[_0x5104('0x1e')](respondWithResult(_0xf583f6,null))[_0x5104('0x50')](handleError(_0xf583f6,null));};exports[_0x5104('0x57')]=function(_0x4026bd,_0x2adf37){return db[_0x5104('0x36')][_0x5104('0x54')]({'where':{'id':_0x4026bd[_0x5104('0x52')]['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0x2adf37,null))['then'](removeEntity(_0x2adf37,null))[_0x5104('0x50')](handleError(_0x2adf37,null));};exports[_0x5104('0x58')]=function(_0x5f214b,_0x46051b,_0x344122){var _0x5e2b93={};var _0x2e661b={};var _0x406abe;var _0x4033c8;return db[_0x5104('0x36')]['findOne']({'where':{'id':_0x5f214b['params']['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0x46051b,null))[_0x5104('0x1e')](function(_0xc9f708){if(_0xc9f708){_0x406abe=_0xc9f708;_0x2e661b[_0x5104('0x3b')]=_['keys'](db[_0x5104('0x59')][_0x5104('0x37')]);_0x2e661b['query']=_[_0x5104('0x38')](_0x5f214b[_0x5104('0x3c')]);_0x2e661b[_0x5104('0x39')]=_[_0x5104('0x3a')](_0x2e661b[_0x5104('0x3b')],_0x2e661b[_0x5104('0x3c')]);_0x5e2b93[_0x5104('0x3e')]=_['intersection'](_0x2e661b[_0x5104('0x3b')],qs[_0x5104('0x3d')](_0x5f214b[_0x5104('0x3c')][_0x5104('0x3d')]));_0x5e2b93[_0x5104('0x3e')]=_0x5e2b93['attributes']['length']?_0x5e2b93['attributes']:_0x2e661b[_0x5104('0x3b')];_0x5e2b93[_0x5104('0x41')]=qs[_0x5104('0x42')](_0x5f214b[_0x5104('0x3c')]['sort']);_0x5e2b93['where']=qs[_0x5104('0x39')](_[_0x5104('0x44')](_0x5f214b[_0x5104('0x3c')],_0x2e661b[_0x5104('0x39')]));if(_0x5f214b[_0x5104('0x3c')]['filter']){_0x5e2b93['where']=_['merge'](_0x5e2b93[_0x5104('0x43')],{'$or':_[_0x5104('0x47')](_0x5e2b93['attributes'],function(_0x2fae8b){var _0x3c680f={};_0x3c680f[_0x2fae8b]={'$like':'%'+_0x5f214b[_0x5104('0x3c')][_0x5104('0x45')]+'%'};return _0x3c680f;})});}_0x5e2b93=_[_0x5104('0x46')]({},_0x5e2b93,_0x5f214b[_0x5104('0x4b')]);return _0x406abe[_0x5104('0x58')](_0x5e2b93);}})[_0x5104('0x1e')](function(_0x247859){if(_0x247859){_0x4033c8=_0x247859[_0x5104('0x53')];if(!_0x5f214b[_0x5104('0x3c')][_0x5104('0x5a')](_0x5104('0x3f'))){_0x5e2b93[_0x5104('0x40')]=qs[_0x5104('0x40')](_0x5f214b[_0x5104('0x3c')][_0x5104('0x40')]);_0x5e2b93[_0x5104('0x2a')]=qs[_0x5104('0x2a')](_0x5f214b['query'][_0x5104('0x2a')]);}return _0x406abe[_0x5104('0x58')](_0x5e2b93);}})[_0x5104('0x1e')](function(_0x808ee5){if(_0x808ee5){return _0x808ee5?{'count':_0x4033c8,'rows':_0x808ee5}:null;}})[_0x5104('0x1e')](respondWithResult(_0x46051b,null))['catch'](handleError(_0x46051b,null));};exports[_0x5104('0x5b')]=function(_0x3ffc4e,_0x59fff2,_0x514ed6){var _0x296c4a={};var _0x5b4b23={};var _0x2af674;var _0x571342;return db['ZendeskConfiguration'][_0x5104('0x5c')]({'where':{'id':_0x3ffc4e['params']['id']}})['then'](handleEntityNotFound(_0x59fff2,null))[_0x5104('0x1e')](function(_0x14ce73){if(_0x14ce73){_0x2af674=_0x14ce73;_0x5b4b23[_0x5104('0x3b')]=_['keys'](db[_0x5104('0x59')][_0x5104('0x37')]);_0x5b4b23[_0x5104('0x3c')]=_[_0x5104('0x38')](_0x3ffc4e[_0x5104('0x3c')]);_0x5b4b23[_0x5104('0x39')]=_[_0x5104('0x3a')](_0x5b4b23[_0x5104('0x3b')],_0x5b4b23[_0x5104('0x3c')]);_0x296c4a['attributes']=_[_0x5104('0x3a')](_0x5b4b23[_0x5104('0x3b')],qs[_0x5104('0x3d')](_0x3ffc4e[_0x5104('0x3c')]['fields']));_0x296c4a[_0x5104('0x3e')]=_0x296c4a[_0x5104('0x3e')][_0x5104('0x53')]?_0x296c4a[_0x5104('0x3e')]:_0x5b4b23[_0x5104('0x3b')];_0x296c4a[_0x5104('0x41')]=qs[_0x5104('0x42')](_0x3ffc4e[_0x5104('0x3c')]['sort']);_0x296c4a[_0x5104('0x43')]=qs['filters'](_[_0x5104('0x44')](_0x3ffc4e[_0x5104('0x3c')],_0x5b4b23[_0x5104('0x39')]));if(_0x3ffc4e['query'][_0x5104('0x45')]){_0x296c4a['where']=_[_0x5104('0x46')](_0x296c4a[_0x5104('0x43')],{'$or':_[_0x5104('0x47')](_0x296c4a[_0x5104('0x3e')],function(_0x269c7b){var _0x1c9da3={};_0x1c9da3[_0x269c7b]={'$like':'%'+_0x3ffc4e['query'][_0x5104('0x45')]+'%'};return _0x1c9da3;})});}_0x296c4a=_[_0x5104('0x46')]({},_0x296c4a,_0x3ffc4e[_0x5104('0x4b')]);return _0x2af674[_0x5104('0x5b')](_0x296c4a);}})[_0x5104('0x1e')](function(_0x482020){if(_0x482020){_0x571342=_0x482020[_0x5104('0x53')];if(!_0x3ffc4e[_0x5104('0x3c')][_0x5104('0x5a')]('nolimit')){_0x296c4a['limit']=qs['limit'](_0x3ffc4e[_0x5104('0x3c')][_0x5104('0x40')]);_0x296c4a[_0x5104('0x2a')]=qs[_0x5104('0x2a')](_0x3ffc4e[_0x5104('0x3c')][_0x5104('0x2a')]);}return _0x2af674['getSubjects'](_0x296c4a);}})[_0x5104('0x1e')](function(_0x2ddf9e){if(_0x2ddf9e){return _0x2ddf9e?{'count':_0x571342,'rows':_0x2ddf9e}:null;}})[_0x5104('0x1e')](respondWithResult(_0x59fff2,null))['catch'](handleError(_0x59fff2,null));};exports['getDescriptions']=function(_0x1706a2,_0x51bea2,_0x18a533){var _0x1a986b={};var _0x2d5aff={};var _0x37c983;var _0x489363;return db[_0x5104('0x36')]['findOne']({'where':{'id':_0x1706a2[_0x5104('0x52')]['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0x51bea2,null))[_0x5104('0x1e')](function(_0x153296){if(_0x153296){_0x37c983=_0x153296;_0x2d5aff[_0x5104('0x3b')]=_[_0x5104('0x38')](db[_0x5104('0x59')][_0x5104('0x37')]);_0x2d5aff['query']=_[_0x5104('0x38')](_0x1706a2[_0x5104('0x3c')]);_0x2d5aff[_0x5104('0x39')]=_[_0x5104('0x3a')](_0x2d5aff[_0x5104('0x3b')],_0x2d5aff[_0x5104('0x3c')]);_0x1a986b[_0x5104('0x3e')]=_[_0x5104('0x3a')](_0x2d5aff[_0x5104('0x3b')],qs['fields'](_0x1706a2[_0x5104('0x3c')]['fields']));_0x1a986b[_0x5104('0x3e')]=_0x1a986b[_0x5104('0x3e')]['length']?_0x1a986b['attributes']:_0x2d5aff[_0x5104('0x3b')];_0x1a986b[_0x5104('0x41')]=qs[_0x5104('0x42')](_0x1706a2['query'][_0x5104('0x42')]);_0x1a986b['where']=qs[_0x5104('0x39')](_[_0x5104('0x44')](_0x1706a2['query'],_0x2d5aff['filters']));if(_0x1706a2[_0x5104('0x3c')][_0x5104('0x45')]){_0x1a986b[_0x5104('0x43')]=_[_0x5104('0x46')](_0x1a986b[_0x5104('0x43')],{'$or':_[_0x5104('0x47')](_0x1a986b[_0x5104('0x3e')],function(_0x4da225){var _0x21a3f3={};_0x21a3f3[_0x4da225]={'$like':'%'+_0x1706a2[_0x5104('0x3c')]['filter']+'%'};return _0x21a3f3;})});}_0x1a986b=_['merge']({},_0x1a986b,_0x1706a2[_0x5104('0x4b')]);return _0x37c983[_0x5104('0x5d')](_0x1a986b);}})[_0x5104('0x1e')](function(_0x11604f){if(_0x11604f){_0x489363=_0x11604f[_0x5104('0x53')];if(!_0x1706a2[_0x5104('0x3c')][_0x5104('0x5a')](_0x5104('0x3f'))){_0x1a986b['limit']=qs[_0x5104('0x40')](_0x1706a2[_0x5104('0x3c')][_0x5104('0x40')]);_0x1a986b[_0x5104('0x2a')]=qs[_0x5104('0x2a')](_0x1706a2[_0x5104('0x3c')]['offset']);}return _0x37c983[_0x5104('0x5d')](_0x1a986b);}})[_0x5104('0x1e')](function(_0x1c56ef){if(_0x1c56ef){return _0x1c56ef?{'count':_0x489363,'rows':_0x1c56ef}:null;}})[_0x5104('0x1e')](respondWithResult(_0x51bea2,null))[_0x5104('0x50')](handleError(_0x51bea2,null));};exports['getTags']=function(_0xd1326e,_0x2abfc0,_0x4b1961){var _0x397872={};var _0x78feed={};var _0x1d3e7d;var _0x24fa23;return db[_0x5104('0x36')][_0x5104('0x5c')]({'where':{'id':_0xd1326e[_0x5104('0x52')]['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0x2abfc0,null))[_0x5104('0x1e')](function(_0x4d3d3a){if(_0x4d3d3a){_0x1d3e7d=_0x4d3d3a;_0x78feed['model']=_[_0x5104('0x38')](db[_0x5104('0x5e')][_0x5104('0x37')]);_0x78feed[_0x5104('0x3c')]=_[_0x5104('0x38')](_0xd1326e[_0x5104('0x3c')]);_0x78feed['filters']=_['intersection'](_0x78feed['model'],_0x78feed['query']);_0x397872[_0x5104('0x3e')]=_[_0x5104('0x3a')](_0x78feed[_0x5104('0x3b')],qs[_0x5104('0x3d')](_0xd1326e[_0x5104('0x3c')][_0x5104('0x3d')]));_0x397872[_0x5104('0x3e')]=_0x397872[_0x5104('0x3e')][_0x5104('0x53')]?_0x397872[_0x5104('0x3e')]:_0x78feed[_0x5104('0x3b')];_0x397872[_0x5104('0x41')]=qs[_0x5104('0x42')](_0xd1326e[_0x5104('0x3c')][_0x5104('0x42')]);_0x397872['where']=qs[_0x5104('0x39')](_[_0x5104('0x44')](_0xd1326e['query'],_0x78feed[_0x5104('0x39')]));if(_0xd1326e[_0x5104('0x3c')][_0x5104('0x45')]){_0x397872[_0x5104('0x43')]=_[_0x5104('0x46')](_0x397872[_0x5104('0x43')],{'$or':_[_0x5104('0x47')](_0x397872[_0x5104('0x3e')],function(_0x33f5e7){var _0x49d19c={};_0x49d19c[_0x33f5e7]={'$like':'%'+_0xd1326e[_0x5104('0x3c')][_0x5104('0x45')]+'%'};return _0x49d19c;})});}_0x397872=_[_0x5104('0x46')]({},_0x397872,_0xd1326e[_0x5104('0x4b')]);return _0x1d3e7d['getTags'](_0x397872);}})[_0x5104('0x1e')](function(_0x10206c){if(_0x10206c){_0x24fa23=_0x10206c[_0x5104('0x53')];if(!_0xd1326e['query']['hasOwnProperty'](_0x5104('0x3f'))){_0x397872[_0x5104('0x40')]=qs[_0x5104('0x40')](_0xd1326e[_0x5104('0x3c')][_0x5104('0x40')]);_0x397872[_0x5104('0x2a')]=qs[_0x5104('0x2a')](_0xd1326e[_0x5104('0x3c')][_0x5104('0x2a')]);}return _0x1d3e7d[_0x5104('0x5f')](_0x397872);}})[_0x5104('0x1e')](function(_0x1f2dab){if(_0x1f2dab){return _0x1f2dab?{'count':_0x24fa23,'rows':_0x1f2dab}:null;}})[_0x5104('0x1e')](respondWithResult(_0x2abfc0,null))[_0x5104('0x50')](handleError(_0x2abfc0,null));};exports[_0x5104('0x60')]=function(_0x49634b,_0x2fea87,_0x259be7){if(_0x49634b[_0x5104('0x56')]['id']){delete _0x49634b['body']['id'];}return db[_0x5104('0x36')][_0x5104('0x5c')]({'where':{'id':_0x49634b[_0x5104('0x52')]['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0x2fea87,null))[_0x5104('0x1e')](function(_0x58b083){if(_0x58b083){return _0x58b083['setTags'](_0x49634b['body'][_0x5104('0x61')]||[]);}return null;})['then'](respondWithResult(_0x2fea87,null))[_0x5104('0x50')](handleError(_0x2fea87,null));};
\ No newline at end of file
+var _0x97af=['sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','merge','field','options','ZendeskConfiguration','count','includeAll','findAll','rows','show','params','include','create','body','find','getFields','findOne','ZendeskField','length','order','map','getSubjects','getDescriptions','hasOwnProperty','getTags','Tag','setTags','ids','html-pdf','rimraf','moment','bluebird','util','path'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x97af,0xb2));var _0xf97a=function(_0xc439f,_0x1494d4){_0xc439f=_0xc439f-0x0;var _0x2f437d=_0x97af[_0xc439f];return _0x2f437d;};'use strict';var pdf=require(_0xf97a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf97a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf97a('0x2'));var BPromise=require(_0xf97a('0x3'));var Mustache=require('mustache');var util=require(_0xf97a('0x4'));var path=require(_0xf97a('0x5'));var sox=require(_0xf97a('0x6'));var csv=require(_0xf97a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf97a('0x8'));var squel=require(_0xf97a('0x9'));var crypto=require(_0xf97a('0xa'));var jsforce=require(_0xf97a('0xb'));var deskjs=require(_0xf97a('0xc'));var toCsv=require(_0xf97a('0x7'));var querystring=require('querystring');var Papa=require(_0xf97a('0xd'));var Redis=require(_0xf97a('0xe'));var authService=require(_0xf97a('0xf'));var qs=require(_0xf97a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf97a('0x11'))('api');var utils=require(_0xf97a('0x12'));var config=require(_0xf97a('0x13'));var db=require(_0xf97a('0x14'))['db'];var jayson=require(_0xf97a('0x15'));var client=jayson[_0xf97a('0x16')][_0xf97a('0x17')]({'port':0x232a});function checkPasswordPattern(_0xca0a63,_0x3b21eb,_0x1fc8e3){if(_0x1fc8e3){var _0x490825=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x490825['test'](_0x3b21eb)){return _0xca0a63;}else{throw new Error(_0xf97a('0x18'));}}else{return _0xca0a63;}}function respondWithRpcPromise(_0x4a7c46,_0x5b8ab2,_0x49ef37,_0x346339){return new BPromise(function(_0xc323ba,_0x2a1513){var _0xb651b9=_0x346339||client;return _0xb651b9[_0xf97a('0x19')](_0x4a7c46,_0x49ef37)[_0xf97a('0x1a')](function(_0x4ea445){logger[_0xf97a('0x1b')](_0xf97a('0x1c'),_0x5b8ab2,_0xf97a('0x1d'));logger['debug'](_0xf97a('0x1e'),_0x5b8ab2,'request\x20sent',JSON[_0xf97a('0x1f')](_0x4ea445));if(_0x4ea445['error']){if(_0x4ea445[_0xf97a('0x20')]['code']===0x1f4){logger[_0xf97a('0x20')](_0xf97a('0x1c'),_0x5b8ab2,_0x4ea445[_0xf97a('0x20')]['message']);return _0x2a1513(_0x4ea445[_0xf97a('0x20')]['message']);}logger[_0xf97a('0x20')](_0xf97a('0x1c'),_0x5b8ab2,_0x4ea445[_0xf97a('0x20')][_0xf97a('0x21')]);return _0xc323ba(_0x4ea445[_0xf97a('0x20')][_0xf97a('0x21')]);}else{logger[_0xf97a('0x1b')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5b8ab2,_0xf97a('0x1d'));_0xc323ba(_0x4ea445[_0xf97a('0x22')][_0xf97a('0x21')]);}})[_0xf97a('0x23')](function(_0x3d2c3a){logger['error'](_0xf97a('0x1c'),_0x5b8ab2,_0x3d2c3a);_0x2a1513(_0x3d2c3a);});});}function respondWithStatusCode(_0x4994b6,_0x2d40e1){_0x2d40e1=_0x2d40e1||0xcc;return function(_0x4bf572){if(_0x4bf572){return _0x4994b6[_0xf97a('0x24')](_0x2d40e1);}return _0x4994b6[_0xf97a('0x25')](_0x2d40e1)[_0xf97a('0x26')]();};}function respondWithResult(_0x42aa22,_0x3cf65e){_0x3cf65e=_0x3cf65e||0xc8;return function(_0x4b5af3){if(_0x4b5af3){return _0x42aa22['status'](_0x3cf65e)[_0xf97a('0x27')](_0x4b5af3);}};}function respondWithFilteredResult(_0xc5be6d,_0x48db47){return function(_0x152972){if(_0x152972){var _0x417609=_0x152972['count'],_0x2ae6bc=_0x48db47[_0xf97a('0x28')],_0x447c8c=_0x48db47[_0xf97a('0x28')]+_0x48db47[_0xf97a('0x29')],_0x33e2fa;if(_0x447c8c>=_0x417609){_0x447c8c=_0x417609;_0x33e2fa=0xc8;}else{_0x33e2fa=0xce;}_0xc5be6d[_0xf97a('0x25')](_0x33e2fa);return _0xc5be6d[_0xf97a('0x2a')](_0xf97a('0x2b'),_0x2ae6bc+'-'+_0x447c8c+'/'+_0x417609)[_0xf97a('0x27')](_0x152972);}return null;};}function patchUpdates(_0x1b8fe6){return function(_0x55d418){try{jsonpatch[_0xf97a('0x2c')](_0x55d418,_0x1b8fe6,!![]);}catch(_0x1d6ab2){return BPromise[_0xf97a('0x2d')](_0x1d6ab2);}return _0x55d418[_0xf97a('0x2e')]();};}function saveUpdates(_0x56679a,_0x34c0d6){return function(_0x2f0846){if(_0x2f0846){return _0x2f0846[_0xf97a('0x2f')](_0x56679a)[_0xf97a('0x1a')](function(_0x4652f3){return _0x4652f3;});}return null;};}function removeEntity(_0x1c3c23,_0x49c940){return function(_0x454eec){if(_0x454eec){return _0x454eec[_0xf97a('0x30')]()[_0xf97a('0x1a')](function(){_0x1c3c23['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bff85,_0x45dc3f){return function(_0x2ef300){if(!_0x2ef300){_0x5bff85['sendStatus'](0x194);}return _0x2ef300;};}function handleError(_0x5dd429,_0x18ec5c){_0x18ec5c=_0x18ec5c||0x1f4;return function(_0xa176bd){logger[_0xf97a('0x20')](_0xa176bd[_0xf97a('0x31')]);if(_0xa176bd['name']){delete _0xa176bd['name'];}_0x5dd429[_0xf97a('0x25')](_0x18ec5c)[_0xf97a('0x32')](_0xa176bd);};}exports[_0xf97a('0x33')]=function(_0x1dd64e,_0x3fde36){var _0x368c42={},_0x1f0675={},_0x4b77b8={'count':0x0,'rows':[]};var _0x501f4a=db['ZendeskConfiguration'][_0xf97a('0x34')];_0x1f0675[_0xf97a('0x35')]=_[_0xf97a('0x36')](_0x501f4a);_0x1f0675['query']=_[_0xf97a('0x36')](_0x1dd64e[_0xf97a('0x37')]);_0x1f0675[_0xf97a('0x38')]=_[_0xf97a('0x39')](_0x1f0675[_0xf97a('0x35')],_0x1f0675[_0xf97a('0x37')]);_0x368c42[_0xf97a('0x3a')]=_[_0xf97a('0x39')](_0x1f0675[_0xf97a('0x35')],qs[_0xf97a('0x3b')](_0x1dd64e[_0xf97a('0x37')][_0xf97a('0x3b')]));_0x368c42[_0xf97a('0x3a')]=_0x368c42['attributes']['length']?_0x368c42[_0xf97a('0x3a')]:_0x1f0675[_0xf97a('0x35')];if(!_0x1dd64e[_0xf97a('0x37')]['hasOwnProperty'](_0xf97a('0x3c'))){_0x368c42[_0xf97a('0x29')]=qs[_0xf97a('0x29')](_0x1dd64e[_0xf97a('0x37')][_0xf97a('0x29')]);_0x368c42[_0xf97a('0x28')]=qs[_0xf97a('0x28')](_0x1dd64e[_0xf97a('0x37')][_0xf97a('0x28')]);}_0x368c42['order']=qs[_0xf97a('0x3d')](_0x1dd64e[_0xf97a('0x37')][_0xf97a('0x3d')]);_0x368c42['where']=qs['filters'](_[_0xf97a('0x3e')](_0x1dd64e[_0xf97a('0x37')],_0x1f0675['filters']));if(_0x1dd64e[_0xf97a('0x37')][_0xf97a('0x3f')]){_0x368c42[_0xf97a('0x40')]=_[_0xf97a('0x41')](_0x368c42['where'],{'$or':_['map'](_0x501f4a,function(_0x385396){if(_0x385396['type']['key']!=='VIRTUAL'){var _0x3422e3={};_0x3422e3[_0x385396[_0xf97a('0x42')]]={'$like':'%'+_0x1dd64e[_0xf97a('0x37')][_0xf97a('0x3f')]+'%'};return _0x3422e3;}})});}_0x368c42=_[_0xf97a('0x41')]({},_0x368c42,_0x1dd64e[_0xf97a('0x43')]);var _0x307643={'where':_0x368c42[_0xf97a('0x40')]};return db[_0xf97a('0x44')][_0xf97a('0x45')](_0x307643)[_0xf97a('0x1a')](function(_0x978708){_0x4b77b8[_0xf97a('0x45')]=_0x978708;if(_0x1dd64e['query'][_0xf97a('0x46')]){_0x368c42['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xf97a('0x47')](_0x368c42);})[_0xf97a('0x1a')](function(_0x5f3a07){_0x4b77b8[_0xf97a('0x48')]=_0x5f3a07;return _0x4b77b8;})[_0xf97a('0x1a')](respondWithFilteredResult(_0x3fde36,_0x368c42))[_0xf97a('0x23')](handleError(_0x3fde36,null));};exports[_0xf97a('0x49')]=function(_0x48d2c6,_0x3e8122){var _0x43fce3={'raw':![],'where':{'id':_0x48d2c6[_0xf97a('0x4a')]['id']}},_0x38cb36={};_0x38cb36[_0xf97a('0x35')]=_['keys'](db[_0xf97a('0x44')][_0xf97a('0x34')]);_0x38cb36['query']=_[_0xf97a('0x36')](_0x48d2c6[_0xf97a('0x37')]);_0x38cb36[_0xf97a('0x38')]=_['intersection'](_0x38cb36['model'],_0x38cb36['query']);_0x43fce3['attributes']=_['intersection'](_0x38cb36[_0xf97a('0x35')],qs[_0xf97a('0x3b')](_0x48d2c6['query'][_0xf97a('0x3b')]));_0x43fce3[_0xf97a('0x3a')]=_0x43fce3[_0xf97a('0x3a')]['length']?_0x43fce3[_0xf97a('0x3a')]:_0x38cb36[_0xf97a('0x35')];if(_0x48d2c6['query'][_0xf97a('0x46')]){_0x43fce3[_0xf97a('0x4b')]=[{'all':!![]}];}_0x43fce3=_[_0xf97a('0x41')]({},_0x43fce3,_0x48d2c6['options']);return db['ZendeskConfiguration']['find'](_0x43fce3)[_0xf97a('0x1a')](handleEntityNotFound(_0x3e8122,null))['then'](respondWithResult(_0x3e8122,null))[_0xf97a('0x23')](handleError(_0x3e8122,null));};exports[_0xf97a('0x4c')]=function(_0x3018a1,_0x29bf85){return db[_0xf97a('0x44')][_0xf97a('0x4c')](_0x3018a1[_0xf97a('0x4d')],{})[_0xf97a('0x1a')](respondWithResult(_0x29bf85,0xc9))[_0xf97a('0x23')](handleError(_0x29bf85,null));};exports['update']=function(_0x51c0a6,_0x7399e7){if(_0x51c0a6[_0xf97a('0x4d')]['id']){delete _0x51c0a6[_0xf97a('0x4d')]['id'];}return db[_0xf97a('0x44')][_0xf97a('0x4e')]({'where':{'id':_0x51c0a6['params']['id']}})['then'](handleEntityNotFound(_0x7399e7,null))[_0xf97a('0x1a')](saveUpdates(_0x51c0a6[_0xf97a('0x4d')],null))[_0xf97a('0x1a')](respondWithResult(_0x7399e7,null))[_0xf97a('0x23')](handleError(_0x7399e7,null));};exports[_0xf97a('0x30')]=function(_0x3ccb32,_0x332e5e){return db[_0xf97a('0x44')][_0xf97a('0x4e')]({'where':{'id':_0x3ccb32[_0xf97a('0x4a')]['id']}})[_0xf97a('0x1a')](handleEntityNotFound(_0x332e5e,null))[_0xf97a('0x1a')](removeEntity(_0x332e5e,null))[_0xf97a('0x23')](handleError(_0x332e5e,null));};exports[_0xf97a('0x4f')]=function(_0x5e8788,_0x5b3bc4,_0x381084){var _0xd8970c={};var _0x267f40={};var _0x4802e0;var _0x3cf5a4;return db[_0xf97a('0x44')][_0xf97a('0x50')]({'where':{'id':_0x5e8788[_0xf97a('0x4a')]['id']}})[_0xf97a('0x1a')](handleEntityNotFound(_0x5b3bc4,null))[_0xf97a('0x1a')](function(_0x572ffb){if(_0x572ffb){_0x4802e0=_0x572ffb;_0x267f40['model']=_[_0xf97a('0x36')](db[_0xf97a('0x51')][_0xf97a('0x34')]);_0x267f40[_0xf97a('0x37')]=_['keys'](_0x5e8788[_0xf97a('0x37')]);_0x267f40[_0xf97a('0x38')]=_['intersection'](_0x267f40['model'],_0x267f40[_0xf97a('0x37')]);_0xd8970c['attributes']=_[_0xf97a('0x39')](_0x267f40[_0xf97a('0x35')],qs[_0xf97a('0x3b')](_0x5e8788[_0xf97a('0x37')][_0xf97a('0x3b')]));_0xd8970c[_0xf97a('0x3a')]=_0xd8970c[_0xf97a('0x3a')][_0xf97a('0x52')]?_0xd8970c[_0xf97a('0x3a')]:_0x267f40['model'];_0xd8970c[_0xf97a('0x53')]=qs[_0xf97a('0x3d')](_0x5e8788['query'][_0xf97a('0x3d')]);_0xd8970c[_0xf97a('0x40')]=qs['filters'](_[_0xf97a('0x3e')](_0x5e8788[_0xf97a('0x37')],_0x267f40['filters']));if(_0x5e8788[_0xf97a('0x37')]['filter']){_0xd8970c['where']=_[_0xf97a('0x41')](_0xd8970c[_0xf97a('0x40')],{'$or':_['map'](_0xd8970c['attributes'],function(_0x300ee6){var _0x31c4d5={};_0x31c4d5[_0x300ee6]={'$like':'%'+_0x5e8788['query'][_0xf97a('0x3f')]+'%'};return _0x31c4d5;})});}_0xd8970c=_[_0xf97a('0x41')]({},_0xd8970c,_0x5e8788['options']);return _0x4802e0[_0xf97a('0x4f')](_0xd8970c);}})[_0xf97a('0x1a')](function(_0x3a9dbc){if(_0x3a9dbc){_0x3cf5a4=_0x3a9dbc[_0xf97a('0x52')];if(!_0x5e8788[_0xf97a('0x37')]['hasOwnProperty'](_0xf97a('0x3c'))){_0xd8970c[_0xf97a('0x29')]=qs[_0xf97a('0x29')](_0x5e8788['query'][_0xf97a('0x29')]);_0xd8970c[_0xf97a('0x28')]=qs[_0xf97a('0x28')](_0x5e8788[_0xf97a('0x37')][_0xf97a('0x28')]);}return _0x4802e0[_0xf97a('0x4f')](_0xd8970c);}})[_0xf97a('0x1a')](function(_0x8bd120){if(_0x8bd120){return _0x8bd120?{'count':_0x3cf5a4,'rows':_0x8bd120}:null;}})[_0xf97a('0x1a')](respondWithResult(_0x5b3bc4,null))[_0xf97a('0x23')](handleError(_0x5b3bc4,null));};exports['getSubjects']=function(_0x18a6bb,_0x5a227c,_0x93ce67){var _0x1e9e01={};var _0x37aa90={};var _0x2d27ec;var _0x3a0ecf;return db['ZendeskConfiguration'][_0xf97a('0x50')]({'where':{'id':_0x18a6bb['params']['id']}})[_0xf97a('0x1a')](handleEntityNotFound(_0x5a227c,null))['then'](function(_0x3c9fe7){if(_0x3c9fe7){_0x2d27ec=_0x3c9fe7;_0x37aa90['model']=_[_0xf97a('0x36')](db[_0xf97a('0x51')][_0xf97a('0x34')]);_0x37aa90[_0xf97a('0x37')]=_[_0xf97a('0x36')](_0x18a6bb[_0xf97a('0x37')]);_0x37aa90[_0xf97a('0x38')]=_[_0xf97a('0x39')](_0x37aa90[_0xf97a('0x35')],_0x37aa90[_0xf97a('0x37')]);_0x1e9e01[_0xf97a('0x3a')]=_[_0xf97a('0x39')](_0x37aa90[_0xf97a('0x35')],qs[_0xf97a('0x3b')](_0x18a6bb[_0xf97a('0x37')][_0xf97a('0x3b')]));_0x1e9e01[_0xf97a('0x3a')]=_0x1e9e01['attributes'][_0xf97a('0x52')]?_0x1e9e01[_0xf97a('0x3a')]:_0x37aa90['model'];_0x1e9e01[_0xf97a('0x53')]=qs[_0xf97a('0x3d')](_0x18a6bb['query'][_0xf97a('0x3d')]);_0x1e9e01[_0xf97a('0x40')]=qs[_0xf97a('0x38')](_['pick'](_0x18a6bb[_0xf97a('0x37')],_0x37aa90[_0xf97a('0x38')]));if(_0x18a6bb[_0xf97a('0x37')]['filter']){_0x1e9e01['where']=_[_0xf97a('0x41')](_0x1e9e01[_0xf97a('0x40')],{'$or':_[_0xf97a('0x54')](_0x1e9e01[_0xf97a('0x3a')],function(_0x2e8f6b){var _0x196dec={};_0x196dec[_0x2e8f6b]={'$like':'%'+_0x18a6bb[_0xf97a('0x37')]['filter']+'%'};return _0x196dec;})});}_0x1e9e01=_[_0xf97a('0x41')]({},_0x1e9e01,_0x18a6bb['options']);return _0x2d27ec[_0xf97a('0x55')](_0x1e9e01);}})['then'](function(_0xcbba34){if(_0xcbba34){_0x3a0ecf=_0xcbba34[_0xf97a('0x52')];if(!_0x18a6bb[_0xf97a('0x37')]['hasOwnProperty']('nolimit')){_0x1e9e01[_0xf97a('0x29')]=qs[_0xf97a('0x29')](_0x18a6bb[_0xf97a('0x37')]['limit']);_0x1e9e01['offset']=qs['offset'](_0x18a6bb['query']['offset']);}return _0x2d27ec['getSubjects'](_0x1e9e01);}})[_0xf97a('0x1a')](function(_0x439774){if(_0x439774){return _0x439774?{'count':_0x3a0ecf,'rows':_0x439774}:null;}})[_0xf97a('0x1a')](respondWithResult(_0x5a227c,null))[_0xf97a('0x23')](handleError(_0x5a227c,null));};exports['getDescriptions']=function(_0x37b1fb,_0x5c72f2,_0x5cdf72){var _0x2be331={};var _0x24962c={};var _0x39480d;var _0x5036e9;return db[_0xf97a('0x44')][_0xf97a('0x50')]({'where':{'id':_0x37b1fb[_0xf97a('0x4a')]['id']}})[_0xf97a('0x1a')](handleEntityNotFound(_0x5c72f2,null))[_0xf97a('0x1a')](function(_0x2379ae){if(_0x2379ae){_0x39480d=_0x2379ae;_0x24962c['model']=_[_0xf97a('0x36')](db[_0xf97a('0x51')]['rawAttributes']);_0x24962c[_0xf97a('0x37')]=_[_0xf97a('0x36')](_0x37b1fb[_0xf97a('0x37')]);_0x24962c[_0xf97a('0x38')]=_[_0xf97a('0x39')](_0x24962c['model'],_0x24962c[_0xf97a('0x37')]);_0x2be331['attributes']=_['intersection'](_0x24962c['model'],qs['fields'](_0x37b1fb[_0xf97a('0x37')]['fields']));_0x2be331['attributes']=_0x2be331['attributes']['length']?_0x2be331[_0xf97a('0x3a')]:_0x24962c['model'];_0x2be331[_0xf97a('0x53')]=qs[_0xf97a('0x3d')](_0x37b1fb[_0xf97a('0x37')]['sort']);_0x2be331[_0xf97a('0x40')]=qs[_0xf97a('0x38')](_['pick'](_0x37b1fb[_0xf97a('0x37')],_0x24962c[_0xf97a('0x38')]));if(_0x37b1fb[_0xf97a('0x37')][_0xf97a('0x3f')]){_0x2be331[_0xf97a('0x40')]=_[_0xf97a('0x41')](_0x2be331['where'],{'$or':_[_0xf97a('0x54')](_0x2be331[_0xf97a('0x3a')],function(_0x187968){var _0x41580a={};_0x41580a[_0x187968]={'$like':'%'+_0x37b1fb[_0xf97a('0x37')][_0xf97a('0x3f')]+'%'};return _0x41580a;})});}_0x2be331=_[_0xf97a('0x41')]({},_0x2be331,_0x37b1fb[_0xf97a('0x43')]);return _0x39480d[_0xf97a('0x56')](_0x2be331);}})[_0xf97a('0x1a')](function(_0x3dda6b){if(_0x3dda6b){_0x5036e9=_0x3dda6b[_0xf97a('0x52')];if(!_0x37b1fb['query'][_0xf97a('0x57')](_0xf97a('0x3c'))){_0x2be331[_0xf97a('0x29')]=qs[_0xf97a('0x29')](_0x37b1fb[_0xf97a('0x37')][_0xf97a('0x29')]);_0x2be331[_0xf97a('0x28')]=qs[_0xf97a('0x28')](_0x37b1fb[_0xf97a('0x37')][_0xf97a('0x28')]);}return _0x39480d[_0xf97a('0x56')](_0x2be331);}})['then'](function(_0x1ff2b1){if(_0x1ff2b1){return _0x1ff2b1?{'count':_0x5036e9,'rows':_0x1ff2b1}:null;}})[_0xf97a('0x1a')](respondWithResult(_0x5c72f2,null))[_0xf97a('0x23')](handleError(_0x5c72f2,null));};exports[_0xf97a('0x58')]=function(_0x118ee9,_0x136308,_0x5cc3c8){var _0x5bc210={};var _0x12ecaf={};var _0xcd1db1;var _0x51c7ad;return db[_0xf97a('0x44')]['findOne']({'where':{'id':_0x118ee9[_0xf97a('0x4a')]['id']}})[_0xf97a('0x1a')](handleEntityNotFound(_0x136308,null))[_0xf97a('0x1a')](function(_0x442a63){if(_0x442a63){_0xcd1db1=_0x442a63;_0x12ecaf[_0xf97a('0x35')]=_[_0xf97a('0x36')](db[_0xf97a('0x59')]['rawAttributes']);_0x12ecaf[_0xf97a('0x37')]=_[_0xf97a('0x36')](_0x118ee9['query']);_0x12ecaf[_0xf97a('0x38')]=_[_0xf97a('0x39')](_0x12ecaf[_0xf97a('0x35')],_0x12ecaf[_0xf97a('0x37')]);_0x5bc210[_0xf97a('0x3a')]=_[_0xf97a('0x39')](_0x12ecaf[_0xf97a('0x35')],qs[_0xf97a('0x3b')](_0x118ee9[_0xf97a('0x37')]['fields']));_0x5bc210['attributes']=_0x5bc210[_0xf97a('0x3a')]['length']?_0x5bc210['attributes']:_0x12ecaf[_0xf97a('0x35')];_0x5bc210[_0xf97a('0x53')]=qs['sort'](_0x118ee9[_0xf97a('0x37')]['sort']);_0x5bc210['where']=qs['filters'](_[_0xf97a('0x3e')](_0x118ee9['query'],_0x12ecaf['filters']));if(_0x118ee9['query'][_0xf97a('0x3f')]){_0x5bc210[_0xf97a('0x40')]=_['merge'](_0x5bc210[_0xf97a('0x40')],{'$or':_[_0xf97a('0x54')](_0x5bc210['attributes'],function(_0x32ee0a){var _0x5d5f9e={};_0x5d5f9e[_0x32ee0a]={'$like':'%'+_0x118ee9[_0xf97a('0x37')][_0xf97a('0x3f')]+'%'};return _0x5d5f9e;})});}_0x5bc210=_[_0xf97a('0x41')]({},_0x5bc210,_0x118ee9['options']);return _0xcd1db1['getTags'](_0x5bc210);}})[_0xf97a('0x1a')](function(_0xee47ef){if(_0xee47ef){_0x51c7ad=_0xee47ef[_0xf97a('0x52')];if(!_0x118ee9[_0xf97a('0x37')][_0xf97a('0x57')](_0xf97a('0x3c'))){_0x5bc210['limit']=qs[_0xf97a('0x29')](_0x118ee9['query'][_0xf97a('0x29')]);_0x5bc210[_0xf97a('0x28')]=qs[_0xf97a('0x28')](_0x118ee9[_0xf97a('0x37')]['offset']);}return _0xcd1db1['getTags'](_0x5bc210);}})[_0xf97a('0x1a')](function(_0x20921c){if(_0x20921c){return _0x20921c?{'count':_0x51c7ad,'rows':_0x20921c}:null;}})[_0xf97a('0x1a')](respondWithResult(_0x136308,null))[_0xf97a('0x23')](handleError(_0x136308,null));};exports[_0xf97a('0x5a')]=function(_0xc1f028,_0x4fb43c,_0x4fa66e){if(_0xc1f028[_0xf97a('0x4d')]['id']){delete _0xc1f028[_0xf97a('0x4d')]['id'];}return db[_0xf97a('0x44')][_0xf97a('0x50')]({'where':{'id':_0xc1f028[_0xf97a('0x4a')]['id']}})[_0xf97a('0x1a')](handleEntityNotFound(_0x4fb43c,null))[_0xf97a('0x1a')](function(_0x3e9320){if(_0x3e9320){return _0x3e9320[_0xf97a('0x5a')](_0xc1f028[_0xf97a('0x4d')][_0xf97a('0x5b')]||[]);}return null;})[_0xf97a('0x1a')](respondWithResult(_0x4fb43c,null))[_0xf97a('0x23')](handleError(_0x4fb43c,null));};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
index 7b316c7..344e40d 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x30f9=['bluebird','request-promise','path','rimraf','../../config/environment','define','int_zendesk_configurations','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x30f9,0xc5));var _0x930f=function(_0x21fc68,_0x459828){_0x21fc68=_0x21fc68-0x0;var _0x3561e1=_0x30f9[_0x21fc68];return _0x3561e1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x930f('0x0'))(_0x930f('0x1'));var moment=require(_0x930f('0x2'));var BPromise=require(_0x930f('0x3'));var rp=require(_0x930f('0x4'));var fs=require('fs');var path=require(_0x930f('0x5'));var rimraf=require(_0x930f('0x6'));var config=require(_0x930f('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x46d0ae,_0x390f7e){return _0x46d0ae[_0x930f('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0x930f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc9a3=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0xc9a3,0x83));var _0x3c9a=function(_0xbb5cc9,_0x1241a7){_0xbb5cc9=_0xbb5cc9-0x0;var _0x385d31=_0xc9a3[_0xbb5cc9];return _0x385d31;};'use strict';var _=require(_0x3c9a('0x0'));var util=require(_0x3c9a('0x1'));var logger=require(_0x3c9a('0x2'))('api');var moment=require(_0x3c9a('0x3'));var BPromise=require(_0x3c9a('0x4'));var rp=require(_0x3c9a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c9a('0x6'));var config=require(_0x3c9a('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x3c9a('0x8')]=function(_0xea1ae9,_0x4d75fe){return _0xea1ae9[_0x3c9a('0x9')](_0x3c9a('0xa'),attributes,{'tableName':_0x3c9a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
index 504c6e7..0cd154e 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6dec=['result','catch','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5b243b,_0x3391eb){var _0x52fbac=function(_0x3fd836){while(--_0x3fd836){_0x5b243b['push'](_0x5b243b['shift']());}};_0x52fbac(++_0x3391eb);}(_0x6dec,0x10a));var _0xc6de=function(_0xe5c052,_0x3972b6){_0xe5c052=_0xe5c052-0x0;var _0x46d06a=_0x6dec[_0xe5c052];return _0x46d06a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc6de('0x0'));var BPromise=require(_0xc6de('0x1'));var rs=require(_0xc6de('0x2'));var fs=require('fs');var Redis=require(_0xc6de('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc6de('0x4'));var config=require(_0xc6de('0x5'));var jayson=require(_0xc6de('0x6'));var client=jayson[_0xc6de('0x7')][_0xc6de('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36fd45,_0xe1e6ad,_0x330bab){return new BPromise(function(_0x174100,_0x3b8c57){return client[_0xc6de('0x9')](_0x36fd45,_0x330bab)[_0xc6de('0xa')](function(_0x3fda57){logger['info'](_0xc6de('0xb'),_0xe1e6ad,_0xc6de('0xc'));logger[_0xc6de('0xd')](_0xc6de('0xe'),_0xe1e6ad,_0xc6de('0xc'),JSON[_0xc6de('0xf')](_0x3fda57));if(_0x3fda57[_0xc6de('0x10')]){if(_0x3fda57[_0xc6de('0x10')][_0xc6de('0x11')]===0x1f4){logger[_0xc6de('0x10')](_0xc6de('0xb'),_0xe1e6ad,_0x3fda57[_0xc6de('0x10')][_0xc6de('0x12')]);return _0x3b8c57(_0x3fda57[_0xc6de('0x10')]['message']);}logger[_0xc6de('0x10')](_0xc6de('0xb'),_0xe1e6ad,_0x3fda57[_0xc6de('0x10')]['message']);return _0x174100(_0x3fda57[_0xc6de('0x10')][_0xc6de('0x12')]);}else{logger[_0xc6de('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0xe1e6ad,_0xc6de('0xc'));_0x174100(_0x3fda57[_0xc6de('0x14')][_0xc6de('0x12')]);}})[_0xc6de('0x15')](function(_0x164ec4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xe1e6ad,_0x164ec4);_0x3b8c57(_0x164ec4);});});}
\ No newline at end of file
+var _0x9ae3=['info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9ae3,0x197));var _0x39ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ae3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x39ae('0x0'));var util=require(_0x39ae('0x1'));var moment=require('moment');var BPromise=require(_0x39ae('0x2'));var rs=require(_0x39ae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39ae('0x4'))['db'];var utils=require(_0x39ae('0x5'));var logger=require(_0x39ae('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x39ae('0x7'));var client=jayson[_0x39ae('0x8')][_0x39ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x423295,_0x18277c,_0x1c2638){return new BPromise(function(_0x1b2957,_0x28d565){return client[_0x39ae('0xa')](_0x423295,_0x1c2638)['then'](function(_0x55d80b){logger[_0x39ae('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x18277c,_0x39ae('0xc'));logger[_0x39ae('0xd')](_0x39ae('0xe'),_0x18277c,_0x39ae('0xc'),JSON[_0x39ae('0xf')](_0x55d80b));if(_0x55d80b[_0x39ae('0x10')]){if(_0x55d80b[_0x39ae('0x10')][_0x39ae('0x11')]===0x1f4){logger['error'](_0x39ae('0x12'),_0x18277c,_0x55d80b['error'][_0x39ae('0x13')]);return _0x28d565(_0x55d80b['error'][_0x39ae('0x13')]);}logger[_0x39ae('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x18277c,_0x55d80b[_0x39ae('0x10')][_0x39ae('0x13')]);return _0x1b2957(_0x55d80b[_0x39ae('0x10')][_0x39ae('0x13')]);}else{logger['info'](_0x39ae('0x12'),_0x18277c,_0x39ae('0xc'));_0x1b2957(_0x55d80b[_0x39ae('0x14')][_0x39ae('0x13')]);}})[_0x39ae('0x15')](function(_0x236178){logger['error'](_0x39ae('0x12'),_0x18277c,_0x236178);_0x28d565(_0x236178);});});}
\ No newline at end of file
diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js
index 7091dde..30a1be6 100644
--- a/server/api/intZendeskField/index.js
+++ b/server/api/intZendeskField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x34dc9d,_0x20fa7c){var _0x124834=function(_0xe5e5f9){while(--_0xe5e5f9){_0x34dc9d['push'](_0x34dc9d['shift']());}};_0x124834(++_0x20fa7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x2c574e,_0x3ccb69){var _0x1b6b18=function(_0x242897){while(--_0x242897){_0x2c574e['push'](_0x2c574e['shift']());}};_0x1b6b18(++_0x3ccb69);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./intZendeskField.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js
index 9ed5ba3..008aacb 100644
--- a/server/api/intZendeskField/intZendeskField.attributes.js
+++ b/server/api/intZendeskField/intZendeskField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb58b=['BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x3d938d,_0x5ed96d){var _0x2b721f=function(_0x3f5ca2){while(--_0x3f5ca2){_0x3d938d['push'](_0x3d938d['shift']());}};_0x2b721f(++_0x5ed96d);}(_0xb58b,0x1f1));var _0xbb58=function(_0x54beb8,_0x3d370f){_0x54beb8=_0x54beb8-0x0;var _0x635c77=_0xb58b[_0x54beb8];return _0x635c77;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'type':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),'variable',_0xbb58('0x3'),_0xbb58('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbb58('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),_0xbb58('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xbb58('0x5')]},'idField':{'type':Sequelize[_0xbb58('0x5')]},'nameField':{'type':Sequelize[_0xbb58('0x5')]},'customField':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb58('0x5')]}};
\ No newline at end of file
+var _0x9c44=['variable','customVariable','keyValue','STRING','ENUM','string'];(function(_0x4cec3d,_0x360746){var _0x1fae2e=function(_0x245abc){while(--_0x245abc){_0x4cec3d['push'](_0x4cec3d['shift']());}};_0x1fae2e(++_0x360746);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x49c4('0x0')](_0x49c4('0x1'),_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')),'defaultValue':_0x49c4('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x49c4('0x0')]('string',_0x49c4('0x2'),_0x49c4('0x3'))},'keyContent':{'type':Sequelize[_0x49c4('0x5')]},'idField':{'type':Sequelize[_0x49c4('0x5')]},'nameField':{'type':Sequelize[_0x49c4('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x49c4('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js
index cfa573d..294e15f 100644
--- a/server/api/intZendeskField/intZendeskField.controller.js
+++ b/server/api/intZendeskField/intZendeskField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee3a=['show','params','find','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','ZendeskField','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xee3a,0xec));var _0xaee3=function(_0x29fd84,_0x100981){_0x29fd84=_0x29fd84-0x0;var _0x70a808=_0xee3a[_0x29fd84];return _0x70a808;};'use strict';var pdf=require(_0xaee3('0x0'));var emlformat=require(_0xaee3('0x1'));var rimraf=require(_0xaee3('0x2'));var zipdir=require(_0xaee3('0x3'));var jsonpatch=require(_0xaee3('0x4'));var rp=require(_0xaee3('0x5'));var moment=require(_0xaee3('0x6'));var BPromise=require(_0xaee3('0x7'));var Mustache=require('mustache');var util=require(_0xaee3('0x8'));var path=require(_0xaee3('0x9'));var sox=require('sox');var csv=require(_0xaee3('0xa'));var ejs=require(_0xaee3('0xb'));var fs=require('fs');var _=require(_0xaee3('0xc'));var squel=require(_0xaee3('0xd'));var crypto=require(_0xaee3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaee3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaee3('0x10'));var Papa=require(_0xaee3('0x11'));var Redis=require(_0xaee3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xaee3('0x13'));var hardwareService=require(_0xaee3('0x14'));var logger=require(_0xaee3('0x15'))(_0xaee3('0x16'));var utils=require(_0xaee3('0x17'));var config=require(_0xaee3('0x18'));var db=require(_0xaee3('0x19'))['db'];function respondWithStatusCode(_0x552b41,_0x2110fa){_0x2110fa=_0x2110fa||0xcc;return function(_0x3a7eed){if(_0x3a7eed){return _0x552b41['sendStatus'](_0x2110fa);}return _0x552b41[_0xaee3('0x1a')](_0x2110fa)[_0xaee3('0x1b')]();};}function respondWithResult(_0x13df75,_0x523a3d){_0x523a3d=_0x523a3d||0xc8;return function(_0x566064){if(_0x566064){return _0x13df75[_0xaee3('0x1a')](_0x523a3d)[_0xaee3('0x1c')](_0x566064);}};}function respondWithFilteredResult(_0x3089c3,_0x5823d5){return function(_0x3e189e){if(_0x3e189e){var _0x44b87e=_0x3e189e['count'],_0x841009=_0x5823d5['offset'],_0xad4c5f=_0x5823d5[_0xaee3('0x1d')]+_0x5823d5['limit'],_0x2ab344;if(_0xad4c5f>=_0x44b87e){_0xad4c5f=_0x44b87e;_0x2ab344=0xc8;}else{_0x2ab344=0xce;}_0x3089c3[_0xaee3('0x1a')](_0x2ab344);return _0x3089c3[_0xaee3('0x1e')](_0xaee3('0x1f'),_0x841009+'-'+_0xad4c5f+'/'+_0x44b87e)[_0xaee3('0x1c')](_0x3e189e);}return null;};}function patchUpdates(_0xc06326){return function(_0x5bdea9){try{jsonpatch[_0xaee3('0x20')](_0x5bdea9,_0xc06326,!![]);}catch(_0x252c74){return BPromise[_0xaee3('0x21')](_0x252c74);}return _0x5bdea9[_0xaee3('0x22')]();};}function saveUpdates(_0xd58652,_0x543063){return function(_0x62fc2c){if(_0x62fc2c){return _0x62fc2c['update'](_0xd58652)['then'](function(_0x3c3521){return _0x3c3521;});}return null;};}function removeEntity(_0x16b019,_0xd7b7ca){return function(_0x428d63){if(_0x428d63){return _0x428d63[_0xaee3('0x23')]()[_0xaee3('0x24')](function(){_0x16b019['status'](0xcc)[_0xaee3('0x1b')]();});}};}function handleEntityNotFound(_0x3b8f8f,_0xd910df){return function(_0x11367d){if(!_0x11367d){_0x3b8f8f[_0xaee3('0x25')](0x194);}return _0x11367d;};}function handleError(_0x6d1370,_0x914921){_0x914921=_0x914921||0x1f4;return function(_0x1b3895){logger[_0xaee3('0x26')](_0x1b3895[_0xaee3('0x27')]);if(_0x1b3895[_0xaee3('0x28')]){delete _0x1b3895[_0xaee3('0x28')];}_0x6d1370['status'](_0x914921)[_0xaee3('0x29')](_0x1b3895);};}exports[_0xaee3('0x2a')]=function(_0x5e9a86,_0xb5385b){var _0x4d5556={},_0x59a368={},_0x4186db={'count':0x0,'rows':[]};var _0x4898e5=db[_0xaee3('0x2b')][_0xaee3('0x2c')];_0x59a368[_0xaee3('0x2d')]=_['keys'](_0x4898e5);_0x59a368[_0xaee3('0x2e')]=_[_0xaee3('0x2f')](_0x5e9a86[_0xaee3('0x2e')]);_0x59a368[_0xaee3('0x30')]=_[_0xaee3('0x31')](_0x59a368[_0xaee3('0x2d')],_0x59a368[_0xaee3('0x2e')]);_0x4d5556[_0xaee3('0x32')]=_['intersection'](_0x59a368[_0xaee3('0x2d')],qs[_0xaee3('0x33')](_0x5e9a86[_0xaee3('0x2e')]['fields']));_0x4d5556[_0xaee3('0x32')]=_0x4d5556['attributes'][_0xaee3('0x34')]?_0x4d5556['attributes']:_0x59a368[_0xaee3('0x2d')];if(!_0x5e9a86[_0xaee3('0x2e')][_0xaee3('0x35')](_0xaee3('0x36'))){_0x4d5556[_0xaee3('0x37')]=qs['limit'](_0x5e9a86[_0xaee3('0x2e')][_0xaee3('0x37')]);_0x4d5556['offset']=qs[_0xaee3('0x1d')](_0x5e9a86[_0xaee3('0x2e')][_0xaee3('0x1d')]);}_0x4d5556[_0xaee3('0x38')]=qs[_0xaee3('0x39')](_0x5e9a86[_0xaee3('0x2e')][_0xaee3('0x39')]);_0x4d5556[_0xaee3('0x3a')]=qs[_0xaee3('0x30')](_[_0xaee3('0x3b')](_0x5e9a86[_0xaee3('0x2e')],_0x59a368[_0xaee3('0x30')]));if(_0x5e9a86[_0xaee3('0x2e')]['filter']){_0x4d5556[_0xaee3('0x3a')]=_[_0xaee3('0x3c')](_0x4d5556['where'],{'$or':_['map'](_0x4898e5,function(_0x6e8d67){if(_0x6e8d67[_0xaee3('0x3d')][_0xaee3('0x3e')]!==_0xaee3('0x3f')){var _0xa9a47e={};_0xa9a47e[_0x6e8d67[_0xaee3('0x40')]]={'$like':'%'+_0x5e9a86[_0xaee3('0x2e')]['filter']+'%'};return _0xa9a47e;}})});}_0x4d5556=_[_0xaee3('0x3c')]({},_0x4d5556,_0x5e9a86[_0xaee3('0x41')]);var _0x5ba4cc={'where':_0x4d5556[_0xaee3('0x3a')]};return db[_0xaee3('0x2b')][_0xaee3('0x42')](_0x5ba4cc)[_0xaee3('0x24')](function(_0x167c56){_0x4186db['count']=_0x167c56;if(_0x5e9a86[_0xaee3('0x2e')][_0xaee3('0x43')]){_0x4d5556[_0xaee3('0x44')]=[{'all':!![]}];}return db[_0xaee3('0x2b')][_0xaee3('0x45')](_0x4d5556);})[_0xaee3('0x24')](function(_0x33a0b5){_0x4186db[_0xaee3('0x46')]=_0x33a0b5;return _0x4186db;})[_0xaee3('0x24')](respondWithFilteredResult(_0xb5385b,_0x4d5556))[_0xaee3('0x47')](handleError(_0xb5385b,null));};exports[_0xaee3('0x48')]=function(_0x514267,_0x267703){var _0x2aacce={'raw':!![],'where':{'id':_0x514267[_0xaee3('0x49')]['id']}},_0x33d5ed={};_0x33d5ed['model']=_[_0xaee3('0x2f')](db[_0xaee3('0x2b')][_0xaee3('0x2c')]);_0x33d5ed[_0xaee3('0x2e')]=_[_0xaee3('0x2f')](_0x514267[_0xaee3('0x2e')]);_0x33d5ed['filters']=_[_0xaee3('0x31')](_0x33d5ed[_0xaee3('0x2d')],_0x33d5ed['query']);_0x2aacce[_0xaee3('0x32')]=_[_0xaee3('0x31')](_0x33d5ed[_0xaee3('0x2d')],qs[_0xaee3('0x33')](_0x514267[_0xaee3('0x2e')][_0xaee3('0x33')]));_0x2aacce[_0xaee3('0x32')]=_0x2aacce[_0xaee3('0x32')][_0xaee3('0x34')]?_0x2aacce['attributes']:_0x33d5ed['model'];if(_0x514267['query'][_0xaee3('0x43')]){_0x2aacce[_0xaee3('0x44')]=[{'all':!![]}];}_0x2aacce=_[_0xaee3('0x3c')]({},_0x2aacce,_0x514267['options']);return db['ZendeskField'][_0xaee3('0x4a')](_0x2aacce)[_0xaee3('0x24')](handleEntityNotFound(_0x267703,null))[_0xaee3('0x24')](respondWithResult(_0x267703,null))['catch'](handleError(_0x267703,null));};exports['create']=function(_0x574311,_0x29b6fb){return db['ZendeskField']['create'](_0x574311[_0xaee3('0x4b')],{})[_0xaee3('0x24')](respondWithResult(_0x29b6fb,0xc9))[_0xaee3('0x47')](handleError(_0x29b6fb,null));};exports[_0xaee3('0x4c')]=function(_0x2782f0,_0x504a31){if(_0x2782f0[_0xaee3('0x4b')]['id']){delete _0x2782f0['body']['id'];}return db[_0xaee3('0x2b')][_0xaee3('0x4a')]({'where':{'id':_0x2782f0[_0xaee3('0x49')]['id']}})['then'](handleEntityNotFound(_0x504a31,null))[_0xaee3('0x24')](saveUpdates(_0x2782f0[_0xaee3('0x4b')],null))[_0xaee3('0x24')](respondWithResult(_0x504a31,null))[_0xaee3('0x47')](handleError(_0x504a31,null));};exports['destroy']=function(_0x43511f,_0x1bddac){return db[_0xaee3('0x2b')][_0xaee3('0x4a')]({'where':{'id':_0x43511f[_0xaee3('0x49')]['id']}})[_0xaee3('0x24')](handleEntityNotFound(_0x1bddac,null))[_0xaee3('0x24')](removeEntity(_0x1bddac,null))[_0xaee3('0x47')](handleError(_0x1bddac,null));};
\ No newline at end of file
+var _0x07ef=['destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','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/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','apply','save','update','then','stack','name','send','index','ZendeskField','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','type','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','params','rawAttributes','length','include','merge','find','create','body'];(function(_0x1a0954,_0x4c4012){var _0x56c129=function(_0x31f4f9){while(--_0x31f4f9){_0x1a0954['push'](_0x1a0954['shift']());}};_0x56c129(++_0x4c4012);}(_0x07ef,0x12d));var _0xf07e=function(_0x101176,_0x1ad975){_0x101176=_0x101176-0x0;var _0x4ec27c=_0x07ef[_0x101176];return _0x4ec27c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf07e('0x0'));var rimraf=require(_0xf07e('0x1'));var zipdir=require(_0xf07e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf07e('0x3'));var moment=require(_0xf07e('0x4'));var BPromise=require(_0xf07e('0x5'));var Mustache=require(_0xf07e('0x6'));var util=require(_0xf07e('0x7'));var path=require(_0xf07e('0x8'));var sox=require('sox');var csv=require(_0xf07e('0x9'));var ejs=require(_0xf07e('0xa'));var fs=require('fs');var _=require(_0xf07e('0xb'));var squel=require(_0xf07e('0xc'));var crypto=require(_0xf07e('0xd'));var jsforce=require(_0xf07e('0xe'));var deskjs=require(_0xf07e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf07e('0x10'));var Papa=require(_0xf07e('0x11'));var Redis=require(_0xf07e('0x12'));var authService=require(_0xf07e('0x13'));var qs=require(_0xf07e('0x14'));var hardwareService=require(_0xf07e('0x15'));var logger=require(_0xf07e('0x16'))(_0xf07e('0x17'));var utils=require(_0xf07e('0x18'));var config=require(_0xf07e('0x19'));var db=require(_0xf07e('0x1a'))['db'];function respondWithStatusCode(_0x1acdaf,_0x483874){_0x483874=_0x483874||0xcc;return function(_0x1937e8){if(_0x1937e8){return _0x1acdaf[_0xf07e('0x1b')](_0x483874);}return _0x1acdaf[_0xf07e('0x1c')](_0x483874)[_0xf07e('0x1d')]();};}function respondWithResult(_0x335681,_0x16ac4a){_0x16ac4a=_0x16ac4a||0xc8;return function(_0x4f39e7){if(_0x4f39e7){return _0x335681[_0xf07e('0x1c')](_0x16ac4a)['json'](_0x4f39e7);}};}function respondWithFilteredResult(_0x54b963,_0x372fdd){return function(_0x97fb8f){if(_0x97fb8f){var _0x58953d=_0x97fb8f['count'],_0xb5a3b1=_0x372fdd[_0xf07e('0x1e')],_0x2f1bc5=_0x372fdd[_0xf07e('0x1e')]+_0x372fdd[_0xf07e('0x1f')],_0x25d1ba;if(_0x2f1bc5>=_0x58953d){_0x2f1bc5=_0x58953d;_0x25d1ba=0xc8;}else{_0x25d1ba=0xce;}_0x54b963[_0xf07e('0x1c')](_0x25d1ba);return _0x54b963[_0xf07e('0x20')]('Content-Range',_0xb5a3b1+'-'+_0x2f1bc5+'/'+_0x58953d)['json'](_0x97fb8f);}return null;};}function patchUpdates(_0x16db23){return function(_0x51b09e){try{jsonpatch[_0xf07e('0x21')](_0x51b09e,_0x16db23,!![]);}catch(_0x84ed0d){return BPromise['reject'](_0x84ed0d);}return _0x51b09e[_0xf07e('0x22')]();};}function saveUpdates(_0xb0eef7,_0x27038c){return function(_0x21f0fb){if(_0x21f0fb){return _0x21f0fb[_0xf07e('0x23')](_0xb0eef7)[_0xf07e('0x24')](function(_0x258e8f){return _0x258e8f;});}return null;};}function removeEntity(_0x17ec68,_0x647191){return function(_0x38cb41){if(_0x38cb41){return _0x38cb41['destroy']()[_0xf07e('0x24')](function(){_0x17ec68[_0xf07e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x595d20,_0x39a890){return function(_0x64a83a){if(!_0x64a83a){_0x595d20[_0xf07e('0x1b')](0x194);}return _0x64a83a;};}function handleError(_0x452d6f,_0x359046){_0x359046=_0x359046||0x1f4;return function(_0x42baea){logger['error'](_0x42baea[_0xf07e('0x25')]);if(_0x42baea[_0xf07e('0x26')]){delete _0x42baea[_0xf07e('0x26')];}_0x452d6f['status'](_0x359046)[_0xf07e('0x27')](_0x42baea);};}exports[_0xf07e('0x28')]=function(_0x245019,_0xb1380f){var _0x1e2d29={},_0x369254={},_0x556f23={'count':0x0,'rows':[]};var _0x1a3457=db[_0xf07e('0x29')]['rawAttributes'];_0x369254[_0xf07e('0x2a')]=_[_0xf07e('0x2b')](_0x1a3457);_0x369254[_0xf07e('0x2c')]=_[_0xf07e('0x2b')](_0x245019[_0xf07e('0x2c')]);_0x369254[_0xf07e('0x2d')]=_[_0xf07e('0x2e')](_0x369254['model'],_0x369254[_0xf07e('0x2c')]);_0x1e2d29['attributes']=_[_0xf07e('0x2e')](_0x369254[_0xf07e('0x2a')],qs[_0xf07e('0x2f')](_0x245019[_0xf07e('0x2c')]['fields']));_0x1e2d29['attributes']=_0x1e2d29[_0xf07e('0x30')]['length']?_0x1e2d29[_0xf07e('0x30')]:_0x369254[_0xf07e('0x2a')];if(!_0x245019[_0xf07e('0x2c')][_0xf07e('0x31')](_0xf07e('0x32'))){_0x1e2d29['limit']=qs[_0xf07e('0x1f')](_0x245019['query'][_0xf07e('0x1f')]);_0x1e2d29[_0xf07e('0x1e')]=qs[_0xf07e('0x1e')](_0x245019[_0xf07e('0x2c')][_0xf07e('0x1e')]);}_0x1e2d29[_0xf07e('0x33')]=qs[_0xf07e('0x34')](_0x245019[_0xf07e('0x2c')]['sort']);_0x1e2d29['where']=qs[_0xf07e('0x2d')](_[_0xf07e('0x35')](_0x245019[_0xf07e('0x2c')],_0x369254[_0xf07e('0x2d')]));if(_0x245019['query'][_0xf07e('0x36')]){_0x1e2d29[_0xf07e('0x37')]=_['merge'](_0x1e2d29[_0xf07e('0x37')],{'$or':_[_0xf07e('0x38')](_0x1a3457,function(_0x33fd3c){if(_0x33fd3c[_0xf07e('0x39')]['key']!==_0xf07e('0x3a')){var _0x436e3c={};_0x436e3c[_0x33fd3c[_0xf07e('0x3b')]]={'$like':'%'+_0x245019[_0xf07e('0x2c')][_0xf07e('0x36')]+'%'};return _0x436e3c;}})});}_0x1e2d29=_['merge']({},_0x1e2d29,_0x245019[_0xf07e('0x3c')]);var _0xcc6f41={'where':_0x1e2d29[_0xf07e('0x37')]};return db[_0xf07e('0x29')][_0xf07e('0x3d')](_0xcc6f41)[_0xf07e('0x24')](function(_0x475fe7){_0x556f23[_0xf07e('0x3d')]=_0x475fe7;if(_0x245019[_0xf07e('0x2c')][_0xf07e('0x3e')]){_0x1e2d29['include']=[{'all':!![]}];}return db[_0xf07e('0x29')][_0xf07e('0x3f')](_0x1e2d29);})[_0xf07e('0x24')](function(_0x4746a1){_0x556f23[_0xf07e('0x40')]=_0x4746a1;return _0x556f23;})[_0xf07e('0x24')](respondWithFilteredResult(_0xb1380f,_0x1e2d29))[_0xf07e('0x41')](handleError(_0xb1380f,null));};exports['show']=function(_0x3b5847,_0x2aa506){var _0x42ea7d={'raw':!![],'where':{'id':_0x3b5847[_0xf07e('0x42')]['id']}},_0x1fd55a={};_0x1fd55a['model']=_[_0xf07e('0x2b')](db[_0xf07e('0x29')][_0xf07e('0x43')]);_0x1fd55a[_0xf07e('0x2c')]=_[_0xf07e('0x2b')](_0x3b5847['query']);_0x1fd55a[_0xf07e('0x2d')]=_[_0xf07e('0x2e')](_0x1fd55a[_0xf07e('0x2a')],_0x1fd55a[_0xf07e('0x2c')]);_0x42ea7d[_0xf07e('0x30')]=_[_0xf07e('0x2e')](_0x1fd55a[_0xf07e('0x2a')],qs[_0xf07e('0x2f')](_0x3b5847[_0xf07e('0x2c')][_0xf07e('0x2f')]));_0x42ea7d['attributes']=_0x42ea7d[_0xf07e('0x30')][_0xf07e('0x44')]?_0x42ea7d[_0xf07e('0x30')]:_0x1fd55a[_0xf07e('0x2a')];if(_0x3b5847[_0xf07e('0x2c')]['includeAll']){_0x42ea7d[_0xf07e('0x45')]=[{'all':!![]}];}_0x42ea7d=_[_0xf07e('0x46')]({},_0x42ea7d,_0x3b5847['options']);return db['ZendeskField'][_0xf07e('0x47')](_0x42ea7d)['then'](handleEntityNotFound(_0x2aa506,null))[_0xf07e('0x24')](respondWithResult(_0x2aa506,null))[_0xf07e('0x41')](handleError(_0x2aa506,null));};exports[_0xf07e('0x48')]=function(_0x5b0d29,_0x5f390f){return db['ZendeskField']['create'](_0x5b0d29[_0xf07e('0x49')],{})[_0xf07e('0x24')](respondWithResult(_0x5f390f,0xc9))[_0xf07e('0x41')](handleError(_0x5f390f,null));};exports[_0xf07e('0x23')]=function(_0x3b1227,_0x7af804){if(_0x3b1227[_0xf07e('0x49')]['id']){delete _0x3b1227['body']['id'];}return db[_0xf07e('0x29')][_0xf07e('0x47')]({'where':{'id':_0x3b1227[_0xf07e('0x42')]['id']}})[_0xf07e('0x24')](handleEntityNotFound(_0x7af804,null))['then'](saveUpdates(_0x3b1227[_0xf07e('0x49')],null))[_0xf07e('0x24')](respondWithResult(_0x7af804,null))['catch'](handleError(_0x7af804,null));};exports[_0xf07e('0x4a')]=function(_0x6ceb7,_0x2ee6fb){return db['ZendeskField']['find']({'where':{'id':_0x6ceb7['params']['id']}})[_0xf07e('0x24')](handleEntityNotFound(_0x2ee6fb,null))[_0xf07e('0x24')](removeEntity(_0x2ee6fb,null))[_0xf07e('0x41')](handleError(_0x2ee6fb,null));};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js
index 7802b6e..18ff968 100644
--- a/server/api/intZendeskField/intZendeskField.model.js
+++ b/server/api/intZendeskField/intZendeskField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00cc=['path','rimraf','../../config/environment','./intZendeskField.attributes','exports','int_zendesk_fields','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x00cc,0x1cf));var _0xc00c=function(_0x23f0ae,_0x46eb92){_0x23f0ae=_0x23f0ae-0x0;var _0x115ca3=_0x00cc[_0x23f0ae];return _0x115ca3;};'use strict';var _=require('lodash');var util=require(_0xc00c('0x0'));var logger=require(_0xc00c('0x1'))('api');var moment=require(_0xc00c('0x2'));var BPromise=require(_0xc00c('0x3'));var rp=require(_0xc00c('0x4'));var fs=require('fs');var path=require(_0xc00c('0x5'));var rimraf=require(_0xc00c('0x6'));var config=require(_0xc00c('0x7'));var attributes=require(_0xc00c('0x8'));module[_0xc00c('0x9')]=function(_0x175f14,_0x3ff8a0){return _0x175f14['define']('ZendeskField',attributes,{'tableName':_0xc00c('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xc00c('0xb'),_0xc00c('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x90f3=['FieldId','lodash','util','request-promise','../../config/environment','define','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x28d1cd,_0x192371){var _0xdcb892=function(_0x145f6e){while(--_0x145f6e){_0x28d1cd['push'](_0x28d1cd['shift']());}};_0xdcb892(++_0x192371);}(_0x90f3,0x7f));var _0x390f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x90f3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x390f('0x0'));var util=require(_0x390f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x390f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x390f('0x3'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x287c9c,_0x23c083){return _0x287c9c[_0x390f('0x4')](_0x390f('0x5'),attributes,{'tableName':_0x390f('0x6'),'paranoid':![],'indexes':[{'name':_0x390f('0x7'),'fields':['idField',_0x390f('0x8')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js
index 5636331..1ed5c2e 100644
--- a/server/api/intZendeskField/intZendeskField.rpc.js
+++ b/server/api/intZendeskField/intZendeskField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x51c5=['code','message','ZendeskField,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error'];(function(_0x2bee11,_0x21dcce){var _0x56670f=function(_0x228fd6){while(--_0x228fd6){_0x2bee11['push'](_0x2bee11['shift']());}};_0x56670f(++_0x21dcce);}(_0x51c5,0x8f));var _0x551c=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x51c5[_0x307d86];return _0x361745;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rs=require(_0x551c('0x4'));var fs=require('fs');var Redis=require(_0x551c('0x5'));var db=require(_0x551c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x551c('0x7'))(_0x551c('0x8'));var config=require(_0x551c('0x9'));var jayson=require(_0x551c('0xa'));var client=jayson[_0x551c('0xb')][_0x551c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21dfa1,_0x196955,_0x4f3a0a){return new BPromise(function(_0x414edb,_0x15f4f8){return client[_0x551c('0xd')](_0x21dfa1,_0x4f3a0a)['then'](function(_0x17683c){logger['info']('ZendeskField,\x20%s,\x20%s',_0x196955,'request\x20sent');logger[_0x551c('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x196955,_0x551c('0xf'),JSON[_0x551c('0x10')](_0x17683c));if(_0x17683c[_0x551c('0x11')]){if(_0x17683c[_0x551c('0x11')][_0x551c('0x12')]===0x1f4){logger[_0x551c('0x11')]('ZendeskField,\x20%s,\x20%s',_0x196955,_0x17683c[_0x551c('0x11')][_0x551c('0x13')]);return _0x15f4f8(_0x17683c[_0x551c('0x11')]['message']);}logger[_0x551c('0x11')](_0x551c('0x14'),_0x196955,_0x17683c['error'][_0x551c('0x13')]);return _0x414edb(_0x17683c['error'][_0x551c('0x13')]);}else{logger[_0x551c('0x15')](_0x551c('0x14'),_0x196955,_0x551c('0xf'));_0x414edb(_0x17683c['result']['message']);}})[_0x551c('0x16')](function(_0xcdf011){logger['error'](_0x551c('0x14'),_0x196955,_0xcdf011);_0x15f4f8(_0xcdf011);});});}
\ No newline at end of file
+var _0x407f=['rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0x407f,0xc2));var _0xf407=function(_0xcc0b79,_0x74a2f7){_0xcc0b79=_0xcc0b79-0x0;var _0x2643a4=_0x407f[_0xcc0b79];return _0x2643a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf407('0x0'));var rs=require(_0xf407('0x1'));var fs=require('fs');var Redis=require(_0xf407('0x2'));var db=require(_0xf407('0x3'))['db'];var utils=require(_0xf407('0x4'));var logger=require(_0xf407('0x5'))(_0xf407('0x6'));var config=require(_0xf407('0x7'));var jayson=require(_0xf407('0x8'));var client=jayson[_0xf407('0x9')][_0xf407('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bce9d,_0x2d4ec6,_0x3ac774){return new BPromise(function(_0x38ee37,_0x3ab539){return client['request'](_0x2bce9d,_0x3ac774)[_0xf407('0xb')](function(_0xc3473a){logger[_0xf407('0xc')](_0xf407('0xd'),_0x2d4ec6,'request\x20sent');logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x2d4ec6,_0xf407('0xe'),JSON[_0xf407('0xf')](_0xc3473a));if(_0xc3473a[_0xf407('0x10')]){if(_0xc3473a[_0xf407('0x10')][_0xf407('0x11')]===0x1f4){logger['error'](_0xf407('0xd'),_0x2d4ec6,_0xc3473a[_0xf407('0x10')][_0xf407('0x12')]);return _0x3ab539(_0xc3473a[_0xf407('0x10')][_0xf407('0x12')]);}logger[_0xf407('0x10')](_0xf407('0xd'),_0x2d4ec6,_0xc3473a[_0xf407('0x10')]['message']);return _0x38ee37(_0xc3473a['error'][_0xf407('0x12')]);}else{logger['info'](_0xf407('0xd'),_0x2d4ec6,'request\x20sent');_0x38ee37(_0xc3473a['result'][_0xf407('0x12')]);}})[_0xf407('0x13')](function(_0x1cdc81){logger[_0xf407('0x10')](_0xf407('0xd'),_0x2d4ec6,_0x1cdc81);_0x3ab539(_0x1cdc81);});});}
\ No newline at end of file
diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js
index d56c787..ab2206d 100644
--- a/server/api/intZohoAccount/index.js
+++ b/server/api/intZohoAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x3e2599,_0x71dbc1){var _0xb5a956=function(_0xed7365){while(--_0xed7365){_0x3e2599['push'](_0x3e2599['shift']());}};_0xb5a956(++_0x71dbc1);}(_0xb10b,0x12a));var _0xbb10=function(_0xb2c2b4,_0x4800b2){_0xb2c2b4=_0xb2c2b4-0x0;var _0x362374=_0xb10b[_0xb2c2b4];return _0x362374;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getFields']);router['post']('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router[_0xbb10('0x10')]('/:id/configurations',auth[_0xbb10('0x9')](),controller['addConfiguration']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router;
\ No newline at end of file
+var _0x4213=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getFields','create','post','addConfiguration','put','update'];(function(_0x70e89b,_0x538aea){var _0x151710=function(_0x4d2c5e){while(--_0x4d2c5e){_0x70e89b['push'](_0x70e89b['shift']());}};_0x151710(++_0x538aea);}(_0x4213,0x77));var _0x3421=function(_0x2f255a,_0x37aed1){_0x2f255a=_0x2f255a-0x0;var _0x551181=_0x4213[_0x2f255a];return _0x551181;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var auth=require(_0x3421('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3421('0x7'));var controller=require('./intZohoAccount.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xa')]);router[_0x3421('0x8')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0x8')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller['getConfigurations']);router[_0x3421('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3421('0xd')]);router['post']('/',auth[_0x3421('0x9')](),controller[_0x3421('0xe')]);router[_0x3421('0xf')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller[_0x3421('0x10')]);router[_0x3421('0x11')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0x12')]);router[_0x3421('0x13')](_0x3421('0x14'),auth[_0x3421('0x9')](),controller[_0x3421('0x15')]);module[_0x3421('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js
index 9b1e1d1..e2e269d 100644
--- a/server/api/intZohoAccount/intZohoAccount.attributes.js
+++ b/server/api/intZohoAccount/intZohoAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x737b=['sequelize','exports','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x737b,0x117));var _0xb737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x737b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb737('0x0'));module[_0xb737('0x1')]={'name':{'type':Sequelize[_0xb737('0x2')]},'description':{'type':Sequelize[_0xb737('0x2')]},'authToken':{'type':Sequelize[_0xb737('0x2')]},'host':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb737('0x2')]}};
\ No newline at end of file
+var _0x71f5=['sequelize','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x71f5,0x13a));var _0x571f=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x71f5[_0x342700];return _0x53406f;};'use strict';var Sequelize=require(_0x571f('0x0'));module['exports']={'name':{'type':Sequelize[_0x571f('0x1')]},'description':{'type':Sequelize[_0x571f('0x1')]},'authToken':{'type':Sequelize[_0x571f('0x1')]},'host':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x571f('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js
index 4966a6a..b6d1f58 100644
--- a/server/api/intZohoAccount/intZohoAccount.controller.js
+++ b/server/api/intZohoAccount/intZohoAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x569f=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','sendStatus','stack','name','index','ZohoAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','rows','params','length','find','catch','create','body','update','findOne','ZohoConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','ZohoField','getFields','host','slice','lastIndexOf','GET','format','https://crm.%s/crm/private/json/Calls/getFields','authToken','crmapi','response','Calls','section','Call\x20Purpose','includes','push','label','customfield','true','Pick\x20List','val','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format'];(function(_0xfcfe92,_0x14ea66){var _0x166ba1=function(_0x45f01a){while(--_0x45f01a){_0xfcfe92['push'](_0xfcfe92['shift']());}};_0x166ba1(++_0x14ea66);}(_0x569f,0xef));var _0xf569=function(_0x3f06ff,_0x449b9c){_0x3f06ff=_0x3f06ff-0x0;var _0x375fcd=_0x569f[_0x3f06ff];return _0x375fcd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf569('0x0'));var rimraf=require(_0xf569('0x1'));var zipdir=require(_0xf569('0x2'));var jsonpatch=require(_0xf569('0x3'));var rp=require(_0xf569('0x4'));var moment=require(_0xf569('0x5'));var BPromise=require(_0xf569('0x6'));var Mustache=require(_0xf569('0x7'));var util=require('util');var path=require(_0xf569('0x8'));var sox=require(_0xf569('0x9'));var csv=require(_0xf569('0xa'));var ejs=require(_0xf569('0xb'));var fs=require('fs');var _=require(_0xf569('0xc'));var squel=require(_0xf569('0xd'));var crypto=require('crypto');var jsforce=require(_0xf569('0xe'));var deskjs=require(_0xf569('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf569('0x10'));var Redis=require(_0xf569('0x11'));var authService=require(_0xf569('0x12'));var qs=require(_0xf569('0x13'));var hardwareService=require(_0xf569('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf569('0x15'));var config=require(_0xf569('0x16'));var db=require(_0xf569('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xf569('0x18')][_0xf569('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2f3516,_0x186b87,_0x234396){if(_0x234396){var _0x549b58=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x549b58[_0xf569('0x1a')](_0x186b87)){return _0x2f3516;}else{throw new Error(_0xf569('0x1b'));}}else{return _0x2f3516;}}function respondWithRpcPromise(_0x190f3f,_0xe0867e,_0x372599,_0x507c83){return new BPromise(function(_0x41e8a9,_0x191e7a){var _0xf6acd5=_0x507c83||client;return _0xf6acd5[_0xf569('0x1c')](_0x190f3f,_0x372599)['then'](function(_0x423640){logger[_0xf569('0x1d')](_0xf569('0x1e'),_0xe0867e,_0xf569('0x1f'));logger[_0xf569('0x20')](_0xf569('0x21'),_0xe0867e,_0xf569('0x1f'),JSON[_0xf569('0x22')](_0x423640));if(_0x423640[_0xf569('0x23')]){if(_0x423640[_0xf569('0x23')]['code']===0x1f4){logger[_0xf569('0x23')](_0xf569('0x1e'),_0xe0867e,_0x423640['error'][_0xf569('0x24')]);return _0x191e7a(_0x423640['error'][_0xf569('0x24')]);}logger['error'](_0xf569('0x1e'),_0xe0867e,_0x423640[_0xf569('0x23')]['message']);return _0x41e8a9(_0x423640[_0xf569('0x23')][_0xf569('0x24')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0xe0867e,'request\x20sent');_0x41e8a9(_0x423640[_0xf569('0x25')][_0xf569('0x24')]);}})['catch'](function(_0x108997){logger[_0xf569('0x23')](_0xf569('0x1e'),_0xe0867e,_0x108997);_0x191e7a(_0x108997);});});}function respondWithStatusCode(_0x2c49af,_0x3219b2){_0x3219b2=_0x3219b2||0xcc;return function(_0x230e52){if(_0x230e52){return _0x2c49af['sendStatus'](_0x3219b2);}return _0x2c49af[_0xf569('0x26')](_0x3219b2)[_0xf569('0x27')]();};}function respondWithResult(_0x360f16,_0xc846b7){_0xc846b7=_0xc846b7||0xc8;return function(_0x1004eb){if(_0x1004eb){return _0x360f16[_0xf569('0x26')](_0xc846b7)[_0xf569('0x28')](_0x1004eb);}};}function respondWithFilteredResult(_0x42bb5b,_0x299696){return function(_0x4c112a){if(_0x4c112a){var _0x1450b9=_0x4c112a[_0xf569('0x29')],_0x1c7c3e=_0x299696[_0xf569('0x2a')],_0x536d56=_0x299696[_0xf569('0x2a')]+_0x299696[_0xf569('0x2b')],_0xa5c682;if(_0x536d56>=_0x1450b9){_0x536d56=_0x1450b9;_0xa5c682=0xc8;}else{_0xa5c682=0xce;}_0x42bb5b[_0xf569('0x26')](_0xa5c682);return _0x42bb5b[_0xf569('0x2c')]('Content-Range',_0x1c7c3e+'-'+_0x536d56+'/'+_0x1450b9)[_0xf569('0x28')](_0x4c112a);}return null;};}function patchUpdates(_0x3100e7){return function(_0x3fc1e0){try{jsonpatch[_0xf569('0x2d')](_0x3fc1e0,_0x3100e7,!![]);}catch(_0x45e6d1){return BPromise[_0xf569('0x2e')](_0x45e6d1);}return _0x3fc1e0[_0xf569('0x2f')]();};}function saveUpdates(_0x58b29f,_0x42a2dc){return function(_0x4a0e45){if(_0x4a0e45){return _0x4a0e45['update'](_0x58b29f)[_0xf569('0x30')](function(_0x611c30){return _0x611c30;});}return null;};}function removeEntity(_0x256e0f,_0x19a203){return function(_0x52b9b8){if(_0x52b9b8){return _0x52b9b8[_0xf569('0x31')]()[_0xf569('0x30')](function(){_0x256e0f[_0xf569('0x26')](0xcc)[_0xf569('0x27')]();});}};}function handleEntityNotFound(_0x5ecfe1,_0x2f9bd6){return function(_0x9dbf37){if(!_0x9dbf37){_0x5ecfe1[_0xf569('0x32')](0x194);}return _0x9dbf37;};}function handleError(_0x61faad,_0xd96364){_0xd96364=_0xd96364||0x1f4;return function(_0x2f4339){logger[_0xf569('0x23')](_0x2f4339[_0xf569('0x33')]);if(_0x2f4339[_0xf569('0x34')]){delete _0x2f4339['name'];}_0x61faad[_0xf569('0x26')](_0xd96364)['send'](_0x2f4339);};}exports[_0xf569('0x35')]=function(_0x441a80,_0x3351a0){var _0x41b4ae={},_0x48cfc4={},_0x270491={'count':0x0,'rows':[]};var _0x1b7cc1=db[_0xf569('0x36')][_0xf569('0x37')];_0x48cfc4[_0xf569('0x38')]=_[_0xf569('0x39')](_0x1b7cc1);_0x48cfc4[_0xf569('0x3a')]=_[_0xf569('0x39')](_0x441a80[_0xf569('0x3a')]);_0x48cfc4[_0xf569('0x3b')]=_[_0xf569('0x3c')](_0x48cfc4[_0xf569('0x38')],_0x48cfc4[_0xf569('0x3a')]);_0x41b4ae[_0xf569('0x3d')]=_['intersection'](_0x48cfc4[_0xf569('0x38')],qs[_0xf569('0x3e')](_0x441a80['query'][_0xf569('0x3e')]));_0x41b4ae['attributes']=_0x41b4ae[_0xf569('0x3d')]['length']?_0x41b4ae[_0xf569('0x3d')]:_0x48cfc4[_0xf569('0x38')];if(!_0x441a80[_0xf569('0x3a')][_0xf569('0x3f')](_0xf569('0x40'))){_0x41b4ae[_0xf569('0x2b')]=qs[_0xf569('0x2b')](_0x441a80['query']['limit']);_0x41b4ae[_0xf569('0x2a')]=qs['offset'](_0x441a80[_0xf569('0x3a')][_0xf569('0x2a')]);}_0x41b4ae[_0xf569('0x41')]=qs[_0xf569('0x42')](_0x441a80[_0xf569('0x3a')]['sort']);_0x41b4ae[_0xf569('0x43')]=qs[_0xf569('0x3b')](_[_0xf569('0x44')](_0x441a80[_0xf569('0x3a')],_0x48cfc4['filters']));if(_0x441a80['query'][_0xf569('0x45')]){_0x41b4ae[_0xf569('0x43')]=_[_0xf569('0x46')](_0x41b4ae[_0xf569('0x43')],{'$or':_[_0xf569('0x47')](_0x1b7cc1,function(_0x570de4){if(_0x570de4['type'][_0xf569('0x48')]!==_0xf569('0x49')){var _0x264385={};_0x264385[_0x570de4[_0xf569('0x4a')]]={'$like':'%'+_0x441a80[_0xf569('0x3a')]['filter']+'%'};return _0x264385;}})});}_0x41b4ae=_[_0xf569('0x46')]({},_0x41b4ae,_0x441a80[_0xf569('0x4b')]);var _0x52f054={'where':_0x41b4ae[_0xf569('0x43')]};return db[_0xf569('0x36')][_0xf569('0x29')](_0x52f054)[_0xf569('0x30')](function(_0x48ab50){_0x270491[_0xf569('0x29')]=_0x48ab50;if(_0x441a80['query'][_0xf569('0x4c')]){_0x41b4ae[_0xf569('0x4d')]=[{'all':!![]}];}return db[_0xf569('0x36')]['findAll'](_0x41b4ae);})['then'](function(_0x5158be){_0x270491[_0xf569('0x4e')]=_0x5158be;return _0x270491;})[_0xf569('0x30')](respondWithFilteredResult(_0x3351a0,_0x41b4ae))['catch'](handleError(_0x3351a0,null));};exports['show']=function(_0x27eea7,_0x2b302f){var _0x21d3e4={'raw':![],'where':{'id':_0x27eea7[_0xf569('0x4f')]['id']}},_0x3df0dc={};_0x3df0dc[_0xf569('0x38')]=_['keys'](db[_0xf569('0x36')]['rawAttributes']);_0x3df0dc[_0xf569('0x3a')]=_[_0xf569('0x39')](_0x27eea7[_0xf569('0x3a')]);_0x3df0dc[_0xf569('0x3b')]=_['intersection'](_0x3df0dc[_0xf569('0x38')],_0x3df0dc[_0xf569('0x3a')]);_0x21d3e4['attributes']=_['intersection'](_0x3df0dc['model'],qs['fields'](_0x27eea7[_0xf569('0x3a')][_0xf569('0x3e')]));_0x21d3e4[_0xf569('0x3d')]=_0x21d3e4[_0xf569('0x3d')][_0xf569('0x50')]?_0x21d3e4[_0xf569('0x3d')]:_0x3df0dc['model'];if(_0x27eea7[_0xf569('0x3a')][_0xf569('0x4c')]){_0x21d3e4[_0xf569('0x4d')]=[{'all':!![]}];}_0x21d3e4=_['merge']({},_0x21d3e4,_0x27eea7['options']);return db['ZohoAccount'][_0xf569('0x51')](_0x21d3e4)[_0xf569('0x30')](handleEntityNotFound(_0x2b302f,null))[_0xf569('0x30')](respondWithResult(_0x2b302f,null))[_0xf569('0x52')](handleError(_0x2b302f,null));};exports[_0xf569('0x53')]=function(_0x59ad88,_0x2c8be6){return db[_0xf569('0x36')]['create'](_0x59ad88[_0xf569('0x54')],{})['then'](respondWithResult(_0x2c8be6,0xc9))[_0xf569('0x52')](handleError(_0x2c8be6,null));};exports[_0xf569('0x55')]=function(_0x26b5b3,_0x25aac7){if(_0x26b5b3[_0xf569('0x54')]['id']){delete _0x26b5b3[_0xf569('0x54')]['id'];}return db[_0xf569('0x36')]['find']({'where':{'id':_0x26b5b3[_0xf569('0x4f')]['id']}})[_0xf569('0x30')](handleEntityNotFound(_0x25aac7,null))[_0xf569('0x30')](saveUpdates(_0x26b5b3[_0xf569('0x54')],null))['then'](respondWithResult(_0x25aac7,null))[_0xf569('0x52')](handleError(_0x25aac7,null));};exports[_0xf569('0x31')]=function(_0x168830,_0x1d4eb6){return db[_0xf569('0x36')][_0xf569('0x51')]({'where':{'id':_0x168830[_0xf569('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1d4eb6,null))[_0xf569('0x30')](removeEntity(_0x1d4eb6,null))[_0xf569('0x52')](handleError(_0x1d4eb6,null));};exports['getConfigurations']=function(_0x46c758,_0x32d6a8,_0x272904){var _0x251af8={};var _0x4460f3={};var _0x10f4e1;var _0x4f34de;return db[_0xf569('0x36')][_0xf569('0x56')]({'where':{'id':_0x46c758['params']['id']}})[_0xf569('0x30')](handleEntityNotFound(_0x32d6a8,null))[_0xf569('0x30')](function(_0x496980){if(_0x496980){_0x10f4e1=_0x496980;_0x4460f3['model']=_[_0xf569('0x39')](db[_0xf569('0x57')][_0xf569('0x37')]);_0x4460f3[_0xf569('0x3a')]=_[_0xf569('0x39')](_0x46c758[_0xf569('0x3a')]);_0x4460f3[_0xf569('0x3b')]=_[_0xf569('0x3c')](_0x4460f3[_0xf569('0x38')],_0x4460f3[_0xf569('0x3a')]);_0x251af8[_0xf569('0x3d')]=_['intersection'](_0x4460f3[_0xf569('0x38')],qs[_0xf569('0x3e')](_0x46c758[_0xf569('0x3a')][_0xf569('0x3e')]));_0x251af8[_0xf569('0x3d')]=_0x251af8[_0xf569('0x3d')]['length']?_0x251af8['attributes']:_0x4460f3[_0xf569('0x38')];_0x251af8[_0xf569('0x41')]=qs[_0xf569('0x42')](_0x46c758['query'][_0xf569('0x42')]);_0x251af8[_0xf569('0x43')]=qs['filters'](_[_0xf569('0x44')](_0x46c758[_0xf569('0x3a')],_0x4460f3[_0xf569('0x3b')]));if(_0x46c758[_0xf569('0x3a')][_0xf569('0x45')]){_0x251af8['where']=_[_0xf569('0x46')](_0x251af8[_0xf569('0x43')],{'$or':_[_0xf569('0x47')](_0x251af8[_0xf569('0x3d')],function(_0x4cdca6){var _0x1a3567={};_0x1a3567[_0x4cdca6]={'$like':'%'+_0x46c758[_0xf569('0x3a')]['filter']+'%'};return _0x1a3567;})});}_0x251af8=_[_0xf569('0x46')]({},_0x251af8,_0x46c758[_0xf569('0x4b')]);return _0x10f4e1[_0xf569('0x58')](_0x251af8);}})['then'](function(_0x18d3a0){if(_0x18d3a0){_0x4f34de=_0x18d3a0[_0xf569('0x50')];if(!_0x46c758[_0xf569('0x3a')][_0xf569('0x3f')]('nolimit')){_0x251af8['limit']=qs[_0xf569('0x2b')](_0x46c758[_0xf569('0x3a')][_0xf569('0x2b')]);_0x251af8[_0xf569('0x2a')]=qs[_0xf569('0x2a')](_0x46c758[_0xf569('0x3a')][_0xf569('0x2a')]);}return _0x10f4e1[_0xf569('0x58')](_0x251af8);}})[_0xf569('0x30')](function(_0x51e4b7){if(_0x51e4b7){return _0x51e4b7?{'count':_0x4f34de,'rows':_0x51e4b7}:null;}})[_0xf569('0x30')](respondWithResult(_0x32d6a8,null))['catch'](handleError(_0x32d6a8,null));};exports[_0xf569('0x59')]=function(_0x191542,_0x277616,_0x576003){if(_0x191542[_0xf569('0x54')]['id']){delete _0x191542[_0xf569('0x54')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x191542[_0xf569('0x4f')]['id']}})['then'](handleEntityNotFound(_0x277616,null))[_0xf569('0x30')](function(_0x24d612){if(_0x24d612){_0x191542['body']['AccountId']=_0x24d612['id'];_0x191542[_0xf569('0x54')][_0xf569('0x5a')]=integrations[_0xf569('0x5b')](_0x191542['body']['channel'],_0x191542[_0xf569('0x54')][_0xf569('0x5c')]);_0x191542[_0xf569('0x54')][_0xf569('0x5d')]=integrations[_0xf569('0x5e')](_0x191542['body'][_0xf569('0x5f')],_0x191542[_0xf569('0x54')]['type']);return db[_0xf569('0x57')][_0xf569('0x53')](_0x191542[_0xf569('0x54')],{'include':[{'model':db[_0xf569('0x60')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0xf569('0x5d')}]});}return null;})[_0xf569('0x30')](respondWithResult(_0x277616,null))['catch'](handleError(_0x277616,null));};exports[_0xf569('0x61')]=function(_0xc8480f,_0xf73222,_0x2765ea){var _0x422d4a='';return db[_0xf569('0x36')][_0xf569('0x56')]({'where':{'id':_0xc8480f[_0xf569('0x4f')]['id']},'attributes':['id','host','authToken']})[_0xf569('0x30')](handleEntityNotFound(_0xf73222,null))[_0xf569('0x30')](function(_0x55a0aa){if(_0x55a0aa){_0x422d4a=_0x55a0aa[_0xf569('0x62')];var _0x4fbf78=_0x422d4a[_0xf569('0x63')](-0x1);if(_0x4fbf78==='/'){_0x422d4a=_0x422d4a['substring'](0x0,_0x422d4a[_0xf569('0x64')](_0x4fbf78));}return rp({'method':_0xf569('0x65'),'uri':util[_0xf569('0x66')](_0xf569('0x67'),_0x422d4a),'qs':{'authtoken':_0x55a0aa[_0xf569('0x68')],'scope':_0xf569('0x69')},'json':!![]});}})[_0xf569('0x30')](function(_0x130e47){if(_0x130e47){if(_0x130e47['response']&&_0x130e47[_0xf569('0x6a')][_0xf569('0x23')]){throw new Error(_0x130e47[_0xf569('0x6a')]['error'][_0xf569('0x24')]);}var _0x3fbe49=[];if(_0x130e47[_0xf569('0x6b')]&&_0x130e47[_0xf569('0x6b')]['section']){if(_0x130e47[_0xf569('0x6b')][_0xf569('0x6c')]['FL']){var _0x3e248d=[_0xf569('0x6d')];for(var _0x382cb9=0x0,_0x4a1aa2=_0x130e47[_0xf569('0x6b')][_0xf569('0x6c')]['FL']['length'];_0x382cb9<_0x4a1aa2;_0x382cb9++){if(_[_0xf569('0x6e')](_0x3e248d,_0x130e47['Calls'][_0xf569('0x6c')]['FL'][_0x382cb9]['dv'])){_0x3fbe49[_0xf569('0x6f')]({'id':_0x130e47['Calls'][_0xf569('0x6c')]['FL'][_0x382cb9]['dv'],'name':_0x130e47['Calls'][_0xf569('0x6c')]['FL'][_0x382cb9][_0xf569('0x70')],'custom':_0x130e47[_0xf569('0x6b')][_0xf569('0x6c')]['FL'][_0x382cb9][_0xf569('0x71')]===_0xf569('0x72')?!![]:![],'options':_0x130e47[_0xf569('0x6b')]['section']['FL'][_0x382cb9][_0xf569('0x5c')]===_0xf569('0x73')&&_0x130e47['Calls'][_0xf569('0x6c')]['FL'][_0x382cb9][_0xf569('0x74')]?_[_0xf569('0x47')](_0x130e47[_0xf569('0x6b')][_0xf569('0x6c')]['FL'][_0x382cb9]['val'],function(_0x3e1ed6){return{'name':_0x3e1ed6,'value':_0x3e1ed6};}):[]});}}}}return{'count':_0x3fbe49[_0xf569('0x50')],'rows':_0x3fbe49};}})[_0xf569('0x30')](respondWithResult(_0xf73222,null))[_0xf569('0x52')](function(_0x48bd3d){var _0x5b9077=_0xc8480f[_0xf569('0x3a')][_0xf569('0x1a')]?0x1f4:_0x48bd3d[_0xf569('0x75')]||0x1f4;logger[_0xf569('0x23')](_0xf569('0x76'),_0xf569('0x61'),_0x5b9077,JSON[_0xf569('0x22')](_0x48bd3d));delete _0x48bd3d[_0xf569('0x34')];if(_0x5b9077===0x191){_0x5b9077=0x190;}_0xf73222[_0xf569('0x26')](_0x5b9077)[_0xf569('0x77')](_0xc8480f[_0xf569('0x3a')][_0xf569('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x48bd3d[_0xf569('0x75')]}:_0x48bd3d);});};
\ No newline at end of file
+var _0x1cf0=['Descriptions','getDescriptions','ZohoField','authToken','host','slice','lastIndexOf','GET','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','section','Call\x20Purpose','push','label','customfield','true','Pick\x20List','val','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','test','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','ZohoAccount,\x20%s,\x20%s','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','name','send','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','sort','where','pick','filter','map','type','VIRTUAL','merge','ZohoAccount','includeAll','findAll','rows','show','find','catch','create','body','params','getConfigurations','findOne','ZohoConfiguration','rawAttributes','order','options','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x1cf0,0x16c));var _0x01cf=function(_0x5ee3d3,_0x537c30){_0x5ee3d3=_0x5ee3d3-0x0;var _0x4b272f=_0x1cf0[_0x5ee3d3];return _0x4b272f;};'use strict';var pdf=require(_0x01cf('0x0'));var emlformat=require(_0x01cf('0x1'));var rimraf=require(_0x01cf('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x01cf('0x3'));var moment=require('moment');var BPromise=require(_0x01cf('0x4'));var Mustache=require('mustache');var util=require(_0x01cf('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x01cf('0x6'));var ejs=require(_0x01cf('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x01cf('0x8'));var crypto=require(_0x01cf('0x9'));var jsforce=require(_0x01cf('0xa'));var deskjs=require(_0x01cf('0xb'));var toCsv=require(_0x01cf('0x6'));var querystring=require(_0x01cf('0xc'));var Papa=require('papaparse');var Redis=require(_0x01cf('0xd'));var authService=require(_0x01cf('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x01cf('0xf'));var logger=require(_0x01cf('0x10'))(_0x01cf('0x11'));var utils=require(_0x01cf('0x12'));var config=require(_0x01cf('0x13'));var db=require(_0x01cf('0x14'))['db'];var integrations=require(_0x01cf('0x15'));var jayson=require('jayson/promise');var client=jayson[_0x01cf('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x3d19f7,_0x1ab9d2,_0x4762e3){if(_0x4762e3){var _0x2c0116=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c0116[_0x01cf('0x17')](_0x1ab9d2)){return _0x3d19f7;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3d19f7;}}function respondWithRpcPromise(_0xb6573d,_0x55b910,_0x47e928,_0x909cbc){return new BPromise(function(_0x25b766,_0x2c8716){var _0x1ed41f=_0x909cbc||client;return _0x1ed41f['request'](_0xb6573d,_0x47e928)[_0x01cf('0x18')](function(_0x453d97){logger[_0x01cf('0x19')]('ZohoAccount,\x20%s,\x20%s',_0x55b910,_0x01cf('0x1a'));logger[_0x01cf('0x1b')](_0x01cf('0x1c'),_0x55b910,_0x01cf('0x1a'),JSON[_0x01cf('0x1d')](_0x453d97));if(_0x453d97['error']){if(_0x453d97['error'][_0x01cf('0x1e')]===0x1f4){logger[_0x01cf('0x1f')](_0x01cf('0x20'),_0x55b910,_0x453d97[_0x01cf('0x1f')][_0x01cf('0x21')]);return _0x2c8716(_0x453d97['error'][_0x01cf('0x21')]);}logger[_0x01cf('0x1f')]('ZohoAccount,\x20%s,\x20%s',_0x55b910,_0x453d97[_0x01cf('0x1f')][_0x01cf('0x21')]);return _0x25b766(_0x453d97[_0x01cf('0x1f')][_0x01cf('0x21')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x55b910,'request\x20sent');_0x25b766(_0x453d97['result']['message']);}})['catch'](function(_0x3c02b5){logger[_0x01cf('0x1f')](_0x01cf('0x20'),_0x55b910,_0x3c02b5);_0x2c8716(_0x3c02b5);});});}function respondWithStatusCode(_0x151faa,_0x43127e){_0x43127e=_0x43127e||0xcc;return function(_0x4d5976){if(_0x4d5976){return _0x151faa[_0x01cf('0x22')](_0x43127e);}return _0x151faa[_0x01cf('0x23')](_0x43127e)[_0x01cf('0x24')]();};}function respondWithResult(_0x55f2dd,_0xe50592){_0xe50592=_0xe50592||0xc8;return function(_0x316958){if(_0x316958){return _0x55f2dd[_0x01cf('0x23')](_0xe50592)[_0x01cf('0x25')](_0x316958);}};}function respondWithFilteredResult(_0x336a82,_0x34a160){return function(_0x3dd87e){if(_0x3dd87e){var _0x56e051=_0x3dd87e[_0x01cf('0x26')],_0x344323=_0x34a160[_0x01cf('0x27')],_0x5e3361=_0x34a160['offset']+_0x34a160[_0x01cf('0x28')],_0x5a5b93;if(_0x5e3361>=_0x56e051){_0x5e3361=_0x56e051;_0x5a5b93=0xc8;}else{_0x5a5b93=0xce;}_0x336a82[_0x01cf('0x23')](_0x5a5b93);return _0x336a82[_0x01cf('0x29')](_0x01cf('0x2a'),_0x344323+'-'+_0x5e3361+'/'+_0x56e051)[_0x01cf('0x25')](_0x3dd87e);}return null;};}function patchUpdates(_0x4a493d){return function(_0x5dd781){try{jsonpatch[_0x01cf('0x2b')](_0x5dd781,_0x4a493d,!![]);}catch(_0x27e739){return BPromise[_0x01cf('0x2c')](_0x27e739);}return _0x5dd781[_0x01cf('0x2d')]();};}function saveUpdates(_0x48a69f,_0x297cc2){return function(_0x4154c1){if(_0x4154c1){return _0x4154c1[_0x01cf('0x2e')](_0x48a69f)[_0x01cf('0x18')](function(_0x7818a2){return _0x7818a2;});}return null;};}function removeEntity(_0x500e12,_0x136a15){return function(_0x15bc82){if(_0x15bc82){return _0x15bc82['destroy']()['then'](function(){_0x500e12[_0x01cf('0x23')](0xcc)[_0x01cf('0x24')]();});}};}function handleEntityNotFound(_0x55972e,_0x414579){return function(_0x37cf4b){if(!_0x37cf4b){_0x55972e['sendStatus'](0x194);}return _0x37cf4b;};}function handleError(_0x6fbbc4,_0x2d2a06){_0x2d2a06=_0x2d2a06||0x1f4;return function(_0x2bf033){logger[_0x01cf('0x1f')](_0x2bf033['stack']);if(_0x2bf033['name']){delete _0x2bf033[_0x01cf('0x2f')];}_0x6fbbc4['status'](_0x2d2a06)[_0x01cf('0x30')](_0x2bf033);};}exports['index']=function(_0x37a3fb,_0x30b5fd){var _0x52c0ed={},_0x5631a7={},_0x12c8e9={'count':0x0,'rows':[]};var _0x26f1cd=db['ZohoAccount']['rawAttributes'];_0x5631a7[_0x01cf('0x31')]=_['keys'](_0x26f1cd);_0x5631a7['query']=_[_0x01cf('0x32')](_0x37a3fb['query']);_0x5631a7[_0x01cf('0x33')]=_[_0x01cf('0x34')](_0x5631a7[_0x01cf('0x31')],_0x5631a7['query']);_0x52c0ed[_0x01cf('0x35')]=_['intersection'](_0x5631a7[_0x01cf('0x31')],qs['fields'](_0x37a3fb[_0x01cf('0x36')][_0x01cf('0x37')]));_0x52c0ed[_0x01cf('0x35')]=_0x52c0ed['attributes'][_0x01cf('0x38')]?_0x52c0ed['attributes']:_0x5631a7[_0x01cf('0x31')];if(!_0x37a3fb[_0x01cf('0x36')][_0x01cf('0x39')]('nolimit')){_0x52c0ed[_0x01cf('0x28')]=qs[_0x01cf('0x28')](_0x37a3fb['query'][_0x01cf('0x28')]);_0x52c0ed['offset']=qs[_0x01cf('0x27')](_0x37a3fb['query']['offset']);}_0x52c0ed['order']=qs[_0x01cf('0x3a')](_0x37a3fb[_0x01cf('0x36')][_0x01cf('0x3a')]);_0x52c0ed[_0x01cf('0x3b')]=qs[_0x01cf('0x33')](_[_0x01cf('0x3c')](_0x37a3fb[_0x01cf('0x36')],_0x5631a7[_0x01cf('0x33')]));if(_0x37a3fb[_0x01cf('0x36')][_0x01cf('0x3d')]){_0x52c0ed[_0x01cf('0x3b')]=_['merge'](_0x52c0ed[_0x01cf('0x3b')],{'$or':_[_0x01cf('0x3e')](_0x26f1cd,function(_0xed30a9){if(_0xed30a9[_0x01cf('0x3f')]['key']!==_0x01cf('0x40')){var _0x14d99d={};_0x14d99d[_0xed30a9['field']]={'$like':'%'+_0x37a3fb[_0x01cf('0x36')][_0x01cf('0x3d')]+'%'};return _0x14d99d;}})});}_0x52c0ed=_[_0x01cf('0x41')]({},_0x52c0ed,_0x37a3fb['options']);var _0x3892c3={'where':_0x52c0ed[_0x01cf('0x3b')]};return db[_0x01cf('0x42')]['count'](_0x3892c3)[_0x01cf('0x18')](function(_0x49d75a){_0x12c8e9[_0x01cf('0x26')]=_0x49d75a;if(_0x37a3fb[_0x01cf('0x36')][_0x01cf('0x43')]){_0x52c0ed['include']=[{'all':!![]}];}return db[_0x01cf('0x42')][_0x01cf('0x44')](_0x52c0ed);})[_0x01cf('0x18')](function(_0x34c503){_0x12c8e9[_0x01cf('0x45')]=_0x34c503;return _0x12c8e9;})['then'](respondWithFilteredResult(_0x30b5fd,_0x52c0ed))['catch'](handleError(_0x30b5fd,null));};exports[_0x01cf('0x46')]=function(_0x113370,_0x85a136){var _0x349a54={'raw':![],'where':{'id':_0x113370['params']['id']}},_0x4317e9={};_0x4317e9[_0x01cf('0x31')]=_[_0x01cf('0x32')](db[_0x01cf('0x42')]['rawAttributes']);_0x4317e9[_0x01cf('0x36')]=_[_0x01cf('0x32')](_0x113370['query']);_0x4317e9[_0x01cf('0x33')]=_[_0x01cf('0x34')](_0x4317e9['model'],_0x4317e9[_0x01cf('0x36')]);_0x349a54[_0x01cf('0x35')]=_[_0x01cf('0x34')](_0x4317e9[_0x01cf('0x31')],qs[_0x01cf('0x37')](_0x113370[_0x01cf('0x36')][_0x01cf('0x37')]));_0x349a54['attributes']=_0x349a54['attributes'][_0x01cf('0x38')]?_0x349a54[_0x01cf('0x35')]:_0x4317e9[_0x01cf('0x31')];if(_0x113370['query'][_0x01cf('0x43')]){_0x349a54['include']=[{'all':!![]}];}_0x349a54=_[_0x01cf('0x41')]({},_0x349a54,_0x113370['options']);return db[_0x01cf('0x42')][_0x01cf('0x47')](_0x349a54)[_0x01cf('0x18')](handleEntityNotFound(_0x85a136,null))[_0x01cf('0x18')](respondWithResult(_0x85a136,null))[_0x01cf('0x48')](handleError(_0x85a136,null));};exports[_0x01cf('0x49')]=function(_0x4f2a36,_0x468d8c){return db[_0x01cf('0x42')][_0x01cf('0x49')](_0x4f2a36[_0x01cf('0x4a')],{})[_0x01cf('0x18')](respondWithResult(_0x468d8c,0xc9))['catch'](handleError(_0x468d8c,null));};exports[_0x01cf('0x2e')]=function(_0x4ecfd4,_0xabb375){if(_0x4ecfd4[_0x01cf('0x4a')]['id']){delete _0x4ecfd4[_0x01cf('0x4a')]['id'];}return db['ZohoAccount'][_0x01cf('0x47')]({'where':{'id':_0x4ecfd4[_0x01cf('0x4b')]['id']}})[_0x01cf('0x18')](handleEntityNotFound(_0xabb375,null))[_0x01cf('0x18')](saveUpdates(_0x4ecfd4[_0x01cf('0x4a')],null))['then'](respondWithResult(_0xabb375,null))[_0x01cf('0x48')](handleError(_0xabb375,null));};exports['destroy']=function(_0x3d1878,_0x1d395c){return db['ZohoAccount'][_0x01cf('0x47')]({'where':{'id':_0x3d1878[_0x01cf('0x4b')]['id']}})[_0x01cf('0x18')](handleEntityNotFound(_0x1d395c,null))[_0x01cf('0x18')](removeEntity(_0x1d395c,null))[_0x01cf('0x48')](handleError(_0x1d395c,null));};exports[_0x01cf('0x4c')]=function(_0x2ee302,_0x1f7af2,_0x26ea75){var _0x40e59d={};var _0x4a313d={};var _0x599e65;var _0x2968e6;return db[_0x01cf('0x42')][_0x01cf('0x4d')]({'where':{'id':_0x2ee302['params']['id']}})[_0x01cf('0x18')](handleEntityNotFound(_0x1f7af2,null))['then'](function(_0x59086d){if(_0x59086d){_0x599e65=_0x59086d;_0x4a313d[_0x01cf('0x31')]=_[_0x01cf('0x32')](db[_0x01cf('0x4e')][_0x01cf('0x4f')]);_0x4a313d[_0x01cf('0x36')]=_[_0x01cf('0x32')](_0x2ee302[_0x01cf('0x36')]);_0x4a313d[_0x01cf('0x33')]=_['intersection'](_0x4a313d[_0x01cf('0x31')],_0x4a313d['query']);_0x40e59d['attributes']=_[_0x01cf('0x34')](_0x4a313d[_0x01cf('0x31')],qs[_0x01cf('0x37')](_0x2ee302[_0x01cf('0x36')][_0x01cf('0x37')]));_0x40e59d[_0x01cf('0x35')]=_0x40e59d[_0x01cf('0x35')][_0x01cf('0x38')]?_0x40e59d[_0x01cf('0x35')]:_0x4a313d['model'];_0x40e59d[_0x01cf('0x50')]=qs[_0x01cf('0x3a')](_0x2ee302[_0x01cf('0x36')][_0x01cf('0x3a')]);_0x40e59d['where']=qs[_0x01cf('0x33')](_['pick'](_0x2ee302['query'],_0x4a313d[_0x01cf('0x33')]));if(_0x2ee302[_0x01cf('0x36')][_0x01cf('0x3d')]){_0x40e59d[_0x01cf('0x3b')]=_[_0x01cf('0x41')](_0x40e59d[_0x01cf('0x3b')],{'$or':_['map'](_0x40e59d['attributes'],function(_0x351bb1){var _0x1c205e={};_0x1c205e[_0x351bb1]={'$like':'%'+_0x2ee302[_0x01cf('0x36')][_0x01cf('0x3d')]+'%'};return _0x1c205e;})});}_0x40e59d=_[_0x01cf('0x41')]({},_0x40e59d,_0x2ee302[_0x01cf('0x51')]);return _0x599e65[_0x01cf('0x4c')](_0x40e59d);}})[_0x01cf('0x18')](function(_0x3d024b){if(_0x3d024b){_0x2968e6=_0x3d024b[_0x01cf('0x38')];if(!_0x2ee302[_0x01cf('0x36')][_0x01cf('0x39')](_0x01cf('0x52'))){_0x40e59d[_0x01cf('0x28')]=qs[_0x01cf('0x28')](_0x2ee302['query'][_0x01cf('0x28')]);_0x40e59d[_0x01cf('0x27')]=qs[_0x01cf('0x27')](_0x2ee302['query'][_0x01cf('0x27')]);}return _0x599e65['getConfigurations'](_0x40e59d);}})['then'](function(_0x31fc56){if(_0x31fc56){return _0x31fc56?{'count':_0x2968e6,'rows':_0x31fc56}:null;}})['then'](respondWithResult(_0x1f7af2,null))['catch'](handleError(_0x1f7af2,null));};exports[_0x01cf('0x53')]=function(_0xa5dcc6,_0x1a701d,_0x3a4369){if(_0xa5dcc6[_0x01cf('0x4a')]['id']){delete _0xa5dcc6[_0x01cf('0x4a')]['id'];}return db['ZohoAccount'][_0x01cf('0x4d')]({'where':{'id':_0xa5dcc6[_0x01cf('0x4b')]['id']}})[_0x01cf('0x18')](handleEntityNotFound(_0x1a701d,null))[_0x01cf('0x18')](function(_0x46a20d){if(_0x46a20d){_0xa5dcc6['body'][_0x01cf('0x54')]=_0x46a20d['id'];_0xa5dcc6[_0x01cf('0x4a')][_0x01cf('0x55')]=integrations[_0x01cf('0x56')](_0xa5dcc6[_0x01cf('0x4a')][_0x01cf('0x57')],_0xa5dcc6[_0x01cf('0x4a')][_0x01cf('0x3f')]);_0xa5dcc6[_0x01cf('0x4a')][_0x01cf('0x58')]=integrations[_0x01cf('0x59')](_0xa5dcc6[_0x01cf('0x4a')][_0x01cf('0x57')],_0xa5dcc6[_0x01cf('0x4a')][_0x01cf('0x3f')]);return db[_0x01cf('0x4e')]['create'](_0xa5dcc6['body'],{'include':[{'model':db[_0x01cf('0x5a')],'as':'Subjects'},{'model':db[_0x01cf('0x5a')],'as':'Descriptions'}]});}return null;})[_0x01cf('0x18')](respondWithResult(_0x1a701d,null))[_0x01cf('0x48')](handleError(_0x1a701d,null));};exports['getFields']=function(_0x14a645,_0x3ce781,_0x5ef747){var _0x41ee76='';return db[_0x01cf('0x42')][_0x01cf('0x4d')]({'where':{'id':_0x14a645['params']['id']},'attributes':['id','host',_0x01cf('0x5b')]})['then'](handleEntityNotFound(_0x3ce781,null))['then'](function(_0x2c6b14){if(_0x2c6b14){_0x41ee76=_0x2c6b14[_0x01cf('0x5c')];var _0x22f581=_0x41ee76[_0x01cf('0x5d')](-0x1);if(_0x22f581==='/'){_0x41ee76=_0x41ee76['substring'](0x0,_0x41ee76[_0x01cf('0x5e')](_0x22f581));}return rp({'method':_0x01cf('0x5f'),'uri':util[_0x01cf('0x60')](_0x01cf('0x61'),_0x41ee76),'qs':{'authtoken':_0x2c6b14['authToken'],'scope':_0x01cf('0x62')},'json':!![]});}})[_0x01cf('0x18')](function(_0x32eed0){if(_0x32eed0){if(_0x32eed0[_0x01cf('0x63')]&&_0x32eed0[_0x01cf('0x63')]['error']){throw new Error(_0x32eed0[_0x01cf('0x63')][_0x01cf('0x1f')]['message']);}var _0x404947=[];if(_0x32eed0[_0x01cf('0x64')]&&_0x32eed0[_0x01cf('0x64')][_0x01cf('0x65')]){if(_0x32eed0['Calls'][_0x01cf('0x65')]['FL']){var _0x41a297=[_0x01cf('0x66')];for(var _0x5cd3d6=0x0,_0x1adc1f=_0x32eed0[_0x01cf('0x64')][_0x01cf('0x65')]['FL'][_0x01cf('0x38')];_0x5cd3d6<_0x1adc1f;_0x5cd3d6++){if(_['includes'](_0x41a297,_0x32eed0['Calls']['section']['FL'][_0x5cd3d6]['dv'])){_0x404947[_0x01cf('0x67')]({'id':_0x32eed0[_0x01cf('0x64')][_0x01cf('0x65')]['FL'][_0x5cd3d6]['dv'],'name':_0x32eed0[_0x01cf('0x64')][_0x01cf('0x65')]['FL'][_0x5cd3d6][_0x01cf('0x68')],'custom':_0x32eed0[_0x01cf('0x64')][_0x01cf('0x65')]['FL'][_0x5cd3d6][_0x01cf('0x69')]===_0x01cf('0x6a')?!![]:![],'options':_0x32eed0[_0x01cf('0x64')][_0x01cf('0x65')]['FL'][_0x5cd3d6][_0x01cf('0x3f')]===_0x01cf('0x6b')&&_0x32eed0[_0x01cf('0x64')][_0x01cf('0x65')]['FL'][_0x5cd3d6][_0x01cf('0x6c')]?_[_0x01cf('0x3e')](_0x32eed0['Calls'][_0x01cf('0x65')]['FL'][_0x5cd3d6]['val'],function(_0x5d0bfb){return{'name':_0x5d0bfb,'value':_0x5d0bfb};}):[]});}}}}return{'count':_0x404947[_0x01cf('0x38')],'rows':_0x404947};}})[_0x01cf('0x18')](respondWithResult(_0x3ce781,null))['catch'](function(_0x1b6845){var _0x2faa69=_0x14a645[_0x01cf('0x36')][_0x01cf('0x17')]?0x1f4:_0x1b6845[_0x01cf('0x6d')]||0x1f4;logger[_0x01cf('0x1f')](_0x01cf('0x6e'),_0x01cf('0x6f'),_0x2faa69,JSON['stringify'](_0x1b6845));delete _0x1b6845['name'];if(_0x2faa69===0x191){_0x2faa69=0x190;}_0x3ce781['status'](_0x2faa69)['send'](_0x14a645['query'][_0x01cf('0x17')]?{'message':_0x01cf('0x70'),'statusCode':_0x1b6845['statusCode']}:_0x1b6845);});};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js
index 5bb57ba..1bc25d4 100644
--- a/server/api/intZohoAccount/intZohoAccount.model.js
+++ b/server/api/intZohoAccount/intZohoAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcc65=['int_zoho_accounts','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xcc65,0x1b1));var _0x5cc6=function(_0x4bf5ec,_0x333deb){_0x4bf5ec=_0x4bf5ec-0x0;var _0x128359=_0xcc65[_0x4bf5ec];return _0x128359;};'use strict';var _=require(_0x5cc6('0x0'));var util=require('util');var logger=require(_0x5cc6('0x1'))('api');var moment=require(_0x5cc6('0x2'));var BPromise=require(_0x5cc6('0x3'));var rp=require(_0x5cc6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5cc6('0x5'));var attributes=require(_0x5cc6('0x6'));var integrations=require(_0x5cc6('0x7'));module[_0x5cc6('0x8')]=function(_0x5e1cee,_0xfc7d6d){return _0x5e1cee[_0x5cc6('0x9')](_0x5cc6('0xa'),attributes,{'tableName':_0x5cc6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d68=['moment','bluebird','request-promise','path','rimraf','exports','define','ZohoAccount','lodash','util','../../config/logger','api'];(function(_0xdb6398,_0x2d07b3){var _0x5dd76b=function(_0x40136a){while(--_0x40136a){_0xdb6398['push'](_0xdb6398['shift']());}};_0x5dd76b(++_0x2d07b3);}(_0x6d68,0x104));var _0x86d6=function(_0x3b83ad,_0x51290d){_0x3b83ad=_0x3b83ad-0x0;var _0x20e6fd=_0x6d68[_0x3b83ad];return _0x20e6fd;};'use strict';var _=require(_0x86d6('0x0'));var util=require(_0x86d6('0x1'));var logger=require(_0x86d6('0x2'))(_0x86d6('0x3'));var moment=require(_0x86d6('0x4'));var BPromise=require(_0x86d6('0x5'));var rp=require(_0x86d6('0x6'));var fs=require('fs');var path=require(_0x86d6('0x7'));var rimraf=require(_0x86d6('0x8'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x86d6('0x9')]=function(_0x19e8de,_0x16fc86){return _0x19e8de[_0x86d6('0xa')](_0x86d6('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js
index 1217d9b..9b6e06f 100644
--- a/server/api/intZohoAccount/intZohoAccount.rpc.js
+++ b/server/api/intZohoAccount/intZohoAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x956c=['attributes','then','info','GetZohoAccount','catch','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoAccount','findAll','options','raw','where','limit','include','map','model'];(function(_0x5178a5,_0x53a158){var _0x2467e6=function(_0x2e7ff9){while(--_0x2e7ff9){_0x5178a5['push'](_0x5178a5['shift']());}};_0x2467e6(++_0x53a158);}(_0x956c,0x1d5));var _0xc956=function(_0x3a6201,_0x514193){_0x3a6201=_0x3a6201-0x0;var _0x3a37af=_0x956c[_0x3a6201];return _0x3a37af;};'use strict';var _=require(_0xc956('0x0'));var util=require(_0xc956('0x1'));var moment=require(_0xc956('0x2'));var BPromise=require('bluebird');var rs=require(_0xc956('0x3'));var fs=require('fs');var Redis=require(_0xc956('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc956('0x5'));var logger=require('../../config/logger')(_0xc956('0x6'));var config=require('../../config/environment');var jayson=require(_0xc956('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35a20e,_0x4722a2,_0x2609cf){return new BPromise(function(_0x4b5dd6,_0xf25ec){return client[_0xc956('0x8')](_0x35a20e,_0x2609cf)['then'](function(_0x557676){logger['info'](_0xc956('0x9'),_0x4722a2,_0xc956('0xa'));logger[_0xc956('0xb')](_0xc956('0xc'),_0x4722a2,_0xc956('0xa'),JSON[_0xc956('0xd')](_0x557676));if(_0x557676[_0xc956('0xe')]){if(_0x557676[_0xc956('0xe')][_0xc956('0xf')]===0x1f4){logger['error'](_0xc956('0x9'),_0x4722a2,_0x557676[_0xc956('0xe')][_0xc956('0x10')]);return _0xf25ec(_0x557676[_0xc956('0xe')][_0xc956('0x10')]);}logger[_0xc956('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x4722a2,_0x557676[_0xc956('0xe')][_0xc956('0x10')]);return _0x4b5dd6(_0x557676[_0xc956('0xe')][_0xc956('0x10')]);}else{logger['info'](_0xc956('0x9'),_0x4722a2,_0xc956('0xa'));_0x4b5dd6(_0x557676['result']['message']);}})['catch'](function(_0x3ea285){logger['error'](_0xc956('0x9'),_0x4722a2,_0x3ea285);_0xf25ec(_0x3ea285);});});}exports['GetZohoAccount']=function(_0x154ec6){var _0x2899eb=this;return new Promise(function(_0x51a8c2,_0x35ec6a){return db[_0xc956('0x11')][_0xc956('0x12')]({'raw':_0x154ec6['options']?_0x154ec6[_0xc956('0x13')][_0xc956('0x14')]===undefined?!![]:![]:!![],'where':_0x154ec6[_0xc956('0x13')]?_0x154ec6[_0xc956('0x13')][_0xc956('0x15')]||null:null,'attributes':_0x154ec6[_0xc956('0x13')]?_0x154ec6[_0xc956('0x13')]['attributes']||null:null,'limit':_0x154ec6['options']?_0x154ec6['options'][_0xc956('0x16')]||null:null,'include':_0x154ec6[_0xc956('0x13')]?_0x154ec6['options'][_0xc956('0x17')]?_[_0xc956('0x18')](_0x154ec6[_0xc956('0x13')][_0xc956('0x17')],function(_0x709100){return{'model':db[_0x709100['model']],'as':_0x709100['as'],'attributes':_0x709100['attributes'],'include':_0x709100[_0xc956('0x17')]?_['map'](_0x709100[_0xc956('0x17')],function(_0x11bb49){return{'model':db[_0x11bb49[_0xc956('0x19')]],'as':_0x11bb49['as'],'attributes':_0x11bb49[_0xc956('0x1a')],'include':_0x11bb49['include']?_[_0xc956('0x18')](_0x11bb49[_0xc956('0x17')],function(_0x47815e){return{'model':db[_0x47815e['model']],'as':_0x47815e['as'],'attributes':_0x47815e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc956('0x1b')](function(_0x942733){logger[_0xc956('0x1c')](_0xc956('0x1d'),_0x154ec6);logger[_0xc956('0xb')]('GetZohoAccount',_0x154ec6,JSON[_0xc956('0xd')](_0x942733));_0x51a8c2(_0x942733);})[_0xc956('0x1e')](function(_0x35cdaa){logger['error'](_0xc956('0x1d'),_0x35cdaa[_0xc956('0x10')],_0x154ec6);_0x35ec6a(_0x2899eb['error'](0x1f4,_0x35cdaa[_0xc956('0x10')]));});});};exports[_0xc956('0x1f')]=function(_0x4445a0){var _0x14898b=this;return new Promise(function(_0x3b2f9f,_0x5a6bc7){return db[_0xc956('0x11')][_0xc956('0x20')]({'raw':_0x4445a0[_0xc956('0x13')]?_0x4445a0[_0xc956('0x13')][_0xc956('0x14')]===undefined?!![]:![]:!![],'where':_0x4445a0['options']?_0x4445a0['options'][_0xc956('0x15')]||null:null,'attributes':_0x4445a0[_0xc956('0x13')]?_0x4445a0[_0xc956('0x13')][_0xc956('0x1a')]||null:null,'include':_0x4445a0[_0xc956('0x13')]?_0x4445a0[_0xc956('0x13')][_0xc956('0x17')]?_[_0xc956('0x18')](_0x4445a0[_0xc956('0x13')][_0xc956('0x17')],function(_0x3808b1){return{'model':db[_0x3808b1['model']],'as':_0x3808b1['as'],'attributes':_0x3808b1[_0xc956('0x1a')],'include':_0x3808b1[_0xc956('0x17')]?_[_0xc956('0x18')](_0x3808b1[_0xc956('0x17')],function(_0x59756c){return{'model':db[_0x59756c[_0xc956('0x19')]],'as':_0x59756c['as'],'attributes':_0x59756c[_0xc956('0x1a')],'include':_0x59756c[_0xc956('0x17')]?_['map'](_0x59756c[_0xc956('0x17')],function(_0x57cd4a){return{'model':db[_0x57cd4a[_0xc956('0x19')]],'as':_0x57cd4a['as'],'attributes':_0x57cd4a[_0xc956('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc956('0x1b')](function(_0x1ee3ae){logger[_0xc956('0x1c')](_0xc956('0x1f'),_0x4445a0);logger[_0xc956('0xb')](_0xc956('0x1f'),_0x4445a0,JSON['stringify'](_0x1ee3ae));_0x3b2f9f(_0x1ee3ae);})[_0xc956('0x1e')](function(_0x477daa){logger['error'](_0xc956('0x1f'),_0x477daa[_0xc956('0x10')],_0x4445a0);_0x5a6bc7(_0x14898b[_0xc956('0xe')](0x1f4,_0x477daa[_0xc956('0x10')]));});});};
\ No newline at end of file
+var _0x0924=['request\x20sent','stringify','error','code','message','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','include','map','model','attributes','info','ShowZohoAccount','find','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','ZohoAccount,\x20%s,\x20%s','debug'];(function(_0xbd432c,_0x1239b0){var _0x4ab461=function(_0x342c25){while(--_0x342c25){_0xbd432c['push'](_0xbd432c['shift']());}};_0x4ab461(++_0x1239b0);}(_0x0924,0x77));var _0x4092=function(_0x569fef,_0x49c37a){_0x569fef=_0x569fef-0x0;var _0x11f20b=_0x0924[_0x569fef];return _0x11f20b;};'use strict';var _=require('lodash');var util=require(_0x4092('0x0'));var moment=require(_0x4092('0x1'));var BPromise=require(_0x4092('0x2'));var rs=require(_0x4092('0x3'));var fs=require('fs');var Redis=require(_0x4092('0x4'));var db=require(_0x4092('0x5'))['db'];var utils=require(_0x4092('0x6'));var logger=require('../../config/logger')(_0x4092('0x7'));var config=require(_0x4092('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4092('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17b57d,_0x238a93,_0x524f38){return new BPromise(function(_0x5f10ea,_0x5f3135){return client[_0x4092('0xa')](_0x17b57d,_0x524f38)['then'](function(_0xc11707){logger['info'](_0x4092('0xb'),_0x238a93,'request\x20sent');logger[_0x4092('0xc')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x238a93,_0x4092('0xd'),JSON[_0x4092('0xe')](_0xc11707));if(_0xc11707[_0x4092('0xf')]){if(_0xc11707['error'][_0x4092('0x10')]===0x1f4){logger[_0x4092('0xf')](_0x4092('0xb'),_0x238a93,_0xc11707['error']['message']);return _0x5f3135(_0xc11707[_0x4092('0xf')][_0x4092('0x11')]);}logger[_0x4092('0xf')](_0x4092('0xb'),_0x238a93,_0xc11707['error'][_0x4092('0x11')]);return _0x5f10ea(_0xc11707['error'][_0x4092('0x11')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x238a93,_0x4092('0xd'));_0x5f10ea(_0xc11707['result'][_0x4092('0x11')]);}})['catch'](function(_0x36df3b){logger[_0x4092('0xf')](_0x4092('0xb'),_0x238a93,_0x36df3b);_0x5f3135(_0x36df3b);});});}exports[_0x4092('0x12')]=function(_0x49d3ee){var _0x424a9b=this;return new Promise(function(_0x122a0e,_0x45d503){return db[_0x4092('0x13')][_0x4092('0x14')]({'raw':_0x49d3ee[_0x4092('0x15')]?_0x49d3ee[_0x4092('0x15')][_0x4092('0x16')]===undefined?!![]:![]:!![],'where':_0x49d3ee[_0x4092('0x15')]?_0x49d3ee['options'][_0x4092('0x17')]||null:null,'attributes':_0x49d3ee[_0x4092('0x15')]?_0x49d3ee[_0x4092('0x15')]['attributes']||null:null,'limit':_0x49d3ee[_0x4092('0x15')]?_0x49d3ee[_0x4092('0x15')][_0x4092('0x18')]||null:null,'include':_0x49d3ee[_0x4092('0x15')]?_0x49d3ee['options'][_0x4092('0x19')]?_[_0x4092('0x1a')](_0x49d3ee[_0x4092('0x15')][_0x4092('0x19')],function(_0x59c8d1){return{'model':db[_0x59c8d1[_0x4092('0x1b')]],'as':_0x59c8d1['as'],'attributes':_0x59c8d1[_0x4092('0x1c')],'include':_0x59c8d1['include']?_[_0x4092('0x1a')](_0x59c8d1[_0x4092('0x19')],function(_0x58e62d){return{'model':db[_0x58e62d['model']],'as':_0x58e62d['as'],'attributes':_0x58e62d[_0x4092('0x1c')],'include':_0x58e62d[_0x4092('0x19')]?_[_0x4092('0x1a')](_0x58e62d['include'],function(_0x4a149f){return{'model':db[_0x4a149f[_0x4092('0x1b')]],'as':_0x4a149f['as'],'attributes':_0x4a149f[_0x4092('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15909c){logger[_0x4092('0x1d')]('GetZohoAccount',_0x49d3ee);logger['debug'](_0x4092('0x12'),_0x49d3ee,JSON[_0x4092('0xe')](_0x15909c));_0x122a0e(_0x15909c);})['catch'](function(_0x28f708){logger[_0x4092('0xf')](_0x4092('0x12'),_0x28f708[_0x4092('0x11')],_0x49d3ee);_0x45d503(_0x424a9b['error'](0x1f4,_0x28f708[_0x4092('0x11')]));});});};exports[_0x4092('0x1e')]=function(_0x736007){var _0x107b69=this;return new Promise(function(_0x398127,_0xa49f9c){return db[_0x4092('0x13')][_0x4092('0x1f')]({'raw':_0x736007[_0x4092('0x15')]?_0x736007[_0x4092('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x736007[_0x4092('0x15')]?_0x736007[_0x4092('0x15')][_0x4092('0x17')]||null:null,'attributes':_0x736007[_0x4092('0x15')]?_0x736007[_0x4092('0x15')][_0x4092('0x1c')]||null:null,'include':_0x736007[_0x4092('0x15')]?_0x736007[_0x4092('0x15')][_0x4092('0x19')]?_[_0x4092('0x1a')](_0x736007[_0x4092('0x15')][_0x4092('0x19')],function(_0x41342e){return{'model':db[_0x41342e[_0x4092('0x1b')]],'as':_0x41342e['as'],'attributes':_0x41342e[_0x4092('0x1c')],'include':_0x41342e[_0x4092('0x19')]?_['map'](_0x41342e[_0x4092('0x19')],function(_0x36b3c3){return{'model':db[_0x36b3c3[_0x4092('0x1b')]],'as':_0x36b3c3['as'],'attributes':_0x36b3c3[_0x4092('0x1c')],'include':_0x36b3c3[_0x4092('0x19')]?_[_0x4092('0x1a')](_0x36b3c3[_0x4092('0x19')],function(_0x5b35f0){return{'model':db[_0x5b35f0[_0x4092('0x1b')]],'as':_0x5b35f0['as'],'attributes':_0x5b35f0['attributes']};}):[]};}):[]};}):[]:[]})[_0x4092('0x20')](function(_0x3caf89){logger[_0x4092('0x1d')](_0x4092('0x1e'),_0x736007);logger[_0x4092('0xc')](_0x4092('0x1e'),_0x736007,JSON[_0x4092('0xe')](_0x3caf89));_0x398127(_0x3caf89);})['catch'](function(_0x23d73f){logger[_0x4092('0xf')](_0x4092('0x1e'),_0x23d73f[_0x4092('0x11')],_0x736007);_0xa49f9c(_0x107b69['error'](0x1f4,_0x23d73f[_0x4092('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js
index c9aa4a2..98a68e2 100644
--- a/server/api/intZohoConfiguration/index.js
+++ b/server/api/intZohoConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf021=['getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','index','/:id','isAuthenticated','show','get','/:id/fields','getFields'];(function(_0x11714b,_0x2aef4b){var _0x3386d3=function(_0x48bc10){while(--_0x48bc10){_0x11714b['push'](_0x11714b['shift']());}};_0x3386d3(++_0x2aef4b);}(_0xf021,0x18f));var _0x1f02=function(_0x36bf4a,_0x13cf2f){_0x36bf4a=_0x36bf4a-0x0;var _0x3588c6=_0xf021[_0x36bf4a];return _0x3588c6;};'use strict';var multer=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var path=require(_0x1f02('0x2'));var timeout=require(_0x1f02('0x3'));var express=require(_0x1f02('0x4'));var router=express['Router']();var auth=require(_0x1f02('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1f02('0x6'));var controller=require(_0x1f02('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1f02('0x8')]);router['get'](_0x1f02('0x9'),auth[_0x1f02('0xa')](),controller[_0x1f02('0xb')]);router[_0x1f02('0xc')](_0x1f02('0xd'),auth['isAuthenticated'](),controller[_0x1f02('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x1f02('0xf')]);router[_0x1f02('0xc')](_0x1f02('0x10'),auth[_0x1f02('0xa')](),controller[_0x1f02('0x11')]);router['post']('/',auth[_0x1f02('0xa')](),controller[_0x1f02('0x12')]);router[_0x1f02('0x13')]('/:id',auth[_0x1f02('0xa')](),controller[_0x1f02('0x14')]);router[_0x1f02('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1f02('0x16')]=router;
\ No newline at end of file
+var _0x447b=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update'];(function(_0x433362,_0x12ba54){var _0x19d95d=function(_0x35a0da){while(--_0x35a0da){_0x433362['push'](_0x433362['shift']());}};_0x19d95d(++_0x12ba54);}(_0x447b,0xe4));var _0xb447=function(_0x2513c7,_0x30ca8f){_0x2513c7=_0x2513c7-0x0;var _0x51d34b=_0x447b[_0x2513c7];return _0x51d34b;};'use strict';var multer=require(_0xb447('0x0'));var util=require(_0xb447('0x1'));var path=require('path');var timeout=require(_0xb447('0x2'));var express=require(_0xb447('0x3'));var router=express[_0xb447('0x4')]();var auth=require(_0xb447('0x5'));var interaction=require(_0xb447('0x6'));var config=require(_0xb447('0x7'));var controller=require(_0xb447('0x8'));router[_0xb447('0x9')]('/',auth[_0xb447('0xa')](),controller[_0xb447('0xb')]);router['get']('/:id',auth[_0xb447('0xa')](),controller['show']);router[_0xb447('0x9')](_0xb447('0xc'),auth[_0xb447('0xa')](),controller[_0xb447('0xd')]);router[_0xb447('0x9')]('/:id/subjects',auth[_0xb447('0xa')](),controller[_0xb447('0xe')]);router[_0xb447('0x9')](_0xb447('0xf'),auth['isAuthenticated'](),controller[_0xb447('0x10')]);router[_0xb447('0x11')]('/',auth[_0xb447('0xa')](),controller[_0xb447('0x12')]);router[_0xb447('0x13')](_0xb447('0x14'),auth[_0xb447('0xa')](),controller[_0xb447('0x15')]);router[_0xb447('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xb447('0x17')]);module[_0xb447('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
index fbd2bc8..a2dbde4 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc279=['exports','STRING'];(function(_0x45a4a0,_0x2ed137){var _0xcf3cca=function(_0x56c28a){while(--_0x56c28a){_0x45a4a0['push'](_0x45a4a0['shift']());}};_0xcf3cca(++_0x2ed137);}(_0xc279,0xd2));var _0x9c27=function(_0x4d0c07,_0x1c647b){_0x4d0c07=_0x4d0c07-0x0;var _0x450ca0=_0xc279[_0x4d0c07];return _0x450ca0;};'use strict';var Sequelize=require('sequelize');module[_0x9c27('0x0')]={'name':{'type':Sequelize[_0x9c27('0x1')]},'description':{'type':Sequelize[_0x9c27('0x1')]}};
\ No newline at end of file
+var _0x461c=['STRING','sequelize'];(function(_0x586ec3,_0x208917){var _0x1d6233=function(_0x169e6c){while(--_0x169e6c){_0x586ec3['push'](_0x586ec3['shift']());}};_0x1d6233(++_0x208917);}(_0x461c,0x1c3));var _0xc461=function(_0x5ef637,_0x32a0b7){_0x5ef637=_0x5ef637-0x0;var _0x208fa8=_0x461c[_0x5ef637];return _0x208fa8;};'use strict';var Sequelize=require(_0xc461('0x0'));module['exports']={'name':{'type':Sequelize[_0xc461('0x1')]},'description':{'type':Sequelize[_0xc461('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js
index 984bc07..198766c 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb3d=['limit','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','ZohoConfiguration','rawAttributes','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','type','key','field','options','count','includeAll','include','rows','show','keys','length','find','create','body','params','findOne','ZohoField','getFields','getSubjects','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','sendStatus','status','json','offset'];(function(_0x3744c4,_0x5cc421){var _0x540e13=function(_0x40e000){while(--_0x40e000){_0x3744c4['push'](_0x3744c4['shift']());}};_0x540e13(++_0x5cc421);}(_0xfb3d,0x1e8));var _0xdfb3=function(_0x5962de,_0x5d63a3){_0x5962de=_0x5962de-0x0;var _0x1b7dd9=_0xfb3d[_0x5962de];return _0x1b7dd9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdfb3('0x0'));var rimraf=require(_0xdfb3('0x1'));var zipdir=require(_0xdfb3('0x2'));var jsonpatch=require(_0xdfb3('0x3'));var rp=require(_0xdfb3('0x4'));var moment=require('moment');var BPromise=require(_0xdfb3('0x5'));var Mustache=require(_0xdfb3('0x6'));var util=require(_0xdfb3('0x7'));var path=require('path');var sox=require(_0xdfb3('0x8'));var csv=require(_0xdfb3('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdfb3('0xa'));var squel=require('squel');var crypto=require(_0xdfb3('0xb'));var jsforce=require(_0xdfb3('0xc'));var deskjs=require(_0xdfb3('0xd'));var toCsv=require(_0xdfb3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdfb3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdfb3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfb3('0x10'))(_0xdfb3('0x11'));var utils=require(_0xdfb3('0x12'));var config=require(_0xdfb3('0x13'));var db=require(_0xdfb3('0x14'))['db'];var jayson=require(_0xdfb3('0x15'));var client=jayson['client'][_0xdfb3('0x16')]({'port':0x232a});function checkPasswordPattern(_0x4b82cc,_0x13b043,_0x5f0b36){if(_0x5f0b36){var _0x25b2eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25b2eb[_0xdfb3('0x17')](_0x13b043)){return _0x4b82cc;}else{throw new Error(_0xdfb3('0x18'));}}else{return _0x4b82cc;}}function respondWithRpcPromise(_0x474351,_0x30c5bc,_0x335a55,_0x538da5){return new BPromise(function(_0x8e0e61,_0x22121a){var _0x1e4779=_0x538da5||client;return _0x1e4779[_0xdfb3('0x19')](_0x474351,_0x335a55)[_0xdfb3('0x1a')](function(_0x3ca336){logger['info'](_0xdfb3('0x1b'),_0x30c5bc,_0xdfb3('0x1c'));logger['debug'](_0xdfb3('0x1d'),_0x30c5bc,_0xdfb3('0x1c'),JSON['stringify'](_0x3ca336));if(_0x3ca336['error']){if(_0x3ca336['error'][_0xdfb3('0x1e')]===0x1f4){logger['error'](_0xdfb3('0x1b'),_0x30c5bc,_0x3ca336['error']['message']);return _0x22121a(_0x3ca336[_0xdfb3('0x1f')]['message']);}logger[_0xdfb3('0x1f')](_0xdfb3('0x1b'),_0x30c5bc,_0x3ca336[_0xdfb3('0x1f')][_0xdfb3('0x20')]);return _0x8e0e61(_0x3ca336[_0xdfb3('0x1f')][_0xdfb3('0x20')]);}else{logger[_0xdfb3('0x21')](_0xdfb3('0x1b'),_0x30c5bc,_0xdfb3('0x1c'));_0x8e0e61(_0x3ca336[_0xdfb3('0x22')][_0xdfb3('0x20')]);}})[_0xdfb3('0x23')](function(_0x14cb30){logger[_0xdfb3('0x1f')](_0xdfb3('0x1b'),_0x30c5bc,_0x14cb30);_0x22121a(_0x14cb30);});});}function respondWithStatusCode(_0x185027,_0x3de83d){_0x3de83d=_0x3de83d||0xcc;return function(_0x335942){if(_0x335942){return _0x185027[_0xdfb3('0x24')](_0x3de83d);}return _0x185027[_0xdfb3('0x25')](_0x3de83d)['end']();};}function respondWithResult(_0x21b259,_0x20381c){_0x20381c=_0x20381c||0xc8;return function(_0x50c3a0){if(_0x50c3a0){return _0x21b259['status'](_0x20381c)[_0xdfb3('0x26')](_0x50c3a0);}};}function respondWithFilteredResult(_0x197d05,_0x2fb565){return function(_0xb7f44e){if(_0xb7f44e){var _0x1a5e4a=_0xb7f44e['count'],_0x5f37ce=_0x2fb565[_0xdfb3('0x27')],_0x3baad6=_0x2fb565['offset']+_0x2fb565[_0xdfb3('0x28')],_0x518da7;if(_0x3baad6>=_0x1a5e4a){_0x3baad6=_0x1a5e4a;_0x518da7=0xc8;}else{_0x518da7=0xce;}_0x197d05['status'](_0x518da7);return _0x197d05[_0xdfb3('0x29')](_0xdfb3('0x2a'),_0x5f37ce+'-'+_0x3baad6+'/'+_0x1a5e4a)[_0xdfb3('0x26')](_0xb7f44e);}return null;};}function patchUpdates(_0x3ab08b){return function(_0x42a710){try{jsonpatch[_0xdfb3('0x2b')](_0x42a710,_0x3ab08b,!![]);}catch(_0x536f6b){return BPromise[_0xdfb3('0x2c')](_0x536f6b);}return _0x42a710['save']();};}function saveUpdates(_0x2b76b9,_0x58d3e0){return function(_0x5c2e53){if(_0x5c2e53){return _0x5c2e53[_0xdfb3('0x2d')](_0x2b76b9)[_0xdfb3('0x1a')](function(_0x2d1194){return _0x2d1194;});}return null;};}function removeEntity(_0x37819b,_0xa5100d){return function(_0x9f4c29){if(_0x9f4c29){return _0x9f4c29[_0xdfb3('0x2e')]()['then'](function(){_0x37819b[_0xdfb3('0x25')](0xcc)[_0xdfb3('0x2f')]();});}};}function handleEntityNotFound(_0x520e41,_0x4aa0e7){return function(_0x4a0089){if(!_0x4a0089){_0x520e41[_0xdfb3('0x24')](0x194);}return _0x4a0089;};}function handleError(_0x238e33,_0x140555){_0x140555=_0x140555||0x1f4;return function(_0x5bfae3){logger[_0xdfb3('0x1f')](_0x5bfae3[_0xdfb3('0x30')]);if(_0x5bfae3['name']){delete _0x5bfae3[_0xdfb3('0x31')];}_0x238e33['status'](_0x140555)[_0xdfb3('0x32')](_0x5bfae3);};}exports['index']=function(_0x2282ba,_0x10e904){var _0xe9af36={},_0x39048a={},_0x246beb={'count':0x0,'rows':[]};var _0x5e8fb5=db[_0xdfb3('0x33')][_0xdfb3('0x34')];_0x39048a[_0xdfb3('0x35')]=_['keys'](_0x5e8fb5);_0x39048a[_0xdfb3('0x36')]=_['keys'](_0x2282ba[_0xdfb3('0x36')]);_0x39048a['filters']=_[_0xdfb3('0x37')](_0x39048a[_0xdfb3('0x35')],_0x39048a['query']);_0xe9af36[_0xdfb3('0x38')]=_[_0xdfb3('0x37')](_0x39048a['model'],qs[_0xdfb3('0x39')](_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x39')]));_0xe9af36[_0xdfb3('0x38')]=_0xe9af36['attributes']['length']?_0xe9af36['attributes']:_0x39048a[_0xdfb3('0x35')];if(!_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x3a')](_0xdfb3('0x3b'))){_0xe9af36['limit']=qs[_0xdfb3('0x28')](_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x28')]);_0xe9af36[_0xdfb3('0x27')]=qs['offset'](_0x2282ba['query'][_0xdfb3('0x27')]);}_0xe9af36['order']=qs[_0xdfb3('0x3c')](_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x3c')]);_0xe9af36['where']=qs[_0xdfb3('0x3d')](_[_0xdfb3('0x3e')](_0x2282ba[_0xdfb3('0x36')],_0x39048a[_0xdfb3('0x3d')]));if(_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x3f')]){_0xe9af36[_0xdfb3('0x40')]=_[_0xdfb3('0x41')](_0xe9af36[_0xdfb3('0x40')],{'$or':_[_0xdfb3('0x42')](_0x5e8fb5,function(_0x3bd4f4){if(_0x3bd4f4[_0xdfb3('0x43')][_0xdfb3('0x44')]!=='VIRTUAL'){var _0x51a55d={};_0x51a55d[_0x3bd4f4[_0xdfb3('0x45')]]={'$like':'%'+_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x3f')]+'%'};return _0x51a55d;}})});}_0xe9af36=_[_0xdfb3('0x41')]({},_0xe9af36,_0x2282ba[_0xdfb3('0x46')]);var _0x312228={'where':_0xe9af36['where']};return db['ZohoConfiguration'][_0xdfb3('0x47')](_0x312228)['then'](function(_0x425713){_0x246beb['count']=_0x425713;if(_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x48')]){_0xe9af36[_0xdfb3('0x49')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0xe9af36);})[_0xdfb3('0x1a')](function(_0x32070d){_0x246beb[_0xdfb3('0x4a')]=_0x32070d;return _0x246beb;})[_0xdfb3('0x1a')](respondWithFilteredResult(_0x10e904,_0xe9af36))[_0xdfb3('0x23')](handleError(_0x10e904,null));};exports[_0xdfb3('0x4b')]=function(_0x235c63,_0x14412f){var _0x42be56={'raw':![],'where':{'id':_0x235c63['params']['id']}},_0x497c0f={};_0x497c0f[_0xdfb3('0x35')]=_[_0xdfb3('0x4c')](db[_0xdfb3('0x33')][_0xdfb3('0x34')]);_0x497c0f[_0xdfb3('0x36')]=_['keys'](_0x235c63['query']);_0x497c0f['filters']=_[_0xdfb3('0x37')](_0x497c0f[_0xdfb3('0x35')],_0x497c0f[_0xdfb3('0x36')]);_0x42be56[_0xdfb3('0x38')]=_[_0xdfb3('0x37')](_0x497c0f[_0xdfb3('0x35')],qs[_0xdfb3('0x39')](_0x235c63['query'][_0xdfb3('0x39')]));_0x42be56[_0xdfb3('0x38')]=_0x42be56[_0xdfb3('0x38')][_0xdfb3('0x4d')]?_0x42be56[_0xdfb3('0x38')]:_0x497c0f[_0xdfb3('0x35')];if(_0x235c63['query'][_0xdfb3('0x48')]){_0x42be56[_0xdfb3('0x49')]=[{'all':!![]}];}_0x42be56=_['merge']({},_0x42be56,_0x235c63['options']);return db[_0xdfb3('0x33')][_0xdfb3('0x4e')](_0x42be56)['then'](handleEntityNotFound(_0x14412f,null))['then'](respondWithResult(_0x14412f,null))['catch'](handleError(_0x14412f,null));};exports[_0xdfb3('0x4f')]=function(_0x226636,_0x1098ef){return db[_0xdfb3('0x33')][_0xdfb3('0x4f')](_0x226636[_0xdfb3('0x50')],{})[_0xdfb3('0x1a')](respondWithResult(_0x1098ef,0xc9))['catch'](handleError(_0x1098ef,null));};exports[_0xdfb3('0x2d')]=function(_0x4211d0,_0x26df39){if(_0x4211d0[_0xdfb3('0x50')]['id']){delete _0x4211d0[_0xdfb3('0x50')]['id'];}return db[_0xdfb3('0x33')][_0xdfb3('0x4e')]({'where':{'id':_0x4211d0[_0xdfb3('0x51')]['id']}})[_0xdfb3('0x1a')](handleEntityNotFound(_0x26df39,null))[_0xdfb3('0x1a')](saveUpdates(_0x4211d0[_0xdfb3('0x50')],null))[_0xdfb3('0x1a')](respondWithResult(_0x26df39,null))['catch'](handleError(_0x26df39,null));};exports[_0xdfb3('0x2e')]=function(_0x3e331b,_0x307773){return db[_0xdfb3('0x33')][_0xdfb3('0x4e')]({'where':{'id':_0x3e331b[_0xdfb3('0x51')]['id']}})['then'](handleEntityNotFound(_0x307773,null))[_0xdfb3('0x1a')](removeEntity(_0x307773,null))[_0xdfb3('0x23')](handleError(_0x307773,null));};exports['getFields']=function(_0x11f829,_0x448451,_0x31b569){var _0x528b63={};var _0x975b52={};var _0xffcd0e;var _0x22a3a0;return db[_0xdfb3('0x33')][_0xdfb3('0x52')]({'where':{'id':_0x11f829[_0xdfb3('0x51')]['id']}})['then'](handleEntityNotFound(_0x448451,null))[_0xdfb3('0x1a')](function(_0x3a9ab8){if(_0x3a9ab8){_0xffcd0e=_0x3a9ab8;_0x975b52[_0xdfb3('0x35')]=_[_0xdfb3('0x4c')](db[_0xdfb3('0x53')][_0xdfb3('0x34')]);_0x975b52[_0xdfb3('0x36')]=_[_0xdfb3('0x4c')](_0x11f829[_0xdfb3('0x36')]);_0x975b52['filters']=_[_0xdfb3('0x37')](_0x975b52[_0xdfb3('0x35')],_0x975b52['query']);_0x528b63[_0xdfb3('0x38')]=_[_0xdfb3('0x37')](_0x975b52['model'],qs[_0xdfb3('0x39')](_0x11f829['query'][_0xdfb3('0x39')]));_0x528b63[_0xdfb3('0x38')]=_0x528b63[_0xdfb3('0x38')]['length']?_0x528b63['attributes']:_0x975b52[_0xdfb3('0x35')];_0x528b63['order']=qs[_0xdfb3('0x3c')](_0x11f829['query'][_0xdfb3('0x3c')]);_0x528b63[_0xdfb3('0x40')]=qs[_0xdfb3('0x3d')](_[_0xdfb3('0x3e')](_0x11f829[_0xdfb3('0x36')],_0x975b52[_0xdfb3('0x3d')]));if(_0x11f829[_0xdfb3('0x36')][_0xdfb3('0x3f')]){_0x528b63[_0xdfb3('0x40')]=_[_0xdfb3('0x41')](_0x528b63[_0xdfb3('0x40')],{'$or':_[_0xdfb3('0x42')](_0x528b63[_0xdfb3('0x38')],function(_0x446249){var _0x15f48c={};_0x15f48c[_0x446249]={'$like':'%'+_0x11f829[_0xdfb3('0x36')][_0xdfb3('0x3f')]+'%'};return _0x15f48c;})});}_0x528b63=_['merge']({},_0x528b63,_0x11f829[_0xdfb3('0x46')]);return _0xffcd0e['getFields'](_0x528b63);}})[_0xdfb3('0x1a')](function(_0x5c4086){if(_0x5c4086){_0x22a3a0=_0x5c4086['length'];if(!_0x11f829[_0xdfb3('0x36')][_0xdfb3('0x3a')](_0xdfb3('0x3b'))){_0x528b63[_0xdfb3('0x28')]=qs[_0xdfb3('0x28')](_0x11f829['query'][_0xdfb3('0x28')]);_0x528b63[_0xdfb3('0x27')]=qs[_0xdfb3('0x27')](_0x11f829[_0xdfb3('0x36')][_0xdfb3('0x27')]);}return _0xffcd0e[_0xdfb3('0x54')](_0x528b63);}})['then'](function(_0x57f8f3){if(_0x57f8f3){return _0x57f8f3?{'count':_0x22a3a0,'rows':_0x57f8f3}:null;}})[_0xdfb3('0x1a')](respondWithResult(_0x448451,null))[_0xdfb3('0x23')](handleError(_0x448451,null));};exports[_0xdfb3('0x55')]=function(_0x40cadb,_0x1649ce,_0x1aee3d){var _0x383cfd={};var _0x12eef2={};var _0x337899;var _0x49c40d;return db['ZohoConfiguration'][_0xdfb3('0x52')]({'where':{'id':_0x40cadb[_0xdfb3('0x51')]['id']}})[_0xdfb3('0x1a')](handleEntityNotFound(_0x1649ce,null))[_0xdfb3('0x1a')](function(_0x35d714){if(_0x35d714){_0x337899=_0x35d714;_0x12eef2[_0xdfb3('0x35')]=_['keys'](db['ZohoField'][_0xdfb3('0x34')]);_0x12eef2[_0xdfb3('0x36')]=_['keys'](_0x40cadb[_0xdfb3('0x36')]);_0x12eef2[_0xdfb3('0x3d')]=_[_0xdfb3('0x37')](_0x12eef2[_0xdfb3('0x35')],_0x12eef2[_0xdfb3('0x36')]);_0x383cfd['attributes']=_['intersection'](_0x12eef2[_0xdfb3('0x35')],qs[_0xdfb3('0x39')](_0x40cadb['query'][_0xdfb3('0x39')]));_0x383cfd[_0xdfb3('0x38')]=_0x383cfd[_0xdfb3('0x38')][_0xdfb3('0x4d')]?_0x383cfd[_0xdfb3('0x38')]:_0x12eef2[_0xdfb3('0x35')];_0x383cfd[_0xdfb3('0x56')]=qs[_0xdfb3('0x3c')](_0x40cadb[_0xdfb3('0x36')][_0xdfb3('0x3c')]);_0x383cfd[_0xdfb3('0x40')]=qs[_0xdfb3('0x3d')](_[_0xdfb3('0x3e')](_0x40cadb[_0xdfb3('0x36')],_0x12eef2[_0xdfb3('0x3d')]));if(_0x40cadb[_0xdfb3('0x36')]['filter']){_0x383cfd[_0xdfb3('0x40')]=_[_0xdfb3('0x41')](_0x383cfd[_0xdfb3('0x40')],{'$or':_[_0xdfb3('0x42')](_0x383cfd[_0xdfb3('0x38')],function(_0x41dfcf){var _0x3437c8={};_0x3437c8[_0x41dfcf]={'$like':'%'+_0x40cadb[_0xdfb3('0x36')][_0xdfb3('0x3f')]+'%'};return _0x3437c8;})});}_0x383cfd=_['merge']({},_0x383cfd,_0x40cadb[_0xdfb3('0x46')]);return _0x337899[_0xdfb3('0x55')](_0x383cfd);}})[_0xdfb3('0x1a')](function(_0x4679e6){if(_0x4679e6){_0x49c40d=_0x4679e6[_0xdfb3('0x4d')];if(!_0x40cadb[_0xdfb3('0x36')][_0xdfb3('0x3a')]('nolimit')){_0x383cfd[_0xdfb3('0x28')]=qs[_0xdfb3('0x28')](_0x40cadb[_0xdfb3('0x36')][_0xdfb3('0x28')]);_0x383cfd[_0xdfb3('0x27')]=qs['offset'](_0x40cadb[_0xdfb3('0x36')][_0xdfb3('0x27')]);}return _0x337899[_0xdfb3('0x55')](_0x383cfd);}})[_0xdfb3('0x1a')](function(_0x1181fc){if(_0x1181fc){return _0x1181fc?{'count':_0x49c40d,'rows':_0x1181fc}:null;}})[_0xdfb3('0x1a')](respondWithResult(_0x1649ce,null))[_0xdfb3('0x23')](handleError(_0x1649ce,null));};exports[_0xdfb3('0x57')]=function(_0x40e618,_0x2be8bb,_0x5f5369){var _0x449ab4={};var _0x20da57={};var _0x3f4f57;var _0x2556a9;return db[_0xdfb3('0x33')][_0xdfb3('0x52')]({'where':{'id':_0x40e618[_0xdfb3('0x51')]['id']}})[_0xdfb3('0x1a')](handleEntityNotFound(_0x2be8bb,null))[_0xdfb3('0x1a')](function(_0xd33b65){if(_0xd33b65){_0x3f4f57=_0xd33b65;_0x20da57[_0xdfb3('0x35')]=_[_0xdfb3('0x4c')](db['ZohoField'][_0xdfb3('0x34')]);_0x20da57[_0xdfb3('0x36')]=_['keys'](_0x40e618['query']);_0x20da57[_0xdfb3('0x3d')]=_['intersection'](_0x20da57[_0xdfb3('0x35')],_0x20da57[_0xdfb3('0x36')]);_0x449ab4['attributes']=_[_0xdfb3('0x37')](_0x20da57[_0xdfb3('0x35')],qs[_0xdfb3('0x39')](_0x40e618[_0xdfb3('0x36')][_0xdfb3('0x39')]));_0x449ab4[_0xdfb3('0x38')]=_0x449ab4[_0xdfb3('0x38')][_0xdfb3('0x4d')]?_0x449ab4[_0xdfb3('0x38')]:_0x20da57[_0xdfb3('0x35')];_0x449ab4[_0xdfb3('0x56')]=qs['sort'](_0x40e618['query']['sort']);_0x449ab4[_0xdfb3('0x40')]=qs['filters'](_[_0xdfb3('0x3e')](_0x40e618[_0xdfb3('0x36')],_0x20da57[_0xdfb3('0x3d')]));if(_0x40e618[_0xdfb3('0x36')][_0xdfb3('0x3f')]){_0x449ab4[_0xdfb3('0x40')]=_[_0xdfb3('0x41')](_0x449ab4[_0xdfb3('0x40')],{'$or':_[_0xdfb3('0x42')](_0x449ab4['attributes'],function(_0x4d9c7c){var _0x9dbd32={};_0x9dbd32[_0x4d9c7c]={'$like':'%'+_0x40e618['query'][_0xdfb3('0x3f')]+'%'};return _0x9dbd32;})});}_0x449ab4=_[_0xdfb3('0x41')]({},_0x449ab4,_0x40e618[_0xdfb3('0x46')]);return _0x3f4f57['getDescriptions'](_0x449ab4);}})['then'](function(_0x4bc44f){if(_0x4bc44f){_0x2556a9=_0x4bc44f['length'];if(!_0x40e618[_0xdfb3('0x36')][_0xdfb3('0x3a')]('nolimit')){_0x449ab4[_0xdfb3('0x28')]=qs[_0xdfb3('0x28')](_0x40e618[_0xdfb3('0x36')][_0xdfb3('0x28')]);_0x449ab4[_0xdfb3('0x27')]=qs[_0xdfb3('0x27')](_0x40e618[_0xdfb3('0x36')][_0xdfb3('0x27')]);}return _0x3f4f57['getDescriptions'](_0x449ab4);}})[_0xdfb3('0x1a')](function(_0x5731ee){if(_0x5731ee){return _0x5731ee?{'count':_0x2556a9,'rows':_0x5731ee}:null;}})[_0xdfb3('0x1a')](respondWithResult(_0x2be8bb,null))[_0xdfb3('0x23')](handleError(_0x2be8bb,null));};
\ No newline at end of file
+var _0x6922=['message','catch','end','status','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','stack','send','index','ZohoConfiguration','rawAttributes','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','map','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','params','length','merge','find','create','body','getFields','ZohoField','hasOwnProperty','findOne','getSubjects','pick','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','client','http','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x48fefe,_0x4064be){var _0x5d7e35=function(_0x57bbe4){while(--_0x57bbe4){_0x48fefe['push'](_0x48fefe['shift']());}};_0x5d7e35(++_0x4064be);}(_0x6922,0xe8));var _0x2692=function(_0x4f29d3,_0x257bfa){_0x4f29d3=_0x4f29d3-0x0;var _0x322e36=_0x6922[_0x4f29d3];return _0x322e36;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2692('0x0'));var jsonpatch=require(_0x2692('0x1'));var rp=require(_0x2692('0x2'));var moment=require(_0x2692('0x3'));var BPromise=require(_0x2692('0x4'));var Mustache=require(_0x2692('0x5'));var util=require(_0x2692('0x6'));var path=require(_0x2692('0x7'));var sox=require(_0x2692('0x8'));var csv=require(_0x2692('0x9'));var ejs=require(_0x2692('0xa'));var fs=require('fs');var _=require(_0x2692('0xb'));var squel=require(_0x2692('0xc'));var crypto=require(_0x2692('0xd'));var jsforce=require(_0x2692('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2692('0x9'));var querystring=require('querystring');var Papa=require(_0x2692('0xf'));var Redis=require('ioredis');var authService=require(_0x2692('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2692('0x11'));var logger=require(_0x2692('0x12'))(_0x2692('0x13'));var utils=require(_0x2692('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x2692('0x15'));var client=jayson[_0x2692('0x16')][_0x2692('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1d1947,_0xf03e8b,_0x28ea1d){if(_0x28ea1d){var _0x43aaa3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43aaa3['test'](_0xf03e8b)){return _0x1d1947;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1d1947;}}function respondWithRpcPromise(_0x581f57,_0xa68313,_0x1e032a,_0x3abcb8){return new BPromise(function(_0x293275,_0x299b2b){var _0x1358f9=_0x3abcb8||client;return _0x1358f9['request'](_0x581f57,_0x1e032a)['then'](function(_0x1ce66c){logger[_0x2692('0x18')](_0x2692('0x19'),_0xa68313,_0x2692('0x1a'));logger[_0x2692('0x1b')](_0x2692('0x1c'),_0xa68313,'request\x20sent',JSON[_0x2692('0x1d')](_0x1ce66c));if(_0x1ce66c[_0x2692('0x1e')]){if(_0x1ce66c['error'][_0x2692('0x1f')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0xa68313,_0x1ce66c[_0x2692('0x1e')][_0x2692('0x20')]);return _0x299b2b(_0x1ce66c[_0x2692('0x1e')]['message']);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0xa68313,_0x1ce66c[_0x2692('0x1e')][_0x2692('0x20')]);return _0x293275(_0x1ce66c[_0x2692('0x1e')][_0x2692('0x20')]);}else{logger[_0x2692('0x18')](_0x2692('0x19'),_0xa68313,'request\x20sent');_0x293275(_0x1ce66c['result']['message']);}})[_0x2692('0x21')](function(_0x7c95d5){logger[_0x2692('0x1e')]('ZohoConfiguration,\x20%s,\x20%s',_0xa68313,_0x7c95d5);_0x299b2b(_0x7c95d5);});});}function respondWithStatusCode(_0x7bd393,_0x3739db){_0x3739db=_0x3739db||0xcc;return function(_0x2270ab){if(_0x2270ab){return _0x7bd393['sendStatus'](_0x3739db);}return _0x7bd393['status'](_0x3739db)[_0x2692('0x22')]();};}function respondWithResult(_0x108888,_0xdb7af0){_0xdb7af0=_0xdb7af0||0xc8;return function(_0x441562){if(_0x441562){return _0x108888[_0x2692('0x23')](_0xdb7af0)['json'](_0x441562);}};}function respondWithFilteredResult(_0x10220a,_0x55e65f){return function(_0x1beb9d){if(_0x1beb9d){var _0xa27827=_0x1beb9d['count'],_0x18d279=_0x55e65f[_0x2692('0x24')],_0x299c2a=_0x55e65f[_0x2692('0x24')]+_0x55e65f[_0x2692('0x25')],_0x14d97b;if(_0x299c2a>=_0xa27827){_0x299c2a=_0xa27827;_0x14d97b=0xc8;}else{_0x14d97b=0xce;}_0x10220a[_0x2692('0x23')](_0x14d97b);return _0x10220a[_0x2692('0x26')](_0x2692('0x27'),_0x18d279+'-'+_0x299c2a+'/'+_0xa27827)[_0x2692('0x28')](_0x1beb9d);}return null;};}function patchUpdates(_0x5aa73a){return function(_0x1104fe){try{jsonpatch[_0x2692('0x29')](_0x1104fe,_0x5aa73a,!![]);}catch(_0x4d1cff){return BPromise[_0x2692('0x2a')](_0x4d1cff);}return _0x1104fe['save']();};}function saveUpdates(_0x2fb063,_0x347b96){return function(_0x2d4f45){if(_0x2d4f45){return _0x2d4f45[_0x2692('0x2b')](_0x2fb063)[_0x2692('0x2c')](function(_0x1159d3){return _0x1159d3;});}return null;};}function removeEntity(_0xc88882,_0x408a5a){return function(_0x47b6e1){if(_0x47b6e1){return _0x47b6e1[_0x2692('0x2d')]()['then'](function(){_0xc88882['status'](0xcc)[_0x2692('0x22')]();});}};}function handleEntityNotFound(_0xbd975a,_0xa56af9){return function(_0x231311){if(!_0x231311){_0xbd975a[_0x2692('0x2e')](0x194);}return _0x231311;};}function handleError(_0x924f34,_0x483e41){_0x483e41=_0x483e41||0x1f4;return function(_0xdae8fc){logger[_0x2692('0x1e')](_0xdae8fc[_0x2692('0x2f')]);if(_0xdae8fc['name']){delete _0xdae8fc['name'];}_0x924f34[_0x2692('0x23')](_0x483e41)[_0x2692('0x30')](_0xdae8fc);};}exports[_0x2692('0x31')]=function(_0x3e06d5,_0x1a71e8){var _0x159cce={},_0x912adf={},_0x2be148={'count':0x0,'rows':[]};var _0x1df2d0=db[_0x2692('0x32')][_0x2692('0x33')];_0x912adf[_0x2692('0x34')]=_['keys'](_0x1df2d0);_0x912adf[_0x2692('0x35')]=_[_0x2692('0x36')](_0x3e06d5['query']);_0x912adf[_0x2692('0x37')]=_['intersection'](_0x912adf[_0x2692('0x34')],_0x912adf[_0x2692('0x35')]);_0x159cce[_0x2692('0x38')]=_[_0x2692('0x39')](_0x912adf['model'],qs[_0x2692('0x3a')](_0x3e06d5[_0x2692('0x35')]['fields']));_0x159cce[_0x2692('0x38')]=_0x159cce['attributes']['length']?_0x159cce[_0x2692('0x38')]:_0x912adf[_0x2692('0x34')];if(!_0x3e06d5['query']['hasOwnProperty'](_0x2692('0x3b'))){_0x159cce[_0x2692('0x25')]=qs['limit'](_0x3e06d5[_0x2692('0x35')][_0x2692('0x25')]);_0x159cce[_0x2692('0x24')]=qs[_0x2692('0x24')](_0x3e06d5['query'][_0x2692('0x24')]);}_0x159cce[_0x2692('0x3c')]=qs[_0x2692('0x3d')](_0x3e06d5[_0x2692('0x35')][_0x2692('0x3d')]);_0x159cce[_0x2692('0x3e')]=qs[_0x2692('0x37')](_['pick'](_0x3e06d5[_0x2692('0x35')],_0x912adf[_0x2692('0x37')]));if(_0x3e06d5[_0x2692('0x35')]['filter']){_0x159cce[_0x2692('0x3e')]=_['merge'](_0x159cce[_0x2692('0x3e')],{'$or':_[_0x2692('0x3f')](_0x1df2d0,function(_0x12e05c){if(_0x12e05c[_0x2692('0x40')][_0x2692('0x41')]!==_0x2692('0x42')){var _0x34e7d6={};_0x34e7d6[_0x12e05c[_0x2692('0x43')]]={'$like':'%'+_0x3e06d5['query'][_0x2692('0x44')]+'%'};return _0x34e7d6;}})});}_0x159cce=_['merge']({},_0x159cce,_0x3e06d5[_0x2692('0x45')]);var _0x224931={'where':_0x159cce[_0x2692('0x3e')]};return db['ZohoConfiguration']['count'](_0x224931)[_0x2692('0x2c')](function(_0x37c47a){_0x2be148[_0x2692('0x46')]=_0x37c47a;if(_0x3e06d5[_0x2692('0x35')][_0x2692('0x47')]){_0x159cce[_0x2692('0x48')]=[{'all':!![]}];}return db[_0x2692('0x32')][_0x2692('0x49')](_0x159cce);})[_0x2692('0x2c')](function(_0x5611e2){_0x2be148[_0x2692('0x4a')]=_0x5611e2;return _0x2be148;})[_0x2692('0x2c')](respondWithFilteredResult(_0x1a71e8,_0x159cce))[_0x2692('0x21')](handleError(_0x1a71e8,null));};exports['show']=function(_0x500d36,_0x2a4da4){var _0x3da0a4={'raw':![],'where':{'id':_0x500d36[_0x2692('0x4b')]['id']}},_0x33999c={};_0x33999c['model']=_[_0x2692('0x36')](db[_0x2692('0x32')][_0x2692('0x33')]);_0x33999c['query']=_['keys'](_0x500d36[_0x2692('0x35')]);_0x33999c['filters']=_[_0x2692('0x39')](_0x33999c[_0x2692('0x34')],_0x33999c[_0x2692('0x35')]);_0x3da0a4[_0x2692('0x38')]=_[_0x2692('0x39')](_0x33999c[_0x2692('0x34')],qs[_0x2692('0x3a')](_0x500d36[_0x2692('0x35')][_0x2692('0x3a')]));_0x3da0a4[_0x2692('0x38')]=_0x3da0a4[_0x2692('0x38')][_0x2692('0x4c')]?_0x3da0a4[_0x2692('0x38')]:_0x33999c['model'];if(_0x500d36[_0x2692('0x35')][_0x2692('0x47')]){_0x3da0a4[_0x2692('0x48')]=[{'all':!![]}];}_0x3da0a4=_[_0x2692('0x4d')]({},_0x3da0a4,_0x500d36[_0x2692('0x45')]);return db[_0x2692('0x32')][_0x2692('0x4e')](_0x3da0a4)[_0x2692('0x2c')](handleEntityNotFound(_0x2a4da4,null))['then'](respondWithResult(_0x2a4da4,null))['catch'](handleError(_0x2a4da4,null));};exports['create']=function(_0x351a0c,_0x11643c){return db[_0x2692('0x32')][_0x2692('0x4f')](_0x351a0c[_0x2692('0x50')],{})['then'](respondWithResult(_0x11643c,0xc9))[_0x2692('0x21')](handleError(_0x11643c,null));};exports[_0x2692('0x2b')]=function(_0x2128cd,_0x40206c){if(_0x2128cd[_0x2692('0x50')]['id']){delete _0x2128cd[_0x2692('0x50')]['id'];}return db[_0x2692('0x32')][_0x2692('0x4e')]({'where':{'id':_0x2128cd[_0x2692('0x4b')]['id']}})[_0x2692('0x2c')](handleEntityNotFound(_0x40206c,null))[_0x2692('0x2c')](saveUpdates(_0x2128cd[_0x2692('0x50')],null))[_0x2692('0x2c')](respondWithResult(_0x40206c,null))[_0x2692('0x21')](handleError(_0x40206c,null));};exports[_0x2692('0x2d')]=function(_0x4cd2b3,_0x330394){return db['ZohoConfiguration'][_0x2692('0x4e')]({'where':{'id':_0x4cd2b3[_0x2692('0x4b')]['id']}})[_0x2692('0x2c')](handleEntityNotFound(_0x330394,null))[_0x2692('0x2c')](removeEntity(_0x330394,null))[_0x2692('0x21')](handleError(_0x330394,null));};exports[_0x2692('0x51')]=function(_0x39b692,_0x2d04f6,_0x4ec2ce){var _0x4df6db={};var _0x527b33={};var _0x19ae3d;var _0x26695a;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x39b692[_0x2692('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2d04f6,null))[_0x2692('0x2c')](function(_0x1fcbcd){if(_0x1fcbcd){_0x19ae3d=_0x1fcbcd;_0x527b33[_0x2692('0x34')]=_['keys'](db[_0x2692('0x52')][_0x2692('0x33')]);_0x527b33['query']=_[_0x2692('0x36')](_0x39b692[_0x2692('0x35')]);_0x527b33[_0x2692('0x37')]=_['intersection'](_0x527b33[_0x2692('0x34')],_0x527b33[_0x2692('0x35')]);_0x4df6db['attributes']=_[_0x2692('0x39')](_0x527b33[_0x2692('0x34')],qs[_0x2692('0x3a')](_0x39b692[_0x2692('0x35')][_0x2692('0x3a')]));_0x4df6db['attributes']=_0x4df6db[_0x2692('0x38')]['length']?_0x4df6db['attributes']:_0x527b33[_0x2692('0x34')];_0x4df6db[_0x2692('0x3c')]=qs['sort'](_0x39b692[_0x2692('0x35')][_0x2692('0x3d')]);_0x4df6db[_0x2692('0x3e')]=qs['filters'](_['pick'](_0x39b692['query'],_0x527b33['filters']));if(_0x39b692[_0x2692('0x35')][_0x2692('0x44')]){_0x4df6db['where']=_[_0x2692('0x4d')](_0x4df6db['where'],{'$or':_[_0x2692('0x3f')](_0x4df6db[_0x2692('0x38')],function(_0x4f9482){var _0x5712ba={};_0x5712ba[_0x4f9482]={'$like':'%'+_0x39b692[_0x2692('0x35')][_0x2692('0x44')]+'%'};return _0x5712ba;})});}_0x4df6db=_[_0x2692('0x4d')]({},_0x4df6db,_0x39b692[_0x2692('0x45')]);return _0x19ae3d['getFields'](_0x4df6db);}})['then'](function(_0xbfb561){if(_0xbfb561){_0x26695a=_0xbfb561[_0x2692('0x4c')];if(!_0x39b692[_0x2692('0x35')][_0x2692('0x53')](_0x2692('0x3b'))){_0x4df6db[_0x2692('0x25')]=qs[_0x2692('0x25')](_0x39b692[_0x2692('0x35')][_0x2692('0x25')]);_0x4df6db['offset']=qs[_0x2692('0x24')](_0x39b692[_0x2692('0x35')][_0x2692('0x24')]);}return _0x19ae3d[_0x2692('0x51')](_0x4df6db);}})['then'](function(_0x2395eb){if(_0x2395eb){return _0x2395eb?{'count':_0x26695a,'rows':_0x2395eb}:null;}})[_0x2692('0x2c')](respondWithResult(_0x2d04f6,null))[_0x2692('0x21')](handleError(_0x2d04f6,null));};exports['getSubjects']=function(_0x560666,_0x1052f9,_0x18d895){var _0x49b58a={};var _0x275db0={};var _0x577edb;var _0x13de08;return db[_0x2692('0x32')][_0x2692('0x54')]({'where':{'id':_0x560666[_0x2692('0x4b')]['id']}})[_0x2692('0x2c')](handleEntityNotFound(_0x1052f9,null))['then'](function(_0x4c8e09){if(_0x4c8e09){_0x577edb=_0x4c8e09;_0x275db0[_0x2692('0x34')]=_[_0x2692('0x36')](db[_0x2692('0x52')][_0x2692('0x33')]);_0x275db0[_0x2692('0x35')]=_[_0x2692('0x36')](_0x560666['query']);_0x275db0[_0x2692('0x37')]=_[_0x2692('0x39')](_0x275db0[_0x2692('0x34')],_0x275db0['query']);_0x49b58a[_0x2692('0x38')]=_['intersection'](_0x275db0['model'],qs[_0x2692('0x3a')](_0x560666['query'][_0x2692('0x3a')]));_0x49b58a[_0x2692('0x38')]=_0x49b58a[_0x2692('0x38')][_0x2692('0x4c')]?_0x49b58a[_0x2692('0x38')]:_0x275db0[_0x2692('0x34')];_0x49b58a[_0x2692('0x3c')]=qs[_0x2692('0x3d')](_0x560666[_0x2692('0x35')][_0x2692('0x3d')]);_0x49b58a[_0x2692('0x3e')]=qs[_0x2692('0x37')](_['pick'](_0x560666[_0x2692('0x35')],_0x275db0[_0x2692('0x37')]));if(_0x560666['query'][_0x2692('0x44')]){_0x49b58a['where']=_[_0x2692('0x4d')](_0x49b58a['where'],{'$or':_[_0x2692('0x3f')](_0x49b58a[_0x2692('0x38')],function(_0x37bb99){var _0x3ee27e={};_0x3ee27e[_0x37bb99]={'$like':'%'+_0x560666[_0x2692('0x35')][_0x2692('0x44')]+'%'};return _0x3ee27e;})});}_0x49b58a=_[_0x2692('0x4d')]({},_0x49b58a,_0x560666[_0x2692('0x45')]);return _0x577edb[_0x2692('0x55')](_0x49b58a);}})[_0x2692('0x2c')](function(_0x4bed02){if(_0x4bed02){_0x13de08=_0x4bed02['length'];if(!_0x560666[_0x2692('0x35')][_0x2692('0x53')](_0x2692('0x3b'))){_0x49b58a[_0x2692('0x25')]=qs[_0x2692('0x25')](_0x560666[_0x2692('0x35')][_0x2692('0x25')]);_0x49b58a[_0x2692('0x24')]=qs[_0x2692('0x24')](_0x560666[_0x2692('0x35')][_0x2692('0x24')]);}return _0x577edb['getSubjects'](_0x49b58a);}})[_0x2692('0x2c')](function(_0x34494e){if(_0x34494e){return _0x34494e?{'count':_0x13de08,'rows':_0x34494e}:null;}})[_0x2692('0x2c')](respondWithResult(_0x1052f9,null))[_0x2692('0x21')](handleError(_0x1052f9,null));};exports['getDescriptions']=function(_0x3e6639,_0x24a66c,_0x1813a9){var _0x2bc188={};var _0x222788={};var _0x42a9ff;var _0xcb6e1a;return db[_0x2692('0x32')][_0x2692('0x54')]({'where':{'id':_0x3e6639[_0x2692('0x4b')]['id']}})[_0x2692('0x2c')](handleEntityNotFound(_0x24a66c,null))[_0x2692('0x2c')](function(_0x1b5ea2){if(_0x1b5ea2){_0x42a9ff=_0x1b5ea2;_0x222788['model']=_['keys'](db['ZohoField'][_0x2692('0x33')]);_0x222788[_0x2692('0x35')]=_[_0x2692('0x36')](_0x3e6639[_0x2692('0x35')]);_0x222788['filters']=_['intersection'](_0x222788[_0x2692('0x34')],_0x222788[_0x2692('0x35')]);_0x2bc188[_0x2692('0x38')]=_[_0x2692('0x39')](_0x222788[_0x2692('0x34')],qs['fields'](_0x3e6639[_0x2692('0x35')]['fields']));_0x2bc188['attributes']=_0x2bc188[_0x2692('0x38')][_0x2692('0x4c')]?_0x2bc188[_0x2692('0x38')]:_0x222788[_0x2692('0x34')];_0x2bc188[_0x2692('0x3c')]=qs[_0x2692('0x3d')](_0x3e6639[_0x2692('0x35')]['sort']);_0x2bc188[_0x2692('0x3e')]=qs[_0x2692('0x37')](_[_0x2692('0x56')](_0x3e6639[_0x2692('0x35')],_0x222788['filters']));if(_0x3e6639[_0x2692('0x35')]['filter']){_0x2bc188['where']=_['merge'](_0x2bc188[_0x2692('0x3e')],{'$or':_[_0x2692('0x3f')](_0x2bc188['attributes'],function(_0x19016c){var _0x3526c3={};_0x3526c3[_0x19016c]={'$like':'%'+_0x3e6639[_0x2692('0x35')][_0x2692('0x44')]+'%'};return _0x3526c3;})});}_0x2bc188=_[_0x2692('0x4d')]({},_0x2bc188,_0x3e6639[_0x2692('0x45')]);return _0x42a9ff[_0x2692('0x57')](_0x2bc188);}})[_0x2692('0x2c')](function(_0x45d6b1){if(_0x45d6b1){_0xcb6e1a=_0x45d6b1[_0x2692('0x4c')];if(!_0x3e6639[_0x2692('0x35')][_0x2692('0x53')](_0x2692('0x3b'))){_0x2bc188[_0x2692('0x25')]=qs[_0x2692('0x25')](_0x3e6639[_0x2692('0x35')][_0x2692('0x25')]);_0x2bc188[_0x2692('0x24')]=qs[_0x2692('0x24')](_0x3e6639[_0x2692('0x35')]['offset']);}return _0x42a9ff[_0x2692('0x57')](_0x2bc188);}})[_0x2692('0x2c')](function(_0x52a88d){if(_0x52a88d){return _0x52a88d?{'count':_0xcb6e1a,'rows':_0x52a88d}:null;}})[_0x2692('0x2c')](respondWithResult(_0x24a66c,null))['catch'](handleError(_0x24a66c,null));};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js
index 6de70df..3e25fd5 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.model.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5eb8=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','../../config/logger','api','moment','bluebird'];(function(_0x164bb2,_0x194924){var _0xd16526=function(_0x42eb4a){while(--_0x42eb4a){_0x164bb2['push'](_0x164bb2['shift']());}};_0xd16526(++_0x194924);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5bff0,_0x20716d){_0x5bff0=_0x5bff0-0x0;var _0x3ead2e=_0x5eb8[_0x5bff0];return _0x3ead2e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x85eb('0x0'))(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var BPromise=require(_0x85eb('0x3'));var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x2bf83c,_0x1ba1d8){return _0x2bf83c['define'](_0x85eb('0xa'),attributes,{'tableName':_0x85eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd914=['util','api','moment','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x393500,_0x560060){var _0x487e3a=function(_0x260ef0){while(--_0x260ef0){_0x393500['push'](_0x393500['shift']());}};_0x487e3a(++_0x560060);}(_0xd914,0x17f));var _0x4d91=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0xd914[_0x188a93];return _0x23b40d;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var logger=require('../../config/logger')(_0x4d91('0x2'));var moment=require(_0x4d91('0x3'));var BPromise=require(_0x4d91('0x4'));var rp=require(_0x4d91('0x5'));var fs=require('fs');var path=require(_0x4d91('0x6'));var rimraf=require(_0x4d91('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d91('0x8'));module['exports']=function(_0x3ab6f8,_0x42d7ae){return _0x3ab6f8[_0x4d91('0x9')](_0x4d91('0xa'),attributes,{'tableName':_0x4d91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
index 6ca2939..082c4d6 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ba1=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46ee3c,_0x1c08f0){var _0x530a97=function(_0x194bba){while(--_0x194bba){_0x46ee3c['push'](_0x46ee3c['shift']());}};_0x530a97(++_0x1c08f0);}(_0x4ba1,0x14b));var _0x14ba=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x4ba1[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x14ba('0x0'));var util=require(_0x14ba('0x1'));var moment=require(_0x14ba('0x2'));var BPromise=require(_0x14ba('0x3'));var rs=require(_0x14ba('0x4'));var fs=require('fs');var Redis=require(_0x14ba('0x5'));var db=require(_0x14ba('0x6'))['db'];var utils=require(_0x14ba('0x7'));var logger=require(_0x14ba('0x8'))(_0x14ba('0x9'));var config=require(_0x14ba('0xa'));var jayson=require(_0x14ba('0xb'));var client=jayson[_0x14ba('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbe80d0,_0x245dde,_0x4a3005){return new BPromise(function(_0x205081,_0x1e40d0){return client[_0x14ba('0xd')](_0xbe80d0,_0x4a3005)[_0x14ba('0xe')](function(_0x569b42){logger[_0x14ba('0xf')](_0x14ba('0x10'),_0x245dde,_0x14ba('0x11'));logger[_0x14ba('0x12')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x245dde,_0x14ba('0x11'),JSON[_0x14ba('0x13')](_0x569b42));if(_0x569b42['error']){if(_0x569b42[_0x14ba('0x14')][_0x14ba('0x15')]===0x1f4){logger[_0x14ba('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x245dde,_0x569b42[_0x14ba('0x14')][_0x14ba('0x16')]);return _0x1e40d0(_0x569b42['error'][_0x14ba('0x16')]);}logger[_0x14ba('0x14')](_0x14ba('0x10'),_0x245dde,_0x569b42[_0x14ba('0x14')]['message']);return _0x205081(_0x569b42['error']['message']);}else{logger['info'](_0x14ba('0x10'),_0x245dde,'request\x20sent');_0x205081(_0x569b42[_0x14ba('0x17')][_0x14ba('0x16')]);}})[_0x14ba('0x18')](function(_0x7a7584){logger[_0x14ba('0x14')](_0x14ba('0x10'),_0x245dde,_0x7a7584);_0x1e40d0(_0x7a7584);});});}
\ No newline at end of file
+var _0xc131=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','error'];(function(_0x4032b1,_0x79da1d){var _0x9430a5=function(_0x342e67){while(--_0x342e67){_0x4032b1['push'](_0x4032b1['shift']());}};_0x9430a5(++_0x79da1d);}(_0xc131,0x10e));var _0x1c13=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc131[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x1c13('0x0'));var moment=require(_0x1c13('0x1'));var BPromise=require(_0x1c13('0x2'));var rs=require(_0x1c13('0x3'));var fs=require('fs');var Redis=require(_0x1c13('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c13('0x5'));var config=require(_0x1c13('0x6'));var jayson=require(_0x1c13('0x7'));var client=jayson[_0x1c13('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d25fb,_0x33de03,_0x127695){return new BPromise(function(_0x15749c,_0x1e611b){return client[_0x1c13('0x9')](_0x1d25fb,_0x127695)[_0x1c13('0xa')](function(_0x10f8d9){logger[_0x1c13('0xb')](_0x1c13('0xc'),_0x33de03,_0x1c13('0xd'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x33de03,_0x1c13('0xd'),JSON['stringify'](_0x10f8d9));if(_0x10f8d9[_0x1c13('0xe')]){if(_0x10f8d9[_0x1c13('0xe')][_0x1c13('0xf')]===0x1f4){logger[_0x1c13('0xe')](_0x1c13('0xc'),_0x33de03,_0x10f8d9['error']['message']);return _0x1e611b(_0x10f8d9[_0x1c13('0xe')][_0x1c13('0x10')]);}logger[_0x1c13('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x33de03,_0x10f8d9[_0x1c13('0xe')][_0x1c13('0x10')]);return _0x15749c(_0x10f8d9['error'][_0x1c13('0x10')]);}else{logger[_0x1c13('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x33de03,_0x1c13('0xd'));_0x15749c(_0x10f8d9[_0x1c13('0x11')]['message']);}})[_0x1c13('0x12')](function(_0xc92e85){logger['error'](_0x1c13('0xc'),_0x33de03,_0xc92e85);_0x1e611b(_0xc92e85);});});}
\ No newline at end of file
diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js
index c739b3e..b674197 100644
--- a/server/api/intZohoField/index.js
+++ b/server/api/intZohoField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x480b=['post','create','put','update','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','/:id','isAuthenticated','show'];(function(_0x592f0c,_0x22cee8){var _0x454845=function(_0x56cbc2){while(--_0x56cbc2){_0x592f0c['push'](_0x592f0c['shift']());}};_0x454845(++_0x22cee8);}(_0x480b,0x16a));var _0xb480=function(_0x286297,_0x1aac9c){_0x286297=_0x286297-0x0;var _0x4146bf=_0x480b[_0x286297];return _0x4146bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb480('0x0'));var timeout=require('connect-timeout');var express=require(_0xb480('0x1'));var router=express[_0xb480('0x2')]();var auth=require(_0xb480('0x3'));var interaction=require(_0xb480('0x4'));var config=require(_0xb480('0x5'));var controller=require(_0xb480('0x6'));router[_0xb480('0x7')]('/',auth['isAuthenticated'](),controller[_0xb480('0x8')]);router[_0xb480('0x7')](_0xb480('0x9'),auth[_0xb480('0xa')](),controller[_0xb480('0xb')]);router[_0xb480('0xc')]('/',auth['isAuthenticated'](),controller[_0xb480('0xd')]);router[_0xb480('0xe')](_0xb480('0x9'),auth[_0xb480('0xa')](),controller[_0xb480('0xf')]);router['delete'](_0xb480('0x9'),auth[_0xb480('0xa')](),controller['destroy']);module[_0xb480('0x10')]=router;
\ No newline at end of file
+var _0xdba7=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','create','put','update','destroy','exports'];(function(_0x9c6c1c,_0x21ead9){var _0x594c42=function(_0x27764b){while(--_0x27764b){_0x9c6c1c['push'](_0x9c6c1c['shift']());}};_0x594c42(++_0x21ead9);}(_0xdba7,0x78));var _0x7dba=function(_0x441a45,_0x12d78c){_0x441a45=_0x441a45-0x0;var _0xdd2f3=_0xdba7[_0x441a45];return _0xdd2f3;};'use strict';var multer=require('multer');var util=require(_0x7dba('0x0'));var path=require(_0x7dba('0x1'));var timeout=require(_0x7dba('0x2'));var express=require(_0x7dba('0x3'));var router=express['Router']();var auth=require(_0x7dba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7dba('0x5'));var controller=require('./intZohoField.controller');router[_0x7dba('0x6')]('/',auth[_0x7dba('0x7')](),controller[_0x7dba('0x8')]);router[_0x7dba('0x6')](_0x7dba('0x9'),auth[_0x7dba('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7dba('0xa')]);router[_0x7dba('0xb')]('/:id',auth[_0x7dba('0x7')](),controller[_0x7dba('0xc')]);router['delete']('/:id',auth[_0x7dba('0x7')](),controller[_0x7dba('0xd')]);module[_0x7dba('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js
index cff9291..d7e52db 100644
--- a/server/api/intZohoField/intZohoField.attributes.js
+++ b/server/api/intZohoField/intZohoField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa571=['exports','ENUM','string','customVariable','keyValue','STRING','variable','sequelize'];(function(_0x243358,_0x26775b){var _0x3d3b27=function(_0xf57311){while(--_0xf57311){_0x243358['push'](_0x243358['shift']());}};_0x3d3b27(++_0x26775b);}(_0xa571,0x107));var _0x1a57=function(_0x2d015c,_0x31bb7e){_0x2d015c=_0x2d015c-0x0;var _0x403093=_0xa571[_0x2d015c];return _0x403093;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'type':{'type':Sequelize[_0x1a57('0x2')](_0x1a57('0x3'),'variable',_0x1a57('0x4'),_0x1a57('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1a57('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x1a57('0x3'),_0x1a57('0x7'),_0x1a57('0x4'))},'keyContent':{'type':Sequelize[_0x1a57('0x6')]},'idField':{'type':Sequelize[_0x1a57('0x6')]},'nameField':{'type':Sequelize[_0x1a57('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a57('0x6')]}};
\ No newline at end of file
+var _0xf109=['ENUM','keyValue','string','STRING','variable','customVariable','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf109,0xce));var _0x9f10=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xf109[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'type':{'type':Sequelize[_0x9f10('0x2')]('string','variable','customVariable',_0x9f10('0x3')),'defaultValue':_0x9f10('0x4')},'content':{'type':Sequelize[_0x9f10('0x5')]},'key':{'type':Sequelize[_0x9f10('0x5')]},'keyType':{'type':Sequelize[_0x9f10('0x2')](_0x9f10('0x4'),_0x9f10('0x6'),_0x9f10('0x7'))},'keyContent':{'type':Sequelize[_0x9f10('0x5')]},'idField':{'type':Sequelize[_0x9f10('0x5')]},'nameField':{'type':Sequelize[_0x9f10('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9f10('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js
index 722b33d..e35aa8f 100644
--- a/server/api/intZohoField/intZohoField.controller.js
+++ b/server/api/intZohoField/intZohoField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc573=['fields','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','json','apply','reject','save','then','destroy','end','stack','name','index','rawAttributes','model','keys','filters','intersection','query','attributes'];(function(_0x123493,_0x2a95c8){var _0x5257bd=function(_0x377c6d){while(--_0x377c6d){_0x123493['push'](_0x123493['shift']());}};_0x5257bd(++_0x2a95c8);}(_0xc573,0x12d));var _0x3c57=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc573[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0x3c57('0x0'));var emlformat=require(_0x3c57('0x1'));var rimraf=require(_0x3c57('0x2'));var zipdir=require(_0x3c57('0x3'));var jsonpatch=require(_0x3c57('0x4'));var rp=require(_0x3c57('0x5'));var moment=require(_0x3c57('0x6'));var BPromise=require(_0x3c57('0x7'));var Mustache=require(_0x3c57('0x8'));var util=require(_0x3c57('0x9'));var path=require(_0x3c57('0xa'));var sox=require('sox');var csv=require(_0x3c57('0xb'));var ejs=require(_0x3c57('0xc'));var fs=require('fs');var _=require(_0x3c57('0xd'));var squel=require(_0x3c57('0xe'));var crypto=require(_0x3c57('0xf'));var jsforce=require(_0x3c57('0x10'));var deskjs=require(_0x3c57('0x11'));var toCsv=require(_0x3c57('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3c57('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c57('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3c57('0x14'));var db=require(_0x3c57('0x15'))['db'];function respondWithStatusCode(_0x57fe4b,_0x103b20){_0x103b20=_0x103b20||0xcc;return function(_0x11a7c9){if(_0x11a7c9){return _0x57fe4b[_0x3c57('0x16')](_0x103b20);}return _0x57fe4b[_0x3c57('0x17')](_0x103b20)['end']();};}function respondWithResult(_0x4743f2,_0x13050b){_0x13050b=_0x13050b||0xc8;return function(_0xf7c873){if(_0xf7c873){return _0x4743f2[_0x3c57('0x17')](_0x13050b)['json'](_0xf7c873);}};}function respondWithFilteredResult(_0x2cda8e,_0x29682c){return function(_0x58911b){if(_0x58911b){var _0x21ccce=_0x58911b[_0x3c57('0x18')],_0x3cada7=_0x29682c[_0x3c57('0x19')],_0x4f7eef=_0x29682c[_0x3c57('0x19')]+_0x29682c[_0x3c57('0x1a')],_0x20506b;if(_0x4f7eef>=_0x21ccce){_0x4f7eef=_0x21ccce;_0x20506b=0xc8;}else{_0x20506b=0xce;}_0x2cda8e[_0x3c57('0x17')](_0x20506b);return _0x2cda8e['set']('Content-Range',_0x3cada7+'-'+_0x4f7eef+'/'+_0x21ccce)[_0x3c57('0x1b')](_0x58911b);}return null;};}function patchUpdates(_0x583db0){return function(_0x5e0341){try{jsonpatch[_0x3c57('0x1c')](_0x5e0341,_0x583db0,!![]);}catch(_0x3323c8){return BPromise[_0x3c57('0x1d')](_0x3323c8);}return _0x5e0341[_0x3c57('0x1e')]();};}function saveUpdates(_0x3954f6,_0x22773d){return function(_0x42f626){if(_0x42f626){return _0x42f626['update'](_0x3954f6)[_0x3c57('0x1f')](function(_0x10b517){return _0x10b517;});}return null;};}function removeEntity(_0xc3dc2b,_0x4f5e4c){return function(_0x5584b9){if(_0x5584b9){return _0x5584b9[_0x3c57('0x20')]()[_0x3c57('0x1f')](function(){_0xc3dc2b[_0x3c57('0x17')](0xcc)[_0x3c57('0x21')]();});}};}function handleEntityNotFound(_0xa8ed0b,_0x6f8bb1){return function(_0x34d1b7){if(!_0x34d1b7){_0xa8ed0b[_0x3c57('0x16')](0x194);}return _0x34d1b7;};}function handleError(_0x23e5db,_0x305b82){_0x305b82=_0x305b82||0x1f4;return function(_0x3d55b1){logger['error'](_0x3d55b1[_0x3c57('0x22')]);if(_0x3d55b1[_0x3c57('0x23')]){delete _0x3d55b1[_0x3c57('0x23')];}_0x23e5db[_0x3c57('0x17')](_0x305b82)['send'](_0x3d55b1);};}exports[_0x3c57('0x24')]=function(_0x3dbbe3,_0xd7ddb){var _0x5efa86={},_0x4826d9={},_0x62060a={'count':0x0,'rows':[]};var _0x20a6e2=db['ZohoField'][_0x3c57('0x25')];_0x4826d9[_0x3c57('0x26')]=_[_0x3c57('0x27')](_0x20a6e2);_0x4826d9['query']=_[_0x3c57('0x27')](_0x3dbbe3['query']);_0x4826d9[_0x3c57('0x28')]=_[_0x3c57('0x29')](_0x4826d9[_0x3c57('0x26')],_0x4826d9[_0x3c57('0x2a')]);_0x5efa86[_0x3c57('0x2b')]=_[_0x3c57('0x29')](_0x4826d9[_0x3c57('0x26')],qs['fields'](_0x3dbbe3[_0x3c57('0x2a')][_0x3c57('0x2c')]));_0x5efa86['attributes']=_0x5efa86[_0x3c57('0x2b')]['length']?_0x5efa86[_0x3c57('0x2b')]:_0x4826d9[_0x3c57('0x26')];if(!_0x3dbbe3[_0x3c57('0x2a')]['hasOwnProperty'](_0x3c57('0x2d'))){_0x5efa86[_0x3c57('0x1a')]=qs[_0x3c57('0x1a')](_0x3dbbe3[_0x3c57('0x2a')][_0x3c57('0x1a')]);_0x5efa86[_0x3c57('0x19')]=qs[_0x3c57('0x19')](_0x3dbbe3[_0x3c57('0x2a')][_0x3c57('0x19')]);}_0x5efa86[_0x3c57('0x2e')]=qs['sort'](_0x3dbbe3[_0x3c57('0x2a')][_0x3c57('0x2f')]);_0x5efa86[_0x3c57('0x30')]=qs[_0x3c57('0x28')](_[_0x3c57('0x31')](_0x3dbbe3['query'],_0x4826d9['filters']));if(_0x3dbbe3[_0x3c57('0x2a')][_0x3c57('0x32')]){_0x5efa86[_0x3c57('0x30')]=_['merge'](_0x5efa86[_0x3c57('0x30')],{'$or':_[_0x3c57('0x33')](_0x20a6e2,function(_0x49580a){if(_0x49580a['type'][_0x3c57('0x34')]!==_0x3c57('0x35')){var _0x44e9d5={};_0x44e9d5[_0x49580a[_0x3c57('0x36')]]={'$like':'%'+_0x3dbbe3['query'][_0x3c57('0x32')]+'%'};return _0x44e9d5;}})});}_0x5efa86=_[_0x3c57('0x37')]({},_0x5efa86,_0x3dbbe3[_0x3c57('0x38')]);var _0x444a68={'where':_0x5efa86['where']};return db[_0x3c57('0x39')][_0x3c57('0x18')](_0x444a68)[_0x3c57('0x1f')](function(_0x22506e){_0x62060a['count']=_0x22506e;if(_0x3dbbe3['query'][_0x3c57('0x3a')]){_0x5efa86[_0x3c57('0x3b')]=[{'all':!![]}];}return db[_0x3c57('0x39')][_0x3c57('0x3c')](_0x5efa86);})[_0x3c57('0x1f')](function(_0x2348ba){_0x62060a[_0x3c57('0x3d')]=_0x2348ba;return _0x62060a;})[_0x3c57('0x1f')](respondWithFilteredResult(_0xd7ddb,_0x5efa86))[_0x3c57('0x3e')](handleError(_0xd7ddb,null));};exports[_0x3c57('0x3f')]=function(_0x17d5eb,_0x52278e){var _0x5dc3e3={'raw':!![],'where':{'id':_0x17d5eb[_0x3c57('0x40')]['id']}},_0x234e6b={};_0x234e6b['model']=_[_0x3c57('0x27')](db[_0x3c57('0x39')][_0x3c57('0x25')]);_0x234e6b[_0x3c57('0x2a')]=_[_0x3c57('0x27')](_0x17d5eb[_0x3c57('0x2a')]);_0x234e6b[_0x3c57('0x28')]=_[_0x3c57('0x29')](_0x234e6b[_0x3c57('0x26')],_0x234e6b[_0x3c57('0x2a')]);_0x5dc3e3[_0x3c57('0x2b')]=_[_0x3c57('0x29')](_0x234e6b[_0x3c57('0x26')],qs[_0x3c57('0x2c')](_0x17d5eb['query'][_0x3c57('0x2c')]));_0x5dc3e3['attributes']=_0x5dc3e3[_0x3c57('0x2b')]['length']?_0x5dc3e3[_0x3c57('0x2b')]:_0x234e6b[_0x3c57('0x26')];if(_0x17d5eb[_0x3c57('0x2a')][_0x3c57('0x3a')]){_0x5dc3e3[_0x3c57('0x3b')]=[{'all':!![]}];}_0x5dc3e3=_['merge']({},_0x5dc3e3,_0x17d5eb[_0x3c57('0x38')]);return db[_0x3c57('0x39')][_0x3c57('0x41')](_0x5dc3e3)[_0x3c57('0x1f')](handleEntityNotFound(_0x52278e,null))[_0x3c57('0x1f')](respondWithResult(_0x52278e,null))[_0x3c57('0x3e')](handleError(_0x52278e,null));};exports['create']=function(_0x24a613,_0x3cf7ac){return db[_0x3c57('0x39')][_0x3c57('0x42')](_0x24a613[_0x3c57('0x43')],{})[_0x3c57('0x1f')](respondWithResult(_0x3cf7ac,0xc9))[_0x3c57('0x3e')](handleError(_0x3cf7ac,null));};exports[_0x3c57('0x44')]=function(_0x17c6b5,_0x2df977){if(_0x17c6b5[_0x3c57('0x43')]['id']){delete _0x17c6b5['body']['id'];}return db[_0x3c57('0x39')][_0x3c57('0x41')]({'where':{'id':_0x17c6b5['params']['id']}})[_0x3c57('0x1f')](handleEntityNotFound(_0x2df977,null))[_0x3c57('0x1f')](saveUpdates(_0x17c6b5[_0x3c57('0x43')],null))[_0x3c57('0x1f')](respondWithResult(_0x2df977,null))[_0x3c57('0x3e')](handleError(_0x2df977,null));};exports[_0x3c57('0x20')]=function(_0x1e5cf9,_0x41af81){return db[_0x3c57('0x39')][_0x3c57('0x41')]({'where':{'id':_0x1e5cf9[_0x3c57('0x40')]['id']}})[_0x3c57('0x1f')](handleEntityNotFound(_0x41af81,null))['then'](removeEntity(_0x41af81,null))['catch'](handleError(_0x41af81,null));};
\ No newline at end of file
+var _0x049f=['ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','ZohoField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','length','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv'];(function(_0x438919,_0x9ab855){var _0x26385a=function(_0x1fce43){while(--_0x1fce43){_0x438919['push'](_0x438919['shift']());}};_0x26385a(++_0x9ab855);}(_0x049f,0x1ab));var _0xf049=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x049f[_0x2a5b3b];return _0xae665a;};'use strict';var pdf=require(_0xf049('0x0'));var emlformat=require(_0xf049('0x1'));var rimraf=require(_0xf049('0x2'));var zipdir=require(_0xf049('0x3'));var jsonpatch=require(_0xf049('0x4'));var rp=require(_0xf049('0x5'));var moment=require(_0xf049('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf049('0x7'));var util=require(_0xf049('0x8'));var path=require(_0xf049('0x9'));var sox=require('sox');var csv=require(_0xf049('0xa'));var ejs=require(_0xf049('0xb'));var fs=require('fs');var _=require(_0xf049('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf049('0xd'));var deskjs=require(_0xf049('0xe'));var toCsv=require(_0xf049('0xa'));var querystring=require(_0xf049('0xf'));var Papa=require(_0xf049('0x10'));var Redis=require('ioredis');var authService=require(_0xf049('0x11'));var qs=require(_0xf049('0x12'));var hardwareService=require(_0xf049('0x13'));var logger=require(_0xf049('0x14'))(_0xf049('0x15'));var utils=require(_0xf049('0x16'));var config=require(_0xf049('0x17'));var db=require(_0xf049('0x18'))['db'];function respondWithStatusCode(_0x3d39d1,_0x4f7a8b){_0x4f7a8b=_0x4f7a8b||0xcc;return function(_0x4899fd){if(_0x4899fd){return _0x3d39d1[_0xf049('0x19')](_0x4f7a8b);}return _0x3d39d1[_0xf049('0x1a')](_0x4f7a8b)['end']();};}function respondWithResult(_0x380277,_0x2d3cce){_0x2d3cce=_0x2d3cce||0xc8;return function(_0x27da4a){if(_0x27da4a){return _0x380277[_0xf049('0x1a')](_0x2d3cce)[_0xf049('0x1b')](_0x27da4a);}};}function respondWithFilteredResult(_0x991ac0,_0x1f9d64){return function(_0x22d534){if(_0x22d534){var _0x45b205=_0x22d534[_0xf049('0x1c')],_0x1606a2=_0x1f9d64[_0xf049('0x1d')],_0x585e0b=_0x1f9d64['offset']+_0x1f9d64['limit'],_0x112410;if(_0x585e0b>=_0x45b205){_0x585e0b=_0x45b205;_0x112410=0xc8;}else{_0x112410=0xce;}_0x991ac0[_0xf049('0x1a')](_0x112410);return _0x991ac0[_0xf049('0x1e')](_0xf049('0x1f'),_0x1606a2+'-'+_0x585e0b+'/'+_0x45b205)[_0xf049('0x1b')](_0x22d534);}return null;};}function patchUpdates(_0x3aaee5){return function(_0x291310){try{jsonpatch[_0xf049('0x20')](_0x291310,_0x3aaee5,!![]);}catch(_0x110913){return BPromise[_0xf049('0x21')](_0x110913);}return _0x291310[_0xf049('0x22')]();};}function saveUpdates(_0x5fe58f,_0x2ba43e){return function(_0xeed6db){if(_0xeed6db){return _0xeed6db['update'](_0x5fe58f)[_0xf049('0x23')](function(_0x325606){return _0x325606;});}return null;};}function removeEntity(_0x111a22,_0x2bd9d0){return function(_0x1e1af3){if(_0x1e1af3){return _0x1e1af3[_0xf049('0x24')]()['then'](function(){_0x111a22[_0xf049('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x285b84,_0x391354){return function(_0x3f81bc){if(!_0x3f81bc){_0x285b84[_0xf049('0x19')](0x194);}return _0x3f81bc;};}function handleError(_0x3de686,_0x15522b){_0x15522b=_0x15522b||0x1f4;return function(_0x4f227e){logger[_0xf049('0x25')](_0x4f227e[_0xf049('0x26')]);if(_0x4f227e[_0xf049('0x27')]){delete _0x4f227e[_0xf049('0x27')];}_0x3de686[_0xf049('0x1a')](_0x15522b)[_0xf049('0x28')](_0x4f227e);};}exports[_0xf049('0x29')]=function(_0x67ffce,_0x3ccb91){var _0x4a413a={},_0x24ac30={},_0x3afa2c={'count':0x0,'rows':[]};var _0x153062=db[_0xf049('0x2a')][_0xf049('0x2b')];_0x24ac30[_0xf049('0x2c')]=_[_0xf049('0x2d')](_0x153062);_0x24ac30[_0xf049('0x2e')]=_[_0xf049('0x2d')](_0x67ffce[_0xf049('0x2e')]);_0x24ac30[_0xf049('0x2f')]=_[_0xf049('0x30')](_0x24ac30[_0xf049('0x2c')],_0x24ac30['query']);_0x4a413a[_0xf049('0x31')]=_[_0xf049('0x30')](_0x24ac30['model'],qs[_0xf049('0x32')](_0x67ffce[_0xf049('0x2e')]['fields']));_0x4a413a[_0xf049('0x31')]=_0x4a413a[_0xf049('0x31')]['length']?_0x4a413a[_0xf049('0x31')]:_0x24ac30['model'];if(!_0x67ffce[_0xf049('0x2e')][_0xf049('0x33')]('nolimit')){_0x4a413a['limit']=qs[_0xf049('0x34')](_0x67ffce[_0xf049('0x2e')][_0xf049('0x34')]);_0x4a413a[_0xf049('0x1d')]=qs[_0xf049('0x1d')](_0x67ffce[_0xf049('0x2e')][_0xf049('0x1d')]);}_0x4a413a[_0xf049('0x35')]=qs['sort'](_0x67ffce[_0xf049('0x2e')][_0xf049('0x36')]);_0x4a413a[_0xf049('0x37')]=qs['filters'](_[_0xf049('0x38')](_0x67ffce[_0xf049('0x2e')],_0x24ac30[_0xf049('0x2f')]));if(_0x67ffce[_0xf049('0x2e')]['filter']){_0x4a413a[_0xf049('0x37')]=_[_0xf049('0x39')](_0x4a413a[_0xf049('0x37')],{'$or':_['map'](_0x153062,function(_0x4e07e2){if(_0x4e07e2[_0xf049('0x3a')][_0xf049('0x3b')]!==_0xf049('0x3c')){var _0x524a18={};_0x524a18[_0x4e07e2[_0xf049('0x3d')]]={'$like':'%'+_0x67ffce['query']['filter']+'%'};return _0x524a18;}})});}_0x4a413a=_['merge']({},_0x4a413a,_0x67ffce[_0xf049('0x3e')]);var _0x3a4395={'where':_0x4a413a[_0xf049('0x37')]};return db[_0xf049('0x2a')][_0xf049('0x1c')](_0x3a4395)[_0xf049('0x23')](function(_0x95aaae){_0x3afa2c[_0xf049('0x1c')]=_0x95aaae;if(_0x67ffce[_0xf049('0x2e')][_0xf049('0x3f')]){_0x4a413a[_0xf049('0x40')]=[{'all':!![]}];}return db['ZohoField'][_0xf049('0x41')](_0x4a413a);})[_0xf049('0x23')](function(_0x2bfa3d){_0x3afa2c['rows']=_0x2bfa3d;return _0x3afa2c;})[_0xf049('0x23')](respondWithFilteredResult(_0x3ccb91,_0x4a413a))[_0xf049('0x42')](handleError(_0x3ccb91,null));};exports[_0xf049('0x43')]=function(_0x2406e6,_0x23782b){var _0x50972d={'raw':!![],'where':{'id':_0x2406e6['params']['id']}},_0x377de2={};_0x377de2[_0xf049('0x2c')]=_['keys'](db[_0xf049('0x2a')]['rawAttributes']);_0x377de2['query']=_['keys'](_0x2406e6['query']);_0x377de2[_0xf049('0x2f')]=_[_0xf049('0x30')](_0x377de2['model'],_0x377de2[_0xf049('0x2e')]);_0x50972d[_0xf049('0x31')]=_[_0xf049('0x30')](_0x377de2['model'],qs[_0xf049('0x32')](_0x2406e6[_0xf049('0x2e')][_0xf049('0x32')]));_0x50972d[_0xf049('0x31')]=_0x50972d[_0xf049('0x31')][_0xf049('0x44')]?_0x50972d['attributes']:_0x377de2[_0xf049('0x2c')];if(_0x2406e6[_0xf049('0x2e')][_0xf049('0x3f')]){_0x50972d['include']=[{'all':!![]}];}_0x50972d=_[_0xf049('0x39')]({},_0x50972d,_0x2406e6[_0xf049('0x3e')]);return db[_0xf049('0x2a')][_0xf049('0x45')](_0x50972d)['then'](handleEntityNotFound(_0x23782b,null))[_0xf049('0x23')](respondWithResult(_0x23782b,null))['catch'](handleError(_0x23782b,null));};exports[_0xf049('0x46')]=function(_0x370883,_0x49bbed){return db['ZohoField'][_0xf049('0x46')](_0x370883[_0xf049('0x47')],{})['then'](respondWithResult(_0x49bbed,0xc9))['catch'](handleError(_0x49bbed,null));};exports[_0xf049('0x48')]=function(_0x4bed9c,_0x10970c){if(_0x4bed9c[_0xf049('0x47')]['id']){delete _0x4bed9c[_0xf049('0x47')]['id'];}return db[_0xf049('0x2a')]['find']({'where':{'id':_0x4bed9c['params']['id']}})[_0xf049('0x23')](handleEntityNotFound(_0x10970c,null))[_0xf049('0x23')](saveUpdates(_0x4bed9c['body'],null))[_0xf049('0x23')](respondWithResult(_0x10970c,null))[_0xf049('0x42')](handleError(_0x10970c,null));};exports['destroy']=function(_0x4fa549,_0x97933e){return db[_0xf049('0x2a')]['find']({'where':{'id':_0x4fa549['params']['id']}})[_0xf049('0x23')](handleEntityNotFound(_0x97933e,null))[_0xf049('0x23')](removeEntity(_0x97933e,null))['catch'](handleError(_0x97933e,null));};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js
index 2926e14..b7a6037 100644
--- a/server/api/intZohoField/intZohoField.model.js
+++ b/server/api/intZohoField/intZohoField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xede9=['moment','bluebird','request-promise','../../config/environment','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','../../config/logger','api'];(function(_0x159ca4,_0x388cc9){var _0x2e9cb2=function(_0x510c57){while(--_0x510c57){_0x159ca4['push'](_0x159ca4['shift']());}};_0x2e9cb2(++_0x388cc9);}(_0xede9,0x1d2));var _0x9ede=function(_0x1b9550,_0x4a40a3){_0x1b9550=_0x1b9550-0x0;var _0x357a3a=_0xede9[_0x1b9550];return _0x357a3a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9ede('0x0'))(_0x9ede('0x1'));var moment=require(_0x9ede('0x2'));var BPromise=require(_0x9ede('0x3'));var rp=require(_0x9ede('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ede('0x5'));var attributes=require('./intZohoField.attributes');module[_0x9ede('0x6')]=function(_0x16afd3,_0x16dd63){return _0x16afd3[_0x9ede('0x7')](_0x9ede('0x8'),attributes,{'tableName':_0x9ede('0x9'),'paranoid':![],'indexes':[{'name':_0x9ede('0xa'),'fields':['idField',_0x9ede('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcc4f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x3918f5,_0x557757){var _0x5629d8=function(_0x4355aa){while(--_0x4355aa){_0x3918f5['push'](_0x3918f5['shift']());}};_0x5629d8(++_0x557757);}(_0xcc4f,0x183));var _0xfcc4=function(_0x387052,_0x1dbe12){_0x387052=_0x387052-0x0;var _0x5b3861=_0xcc4f[_0x387052];return _0x5b3861;};'use strict';var _=require(_0xfcc4('0x0'));var util=require(_0xfcc4('0x1'));var logger=require(_0xfcc4('0x2'))(_0xfcc4('0x3'));var moment=require(_0xfcc4('0x4'));var BPromise=require(_0xfcc4('0x5'));var rp=require(_0xfcc4('0x6'));var fs=require('fs');var path=require(_0xfcc4('0x7'));var rimraf=require(_0xfcc4('0x8'));var config=require(_0xfcc4('0x9'));var attributes=require(_0xfcc4('0xa'));module[_0xfcc4('0xb')]=function(_0x5429e7,_0x362097){return _0x5429e7[_0xfcc4('0xc')](_0xfcc4('0xd'),attributes,{'tableName':_0xfcc4('0xe'),'paranoid':![],'indexes':[{'name':_0xfcc4('0xf'),'fields':[_0xfcc4('0x10'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js
index 67422b5..c98432f 100644
--- a/server/api/intZohoField/intZohoField.rpc.js
+++ b/server/api/intZohoField/intZohoField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5dbf=['error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5dbf,0x180));var _0xf5db=function(_0xe11ac7,_0x539367){_0xe11ac7=_0xe11ac7-0x0;var _0x8516e=_0x5dbf[_0xe11ac7];return _0x8516e;};'use strict';var _=require('lodash');var util=require(_0xf5db('0x0'));var moment=require(_0xf5db('0x1'));var BPromise=require(_0xf5db('0x2'));var rs=require(_0xf5db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5db('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5db('0x5'))(_0xf5db('0x6'));var config=require(_0xf5db('0x7'));var jayson=require(_0xf5db('0x8'));var client=jayson[_0xf5db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ac0e3,_0x4ba8cb,_0x368e0a){return new BPromise(function(_0x2d7f5e,_0xafd30c){return client[_0xf5db('0xa')](_0x1ac0e3,_0x368e0a)['then'](function(_0x322746){logger[_0xf5db('0xb')](_0xf5db('0xc'),_0x4ba8cb,'request\x20sent');logger[_0xf5db('0xd')](_0xf5db('0xe'),_0x4ba8cb,'request\x20sent',JSON['stringify'](_0x322746));if(_0x322746[_0xf5db('0xf')]){if(_0x322746[_0xf5db('0xf')][_0xf5db('0x10')]===0x1f4){logger[_0xf5db('0xf')]('ZohoField,\x20%s,\x20%s',_0x4ba8cb,_0x322746[_0xf5db('0xf')]['message']);return _0xafd30c(_0x322746[_0xf5db('0xf')][_0xf5db('0x11')]);}logger[_0xf5db('0xf')](_0xf5db('0xc'),_0x4ba8cb,_0x322746['error'][_0xf5db('0x11')]);return _0x2d7f5e(_0x322746[_0xf5db('0xf')]['message']);}else{logger[_0xf5db('0xb')](_0xf5db('0xc'),_0x4ba8cb,'request\x20sent');_0x2d7f5e(_0x322746[_0xf5db('0x12')][_0xf5db('0x11')]);}})['catch'](function(_0xd24de2){logger[_0xf5db('0xf')](_0xf5db('0xc'),_0x4ba8cb,_0xd24de2);_0xafd30c(_0xd24de2);});});}
\ No newline at end of file
+var _0xacc5=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xacc5,0x1c1));var _0x5acc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xacc5[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5acc('0x0'));var util=require(_0x5acc('0x1'));var moment=require(_0x5acc('0x2'));var BPromise=require('bluebird');var rs=require(_0x5acc('0x3'));var fs=require('fs');var Redis=require(_0x5acc('0x4'));var db=require(_0x5acc('0x5'))['db'];var utils=require(_0x5acc('0x6'));var logger=require(_0x5acc('0x7'))(_0x5acc('0x8'));var config=require(_0x5acc('0x9'));var jayson=require(_0x5acc('0xa'));var client=jayson[_0x5acc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x305586,_0x4ebb99,_0x31cce8){return new BPromise(function(_0x53e176,_0x399e74){return client[_0x5acc('0xc')](_0x305586,_0x31cce8)[_0x5acc('0xd')](function(_0x29c1c1){logger[_0x5acc('0xe')]('ZohoField,\x20%s,\x20%s',_0x4ebb99,_0x5acc('0xf'));logger[_0x5acc('0x10')](_0x5acc('0x11'),_0x4ebb99,'request\x20sent',JSON[_0x5acc('0x12')](_0x29c1c1));if(_0x29c1c1[_0x5acc('0x13')]){if(_0x29c1c1[_0x5acc('0x13')][_0x5acc('0x14')]===0x1f4){logger[_0x5acc('0x13')](_0x5acc('0x15'),_0x4ebb99,_0x29c1c1[_0x5acc('0x13')][_0x5acc('0x16')]);return _0x399e74(_0x29c1c1[_0x5acc('0x13')][_0x5acc('0x16')]);}logger['error'](_0x5acc('0x15'),_0x4ebb99,_0x29c1c1[_0x5acc('0x13')]['message']);return _0x53e176(_0x29c1c1[_0x5acc('0x13')][_0x5acc('0x16')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x4ebb99,_0x5acc('0xf'));_0x53e176(_0x29c1c1[_0x5acc('0x17')][_0x5acc('0x16')]);}})[_0x5acc('0x18')](function(_0x17ef2a){logger[_0x5acc('0x13')](_0x5acc('0x15'),_0x4ebb99,_0x17ef2a);_0x399e74(_0x17ef2a);});});}
\ No newline at end of file
diff --git a/server/api/integration/index.js b/server/api/integration/index.js
index 109c029..810462b 100644
--- a/server/api/integration/index.js
+++ b/server/api/integration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3bd7=['../../config/environment','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x34cda7,_0xfd20d4){var _0x2ae028=function(_0x33c78e){while(--_0x33c78e){_0x34cda7['push'](_0x34cda7['shift']());}};_0x2ae028(++_0xfd20d4);}(_0x3bd7,0x199));var _0x73bd=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x3bd7[_0x5c6244];return _0x5800ce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x73bd('0x0'));var timeout=require(_0x73bd('0x1'));var express=require(_0x73bd('0x2'));var router=express['Router']();var auth=require(_0x73bd('0x3'));var interaction=require(_0x73bd('0x4'));var config=require(_0x73bd('0x5'));module['exports']=router;
\ No newline at end of file
+var _0x1a61=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x1a61,0x1e6));var _0x11a6=function(_0x185c2b,_0x5e5099){_0x185c2b=_0x185c2b-0x0;var _0x15d684=_0x1a61[_0x185c2b];return _0x15d684;};'use strict';var multer=require(_0x11a6('0x0'));var util=require('util');var path=require(_0x11a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x11a6('0x2'));var router=express[_0x11a6('0x3')]();var auth=require(_0x11a6('0x4'));var interaction=require(_0x11a6('0x5'));var config=require('../../config/environment');module['exports']=router;
\ No newline at end of file
diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js
index 86ccbf5..6be3217 100644
--- a/server/api/integration/integration.attributes.js
+++ b/server/api/integration/integration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x79c3=['app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x2494bd,_0x4e04fc){var _0x57e5bd=function(_0x231c2f){while(--_0x231c2f){_0x2494bd['push'](_0x2494bd['shift']());}};_0x57e5bd(++_0x4e04fc);}(_0x79c3,0x1a4));var _0x379c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x79c3[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x379c('0x0'));module[_0x379c('0x1')]={'name':{'type':Sequelize[_0x379c('0x2')],'allowNull':![],'unique':_0x379c('0x3')},'version':{'type':Sequelize[_0x379c('0x2')],'allowNull':![],'unique':_0x379c('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x379c('0x4')},'filename':{'type':Sequelize[_0x379c('0x2')]},'path':{'type':Sequelize[_0x379c('0x2')]},'type':{'type':Sequelize[_0x379c('0x2')]},'size':{'type':Sequelize[_0x379c('0x5')]},'active':{'type':Sequelize[_0x379c('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x379c('0x2')]},'logo':{'type':Sequelize[_0x379c('0x2')]},'state':{'type':Sequelize[_0x379c('0x2')],'unique':_0x379c('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x379c('0x2')]},'remoteUri':{'type':Sequelize[_0x379c('0x2')]},'link':{'type':Sequelize[_0x379c('0x2')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xb57c=['unique_name_and_version','STRING','app.js','INTEGER','BOOLEAN','state','sequelize','exports'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xb57c,0x76));var _0xcb57=function(_0x3db9b7,_0x1133f3){_0x3db9b7=_0x3db9b7-0x0;var _0x290c03=_0xb57c[_0x3db9b7];return _0x290c03;};'use strict';var Sequelize=require(_0xcb57('0x0'));module[_0xcb57('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcb57('0x2')},'main':{'type':Sequelize[_0xcb57('0x3')],'defaultValue':_0xcb57('0x4')},'filename':{'type':Sequelize[_0xcb57('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcb57('0x3')]},'size':{'type':Sequelize[_0xcb57('0x5')]},'active':{'type':Sequelize[_0xcb57('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xcb57('0x3')]},'logo':{'type':Sequelize[_0xcb57('0x3')]},'state':{'type':Sequelize[_0xcb57('0x3')],'unique':_0xcb57('0x7')},'description':{'type':Sequelize[_0xcb57('0x3')]},'title':{'type':Sequelize[_0xcb57('0x3')]},'remoteUri':{'type':Sequelize[_0xcb57('0x3')]},'link':{'type':Sequelize[_0xcb57('0x3')],'defaultValue':'#'}};
\ No newline at end of file
diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js
index c9cf2b3..2e7381b 100644
--- a/server/api/integration/integration.controller.js
+++ b/server/api/integration/integration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5a91=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','index','Integration','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','include','findAll','params','includeAll','options','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x810d09,_0x4adab4){var _0x417828=function(_0x2537a9){while(--_0x2537a9){_0x810d09['push'](_0x810d09['shift']());}};_0x417828(++_0x4adab4);}(_0x5a91,0xc0));var _0x15a9=function(_0x1b5f00,_0x2bba5a){_0x1b5f00=_0x1b5f00-0x0;var _0x235948=_0x5a91[_0x1b5f00];return _0x235948;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x15a9('0x0'));var rimraf=require(_0x15a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15a9('0x2'));var rp=require(_0x15a9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15a9('0x4'));var path=require(_0x15a9('0x5'));var sox=require(_0x15a9('0x6'));var csv=require(_0x15a9('0x7'));var ejs=require(_0x15a9('0x8'));var fs=require('fs');var _=require(_0x15a9('0x9'));var squel=require(_0x15a9('0xa'));var crypto=require(_0x15a9('0xb'));var jsforce=require(_0x15a9('0xc'));var deskjs=require(_0x15a9('0xd'));var toCsv=require(_0x15a9('0x7'));var querystring=require(_0x15a9('0xe'));var Papa=require(_0x15a9('0xf'));var Redis=require(_0x15a9('0x10'));var authService=require(_0x15a9('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x15a9('0x12'));var logger=require(_0x15a9('0x13'))(_0x15a9('0x14'));var utils=require(_0x15a9('0x15'));var config=require('../../config/environment');var db=require(_0x15a9('0x16'))['db'];function respondWithStatusCode(_0x4f022e,_0x103ec7){_0x103ec7=_0x103ec7||0xcc;return function(_0x3d67f7){if(_0x3d67f7){return _0x4f022e[_0x15a9('0x17')](_0x103ec7);}return _0x4f022e[_0x15a9('0x18')](_0x103ec7)[_0x15a9('0x19')]();};}function respondWithResult(_0x16ab6c,_0x2a33b3){_0x2a33b3=_0x2a33b3||0xc8;return function(_0x2303d3){if(_0x2303d3){return _0x16ab6c[_0x15a9('0x18')](_0x2a33b3)[_0x15a9('0x1a')](_0x2303d3);}};}function respondWithFilteredResult(_0xb27ca0,_0x1fa23e){return function(_0x4f1b32){if(_0x4f1b32){var _0x8f0878=_0x4f1b32[_0x15a9('0x1b')],_0x3a3365=_0x1fa23e[_0x15a9('0x1c')],_0x404683=_0x1fa23e[_0x15a9('0x1c')]+_0x1fa23e[_0x15a9('0x1d')],_0x3fec7f;if(_0x404683>=_0x8f0878){_0x404683=_0x8f0878;_0x3fec7f=0xc8;}else{_0x3fec7f=0xce;}_0xb27ca0[_0x15a9('0x18')](_0x3fec7f);return _0xb27ca0[_0x15a9('0x1e')]('Content-Range',_0x3a3365+'-'+_0x404683+'/'+_0x8f0878)[_0x15a9('0x1a')](_0x4f1b32);}return null;};}function patchUpdates(_0x55fcf4){return function(_0x58bba2){try{jsonpatch[_0x15a9('0x1f')](_0x58bba2,_0x55fcf4,!![]);}catch(_0x50b8a0){return BPromise[_0x15a9('0x20')](_0x50b8a0);}return _0x58bba2[_0x15a9('0x21')]();};}function saveUpdates(_0x1fc183,_0x35a4dd){return function(_0x8f02af){if(_0x8f02af){return _0x8f02af[_0x15a9('0x22')](_0x1fc183)[_0x15a9('0x23')](function(_0x5f43c9){return _0x5f43c9;});}return null;};}function removeEntity(_0x1b3cae,_0x87f63a){return function(_0x6aaa41){if(_0x6aaa41){return _0x6aaa41[_0x15a9('0x24')]()['then'](function(){_0x1b3cae['status'](0xcc)[_0x15a9('0x19')]();});}};}function handleEntityNotFound(_0x43b354,_0xac44a){return function(_0x19b251){if(!_0x19b251){_0x43b354[_0x15a9('0x17')](0x194);}return _0x19b251;};}function handleError(_0x4e4864,_0x3d195c){_0x3d195c=_0x3d195c||0x1f4;return function(_0x96c5b){logger[_0x15a9('0x25')](_0x96c5b['stack']);if(_0x96c5b[_0x15a9('0x26')]){delete _0x96c5b['name'];}_0x4e4864[_0x15a9('0x18')](_0x3d195c)['send'](_0x96c5b);};}exports[_0x15a9('0x27')]=function(_0x29c8e5,_0x35a1bc){var _0x1fca85={},_0x20c3c0={},_0x1b1f81={'count':0x0,'rows':[]};var _0x436265=db[_0x15a9('0x28')][_0x15a9('0x29')];_0x20c3c0['model']=_[_0x15a9('0x2a')](_0x436265);_0x20c3c0[_0x15a9('0x2b')]=_[_0x15a9('0x2a')](_0x29c8e5[_0x15a9('0x2b')]);_0x20c3c0[_0x15a9('0x2c')]=_[_0x15a9('0x2d')](_0x20c3c0['model'],_0x20c3c0['query']);_0x1fca85[_0x15a9('0x2e')]=_[_0x15a9('0x2d')](_0x20c3c0[_0x15a9('0x2f')],qs[_0x15a9('0x30')](_0x29c8e5[_0x15a9('0x2b')]['fields']));_0x1fca85[_0x15a9('0x2e')]=_0x1fca85['attributes'][_0x15a9('0x31')]?_0x1fca85[_0x15a9('0x2e')]:_0x20c3c0['model'];if(!_0x29c8e5[_0x15a9('0x2b')][_0x15a9('0x32')](_0x15a9('0x33'))){_0x1fca85[_0x15a9('0x1d')]=qs['limit'](_0x29c8e5[_0x15a9('0x2b')][_0x15a9('0x1d')]);_0x1fca85['offset']=qs[_0x15a9('0x1c')](_0x29c8e5[_0x15a9('0x2b')][_0x15a9('0x1c')]);}_0x1fca85['order']=qs[_0x15a9('0x34')](_0x29c8e5[_0x15a9('0x2b')][_0x15a9('0x34')]);_0x1fca85[_0x15a9('0x35')]=qs[_0x15a9('0x2c')](_[_0x15a9('0x36')](_0x29c8e5['query'],_0x20c3c0[_0x15a9('0x2c')]));if(_0x29c8e5[_0x15a9('0x2b')][_0x15a9('0x37')]){_0x1fca85[_0x15a9('0x35')]=_[_0x15a9('0x38')](_0x1fca85[_0x15a9('0x35')],{'$or':_[_0x15a9('0x39')](_0x436265,function(_0x183cb7){if(_0x183cb7[_0x15a9('0x3a')]['key']!=='VIRTUAL'){var _0x586d09={};_0x586d09[_0x183cb7['field']]={'$like':'%'+_0x29c8e5['query'][_0x15a9('0x37')]+'%'};return _0x586d09;}})});}_0x1fca85=_[_0x15a9('0x38')]({},_0x1fca85,_0x29c8e5['options']);var _0x1d4177={'where':_0x1fca85[_0x15a9('0x35')]};return db[_0x15a9('0x28')][_0x15a9('0x1b')](_0x1d4177)[_0x15a9('0x23')](function(_0x5887fc){_0x1b1f81[_0x15a9('0x1b')]=_0x5887fc;if(_0x29c8e5[_0x15a9('0x2b')]['includeAll']){_0x1fca85[_0x15a9('0x3b')]=[{'all':!![]}];}return db[_0x15a9('0x28')][_0x15a9('0x3c')](_0x1fca85);})['then'](function(_0x2d3b60){_0x1b1f81['rows']=_0x2d3b60;return _0x1b1f81;})['then'](respondWithFilteredResult(_0x35a1bc,_0x1fca85))['catch'](handleError(_0x35a1bc,null));};exports['show']=function(_0x4220ed,_0x221a3d){var _0x334dc4={'raw':![],'where':{'id':_0x4220ed[_0x15a9('0x3d')]['id']}},_0x3e04e3={};_0x3e04e3['model']=_[_0x15a9('0x2a')](db[_0x15a9('0x28')][_0x15a9('0x29')]);_0x3e04e3['query']=_['keys'](_0x4220ed[_0x15a9('0x2b')]);_0x3e04e3['filters']=_['intersection'](_0x3e04e3[_0x15a9('0x2f')],_0x3e04e3[_0x15a9('0x2b')]);_0x334dc4[_0x15a9('0x2e')]=_['intersection'](_0x3e04e3[_0x15a9('0x2f')],qs[_0x15a9('0x30')](_0x4220ed[_0x15a9('0x2b')][_0x15a9('0x30')]));_0x334dc4['attributes']=_0x334dc4[_0x15a9('0x2e')][_0x15a9('0x31')]?_0x334dc4[_0x15a9('0x2e')]:_0x3e04e3[_0x15a9('0x2f')];if(_0x4220ed[_0x15a9('0x2b')][_0x15a9('0x3e')]){_0x334dc4[_0x15a9('0x3b')]=[{'all':!![]}];}_0x334dc4=_['merge']({},_0x334dc4,_0x4220ed[_0x15a9('0x3f')]);return db[_0x15a9('0x28')]['find'](_0x334dc4)[_0x15a9('0x23')](handleEntityNotFound(_0x221a3d,null))[_0x15a9('0x23')](respondWithResult(_0x221a3d,null))[_0x15a9('0x40')](handleError(_0x221a3d,null));};exports['create']=function(_0xabaab3,_0x53a5d0){return db[_0x15a9('0x28')][_0x15a9('0x41')](_0xabaab3[_0x15a9('0x42')],{})[_0x15a9('0x23')](respondWithResult(_0x53a5d0,0xc9))[_0x15a9('0x40')](handleError(_0x53a5d0,null));};exports['update']=function(_0x34d379,_0x2c4e5e){if(_0x34d379[_0x15a9('0x42')]['id']){delete _0x34d379[_0x15a9('0x42')]['id'];}return db['Integration'][_0x15a9('0x43')]({'where':{'id':_0x34d379[_0x15a9('0x3d')]['id']}})[_0x15a9('0x23')](handleEntityNotFound(_0x2c4e5e,null))['then'](saveUpdates(_0x34d379[_0x15a9('0x42')],null))[_0x15a9('0x23')](respondWithResult(_0x2c4e5e,null))[_0x15a9('0x40')](handleError(_0x2c4e5e,null));};exports['destroy']=function(_0x154a30,_0x2a6781){return db['Integration'][_0x15a9('0x43')]({'where':{'id':_0x154a30[_0x15a9('0x3d')]['id']}})[_0x15a9('0x23')](handleEntityNotFound(_0x2a6781,null))[_0x15a9('0x23')](removeEntity(_0x2a6781,null))[_0x15a9('0x40')](handleError(_0x2a6781,null));};
\ No newline at end of file
+var _0xa3ce=['rawAttributes','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','sort','where','filter','map','key','field','merge','options','then','includeAll','include','findAll','rows','params','find','create','body','catch','destroy','html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','to-csv','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','end','error','stack','name','send','Integration'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa3ce,0x1af));var _0xea3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa3ce[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xea3c('0x0'));var emlformat=require(_0xea3c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xea3c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xea3c('0x3'));var Mustache=require(_0xea3c('0x4'));var util=require(_0xea3c('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xea3c('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xea3c('0x7'));var jsforce=require(_0xea3c('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea3c('0x9'));var Papa=require(_0xea3c('0xa'));var Redis=require(_0xea3c('0xb'));var authService=require(_0xea3c('0xc'));var qs=require(_0xea3c('0xd'));var hardwareService=require(_0xea3c('0xe'));var logger=require(_0xea3c('0xf'))(_0xea3c('0x10'));var utils=require(_0xea3c('0x11'));var config=require(_0xea3c('0x12'));var db=require(_0xea3c('0x13'))['db'];function respondWithStatusCode(_0xbe70a4,_0x2bac30){_0x2bac30=_0x2bac30||0xcc;return function(_0x1b8bd5){if(_0x1b8bd5){return _0xbe70a4[_0xea3c('0x14')](_0x2bac30);}return _0xbe70a4[_0xea3c('0x15')](_0x2bac30)['end']();};}function respondWithResult(_0x19b41e,_0x1711a5){_0x1711a5=_0x1711a5||0xc8;return function(_0x5d6a2b){if(_0x5d6a2b){return _0x19b41e[_0xea3c('0x15')](_0x1711a5)['json'](_0x5d6a2b);}};}function respondWithFilteredResult(_0x9281d0,_0x2ce766){return function(_0x52d8cc){if(_0x52d8cc){var _0x1dd0e4=_0x52d8cc[_0xea3c('0x16')],_0x266101=_0x2ce766[_0xea3c('0x17')],_0x3a7f54=_0x2ce766[_0xea3c('0x17')]+_0x2ce766[_0xea3c('0x18')],_0x986bf8;if(_0x3a7f54>=_0x1dd0e4){_0x3a7f54=_0x1dd0e4;_0x986bf8=0xc8;}else{_0x986bf8=0xce;}_0x9281d0[_0xea3c('0x15')](_0x986bf8);return _0x9281d0[_0xea3c('0x19')](_0xea3c('0x1a'),_0x266101+'-'+_0x3a7f54+'/'+_0x1dd0e4)[_0xea3c('0x1b')](_0x52d8cc);}return null;};}function patchUpdates(_0x43e014){return function(_0x177547){try{jsonpatch[_0xea3c('0x1c')](_0x177547,_0x43e014,!![]);}catch(_0x251edf){return BPromise[_0xea3c('0x1d')](_0x251edf);}return _0x177547[_0xea3c('0x1e')]();};}function saveUpdates(_0x4e50c5,_0x524da7){return function(_0x4c7586){if(_0x4c7586){return _0x4c7586[_0xea3c('0x1f')](_0x4e50c5)['then'](function(_0x1ee883){return _0x1ee883;});}return null;};}function removeEntity(_0x144002,_0x3a0365){return function(_0xf05d7d){if(_0xf05d7d){return _0xf05d7d['destroy']()['then'](function(){_0x144002[_0xea3c('0x15')](0xcc)[_0xea3c('0x20')]();});}};}function handleEntityNotFound(_0x5b8541,_0xa76fb2){return function(_0x582535){if(!_0x582535){_0x5b8541[_0xea3c('0x14')](0x194);}return _0x582535;};}function handleError(_0x51e694,_0x41498b){_0x41498b=_0x41498b||0x1f4;return function(_0x113347){logger[_0xea3c('0x21')](_0x113347[_0xea3c('0x22')]);if(_0x113347[_0xea3c('0x23')]){delete _0x113347['name'];}_0x51e694[_0xea3c('0x15')](_0x41498b)[_0xea3c('0x24')](_0x113347);};}exports['index']=function(_0x55ba33,_0x580d8c){var _0x1a7e85={},_0x2030d8={},_0x23aab5={'count':0x0,'rows':[]};var _0x47ecd9=db[_0xea3c('0x25')][_0xea3c('0x26')];_0x2030d8['model']=_[_0xea3c('0x27')](_0x47ecd9);_0x2030d8['query']=_['keys'](_0x55ba33['query']);_0x2030d8[_0xea3c('0x28')]=_[_0xea3c('0x29')](_0x2030d8[_0xea3c('0x2a')],_0x2030d8[_0xea3c('0x2b')]);_0x1a7e85[_0xea3c('0x2c')]=_[_0xea3c('0x29')](_0x2030d8[_0xea3c('0x2a')],qs[_0xea3c('0x2d')](_0x55ba33['query']['fields']));_0x1a7e85[_0xea3c('0x2c')]=_0x1a7e85[_0xea3c('0x2c')][_0xea3c('0x2e')]?_0x1a7e85['attributes']:_0x2030d8['model'];if(!_0x55ba33[_0xea3c('0x2b')][_0xea3c('0x2f')]('nolimit')){_0x1a7e85[_0xea3c('0x18')]=qs[_0xea3c('0x18')](_0x55ba33['query'][_0xea3c('0x18')]);_0x1a7e85[_0xea3c('0x17')]=qs[_0xea3c('0x17')](_0x55ba33[_0xea3c('0x2b')]['offset']);}_0x1a7e85['order']=qs[_0xea3c('0x30')](_0x55ba33[_0xea3c('0x2b')][_0xea3c('0x30')]);_0x1a7e85[_0xea3c('0x31')]=qs['filters'](_['pick'](_0x55ba33[_0xea3c('0x2b')],_0x2030d8[_0xea3c('0x28')]));if(_0x55ba33[_0xea3c('0x2b')][_0xea3c('0x32')]){_0x1a7e85[_0xea3c('0x31')]=_['merge'](_0x1a7e85['where'],{'$or':_[_0xea3c('0x33')](_0x47ecd9,function(_0x721480){if(_0x721480['type'][_0xea3c('0x34')]!=='VIRTUAL'){var _0x122e6e={};_0x122e6e[_0x721480[_0xea3c('0x35')]]={'$like':'%'+_0x55ba33[_0xea3c('0x2b')][_0xea3c('0x32')]+'%'};return _0x122e6e;}})});}_0x1a7e85=_[_0xea3c('0x36')]({},_0x1a7e85,_0x55ba33[_0xea3c('0x37')]);var _0x440054={'where':_0x1a7e85[_0xea3c('0x31')]};return db['Integration'][_0xea3c('0x16')](_0x440054)[_0xea3c('0x38')](function(_0x20293f){_0x23aab5[_0xea3c('0x16')]=_0x20293f;if(_0x55ba33[_0xea3c('0x2b')][_0xea3c('0x39')]){_0x1a7e85[_0xea3c('0x3a')]=[{'all':!![]}];}return db[_0xea3c('0x25')][_0xea3c('0x3b')](_0x1a7e85);})[_0xea3c('0x38')](function(_0x11f48a){_0x23aab5[_0xea3c('0x3c')]=_0x11f48a;return _0x23aab5;})[_0xea3c('0x38')](respondWithFilteredResult(_0x580d8c,_0x1a7e85))['catch'](handleError(_0x580d8c,null));};exports['show']=function(_0x2e0572,_0x1d9eab){var _0x4a6959={'raw':![],'where':{'id':_0x2e0572[_0xea3c('0x3d')]['id']}},_0x51ebd7={};_0x51ebd7[_0xea3c('0x2a')]=_['keys'](db['Integration'][_0xea3c('0x26')]);_0x51ebd7[_0xea3c('0x2b')]=_[_0xea3c('0x27')](_0x2e0572[_0xea3c('0x2b')]);_0x51ebd7[_0xea3c('0x28')]=_[_0xea3c('0x29')](_0x51ebd7[_0xea3c('0x2a')],_0x51ebd7['query']);_0x4a6959[_0xea3c('0x2c')]=_[_0xea3c('0x29')](_0x51ebd7[_0xea3c('0x2a')],qs[_0xea3c('0x2d')](_0x2e0572[_0xea3c('0x2b')][_0xea3c('0x2d')]));_0x4a6959['attributes']=_0x4a6959[_0xea3c('0x2c')][_0xea3c('0x2e')]?_0x4a6959[_0xea3c('0x2c')]:_0x51ebd7[_0xea3c('0x2a')];if(_0x2e0572[_0xea3c('0x2b')]['includeAll']){_0x4a6959[_0xea3c('0x3a')]=[{'all':!![]}];}_0x4a6959=_[_0xea3c('0x36')]({},_0x4a6959,_0x2e0572[_0xea3c('0x37')]);return db[_0xea3c('0x25')][_0xea3c('0x3e')](_0x4a6959)[_0xea3c('0x38')](handleEntityNotFound(_0x1d9eab,null))[_0xea3c('0x38')](respondWithResult(_0x1d9eab,null))['catch'](handleError(_0x1d9eab,null));};exports['create']=function(_0x34dc79,_0x1f9078){return db[_0xea3c('0x25')][_0xea3c('0x3f')](_0x34dc79['body'],{})[_0xea3c('0x38')](respondWithResult(_0x1f9078,0xc9))['catch'](handleError(_0x1f9078,null));};exports[_0xea3c('0x1f')]=function(_0x5a923d,_0x5ea964){if(_0x5a923d['body']['id']){delete _0x5a923d[_0xea3c('0x40')]['id'];}return db[_0xea3c('0x25')][_0xea3c('0x3e')]({'where':{'id':_0x5a923d[_0xea3c('0x3d')]['id']}})[_0xea3c('0x38')](handleEntityNotFound(_0x5ea964,null))[_0xea3c('0x38')](saveUpdates(_0x5a923d[_0xea3c('0x40')],null))[_0xea3c('0x38')](respondWithResult(_0x5ea964,null))[_0xea3c('0x41')](handleError(_0x5ea964,null));};exports[_0xea3c('0x42')]=function(_0x8cb3a3,_0x4ea19b){return db[_0xea3c('0x25')][_0xea3c('0x3e')]({'where':{'id':_0x8cb3a3[_0xea3c('0x3d')]['id']}})[_0xea3c('0x38')](handleEntityNotFound(_0x4ea19b,null))[_0xea3c('0x38')](removeEntity(_0x4ea19b,null))[_0xea3c('0x41')](handleError(_0x4ea19b,null));};
\ No newline at end of file
diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js
index 029f50c..7dedc8f 100644
--- a/server/api/integration/integration.model.js
+++ b/server/api/integration/integration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x08fa=['Integration','integrations','lodash','../../config/logger','api','moment','path','../../config/environment','exports','define'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0x08fa,0x124));var _0xa08f=function(_0x35158d,_0x3fe39b){_0x35158d=_0x35158d-0x0;var _0x31f810=_0x08fa[_0x35158d];return _0x31f810;};'use strict';var _=require(_0xa08f('0x0'));var util=require('util');var logger=require(_0xa08f('0x1'))(_0xa08f('0x2'));var moment=require(_0xa08f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa08f('0x4'));var rimraf=require('rimraf');var config=require(_0xa08f('0x5'));var attributes=require('./integration.attributes');module[_0xa08f('0x6')]=function(_0x35ca35,_0x15c7dd){return _0x35ca35[_0xa08f('0x7')](_0xa08f('0x8'),attributes,{'tableName':_0xa08f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','lodash','util','../../config/logger'];(function(_0x180ae5,_0x5499cf){var _0x191403=function(_0x5d3112){while(--_0x5d3112){_0x180ae5['push'](_0x180ae5['shift']());}};_0x191403(++_0x5499cf);}(_0x1fab,0x1d9));var _0xb1fa=function(_0x4a0667,_0x528c50){_0x4a0667=_0x4a0667-0x0;var _0x38cfa3=_0x1fab[_0x4a0667];return _0x38cfa3;};'use strict';var _=require(_0xb1fa('0x0'));var util=require(_0xb1fa('0x1'));var logger=require(_0xb1fa('0x2'))(_0xb1fa('0x3'));var moment=require(_0xb1fa('0x4'));var BPromise=require(_0xb1fa('0x5'));var rp=require(_0xb1fa('0x6'));var fs=require('fs');var path=require(_0xb1fa('0x7'));var rimraf=require(_0xb1fa('0x8'));var config=require(_0xb1fa('0x9'));var attributes=require(_0xb1fa('0xa'));module[_0xb1fa('0xb')]=function(_0x2ff29b,_0x5e6b74){return _0x2ff29b[_0xb1fa('0xc')](_0xb1fa('0xd'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js
index ccfb65b..600258a 100644
--- a/server/api/integration/integration.rpc.js
+++ b/server/api/integration/integration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd5c7=['catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x453257,_0x2fe82e){var _0x9779a8=function(_0x2c9ad0){while(--_0x2c9ad0){_0x453257['push'](_0x453257['shift']());}};_0x9779a8(++_0x2fe82e);}(_0xd5c7,0x99));var _0x7d5c=function(_0x5a76ee,_0x26e0a2){_0x5a76ee=_0x5a76ee-0x0;var _0x871197=_0xd5c7[_0x5a76ee];return _0x871197;};'use strict';var _=require('lodash');var util=require(_0x7d5c('0x0'));var moment=require(_0x7d5c('0x1'));var BPromise=require('bluebird');var rs=require(_0x7d5c('0x2'));var fs=require('fs');var Redis=require(_0x7d5c('0x3'));var db=require(_0x7d5c('0x4'))['db'];var utils=require(_0x7d5c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7d5c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7d5c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x421302,_0x210df4,_0x58cc37){return new BPromise(function(_0x334480,_0x1d0c5c){return client[_0x7d5c('0x8')](_0x421302,_0x58cc37)[_0x7d5c('0x9')](function(_0x516aa6){logger[_0x7d5c('0xa')](_0x7d5c('0xb'),_0x210df4,_0x7d5c('0xc'));logger[_0x7d5c('0xd')](_0x7d5c('0xe'),_0x210df4,_0x7d5c('0xc'),JSON[_0x7d5c('0xf')](_0x516aa6));if(_0x516aa6['error']){if(_0x516aa6[_0x7d5c('0x10')]['code']===0x1f4){logger['error'](_0x7d5c('0xb'),_0x210df4,_0x516aa6[_0x7d5c('0x10')][_0x7d5c('0x11')]);return _0x1d0c5c(_0x516aa6['error'][_0x7d5c('0x11')]);}logger[_0x7d5c('0x10')]('Integration,\x20%s,\x20%s',_0x210df4,_0x516aa6[_0x7d5c('0x10')][_0x7d5c('0x11')]);return _0x334480(_0x516aa6[_0x7d5c('0x10')][_0x7d5c('0x11')]);}else{logger['info'](_0x7d5c('0xb'),_0x210df4,_0x7d5c('0xc'));_0x334480(_0x516aa6['result'][_0x7d5c('0x11')]);}})[_0x7d5c('0x12')](function(_0x5c37d4){logger[_0x7d5c('0x10')](_0x7d5c('0xb'),_0x210df4,_0x5c37d4);_0x1d0c5c(_0x5c37d4);});});}
\ No newline at end of file
+var _0x15f3=['then','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x364075,_0x386968){var _0x3b7117=function(_0x3eec76){while(--_0x3eec76){_0x364075['push'](_0x364075['shift']());}};_0x3b7117(++_0x386968);}(_0x15f3,0x1ed));var _0x315f=function(_0x3281c8,_0x2c5d3a){_0x3281c8=_0x3281c8-0x0;var _0x5a2345=_0x15f3[_0x3281c8];return _0x5a2345;};'use strict';var _=require(_0x315f('0x0'));var util=require('util');var moment=require(_0x315f('0x1'));var BPromise=require(_0x315f('0x2'));var rs=require(_0x315f('0x3'));var fs=require('fs');var Redis=require(_0x315f('0x4'));var db=require(_0x315f('0x5'))['db'];var utils=require(_0x315f('0x6'));var logger=require(_0x315f('0x7'))(_0x315f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x315f('0x9')][_0x315f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b72e5,_0x29483e,_0x2b906d){return new BPromise(function(_0x47fc42,_0x57b33d){return client['request'](_0x5b72e5,_0x2b906d)[_0x315f('0xb')](function(_0x22c95c){logger['info']('Integration,\x20%s,\x20%s',_0x29483e,'request\x20sent');logger[_0x315f('0xc')](_0x315f('0xd'),_0x29483e,_0x315f('0xe'),JSON['stringify'](_0x22c95c));if(_0x22c95c['error']){if(_0x22c95c[_0x315f('0xf')][_0x315f('0x10')]===0x1f4){logger['error'](_0x315f('0x11'),_0x29483e,_0x22c95c[_0x315f('0xf')]['message']);return _0x57b33d(_0x22c95c['error'][_0x315f('0x12')]);}logger[_0x315f('0xf')](_0x315f('0x11'),_0x29483e,_0x22c95c['error'][_0x315f('0x12')]);return _0x47fc42(_0x22c95c['error'][_0x315f('0x12')]);}else{logger['info'](_0x315f('0x11'),_0x29483e,_0x315f('0xe'));_0x47fc42(_0x22c95c[_0x315f('0x13')][_0x315f('0x12')]);}})[_0x315f('0x14')](function(_0x42d7d4){logger[_0x315f('0xf')]('Integration,\x20%s,\x20%s',_0x29483e,_0x42d7d4);_0x57b33d(_0x42d7d4);});});}
\ No newline at end of file
diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js
index 9df599d..a75cc3a 100644
--- a/server/api/integrationReport/index.js
+++ b/server/api/integrationReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb1e=['/describe','describe','/:id','show','post','create','update','exports','util','path','connect-timeout','express','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index'];(function(_0x3b1106,_0x4bd523){var _0x1fbeef=function(_0x2c6889){while(--_0x2c6889){_0x3b1106['push'](_0x3b1106['shift']());}};_0x1fbeef(++_0x4bd523);}(_0xbb1e,0x90));var _0xebb1=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbb1e[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0xebb1('0x0'));var path=require(_0xebb1('0x1'));var timeout=require(_0xebb1('0x2'));var express=require(_0xebb1('0x3'));var router=express['Router']();var auth=require(_0xebb1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xebb1('0x5'));router[_0xebb1('0x6')]('/',auth[_0xebb1('0x7')](),controller[_0xebb1('0x8')]);router[_0xebb1('0x6')](_0xebb1('0x9'),auth[_0xebb1('0x7')](),controller[_0xebb1('0xa')]);router[_0xebb1('0x6')](_0xebb1('0xb'),auth['isAuthenticated'](),controller[_0xebb1('0xc')]);router[_0xebb1('0xd')]('/',auth[_0xebb1('0x7')](),controller[_0xebb1('0xe')]);router['put'](_0xebb1('0xb'),auth['isAuthenticated'](),controller[_0xebb1('0xf')]);router['delete'](_0xebb1('0xb'),auth[_0xebb1('0x7')](),controller['destroy']);module[_0xebb1('0x10')]=router;
\ No newline at end of file
+var _0x043d=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete'];(function(_0x3de2e3,_0x138ce7){var _0x1bce2a=function(_0x39c79f){while(--_0x39c79f){_0x3de2e3['push'](_0x3de2e3['shift']());}};_0x1bce2a(++_0x138ce7);}(_0x043d,0x1ba));var _0xd043=function(_0x55d58f,_0x2bea83){_0x55d58f=_0x55d58f-0x0;var _0x1ad6e6=_0x043d[_0x55d58f];return _0x1ad6e6;};'use strict';var multer=require(_0xd043('0x0'));var util=require(_0xd043('0x1'));var path=require(_0xd043('0x2'));var timeout=require(_0xd043('0x3'));var express=require(_0xd043('0x4'));var router=express[_0xd043('0x5')]();var auth=require(_0xd043('0x6'));var interaction=require(_0xd043('0x7'));var config=require(_0xd043('0x8'));var controller=require(_0xd043('0x9'));router[_0xd043('0xa')]('/',auth[_0xd043('0xb')](),controller[_0xd043('0xc')]);router[_0xd043('0xa')]('/describe',auth[_0xd043('0xb')](),controller[_0xd043('0xd')]);router['get'](_0xd043('0xe'),auth['isAuthenticated'](),controller[_0xd043('0xf')]);router[_0xd043('0x10')]('/',auth[_0xd043('0xb')](),controller['create']);router[_0xd043('0x11')](_0xd043('0xe'),auth[_0xd043('0xb')](),controller[_0xd043('0x12')]);router[_0xd043('0x13')](_0xd043('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xd043('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js
index 0b59422..474298e 100644
--- a/server/api/integrationReport/integrationReport.attributes.js
+++ b/server/api/integrationReport/integrationReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe1ff=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED'];(function(_0x2cb491,_0x3e08e8){var _0x2a9bde=function(_0x3a44c9){while(--_0x3a44c9){_0x2cb491['push'](_0x2cb491['shift']());}};_0x2a9bde(++_0x3e08e8);}(_0xe1ff,0x138));var _0xfe1f=function(_0x41fd17,_0x5ddf0f){_0x41fd17=_0x41fd17-0x0;var _0x3e8502=_0xe1ff[_0x41fd17];return _0x3e8502;};'use strict';var Sequelize=require(_0xfe1f('0x0'));module[_0xfe1f('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xfe1f('0x2')]},'exitStatus':{'type':Sequelize[_0xfe1f('0x2')]},'ticketId':{'type':Sequelize[_0xfe1f('0x2')]},'integrationId':{'type':Sequelize[_0xfe1f('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfe1f('0x2')]},'calleridnum':{'type':Sequelize[_0xfe1f('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfe1f('0x2')]},'interface':{'type':Sequelize[_0xfe1f('0x2')]},'membername':{'type':Sequelize[_0xfe1f('0x2')]},'agentcalledAt':{'type':Sequelize[_0xfe1f('0x4')]},'agentconnectAt':{'type':Sequelize[_0xfe1f('0x4')]},'holdtime':{'type':Sequelize[_0xfe1f('0x3')]},'agentcomplete':{'type':Sequelize[_0xfe1f('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xfe1f('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xfe1f('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xfe1f('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xfe1f('0x4')]},'agentdump':{'type':Sequelize[_0xfe1f('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xfe1f('0x4')]},'lastevent':{'type':Sequelize[_0xfe1f('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xfe1f('0x3')]},'channelstatedesc':{'type':Sequelize[_0xfe1f('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfe1f('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfe1f('0x2')]},'accountcode':{'type':Sequelize[_0xfe1f('0x2')]},'context':{'type':Sequelize[_0xfe1f('0x2')]},'exten':{'type':Sequelize[_0xfe1f('0x2')]},'priority':{'type':Sequelize[_0xfe1f('0x2')]},'destchannel':{'type':Sequelize[_0xfe1f('0x2')]},'destchannelstate':{'type':Sequelize[_0xfe1f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xfe1f('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xfe1f('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xfe1f('0x2')]},'destlanguage':{'type':Sequelize[_0xfe1f('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xfe1f('0x2')]},'destexten':{'type':Sequelize[_0xfe1f('0x2')]},'destpriority':{'type':Sequelize[_0xfe1f('0x2')]},'destuniqueid':{'type':Sequelize[_0xfe1f('0x2')]},'messageId':{'type':Sequelize[_0xfe1f('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xfe1f('0x2')]},'from':{'type':Sequelize[_0xfe1f('0x2')]},'to':{'type':Sequelize[_0xfe1f('0x2')]},'cc':{'type':Sequelize[_0xfe1f('0x2')]},'attachment':{'type':Sequelize[_0xfe1f('0x6')]},'html':{'type':Sequelize[_0xfe1f('0x6')]},'text':{'type':Sequelize[_0xfe1f('0x6')]},'status':{'type':Sequelize[_0xfe1f('0x7')](_0xfe1f('0x8'),_0xfe1f('0x9'),_0xfe1f('0xa'),_0xfe1f('0xb'))},'url':{'type':Sequelize[_0xfe1f('0x2')]},'app':{'type':Sequelize[_0xfe1f('0x2')]},'appdata':{'type':Sequelize[_0xfe1f('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xa8a6=['DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED','FAILED','exports','STRING','INTEGER'];(function(_0x2b7cfb,_0x4161dc){var _0x26182a=function(_0x3cd13a){while(--_0x3cd13a){_0x2b7cfb['push'](_0x2b7cfb['shift']());}};_0x26182a(++_0x4161dc);}(_0xa8a6,0x18d));var _0x6a8a=function(_0x6800f2,_0x1869a9){_0x6800f2=_0x6800f2-0x0;var _0x2450ab=_0xa8a6[_0x6800f2];return _0x2450ab;};'use strict';var Sequelize=require('sequelize');module[_0x6a8a('0x0')]={'integration':{'type':Sequelize[_0x6a8a('0x1')]},'eventChannel':{'type':Sequelize[_0x6a8a('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x6a8a('0x2')]},'contacts':{'type':Sequelize[_0x6a8a('0x1')]},'uniqueid':{'type':Sequelize[_0x6a8a('0x1')]},'calleridnum':{'type':Sequelize[_0x6a8a('0x1')]},'calleridname':{'type':Sequelize[_0x6a8a('0x1')]},'queue':{'type':Sequelize[_0x6a8a('0x1')]},'interface':{'type':Sequelize[_0x6a8a('0x1')]},'membername':{'type':Sequelize[_0x6a8a('0x1')]},'agentcalledAt':{'type':Sequelize[_0x6a8a('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6a8a('0x3')]},'holdtime':{'type':Sequelize[_0x6a8a('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x6a8a('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6a8a('0x2')]},'reason':{'type':Sequelize[_0x6a8a('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6a8a('0x3')]},'agentdump':{'type':Sequelize[_0x6a8a('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6a8a('0x3')]},'lastevent':{'type':Sequelize[_0x6a8a('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6a8a('0x2')]},'channelstatedesc':{'type':Sequelize[_0x6a8a('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x6a8a('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6a8a('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6a8a('0x1')]},'destchannel':{'type':Sequelize[_0x6a8a('0x1')]},'destchannelstate':{'type':Sequelize[_0x6a8a('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x6a8a('0x1')]},'destcalleridnum':{'type':Sequelize[_0x6a8a('0x1')]},'destcalleridname':{'type':Sequelize[_0x6a8a('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x6a8a('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x6a8a('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x6a8a('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6a8a('0x1')]},'messageId':{'type':Sequelize[_0x6a8a('0x1')]},'inReplyTo':{'type':Sequelize[_0x6a8a('0x1')]},'subject':{'type':Sequelize[_0x6a8a('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6a8a('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x6a8a('0x5')]},'text':{'type':Sequelize[_0x6a8a('0x5')]},'status':{'type':Sequelize[_0x6a8a('0x6')](_0x6a8a('0x7'),'SENDING',_0x6a8a('0x8'),_0x6a8a('0x9'))},'url':{'type':Sequelize[_0x6a8a('0x1')]},'app':{'type':Sequelize[_0x6a8a('0x1')]},'appdata':{'type':Sequelize[_0x6a8a('0x1')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js
index da2bf51..321a10a 100644
--- a/server/api/integrationReport/integrationReport.controller.js
+++ b/server/api/integrationReport/integrationReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe027=['offset','limit','Content-Range','apply','reject','save','update','destroy','end','error','name','index','IntegrationReport','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','type','options','count','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0xd3fc8c,_0x204ecb){var _0x44558b=function(_0x2a958c){while(--_0x2a958c){_0xd3fc8c['push'](_0xd3fc8c['shift']());}};_0x44558b(++_0x204ecb);}(_0xe027,0x106));var _0x7e02=function(_0x1d22ce,_0x21a755){_0x1d22ce=_0x1d22ce-0x0;var _0x998150=_0xe027[_0x1d22ce];return _0x998150;};'use strict';var pdf=require(_0x7e02('0x0'));var emlformat=require(_0x7e02('0x1'));var rimraf=require(_0x7e02('0x2'));var zipdir=require(_0x7e02('0x3'));var jsonpatch=require(_0x7e02('0x4'));var rp=require(_0x7e02('0x5'));var moment=require(_0x7e02('0x6'));var BPromise=require(_0x7e02('0x7'));var Mustache=require(_0x7e02('0x8'));var util=require(_0x7e02('0x9'));var path=require(_0x7e02('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7e02('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7e02('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7e02('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7e02('0xe'));var Papa=require(_0x7e02('0xf'));var Redis=require(_0x7e02('0x10'));var authService=require(_0x7e02('0x11'));var qs=require(_0x7e02('0x12'));var hardwareService=require(_0x7e02('0x13'));var logger=require('../../config/logger')(_0x7e02('0x14'));var utils=require('../../config/utils');var config=require(_0x7e02('0x15'));var db=require(_0x7e02('0x16'))['db'];function respondWithStatusCode(_0x9de2f,_0x8406e6){_0x8406e6=_0x8406e6||0xcc;return function(_0x44daf4){if(_0x44daf4){return _0x9de2f[_0x7e02('0x17')](_0x8406e6);}return _0x9de2f[_0x7e02('0x18')](_0x8406e6)['end']();};}function respondWithResult(_0x7dc571,_0x5d91ab){_0x5d91ab=_0x5d91ab||0xc8;return function(_0x542ecb){if(_0x542ecb){return _0x7dc571[_0x7e02('0x18')](_0x5d91ab)[_0x7e02('0x19')](_0x542ecb);}};}function respondWithFilteredResult(_0x269c3b,_0x249281){return function(_0x33b013){if(_0x33b013){var _0x550352=_0x33b013['count'],_0x5b69a3=_0x249281[_0x7e02('0x1a')],_0x589ecb=_0x249281[_0x7e02('0x1a')]+_0x249281[_0x7e02('0x1b')],_0x24a572;if(_0x589ecb>=_0x550352){_0x589ecb=_0x550352;_0x24a572=0xc8;}else{_0x24a572=0xce;}_0x269c3b[_0x7e02('0x18')](_0x24a572);return _0x269c3b['set'](_0x7e02('0x1c'),_0x5b69a3+'-'+_0x589ecb+'/'+_0x550352)[_0x7e02('0x19')](_0x33b013);}return null;};}function patchUpdates(_0x53d174){return function(_0x1199ed){try{jsonpatch[_0x7e02('0x1d')](_0x1199ed,_0x53d174,!![]);}catch(_0x1d2bd2){return BPromise[_0x7e02('0x1e')](_0x1d2bd2);}return _0x1199ed[_0x7e02('0x1f')]();};}function saveUpdates(_0xd7c720,_0x5670c1){return function(_0x452499){if(_0x452499){return _0x452499[_0x7e02('0x20')](_0xd7c720)['then'](function(_0x2f44f4){return _0x2f44f4;});}return null;};}function removeEntity(_0x1eef9c,_0x4aca7e){return function(_0xb1b8f9){if(_0xb1b8f9){return _0xb1b8f9[_0x7e02('0x21')]()['then'](function(){_0x1eef9c[_0x7e02('0x18')](0xcc)[_0x7e02('0x22')]();});}};}function handleEntityNotFound(_0x5b0481,_0x5625e5){return function(_0x3e1b35){if(!_0x3e1b35){_0x5b0481[_0x7e02('0x17')](0x194);}return _0x3e1b35;};}function handleError(_0x177553,_0x145adb){_0x145adb=_0x145adb||0x1f4;return function(_0x3b8794){logger[_0x7e02('0x23')](_0x3b8794['stack']);if(_0x3b8794['name']){delete _0x3b8794[_0x7e02('0x24')];}_0x177553[_0x7e02('0x18')](_0x145adb)['send'](_0x3b8794);};}exports[_0x7e02('0x25')]=function(_0x56b928,_0x216e7c){var _0xd4270e={},_0x3541b6={},_0x552ed7={'count':0x0,'rows':[]};var _0x42283d=db[_0x7e02('0x26')][_0x7e02('0x27')];_0x3541b6['model']=_['keys'](_0x42283d);_0x3541b6[_0x7e02('0x28')]=_[_0x7e02('0x29')](_0x56b928['query']);_0x3541b6[_0x7e02('0x2a')]=_[_0x7e02('0x2b')](_0x3541b6[_0x7e02('0x2c')],_0x3541b6[_0x7e02('0x28')]);_0xd4270e['attributes']=_[_0x7e02('0x2b')](_0x3541b6[_0x7e02('0x2c')],qs[_0x7e02('0x2d')](_0x56b928[_0x7e02('0x28')][_0x7e02('0x2d')]));_0xd4270e[_0x7e02('0x2e')]=_0xd4270e[_0x7e02('0x2e')][_0x7e02('0x2f')]?_0xd4270e[_0x7e02('0x2e')]:_0x3541b6[_0x7e02('0x2c')];if(!_0x56b928[_0x7e02('0x28')][_0x7e02('0x30')](_0x7e02('0x31'))){_0xd4270e[_0x7e02('0x1b')]=qs[_0x7e02('0x1b')](_0x56b928['query'][_0x7e02('0x1b')]);_0xd4270e[_0x7e02('0x1a')]=qs[_0x7e02('0x1a')](_0x56b928[_0x7e02('0x28')][_0x7e02('0x1a')]);}_0xd4270e[_0x7e02('0x32')]=qs[_0x7e02('0x33')](_0x56b928['query']['sort']);_0xd4270e['where']=qs['filters'](_[_0x7e02('0x34')](_0x56b928[_0x7e02('0x28')],_0x3541b6['filters']));if(_0x56b928[_0x7e02('0x28')][_0x7e02('0x35')]){_0xd4270e['where']=_[_0x7e02('0x36')](_0xd4270e[_0x7e02('0x37')],{'$or':_[_0x7e02('0x38')](_0x42283d,function(_0x358d93){if(_0x358d93[_0x7e02('0x39')]['key']!=='VIRTUAL'){var _0x43c9c5={};_0x43c9c5[_0x358d93['field']]={'$like':'%'+_0x56b928[_0x7e02('0x28')][_0x7e02('0x35')]+'%'};return _0x43c9c5;}})});}_0xd4270e=_[_0x7e02('0x36')]({},_0xd4270e,_0x56b928[_0x7e02('0x3a')]);var _0x4cd23f={'where':_0xd4270e[_0x7e02('0x37')]};return db[_0x7e02('0x26')][_0x7e02('0x3b')](_0x4cd23f)[_0x7e02('0x3c')](function(_0x1f8d8f){_0x552ed7[_0x7e02('0x3b')]=_0x1f8d8f;if(_0x56b928['query'][_0x7e02('0x3d')]){_0xd4270e[_0x7e02('0x3e')]=[{'all':!![]}];}return db[_0x7e02('0x26')][_0x7e02('0x3f')](_0xd4270e);})[_0x7e02('0x3c')](function(_0x1125ac){_0x552ed7[_0x7e02('0x40')]=_0x1125ac;return _0x552ed7;})[_0x7e02('0x3c')](respondWithFilteredResult(_0x216e7c,_0xd4270e))[_0x7e02('0x41')](handleError(_0x216e7c,null));};exports[_0x7e02('0x42')]=function(_0x4cd2ba,_0x15bbcb){var _0x46b32a={'raw':![],'where':{'id':_0x4cd2ba[_0x7e02('0x43')]['id']}},_0x2bbd20={};_0x2bbd20[_0x7e02('0x2c')]=_[_0x7e02('0x29')](db[_0x7e02('0x26')][_0x7e02('0x27')]);_0x2bbd20[_0x7e02('0x28')]=_[_0x7e02('0x29')](_0x4cd2ba['query']);_0x2bbd20[_0x7e02('0x2a')]=_[_0x7e02('0x2b')](_0x2bbd20[_0x7e02('0x2c')],_0x2bbd20[_0x7e02('0x28')]);_0x46b32a[_0x7e02('0x2e')]=_[_0x7e02('0x2b')](_0x2bbd20['model'],qs[_0x7e02('0x2d')](_0x4cd2ba['query'][_0x7e02('0x2d')]));_0x46b32a[_0x7e02('0x2e')]=_0x46b32a[_0x7e02('0x2e')][_0x7e02('0x2f')]?_0x46b32a[_0x7e02('0x2e')]:_0x2bbd20[_0x7e02('0x2c')];if(_0x4cd2ba['query'][_0x7e02('0x3d')]){_0x46b32a[_0x7e02('0x3e')]=[{'all':!![]}];}_0x46b32a=_[_0x7e02('0x36')]({},_0x46b32a,_0x4cd2ba[_0x7e02('0x3a')]);return db[_0x7e02('0x26')][_0x7e02('0x44')](_0x46b32a)['then'](handleEntityNotFound(_0x15bbcb,null))[_0x7e02('0x3c')](respondWithResult(_0x15bbcb,null))[_0x7e02('0x41')](handleError(_0x15bbcb,null));};exports[_0x7e02('0x45')]=function(_0x138a81,_0x267acb){return db['IntegrationReport'][_0x7e02('0x45')](_0x138a81[_0x7e02('0x46')],{})[_0x7e02('0x3c')](respondWithResult(_0x267acb,0xc9))['catch'](handleError(_0x267acb,null));};exports[_0x7e02('0x20')]=function(_0x7b2829,_0x3700c9){if(_0x7b2829['body']['id']){delete _0x7b2829['body']['id'];}return db[_0x7e02('0x26')][_0x7e02('0x44')]({'where':{'id':_0x7b2829[_0x7e02('0x43')]['id']}})[_0x7e02('0x3c')](handleEntityNotFound(_0x3700c9,null))[_0x7e02('0x3c')](saveUpdates(_0x7b2829['body'],null))['then'](respondWithResult(_0x3700c9,null))['catch'](handleError(_0x3700c9,null));};exports[_0x7e02('0x21')]=function(_0x107445,_0x452303){return db[_0x7e02('0x26')][_0x7e02('0x44')]({'where':{'id':_0x107445['params']['id']}})[_0x7e02('0x3c')](handleEntityNotFound(_0x452303,null))[_0x7e02('0x3c')](removeEntity(_0x452303,null))[_0x7e02('0x41')](handleError(_0x452303,null));};exports[_0x7e02('0x47')]=function(_0x26eadb,_0xa76dd7){return db['IntegrationReport'][_0x7e02('0x47')]()[_0x7e02('0x3c')](respondWithResult(_0xa76dd7,null))[_0x7e02('0x41')](handleError(_0xa76dd7,null));};
\ No newline at end of file
+var _0x22a4=['filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','field','includeAll','include','rows','catch','show','params','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','index','IntegrationReport','rawAttributes','keys','query'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x22a4,0x1cb));var _0x422a=function(_0x204cff,_0x53712d){_0x204cff=_0x204cff-0x0;var _0xdcaf67=_0x22a4[_0x204cff];return _0xdcaf67;};'use strict';var pdf=require(_0x422a('0x0'));var emlformat=require(_0x422a('0x1'));var rimraf=require(_0x422a('0x2'));var zipdir=require(_0x422a('0x3'));var jsonpatch=require(_0x422a('0x4'));var rp=require(_0x422a('0x5'));var moment=require(_0x422a('0x6'));var BPromise=require(_0x422a('0x7'));var Mustache=require('mustache');var util=require(_0x422a('0x8'));var path=require(_0x422a('0x9'));var sox=require(_0x422a('0xa'));var csv=require(_0x422a('0xb'));var ejs=require(_0x422a('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x422a('0xd'));var crypto=require(_0x422a('0xe'));var jsforce=require(_0x422a('0xf'));var deskjs=require(_0x422a('0x10'));var toCsv=require(_0x422a('0xb'));var querystring=require(_0x422a('0x11'));var Papa=require(_0x422a('0x12'));var Redis=require(_0x422a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x422a('0x14'));var logger=require(_0x422a('0x15'))(_0x422a('0x16'));var utils=require(_0x422a('0x17'));var config=require(_0x422a('0x18'));var db=require(_0x422a('0x19'))['db'];function respondWithStatusCode(_0x48c0a2,_0x489953){_0x489953=_0x489953||0xcc;return function(_0xebe70d){if(_0xebe70d){return _0x48c0a2['sendStatus'](_0x489953);}return _0x48c0a2['status'](_0x489953)['end']();};}function respondWithResult(_0x30f24c,_0xe43bbf){_0xe43bbf=_0xe43bbf||0xc8;return function(_0x11af1f){if(_0x11af1f){return _0x30f24c[_0x422a('0x1a')](_0xe43bbf)[_0x422a('0x1b')](_0x11af1f);}};}function respondWithFilteredResult(_0x428752,_0x3bfb41){return function(_0x3504bb){if(_0x3504bb){var _0xf9fcf7=_0x3504bb[_0x422a('0x1c')],_0x2ba53b=_0x3bfb41[_0x422a('0x1d')],_0x30b6e9=_0x3bfb41[_0x422a('0x1d')]+_0x3bfb41[_0x422a('0x1e')],_0x441fa8;if(_0x30b6e9>=_0xf9fcf7){_0x30b6e9=_0xf9fcf7;_0x441fa8=0xc8;}else{_0x441fa8=0xce;}_0x428752[_0x422a('0x1a')](_0x441fa8);return _0x428752['set'](_0x422a('0x1f'),_0x2ba53b+'-'+_0x30b6e9+'/'+_0xf9fcf7)[_0x422a('0x1b')](_0x3504bb);}return null;};}function patchUpdates(_0x5b29fc){return function(_0x26bce9){try{jsonpatch['apply'](_0x26bce9,_0x5b29fc,!![]);}catch(_0x552048){return BPromise[_0x422a('0x20')](_0x552048);}return _0x26bce9[_0x422a('0x21')]();};}function saveUpdates(_0x12d913,_0x1b69ca){return function(_0x194c25){if(_0x194c25){return _0x194c25[_0x422a('0x22')](_0x12d913)[_0x422a('0x23')](function(_0x26922a){return _0x26922a;});}return null;};}function removeEntity(_0x55e0c8,_0x143a20){return function(_0x3284ed){if(_0x3284ed){return _0x3284ed[_0x422a('0x24')]()[_0x422a('0x23')](function(){_0x55e0c8[_0x422a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x837c81,_0x33bc88){return function(_0x6e209d){if(!_0x6e209d){_0x837c81['sendStatus'](0x194);}return _0x6e209d;};}function handleError(_0x14f06b,_0x17b3da){_0x17b3da=_0x17b3da||0x1f4;return function(_0x1fd126){logger[_0x422a('0x25')](_0x1fd126[_0x422a('0x26')]);if(_0x1fd126[_0x422a('0x27')]){delete _0x1fd126[_0x422a('0x27')];}_0x14f06b[_0x422a('0x1a')](_0x17b3da)['send'](_0x1fd126);};}exports[_0x422a('0x28')]=function(_0x15d2ab,_0x572924){var _0x83cb4d={},_0x49d75f={},_0x1b88ae={'count':0x0,'rows':[]};var _0xad42b4=db[_0x422a('0x29')][_0x422a('0x2a')];_0x49d75f['model']=_[_0x422a('0x2b')](_0xad42b4);_0x49d75f[_0x422a('0x2c')]=_['keys'](_0x15d2ab['query']);_0x49d75f[_0x422a('0x2d')]=_[_0x422a('0x2e')](_0x49d75f['model'],_0x49d75f['query']);_0x83cb4d['attributes']=_['intersection'](_0x49d75f['model'],qs[_0x422a('0x2f')](_0x15d2ab[_0x422a('0x2c')][_0x422a('0x2f')]));_0x83cb4d[_0x422a('0x30')]=_0x83cb4d[_0x422a('0x30')]['length']?_0x83cb4d[_0x422a('0x30')]:_0x49d75f[_0x422a('0x31')];if(!_0x15d2ab[_0x422a('0x2c')][_0x422a('0x32')](_0x422a('0x33'))){_0x83cb4d[_0x422a('0x1e')]=qs[_0x422a('0x1e')](_0x15d2ab['query'][_0x422a('0x1e')]);_0x83cb4d[_0x422a('0x1d')]=qs[_0x422a('0x1d')](_0x15d2ab[_0x422a('0x2c')]['offset']);}_0x83cb4d[_0x422a('0x34')]=qs['sort'](_0x15d2ab[_0x422a('0x2c')][_0x422a('0x35')]);_0x83cb4d['where']=qs[_0x422a('0x2d')](_[_0x422a('0x36')](_0x15d2ab['query'],_0x49d75f[_0x422a('0x2d')]));if(_0x15d2ab[_0x422a('0x2c')][_0x422a('0x37')]){_0x83cb4d[_0x422a('0x38')]=_[_0x422a('0x39')](_0x83cb4d[_0x422a('0x38')],{'$or':_[_0x422a('0x3a')](_0xad42b4,function(_0xda9b95){if(_0xda9b95['type']['key']!==_0x422a('0x3b')){var _0xb1b1d8={};_0xb1b1d8[_0xda9b95[_0x422a('0x3c')]]={'$like':'%'+_0x15d2ab['query'][_0x422a('0x37')]+'%'};return _0xb1b1d8;}})});}_0x83cb4d=_[_0x422a('0x39')]({},_0x83cb4d,_0x15d2ab['options']);var _0x5e145b={'where':_0x83cb4d[_0x422a('0x38')]};return db['IntegrationReport'][_0x422a('0x1c')](_0x5e145b)[_0x422a('0x23')](function(_0x4d8328){_0x1b88ae['count']=_0x4d8328;if(_0x15d2ab[_0x422a('0x2c')][_0x422a('0x3d')]){_0x83cb4d[_0x422a('0x3e')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x83cb4d);})[_0x422a('0x23')](function(_0x424716){_0x1b88ae[_0x422a('0x3f')]=_0x424716;return _0x1b88ae;})['then'](respondWithFilteredResult(_0x572924,_0x83cb4d))[_0x422a('0x40')](handleError(_0x572924,null));};exports[_0x422a('0x41')]=function(_0x254f3f,_0x4388b6){var _0x27eab4={'raw':![],'where':{'id':_0x254f3f[_0x422a('0x42')]['id']}},_0x590c9b={};_0x590c9b[_0x422a('0x31')]=_[_0x422a('0x2b')](db[_0x422a('0x29')][_0x422a('0x2a')]);_0x590c9b['query']=_['keys'](_0x254f3f[_0x422a('0x2c')]);_0x590c9b['filters']=_[_0x422a('0x2e')](_0x590c9b[_0x422a('0x31')],_0x590c9b[_0x422a('0x2c')]);_0x27eab4[_0x422a('0x30')]=_[_0x422a('0x2e')](_0x590c9b[_0x422a('0x31')],qs[_0x422a('0x2f')](_0x254f3f['query'][_0x422a('0x2f')]));_0x27eab4[_0x422a('0x30')]=_0x27eab4[_0x422a('0x30')][_0x422a('0x43')]?_0x27eab4[_0x422a('0x30')]:_0x590c9b[_0x422a('0x31')];if(_0x254f3f[_0x422a('0x2c')]['includeAll']){_0x27eab4[_0x422a('0x3e')]=[{'all':!![]}];}_0x27eab4=_[_0x422a('0x39')]({},_0x27eab4,_0x254f3f['options']);return db[_0x422a('0x29')][_0x422a('0x44')](_0x27eab4)[_0x422a('0x23')](handleEntityNotFound(_0x4388b6,null))[_0x422a('0x23')](respondWithResult(_0x4388b6,null))[_0x422a('0x40')](handleError(_0x4388b6,null));};exports[_0x422a('0x45')]=function(_0x243989,_0x4c1d26){return db[_0x422a('0x29')][_0x422a('0x45')](_0x243989[_0x422a('0x46')],{})[_0x422a('0x23')](respondWithResult(_0x4c1d26,0xc9))[_0x422a('0x40')](handleError(_0x4c1d26,null));};exports[_0x422a('0x22')]=function(_0x21bf08,_0x2292d7){if(_0x21bf08[_0x422a('0x46')]['id']){delete _0x21bf08[_0x422a('0x46')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x21bf08[_0x422a('0x42')]['id']}})[_0x422a('0x23')](handleEntityNotFound(_0x2292d7,null))['then'](saveUpdates(_0x21bf08[_0x422a('0x46')],null))[_0x422a('0x23')](respondWithResult(_0x2292d7,null))[_0x422a('0x40')](handleError(_0x2292d7,null));};exports[_0x422a('0x24')]=function(_0x706497,_0x792783){return db[_0x422a('0x29')][_0x422a('0x44')]({'where':{'id':_0x706497[_0x422a('0x42')]['id']}})[_0x422a('0x23')](handleEntityNotFound(_0x792783,null))['then'](removeEntity(_0x792783,null))['catch'](handleError(_0x792783,null));};exports[_0x422a('0x47')]=function(_0x1f5066,_0x553ab8){return db[_0x422a('0x29')][_0x422a('0x47')]()[_0x422a('0x23')](respondWithResult(_0x553ab8,null))[_0x422a('0x40')](handleError(_0x553ab8,null));};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js
index 306a862..d4e2194 100644
--- a/server/api/integrationReport/integrationReport.model.js
+++ b/server/api/integrationReport/integrationReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x950a=['../../config/logger','api','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','define','lodash','util'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x950a,0x111));var _0xa950=function(_0x4b4888,_0x497b2a){_0x4b4888=_0x4b4888-0x0;var _0x468eb2=_0x950a[_0x4b4888];return _0x468eb2;};'use strict';var _=require(_0xa950('0x0'));var util=require(_0xa950('0x1'));var logger=require(_0xa950('0x2'))(_0xa950('0x3'));var moment=require('moment');var BPromise=require(_0xa950('0x4'));var rp=require(_0xa950('0x5'));var fs=require('fs');var path=require(_0xa950('0x6'));var rimraf=require(_0xa950('0x7'));var config=require('../../config/environment');var attributes=require(_0xa950('0x8'));module[_0xa950('0x9')]=function(_0x512c0e,_0x14b4ac){return _0x512c0e[_0xa950('0xa')]('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8098=['define','report_integration','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0x8098,0x1ba));var _0x8809=function(_0x27102e,_0x979ba0){_0x27102e=_0x27102e-0x0;var _0x50ce28=_0x8098[_0x27102e];return _0x50ce28;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8809('0x0'))(_0x8809('0x1'));var moment=require(_0x8809('0x2'));var BPromise=require(_0x8809('0x3'));var rp=require(_0x8809('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8809('0x5'));var config=require(_0x8809('0x6'));var attributes=require(_0x8809('0x7'));module[_0x8809('0x8')]=function(_0x5804f0,_0xeb811){return _0x5804f0[_0x8809('0x9')]('IntegrationReport',attributes,{'tableName':_0x8809('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js
index 450e3e8..c1df196 100644
--- a/server/api/integrationReport/integrationReport.rpc.js
+++ b/server/api/integrationReport/integrationReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad94=['catch','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x50993c,_0x186d2a){var _0x143663=function(_0x1a150a){while(--_0x1a150a){_0x50993c['push'](_0x50993c['shift']());}};_0x143663(++_0x186d2a);}(_0xad94,0x99));var _0x4ad9=function(_0x31fe11,_0x38ff4a){_0x31fe11=_0x31fe11-0x0;var _0xd96502=_0xad94[_0x31fe11];return _0xd96502;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4ad9('0x0'));var BPromise=require('bluebird');var rs=require(_0x4ad9('0x1'));var fs=require('fs');var Redis=require(_0x4ad9('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ad9('0x3'))('rpc');var config=require(_0x4ad9('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4ad9('0x5')][_0x4ad9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xb6e8cb,_0x3cd626,_0x1f1d52){return new BPromise(function(_0xac2d13,_0x516496){return client[_0x4ad9('0x7')](_0xb6e8cb,_0x1f1d52)[_0x4ad9('0x8')](function(_0xb308b0){logger[_0x4ad9('0x9')](_0x4ad9('0xa'),_0x3cd626,'request\x20sent');logger[_0x4ad9('0xb')](_0x4ad9('0xc'),_0x3cd626,_0x4ad9('0xd'),JSON['stringify'](_0xb308b0));if(_0xb308b0[_0x4ad9('0xe')]){if(_0xb308b0[_0x4ad9('0xe')][_0x4ad9('0xf')]===0x1f4){logger[_0x4ad9('0xe')](_0x4ad9('0xa'),_0x3cd626,_0xb308b0[_0x4ad9('0xe')][_0x4ad9('0x10')]);return _0x516496(_0xb308b0[_0x4ad9('0xe')][_0x4ad9('0x10')]);}logger[_0x4ad9('0xe')](_0x4ad9('0xa'),_0x3cd626,_0xb308b0[_0x4ad9('0xe')]['message']);return _0xac2d13(_0xb308b0[_0x4ad9('0xe')]['message']);}else{logger[_0x4ad9('0x9')]('IntegrationReport,\x20%s,\x20%s',_0x3cd626,_0x4ad9('0xd'));_0xac2d13(_0xb308b0[_0x4ad9('0x11')][_0x4ad9('0x10')]);}})[_0x4ad9('0x12')](function(_0x2b5bbc){logger[_0x4ad9('0xe')](_0x4ad9('0xa'),_0x3cd626,_0x2b5bbc);_0x516496(_0x2b5bbc);});});}
\ No newline at end of file
+var _0xdede=['../../config/environment','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','../../mysqldb','../../config/logger'];(function(_0x80b2c3,_0x23eefe){var _0x19f9c0=function(_0x17df4b){while(--_0x17df4b){_0x80b2c3['push'](_0x80b2c3['shift']());}};_0x19f9c0(++_0x23eefe);}(_0xdede,0xf7));var _0xeded=function(_0x265375,_0x81bb71){_0x265375=_0x265375-0x0;var _0x1cbdb8=_0xdede[_0x265375];return _0x1cbdb8;};'use strict';var _=require(_0xeded('0x0'));var util=require(_0xeded('0x1'));var moment=require(_0xeded('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeded('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xeded('0x4'))('rpc');var config=require(_0xeded('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xeded('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x16a986,_0x57cfe2,_0x1c9ae3){return new BPromise(function(_0x320b0e,_0x5a2a4e){return client[_0xeded('0x7')](_0x16a986,_0x1c9ae3)[_0xeded('0x8')](function(_0x3346c1){logger[_0xeded('0x9')](_0xeded('0xa'),_0x57cfe2,_0xeded('0xb'));logger['debug'](_0xeded('0xc'),_0x57cfe2,_0xeded('0xb'),JSON[_0xeded('0xd')](_0x3346c1));if(_0x3346c1[_0xeded('0xe')]){if(_0x3346c1[_0xeded('0xe')][_0xeded('0xf')]===0x1f4){logger[_0xeded('0xe')](_0xeded('0xa'),_0x57cfe2,_0x3346c1[_0xeded('0xe')]['message']);return _0x5a2a4e(_0x3346c1[_0xeded('0xe')][_0xeded('0x10')]);}logger[_0xeded('0xe')](_0xeded('0xa'),_0x57cfe2,_0x3346c1['error']['message']);return _0x320b0e(_0x3346c1[_0xeded('0xe')][_0xeded('0x10')]);}else{logger[_0xeded('0x9')](_0xeded('0xa'),_0x57cfe2,_0xeded('0xb'));_0x320b0e(_0x3346c1[_0xeded('0x11')]['message']);}})['catch'](function(_0x41bd47){logger[_0xeded('0xe')](_0xeded('0xa'),_0x57cfe2,_0x41bd47);_0x5a2a4e(_0x41bd47);});});}
\ No newline at end of file
diff --git a/server/api/interval/index.js b/server/api/interval/index.js
index 6e5377a..d37a539 100644
--- a/server/api/interval/index.js
+++ b/server/api/interval/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf087=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./interval.controller','index','isAuthenticated','get','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf087,0x101));var _0x7f08=function(_0x294aa0,_0x43ba1a){_0x294aa0=_0x294aa0-0x0;var _0x395eb6=_0xf087[_0x294aa0];return _0x395eb6;};'use strict';var multer=require(_0x7f08('0x0'));var util=require(_0x7f08('0x1'));var path=require(_0x7f08('0x2'));var timeout=require(_0x7f08('0x3'));var express=require(_0x7f08('0x4'));var router=express['Router']();var auth=require(_0x7f08('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7f08('0x6'));var controller=require(_0x7f08('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7f08('0x8')]);router['get']('/:id',auth[_0x7f08('0x9')](),controller['show']);router[_0x7f08('0xa')](_0x7f08('0xb'),auth[_0x7f08('0x9')](),controller[_0x7f08('0xc')]);router['post']('/',auth[_0x7f08('0x9')](),controller[_0x7f08('0xd')]);router[_0x7f08('0xe')](_0x7f08('0xb'),auth[_0x7f08('0x9')](),controller[_0x7f08('0xf')]);router[_0x7f08('0xe')](_0x7f08('0x10'),auth['isAuthenticated'](),controller[_0x7f08('0x11')]);router[_0x7f08('0x12')](_0x7f08('0x13'),auth[_0x7f08('0x9')](),controller['update']);router[_0x7f08('0x14')](_0x7f08('0x13'),auth['isAuthenticated'](),controller[_0x7f08('0x15')]);module[_0x7f08('0x16')]=router;
\ No newline at end of file
+var _0x00e9=['addInterval','addIntervals','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./interval.controller','get','/:id','isAuthenticated','show','getIntervals','post','/:id/sub_intervals'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0x00e9,0x69));var _0x900e=function(_0x1ee276,_0x5d86c4){_0x1ee276=_0x1ee276-0x0;var _0x41d8a6=_0x00e9[_0x1ee276];return _0x41d8a6;};'use strict';var multer=require(_0x900e('0x0'));var util=require('util');var path=require(_0x900e('0x1'));var timeout=require(_0x900e('0x2'));var express=require(_0x900e('0x3'));var router=express[_0x900e('0x4')]();var auth=require(_0x900e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x900e('0x6'));var controller=require(_0x900e('0x7'));router[_0x900e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x900e('0x8')](_0x900e('0x9'),auth[_0x900e('0xa')](),controller[_0x900e('0xb')]);router['get']('/:id/sub_intervals',auth[_0x900e('0xa')](),controller[_0x900e('0xc')]);router[_0x900e('0xd')]('/',auth[_0x900e('0xa')](),controller['create']);router[_0x900e('0xd')](_0x900e('0xe'),auth[_0x900e('0xa')](),controller[_0x900e('0xf')]);router[_0x900e('0xd')]('/:id/sub_intervals/create_many',auth[_0x900e('0xa')](),controller[_0x900e('0x10')]);router['put'](_0x900e('0x9'),auth[_0x900e('0xa')](),controller[_0x900e('0x11')]);router['delete']('/:id',auth[_0x900e('0xa')](),controller[_0x900e('0x12')]);module[_0x900e('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js
index 4532544..a5e1903 100644
--- a/server/api/interval/interval.attributes.js
+++ b/server/api/interval/interval.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc331=['exports','STRING','sequelize'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0xc331,0x18b));var _0x1c33=function(_0x1cbde6,_0x54d935){_0x1cbde6=_0x1cbde6-0x0;var _0xc10400=_0xc331[_0x1cbde6];return _0xc10400;};'use strict';var Sequelize=require(_0x1c33('0x0'));module[_0x1c33('0x1')]={'name':{'type':Sequelize[_0x1c33('0x2')]},'description':{'type':Sequelize[_0x1c33('0x2')]},'interval':{'type':Sequelize[_0x1c33('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xb4da=['sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb4da,0x135));var _0xab4d=function(_0x2498db,_0x23ff93){_0x2498db=_0x2498db-0x0;var _0x5a4c79=_0xb4da[_0x2498db];return _0x5a4c79;};'use strict';var Sequelize=require(_0xab4d('0x0'));module[_0xab4d('0x1')]={'name':{'type':Sequelize[_0xab4d('0x2')]},'description':{'type':Sequelize[_0xab4d('0x2')]},'interval':{'type':Sequelize[_0xab4d('0x2')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js
index 2d1cc04..b2110d7 100644
--- a/server/api/interval/interval.controller.js
+++ b/server/api/interval/interval.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9df=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','Interval','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','filter','options','includeAll','include','findAll','catch','params','rawAttributes','length','find','create','body','user','role','Intervals','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getIntervals','findOne','addIntervals','sequelize','transaction','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','fast-json-patch','moment','path','sox','to-csv','lodash','crypto'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xa9df,0x1ee));var _0xfa9d=function(_0x3c2c97,_0x3f97f5){_0x3c2c97=_0x3c2c97-0x0;var _0x2ec77c=_0xa9df[_0x3c2c97];return _0x2ec77c;};'use strict';var pdf=require(_0xfa9d('0x0'));var emlformat=require(_0xfa9d('0x1'));var rimraf=require(_0xfa9d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa9d('0x3'));var rp=require('request-promise');var moment=require(_0xfa9d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfa9d('0x5'));var sox=require(_0xfa9d('0x6'));var csv=require(_0xfa9d('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfa9d('0x8'));var squel=require('squel');var crypto=require(_0xfa9d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfa9d('0xa'));var toCsv=require(_0xfa9d('0x7'));var querystring=require(_0xfa9d('0xb'));var Papa=require(_0xfa9d('0xc'));var Redis=require(_0xfa9d('0xd'));var authService=require(_0xfa9d('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa9d('0xf'))(_0xfa9d('0x10'));var utils=require(_0xfa9d('0x11'));var config=require(_0xfa9d('0x12'));var db=require(_0xfa9d('0x13'))['db'];var extensions=require(_0xfa9d('0x14'));function respondWithStatusCode(_0x34790b,_0x83bdee){_0x83bdee=_0x83bdee||0xcc;return function(_0xb262ea){if(_0xb262ea){return _0x34790b[_0xfa9d('0x15')](_0x83bdee);}return _0x34790b[_0xfa9d('0x16')](_0x83bdee)['end']();};}function respondWithResult(_0x591ce3,_0x5a437c){_0x5a437c=_0x5a437c||0xc8;return function(_0x131e68){if(_0x131e68){return _0x591ce3[_0xfa9d('0x16')](_0x5a437c)['json'](_0x131e68);}};}function respondWithFilteredResult(_0x11f75e,_0x4ce959){return function(_0x484a8c){if(_0x484a8c){var _0x4d9e47=_0x484a8c[_0xfa9d('0x17')],_0x9b76e9=_0x4ce959['offset'],_0x5daf3e=_0x4ce959[_0xfa9d('0x18')]+_0x4ce959[_0xfa9d('0x19')],_0x4dcac5;if(_0x5daf3e>=_0x4d9e47){_0x5daf3e=_0x4d9e47;_0x4dcac5=0xc8;}else{_0x4dcac5=0xce;}_0x11f75e[_0xfa9d('0x16')](_0x4dcac5);return _0x11f75e[_0xfa9d('0x1a')](_0xfa9d('0x1b'),_0x9b76e9+'-'+_0x5daf3e+'/'+_0x4d9e47)[_0xfa9d('0x1c')](_0x484a8c);}return null;};}function patchUpdates(_0xbb6e1d){return function(_0x3f0e17){try{jsonpatch[_0xfa9d('0x1d')](_0x3f0e17,_0xbb6e1d,!![]);}catch(_0x13e9a6){return BPromise[_0xfa9d('0x1e')](_0x13e9a6);}return _0x3f0e17['save']();};}function saveUpdates(_0x10730b,_0x4ad98f){return function(_0x59498c){if(_0x59498c){return _0x59498c[_0xfa9d('0x1f')](_0x10730b)[_0xfa9d('0x20')](function(_0x2d9b3a){return _0x2d9b3a;});}return null;};}function removeEntity(_0x596e20,_0x326525){return function(_0x49d18d){if(_0x49d18d){return _0x49d18d[_0xfa9d('0x21')]()['then'](function(){var _0x5a42e1=_0x49d18d[_0xfa9d('0x22')]({'plain':!![]});var _0x4316d4='Intervals';return db[_0xfa9d('0x23')][_0xfa9d('0x21')]({'where':{'type':_0x4316d4,'resourceId':_0x5a42e1['id']}})[_0xfa9d('0x20')](function(){return _0x49d18d;});})[_0xfa9d('0x20')](function(){_0x596e20[_0xfa9d('0x16')](0xcc)[_0xfa9d('0x24')]();});}};}function handleEntityNotFound(_0x6e8d9b,_0xbf2a98){return function(_0x4d8086){if(!_0x4d8086){_0x6e8d9b['sendStatus'](0x194);}return _0x4d8086;};}function handleError(_0x47c98b,_0x177be6){_0x177be6=_0x177be6||0x1f4;return function(_0x5c8476){logger[_0xfa9d('0x25')](_0x5c8476[_0xfa9d('0x26')]);if(_0x5c8476['name']){delete _0x5c8476[_0xfa9d('0x27')];}_0x47c98b['status'](_0x177be6)[_0xfa9d('0x28')](_0x5c8476);};}exports[_0xfa9d('0x29')]=function(_0x58bb3c,_0x342f2e){var _0x12bf38={},_0x2483a1={},_0x475549={'count':0x0,'rows':[]};var _0x299745=db[_0xfa9d('0x2a')]['rawAttributes'];_0x2483a1[_0xfa9d('0x2b')]=_[_0xfa9d('0x2c')](_0x299745);_0x2483a1[_0xfa9d('0x2d')]=_[_0xfa9d('0x2c')](_0x58bb3c['query']);_0x2483a1[_0xfa9d('0x2e')]=_[_0xfa9d('0x2f')](_0x2483a1[_0xfa9d('0x2b')],_0x2483a1[_0xfa9d('0x2d')]);_0x12bf38[_0xfa9d('0x30')]=_['intersection'](_0x2483a1['model'],qs[_0xfa9d('0x31')](_0x58bb3c[_0xfa9d('0x2d')][_0xfa9d('0x31')]));_0x12bf38['attributes']=_0x12bf38[_0xfa9d('0x30')]['length']?_0x12bf38[_0xfa9d('0x30')]:_0x2483a1[_0xfa9d('0x2b')];if(!_0x58bb3c[_0xfa9d('0x2d')][_0xfa9d('0x32')](_0xfa9d('0x33'))){_0x12bf38[_0xfa9d('0x19')]=qs[_0xfa9d('0x19')](_0x58bb3c[_0xfa9d('0x2d')][_0xfa9d('0x19')]);_0x12bf38[_0xfa9d('0x18')]=qs[_0xfa9d('0x18')](_0x58bb3c['query'][_0xfa9d('0x18')]);}_0x12bf38[_0xfa9d('0x34')]=qs[_0xfa9d('0x35')](_0x58bb3c[_0xfa9d('0x2d')]['sort']);_0x12bf38[_0xfa9d('0x36')]=qs[_0xfa9d('0x2e')](_[_0xfa9d('0x37')](_0x58bb3c[_0xfa9d('0x2d')],_0x2483a1['filters']));if(_0x58bb3c['query']['filter']){_0x12bf38[_0xfa9d('0x36')]=_[_0xfa9d('0x38')](_0x12bf38[_0xfa9d('0x36')],{'$or':_[_0xfa9d('0x39')](_0x299745,function(_0x48bc18){if(_0x48bc18['type'][_0xfa9d('0x3a')]!=='VIRTUAL'){var _0x339b9a={};_0x339b9a[_0x48bc18['field']]={'$like':'%'+_0x58bb3c[_0xfa9d('0x2d')][_0xfa9d('0x3b')]+'%'};return _0x339b9a;}})});}_0x12bf38=_[_0xfa9d('0x38')]({},_0x12bf38,_0x58bb3c[_0xfa9d('0x3c')]);var _0x2ca29c={'where':_0x12bf38['where']};return db[_0xfa9d('0x2a')]['count'](_0x2ca29c)[_0xfa9d('0x20')](function(_0x47e551){_0x475549[_0xfa9d('0x17')]=_0x47e551;if(_0x58bb3c[_0xfa9d('0x2d')][_0xfa9d('0x3d')]){_0x12bf38[_0xfa9d('0x3e')]=[{'all':!![]}];}return db[_0xfa9d('0x2a')][_0xfa9d('0x3f')](_0x12bf38);})['then'](function(_0x5596d0){_0x475549['rows']=_0x5596d0;return _0x475549;})[_0xfa9d('0x20')](respondWithFilteredResult(_0x342f2e,_0x12bf38))[_0xfa9d('0x40')](handleError(_0x342f2e,null));};exports['show']=function(_0x3dcd85,_0x212fb6){var _0x469ae2={'raw':!![],'where':{'id':_0x3dcd85[_0xfa9d('0x41')]['id']}},_0x2c93e9={};_0x2c93e9['model']=_[_0xfa9d('0x2c')](db[_0xfa9d('0x2a')][_0xfa9d('0x42')]);_0x2c93e9['query']=_[_0xfa9d('0x2c')](_0x3dcd85[_0xfa9d('0x2d')]);_0x2c93e9[_0xfa9d('0x2e')]=_[_0xfa9d('0x2f')](_0x2c93e9[_0xfa9d('0x2b')],_0x2c93e9['query']);_0x469ae2[_0xfa9d('0x30')]=_[_0xfa9d('0x2f')](_0x2c93e9[_0xfa9d('0x2b')],qs[_0xfa9d('0x31')](_0x3dcd85['query'][_0xfa9d('0x31')]));_0x469ae2[_0xfa9d('0x30')]=_0x469ae2[_0xfa9d('0x30')][_0xfa9d('0x43')]?_0x469ae2['attributes']:_0x2c93e9['model'];if(_0x3dcd85[_0xfa9d('0x2d')][_0xfa9d('0x3d')]){_0x469ae2[_0xfa9d('0x3e')]=[{'all':!![]}];}_0x469ae2=_[_0xfa9d('0x38')]({},_0x469ae2,_0x3dcd85['options']);return db[_0xfa9d('0x2a')][_0xfa9d('0x44')](_0x469ae2)[_0xfa9d('0x20')](handleEntityNotFound(_0x212fb6,null))[_0xfa9d('0x20')](respondWithResult(_0x212fb6,null))[_0xfa9d('0x40')](handleError(_0x212fb6,null));};exports[_0xfa9d('0x45')]=function(_0x24009b,_0x2e8877){return db[_0xfa9d('0x2a')][_0xfa9d('0x45')](_0x24009b[_0xfa9d('0x46')],{})[_0xfa9d('0x20')](function(_0x1c4c20){var _0x5c2364=_0x24009b[_0xfa9d('0x47')][_0xfa9d('0x22')]({'plain':!![]});if(!_0x5c2364)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c2364[_0xfa9d('0x48')]==='user'){var _0x586c76=_0x1c4c20[_0xfa9d('0x22')]({'plain':!![]});var _0x587810=_0xfa9d('0x49');return db[_0xfa9d('0x4a')][_0xfa9d('0x44')]({'where':{'name':_0x587810,'userProfileId':_0x5c2364['userProfileId']},'raw':!![]})[_0xfa9d('0x20')](function(_0x1fb118){if(_0x1fb118&&_0x1fb118[_0xfa9d('0x4b')]===0x0){return db[_0xfa9d('0x23')]['create']({'name':_0x586c76[_0xfa9d('0x27')],'resourceId':_0x586c76['id'],'type':_0x1fb118[_0xfa9d('0x27')],'sectionId':_0x1fb118['id']},{})[_0xfa9d('0x20')](function(){return _0x1c4c20;});}else{return _0x1c4c20;}})[_0xfa9d('0x40')](function(_0x48afe8){logger[_0xfa9d('0x25')](_0xfa9d('0x4c'),_0x48afe8);throw _0x48afe8;});}return _0x1c4c20;})[_0xfa9d('0x20')](respondWithResult(_0x2e8877,0xc9))[_0xfa9d('0x40')](handleError(_0x2e8877,null));};exports[_0xfa9d('0x1f')]=function(_0x30af68,_0x5d11ca){if(_0x30af68[_0xfa9d('0x46')]['id']){delete _0x30af68[_0xfa9d('0x46')]['id'];}return db[_0xfa9d('0x2a')][_0xfa9d('0x44')]({'where':{'id':_0x30af68['params']['id']}})['then'](handleEntityNotFound(_0x5d11ca,null))[_0xfa9d('0x20')](saveUpdates(_0x30af68['body'],null))[_0xfa9d('0x20')](respondWithResult(_0x5d11ca,null))[_0xfa9d('0x40')](handleError(_0x5d11ca,null));};exports['destroy']=function(_0x5eaaaf,_0x178aa2){return db[_0xfa9d('0x2a')][_0xfa9d('0x44')]({'where':{'id':_0x5eaaaf[_0xfa9d('0x41')]['id']}})[_0xfa9d('0x20')](handleEntityNotFound(_0x178aa2,null))[_0xfa9d('0x20')](removeEntity(_0x178aa2,null))['catch'](handleError(_0x178aa2,null));};exports['addInterval']=function(_0x16b5bc,_0xfc90e5,_0x134b46){if(_0x16b5bc['body']['id']){delete _0x16b5bc[_0xfa9d('0x46')]['id'];}return db[_0xfa9d('0x2a')][_0xfa9d('0x44')]({'where':{'id':_0x16b5bc[_0xfa9d('0x41')]['id']}})[_0xfa9d('0x20')](handleEntityNotFound(_0xfc90e5,null))[_0xfa9d('0x20')](function(_0x130b2b){if(_0x130b2b){_0x16b5bc[_0xfa9d('0x46')]['IntervalId']=_0x130b2b['id'];return db[_0xfa9d('0x2a')][_0xfa9d('0x45')](_0x16b5bc[_0xfa9d('0x46')]);}})[_0xfa9d('0x20')](respondWithResult(_0xfc90e5,null))[_0xfa9d('0x40')](handleError(_0xfc90e5,null));};exports[_0xfa9d('0x4d')]=function(_0x11a3a5,_0x3e7c84,_0x2ad8db){var _0x3349e3={};var _0x3a9705={};var _0x379b54;var _0x2a1bb9;return db['Interval'][_0xfa9d('0x4e')]({'where':{'id':_0x11a3a5[_0xfa9d('0x41')]['id']}})[_0xfa9d('0x20')](handleEntityNotFound(_0x3e7c84,null))[_0xfa9d('0x20')](function(_0x5bdc58){if(_0x5bdc58){_0x379b54=_0x5bdc58;_0x3a9705['model']=_['keys'](db[_0xfa9d('0x2a')][_0xfa9d('0x42')]);_0x3a9705['query']=_[_0xfa9d('0x2c')](_0x11a3a5[_0xfa9d('0x2d')]);_0x3a9705[_0xfa9d('0x2e')]=_[_0xfa9d('0x2f')](_0x3a9705[_0xfa9d('0x2b')],_0x3a9705[_0xfa9d('0x2d')]);_0x3349e3[_0xfa9d('0x30')]=_['intersection'](_0x3a9705[_0xfa9d('0x2b')],qs[_0xfa9d('0x31')](_0x11a3a5[_0xfa9d('0x2d')][_0xfa9d('0x31')]));_0x3349e3[_0xfa9d('0x30')]=_0x3349e3[_0xfa9d('0x30')][_0xfa9d('0x43')]?_0x3349e3[_0xfa9d('0x30')]:_0x3a9705[_0xfa9d('0x2b')];_0x3349e3['order']=qs[_0xfa9d('0x35')](_0x11a3a5[_0xfa9d('0x2d')]['sort']);_0x3349e3['where']=qs[_0xfa9d('0x2e')](_[_0xfa9d('0x37')](_0x11a3a5[_0xfa9d('0x2d')],_0x3a9705['filters']));if(_0x11a3a5[_0xfa9d('0x2d')][_0xfa9d('0x3b')]){_0x3349e3[_0xfa9d('0x36')]=_[_0xfa9d('0x38')](_0x3349e3[_0xfa9d('0x36')],{'$or':_['map'](_0x3349e3['attributes'],function(_0x26bc78){var _0x3873b7={};_0x3873b7[_0x26bc78]={'$like':'%'+_0x11a3a5[_0xfa9d('0x2d')][_0xfa9d('0x3b')]+'%'};return _0x3873b7;})});}_0x3349e3=_[_0xfa9d('0x38')]({},_0x3349e3,_0x11a3a5[_0xfa9d('0x3c')]);return _0x379b54[_0xfa9d('0x4d')](_0x3349e3);}})[_0xfa9d('0x20')](function(_0x457936){if(_0x457936){_0x2a1bb9=_0x457936['length'];if(!_0x11a3a5[_0xfa9d('0x2d')]['hasOwnProperty'](_0xfa9d('0x33'))){_0x3349e3['limit']=qs[_0xfa9d('0x19')](_0x11a3a5[_0xfa9d('0x2d')][_0xfa9d('0x19')]);_0x3349e3[_0xfa9d('0x18')]=qs[_0xfa9d('0x18')](_0x11a3a5['query']['offset']);}return _0x379b54[_0xfa9d('0x4d')](_0x3349e3);}})['then'](function(_0x1112f0){if(_0x1112f0){return _0x1112f0?{'count':_0x2a1bb9,'rows':_0x1112f0}:null;}})[_0xfa9d('0x20')](respondWithResult(_0x3e7c84,null))[_0xfa9d('0x40')](handleError(_0x3e7c84,null));};exports[_0xfa9d('0x4f')]=function(_0x3f240d,_0x769b2b,_0x25d421){return db['Interval'][_0xfa9d('0x4e')]({'where':{'id':_0x3f240d[_0xfa9d('0x41')]['id']}})[_0xfa9d('0x20')](handleEntityNotFound(_0x769b2b,null))[_0xfa9d('0x20')](function(_0x5cec68){if(_0x5cec68){return db[_0xfa9d('0x50')][_0xfa9d('0x51')](function(_0x2b791e){return db[_0xfa9d('0x2a')][_0xfa9d('0x21')]({'where':{'IntervalId':_0x3f240d[_0xfa9d('0x41')]['id']},'transaction':_0x2b791e})[_0xfa9d('0x20')](function(_0x3eee0f){var _0x4137b2=_[_0xfa9d('0x39')](_0x3f240d[_0xfa9d('0x46')],function(_0x22dd7e){delete _0x22dd7e['id'];_0x22dd7e[_0xfa9d('0x52')]=_0x3f240d[_0xfa9d('0x41')]['id'];return _0x22dd7e;});return db[_0xfa9d('0x2a')][_0xfa9d('0x53')](_0x4137b2,{'transaction':_0x2b791e});});})['then'](function(){return db['Interval'][_0xfa9d('0x3f')]({'where':{'IntervalId':_0x3f240d[_0xfa9d('0x41')]['id']}});});}})[_0xfa9d('0x20')](respondWithResult(_0x769b2b,null))[_0xfa9d('0x40')](handleError(_0x769b2b,null));};
\ No newline at end of file
+var _0x82b5=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addInterval','IntervalId','getIntervals','order','pick','findOne','sequelize','transaction','bulkCreate','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','destroy','then','get','Intervals','UserProfileResource','stack','name','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','merge','map','type','key','VIRTUAL','field','filter','options','Interval','count','includeAll','include','findAll','rows','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error'];(function(_0x4f2fb1,_0x30eb8c){var _0x475fd2=function(_0x5cad26){while(--_0x5cad26){_0x4f2fb1['push'](_0x4f2fb1['shift']());}};_0x475fd2(++_0x30eb8c);}(_0x82b5,0xc0));var _0x582b=function(_0x1081b6,_0x21c7db){_0x1081b6=_0x1081b6-0x0;var _0x2564d0=_0x82b5[_0x1081b6];return _0x2564d0;};'use strict';var pdf=require(_0x582b('0x0'));var emlformat=require(_0x582b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x582b('0x2'));var jsonpatch=require(_0x582b('0x3'));var rp=require(_0x582b('0x4'));var moment=require(_0x582b('0x5'));var BPromise=require(_0x582b('0x6'));var Mustache=require(_0x582b('0x7'));var util=require(_0x582b('0x8'));var path=require(_0x582b('0x9'));var sox=require('sox');var csv=require(_0x582b('0xa'));var ejs=require(_0x582b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x582b('0xc'));var crypto=require(_0x582b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x582b('0xe'));var toCsv=require(_0x582b('0xa'));var querystring=require(_0x582b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x582b('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x582b('0x11'));var logger=require(_0x582b('0x12'))('api');var utils=require(_0x582b('0x13'));var config=require(_0x582b('0x14'));var db=require(_0x582b('0x15'))['db'];var extensions=require(_0x582b('0x16'));function respondWithStatusCode(_0xa0e622,_0x311f17){_0x311f17=_0x311f17||0xcc;return function(_0x2f6259){if(_0x2f6259){return _0xa0e622[_0x582b('0x17')](_0x311f17);}return _0xa0e622[_0x582b('0x18')](_0x311f17)[_0x582b('0x19')]();};}function respondWithResult(_0x1d9167,_0xc9f905){_0xc9f905=_0xc9f905||0xc8;return function(_0x53aa6e){if(_0x53aa6e){return _0x1d9167[_0x582b('0x18')](_0xc9f905)['json'](_0x53aa6e);}};}function respondWithFilteredResult(_0x4b35a6,_0x50554c){return function(_0x3db4ab){if(_0x3db4ab){var _0x2a1268=_0x3db4ab['count'],_0x3f415c=_0x50554c[_0x582b('0x1a')],_0x4cd13a=_0x50554c[_0x582b('0x1a')]+_0x50554c['limit'],_0x578fe3;if(_0x4cd13a>=_0x2a1268){_0x4cd13a=_0x2a1268;_0x578fe3=0xc8;}else{_0x578fe3=0xce;}_0x4b35a6[_0x582b('0x18')](_0x578fe3);return _0x4b35a6[_0x582b('0x1b')](_0x582b('0x1c'),_0x3f415c+'-'+_0x4cd13a+'/'+_0x2a1268)[_0x582b('0x1d')](_0x3db4ab);}return null;};}function patchUpdates(_0x6fbd66){return function(_0x321d28){try{jsonpatch[_0x582b('0x1e')](_0x321d28,_0x6fbd66,!![]);}catch(_0x1c8c76){return BPromise[_0x582b('0x1f')](_0x1c8c76);}return _0x321d28['save']();};}function saveUpdates(_0x2139d8,_0x20ff01){return function(_0x4c1716){if(_0x4c1716){return _0x4c1716['update'](_0x2139d8)['then'](function(_0x195c37){return _0x195c37;});}return null;};}function removeEntity(_0x5b7fe3,_0x426259){return function(_0x479755){if(_0x479755){return _0x479755[_0x582b('0x20')]()[_0x582b('0x21')](function(){var _0xafae54=_0x479755[_0x582b('0x22')]({'plain':!![]});var _0x5134b4=_0x582b('0x23');return db[_0x582b('0x24')][_0x582b('0x20')]({'where':{'type':_0x5134b4,'resourceId':_0xafae54['id']}})[_0x582b('0x21')](function(){return _0x479755;});})[_0x582b('0x21')](function(){_0x5b7fe3[_0x582b('0x18')](0xcc)[_0x582b('0x19')]();});}};}function handleEntityNotFound(_0x38338b,_0x20feca){return function(_0x40d3d0){if(!_0x40d3d0){_0x38338b['sendStatus'](0x194);}return _0x40d3d0;};}function handleError(_0x19003f,_0x33f1d6){_0x33f1d6=_0x33f1d6||0x1f4;return function(_0x52e8a5){logger['error'](_0x52e8a5[_0x582b('0x25')]);if(_0x52e8a5[_0x582b('0x26')]){delete _0x52e8a5[_0x582b('0x26')];}_0x19003f[_0x582b('0x18')](_0x33f1d6)['send'](_0x52e8a5);};}exports[_0x582b('0x27')]=function(_0x8ba90d,_0x4dbb1d){var _0x5b6e08={},_0x3f53b7={},_0x3c94d1={'count':0x0,'rows':[]};var _0x168263=db['Interval'][_0x582b('0x28')];_0x3f53b7[_0x582b('0x29')]=_['keys'](_0x168263);_0x3f53b7[_0x582b('0x2a')]=_[_0x582b('0x2b')](_0x8ba90d['query']);_0x3f53b7[_0x582b('0x2c')]=_[_0x582b('0x2d')](_0x3f53b7['model'],_0x3f53b7[_0x582b('0x2a')]);_0x5b6e08[_0x582b('0x2e')]=_[_0x582b('0x2d')](_0x3f53b7[_0x582b('0x29')],qs[_0x582b('0x2f')](_0x8ba90d[_0x582b('0x2a')][_0x582b('0x2f')]));_0x5b6e08[_0x582b('0x2e')]=_0x5b6e08[_0x582b('0x2e')]['length']?_0x5b6e08[_0x582b('0x2e')]:_0x3f53b7[_0x582b('0x29')];if(!_0x8ba90d['query'][_0x582b('0x30')](_0x582b('0x31'))){_0x5b6e08[_0x582b('0x32')]=qs['limit'](_0x8ba90d['query'][_0x582b('0x32')]);_0x5b6e08[_0x582b('0x1a')]=qs['offset'](_0x8ba90d['query'][_0x582b('0x1a')]);}_0x5b6e08['order']=qs[_0x582b('0x33')](_0x8ba90d[_0x582b('0x2a')][_0x582b('0x33')]);_0x5b6e08[_0x582b('0x34')]=qs[_0x582b('0x2c')](_['pick'](_0x8ba90d['query'],_0x3f53b7[_0x582b('0x2c')]));if(_0x8ba90d[_0x582b('0x2a')]['filter']){_0x5b6e08[_0x582b('0x34')]=_[_0x582b('0x35')](_0x5b6e08[_0x582b('0x34')],{'$or':_[_0x582b('0x36')](_0x168263,function(_0x2e7593){if(_0x2e7593[_0x582b('0x37')][_0x582b('0x38')]!==_0x582b('0x39')){var _0x517423={};_0x517423[_0x2e7593[_0x582b('0x3a')]]={'$like':'%'+_0x8ba90d[_0x582b('0x2a')][_0x582b('0x3b')]+'%'};return _0x517423;}})});}_0x5b6e08=_[_0x582b('0x35')]({},_0x5b6e08,_0x8ba90d[_0x582b('0x3c')]);var _0x54a462={'where':_0x5b6e08[_0x582b('0x34')]};return db[_0x582b('0x3d')]['count'](_0x54a462)[_0x582b('0x21')](function(_0x63c3e2){_0x3c94d1[_0x582b('0x3e')]=_0x63c3e2;if(_0x8ba90d['query'][_0x582b('0x3f')]){_0x5b6e08[_0x582b('0x40')]=[{'all':!![]}];}return db[_0x582b('0x3d')][_0x582b('0x41')](_0x5b6e08);})[_0x582b('0x21')](function(_0x19d85b){_0x3c94d1[_0x582b('0x42')]=_0x19d85b;return _0x3c94d1;})[_0x582b('0x21')](respondWithFilteredResult(_0x4dbb1d,_0x5b6e08))[_0x582b('0x43')](handleError(_0x4dbb1d,null));};exports[_0x582b('0x44')]=function(_0xbf2c56,_0x5bcb9b){var _0x3777f3={'raw':!![],'where':{'id':_0xbf2c56['params']['id']}},_0x564604={};_0x564604[_0x582b('0x29')]=_['keys'](db[_0x582b('0x3d')][_0x582b('0x28')]);_0x564604[_0x582b('0x2a')]=_['keys'](_0xbf2c56[_0x582b('0x2a')]);_0x564604[_0x582b('0x2c')]=_['intersection'](_0x564604[_0x582b('0x29')],_0x564604['query']);_0x3777f3[_0x582b('0x2e')]=_['intersection'](_0x564604[_0x582b('0x29')],qs[_0x582b('0x2f')](_0xbf2c56[_0x582b('0x2a')][_0x582b('0x2f')]));_0x3777f3['attributes']=_0x3777f3['attributes'][_0x582b('0x45')]?_0x3777f3[_0x582b('0x2e')]:_0x564604[_0x582b('0x29')];if(_0xbf2c56['query'][_0x582b('0x3f')]){_0x3777f3[_0x582b('0x40')]=[{'all':!![]}];}_0x3777f3=_[_0x582b('0x35')]({},_0x3777f3,_0xbf2c56[_0x582b('0x3c')]);return db[_0x582b('0x3d')][_0x582b('0x46')](_0x3777f3)[_0x582b('0x21')](handleEntityNotFound(_0x5bcb9b,null))['then'](respondWithResult(_0x5bcb9b,null))[_0x582b('0x43')](handleError(_0x5bcb9b,null));};exports[_0x582b('0x47')]=function(_0x226307,_0x227e22){return db[_0x582b('0x3d')][_0x582b('0x47')](_0x226307[_0x582b('0x48')],{})[_0x582b('0x21')](function(_0x455c49){var _0x472683=_0x226307[_0x582b('0x49')]['get']({'plain':!![]});if(!_0x472683)throw new Error(_0x582b('0x4a'));if(_0x472683[_0x582b('0x4b')]==='user'){var _0x313d65=_0x455c49[_0x582b('0x22')]({'plain':!![]});var _0x499a7c='Intervals';return db['UserProfileSection'][_0x582b('0x46')]({'where':{'name':_0x499a7c,'userProfileId':_0x472683['userProfileId']},'raw':!![]})['then'](function(_0xa4b776){if(_0xa4b776&&_0xa4b776[_0x582b('0x4c')]===0x0){return db[_0x582b('0x24')]['create']({'name':_0x313d65['name'],'resourceId':_0x313d65['id'],'type':_0xa4b776[_0x582b('0x26')],'sectionId':_0xa4b776['id']},{})[_0x582b('0x21')](function(){return _0x455c49;});}else{return _0x455c49;}})[_0x582b('0x43')](function(_0x42a14c){logger[_0x582b('0x4d')](_0x582b('0x4e'),_0x42a14c);throw _0x42a14c;});}return _0x455c49;})[_0x582b('0x21')](respondWithResult(_0x227e22,0xc9))[_0x582b('0x43')](handleError(_0x227e22,null));};exports[_0x582b('0x4f')]=function(_0x5d70d1,_0xa4292f){if(_0x5d70d1[_0x582b('0x48')]['id']){delete _0x5d70d1['body']['id'];}return db[_0x582b('0x3d')]['find']({'where':{'id':_0x5d70d1['params']['id']}})[_0x582b('0x21')](handleEntityNotFound(_0xa4292f,null))[_0x582b('0x21')](saveUpdates(_0x5d70d1[_0x582b('0x48')],null))[_0x582b('0x21')](respondWithResult(_0xa4292f,null))[_0x582b('0x43')](handleError(_0xa4292f,null));};exports[_0x582b('0x20')]=function(_0x5884bb,_0x1f596c){return db['Interval'][_0x582b('0x46')]({'where':{'id':_0x5884bb[_0x582b('0x50')]['id']}})[_0x582b('0x21')](handleEntityNotFound(_0x1f596c,null))[_0x582b('0x21')](removeEntity(_0x1f596c,null))[_0x582b('0x43')](handleError(_0x1f596c,null));};exports[_0x582b('0x51')]=function(_0x23052b,_0xe27a94,_0x597baf){if(_0x23052b[_0x582b('0x48')]['id']){delete _0x23052b[_0x582b('0x48')]['id'];}return db[_0x582b('0x3d')][_0x582b('0x46')]({'where':{'id':_0x23052b['params']['id']}})[_0x582b('0x21')](handleEntityNotFound(_0xe27a94,null))[_0x582b('0x21')](function(_0x38ad0d){if(_0x38ad0d){_0x23052b[_0x582b('0x48')][_0x582b('0x52')]=_0x38ad0d['id'];return db[_0x582b('0x3d')][_0x582b('0x47')](_0x23052b[_0x582b('0x48')]);}})[_0x582b('0x21')](respondWithResult(_0xe27a94,null))[_0x582b('0x43')](handleError(_0xe27a94,null));};exports[_0x582b('0x53')]=function(_0xda9a9e,_0x2e6cbc,_0x469b1e){var _0x4140fc={};var _0x309544={};var _0x1aaa72;var _0x26add3;return db[_0x582b('0x3d')]['findOne']({'where':{'id':_0xda9a9e[_0x582b('0x50')]['id']}})[_0x582b('0x21')](handleEntityNotFound(_0x2e6cbc,null))['then'](function(_0x1089a6){if(_0x1089a6){_0x1aaa72=_0x1089a6;_0x309544[_0x582b('0x29')]=_['keys'](db[_0x582b('0x3d')][_0x582b('0x28')]);_0x309544[_0x582b('0x2a')]=_['keys'](_0xda9a9e['query']);_0x309544['filters']=_[_0x582b('0x2d')](_0x309544[_0x582b('0x29')],_0x309544[_0x582b('0x2a')]);_0x4140fc[_0x582b('0x2e')]=_[_0x582b('0x2d')](_0x309544[_0x582b('0x29')],qs['fields'](_0xda9a9e[_0x582b('0x2a')][_0x582b('0x2f')]));_0x4140fc[_0x582b('0x2e')]=_0x4140fc[_0x582b('0x2e')][_0x582b('0x45')]?_0x4140fc['attributes']:_0x309544[_0x582b('0x29')];_0x4140fc[_0x582b('0x54')]=qs['sort'](_0xda9a9e[_0x582b('0x2a')][_0x582b('0x33')]);_0x4140fc[_0x582b('0x34')]=qs[_0x582b('0x2c')](_[_0x582b('0x55')](_0xda9a9e[_0x582b('0x2a')],_0x309544[_0x582b('0x2c')]));if(_0xda9a9e[_0x582b('0x2a')][_0x582b('0x3b')]){_0x4140fc[_0x582b('0x34')]=_[_0x582b('0x35')](_0x4140fc[_0x582b('0x34')],{'$or':_[_0x582b('0x36')](_0x4140fc['attributes'],function(_0xdaf9b8){var _0x5d16e5={};_0x5d16e5[_0xdaf9b8]={'$like':'%'+_0xda9a9e['query'][_0x582b('0x3b')]+'%'};return _0x5d16e5;})});}_0x4140fc=_[_0x582b('0x35')]({},_0x4140fc,_0xda9a9e[_0x582b('0x3c')]);return _0x1aaa72[_0x582b('0x53')](_0x4140fc);}})[_0x582b('0x21')](function(_0x14f943){if(_0x14f943){_0x26add3=_0x14f943[_0x582b('0x45')];if(!_0xda9a9e[_0x582b('0x2a')][_0x582b('0x30')](_0x582b('0x31'))){_0x4140fc[_0x582b('0x32')]=qs[_0x582b('0x32')](_0xda9a9e[_0x582b('0x2a')][_0x582b('0x32')]);_0x4140fc['offset']=qs[_0x582b('0x1a')](_0xda9a9e[_0x582b('0x2a')][_0x582b('0x1a')]);}return _0x1aaa72[_0x582b('0x53')](_0x4140fc);}})[_0x582b('0x21')](function(_0x524997){if(_0x524997){return _0x524997?{'count':_0x26add3,'rows':_0x524997}:null;}})[_0x582b('0x21')](respondWithResult(_0x2e6cbc,null))[_0x582b('0x43')](handleError(_0x2e6cbc,null));};exports['addIntervals']=function(_0x39410d,_0x1dbe4c,_0x59cd5c){return db[_0x582b('0x3d')][_0x582b('0x56')]({'where':{'id':_0x39410d[_0x582b('0x50')]['id']}})[_0x582b('0x21')](handleEntityNotFound(_0x1dbe4c,null))[_0x582b('0x21')](function(_0x25107e){if(_0x25107e){return db[_0x582b('0x57')][_0x582b('0x58')](function(_0x57d007){return db[_0x582b('0x3d')][_0x582b('0x20')]({'where':{'IntervalId':_0x39410d[_0x582b('0x50')]['id']},'transaction':_0x57d007})[_0x582b('0x21')](function(_0x264b17){var _0x59644a=_['map'](_0x39410d[_0x582b('0x48')],function(_0x1f9afe){delete _0x1f9afe['id'];_0x1f9afe[_0x582b('0x52')]=_0x39410d['params']['id'];return _0x1f9afe;});return db[_0x582b('0x3d')][_0x582b('0x59')](_0x59644a,{'transaction':_0x57d007});});})[_0x582b('0x21')](function(){return db[_0x582b('0x3d')][_0x582b('0x41')]({'where':{'IntervalId':_0x39410d['params']['id']}});});}})[_0x582b('0x21')](respondWithResult(_0x1dbe4c,null))[_0x582b('0x43')](handleError(_0x1dbe4c,null));};
\ No newline at end of file
diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js
index 7add367..a6dbf41 100644
--- a/server/api/interval/interval.model.js
+++ b/server/api/interval/interval.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7ad9=['util','../../config/logger','bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite','lodash'];(function(_0x1b8678,_0x472aa1){var _0x2e3eaf=function(_0x3fcac2){while(--_0x3fcac2){_0x1b8678['push'](_0x1b8678['shift']());}};_0x2e3eaf(++_0x472aa1);}(_0x7ad9,0x17f));var _0x97ad=function(_0x5f8d3c,_0x5eb54a){_0x5f8d3c=_0x5f8d3c-0x0;var _0x4d2bcb=_0x7ad9[_0x5f8d3c];return _0x4d2bcb;};'use strict';var _=require(_0x97ad('0x0'));var util=require(_0x97ad('0x1'));var logger=require(_0x97ad('0x2'))('api');var moment=require('moment');var BPromise=require(_0x97ad('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97ad('0x4'));var config=require(_0x97ad('0x5'));var attributes=require(_0x97ad('0x6'));var extensions=require(_0x97ad('0x7'));module[_0x97ad('0x8')]=function(_0x1fd0d1,_0x2381d8){return _0x1fd0d1['define'](_0x97ad('0x9'),attributes,{'tableName':_0x97ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x41dc05,_0x285e2c){extensions[_0x97ad('0xb')](_0x1fd0d1,_0x41dc05);},'afterBulkCreate':function(_0x4c4e28,_0x34cf69,_0x594cb6){_0x594cb6();extensions[_0x97ad('0xb')](_0x1fd0d1,_0x4c4e28[0x0]);},'afterUpdate':function(_0x1c63ad,_0x2a8cbe){extensions[_0x97ad('0xb')](_0x1fd0d1,_0x1c63ad);},'afterDestroy':function(_0x4a0d25,_0x29ccc8){extensions[_0x97ad('0xb')](_0x1fd0d1,_0x4a0d25);}}});};
\ No newline at end of file
+var _0x47ab=['../../components/extensions/rewrite','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./interval.attributes'];(function(_0x4114dd,_0x2ad862){var _0x26f44c=function(_0xad2246){while(--_0xad2246){_0x4114dd['push'](_0x4114dd['shift']());}};_0x26f44c(++_0x2ad862);}(_0x47ab,0xc9));var _0xb47a=function(_0x4e780d,_0x4aa422){_0x4e780d=_0x4e780d-0x0;var _0x30e51a=_0x47ab[_0x4e780d];return _0x30e51a;};'use strict';var _=require(_0xb47a('0x0'));var util=require(_0xb47a('0x1'));var logger=require(_0xb47a('0x2'))(_0xb47a('0x3'));var moment=require(_0xb47a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb47a('0x5'));var fs=require('fs');var path=require(_0xb47a('0x6'));var rimraf=require(_0xb47a('0x7'));var config=require('../../config/environment');var attributes=require(_0xb47a('0x8'));var extensions=require(_0xb47a('0x9'));module['exports']=function(_0xe8a428,_0x11bc60){return _0xe8a428[_0xb47a('0xa')](_0xb47a('0xb'),attributes,{'tableName':_0xb47a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xd73972,_0x2a7723){extensions[_0xb47a('0xd')](_0xe8a428,_0xd73972);},'afterBulkCreate':function(_0x595b70,_0x47602f,_0x241bdb){_0x241bdb();extensions[_0xb47a('0xd')](_0xe8a428,_0x595b70[0x0]);},'afterUpdate':function(_0x51191e,_0x3f26d3){extensions[_0xb47a('0xd')](_0xe8a428,_0x51191e);},'afterDestroy':function(_0x980ebf,_0x1de896){extensions['rewrite'](_0xe8a428,_0x980ebf);}}});};
\ No newline at end of file
diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js
index 34e059c..5ff1627 100644
--- a/server/api/interval/interval.rpc.js
+++ b/server/api/interval/interval.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b20=['rpc','../../config/environment','jayson/promise','client','http','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','error','code','message','result','GetInterval','Interval','findAll','options','where','attributes','limit','include','map','model','catch','ShowInterval','find','raw','stringify','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x28f1d0,_0x190e2c){var _0x495a23=function(_0x1da2dd){while(--_0x1da2dd){_0x28f1d0['push'](_0x28f1d0['shift']());}};_0x495a23(++_0x190e2c);}(_0x1b20,0x66));var _0x01b2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1b20[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x01b2('0x0'));var moment=require(_0x01b2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01b2('0x2'));var db=require(_0x01b2('0x3'))['db'];var utils=require(_0x01b2('0x4'));var logger=require(_0x01b2('0x5'))(_0x01b2('0x6'));var config=require(_0x01b2('0x7'));var jayson=require(_0x01b2('0x8'));var client=jayson[_0x01b2('0x9')][_0x01b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa64ad1,_0x43d561,_0x323470){return new BPromise(function(_0x508add,_0x132a08){return client['request'](_0xa64ad1,_0x323470)[_0x01b2('0xb')](function(_0x157fb6){logger[_0x01b2('0xc')](_0x01b2('0xd'),_0x43d561,_0x01b2('0xe'));logger[_0x01b2('0xf')](_0x01b2('0x10'),_0x43d561,_0x01b2('0xe'),JSON['stringify'](_0x157fb6));if(_0x157fb6[_0x01b2('0x11')]){if(_0x157fb6['error'][_0x01b2('0x12')]===0x1f4){logger['error'](_0x01b2('0xd'),_0x43d561,_0x157fb6[_0x01b2('0x11')][_0x01b2('0x13')]);return _0x132a08(_0x157fb6[_0x01b2('0x11')]['message']);}logger[_0x01b2('0x11')](_0x01b2('0xd'),_0x43d561,_0x157fb6[_0x01b2('0x11')][_0x01b2('0x13')]);return _0x508add(_0x157fb6[_0x01b2('0x11')]['message']);}else{logger[_0x01b2('0xc')](_0x01b2('0xd'),_0x43d561,_0x01b2('0xe'));_0x508add(_0x157fb6[_0x01b2('0x14')]['message']);}})['catch'](function(_0x2a8458){logger[_0x01b2('0x11')]('Interval,\x20%s,\x20%s',_0x43d561,_0x2a8458);_0x132a08(_0x2a8458);});});}exports[_0x01b2('0x15')]=function(_0x444236){var _0x27a0bc=this;return new Promise(function(_0x5986f5,_0x25c55f){return db[_0x01b2('0x16')][_0x01b2('0x17')]({'raw':_0x444236[_0x01b2('0x18')]?_0x444236[_0x01b2('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x444236[_0x01b2('0x18')]?_0x444236['options'][_0x01b2('0x19')]||null:null,'attributes':_0x444236['options']?_0x444236[_0x01b2('0x18')][_0x01b2('0x1a')]||null:null,'limit':_0x444236[_0x01b2('0x18')]?_0x444236['options'][_0x01b2('0x1b')]||null:null,'include':_0x444236[_0x01b2('0x18')]?_0x444236[_0x01b2('0x18')][_0x01b2('0x1c')]?_[_0x01b2('0x1d')](_0x444236['options'][_0x01b2('0x1c')],function(_0x539db1){return{'model':db[_0x539db1['model']],'as':_0x539db1['as'],'attributes':_0x539db1[_0x01b2('0x1a')],'include':_0x539db1[_0x01b2('0x1c')]?_[_0x01b2('0x1d')](_0x539db1[_0x01b2('0x1c')],function(_0x2e32c1){return{'model':db[_0x2e32c1[_0x01b2('0x1e')]],'as':_0x2e32c1['as'],'attributes':_0x2e32c1['attributes'],'include':_0x2e32c1[_0x01b2('0x1c')]?_[_0x01b2('0x1d')](_0x2e32c1[_0x01b2('0x1c')],function(_0x17274f){return{'model':db[_0x17274f['model']],'as':_0x17274f['as'],'attributes':_0x17274f[_0x01b2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x122925){logger[_0x01b2('0xc')]('GetInterval',_0x444236);logger[_0x01b2('0xf')]('GetInterval',_0x444236,JSON['stringify'](_0x122925));_0x5986f5(_0x122925);})[_0x01b2('0x1f')](function(_0x4363ec){logger['error'](_0x01b2('0x15'),_0x4363ec[_0x01b2('0x13')],_0x444236);_0x25c55f(_0x27a0bc[_0x01b2('0x11')](0x1f4,_0x4363ec[_0x01b2('0x13')]));});});};exports[_0x01b2('0x20')]=function(_0xd7ad6b){var _0xd60b46=this;return new Promise(function(_0x3169f5,_0x27eeb3){return db[_0x01b2('0x16')][_0x01b2('0x21')]({'raw':_0xd7ad6b['options']?_0xd7ad6b[_0x01b2('0x18')][_0x01b2('0x22')]===undefined?!![]:![]:!![],'where':_0xd7ad6b[_0x01b2('0x18')]?_0xd7ad6b[_0x01b2('0x18')][_0x01b2('0x19')]||null:null,'attributes':_0xd7ad6b[_0x01b2('0x18')]?_0xd7ad6b['options']['attributes']||null:null,'include':_0xd7ad6b[_0x01b2('0x18')]?_0xd7ad6b['options']['include']?_[_0x01b2('0x1d')](_0xd7ad6b[_0x01b2('0x18')][_0x01b2('0x1c')],function(_0x3b1307){return{'model':db[_0x3b1307['model']],'as':_0x3b1307['as'],'attributes':_0x3b1307[_0x01b2('0x1a')],'include':_0x3b1307['include']?_[_0x01b2('0x1d')](_0x3b1307['include'],function(_0x5af6ff){return{'model':db[_0x5af6ff['model']],'as':_0x5af6ff['as'],'attributes':_0x5af6ff[_0x01b2('0x1a')],'include':_0x5af6ff[_0x01b2('0x1c')]?_[_0x01b2('0x1d')](_0x5af6ff[_0x01b2('0x1c')],function(_0x4d80d0){return{'model':db[_0x4d80d0[_0x01b2('0x1e')]],'as':_0x4d80d0['as'],'attributes':_0x4d80d0[_0x01b2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xecbce4){logger[_0x01b2('0xc')](_0x01b2('0x20'),_0xd7ad6b);logger[_0x01b2('0xf')](_0x01b2('0x20'),_0xd7ad6b,JSON[_0x01b2('0x23')](_0xecbce4));_0x3169f5(_0xecbce4);})['catch'](function(_0x2fb530){logger[_0x01b2('0x11')]('ShowInterval',_0x2fb530['message'],_0xd7ad6b);_0x27eeb3(_0xd60b46[_0x01b2('0x11')](0x1f4,_0x2fb530[_0x01b2('0x13')]));});});};
\ No newline at end of file
+var _0x8958=['then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetInterval','Interval','findAll','options','where','attributes','limit','include','map','model','ShowInterval','find','util','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x185dba,_0x5b284c){var _0x28e627=function(_0x322303){while(--_0x322303){_0x185dba['push'](_0x185dba['shift']());}};_0x28e627(++_0x5b284c);}(_0x8958,0x93));var _0x8895=function(_0x8889c3,_0x1e3212){_0x8889c3=_0x8889c3-0x0;var _0x427dd2=_0x8958[_0x8889c3];return _0x427dd2;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8895('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x8895('0x2'))(_0x8895('0x3'));var config=require(_0x8895('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8895('0x5')][_0x8895('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x124e1e,_0x40cec6,_0x33013a){return new BPromise(function(_0x51376b,_0xe018b8){return client[_0x8895('0x7')](_0x124e1e,_0x33013a)[_0x8895('0x8')](function(_0x24fe49){logger[_0x8895('0x9')](_0x8895('0xa'),_0x40cec6,_0x8895('0xb'));logger[_0x8895('0xc')](_0x8895('0xd'),_0x40cec6,_0x8895('0xb'),JSON['stringify'](_0x24fe49));if(_0x24fe49[_0x8895('0xe')]){if(_0x24fe49[_0x8895('0xe')][_0x8895('0xf')]===0x1f4){logger[_0x8895('0xe')](_0x8895('0xa'),_0x40cec6,_0x24fe49[_0x8895('0xe')]['message']);return _0xe018b8(_0x24fe49[_0x8895('0xe')][_0x8895('0x10')]);}logger[_0x8895('0xe')]('Interval,\x20%s,\x20%s',_0x40cec6,_0x24fe49['error'][_0x8895('0x10')]);return _0x51376b(_0x24fe49['error'][_0x8895('0x10')]);}else{logger[_0x8895('0x9')](_0x8895('0xa'),_0x40cec6,_0x8895('0xb'));_0x51376b(_0x24fe49[_0x8895('0x11')]['message']);}})[_0x8895('0x12')](function(_0x100fc8){logger[_0x8895('0xe')](_0x8895('0xa'),_0x40cec6,_0x100fc8);_0xe018b8(_0x100fc8);});});}exports[_0x8895('0x13')]=function(_0x1b5c82){var _0x304be6=this;return new Promise(function(_0x26cee0,_0x135c11){return db[_0x8895('0x14')][_0x8895('0x15')]({'raw':_0x1b5c82[_0x8895('0x16')]?_0x1b5c82[_0x8895('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1b5c82['options']?_0x1b5c82['options'][_0x8895('0x17')]||null:null,'attributes':_0x1b5c82[_0x8895('0x16')]?_0x1b5c82[_0x8895('0x16')][_0x8895('0x18')]||null:null,'limit':_0x1b5c82[_0x8895('0x16')]?_0x1b5c82[_0x8895('0x16')][_0x8895('0x19')]||null:null,'include':_0x1b5c82[_0x8895('0x16')]?_0x1b5c82['options'][_0x8895('0x1a')]?_[_0x8895('0x1b')](_0x1b5c82[_0x8895('0x16')][_0x8895('0x1a')],function(_0x29223d){return{'model':db[_0x29223d['model']],'as':_0x29223d['as'],'attributes':_0x29223d['attributes'],'include':_0x29223d[_0x8895('0x1a')]?_[_0x8895('0x1b')](_0x29223d[_0x8895('0x1a')],function(_0x24a376){return{'model':db[_0x24a376['model']],'as':_0x24a376['as'],'attributes':_0x24a376[_0x8895('0x18')],'include':_0x24a376[_0x8895('0x1a')]?_[_0x8895('0x1b')](_0x24a376['include'],function(_0x4aee03){return{'model':db[_0x4aee03[_0x8895('0x1c')]],'as':_0x4aee03['as'],'attributes':_0x4aee03['attributes']};}):[]};}):[]};}):[]:[]})[_0x8895('0x8')](function(_0x3e3b48){logger[_0x8895('0x9')](_0x8895('0x13'),_0x1b5c82);logger[_0x8895('0xc')]('GetInterval',_0x1b5c82,JSON['stringify'](_0x3e3b48));_0x26cee0(_0x3e3b48);})[_0x8895('0x12')](function(_0x37ac3a){logger[_0x8895('0xe')](_0x8895('0x13'),_0x37ac3a[_0x8895('0x10')],_0x1b5c82);_0x135c11(_0x304be6['error'](0x1f4,_0x37ac3a['message']));});});};exports[_0x8895('0x1d')]=function(_0x848a11){var _0x1c16f6=this;return new Promise(function(_0x29f565,_0x1eabb6){return db['Interval'][_0x8895('0x1e')]({'raw':_0x848a11['options']?_0x848a11[_0x8895('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x848a11[_0x8895('0x16')]?_0x848a11[_0x8895('0x16')][_0x8895('0x17')]||null:null,'attributes':_0x848a11[_0x8895('0x16')]?_0x848a11[_0x8895('0x16')]['attributes']||null:null,'include':_0x848a11[_0x8895('0x16')]?_0x848a11[_0x8895('0x16')][_0x8895('0x1a')]?_[_0x8895('0x1b')](_0x848a11[_0x8895('0x16')]['include'],function(_0x2880a6){return{'model':db[_0x2880a6['model']],'as':_0x2880a6['as'],'attributes':_0x2880a6[_0x8895('0x18')],'include':_0x2880a6['include']?_[_0x8895('0x1b')](_0x2880a6[_0x8895('0x1a')],function(_0x20907a){return{'model':db[_0x20907a[_0x8895('0x1c')]],'as':_0x20907a['as'],'attributes':_0x20907a[_0x8895('0x18')],'include':_0x20907a['include']?_[_0x8895('0x1b')](_0x20907a['include'],function(_0x57f58a){return{'model':db[_0x57f58a[_0x8895('0x1c')]],'as':_0x57f58a['as'],'attributes':_0x57f58a[_0x8895('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8895('0x8')](function(_0x25fa39){logger[_0x8895('0x9')]('ShowInterval',_0x848a11);logger[_0x8895('0xc')](_0x8895('0x1d'),_0x848a11,JSON['stringify'](_0x25fa39));_0x29f565(_0x25fa39);})[_0x8895('0x12')](function(_0x54ca09){logger[_0x8895('0xe')](_0x8895('0x1d'),_0x54ca09['message'],_0x848a11);_0x1eabb6(_0x1c16f6[_0x8895('0xe')](0x1f4,_0x54ca09[_0x8895('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/jira/index.js b/server/api/jira/index.js
index df25f85..4c2b92e 100644
--- a/server/api/jira/index.js
+++ b/server/api/jira/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x43bf97,_0x3083d7){var _0x55ee6a=function(_0x4b37ef){while(--_0x4b37ef){_0x43bf97['push'](_0x43bf97['shift']());}};_0x55ee6a(++_0x3083d7);}(_0xdb28,0x106));var _0x8db2=function(_0x472432,_0x412b95){_0x472432=_0x472432-0x0;var _0x4038f8=_0xdb28[_0x472432];return _0x4038f8;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router;
\ No newline at end of file
+var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x210855,_0x2372b8){var _0x4bd882=function(_0x356e8d){while(--_0x356e8d){_0x210855['push'](_0x210855['shift']());}};_0x4bd882(++_0x2372b8);}(_0xadb5,0xad));var _0x5adb=function(_0x27e8d3,_0x1c7e4d){_0x27e8d3=_0x27e8d3-0x0;var _0x3bf64a=_0xadb5[_0x27e8d3];return _0x3bf64a;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js
index f2fb064..daee913 100644
--- a/server/api/jira/jira.controller.js
+++ b/server/api/jira/jira.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['description','stringify','issuetype','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_10102','track.xcallymotion.com','POST','Basic\x20','toString','base64','setEncoding','utf8','data','end','statusCode','json','parse','error','status','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20'];(function(_0x46ecbf,_0x23485d){var _0x476483=function(_0x467b06){while(--_0x467b06){_0x46ecbf['push'](_0x46ecbf['shift']());}};_0x476483(++_0x23485d);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require('bluebird');var https=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var USERNAME=_0x0baf('0x3');var PASSWORD=_0x0baf('0x4');function openIssue(_0x4d2e72,_0x5a3e42){var _0x232cc7={'fields':{'project':{'key':_0x4d2e72[_0x0baf('0x5')]||_0x0baf('0x6')},'summary':(_0x4d2e72[_0x0baf('0x7')]||_0x0baf('0x8'))+_0x0baf('0x9')+_0x4d2e72['ip'],'description':_0x4d2e72[_0x0baf('0xa')]||JSON[_0x0baf('0xb')](_0x4d2e72),'issuetype':{'name':_0x4d2e72[_0x0baf('0xc')]||'Bug'}}};_0x232cc7[_0x0baf('0xd')]['customfield_11500']=_0x4d2e72[_0x0baf('0xe')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0xf')]=_0x4d2e72[_0x0baf('0x10')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x11')]=_0x4d2e72[_0x0baf('0x12')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x13')]=_0x4d2e72[_0x0baf('0x14')];_0x232cc7[_0x0baf('0xd')]['customfield_11504']=_0x4d2e72['reason'];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x15')]=_0x4d2e72['ip'];var _0x5db689={'host':_0x0baf('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x0baf('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x0baf('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x0baf('0x19')](_0x0baf('0x1a'))}};var _0x2bc381=JSON[_0x0baf('0xb')](_0x232cc7);var _0x469599=https['request'](_0x5db689,function(_0x4cd79d){_0x4cd79d[_0x0baf('0x1b')](_0x0baf('0x1c'));var _0x283408='';_0x4cd79d['on'](_0x0baf('0x1d'),function(_0x2cf7da){_0x283408+=_0x2cf7da;});_0x4cd79d['on'](_0x0baf('0x1e'),function(){if(_0x5a3e42){return _0x5a3e42['status'](_0x4cd79d[_0x0baf('0x1f')])[_0x0baf('0x20')](JSON[_0x0baf('0x21')](_0x283408));}});});_0x469599['on'](_0x0baf('0x22'),function(_0x47070d){if(_0x5a3e42){return _0x5a3e42[_0x0baf('0x23')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x0baf('0x24')}]});}});_0x469599[_0x0baf('0x25')](_0x2bc381);_0x469599[_0x0baf('0x1e')]();}exports[_0x0baf('0x26')]=openIssue;exports[_0x0baf('0x27')]=function(_0x3e3e20,_0x210cd8){_0x3e3e20[_0x0baf('0x28')]['ip']=_0x3e3e20[_0x0baf('0x29')][_0x0baf('0x2a')]||_0x3e3e20['connection'][_0x0baf('0x2b')]||_0x3e3e20['socket'][_0x0baf('0x2b')]||_0x3e3e20['connection']['socket'][_0x0baf('0x2b')];return openIssue(_0x3e3e20['body'],_0x210cd8);};
\ No newline at end of file
+var _0xd8b0=['fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','remoteAddress','socket','connection','bluebird','https','3eAmWpBVP0','key','Report','\x20from\x20','description','issuetype','Bug','customfield_11500','email'];(function(_0x336f33,_0x43cc91){var _0x3ea123=function(_0x19b81c){while(--_0x19b81c){_0x336f33['push'](_0x336f33['shift']());}};_0x3ea123(++_0x43cc91);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var https=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var USERNAME='support';var PASSWORD=_0x0d8b('0x2');function openIssue(_0x5b9b89,_0x43bca1){var _0x364286={'fields':{'project':{'key':_0x5b9b89[_0x0d8b('0x3')]||'MOTGUI'},'summary':(_0x5b9b89['summary']||_0x0d8b('0x4'))+_0x0d8b('0x5')+_0x5b9b89['ip'],'description':_0x5b9b89[_0x0d8b('0x6')]||JSON['stringify'](_0x5b9b89),'issuetype':{'name':_0x5b9b89[_0x0d8b('0x7')]||_0x0d8b('0x8')}}};_0x364286['fields'][_0x0d8b('0x9')]=_0x5b9b89[_0x0d8b('0xa')];_0x364286[_0x0d8b('0xb')][_0x0d8b('0xc')]=_0x5b9b89[_0x0d8b('0xd')];_0x364286[_0x0d8b('0xb')][_0x0d8b('0xe')]=_0x5b9b89[_0x0d8b('0xf')];_0x364286['fields'][_0x0d8b('0x10')]=_0x5b9b89['name'];_0x364286[_0x0d8b('0xb')][_0x0d8b('0x11')]=_0x5b9b89[_0x0d8b('0x12')];_0x364286[_0x0d8b('0xb')][_0x0d8b('0x13')]=_0x5b9b89['ip'];var _0x32bb1a={'host':_0x0d8b('0x14'),'port':0x1bb,'path':_0x0d8b('0x15'),'method':_0x0d8b('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x0d8b('0x17'),'Authorization':_0x0d8b('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x0d8b('0x19')](_0x0d8b('0x1a'))}};var _0x2d4e1c=JSON['stringify'](_0x364286);var _0x23eb7b=https[_0x0d8b('0x1b')](_0x32bb1a,function(_0x17f7df){_0x17f7df[_0x0d8b('0x1c')](_0x0d8b('0x1d'));var _0x5cd485='';_0x17f7df['on'](_0x0d8b('0x1e'),function(_0x4586c2){_0x5cd485+=_0x4586c2;});_0x17f7df['on'](_0x0d8b('0x1f'),function(){if(_0x43bca1){return _0x43bca1[_0x0d8b('0x20')](_0x17f7df[_0x0d8b('0x21')])[_0x0d8b('0x22')](JSON[_0x0d8b('0x23')](_0x5cd485));}});});_0x23eb7b['on'](_0x0d8b('0x24'),function(_0x4a15bf){if(_0x43bca1){return _0x43bca1[_0x0d8b('0x20')](0x1f4)[_0x0d8b('0x22')]({'errors':[{'message':_0x0d8b('0x25'),'type':_0x0d8b('0x26')}]});}});_0x23eb7b[_0x0d8b('0x27')](_0x2d4e1c);_0x23eb7b[_0x0d8b('0x1f')]();}exports[_0x0d8b('0x28')]=openIssue;exports[_0x0d8b('0x29')]=function(_0x50ec1e,_0x4f0a1a){_0x50ec1e[_0x0d8b('0x2a')]['ip']=_0x50ec1e['headers']['x-forwarded-for']||_0x50ec1e['connection'][_0x0d8b('0x2b')]||_0x50ec1e[_0x0d8b('0x2c')][_0x0d8b('0x2b')]||_0x50ec1e[_0x0d8b('0x2d')][_0x0d8b('0x2c')][_0x0d8b('0x2b')];return openIssue(_0x50ec1e[_0x0d8b('0x2a')],_0x4f0a1a);};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js
index 20232fe..d8a0d5b 100644
--- a/server/api/jscriptyAnswerReport/index.js
+++ b/server/api/jscriptyAnswerReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x950c=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x17ec0f,_0x5126a3){var _0x3a4191=function(_0x3ed243){while(--_0x3ed243){_0x17ec0f['push'](_0x17ec0f['shift']());}};_0x3a4191(++_0x5126a3);}(_0x950c,0x18e));var _0xc950=function(_0x5e4f92,_0x5ef2d0){_0x5e4f92=_0x5e4f92-0x0;var _0x3bf6ba=_0x950c[_0x5e4f92];return _0x3bf6ba;};'use strict';var multer=require(_0xc950('0x0'));var util=require(_0xc950('0x1'));var path=require(_0xc950('0x2'));var timeout=require(_0xc950('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xc950('0x4'));var interaction=require(_0xc950('0x5'));var config=require(_0xc950('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0xc950('0x7')]('/',auth[_0xc950('0x8')](),controller[_0xc950('0x9')]);router[_0xc950('0x7')](_0xc950('0xa'),auth['isAuthenticated'](),controller[_0xc950('0xb')]);router[_0xc950('0x7')](_0xc950('0xc'),auth[_0xc950('0x8')](),controller[_0xc950('0xd')]);router[_0xc950('0xe')]('/',auth[_0xc950('0x8')](),controller['create']);router[_0xc950('0xf')](_0xc950('0xc'),auth['isAuthenticated'](),controller[_0xc950('0x10')]);router[_0xc950('0x11')](_0xc950('0xc'),auth['isAuthenticated'](),controller[_0xc950('0x12')]);module[_0xc950('0x13')]=router;
\ No newline at end of file
+var _0x782f=['Router','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3103b9,_0x5df4de){var _0x40b18c=function(_0x35b94d){while(--_0x35b94d){_0x3103b9['push'](_0x3103b9['shift']());}};_0x40b18c(++_0x5df4de);}(_0x782f,0x95));var _0xf782=function(_0x18ad10,_0xf1358f){_0x18ad10=_0x18ad10-0x0;var _0x2289ac=_0x782f[_0x18ad10];return _0x2289ac;};'use strict';var multer=require(_0xf782('0x0'));var util=require(_0xf782('0x1'));var path=require(_0xf782('0x2'));var timeout=require(_0xf782('0x3'));var express=require(_0xf782('0x4'));var router=express[_0xf782('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xf782('0x6'));var config=require(_0xf782('0x7'));var controller=require(_0xf782('0x8'));router[_0xf782('0x9')]('/',auth[_0xf782('0xa')](),controller[_0xf782('0xb')]);router['get'](_0xf782('0xc'),auth['isAuthenticated'](),controller[_0xf782('0xd')]);router['get'](_0xf782('0xe'),auth[_0xf782('0xa')](),controller[_0xf782('0xf')]);router[_0xf782('0x10')]('/',auth['isAuthenticated'](),controller[_0xf782('0x11')]);router[_0xf782('0x12')](_0xf782('0xe'),auth[_0xf782('0xa')](),controller['update']);router[_0xf782('0x13')](_0xf782('0xe'),auth[_0xf782('0xa')](),controller[_0xf782('0x14')]);module[_0xf782('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
index 1486f71..959621b 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd73a=['exports','STRING','TEXT','long','sequelize'];(function(_0x71ce36,_0x563612){var _0x6177c0=function(_0x1e46d8){while(--_0x1e46d8){_0x71ce36['push'](_0x71ce36['shift']());}};_0x6177c0(++_0x563612);}(_0xd73a,0x171));var _0xad73=function(_0x492445,_0x1454f9){_0x492445=_0x492445-0x0;var _0x34ca20=_0xd73a[_0x492445];return _0x34ca20;};'use strict';var Sequelize=require(_0xad73('0x0'));module[_0xad73('0x1')]={'question':{'type':Sequelize[_0xad73('0x2')]},'answer':{'type':Sequelize[_0xad73('0x3')](_0xad73('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xad73('0x2')]},'uniqueid':{'type':Sequelize[_0xad73('0x2')]},'calleridname':{'type':Sequelize[_0xad73('0x2')]},'calleridnum':{'type':Sequelize[_0xad73('0x2')]},'questionId':{'type':Sequelize[_0xad73('0x2')]}};
\ No newline at end of file
+var _0xcbe1=['exports','STRING'];(function(_0xedd4df,_0x41956a){var _0x484a90=function(_0x4d1c28){while(--_0x4d1c28){_0xedd4df['push'](_0xedd4df['shift']());}};_0x484a90(++_0x41956a);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x28b3d7,_0x17b41d){_0x28b3d7=_0x28b3d7-0x0;var _0x49619d=_0xcbe1[_0x28b3d7];return _0x49619d;};'use strict';var Sequelize=require('sequelize');module[_0x1cbe('0x0')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize['TEXT']('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x1cbe('0x1')]},'queue':{'type':Sequelize[_0x1cbe('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1cbe('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x1cbe('0x1')]}};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
index 2bc4c42..1fc2cd7 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5c12=['rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','include','findAll','show','keys','includeAll','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','reject','save','update','then','destroy','end','error','stack','name','send','index','JscriptyAnswerReport'];(function(_0x1dd22e,_0x5e9f64){var _0x4ba820=function(_0xb7e887){while(--_0xb7e887){_0x1dd22e['push'](_0x1dd22e['shift']());}};_0x4ba820(++_0x5e9f64);}(_0x5c12,0x188));var _0x25c1=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x5c12[_0x149a9b];return _0x2c2bf6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x25c1('0x0'));var rimraf=require(_0x25c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25c1('0x2'));var rp=require(_0x25c1('0x3'));var moment=require(_0x25c1('0x4'));var BPromise=require(_0x25c1('0x5'));var Mustache=require(_0x25c1('0x6'));var util=require(_0x25c1('0x7'));var path=require(_0x25c1('0x8'));var sox=require('sox');var csv=require(_0x25c1('0x9'));var ejs=require(_0x25c1('0xa'));var fs=require('fs');var _=require(_0x25c1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25c1('0xc'));var deskjs=require(_0x25c1('0xd'));var toCsv=require(_0x25c1('0x9'));var querystring=require(_0x25c1('0xe'));var Papa=require(_0x25c1('0xf'));var Redis=require('ioredis');var authService=require(_0x25c1('0x10'));var qs=require(_0x25c1('0x11'));var hardwareService=require(_0x25c1('0x12'));var logger=require(_0x25c1('0x13'))(_0x25c1('0x14'));var utils=require('../../config/utils');var config=require(_0x25c1('0x15'));var db=require(_0x25c1('0x16'))['db'];function respondWithStatusCode(_0x49fb8e,_0x256ecd){_0x256ecd=_0x256ecd||0xcc;return function(_0x209af5){if(_0x209af5){return _0x49fb8e[_0x25c1('0x17')](_0x256ecd);}return _0x49fb8e[_0x25c1('0x18')](_0x256ecd)['end']();};}function respondWithResult(_0x569ef9,_0x4ef5d7){_0x4ef5d7=_0x4ef5d7||0xc8;return function(_0x54f6f4){if(_0x54f6f4){return _0x569ef9[_0x25c1('0x18')](_0x4ef5d7)[_0x25c1('0x19')](_0x54f6f4);}};}function respondWithFilteredResult(_0x342cd4,_0x6eba15){return function(_0x17a032){if(_0x17a032){var _0x4ea926=_0x17a032['count'],_0x4638f0=_0x6eba15[_0x25c1('0x1a')],_0x55b62d=_0x6eba15[_0x25c1('0x1a')]+_0x6eba15['limit'],_0x5d631e;if(_0x55b62d>=_0x4ea926){_0x55b62d=_0x4ea926;_0x5d631e=0xc8;}else{_0x5d631e=0xce;}_0x342cd4['status'](_0x5d631e);return _0x342cd4[_0x25c1('0x1b')]('Content-Range',_0x4638f0+'-'+_0x55b62d+'/'+_0x4ea926)[_0x25c1('0x19')](_0x17a032);}return null;};}function patchUpdates(_0x23a418){return function(_0x5c3c5d){try{jsonpatch['apply'](_0x5c3c5d,_0x23a418,!![]);}catch(_0x542768){return BPromise[_0x25c1('0x1c')](_0x542768);}return _0x5c3c5d[_0x25c1('0x1d')]();};}function saveUpdates(_0x22a36e,_0x1bf95d){return function(_0x481c12){if(_0x481c12){return _0x481c12[_0x25c1('0x1e')](_0x22a36e)[_0x25c1('0x1f')](function(_0x34454a){return _0x34454a;});}return null;};}function removeEntity(_0x29e637,_0x517a46){return function(_0x4c3259){if(_0x4c3259){return _0x4c3259[_0x25c1('0x20')]()[_0x25c1('0x1f')](function(){_0x29e637[_0x25c1('0x18')](0xcc)[_0x25c1('0x21')]();});}};}function handleEntityNotFound(_0x15cf2f,_0x1a4b89){return function(_0x2ba595){if(!_0x2ba595){_0x15cf2f[_0x25c1('0x17')](0x194);}return _0x2ba595;};}function handleError(_0x14ffd9,_0x261604){_0x261604=_0x261604||0x1f4;return function(_0x2f78dd){logger[_0x25c1('0x22')](_0x2f78dd[_0x25c1('0x23')]);if(_0x2f78dd['name']){delete _0x2f78dd[_0x25c1('0x24')];}_0x14ffd9[_0x25c1('0x18')](_0x261604)[_0x25c1('0x25')](_0x2f78dd);};}exports[_0x25c1('0x26')]=function(_0x21fdb8,_0x326a5f){var _0x5ad776={},_0x17c924={},_0x428ce8={'count':0x0,'rows':[]};var _0x6cb14f=db[_0x25c1('0x27')][_0x25c1('0x28')];_0x17c924[_0x25c1('0x29')]=_['keys'](_0x6cb14f);_0x17c924[_0x25c1('0x2a')]=_['keys'](_0x21fdb8[_0x25c1('0x2a')]);_0x17c924[_0x25c1('0x2b')]=_[_0x25c1('0x2c')](_0x17c924[_0x25c1('0x29')],_0x17c924[_0x25c1('0x2a')]);_0x5ad776[_0x25c1('0x2d')]=_[_0x25c1('0x2c')](_0x17c924[_0x25c1('0x29')],qs[_0x25c1('0x2e')](_0x21fdb8['query'][_0x25c1('0x2e')]));_0x5ad776['attributes']=_0x5ad776['attributes'][_0x25c1('0x2f')]?_0x5ad776[_0x25c1('0x2d')]:_0x17c924['model'];if(!_0x21fdb8[_0x25c1('0x2a')]['hasOwnProperty'](_0x25c1('0x30'))){_0x5ad776['limit']=qs[_0x25c1('0x31')](_0x21fdb8[_0x25c1('0x2a')][_0x25c1('0x31')]);_0x5ad776[_0x25c1('0x1a')]=qs[_0x25c1('0x1a')](_0x21fdb8[_0x25c1('0x2a')][_0x25c1('0x1a')]);}_0x5ad776[_0x25c1('0x32')]=qs['sort'](_0x21fdb8[_0x25c1('0x2a')]['sort']);_0x5ad776[_0x25c1('0x33')]=qs['filters'](_[_0x25c1('0x34')](_0x21fdb8[_0x25c1('0x2a')],_0x17c924[_0x25c1('0x2b')]));if(_0x21fdb8[_0x25c1('0x2a')][_0x25c1('0x35')]){_0x5ad776[_0x25c1('0x33')]=_[_0x25c1('0x36')](_0x5ad776[_0x25c1('0x33')],{'$or':_[_0x25c1('0x37')](_0x6cb14f,function(_0x2d060c){if(_0x2d060c[_0x25c1('0x38')][_0x25c1('0x39')]!==_0x25c1('0x3a')){var _0x1b6e92={};_0x1b6e92[_0x2d060c[_0x25c1('0x3b')]]={'$like':'%'+_0x21fdb8[_0x25c1('0x2a')][_0x25c1('0x35')]+'%'};return _0x1b6e92;}})});}_0x5ad776=_[_0x25c1('0x36')]({},_0x5ad776,_0x21fdb8[_0x25c1('0x3c')]);var _0x357385={'where':_0x5ad776['where']};return db[_0x25c1('0x27')][_0x25c1('0x3d')](_0x357385)['then'](function(_0x32ab98){_0x428ce8['count']=_0x32ab98;if(_0x21fdb8[_0x25c1('0x2a')]['includeAll']){_0x5ad776[_0x25c1('0x3e')]=[{'all':!![]}];}return db[_0x25c1('0x27')][_0x25c1('0x3f')](_0x5ad776);})[_0x25c1('0x1f')](function(_0xbc20a3){_0x428ce8['rows']=_0xbc20a3;return _0x428ce8;})[_0x25c1('0x1f')](respondWithFilteredResult(_0x326a5f,_0x5ad776))['catch'](handleError(_0x326a5f,null));};exports[_0x25c1('0x40')]=function(_0xe83d32,_0x6d588a){var _0x17fc23={'raw':!![],'where':{'id':_0xe83d32['params']['id']}},_0x57c65a={};_0x57c65a['model']=_[_0x25c1('0x41')](db[_0x25c1('0x27')]['rawAttributes']);_0x57c65a[_0x25c1('0x2a')]=_['keys'](_0xe83d32[_0x25c1('0x2a')]);_0x57c65a[_0x25c1('0x2b')]=_[_0x25c1('0x2c')](_0x57c65a['model'],_0x57c65a['query']);_0x17fc23['attributes']=_[_0x25c1('0x2c')](_0x57c65a[_0x25c1('0x29')],qs['fields'](_0xe83d32[_0x25c1('0x2a')][_0x25c1('0x2e')]));_0x17fc23[_0x25c1('0x2d')]=_0x17fc23['attributes']['length']?_0x17fc23['attributes']:_0x57c65a['model'];if(_0xe83d32[_0x25c1('0x2a')][_0x25c1('0x42')]){_0x17fc23['include']=[{'all':!![]}];}_0x17fc23=_[_0x25c1('0x36')]({},_0x17fc23,_0xe83d32[_0x25c1('0x3c')]);return db[_0x25c1('0x27')][_0x25c1('0x43')](_0x17fc23)[_0x25c1('0x1f')](handleEntityNotFound(_0x6d588a,null))[_0x25c1('0x1f')](respondWithResult(_0x6d588a,null))[_0x25c1('0x44')](handleError(_0x6d588a,null));};exports['create']=function(_0x545934,_0x28fc89){return db[_0x25c1('0x27')][_0x25c1('0x45')](_0x545934['body'],{})[_0x25c1('0x1f')](respondWithResult(_0x28fc89,0xc9))[_0x25c1('0x44')](handleError(_0x28fc89,null));};exports[_0x25c1('0x1e')]=function(_0xa009d1,_0x557ca3){if(_0xa009d1[_0x25c1('0x46')]['id']){delete _0xa009d1[_0x25c1('0x46')]['id'];}return db[_0x25c1('0x27')][_0x25c1('0x43')]({'where':{'id':_0xa009d1['params']['id']}})['then'](handleEntityNotFound(_0x557ca3,null))[_0x25c1('0x1f')](saveUpdates(_0xa009d1[_0x25c1('0x46')],null))[_0x25c1('0x1f')](respondWithResult(_0x557ca3,null))[_0x25c1('0x44')](handleError(_0x557ca3,null));};exports['destroy']=function(_0x6eff9e,_0x32943c){return db['JscriptyAnswerReport'][_0x25c1('0x43')]({'where':{'id':_0x6eff9e[_0x25c1('0x47')]['id']}})[_0x25c1('0x1f')](handleEntityNotFound(_0x32943c,null))[_0x25c1('0x1f')](removeEntity(_0x32943c,null))['catch'](handleError(_0x32943c,null));};exports['describe']=function(_0x5034ba,_0x3e8e2c){return db[_0x25c1('0x27')]['describe']()[_0x25c1('0x1f')](respondWithResult(_0x3e8e2c,null))[_0x25c1('0x44')](handleError(_0x3e8e2c,null));};
\ No newline at end of file
+var _0xed1f=['JscriptyAnswerReport','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','count','includeAll','include','findAll','catch','show','params','rawAttributes','length','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','status','offset','set','reject','update','then','end','error','stack','name','index'];(function(_0x46b4f1,_0x4c00b2){var _0x5ccecc=function(_0x1c4e80){while(--_0x1c4e80){_0x46b4f1['push'](_0x46b4f1['shift']());}};_0x5ccecc(++_0x4c00b2);}(_0xed1f,0x6a));var _0xfed1=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xed1f[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0xfed1('0x0'));var emlformat=require(_0xfed1('0x1'));var rimraf=require(_0xfed1('0x2'));var zipdir=require(_0xfed1('0x3'));var jsonpatch=require(_0xfed1('0x4'));var rp=require(_0xfed1('0x5'));var moment=require(_0xfed1('0x6'));var BPromise=require(_0xfed1('0x7'));var Mustache=require(_0xfed1('0x8'));var util=require(_0xfed1('0x9'));var path=require(_0xfed1('0xa'));var sox=require(_0xfed1('0xb'));var csv=require(_0xfed1('0xc'));var ejs=require(_0xfed1('0xd'));var fs=require('fs');var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xc'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfed1('0x15'));var logger=require('../../config/logger')(_0xfed1('0x16'));var utils=require(_0xfed1('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d1891,_0xe84ba6){_0xe84ba6=_0xe84ba6||0xcc;return function(_0x569a6e){if(_0x569a6e){return _0x3d1891[_0xfed1('0x18')](_0xe84ba6);}return _0x3d1891['status'](_0xe84ba6)['end']();};}function respondWithResult(_0x3f6555,_0x397af9){_0x397af9=_0x397af9||0xc8;return function(_0x532537){if(_0x532537){return _0x3f6555[_0xfed1('0x19')](_0x397af9)['json'](_0x532537);}};}function respondWithFilteredResult(_0x4cd9d1,_0xde25db){return function(_0x39aa0c){if(_0x39aa0c){var _0x1fbb7a=_0x39aa0c['count'],_0x123c46=_0xde25db[_0xfed1('0x1a')],_0x582e67=_0xde25db[_0xfed1('0x1a')]+_0xde25db['limit'],_0x1a00f6;if(_0x582e67>=_0x1fbb7a){_0x582e67=_0x1fbb7a;_0x1a00f6=0xc8;}else{_0x1a00f6=0xce;}_0x4cd9d1[_0xfed1('0x19')](_0x1a00f6);return _0x4cd9d1[_0xfed1('0x1b')]('Content-Range',_0x123c46+'-'+_0x582e67+'/'+_0x1fbb7a)['json'](_0x39aa0c);}return null;};}function patchUpdates(_0x586ea6){return function(_0x1e5afb){try{jsonpatch['apply'](_0x1e5afb,_0x586ea6,!![]);}catch(_0x201f18){return BPromise[_0xfed1('0x1c')](_0x201f18);}return _0x1e5afb['save']();};}function saveUpdates(_0x94cb84,_0x65f14b){return function(_0x59ee9d){if(_0x59ee9d){return _0x59ee9d[_0xfed1('0x1d')](_0x94cb84)[_0xfed1('0x1e')](function(_0xff4842){return _0xff4842;});}return null;};}function removeEntity(_0x92b92d,_0x4bac79){return function(_0x203cec){if(_0x203cec){return _0x203cec['destroy']()[_0xfed1('0x1e')](function(){_0x92b92d[_0xfed1('0x19')](0xcc)[_0xfed1('0x1f')]();});}};}function handleEntityNotFound(_0x532ec2,_0x41d22c){return function(_0x594917){if(!_0x594917){_0x532ec2[_0xfed1('0x18')](0x194);}return _0x594917;};}function handleError(_0x2793b7,_0x1b7b22){_0x1b7b22=_0x1b7b22||0x1f4;return function(_0x365bae){logger[_0xfed1('0x20')](_0x365bae[_0xfed1('0x21')]);if(_0x365bae['name']){delete _0x365bae[_0xfed1('0x22')];}_0x2793b7[_0xfed1('0x19')](_0x1b7b22)['send'](_0x365bae);};}exports[_0xfed1('0x23')]=function(_0x2b9dd2,_0x1b871a){var _0x1d62c5={},_0x3b9122={},_0x1761d1={'count':0x0,'rows':[]};var _0x583953=db[_0xfed1('0x24')]['rawAttributes'];_0x3b9122[_0xfed1('0x25')]=_['keys'](_0x583953);_0x3b9122['query']=_[_0xfed1('0x26')](_0x2b9dd2[_0xfed1('0x27')]);_0x3b9122[_0xfed1('0x28')]=_['intersection'](_0x3b9122[_0xfed1('0x25')],_0x3b9122[_0xfed1('0x27')]);_0x1d62c5[_0xfed1('0x29')]=_[_0xfed1('0x2a')](_0x3b9122[_0xfed1('0x25')],qs[_0xfed1('0x2b')](_0x2b9dd2['query'][_0xfed1('0x2b')]));_0x1d62c5[_0xfed1('0x29')]=_0x1d62c5['attributes']['length']?_0x1d62c5[_0xfed1('0x29')]:_0x3b9122[_0xfed1('0x25')];if(!_0x2b9dd2[_0xfed1('0x27')][_0xfed1('0x2c')](_0xfed1('0x2d'))){_0x1d62c5['limit']=qs[_0xfed1('0x2e')](_0x2b9dd2[_0xfed1('0x27')][_0xfed1('0x2e')]);_0x1d62c5[_0xfed1('0x1a')]=qs[_0xfed1('0x1a')](_0x2b9dd2['query'][_0xfed1('0x1a')]);}_0x1d62c5['order']=qs[_0xfed1('0x2f')](_0x2b9dd2[_0xfed1('0x27')][_0xfed1('0x2f')]);_0x1d62c5[_0xfed1('0x30')]=qs[_0xfed1('0x28')](_[_0xfed1('0x31')](_0x2b9dd2[_0xfed1('0x27')],_0x3b9122[_0xfed1('0x28')]));if(_0x2b9dd2['query'][_0xfed1('0x32')]){_0x1d62c5[_0xfed1('0x30')]=_[_0xfed1('0x33')](_0x1d62c5[_0xfed1('0x30')],{'$or':_['map'](_0x583953,function(_0x4b1d7b){if(_0x4b1d7b[_0xfed1('0x34')][_0xfed1('0x35')]!==_0xfed1('0x36')){var _0x1105bd={};_0x1105bd[_0x4b1d7b[_0xfed1('0x37')]]={'$like':'%'+_0x2b9dd2[_0xfed1('0x27')][_0xfed1('0x32')]+'%'};return _0x1105bd;}})});}_0x1d62c5=_[_0xfed1('0x33')]({},_0x1d62c5,_0x2b9dd2['options']);var _0x52c7b8={'where':_0x1d62c5[_0xfed1('0x30')]};return db[_0xfed1('0x24')]['count'](_0x52c7b8)[_0xfed1('0x1e')](function(_0x15339c){_0x1761d1[_0xfed1('0x38')]=_0x15339c;if(_0x2b9dd2[_0xfed1('0x27')][_0xfed1('0x39')]){_0x1d62c5[_0xfed1('0x3a')]=[{'all':!![]}];}return db[_0xfed1('0x24')][_0xfed1('0x3b')](_0x1d62c5);})[_0xfed1('0x1e')](function(_0x5f3e1f){_0x1761d1['rows']=_0x5f3e1f;return _0x1761d1;})['then'](respondWithFilteredResult(_0x1b871a,_0x1d62c5))[_0xfed1('0x3c')](handleError(_0x1b871a,null));};exports[_0xfed1('0x3d')]=function(_0x2f8f08,_0x496a5d){var _0x3454e6={'raw':!![],'where':{'id':_0x2f8f08[_0xfed1('0x3e')]['id']}},_0x4a0b04={};_0x4a0b04[_0xfed1('0x25')]=_[_0xfed1('0x26')](db['JscriptyAnswerReport'][_0xfed1('0x3f')]);_0x4a0b04[_0xfed1('0x27')]=_[_0xfed1('0x26')](_0x2f8f08['query']);_0x4a0b04[_0xfed1('0x28')]=_['intersection'](_0x4a0b04[_0xfed1('0x25')],_0x4a0b04[_0xfed1('0x27')]);_0x3454e6[_0xfed1('0x29')]=_[_0xfed1('0x2a')](_0x4a0b04[_0xfed1('0x25')],qs[_0xfed1('0x2b')](_0x2f8f08[_0xfed1('0x27')][_0xfed1('0x2b')]));_0x3454e6[_0xfed1('0x29')]=_0x3454e6['attributes'][_0xfed1('0x40')]?_0x3454e6[_0xfed1('0x29')]:_0x4a0b04[_0xfed1('0x25')];if(_0x2f8f08['query']['includeAll']){_0x3454e6[_0xfed1('0x3a')]=[{'all':!![]}];}_0x3454e6=_[_0xfed1('0x33')]({},_0x3454e6,_0x2f8f08[_0xfed1('0x41')]);return db[_0xfed1('0x24')][_0xfed1('0x42')](_0x3454e6)[_0xfed1('0x1e')](handleEntityNotFound(_0x496a5d,null))[_0xfed1('0x1e')](respondWithResult(_0x496a5d,null))[_0xfed1('0x3c')](handleError(_0x496a5d,null));};exports[_0xfed1('0x43')]=function(_0x3fd1c8,_0x61f65b){return db[_0xfed1('0x24')]['create'](_0x3fd1c8[_0xfed1('0x44')],{})[_0xfed1('0x1e')](respondWithResult(_0x61f65b,0xc9))[_0xfed1('0x3c')](handleError(_0x61f65b,null));};exports[_0xfed1('0x1d')]=function(_0x2b6267,_0x1e4781){if(_0x2b6267['body']['id']){delete _0x2b6267[_0xfed1('0x44')]['id'];}return db[_0xfed1('0x24')][_0xfed1('0x42')]({'where':{'id':_0x2b6267['params']['id']}})[_0xfed1('0x1e')](handleEntityNotFound(_0x1e4781,null))[_0xfed1('0x1e')](saveUpdates(_0x2b6267[_0xfed1('0x44')],null))[_0xfed1('0x1e')](respondWithResult(_0x1e4781,null))['catch'](handleError(_0x1e4781,null));};exports[_0xfed1('0x45')]=function(_0x2a346e,_0x2c32af){return db[_0xfed1('0x24')][_0xfed1('0x42')]({'where':{'id':_0x2a346e[_0xfed1('0x3e')]['id']}})[_0xfed1('0x1e')](handleEntityNotFound(_0x2c32af,null))[_0xfed1('0x1e')](removeEntity(_0x2c32af,null))[_0xfed1('0x3c')](handleError(_0x2c32af,null));};exports[_0xfed1('0x46')]=function(_0xa0515c,_0xb3a534){return db[_0xfed1('0x24')][_0xfed1('0x46')]()[_0xfed1('0x1e')](respondWithResult(_0xb3a534,null))[_0xfed1('0x3c')](handleError(_0xb3a534,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
index 6cd7287..6b0f283 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d99=['exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x9a74aa,_0x3ae50e){var _0x19cf78=function(_0x3beeea){while(--_0x3beeea){_0x9a74aa['push'](_0x9a74aa['shift']());}};_0x19cf78(++_0x3ae50e);}(_0x6d99,0xd0));var _0x96d9=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x6d99[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var util=require(_0x96d9('0x0'));var logger=require(_0x96d9('0x1'))(_0x96d9('0x2'));var moment=require('moment');var BPromise=require(_0x96d9('0x3'));var rp=require(_0x96d9('0x4'));var fs=require('fs');var path=require(_0x96d9('0x5'));var rimraf=require('rimraf');var config=require(_0x96d9('0x6'));var attributes=require(_0x96d9('0x7'));module[_0x96d9('0x8')]=function(_0x5555ba,_0x1a58c3){return _0x5555ba[_0x96d9('0x9')](_0x96d9('0xa'),attributes,{'tableName':_0x96d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x09d8=['report_jscripty_answers','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport'];(function(_0x45e6ae,_0x29948b){var _0x1c3e57=function(_0x466336){while(--_0x466336){_0x45e6ae['push'](_0x45e6ae['shift']());}};_0x1c3e57(++_0x29948b);}(_0x09d8,0x197));var _0x809d=function(_0x3eb876,_0x23f4ba){_0x3eb876=_0x3eb876-0x0;var _0x462e33=_0x09d8[_0x3eb876];return _0x462e33;};'use strict';var _=require(_0x809d('0x0'));var util=require('util');var logger=require(_0x809d('0x1'))(_0x809d('0x2'));var moment=require(_0x809d('0x3'));var BPromise=require(_0x809d('0x4'));var rp=require(_0x809d('0x5'));var fs=require('fs');var path=require(_0x809d('0x6'));var rimraf=require(_0x809d('0x7'));var config=require(_0x809d('0x8'));var attributes=require(_0x809d('0x9'));module[_0x809d('0xa')]=function(_0x1a6c79,_0x12cba1){return _0x1a6c79[_0x809d('0xb')](_0x809d('0xc'),attributes,{'tableName':_0x809d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
index 4655631..7b9dea7 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe0b7=['then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5e741f,_0x4a60ce){var _0x23f353=function(_0x5f0c24){while(--_0x5f0c24){_0x5e741f['push'](_0x5e741f['shift']());}};_0x23f353(++_0x4a60ce);}(_0xe0b7,0xc4));var _0x7e0b=function(_0x35b6a6,_0x2af2ad){_0x35b6a6=_0x35b6a6-0x0;var _0x19cbc8=_0xe0b7[_0x35b6a6];return _0x19cbc8;};'use strict';var _=require(_0x7e0b('0x0'));var util=require(_0x7e0b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e0b('0x2'));var db=require(_0x7e0b('0x3'))['db'];var utils=require(_0x7e0b('0x4'));var logger=require(_0x7e0b('0x5'))(_0x7e0b('0x6'));var config=require(_0x7e0b('0x7'));var jayson=require(_0x7e0b('0x8'));var client=jayson[_0x7e0b('0x9')][_0x7e0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e0999,_0x932d74,_0x5aa527){return new BPromise(function(_0x4eb43b,_0x5f40ad){return client['request'](_0x5e0999,_0x5aa527)[_0x7e0b('0xb')](function(_0x2d0d12){logger[_0x7e0b('0xc')](_0x7e0b('0xd'),_0x932d74,'request\x20sent');logger[_0x7e0b('0xe')](_0x7e0b('0xf'),_0x932d74,_0x7e0b('0x10'),JSON[_0x7e0b('0x11')](_0x2d0d12));if(_0x2d0d12[_0x7e0b('0x12')]){if(_0x2d0d12['error'][_0x7e0b('0x13')]===0x1f4){logger[_0x7e0b('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x932d74,_0x2d0d12['error'][_0x7e0b('0x14')]);return _0x5f40ad(_0x2d0d12[_0x7e0b('0x12')]['message']);}logger[_0x7e0b('0x12')](_0x7e0b('0xd'),_0x932d74,_0x2d0d12[_0x7e0b('0x12')][_0x7e0b('0x14')]);return _0x4eb43b(_0x2d0d12[_0x7e0b('0x12')]['message']);}else{logger[_0x7e0b('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x932d74,_0x7e0b('0x10'));_0x4eb43b(_0x2d0d12[_0x7e0b('0x15')][_0x7e0b('0x14')]);}})[_0x7e0b('0x16')](function(_0x4a91e0){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x932d74,_0x4a91e0);_0x5f40ad(_0x4a91e0);});});}
\ No newline at end of file
+var _0x0e79=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x0e79,0xac));var _0x90e7=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0x0e79[_0x3a3758];return _0x1a9234;};'use strict';var _=require(_0x90e7('0x0'));var util=require(_0x90e7('0x1'));var moment=require(_0x90e7('0x2'));var BPromise=require(_0x90e7('0x3'));var rs=require(_0x90e7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90e7('0x5'))['db'];var utils=require(_0x90e7('0x6'));var logger=require(_0x90e7('0x7'))(_0x90e7('0x8'));var config=require(_0x90e7('0x9'));var jayson=require(_0x90e7('0xa'));var client=jayson[_0x90e7('0xb')][_0x90e7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57c288,_0x595376,_0x1c2cf7){return new BPromise(function(_0x5e0ebd,_0x8e391c){return client['request'](_0x57c288,_0x1c2cf7)['then'](function(_0x4d4d51){logger['info'](_0x90e7('0xd'),_0x595376,_0x90e7('0xe'));logger[_0x90e7('0xf')](_0x90e7('0x10'),_0x595376,_0x90e7('0xe'),JSON[_0x90e7('0x11')](_0x4d4d51));if(_0x4d4d51[_0x90e7('0x12')]){if(_0x4d4d51[_0x90e7('0x12')][_0x90e7('0x13')]===0x1f4){logger['error'](_0x90e7('0xd'),_0x595376,_0x4d4d51[_0x90e7('0x12')][_0x90e7('0x14')]);return _0x8e391c(_0x4d4d51[_0x90e7('0x12')][_0x90e7('0x14')]);}logger[_0x90e7('0x12')](_0x90e7('0xd'),_0x595376,_0x4d4d51['error'][_0x90e7('0x14')]);return _0x5e0ebd(_0x4d4d51['error']['message']);}else{logger['info'](_0x90e7('0xd'),_0x595376,_0x90e7('0xe'));_0x5e0ebd(_0x4d4d51[_0x90e7('0x15')][_0x90e7('0x14')]);}})['catch'](function(_0x86fd8f){logger[_0x90e7('0x12')](_0x90e7('0xd'),_0x595376,_0x86fd8f);_0x8e391c(_0x86fd8f);});});}
\ No newline at end of file
diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js
index 6f14ccc..c26ea27 100644
--- a/server/api/jscriptyProject/index.js
+++ b/server/api/jscriptyProject/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x79d7=['/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','/:id','show'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x79d7,0x9c));var _0x779d=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x79d7[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0x779d('0x0'));var util=require('util');var path=require(_0x779d('0x1'));var timeout=require(_0x779d('0x2'));var express=require(_0x779d('0x3'));var router=express[_0x779d('0x4')]();var auth=require(_0x779d('0x5'));var interaction=require(_0x779d('0x6'));var config=require('../../config/environment');var controller=require(_0x779d('0x7'));router[_0x779d('0x8')]('/',auth[_0x779d('0x9')](),controller['index']);router['get'](_0x779d('0xa'),auth['isAuthenticated'](),controller[_0x779d('0xb')]);router[_0x779d('0x8')]('/:id/sessions',auth['isAuthenticated'](),controller['getSessions']);router['get'](_0x779d('0xc'),auth[_0x779d('0x9')](),controller[_0x779d('0xd')]);router['get'](_0x779d('0xe'),auth['isAuthenticated'](),timeout(_0x779d('0xf')),controller['getSummary']);router[_0x779d('0x10')]('/',auth[_0x779d('0x9')](),controller[_0x779d('0x11')]);router['post'](_0x779d('0x12'),auth[_0x779d('0x9')](),controller[_0x779d('0x13')]);router[_0x779d('0x14')](_0x779d('0xa'),auth[_0x779d('0x9')](),controller['update']);router[_0x779d('0x15')](_0x779d('0xa'),auth[_0x779d('0x9')](),controller[_0x779d('0x16')]);module[_0x779d('0x17')]=router;
\ No newline at end of file
+var _0xfc5a=['30s','getSummary','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xfc5a,0x169));var _0xafc5=function(_0x3d3379,_0x4c9bc1){_0x3d3379=_0x3d3379-0x0;var _0x358633=_0xfc5a[_0x3d3379];return _0x358633;};'use strict';var multer=require(_0xafc5('0x0'));var util=require(_0xafc5('0x1'));var path=require(_0xafc5('0x2'));var timeout=require(_0xafc5('0x3'));var express=require(_0xafc5('0x4'));var router=express[_0xafc5('0x5')]();var auth=require(_0xafc5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xafc5('0x7'));var controller=require('./jscriptyProject.controller');router[_0xafc5('0x8')]('/',auth['isAuthenticated'](),controller[_0xafc5('0x9')]);router[_0xafc5('0x8')](_0xafc5('0xa'),auth[_0xafc5('0xb')](),controller[_0xafc5('0xc')]);router[_0xafc5('0x8')](_0xafc5('0xd'),auth[_0xafc5('0xb')](),controller[_0xafc5('0xe')]);router[_0xafc5('0x8')](_0xafc5('0xf'),auth[_0xafc5('0xb')](),controller[_0xafc5('0x10')]);router[_0xafc5('0x8')]('/:id/summary',auth[_0xafc5('0xb')](),timeout(_0xafc5('0x11')),controller[_0xafc5('0x12')]);router[_0xafc5('0x13')]('/',auth[_0xafc5('0xb')](),controller['create']);router[_0xafc5('0x13')](_0xafc5('0x14'),auth[_0xafc5('0xb')](),controller[_0xafc5('0x15')]);router[_0xafc5('0x16')](_0xafc5('0xa'),auth[_0xafc5('0xb')](),controller[_0xafc5('0x17')]);router[_0xafc5('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xafc5('0x19')]);module[_0xafc5('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js
index 2f807d6..5f7a956 100644
--- a/server/api/jscriptyProject/jscriptyProject.attributes.js
+++ b/server/api/jscriptyProject/jscriptyProject.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8ac=['BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0xd8ac,0x171));var _0xcd8a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd8ac[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xcd8a('0x0'));var _=require(_0xcd8a('0x1'));var util=require(_0xcd8a('0x2'));module[_0xcd8a('0x3')]={'name':{'type':Sequelize[_0xcd8a('0x4')],'unique':_0xcd8a('0x5')},'description':{'type':Sequelize[_0xcd8a('0x4')]},'formData':{'type':Sequelize[_0xcd8a('0x6')](_0xcd8a('0x7')),'set':function(_0x328c70){if(_[_0xcd8a('0x8')](_0x328c70)){this[_0xcd8a('0x9')]('formData',JSON[_0xcd8a('0xa')](_0x328c70));}else if(_[_0xcd8a('0xb')](_0x328c70)){this[_0xcd8a('0x9')](_0xcd8a('0xc'),_0x328c70);}else{this[_0xcd8a('0x9')]('formData',util['format'](_0xcd8a('0xd'),this[_0xcd8a('0xe')](_0xcd8a('0x5'))||'',this[_0xcd8a('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xcd8a('0xf')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xed04=['setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT','long','isObjectLike'];(function(_0x3769a9,_0x5b032b){var _0x3586b4=function(_0x487a87){while(--_0x487a87){_0x3769a9['push'](_0x3769a9['shift']());}};_0x3586b4(++_0x5b032b);}(_0xed04,0xa2));var _0x4ed0=function(_0x2772f8,_0x33fe90){_0x2772f8=_0x2772f8-0x0;var _0x338018=_0xed04[_0x2772f8];return _0x338018;};'use strict';var Sequelize=require(_0x4ed0('0x0'));var _=require(_0x4ed0('0x1'));var util=require(_0x4ed0('0x2'));module[_0x4ed0('0x3')]={'name':{'type':Sequelize[_0x4ed0('0x4')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x4ed0('0x5')](_0x4ed0('0x6')),'set':function(_0x5c8aa2){if(_[_0x4ed0('0x7')](_0x5c8aa2)){this[_0x4ed0('0x8')](_0x4ed0('0x9'),JSON[_0x4ed0('0xa')](_0x5c8aa2));}else if(_[_0x4ed0('0xb')](_0x5c8aa2)){this[_0x4ed0('0x8')](_0x4ed0('0x9'),_0x5c8aa2);}else{this['setDataValue'](_0x4ed0('0x9'),util[_0x4ed0('0xc')](_0x4ed0('0xd'),this['getDataValue']('name')||'',this[_0x4ed0('0xe')](_0x4ed0('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x4ed0('0x10')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js
index 94e2867..a2a1358 100644
--- a/server/api/jscriptyProject/jscriptyProject.controller.js
+++ b/server/api/jscriptyProject/jscriptyProject.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6ba9=['where','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','show','params','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','role','UserProfileSection','update','getSessions','findOne','JscriptySessionReport','pick','ProjectId','findAll','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','JscriptyProject','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x24a4b1,_0x4f23cb){var _0x476dfb=function(_0x5bf09a){while(--_0x5bf09a){_0x24a4b1['push'](_0x24a4b1['shift']());}};_0x476dfb(++_0x4f23cb);}(_0x6ba9,0x126));var _0x96ba=function(_0x56625d,_0x12e6e9){_0x56625d=_0x56625d-0x0;var _0x3bf11b=_0x6ba9[_0x56625d];return _0x3bf11b;};'use strict';var pdf=require(_0x96ba('0x0'));var emlformat=require(_0x96ba('0x1'));var rimraf=require(_0x96ba('0x2'));var zipdir=require(_0x96ba('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96ba('0x4'));var moment=require(_0x96ba('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96ba('0x6'));var path=require(_0x96ba('0x7'));var sox=require(_0x96ba('0x8'));var csv=require('to-csv');var ejs=require(_0x96ba('0x9'));var fs=require('fs');var _=require(_0x96ba('0xa'));var squel=require(_0x96ba('0xb'));var crypto=require(_0x96ba('0xc'));var jsforce=require(_0x96ba('0xd'));var deskjs=require(_0x96ba('0xe'));var toCsv=require(_0x96ba('0xf'));var querystring=require(_0x96ba('0x10'));var Papa=require(_0x96ba('0x11'));var Redis=require('ioredis');var authService=require(_0x96ba('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x96ba('0x13'));var logger=require(_0x96ba('0x14'))('api');var utils=require(_0x96ba('0x15'));var config=require(_0x96ba('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ce16c,_0x3186ef){_0x3186ef=_0x3186ef||0xcc;return function(_0xb3216d){if(_0xb3216d){return _0x2ce16c[_0x96ba('0x17')](_0x3186ef);}return _0x2ce16c[_0x96ba('0x18')](_0x3186ef)[_0x96ba('0x19')]();};}function respondWithResult(_0x340c8a,_0x211c42){_0x211c42=_0x211c42||0xc8;return function(_0x24cac8){if(_0x24cac8){return _0x340c8a[_0x96ba('0x18')](_0x211c42)[_0x96ba('0x1a')](_0x24cac8);}};}function respondWithFilteredResult(_0x447ac4,_0x5072a7){return function(_0x283cb2){if(_0x283cb2){var _0x5b2b8d=_0x283cb2[_0x96ba('0x1b')],_0x2e8400=_0x5072a7[_0x96ba('0x1c')],_0x4fe918=_0x5072a7[_0x96ba('0x1c')]+_0x5072a7['limit'],_0x5ada5e;if(_0x4fe918>=_0x5b2b8d){_0x4fe918=_0x5b2b8d;_0x5ada5e=0xc8;}else{_0x5ada5e=0xce;}_0x447ac4['status'](_0x5ada5e);return _0x447ac4[_0x96ba('0x1d')](_0x96ba('0x1e'),_0x2e8400+'-'+_0x4fe918+'/'+_0x5b2b8d)[_0x96ba('0x1a')](_0x283cb2);}return null;};}function patchUpdates(_0x17cc8b){return function(_0x3dd9f0){try{jsonpatch[_0x96ba('0x1f')](_0x3dd9f0,_0x17cc8b,!![]);}catch(_0x152521){return BPromise['reject'](_0x152521);}return _0x3dd9f0['save']();};}function saveUpdates(_0x5a8ef2,_0xc4f355){return function(_0x209182){if(_0x209182){return _0x209182['update'](_0x5a8ef2)[_0x96ba('0x20')](function(_0xf0009){return _0xf0009;});}return null;};}function removeEntity(_0x63b309,_0x312220){return function(_0x1499fb){if(_0x1499fb){return _0x1499fb[_0x96ba('0x21')]()[_0x96ba('0x20')](function(){var _0x35ba4d=_0x1499fb[_0x96ba('0x22')]({'plain':!![]});var _0x5c2b64=_0x96ba('0x23');return db[_0x96ba('0x24')][_0x96ba('0x21')]({'where':{'type':_0x5c2b64,'resourceId':_0x35ba4d['id']}})[_0x96ba('0x20')](function(){return _0x1499fb;});})['then'](function(){_0x63b309[_0x96ba('0x18')](0xcc)[_0x96ba('0x19')]();});}};}function handleEntityNotFound(_0x140cae,_0x2dc2a2){return function(_0x1e7efe){if(!_0x1e7efe){_0x140cae[_0x96ba('0x17')](0x194);}return _0x1e7efe;};}function handleError(_0x118c77,_0x5f7c51){_0x5f7c51=_0x5f7c51||0x1f4;return function(_0x4c900a){logger[_0x96ba('0x25')](_0x4c900a[_0x96ba('0x26')]);if(_0x4c900a['name']){delete _0x4c900a[_0x96ba('0x27')];}_0x118c77[_0x96ba('0x18')](_0x5f7c51)[_0x96ba('0x28')](_0x4c900a);};}exports[_0x96ba('0x29')]=function(_0x586820,_0x51aedd){var _0x305afb={},_0x1b2325={},_0x14d3f9={'count':0x0,'rows':[]};var _0xdc69a4=db[_0x96ba('0x2a')][_0x96ba('0x2b')];_0x1b2325[_0x96ba('0x2c')]=_[_0x96ba('0x2d')](_0xdc69a4);_0x1b2325[_0x96ba('0x2e')]=_[_0x96ba('0x2d')](_0x586820[_0x96ba('0x2e')]);_0x1b2325[_0x96ba('0x2f')]=_[_0x96ba('0x30')](_0x1b2325[_0x96ba('0x2c')],_0x1b2325[_0x96ba('0x2e')]);_0x305afb[_0x96ba('0x31')]=_[_0x96ba('0x30')](_0x1b2325['model'],qs['fields'](_0x586820[_0x96ba('0x2e')][_0x96ba('0x32')]));_0x305afb['attributes']=_0x305afb[_0x96ba('0x31')][_0x96ba('0x33')]?_0x305afb[_0x96ba('0x31')]:_0x1b2325[_0x96ba('0x2c')];if(!_0x586820[_0x96ba('0x2e')][_0x96ba('0x34')](_0x96ba('0x35'))){_0x305afb[_0x96ba('0x36')]=qs['limit'](_0x586820[_0x96ba('0x2e')]['limit']);_0x305afb[_0x96ba('0x1c')]=qs[_0x96ba('0x1c')](_0x586820[_0x96ba('0x2e')][_0x96ba('0x1c')]);}_0x305afb[_0x96ba('0x37')]=qs['sort'](_0x586820[_0x96ba('0x2e')][_0x96ba('0x38')]);_0x305afb[_0x96ba('0x39')]=qs['filters'](_['pick'](_0x586820[_0x96ba('0x2e')],_0x1b2325['filters']));if(_0x586820['query'][_0x96ba('0x3a')]){_0x305afb[_0x96ba('0x39')]=_[_0x96ba('0x3b')](_0x305afb[_0x96ba('0x39')],{'$or':_[_0x96ba('0x3c')](_0xdc69a4,function(_0x5bf307){if(_0x5bf307[_0x96ba('0x3d')][_0x96ba('0x3e')]!==_0x96ba('0x3f')){var _0x19d392={};_0x19d392[_0x5bf307[_0x96ba('0x40')]]={'$like':'%'+_0x586820[_0x96ba('0x2e')][_0x96ba('0x3a')]+'%'};return _0x19d392;}})});}_0x305afb=_['merge']({},_0x305afb,_0x586820['options']);var _0x183b7d={'where':_0x305afb[_0x96ba('0x39')]};return db['JscriptyProject']['count'](_0x183b7d)[_0x96ba('0x20')](function(_0x53102a){_0x14d3f9[_0x96ba('0x1b')]=_0x53102a;if(_0x586820['query'][_0x96ba('0x41')]){_0x305afb[_0x96ba('0x42')]=[{'all':!![]}];}return db[_0x96ba('0x2a')]['findAll'](_0x305afb);})[_0x96ba('0x20')](function(_0x9201d4){_0x14d3f9[_0x96ba('0x43')]=_0x9201d4;return _0x14d3f9;})['then'](respondWithFilteredResult(_0x51aedd,_0x305afb))['catch'](handleError(_0x51aedd,null));};exports[_0x96ba('0x44')]=function(_0xce0f82,_0x17fc6a){var _0x1c825d={'raw':![],'where':{'id':_0xce0f82[_0x96ba('0x45')]['id']}},_0x45302a={};_0x45302a[_0x96ba('0x2c')]=_['keys'](db[_0x96ba('0x2a')][_0x96ba('0x2b')]);_0x45302a['query']=_['keys'](_0xce0f82['query']);_0x45302a[_0x96ba('0x2f')]=_[_0x96ba('0x30')](_0x45302a[_0x96ba('0x2c')],_0x45302a[_0x96ba('0x2e')]);_0x1c825d[_0x96ba('0x31')]=_[_0x96ba('0x30')](_0x45302a[_0x96ba('0x2c')],qs[_0x96ba('0x32')](_0xce0f82['query'][_0x96ba('0x32')]));_0x1c825d[_0x96ba('0x31')]=_0x1c825d['attributes'][_0x96ba('0x33')]?_0x1c825d[_0x96ba('0x31')]:_0x45302a[_0x96ba('0x2c')];if(_0xce0f82[_0x96ba('0x2e')][_0x96ba('0x41')]){_0x1c825d[_0x96ba('0x42')]=[{'all':!![]}];}_0x1c825d=_[_0x96ba('0x3b')]({},_0x1c825d,_0xce0f82[_0x96ba('0x46')]);return db[_0x96ba('0x2a')][_0x96ba('0x47')](_0x1c825d)[_0x96ba('0x20')](handleEntityNotFound(_0x17fc6a,null))[_0x96ba('0x20')](respondWithResult(_0x17fc6a,null))[_0x96ba('0x48')](handleError(_0x17fc6a,null));};exports['create']=function(_0x15bb02,_0x11744f){return db[_0x96ba('0x2a')][_0x96ba('0x49')](_0x15bb02['body'],{})['then'](function(_0x236270){var _0x55c47a=_0x15bb02['user'][_0x96ba('0x22')]({'plain':!![]});if(!_0x55c47a)throw new Error(_0x96ba('0x4a'));if(_0x55c47a['role']===_0x96ba('0x4b')){var _0x9df07d=_0x236270[_0x96ba('0x22')]({'plain':!![]});var _0x1b2a6d=_0x96ba('0x23');return db['UserProfileSection'][_0x96ba('0x47')]({'where':{'name':_0x1b2a6d,'userProfileId':_0x55c47a['userProfileId']},'raw':!![]})['then'](function(_0x40c9cc){if(_0x40c9cc&&_0x40c9cc[_0x96ba('0x4c')]===0x0){return db[_0x96ba('0x24')][_0x96ba('0x49')]({'name':_0x9df07d[_0x96ba('0x27')],'resourceId':_0x9df07d['id'],'type':_0x40c9cc[_0x96ba('0x27')],'sectionId':_0x40c9cc['id']},{})[_0x96ba('0x20')](function(){return _0x236270;});}else{return _0x236270;}})[_0x96ba('0x48')](function(_0x1e845e){logger[_0x96ba('0x25')](_0x96ba('0x4d'),_0x1e845e);throw _0x1e845e;});}return _0x236270;})['then'](respondWithResult(_0x11744f,0xc9))[_0x96ba('0x48')](handleError(_0x11744f,null));};exports['clone']=function(_0x4064a9,_0x470191){var _0xcc0256={'raw':![],'where':{'id':_0x4064a9[_0x96ba('0x45')]['id']}},_0xbc852f={};_0xbc852f[_0x96ba('0x2c')]=_[_0x96ba('0x2d')](db['JscriptyProject'][_0x96ba('0x2b')]);_0xcc0256['attributes']=_[_0x96ba('0x30')](_0xbc852f[_0x96ba('0x2c')],qs[_0x96ba('0x32')](_0x4064a9[_0x96ba('0x2e')]['fields']));_0xcc0256['attributes']=_0xcc0256[_0x96ba('0x31')][_0x96ba('0x33')]?_0xcc0256[_0x96ba('0x31')]:_0xbc852f[_0x96ba('0x2c')];if(_0x4064a9['query'][_0x96ba('0x41')]){_0xcc0256[_0x96ba('0x42')]=[{'all':!![]}];}_0xcc0256=_[_0x96ba('0x3b')]({},_0xcc0256,_0x4064a9['options']);return db[_0x96ba('0x2a')][_0x96ba('0x47')](_0xcc0256)['then'](handleEntityNotFound(_0x470191,null))[_0x96ba('0x20')](function(_0x34faf2){if(_0x34faf2){var _0x9d37b=_0x34faf2[_0x96ba('0x22')]({'plain':!![]});_0x9d37b=qs[_0x96ba('0x4e')](_0x9d37b,['id',_0x96ba('0x4f'),_0x96ba('0x50')]);_0x4064a9['body']=_['omit'](_0x4064a9['body'],['id',_0x96ba('0x4f'),_0x96ba('0x50')]);return db[_0x96ba('0x2a')][_0x96ba('0x49')](_['merge'](_0x9d37b,_0x4064a9[_0x96ba('0x51')]),{'include':_0x4064a9[_0x96ba('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0x96ba('0x20')](function(_0x1bf7e9){var _0x2b11a3=_0x4064a9[_0x96ba('0x4b')][_0x96ba('0x22')]({'plain':!![]});if(!_0x2b11a3)throw new Error(_0x96ba('0x4a'));if(_0x2b11a3[_0x96ba('0x52')]===_0x96ba('0x4b')){var _0x1fc54f=_0x1bf7e9[_0x96ba('0x22')]({'plain':!![]});var _0xb8dc8e=_0x96ba('0x23');return db[_0x96ba('0x53')][_0x96ba('0x47')]({'where':{'name':_0xb8dc8e,'userProfileId':_0x2b11a3['userProfileId']},'raw':!![]})[_0x96ba('0x20')](function(_0x4570e3){if(_0x4570e3&&_0x4570e3[_0x96ba('0x4c')]===0x0){return db['UserProfileResource'][_0x96ba('0x49')]({'name':_0x1fc54f[_0x96ba('0x27')],'resourceId':_0x1fc54f['id'],'type':_0x4570e3[_0x96ba('0x27')],'sectionId':_0x4570e3['id']},{})[_0x96ba('0x20')](function(){return _0x1bf7e9;});}else{return _0x1bf7e9;}})[_0x96ba('0x48')](function(_0x137786){logger[_0x96ba('0x25')](_0x96ba('0x4d'),_0x137786);throw _0x137786;});}return _0x1bf7e9;});}})[_0x96ba('0x20')](respondWithResult(_0x470191,0xc9))['catch'](handleError(_0x470191,null));};exports[_0x96ba('0x54')]=function(_0xd7903f,_0xc5ea80){if(_0xd7903f[_0x96ba('0x51')]['id']){delete _0xd7903f[_0x96ba('0x51')]['id'];}return db[_0x96ba('0x2a')][_0x96ba('0x47')]({'where':{'id':_0xd7903f[_0x96ba('0x45')]['id']}})[_0x96ba('0x20')](handleEntityNotFound(_0xc5ea80,null))['then'](saveUpdates(_0xd7903f[_0x96ba('0x51')],null))[_0x96ba('0x20')](respondWithResult(_0xc5ea80,null))['catch'](handleError(_0xc5ea80,null));};exports[_0x96ba('0x21')]=function(_0x1d4d2e,_0x513d2f){return db[_0x96ba('0x2a')][_0x96ba('0x47')]({'where':{'id':_0x1d4d2e[_0x96ba('0x45')]['id']}})[_0x96ba('0x20')](handleEntityNotFound(_0x513d2f,null))[_0x96ba('0x20')](removeEntity(_0x513d2f,null))[_0x96ba('0x48')](handleError(_0x513d2f,null));};exports[_0x96ba('0x55')]=function(_0x189dc4,_0x529b94,_0x9a6190){var _0x2f9788={'raw':!![],'where':{}};var _0x5b4bc3={};var _0x178284={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x96ba('0x56')]({'where':{'id':_0x189dc4['params']['id']}})[_0x96ba('0x20')](handleEntityNotFound(_0x529b94,null))[_0x96ba('0x20')](function(_0x10e28e){if(_0x10e28e){_0x5b4bc3[_0x96ba('0x2c')]=_[_0x96ba('0x2d')](db[_0x96ba('0x57')][_0x96ba('0x2b')]);_0x5b4bc3[_0x96ba('0x2e')]=_['keys'](_0x189dc4['query']);_0x5b4bc3[_0x96ba('0x2f')]=_[_0x96ba('0x30')](_0x5b4bc3['model'],_0x5b4bc3[_0x96ba('0x2e')]);_0x2f9788[_0x96ba('0x31')]=_[_0x96ba('0x30')](_0x5b4bc3[_0x96ba('0x2c')],qs[_0x96ba('0x32')](_0x189dc4['query'][_0x96ba('0x32')]));_0x2f9788[_0x96ba('0x31')]=_0x2f9788[_0x96ba('0x31')][_0x96ba('0x33')]?_0x2f9788[_0x96ba('0x31')]:_0x5b4bc3[_0x96ba('0x2c')];if(!_0x189dc4['query'][_0x96ba('0x34')](_0x96ba('0x35'))){_0x2f9788['limit']=qs[_0x96ba('0x36')](_0x189dc4[_0x96ba('0x2e')]['limit']);_0x2f9788[_0x96ba('0x1c')]=qs['offset'](_0x189dc4[_0x96ba('0x2e')][_0x96ba('0x1c')]);}_0x2f9788[_0x96ba('0x37')]=qs[_0x96ba('0x38')](_0x189dc4[_0x96ba('0x2e')][_0x96ba('0x38')]);_0x2f9788[_0x96ba('0x39')]=qs[_0x96ba('0x2f')](_[_0x96ba('0x58')](_0x189dc4[_0x96ba('0x2e')],_0x5b4bc3['filters']));_0x2f9788[_0x96ba('0x39')][_0x96ba('0x59')]=_0x10e28e['id'];if(_0x189dc4[_0x96ba('0x2e')][_0x96ba('0x3a')]){_0x2f9788[_0x96ba('0x39')]=_[_0x96ba('0x3b')](_0x2f9788[_0x96ba('0x39')],{'$or':_[_0x96ba('0x3c')](_0x2f9788['attributes'],function(_0x196f92){var _0x52a278={};_0x52a278[_0x196f92]={'$like':'%'+_0x189dc4['query']['filter']+'%'};return _0x52a278;})});}_0x2f9788=_[_0x96ba('0x3b')]({},_0x2f9788,_0x189dc4['options']);return db[_0x96ba('0x57')][_0x96ba('0x1b')]({'where':_0x2f9788[_0x96ba('0x39')]})[_0x96ba('0x20')](function(_0x3b9d86){_0x178284[_0x96ba('0x1b')]=_0x3b9d86;if(_0x189dc4[_0x96ba('0x2e')]['includeAll']){_0x2f9788[_0x96ba('0x42')]=[{'all':!![]}];}return db[_0x96ba('0x57')][_0x96ba('0x5a')](_0x2f9788);})[_0x96ba('0x20')](function(_0x7d0aa1){_0x178284[_0x96ba('0x43')]=_0x7d0aa1;return _0x178284;});}})[_0x96ba('0x20')](respondWithFilteredResult(_0x529b94,_0x2f9788))[_0x96ba('0x48')](handleError(_0x529b94,null));};exports['getAnswers']=function(_0x35e13a,_0x42f143,_0x36a984){var _0x225c30={'raw':!![],'where':{}};var _0x22019f={};var _0xea4dca={'count':0x0,'rows':[]};return db[_0x96ba('0x2a')][_0x96ba('0x56')]({'where':{'id':_0x35e13a[_0x96ba('0x45')]['id']}})[_0x96ba('0x20')](handleEntityNotFound(_0x42f143,null))[_0x96ba('0x20')](function(_0x48fe63){if(_0x48fe63){_0x22019f[_0x96ba('0x2c')]=_[_0x96ba('0x2d')](db[_0x96ba('0x5b')][_0x96ba('0x2b')]);_0x22019f[_0x96ba('0x2e')]=_[_0x96ba('0x2d')](_0x35e13a['query']);_0x22019f[_0x96ba('0x2f')]=_['intersection'](_0x22019f[_0x96ba('0x2c')],_0x22019f['query']);_0x225c30[_0x96ba('0x31')]=_[_0x96ba('0x30')](_0x22019f[_0x96ba('0x2c')],qs['fields'](_0x35e13a[_0x96ba('0x2e')][_0x96ba('0x32')]));_0x225c30[_0x96ba('0x31')]=_0x225c30[_0x96ba('0x31')][_0x96ba('0x33')]?_0x225c30['attributes']:_0x22019f[_0x96ba('0x2c')];if(!_0x35e13a[_0x96ba('0x2e')]['hasOwnProperty'](_0x96ba('0x35'))){_0x225c30['limit']=qs[_0x96ba('0x36')](_0x35e13a['query'][_0x96ba('0x36')]);_0x225c30[_0x96ba('0x1c')]=qs[_0x96ba('0x1c')](_0x35e13a[_0x96ba('0x2e')]['offset']);}_0x225c30[_0x96ba('0x37')]=qs[_0x96ba('0x38')](_0x35e13a[_0x96ba('0x2e')][_0x96ba('0x38')]);_0x225c30['where']=qs[_0x96ba('0x2f')](_[_0x96ba('0x58')](_0x35e13a[_0x96ba('0x2e')],_0x22019f[_0x96ba('0x2f')]));_0x225c30[_0x96ba('0x39')][_0x96ba('0x59')]=_0x48fe63['id'];if(_0x35e13a[_0x96ba('0x2e')][_0x96ba('0x3a')]){_0x225c30['where']=_[_0x96ba('0x3b')](_0x225c30[_0x96ba('0x39')],{'$or':_[_0x96ba('0x3c')](_0x225c30[_0x96ba('0x31')],function(_0xe1eac){var _0x260cb1={};_0x260cb1[_0xe1eac]={'$like':'%'+_0x35e13a[_0x96ba('0x2e')]['filter']+'%'};return _0x260cb1;})});}_0x225c30=_[_0x96ba('0x3b')]({},_0x225c30,_0x35e13a[_0x96ba('0x46')]);return db[_0x96ba('0x5b')][_0x96ba('0x1b')]({'where':_0x225c30[_0x96ba('0x39')]})[_0x96ba('0x20')](function(_0x20e6da){_0xea4dca[_0x96ba('0x1b')]=_0x20e6da;if(_0x35e13a[_0x96ba('0x2e')][_0x96ba('0x41')]){_0x225c30[_0x96ba('0x42')]=[{'all':!![]}];}return db[_0x96ba('0x5b')]['findAll'](_0x225c30);})['then'](function(_0xfb6993){_0xea4dca[_0x96ba('0x43')]=_0xfb6993;return _0xea4dca;});}})[_0x96ba('0x20')](respondWithFilteredResult(_0x42f143,_0x225c30))[_0x96ba('0x48')](handleError(_0x42f143,null));};function char(_0x38bef1){return'number'===typeof _0x38bef1?String[_0x96ba('0x5c')][_0x96ba('0x1f')](null,arguments):_0x38bef1;}function needsEncapsulation(_0x42b0b0){return!!_0x42b0b0&&(_0x42b0b0[_0x96ba('0x5d')]()['indexOf'](char(0xd))>=0x0||_0x42b0b0['toString']()[_0x96ba('0x5e')](char(0xa))>=0x0||_0x42b0b0[_0x96ba('0x5d')]()[_0x96ba('0x5e')](char(0x2c))>=0x0||_0x42b0b0[_0x96ba('0x5d')]()[_0x96ba('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x57056f){var _0x5ca783=char(0x22),_0x2dca0f='\x5c'+char(0x22),_0x1a58df=_0x57056f[_0x96ba('0x5d')]()[_0x96ba('0x5f')](new RegExp(_0x5ca783,'g'),_0x2dca0f);return _0x5ca783+_0x1a58df+_0x5ca783;}exports['getSummary']=function(_0x418ea4,_0x5c4083,_0x4f9f57){var _0xddc7c8,_0x40f330;var _0x3cbfa7={'where':{'ProjectId':_0x418ea4[_0x96ba('0x45')]['id']}};if(_0x418ea4[_0x96ba('0x2e')][_0x96ba('0x60')]){_0x3cbfa7[_0x96ba('0x39')]['starttime']=JSON[_0x96ba('0x61')](_0x418ea4[_0x96ba('0x2e')][_0x96ba('0x60')]);}return db[_0x96ba('0x57')][_0x96ba('0x5a')](_0x3cbfa7)[_0x96ba('0x20')](handleEntityNotFound(_0x5c4083,null))['then'](function(_0x5ceb25){if(_0x5ceb25){_0xddc7c8=_0x5ceb25;return db[_0x96ba('0x62')][_0x96ba('0x5a')]({'where':{'SessionId':{'$in':_[_0x96ba('0x3c')](_0xddc7c8,'id')},'ProjectId':_0x418ea4[_0x96ba('0x45')]['id']},'order':_0x96ba('0x63')});}})[_0x96ba('0x20')](handleEntityNotFound(_0x5c4083,null))[_0x96ba('0x20')](function(_0x16e8f2){if(_0x16e8f2){_0x40f330=_0x16e8f2;var _0x11b54c={};for(var _0x525532=0x0,_0x51fe69=_0x40f330[_0x96ba('0x33')];_0x525532<_0x51fe69;_0x525532++){if(!_0x11b54c[_0x96ba('0x34')](_0x40f330[_0x525532][_0x96ba('0x64')])){_0x11b54c[_0x40f330[_0x525532][_0x96ba('0x64')]]=needsEncapsulation(_0x40f330[_0x525532][_0x96ba('0x65')])?encapsulate(_0x40f330[_0x525532]['question']):_0x40f330[_0x525532]['question'];}}var _0xe3340a=[],_0x4e1765={};for(var _0x44063a=0x0,_0x1aafbc=_0xddc7c8[_0x96ba('0x33')];_0x44063a<_0x1aafbc;_0x44063a++){_0x4e1765={'ProjectId':_0x418ea4[_0x96ba('0x45')]['id'],'SessionId':_0xddc7c8[_0x44063a]['id'],'StartTime':moment(_0xddc7c8[_0x44063a][_0x96ba('0x66')])[_0x96ba('0x67')](_0x96ba('0x68'))};for(var _0x3c48d3=0x0,_0x3d10da=_0x40f330[_0x96ba('0x33')];_0x3c48d3<_0x3d10da;_0x3c48d3++){if(_0x40f330[_0x3c48d3][_0x96ba('0x69')]==_0xddc7c8[_0x44063a]['id']&&_0x11b54c[_0x96ba('0x34')](_0x40f330[_0x3c48d3][_0x96ba('0x64')])){_0x4e1765[_0x11b54c[_0x40f330[_0x3c48d3]['questionId']]]=_0x40f330[_0x3c48d3][_0x96ba('0x6a')];}}for(var _0x20ae2d in _0x11b54c){if(!_0x4e1765[_0x96ba('0x34')](_0x11b54c[_0x20ae2d])){_0x4e1765[_0x11b54c[_0x20ae2d]]=null;}}_0xe3340a[_0x96ba('0x6b')](_0x4e1765);}return _0xe3340a;}})[_0x96ba('0x20')](function(_0x4156a5){if(!_[_0x96ba('0x6c')](_0x4156a5)){var _0x28896c=toCsv(_0x4156a5);var _0x455f5f=Date[_0x96ba('0x6d')]();fs[_0x96ba('0x6e')](util[_0x96ba('0x67')](_0x96ba('0x6f'),_0x418ea4[_0x96ba('0x45')]['id'],_0x455f5f),_0x28896c);_0x5c4083['setHeader'](_0x96ba('0x70'),'attachment;\x20filename='+util[_0x96ba('0x67')](_0x96ba('0x71'),_0x418ea4[_0x96ba('0x45')]['id'],_0x455f5f));_0x5c4083[_0x96ba('0x72')]('Content-type',_0x96ba('0x73'));return _0x5c4083[_0x96ba('0x74')](util[_0x96ba('0x67')](_0x96ba('0x6f'),_0x418ea4[_0x96ba('0x45')]['id'],_0x455f5f));}else{return _0x5c4083[_0x96ba('0x17')](0xcc);}})[_0x96ba('0x48')](handleError(_0x5c4083,null));};
\ No newline at end of file
+var _0xd297=['rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','where','merge','map','type','key','filter','options','JscriptyProject','include','rows','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','getSessions','findOne','JscriptySessionReport','sort','ProjectId','findAll','getAnswers','JscriptyAnswerReport','toString','indexOf','replace','starttime','parse','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index'];(function(_0x325ab8,_0x274fec){var _0x5d505d=function(_0x363440){while(--_0x363440){_0x325ab8['push'](_0x325ab8['shift']());}};_0x5d505d(++_0x274fec);}(_0xd297,0xb8));var _0x7d29=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd297[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0x7d29('0x0'));var emlformat=require(_0x7d29('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7d29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d29('0x3'));var moment=require(_0x7d29('0x4'));var BPromise=require(_0x7d29('0x5'));var Mustache=require(_0x7d29('0x6'));var util=require('util');var path=require(_0x7d29('0x7'));var sox=require(_0x7d29('0x8'));var csv=require(_0x7d29('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7d29('0xa'));var squel=require(_0x7d29('0xb'));var crypto=require(_0x7d29('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7d29('0xd'));var toCsv=require(_0x7d29('0x9'));var querystring=require(_0x7d29('0xe'));var Papa=require(_0x7d29('0xf'));var Redis=require('ioredis');var authService=require(_0x7d29('0x10'));var qs=require(_0x7d29('0x11'));var hardwareService=require(_0x7d29('0x12'));var logger=require(_0x7d29('0x13'))(_0x7d29('0x14'));var utils=require(_0x7d29('0x15'));var config=require('../../config/environment');var db=require(_0x7d29('0x16'))['db'];function respondWithStatusCode(_0x51106a,_0x446be6){_0x446be6=_0x446be6||0xcc;return function(_0x2e123d){if(_0x2e123d){return _0x51106a[_0x7d29('0x17')](_0x446be6);}return _0x51106a['status'](_0x446be6)[_0x7d29('0x18')]();};}function respondWithResult(_0x123fed,_0x5081be){_0x5081be=_0x5081be||0xc8;return function(_0x3daba4){if(_0x3daba4){return _0x123fed[_0x7d29('0x19')](_0x5081be)[_0x7d29('0x1a')](_0x3daba4);}};}function respondWithFilteredResult(_0x6687a7,_0x4165e9){return function(_0x478889){if(_0x478889){var _0x274cfb=_0x478889[_0x7d29('0x1b')],_0x337ea9=_0x4165e9[_0x7d29('0x1c')],_0x49b38f=_0x4165e9[_0x7d29('0x1c')]+_0x4165e9[_0x7d29('0x1d')],_0x3662ea;if(_0x49b38f>=_0x274cfb){_0x49b38f=_0x274cfb;_0x3662ea=0xc8;}else{_0x3662ea=0xce;}_0x6687a7['status'](_0x3662ea);return _0x6687a7[_0x7d29('0x1e')](_0x7d29('0x1f'),_0x337ea9+'-'+_0x49b38f+'/'+_0x274cfb)[_0x7d29('0x1a')](_0x478889);}return null;};}function patchUpdates(_0x2ef7e9){return function(_0x4f20b8){try{jsonpatch[_0x7d29('0x20')](_0x4f20b8,_0x2ef7e9,!![]);}catch(_0x6044ad){return BPromise[_0x7d29('0x21')](_0x6044ad);}return _0x4f20b8[_0x7d29('0x22')]();};}function saveUpdates(_0x1d2df0,_0x572a49){return function(_0x1a5e65){if(_0x1a5e65){return _0x1a5e65[_0x7d29('0x23')](_0x1d2df0)[_0x7d29('0x24')](function(_0x77c198){return _0x77c198;});}return null;};}function removeEntity(_0x259f64,_0x38d8dc){return function(_0x160082){if(_0x160082){return _0x160082[_0x7d29('0x25')]()[_0x7d29('0x24')](function(){var _0x3e2231=_0x160082[_0x7d29('0x26')]({'plain':!![]});var _0xae7646=_0x7d29('0x27');return db[_0x7d29('0x28')][_0x7d29('0x25')]({'where':{'type':_0xae7646,'resourceId':_0x3e2231['id']}})[_0x7d29('0x24')](function(){return _0x160082;});})['then'](function(){_0x259f64[_0x7d29('0x19')](0xcc)[_0x7d29('0x18')]();});}};}function handleEntityNotFound(_0x144f62,_0x1b8925){return function(_0x28064d){if(!_0x28064d){_0x144f62['sendStatus'](0x194);}return _0x28064d;};}function handleError(_0x5a5279,_0x4bf838){_0x4bf838=_0x4bf838||0x1f4;return function(_0x424129){logger[_0x7d29('0x29')](_0x424129[_0x7d29('0x2a')]);if(_0x424129[_0x7d29('0x2b')]){delete _0x424129[_0x7d29('0x2b')];}_0x5a5279['status'](_0x4bf838)[_0x7d29('0x2c')](_0x424129);};}exports[_0x7d29('0x2d')]=function(_0x4a232e,_0x567ff0){var _0x304292={},_0x102928={},_0x53cd57={'count':0x0,'rows':[]};var _0x4f3ed8=db['JscriptyProject'][_0x7d29('0x2e')];_0x102928[_0x7d29('0x2f')]=_[_0x7d29('0x30')](_0x4f3ed8);_0x102928[_0x7d29('0x31')]=_[_0x7d29('0x30')](_0x4a232e['query']);_0x102928[_0x7d29('0x32')]=_[_0x7d29('0x33')](_0x102928[_0x7d29('0x2f')],_0x102928[_0x7d29('0x31')]);_0x304292[_0x7d29('0x34')]=_[_0x7d29('0x33')](_0x102928[_0x7d29('0x2f')],qs['fields'](_0x4a232e['query'][_0x7d29('0x35')]));_0x304292[_0x7d29('0x34')]=_0x304292[_0x7d29('0x34')][_0x7d29('0x36')]?_0x304292[_0x7d29('0x34')]:_0x102928[_0x7d29('0x2f')];if(!_0x4a232e[_0x7d29('0x31')][_0x7d29('0x37')]('nolimit')){_0x304292[_0x7d29('0x1d')]=qs[_0x7d29('0x1d')](_0x4a232e[_0x7d29('0x31')][_0x7d29('0x1d')]);_0x304292[_0x7d29('0x1c')]=qs[_0x7d29('0x1c')](_0x4a232e[_0x7d29('0x31')]['offset']);}_0x304292[_0x7d29('0x38')]=qs['sort'](_0x4a232e[_0x7d29('0x31')]['sort']);_0x304292['where']=qs[_0x7d29('0x32')](_[_0x7d29('0x39')](_0x4a232e['query'],_0x102928[_0x7d29('0x32')]));if(_0x4a232e[_0x7d29('0x31')]['filter']){_0x304292[_0x7d29('0x3a')]=_[_0x7d29('0x3b')](_0x304292[_0x7d29('0x3a')],{'$or':_[_0x7d29('0x3c')](_0x4f3ed8,function(_0xacafa8){if(_0xacafa8[_0x7d29('0x3d')][_0x7d29('0x3e')]!=='VIRTUAL'){var _0x7d67ec={};_0x7d67ec[_0xacafa8['field']]={'$like':'%'+_0x4a232e['query'][_0x7d29('0x3f')]+'%'};return _0x7d67ec;}})});}_0x304292=_[_0x7d29('0x3b')]({},_0x304292,_0x4a232e[_0x7d29('0x40')]);var _0x5a2c6c={'where':_0x304292[_0x7d29('0x3a')]};return db[_0x7d29('0x41')]['count'](_0x5a2c6c)['then'](function(_0x550920){_0x53cd57[_0x7d29('0x1b')]=_0x550920;if(_0x4a232e[_0x7d29('0x31')]['includeAll']){_0x304292[_0x7d29('0x42')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x304292);})[_0x7d29('0x24')](function(_0x5aa9f7){_0x53cd57[_0x7d29('0x43')]=_0x5aa9f7;return _0x53cd57;})[_0x7d29('0x24')](respondWithFilteredResult(_0x567ff0,_0x304292))[_0x7d29('0x44')](handleError(_0x567ff0,null));};exports[_0x7d29('0x45')]=function(_0x2f2a6b,_0x2dc733){var _0x4684b5={'raw':![],'where':{'id':_0x2f2a6b[_0x7d29('0x46')]['id']}},_0x10c102={};_0x10c102['model']=_['keys'](db['JscriptyProject']['rawAttributes']);_0x10c102[_0x7d29('0x31')]=_['keys'](_0x2f2a6b[_0x7d29('0x31')]);_0x10c102[_0x7d29('0x32')]=_[_0x7d29('0x33')](_0x10c102[_0x7d29('0x2f')],_0x10c102[_0x7d29('0x31')]);_0x4684b5[_0x7d29('0x34')]=_[_0x7d29('0x33')](_0x10c102['model'],qs[_0x7d29('0x35')](_0x2f2a6b[_0x7d29('0x31')]['fields']));_0x4684b5[_0x7d29('0x34')]=_0x4684b5['attributes']['length']?_0x4684b5[_0x7d29('0x34')]:_0x10c102[_0x7d29('0x2f')];if(_0x2f2a6b['query'][_0x7d29('0x47')]){_0x4684b5['include']=[{'all':!![]}];}_0x4684b5=_[_0x7d29('0x3b')]({},_0x4684b5,_0x2f2a6b[_0x7d29('0x40')]);return db[_0x7d29('0x41')][_0x7d29('0x48')](_0x4684b5)[_0x7d29('0x24')](handleEntityNotFound(_0x2dc733,null))[_0x7d29('0x24')](respondWithResult(_0x2dc733,null))[_0x7d29('0x44')](handleError(_0x2dc733,null));};exports[_0x7d29('0x49')]=function(_0x5ba534,_0x2582b4){return db[_0x7d29('0x41')][_0x7d29('0x49')](_0x5ba534[_0x7d29('0x4a')],{})[_0x7d29('0x24')](function(_0xbf1e4d){var _0x2e8161=_0x5ba534[_0x7d29('0x4b')][_0x7d29('0x26')]({'plain':!![]});if(!_0x2e8161)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e8161[_0x7d29('0x4c')]===_0x7d29('0x4b')){var _0x4ff4d2=_0xbf1e4d['get']({'plain':!![]});var _0x20065f=_0x7d29('0x27');return db[_0x7d29('0x4d')][_0x7d29('0x48')]({'where':{'name':_0x20065f,'userProfileId':_0x2e8161['userProfileId']},'raw':!![]})[_0x7d29('0x24')](function(_0x287adf){if(_0x287adf&&_0x287adf[_0x7d29('0x4e')]===0x0){return db['UserProfileResource'][_0x7d29('0x49')]({'name':_0x4ff4d2[_0x7d29('0x2b')],'resourceId':_0x4ff4d2['id'],'type':_0x287adf[_0x7d29('0x2b')],'sectionId':_0x287adf['id']},{})['then'](function(){return _0xbf1e4d;});}else{return _0xbf1e4d;}})['catch'](function(_0x1de29c){logger[_0x7d29('0x29')](_0x7d29('0x4f'),_0x1de29c);throw _0x1de29c;});}return _0xbf1e4d;})[_0x7d29('0x24')](respondWithResult(_0x2582b4,0xc9))[_0x7d29('0x44')](handleError(_0x2582b4,null));};exports[_0x7d29('0x50')]=function(_0x31eab1,_0x2a9fc4){var _0x178f29={'raw':![],'where':{'id':_0x31eab1[_0x7d29('0x46')]['id']}},_0x23733a={};_0x23733a[_0x7d29('0x2f')]=_[_0x7d29('0x30')](db[_0x7d29('0x41')][_0x7d29('0x2e')]);_0x178f29[_0x7d29('0x34')]=_[_0x7d29('0x33')](_0x23733a[_0x7d29('0x2f')],qs['fields'](_0x31eab1[_0x7d29('0x31')]['fields']));_0x178f29[_0x7d29('0x34')]=_0x178f29[_0x7d29('0x34')][_0x7d29('0x36')]?_0x178f29[_0x7d29('0x34')]:_0x23733a[_0x7d29('0x2f')];if(_0x31eab1['query'][_0x7d29('0x47')]){_0x178f29[_0x7d29('0x42')]=[{'all':!![]}];}_0x178f29=_[_0x7d29('0x3b')]({},_0x178f29,_0x31eab1[_0x7d29('0x40')]);return db['JscriptyProject'][_0x7d29('0x48')](_0x178f29)[_0x7d29('0x24')](handleEntityNotFound(_0x2a9fc4,null))[_0x7d29('0x24')](function(_0x20ed58){if(_0x20ed58){var _0x4ffc00=_0x20ed58[_0x7d29('0x26')]({'plain':!![]});_0x4ffc00=qs[_0x7d29('0x51')](_0x4ffc00,['id','createdAt',_0x7d29('0x52')]);_0x31eab1['body']=_[_0x7d29('0x51')](_0x31eab1[_0x7d29('0x4a')],['id','createdAt',_0x7d29('0x52')]);return db[_0x7d29('0x41')][_0x7d29('0x49')](_[_0x7d29('0x3b')](_0x4ffc00,_0x31eab1[_0x7d29('0x4a')]),{'include':_0x31eab1[_0x7d29('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0x7d29('0x24')](function(_0x5dbfe8){var _0x2e5eea=_0x31eab1[_0x7d29('0x4b')]['get']({'plain':!![]});if(!_0x2e5eea)throw new Error(_0x7d29('0x53'));if(_0x2e5eea[_0x7d29('0x4c')]===_0x7d29('0x4b')){var _0x477701=_0x5dbfe8[_0x7d29('0x26')]({'plain':!![]});var _0xed25c4=_0x7d29('0x27');return db[_0x7d29('0x4d')][_0x7d29('0x48')]({'where':{'name':_0xed25c4,'userProfileId':_0x2e5eea[_0x7d29('0x54')]},'raw':!![]})[_0x7d29('0x24')](function(_0x142f0a){if(_0x142f0a&&_0x142f0a[_0x7d29('0x4e')]===0x0){return db[_0x7d29('0x28')]['create']({'name':_0x477701['name'],'resourceId':_0x477701['id'],'type':_0x142f0a['name'],'sectionId':_0x142f0a['id']},{})[_0x7d29('0x24')](function(){return _0x5dbfe8;});}else{return _0x5dbfe8;}})['catch'](function(_0x2f7f3f){logger[_0x7d29('0x29')](_0x7d29('0x4f'),_0x2f7f3f);throw _0x2f7f3f;});}return _0x5dbfe8;});}})[_0x7d29('0x24')](respondWithResult(_0x2a9fc4,0xc9))[_0x7d29('0x44')](handleError(_0x2a9fc4,null));};exports['update']=function(_0x403694,_0x425aea){if(_0x403694['body']['id']){delete _0x403694[_0x7d29('0x4a')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x403694[_0x7d29('0x46')]['id']}})[_0x7d29('0x24')](handleEntityNotFound(_0x425aea,null))[_0x7d29('0x24')](saveUpdates(_0x403694[_0x7d29('0x4a')],null))[_0x7d29('0x24')](respondWithResult(_0x425aea,null))[_0x7d29('0x44')](handleError(_0x425aea,null));};exports['destroy']=function(_0x2f0994,_0x5028d6){return db[_0x7d29('0x41')][_0x7d29('0x48')]({'where':{'id':_0x2f0994[_0x7d29('0x46')]['id']}})[_0x7d29('0x24')](handleEntityNotFound(_0x5028d6,null))['then'](removeEntity(_0x5028d6,null))[_0x7d29('0x44')](handleError(_0x5028d6,null));};exports[_0x7d29('0x55')]=function(_0x51fbba,_0x5b5c96,_0x6a8478){var _0x282da8={'raw':!![],'where':{}};var _0x113c6c={};var _0x320065={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x7d29('0x56')]({'where':{'id':_0x51fbba[_0x7d29('0x46')]['id']}})[_0x7d29('0x24')](handleEntityNotFound(_0x5b5c96,null))[_0x7d29('0x24')](function(_0x3f0894){if(_0x3f0894){_0x113c6c[_0x7d29('0x2f')]=_[_0x7d29('0x30')](db[_0x7d29('0x57')]['rawAttributes']);_0x113c6c[_0x7d29('0x31')]=_[_0x7d29('0x30')](_0x51fbba[_0x7d29('0x31')]);_0x113c6c[_0x7d29('0x32')]=_['intersection'](_0x113c6c['model'],_0x113c6c['query']);_0x282da8['attributes']=_['intersection'](_0x113c6c[_0x7d29('0x2f')],qs[_0x7d29('0x35')](_0x51fbba[_0x7d29('0x31')]['fields']));_0x282da8['attributes']=_0x282da8[_0x7d29('0x34')][_0x7d29('0x36')]?_0x282da8['attributes']:_0x113c6c[_0x7d29('0x2f')];if(!_0x51fbba[_0x7d29('0x31')]['hasOwnProperty']('nolimit')){_0x282da8[_0x7d29('0x1d')]=qs[_0x7d29('0x1d')](_0x51fbba[_0x7d29('0x31')]['limit']);_0x282da8[_0x7d29('0x1c')]=qs[_0x7d29('0x1c')](_0x51fbba[_0x7d29('0x31')][_0x7d29('0x1c')]);}_0x282da8[_0x7d29('0x38')]=qs[_0x7d29('0x58')](_0x51fbba['query'][_0x7d29('0x58')]);_0x282da8[_0x7d29('0x3a')]=qs[_0x7d29('0x32')](_[_0x7d29('0x39')](_0x51fbba[_0x7d29('0x31')],_0x113c6c[_0x7d29('0x32')]));_0x282da8[_0x7d29('0x3a')][_0x7d29('0x59')]=_0x3f0894['id'];if(_0x51fbba[_0x7d29('0x31')]['filter']){_0x282da8[_0x7d29('0x3a')]=_[_0x7d29('0x3b')](_0x282da8[_0x7d29('0x3a')],{'$or':_[_0x7d29('0x3c')](_0x282da8[_0x7d29('0x34')],function(_0x33b884){var _0x286ce7={};_0x286ce7[_0x33b884]={'$like':'%'+_0x51fbba[_0x7d29('0x31')][_0x7d29('0x3f')]+'%'};return _0x286ce7;})});}_0x282da8=_[_0x7d29('0x3b')]({},_0x282da8,_0x51fbba[_0x7d29('0x40')]);return db[_0x7d29('0x57')]['count']({'where':_0x282da8['where']})['then'](function(_0x1bc5ee){_0x320065[_0x7d29('0x1b')]=_0x1bc5ee;if(_0x51fbba['query'][_0x7d29('0x47')]){_0x282da8[_0x7d29('0x42')]=[{'all':!![]}];}return db[_0x7d29('0x57')][_0x7d29('0x5a')](_0x282da8);})[_0x7d29('0x24')](function(_0x5d3d6a){_0x320065[_0x7d29('0x43')]=_0x5d3d6a;return _0x320065;});}})[_0x7d29('0x24')](respondWithFilteredResult(_0x5b5c96,_0x282da8))[_0x7d29('0x44')](handleError(_0x5b5c96,null));};exports[_0x7d29('0x5b')]=function(_0x4e6e48,_0x71c7f0,_0x2106f7){var _0xc2214a={'raw':!![],'where':{}};var _0x342e60={};var _0x1d661c={'count':0x0,'rows':[]};return db[_0x7d29('0x41')][_0x7d29('0x56')]({'where':{'id':_0x4e6e48[_0x7d29('0x46')]['id']}})['then'](handleEntityNotFound(_0x71c7f0,null))[_0x7d29('0x24')](function(_0x10a784){if(_0x10a784){_0x342e60[_0x7d29('0x2f')]=_[_0x7d29('0x30')](db['JscriptyAnswerReport']['rawAttributes']);_0x342e60[_0x7d29('0x31')]=_['keys'](_0x4e6e48[_0x7d29('0x31')]);_0x342e60[_0x7d29('0x32')]=_['intersection'](_0x342e60[_0x7d29('0x2f')],_0x342e60[_0x7d29('0x31')]);_0xc2214a['attributes']=_[_0x7d29('0x33')](_0x342e60[_0x7d29('0x2f')],qs[_0x7d29('0x35')](_0x4e6e48['query']['fields']));_0xc2214a[_0x7d29('0x34')]=_0xc2214a[_0x7d29('0x34')][_0x7d29('0x36')]?_0xc2214a[_0x7d29('0x34')]:_0x342e60['model'];if(!_0x4e6e48[_0x7d29('0x31')][_0x7d29('0x37')]('nolimit')){_0xc2214a[_0x7d29('0x1d')]=qs[_0x7d29('0x1d')](_0x4e6e48[_0x7d29('0x31')][_0x7d29('0x1d')]);_0xc2214a['offset']=qs[_0x7d29('0x1c')](_0x4e6e48[_0x7d29('0x31')][_0x7d29('0x1c')]);}_0xc2214a[_0x7d29('0x38')]=qs['sort'](_0x4e6e48[_0x7d29('0x31')][_0x7d29('0x58')]);_0xc2214a[_0x7d29('0x3a')]=qs['filters'](_[_0x7d29('0x39')](_0x4e6e48[_0x7d29('0x31')],_0x342e60[_0x7d29('0x32')]));_0xc2214a[_0x7d29('0x3a')][_0x7d29('0x59')]=_0x10a784['id'];if(_0x4e6e48[_0x7d29('0x31')][_0x7d29('0x3f')]){_0xc2214a[_0x7d29('0x3a')]=_[_0x7d29('0x3b')](_0xc2214a[_0x7d29('0x3a')],{'$or':_[_0x7d29('0x3c')](_0xc2214a[_0x7d29('0x34')],function(_0xbb7087){var _0x4de28a={};_0x4de28a[_0xbb7087]={'$like':'%'+_0x4e6e48[_0x7d29('0x31')][_0x7d29('0x3f')]+'%'};return _0x4de28a;})});}_0xc2214a=_['merge']({},_0xc2214a,_0x4e6e48[_0x7d29('0x40')]);return db[_0x7d29('0x5c')][_0x7d29('0x1b')]({'where':_0xc2214a[_0x7d29('0x3a')]})[_0x7d29('0x24')](function(_0x147791){_0x1d661c[_0x7d29('0x1b')]=_0x147791;if(_0x4e6e48['query']['includeAll']){_0xc2214a['include']=[{'all':!![]}];}return db[_0x7d29('0x5c')][_0x7d29('0x5a')](_0xc2214a);})[_0x7d29('0x24')](function(_0x236d35){_0x1d661c[_0x7d29('0x43')]=_0x236d35;return _0x1d661c;});}})[_0x7d29('0x24')](respondWithFilteredResult(_0x71c7f0,_0xc2214a))[_0x7d29('0x44')](handleError(_0x71c7f0,null));};function char(_0x3a9f07){return'number'===typeof _0x3a9f07?String['fromCharCode'][_0x7d29('0x20')](null,arguments):_0x3a9f07;}function needsEncapsulation(_0x1adbad){return!!_0x1adbad&&(_0x1adbad[_0x7d29('0x5d')]()[_0x7d29('0x5e')](char(0xd))>=0x0||_0x1adbad['toString']()[_0x7d29('0x5e')](char(0xa))>=0x0||_0x1adbad['toString']()['indexOf'](char(0x2c))>=0x0||_0x1adbad[_0x7d29('0x5d')]()[_0x7d29('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x42778e){var _0xff0d7c=char(0x22),_0x4d1f2e='\x5c'+char(0x22),_0x3eea76=_0x42778e[_0x7d29('0x5d')]()[_0x7d29('0x5f')](new RegExp(_0xff0d7c,'g'),_0x4d1f2e);return _0xff0d7c+_0x3eea76+_0xff0d7c;}exports['getSummary']=function(_0x1741eb,_0x203dd8,_0x2aada7){var _0x276dc8,_0x15d35d;var _0x31c42a={'where':{'ProjectId':_0x1741eb[_0x7d29('0x46')]['id']}};if(_0x1741eb[_0x7d29('0x31')]['startTime']){_0x31c42a[_0x7d29('0x3a')][_0x7d29('0x60')]=JSON[_0x7d29('0x61')](_0x1741eb[_0x7d29('0x31')][_0x7d29('0x62')]);}return db[_0x7d29('0x57')][_0x7d29('0x5a')](_0x31c42a)[_0x7d29('0x24')](handleEntityNotFound(_0x203dd8,null))['then'](function(_0x403829){if(_0x403829){_0x276dc8=_0x403829;return db['JscriptyQuestionReport'][_0x7d29('0x5a')]({'where':{'SessionId':{'$in':_[_0x7d29('0x3c')](_0x276dc8,'id')},'ProjectId':_0x1741eb['params']['id']},'order':_0x7d29('0x63')});}})[_0x7d29('0x24')](handleEntityNotFound(_0x203dd8,null))[_0x7d29('0x24')](function(_0x55bd73){if(_0x55bd73){_0x15d35d=_0x55bd73;var _0x100123={};for(var _0xae6ae8=0x0,_0x186e13=_0x15d35d['length'];_0xae6ae8<_0x186e13;_0xae6ae8++){if(!_0x100123['hasOwnProperty'](_0x15d35d[_0xae6ae8]['questionId'])){_0x100123[_0x15d35d[_0xae6ae8][_0x7d29('0x64')]]=needsEncapsulation(_0x15d35d[_0xae6ae8]['question'])?encapsulate(_0x15d35d[_0xae6ae8]['question']):_0x15d35d[_0xae6ae8][_0x7d29('0x65')];}}var _0x47969c=[],_0x31bfbb={};for(var _0x10a9b8=0x0,_0x42761f=_0x276dc8[_0x7d29('0x36')];_0x10a9b8<_0x42761f;_0x10a9b8++){_0x31bfbb={'ProjectId':_0x1741eb['params']['id'],'SessionId':_0x276dc8[_0x10a9b8]['id'],'StartTime':moment(_0x276dc8[_0x10a9b8][_0x7d29('0x60')])[_0x7d29('0x66')](_0x7d29('0x67'))};for(var _0x59e769=0x0,_0x314e0f=_0x15d35d[_0x7d29('0x36')];_0x59e769<_0x314e0f;_0x59e769++){if(_0x15d35d[_0x59e769]['SessionId']==_0x276dc8[_0x10a9b8]['id']&&_0x100123[_0x7d29('0x37')](_0x15d35d[_0x59e769]['questionId'])){_0x31bfbb[_0x100123[_0x15d35d[_0x59e769]['questionId']]]=_0x15d35d[_0x59e769][_0x7d29('0x68')];}}for(var _0x51afe5 in _0x100123){if(!_0x31bfbb['hasOwnProperty'](_0x100123[_0x51afe5])){_0x31bfbb[_0x100123[_0x51afe5]]=null;}}_0x47969c[_0x7d29('0x69')](_0x31bfbb);}return _0x47969c;}})[_0x7d29('0x24')](function(_0x734c5){if(!_[_0x7d29('0x6a')](_0x734c5)){var _0x5b11ee=toCsv(_0x734c5);var _0x1bbdd6=Date['now']();fs[_0x7d29('0x6b')](util[_0x7d29('0x66')](_0x7d29('0x6c'),_0x1741eb[_0x7d29('0x46')]['id'],_0x1bbdd6),_0x5b11ee);_0x203dd8[_0x7d29('0x6d')](_0x7d29('0x6e'),_0x7d29('0x6f')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x1741eb[_0x7d29('0x46')]['id'],_0x1bbdd6));_0x203dd8[_0x7d29('0x6d')](_0x7d29('0x70'),_0x7d29('0x71'));return _0x203dd8[_0x7d29('0x72')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1741eb[_0x7d29('0x46')]['id'],_0x1bbdd6));}else{return _0x203dd8[_0x7d29('0x17')](0xcc);}})[_0x7d29('0x44')](handleError(_0x203dd8,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js
index 0f22a2b..fcbc819 100644
--- a/server/api/jscriptyProject/jscriptyProject.model.js
+++ b/server/api/jscriptyProject/jscriptyProject.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe8a1=['define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','moment','request-promise','rimraf','exports'];(function(_0x5b7ccb,_0x4cf444){var _0x5375f7=function(_0x1e1482){while(--_0x1e1482){_0x5b7ccb['push'](_0x5b7ccb['shift']());}};_0x5375f7(++_0x4cf444);}(_0xe8a1,0xad));var _0x1e8a=function(_0x32c48a,_0x874ea7){_0x32c48a=_0x32c48a-0x0;var _0xfecc8e=_0xe8a1[_0x32c48a];return _0xfecc8e;};'use strict';var _=require(_0x1e8a('0x0'));var util=require(_0x1e8a('0x1'));var logger=require(_0x1e8a('0x2'))('api');var moment=require(_0x1e8a('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e8a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e8a('0x5'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0x1e8a('0x6')]=function(_0x32e924,_0x3fe04c){return _0x32e924[_0x1e8a('0x7')](_0x1e8a('0x8'),attributes,{'tableName':_0x1e8a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbc1c=['path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','util','api','bluebird','request-promise'];(function(_0x17a33f,_0x559021){var _0x4a5861=function(_0xa6b98f){while(--_0xa6b98f){_0x17a33f['push'](_0x17a33f['shift']());}};_0x4a5861(++_0x559021);}(_0xbc1c,0xd8));var _0xcbc1=function(_0x3ce937,_0x568d7d){_0x3ce937=_0x3ce937-0x0;var _0x41d2fa=_0xbc1c[_0x3ce937];return _0x41d2fa;};'use strict';var _=require('lodash');var util=require(_0xcbc1('0x0'));var logger=require('../../config/logger')(_0xcbc1('0x1'));var moment=require('moment');var BPromise=require(_0xcbc1('0x2'));var rp=require(_0xcbc1('0x3'));var fs=require('fs');var path=require(_0xcbc1('0x4'));var rimraf=require(_0xcbc1('0x5'));var config=require('../../config/environment');var attributes=require(_0xcbc1('0x6'));module[_0xcbc1('0x7')]=function(_0x54c13c,_0x27da8d){return _0x54c13c[_0xcbc1('0x8')](_0xcbc1('0x9'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js
index 932c963..3f75957 100644
--- a/server/api/jscriptyProject/jscriptyProject.rpc.js
+++ b/server/api/jscriptyProject/jscriptyProject.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe154=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','util','moment','bluebird'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0xe154,0x11b));var _0x4e15=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xe154[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require('lodash');var util=require(_0x4e15('0x0'));var moment=require(_0x4e15('0x1'));var BPromise=require(_0x4e15('0x2'));var rs=require(_0x4e15('0x3'));var fs=require('fs');var Redis=require(_0x4e15('0x4'));var db=require(_0x4e15('0x5'))['db'];var utils=require(_0x4e15('0x6'));var logger=require(_0x4e15('0x7'))(_0x4e15('0x8'));var config=require(_0x4e15('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4e15('0xa')][_0x4e15('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36a2cf,_0x180947,_0x9f9982){return new BPromise(function(_0x103646,_0x52328a){return client['request'](_0x36a2cf,_0x9f9982)['then'](function(_0x14e35b){logger['info'](_0x4e15('0xc'),_0x180947,'request\x20sent');logger[_0x4e15('0xd')](_0x4e15('0xe'),_0x180947,'request\x20sent',JSON[_0x4e15('0xf')](_0x14e35b));if(_0x14e35b[_0x4e15('0x10')]){if(_0x14e35b[_0x4e15('0x10')]['code']===0x1f4){logger[_0x4e15('0x10')](_0x4e15('0xc'),_0x180947,_0x14e35b[_0x4e15('0x10')][_0x4e15('0x11')]);return _0x52328a(_0x14e35b[_0x4e15('0x10')][_0x4e15('0x11')]);}logger[_0x4e15('0x10')](_0x4e15('0xc'),_0x180947,_0x14e35b[_0x4e15('0x10')]['message']);return _0x103646(_0x14e35b[_0x4e15('0x10')]['message']);}else{logger[_0x4e15('0x12')](_0x4e15('0xc'),_0x180947,_0x4e15('0x13'));_0x103646(_0x14e35b[_0x4e15('0x14')][_0x4e15('0x11')]);}})[_0x4e15('0x15')](function(_0x597fc9){logger[_0x4e15('0x10')](_0x4e15('0xc'),_0x180947,_0x597fc9);_0x52328a(_0x597fc9);});});}
\ No newline at end of file
+var _0xc7b7=['error','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x23dcaa,_0x3c06f6){var _0x2e0557=function(_0x5008ac){while(--_0x5008ac){_0x23dcaa['push'](_0x23dcaa['shift']());}};_0x2e0557(++_0x3c06f6);}(_0xc7b7,0x1ce));var _0x7c7b=function(_0x2e1095,_0x3a7d94){_0x2e1095=_0x2e1095-0x0;var _0x3b2455=_0xc7b7[_0x2e1095];return _0x3b2455;};'use strict';var _=require(_0x7c7b('0x0'));var util=require(_0x7c7b('0x1'));var moment=require(_0x7c7b('0x2'));var BPromise=require(_0x7c7b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c7b('0x4'))['db'];var utils=require(_0x7c7b('0x5'));var logger=require(_0x7c7b('0x6'))(_0x7c7b('0x7'));var config=require(_0x7c7b('0x8'));var jayson=require(_0x7c7b('0x9'));var client=jayson[_0x7c7b('0xa')][_0x7c7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7a694d,_0x5a73b5,_0x31eaf7){return new BPromise(function(_0x4ce8d1,_0x1013df){return client[_0x7c7b('0xc')](_0x7a694d,_0x31eaf7)[_0x7c7b('0xd')](function(_0x45253c){logger[_0x7c7b('0xe')](_0x7c7b('0xf'),_0x5a73b5,_0x7c7b('0x10'));logger[_0x7c7b('0x11')](_0x7c7b('0x12'),_0x5a73b5,_0x7c7b('0x10'),JSON[_0x7c7b('0x13')](_0x45253c));if(_0x45253c['error']){if(_0x45253c['error'][_0x7c7b('0x14')]===0x1f4){logger['error'](_0x7c7b('0xf'),_0x5a73b5,_0x45253c[_0x7c7b('0x15')][_0x7c7b('0x16')]);return _0x1013df(_0x45253c[_0x7c7b('0x15')][_0x7c7b('0x16')]);}logger[_0x7c7b('0x15')](_0x7c7b('0xf'),_0x5a73b5,_0x45253c['error'][_0x7c7b('0x16')]);return _0x4ce8d1(_0x45253c[_0x7c7b('0x15')][_0x7c7b('0x16')]);}else{logger['info'](_0x7c7b('0xf'),_0x5a73b5,_0x7c7b('0x10'));_0x4ce8d1(_0x45253c['result']['message']);}})['catch'](function(_0x59bdd5){logger[_0x7c7b('0x15')]('JscriptyProject,\x20%s,\x20%s',_0x5a73b5,_0x59bdd5);_0x1013df(_0x59bdd5);});});}
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js
index 461b625..d90a029 100644
--- a/server/api/jscriptyQuestionReport/index.js
+++ b/server/api/jscriptyQuestionReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x96d4=['./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x36b7d2,_0xe1d340){var _0x176bb6=function(_0x5a6c8d){while(--_0x5a6c8d){_0x36b7d2['push'](_0x36b7d2['shift']());}};_0x176bb6(++_0xe1d340);}(_0x96d4,0x108));var _0x496d=function(_0x340d27,_0x18af34){_0x340d27=_0x340d27-0x0;var _0x364d74=_0x96d4[_0x340d27];return _0x364d74;};'use strict';var multer=require(_0x496d('0x0'));var util=require(_0x496d('0x1'));var path=require('path');var timeout=require(_0x496d('0x2'));var express=require(_0x496d('0x3'));var router=express['Router']();var auth=require(_0x496d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x496d('0x5'));var controller=require(_0x496d('0x6'));router[_0x496d('0x7')]('/',auth[_0x496d('0x8')](),controller[_0x496d('0x9')]);router[_0x496d('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x496d('0xa')]);router[_0x496d('0x7')](_0x496d('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x496d('0x8')](),controller[_0x496d('0xc')]);router[_0x496d('0xd')](_0x496d('0xb'),auth[_0x496d('0x8')](),controller[_0x496d('0xe')]);router[_0x496d('0xf')]('/:id',auth[_0x496d('0x8')](),controller[_0x496d('0x10')]);module[_0x496d('0x11')]=router;
\ No newline at end of file
+var _0x9276=['/:id','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','get','isAuthenticated','index','describe','show','post','put'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x9276,0x9e));var _0x6927=function(_0x2e7118,_0x589358){_0x2e7118=_0x2e7118-0x0;var _0x245e86=_0x9276[_0x2e7118];return _0x245e86;};'use strict';var multer=require(_0x6927('0x0'));var util=require(_0x6927('0x1'));var path=require(_0x6927('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6927('0x3')]();var auth=require(_0x6927('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x6927('0x5')]('/',auth[_0x6927('0x6')](),controller[_0x6927('0x7')]);router[_0x6927('0x5')]('/describe',auth[_0x6927('0x6')](),controller[_0x6927('0x8')]);router[_0x6927('0x5')]('/:id',auth[_0x6927('0x6')](),controller[_0x6927('0x9')]);router[_0x6927('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6927('0xb')](_0x6927('0xc'),auth[_0x6927('0x6')](),controller[_0x6927('0xd')]);router[_0x6927('0xe')](_0x6927('0xc'),auth[_0x6927('0x6')](),controller[_0x6927('0xf')]);module[_0x6927('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
index 0a9e60d..5debac1 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x76a3=['STRING','TEXT','long','sequelize','exports'];(function(_0x56039b,_0x3de8d8){var _0xc90792=function(_0x300c35){while(--_0x300c35){_0x56039b['push'](_0x56039b['shift']());}};_0xc90792(++_0x3de8d8);}(_0x76a3,0xf8));var _0x376a=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x76a3[_0x754ab4];return _0x34079a;};'use strict';var Sequelize=require(_0x376a('0x0'));module[_0x376a('0x1')]={'question':{'type':Sequelize[_0x376a('0x2')]},'answer':{'type':Sequelize[_0x376a('0x3')](_0x376a('0x4'))},'membername':{'type':Sequelize[_0x376a('0x2')]},'projectname':{'type':Sequelize[_0x376a('0x2')]},'queue':{'type':Sequelize[_0x376a('0x2')]},'uniqueid':{'type':Sequelize[_0x376a('0x2')]},'calleridname':{'type':Sequelize[_0x376a('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xac55=['sequelize','exports','STRING','TEXT'];(function(_0x71cd05,_0x36ac11){var _0x59c9e7=function(_0x5472cd){while(--_0x5472cd){_0x71cd05['push'](_0x71cd05['shift']());}};_0x59c9e7(++_0x36ac11);}(_0xac55,0x1c8));var _0x5ac5=function(_0x176420,_0x54f6b9){_0x176420=_0x176420-0x0;var _0x11d474=_0xac55[_0x176420];return _0x11d474;};'use strict';var Sequelize=require(_0x5ac5('0x0'));module[_0x5ac5('0x1')]={'question':{'type':Sequelize[_0x5ac5('0x2')]},'answer':{'type':Sequelize[_0x5ac5('0x3')]('long')},'membername':{'type':Sequelize[_0x5ac5('0x2')]},'projectname':{'type':Sequelize[_0x5ac5('0x2')]},'queue':{'type':Sequelize[_0x5ac5('0x2')]},'uniqueid':{'type':Sequelize[_0x5ac5('0x2')]},'calleridname':{'type':Sequelize[_0x5ac5('0x2')]},'calleridnum':{'type':Sequelize[_0x5ac5('0x2')]},'questionId':{'type':Sequelize[_0x5ac5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
index 8c36100..c28806b 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x223d=['../../mysqldb','sendStatus','status','json','offset','set','apply','reject','update','then','destroy','end','error','send','index','JscriptyQuestionReport','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','type','VIRTUAL','field','merge','options','count','include','rows','show','params','includeAll','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','path','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment'];(function(_0x2bdff7,_0x4199dd){var _0x15a40a=function(_0x21d57c){while(--_0x21d57c){_0x2bdff7['push'](_0x2bdff7['shift']());}};_0x15a40a(++_0x4199dd);}(_0x223d,0x13c));var _0xd223=function(_0x5d7624,_0x13c005){_0x5d7624=_0x5d7624-0x0;var _0x2ce86e=_0x223d[_0x5d7624];return _0x2ce86e;};'use strict';var pdf=require(_0xd223('0x0'));var emlformat=require(_0xd223('0x1'));var rimraf=require(_0xd223('0x2'));var zipdir=require(_0xd223('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd223('0x4'));var moment=require(_0xd223('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd223('0x6'));var sox=require('sox');var csv=require(_0xd223('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd223('0x8'));var squel=require(_0xd223('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd223('0xa'));var toCsv=require(_0xd223('0x7'));var querystring=require(_0xd223('0xb'));var Papa=require(_0xd223('0xc'));var Redis=require(_0xd223('0xd'));var authService=require(_0xd223('0xe'));var qs=require(_0xd223('0xf'));var hardwareService=require(_0xd223('0x10'));var logger=require('../../config/logger')(_0xd223('0x11'));var utils=require('../../config/utils');var config=require(_0xd223('0x12'));var db=require(_0xd223('0x13'))['db'];function respondWithStatusCode(_0x24a578,_0x34440c){_0x34440c=_0x34440c||0xcc;return function(_0x51fa9b){if(_0x51fa9b){return _0x24a578[_0xd223('0x14')](_0x34440c);}return _0x24a578['status'](_0x34440c)['end']();};}function respondWithResult(_0xe802e3,_0x367407){_0x367407=_0x367407||0xc8;return function(_0x4db289){if(_0x4db289){return _0xe802e3[_0xd223('0x15')](_0x367407)[_0xd223('0x16')](_0x4db289);}};}function respondWithFilteredResult(_0x2d7598,_0x1f29a3){return function(_0x4082c2){if(_0x4082c2){var _0x463e4c=_0x4082c2['count'],_0x1ccd94=_0x1f29a3[_0xd223('0x17')],_0x4d1c34=_0x1f29a3[_0xd223('0x17')]+_0x1f29a3['limit'],_0x2358ed;if(_0x4d1c34>=_0x463e4c){_0x4d1c34=_0x463e4c;_0x2358ed=0xc8;}else{_0x2358ed=0xce;}_0x2d7598[_0xd223('0x15')](_0x2358ed);return _0x2d7598[_0xd223('0x18')]('Content-Range',_0x1ccd94+'-'+_0x4d1c34+'/'+_0x463e4c)['json'](_0x4082c2);}return null;};}function patchUpdates(_0x118d47){return function(_0x5e9b92){try{jsonpatch[_0xd223('0x19')](_0x5e9b92,_0x118d47,!![]);}catch(_0x4cc002){return BPromise[_0xd223('0x1a')](_0x4cc002);}return _0x5e9b92['save']();};}function saveUpdates(_0x4dad15,_0x5eb898){return function(_0x5dc180){if(_0x5dc180){return _0x5dc180[_0xd223('0x1b')](_0x4dad15)[_0xd223('0x1c')](function(_0x115382){return _0x115382;});}return null;};}function removeEntity(_0x1ab7cf,_0x3b8eca){return function(_0xc1c9){if(_0xc1c9){return _0xc1c9[_0xd223('0x1d')]()[_0xd223('0x1c')](function(){_0x1ab7cf[_0xd223('0x15')](0xcc)[_0xd223('0x1e')]();});}};}function handleEntityNotFound(_0x43cc36,_0x149477){return function(_0x47f012){if(!_0x47f012){_0x43cc36[_0xd223('0x14')](0x194);}return _0x47f012;};}function handleError(_0x35ffe4,_0x4250ed){_0x4250ed=_0x4250ed||0x1f4;return function(_0x267acf){logger[_0xd223('0x1f')](_0x267acf['stack']);if(_0x267acf['name']){delete _0x267acf['name'];}_0x35ffe4['status'](_0x4250ed)[_0xd223('0x20')](_0x267acf);};}exports[_0xd223('0x21')]=function(_0x574210,_0x3aeadc){var _0xa35bca={},_0xe404fc={},_0x5a8332={'count':0x0,'rows':[]};var _0x571a0b=db[_0xd223('0x22')][_0xd223('0x23')];_0xe404fc[_0xd223('0x24')]=_[_0xd223('0x25')](_0x571a0b);_0xe404fc['query']=_[_0xd223('0x25')](_0x574210[_0xd223('0x26')]);_0xe404fc['filters']=_[_0xd223('0x27')](_0xe404fc['model'],_0xe404fc[_0xd223('0x26')]);_0xa35bca[_0xd223('0x28')]=_[_0xd223('0x27')](_0xe404fc[_0xd223('0x24')],qs[_0xd223('0x29')](_0x574210[_0xd223('0x26')]['fields']));_0xa35bca[_0xd223('0x28')]=_0xa35bca[_0xd223('0x28')]['length']?_0xa35bca['attributes']:_0xe404fc['model'];if(!_0x574210['query'][_0xd223('0x2a')](_0xd223('0x2b'))){_0xa35bca[_0xd223('0x2c')]=qs[_0xd223('0x2c')](_0x574210[_0xd223('0x26')][_0xd223('0x2c')]);_0xa35bca[_0xd223('0x17')]=qs['offset'](_0x574210[_0xd223('0x26')][_0xd223('0x17')]);}_0xa35bca[_0xd223('0x2d')]=qs[_0xd223('0x2e')](_0x574210[_0xd223('0x26')][_0xd223('0x2e')]);_0xa35bca[_0xd223('0x2f')]=qs[_0xd223('0x30')](_[_0xd223('0x31')](_0x574210[_0xd223('0x26')],_0xe404fc[_0xd223('0x30')]));if(_0x574210[_0xd223('0x26')][_0xd223('0x32')]){_0xa35bca['where']=_['merge'](_0xa35bca['where'],{'$or':_['map'](_0x571a0b,function(_0x18dcb2){if(_0x18dcb2[_0xd223('0x33')]['key']!==_0xd223('0x34')){var _0x36bb5c={};_0x36bb5c[_0x18dcb2[_0xd223('0x35')]]={'$like':'%'+_0x574210[_0xd223('0x26')][_0xd223('0x32')]+'%'};return _0x36bb5c;}})});}_0xa35bca=_[_0xd223('0x36')]({},_0xa35bca,_0x574210[_0xd223('0x37')]);var _0x152534={'where':_0xa35bca[_0xd223('0x2f')]};return db[_0xd223('0x22')][_0xd223('0x38')](_0x152534)['then'](function(_0x37e851){_0x5a8332[_0xd223('0x38')]=_0x37e851;if(_0x574210['query']['includeAll']){_0xa35bca[_0xd223('0x39')]=[{'all':!![]}];}return db[_0xd223('0x22')]['findAll'](_0xa35bca);})[_0xd223('0x1c')](function(_0x5c1971){_0x5a8332[_0xd223('0x3a')]=_0x5c1971;return _0x5a8332;})['then'](respondWithFilteredResult(_0x3aeadc,_0xa35bca))['catch'](handleError(_0x3aeadc,null));};exports[_0xd223('0x3b')]=function(_0x167579,_0x5074fb){var _0x30ed89={'raw':!![],'where':{'id':_0x167579[_0xd223('0x3c')]['id']}},_0x5f2da9={};_0x5f2da9[_0xd223('0x24')]=_[_0xd223('0x25')](db[_0xd223('0x22')]['rawAttributes']);_0x5f2da9[_0xd223('0x26')]=_[_0xd223('0x25')](_0x167579[_0xd223('0x26')]);_0x5f2da9[_0xd223('0x30')]=_[_0xd223('0x27')](_0x5f2da9[_0xd223('0x24')],_0x5f2da9[_0xd223('0x26')]);_0x30ed89['attributes']=_['intersection'](_0x5f2da9[_0xd223('0x24')],qs[_0xd223('0x29')](_0x167579[_0xd223('0x26')][_0xd223('0x29')]));_0x30ed89[_0xd223('0x28')]=_0x30ed89[_0xd223('0x28')]['length']?_0x30ed89[_0xd223('0x28')]:_0x5f2da9[_0xd223('0x24')];if(_0x167579['query'][_0xd223('0x3d')]){_0x30ed89['include']=[{'all':!![]}];}_0x30ed89=_[_0xd223('0x36')]({},_0x30ed89,_0x167579[_0xd223('0x37')]);return db[_0xd223('0x22')][_0xd223('0x3e')](_0x30ed89)[_0xd223('0x1c')](handleEntityNotFound(_0x5074fb,null))[_0xd223('0x1c')](respondWithResult(_0x5074fb,null))[_0xd223('0x3f')](handleError(_0x5074fb,null));};exports[_0xd223('0x40')]=function(_0xc6217f,_0x58b166){return db[_0xd223('0x22')][_0xd223('0x40')](_0xc6217f['body'],{})[_0xd223('0x1c')](respondWithResult(_0x58b166,0xc9))[_0xd223('0x3f')](handleError(_0x58b166,null));};exports[_0xd223('0x1b')]=function(_0x4cd1a5,_0x4ded35){if(_0x4cd1a5[_0xd223('0x41')]['id']){delete _0x4cd1a5[_0xd223('0x41')]['id'];}return db[_0xd223('0x22')][_0xd223('0x3e')]({'where':{'id':_0x4cd1a5[_0xd223('0x3c')]['id']}})[_0xd223('0x1c')](handleEntityNotFound(_0x4ded35,null))[_0xd223('0x1c')](saveUpdates(_0x4cd1a5[_0xd223('0x41')],null))['then'](respondWithResult(_0x4ded35,null))[_0xd223('0x3f')](handleError(_0x4ded35,null));};exports['destroy']=function(_0x2b9c92,_0x391a87){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x2b9c92['params']['id']}})[_0xd223('0x1c')](handleEntityNotFound(_0x391a87,null))['then'](removeEntity(_0x391a87,null))['catch'](handleError(_0x391a87,null));};exports[_0xd223('0x42')]=function(_0x3c0c13,_0x576651){return db['JscriptyQuestionReport']['describe']()['then'](respondWithResult(_0x576651,null))[_0xd223('0x3f')](handleError(_0x576651,null));};
\ No newline at end of file
+var _0x4591=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','destroy','end','error','stack','name','send','index','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','map','type','VIRTUAL','field','JscriptyQuestionReport','includeAll','include','findAll','catch','show','params','rawAttributes','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x5e52fb,_0xc22fca){var _0x22e1ca=function(_0x3b8d36){while(--_0x3b8d36){_0x5e52fb['push'](_0x5e52fb['shift']());}};_0x22e1ca(++_0xc22fca);}(_0x4591,0x168));var _0x1459=function(_0x36682f,_0x34e95e){_0x36682f=_0x36682f-0x0;var _0x22ec9b=_0x4591[_0x36682f];return _0x22ec9b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1459('0x0'));var rimraf=require(_0x1459('0x1'));var zipdir=require(_0x1459('0x2'));var jsonpatch=require(_0x1459('0x3'));var rp=require(_0x1459('0x4'));var moment=require(_0x1459('0x5'));var BPromise=require(_0x1459('0x6'));var Mustache=require(_0x1459('0x7'));var util=require(_0x1459('0x8'));var path=require('path');var sox=require(_0x1459('0x9'));var csv=require(_0x1459('0xa'));var ejs=require(_0x1459('0xb'));var fs=require('fs');var _=require(_0x1459('0xc'));var squel=require('squel');var crypto=require(_0x1459('0xd'));var jsforce=require(_0x1459('0xe'));var deskjs=require(_0x1459('0xf'));var toCsv=require(_0x1459('0xa'));var querystring=require(_0x1459('0x10'));var Papa=require('papaparse');var Redis=require(_0x1459('0x11'));var authService=require(_0x1459('0x12'));var qs=require(_0x1459('0x13'));var hardwareService=require(_0x1459('0x14'));var logger=require(_0x1459('0x15'))(_0x1459('0x16'));var utils=require(_0x1459('0x17'));var config=require('../../config/environment');var db=require(_0x1459('0x18'))['db'];function respondWithStatusCode(_0x4e99a4,_0x49d6f0){_0x49d6f0=_0x49d6f0||0xcc;return function(_0x3dd5c4){if(_0x3dd5c4){return _0x4e99a4[_0x1459('0x19')](_0x49d6f0);}return _0x4e99a4[_0x1459('0x1a')](_0x49d6f0)['end']();};}function respondWithResult(_0x6d6dad,_0x5b9e9a){_0x5b9e9a=_0x5b9e9a||0xc8;return function(_0x217c3c){if(_0x217c3c){return _0x6d6dad[_0x1459('0x1a')](_0x5b9e9a)[_0x1459('0x1b')](_0x217c3c);}};}function respondWithFilteredResult(_0x839223,_0x1ed782){return function(_0x4237b2){if(_0x4237b2){var _0x3857a6=_0x4237b2[_0x1459('0x1c')],_0x7b1647=_0x1ed782[_0x1459('0x1d')],_0xa1474e=_0x1ed782['offset']+_0x1ed782[_0x1459('0x1e')],_0x38a3cb;if(_0xa1474e>=_0x3857a6){_0xa1474e=_0x3857a6;_0x38a3cb=0xc8;}else{_0x38a3cb=0xce;}_0x839223[_0x1459('0x1a')](_0x38a3cb);return _0x839223[_0x1459('0x1f')]('Content-Range',_0x7b1647+'-'+_0xa1474e+'/'+_0x3857a6)[_0x1459('0x1b')](_0x4237b2);}return null;};}function patchUpdates(_0x943a06){return function(_0xa6a795){try{jsonpatch[_0x1459('0x20')](_0xa6a795,_0x943a06,!![]);}catch(_0x2e5d9c){return BPromise[_0x1459('0x21')](_0x2e5d9c);}return _0xa6a795['save']();};}function saveUpdates(_0x33f14a,_0xe4d825){return function(_0x4c4cd7){if(_0x4c4cd7){return _0x4c4cd7[_0x1459('0x22')](_0x33f14a)[_0x1459('0x23')](function(_0x479019){return _0x479019;});}return null;};}function removeEntity(_0x5a1db2,_0x906300){return function(_0x2424e1){if(_0x2424e1){return _0x2424e1[_0x1459('0x24')]()[_0x1459('0x23')](function(){_0x5a1db2[_0x1459('0x1a')](0xcc)[_0x1459('0x25')]();});}};}function handleEntityNotFound(_0x5e196e,_0x20c113){return function(_0x62fd9c){if(!_0x62fd9c){_0x5e196e['sendStatus'](0x194);}return _0x62fd9c;};}function handleError(_0x4ebb9c,_0x35b99d){_0x35b99d=_0x35b99d||0x1f4;return function(_0x17f800){logger[_0x1459('0x26')](_0x17f800[_0x1459('0x27')]);if(_0x17f800[_0x1459('0x28')]){delete _0x17f800['name'];}_0x4ebb9c['status'](_0x35b99d)[_0x1459('0x29')](_0x17f800);};}exports[_0x1459('0x2a')]=function(_0x3dc97f,_0x2b74c2){var _0xf57429={},_0x13975e={},_0x4fec3d={'count':0x0,'rows':[]};var _0x30af99=db['JscriptyQuestionReport']['rawAttributes'];_0x13975e[_0x1459('0x2b')]=_['keys'](_0x30af99);_0x13975e[_0x1459('0x2c')]=_[_0x1459('0x2d')](_0x3dc97f[_0x1459('0x2c')]);_0x13975e['filters']=_['intersection'](_0x13975e['model'],_0x13975e[_0x1459('0x2c')]);_0xf57429[_0x1459('0x2e')]=_[_0x1459('0x2f')](_0x13975e[_0x1459('0x2b')],qs[_0x1459('0x30')](_0x3dc97f[_0x1459('0x2c')][_0x1459('0x30')]));_0xf57429[_0x1459('0x2e')]=_0xf57429['attributes'][_0x1459('0x31')]?_0xf57429['attributes']:_0x13975e[_0x1459('0x2b')];if(!_0x3dc97f[_0x1459('0x2c')][_0x1459('0x32')](_0x1459('0x33'))){_0xf57429['limit']=qs[_0x1459('0x1e')](_0x3dc97f[_0x1459('0x2c')]['limit']);_0xf57429[_0x1459('0x1d')]=qs[_0x1459('0x1d')](_0x3dc97f[_0x1459('0x2c')][_0x1459('0x1d')]);}_0xf57429[_0x1459('0x34')]=qs['sort'](_0x3dc97f[_0x1459('0x2c')]['sort']);_0xf57429[_0x1459('0x35')]=qs[_0x1459('0x36')](_[_0x1459('0x37')](_0x3dc97f[_0x1459('0x2c')],_0x13975e[_0x1459('0x36')]));if(_0x3dc97f['query'][_0x1459('0x38')]){_0xf57429['where']=_[_0x1459('0x39')](_0xf57429[_0x1459('0x35')],{'$or':_[_0x1459('0x3a')](_0x30af99,function(_0x5d6c18){if(_0x5d6c18[_0x1459('0x3b')]['key']!==_0x1459('0x3c')){var _0xc9dff7={};_0xc9dff7[_0x5d6c18[_0x1459('0x3d')]]={'$like':'%'+_0x3dc97f[_0x1459('0x2c')][_0x1459('0x38')]+'%'};return _0xc9dff7;}})});}_0xf57429=_['merge']({},_0xf57429,_0x3dc97f['options']);var _0x154619={'where':_0xf57429[_0x1459('0x35')]};return db[_0x1459('0x3e')][_0x1459('0x1c')](_0x154619)[_0x1459('0x23')](function(_0x5c0740){_0x4fec3d[_0x1459('0x1c')]=_0x5c0740;if(_0x3dc97f[_0x1459('0x2c')][_0x1459('0x3f')]){_0xf57429[_0x1459('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x1459('0x41')](_0xf57429);})[_0x1459('0x23')](function(_0x14d5ff){_0x4fec3d['rows']=_0x14d5ff;return _0x4fec3d;})['then'](respondWithFilteredResult(_0x2b74c2,_0xf57429))[_0x1459('0x42')](handleError(_0x2b74c2,null));};exports[_0x1459('0x43')]=function(_0x5bdbee,_0x5c7ec5){var _0x39f7df={'raw':!![],'where':{'id':_0x5bdbee[_0x1459('0x44')]['id']}},_0x54d0f3={};_0x54d0f3[_0x1459('0x2b')]=_[_0x1459('0x2d')](db['JscriptyQuestionReport'][_0x1459('0x45')]);_0x54d0f3[_0x1459('0x2c')]=_[_0x1459('0x2d')](_0x5bdbee[_0x1459('0x2c')]);_0x54d0f3['filters']=_[_0x1459('0x2f')](_0x54d0f3[_0x1459('0x2b')],_0x54d0f3[_0x1459('0x2c')]);_0x39f7df[_0x1459('0x2e')]=_[_0x1459('0x2f')](_0x54d0f3[_0x1459('0x2b')],qs['fields'](_0x5bdbee[_0x1459('0x2c')]['fields']));_0x39f7df[_0x1459('0x2e')]=_0x39f7df['attributes'][_0x1459('0x31')]?_0x39f7df[_0x1459('0x2e')]:_0x54d0f3[_0x1459('0x2b')];if(_0x5bdbee['query'][_0x1459('0x3f')]){_0x39f7df[_0x1459('0x40')]=[{'all':!![]}];}_0x39f7df=_[_0x1459('0x39')]({},_0x39f7df,_0x5bdbee[_0x1459('0x46')]);return db[_0x1459('0x3e')]['find'](_0x39f7df)[_0x1459('0x23')](handleEntityNotFound(_0x5c7ec5,null))[_0x1459('0x23')](respondWithResult(_0x5c7ec5,null))['catch'](handleError(_0x5c7ec5,null));};exports[_0x1459('0x47')]=function(_0x26e69b,_0x33a9a3){return db[_0x1459('0x3e')][_0x1459('0x47')](_0x26e69b[_0x1459('0x48')],{})['then'](respondWithResult(_0x33a9a3,0xc9))['catch'](handleError(_0x33a9a3,null));};exports[_0x1459('0x22')]=function(_0x3b86fa,_0x37c64b){if(_0x3b86fa['body']['id']){delete _0x3b86fa[_0x1459('0x48')]['id'];}return db[_0x1459('0x3e')][_0x1459('0x49')]({'where':{'id':_0x3b86fa[_0x1459('0x44')]['id']}})[_0x1459('0x23')](handleEntityNotFound(_0x37c64b,null))[_0x1459('0x23')](saveUpdates(_0x3b86fa[_0x1459('0x48')],null))['then'](respondWithResult(_0x37c64b,null))['catch'](handleError(_0x37c64b,null));};exports['destroy']=function(_0x528be2,_0x141960){return db[_0x1459('0x3e')][_0x1459('0x49')]({'where':{'id':_0x528be2[_0x1459('0x44')]['id']}})[_0x1459('0x23')](handleEntityNotFound(_0x141960,null))[_0x1459('0x23')](removeEntity(_0x141960,null))[_0x1459('0x42')](handleError(_0x141960,null));};exports['describe']=function(_0x2a520b,_0x1cea4b){return db['JscriptyQuestionReport'][_0x1459('0x4a')]()['then'](respondWithResult(_0x1cea4b,null))[_0x1459('0x42')](handleError(_0x1cea4b,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
index 69a57ed..997d48d 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc1c9=['../../config/logger','api','moment','bluebird','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','util'];(function(_0x32d06f,_0x430045){var _0x4bda1c=function(_0x49cf4b){while(--_0x49cf4b){_0x32d06f['push'](_0x32d06f['shift']());}};_0x4bda1c(++_0x430045);}(_0xc1c9,0x1de));var _0x9c1c=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0xc1c9[_0x531cb8];return _0x5cf297;};'use strict';var _=require(_0x9c1c('0x0'));var util=require(_0x9c1c('0x1'));var logger=require(_0x9c1c('0x2'))(_0x9c1c('0x3'));var moment=require(_0x9c1c('0x4'));var BPromise=require(_0x9c1c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c1c('0x6'));var rimraf=require('rimraf');var config=require(_0x9c1c('0x7'));var attributes=require(_0x9c1c('0x8'));module[_0x9c1c('0x9')]=function(_0x1a85df,_0x48411d){return _0x1a85df[_0x9c1c('0xa')](_0x9c1c('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22f1=['rimraf','./jscriptyQuestionReport.attributes','define','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5d2ffc,_0x3c36d6){var _0x2e0360=function(_0x5ec851){while(--_0x5ec851){_0x5d2ffc['push'](_0x5d2ffc['shift']());}};_0x2e0360(++_0x3c36d6);}(_0x22f1,0xd0));var _0x122f=function(_0x3ae510,_0x97ebaa){_0x3ae510=_0x3ae510-0x0;var _0x36b888=_0x22f1[_0x3ae510];return _0x36b888;};'use strict';var _=require(_0x122f('0x0'));var util=require(_0x122f('0x1'));var logger=require(_0x122f('0x2'))(_0x122f('0x3'));var moment=require(_0x122f('0x4'));var BPromise=require(_0x122f('0x5'));var rp=require(_0x122f('0x6'));var fs=require('fs');var path=require(_0x122f('0x7'));var rimraf=require(_0x122f('0x8'));var config=require('../../config/environment');var attributes=require(_0x122f('0x9'));module['exports']=function(_0x39e9e8,_0x163971){return _0x39e9e8[_0x122f('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x122f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
index 1664895..5c476ca 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd4a4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd4a4,0x195));var _0x4d4a=function(_0x27f7bf,_0x2d897e){_0x27f7bf=_0x27f7bf-0x0;var _0x30c6c4=_0xd4a4[_0x27f7bf];return _0x30c6c4;};'use strict';var _=require(_0x4d4a('0x0'));var util=require(_0x4d4a('0x1'));var moment=require(_0x4d4a('0x2'));var BPromise=require(_0x4d4a('0x3'));var rs=require(_0x4d4a('0x4'));var fs=require('fs');var Redis=require(_0x4d4a('0x5'));var db=require(_0x4d4a('0x6'))['db'];var utils=require(_0x4d4a('0x7'));var logger=require(_0x4d4a('0x8'))(_0x4d4a('0x9'));var config=require(_0x4d4a('0xa'));var jayson=require(_0x4d4a('0xb'));var client=jayson[_0x4d4a('0xc')][_0x4d4a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xa046bc,_0x1ece4d,_0x3906e7){return new BPromise(function(_0xdd510,_0x2fb223){return client[_0x4d4a('0xe')](_0xa046bc,_0x3906e7)['then'](function(_0x52a57e){logger[_0x4d4a('0xf')](_0x4d4a('0x10'),_0x1ece4d,_0x4d4a('0x11'));logger[_0x4d4a('0x12')](_0x4d4a('0x13'),_0x1ece4d,'request\x20sent',JSON[_0x4d4a('0x14')](_0x52a57e));if(_0x52a57e['error']){if(_0x52a57e[_0x4d4a('0x15')]['code']===0x1f4){logger[_0x4d4a('0x15')](_0x4d4a('0x10'),_0x1ece4d,_0x52a57e[_0x4d4a('0x15')][_0x4d4a('0x16')]);return _0x2fb223(_0x52a57e['error'][_0x4d4a('0x16')]);}logger[_0x4d4a('0x15')](_0x4d4a('0x10'),_0x1ece4d,_0x52a57e[_0x4d4a('0x15')][_0x4d4a('0x16')]);return _0xdd510(_0x52a57e[_0x4d4a('0x15')][_0x4d4a('0x16')]);}else{logger['info'](_0x4d4a('0x10'),_0x1ece4d,_0x4d4a('0x11'));_0xdd510(_0x52a57e['result'][_0x4d4a('0x16')]);}})[_0x4d4a('0x17')](function(_0x53d616){logger['error'](_0x4d4a('0x10'),_0x1ece4d,_0x53d616);_0x2fb223(_0x53d616);});});}
\ No newline at end of file
+var _0xe9a8=['rpc','jayson/promise','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x5e6939,_0x3dcd8a){var _0x45d3f1=function(_0x23c33f){while(--_0x23c33f){_0x5e6939['push'](_0x5e6939['shift']());}};_0x45d3f1(++_0x3dcd8a);}(_0xe9a8,0x1ee));var _0x8e9a=function(_0x2e8e7b,_0x5e4613){_0x2e8e7b=_0x2e8e7b-0x0;var _0x15fdab=_0xe9a8[_0x2e8e7b];return _0x15fdab;};'use strict';var _=require('lodash');var util=require(_0x8e9a('0x0'));var moment=require(_0x8e9a('0x1'));var BPromise=require(_0x8e9a('0x2'));var rs=require(_0x8e9a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e9a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9a('0x5'))(_0x8e9a('0x6'));var config=require('../../config/environment');var jayson=require(_0x8e9a('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21a7a2,_0x531d69,_0x32d1a7){return new BPromise(function(_0x11cad9,_0x56b835){return client[_0x8e9a('0x8')](_0x21a7a2,_0x32d1a7)[_0x8e9a('0x9')](function(_0x3e21a3){logger[_0x8e9a('0xa')](_0x8e9a('0xb'),_0x531d69,_0x8e9a('0xc'));logger[_0x8e9a('0xd')](_0x8e9a('0xe'),_0x531d69,'request\x20sent',JSON[_0x8e9a('0xf')](_0x3e21a3));if(_0x3e21a3['error']){if(_0x3e21a3[_0x8e9a('0x10')]['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x531d69,_0x3e21a3[_0x8e9a('0x10')][_0x8e9a('0x11')]);return _0x56b835(_0x3e21a3['error'][_0x8e9a('0x11')]);}logger[_0x8e9a('0x10')](_0x8e9a('0xb'),_0x531d69,_0x3e21a3[_0x8e9a('0x10')][_0x8e9a('0x11')]);return _0x11cad9(_0x3e21a3[_0x8e9a('0x10')][_0x8e9a('0x11')]);}else{logger[_0x8e9a('0xa')](_0x8e9a('0xb'),_0x531d69,'request\x20sent');_0x11cad9(_0x3e21a3[_0x8e9a('0x12')][_0x8e9a('0x11')]);}})[_0x8e9a('0x13')](function(_0x55c7af){logger[_0x8e9a('0x10')](_0x8e9a('0xb'),_0x531d69,_0x55c7af);_0x56b835(_0x55c7af);});});}
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js
index ce13873..14d92fa 100644
--- a/server/api/jscriptySessionReport/index.js
+++ b/server/api/jscriptySessionReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9d0f=['getQuestions','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe','show','/:id/questions'];(function(_0x2dcc94,_0x290ad1){var _0x3c9567=function(_0x5f15ea){while(--_0x5f15ea){_0x2dcc94['push'](_0x2dcc94['shift']());}};_0x3c9567(++_0x290ad1);}(_0x9d0f,0x134));var _0xf9d0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9d0f[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0xf9d0('0x0'));var path=require(_0xf9d0('0x1'));var timeout=require(_0xf9d0('0x2'));var express=require(_0xf9d0('0x3'));var router=express[_0xf9d0('0x4')]();var auth=require(_0xf9d0('0x5'));var interaction=require(_0xf9d0('0x6'));var config=require(_0xf9d0('0x7'));var controller=require(_0xf9d0('0x8'));router[_0xf9d0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf9d0('0x9')]('/describe',auth[_0xf9d0('0xa')](),controller[_0xf9d0('0xb')]);router[_0xf9d0('0x9')]('/:id',auth[_0xf9d0('0xa')](),controller[_0xf9d0('0xc')]);router[_0xf9d0('0x9')](_0xf9d0('0xd'),auth[_0xf9d0('0xa')](),controller[_0xf9d0('0xe')]);router[_0xf9d0('0xf')]('/',auth[_0xf9d0('0xa')](),controller[_0xf9d0('0x10')]);router[_0xf9d0('0x11')](_0xf9d0('0x12'),auth['isAuthenticated'](),controller[_0xf9d0('0x13')]);router[_0xf9d0('0x14')](_0xf9d0('0x12'),auth['isAuthenticated'](),controller[_0xf9d0('0x15')]);module[_0xf9d0('0x16')]=router;
\ No newline at end of file
+var _0xde7f=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','create','put','update','delete'];(function(_0xc06535,_0x5570f8){var _0x1dac7b=function(_0xaf5942){while(--_0xaf5942){_0xc06535['push'](_0xc06535['shift']());}};_0x1dac7b(++_0x5570f8);}(_0xde7f,0xc8));var _0xfde7=function(_0x8aa126,_0xb4df87){_0x8aa126=_0x8aa126-0x0;var _0x2ba64a=_0xde7f[_0x8aa126];return _0x2ba64a;};'use strict';var multer=require('multer');var util=require(_0xfde7('0x0'));var path=require(_0xfde7('0x1'));var timeout=require(_0xfde7('0x2'));var express=require(_0xfde7('0x3'));var router=express[_0xfde7('0x4')]();var auth=require(_0xfde7('0x5'));var interaction=require(_0xfde7('0x6'));var config=require(_0xfde7('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0xfde7('0x8')]('/',auth[_0xfde7('0x9')](),controller[_0xfde7('0xa')]);router['get'](_0xfde7('0xb'),auth['isAuthenticated'](),controller[_0xfde7('0xc')]);router[_0xfde7('0x8')](_0xfde7('0xd'),auth[_0xfde7('0x9')](),controller[_0xfde7('0xe')]);router['get'](_0xfde7('0xf'),auth[_0xfde7('0x9')](),controller['getQuestions']);router['post']('/',auth[_0xfde7('0x9')](),controller[_0xfde7('0x10')]);router[_0xfde7('0x11')](_0xfde7('0xd'),auth[_0xfde7('0x9')](),controller[_0xfde7('0x12')]);router[_0xfde7('0x13')](_0xfde7('0xd'),auth[_0xfde7('0x9')](),controller[_0xfde7('0x14')]);module[_0xfde7('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
index 5efbd0c..06e106a 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ae9=['BOOLEAN','moment','sequelize','setDataValue','starttime','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING'];(function(_0x5629ca,_0x18796a){var _0x2f5b84=function(_0x3473a4){while(--_0x3473a4){_0x5629ca['push'](_0x5629ca['shift']());}};_0x2f5b84(++_0x18796a);}(_0x8ae9,0x179));var _0x98ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ae9[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x98ae('0x0'));var Sequelize=require(_0x98ae('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x4a1157){this[_0x98ae('0x2')](_0x98ae('0x3'),_0x4a1157);this[_0x98ae('0x2')]('endtime',moment()['format'](_0x98ae('0x4')));}},'endtime':{'type':Sequelize[_0x98ae('0x5')]},'membername':{'type':Sequelize[_0x98ae('0x6')]},'projectname':{'type':Sequelize[_0x98ae('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x98ae('0x6')]},'calleridname':{'type':Sequelize[_0x98ae('0x6')]},'calleridnum':{'type':Sequelize[_0x98ae('0x6')]},'completed':{'type':Sequelize[_0x98ae('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5c32=['setDataValue','endtime','format','STRING','moment','sequelize','exports','DATE','starttime'];(function(_0x5dfbec,_0x5f5760){var _0x3d4870=function(_0x516b42){while(--_0x516b42){_0x5dfbec['push'](_0x5dfbec['shift']());}};_0x3d4870(++_0x5f5760);}(_0x5c32,0xd3));var _0x25c3=function(_0x5010c6,_0x3be11b){_0x5010c6=_0x5010c6-0x0;var _0x306946=_0x5c32[_0x5010c6];return _0x306946;};'use strict';var moment=require(_0x25c3('0x0'));var Sequelize=require(_0x25c3('0x1'));module[_0x25c3('0x2')]={'starttime':{'type':Sequelize[_0x25c3('0x3')],'set':function(_0x539715){this['setDataValue'](_0x25c3('0x4'),_0x539715);this[_0x25c3('0x5')](_0x25c3('0x6'),moment()[_0x25c3('0x7')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x25c3('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x25c3('0x8')]},'queue':{'type':Sequelize[_0x25c3('0x8')]},'uniqueid':{'type':Sequelize[_0x25c3('0x8')]},'calleridname':{'type':Sequelize[_0x25c3('0x8')]},'calleridnum':{'type':Sequelize[_0x25c3('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js
index 0cb7f5f..b253b27 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x11f7=['query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','key','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','pick','SessionId','map','html-pdf','bluebird','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','JscriptySessionReport','rawAttributes','model','keys'];(function(_0x73f596,_0x33ac7c){var _0x4117b3=function(_0x287a34){while(--_0x287a34){_0x73f596['push'](_0x73f596['shift']());}};_0x4117b3(++_0x33ac7c);}(_0x11f7,0xaf));var _0x711f=function(_0x2416cf,_0x58403f){_0x2416cf=_0x2416cf-0x0;var _0x42bc02=_0x11f7[_0x2416cf];return _0x42bc02;};'use strict';var pdf=require(_0x711f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x711f('0x1'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x711f('0x2'));var ejs=require(_0x711f('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x711f('0x4'));var crypto=require(_0x711f('0x5'));var jsforce=require(_0x711f('0x6'));var deskjs=require('desk.js');var toCsv=require(_0x711f('0x2'));var querystring=require(_0x711f('0x7'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x711f('0x8'));var qs=require(_0x711f('0x9'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x711f('0xa'))(_0x711f('0xb'));var utils=require(_0x711f('0xc'));var config=require(_0x711f('0xd'));var db=require(_0x711f('0xe'))['db'];function respondWithStatusCode(_0x40a6d9,_0x57d93a){_0x57d93a=_0x57d93a||0xcc;return function(_0x2ee66f){if(_0x2ee66f){return _0x40a6d9[_0x711f('0xf')](_0x57d93a);}return _0x40a6d9[_0x711f('0x10')](_0x57d93a)[_0x711f('0x11')]();};}function respondWithResult(_0x2213e5,_0x3d0832){_0x3d0832=_0x3d0832||0xc8;return function(_0x731709){if(_0x731709){return _0x2213e5['status'](_0x3d0832)[_0x711f('0x12')](_0x731709);}};}function respondWithFilteredResult(_0x371c2f,_0x3df69f){return function(_0x34d7db){if(_0x34d7db){var _0x557e7c=_0x34d7db[_0x711f('0x13')],_0x7f3233=_0x3df69f[_0x711f('0x14')],_0x287264=_0x3df69f['offset']+_0x3df69f['limit'],_0x5dd22c;if(_0x287264>=_0x557e7c){_0x287264=_0x557e7c;_0x5dd22c=0xc8;}else{_0x5dd22c=0xce;}_0x371c2f[_0x711f('0x10')](_0x5dd22c);return _0x371c2f[_0x711f('0x15')](_0x711f('0x16'),_0x7f3233+'-'+_0x287264+'/'+_0x557e7c)['json'](_0x34d7db);}return null;};}function patchUpdates(_0x38095b){return function(_0x14f021){try{jsonpatch[_0x711f('0x17')](_0x14f021,_0x38095b,!![]);}catch(_0x575b2b){return BPromise[_0x711f('0x18')](_0x575b2b);}return _0x14f021[_0x711f('0x19')]();};}function saveUpdates(_0x5b73a6,_0x1cc8e5){return function(_0x3c2c79){if(_0x3c2c79){return _0x3c2c79[_0x711f('0x1a')](_0x5b73a6)['then'](function(_0x38391a){return _0x38391a;});}return null;};}function removeEntity(_0x478f67,_0xa88232){return function(_0xa4a501){if(_0xa4a501){return _0xa4a501[_0x711f('0x1b')]()[_0x711f('0x1c')](function(){_0x478f67[_0x711f('0x10')](0xcc)[_0x711f('0x11')]();});}};}function handleEntityNotFound(_0x53c861,_0x5e794d){return function(_0x45658f){if(!_0x45658f){_0x53c861[_0x711f('0xf')](0x194);}return _0x45658f;};}function handleError(_0x57b7c4,_0x45f69a){_0x45f69a=_0x45f69a||0x1f4;return function(_0x232e40){logger[_0x711f('0x1d')](_0x232e40[_0x711f('0x1e')]);if(_0x232e40[_0x711f('0x1f')]){delete _0x232e40[_0x711f('0x1f')];}_0x57b7c4[_0x711f('0x10')](_0x45f69a)[_0x711f('0x20')](_0x232e40);};}exports[_0x711f('0x21')]=function(_0x27ebd1,_0x5b8c20){var _0x1b77b6={},_0x2fc9e3={},_0x3d33df={'count':0x0,'rows':[]};var _0x154ccb=db[_0x711f('0x22')][_0x711f('0x23')];_0x2fc9e3[_0x711f('0x24')]=_[_0x711f('0x25')](_0x154ccb);_0x2fc9e3[_0x711f('0x26')]=_[_0x711f('0x25')](_0x27ebd1[_0x711f('0x26')]);_0x2fc9e3['filters']=_[_0x711f('0x27')](_0x2fc9e3[_0x711f('0x24')],_0x2fc9e3[_0x711f('0x26')]);_0x1b77b6[_0x711f('0x28')]=_[_0x711f('0x27')](_0x2fc9e3['model'],qs[_0x711f('0x29')](_0x27ebd1[_0x711f('0x26')]['fields']));_0x1b77b6['attributes']=_0x1b77b6['attributes'][_0x711f('0x2a')]?_0x1b77b6[_0x711f('0x28')]:_0x2fc9e3[_0x711f('0x24')];if(!_0x27ebd1[_0x711f('0x26')][_0x711f('0x2b')]('nolimit')){_0x1b77b6[_0x711f('0x2c')]=qs[_0x711f('0x2c')](_0x27ebd1[_0x711f('0x26')]['limit']);_0x1b77b6[_0x711f('0x14')]=qs['offset'](_0x27ebd1['query'][_0x711f('0x14')]);}_0x1b77b6[_0x711f('0x2d')]=qs[_0x711f('0x2e')](_0x27ebd1[_0x711f('0x26')][_0x711f('0x2e')]);_0x1b77b6[_0x711f('0x2f')]=qs[_0x711f('0x30')](_['pick'](_0x27ebd1[_0x711f('0x26')],_0x2fc9e3[_0x711f('0x30')]));if(_0x27ebd1['query'][_0x711f('0x31')]){_0x1b77b6['where']=_[_0x711f('0x32')](_0x1b77b6[_0x711f('0x2f')],{'$or':_['map'](_0x154ccb,function(_0x467089){if(_0x467089['type'][_0x711f('0x33')]!=='VIRTUAL'){var _0x2bee77={};_0x2bee77[_0x467089['field']]={'$like':'%'+_0x27ebd1[_0x711f('0x26')]['filter']+'%'};return _0x2bee77;}})});}_0x1b77b6=_[_0x711f('0x32')]({},_0x1b77b6,_0x27ebd1[_0x711f('0x34')]);var _0x327bd8={'where':_0x1b77b6[_0x711f('0x2f')]};return db[_0x711f('0x22')][_0x711f('0x13')](_0x327bd8)[_0x711f('0x1c')](function(_0x3bc56a){_0x3d33df['count']=_0x3bc56a;if(_0x27ebd1['query'][_0x711f('0x35')]){_0x1b77b6[_0x711f('0x36')]=[{'all':!![]}];}return db[_0x711f('0x22')][_0x711f('0x37')](_0x1b77b6);})[_0x711f('0x1c')](function(_0x3a7e1e){_0x3d33df[_0x711f('0x38')]=_0x3a7e1e;return _0x3d33df;})[_0x711f('0x1c')](respondWithFilteredResult(_0x5b8c20,_0x1b77b6))['catch'](handleError(_0x5b8c20,null));};exports[_0x711f('0x39')]=function(_0x5763ee,_0x3c9d8a){var _0x39331a={'raw':!![],'where':{'id':_0x5763ee['params']['id']}},_0x4ab528={};_0x4ab528['model']=_['keys'](db[_0x711f('0x22')][_0x711f('0x23')]);_0x4ab528['query']=_[_0x711f('0x25')](_0x5763ee[_0x711f('0x26')]);_0x4ab528[_0x711f('0x30')]=_['intersection'](_0x4ab528[_0x711f('0x24')],_0x4ab528[_0x711f('0x26')]);_0x39331a[_0x711f('0x28')]=_[_0x711f('0x27')](_0x4ab528[_0x711f('0x24')],qs[_0x711f('0x29')](_0x5763ee['query']['fields']));_0x39331a[_0x711f('0x28')]=_0x39331a[_0x711f('0x28')][_0x711f('0x2a')]?_0x39331a[_0x711f('0x28')]:_0x4ab528[_0x711f('0x24')];if(_0x5763ee['query'][_0x711f('0x35')]){_0x39331a[_0x711f('0x36')]=[{'all':!![]}];}_0x39331a=_[_0x711f('0x32')]({},_0x39331a,_0x5763ee[_0x711f('0x34')]);return db[_0x711f('0x22')][_0x711f('0x3a')](_0x39331a)['then'](handleEntityNotFound(_0x3c9d8a,null))['then'](respondWithResult(_0x3c9d8a,null))[_0x711f('0x3b')](handleError(_0x3c9d8a,null));};exports[_0x711f('0x3c')]=function(_0x492179,_0x34f9b4){return db[_0x711f('0x22')][_0x711f('0x3c')](_0x492179[_0x711f('0x3d')],{})['then'](respondWithResult(_0x34f9b4,0xc9))[_0x711f('0x3b')](handleError(_0x34f9b4,null));};exports[_0x711f('0x1a')]=function(_0x46e17a,_0x3af6d2){if(_0x46e17a[_0x711f('0x3d')]['id']){delete _0x46e17a[_0x711f('0x3d')]['id'];}return db[_0x711f('0x22')]['find']({'where':{'id':_0x46e17a[_0x711f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3af6d2,null))[_0x711f('0x1c')](saveUpdates(_0x46e17a['body'],null))[_0x711f('0x1c')](respondWithResult(_0x3af6d2,null))[_0x711f('0x3b')](handleError(_0x3af6d2,null));};exports[_0x711f('0x1b')]=function(_0x46e53d,_0x4b157b){return db['JscriptySessionReport'][_0x711f('0x3a')]({'where':{'id':_0x46e53d[_0x711f('0x3e')]['id']}})[_0x711f('0x1c')](handleEntityNotFound(_0x4b157b,null))[_0x711f('0x1c')](removeEntity(_0x4b157b,null))[_0x711f('0x3b')](handleError(_0x4b157b,null));};exports[_0x711f('0x3f')]=function(_0x1e9b53,_0x18cc32){return db[_0x711f('0x22')][_0x711f('0x3f')]()[_0x711f('0x1c')](respondWithResult(_0x18cc32,null))[_0x711f('0x3b')](handleError(_0x18cc32,null));};exports[_0x711f('0x40')]=function(_0x2f2098,_0x413025,_0x48c304){var _0x74b761={'raw':!![],'where':{}};var _0x16a65c={};var _0x3ff667={'count':0x0,'rows':[]};return db[_0x711f('0x22')][_0x711f('0x41')]({'where':{'id':_0x2f2098[_0x711f('0x3e')]['id']}})[_0x711f('0x1c')](handleEntityNotFound(_0x413025,null))[_0x711f('0x1c')](function(_0x23f8cb){if(_0x23f8cb){_0x16a65c['model']=_[_0x711f('0x25')](db[_0x711f('0x42')][_0x711f('0x23')]);_0x16a65c['query']=_[_0x711f('0x25')](_0x2f2098['query']);_0x16a65c[_0x711f('0x30')]=_['intersection'](_0x16a65c[_0x711f('0x24')],_0x16a65c[_0x711f('0x26')]);_0x74b761[_0x711f('0x28')]=_['intersection'](_0x16a65c[_0x711f('0x24')],qs['fields'](_0x2f2098['query']['fields']));_0x74b761['attributes']=_0x74b761[_0x711f('0x28')][_0x711f('0x2a')]?_0x74b761[_0x711f('0x28')]:_0x16a65c[_0x711f('0x24')];if(!_0x2f2098[_0x711f('0x26')][_0x711f('0x2b')](_0x711f('0x43'))){_0x74b761[_0x711f('0x2c')]=qs[_0x711f('0x2c')](_0x2f2098[_0x711f('0x26')][_0x711f('0x2c')]);_0x74b761[_0x711f('0x14')]=qs[_0x711f('0x14')](_0x2f2098[_0x711f('0x26')][_0x711f('0x14')]);}_0x74b761[_0x711f('0x2d')]=qs[_0x711f('0x2e')](_0x2f2098['query'][_0x711f('0x2e')]);_0x74b761['where']=qs[_0x711f('0x30')](_[_0x711f('0x44')](_0x2f2098[_0x711f('0x26')],_0x16a65c[_0x711f('0x30')]));_0x74b761['where'][_0x711f('0x45')]=_0x23f8cb['id'];if(_0x2f2098['query']['filter']){_0x74b761['where']=_[_0x711f('0x32')](_0x74b761[_0x711f('0x2f')],{'$or':_[_0x711f('0x46')](_0x74b761[_0x711f('0x28')],function(_0x2b4101){var _0x48241e={};_0x48241e[_0x2b4101]={'$like':'%'+_0x2f2098['query']['filter']+'%'};return _0x48241e;})});}_0x74b761=_[_0x711f('0x32')]({},_0x74b761,_0x2f2098['options']);return db[_0x711f('0x42')][_0x711f('0x13')]({'where':_0x74b761[_0x711f('0x2f')]})[_0x711f('0x1c')](function(_0x39ffc3){_0x3ff667[_0x711f('0x13')]=_0x39ffc3;if(_0x2f2098['query'][_0x711f('0x35')]){_0x74b761[_0x711f('0x36')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x711f('0x37')](_0x74b761);})[_0x711f('0x1c')](function(_0x33b10e){_0x3ff667[_0x711f('0x38')]=_0x33b10e;return _0x3ff667;});}})[_0x711f('0x1c')](respondWithFilteredResult(_0x413025,_0x74b761))[_0x711f('0x3b')](handleError(_0x413025,null));};
\ No newline at end of file
+var _0xe5c7=['order','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','JscriptySessionReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','merge','map','type','key','field','options','count','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','findOne','JscriptyQuestionReport'];(function(_0x2eaedf,_0x481885){var _0x4b0bf8=function(_0x1feb83){while(--_0x1feb83){_0x2eaedf['push'](_0x2eaedf['shift']());}};_0x4b0bf8(++_0x481885);}(_0xe5c7,0xa1));var _0x7e5c=function(_0x583936,_0x2cb221){_0x583936=_0x583936-0x0;var _0x5daa4d=_0xe5c7[_0x583936];return _0x5daa4d;};'use strict';var pdf=require(_0x7e5c('0x0'));var emlformat=require(_0x7e5c('0x1'));var rimraf=require(_0x7e5c('0x2'));var zipdir=require(_0x7e5c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e5c('0x4'));var moment=require(_0x7e5c('0x5'));var BPromise=require(_0x7e5c('0x6'));var Mustache=require(_0x7e5c('0x7'));var util=require(_0x7e5c('0x8'));var path=require(_0x7e5c('0x9'));var sox=require(_0x7e5c('0xa'));var csv=require(_0x7e5c('0xb'));var ejs=require(_0x7e5c('0xc'));var fs=require('fs');var _=require(_0x7e5c('0xd'));var squel=require('squel');var crypto=require(_0x7e5c('0xe'));var jsforce=require(_0x7e5c('0xf'));var deskjs=require(_0x7e5c('0x10'));var toCsv=require(_0x7e5c('0xb'));var querystring=require(_0x7e5c('0x11'));var Papa=require(_0x7e5c('0x12'));var Redis=require(_0x7e5c('0x13'));var authService=require(_0x7e5c('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7e5c('0x15'));var logger=require(_0x7e5c('0x16'))(_0x7e5c('0x17'));var utils=require(_0x7e5c('0x18'));var config=require(_0x7e5c('0x19'));var db=require(_0x7e5c('0x1a'))['db'];function respondWithStatusCode(_0x5054c7,_0x617b0b){_0x617b0b=_0x617b0b||0xcc;return function(_0x4c5e4c){if(_0x4c5e4c){return _0x5054c7['sendStatus'](_0x617b0b);}return _0x5054c7[_0x7e5c('0x1b')](_0x617b0b)[_0x7e5c('0x1c')]();};}function respondWithResult(_0x5d85be,_0x439861){_0x439861=_0x439861||0xc8;return function(_0x5d3a2e){if(_0x5d3a2e){return _0x5d85be[_0x7e5c('0x1b')](_0x439861)[_0x7e5c('0x1d')](_0x5d3a2e);}};}function respondWithFilteredResult(_0x566d03,_0x4bbc97){return function(_0x22b176){if(_0x22b176){var _0x3e0d83=_0x22b176['count'],_0x1653bf=_0x4bbc97[_0x7e5c('0x1e')],_0x2530cd=_0x4bbc97[_0x7e5c('0x1e')]+_0x4bbc97[_0x7e5c('0x1f')],_0x525759;if(_0x2530cd>=_0x3e0d83){_0x2530cd=_0x3e0d83;_0x525759=0xc8;}else{_0x525759=0xce;}_0x566d03[_0x7e5c('0x1b')](_0x525759);return _0x566d03[_0x7e5c('0x20')](_0x7e5c('0x21'),_0x1653bf+'-'+_0x2530cd+'/'+_0x3e0d83)[_0x7e5c('0x1d')](_0x22b176);}return null;};}function patchUpdates(_0x1199ad){return function(_0x2b553c){try{jsonpatch[_0x7e5c('0x22')](_0x2b553c,_0x1199ad,!![]);}catch(_0x29a311){return BPromise[_0x7e5c('0x23')](_0x29a311);}return _0x2b553c[_0x7e5c('0x24')]();};}function saveUpdates(_0x2b00e9,_0x524637){return function(_0x34c801){if(_0x34c801){return _0x34c801[_0x7e5c('0x25')](_0x2b00e9)[_0x7e5c('0x26')](function(_0x39a9fe){return _0x39a9fe;});}return null;};}function removeEntity(_0x43aae5,_0x41bd40){return function(_0x50a3c0){if(_0x50a3c0){return _0x50a3c0[_0x7e5c('0x27')]()['then'](function(){_0x43aae5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f697f,_0x17c7d9){return function(_0x434aa8){if(!_0x434aa8){_0x1f697f[_0x7e5c('0x28')](0x194);}return _0x434aa8;};}function handleError(_0x9ee2da,_0xec50cd){_0xec50cd=_0xec50cd||0x1f4;return function(_0x40138c){logger[_0x7e5c('0x29')](_0x40138c[_0x7e5c('0x2a')]);if(_0x40138c[_0x7e5c('0x2b')]){delete _0x40138c[_0x7e5c('0x2b')];}_0x9ee2da[_0x7e5c('0x1b')](_0xec50cd)['send'](_0x40138c);};}exports['index']=function(_0x405921,_0x2142b0){var _0x126601={},_0x170193={},_0x14ea09={'count':0x0,'rows':[]};var _0x8a9045=db[_0x7e5c('0x2c')][_0x7e5c('0x2d')];_0x170193[_0x7e5c('0x2e')]=_[_0x7e5c('0x2f')](_0x8a9045);_0x170193[_0x7e5c('0x30')]=_['keys'](_0x405921[_0x7e5c('0x30')]);_0x170193[_0x7e5c('0x31')]=_['intersection'](_0x170193[_0x7e5c('0x2e')],_0x170193[_0x7e5c('0x30')]);_0x126601[_0x7e5c('0x32')]=_[_0x7e5c('0x33')](_0x170193[_0x7e5c('0x2e')],qs[_0x7e5c('0x34')](_0x405921[_0x7e5c('0x30')][_0x7e5c('0x34')]));_0x126601['attributes']=_0x126601[_0x7e5c('0x32')][_0x7e5c('0x35')]?_0x126601[_0x7e5c('0x32')]:_0x170193[_0x7e5c('0x2e')];if(!_0x405921['query'][_0x7e5c('0x36')]('nolimit')){_0x126601[_0x7e5c('0x1f')]=qs[_0x7e5c('0x1f')](_0x405921[_0x7e5c('0x30')][_0x7e5c('0x1f')]);_0x126601[_0x7e5c('0x1e')]=qs['offset'](_0x405921[_0x7e5c('0x30')][_0x7e5c('0x1e')]);}_0x126601['order']=qs[_0x7e5c('0x37')](_0x405921['query'][_0x7e5c('0x37')]);_0x126601['where']=qs[_0x7e5c('0x31')](_[_0x7e5c('0x38')](_0x405921['query'],_0x170193[_0x7e5c('0x31')]));if(_0x405921[_0x7e5c('0x30')][_0x7e5c('0x39')]){_0x126601[_0x7e5c('0x3a')]=_[_0x7e5c('0x3b')](_0x126601[_0x7e5c('0x3a')],{'$or':_[_0x7e5c('0x3c')](_0x8a9045,function(_0x27b3d3){if(_0x27b3d3[_0x7e5c('0x3d')][_0x7e5c('0x3e')]!=='VIRTUAL'){var _0x1c27b7={};_0x1c27b7[_0x27b3d3[_0x7e5c('0x3f')]]={'$like':'%'+_0x405921[_0x7e5c('0x30')][_0x7e5c('0x39')]+'%'};return _0x1c27b7;}})});}_0x126601=_[_0x7e5c('0x3b')]({},_0x126601,_0x405921[_0x7e5c('0x40')]);var _0x4d9eae={'where':_0x126601['where']};return db[_0x7e5c('0x2c')][_0x7e5c('0x41')](_0x4d9eae)[_0x7e5c('0x26')](function(_0x550ac4){_0x14ea09[_0x7e5c('0x41')]=_0x550ac4;if(_0x405921['query'][_0x7e5c('0x42')]){_0x126601['include']=[{'all':!![]}];}return db[_0x7e5c('0x2c')][_0x7e5c('0x43')](_0x126601);})[_0x7e5c('0x26')](function(_0x45db08){_0x14ea09[_0x7e5c('0x44')]=_0x45db08;return _0x14ea09;})[_0x7e5c('0x26')](respondWithFilteredResult(_0x2142b0,_0x126601))['catch'](handleError(_0x2142b0,null));};exports[_0x7e5c('0x45')]=function(_0x3c53b4,_0xf0257a){var _0x18eb15={'raw':!![],'where':{'id':_0x3c53b4[_0x7e5c('0x46')]['id']}},_0x3ca416={};_0x3ca416[_0x7e5c('0x2e')]=_[_0x7e5c('0x2f')](db['JscriptySessionReport'][_0x7e5c('0x2d')]);_0x3ca416['query']=_[_0x7e5c('0x2f')](_0x3c53b4[_0x7e5c('0x30')]);_0x3ca416[_0x7e5c('0x31')]=_[_0x7e5c('0x33')](_0x3ca416['model'],_0x3ca416[_0x7e5c('0x30')]);_0x18eb15[_0x7e5c('0x32')]=_[_0x7e5c('0x33')](_0x3ca416[_0x7e5c('0x2e')],qs[_0x7e5c('0x34')](_0x3c53b4['query'][_0x7e5c('0x34')]));_0x18eb15[_0x7e5c('0x32')]=_0x18eb15[_0x7e5c('0x32')]['length']?_0x18eb15[_0x7e5c('0x32')]:_0x3ca416[_0x7e5c('0x2e')];if(_0x3c53b4[_0x7e5c('0x30')][_0x7e5c('0x42')]){_0x18eb15[_0x7e5c('0x47')]=[{'all':!![]}];}_0x18eb15=_[_0x7e5c('0x3b')]({},_0x18eb15,_0x3c53b4['options']);return db[_0x7e5c('0x2c')][_0x7e5c('0x48')](_0x18eb15)[_0x7e5c('0x26')](handleEntityNotFound(_0xf0257a,null))[_0x7e5c('0x26')](respondWithResult(_0xf0257a,null))[_0x7e5c('0x49')](handleError(_0xf0257a,null));};exports[_0x7e5c('0x4a')]=function(_0x5ce957,_0x339e9c){return db[_0x7e5c('0x2c')]['create'](_0x5ce957[_0x7e5c('0x4b')],{})[_0x7e5c('0x26')](respondWithResult(_0x339e9c,0xc9))['catch'](handleError(_0x339e9c,null));};exports[_0x7e5c('0x25')]=function(_0x3bd449,_0x5914f9){if(_0x3bd449['body']['id']){delete _0x3bd449[_0x7e5c('0x4b')]['id'];}return db[_0x7e5c('0x2c')]['find']({'where':{'id':_0x3bd449[_0x7e5c('0x46')]['id']}})[_0x7e5c('0x26')](handleEntityNotFound(_0x5914f9,null))[_0x7e5c('0x26')](saveUpdates(_0x3bd449['body'],null))[_0x7e5c('0x26')](respondWithResult(_0x5914f9,null))[_0x7e5c('0x49')](handleError(_0x5914f9,null));};exports['destroy']=function(_0x5b53e8,_0x5a1f9a){return db['JscriptySessionReport']['find']({'where':{'id':_0x5b53e8[_0x7e5c('0x46')]['id']}})[_0x7e5c('0x26')](handleEntityNotFound(_0x5a1f9a,null))[_0x7e5c('0x26')](removeEntity(_0x5a1f9a,null))[_0x7e5c('0x49')](handleError(_0x5a1f9a,null));};exports[_0x7e5c('0x4c')]=function(_0x160666,_0xf7fc24){return db[_0x7e5c('0x2c')][_0x7e5c('0x4c')]()[_0x7e5c('0x26')](respondWithResult(_0xf7fc24,null))[_0x7e5c('0x49')](handleError(_0xf7fc24,null));};exports['getQuestions']=function(_0x5694ac,_0x1409af,_0x44e033){var _0x3b3c57={'raw':!![],'where':{}};var _0x4ddfb0={};var _0x406c1a={'count':0x0,'rows':[]};return db[_0x7e5c('0x2c')][_0x7e5c('0x4d')]({'where':{'id':_0x5694ac[_0x7e5c('0x46')]['id']}})[_0x7e5c('0x26')](handleEntityNotFound(_0x1409af,null))['then'](function(_0x5b05c8){if(_0x5b05c8){_0x4ddfb0[_0x7e5c('0x2e')]=_[_0x7e5c('0x2f')](db[_0x7e5c('0x4e')]['rawAttributes']);_0x4ddfb0[_0x7e5c('0x30')]=_[_0x7e5c('0x2f')](_0x5694ac[_0x7e5c('0x30')]);_0x4ddfb0['filters']=_[_0x7e5c('0x33')](_0x4ddfb0[_0x7e5c('0x2e')],_0x4ddfb0['query']);_0x3b3c57[_0x7e5c('0x32')]=_[_0x7e5c('0x33')](_0x4ddfb0[_0x7e5c('0x2e')],qs[_0x7e5c('0x34')](_0x5694ac[_0x7e5c('0x30')][_0x7e5c('0x34')]));_0x3b3c57[_0x7e5c('0x32')]=_0x3b3c57[_0x7e5c('0x32')][_0x7e5c('0x35')]?_0x3b3c57[_0x7e5c('0x32')]:_0x4ddfb0[_0x7e5c('0x2e')];if(!_0x5694ac[_0x7e5c('0x30')]['hasOwnProperty']('nolimit')){_0x3b3c57[_0x7e5c('0x1f')]=qs[_0x7e5c('0x1f')](_0x5694ac[_0x7e5c('0x30')][_0x7e5c('0x1f')]);_0x3b3c57['offset']=qs['offset'](_0x5694ac[_0x7e5c('0x30')][_0x7e5c('0x1e')]);}_0x3b3c57[_0x7e5c('0x4f')]=qs[_0x7e5c('0x37')](_0x5694ac[_0x7e5c('0x30')][_0x7e5c('0x37')]);_0x3b3c57[_0x7e5c('0x3a')]=qs[_0x7e5c('0x31')](_[_0x7e5c('0x38')](_0x5694ac['query'],_0x4ddfb0[_0x7e5c('0x31')]));_0x3b3c57[_0x7e5c('0x3a')]['SessionId']=_0x5b05c8['id'];if(_0x5694ac[_0x7e5c('0x30')][_0x7e5c('0x39')]){_0x3b3c57[_0x7e5c('0x3a')]=_[_0x7e5c('0x3b')](_0x3b3c57[_0x7e5c('0x3a')],{'$or':_['map'](_0x3b3c57[_0x7e5c('0x32')],function(_0x48343c){var _0x622b7d={};_0x622b7d[_0x48343c]={'$like':'%'+_0x5694ac[_0x7e5c('0x30')][_0x7e5c('0x39')]+'%'};return _0x622b7d;})});}_0x3b3c57=_[_0x7e5c('0x3b')]({},_0x3b3c57,_0x5694ac[_0x7e5c('0x40')]);return db[_0x7e5c('0x4e')][_0x7e5c('0x41')]({'where':_0x3b3c57[_0x7e5c('0x3a')]})[_0x7e5c('0x26')](function(_0x52e0f4){_0x406c1a[_0x7e5c('0x41')]=_0x52e0f4;if(_0x5694ac[_0x7e5c('0x30')][_0x7e5c('0x42')]){_0x3b3c57[_0x7e5c('0x47')]=[{'all':!![]}];}return db[_0x7e5c('0x4e')][_0x7e5c('0x43')](_0x3b3c57);})[_0x7e5c('0x26')](function(_0x14e5aa){_0x406c1a[_0x7e5c('0x44')]=_0x14e5aa;return _0x406c1a;});}})[_0x7e5c('0x26')](respondWithFilteredResult(_0x1409af,_0x3b3c57))[_0x7e5c('0x49')](handleError(_0x1409af,null));};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js
index 6c92b71..1a0191c 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf691=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3550b4,_0x59b309){var _0x237bca=function(_0x9624f9){while(--_0x9624f9){_0x3550b4['push'](_0x3550b4['shift']());}};_0x237bca(++_0x59b309);}(_0xf691,0xa0));var _0x1f69=function(_0x38c401,_0x3b088e){_0x38c401=_0x38c401-0x0;var _0x12ed59=_0xf691[_0x38c401];return _0x12ed59;};'use strict';var _=require(_0x1f69('0x0'));var util=require('util');var logger=require(_0x1f69('0x1'))(_0x1f69('0x2'));var moment=require(_0x1f69('0x3'));var BPromise=require(_0x1f69('0x4'));var rp=require(_0x1f69('0x5'));var fs=require('fs');var path=require(_0x1f69('0x6'));var rimraf=require(_0x1f69('0x7'));var config=require(_0x1f69('0x8'));var attributes=require(_0x1f69('0x9'));module[_0x1f69('0xa')]=function(_0x48ee76,_0x5a9e89){return _0x48ee76[_0x1f69('0xb')](_0x1f69('0xc'),attributes,{'tableName':_0x1f69('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7504=['bluebird','request-promise','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7504,0x8b));var _0x4750=function(_0x3f058,_0x34dc2f){_0x3f058=_0x3f058-0x0;var _0x38dec5=_0x7504[_0x3f058];return _0x38dec5;};'use strict';var _=require(_0x4750('0x0'));var util=require(_0x4750('0x1'));var logger=require(_0x4750('0x2'))(_0x4750('0x3'));var moment=require(_0x4750('0x4'));var BPromise=require(_0x4750('0x5'));var rp=require(_0x4750('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4750('0x7'));var attributes=require(_0x4750('0x8'));module[_0x4750('0x9')]=function(_0x244552,_0x138c6d){return _0x244552[_0x4750('0xa')](_0x4750('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
index 23a81cc..18e9079 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1574=['rpc','../../config/environment','jayson/promise','client','http','request','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','JscriptySessionReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x19aee6,_0xcb2918){var _0x511975=function(_0x4fbb42){while(--_0x4fbb42){_0x19aee6['push'](_0x19aee6['shift']());}};_0x511975(++_0xcb2918);}(_0x1574,0x148));var _0x4157=function(_0x253779,_0x4a85b7){_0x253779=_0x253779-0x0;var _0x16c340=_0x1574[_0x253779];return _0x16c340;};'use strict';var _=require(_0x4157('0x0'));var util=require(_0x4157('0x1'));var moment=require(_0x4157('0x2'));var BPromise=require(_0x4157('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4157('0x4'));var db=require(_0x4157('0x5'))['db'];var utils=require(_0x4157('0x6'));var logger=require(_0x4157('0x7'))(_0x4157('0x8'));var config=require(_0x4157('0x9'));var jayson=require(_0x4157('0xa'));var client=jayson[_0x4157('0xb')][_0x4157('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ece73,_0x1b33e1,_0x213c67){return new BPromise(function(_0x17a9ec,_0xadb310){return client[_0x4157('0xd')](_0x1ece73,_0x213c67)['then'](function(_0x449b71){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x1b33e1,'request\x20sent');logger[_0x4157('0xe')](_0x4157('0xf'),_0x1b33e1,_0x4157('0x10'),JSON['stringify'](_0x449b71));if(_0x449b71[_0x4157('0x11')]){if(_0x449b71[_0x4157('0x11')][_0x4157('0x12')]===0x1f4){logger[_0x4157('0x11')](_0x4157('0x13'),_0x1b33e1,_0x449b71[_0x4157('0x11')][_0x4157('0x14')]);return _0xadb310(_0x449b71[_0x4157('0x11')][_0x4157('0x14')]);}logger[_0x4157('0x11')](_0x4157('0x13'),_0x1b33e1,_0x449b71[_0x4157('0x11')]['message']);return _0x17a9ec(_0x449b71[_0x4157('0x11')]['message']);}else{logger[_0x4157('0x15')](_0x4157('0x13'),_0x1b33e1,_0x4157('0x10'));_0x17a9ec(_0x449b71[_0x4157('0x16')][_0x4157('0x14')]);}})[_0x4157('0x17')](function(_0x30dc0a){logger[_0x4157('0x11')](_0x4157('0x13'),_0x1b33e1,_0x30dc0a);_0xadb310(_0x30dc0a);});});}
\ No newline at end of file
+var _0x61f1=['jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x31b85d,_0x1ce822){var _0x1a5b47=function(_0x3a13a5){while(--_0x3a13a5){_0x31b85d['push'](_0x31b85d['shift']());}};_0x1a5b47(++_0x1ce822);}(_0x61f1,0x18a));var _0x161f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61f1[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x161f('0x0'));var moment=require('moment');var BPromise=require(_0x161f('0x1'));var rs=require(_0x161f('0x2'));var fs=require('fs');var Redis=require(_0x161f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x161f('0x4'))(_0x161f('0x5'));var config=require('../../config/environment');var jayson=require(_0x161f('0x6'));var client=jayson[_0x161f('0x7')][_0x161f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf8174c,_0xd1ad5d,_0x4ff5e1){return new BPromise(function(_0x910af4,_0x31f44e){return client[_0x161f('0x9')](_0xf8174c,_0x4ff5e1)[_0x161f('0xa')](function(_0x24bc8a){logger[_0x161f('0xb')](_0x161f('0xc'),_0xd1ad5d,_0x161f('0xd'));logger[_0x161f('0xe')](_0x161f('0xf'),_0xd1ad5d,_0x161f('0xd'),JSON['stringify'](_0x24bc8a));if(_0x24bc8a[_0x161f('0x10')]){if(_0x24bc8a[_0x161f('0x10')][_0x161f('0x11')]===0x1f4){logger[_0x161f('0x10')](_0x161f('0xc'),_0xd1ad5d,_0x24bc8a['error'][_0x161f('0x12')]);return _0x31f44e(_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);}logger[_0x161f('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0xd1ad5d,_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);return _0x910af4(_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);}else{logger[_0x161f('0xb')](_0x161f('0xc'),_0xd1ad5d,'request\x20sent');_0x910af4(_0x24bc8a['result'][_0x161f('0x12')]);}})[_0x161f('0x13')](function(_0x189a95){logger['error'](_0x161f('0xc'),_0xd1ad5d,_0x189a95);_0x31f44e(_0x189a95);});});}
\ No newline at end of file
diff --git a/server/api/license/index.js b/server/api/license/index.js
index 9fa3c7a..8c48638 100644
--- a/server/api/license/index.js
+++ b/server/api/license/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa692=['update','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put','/:id','isAuthenticated'];(function(_0x554018,_0x455829){var _0x29645b=function(_0x159b93){while(--_0x159b93){_0x554018['push'](_0x554018['shift']());}};_0x29645b(++_0x455829);}(_0xa692,0x16e));var _0x2a69=function(_0x277d61,_0xab8c96){_0x277d61=_0x277d61-0x0;var _0x34f6e1=_0xa692[_0x277d61];return _0x34f6e1;};'use strict';var multer=require(_0x2a69('0x0'));var util=require('util');var path=require(_0x2a69('0x1'));var timeout=require('connect-timeout');var express=require(_0x2a69('0x2'));var router=express[_0x2a69('0x3')]();var auth=require(_0x2a69('0x4'));var interaction=require(_0x2a69('0x5'));var config=require('../../config/environment');var controller=require(_0x2a69('0x6'));router[_0x2a69('0x7')]('/',controller[_0x2a69('0x8')]);router[_0x2a69('0x9')](_0x2a69('0xa'),auth[_0x2a69('0xb')](),controller[_0x2a69('0xc')]);module[_0x2a69('0xd')]=router;
\ No newline at end of file
+var _0x0ed5=['util','connect-timeout','express','Router','../../components/interaction/service','./license.controller','get','index','/:id','update','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0ed5,0x8f));var _0x50ed=function(_0x5af74a,_0x248b5f){_0x5af74a=_0x5af74a-0x0;var _0x5b8c81=_0x0ed5[_0x5af74a];return _0x5b8c81;};'use strict';var multer=require('multer');var util=require(_0x50ed('0x0'));var path=require('path');var timeout=require(_0x50ed('0x1'));var express=require(_0x50ed('0x2'));var router=express[_0x50ed('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x50ed('0x4'));var config=require('../../config/environment');var controller=require(_0x50ed('0x5'));router[_0x50ed('0x6')]('/',controller[_0x50ed('0x7')]);router['put'](_0x50ed('0x8'),auth['isAuthenticated'](),controller[_0x50ed('0x9')]);module[_0x50ed('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js
index 45e2e45..5c283c8 100644
--- a/server/api/license/license.attributes.js
+++ b/server/api/license/license.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc542=['TEXT','STRING','sequelize','exports'];(function(_0x1bd873,_0x5216b1){var _0x477c67=function(_0x3a50c2){while(--_0x3a50c2){_0x1bd873['push'](_0x1bd873['shift']());}};_0x477c67(++_0x5216b1);}(_0xc542,0xc6));var _0x2c54=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xc542[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0x2c54('0x0'));module[_0x2c54('0x1')]={'license':{'type':Sequelize[_0x2c54('0x2')]},'data1':{'type':Sequelize[_0x2c54('0x3')]},'data2':{'type':Sequelize[_0x2c54('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x39cd=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x3d05b9,_0xc228f0){var _0x3b3830=function(_0x3e27e1){while(--_0x3e27e1){_0x3d05b9['push'](_0x3d05b9['shift']());}};_0x3b3830(++_0xc228f0);}(_0x39cd,0x142));var _0xd39c=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x39cd[_0x486f4a];return _0x135d99;};'use strict';var Sequelize=require(_0xd39c('0x0'));module[_0xd39c('0x1')]={'license':{'type':Sequelize[_0xd39c('0x2')]},'data1':{'type':Sequelize[_0xd39c('0x3')]},'data2':{'type':Sequelize[_0xd39c('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xd39c('0x4')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js
index acd871b..86183fe 100644
--- a/server/api/license/license.controller.js
+++ b/server/api/license/license.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2bbc=['offset','Content-Range','apply','then','destroy','error','stack','name','send','model','License','rawAttributes','query','attributes','intersection','fields','length','catch','body','find','params','get','key','demo','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0x2bbc,0xec));var _0xc2bb=function(_0x56457b,_0x322699){_0x56457b=_0x56457b-0x0;var _0x3b6146=_0x2bbc[_0x56457b];return _0x3b6146;};'use strict';var pdf=require(_0xc2bb('0x0'));var emlformat=require(_0xc2bb('0x1'));var rimraf=require(_0xc2bb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc2bb('0x3'));var moment=require(_0xc2bb('0x4'));var BPromise=require(_0xc2bb('0x5'));var Mustache=require(_0xc2bb('0x6'));var util=require(_0xc2bb('0x7'));var path=require(_0xc2bb('0x8'));var sox=require(_0xc2bb('0x9'));var csv=require('to-csv');var ejs=require(_0xc2bb('0xa'));var fs=require('fs');var _=require(_0xc2bb('0xb'));var squel=require(_0xc2bb('0xc'));var crypto=require(_0xc2bb('0xd'));var jsforce=require(_0xc2bb('0xe'));var deskjs=require(_0xc2bb('0xf'));var toCsv=require(_0xc2bb('0x10'));var querystring=require('querystring');var Papa=require(_0xc2bb('0x11'));var Redis=require(_0xc2bb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc2bb('0x13'));var hardwareService=require(_0xc2bb('0x14'));var logger=require(_0xc2bb('0x15'))(_0xc2bb('0x16'));var utils=require(_0xc2bb('0x17'));var config=require(_0xc2bb('0x18'));var db=require(_0xc2bb('0x19'))['db'];function respondWithStatusCode(_0x2c847b,_0x224460){_0x224460=_0x224460||0xcc;return function(_0x45c8eb){if(_0x45c8eb){return _0x2c847b[_0xc2bb('0x1a')](_0x224460);}return _0x2c847b['status'](_0x224460)['end']();};}function respondWithResult(_0x1c0869,_0x22e095){_0x22e095=_0x22e095||0xc8;return function(_0x543d1a){if(_0x543d1a){return _0x1c0869[_0xc2bb('0x1b')](_0x22e095)[_0xc2bb('0x1c')](_0x543d1a);}};}function respondWithFilteredResult(_0x3385bc,_0x4bb7b7){return function(_0x3ac4fe){if(_0x3ac4fe){var _0x1ee311=_0x3ac4fe['count'],_0x4bdc96=_0x4bb7b7[_0xc2bb('0x1d')],_0x57988d=_0x4bb7b7[_0xc2bb('0x1d')]+_0x4bb7b7['limit'],_0x4320bd;if(_0x57988d>=_0x1ee311){_0x57988d=_0x1ee311;_0x4320bd=0xc8;}else{_0x4320bd=0xce;}_0x3385bc[_0xc2bb('0x1b')](_0x4320bd);return _0x3385bc['set'](_0xc2bb('0x1e'),_0x4bdc96+'-'+_0x57988d+'/'+_0x1ee311)[_0xc2bb('0x1c')](_0x3ac4fe);}return null;};}function patchUpdates(_0x25750b){return function(_0x4cb746){try{jsonpatch[_0xc2bb('0x1f')](_0x4cb746,_0x25750b,!![]);}catch(_0x54522d){return BPromise['reject'](_0x54522d);}return _0x4cb746['save']();};}function saveUpdates(_0x1049d3,_0x45b494){return function(_0x205ac5){if(_0x205ac5){return _0x205ac5['update'](_0x1049d3)[_0xc2bb('0x20')](function(_0x43080d){return _0x43080d;});}return null;};}function removeEntity(_0x1bc216,_0x2026ed){return function(_0x5a933d){if(_0x5a933d){return _0x5a933d[_0xc2bb('0x21')]()['then'](function(){_0x1bc216[_0xc2bb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217e79,_0x5de930){return function(_0x5cc622){if(!_0x5cc622){_0x217e79[_0xc2bb('0x1a')](0x194);}return _0x5cc622;};}function handleError(_0x8d4d45,_0x362a7e){_0x362a7e=_0x362a7e||0x1f4;return function(_0x54d732){logger[_0xc2bb('0x22')](_0x54d732[_0xc2bb('0x23')]);if(_0x54d732[_0xc2bb('0x24')]){delete _0x54d732[_0xc2bb('0x24')];}_0x8d4d45[_0xc2bb('0x1b')](_0x362a7e)[_0xc2bb('0x25')](_0x54d732);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x3df934,_0x1c26c3){var _0x1093ea={'raw':!![],'where':{'id':0x1}},_0x4d44c2={};_0x4d44c2[_0xc2bb('0x26')]=_['keys'](db[_0xc2bb('0x27')][_0xc2bb('0x28')]);_0x4d44c2[_0xc2bb('0x29')]=_['keys'](_0x3df934[_0xc2bb('0x29')]);_0x4d44c2['filters']=_['intersection'](_0x4d44c2[_0xc2bb('0x26')],_0x4d44c2[_0xc2bb('0x29')]);_0x1093ea[_0xc2bb('0x2a')]=_[_0xc2bb('0x2b')](_0x4d44c2[_0xc2bb('0x26')],qs[_0xc2bb('0x2c')](_0x3df934['query']['fields']));_0x1093ea['attributes']=_0x1093ea[_0xc2bb('0x2a')][_0xc2bb('0x2d')]?_0x1093ea[_0xc2bb('0x2a')]:_0x4d44c2['model'];_0x1093ea=_['merge']({},_0x1093ea,_0x3df934['options']);return utilLicense['getLicense'](_0x1093ea)[_0xc2bb('0x20')](respondWithResult(_0x1c26c3,null))[_0xc2bb('0x2e')](handleError(_0x1c26c3,null));};exports['update']=function(_0x21875a,_0x2dfd3a){if(_0x21875a[_0xc2bb('0x2f')]['id']){delete _0x21875a['body']['id'];}return db[_0xc2bb('0x27')][_0xc2bb('0x30')]({'where':{'id':_0x21875a[_0xc2bb('0x31')]['id']}})[_0xc2bb('0x20')](handleEntityNotFound(_0x2dfd3a,null))[_0xc2bb('0x20')](function(_0x4d1615){var _0x46bf3b=_0x4d1615[_0xc2bb('0x32')]({'plain':!![]});return utilLicense['checkLicense'](_0x46bf3b,_0x21875a[_0xc2bb('0x2f')][_0xc2bb('0x33')]);})[_0xc2bb('0x20')](function(_0x217f98){if(!_0x217f98[_0xc2bb('0x34')]){return saveUpdates(_0x21875a['body'],null);}return _0x217f98;})[_0xc2bb('0x20')](respondWithResult(_0x2dfd3a,null))[_0xc2bb('0x2e')](handleError(_0x2dfd3a,null));};
\ No newline at end of file
+var _0xb5e5=['filters','fields','attributes','length','options','catch','body','params','get','checkLicense','key','demo','html-pdf','zip-dir','fast-json-patch','mustache','path','sox','ejs','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb5e5,0x1d4));var _0x5b5e=function(_0x44b27e,_0x3cde45){_0x44b27e=_0x44b27e-0x0;var _0x5cc9f3=_0xb5e5[_0x44b27e];return _0x5cc9f3;};'use strict';var pdf=require(_0x5b5e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5b5e('0x1'));var jsonpatch=require(_0x5b5e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b5e('0x3'));var util=require('util');var path=require(_0x5b5e('0x4'));var sox=require(_0x5b5e('0x5'));var csv=require('to-csv');var ejs=require(_0x5b5e('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5b5e('0x7'));var jsforce=require(_0x5b5e('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x5b5e('0x9'));var querystring=require('querystring');var Papa=require(_0x5b5e('0xa'));var Redis=require(_0x5b5e('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x5b5e('0xc'));var hardwareService=require(_0x5b5e('0xd'));var logger=require(_0x5b5e('0xe'))(_0x5b5e('0xf'));var utils=require(_0x5b5e('0x10'));var config=require(_0x5b5e('0x11'));var db=require(_0x5b5e('0x12'))['db'];function respondWithStatusCode(_0x56d20c,_0x258ad9){_0x258ad9=_0x258ad9||0xcc;return function(_0x104dcd){if(_0x104dcd){return _0x56d20c[_0x5b5e('0x13')](_0x258ad9);}return _0x56d20c[_0x5b5e('0x14')](_0x258ad9)[_0x5b5e('0x15')]();};}function respondWithResult(_0x2f0a32,_0x574556){_0x574556=_0x574556||0xc8;return function(_0x4cec55){if(_0x4cec55){return _0x2f0a32['status'](_0x574556)['json'](_0x4cec55);}};}function respondWithFilteredResult(_0x41db6e,_0xd95eb0){return function(_0x5912a4){if(_0x5912a4){var _0x5d9501=_0x5912a4[_0x5b5e('0x16')],_0x485005=_0xd95eb0[_0x5b5e('0x17')],_0x342da1=_0xd95eb0[_0x5b5e('0x17')]+_0xd95eb0[_0x5b5e('0x18')],_0x3a4d7f;if(_0x342da1>=_0x5d9501){_0x342da1=_0x5d9501;_0x3a4d7f=0xc8;}else{_0x3a4d7f=0xce;}_0x41db6e[_0x5b5e('0x14')](_0x3a4d7f);return _0x41db6e[_0x5b5e('0x19')](_0x5b5e('0x1a'),_0x485005+'-'+_0x342da1+'/'+_0x5d9501)[_0x5b5e('0x1b')](_0x5912a4);}return null;};}function patchUpdates(_0x41da15){return function(_0x4cc31b){try{jsonpatch[_0x5b5e('0x1c')](_0x4cc31b,_0x41da15,!![]);}catch(_0x4d39d9){return BPromise[_0x5b5e('0x1d')](_0x4d39d9);}return _0x4cc31b[_0x5b5e('0x1e')]();};}function saveUpdates(_0x53e628,_0xfbd896){return function(_0x23e2a8){if(_0x23e2a8){return _0x23e2a8[_0x5b5e('0x1f')](_0x53e628)[_0x5b5e('0x20')](function(_0x36e7b3){return _0x36e7b3;});}return null;};}function removeEntity(_0x3eb478,_0x8c133f){return function(_0x3219cf){if(_0x3219cf){return _0x3219cf[_0x5b5e('0x21')]()[_0x5b5e('0x20')](function(){_0x3eb478[_0x5b5e('0x14')](0xcc)[_0x5b5e('0x15')]();});}};}function handleEntityNotFound(_0x22392c,_0x8f777c){return function(_0x2bd3f4){if(!_0x2bd3f4){_0x22392c[_0x5b5e('0x13')](0x194);}return _0x2bd3f4;};}function handleError(_0x5e0018,_0xa82068){_0xa82068=_0xa82068||0x1f4;return function(_0x49b111){logger[_0x5b5e('0x22')](_0x49b111[_0x5b5e('0x23')]);if(_0x49b111[_0x5b5e('0x24')]){delete _0x49b111['name'];}_0x5e0018['status'](_0xa82068)[_0x5b5e('0x25')](_0x49b111);};}var utilLicense=require(_0x5b5e('0x26'));exports[_0x5b5e('0x27')]=function(_0xb7b156,_0x457ebf){var _0x49ea6e={'raw':!![],'where':{'id':0x1}},_0x46d220={};_0x46d220[_0x5b5e('0x28')]=_[_0x5b5e('0x29')](db[_0x5b5e('0x2a')][_0x5b5e('0x2b')]);_0x46d220[_0x5b5e('0x2c')]=_['keys'](_0xb7b156[_0x5b5e('0x2c')]);_0x46d220[_0x5b5e('0x2d')]=_['intersection'](_0x46d220[_0x5b5e('0x28')],_0x46d220[_0x5b5e('0x2c')]);_0x49ea6e['attributes']=_['intersection'](_0x46d220[_0x5b5e('0x28')],qs['fields'](_0xb7b156[_0x5b5e('0x2c')][_0x5b5e('0x2e')]));_0x49ea6e[_0x5b5e('0x2f')]=_0x49ea6e['attributes'][_0x5b5e('0x30')]?_0x49ea6e[_0x5b5e('0x2f')]:_0x46d220[_0x5b5e('0x28')];_0x49ea6e=_['merge']({},_0x49ea6e,_0xb7b156[_0x5b5e('0x31')]);return utilLicense['getLicense'](_0x49ea6e)[_0x5b5e('0x20')](respondWithResult(_0x457ebf,null))[_0x5b5e('0x32')](handleError(_0x457ebf,null));};exports[_0x5b5e('0x1f')]=function(_0x3668a6,_0x2fb09f){if(_0x3668a6[_0x5b5e('0x33')]['id']){delete _0x3668a6[_0x5b5e('0x33')]['id'];}return db[_0x5b5e('0x2a')]['find']({'where':{'id':_0x3668a6[_0x5b5e('0x34')]['id']}})[_0x5b5e('0x20')](handleEntityNotFound(_0x2fb09f,null))[_0x5b5e('0x20')](function(_0x59053b){var _0x5e62a2=_0x59053b[_0x5b5e('0x35')]({'plain':!![]});return utilLicense[_0x5b5e('0x36')](_0x5e62a2,_0x3668a6['body'][_0x5b5e('0x37')]);})[_0x5b5e('0x20')](function(_0x17055e){if(!_0x17055e[_0x5b5e('0x38')]){return saveUpdates(_0x3668a6[_0x5b5e('0x33')],null);}return _0x17055e;})[_0x5b5e('0x20')](respondWithResult(_0x2fb09f,null))[_0x5b5e('0x32')](handleError(_0x2fb09f,null));};
\ No newline at end of file
diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js
index f5952df..379061b 100644
--- a/server/api/license/license.model.js
+++ b/server/api/license/license.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x867f=['exports','define','License','license','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./license.attributes'];(function(_0x4e4529,_0x33f07b){var _0x100460=function(_0xdabf17){while(--_0xdabf17){_0x4e4529['push'](_0x4e4529['shift']());}};_0x100460(++_0x33f07b);}(_0x867f,0xdc));var _0xf867=function(_0x241b92,_0x1526dd){_0x241b92=_0x241b92-0x0;var _0x575bb4=_0x867f[_0x241b92];return _0x575bb4;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))('api');var moment=require(_0xf867('0x3'));var BPromise=require(_0xf867('0x4'));var rp=require(_0xf867('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf867('0x6'));var config=require('../../config/environment');var attributes=require(_0xf867('0x7'));module[_0xf867('0x8')]=function(_0x2708d5,_0x287b67){return _0x2708d5[_0xf867('0x9')](_0xf867('0xa'),attributes,{'tableName':_0xf867('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1bd1=['license','lodash','util','../../config/logger','moment','../../config/environment','./license.attributes','exports','define','License'];(function(_0x5ad9f2,_0x10b5e9){var _0x48b4cf=function(_0x46714d){while(--_0x46714d){_0x5ad9f2['push'](_0x5ad9f2['shift']());}};_0x48b4cf(++_0x10b5e9);}(_0x1bd1,0x123));var _0x11bd=function(_0x327e9b,_0x58a191){_0x327e9b=_0x327e9b-0x0;var _0x4bd19c=_0x1bd1[_0x327e9b];return _0x4bd19c;};'use strict';var _=require(_0x11bd('0x0'));var util=require(_0x11bd('0x1'));var logger=require(_0x11bd('0x2'))('api');var moment=require(_0x11bd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x11bd('0x4'));var attributes=require(_0x11bd('0x5'));module[_0x11bd('0x6')]=function(_0x612ff3,_0x57c032){return _0x612ff3[_0x11bd('0x7')](_0x11bd('0x8'),attributes,{'tableName':_0x11bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js
index b2a7ed3..70a0dce 100644
--- a/server/api/license/license.rpc.js
+++ b/server/api/license/license.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x595a=['request','then','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x595a,0x19a));var _0xa595=function(_0x155839,_0x3f679d){_0x155839=_0x155839-0x0;var _0x51d322=_0x595a[_0x155839];return _0x51d322;};'use strict';var _=require('lodash');var util=require(_0xa595('0x0'));var moment=require(_0xa595('0x1'));var BPromise=require(_0xa595('0x2'));var rs=require(_0xa595('0x3'));var fs=require('fs');var Redis=require(_0xa595('0x4'));var db=require(_0xa595('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa595('0x6'))('rpc');var config=require(_0xa595('0x7'));var jayson=require(_0xa595('0x8'));var client=jayson[_0xa595('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eb14b,_0x18e2ed,_0x4617f9){return new BPromise(function(_0x484a3c,_0x251976){return client[_0xa595('0xa')](_0x3eb14b,_0x4617f9)[_0xa595('0xb')](function(_0x54096c){logger['info'](_0xa595('0xc'),_0x18e2ed,_0xa595('0xd'));logger[_0xa595('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x18e2ed,_0xa595('0xd'),JSON[_0xa595('0xf')](_0x54096c));if(_0x54096c[_0xa595('0x10')]){if(_0x54096c['error'][_0xa595('0x11')]===0x1f4){logger[_0xa595('0x10')](_0xa595('0xc'),_0x18e2ed,_0x54096c[_0xa595('0x10')][_0xa595('0x12')]);return _0x251976(_0x54096c['error']['message']);}logger[_0xa595('0x10')](_0xa595('0xc'),_0x18e2ed,_0x54096c[_0xa595('0x10')][_0xa595('0x12')]);return _0x484a3c(_0x54096c['error']['message']);}else{logger[_0xa595('0x13')](_0xa595('0xc'),_0x18e2ed,'request\x20sent');_0x484a3c(_0x54096c[_0xa595('0x14')][_0xa595('0x12')]);}})['catch'](function(_0x5750f0){logger[_0xa595('0x10')]('License,\x20%s,\x20%s',_0x18e2ed,_0x5750f0);_0x251976(_0x5750f0);});});}
\ No newline at end of file
+var _0x4746=['../../config/environment','jayson/promise','http','request','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','code','message','error','info','request\x20sent','result','catch','util','bluebird','randomstring','../../config/logger'];(function(_0x4f0ed1,_0x57c8db){var _0x42fde0=function(_0x2c1126){while(--_0x2c1126){_0x4f0ed1['push'](_0x4f0ed1['shift']());}};_0x42fde0(++_0x57c8db);}(_0x4746,0xb0));var _0x6474=function(_0x355adc,_0xac51ab){_0x355adc=_0x355adc-0x0;var _0x4df04f=_0x4746[_0x355adc];return _0x4df04f;};'use strict';var _=require('lodash');var util=require(_0x6474('0x0'));var moment=require('moment');var BPromise=require(_0x6474('0x1'));var rs=require(_0x6474('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6474('0x3'))('rpc');var config=require(_0x6474('0x4'));var jayson=require(_0x6474('0x5'));var client=jayson['client'][_0x6474('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x534d34,_0x29b219,_0x24aca3){return new BPromise(function(_0x5a067f,_0x16db7c){return client[_0x6474('0x7')](_0x534d34,_0x24aca3)['then'](function(_0x437cca){logger['info'](_0x6474('0x8'),_0x29b219,'request\x20sent');logger[_0x6474('0x9')](_0x6474('0xa'),_0x29b219,'request\x20sent',JSON['stringify'](_0x437cca));if(_0x437cca['error']){if(_0x437cca['error'][_0x6474('0xb')]===0x1f4){logger['error'](_0x6474('0x8'),_0x29b219,_0x437cca['error'][_0x6474('0xc')]);return _0x16db7c(_0x437cca[_0x6474('0xd')][_0x6474('0xc')]);}logger['error']('License,\x20%s,\x20%s',_0x29b219,_0x437cca['error'][_0x6474('0xc')]);return _0x5a067f(_0x437cca[_0x6474('0xd')][_0x6474('0xc')]);}else{logger[_0x6474('0xe')](_0x6474('0x8'),_0x29b219,_0x6474('0xf'));_0x5a067f(_0x437cca[_0x6474('0x10')][_0x6474('0xc')]);}})[_0x6474('0x11')](function(_0x321f73){logger['error'](_0x6474('0x8'),_0x29b219,_0x321f73);_0x16db7c(_0x321f73);});});}
\ No newline at end of file
diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js
index 8235a7c..d7fc945 100644
--- a/server/api/mailAccount/index.js
+++ b/server/api/mailAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1262=['addImap','addSmtp','addInteraction','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','util','express','Router','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','/:id/verify','verifySmtp','/:id/users','addDisposition','post','addAnswer'];(function(_0xda77fb,_0x341892){var _0x18264b=function(_0x1b01dd){while(--_0x1b01dd){_0xda77fb['push'](_0xda77fb['shift']());}};_0x18264b(++_0x341892);}(_0x1262,0x16c));var _0x2126=function(_0x13cc49,_0x5758fc){_0x13cc49=_0x13cc49-0x0;var _0x14b1f9=_0x1262[_0x13cc49];return _0x14b1f9;};'use strict';var multer=require('multer');var util=require(_0x2126('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2126('0x1'));var router=express[_0x2126('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2126('0x3'));router[_0x2126('0x4')]('/',auth[_0x2126('0x5')](),controller[_0x2126('0x6')]);router[_0x2126('0x4')](_0x2126('0x7'),auth[_0x2126('0x5')](),controller['describe']);router['get'](_0x2126('0x8'),auth[_0x2126('0x5')](),controller[_0x2126('0x9')]);router['get'](_0x2126('0xa'),auth['isAuthenticated'](),controller[_0x2126('0xb')]);router[_0x2126('0x4')](_0x2126('0xc'),auth[_0x2126('0x5')](),controller['getAnswers']);router[_0x2126('0x4')](_0x2126('0xd'),auth[_0x2126('0x5')](),controller['getImap']);router[_0x2126('0x4')](_0x2126('0xe'),auth[_0x2126('0x5')](),controller[_0x2126('0xf')]);router[_0x2126('0x4')](_0x2126('0x10'),auth[_0x2126('0x5')](),controller[_0x2126('0x11')]);router['get'](_0x2126('0x12'),auth[_0x2126('0x5')](),controller['getApplications']);router['get'](_0x2126('0x13'),auth[_0x2126('0x5')](),controller['getMessages']);router[_0x2126('0x4')](_0x2126('0x14'),auth[_0x2126('0x5')](),controller[_0x2126('0x15')]);router[_0x2126('0x4')](_0x2126('0x16'),auth[_0x2126('0x5')](),controller['getAgents']);router['post'](_0x2126('0xa'),auth['isAuthenticated'](),controller[_0x2126('0x17')]);router[_0x2126('0x18')](_0x2126('0xc'),auth[_0x2126('0x5')](),controller[_0x2126('0x19')]);router[_0x2126('0x18')]('/',auth[_0x2126('0x5')](),controller['create']);router[_0x2126('0x18')](_0x2126('0xd'),auth[_0x2126('0x5')](),controller[_0x2126('0x1a')]);router['post'](_0x2126('0xe'),auth['isAuthenticated'](),controller[_0x2126('0x1b')]);router[_0x2126('0x18')](_0x2126('0x10'),auth[_0x2126('0x5')](),controller[_0x2126('0x1c')]);router[_0x2126('0x18')](_0x2126('0x12'),auth[_0x2126('0x5')](),controller['addApplications']);router[_0x2126('0x18')]('/:id/send',auth[_0x2126('0x5')](),controller['send']);router['post'](_0x2126('0x16'),auth[_0x2126('0x5')](),controller['addAgents']);router[_0x2126('0x1d')](_0x2126('0x8'),auth[_0x2126('0x5')](),controller[_0x2126('0x1e')]);router[_0x2126('0x1f')](_0x2126('0xa'),auth['isAuthenticated'](),controller[_0x2126('0x20')]);router[_0x2126('0x1f')](_0x2126('0xc'),auth[_0x2126('0x5')](),controller[_0x2126('0x21')]);router[_0x2126('0x1f')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x2126('0x22')]);router[_0x2126('0x1f')](_0x2126('0xe'),auth[_0x2126('0x5')](),controller[_0x2126('0x23')]);router[_0x2126('0x1f')](_0x2126('0x8'),auth[_0x2126('0x5')](),controller[_0x2126('0x24')]);router[_0x2126('0x1f')](_0x2126('0x16'),auth['isAuthenticated'](),controller[_0x2126('0x25')]);module[_0x2126('0x26')]=router;
\ No newline at end of file
+var _0x0a87=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getApplications','/:id/messages','getMessages','/:id/users','post','addAnswer','create','addImap','addSmtp','addInteraction','/:id/applications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','/:id/in_servers','removeSmtp','destroy','exports','multer'];(function(_0x3e93c7,_0x9d5904){var _0xdba5b6=function(_0x3aadaa){while(--_0x3aadaa){_0x3e93c7['push'](_0x3e93c7['shift']());}};_0xdba5b6(++_0x9d5904);}(_0x0a87,0x13a));var _0x70a8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0a87[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x70a8('0x0'));var util=require(_0x70a8('0x1'));var path=require(_0x70a8('0x2'));var timeout=require(_0x70a8('0x3'));var express=require(_0x70a8('0x4'));var router=express[_0x70a8('0x5')]();var auth=require(_0x70a8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x70a8('0x7'));var controller=require(_0x70a8('0x8'));router[_0x70a8('0x9')]('/',auth[_0x70a8('0xa')](),controller[_0x70a8('0xb')]);router[_0x70a8('0x9')](_0x70a8('0xc'),auth[_0x70a8('0xa')](),controller['describe']);router[_0x70a8('0x9')](_0x70a8('0xd'),auth[_0x70a8('0xa')](),controller[_0x70a8('0xe')]);router[_0x70a8('0x9')](_0x70a8('0xf'),auth[_0x70a8('0xa')](),controller[_0x70a8('0x10')]);router[_0x70a8('0x9')](_0x70a8('0x11'),auth['isAuthenticated'](),controller[_0x70a8('0x12')]);router[_0x70a8('0x9')]('/:id/in_servers',auth[_0x70a8('0xa')](),controller[_0x70a8('0x13')]);router['get'](_0x70a8('0x14'),auth['isAuthenticated'](),controller[_0x70a8('0x15')]);router['get'](_0x70a8('0x16'),auth[_0x70a8('0xa')](),controller['getInteractions']);router[_0x70a8('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x70a8('0x17')]);router[_0x70a8('0x9')](_0x70a8('0x18'),auth[_0x70a8('0xa')](),controller[_0x70a8('0x19')]);router[_0x70a8('0x9')]('/:id/verify',auth['isAuthenticated'](),controller['verifySmtp']);router[_0x70a8('0x9')](_0x70a8('0x1a'),auth[_0x70a8('0xa')](),controller['getAgents']);router['post'](_0x70a8('0xf'),auth[_0x70a8('0xa')](),controller['addDisposition']);router[_0x70a8('0x1b')](_0x70a8('0x11'),auth['isAuthenticated'](),controller[_0x70a8('0x1c')]);router[_0x70a8('0x1b')]('/',auth[_0x70a8('0xa')](),controller[_0x70a8('0x1d')]);router['post']('/:id/in_servers',auth[_0x70a8('0xa')](),controller[_0x70a8('0x1e')]);router[_0x70a8('0x1b')](_0x70a8('0x14'),auth[_0x70a8('0xa')](),controller[_0x70a8('0x1f')]);router[_0x70a8('0x1b')](_0x70a8('0x16'),auth[_0x70a8('0xa')](),controller[_0x70a8('0x20')]);router[_0x70a8('0x1b')](_0x70a8('0x21'),auth[_0x70a8('0xa')](),controller['addApplications']);router[_0x70a8('0x1b')](_0x70a8('0x22'),auth['isAuthenticated'](),controller['send']);router[_0x70a8('0x1b')]('/:id/users',auth[_0x70a8('0xa')](),controller[_0x70a8('0x23')]);router[_0x70a8('0x24')](_0x70a8('0xd'),auth[_0x70a8('0xa')](),controller[_0x70a8('0x25')]);router[_0x70a8('0x26')](_0x70a8('0xf'),auth[_0x70a8('0xa')](),controller[_0x70a8('0x27')]);router[_0x70a8('0x26')](_0x70a8('0x11'),auth[_0x70a8('0xa')](),controller[_0x70a8('0x28')]);router[_0x70a8('0x26')](_0x70a8('0x29'),auth[_0x70a8('0xa')](),controller['removeImap']);router[_0x70a8('0x26')](_0x70a8('0x14'),auth[_0x70a8('0xa')](),controller[_0x70a8('0x2a')]);router[_0x70a8('0x26')](_0x70a8('0xd'),auth['isAuthenticated'](),controller[_0x70a8('0x2b')]);router['delete'](_0x70a8('0x1a'),auth[_0x70a8('0xa')](),controller['removeAgents']);module[_0x70a8('0x2c')]=router;
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js
index f05a78d..3be50ed 100644
--- a/server/api/mailAccount/mailAccount.attributes.js
+++ b/server/api/mailAccount/mailAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaaa8=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}} Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x7b975a,_0x1bd7a0){var _0x3aa5e6=function(_0x16dcaa){while(--_0x16dcaa){_0x7b975a['push'](_0x7b975a['shift']());}};_0x3aa5e6(++_0x1bd7a0);}(_0xaaa8,0x17f));var _0x8aaa=function(_0x2b9c1a,_0x575609){_0x2b9c1a=_0x2b9c1a-0x0;var _0x2ac8e2=_0xaaa8[_0x2b9c1a];return _0x2ac8e2;};'use strict';var Sequelize=require(_0x8aaa('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x8aaa('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x8aaa('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8aaa('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x8aaa('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x8aaa('0x3')]},'markAsUnread':{'type':Sequelize[_0x8aaa('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8aaa('0x1')],'allowNull':![],'defaultValue':_0x8aaa('0x4')},'fontSize':{'type':Sequelize[_0x8aaa('0x5')](0x2)[_0x8aaa('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8aaa('0x3')],'defaultValue':function(){return _0x8aaa('0x7');}},'notificationSound':{'type':Sequelize[_0x8aaa('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8aaa('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8aaa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8aaa('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8aaa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8aaa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8aaa('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x8aaa('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8aaa('0x9'),'set':function(_0x4a25fd){if(!_0x4a25fd)this[_0x8aaa('0xa')](_0x8aaa('0xb'),null);this[_0x8aaa('0xa')]('mandatoryDisposition',_0x4a25fd);}}};
\ No newline at end of file
+var _0x3c05=['BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}} Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','STRING'];(function(_0x1c6e30,_0x2dc98e){var _0x5d2da9=function(_0x41e444){while(--_0x41e444){_0x1c6e30['push'](_0x1c6e30['shift']());}};_0x5d2da9(++_0x2dc98e);}(_0x3c05,0x12b));var _0x53c0=function(_0xbb29b5,_0x1e02e5){_0xbb29b5=_0xbb29b5-0x0;var _0xdf5c3b=_0x3c05[_0xbb29b5];return _0xdf5c3b;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x53c0('0x0')]},'name':{'type':Sequelize[_0x53c0('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x53c0('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x53c0('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x53c0('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x53c0('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x53c0('0x2')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x53c0('0x0')],'allowNull':![],'defaultValue':_0x53c0('0x3')},'fontSize':{'type':Sequelize[_0x53c0('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x53c0('0x2')],'defaultValue':function(){return _0x53c0('0x5');}},'notificationSound':{'type':Sequelize[_0x53c0('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x53c0('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x53c0('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x53c0('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x53c0('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x53c0('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x53c0('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x53c0('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x53c0('0x1')],'defaultValue':![],'comment':_0x53c0('0x7'),'set':function(_0x15fd49){if(!_0x15fd49)this[_0x53c0('0x8')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x53c0('0x9'),_0x15fd49);}}};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js
index f507a5d..88406bd 100644
--- a/server/api/mailAccount/mailAccount.controller.js
+++ b/server/api/mailAccount/mailAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d5e=['port','host','service','cuser','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Owner','internal','Tag','tag','addApplications','sequelize','MailApplication','findAndCountAll','getApplications','getMessages','MailMessage','$gte','split','format','CmList','List','CmContact','Contacts','updatedAt','from','%s\x20<%s>','attachments','join','basename','auth','secure','SendMail','List\x20not\x20found','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','request','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','MailAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','json','count','offset','limit','status','set','apply','reject','update','then','MailAccounts','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','map','type','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','body','describe','addDisposition','getDispositions','findOne','Disposition','sort','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','order','removeAnswers','key','email','ListId','isNil','active','description','cservice','cauthentication','user','password','pass','cpassword','authentication'];(function(_0x501401,_0x2d8737){var _0xfd0a47=function(_0x57decb){while(--_0x57decb){_0x501401['push'](_0x501401['shift']());}};_0xfd0a47(++_0x2d8737);}(_0x6d5e,0x103));var _0xe6d5=function(_0x3866ac,_0x1d470f){_0x3866ac=_0x3866ac-0x0;var _0x5ce7b2=_0x6d5e[_0x3866ac];return _0x5ce7b2;};'use strict';var pdf=require(_0xe6d5('0x0'));var emlformat=require(_0xe6d5('0x1'));var rimraf=require(_0xe6d5('0x2'));var zipdir=require(_0xe6d5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6d5('0x4'));var moment=require(_0xe6d5('0x5'));var BPromise=require(_0xe6d5('0x6'));var Mustache=require(_0xe6d5('0x7'));var util=require(_0xe6d5('0x8'));var path=require(_0xe6d5('0x9'));var sox=require(_0xe6d5('0xa'));var csv=require('to-csv');var ejs=require(_0xe6d5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe6d5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe6d5('0xd'));var Papa=require(_0xe6d5('0xe'));var Redis=require(_0xe6d5('0xf'));var authService=require(_0xe6d5('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe6d5('0x11'));var logger=require(_0xe6d5('0x12'))(_0xe6d5('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe6d5('0x14'))['db'];config[_0xe6d5('0x15')]=_[_0xe6d5('0x16')](config[_0xe6d5('0x15')],{'host':_0xe6d5('0x17'),'port':0x18eb});var socket=require(_0xe6d5('0x18'))(new Redis(config[_0xe6d5('0x15')]));require('./mailAccount.socket')[_0xe6d5('0x19')](socket);var jayson=require(_0xe6d5('0x1a'));var client=jayson[_0xe6d5('0x1b')][_0xe6d5('0x1c')]({'port':0x232b});function checkPasswordPattern(_0x88b75e,_0x42f2ba,_0x35599f){if(_0x35599f){var _0x37ff40=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37ff40[_0xe6d5('0x1d')](_0x42f2ba)){return _0x88b75e;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x88b75e;}}function respondWithRpcPromise(_0x2a8aa7,_0x2adb34,_0x268ced,_0x4ecc63){return new BPromise(function(_0x3847d1,_0xf0a8bf){var _0x5f5d7a=_0x4ecc63||client;return _0x5f5d7a[_0xe6d5('0x1e')](_0x2a8aa7,_0x268ced)['then'](function(_0x3d4fb7){logger['info']('MailAccount,\x20%s,\x20%s',_0x2adb34,_0xe6d5('0x1f'));logger['debug'](_0xe6d5('0x20'),_0x2adb34,_0xe6d5('0x1f'),JSON[_0xe6d5('0x21')](_0x3d4fb7));if(_0x3d4fb7['error']){if(_0x3d4fb7['error'][_0xe6d5('0x22')]===0x1f4){logger[_0xe6d5('0x23')](_0xe6d5('0x24'),_0x2adb34,_0x3d4fb7[_0xe6d5('0x23')][_0xe6d5('0x25')]);return _0xf0a8bf(_0x3d4fb7['error'][_0xe6d5('0x25')]);}logger[_0xe6d5('0x23')]('MailAccount,\x20%s,\x20%s',_0x2adb34,_0x3d4fb7[_0xe6d5('0x23')][_0xe6d5('0x25')]);return _0x3847d1(_0x3d4fb7[_0xe6d5('0x23')]['message']);}else{logger[_0xe6d5('0x26')](_0xe6d5('0x24'),_0x2adb34,_0xe6d5('0x1f'));_0x3847d1(_0x3d4fb7[_0xe6d5('0x27')][_0xe6d5('0x25')]);}})[_0xe6d5('0x28')](function(_0x1e6a36){logger[_0xe6d5('0x23')]('MailAccount,\x20%s,\x20%s',_0x2adb34,_0x1e6a36);_0xf0a8bf(_0x1e6a36);});});}function respondWithStatusCode(_0x347343,_0x210b00){_0x210b00=_0x210b00||0xcc;return function(_0x24fe6a){if(_0x24fe6a){return _0x347343[_0xe6d5('0x29')](_0x210b00);}return _0x347343['status'](_0x210b00)[_0xe6d5('0x2a')]();};}function respondWithResult(_0x4a4b27,_0x21ba91){_0x21ba91=_0x21ba91||0xc8;return function(_0x20e1b4){if(_0x20e1b4){return _0x4a4b27['status'](_0x21ba91)[_0xe6d5('0x2b')](_0x20e1b4);}};}function respondWithFilteredResult(_0x526786,_0x4377bc){return function(_0x1345d1){if(_0x1345d1){var _0x4247f5=_0x1345d1[_0xe6d5('0x2c')],_0x1feccd=_0x4377bc['offset'],_0x331449=_0x4377bc[_0xe6d5('0x2d')]+_0x4377bc[_0xe6d5('0x2e')],_0x4754a8;if(_0x331449>=_0x4247f5){_0x331449=_0x4247f5;_0x4754a8=0xc8;}else{_0x4754a8=0xce;}_0x526786[_0xe6d5('0x2f')](_0x4754a8);return _0x526786[_0xe6d5('0x30')]('Content-Range',_0x1feccd+'-'+_0x331449+'/'+_0x4247f5)[_0xe6d5('0x2b')](_0x1345d1);}return null;};}function patchUpdates(_0x2dbf1b){return function(_0x4f5c6a){try{jsonpatch[_0xe6d5('0x31')](_0x4f5c6a,_0x2dbf1b,!![]);}catch(_0x594a25){return BPromise[_0xe6d5('0x32')](_0x594a25);}return _0x4f5c6a['save']();};}function saveUpdates(_0x1f2fbf,_0x5354b0){return function(_0x12f3b0){if(_0x12f3b0){return _0x12f3b0[_0xe6d5('0x33')](_0x1f2fbf)[_0xe6d5('0x34')](function(_0x14960b){return _0x14960b;});}return null;};}function removeEntity(_0x556198,_0x276e32){return function(_0x350441){if(_0x350441){return _0x350441['destroy']()[_0xe6d5('0x34')](function(){var _0x38c757=_0x350441['get']({'plain':!![]});var _0x2663ab=_0xe6d5('0x35');return db['UserProfileResource'][_0xe6d5('0x36')]({'where':{'type':_0x2663ab,'resourceId':_0x38c757['id']}})[_0xe6d5('0x34')](function(){return _0x350441;});})[_0xe6d5('0x34')](function(){_0x556198[_0xe6d5('0x2f')](0xcc)[_0xe6d5('0x2a')]();});}};}function handleEntityNotFound(_0x15e4ce,_0x22a229){return function(_0x2fb0c6){if(!_0x2fb0c6){_0x15e4ce['sendStatus'](0x194);}return _0x2fb0c6;};}function handleError(_0x4b4136,_0x7ce9c6){_0x7ce9c6=_0x7ce9c6||0x1f4;return function(_0x3d625f){logger[_0xe6d5('0x23')](_0x3d625f[_0xe6d5('0x37')]);if(_0x3d625f[_0xe6d5('0x38')]){delete _0x3d625f[_0xe6d5('0x38')];}_0x4b4136[_0xe6d5('0x2f')](_0x7ce9c6)[_0xe6d5('0x39')](_0x3d625f);};}exports[_0xe6d5('0x3a')]=function(_0x348b47,_0x2c1eb9){var _0xc4d65c={'include':[{'model':db[_0xe6d5('0x3b')],'as':_0xe6d5('0x3c')},{'model':db[_0xe6d5('0x3d')],'as':_0xe6d5('0x3e')},{'model':db[_0xe6d5('0x3f')],'as':_0xe6d5('0x40')}]},_0x32bce5={},_0x2e8175={'count':0x0,'rows':[]};var _0x3576da=db[_0xe6d5('0x41')][_0xe6d5('0x42')];_0x32bce5[_0xe6d5('0x43')]=_[_0xe6d5('0x44')](_0x3576da);_0x32bce5['query']=_[_0xe6d5('0x44')](_0x348b47[_0xe6d5('0x45')]);_0x32bce5[_0xe6d5('0x46')]=_[_0xe6d5('0x47')](_0x32bce5[_0xe6d5('0x43')],_0x32bce5[_0xe6d5('0x45')]);_0xc4d65c[_0xe6d5('0x48')]=_[_0xe6d5('0x47')](_0x32bce5[_0xe6d5('0x43')],qs[_0xe6d5('0x49')](_0x348b47['query']['fields']));_0xc4d65c[_0xe6d5('0x48')]=_0xc4d65c['attributes']['length']?_0xc4d65c[_0xe6d5('0x48')]:_0x32bce5[_0xe6d5('0x43')];if(!_0x348b47[_0xe6d5('0x45')][_0xe6d5('0x4a')](_0xe6d5('0x4b'))){_0xc4d65c[_0xe6d5('0x2e')]=qs['limit'](_0x348b47[_0xe6d5('0x45')]['limit']);_0xc4d65c[_0xe6d5('0x2d')]=qs[_0xe6d5('0x2d')](_0x348b47['query'][_0xe6d5('0x2d')]);}_0xc4d65c['order']=qs['sort'](_0x348b47[_0xe6d5('0x45')]['sort']);_0xc4d65c[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x348b47['query'],_0x32bce5[_0xe6d5('0x46')]));if(_0x348b47[_0xe6d5('0x45')][_0xe6d5('0x4e')]){_0xc4d65c[_0xe6d5('0x4c')]=_[_0xe6d5('0x4f')](_0xc4d65c['where'],{'$or':_[_0xe6d5('0x50')](_0x3576da,function(_0x2a04fa){if(_0x2a04fa[_0xe6d5('0x51')]['key']!==_0xe6d5('0x52')){var _0xc696ca={};_0xc696ca[_0x2a04fa['field']]={'$like':'%'+_0x348b47[_0xe6d5('0x45')][_0xe6d5('0x4e')]+'%'};return _0xc696ca;}})});}_0xc4d65c=_[_0xe6d5('0x4f')]({},_0xc4d65c,_0x348b47[_0xe6d5('0x53')]);var _0x5a9fd7={'where':_0xc4d65c['where']};return db['MailAccount'][_0xe6d5('0x2c')](_0x5a9fd7)[_0xe6d5('0x34')](function(_0x1a26da){_0x2e8175[_0xe6d5('0x2c')]=_0x1a26da;if(_0x348b47[_0xe6d5('0x45')]['includeAll']){_0xc4d65c[_0xe6d5('0x54')]=[{'all':!![]}];}return db[_0xe6d5('0x41')][_0xe6d5('0x55')](_0xc4d65c);})['then'](function(_0x1d5281){_0x2e8175[_0xe6d5('0x56')]=_0x1d5281;return _0x2e8175;})[_0xe6d5('0x34')](respondWithFilteredResult(_0x2c1eb9,_0xc4d65c))[_0xe6d5('0x28')](handleError(_0x2c1eb9,null));};exports[_0xe6d5('0x57')]=function(_0x56182e,_0x440d9d){var _0x137b77={'raw':![],'where':{'id':_0x56182e[_0xe6d5('0x58')]['id']},'include':[{'model':db[_0xe6d5('0x3b')],'as':_0xe6d5('0x3c')},{'model':db[_0xe6d5('0x3d')],'as':_0xe6d5('0x3e')},{'model':db[_0xe6d5('0x3f')],'as':_0xe6d5('0x40')}]},_0x49f3d9={};_0x49f3d9['model']=_[_0xe6d5('0x44')](db['MailAccount'][_0xe6d5('0x42')]);_0x49f3d9[_0xe6d5('0x45')]=_['keys'](_0x56182e[_0xe6d5('0x45')]);_0x49f3d9['filters']=_[_0xe6d5('0x47')](_0x49f3d9[_0xe6d5('0x43')],_0x49f3d9[_0xe6d5('0x45')]);_0x137b77['attributes']=_[_0xe6d5('0x47')](_0x49f3d9['model'],qs[_0xe6d5('0x49')](_0x56182e[_0xe6d5('0x45')][_0xe6d5('0x49')]));_0x137b77['attributes']=_0x137b77[_0xe6d5('0x48')][_0xe6d5('0x59')]?_0x137b77[_0xe6d5('0x48')]:_0x49f3d9[_0xe6d5('0x43')];if(_0x56182e[_0xe6d5('0x45')][_0xe6d5('0x5a')]){_0x137b77[_0xe6d5('0x54')]=[{'all':!![]}];}_0x137b77=_[_0xe6d5('0x4f')]({},_0x137b77,_0x56182e[_0xe6d5('0x53')]);return db['MailAccount'][_0xe6d5('0x5b')](_0x137b77)['then'](handleEntityNotFound(_0x440d9d,null))[_0xe6d5('0x34')](respondWithResult(_0x440d9d,null))[_0xe6d5('0x28')](handleError(_0x440d9d,null));};exports[_0xe6d5('0x33')]=function(_0x4ceed9,_0x77ca12){if(_0x4ceed9['body']['id']){delete _0x4ceed9[_0xe6d5('0x5c')]['id'];}return db[_0xe6d5('0x41')][_0xe6d5('0x5b')]({'where':{'id':_0x4ceed9['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xe6d5('0x3c')},{'model':db[_0xe6d5('0x3d')],'as':_0xe6d5('0x3e')},{'model':db[_0xe6d5('0x3f')],'as':_0xe6d5('0x40')}]})[_0xe6d5('0x34')](handleEntityNotFound(_0x77ca12,null))[_0xe6d5('0x34')](saveUpdates(_0x4ceed9['body'],null))[_0xe6d5('0x34')](function(_0x4b1ab4){if(_0x4b1ab4&&_0x4ceed9['body']['Imap']){return db['MailServerIn'][_0xe6d5('0x33')](_0x4ceed9[_0xe6d5('0x5c')]['Imap'],{'where':{'MailAccountId':_0x4b1ab4['id']}})[_0xe6d5('0x34')](function(){return _0x4b1ab4;});}return _0x4b1ab4;})[_0xe6d5('0x34')](function(_0x441b32){if(_0x441b32&&_0x4ceed9['body'][_0xe6d5('0x3e')]){return db[_0xe6d5('0x3d')]['update'](_0x4ceed9[_0xe6d5('0x5c')][_0xe6d5('0x3e')],{'where':{'MailAccountId':_0x441b32['id']}})[_0xe6d5('0x34')](function(){return _0x441b32;});}return _0x441b32;})['then'](respondWithResult(_0x77ca12,null))[_0xe6d5('0x28')](handleError(_0x77ca12,null));};exports['describe']=function(_0x2a326f,_0x2d34b9){return db[_0xe6d5('0x41')][_0xe6d5('0x5d')]()[_0xe6d5('0x34')](respondWithResult(_0x2d34b9,null))[_0xe6d5('0x28')](handleError(_0x2d34b9,null));};exports[_0xe6d5('0x5e')]=function(_0x2a1bb2,_0x298116,_0x381797){if(_0x2a1bb2[_0xe6d5('0x5c')]['id']){delete _0x2a1bb2[_0xe6d5('0x5c')]['id'];}return db['MailAccount'][_0xe6d5('0x5b')]({'where':{'id':_0x2a1bb2['params']['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x298116,null))[_0xe6d5('0x34')](function(_0x4521b7){if(_0x4521b7){_0x2a1bb2['body']['MailAccountId']=_0x4521b7['id'];return db['Disposition']['create'](_0x2a1bb2['body']);}})[_0xe6d5('0x34')](respondWithResult(_0x298116,null))[_0xe6d5('0x28')](handleError(_0x298116,null));};exports[_0xe6d5('0x5f')]=function(_0x1adfe1,_0x1e21c9,_0x2f7827){var _0x40e8ba={'raw':![],'where':{}};var _0x20431d={};var _0x4a9b21={'count':0x0,'rows':[]};return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x1adfe1[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x1e21c9,null))['then'](function(_0x167a0c){if(_0x167a0c){_0x20431d['model']=_[_0xe6d5('0x44')](db[_0xe6d5('0x61')]['rawAttributes']);_0x20431d[_0xe6d5('0x45')]=_['keys'](_0x1adfe1[_0xe6d5('0x45')]);_0x20431d[_0xe6d5('0x46')]=_[_0xe6d5('0x47')](_0x20431d[_0xe6d5('0x43')],_0x20431d['query']);_0x40e8ba[_0xe6d5('0x48')]=_[_0xe6d5('0x47')](_0x20431d['model'],qs[_0xe6d5('0x49')](_0x1adfe1[_0xe6d5('0x45')][_0xe6d5('0x49')]));_0x40e8ba[_0xe6d5('0x48')]=_0x40e8ba[_0xe6d5('0x48')]['length']?_0x40e8ba[_0xe6d5('0x48')]:_0x20431d[_0xe6d5('0x43')];if(!_0x1adfe1[_0xe6d5('0x45')][_0xe6d5('0x4a')](_0xe6d5('0x4b'))){_0x40e8ba[_0xe6d5('0x2e')]=qs[_0xe6d5('0x2e')](_0x1adfe1[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0x40e8ba[_0xe6d5('0x2d')]=qs['offset'](_0x1adfe1['query'][_0xe6d5('0x2d')]);}_0x40e8ba['order']=qs[_0xe6d5('0x62')](_0x1adfe1[_0xe6d5('0x45')][_0xe6d5('0x62')]);_0x40e8ba[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x1adfe1[_0xe6d5('0x45')],_0x20431d[_0xe6d5('0x46')]));_0x40e8ba['where'][_0xe6d5('0x63')]=_0x167a0c['id'];if(_0x1adfe1['query'][_0xe6d5('0x4e')]){_0x40e8ba[_0xe6d5('0x4c')]=_[_0xe6d5('0x4f')](_0x40e8ba['where'],{'$or':_['map'](_0x40e8ba[_0xe6d5('0x48')],function(_0x3cc66e){var _0x2f29c8={};_0x2f29c8[_0x3cc66e]={'$like':'%'+_0x1adfe1['query'][_0xe6d5('0x4e')]+'%'};return _0x2f29c8;})});}_0x40e8ba=_[_0xe6d5('0x4f')]({},_0x40e8ba,_0x1adfe1['options']);return db[_0xe6d5('0x61')][_0xe6d5('0x2c')]({'where':_0x40e8ba[_0xe6d5('0x4c')]})[_0xe6d5('0x34')](function(_0x5034c1){_0x4a9b21[_0xe6d5('0x2c')]=_0x5034c1;if(_0x1adfe1[_0xe6d5('0x45')][_0xe6d5('0x5a')]){_0x40e8ba[_0xe6d5('0x54')]=[{'all':!![]}];}return db['Disposition'][_0xe6d5('0x55')](_0x40e8ba);})[_0xe6d5('0x34')](function(_0x1126a8){_0x4a9b21[_0xe6d5('0x56')]=_0x1126a8;return _0x4a9b21;});}})[_0xe6d5('0x34')](respondWithFilteredResult(_0x1e21c9,_0x40e8ba))['catch'](handleError(_0x1e21c9,null));};exports[_0xe6d5('0x64')]=function(_0x5aad97,_0x32b3c3,_0x1ab6ca){return db['MailAccount'][_0xe6d5('0x5b')]({'where':{'id':_0x5aad97[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x32b3c3,null))['then'](function(_0x4bc6c6){if(_0x4bc6c6){return _0x4bc6c6[_0xe6d5('0x64')](_0x5aad97[_0xe6d5('0x45')][_0xe6d5('0x65')]);}})['then'](respondWithStatusCode(_0x32b3c3,null))['catch'](handleError(_0x32b3c3,null));};exports[_0xe6d5('0x66')]=function(_0x41bf18,_0x12ea3a,_0x1d7af0){if(_0x41bf18['body']['id']){delete _0x41bf18['body']['id'];}return db['MailAccount'][_0xe6d5('0x5b')]({'where':{'id':_0x41bf18[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x12ea3a,null))['then'](function(_0x1646f9){if(_0x1646f9){_0x41bf18[_0xe6d5('0x5c')][_0xe6d5('0x63')]=_0x1646f9['id'];return db[_0xe6d5('0x67')][_0xe6d5('0x68')](_0x41bf18[_0xe6d5('0x5c')]);}})['then'](respondWithResult(_0x12ea3a,null))[_0xe6d5('0x28')](handleError(_0x12ea3a,null));};exports[_0xe6d5('0x69')]=function(_0x291332,_0xe1ed34,_0x52cc47){var _0xb8ee1f={'raw':![],'where':{}};var _0x203cc9={};var _0x5a8b08={'count':0x0,'rows':[]};return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x291332[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0xe1ed34,null))['then'](function(_0x559ed5){if(_0x559ed5){_0x203cc9[_0xe6d5('0x43')]=_[_0xe6d5('0x44')](db[_0xe6d5('0x67')]['rawAttributes']);_0x203cc9[_0xe6d5('0x45')]=_['keys'](_0x291332['query']);_0x203cc9[_0xe6d5('0x46')]=_['intersection'](_0x203cc9[_0xe6d5('0x43')],_0x203cc9[_0xe6d5('0x45')]);_0xb8ee1f[_0xe6d5('0x48')]=_['intersection'](_0x203cc9[_0xe6d5('0x43')],qs[_0xe6d5('0x49')](_0x291332[_0xe6d5('0x45')]['fields']));_0xb8ee1f[_0xe6d5('0x48')]=_0xb8ee1f[_0xe6d5('0x48')]['length']?_0xb8ee1f[_0xe6d5('0x48')]:_0x203cc9[_0xe6d5('0x43')];if(!_0x291332[_0xe6d5('0x45')][_0xe6d5('0x4a')]('nolimit')){_0xb8ee1f[_0xe6d5('0x2e')]=qs[_0xe6d5('0x2e')](_0x291332[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0xb8ee1f['offset']=qs['offset'](_0x291332['query'][_0xe6d5('0x2d')]);}_0xb8ee1f[_0xe6d5('0x6a')]=qs[_0xe6d5('0x62')](_0x291332[_0xe6d5('0x45')]['sort']);_0xb8ee1f[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x291332['query'],_0x203cc9[_0xe6d5('0x46')]));_0xb8ee1f[_0xe6d5('0x4c')]['MailAccountId']=_0x559ed5['id'];if(_0x291332['query'][_0xe6d5('0x4e')]){_0xb8ee1f['where']=_[_0xe6d5('0x4f')](_0xb8ee1f[_0xe6d5('0x4c')],{'$or':_[_0xe6d5('0x50')](_0xb8ee1f[_0xe6d5('0x48')],function(_0x43eafb){var _0x1e6c5c={};_0x1e6c5c[_0x43eafb]={'$like':'%'+_0x291332[_0xe6d5('0x45')][_0xe6d5('0x4e')]+'%'};return _0x1e6c5c;})});}_0xb8ee1f=_[_0xe6d5('0x4f')]({},_0xb8ee1f,_0x291332['options']);return db[_0xe6d5('0x67')][_0xe6d5('0x2c')]({'where':_0xb8ee1f[_0xe6d5('0x4c')]})[_0xe6d5('0x34')](function(_0x5662fd){_0x5a8b08[_0xe6d5('0x2c')]=_0x5662fd;if(_0x291332['query'][_0xe6d5('0x5a')]){_0xb8ee1f[_0xe6d5('0x54')]=[{'all':!![]}];}return db[_0xe6d5('0x67')]['findAll'](_0xb8ee1f);})[_0xe6d5('0x34')](function(_0x1ac560){_0x5a8b08[_0xe6d5('0x56')]=_0x1ac560;return _0x5a8b08;});}})[_0xe6d5('0x34')](respondWithFilteredResult(_0xe1ed34,_0xb8ee1f))[_0xe6d5('0x28')](handleError(_0xe1ed34,null));};exports[_0xe6d5('0x6b')]=function(_0x4ccc92,_0x372d15,_0x1b163d){return db[_0xe6d5('0x41')][_0xe6d5('0x5b')]({'where':{'id':_0x4ccc92[_0xe6d5('0x58')]['id']}})['then'](handleEntityNotFound(_0x372d15,null))[_0xe6d5('0x34')](function(_0x56845e){if(_0x56845e){return _0x56845e[_0xe6d5('0x6b')](_0x4ccc92['query'][_0xe6d5('0x65')]);}})[_0xe6d5('0x34')](respondWithStatusCode(_0x372d15,null))[_0xe6d5('0x28')](handleError(_0x372d15,null));};exports[_0xe6d5('0x68')]=function(_0x36b863,_0x1fc646){var _0x1cd1a5={'name':_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x38')],'key':_0x36b863['body'][_0xe6d5('0x6c')],'email':_0x36b863['body'][_0xe6d5('0x6d')],'ListId':_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x6e')],'active':!_[_0xe6d5('0x6f')](_0x36b863[_0xe6d5('0x5c')]['active'])?_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x70')]:!![],'description':_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0xe6d5('0x6f')](_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x72')])){if(_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x73')]){_0x1cd1a5[_0xe6d5('0x3c')][_0xe6d5('0x74')]=_0x1cd1a5[_0xe6d5('0x3e')][_0xe6d5('0x74')]=_0x36b863[_0xe6d5('0x5c')]['cuser'];_0x1cd1a5[_0xe6d5('0x3c')][_0xe6d5('0x75')]=_0x1cd1a5['Smtp'][_0xe6d5('0x76')]=_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x77')];}else{_0x1cd1a5[_0xe6d5('0x3c')][_0xe6d5('0x78')]=_0x1cd1a5[_0xe6d5('0x3e')][_0xe6d5('0x78')]=![];}_0x1cd1a5[_0xe6d5('0x3c')]['host']=_0x36b863['body'][_0xe6d5('0x3c')]['host'];_0x1cd1a5['Imap']['port']=_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x3c')][_0xe6d5('0x79')];_0x1cd1a5[_0xe6d5('0x3e')][_0xe6d5('0x7a')]=_0x36b863[_0xe6d5('0x5c')]['Smtp'][_0xe6d5('0x7a')];_0x1cd1a5['Smtp'][_0xe6d5('0x79')]=_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x3e')][_0xe6d5('0x79')];}else{_0x1cd1a5[_0xe6d5('0x3c')][_0xe6d5('0x7b')]=_0x1cd1a5[_0xe6d5('0x3e')]['service']=_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x72')];_0x1cd1a5[_0xe6d5('0x3c')]['user']=_0x1cd1a5['Smtp'][_0xe6d5('0x74')]=_0x36b863['body'][_0xe6d5('0x7c')];_0x1cd1a5[_0xe6d5('0x3c')][_0xe6d5('0x75')]=_0x1cd1a5[_0xe6d5('0x3e')][_0xe6d5('0x76')]=_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x77')];}return db[_0xe6d5('0x41')][_0xe6d5('0x68')](_0x1cd1a5,{'include':[{'model':db[_0xe6d5('0x3d')],'as':_0xe6d5('0x3e')},{'model':db['MailServerIn'],'as':_0xe6d5('0x3c')}]})[_0xe6d5('0x34')](function(_0x2b55ee){var _0x4d1db0=_0x36b863[_0xe6d5('0x74')][_0xe6d5('0x7d')]({'plain':!![]});if(!_0x4d1db0)throw new Error(_0xe6d5('0x7e'));if(_0x4d1db0[_0xe6d5('0x7f')]===_0xe6d5('0x74')){var _0x1de88e=_0x2b55ee[_0xe6d5('0x7d')]({'plain':!![]});return db[_0xe6d5('0x80')][_0xe6d5('0x5b')]({'where':{'name':_0xe6d5('0x35'),'userProfileId':_0x4d1db0['userProfileId']},'raw':!![]})['then'](function(_0x50857f){if(_0x50857f&&_0x50857f[_0xe6d5('0x81')]===0x0){return db[_0xe6d5('0x82')]['create']({'name':_0x1de88e[_0xe6d5('0x38')],'resourceId':_0x1de88e['id'],'type':_0x50857f['name'],'sectionId':_0x50857f['id']},{})[_0xe6d5('0x34')](function(){return _0x2b55ee;});}else{return _0x2b55ee;}})[_0xe6d5('0x28')](function(_0x5a4caa){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a4caa);throw _0x5a4caa;});}return _0x2b55ee;})[_0xe6d5('0x34')](respondWithResult(_0x1fc646,0xc9))[_0xe6d5('0x28')](handleError(_0x1fc646,null));};exports[_0xe6d5('0x83')]=function(_0x42f00f,_0x3c5c4f,_0x2896fc){return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x42f00f[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x3c5c4f,null))[_0xe6d5('0x34')](function(_0x11a774){if(_0x11a774){return _0x11a774[_0xe6d5('0x83')]();}return null;})['then'](respondWithResult(_0x3c5c4f,null))[_0xe6d5('0x28')](handleError(_0x3c5c4f,null));};exports[_0xe6d5('0x84')]=function(_0x569043,_0x4c328a,_0x2262d6){if(_0x569043[_0xe6d5('0x5c')]['id']){delete _0x569043['body']['id'];}return db[_0xe6d5('0x41')]['find']({'where':{'id':_0x569043['params']['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x4c328a,null))['then'](function(_0x2de93a){if(_0x2de93a){_0x569043['body'][_0xe6d5('0x63')]=_0x2de93a['id'];return db['MailServerIn'][_0xe6d5('0x68')](_0x569043[_0xe6d5('0x5c')]);}})[_0xe6d5('0x34')](respondWithResult(_0x4c328a,null))['catch'](handleError(_0x4c328a,null));};exports[_0xe6d5('0x85')]=function(_0x55a61e,_0xa3b631,_0x3ace1b){return db['MailAccount'][_0xe6d5('0x60')]({'where':{'id':_0x55a61e[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0xa3b631,null))[_0xe6d5('0x34')](function(_0x13c9a7){if(_0x13c9a7){return _0x13c9a7[_0xe6d5('0x86')](null);}return null;})[_0xe6d5('0x34')](respondWithStatusCode(_0xa3b631,null))[_0xe6d5('0x28')](handleError(_0xa3b631,null));};exports[_0xe6d5('0x87')]=function(_0x309d55,_0x3fea0b,_0x21eda6){return db[_0xe6d5('0x41')]['findOne']({'where':{'id':_0x309d55[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x3fea0b,null))['then'](function(_0x321567){if(_0x321567){return _0x321567[_0xe6d5('0x87')]();}return null;})['then'](respondWithResult(_0x3fea0b,null))[_0xe6d5('0x28')](handleError(_0x3fea0b,null));};exports[_0xe6d5('0x88')]=function(_0x1b7b11,_0x5b097e,_0x599efd){if(_0x1b7b11['body']['id']){delete _0x1b7b11[_0xe6d5('0x5c')]['id'];}return db[_0xe6d5('0x41')]['find']({'where':{'id':_0x1b7b11[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x5b097e,null))[_0xe6d5('0x34')](function(_0x46e342){if(_0x46e342){_0x1b7b11[_0xe6d5('0x5c')][_0xe6d5('0x63')]=_0x46e342['id'];return db[_0xe6d5('0x3d')][_0xe6d5('0x68')](_0x1b7b11[_0xe6d5('0x5c')]);}})['then'](respondWithResult(_0x5b097e,null))['catch'](handleError(_0x5b097e,null));};exports[_0xe6d5('0x89')]=function(_0x48d48d,_0x8876,_0x4c3108){return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x48d48d[_0xe6d5('0x58')]['id']}})['then'](handleEntityNotFound(_0x8876,null))[_0xe6d5('0x34')](function(_0x47cde0){if(_0x47cde0){return _0x47cde0[_0xe6d5('0x8a')](null);}return null;})['then'](respondWithStatusCode(_0x8876,null))[_0xe6d5('0x28')](handleError(_0x8876,null));};exports[_0xe6d5('0x8b')]=function(_0x5c6421,_0xf4f108,_0x209a1e){return db[_0xe6d5('0x8c')][_0xe6d5('0x5b')]({'where':{'id':_0x5c6421[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0xf4f108,null))[_0xe6d5('0x34')](function(_0x361a64){if(_0x361a64){return _0x361a64[_0xe6d5('0x8b')](_0x5c6421[_0xe6d5('0x5c')]['ids'],_[_0xe6d5('0x8d')](_0x5c6421['body'],[_0xe6d5('0x65'),'id'])||{});}})['then'](respondWithResult(_0xf4f108,null))[_0xe6d5('0x28')](handleError(_0xf4f108,null));};exports[_0xe6d5('0x8e')]=function(_0x5ee4dd,_0x1c1b1b,_0x4650f0){var _0x66c6d2={'raw':![],'where':{}};var _0x2e0201={};var _0x23ea96={'count':0x0,'rows':[]};return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x5ee4dd[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x1c1b1b,null))[_0xe6d5('0x34')](function(_0x2f3992){if(_0x2f3992){_0x2e0201[_0xe6d5('0x43')]=_[_0xe6d5('0x44')](db[_0xe6d5('0x8c')][_0xe6d5('0x42')]);_0x2e0201[_0xe6d5('0x45')]=_[_0xe6d5('0x44')](_0x5ee4dd[_0xe6d5('0x45')]);_0x2e0201[_0xe6d5('0x46')]=_['intersection'](_0x2e0201['model'],_0x2e0201['query']);_0x66c6d2['attributes']=_[_0xe6d5('0x47')](_0x2e0201['model'],qs['fields'](_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x49')]));_0x66c6d2['attributes']=_0x66c6d2[_0xe6d5('0x48')][_0xe6d5('0x59')]?_0x66c6d2[_0xe6d5('0x48')]:_0x2e0201[_0xe6d5('0x43')];if(!_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x4a')]('nolimit')){_0x66c6d2[_0xe6d5('0x2e')]=qs['limit'](_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0x66c6d2[_0xe6d5('0x2d')]=qs[_0xe6d5('0x2d')](_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x2d')]);}_0x66c6d2[_0xe6d5('0x6a')]=qs[_0xe6d5('0x62')](_0x5ee4dd['query'][_0xe6d5('0x62')]);_0x66c6d2['where']=qs[_0xe6d5('0x46')](_['pick'](_0x5ee4dd[_0xe6d5('0x45')],_0x2e0201[_0xe6d5('0x46')]));_0x66c6d2[_0xe6d5('0x4c')][_0xe6d5('0x63')]=_0x2f3992['id'];if(_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x4e')]){_0x66c6d2['where']=_[_0xe6d5('0x4f')](_0x66c6d2['where'],{'$or':_[_0xe6d5('0x50')](_0x66c6d2[_0xe6d5('0x48')],function(_0x4c1c23){var _0xfbca64={};_0xfbca64[_0x4c1c23]={'$like':'%'+_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x4e')]+'%'};return _0xfbca64;})});}_0x66c6d2=_['merge']({},_0x66c6d2,_0x5ee4dd[_0xe6d5('0x53')]);return db[_0xe6d5('0x8c')]['count']({'where':_0x66c6d2['where']})[_0xe6d5('0x34')](function(_0x39e03b){_0x23ea96[_0xe6d5('0x2c')]=_0x39e03b;if(_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x5a')]){_0x66c6d2[_0xe6d5('0x54')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xe6d5('0x8f'),'attributes':[_0xe6d5('0x38'),'fullname',_0xe6d5('0x90')],'required':![]},{'model':db[_0xe6d5('0x91')],'as':'Tags','attributes':['id',_0xe6d5('0x38'),'color'],'where':_0x5ee4dd[_0xe6d5('0x45')]['tag']?{'id':_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x92')]}:undefined,'required':_0x5ee4dd['query'][_0xe6d5('0x92')]?!![]:![]}];}return db['MailInteraction'][_0xe6d5('0x55')](_0x66c6d2);})[_0xe6d5('0x34')](function(_0x4ae7c1){_0x23ea96[_0xe6d5('0x56')]=_0x4ae7c1;return _0x23ea96;});}})['then'](respondWithFilteredResult(_0x1c1b1b,_0x66c6d2))[_0xe6d5('0x28')](handleError(_0x1c1b1b,null));};exports[_0xe6d5('0x93')]=function(_0x2e9a0a,_0x10025,_0x145c2f){return db['MailAccount'][_0xe6d5('0x60')]({'where':{'id':_0x2e9a0a[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x10025,null))['then'](function(_0xbaf208){if(_0xbaf208){return db[_0xe6d5('0x94')]['transaction'](function(_0x45c17c){return db[_0xe6d5('0x95')][_0xe6d5('0x36')]({'where':{'MailAccountId':_0x2e9a0a['params']['id']},'transaction':_0x45c17c})[_0xe6d5('0x34')](function(_0x2d6995){var _0x576190=_['map'](_0x2e9a0a['body'],function(_0x50f3fd){_0x50f3fd[_0xe6d5('0x63')]=_0x2e9a0a['params']['id'];return _0x50f3fd;});return db[_0xe6d5('0x95')]['bulkCreate'](_0x576190,{'transaction':_0x45c17c});});})[_0xe6d5('0x34')](function(){return db[_0xe6d5('0x95')][_0xe6d5('0x96')]({'where':{'MailAccountId':_0x2e9a0a[_0xe6d5('0x58')]['id']},'order':'priority'});});}})[_0xe6d5('0x34')](respondWithResult(_0x10025,null))['catch'](handleError(_0x10025,null));};exports['getApplications']=function(_0x4087f6,_0x20072d,_0x4f7a03){var _0x2ad8bf={};var _0x1fc37f={};var _0xeee60;var _0x4b2b70;return db['MailAccount'][_0xe6d5('0x60')]({'where':{'id':_0x4087f6[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x20072d,null))[_0xe6d5('0x34')](function(_0x4bf30b){if(_0x4bf30b){_0xeee60=_0x4bf30b;_0x1fc37f['model']=_[_0xe6d5('0x44')](db[_0xe6d5('0x95')][_0xe6d5('0x42')]);_0x1fc37f['query']=_['keys'](_0x4087f6[_0xe6d5('0x45')]);_0x1fc37f['filters']=_['intersection'](_0x1fc37f[_0xe6d5('0x43')],_0x1fc37f[_0xe6d5('0x45')]);_0x2ad8bf[_0xe6d5('0x48')]=_[_0xe6d5('0x47')](_0x1fc37f['model'],qs[_0xe6d5('0x49')](_0x4087f6[_0xe6d5('0x45')][_0xe6d5('0x49')]));_0x2ad8bf[_0xe6d5('0x48')]=_0x2ad8bf[_0xe6d5('0x48')][_0xe6d5('0x59')]?_0x2ad8bf[_0xe6d5('0x48')]:_0x1fc37f[_0xe6d5('0x43')];_0x2ad8bf[_0xe6d5('0x6a')]=qs['sort'](_0x4087f6[_0xe6d5('0x45')]['sort']);_0x2ad8bf[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x4087f6[_0xe6d5('0x45')],_0x1fc37f['filters']));if(_0x4087f6[_0xe6d5('0x45')][_0xe6d5('0x4e')]){_0x2ad8bf['where']=_[_0xe6d5('0x4f')](_0x2ad8bf[_0xe6d5('0x4c')],{'$or':_['map'](_0x2ad8bf[_0xe6d5('0x48')],function(_0x36ab30){var _0x5e16c8={};_0x5e16c8[_0x36ab30]={'$like':'%'+_0x4087f6[_0xe6d5('0x45')][_0xe6d5('0x4e')]+'%'};return _0x5e16c8;})});}_0x2ad8bf=_['merge']({},_0x2ad8bf,_0x4087f6[_0xe6d5('0x53')]);return _0xeee60['getApplications'](_0x2ad8bf);}})[_0xe6d5('0x34')](function(_0x18c4b5){if(_0x18c4b5){_0x4b2b70=_0x18c4b5[_0xe6d5('0x59')];if(!_0x4087f6[_0xe6d5('0x45')][_0xe6d5('0x4a')](_0xe6d5('0x4b'))){_0x2ad8bf[_0xe6d5('0x2e')]=qs[_0xe6d5('0x2e')](_0x4087f6[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0x2ad8bf['offset']=qs[_0xe6d5('0x2d')](_0x4087f6['query'][_0xe6d5('0x2d')]);}return _0xeee60[_0xe6d5('0x97')](_0x2ad8bf);}})[_0xe6d5('0x34')](function(_0xf010e4){if(_0xf010e4){return _0xf010e4?{'count':_0x4b2b70,'rows':_0xf010e4}:null;}})['then'](respondWithResult(_0x20072d,null))[_0xe6d5('0x28')](handleError(_0x20072d,null));};exports[_0xe6d5('0x98')]=function(_0x300780,_0x12eaf5,_0x18d7a6){var _0x42f7e9={'raw':!![],'where':{}};var _0x33be88={};var _0x5ce771={'count':0x0,'rows':[]};return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x300780['params']['id']}})['then'](handleEntityNotFound(_0x12eaf5,null))[_0xe6d5('0x34')](function(_0x3ea4b6){if(_0x3ea4b6){_0x33be88['model']=_[_0xe6d5('0x44')](db[_0xe6d5('0x99')]['rawAttributes']);_0x33be88[_0xe6d5('0x45')]=_[_0xe6d5('0x44')](_0x300780['query']);_0x33be88[_0xe6d5('0x46')]=_['intersection'](_0x33be88[_0xe6d5('0x43')],_0x33be88[_0xe6d5('0x45')]);_0x42f7e9[_0xe6d5('0x48')]=_[_0xe6d5('0x47')](_0x33be88[_0xe6d5('0x43')],qs[_0xe6d5('0x49')](_0x300780[_0xe6d5('0x45')][_0xe6d5('0x49')]));_0x42f7e9[_0xe6d5('0x48')]=_0x42f7e9[_0xe6d5('0x48')][_0xe6d5('0x59')]?_0x42f7e9[_0xe6d5('0x48')]:_0x33be88[_0xe6d5('0x43')];if(!_0x300780[_0xe6d5('0x45')][_0xe6d5('0x4a')](_0xe6d5('0x4b'))){_0x42f7e9[_0xe6d5('0x2e')]=qs[_0xe6d5('0x2e')](_0x300780[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0x42f7e9[_0xe6d5('0x2d')]=qs['offset'](_0x300780['query'][_0xe6d5('0x2d')]);}_0x42f7e9[_0xe6d5('0x6a')]=qs[_0xe6d5('0x62')](_0x300780['query'][_0xe6d5('0x62')]);_0x42f7e9[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x300780[_0xe6d5('0x45')],_0x33be88[_0xe6d5('0x46')]));_0x42f7e9[_0xe6d5('0x4c')]['MailAccountId']=_0x3ea4b6['id'];if(_0x300780['query'][_0xe6d5('0x4e')]){_0x42f7e9[_0xe6d5('0x4c')]=_[_0xe6d5('0x4f')](_0x42f7e9[_0xe6d5('0x4c')],{'$or':_[_0xe6d5('0x50')](_0x42f7e9[_0xe6d5('0x48')],function(_0x481079){var _0x5cbd37={};_0x5cbd37[_0x481079]={'$like':'%'+_0x300780['query'][_0xe6d5('0x4e')]+'%'};return _0x5cbd37;})});}if(_0x300780[_0xe6d5('0x45')][_0xe6d5('0x9a')]){var _0x43df2f=_0x300780[_0xe6d5('0x45')][_0xe6d5('0x9a')][_0xe6d5('0x9b')](',');var _0x5531af={};_0x5531af[_0x43df2f[0x0]]={'$gte':moment(_0x43df2f[0x1])[_0xe6d5('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x42f7e9['where']=_[_0xe6d5('0x4f')](_0x42f7e9[_0xe6d5('0x4c')],_0x5531af);}_0x42f7e9=_[_0xe6d5('0x4f')]({},_0x42f7e9,_0x300780[_0xe6d5('0x53')]);return db[_0xe6d5('0x99')][_0xe6d5('0x2c')]({'where':_0x42f7e9[_0xe6d5('0x4c')]})['then'](function(_0x582908){_0x5ce771[_0xe6d5('0x2c')]=_0x582908;if(_0x300780[_0xe6d5('0x45')][_0xe6d5('0x5a')]){_0x42f7e9[_0xe6d5('0x54')]=[{'all':!![]}];}return db['MailMessage'][_0xe6d5('0x55')](_0x42f7e9);})[_0xe6d5('0x34')](function(_0x336191){_0x5ce771[_0xe6d5('0x56')]=_0x336191;return _0x5ce771;});}})[_0xe6d5('0x34')](respondWithFilteredResult(_0x12eaf5,_0x42f7e9))[_0xe6d5('0x28')](handleError(_0x12eaf5,null));};exports['send']=function(_0x169a03,_0x2e07cd,_0x56a12b){var _0x21a7e5,_0x5ca46b={},_0x50e672;if(_0x169a03[_0xe6d5('0x5c')]['to']){_0x50e672=_0x169a03[_0xe6d5('0x5c')]['to'][_0xe6d5('0x9b')](',')[0x0];}return db['MailAccount'][_0xe6d5('0x5b')]({'where':{'id':_0x169a03[_0xe6d5('0x58')]['id']},'include':[{'model':db[_0xe6d5('0x9d')],'as':_0xe6d5('0x9e'),'include':[{'model':db[_0xe6d5('0x9f')],'as':_0xe6d5('0xa0'),'where':{'email':_0x50e672},'limit':0x1,'order':[[_0xe6d5('0xa1'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0xe6d5('0x3e'),'raw':!![]}]})[_0xe6d5('0x34')](handleEntityNotFound(_0x2e07cd,null))[_0xe6d5('0x34')](function(_0x4a9f76){if(_0x4a9f76){_0x21a7e5=_0x4a9f76;if(_0x4a9f76[_0xe6d5('0x3e')]){if(_[_0xe6d5('0x6f')](_0x169a03['body']['from'])){_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xa2')]=util['format'](_0xe6d5('0xa3'),_0x4a9f76['name'],_0x4a9f76[_0xe6d5('0x6d')]||_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x74')]);}if(_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xa4')]&&_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xa4')]['length']){for(var _0xf58202=0x0;_0xf58202<_0x169a03['body'][_0xe6d5('0xa4')][_0xe6d5('0x59')];_0xf58202+=0x1){_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xa4')][_0xf58202]={'filename':_0x169a03[_0xe6d5('0x5c')]['attachments'][_0xf58202][_0xe6d5('0x38')],'path':path[_0xe6d5('0xa5')](config['root'],'server/files/attachments',_0x169a03['body'][_0xe6d5('0xa4')][_0xf58202][_0xe6d5('0xa6')])};}}var _0x2ef5d3={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4a9f76['Smtp']['service'])){if(_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x78')]){_0x2ef5d3[_0xe6d5('0xa7')]={'user':_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x74')],'pass':_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x76')]};}_0x2ef5d3[_0xe6d5('0x7a')]=_0x4a9f76['Smtp']['host'];_0x2ef5d3[_0xe6d5('0x79')]=_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x79')];_0x2ef5d3[_0xe6d5('0xa8')]=_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0xa8')];}else{_0x2ef5d3['service']=_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x7b')];_0x2ef5d3['auth']={'user':_0x4a9f76['Smtp'][_0xe6d5('0x74')],'pass':_0x4a9f76[_0xe6d5('0x3e')]['pass']};}return respondWithRpcPromise(_0xe6d5('0xa9'),'sendMail',{'account':_0x2ef5d3,'message':_0x169a03[_0xe6d5('0x5c')]});}else{throw new Error(_0xe6d5('0xaa'));}}})[_0xe6d5('0x34')](function(_0x479d6a){if(_0x479d6a){_0x5ca46b=_0x479d6a;if(_0x21a7e5[_0xe6d5('0x9e')]){if(_0x21a7e5['List'][_0xe6d5('0xa0')]['length']){return _0x21a7e5[_0xe6d5('0x9e')][_0xe6d5('0xa0')][0x0];}else{return db[_0xe6d5('0x9f')][_0xe6d5('0x68')](_[_0xe6d5('0x16')](_0x169a03[_0xe6d5('0x5c')],{'firstName':_0x169a03[_0xe6d5('0x5c')]['to'],'email':_0x169a03['body']['to'],'phone':_0x169a03[_0xe6d5('0x5c')]['to'],'ListId':_0x21a7e5[_0xe6d5('0x6e')]}));}}else{throw new Error(_0xe6d5('0xaa'));}}})[_0xe6d5('0x34')](function(_0x1ec885){if(_0x1ec885){var _0x22521e={'UserId':_0x169a03[_0xe6d5('0x74')]['id'],'ContactId':_0x1ec885['id'],'MailAccountId':_0x21a7e5['id'],'inReplyTo':_0x5ca46b[_0xe6d5('0xab')],'to':_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xa2')],'cc':_0x169a03['body']['cc'],'subject':_0x169a03['body'][_0xe6d5('0xac')],'attach':_0x169a03['body']['attach'],'firstMsgDirection':_0xe6d5('0xad'),'lastMsgAt':moment()[_0xe6d5('0x9c')](_0xe6d5('0xae')),'lastMsgDirection':_0xe6d5('0xad'),'lastMsgBody':_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0x5c')],'Messages':[_['merge'](_0x169a03[_0xe6d5('0x5c')],{'messageId':_0x5ca46b[_0xe6d5('0xab')],'sentAt':moment()[_0xe6d5('0x9c')](_0xe6d5('0xae')),'read':!![],'MailAccountId':_0x21a7e5['id'],'UserId':_0x169a03[_0xe6d5('0x74')]['id'],'ContactId':_0x1ec885['id']})]};if(_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xaf')]){_0x22521e=_[_0xe6d5('0x4f')](_0x22521e,_0x169a03['body']['Interaction']);}return db[_0xe6d5('0x8c')][_0xe6d5('0x68')](_0x22521e,{'include':[{'model':db[_0xe6d5('0x99')],'as':'Messages'}]});}})[_0xe6d5('0x34')](respondWithResult(_0x2e07cd,null))['catch'](handleError(_0x2e07cd,null));};exports[_0xe6d5('0xb0')]=function(_0x86ffe,_0x3a07ed,_0x393122){return db['MailAccount']['find']({'where':{'id':_0x86ffe[_0xe6d5('0x58')]['id']},'include':[{'model':db[_0xe6d5('0x3d')],'as':_0xe6d5('0x3e'),'raw':!![]}]})['then'](handleEntityNotFound(_0x3a07ed,null))[_0xe6d5('0x34')](function(_0x5dcb2c){if(_0x5dcb2c&&_0x5dcb2c[_0xe6d5('0x3e')]){var _0x1469e4={'id':_0x5dcb2c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5dcb2c[_0xe6d5('0x3e')][_0xe6d5('0x7b')]){_0x1469e4[_0xe6d5('0x7b')]=_0x5dcb2c[_0xe6d5('0x3e')]['service'];}else{_0x1469e4['host']=_0x5dcb2c[_0xe6d5('0x3e')]['host'];_0x1469e4[_0xe6d5('0x79')]=_0x5dcb2c[_0xe6d5('0x3e')][_0xe6d5('0x79')];_0x1469e4[_0xe6d5('0xa8')]=_0x5dcb2c[_0xe6d5('0x3e')][_0xe6d5('0xa8')];}if(_0x5dcb2c[_0xe6d5('0x3e')][_0xe6d5('0x78')]){_0x1469e4[_0xe6d5('0xa7')]={'user':_0x5dcb2c[_0xe6d5('0x3e')][_0xe6d5('0x74')],'pass':_0x5dcb2c[_0xe6d5('0x3e')]['pass']};}return respondWithRpcPromise(_0xe6d5('0xb1'),'verifySmtp',{'account':_0x1469e4});}})[_0xe6d5('0x34')](respondWithResult(_0x3a07ed,null))[_0xe6d5('0x28')](handleError(_0x3a07ed,null));};exports[_0xe6d5('0x36')]=function(_0x5d5312,_0x340da0){return db[_0xe6d5('0x41')][_0xe6d5('0x5b')]({'where':{'id':_0x5d5312[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x340da0,null))[_0xe6d5('0x34')](function(_0x523e2f){if(_0x523e2f&&_0x523e2f['service']){throw new db[(_0xe6d5('0xb2'))][(_0xe6d5('0xb3'))](_0xe6d5('0xb4'));}return _0x523e2f;})['then'](removeEntity(_0x340da0,null))['catch'](handleError(_0x340da0,null));};exports[_0xe6d5('0xb5')]=function(_0x39581e,_0x49dd5e,_0x1ddf60){return db['MailAccount'][_0xe6d5('0x5b')]({'where':{'id':_0x39581e[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x49dd5e,null))[_0xe6d5('0x34')](function(_0x35f402){if(_0x35f402){return _0x35f402[_0xe6d5('0xb5')](_0x39581e[_0xe6d5('0x5c')][_0xe6d5('0x65')],_['omit'](_0x39581e[_0xe6d5('0x5c')],['ids','id'])||{})[_0xe6d5('0xb6')](function(_0xd98fa3){for(var _0x15f150=0x0;_0x15f150<_0x39581e['body'][_0xe6d5('0x65')][_0xe6d5('0x59')];_0x15f150+=0x1){socket[_0xe6d5('0xb7')](_0xe6d5('0xb8'),{'UserId':_0x39581e['body']['ids'][_0x15f150],'MailAccountId':_0x39581e[_0xe6d5('0x58')]['id']});}return _0xd98fa3;});}})['then'](respondWithResult(_0x49dd5e,null))[_0xe6d5('0x28')](handleError(_0x49dd5e,null));};exports[_0xe6d5('0xb9')]=function(_0x3016cb,_0xcfb44c,_0x51c274){return db[_0xe6d5('0x41')][_0xe6d5('0x5b')]({'where':{'id':_0x3016cb[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0xcfb44c,null))[_0xe6d5('0x34')](function(_0x4ae27c){if(_0x4ae27c){return _0x4ae27c[_0xe6d5('0xb9')](_0x3016cb[_0xe6d5('0x45')][_0xe6d5('0x65')])[_0xe6d5('0x34')](function(){if(_[_0xe6d5('0xba')](_0x3016cb['query'][_0xe6d5('0x65')])){for(var _0x5d927d=0x0;_0x5d927d<_0x3016cb['query']['ids'][_0xe6d5('0x59')];_0x5d927d+=0x1){socket[_0xe6d5('0xb7')](_0xe6d5('0xbb'),{'UserId':Number(_0x3016cb[_0xe6d5('0x45')]['ids'][_0x5d927d]),'MailAccountId':Number(_0x3016cb[_0xe6d5('0x58')]['id'])});}}else{socket['emit'](_0xe6d5('0xbb'),{'UserId':Number(_0x3016cb[_0xe6d5('0x45')][_0xe6d5('0x65')]),'MailAccountId':Number(_0x3016cb[_0xe6d5('0x58')]['id'])});}});}})[_0xe6d5('0x34')](respondWithStatusCode(_0xcfb44c,null))[_0xe6d5('0x28')](handleError(_0xcfb44c,null));};exports['getAgents']=function(_0x48afa7,_0x20e010,_0x4bac10){var _0x2fcead={};var _0x8ebb6a={};var _0x4fe787;var _0x6d7e19;return db['MailAccount']['findOne']({'where':{'id':_0x48afa7[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x20e010,null))['then'](function(_0x1e4ebd){if(_0x1e4ebd){_0x4fe787=_0x1e4ebd;_0x8ebb6a[_0xe6d5('0x43')]=_[_0xe6d5('0x44')](db[_0xe6d5('0xbc')][_0xe6d5('0x42')]);_0x8ebb6a[_0xe6d5('0x45')]=_[_0xe6d5('0x44')](_0x48afa7[_0xe6d5('0x45')]);_0x8ebb6a[_0xe6d5('0x46')]=_[_0xe6d5('0x47')](_0x8ebb6a[_0xe6d5('0x43')],_0x8ebb6a['query']);_0x2fcead[_0xe6d5('0x48')]=_['intersection'](_0x8ebb6a['model'],qs[_0xe6d5('0x49')](_0x48afa7['query'][_0xe6d5('0x49')]));_0x2fcead['attributes']=_0x2fcead['attributes'][_0xe6d5('0x59')]?_0x2fcead[_0xe6d5('0x48')]:_0x8ebb6a[_0xe6d5('0x43')];_0x2fcead[_0xe6d5('0x6a')]=qs[_0xe6d5('0x62')](_0x48afa7['query'][_0xe6d5('0x62')]);_0x2fcead[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x48afa7[_0xe6d5('0x45')],_0x8ebb6a['filters']));if(_0x48afa7['query'][_0xe6d5('0x4e')]){_0x2fcead[_0xe6d5('0x4c')]=_[_0xe6d5('0x4f')](_0x2fcead[_0xe6d5('0x4c')],{'$or':_['map'](_0x2fcead['attributes'],function(_0xe73271){var _0x4187d1={};_0x4187d1[_0xe73271]={'$like':'%'+_0x48afa7[_0xe6d5('0x45')]['filter']+'%'};return _0x4187d1;})});}_0x2fcead=_[_0xe6d5('0x4f')]({},_0x2fcead,_0x48afa7[_0xe6d5('0x53')]);return _0x4fe787[_0xe6d5('0xbd')](_0x2fcead);}})[_0xe6d5('0x34')](function(_0x277247){if(_0x277247){_0x6d7e19=_0x277247[_0xe6d5('0x59')];if(!_0x48afa7[_0xe6d5('0x45')][_0xe6d5('0x4a')](_0xe6d5('0x4b'))){_0x2fcead['limit']=qs['limit'](_0x48afa7[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0x2fcead['offset']=qs[_0xe6d5('0x2d')](_0x48afa7[_0xe6d5('0x45')][_0xe6d5('0x2d')]);}return _0x4fe787['getAgents'](_0x2fcead);}})[_0xe6d5('0x34')](function(_0x451e4f){if(_0x451e4f){return _0x451e4f?{'count':_0x6d7e19,'rows':_0x451e4f}:null;}})[_0xe6d5('0x34')](respondWithResult(_0x20e010,null))['catch'](handleError(_0x20e010,null));};
\ No newline at end of file
+var _0xd301=['send','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','Smtp','include','find','update','body','describe','addDisposition','Disposition','create','getDispositions','findOne','MailAccountId','removeDispositions','ids','CannedAnswer','getAnswers','nolimit','removeAnswers','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','MailApplication','bulkCreate','getApplications','getMessages','MailMessage','$gte','split','format','CmList','List','Contacts','updatedAt','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','User','getAgents','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','MailAccounts','UserProfileResource','destroy','name'];(function(_0x3ee916,_0x32fa97){var _0x34bed9=function(_0x2337c6){while(--_0x2337c6){_0x3ee916['push'](_0x3ee916['shift']());}};_0x34bed9(++_0x32fa97);}(_0xd301,0x145));var _0x1d30=function(_0x10a480,_0x282218){_0x10a480=_0x10a480-0x0;var _0x2975c5=_0xd301[_0x10a480];return _0x2975c5;};'use strict';var pdf=require(_0x1d30('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1d30('0x1'));var rp=require(_0x1d30('0x2'));var moment=require(_0x1d30('0x3'));var BPromise=require(_0x1d30('0x4'));var Mustache=require(_0x1d30('0x5'));var util=require(_0x1d30('0x6'));var path=require(_0x1d30('0x7'));var sox=require(_0x1d30('0x8'));var csv=require(_0x1d30('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d30('0xa'));var squel=require(_0x1d30('0xb'));var crypto=require(_0x1d30('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1d30('0xd'));var toCsv=require(_0x1d30('0x9'));var querystring=require(_0x1d30('0xe'));var Papa=require(_0x1d30('0xf'));var Redis=require(_0x1d30('0x10'));var authService=require(_0x1d30('0x11'));var qs=require(_0x1d30('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d30('0x13'))(_0x1d30('0x14'));var utils=require(_0x1d30('0x15'));var config=require('../../config/environment');var db=require(_0x1d30('0x16'))['db'];config[_0x1d30('0x17')]=_[_0x1d30('0x18')](config[_0x1d30('0x17')],{'host':_0x1d30('0x19'),'port':0x18eb});var socket=require(_0x1d30('0x1a'))(new Redis(config[_0x1d30('0x17')]));require(_0x1d30('0x1b'))[_0x1d30('0x1c')](socket);var jayson=require(_0x1d30('0x1d'));var client=jayson[_0x1d30('0x1e')][_0x1d30('0x1f')]({'port':0x232b});function checkPasswordPattern(_0x4004af,_0x16a7f7,_0x110ab7){if(_0x110ab7){var _0x5caf34=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5caf34[_0x1d30('0x20')](_0x16a7f7)){return _0x4004af;}else{throw new Error(_0x1d30('0x21'));}}else{return _0x4004af;}}function respondWithRpcPromise(_0x3c8af1,_0x156950,_0x40f4b5,_0x5e54cf){return new BPromise(function(_0x59de9d,_0x17cfd3){var _0x2fb9a9=_0x5e54cf||client;return _0x2fb9a9[_0x1d30('0x22')](_0x3c8af1,_0x40f4b5)[_0x1d30('0x23')](function(_0x26e73a){logger[_0x1d30('0x24')](_0x1d30('0x25'),_0x156950,_0x1d30('0x26'));logger[_0x1d30('0x27')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x156950,_0x1d30('0x26'),JSON[_0x1d30('0x28')](_0x26e73a));if(_0x26e73a[_0x1d30('0x29')]){if(_0x26e73a[_0x1d30('0x29')][_0x1d30('0x2a')]===0x1f4){logger[_0x1d30('0x29')](_0x1d30('0x25'),_0x156950,_0x26e73a[_0x1d30('0x29')][_0x1d30('0x2b')]);return _0x17cfd3(_0x26e73a[_0x1d30('0x29')][_0x1d30('0x2b')]);}logger[_0x1d30('0x29')](_0x1d30('0x25'),_0x156950,_0x26e73a[_0x1d30('0x29')][_0x1d30('0x2b')]);return _0x59de9d(_0x26e73a[_0x1d30('0x29')]['message']);}else{logger[_0x1d30('0x24')](_0x1d30('0x25'),_0x156950,_0x1d30('0x26'));_0x59de9d(_0x26e73a[_0x1d30('0x2c')]['message']);}})['catch'](function(_0xcc539a){logger[_0x1d30('0x29')](_0x1d30('0x25'),_0x156950,_0xcc539a);_0x17cfd3(_0xcc539a);});});}function respondWithStatusCode(_0x47a073,_0x135083){_0x135083=_0x135083||0xcc;return function(_0xf4864a){if(_0xf4864a){return _0x47a073[_0x1d30('0x2d')](_0x135083);}return _0x47a073[_0x1d30('0x2e')](_0x135083)[_0x1d30('0x2f')]();};}function respondWithResult(_0x1f1221,_0x2b74fe){_0x2b74fe=_0x2b74fe||0xc8;return function(_0x59b67e){if(_0x59b67e){return _0x1f1221[_0x1d30('0x2e')](_0x2b74fe)['json'](_0x59b67e);}};}function respondWithFilteredResult(_0x50f9ef,_0x5cfde8){return function(_0x49b644){if(_0x49b644){var _0x30508d=_0x49b644[_0x1d30('0x30')],_0x58ba26=_0x5cfde8[_0x1d30('0x31')],_0x26be0a=_0x5cfde8[_0x1d30('0x31')]+_0x5cfde8[_0x1d30('0x32')],_0x11a8ac;if(_0x26be0a>=_0x30508d){_0x26be0a=_0x30508d;_0x11a8ac=0xc8;}else{_0x11a8ac=0xce;}_0x50f9ef[_0x1d30('0x2e')](_0x11a8ac);return _0x50f9ef['set'](_0x1d30('0x33'),_0x58ba26+'-'+_0x26be0a+'/'+_0x30508d)[_0x1d30('0x34')](_0x49b644);}return null;};}function patchUpdates(_0x415134){return function(_0x5d8739){try{jsonpatch[_0x1d30('0x35')](_0x5d8739,_0x415134,!![]);}catch(_0x45e324){return BPromise['reject'](_0x45e324);}return _0x5d8739[_0x1d30('0x36')]();};}function saveUpdates(_0x4ffcc0,_0x2d3638){return function(_0x334599){if(_0x334599){return _0x334599['update'](_0x4ffcc0)['then'](function(_0x1891af){return _0x1891af;});}return null;};}function removeEntity(_0x1d00d0,_0x44e3db){return function(_0x22765f){if(_0x22765f){return _0x22765f['destroy']()['then'](function(){var _0x5b5f49=_0x22765f['get']({'plain':!![]});var _0x3c5ae8=_0x1d30('0x37');return db[_0x1d30('0x38')][_0x1d30('0x39')]({'where':{'type':_0x3c5ae8,'resourceId':_0x5b5f49['id']}})[_0x1d30('0x23')](function(){return _0x22765f;});})[_0x1d30('0x23')](function(){_0x1d00d0['status'](0xcc)[_0x1d30('0x2f')]();});}};}function handleEntityNotFound(_0x5b7293,_0xb5ee87){return function(_0x31e48c){if(!_0x31e48c){_0x5b7293[_0x1d30('0x2d')](0x194);}return _0x31e48c;};}function handleError(_0x5a4f5b,_0x4b9855){_0x4b9855=_0x4b9855||0x1f4;return function(_0x11d95d){logger[_0x1d30('0x29')](_0x11d95d['stack']);if(_0x11d95d[_0x1d30('0x3a')]){delete _0x11d95d['name'];}_0x5a4f5b[_0x1d30('0x2e')](_0x4b9855)[_0x1d30('0x3b')](_0x11d95d);};}exports[_0x1d30('0x3c')]=function(_0x2234c2,_0x4ae115){var _0x1d502d={'include':[{'model':db[_0x1d30('0x3d')],'as':_0x1d30('0x3e')},{'model':db[_0x1d30('0x3f')],'as':'Smtp'},{'model':db[_0x1d30('0x40')],'as':_0x1d30('0x41')}]},_0x4c555f={},_0x489772={'count':0x0,'rows':[]};var _0x1a9e7d=db[_0x1d30('0x42')][_0x1d30('0x43')];_0x4c555f[_0x1d30('0x44')]=_['keys'](_0x1a9e7d);_0x4c555f[_0x1d30('0x45')]=_[_0x1d30('0x46')](_0x2234c2[_0x1d30('0x45')]);_0x4c555f[_0x1d30('0x47')]=_[_0x1d30('0x48')](_0x4c555f[_0x1d30('0x44')],_0x4c555f['query']);_0x1d502d['attributes']=_[_0x1d30('0x48')](_0x4c555f['model'],qs[_0x1d30('0x49')](_0x2234c2[_0x1d30('0x45')]['fields']));_0x1d502d['attributes']=_0x1d502d[_0x1d30('0x4a')][_0x1d30('0x4b')]?_0x1d502d['attributes']:_0x4c555f[_0x1d30('0x44')];if(!_0x2234c2['query'][_0x1d30('0x4c')]('nolimit')){_0x1d502d['limit']=qs[_0x1d30('0x32')](_0x2234c2['query'][_0x1d30('0x32')]);_0x1d502d['offset']=qs['offset'](_0x2234c2[_0x1d30('0x45')][_0x1d30('0x31')]);}_0x1d502d[_0x1d30('0x4d')]=qs['sort'](_0x2234c2[_0x1d30('0x45')][_0x1d30('0x4e')]);_0x1d502d[_0x1d30('0x4f')]=qs[_0x1d30('0x47')](_[_0x1d30('0x50')](_0x2234c2['query'],_0x4c555f['filters']));if(_0x2234c2[_0x1d30('0x45')][_0x1d30('0x51')]){_0x1d502d[_0x1d30('0x4f')]=_[_0x1d30('0x52')](_0x1d502d['where'],{'$or':_[_0x1d30('0x53')](_0x1a9e7d,function(_0x28bb80){if(_0x28bb80[_0x1d30('0x54')][_0x1d30('0x55')]!==_0x1d30('0x56')){var _0xe05667={};_0xe05667[_0x28bb80[_0x1d30('0x57')]]={'$like':'%'+_0x2234c2[_0x1d30('0x45')]['filter']+'%'};return _0xe05667;}})});}_0x1d502d=_['merge']({},_0x1d502d,_0x2234c2[_0x1d30('0x58')]);var _0x1fab17={'where':_0x1d502d['where']};return db['MailAccount'][_0x1d30('0x30')](_0x1fab17)[_0x1d30('0x23')](function(_0xc4ce09){_0x489772[_0x1d30('0x30')]=_0xc4ce09;if(_0x2234c2[_0x1d30('0x45')][_0x1d30('0x59')]){_0x1d502d['include']=[{'all':!![]}];}return db[_0x1d30('0x42')][_0x1d30('0x5a')](_0x1d502d);})['then'](function(_0x3dd5a5){_0x489772[_0x1d30('0x5b')]=_0x3dd5a5;return _0x489772;})['then'](respondWithFilteredResult(_0x4ae115,_0x1d502d))[_0x1d30('0x5c')](handleError(_0x4ae115,null));};exports[_0x1d30('0x5d')]=function(_0x4e69d6,_0x29c1bc){var _0x2eaba8={'raw':![],'where':{'id':_0x4e69d6[_0x1d30('0x5e')]['id']},'include':[{'model':db[_0x1d30('0x3d')],'as':_0x1d30('0x3e')},{'model':db[_0x1d30('0x3f')],'as':_0x1d30('0x5f')},{'model':db[_0x1d30('0x40')],'as':_0x1d30('0x41')}]},_0x2fd18e={};_0x2fd18e[_0x1d30('0x44')]=_[_0x1d30('0x46')](db[_0x1d30('0x42')][_0x1d30('0x43')]);_0x2fd18e['query']=_[_0x1d30('0x46')](_0x4e69d6[_0x1d30('0x45')]);_0x2fd18e[_0x1d30('0x47')]=_[_0x1d30('0x48')](_0x2fd18e[_0x1d30('0x44')],_0x2fd18e[_0x1d30('0x45')]);_0x2eaba8[_0x1d30('0x4a')]=_['intersection'](_0x2fd18e[_0x1d30('0x44')],qs[_0x1d30('0x49')](_0x4e69d6[_0x1d30('0x45')]['fields']));_0x2eaba8['attributes']=_0x2eaba8['attributes'][_0x1d30('0x4b')]?_0x2eaba8[_0x1d30('0x4a')]:_0x2fd18e[_0x1d30('0x44')];if(_0x4e69d6[_0x1d30('0x45')]['includeAll']){_0x2eaba8[_0x1d30('0x60')]=[{'all':!![]}];}_0x2eaba8=_[_0x1d30('0x52')]({},_0x2eaba8,_0x4e69d6[_0x1d30('0x58')]);return db['MailAccount'][_0x1d30('0x61')](_0x2eaba8)[_0x1d30('0x23')](handleEntityNotFound(_0x29c1bc,null))[_0x1d30('0x23')](respondWithResult(_0x29c1bc,null))['catch'](handleError(_0x29c1bc,null));};exports[_0x1d30('0x62')]=function(_0x15bc11,_0x3b44f1){if(_0x15bc11[_0x1d30('0x63')]['id']){delete _0x15bc11[_0x1d30('0x63')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x15bc11[_0x1d30('0x5e')]['id']},'include':[{'model':db[_0x1d30('0x3d')],'as':'Imap'},{'model':db[_0x1d30('0x3f')],'as':_0x1d30('0x5f')},{'model':db[_0x1d30('0x40')],'as':_0x1d30('0x41')}]})[_0x1d30('0x23')](handleEntityNotFound(_0x3b44f1,null))['then'](saveUpdates(_0x15bc11[_0x1d30('0x63')],null))[_0x1d30('0x23')](function(_0x5cef16){if(_0x5cef16&&_0x15bc11[_0x1d30('0x63')][_0x1d30('0x3e')]){return db[_0x1d30('0x3d')]['update'](_0x15bc11[_0x1d30('0x63')][_0x1d30('0x3e')],{'where':{'MailAccountId':_0x5cef16['id']}})[_0x1d30('0x23')](function(){return _0x5cef16;});}return _0x5cef16;})['then'](function(_0x4f103b){if(_0x4f103b&&_0x15bc11['body'][_0x1d30('0x5f')]){return db[_0x1d30('0x3f')][_0x1d30('0x62')](_0x15bc11[_0x1d30('0x63')]['Smtp'],{'where':{'MailAccountId':_0x4f103b['id']}})['then'](function(){return _0x4f103b;});}return _0x4f103b;})['then'](respondWithResult(_0x3b44f1,null))[_0x1d30('0x5c')](handleError(_0x3b44f1,null));};exports[_0x1d30('0x64')]=function(_0x3fa0e5,_0x36572c){return db[_0x1d30('0x42')][_0x1d30('0x64')]()[_0x1d30('0x23')](respondWithResult(_0x36572c,null))['catch'](handleError(_0x36572c,null));};exports[_0x1d30('0x65')]=function(_0x26958c,_0x1b57c3,_0x291bfe){if(_0x26958c[_0x1d30('0x63')]['id']){delete _0x26958c['body']['id'];}return db[_0x1d30('0x42')]['find']({'where':{'id':_0x26958c[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x1b57c3,null))[_0x1d30('0x23')](function(_0xdbcdb0){if(_0xdbcdb0){_0x26958c[_0x1d30('0x63')]['MailAccountId']=_0xdbcdb0['id'];return db[_0x1d30('0x66')][_0x1d30('0x67')](_0x26958c[_0x1d30('0x63')]);}})[_0x1d30('0x23')](respondWithResult(_0x1b57c3,null))[_0x1d30('0x5c')](handleError(_0x1b57c3,null));};exports[_0x1d30('0x68')]=function(_0x795dda,_0xd5900d,_0x86df82){var _0x308251={'raw':![],'where':{}};var _0x514388={};var _0x16e6b2={'count':0x0,'rows':[]};return db['MailAccount'][_0x1d30('0x69')]({'where':{'id':_0x795dda['params']['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0xd5900d,null))[_0x1d30('0x23')](function(_0x39ff6c){if(_0x39ff6c){_0x514388[_0x1d30('0x44')]=_['keys'](db[_0x1d30('0x66')][_0x1d30('0x43')]);_0x514388[_0x1d30('0x45')]=_[_0x1d30('0x46')](_0x795dda['query']);_0x514388[_0x1d30('0x47')]=_[_0x1d30('0x48')](_0x514388[_0x1d30('0x44')],_0x514388['query']);_0x308251[_0x1d30('0x4a')]=_['intersection'](_0x514388[_0x1d30('0x44')],qs[_0x1d30('0x49')](_0x795dda[_0x1d30('0x45')][_0x1d30('0x49')]));_0x308251[_0x1d30('0x4a')]=_0x308251[_0x1d30('0x4a')]['length']?_0x308251[_0x1d30('0x4a')]:_0x514388['model'];if(!_0x795dda[_0x1d30('0x45')][_0x1d30('0x4c')]('nolimit')){_0x308251[_0x1d30('0x32')]=qs[_0x1d30('0x32')](_0x795dda[_0x1d30('0x45')][_0x1d30('0x32')]);_0x308251['offset']=qs[_0x1d30('0x31')](_0x795dda['query']['offset']);}_0x308251[_0x1d30('0x4d')]=qs['sort'](_0x795dda[_0x1d30('0x45')]['sort']);_0x308251[_0x1d30('0x4f')]=qs[_0x1d30('0x47')](_[_0x1d30('0x50')](_0x795dda[_0x1d30('0x45')],_0x514388['filters']));_0x308251[_0x1d30('0x4f')][_0x1d30('0x6a')]=_0x39ff6c['id'];if(_0x795dda[_0x1d30('0x45')][_0x1d30('0x51')]){_0x308251[_0x1d30('0x4f')]=_[_0x1d30('0x52')](_0x308251[_0x1d30('0x4f')],{'$or':_['map'](_0x308251[_0x1d30('0x4a')],function(_0x366a76){var _0x22073a={};_0x22073a[_0x366a76]={'$like':'%'+_0x795dda[_0x1d30('0x45')]['filter']+'%'};return _0x22073a;})});}_0x308251=_['merge']({},_0x308251,_0x795dda[_0x1d30('0x58')]);return db[_0x1d30('0x66')][_0x1d30('0x30')]({'where':_0x308251[_0x1d30('0x4f')]})[_0x1d30('0x23')](function(_0x457910){_0x16e6b2[_0x1d30('0x30')]=_0x457910;if(_0x795dda[_0x1d30('0x45')][_0x1d30('0x59')]){_0x308251[_0x1d30('0x60')]=[{'all':!![]}];}return db[_0x1d30('0x66')]['findAll'](_0x308251);})[_0x1d30('0x23')](function(_0x59a0b9){_0x16e6b2[_0x1d30('0x5b')]=_0x59a0b9;return _0x16e6b2;});}})['then'](respondWithFilteredResult(_0xd5900d,_0x308251))[_0x1d30('0x5c')](handleError(_0xd5900d,null));};exports[_0x1d30('0x6b')]=function(_0x3a83ae,_0x4db728,_0x1efd3a){return db[_0x1d30('0x42')]['find']({'where':{'id':_0x3a83ae[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x4db728,null))[_0x1d30('0x23')](function(_0x46d4d5){if(_0x46d4d5){return _0x46d4d5['removeDispositions'](_0x3a83ae[_0x1d30('0x45')][_0x1d30('0x6c')]);}})[_0x1d30('0x23')](respondWithStatusCode(_0x4db728,null))[_0x1d30('0x5c')](handleError(_0x4db728,null));};exports['addAnswer']=function(_0x6b268d,_0x56726a,_0x554906){if(_0x6b268d[_0x1d30('0x63')]['id']){delete _0x6b268d[_0x1d30('0x63')]['id'];}return db[_0x1d30('0x42')][_0x1d30('0x61')]({'where':{'id':_0x6b268d[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x56726a,null))[_0x1d30('0x23')](function(_0x4dd1ef){if(_0x4dd1ef){_0x6b268d[_0x1d30('0x63')][_0x1d30('0x6a')]=_0x4dd1ef['id'];return db[_0x1d30('0x6d')][_0x1d30('0x67')](_0x6b268d[_0x1d30('0x63')]);}})[_0x1d30('0x23')](respondWithResult(_0x56726a,null))[_0x1d30('0x5c')](handleError(_0x56726a,null));};exports[_0x1d30('0x6e')]=function(_0x1e3e54,_0x50caba,_0x2eed38){var _0x30967d={'raw':![],'where':{}};var _0x3b50ec={};var _0x1c6b4e={'count':0x0,'rows':[]};return db['MailAccount'][_0x1d30('0x69')]({'where':{'id':_0x1e3e54[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x50caba,null))[_0x1d30('0x23')](function(_0x587ba0){if(_0x587ba0){_0x3b50ec[_0x1d30('0x44')]=_[_0x1d30('0x46')](db[_0x1d30('0x6d')]['rawAttributes']);_0x3b50ec['query']=_[_0x1d30('0x46')](_0x1e3e54['query']);_0x3b50ec[_0x1d30('0x47')]=_[_0x1d30('0x48')](_0x3b50ec[_0x1d30('0x44')],_0x3b50ec[_0x1d30('0x45')]);_0x30967d[_0x1d30('0x4a')]=_['intersection'](_0x3b50ec[_0x1d30('0x44')],qs['fields'](_0x1e3e54[_0x1d30('0x45')][_0x1d30('0x49')]));_0x30967d['attributes']=_0x30967d['attributes'][_0x1d30('0x4b')]?_0x30967d[_0x1d30('0x4a')]:_0x3b50ec['model'];if(!_0x1e3e54[_0x1d30('0x45')][_0x1d30('0x4c')](_0x1d30('0x6f'))){_0x30967d[_0x1d30('0x32')]=qs[_0x1d30('0x32')](_0x1e3e54[_0x1d30('0x45')][_0x1d30('0x32')]);_0x30967d[_0x1d30('0x31')]=qs['offset'](_0x1e3e54[_0x1d30('0x45')]['offset']);}_0x30967d['order']=qs['sort'](_0x1e3e54[_0x1d30('0x45')][_0x1d30('0x4e')]);_0x30967d['where']=qs['filters'](_[_0x1d30('0x50')](_0x1e3e54[_0x1d30('0x45')],_0x3b50ec[_0x1d30('0x47')]));_0x30967d['where'][_0x1d30('0x6a')]=_0x587ba0['id'];if(_0x1e3e54['query'][_0x1d30('0x51')]){_0x30967d[_0x1d30('0x4f')]=_[_0x1d30('0x52')](_0x30967d[_0x1d30('0x4f')],{'$or':_[_0x1d30('0x53')](_0x30967d['attributes'],function(_0x2cb05a){var _0x30f80d={};_0x30f80d[_0x2cb05a]={'$like':'%'+_0x1e3e54[_0x1d30('0x45')][_0x1d30('0x51')]+'%'};return _0x30f80d;})});}_0x30967d=_['merge']({},_0x30967d,_0x1e3e54[_0x1d30('0x58')]);return db['CannedAnswer'][_0x1d30('0x30')]({'where':_0x30967d[_0x1d30('0x4f')]})['then'](function(_0x1b3d5a){_0x1c6b4e['count']=_0x1b3d5a;if(_0x1e3e54[_0x1d30('0x45')]['includeAll']){_0x30967d[_0x1d30('0x60')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x30967d);})['then'](function(_0x4e661e){_0x1c6b4e[_0x1d30('0x5b')]=_0x4e661e;return _0x1c6b4e;});}})['then'](respondWithFilteredResult(_0x50caba,_0x30967d))['catch'](handleError(_0x50caba,null));};exports[_0x1d30('0x70')]=function(_0x540d17,_0xaa36d3,_0x2c5231){return db['MailAccount'][_0x1d30('0x61')]({'where':{'id':_0x540d17[_0x1d30('0x5e')]['id']}})['then'](handleEntityNotFound(_0xaa36d3,null))[_0x1d30('0x23')](function(_0x3f4e00){if(_0x3f4e00){return _0x3f4e00[_0x1d30('0x70')](_0x540d17[_0x1d30('0x45')][_0x1d30('0x6c')]);}})['then'](respondWithStatusCode(_0xaa36d3,null))[_0x1d30('0x5c')](handleError(_0xaa36d3,null));};exports[_0x1d30('0x67')]=function(_0x570008,_0x2c91c4){var _0x21a138={'name':_0x570008[_0x1d30('0x63')][_0x1d30('0x3a')],'key':_0x570008[_0x1d30('0x63')][_0x1d30('0x55')],'email':_0x570008[_0x1d30('0x63')]['email'],'ListId':_0x570008[_0x1d30('0x63')][_0x1d30('0x71')],'active':!_[_0x1d30('0x72')](_0x570008[_0x1d30('0x63')][_0x1d30('0x73')])?_0x570008[_0x1d30('0x63')][_0x1d30('0x73')]:!![],'description':_0x570008[_0x1d30('0x63')][_0x1d30('0x74')]||null,'Imap':{},'Smtp':{}};if(_[_0x1d30('0x72')](_0x570008[_0x1d30('0x63')][_0x1d30('0x75')])){if(_0x570008[_0x1d30('0x63')][_0x1d30('0x76')]){_0x21a138[_0x1d30('0x3e')][_0x1d30('0x77')]=_0x21a138['Smtp']['user']=_0x570008[_0x1d30('0x63')][_0x1d30('0x78')];_0x21a138[_0x1d30('0x3e')][_0x1d30('0x79')]=_0x21a138['Smtp'][_0x1d30('0x7a')]=_0x570008[_0x1d30('0x63')][_0x1d30('0x7b')];}else{_0x21a138['Imap'][_0x1d30('0x7c')]=_0x21a138[_0x1d30('0x5f')][_0x1d30('0x7c')]=![];}_0x21a138[_0x1d30('0x3e')][_0x1d30('0x7d')]=_0x570008[_0x1d30('0x63')][_0x1d30('0x3e')][_0x1d30('0x7d')];_0x21a138['Imap']['port']=_0x570008[_0x1d30('0x63')][_0x1d30('0x3e')][_0x1d30('0x7e')];_0x21a138[_0x1d30('0x5f')][_0x1d30('0x7d')]=_0x570008[_0x1d30('0x63')][_0x1d30('0x5f')]['host'];_0x21a138[_0x1d30('0x5f')][_0x1d30('0x7e')]=_0x570008[_0x1d30('0x63')]['Smtp'][_0x1d30('0x7e')];}else{_0x21a138[_0x1d30('0x3e')]['service']=_0x21a138[_0x1d30('0x5f')][_0x1d30('0x7f')]=_0x570008['body'][_0x1d30('0x75')];_0x21a138[_0x1d30('0x3e')]['user']=_0x21a138[_0x1d30('0x5f')][_0x1d30('0x77')]=_0x570008[_0x1d30('0x63')][_0x1d30('0x78')];_0x21a138[_0x1d30('0x3e')][_0x1d30('0x79')]=_0x21a138[_0x1d30('0x5f')][_0x1d30('0x7a')]=_0x570008[_0x1d30('0x63')][_0x1d30('0x7b')];}return db['MailAccount'][_0x1d30('0x67')](_0x21a138,{'include':[{'model':db[_0x1d30('0x3f')],'as':_0x1d30('0x5f')},{'model':db['MailServerIn'],'as':_0x1d30('0x3e')}]})[_0x1d30('0x23')](function(_0x354e20){var _0x35ace9=_0x570008['user']['get']({'plain':!![]});if(!_0x35ace9)throw new Error(_0x1d30('0x80'));if(_0x35ace9[_0x1d30('0x81')]==='user'){var _0x14c87c=_0x354e20[_0x1d30('0x82')]({'plain':!![]});return db[_0x1d30('0x83')][_0x1d30('0x61')]({'where':{'name':_0x1d30('0x37'),'userProfileId':_0x35ace9['userProfileId']},'raw':!![]})[_0x1d30('0x23')](function(_0x3bc9ee){if(_0x3bc9ee&&_0x3bc9ee[_0x1d30('0x84')]===0x0){return db[_0x1d30('0x38')][_0x1d30('0x67')]({'name':_0x14c87c['name'],'resourceId':_0x14c87c['id'],'type':_0x3bc9ee[_0x1d30('0x3a')],'sectionId':_0x3bc9ee['id']},{})[_0x1d30('0x23')](function(){return _0x354e20;});}else{return _0x354e20;}})[_0x1d30('0x5c')](function(_0x2b142f){logger[_0x1d30('0x29')](_0x1d30('0x85'),_0x2b142f);throw _0x2b142f;});}return _0x354e20;})[_0x1d30('0x23')](respondWithResult(_0x2c91c4,0xc9))[_0x1d30('0x5c')](handleError(_0x2c91c4,null));};exports[_0x1d30('0x86')]=function(_0x51e73d,_0x4c7b42,_0x145215){return db[_0x1d30('0x42')][_0x1d30('0x69')]({'where':{'id':_0x51e73d[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x4c7b42,null))[_0x1d30('0x23')](function(_0x40614e){if(_0x40614e){return _0x40614e['getImap']();}return null;})[_0x1d30('0x23')](respondWithResult(_0x4c7b42,null))[_0x1d30('0x5c')](handleError(_0x4c7b42,null));};exports[_0x1d30('0x87')]=function(_0x1250e7,_0x9ee1cd,_0x3f23d8){if(_0x1250e7[_0x1d30('0x63')]['id']){delete _0x1250e7[_0x1d30('0x63')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x1250e7[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x9ee1cd,null))['then'](function(_0x44fdec){if(_0x44fdec){_0x1250e7[_0x1d30('0x63')]['MailAccountId']=_0x44fdec['id'];return db['MailServerIn'][_0x1d30('0x67')](_0x1250e7[_0x1d30('0x63')]);}})[_0x1d30('0x23')](respondWithResult(_0x9ee1cd,null))[_0x1d30('0x5c')](handleError(_0x9ee1cd,null));};exports[_0x1d30('0x88')]=function(_0x5a1698,_0x1f80f8,_0x5a43ff){return db['MailAccount']['findOne']({'where':{'id':_0x5a1698['params']['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x1f80f8,null))['then'](function(_0x539855){if(_0x539855){return _0x539855['setImap'](null);}return null;})[_0x1d30('0x23')](respondWithStatusCode(_0x1f80f8,null))[_0x1d30('0x5c')](handleError(_0x1f80f8,null));};exports[_0x1d30('0x89')]=function(_0x3ef360,_0xc8906b,_0x21ba41){return db['MailAccount']['findOne']({'where':{'id':_0x3ef360['params']['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0xc8906b,null))[_0x1d30('0x23')](function(_0x50b350){if(_0x50b350){return _0x50b350[_0x1d30('0x89')]();}return null;})[_0x1d30('0x23')](respondWithResult(_0xc8906b,null))[_0x1d30('0x5c')](handleError(_0xc8906b,null));};exports[_0x1d30('0x8a')]=function(_0x46cbc3,_0xdbda8b,_0x5cbc9c){if(_0x46cbc3[_0x1d30('0x63')]['id']){delete _0x46cbc3[_0x1d30('0x63')]['id'];}return db[_0x1d30('0x42')][_0x1d30('0x61')]({'where':{'id':_0x46cbc3[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0xdbda8b,null))[_0x1d30('0x23')](function(_0x2543e4){if(_0x2543e4){_0x46cbc3['body'][_0x1d30('0x6a')]=_0x2543e4['id'];return db[_0x1d30('0x3f')][_0x1d30('0x67')](_0x46cbc3[_0x1d30('0x63')]);}})[_0x1d30('0x23')](respondWithResult(_0xdbda8b,null))[_0x1d30('0x5c')](handleError(_0xdbda8b,null));};exports['removeSmtp']=function(_0x3469b6,_0x39dc46,_0x2fb2f1){return db[_0x1d30('0x42')]['findOne']({'where':{'id':_0x3469b6['params']['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x39dc46,null))[_0x1d30('0x23')](function(_0x4b2fc1){if(_0x4b2fc1){return _0x4b2fc1[_0x1d30('0x8b')](null);}return null;})['then'](respondWithStatusCode(_0x39dc46,null))[_0x1d30('0x5c')](handleError(_0x39dc46,null));};exports[_0x1d30('0x8c')]=function(_0x87ec2c,_0x5165af,_0x47691b){return db['MailInteraction'][_0x1d30('0x61')]({'where':{'id':_0x87ec2c[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x5165af,null))[_0x1d30('0x23')](function(_0x34aead){if(_0x34aead){return _0x34aead[_0x1d30('0x8c')](_0x87ec2c[_0x1d30('0x63')][_0x1d30('0x6c')],_[_0x1d30('0x8d')](_0x87ec2c[_0x1d30('0x63')],[_0x1d30('0x6c'),'id'])||{});}})[_0x1d30('0x23')](respondWithResult(_0x5165af,null))[_0x1d30('0x5c')](handleError(_0x5165af,null));};exports[_0x1d30('0x8e')]=function(_0x154695,_0x55e8d1,_0x32f8df){var _0x259d37={'raw':![],'where':{}};var _0x3f8340={};var _0x43540d={'count':0x0,'rows':[]};return db[_0x1d30('0x42')]['findOne']({'where':{'id':_0x154695[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x55e8d1,null))['then'](function(_0x1aaa4f){if(_0x1aaa4f){_0x3f8340[_0x1d30('0x44')]=_['keys'](db[_0x1d30('0x8f')][_0x1d30('0x43')]);_0x3f8340['query']=_[_0x1d30('0x46')](_0x154695['query']);_0x3f8340[_0x1d30('0x47')]=_[_0x1d30('0x48')](_0x3f8340[_0x1d30('0x44')],_0x3f8340[_0x1d30('0x45')]);_0x259d37['attributes']=_[_0x1d30('0x48')](_0x3f8340['model'],qs[_0x1d30('0x49')](_0x154695[_0x1d30('0x45')][_0x1d30('0x49')]));_0x259d37[_0x1d30('0x4a')]=_0x259d37[_0x1d30('0x4a')][_0x1d30('0x4b')]?_0x259d37[_0x1d30('0x4a')]:_0x3f8340[_0x1d30('0x44')];if(!_0x154695[_0x1d30('0x45')]['hasOwnProperty']('nolimit')){_0x259d37[_0x1d30('0x32')]=qs[_0x1d30('0x32')](_0x154695['query']['limit']);_0x259d37[_0x1d30('0x31')]=qs['offset'](_0x154695[_0x1d30('0x45')]['offset']);}_0x259d37[_0x1d30('0x4d')]=qs[_0x1d30('0x4e')](_0x154695[_0x1d30('0x45')][_0x1d30('0x4e')]);_0x259d37[_0x1d30('0x4f')]=qs['filters'](_[_0x1d30('0x50')](_0x154695[_0x1d30('0x45')],_0x3f8340[_0x1d30('0x47')]));_0x259d37['where'][_0x1d30('0x6a')]=_0x1aaa4f['id'];if(_0x154695['query'][_0x1d30('0x51')]){_0x259d37[_0x1d30('0x4f')]=_[_0x1d30('0x52')](_0x259d37[_0x1d30('0x4f')],{'$or':_['map'](_0x259d37[_0x1d30('0x4a')],function(_0x32146f){var _0x2e66c2={};_0x2e66c2[_0x32146f]={'$like':'%'+_0x154695[_0x1d30('0x45')][_0x1d30('0x51')]+'%'};return _0x2e66c2;})});}_0x259d37=_[_0x1d30('0x52')]({},_0x259d37,_0x154695[_0x1d30('0x58')]);return db[_0x1d30('0x8f')]['count']({'where':_0x259d37[_0x1d30('0x4f')]})[_0x1d30('0x23')](function(_0x104b95){_0x43540d[_0x1d30('0x30')]=_0x104b95;if(_0x154695[_0x1d30('0x45')]['includeAll']){_0x259d37[_0x1d30('0x60')]=[{'model':db[_0x1d30('0x90')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x1d30('0x3a'),_0x1d30('0x91'),_0x1d30('0x92')],'required':![]},{'model':db[_0x1d30('0x93')],'as':_0x1d30('0x94'),'attributes':['id',_0x1d30('0x3a'),_0x1d30('0x95')],'where':_0x154695[_0x1d30('0x45')][_0x1d30('0x96')]?{'id':_0x154695[_0x1d30('0x45')]['tag']}:undefined,'required':_0x154695[_0x1d30('0x45')][_0x1d30('0x96')]?!![]:![]}];}return db[_0x1d30('0x8f')][_0x1d30('0x5a')](_0x259d37);})[_0x1d30('0x23')](function(_0x1d1afd){_0x43540d['rows']=_0x1d1afd;return _0x43540d;});}})['then'](respondWithFilteredResult(_0x55e8d1,_0x259d37))[_0x1d30('0x5c')](handleError(_0x55e8d1,null));};exports[_0x1d30('0x97')]=function(_0x2844c1,_0x36a717,_0x3c1fb7){return db[_0x1d30('0x42')][_0x1d30('0x69')]({'where':{'id':_0x2844c1['params']['id']}})['then'](handleEntityNotFound(_0x36a717,null))['then'](function(_0x5330d5){if(_0x5330d5){return db['sequelize'][_0x1d30('0x98')](function(_0x119b67){return db['MailApplication'][_0x1d30('0x39')]({'where':{'MailAccountId':_0x2844c1['params']['id']},'transaction':_0x119b67})['then'](function(_0xfcabfc){var _0x112ab1=_[_0x1d30('0x53')](_0x2844c1[_0x1d30('0x63')],function(_0x24f9c8){_0x24f9c8['MailAccountId']=_0x2844c1[_0x1d30('0x5e')]['id'];return _0x24f9c8;});return db[_0x1d30('0x99')][_0x1d30('0x9a')](_0x112ab1,{'transaction':_0x119b67});});})['then'](function(){return db[_0x1d30('0x99')]['findAndCountAll']({'where':{'MailAccountId':_0x2844c1[_0x1d30('0x5e')]['id']},'order':'priority'});});}})[_0x1d30('0x23')](respondWithResult(_0x36a717,null))[_0x1d30('0x5c')](handleError(_0x36a717,null));};exports[_0x1d30('0x9b')]=function(_0x4f4546,_0x1125e3,_0x27b88e){var _0x2093de={};var _0x1a6f57={};var _0x245029;var _0x190de6;return db[_0x1d30('0x42')][_0x1d30('0x69')]({'where':{'id':_0x4f4546[_0x1d30('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1125e3,null))[_0x1d30('0x23')](function(_0x59b11f){if(_0x59b11f){_0x245029=_0x59b11f;_0x1a6f57[_0x1d30('0x44')]=_[_0x1d30('0x46')](db[_0x1d30('0x99')][_0x1d30('0x43')]);_0x1a6f57[_0x1d30('0x45')]=_[_0x1d30('0x46')](_0x4f4546['query']);_0x1a6f57[_0x1d30('0x47')]=_[_0x1d30('0x48')](_0x1a6f57['model'],_0x1a6f57[_0x1d30('0x45')]);_0x2093de[_0x1d30('0x4a')]=_[_0x1d30('0x48')](_0x1a6f57[_0x1d30('0x44')],qs[_0x1d30('0x49')](_0x4f4546[_0x1d30('0x45')][_0x1d30('0x49')]));_0x2093de[_0x1d30('0x4a')]=_0x2093de[_0x1d30('0x4a')][_0x1d30('0x4b')]?_0x2093de[_0x1d30('0x4a')]:_0x1a6f57[_0x1d30('0x44')];_0x2093de[_0x1d30('0x4d')]=qs[_0x1d30('0x4e')](_0x4f4546['query']['sort']);_0x2093de[_0x1d30('0x4f')]=qs[_0x1d30('0x47')](_['pick'](_0x4f4546['query'],_0x1a6f57[_0x1d30('0x47')]));if(_0x4f4546['query']['filter']){_0x2093de['where']=_[_0x1d30('0x52')](_0x2093de[_0x1d30('0x4f')],{'$or':_['map'](_0x2093de['attributes'],function(_0x2d7313){var _0x108a82={};_0x108a82[_0x2d7313]={'$like':'%'+_0x4f4546[_0x1d30('0x45')][_0x1d30('0x51')]+'%'};return _0x108a82;})});}_0x2093de=_[_0x1d30('0x52')]({},_0x2093de,_0x4f4546[_0x1d30('0x58')]);return _0x245029[_0x1d30('0x9b')](_0x2093de);}})[_0x1d30('0x23')](function(_0x26ad4f){if(_0x26ad4f){_0x190de6=_0x26ad4f[_0x1d30('0x4b')];if(!_0x4f4546['query']['hasOwnProperty']('nolimit')){_0x2093de['limit']=qs[_0x1d30('0x32')](_0x4f4546['query'][_0x1d30('0x32')]);_0x2093de['offset']=qs[_0x1d30('0x31')](_0x4f4546[_0x1d30('0x45')][_0x1d30('0x31')]);}return _0x245029['getApplications'](_0x2093de);}})['then'](function(_0x53af38){if(_0x53af38){return _0x53af38?{'count':_0x190de6,'rows':_0x53af38}:null;}})['then'](respondWithResult(_0x1125e3,null))[_0x1d30('0x5c')](handleError(_0x1125e3,null));};exports[_0x1d30('0x9c')]=function(_0x17b644,_0x5699b4,_0x2947d0){var _0x18b127={'raw':!![],'where':{}};var _0x4c0f73={};var _0xb90491={'count':0x0,'rows':[]};return db[_0x1d30('0x42')][_0x1d30('0x69')]({'where':{'id':_0x17b644[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x5699b4,null))['then'](function(_0x33f726){if(_0x33f726){_0x4c0f73[_0x1d30('0x44')]=_[_0x1d30('0x46')](db[_0x1d30('0x9d')]['rawAttributes']);_0x4c0f73[_0x1d30('0x45')]=_[_0x1d30('0x46')](_0x17b644[_0x1d30('0x45')]);_0x4c0f73[_0x1d30('0x47')]=_[_0x1d30('0x48')](_0x4c0f73[_0x1d30('0x44')],_0x4c0f73['query']);_0x18b127[_0x1d30('0x4a')]=_['intersection'](_0x4c0f73['model'],qs['fields'](_0x17b644[_0x1d30('0x45')]['fields']));_0x18b127[_0x1d30('0x4a')]=_0x18b127[_0x1d30('0x4a')][_0x1d30('0x4b')]?_0x18b127['attributes']:_0x4c0f73[_0x1d30('0x44')];if(!_0x17b644[_0x1d30('0x45')]['hasOwnProperty'](_0x1d30('0x6f'))){_0x18b127['limit']=qs[_0x1d30('0x32')](_0x17b644[_0x1d30('0x45')][_0x1d30('0x32')]);_0x18b127['offset']=qs[_0x1d30('0x31')](_0x17b644[_0x1d30('0x45')][_0x1d30('0x31')]);}_0x18b127['order']=qs['sort'](_0x17b644[_0x1d30('0x45')][_0x1d30('0x4e')]);_0x18b127[_0x1d30('0x4f')]=qs[_0x1d30('0x47')](_[_0x1d30('0x50')](_0x17b644[_0x1d30('0x45')],_0x4c0f73[_0x1d30('0x47')]));_0x18b127[_0x1d30('0x4f')]['MailAccountId']=_0x33f726['id'];if(_0x17b644[_0x1d30('0x45')][_0x1d30('0x51')]){_0x18b127[_0x1d30('0x4f')]=_['merge'](_0x18b127[_0x1d30('0x4f')],{'$or':_[_0x1d30('0x53')](_0x18b127['attributes'],function(_0x377132){var _0x22a67e={};_0x22a67e[_0x377132]={'$like':'%'+_0x17b644[_0x1d30('0x45')][_0x1d30('0x51')]+'%'};return _0x22a67e;})});}if(_0x17b644[_0x1d30('0x45')][_0x1d30('0x9e')]){var _0x88cfab=_0x17b644[_0x1d30('0x45')][_0x1d30('0x9e')][_0x1d30('0x9f')](',');var _0x47824e={};_0x47824e[_0x88cfab[0x0]]={'$gte':moment(_0x88cfab[0x1])[_0x1d30('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x18b127['where']=_[_0x1d30('0x52')](_0x18b127[_0x1d30('0x4f')],_0x47824e);}_0x18b127=_[_0x1d30('0x52')]({},_0x18b127,_0x17b644[_0x1d30('0x58')]);return db[_0x1d30('0x9d')][_0x1d30('0x30')]({'where':_0x18b127[_0x1d30('0x4f')]})[_0x1d30('0x23')](function(_0x111675){_0xb90491['count']=_0x111675;if(_0x17b644['query'][_0x1d30('0x59')]){_0x18b127[_0x1d30('0x60')]=[{'all':!![]}];}return db[_0x1d30('0x9d')][_0x1d30('0x5a')](_0x18b127);})[_0x1d30('0x23')](function(_0x2ee6ff){_0xb90491[_0x1d30('0x5b')]=_0x2ee6ff;return _0xb90491;});}})[_0x1d30('0x23')](respondWithFilteredResult(_0x5699b4,_0x18b127))[_0x1d30('0x5c')](handleError(_0x5699b4,null));};exports[_0x1d30('0x3b')]=function(_0x3956f3,_0x174279,_0x44f2d1){var _0x3f5f14,_0xe1f23e={},_0x1d36e1;if(_0x3956f3['body']['to']){_0x1d36e1=_0x3956f3[_0x1d30('0x63')]['to']['split'](',')[0x0];}return db[_0x1d30('0x42')][_0x1d30('0x61')]({'where':{'id':_0x3956f3[_0x1d30('0x5e')]['id']},'include':[{'model':db[_0x1d30('0xa1')],'as':_0x1d30('0xa2'),'include':[{'model':db[_0x1d30('0x90')],'as':_0x1d30('0xa3'),'where':{'email':_0x1d36e1},'limit':0x1,'order':[[_0x1d30('0xa4'),'DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x174279,null))['then'](function(_0x44b1fb){if(_0x44b1fb){_0x3f5f14=_0x44b1fb;if(_0x44b1fb[_0x1d30('0x5f')]){if(_['isNil'](_0x3956f3[_0x1d30('0x63')][_0x1d30('0xa5')])){_0x3956f3['body'][_0x1d30('0xa5')]=util[_0x1d30('0xa0')](_0x1d30('0xa6'),_0x44b1fb['name'],_0x44b1fb['email']||_0x44b1fb['Smtp'][_0x1d30('0x77')]);}if(_0x3956f3['body']['attachments']&&_0x3956f3['body'][_0x1d30('0xa7')][_0x1d30('0x4b')]){for(var _0x457f4a=0x0;_0x457f4a<_0x3956f3[_0x1d30('0x63')]['attachments'][_0x1d30('0x4b')];_0x457f4a+=0x1){_0x3956f3[_0x1d30('0x63')][_0x1d30('0xa7')][_0x457f4a]={'filename':_0x3956f3[_0x1d30('0x63')][_0x1d30('0xa7')][_0x457f4a]['name'],'path':path['join'](config[_0x1d30('0xa8')],_0x1d30('0xa9'),_0x3956f3[_0x1d30('0x63')][_0x1d30('0xa7')][_0x457f4a][_0x1d30('0xaa')])};}}var _0x2cb8b0={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x44b1fb[_0x1d30('0x5f')]['service'])){if(_0x44b1fb[_0x1d30('0x5f')][_0x1d30('0x7c')]){_0x2cb8b0[_0x1d30('0xab')]={'user':_0x44b1fb['Smtp']['user'],'pass':_0x44b1fb[_0x1d30('0x5f')][_0x1d30('0x7a')]};}_0x2cb8b0[_0x1d30('0x7d')]=_0x44b1fb[_0x1d30('0x5f')]['host'];_0x2cb8b0['port']=_0x44b1fb['Smtp'][_0x1d30('0x7e')];_0x2cb8b0[_0x1d30('0xac')]=_0x44b1fb[_0x1d30('0x5f')]['secure'];}else{_0x2cb8b0[_0x1d30('0x7f')]=_0x44b1fb[_0x1d30('0x5f')]['service'];_0x2cb8b0['auth']={'user':_0x44b1fb[_0x1d30('0x5f')]['user'],'pass':_0x44b1fb[_0x1d30('0x5f')][_0x1d30('0x7a')]};}return respondWithRpcPromise('SendMail',_0x1d30('0xad'),{'account':_0x2cb8b0,'message':_0x3956f3['body']});}else{throw new Error(_0x1d30('0xae'));}}})[_0x1d30('0x23')](function(_0x48979c){if(_0x48979c){_0xe1f23e=_0x48979c;if(_0x3f5f14[_0x1d30('0xa2')]){if(_0x3f5f14[_0x1d30('0xa2')]['Contacts']['length']){return _0x3f5f14['List']['Contacts'][0x0];}else{return db[_0x1d30('0x90')][_0x1d30('0x67')](_[_0x1d30('0x18')](_0x3956f3[_0x1d30('0x63')],{'firstName':_0x3956f3[_0x1d30('0x63')]['to'],'email':_0x3956f3[_0x1d30('0x63')]['to'],'phone':_0x3956f3['body']['to'],'ListId':_0x3f5f14['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})[_0x1d30('0x23')](function(_0x5a0bf2){if(_0x5a0bf2){var _0x5db0f6={'UserId':_0x3956f3[_0x1d30('0x77')]['id'],'ContactId':_0x5a0bf2['id'],'MailAccountId':_0x3f5f14['id'],'inReplyTo':_0xe1f23e[_0x1d30('0xaf')],'to':_0x3956f3['body'][_0x1d30('0xa5')],'cc':_0x3956f3[_0x1d30('0x63')]['cc'],'subject':_0x3956f3[_0x1d30('0x63')][_0x1d30('0xb0')],'attach':_0x3956f3[_0x1d30('0x63')]['attach'],'firstMsgDirection':_0x1d30('0xb1'),'lastMsgAt':moment()[_0x1d30('0xa0')](_0x1d30('0xb2')),'lastMsgDirection':_0x1d30('0xb1'),'lastMsgBody':_0x3956f3[_0x1d30('0x63')]['body'],'Messages':[_[_0x1d30('0x52')](_0x3956f3[_0x1d30('0x63')],{'messageId':_0xe1f23e['messageId'],'sentAt':moment()[_0x1d30('0xa0')](_0x1d30('0xb2')),'read':!![],'MailAccountId':_0x3f5f14['id'],'UserId':_0x3956f3[_0x1d30('0x77')]['id'],'ContactId':_0x5a0bf2['id']})]};if(_0x3956f3[_0x1d30('0x63')][_0x1d30('0xb3')]){_0x5db0f6=_[_0x1d30('0x52')](_0x5db0f6,_0x3956f3[_0x1d30('0x63')][_0x1d30('0xb3')]);}return db[_0x1d30('0x8f')][_0x1d30('0x67')](_0x5db0f6,{'include':[{'model':db[_0x1d30('0x9d')],'as':_0x1d30('0xb4')}]});}})[_0x1d30('0x23')](respondWithResult(_0x174279,null))['catch'](handleError(_0x174279,null));};exports[_0x1d30('0xb5')]=function(_0x37eb5b,_0x534866,_0x4cd01b){return db[_0x1d30('0x42')][_0x1d30('0x61')]({'where':{'id':_0x37eb5b[_0x1d30('0x5e')]['id']},'include':[{'model':db[_0x1d30('0x3f')],'as':_0x1d30('0x5f'),'raw':!![]}]})[_0x1d30('0x23')](handleEntityNotFound(_0x534866,null))[_0x1d30('0x23')](function(_0x26c46e){if(_0x26c46e&&_0x26c46e[_0x1d30('0x5f')]){var _0x3b4f89={'id':_0x26c46e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x26c46e[_0x1d30('0x5f')][_0x1d30('0x7f')]){_0x3b4f89[_0x1d30('0x7f')]=_0x26c46e['Smtp'][_0x1d30('0x7f')];}else{_0x3b4f89['host']=_0x26c46e[_0x1d30('0x5f')][_0x1d30('0x7d')];_0x3b4f89['port']=_0x26c46e['Smtp']['port'];_0x3b4f89[_0x1d30('0xac')]=_0x26c46e[_0x1d30('0x5f')][_0x1d30('0xac')];}if(_0x26c46e[_0x1d30('0x5f')][_0x1d30('0x7c')]){_0x3b4f89[_0x1d30('0xab')]={'user':_0x26c46e[_0x1d30('0x5f')][_0x1d30('0x77')],'pass':_0x26c46e[_0x1d30('0x5f')][_0x1d30('0x7a')]};}return respondWithRpcPromise('VerifySmtp',_0x1d30('0xb5'),{'account':_0x3b4f89});}})[_0x1d30('0x23')](respondWithResult(_0x534866,null))[_0x1d30('0x5c')](handleError(_0x534866,null));};exports[_0x1d30('0x39')]=function(_0x431aff,_0x503fda){return db[_0x1d30('0x42')][_0x1d30('0x61')]({'where':{'id':_0x431aff[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x503fda,null))['then'](function(_0x2daecb){if(_0x2daecb&&_0x2daecb[_0x1d30('0x7f')]){throw new db[(_0x1d30('0xb6'))][(_0x1d30('0xb7'))](_0x1d30('0xb8'));}return _0x2daecb;})['then'](removeEntity(_0x503fda,null))['catch'](handleError(_0x503fda,null));};exports[_0x1d30('0xb9')]=function(_0x2bc479,_0x212407,_0x4ebd19){return db[_0x1d30('0x42')][_0x1d30('0x61')]({'where':{'id':_0x2bc479[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x212407,null))[_0x1d30('0x23')](function(_0x45b367){if(_0x45b367){return _0x45b367[_0x1d30('0xb9')](_0x2bc479[_0x1d30('0x63')][_0x1d30('0x6c')],_[_0x1d30('0x8d')](_0x2bc479[_0x1d30('0x63')],[_0x1d30('0x6c'),'id'])||{})[_0x1d30('0xba')](function(_0x1257b0){for(var _0x5adf89=0x0;_0x5adf89<_0x2bc479[_0x1d30('0x63')]['ids']['length'];_0x5adf89+=0x1){socket[_0x1d30('0xbb')](_0x1d30('0xbc'),{'UserId':_0x2bc479['body'][_0x1d30('0x6c')][_0x5adf89],'MailAccountId':_0x2bc479[_0x1d30('0x5e')]['id']});}return _0x1257b0;});}})['then'](respondWithResult(_0x212407,null))[_0x1d30('0x5c')](handleError(_0x212407,null));};exports[_0x1d30('0xbd')]=function(_0x6fd59c,_0x39217e,_0x5d56ef){return db[_0x1d30('0x42')][_0x1d30('0x61')]({'where':{'id':_0x6fd59c[_0x1d30('0x5e')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x39217e,null))[_0x1d30('0x23')](function(_0x40bbf8){if(_0x40bbf8){return _0x40bbf8['removeAgents'](_0x6fd59c[_0x1d30('0x45')]['ids'])[_0x1d30('0x23')](function(){if(_['isArray'](_0x6fd59c[_0x1d30('0x45')][_0x1d30('0x6c')])){for(var _0x3dc401=0x0;_0x3dc401<_0x6fd59c[_0x1d30('0x45')]['ids'][_0x1d30('0x4b')];_0x3dc401+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x6fd59c[_0x1d30('0x45')][_0x1d30('0x6c')][_0x3dc401]),'MailAccountId':Number(_0x6fd59c[_0x1d30('0x5e')]['id'])});}}else{socket[_0x1d30('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x6fd59c['query'][_0x1d30('0x6c')]),'MailAccountId':Number(_0x6fd59c[_0x1d30('0x5e')]['id'])});}});}})[_0x1d30('0x23')](respondWithStatusCode(_0x39217e,null))[_0x1d30('0x5c')](handleError(_0x39217e,null));};exports['getAgents']=function(_0x3137c9,_0x8a28fc,_0x454ba0){var _0x4d6b46={};var _0xe678b5={};var _0x150d22;var _0x251483;return db[_0x1d30('0x42')][_0x1d30('0x69')]({'where':{'id':_0x3137c9[_0x1d30('0x5e')]['id']}})['then'](handleEntityNotFound(_0x8a28fc,null))[_0x1d30('0x23')](function(_0x2cafc7){if(_0x2cafc7){_0x150d22=_0x2cafc7;_0xe678b5['model']=_['keys'](db[_0x1d30('0xbe')][_0x1d30('0x43')]);_0xe678b5[_0x1d30('0x45')]=_['keys'](_0x3137c9[_0x1d30('0x45')]);_0xe678b5['filters']=_[_0x1d30('0x48')](_0xe678b5[_0x1d30('0x44')],_0xe678b5[_0x1d30('0x45')]);_0x4d6b46['attributes']=_['intersection'](_0xe678b5[_0x1d30('0x44')],qs['fields'](_0x3137c9['query']['fields']));_0x4d6b46['attributes']=_0x4d6b46[_0x1d30('0x4a')][_0x1d30('0x4b')]?_0x4d6b46[_0x1d30('0x4a')]:_0xe678b5['model'];_0x4d6b46[_0x1d30('0x4d')]=qs['sort'](_0x3137c9['query'][_0x1d30('0x4e')]);_0x4d6b46[_0x1d30('0x4f')]=qs['filters'](_[_0x1d30('0x50')](_0x3137c9[_0x1d30('0x45')],_0xe678b5[_0x1d30('0x47')]));if(_0x3137c9[_0x1d30('0x45')][_0x1d30('0x51')]){_0x4d6b46[_0x1d30('0x4f')]=_['merge'](_0x4d6b46['where'],{'$or':_[_0x1d30('0x53')](_0x4d6b46['attributes'],function(_0x25ffba){var _0xf361d4={};_0xf361d4[_0x25ffba]={'$like':'%'+_0x3137c9[_0x1d30('0x45')][_0x1d30('0x51')]+'%'};return _0xf361d4;})});}_0x4d6b46=_[_0x1d30('0x52')]({},_0x4d6b46,_0x3137c9[_0x1d30('0x58')]);return _0x150d22[_0x1d30('0xbf')](_0x4d6b46);}})[_0x1d30('0x23')](function(_0x348a7b){if(_0x348a7b){_0x251483=_0x348a7b['length'];if(!_0x3137c9[_0x1d30('0x45')][_0x1d30('0x4c')](_0x1d30('0x6f'))){_0x4d6b46[_0x1d30('0x32')]=qs['limit'](_0x3137c9[_0x1d30('0x45')]['limit']);_0x4d6b46[_0x1d30('0x31')]=qs[_0x1d30('0x31')](_0x3137c9[_0x1d30('0x45')][_0x1d30('0x31')]);}return _0x150d22[_0x1d30('0xbf')](_0x4d6b46);}})[_0x1d30('0x23')](function(_0x262316){if(_0x262316){return _0x262316?{'count':_0x251483,'rows':_0x262316}:null;}})[_0x1d30('0x23')](respondWithResult(_0x8a28fc,null))[_0x1d30('0x5c')](handleError(_0x8a28fc,null));};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js
index e2f7d45..351b9e2 100644
--- a/server/api/mailAccount/mailAccount.events.js
+++ b/server/api/mailAccount/mailAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa8b2=['remove','emit','exports','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x4ac12d,_0x16a759){var _0x30c831=function(_0x52ed0a){while(--_0x52ed0a){_0x4ac12d['push'](_0x4ac12d['shift']());}};_0x30c831(++_0x16a759);}(_0xa8b2,0x193));var _0x2a8b=function(_0x38bbb7,_0x302c80){_0x38bbb7=_0x38bbb7-0x0;var _0xee51a5=_0xa8b2[_0x38bbb7];return _0xee51a5;};'use strict';var EventEmitter=require(_0x2a8b('0x0'));var MailAccount=require(_0x2a8b('0x1'))['db'][_0x2a8b('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2a8b('0x3')](0x0);var events={'afterCreate':_0x2a8b('0x4'),'afterUpdate':'update','afterDestroy':_0x2a8b('0x5')};function emitEvent(_0x33cd08){return function(_0x5a422a,_0x4e2a2d,_0x109183){MailAccountEvents[_0x2a8b('0x6')](_0x33cd08+':'+_0x5a422a['id'],_0x5a422a);MailAccountEvents[_0x2a8b('0x6')](_0x33cd08,_0x5a422a);_0x109183(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x2a8b('0x7')]=MailAccountEvents;
\ No newline at end of file
+var _0xa49c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0xa49c,0x15c));var _0xca49=function(_0x146dd7,_0x4d877d){_0x146dd7=_0x146dd7-0x0;var _0x2af0bb=_0xa49c[_0x146dd7];return _0x2af0bb;};'use strict';var EventEmitter=require(_0xca49('0x0'));var MailAccount=require(_0xca49('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xca49('0x2')](0x0);var events={'afterCreate':_0xca49('0x3'),'afterUpdate':_0xca49('0x4'),'afterDestroy':_0xca49('0x5')};function emitEvent(_0x5457af){return function(_0x173ad7,_0x21ceb4,_0x9f835){MailAccountEvents[_0xca49('0x6')](_0x5457af+':'+_0x173ad7['id'],_0x173ad7);MailAccountEvents['emit'](_0x5457af,_0x173ad7);_0x9f835(null);};}for(var e in events){if(events[_0xca49('0x7')](e)){var event=events[e];MailAccount[_0xca49('0x8')](e,emitEvent(event));}}module[_0xca49('0x9')]=MailAccountEvents;
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js
index 3192fb0..35e6a75 100644
--- a/server/api/mailAccount/mailAccount.model.js
+++ b/server/api/mailAccount/mailAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa486=['request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','../../config/logger','moment'];(function(_0x125857,_0x14e067){var _0x4fa9ff=function(_0xbb5991){while(--_0xbb5991){_0x125857['push'](_0x125857['shift']());}};_0x4fa9ff(++_0x14e067);}(_0xa486,0x17d));var _0x6a48=function(_0x584fa2,_0x45820f){_0x584fa2=_0x584fa2-0x0;var _0x4adc75=_0xa486[_0x584fa2];return _0x4adc75;};'use strict';var _=require(_0x6a48('0x0'));var util=require('util');var logger=require(_0x6a48('0x1'))('api');var moment=require(_0x6a48('0x2'));var BPromise=require('bluebird');var rp=require(_0x6a48('0x3'));var fs=require('fs');var path=require(_0x6a48('0x4'));var rimraf=require(_0x6a48('0x5'));var config=require(_0x6a48('0x6'));var attributes=require(_0x6a48('0x7'));module[_0x6a48('0x8')]=function(_0x29c0eb,_0x3d81f7){return _0x29c0eb[_0x6a48('0x9')](_0x6a48('0xa'),attributes,{'tableName':_0x6a48('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xccef=['path','rimraf','exports','define','MailAccount','mail_accounts','util','api','moment','bluebird','request-promise'];(function(_0x486a12,_0x2a234f){var _0x5da39b=function(_0x155d21){while(--_0x155d21){_0x486a12['push'](_0x486a12['shift']());}};_0x5da39b(++_0x2a234f);}(_0xccef,0x1d4));var _0xfcce=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xccef[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xfcce('0x0'));var logger=require('../../config/logger')(_0xfcce('0x1'));var moment=require(_0xfcce('0x2'));var BPromise=require(_0xfcce('0x3'));var rp=require(_0xfcce('0x4'));var fs=require('fs');var path=require(_0xfcce('0x5'));var rimraf=require(_0xfcce('0x6'));var config=require('../../config/environment');var attributes=require('./mailAccount.attributes');module[_0xfcce('0x7')]=function(_0x4f6cae,_0x96ac52){return _0x4f6cae[_0xfcce('0x8')](_0xfcce('0x9'),attributes,{'tableName':_0xfcce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js
index 0efc6e4..1403676 100644
--- a/server/api/mailAccount/mailAccount.rpc.js
+++ b/server/api/mailAccount/mailAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe840=['limit','include','map','model','GetMailAccount','find','raw','ShowMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','MailApplication','Applications','MailServerOut','Smtp','get','list','applications','orderBy','asc','push','length','close','autoclose','*,*,*,*','Contacts','create','contact','messageId','generate','subject','attach','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','update','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','bcc','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','info','catch','MailAccount','findAll','options','where','attributes'];(function(_0x480009,_0x209238){var _0x31dfc2=function(_0x3161f5){while(--_0x3161f5){_0x480009['push'](_0x480009['shift']());}};_0x31dfc2(++_0x209238);}(_0xe840,0x1dd));var _0x0e84=function(_0x494603,_0x300ba4){_0x494603=_0x494603-0x0;var _0x3504f5=_0xe840[_0x494603];return _0x3504f5;};'use strict';var _=require(_0x0e84('0x0'));var util=require('util');var moment=require(_0x0e84('0x1'));var BPromise=require(_0x0e84('0x2'));var rs=require(_0x0e84('0x3'));var fs=require('fs');var Redis=require(_0x0e84('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e84('0x5'));var logger=require('../../config/logger')(_0x0e84('0x6'));var config=require(_0x0e84('0x7'));var jayson=require(_0x0e84('0x8'));var client=jayson[_0x0e84('0x9')]['http']({'port':0x232c});config['redis']=_[_0x0e84('0xa')](config[_0x0e84('0xb')],{'host':_0x0e84('0xc'),'port':0x18eb});var socket=require(_0x0e84('0xd'))(new Redis(config[_0x0e84('0xb')]));require(_0x0e84('0xe'))[_0x0e84('0xf')](socket);function respondWithRpcPromise(_0x41d587,_0x2a2c72,_0xae798c){return new BPromise(function(_0x3dd022,_0x91e828){return client[_0x0e84('0x10')](_0x41d587,_0xae798c)[_0x0e84('0x11')](function(_0x58da53){logger['info']('MailAccount,\x20%s,\x20%s',_0x2a2c72,_0x0e84('0x12'));logger[_0x0e84('0x13')](_0x0e84('0x14'),_0x2a2c72,_0x0e84('0x12'),JSON[_0x0e84('0x15')](_0x58da53));if(_0x58da53[_0x0e84('0x16')]){if(_0x58da53[_0x0e84('0x16')][_0x0e84('0x17')]===0x1f4){logger[_0x0e84('0x16')](_0x0e84('0x18'),_0x2a2c72,_0x58da53[_0x0e84('0x16')][_0x0e84('0x19')]);return _0x91e828(_0x58da53[_0x0e84('0x16')]['message']);}logger[_0x0e84('0x16')](_0x0e84('0x18'),_0x2a2c72,_0x58da53['error'][_0x0e84('0x19')]);return _0x3dd022(_0x58da53[_0x0e84('0x16')][_0x0e84('0x19')]);}else{logger[_0x0e84('0x1a')](_0x0e84('0x18'),_0x2a2c72,_0x0e84('0x12'));_0x3dd022(_0x58da53['result'][_0x0e84('0x19')]);}})[_0x0e84('0x1b')](function(_0x1c92b8){logger['error'](_0x0e84('0x18'),_0x2a2c72,_0x1c92b8);_0x91e828(_0x1c92b8);});});}exports['GetMailAccount']=function(_0x36d829){var _0x3544b1=this;return new Promise(function(_0x27428d,_0x5809c2){return db[_0x0e84('0x1c')][_0x0e84('0x1d')]({'raw':_0x36d829[_0x0e84('0x1e')]?_0x36d829['options']['raw']===undefined?!![]:![]:!![],'where':_0x36d829[_0x0e84('0x1e')]?_0x36d829[_0x0e84('0x1e')][_0x0e84('0x1f')]||null:null,'attributes':_0x36d829['options']?_0x36d829['options'][_0x0e84('0x20')]||null:null,'limit':_0x36d829[_0x0e84('0x1e')]?_0x36d829['options'][_0x0e84('0x21')]||null:null,'include':_0x36d829[_0x0e84('0x1e')]?_0x36d829[_0x0e84('0x1e')][_0x0e84('0x22')]?_[_0x0e84('0x23')](_0x36d829['options'][_0x0e84('0x22')],function(_0x347c12){return{'model':db[_0x347c12[_0x0e84('0x24')]],'as':_0x347c12['as'],'attributes':_0x347c12['attributes'],'include':_0x347c12[_0x0e84('0x22')]?_[_0x0e84('0x23')](_0x347c12[_0x0e84('0x22')],function(_0x3bf26b){return{'model':db[_0x3bf26b['model']],'as':_0x3bf26b['as'],'attributes':_0x3bf26b['attributes'],'include':_0x3bf26b[_0x0e84('0x22')]?_[_0x0e84('0x23')](_0x3bf26b[_0x0e84('0x22')],function(_0x5034c2){return{'model':db[_0x5034c2['model']],'as':_0x5034c2['as'],'attributes':_0x5034c2[_0x0e84('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12ab63){logger['info'](_0x0e84('0x25'),_0x36d829);logger[_0x0e84('0x13')]('GetMailAccount',_0x36d829,JSON[_0x0e84('0x15')](_0x12ab63));_0x27428d(_0x12ab63);})['catch'](function(_0x198c0d){logger[_0x0e84('0x16')]('GetMailAccount',_0x198c0d[_0x0e84('0x19')],_0x36d829);_0x5809c2(_0x3544b1['error'](0x1f4,_0x198c0d[_0x0e84('0x19')]));});});};exports['ShowMailAccount']=function(_0x55c6e6){var _0x4eb09e=this;return new Promise(function(_0x128c3d,_0x3528f0){return db[_0x0e84('0x1c')][_0x0e84('0x26')]({'raw':_0x55c6e6[_0x0e84('0x1e')]?_0x55c6e6[_0x0e84('0x1e')][_0x0e84('0x27')]===undefined?!![]:![]:!![],'where':_0x55c6e6[_0x0e84('0x1e')]?_0x55c6e6[_0x0e84('0x1e')][_0x0e84('0x1f')]||null:null,'attributes':_0x55c6e6['options']?_0x55c6e6['options'][_0x0e84('0x20')]||null:null,'include':_0x55c6e6[_0x0e84('0x1e')]?_0x55c6e6['options']['include']?_[_0x0e84('0x23')](_0x55c6e6['options'][_0x0e84('0x22')],function(_0xff97c5){return{'model':db[_0xff97c5['model']],'as':_0xff97c5['as'],'attributes':_0xff97c5[_0x0e84('0x20')],'include':_0xff97c5[_0x0e84('0x22')]?_[_0x0e84('0x23')](_0xff97c5[_0x0e84('0x22')],function(_0x14213e){return{'model':db[_0x14213e[_0x0e84('0x24')]],'as':_0x14213e['as'],'attributes':_0x14213e[_0x0e84('0x20')],'include':_0x14213e[_0x0e84('0x22')]?_[_0x0e84('0x23')](_0x14213e[_0x0e84('0x22')],function(_0x5a9140){return{'model':db[_0x5a9140[_0x0e84('0x24')]],'as':_0x5a9140['as'],'attributes':_0x5a9140[_0x0e84('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0e84('0x11')](function(_0x3ad5ab){logger[_0x0e84('0x1a')](_0x0e84('0x28'),_0x55c6e6);logger[_0x0e84('0x13')](_0x0e84('0x28'),_0x55c6e6,JSON[_0x0e84('0x15')](_0x3ad5ab));_0x128c3d(_0x3ad5ab);})[_0x0e84('0x1b')](function(_0x65df2c){logger[_0x0e84('0x16')](_0x0e84('0x28'),_0x65df2c[_0x0e84('0x19')],_0x55c6e6);_0x3528f0(_0x4eb09e['error'](0x1f4,_0x65df2c[_0x0e84('0x19')]));});});};exports['NotifyMailAccount']=function(_0x488e58){var _0x17b499=this;return new Promise(function(_0x552230,_0x231980){var _0x1aeada={'body':_0x488e58[_0x0e84('0x29')],'channel':_0x0e84('0x2a')};var _0x54cbb1=_[_0x0e84('0x2b')](_['keys'](db[_0x0e84('0x2c')][_0x0e84('0x2d')]),[_0x0e84('0x2e'),_0x0e84('0x2f'),_0x0e84('0x30'),_0x0e84('0x31')]);var _0x35d253=![];if(_0x488e58[_0x0e84('0x29')]['id']){delete _0x488e58['body']['id'];}if(_[_0x0e84('0x32')](_0x488e58['body'][_0x0e84('0x33')])){return _0x231980(_0x17b499[_0x0e84('0x16')](0x1f4,_0x0e84('0x34')));}if(_['isNil'](_0x488e58[_0x0e84('0x29')][_0x0e84('0x29')])||_0x488e58[_0x0e84('0x29')][_0x0e84('0x29')]===''){return _0x231980(_0x17b499[_0x0e84('0x16')](0x1f4,_0x0e84('0x35')));}if(_['isNil'](_0x488e58['body'][_0x0e84('0x36')])){return _0x231980(_0x17b499['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x54cbb1));}if(!_[_0x0e84('0x37')](_0x54cbb1,_0x488e58['body']['mapKey'])){return _0x231980(_0x17b499[_0x0e84('0x16')](0x1f4,_0x0e84('0x38')+_0x54cbb1));}var _0x138a5c={};_0x138a5c[_0x488e58[_0x0e84('0x29')]['mapKey']]=_0x488e58[_0x0e84('0x29')]['from'];return db['MailAccount'][_0x0e84('0x26')]({'where':{'id':_0x488e58[_0x0e84('0x39')]['id']},'include':[{'model':db[_0x0e84('0x3a')],'as':_0x0e84('0x3b'),'include':[{'model':db[_0x0e84('0x2c')],'as':'Contacts','where':_0x138a5c,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x0e84('0x3c')],'as':_0x0e84('0x3d')},{'model':db[_0x0e84('0x3e')],'as':_0x0e84('0x3f')}]})[_0x0e84('0x11')](function(_0x5b9bb5){if(_0x5b9bb5&&_0x5b9bb5[_0x0e84('0x3b')]){var _0x309ee9=_0x5b9bb5[_0x0e84('0x40')]({'plain':!![]});_0x1aeada[_0x0e84('0x39')]=_['omit'](_0x309ee9,[_0x0e84('0x3d'),_0x0e84('0x3b')]);_0x1aeada['applications']=_0x309ee9[_0x0e84('0x3d')];_0x1aeada[_0x0e84('0x41')]=_0x309ee9[_0x0e84('0x3b')];_0x1aeada[_0x0e84('0x42')]=_[_0x0e84('0x43')](_0x1aeada[_0x0e84('0x42')],['priority'],[_0x0e84('0x44')]);if(_0x1aeada[_0x0e84('0x39')]&&_0x1aeada[_0x0e84('0x39')]['autoclose']){_0x1aeada[_0x0e84('0x42')][_0x0e84('0x45')]({'id':0x0,'priority':_0x1aeada[_0x0e84('0x42')][_0x0e84('0x46')]+0x1,'app':_0x0e84('0x47'),'appdata':_0x0e84('0x48'),'interval':_0x0e84('0x49')});}if(_0x1aeada[_0x0e84('0x39')][_0x0e84('0x3d')]){delete _0x1aeada[_0x0e84('0x39')][_0x0e84('0x3d')];}if(_0x1aeada[_0x0e84('0x39')][_0x0e84('0x3b')]){delete _0x1aeada['account'][_0x0e84('0x3b')];}if(_0x309ee9[_0x0e84('0x3b')][_0x0e84('0x4a')][_0x0e84('0x46')]){return _0x309ee9[_0x0e84('0x3b')]['Contacts'][0x0];}var _0x55447b=_[_0x0e84('0xa')](_0x488e58['body'],{'firstName':_0x488e58[_0x0e84('0x29')][_0x0e84('0x33')],'ListId':_0x309ee9[_0x0e84('0x31')]});_0x55447b[_0x488e58[_0x0e84('0x29')][_0x0e84('0x36')]]=_0x488e58[_0x0e84('0x29')]['from'];return db[_0x0e84('0x2c')][_0x0e84('0x4b')](_0x55447b);}else{throw new Error('List\x20not\x20found');}})[_0x0e84('0x11')](function(_0x3fada7){_0x1aeada[_0x0e84('0x4c')]=_0x3fada7;if(_0x3fada7){if(!_0x488e58['body'][_0x0e84('0x19')][_0x0e84('0x4d')]){_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')]['messageId']=rs[_0x0e84('0x4e')]()+'\x20'+_0x488e58[_0x0e84('0x29')]['message'][_0x0e84('0x33')];}var _0x330247={'ContactId':_0x3fada7['id'],'MailAccountId':_0x488e58[_0x0e84('0x39')]['id'],'inReplyTo':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x4d')],'to':_0x488e58['body'][_0x0e84('0x19')][_0x0e84('0x33')],'cc':_0x488e58['body'][_0x0e84('0x19')]['cc'],'subject':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x4f')],'attach':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x50')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x488e58[_0x0e84('0x29')][_0x0e84('0x29')]};return db[_0x0e84('0x51')][_0x0e84('0x26')]({'where':{'closed':![],'MailAccountId':_0x488e58['account']['id']},'include':[{'model':db[_0x0e84('0x52')],'as':'Messages','attributes':[_0x0e84('0x4d')],'where':{'messageId':_0x488e58['body']['message'][_0x0e84('0x53')]}}]})['then'](function(_0x459930){if(_0x459930){return[_0x459930,![]];}return db[_0x0e84('0x51')]['create'](_0x330247)[_0x0e84('0x11')](function(_0x5cdd45){return[_0x5cdd45,!![]];});});}else{throw new Error(_0x0e84('0x54'));}})['spread'](function(_0x369d42,_0x202295){if(_0x369d42){_0x35d253=_0x202295;if(!_0x202295){return _0x369d42[_0x0e84('0x55')]({'inReplyTo':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x4d')],'to':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x33')],'cc':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')]['cc'],'subject':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x4f')],'attach':_0x369d42[_0x0e84('0x50')]?_0x369d42[_0x0e84('0x50')]:_0x488e58[_0x0e84('0x29')]['message'][_0x0e84('0x50')],'substatus':null,'substatusAt':moment()[_0x0e84('0x56')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x0e84('0x56')](_0x0e84('0x57')),'lastMsgDirection':'in','lastMsgBody':_0x488e58[_0x0e84('0x29')][_0x0e84('0x29')]});}else{return _0x369d42;}}})[_0x0e84('0x11')](function(_0x421b97){_0x1aeada[_0x0e84('0x58')]=_0x421b97[_0x0e84('0x40')]({'plain':!![]});_0x1aeada[_0x0e84('0x58')][_0x0e84('0x59')]=_0x35d253;return db['MailMessage'][_0x0e84('0x4b')]({'body':_0x488e58['body'][_0x0e84('0x29')],'MailAccountId':_0x488e58[_0x0e84('0x39')]['id'],'MailInteractionId':_0x421b97['id'],'direction':'in','ContactId':_0x1aeada['contact']['id'],'messageId':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x4d')],'from':_0x488e58['body']['message'][_0x0e84('0x33')],'to':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')]['to'],'cc':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')]['cc'],'subject':_0x488e58[_0x0e84('0x29')]['message'][_0x0e84('0x4f')],'attach':_0x488e58['body']['message'][_0x0e84('0x50')],'Attachments':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x5a')],'originTo':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x5b')],'originCc':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')]['originCc'],'bcc':_0x488e58['body'][_0x0e84('0x19')][_0x0e84('0x5c')]},{'include':[{'model':db[_0x0e84('0x5d')],'as':'Attachments'}]});})[_0x0e84('0x11')](function(_0x381b89){_0x1aeada['message']=_0x381b89;if(_0x1aeada[_0x0e84('0x58')][_0x0e84('0x5e')]){return db[_0x0e84('0x5f')][_0x0e84('0x26')]({'attributes':['id',_0x0e84('0x60')],'where':{'id':_0x1aeada['interaction'][_0x0e84('0x5e')]}})[_0x0e84('0x11')](function(_0x542425){if(_0x542425){_0x1aeada[_0x0e84('0x42')][_0x0e84('0x61')]({'id':0x0,'priority':0x0,'app':_0x0e84('0x62'),'appdata':_0x542425[_0x0e84('0x60')]+','+(_0x1aeada[_0x0e84('0x39')][_0x0e84('0x63')]||0xa),'interval':_0x0e84('0x49')});}return respondWithRpcPromise('Start',_0x0e84('0x64'),_0x1aeada);});}return respondWithRpcPromise(_0x0e84('0x65'),_0x0e84('0x64'),_0x1aeada);})[_0x0e84('0x11')](function(_0x2da69d){_0x552230(_0x2da69d);})[_0x0e84('0x1b')](function(_0x4d3113){_0x231980(_0x17b499[_0x0e84('0x16')](0x1f4,_0x4d3113[_0x0e84('0x19')]));});});};
\ No newline at end of file
+var _0xf8b4=['rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','where','attributes','map','model','include','find','raw','ShowMailAccount','NotifyMailAccount','difference','keys','CmContact','rawAttributes','updatedAt','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','create','List\x20not\x20found','messageId','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','interaction','contact','attachments','originTo','originCc','Attachment','UserId','unshift','name','waitForTheAssignedAgent','startRouting','Start','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2daaf2,_0x8c8170){var _0x2be4a6=function(_0x121b9e){while(--_0x121b9e){_0x2daaf2['push'](_0x2daaf2['shift']());}};_0x2be4a6(++_0x8c8170);}(_0xf8b4,0x1ec));var _0x4f8b=function(_0x5b6eea,_0x1f6e7c){_0x5b6eea=_0x5b6eea-0x0;var _0x2b71c3=_0xf8b4[_0x5b6eea];return _0x2b71c3;};'use strict';var _=require(_0x4f8b('0x0'));var util=require(_0x4f8b('0x1'));var moment=require('moment');var BPromise=require(_0x4f8b('0x2'));var rs=require(_0x4f8b('0x3'));var fs=require('fs');var Redis=require(_0x4f8b('0x4'));var db=require(_0x4f8b('0x5'))['db'];var utils=require(_0x4f8b('0x6'));var logger=require(_0x4f8b('0x7'))(_0x4f8b('0x8'));var config=require(_0x4f8b('0x9'));var jayson=require(_0x4f8b('0xa'));var client=jayson['client'][_0x4f8b('0xb')]({'port':0x232c});config['redis']=_[_0x4f8b('0xc')](config[_0x4f8b('0xd')],{'host':_0x4f8b('0xe'),'port':0x18eb});var socket=require(_0x4f8b('0xf'))(new Redis(config['redis']));require(_0x4f8b('0x10'))['register'](socket);function respondWithRpcPromise(_0x29ee06,_0x4873b8,_0x22eee5){return new BPromise(function(_0x3ec079,_0x187f68){return client[_0x4f8b('0x11')](_0x29ee06,_0x22eee5)[_0x4f8b('0x12')](function(_0x3d1b60){logger['info'](_0x4f8b('0x13'),_0x4873b8,_0x4f8b('0x14'));logger[_0x4f8b('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x4873b8,_0x4f8b('0x14'),JSON[_0x4f8b('0x16')](_0x3d1b60));if(_0x3d1b60[_0x4f8b('0x17')]){if(_0x3d1b60[_0x4f8b('0x17')]['code']===0x1f4){logger[_0x4f8b('0x17')](_0x4f8b('0x13'),_0x4873b8,_0x3d1b60[_0x4f8b('0x17')][_0x4f8b('0x18')]);return _0x187f68(_0x3d1b60[_0x4f8b('0x17')][_0x4f8b('0x18')]);}logger[_0x4f8b('0x17')](_0x4f8b('0x13'),_0x4873b8,_0x3d1b60[_0x4f8b('0x17')][_0x4f8b('0x18')]);return _0x3ec079(_0x3d1b60[_0x4f8b('0x17')]['message']);}else{logger[_0x4f8b('0x19')](_0x4f8b('0x13'),_0x4873b8,_0x4f8b('0x14'));_0x3ec079(_0x3d1b60[_0x4f8b('0x1a')][_0x4f8b('0x18')]);}})[_0x4f8b('0x1b')](function(_0x50316b){logger[_0x4f8b('0x17')](_0x4f8b('0x13'),_0x4873b8,_0x50316b);_0x187f68(_0x50316b);});});}exports[_0x4f8b('0x1c')]=function(_0x23a139){var _0x3d1eab=this;return new Promise(function(_0x398ae2,_0x151bcc){return db[_0x4f8b('0x1d')][_0x4f8b('0x1e')]({'raw':_0x23a139[_0x4f8b('0x1f')]?_0x23a139[_0x4f8b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x23a139[_0x4f8b('0x1f')]?_0x23a139[_0x4f8b('0x1f')][_0x4f8b('0x20')]||null:null,'attributes':_0x23a139[_0x4f8b('0x1f')]?_0x23a139[_0x4f8b('0x1f')][_0x4f8b('0x21')]||null:null,'limit':_0x23a139[_0x4f8b('0x1f')]?_0x23a139[_0x4f8b('0x1f')]['limit']||null:null,'include':_0x23a139[_0x4f8b('0x1f')]?_0x23a139[_0x4f8b('0x1f')]['include']?_[_0x4f8b('0x22')](_0x23a139[_0x4f8b('0x1f')]['include'],function(_0x2cb306){return{'model':db[_0x2cb306[_0x4f8b('0x23')]],'as':_0x2cb306['as'],'attributes':_0x2cb306[_0x4f8b('0x21')],'include':_0x2cb306[_0x4f8b('0x24')]?_[_0x4f8b('0x22')](_0x2cb306[_0x4f8b('0x24')],function(_0x341cd6){return{'model':db[_0x341cd6[_0x4f8b('0x23')]],'as':_0x341cd6['as'],'attributes':_0x341cd6['attributes'],'include':_0x341cd6[_0x4f8b('0x24')]?_['map'](_0x341cd6[_0x4f8b('0x24')],function(_0x37b47b){return{'model':db[_0x37b47b[_0x4f8b('0x23')]],'as':_0x37b47b['as'],'attributes':_0x37b47b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x135b07){logger[_0x4f8b('0x19')](_0x4f8b('0x1c'),_0x23a139);logger[_0x4f8b('0x15')](_0x4f8b('0x1c'),_0x23a139,JSON[_0x4f8b('0x16')](_0x135b07));_0x398ae2(_0x135b07);})['catch'](function(_0x2398c0){logger[_0x4f8b('0x17')](_0x4f8b('0x1c'),_0x2398c0[_0x4f8b('0x18')],_0x23a139);_0x151bcc(_0x3d1eab[_0x4f8b('0x17')](0x1f4,_0x2398c0[_0x4f8b('0x18')]));});});};exports['ShowMailAccount']=function(_0x3d7bf1){var _0x42d8a5=this;return new Promise(function(_0x30cee5,_0x129257){return db[_0x4f8b('0x1d')][_0x4f8b('0x25')]({'raw':_0x3d7bf1[_0x4f8b('0x1f')]?_0x3d7bf1['options'][_0x4f8b('0x26')]===undefined?!![]:![]:!![],'where':_0x3d7bf1[_0x4f8b('0x1f')]?_0x3d7bf1[_0x4f8b('0x1f')][_0x4f8b('0x20')]||null:null,'attributes':_0x3d7bf1['options']?_0x3d7bf1[_0x4f8b('0x1f')][_0x4f8b('0x21')]||null:null,'include':_0x3d7bf1[_0x4f8b('0x1f')]?_0x3d7bf1['options'][_0x4f8b('0x24')]?_[_0x4f8b('0x22')](_0x3d7bf1[_0x4f8b('0x1f')][_0x4f8b('0x24')],function(_0x548397){return{'model':db[_0x548397[_0x4f8b('0x23')]],'as':_0x548397['as'],'attributes':_0x548397[_0x4f8b('0x21')],'include':_0x548397[_0x4f8b('0x24')]?_['map'](_0x548397[_0x4f8b('0x24')],function(_0x40e766){return{'model':db[_0x40e766[_0x4f8b('0x23')]],'as':_0x40e766['as'],'attributes':_0x40e766[_0x4f8b('0x21')],'include':_0x40e766[_0x4f8b('0x24')]?_[_0x4f8b('0x22')](_0x40e766[_0x4f8b('0x24')],function(_0x474c01){return{'model':db[_0x474c01[_0x4f8b('0x23')]],'as':_0x474c01['as'],'attributes':_0x474c01['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f8b('0x12')](function(_0xe29bf3){logger[_0x4f8b('0x19')](_0x4f8b('0x27'),_0x3d7bf1);logger[_0x4f8b('0x15')]('ShowMailAccount',_0x3d7bf1,JSON[_0x4f8b('0x16')](_0xe29bf3));_0x30cee5(_0xe29bf3);})['catch'](function(_0x319a9e){logger[_0x4f8b('0x17')](_0x4f8b('0x27'),_0x319a9e[_0x4f8b('0x18')],_0x3d7bf1);_0x129257(_0x42d8a5['error'](0x1f4,_0x319a9e[_0x4f8b('0x18')]));});});};exports[_0x4f8b('0x28')]=function(_0x47a98d){var _0x53ee72=this;return new Promise(function(_0x2c7ded,_0x23ebbf){var _0x5dbd8d={'body':_0x47a98d['body'],'channel':'mail'};var _0x1448c1=_[_0x4f8b('0x29')](_[_0x4f8b('0x2a')](db[_0x4f8b('0x2b')][_0x4f8b('0x2c')]),['createdAt',_0x4f8b('0x2d'),'CompanyId',_0x4f8b('0x2e')]);var _0x31954d=![];if(_0x47a98d['body']['id']){delete _0x47a98d[_0x4f8b('0x2f')]['id'];}if(_[_0x4f8b('0x30')](_0x47a98d['body'][_0x4f8b('0x31')])){return _0x23ebbf(_0x53ee72[_0x4f8b('0x17')](0x1f4,_0x4f8b('0x32')));}if(_[_0x4f8b('0x30')](_0x47a98d['body'][_0x4f8b('0x2f')])||_0x47a98d['body'][_0x4f8b('0x2f')]===''){return _0x23ebbf(_0x53ee72[_0x4f8b('0x17')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x4f8b('0x30')](_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x33')])){return _0x23ebbf(_0x53ee72[_0x4f8b('0x17')](0x1f4,_0x4f8b('0x34')+_0x1448c1));}if(!_['includes'](_0x1448c1,_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x33')])){return _0x23ebbf(_0x53ee72['error'](0x1f4,_0x4f8b('0x35')+_0x1448c1));}var _0x59501f={};_0x59501f[_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x33')]]=_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x31')];return db[_0x4f8b('0x1d')]['find']({'where':{'id':_0x47a98d[_0x4f8b('0x36')]['id']},'include':[{'model':db['CmList'],'as':_0x4f8b('0x37'),'include':[{'model':db[_0x4f8b('0x2b')],'as':'Contacts','where':_0x59501f,'limit':0x1,'order':[['updatedAt',_0x4f8b('0x38')]]}]},{'model':db[_0x4f8b('0x39')],'as':_0x4f8b('0x3a')},{'model':db[_0x4f8b('0x3b')],'as':_0x4f8b('0x3c')}]})[_0x4f8b('0x12')](function(_0x133a1a){if(_0x133a1a&&_0x133a1a[_0x4f8b('0x37')]){var _0xdebd2d=_0x133a1a[_0x4f8b('0x3d')]({'plain':!![]});_0x5dbd8d[_0x4f8b('0x36')]=_[_0x4f8b('0x3e')](_0xdebd2d,[_0x4f8b('0x3a'),_0x4f8b('0x37')]);_0x5dbd8d[_0x4f8b('0x3f')]=_0xdebd2d['Applications'];_0x5dbd8d[_0x4f8b('0x40')]=_0xdebd2d[_0x4f8b('0x37')];_0x5dbd8d['applications']=_[_0x4f8b('0x41')](_0x5dbd8d[_0x4f8b('0x3f')],[_0x4f8b('0x42')],[_0x4f8b('0x43')]);if(_0x5dbd8d[_0x4f8b('0x36')]&&_0x5dbd8d[_0x4f8b('0x36')][_0x4f8b('0x44')]){_0x5dbd8d[_0x4f8b('0x3f')][_0x4f8b('0x45')]({'id':0x0,'priority':_0x5dbd8d[_0x4f8b('0x3f')][_0x4f8b('0x46')]+0x1,'app':_0x4f8b('0x47'),'appdata':_0x4f8b('0x44'),'interval':_0x4f8b('0x48')});}if(_0x5dbd8d[_0x4f8b('0x36')]['Applications']){delete _0x5dbd8d[_0x4f8b('0x36')][_0x4f8b('0x3a')];}if(_0x5dbd8d[_0x4f8b('0x36')][_0x4f8b('0x37')]){delete _0x5dbd8d[_0x4f8b('0x36')][_0x4f8b('0x37')];}if(_0xdebd2d['List'][_0x4f8b('0x49')][_0x4f8b('0x46')]){return _0xdebd2d[_0x4f8b('0x37')][_0x4f8b('0x49')][0x0];}var _0x2c5a79=_['defaults'](_0x47a98d[_0x4f8b('0x2f')],{'firstName':_0x47a98d['body'][_0x4f8b('0x31')],'ListId':_0xdebd2d[_0x4f8b('0x2e')]});_0x2c5a79[_0x47a98d[_0x4f8b('0x2f')]['mapKey']]=_0x47a98d['body'][_0x4f8b('0x31')];return db['CmContact'][_0x4f8b('0x4a')](_0x2c5a79);}else{throw new Error(_0x4f8b('0x4b'));}})[_0x4f8b('0x12')](function(_0x54c60c){_0x5dbd8d['contact']=_0x54c60c;if(_0x54c60c){if(!_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x18')]['messageId']){_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x18')][_0x4f8b('0x4c')]=rs['generate']()+'\x20'+_0x47a98d['body'][_0x4f8b('0x18')][_0x4f8b('0x31')];}var _0x448928={'ContactId':_0x54c60c['id'],'MailAccountId':_0x47a98d['account']['id'],'inReplyTo':_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x18')][_0x4f8b('0x4c')],'to':_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x18')][_0x4f8b('0x31')],'cc':_0x47a98d['body']['message']['cc'],'subject':_0x47a98d[_0x4f8b('0x2f')]['message']['subject'],'attach':_0x47a98d['body'][_0x4f8b('0x18')][_0x4f8b('0x4d')],'lastMsgAt':moment()[_0x4f8b('0x4e')](_0x4f8b('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x2f')]};return db[_0x4f8b('0x50')][_0x4f8b('0x25')]({'where':{'closed':![],'MailAccountId':_0x47a98d[_0x4f8b('0x36')]['id']},'include':[{'model':db[_0x4f8b('0x51')],'as':_0x4f8b('0x52'),'attributes':['messageId'],'where':{'messageId':_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x18')][_0x4f8b('0x53')]}}]})['then'](function(_0x1bebba){if(_0x1bebba){return[_0x1bebba,![]];}return db['MailInteraction'][_0x4f8b('0x4a')](_0x448928)['then'](function(_0x2a5c4e){return[_0x2a5c4e,!![]];});});}else{throw new Error(_0x4f8b('0x54'));}})[_0x4f8b('0x55')](function(_0x57dba5,_0x3c5ea5){if(_0x57dba5){_0x31954d=_0x3c5ea5;if(!_0x3c5ea5){return _0x57dba5[_0x4f8b('0x56')]({'inReplyTo':_0x47a98d[_0x4f8b('0x2f')]['message'][_0x4f8b('0x4c')],'to':_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x18')][_0x4f8b('0x31')],'cc':_0x47a98d[_0x4f8b('0x2f')]['message']['cc'],'subject':_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x18')][_0x4f8b('0x57')],'attach':_0x57dba5[_0x4f8b('0x4d')]?_0x57dba5[_0x4f8b('0x4d')]:_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x18')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0x4f8b('0x4f')),'lastMsgAt':moment()[_0x4f8b('0x4e')](_0x4f8b('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x47a98d['body']['body']});}else{return _0x57dba5;}}})[_0x4f8b('0x12')](function(_0x418fa7){_0x5dbd8d['interaction']=_0x418fa7[_0x4f8b('0x3d')]({'plain':!![]});_0x5dbd8d[_0x4f8b('0x58')]['created']=_0x31954d;return db[_0x4f8b('0x51')][_0x4f8b('0x4a')]({'body':_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x2f')],'MailAccountId':_0x47a98d[_0x4f8b('0x36')]['id'],'MailInteractionId':_0x418fa7['id'],'direction':'in','ContactId':_0x5dbd8d[_0x4f8b('0x59')]['id'],'messageId':_0x47a98d[_0x4f8b('0x2f')]['message']['messageId'],'from':_0x47a98d[_0x4f8b('0x2f')]['message'][_0x4f8b('0x31')],'to':_0x47a98d['body']['message']['to'],'cc':_0x47a98d['body'][_0x4f8b('0x18')]['cc'],'subject':_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x18')]['subject'],'attach':_0x47a98d['body'][_0x4f8b('0x18')][_0x4f8b('0x4d')],'Attachments':_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x18')][_0x4f8b('0x5a')],'originTo':_0x47a98d[_0x4f8b('0x2f')]['message'][_0x4f8b('0x5b')],'originCc':_0x47a98d['body'][_0x4f8b('0x18')][_0x4f8b('0x5c')],'bcc':_0x47a98d[_0x4f8b('0x2f')][_0x4f8b('0x18')]['bcc']},{'include':[{'model':db[_0x4f8b('0x5d')],'as':'Attachments'}]});})['then'](function(_0x3d6d9d){_0x5dbd8d[_0x4f8b('0x18')]=_0x3d6d9d;if(_0x5dbd8d[_0x4f8b('0x58')][_0x4f8b('0x5e')]){return db['User'][_0x4f8b('0x25')]({'attributes':['id','name'],'where':{'id':_0x5dbd8d[_0x4f8b('0x58')]['UserId']}})[_0x4f8b('0x12')](function(_0x5dc592){if(_0x5dc592){_0x5dbd8d[_0x4f8b('0x3f')][_0x4f8b('0x5f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5dc592[_0x4f8b('0x60')]+','+(_0x5dbd8d[_0x4f8b('0x36')][_0x4f8b('0x61')]||0xa),'interval':_0x4f8b('0x48')});}return respondWithRpcPromise('Start',_0x4f8b('0x62'),_0x5dbd8d);});}return respondWithRpcPromise(_0x4f8b('0x63'),_0x4f8b('0x62'),_0x5dbd8d);})[_0x4f8b('0x12')](function(_0x44d025){_0x2c7ded(_0x44d025);})[_0x4f8b('0x1b')](function(_0x520c02){_0x23ebbf(_0x53ee72[_0x4f8b('0x17')](0x1f4,_0x520c02['message']));});});};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js
index b70bc39..f1e4515 100644
--- a/server/api/mailAccount/mailAccount.socket.js
+++ b/server/api/mailAccount/mailAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc1c6=['emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0xe58f7a,_0x1e59d3){var _0x591208=function(_0x213621){while(--_0x213621){_0xe58f7a['push'](_0xe58f7a['shift']());}};_0x591208(++_0x1e59d3);}(_0xc1c6,0x145));var _0x6c1c=function(_0x56de14,_0x376a46){_0x56de14=_0x56de14-0x0;var _0x1b0446=_0xc1c6[_0x56de14];return _0x1b0446;};'use strict';var MailAccountEvents=require(_0x6c1c('0x0'));var events=[_0x6c1c('0x1'),_0x6c1c('0x2'),'update'];function createListener(_0x5a876a,_0x118780){return function(_0x556e32){_0x118780[_0x6c1c('0x3')](_0x5a876a,_0x556e32);};}function removeListener(_0x3df146,_0x22f726){return function(){MailAccountEvents[_0x6c1c('0x4')](_0x3df146,_0x22f726);};}exports[_0x6c1c('0x5')]=function(_0x135890){for(var _0x3f30f4=0x0,_0x228c2b=events[_0x6c1c('0x6')];_0x3f30f4<_0x228c2b;_0x3f30f4++){var _0x153397=events[_0x3f30f4];var _0x45e0ee=createListener(_0x6c1c('0x7')+_0x153397,_0x135890);MailAccountEvents['on'](_0x153397,_0x45e0ee);}};
\ No newline at end of file
+var _0x68a6=['removeListener','length','./mailAccount.events','save','remove','update','emit'];(function(_0xe9a3c8,_0x57ce6d){var _0x4cd154=function(_0x36de66){while(--_0x36de66){_0xe9a3c8['push'](_0xe9a3c8['shift']());}};_0x4cd154(++_0x57ce6d);}(_0x68a6,0x19f));var _0x668a=function(_0x11acb7,_0x148915){_0x11acb7=_0x11acb7-0x0;var _0x32ee39=_0x68a6[_0x11acb7];return _0x32ee39;};'use strict';var MailAccountEvents=require(_0x668a('0x0'));var events=[_0x668a('0x1'),_0x668a('0x2'),_0x668a('0x3')];function createListener(_0x4ee31e,_0x203f5a){return function(_0x429aad){_0x203f5a[_0x668a('0x4')](_0x4ee31e,_0x429aad);};}function removeListener(_0x4b4501,_0x53ba67){return function(){MailAccountEvents[_0x668a('0x5')](_0x4b4501,_0x53ba67);};}exports['register']=function(_0x8b6704){for(var _0x2eecf8=0x0,_0x5aa271=events[_0x668a('0x6')];_0x2eecf8<_0x5aa271;_0x2eecf8++){var _0x7ec5e8=events[_0x2eecf8];var _0x157c91=createListener('mailAccount:'+_0x7ec5e8,_0x8b6704);MailAccountEvents['on'](_0x7ec5e8,_0x157c91);}};
\ No newline at end of file
diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js
index e90713e..9301ee9 100644
--- a/server/api/mailApplication/index.js
+++ b/server/api/mailApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x180f=['/:id','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','show','update','delete'];(function(_0x2636ee,_0xa2019b){var _0x5be81e=function(_0x2093a4){while(--_0x2093a4){_0x2636ee['push'](_0x2636ee['shift']());}};_0x5be81e(++_0xa2019b);}(_0x180f,0xf3));var _0xf180=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0x180f[_0x4e1a49];return _0x136aae;};'use strict';var multer=require(_0xf180('0x0'));var util=require(_0xf180('0x1'));var path=require('path');var timeout=require(_0xf180('0x2'));var express=require(_0xf180('0x3'));var router=express['Router']();var auth=require(_0xf180('0x4'));var interaction=require(_0xf180('0x5'));var config=require(_0xf180('0x6'));var controller=require(_0xf180('0x7'));router[_0xf180('0x8')]('/:id',auth[_0xf180('0x9')](),controller[_0xf180('0xa')]);router['put']('/:id',auth[_0xf180('0x9')](),controller[_0xf180('0xb')]);router[_0xf180('0xc')](_0xf180('0xd'),auth[_0xf180('0x9')](),controller[_0xf180('0xe')]);module[_0xf180('0xf')]=router;
\ No newline at end of file
+var _0x4c6d=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','put','update','delete','destroy','exports'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x4913b1,_0x4a115e){_0x4913b1=_0x4913b1-0x0;var _0x1b39a6=_0x4c6d[_0x4913b1];return _0x1b39a6;};'use strict';var multer=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var path=require(_0xd4c6('0x2'));var timeout=require(_0xd4c6('0x3'));var express=require(_0xd4c6('0x4'));var router=express['Router']();var auth=require(_0xd4c6('0x5'));var interaction=require(_0xd4c6('0x6'));var config=require(_0xd4c6('0x7'));var controller=require('./mailApplication.controller');router[_0xd4c6('0x8')](_0xd4c6('0x9'),auth['isAuthenticated'](),controller[_0xd4c6('0xa')]);router[_0xd4c6('0xb')](_0xd4c6('0x9'),auth['isAuthenticated'](),controller[_0xd4c6('0xc')]);router[_0xd4c6('0xd')](_0xd4c6('0x9'),auth['isAuthenticated'](),controller[_0xd4c6('0xe')]);module[_0xd4c6('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js
index 75fd6b0..159ffd2 100644
--- a/server/api/mailApplication/mailApplication.attributes.js
+++ b/server/api/mailApplication/mailApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x762e=['sequelize','STRING','*,*,*,*'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x762e,0xea));var _0xe762=function(_0x130319,_0x5722d8){_0x130319=_0x130319-0x0;var _0x235ae3=_0x762e[_0x130319];return _0x235ae3;};'use strict';var Sequelize=require(_0xe762('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe762('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe762('0x1')]},'interval':{'type':Sequelize[_0xe762('0x1')],'defaultValue':_0xe762('0x2')}};
\ No newline at end of file
+var _0xff6f=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x5dfff5,_0x34e32e){var _0x504a80=function(_0x22b06b){while(--_0x22b06b){_0x5dfff5['push'](_0x5dfff5['shift']());}};_0x504a80(++_0x34e32e);}(_0xff6f,0x11e));var _0xfff6=function(_0x40dbb9,_0x498dbe){_0x40dbb9=_0x40dbb9-0x0;var _0x32af4e=_0xff6f[_0x40dbb9];return _0x32af4e;};'use strict';var Sequelize=require(_0xfff6('0x0'));module[_0xfff6('0x1')]={'priority':{'type':Sequelize[_0xfff6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfff6('0x3')],'allowNull':![],'defaultValue':_0xfff6('0x4')},'appdata':{'type':Sequelize[_0xfff6('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfff6('0x3')],'defaultValue':_0xfff6('0x6')}};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js
index 8b2c25b..fbe85c2 100644
--- a/server/api/mailApplication/mailApplication.controller.js
+++ b/server/api/mailApplication/mailApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f37=['then','destroy','error','stack','name','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','options','find','catch','body','params','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','sox','ejs','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update'];(function(_0x49b984,_0x387c83){var _0x49d1e0=function(_0x3664c7){while(--_0x3664c7){_0x49b984['push'](_0x49b984['shift']());}};_0x49d1e0(++_0x387c83);}(_0x8f37,0x190));var _0x78f3=function(_0x181101,_0x2745f9){_0x181101=_0x181101-0x0;var _0x414148=_0x8f37[_0x181101];return _0x414148;};'use strict';var pdf=require(_0x78f3('0x0'));var emlformat=require(_0x78f3('0x1'));var rimraf=require(_0x78f3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x78f3('0x3'));var moment=require(_0x78f3('0x4'));var BPromise=require(_0x78f3('0x5'));var Mustache=require('mustache');var util=require(_0x78f3('0x6'));var path=require('path');var sox=require(_0x78f3('0x7'));var csv=require('to-csv');var ejs=require(_0x78f3('0x8'));var fs=require('fs');var _=require(_0x78f3('0x9'));var squel=require('squel');var crypto=require(_0x78f3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x78f3('0xb'));var toCsv=require(_0x78f3('0xc'));var querystring=require('querystring');var Papa=require(_0x78f3('0xd'));var Redis=require(_0x78f3('0xe'));var authService=require(_0x78f3('0xf'));var qs=require(_0x78f3('0x10'));var hardwareService=require(_0x78f3('0x11'));var logger=require('../../config/logger')(_0x78f3('0x12'));var utils=require(_0x78f3('0x13'));var config=require('../../config/environment');var db=require(_0x78f3('0x14'))['db'];function respondWithStatusCode(_0x26466c,_0x2cc16b){_0x2cc16b=_0x2cc16b||0xcc;return function(_0x532f29){if(_0x532f29){return _0x26466c[_0x78f3('0x15')](_0x2cc16b);}return _0x26466c[_0x78f3('0x16')](_0x2cc16b)[_0x78f3('0x17')]();};}function respondWithResult(_0x244915,_0x58fe69){_0x58fe69=_0x58fe69||0xc8;return function(_0x1858f1){if(_0x1858f1){return _0x244915[_0x78f3('0x16')](_0x58fe69)[_0x78f3('0x18')](_0x1858f1);}};}function respondWithFilteredResult(_0x1b0f4c,_0x1059e0){return function(_0x225c7f){if(_0x225c7f){var _0x1e7a83=_0x225c7f[_0x78f3('0x19')],_0x3e2a15=_0x1059e0[_0x78f3('0x1a')],_0x453270=_0x1059e0[_0x78f3('0x1a')]+_0x1059e0[_0x78f3('0x1b')],_0x17172c;if(_0x453270>=_0x1e7a83){_0x453270=_0x1e7a83;_0x17172c=0xc8;}else{_0x17172c=0xce;}_0x1b0f4c[_0x78f3('0x16')](_0x17172c);return _0x1b0f4c[_0x78f3('0x1c')](_0x78f3('0x1d'),_0x3e2a15+'-'+_0x453270+'/'+_0x1e7a83)[_0x78f3('0x18')](_0x225c7f);}return null;};}function patchUpdates(_0x4a5db4){return function(_0x2f7ec9){try{jsonpatch[_0x78f3('0x1e')](_0x2f7ec9,_0x4a5db4,!![]);}catch(_0x53ee6a){return BPromise['reject'](_0x53ee6a);}return _0x2f7ec9['save']();};}function saveUpdates(_0x46d65d,_0x364a72){return function(_0x31621a){if(_0x31621a){return _0x31621a[_0x78f3('0x1f')](_0x46d65d)[_0x78f3('0x20')](function(_0x560510){return _0x560510;});}return null;};}function removeEntity(_0x369704,_0x2dfe51){return function(_0x116918){if(_0x116918){return _0x116918[_0x78f3('0x21')]()[_0x78f3('0x20')](function(){_0x369704[_0x78f3('0x16')](0xcc)[_0x78f3('0x17')]();});}};}function handleEntityNotFound(_0x213604,_0x18189e){return function(_0x3c6bf8){if(!_0x3c6bf8){_0x213604['sendStatus'](0x194);}return _0x3c6bf8;};}function handleError(_0x46f3a0,_0x172fda){_0x172fda=_0x172fda||0x1f4;return function(_0x48d727){logger[_0x78f3('0x22')](_0x48d727[_0x78f3('0x23')]);if(_0x48d727[_0x78f3('0x24')]){delete _0x48d727[_0x78f3('0x24')];}_0x46f3a0[_0x78f3('0x16')](_0x172fda)['send'](_0x48d727);};}exports[_0x78f3('0x25')]=function(_0x197837,_0xf0607f){var _0x28b923={'raw':!![],'where':{'id':_0x197837['params']['id']}},_0x1595b7={};_0x1595b7[_0x78f3('0x26')]=_[_0x78f3('0x27')](db[_0x78f3('0x28')][_0x78f3('0x29')]);_0x1595b7[_0x78f3('0x2a')]=_[_0x78f3('0x27')](_0x197837[_0x78f3('0x2a')]);_0x1595b7[_0x78f3('0x2b')]=_[_0x78f3('0x2c')](_0x1595b7[_0x78f3('0x26')],_0x1595b7[_0x78f3('0x2a')]);_0x28b923[_0x78f3('0x2d')]=_[_0x78f3('0x2c')](_0x1595b7[_0x78f3('0x26')],qs[_0x78f3('0x2e')](_0x197837[_0x78f3('0x2a')][_0x78f3('0x2e')]));_0x28b923[_0x78f3('0x2d')]=_0x28b923[_0x78f3('0x2d')][_0x78f3('0x2f')]?_0x28b923[_0x78f3('0x2d')]:_0x1595b7[_0x78f3('0x26')];if(_0x197837[_0x78f3('0x2a')]['includeAll']){_0x28b923[_0x78f3('0x30')]=[{'all':!![]}];}_0x28b923=_['merge']({},_0x28b923,_0x197837[_0x78f3('0x31')]);return db[_0x78f3('0x28')][_0x78f3('0x32')](_0x28b923)['then'](handleEntityNotFound(_0xf0607f,null))[_0x78f3('0x20')](respondWithResult(_0xf0607f,null))[_0x78f3('0x33')](handleError(_0xf0607f,null));};exports[_0x78f3('0x1f')]=function(_0x3228f6,_0x4854c0){if(_0x3228f6['body']['id']){delete _0x3228f6[_0x78f3('0x34')]['id'];}return db[_0x78f3('0x28')][_0x78f3('0x32')]({'where':{'id':_0x3228f6[_0x78f3('0x35')]['id']}})[_0x78f3('0x20')](handleEntityNotFound(_0x4854c0,null))['then'](saveUpdates(_0x3228f6[_0x78f3('0x34')],null))[_0x78f3('0x20')](respondWithResult(_0x4854c0,null))[_0x78f3('0x33')](handleError(_0x4854c0,null));};exports['destroy']=function(_0x4c00f1,_0x371976){return db[_0x78f3('0x28')]['find']({'where':{'id':_0x4c00f1[_0x78f3('0x35')]['id']}})[_0x78f3('0x20')](handleEntityNotFound(_0x371976,null))[_0x78f3('0x20')](removeEntity(_0x371976,null))[_0x78f3('0x33')](handleError(_0x371976,null));};
\ No newline at end of file
+var _0xc901=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','apply','reject','update','then','destroy','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','intersection','attributes','fields','includeAll','merge','body','find','html-pdf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring'];(function(_0x632e9b,_0x37299e){var _0x2c19fc=function(_0x48513e){while(--_0x48513e){_0x632e9b['push'](_0x632e9b['shift']());}};_0x2c19fc(++_0x37299e);}(_0xc901,0x142));var _0x1c90=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc901[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x1c90('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1c90('0x1'));var moment=require(_0x1c90('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1c90('0x3'));var util=require(_0x1c90('0x4'));var path=require(_0x1c90('0x5'));var sox=require(_0x1c90('0x6'));var csv=require(_0x1c90('0x7'));var ejs=require(_0x1c90('0x8'));var fs=require('fs');var _=require(_0x1c90('0x9'));var squel=require(_0x1c90('0xa'));var crypto=require(_0x1c90('0xb'));var jsforce=require(_0x1c90('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1c90('0x7'));var querystring=require(_0x1c90('0xd'));var Papa=require(_0x1c90('0xe'));var Redis=require(_0x1c90('0xf'));var authService=require(_0x1c90('0x10'));var qs=require(_0x1c90('0x11'));var hardwareService=require(_0x1c90('0x12'));var logger=require(_0x1c90('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1c90('0x14'));var db=require(_0x1c90('0x15'))['db'];function respondWithStatusCode(_0x327610,_0x4addeb){_0x4addeb=_0x4addeb||0xcc;return function(_0x4da158){if(_0x4da158){return _0x327610[_0x1c90('0x16')](_0x4addeb);}return _0x327610[_0x1c90('0x17')](_0x4addeb)['end']();};}function respondWithResult(_0x23f69f,_0x128969){_0x128969=_0x128969||0xc8;return function(_0xf72b98){if(_0xf72b98){return _0x23f69f['status'](_0x128969)[_0x1c90('0x18')](_0xf72b98);}};}function respondWithFilteredResult(_0x5f3727,_0x1174b6){return function(_0x210ef4){if(_0x210ef4){var _0x7a88dc=_0x210ef4['count'],_0x42d8a4=_0x1174b6[_0x1c90('0x19')],_0x48bd5e=_0x1174b6[_0x1c90('0x19')]+_0x1174b6['limit'],_0x296c5d;if(_0x48bd5e>=_0x7a88dc){_0x48bd5e=_0x7a88dc;_0x296c5d=0xc8;}else{_0x296c5d=0xce;}_0x5f3727[_0x1c90('0x17')](_0x296c5d);return _0x5f3727['set']('Content-Range',_0x42d8a4+'-'+_0x48bd5e+'/'+_0x7a88dc)[_0x1c90('0x18')](_0x210ef4);}return null;};}function patchUpdates(_0x5dd488){return function(_0x341228){try{jsonpatch[_0x1c90('0x1a')](_0x341228,_0x5dd488,!![]);}catch(_0x2a5b73){return BPromise[_0x1c90('0x1b')](_0x2a5b73);}return _0x341228['save']();};}function saveUpdates(_0x1cd89b,_0x5a9cc0){return function(_0x525997){if(_0x525997){return _0x525997[_0x1c90('0x1c')](_0x1cd89b)[_0x1c90('0x1d')](function(_0x47fd11){return _0x47fd11;});}return null;};}function removeEntity(_0x27765a,_0x1af08e){return function(_0x445664){if(_0x445664){return _0x445664[_0x1c90('0x1e')]()[_0x1c90('0x1d')](function(){_0x27765a[_0x1c90('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x418f4c,_0x46baa1){return function(_0xab232a){if(!_0xab232a){_0x418f4c[_0x1c90('0x16')](0x194);}return _0xab232a;};}function handleError(_0x24539a,_0x26d55a){_0x26d55a=_0x26d55a||0x1f4;return function(_0x4c3bb0){logger['error'](_0x4c3bb0[_0x1c90('0x1f')]);if(_0x4c3bb0[_0x1c90('0x20')]){delete _0x4c3bb0[_0x1c90('0x20')];}_0x24539a['status'](_0x26d55a)[_0x1c90('0x21')](_0x4c3bb0);};}exports[_0x1c90('0x22')]=function(_0x4abffe,_0x10a9bd){var _0x7e9044={'raw':!![],'where':{'id':_0x4abffe[_0x1c90('0x23')]['id']}},_0x488d52={};_0x488d52[_0x1c90('0x24')]=_[_0x1c90('0x25')](db[_0x1c90('0x26')][_0x1c90('0x27')]);_0x488d52[_0x1c90('0x28')]=_[_0x1c90('0x25')](_0x4abffe[_0x1c90('0x28')]);_0x488d52['filters']=_[_0x1c90('0x29')](_0x488d52[_0x1c90('0x24')],_0x488d52[_0x1c90('0x28')]);_0x7e9044[_0x1c90('0x2a')]=_[_0x1c90('0x29')](_0x488d52[_0x1c90('0x24')],qs[_0x1c90('0x2b')](_0x4abffe[_0x1c90('0x28')][_0x1c90('0x2b')]));_0x7e9044[_0x1c90('0x2a')]=_0x7e9044[_0x1c90('0x2a')]['length']?_0x7e9044[_0x1c90('0x2a')]:_0x488d52[_0x1c90('0x24')];if(_0x4abffe['query'][_0x1c90('0x2c')]){_0x7e9044['include']=[{'all':!![]}];}_0x7e9044=_[_0x1c90('0x2d')]({},_0x7e9044,_0x4abffe['options']);return db[_0x1c90('0x26')]['find'](_0x7e9044)[_0x1c90('0x1d')](handleEntityNotFound(_0x10a9bd,null))[_0x1c90('0x1d')](respondWithResult(_0x10a9bd,null))['catch'](handleError(_0x10a9bd,null));};exports[_0x1c90('0x1c')]=function(_0x3d9d26,_0x5ef159){if(_0x3d9d26[_0x1c90('0x2e')]['id']){delete _0x3d9d26[_0x1c90('0x2e')]['id'];}return db[_0x1c90('0x26')][_0x1c90('0x2f')]({'where':{'id':_0x3d9d26[_0x1c90('0x23')]['id']}})['then'](handleEntityNotFound(_0x5ef159,null))['then'](saveUpdates(_0x3d9d26['body'],null))['then'](respondWithResult(_0x5ef159,null))['catch'](handleError(_0x5ef159,null));};exports[_0x1c90('0x1e')]=function(_0x438a50,_0x120d4c){return db['MailApplication'][_0x1c90('0x2f')]({'where':{'id':_0x438a50['params']['id']}})[_0x1c90('0x1d')](handleEntityNotFound(_0x120d4c,null))[_0x1c90('0x1d')](removeEntity(_0x120d4c,null))['catch'](handleError(_0x120d4c,null));};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js
index c3021d4..3e19cdd 100644
--- a/server/api/mailApplication/mailApplication.model.js
+++ b/server/api/mailApplication/mailApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb66=['rimraf','./mailApplication.attributes','exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1e175d,_0x41ff45){var _0x3a3ce5=function(_0x186001){while(--_0x186001){_0x1e175d['push'](_0x1e175d['shift']());}};_0x3a3ce5(++_0x41ff45);}(_0xfb66,0xf7));var _0x6fb6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfb66[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6fb6('0x0'));var util=require(_0x6fb6('0x1'));var logger=require(_0x6fb6('0x2'))(_0x6fb6('0x3'));var moment=require(_0x6fb6('0x4'));var BPromise=require(_0x6fb6('0x5'));var rp=require(_0x6fb6('0x6'));var fs=require('fs');var path=require(_0x6fb6('0x7'));var rimraf=require(_0x6fb6('0x8'));var config=require('../../config/environment');var attributes=require(_0x6fb6('0x9'));module[_0x6fb6('0xa')]=function(_0x1041f5,_0x374f2e){return _0x1041f5[_0x6fb6('0xb')](_0x6fb6('0xc'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6fb6('0xd'),'collate':_0x6fb6('0xe')});};
\ No newline at end of file
+var _0x24d9=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4676b3,_0xb53124){var _0x27fff0=function(_0x2df3e4){while(--_0x2df3e4){_0x4676b3['push'](_0x4676b3['shift']());}};_0x27fff0(++_0xb53124);}(_0x24d9,0xf6));var _0x924d=function(_0x393e46,_0x56f5f7){_0x393e46=_0x393e46-0x0;var _0x2b2497=_0x24d9[_0x393e46];return _0x2b2497;};'use strict';var _=require(_0x924d('0x0'));var util=require('util');var logger=require(_0x924d('0x1'))(_0x924d('0x2'));var moment=require(_0x924d('0x3'));var BPromise=require(_0x924d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x924d('0x5'));var config=require(_0x924d('0x6'));var attributes=require(_0x924d('0x7'));module[_0x924d('0x8')]=function(_0x240dab,_0x440f79){return _0x240dab['define'](_0x924d('0x9'),attributes,{'tableName':_0x924d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x924d('0xb'),'collate':_0x924d('0xc')});};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js
index 21e090b..f7b1a5b 100644
--- a/server/api/mailApplication/mailApplication.rpc.js
+++ b/server/api/mailApplication/mailApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x30b1f4,_0x32a0fe){var _0x57c004=function(_0x11e26f){while(--_0x11e26f){_0x30b1f4['push'](_0x30b1f4['shift']());}};_0x57c004(++_0x32a0fe);}(_0x7a54,0x106));var _0x47a5=function(_0x421da9,_0x2759ea){_0x421da9=_0x421da9-0x0;var _0x574ecc=_0x7a54[_0x421da9];return _0x574ecc;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});};
\ No newline at end of file
+var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4bca94,_0x5b2b9f){var _0x526d30=function(_0x23dd3a){while(--_0x23dd3a){_0x4bca94['push'](_0x4bca94['shift']());}};_0x526d30(++_0x5b2b9f);}(_0x7a54,0x106));var _0x47a5=function(_0x23edb5,_0x214492){_0x23edb5=_0x23edb5-0x0;var _0x495af0=_0x7a54[_0x23edb5];return _0x495af0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js
index ea2f086..70060a1 100644
--- a/server/api/mailInteraction/index.js
+++ b/server/api/mailInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00bb=['../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','mail','addTags','put','update','delete','destroy','removeTags','exports','multer','util','path','express'];(function(_0x311e77,_0x49a459){var _0x559c54=function(_0x283a97){while(--_0x283a97){_0x311e77['push'](_0x311e77['shift']());}};_0x559c54(++_0x49a459);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x00bb[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var auth=require(_0xb00b('0x4'));var interaction=require(_0xb00b('0x5'));var config=require('../../config/environment');var controller=require(_0xb00b('0x6'));router[_0xb00b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb00b('0x8'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xa')]);router[_0xb00b('0x7')](_0xb00b('0xb'),auth[_0xb00b('0x9')](),controller['show']);router['get'](_0xb00b('0xc'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xd')]);router[_0xb00b('0x7')](_0xb00b('0xe'),auth['isAuthenticated'](),controller[_0xb00b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb00b('0x10')](_0xb00b('0xc'),auth[_0xb00b('0x9')](),controller[_0xb00b('0x11')]);router[_0xb00b('0x10')](_0xb00b('0x12'),auth['isAuthenticated'](),interaction[_0xb00b('0x13')](_0xb00b('0x14'),'mailinteraction:addtags'),controller[_0xb00b('0x15')]);router[_0xb00b('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0xb00b('0x13')]('mail','mailinteraction:update'),controller[_0xb00b('0x17')]);router[_0xb00b('0x18')](_0xb00b('0xb'),auth[_0xb00b('0x9')](),interaction['tracked'](_0xb00b('0x14'),'mailinteraction:destroy'),controller[_0xb00b('0x19')]);router['delete'](_0xb00b('0x12'),auth['isAuthenticated'](),controller[_0xb00b('0x1a')]);module[_0xb00b('0x1b')]=router;
\ No newline at end of file
+var _0x4b84=['delete','mailinteraction:destroy','destroy','exports','multer','util','express','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','mail','put','/:id','tracked'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x4b84[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x44b8('0x3'));var config=require(_0x44b8('0x4'));var controller=require(_0x44b8('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x44b8('0x6')]('/describe',auth[_0x44b8('0x7')](),controller['describe']);router[_0x44b8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router[_0x44b8('0x6')](_0x44b8('0x9'),auth['isAuthenticated'](),controller[_0x44b8('0xa')]);router[_0x44b8('0x6')](_0x44b8('0xb'),auth[_0x44b8('0x7')](),controller[_0x44b8('0xc')]);router[_0x44b8('0xd')]('/',auth[_0x44b8('0x7')](),controller['create']);router[_0x44b8('0xd')](_0x44b8('0x9'),auth['isAuthenticated'](),controller[_0x44b8('0xe')]);router['post'](_0x44b8('0xf'),auth[_0x44b8('0x7')](),interaction['tracked'](_0x44b8('0x10'),'mailinteraction:addtags'),controller['addTags']);router[_0x44b8('0x11')](_0x44b8('0x12'),auth[_0x44b8('0x7')](),interaction[_0x44b8('0x13')]('mail','mailinteraction:update'),controller['update']);router[_0x44b8('0x14')]('/:id',auth[_0x44b8('0x7')](),interaction[_0x44b8('0x13')]('mail',_0x44b8('0x15')),controller[_0x44b8('0x16')]);router['delete'](_0x44b8('0xf'),auth[_0x44b8('0x7')](),controller['removeTags']);module[_0x44b8('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js
index 8ed431c..e03d542 100644
--- a/server/api/mailInteraction/mailInteraction.attributes.js
+++ b/server/api/mailInteraction/mailInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ff0=['DATE','STRING','TEXT','ENUM','out','long','sequelize','iconv','BOOLEAN'];(function(_0x3201bf,_0x3fbc6b){var _0x154e68=function(_0x5a7c2a){while(--_0x5a7c2a){_0x3201bf['push'](_0x3201bf['shift']());}};_0x154e68(++_0x3fbc6b);}(_0x2ff0,0x72));var _0x02ff=function(_0x14c8fb,_0x29a4ab){_0x14c8fb=_0x14c8fb-0x0;var _0x220dfe=_0x2ff0[_0x14c8fb];return _0x220dfe;};'use strict';var Sequelize=require(_0x02ff('0x0'));var iconv=require(_0x02ff('0x1'));module['exports']={'closed':{'type':Sequelize[_0x02ff('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x02ff('0x3')]},'disposition':{'type':Sequelize[_0x02ff('0x4')]},'note':{'type':Sequelize[_0x02ff('0x4')]},'inReplyTo':{'type':Sequelize[_0x02ff('0x4')](0x1fe)},'to':{'type':Sequelize[_0x02ff('0x4')]},'cc':{'type':Sequelize[_0x02ff('0x5')]('long')},'subject':{'type':Sequelize[_0x02ff('0x5')]()},'attach':{'type':Sequelize[_0x02ff('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x02ff('0x3')]},'substatus':{'type':Sequelize[_0x02ff('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x02ff('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x02ff('0x6')]('in',_0x02ff('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x02ff('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x02ff('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x02ff('0x5')](_0x02ff('0x8'))},'lastMsgText':{'type':Sequelize['TEXT'](_0x02ff('0x8'))}};
\ No newline at end of file
+var _0x6c31=['long','iconv','exports','BOOLEAN','DATE','STRING','TEXT','ENUM','out'];(function(_0x2a31ae,_0xcfcbd9){var _0x475a8d=function(_0x55a1b7){while(--_0x55a1b7){_0x2a31ae['push'](_0x2a31ae['shift']());}};_0x475a8d(++_0xcfcbd9);}(_0x6c31,0x1c3));var _0x16c3=function(_0x1ff527,_0x54b6d2){_0x1ff527=_0x1ff527-0x0;var _0x51cc75=_0x6c31[_0x1ff527];return _0x51cc75;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x16c3('0x0'));module[_0x16c3('0x1')]={'closed':{'type':Sequelize[_0x16c3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x16c3('0x3')]},'disposition':{'type':Sequelize[_0x16c3('0x4')]},'note':{'type':Sequelize[_0x16c3('0x4')]},'inReplyTo':{'type':Sequelize[_0x16c3('0x4')](0x1fe)},'to':{'type':Sequelize[_0x16c3('0x4')]},'cc':{'type':Sequelize[_0x16c3('0x5')]('long')},'subject':{'type':Sequelize[_0x16c3('0x5')]()},'attach':{'type':Sequelize[_0x16c3('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x16c3('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x16c3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x16c3('0x6')]('in',_0x16c3('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x16c3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x16c3('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x16c3('0x5')](_0x16c3('0x8'))},'lastMsgText':{'type':Sequelize[_0x16c3('0x5')](_0x16c3('0x8'))}};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js
index 95df1e9..3256e07 100644
--- a/server/api/mailInteraction/mailInteraction.controller.js
+++ b/server/api/mailInteraction/mailInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2cf0=['pick','select','field','name','color','from','tools_tags','COUNT(*)','mail_messages','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','mail_interactions','ui.UserId\x20=\x20i.UserId','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','expr','parse','advancedFilter','createdAt','value','dateStart','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','Messages.count','\x20<\x20?','map','filter','isNil','isEmpty','forEach','MailAccountId','i.MailAccountId\x20IN\x20?','concat','$lte','replace','\x27\x27\x27\x27','isNumeric','split','push','toString','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','DESC','group','i.id','Sequelize','QueryTypes','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','sequelize','count','keyBy','merge','MailInteraction','a.key','Account.key','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','u.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','Users','Tags','TagIds','lastMsgText','trimStart','fromString','lastMsgBody','rows','catch','show','params','intersection','includeAll','include','options','create','body','find','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','sort','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','Tag','emit','mailInteractionTags:save','removeTags','download','unix','join','server','files','attachments','root','tmp','interaction-%s.zip','bcc','subject','Attachment','Attachments','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','type','build','writeFileSync','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','./mailInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','apply','save','update','then','destroy','stack','send','index','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','where'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2cf0,0x17d));var _0x02cf=function(_0x302a35,_0x3b9e8f){_0x302a35=_0x302a35-0x0;var _0x4c3891=_0x2cf0[_0x302a35];return _0x4c3891;};'use strict';var pdf=require(_0x02cf('0x0'));var emlformat=require(_0x02cf('0x1'));var rimraf=require(_0x02cf('0x2'));var zipdir=require(_0x02cf('0x3'));var jsonpatch=require(_0x02cf('0x4'));var rp=require(_0x02cf('0x5'));var moment=require(_0x02cf('0x6'));var BPromise=require(_0x02cf('0x7'));var Mustache=require('mustache');var util=require(_0x02cf('0x8'));var path=require(_0x02cf('0x9'));var sox=require(_0x02cf('0xa'));var csv=require(_0x02cf('0xb'));var ejs=require(_0x02cf('0xc'));var fs=require('fs');var _=require(_0x02cf('0xd'));var squel=require(_0x02cf('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x02cf('0xf'));var toCsv=require(_0x02cf('0xb'));var querystring=require('querystring');var Papa=require(_0x02cf('0x10'));var htmlToText=require(_0x02cf('0x11'));var Redis=require(_0x02cf('0x12'));var authService=require(_0x02cf('0x13'));var qs=require(_0x02cf('0x14'));var hardwareService=require(_0x02cf('0x15'));var logger=require(_0x02cf('0x16'))(_0x02cf('0x17'));var utils=require('../../config/utils');var config=require(_0x02cf('0x18'));var db=require(_0x02cf('0x19'))['db'];config['redis']=_['defaults'](config[_0x02cf('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02cf('0x1a')]));require(_0x02cf('0x1b'))[_0x02cf('0x1c')](socket);function respondWithStatusCode(_0x14cd66,_0x5590bc){_0x5590bc=_0x5590bc||0xcc;return function(_0x4956c8){if(_0x4956c8){return _0x14cd66[_0x02cf('0x1d')](_0x5590bc);}return _0x14cd66[_0x02cf('0x1e')](_0x5590bc)[_0x02cf('0x1f')]();};}function respondWithResult(_0x361757,_0x572bc8){_0x572bc8=_0x572bc8||0xc8;return function(_0x201c12){if(_0x201c12){return _0x361757[_0x02cf('0x1e')](_0x572bc8)[_0x02cf('0x20')](_0x201c12);}};}function respondWithFilteredResult(_0x4f20b6,_0x175ef9){return function(_0x2a457c){if(_0x2a457c){var _0x922406=_0x2a457c['count'],_0x44d17f=_0x175ef9[_0x02cf('0x21')],_0x481bef=_0x175ef9['offset']+_0x175ef9[_0x02cf('0x22')],_0x51130e;if(_0x481bef>=_0x922406){_0x481bef=_0x922406;_0x51130e=0xc8;}else{_0x51130e=0xce;}_0x4f20b6[_0x02cf('0x1e')](_0x51130e);return _0x4f20b6[_0x02cf('0x23')]('Content-Range',_0x44d17f+'-'+_0x481bef+'/'+_0x922406)[_0x02cf('0x20')](_0x2a457c);}return null;};}function patchUpdates(_0x115846){return function(_0x27145a){try{jsonpatch[_0x02cf('0x24')](_0x27145a,_0x115846,!![]);}catch(_0x36d0e1){return BPromise['reject'](_0x36d0e1);}return _0x27145a[_0x02cf('0x25')]();};}function saveUpdates(_0x316d53,_0x26f2ec){return function(_0x5c692d){if(_0x5c692d){return _0x5c692d[_0x02cf('0x26')](_0x316d53)[_0x02cf('0x27')](function(_0x2bba1c){return _0x2bba1c;});}return null;};}function removeEntity(_0x150b81,_0x20ab04){return function(_0x5d3c98){if(_0x5d3c98){return _0x5d3c98[_0x02cf('0x28')]()[_0x02cf('0x27')](function(){_0x150b81[_0x02cf('0x1e')](0xcc)[_0x02cf('0x1f')]();});}};}function handleEntityNotFound(_0x205fb9,_0xf7d722){return function(_0x51ed76){if(!_0x51ed76){_0x205fb9[_0x02cf('0x1d')](0x194);}return _0x51ed76;};}function handleError(_0x7fc968,_0x2d207d){_0x2d207d=_0x2d207d||0x1f4;return function(_0x2e9ca6){logger['error'](_0x2e9ca6[_0x02cf('0x29')]);if(_0x2e9ca6['name']){delete _0x2e9ca6['name'];}_0x7fc968[_0x02cf('0x1e')](_0x2d207d)[_0x02cf('0x2a')](_0x2e9ca6);};}exports[_0x02cf('0x2b')]=function(_0x2f2b1a,_0x480c1c){var _0x105dab={},_0xb18380={},_0x2b18ef={'count':0x0,'rows':[]};var _0x2b8cd7=db['MailInteraction'][_0x02cf('0x2c')];_0xb18380[_0x02cf('0x2d')]=_[_0x02cf('0x2e')](_0x2b8cd7);_0xb18380[_0x02cf('0x2f')]=_['keys'](_0x2f2b1a[_0x02cf('0x2f')]);_0xb18380[_0x02cf('0x30')]=_['intersection'](_0xb18380['model'],_0xb18380[_0x02cf('0x2f')]);_0x105dab[_0x02cf('0x31')]=_['intersection'](_0xb18380[_0x02cf('0x2d')],qs[_0x02cf('0x32')](_0x2f2b1a[_0x02cf('0x2f')]['fields']));_0x105dab[_0x02cf('0x31')]=_0x105dab[_0x02cf('0x31')][_0x02cf('0x33')]?_0x105dab[_0x02cf('0x31')]:_0xb18380[_0x02cf('0x2d')];if(!_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x34')](_0x02cf('0x35'))){_0x105dab[_0x02cf('0x22')]=qs[_0x02cf('0x22')](_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x22')]);_0x105dab[_0x02cf('0x21')]=qs[_0x02cf('0x21')](_0x2f2b1a[_0x02cf('0x2f')]['offset']);}_0x105dab['order']=qs['sort'](_0x2f2b1a[_0x02cf('0x2f')]['sort']);_0x105dab[_0x02cf('0x36')]=qs[_0x02cf('0x30')](_[_0x02cf('0x37')](_0x2f2b1a[_0x02cf('0x2f')],_0xb18380[_0x02cf('0x30')]));var _0x5bfff1=[];var _0x56e57c=squel[_0x02cf('0x38')]()[_0x02cf('0x39')]('id')[_0x02cf('0x39')](_0x02cf('0x3a'))[_0x02cf('0x39')](_0x02cf('0x3b'))[_0x02cf('0x3c')](_0x02cf('0x3d'));var _0x4f3f5e=squel['select']()[_0x02cf('0x39')](_0x02cf('0x3e'))[_0x02cf('0x3c')](_0x02cf('0x3f'),'me')[_0x02cf('0x36')]('me.MailInteractionId\x20=\x20i.id')[_0x02cf('0x36')](_0x02cf('0x40'))[_0x02cf('0x36')](_0x02cf('0x41'));var _0x599c29=squel['select']()[_0x02cf('0x39')](_0x02cf('0x42'))[_0x02cf('0x39')](_0x02cf('0x43'))[_0x02cf('0x3c')](_0x02cf('0x44'),'ui')[_0x02cf('0x45')]('users','u',_0x02cf('0x46'));var _0xe27207=squel[_0x02cf('0x38')]()[_0x02cf('0x3c')](_0x02cf('0x47'),'i')['left_join']('user_has_mail_interactions','ui',_0x02cf('0x48'))[_0x02cf('0x45')](_0x02cf('0x49'),'u',_0x02cf('0x46'))[_0x02cf('0x45')]('cm_contacts','c',_0x02cf('0x4a'))[_0x02cf('0x45')](_0x02cf('0x49'),'o',_0x02cf('0x4b'))['left_join'](_0x02cf('0x4c'),'a',_0x02cf('0x4d'))[_0x02cf('0x45')](_0x02cf('0x3f'),'me',_0x02cf('0x4e'));var _0x285214=squel[_0x02cf('0x4f')]();if(_0x2f2b1a[_0x02cf('0x2f')]['advancedFilter']){var _0x3ef202=JSON[_0x02cf('0x50')](_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x51')]);_['keys'](_0x3ef202)['forEach'](function(_0x28c98c){var _0x22f92b=_0x3ef202[_0x28c98c];if(_0x28c98c===_0x02cf('0x52')){var _0x39c8ff=moment(_0x22f92b[_0x02cf('0x53')][_0x02cf('0x54')])[_0x02cf('0x55')](_0x02cf('0x56'))[_0x02cf('0x57')]()[_0x02cf('0x58')]();var _0x45c48c=moment(_0x45c48c)[_0x02cf('0x57')]()[_0x02cf('0x59')]('day')[_0x02cf('0x58')]();_0x285214[_0x02cf('0x5a')](_0x02cf('0x5b'),_0x39c8ff,_0x45c48c);}else{if(_[_0x02cf('0x5c')](_0x22f92b[_0x02cf('0x5d')])){_0x22f92b['condition']['forEach'](function(_0x53a705){switch(_0x22f92b['condition'][_0x02cf('0x53')]){case'IS':if(_0x28c98c!==_0x02cf('0x5e')&&_0x28c98c!=='Messages.count'){if(_['isArray'](_0x22f92b[_0x02cf('0x53')])&&_0x22f92b['value'][_0x02cf('0x33')]>0x1){_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+_0x02cf('0x60'),_0x22f92b[_0x02cf('0x53')]);}else{_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+_0x02cf('0x61'),_0x22f92b['value'][0x0]);}}break;case'=':_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+'\x20=\x20?',_0x22f92b['value']);break;case _0x02cf('0x62'):if(_0x28c98c===_0x02cf('0x63')){_0x285214[_0x02cf('0x5a')](_0x02cf('0x64')+_0x02cf('0x65'),'%'+_0x22f92b[_0x02cf('0x53')]+'%');_0x285214['or'](_0x02cf('0x66')+_0x02cf('0x65'),'%'+_0x22f92b[_0x02cf('0x53')]+'%');_0x285214['or'](_0x02cf('0x67')+'\x20LIKE\x20?','%'+_0x22f92b[_0x02cf('0x53')]+'%');}else{_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+'\x20LIKE\x20?','%'+_0x22f92b[_0x02cf('0x53')]+'%');}break;case'>':_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+_0x02cf('0x68'),_0x22f92b['value']);break;case'<':_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+'\x20<\x20?',_0x22f92b[_0x02cf('0x53')]);break;}});}else{switch(_0x22f92b['condition'][_0x02cf('0x53')]){case'IS':if(_0x28c98c!==_0x02cf('0x5e')&&_0x28c98c!==_0x02cf('0x69')){if(_['isArray'](_0x22f92b[_0x02cf('0x53')])&&_0x22f92b['value'][_0x02cf('0x33')]>0x1){_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+'\x20IN\x20?',_0x22f92b[_0x02cf('0x53')]);}else{_0x285214['and'](_0x22f92b['tableAlias']+'.'+_0x28c98c+_0x02cf('0x61'),_0x22f92b[_0x02cf('0x53')][0x0]);}}break;case'=':_0x285214['and'](_0x22f92b['tableAlias']+'.'+_0x28c98c+_0x02cf('0x61'),_0x22f92b['value']);break;case _0x02cf('0x62'):if(_0x28c98c===_0x02cf('0x63')){_0x285214['and'](_0x02cf('0x64')+'\x20LIKE\x20?','%'+_0x22f92b[_0x02cf('0x53')]+'%');_0x285214['or'](_0x02cf('0x66')+'\x20LIKE\x20?','%'+_0x22f92b[_0x02cf('0x53')]+'%');_0x285214['or'](_0x02cf('0x67')+_0x02cf('0x65'),'%'+_0x22f92b[_0x02cf('0x53')]+'%');}else{_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+'\x20LIKE\x20?','%'+_0x22f92b[_0x02cf('0x53')]+'%');}break;case'>':_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+_0x02cf('0x68'),_0x22f92b[_0x02cf('0x53')]);break;case'<':_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+_0x02cf('0x6a'),_0x22f92b['value']);break;}}}});}else{var _0x331e14=_(Object[_0x02cf('0x2e')](_0x2f2b1a[_0x02cf('0x2f')]))[_0x02cf('0x6b')](function(_0x7d30c8){return _0x2b8cd7[_0x02cf('0x34')](_0x7d30c8)?_0x7d30c8:undefined;})[_0x02cf('0x6c')](function(_0x567cf7){return!_[_0x02cf('0x6d')](_0x567cf7);})[_0x02cf('0x53')]();if(!_[_0x02cf('0x6e')](_0x331e14)){_0x331e14[_0x02cf('0x6f')](function(_0x485a45){if(_0x485a45===_0x02cf('0x70')){_0xe27207[_0x02cf('0x36')](_0x02cf('0x71'),[][_0x02cf('0x72')](_0x2f2b1a[_0x02cf('0x2f')][_0x485a45]));}else if(_0x485a45==='createdAt'){var _0x41e982=JSON[_0x02cf('0x50')](_0x2f2b1a['query'][_0x485a45])['$gte'];var _0x245364=JSON['parse'](_0x2f2b1a[_0x02cf('0x2f')][_0x485a45])[_0x02cf('0x73')];_0xe27207['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x41e982,_0x245364);}else{_0xe27207[_0x02cf('0x36')]('i.'+_0x485a45+_0x02cf('0x61'),_0x2f2b1a[_0x02cf('0x2f')][_0x485a45]);}});}if(_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x6c')]){var _0x34ea1b=_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x6c')][_0x02cf('0x74')]('\x5c','\x5c\x5c')[_0x02cf('0x74')]('\x27\x27',_0x02cf('0x75'));if(qs[_0x02cf('0x76')](_0x34ea1b)){_0x285214['or']('i.id\x20LIKE\x20?',_0x34ea1b+'%');}else if(qs['isEmail'](_0x34ea1b)){_0x285214['or']('c.email\x20LIKE\x20?',_0x34ea1b+'%');}else{var _0x439d7a=[];_0x34ea1b[_0x02cf('0x77')]('\x20')[_0x02cf('0x6f')](function(_0x32068c){_0x439d7a[_0x02cf('0x78')]('+'+_0x32068c[_0x02cf('0x79')]());});var _0x1c6a15=_0x439d7a['join']('\x20');_0x285214['or'](_0x02cf('0x7a'),_0x1c6a15)['or'](_0x02cf('0x7b'),_0x1c6a15);}}}_0xe27207[_0x02cf('0x36')](_0x285214);if(_0x105dab[_0x02cf('0x7c')]){_0x105dab[_0x02cf('0x7c')]['forEach'](function(_0x44aae1){_0xe27207[_0x02cf('0x7c')]('i.'+_0x44aae1[0x0],_0x44aae1[0x1]===_0x02cf('0x7d')?![]:!![]);});}_0xe27207[_0x02cf('0x7e')](_0x02cf('0x7f'));var _0x13508f={'type':db[_0x02cf('0x80')][_0x02cf('0x81')]['SELECT'],'raw':!![]};var _0x173068=_0xe27207['clone']()['field'](_0x02cf('0x3e'));if(!_0x2f2b1a[_0x02cf('0x2f')]['advancedFilter']){if(_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x82')]){if(_0x2f2b1a['query'][_0x02cf('0x82')]==0x1){_0x173068[_0x02cf('0x36')](util['format'](_0x02cf('0x83'),_0x4f3f5e[_0x02cf('0x79')]()));_0xe27207[_0x02cf('0x84')](_0x02cf('0x85'));}else{_0x173068[_0x02cf('0x36')](util[_0x02cf('0x58')](_0x02cf('0x86'),_0x4f3f5e[_0x02cf('0x79')]()));_0xe27207['having'](_0x02cf('0x87'));}}if(_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x88')]){var _0x146565=_[_0x02cf('0x5c')](_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x88')])?_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x88')]:new Array(_0x2f2b1a['query']['tag']);var _0x14dc30=squel[_0x02cf('0x4f')]();_0x146565[_0x02cf('0x6f')](function(_0x4c5cd3){_0x14dc30['or'](_0x02cf('0x89'),'%,'+_0x4c5cd3+',%');});_0xe27207['having'](_0x14dc30);_0x173068[_0x02cf('0x45')](_0x02cf('0x8a'),'it',_0x02cf('0x8b'));_0x173068[_0x02cf('0x45')](_0x02cf('0x3d'),'t',_0x02cf('0x8c'));_0x173068[_0x02cf('0x36')](_0x02cf('0x8d'),_0x146565);}}else{var _0x3ef202=JSON[_0x02cf('0x50')](_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x51')]);_[_0x02cf('0x2e')](_0x3ef202)[_0x02cf('0x6f')](function(_0x47b85d){var _0x57fac0=_0x3ef202[_0x47b85d];if(_0x47b85d===_0x02cf('0x5e')){var _0x2d82eb=_0x57fac0[_0x02cf('0x53')];var _0x189cb9=squel[_0x02cf('0x4f')]();_0x2d82eb[_0x02cf('0x6f')](function(_0x1afe45){_0x189cb9['or'](_0x02cf('0x89'),'%,'+_0x1afe45+',%');});_0xe27207[_0x02cf('0x84')](_0x189cb9);_0x173068[_0x02cf('0x45')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x173068[_0x02cf('0x45')](_0x02cf('0x3d'),'t',_0x02cf('0x8c'));_0x173068[_0x02cf('0x36')](_0x02cf('0x8d'),_0x2d82eb);}else if(_0x47b85d===_0x02cf('0x69')){if(_0x57fac0['value'][_0x02cf('0x33')]===0x1){if(_0x57fac0['value'][0x0]===0x1){_0x173068[_0x02cf('0x36')](util[_0x02cf('0x58')](_0x02cf('0x83'),_0x4f3f5e[_0x02cf('0x79')]()));_0xe27207[_0x02cf('0x84')](_0x02cf('0x85'));}else{_0x173068[_0x02cf('0x36')](util[_0x02cf('0x58')](_0x02cf('0x86'),_0x4f3f5e[_0x02cf('0x79')]()));_0xe27207['having'](_0x02cf('0x87'));}}}});}db[_0x02cf('0x8e')][_0x02cf('0x2f')](_0x173068[_0x02cf('0x79')](),_0x13508f)[_0x02cf('0x27')](function(_0x3826f9){_0x2b18ef[_0x02cf('0x8f')]=_0x3826f9[_0x02cf('0x33')];if(_0x2b18ef[_0x02cf('0x8f')]===0x0)return[];return db[_0x02cf('0x8e')][_0x02cf('0x2f')](_0x56e57c[_0x02cf('0x79')](),_0x13508f)[_0x02cf('0x27')](function(_0x35d09e){_0x5bfff1=_[_0x02cf('0x90')](_0x35d09e,'id');_0x13508f=_[_0x02cf('0x91')](_0x13508f,{'model':db[_0x02cf('0x92')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xe27207[_0x02cf('0x39')](_0x4f3f5e,_0x02cf('0x69'));_0xe27207[_0x02cf('0x39')](_0x02cf('0x93'),_0x02cf('0x94'));_0xe27207[_0x02cf('0x39')]('i.*');_0xe27207['field']('c.firstName',_0x02cf('0x95'));_0xe27207[_0x02cf('0x39')]('c.lastName',_0x02cf('0x96'));_0xe27207[_0x02cf('0x39')](_0x02cf('0x67'),_0x02cf('0x97'));_0xe27207['field'](_0x02cf('0x98'),_0x02cf('0x99'));_0xe27207[_0x02cf('0x39')](_0x02cf('0x9a'),'Contact.mobile');_0xe27207['field'](_0x02cf('0x9b'),_0x02cf('0x9c'));_0xe27207[_0x02cf('0x39')](_0x02cf('0x9d'),'User.name');_0xe27207['field'](_0x02cf('0x9e'),'TagIds');_0xe27207[_0x02cf('0x45')](_0x02cf('0x8a'),'it',_0x02cf('0x8b'));_0xe27207[_0x02cf('0x45')](_0x02cf('0x3d'),'t',_0x02cf('0x8c'));_0xe27207[_0x02cf('0x22')](_0x105dab[_0x02cf('0x22')]);_0xe27207['offset'](_0x105dab[_0x02cf('0x21')]);return db[_0x02cf('0x8e')]['query'](_0xe27207[_0x02cf('0x79')](),_0x13508f);})[_0x02cf('0x27')](function(_0x5e51db){_0x599c29[_0x02cf('0x36')]('ui.MailInteractionId\x20IN\x20?',_['map'](_0x5e51db,'id'));return db[_0x02cf('0x8e')][_0x02cf('0x2f')](_0x599c29[_0x02cf('0x79')](),_0x13508f)[_0x02cf('0x27')](function(_0x5d6207){var _0x463845=_[_0x02cf('0x9f')](_0x5d6207,_0x02cf('0xa0'));_0x5e51db['forEach'](function(_0x316d6e){if(_0x463845[_0x316d6e['id']]){_0x316d6e[_0x02cf('0xa1')]=_['map'](_0x463845[_0x316d6e['id']],function(_0x1050c2){return{'id':_0x1050c2['id']};});}if(_0x316d6e['TagIds']){_0x316d6e[_0x02cf('0xa2')]=[];_0x316d6e['TagIds'][_0x02cf('0x77')](',')['forEach'](function(_0xac9820){_0x316d6e[_0x02cf('0xa2')][_0x02cf('0x78')](_0x5bfff1[_0xac9820]);});}delete _0x316d6e[_0x02cf('0xa3')];if(!_0x316d6e[_0x02cf('0xa4')]){_0x316d6e[_0x02cf('0xa4')]=_[_0x02cf('0xa5')](htmlToText[_0x02cf('0xa6')](_0x316d6e[_0x02cf('0xa7')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}});return _0x5e51db;});});})[_0x02cf('0x27')](function(_0x3e78db){_0x2b18ef[_0x02cf('0xa8')]=_0x3e78db;return _0x2b18ef;})['then'](respondWithFilteredResult(_0x480c1c,_0x105dab))[_0x02cf('0xa9')](handleError(_0x480c1c,null));};exports[_0x02cf('0xaa')]=function(_0x40e078,_0x1fa42d){var _0x5e8d26={'raw':![],'where':{'id':_0x40e078[_0x02cf('0xab')]['id']}},_0x25e163={};_0x25e163[_0x02cf('0x2d')]=_['keys'](db[_0x02cf('0x92')]['rawAttributes']);_0x25e163[_0x02cf('0x2f')]=_[_0x02cf('0x2e')](_0x40e078['query']);_0x25e163[_0x02cf('0x30')]=_['intersection'](_0x25e163[_0x02cf('0x2d')],_0x25e163[_0x02cf('0x2f')]);_0x5e8d26[_0x02cf('0x31')]=_[_0x02cf('0xac')](_0x25e163['model'],qs[_0x02cf('0x32')](_0x40e078[_0x02cf('0x2f')][_0x02cf('0x32')]));_0x5e8d26[_0x02cf('0x31')]=_0x5e8d26['attributes'][_0x02cf('0x33')]?_0x5e8d26['attributes']:_0x25e163[_0x02cf('0x2d')];if(_0x40e078[_0x02cf('0x2f')][_0x02cf('0xad')]){_0x5e8d26[_0x02cf('0xae')]=[{'all':!![]}];}_0x5e8d26=_['merge']({},_0x5e8d26,_0x40e078[_0x02cf('0xaf')]);return db[_0x02cf('0x92')]['find'](_0x5e8d26)['then'](handleEntityNotFound(_0x1fa42d,null))['then'](respondWithResult(_0x1fa42d,null))[_0x02cf('0xa9')](handleError(_0x1fa42d,null));};exports[_0x02cf('0xb0')]=function(_0xcea802,_0x604799){return db['MailInteraction'][_0x02cf('0xb0')](_0xcea802[_0x02cf('0xb1')],{})[_0x02cf('0x27')](respondWithResult(_0x604799,0xc9))['catch'](handleError(_0x604799,null));};exports[_0x02cf('0x26')]=function(_0x4fd526,_0x574a75){if(_0x4fd526[_0x02cf('0xb1')]['id']){delete _0x4fd526[_0x02cf('0xb1')]['id'];}return db[_0x02cf('0x92')]['find']({'where':{'id':_0x4fd526[_0x02cf('0xab')]['id']}})['then'](handleEntityNotFound(_0x574a75,null))[_0x02cf('0x27')](saveUpdates(_0x4fd526['body'],null))['then'](respondWithResult(_0x574a75,null))[_0x02cf('0xa9')](handleError(_0x574a75,null));};exports[_0x02cf('0x28')]=function(_0x587618,_0x4d5c7){return db[_0x02cf('0x92')][_0x02cf('0xb2')]({'where':{'id':_0x587618[_0x02cf('0xab')]['id']}})[_0x02cf('0x27')](handleEntityNotFound(_0x4d5c7,null))['then'](removeEntity(_0x4d5c7,null))['catch'](handleError(_0x4d5c7,null));};exports[_0x02cf('0xb3')]=function(_0x159803,_0x122293){return db[_0x02cf('0x92')][_0x02cf('0xb3')]()['then'](respondWithResult(_0x122293,null))[_0x02cf('0xa9')](handleError(_0x122293,null));};exports[_0x02cf('0xb4')]=function(_0x1490bf,_0x1946bc,_0x17df80){return db[_0x02cf('0xb5')][_0x02cf('0xb2')]({'where':{'id':_0x1490bf[_0x02cf('0xab')]['id']}})[_0x02cf('0x27')](handleEntityNotFound(_0x1946bc,null))['then'](function(_0x55b1ce){if(_0x55b1ce){return _0x55b1ce[_0x02cf('0xb4')](_0x1490bf[_0x02cf('0xb1')][_0x02cf('0xb6')],_[_0x02cf('0xb7')](_0x1490bf['body'],[_0x02cf('0xb6'),'id'])||{});}})[_0x02cf('0x27')](respondWithResult(_0x1946bc,null))['catch'](handleError(_0x1946bc,null));};exports[_0x02cf('0xb8')]=function(_0x55c4ca,_0x1ce057,_0x13c257){var _0x37b050={'raw':![],'where':{}};var _0xd85790={};var _0xd7aaa6={'count':0x0,'rows':[]};return db['MailInteraction'][_0x02cf('0xb9')]({'where':{'id':_0x55c4ca['params']['id']}})['then'](handleEntityNotFound(_0x1ce057,null))[_0x02cf('0x27')](function(_0x496bb3){if(_0x496bb3){_0xd85790[_0x02cf('0x2d')]=_['keys'](db[_0x02cf('0xb5')]['rawAttributes']);_0xd85790[_0x02cf('0x2f')]=_[_0x02cf('0x2e')](_0x55c4ca[_0x02cf('0x2f')]);_0xd85790[_0x02cf('0x30')]=_[_0x02cf('0xac')](_0xd85790[_0x02cf('0x2d')],_0xd85790['query']);_0x37b050[_0x02cf('0x31')]=_[_0x02cf('0xac')](_0xd85790[_0x02cf('0x2d')],qs['fields'](_0x55c4ca[_0x02cf('0x2f')][_0x02cf('0x32')]));_0x37b050[_0x02cf('0x31')]=_0x37b050[_0x02cf('0x31')]['length']?_0x37b050[_0x02cf('0x31')]:_0xd85790[_0x02cf('0x2d')];if(!_0x55c4ca[_0x02cf('0x2f')]['hasOwnProperty'](_0x02cf('0x35'))){_0x37b050[_0x02cf('0x22')]=qs['limit'](_0x55c4ca[_0x02cf('0x2f')]['limit']);_0x37b050[_0x02cf('0x21')]=qs[_0x02cf('0x21')](_0x55c4ca['query'][_0x02cf('0x21')]);}_0x37b050[_0x02cf('0x7c')]=qs[_0x02cf('0xba')](_0x55c4ca[_0x02cf('0x2f')]['sort']);_0x37b050[_0x02cf('0x36')]=qs[_0x02cf('0x30')](_[_0x02cf('0x37')](_0x55c4ca[_0x02cf('0x2f')],_0xd85790['filters']));_0x37b050['where'][_0x02cf('0xa0')]=_0x496bb3['id'];if(_0x55c4ca[_0x02cf('0x2f')][_0x02cf('0x6c')]){_0x37b050[_0x02cf('0x36')]=_['merge'](_0x37b050[_0x02cf('0x36')],{'$or':_[_0x02cf('0x6b')](_0x37b050[_0x02cf('0x31')],function(_0x79691d){var _0x424739={};_0x424739[_0x79691d]={'$like':'%'+_0x55c4ca[_0x02cf('0x2f')][_0x02cf('0x6c')]+'%'};return _0x424739;})});}if(_0x55c4ca[_0x02cf('0x2f')][_0x02cf('0xbb')]){var _0xa9a781=_0x55c4ca['query'][_0x02cf('0xbb')]['split'](',');var _0x4f745b={};_0x4f745b[_0xa9a781[0x0]]={'$gte':moment(_0xa9a781[0x1])[_0x02cf('0x58')](_0x02cf('0xbc'))};_0x37b050[_0x02cf('0x36')]=_['merge'](_0x37b050[_0x02cf('0x36')],_0x4f745b);}_0x37b050=_[_0x02cf('0x91')]({},_0x37b050,_0x55c4ca[_0x02cf('0xaf')]);return db[_0x02cf('0xb5')]['count']({'where':_0x37b050[_0x02cf('0x36')]})[_0x02cf('0x27')](function(_0x226364){_0xd7aaa6[_0x02cf('0x8f')]=_0x226364;if(_0x55c4ca[_0x02cf('0x2f')]['includeAll']){_0x37b050[_0x02cf('0xae')]=[{'all':!![]}];}return db[_0x02cf('0xb5')][_0x02cf('0xbd')](_0x37b050);})[_0x02cf('0x27')](function(_0x1fbba4){_0xd7aaa6['rows']=_0x1fbba4;return _0xd7aaa6;});}})[_0x02cf('0x27')](respondWithFilteredResult(_0x1ce057,_0x37b050))[_0x02cf('0xa9')](handleError(_0x1ce057,null));};exports[_0x02cf('0xbe')]=function(_0x265a32,_0x1bf60b,_0x1329dd){return db[_0x02cf('0x92')][_0x02cf('0xb2')]({'where':{'id':_0x265a32['params']['id']}})['then'](handleEntityNotFound(_0x1bf60b,null))[_0x02cf('0x27')](function(_0x3b53a1){if(_0x3b53a1){return _0x3b53a1['setTags'](_0x265a32['body']['ids'],_[_0x02cf('0xb7')](_0x265a32[_0x02cf('0xb1')],[_0x02cf('0xb6'),'id'])||{})['spread'](function(){return db[_0x02cf('0xbf')][_0x02cf('0xbd')]({'attributes':['id',_0x02cf('0x3a'),'color'],'where':{'id':_0x265a32[_0x02cf('0xb1')][_0x02cf('0xb6')]}});})[_0x02cf('0x27')](function(_0x531226){socket[_0x02cf('0xc0')](_0x02cf('0xc1'),{'id':Number(_0x265a32[_0x02cf('0xab')]['id']),'tags':_0x531226||[]});return{'id':Number(_0x265a32[_0x02cf('0xab')]['id']),'tags':_0x531226||[]};});}})['then'](respondWithResult(_0x1bf60b,null))[_0x02cf('0xa9')](handleError(_0x1bf60b,null));};exports['removeTags']=function(_0x3973b4,_0xa32649,_0x58961a){return db[_0x02cf('0x92')]['find']({'where':{'id':_0x3973b4[_0x02cf('0xab')]['id']}})[_0x02cf('0x27')](handleEntityNotFound(_0xa32649,null))[_0x02cf('0x27')](function(_0x1e2428){if(_0x1e2428){return _0x1e2428[_0x02cf('0xc2')](_0x3973b4[_0x02cf('0x2f')][_0x02cf('0xb6')]);}})[_0x02cf('0x27')](respondWithStatusCode(_0xa32649,null))[_0x02cf('0xa9')](handleError(_0xa32649,null));};exports[_0x02cf('0xc3')]=function(_0x55aa36,_0x19f58a){var _0x25278f=moment()[_0x02cf('0xc4')]()[_0x02cf('0x79')]();var _0x59dc7e=path[_0x02cf('0xc5')](config['root'],_0x02cf('0xc6'),_0x02cf('0xc7'),_0x02cf('0xc8'));var _0x4985fc=path['join'](config[_0x02cf('0xc9')],_0x02cf('0xc6'),'files',_0x02cf('0xca'));var _0x5ecb35=path[_0x02cf('0xc5')](_0x4985fc,_0x25278f);var _0x502084=util[_0x02cf('0x58')](_0x02cf('0xcb'),_0x25278f);var _0x391115=path[_0x02cf('0xc5')](_0x4985fc,_0x502084);var _0x318323=![];return db[_0x02cf('0x92')][_0x02cf('0xb2')]({'where':{'id':_0x55aa36[_0x02cf('0xab')]['id']}})[_0x02cf('0x27')](handleEntityNotFound(_0x19f58a,null))['then'](function(_0x320391){if(_0x320391){return _0x320391[_0x02cf('0xb8')]({'attributes':['id',_0x02cf('0xb1'),_0x02cf('0x3c'),'to','cc',_0x02cf('0xcc'),_0x02cf('0xcd'),_0x02cf('0x52')],'where':{'secret':![]},'include':_0x55aa36[_0x02cf('0x2f')][_0x02cf('0xc8')]?[{'model':db[_0x02cf('0xce')],'as':_0x02cf('0xcf')}]:undefined,'order':qs['sort']('id')});}return[];})[_0x02cf('0x27')](function(_0x17bd35){_0x318323=_0x17bd35['length'];if(_0x17bd35['length']){fs['mkdirSync'](_0x5ecb35);return BPromise[_0x02cf('0xd0')](_0x17bd35,function(_0x99859a,_0x3fa690){var _0x225567=_0x99859a;var _0x46dbd5={'from':_0x225567[_0x02cf('0x3c')],'to':_0x225567['to'],'subject':_0x225567[_0x02cf('0xcd')],'html':_0x225567[_0x02cf('0xb1')],'headers':{'Date':moment(_0x225567[_0x02cf('0x52')])['format'](_0x02cf('0xd1'))},'attachments':[]};if(_0x99859a['cc']){_0x46dbd5[_0x02cf('0xd2')]['Cc']=_0x99859a['cc'];}if(_0x99859a['bcc']){_0x46dbd5[_0x02cf('0xd2')]['Bcc']=_0x99859a[_0x02cf('0xcc')];}return new BPromise(function(_0x4b1ab9,_0x9124a0){if(_0x99859a[_0x02cf('0xcf')]){for(var _0xbb1a2f=0x0;_0xbb1a2f<_0x99859a[_0x02cf('0xcf')][_0x02cf('0x33')];_0xbb1a2f++){var _0x2abcaa=_0x99859a[_0x02cf('0xcf')][_0xbb1a2f];var _0x1aab3f=path[_0x02cf('0xc5')](_0x59dc7e,_0x2abcaa[_0x02cf('0xd3')]);if(fs[_0x02cf('0xd4')](_0x1aab3f)){_0x46dbd5[_0x02cf('0xc8')][_0x02cf('0x78')]({'name':_0x2abcaa[_0x02cf('0x3a')],'contentType':_0x2abcaa[_0x02cf('0xd5')],'data':fs['readFileSync'](_0x1aab3f)});}}}emlformat[_0x02cf('0xd6')](_0x46dbd5,function(_0x2de1e9,_0x36c203){if(_0x2de1e9)return _0x9124a0(_0x2de1e9);fs[_0x02cf('0xd7')](path[_0x02cf('0xc5')](_0x5ecb35,util[_0x02cf('0x58')]('message%d.eml',_0x3fa690)),_0x36c203);return _0x4b1ab9(_0x36c203);});});});}})[_0x02cf('0x27')](function(){if(_0x318323){return new BPromise(function(_0x293c43,_0x9f9cc1){zipdir(_0x5ecb35,{'saveTo':_0x391115},function(_0x5a159b,_0x5022a4){if(_0x5a159b)return _0x9f9cc1(_0x5a159b);return _0x293c43(_0x5022a4);});});}})[_0x02cf('0x27')](function(){if(_0x318323){return new BPromise(function(_0x3a3117,_0x2417a8){rimraf(_0x5ecb35,function(_0x724c6c){if(_0x724c6c)_0x2417a8(_0x724c6c);return _0x3a3117();});});}})['then'](function(){if(_0x318323){return _0x19f58a[_0x02cf('0xc3')](_0x391115,_0x502084,function(_0x13ce63){if(_0x13ce63){console[_0x02cf('0xd8')]('err',_0x13ce63);}else{fs[_0x02cf('0xd9')](_0x391115);}});}else{return _0x19f58a[_0x02cf('0x1d')](0xc8);}})['catch'](handleError(_0x19f58a,null));};
\ No newline at end of file
+var _0xb870=['day','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','Messages.count','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','map','filter','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','$gte','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','tools_tags','t.id\x20=\x20it.TagId','merge','a.key','Account.key','i.*','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','u.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Users','Tags','push','lastMsgText','trimStart','fromString','lastMsgBody','show','MailInteraction','include','options','find','catch','create','body','params','describe','addMessage','MailMessage','omit','ids','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','root','server','files','tmp','interaction-%s.zip','bcc','attachments','Attachment','Attachments','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','type','readFileSync','writeFileSync','message%d.eml','log','html-pdf','eml-format','zip-dir','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','COUNT(*)','from','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','users','left_join','user_has_mail_interactions','ui.UserId\x20=\x20i.UserId','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','expr','advancedFilter','parse','forEach','createdAt','value','dateStart','startOf','utc','endOf'];(function(_0xf4666e,_0x571140){var _0x1853f1=function(_0x5160a5){while(--_0x5160a5){_0xf4666e['push'](_0xf4666e['shift']());}};_0x1853f1(++_0x571140);}(_0xb870,0x154));var _0x0b87=function(_0x158e3b,_0x4534b){_0x158e3b=_0x158e3b-0x0;var _0x551a1d=_0xb870[_0x158e3b];return _0x551a1d;};'use strict';var pdf=require(_0x0b87('0x0'));var emlformat=require(_0x0b87('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0b87('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b87('0x3'));var moment=require('moment');var BPromise=require(_0x0b87('0x4'));var Mustache=require('mustache');var util=require(_0x0b87('0x5'));var path=require(_0x0b87('0x6'));var sox=require(_0x0b87('0x7'));var csv=require('to-csv');var ejs=require(_0x0b87('0x8'));var fs=require('fs');var _=require(_0x0b87('0x9'));var squel=require('squel');var crypto=require(_0x0b87('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0b87('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0b87('0xc'));var htmlToText=require('html-to-text');var Redis=require(_0x0b87('0xd'));var authService=require(_0x0b87('0xe'));var qs=require(_0x0b87('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0b87('0x10'));var db=require(_0x0b87('0x11'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0b87('0x12'),'port':0x18eb});var socket=require(_0x0b87('0x13'))(new Redis(config['redis']));require(_0x0b87('0x14'))[_0x0b87('0x15')](socket);function respondWithStatusCode(_0x3dd888,_0x2c85f8){_0x2c85f8=_0x2c85f8||0xcc;return function(_0x2d8f24){if(_0x2d8f24){return _0x3dd888['sendStatus'](_0x2c85f8);}return _0x3dd888[_0x0b87('0x16')](_0x2c85f8)[_0x0b87('0x17')]();};}function respondWithResult(_0x2069e2,_0x36f2f5){_0x36f2f5=_0x36f2f5||0xc8;return function(_0x5211d7){if(_0x5211d7){return _0x2069e2[_0x0b87('0x16')](_0x36f2f5)[_0x0b87('0x18')](_0x5211d7);}};}function respondWithFilteredResult(_0x17d726,_0x539a98){return function(_0x2abc77){if(_0x2abc77){var _0x4fa698=_0x2abc77[_0x0b87('0x19')],_0x38831c=_0x539a98[_0x0b87('0x1a')],_0x2dcb4d=_0x539a98[_0x0b87('0x1a')]+_0x539a98[_0x0b87('0x1b')],_0xfbc513;if(_0x2dcb4d>=_0x4fa698){_0x2dcb4d=_0x4fa698;_0xfbc513=0xc8;}else{_0xfbc513=0xce;}_0x17d726['status'](_0xfbc513);return _0x17d726[_0x0b87('0x1c')](_0x0b87('0x1d'),_0x38831c+'-'+_0x2dcb4d+'/'+_0x4fa698)[_0x0b87('0x18')](_0x2abc77);}return null;};}function patchUpdates(_0x39bedc){return function(_0x283720){try{jsonpatch[_0x0b87('0x1e')](_0x283720,_0x39bedc,!![]);}catch(_0x20c952){return BPromise[_0x0b87('0x1f')](_0x20c952);}return _0x283720[_0x0b87('0x20')]();};}function saveUpdates(_0x404d78,_0x2a3d80){return function(_0x4a1b5f){if(_0x4a1b5f){return _0x4a1b5f[_0x0b87('0x21')](_0x404d78)[_0x0b87('0x22')](function(_0x59c71d){return _0x59c71d;});}return null;};}function removeEntity(_0x44aaa5,_0x27faa9){return function(_0x2b1356){if(_0x2b1356){return _0x2b1356[_0x0b87('0x23')]()[_0x0b87('0x22')](function(){_0x44aaa5[_0x0b87('0x16')](0xcc)[_0x0b87('0x17')]();});}};}function handleEntityNotFound(_0x202f3f,_0xd80688){return function(_0x44b20d){if(!_0x44b20d){_0x202f3f[_0x0b87('0x24')](0x194);}return _0x44b20d;};}function handleError(_0x513937,_0x2945a6){_0x2945a6=_0x2945a6||0x1f4;return function(_0x30e742){logger[_0x0b87('0x25')](_0x30e742[_0x0b87('0x26')]);if(_0x30e742[_0x0b87('0x27')]){delete _0x30e742[_0x0b87('0x27')];}_0x513937['status'](_0x2945a6)['send'](_0x30e742);};}exports[_0x0b87('0x28')]=function(_0x57742f,_0x53c3a2){var _0x226728={},_0x34c074={},_0x2a55ca={'count':0x0,'rows':[]};var _0x324571=db['MailInteraction'][_0x0b87('0x29')];_0x34c074[_0x0b87('0x2a')]=_[_0x0b87('0x2b')](_0x324571);_0x34c074[_0x0b87('0x2c')]=_[_0x0b87('0x2b')](_0x57742f[_0x0b87('0x2c')]);_0x34c074[_0x0b87('0x2d')]=_['intersection'](_0x34c074['model'],_0x34c074[_0x0b87('0x2c')]);_0x226728[_0x0b87('0x2e')]=_[_0x0b87('0x2f')](_0x34c074['model'],qs[_0x0b87('0x30')](_0x57742f[_0x0b87('0x2c')][_0x0b87('0x30')]));_0x226728[_0x0b87('0x2e')]=_0x226728[_0x0b87('0x2e')][_0x0b87('0x31')]?_0x226728['attributes']:_0x34c074['model'];if(!_0x57742f[_0x0b87('0x2c')][_0x0b87('0x32')](_0x0b87('0x33'))){_0x226728[_0x0b87('0x1b')]=qs[_0x0b87('0x1b')](_0x57742f[_0x0b87('0x2c')]['limit']);_0x226728[_0x0b87('0x1a')]=qs[_0x0b87('0x1a')](_0x57742f[_0x0b87('0x2c')][_0x0b87('0x1a')]);}_0x226728[_0x0b87('0x34')]=qs[_0x0b87('0x35')](_0x57742f['query']['sort']);_0x226728[_0x0b87('0x36')]=qs[_0x0b87('0x2d')](_[_0x0b87('0x37')](_0x57742f[_0x0b87('0x2c')],_0x34c074[_0x0b87('0x2d')]));var _0x4d2fff=[];var _0x354d5e=squel[_0x0b87('0x38')]()[_0x0b87('0x39')]('id')['field'](_0x0b87('0x27'))[_0x0b87('0x39')]('color')['from']('tools_tags');var _0x5d615d=squel['select']()['field'](_0x0b87('0x3a'))[_0x0b87('0x3b')]('mail_messages','me')[_0x0b87('0x36')](_0x0b87('0x3c'))[_0x0b87('0x36')](_0x0b87('0x3d'))[_0x0b87('0x36')](_0x0b87('0x3e'));var _0x39cc89=squel[_0x0b87('0x38')]()[_0x0b87('0x39')](_0x0b87('0x3f'))[_0x0b87('0x39')](_0x0b87('0x40'))['from']('user_has_mail_interactions','ui')['left_join'](_0x0b87('0x41'),'u','u.id\x20=\x20ui.UserId');var _0x35490e=squel[_0x0b87('0x38')]()[_0x0b87('0x3b')]('mail_interactions','i')[_0x0b87('0x42')](_0x0b87('0x43'),'ui',_0x0b87('0x44'))[_0x0b87('0x42')](_0x0b87('0x41'),'u',_0x0b87('0x45'))[_0x0b87('0x42')](_0x0b87('0x46'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0b87('0x42')](_0x0b87('0x41'),'o',_0x0b87('0x47'))[_0x0b87('0x42')]('mail_accounts','a',_0x0b87('0x48'))['left_join'](_0x0b87('0x49'),'me',_0x0b87('0x3c'));var _0x290f57=squel[_0x0b87('0x4a')]();if(_0x57742f[_0x0b87('0x2c')][_0x0b87('0x4b')]){var _0x48b577=JSON[_0x0b87('0x4c')](_0x57742f[_0x0b87('0x2c')][_0x0b87('0x4b')]);_[_0x0b87('0x2b')](_0x48b577)[_0x0b87('0x4d')](function(_0x21c050){var _0x441e50=_0x48b577[_0x21c050];if(_0x21c050===_0x0b87('0x4e')){var _0x390c48=moment(_0x441e50[_0x0b87('0x4f')][_0x0b87('0x50')])[_0x0b87('0x51')]('day')[_0x0b87('0x52')]()['format']();var _0x30c66e=moment(_0x30c66e)[_0x0b87('0x52')]()[_0x0b87('0x53')](_0x0b87('0x54'))[_0x0b87('0x55')]();_0x290f57[_0x0b87('0x56')](_0x0b87('0x57'),_0x390c48,_0x30c66e);}else{if(_[_0x0b87('0x58')](_0x441e50[_0x0b87('0x59')])){_0x441e50[_0x0b87('0x59')][_0x0b87('0x4d')](function(_0x463f77){switch(_0x441e50[_0x0b87('0x59')]['value']){case'IS':if(_0x21c050!==_0x0b87('0x5a')&&_0x21c050!==_0x0b87('0x5b')){if(_[_0x0b87('0x58')](_0x441e50[_0x0b87('0x4f')])&&_0x441e50['value'][_0x0b87('0x31')]>0x1){_0x290f57[_0x0b87('0x56')](_0x441e50[_0x0b87('0x5c')]+'.'+_0x21c050+_0x0b87('0x5d'),_0x441e50[_0x0b87('0x4f')]);}else{_0x290f57['and'](_0x441e50[_0x0b87('0x5c')]+'.'+_0x21c050+_0x0b87('0x5e'),_0x441e50[_0x0b87('0x4f')][0x0]);}}break;case'=':_0x290f57[_0x0b87('0x56')](_0x441e50['tableAlias']+'.'+_0x21c050+_0x0b87('0x5e'),_0x441e50[_0x0b87('0x4f')]);break;case _0x0b87('0x5f'):if(_0x21c050===_0x0b87('0x60')){_0x290f57['and'](_0x0b87('0x61')+_0x0b87('0x62'),'%'+_0x441e50[_0x0b87('0x4f')]+'%');_0x290f57['or'](_0x0b87('0x63')+_0x0b87('0x62'),'%'+_0x441e50[_0x0b87('0x4f')]+'%');_0x290f57['or'](_0x0b87('0x64')+_0x0b87('0x62'),'%'+_0x441e50[_0x0b87('0x4f')]+'%');}else{_0x290f57['and'](_0x441e50['tableAlias']+'.'+_0x21c050+_0x0b87('0x62'),'%'+_0x441e50[_0x0b87('0x4f')]+'%');}break;case'>':_0x290f57['and'](_0x441e50[_0x0b87('0x5c')]+'.'+_0x21c050+_0x0b87('0x65'),_0x441e50['value']);break;case'<':_0x290f57['and'](_0x441e50[_0x0b87('0x5c')]+'.'+_0x21c050+'\x20<\x20?',_0x441e50['value']);break;}});}else{switch(_0x441e50['condition'][_0x0b87('0x4f')]){case'IS':if(_0x21c050!==_0x0b87('0x5a')&&_0x21c050!==_0x0b87('0x5b')){if(_['isArray'](_0x441e50['value'])&&_0x441e50[_0x0b87('0x4f')]['length']>0x1){_0x290f57['and'](_0x441e50[_0x0b87('0x5c')]+'.'+_0x21c050+'\x20IN\x20?',_0x441e50[_0x0b87('0x4f')]);}else{_0x290f57[_0x0b87('0x56')](_0x441e50[_0x0b87('0x5c')]+'.'+_0x21c050+_0x0b87('0x5e'),_0x441e50[_0x0b87('0x4f')][0x0]);}}break;case'=':_0x290f57[_0x0b87('0x56')](_0x441e50['tableAlias']+'.'+_0x21c050+_0x0b87('0x5e'),_0x441e50['value']);break;case _0x0b87('0x5f'):if(_0x21c050===_0x0b87('0x60')){_0x290f57[_0x0b87('0x56')](_0x0b87('0x61')+_0x0b87('0x62'),'%'+_0x441e50[_0x0b87('0x4f')]+'%');_0x290f57['or'](_0x0b87('0x63')+_0x0b87('0x62'),'%'+_0x441e50[_0x0b87('0x4f')]+'%');_0x290f57['or'](_0x0b87('0x64')+_0x0b87('0x62'),'%'+_0x441e50['value']+'%');}else{_0x290f57[_0x0b87('0x56')](_0x441e50[_0x0b87('0x5c')]+'.'+_0x21c050+'\x20LIKE\x20?','%'+_0x441e50[_0x0b87('0x4f')]+'%');}break;case'>':_0x290f57[_0x0b87('0x56')](_0x441e50[_0x0b87('0x5c')]+'.'+_0x21c050+_0x0b87('0x65'),_0x441e50[_0x0b87('0x4f')]);break;case'<':_0x290f57[_0x0b87('0x56')](_0x441e50[_0x0b87('0x5c')]+'.'+_0x21c050+_0x0b87('0x66'),_0x441e50[_0x0b87('0x4f')]);break;}}}});}else{var _0x134d08=_(Object[_0x0b87('0x2b')](_0x57742f['query']))[_0x0b87('0x67')](function(_0x125335){return _0x324571[_0x0b87('0x32')](_0x125335)?_0x125335:undefined;})[_0x0b87('0x68')](function(_0x312c71){return!_[_0x0b87('0x69')](_0x312c71);})[_0x0b87('0x4f')]();if(!_[_0x0b87('0x6a')](_0x134d08)){_0x134d08[_0x0b87('0x4d')](function(_0x464332){if(_0x464332===_0x0b87('0x6b')){_0x35490e['where'](_0x0b87('0x6c'),[][_0x0b87('0x6d')](_0x57742f[_0x0b87('0x2c')][_0x464332]));}else if(_0x464332===_0x0b87('0x4e')){var _0x5f3a71=JSON[_0x0b87('0x4c')](_0x57742f['query'][_0x464332])[_0x0b87('0x6e')];var _0xd604e8=JSON[_0x0b87('0x4c')](_0x57742f[_0x0b87('0x2c')][_0x464332])['$lte'];_0x35490e[_0x0b87('0x36')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5f3a71,_0xd604e8);}else{_0x35490e[_0x0b87('0x36')]('i.'+_0x464332+_0x0b87('0x5e'),_0x57742f['query'][_0x464332]);}});}if(_0x57742f[_0x0b87('0x2c')]['filter']){var _0x2b5d08=_0x57742f['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x0b87('0x6f')]('\x27\x27',_0x0b87('0x70'));if(qs['isNumeric'](_0x2b5d08)){_0x290f57['or'](_0x0b87('0x71'),_0x2b5d08+'%');}else if(qs[_0x0b87('0x72')](_0x2b5d08)){_0x290f57['or'](_0x0b87('0x73'),_0x2b5d08+'%');}else{var _0x3ac980=[];_0x2b5d08['split']('\x20')[_0x0b87('0x4d')](function(_0x59b14e){_0x3ac980['push']('+'+_0x59b14e[_0x0b87('0x74')]());});var _0x318b59=_0x3ac980[_0x0b87('0x75')]('\x20');_0x290f57['or'](_0x0b87('0x76'),_0x318b59)['or'](_0x0b87('0x77'),_0x318b59);}}}_0x35490e[_0x0b87('0x36')](_0x290f57);if(_0x226728[_0x0b87('0x34')]){_0x226728[_0x0b87('0x34')]['forEach'](function(_0x1b3652){_0x35490e[_0x0b87('0x34')]('i.'+_0x1b3652[0x0],_0x1b3652[0x1]==='DESC'?![]:!![]);});}_0x35490e[_0x0b87('0x78')](_0x0b87('0x79'));var _0x13c71b={'type':db[_0x0b87('0x7a')][_0x0b87('0x7b')][_0x0b87('0x7c')],'raw':!![]};var _0xa473e5=_0x35490e[_0x0b87('0x7d')]()[_0x0b87('0x39')](_0x0b87('0x3a'));if(!_0x57742f['query'][_0x0b87('0x4b')]){if(_0x57742f[_0x0b87('0x2c')][_0x0b87('0x7e')]){if(_0x57742f[_0x0b87('0x2c')]['read']==0x1){_0xa473e5['where'](util[_0x0b87('0x55')](_0x0b87('0x7f'),_0x5d615d[_0x0b87('0x74')]()));_0x35490e[_0x0b87('0x80')](_0x0b87('0x81'));}else{_0xa473e5['where'](util['format'](_0x0b87('0x82'),_0x5d615d['toString']()));_0x35490e[_0x0b87('0x80')](_0x0b87('0x83'));}}if(_0x57742f['query'][_0x0b87('0x84')]){var _0x3acfde=_[_0x0b87('0x58')](_0x57742f['query'][_0x0b87('0x84')])?_0x57742f['query'][_0x0b87('0x84')]:new Array(_0x57742f[_0x0b87('0x2c')]['tag']);var _0x27c05c=squel[_0x0b87('0x4a')]();_0x3acfde[_0x0b87('0x4d')](function(_0x41a3c1){_0x27c05c['or'](_0x0b87('0x85'),'%,'+_0x41a3c1+',%');});_0x35490e['having'](_0x27c05c);_0xa473e5['left_join'](_0x0b87('0x86'),'it',_0x0b87('0x87'));_0xa473e5['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');_0xa473e5[_0x0b87('0x36')](_0x0b87('0x88'),_0x3acfde);}}else{var _0x48b577=JSON[_0x0b87('0x4c')](_0x57742f[_0x0b87('0x2c')]['advancedFilter']);_[_0x0b87('0x2b')](_0x48b577)[_0x0b87('0x4d')](function(_0x1f0d1c){var _0x496fdf=_0x48b577[_0x1f0d1c];if(_0x1f0d1c==='TagId'){var _0x3bc678=_0x496fdf[_0x0b87('0x4f')];var _0x1a4aed=squel['expr']();_0x3bc678['forEach'](function(_0x1d8787){_0x1a4aed['or'](_0x0b87('0x85'),'%,'+_0x1d8787+',%');});_0x35490e[_0x0b87('0x80')](_0x1a4aed);_0xa473e5[_0x0b87('0x42')](_0x0b87('0x86'),'it','it.MailInteractionId\x20=\x20i.id');_0xa473e5[_0x0b87('0x42')](_0x0b87('0x89'),'t',_0x0b87('0x8a'));_0xa473e5[_0x0b87('0x36')](_0x0b87('0x88'),_0x3bc678);}else if(_0x1f0d1c===_0x0b87('0x5b')){if(_0x496fdf['value'][_0x0b87('0x31')]===0x1){if(_0x496fdf[_0x0b87('0x4f')][0x0]===0x1){_0xa473e5[_0x0b87('0x36')](util['format'](_0x0b87('0x7f'),_0x5d615d['toString']()));_0x35490e[_0x0b87('0x80')](_0x0b87('0x81'));}else{_0xa473e5[_0x0b87('0x36')](util[_0x0b87('0x55')]('%s\x20>\x200',_0x5d615d['toString']()));_0x35490e[_0x0b87('0x80')](_0x0b87('0x83'));}}}});}db['sequelize'][_0x0b87('0x2c')](_0xa473e5[_0x0b87('0x74')](),_0x13c71b)['then'](function(_0x231c1a){_0x2a55ca[_0x0b87('0x19')]=_0x231c1a[_0x0b87('0x31')];if(_0x2a55ca[_0x0b87('0x19')]===0x0)return[];return db['sequelize']['query'](_0x354d5e[_0x0b87('0x74')](),_0x13c71b)[_0x0b87('0x22')](function(_0x27e4c8){_0x4d2fff=_['keyBy'](_0x27e4c8,'id');_0x13c71b=_[_0x0b87('0x8b')](_0x13c71b,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x35490e['field'](_0x5d615d,_0x0b87('0x5b'));_0x35490e[_0x0b87('0x39')](_0x0b87('0x8c'),_0x0b87('0x8d'));_0x35490e[_0x0b87('0x39')](_0x0b87('0x8e'));_0x35490e['field'](_0x0b87('0x61'),'Contact.firstName');_0x35490e['field'](_0x0b87('0x63'),_0x0b87('0x8f'));_0x35490e[_0x0b87('0x39')](_0x0b87('0x64'),_0x0b87('0x90'));_0x35490e[_0x0b87('0x39')]('c.phone',_0x0b87('0x91'));_0x35490e[_0x0b87('0x39')](_0x0b87('0x92'),_0x0b87('0x93'));_0x35490e[_0x0b87('0x39')](_0x0b87('0x94'),_0x0b87('0x95'));_0x35490e[_0x0b87('0x39')](_0x0b87('0x96'),'User.name');_0x35490e['field'](_0x0b87('0x97'),_0x0b87('0x98'));_0x35490e[_0x0b87('0x42')]('mail_interaction_has_tags','it',_0x0b87('0x87'));_0x35490e['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');_0x35490e[_0x0b87('0x1b')](_0x226728[_0x0b87('0x1b')]);_0x35490e[_0x0b87('0x1a')](_0x226728[_0x0b87('0x1a')]);return db['sequelize'][_0x0b87('0x2c')](_0x35490e[_0x0b87('0x74')](),_0x13c71b);})[_0x0b87('0x22')](function(_0x195cce){_0x39cc89['where'](_0x0b87('0x99'),_[_0x0b87('0x67')](_0x195cce,'id'));return db['sequelize'][_0x0b87('0x2c')](_0x39cc89[_0x0b87('0x74')](),_0x13c71b)[_0x0b87('0x22')](function(_0x5d611d){var _0x257477=_[_0x0b87('0x9a')](_0x5d611d,_0x0b87('0x9b'));_0x195cce[_0x0b87('0x4d')](function(_0x22f0fd){if(_0x257477[_0x22f0fd['id']]){_0x22f0fd[_0x0b87('0x9c')]=_[_0x0b87('0x67')](_0x257477[_0x22f0fd['id']],function(_0x124961){return{'id':_0x124961['id']};});}if(_0x22f0fd[_0x0b87('0x98')]){_0x22f0fd['Tags']=[];_0x22f0fd[_0x0b87('0x98')]['split'](',')[_0x0b87('0x4d')](function(_0x3e50aa){_0x22f0fd[_0x0b87('0x9d')][_0x0b87('0x9e')](_0x4d2fff[_0x3e50aa]);});}delete _0x22f0fd[_0x0b87('0x98')];if(!_0x22f0fd[_0x0b87('0x9f')]){_0x22f0fd[_0x0b87('0x9f')]=_[_0x0b87('0xa0')](htmlToText[_0x0b87('0xa1')](_0x22f0fd[_0x0b87('0xa2')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}});return _0x195cce;});});})[_0x0b87('0x22')](function(_0x1e1891){_0x2a55ca['rows']=_0x1e1891;return _0x2a55ca;})[_0x0b87('0x22')](respondWithFilteredResult(_0x53c3a2,_0x226728))['catch'](handleError(_0x53c3a2,null));};exports[_0x0b87('0xa3')]=function(_0x42b7bd,_0xe45c2d){var _0x85bdfa={'raw':![],'where':{'id':_0x42b7bd['params']['id']}},_0x409014={};_0x409014[_0x0b87('0x2a')]=_[_0x0b87('0x2b')](db[_0x0b87('0xa4')]['rawAttributes']);_0x409014[_0x0b87('0x2c')]=_['keys'](_0x42b7bd[_0x0b87('0x2c')]);_0x409014[_0x0b87('0x2d')]=_['intersection'](_0x409014[_0x0b87('0x2a')],_0x409014[_0x0b87('0x2c')]);_0x85bdfa[_0x0b87('0x2e')]=_['intersection'](_0x409014['model'],qs[_0x0b87('0x30')](_0x42b7bd[_0x0b87('0x2c')][_0x0b87('0x30')]));_0x85bdfa[_0x0b87('0x2e')]=_0x85bdfa['attributes']['length']?_0x85bdfa['attributes']:_0x409014[_0x0b87('0x2a')];if(_0x42b7bd['query']['includeAll']){_0x85bdfa[_0x0b87('0xa5')]=[{'all':!![]}];}_0x85bdfa=_[_0x0b87('0x8b')]({},_0x85bdfa,_0x42b7bd[_0x0b87('0xa6')]);return db[_0x0b87('0xa4')][_0x0b87('0xa7')](_0x85bdfa)['then'](handleEntityNotFound(_0xe45c2d,null))[_0x0b87('0x22')](respondWithResult(_0xe45c2d,null))[_0x0b87('0xa8')](handleError(_0xe45c2d,null));};exports[_0x0b87('0xa9')]=function(_0x422381,_0xf79af1){return db[_0x0b87('0xa4')][_0x0b87('0xa9')](_0x422381[_0x0b87('0xaa')],{})['then'](respondWithResult(_0xf79af1,0xc9))[_0x0b87('0xa8')](handleError(_0xf79af1,null));};exports[_0x0b87('0x21')]=function(_0x2a3f9b,_0x38da28){if(_0x2a3f9b['body']['id']){delete _0x2a3f9b[_0x0b87('0xaa')]['id'];}return db['MailInteraction'][_0x0b87('0xa7')]({'where':{'id':_0x2a3f9b['params']['id']}})[_0x0b87('0x22')](handleEntityNotFound(_0x38da28,null))[_0x0b87('0x22')](saveUpdates(_0x2a3f9b[_0x0b87('0xaa')],null))[_0x0b87('0x22')](respondWithResult(_0x38da28,null))[_0x0b87('0xa8')](handleError(_0x38da28,null));};exports[_0x0b87('0x23')]=function(_0x396da9,_0x128084){return db[_0x0b87('0xa4')][_0x0b87('0xa7')]({'where':{'id':_0x396da9[_0x0b87('0xab')]['id']}})[_0x0b87('0x22')](handleEntityNotFound(_0x128084,null))[_0x0b87('0x22')](removeEntity(_0x128084,null))[_0x0b87('0xa8')](handleError(_0x128084,null));};exports[_0x0b87('0xac')]=function(_0x4def87,_0x324b29){return db[_0x0b87('0xa4')]['describe']()[_0x0b87('0x22')](respondWithResult(_0x324b29,null))[_0x0b87('0xa8')](handleError(_0x324b29,null));};exports[_0x0b87('0xad')]=function(_0x48b193,_0x20adf2,_0x4ee5d7){return db[_0x0b87('0xae')][_0x0b87('0xa7')]({'where':{'id':_0x48b193[_0x0b87('0xab')]['id']}})[_0x0b87('0x22')](handleEntityNotFound(_0x20adf2,null))[_0x0b87('0x22')](function(_0x322785){if(_0x322785){return _0x322785['addMessage'](_0x48b193[_0x0b87('0xaa')]['ids'],_[_0x0b87('0xaf')](_0x48b193[_0x0b87('0xaa')],[_0x0b87('0xb0'),'id'])||{});}})[_0x0b87('0x22')](respondWithResult(_0x20adf2,null))[_0x0b87('0xa8')](handleError(_0x20adf2,null));};exports[_0x0b87('0xb1')]=function(_0x27f59d,_0x2bb888,_0x1a4a40){var _0x23a25c={'raw':![],'where':{}};var _0x5400d3={};var _0x46bede={'count':0x0,'rows':[]};return db[_0x0b87('0xa4')]['findOne']({'where':{'id':_0x27f59d['params']['id']}})[_0x0b87('0x22')](handleEntityNotFound(_0x2bb888,null))[_0x0b87('0x22')](function(_0x1946c6){if(_0x1946c6){_0x5400d3[_0x0b87('0x2a')]=_[_0x0b87('0x2b')](db[_0x0b87('0xae')]['rawAttributes']);_0x5400d3['query']=_[_0x0b87('0x2b')](_0x27f59d[_0x0b87('0x2c')]);_0x5400d3[_0x0b87('0x2d')]=_[_0x0b87('0x2f')](_0x5400d3[_0x0b87('0x2a')],_0x5400d3[_0x0b87('0x2c')]);_0x23a25c[_0x0b87('0x2e')]=_['intersection'](_0x5400d3[_0x0b87('0x2a')],qs[_0x0b87('0x30')](_0x27f59d[_0x0b87('0x2c')]['fields']));_0x23a25c['attributes']=_0x23a25c[_0x0b87('0x2e')]['length']?_0x23a25c[_0x0b87('0x2e')]:_0x5400d3[_0x0b87('0x2a')];if(!_0x27f59d[_0x0b87('0x2c')][_0x0b87('0x32')](_0x0b87('0x33'))){_0x23a25c[_0x0b87('0x1b')]=qs[_0x0b87('0x1b')](_0x27f59d[_0x0b87('0x2c')]['limit']);_0x23a25c['offset']=qs['offset'](_0x27f59d['query'][_0x0b87('0x1a')]);}_0x23a25c[_0x0b87('0x34')]=qs[_0x0b87('0x35')](_0x27f59d[_0x0b87('0x2c')][_0x0b87('0x35')]);_0x23a25c[_0x0b87('0x36')]=qs[_0x0b87('0x2d')](_[_0x0b87('0x37')](_0x27f59d['query'],_0x5400d3['filters']));_0x23a25c['where'][_0x0b87('0x9b')]=_0x1946c6['id'];if(_0x27f59d['query'][_0x0b87('0x68')]){_0x23a25c[_0x0b87('0x36')]=_['merge'](_0x23a25c['where'],{'$or':_[_0x0b87('0x67')](_0x23a25c[_0x0b87('0x2e')],function(_0x33018a){var _0x2a44c7={};_0x2a44c7[_0x33018a]={'$like':'%'+_0x27f59d['query'][_0x0b87('0x68')]+'%'};return _0x2a44c7;})});}if(_0x27f59d[_0x0b87('0x2c')]['$gte']){var _0xa50b1a=_0x27f59d['query'][_0x0b87('0x6e')][_0x0b87('0xb2')](',');var _0x2fd169={};_0x2fd169[_0xa50b1a[0x0]]={'$gte':moment(_0xa50b1a[0x1])['format'](_0x0b87('0xb3'))};_0x23a25c[_0x0b87('0x36')]=_[_0x0b87('0x8b')](_0x23a25c[_0x0b87('0x36')],_0x2fd169);}_0x23a25c=_['merge']({},_0x23a25c,_0x27f59d[_0x0b87('0xa6')]);return db['MailMessage'][_0x0b87('0x19')]({'where':_0x23a25c[_0x0b87('0x36')]})[_0x0b87('0x22')](function(_0x3596bd){_0x46bede['count']=_0x3596bd;if(_0x27f59d[_0x0b87('0x2c')][_0x0b87('0xb4')]){_0x23a25c[_0x0b87('0xa5')]=[{'all':!![]}];}return db[_0x0b87('0xae')][_0x0b87('0xb5')](_0x23a25c);})[_0x0b87('0x22')](function(_0x212c89){_0x46bede[_0x0b87('0xb6')]=_0x212c89;return _0x46bede;});}})['then'](respondWithFilteredResult(_0x2bb888,_0x23a25c))['catch'](handleError(_0x2bb888,null));};exports[_0x0b87('0xb7')]=function(_0x3310bd,_0x279d2f,_0x8d57ca){return db[_0x0b87('0xa4')][_0x0b87('0xa7')]({'where':{'id':_0x3310bd[_0x0b87('0xab')]['id']}})[_0x0b87('0x22')](handleEntityNotFound(_0x279d2f,null))[_0x0b87('0x22')](function(_0x183f7b){if(_0x183f7b){return _0x183f7b[_0x0b87('0xb8')](_0x3310bd[_0x0b87('0xaa')]['ids'],_['omit'](_0x3310bd[_0x0b87('0xaa')],[_0x0b87('0xb0'),'id'])||{})[_0x0b87('0xb9')](function(){return db[_0x0b87('0xba')][_0x0b87('0xb5')]({'attributes':['id',_0x0b87('0x27'),_0x0b87('0xbb')],'where':{'id':_0x3310bd[_0x0b87('0xaa')][_0x0b87('0xb0')]}});})[_0x0b87('0x22')](function(_0x16e62d){socket[_0x0b87('0xbc')]('mailInteractionTags:save',{'id':Number(_0x3310bd[_0x0b87('0xab')]['id']),'tags':_0x16e62d||[]});return{'id':Number(_0x3310bd[_0x0b87('0xab')]['id']),'tags':_0x16e62d||[]};});}})['then'](respondWithResult(_0x279d2f,null))[_0x0b87('0xa8')](handleError(_0x279d2f,null));};exports[_0x0b87('0xbd')]=function(_0x165016,_0x766010,_0x4a9cd0){return db[_0x0b87('0xa4')][_0x0b87('0xa7')]({'where':{'id':_0x165016['params']['id']}})['then'](handleEntityNotFound(_0x766010,null))[_0x0b87('0x22')](function(_0x4ffbdb){if(_0x4ffbdb){return _0x4ffbdb['removeTags'](_0x165016[_0x0b87('0x2c')]['ids']);}})[_0x0b87('0x22')](respondWithStatusCode(_0x766010,null))[_0x0b87('0xa8')](handleError(_0x766010,null));};exports[_0x0b87('0xbe')]=function(_0x1f129a,_0x507957){var _0x16c323=moment()['unix']()['toString']();var _0x304a8=path[_0x0b87('0x75')](config[_0x0b87('0xbf')],_0x0b87('0xc0'),_0x0b87('0xc1'),'attachments');var _0x10b489=path[_0x0b87('0x75')](config['root'],_0x0b87('0xc0'),_0x0b87('0xc1'),_0x0b87('0xc2'));var _0x1029cf=path[_0x0b87('0x75')](_0x10b489,_0x16c323);var _0x534b21=util[_0x0b87('0x55')](_0x0b87('0xc3'),_0x16c323);var _0x5cd466=path['join'](_0x10b489,_0x534b21);var _0x3bc3b2=![];return db['MailInteraction']['find']({'where':{'id':_0x1f129a['params']['id']}})[_0x0b87('0x22')](handleEntityNotFound(_0x507957,null))['then'](function(_0x2f0436){if(_0x2f0436){return _0x2f0436[_0x0b87('0xb1')]({'attributes':['id',_0x0b87('0xaa'),'from','to','cc',_0x0b87('0xc4'),'subject',_0x0b87('0x4e')],'where':{'secret':![]},'include':_0x1f129a['query'][_0x0b87('0xc5')]?[{'model':db[_0x0b87('0xc6')],'as':_0x0b87('0xc7')}]:undefined,'order':qs[_0x0b87('0x35')]('id')});}return[];})[_0x0b87('0x22')](function(_0x388ed0){_0x3bc3b2=_0x388ed0[_0x0b87('0x31')];if(_0x388ed0['length']){fs[_0x0b87('0xc8')](_0x1029cf);return BPromise[_0x0b87('0xc9')](_0x388ed0,function(_0x2a789c,_0x50e8d3){var _0x15cf14=_0x2a789c;var _0x3e4114={'from':_0x15cf14['from'],'to':_0x15cf14['to'],'subject':_0x15cf14['subject'],'html':_0x15cf14[_0x0b87('0xaa')],'headers':{'Date':moment(_0x15cf14[_0x0b87('0x4e')])[_0x0b87('0x55')](_0x0b87('0xca'))},'attachments':[]};if(_0x2a789c['cc']){_0x3e4114[_0x0b87('0xcb')]['Cc']=_0x2a789c['cc'];}if(_0x2a789c[_0x0b87('0xc4')]){_0x3e4114['headers'][_0x0b87('0xcc')]=_0x2a789c[_0x0b87('0xc4')];}return new BPromise(function(_0x15b13a,_0x5af0a9){if(_0x2a789c[_0x0b87('0xc7')]){for(var _0x5032c2=0x0;_0x5032c2<_0x2a789c[_0x0b87('0xc7')][_0x0b87('0x31')];_0x5032c2++){var _0x487f4e=_0x2a789c['Attachments'][_0x5032c2];var _0x4be4cc=path[_0x0b87('0x75')](_0x304a8,_0x487f4e[_0x0b87('0xcd')]);if(fs[_0x0b87('0xce')](_0x4be4cc)){_0x3e4114['attachments'][_0x0b87('0x9e')]({'name':_0x487f4e[_0x0b87('0x27')],'contentType':_0x487f4e[_0x0b87('0xcf')],'data':fs[_0x0b87('0xd0')](_0x4be4cc)});}}}emlformat['build'](_0x3e4114,function(_0x22cb8c,_0x10291e){if(_0x22cb8c)return _0x5af0a9(_0x22cb8c);fs[_0x0b87('0xd1')](path[_0x0b87('0x75')](_0x1029cf,util[_0x0b87('0x55')](_0x0b87('0xd2'),_0x50e8d3)),_0x10291e);return _0x15b13a(_0x10291e);});});});}})[_0x0b87('0x22')](function(){if(_0x3bc3b2){return new BPromise(function(_0x359e04,_0xb75a13){zipdir(_0x1029cf,{'saveTo':_0x5cd466},function(_0x20582f,_0x264ddc){if(_0x20582f)return _0xb75a13(_0x20582f);return _0x359e04(_0x264ddc);});});}})[_0x0b87('0x22')](function(){if(_0x3bc3b2){return new BPromise(function(_0x59c034,_0x334705){rimraf(_0x1029cf,function(_0x542030){if(_0x542030)_0x334705(_0x542030);return _0x59c034();});});}})[_0x0b87('0x22')](function(){if(_0x3bc3b2){return _0x507957[_0x0b87('0xbe')](_0x5cd466,_0x534b21,function(_0x3d2dca){if(_0x3d2dca){console[_0x0b87('0xd3')]('err',_0x3d2dca);}else{fs['unlinkSync'](_0x5cd466);}});}else{return _0x507957[_0x0b87('0x24')](0xc8);}})['catch'](handleError(_0x507957,null));};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js
index 3ac7e9e..149b9aa 100644
--- a/server/api/mailInteraction/mailInteraction.events.js
+++ b/server/api/mailInteraction/mailInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7fd9=['emit','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x2a7589,_0x90c5d3){var _0x18619b=function(_0x3b60f8){while(--_0x3b60f8){_0x2a7589['push'](_0x2a7589['shift']());}};_0x18619b(++_0x90c5d3);}(_0x7fd9,0x16f));var _0x97fd=function(_0x3231e8,_0x41df58){_0x3231e8=_0x3231e8-0x0;var _0x13a897=_0x7fd9[_0x3231e8];return _0x13a897;};'use strict';var EventEmitter=require(_0x97fd('0x0'));var MailInteraction=require(_0x97fd('0x1'))['db']['MailInteraction'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x97fd('0x2')](0x0);var events={'afterCreate':_0x97fd('0x3'),'afterUpdate':'update','afterDestroy':_0x97fd('0x4')};function emitEvent(_0x44c526){return function(_0x209cb6,_0x1ae083,_0x1300de){MailInteractionEvents[_0x97fd('0x5')](_0x44c526+':'+_0x209cb6['id'],_0x209cb6);MailInteractionEvents[_0x97fd('0x5')](_0x44c526,_0x209cb6);_0x1300de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
+var _0x6c52=['update','remove','emit','hasOwnProperty','exports','events','MailInteraction','setMaxListeners','save'];(function(_0x1ed73d,_0x3e6227){var _0x1a3980=function(_0x6c9046){while(--_0x6c9046){_0x1ed73d['push'](_0x1ed73d['shift']());}};_0x1a3980(++_0x3e6227);}(_0x6c52,0x68));var _0x26c5=function(_0x2aecf5,_0x3ca902){_0x2aecf5=_0x2aecf5-0x0;var _0x1966a7=_0x6c52[_0x2aecf5];return _0x1966a7;};'use strict';var EventEmitter=require(_0x26c5('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x26c5('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x26c5('0x2')](0x0);var events={'afterCreate':_0x26c5('0x3'),'afterUpdate':_0x26c5('0x4'),'afterDestroy':_0x26c5('0x5')};function emitEvent(_0x534c83){return function(_0x4b5876,_0x3ac0c6,_0x2fef3d){MailInteractionEvents[_0x26c5('0x6')](_0x534c83+':'+_0x4b5876['id'],_0x4b5876);MailInteractionEvents[_0x26c5('0x6')](_0x534c83,_0x4b5876);_0x2fef3d(null);};}for(var e in events){if(events[_0x26c5('0x7')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x26c5('0x8')]=MailInteractionEvents;
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js
index 6a7aca9..7dba7c3 100644
--- a/server/api/mailInteraction/mailInteraction.model.js
+++ b/server/api/mailInteraction/mailInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6427=['./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x32b30c,_0x2d5ec8){var _0xcfc212=function(_0x42e668){while(--_0x42e668){_0x32b30c['push'](_0x32b30c['shift']());}};_0xcfc212(++_0x2d5ec8);}(_0x6427,0xbe));var _0x7642=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x6427[_0x55f8b4];return _0x2475f9;};'use strict';var _=require('lodash');var util=require(_0x7642('0x0'));var logger=require(_0x7642('0x1'))(_0x7642('0x2'));var moment=require(_0x7642('0x3'));var BPromise=require(_0x7642('0x4'));var rp=require(_0x7642('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7642('0x6'));var config=require(_0x7642('0x7'));var attributes=require(_0x7642('0x8'));module[_0x7642('0x9')]=function(_0x2e2fa7,_0x3788b1){return _0x2e2fa7[_0x7642('0xa')](_0x7642('0xb'),attributes,{'tableName':_0x7642('0xc'),'paranoid':![],'indexes':[{'name':_0x7642('0xd'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x37cb5a,_0x17527f,_0x1ef8d3){if(_0x37cb5a[_0x7642('0xe')]){_0x37cb5a[_0x7642('0xf')]=moment()[_0x7642('0x10')](_0x7642('0x11'));}if(_0x37cb5a[_0x7642('0x12')]){_0x37cb5a[_0x7642('0x13')]=moment()[_0x7642('0x10')](_0x7642('0x11'));}_0x1ef8d3(null,_0x17527f);},'beforeUpdate':function(_0xd214ee,_0x167ff6,_0x3e5f50){if(_0xd214ee[_0x7642('0x14')](_0x7642('0xe'))){_0xd214ee[_0x7642('0xf')]=moment()['format'](_0x7642('0x11'));}if(_0xd214ee[_0x7642('0x14')]('closed')){_0xd214ee[_0x7642('0x13')]=moment()['format'](_0x7642('0x11'));}_0x3e5f50(null,_0xd214ee);}},'charset':'utf8mb4','collate':_0x7642('0x15')});};
\ No newline at end of file
+var _0x9755=['./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatusAt','format','utf8mb4','lodash','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x22d06a,_0x292997){var _0x4d89b8=function(_0x53a0de){while(--_0x53a0de){_0x22d06a['push'](_0x22d06a['shift']());}};_0x4d89b8(++_0x292997);}(_0x9755,0x1c6));var _0x5975=function(_0x2f965f,_0x100aca){_0x2f965f=_0x2f965f-0x0;var _0x73f2b9=_0x9755[_0x2f965f];return _0x73f2b9;};'use strict';var _=require(_0x5975('0x0'));var util=require('util');var logger=require(_0x5975('0x1'))(_0x5975('0x2'));var moment=require(_0x5975('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5975('0x4'));var config=require(_0x5975('0x5'));var attributes=require(_0x5975('0x6'));module[_0x5975('0x7')]=function(_0x414e54,_0x1839fb){return _0x414e54[_0x5975('0x8')]('MailInteraction',attributes,{'tableName':_0x5975('0x9'),'paranoid':![],'indexes':[{'name':_0x5975('0xa'),'fields':['subject','to'],'type':_0x5975('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3920c1,_0x15ebfd,_0x5701dd){if(_0x3920c1[_0x5975('0xc')]){_0x3920c1['substatusAt']=moment()['format'](_0x5975('0xd'));}if(_0x3920c1[_0x5975('0xe')]){_0x3920c1[_0x5975('0xf')]=moment()['format'](_0x5975('0xd'));}_0x5701dd(null,_0x15ebfd);},'beforeUpdate':function(_0xe62491,_0x471ddf,_0x52bdaa){if(_0xe62491[_0x5975('0x10')](_0x5975('0xc'))){_0xe62491[_0x5975('0x11')]=moment()[_0x5975('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xe62491['changed'](_0x5975('0xe'))){_0xe62491[_0x5975('0xf')]=moment()[_0x5975('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x52bdaa(null,_0xe62491);}},'charset':_0x5975('0x13'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js
index 0bd58df..b6ecced 100644
--- a/server/api/mailInteraction/mailInteraction.rpc.js
+++ b/server/api/mailInteraction/mailInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6075=['AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToMailInteraction','omit','ids'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6075,0x191));var _0x5607=function(_0x480834,_0x2fbcee){_0x480834=_0x480834-0x0;var _0x33aab2=_0x6075[_0x480834];return _0x33aab2;};'use strict';var _=require('lodash');var util=require(_0x5607('0x0'));var moment=require(_0x5607('0x1'));var BPromise=require(_0x5607('0x2'));var rs=require(_0x5607('0x3'));var fs=require('fs');var Redis=require(_0x5607('0x4'));var db=require(_0x5607('0x5'))['db'];var utils=require(_0x5607('0x6'));var logger=require(_0x5607('0x7'))(_0x5607('0x8'));var config=require('../../config/environment');var jayson=require(_0x5607('0x9'));var client=jayson[_0x5607('0xa')][_0x5607('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5607('0xc')],{'host':_0x5607('0xd'),'port':0x18eb});var socket=require(_0x5607('0xe'))(new Redis(config[_0x5607('0xc')]));require(_0x5607('0xf'))['register'](socket);function respondWithRpcPromise(_0x96549b,_0x45de00,_0xe18e86){return new BPromise(function(_0x4ea43b,_0x6e62a0){return client['request'](_0x96549b,_0xe18e86)['then'](function(_0x3eb82e){logger[_0x5607('0x10')](_0x5607('0x11'),_0x45de00,'request\x20sent');logger[_0x5607('0x12')](_0x5607('0x13'),_0x45de00,_0x5607('0x14'),JSON[_0x5607('0x15')](_0x3eb82e));if(_0x3eb82e[_0x5607('0x16')]){if(_0x3eb82e[_0x5607('0x16')][_0x5607('0x17')]===0x1f4){logger[_0x5607('0x16')](_0x5607('0x11'),_0x45de00,_0x3eb82e['error'][_0x5607('0x18')]);return _0x6e62a0(_0x3eb82e[_0x5607('0x16')][_0x5607('0x18')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x45de00,_0x3eb82e[_0x5607('0x16')]['message']);return _0x4ea43b(_0x3eb82e[_0x5607('0x16')][_0x5607('0x18')]);}else{logger[_0x5607('0x10')](_0x5607('0x11'),_0x45de00,_0x5607('0x14'));_0x4ea43b(_0x3eb82e[_0x5607('0x19')]['message']);}})[_0x5607('0x1a')](function(_0x50bd2c){logger[_0x5607('0x16')](_0x5607('0x11'),_0x45de00,_0x50bd2c);_0x6e62a0(_0x50bd2c);});});}exports[_0x5607('0x1b')]=function(_0x5f080d){var _0xffa25d=this;return new Promise(function(_0x6e4868,_0x303089){return db['MailInteraction'][_0x5607('0x1c')](_0x5f080d[_0x5607('0x1d')],{'raw':_0x5f080d[_0x5607('0x1e')]?_0x5f080d['options'][_0x5607('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f080d['options']?_0x5f080d['options'][_0x5607('0x20')]||null:null,'attributes':_0x5f080d[_0x5607('0x1e')]?_0x5f080d[_0x5607('0x1e')][_0x5607('0x21')]||null:null,'limit':_0x5f080d[_0x5607('0x1e')]?_0x5f080d[_0x5607('0x1e')][_0x5607('0x22')]||null:null})[_0x5607('0x23')](function(_0x8a7592){logger[_0x5607('0x10')]('UpdateMailInteraction',_0x5f080d);logger[_0x5607('0x12')](_0x5607('0x1b'),_0x5f080d,JSON['stringify'](_0x8a7592));_0x6e4868(_0x8a7592);})[_0x5607('0x1a')](function(_0x14dd08){logger[_0x5607('0x16')](_0x5607('0x1b'),_0x14dd08[_0x5607('0x18')],_0x5f080d);_0x303089(_0xffa25d[_0x5607('0x16')](0x1f4,_0x14dd08[_0x5607('0x18')]));});});};exports[_0x5607('0x24')]=function(_0x570e62){return new Promise(function(_0xcd4e9f,_0x309ede){return db['MailInteraction']['find']({'where':_0x570e62[_0x5607('0x1e')]?_0x570e62[_0x5607('0x1e')][_0x5607('0x20')]||null:null})[_0x5607('0x23')](function(_0x2c3078){if(_0x2c3078){return _0x2c3078['addTags'](_0x570e62[_0x5607('0x1d')]['ids'],_[_0x5607('0x25')](_0x570e62[_0x5607('0x1d')],[_0x5607('0x26'),'id'])||{});}})['spread'](function(_0x326c51){logger['info'](_0x5607('0x27'),_0x570e62);logger[_0x5607('0x12')](_0x5607('0x27'),_0x570e62,JSON[_0x5607('0x15')](_0x326c51));_0xcd4e9f(_0x326c51);})[_0x5607('0x1a')](function(_0x525fb5){logger[_0x5607('0x16')]('AddTags',_0x525fb5[_0x5607('0x18')],_0x570e62);_0x309ede(_this[_0x5607('0x16')](0x1f4,_0x525fb5['message']));});});};
\ No newline at end of file
+var _0xe829=['socket.io-emitter','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailInteraction','body','options','raw','where','attributes','limit','UpdateMailInteraction','debug','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','defaults','localhost'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xe829,0xde));var _0x9e82=function(_0x5842c3,_0x56bd74){_0x5842c3=_0x5842c3-0x0;var _0x44bf8c=_0xe829[_0x5842c3];return _0x44bf8c;};'use strict';var _=require('lodash');var util=require(_0x9e82('0x0'));var moment=require(_0x9e82('0x1'));var BPromise=require(_0x9e82('0x2'));var rs=require(_0x9e82('0x3'));var fs=require('fs');var Redis=require(_0x9e82('0x4'));var db=require(_0x9e82('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e82('0x6'))(_0x9e82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9e82('0x8')]({'port':0x232a});config[_0x9e82('0x9')]=_[_0x9e82('0xa')](config['redis'],{'host':_0x9e82('0xb'),'port':0x18eb});var socket=require(_0x9e82('0xc'))(new Redis(config[_0x9e82('0x9')]));require(_0x9e82('0xd'))['register'](socket);function respondWithRpcPromise(_0xf49a04,_0x408027,_0x57d575){return new BPromise(function(_0x234265,_0x46dd78){return client['request'](_0xf49a04,_0x57d575)[_0x9e82('0xe')](function(_0x2f0639){logger[_0x9e82('0xf')](_0x9e82('0x10'),_0x408027,_0x9e82('0x11'));logger['debug'](_0x9e82('0x12'),_0x408027,_0x9e82('0x11'),JSON[_0x9e82('0x13')](_0x2f0639));if(_0x2f0639[_0x9e82('0x14')]){if(_0x2f0639['error']['code']===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x408027,_0x2f0639['error'][_0x9e82('0x15')]);return _0x46dd78(_0x2f0639['error'][_0x9e82('0x15')]);}logger[_0x9e82('0x14')](_0x9e82('0x10'),_0x408027,_0x2f0639[_0x9e82('0x14')]['message']);return _0x234265(_0x2f0639[_0x9e82('0x14')][_0x9e82('0x15')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x408027,_0x9e82('0x11'));_0x234265(_0x2f0639[_0x9e82('0x16')][_0x9e82('0x15')]);}})[_0x9e82('0x17')](function(_0xfbeb43){logger[_0x9e82('0x14')](_0x9e82('0x10'),_0x408027,_0xfbeb43);_0x46dd78(_0xfbeb43);});});}exports['UpdateMailInteraction']=function(_0x243a46){var _0x135b3c=this;return new Promise(function(_0x3463e6,_0x5b4352){return db[_0x9e82('0x18')]['update'](_0x243a46[_0x9e82('0x19')],{'raw':_0x243a46[_0x9e82('0x1a')]?_0x243a46[_0x9e82('0x1a')][_0x9e82('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x243a46[_0x9e82('0x1a')]?_0x243a46['options'][_0x9e82('0x1c')]||null:null,'attributes':_0x243a46[_0x9e82('0x1a')]?_0x243a46[_0x9e82('0x1a')][_0x9e82('0x1d')]||null:null,'limit':_0x243a46['options']?_0x243a46['options'][_0x9e82('0x1e')]||null:null})[_0x9e82('0xe')](function(_0x2c3895){logger[_0x9e82('0xf')](_0x9e82('0x1f'),_0x243a46);logger[_0x9e82('0x20')]('UpdateMailInteraction',_0x243a46,JSON[_0x9e82('0x13')](_0x2c3895));_0x3463e6(_0x2c3895);})['catch'](function(_0x5658f5){logger[_0x9e82('0x14')]('UpdateMailInteraction',_0x5658f5['message'],_0x243a46);_0x5b4352(_0x135b3c[_0x9e82('0x14')](0x1f4,_0x5658f5[_0x9e82('0x15')]));});});};exports[_0x9e82('0x21')]=function(_0x2690ef){return new Promise(function(_0x19491d,_0x495b77){return db['MailInteraction'][_0x9e82('0x22')]({'where':_0x2690ef[_0x9e82('0x1a')]?_0x2690ef[_0x9e82('0x1a')]['where']||null:null})['then'](function(_0x3a2acf){if(_0x3a2acf){return _0x3a2acf[_0x9e82('0x23')](_0x2690ef[_0x9e82('0x19')][_0x9e82('0x24')],_[_0x9e82('0x25')](_0x2690ef[_0x9e82('0x19')],['ids','id'])||{});}})['spread'](function(_0x5077ef){logger['info'](_0x9e82('0x26'),_0x2690ef);logger[_0x9e82('0x20')](_0x9e82('0x26'),_0x2690ef,JSON['stringify'](_0x5077ef));_0x19491d(_0x5077ef);})[_0x9e82('0x17')](function(_0x4398c7){logger['error'](_0x9e82('0x26'),_0x4398c7[_0x9e82('0x15')],_0x2690ef);_0x495b77(_this[_0x9e82('0x14')](0x1f4,_0x4398c7[_0x9e82('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js
index b1c7dcc..6c9c6e6 100644
--- a/server/api/mailInteraction/mailInteraction.socket.js
+++ b/server/api/mailInteraction/mailInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d21=['save','update','emit','removeListener','./mailInteraction.events'];(function(_0x116d33,_0xd0ac04){var _0x32c10d=function(_0xd65b43){while(--_0xd65b43){_0x116d33['push'](_0x116d33['shift']());}};_0x32c10d(++_0xd0ac04);}(_0x6d21,0x144));var _0x16d2=function(_0x2aaa29,_0x56aeb8){_0x2aaa29=_0x2aaa29-0x0;var _0x521519=_0x6d21[_0x2aaa29];return _0x521519;};'use strict';var MailInteractionEvents=require(_0x16d2('0x0'));var events=[_0x16d2('0x1'),'remove',_0x16d2('0x2')];function createListener(_0x1a6a12,_0x3410d8){return function(_0xe8a044){_0x3410d8[_0x16d2('0x3')](_0x1a6a12,_0xe8a044);};}function removeListener(_0x3e4596,_0x180b92){return function(){MailInteractionEvents[_0x16d2('0x4')](_0x3e4596,_0x180b92);};}exports['register']=function(_0x3db806){for(var _0x4afdd5=0x0,_0x28a21f=events['length'];_0x4afdd5<_0x28a21f;_0x4afdd5++){var _0x5bdbaf=events[_0x4afdd5];var _0x40ebac=createListener('mailInteraction:'+_0x5bdbaf,_0x3db806);MailInteractionEvents['on'](_0x5bdbaf,_0x40ebac);}};
\ No newline at end of file
+var _0x036c=['length','mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x5d2f8a,_0x581301){var _0x47fed1=function(_0x3872f9){while(--_0x3872f9){_0x5d2f8a['push'](_0x5d2f8a['shift']());}};_0x47fed1(++_0x581301);}(_0x036c,0x1bb));var _0xc036=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x036c[_0x1facfa];return _0x9ec701;};'use strict';var MailInteractionEvents=require(_0xc036('0x0'));var events=[_0xc036('0x1'),_0xc036('0x2'),_0xc036('0x3')];function createListener(_0x3f6764,_0x47b629){return function(_0x497215){_0x47b629[_0xc036('0x4')](_0x3f6764,_0x497215);};}function removeListener(_0xaa17dc,_0x425033){return function(){MailInteractionEvents[_0xc036('0x5')](_0xaa17dc,_0x425033);};}exports[_0xc036('0x6')]=function(_0x2e7540){for(var _0x235840=0x0,_0x2d78a1=events[_0xc036('0x7')];_0x235840<_0x2d78a1;_0x235840++){var _0x107050=events[_0x235840];var _0x14f073=createListener(_0xc036('0x8')+_0x107050,_0x2e7540);MailInteractionEvents['on'](_0x107050,_0x14f073);}};
\ No newline at end of file
diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js
index 2349332..4fca7fe 100644
--- a/server/api/mailMessage/index.js
+++ b/server/api/mailMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['post','tracked','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download'];(function(_0x19990f,_0x1ebd9e){var _0x188288=function(_0x37a6c2){while(--_0x37a6c2){_0x19990f['push'](_0x19990f['shift']());}};_0x188288(++_0x1ebd9e);}(_0x814b,0x1a2));var _0xb814=function(_0x5b26cb,_0x527ab0){_0x5b26cb=_0x5b26cb-0x0;var _0x563d12=_0x814b[_0x5b26cb];return _0x563d12;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0x9')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')]('/',auth[_0xb814('0xa')](),interaction[_0xb814('0x12')]('mail',_0xb814('0x13')),controller['create']);router[_0xb814('0x14')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x15')]);router[_0xb814('0x14')](_0xb814('0x16'),auth[_0xb814('0xa')](),controller[_0xb814('0x17')]);router[_0xb814('0x14')](_0xb814('0x18'),auth[_0xb814('0xa')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x1b')]);module[_0xb814('0x1c')]=router;
\ No newline at end of file
+var _0x71ab=['../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','mail','create','put','/:id/accept','accept','reject','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0xcb61a5,_0x5ca66d){var _0x1c2ac9=function(_0xc1fa14){while(--_0xc1fa14){_0xcb61a5['push'](_0xcb61a5['shift']());}};_0x1c2ac9(++_0x5ca66d);}(_0x71ab,0x64));var _0xb71a=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x71ab[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var auth=require(_0xb71a('0x3'));var interaction=require(_0xb71a('0x4'));var config=require(_0xb71a('0x5'));var controller=require(_0xb71a('0x6'));router[_0xb71a('0x7')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0x9')]);router[_0xb71a('0x7')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xb')]);router[_0xb71a('0x7')](_0xb71a('0xc'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xd')]);router[_0xb71a('0x7')](_0xb71a('0xe'),auth['isAuthenticated'](),controller[_0xb71a('0xf')]);router['post']('/',auth[_0xb71a('0x8')](),interaction[_0xb71a('0x10')](_0xb71a('0x11'),'mailmessage:create'),controller[_0xb71a('0x12')]);router['put'](_0xb71a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xb71a('0x13')](_0xb71a('0x14'),auth[_0xb71a('0x8')](),controller[_0xb71a('0x15')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xb71a('0x16')]);router[_0xb71a('0x17')](_0xb71a('0xc'),auth[_0xb71a('0x8')](),controller[_0xb71a('0x18')]);module[_0xb71a('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js
index 6e4e352..5abb880 100644
--- a/server/api/mailMessage/mailMessage.attributes.js
+++ b/server/api/mailMessage/mailMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6988=['TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','sequelize','lodash','exports'];(function(_0x4e6993,_0x5a8f22){var _0x2ab2a3=function(_0x2bc5cc){while(--_0x2bc5cc){_0x4e6993['push'](_0x4e6993['shift']());}};_0x2ab2a3(++_0x5a8f22);}(_0x6988,0x81));var _0x8698=function(_0xbc59d6,_0xbbf474){_0xbc59d6=_0xbc59d6-0x0;var _0x490ebe=_0x6988[_0xbc59d6];return _0x490ebe;};'use strict';var Sequelize=require(_0x8698('0x0'));var _=require(_0x8698('0x1'));module[_0x8698('0x2')]={'body':{'type':Sequelize[_0x8698('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8698('0x4'))},'read':{'type':Sequelize[_0x8698('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8698('0x6')]('in',_0x8698('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x8698('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x8698('0x3')](_0x8698('0x9'))},'cc':{'type':Sequelize[_0x8698('0x3')](_0x8698('0x9'))},'bcc':{'type':Sequelize[_0x8698('0x3')](_0x8698('0x9'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x8698('0xa')]},'attach':{'type':Sequelize[_0x8698('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8698('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8698('0xa')]},'originTo':{'type':Sequelize[_0x8698('0x3')](_0x8698('0x9'))},'originCc':{'type':Sequelize['TEXT'](_0x8698('0x9'))}};
\ No newline at end of file
+var _0xa83a=['out','STRING','DATE','INTEGER','lodash','exports','long','TEXT','medium','BOOLEAN','ENUM'];(function(_0x59e522,_0x28219a){var _0x5ca8cd=function(_0x3c963e){while(--_0x3c963e){_0x59e522['push'](_0x59e522['shift']());}};_0x5ca8cd(++_0x28219a);}(_0xa83a,0x88));var _0xaa83=function(_0x22ad1a,_0x1bab4b){_0x22ad1a=_0x22ad1a-0x0;var _0x473372=_0xa83a[_0x22ad1a];return _0x473372;};'use strict';var Sequelize=require('sequelize');var _=require(_0xaa83('0x0'));module[_0xaa83('0x1')]={'body':{'type':Sequelize['TEXT'](_0xaa83('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xaa83('0x3')](_0xaa83('0x4'))},'read':{'type':Sequelize[_0xaa83('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa83('0x6')]('in','out'),'defaultValue':_0xaa83('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xaa83('0x8')](0x1fe)},'from':{'type':Sequelize[_0xaa83('0x8')]},'to':{'type':Sequelize[_0xaa83('0x3')](_0xaa83('0x2'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize['TEXT'](_0xaa83('0x2'))},'subject':{'type':Sequelize[_0xaa83('0x3')]},'sentAt':{'type':Sequelize[_0xaa83('0x9')]},'attach':{'type':Sequelize[_0xaa83('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xaa83('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xaa83('0x9')]},'originTo':{'type':Sequelize[_0xaa83('0x3')](_0xaa83('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0xaa83('0x2'))}};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js
index d91d1e1..642f726 100644
--- a/server/api/mailMessage/mailMessage.controller.js
+++ b/server/api/mailMessage/mailMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1708=['body','params','create','direction','out','MailAccount','Smtp','isNil','service','host','port','authentication','auth','user','pass','secure','attachments','server/files/attachments','basename','SendMail','format','accept','mail','read','UserId','CmContact','Contact','get','MailInteractionId','YYYY-MM-DD\x20HH:mm:ss','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','interface','channel','event','EventManager','acceptmessage','mail-interactions','MailInteraction','RejectMessage','rejectMessage','SIP/%s','rejectmessage','download','unix','toString','join','root','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','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','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','send','index','model','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','key','options','includeAll','include','MailMessage','findAll','rows','catch','show','keys','rawAttributes','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1708,0xe9));var _0x8170=function(_0x1a3eb1,_0x5188d5){_0x1a3eb1=_0x1a3eb1-0x0;var _0x29efec=_0x1708[_0x1a3eb1];return _0x29efec;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8170('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8170('0x1'));var jsonpatch=require(_0x8170('0x2'));var rp=require(_0x8170('0x3'));var moment=require('moment');var BPromise=require(_0x8170('0x4'));var Mustache=require('mustache');var util=require(_0x8170('0x5'));var path=require(_0x8170('0x6'));var sox=require(_0x8170('0x7'));var csv=require(_0x8170('0x8'));var ejs=require(_0x8170('0x9'));var fs=require('fs');var _=require(_0x8170('0xa'));var squel=require(_0x8170('0xb'));var crypto=require(_0x8170('0xc'));var jsforce=require(_0x8170('0xd'));var deskjs=require(_0x8170('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8170('0xf'));var Papa=require(_0x8170('0x10'));var Redis=require(_0x8170('0x11'));var authService=require(_0x8170('0x12'));var qs=require(_0x8170('0x13'));var hardwareService=require(_0x8170('0x14'));var logger=require(_0x8170('0x15'))('api');var utils=require(_0x8170('0x16'));var config=require(_0x8170('0x17'));var db=require(_0x8170('0x18'))['db'];config['redis']=_[_0x8170('0x19')](config[_0x8170('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x8170('0x1b'))(new Redis(config[_0x8170('0x1a')]));require(_0x8170('0x1c'))['register'](socket);var jayson=require(_0x8170('0x1d'));var client=jayson[_0x8170('0x1e')][_0x8170('0x1f')]({'port':0x232c});var client9003=jayson[_0x8170('0x1e')][_0x8170('0x1f')]({'port':0x232b});var client9002=jayson['client'][_0x8170('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x272816,_0x23341a,_0x326049){if(_0x326049){var _0x1c64d9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c64d9['test'](_0x23341a)){return _0x272816;}else{throw new Error(_0x8170('0x20'));}}else{return _0x272816;}}function respondWithRpcPromise(_0x2a7bb5,_0x3085fd,_0x2a57ec,_0x21328a){return new BPromise(function(_0x25d87e,_0x5f05ce){var _0x1bbc64=_0x21328a||client;return _0x1bbc64[_0x8170('0x21')](_0x2a7bb5,_0x2a57ec)[_0x8170('0x22')](function(_0x4d1e87){logger[_0x8170('0x23')]('MailMessage,\x20%s,\x20%s',_0x3085fd,_0x8170('0x24'));logger[_0x8170('0x25')](_0x8170('0x26'),_0x3085fd,'request\x20sent',JSON[_0x8170('0x27')](_0x4d1e87));if(_0x4d1e87['error']){if(_0x4d1e87[_0x8170('0x28')][_0x8170('0x29')]===0x1f4){logger[_0x8170('0x28')]('MailMessage,\x20%s,\x20%s',_0x3085fd,_0x4d1e87['error']['message']);return _0x5f05ce(_0x4d1e87[_0x8170('0x28')][_0x8170('0x2a')]);}logger[_0x8170('0x28')](_0x8170('0x2b'),_0x3085fd,_0x4d1e87[_0x8170('0x28')][_0x8170('0x2a')]);return _0x25d87e(_0x4d1e87['error'][_0x8170('0x2a')]);}else{logger[_0x8170('0x23')](_0x8170('0x2b'),_0x3085fd,_0x8170('0x24'));_0x25d87e(_0x4d1e87['result'][_0x8170('0x2a')]);}})['catch'](function(_0x4697b6){logger[_0x8170('0x28')](_0x8170('0x2b'),_0x3085fd,_0x4697b6);_0x5f05ce(_0x4697b6);});});}function respondWithStatusCode(_0x70e25,_0x982ff0){_0x982ff0=_0x982ff0||0xcc;return function(_0x3576e9){if(_0x3576e9){return _0x70e25['sendStatus'](_0x982ff0);}return _0x70e25['status'](_0x982ff0)[_0x8170('0x2c')]();};}function respondWithResult(_0x51008f,_0x5ccd2e){_0x5ccd2e=_0x5ccd2e||0xc8;return function(_0x3e5b33){if(_0x3e5b33){return _0x51008f[_0x8170('0x2d')](_0x5ccd2e)[_0x8170('0x2e')](_0x3e5b33);}};}function respondWithFilteredResult(_0xb2b9da,_0x2fbe59){return function(_0x2139d9){if(_0x2139d9){var _0x139898=_0x2139d9[_0x8170('0x2f')],_0xe86e74=_0x2fbe59[_0x8170('0x30')],_0x37162d=_0x2fbe59[_0x8170('0x30')]+_0x2fbe59['limit'],_0x3e3ec4;if(_0x37162d>=_0x139898){_0x37162d=_0x139898;_0x3e3ec4=0xc8;}else{_0x3e3ec4=0xce;}_0xb2b9da[_0x8170('0x2d')](_0x3e3ec4);return _0xb2b9da[_0x8170('0x31')](_0x8170('0x32'),_0xe86e74+'-'+_0x37162d+'/'+_0x139898)[_0x8170('0x2e')](_0x2139d9);}return null;};}function patchUpdates(_0x5b7c4e){return function(_0x28f375){try{jsonpatch[_0x8170('0x33')](_0x28f375,_0x5b7c4e,!![]);}catch(_0x25f4b){return BPromise[_0x8170('0x34')](_0x25f4b);}return _0x28f375[_0x8170('0x35')]();};}function saveUpdates(_0x50b93d,_0x513376){return function(_0xd5ed9){if(_0xd5ed9){return _0xd5ed9[_0x8170('0x36')](_0x50b93d)['then'](function(_0x11ca35){return _0x11ca35;});}return null;};}function removeEntity(_0x2fbd25,_0x166fe5){return function(_0x50c9ea){if(_0x50c9ea){return _0x50c9ea[_0x8170('0x37')]()[_0x8170('0x22')](function(){_0x2fbd25['status'](0xcc)[_0x8170('0x2c')]();});}};}function handleEntityNotFound(_0x4b02ba,_0x5733e7){return function(_0x46c1d3){if(!_0x46c1d3){_0x4b02ba['sendStatus'](0x194);}return _0x46c1d3;};}function handleError(_0x35c63d,_0x68ea3e){_0x68ea3e=_0x68ea3e||0x1f4;return function(_0xf476a0){logger[_0x8170('0x28')](_0xf476a0['stack']);if(_0xf476a0[_0x8170('0x38')]){delete _0xf476a0[_0x8170('0x38')];}_0x35c63d['status'](_0x68ea3e)[_0x8170('0x39')](_0xf476a0);};}exports[_0x8170('0x3a')]=function(_0x364f2c,_0x36c638){var _0x4635a2={},_0xb1fbdf={},_0x31c315={'count':0x0,'rows':[]};var _0x2ebdc5=db['MailMessage']['rawAttributes'];_0xb1fbdf[_0x8170('0x3b')]=_['keys'](_0x2ebdc5);_0xb1fbdf[_0x8170('0x3c')]=_['keys'](_0x364f2c['query']);_0xb1fbdf['filters']=_[_0x8170('0x3d')](_0xb1fbdf[_0x8170('0x3b')],_0xb1fbdf[_0x8170('0x3c')]);_0x4635a2[_0x8170('0x3e')]=_[_0x8170('0x3d')](_0xb1fbdf[_0x8170('0x3b')],qs[_0x8170('0x3f')](_0x364f2c[_0x8170('0x3c')]['fields']));_0x4635a2[_0x8170('0x3e')]=_0x4635a2['attributes'][_0x8170('0x40')]?_0x4635a2[_0x8170('0x3e')]:_0xb1fbdf['model'];if(!_0x364f2c[_0x8170('0x3c')][_0x8170('0x41')]('nolimit')){_0x4635a2[_0x8170('0x42')]=qs['limit'](_0x364f2c['query'][_0x8170('0x42')]);_0x4635a2['offset']=qs[_0x8170('0x30')](_0x364f2c['query'][_0x8170('0x30')]);}_0x4635a2[_0x8170('0x43')]=qs[_0x8170('0x44')](_0x364f2c[_0x8170('0x3c')]['sort']);_0x4635a2[_0x8170('0x45')]=qs[_0x8170('0x46')](_[_0x8170('0x47')](_0x364f2c['query'],_0xb1fbdf[_0x8170('0x46')]));if(_0x364f2c[_0x8170('0x3c')][_0x8170('0x48')]){_0x4635a2['where']=_[_0x8170('0x49')](_0x4635a2[_0x8170('0x45')],{'$or':_[_0x8170('0x4a')](_0x2ebdc5,function(_0x4a7291){if(_0x4a7291['type'][_0x8170('0x4b')]!=='VIRTUAL'){var _0x5a1a31={};_0x5a1a31[_0x4a7291['field']]={'$like':'%'+_0x364f2c[_0x8170('0x3c')]['filter']+'%'};return _0x5a1a31;}})});}_0x4635a2=_[_0x8170('0x49')]({},_0x4635a2,_0x364f2c[_0x8170('0x4c')]);var _0x273e04={'where':_0x4635a2[_0x8170('0x45')]};return db['MailMessage']['count'](_0x273e04)[_0x8170('0x22')](function(_0x543759){_0x31c315[_0x8170('0x2f')]=_0x543759;if(_0x364f2c[_0x8170('0x3c')][_0x8170('0x4d')]){_0x4635a2[_0x8170('0x4e')]=[{'all':!![]}];}return db[_0x8170('0x4f')][_0x8170('0x50')](_0x4635a2);})[_0x8170('0x22')](function(_0x4d2ea3){_0x31c315[_0x8170('0x51')]=_0x4d2ea3;return _0x31c315;})[_0x8170('0x22')](respondWithFilteredResult(_0x36c638,_0x4635a2))[_0x8170('0x52')](handleError(_0x36c638,null));};exports[_0x8170('0x53')]=function(_0x5369c7,_0x12bd49){var _0x37b7bc={'raw':!![],'where':{'id':_0x5369c7['params']['id']}},_0x3edf82={};_0x3edf82[_0x8170('0x3b')]=_[_0x8170('0x54')](db[_0x8170('0x4f')][_0x8170('0x55')]);_0x3edf82[_0x8170('0x3c')]=_['keys'](_0x5369c7[_0x8170('0x3c')]);_0x3edf82['filters']=_[_0x8170('0x3d')](_0x3edf82[_0x8170('0x3b')],_0x3edf82['query']);_0x37b7bc[_0x8170('0x3e')]=_[_0x8170('0x3d')](_0x3edf82['model'],qs[_0x8170('0x3f')](_0x5369c7['query'][_0x8170('0x3f')]));_0x37b7bc[_0x8170('0x3e')]=_0x37b7bc[_0x8170('0x3e')][_0x8170('0x40')]?_0x37b7bc[_0x8170('0x3e')]:_0x3edf82[_0x8170('0x3b')];if(_0x5369c7[_0x8170('0x3c')][_0x8170('0x4d')]){_0x37b7bc[_0x8170('0x4e')]=[{'all':!![]}];}_0x37b7bc=_[_0x8170('0x49')]({},_0x37b7bc,_0x5369c7['options']);return db['MailMessage'][_0x8170('0x56')](_0x37b7bc)[_0x8170('0x22')](handleEntityNotFound(_0x12bd49,null))[_0x8170('0x22')](respondWithResult(_0x12bd49,null))['catch'](handleError(_0x12bd49,null));};exports[_0x8170('0x36')]=function(_0x2d0e17,_0x1df1bf){if(_0x2d0e17[_0x8170('0x57')]['id']){delete _0x2d0e17[_0x8170('0x57')]['id'];}return db['MailMessage'][_0x8170('0x56')]({'where':{'id':_0x2d0e17[_0x8170('0x58')]['id']}})[_0x8170('0x22')](handleEntityNotFound(_0x1df1bf,null))[_0x8170('0x22')](saveUpdates(_0x2d0e17[_0x8170('0x57')],null))['then'](respondWithResult(_0x1df1bf,null))['catch'](handleError(_0x1df1bf,null));};exports[_0x8170('0x37')]=function(_0x4ab83b,_0x52affb){return db[_0x8170('0x4f')][_0x8170('0x56')]({'where':{'id':_0x4ab83b['params']['id']}})[_0x8170('0x22')](handleEntityNotFound(_0x52affb,null))[_0x8170('0x22')](removeEntity(_0x52affb,null))[_0x8170('0x52')](handleError(_0x52affb,null));};exports['describe']=function(_0x5f07b0,_0x2b7f28){return db[_0x8170('0x4f')]['describe']()['then'](respondWithResult(_0x2b7f28,null))[_0x8170('0x52')](handleError(_0x2b7f28,null));};exports[_0x8170('0x59')]=function(_0x2e1962,_0x3f28fe){return db[_0x8170('0x4f')]['create'](_0x2e1962[_0x8170('0x57')])[_0x8170('0x22')](function(_0x59af1f){if(_0x59af1f){if(_0x59af1f[_0x8170('0x5a')]===_0x8170('0x5b')&&!_0x59af1f['secret']){return db[_0x8170('0x5c')]['findOne']({'where':{'id':_0x59af1f['MailAccountId']},'include':[{'model':db['MailServerOut'],'as':_0x8170('0x5d'),'raw':!![]}]})['then'](function(_0x53e086){if(_0x53e086&&_0x53e086[_0x8170('0x5d')]){var _0x4a1c34={'tls':{'rejectUnauthorized':![]}};if(_[_0x8170('0x5e')](_0x53e086[_0x8170('0x5d')][_0x8170('0x5f')])){_0x4a1c34[_0x8170('0x60')]=_0x53e086[_0x8170('0x5d')]['host'];_0x4a1c34[_0x8170('0x61')]=_0x53e086[_0x8170('0x5d')]['port'];_0x4a1c34['secure']=_0x53e086[_0x8170('0x5d')]['secure'];if(_0x53e086['Smtp'][_0x8170('0x62')]){_0x4a1c34[_0x8170('0x63')]={'user':_0x53e086[_0x8170('0x5d')][_0x8170('0x64')],'pass':_0x53e086[_0x8170('0x5d')][_0x8170('0x65')]};}}else{_0x4a1c34['service']=_0x53e086[_0x8170('0x5d')][_0x8170('0x5f')];_0x4a1c34['auth']={'user':_0x53e086['Smtp'][_0x8170('0x64')],'pass':_0x53e086['Smtp']['pass']};_0x4a1c34[_0x8170('0x66')]=_0x53e086[_0x8170('0x5d')][_0x8170('0x66')];}if(_0x2e1962[_0x8170('0x57')][_0x8170('0x67')]&&_0x2e1962[_0x8170('0x57')][_0x8170('0x67')]['length']){for(var _0x11d29a=0x0;_0x11d29a<_0x2e1962[_0x8170('0x57')][_0x8170('0x67')][_0x8170('0x40')];_0x11d29a+=0x1){_0x2e1962[_0x8170('0x57')][_0x8170('0x67')][_0x11d29a]={'filename':_0x2e1962[_0x8170('0x57')][_0x8170('0x67')][_0x11d29a][_0x8170('0x38')],'path':path['join'](config['root'],_0x8170('0x68'),_0x2e1962[_0x8170('0x57')][_0x8170('0x67')][_0x11d29a][_0x8170('0x69')])};}}return{'account':_0x4a1c34,'message':_0x2e1962[_0x8170('0x57')]};}})[_0x8170('0x22')](function(_0x31fdb5){if(_0x31fdb5){return respondWithRpcPromise(_0x8170('0x6a'),'sendMail',_0x31fdb5,client9003)[_0x8170('0x22')](function(_0x158801){return _0x59af1f['update']({'read':!![],'messageId':_0x158801['messageId'],'sentAt':moment()[_0x8170('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x8170('0x52')](function(_0x59b361){logger['error']('%s',JSON[_0x8170('0x27')](_0x59b361));return _0x59af1f;});}return _0x59af1f;});}return _0x59af1f;}})[_0x8170('0x22')](respondWithResult(_0x3f28fe,0xc9))[_0x8170('0x52')](handleError(_0x3f28fe,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0x8170('0x6c')]=function(_0x59fe32,_0x5c6897,_0x3986af){var _0x54020e={'channel':_0x8170('0x6d')};if(_0x59fe32[_0x8170('0x57')]['id']){delete _0x59fe32['body']['id'];}_0x59fe32[_0x8170('0x57')][_0x8170('0x6e')]=!![];_0x59fe32['body']['readAt']=moment()[_0x8170('0x6b')]('YYYY-MM-DD\x20HH:mm:ss');_0x59fe32[_0x8170('0x57')][_0x8170('0x6f')]=_0x59fe32[_0x8170('0x57')]['UserId']||_0x59fe32['user']['id'];return db[_0x8170('0x4f')][_0x8170('0x56')]({'where':{'id':_0x59fe32[_0x8170('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x8170('0x70')],'as':_0x8170('0x71')}]})[_0x8170('0x22')](handleEntityNotFound(_0x5c6897,null))[_0x8170('0x22')](saveUpdates(_0x59fe32[_0x8170('0x57')],null))[_0x8170('0x22')](function(_0x5a1f48){if(_0x5a1f48){_0x54020e[_0x8170('0x2a')]=_0x5a1f48[_0x8170('0x72')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x5a1f48[_0x8170('0x73')]}});}return null;})[_0x8170('0x22')](handleEntityNotFound(_0x5c6897,null))['then'](function(_0x5e64ed){if(_0x5e64ed){return _0x5e64ed[_0x8170('0x36')]({'UserId':_0x59fe32[_0x8170('0x57')][_0x8170('0x6f')],'read1stAt':_[_0x8170('0x5e')](_0x5e64ed['read1stAt'])?moment()[_0x8170('0x6b')](_0x8170('0x74')):undefined});}return null;})[_0x8170('0x22')](function(_0x4ae644){if(_0x4ae644){_0x54020e[_0x8170('0x75')]=_0x4ae644[_0x8170('0x72')]({'plain':!![]});interaction_log['info'](_0x8170('0x76'),_0x59fe32[_0x8170('0x64')]['id'],_0x59fe32[_0x8170('0x64')]['name'],_0x59fe32[_0x8170('0x64')][_0x8170('0x77')],_0x54020e[_0x8170('0x75')]['id'],_0x59fe32[_0x8170('0x57')]?JSON[_0x8170('0x27')](_0x59fe32[_0x8170('0x57')]):_0x8170('0x78'));return respondWithRpcPromise(_0x8170('0x79'),_0x8170('0x7a'),_0x54020e);}return null;})['then'](function(_0x19e374){if(_0x19e374){if(_0x59fe32[_0x8170('0x57')]['manual']){_0x54020e[_0x8170('0x2a')][_0x8170('0x7b')]=util['format']('SIP/%s',_0x59fe32[_0x8170('0x64')][_0x8170('0x38')]);_0x54020e[_0x8170('0x2a')][_0x8170('0x7c')]=_0x54020e['channel'];_0x54020e[_0x8170('0x2a')][_0x8170('0x7d')]=_0x8170('0x6c');return respondWithRpcPromise(_0x8170('0x7e'),_0x8170('0x7e'),{'event':_0x8170('0x7f'),'message':_0x54020e[_0x8170('0x2a')]},client9002)[_0x8170('0x22')](function(){return _0x54020e;});}return _0x54020e;}return null;})['then'](respondWithResult(_0x5c6897,null))[_0x8170('0x52')](handleError(_0x5c6897,null));};var interaction_log=require(_0x8170('0x15'))(_0x8170('0x80'));exports[_0x8170('0x34')]=function(_0x1df5ea,_0x50d2db,_0x45a52b){var _0xe1bd1c={'agent':{},'channel':'mail'};if(_0x1df5ea['body']['id']){delete _0x1df5ea[_0x8170('0x57')]['id'];}_0x1df5ea['body'][_0x8170('0x6f')]=_0x1df5ea[_0x8170('0x57')][_0x8170('0x6f')]||_0x1df5ea['user']['id'];_0xe1bd1c['agent']['id']=_0x1df5ea[_0x8170('0x57')][_0x8170('0x6f')];return db[_0x8170('0x4f')][_0x8170('0x56')]({'where':{'id':_0x1df5ea[_0x8170('0x58')]['id'],'UserId':null}})[_0x8170('0x22')](handleEntityNotFound(_0x50d2db,null))['then'](function(_0x5d2d20){if(_0x5d2d20){_0xe1bd1c[_0x8170('0x2a')]=_0x5d2d20[_0x8170('0x72')]({'plain':!![]});return db[_0x8170('0x81')][_0x8170('0x56')]({'where':{'id':_0x5d2d20['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x50d2db,null))[_0x8170('0x22')](function(_0xc4d171){if(_0xc4d171){_0xe1bd1c[_0x8170('0x75')]=_0xc4d171[_0x8170('0x72')]({'plain':!![]});interaction_log[_0x8170('0x23')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1df5ea['user']['id'],_0x1df5ea[_0x8170('0x64')]['name'],_0x1df5ea[_0x8170('0x64')][_0x8170('0x77')],_0xe1bd1c['interaction']['id'],_0x1df5ea[_0x8170('0x57')]?JSON[_0x8170('0x27')](_0x1df5ea[_0x8170('0x57')]):_0x8170('0x78'));return respondWithRpcPromise(_0x8170('0x82'),_0x8170('0x83'),_0xe1bd1c);}return null;})['then'](function(_0x3a2a3f){if(_0x3a2a3f){_0x3a2a3f[_0x8170('0x2a')]['interface']=util[_0x8170('0x6b')](_0x8170('0x84'),_0x1df5ea[_0x8170('0x64')][_0x8170('0x38')]);_0x3a2a3f[_0x8170('0x2a')][_0x8170('0x7c')]=_0xe1bd1c['channel'];_0x3a2a3f[_0x8170('0x2a')][_0x8170('0x7d')]=_0x8170('0x34');respondWithRpcPromise(_0x8170('0x7e'),'EventManager',{'event':_0x8170('0x85'),'message':_0x3a2a3f['message']},client9002);return _0xe1bd1c;}return null;})[_0x8170('0x22')](respondWithResult(_0x50d2db,null))['catch'](handleError(_0x50d2db,null));};exports[_0x8170('0x86')]=function(_0xbb855b,_0x45d829){var _0x5a76c4=moment()[_0x8170('0x87')]()[_0x8170('0x88')]();var _0x1fbefa=path[_0x8170('0x89')](config[_0x8170('0x8a')],_0x8170('0x8b'),_0x8170('0x8c'),_0x8170('0x8d'));var _0x51dcc1=path['join'](config[_0x8170('0x8a')],'server','files',_0x8170('0x67'));var _0x160dc3=util[_0x8170('0x6b')](_0x8170('0x8e'),_0x5a76c4);return db[_0x8170('0x4f')][_0x8170('0x56')]({'where':{'id':_0xbb855b[_0x8170('0x58')]['id']},'attributes':['id',_0x8170('0x57'),_0x8170('0x8f'),'to','cc',_0x8170('0x90'),_0x8170('0x91'),'createdAt'],'include':_0xbb855b[_0x8170('0x3c')][_0x8170('0x67')]?[{'model':db[_0x8170('0x92')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x45d829,null))[_0x8170('0x22')](function(_0x275b21){if(_0x275b21){var _0x290429=_0x275b21;var _0x14923b={'from':_0x290429[_0x8170('0x8f')],'to':_0x290429['to'],'subject':_0x290429[_0x8170('0x91')],'html':_0x290429[_0x8170('0x57')],'headers':{'Date':moment(_0x290429[_0x8170('0x93')])[_0x8170('0x6b')](_0x8170('0x94'))},'attachments':[]};if(_0x275b21['cc']){_0x14923b[_0x8170('0x95')]['Cc']=_0x275b21['cc'];}if(_0x275b21['bcc']){_0x14923b[_0x8170('0x95')][_0x8170('0x96')]=_0x275b21['bcc'];}return new BPromise(function(_0x4997d1,_0x2bdeb1){if(_0x275b21[_0x8170('0x97')]){for(var _0x129bdc=0x0;_0x129bdc<_0x275b21['Attachments'][_0x8170('0x40')];_0x129bdc++){var _0x5d3739=_0x275b21[_0x8170('0x97')][_0x129bdc];var _0x35895b=path['join'](_0x51dcc1,_0x5d3739[_0x8170('0x69')]);if(fs[_0x8170('0x98')](_0x35895b)){_0x14923b['attachments'][_0x8170('0x99')]({'name':_0x5d3739[_0x8170('0x38')],'contentType':_0x5d3739['type'],'data':fs[_0x8170('0x9a')](_0x35895b)});}}}emlformat[_0x8170('0x9b')](_0x14923b,function(_0xd2b5da,_0x5416ad){if(_0xd2b5da)return _0x2bdeb1(_0xd2b5da);fs[_0x8170('0x9c')](path['join'](_0x1fbefa,_0x160dc3),_0x5416ad);return _0x4997d1(_0x5416ad);});});}})['then'](function(_0x4f64b8){if(_0x4f64b8){return _0x45d829[_0x8170('0x86')](path['join'](_0x1fbefa,_0x160dc3),_0x160dc3,function(_0x42ac18){if(_0x42ac18){console[_0x8170('0x9d')](_0x8170('0x9e'),_0x42ac18);}else{fs[_0x8170('0x9f')](path[_0x8170('0x89')](_0x1fbefa,_0x160dc3));}});}})['catch'](handleError(_0x45d829,null));};
\ No newline at end of file
+var _0xbade=['status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','sendStatus','stack','name','send','index','MailMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','field','options','include','findAll','params','includeAll','body','find','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','auth','pass','user','attachments','join','basename','SendMail','sendMail','stringify','mail-interactions','accept','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','format','event','rejectmessage','download','toString','server','files','root','message-%s.eml','subject','createdAt','Attachment','headers','bcc','Attachments','existsSync','type','readFileSync','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','info','request\x20sent','result','catch'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xbade,0x70));var _0xebad=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xbade[_0x2c0dc0];return _0x4c0990;};'use strict';var pdf=require(_0xebad('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xebad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebad('0x2'));var rp=require('request-promise');var moment=require(_0xebad('0x3'));var BPromise=require(_0xebad('0x4'));var Mustache=require(_0xebad('0x5'));var util=require(_0xebad('0x6'));var path=require('path');var sox=require(_0xebad('0x7'));var csv=require(_0xebad('0x8'));var ejs=require(_0xebad('0x9'));var fs=require('fs');var _=require(_0xebad('0xa'));var squel=require(_0xebad('0xb'));var crypto=require(_0xebad('0xc'));var jsforce=require(_0xebad('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xebad('0xe'));var Papa=require(_0xebad('0xf'));var Redis=require(_0xebad('0x10'));var authService=require(_0xebad('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xebad('0x12'));var logger=require(_0xebad('0x13'))(_0xebad('0x14'));var utils=require(_0xebad('0x15'));var config=require(_0xebad('0x16'));var db=require(_0xebad('0x17'))['db'];config[_0xebad('0x18')]=_['defaults'](config[_0xebad('0x18')],{'host':_0xebad('0x19'),'port':0x18eb});var socket=require(_0xebad('0x1a'))(new Redis(config[_0xebad('0x18')]));require(_0xebad('0x1b'))[_0xebad('0x1c')](socket);var jayson=require(_0xebad('0x1d'));var client=jayson[_0xebad('0x1e')]['http']({'port':0x232c});var client9003=jayson[_0xebad('0x1e')][_0xebad('0x1f')]({'port':0x232b});var client9002=jayson['client'][_0xebad('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x23cb82,_0x3124bc,_0x1e2563){if(_0x1e2563){var _0x5575c8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5575c8[_0xebad('0x20')](_0x3124bc)){return _0x23cb82;}else{throw new Error(_0xebad('0x21'));}}else{return _0x23cb82;}}function respondWithRpcPromise(_0x9bb98f,_0x5e2866,_0x5a14e8,_0x23e747){return new BPromise(function(_0x457bfd,_0x9c5c95){var _0x516e61=_0x23e747||client;return _0x516e61[_0xebad('0x22')](_0x9bb98f,_0x5a14e8)[_0xebad('0x23')](function(_0x3fc180){logger['info']('MailMessage,\x20%s,\x20%s',_0x5e2866,'request\x20sent');logger['debug'](_0xebad('0x24'),_0x5e2866,'request\x20sent',JSON['stringify'](_0x3fc180));if(_0x3fc180[_0xebad('0x25')]){if(_0x3fc180['error'][_0xebad('0x26')]===0x1f4){logger['error'](_0xebad('0x27'),_0x5e2866,_0x3fc180[_0xebad('0x25')][_0xebad('0x28')]);return _0x9c5c95(_0x3fc180['error']['message']);}logger[_0xebad('0x25')](_0xebad('0x27'),_0x5e2866,_0x3fc180['error']['message']);return _0x457bfd(_0x3fc180[_0xebad('0x25')]['message']);}else{logger[_0xebad('0x29')](_0xebad('0x27'),_0x5e2866,_0xebad('0x2a'));_0x457bfd(_0x3fc180[_0xebad('0x2b')][_0xebad('0x28')]);}})[_0xebad('0x2c')](function(_0x226fd1){logger[_0xebad('0x25')](_0xebad('0x27'),_0x5e2866,_0x226fd1);_0x9c5c95(_0x226fd1);});});}function respondWithStatusCode(_0x29832a,_0x2fd774){_0x2fd774=_0x2fd774||0xcc;return function(_0x157e1b){if(_0x157e1b){return _0x29832a['sendStatus'](_0x2fd774);}return _0x29832a[_0xebad('0x2d')](_0x2fd774)[_0xebad('0x2e')]();};}function respondWithResult(_0x8f03b5,_0x496f48){_0x496f48=_0x496f48||0xc8;return function(_0x167bf3){if(_0x167bf3){return _0x8f03b5['status'](_0x496f48)[_0xebad('0x2f')](_0x167bf3);}};}function respondWithFilteredResult(_0x419dcc,_0x4a8b6e){return function(_0x3108b8){if(_0x3108b8){var _0x3431fc=_0x3108b8[_0xebad('0x30')],_0x2e278c=_0x4a8b6e[_0xebad('0x31')],_0x54a3b1=_0x4a8b6e[_0xebad('0x31')]+_0x4a8b6e[_0xebad('0x32')],_0x3f77e7;if(_0x54a3b1>=_0x3431fc){_0x54a3b1=_0x3431fc;_0x3f77e7=0xc8;}else{_0x3f77e7=0xce;}_0x419dcc[_0xebad('0x2d')](_0x3f77e7);return _0x419dcc[_0xebad('0x33')](_0xebad('0x34'),_0x2e278c+'-'+_0x54a3b1+'/'+_0x3431fc)[_0xebad('0x2f')](_0x3108b8);}return null;};}function patchUpdates(_0x435a31){return function(_0x206e63){try{jsonpatch['apply'](_0x206e63,_0x435a31,!![]);}catch(_0x43ca1a){return BPromise[_0xebad('0x35')](_0x43ca1a);}return _0x206e63['save']();};}function saveUpdates(_0x481462,_0x59e145){return function(_0x49a8e9){if(_0x49a8e9){return _0x49a8e9[_0xebad('0x36')](_0x481462)['then'](function(_0xb6c326){return _0xb6c326;});}return null;};}function removeEntity(_0x335abd,_0xacc7e7){return function(_0x26970f){if(_0x26970f){return _0x26970f[_0xebad('0x37')]()[_0xebad('0x23')](function(){_0x335abd[_0xebad('0x2d')](0xcc)[_0xebad('0x2e')]();});}};}function handleEntityNotFound(_0x2e7732,_0x1339d0){return function(_0x2364f4){if(!_0x2364f4){_0x2e7732[_0xebad('0x38')](0x194);}return _0x2364f4;};}function handleError(_0x68fa21,_0xa01441){_0xa01441=_0xa01441||0x1f4;return function(_0x49e8db){logger['error'](_0x49e8db[_0xebad('0x39')]);if(_0x49e8db[_0xebad('0x3a')]){delete _0x49e8db[_0xebad('0x3a')];}_0x68fa21[_0xebad('0x2d')](_0xa01441)[_0xebad('0x3b')](_0x49e8db);};}exports[_0xebad('0x3c')]=function(_0x2addac,_0x574718){var _0x266a5d={},_0x262756={},_0x19c0e0={'count':0x0,'rows':[]};var _0x3f0298=db[_0xebad('0x3d')][_0xebad('0x3e')];_0x262756[_0xebad('0x3f')]=_[_0xebad('0x40')](_0x3f0298);_0x262756[_0xebad('0x41')]=_['keys'](_0x2addac[_0xebad('0x41')]);_0x262756[_0xebad('0x42')]=_[_0xebad('0x43')](_0x262756['model'],_0x262756['query']);_0x266a5d['attributes']=_['intersection'](_0x262756[_0xebad('0x3f')],qs['fields'](_0x2addac[_0xebad('0x41')][_0xebad('0x44')]));_0x266a5d['attributes']=_0x266a5d[_0xebad('0x45')][_0xebad('0x46')]?_0x266a5d[_0xebad('0x45')]:_0x262756['model'];if(!_0x2addac['query'][_0xebad('0x47')](_0xebad('0x48'))){_0x266a5d[_0xebad('0x32')]=qs[_0xebad('0x32')](_0x2addac['query'][_0xebad('0x32')]);_0x266a5d[_0xebad('0x31')]=qs[_0xebad('0x31')](_0x2addac[_0xebad('0x41')][_0xebad('0x31')]);}_0x266a5d[_0xebad('0x49')]=qs['sort'](_0x2addac[_0xebad('0x41')][_0xebad('0x4a')]);_0x266a5d[_0xebad('0x4b')]=qs[_0xebad('0x42')](_['pick'](_0x2addac[_0xebad('0x41')],_0x262756['filters']));if(_0x2addac[_0xebad('0x41')][_0xebad('0x4c')]){_0x266a5d['where']=_[_0xebad('0x4d')](_0x266a5d[_0xebad('0x4b')],{'$or':_[_0xebad('0x4e')](_0x3f0298,function(_0x4b05ab){if(_0x4b05ab['type']['key']!==_0xebad('0x4f')){var _0xb83732={};_0xb83732[_0x4b05ab[_0xebad('0x50')]]={'$like':'%'+_0x2addac['query'][_0xebad('0x4c')]+'%'};return _0xb83732;}})});}_0x266a5d=_[_0xebad('0x4d')]({},_0x266a5d,_0x2addac[_0xebad('0x51')]);var _0x302f42={'where':_0x266a5d[_0xebad('0x4b')]};return db[_0xebad('0x3d')][_0xebad('0x30')](_0x302f42)[_0xebad('0x23')](function(_0x8b4101){_0x19c0e0[_0xebad('0x30')]=_0x8b4101;if(_0x2addac['query']['includeAll']){_0x266a5d[_0xebad('0x52')]=[{'all':!![]}];}return db[_0xebad('0x3d')][_0xebad('0x53')](_0x266a5d);})[_0xebad('0x23')](function(_0x219a13){_0x19c0e0['rows']=_0x219a13;return _0x19c0e0;})[_0xebad('0x23')](respondWithFilteredResult(_0x574718,_0x266a5d))[_0xebad('0x2c')](handleError(_0x574718,null));};exports['show']=function(_0x36708e,_0x12b6fa){var _0x1e287d={'raw':!![],'where':{'id':_0x36708e[_0xebad('0x54')]['id']}},_0x18928d={};_0x18928d['model']=_['keys'](db[_0xebad('0x3d')][_0xebad('0x3e')]);_0x18928d[_0xebad('0x41')]=_[_0xebad('0x40')](_0x36708e[_0xebad('0x41')]);_0x18928d[_0xebad('0x42')]=_[_0xebad('0x43')](_0x18928d[_0xebad('0x3f')],_0x18928d[_0xebad('0x41')]);_0x1e287d['attributes']=_['intersection'](_0x18928d[_0xebad('0x3f')],qs[_0xebad('0x44')](_0x36708e['query'][_0xebad('0x44')]));_0x1e287d[_0xebad('0x45')]=_0x1e287d['attributes'][_0xebad('0x46')]?_0x1e287d[_0xebad('0x45')]:_0x18928d[_0xebad('0x3f')];if(_0x36708e[_0xebad('0x41')][_0xebad('0x55')]){_0x1e287d[_0xebad('0x52')]=[{'all':!![]}];}_0x1e287d=_[_0xebad('0x4d')]({},_0x1e287d,_0x36708e[_0xebad('0x51')]);return db['MailMessage']['find'](_0x1e287d)['then'](handleEntityNotFound(_0x12b6fa,null))[_0xebad('0x23')](respondWithResult(_0x12b6fa,null))[_0xebad('0x2c')](handleError(_0x12b6fa,null));};exports['update']=function(_0x47730b,_0x5a88fe){if(_0x47730b[_0xebad('0x56')]['id']){delete _0x47730b[_0xebad('0x56')]['id'];}return db[_0xebad('0x3d')][_0xebad('0x57')]({'where':{'id':_0x47730b[_0xebad('0x54')]['id']}})[_0xebad('0x23')](handleEntityNotFound(_0x5a88fe,null))['then'](saveUpdates(_0x47730b[_0xebad('0x56')],null))[_0xebad('0x23')](respondWithResult(_0x5a88fe,null))[_0xebad('0x2c')](handleError(_0x5a88fe,null));};exports[_0xebad('0x37')]=function(_0x32f67e,_0x5c5e88){return db['MailMessage']['find']({'where':{'id':_0x32f67e[_0xebad('0x54')]['id']}})[_0xebad('0x23')](handleEntityNotFound(_0x5c5e88,null))[_0xebad('0x23')](removeEntity(_0x5c5e88,null))['catch'](handleError(_0x5c5e88,null));};exports[_0xebad('0x58')]=function(_0x373b75,_0xdd832c){return db[_0xebad('0x3d')][_0xebad('0x58')]()['then'](respondWithResult(_0xdd832c,null))[_0xebad('0x2c')](handleError(_0xdd832c,null));};exports[_0xebad('0x59')]=function(_0x522870,_0x1295a4){return db[_0xebad('0x3d')][_0xebad('0x59')](_0x522870['body'])[_0xebad('0x23')](function(_0x466ffa){if(_0x466ffa){if(_0x466ffa[_0xebad('0x5a')]===_0xebad('0x5b')&&!_0x466ffa[_0xebad('0x5c')]){return db[_0xebad('0x5d')][_0xebad('0x5e')]({'where':{'id':_0x466ffa[_0xebad('0x5f')]},'include':[{'model':db[_0xebad('0x60')],'as':'Smtp','raw':!![]}]})[_0xebad('0x23')](function(_0x3e0286){if(_0x3e0286&&_0x3e0286[_0xebad('0x61')]){var _0x4f9d22={'tls':{'rejectUnauthorized':![]}};if(_[_0xebad('0x62')](_0x3e0286[_0xebad('0x61')][_0xebad('0x63')])){_0x4f9d22[_0xebad('0x64')]=_0x3e0286[_0xebad('0x61')][_0xebad('0x64')];_0x4f9d22[_0xebad('0x65')]=_0x3e0286['Smtp'][_0xebad('0x65')];_0x4f9d22[_0xebad('0x66')]=_0x3e0286['Smtp'][_0xebad('0x66')];if(_0x3e0286['Smtp']['authentication']){_0x4f9d22[_0xebad('0x67')]={'user':_0x3e0286[_0xebad('0x61')]['user'],'pass':_0x3e0286[_0xebad('0x61')][_0xebad('0x68')]};}}else{_0x4f9d22[_0xebad('0x63')]=_0x3e0286['Smtp']['service'];_0x4f9d22[_0xebad('0x67')]={'user':_0x3e0286['Smtp'][_0xebad('0x69')],'pass':_0x3e0286[_0xebad('0x61')][_0xebad('0x68')]};_0x4f9d22[_0xebad('0x66')]=_0x3e0286[_0xebad('0x61')]['secure'];}if(_0x522870[_0xebad('0x56')][_0xebad('0x6a')]&&_0x522870[_0xebad('0x56')]['attachments'][_0xebad('0x46')]){for(var _0xcda55f=0x0;_0xcda55f<_0x522870['body']['attachments'][_0xebad('0x46')];_0xcda55f+=0x1){_0x522870[_0xebad('0x56')][_0xebad('0x6a')][_0xcda55f]={'filename':_0x522870['body'][_0xebad('0x6a')][_0xcda55f][_0xebad('0x3a')],'path':path[_0xebad('0x6b')](config['root'],'server/files/attachments',_0x522870[_0xebad('0x56')][_0xebad('0x6a')][_0xcda55f][_0xebad('0x6c')])};}}return{'account':_0x4f9d22,'message':_0x522870['body']};}})[_0xebad('0x23')](function(_0x2d3d04){if(_0x2d3d04){return respondWithRpcPromise(_0xebad('0x6d'),_0xebad('0x6e'),_0x2d3d04,client9003)['then'](function(_0x288153){return _0x466ffa[_0xebad('0x36')]({'read':!![],'messageId':_0x288153['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xebad('0x2c')](function(_0x1851ec){logger[_0xebad('0x25')]('%s',JSON[_0xebad('0x6f')](_0x1851ec));return _0x466ffa;});}return _0x466ffa;});}return _0x466ffa;}})[_0xebad('0x23')](respondWithResult(_0x1295a4,0xc9))['catch'](handleError(_0x1295a4,null));};var interaction_log=require(_0xebad('0x13'))(_0xebad('0x70'));exports[_0xebad('0x71')]=function(_0x1f235f,_0x343fa9,_0x5cf9ea){var _0x5daced={'channel':_0xebad('0x72')};if(_0x1f235f[_0xebad('0x56')]['id']){delete _0x1f235f['body']['id'];}_0x1f235f[_0xebad('0x56')]['read']=!![];_0x1f235f[_0xebad('0x56')][_0xebad('0x73')]=moment()['format'](_0xebad('0x74'));_0x1f235f[_0xebad('0x56')][_0xebad('0x75')]=_0x1f235f[_0xebad('0x56')][_0xebad('0x75')]||_0x1f235f[_0xebad('0x69')]['id'];return db[_0xebad('0x3d')][_0xebad('0x57')]({'where':{'id':_0x1f235f[_0xebad('0x54')]['id'],'UserId':null},'include':[{'model':db[_0xebad('0x76')],'as':_0xebad('0x77')}]})['then'](handleEntityNotFound(_0x343fa9,null))[_0xebad('0x23')](saveUpdates(_0x1f235f[_0xebad('0x56')],null))[_0xebad('0x23')](function(_0x12ad1e){if(_0x12ad1e){_0x5daced[_0xebad('0x28')]=_0x12ad1e[_0xebad('0x78')]({'plain':!![]});return db[_0xebad('0x79')][_0xebad('0x57')]({'where':{'id':_0x12ad1e[_0xebad('0x7a')]}});}return null;})[_0xebad('0x23')](handleEntityNotFound(_0x343fa9,null))[_0xebad('0x23')](function(_0x16a02f){if(_0x16a02f){return _0x16a02f[_0xebad('0x36')]({'UserId':_0x1f235f['body']['UserId'],'read1stAt':_[_0xebad('0x62')](_0x16a02f[_0xebad('0x7b')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xebad('0x23')](function(_0x2193b3){if(_0x2193b3){_0x5daced['interaction']=_0x2193b3[_0xebad('0x78')]({'plain':!![]});interaction_log[_0xebad('0x29')](_0xebad('0x7c'),_0x1f235f[_0xebad('0x69')]['id'],_0x1f235f[_0xebad('0x69')][_0xebad('0x3a')],_0x1f235f[_0xebad('0x69')][_0xebad('0x7d')],_0x5daced[_0xebad('0x7e')]['id'],_0x1f235f['body']?JSON[_0xebad('0x6f')](_0x1f235f[_0xebad('0x56')]):'null');return respondWithRpcPromise(_0xebad('0x7f'),_0xebad('0x80'),_0x5daced);}return null;})['then'](function(_0x530349){if(_0x530349){if(_0x1f235f[_0xebad('0x56')][_0xebad('0x81')]){_0x5daced[_0xebad('0x28')]['interface']=util['format'](_0xebad('0x82'),_0x1f235f[_0xebad('0x69')][_0xebad('0x3a')]);_0x5daced['message']['channel']=_0x5daced[_0xebad('0x83')];_0x5daced['message']['event']=_0xebad('0x71');return respondWithRpcPromise('EventManager',_0xebad('0x84'),{'event':_0xebad('0x85'),'message':_0x5daced['message']},client9002)[_0xebad('0x23')](function(){return _0x5daced;});}return _0x5daced;}return null;})[_0xebad('0x23')](respondWithResult(_0x343fa9,null))[_0xebad('0x2c')](handleError(_0x343fa9,null));};var interaction_log=require(_0xebad('0x13'))(_0xebad('0x70'));exports[_0xebad('0x35')]=function(_0x1042a3,_0x18c3fb,_0x391df5){var _0x2070af={'agent':{},'channel':_0xebad('0x72')};if(_0x1042a3[_0xebad('0x56')]['id']){delete _0x1042a3['body']['id'];}_0x1042a3['body']['UserId']=_0x1042a3[_0xebad('0x56')][_0xebad('0x75')]||_0x1042a3[_0xebad('0x69')]['id'];_0x2070af[_0xebad('0x86')]['id']=_0x1042a3[_0xebad('0x56')][_0xebad('0x75')];return db[_0xebad('0x3d')][_0xebad('0x57')]({'where':{'id':_0x1042a3[_0xebad('0x54')]['id'],'UserId':null}})[_0xebad('0x23')](handleEntityNotFound(_0x18c3fb,null))[_0xebad('0x23')](function(_0x2dc5fc){if(_0x2dc5fc){_0x2070af['message']=_0x2dc5fc['get']({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x2dc5fc[_0xebad('0x7a')]}});}return null;})[_0xebad('0x23')](handleEntityNotFound(_0x18c3fb,null))[_0xebad('0x23')](function(_0xb6359){if(_0xb6359){_0x2070af['interaction']=_0xb6359[_0xebad('0x78')]({'plain':!![]});interaction_log[_0xebad('0x29')](_0xebad('0x87'),_0x1042a3[_0xebad('0x69')]['id'],_0x1042a3[_0xebad('0x69')]['name'],_0x1042a3['user'][_0xebad('0x7d')],_0x2070af[_0xebad('0x7e')]['id'],_0x1042a3[_0xebad('0x56')]?JSON[_0xebad('0x6f')](_0x1042a3[_0xebad('0x56')]):_0xebad('0x88'));return respondWithRpcPromise(_0xebad('0x89'),_0xebad('0x8a'),_0x2070af);}return null;})[_0xebad('0x23')](function(_0x3bb082){if(_0x3bb082){_0x3bb082[_0xebad('0x28')]['interface']=util[_0xebad('0x8b')](_0xebad('0x82'),_0x1042a3[_0xebad('0x69')]['name']);_0x3bb082['message'][_0xebad('0x83')]=_0x2070af[_0xebad('0x83')];_0x3bb082[_0xebad('0x28')][_0xebad('0x8c')]=_0xebad('0x35');respondWithRpcPromise(_0xebad('0x84'),_0xebad('0x84'),{'event':_0xebad('0x8d'),'message':_0x3bb082['message']},client9002);return _0x2070af;}return null;})[_0xebad('0x23')](respondWithResult(_0x18c3fb,null))[_0xebad('0x2c')](handleError(_0x18c3fb,null));};exports[_0xebad('0x8e')]=function(_0x27b14b,_0x3edf42){var _0xc0ef4a=moment()['unix']()[_0xebad('0x8f')]();var _0x290e15=path[_0xebad('0x6b')](config['root'],_0xebad('0x90'),_0xebad('0x91'),'tmp');var _0x53df63=path[_0xebad('0x6b')](config[_0xebad('0x92')],_0xebad('0x90'),_0xebad('0x91'),'attachments');var _0x56a9e7=util[_0xebad('0x8b')](_0xebad('0x93'),_0xc0ef4a);return db['MailMessage'][_0xebad('0x57')]({'where':{'id':_0x27b14b[_0xebad('0x54')]['id']},'attributes':['id',_0xebad('0x56'),'from','to','cc','bcc',_0xebad('0x94'),_0xebad('0x95')],'include':_0x27b14b[_0xebad('0x41')][_0xebad('0x6a')]?[{'model':db[_0xebad('0x96')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x3edf42,null))[_0xebad('0x23')](function(_0x3a01dd){if(_0x3a01dd){var _0x1ad46b=_0x3a01dd;var _0x58ae5d={'from':_0x1ad46b['from'],'to':_0x1ad46b['to'],'subject':_0x1ad46b[_0xebad('0x94')],'html':_0x1ad46b[_0xebad('0x56')],'headers':{'Date':moment(_0x1ad46b['createdAt'])[_0xebad('0x8b')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x3a01dd['cc']){_0x58ae5d[_0xebad('0x97')]['Cc']=_0x3a01dd['cc'];}if(_0x3a01dd['bcc']){_0x58ae5d[_0xebad('0x97')]['Bcc']=_0x3a01dd[_0xebad('0x98')];}return new BPromise(function(_0x52da4b,_0x184fa6){if(_0x3a01dd[_0xebad('0x99')]){for(var _0x2a5e02=0x0;_0x2a5e02<_0x3a01dd[_0xebad('0x99')][_0xebad('0x46')];_0x2a5e02++){var _0x8b7061=_0x3a01dd[_0xebad('0x99')][_0x2a5e02];var _0x9a2df5=path['join'](_0x53df63,_0x8b7061[_0xebad('0x6c')]);if(fs[_0xebad('0x9a')](_0x9a2df5)){_0x58ae5d[_0xebad('0x6a')]['push']({'name':_0x8b7061['name'],'contentType':_0x8b7061[_0xebad('0x9b')],'data':fs[_0xebad('0x9c')](_0x9a2df5)});}}}emlformat['build'](_0x58ae5d,function(_0x27ec3d,_0x1405d6){if(_0x27ec3d)return _0x184fa6(_0x27ec3d);fs['writeFileSync'](path['join'](_0x290e15,_0x56a9e7),_0x1405d6);return _0x52da4b(_0x1405d6);});});}})['then'](function(_0x1637cd){if(_0x1637cd){return _0x3edf42[_0xebad('0x8e')](path[_0xebad('0x6b')](_0x290e15,_0x56a9e7),_0x56a9e7,function(_0xe26270){if(_0xe26270){console['log']('err',_0xe26270);}else{fs['unlinkSync'](path[_0xebad('0x6b')](_0x290e15,_0x56a9e7));}});}})['catch'](handleError(_0x3edf42,null));};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js
index 40729b6..7d19579 100644
--- a/server/api/mailMessage/mailMessage.events.js
+++ b/server/api/mailMessage/mailMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb194=['hasOwnProperty','exports','events','MailMessage','setMaxListeners','save','update','remove','emit'];(function(_0x34945a,_0x423a7d){var _0x5d7a1d=function(_0xe346c0){while(--_0xe346c0){_0x34945a['push'](_0x34945a['shift']());}};_0x5d7a1d(++_0x423a7d);}(_0xb194,0x1b2));var _0x4b19=function(_0xd3348b,_0x288d47){_0xd3348b=_0xd3348b-0x0;var _0x583cdc=_0xb194[_0xd3348b];return _0x583cdc;};'use strict';var EventEmitter=require(_0x4b19('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x4b19('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x4b19('0x2')](0x0);var events={'afterCreate':_0x4b19('0x3'),'afterUpdate':_0x4b19('0x4'),'afterDestroy':_0x4b19('0x5')};function emitEvent(_0x5c07ad){return function(_0x46faa3,_0x3a4700,_0x555969){MailMessageEvents[_0x4b19('0x6')](_0x5c07ad+':'+_0x46faa3['id'],_0x46faa3);MailMessageEvents['emit'](_0x5c07ad,_0x46faa3);_0x555969(null);};}for(var e in events){if(events[_0x4b19('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x4b19('0x8')]=MailMessageEvents;
\ No newline at end of file
+var _0xed1f=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed1f,0x170));var _0xfed1=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xed1f[_0x7e2eb0];return _0xd92de4;};'use strict';var EventEmitter=require(_0xfed1('0x0'));var MailMessage=require(_0xfed1('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfed1('0x2'),'afterUpdate':'update','afterDestroy':_0xfed1('0x3')};function emitEvent(_0x501da6){return function(_0x444ba8,_0x423af3,_0x198341){MailMessageEvents[_0xfed1('0x4')](_0x501da6+':'+_0x444ba8['id'],_0x444ba8);MailMessageEvents[_0xfed1('0x4')](_0x501da6,_0x444ba8);_0x198341(null);};}for(var e in events){if(events[_0xfed1('0x5')](e)){var event=events[e];MailMessage[_0xfed1('0x6')](e,emitEvent(event));}}module[_0xfed1('0x7')]=MailMessageEvents;
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js
index b53cfbd..d60d4a8 100644
--- a/server/api/mailMessage/mailMessage.model.js
+++ b/server/api/mailMessage/mailMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ab5=['direction','out','secret','isNil','UserId','findOne','update','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailMessage.attributes','exports','define','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','models','get','toLowerCase'];(function(_0x2534ce,_0x46b96d){var _0x2dc511=function(_0x54796d){while(--_0x54796d){_0x2534ce['push'](_0x2534ce['shift']());}};_0x2dc511(++_0x46b96d);}(_0x8ab5,0x9f));var _0x58ab=function(_0x483eea,_0x35cfc5){_0x483eea=_0x483eea-0x0;var _0x27c3e0=_0x8ab5[_0x483eea];return _0x27c3e0;};'use strict';var _=require(_0x58ab('0x0'));var util=require(_0x58ab('0x1'));var logger=require(_0x58ab('0x2'))(_0x58ab('0x3'));var moment=require(_0x58ab('0x4'));var BPromise=require(_0x58ab('0x5'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x58ab('0x6'));var rimraf=require('rimraf');var config=require(_0x58ab('0x7'));var attributes=require(_0x58ab('0x8'));module[_0x58ab('0x9')]=function(_0x37d6a3,_0x41585e){return _0x37d6a3[_0x58ab('0xa')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x58ab('0xb'),'fields':[_0x58ab('0xb')]},{'name':_0x58ab('0xc'),'fields':['plainBody',_0x58ab('0xd')],'type':_0x58ab('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x215820,_0x1688fe,_0x1fc230){if(_0x215820[_0x58ab('0xf')]){_0x215820[_0x58ab('0x10')]=htmlToText[_0x58ab('0x11')](_0x215820[_0x58ab('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1fc230(null,_0x1688fe);},'afterCreate':function(_0x14d7d9,_0x4fb129,_0x44da93){var _0x2538b6=_0x37d6a3[_0x58ab('0x12')];var _0x3ae3bf=_0x14d7d9[_0x58ab('0x13')]({'plain':!![]});if(_0x3ae3bf['direction'][_0x58ab('0x14')]()==='in'||_0x3ae3bf[_0x58ab('0x15')][_0x58ab('0x14')]()===_0x58ab('0x16')&&!_0x3ae3bf[_0x58ab('0x17')]&&!_[_0x58ab('0x18')](_0x3ae3bf[_0x58ab('0x19')])){_0x2538b6['MailInteraction'][_0x58ab('0x1a')]({'where':{'id':_0x3ae3bf['MailInteractionId']}})['then'](function(_0xff62bf){if(_0xff62bf){_0xff62bf[_0x58ab('0x1b')]({'lastMsgAt':_0x3ae3bf['createdAt'],'lastMsgDirection':_0x3ae3bf[_0x58ab('0x15')]['toLowerCase'](),'lastMsgBody':_0x3ae3bf['body']});}})['catch'](function(_0x1c7a8c){console[_0x58ab('0x1c')](_0x1c7a8c);});}_0x44da93();}},'charset':'utf8mb4','collate':_0x58ab('0x1d')});};
\ No newline at end of file
+var _0x37c9=['FULLTEXT','body','fromString','models','direction','out','secret','isNil','UserId','MailInteraction','then','createdAt','toLowerCase','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','html-to-text','rimraf','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x37c9,0x127));var _0x937c=function(_0x5303f3,_0x24eaac){_0x5303f3=_0x5303f3-0x0;var _0x2d123f=_0x37c9[_0x5303f3];return _0x2d123f;};'use strict';var _=require('lodash');var util=require(_0x937c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x937c('0x1'));var BPromise=require(_0x937c('0x2'));var rp=require(_0x937c('0x3'));var htmlToText=require(_0x937c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x937c('0x5'));var config=require('../../config/environment');var attributes=require(_0x937c('0x6'));module['exports']=function(_0x58ced8,_0x734438){return _0x58ced8[_0x937c('0x7')](_0x937c('0x8'),attributes,{'tableName':_0x937c('0x9'),'paranoid':![],'indexes':[{'name':_0x937c('0xa'),'fields':[_0x937c('0xa')]},{'name':_0x937c('0xb'),'fields':[_0x937c('0xc'),'subject'],'type':_0x937c('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x53b92b,_0x37b322,_0x520aa9){if(_0x53b92b[_0x937c('0xe')]){_0x53b92b[_0x937c('0xc')]=htmlToText[_0x937c('0xf')](_0x53b92b['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x520aa9(null,_0x37b322);},'afterCreate':function(_0x2a05f8,_0x4c613e,_0x2fcffb){var _0x297ef9=_0x58ced8[_0x937c('0x10')];var _0x25dc86=_0x2a05f8['get']({'plain':!![]});if(_0x25dc86['direction']['toLowerCase']()==='in'||_0x25dc86[_0x937c('0x11')]['toLowerCase']()===_0x937c('0x12')&&!_0x25dc86[_0x937c('0x13')]&&!_[_0x937c('0x14')](_0x25dc86[_0x937c('0x15')])){_0x297ef9[_0x937c('0x16')]['findOne']({'where':{'id':_0x25dc86['MailInteractionId']}})[_0x937c('0x17')](function(_0x5bcd88){if(_0x5bcd88){_0x5bcd88['update']({'lastMsgAt':_0x25dc86[_0x937c('0x18')],'lastMsgDirection':_0x25dc86[_0x937c('0x11')][_0x937c('0x19')](),'lastMsgBody':_0x25dc86[_0x937c('0xe')]});}})['catch'](function(_0x45e09f){console['error'](_0x45e09f);});}_0x2fcffb();}},'charset':_0x937c('0x1a'),'collate':_0x937c('0x1b')});};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js
index 1f231d2..1879eb6 100644
--- a/server/api/mailMessage/mailMessage.rpc.js
+++ b/server/api/mailMessage/mailMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf8af=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','info','stringify','lodash'];(function(_0x2a80ee,_0x4f21f2){var _0x145a20=function(_0x42e967){while(--_0x42e967){_0x2a80ee['push'](_0x2a80ee['shift']());}};_0x145a20(++_0x4f21f2);}(_0xf8af,0x8b));var _0xff8a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf8af[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xff8a('0x0'));var util=require('util');var moment=require(_0xff8a('0x1'));var BPromise=require(_0xff8a('0x2'));var rs=require(_0xff8a('0x3'));var fs=require('fs');var Redis=require(_0xff8a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xff8a('0x5'));var logger=require(_0xff8a('0x6'))(_0xff8a('0x7'));var config=require(_0xff8a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xff8a('0x9')]({'port':0x232a});config['redis']=_[_0xff8a('0xa')](config[_0xff8a('0xb')],{'host':_0xff8a('0xc'),'port':0x18eb});var socket=require(_0xff8a('0xd'))(new Redis(config[_0xff8a('0xb')]));require(_0xff8a('0xe'))[_0xff8a('0xf')](socket);function respondWithRpcPromise(_0x7442d6,_0x3bb1ba,_0xb8cb56){return new BPromise(function(_0x2c2e5d,_0x5a31cb){return client[_0xff8a('0x10')](_0x7442d6,_0xb8cb56)[_0xff8a('0x11')](function(_0x3f12b5){logger['info'](_0xff8a('0x12'),_0x3bb1ba,_0xff8a('0x13'));logger[_0xff8a('0x14')](_0xff8a('0x15'),_0x3bb1ba,_0xff8a('0x13'),JSON['stringify'](_0x3f12b5));if(_0x3f12b5[_0xff8a('0x16')]){if(_0x3f12b5[_0xff8a('0x16')][_0xff8a('0x17')]===0x1f4){logger[_0xff8a('0x16')]('MailMessage,\x20%s,\x20%s',_0x3bb1ba,_0x3f12b5['error']['message']);return _0x5a31cb(_0x3f12b5['error'][_0xff8a('0x18')]);}logger['error'](_0xff8a('0x12'),_0x3bb1ba,_0x3f12b5[_0xff8a('0x16')]['message']);return _0x2c2e5d(_0x3f12b5[_0xff8a('0x16')]['message']);}else{logger['info'](_0xff8a('0x12'),_0x3bb1ba,_0xff8a('0x13'));_0x2c2e5d(_0x3f12b5[_0xff8a('0x19')]['message']);}})[_0xff8a('0x1a')](function(_0x5c4349){logger[_0xff8a('0x16')]('MailMessage,\x20%s,\x20%s',_0x3bb1ba,_0x5c4349);_0x5a31cb(_0x5c4349);});});}exports[_0xff8a('0x1b')]=function(_0x1b4272){var _0x794015=this;return new Promise(function(_0xdb1027,_0x145d95){return db[_0xff8a('0x1c')][_0xff8a('0x1d')](_0x1b4272[_0xff8a('0x1e')],{'raw':_0x1b4272[_0xff8a('0x1f')]?_0x1b4272[_0xff8a('0x1f')][_0xff8a('0x20')]===undefined?!![]:![]:!![]})[_0xff8a('0x11')](function(_0x3bb4ac){logger[_0xff8a('0x21')](_0xff8a('0x1b'),_0x1b4272);logger['debug'](_0xff8a('0x1b'),_0x1b4272,JSON[_0xff8a('0x22')](_0x3bb4ac));_0xdb1027(_0x3bb4ac);})[_0xff8a('0x1a')](function(_0x303050){logger['error'](_0xff8a('0x1b'),_0x303050['message'],_0x1b4272);_0x145d95(_0x794015[_0xff8a('0x16')](0x1f4,_0x303050[_0xff8a('0x18')]));});});};
\ No newline at end of file
+var _0x3595=['MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateMailMessage','MailMessage','body','options','raw','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2547ac,_0x34318e){var _0x1011c5=function(_0x5a314b){while(--_0x5a314b){_0x2547ac['push'](_0x2547ac['shift']());}};_0x1011c5(++_0x34318e);}(_0x3595,0x147));var _0x5359=function(_0x4d0702,_0x3ebc6c){_0x4d0702=_0x4d0702-0x0;var _0x1a488d=_0x3595[_0x4d0702];return _0x1a488d;};'use strict';var _=require(_0x5359('0x0'));var util=require(_0x5359('0x1'));var moment=require(_0x5359('0x2'));var BPromise=require('bluebird');var rs=require(_0x5359('0x3'));var fs=require('fs');var Redis=require(_0x5359('0x4'));var db=require(_0x5359('0x5'))['db'];var utils=require(_0x5359('0x6'));var logger=require(_0x5359('0x7'))(_0x5359('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5359('0x9')][_0x5359('0xa')]({'port':0x232a});config[_0x5359('0xb')]=_[_0x5359('0xc')](config[_0x5359('0xb')],{'host':_0x5359('0xd'),'port':0x18eb});var socket=require(_0x5359('0xe'))(new Redis(config[_0x5359('0xb')]));require(_0x5359('0xf'))[_0x5359('0x10')](socket);function respondWithRpcPromise(_0x5d33a0,_0x4804bb,_0x4c70d7){return new BPromise(function(_0x541386,_0x1496b5){return client[_0x5359('0x11')](_0x5d33a0,_0x4c70d7)[_0x5359('0x12')](function(_0x2f7a5b){logger[_0x5359('0x13')](_0x5359('0x14'),_0x4804bb,_0x5359('0x15'));logger[_0x5359('0x16')](_0x5359('0x17'),_0x4804bb,_0x5359('0x15'),JSON[_0x5359('0x18')](_0x2f7a5b));if(_0x2f7a5b[_0x5359('0x19')]){if(_0x2f7a5b[_0x5359('0x19')][_0x5359('0x1a')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x4804bb,_0x2f7a5b[_0x5359('0x19')][_0x5359('0x1b')]);return _0x1496b5(_0x2f7a5b[_0x5359('0x19')][_0x5359('0x1b')]);}logger[_0x5359('0x19')](_0x5359('0x14'),_0x4804bb,_0x2f7a5b['error']['message']);return _0x541386(_0x2f7a5b[_0x5359('0x19')][_0x5359('0x1b')]);}else{logger['info'](_0x5359('0x14'),_0x4804bb,_0x5359('0x15'));_0x541386(_0x2f7a5b[_0x5359('0x1c')][_0x5359('0x1b')]);}})['catch'](function(_0x50d158){logger['error'](_0x5359('0x14'),_0x4804bb,_0x50d158);_0x1496b5(_0x50d158);});});}exports[_0x5359('0x1d')]=function(_0x53f00f){var _0x35e920=this;return new Promise(function(_0x211580,_0x45bf1c){return db[_0x5359('0x1e')]['create'](_0x53f00f[_0x5359('0x1f')],{'raw':_0x53f00f[_0x5359('0x20')]?_0x53f00f['options'][_0x5359('0x21')]===undefined?!![]:![]:!![]})[_0x5359('0x12')](function(_0x3d3c0c){logger[_0x5359('0x13')](_0x5359('0x1d'),_0x53f00f);logger['debug']('CreateMailMessage',_0x53f00f,JSON[_0x5359('0x18')](_0x3d3c0c));_0x211580(_0x3d3c0c);})[_0x5359('0x22')](function(_0x45edfb){logger[_0x5359('0x19')](_0x5359('0x1d'),_0x45edfb[_0x5359('0x1b')],_0x53f00f);_0x45bf1c(_0x35e920[_0x5359('0x19')](0x1f4,_0x45edfb[_0x5359('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js
index 4074f96..6f00f32 100644
--- a/server/api/mailMessage/mailMessage.socket.js
+++ b/server/api/mailMessage/mailMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa059=['./mailMessage.events','save','remove','update','emit','mailMessage:'];(function(_0x53fec6,_0x45fa6b){var _0x5ddf3b=function(_0x39f122){while(--_0x39f122){_0x53fec6['push'](_0x53fec6['shift']());}};_0x5ddf3b(++_0x45fa6b);}(_0xa059,0x90));var _0x9a05=function(_0x5ceb12,_0x3035fd){_0x5ceb12=_0x5ceb12-0x0;var _0x2d046a=_0xa059[_0x5ceb12];return _0x2d046a;};'use strict';var MailMessageEvents=require(_0x9a05('0x0'));var events=[_0x9a05('0x1'),_0x9a05('0x2'),_0x9a05('0x3')];function createListener(_0x3ce22b,_0x16c58f){return function(_0x3dd4b8){_0x16c58f[_0x9a05('0x4')](_0x3ce22b,_0x3dd4b8);};}function removeListener(_0x1331cf,_0x561d95){return function(){MailMessageEvents['removeListener'](_0x1331cf,_0x561d95);};}exports['register']=function(_0x5a6372){for(var _0x4368ce=0x0,_0x592321=events['length'];_0x4368ce<_0x592321;_0x4368ce++){var _0x3d7937=events[_0x4368ce];var _0x403ed3=createListener(_0x9a05('0x5')+_0x3d7937,_0x5a6372);MailMessageEvents['on'](_0x3d7937,_0x403ed3);}};
\ No newline at end of file
+var _0x2150=['./mailMessage.events','save','update','emit','removeListener','mailMessage:'];(function(_0x56b889,_0x3b55a7){var _0xdc5202=function(_0x53e567){while(--_0x53e567){_0x56b889['push'](_0x56b889['shift']());}};_0xdc5202(++_0x3b55a7);}(_0x2150,0x8a));var _0x0215=function(_0x3a8b7c,_0x3e5db2){_0x3a8b7c=_0x3a8b7c-0x0;var _0x40eb80=_0x2150[_0x3a8b7c];return _0x40eb80;};'use strict';var MailMessageEvents=require(_0x0215('0x0'));var events=[_0x0215('0x1'),'remove',_0x0215('0x2')];function createListener(_0x46f9da,_0x2de559){return function(_0x28f389){_0x2de559[_0x0215('0x3')](_0x46f9da,_0x28f389);};}function removeListener(_0x27f8f5,_0x32b870){return function(){MailMessageEvents[_0x0215('0x4')](_0x27f8f5,_0x32b870);};}exports['register']=function(_0x5227fb){for(var _0x459dc6=0x0,_0x2a7708=events['length'];_0x459dc6<_0x2a7708;_0x459dc6++){var _0x24bf05=events[_0x459dc6];var _0x3a504f=createListener(_0x0215('0x5')+_0x24bf05,_0x5227fb);MailMessageEvents['on'](_0x24bf05,_0x3a504f);}};
\ No newline at end of file
diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js
index 02b9216..7d9434e 100644
--- a/server/api/mailQueue/index.js
+++ b/server/api/mailQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x77aa=['post','create','addTeams','/:id/users','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','Router','../../components/auth/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x77aa,0x6a));var _0xa77a=function(_0x25d812,_0x379281){_0x25d812=_0x25d812-0x0;var _0x2a9a0b=_0x77aa[_0x25d812];return _0x2a9a0b;};'use strict';var multer=require(_0xa77a('0x0'));var util=require(_0xa77a('0x1'));var path=require(_0xa77a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa77a('0x3')]();var auth=require(_0xa77a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa77a('0x5'));router[_0xa77a('0x6')]('/',auth[_0xa77a('0x7')](),controller[_0xa77a('0x8')]);router[_0xa77a('0x6')](_0xa77a('0x9'),auth[_0xa77a('0x7')](),controller[_0xa77a('0xa')]);router['get'](_0xa77a('0xb'),auth[_0xa77a('0x7')](),controller[_0xa77a('0xc')]);router['get']('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xa77a('0x6')](_0xa77a('0xd'),auth[_0xa77a('0x7')](),controller['getTeams']);router[_0xa77a('0x6')]('/:id/users',auth[_0xa77a('0x7')](),controller['getAgents']);router[_0xa77a('0xe')]('/',auth[_0xa77a('0x7')](),controller[_0xa77a('0xf')]);router[_0xa77a('0xe')](_0xa77a('0xd'),auth[_0xa77a('0x7')](),controller[_0xa77a('0x10')]);router['post'](_0xa77a('0x11'),auth[_0xa77a('0x7')](),controller['addAgents']);router[_0xa77a('0x12')]('/:id',auth[_0xa77a('0x7')](),controller['update']);router['delete'](_0xa77a('0xb'),auth[_0xa77a('0x7')](),controller[_0xa77a('0x13')]);router[_0xa77a('0x14')](_0xa77a('0xd'),auth[_0xa77a('0x7')](),controller[_0xa77a('0x15')]);router[_0xa77a('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xa77a('0x16')]);module[_0xa77a('0x17')]=router;
\ No newline at end of file
+var _0x1ad1=['show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','get','isAuthenticated','index','describe','/:id'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x1ad1,0x1c9));var _0x11ad=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x1ad1[_0x1beef3];return _0x5af964;};'use strict';var multer=require(_0x11ad('0x0'));var util=require(_0x11ad('0x1'));var path=require(_0x11ad('0x2'));var timeout=require('connect-timeout');var express=require(_0x11ad('0x3'));var router=express[_0x11ad('0x4')]();var auth=require(_0x11ad('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0x11ad('0x6')]('/',auth[_0x11ad('0x7')](),controller[_0x11ad('0x8')]);router[_0x11ad('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x11ad('0x9')]);router[_0x11ad('0x6')](_0x11ad('0xa'),auth[_0x11ad('0x7')](),controller[_0x11ad('0xb')]);router[_0x11ad('0x6')](_0x11ad('0xc'),auth[_0x11ad('0x7')](),controller[_0x11ad('0xd')]);router['get'](_0x11ad('0xe'),auth[_0x11ad('0x7')](),controller['getTeams']);router[_0x11ad('0x6')](_0x11ad('0xf'),auth[_0x11ad('0x7')](),controller[_0x11ad('0x10')]);router[_0x11ad('0x11')]('/',auth[_0x11ad('0x7')](),controller[_0x11ad('0x12')]);router[_0x11ad('0x11')]('/:id/teams',auth[_0x11ad('0x7')](),controller[_0x11ad('0x13')]);router[_0x11ad('0x11')](_0x11ad('0xf'),auth[_0x11ad('0x7')](),controller[_0x11ad('0x14')]);router['put']('/:id',auth[_0x11ad('0x7')](),controller[_0x11ad('0x15')]);router[_0x11ad('0x16')]('/:id',auth[_0x11ad('0x7')](),controller[_0x11ad('0x17')]);router[_0x11ad('0x16')](_0x11ad('0xe'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x11ad('0x7')](),controller[_0x11ad('0x18')]);module[_0x11ad('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js
index dc98acd..77bcfb8 100644
--- a/server/api/mailQueue/mailQueue.attributes.js
+++ b/server/api/mailQueue/mailQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8643=['beepall','roundrobin','sequelize','name','STRING','INTEGER','rrmemory'];(function(_0xa273e9,_0x49d1dd){var _0x13b88d=function(_0x1b6e82){while(--_0x1b6e82){_0xa273e9['push'](_0xa273e9['shift']());}};_0x13b88d(++_0x49d1dd);}(_0x8643,0xb1));var _0x3864=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8643[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x3864('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3864('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3864('0x2')]},'timeout':{'type':Sequelize[_0x3864('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3864('0x4'),_0x3864('0x5'),_0x3864('0x6'))}};
\ No newline at end of file
+var _0x357f=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x84b42b,_0x70e55c){var _0x399751=function(_0x4c0d62){while(--_0x4c0d62){_0x84b42b['push'](_0x84b42b['shift']());}};_0x399751(++_0x70e55c);}(_0x357f,0xf5));var _0xf357=function(_0x1959ed,_0x5a840d){_0x1959ed=_0x1959ed-0x0;var _0x47e5c9=_0x357f[_0x1959ed];return _0x47e5c9;};'use strict';var Sequelize=require(_0xf357('0x0'));module[_0xf357('0x1')]={'name':{'type':Sequelize[_0xf357('0x2')],'unique':_0xf357('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf357('0x2')]},'timeout':{'type':Sequelize[_0xf357('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf357('0x5')](_0xf357('0x6'),'beepall',_0xf357('0x7'))}};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js
index b165568..f1468b0 100644
--- a/server/api/mailQueue/mailQueue.controller.js
+++ b/server/api/mailQueue/mailQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f18=['merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','update','body','describe','getMembers','findOne','UserMailQueue','order','MailQueueId','findAndCountAll','UserId','updatedAt','createdAt','format','SIP','mailPause','getTeams','Team','nolimit','teams','User','Agents','online','voicePause','interface','flatMap','transaction','addTeams','findOrCreate','forEach','emit','removeTeams','ids','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','removeAgents','userMailQueue:remove','addAgents','omit','userMailQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','./mailQueue.socket','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','MailQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','map','type','field','options','includeAll','findAll','rows','catch','params'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x3f18,0x1ce));var _0x83f1=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3f18[_0x3b380d];return _0x54502b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x83f1('0x0'));var rimraf=require(_0x83f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83f1('0x2'));var rp=require('request-promise');var moment=require(_0x83f1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x83f1('0x4'));var util=require(_0x83f1('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x83f1('0x6'));var ejs=require(_0x83f1('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x83f1('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x83f1('0x9'));var Papa=require(_0x83f1('0xa'));var Redis=require(_0x83f1('0xb'));var authService=require(_0x83f1('0xc'));var qs=require(_0x83f1('0xd'));var hardwareService=require(_0x83f1('0xe'));var logger=require('../../config/logger')(_0x83f1('0xf'));var utils=require('../../config/utils');var config=require(_0x83f1('0x10'));var db=require(_0x83f1('0x11'))['db'];config[_0x83f1('0x12')]=_['defaults'](config[_0x83f1('0x12')],{'host':_0x83f1('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x83f1('0x12')]));require(_0x83f1('0x14'))['register'](socket);function respondWithStatusCode(_0x38f2f6,_0x1cdad8){_0x1cdad8=_0x1cdad8||0xcc;return function(_0x2549a2){if(_0x2549a2){return _0x38f2f6[_0x83f1('0x15')](_0x1cdad8);}return _0x38f2f6[_0x83f1('0x16')](_0x1cdad8)[_0x83f1('0x17')]();};}function respondWithResult(_0x130912,_0x326e89){_0x326e89=_0x326e89||0xc8;return function(_0x434ab3){if(_0x434ab3){return _0x130912[_0x83f1('0x16')](_0x326e89)[_0x83f1('0x18')](_0x434ab3);}};}function respondWithFilteredResult(_0x424508,_0x51b685){return function(_0x25c694){if(_0x25c694){var _0x49e78d=_0x25c694[_0x83f1('0x19')],_0x99ef16=_0x51b685[_0x83f1('0x1a')],_0x30e876=_0x51b685[_0x83f1('0x1a')]+_0x51b685[_0x83f1('0x1b')],_0xafa1f9;if(_0x30e876>=_0x49e78d){_0x30e876=_0x49e78d;_0xafa1f9=0xc8;}else{_0xafa1f9=0xce;}_0x424508[_0x83f1('0x16')](_0xafa1f9);return _0x424508[_0x83f1('0x1c')]('Content-Range',_0x99ef16+'-'+_0x30e876+'/'+_0x49e78d)[_0x83f1('0x18')](_0x25c694);}return null;};}function patchUpdates(_0x4ce7f4){return function(_0x322344){try{jsonpatch[_0x83f1('0x1d')](_0x322344,_0x4ce7f4,!![]);}catch(_0x4adb6e){return BPromise[_0x83f1('0x1e')](_0x4adb6e);}return _0x322344[_0x83f1('0x1f')]();};}function saveUpdates(_0x1d1b69,_0x2059c5){return function(_0x4d804b){if(_0x4d804b){return _0x4d804b['update'](_0x1d1b69)[_0x83f1('0x20')](function(_0x2934b2){return _0x2934b2;});}return null;};}function removeEntity(_0x1887e8,_0x78c6e2){return function(_0x4eacd5){if(_0x4eacd5){return _0x4eacd5[_0x83f1('0x21')]()[_0x83f1('0x20')](function(){var _0x288525=_0x4eacd5[_0x83f1('0x22')]({'plain':!![]});var _0x205624=_0x83f1('0x23');return db[_0x83f1('0x24')][_0x83f1('0x21')]({'where':{'type':_0x205624,'resourceId':_0x288525['id']}})[_0x83f1('0x20')](function(){return _0x4eacd5;});})['then'](function(){_0x1887e8[_0x83f1('0x16')](0xcc)[_0x83f1('0x17')]();});}};}function handleEntityNotFound(_0x3282be,_0x345d65){return function(_0x2b8367){if(!_0x2b8367){_0x3282be[_0x83f1('0x15')](0x194);}return _0x2b8367;};}function handleError(_0x9f6af7,_0x268dc8){_0x268dc8=_0x268dc8||0x1f4;return function(_0x30622d){logger[_0x83f1('0x25')](_0x30622d[_0x83f1('0x26')]);if(_0x30622d[_0x83f1('0x27')]){delete _0x30622d['name'];}_0x9f6af7[_0x83f1('0x16')](_0x268dc8)[_0x83f1('0x28')](_0x30622d);};}exports[_0x83f1('0x29')]=function(_0x307c96,_0x5c32a9){var _0x164e1e={},_0x1584d4={},_0x34933a={'count':0x0,'rows':[]};var _0x2435e9=db[_0x83f1('0x2a')][_0x83f1('0x2b')];_0x1584d4[_0x83f1('0x2c')]=_[_0x83f1('0x2d')](_0x2435e9);_0x1584d4['query']=_['keys'](_0x307c96[_0x83f1('0x2e')]);_0x1584d4[_0x83f1('0x2f')]=_[_0x83f1('0x30')](_0x1584d4[_0x83f1('0x2c')],_0x1584d4[_0x83f1('0x2e')]);_0x164e1e[_0x83f1('0x31')]=_[_0x83f1('0x30')](_0x1584d4[_0x83f1('0x2c')],qs[_0x83f1('0x32')](_0x307c96[_0x83f1('0x2e')][_0x83f1('0x32')]));_0x164e1e[_0x83f1('0x31')]=_0x164e1e[_0x83f1('0x31')][_0x83f1('0x33')]?_0x164e1e[_0x83f1('0x31')]:_0x1584d4[_0x83f1('0x2c')];if(!_0x307c96['query'][_0x83f1('0x34')]('nolimit')){_0x164e1e['limit']=qs[_0x83f1('0x1b')](_0x307c96['query'][_0x83f1('0x1b')]);_0x164e1e[_0x83f1('0x1a')]=qs['offset'](_0x307c96[_0x83f1('0x2e')][_0x83f1('0x1a')]);}_0x164e1e['order']=qs['sort'](_0x307c96[_0x83f1('0x2e')][_0x83f1('0x35')]);_0x164e1e[_0x83f1('0x36')]=qs['filters'](_[_0x83f1('0x37')](_0x307c96[_0x83f1('0x2e')],_0x1584d4['filters']));if(_0x307c96[_0x83f1('0x2e')][_0x83f1('0x38')]){_0x164e1e[_0x83f1('0x36')]=_['merge'](_0x164e1e[_0x83f1('0x36')],{'$or':_[_0x83f1('0x39')](_0x2435e9,function(_0x2e789f){if(_0x2e789f[_0x83f1('0x3a')]['key']!=='VIRTUAL'){var _0xb38aec={};_0xb38aec[_0x2e789f[_0x83f1('0x3b')]]={'$like':'%'+_0x307c96[_0x83f1('0x2e')][_0x83f1('0x38')]+'%'};return _0xb38aec;}})});}_0x164e1e=_['merge']({},_0x164e1e,_0x307c96[_0x83f1('0x3c')]);var _0x5ccdce={'where':_0x164e1e['where']};return db[_0x83f1('0x2a')][_0x83f1('0x19')](_0x5ccdce)['then'](function(_0x388afd){_0x34933a[_0x83f1('0x19')]=_0x388afd;if(_0x307c96[_0x83f1('0x2e')][_0x83f1('0x3d')]){_0x164e1e['include']=[{'all':!![]}];}return db[_0x83f1('0x2a')][_0x83f1('0x3e')](_0x164e1e);})['then'](function(_0x2af01a){_0x34933a[_0x83f1('0x3f')]=_0x2af01a;return _0x34933a;})['then'](respondWithFilteredResult(_0x5c32a9,_0x164e1e))[_0x83f1('0x40')](handleError(_0x5c32a9,null));};exports['show']=function(_0x1980e5,_0x21b1ea){var _0xa4c099={'raw':!![],'where':{'id':_0x1980e5[_0x83f1('0x41')]['id']}},_0x2acaa3={};_0x2acaa3[_0x83f1('0x2c')]=_[_0x83f1('0x2d')](db['MailQueue']['rawAttributes']);_0x2acaa3[_0x83f1('0x2e')]=_[_0x83f1('0x2d')](_0x1980e5[_0x83f1('0x2e')]);_0x2acaa3[_0x83f1('0x2f')]=_[_0x83f1('0x30')](_0x2acaa3[_0x83f1('0x2c')],_0x2acaa3[_0x83f1('0x2e')]);_0xa4c099[_0x83f1('0x31')]=_[_0x83f1('0x30')](_0x2acaa3[_0x83f1('0x2c')],qs[_0x83f1('0x32')](_0x1980e5[_0x83f1('0x2e')][_0x83f1('0x32')]));_0xa4c099[_0x83f1('0x31')]=_0xa4c099['attributes'][_0x83f1('0x33')]?_0xa4c099['attributes']:_0x2acaa3['model'];if(_0x1980e5[_0x83f1('0x2e')][_0x83f1('0x3d')]){_0xa4c099['include']=[{'all':!![]}];}_0xa4c099=_[_0x83f1('0x42')]({},_0xa4c099,_0x1980e5['options']);return db[_0x83f1('0x2a')][_0x83f1('0x43')](_0xa4c099)[_0x83f1('0x20')](handleEntityNotFound(_0x21b1ea,null))[_0x83f1('0x20')](respondWithResult(_0x21b1ea,null))[_0x83f1('0x40')](handleError(_0x21b1ea,null));};exports[_0x83f1('0x44')]=function(_0x434724,_0x29513a){return db[_0x83f1('0x2a')][_0x83f1('0x44')](_0x434724['body'],{})[_0x83f1('0x20')](function(_0x1b3b37){var _0x4c37cb=_0x434724['user'][_0x83f1('0x22')]({'plain':!![]});if(!_0x4c37cb)throw new Error(_0x83f1('0x45'));if(_0x4c37cb[_0x83f1('0x46')]===_0x83f1('0x47')){var _0xcc4790=_0x1b3b37[_0x83f1('0x22')]({'plain':!![]});var _0x221b37=_0x83f1('0x23');return db['UserProfileSection'][_0x83f1('0x43')]({'where':{'name':_0x221b37,'userProfileId':_0x4c37cb[_0x83f1('0x48')]},'raw':!![]})[_0x83f1('0x20')](function(_0x45ad2c){if(_0x45ad2c&&_0x45ad2c[_0x83f1('0x49')]===0x0){return db[_0x83f1('0x24')][_0x83f1('0x44')]({'name':_0xcc4790['name'],'resourceId':_0xcc4790['id'],'type':_0x45ad2c[_0x83f1('0x27')],'sectionId':_0x45ad2c['id']},{})[_0x83f1('0x20')](function(){return _0x1b3b37;});}else{return _0x1b3b37;}})[_0x83f1('0x40')](function(_0x3d9387){logger[_0x83f1('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d9387);throw _0x3d9387;});}return _0x1b3b37;})[_0x83f1('0x20')](respondWithResult(_0x29513a,0xc9))[_0x83f1('0x40')](handleError(_0x29513a,null));};exports[_0x83f1('0x4a')]=function(_0x5e27f0,_0x576262){if(_0x5e27f0[_0x83f1('0x4b')]['id']){delete _0x5e27f0['body']['id'];}return db[_0x83f1('0x2a')][_0x83f1('0x43')]({'where':{'id':_0x5e27f0[_0x83f1('0x41')]['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x576262,null))['then'](saveUpdates(_0x5e27f0[_0x83f1('0x4b')],null))['then'](respondWithResult(_0x576262,null))[_0x83f1('0x40')](handleError(_0x576262,null));};exports[_0x83f1('0x21')]=function(_0x15bdaa,_0x101a24){return db[_0x83f1('0x2a')]['find']({'where':{'id':_0x15bdaa['params']['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x101a24,null))[_0x83f1('0x20')](removeEntity(_0x101a24,null))['catch'](handleError(_0x101a24,null));};exports[_0x83f1('0x4c')]=function(_0x18ab06,_0x3ef104){return db[_0x83f1('0x2a')][_0x83f1('0x4c')]()[_0x83f1('0x20')](respondWithResult(_0x3ef104,null))[_0x83f1('0x40')](handleError(_0x3ef104,null));};exports[_0x83f1('0x4d')]=function(_0x4b7e7e,_0x2bd284,_0x23275d){var _0x2c0aab={'raw':!![],'where':{}},_0x18adb5={},_0x3dea86;return db[_0x83f1('0x2a')][_0x83f1('0x4e')]({'where':{'id':_0x4b7e7e['params']['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x2bd284,null))[_0x83f1('0x20')](function(_0x1058fa){if(_0x1058fa){_0x3dea86=_0x1058fa[_0x83f1('0x22')]({'plain':!![]});_0x18adb5[_0x83f1('0x2c')]=_[_0x83f1('0x2d')](db[_0x83f1('0x4f')][_0x83f1('0x2b')]);_0x18adb5[_0x83f1('0x2e')]=_['keys'](_0x4b7e7e[_0x83f1('0x2e')]);_0x18adb5[_0x83f1('0x2f')]=_[_0x83f1('0x30')](_0x18adb5['model'],_0x18adb5['query']);_0x2c0aab[_0x83f1('0x31')]=_[_0x83f1('0x30')](_0x18adb5['model'],qs['fields'](_0x4b7e7e['query']['fields']));_0x2c0aab[_0x83f1('0x31')]=_0x2c0aab[_0x83f1('0x31')][_0x83f1('0x33')]?_0x2c0aab[_0x83f1('0x31')]:_0x18adb5[_0x83f1('0x2c')];if(!_0x4b7e7e[_0x83f1('0x2e')][_0x83f1('0x34')]('nolimit')){_0x2c0aab['limit']=qs[_0x83f1('0x1b')](_0x4b7e7e[_0x83f1('0x2e')][_0x83f1('0x1b')]);_0x2c0aab[_0x83f1('0x1a')]=qs['offset'](_0x4b7e7e[_0x83f1('0x2e')][_0x83f1('0x1a')]);}_0x2c0aab[_0x83f1('0x50')]=qs[_0x83f1('0x35')](_0x4b7e7e[_0x83f1('0x2e')][_0x83f1('0x35')]);_0x2c0aab[_0x83f1('0x36')]=qs[_0x83f1('0x2f')](_[_0x83f1('0x37')](_0x4b7e7e[_0x83f1('0x2e')],_0x18adb5[_0x83f1('0x2f')]));_0x2c0aab[_0x83f1('0x36')][_0x83f1('0x51')]=_0x1058fa['id'];if(_0x4b7e7e[_0x83f1('0x2e')][_0x83f1('0x38')]){_0x2c0aab['where']=_[_0x83f1('0x42')](_0x2c0aab[_0x83f1('0x36')],{'$or':_[_0x83f1('0x39')](_0x2c0aab[_0x83f1('0x31')],function(_0x54115a){var _0x122864={};_0x122864[_0x54115a]={'$like':'%'+_0x4b7e7e['query'][_0x83f1('0x38')]+'%'};return _0x122864;})});}_0x2c0aab=_[_0x83f1('0x42')]({},_0x2c0aab,_0x4b7e7e['options']);return db[_0x83f1('0x4f')][_0x83f1('0x3e')](_0x2c0aab);}})['then'](function(_0x52fb41){if(_0x52fb41){return db['User'][_0x83f1('0x52')]({'where':{'id':_['map'](_0x52fb41,_0x83f1('0x53')),'role':'agent'},'attributes':['id',_0x83f1('0x27'),'mailPause',_0x83f1('0x54'),_0x83f1('0x55')]});}})[_0x83f1('0x20')](function(_0x50e4c3){if(_0x50e4c3){return{'count':_0x50e4c3[_0x83f1('0x19')],'rows':_[_0x83f1('0x39')](_0x50e4c3[_0x83f1('0x3f')],function(_0x51e1e4){return{'membername':_0x51e1e4[_0x83f1('0x27')],'UserId':_0x51e1e4['id'],'queue_name':_0x3dea86['name'],'MailQueueId':_0x3dea86['id'],'interface':util[_0x83f1('0x56')]('%s/%s',_0x83f1('0x57'),_0x51e1e4[_0x83f1('0x27')]),'penalty':0x0,'paused':_0x51e1e4[_0x83f1('0x58')],'createdAt':_0x51e1e4['createdAt'],'updatedAt':_0x51e1e4[_0x83f1('0x54')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x83f1('0x20')](respondWithFilteredResult(_0x2bd284,_0x2c0aab))[_0x83f1('0x40')](handleError(_0x2bd284,null));};exports[_0x83f1('0x59')]=function(_0x259937,_0x46365b,_0x392e96){var _0x338d91={};var _0x1306fd={};var _0x3d5c2c;var _0x51ac39;return db[_0x83f1('0x2a')]['findOne']({'where':{'id':_0x259937[_0x83f1('0x41')]['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x46365b,null))[_0x83f1('0x20')](function(_0x29ed31){if(_0x29ed31){_0x3d5c2c=_0x29ed31;_0x1306fd['model']=_[_0x83f1('0x2d')](db[_0x83f1('0x5a')]['rawAttributes']);_0x1306fd[_0x83f1('0x2e')]=_['keys'](_0x259937[_0x83f1('0x2e')]);_0x1306fd['filters']=_[_0x83f1('0x30')](_0x1306fd[_0x83f1('0x2c')],_0x1306fd[_0x83f1('0x2e')]);_0x338d91[_0x83f1('0x31')]=_[_0x83f1('0x30')](_0x1306fd[_0x83f1('0x2c')],qs['fields'](_0x259937[_0x83f1('0x2e')]['fields']));_0x338d91[_0x83f1('0x31')]=_0x338d91[_0x83f1('0x31')][_0x83f1('0x33')]?_0x338d91[_0x83f1('0x31')]:_0x1306fd[_0x83f1('0x2c')];_0x338d91[_0x83f1('0x50')]=qs[_0x83f1('0x35')](_0x259937[_0x83f1('0x2e')]['sort']);_0x338d91[_0x83f1('0x36')]=qs[_0x83f1('0x2f')](_['pick'](_0x259937['query'],_0x1306fd[_0x83f1('0x2f')]));if(_0x259937[_0x83f1('0x2e')][_0x83f1('0x38')]){_0x338d91[_0x83f1('0x36')]=_[_0x83f1('0x42')](_0x338d91[_0x83f1('0x36')],{'$or':_[_0x83f1('0x39')](_0x338d91[_0x83f1('0x31')],function(_0xf27326){var _0x1e44d9={};_0x1e44d9[_0xf27326]={'$like':'%'+_0x259937[_0x83f1('0x2e')][_0x83f1('0x38')]+'%'};return _0x1e44d9;})});}_0x338d91=_[_0x83f1('0x42')]({},_0x338d91,_0x259937[_0x83f1('0x3c')]);return _0x3d5c2c[_0x83f1('0x59')](_0x338d91);}})['then'](function(_0x40245f){if(_0x40245f){_0x51ac39=_0x40245f[_0x83f1('0x33')];if(!_0x259937[_0x83f1('0x2e')]['hasOwnProperty'](_0x83f1('0x5b'))){_0x338d91[_0x83f1('0x1b')]=qs[_0x83f1('0x1b')](_0x259937[_0x83f1('0x2e')][_0x83f1('0x1b')]);_0x338d91[_0x83f1('0x1a')]=qs[_0x83f1('0x1a')](_0x259937[_0x83f1('0x2e')]['offset']);}return _0x3d5c2c['getTeams'](_0x338d91);}})[_0x83f1('0x20')](function(_0x3bc7fe){if(_0x3bc7fe){return _0x3bc7fe?{'count':_0x51ac39,'rows':_0x3bc7fe}:null;}})[_0x83f1('0x20')](respondWithResult(_0x46365b,null))[_0x83f1('0x40')](handleError(_0x46365b,null));};exports['addTeams']=function(_0xbcb5de,_0x42deca,_0x13a35d){var _0x43f5f9=_0xbcb5de[_0x83f1('0x4b')][_0x83f1('0x5c')];return db['Team']['findAll']({'where':{'id':_[_0x83f1('0x39')](_0x43f5f9,'id')},'attributes':['id'],'include':[{'model':db[_0x83f1('0x5d')],'as':_0x83f1('0x5e'),'attributes':['id','name',_0x83f1('0x5f'),_0x83f1('0x60'),_0x83f1('0x61')],'raw':!![]}]})[_0x83f1('0x20')](function(_0x698194){if(_0x698194){var _0x44e2ca=_[_0x83f1('0x62')](_0x698194,function(_0x12b9e3){var _0x54fd0a=_0x12b9e3[_0x83f1('0x22')]({'plain':!![]});return _0x54fd0a['Agents'];});return db[_0x83f1('0x2a')][_0x83f1('0x43')]({'where':{'id':_0xbcb5de[_0x83f1('0x41')]['id']}})[_0x83f1('0x20')](function(_0x39a23d){return db['sequelize'][_0x83f1('0x63')](function(_0x49a1b6){return _0x39a23d[_0x83f1('0x64')](_[_0x83f1('0x39')](_0x43f5f9,'id'),{'transaction':_0x49a1b6})[_0x83f1('0x20')](function(){return BPromise['each'](_0x44e2ca,function(_0x3bd45c){return db['UserMailQueue'][_0x83f1('0x65')]({'where':{'UserId':_0x3bd45c['id'],'MailQueueId':_0xbcb5de['params']['id']},'transaction':_0x49a1b6});});})[_0x83f1('0x20')](function(){_0x44e2ca[_0x83f1('0x66')](function(_0x3df369){socket[_0x83f1('0x67')]('userMailQueue:save',{'UserId':_0x3df369['id'],'MailQueueId':_0x39a23d['id']});});});});});}})[_0x83f1('0x20')](respondWithStatusCode(_0x42deca,null))[_0x83f1('0x40')](handleError(_0x42deca,null));};exports[_0x83f1('0x68')]=function(_0x16be03,_0x30f517,_0xf81e54){return db[_0x83f1('0x5a')][_0x83f1('0x3e')]({'where':{'id':_0x16be03[_0x83f1('0x2e')][_0x83f1('0x69')]},'attributes':['id'],'include':[{'model':db[_0x83f1('0x5d')],'as':_0x83f1('0x5e'),'attributes':['id'],'raw':!![]}]})[_0x83f1('0x20')](handleEntityNotFound(_0x30f517,null))['then'](function(_0x2e25bf){var _0x1a8d5f=_[_0x83f1('0x39')](_0x2e25bf,'id');var _0x262dc2=[];var _0x4be267=[];var _0x71005=squel[_0x83f1('0x6a')]();_0x71005[_0x83f1('0x3b')](_0x83f1('0x6b'))[_0x83f1('0x6c')](_0x83f1('0x6d'),'tq')[_0x83f1('0x6e')](_0x83f1('0x6f'),'ut',_0x83f1('0x70'))[_0x83f1('0x36')](_0x83f1('0x71'),_0x16be03[_0x83f1('0x41')]['id']);for(var _0x151c6b=0x0;_0x151c6b<_0x2e25bf[_0x83f1('0x33')];_0x151c6b+=0x1){let _0x27915c=_0x2e25bf[_0x151c6b];for(var _0x3ea279=0x0;_0x3ea279<_0x27915c[_0x83f1('0x5e')][_0x83f1('0x33')];_0x3ea279+=0x1){let _0x352394=_0x27915c[_0x83f1('0x5e')][_0x3ea279];var _0x4e4b24=_0x71005[_0x83f1('0x72')]();_0x4e4b24['where'](_0x83f1('0x73'),_0x352394['id']);_0x4be267[_0x83f1('0x74')](db[_0x83f1('0x75')][_0x83f1('0x2e')](_0x4e4b24[_0x83f1('0x76')](),{'type':db[_0x83f1('0x75')][_0x83f1('0x77')][_0x83f1('0x78')]})['then'](function(_0x13ee43){if(_0x13ee43['length']===0x1){return _0x352394['id'];}else{var _0x509339=_[_0x83f1('0x79')](_[_0x83f1('0x39')](_0x13ee43,_0x83f1('0x7a')),function(_0x3a00be){return _['includes'](_0x1a8d5f,_0x3a00be);});if(_0x509339){return _0x352394['id'];}}}));}}return BPromise[_0x83f1('0x7b')](_0x4be267)[_0x83f1('0x20')](function(_0x5c9f1d){_0x262dc2=_(_0x262dc2)[_0x83f1('0x7c')](_0x5c9f1d)['compact']()['value']();return db['MailQueue'][_0x83f1('0x43')]({'where':{'id':_0x16be03['params']['id']}})[_0x83f1('0x20')](function(_0x2e572d){return db[_0x83f1('0x75')]['transaction'](function(_0x41687b){return _0x2e572d[_0x83f1('0x68')](_0x16be03[_0x83f1('0x2e')][_0x83f1('0x69')],{'transaction':_0x41687b})['then'](function(){if(!_['isEmpty'](_0x262dc2)){return _0x2e572d[_0x83f1('0x7d')](_0x262dc2,{'transaction':_0x41687b});}})[_0x83f1('0x20')](function(){_0x262dc2['forEach'](function(_0x4c547c){socket[_0x83f1('0x67')](_0x83f1('0x7e'),{'UserId':_0x4c547c,'MailQueueId':_0x2e572d['id']});});});});});});})[_0x83f1('0x20')](respondWithStatusCode(_0x30f517,null))[_0x83f1('0x40')](handleError(_0x30f517,null));};exports[_0x83f1('0x7f')]=function(_0x3c63bc,_0x49b9da,_0x585dfc){return db[_0x83f1('0x2a')][_0x83f1('0x43')]({'where':{'id':_0x3c63bc[_0x83f1('0x41')]['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x49b9da,null))['then'](function(_0x57a409){if(_0x57a409){return _0x57a409[_0x83f1('0x7f')](_0x3c63bc[_0x83f1('0x4b')][_0x83f1('0x69')],_[_0x83f1('0x80')](_0x3c63bc[_0x83f1('0x4b')],[_0x83f1('0x69'),'id'])||{})['spread'](function(_0x3ab763){for(var _0x52f554=0x0;_0x52f554<_0x3c63bc[_0x83f1('0x4b')][_0x83f1('0x69')]['length'];_0x52f554+=0x1){socket[_0x83f1('0x67')](_0x83f1('0x81'),{'UserId':_0x3c63bc[_0x83f1('0x4b')][_0x83f1('0x69')][_0x52f554],'MailQueueId':_0x3c63bc['params']['id']});}return _0x3ab763;});}})[_0x83f1('0x20')](respondWithResult(_0x49b9da,null))[_0x83f1('0x40')](handleError(_0x49b9da,null));};exports[_0x83f1('0x7d')]=function(_0x193037,_0x1572cb,_0x5d7363){return db[_0x83f1('0x2a')][_0x83f1('0x43')]({'where':{'id':_0x193037[_0x83f1('0x41')]['id']}})['then'](handleEntityNotFound(_0x1572cb,null))[_0x83f1('0x20')](function(_0x56f7ef){if(_0x56f7ef){return _0x56f7ef[_0x83f1('0x7d')](_0x193037['query'][_0x83f1('0x69')])['then'](function(){if(_[_0x83f1('0x82')](_0x193037[_0x83f1('0x2e')][_0x83f1('0x69')])){for(var _0x3758a7=0x0;_0x3758a7<_0x193037[_0x83f1('0x2e')][_0x83f1('0x69')]['length'];_0x3758a7+=0x1){socket[_0x83f1('0x67')](_0x83f1('0x7e'),{'UserId':Number(_0x193037[_0x83f1('0x2e')][_0x83f1('0x69')][_0x3758a7]),'MailQueueId':Number(_0x193037[_0x83f1('0x41')]['id'])});}}else{socket[_0x83f1('0x67')]('userMailQueue:remove',{'UserId':Number(_0x193037[_0x83f1('0x2e')][_0x83f1('0x69')]),'MailQueueId':Number(_0x193037['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1572cb,null))['catch'](handleError(_0x1572cb,null));};exports[_0x83f1('0x83')]=function(_0x5b324e,_0x286b92,_0x3dfce2){var _0x4960a0={};var _0x46226b={};var _0x2575a7;var _0x4c43bd;return db[_0x83f1('0x2a')][_0x83f1('0x4e')]({'where':{'id':_0x5b324e[_0x83f1('0x41')]['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x286b92,null))[_0x83f1('0x20')](function(_0x2b7751){if(_0x2b7751){_0x2575a7=_0x2b7751;_0x46226b[_0x83f1('0x2c')]=_[_0x83f1('0x2d')](db[_0x83f1('0x5d')][_0x83f1('0x2b')]);_0x46226b[_0x83f1('0x2e')]=_['keys'](_0x5b324e[_0x83f1('0x2e')]);_0x46226b[_0x83f1('0x2f')]=_['intersection'](_0x46226b[_0x83f1('0x2c')],_0x46226b[_0x83f1('0x2e')]);_0x4960a0[_0x83f1('0x31')]=_['intersection'](_0x46226b['model'],qs['fields'](_0x5b324e[_0x83f1('0x2e')]['fields']));_0x4960a0['attributes']=_0x4960a0[_0x83f1('0x31')][_0x83f1('0x33')]?_0x4960a0['attributes']:_0x46226b[_0x83f1('0x2c')];_0x4960a0[_0x83f1('0x50')]=qs[_0x83f1('0x35')](_0x5b324e['query'][_0x83f1('0x35')]);_0x4960a0[_0x83f1('0x36')]=qs[_0x83f1('0x2f')](_[_0x83f1('0x37')](_0x5b324e[_0x83f1('0x2e')],_0x46226b[_0x83f1('0x2f')]));if(_0x5b324e[_0x83f1('0x2e')]['filter']){_0x4960a0[_0x83f1('0x36')]=_[_0x83f1('0x42')](_0x4960a0[_0x83f1('0x36')],{'$or':_[_0x83f1('0x39')](_0x4960a0['attributes'],function(_0x1d7f84){var _0x9bf089={};_0x9bf089[_0x1d7f84]={'$like':'%'+_0x5b324e[_0x83f1('0x2e')][_0x83f1('0x38')]+'%'};return _0x9bf089;})});}_0x4960a0=_['merge']({},_0x4960a0,_0x5b324e[_0x83f1('0x3c')]);return _0x2575a7[_0x83f1('0x83')](_0x4960a0);}})[_0x83f1('0x20')](function(_0x483396){if(_0x483396){_0x4c43bd=_0x483396['length'];if(!_0x5b324e[_0x83f1('0x2e')][_0x83f1('0x34')](_0x83f1('0x5b'))){_0x4960a0[_0x83f1('0x1b')]=qs['limit'](_0x5b324e[_0x83f1('0x2e')]['limit']);_0x4960a0['offset']=qs['offset'](_0x5b324e[_0x83f1('0x2e')][_0x83f1('0x1a')]);}return _0x2575a7[_0x83f1('0x83')](_0x4960a0);}})[_0x83f1('0x20')](function(_0x3c1464){if(_0x3c1464){return _0x3c1464?{'count':_0x4c43bd,'rows':_0x3c1464}:null;}})[_0x83f1('0x20')](respondWithResult(_0x286b92,null))[_0x83f1('0x40')](handleError(_0x286b92,null));};
\ No newline at end of file
+var _0x8401=['papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','set','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','end','name','send','index','MailQueue','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','params','intersection','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','order','MailQueueId','options','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','teams','Agents','flatMap','transaction','findOrCreate','forEach','emit','removeTeams','Team','ids','select','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','includes','all','union','isEmpty','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','removeAgents','isArray','getAgents','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x39fb8a,_0x55cb8d){var _0x5962b0=function(_0x13a956){while(--_0x13a956){_0x39fb8a['push'](_0x39fb8a['shift']());}};_0x5962b0(++_0x55cb8d);}(_0x8401,0x109));var _0x1840=function(_0x3427b7,_0x5bc5f3){_0x3427b7=_0x3427b7-0x0;var _0xea8ea2=_0x8401[_0x3427b7];return _0xea8ea2;};'use strict';var pdf=require(_0x1840('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1840('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1840('0x2'));var rp=require('request-promise');var moment=require(_0x1840('0x3'));var BPromise=require(_0x1840('0x4'));var Mustache=require(_0x1840('0x5'));var util=require(_0x1840('0x6'));var path=require(_0x1840('0x7'));var sox=require(_0x1840('0x8'));var csv=require(_0x1840('0x9'));var ejs=require(_0x1840('0xa'));var fs=require('fs');var _=require(_0x1840('0xb'));var squel=require(_0x1840('0xc'));var crypto=require(_0x1840('0xd'));var jsforce=require(_0x1840('0xe'));var deskjs=require(_0x1840('0xf'));var toCsv=require(_0x1840('0x9'));var querystring=require(_0x1840('0x10'));var Papa=require(_0x1840('0x11'));var Redis=require('ioredis');var authService=require(_0x1840('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1840('0x13'));var logger=require(_0x1840('0x14'))('api');var utils=require(_0x1840('0x15'));var config=require(_0x1840('0x16'));var db=require(_0x1840('0x17'))['db'];config[_0x1840('0x18')]=_[_0x1840('0x19')](config[_0x1840('0x18')],{'host':_0x1840('0x1a'),'port':0x18eb});var socket=require(_0x1840('0x1b'))(new Redis(config[_0x1840('0x18')]));require(_0x1840('0x1c'))[_0x1840('0x1d')](socket);function respondWithStatusCode(_0x242cbe,_0x245682){_0x245682=_0x245682||0xcc;return function(_0x28e2bd){if(_0x28e2bd){return _0x242cbe[_0x1840('0x1e')](_0x245682);}return _0x242cbe['status'](_0x245682)['end']();};}function respondWithResult(_0x4f3375,_0x521500){_0x521500=_0x521500||0xc8;return function(_0x3d47d2){if(_0x3d47d2){return _0x4f3375[_0x1840('0x1f')](_0x521500)[_0x1840('0x20')](_0x3d47d2);}};}function respondWithFilteredResult(_0x4f6fd9,_0x31899f){return function(_0x50729a){if(_0x50729a){var _0xc4a200=_0x50729a['count'],_0x14a569=_0x31899f['offset'],_0x2f491=_0x31899f['offset']+_0x31899f['limit'],_0x41685c;if(_0x2f491>=_0xc4a200){_0x2f491=_0xc4a200;_0x41685c=0xc8;}else{_0x41685c=0xce;}_0x4f6fd9['status'](_0x41685c);return _0x4f6fd9[_0x1840('0x21')](_0x1840('0x22'),_0x14a569+'-'+_0x2f491+'/'+_0xc4a200)['json'](_0x50729a);}return null;};}function patchUpdates(_0x17e2e8){return function(_0x5b9cca){try{jsonpatch[_0x1840('0x23')](_0x5b9cca,_0x17e2e8,!![]);}catch(_0x164a4a){return BPromise[_0x1840('0x24')](_0x164a4a);}return _0x5b9cca[_0x1840('0x25')]();};}function saveUpdates(_0x29e487,_0x1a1a13){return function(_0xa0a431){if(_0xa0a431){return _0xa0a431[_0x1840('0x26')](_0x29e487)[_0x1840('0x27')](function(_0x378614){return _0x378614;});}return null;};}function removeEntity(_0x521b63,_0x53fd9e){return function(_0x3c6f48){if(_0x3c6f48){return _0x3c6f48[_0x1840('0x28')]()[_0x1840('0x27')](function(){var _0x19e125=_0x3c6f48[_0x1840('0x29')]({'plain':!![]});var _0x7cce33=_0x1840('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x7cce33,'resourceId':_0x19e125['id']}})[_0x1840('0x27')](function(){return _0x3c6f48;});})[_0x1840('0x27')](function(){_0x521b63['status'](0xcc)[_0x1840('0x2b')]();});}};}function handleEntityNotFound(_0x44a6ee,_0x316e90){return function(_0x4c46ce){if(!_0x4c46ce){_0x44a6ee['sendStatus'](0x194);}return _0x4c46ce;};}function handleError(_0x11d72a,_0x1f366b){_0x1f366b=_0x1f366b||0x1f4;return function(_0x5e7046){logger['error'](_0x5e7046['stack']);if(_0x5e7046[_0x1840('0x2c')]){delete _0x5e7046[_0x1840('0x2c')];}_0x11d72a[_0x1840('0x1f')](_0x1f366b)[_0x1840('0x2d')](_0x5e7046);};}exports[_0x1840('0x2e')]=function(_0x43103a,_0xfd3b76){var _0xc8c130={},_0x9a95b3={},_0x4fcbe9={'count':0x0,'rows':[]};var _0x38e0f0=db[_0x1840('0x2f')][_0x1840('0x30')];_0x9a95b3[_0x1840('0x31')]=_[_0x1840('0x32')](_0x38e0f0);_0x9a95b3[_0x1840('0x33')]=_[_0x1840('0x32')](_0x43103a[_0x1840('0x33')]);_0x9a95b3[_0x1840('0x34')]=_['intersection'](_0x9a95b3[_0x1840('0x31')],_0x9a95b3['query']);_0xc8c130[_0x1840('0x35')]=_['intersection'](_0x9a95b3[_0x1840('0x31')],qs[_0x1840('0x36')](_0x43103a['query']['fields']));_0xc8c130[_0x1840('0x35')]=_0xc8c130[_0x1840('0x35')][_0x1840('0x37')]?_0xc8c130[_0x1840('0x35')]:_0x9a95b3['model'];if(!_0x43103a[_0x1840('0x33')][_0x1840('0x38')](_0x1840('0x39'))){_0xc8c130['limit']=qs[_0x1840('0x3a')](_0x43103a[_0x1840('0x33')][_0x1840('0x3a')]);_0xc8c130['offset']=qs[_0x1840('0x3b')](_0x43103a['query'][_0x1840('0x3b')]);}_0xc8c130['order']=qs[_0x1840('0x3c')](_0x43103a[_0x1840('0x33')][_0x1840('0x3c')]);_0xc8c130['where']=qs[_0x1840('0x34')](_[_0x1840('0x3d')](_0x43103a[_0x1840('0x33')],_0x9a95b3[_0x1840('0x34')]));if(_0x43103a[_0x1840('0x33')][_0x1840('0x3e')]){_0xc8c130[_0x1840('0x3f')]=_[_0x1840('0x40')](_0xc8c130[_0x1840('0x3f')],{'$or':_[_0x1840('0x41')](_0x38e0f0,function(_0x3a45de){if(_0x3a45de[_0x1840('0x42')][_0x1840('0x43')]!==_0x1840('0x44')){var _0x507e25={};_0x507e25[_0x3a45de[_0x1840('0x45')]]={'$like':'%'+_0x43103a[_0x1840('0x33')][_0x1840('0x3e')]+'%'};return _0x507e25;}})});}_0xc8c130=_['merge']({},_0xc8c130,_0x43103a['options']);var _0x2b20c9={'where':_0xc8c130[_0x1840('0x3f')]};return db['MailQueue'][_0x1840('0x46')](_0x2b20c9)[_0x1840('0x27')](function(_0x5d29dd){_0x4fcbe9['count']=_0x5d29dd;if(_0x43103a[_0x1840('0x33')][_0x1840('0x47')]){_0xc8c130[_0x1840('0x48')]=[{'all':!![]}];}return db[_0x1840('0x2f')][_0x1840('0x49')](_0xc8c130);})['then'](function(_0x79a52c){_0x4fcbe9[_0x1840('0x4a')]=_0x79a52c;return _0x4fcbe9;})[_0x1840('0x27')](respondWithFilteredResult(_0xfd3b76,_0xc8c130))[_0x1840('0x4b')](handleError(_0xfd3b76,null));};exports['show']=function(_0x127cee,_0x52b4f2){var _0x2cc294={'raw':!![],'where':{'id':_0x127cee[_0x1840('0x4c')]['id']}},_0x2dee69={};_0x2dee69['model']=_['keys'](db[_0x1840('0x2f')][_0x1840('0x30')]);_0x2dee69[_0x1840('0x33')]=_[_0x1840('0x32')](_0x127cee['query']);_0x2dee69['filters']=_[_0x1840('0x4d')](_0x2dee69[_0x1840('0x31')],_0x2dee69[_0x1840('0x33')]);_0x2cc294[_0x1840('0x35')]=_[_0x1840('0x4d')](_0x2dee69[_0x1840('0x31')],qs[_0x1840('0x36')](_0x127cee[_0x1840('0x33')]['fields']));_0x2cc294[_0x1840('0x35')]=_0x2cc294[_0x1840('0x35')][_0x1840('0x37')]?_0x2cc294['attributes']:_0x2dee69[_0x1840('0x31')];if(_0x127cee[_0x1840('0x33')][_0x1840('0x47')]){_0x2cc294[_0x1840('0x48')]=[{'all':!![]}];}_0x2cc294=_['merge']({},_0x2cc294,_0x127cee['options']);return db[_0x1840('0x2f')]['find'](_0x2cc294)['then'](handleEntityNotFound(_0x52b4f2,null))[_0x1840('0x27')](respondWithResult(_0x52b4f2,null))[_0x1840('0x4b')](handleError(_0x52b4f2,null));};exports[_0x1840('0x4e')]=function(_0x961c5,_0x200a88){return db[_0x1840('0x2f')][_0x1840('0x4e')](_0x961c5[_0x1840('0x4f')],{})[_0x1840('0x27')](function(_0x582acc){var _0x1774f5=_0x961c5['user'][_0x1840('0x29')]({'plain':!![]});if(!_0x1774f5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1774f5[_0x1840('0x50')]===_0x1840('0x51')){var _0x5e65a7=_0x582acc['get']({'plain':!![]});var _0x2a7bbe='MailQueues';return db[_0x1840('0x52')][_0x1840('0x53')]({'where':{'name':_0x2a7bbe,'userProfileId':_0x1774f5[_0x1840('0x54')]},'raw':!![]})[_0x1840('0x27')](function(_0x28d9bf){if(_0x28d9bf&&_0x28d9bf[_0x1840('0x55')]===0x0){return db[_0x1840('0x56')][_0x1840('0x4e')]({'name':_0x5e65a7[_0x1840('0x2c')],'resourceId':_0x5e65a7['id'],'type':_0x28d9bf[_0x1840('0x2c')],'sectionId':_0x28d9bf['id']},{})[_0x1840('0x27')](function(){return _0x582acc;});}else{return _0x582acc;}})[_0x1840('0x4b')](function(_0x3aaf85){logger[_0x1840('0x57')](_0x1840('0x58'),_0x3aaf85);throw _0x3aaf85;});}return _0x582acc;})['then'](respondWithResult(_0x200a88,0xc9))[_0x1840('0x4b')](handleError(_0x200a88,null));};exports[_0x1840('0x26')]=function(_0xef0ac6,_0x5a5529){if(_0xef0ac6['body']['id']){delete _0xef0ac6[_0x1840('0x4f')]['id'];}return db[_0x1840('0x2f')][_0x1840('0x53')]({'where':{'id':_0xef0ac6[_0x1840('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5a5529,null))[_0x1840('0x27')](saveUpdates(_0xef0ac6[_0x1840('0x4f')],null))[_0x1840('0x27')](respondWithResult(_0x5a5529,null))[_0x1840('0x4b')](handleError(_0x5a5529,null));};exports[_0x1840('0x28')]=function(_0x281963,_0x42b2c9){return db[_0x1840('0x2f')][_0x1840('0x53')]({'where':{'id':_0x281963[_0x1840('0x4c')]['id']}})[_0x1840('0x27')](handleEntityNotFound(_0x42b2c9,null))[_0x1840('0x27')](removeEntity(_0x42b2c9,null))['catch'](handleError(_0x42b2c9,null));};exports[_0x1840('0x59')]=function(_0x15130f,_0x246e1e){return db['MailQueue'][_0x1840('0x59')]()['then'](respondWithResult(_0x246e1e,null))['catch'](handleError(_0x246e1e,null));};exports[_0x1840('0x5a')]=function(_0x45e427,_0x23eb05,_0x842a12){var _0x377545={'raw':!![],'where':{}},_0x156f98={},_0xb7e14e;return db[_0x1840('0x2f')][_0x1840('0x5b')]({'where':{'id':_0x45e427[_0x1840('0x4c')]['id']}})[_0x1840('0x27')](handleEntityNotFound(_0x23eb05,null))[_0x1840('0x27')](function(_0x39be38){if(_0x39be38){_0xb7e14e=_0x39be38['get']({'plain':!![]});_0x156f98['model']=_[_0x1840('0x32')](db[_0x1840('0x5c')][_0x1840('0x30')]);_0x156f98[_0x1840('0x33')]=_['keys'](_0x45e427[_0x1840('0x33')]);_0x156f98[_0x1840('0x34')]=_['intersection'](_0x156f98['model'],_0x156f98[_0x1840('0x33')]);_0x377545[_0x1840('0x35')]=_[_0x1840('0x4d')](_0x156f98[_0x1840('0x31')],qs[_0x1840('0x36')](_0x45e427[_0x1840('0x33')][_0x1840('0x36')]));_0x377545['attributes']=_0x377545[_0x1840('0x35')]['length']?_0x377545['attributes']:_0x156f98[_0x1840('0x31')];if(!_0x45e427[_0x1840('0x33')]['hasOwnProperty'](_0x1840('0x39'))){_0x377545['limit']=qs['limit'](_0x45e427[_0x1840('0x33')][_0x1840('0x3a')]);_0x377545[_0x1840('0x3b')]=qs[_0x1840('0x3b')](_0x45e427[_0x1840('0x33')][_0x1840('0x3b')]);}_0x377545[_0x1840('0x5d')]=qs[_0x1840('0x3c')](_0x45e427[_0x1840('0x33')][_0x1840('0x3c')]);_0x377545[_0x1840('0x3f')]=qs[_0x1840('0x34')](_[_0x1840('0x3d')](_0x45e427['query'],_0x156f98[_0x1840('0x34')]));_0x377545[_0x1840('0x3f')][_0x1840('0x5e')]=_0x39be38['id'];if(_0x45e427[_0x1840('0x33')]['filter']){_0x377545[_0x1840('0x3f')]=_['merge'](_0x377545[_0x1840('0x3f')],{'$or':_[_0x1840('0x41')](_0x377545[_0x1840('0x35')],function(_0x1030a5){var _0x5714da={};_0x5714da[_0x1030a5]={'$like':'%'+_0x45e427[_0x1840('0x33')][_0x1840('0x3e')]+'%'};return _0x5714da;})});}_0x377545=_[_0x1840('0x40')]({},_0x377545,_0x45e427[_0x1840('0x5f')]);return db['UserMailQueue'][_0x1840('0x49')](_0x377545);}})['then'](function(_0x284b08){if(_0x284b08){return db[_0x1840('0x60')][_0x1840('0x61')]({'where':{'id':_[_0x1840('0x41')](_0x284b08,_0x1840('0x62')),'role':_0x1840('0x63')},'attributes':['id',_0x1840('0x2c'),_0x1840('0x64'),_0x1840('0x65'),_0x1840('0x66')]});}})[_0x1840('0x27')](function(_0x377a9e){if(_0x377a9e){return{'count':_0x377a9e[_0x1840('0x46')],'rows':_['map'](_0x377a9e['rows'],function(_0x512c37){return{'membername':_0x512c37[_0x1840('0x2c')],'UserId':_0x512c37['id'],'queue_name':_0xb7e14e[_0x1840('0x2c')],'MailQueueId':_0xb7e14e['id'],'interface':util[_0x1840('0x67')](_0x1840('0x68'),_0x1840('0x69'),_0x512c37[_0x1840('0x2c')]),'penalty':0x0,'paused':_0x512c37['mailPause'],'createdAt':_0x512c37[_0x1840('0x66')],'updatedAt':_0x512c37[_0x1840('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1840('0x27')](respondWithFilteredResult(_0x23eb05,_0x377545))[_0x1840('0x4b')](handleError(_0x23eb05,null));};exports[_0x1840('0x6a')]=function(_0x3c8a7f,_0x2120ae,_0x5a8135){var _0x411f3e={};var _0x2262c3={};var _0x2b8217;var _0x128502;return db[_0x1840('0x2f')][_0x1840('0x5b')]({'where':{'id':_0x3c8a7f[_0x1840('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2120ae,null))[_0x1840('0x27')](function(_0x214a00){if(_0x214a00){_0x2b8217=_0x214a00;_0x2262c3[_0x1840('0x31')]=_[_0x1840('0x32')](db['Team']['rawAttributes']);_0x2262c3[_0x1840('0x33')]=_[_0x1840('0x32')](_0x3c8a7f[_0x1840('0x33')]);_0x2262c3[_0x1840('0x34')]=_[_0x1840('0x4d')](_0x2262c3['model'],_0x2262c3['query']);_0x411f3e[_0x1840('0x35')]=_['intersection'](_0x2262c3[_0x1840('0x31')],qs[_0x1840('0x36')](_0x3c8a7f['query'][_0x1840('0x36')]));_0x411f3e['attributes']=_0x411f3e[_0x1840('0x35')][_0x1840('0x37')]?_0x411f3e['attributes']:_0x2262c3[_0x1840('0x31')];_0x411f3e[_0x1840('0x5d')]=qs['sort'](_0x3c8a7f[_0x1840('0x33')][_0x1840('0x3c')]);_0x411f3e[_0x1840('0x3f')]=qs['filters'](_[_0x1840('0x3d')](_0x3c8a7f[_0x1840('0x33')],_0x2262c3['filters']));if(_0x3c8a7f['query'][_0x1840('0x3e')]){_0x411f3e['where']=_[_0x1840('0x40')](_0x411f3e[_0x1840('0x3f')],{'$or':_[_0x1840('0x41')](_0x411f3e['attributes'],function(_0x2dfa01){var _0x3a7457={};_0x3a7457[_0x2dfa01]={'$like':'%'+_0x3c8a7f[_0x1840('0x33')][_0x1840('0x3e')]+'%'};return _0x3a7457;})});}_0x411f3e=_['merge']({},_0x411f3e,_0x3c8a7f[_0x1840('0x5f')]);return _0x2b8217[_0x1840('0x6a')](_0x411f3e);}})['then'](function(_0x2f8625){if(_0x2f8625){_0x128502=_0x2f8625[_0x1840('0x37')];if(!_0x3c8a7f[_0x1840('0x33')][_0x1840('0x38')](_0x1840('0x39'))){_0x411f3e['limit']=qs[_0x1840('0x3a')](_0x3c8a7f[_0x1840('0x33')][_0x1840('0x3a')]);_0x411f3e[_0x1840('0x3b')]=qs[_0x1840('0x3b')](_0x3c8a7f[_0x1840('0x33')][_0x1840('0x3b')]);}return _0x2b8217[_0x1840('0x6a')](_0x411f3e);}})[_0x1840('0x27')](function(_0x354d77){if(_0x354d77){return _0x354d77?{'count':_0x128502,'rows':_0x354d77}:null;}})[_0x1840('0x27')](respondWithResult(_0x2120ae,null))[_0x1840('0x4b')](handleError(_0x2120ae,null));};exports[_0x1840('0x6b')]=function(_0x36eb74,_0x4aaf19,_0x14a249){var _0x30ea04=_0x36eb74[_0x1840('0x4f')][_0x1840('0x6c')];return db['Team'][_0x1840('0x49')]({'where':{'id':_[_0x1840('0x41')](_0x30ea04,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1840('0x6d'),'attributes':['id',_0x1840('0x2c'),'online','voicePause','interface'],'raw':!![]}]})[_0x1840('0x27')](function(_0x2e245a){if(_0x2e245a){var _0xb73c5a=_[_0x1840('0x6e')](_0x2e245a,function(_0x1ff68c){var _0x5819af=_0x1ff68c['get']({'plain':!![]});return _0x5819af[_0x1840('0x6d')];});return db[_0x1840('0x2f')][_0x1840('0x53')]({'where':{'id':_0x36eb74[_0x1840('0x4c')]['id']}})[_0x1840('0x27')](function(_0x4b7f0a){return db['sequelize'][_0x1840('0x6f')](function(_0x3c7d8f){return _0x4b7f0a[_0x1840('0x6b')](_[_0x1840('0x41')](_0x30ea04,'id'),{'transaction':_0x3c7d8f})[_0x1840('0x27')](function(){return BPromise['each'](_0xb73c5a,function(_0x1cd23f){return db['UserMailQueue'][_0x1840('0x70')]({'where':{'UserId':_0x1cd23f['id'],'MailQueueId':_0x36eb74[_0x1840('0x4c')]['id']},'transaction':_0x3c7d8f});});})[_0x1840('0x27')](function(){_0xb73c5a[_0x1840('0x71')](function(_0x17e240){socket[_0x1840('0x72')]('userMailQueue:save',{'UserId':_0x17e240['id'],'MailQueueId':_0x4b7f0a['id']});});});});});}})[_0x1840('0x27')](respondWithStatusCode(_0x4aaf19,null))[_0x1840('0x4b')](handleError(_0x4aaf19,null));};exports[_0x1840('0x73')]=function(_0x230676,_0x13da7a,_0x3edb48){return db[_0x1840('0x74')][_0x1840('0x49')]({'where':{'id':_0x230676[_0x1840('0x33')][_0x1840('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1840('0x27')](handleEntityNotFound(_0x13da7a,null))['then'](function(_0xb6aa){var _0x58f9c1=_[_0x1840('0x41')](_0xb6aa,'id');var _0x4ba2e4=[];var _0xbd2a3d=[];var _0x3610bf=squel[_0x1840('0x76')]();_0x3610bf[_0x1840('0x45')](_0x1840('0x77'))[_0x1840('0x78')](_0x1840('0x79'),'tq')['join'](_0x1840('0x7a'),'ut',_0x1840('0x7b'))['where'](_0x1840('0x7c'),_0x230676[_0x1840('0x4c')]['id']);for(var _0x328ae2=0x0;_0x328ae2<_0xb6aa[_0x1840('0x37')];_0x328ae2+=0x1){let _0x3b1225=_0xb6aa[_0x328ae2];for(var _0x4bc95a=0x0;_0x4bc95a<_0x3b1225[_0x1840('0x6d')][_0x1840('0x37')];_0x4bc95a+=0x1){let _0x11a23b=_0x3b1225[_0x1840('0x6d')][_0x4bc95a];var _0x1c2dc1=_0x3610bf[_0x1840('0x7d')]();_0x1c2dc1[_0x1840('0x3f')]('ut.UserId\x20=\x20?',_0x11a23b['id']);_0xbd2a3d[_0x1840('0x7e')](db[_0x1840('0x7f')][_0x1840('0x33')](_0x1c2dc1['toString'](),{'type':db['sequelize'][_0x1840('0x80')]['SELECT']})[_0x1840('0x27')](function(_0x12070d){if(_0x12070d[_0x1840('0x37')]===0x1){return _0x11a23b['id'];}else{var _0x504105=_['every'](_[_0x1840('0x41')](_0x12070d,'TeamId'),function(_0x57b443){return _[_0x1840('0x81')](_0x58f9c1,_0x57b443);});if(_0x504105){return _0x11a23b['id'];}}}));}}return BPromise[_0x1840('0x82')](_0xbd2a3d)[_0x1840('0x27')](function(_0x86a910){_0x4ba2e4=_(_0x4ba2e4)[_0x1840('0x83')](_0x86a910)['compact']()['value']();return db['MailQueue'][_0x1840('0x53')]({'where':{'id':_0x230676[_0x1840('0x4c')]['id']}})[_0x1840('0x27')](function(_0x1d6e0a){return db[_0x1840('0x7f')]['transaction'](function(_0x32ed43){return _0x1d6e0a[_0x1840('0x73')](_0x230676[_0x1840('0x33')][_0x1840('0x75')],{'transaction':_0x32ed43})[_0x1840('0x27')](function(){if(!_[_0x1840('0x84')](_0x4ba2e4)){return _0x1d6e0a['removeAgents'](_0x4ba2e4,{'transaction':_0x32ed43});}})['then'](function(){_0x4ba2e4[_0x1840('0x71')](function(_0x81c98e){socket[_0x1840('0x72')](_0x1840('0x85'),{'UserId':_0x81c98e,'MailQueueId':_0x1d6e0a['id']});});});});});});})['then'](respondWithStatusCode(_0x13da7a,null))[_0x1840('0x4b')](handleError(_0x13da7a,null));};exports[_0x1840('0x86')]=function(_0x483ce,_0x370721,_0x37b26d){return db['MailQueue'][_0x1840('0x53')]({'where':{'id':_0x483ce[_0x1840('0x4c')]['id']}})[_0x1840('0x27')](handleEntityNotFound(_0x370721,null))[_0x1840('0x27')](function(_0x2bd8a8){if(_0x2bd8a8){return _0x2bd8a8[_0x1840('0x86')](_0x483ce[_0x1840('0x4f')][_0x1840('0x75')],_[_0x1840('0x87')](_0x483ce[_0x1840('0x4f')],[_0x1840('0x75'),'id'])||{})[_0x1840('0x88')](function(_0x52d70c){for(var _0x82a146=0x0;_0x82a146<_0x483ce[_0x1840('0x4f')][_0x1840('0x75')][_0x1840('0x37')];_0x82a146+=0x1){socket['emit'](_0x1840('0x89'),{'UserId':_0x483ce[_0x1840('0x4f')][_0x1840('0x75')][_0x82a146],'MailQueueId':_0x483ce[_0x1840('0x4c')]['id']});}return _0x52d70c;});}})[_0x1840('0x27')](respondWithResult(_0x370721,null))[_0x1840('0x4b')](handleError(_0x370721,null));};exports[_0x1840('0x8a')]=function(_0x1c64a6,_0x486f2c,_0x3d1735){return db['MailQueue'][_0x1840('0x53')]({'where':{'id':_0x1c64a6[_0x1840('0x4c')]['id']}})['then'](handleEntityNotFound(_0x486f2c,null))[_0x1840('0x27')](function(_0x2bc08d){if(_0x2bc08d){return _0x2bc08d[_0x1840('0x8a')](_0x1c64a6[_0x1840('0x33')][_0x1840('0x75')])[_0x1840('0x27')](function(){if(_[_0x1840('0x8b')](_0x1c64a6['query'][_0x1840('0x75')])){for(var _0x2664b3=0x0;_0x2664b3<_0x1c64a6[_0x1840('0x33')][_0x1840('0x75')]['length'];_0x2664b3+=0x1){socket[_0x1840('0x72')]('userMailQueue:remove',{'UserId':Number(_0x1c64a6[_0x1840('0x33')]['ids'][_0x2664b3]),'MailQueueId':Number(_0x1c64a6[_0x1840('0x4c')]['id'])});}}else{socket[_0x1840('0x72')]('userMailQueue:remove',{'UserId':Number(_0x1c64a6['query'][_0x1840('0x75')]),'MailQueueId':Number(_0x1c64a6[_0x1840('0x4c')]['id'])});}});}})[_0x1840('0x27')](respondWithStatusCode(_0x486f2c,null))['catch'](handleError(_0x486f2c,null));};exports['getAgents']=function(_0x494e19,_0x57a043,_0x1def58){var _0x2fd0fb={};var _0x5258cc={};var _0x1a5c0d;var _0x1abf87;return db['MailQueue'][_0x1840('0x5b')]({'where':{'id':_0x494e19['params']['id']}})[_0x1840('0x27')](handleEntityNotFound(_0x57a043,null))[_0x1840('0x27')](function(_0x6e3de9){if(_0x6e3de9){_0x1a5c0d=_0x6e3de9;_0x5258cc[_0x1840('0x31')]=_['keys'](db[_0x1840('0x60')][_0x1840('0x30')]);_0x5258cc[_0x1840('0x33')]=_[_0x1840('0x32')](_0x494e19[_0x1840('0x33')]);_0x5258cc['filters']=_[_0x1840('0x4d')](_0x5258cc[_0x1840('0x31')],_0x5258cc[_0x1840('0x33')]);_0x2fd0fb[_0x1840('0x35')]=_[_0x1840('0x4d')](_0x5258cc[_0x1840('0x31')],qs[_0x1840('0x36')](_0x494e19[_0x1840('0x33')][_0x1840('0x36')]));_0x2fd0fb[_0x1840('0x35')]=_0x2fd0fb['attributes']['length']?_0x2fd0fb[_0x1840('0x35')]:_0x5258cc[_0x1840('0x31')];_0x2fd0fb[_0x1840('0x5d')]=qs['sort'](_0x494e19['query'][_0x1840('0x3c')]);_0x2fd0fb[_0x1840('0x3f')]=qs['filters'](_[_0x1840('0x3d')](_0x494e19[_0x1840('0x33')],_0x5258cc[_0x1840('0x34')]));if(_0x494e19[_0x1840('0x33')]['filter']){_0x2fd0fb['where']=_[_0x1840('0x40')](_0x2fd0fb[_0x1840('0x3f')],{'$or':_['map'](_0x2fd0fb['attributes'],function(_0x1fb126){var _0x217f16={};_0x217f16[_0x1fb126]={'$like':'%'+_0x494e19[_0x1840('0x33')][_0x1840('0x3e')]+'%'};return _0x217f16;})});}_0x2fd0fb=_['merge']({},_0x2fd0fb,_0x494e19[_0x1840('0x5f')]);return _0x1a5c0d[_0x1840('0x8c')](_0x2fd0fb);}})[_0x1840('0x27')](function(_0x9cbdcc){if(_0x9cbdcc){_0x1abf87=_0x9cbdcc['length'];if(!_0x494e19[_0x1840('0x33')]['hasOwnProperty']('nolimit')){_0x2fd0fb['limit']=qs[_0x1840('0x3a')](_0x494e19[_0x1840('0x33')]['limit']);_0x2fd0fb[_0x1840('0x3b')]=qs[_0x1840('0x3b')](_0x494e19['query'][_0x1840('0x3b')]);}return _0x1a5c0d['getAgents'](_0x2fd0fb);}})['then'](function(_0x2c7a79){if(_0x2c7a79){return _0x2c7a79?{'count':_0x1abf87,'rows':_0x2c7a79}:null;}})[_0x1840('0x27')](respondWithResult(_0x57a043,null))['catch'](handleError(_0x57a043,null));};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js
index c1c6aeb..3d79c05 100644
--- a/server/api/mailQueue/mailQueue.events.js
+++ b/server/api/mailQueue/mailQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcc7d=['MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x18be08,_0x1329bc){var _0x5cdf81=function(_0x5ced79){while(--_0x5ced79){_0x18be08['push'](_0x18be08['shift']());}};_0x5cdf81(++_0x1329bc);}(_0xcc7d,0x19c));var _0xdcc7=function(_0x4cc566,_0x4ac7cf){_0x4cc566=_0x4cc566-0x0;var _0x1a470a=_0xcc7d[_0x4cc566];return _0x1a470a;};'use strict';var EventEmitter=require(_0xdcc7('0x0'));var MailQueue=require(_0xdcc7('0x1'))['db'][_0xdcc7('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xdcc7('0x3')](0x0);var events={'afterCreate':_0xdcc7('0x4'),'afterUpdate':'update','afterDestroy':_0xdcc7('0x5')};function emitEvent(_0xb41c91){return function(_0x331038,_0x35fa61,_0xbccf0d){MailQueueEvents[_0xdcc7('0x6')](_0xb41c91+':'+_0x331038['id'],_0x331038);MailQueueEvents['emit'](_0xb41c91,_0x331038);_0xbccf0d(null);};}for(var e in events){if(events[_0xdcc7('0x7')](e)){var event=events[e];MailQueue[_0xdcc7('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
+var _0x74a7=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x1ec44b,_0x227baf){var _0x1c1803=function(_0x280e8d){while(--_0x280e8d){_0x1ec44b['push'](_0x1ec44b['shift']());}};_0x1c1803(++_0x227baf);}(_0x74a7,0x168));var _0x774a=function(_0x196ddf,_0x25bc41){_0x196ddf=_0x196ddf-0x0;var _0x34fedb=_0x74a7[_0x196ddf];return _0x34fedb;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x774a('0x0'))['db'][_0x774a('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x774a('0x2')](0x0);var events={'afterCreate':_0x774a('0x3'),'afterUpdate':_0x774a('0x4'),'afterDestroy':_0x774a('0x5')};function emitEvent(_0x3655a8){return function(_0x36513c,_0x2dfcc6,_0xffa7bc){MailQueueEvents[_0x774a('0x6')](_0x3655a8+':'+_0x36513c['id'],_0x36513c);MailQueueEvents[_0x774a('0x6')](_0x3655a8,_0x36513c);_0xffa7bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x774a('0x7')](e,emitEvent(event));}}module[_0x774a('0x8')]=MailQueueEvents;
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js
index a4e0a71..c69f8d8 100644
--- a/server/api/mailQueue/mailQueue.model.js
+++ b/server/api/mailQueue/mailQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['rimraf','./mailQueue.attributes','exports','define','mail_queues','../../config/logger','api','moment','bluebird','path'];(function(_0x123c05,_0x43820d){var _0x4d2410=function(_0x156d1f){while(--_0x156d1f){_0x123c05['push'](_0x123c05['shift']());}};_0x4d2410(++_0x43820d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0xcb91[_0x189305];return _0xea3406;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('MailQueue',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','../../config/logger','api'];(function(_0x4fa405,_0xc0910d){var _0x56e3f1=function(_0x5d4633){while(--_0x5d4633){_0x4fa405['push'](_0x4fa405['shift']());}};_0x56e3f1(++_0xc0910d);}(_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':!![]});};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js
index 27952c9..85e1182 100644
--- a/server/api/mailQueue/mailQueue.rpc.js
+++ b/server/api/mailQueue/mailQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x062f=['ShowMailQueue','MailQueue','find','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailQueue','findAll','options','raw','where','limit','map','include','model','attributes'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x062f,0xc7));var _0xf062=function(_0x4bbe00,_0x1d2f14){_0x4bbe00=_0x4bbe00-0x0;var _0x3999d2=_0x062f[_0x4bbe00];return _0x3999d2;};'use strict';var _=require(_0xf062('0x0'));var util=require(_0xf062('0x1'));var moment=require(_0xf062('0x2'));var BPromise=require('bluebird');var rs=require(_0xf062('0x3'));var fs=require('fs');var Redis=require(_0xf062('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf062('0x5'));var logger=require(_0xf062('0x6'))(_0xf062('0x7'));var config=require(_0xf062('0x8'));var jayson=require(_0xf062('0x9'));var client=jayson[_0xf062('0xa')][_0xf062('0xb')]({'port':0x232a});config[_0xf062('0xc')]=_['defaults'](config[_0xf062('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf062('0xd'))(new Redis(config[_0xf062('0xc')]));require(_0xf062('0xe'))[_0xf062('0xf')](socket);function respondWithRpcPromise(_0x432d2c,_0x3ae668,_0x25a875){return new BPromise(function(_0x3ca47c,_0x1d6363){return client['request'](_0x432d2c,_0x25a875)[_0xf062('0x10')](function(_0x29eef2){logger[_0xf062('0x11')](_0xf062('0x12'),_0x3ae668,_0xf062('0x13'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x3ae668,'request\x20sent',JSON[_0xf062('0x14')](_0x29eef2));if(_0x29eef2[_0xf062('0x15')]){if(_0x29eef2[_0xf062('0x15')]['code']===0x1f4){logger[_0xf062('0x15')](_0xf062('0x12'),_0x3ae668,_0x29eef2[_0xf062('0x15')][_0xf062('0x16')]);return _0x1d6363(_0x29eef2[_0xf062('0x15')][_0xf062('0x16')]);}logger[_0xf062('0x15')](_0xf062('0x12'),_0x3ae668,_0x29eef2[_0xf062('0x15')]['message']);return _0x3ca47c(_0x29eef2[_0xf062('0x15')][_0xf062('0x16')]);}else{logger['info'](_0xf062('0x12'),_0x3ae668,_0xf062('0x13'));_0x3ca47c(_0x29eef2[_0xf062('0x17')][_0xf062('0x16')]);}})[_0xf062('0x18')](function(_0x410598){logger[_0xf062('0x15')]('MailQueue,\x20%s,\x20%s',_0x3ae668,_0x410598);_0x1d6363(_0x410598);});});}exports[_0xf062('0x19')]=function(_0x35b884){var _0x29cb2b=this;return new Promise(function(_0x545b1b,_0x1914b8){return db['MailQueue'][_0xf062('0x1a')]({'raw':_0x35b884[_0xf062('0x1b')]?_0x35b884[_0xf062('0x1b')][_0xf062('0x1c')]===undefined?!![]:![]:!![],'where':_0x35b884['options']?_0x35b884[_0xf062('0x1b')][_0xf062('0x1d')]||null:null,'attributes':_0x35b884[_0xf062('0x1b')]?_0x35b884[_0xf062('0x1b')]['attributes']||null:null,'limit':_0x35b884['options']?_0x35b884['options'][_0xf062('0x1e')]||null:null,'include':_0x35b884['options']?_0x35b884[_0xf062('0x1b')]['include']?_[_0xf062('0x1f')](_0x35b884[_0xf062('0x1b')][_0xf062('0x20')],function(_0x41896b){return{'model':db[_0x41896b[_0xf062('0x21')]],'as':_0x41896b['as'],'attributes':_0x41896b[_0xf062('0x22')],'include':_0x41896b[_0xf062('0x20')]?_['map'](_0x41896b['include'],function(_0x22988f){return{'model':db[_0x22988f[_0xf062('0x21')]],'as':_0x22988f['as'],'attributes':_0x22988f[_0xf062('0x22')],'include':_0x22988f[_0xf062('0x20')]?_['map'](_0x22988f[_0xf062('0x20')],function(_0x5e796c){return{'model':db[_0x5e796c[_0xf062('0x21')]],'as':_0x5e796c['as'],'attributes':_0x5e796c[_0xf062('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf062('0x10')](function(_0x16bf0){logger[_0xf062('0x11')](_0xf062('0x19'),_0x35b884);logger['debug'](_0xf062('0x19'),_0x35b884,JSON[_0xf062('0x14')](_0x16bf0));_0x545b1b(_0x16bf0);})[_0xf062('0x18')](function(_0x6e7a18){logger['error']('GetMailQueue',_0x6e7a18[_0xf062('0x16')],_0x35b884);_0x1914b8(_0x29cb2b[_0xf062('0x15')](0x1f4,_0x6e7a18[_0xf062('0x16')]));});});};exports[_0xf062('0x23')]=function(_0x562c8e){var _0x3770d7=this;return new Promise(function(_0x492be2,_0x53eb97){return db[_0xf062('0x24')][_0xf062('0x25')]({'raw':_0x562c8e[_0xf062('0x1b')]?_0x562c8e['options'][_0xf062('0x1c')]===undefined?!![]:![]:!![],'where':_0x562c8e[_0xf062('0x1b')]?_0x562c8e[_0xf062('0x1b')][_0xf062('0x1d')]||null:null,'attributes':_0x562c8e[_0xf062('0x1b')]?_0x562c8e['options']['attributes']||null:null,'include':_0x562c8e[_0xf062('0x1b')]?_0x562c8e[_0xf062('0x1b')][_0xf062('0x20')]?_['map'](_0x562c8e[_0xf062('0x1b')]['include'],function(_0x25faa4){return{'model':db[_0x25faa4['model']],'as':_0x25faa4['as'],'attributes':_0x25faa4[_0xf062('0x22')],'include':_0x25faa4[_0xf062('0x20')]?_['map'](_0x25faa4[_0xf062('0x20')],function(_0x2bcb60){return{'model':db[_0x2bcb60[_0xf062('0x21')]],'as':_0x2bcb60['as'],'attributes':_0x2bcb60[_0xf062('0x22')],'include':_0x2bcb60[_0xf062('0x20')]?_[_0xf062('0x1f')](_0x2bcb60[_0xf062('0x20')],function(_0x4a7742){return{'model':db[_0x4a7742[_0xf062('0x21')]],'as':_0x4a7742['as'],'attributes':_0x4a7742[_0xf062('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x494997){logger[_0xf062('0x11')](_0xf062('0x23'),_0x562c8e);logger[_0xf062('0x26')](_0xf062('0x23'),_0x562c8e,JSON['stringify'](_0x494997));_0x492be2(_0x494997);})[_0xf062('0x18')](function(_0x408961){logger[_0xf062('0x15')]('ShowMailQueue',_0x408961[_0xf062('0x16')],_0x562c8e);_0x53eb97(_0x3770d7[_0xf062('0x15')](0x1f4,_0x408961[_0xf062('0x16')]));});});};
\ No newline at end of file
+var _0x3bb2=['MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','map','model','then','stringify','catch','ShowMailQueue','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x159ea3,_0x439c47){var _0x4f0957=function(_0x4ca98c){while(--_0x4ca98c){_0x159ea3['push'](_0x159ea3['shift']());}};_0x4f0957(++_0x439c47);}(_0x3bb2,0x1ee));var _0x23bb=function(_0x46ef8d,_0x3f70db){_0x46ef8d=_0x46ef8d-0x0;var _0xc63a65=_0x3bb2[_0x46ef8d];return _0xc63a65;};'use strict';var _=require(_0x23bb('0x0'));var util=require(_0x23bb('0x1'));var moment=require(_0x23bb('0x2'));var BPromise=require(_0x23bb('0x3'));var rs=require(_0x23bb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23bb('0x5'))['db'];var utils=require(_0x23bb('0x6'));var logger=require(_0x23bb('0x7'))(_0x23bb('0x8'));var config=require('../../config/environment');var jayson=require(_0x23bb('0x9'));var client=jayson[_0x23bb('0xa')][_0x23bb('0xb')]({'port':0x232a});config[_0x23bb('0xc')]=_[_0x23bb('0xd')](config[_0x23bb('0xc')],{'host':_0x23bb('0xe'),'port':0x18eb});var socket=require(_0x23bb('0xf'))(new Redis(config[_0x23bb('0xc')]));require(_0x23bb('0x10'))[_0x23bb('0x11')](socket);function respondWithRpcPromise(_0x59b7cd,_0x319b62,_0x42bcfe){return new BPromise(function(_0x59ec29,_0x46163c){return client[_0x23bb('0x12')](_0x59b7cd,_0x42bcfe)['then'](function(_0x139863){logger['info'](_0x23bb('0x13'),_0x319b62,_0x23bb('0x14'));logger[_0x23bb('0x15')](_0x23bb('0x16'),_0x319b62,_0x23bb('0x14'),JSON['stringify'](_0x139863));if(_0x139863[_0x23bb('0x17')]){if(_0x139863[_0x23bb('0x17')][_0x23bb('0x18')]===0x1f4){logger[_0x23bb('0x17')](_0x23bb('0x13'),_0x319b62,_0x139863['error'][_0x23bb('0x19')]);return _0x46163c(_0x139863['error'][_0x23bb('0x19')]);}logger[_0x23bb('0x17')](_0x23bb('0x13'),_0x319b62,_0x139863[_0x23bb('0x17')][_0x23bb('0x19')]);return _0x59ec29(_0x139863[_0x23bb('0x17')][_0x23bb('0x19')]);}else{logger[_0x23bb('0x1a')]('MailQueue,\x20%s,\x20%s',_0x319b62,'request\x20sent');_0x59ec29(_0x139863[_0x23bb('0x1b')][_0x23bb('0x19')]);}})['catch'](function(_0x4bf38c){logger[_0x23bb('0x17')](_0x23bb('0x13'),_0x319b62,_0x4bf38c);_0x46163c(_0x4bf38c);});});}exports[_0x23bb('0x1c')]=function(_0x1fb7c2){var _0x133c76=this;return new Promise(function(_0x1b340a,_0x1ee35e){return db[_0x23bb('0x1d')][_0x23bb('0x1e')]({'raw':_0x1fb7c2[_0x23bb('0x1f')]?_0x1fb7c2[_0x23bb('0x1f')][_0x23bb('0x20')]===undefined?!![]:![]:!![],'where':_0x1fb7c2[_0x23bb('0x1f')]?_0x1fb7c2[_0x23bb('0x1f')]['where']||null:null,'attributes':_0x1fb7c2[_0x23bb('0x1f')]?_0x1fb7c2[_0x23bb('0x1f')][_0x23bb('0x21')]||null:null,'limit':_0x1fb7c2[_0x23bb('0x1f')]?_0x1fb7c2['options'][_0x23bb('0x22')]||null:null,'include':_0x1fb7c2[_0x23bb('0x1f')]?_0x1fb7c2[_0x23bb('0x1f')][_0x23bb('0x23')]?_[_0x23bb('0x24')](_0x1fb7c2['options'][_0x23bb('0x23')],function(_0x4a0b43){return{'model':db[_0x4a0b43[_0x23bb('0x25')]],'as':_0x4a0b43['as'],'attributes':_0x4a0b43[_0x23bb('0x21')],'include':_0x4a0b43[_0x23bb('0x23')]?_[_0x23bb('0x24')](_0x4a0b43[_0x23bb('0x23')],function(_0x4f7fbf){return{'model':db[_0x4f7fbf[_0x23bb('0x25')]],'as':_0x4f7fbf['as'],'attributes':_0x4f7fbf[_0x23bb('0x21')],'include':_0x4f7fbf[_0x23bb('0x23')]?_[_0x23bb('0x24')](_0x4f7fbf[_0x23bb('0x23')],function(_0x47be81){return{'model':db[_0x47be81['model']],'as':_0x47be81['as'],'attributes':_0x47be81[_0x23bb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x23bb('0x26')](function(_0x5508b7){logger[_0x23bb('0x1a')](_0x23bb('0x1c'),_0x1fb7c2);logger[_0x23bb('0x15')](_0x23bb('0x1c'),_0x1fb7c2,JSON[_0x23bb('0x27')](_0x5508b7));_0x1b340a(_0x5508b7);})[_0x23bb('0x28')](function(_0x34164a){logger['error'](_0x23bb('0x1c'),_0x34164a[_0x23bb('0x19')],_0x1fb7c2);_0x1ee35e(_0x133c76[_0x23bb('0x17')](0x1f4,_0x34164a[_0x23bb('0x19')]));});});};exports[_0x23bb('0x29')]=function(_0xfcdccc){var _0x17a00c=this;return new Promise(function(_0x2f2c74,_0xbef68){return db['MailQueue']['find']({'raw':_0xfcdccc[_0x23bb('0x1f')]?_0xfcdccc[_0x23bb('0x1f')][_0x23bb('0x20')]===undefined?!![]:![]:!![],'where':_0xfcdccc[_0x23bb('0x1f')]?_0xfcdccc['options'][_0x23bb('0x2a')]||null:null,'attributes':_0xfcdccc[_0x23bb('0x1f')]?_0xfcdccc['options'][_0x23bb('0x21')]||null:null,'include':_0xfcdccc[_0x23bb('0x1f')]?_0xfcdccc[_0x23bb('0x1f')][_0x23bb('0x23')]?_[_0x23bb('0x24')](_0xfcdccc[_0x23bb('0x1f')][_0x23bb('0x23')],function(_0x1d3c61){return{'model':db[_0x1d3c61[_0x23bb('0x25')]],'as':_0x1d3c61['as'],'attributes':_0x1d3c61[_0x23bb('0x21')],'include':_0x1d3c61['include']?_[_0x23bb('0x24')](_0x1d3c61['include'],function(_0x3521b5){return{'model':db[_0x3521b5[_0x23bb('0x25')]],'as':_0x3521b5['as'],'attributes':_0x3521b5[_0x23bb('0x21')],'include':_0x3521b5[_0x23bb('0x23')]?_[_0x23bb('0x24')](_0x3521b5['include'],function(_0x38bc59){return{'model':db[_0x38bc59['model']],'as':_0x38bc59['as'],'attributes':_0x38bc59[_0x23bb('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1134bb){logger[_0x23bb('0x1a')](_0x23bb('0x29'),_0xfcdccc);logger['debug'](_0x23bb('0x29'),_0xfcdccc,JSON['stringify'](_0x1134bb));_0x2f2c74(_0x1134bb);})[_0x23bb('0x28')](function(_0x31d6c8){logger[_0x23bb('0x17')](_0x23bb('0x29'),_0x31d6c8[_0x23bb('0x19')],_0xfcdccc);_0xbef68(_0x17a00c['error'](0x1f4,_0x31d6c8[_0x23bb('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js
index 3844b0a..9230f3e 100644
--- a/server/api/mailQueue/mailQueue.socket.js
+++ b/server/api/mailQueue/mailQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcfba=['./mailQueue.events','save','remove','update','emit','removeListener','length','mailQueue:'];(function(_0x9fe71f,_0x52a7ec){var _0x1c5cc8=function(_0x9815d2){while(--_0x9815d2){_0x9fe71f['push'](_0x9fe71f['shift']());}};_0x1c5cc8(++_0x52a7ec);}(_0xcfba,0x1d0));var _0xacfb=function(_0x38537d,_0x1cbe69){_0x38537d=_0x38537d-0x0;var _0x4674e3=_0xcfba[_0x38537d];return _0x4674e3;};'use strict';var MailQueueEvents=require(_0xacfb('0x0'));var events=[_0xacfb('0x1'),_0xacfb('0x2'),_0xacfb('0x3')];function createListener(_0x214eb3,_0x19d879){return function(_0x32aa02){_0x19d879[_0xacfb('0x4')](_0x214eb3,_0x32aa02);};}function removeListener(_0x1719da,_0x105c1c){return function(){MailQueueEvents[_0xacfb('0x5')](_0x1719da,_0x105c1c);};}exports['register']=function(_0x1c34e3){for(var _0x351836=0x0,_0x1d4e7b=events[_0xacfb('0x6')];_0x351836<_0x1d4e7b;_0x351836++){var _0x4b1991=events[_0x351836];var _0x4bece8=createListener(_0xacfb('0x7')+_0x4b1991,_0x1c34e3);MailQueueEvents['on'](_0x4b1991,_0x4bece8);}};
\ No newline at end of file
+var _0xea3a=['remove','update','emit','removeListener','register','length','mailQueue:','save'];(function(_0x41ee92,_0xabb585){var _0x1333a7=function(_0x4f7b77){while(--_0x4f7b77){_0x41ee92['push'](_0x41ee92['shift']());}};_0x1333a7(++_0xabb585);}(_0xea3a,0x87));var _0xaea3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xea3a[_0x59ee6f];return _0x4c0979;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xaea3('0x0'),_0xaea3('0x1'),_0xaea3('0x2')];function createListener(_0x796fc0,_0x2ac86c){return function(_0x287670){_0x2ac86c[_0xaea3('0x3')](_0x796fc0,_0x287670);};}function removeListener(_0x4e3d25,_0x350011){return function(){MailQueueEvents[_0xaea3('0x4')](_0x4e3d25,_0x350011);};}exports[_0xaea3('0x5')]=function(_0x12bb0e){for(var _0x317c36=0x0,_0x1274d6=events[_0xaea3('0x6')];_0x317c36<_0x1274d6;_0x317c36++){var _0x339b5e=events[_0x317c36];var _0x4e4614=createListener(_0xaea3('0x7')+_0x339b5e,_0x12bb0e);MailQueueEvents['on'](_0x339b5e,_0x4e4614);}};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js
index df7c868..eae0ef7 100644
--- a/server/api/mailQueueReport/index.js
+++ b/server/api/mailQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd17d=['../../config/environment','./mailQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','put','update','multer','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x10afad,_0x30da9d){var _0x588d7e=function(_0x25e897){while(--_0x25e897){_0x10afad['push'](_0x10afad['shift']());}};_0x588d7e(++_0x30da9d);}(_0xd17d,0x93));var _0xdd17=function(_0x26d784,_0xf08b74){_0x26d784=_0x26d784-0x0;var _0x5d131d=_0xd17d[_0x26d784];return _0x5d131d;};'use strict';var multer=require(_0xdd17('0x0'));var util=require(_0xdd17('0x1'));var path=require(_0xdd17('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdd17('0x3')]();var auth=require(_0xdd17('0x4'));var interaction=require(_0xdd17('0x5'));var config=require(_0xdd17('0x6'));var controller=require(_0xdd17('0x7'));router[_0xdd17('0x8')]('/',auth['isAuthenticated'](),controller[_0xdd17('0x9')]);router[_0xdd17('0x8')](_0xdd17('0xa'),auth['isAuthenticated'](),controller[_0xdd17('0xb')]);router[_0xdd17('0x8')](_0xdd17('0xc'),auth[_0xdd17('0xd')](),controller[_0xdd17('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdd17('0xf')](_0xdd17('0xc'),auth[_0xdd17('0xd')](),controller[_0xdd17('0x10')]);router['delete'](_0xdd17('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xde1a=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xde1a,0x113));var _0xade1=function(_0x47ac98,_0x55f471){_0x47ac98=_0x47ac98-0x0;var _0x119e42=_0xde1a[_0x47ac98];return _0x119e42;};'use strict';var multer=require(_0xade1('0x0'));var util=require(_0xade1('0x1'));var path=require(_0xade1('0x2'));var timeout=require(_0xade1('0x3'));var express=require(_0xade1('0x4'));var router=express[_0xade1('0x5')]();var auth=require(_0xade1('0x6'));var interaction=require(_0xade1('0x7'));var config=require(_0xade1('0x8'));var controller=require(_0xade1('0x9'));router['get']('/',auth[_0xade1('0xa')](),controller[_0xade1('0xb')]);router[_0xade1('0xc')](_0xade1('0xd'),auth[_0xade1('0xa')](),controller[_0xade1('0xe')]);router[_0xade1('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xade1('0xf')]);router[_0xade1('0x10')]('/',auth[_0xade1('0xa')](),controller['create']);router[_0xade1('0x11')](_0xade1('0x12'),auth[_0xade1('0xa')](),controller[_0xade1('0x13')]);router[_0xade1('0x14')](_0xade1('0x12'),auth[_0xade1('0xa')](),controller[_0xade1('0x15')]);module[_0xade1('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js
index 936c6d7..a901457 100644
--- a/server/api/mailQueueReport/mailQueueReport.attributes.js
+++ b/server/api/mailQueueReport/mailQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc30f=['moment','sequelize','exports','STRING','DATE'];(function(_0x495d55,_0x29ced0){var _0x477849=function(_0xeb718c){while(--_0xeb718c){_0x495d55['push'](_0x495d55['shift']());}};_0x477849(++_0x29ced0);}(_0xc30f,0x159));var _0xfc30=function(_0x10a827,_0x381036){_0x10a827=_0x10a827-0x0;var _0x28803a=_0xc30f[_0x10a827];return _0x28803a;};'use strict';var moment=require(_0xfc30('0x0'));var Sequelize=require(_0xfc30('0x1'));module[_0xfc30('0x2')]={'uniqueid':{'type':Sequelize[_0xfc30('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfc30('0x3')]},'joinAt':{'type':Sequelize[_0xfc30('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfc30('0x4')]},'exitAt':{'type':Sequelize[_0xfc30('0x4')]},'reason':{'type':Sequelize[_0xfc30('0x3')]}};
\ No newline at end of file
+var _0x4e47=['sequelize','STRING','DATE'];(function(_0x4c6357,_0x1c1909){var _0x3199ee=function(_0x1d3ad1){while(--_0x1d3ad1){_0x4c6357['push'](_0x4c6357['shift']());}};_0x3199ee(++_0x1c1909);}(_0x4e47,0x7e));var _0x74e4=function(_0x2614eb,_0x1be322){_0x2614eb=_0x2614eb-0x0;var _0x5aa1c1=_0x4e47[_0x2614eb];return _0x5aa1c1;};'use strict';var moment=require('moment');var Sequelize=require(_0x74e4('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x74e4('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x74e4('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x74e4('0x2')]},'exitAt':{'type':Sequelize[_0x74e4('0x2')]},'reason':{'type':Sequelize[_0x74e4('0x1')]}};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js
index 5e4f9b0..d19a810 100644
--- a/server/api/mailQueueReport/mailQueueReport.controller.js
+++ b/server/api/mailQueueReport/mailQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ae7=['reject','save','update','then','destroy','error','name','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','MailQueueReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x282a8e,_0x26fa64){var _0x3e7d2d=function(_0x20436c){while(--_0x20436c){_0x282a8e['push'](_0x282a8e['shift']());}};_0x3e7d2d(++_0x26fa64);}(_0x8ae7,0x1e4));var _0x78ae=function(_0x13047e,_0xbf0fbe){_0x13047e=_0x13047e-0x0;var _0x1e2602=_0x8ae7[_0x13047e];return _0x1e2602;};'use strict';var pdf=require(_0x78ae('0x0'));var emlformat=require(_0x78ae('0x1'));var rimraf=require(_0x78ae('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x78ae('0x3'));var rp=require(_0x78ae('0x4'));var moment=require(_0x78ae('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x78ae('0x6'));var path=require(_0x78ae('0x7'));var sox=require(_0x78ae('0x8'));var csv=require(_0x78ae('0x9'));var ejs=require(_0x78ae('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x78ae('0xb'));var crypto=require(_0x78ae('0xc'));var jsforce=require(_0x78ae('0xd'));var deskjs=require(_0x78ae('0xe'));var toCsv=require(_0x78ae('0x9'));var querystring=require(_0x78ae('0xf'));var Papa=require(_0x78ae('0x10'));var Redis=require(_0x78ae('0x11'));var authService=require(_0x78ae('0x12'));var qs=require(_0x78ae('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x78ae('0x14'));var utils=require(_0x78ae('0x15'));var config=require(_0x78ae('0x16'));var db=require(_0x78ae('0x17'))['db'];function respondWithStatusCode(_0x264fb8,_0x2f665d){_0x2f665d=_0x2f665d||0xcc;return function(_0x110a00){if(_0x110a00){return _0x264fb8[_0x78ae('0x18')](_0x2f665d);}return _0x264fb8[_0x78ae('0x19')](_0x2f665d)[_0x78ae('0x1a')]();};}function respondWithResult(_0x2ec98f,_0x5e3dc6){_0x5e3dc6=_0x5e3dc6||0xc8;return function(_0x442dd3){if(_0x442dd3){return _0x2ec98f[_0x78ae('0x19')](_0x5e3dc6)[_0x78ae('0x1b')](_0x442dd3);}};}function respondWithFilteredResult(_0x19c095,_0x261e8c){return function(_0x53f6ac){if(_0x53f6ac){var _0x396d1b=_0x53f6ac[_0x78ae('0x1c')],_0x4c396a=_0x261e8c[_0x78ae('0x1d')],_0x1b42a9=_0x261e8c[_0x78ae('0x1d')]+_0x261e8c[_0x78ae('0x1e')],_0x43e93a;if(_0x1b42a9>=_0x396d1b){_0x1b42a9=_0x396d1b;_0x43e93a=0xc8;}else{_0x43e93a=0xce;}_0x19c095[_0x78ae('0x19')](_0x43e93a);return _0x19c095[_0x78ae('0x1f')](_0x78ae('0x20'),_0x4c396a+'-'+_0x1b42a9+'/'+_0x396d1b)[_0x78ae('0x1b')](_0x53f6ac);}return null;};}function patchUpdates(_0x339a5c){return function(_0x39a22f){try{jsonpatch[_0x78ae('0x21')](_0x39a22f,_0x339a5c,!![]);}catch(_0x217ca4){return BPromise[_0x78ae('0x22')](_0x217ca4);}return _0x39a22f[_0x78ae('0x23')]();};}function saveUpdates(_0xc6699f,_0xf1c506){return function(_0x2f9b97){if(_0x2f9b97){return _0x2f9b97[_0x78ae('0x24')](_0xc6699f)[_0x78ae('0x25')](function(_0x30ca02){return _0x30ca02;});}return null;};}function removeEntity(_0x4b136a,_0x2bab1f){return function(_0x3cadfe){if(_0x3cadfe){return _0x3cadfe[_0x78ae('0x26')]()[_0x78ae('0x25')](function(){_0x4b136a[_0x78ae('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa076,_0x283a06){return function(_0x214eb7){if(!_0x214eb7){_0x3fa076[_0x78ae('0x18')](0x194);}return _0x214eb7;};}function handleError(_0x1d261f,_0x19cfd3){_0x19cfd3=_0x19cfd3||0x1f4;return function(_0x16c9b1){logger[_0x78ae('0x27')](_0x16c9b1['stack']);if(_0x16c9b1['name']){delete _0x16c9b1[_0x78ae('0x28')];}_0x1d261f['status'](_0x19cfd3)['send'](_0x16c9b1);};}exports[_0x78ae('0x29')]=function(_0x4c6247,_0xea3b70){var _0x13ffeb={},_0x541cd3={},_0xb21125={'count':0x0,'rows':[]};var _0x499300=db['MailQueueReport'][_0x78ae('0x2a')];_0x541cd3[_0x78ae('0x2b')]=_[_0x78ae('0x2c')](_0x499300);_0x541cd3[_0x78ae('0x2d')]=_[_0x78ae('0x2c')](_0x4c6247[_0x78ae('0x2d')]);_0x541cd3['filters']=_[_0x78ae('0x2e')](_0x541cd3[_0x78ae('0x2b')],_0x541cd3[_0x78ae('0x2d')]);_0x13ffeb[_0x78ae('0x2f')]=_['intersection'](_0x541cd3[_0x78ae('0x2b')],qs[_0x78ae('0x30')](_0x4c6247['query']['fields']));_0x13ffeb[_0x78ae('0x2f')]=_0x13ffeb[_0x78ae('0x2f')][_0x78ae('0x31')]?_0x13ffeb[_0x78ae('0x2f')]:_0x541cd3[_0x78ae('0x2b')];if(!_0x4c6247[_0x78ae('0x2d')][_0x78ae('0x32')](_0x78ae('0x33'))){_0x13ffeb[_0x78ae('0x1e')]=qs[_0x78ae('0x1e')](_0x4c6247[_0x78ae('0x2d')]['limit']);_0x13ffeb[_0x78ae('0x1d')]=qs[_0x78ae('0x1d')](_0x4c6247[_0x78ae('0x2d')][_0x78ae('0x1d')]);}_0x13ffeb['order']=qs[_0x78ae('0x34')](_0x4c6247[_0x78ae('0x2d')][_0x78ae('0x34')]);_0x13ffeb[_0x78ae('0x35')]=qs[_0x78ae('0x36')](_[_0x78ae('0x37')](_0x4c6247[_0x78ae('0x2d')],_0x541cd3[_0x78ae('0x36')]));if(_0x4c6247['query'][_0x78ae('0x38')]){_0x13ffeb[_0x78ae('0x35')]=_[_0x78ae('0x39')](_0x13ffeb[_0x78ae('0x35')],{'$or':_[_0x78ae('0x3a')](_0x499300,function(_0xf3f6c9){if(_0xf3f6c9[_0x78ae('0x3b')][_0x78ae('0x3c')]!==_0x78ae('0x3d')){var _0x35ebbd={};_0x35ebbd[_0xf3f6c9['field']]={'$like':'%'+_0x4c6247[_0x78ae('0x2d')]['filter']+'%'};return _0x35ebbd;}})});}_0x13ffeb=_['merge']({},_0x13ffeb,_0x4c6247[_0x78ae('0x3e')]);var _0x1b5b9f={'where':_0x13ffeb[_0x78ae('0x35')]};return db[_0x78ae('0x3f')][_0x78ae('0x1c')](_0x1b5b9f)[_0x78ae('0x25')](function(_0x434f24){_0xb21125[_0x78ae('0x1c')]=_0x434f24;if(_0x4c6247[_0x78ae('0x2d')][_0x78ae('0x40')]){_0x13ffeb[_0x78ae('0x41')]=[{'all':!![]}];}return db[_0x78ae('0x3f')][_0x78ae('0x42')](_0x13ffeb);})[_0x78ae('0x25')](function(_0x3b906a){_0xb21125[_0x78ae('0x43')]=_0x3b906a;return _0xb21125;})[_0x78ae('0x25')](respondWithFilteredResult(_0xea3b70,_0x13ffeb))[_0x78ae('0x44')](handleError(_0xea3b70,null));};exports['show']=function(_0x44a2ae,_0x4f98b1){var _0x3f9998={'raw':!![],'where':{'id':_0x44a2ae[_0x78ae('0x45')]['id']}},_0x3f67c5={};_0x3f67c5[_0x78ae('0x2b')]=_[_0x78ae('0x2c')](db[_0x78ae('0x3f')]['rawAttributes']);_0x3f67c5[_0x78ae('0x2d')]=_['keys'](_0x44a2ae[_0x78ae('0x2d')]);_0x3f67c5['filters']=_[_0x78ae('0x2e')](_0x3f67c5[_0x78ae('0x2b')],_0x3f67c5[_0x78ae('0x2d')]);_0x3f9998[_0x78ae('0x2f')]=_[_0x78ae('0x2e')](_0x3f67c5[_0x78ae('0x2b')],qs[_0x78ae('0x30')](_0x44a2ae[_0x78ae('0x2d')][_0x78ae('0x30')]));_0x3f9998[_0x78ae('0x2f')]=_0x3f9998[_0x78ae('0x2f')][_0x78ae('0x31')]?_0x3f9998['attributes']:_0x3f67c5['model'];if(_0x44a2ae[_0x78ae('0x2d')][_0x78ae('0x40')]){_0x3f9998[_0x78ae('0x41')]=[{'all':!![]}];}_0x3f9998=_[_0x78ae('0x39')]({},_0x3f9998,_0x44a2ae[_0x78ae('0x3e')]);return db[_0x78ae('0x3f')][_0x78ae('0x46')](_0x3f9998)[_0x78ae('0x25')](handleEntityNotFound(_0x4f98b1,null))[_0x78ae('0x25')](respondWithResult(_0x4f98b1,null))[_0x78ae('0x44')](handleError(_0x4f98b1,null));};exports[_0x78ae('0x47')]=function(_0x1b42ee,_0x528a65){return db['MailQueueReport'][_0x78ae('0x47')](_0x1b42ee[_0x78ae('0x48')],{})[_0x78ae('0x25')](respondWithResult(_0x528a65,0xc9))[_0x78ae('0x44')](handleError(_0x528a65,null));};exports[_0x78ae('0x24')]=function(_0x4ceb84,_0x5156cc){if(_0x4ceb84['body']['id']){delete _0x4ceb84[_0x78ae('0x48')]['id'];}return db[_0x78ae('0x3f')]['find']({'where':{'id':_0x4ceb84[_0x78ae('0x45')]['id']}})[_0x78ae('0x25')](handleEntityNotFound(_0x5156cc,null))[_0x78ae('0x25')](saveUpdates(_0x4ceb84[_0x78ae('0x48')],null))[_0x78ae('0x25')](respondWithResult(_0x5156cc,null))[_0x78ae('0x44')](handleError(_0x5156cc,null));};exports[_0x78ae('0x26')]=function(_0x585224,_0xa0b276){return db['MailQueueReport'][_0x78ae('0x46')]({'where':{'id':_0x585224[_0x78ae('0x45')]['id']}})[_0x78ae('0x25')](handleEntityNotFound(_0xa0b276,null))['then'](removeEntity(_0xa0b276,null))[_0x78ae('0x44')](handleError(_0xa0b276,null));};exports[_0x78ae('0x49')]=function(_0x4a2664,_0x3e7cdd){return db[_0x78ae('0x3f')][_0x78ae('0x49')]()['then'](respondWithResult(_0x3e7cdd,null))[_0x78ae('0x44')](handleError(_0x3e7cdd,null));};
\ No newline at end of file
+var _0x4f5d=['create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','MailQueueReport','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','sort','where','filters','pick','filter','merge','key','VIRTUAL','findAll','catch','show','rawAttributes','find'];(function(_0x3b3ce1,_0x300eb4){var _0x3a78a5=function(_0x40d4c6){while(--_0x40d4c6){_0x3b3ce1['push'](_0x3b3ce1['shift']());}};_0x3a78a5(++_0x300eb4);}(_0x4f5d,0x1e7));var _0xd4f5=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4f5d[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0xd4f5('0x0'));var emlformat=require(_0xd4f5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd4f5('0x2'));var jsonpatch=require(_0xd4f5('0x3'));var rp=require(_0xd4f5('0x4'));var moment=require(_0xd4f5('0x5'));var BPromise=require(_0xd4f5('0x6'));var Mustache=require(_0xd4f5('0x7'));var util=require('util');var path=require(_0xd4f5('0x8'));var sox=require('sox');var csv=require(_0xd4f5('0x9'));var ejs=require(_0xd4f5('0xa'));var fs=require('fs');var _=require(_0xd4f5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd4f5('0xc'));var deskjs=require(_0xd4f5('0xd'));var toCsv=require(_0xd4f5('0x9'));var querystring=require(_0xd4f5('0xe'));var Papa=require(_0xd4f5('0xf'));var Redis=require(_0xd4f5('0x10'));var authService=require(_0xd4f5('0x11'));var qs=require(_0xd4f5('0x12'));var hardwareService=require(_0xd4f5('0x13'));var logger=require(_0xd4f5('0x14'))(_0xd4f5('0x15'));var utils=require(_0xd4f5('0x16'));var config=require(_0xd4f5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1151f8,_0x31d4e2){_0x31d4e2=_0x31d4e2||0xcc;return function(_0x2db1ac){if(_0x2db1ac){return _0x1151f8['sendStatus'](_0x31d4e2);}return _0x1151f8[_0xd4f5('0x18')](_0x31d4e2)[_0xd4f5('0x19')]();};}function respondWithResult(_0x28a1f8,_0x135776){_0x135776=_0x135776||0xc8;return function(_0x163545){if(_0x163545){return _0x28a1f8[_0xd4f5('0x18')](_0x135776)[_0xd4f5('0x1a')](_0x163545);}};}function respondWithFilteredResult(_0x1aafbb,_0x46f82a){return function(_0xf95e4){if(_0xf95e4){var _0x2b7705=_0xf95e4[_0xd4f5('0x1b')],_0xabca67=_0x46f82a['offset'],_0x50ceac=_0x46f82a['offset']+_0x46f82a['limit'],_0x4e4609;if(_0x50ceac>=_0x2b7705){_0x50ceac=_0x2b7705;_0x4e4609=0xc8;}else{_0x4e4609=0xce;}_0x1aafbb[_0xd4f5('0x18')](_0x4e4609);return _0x1aafbb[_0xd4f5('0x1c')]('Content-Range',_0xabca67+'-'+_0x50ceac+'/'+_0x2b7705)[_0xd4f5('0x1a')](_0xf95e4);}return null;};}function patchUpdates(_0x1f988a){return function(_0x129288){try{jsonpatch[_0xd4f5('0x1d')](_0x129288,_0x1f988a,!![]);}catch(_0x249b8f){return BPromise[_0xd4f5('0x1e')](_0x249b8f);}return _0x129288[_0xd4f5('0x1f')]();};}function saveUpdates(_0x4b92de,_0x4c9cf4){return function(_0x16129b){if(_0x16129b){return _0x16129b[_0xd4f5('0x20')](_0x4b92de)[_0xd4f5('0x21')](function(_0x599f34){return _0x599f34;});}return null;};}function removeEntity(_0x30f7f3,_0x263eba){return function(_0xdb847c){if(_0xdb847c){return _0xdb847c[_0xd4f5('0x22')]()[_0xd4f5('0x21')](function(){_0x30f7f3[_0xd4f5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x859c89,_0x311540){return function(_0x29141a){if(!_0x29141a){_0x859c89[_0xd4f5('0x23')](0x194);}return _0x29141a;};}function handleError(_0x9185cc,_0x1c1d87){_0x1c1d87=_0x1c1d87||0x1f4;return function(_0x34ef14){logger[_0xd4f5('0x24')](_0x34ef14[_0xd4f5('0x25')]);if(_0x34ef14[_0xd4f5('0x26')]){delete _0x34ef14[_0xd4f5('0x26')];}_0x9185cc[_0xd4f5('0x18')](_0x1c1d87)['send'](_0x34ef14);};}exports[_0xd4f5('0x27')]=function(_0x17314e,_0x29f1dc){var _0x3c4935={},_0x10148c={},_0x3d712f={'count':0x0,'rows':[]};var _0x396d3e=db[_0xd4f5('0x28')]['rawAttributes'];_0x10148c[_0xd4f5('0x29')]=_[_0xd4f5('0x2a')](_0x396d3e);_0x10148c[_0xd4f5('0x2b')]=_[_0xd4f5('0x2a')](_0x17314e[_0xd4f5('0x2b')]);_0x10148c['filters']=_[_0xd4f5('0x2c')](_0x10148c[_0xd4f5('0x29')],_0x10148c['query']);_0x3c4935['attributes']=_[_0xd4f5('0x2c')](_0x10148c[_0xd4f5('0x29')],qs[_0xd4f5('0x2d')](_0x17314e[_0xd4f5('0x2b')]['fields']));_0x3c4935[_0xd4f5('0x2e')]=_0x3c4935[_0xd4f5('0x2e')][_0xd4f5('0x2f')]?_0x3c4935['attributes']:_0x10148c[_0xd4f5('0x29')];if(!_0x17314e[_0xd4f5('0x2b')][_0xd4f5('0x30')](_0xd4f5('0x31'))){_0x3c4935[_0xd4f5('0x32')]=qs[_0xd4f5('0x32')](_0x17314e[_0xd4f5('0x2b')][_0xd4f5('0x32')]);_0x3c4935[_0xd4f5('0x33')]=qs[_0xd4f5('0x33')](_0x17314e[_0xd4f5('0x2b')]['offset']);}_0x3c4935['order']=qs[_0xd4f5('0x34')](_0x17314e['query'][_0xd4f5('0x34')]);_0x3c4935[_0xd4f5('0x35')]=qs[_0xd4f5('0x36')](_[_0xd4f5('0x37')](_0x17314e['query'],_0x10148c[_0xd4f5('0x36')]));if(_0x17314e[_0xd4f5('0x2b')][_0xd4f5('0x38')]){_0x3c4935['where']=_[_0xd4f5('0x39')](_0x3c4935[_0xd4f5('0x35')],{'$or':_['map'](_0x396d3e,function(_0x3c3446){if(_0x3c3446['type'][_0xd4f5('0x3a')]!==_0xd4f5('0x3b')){var _0x22829d={};_0x22829d[_0x3c3446['field']]={'$like':'%'+_0x17314e[_0xd4f5('0x2b')][_0xd4f5('0x38')]+'%'};return _0x22829d;}})});}_0x3c4935=_['merge']({},_0x3c4935,_0x17314e['options']);var _0x5cfe0c={'where':_0x3c4935[_0xd4f5('0x35')]};return db['MailQueueReport'][_0xd4f5('0x1b')](_0x5cfe0c)[_0xd4f5('0x21')](function(_0x26aedb){_0x3d712f[_0xd4f5('0x1b')]=_0x26aedb;if(_0x17314e[_0xd4f5('0x2b')]['includeAll']){_0x3c4935['include']=[{'all':!![]}];}return db[_0xd4f5('0x28')][_0xd4f5('0x3c')](_0x3c4935);})[_0xd4f5('0x21')](function(_0x3208c9){_0x3d712f['rows']=_0x3208c9;return _0x3d712f;})['then'](respondWithFilteredResult(_0x29f1dc,_0x3c4935))[_0xd4f5('0x3d')](handleError(_0x29f1dc,null));};exports[_0xd4f5('0x3e')]=function(_0xf74fc6,_0x28f849){var _0x1e1fcc={'raw':!![],'where':{'id':_0xf74fc6['params']['id']}},_0x19fdd5={};_0x19fdd5['model']=_[_0xd4f5('0x2a')](db[_0xd4f5('0x28')][_0xd4f5('0x3f')]);_0x19fdd5[_0xd4f5('0x2b')]=_[_0xd4f5('0x2a')](_0xf74fc6[_0xd4f5('0x2b')]);_0x19fdd5[_0xd4f5('0x36')]=_['intersection'](_0x19fdd5['model'],_0x19fdd5[_0xd4f5('0x2b')]);_0x1e1fcc[_0xd4f5('0x2e')]=_[_0xd4f5('0x2c')](_0x19fdd5[_0xd4f5('0x29')],qs[_0xd4f5('0x2d')](_0xf74fc6[_0xd4f5('0x2b')][_0xd4f5('0x2d')]));_0x1e1fcc[_0xd4f5('0x2e')]=_0x1e1fcc[_0xd4f5('0x2e')][_0xd4f5('0x2f')]?_0x1e1fcc[_0xd4f5('0x2e')]:_0x19fdd5[_0xd4f5('0x29')];if(_0xf74fc6['query']['includeAll']){_0x1e1fcc['include']=[{'all':!![]}];}_0x1e1fcc=_[_0xd4f5('0x39')]({},_0x1e1fcc,_0xf74fc6['options']);return db['MailQueueReport'][_0xd4f5('0x40')](_0x1e1fcc)[_0xd4f5('0x21')](handleEntityNotFound(_0x28f849,null))[_0xd4f5('0x21')](respondWithResult(_0x28f849,null))['catch'](handleError(_0x28f849,null));};exports[_0xd4f5('0x41')]=function(_0x2ae67c,_0x46029c){return db[_0xd4f5('0x28')][_0xd4f5('0x41')](_0x2ae67c[_0xd4f5('0x42')],{})['then'](respondWithResult(_0x46029c,0xc9))['catch'](handleError(_0x46029c,null));};exports[_0xd4f5('0x20')]=function(_0x434b6b,_0x8b9197){if(_0x434b6b[_0xd4f5('0x42')]['id']){delete _0x434b6b[_0xd4f5('0x42')]['id'];}return db[_0xd4f5('0x28')]['find']({'where':{'id':_0x434b6b[_0xd4f5('0x43')]['id']}})[_0xd4f5('0x21')](handleEntityNotFound(_0x8b9197,null))[_0xd4f5('0x21')](saveUpdates(_0x434b6b[_0xd4f5('0x42')],null))[_0xd4f5('0x21')](respondWithResult(_0x8b9197,null))[_0xd4f5('0x3d')](handleError(_0x8b9197,null));};exports['destroy']=function(_0x467cfa,_0x4895db){return db[_0xd4f5('0x28')][_0xd4f5('0x40')]({'where':{'id':_0x467cfa['params']['id']}})[_0xd4f5('0x21')](handleEntityNotFound(_0x4895db,null))[_0xd4f5('0x21')](removeEntity(_0x4895db,null))[_0xd4f5('0x3d')](handleError(_0x4895db,null));};exports[_0xd4f5('0x44')]=function(_0x389b0d,_0x560c23){return db[_0xd4f5('0x28')]['describe']()[_0xd4f5('0x21')](respondWithResult(_0x560c23,null))[_0xd4f5('0x3d')](handleError(_0x560c23,null));};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js
index 5233c1c..863cc6b 100644
--- a/server/api/mailQueueReport/mailQueueReport.model.js
+++ b/server/api/mailQueueReport/mailQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xea5b=['report_mail_queue','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','define','MailQueueReport'];(function(_0x2edda2,_0x512dd4){var _0xa51ae1=function(_0x1aff8b){while(--_0x1aff8b){_0x2edda2['push'](_0x2edda2['shift']());}};_0xa51ae1(++_0x512dd4);}(_0xea5b,0x152));var _0xbea5=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xea5b[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xbea5('0x0'));var util=require(_0xbea5('0x1'));var logger=require(_0xbea5('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbea5('0x3'));var rp=require(_0xbea5('0x4'));var fs=require('fs');var path=require(_0xbea5('0x5'));var rimraf=require(_0xbea5('0x6'));var config=require('../../config/environment');var attributes=require(_0xbea5('0x7'));module['exports']=function(_0x2db67a,_0x3d9263){return _0x2db67a[_0xbea5('0x8')](_0xbea5('0x9'),attributes,{'tableName':_0xbea5('0xa'),'paranoid':![],'indexes':[{'name':_0xbea5('0xb'),'fields':[_0xbea5('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe1e3=['MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x5bd89b,_0x36c06c){var _0x34c740=function(_0x56404f){while(--_0x56404f){_0x5bd89b['push'](_0x5bd89b['shift']());}};_0x34c740(++_0x36c06c);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x5148ac,_0x5b6f45){_0x5148ac=_0x5148ac-0x0;var _0x48dbd7=_0xe1e3[_0x5148ac];return _0x48dbd7;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var logger=require('../../config/logger')(_0x3e1e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3e1e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e1e('0x4'));var config=require(_0x3e1e('0x5'));var attributes=require(_0x3e1e('0x6'));module[_0x3e1e('0x7')]=function(_0x40d6d8,_0x25701f){return _0x40d6d8['define'](_0x3e1e('0x8'),attributes,{'tableName':_0x3e1e('0x9'),'paranoid':![],'indexes':[{'name':_0x3e1e('0xa'),'fields':[_0x3e1e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js
index 1795f87..0af0f84 100644
--- a/server/api/mailQueueReport/mailQueueReport.rpc.js
+++ b/server/api/mailQueueReport/mailQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8a01=['stringify','code','error','message','result','catch','CreateMailQueueReport','MailQueueReport','create','options','raw','UpdateMailQueueReport','update','body','where','attributes','limit','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x8a01,0x1df));var _0x18a0=function(_0x5be32a,_0x61feed){_0x5be32a=_0x5be32a-0x0;var _0x5d1cee=_0x8a01[_0x5be32a];return _0x5d1cee;};'use strict';var _=require('lodash');var util=require(_0x18a0('0x0'));var moment=require(_0x18a0('0x1'));var BPromise=require('bluebird');var rs=require(_0x18a0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18a0('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x18a0('0x4'));var config=require(_0x18a0('0x5'));var jayson=require(_0x18a0('0x6'));var client=jayson[_0x18a0('0x7')][_0x18a0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4218d9,_0x326a71,_0x233c64){return new BPromise(function(_0x58c50b,_0x2c672a){return client[_0x18a0('0x9')](_0x4218d9,_0x233c64)[_0x18a0('0xa')](function(_0x539be0){logger[_0x18a0('0xb')](_0x18a0('0xc'),_0x326a71,_0x18a0('0xd'));logger[_0x18a0('0xe')](_0x18a0('0xf'),_0x326a71,_0x18a0('0xd'),JSON[_0x18a0('0x10')](_0x539be0));if(_0x539be0['error']){if(_0x539be0['error'][_0x18a0('0x11')]===0x1f4){logger['error'](_0x18a0('0xc'),_0x326a71,_0x539be0[_0x18a0('0x12')]['message']);return _0x2c672a(_0x539be0[_0x18a0('0x12')][_0x18a0('0x13')]);}logger[_0x18a0('0x12')](_0x18a0('0xc'),_0x326a71,_0x539be0['error'][_0x18a0('0x13')]);return _0x58c50b(_0x539be0[_0x18a0('0x12')]['message']);}else{logger[_0x18a0('0xb')](_0x18a0('0xc'),_0x326a71,'request\x20sent');_0x58c50b(_0x539be0[_0x18a0('0x14')]['message']);}})[_0x18a0('0x15')](function(_0x5c7637){logger['error'](_0x18a0('0xc'),_0x326a71,_0x5c7637);_0x2c672a(_0x5c7637);});});}exports[_0x18a0('0x16')]=function(_0x42dffa){var _0x31936b=this;return new Promise(function(_0x53680c,_0x3dbf0d){return db[_0x18a0('0x17')][_0x18a0('0x18')](_0x42dffa['body'],{'raw':_0x42dffa[_0x18a0('0x19')]?_0x42dffa['options'][_0x18a0('0x1a')]===undefined?!![]:![]:!![]})[_0x18a0('0xa')](function(_0x36fec1){logger['info'](_0x18a0('0x16'),_0x42dffa);logger[_0x18a0('0xe')](_0x18a0('0x16'),_0x42dffa,JSON['stringify'](_0x36fec1));_0x53680c(_0x36fec1);})[_0x18a0('0x15')](function(_0x334394){logger['error'](_0x18a0('0x16'),_0x334394[_0x18a0('0x13')],_0x42dffa);_0x3dbf0d(_0x31936b[_0x18a0('0x12')](0x1f4,_0x334394[_0x18a0('0x13')]));});});};exports[_0x18a0('0x1b')]=function(_0x2c733b){var _0x1bd8c8=this;return new Promise(function(_0x348930,_0x2bcf9d){return db[_0x18a0('0x17')][_0x18a0('0x1c')](_0x2c733b[_0x18a0('0x1d')],{'raw':_0x2c733b[_0x18a0('0x19')]?_0x2c733b['options'][_0x18a0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c733b['options']?_0x2c733b[_0x18a0('0x19')][_0x18a0('0x1e')]||null:null,'attributes':_0x2c733b[_0x18a0('0x19')]?_0x2c733b[_0x18a0('0x19')][_0x18a0('0x1f')]||null:null,'limit':_0x2c733b['options']?_0x2c733b['options'][_0x18a0('0x20')]||null:null})[_0x18a0('0xa')](function(_0x44e8b1){logger[_0x18a0('0xb')](_0x18a0('0x1b'),_0x2c733b);logger[_0x18a0('0xe')](_0x18a0('0x1b'),_0x2c733b,JSON['stringify'](_0x44e8b1));_0x348930(_0x44e8b1);})[_0x18a0('0x15')](function(_0x254493){logger['error'](_0x18a0('0x1b'),_0x254493['message'],_0x2c733b);_0x2bcf9d(_0x1bd8c8[_0x18a0('0x12')](0x1f4,_0x254493['message']));});});};
\ No newline at end of file
+var _0x4486=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','util','moment','bluebird','randomstring'];(function(_0x20fb4d,_0x2d944c){var _0x2c4a6a=function(_0x5b4c4b){while(--_0x5b4c4b){_0x20fb4d['push'](_0x20fb4d['shift']());}};_0x2c4a6a(++_0x2d944c);}(_0x4486,0xea));var _0x6448=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0x4486[_0x2bcd1f];return _0x2381ca;};'use strict';var _=require('lodash');var util=require(_0x6448('0x0'));var moment=require(_0x6448('0x1'));var BPromise=require(_0x6448('0x2'));var rs=require(_0x6448('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6448('0x4'))['db'];var utils=require(_0x6448('0x5'));var logger=require(_0x6448('0x6'))(_0x6448('0x7'));var config=require('../../config/environment');var jayson=require(_0x6448('0x8'));var client=jayson[_0x6448('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54695e,_0x29bd46,_0x2f0795){return new BPromise(function(_0x3bb0de,_0x17603e){return client[_0x6448('0xa')](_0x54695e,_0x2f0795)[_0x6448('0xb')](function(_0x1333b6){logger['info'](_0x6448('0xc'),_0x29bd46,_0x6448('0xd'));logger[_0x6448('0xe')](_0x6448('0xf'),_0x29bd46,_0x6448('0xd'),JSON[_0x6448('0x10')](_0x1333b6));if(_0x1333b6[_0x6448('0x11')]){if(_0x1333b6['error'][_0x6448('0x12')]===0x1f4){logger[_0x6448('0x11')](_0x6448('0xc'),_0x29bd46,_0x1333b6['error']['message']);return _0x17603e(_0x1333b6[_0x6448('0x11')]['message']);}logger[_0x6448('0x11')](_0x6448('0xc'),_0x29bd46,_0x1333b6[_0x6448('0x11')]['message']);return _0x3bb0de(_0x1333b6[_0x6448('0x11')][_0x6448('0x13')]);}else{logger[_0x6448('0x14')](_0x6448('0xc'),_0x29bd46,_0x6448('0xd'));_0x3bb0de(_0x1333b6[_0x6448('0x15')]['message']);}})[_0x6448('0x16')](function(_0x32b9ca){logger[_0x6448('0x11')]('MailQueueReport,\x20%s,\x20%s',_0x29bd46,_0x32b9ca);_0x17603e(_0x32b9ca);});});}exports[_0x6448('0x17')]=function(_0x37148d){var _0x5a929e=this;return new Promise(function(_0x22f56f,_0x3dc70d){return db[_0x6448('0x18')][_0x6448('0x19')](_0x37148d[_0x6448('0x1a')],{'raw':_0x37148d[_0x6448('0x1b')]?_0x37148d[_0x6448('0x1b')][_0x6448('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3262d5){logger[_0x6448('0x14')](_0x6448('0x17'),_0x37148d);logger[_0x6448('0xe')](_0x6448('0x17'),_0x37148d,JSON[_0x6448('0x10')](_0x3262d5));_0x22f56f(_0x3262d5);})[_0x6448('0x16')](function(_0x158032){logger[_0x6448('0x11')](_0x6448('0x17'),_0x158032[_0x6448('0x13')],_0x37148d);_0x3dc70d(_0x5a929e['error'](0x1f4,_0x158032[_0x6448('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x4e4b04){var _0x41f862=this;return new Promise(function(_0x17f6f3,_0x2b78b0){return db[_0x6448('0x18')][_0x6448('0x1d')](_0x4e4b04[_0x6448('0x1a')],{'raw':_0x4e4b04[_0x6448('0x1b')]?_0x4e4b04['options'][_0x6448('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e4b04[_0x6448('0x1b')]?_0x4e4b04[_0x6448('0x1b')][_0x6448('0x1e')]||null:null,'attributes':_0x4e4b04[_0x6448('0x1b')]?_0x4e4b04[_0x6448('0x1b')][_0x6448('0x1f')]||null:null,'limit':_0x4e4b04['options']?_0x4e4b04[_0x6448('0x1b')][_0x6448('0x20')]||null:null})[_0x6448('0xb')](function(_0x34d66e){logger[_0x6448('0x14')]('UpdateMailQueueReport',_0x4e4b04);logger['debug'](_0x6448('0x21'),_0x4e4b04,JSON['stringify'](_0x34d66e));_0x17f6f3(_0x34d66e);})[_0x6448('0x16')](function(_0x312029){logger[_0x6448('0x11')](_0x6448('0x21'),_0x312029[_0x6448('0x13')],_0x4e4b04);_0x2b78b0(_0x41f862[_0x6448('0x11')](0x1f4,_0x312029[_0x6448('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js
index 510f8fb..d49b409 100644
--- a/server/api/mailServerIn/index.js
+++ b/server/api/mailServerIn/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfcf0=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcf0,0x138));var _0x0fcf=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0xfcf0[_0x117f4c];return _0x2b24e9;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var auth=require(_0x0fcf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0fcf('0x6'));module[_0x0fcf('0x7')]=router;
\ No newline at end of file
+var _0x4279=['exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x493db5,_0x4624c4){var _0x4278e0=function(_0x562d66){while(--_0x562d66){_0x493db5['push'](_0x493db5['shift']());}};_0x4278e0(++_0x4624c4);}(_0x4279,0x8d));var _0x9427=function(_0x8ad25b,_0x116470){_0x8ad25b=_0x8ad25b-0x0;var _0x2f9ccd=_0x4279[_0x8ad25b];return _0x2f9ccd;};'use strict';var multer=require('multer');var util=require(_0x9427('0x0'));var path=require(_0x9427('0x1'));var timeout=require('connect-timeout');var express=require(_0x9427('0x2'));var router=express[_0x9427('0x3')]();var auth=require(_0x9427('0x4'));var interaction=require(_0x9427('0x5'));var config=require('../../config/environment');module[_0x9427('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js
index d999393..270288a 100644
--- a/server/api/mailServerIn/mailServerIn.attributes.js
+++ b/server/api/mailServerIn/mailServerIn.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad8a=['INBOX','sequelize','exports','STRING','BOOLEAN','username','INTEGER'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xad8a,0xb0));var _0xaad8=function(_0x2b2a24,_0x1ef51a){_0x2b2a24=_0x2b2a24-0x0;var _0x3e5cb5=_0xad8a[_0x2b2a24];return _0x3e5cb5;};'use strict';var Sequelize=require(_0xaad8('0x0'));module[_0xaad8('0x1')]={'description':{'type':Sequelize[_0xaad8('0x2')]},'host':{'type':Sequelize[_0xaad8('0x2')]},'authentication':{'type':Sequelize[_0xaad8('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0xaad8('0x4')},'password':{'type':Sequelize[_0xaad8('0x2')]},'port':{'type':Sequelize[_0xaad8('0x5')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xaad8('0x2')],'defaultValue':_0xaad8('0x6')},'connTimeout':{'type':Sequelize[_0xaad8('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xaad8('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xaad8('0x2')]}};
\ No newline at end of file
+var _0x4058=['BOOLEAN','username','INTEGER','sequelize','exports','STRING'];(function(_0x3732e1,_0x304dc1){var _0x51e120=function(_0x33c129){while(--_0x33c129){_0x3732e1['push'](_0x3732e1['shift']());}};_0x51e120(++_0x304dc1);}(_0x4058,0x129));var _0x8405=function(_0x3f67c5,_0xa6364a){_0x3f67c5=_0x3f67c5-0x0;var _0x36e110=_0x4058[_0x3f67c5];return _0x36e110;};'use strict';var Sequelize=require(_0x8405('0x0'));module[_0x8405('0x1')]={'description':{'type':Sequelize[_0x8405('0x2')]},'host':{'type':Sequelize[_0x8405('0x2')]},'authentication':{'type':Sequelize[_0x8405('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x8405('0x2')],'unique':_0x8405('0x4')},'password':{'type':Sequelize[_0x8405('0x2')]},'port':{'type':Sequelize[_0x8405('0x5')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x8405('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8405('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8405('0x2')]}};
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js
index 9df1c6a..72d07d4 100644
--- a/server/api/mailServerIn/mailServerIn.model.js
+++ b/server/api/mailServerIn/mailServerIn.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x68a1=['path','rimraf','../../config/environment','./mailServerIn.attributes','MailServerIn','lodash','../../config/logger','api','moment'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0x68a1,0x17f));var _0x168a=function(_0x5ef56c,_0x497df1){_0x5ef56c=_0x5ef56c-0x0;var _0x1f10ae=_0x68a1[_0x5ef56c];return _0x1f10ae;};'use strict';var _=require(_0x168a('0x0'));var util=require('util');var logger=require(_0x168a('0x1'))(_0x168a('0x2'));var moment=require(_0x168a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x168a('0x4'));var rimraf=require(_0x168a('0x5'));var config=require(_0x168a('0x6'));var attributes=require(_0x168a('0x7'));module['exports']=function(_0x59f73b,_0x1905aa){return _0x59f73b['define'](_0x168a('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef0a=['../../config/environment','exports','MailServerIn','mail_servers_in','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x446249,_0x4b4f63){var _0x12ebfb=function(_0x1a7ed2){while(--_0x1a7ed2){_0x446249['push'](_0x446249['shift']());}};_0x12ebfb(++_0x4b4f63);}(_0xef0a,0x1a8));var _0xaef0=function(_0xabade1,_0x134512){_0xabade1=_0xabade1-0x0;var _0x40c9c5=_0xef0a[_0xabade1];return _0x40c9c5;};'use strict';var _=require('lodash');var util=require(_0xaef0('0x0'));var logger=require(_0xaef0('0x1'))(_0xaef0('0x2'));var moment=require(_0xaef0('0x3'));var BPromise=require('bluebird');var rp=require(_0xaef0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaef0('0x5'));var config=require(_0xaef0('0x6'));var attributes=require('./mailServerIn.attributes');module[_0xaef0('0x7')]=function(_0x389567,_0x2812b1){return _0x389567['define'](_0xaef0('0x8'),attributes,{'tableName':_0xaef0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js
index 14fa773..734eb4a 100644
--- a/server/api/mailServerIn/mailServerIn.rpc.js
+++ b/server/api/mailServerIn/mailServerIn.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdfd2=['options','raw','where','attributes','include','map','model','GetMailServerIn','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailServerIn,\x20%s,\x20%s'];(function(_0x32732e,_0x2246bd){var _0x448a9f=function(_0x3497e7){while(--_0x3497e7){_0x32732e['push'](_0x32732e['shift']());}};_0x448a9f(++_0x2246bd);}(_0xdfd2,0xf3));var _0x2dfd=function(_0x22edf5,_0xb6b72a){_0x22edf5=_0x22edf5-0x0;var _0x3276d8=_0xdfd2[_0x22edf5];return _0x3276d8;};'use strict';var _=require('lodash');var util=require(_0x2dfd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2dfd('0x1'));var fs=require('fs');var Redis=require(_0x2dfd('0x2'));var db=require(_0x2dfd('0x3'))['db'];var utils=require(_0x2dfd('0x4'));var logger=require(_0x2dfd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2dfd('0x6'));var client=jayson['client'][_0x2dfd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x35c2a0,_0xe7e81f,_0x23416c){return new BPromise(function(_0x11c38a,_0x11f274){return client['request'](_0x35c2a0,_0x23416c)[_0x2dfd('0x8')](function(_0x55f750){logger[_0x2dfd('0x9')]('MailServerIn,\x20%s,\x20%s',_0xe7e81f,_0x2dfd('0xa'));logger['debug'](_0x2dfd('0xb'),_0xe7e81f,_0x2dfd('0xa'),JSON[_0x2dfd('0xc')](_0x55f750));if(_0x55f750[_0x2dfd('0xd')]){if(_0x55f750[_0x2dfd('0xd')][_0x2dfd('0xe')]===0x1f4){logger[_0x2dfd('0xd')]('MailServerIn,\x20%s,\x20%s',_0xe7e81f,_0x55f750[_0x2dfd('0xd')][_0x2dfd('0xf')]);return _0x11f274(_0x55f750[_0x2dfd('0xd')][_0x2dfd('0xf')]);}logger[_0x2dfd('0xd')](_0x2dfd('0x10'),_0xe7e81f,_0x55f750['error'][_0x2dfd('0xf')]);return _0x11c38a(_0x55f750[_0x2dfd('0xd')][_0x2dfd('0xf')]);}else{logger[_0x2dfd('0x9')](_0x2dfd('0x10'),_0xe7e81f,_0x2dfd('0xa'));_0x11c38a(_0x55f750['result'][_0x2dfd('0xf')]);}})['catch'](function(_0x2c0078){logger[_0x2dfd('0xd')](_0x2dfd('0x10'),_0xe7e81f,_0x2c0078);_0x11f274(_0x2c0078);});});}exports['GetMailServerIn']=function(_0x300761){var _0x1f0944=this;return new Promise(function(_0x85e3d1,_0x3c2bcc){return db['MailServerIn']['findAll']({'raw':_0x300761[_0x2dfd('0x11')]?_0x300761[_0x2dfd('0x11')][_0x2dfd('0x12')]===undefined?!![]:![]:!![],'where':_0x300761[_0x2dfd('0x11')]?_0x300761[_0x2dfd('0x11')][_0x2dfd('0x13')]||null:null,'attributes':_0x300761['options']?_0x300761[_0x2dfd('0x11')][_0x2dfd('0x14')]||null:null,'limit':_0x300761[_0x2dfd('0x11')]?_0x300761['options']['limit']||null:null,'include':_0x300761[_0x2dfd('0x11')]?_0x300761[_0x2dfd('0x11')][_0x2dfd('0x15')]?_[_0x2dfd('0x16')](_0x300761[_0x2dfd('0x11')][_0x2dfd('0x15')],function(_0x44f26d){return{'model':db[_0x44f26d[_0x2dfd('0x17')]],'as':_0x44f26d['as'],'attributes':_0x44f26d[_0x2dfd('0x14')],'include':_0x44f26d[_0x2dfd('0x15')]?_[_0x2dfd('0x16')](_0x44f26d[_0x2dfd('0x15')],function(_0x47566a){return{'model':db[_0x47566a[_0x2dfd('0x17')]],'as':_0x47566a['as'],'attributes':_0x47566a[_0x2dfd('0x14')],'include':_0x47566a[_0x2dfd('0x15')]?_[_0x2dfd('0x16')](_0x47566a[_0x2dfd('0x15')],function(_0x82e854){return{'model':db[_0x82e854[_0x2dfd('0x17')]],'as':_0x82e854['as'],'attributes':_0x82e854['attributes']};}):[]};}):[]};}):[]:[]})[_0x2dfd('0x8')](function(_0x468b6a){logger[_0x2dfd('0x9')](_0x2dfd('0x18'),_0x300761);logger['debug']('GetMailServerIn',_0x300761,JSON[_0x2dfd('0xc')](_0x468b6a));_0x85e3d1(_0x468b6a);})[_0x2dfd('0x19')](function(_0x2d6d86){logger['error'](_0x2dfd('0x18'),_0x2d6d86[_0x2dfd('0xf')],_0x300761);_0x3c2bcc(_0x1f0944['error'](0x1f4,_0x2d6d86['message']));});});};
\ No newline at end of file
+var _0x1f33=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','include','model','map','stringify','lodash','util','bluebird','randomstring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1f33,0x1ca));var _0x31f3=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x1f33[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x31f3('0x0'));var util=require(_0x31f3('0x1'));var moment=require('moment');var BPromise=require(_0x31f3('0x2'));var rs=require(_0x31f3('0x3'));var fs=require('fs');var Redis=require(_0x31f3('0x4'));var db=require(_0x31f3('0x5'))['db'];var utils=require(_0x31f3('0x6'));var logger=require('../../config/logger')(_0x31f3('0x7'));var config=require(_0x31f3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x31f3('0x9')][_0x31f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x269762,_0x304c0a,_0xb1849){return new BPromise(function(_0x4960cb,_0x2d7d8b){return client[_0x31f3('0xb')](_0x269762,_0xb1849)[_0x31f3('0xc')](function(_0xda770e){logger[_0x31f3('0xd')](_0x31f3('0xe'),_0x304c0a,'request\x20sent');logger[_0x31f3('0xf')](_0x31f3('0x10'),_0x304c0a,_0x31f3('0x11'),JSON['stringify'](_0xda770e));if(_0xda770e[_0x31f3('0x12')]){if(_0xda770e[_0x31f3('0x12')]['code']===0x1f4){logger['error'](_0x31f3('0xe'),_0x304c0a,_0xda770e[_0x31f3('0x12')]['message']);return _0x2d7d8b(_0xda770e[_0x31f3('0x12')][_0x31f3('0x13')]);}logger['error'](_0x31f3('0xe'),_0x304c0a,_0xda770e[_0x31f3('0x12')][_0x31f3('0x13')]);return _0x4960cb(_0xda770e['error'][_0x31f3('0x13')]);}else{logger[_0x31f3('0xd')](_0x31f3('0xe'),_0x304c0a,_0x31f3('0x11'));_0x4960cb(_0xda770e[_0x31f3('0x14')][_0x31f3('0x13')]);}})[_0x31f3('0x15')](function(_0x2bc86f){logger['error'](_0x31f3('0xe'),_0x304c0a,_0x2bc86f);_0x2d7d8b(_0x2bc86f);});});}exports[_0x31f3('0x16')]=function(_0x12b9ac){var _0x1c2831=this;return new Promise(function(_0x1a4bd5,_0x458a81){return db[_0x31f3('0x17')]['findAll']({'raw':_0x12b9ac['options']?_0x12b9ac[_0x31f3('0x18')][_0x31f3('0x19')]===undefined?!![]:![]:!![],'where':_0x12b9ac['options']?_0x12b9ac[_0x31f3('0x18')][_0x31f3('0x1a')]||null:null,'attributes':_0x12b9ac[_0x31f3('0x18')]?_0x12b9ac[_0x31f3('0x18')][_0x31f3('0x1b')]||null:null,'limit':_0x12b9ac[_0x31f3('0x18')]?_0x12b9ac[_0x31f3('0x18')][_0x31f3('0x1c')]||null:null,'include':_0x12b9ac['options']?_0x12b9ac[_0x31f3('0x18')]['include']?_['map'](_0x12b9ac[_0x31f3('0x18')][_0x31f3('0x1d')],function(_0x3ba254){return{'model':db[_0x3ba254[_0x31f3('0x1e')]],'as':_0x3ba254['as'],'attributes':_0x3ba254['attributes'],'include':_0x3ba254[_0x31f3('0x1d')]?_[_0x31f3('0x1f')](_0x3ba254[_0x31f3('0x1d')],function(_0x1e55d3){return{'model':db[_0x1e55d3[_0x31f3('0x1e')]],'as':_0x1e55d3['as'],'attributes':_0x1e55d3[_0x31f3('0x1b')],'include':_0x1e55d3[_0x31f3('0x1d')]?_[_0x31f3('0x1f')](_0x1e55d3['include'],function(_0x4c6bef){return{'model':db[_0x4c6bef[_0x31f3('0x1e')]],'as':_0x4c6bef['as'],'attributes':_0x4c6bef[_0x31f3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x31f3('0xc')](function(_0x44b7bc){logger[_0x31f3('0xd')](_0x31f3('0x16'),_0x12b9ac);logger[_0x31f3('0xf')](_0x31f3('0x16'),_0x12b9ac,JSON[_0x31f3('0x20')](_0x44b7bc));_0x1a4bd5(_0x44b7bc);})[_0x31f3('0x15')](function(_0x287ac4){logger[_0x31f3('0x12')](_0x31f3('0x16'),_0x287ac4[_0x31f3('0x13')],_0x12b9ac);_0x458a81(_0x1c2831['error'](0x1f4,_0x287ac4[_0x31f3('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js
index 6556ae3..68496e2 100644
--- a/server/api/mailServerOut/index.js
+++ b/server/api/mailServerOut/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3b6d=['isAuthenticated','index','/:id','show','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0xc051b2,_0x3d6d9d){var _0x599dc2=function(_0x235ded){while(--_0x235ded){_0xc051b2['push'](_0xc051b2['shift']());}};_0x599dc2(++_0x3d6d9d);}(_0x3b6d,0x1af));var _0xd3b6=function(_0x2701df,_0xe37904){_0x2701df=_0x2701df-0x0;var _0x4fe239=_0x3b6d[_0x2701df];return _0x4fe239;};'use strict';var multer=require(_0xd3b6('0x0'));var util=require(_0xd3b6('0x1'));var path=require(_0xd3b6('0x2'));var timeout=require(_0xd3b6('0x3'));var express=require(_0xd3b6('0x4'));var router=express[_0xd3b6('0x5')]();var auth=require(_0xd3b6('0x6'));var interaction=require(_0xd3b6('0x7'));var config=require(_0xd3b6('0x8'));var controller=require(_0xd3b6('0x9'));router[_0xd3b6('0xa')]('/',auth[_0xd3b6('0xb')](),controller[_0xd3b6('0xc')]);router['get'](_0xd3b6('0xd'),auth[_0xd3b6('0xb')](),controller[_0xd3b6('0xe')]);router['post']('/',auth[_0xd3b6('0xb')](),controller['create']);router['put'](_0xd3b6('0xd'),auth[_0xd3b6('0xb')](),controller['update']);router[_0xd3b6('0xf')](_0xd3b6('0xd'),auth[_0xd3b6('0xb')](),controller['destroy']);module[_0xd3b6('0x10')]=router;
\ No newline at end of file
+var _0xd72b=['show','create','delete','/:id','exports','multer','util','path','express','../../components/auth/service','./mailServerOut.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd72b,0xf3));var _0xbd72=function(_0x16d4b2,_0x5f3469){_0x16d4b2=_0x16d4b2-0x0;var _0x704094=_0xd72b[_0x16d4b2];return _0x704094;};'use strict';var multer=require(_0xbd72('0x0'));var util=require(_0xbd72('0x1'));var path=require(_0xbd72('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd72('0x3'));var router=express['Router']();var auth=require(_0xbd72('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbd72('0x5'));router[_0xbd72('0x6')]('/',auth[_0xbd72('0x7')](),controller[_0xbd72('0x8')]);router[_0xbd72('0x6')]('/:id',auth[_0xbd72('0x7')](),controller[_0xbd72('0x9')]);router['post']('/',auth[_0xbd72('0x7')](),controller[_0xbd72('0xa')]);router['put']('/:id',auth[_0xbd72('0x7')](),controller['update']);router[_0xbd72('0xb')](_0xbd72('0xc'),auth[_0xbd72('0x7')](),controller['destroy']);module[_0xbd72('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js
index 6ae1754..543a03d 100644
--- a/server/api/mailServerOut/mailServerOut.attributes.js
+++ b/server/api/mailServerOut/mailServerOut.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5417=['STRING','INTEGER','BOOLEAN'];(function(_0x43af63,_0x1a3ed5){var _0x389f55=function(_0x129b2b){while(--_0x129b2b){_0x43af63['push'](_0x43af63['shift']());}};_0x389f55(++_0x1a3ed5);}(_0x5417,0x1c5));var _0x7541=function(_0x21ac5c,_0x18db00){_0x21ac5c=_0x21ac5c-0x0;var _0xae469a=_0x5417[_0x21ac5c];return _0xae469a;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x7541('0x0')]},'host':{'type':Sequelize[_0x7541('0x0')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x7541('0x0')]},'port':{'type':Sequelize[_0x7541('0x1')]},'secure':{'type':Sequelize[_0x7541('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x7541('0x0')]},'authentication':{'type':Sequelize[_0x7541('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xd6ea=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x3ad6bd,_0x4aef2c){var _0x27f188=function(_0x18a2fa){while(--_0x18a2fa){_0x3ad6bd['push'](_0x3ad6bd['shift']());}};_0x27f188(++_0x4aef2c);}(_0xd6ea,0xe6));var _0xad6e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd6ea[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xad6e('0x0'));module[_0xad6e('0x1')]={'description':{'type':Sequelize[_0xad6e('0x2')]},'host':{'type':Sequelize[_0xad6e('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xad6e('0x2')]},'port':{'type':Sequelize[_0xad6e('0x3')]},'secure':{'type':Sequelize[_0xad6e('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xad6e('0x4')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js
index 223a3f5..962628d 100644
--- a/server/api/mailServerOut/mailServerOut.controller.js
+++ b/server/api/mailServerOut/mailServerOut.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5cc5=['status','end','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','MailServerOut','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','map','type','key','field','include','findAll','then','rows','show','params','keys','length','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x166f86,_0x3d9435){var _0x25dda8=function(_0x50df2e){while(--_0x50df2e){_0x166f86['push'](_0x166f86['shift']());}};_0x25dda8(++_0x3d9435);}(_0x5cc5,0x70));var _0x55cc=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x5cc5[_0x40b3f2];return _0x4ce90c;};'use strict';var pdf=require(_0x55cc('0x0'));var emlformat=require(_0x55cc('0x1'));var rimraf=require(_0x55cc('0x2'));var zipdir=require(_0x55cc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x55cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x55cc('0x5'));var util=require(_0x55cc('0x6'));var path=require(_0x55cc('0x7'));var sox=require(_0x55cc('0x8'));var csv=require(_0x55cc('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x55cc('0xa'));var crypto=require('crypto');var jsforce=require(_0x55cc('0xb'));var deskjs=require(_0x55cc('0xc'));var toCsv=require(_0x55cc('0x9'));var querystring=require(_0x55cc('0xd'));var Papa=require(_0x55cc('0xe'));var Redis=require('ioredis');var authService=require(_0x55cc('0xf'));var qs=require(_0x55cc('0x10'));var hardwareService=require(_0x55cc('0x11'));var logger=require(_0x55cc('0x12'))('api');var utils=require(_0x55cc('0x13'));var config=require(_0x55cc('0x14'));var db=require(_0x55cc('0x15'))['db'];function respondWithStatusCode(_0x4ee613,_0x57c811){_0x57c811=_0x57c811||0xcc;return function(_0x50356b){if(_0x50356b){return _0x4ee613['sendStatus'](_0x57c811);}return _0x4ee613[_0x55cc('0x16')](_0x57c811)[_0x55cc('0x17')]();};}function respondWithResult(_0x77c17d,_0x4b7590){_0x4b7590=_0x4b7590||0xc8;return function(_0x5ae417){if(_0x5ae417){return _0x77c17d[_0x55cc('0x16')](_0x4b7590)['json'](_0x5ae417);}};}function respondWithFilteredResult(_0x265088,_0x31f0f3){return function(_0xd3b246){if(_0xd3b246){var _0x18f1cf=_0xd3b246[_0x55cc('0x18')],_0xc71401=_0x31f0f3[_0x55cc('0x19')],_0x5c9156=_0x31f0f3['offset']+_0x31f0f3[_0x55cc('0x1a')],_0x1c810c;if(_0x5c9156>=_0x18f1cf){_0x5c9156=_0x18f1cf;_0x1c810c=0xc8;}else{_0x1c810c=0xce;}_0x265088[_0x55cc('0x16')](_0x1c810c);return _0x265088['set'](_0x55cc('0x1b'),_0xc71401+'-'+_0x5c9156+'/'+_0x18f1cf)['json'](_0xd3b246);}return null;};}function patchUpdates(_0x1541b3){return function(_0x2fc928){try{jsonpatch[_0x55cc('0x1c')](_0x2fc928,_0x1541b3,!![]);}catch(_0x392adb){return BPromise[_0x55cc('0x1d')](_0x392adb);}return _0x2fc928[_0x55cc('0x1e')]();};}function saveUpdates(_0x3f59a2,_0x550201){return function(_0x2a3d5b){if(_0x2a3d5b){return _0x2a3d5b[_0x55cc('0x1f')](_0x3f59a2)['then'](function(_0x267604){return _0x267604;});}return null;};}function removeEntity(_0x9aaaf9,_0x16f82a){return function(_0x219130){if(_0x219130){return _0x219130[_0x55cc('0x20')]()['then'](function(){_0x9aaaf9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7af9,_0x308dbf){return function(_0x142ee6){if(!_0x142ee6){_0x5d7af9['sendStatus'](0x194);}return _0x142ee6;};}function handleError(_0x4ba034,_0x336560){_0x336560=_0x336560||0x1f4;return function(_0x48f723){logger['error'](_0x48f723[_0x55cc('0x21')]);if(_0x48f723[_0x55cc('0x22')]){delete _0x48f723[_0x55cc('0x22')];}_0x4ba034[_0x55cc('0x16')](_0x336560)[_0x55cc('0x23')](_0x48f723);};}exports['index']=function(_0x571bb3,_0x4a5054){var _0x13af92={},_0x37404c={},_0x3ab0cc={'count':0x0,'rows':[]};var _0x2b35db=db[_0x55cc('0x24')]['rawAttributes'];_0x37404c[_0x55cc('0x25')]=_['keys'](_0x2b35db);_0x37404c['query']=_['keys'](_0x571bb3[_0x55cc('0x26')]);_0x37404c[_0x55cc('0x27')]=_[_0x55cc('0x28')](_0x37404c['model'],_0x37404c[_0x55cc('0x26')]);_0x13af92['attributes']=_[_0x55cc('0x28')](_0x37404c[_0x55cc('0x25')],qs['fields'](_0x571bb3[_0x55cc('0x26')][_0x55cc('0x29')]));_0x13af92[_0x55cc('0x2a')]=_0x13af92[_0x55cc('0x2a')]['length']?_0x13af92['attributes']:_0x37404c[_0x55cc('0x25')];if(!_0x571bb3[_0x55cc('0x26')][_0x55cc('0x2b')](_0x55cc('0x2c'))){_0x13af92[_0x55cc('0x1a')]=qs['limit'](_0x571bb3['query'][_0x55cc('0x1a')]);_0x13af92['offset']=qs[_0x55cc('0x19')](_0x571bb3[_0x55cc('0x26')][_0x55cc('0x19')]);}_0x13af92[_0x55cc('0x2d')]=qs[_0x55cc('0x2e')](_0x571bb3[_0x55cc('0x26')][_0x55cc('0x2e')]);_0x13af92['where']=qs[_0x55cc('0x27')](_[_0x55cc('0x2f')](_0x571bb3[_0x55cc('0x26')],_0x37404c[_0x55cc('0x27')]));if(_0x571bb3[_0x55cc('0x26')][_0x55cc('0x30')]){_0x13af92['where']=_[_0x55cc('0x31')](_0x13af92['where'],{'$or':_[_0x55cc('0x32')](_0x2b35db,function(_0x3923e0){if(_0x3923e0[_0x55cc('0x33')][_0x55cc('0x34')]!=='VIRTUAL'){var _0x57bc8e={};_0x57bc8e[_0x3923e0[_0x55cc('0x35')]]={'$like':'%'+_0x571bb3['query']['filter']+'%'};return _0x57bc8e;}})});}_0x13af92=_['merge']({},_0x13af92,_0x571bb3['options']);var _0x432f58={'where':_0x13af92['where']};return db['MailServerOut'][_0x55cc('0x18')](_0x432f58)['then'](function(_0x1c0fde){_0x3ab0cc[_0x55cc('0x18')]=_0x1c0fde;if(_0x571bb3['query']['includeAll']){_0x13af92[_0x55cc('0x36')]=[{'all':!![]}];}return db[_0x55cc('0x24')][_0x55cc('0x37')](_0x13af92);})[_0x55cc('0x38')](function(_0x35233a){_0x3ab0cc[_0x55cc('0x39')]=_0x35233a;return _0x3ab0cc;})['then'](respondWithFilteredResult(_0x4a5054,_0x13af92))['catch'](handleError(_0x4a5054,null));};exports[_0x55cc('0x3a')]=function(_0x30afdd,_0xedd7b9){var _0x319836={'raw':!![],'where':{'id':_0x30afdd[_0x55cc('0x3b')]['id']}},_0x4a998a={};_0x4a998a[_0x55cc('0x25')]=_[_0x55cc('0x3c')](db[_0x55cc('0x24')]['rawAttributes']);_0x4a998a[_0x55cc('0x26')]=_[_0x55cc('0x3c')](_0x30afdd[_0x55cc('0x26')]);_0x4a998a['filters']=_[_0x55cc('0x28')](_0x4a998a['model'],_0x4a998a[_0x55cc('0x26')]);_0x319836['attributes']=_[_0x55cc('0x28')](_0x4a998a['model'],qs[_0x55cc('0x29')](_0x30afdd[_0x55cc('0x26')][_0x55cc('0x29')]));_0x319836[_0x55cc('0x2a')]=_0x319836[_0x55cc('0x2a')][_0x55cc('0x3d')]?_0x319836[_0x55cc('0x2a')]:_0x4a998a['model'];if(_0x30afdd[_0x55cc('0x26')]['includeAll']){_0x319836[_0x55cc('0x36')]=[{'all':!![]}];}_0x319836=_[_0x55cc('0x31')]({},_0x319836,_0x30afdd[_0x55cc('0x3e')]);return db[_0x55cc('0x24')][_0x55cc('0x3f')](_0x319836)[_0x55cc('0x38')](handleEntityNotFound(_0xedd7b9,null))[_0x55cc('0x38')](respondWithResult(_0xedd7b9,null))[_0x55cc('0x40')](handleError(_0xedd7b9,null));};exports[_0x55cc('0x41')]=function(_0x3162b4,_0x5716a6){return db[_0x55cc('0x24')]['create'](_0x3162b4[_0x55cc('0x42')],{})[_0x55cc('0x38')](respondWithResult(_0x5716a6,0xc9))[_0x55cc('0x40')](handleError(_0x5716a6,null));};exports['update']=function(_0x4c8c3f,_0x424312){if(_0x4c8c3f['body']['id']){delete _0x4c8c3f[_0x55cc('0x42')]['id'];}return db[_0x55cc('0x24')][_0x55cc('0x3f')]({'where':{'id':_0x4c8c3f['params']['id']}})[_0x55cc('0x38')](handleEntityNotFound(_0x424312,null))['then'](saveUpdates(_0x4c8c3f[_0x55cc('0x42')],null))[_0x55cc('0x38')](respondWithResult(_0x424312,null))[_0x55cc('0x40')](handleError(_0x424312,null));};exports['destroy']=function(_0x5071dd,_0x12b8ea){return db['MailServerOut'][_0x55cc('0x3f')]({'where':{'id':_0x5071dd[_0x55cc('0x3b')]['id']}})[_0x55cc('0x38')](handleEntityNotFound(_0x12b8ea,null))[_0x55cc('0x38')](removeEntity(_0x12b8ea,null))[_0x55cc('0x40')](handleError(_0x12b8ea,null));};
\ No newline at end of file
+var _0xed82=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','apply','then','destroy','end','error','stack','name','send','index','MailServerOut','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','merge','type','VIRTUAL','options','where','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv'];(function(_0x324299,_0x3bf812){var _0x4d2c1c=function(_0x71ffc5){while(--_0x71ffc5){_0x324299['push'](_0x324299['shift']());}};_0x4d2c1c(++_0x3bf812);}(_0xed82,0x1d3));var _0x2ed8=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xed82[_0x4b369d];return _0x571a98;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2ed8('0x0'));var rimraf=require(_0x2ed8('0x1'));var zipdir=require(_0x2ed8('0x2'));var jsonpatch=require(_0x2ed8('0x3'));var rp=require(_0x2ed8('0x4'));var moment=require(_0x2ed8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2ed8('0x6'));var util=require(_0x2ed8('0x7'));var path=require(_0x2ed8('0x8'));var sox=require(_0x2ed8('0x9'));var csv=require('to-csv');var ejs=require(_0x2ed8('0xa'));var fs=require('fs');var _=require(_0x2ed8('0xb'));var squel=require(_0x2ed8('0xc'));var crypto=require(_0x2ed8('0xd'));var jsforce=require(_0x2ed8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2ed8('0xf'));var querystring=require('querystring');var Papa=require(_0x2ed8('0x10'));var Redis=require(_0x2ed8('0x11'));var authService=require(_0x2ed8('0x12'));var qs=require(_0x2ed8('0x13'));var hardwareService=require(_0x2ed8('0x14'));var logger=require(_0x2ed8('0x15'))(_0x2ed8('0x16'));var utils=require(_0x2ed8('0x17'));var config=require(_0x2ed8('0x18'));var db=require(_0x2ed8('0x19'))['db'];function respondWithStatusCode(_0x3a1f4e,_0x38e28c){_0x38e28c=_0x38e28c||0xcc;return function(_0x4278cf){if(_0x4278cf){return _0x3a1f4e[_0x2ed8('0x1a')](_0x38e28c);}return _0x3a1f4e[_0x2ed8('0x1b')](_0x38e28c)['end']();};}function respondWithResult(_0xab8f30,_0x4c4cb3){_0x4c4cb3=_0x4c4cb3||0xc8;return function(_0x1db790){if(_0x1db790){return _0xab8f30[_0x2ed8('0x1b')](_0x4c4cb3)['json'](_0x1db790);}};}function respondWithFilteredResult(_0x524f06,_0x54fbaa){return function(_0x4e4c7c){if(_0x4e4c7c){var _0x4045af=_0x4e4c7c[_0x2ed8('0x1c')],_0x167626=_0x54fbaa[_0x2ed8('0x1d')],_0x2ab581=_0x54fbaa[_0x2ed8('0x1d')]+_0x54fbaa[_0x2ed8('0x1e')],_0x365dc3;if(_0x2ab581>=_0x4045af){_0x2ab581=_0x4045af;_0x365dc3=0xc8;}else{_0x365dc3=0xce;}_0x524f06[_0x2ed8('0x1b')](_0x365dc3);return _0x524f06[_0x2ed8('0x1f')]('Content-Range',_0x167626+'-'+_0x2ab581+'/'+_0x4045af)['json'](_0x4e4c7c);}return null;};}function patchUpdates(_0x1326dd){return function(_0x34c640){try{jsonpatch[_0x2ed8('0x20')](_0x34c640,_0x1326dd,!![]);}catch(_0x347188){return BPromise['reject'](_0x347188);}return _0x34c640['save']();};}function saveUpdates(_0x2b314,_0x7aae88){return function(_0x5c67f3){if(_0x5c67f3){return _0x5c67f3['update'](_0x2b314)[_0x2ed8('0x21')](function(_0x3b6865){return _0x3b6865;});}return null;};}function removeEntity(_0x822741,_0x4b524a){return function(_0x4c4c4a){if(_0x4c4c4a){return _0x4c4c4a[_0x2ed8('0x22')]()[_0x2ed8('0x21')](function(){_0x822741[_0x2ed8('0x1b')](0xcc)[_0x2ed8('0x23')]();});}};}function handleEntityNotFound(_0x467d50,_0x3f867f){return function(_0xc59e94){if(!_0xc59e94){_0x467d50['sendStatus'](0x194);}return _0xc59e94;};}function handleError(_0x41b80d,_0x5aad3f){_0x5aad3f=_0x5aad3f||0x1f4;return function(_0x1ccc6e){logger[_0x2ed8('0x24')](_0x1ccc6e[_0x2ed8('0x25')]);if(_0x1ccc6e[_0x2ed8('0x26')]){delete _0x1ccc6e[_0x2ed8('0x26')];}_0x41b80d['status'](_0x5aad3f)[_0x2ed8('0x27')](_0x1ccc6e);};}exports[_0x2ed8('0x28')]=function(_0x1dfbe2,_0xdfa23b){var _0x4611c2={},_0xb53a2f={},_0x2d4db9={'count':0x0,'rows':[]};var _0x549a89=db[_0x2ed8('0x29')][_0x2ed8('0x2a')];_0xb53a2f['model']=_[_0x2ed8('0x2b')](_0x549a89);_0xb53a2f[_0x2ed8('0x2c')]=_['keys'](_0x1dfbe2[_0x2ed8('0x2c')]);_0xb53a2f[_0x2ed8('0x2d')]=_[_0x2ed8('0x2e')](_0xb53a2f[_0x2ed8('0x2f')],_0xb53a2f[_0x2ed8('0x2c')]);_0x4611c2[_0x2ed8('0x30')]=_[_0x2ed8('0x2e')](_0xb53a2f[_0x2ed8('0x2f')],qs[_0x2ed8('0x31')](_0x1dfbe2['query']['fields']));_0x4611c2[_0x2ed8('0x30')]=_0x4611c2['attributes'][_0x2ed8('0x32')]?_0x4611c2['attributes']:_0xb53a2f[_0x2ed8('0x2f')];if(!_0x1dfbe2['query']['hasOwnProperty'](_0x2ed8('0x33'))){_0x4611c2[_0x2ed8('0x1e')]=qs['limit'](_0x1dfbe2[_0x2ed8('0x2c')][_0x2ed8('0x1e')]);_0x4611c2[_0x2ed8('0x1d')]=qs[_0x2ed8('0x1d')](_0x1dfbe2['query'][_0x2ed8('0x1d')]);}_0x4611c2[_0x2ed8('0x34')]=qs[_0x2ed8('0x35')](_0x1dfbe2[_0x2ed8('0x2c')][_0x2ed8('0x35')]);_0x4611c2['where']=qs['filters'](_['pick'](_0x1dfbe2[_0x2ed8('0x2c')],_0xb53a2f[_0x2ed8('0x2d')]));if(_0x1dfbe2['query'][_0x2ed8('0x36')]){_0x4611c2['where']=_[_0x2ed8('0x37')](_0x4611c2['where'],{'$or':_['map'](_0x549a89,function(_0x48997d){if(_0x48997d[_0x2ed8('0x38')]['key']!==_0x2ed8('0x39')){var _0x37e5da={};_0x37e5da[_0x48997d['field']]={'$like':'%'+_0x1dfbe2['query']['filter']+'%'};return _0x37e5da;}})});}_0x4611c2=_['merge']({},_0x4611c2,_0x1dfbe2[_0x2ed8('0x3a')]);var _0x20088b={'where':_0x4611c2[_0x2ed8('0x3b')]};return db['MailServerOut'][_0x2ed8('0x1c')](_0x20088b)[_0x2ed8('0x21')](function(_0x595f93){_0x2d4db9[_0x2ed8('0x1c')]=_0x595f93;if(_0x1dfbe2[_0x2ed8('0x2c')][_0x2ed8('0x3c')]){_0x4611c2[_0x2ed8('0x3d')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x4611c2);})['then'](function(_0xa7647c){_0x2d4db9[_0x2ed8('0x3e')]=_0xa7647c;return _0x2d4db9;})[_0x2ed8('0x21')](respondWithFilteredResult(_0xdfa23b,_0x4611c2))[_0x2ed8('0x3f')](handleError(_0xdfa23b,null));};exports[_0x2ed8('0x40')]=function(_0x5a6cbf,_0x5dc82b){var _0x1d2c72={'raw':!![],'where':{'id':_0x5a6cbf[_0x2ed8('0x41')]['id']}},_0x31de96={};_0x31de96['model']=_['keys'](db[_0x2ed8('0x29')][_0x2ed8('0x2a')]);_0x31de96[_0x2ed8('0x2c')]=_[_0x2ed8('0x2b')](_0x5a6cbf[_0x2ed8('0x2c')]);_0x31de96[_0x2ed8('0x2d')]=_[_0x2ed8('0x2e')](_0x31de96[_0x2ed8('0x2f')],_0x31de96['query']);_0x1d2c72[_0x2ed8('0x30')]=_[_0x2ed8('0x2e')](_0x31de96['model'],qs[_0x2ed8('0x31')](_0x5a6cbf[_0x2ed8('0x2c')][_0x2ed8('0x31')]));_0x1d2c72[_0x2ed8('0x30')]=_0x1d2c72[_0x2ed8('0x30')][_0x2ed8('0x32')]?_0x1d2c72['attributes']:_0x31de96[_0x2ed8('0x2f')];if(_0x5a6cbf[_0x2ed8('0x2c')]['includeAll']){_0x1d2c72['include']=[{'all':!![]}];}_0x1d2c72=_[_0x2ed8('0x37')]({},_0x1d2c72,_0x5a6cbf[_0x2ed8('0x3a')]);return db[_0x2ed8('0x29')][_0x2ed8('0x42')](_0x1d2c72)[_0x2ed8('0x21')](handleEntityNotFound(_0x5dc82b,null))[_0x2ed8('0x21')](respondWithResult(_0x5dc82b,null))[_0x2ed8('0x3f')](handleError(_0x5dc82b,null));};exports[_0x2ed8('0x43')]=function(_0x1ed2d6,_0x3cea37){return db[_0x2ed8('0x29')][_0x2ed8('0x43')](_0x1ed2d6[_0x2ed8('0x44')],{})['then'](respondWithResult(_0x3cea37,0xc9))['catch'](handleError(_0x3cea37,null));};exports['update']=function(_0x4849e1,_0x1eb077){if(_0x4849e1[_0x2ed8('0x44')]['id']){delete _0x4849e1[_0x2ed8('0x44')]['id'];}return db['MailServerOut'][_0x2ed8('0x42')]({'where':{'id':_0x4849e1[_0x2ed8('0x41')]['id']}})[_0x2ed8('0x21')](handleEntityNotFound(_0x1eb077,null))[_0x2ed8('0x21')](saveUpdates(_0x4849e1[_0x2ed8('0x44')],null))[_0x2ed8('0x21')](respondWithResult(_0x1eb077,null))[_0x2ed8('0x3f')](handleError(_0x1eb077,null));};exports[_0x2ed8('0x22')]=function(_0x4d7e7a,_0x418e97){return db[_0x2ed8('0x29')][_0x2ed8('0x42')]({'where':{'id':_0x4d7e7a[_0x2ed8('0x41')]['id']}})[_0x2ed8('0x21')](handleEntityNotFound(_0x418e97,null))[_0x2ed8('0x21')](removeEntity(_0x418e97,null))[_0x2ed8('0x3f')](handleError(_0x418e97,null));};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js
index 7358904..6c184a1 100644
--- a/server/api/mailServerOut/mailServerOut.model.js
+++ b/server/api/mailServerOut/mailServerOut.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x13f6=['request-promise','rimraf','../../config/environment','./mailServerOut.attributes','lodash','util','moment','bluebird'];(function(_0x3bb956,_0x4caf00){var _0x1f544b=function(_0x55d6e4){while(--_0x55d6e4){_0x3bb956['push'](_0x3bb956['shift']());}};_0x1f544b(++_0x4caf00);}(_0x13f6,0x124));var _0x613f=function(_0x4596d1,_0x3c87b5){_0x4596d1=_0x4596d1-0x0;var _0x3225e5=_0x13f6[_0x4596d1];return _0x3225e5;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x613f('0x2'));var BPromise=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var attributes=require(_0x613f('0x7'));module['exports']=function(_0x3f3525,_0x2367b3){return _0x3f3525['define']('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c81=['moment','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','api'];(function(_0x265d39,_0x1c69b9){var _0x45bcae=function(_0x2a0c03){while(--_0x2a0c03){_0x265d39['push'](_0x265d39['shift']());}};_0x45bcae(++_0x1c69b9);}(_0x3c81,0x102));var _0x13c8=function(_0x2d8864,_0x491670){_0x2d8864=_0x2d8864-0x0;var _0x5389db=_0x3c81[_0x2d8864];return _0x5389db;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13c8('0x4'));var attributes=require(_0x13c8('0x5'));module[_0x13c8('0x6')]=function(_0x1c16f1,_0x2a4d66){return _0x1c16f1[_0x13c8('0x7')](_0x13c8('0x8'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js
index cbfb609..bc55c09 100644
--- a/server/api/mailServerOut/mailServerOut.rpc.js
+++ b/server/api/mailServerOut/mailServerOut.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x091f=['message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x201d67,_0x13b1f2){var _0x3e8711=function(_0x131a94){while(--_0x131a94){_0x201d67['push'](_0x201d67['shift']());}};_0x3e8711(++_0x13b1f2);}(_0x091f,0x17e));var _0xf091=function(_0x5301a0,_0x562072){_0x5301a0=_0x5301a0-0x0;var _0x3edb89=_0x091f[_0x5301a0];return _0x3edb89;};'use strict';var _=require(_0xf091('0x0'));var util=require('util');var moment=require(_0xf091('0x1'));var BPromise=require(_0xf091('0x2'));var rs=require(_0xf091('0x3'));var fs=require('fs');var Redis=require(_0xf091('0x4'));var db=require(_0xf091('0x5'))['db'];var utils=require(_0xf091('0x6'));var logger=require(_0xf091('0x7'))('rpc');var config=require(_0xf091('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf091('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c4615,_0x3fbae3,_0xd1f796){return new BPromise(function(_0x329fea,_0x312fc1){return client['request'](_0x1c4615,_0xd1f796)['then'](function(_0x3c24ee){logger['info'](_0xf091('0xa'),_0x3fbae3,_0xf091('0xb'));logger[_0xf091('0xc')](_0xf091('0xd'),_0x3fbae3,'request\x20sent',JSON[_0xf091('0xe')](_0x3c24ee));if(_0x3c24ee['error']){if(_0x3c24ee['error'][_0xf091('0xf')]===0x1f4){logger[_0xf091('0x10')](_0xf091('0xa'),_0x3fbae3,_0x3c24ee['error'][_0xf091('0x11')]);return _0x312fc1(_0x3c24ee[_0xf091('0x10')][_0xf091('0x11')]);}logger['error']('MailServerOut,\x20%s,\x20%s',_0x3fbae3,_0x3c24ee['error'][_0xf091('0x11')]);return _0x329fea(_0x3c24ee[_0xf091('0x10')][_0xf091('0x11')]);}else{logger[_0xf091('0x12')](_0xf091('0xa'),_0x3fbae3,_0xf091('0xb'));_0x329fea(_0x3c24ee[_0xf091('0x13')]['message']);}})[_0xf091('0x14')](function(_0x230ed4){logger['error'](_0xf091('0xa'),_0x3fbae3,_0x230ed4);_0x312fc1(_0x230ed4);});});}
\ No newline at end of file
+var _0x4f38=['stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x4f38,0xf7));var _0x84f3=function(_0x2ad1a6,_0x22b83e){_0x2ad1a6=_0x2ad1a6-0x0;var _0x17be86=_0x4f38[_0x2ad1a6];return _0x17be86;};'use strict';var _=require(_0x84f3('0x0'));var util=require('util');var moment=require(_0x84f3('0x1'));var BPromise=require(_0x84f3('0x2'));var rs=require(_0x84f3('0x3'));var fs=require('fs');var Redis=require(_0x84f3('0x4'));var db=require(_0x84f3('0x5'))['db'];var utils=require(_0x84f3('0x6'));var logger=require(_0x84f3('0x7'))('rpc');var config=require(_0x84f3('0x8'));var jayson=require(_0x84f3('0x9'));var client=jayson[_0x84f3('0xa')][_0x84f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x342e2c,_0x2e1d45,_0x1d73fa){return new BPromise(function(_0x3b8822,_0x2e26e1){return client['request'](_0x342e2c,_0x1d73fa)[_0x84f3('0xc')](function(_0x4416f2){logger[_0x84f3('0xd')](_0x84f3('0xe'),_0x2e1d45,_0x84f3('0xf'));logger['debug'](_0x84f3('0x10'),_0x2e1d45,_0x84f3('0xf'),JSON[_0x84f3('0x11')](_0x4416f2));if(_0x4416f2[_0x84f3('0x12')]){if(_0x4416f2[_0x84f3('0x12')][_0x84f3('0x13')]===0x1f4){logger[_0x84f3('0x12')]('MailServerOut,\x20%s,\x20%s',_0x2e1d45,_0x4416f2[_0x84f3('0x12')][_0x84f3('0x14')]);return _0x2e26e1(_0x4416f2[_0x84f3('0x12')]['message']);}logger[_0x84f3('0x12')](_0x84f3('0xe'),_0x2e1d45,_0x4416f2[_0x84f3('0x12')][_0x84f3('0x14')]);return _0x3b8822(_0x4416f2[_0x84f3('0x12')][_0x84f3('0x14')]);}else{logger[_0x84f3('0xd')](_0x84f3('0xe'),_0x2e1d45,_0x84f3('0xf'));_0x3b8822(_0x4416f2[_0x84f3('0x15')][_0x84f3('0x14')]);}})['catch'](function(_0x22e41f){logger[_0x84f3('0x12')](_0x84f3('0xe'),_0x2e1d45,_0x22e41f);_0x2e26e1(_0x22e41f);});});}
\ No newline at end of file
diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js
index cee8257..b8d07dc 100644
--- a/server/api/mailSubstatus/index.js
+++ b/server/api/mailSubstatus/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1d44=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x79702,_0x34931c){var _0x417e6b=function(_0x55294a){while(--_0x55294a){_0x79702['push'](_0x79702['shift']());}};_0x417e6b(++_0x34931c);}(_0x1d44,0x8c));var _0x41d4=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0x1d44[_0x567bcb];return _0x4eebc2;};'use strict';var multer=require(_0x41d4('0x0'));var util=require(_0x41d4('0x1'));var path=require('path');var timeout=require(_0x41d4('0x2'));var express=require(_0x41d4('0x3'));var router=express[_0x41d4('0x4')]();var auth=require(_0x41d4('0x5'));var interaction=require(_0x41d4('0x6'));var config=require('../../config/environment');var controller=require(_0x41d4('0x7'));router[_0x41d4('0x8')]('/',auth[_0x41d4('0x9')](),controller[_0x41d4('0xa')]);router[_0x41d4('0x8')]('/describe',auth[_0x41d4('0x9')](),controller[_0x41d4('0xb')]);router[_0x41d4('0x8')](_0x41d4('0xc'),auth[_0x41d4('0x9')](),controller[_0x41d4('0xd')]);router[_0x41d4('0xe')]('/',auth[_0x41d4('0x9')](),controller[_0x41d4('0xf')]);router['put'](_0x41d4('0xc'),auth[_0x41d4('0x9')](),controller[_0x41d4('0x10')]);router[_0x41d4('0x11')](_0x41d4('0xc'),auth[_0x41d4('0x9')](),controller[_0x41d4('0x12')]);module[_0x41d4('0x13')]=router;
\ No newline at end of file
+var _0x3844=['put','/:id','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','show','post','create'];(function(_0x1f4d1f,_0x4e612f){var _0x4a0590=function(_0xd13f){while(--_0xd13f){_0x1f4d1f['push'](_0x1f4d1f['shift']());}};_0x4a0590(++_0x4e612f);}(_0x3844,0x1ba));var _0x4384=function(_0x402dd3,_0x132646){_0x402dd3=_0x402dd3-0x0;var _0x4bef49=_0x3844[_0x402dd3];return _0x4bef49;};'use strict';var multer=require(_0x4384('0x0'));var util=require(_0x4384('0x1'));var path=require(_0x4384('0x2'));var timeout=require(_0x4384('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x4384('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4384('0x5'));var controller=require(_0x4384('0x6'));router[_0x4384('0x7')]('/',auth[_0x4384('0x8')](),controller[_0x4384('0x9')]);router['get'](_0x4384('0xa'),auth[_0x4384('0x8')](),controller['describe']);router[_0x4384('0x7')]('/:id',auth[_0x4384('0x8')](),controller[_0x4384('0xb')]);router[_0x4384('0xc')]('/',auth[_0x4384('0x8')](),controller[_0x4384('0xd')]);router[_0x4384('0xe')](_0x4384('0xf'),auth[_0x4384('0x8')](),controller[_0x4384('0x10')]);router[_0x4384('0x11')](_0x4384('0xf'),auth[_0x4384('0x8')](),controller[_0x4384('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js
index 37f52fc..843af11 100644
--- a/server/api/mailSubstatus/mailSubstatus.attributes.js
+++ b/server/api/mailSubstatus/mailSubstatus.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x13f6=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x13f6,0x124));var _0x613f=function(_0x1fa22b,_0x3ab9c0){_0x1fa22b=_0x1fa22b-0x0;var _0x50c4d7=_0x13f6[_0x1fa22b];return _0x50c4d7;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x613f('0x2')]}};
\ No newline at end of file
+var _0x3276=['STRING','sequelize','name'];(function(_0x11e8d5,_0x4c035e){var _0x2834b7=function(_0x32b5ff){while(--_0x32b5ff){_0x11e8d5['push'](_0x11e8d5['shift']());}};_0x2834b7(++_0x4c035e);}(_0x3276,0xc7));var _0x6327=function(_0x59a0fc,_0x3ce0d2){_0x59a0fc=_0x59a0fc-0x0;var _0x41699a=_0x3276[_0x59a0fc];return _0x41699a;};'use strict';var Sequelize=require(_0x6327('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6327('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6327('0x2')]}};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js
index 8d97cf2..fbd67a9 100644
--- a/server/api/mailSubstatus/mailSubstatus.controller.js
+++ b/server/api/mailSubstatus/mailSubstatus.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x47c1=['json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','map','type','key','VIRTUAL','field','filter','options','MailSubstatus','includeAll','findAll','rows','show','params','rawAttributes','intersection','include','merge','find','create','body','describe','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end'];(function(_0x490e0a,_0x1eca50){var _0x212ff2=function(_0x281eb2){while(--_0x281eb2){_0x490e0a['push'](_0x490e0a['shift']());}};_0x212ff2(++_0x1eca50);}(_0x47c1,0x1b6));var _0x147c=function(_0x2073f8,_0x34a29d){_0x2073f8=_0x2073f8-0x0;var _0x11c069=_0x47c1[_0x2073f8];return _0x11c069;};'use strict';var pdf=require(_0x147c('0x0'));var emlformat=require(_0x147c('0x1'));var rimraf=require(_0x147c('0x2'));var zipdir=require(_0x147c('0x3'));var jsonpatch=require(_0x147c('0x4'));var rp=require('request-promise');var moment=require(_0x147c('0x5'));var BPromise=require(_0x147c('0x6'));var Mustache=require(_0x147c('0x7'));var util=require(_0x147c('0x8'));var path=require('path');var sox=require(_0x147c('0x9'));var csv=require('to-csv');var ejs=require(_0x147c('0xa'));var fs=require('fs');var _=require(_0x147c('0xb'));var squel=require(_0x147c('0xc'));var crypto=require(_0x147c('0xd'));var jsforce=require(_0x147c('0xe'));var deskjs=require(_0x147c('0xf'));var toCsv=require(_0x147c('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x147c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x147c('0x12'));var logger=require(_0x147c('0x13'))('api');var utils=require(_0x147c('0x14'));var config=require(_0x147c('0x15'));var db=require(_0x147c('0x16'))['db'];function respondWithStatusCode(_0x3ef17f,_0x5ce687){_0x5ce687=_0x5ce687||0xcc;return function(_0x2f4319){if(_0x2f4319){return _0x3ef17f['sendStatus'](_0x5ce687);}return _0x3ef17f['status'](_0x5ce687)[_0x147c('0x17')]();};}function respondWithResult(_0x1a65e8,_0x22012d){_0x22012d=_0x22012d||0xc8;return function(_0x110e59){if(_0x110e59){return _0x1a65e8['status'](_0x22012d)[_0x147c('0x18')](_0x110e59);}};}function respondWithFilteredResult(_0x2f36c9,_0x6c2308){return function(_0x3b2e40){if(_0x3b2e40){var _0x4dc26f=_0x3b2e40[_0x147c('0x19')],_0x58f13d=_0x6c2308[_0x147c('0x1a')],_0x3732ba=_0x6c2308[_0x147c('0x1a')]+_0x6c2308[_0x147c('0x1b')],_0x567832;if(_0x3732ba>=_0x4dc26f){_0x3732ba=_0x4dc26f;_0x567832=0xc8;}else{_0x567832=0xce;}_0x2f36c9[_0x147c('0x1c')](_0x567832);return _0x2f36c9[_0x147c('0x1d')](_0x147c('0x1e'),_0x58f13d+'-'+_0x3732ba+'/'+_0x4dc26f)[_0x147c('0x18')](_0x3b2e40);}return null;};}function patchUpdates(_0x2f70fc){return function(_0x5a1fef){try{jsonpatch[_0x147c('0x1f')](_0x5a1fef,_0x2f70fc,!![]);}catch(_0x1db291){return BPromise[_0x147c('0x20')](_0x1db291);}return _0x5a1fef[_0x147c('0x21')]();};}function saveUpdates(_0x7fc77d,_0x2149c0){return function(_0x33aadd){if(_0x33aadd){return _0x33aadd[_0x147c('0x22')](_0x7fc77d)[_0x147c('0x23')](function(_0x4fa0a3){return _0x4fa0a3;});}return null;};}function removeEntity(_0x493eff,_0x53d164){return function(_0x75447f){if(_0x75447f){return _0x75447f[_0x147c('0x24')]()['then'](function(){_0x493eff[_0x147c('0x1c')](0xcc)[_0x147c('0x17')]();});}};}function handleEntityNotFound(_0x3503c8,_0x4cf9b6){return function(_0x533f66){if(!_0x533f66){_0x3503c8[_0x147c('0x25')](0x194);}return _0x533f66;};}function handleError(_0x2b162c,_0x47324d){_0x47324d=_0x47324d||0x1f4;return function(_0x3b2483){logger[_0x147c('0x26')](_0x3b2483[_0x147c('0x27')]);if(_0x3b2483[_0x147c('0x28')]){delete _0x3b2483[_0x147c('0x28')];}_0x2b162c[_0x147c('0x1c')](_0x47324d)[_0x147c('0x29')](_0x3b2483);};}exports[_0x147c('0x2a')]=function(_0x5d57de,_0x29e314){var _0x2f0b86={},_0x222cdb={},_0x12cfcf={'count':0x0,'rows':[]};var _0x21f0ed=db['MailSubstatus']['rawAttributes'];_0x222cdb[_0x147c('0x2b')]=_[_0x147c('0x2c')](_0x21f0ed);_0x222cdb['query']=_[_0x147c('0x2c')](_0x5d57de[_0x147c('0x2d')]);_0x222cdb[_0x147c('0x2e')]=_['intersection'](_0x222cdb['model'],_0x222cdb[_0x147c('0x2d')]);_0x2f0b86[_0x147c('0x2f')]=_['intersection'](_0x222cdb[_0x147c('0x2b')],qs[_0x147c('0x30')](_0x5d57de['query']['fields']));_0x2f0b86[_0x147c('0x2f')]=_0x2f0b86[_0x147c('0x2f')][_0x147c('0x31')]?_0x2f0b86[_0x147c('0x2f')]:_0x222cdb[_0x147c('0x2b')];if(!_0x5d57de[_0x147c('0x2d')][_0x147c('0x32')](_0x147c('0x33'))){_0x2f0b86[_0x147c('0x1b')]=qs[_0x147c('0x1b')](_0x5d57de[_0x147c('0x2d')][_0x147c('0x1b')]);_0x2f0b86['offset']=qs[_0x147c('0x1a')](_0x5d57de[_0x147c('0x2d')][_0x147c('0x1a')]);}_0x2f0b86[_0x147c('0x34')]=qs['sort'](_0x5d57de[_0x147c('0x2d')][_0x147c('0x35')]);_0x2f0b86[_0x147c('0x36')]=qs[_0x147c('0x2e')](_['pick'](_0x5d57de[_0x147c('0x2d')],_0x222cdb[_0x147c('0x2e')]));if(_0x5d57de[_0x147c('0x2d')]['filter']){_0x2f0b86[_0x147c('0x36')]=_['merge'](_0x2f0b86[_0x147c('0x36')],{'$or':_[_0x147c('0x37')](_0x21f0ed,function(_0x410cd6){if(_0x410cd6[_0x147c('0x38')][_0x147c('0x39')]!==_0x147c('0x3a')){var _0x476332={};_0x476332[_0x410cd6[_0x147c('0x3b')]]={'$like':'%'+_0x5d57de[_0x147c('0x2d')][_0x147c('0x3c')]+'%'};return _0x476332;}})});}_0x2f0b86=_['merge']({},_0x2f0b86,_0x5d57de[_0x147c('0x3d')]);var _0x1d6884={'where':_0x2f0b86[_0x147c('0x36')]};return db[_0x147c('0x3e')][_0x147c('0x19')](_0x1d6884)[_0x147c('0x23')](function(_0x4d1d33){_0x12cfcf[_0x147c('0x19')]=_0x4d1d33;if(_0x5d57de[_0x147c('0x2d')][_0x147c('0x3f')]){_0x2f0b86['include']=[{'all':!![]}];}return db[_0x147c('0x3e')][_0x147c('0x40')](_0x2f0b86);})[_0x147c('0x23')](function(_0x2fab91){_0x12cfcf[_0x147c('0x41')]=_0x2fab91;return _0x12cfcf;})[_0x147c('0x23')](respondWithFilteredResult(_0x29e314,_0x2f0b86))['catch'](handleError(_0x29e314,null));};exports[_0x147c('0x42')]=function(_0x5d05f6,_0x1f7512){var _0x4e16e5={'raw':!![],'where':{'id':_0x5d05f6[_0x147c('0x43')]['id']}},_0x12a77b={};_0x12a77b['model']=_[_0x147c('0x2c')](db[_0x147c('0x3e')][_0x147c('0x44')]);_0x12a77b['query']=_['keys'](_0x5d05f6['query']);_0x12a77b['filters']=_[_0x147c('0x45')](_0x12a77b['model'],_0x12a77b[_0x147c('0x2d')]);_0x4e16e5['attributes']=_[_0x147c('0x45')](_0x12a77b['model'],qs['fields'](_0x5d05f6[_0x147c('0x2d')][_0x147c('0x30')]));_0x4e16e5[_0x147c('0x2f')]=_0x4e16e5['attributes'][_0x147c('0x31')]?_0x4e16e5[_0x147c('0x2f')]:_0x12a77b[_0x147c('0x2b')];if(_0x5d05f6[_0x147c('0x2d')][_0x147c('0x3f')]){_0x4e16e5[_0x147c('0x46')]=[{'all':!![]}];}_0x4e16e5=_[_0x147c('0x47')]({},_0x4e16e5,_0x5d05f6[_0x147c('0x3d')]);return db[_0x147c('0x3e')][_0x147c('0x48')](_0x4e16e5)[_0x147c('0x23')](handleEntityNotFound(_0x1f7512,null))['then'](respondWithResult(_0x1f7512,null))['catch'](handleError(_0x1f7512,null));};exports[_0x147c('0x49')]=function(_0x56ddcb,_0x192677){return db['MailSubstatus'][_0x147c('0x49')](_0x56ddcb[_0x147c('0x4a')],{})['then'](respondWithResult(_0x192677,0xc9))['catch'](handleError(_0x192677,null));};exports[_0x147c('0x22')]=function(_0x2324f6,_0x1668d4){if(_0x2324f6[_0x147c('0x4a')]['id']){delete _0x2324f6[_0x147c('0x4a')]['id'];}return db[_0x147c('0x3e')]['find']({'where':{'id':_0x2324f6[_0x147c('0x43')]['id']}})[_0x147c('0x23')](handleEntityNotFound(_0x1668d4,null))[_0x147c('0x23')](saveUpdates(_0x2324f6[_0x147c('0x4a')],null))['then'](respondWithResult(_0x1668d4,null))['catch'](handleError(_0x1668d4,null));};exports[_0x147c('0x24')]=function(_0x540656,_0x425a5d){return db[_0x147c('0x3e')][_0x147c('0x48')]({'where':{'id':_0x540656[_0x147c('0x43')]['id']}})['then'](handleEntityNotFound(_0x425a5d,null))['then'](removeEntity(_0x425a5d,null))['catch'](handleError(_0x425a5d,null));};exports[_0x147c('0x4b')]=function(_0x233cf7,_0x2eeaf9){return db[_0x147c('0x3e')][_0x147c('0x4b')]()[_0x147c('0x23')](respondWithResult(_0x2eeaf9,null))[_0x147c('0x4c')](handleError(_0x2eeaf9,null));};
\ No newline at end of file
+var _0xfa72=['path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','map','type','key','VIRTUAL','field','merge','options','where','MailSubstatus','count','include','rows','catch','show','params','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x284bc3,_0x22dffe){var _0x41ac81=function(_0x47031f){while(--_0x47031f){_0x284bc3['push'](_0x284bc3['shift']());}};_0x41ac81(++_0x22dffe);}(_0xfa72,0x1e9));var _0x2fa7=function(_0x4a23e0,_0x26e163){_0x4a23e0=_0x4a23e0-0x0;var _0x3a3a9d=_0xfa72[_0x4a23e0];return _0x3a3a9d;};'use strict';var pdf=require(_0x2fa7('0x0'));var emlformat=require(_0x2fa7('0x1'));var rimraf=require(_0x2fa7('0x2'));var zipdir=require(_0x2fa7('0x3'));var jsonpatch=require(_0x2fa7('0x4'));var rp=require('request-promise');var moment=require(_0x2fa7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2fa7('0x6'));var util=require(_0x2fa7('0x7'));var path=require(_0x2fa7('0x8'));var sox=require(_0x2fa7('0x9'));var csv=require(_0x2fa7('0xa'));var ejs=require(_0x2fa7('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2fa7('0xc'));var jsforce=require(_0x2fa7('0xd'));var deskjs=require(_0x2fa7('0xe'));var toCsv=require(_0x2fa7('0xa'));var querystring=require('querystring');var Papa=require(_0x2fa7('0xf'));var Redis=require('ioredis');var authService=require(_0x2fa7('0x10'));var qs=require(_0x2fa7('0x11'));var hardwareService=require(_0x2fa7('0x12'));var logger=require('../../config/logger')(_0x2fa7('0x13'));var utils=require('../../config/utils');var config=require(_0x2fa7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f1a66,_0x556298){_0x556298=_0x556298||0xcc;return function(_0x3b6521){if(_0x3b6521){return _0x1f1a66[_0x2fa7('0x15')](_0x556298);}return _0x1f1a66[_0x2fa7('0x16')](_0x556298)[_0x2fa7('0x17')]();};}function respondWithResult(_0x36ca86,_0x54424c){_0x54424c=_0x54424c||0xc8;return function(_0x3cc6b6){if(_0x3cc6b6){return _0x36ca86[_0x2fa7('0x16')](_0x54424c)[_0x2fa7('0x18')](_0x3cc6b6);}};}function respondWithFilteredResult(_0x5f0aab,_0x2ecf41){return function(_0x4264ef){if(_0x4264ef){var _0x10402e=_0x4264ef['count'],_0x2051d0=_0x2ecf41[_0x2fa7('0x19')],_0x38b9ce=_0x2ecf41[_0x2fa7('0x19')]+_0x2ecf41[_0x2fa7('0x1a')],_0x52a67b;if(_0x38b9ce>=_0x10402e){_0x38b9ce=_0x10402e;_0x52a67b=0xc8;}else{_0x52a67b=0xce;}_0x5f0aab[_0x2fa7('0x16')](_0x52a67b);return _0x5f0aab[_0x2fa7('0x1b')](_0x2fa7('0x1c'),_0x2051d0+'-'+_0x38b9ce+'/'+_0x10402e)[_0x2fa7('0x18')](_0x4264ef);}return null;};}function patchUpdates(_0x3f1a0b){return function(_0x196059){try{jsonpatch[_0x2fa7('0x1d')](_0x196059,_0x3f1a0b,!![]);}catch(_0x330d59){return BPromise[_0x2fa7('0x1e')](_0x330d59);}return _0x196059['save']();};}function saveUpdates(_0x281b40,_0x5f472e){return function(_0x159122){if(_0x159122){return _0x159122[_0x2fa7('0x1f')](_0x281b40)['then'](function(_0xc34143){return _0xc34143;});}return null;};}function removeEntity(_0x5982fa,_0x21e5a9){return function(_0x28d0db){if(_0x28d0db){return _0x28d0db[_0x2fa7('0x20')]()[_0x2fa7('0x21')](function(){_0x5982fa[_0x2fa7('0x16')](0xcc)[_0x2fa7('0x17')]();});}};}function handleEntityNotFound(_0x56bf68,_0x4c5f3d){return function(_0x249241){if(!_0x249241){_0x56bf68[_0x2fa7('0x15')](0x194);}return _0x249241;};}function handleError(_0xe29f6e,_0x24780b){_0x24780b=_0x24780b||0x1f4;return function(_0x2c3815){logger[_0x2fa7('0x22')](_0x2c3815[_0x2fa7('0x23')]);if(_0x2c3815[_0x2fa7('0x24')]){delete _0x2c3815[_0x2fa7('0x24')];}_0xe29f6e['status'](_0x24780b)[_0x2fa7('0x25')](_0x2c3815);};}exports[_0x2fa7('0x26')]=function(_0x64a1fe,_0x158e85){var _0x3d2618={},_0x16197e={},_0x3afcde={'count':0x0,'rows':[]};var _0x14c6cf=db['MailSubstatus']['rawAttributes'];_0x16197e[_0x2fa7('0x27')]=_[_0x2fa7('0x28')](_0x14c6cf);_0x16197e['query']=_[_0x2fa7('0x28')](_0x64a1fe[_0x2fa7('0x29')]);_0x16197e[_0x2fa7('0x2a')]=_[_0x2fa7('0x2b')](_0x16197e[_0x2fa7('0x27')],_0x16197e[_0x2fa7('0x29')]);_0x3d2618[_0x2fa7('0x2c')]=_[_0x2fa7('0x2b')](_0x16197e[_0x2fa7('0x27')],qs[_0x2fa7('0x2d')](_0x64a1fe[_0x2fa7('0x29')][_0x2fa7('0x2d')]));_0x3d2618[_0x2fa7('0x2c')]=_0x3d2618[_0x2fa7('0x2c')]['length']?_0x3d2618['attributes']:_0x16197e[_0x2fa7('0x27')];if(!_0x64a1fe[_0x2fa7('0x29')][_0x2fa7('0x2e')](_0x2fa7('0x2f'))){_0x3d2618[_0x2fa7('0x1a')]=qs['limit'](_0x64a1fe[_0x2fa7('0x29')]['limit']);_0x3d2618[_0x2fa7('0x19')]=qs[_0x2fa7('0x19')](_0x64a1fe['query']['offset']);}_0x3d2618[_0x2fa7('0x30')]=qs[_0x2fa7('0x31')](_0x64a1fe[_0x2fa7('0x29')][_0x2fa7('0x31')]);_0x3d2618['where']=qs['filters'](_['pick'](_0x64a1fe[_0x2fa7('0x29')],_0x16197e[_0x2fa7('0x2a')]));if(_0x64a1fe[_0x2fa7('0x29')][_0x2fa7('0x32')]){_0x3d2618['where']=_['merge'](_0x3d2618['where'],{'$or':_[_0x2fa7('0x33')](_0x14c6cf,function(_0x8a69ac){if(_0x8a69ac[_0x2fa7('0x34')][_0x2fa7('0x35')]!==_0x2fa7('0x36')){var _0x2863da={};_0x2863da[_0x8a69ac[_0x2fa7('0x37')]]={'$like':'%'+_0x64a1fe[_0x2fa7('0x29')]['filter']+'%'};return _0x2863da;}})});}_0x3d2618=_[_0x2fa7('0x38')]({},_0x3d2618,_0x64a1fe[_0x2fa7('0x39')]);var _0x43ef5e={'where':_0x3d2618[_0x2fa7('0x3a')]};return db[_0x2fa7('0x3b')]['count'](_0x43ef5e)[_0x2fa7('0x21')](function(_0x2058de){_0x3afcde[_0x2fa7('0x3c')]=_0x2058de;if(_0x64a1fe['query']['includeAll']){_0x3d2618[_0x2fa7('0x3d')]=[{'all':!![]}];}return db[_0x2fa7('0x3b')]['findAll'](_0x3d2618);})[_0x2fa7('0x21')](function(_0x2c9b67){_0x3afcde[_0x2fa7('0x3e')]=_0x2c9b67;return _0x3afcde;})[_0x2fa7('0x21')](respondWithFilteredResult(_0x158e85,_0x3d2618))[_0x2fa7('0x3f')](handleError(_0x158e85,null));};exports[_0x2fa7('0x40')]=function(_0x1d8edf,_0x1a4268){var _0x3cdb81={'raw':!![],'where':{'id':_0x1d8edf[_0x2fa7('0x41')]['id']}},_0xe45af8={};_0xe45af8['model']=_[_0x2fa7('0x28')](db['MailSubstatus']['rawAttributes']);_0xe45af8['query']=_[_0x2fa7('0x28')](_0x1d8edf[_0x2fa7('0x29')]);_0xe45af8[_0x2fa7('0x2a')]=_[_0x2fa7('0x2b')](_0xe45af8[_0x2fa7('0x27')],_0xe45af8['query']);_0x3cdb81[_0x2fa7('0x2c')]=_['intersection'](_0xe45af8[_0x2fa7('0x27')],qs[_0x2fa7('0x2d')](_0x1d8edf[_0x2fa7('0x29')][_0x2fa7('0x2d')]));_0x3cdb81[_0x2fa7('0x2c')]=_0x3cdb81['attributes']['length']?_0x3cdb81['attributes']:_0xe45af8[_0x2fa7('0x27')];if(_0x1d8edf[_0x2fa7('0x29')][_0x2fa7('0x42')]){_0x3cdb81['include']=[{'all':!![]}];}_0x3cdb81=_[_0x2fa7('0x38')]({},_0x3cdb81,_0x1d8edf['options']);return db[_0x2fa7('0x3b')][_0x2fa7('0x43')](_0x3cdb81)['then'](handleEntityNotFound(_0x1a4268,null))[_0x2fa7('0x21')](respondWithResult(_0x1a4268,null))[_0x2fa7('0x3f')](handleError(_0x1a4268,null));};exports[_0x2fa7('0x44')]=function(_0xd0f6b7,_0x35ba65){return db['MailSubstatus'][_0x2fa7('0x44')](_0xd0f6b7['body'],{})[_0x2fa7('0x21')](respondWithResult(_0x35ba65,0xc9))[_0x2fa7('0x3f')](handleError(_0x35ba65,null));};exports['update']=function(_0xcfd010,_0x3d0abf){if(_0xcfd010[_0x2fa7('0x45')]['id']){delete _0xcfd010['body']['id'];}return db[_0x2fa7('0x3b')][_0x2fa7('0x43')]({'where':{'id':_0xcfd010['params']['id']}})[_0x2fa7('0x21')](handleEntityNotFound(_0x3d0abf,null))[_0x2fa7('0x21')](saveUpdates(_0xcfd010['body'],null))[_0x2fa7('0x21')](respondWithResult(_0x3d0abf,null))[_0x2fa7('0x3f')](handleError(_0x3d0abf,null));};exports[_0x2fa7('0x20')]=function(_0x3c7d14,_0x6dc445){return db[_0x2fa7('0x3b')][_0x2fa7('0x43')]({'where':{'id':_0x3c7d14[_0x2fa7('0x41')]['id']}})[_0x2fa7('0x21')](handleEntityNotFound(_0x6dc445,null))['then'](removeEntity(_0x6dc445,null))[_0x2fa7('0x3f')](handleError(_0x6dc445,null));};exports[_0x2fa7('0x46')]=function(_0x3f8b17,_0x35a45b){return db[_0x2fa7('0x3b')]['describe']()[_0x2fa7('0x21')](respondWithResult(_0x35a45b,null))[_0x2fa7('0x3f')](handleError(_0x35a45b,null));};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js
index 3d0b3ec..e4bee4c 100644
--- a/server/api/mailSubstatus/mailSubstatus.model.js
+++ b/server/api/mailSubstatus/mailSubstatus.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x110d=['define','mail_substatuses','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4101ab,_0x1777e6){var _0x4eaf40=function(_0x494db7){while(--_0x494db7){_0x4101ab['push'](_0x4101ab['shift']());}};_0x4eaf40(++_0x1777e6);}(_0x110d,0x8e));var _0xd110=function(_0x45c856,_0x5e6a1e){_0x45c856=_0x45c856-0x0;var _0x4961aa=_0x110d[_0x45c856];return _0x4961aa;};'use strict';var _=require(_0xd110('0x0'));var util=require(_0xd110('0x1'));var logger=require(_0xd110('0x2'))('api');var moment=require(_0xd110('0x3'));var BPromise=require(_0xd110('0x4'));var rp=require(_0xd110('0x5'));var fs=require('fs');var path=require(_0xd110('0x6'));var rimraf=require('rimraf');var config=require(_0xd110('0x7'));var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0xadafdf,_0x1b1c4a){return _0xadafdf[_0xd110('0x8')]('MailSubstatus',attributes,{'tableName':_0xd110('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x45f6=['request-promise','path','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45f6,0x6a));var _0x645f=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0x45f6[_0x10df18];return _0x1f9a1d;};'use strict';var _=require(_0x645f('0x0'));var util=require('util');var logger=require(_0x645f('0x1'))('api');var moment=require(_0x645f('0x2'));var BPromise=require(_0x645f('0x3'));var rp=require(_0x645f('0x4'));var fs=require('fs');var path=require(_0x645f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x645f('0x6'));module[_0x645f('0x7')]=function(_0x1af7c4,_0x40a6a8){return _0x1af7c4[_0x645f('0x8')](_0x645f('0x9'),attributes,{'tableName':_0x645f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js
index f73acef..b223bf2 100644
--- a/server/api/mailSubstatus/mailSubstatus.rpc.js
+++ b/server/api/mailSubstatus/mailSubstatus.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x50f6=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3e4e06,_0x577430){var _0x58e857=function(_0x19dc70){while(--_0x19dc70){_0x3e4e06['push'](_0x3e4e06['shift']());}};_0x58e857(++_0x577430);}(_0x50f6,0x11f));var _0x650f=function(_0x4f4107,_0x342cd4){_0x4f4107=_0x4f4107-0x0;var _0x2f02bc=_0x50f6[_0x4f4107];return _0x2f02bc;};'use strict';var _=require(_0x650f('0x0'));var util=require('util');var moment=require(_0x650f('0x1'));var BPromise=require(_0x650f('0x2'));var rs=require(_0x650f('0x3'));var fs=require('fs');var Redis=require(_0x650f('0x4'));var db=require(_0x650f('0x5'))['db'];var utils=require(_0x650f('0x6'));var logger=require(_0x650f('0x7'))('rpc');var config=require(_0x650f('0x8'));var jayson=require(_0x650f('0x9'));var client=jayson['client'][_0x650f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x282d29,_0x2c89d3,_0xed02a0){return new BPromise(function(_0xb60f65,_0x324481){return client[_0x650f('0xb')](_0x282d29,_0xed02a0)['then'](function(_0x14d442){logger[_0x650f('0xc')](_0x650f('0xd'),_0x2c89d3,_0x650f('0xe'));logger['debug'](_0x650f('0xf'),_0x2c89d3,_0x650f('0xe'),JSON[_0x650f('0x10')](_0x14d442));if(_0x14d442[_0x650f('0x11')]){if(_0x14d442[_0x650f('0x11')][_0x650f('0x12')]===0x1f4){logger[_0x650f('0x11')](_0x650f('0xd'),_0x2c89d3,_0x14d442[_0x650f('0x11')][_0x650f('0x13')]);return _0x324481(_0x14d442[_0x650f('0x11')][_0x650f('0x13')]);}logger[_0x650f('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x2c89d3,_0x14d442[_0x650f('0x11')][_0x650f('0x13')]);return _0xb60f65(_0x14d442['error']['message']);}else{logger[_0x650f('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x2c89d3,'request\x20sent');_0xb60f65(_0x14d442[_0x650f('0x14')][_0x650f('0x13')]);}})[_0x650f('0x15')](function(_0x30ef81){logger[_0x650f('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x2c89d3,_0x30ef81);_0x324481(_0x30ef81);});});}
\ No newline at end of file
+var _0x5906=['debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5906,0x85));var _0x6590=function(_0xa0ab96,_0x1ab94c){_0xa0ab96=_0xa0ab96-0x0;var _0x5c6d3a=_0x5906[_0xa0ab96];return _0x5c6d3a;};'use strict';var _=require(_0x6590('0x0'));var util=require(_0x6590('0x1'));var moment=require(_0x6590('0x2'));var BPromise=require('bluebird');var rs=require(_0x6590('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6590('0x4'))['db'];var utils=require(_0x6590('0x5'));var logger=require(_0x6590('0x6'))(_0x6590('0x7'));var config=require(_0x6590('0x8'));var jayson=require(_0x6590('0x9'));var client=jayson['client'][_0x6590('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e06ff,_0x5059d1,_0x2995ea){return new BPromise(function(_0x7dc709,_0x1ba463){return client[_0x6590('0xb')](_0x3e06ff,_0x2995ea)['then'](function(_0x2e291e){logger[_0x6590('0xc')](_0x6590('0xd'),_0x5059d1,'request\x20sent');logger[_0x6590('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5059d1,_0x6590('0xf'),JSON[_0x6590('0x10')](_0x2e291e));if(_0x2e291e[_0x6590('0x11')]){if(_0x2e291e[_0x6590('0x11')][_0x6590('0x12')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x5059d1,_0x2e291e[_0x6590('0x11')]['message']);return _0x1ba463(_0x2e291e[_0x6590('0x11')][_0x6590('0x13')]);}logger['error'](_0x6590('0xd'),_0x5059d1,_0x2e291e['error'][_0x6590('0x13')]);return _0x7dc709(_0x2e291e[_0x6590('0x11')]['message']);}else{logger['info'](_0x6590('0xd'),_0x5059d1,_0x6590('0xf'));_0x7dc709(_0x2e291e[_0x6590('0x14')][_0x6590('0x13')]);}})['catch'](function(_0x1d2f03){logger['error'](_0x6590('0xd'),_0x5059d1,_0x1d2f03);_0x1ba463(_0x1d2f03);});});}
\ No newline at end of file
diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js
index 079426f..4425a3e 100644
--- a/server/api/mailTransferReport/index.js
+++ b/server/api/mailTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6b8f=['isAuthenticated','/describe','describe','post','create','put','/:id','destroy','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get'];(function(_0x276098,_0x3bb8b3){var _0x3e7506=function(_0x5b474d){while(--_0x5b474d){_0x276098['push'](_0x276098['shift']());}};_0x3e7506(++_0x3bb8b3);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x479d18,_0x3e10e7){_0x479d18=_0x479d18-0x0;var _0x4348cf=_0x6b8f[_0x479d18];return _0x4348cf;};'use strict';var multer=require('multer');var util=require(_0xf6b8('0x0'));var path=require('path');var timeout=require(_0xf6b8('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xf6b8('0x2'));var interaction=require(_0xf6b8('0x3'));var config=require('../../config/environment');var controller=require(_0xf6b8('0x4'));router[_0xf6b8('0x5')]('/',auth[_0xf6b8('0x6')](),controller['index']);router[_0xf6b8('0x5')](_0xf6b8('0x7'),auth[_0xf6b8('0x6')](),controller[_0xf6b8('0x8')]);router['get']('/:id',auth[_0xf6b8('0x6')](),controller['show']);router[_0xf6b8('0x9')]('/',auth[_0xf6b8('0x6')](),controller[_0xf6b8('0xa')]);router[_0xf6b8('0xb')](_0xf6b8('0xc'),auth[_0xf6b8('0x6')](),controller['update']);router['delete']('/:id',auth[_0xf6b8('0x6')](),controller[_0xf6b8('0xd')]);module[_0xf6b8('0xe')]=router;
\ No newline at end of file
+var _0xd046=['delete','isAuthenticated','exports','util','path','connect-timeout','Router','../../config/environment','get','/describe','/:id','post','create','update'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd046,0x129));var _0x6d04=function(_0x41bf01,_0x582998){_0x41bf01=_0x41bf01-0x0;var _0x18509a=_0xd046[_0x41bf01];return _0x18509a;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d04('0x4'));var controller=require('./mailTransferReport.controller');router[_0x6d04('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6d04('0x5')](_0x6d04('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x6d04('0x5')](_0x6d04('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x6d04('0x8')]('/',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6d04('0xa')]);router[_0x6d04('0xb')](_0x6d04('0x7'),auth[_0x6d04('0xc')](),controller['destroy']);module[_0x6d04('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js
index 6c75c3b..8c48ffc 100644
--- a/server/api/mailTransferReport/mailTransferReport.attributes.js
+++ b/server/api/mailTransferReport/mailTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0226=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM'];(function(_0x4d39c3,_0x2c300d){var _0x4a1122=function(_0x5e7285){while(--_0x5e7285){_0x4d39c3['push'](_0x4d39c3['shift']());}};_0x4a1122(++_0x2c300d);}(_0x0226,0x159));var _0x6022=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x0226[_0x2ed8f3];return _0x525a55;};'use strict';var moment=require(_0x6022('0x0'));var Sequelize=require(_0x6022('0x1'));module[_0x6022('0x2')]={'uniqueid':{'type':Sequelize[_0x6022('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x6022('0x4')](_0x6022('0x5'),_0x6022('0x6'),_0x6022('0x7')),'allowNull':![],'defaultValue':_0x6022('0x7')},'transferredAt':{'type':Sequelize[_0x6022('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x6022('0x9')]}};
\ No newline at end of file
+var _0xfbfc=['moment','STRING','account','agent','queue','NOW'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xfbfc,0x14a));var _0xcfbf=function(_0x1398ba,_0x2a6e18){_0x1398ba=_0x1398ba-0x0;var _0x20daa5=_0xfbfc[_0x1398ba];return _0x20daa5;};'use strict';var moment=require(_0xcfbf('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xcfbf('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xcfbf('0x2'),_0xcfbf('0x3'),_0xcfbf('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xcfbf('0x5')]}};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js
index a9a184a..62f091f 100644
--- a/server/api/mailTransferReport/mailTransferReport.controller.js
+++ b/server/api/mailTransferReport/mailTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf90=['keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','field','count','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','update','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','MailTransferReport','rawAttributes','model'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xaf90,0x1e3));var _0x0af9=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xaf90[_0x311c35];return _0x5cc50c;};'use strict';var pdf=require(_0x0af9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0af9('0x1'));var jsonpatch=require(_0x0af9('0x2'));var rp=require(_0x0af9('0x3'));var moment=require(_0x0af9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0af9('0x5'));var util=require(_0x0af9('0x6'));var path=require(_0x0af9('0x7'));var sox=require(_0x0af9('0x8'));var csv=require('to-csv');var ejs=require(_0x0af9('0x9'));var fs=require('fs');var _=require(_0x0af9('0xa'));var squel=require('squel');var crypto=require(_0x0af9('0xb'));var jsforce=require(_0x0af9('0xc'));var deskjs=require(_0x0af9('0xd'));var toCsv=require(_0x0af9('0xe'));var querystring=require(_0x0af9('0xf'));var Papa=require('papaparse');var Redis=require(_0x0af9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0af9('0x11'));var hardwareService=require(_0x0af9('0x12'));var logger=require(_0x0af9('0x13'))(_0x0af9('0x14'));var utils=require('../../config/utils');var config=require(_0x0af9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf195e5,_0x1152d1){_0x1152d1=_0x1152d1||0xcc;return function(_0x46ba18){if(_0x46ba18){return _0xf195e5[_0x0af9('0x16')](_0x1152d1);}return _0xf195e5['status'](_0x1152d1)[_0x0af9('0x17')]();};}function respondWithResult(_0x2a6c0b,_0x25f074){_0x25f074=_0x25f074||0xc8;return function(_0x1d2a65){if(_0x1d2a65){return _0x2a6c0b[_0x0af9('0x18')](_0x25f074)[_0x0af9('0x19')](_0x1d2a65);}};}function respondWithFilteredResult(_0x2d482f,_0x37488f){return function(_0x100bad){if(_0x100bad){var _0x4ede8c=_0x100bad['count'],_0x324a3a=_0x37488f[_0x0af9('0x1a')],_0x58358a=_0x37488f[_0x0af9('0x1a')]+_0x37488f['limit'],_0x1c88da;if(_0x58358a>=_0x4ede8c){_0x58358a=_0x4ede8c;_0x1c88da=0xc8;}else{_0x1c88da=0xce;}_0x2d482f[_0x0af9('0x18')](_0x1c88da);return _0x2d482f[_0x0af9('0x1b')](_0x0af9('0x1c'),_0x324a3a+'-'+_0x58358a+'/'+_0x4ede8c)[_0x0af9('0x19')](_0x100bad);}return null;};}function patchUpdates(_0x23f7f3){return function(_0x17e698){try{jsonpatch[_0x0af9('0x1d')](_0x17e698,_0x23f7f3,!![]);}catch(_0x3577f4){return BPromise[_0x0af9('0x1e')](_0x3577f4);}return _0x17e698[_0x0af9('0x1f')]();};}function saveUpdates(_0xf79ad,_0x2f0078){return function(_0x2dd0ce){if(_0x2dd0ce){return _0x2dd0ce['update'](_0xf79ad)[_0x0af9('0x20')](function(_0x4e38bd){return _0x4e38bd;});}return null;};}function removeEntity(_0x93faf6,_0xb837cc){return function(_0x25af39){if(_0x25af39){return _0x25af39[_0x0af9('0x21')]()['then'](function(){_0x93faf6[_0x0af9('0x18')](0xcc)[_0x0af9('0x17')]();});}};}function handleEntityNotFound(_0x4274d1,_0x11c051){return function(_0x2d2cca){if(!_0x2d2cca){_0x4274d1[_0x0af9('0x16')](0x194);}return _0x2d2cca;};}function handleError(_0x17bb26,_0x526b7){_0x526b7=_0x526b7||0x1f4;return function(_0x235ddc){logger[_0x0af9('0x22')](_0x235ddc[_0x0af9('0x23')]);if(_0x235ddc['name']){delete _0x235ddc[_0x0af9('0x24')];}_0x17bb26[_0x0af9('0x18')](_0x526b7)[_0x0af9('0x25')](_0x235ddc);};}exports[_0x0af9('0x26')]=function(_0x9ec64e,_0x4d61ae){var _0xa86ae8={},_0x2e5633={},_0x163832={'count':0x0,'rows':[]};var _0x3ef489=db[_0x0af9('0x27')][_0x0af9('0x28')];_0x2e5633[_0x0af9('0x29')]=_[_0x0af9('0x2a')](_0x3ef489);_0x2e5633[_0x0af9('0x2b')]=_['keys'](_0x9ec64e[_0x0af9('0x2b')]);_0x2e5633[_0x0af9('0x2c')]=_[_0x0af9('0x2d')](_0x2e5633[_0x0af9('0x29')],_0x2e5633[_0x0af9('0x2b')]);_0xa86ae8[_0x0af9('0x2e')]=_[_0x0af9('0x2d')](_0x2e5633['model'],qs[_0x0af9('0x2f')](_0x9ec64e[_0x0af9('0x2b')][_0x0af9('0x2f')]));_0xa86ae8[_0x0af9('0x2e')]=_0xa86ae8[_0x0af9('0x2e')][_0x0af9('0x30')]?_0xa86ae8['attributes']:_0x2e5633['model'];if(!_0x9ec64e['query']['hasOwnProperty'](_0x0af9('0x31'))){_0xa86ae8[_0x0af9('0x32')]=qs[_0x0af9('0x32')](_0x9ec64e[_0x0af9('0x2b')][_0x0af9('0x32')]);_0xa86ae8[_0x0af9('0x1a')]=qs[_0x0af9('0x1a')](_0x9ec64e[_0x0af9('0x2b')][_0x0af9('0x1a')]);}_0xa86ae8[_0x0af9('0x33')]=qs[_0x0af9('0x34')](_0x9ec64e['query'][_0x0af9('0x34')]);_0xa86ae8['where']=qs[_0x0af9('0x2c')](_[_0x0af9('0x35')](_0x9ec64e['query'],_0x2e5633['filters']));if(_0x9ec64e[_0x0af9('0x2b')][_0x0af9('0x36')]){_0xa86ae8[_0x0af9('0x37')]=_[_0x0af9('0x38')](_0xa86ae8[_0x0af9('0x37')],{'$or':_[_0x0af9('0x39')](_0x3ef489,function(_0x3609ee){if(_0x3609ee[_0x0af9('0x3a')][_0x0af9('0x3b')]!=='VIRTUAL'){var _0x4079af={};_0x4079af[_0x3609ee[_0x0af9('0x3c')]]={'$like':'%'+_0x9ec64e[_0x0af9('0x2b')][_0x0af9('0x36')]+'%'};return _0x4079af;}})});}_0xa86ae8=_['merge']({},_0xa86ae8,_0x9ec64e['options']);var _0x5d4534={'where':_0xa86ae8['where']};return db[_0x0af9('0x27')][_0x0af9('0x3d')](_0x5d4534)['then'](function(_0x43fc7d){_0x163832[_0x0af9('0x3d')]=_0x43fc7d;if(_0x9ec64e['query'][_0x0af9('0x3e')]){_0xa86ae8[_0x0af9('0x3f')]=[{'all':!![]}];}return db[_0x0af9('0x27')][_0x0af9('0x40')](_0xa86ae8);})[_0x0af9('0x20')](function(_0x3fbb30){_0x163832[_0x0af9('0x41')]=_0x3fbb30;return _0x163832;})[_0x0af9('0x20')](respondWithFilteredResult(_0x4d61ae,_0xa86ae8))['catch'](handleError(_0x4d61ae,null));};exports[_0x0af9('0x42')]=function(_0x18576b,_0x3015a7){var _0x3d4a0d={'raw':!![],'where':{'id':_0x18576b[_0x0af9('0x43')]['id']}},_0x3cdb8d={};_0x3cdb8d['model']=_[_0x0af9('0x2a')](db['MailTransferReport'][_0x0af9('0x28')]);_0x3cdb8d[_0x0af9('0x2b')]=_[_0x0af9('0x2a')](_0x18576b['query']);_0x3cdb8d['filters']=_[_0x0af9('0x2d')](_0x3cdb8d[_0x0af9('0x29')],_0x3cdb8d['query']);_0x3d4a0d[_0x0af9('0x2e')]=_[_0x0af9('0x2d')](_0x3cdb8d['model'],qs[_0x0af9('0x2f')](_0x18576b[_0x0af9('0x2b')][_0x0af9('0x2f')]));_0x3d4a0d[_0x0af9('0x2e')]=_0x3d4a0d[_0x0af9('0x2e')][_0x0af9('0x30')]?_0x3d4a0d['attributes']:_0x3cdb8d[_0x0af9('0x29')];if(_0x18576b[_0x0af9('0x2b')]['includeAll']){_0x3d4a0d[_0x0af9('0x3f')]=[{'all':!![]}];}_0x3d4a0d=_[_0x0af9('0x38')]({},_0x3d4a0d,_0x18576b[_0x0af9('0x44')]);return db[_0x0af9('0x27')][_0x0af9('0x45')](_0x3d4a0d)[_0x0af9('0x20')](handleEntityNotFound(_0x3015a7,null))[_0x0af9('0x20')](respondWithResult(_0x3015a7,null))[_0x0af9('0x46')](handleError(_0x3015a7,null));};exports[_0x0af9('0x47')]=function(_0x516a65,_0xee6ea2){return db[_0x0af9('0x27')][_0x0af9('0x47')](_0x516a65[_0x0af9('0x48')],{})['then'](respondWithResult(_0xee6ea2,0xc9))[_0x0af9('0x46')](handleError(_0xee6ea2,null));};exports[_0x0af9('0x49')]=function(_0x55375e,_0x519864){if(_0x55375e[_0x0af9('0x48')]['id']){delete _0x55375e[_0x0af9('0x48')]['id'];}return db[_0x0af9('0x27')]['find']({'where':{'id':_0x55375e[_0x0af9('0x43')]['id']}})[_0x0af9('0x20')](handleEntityNotFound(_0x519864,null))[_0x0af9('0x20')](saveUpdates(_0x55375e[_0x0af9('0x48')],null))[_0x0af9('0x20')](respondWithResult(_0x519864,null))[_0x0af9('0x46')](handleError(_0x519864,null));};exports[_0x0af9('0x21')]=function(_0x29ca7e,_0x208d94){return db[_0x0af9('0x27')][_0x0af9('0x45')]({'where':{'id':_0x29ca7e[_0x0af9('0x43')]['id']}})[_0x0af9('0x20')](handleEntityNotFound(_0x208d94,null))[_0x0af9('0x20')](removeEntity(_0x208d94,null))[_0x0af9('0x46')](handleError(_0x208d94,null));};exports['describe']=function(_0x1de647,_0x1e96c3){return db[_0x0af9('0x27')][_0x0af9('0x4a')]()[_0x0af9('0x20')](respondWithResult(_0x1e96c3,null))[_0x0af9('0x46')](handleError(_0x1e96c3,null));};
\ No newline at end of file
+var _0xa588=['params','fields','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','send','index','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','filters','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','MailTransferReport','findAll','catch','show'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa588,0x169));var _0x8a58=function(_0x34ad46,_0x6fbd0c){_0x34ad46=_0x34ad46-0x0;var _0xbdd4ea=_0xa588[_0x34ad46];return _0xbdd4ea;};'use strict';var pdf=require(_0x8a58('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8a58('0x1'));var zipdir=require(_0x8a58('0x2'));var jsonpatch=require(_0x8a58('0x3'));var rp=require(_0x8a58('0x4'));var moment=require(_0x8a58('0x5'));var BPromise=require(_0x8a58('0x6'));var Mustache=require(_0x8a58('0x7'));var util=require('util');var path=require(_0x8a58('0x8'));var sox=require(_0x8a58('0x9'));var csv=require(_0x8a58('0xa'));var ejs=require(_0x8a58('0xb'));var fs=require('fs');var _=require(_0x8a58('0xc'));var squel=require(_0x8a58('0xd'));var crypto=require(_0x8a58('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8a58('0xf'));var Papa=require(_0x8a58('0x10'));var Redis=require(_0x8a58('0x11'));var authService=require(_0x8a58('0x12'));var qs=require(_0x8a58('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8a58('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8a58('0x15'))['db'];function respondWithStatusCode(_0x12a8d7,_0x2727d1){_0x2727d1=_0x2727d1||0xcc;return function(_0x10d16c){if(_0x10d16c){return _0x12a8d7[_0x8a58('0x16')](_0x2727d1);}return _0x12a8d7[_0x8a58('0x17')](_0x2727d1)['end']();};}function respondWithResult(_0x79886e,_0x572aa4){_0x572aa4=_0x572aa4||0xc8;return function(_0x3925c5){if(_0x3925c5){return _0x79886e[_0x8a58('0x17')](_0x572aa4)[_0x8a58('0x18')](_0x3925c5);}};}function respondWithFilteredResult(_0x3ae9e0,_0x381a3e){return function(_0x49a908){if(_0x49a908){var _0x90add5=_0x49a908[_0x8a58('0x19')],_0x528e5b=_0x381a3e[_0x8a58('0x1a')],_0x814eca=_0x381a3e[_0x8a58('0x1a')]+_0x381a3e['limit'],_0x3a2368;if(_0x814eca>=_0x90add5){_0x814eca=_0x90add5;_0x3a2368=0xc8;}else{_0x3a2368=0xce;}_0x3ae9e0['status'](_0x3a2368);return _0x3ae9e0[_0x8a58('0x1b')](_0x8a58('0x1c'),_0x528e5b+'-'+_0x814eca+'/'+_0x90add5)[_0x8a58('0x18')](_0x49a908);}return null;};}function patchUpdates(_0x47b730){return function(_0x42d0f0){try{jsonpatch['apply'](_0x42d0f0,_0x47b730,!![]);}catch(_0x19138d){return BPromise[_0x8a58('0x1d')](_0x19138d);}return _0x42d0f0[_0x8a58('0x1e')]();};}function saveUpdates(_0x2b8a67,_0x16ebaa){return function(_0xf1849){if(_0xf1849){return _0xf1849[_0x8a58('0x1f')](_0x2b8a67)[_0x8a58('0x20')](function(_0x5787bb){return _0x5787bb;});}return null;};}function removeEntity(_0x50bb4f,_0x2632fa){return function(_0x19a99d){if(_0x19a99d){return _0x19a99d[_0x8a58('0x21')]()[_0x8a58('0x20')](function(){_0x50bb4f[_0x8a58('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x565481,_0x13676f){return function(_0x17a0b2){if(!_0x17a0b2){_0x565481['sendStatus'](0x194);}return _0x17a0b2;};}function handleError(_0x11e321,_0x57e20b){_0x57e20b=_0x57e20b||0x1f4;return function(_0x45674e){logger[_0x8a58('0x22')](_0x45674e[_0x8a58('0x23')]);if(_0x45674e['name']){delete _0x45674e['name'];}_0x11e321[_0x8a58('0x17')](_0x57e20b)[_0x8a58('0x24')](_0x45674e);};}exports[_0x8a58('0x25')]=function(_0x1f5fb2,_0x549485){var _0x29393c={},_0x9142ca={},_0x4d7962={'count':0x0,'rows':[]};var _0x5eeb25=db['MailTransferReport'][_0x8a58('0x26')];_0x9142ca[_0x8a58('0x27')]=_['keys'](_0x5eeb25);_0x9142ca['query']=_[_0x8a58('0x28')](_0x1f5fb2[_0x8a58('0x29')]);_0x9142ca['filters']=_[_0x8a58('0x2a')](_0x9142ca[_0x8a58('0x27')],_0x9142ca[_0x8a58('0x29')]);_0x29393c['attributes']=_[_0x8a58('0x2a')](_0x9142ca[_0x8a58('0x27')],qs['fields'](_0x1f5fb2[_0x8a58('0x29')]['fields']));_0x29393c['attributes']=_0x29393c[_0x8a58('0x2b')][_0x8a58('0x2c')]?_0x29393c[_0x8a58('0x2b')]:_0x9142ca[_0x8a58('0x27')];if(!_0x1f5fb2[_0x8a58('0x29')][_0x8a58('0x2d')](_0x8a58('0x2e'))){_0x29393c[_0x8a58('0x2f')]=qs[_0x8a58('0x2f')](_0x1f5fb2[_0x8a58('0x29')][_0x8a58('0x2f')]);_0x29393c[_0x8a58('0x1a')]=qs[_0x8a58('0x1a')](_0x1f5fb2[_0x8a58('0x29')][_0x8a58('0x1a')]);}_0x29393c[_0x8a58('0x30')]=qs['sort'](_0x1f5fb2[_0x8a58('0x29')]['sort']);_0x29393c['where']=qs[_0x8a58('0x31')](_['pick'](_0x1f5fb2[_0x8a58('0x29')],_0x9142ca['filters']));if(_0x1f5fb2['query'][_0x8a58('0x32')]){_0x29393c[_0x8a58('0x33')]=_[_0x8a58('0x34')](_0x29393c[_0x8a58('0x33')],{'$or':_[_0x8a58('0x35')](_0x5eeb25,function(_0x374215){if(_0x374215[_0x8a58('0x36')][_0x8a58('0x37')]!==_0x8a58('0x38')){var _0xb77c77={};_0xb77c77[_0x374215[_0x8a58('0x39')]]={'$like':'%'+_0x1f5fb2[_0x8a58('0x29')][_0x8a58('0x32')]+'%'};return _0xb77c77;}})});}_0x29393c=_['merge']({},_0x29393c,_0x1f5fb2[_0x8a58('0x3a')]);var _0x3659e2={'where':_0x29393c[_0x8a58('0x33')]};return db['MailTransferReport'][_0x8a58('0x19')](_0x3659e2)[_0x8a58('0x20')](function(_0x1b4993){_0x4d7962[_0x8a58('0x19')]=_0x1b4993;if(_0x1f5fb2[_0x8a58('0x29')][_0x8a58('0x3b')]){_0x29393c[_0x8a58('0x3c')]=[{'all':!![]}];}return db[_0x8a58('0x3d')][_0x8a58('0x3e')](_0x29393c);})['then'](function(_0x1b6d6a){_0x4d7962['rows']=_0x1b6d6a;return _0x4d7962;})[_0x8a58('0x20')](respondWithFilteredResult(_0x549485,_0x29393c))[_0x8a58('0x3f')](handleError(_0x549485,null));};exports[_0x8a58('0x40')]=function(_0x33eb69,_0x1f815b){var _0x3ba772={'raw':!![],'where':{'id':_0x33eb69[_0x8a58('0x41')]['id']}},_0x2c2085={};_0x2c2085[_0x8a58('0x27')]=_[_0x8a58('0x28')](db[_0x8a58('0x3d')][_0x8a58('0x26')]);_0x2c2085[_0x8a58('0x29')]=_[_0x8a58('0x28')](_0x33eb69[_0x8a58('0x29')]);_0x2c2085[_0x8a58('0x31')]=_[_0x8a58('0x2a')](_0x2c2085[_0x8a58('0x27')],_0x2c2085[_0x8a58('0x29')]);_0x3ba772[_0x8a58('0x2b')]=_['intersection'](_0x2c2085['model'],qs[_0x8a58('0x42')](_0x33eb69['query'][_0x8a58('0x42')]));_0x3ba772['attributes']=_0x3ba772[_0x8a58('0x2b')][_0x8a58('0x2c')]?_0x3ba772['attributes']:_0x2c2085[_0x8a58('0x27')];if(_0x33eb69[_0x8a58('0x29')][_0x8a58('0x3b')]){_0x3ba772[_0x8a58('0x3c')]=[{'all':!![]}];}_0x3ba772=_[_0x8a58('0x34')]({},_0x3ba772,_0x33eb69[_0x8a58('0x3a')]);return db[_0x8a58('0x3d')][_0x8a58('0x43')](_0x3ba772)[_0x8a58('0x20')](handleEntityNotFound(_0x1f815b,null))[_0x8a58('0x20')](respondWithResult(_0x1f815b,null))[_0x8a58('0x3f')](handleError(_0x1f815b,null));};exports[_0x8a58('0x44')]=function(_0x282a6f,_0x4ff33a){return db['MailTransferReport']['create'](_0x282a6f['body'],{})[_0x8a58('0x20')](respondWithResult(_0x4ff33a,0xc9))['catch'](handleError(_0x4ff33a,null));};exports[_0x8a58('0x1f')]=function(_0x5a7f54,_0x1b7b63){if(_0x5a7f54['body']['id']){delete _0x5a7f54[_0x8a58('0x45')]['id'];}return db[_0x8a58('0x3d')][_0x8a58('0x43')]({'where':{'id':_0x5a7f54[_0x8a58('0x41')]['id']}})[_0x8a58('0x20')](handleEntityNotFound(_0x1b7b63,null))[_0x8a58('0x20')](saveUpdates(_0x5a7f54['body'],null))[_0x8a58('0x20')](respondWithResult(_0x1b7b63,null))['catch'](handleError(_0x1b7b63,null));};exports['destroy']=function(_0x1d6f0e,_0x32fb3d){return db[_0x8a58('0x3d')][_0x8a58('0x43')]({'where':{'id':_0x1d6f0e[_0x8a58('0x41')]['id']}})[_0x8a58('0x20')](handleEntityNotFound(_0x32fb3d,null))[_0x8a58('0x20')](removeEntity(_0x32fb3d,null))[_0x8a58('0x3f')](handleError(_0x32fb3d,null));};exports[_0x8a58('0x46')]=function(_0x25bb91,_0x468860){return db[_0x8a58('0x3d')][_0x8a58('0x46')]()[_0x8a58('0x20')](respondWithResult(_0x468860,null))[_0x8a58('0x3f')](handleError(_0x468860,null));};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js
index c86319a..74849a0 100644
--- a/server/api/mailTransferReport/mailTransferReport.model.js
+++ b/server/api/mailTransferReport/mailTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2ca=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_mail_transfer','uniqueid','lodash','util'];(function(_0x24322c,_0x291896){var _0x53ad8f=function(_0x24a5c8){while(--_0x24a5c8){_0x24322c['push'](_0x24322c['shift']());}};_0x53ad8f(++_0x291896);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xf4add4,_0x5b9cc1){_0xf4add4=_0xf4add4-0x0;var _0x1c42fb=_0xf2ca[_0xf4add4];return _0x1c42fb;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var logger=require(_0xaf2c('0x2'))('api');var moment=require(_0xaf2c('0x3'));var BPromise=require(_0xaf2c('0x4'));var rp=require(_0xaf2c('0x5'));var fs=require('fs');var path=require(_0xaf2c('0x6'));var rimraf=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var attributes=require('./mailTransferReport.attributes');module[_0xaf2c('0x9')]=function(_0x100d17,_0x297740){return _0x100d17[_0xaf2c('0xa')]('MailTransferReport',attributes,{'tableName':_0xaf2c('0xb'),'paranoid':![],'indexes':[{'name':_0xaf2c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','../../config/logger','api'];(function(_0x16c694,_0x75f1f2){var _0x2ee07c=function(_0xd2e5e){while(--_0xd2e5e){_0x16c694['push'](_0x16c694['shift']());}};_0x2ee07c(++_0x75f1f2);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3aeea1,_0x4cfbb9){_0x3aeea1=_0x3aeea1-0x0;var _0x424cc1=_0x7fbe[_0x3aeea1];return _0x424cc1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js
index fa8073d..e382fdc 100644
--- a/server/api/mailTransferReport/mailTransferReport.rpc.js
+++ b/server/api/mailTransferReport/mailTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f7b=['http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1ee358,_0x42fdfb){var _0x4d01b9=function(_0x2ad69d){while(--_0x2ad69d){_0x1ee358['push'](_0x1ee358['shift']());}};_0x4d01b9(++_0x42fdfb);}(_0x5f7b,0xb4));var _0xb5f7=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x5f7b[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0xb5f7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb5f7('0x1'));var fs=require('fs');var Redis=require(_0xb5f7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb5f7('0x3'));var logger=require(_0xb5f7('0x4'))(_0xb5f7('0x5'));var config=require(_0xb5f7('0x6'));var jayson=require(_0xb5f7('0x7'));var client=jayson[_0xb5f7('0x8')][_0xb5f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x561f85,_0x30e47e,_0x5a523d){return new BPromise(function(_0x206181,_0x460fdc){return client[_0xb5f7('0xa')](_0x561f85,_0x5a523d)[_0xb5f7('0xb')](function(_0x317dd4){logger[_0xb5f7('0xc')](_0xb5f7('0xd'),_0x30e47e,_0xb5f7('0xe'));logger['debug'](_0xb5f7('0xf'),_0x30e47e,_0xb5f7('0xe'),JSON[_0xb5f7('0x10')](_0x317dd4));if(_0x317dd4['error']){if(_0x317dd4['error']['code']===0x1f4){logger[_0xb5f7('0x11')](_0xb5f7('0xd'),_0x30e47e,_0x317dd4['error'][_0xb5f7('0x12')]);return _0x460fdc(_0x317dd4[_0xb5f7('0x11')]['message']);}logger[_0xb5f7('0x11')](_0xb5f7('0xd'),_0x30e47e,_0x317dd4['error'][_0xb5f7('0x12')]);return _0x206181(_0x317dd4[_0xb5f7('0x11')][_0xb5f7('0x12')]);}else{logger[_0xb5f7('0xc')](_0xb5f7('0xd'),_0x30e47e,'request\x20sent');_0x206181(_0x317dd4[_0xb5f7('0x13')][_0xb5f7('0x12')]);}})[_0xb5f7('0x14')](function(_0x3652de){logger[_0xb5f7('0x11')](_0xb5f7('0xd'),_0x30e47e,_0x3652de);_0x460fdc(_0x3652de);});});}
\ No newline at end of file
+var _0x72e3=['request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','util','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5de40e,_0x1fb45d){var _0x49c7c7=function(_0x4f8f52){while(--_0x4f8f52){_0x5de40e['push'](_0x5de40e['shift']());}};_0x49c7c7(++_0x1fb45d);}(_0x72e3,0x127));var _0x372e=function(_0x52fe08,_0x529536){_0x52fe08=_0x52fe08-0x0;var _0x506424=_0x72e3[_0x52fe08];return _0x506424;};'use strict';var _=require('lodash');var util=require(_0x372e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x372e('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x372e('0x2'));var logger=require('../../config/logger')(_0x372e('0x3'));var config=require(_0x372e('0x4'));var jayson=require(_0x372e('0x5'));var client=jayson[_0x372e('0x6')][_0x372e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x56bc9c,_0x3b63eb,_0x47cf1a){return new BPromise(function(_0x149876,_0x3d138d){return client[_0x372e('0x8')](_0x56bc9c,_0x47cf1a)[_0x372e('0x9')](function(_0x1e53ad){logger[_0x372e('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x3b63eb,_0x372e('0xb'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x3b63eb,_0x372e('0xb'),JSON[_0x372e('0xc')](_0x1e53ad));if(_0x1e53ad['error']){if(_0x1e53ad[_0x372e('0xd')][_0x372e('0xe')]===0x1f4){logger['error'](_0x372e('0xf'),_0x3b63eb,_0x1e53ad['error'][_0x372e('0x10')]);return _0x3d138d(_0x1e53ad['error'][_0x372e('0x10')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x3b63eb,_0x1e53ad[_0x372e('0xd')]['message']);return _0x149876(_0x1e53ad[_0x372e('0xd')]['message']);}else{logger[_0x372e('0xa')](_0x372e('0xf'),_0x3b63eb,_0x372e('0xb'));_0x149876(_0x1e53ad[_0x372e('0x11')][_0x372e('0x10')]);}})['catch'](function(_0x124614){logger[_0x372e('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x3b63eb,_0x124614);_0x3d138d(_0x124614);});});}
\ No newline at end of file
diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js
index b162ce3..a2d4a71 100644
--- a/server/api/memberReport/index.js
+++ b/server/api/memberReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x979e=['describe','/:id','show','post','update','delete','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe'];(function(_0x261950,_0x38e58a){var _0x40fa53=function(_0x9a754){while(--_0x9a754){_0x261950['push'](_0x261950['shift']());}};_0x40fa53(++_0x38e58a);}(_0x979e,0xe4));var _0xe979=function(_0x48b4ab,_0x939aff){_0x48b4ab=_0x48b4ab-0x0;var _0x3c06ac=_0x979e[_0x48b4ab];return _0x3c06ac;};'use strict';var multer=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var path=require('path');var timeout=require(_0xe979('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe979('0x3'));var config=require(_0xe979('0x4'));var controller=require(_0xe979('0x5'));router[_0xe979('0x6')]('/',auth[_0xe979('0x7')](),controller[_0xe979('0x8')]);router[_0xe979('0x6')](_0xe979('0x9'),auth[_0xe979('0x7')](),controller[_0xe979('0xa')]);router['get'](_0xe979('0xb'),auth[_0xe979('0x7')](),controller[_0xe979('0xc')]);router[_0xe979('0xd')]('/',auth[_0xe979('0x7')](),controller['create']);router['put'](_0xe979('0xb'),auth['isAuthenticated'](),controller[_0xe979('0xe')]);router[_0xe979('0xf')](_0xe979('0xb'),auth[_0xe979('0x7')](),controller['destroy']);module[_0xe979('0x10')]=router;
\ No newline at end of file
+var _0x5a7f=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','isAuthenticated','describe','/:id','post','create'];(function(_0x5527c3,_0x571434){var _0xed3601=function(_0x3c2e14){while(--_0x3c2e14){_0x5527c3['push'](_0x5527c3['shift']());}};_0xed3601(++_0x571434);}(_0x5a7f,0x194));var _0xf5a7=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x5a7f[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0xf5a7('0x0'));var util=require('util');var path=require(_0xf5a7('0x1'));var timeout=require(_0xf5a7('0x2'));var express=require(_0xf5a7('0x3'));var router=express[_0xf5a7('0x4')]();var auth=require(_0xf5a7('0x5'));var interaction=require(_0xf5a7('0x6'));var config=require(_0xf5a7('0x7'));var controller=require(_0xf5a7('0x8'));router[_0xf5a7('0x9')]('/',auth['isAuthenticated'](),controller[_0xf5a7('0xa')]);router[_0xf5a7('0x9')]('/describe',auth[_0xf5a7('0xb')](),controller[_0xf5a7('0xc')]);router[_0xf5a7('0x9')](_0xf5a7('0xd'),auth[_0xf5a7('0xb')](),controller['show']);router[_0xf5a7('0xe')]('/',auth[_0xf5a7('0xb')](),controller[_0xf5a7('0xf')]);router[_0xf5a7('0x10')]('/:id',auth[_0xf5a7('0xb')](),controller[_0xf5a7('0x11')]);router[_0xf5a7('0x12')]('/:id',auth[_0xf5a7('0xb')](),controller[_0xf5a7('0x13')]);module[_0xf5a7('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js
index f9b001c..35a2e70 100644
--- a/server/api/memberReport/memberReport.attributes.js
+++ b/server/api/memberReport/memberReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe55=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0xbe55,0x91));var _0x5be5=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xbe55[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0x5be5('0x0'));var moment=require(_0x5be5('0x1'));module[_0x5be5('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5be5('0x3')]},'interface':{'type':Sequelize[_0x5be5('0x3')]},'type':{'type':Sequelize[_0x5be5('0x3')],'defaultValue':_0x5be5('0x4'),'comment':_0x5be5('0x5')},'duration':{'type':Sequelize[_0x5be5('0x6')]},'enterAt':{'type':Sequelize[_0x5be5('0x7')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x3e579c){var _0x598f70=moment(_0x3e579c);var _0x14c41a=moment(this[_0x5be5('0x8')](_0x5be5('0x9')));var _0x194ba1=_0x598f70[_0x5be5('0xa')](_0x14c41a,_0x5be5('0xb'));this[_0x5be5('0xc')](_0x5be5('0xd'),_0x3e579c);this[_0x5be5('0xc')](_0x5be5('0xe'),_0x194ba1||null);}},'data1':{'type':Sequelize[_0x5be5('0x3')],'comment':_0x5be5('0xf')},'data2':{'type':Sequelize['STRING'],'comment':_0x5be5('0x10')},'data3':{'type':Sequelize[_0x5be5('0x3')],'comment':_0x5be5('0x11')},'data4':{'type':Sequelize[_0x5be5('0x3')],'comment':_0x5be5('0x12')},'data5':{'type':Sequelize[_0x5be5('0x3')],'comment':_0x5be5('0x13')},'role':{'type':Sequelize[_0x5be5('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb5b6=['moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','seconds','exitAt','setDataValue','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0x404f10,_0x59e40f){var _0x8d5c87=function(_0x134513){while(--_0x134513){_0x404f10['push'](_0x404f10['shift']());}};_0x8d5c87(++_0x59e40f);}(_0xb5b6,0x1c0));var _0x6b5b=function(_0x104b75,_0x58066b){_0x104b75=_0x104b75-0x0;var _0x941480=_0xb5b6[_0x104b75];return _0x941480;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6b5b('0x0'));module[_0x6b5b('0x1')]={'channel':{'type':Sequelize[_0x6b5b('0x2')]},'membername':{'type':Sequelize[_0x6b5b('0x2')]},'interface':{'type':Sequelize[_0x6b5b('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x6b5b('0x3')},'duration':{'type':Sequelize[_0x6b5b('0x4')]},'enterAt':{'type':Sequelize[_0x6b5b('0x5')]},'exitAt':{'type':Sequelize[_0x6b5b('0x5')],'set':function(_0x3267a8){var _0x54f1bc=moment(_0x3267a8);var _0x133bd7=moment(this[_0x6b5b('0x6')]('enterAt'));var _0x589e63=_0x54f1bc[_0x6b5b('0x7')](_0x133bd7,_0x6b5b('0x8'));this['setDataValue'](_0x6b5b('0x9'),_0x3267a8);this[_0x6b5b('0xa')](_0x6b5b('0xb'),_0x589e63||null);}},'data1':{'type':Sequelize[_0x6b5b('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x6b5b('0x2')],'comment':_0x6b5b('0xc')},'data3':{'type':Sequelize[_0x6b5b('0x2')],'comment':_0x6b5b('0xd')},'data4':{'type':Sequelize[_0x6b5b('0x2')],'comment':_0x6b5b('0xe')},'data5':{'type':Sequelize['STRING'],'comment':_0x6b5b('0xf')},'role':{'type':Sequelize[_0x6b5b('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x6b5b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js
index 085d7ef..fca2001 100644
--- a/server/api/memberReport/memberReport.controller.js
+++ b/server/api/memberReport/memberReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7082=['apply','reject','save','then','destroy','error','stack','name','send','index','MemberReport','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','rows','catch','show','params','intersection','length','include','create','body','update','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0x7082,0x145));var _0x2708=function(_0x55e839,_0x3b5345){_0x55e839=_0x55e839-0x0;var _0x39c61a=_0x7082[_0x55e839];return _0x39c61a;};'use strict';var pdf=require(_0x2708('0x0'));var emlformat=require(_0x2708('0x1'));var rimraf=require(_0x2708('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2708('0x3'));var rp=require(_0x2708('0x4'));var moment=require(_0x2708('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2708('0x6'));var csv=require('to-csv');var ejs=require(_0x2708('0x7'));var fs=require('fs');var _=require(_0x2708('0x8'));var squel=require(_0x2708('0x9'));var crypto=require(_0x2708('0xa'));var jsforce=require(_0x2708('0xb'));var deskjs=require(_0x2708('0xc'));var toCsv=require(_0x2708('0xd'));var querystring=require(_0x2708('0xe'));var Papa=require(_0x2708('0xf'));var Redis=require('ioredis');var authService=require(_0x2708('0x10'));var qs=require(_0x2708('0x11'));var hardwareService=require(_0x2708('0x12'));var logger=require('../../config/logger')(_0x2708('0x13'));var utils=require('../../config/utils');var config=require(_0x2708('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e4860,_0x30fc08){_0x30fc08=_0x30fc08||0xcc;return function(_0x549fd9){if(_0x549fd9){return _0x4e4860[_0x2708('0x15')](_0x30fc08);}return _0x4e4860['status'](_0x30fc08)[_0x2708('0x16')]();};}function respondWithResult(_0x17a3b9,_0x2a51f4){_0x2a51f4=_0x2a51f4||0xc8;return function(_0x4b60c3){if(_0x4b60c3){return _0x17a3b9[_0x2708('0x17')](_0x2a51f4)[_0x2708('0x18')](_0x4b60c3);}};}function respondWithFilteredResult(_0x4c9413,_0x2db6d6){return function(_0x1465d3){if(_0x1465d3){var _0x4d26b9=_0x1465d3[_0x2708('0x19')],_0x206440=_0x2db6d6[_0x2708('0x1a')],_0xa8c084=_0x2db6d6[_0x2708('0x1a')]+_0x2db6d6[_0x2708('0x1b')],_0x47e92d;if(_0xa8c084>=_0x4d26b9){_0xa8c084=_0x4d26b9;_0x47e92d=0xc8;}else{_0x47e92d=0xce;}_0x4c9413['status'](_0x47e92d);return _0x4c9413[_0x2708('0x1c')](_0x2708('0x1d'),_0x206440+'-'+_0xa8c084+'/'+_0x4d26b9)['json'](_0x1465d3);}return null;};}function patchUpdates(_0x9e737f){return function(_0x2e2225){try{jsonpatch[_0x2708('0x1e')](_0x2e2225,_0x9e737f,!![]);}catch(_0x242239){return BPromise[_0x2708('0x1f')](_0x242239);}return _0x2e2225[_0x2708('0x20')]();};}function saveUpdates(_0x21c664,_0x311e5d){return function(_0x312cd8){if(_0x312cd8){return _0x312cd8['update'](_0x21c664)[_0x2708('0x21')](function(_0x196313){return _0x196313;});}return null;};}function removeEntity(_0x3a5d45,_0x5529ec){return function(_0x23a8d9){if(_0x23a8d9){return _0x23a8d9[_0x2708('0x22')]()['then'](function(){_0x3a5d45['status'](0xcc)[_0x2708('0x16')]();});}};}function handleEntityNotFound(_0x1e84fe,_0x39e394){return function(_0x242f92){if(!_0x242f92){_0x1e84fe[_0x2708('0x15')](0x194);}return _0x242f92;};}function handleError(_0xc50dd,_0x172cdd){_0x172cdd=_0x172cdd||0x1f4;return function(_0x39c16b){logger[_0x2708('0x23')](_0x39c16b[_0x2708('0x24')]);if(_0x39c16b['name']){delete _0x39c16b[_0x2708('0x25')];}_0xc50dd[_0x2708('0x17')](_0x172cdd)[_0x2708('0x26')](_0x39c16b);};}exports[_0x2708('0x27')]=function(_0x228d8d,_0x1d43f2){var _0x442e98={},_0x322e9e={},_0x16cc16={'count':0x0,'rows':[]};var _0x2c4202=db[_0x2708('0x28')][_0x2708('0x29')];_0x322e9e[_0x2708('0x2a')]=_[_0x2708('0x2b')](_0x2c4202);_0x322e9e[_0x2708('0x2c')]=_[_0x2708('0x2b')](_0x228d8d[_0x2708('0x2c')]);_0x322e9e[_0x2708('0x2d')]=_['intersection'](_0x322e9e[_0x2708('0x2a')],_0x322e9e['query']);_0x442e98[_0x2708('0x2e')]=_['intersection'](_0x322e9e[_0x2708('0x2a')],qs[_0x2708('0x2f')](_0x228d8d[_0x2708('0x2c')][_0x2708('0x2f')]));_0x442e98[_0x2708('0x2e')]=_0x442e98[_0x2708('0x2e')]['length']?_0x442e98[_0x2708('0x2e')]:_0x322e9e['model'];if(!_0x228d8d['query'][_0x2708('0x30')](_0x2708('0x31'))){_0x442e98[_0x2708('0x1b')]=qs[_0x2708('0x1b')](_0x228d8d[_0x2708('0x2c')]['limit']);_0x442e98[_0x2708('0x1a')]=qs[_0x2708('0x1a')](_0x228d8d[_0x2708('0x2c')]['offset']);}_0x442e98[_0x2708('0x32')]=qs['sort'](_0x228d8d['query'][_0x2708('0x33')]);_0x442e98[_0x2708('0x34')]=qs[_0x2708('0x2d')](_[_0x2708('0x35')](_0x228d8d['query'],_0x322e9e[_0x2708('0x2d')]));if(_0x228d8d[_0x2708('0x2c')][_0x2708('0x36')]){_0x442e98['where']=_[_0x2708('0x37')](_0x442e98[_0x2708('0x34')],{'$or':_['map'](_0x2c4202,function(_0x204df5){if(_0x204df5[_0x2708('0x38')]['key']!==_0x2708('0x39')){var _0x426f61={};_0x426f61[_0x204df5['field']]={'$like':'%'+_0x228d8d[_0x2708('0x2c')]['filter']+'%'};return _0x426f61;}})});}_0x442e98=_['merge']({},_0x442e98,_0x228d8d['options']);var _0x43ff0f={'where':_0x442e98[_0x2708('0x34')]};return db[_0x2708('0x28')]['count'](_0x43ff0f)['then'](function(_0x38c66a){_0x16cc16[_0x2708('0x19')]=_0x38c66a;if(_0x228d8d['query'][_0x2708('0x3a')]){_0x442e98['include']=[{'all':!![]}];}return db[_0x2708('0x28')]['findAll'](_0x442e98);})[_0x2708('0x21')](function(_0x3fd519){_0x16cc16[_0x2708('0x3b')]=_0x3fd519;return _0x16cc16;})[_0x2708('0x21')](respondWithFilteredResult(_0x1d43f2,_0x442e98))[_0x2708('0x3c')](handleError(_0x1d43f2,null));};exports[_0x2708('0x3d')]=function(_0x2b9c26,_0x4b44f9){var _0x48e7d2={'raw':!![],'where':{'id':_0x2b9c26[_0x2708('0x3e')]['id']}},_0x59f993={};_0x59f993[_0x2708('0x2a')]=_[_0x2708('0x2b')](db[_0x2708('0x28')][_0x2708('0x29')]);_0x59f993['query']=_[_0x2708('0x2b')](_0x2b9c26[_0x2708('0x2c')]);_0x59f993['filters']=_['intersection'](_0x59f993['model'],_0x59f993[_0x2708('0x2c')]);_0x48e7d2[_0x2708('0x2e')]=_[_0x2708('0x3f')](_0x59f993[_0x2708('0x2a')],qs[_0x2708('0x2f')](_0x2b9c26['query'][_0x2708('0x2f')]));_0x48e7d2[_0x2708('0x2e')]=_0x48e7d2['attributes'][_0x2708('0x40')]?_0x48e7d2[_0x2708('0x2e')]:_0x59f993[_0x2708('0x2a')];if(_0x2b9c26['query'][_0x2708('0x3a')]){_0x48e7d2[_0x2708('0x41')]=[{'all':!![]}];}_0x48e7d2=_['merge']({},_0x48e7d2,_0x2b9c26['options']);return db[_0x2708('0x28')]['find'](_0x48e7d2)[_0x2708('0x21')](handleEntityNotFound(_0x4b44f9,null))['then'](respondWithResult(_0x4b44f9,null))[_0x2708('0x3c')](handleError(_0x4b44f9,null));};exports['create']=function(_0x5c6d77,_0x4dda45){return db[_0x2708('0x28')][_0x2708('0x42')](_0x5c6d77[_0x2708('0x43')],{})[_0x2708('0x21')](respondWithResult(_0x4dda45,0xc9))[_0x2708('0x3c')](handleError(_0x4dda45,null));};exports[_0x2708('0x44')]=function(_0x811780,_0x1cb96b){if(_0x811780[_0x2708('0x43')]['id']){delete _0x811780[_0x2708('0x43')]['id'];}return db[_0x2708('0x28')]['find']({'where':{'id':_0x811780['params']['id']}})[_0x2708('0x21')](handleEntityNotFound(_0x1cb96b,null))[_0x2708('0x21')](saveUpdates(_0x811780['body'],null))['then'](respondWithResult(_0x1cb96b,null))['catch'](handleError(_0x1cb96b,null));};exports[_0x2708('0x22')]=function(_0x737a7,_0x1baa81){return db[_0x2708('0x28')][_0x2708('0x45')]({'where':{'id':_0x737a7[_0x2708('0x3e')]['id']}})[_0x2708('0x21')](handleEntityNotFound(_0x1baa81,null))['then'](removeEntity(_0x1baa81,null))['catch'](handleError(_0x1baa81,null));};exports[_0x2708('0x46')]=function(_0x390c6b,_0x53ef5e){return db[_0x2708('0x28')]['describe']()[_0x2708('0x21')](respondWithResult(_0x53ef5e,null))[_0x2708('0x3c')](handleError(_0x53ef5e,null));};
\ No newline at end of file
+var _0xe816=['error','name','send','index','MemberReport','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy'];(function(_0x5c7cbe,_0x276ce9){var _0x431728=function(_0x22d7c1){while(--_0x22d7c1){_0x5c7cbe['push'](_0x5c7cbe['shift']());}};_0x431728(++_0x276ce9);}(_0xe816,0x19e));var _0x6e81=function(_0x1b215f,_0x2c8c52){_0x1b215f=_0x1b215f-0x0;var _0x2ca1e1=_0xe816[_0x1b215f];return _0x2ca1e1;};'use strict';var pdf=require(_0x6e81('0x0'));var emlformat=require(_0x6e81('0x1'));var rimraf=require(_0x6e81('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e81('0x3'));var rp=require(_0x6e81('0x4'));var moment=require(_0x6e81('0x5'));var BPromise=require(_0x6e81('0x6'));var Mustache=require(_0x6e81('0x7'));var util=require(_0x6e81('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x6e81('0x9'));var ejs=require(_0x6e81('0xa'));var fs=require('fs');var _=require(_0x6e81('0xb'));var squel=require('squel');var crypto=require(_0x6e81('0xc'));var jsforce=require(_0x6e81('0xd'));var deskjs=require(_0x6e81('0xe'));var toCsv=require(_0x6e81('0x9'));var querystring=require(_0x6e81('0xf'));var Papa=require('papaparse');var Redis=require(_0x6e81('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6e81('0x11'));var hardwareService=require(_0x6e81('0x12'));var logger=require(_0x6e81('0x13'))(_0x6e81('0x14'));var utils=require(_0x6e81('0x15'));var config=require('../../config/environment');var db=require(_0x6e81('0x16'))['db'];function respondWithStatusCode(_0x2a60fc,_0x3013a3){_0x3013a3=_0x3013a3||0xcc;return function(_0x2baa9c){if(_0x2baa9c){return _0x2a60fc[_0x6e81('0x17')](_0x3013a3);}return _0x2a60fc[_0x6e81('0x18')](_0x3013a3)[_0x6e81('0x19')]();};}function respondWithResult(_0xad0728,_0x4b7ea4){_0x4b7ea4=_0x4b7ea4||0xc8;return function(_0x2b7237){if(_0x2b7237){return _0xad0728[_0x6e81('0x18')](_0x4b7ea4)[_0x6e81('0x1a')](_0x2b7237);}};}function respondWithFilteredResult(_0x16959f,_0x2a8147){return function(_0x3529e9){if(_0x3529e9){var _0x148623=_0x3529e9[_0x6e81('0x1b')],_0x488a12=_0x2a8147['offset'],_0x3411de=_0x2a8147[_0x6e81('0x1c')]+_0x2a8147[_0x6e81('0x1d')],_0x424474;if(_0x3411de>=_0x148623){_0x3411de=_0x148623;_0x424474=0xc8;}else{_0x424474=0xce;}_0x16959f[_0x6e81('0x18')](_0x424474);return _0x16959f['set'](_0x6e81('0x1e'),_0x488a12+'-'+_0x3411de+'/'+_0x148623)[_0x6e81('0x1a')](_0x3529e9);}return null;};}function patchUpdates(_0x3e257c){return function(_0x2ba379){try{jsonpatch[_0x6e81('0x1f')](_0x2ba379,_0x3e257c,!![]);}catch(_0x24e24a){return BPromise['reject'](_0x24e24a);}return _0x2ba379[_0x6e81('0x20')]();};}function saveUpdates(_0x957a0b,_0x206c7c){return function(_0x11a408){if(_0x11a408){return _0x11a408[_0x6e81('0x21')](_0x957a0b)[_0x6e81('0x22')](function(_0x16fce5){return _0x16fce5;});}return null;};}function removeEntity(_0x7c5b39,_0x4e5a9d){return function(_0x4da070){if(_0x4da070){return _0x4da070[_0x6e81('0x23')]()[_0x6e81('0x22')](function(){_0x7c5b39[_0x6e81('0x18')](0xcc)[_0x6e81('0x19')]();});}};}function handleEntityNotFound(_0x7f58d1,_0x1fc3d8){return function(_0x4d304b){if(!_0x4d304b){_0x7f58d1[_0x6e81('0x17')](0x194);}return _0x4d304b;};}function handleError(_0x26ab79,_0x46dd7d){_0x46dd7d=_0x46dd7d||0x1f4;return function(_0x45aab4){logger[_0x6e81('0x24')](_0x45aab4['stack']);if(_0x45aab4[_0x6e81('0x25')]){delete _0x45aab4[_0x6e81('0x25')];}_0x26ab79[_0x6e81('0x18')](_0x46dd7d)[_0x6e81('0x26')](_0x45aab4);};}exports[_0x6e81('0x27')]=function(_0x1c17ad,_0x274938){var _0x7f169c={},_0x2b575f={},_0x2160d5={'count':0x0,'rows':[]};var _0x3779e4=db[_0x6e81('0x28')][_0x6e81('0x29')];_0x2b575f[_0x6e81('0x2a')]=_[_0x6e81('0x2b')](_0x3779e4);_0x2b575f[_0x6e81('0x2c')]=_[_0x6e81('0x2b')](_0x1c17ad[_0x6e81('0x2c')]);_0x2b575f[_0x6e81('0x2d')]=_['intersection'](_0x2b575f[_0x6e81('0x2a')],_0x2b575f[_0x6e81('0x2c')]);_0x7f169c[_0x6e81('0x2e')]=_['intersection'](_0x2b575f[_0x6e81('0x2a')],qs[_0x6e81('0x2f')](_0x1c17ad[_0x6e81('0x2c')][_0x6e81('0x2f')]));_0x7f169c[_0x6e81('0x2e')]=_0x7f169c[_0x6e81('0x2e')][_0x6e81('0x30')]?_0x7f169c[_0x6e81('0x2e')]:_0x2b575f[_0x6e81('0x2a')];if(!_0x1c17ad[_0x6e81('0x2c')][_0x6e81('0x31')](_0x6e81('0x32'))){_0x7f169c['limit']=qs[_0x6e81('0x1d')](_0x1c17ad[_0x6e81('0x2c')][_0x6e81('0x1d')]);_0x7f169c[_0x6e81('0x1c')]=qs[_0x6e81('0x1c')](_0x1c17ad[_0x6e81('0x2c')][_0x6e81('0x1c')]);}_0x7f169c[_0x6e81('0x33')]=qs[_0x6e81('0x34')](_0x1c17ad[_0x6e81('0x2c')][_0x6e81('0x34')]);_0x7f169c[_0x6e81('0x35')]=qs['filters'](_[_0x6e81('0x36')](_0x1c17ad['query'],_0x2b575f['filters']));if(_0x1c17ad[_0x6e81('0x2c')]['filter']){_0x7f169c[_0x6e81('0x35')]=_[_0x6e81('0x37')](_0x7f169c[_0x6e81('0x35')],{'$or':_[_0x6e81('0x38')](_0x3779e4,function(_0x1d3028){if(_0x1d3028[_0x6e81('0x39')][_0x6e81('0x3a')]!==_0x6e81('0x3b')){var _0x568105={};_0x568105[_0x1d3028[_0x6e81('0x3c')]]={'$like':'%'+_0x1c17ad[_0x6e81('0x2c')][_0x6e81('0x3d')]+'%'};return _0x568105;}})});}_0x7f169c=_[_0x6e81('0x37')]({},_0x7f169c,_0x1c17ad[_0x6e81('0x3e')]);var _0xd7471c={'where':_0x7f169c[_0x6e81('0x35')]};return db[_0x6e81('0x28')][_0x6e81('0x1b')](_0xd7471c)['then'](function(_0x260626){_0x2160d5[_0x6e81('0x1b')]=_0x260626;if(_0x1c17ad[_0x6e81('0x2c')][_0x6e81('0x3f')]){_0x7f169c[_0x6e81('0x40')]=[{'all':!![]}];}return db[_0x6e81('0x28')][_0x6e81('0x41')](_0x7f169c);})['then'](function(_0x1c01e6){_0x2160d5[_0x6e81('0x42')]=_0x1c01e6;return _0x2160d5;})['then'](respondWithFilteredResult(_0x274938,_0x7f169c))[_0x6e81('0x43')](handleError(_0x274938,null));};exports[_0x6e81('0x44')]=function(_0x49a4bf,_0x33ec60){var _0x236c66={'raw':!![],'where':{'id':_0x49a4bf[_0x6e81('0x45')]['id']}},_0x5ed8d4={};_0x5ed8d4[_0x6e81('0x2a')]=_[_0x6e81('0x2b')](db[_0x6e81('0x28')][_0x6e81('0x29')]);_0x5ed8d4[_0x6e81('0x2c')]=_[_0x6e81('0x2b')](_0x49a4bf[_0x6e81('0x2c')]);_0x5ed8d4[_0x6e81('0x2d')]=_[_0x6e81('0x46')](_0x5ed8d4[_0x6e81('0x2a')],_0x5ed8d4['query']);_0x236c66[_0x6e81('0x2e')]=_[_0x6e81('0x46')](_0x5ed8d4[_0x6e81('0x2a')],qs[_0x6e81('0x2f')](_0x49a4bf[_0x6e81('0x2c')][_0x6e81('0x2f')]));_0x236c66[_0x6e81('0x2e')]=_0x236c66['attributes'][_0x6e81('0x30')]?_0x236c66[_0x6e81('0x2e')]:_0x5ed8d4[_0x6e81('0x2a')];if(_0x49a4bf[_0x6e81('0x2c')][_0x6e81('0x3f')]){_0x236c66[_0x6e81('0x40')]=[{'all':!![]}];}_0x236c66=_[_0x6e81('0x37')]({},_0x236c66,_0x49a4bf[_0x6e81('0x3e')]);return db['MemberReport'][_0x6e81('0x47')](_0x236c66)[_0x6e81('0x22')](handleEntityNotFound(_0x33ec60,null))[_0x6e81('0x22')](respondWithResult(_0x33ec60,null))['catch'](handleError(_0x33ec60,null));};exports['create']=function(_0x2e1945,_0x5b0ec9){return db[_0x6e81('0x28')][_0x6e81('0x48')](_0x2e1945[_0x6e81('0x49')],{})[_0x6e81('0x22')](respondWithResult(_0x5b0ec9,0xc9))[_0x6e81('0x43')](handleError(_0x5b0ec9,null));};exports[_0x6e81('0x21')]=function(_0x19c6bd,_0x147c3b){if(_0x19c6bd[_0x6e81('0x49')]['id']){delete _0x19c6bd[_0x6e81('0x49')]['id'];}return db['MemberReport']['find']({'where':{'id':_0x19c6bd[_0x6e81('0x45')]['id']}})['then'](handleEntityNotFound(_0x147c3b,null))[_0x6e81('0x22')](saveUpdates(_0x19c6bd[_0x6e81('0x49')],null))[_0x6e81('0x22')](respondWithResult(_0x147c3b,null))[_0x6e81('0x43')](handleError(_0x147c3b,null));};exports[_0x6e81('0x23')]=function(_0x51eea1,_0x19967f){return db[_0x6e81('0x28')][_0x6e81('0x47')]({'where':{'id':_0x51eea1[_0x6e81('0x45')]['id']}})[_0x6e81('0x22')](handleEntityNotFound(_0x19967f,null))[_0x6e81('0x22')](removeEntity(_0x19967f,null))[_0x6e81('0x43')](handleError(_0x19967f,null));};exports[_0x6e81('0x4a')]=function(_0x6b0a13,_0x385687){return db[_0x6e81('0x28')][_0x6e81('0x4a')]()[_0x6e81('0x22')](respondWithResult(_0x385687,null))[_0x6e81('0x43')](handleError(_0x385687,null));};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js
index 5635f38..8e2215f 100644
--- a/server/api/memberReport/memberReport.model.js
+++ b/server/api/memberReport/memberReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc462=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','membername_interface','interface','lodash','util','api'];(function(_0x4fc3a2,_0x5d9d9d){var _0x3ebfb9=function(_0xa51f97){while(--_0xa51f97){_0x4fc3a2['push'](_0x4fc3a2['shift']());}};_0x3ebfb9(++_0x5d9d9d);}(_0xc462,0xc0));var _0x2c46=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc462[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x2c46('0x0'));var util=require(_0x2c46('0x1'));var logger=require('../../config/logger')(_0x2c46('0x2'));var moment=require(_0x2c46('0x3'));var BPromise=require(_0x2c46('0x4'));var rp=require(_0x2c46('0x5'));var fs=require('fs');var path=require(_0x2c46('0x6'));var rimraf=require(_0x2c46('0x7'));var config=require(_0x2c46('0x8'));var attributes=require('./memberReport.attributes');module[_0x2c46('0x9')]=function(_0x1b57a8,_0x31d470){return _0x1b57a8[_0x2c46('0xa')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x2c46('0xb'),'fields':['membername',_0x2c46('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f61=['define','report_member','membername_interface','membername','interface','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x478566,_0x488c43){var _0x3c72ab=function(_0x341053){while(--_0x341053){_0x478566['push'](_0x478566['shift']());}};_0x3c72ab(++_0x488c43);}(_0x7f61,0x1e1));var _0x17f6=function(_0x265457,_0x5903c8){_0x265457=_0x265457-0x0;var _0x173c46=_0x7f61[_0x265457];return _0x173c46;};'use strict';var _=require('lodash');var util=require(_0x17f6('0x0'));var logger=require(_0x17f6('0x1'))(_0x17f6('0x2'));var moment=require(_0x17f6('0x3'));var BPromise=require(_0x17f6('0x4'));var rp=require(_0x17f6('0x5'));var fs=require('fs');var path=require(_0x17f6('0x6'));var rimraf=require(_0x17f6('0x7'));var config=require(_0x17f6('0x8'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x180d7a,_0x232718){return _0x180d7a[_0x17f6('0x9')]('MemberReport',attributes,{'tableName':_0x17f6('0xa'),'paranoid':![],'indexes':[{'name':_0x17f6('0xb'),'fields':[_0x17f6('0xc'),_0x17f6('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js
index 700399f..a41d38a 100644
--- a/server/api/memberReport/memberReport.rpc.js
+++ b/server/api/memberReport/memberReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9419=['stringify','error','code','message','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9419,0x1cd));var _0x9941=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0x9419[_0x336ca2];return _0xda59a6;};'use strict';var _=require(_0x9941('0x0'));var util=require(_0x9941('0x1'));var moment=require(_0x9941('0x2'));var BPromise=require(_0x9941('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9941('0x4'));var db=require(_0x9941('0x5'))['db'];var utils=require(_0x9941('0x6'));var logger=require(_0x9941('0x7'))(_0x9941('0x8'));var config=require('../../config/environment');var jayson=require(_0x9941('0x9'));var client=jayson[_0x9941('0xa')][_0x9941('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8f5adb,_0x5de59f,_0x30ef32){return new BPromise(function(_0x1350ef,_0x3efbf3){return client[_0x9941('0xc')](_0x8f5adb,_0x30ef32)[_0x9941('0xd')](function(_0x3d3365){logger[_0x9941('0xe')](_0x9941('0xf'),_0x5de59f,_0x9941('0x10'));logger[_0x9941('0x11')](_0x9941('0x12'),_0x5de59f,_0x9941('0x10'),JSON[_0x9941('0x13')](_0x3d3365));if(_0x3d3365[_0x9941('0x14')]){if(_0x3d3365[_0x9941('0x14')][_0x9941('0x15')]===0x1f4){logger['error'](_0x9941('0xf'),_0x5de59f,_0x3d3365['error'][_0x9941('0x16')]);return _0x3efbf3(_0x3d3365[_0x9941('0x14')][_0x9941('0x16')]);}logger[_0x9941('0x14')](_0x9941('0xf'),_0x5de59f,_0x3d3365[_0x9941('0x14')][_0x9941('0x16')]);return _0x1350ef(_0x3d3365[_0x9941('0x14')]['message']);}else{logger['info'](_0x9941('0xf'),_0x5de59f,_0x9941('0x10'));_0x1350ef(_0x3d3365['result'][_0x9941('0x16')]);}})[_0x9941('0x17')](function(_0x376f29){logger[_0x9941('0x14')]('MemberReport,\x20%s,\x20%s',_0x5de59f,_0x376f29);_0x3efbf3(_0x376f29);});});}exports[_0x9941('0x18')]=function(_0x44a7b8){var _0x39c50e=this;return new Promise(function(_0x1b6481,_0x16e043){return db[_0x9941('0x19')][_0x9941('0x1a')]({'raw':_0x44a7b8[_0x9941('0x1b')]?_0x44a7b8[_0x9941('0x1b')][_0x9941('0x1c')]===undefined?!![]:![]:!![],'where':_0x44a7b8['options']?_0x44a7b8['options'][_0x9941('0x1d')]||null:null,'attributes':_0x44a7b8['options']?_0x44a7b8[_0x9941('0x1b')][_0x9941('0x1e')]||null:null,'limit':_0x44a7b8[_0x9941('0x1b')]?_0x44a7b8[_0x9941('0x1b')][_0x9941('0x1f')]||null:null,'include':_0x44a7b8[_0x9941('0x1b')]?_0x44a7b8[_0x9941('0x1b')][_0x9941('0x20')]?_[_0x9941('0x21')](_0x44a7b8['options'][_0x9941('0x20')],function(_0x344c91){return{'model':db[_0x344c91[_0x9941('0x22')]],'as':_0x344c91['as'],'attributes':_0x344c91[_0x9941('0x1e')],'include':_0x344c91[_0x9941('0x20')]?_[_0x9941('0x21')](_0x344c91[_0x9941('0x20')],function(_0x420d94){return{'model':db[_0x420d94[_0x9941('0x22')]],'as':_0x420d94['as'],'attributes':_0x420d94[_0x9941('0x1e')],'include':_0x420d94[_0x9941('0x20')]?_[_0x9941('0x21')](_0x420d94[_0x9941('0x20')],function(_0xd9d32d){return{'model':db[_0xd9d32d['model']],'as':_0xd9d32d['as'],'attributes':_0xd9d32d['attributes']};}):[]};}):[]};}):[]:[]})[_0x9941('0xd')](function(_0x8a06a6){logger[_0x9941('0xe')]('GetMemberReport',_0x44a7b8);logger['debug'](_0x9941('0x18'),_0x44a7b8,JSON['stringify'](_0x8a06a6));_0x1b6481(_0x8a06a6);})[_0x9941('0x17')](function(_0x512174){logger['error'](_0x9941('0x18'),_0x512174[_0x9941('0x16')],_0x44a7b8);_0x16e043(_0x39c50e[_0x9941('0x14')](0x1f4,_0x512174[_0x9941('0x16')]));});});};exports[_0x9941('0x23')]=function(_0x52c152){var _0x169e45=this;return new Promise(function(_0x43eae9,_0x3d684a){return db['MemberReport'][_0x9941('0x24')](_0x52c152[_0x9941('0x25')],{'raw':_0x52c152[_0x9941('0x1b')]?_0x52c152[_0x9941('0x1b')][_0x9941('0x1c')]===undefined?!![]:![]:!![]})[_0x9941('0xd')](function(_0x52118c){logger[_0x9941('0xe')](_0x9941('0x23'),_0x52c152);logger[_0x9941('0x11')](_0x9941('0x23'),_0x52c152,JSON['stringify'](_0x52118c));_0x43eae9(_0x52118c);})[_0x9941('0x17')](function(_0x459202){logger[_0x9941('0x14')](_0x9941('0x23'),_0x459202[_0x9941('0x16')],_0x52c152);_0x3d684a(_0x169e45[_0x9941('0x14')](0x1f4,_0x459202[_0x9941('0x16')]));});});};exports[_0x9941('0x26')]=function(_0x5cfc84){var _0x2ce7ad=this;return new Promise(function(_0x287372,_0x26a084){return db['MemberReport'][_0x9941('0x27')](_0x5cfc84[_0x9941('0x25')],{'raw':_0x5cfc84[_0x9941('0x1b')]?_0x5cfc84['options'][_0x9941('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cfc84[_0x9941('0x1b')]?_0x5cfc84['options'][_0x9941('0x1d')]||null:null,'attributes':_0x5cfc84['options']?_0x5cfc84[_0x9941('0x1b')][_0x9941('0x1e')]||null:null,'limit':_0x5cfc84[_0x9941('0x1b')]?_0x5cfc84[_0x9941('0x1b')][_0x9941('0x1f')]||null:null})[_0x9941('0xd')](function(_0xaa0454){logger[_0x9941('0xe')](_0x9941('0x26'),_0x5cfc84);logger[_0x9941('0x11')](_0x9941('0x26'),_0x5cfc84,JSON[_0x9941('0x13')](_0xaa0454));_0x287372(_0xaa0454);})['catch'](function(_0x4c58e0){logger[_0x9941('0x14')](_0x9941('0x26'),_0x4c58e0['message'],_0x5cfc84);_0x26a084(_0x2ce7ad[_0x9941('0x14')](0x1f4,_0x4c58e0[_0x9941('0x16')]));});});};
\ No newline at end of file
+var _0x8121=['debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','MemberReport,\x20%s,\x20%s','message','result','GetMemberReport','findAll','options','where','attributes','limit','include','model','map','stringify','catch','CreateMemberReport','MemberReport','body','raw','UpdateMemberReport','update','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3662a7,_0x1a1ca4){var _0x295866=function(_0x52bb49){while(--_0x52bb49){_0x3662a7['push'](_0x3662a7['shift']());}};_0x295866(++_0x1a1ca4);}(_0x8121,0xfc));var _0x1812=function(_0x2fec33,_0x3d796e){_0x2fec33=_0x2fec33-0x0;var _0x117c9f=_0x8121[_0x2fec33];return _0x117c9f;};'use strict';var _=require('lodash');var util=require(_0x1812('0x0'));var moment=require('moment');var BPromise=require(_0x1812('0x1'));var rs=require(_0x1812('0x2'));var fs=require('fs');var Redis=require(_0x1812('0x3'));var db=require(_0x1812('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1812('0x5'))(_0x1812('0x6'));var config=require('../../config/environment');var jayson=require(_0x1812('0x7'));var client=jayson[_0x1812('0x8')][_0x1812('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf0b27d,_0x14e849,_0x16fe71){return new BPromise(function(_0x5af01d,_0x534015){return client[_0x1812('0xa')](_0xf0b27d,_0x16fe71)[_0x1812('0xb')](function(_0x393c97){logger[_0x1812('0xc')]('MemberReport,\x20%s,\x20%s',_0x14e849,_0x1812('0xd'));logger[_0x1812('0xe')](_0x1812('0xf'),_0x14e849,_0x1812('0xd'),JSON['stringify'](_0x393c97));if(_0x393c97[_0x1812('0x10')]){if(_0x393c97[_0x1812('0x10')][_0x1812('0x11')]===0x1f4){logger[_0x1812('0x10')](_0x1812('0x12'),_0x14e849,_0x393c97[_0x1812('0x10')][_0x1812('0x13')]);return _0x534015(_0x393c97[_0x1812('0x10')][_0x1812('0x13')]);}logger[_0x1812('0x10')](_0x1812('0x12'),_0x14e849,_0x393c97['error'][_0x1812('0x13')]);return _0x5af01d(_0x393c97['error'][_0x1812('0x13')]);}else{logger[_0x1812('0xc')](_0x1812('0x12'),_0x14e849,'request\x20sent');_0x5af01d(_0x393c97[_0x1812('0x14')][_0x1812('0x13')]);}})['catch'](function(_0x55fd2d){logger[_0x1812('0x10')]('MemberReport,\x20%s,\x20%s',_0x14e849,_0x55fd2d);_0x534015(_0x55fd2d);});});}exports[_0x1812('0x15')]=function(_0x20c1fb){var _0x3c922e=this;return new Promise(function(_0x2bd795,_0x106352){return db['MemberReport'][_0x1812('0x16')]({'raw':_0x20c1fb[_0x1812('0x17')]?_0x20c1fb[_0x1812('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x20c1fb['options']?_0x20c1fb[_0x1812('0x17')][_0x1812('0x18')]||null:null,'attributes':_0x20c1fb[_0x1812('0x17')]?_0x20c1fb[_0x1812('0x17')][_0x1812('0x19')]||null:null,'limit':_0x20c1fb['options']?_0x20c1fb[_0x1812('0x17')][_0x1812('0x1a')]||null:null,'include':_0x20c1fb['options']?_0x20c1fb[_0x1812('0x17')][_0x1812('0x1b')]?_['map'](_0x20c1fb[_0x1812('0x17')]['include'],function(_0x32c8f6){return{'model':db[_0x32c8f6[_0x1812('0x1c')]],'as':_0x32c8f6['as'],'attributes':_0x32c8f6[_0x1812('0x19')],'include':_0x32c8f6['include']?_[_0x1812('0x1d')](_0x32c8f6['include'],function(_0x6e4591){return{'model':db[_0x6e4591['model']],'as':_0x6e4591['as'],'attributes':_0x6e4591[_0x1812('0x19')],'include':_0x6e4591['include']?_[_0x1812('0x1d')](_0x6e4591[_0x1812('0x1b')],function(_0x124012){return{'model':db[_0x124012['model']],'as':_0x124012['as'],'attributes':_0x124012[_0x1812('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x358793){logger[_0x1812('0xc')](_0x1812('0x15'),_0x20c1fb);logger[_0x1812('0xe')](_0x1812('0x15'),_0x20c1fb,JSON[_0x1812('0x1e')](_0x358793));_0x2bd795(_0x358793);})[_0x1812('0x1f')](function(_0x2168db){logger[_0x1812('0x10')](_0x1812('0x15'),_0x2168db[_0x1812('0x13')],_0x20c1fb);_0x106352(_0x3c922e['error'](0x1f4,_0x2168db[_0x1812('0x13')]));});});};exports[_0x1812('0x20')]=function(_0x3978ae){var _0x3c92f1=this;return new Promise(function(_0xa09a2f,_0x101ea5){return db[_0x1812('0x21')]['create'](_0x3978ae[_0x1812('0x22')],{'raw':_0x3978ae[_0x1812('0x17')]?_0x3978ae[_0x1812('0x17')][_0x1812('0x23')]===undefined?!![]:![]:!![]})[_0x1812('0xb')](function(_0x3f8bdc){logger['info'](_0x1812('0x20'),_0x3978ae);logger['debug'](_0x1812('0x20'),_0x3978ae,JSON['stringify'](_0x3f8bdc));_0xa09a2f(_0x3f8bdc);})['catch'](function(_0x100809){logger[_0x1812('0x10')](_0x1812('0x20'),_0x100809[_0x1812('0x13')],_0x3978ae);_0x101ea5(_0x3c92f1['error'](0x1f4,_0x100809[_0x1812('0x13')]));});});};exports[_0x1812('0x24')]=function(_0x415429){var _0x3ae54d=this;return new Promise(function(_0x50b15b,_0x804255){return db[_0x1812('0x21')][_0x1812('0x25')](_0x415429['body'],{'raw':_0x415429['options']?_0x415429['options'][_0x1812('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x415429['options']?_0x415429[_0x1812('0x17')][_0x1812('0x18')]||null:null,'attributes':_0x415429[_0x1812('0x17')]?_0x415429['options']['attributes']||null:null,'limit':_0x415429['options']?_0x415429[_0x1812('0x17')][_0x1812('0x1a')]||null:null})[_0x1812('0xb')](function(_0x43b379){logger[_0x1812('0xc')](_0x1812('0x24'),_0x415429);logger[_0x1812('0xe')](_0x1812('0x24'),_0x415429,JSON['stringify'](_0x43b379));_0x50b15b(_0x43b379);})['catch'](function(_0x158a02){logger[_0x1812('0x10')](_0x1812('0x24'),_0x158a02['message'],_0x415429);_0x804255(_0x3ae54d[_0x1812('0x10')](0x1f4,_0x158a02[_0x1812('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/migration/index.js b/server/api/migration/index.js
index 121eb45..395c50f 100644
--- a/server/api/migration/index.js
+++ b/server/api/migration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c38=['index','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x7c38,0x98));var _0x87c3=function(_0x282899,_0x12c338){_0x282899=_0x282899-0x0;var _0x13bbb6=_0x7c38[_0x282899];return _0x13bbb6;};'use strict';var multer=require('multer');var util=require(_0x87c3('0x0'));var path=require('path');var timeout=require(_0x87c3('0x1'));var express=require('express');var router=express[_0x87c3('0x2')]();var auth=require(_0x87c3('0x3'));var interaction=require(_0x87c3('0x4'));var config=require(_0x87c3('0x5'));var controller=require(_0x87c3('0x6'));router[_0x87c3('0x7')]('/',controller[_0x87c3('0x8')]);module[_0x87c3('0x9')]=router;
\ No newline at end of file
+var _0xad68=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','util','connect-timeout','Router'];(function(_0x47b231,_0x4c3666){var _0xc2a934=function(_0x2e7977){while(--_0x2e7977){_0x47b231['push'](_0x47b231['shift']());}};_0xc2a934(++_0x4c3666);}(_0xad68,0x175));var _0x8ad6=function(_0x4e7012,_0x5d5f73){_0x4e7012=_0x4e7012-0x0;var _0xcd56d5=_0xad68[_0x4e7012];return _0xcd56d5;};'use strict';var multer=require('multer');var util=require(_0x8ad6('0x0'));var path=require('path');var timeout=require(_0x8ad6('0x1'));var express=require('express');var router=express[_0x8ad6('0x2')]();var auth=require(_0x8ad6('0x3'));var interaction=require(_0x8ad6('0x4'));var config=require(_0x8ad6('0x5'));var controller=require('./migration.controller');router[_0x8ad6('0x6')]('/',controller[_0x8ad6('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js
index 2f63ac3..7637bfb 100644
--- a/server/api/migration/migration.attributes.js
+++ b/server/api/migration/migration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef09=['version','sequelize','STRING'];(function(_0xe3bbf3,_0x1e5d36){var _0x1ee802=function(_0x513d09){while(--_0x513d09){_0xe3bbf3['push'](_0xe3bbf3['shift']());}};_0x1ee802(++_0x1e5d36);}(_0xef09,0x1e4));var _0x9ef0=function(_0x99c154,_0x27e9fb){_0x99c154=_0x99c154-0x0;var _0x38974b=_0xef09[_0x99c154];return _0x38974b;};'use strict';var Sequelize=require(_0x9ef0('0x0'));module['exports']={'version':{'type':Sequelize[_0x9ef0('0x1')],'unique':_0x9ef0('0x2')}};
\ No newline at end of file
+var _0xf66f=['sequelize','STRING'];(function(_0x59a3e9,_0x27fb38){var _0x5179ac=function(_0x5a9b1c){while(--_0x5a9b1c){_0x59a3e9['push'](_0x59a3e9['shift']());}};_0x5179ac(++_0x27fb38);}(_0xf66f,0xea));var _0xff66=function(_0x1f6835,_0xff3520){_0x1f6835=_0x1f6835-0x0;var _0x10aee2=_0xf66f[_0x1f6835];return _0x10aee2;};'use strict';var Sequelize=require(_0xff66('0x0'));module['exports']={'version':{'type':Sequelize[_0xff66('0x1')],'unique':'version'}};
\ No newline at end of file
diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js
index dcacfb6..4d2839a 100644
--- a/server/api/migration/migration.controller.js
+++ b/server/api/migration/migration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9688=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','Migration','count','includeAll','include','findAll','catch','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0x9688,0xc4));var _0x8968=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9688[_0x160c73];return _0xd9302;};'use strict';var pdf=require(_0x8968('0x0'));var emlformat=require(_0x8968('0x1'));var rimraf=require(_0x8968('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8968('0x3'));var rp=require('request-promise');var moment=require(_0x8968('0x4'));var BPromise=require(_0x8968('0x5'));var Mustache=require(_0x8968('0x6'));var util=require('util');var path=require(_0x8968('0x7'));var sox=require('sox');var csv=require(_0x8968('0x8'));var ejs=require(_0x8968('0x9'));var fs=require('fs');var _=require(_0x8968('0xa'));var squel=require(_0x8968('0xb'));var crypto=require(_0x8968('0xc'));var jsforce=require(_0x8968('0xd'));var deskjs=require(_0x8968('0xe'));var toCsv=require(_0x8968('0x8'));var querystring=require('querystring');var Papa=require(_0x8968('0xf'));var Redis=require(_0x8968('0x10'));var authService=require(_0x8968('0x11'));var qs=require(_0x8968('0x12'));var hardwareService=require(_0x8968('0x13'));var logger=require('../../config/logger')(_0x8968('0x14'));var utils=require(_0x8968('0x15'));var config=require(_0x8968('0x16'));var db=require(_0x8968('0x17'))['db'];function respondWithStatusCode(_0x3cadc8,_0x320006){_0x320006=_0x320006||0xcc;return function(_0x1df88b){if(_0x1df88b){return _0x3cadc8[_0x8968('0x18')](_0x320006);}return _0x3cadc8[_0x8968('0x19')](_0x320006)['end']();};}function respondWithResult(_0x2d2a5b,_0x417a28){_0x417a28=_0x417a28||0xc8;return function(_0x50ac70){if(_0x50ac70){return _0x2d2a5b['status'](_0x417a28)[_0x8968('0x1a')](_0x50ac70);}};}function respondWithFilteredResult(_0x554414,_0x127109){return function(_0x45dd5b){if(_0x45dd5b){var _0x53b4be=_0x45dd5b['count'],_0x480125=_0x127109[_0x8968('0x1b')],_0x27afe0=_0x127109[_0x8968('0x1b')]+_0x127109[_0x8968('0x1c')],_0x57a89c;if(_0x27afe0>=_0x53b4be){_0x27afe0=_0x53b4be;_0x57a89c=0xc8;}else{_0x57a89c=0xce;}_0x554414['status'](_0x57a89c);return _0x554414[_0x8968('0x1d')](_0x8968('0x1e'),_0x480125+'-'+_0x27afe0+'/'+_0x53b4be)[_0x8968('0x1a')](_0x45dd5b);}return null;};}function patchUpdates(_0x4ae830){return function(_0x3ab9bf){try{jsonpatch[_0x8968('0x1f')](_0x3ab9bf,_0x4ae830,!![]);}catch(_0x2212e1){return BPromise['reject'](_0x2212e1);}return _0x3ab9bf[_0x8968('0x20')]();};}function saveUpdates(_0x3dc636,_0xc6d5ce){return function(_0x35d324){if(_0x35d324){return _0x35d324[_0x8968('0x21')](_0x3dc636)[_0x8968('0x22')](function(_0x198bc7){return _0x198bc7;});}return null;};}function removeEntity(_0x3f55f3,_0x55f2b2){return function(_0x352373){if(_0x352373){return _0x352373[_0x8968('0x23')]()[_0x8968('0x22')](function(){_0x3f55f3[_0x8968('0x19')](0xcc)[_0x8968('0x24')]();});}};}function handleEntityNotFound(_0x169328,_0x5699c4){return function(_0x10869b){if(!_0x10869b){_0x169328['sendStatus'](0x194);}return _0x10869b;};}function handleError(_0x27a51c,_0x25edbb){_0x25edbb=_0x25edbb||0x1f4;return function(_0x5bd3f2){logger['error'](_0x5bd3f2[_0x8968('0x25')]);if(_0x5bd3f2[_0x8968('0x26')]){delete _0x5bd3f2[_0x8968('0x26')];}_0x27a51c[_0x8968('0x19')](_0x25edbb)[_0x8968('0x27')](_0x5bd3f2);};}exports[_0x8968('0x28')]=function(_0x41eee3,_0x6f65ed){var _0x55ee3e={},_0x5f0902={},_0x5ca920={'count':0x0,'rows':[]};var _0x3fd4fe=db['Migration'][_0x8968('0x29')];_0x5f0902[_0x8968('0x2a')]=_[_0x8968('0x2b')](_0x3fd4fe);_0x5f0902[_0x8968('0x2c')]=_[_0x8968('0x2b')](_0x41eee3[_0x8968('0x2c')]);_0x5f0902[_0x8968('0x2d')]=_[_0x8968('0x2e')](_0x5f0902[_0x8968('0x2a')],_0x5f0902[_0x8968('0x2c')]);_0x55ee3e[_0x8968('0x2f')]=_[_0x8968('0x2e')](_0x5f0902[_0x8968('0x2a')],qs[_0x8968('0x30')](_0x41eee3['query'][_0x8968('0x30')]));_0x55ee3e[_0x8968('0x2f')]=_0x55ee3e[_0x8968('0x2f')][_0x8968('0x31')]?_0x55ee3e['attributes']:_0x5f0902[_0x8968('0x2a')];if(!_0x41eee3[_0x8968('0x2c')]['hasOwnProperty'](_0x8968('0x32'))){_0x55ee3e['limit']=qs[_0x8968('0x1c')](_0x41eee3[_0x8968('0x2c')][_0x8968('0x1c')]);_0x55ee3e['offset']=qs[_0x8968('0x1b')](_0x41eee3[_0x8968('0x2c')][_0x8968('0x1b')]);}_0x55ee3e[_0x8968('0x33')]=qs[_0x8968('0x34')](_0x41eee3[_0x8968('0x2c')][_0x8968('0x34')]);_0x55ee3e[_0x8968('0x35')]=qs['filters'](_[_0x8968('0x36')](_0x41eee3['query'],_0x5f0902[_0x8968('0x2d')]));if(_0x41eee3[_0x8968('0x2c')][_0x8968('0x37')]){_0x55ee3e[_0x8968('0x35')]=_[_0x8968('0x38')](_0x55ee3e['where'],{'$or':_[_0x8968('0x39')](_0x3fd4fe,function(_0x46cd90){if(_0x46cd90[_0x8968('0x3a')][_0x8968('0x3b')]!==_0x8968('0x3c')){var _0x373571={};_0x373571[_0x46cd90[_0x8968('0x3d')]]={'$like':'%'+_0x41eee3[_0x8968('0x2c')][_0x8968('0x37')]+'%'};return _0x373571;}})});}_0x55ee3e=_[_0x8968('0x38')]({},_0x55ee3e,_0x41eee3['options']);var _0x3147fd={'where':_0x55ee3e[_0x8968('0x35')]};return db[_0x8968('0x3e')][_0x8968('0x3f')](_0x3147fd)[_0x8968('0x22')](function(_0x3f073b){_0x5ca920[_0x8968('0x3f')]=_0x3f073b;if(_0x41eee3[_0x8968('0x2c')][_0x8968('0x40')]){_0x55ee3e[_0x8968('0x41')]=[{'all':!![]}];}return db[_0x8968('0x3e')][_0x8968('0x42')](_0x55ee3e);})[_0x8968('0x22')](function(_0x111a7d){_0x5ca920['rows']=_0x111a7d;return _0x5ca920;})[_0x8968('0x22')](respondWithFilteredResult(_0x6f65ed,_0x55ee3e))[_0x8968('0x43')](handleError(_0x6f65ed,null));};
\ No newline at end of file
+var _0xb052=['attributes','fields','length','hasOwnProperty','nolimit','order','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','Migration','rawAttributes','model','keys','filters','intersection','query'];(function(_0x99a8e7,_0x1b3b40){var _0x2642c5=function(_0x39dd2b){while(--_0x39dd2b){_0x99a8e7['push'](_0x99a8e7['shift']());}};_0x2642c5(++_0x1b3b40);}(_0xb052,0x1d4));var _0x2b05=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0xb052[_0x2b0a86];return _0x955940;};'use strict';var pdf=require(_0x2b05('0x0'));var emlformat=require(_0x2b05('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2b05('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2b05('0x3'));var BPromise=require(_0x2b05('0x4'));var Mustache=require(_0x2b05('0x5'));var util=require(_0x2b05('0x6'));var path=require('path');var sox=require(_0x2b05('0x7'));var csv=require('to-csv');var ejs=require(_0x2b05('0x8'));var fs=require('fs');var _=require(_0x2b05('0x9'));var squel=require(_0x2b05('0xa'));var crypto=require('crypto');var jsforce=require(_0x2b05('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2b05('0xc'));var querystring=require(_0x2b05('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2b05('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2b05('0xf'));var logger=require(_0x2b05('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x2b05('0x11'));var db=require(_0x2b05('0x12'))['db'];function respondWithStatusCode(_0x135bee,_0x58e968){_0x58e968=_0x58e968||0xcc;return function(_0x3a12bb){if(_0x3a12bb){return _0x135bee[_0x2b05('0x13')](_0x58e968);}return _0x135bee['status'](_0x58e968)[_0x2b05('0x14')]();};}function respondWithResult(_0x3ca482,_0x48a79a){_0x48a79a=_0x48a79a||0xc8;return function(_0x31803f){if(_0x31803f){return _0x3ca482[_0x2b05('0x15')](_0x48a79a)[_0x2b05('0x16')](_0x31803f);}};}function respondWithFilteredResult(_0x1adb54,_0x38f6cc){return function(_0x590e7b){if(_0x590e7b){var _0x2f1b07=_0x590e7b['count'],_0x14e79=_0x38f6cc[_0x2b05('0x17')],_0x2af015=_0x38f6cc[_0x2b05('0x17')]+_0x38f6cc[_0x2b05('0x18')],_0x2df24c;if(_0x2af015>=_0x2f1b07){_0x2af015=_0x2f1b07;_0x2df24c=0xc8;}else{_0x2df24c=0xce;}_0x1adb54[_0x2b05('0x15')](_0x2df24c);return _0x1adb54[_0x2b05('0x19')](_0x2b05('0x1a'),_0x14e79+'-'+_0x2af015+'/'+_0x2f1b07)[_0x2b05('0x16')](_0x590e7b);}return null;};}function patchUpdates(_0x2cc99d){return function(_0x2592ed){try{jsonpatch[_0x2b05('0x1b')](_0x2592ed,_0x2cc99d,!![]);}catch(_0x396250){return BPromise[_0x2b05('0x1c')](_0x396250);}return _0x2592ed[_0x2b05('0x1d')]();};}function saveUpdates(_0x36098a,_0x2558d4){return function(_0x4a365c){if(_0x4a365c){return _0x4a365c[_0x2b05('0x1e')](_0x36098a)[_0x2b05('0x1f')](function(_0x3a89fc){return _0x3a89fc;});}return null;};}function removeEntity(_0x2516fa,_0x20ac9c){return function(_0x447e13){if(_0x447e13){return _0x447e13[_0x2b05('0x20')]()[_0x2b05('0x1f')](function(){_0x2516fa[_0x2b05('0x15')](0xcc)[_0x2b05('0x14')]();});}};}function handleEntityNotFound(_0x10c37a,_0x28bf0e){return function(_0x3439e4){if(!_0x3439e4){_0x10c37a[_0x2b05('0x13')](0x194);}return _0x3439e4;};}function handleError(_0x2ccc26,_0x462092){_0x462092=_0x462092||0x1f4;return function(_0xb526d9){logger[_0x2b05('0x21')](_0xb526d9['stack']);if(_0xb526d9['name']){delete _0xb526d9[_0x2b05('0x22')];}_0x2ccc26[_0x2b05('0x15')](_0x462092)[_0x2b05('0x23')](_0xb526d9);};}exports[_0x2b05('0x24')]=function(_0x104232,_0x7ba7d){var _0xb9dc84={},_0x5cb58e={},_0x2a3f73={'count':0x0,'rows':[]};var _0x4ff766=db[_0x2b05('0x25')][_0x2b05('0x26')];_0x5cb58e[_0x2b05('0x27')]=_[_0x2b05('0x28')](_0x4ff766);_0x5cb58e['query']=_[_0x2b05('0x28')](_0x104232['query']);_0x5cb58e[_0x2b05('0x29')]=_[_0x2b05('0x2a')](_0x5cb58e[_0x2b05('0x27')],_0x5cb58e[_0x2b05('0x2b')]);_0xb9dc84[_0x2b05('0x2c')]=_[_0x2b05('0x2a')](_0x5cb58e[_0x2b05('0x27')],qs[_0x2b05('0x2d')](_0x104232[_0x2b05('0x2b')][_0x2b05('0x2d')]));_0xb9dc84[_0x2b05('0x2c')]=_0xb9dc84['attributes'][_0x2b05('0x2e')]?_0xb9dc84[_0x2b05('0x2c')]:_0x5cb58e[_0x2b05('0x27')];if(!_0x104232[_0x2b05('0x2b')][_0x2b05('0x2f')](_0x2b05('0x30'))){_0xb9dc84[_0x2b05('0x18')]=qs[_0x2b05('0x18')](_0x104232[_0x2b05('0x2b')][_0x2b05('0x18')]);_0xb9dc84[_0x2b05('0x17')]=qs[_0x2b05('0x17')](_0x104232[_0x2b05('0x2b')][_0x2b05('0x17')]);}_0xb9dc84[_0x2b05('0x31')]=qs['sort'](_0x104232[_0x2b05('0x2b')]['sort']);_0xb9dc84['where']=qs['filters'](_['pick'](_0x104232[_0x2b05('0x2b')],_0x5cb58e[_0x2b05('0x29')]));if(_0x104232[_0x2b05('0x2b')][_0x2b05('0x32')]){_0xb9dc84['where']=_[_0x2b05('0x33')](_0xb9dc84['where'],{'$or':_[_0x2b05('0x34')](_0x4ff766,function(_0xfc63fc){if(_0xfc63fc[_0x2b05('0x35')][_0x2b05('0x36')]!==_0x2b05('0x37')){var _0x1f79e7={};_0x1f79e7[_0xfc63fc[_0x2b05('0x38')]]={'$like':'%'+_0x104232[_0x2b05('0x2b')][_0x2b05('0x32')]+'%'};return _0x1f79e7;}})});}_0xb9dc84=_[_0x2b05('0x33')]({},_0xb9dc84,_0x104232[_0x2b05('0x39')]);var _0x1f32ea={'where':_0xb9dc84['where']};return db[_0x2b05('0x25')]['count'](_0x1f32ea)[_0x2b05('0x1f')](function(_0x32da9a){_0x2a3f73[_0x2b05('0x3a')]=_0x32da9a;if(_0x104232['query'][_0x2b05('0x3b')]){_0xb9dc84[_0x2b05('0x3c')]=[{'all':!![]}];}return db[_0x2b05('0x25')][_0x2b05('0x3d')](_0xb9dc84);})[_0x2b05('0x1f')](function(_0x392005){_0x2a3f73[_0x2b05('0x3e')]=_0x392005;return _0x2a3f73;})[_0x2b05('0x1f')](respondWithFilteredResult(_0x7ba7d,_0xb9dc84))[_0x2b05('0x3f')](handleError(_0x7ba7d,null));};
\ No newline at end of file
diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js
index 4b6ca5d..41eab9e 100644
--- a/server/api/migration/migration.model.js
+++ b/server/api/migration/migration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x35cb=['bluebird','request-promise','path','rimraf','../../config/environment','define','Migration','util','../../config/logger','api','moment'];(function(_0x12bbc6,_0x1a3eb3){var _0x26a056=function(_0x12626e){while(--_0x12626e){_0x12bbc6['push'](_0x12bbc6['shift']());}};_0x26a056(++_0x1a3eb3);}(_0x35cb,0xe3));var _0xb35c=function(_0x14cd91,_0x4ae5ce){_0x14cd91=_0x14cd91-0x0;var _0x8bb2e6=_0x35cb[_0x14cd91];return _0x8bb2e6;};'use strict';var _=require('lodash');var util=require(_0xb35c('0x0'));var logger=require(_0xb35c('0x1'))(_0xb35c('0x2'));var moment=require(_0xb35c('0x3'));var BPromise=require(_0xb35c('0x4'));var rp=require(_0xb35c('0x5'));var fs=require('fs');var path=require(_0xb35c('0x6'));var rimraf=require(_0xb35c('0x7'));var config=require(_0xb35c('0x8'));var attributes=require('./migration.attributes');module['exports']=function(_0x29c2d3,_0x441f83){return _0x29c2d3[_0xb35c('0x9')](_0xb35c('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc03b=['./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xc03b,0x119));var _0xbc03=function(_0x5713b5,_0x423f83){_0x5713b5=_0x5713b5-0x0;var _0x2f795d=_0xc03b[_0x5713b5];return _0x2f795d;};'use strict';var _=require(_0xbc03('0x0'));var util=require(_0xbc03('0x1'));var logger=require(_0xbc03('0x2'))(_0xbc03('0x3'));var moment=require('moment');var BPromise=require(_0xbc03('0x4'));var rp=require(_0xbc03('0x5'));var fs=require('fs');var path=require(_0xbc03('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbc03('0x7'));module[_0xbc03('0x8')]=function(_0xa3f9e3,_0x20a8fb){return _0xa3f9e3[_0xbc03('0x9')](_0xbc03('0xa'),attributes,{'tableName':_0xbc03('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js
index 7f549b5..dd57487 100644
--- a/server/api/migration/migration.rpc.js
+++ b/server/api/migration/migration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x268880,_0x840a79){var _0x53c0b4=function(_0x23864f){while(--_0x23864f){_0x268880['push'](_0x268880['shift']());}};_0x53c0b4(++_0x840a79);}(_0x00bb,0x1d8));var _0xb00b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x00bb[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});}
\ No newline at end of file
+var _0x5c12=['../../config/environment','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x5c12,0x188));var _0x25c1=function(_0x3de4f8,_0x336c7d){_0x3de4f8=_0x3de4f8-0x0;var _0x3d81fc=_0x5c12[_0x3de4f8];return _0x3d81fc;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('Migration,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('Migration,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('Migration,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});}
\ No newline at end of file
diff --git a/server/api/network/index.js b/server/api/network/index.js
index 6d40e05..0fd4e0f 100644
--- a/server/api/network/index.js
+++ b/server/api/network/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3aca=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3766f4,_0x580673){var _0x183f88=function(_0x4be9ac){while(--_0x4be9ac){_0x3766f4['push'](_0x3766f4['shift']());}};_0x183f88(++_0x580673);}(_0x3aca,0xea));var _0xa3ac=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x3aca[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require(_0xa3ac('0x0'));var util=require(_0xa3ac('0x1'));var path=require(_0xa3ac('0x2'));var timeout=require(_0xa3ac('0x3'));var express=require(_0xa3ac('0x4'));var router=express[_0xa3ac('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa3ac('0x6'));var controller=require(_0xa3ac('0x7'));router[_0xa3ac('0x8')]('/',auth[_0xa3ac('0x9')](),controller[_0xa3ac('0xa')]);router[_0xa3ac('0x8')](_0xa3ac('0xb'),auth['isAuthenticated'](),controller[_0xa3ac('0xc')]);router[_0xa3ac('0xd')]('/',auth['isAuthenticated'](),controller[_0xa3ac('0xe')]);router[_0xa3ac('0xf')](_0xa3ac('0xb'),auth[_0xa3ac('0x9')](),controller['update']);router[_0xa3ac('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa3ac('0x11')]);module[_0xa3ac('0x12')]=router;
\ No newline at end of file
+var _0x6abe=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6abe,0x9b));var _0xe6ab=function(_0x387b27,_0x43983e){_0x387b27=_0x387b27-0x0;var _0x4b07e7=_0x6abe[_0x387b27];return _0x4b07e7;};'use strict';var multer=require(_0xe6ab('0x0'));var util=require(_0xe6ab('0x1'));var path=require(_0xe6ab('0x2'));var timeout=require(_0xe6ab('0x3'));var express=require(_0xe6ab('0x4'));var router=express[_0xe6ab('0x5')]();var auth=require(_0xe6ab('0x6'));var interaction=require(_0xe6ab('0x7'));var config=require(_0xe6ab('0x8'));var controller=require(_0xe6ab('0x9'));router[_0xe6ab('0xa')]('/',auth[_0xe6ab('0xb')](),controller[_0xe6ab('0xc')]);router[_0xe6ab('0xa')](_0xe6ab('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe6ab('0xe')]('/',auth[_0xe6ab('0xb')](),controller[_0xe6ab('0xf')]);router[_0xe6ab('0x10')](_0xe6ab('0xd'),auth['isAuthenticated'](),controller[_0xe6ab('0x11')]);router[_0xe6ab('0x12')](_0xe6ab('0xd'),auth[_0xe6ab('0xb')](),controller['destroy']);module[_0xe6ab('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js
index 450f5e8..d705c55 100644
--- a/server/api/network/network.attributes.js
+++ b/server/api/network/network.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x28d5=['externip','STRING','sequelize','exports','ENUM','localnet'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x28d5,0xf8));var _0x528d=function(_0x58235f,_0x5e3186){_0x58235f=_0x58235f-0x0;var _0x461ccc=_0x28d5[_0x58235f];return _0x461ccc;};'use strict';var Sequelize=require(_0x528d('0x0'));module[_0x528d('0x1')]={'type':{'type':Sequelize[_0x528d('0x2')](_0x528d('0x3'),_0x528d('0x4'))},'value':{'type':Sequelize[_0x528d('0x5')]}};
\ No newline at end of file
+var _0xb539=['STRING','sequelize','exports','ENUM','localnet'];(function(_0x5ca784,_0x28bea2){var _0x5aa579=function(_0x531234){while(--_0x531234){_0x5ca784['push'](_0x5ca784['shift']());}};_0x5aa579(++_0x28bea2);}(_0xb539,0x155));var _0x9b53=function(_0x29fb7f,_0x834b8){_0x29fb7f=_0x29fb7f-0x0;var _0x3df5bb=_0xb539[_0x29fb7f];return _0x3df5bb;};'use strict';var Sequelize=require(_0x9b53('0x0'));module[_0x9b53('0x1')]={'type':{'type':Sequelize[_0x9b53('0x2')](_0x9b53('0x3'),'externip')},'value':{'type':Sequelize[_0x9b53('0x4')]}};
\ No newline at end of file
diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js
index 3059205..51e393c 100644
--- a/server/api/network/network.controller.js
+++ b/server/api/network/network.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb14c=['find','create','sequelize','transaction','findAll','body','readFileSync','join','root','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','catch','server/files/templates/network.ejs','utf8','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','status','end','count','offset','Content-Range','json','apply','reject','save','update','sendStatus','name','index','Network','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','merge','map','type','key','VIRTUAL','field','includeAll','include','show','params','fields'];(function(_0x42dab9,_0x22de42){var _0x8ab5ea=function(_0x4b7ec1){while(--_0x4b7ec1){_0x42dab9['push'](_0x42dab9['shift']());}};_0x8ab5ea(++_0x22de42);}(_0xb14c,0xd4));var _0xcb14=function(_0x486eff,_0x5cb3b0){_0x486eff=_0x486eff-0x0;var _0x95293b=_0xb14c[_0x486eff];return _0x95293b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcb14('0x0'));var rimraf=require(_0xcb14('0x1'));var zipdir=require(_0xcb14('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb14('0x3'));var moment=require(_0xcb14('0x4'));var BPromise=require(_0xcb14('0x5'));var Mustache=require(_0xcb14('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcb14('0x7'));var csv=require(_0xcb14('0x8'));var ejs=require(_0xcb14('0x9'));var fs=require('fs');var _=require(_0xcb14('0xa'));var squel=require(_0xcb14('0xb'));var crypto=require(_0xcb14('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcb14('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb14('0xe'));var Papa=require(_0xcb14('0xf'));var Redis=require(_0xcb14('0x10'));var authService=require(_0xcb14('0x11'));var qs=require(_0xcb14('0x12'));var hardwareService=require(_0xcb14('0x13'));var logger=require(_0xcb14('0x14'))(_0xcb14('0x15'));var utils=require(_0xcb14('0x16'));var config=require('../../config/environment');var db=require(_0xcb14('0x17'))['db'];var jayson=require(_0xcb14('0x18'));var client=jayson[_0xcb14('0x19')][_0xcb14('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x504a6a,_0x18c0ee,_0x1b34bb){if(_0x1b34bb){var _0x4ebd97=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ebd97['test'](_0x18c0ee)){return _0x504a6a;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x504a6a;}}function respondWithRpcPromise(_0x1d8627,_0x3b737d,_0x19eb13,_0x4f1e48){return new BPromise(function(_0x1484db,_0x40211f){var _0x144d98=_0x4f1e48||client;return _0x144d98[_0xcb14('0x1b')](_0x1d8627,_0x19eb13)[_0xcb14('0x1c')](function(_0x4d0b08){logger['info'](_0xcb14('0x1d'),_0x3b737d,'request\x20sent');logger['debug'](_0xcb14('0x1e'),_0x3b737d,_0xcb14('0x1f'),JSON[_0xcb14('0x20')](_0x4d0b08));if(_0x4d0b08[_0xcb14('0x21')]){if(_0x4d0b08['error'][_0xcb14('0x22')]===0x1f4){logger[_0xcb14('0x21')]('Network,\x20%s,\x20%s',_0x3b737d,_0x4d0b08[_0xcb14('0x21')][_0xcb14('0x23')]);return _0x40211f(_0x4d0b08[_0xcb14('0x21')][_0xcb14('0x23')]);}logger[_0xcb14('0x21')](_0xcb14('0x1d'),_0x3b737d,_0x4d0b08[_0xcb14('0x21')][_0xcb14('0x23')]);return _0x1484db(_0x4d0b08[_0xcb14('0x21')][_0xcb14('0x23')]);}else{logger[_0xcb14('0x24')](_0xcb14('0x1d'),_0x3b737d,_0xcb14('0x1f'));_0x1484db(_0x4d0b08[_0xcb14('0x25')][_0xcb14('0x23')]);}})['catch'](function(_0x51be0e){logger[_0xcb14('0x21')](_0xcb14('0x1d'),_0x3b737d,_0x51be0e);_0x40211f(_0x51be0e);});});}function respondWithStatusCode(_0x525bbd,_0x454eb7){_0x454eb7=_0x454eb7||0xcc;return function(_0xd38d7d){if(_0xd38d7d){return _0x525bbd['sendStatus'](_0x454eb7);}return _0x525bbd[_0xcb14('0x26')](_0x454eb7)[_0xcb14('0x27')]();};}function respondWithResult(_0x385b71,_0x1adba6){_0x1adba6=_0x1adba6||0xc8;return function(_0x27aa8a){if(_0x27aa8a){return _0x385b71[_0xcb14('0x26')](_0x1adba6)['json'](_0x27aa8a);}};}function respondWithFilteredResult(_0x1ba536,_0x477c09){return function(_0x196c08){if(_0x196c08){var _0x416a6b=_0x196c08[_0xcb14('0x28')],_0xc366cd=_0x477c09[_0xcb14('0x29')],_0x2e4e8e=_0x477c09['offset']+_0x477c09['limit'],_0x5bdb59;if(_0x2e4e8e>=_0x416a6b){_0x2e4e8e=_0x416a6b;_0x5bdb59=0xc8;}else{_0x5bdb59=0xce;}_0x1ba536['status'](_0x5bdb59);return _0x1ba536['set'](_0xcb14('0x2a'),_0xc366cd+'-'+_0x2e4e8e+'/'+_0x416a6b)[_0xcb14('0x2b')](_0x196c08);}return null;};}function patchUpdates(_0x2c54ea){return function(_0x487e00){try{jsonpatch[_0xcb14('0x2c')](_0x487e00,_0x2c54ea,!![]);}catch(_0x124191){return BPromise[_0xcb14('0x2d')](_0x124191);}return _0x487e00[_0xcb14('0x2e')]();};}function saveUpdates(_0x4246c4,_0x5dd7f2){return function(_0x11903d){if(_0x11903d){return _0x11903d[_0xcb14('0x2f')](_0x4246c4)['then'](function(_0x1e03a5){return _0x1e03a5;});}return null;};}function removeEntity(_0x56190f,_0x1346b0){return function(_0x530cf8){if(_0x530cf8){return _0x530cf8['destroy']()['then'](function(){_0x56190f[_0xcb14('0x26')](0xcc)[_0xcb14('0x27')]();});}};}function handleEntityNotFound(_0x2bfe31,_0x11bd16){return function(_0x49e976){if(!_0x49e976){_0x2bfe31[_0xcb14('0x30')](0x194);}return _0x49e976;};}function handleError(_0x18c2f8,_0x2bacc5){_0x2bacc5=_0x2bacc5||0x1f4;return function(_0x170016){logger['error'](_0x170016['stack']);if(_0x170016[_0xcb14('0x31')]){delete _0x170016[_0xcb14('0x31')];}_0x18c2f8['status'](_0x2bacc5)['send'](_0x170016);};}exports[_0xcb14('0x32')]=function(_0x48608e,_0x11c766){var _0xec38a4={},_0x2a65b2={},_0x3487a2={'count':0x0,'rows':[]};var _0x110579=db[_0xcb14('0x33')][_0xcb14('0x34')];_0x2a65b2[_0xcb14('0x35')]=_[_0xcb14('0x36')](_0x110579);_0x2a65b2[_0xcb14('0x37')]=_['keys'](_0x48608e['query']);_0x2a65b2['filters']=_[_0xcb14('0x38')](_0x2a65b2[_0xcb14('0x35')],_0x2a65b2[_0xcb14('0x37')]);_0xec38a4[_0xcb14('0x39')]=_[_0xcb14('0x38')](_0x2a65b2[_0xcb14('0x35')],qs['fields'](_0x48608e[_0xcb14('0x37')]['fields']));_0xec38a4[_0xcb14('0x39')]=_0xec38a4[_0xcb14('0x39')][_0xcb14('0x3a')]?_0xec38a4[_0xcb14('0x39')]:_0x2a65b2[_0xcb14('0x35')];if(!_0x48608e[_0xcb14('0x37')][_0xcb14('0x3b')](_0xcb14('0x3c'))){_0xec38a4['limit']=qs['limit'](_0x48608e[_0xcb14('0x37')][_0xcb14('0x3d')]);_0xec38a4[_0xcb14('0x29')]=qs['offset'](_0x48608e[_0xcb14('0x37')][_0xcb14('0x29')]);}_0xec38a4['order']=qs[_0xcb14('0x3e')](_0x48608e['query'][_0xcb14('0x3e')]);_0xec38a4[_0xcb14('0x3f')]=qs['filters'](_['pick'](_0x48608e[_0xcb14('0x37')],_0x2a65b2[_0xcb14('0x40')]));if(_0x48608e[_0xcb14('0x37')]['filter']){_0xec38a4[_0xcb14('0x3f')]=_[_0xcb14('0x41')](_0xec38a4[_0xcb14('0x3f')],{'$or':_[_0xcb14('0x42')](_0x110579,function(_0x5ed5c7){if(_0x5ed5c7[_0xcb14('0x43')][_0xcb14('0x44')]!==_0xcb14('0x45')){var _0x2c2147={};_0x2c2147[_0x5ed5c7[_0xcb14('0x46')]]={'$like':'%'+_0x48608e[_0xcb14('0x37')]['filter']+'%'};return _0x2c2147;}})});}_0xec38a4=_[_0xcb14('0x41')]({},_0xec38a4,_0x48608e['options']);var _0x362354={'where':_0xec38a4[_0xcb14('0x3f')]};return db['Network'][_0xcb14('0x28')](_0x362354)['then'](function(_0x2ed8e1){_0x3487a2[_0xcb14('0x28')]=_0x2ed8e1;if(_0x48608e[_0xcb14('0x37')][_0xcb14('0x47')]){_0xec38a4[_0xcb14('0x48')]=[{'all':!![]}];}return db[_0xcb14('0x33')]['findAll'](_0xec38a4);})[_0xcb14('0x1c')](function(_0xeab65a){_0x3487a2['rows']=_0xeab65a;return _0x3487a2;})[_0xcb14('0x1c')](respondWithFilteredResult(_0x11c766,_0xec38a4))['catch'](handleError(_0x11c766,null));};exports[_0xcb14('0x49')]=function(_0x51c067,_0x2da09b){var _0x5c8fa6={'raw':!![],'where':{'id':_0x51c067[_0xcb14('0x4a')]['id']}},_0x8fcb6f={};_0x8fcb6f['model']=_[_0xcb14('0x36')](db[_0xcb14('0x33')][_0xcb14('0x34')]);_0x8fcb6f[_0xcb14('0x37')]=_[_0xcb14('0x36')](_0x51c067[_0xcb14('0x37')]);_0x8fcb6f[_0xcb14('0x40')]=_[_0xcb14('0x38')](_0x8fcb6f['model'],_0x8fcb6f[_0xcb14('0x37')]);_0x5c8fa6['attributes']=_['intersection'](_0x8fcb6f[_0xcb14('0x35')],qs[_0xcb14('0x4b')](_0x51c067[_0xcb14('0x37')][_0xcb14('0x4b')]));_0x5c8fa6['attributes']=_0x5c8fa6['attributes'][_0xcb14('0x3a')]?_0x5c8fa6[_0xcb14('0x39')]:_0x8fcb6f[_0xcb14('0x35')];if(_0x51c067[_0xcb14('0x37')]['includeAll']){_0x5c8fa6['include']=[{'all':!![]}];}_0x5c8fa6=_[_0xcb14('0x41')]({},_0x5c8fa6,_0x51c067['options']);return db[_0xcb14('0x33')][_0xcb14('0x4c')](_0x5c8fa6)['then'](handleEntityNotFound(_0x2da09b,null))['then'](respondWithResult(_0x2da09b,null))['catch'](handleError(_0x2da09b,null));};exports[_0xcb14('0x4d')]=function(_0x308019,_0x5b32ea,_0x583381){var _0x8534b0;return db[_0xcb14('0x4e')][_0xcb14('0x4f')](function(_0x19c43b){return db[_0xcb14('0x33')][_0xcb14('0x4d')](_0x308019['body'],{'raw':!![]})[_0xcb14('0x1c')](function(_0xecdbd2){_0x8534b0=_0xecdbd2;return db[_0xcb14('0x33')][_0xcb14('0x50')]({'where':{'type':_0x308019[_0xcb14('0x51')][_0xcb14('0x43')]},'raw':!![]});})[_0xcb14('0x1c')](function(_0x11c61e){var _0x564890=fs[_0xcb14('0x52')](path[_0xcb14('0x53')](config[_0xcb14('0x54')],'server/files/templates/network.ejs'),'utf8');var _0x4fcee4=ejs[_0xcb14('0x55')](_0x564890,{'networks':_0x11c61e||[]});fs[_0xcb14('0x56')](util[_0xcb14('0x57')](_0xcb14('0x58'),_0x308019[_0xcb14('0x51')]['type'][_0xcb14('0x59')]()),_0x4fcee4);})['then'](function(){return respondWithRpcPromise(_0xcb14('0x5a'),_0xcb14('0x4d'),{'module':_0xcb14('0x5b')});})[_0xcb14('0x1c')](function(){return _0x8534b0;});})[_0xcb14('0x1c')](respondWithResult(_0x5b32ea,0xc9))[_0xcb14('0x5c')](handleError(_0x5b32ea,null));};exports[_0xcb14('0x2f')]=function(_0x17ed7d,_0x211406,_0x2858d6){var _0x24cd40;return db[_0xcb14('0x4e')][_0xcb14('0x4f')](function(_0x274e3f){return db[_0xcb14('0x33')]['find']({'where':{'id':_0x17ed7d['params']['id']}})[_0xcb14('0x1c')](handleEntityNotFound(_0x211406,null))[_0xcb14('0x1c')](saveUpdates(_0x17ed7d['body'],null))[_0xcb14('0x1c')](function(_0x23fe89){if(_0x23fe89){_0x24cd40=_0x23fe89;return db[_0xcb14('0x33')]['findAll']({'where':{'type':_0x24cd40[_0xcb14('0x43')]},'raw':!![]});}return null;})[_0xcb14('0x1c')](function(_0xbd3339){if(_0xbd3339){var _0x3c0e64=fs[_0xcb14('0x52')](path[_0xcb14('0x53')](config[_0xcb14('0x54')],_0xcb14('0x5d')),_0xcb14('0x5e'));var _0x4ec661=ejs[_0xcb14('0x55')](_0x3c0e64,{'networks':_0xbd3339||[]});fs[_0xcb14('0x56')](util[_0xcb14('0x57')](_0xcb14('0x58'),_0x24cd40['type'][_0xcb14('0x59')]()),_0x4ec661);return respondWithRpcPromise(_0xcb14('0x5a'),_0xcb14('0x2f'),{'module':_0xcb14('0x5b')});}return null;})[_0xcb14('0x1c')](function(_0x362dad){if(_0x362dad){return _0x24cd40;}return null;});})[_0xcb14('0x1c')](respondWithResult(_0x211406,null))[_0xcb14('0x5c')](handleError(_0x211406,null));};exports[_0xcb14('0x5f')]=function(_0x2b90da,_0x1a315e,_0x57eede){var _0x11e8af;return db['Network']['find']({'where':{'id':_0x2b90da[_0xcb14('0x4a')]['id']}})['then'](function(_0x3b457e){_0x11e8af=_0x3b457e;return _0x3b457e;})['then'](handleEntityNotFound(_0x1a315e,null))[_0xcb14('0x1c')](removeEntity(_0x1a315e,null))[_0xcb14('0x1c')](function(){if(_0x11e8af){return db['Network'][_0xcb14('0x50')]({'where':{'type':_0x11e8af['type']},'raw':!![]});}})[_0xcb14('0x1c')](function(_0x257439){if(_0x257439){var _0x307535=fs['readFileSync'](path['join'](config['root'],_0xcb14('0x5d')),_0xcb14('0x5e'));var _0xf44638=ejs[_0xcb14('0x55')](_0x307535,{'networks':_0x257439||[]});fs[_0xcb14('0x56')](util[_0xcb14('0x57')]('/etc/asterisk/sip_xcally_%s.conf',_0x11e8af[_0xcb14('0x43')][_0xcb14('0x59')]()),_0xf44638);return respondWithRpcPromise(_0xcb14('0x5a'),_0xcb14('0x5f'),{'module':_0xcb14('0x5b')});}})['catch'](handleError(_0x1a315e,null));};
\ No newline at end of file
+var _0x3a3d=['ejs','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','Network,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','Network','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','map','key','VIRTUAL','field','count','includeAll','include','findAll','rows','show','params','length','options','find','sequelize','transaction','create','body','type','readFileSync','server/files/templates/network.ejs','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','root','Reload','join','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path'];(function(_0x484bbb,_0x1643d9){var _0x275422=function(_0x110516){while(--_0x110516){_0x484bbb['push'](_0x484bbb['shift']());}};_0x275422(++_0x1643d9);}(_0x3a3d,0x121));var _0xd3a3=function(_0x2454e9,_0x288092){_0x2454e9=_0x2454e9-0x0;var _0x2e1ab5=_0x3a3d[_0x2454e9];return _0x2e1ab5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd3a3('0x0'));var rimraf=require(_0xd3a3('0x1'));var zipdir=require(_0xd3a3('0x2'));var jsonpatch=require(_0xd3a3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd3a3('0x4'));var Mustache=require(_0xd3a3('0x5'));var util=require(_0xd3a3('0x6'));var path=require(_0xd3a3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd3a3('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd3a3('0x9'));var crypto=require('crypto');var jsforce=require(_0xd3a3('0xa'));var deskjs=require(_0xd3a3('0xb'));var toCsv=require(_0xd3a3('0xc'));var querystring=require('querystring');var Papa=require(_0xd3a3('0xd'));var Redis=require(_0xd3a3('0xe'));var authService=require(_0xd3a3('0xf'));var qs=require(_0xd3a3('0x10'));var hardwareService=require(_0xd3a3('0x11'));var logger=require(_0xd3a3('0x12'))(_0xd3a3('0x13'));var utils=require(_0xd3a3('0x14'));var config=require(_0xd3a3('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xd3a3('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x57f272,_0x3009ed,_0x305677){if(_0x305677){var _0x2edbb2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2edbb2[_0xd3a3('0x17')](_0x3009ed)){return _0x57f272;}else{throw new Error(_0xd3a3('0x18'));}}else{return _0x57f272;}}function respondWithRpcPromise(_0x2997a5,_0x5cdac1,_0x1d9fbc,_0x375ded){return new BPromise(function(_0x57d223,_0x52a854){var _0x8b2eeb=_0x375ded||client;return _0x8b2eeb[_0xd3a3('0x19')](_0x2997a5,_0x1d9fbc)['then'](function(_0x39240a){logger[_0xd3a3('0x1a')]('Network,\x20%s,\x20%s',_0x5cdac1,_0xd3a3('0x1b'));logger[_0xd3a3('0x1c')](_0xd3a3('0x1d'),_0x5cdac1,'request\x20sent',JSON[_0xd3a3('0x1e')](_0x39240a));if(_0x39240a[_0xd3a3('0x1f')]){if(_0x39240a[_0xd3a3('0x1f')]['code']===0x1f4){logger[_0xd3a3('0x1f')](_0xd3a3('0x20'),_0x5cdac1,_0x39240a[_0xd3a3('0x1f')]['message']);return _0x52a854(_0x39240a[_0xd3a3('0x1f')][_0xd3a3('0x21')]);}logger['error'](_0xd3a3('0x20'),_0x5cdac1,_0x39240a['error'][_0xd3a3('0x21')]);return _0x57d223(_0x39240a['error'][_0xd3a3('0x21')]);}else{logger[_0xd3a3('0x1a')]('Network,\x20%s,\x20%s',_0x5cdac1,_0xd3a3('0x1b'));_0x57d223(_0x39240a[_0xd3a3('0x22')]['message']);}})[_0xd3a3('0x23')](function(_0x48d947){logger[_0xd3a3('0x1f')](_0xd3a3('0x20'),_0x5cdac1,_0x48d947);_0x52a854(_0x48d947);});});}function respondWithStatusCode(_0x10f10e,_0x1a4963){_0x1a4963=_0x1a4963||0xcc;return function(_0x482acb){if(_0x482acb){return _0x10f10e[_0xd3a3('0x24')](_0x1a4963);}return _0x10f10e[_0xd3a3('0x25')](_0x1a4963)[_0xd3a3('0x26')]();};}function respondWithResult(_0x19569a,_0x2cd2eb){_0x2cd2eb=_0x2cd2eb||0xc8;return function(_0x5c08c0){if(_0x5c08c0){return _0x19569a[_0xd3a3('0x25')](_0x2cd2eb)[_0xd3a3('0x27')](_0x5c08c0);}};}function respondWithFilteredResult(_0x46a3df,_0x3e11eb){return function(_0x321103){if(_0x321103){var _0x5a75fd=_0x321103['count'],_0x575e6a=_0x3e11eb[_0xd3a3('0x28')],_0x355e02=_0x3e11eb['offset']+_0x3e11eb[_0xd3a3('0x29')],_0x391550;if(_0x355e02>=_0x5a75fd){_0x355e02=_0x5a75fd;_0x391550=0xc8;}else{_0x391550=0xce;}_0x46a3df[_0xd3a3('0x25')](_0x391550);return _0x46a3df[_0xd3a3('0x2a')](_0xd3a3('0x2b'),_0x575e6a+'-'+_0x355e02+'/'+_0x5a75fd)['json'](_0x321103);}return null;};}function patchUpdates(_0xa7d880){return function(_0xc695e9){try{jsonpatch[_0xd3a3('0x2c')](_0xc695e9,_0xa7d880,!![]);}catch(_0x5dbd7d){return BPromise[_0xd3a3('0x2d')](_0x5dbd7d);}return _0xc695e9[_0xd3a3('0x2e')]();};}function saveUpdates(_0x45ff57,_0x52f699){return function(_0x13ad28){if(_0x13ad28){return _0x13ad28[_0xd3a3('0x2f')](_0x45ff57)[_0xd3a3('0x30')](function(_0x1054f5){return _0x1054f5;});}return null;};}function removeEntity(_0xff625a,_0x3acc07){return function(_0x442f77){if(_0x442f77){return _0x442f77[_0xd3a3('0x31')]()[_0xd3a3('0x30')](function(){_0xff625a[_0xd3a3('0x25')](0xcc)[_0xd3a3('0x26')]();});}};}function handleEntityNotFound(_0x1cd453,_0x29f162){return function(_0x2106f6){if(!_0x2106f6){_0x1cd453[_0xd3a3('0x24')](0x194);}return _0x2106f6;};}function handleError(_0x23e995,_0x26e649){_0x26e649=_0x26e649||0x1f4;return function(_0x511f4f){logger[_0xd3a3('0x1f')](_0x511f4f[_0xd3a3('0x32')]);if(_0x511f4f[_0xd3a3('0x33')]){delete _0x511f4f[_0xd3a3('0x33')];}_0x23e995[_0xd3a3('0x25')](_0x26e649)['send'](_0x511f4f);};}exports[_0xd3a3('0x34')]=function(_0xd6237e,_0x36c0d7){var _0xf43ca8={},_0x32fbe5={},_0x177d5b={'count':0x0,'rows':[]};var _0x5000ee=db[_0xd3a3('0x35')][_0xd3a3('0x36')];_0x32fbe5[_0xd3a3('0x37')]=_['keys'](_0x5000ee);_0x32fbe5[_0xd3a3('0x38')]=_[_0xd3a3('0x39')](_0xd6237e[_0xd3a3('0x38')]);_0x32fbe5[_0xd3a3('0x3a')]=_[_0xd3a3('0x3b')](_0x32fbe5[_0xd3a3('0x37')],_0x32fbe5['query']);_0xf43ca8[_0xd3a3('0x3c')]=_[_0xd3a3('0x3b')](_0x32fbe5[_0xd3a3('0x37')],qs[_0xd3a3('0x3d')](_0xd6237e[_0xd3a3('0x38')][_0xd3a3('0x3d')]));_0xf43ca8[_0xd3a3('0x3c')]=_0xf43ca8[_0xd3a3('0x3c')]['length']?_0xf43ca8['attributes']:_0x32fbe5['model'];if(!_0xd6237e[_0xd3a3('0x38')][_0xd3a3('0x3e')](_0xd3a3('0x3f'))){_0xf43ca8['limit']=qs[_0xd3a3('0x29')](_0xd6237e[_0xd3a3('0x38')][_0xd3a3('0x29')]);_0xf43ca8['offset']=qs[_0xd3a3('0x28')](_0xd6237e['query'][_0xd3a3('0x28')]);}_0xf43ca8['order']=qs['sort'](_0xd6237e[_0xd3a3('0x38')][_0xd3a3('0x40')]);_0xf43ca8['where']=qs[_0xd3a3('0x3a')](_['pick'](_0xd6237e[_0xd3a3('0x38')],_0x32fbe5[_0xd3a3('0x3a')]));if(_0xd6237e[_0xd3a3('0x38')][_0xd3a3('0x41')]){_0xf43ca8[_0xd3a3('0x42')]=_[_0xd3a3('0x43')](_0xf43ca8[_0xd3a3('0x42')],{'$or':_[_0xd3a3('0x44')](_0x5000ee,function(_0x15802c){if(_0x15802c['type'][_0xd3a3('0x45')]!==_0xd3a3('0x46')){var _0x4a4ce7={};_0x4a4ce7[_0x15802c[_0xd3a3('0x47')]]={'$like':'%'+_0xd6237e[_0xd3a3('0x38')]['filter']+'%'};return _0x4a4ce7;}})});}_0xf43ca8=_['merge']({},_0xf43ca8,_0xd6237e['options']);var _0x22febb={'where':_0xf43ca8[_0xd3a3('0x42')]};return db[_0xd3a3('0x35')][_0xd3a3('0x48')](_0x22febb)[_0xd3a3('0x30')](function(_0x2c326b){_0x177d5b[_0xd3a3('0x48')]=_0x2c326b;if(_0xd6237e[_0xd3a3('0x38')][_0xd3a3('0x49')]){_0xf43ca8[_0xd3a3('0x4a')]=[{'all':!![]}];}return db[_0xd3a3('0x35')][_0xd3a3('0x4b')](_0xf43ca8);})[_0xd3a3('0x30')](function(_0x32d830){_0x177d5b[_0xd3a3('0x4c')]=_0x32d830;return _0x177d5b;})[_0xd3a3('0x30')](respondWithFilteredResult(_0x36c0d7,_0xf43ca8))[_0xd3a3('0x23')](handleError(_0x36c0d7,null));};exports[_0xd3a3('0x4d')]=function(_0x3692a4,_0x3dd4bb){var _0x5b022a={'raw':!![],'where':{'id':_0x3692a4[_0xd3a3('0x4e')]['id']}},_0x6fad2f={};_0x6fad2f[_0xd3a3('0x37')]=_[_0xd3a3('0x39')](db[_0xd3a3('0x35')][_0xd3a3('0x36')]);_0x6fad2f[_0xd3a3('0x38')]=_['keys'](_0x3692a4['query']);_0x6fad2f['filters']=_[_0xd3a3('0x3b')](_0x6fad2f['model'],_0x6fad2f[_0xd3a3('0x38')]);_0x5b022a[_0xd3a3('0x3c')]=_[_0xd3a3('0x3b')](_0x6fad2f[_0xd3a3('0x37')],qs['fields'](_0x3692a4[_0xd3a3('0x38')][_0xd3a3('0x3d')]));_0x5b022a[_0xd3a3('0x3c')]=_0x5b022a[_0xd3a3('0x3c')][_0xd3a3('0x4f')]?_0x5b022a[_0xd3a3('0x3c')]:_0x6fad2f['model'];if(_0x3692a4[_0xd3a3('0x38')]['includeAll']){_0x5b022a[_0xd3a3('0x4a')]=[{'all':!![]}];}_0x5b022a=_['merge']({},_0x5b022a,_0x3692a4[_0xd3a3('0x50')]);return db[_0xd3a3('0x35')][_0xd3a3('0x51')](_0x5b022a)[_0xd3a3('0x30')](handleEntityNotFound(_0x3dd4bb,null))['then'](respondWithResult(_0x3dd4bb,null))[_0xd3a3('0x23')](handleError(_0x3dd4bb,null));};exports['create']=function(_0x3242e4,_0x33b309,_0x2e152d){var _0x4a5f68;return db[_0xd3a3('0x52')][_0xd3a3('0x53')](function(_0x46899d){return db[_0xd3a3('0x35')][_0xd3a3('0x54')](_0x3242e4[_0xd3a3('0x55')],{'raw':!![]})['then'](function(_0x52af2a){_0x4a5f68=_0x52af2a;return db[_0xd3a3('0x35')][_0xd3a3('0x4b')]({'where':{'type':_0x3242e4[_0xd3a3('0x55')][_0xd3a3('0x56')]},'raw':!![]});})[_0xd3a3('0x30')](function(_0x373442){var _0x40e08d=fs[_0xd3a3('0x57')](path['join'](config['root'],_0xd3a3('0x58')),_0xd3a3('0x59'));var _0x48454b=ejs[_0xd3a3('0x5a')](_0x40e08d,{'networks':_0x373442||[]});fs[_0xd3a3('0x5b')](util[_0xd3a3('0x5c')](_0xd3a3('0x5d'),_0x3242e4[_0xd3a3('0x55')]['type']['toLowerCase']()),_0x48454b);})[_0xd3a3('0x30')](function(){return respondWithRpcPromise('Reload','create',{'module':_0xd3a3('0x5e')});})[_0xd3a3('0x30')](function(){return _0x4a5f68;});})[_0xd3a3('0x30')](respondWithResult(_0x33b309,0xc9))[_0xd3a3('0x23')](handleError(_0x33b309,null));};exports[_0xd3a3('0x2f')]=function(_0x4c0efa,_0x4079a9,_0x39368a){var _0x23a3dc;return db[_0xd3a3('0x52')][_0xd3a3('0x53')](function(_0x4e4c74){return db['Network']['find']({'where':{'id':_0x4c0efa[_0xd3a3('0x4e')]['id']}})[_0xd3a3('0x30')](handleEntityNotFound(_0x4079a9,null))['then'](saveUpdates(_0x4c0efa[_0xd3a3('0x55')],null))[_0xd3a3('0x30')](function(_0x4aea5b){if(_0x4aea5b){_0x23a3dc=_0x4aea5b;return db['Network']['findAll']({'where':{'type':_0x23a3dc[_0xd3a3('0x56')]},'raw':!![]});}return null;})[_0xd3a3('0x30')](function(_0x186508){if(_0x186508){var _0x1adfa7=fs['readFileSync'](path['join'](config[_0xd3a3('0x5f')],_0xd3a3('0x58')),_0xd3a3('0x59'));var _0x31a338=ejs[_0xd3a3('0x5a')](_0x1adfa7,{'networks':_0x186508||[]});fs[_0xd3a3('0x5b')](util[_0xd3a3('0x5c')]('/etc/asterisk/sip_xcally_%s.conf',_0x23a3dc['type']['toLowerCase']()),_0x31a338);return respondWithRpcPromise(_0xd3a3('0x60'),_0xd3a3('0x2f'),{'module':_0xd3a3('0x5e')});}return null;})[_0xd3a3('0x30')](function(_0x577c08){if(_0x577c08){return _0x23a3dc;}return null;});})['then'](respondWithResult(_0x4079a9,null))[_0xd3a3('0x23')](handleError(_0x4079a9,null));};exports[_0xd3a3('0x31')]=function(_0x2ca882,_0x1ced31,_0x188aa4){var _0x2b18ab;return db[_0xd3a3('0x35')][_0xd3a3('0x51')]({'where':{'id':_0x2ca882[_0xd3a3('0x4e')]['id']}})[_0xd3a3('0x30')](function(_0x267066){_0x2b18ab=_0x267066;return _0x267066;})['then'](handleEntityNotFound(_0x1ced31,null))[_0xd3a3('0x30')](removeEntity(_0x1ced31,null))[_0xd3a3('0x30')](function(){if(_0x2b18ab){return db[_0xd3a3('0x35')]['findAll']({'where':{'type':_0x2b18ab[_0xd3a3('0x56')]},'raw':!![]});}})[_0xd3a3('0x30')](function(_0x2b0c87){if(_0x2b0c87){var _0x3066d6=fs[_0xd3a3('0x57')](path[_0xd3a3('0x61')](config[_0xd3a3('0x5f')],_0xd3a3('0x58')),_0xd3a3('0x59'));var _0x30ba45=ejs[_0xd3a3('0x5a')](_0x3066d6,{'networks':_0x2b0c87||[]});fs['writeFileSync'](util['format'](_0xd3a3('0x5d'),_0x2b18ab[_0xd3a3('0x56')][_0xd3a3('0x62')]()),_0x30ba45);return respondWithRpcPromise('Reload',_0xd3a3('0x31'),{'module':_0xd3a3('0x5e')});}})[_0xd3a3('0x23')](handleError(_0x1ced31,null));};
\ No newline at end of file
diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js
index d8172cb..74d194f 100644
--- a/server/api/network/network.model.js
+++ b/server/api/network/network.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa438=['../../config/environment','./network.attributes','exports','Network','network','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa438,0x130));var _0x8a43=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa438[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x8a43('0x0'));var logger=require(_0x8a43('0x1'))(_0x8a43('0x2'));var moment=require(_0x8a43('0x3'));var BPromise=require(_0x8a43('0x4'));var rp=require(_0x8a43('0x5'));var fs=require('fs');var path=require(_0x8a43('0x6'));var rimraf=require(_0x8a43('0x7'));var config=require(_0x8a43('0x8'));var attributes=require(_0x8a43('0x9'));module[_0x8a43('0xa')]=function(_0x4469dd,_0x46b9c1){return _0x4469dd['define'](_0x8a43('0xb'),attributes,{'tableName':_0x8a43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x876b=['rimraf','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x23dc18,_0x1e729a){var _0x248c55=function(_0x380498){while(--_0x380498){_0x23dc18['push'](_0x23dc18['shift']());}};_0x248c55(++_0x1e729a);}(_0x876b,0x19d));var _0xb876=function(_0x414a58,_0x2b28bb){_0x414a58=_0x414a58-0x0;var _0x5a6e7b=_0x876b[_0x414a58];return _0x5a6e7b;};'use strict';var _=require(_0xb876('0x0'));var util=require(_0xb876('0x1'));var logger=require(_0xb876('0x2'))(_0xb876('0x3'));var moment=require('moment');var BPromise=require(_0xb876('0x4'));var rp=require(_0xb876('0x5'));var fs=require('fs');var path=require(_0xb876('0x6'));var rimraf=require(_0xb876('0x7'));var config=require(_0xb876('0x8'));var attributes=require(_0xb876('0x9'));module[_0xb876('0xa')]=function(_0x19d8cd,_0xdbc98){return _0x19d8cd[_0xb876('0xb')](_0xb876('0xc'),attributes,{'tableName':_0xb876('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js
index 930d391..a49702e 100644
--- a/server/api/network/network.rpc.js
+++ b/server/api/network/network.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0xd75d67,_0x3274bb){_0xd75d67=_0xd75d67-0x0;var _0x8d7d3a=_0x3f8a[_0xd75d67];return _0x8d7d3a;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('Network,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});}
\ No newline at end of file
+var _0xd67b=['Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s'];(function(_0x4c001b,_0x594cff){var _0x166de1=function(_0x2dbbe1){while(--_0x2dbbe1){_0x4c001b['push'](_0x4c001b['shift']());}};_0x166de1(++_0x594cff);}(_0xd67b,0x133));var _0xbd67=function(_0x3e29d7,_0x3ebe74){_0x3e29d7=_0x3e29d7-0x0;var _0x523a5f=_0xd67b[_0x3e29d7];return _0x523a5f;};'use strict';var _=require('lodash');var util=require(_0xbd67('0x0'));var moment=require('moment');var BPromise=require(_0xbd67('0x1'));var rs=require(_0xbd67('0x2'));var fs=require('fs');var Redis=require(_0xbd67('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd67('0x4'));var logger=require('../../config/logger')(_0xbd67('0x5'));var config=require('../../config/environment');var jayson=require(_0xbd67('0x6'));var client=jayson[_0xbd67('0x7')][_0xbd67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27b016,_0x1860c9,_0x72f9ac){return new BPromise(function(_0x2d4af6,_0xfad775){return client[_0xbd67('0x9')](_0x27b016,_0x72f9ac)[_0xbd67('0xa')](function(_0x177f41){logger[_0xbd67('0xb')](_0xbd67('0xc'),_0x1860c9,'request\x20sent');logger['debug'](_0xbd67('0xd'),_0x1860c9,'request\x20sent',JSON[_0xbd67('0xe')](_0x177f41));if(_0x177f41[_0xbd67('0xf')]){if(_0x177f41[_0xbd67('0xf')][_0xbd67('0x10')]===0x1f4){logger[_0xbd67('0xf')](_0xbd67('0xc'),_0x1860c9,_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);return _0xfad775(_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);}logger['error'](_0xbd67('0xc'),_0x1860c9,_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);return _0x2d4af6(_0x177f41[_0xbd67('0xf')][_0xbd67('0x11')]);}else{logger[_0xbd67('0xb')](_0xbd67('0xc'),_0x1860c9,_0xbd67('0x12'));_0x2d4af6(_0x177f41[_0xbd67('0x13')][_0xbd67('0x11')]);}})['catch'](function(_0x4ab3a6){logger[_0xbd67('0xf')](_0xbd67('0xc'),_0x1860c9,_0x4ab3a6);_0xfad775(_0x4ab3a6);});});}
\ No newline at end of file
diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js
index 105fec4..aac6358 100644
--- a/server/api/openchannelAccount/index.js
+++ b/server/api/openchannelAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce26=['util','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','post','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/users','/:id/send','send','put','delete','removeAnswers','removeAgents','exports'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0xce26,0x100));var _0x6ce2=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xce26[_0x75f869];return _0x10af8b;};'use strict';var multer=require('multer');var util=require(_0x6ce2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ce2('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x6ce2('0x2'));var config=require(_0x6ce2('0x3'));var controller=require(_0x6ce2('0x4'));router['get']('/',auth[_0x6ce2('0x5')](),controller[_0x6ce2('0x6')]);router[_0x6ce2('0x7')](_0x6ce2('0x8'),auth[_0x6ce2('0x5')](),controller['describe']);router[_0x6ce2('0x7')](_0x6ce2('0x9'),auth[_0x6ce2('0x5')](),controller[_0x6ce2('0xa')]);router[_0x6ce2('0x7')](_0x6ce2('0xb'),auth[_0x6ce2('0x5')](),controller['getDispositions']);router[_0x6ce2('0x7')](_0x6ce2('0xc'),auth['isAuthenticated'](),controller[_0x6ce2('0xd')]);router['get']('/:id/applications',auth[_0x6ce2('0x5')](),controller[_0x6ce2('0xe')]);router[_0x6ce2('0x7')](_0x6ce2('0xf'),auth['isAuthenticated'](),controller[_0x6ce2('0x10')]);router['get']('/:id/users',auth[_0x6ce2('0x5')](),controller['getAgents']);router[_0x6ce2('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6ce2('0x11')](_0x6ce2('0xb'),auth[_0x6ce2('0x5')](),controller[_0x6ce2('0x12')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x6ce2('0x13')]);router['post'](_0x6ce2('0x14'),controller[_0x6ce2('0x15')]);router['post'](_0x6ce2('0x16'),auth['isAuthenticated'](),controller[_0x6ce2('0x17')]);router[_0x6ce2('0x11')](_0x6ce2('0x18'),auth['isAuthenticated'](),controller['addAgents']);router[_0x6ce2('0x11')](_0x6ce2('0x19'),auth[_0x6ce2('0x5')](),controller[_0x6ce2('0x1a')]);router[_0x6ce2('0x1b')](_0x6ce2('0x9'),auth[_0x6ce2('0x5')](),controller['update']);router[_0x6ce2('0x1c')](_0x6ce2('0x9'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x6ce2('0xb'),auth[_0x6ce2('0x5')](),controller['removeDispositions']);router[_0x6ce2('0x1c')](_0x6ce2('0xc'),auth[_0x6ce2('0x5')](),controller[_0x6ce2('0x1d')]);router[_0x6ce2('0x1c')](_0x6ce2('0x18'),auth['isAuthenticated'](),controller[_0x6ce2('0x1e')]);module[_0x6ce2('0x1f')]=router;
\ No newline at end of file
+var _0xf352=['express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','send','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf352,0x71));var _0x2f35=function(_0x1bb2a3,_0x487635){_0x1bb2a3=_0x1bb2a3-0x0;var _0x5d35d7=_0xf352[_0x1bb2a3];return _0x5d35d7;};'use strict';var multer=require(_0x2f35('0x0'));var util=require(_0x2f35('0x1'));var path=require(_0x2f35('0x2'));var timeout=require(_0x2f35('0x3'));var express=require(_0x2f35('0x4'));var router=express[_0x2f35('0x5')]();var auth=require(_0x2f35('0x6'));var interaction=require(_0x2f35('0x7'));var config=require('../../config/environment');var controller=require(_0x2f35('0x8'));router[_0x2f35('0x9')]('/',auth['isAuthenticated'](),controller[_0x2f35('0xa')]);router[_0x2f35('0x9')](_0x2f35('0xb'),auth[_0x2f35('0xc')](),controller[_0x2f35('0xd')]);router[_0x2f35('0x9')](_0x2f35('0xe'),auth[_0x2f35('0xc')](),controller[_0x2f35('0xf')]);router[_0x2f35('0x9')]('/:id/dispositions',auth[_0x2f35('0xc')](),controller['getDispositions']);router[_0x2f35('0x9')](_0x2f35('0x10'),auth[_0x2f35('0xc')](),controller[_0x2f35('0x11')]);router[_0x2f35('0x9')](_0x2f35('0x12'),auth[_0x2f35('0xc')](),controller[_0x2f35('0x13')]);router[_0x2f35('0x9')](_0x2f35('0x14'),auth['isAuthenticated'](),controller[_0x2f35('0x15')]);router[_0x2f35('0x9')](_0x2f35('0x16'),auth[_0x2f35('0xc')](),controller[_0x2f35('0x17')]);router[_0x2f35('0x18')]('/',auth[_0x2f35('0xc')](),controller['create']);router['post']('/:id/dispositions',auth[_0x2f35('0xc')](),controller[_0x2f35('0x19')]);router['post'](_0x2f35('0x10'),auth[_0x2f35('0xc')](),controller[_0x2f35('0x1a')]);router[_0x2f35('0x18')](_0x2f35('0x1b'),controller[_0x2f35('0x1c')]);router['post'](_0x2f35('0x12'),auth[_0x2f35('0xc')](),controller[_0x2f35('0x1d')]);router[_0x2f35('0x18')]('/:id/users',auth[_0x2f35('0xc')](),controller[_0x2f35('0x1e')]);router[_0x2f35('0x18')]('/:id/send',auth[_0x2f35('0xc')](),controller[_0x2f35('0x1f')]);router[_0x2f35('0x20')](_0x2f35('0xe'),auth['isAuthenticated'](),controller[_0x2f35('0x21')]);router[_0x2f35('0x22')](_0x2f35('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x2f35('0x22')]('/:id/dispositions',auth[_0x2f35('0xc')](),controller[_0x2f35('0x23')]);router['delete'](_0x2f35('0x10'),auth[_0x2f35('0xc')](),controller[_0x2f35('0x24')]);router[_0x2f35('0x22')](_0x2f35('0x16'),auth[_0x2f35('0xc')](),controller[_0x2f35('0x25')]);module[_0x2f35('0x26')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js
index aa96d4f..39551ed 100644
--- a/server/api/openchannelAccount/openchannelAccount.attributes.js
+++ b/server/api/openchannelAccount/openchannelAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfedd=['mandatoryDisposition','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x394862,_0x17c8cf){var _0x46ec78=function(_0x2e1d78){while(--_0x2e1d78){_0x394862['push'](_0x394862['shift']());}};_0x46ec78(++_0x17c8cf);}(_0xfedd,0x160));var _0xdfed=function(_0x69dc6b,_0x37c643){_0x69dc6b=_0x69dc6b-0x0;var _0xa89e64=_0xfedd[_0x69dc6b];return _0xa89e64;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xdfed('0x0'));module[_0xdfed('0x1')]={'name':{'type':Sequelize[_0xdfed('0x2')],'unique':_0xdfed('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xdfed('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xdfed('0x4')]();}},'replyUri':{'type':Sequelize[_0xdfed('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xdfed('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xdfed('0x5')],'defaultValue':function(){return _0xdfed('0x6');}},'notificationSound':{'type':Sequelize[_0xdfed('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdfed('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xdfed('0x2')]},'queueTransfer':{'type':Sequelize[_0xdfed('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdfed('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdfed('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xdfed('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xdfed('0x7')],'defaultValue':![],'comment':_0xdfed('0xa'),'set':function(_0xcd7c39){if(!_0xcd7c39)this[_0xdfed('0xb')]('mandatoryDispositionPauseId',null);this[_0xdfed('0xb')](_0xdfed('0xc'),_0xcd7c39);}}};
\ No newline at end of file
+var _0x045f=['generate','TEXT','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring','STRING','name'];(function(_0xde10aa,_0xfe01f1){var _0x311377=function(_0x26d47c){while(--_0x26d47c){_0xde10aa['push'](_0xde10aa['shift']());}};_0x311377(++_0xfe01f1);}(_0x045f,0xce));var _0xf045=function(_0x245d40,_0x455ece){_0x245d40=_0x245d40-0x0;var _0x245534=_0x045f[_0x245d40];return _0x245534;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf045('0x0'));module['exports']={'name':{'type':Sequelize[_0xf045('0x1')],'unique':_0xf045('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf045('0x1')],'defaultValue':function(){return rs[_0xf045('0x3')]();}},'replyUri':{'type':Sequelize[_0xf045('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf045('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf045('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf045('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf045('0x1')]},'queueTransfer':{'type':Sequelize[_0xf045('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf045('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf045('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf045('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xf045('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf045('0x8'),'set':function(_0x16a3bd){if(!_0x16a3bd)this[_0xf045('0x9')](_0xf045('0xa'),null);this[_0xf045('0x9')]('mandatoryDisposition',_0x16a3bd);}}};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js
index e7e28b6..b73eabd 100644
--- a/server/api/openchannelAccount/openchannelAccount.controller.js
+++ b/server/api/openchannelAccount/openchannelAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x83ac=['stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','apply','reject','update','destroy','get','OpenchannelAccounts','sendStatus','stack','name','send','index','mandatoryDispositionPause','OpenchannelAccount','model','keys','query','intersection','fields','attributes','nolimit','sort','filters','filter','where','merge','type','key','VIRTUAL','field','options','findAll','show','Pause','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','order','pick','OpenchannelAccountId','map','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','hasOwnProperty','include','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','isNil','from','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','account','list','applications','orderBy','priority','defaults','ListId','contact','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','getApplications','getInteractions','includeAll','Contact','fullname','internal','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out','OpenchannelMessage','Messages','dataValues','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2cd863,_0x434fcf){var _0x3ad0b3=function(_0x2fd4e2){while(--_0x2fd4e2){_0x2cd863['push'](_0x2cd863['shift']());}};_0x3ad0b3(++_0x434fcf);}(_0x83ac,0x15d));var _0xc83a=function(_0x586184,_0x14ddff){_0x586184=_0x586184-0x0;var _0x40cda7=_0x83ac[_0x586184];return _0x40cda7;};'use strict';var pdf=require(_0xc83a('0x0'));var emlformat=require(_0xc83a('0x1'));var rimraf=require(_0xc83a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc83a('0x3'));var moment=require(_0xc83a('0x4'));var BPromise=require(_0xc83a('0x5'));var Mustache=require(_0xc83a('0x6'));var util=require(_0xc83a('0x7'));var path=require(_0xc83a('0x8'));var sox=require('sox');var csv=require(_0xc83a('0x9'));var ejs=require(_0xc83a('0xa'));var fs=require('fs');var _=require(_0xc83a('0xb'));var squel=require(_0xc83a('0xc'));var crypto=require(_0xc83a('0xd'));var jsforce=require(_0xc83a('0xe'));var deskjs=require(_0xc83a('0xf'));var toCsv=require(_0xc83a('0x9'));var querystring=require(_0xc83a('0x10'));var Papa=require('papaparse');var Redis=require(_0xc83a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc83a('0x12'));var hardwareService=require(_0xc83a('0x13'));var logger=require(_0xc83a('0x14'))(_0xc83a('0x15'));var utils=require(_0xc83a('0x16'));var config=require('../../config/environment');var db=require(_0xc83a('0x17'))['db'];config[_0xc83a('0x18')]=_['defaults'](config[_0xc83a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc83a('0x19'))(new Redis(config[_0xc83a('0x18')]));require(_0xc83a('0x1a'))[_0xc83a('0x1b')](socket);var jayson=require(_0xc83a('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xc83a('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x3783f3,_0x2ee044,_0x52ae67){if(_0x52ae67){var _0x10f1dd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x10f1dd[_0xc83a('0x1e')](_0x2ee044)){return _0x3783f3;}else{throw new Error(_0xc83a('0x1f'));}}else{return _0x3783f3;}}function respondWithRpcPromise(_0x9d030e,_0x50f0c8,_0x5829ab,_0xdbb6fd){return new BPromise(function(_0x45dbe4,_0x5a8282){var _0x4b7593=_0xdbb6fd||client;return _0x4b7593[_0xc83a('0x20')](_0x9d030e,_0x5829ab)[_0xc83a('0x21')](function(_0x52c99d){logger[_0xc83a('0x22')](_0xc83a('0x23'),_0x50f0c8,_0xc83a('0x24'));logger[_0xc83a('0x25')](_0xc83a('0x26'),_0x50f0c8,_0xc83a('0x24'),JSON[_0xc83a('0x27')](_0x52c99d));if(_0x52c99d[_0xc83a('0x28')]){if(_0x52c99d[_0xc83a('0x28')][_0xc83a('0x29')]===0x1f4){logger[_0xc83a('0x28')](_0xc83a('0x23'),_0x50f0c8,_0x52c99d['error'][_0xc83a('0x2a')]);return _0x5a8282(_0x52c99d['error'][_0xc83a('0x2a')]);}logger[_0xc83a('0x28')](_0xc83a('0x23'),_0x50f0c8,_0x52c99d[_0xc83a('0x28')]['message']);return _0x45dbe4(_0x52c99d[_0xc83a('0x28')][_0xc83a('0x2a')]);}else{logger[_0xc83a('0x22')](_0xc83a('0x23'),_0x50f0c8,'request\x20sent');_0x45dbe4(_0x52c99d[_0xc83a('0x2b')][_0xc83a('0x2a')]);}})[_0xc83a('0x2c')](function(_0x90d88c){logger[_0xc83a('0x28')](_0xc83a('0x23'),_0x50f0c8,_0x90d88c);_0x5a8282(_0x90d88c);});});}function respondWithStatusCode(_0x2ce281,_0x2ac69e){_0x2ac69e=_0x2ac69e||0xcc;return function(_0x2456a7){if(_0x2456a7){return _0x2ce281['sendStatus'](_0x2ac69e);}return _0x2ce281[_0xc83a('0x2d')](_0x2ac69e)[_0xc83a('0x2e')]();};}function respondWithResult(_0x2ec299,_0x120781){_0x120781=_0x120781||0xc8;return function(_0x10df05){if(_0x10df05){return _0x2ec299[_0xc83a('0x2d')](_0x120781)[_0xc83a('0x2f')](_0x10df05);}};}function respondWithFilteredResult(_0x412e08,_0x42a062){return function(_0x83eaa5){if(_0x83eaa5){var _0xef7d0a=_0x83eaa5[_0xc83a('0x30')],_0x120186=_0x42a062[_0xc83a('0x31')],_0x293157=_0x42a062[_0xc83a('0x31')]+_0x42a062[_0xc83a('0x32')],_0x3938d4;if(_0x293157>=_0xef7d0a){_0x293157=_0xef7d0a;_0x3938d4=0xc8;}else{_0x3938d4=0xce;}_0x412e08[_0xc83a('0x2d')](_0x3938d4);return _0x412e08[_0xc83a('0x33')]('Content-Range',_0x120186+'-'+_0x293157+'/'+_0xef7d0a)[_0xc83a('0x2f')](_0x83eaa5);}return null;};}function patchUpdates(_0x6c05a3){return function(_0x47049d){try{jsonpatch[_0xc83a('0x34')](_0x47049d,_0x6c05a3,!![]);}catch(_0x39d1b0){return BPromise[_0xc83a('0x35')](_0x39d1b0);}return _0x47049d['save']();};}function saveUpdates(_0x451b3d,_0x4ba60a){return function(_0x1b9103){if(_0x1b9103){return _0x1b9103[_0xc83a('0x36')](_0x451b3d)[_0xc83a('0x21')](function(_0x60d6ab){return _0x60d6ab;});}return null;};}function removeEntity(_0xcbe612,_0x350e8b){return function(_0x17d007){if(_0x17d007){return _0x17d007[_0xc83a('0x37')]()[_0xc83a('0x21')](function(){var _0x4dc180=_0x17d007[_0xc83a('0x38')]({'plain':!![]});var _0x42df3c=_0xc83a('0x39');return db['UserProfileResource'][_0xc83a('0x37')]({'where':{'type':_0x42df3c,'resourceId':_0x4dc180['id']}})[_0xc83a('0x21')](function(){return _0x17d007;});})[_0xc83a('0x21')](function(){_0xcbe612[_0xc83a('0x2d')](0xcc)[_0xc83a('0x2e')]();});}};}function handleEntityNotFound(_0x1e8093,_0x238522){return function(_0x156f8e){if(!_0x156f8e){_0x1e8093[_0xc83a('0x3a')](0x194);}return _0x156f8e;};}function handleError(_0x11bb8b,_0xbf1805){_0xbf1805=_0xbf1805||0x1f4;return function(_0x3775e3){logger[_0xc83a('0x28')](_0x3775e3[_0xc83a('0x3b')]);if(_0x3775e3[_0xc83a('0x3c')]){delete _0x3775e3[_0xc83a('0x3c')];}_0x11bb8b[_0xc83a('0x2d')](_0xbf1805)[_0xc83a('0x3d')](_0x3775e3);};}exports[_0xc83a('0x3e')]=function(_0x23af0e,_0xb7219d){var _0x2f4d18={'include':[{'model':db['Pause'],'as':_0xc83a('0x3f')}]},_0x8447d2={},_0x1a708c={'count':0x0,'rows':[]};var _0x243ea1=db[_0xc83a('0x40')]['rawAttributes'];_0x8447d2[_0xc83a('0x41')]=_[_0xc83a('0x42')](_0x243ea1);_0x8447d2['query']=_[_0xc83a('0x42')](_0x23af0e[_0xc83a('0x43')]);_0x8447d2['filters']=_['intersection'](_0x8447d2['model'],_0x8447d2[_0xc83a('0x43')]);_0x2f4d18['attributes']=_[_0xc83a('0x44')](_0x8447d2['model'],qs[_0xc83a('0x45')](_0x23af0e[_0xc83a('0x43')][_0xc83a('0x45')]));_0x2f4d18[_0xc83a('0x46')]=_0x2f4d18[_0xc83a('0x46')]['length']?_0x2f4d18[_0xc83a('0x46')]:_0x8447d2[_0xc83a('0x41')];if(!_0x23af0e[_0xc83a('0x43')]['hasOwnProperty'](_0xc83a('0x47'))){_0x2f4d18[_0xc83a('0x32')]=qs[_0xc83a('0x32')](_0x23af0e[_0xc83a('0x43')][_0xc83a('0x32')]);_0x2f4d18['offset']=qs['offset'](_0x23af0e[_0xc83a('0x43')][_0xc83a('0x31')]);}_0x2f4d18['order']=qs[_0xc83a('0x48')](_0x23af0e[_0xc83a('0x43')][_0xc83a('0x48')]);_0x2f4d18['where']=qs['filters'](_['pick'](_0x23af0e[_0xc83a('0x43')],_0x8447d2[_0xc83a('0x49')]));if(_0x23af0e[_0xc83a('0x43')][_0xc83a('0x4a')]){_0x2f4d18[_0xc83a('0x4b')]=_[_0xc83a('0x4c')](_0x2f4d18['where'],{'$or':_['map'](_0x243ea1,function(_0x506e1a){if(_0x506e1a[_0xc83a('0x4d')][_0xc83a('0x4e')]!==_0xc83a('0x4f')){var _0x52e56b={};_0x52e56b[_0x506e1a[_0xc83a('0x50')]]={'$like':'%'+_0x23af0e[_0xc83a('0x43')][_0xc83a('0x4a')]+'%'};return _0x52e56b;}})});}_0x2f4d18=_[_0xc83a('0x4c')]({},_0x2f4d18,_0x23af0e[_0xc83a('0x51')]);var _0xcd05ed={'where':_0x2f4d18[_0xc83a('0x4b')]};return db[_0xc83a('0x40')][_0xc83a('0x30')](_0xcd05ed)[_0xc83a('0x21')](function(_0x19bbe9){_0x1a708c[_0xc83a('0x30')]=_0x19bbe9;if(_0x23af0e[_0xc83a('0x43')]['includeAll']){_0x2f4d18['include']=[{'all':!![]}];}return db[_0xc83a('0x40')][_0xc83a('0x52')](_0x2f4d18);})[_0xc83a('0x21')](function(_0x31d810){_0x1a708c['rows']=_0x31d810;return _0x1a708c;})[_0xc83a('0x21')](respondWithFilteredResult(_0xb7219d,_0x2f4d18))[_0xc83a('0x2c')](handleError(_0xb7219d,null));};exports[_0xc83a('0x53')]=function(_0x2124d0,_0x4a7052){var _0x2e082d={'raw':![],'where':{'id':_0x2124d0['params']['id']},'include':[{'model':db[_0xc83a('0x54')],'as':_0xc83a('0x3f')}]},_0x554aba={};_0x554aba['model']=_[_0xc83a('0x42')](db['OpenchannelAccount'][_0xc83a('0x55')]);_0x554aba['query']=_[_0xc83a('0x42')](_0x2124d0[_0xc83a('0x43')]);_0x554aba[_0xc83a('0x49')]=_[_0xc83a('0x44')](_0x554aba[_0xc83a('0x41')],_0x554aba[_0xc83a('0x43')]);_0x2e082d['attributes']=_[_0xc83a('0x44')](_0x554aba[_0xc83a('0x41')],qs[_0xc83a('0x45')](_0x2124d0[_0xc83a('0x43')][_0xc83a('0x45')]));_0x2e082d[_0xc83a('0x46')]=_0x2e082d['attributes'][_0xc83a('0x56')]?_0x2e082d['attributes']:_0x554aba[_0xc83a('0x41')];if(_0x2124d0['query']['includeAll']){_0x2e082d['include']=[{'all':!![]}];}_0x2e082d=_[_0xc83a('0x4c')]({},_0x2e082d,_0x2124d0[_0xc83a('0x51')]);return db['OpenchannelAccount']['find'](_0x2e082d)[_0xc83a('0x21')](handleEntityNotFound(_0x4a7052,null))[_0xc83a('0x21')](respondWithResult(_0x4a7052,null))['catch'](handleError(_0x4a7052,null));};exports['create']=function(_0x4809be,_0x50dde0){return db[_0xc83a('0x40')][_0xc83a('0x57')](_0x4809be[_0xc83a('0x58')],{})[_0xc83a('0x21')](function(_0x2bb80b){var _0x510376=_0x4809be[_0xc83a('0x59')][_0xc83a('0x38')]({'plain':!![]});if(!_0x510376)throw new Error(_0xc83a('0x5a'));if(_0x510376['role']==='user'){var _0x21f32b=_0x2bb80b['get']({'plain':!![]});var _0x29237e='OpenchannelAccounts';return db['UserProfileSection'][_0xc83a('0x5b')]({'where':{'name':_0x29237e,'userProfileId':_0x510376[_0xc83a('0x5c')]},'raw':!![]})[_0xc83a('0x21')](function(_0x41cc02){if(_0x41cc02&&_0x41cc02[_0xc83a('0x5d')]===0x0){return db[_0xc83a('0x5e')][_0xc83a('0x57')]({'name':_0x21f32b['name'],'resourceId':_0x21f32b['id'],'type':_0x41cc02['name'],'sectionId':_0x41cc02['id']},{})[_0xc83a('0x21')](function(){return _0x2bb80b;});}else{return _0x2bb80b;}})[_0xc83a('0x2c')](function(_0x3f793a){logger[_0xc83a('0x28')](_0xc83a('0x5f'),_0x3f793a);throw _0x3f793a;});}return _0x2bb80b;})['then'](respondWithResult(_0x50dde0,0xc9))[_0xc83a('0x2c')](handleError(_0x50dde0,null));};exports['update']=function(_0x2460c4,_0x130006){if(_0x2460c4[_0xc83a('0x58')]['id']){delete _0x2460c4[_0xc83a('0x58')]['id'];}return db['OpenchannelAccount'][_0xc83a('0x5b')]({'where':{'id':_0x2460c4[_0xc83a('0x60')]['id']},'include':[{'model':db[_0xc83a('0x54')],'as':_0xc83a('0x3f')}]})[_0xc83a('0x21')](handleEntityNotFound(_0x130006,null))[_0xc83a('0x21')](saveUpdates(_0x2460c4[_0xc83a('0x58')],null))[_0xc83a('0x21')](respondWithResult(_0x130006,null))['catch'](handleError(_0x130006,null));};exports[_0xc83a('0x37')]=function(_0x5a95e1,_0x608a25){return db[_0xc83a('0x40')][_0xc83a('0x5b')]({'where':{'id':_0x5a95e1[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x608a25,null))['then'](removeEntity(_0x608a25,null))[_0xc83a('0x2c')](handleError(_0x608a25,null));};exports[_0xc83a('0x61')]=function(_0x55523a,_0x2ca151){return db['OpenchannelAccount'][_0xc83a('0x61')]()[_0xc83a('0x21')](respondWithResult(_0x2ca151,null))[_0xc83a('0x2c')](handleError(_0x2ca151,null));};exports[_0xc83a('0x62')]=function(_0x599d5f,_0x45e659,_0x2d949b){if(_0x599d5f[_0xc83a('0x58')]['id']){delete _0x599d5f[_0xc83a('0x58')]['id'];}return db['OpenchannelAccount'][_0xc83a('0x5b')]({'where':{'id':_0x599d5f[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x45e659,null))[_0xc83a('0x21')](function(_0x10384e){if(_0x10384e){_0x599d5f[_0xc83a('0x58')][_0xc83a('0x63')]=_0x10384e['id'];return db[_0xc83a('0x64')][_0xc83a('0x57')](_0x599d5f[_0xc83a('0x58')]);}})[_0xc83a('0x21')](respondWithResult(_0x45e659,null))[_0xc83a('0x2c')](handleError(_0x45e659,null));};exports[_0xc83a('0x65')]=function(_0x43f50d,_0x3be9a7,_0x2f6a5c){var _0x288d52={'raw':![],'where':{}};var _0xd56fe1={};var _0x1eb8be={'count':0x0,'rows':[]};return db[_0xc83a('0x40')]['findOne']({'where':{'id':_0x43f50d[_0xc83a('0x60')]['id']}})['then'](handleEntityNotFound(_0x3be9a7,null))[_0xc83a('0x21')](function(_0x4ca532){if(_0x4ca532){_0xd56fe1['model']=_[_0xc83a('0x42')](db[_0xc83a('0x64')][_0xc83a('0x55')]);_0xd56fe1['query']=_['keys'](_0x43f50d['query']);_0xd56fe1[_0xc83a('0x49')]=_[_0xc83a('0x44')](_0xd56fe1['model'],_0xd56fe1['query']);_0x288d52[_0xc83a('0x46')]=_[_0xc83a('0x44')](_0xd56fe1['model'],qs[_0xc83a('0x45')](_0x43f50d['query']['fields']));_0x288d52[_0xc83a('0x46')]=_0x288d52[_0xc83a('0x46')][_0xc83a('0x56')]?_0x288d52[_0xc83a('0x46')]:_0xd56fe1['model'];if(!_0x43f50d[_0xc83a('0x43')]['hasOwnProperty'](_0xc83a('0x47'))){_0x288d52[_0xc83a('0x32')]=qs[_0xc83a('0x32')](_0x43f50d[_0xc83a('0x43')][_0xc83a('0x32')]);_0x288d52['offset']=qs[_0xc83a('0x31')](_0x43f50d[_0xc83a('0x43')][_0xc83a('0x31')]);}_0x288d52[_0xc83a('0x66')]=qs['sort'](_0x43f50d[_0xc83a('0x43')][_0xc83a('0x48')]);_0x288d52[_0xc83a('0x4b')]=qs[_0xc83a('0x49')](_[_0xc83a('0x67')](_0x43f50d[_0xc83a('0x43')],_0xd56fe1[_0xc83a('0x49')]));_0x288d52[_0xc83a('0x4b')][_0xc83a('0x68')]=_0x4ca532['id'];if(_0x43f50d['query'][_0xc83a('0x4a')]){_0x288d52[_0xc83a('0x4b')]=_[_0xc83a('0x4c')](_0x288d52[_0xc83a('0x4b')],{'$or':_[_0xc83a('0x69')](_0x288d52[_0xc83a('0x46')],function(_0x1631b7){var _0x5b3a67={};_0x5b3a67[_0x1631b7]={'$like':'%'+_0x43f50d[_0xc83a('0x43')][_0xc83a('0x4a')]+'%'};return _0x5b3a67;})});}_0x288d52=_['merge']({},_0x288d52,_0x43f50d[_0xc83a('0x51')]);return db[_0xc83a('0x64')][_0xc83a('0x30')]({'where':_0x288d52['where']})[_0xc83a('0x21')](function(_0x3f71ac){_0x1eb8be[_0xc83a('0x30')]=_0x3f71ac;if(_0x43f50d[_0xc83a('0x43')]['includeAll']){_0x288d52['include']=[{'all':!![]}];}return db[_0xc83a('0x64')]['findAll'](_0x288d52);})[_0xc83a('0x21')](function(_0x2714f5){_0x1eb8be[_0xc83a('0x6a')]=_0x2714f5;return _0x1eb8be;});}})[_0xc83a('0x21')](respondWithFilteredResult(_0x3be9a7,_0x288d52))['catch'](handleError(_0x3be9a7,null));};exports[_0xc83a('0x6b')]=function(_0xf64b16,_0x406a29,_0x4f0276){return db[_0xc83a('0x40')]['find']({'where':{'id':_0xf64b16[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x406a29,null))[_0xc83a('0x21')](function(_0x48926e){if(_0x48926e){return _0x48926e[_0xc83a('0x6b')](_0xf64b16['query'][_0xc83a('0x6c')]);}})['then'](respondWithStatusCode(_0x406a29,null))['catch'](handleError(_0x406a29,null));};exports[_0xc83a('0x6d')]=function(_0x44ee4c,_0x2238e5,_0x343933){if(_0x44ee4c[_0xc83a('0x58')]['id']){delete _0x44ee4c[_0xc83a('0x58')]['id'];}return db[_0xc83a('0x40')][_0xc83a('0x5b')]({'where':{'id':_0x44ee4c[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x2238e5,null))['then'](function(_0x10319a){if(_0x10319a){_0x44ee4c[_0xc83a('0x58')][_0xc83a('0x68')]=_0x10319a['id'];return db[_0xc83a('0x6e')][_0xc83a('0x57')](_0x44ee4c[_0xc83a('0x58')]);}})[_0xc83a('0x21')](respondWithResult(_0x2238e5,null))[_0xc83a('0x2c')](handleError(_0x2238e5,null));};exports[_0xc83a('0x6f')]=function(_0x5cae04,_0x2b2845,_0x46b8dc){var _0x496bd9={'raw':![],'where':{}};var _0x4d47ac={};var _0x10b31d={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xc83a('0x70')]({'where':{'id':_0x5cae04[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x2b2845,null))['then'](function(_0x4f10c4){if(_0x4f10c4){_0x4d47ac[_0xc83a('0x41')]=_[_0xc83a('0x42')](db[_0xc83a('0x6e')][_0xc83a('0x55')]);_0x4d47ac[_0xc83a('0x43')]=_[_0xc83a('0x42')](_0x5cae04[_0xc83a('0x43')]);_0x4d47ac[_0xc83a('0x49')]=_[_0xc83a('0x44')](_0x4d47ac[_0xc83a('0x41')],_0x4d47ac[_0xc83a('0x43')]);_0x496bd9['attributes']=_['intersection'](_0x4d47ac[_0xc83a('0x41')],qs[_0xc83a('0x45')](_0x5cae04[_0xc83a('0x43')][_0xc83a('0x45')]));_0x496bd9[_0xc83a('0x46')]=_0x496bd9[_0xc83a('0x46')][_0xc83a('0x56')]?_0x496bd9[_0xc83a('0x46')]:_0x4d47ac['model'];if(!_0x5cae04['query'][_0xc83a('0x71')](_0xc83a('0x47'))){_0x496bd9[_0xc83a('0x32')]=qs[_0xc83a('0x32')](_0x5cae04[_0xc83a('0x43')][_0xc83a('0x32')]);_0x496bd9[_0xc83a('0x31')]=qs[_0xc83a('0x31')](_0x5cae04['query'][_0xc83a('0x31')]);}_0x496bd9['order']=qs[_0xc83a('0x48')](_0x5cae04[_0xc83a('0x43')][_0xc83a('0x48')]);_0x496bd9[_0xc83a('0x4b')]=qs[_0xc83a('0x49')](_[_0xc83a('0x67')](_0x5cae04[_0xc83a('0x43')],_0x4d47ac[_0xc83a('0x49')]));_0x496bd9[_0xc83a('0x4b')][_0xc83a('0x68')]=_0x4f10c4['id'];if(_0x5cae04[_0xc83a('0x43')][_0xc83a('0x4a')]){_0x496bd9[_0xc83a('0x4b')]=_[_0xc83a('0x4c')](_0x496bd9[_0xc83a('0x4b')],{'$or':_[_0xc83a('0x69')](_0x496bd9['attributes'],function(_0x8d2926){var _0x4afad0={};_0x4afad0[_0x8d2926]={'$like':'%'+_0x5cae04[_0xc83a('0x43')][_0xc83a('0x4a')]+'%'};return _0x4afad0;})});}_0x496bd9=_[_0xc83a('0x4c')]({},_0x496bd9,_0x5cae04[_0xc83a('0x51')]);return db['CannedAnswer']['count']({'where':_0x496bd9[_0xc83a('0x4b')]})[_0xc83a('0x21')](function(_0x2429fe){_0x10b31d[_0xc83a('0x30')]=_0x2429fe;if(_0x5cae04[_0xc83a('0x43')]['includeAll']){_0x496bd9[_0xc83a('0x72')]=[{'all':!![]}];}return db[_0xc83a('0x6e')][_0xc83a('0x52')](_0x496bd9);})[_0xc83a('0x21')](function(_0x17281d){_0x10b31d[_0xc83a('0x6a')]=_0x17281d;return _0x10b31d;});}})[_0xc83a('0x21')](respondWithFilteredResult(_0x2b2845,_0x496bd9))['catch'](handleError(_0x2b2845,null));};exports[_0xc83a('0x73')]=function(_0x3ab1fa,_0x4c91da,_0x212f69){return db['OpenchannelAccount'][_0xc83a('0x5b')]({'where':{'id':_0x3ab1fa[_0xc83a('0x60')]['id']}})['then'](handleEntityNotFound(_0x4c91da,null))[_0xc83a('0x21')](function(_0x25d6b6){if(_0x25d6b6){return _0x25d6b6[_0xc83a('0x73')](_0x3ab1fa['query'][_0xc83a('0x6c')]);}})['then'](respondWithStatusCode(_0x4c91da,null))[_0xc83a('0x2c')](handleError(_0x4c91da,null));};exports[_0xc83a('0x74')]=function(_0x260d24,_0x20f89c,_0x324eec){var _0x1d1e43={'body':_0x260d24[_0xc83a('0x58')],'channel':_0xc83a('0x75')};var _0x21a735=[];var _0x27cf11=[];var _0x2e5cbf={};var _0x340893=![];return db[_0xc83a('0x76')][_0xc83a('0x61')]()['then'](function(_0x38a3e0){if(!_0x38a3e0){throw new db[(_0xc83a('0x77'))][(_0xc83a('0x78'))](_0xc83a('0x79'));}_0x21a735=_['difference'](_[_0xc83a('0x42')](_0x38a3e0),[_0xc83a('0x7a'),'updatedAt']);_0x27cf11=_[_0xc83a('0x7b')](_[_0xc83a('0x42')](_0x38a3e0),['createdAt',_0xc83a('0x7c'),_0xc83a('0x7d'),'ListId']);if(_0x260d24['body']['id']){delete _0x260d24[_0xc83a('0x58')]['id'];}if(_[_0xc83a('0x7e')](_0x260d24[_0xc83a('0x58')][_0xc83a('0x7f')])){throw new db[(_0xc83a('0x77'))][(_0xc83a('0x78'))]('from\x20is\x20mandatory');}if(_[_0xc83a('0x7e')](_0x260d24['body']['body'])||_0x260d24['body'][_0xc83a('0x58')]===''){throw new db[(_0xc83a('0x77'))][(_0xc83a('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc83a('0x7e')](_0x260d24[_0xc83a('0x58')][_0xc83a('0x80')])){throw new db[(_0xc83a('0x77'))][(_0xc83a('0x78'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x27cf11);}if(!_[_0xc83a('0x81')](_0x27cf11,_0x260d24[_0xc83a('0x58')]['mapKey'])){throw new db['Sequelize'][(_0xc83a('0x78'))](_0xc83a('0x82')+_0x27cf11);}_0x2e5cbf[_0x260d24[_0xc83a('0x58')][_0xc83a('0x80')]]=_0x260d24[_0xc83a('0x58')]['from'];})[_0xc83a('0x21')](function(){return db['OpenchannelAccount'][_0xc83a('0x5b')]({'where':{'id':_0x260d24[_0xc83a('0x60')]['id']},'include':[{'model':db[_0xc83a('0x83')],'as':_0xc83a('0x84'),'include':[{'model':db[_0xc83a('0x76')],'as':_0xc83a('0x85'),'where':_0x2e5cbf,'limit':0x1,'order':[[_0xc83a('0x7c'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xc83a('0x86')}]});})[_0xc83a('0x21')](handleEntityNotFound(_0x20f89c,null))[_0xc83a('0x21')](function(_0xcec2f6){if(_0xcec2f6&&_0xcec2f6[_0xc83a('0x84')]){_0x1d1e43[_0xc83a('0x87')]=_0xcec2f6;_0x1d1e43['applications']=_0xcec2f6[_0xc83a('0x86')];_0x1d1e43[_0xc83a('0x88')]=_0xcec2f6['List'];_0x1d1e43[_0xc83a('0x89')]=_[_0xc83a('0x8a')](_0x1d1e43[_0xc83a('0x89')],[_0xc83a('0x8b')],['asc']);if(_0x1d1e43[_0xc83a('0x87')]['Applications']){delete _0x1d1e43[_0xc83a('0x87')]['Applications'];}if(_0x1d1e43['account'][_0xc83a('0x84')]&&_0x1d1e43[_0xc83a('0x87')][_0xc83a('0x84')]['Contacts']['length']){return _0x1d1e43[_0xc83a('0x87')][_0xc83a('0x84')][_0xc83a('0x85')][0x0];}var _0x2c87ea=_[_0xc83a('0x8c')](_0x260d24[_0xc83a('0x58')],{'firstName':_0x260d24['body'][_0xc83a('0x7f')],'ListId':_0xcec2f6[_0xc83a('0x8d')]});_0x2c87ea[_0x260d24[_0xc83a('0x58')]['mapKey']]=_0x260d24['body'][_0xc83a('0x7f')];return db[_0xc83a('0x76')][_0xc83a('0x57')](_0x2c87ea,{'fields':_0x21a735,'raw':!![]});}})[_0xc83a('0x21')](handleEntityNotFound(_0x20f89c,null))[_0xc83a('0x21')](function(_0x39e050){_0x1d1e43[_0xc83a('0x8e')]=_0x39e050;if(_0x39e050){var _0x2b564d={'ContactId':_0x39e050['id'],'OpenchannelAccountId':_0x260d24[_0xc83a('0x60')]['id'],'from':(_0x39e050['firstName']||'')+'\x20'+(_0x39e050['lastName']||'')};var _0xf8a504={'OpenchannelAccountId':_0x260d24[_0xc83a('0x60')]['id'],'closed':![]};if(_0x260d24['body'][_0xc83a('0x8f')]){_0xf8a504[_0xc83a('0x8f')]=_0x260d24[_0xc83a('0x58')][_0xc83a('0x8f')];return db[_0xc83a('0x90')][_0xc83a('0x5b')]({'where':_0xf8a504})[_0xc83a('0x21')](function(_0x19bffa){if(_0x19bffa){return[_0x19bffa,![]];}_0x2b564d[_0xc83a('0x8f')]=_0x260d24[_0xc83a('0x58')]['threadId'];_0x2b564d[_0xc83a('0x91')]=_0x260d24[_0xc83a('0x58')][_0xc83a('0x91')];return db['OpenchannelInteraction'][_0xc83a('0x57')](_0x2b564d)[_0xc83a('0x21')](function(_0x2948d0){return[_0x2948d0,!![]];});});}else{_0xf8a504[_0xc83a('0x8f')]=null;}_0xf8a504[_0xc83a('0x92')]=_0x39e050['id'];return db[_0xc83a('0x90')][_0xc83a('0x5b')]({'where':_0xf8a504})[_0xc83a('0x21')](function(_0x5baf33){if(_0x5baf33){return[_0x5baf33,![]];}return db[_0xc83a('0x90')][_0xc83a('0x57')](_0x2b564d)[_0xc83a('0x21')](function(_0xdd48f0){return[_0xdd48f0,!![]];});});}})[_0xc83a('0x93')](function(_0x2a34dc,_0x4d0064){if(_0x2a34dc){_0x340893=_0x4d0064;if(!_0x4d0064){var _0x503696={'from':(_0x1d1e43[_0xc83a('0x8e')][_0xc83a('0x94')]||'')+'\x20'+(_0x1d1e43[_0xc83a('0x8e')][_0xc83a('0x95')]||'')};if(_0x260d24['body'][_0xc83a('0x8f')]&&_0x260d24[_0xc83a('0x58')][_0xc83a('0x96')]&&_0x260d24['body'][_0xc83a('0x8f')]!=_0x260d24[_0xc83a('0x58')][_0xc83a('0x96')]){_0x503696[_0xc83a('0x8f')]=_0x260d24['body'][_0xc83a('0x96')];}return _0x2a34dc[_0xc83a('0x36')](_0x503696);}else{return _0x2a34dc;}}})['then'](function(_0x18ff67){_0x1d1e43[_0xc83a('0x97')]=_0x18ff67[_0xc83a('0x38')]({'plain':!![]});_0x1d1e43[_0xc83a('0x97')][_0xc83a('0x98')]=_0x340893;if(_0x1d1e43['interaction'][_0xc83a('0x98')]){if(_0x1d1e43[_0xc83a('0x87')][_0xc83a('0x99')]){_0x1d1e43['applications'][_0xc83a('0x9a')]({'id':0x0,'priority':_0x1d1e43['applications'][_0xc83a('0x56')]+0x1,'app':_0xc83a('0x9b'),'appdata':_0xc83a('0x9c'),'interval':_0xc83a('0x9d')});}}return db['OpenchannelMessage'][_0xc83a('0x57')]({'body':_0x260d24[_0xc83a('0x58')][_0xc83a('0x58')],'OpenchannelAccountId':_0x260d24['params']['id'],'OpenchannelInteractionId':_0x18ff67['id'],'direction':'in','ContactId':_0x1d1e43['contact']['id'],'AttachmentId':_0x260d24[_0xc83a('0x58')]['AttachmentId']});})['then'](function(_0x1585e1){_0x1d1e43[_0xc83a('0x2a')]=_0x1585e1;if(_0x1d1e43[_0xc83a('0x97')][_0xc83a('0x9e')]){return db[_0xc83a('0x9f')][_0xc83a('0x5b')]({'attributes':['id',_0xc83a('0x3c')],'where':{'id':_0x1d1e43['interaction'][_0xc83a('0x9e')]}})['then'](function(_0x227038){if(_0x227038){_0x1d1e43[_0xc83a('0x89')][_0xc83a('0xa0')]({'id':0x0,'priority':0x0,'app':_0xc83a('0xa1'),'appdata':_0x227038[_0xc83a('0x3c')]+','+(_0x1d1e43[_0xc83a('0x87')][_0xc83a('0xa2')]||0xa),'interval':'*,*,*,*'});_0x1d1e43[_0xc83a('0xa3')]=![];}return respondWithRpcPromise(_0xc83a('0xa4'),_0xc83a('0xa5'),_0x1d1e43);});}return respondWithRpcPromise(_0xc83a('0xa4'),'startRouting',_0x1d1e43);})[_0xc83a('0x21')](function(_0x51afa3){respondWithRpcPromise(_0xc83a('0xa6'),_0xc83a('0xa6'),{'event':'notify','message':_0x51afa3},client9002);return _0x51afa3;})[_0xc83a('0x21')](respondWithResult(_0x20f89c,null))[_0xc83a('0x2c')](handleError(_0x20f89c,null));};exports[_0xc83a('0xa7')]=function(_0x8d00c8,_0x127b1f,_0x4f0a4b){return db[_0xc83a('0x40')][_0xc83a('0x70')]({'where':{'id':_0x8d00c8[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x127b1f,null))[_0xc83a('0x21')](function(_0x211595){if(_0x211595){return db[_0xc83a('0xa8')][_0xc83a('0xa9')](function(_0x2eb9b0){return db[_0xc83a('0xaa')][_0xc83a('0x37')]({'where':{'OpenchannelAccountId':_0x8d00c8[_0xc83a('0x60')]['id']},'transaction':_0x2eb9b0})[_0xc83a('0x21')](function(_0x342443){var _0x44077c=_[_0xc83a('0x69')](_0x8d00c8[_0xc83a('0x58')],function(_0x6973b8){_0x6973b8[_0xc83a('0x68')]=_0x8d00c8[_0xc83a('0x60')]['id'];return _0x6973b8;});return db[_0xc83a('0xaa')][_0xc83a('0xab')](_0x44077c,{'transaction':_0x2eb9b0});});})[_0xc83a('0x21')](function(){return db[_0xc83a('0xaa')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x8d00c8[_0xc83a('0x60')]['id']},'order':_0xc83a('0x8b')});});}})['then'](respondWithResult(_0x127b1f,null))['catch'](handleError(_0x127b1f,null));};exports[_0xc83a('0xac')]=function(_0x2e39e0,_0x14cd13,_0x427613){var _0x30fe62={};var _0x1ac713={};var _0x53d5c9;var _0x26a9ed;return db['OpenchannelAccount'][_0xc83a('0x70')]({'where':{'id':_0x2e39e0[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x14cd13,null))[_0xc83a('0x21')](function(_0x13a30a){if(_0x13a30a){_0x53d5c9=_0x13a30a;_0x1ac713['model']=_[_0xc83a('0x42')](db[_0xc83a('0xaa')][_0xc83a('0x55')]);_0x1ac713[_0xc83a('0x43')]=_[_0xc83a('0x42')](_0x2e39e0['query']);_0x1ac713['filters']=_['intersection'](_0x1ac713[_0xc83a('0x41')],_0x1ac713[_0xc83a('0x43')]);_0x30fe62[_0xc83a('0x46')]=_[_0xc83a('0x44')](_0x1ac713[_0xc83a('0x41')],qs[_0xc83a('0x45')](_0x2e39e0[_0xc83a('0x43')][_0xc83a('0x45')]));_0x30fe62[_0xc83a('0x46')]=_0x30fe62[_0xc83a('0x46')][_0xc83a('0x56')]?_0x30fe62[_0xc83a('0x46')]:_0x1ac713['model'];_0x30fe62[_0xc83a('0x66')]=qs[_0xc83a('0x48')](_0x2e39e0[_0xc83a('0x43')][_0xc83a('0x48')]);_0x30fe62[_0xc83a('0x4b')]=qs[_0xc83a('0x49')](_[_0xc83a('0x67')](_0x2e39e0[_0xc83a('0x43')],_0x1ac713[_0xc83a('0x49')]));if(_0x2e39e0[_0xc83a('0x43')][_0xc83a('0x4a')]){_0x30fe62[_0xc83a('0x4b')]=_[_0xc83a('0x4c')](_0x30fe62['where'],{'$or':_[_0xc83a('0x69')](_0x30fe62['attributes'],function(_0x260ee1){var _0x1ff753={};_0x1ff753[_0x260ee1]={'$like':'%'+_0x2e39e0['query'][_0xc83a('0x4a')]+'%'};return _0x1ff753;})});}_0x30fe62=_[_0xc83a('0x4c')]({},_0x30fe62,_0x2e39e0[_0xc83a('0x51')]);return _0x53d5c9[_0xc83a('0xac')](_0x30fe62);}})[_0xc83a('0x21')](function(_0x4ea468){if(_0x4ea468){_0x26a9ed=_0x4ea468[_0xc83a('0x56')];if(!_0x2e39e0['query']['hasOwnProperty'](_0xc83a('0x47'))){_0x30fe62[_0xc83a('0x32')]=qs[_0xc83a('0x32')](_0x2e39e0[_0xc83a('0x43')][_0xc83a('0x32')]);_0x30fe62[_0xc83a('0x31')]=qs[_0xc83a('0x31')](_0x2e39e0[_0xc83a('0x43')][_0xc83a('0x31')]);}return _0x53d5c9[_0xc83a('0xac')](_0x30fe62);}})[_0xc83a('0x21')](function(_0x5008bc){if(_0x5008bc){return _0x5008bc?{'count':_0x26a9ed,'rows':_0x5008bc}:null;}})[_0xc83a('0x21')](respondWithResult(_0x14cd13,null))[_0xc83a('0x2c')](handleError(_0x14cd13,null));};exports[_0xc83a('0xad')]=function(_0x1e8be0,_0xd96b89,_0x3286bc){var _0x5cba63={'raw':![],'where':{}};var _0xb76163={};var _0x21fdc3={'count':0x0,'rows':[]};return db[_0xc83a('0x40')][_0xc83a('0x70')]({'where':{'id':_0x1e8be0['params']['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0xd96b89,null))[_0xc83a('0x21')](function(_0x47b48a){if(_0x47b48a){_0xb76163[_0xc83a('0x41')]=_[_0xc83a('0x42')](db[_0xc83a('0x90')][_0xc83a('0x55')]);_0xb76163[_0xc83a('0x43')]=_[_0xc83a('0x42')](_0x1e8be0[_0xc83a('0x43')]);_0xb76163['filters']=_[_0xc83a('0x44')](_0xb76163[_0xc83a('0x41')],_0xb76163['query']);_0x5cba63[_0xc83a('0x46')]=_[_0xc83a('0x44')](_0xb76163[_0xc83a('0x41')],qs['fields'](_0x1e8be0[_0xc83a('0x43')]['fields']));_0x5cba63['attributes']=_0x5cba63[_0xc83a('0x46')][_0xc83a('0x56')]?_0x5cba63['attributes']:_0xb76163[_0xc83a('0x41')];if(!_0x1e8be0['query'][_0xc83a('0x71')](_0xc83a('0x47'))){_0x5cba63[_0xc83a('0x32')]=qs[_0xc83a('0x32')](_0x1e8be0[_0xc83a('0x43')][_0xc83a('0x32')]);_0x5cba63['offset']=qs['offset'](_0x1e8be0[_0xc83a('0x43')][_0xc83a('0x31')]);}_0x5cba63[_0xc83a('0x66')]=qs[_0xc83a('0x48')](_0x1e8be0[_0xc83a('0x43')][_0xc83a('0x48')]);_0x5cba63[_0xc83a('0x4b')]=qs[_0xc83a('0x49')](_[_0xc83a('0x67')](_0x1e8be0[_0xc83a('0x43')],_0xb76163[_0xc83a('0x49')]));_0x5cba63[_0xc83a('0x4b')][_0xc83a('0x68')]=_0x47b48a['id'];if(_0x1e8be0['query'][_0xc83a('0x4a')]){_0x5cba63[_0xc83a('0x4b')]=_[_0xc83a('0x4c')](_0x5cba63[_0xc83a('0x4b')],{'$or':_[_0xc83a('0x69')](_0x5cba63[_0xc83a('0x46')],function(_0x47b598){var _0x12a91c={};_0x12a91c[_0x47b598]={'$like':'%'+_0x1e8be0['query']['filter']+'%'};return _0x12a91c;})});}_0x5cba63=_[_0xc83a('0x4c')]({},_0x5cba63,_0x1e8be0['options']);return db[_0xc83a('0x90')]['count']({'where':_0x5cba63[_0xc83a('0x4b')]})['then'](function(_0x534e76){_0x21fdc3[_0xc83a('0x30')]=_0x534e76;if(_0x1e8be0[_0xc83a('0x43')][_0xc83a('0xae')]){_0x5cba63[_0xc83a('0x72')]=[{'model':db[_0xc83a('0x76')],'as':_0xc83a('0xaf'),'required':![]},{'model':db[_0xc83a('0x9f')],'as':'Owner','attributes':[_0xc83a('0x3c'),_0xc83a('0xb0'),_0xc83a('0xb1')],'required':![]},{'model':db['Tag'],'as':_0xc83a('0xb2'),'attributes':['id',_0xc83a('0x3c'),_0xc83a('0xb3')],'where':_0x1e8be0['query'][_0xc83a('0xb4')]?{'id':_0x1e8be0[_0xc83a('0x43')][_0xc83a('0xb4')]}:undefined,'required':_0x1e8be0['query'][_0xc83a('0xb4')]?!![]:![]}];}return db[_0xc83a('0x90')][_0xc83a('0x52')](_0x5cba63);})['then'](function(_0x1245b1){_0x21fdc3[_0xc83a('0x6a')]=_0x1245b1;return _0x21fdc3;});}})['then'](respondWithFilteredResult(_0xd96b89,_0x5cba63))[_0xc83a('0x2c')](handleError(_0xd96b89,null));};exports[_0xc83a('0xb5')]=function(_0x5874d6,_0x2fdda6,_0x5903fc){return db[_0xc83a('0x40')][_0xc83a('0x5b')]({'where':{'id':_0x5874d6[_0xc83a('0x60')]['id']}})['then'](handleEntityNotFound(_0x2fdda6,null))['then'](function(_0x58fb0e){if(_0x58fb0e){return _0x58fb0e[_0xc83a('0xb5')](_0x5874d6[_0xc83a('0x58')][_0xc83a('0x6c')],_[_0xc83a('0xb6')](_0x5874d6['body'],[_0xc83a('0x6c'),'id'])||{})[_0xc83a('0x93')](function(_0x1a63c8){for(var _0x40284e=0x0;_0x40284e<_0x5874d6['body'][_0xc83a('0x6c')][_0xc83a('0x56')];_0x40284e+=0x1){socket[_0xc83a('0xb7')]('userOpenchannelAccount:save',{'UserId':_0x5874d6[_0xc83a('0x58')]['ids'][_0x40284e],'OpenchannelAccountId':_0x5874d6[_0xc83a('0x60')]['id']});}return _0x1a63c8;});}})[_0xc83a('0x21')](respondWithResult(_0x2fdda6,null))[_0xc83a('0x2c')](handleError(_0x2fdda6,null));};exports[_0xc83a('0xb8')]=function(_0x2d5e8e,_0x598540,_0x517700){return db[_0xc83a('0x40')][_0xc83a('0x5b')]({'where':{'id':_0x2d5e8e[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x598540,null))[_0xc83a('0x21')](function(_0x1735b9){if(_0x1735b9){return _0x1735b9[_0xc83a('0xb8')](_0x2d5e8e[_0xc83a('0x43')][_0xc83a('0x6c')])[_0xc83a('0x21')](function(){if(_[_0xc83a('0xb9')](_0x2d5e8e[_0xc83a('0x43')][_0xc83a('0x6c')])){for(var _0x120594=0x0;_0x120594<_0x2d5e8e[_0xc83a('0x43')]['ids'][_0xc83a('0x56')];_0x120594+=0x1){socket[_0xc83a('0xb7')](_0xc83a('0xba'),{'UserId':Number(_0x2d5e8e[_0xc83a('0x43')][_0xc83a('0x6c')][_0x120594]),'OpenchannelAccountId':Number(_0x2d5e8e[_0xc83a('0x60')]['id'])});}}else{socket[_0xc83a('0xb7')](_0xc83a('0xba'),{'UserId':Number(_0x2d5e8e[_0xc83a('0x43')][_0xc83a('0x6c')]),'OpenchannelAccountId':Number(_0x2d5e8e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x598540,null))['catch'](handleError(_0x598540,null));};exports[_0xc83a('0xbb')]=function(_0xbe2876,_0x471adc,_0x4c81fa){var _0x51170e={};var _0x278237={};var _0x5609f6;var _0x355aab;return db['OpenchannelAccount'][_0xc83a('0x70')]({'where':{'id':_0xbe2876[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x471adc,null))['then'](function(_0x1419ae){if(_0x1419ae){_0x5609f6=_0x1419ae;_0x278237[_0xc83a('0x41')]=_[_0xc83a('0x42')](db[_0xc83a('0x9f')][_0xc83a('0x55')]);_0x278237[_0xc83a('0x43')]=_['keys'](_0xbe2876[_0xc83a('0x43')]);_0x278237[_0xc83a('0x49')]=_[_0xc83a('0x44')](_0x278237['model'],_0x278237[_0xc83a('0x43')]);_0x51170e[_0xc83a('0x46')]=_['intersection'](_0x278237[_0xc83a('0x41')],qs['fields'](_0xbe2876[_0xc83a('0x43')][_0xc83a('0x45')]));_0x51170e[_0xc83a('0x46')]=_0x51170e[_0xc83a('0x46')]['length']?_0x51170e['attributes']:_0x278237[_0xc83a('0x41')];_0x51170e[_0xc83a('0x66')]=qs[_0xc83a('0x48')](_0xbe2876[_0xc83a('0x43')]['sort']);_0x51170e[_0xc83a('0x4b')]=qs[_0xc83a('0x49')](_[_0xc83a('0x67')](_0xbe2876[_0xc83a('0x43')],_0x278237[_0xc83a('0x49')]));if(_0xbe2876[_0xc83a('0x43')][_0xc83a('0x4a')]){_0x51170e[_0xc83a('0x4b')]=_['merge'](_0x51170e[_0xc83a('0x4b')],{'$or':_[_0xc83a('0x69')](_0x51170e[_0xc83a('0x46')],function(_0x238dec){var _0x5b4bd6={};_0x5b4bd6[_0x238dec]={'$like':'%'+_0xbe2876['query'][_0xc83a('0x4a')]+'%'};return _0x5b4bd6;})});}_0x51170e=_[_0xc83a('0x4c')]({},_0x51170e,_0xbe2876['options']);return _0x5609f6[_0xc83a('0xbb')](_0x51170e);}})[_0xc83a('0x21')](function(_0x25d701){if(_0x25d701){_0x355aab=_0x25d701[_0xc83a('0x56')];if(!_0xbe2876[_0xc83a('0x43')][_0xc83a('0x71')](_0xc83a('0x47'))){_0x51170e[_0xc83a('0x32')]=qs['limit'](_0xbe2876[_0xc83a('0x43')][_0xc83a('0x32')]);_0x51170e[_0xc83a('0x31')]=qs['offset'](_0xbe2876['query']['offset']);}return _0x5609f6[_0xc83a('0xbb')](_0x51170e);}})[_0xc83a('0x21')](function(_0x58b7f0){if(_0x58b7f0){return _0x58b7f0?{'count':_0x355aab,'rows':_0x58b7f0}:null;}})['then'](respondWithResult(_0x471adc,null))['catch'](handleError(_0x471adc,null));};exports[_0xc83a('0x3d')]=function(_0x285095,_0x1a0380,_0x2d1f7d){var _0x6f3cdb,_0x28be87,_0x519137;if(_[_0xc83a('0x7e')](_0x285095[_0xc83a('0x58')]['body'])||_0x285095[_0xc83a('0x58')][_0xc83a('0x58')]===''){throw new db[(_0xc83a('0x77'))][(_0xc83a('0x78'))](_0xc83a('0xbc'));}if(_[_0xc83a('0x7e')](_0x285095[_0xc83a('0x58')]['to'])){}_0x6f3cdb=_0x285095[_0xc83a('0x58')]['to'];return db[_0xc83a('0x40')]['findOne']({'where':{'id':_0x285095[_0xc83a('0x60')]['id']}})['then'](handleEntityNotFound(_0x1a0380,null))[_0xc83a('0x21')](function(_0x28141b){if(_0x28141b){return db['OpenchannelAccount'][_0xc83a('0x5b')]({'where':{'id':_0x28141b['id']},'include':[{'model':db[_0xc83a('0x83')],'as':_0xc83a('0x84'),'include':[{'model':db['CmContact'],'as':_0xc83a('0x85'),'where':{[_0x28141b['mapKey']]:_0x6f3cdb},'limit':0x1,'order':[['updatedAt',_0xc83a('0xbd')]]}]}]})[_0xc83a('0x21')](handleEntityNotFound(_0x1a0380,null))[_0xc83a('0x21')](function(_0x394737){if(_0x394737&&_0x394737[_0xc83a('0x84')]){_0x28be87=_0x394737[_0xc83a('0x38')]({'plain':!![]});if(_0x28be87['List']&&_0x28be87[_0xc83a('0x84')][_0xc83a('0x85')][_0xc83a('0x56')]){return _0x28be87[_0xc83a('0x84')][_0xc83a('0x85')][0x0];}return db['CmContact']['create'](_['defaults'](_0x285095['body'],{'firstName':_0x6f3cdb,[_0x394737['mapKey']]:_0x6f3cdb,'phone':_0x6f3cdb,'ListId':_0x28be87[_0xc83a('0x8d')]}));}})[_0xc83a('0x21')](handleEntityNotFound(_0x1a0380,null))[_0xc83a('0x21')](function(_0x2943d8){if(_0x2943d8){_0x519137=_0x2943d8;return db[_0xc83a('0x90')][_0xc83a('0x5b')]({'where':{'ContactId':_0x519137['id'],'closed':![],'OpenchannelAccountId':_0x28be87['id']}})[_0xc83a('0x21')](function(_0x391494){if(_0x391494){return[_0x391494,![]];}return db['OpenchannelInteraction'][_0xc83a('0x57')]({'UserId':_0x285095['user']['id'],'ContactId':_0x519137['id'],'OpenchannelAccountId':_0x28be87['id'],'lastMsgDirection':_0xc83a('0xbe'),'Messages':[_[_0xc83a('0x4c')](_0x285095['body'],{'read':![],'body':_0x285095[_0xc83a('0x58')]['body'],'OpenchannelAccountId':_0x28be87['id'],'UserId':_0x285095[_0xc83a('0x59')]['id'],'ContactId':_0x519137['id']})]},{'include':[{'model':db[_0xc83a('0xbf')],'as':_0xc83a('0xc0')}]})[_0xc83a('0x21')](function(_0x479be4){return[_0x479be4,!![]];});});}})['spread'](function(_0x12a149,_0x15356b){if(_0x15356b){return _0x12a149;}return db[_0xc83a('0xbf')][_0xc83a('0x57')](_[_0xc83a('0x4c')](_0x285095[_0xc83a('0x58')],{'read':![],'body':_0x285095[_0xc83a('0x58')]['body'],'OpenchannelAccountId':_0x28be87['id'],'OpenchannelInteractionId':_0x12a149['id'],'UserId':_0x285095[_0xc83a('0x59')]['id'],'ContactId':_0x519137['id']}))[_0xc83a('0x21')](function(_0x825495){_0x12a149[_0xc83a('0xc1')][_0xc83a('0xc0')]=[];_0x12a149[_0xc83a('0xc1')][_0xc83a('0xc0')]['push'](_0x825495[_0xc83a('0xc1')]);return _0x12a149;});});}})[_0xc83a('0x21')](respondWithResult(_0x1a0380,null))[_0xc83a('0x2c')](handleError(_0x1a0380,null));};
\ No newline at end of file
+var _0x18b9=['mandatoryDispositionPause','OpenchannelAccount','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpnechannelAccountId','Disposition','findOne','rawAttributes','map','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','nolimit','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','asc','contact','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','firstName','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','addApplications','sequelize','transaction','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','info','catch','status','end','count','offset','limit','Content-Range','json','reject','save','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause'];(function(_0x4f155f,_0x5f118d){var _0x4d7dc8=function(_0x3d88e0){while(--_0x3d88e0){_0x4f155f['push'](_0x4f155f['shift']());}};_0x4d7dc8(++_0x5f118d);}(_0x18b9,0x81));var _0x918b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x18b9[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0x918b('0x0'));var emlformat=require(_0x918b('0x1'));var rimraf=require(_0x918b('0x2'));var zipdir=require(_0x918b('0x3'));var jsonpatch=require(_0x918b('0x4'));var rp=require(_0x918b('0x5'));var moment=require('moment');var BPromise=require(_0x918b('0x6'));var Mustache=require(_0x918b('0x7'));var util=require(_0x918b('0x8'));var path=require(_0x918b('0x9'));var sox=require(_0x918b('0xa'));var csv=require(_0x918b('0xb'));var ejs=require(_0x918b('0xc'));var fs=require('fs');var _=require(_0x918b('0xd'));var squel=require(_0x918b('0xe'));var crypto=require(_0x918b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x918b('0x10'));var toCsv=require(_0x918b('0xb'));var querystring=require('querystring');var Papa=require(_0x918b('0x11'));var Redis=require(_0x918b('0x12'));var authService=require(_0x918b('0x13'));var qs=require(_0x918b('0x14'));var hardwareService=require(_0x918b('0x15'));var logger=require(_0x918b('0x16'))(_0x918b('0x17'));var utils=require(_0x918b('0x18'));var config=require(_0x918b('0x19'));var db=require(_0x918b('0x1a'))['db'];config[_0x918b('0x1b')]=_[_0x918b('0x1c')](config['redis'],{'host':_0x918b('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x918b('0x1b')]));require(_0x918b('0x1e'))[_0x918b('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x918b('0x20')][_0x918b('0x21')]({'port':0x232c});var client9002=jayson[_0x918b('0x20')]['http']({'port':0x232a});function checkPasswordPattern(_0x2d6c33,_0x1742cd,_0x3723be){if(_0x3723be){var _0x23cca6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x23cca6[_0x918b('0x22')](_0x1742cd)){return _0x2d6c33;}else{throw new Error(_0x918b('0x23'));}}else{return _0x2d6c33;}}function respondWithRpcPromise(_0x18fadd,_0x133c8f,_0x10cfe7,_0xa2a2c0){return new BPromise(function(_0x4806f5,_0x29a767){var _0x34abc0=_0xa2a2c0||client;return _0x34abc0[_0x918b('0x24')](_0x18fadd,_0x10cfe7)[_0x918b('0x25')](function(_0x39dce8){logger['info'](_0x918b('0x26'),_0x133c8f,_0x918b('0x27'));logger[_0x918b('0x28')](_0x918b('0x29'),_0x133c8f,_0x918b('0x27'),JSON['stringify'](_0x39dce8));if(_0x39dce8[_0x918b('0x2a')]){if(_0x39dce8[_0x918b('0x2a')]['code']===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x133c8f,_0x39dce8[_0x918b('0x2a')][_0x918b('0x2b')]);return _0x29a767(_0x39dce8[_0x918b('0x2a')][_0x918b('0x2b')]);}logger[_0x918b('0x2a')](_0x918b('0x26'),_0x133c8f,_0x39dce8['error'][_0x918b('0x2b')]);return _0x4806f5(_0x39dce8[_0x918b('0x2a')]['message']);}else{logger[_0x918b('0x2c')](_0x918b('0x26'),_0x133c8f,_0x918b('0x27'));_0x4806f5(_0x39dce8['result'][_0x918b('0x2b')]);}})[_0x918b('0x2d')](function(_0x1cf9ce){logger[_0x918b('0x2a')](_0x918b('0x26'),_0x133c8f,_0x1cf9ce);_0x29a767(_0x1cf9ce);});});}function respondWithStatusCode(_0x33df25,_0x249d11){_0x249d11=_0x249d11||0xcc;return function(_0x4b5a64){if(_0x4b5a64){return _0x33df25['sendStatus'](_0x249d11);}return _0x33df25[_0x918b('0x2e')](_0x249d11)[_0x918b('0x2f')]();};}function respondWithResult(_0x59b89c,_0x1e1b28){_0x1e1b28=_0x1e1b28||0xc8;return function(_0x2483bc){if(_0x2483bc){return _0x59b89c[_0x918b('0x2e')](_0x1e1b28)['json'](_0x2483bc);}};}function respondWithFilteredResult(_0x660ee5,_0x22098d){return function(_0x21b1cc){if(_0x21b1cc){var _0x251083=_0x21b1cc[_0x918b('0x30')],_0x95a195=_0x22098d[_0x918b('0x31')],_0x3c4c2d=_0x22098d[_0x918b('0x31')]+_0x22098d[_0x918b('0x32')],_0x26df35;if(_0x3c4c2d>=_0x251083){_0x3c4c2d=_0x251083;_0x26df35=0xc8;}else{_0x26df35=0xce;}_0x660ee5[_0x918b('0x2e')](_0x26df35);return _0x660ee5['set'](_0x918b('0x33'),_0x95a195+'-'+_0x3c4c2d+'/'+_0x251083)[_0x918b('0x34')](_0x21b1cc);}return null;};}function patchUpdates(_0x1af907){return function(_0x579622){try{jsonpatch['apply'](_0x579622,_0x1af907,!![]);}catch(_0x4ff26c){return BPromise[_0x918b('0x35')](_0x4ff26c);}return _0x579622[_0x918b('0x36')]();};}function saveUpdates(_0x56190d,_0x423852){return function(_0x4feeae){if(_0x4feeae){return _0x4feeae[_0x918b('0x37')](_0x56190d)[_0x918b('0x25')](function(_0x546e95){return _0x546e95;});}return null;};}function removeEntity(_0x1489d9,_0x648182){return function(_0x54c7b4){if(_0x54c7b4){return _0x54c7b4[_0x918b('0x38')]()[_0x918b('0x25')](function(){var _0x1f188c=_0x54c7b4['get']({'plain':!![]});var _0x2dccbd=_0x918b('0x39');return db[_0x918b('0x3a')][_0x918b('0x38')]({'where':{'type':_0x2dccbd,'resourceId':_0x1f188c['id']}})[_0x918b('0x25')](function(){return _0x54c7b4;});})[_0x918b('0x25')](function(){_0x1489d9[_0x918b('0x2e')](0xcc)[_0x918b('0x2f')]();});}};}function handleEntityNotFound(_0x184353,_0x273969){return function(_0xb33b1b){if(!_0xb33b1b){_0x184353['sendStatus'](0x194);}return _0xb33b1b;};}function handleError(_0x8165d,_0x21f65a){_0x21f65a=_0x21f65a||0x1f4;return function(_0x5ce170){logger[_0x918b('0x2a')](_0x5ce170[_0x918b('0x3b')]);if(_0x5ce170[_0x918b('0x3c')]){delete _0x5ce170[_0x918b('0x3c')];}_0x8165d[_0x918b('0x2e')](_0x21f65a)[_0x918b('0x3d')](_0x5ce170);};}exports[_0x918b('0x3e')]=function(_0x45c410,_0x58768d){var _0x36af0f={'include':[{'model':db[_0x918b('0x3f')],'as':_0x918b('0x40')}]},_0x32462c={},_0x4a5970={'count':0x0,'rows':[]};var _0x9a2c09=db[_0x918b('0x41')]['rawAttributes'];_0x32462c[_0x918b('0x42')]=_['keys'](_0x9a2c09);_0x32462c[_0x918b('0x43')]=_[_0x918b('0x44')](_0x45c410[_0x918b('0x43')]);_0x32462c[_0x918b('0x45')]=_[_0x918b('0x46')](_0x32462c[_0x918b('0x42')],_0x32462c[_0x918b('0x43')]);_0x36af0f[_0x918b('0x47')]=_[_0x918b('0x46')](_0x32462c[_0x918b('0x42')],qs[_0x918b('0x48')](_0x45c410[_0x918b('0x43')]['fields']));_0x36af0f['attributes']=_0x36af0f[_0x918b('0x47')][_0x918b('0x49')]?_0x36af0f[_0x918b('0x47')]:_0x32462c[_0x918b('0x42')];if(!_0x45c410['query'][_0x918b('0x4a')]('nolimit')){_0x36af0f[_0x918b('0x32')]=qs[_0x918b('0x32')](_0x45c410[_0x918b('0x43')][_0x918b('0x32')]);_0x36af0f[_0x918b('0x31')]=qs[_0x918b('0x31')](_0x45c410[_0x918b('0x43')]['offset']);}_0x36af0f[_0x918b('0x4b')]=qs[_0x918b('0x4c')](_0x45c410['query'][_0x918b('0x4c')]);_0x36af0f[_0x918b('0x4d')]=qs[_0x918b('0x45')](_[_0x918b('0x4e')](_0x45c410[_0x918b('0x43')],_0x32462c[_0x918b('0x45')]));if(_0x45c410['query'][_0x918b('0x4f')]){_0x36af0f[_0x918b('0x4d')]=_[_0x918b('0x50')](_0x36af0f['where'],{'$or':_['map'](_0x9a2c09,function(_0x1e814d){if(_0x1e814d[_0x918b('0x51')][_0x918b('0x52')]!==_0x918b('0x53')){var _0x46cbc2={};_0x46cbc2[_0x1e814d[_0x918b('0x54')]]={'$like':'%'+_0x45c410[_0x918b('0x43')][_0x918b('0x4f')]+'%'};return _0x46cbc2;}})});}_0x36af0f=_[_0x918b('0x50')]({},_0x36af0f,_0x45c410[_0x918b('0x55')]);var _0x398002={'where':_0x36af0f[_0x918b('0x4d')]};return db[_0x918b('0x41')][_0x918b('0x30')](_0x398002)[_0x918b('0x25')](function(_0x31d765){_0x4a5970[_0x918b('0x30')]=_0x31d765;if(_0x45c410[_0x918b('0x43')][_0x918b('0x56')]){_0x36af0f[_0x918b('0x57')]=[{'all':!![]}];}return db[_0x918b('0x41')][_0x918b('0x58')](_0x36af0f);})[_0x918b('0x25')](function(_0x50a01d){_0x4a5970['rows']=_0x50a01d;return _0x4a5970;})['then'](respondWithFilteredResult(_0x58768d,_0x36af0f))[_0x918b('0x2d')](handleError(_0x58768d,null));};exports['show']=function(_0x40c048,_0x2f9afc){var _0x356dc5={'raw':![],'where':{'id':_0x40c048[_0x918b('0x59')]['id']},'include':[{'model':db[_0x918b('0x3f')],'as':_0x918b('0x40')}]},_0xcb9101={};_0xcb9101[_0x918b('0x42')]=_[_0x918b('0x44')](db[_0x918b('0x41')]['rawAttributes']);_0xcb9101[_0x918b('0x43')]=_[_0x918b('0x44')](_0x40c048[_0x918b('0x43')]);_0xcb9101[_0x918b('0x45')]=_['intersection'](_0xcb9101[_0x918b('0x42')],_0xcb9101['query']);_0x356dc5['attributes']=_[_0x918b('0x46')](_0xcb9101[_0x918b('0x42')],qs[_0x918b('0x48')](_0x40c048[_0x918b('0x43')][_0x918b('0x48')]));_0x356dc5[_0x918b('0x47')]=_0x356dc5['attributes']['length']?_0x356dc5[_0x918b('0x47')]:_0xcb9101[_0x918b('0x42')];if(_0x40c048['query'][_0x918b('0x56')]){_0x356dc5[_0x918b('0x57')]=[{'all':!![]}];}_0x356dc5=_[_0x918b('0x50')]({},_0x356dc5,_0x40c048[_0x918b('0x55')]);return db[_0x918b('0x41')][_0x918b('0x5a')](_0x356dc5)[_0x918b('0x25')](handleEntityNotFound(_0x2f9afc,null))[_0x918b('0x25')](respondWithResult(_0x2f9afc,null))['catch'](handleError(_0x2f9afc,null));};exports[_0x918b('0x5b')]=function(_0x24bc3f,_0x2a8c9e){return db[_0x918b('0x41')][_0x918b('0x5b')](_0x24bc3f[_0x918b('0x5c')],{})[_0x918b('0x25')](function(_0x25f065){var _0x3c4792=_0x24bc3f['user'][_0x918b('0x5d')]({'plain':!![]});if(!_0x3c4792)throw new Error(_0x918b('0x5e'));if(_0x3c4792[_0x918b('0x5f')]===_0x918b('0x60')){var _0x5ee190=_0x25f065[_0x918b('0x5d')]({'plain':!![]});var _0x2791c8=_0x918b('0x39');return db[_0x918b('0x61')]['find']({'where':{'name':_0x2791c8,'userProfileId':_0x3c4792[_0x918b('0x62')]},'raw':!![]})['then'](function(_0x306280){if(_0x306280&&_0x306280[_0x918b('0x63')]===0x0){return db[_0x918b('0x3a')][_0x918b('0x5b')]({'name':_0x5ee190[_0x918b('0x3c')],'resourceId':_0x5ee190['id'],'type':_0x306280[_0x918b('0x3c')],'sectionId':_0x306280['id']},{})[_0x918b('0x25')](function(){return _0x25f065;});}else{return _0x25f065;}})[_0x918b('0x2d')](function(_0x52dadf){logger['error'](_0x918b('0x64'),_0x52dadf);throw _0x52dadf;});}return _0x25f065;})[_0x918b('0x25')](respondWithResult(_0x2a8c9e,0xc9))['catch'](handleError(_0x2a8c9e,null));};exports['update']=function(_0x2d4c4c,_0x143753){if(_0x2d4c4c[_0x918b('0x5c')]['id']){delete _0x2d4c4c['body']['id'];}return db['OpenchannelAccount'][_0x918b('0x5a')]({'where':{'id':_0x2d4c4c['params']['id']},'include':[{'model':db[_0x918b('0x3f')],'as':'mandatoryDispositionPause'}]})[_0x918b('0x25')](handleEntityNotFound(_0x143753,null))[_0x918b('0x25')](saveUpdates(_0x2d4c4c[_0x918b('0x5c')],null))[_0x918b('0x25')](respondWithResult(_0x143753,null))[_0x918b('0x2d')](handleError(_0x143753,null));};exports['destroy']=function(_0x3aa1cc,_0x564868){return db[_0x918b('0x41')][_0x918b('0x5a')]({'where':{'id':_0x3aa1cc[_0x918b('0x59')]['id']}})[_0x918b('0x25')](handleEntityNotFound(_0x564868,null))['then'](removeEntity(_0x564868,null))[_0x918b('0x2d')](handleError(_0x564868,null));};exports[_0x918b('0x65')]=function(_0x47642f,_0x4df8d8){return db[_0x918b('0x41')][_0x918b('0x65')]()[_0x918b('0x25')](respondWithResult(_0x4df8d8,null))[_0x918b('0x2d')](handleError(_0x4df8d8,null));};exports[_0x918b('0x66')]=function(_0x3d982e,_0x4ca84b,_0x402bdc){if(_0x3d982e[_0x918b('0x5c')]['id']){delete _0x3d982e[_0x918b('0x5c')]['id'];}return db[_0x918b('0x41')][_0x918b('0x5a')]({'where':{'id':_0x3d982e[_0x918b('0x59')]['id']}})[_0x918b('0x25')](handleEntityNotFound(_0x4ca84b,null))[_0x918b('0x25')](function(_0x3e70da){if(_0x3e70da){_0x3d982e[_0x918b('0x5c')][_0x918b('0x67')]=_0x3e70da['id'];return db[_0x918b('0x68')][_0x918b('0x5b')](_0x3d982e['body']);}})['then'](respondWithResult(_0x4ca84b,null))['catch'](handleError(_0x4ca84b,null));};exports['getDispositions']=function(_0x1040a1,_0x1151c6,_0x3364b1){var _0x454879={'raw':![],'where':{}};var _0x379ad5={};var _0x40feeb={'count':0x0,'rows':[]};return db[_0x918b('0x41')][_0x918b('0x69')]({'where':{'id':_0x1040a1[_0x918b('0x59')]['id']}})['then'](handleEntityNotFound(_0x1151c6,null))['then'](function(_0x4ac2b6){if(_0x4ac2b6){_0x379ad5[_0x918b('0x42')]=_[_0x918b('0x44')](db[_0x918b('0x68')][_0x918b('0x6a')]);_0x379ad5[_0x918b('0x43')]=_[_0x918b('0x44')](_0x1040a1[_0x918b('0x43')]);_0x379ad5[_0x918b('0x45')]=_[_0x918b('0x46')](_0x379ad5[_0x918b('0x42')],_0x379ad5[_0x918b('0x43')]);_0x454879[_0x918b('0x47')]=_[_0x918b('0x46')](_0x379ad5['model'],qs[_0x918b('0x48')](_0x1040a1[_0x918b('0x43')]['fields']));_0x454879[_0x918b('0x47')]=_0x454879[_0x918b('0x47')]['length']?_0x454879[_0x918b('0x47')]:_0x379ad5['model'];if(!_0x1040a1[_0x918b('0x43')][_0x918b('0x4a')]('nolimit')){_0x454879[_0x918b('0x32')]=qs[_0x918b('0x32')](_0x1040a1[_0x918b('0x43')]['limit']);_0x454879[_0x918b('0x31')]=qs[_0x918b('0x31')](_0x1040a1['query'][_0x918b('0x31')]);}_0x454879['order']=qs['sort'](_0x1040a1[_0x918b('0x43')][_0x918b('0x4c')]);_0x454879[_0x918b('0x4d')]=qs[_0x918b('0x45')](_[_0x918b('0x4e')](_0x1040a1[_0x918b('0x43')],_0x379ad5['filters']));_0x454879[_0x918b('0x4d')]['OpenchannelAccountId']=_0x4ac2b6['id'];if(_0x1040a1[_0x918b('0x43')][_0x918b('0x4f')]){_0x454879[_0x918b('0x4d')]=_[_0x918b('0x50')](_0x454879['where'],{'$or':_[_0x918b('0x6b')](_0x454879[_0x918b('0x47')],function(_0x381f7b){var _0x2d4997={};_0x2d4997[_0x381f7b]={'$like':'%'+_0x1040a1[_0x918b('0x43')]['filter']+'%'};return _0x2d4997;})});}_0x454879=_['merge']({},_0x454879,_0x1040a1[_0x918b('0x55')]);return db[_0x918b('0x68')][_0x918b('0x30')]({'where':_0x454879[_0x918b('0x4d')]})[_0x918b('0x25')](function(_0x45fe78){_0x40feeb[_0x918b('0x30')]=_0x45fe78;if(_0x1040a1[_0x918b('0x43')][_0x918b('0x56')]){_0x454879[_0x918b('0x57')]=[{'all':!![]}];}return db[_0x918b('0x68')]['findAll'](_0x454879);})['then'](function(_0x38360a){_0x40feeb['rows']=_0x38360a;return _0x40feeb;});}})['then'](respondWithFilteredResult(_0x1151c6,_0x454879))[_0x918b('0x2d')](handleError(_0x1151c6,null));};exports[_0x918b('0x6c')]=function(_0x553b2e,_0x2ee8ad,_0x351c7b){return db[_0x918b('0x41')][_0x918b('0x5a')]({'where':{'id':_0x553b2e[_0x918b('0x59')]['id']}})[_0x918b('0x25')](handleEntityNotFound(_0x2ee8ad,null))['then'](function(_0x35abc6){if(_0x35abc6){return _0x35abc6[_0x918b('0x6c')](_0x553b2e[_0x918b('0x43')][_0x918b('0x6d')]);}})[_0x918b('0x25')](respondWithStatusCode(_0x2ee8ad,null))['catch'](handleError(_0x2ee8ad,null));};exports[_0x918b('0x6e')]=function(_0x4f25ea,_0x5b96c4,_0x2edf6b){if(_0x4f25ea[_0x918b('0x5c')]['id']){delete _0x4f25ea[_0x918b('0x5c')]['id'];}return db[_0x918b('0x41')][_0x918b('0x5a')]({'where':{'id':_0x4f25ea[_0x918b('0x59')]['id']}})[_0x918b('0x25')](handleEntityNotFound(_0x5b96c4,null))['then'](function(_0x5cca52){if(_0x5cca52){_0x4f25ea['body'][_0x918b('0x6f')]=_0x5cca52['id'];return db[_0x918b('0x70')][_0x918b('0x5b')](_0x4f25ea['body']);}})['then'](respondWithResult(_0x5b96c4,null))['catch'](handleError(_0x5b96c4,null));};exports[_0x918b('0x71')]=function(_0x43503c,_0x4d981d,_0x3af31b){var _0x2720ac={'raw':![],'where':{}};var _0x44614e={};var _0x229687={'count':0x0,'rows':[]};return db[_0x918b('0x41')][_0x918b('0x69')]({'where':{'id':_0x43503c[_0x918b('0x59')]['id']}})[_0x918b('0x25')](handleEntityNotFound(_0x4d981d,null))[_0x918b('0x25')](function(_0x470d17){if(_0x470d17){_0x44614e[_0x918b('0x42')]=_[_0x918b('0x44')](db[_0x918b('0x70')]['rawAttributes']);_0x44614e['query']=_[_0x918b('0x44')](_0x43503c[_0x918b('0x43')]);_0x44614e['filters']=_[_0x918b('0x46')](_0x44614e[_0x918b('0x42')],_0x44614e['query']);_0x2720ac['attributes']=_['intersection'](_0x44614e[_0x918b('0x42')],qs[_0x918b('0x48')](_0x43503c[_0x918b('0x43')][_0x918b('0x48')]));_0x2720ac[_0x918b('0x47')]=_0x2720ac[_0x918b('0x47')]['length']?_0x2720ac[_0x918b('0x47')]:_0x44614e[_0x918b('0x42')];if(!_0x43503c['query'][_0x918b('0x4a')](_0x918b('0x72'))){_0x2720ac[_0x918b('0x32')]=qs[_0x918b('0x32')](_0x43503c[_0x918b('0x43')][_0x918b('0x32')]);_0x2720ac['offset']=qs[_0x918b('0x31')](_0x43503c[_0x918b('0x43')]['offset']);}_0x2720ac[_0x918b('0x4b')]=qs[_0x918b('0x4c')](_0x43503c[_0x918b('0x43')][_0x918b('0x4c')]);_0x2720ac[_0x918b('0x4d')]=qs[_0x918b('0x45')](_[_0x918b('0x4e')](_0x43503c[_0x918b('0x43')],_0x44614e['filters']));_0x2720ac[_0x918b('0x4d')][_0x918b('0x6f')]=_0x470d17['id'];if(_0x43503c['query']['filter']){_0x2720ac[_0x918b('0x4d')]=_[_0x918b('0x50')](_0x2720ac[_0x918b('0x4d')],{'$or':_[_0x918b('0x6b')](_0x2720ac['attributes'],function(_0x4e1f7b){var _0x15c0ac={};_0x15c0ac[_0x4e1f7b]={'$like':'%'+_0x43503c['query'][_0x918b('0x4f')]+'%'};return _0x15c0ac;})});}_0x2720ac=_[_0x918b('0x50')]({},_0x2720ac,_0x43503c['options']);return db['CannedAnswer'][_0x918b('0x30')]({'where':_0x2720ac[_0x918b('0x4d')]})[_0x918b('0x25')](function(_0x1a0153){_0x229687['count']=_0x1a0153;if(_0x43503c[_0x918b('0x43')]['includeAll']){_0x2720ac['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x918b('0x58')](_0x2720ac);})['then'](function(_0x3405d6){_0x229687['rows']=_0x3405d6;return _0x229687;});}})['then'](respondWithFilteredResult(_0x4d981d,_0x2720ac))[_0x918b('0x2d')](handleError(_0x4d981d,null));};exports[_0x918b('0x73')]=function(_0x931454,_0x2b6a3e,_0x3cce32){return db['OpenchannelAccount'][_0x918b('0x5a')]({'where':{'id':_0x931454[_0x918b('0x59')]['id']}})[_0x918b('0x25')](handleEntityNotFound(_0x2b6a3e,null))[_0x918b('0x25')](function(_0x282ac8){if(_0x282ac8){return _0x282ac8[_0x918b('0x73')](_0x931454[_0x918b('0x43')][_0x918b('0x6d')]);}})[_0x918b('0x25')](respondWithStatusCode(_0x2b6a3e,null))['catch'](handleError(_0x2b6a3e,null));};exports[_0x918b('0x74')]=function(_0x27bfe0,_0x27c729,_0x27631f){var _0x589c3d={'body':_0x27bfe0[_0x918b('0x5c')],'channel':_0x918b('0x75')};var _0xd66c83=[];var _0x4c6463=[];var _0x4fd980={};var _0x5e1b07=![];return db[_0x918b('0x76')]['describe']()[_0x918b('0x25')](function(_0x5821de){if(!_0x5821de){throw new db[(_0x918b('0x77'))][(_0x918b('0x78'))]('no\x20available\x20attributes');}_0xd66c83=_[_0x918b('0x79')](_[_0x918b('0x44')](_0x5821de),[_0x918b('0x7a'),_0x918b('0x7b')]);_0x4c6463=_[_0x918b('0x79')](_['keys'](_0x5821de),[_0x918b('0x7a'),_0x918b('0x7b'),_0x918b('0x7c'),_0x918b('0x7d')]);if(_0x27bfe0['body']['id']){delete _0x27bfe0[_0x918b('0x5c')]['id'];}if(_[_0x918b('0x7e')](_0x27bfe0[_0x918b('0x5c')][_0x918b('0x7f')])){throw new db['Sequelize'][(_0x918b('0x78'))](_0x918b('0x80'));}if(_[_0x918b('0x7e')](_0x27bfe0[_0x918b('0x5c')][_0x918b('0x5c')])||_0x27bfe0['body'][_0x918b('0x5c')]===''){throw new db[(_0x918b('0x77'))][(_0x918b('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x918b('0x7e')](_0x27bfe0[_0x918b('0x5c')][_0x918b('0x81')])){throw new db['Sequelize'][(_0x918b('0x78'))](_0x918b('0x82')+_0x4c6463);}if(!_[_0x918b('0x83')](_0x4c6463,_0x27bfe0[_0x918b('0x5c')][_0x918b('0x81')])){throw new db[(_0x918b('0x77'))][(_0x918b('0x78'))](_0x918b('0x84')+_0x4c6463);}_0x4fd980[_0x27bfe0[_0x918b('0x5c')][_0x918b('0x81')]]=_0x27bfe0[_0x918b('0x5c')][_0x918b('0x7f')];})[_0x918b('0x25')](function(){return db['OpenchannelAccount'][_0x918b('0x5a')]({'where':{'id':_0x27bfe0[_0x918b('0x59')]['id']},'include':[{'model':db[_0x918b('0x85')],'as':_0x918b('0x86'),'include':[{'model':db[_0x918b('0x76')],'as':_0x918b('0x87'),'where':_0x4fd980,'limit':0x1,'order':[[_0x918b('0x7b'),_0x918b('0x88')]]}]},{'model':db[_0x918b('0x89')],'as':_0x918b('0x8a')}]});})[_0x918b('0x25')](handleEntityNotFound(_0x27c729,null))['then'](function(_0x3981fd){if(_0x3981fd&&_0x3981fd[_0x918b('0x86')]){_0x589c3d[_0x918b('0x8b')]=_0x3981fd;_0x589c3d['applications']=_0x3981fd[_0x918b('0x8a')];_0x589c3d[_0x918b('0x8c')]=_0x3981fd[_0x918b('0x86')];_0x589c3d[_0x918b('0x8d')]=_[_0x918b('0x8e')](_0x589c3d[_0x918b('0x8d')],[_0x918b('0x8f')],[_0x918b('0x90')]);if(_0x589c3d[_0x918b('0x8b')]['Applications']){delete _0x589c3d[_0x918b('0x8b')][_0x918b('0x8a')];}if(_0x589c3d[_0x918b('0x8b')][_0x918b('0x86')]&&_0x589c3d[_0x918b('0x8b')][_0x918b('0x86')][_0x918b('0x87')][_0x918b('0x49')]){return _0x589c3d[_0x918b('0x8b')][_0x918b('0x86')][_0x918b('0x87')][0x0];}var _0x235661=_[_0x918b('0x1c')](_0x27bfe0[_0x918b('0x5c')],{'firstName':_0x27bfe0[_0x918b('0x5c')]['from'],'ListId':_0x3981fd[_0x918b('0x7d')]});_0x235661[_0x27bfe0[_0x918b('0x5c')][_0x918b('0x81')]]=_0x27bfe0[_0x918b('0x5c')]['from'];return db[_0x918b('0x76')][_0x918b('0x5b')](_0x235661,{'fields':_0xd66c83,'raw':!![]});}})[_0x918b('0x25')](handleEntityNotFound(_0x27c729,null))[_0x918b('0x25')](function(_0x15efd6){_0x589c3d[_0x918b('0x91')]=_0x15efd6;if(_0x15efd6){var _0x3b7a77={'ContactId':_0x15efd6['id'],'OpenchannelAccountId':_0x27bfe0[_0x918b('0x59')]['id'],'from':(_0x15efd6['firstName']||'')+'\x20'+(_0x15efd6['lastName']||'')};var _0x1109f4={'OpenchannelAccountId':_0x27bfe0[_0x918b('0x59')]['id'],'closed':![]};if(_0x27bfe0[_0x918b('0x5c')]['threadId']){_0x1109f4[_0x918b('0x92')]=_0x27bfe0[_0x918b('0x5c')][_0x918b('0x92')];return db['OpenchannelInteraction'][_0x918b('0x5a')]({'where':_0x1109f4})[_0x918b('0x25')](function(_0x49d79c){if(_0x49d79c){return[_0x49d79c,![]];}_0x3b7a77[_0x918b('0x92')]=_0x27bfe0[_0x918b('0x5c')]['threadId'];_0x3b7a77[_0x918b('0x93')]=_0x27bfe0['body']['externalUrl'];return db[_0x918b('0x94')][_0x918b('0x5b')](_0x3b7a77)[_0x918b('0x25')](function(_0x2e5b3e){return[_0x2e5b3e,!![]];});});}else{_0x1109f4[_0x918b('0x92')]=null;}_0x1109f4[_0x918b('0x95')]=_0x15efd6['id'];return db[_0x918b('0x94')][_0x918b('0x5a')]({'where':_0x1109f4})['then'](function(_0x28e89d){if(_0x28e89d){return[_0x28e89d,![]];}return db['OpenchannelInteraction'][_0x918b('0x5b')](_0x3b7a77)[_0x918b('0x25')](function(_0x3f8fe8){return[_0x3f8fe8,!![]];});});}})[_0x918b('0x96')](function(_0xba3418,_0x169d3c){if(_0xba3418){_0x5e1b07=_0x169d3c;if(!_0x169d3c){var _0x2bf115={'from':(_0x589c3d['contact'][_0x918b('0x97')]||'')+'\x20'+(_0x589c3d['contact'][_0x918b('0x98')]||'')};if(_0x27bfe0[_0x918b('0x5c')][_0x918b('0x92')]&&_0x27bfe0[_0x918b('0x5c')][_0x918b('0x99')]&&_0x27bfe0[_0x918b('0x5c')]['threadId']!=_0x27bfe0[_0x918b('0x5c')]['messageId']){_0x2bf115['threadId']=_0x27bfe0[_0x918b('0x5c')]['messageId'];}return _0xba3418[_0x918b('0x37')](_0x2bf115);}else{return _0xba3418;}}})[_0x918b('0x25')](function(_0x2f9775){_0x589c3d[_0x918b('0x9a')]=_0x2f9775[_0x918b('0x5d')]({'plain':!![]});_0x589c3d[_0x918b('0x9a')]['created']=_0x5e1b07;if(_0x589c3d['interaction'][_0x918b('0x9b')]){if(_0x589c3d['account'][_0x918b('0x9c')]){_0x589c3d[_0x918b('0x8d')][_0x918b('0x9d')]({'id':0x0,'priority':_0x589c3d[_0x918b('0x8d')]['length']+0x1,'app':_0x918b('0x9e'),'appdata':_0x918b('0x9f'),'interval':_0x918b('0xa0')});}}return db[_0x918b('0xa1')]['create']({'body':_0x27bfe0[_0x918b('0x5c')]['body'],'OpenchannelAccountId':_0x27bfe0[_0x918b('0x59')]['id'],'OpenchannelInteractionId':_0x2f9775['id'],'direction':'in','ContactId':_0x589c3d[_0x918b('0x91')]['id'],'AttachmentId':_0x27bfe0[_0x918b('0x5c')][_0x918b('0xa2')]});})[_0x918b('0x25')](function(_0x553684){_0x589c3d['message']=_0x553684;if(_0x589c3d[_0x918b('0x9a')][_0x918b('0xa3')]){return db[_0x918b('0xa4')][_0x918b('0x5a')]({'attributes':['id','name'],'where':{'id':_0x589c3d[_0x918b('0x9a')]['UserId']}})['then'](function(_0x3aec23){if(_0x3aec23){_0x589c3d[_0x918b('0x8d')][_0x918b('0xa5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3aec23[_0x918b('0x3c')]+','+(_0x589c3d[_0x918b('0x8b')][_0x918b('0xa6')]||0xa),'interval':_0x918b('0xa0')});_0x589c3d[_0x918b('0xa7')]=![];}return respondWithRpcPromise('Start','startRouting',_0x589c3d);});}return respondWithRpcPromise(_0x918b('0xa8'),'startRouting',_0x589c3d);})[_0x918b('0x25')](function(_0x586e22){respondWithRpcPromise(_0x918b('0xa9'),'EventManager',{'event':'notify','message':_0x586e22},client9002);return _0x586e22;})[_0x918b('0x25')](respondWithResult(_0x27c729,null))[_0x918b('0x2d')](handleError(_0x27c729,null));};exports[_0x918b('0xaa')]=function(_0x56dc7e,_0x176e39,_0x563fca){return db[_0x918b('0x41')][_0x918b('0x69')]({'where':{'id':_0x56dc7e[_0x918b('0x59')]['id']}})[_0x918b('0x25')](handleEntityNotFound(_0x176e39,null))[_0x918b('0x25')](function(_0xa1f55c){if(_0xa1f55c){return db[_0x918b('0xab')][_0x918b('0xac')](function(_0x49d5bc){return db[_0x918b('0x89')][_0x918b('0x38')]({'where':{'OpenchannelAccountId':_0x56dc7e[_0x918b('0x59')]['id']},'transaction':_0x49d5bc})[_0x918b('0x25')](function(_0xc08448){var _0x23cb0e=_['map'](_0x56dc7e[_0x918b('0x5c')],function(_0x4d2e12){_0x4d2e12[_0x918b('0x6f')]=_0x56dc7e[_0x918b('0x59')]['id'];return _0x4d2e12;});return db[_0x918b('0x89')][_0x918b('0xad')](_0x23cb0e,{'transaction':_0x49d5bc});});})['then'](function(){return db[_0x918b('0x89')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x56dc7e[_0x918b('0x59')]['id']},'order':_0x918b('0x8f')});});}})['then'](respondWithResult(_0x176e39,null))[_0x918b('0x2d')](handleError(_0x176e39,null));};exports[_0x918b('0xae')]=function(_0x3d6587,_0x13cf90,_0x3f6601){var _0x2235fa={};var _0x4a66df={};var _0x2d7e55;var _0xd2ea75;return db[_0x918b('0x41')][_0x918b('0x69')]({'where':{'id':_0x3d6587[_0x918b('0x59')]['id']}})['then'](handleEntityNotFound(_0x13cf90,null))[_0x918b('0x25')](function(_0x42887c){if(_0x42887c){_0x2d7e55=_0x42887c;_0x4a66df[_0x918b('0x42')]=_['keys'](db[_0x918b('0x89')]['rawAttributes']);_0x4a66df[_0x918b('0x43')]=_['keys'](_0x3d6587[_0x918b('0x43')]);_0x4a66df[_0x918b('0x45')]=_[_0x918b('0x46')](_0x4a66df[_0x918b('0x42')],_0x4a66df['query']);_0x2235fa[_0x918b('0x47')]=_[_0x918b('0x46')](_0x4a66df[_0x918b('0x42')],qs[_0x918b('0x48')](_0x3d6587[_0x918b('0x43')][_0x918b('0x48')]));_0x2235fa['attributes']=_0x2235fa[_0x918b('0x47')][_0x918b('0x49')]?_0x2235fa[_0x918b('0x47')]:_0x4a66df[_0x918b('0x42')];_0x2235fa[_0x918b('0x4b')]=qs['sort'](_0x3d6587[_0x918b('0x43')][_0x918b('0x4c')]);_0x2235fa[_0x918b('0x4d')]=qs['filters'](_[_0x918b('0x4e')](_0x3d6587['query'],_0x4a66df[_0x918b('0x45')]));if(_0x3d6587[_0x918b('0x43')][_0x918b('0x4f')]){_0x2235fa[_0x918b('0x4d')]=_['merge'](_0x2235fa['where'],{'$or':_[_0x918b('0x6b')](_0x2235fa[_0x918b('0x47')],function(_0x354220){var _0x48634b={};_0x48634b[_0x354220]={'$like':'%'+_0x3d6587[_0x918b('0x43')]['filter']+'%'};return _0x48634b;})});}_0x2235fa=_['merge']({},_0x2235fa,_0x3d6587['options']);return _0x2d7e55[_0x918b('0xae')](_0x2235fa);}})[_0x918b('0x25')](function(_0x2b351e){if(_0x2b351e){_0xd2ea75=_0x2b351e[_0x918b('0x49')];if(!_0x3d6587['query'][_0x918b('0x4a')](_0x918b('0x72'))){_0x2235fa[_0x918b('0x32')]=qs[_0x918b('0x32')](_0x3d6587[_0x918b('0x43')]['limit']);_0x2235fa['offset']=qs[_0x918b('0x31')](_0x3d6587[_0x918b('0x43')][_0x918b('0x31')]);}return _0x2d7e55['getApplications'](_0x2235fa);}})[_0x918b('0x25')](function(_0x563077){if(_0x563077){return _0x563077?{'count':_0xd2ea75,'rows':_0x563077}:null;}})[_0x918b('0x25')](respondWithResult(_0x13cf90,null))['catch'](handleError(_0x13cf90,null));};exports[_0x918b('0xaf')]=function(_0x40e0f8,_0x59cc95,_0x4970a6){var _0x5e27ed={'raw':![],'where':{}};var _0x36c4f3={};var _0x155643={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x40e0f8[_0x918b('0x59')]['id']}})['then'](handleEntityNotFound(_0x59cc95,null))[_0x918b('0x25')](function(_0x2db16e){if(_0x2db16e){_0x36c4f3[_0x918b('0x42')]=_[_0x918b('0x44')](db[_0x918b('0x94')]['rawAttributes']);_0x36c4f3[_0x918b('0x43')]=_[_0x918b('0x44')](_0x40e0f8[_0x918b('0x43')]);_0x36c4f3[_0x918b('0x45')]=_[_0x918b('0x46')](_0x36c4f3[_0x918b('0x42')],_0x36c4f3['query']);_0x5e27ed[_0x918b('0x47')]=_[_0x918b('0x46')](_0x36c4f3[_0x918b('0x42')],qs[_0x918b('0x48')](_0x40e0f8[_0x918b('0x43')]['fields']));_0x5e27ed[_0x918b('0x47')]=_0x5e27ed[_0x918b('0x47')][_0x918b('0x49')]?_0x5e27ed[_0x918b('0x47')]:_0x36c4f3[_0x918b('0x42')];if(!_0x40e0f8['query'][_0x918b('0x4a')]('nolimit')){_0x5e27ed['limit']=qs[_0x918b('0x32')](_0x40e0f8[_0x918b('0x43')]['limit']);_0x5e27ed[_0x918b('0x31')]=qs[_0x918b('0x31')](_0x40e0f8['query'][_0x918b('0x31')]);}_0x5e27ed[_0x918b('0x4b')]=qs[_0x918b('0x4c')](_0x40e0f8[_0x918b('0x43')][_0x918b('0x4c')]);_0x5e27ed[_0x918b('0x4d')]=qs[_0x918b('0x45')](_[_0x918b('0x4e')](_0x40e0f8[_0x918b('0x43')],_0x36c4f3['filters']));_0x5e27ed[_0x918b('0x4d')]['OpenchannelAccountId']=_0x2db16e['id'];if(_0x40e0f8[_0x918b('0x43')][_0x918b('0x4f')]){_0x5e27ed[_0x918b('0x4d')]=_[_0x918b('0x50')](_0x5e27ed['where'],{'$or':_['map'](_0x5e27ed[_0x918b('0x47')],function(_0x784879){var _0x29bc76={};_0x29bc76[_0x784879]={'$like':'%'+_0x40e0f8[_0x918b('0x43')][_0x918b('0x4f')]+'%'};return _0x29bc76;})});}_0x5e27ed=_[_0x918b('0x50')]({},_0x5e27ed,_0x40e0f8['options']);return db[_0x918b('0x94')][_0x918b('0x30')]({'where':_0x5e27ed[_0x918b('0x4d')]})[_0x918b('0x25')](function(_0x1d612a){_0x155643[_0x918b('0x30')]=_0x1d612a;if(_0x40e0f8[_0x918b('0x43')][_0x918b('0x56')]){_0x5e27ed[_0x918b('0x57')]=[{'model':db[_0x918b('0x76')],'as':_0x918b('0xb0'),'required':![]},{'model':db[_0x918b('0xa4')],'as':_0x918b('0xb1'),'attributes':[_0x918b('0x3c'),_0x918b('0xb2'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x918b('0xb3'),'attributes':['id',_0x918b('0x3c'),_0x918b('0xb4')],'where':_0x40e0f8[_0x918b('0x43')]['tag']?{'id':_0x40e0f8[_0x918b('0x43')][_0x918b('0xb5')]}:undefined,'required':_0x40e0f8[_0x918b('0x43')][_0x918b('0xb5')]?!![]:![]}];}return db[_0x918b('0x94')][_0x918b('0x58')](_0x5e27ed);})[_0x918b('0x25')](function(_0x8b81c){_0x155643['rows']=_0x8b81c;return _0x155643;});}})[_0x918b('0x25')](respondWithFilteredResult(_0x59cc95,_0x5e27ed))[_0x918b('0x2d')](handleError(_0x59cc95,null));};exports[_0x918b('0xb6')]=function(_0x39c5b0,_0x3fb299,_0x28865f){return db[_0x918b('0x41')][_0x918b('0x5a')]({'where':{'id':_0x39c5b0['params']['id']}})['then'](handleEntityNotFound(_0x3fb299,null))[_0x918b('0x25')](function(_0x5a0e42){if(_0x5a0e42){return _0x5a0e42['addAgents'](_0x39c5b0[_0x918b('0x5c')][_0x918b('0x6d')],_['omit'](_0x39c5b0['body'],['ids','id'])||{})[_0x918b('0x96')](function(_0x1ac38b){for(var _0x8e3498=0x0;_0x8e3498<_0x39c5b0['body'][_0x918b('0x6d')]['length'];_0x8e3498+=0x1){socket[_0x918b('0xb7')](_0x918b('0xb8'),{'UserId':_0x39c5b0['body'][_0x918b('0x6d')][_0x8e3498],'OpenchannelAccountId':_0x39c5b0[_0x918b('0x59')]['id']});}return _0x1ac38b;});}})['then'](respondWithResult(_0x3fb299,null))[_0x918b('0x2d')](handleError(_0x3fb299,null));};exports[_0x918b('0xb9')]=function(_0x3c7ff7,_0x2c1f2b,_0x2fc8b5){return db['OpenchannelAccount'][_0x918b('0x5a')]({'where':{'id':_0x3c7ff7[_0x918b('0x59')]['id']}})[_0x918b('0x25')](handleEntityNotFound(_0x2c1f2b,null))[_0x918b('0x25')](function(_0xd2dcd){if(_0xd2dcd){return _0xd2dcd[_0x918b('0xb9')](_0x3c7ff7[_0x918b('0x43')][_0x918b('0x6d')])[_0x918b('0x25')](function(){if(_[_0x918b('0xba')](_0x3c7ff7[_0x918b('0x43')][_0x918b('0x6d')])){for(var _0x5b1377=0x0;_0x5b1377<_0x3c7ff7['query'][_0x918b('0x6d')][_0x918b('0x49')];_0x5b1377+=0x1){socket[_0x918b('0xb7')](_0x918b('0xbb'),{'UserId':Number(_0x3c7ff7['query']['ids'][_0x5b1377]),'OpenchannelAccountId':Number(_0x3c7ff7[_0x918b('0x59')]['id'])});}}else{socket[_0x918b('0xb7')](_0x918b('0xbb'),{'UserId':Number(_0x3c7ff7[_0x918b('0x43')][_0x918b('0x6d')]),'OpenchannelAccountId':Number(_0x3c7ff7[_0x918b('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x2c1f2b,null))[_0x918b('0x2d')](handleError(_0x2c1f2b,null));};exports[_0x918b('0xbc')]=function(_0x326915,_0x26765c,_0x2e192a){var _0x4fcf4b={};var _0x2e3a4c={};var _0x3a866b;var _0x1e193d;return db[_0x918b('0x41')][_0x918b('0x69')]({'where':{'id':_0x326915['params']['id']}})['then'](handleEntityNotFound(_0x26765c,null))['then'](function(_0x4ab1ce){if(_0x4ab1ce){_0x3a866b=_0x4ab1ce;_0x2e3a4c[_0x918b('0x42')]=_[_0x918b('0x44')](db[_0x918b('0xa4')][_0x918b('0x6a')]);_0x2e3a4c['query']=_['keys'](_0x326915[_0x918b('0x43')]);_0x2e3a4c['filters']=_[_0x918b('0x46')](_0x2e3a4c[_0x918b('0x42')],_0x2e3a4c['query']);_0x4fcf4b[_0x918b('0x47')]=_[_0x918b('0x46')](_0x2e3a4c[_0x918b('0x42')],qs[_0x918b('0x48')](_0x326915[_0x918b('0x43')][_0x918b('0x48')]));_0x4fcf4b['attributes']=_0x4fcf4b[_0x918b('0x47')][_0x918b('0x49')]?_0x4fcf4b['attributes']:_0x2e3a4c['model'];_0x4fcf4b[_0x918b('0x4b')]=qs['sort'](_0x326915[_0x918b('0x43')][_0x918b('0x4c')]);_0x4fcf4b[_0x918b('0x4d')]=qs[_0x918b('0x45')](_[_0x918b('0x4e')](_0x326915[_0x918b('0x43')],_0x2e3a4c['filters']));if(_0x326915['query']['filter']){_0x4fcf4b[_0x918b('0x4d')]=_['merge'](_0x4fcf4b['where'],{'$or':_[_0x918b('0x6b')](_0x4fcf4b[_0x918b('0x47')],function(_0x1675ea){var _0x118795={};_0x118795[_0x1675ea]={'$like':'%'+_0x326915[_0x918b('0x43')][_0x918b('0x4f')]+'%'};return _0x118795;})});}_0x4fcf4b=_[_0x918b('0x50')]({},_0x4fcf4b,_0x326915['options']);return _0x3a866b[_0x918b('0xbc')](_0x4fcf4b);}})['then'](function(_0x54d641){if(_0x54d641){_0x1e193d=_0x54d641[_0x918b('0x49')];if(!_0x326915[_0x918b('0x43')][_0x918b('0x4a')]('nolimit')){_0x4fcf4b[_0x918b('0x32')]=qs[_0x918b('0x32')](_0x326915[_0x918b('0x43')][_0x918b('0x32')]);_0x4fcf4b[_0x918b('0x31')]=qs[_0x918b('0x31')](_0x326915[_0x918b('0x43')][_0x918b('0x31')]);}return _0x3a866b[_0x918b('0xbc')](_0x4fcf4b);}})[_0x918b('0x25')](function(_0x4bd3e6){if(_0x4bd3e6){return _0x4bd3e6?{'count':_0x1e193d,'rows':_0x4bd3e6}:null;}})['then'](respondWithResult(_0x26765c,null))['catch'](handleError(_0x26765c,null));};exports[_0x918b('0x3d')]=function(_0x230c83,_0xe67d9,_0x35e589){var _0x5cfb25,_0x1d3c2e,_0x930bf;if(_[_0x918b('0x7e')](_0x230c83[_0x918b('0x5c')][_0x918b('0x5c')])||_0x230c83['body'][_0x918b('0x5c')]===''){throw new db[(_0x918b('0x77'))]['ValidationError'](_0x918b('0xbd'));}if(_[_0x918b('0x7e')](_0x230c83[_0x918b('0x5c')]['to'])){}_0x5cfb25=_0x230c83[_0x918b('0x5c')]['to'];return db[_0x918b('0x41')][_0x918b('0x69')]({'where':{'id':_0x230c83[_0x918b('0x59')]['id']}})[_0x918b('0x25')](handleEntityNotFound(_0xe67d9,null))[_0x918b('0x25')](function(_0x5afff3){if(_0x5afff3){return db['OpenchannelAccount'][_0x918b('0x5a')]({'where':{'id':_0x5afff3['id']},'include':[{'model':db[_0x918b('0x85')],'as':'List','include':[{'model':db[_0x918b('0x76')],'as':_0x918b('0x87'),'where':{[_0x5afff3[_0x918b('0x81')]]:_0x5cfb25},'limit':0x1,'order':[[_0x918b('0x7b'),_0x918b('0x88')]]}]}]})[_0x918b('0x25')](handleEntityNotFound(_0xe67d9,null))[_0x918b('0x25')](function(_0x5c2c24){if(_0x5c2c24&&_0x5c2c24[_0x918b('0x86')]){_0x1d3c2e=_0x5c2c24[_0x918b('0x5d')]({'plain':!![]});if(_0x1d3c2e[_0x918b('0x86')]&&_0x1d3c2e[_0x918b('0x86')][_0x918b('0x87')][_0x918b('0x49')]){return _0x1d3c2e[_0x918b('0x86')][_0x918b('0x87')][0x0];}return db[_0x918b('0x76')][_0x918b('0x5b')](_['defaults'](_0x230c83[_0x918b('0x5c')],{'firstName':_0x5cfb25,[_0x5c2c24[_0x918b('0x81')]]:_0x5cfb25,'phone':_0x5cfb25,'ListId':_0x1d3c2e[_0x918b('0x7d')]}));}})[_0x918b('0x25')](handleEntityNotFound(_0xe67d9,null))[_0x918b('0x25')](function(_0x598260){if(_0x598260){_0x930bf=_0x598260;return db[_0x918b('0x94')]['find']({'where':{'ContactId':_0x930bf['id'],'closed':![],'OpenchannelAccountId':_0x1d3c2e['id']}})[_0x918b('0x25')](function(_0x1111b3){if(_0x1111b3){return[_0x1111b3,![]];}return db['OpenchannelInteraction'][_0x918b('0x5b')]({'UserId':_0x230c83[_0x918b('0x60')]['id'],'ContactId':_0x930bf['id'],'OpenchannelAccountId':_0x1d3c2e['id'],'lastMsgDirection':_0x918b('0xbe'),'Messages':[_[_0x918b('0x50')](_0x230c83[_0x918b('0x5c')],{'read':![],'body':_0x230c83[_0x918b('0x5c')][_0x918b('0x5c')],'OpenchannelAccountId':_0x1d3c2e['id'],'UserId':_0x230c83[_0x918b('0x60')]['id'],'ContactId':_0x930bf['id']})]},{'include':[{'model':db[_0x918b('0xa1')],'as':_0x918b('0xbf')}]})[_0x918b('0x25')](function(_0x42b50c){return[_0x42b50c,!![]];});});}})[_0x918b('0x96')](function(_0x21f393,_0x274fc6){if(_0x274fc6){return _0x21f393;}return db[_0x918b('0xa1')][_0x918b('0x5b')](_[_0x918b('0x50')](_0x230c83[_0x918b('0x5c')],{'read':![],'body':_0x230c83[_0x918b('0x5c')]['body'],'OpenchannelAccountId':_0x1d3c2e['id'],'OpenchannelInteractionId':_0x21f393['id'],'UserId':_0x230c83['user']['id'],'ContactId':_0x930bf['id']}))[_0x918b('0x25')](function(_0x47d68c){_0x21f393['dataValues'][_0x918b('0xbf')]=[];_0x21f393[_0x918b('0xc0')]['Messages']['push'](_0x47d68c['dataValues']);return _0x21f393;});});}})[_0x918b('0x25')](respondWithResult(_0xe67d9,null))['catch'](handleError(_0xe67d9,null));};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js
index cc6309c..534a425 100644
--- a/server/api/openchannelAccount/openchannelAccount.events.js
+++ b/server/api/openchannelAccount/openchannelAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe148=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','hook','exports','events'];(function(_0x114da6,_0x41b730){var _0x2fa6d9=function(_0x3b85c1){while(--_0x3b85c1){_0x114da6['push'](_0x114da6['shift']());}};_0x2fa6d9(++_0x41b730);}(_0xe148,0x109));var _0x8e14=function(_0x455f19,_0x4f8f3a){_0x455f19=_0x455f19-0x0;var _0x422f21=_0xe148[_0x455f19];return _0x422f21;};'use strict';var EventEmitter=require(_0x8e14('0x0'));var OpenchannelAccount=require(_0x8e14('0x1'))['db'][_0x8e14('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8e14('0x3')](0x0);var events={'afterCreate':_0x8e14('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x122b0c){return function(_0x22e11f,_0x1264d8,_0x16b54a){OpenchannelAccountEvents['emit'](_0x122b0c+':'+_0x22e11f['id'],_0x22e11f);OpenchannelAccountEvents['emit'](_0x122b0c,_0x22e11f);_0x16b54a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x8e14('0x5')](e,emitEvent(event));}}module[_0x8e14('0x6')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x2318=['update','remove','emit','hasOwnProperty','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x32d6f0,_0x20bd82){var _0x48540f=function(_0x48fb0f){while(--_0x48fb0f){_0x32d6f0['push'](_0x32d6f0['shift']());}};_0x48540f(++_0x20bd82);}(_0x2318,0x115));var _0x8231=function(_0x4f8d01,_0x2c0343){_0x4f8d01=_0x4f8d01-0x0;var _0x13afd2=_0x2318[_0x4f8d01];return _0x13afd2;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x8231('0x0'))['db'][_0x8231('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8231('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8231('0x3'),'afterDestroy':_0x8231('0x4')};function emitEvent(_0x299daf){return function(_0x2e26af,_0x25afb2,_0xf9a7a0){OpenchannelAccountEvents['emit'](_0x299daf+':'+_0x2e26af['id'],_0x2e26af);OpenchannelAccountEvents[_0x8231('0x5')](_0x299daf,_0x2e26af);_0xf9a7a0(null);};}for(var e in events){if(events[_0x8231('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js
index ef36c92..4f7e1c1 100644
--- a/server/api/openchannelAccount/openchannelAccount.model.js
+++ b/server/api/openchannelAccount/openchannelAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcce9=['./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x28e4f1,_0x4b3b80){var _0x56f544=function(_0x2f8c15){while(--_0x2f8c15){_0x28e4f1['push'](_0x28e4f1['shift']());}};_0x56f544(++_0x4b3b80);}(_0xcce9,0xd4));var _0x9cce=function(_0x2aacff,_0x29cac9){_0x2aacff=_0x2aacff-0x0;var _0x5b474a=_0xcce9[_0x2aacff];return _0x5b474a;};'use strict';var _=require(_0x9cce('0x0'));var util=require(_0x9cce('0x1'));var logger=require(_0x9cce('0x2'))(_0x9cce('0x3'));var moment=require(_0x9cce('0x4'));var BPromise=require(_0x9cce('0x5'));var rp=require(_0x9cce('0x6'));var fs=require('fs');var path=require(_0x9cce('0x7'));var rimraf=require('rimraf');var config=require(_0x9cce('0x8'));var attributes=require(_0x9cce('0x9'));module[_0x9cce('0xa')]=function(_0x52a521,_0x737449){return _0x52a521[_0x9cce('0xb')](_0x9cce('0xc'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe666=['exports','lodash','api','bluebird','path','../../config/environment','./openchannelAccount.attributes'];(function(_0x409c97,_0x3cb400){var _0x25861e=function(_0x15239f){while(--_0x15239f){_0x409c97['push'](_0x409c97['shift']());}};_0x25861e(++_0x3cb400);}(_0xe666,0x189));var _0x6e66=function(_0x2a2e62,_0x54ccc3){_0x2a2e62=_0x2a2e62-0x0;var _0x6ae6af=_0xe666[_0x2a2e62];return _0x6ae6af;};'use strict';var _=require(_0x6e66('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6e66('0x1'));var moment=require('moment');var BPromise=require(_0x6e66('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e66('0x3'));var rimraf=require('rimraf');var config=require(_0x6e66('0x4'));var attributes=require(_0x6e66('0x5'));module[_0x6e66('0x6')]=function(_0x3af796,_0x15889f){return _0x3af796['define']('OpenchannelAccount',attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js
index ed8f0bb..ba887ff 100644
--- a/server/api/openchannelAccount/openchannelAccount.rpc.js
+++ b/server/api/openchannelAccount/openchannelAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x326f=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x15b580,_0x343baf){var _0x47cd5e=function(_0x51993a){while(--_0x51993a){_0x15b580['push'](_0x15b580['shift']());}};_0x47cd5e(++_0x343baf);}(_0x326f,0xd1));var _0xf326=function(_0x28fbfc,_0x423782){_0x28fbfc=_0x28fbfc-0x0;var _0x4feca4=_0x326f[_0x28fbfc];return _0x4feca4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});config[_0xf326('0xb')]=_[_0xf326('0xc')](config[_0xf326('0xb')],{'host':_0xf326('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xf326('0xe')](socket);function respondWithRpcPromise(_0x1fc80e,_0x163416,_0x2686e1){return new BPromise(function(_0x1f3a33,_0x5db9d7){return client[_0xf326('0xf')](_0x1fc80e,_0x2686e1)['then'](function(_0x1cf441){logger['info'](_0xf326('0x10'),_0x163416,'request\x20sent');logger[_0xf326('0x11')](_0xf326('0x12'),_0x163416,'request\x20sent',JSON[_0xf326('0x13')](_0x1cf441));if(_0x1cf441[_0xf326('0x14')]){if(_0x1cf441[_0xf326('0x14')][_0xf326('0x15')]===0x1f4){logger['error'](_0xf326('0x10'),_0x163416,_0x1cf441['error']['message']);return _0x5db9d7(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}logger[_0xf326('0x14')](_0xf326('0x10'),_0x163416,_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);return _0x1f3a33(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}else{logger['info'](_0xf326('0x10'),_0x163416,_0xf326('0x17'));_0x1f3a33(_0x1cf441[_0xf326('0x18')][_0xf326('0x16')]);}})[_0xf326('0x19')](function(_0x311af0){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x163416,_0x311af0);_0x5db9d7(_0x311af0);});});}
\ No newline at end of file
+var _0x5fc3=['register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./openchannelAccount.socket'];(function(_0x510d39,_0x166b23){var _0x4f8d53=function(_0x476cb8){while(--_0x476cb8){_0x510d39['push'](_0x510d39['shift']());}};_0x4f8d53(++_0x166b23);}(_0x5fc3,0xa8));var _0x35fc=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x5fc3[_0x26b8b5];return _0x2150a9;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x35fc('0xa')]=_['defaults'](config[_0x35fc('0xa')],{'host':_0x35fc('0xb'),'port':0x18eb});var socket=require(_0x35fc('0xc'))(new Redis(config[_0x35fc('0xa')]));require(_0x35fc('0xd'))[_0x35fc('0xe')](socket);function respondWithRpcPromise(_0x2051ab,_0x565f95,_0x1083a9){return new BPromise(function(_0x2a1084,_0x4fdca1){return client[_0x35fc('0xf')](_0x2051ab,_0x1083a9)[_0x35fc('0x10')](function(_0x5021d4){logger[_0x35fc('0x11')](_0x35fc('0x12'),_0x565f95,'request\x20sent');logger['debug'](_0x35fc('0x13'),_0x565f95,'request\x20sent',JSON[_0x35fc('0x14')](_0x5021d4));if(_0x5021d4[_0x35fc('0x15')]){if(_0x5021d4[_0x35fc('0x15')][_0x35fc('0x16')]===0x1f4){logger[_0x35fc('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x565f95,_0x5021d4['error']['message']);return _0x4fdca1(_0x5021d4['error'][_0x35fc('0x17')]);}logger[_0x35fc('0x15')](_0x35fc('0x12'),_0x565f95,_0x5021d4[_0x35fc('0x15')][_0x35fc('0x17')]);return _0x2a1084(_0x5021d4[_0x35fc('0x15')]['message']);}else{logger[_0x35fc('0x11')](_0x35fc('0x12'),_0x565f95,'request\x20sent');_0x2a1084(_0x5021d4[_0x35fc('0x18')][_0x35fc('0x17')]);}})[_0x35fc('0x19')](function(_0x5f56c6){logger[_0x35fc('0x15')](_0x35fc('0x12'),_0x565f95,_0x5f56c6);_0x4fdca1(_0x5f56c6);});});}
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js
index 214082f..ae6698a 100644
--- a/server/api/openchannelAccount/openchannelAccount.socket.js
+++ b/server/api/openchannelAccount/openchannelAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a19=['register','openchannelAccount:','save','remove','update','emit','removeListener'];(function(_0x1dd46b,_0x4021b7){var _0x545d3a=function(_0x12dd81){while(--_0x12dd81){_0x1dd46b['push'](_0x1dd46b['shift']());}};_0x545d3a(++_0x4021b7);}(_0x2a19,0x1ec));var _0x92a1=function(_0x2c18c2,_0x1edbf1){_0x2c18c2=_0x2c18c2-0x0;var _0x24580e=_0x2a19[_0x2c18c2];return _0x24580e;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x92a1('0x0'),_0x92a1('0x1'),_0x92a1('0x2')];function createListener(_0x3653cb,_0x3c7eb5){return function(_0x3e526f){_0x3c7eb5[_0x92a1('0x3')](_0x3653cb,_0x3e526f);};}function removeListener(_0x52b6f9,_0x51db20){return function(){OpenchannelAccountEvents[_0x92a1('0x4')](_0x52b6f9,_0x51db20);};}exports[_0x92a1('0x5')]=function(_0x1b5462){for(var _0x11a704=0x0,_0x3fc436=events['length'];_0x11a704<_0x3fc436;_0x11a704++){var _0x2d069a=events[_0x11a704];var _0x37c304=createListener(_0x92a1('0x6')+_0x2d069a,_0x1b5462);OpenchannelAccountEvents['on'](_0x2d069a,_0x37c304);}};
\ No newline at end of file
+var _0xc8fd=['emit','openchannelAccount:','./openchannelAccount.events','save','update'];(function(_0x4e9311,_0x1b4345){var _0x144a92=function(_0x17a302){while(--_0x17a302){_0x4e9311['push'](_0x4e9311['shift']());}};_0x144a92(++_0x1b4345);}(_0xc8fd,0x17e));var _0xdc8f=function(_0x55c5f7,_0x42aa06){_0x55c5f7=_0x55c5f7-0x0;var _0x35f640=_0xc8fd[_0x55c5f7];return _0x35f640;};'use strict';var OpenchannelAccountEvents=require(_0xdc8f('0x0'));var events=[_0xdc8f('0x1'),'remove',_0xdc8f('0x2')];function createListener(_0x3d970c,_0x25d86a){return function(_0x304403){_0x25d86a[_0xdc8f('0x3')](_0x3d970c,_0x304403);};}function removeListener(_0x184990,_0x2687a1){return function(){OpenchannelAccountEvents['removeListener'](_0x184990,_0x2687a1);};}exports['register']=function(_0x163cbd){for(var _0x451fdc=0x0,_0x4d1dde=events['length'];_0x451fdc<_0x4d1dde;_0x451fdc++){var _0xc6f624=events[_0x451fdc];var _0x1e84dc=createListener(_0xdc8f('0x4')+_0xc6f624,_0x163cbd);OpenchannelAccountEvents['on'](_0xc6f624,_0x1e84dc);}};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js
index a7f6420..69cc5e1 100644
--- a/server/api/openchannelApplication/index.js
+++ b/server/api/openchannelApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1645=['update','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1645,0x141));var _0x5164=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1645[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5164('0x0'));var util=require('util');var path=require(_0x5164('0x1'));var timeout=require('connect-timeout');var express=require(_0x5164('0x2'));var router=express[_0x5164('0x3')]();var auth=require(_0x5164('0x4'));var interaction=require(_0x5164('0x5'));var config=require(_0x5164('0x6'));var controller=require(_0x5164('0x7'));router[_0x5164('0x8')]('/',auth[_0x5164('0x9')](),controller[_0x5164('0xa')]);router['get'](_0x5164('0xb'),auth[_0x5164('0x9')](),controller['show']);router[_0x5164('0xc')]('/',auth[_0x5164('0x9')](),controller[_0x5164('0xd')]);router[_0x5164('0xe')](_0x5164('0xb'),auth[_0x5164('0x9')](),controller[_0x5164('0xf')]);router['delete'](_0x5164('0xb'),auth[_0x5164('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x7514=['destroy','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete'];(function(_0x15661d,_0x25f53a){var _0x366c22=function(_0x1f3ebf){while(--_0x1f3ebf){_0x15661d['push'](_0x15661d['shift']());}};_0x366c22(++_0x25f53a);}(_0x7514,0x112));var _0x4751=function(_0x3189d3,_0x7879d6){_0x3189d3=_0x3189d3-0x0;var _0x2c813d=_0x7514[_0x3189d3];return _0x2c813d;};'use strict';var multer=require(_0x4751('0x0'));var util=require('util');var path=require(_0x4751('0x1'));var timeout=require(_0x4751('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4751('0x3'));var config=require(_0x4751('0x4'));var controller=require(_0x4751('0x5'));router[_0x4751('0x6')]('/',auth[_0x4751('0x7')](),controller[_0x4751('0x8')]);router[_0x4751('0x6')]('/:id',auth[_0x4751('0x7')](),controller[_0x4751('0x9')]);router[_0x4751('0xa')]('/',auth['isAuthenticated'](),controller[_0x4751('0xb')]);router['put'](_0x4751('0xc'),auth[_0x4751('0x7')](),controller[_0x4751('0xd')]);router[_0x4751('0xe')](_0x4751('0xc'),auth['isAuthenticated'](),controller[_0x4751('0xf')]);module[_0x4751('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js
index 0255a3a..24cc3fd 100644
--- a/server/api/openchannelApplication/openchannelApplication.attributes.js
+++ b/server/api/openchannelApplication/openchannelApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf5c0=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x1c3ecd,_0x14932c){var _0xdfe805=function(_0x160421){while(--_0x160421){_0x1c3ecd['push'](_0x1c3ecd['shift']());}};_0xdfe805(++_0x14932c);}(_0xf5c0,0x9d));var _0x0f5c=function(_0x4ffa03,_0x363a82){_0x4ffa03=_0x4ffa03-0x0;var _0x30d661=_0xf5c0[_0x4ffa03];return _0x30d661;};'use strict';var Sequelize=require(_0x0f5c('0x0'));module[_0x0f5c('0x1')]={'priority':{'type':Sequelize[_0x0f5c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0f5c('0x3')],'allowNull':![],'defaultValue':_0x0f5c('0x4')},'appdata':{'type':Sequelize[_0x0f5c('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0f5c('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xe0dc=['sequelize','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x35d134,_0x16d7b3){var _0x170083=function(_0x1285b4){while(--_0x1285b4){_0x35d134['push'](_0x35d134['shift']());}};_0x170083(++_0x16d7b3);}(_0xe0dc,0x190));var _0xce0d=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xe0dc[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0xce0d('0x0'));module['exports']={'priority':{'type':Sequelize[_0xce0d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xce0d('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xce0d('0x3')]()},'description':{'type':Sequelize[_0xce0d('0x2')]},'interval':{'type':Sequelize[_0xce0d('0x2')],'defaultValue':_0xce0d('0x4')}};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js
index cff16d0..8bd3fad 100644
--- a/server/api/openchannelApplication/openchannelApplication.controller.js
+++ b/server/api/openchannelApplication/openchannelApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x1fe322,_0x4cd748){var _0x2908f0=function(_0x4d3621){while(--_0x4d3621){_0x1fe322['push'](_0x1fe322['shift']());}};_0x2908f0(++_0x4cd748);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['OpenchannelApplication'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['OpenchannelApplication'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};
\ No newline at end of file
+var _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x5ee7b2,_0xea7ca9){var _0x2bd7d6=function(_0x1f0f22){while(--_0x1f0f22){_0x5ee7b2['push'](_0x5ee7b2['shift']());}};_0x2bd7d6(++_0xea7ca9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['OpenchannelApplication'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['OpenchannelApplication'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js
index 793e16f..5c6f604 100644
--- a/server/api/openchannelApplication/openchannelApplication.model.js
+++ b/server/api/openchannelApplication/openchannelApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b48=['request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x313009,_0x95d7aa){var _0x45de67=function(_0x222d84){while(--_0x222d84){_0x313009['push'](_0x313009['shift']());}};_0x45de67(++_0x95d7aa);}(_0x4b48,0x190));var _0x84b4=function(_0x3cd957,_0x46dd8d){_0x3cd957=_0x3cd957-0x0;var _0x21801b=_0x4b48[_0x3cd957];return _0x21801b;};'use strict';var _=require(_0x84b4('0x0'));var util=require(_0x84b4('0x1'));var logger=require(_0x84b4('0x2'))(_0x84b4('0x3'));var moment=require(_0x84b4('0x4'));var BPromise=require(_0x84b4('0x5'));var rp=require(_0x84b4('0x6'));var fs=require('fs');var path=require(_0x84b4('0x7'));var rimraf=require(_0x84b4('0x8'));var config=require(_0x84b4('0x9'));var attributes=require('./openchannelApplication.attributes');module[_0x84b4('0xa')]=function(_0x39c5d5,_0x1ae2b3){return _0x39c5d5[_0x84b4('0xb')](_0x84b4('0xc'),attributes,{'tableName':_0x84b4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xa79e=['../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x15adc6,_0xbc8322){var _0x3bb841=function(_0x16945d){while(--_0x16945d){_0x15adc6['push'](_0x15adc6['shift']());}};_0x3bb841(++_0xbc8322);}(_0xa79e,0xf7));var _0xea79=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0xa79e[_0x2e249d];return _0x1faa37;};'use strict';var _=require(_0xea79('0x0'));var util=require('util');var logger=require(_0xea79('0x1'))(_0xea79('0x2'));var moment=require(_0xea79('0x3'));var BPromise=require(_0xea79('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xea79('0x5'));var config=require(_0xea79('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0xea79('0x7')]=function(_0x29907d,_0x5836de){return _0x29907d[_0xea79('0x8')](_0xea79('0x9'),attributes,{'tableName':_0xea79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js
index 5b77d25..0638ba3 100644
--- a/server/api/openchannelApplication/openchannelApplication.rpc.js
+++ b/server/api/openchannelApplication/openchannelApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa76a=['error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x126867,_0x1f8092){var _0x586c0c=function(_0x12af44){while(--_0x12af44){_0x126867['push'](_0x126867['shift']());}};_0x586c0c(++_0x1f8092);}(_0xa76a,0xad));var _0xaa76=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0xa76a[_0x3d4876];return _0x58ca9d;};'use strict';var _=require('lodash');var util=require(_0xaa76('0x0'));var moment=require(_0xaa76('0x1'));var BPromise=require(_0xaa76('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa76('0x3'));var db=require(_0xaa76('0x4'))['db'];var utils=require(_0xaa76('0x5'));var logger=require(_0xaa76('0x6'))(_0xaa76('0x7'));var config=require(_0xaa76('0x8'));var jayson=require(_0xaa76('0x9'));var client=jayson[_0xaa76('0xa')][_0xaa76('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b869a,_0x5e1f71,_0x3f8790){return new BPromise(function(_0x3a8c79,_0x3717ba){return client[_0xaa76('0xc')](_0x3b869a,_0x3f8790)[_0xaa76('0xd')](function(_0x53201b){logger[_0xaa76('0xe')](_0xaa76('0xf'),_0x5e1f71,_0xaa76('0x10'));logger[_0xaa76('0x11')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x5e1f71,_0xaa76('0x10'),JSON[_0xaa76('0x12')](_0x53201b));if(_0x53201b[_0xaa76('0x13')]){if(_0x53201b[_0xaa76('0x13')][_0xaa76('0x14')]===0x1f4){logger[_0xaa76('0x13')](_0xaa76('0xf'),_0x5e1f71,_0x53201b[_0xaa76('0x13')][_0xaa76('0x15')]);return _0x3717ba(_0x53201b[_0xaa76('0x13')][_0xaa76('0x15')]);}logger[_0xaa76('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x5e1f71,_0x53201b[_0xaa76('0x13')]['message']);return _0x3a8c79(_0x53201b['error'][_0xaa76('0x15')]);}else{logger[_0xaa76('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x5e1f71,'request\x20sent');_0x3a8c79(_0x53201b[_0xaa76('0x16')][_0xaa76('0x15')]);}})['catch'](function(_0x521a8d){logger[_0xaa76('0x13')](_0xaa76('0xf'),_0x5e1f71,_0x521a8d);_0x3717ba(_0x521a8d);});});}exports[_0xaa76('0x17')]=function(_0x1c48c9){var _0x6837c7=this;return new Promise(function(_0x3f8f0e,_0x53f086){return db[_0xaa76('0x18')][_0xaa76('0x19')](_0x1c48c9[_0xaa76('0x1a')],{'raw':_0x1c48c9[_0xaa76('0x1b')]?_0x1c48c9[_0xaa76('0x1b')][_0xaa76('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c48c9[_0xaa76('0x1b')]?_0x1c48c9['options'][_0xaa76('0x1d')]||null:null,'attributes':_0x1c48c9['options']?_0x1c48c9[_0xaa76('0x1b')]['attributes']||null:null,'limit':_0x1c48c9[_0xaa76('0x1b')]?_0x1c48c9['options'][_0xaa76('0x1e')]||null:null})['then'](function(_0x291c18){logger[_0xaa76('0xe')](_0xaa76('0x17'),_0x1c48c9);logger[_0xaa76('0x11')](_0xaa76('0x17'),_0x1c48c9,JSON[_0xaa76('0x12')](_0x291c18));_0x3f8f0e(_0x291c18);})[_0xaa76('0x1f')](function(_0x543a84){logger[_0xaa76('0x13')](_0xaa76('0x17'),_0x543a84[_0xaa76('0x15')],_0x1c48c9);_0x53f086(_0x6837c7[_0xaa76('0x13')](0x1f4,_0x543a84[_0xaa76('0x15')]));});});};
\ No newline at end of file
+var _0x28b2=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelApplication,\x20%s,\x20%s','message','OpenchannelApplication','update','options','raw','where','attributes','limit','UpdateOpenchannelApplication','catch','lodash','util'];(function(_0x5bdf0b,_0x30163a){var _0x4103b1=function(_0x5be011){while(--_0x5be011){_0x5bdf0b['push'](_0x5bdf0b['shift']());}};_0x4103b1(++_0x30163a);}(_0x28b2,0xb8));var _0x228b=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x28b2[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x228b('0x0'));var util=require(_0x228b('0x1'));var moment=require(_0x228b('0x2'));var BPromise=require('bluebird');var rs=require(_0x228b('0x3'));var fs=require('fs');var Redis=require(_0x228b('0x4'));var db=require(_0x228b('0x5'))['db'];var utils=require(_0x228b('0x6'));var logger=require(_0x228b('0x7'))(_0x228b('0x8'));var config=require(_0x228b('0x9'));var jayson=require(_0x228b('0xa'));var client=jayson[_0x228b('0xb')][_0x228b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e8e9a,_0x4ce985,_0x25549b){return new BPromise(function(_0x3f2e4f,_0x56916c){return client['request'](_0x5e8e9a,_0x25549b)[_0x228b('0xd')](function(_0x535d84){logger[_0x228b('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x4ce985,_0x228b('0xf'));logger[_0x228b('0x10')](_0x228b('0x11'),_0x4ce985,_0x228b('0xf'),JSON[_0x228b('0x12')](_0x535d84));if(_0x535d84['error']){if(_0x535d84[_0x228b('0x13')]['code']===0x1f4){logger[_0x228b('0x13')](_0x228b('0x14'),_0x4ce985,_0x535d84[_0x228b('0x13')]['message']);return _0x56916c(_0x535d84['error'][_0x228b('0x15')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x4ce985,_0x535d84[_0x228b('0x13')][_0x228b('0x15')]);return _0x3f2e4f(_0x535d84['error'][_0x228b('0x15')]);}else{logger[_0x228b('0xe')](_0x228b('0x14'),_0x4ce985,_0x228b('0xf'));_0x3f2e4f(_0x535d84['result'][_0x228b('0x15')]);}})['catch'](function(_0x57f386){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x4ce985,_0x57f386);_0x56916c(_0x57f386);});});}exports['UpdateOpenchannelApplication']=function(_0x27fc05){var _0x1739e2=this;return new Promise(function(_0x39ae0b,_0x244086){return db[_0x228b('0x16')][_0x228b('0x17')](_0x27fc05['body'],{'raw':_0x27fc05[_0x228b('0x18')]?_0x27fc05[_0x228b('0x18')][_0x228b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27fc05[_0x228b('0x18')]?_0x27fc05[_0x228b('0x18')][_0x228b('0x1a')]||null:null,'attributes':_0x27fc05[_0x228b('0x18')]?_0x27fc05['options'][_0x228b('0x1b')]||null:null,'limit':_0x27fc05[_0x228b('0x18')]?_0x27fc05['options'][_0x228b('0x1c')]||null:null})['then'](function(_0x53a655){logger[_0x228b('0xe')](_0x228b('0x1d'),_0x27fc05);logger[_0x228b('0x10')](_0x228b('0x1d'),_0x27fc05,JSON[_0x228b('0x12')](_0x53a655));_0x39ae0b(_0x53a655);})[_0x228b('0x1e')](function(_0x51456a){logger[_0x228b('0x13')](_0x228b('0x1d'),_0x51456a['message'],_0x27fc05);_0x244086(_0x1739e2[_0x228b('0x13')](0x1f4,_0x51456a[_0x228b('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js
index 2b75131..cce6cd3 100644
--- a/server/api/openchannelInteraction/index.js
+++ b/server/api/openchannelInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f10=['../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','/describe','describe','/:id','show','get','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','removeTags','exports','multer','util','connect-timeout','express','Router'];(function(_0x5dd469,_0x2a66c4){var _0x59f4b4=function(_0x5a47fa){while(--_0x5a47fa){_0x5dd469['push'](_0x5dd469['shift']());}};_0x59f4b4(++_0x2a66c4);}(_0x5f10,0x1db));var _0x05f1=function(_0x20a761,_0x2ffd85){_0x20a761=_0x20a761-0x0;var _0x284a38=_0x5f10[_0x20a761];return _0x284a38;};'use strict';var multer=require(_0x05f1('0x0'));var util=require(_0x05f1('0x1'));var path=require('path');var timeout=require(_0x05f1('0x2'));var express=require(_0x05f1('0x3'));var router=express[_0x05f1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x05f1('0x5'));var config=require(_0x05f1('0x6'));var controller=require(_0x05f1('0x7'));router['get']('/',auth[_0x05f1('0x8')](),controller[_0x05f1('0x9')]);router['get'](_0x05f1('0xa'),auth[_0x05f1('0x8')](),controller[_0x05f1('0xb')]);router['get'](_0x05f1('0xc'),auth[_0x05f1('0x8')](),controller[_0x05f1('0xd')]);router[_0x05f1('0xe')](_0x05f1('0xf'),auth[_0x05f1('0x8')](),controller[_0x05f1('0x10')]);router[_0x05f1('0xe')](_0x05f1('0x11'),auth[_0x05f1('0x8')](),controller[_0x05f1('0x12')]);router[_0x05f1('0x13')]('/',auth[_0x05f1('0x8')](),controller[_0x05f1('0x14')]);router[_0x05f1('0x13')](_0x05f1('0xf'),auth[_0x05f1('0x8')](),controller['addMessage']);router['post'](_0x05f1('0x15'),auth['isAuthenticated'](),interaction[_0x05f1('0x16')](_0x05f1('0x17'),_0x05f1('0x18')),controller[_0x05f1('0x19')]);router[_0x05f1('0x1a')](_0x05f1('0xc'),auth[_0x05f1('0x8')](),interaction[_0x05f1('0x16')](_0x05f1('0x17'),_0x05f1('0x1b')),controller[_0x05f1('0x1c')]);router[_0x05f1('0x1d')](_0x05f1('0xc'),auth['isAuthenticated'](),interaction['tracked']('openchannel','openchannelinteraction:destroy'),controller['destroy']);router[_0x05f1('0x1d')](_0x05f1('0x15'),auth[_0x05f1('0x8')](),controller[_0x05f1('0x1e')]);module[_0x05f1('0x1f')]=router;
\ No newline at end of file
+var _0x9664=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','openchannel','addTags','openchannelinteraction:update','openchannelinteraction:destroy','destroy','delete','removeTags','util'];(function(_0x5ad161,_0x1fe6f0){var _0x300970=function(_0x5b5402){while(--_0x5b5402){_0x5ad161['push'](_0x5ad161['shift']());}};_0x300970(++_0x1fe6f0);}(_0x9664,0xae));var _0x4966=function(_0x535ad6,_0x22b56c){_0x535ad6=_0x535ad6-0x0;var _0x12d4f6=_0x9664[_0x535ad6];return _0x12d4f6;};'use strict';var multer=require('multer');var util=require(_0x4966('0x0'));var path=require(_0x4966('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4966('0x2')]();var auth=require(_0x4966('0x3'));var interaction=require(_0x4966('0x4'));var config=require(_0x4966('0x5'));var controller=require('./openchannelInteraction.controller');router[_0x4966('0x6')]('/',auth[_0x4966('0x7')](),controller[_0x4966('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x4966('0x9')]);router[_0x4966('0x6')](_0x4966('0xa'),auth[_0x4966('0x7')](),controller['show']);router[_0x4966('0x6')](_0x4966('0xb'),auth[_0x4966('0x7')](),controller['getMessages']);router[_0x4966('0x6')](_0x4966('0xc'),auth[_0x4966('0x7')](),controller['download']);router[_0x4966('0xd')]('/',auth[_0x4966('0x7')](),controller[_0x4966('0xe')]);router[_0x4966('0xd')]('/:id/messages',auth['isAuthenticated'](),controller[_0x4966('0xf')]);router[_0x4966('0xd')](_0x4966('0x10'),auth[_0x4966('0x7')](),interaction[_0x4966('0x11')](_0x4966('0x12'),'openchannelinteraction:addtags'),controller[_0x4966('0x13')]);router['put'](_0x4966('0xa'),auth['isAuthenticated'](),interaction[_0x4966('0x11')](_0x4966('0x12'),_0x4966('0x14')),controller['update']);router['delete'](_0x4966('0xa'),auth[_0x4966('0x7')](),interaction[_0x4966('0x11')](_0x4966('0x12'),_0x4966('0x15')),controller[_0x4966('0x16')]);router[_0x4966('0x17')](_0x4966('0x10'),auth[_0x4966('0x7')](),controller[_0x4966('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js
index 3296f24..c8632c2 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.attributes.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x66d9=['exports','BOOLEAN','DATE','STRING','sequelize'];(function(_0x2d17b0,_0x773ed4){var _0x3af5be=function(_0x3b7704){while(--_0x3b7704){_0x2d17b0['push'](_0x2d17b0['shift']());}};_0x3af5be(++_0x773ed4);}(_0x66d9,0x1e9));var _0x966d=function(_0x2c120d,_0x283db8){_0x2c120d=_0x2c120d-0x0;var _0x354271=_0x66d9[_0x2c120d];return _0x354271;};'use strict';var Sequelize=require(_0x966d('0x0'));module[_0x966d('0x1')]={'closed':{'type':Sequelize[_0x966d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x966d('0x3')]},'disposition':{'type':Sequelize[_0x966d('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x966d('0x4')]},'externalUrl':{'type':Sequelize[_0x966d('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x966d('0x4')]}};
\ No newline at end of file
+var _0x3423=['out','sequelize','exports','DATE','STRING'];(function(_0x265b4a,_0x286538){var _0x58f7e2=function(_0x3a1662){while(--_0x3a1662){_0x265b4a['push'](_0x265b4a['shift']());}};_0x58f7e2(++_0x286538);}(_0x3423,0x1f0));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3342('0x0'));module[_0x3342('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3342('0x2')]},'disposition':{'type':Sequelize[_0x3342('0x3')]},'note':{'type':Sequelize[_0x3342('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x3342('0x3')]},'externalUrl':{'type':Sequelize[_0x3342('0x3')]},'lastMsgAt':{'type':Sequelize[_0x3342('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3342('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3342('0x3')]}};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js
index e1dac72..b4cbf7f 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.controller.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe5d4=['setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','root','files','tmp','server','attachments','Messages','direction','User','Contact','firstName','lastName','Attachment','OpenchannelAccount','Account','Owner','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Openchannel','YYYY-MM-DD','mkdirSync','N.A.','closed','closedAt','disposition','threadId','Public','Private','existsSync','createWriteStream','basename','out','System','renderFile','downloadInteraction.html','create','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','name','send','index','OpenchannelInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','pick','select','field','tools_tags','COUNT(*)','from','openchannel_messages','where','me.read\x20=\x20false','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','ui.UserId\x20=\x20i.UserId','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','expr','advancedFilter','createdAt','value','startOf','utc','format','endOf','day','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','Messages.count','\x20IN\x20?','and','tableAlias','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','map','hasOwnProperty','filter','isNil','isEmpty','forEach','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','replace','\x27\x27\x27\x27','isNumeric','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','read','%s\x20=\x200','%s\x20>\x200','having','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','`Messages.count`\x20=\x200','sequelize','count','keyBy','a.key','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','u.fullname','User.name','TagIds','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','Tags','split','catch','show','merge','find','body','params','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','includeAll'];(function(_0x255caf,_0x2f893b){var _0x25e862=function(_0xffbed9){while(--_0xffbed9){_0x255caf['push'](_0x255caf['shift']());}};_0x25e862(++_0x2f893b);}(_0xe5d4,0x110));var _0x4e5d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe5d4[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x4e5d('0x0'));var emlformat=require(_0x4e5d('0x1'));var rimraf=require(_0x4e5d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4e5d('0x3'));var moment=require(_0x4e5d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4e5d('0x5'));var util=require(_0x4e5d('0x6'));var path=require(_0x4e5d('0x7'));var sox=require(_0x4e5d('0x8'));var csv=require(_0x4e5d('0x9'));var ejs=require(_0x4e5d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4e5d('0xb'));var crypto=require(_0x4e5d('0xc'));var jsforce=require(_0x4e5d('0xd'));var deskjs=require(_0x4e5d('0xe'));var toCsv=require(_0x4e5d('0x9'));var querystring=require('querystring');var Papa=require(_0x4e5d('0xf'));var Redis=require(_0x4e5d('0x10'));var authService=require(_0x4e5d('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4e5d('0x12'));var logger=require('../../config/logger')(_0x4e5d('0x13'));var utils=require('../../config/utils');var config=require(_0x4e5d('0x14'));var db=require(_0x4e5d('0x15'))['db'];config[_0x4e5d('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4e5d('0x17'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x4e5d('0x18')](socket);function respondWithStatusCode(_0x41f799,_0x571651){_0x571651=_0x571651||0xcc;return function(_0x447d0b){if(_0x447d0b){return _0x41f799[_0x4e5d('0x19')](_0x571651);}return _0x41f799[_0x4e5d('0x1a')](_0x571651)[_0x4e5d('0x1b')]();};}function respondWithResult(_0x5c83fc,_0x217552){_0x217552=_0x217552||0xc8;return function(_0x138b06){if(_0x138b06){return _0x5c83fc['status'](_0x217552)['json'](_0x138b06);}};}function respondWithFilteredResult(_0x23f323,_0x4a4411){return function(_0x4b4ee2){if(_0x4b4ee2){var _0x2940d5=_0x4b4ee2['count'],_0xaae217=_0x4a4411['offset'],_0x44b6f7=_0x4a4411['offset']+_0x4a4411[_0x4e5d('0x1c')],_0x3af8b5;if(_0x44b6f7>=_0x2940d5){_0x44b6f7=_0x2940d5;_0x3af8b5=0xc8;}else{_0x3af8b5=0xce;}_0x23f323[_0x4e5d('0x1a')](_0x3af8b5);return _0x23f323[_0x4e5d('0x1d')](_0x4e5d('0x1e'),_0xaae217+'-'+_0x44b6f7+'/'+_0x2940d5)[_0x4e5d('0x1f')](_0x4b4ee2);}return null;};}function patchUpdates(_0x519184){return function(_0x286d75){try{jsonpatch[_0x4e5d('0x20')](_0x286d75,_0x519184,!![]);}catch(_0x46bd26){return BPromise[_0x4e5d('0x21')](_0x46bd26);}return _0x286d75[_0x4e5d('0x22')]();};}function saveUpdates(_0x500bdc,_0x220eb0){return function(_0x53cb98){if(_0x53cb98){return _0x53cb98[_0x4e5d('0x23')](_0x500bdc)['then'](function(_0x426a40){return _0x426a40;});}return null;};}function removeEntity(_0x565c2d,_0x2b3aa3){return function(_0x3450f4){if(_0x3450f4){return _0x3450f4[_0x4e5d('0x24')]()[_0x4e5d('0x25')](function(){_0x565c2d[_0x4e5d('0x1a')](0xcc)[_0x4e5d('0x1b')]();});}};}function handleEntityNotFound(_0x1d3cc0,_0x47817c){return function(_0x3cbcee){if(!_0x3cbcee){_0x1d3cc0[_0x4e5d('0x19')](0x194);}return _0x3cbcee;};}function handleError(_0x242bd9,_0x45898e){_0x45898e=_0x45898e||0x1f4;return function(_0x44b35e){logger['error'](_0x44b35e['stack']);if(_0x44b35e['name']){delete _0x44b35e[_0x4e5d('0x26')];}_0x242bd9[_0x4e5d('0x1a')](_0x45898e)[_0x4e5d('0x27')](_0x44b35e);};}exports[_0x4e5d('0x28')]=function(_0x2ba816,_0x49f888){var _0x4f9d30={},_0x2d5360={},_0x313f7d={'count':0x0,'rows':[]};var _0x3abb86=db[_0x4e5d('0x29')][_0x4e5d('0x2a')];_0x2d5360[_0x4e5d('0x2b')]=_[_0x4e5d('0x2c')](_0x3abb86);_0x2d5360['query']=_['keys'](_0x2ba816[_0x4e5d('0x2d')]);_0x2d5360[_0x4e5d('0x2e')]=_[_0x4e5d('0x2f')](_0x2d5360[_0x4e5d('0x2b')],_0x2d5360['query']);_0x4f9d30[_0x4e5d('0x30')]=_['intersection'](_0x2d5360[_0x4e5d('0x2b')],qs[_0x4e5d('0x31')](_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x31')]));_0x4f9d30[_0x4e5d('0x30')]=_0x4f9d30[_0x4e5d('0x30')][_0x4e5d('0x32')]?_0x4f9d30['attributes']:_0x2d5360[_0x4e5d('0x2b')];if(!_0x2ba816[_0x4e5d('0x2d')]['hasOwnProperty'](_0x4e5d('0x33'))){_0x4f9d30[_0x4e5d('0x1c')]=qs[_0x4e5d('0x1c')](_0x2ba816['query'][_0x4e5d('0x1c')]);_0x4f9d30[_0x4e5d('0x34')]=qs[_0x4e5d('0x34')](_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x34')]);}_0x4f9d30[_0x4e5d('0x35')]=qs[_0x4e5d('0x36')](_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x36')]);_0x4f9d30['where']=qs[_0x4e5d('0x2e')](_[_0x4e5d('0x37')](_0x2ba816[_0x4e5d('0x2d')],_0x2d5360[_0x4e5d('0x2e')]));var _0x9097a3=[];var _0x32d435=squel[_0x4e5d('0x38')]()[_0x4e5d('0x39')]('id')['field'](_0x4e5d('0x26'))[_0x4e5d('0x39')]('color')['from'](_0x4e5d('0x3a'));var _0x2e252c=squel[_0x4e5d('0x38')]()[_0x4e5d('0x39')](_0x4e5d('0x3b'))[_0x4e5d('0x3c')](_0x4e5d('0x3d'),'me')['where']('me.OpenchannelInteractionId\x20=\x20i.id')[_0x4e5d('0x3e')]('me.direction\x20=\x20\x27in\x27')[_0x4e5d('0x3e')](_0x4e5d('0x3f'));var _0x5ee547=squel[_0x4e5d('0x38')]()[_0x4e5d('0x39')](_0x4e5d('0x40'))['field'](_0x4e5d('0x41'))[_0x4e5d('0x3c')](_0x4e5d('0x42'),'ui')[_0x4e5d('0x43')](_0x4e5d('0x44'),'u','u.id\x20=\x20ui.UserId');var _0x232ff7=squel[_0x4e5d('0x38')]()[_0x4e5d('0x3c')]('openchannel_interactions','i')[_0x4e5d('0x43')](_0x4e5d('0x42'),'ui',_0x4e5d('0x45'))[_0x4e5d('0x43')]('users','u',_0x4e5d('0x46'))[_0x4e5d('0x43')]('cm_contacts','c',_0x4e5d('0x47'))['left_join']('users','o',_0x4e5d('0x48'))['left_join'](_0x4e5d('0x49'),'a',_0x4e5d('0x4a'))['left_join']('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id');var _0xcf2e04=squel[_0x4e5d('0x4b')]();if(_0x2ba816['query'][_0x4e5d('0x4c')]){var _0x1d37f3=JSON['parse'](_0x2ba816['query']['advancedFilter']);_[_0x4e5d('0x2c')](_0x1d37f3)['forEach'](function(_0x3081ef){var _0x1c3670=_0x1d37f3[_0x3081ef];if(_0x3081ef===_0x4e5d('0x4d')){var _0x59b6cf=moment(_0x1c3670[_0x4e5d('0x4e')]['dateStart'])[_0x4e5d('0x4f')]('day')[_0x4e5d('0x50')]()[_0x4e5d('0x51')]();var _0x1041d1=moment(_0x1041d1)[_0x4e5d('0x50')]()[_0x4e5d('0x52')](_0x4e5d('0x53'))[_0x4e5d('0x51')]();_0xcf2e04['and'](_0x4e5d('0x54'),_0x59b6cf,_0x1041d1);}else{if(_[_0x4e5d('0x55')](_0x1c3670[_0x4e5d('0x56')])){_0x1c3670[_0x4e5d('0x56')]['forEach'](function(_0x358cab){switch(_0x1c3670[_0x4e5d('0x56')]['value']){case'IS':if(_0x3081ef!==_0x4e5d('0x57')&&_0x3081ef!==_0x4e5d('0x58')){if(_[_0x4e5d('0x55')](_0x1c3670[_0x4e5d('0x4e')])&&_0x1c3670[_0x4e5d('0x4e')][_0x4e5d('0x32')]>0x1){_0xcf2e04['and'](_0x1c3670['tableAlias']+'.'+_0x3081ef+_0x4e5d('0x59'),_0x1c3670[_0x4e5d('0x4e')]);}else{_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x5c'),_0x1c3670[_0x4e5d('0x4e')][0x0]);}}break;case'=':_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x5c'),_0x1c3670[_0x4e5d('0x4e')]);break;case _0x4e5d('0x5d'):if(_0x3081ef===_0x4e5d('0x5e')){_0xcf2e04[_0x4e5d('0x5a')]('c.firstName'+_0x4e5d('0x5f'),'%'+_0x1c3670[_0x4e5d('0x4e')]+'%');_0xcf2e04['or'](_0x4e5d('0x60')+_0x4e5d('0x5f'),'%'+_0x1c3670[_0x4e5d('0x4e')]+'%');_0xcf2e04['or'](_0x4e5d('0x61')+'\x20LIKE\x20?','%'+_0x1c3670['value']+'%');}else{_0xcf2e04['and'](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+'\x20LIKE\x20?','%'+_0x1c3670[_0x4e5d('0x4e')]+'%');}break;case'>':_0xcf2e04['and'](_0x1c3670['tableAlias']+'.'+_0x3081ef+_0x4e5d('0x62'),_0x1c3670[_0x4e5d('0x4e')]);break;case'<':_0xcf2e04['and'](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x63'),_0x1c3670[_0x4e5d('0x4e')]);break;}});}else{switch(_0x1c3670['condition']['value']){case'IS':if(_0x3081ef!==_0x4e5d('0x57')&&_0x3081ef!==_0x4e5d('0x58')){if(_[_0x4e5d('0x55')](_0x1c3670['value'])&&_0x1c3670[_0x4e5d('0x4e')][_0x4e5d('0x32')]>0x1){_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x59'),_0x1c3670['value']);}else{_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x5c'),_0x1c3670[_0x4e5d('0x4e')][0x0]);}}break;case'=':_0xcf2e04['and'](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x5c'),_0x1c3670['value']);break;case'LIKE':if(_0x3081ef===_0x4e5d('0x5e')){_0xcf2e04[_0x4e5d('0x5a')]('c.firstName'+'\x20LIKE\x20?','%'+_0x1c3670[_0x4e5d('0x4e')]+'%');_0xcf2e04['or']('c.lastName'+_0x4e5d('0x5f'),'%'+_0x1c3670[_0x4e5d('0x4e')]+'%');_0xcf2e04['or']('c.email'+_0x4e5d('0x5f'),'%'+_0x1c3670[_0x4e5d('0x4e')]+'%');}else{_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670['tableAlias']+'.'+_0x3081ef+'\x20LIKE\x20?','%'+_0x1c3670['value']+'%');}break;case'>':_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670['tableAlias']+'.'+_0x3081ef+_0x4e5d('0x62'),_0x1c3670['value']);break;case'<':_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x63'),_0x1c3670['value']);break;}}}});}else{var _0x1d7c92=_(Object['keys'](_0x2ba816[_0x4e5d('0x2d')]))[_0x4e5d('0x64')](function(_0x4fd737){return _0x3abb86[_0x4e5d('0x65')](_0x4fd737)?_0x4fd737:undefined;})[_0x4e5d('0x66')](function(_0x265724){return!_[_0x4e5d('0x67')](_0x265724);})['value']();if(!_[_0x4e5d('0x68')](_0x1d7c92)){_0x1d7c92[_0x4e5d('0x69')](function(_0x51221c){if(_0x51221c===_0x4e5d('0x6a')){_0x232ff7['where'](_0x4e5d('0x6b'),[][_0x4e5d('0x6c')](_0x2ba816[_0x4e5d('0x2d')][_0x51221c]));}else if(_0x51221c===_0x4e5d('0x4d')){var _0x12c9d2=JSON[_0x4e5d('0x6d')](_0x2ba816[_0x4e5d('0x2d')][_0x51221c])[_0x4e5d('0x6e')];var _0x38c352=JSON[_0x4e5d('0x6d')](_0x2ba816['query'][_0x51221c])['$lte'];_0x232ff7['where'](_0x4e5d('0x54'),_0x12c9d2,_0x38c352);}else{_0x232ff7[_0x4e5d('0x3e')]('i.'+_0x51221c+_0x4e5d('0x5c'),_0x2ba816[_0x4e5d('0x2d')][_0x51221c]);}});}if(_0x2ba816['query'][_0x4e5d('0x66')]){var _0x1b2bff=_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x66')][_0x4e5d('0x6f')]('\x5c','\x5c\x5c')[_0x4e5d('0x6f')]('\x27\x27',_0x4e5d('0x70'));if(qs[_0x4e5d('0x71')](_0x1b2bff)){_0xcf2e04['or']('i.id\x20LIKE\x20?',_0x1b2bff+'%');}else{var _0x552604=[];_0x1b2bff['split']('\x20')[_0x4e5d('0x69')](function(_0x4d4097){_0x552604[_0x4e5d('0x72')]('+'+_0x4d4097[_0x4e5d('0x73')]());});var _0x566ed7=_0x552604[_0x4e5d('0x74')]('\x20');_0xcf2e04['or'](_0x4e5d('0x75'),_0x566ed7)['or'](_0x4e5d('0x76'),_0x1b2bff+'%')['or'](_0x4e5d('0x77'),_0x1b2bff+'%');}}}_0x232ff7[_0x4e5d('0x3e')](_0xcf2e04);if(_0x4f9d30[_0x4e5d('0x35')]){_0x4f9d30[_0x4e5d('0x35')][_0x4e5d('0x69')](function(_0x446456){_0x232ff7[_0x4e5d('0x35')]('i.'+_0x446456[0x0],_0x446456[0x1]==='DESC'?![]:!![]);});}_0x232ff7[_0x4e5d('0x78')]('i.id');var _0x36846c={'type':db[_0x4e5d('0x79')]['QueryTypes'][_0x4e5d('0x7a')],'raw':!![]};var _0x1d16b1=_0x232ff7['clone']()[_0x4e5d('0x39')]('COUNT(*)');if(!_0x2ba816[_0x4e5d('0x2d')]['advancedFilter']){if(_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x7b')]){if(_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x7b')]==0x1){_0x1d16b1[_0x4e5d('0x3e')](util[_0x4e5d('0x51')](_0x4e5d('0x7c'),_0x2e252c[_0x4e5d('0x73')]()));_0x232ff7['having']('`Messages.count`\x20=\x200');}else{_0x1d16b1[_0x4e5d('0x3e')](util[_0x4e5d('0x51')](_0x4e5d('0x7d'),_0x2e252c[_0x4e5d('0x73')]()));_0x232ff7[_0x4e5d('0x7e')](_0x4e5d('0x7f'));}}if(_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x80')]){var _0x3b860e=_['isArray'](_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x80')])?_0x2ba816['query'][_0x4e5d('0x80')]:new Array(_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x80')]);var _0x3d3e0d=squel[_0x4e5d('0x4b')]();_0x3b860e['forEach'](function(_0x38a781){_0x3d3e0d['or'](_0x4e5d('0x81'),'%,'+_0x38a781+',%');});_0x232ff7['having'](_0x3d3e0d);_0x1d16b1[_0x4e5d('0x43')](_0x4e5d('0x82'),'it',_0x4e5d('0x83'));_0x1d16b1['left_join']('tools_tags','t',_0x4e5d('0x84'));_0x1d16b1[_0x4e5d('0x3e')](_0x4e5d('0x85'),_0x3b860e);}}else{var _0x1d37f3=JSON['parse'](_0x2ba816[_0x4e5d('0x2d')]['advancedFilter']);_[_0x4e5d('0x2c')](_0x1d37f3)[_0x4e5d('0x69')](function(_0x97a702){var _0x568137=_0x1d37f3[_0x97a702];if(_0x97a702===_0x4e5d('0x57')){var _0x55eb0a=_0x568137[_0x4e5d('0x4e')];var _0x5b5723=squel[_0x4e5d('0x4b')]();_0x55eb0a[_0x4e5d('0x69')](function(_0x49e28b){_0x5b5723['or'](_0x4e5d('0x81'),'%,'+_0x49e28b+',%');});_0x232ff7[_0x4e5d('0x7e')](_0x5b5723);_0x1d16b1[_0x4e5d('0x43')](_0x4e5d('0x86'),'it',_0x4e5d('0x87'));_0x1d16b1[_0x4e5d('0x43')](_0x4e5d('0x3a'),'t',_0x4e5d('0x84'));_0x1d16b1[_0x4e5d('0x3e')](_0x4e5d('0x85'),_0x55eb0a);}else if(_0x97a702===_0x4e5d('0x58')){if(_0x568137['value'][_0x4e5d('0x32')]===0x1){if(_0x568137['value'][0x0]===0x1){_0x1d16b1[_0x4e5d('0x3e')](util['format']('%s\x20=\x200',_0x2e252c[_0x4e5d('0x73')]()));_0x232ff7[_0x4e5d('0x7e')](_0x4e5d('0x88'));}else{_0x1d16b1[_0x4e5d('0x3e')](util[_0x4e5d('0x51')]('%s\x20>\x200',_0x2e252c[_0x4e5d('0x73')]()));_0x232ff7[_0x4e5d('0x7e')](_0x4e5d('0x7f'));}}}});}db[_0x4e5d('0x89')][_0x4e5d('0x2d')](_0x1d16b1[_0x4e5d('0x73')](),_0x36846c)['then'](function(_0xd01027){_0x313f7d[_0x4e5d('0x8a')]=_0xd01027[_0x4e5d('0x32')];if(_0x313f7d['count']===0x0)return[];return db[_0x4e5d('0x89')][_0x4e5d('0x2d')](_0x32d435['toString'](),_0x36846c)['then'](function(_0x35090f){_0x9097a3=_[_0x4e5d('0x8b')](_0x35090f,'id');_0x36846c=_['merge'](_0x36846c,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x232ff7[_0x4e5d('0x39')](_0x2e252c,_0x4e5d('0x58'));_0x232ff7[_0x4e5d('0x39')](_0x4e5d('0x8c'),'Account.key');_0x232ff7['field']('i.*');_0x232ff7['field']('c.firstName','Contact.firstName');_0x232ff7['field'](_0x4e5d('0x60'),_0x4e5d('0x8d'));_0x232ff7['field'](_0x4e5d('0x61'),_0x4e5d('0x8e'));_0x232ff7[_0x4e5d('0x39')]('c.phone',_0x4e5d('0x8f'));_0x232ff7['field'](_0x4e5d('0x90'),_0x4e5d('0x91'));_0x232ff7['field'](_0x4e5d('0x92'),_0x4e5d('0x93'));_0x232ff7['field'](_0x4e5d('0x94'),_0x4e5d('0x95'));_0x232ff7[_0x4e5d('0x39')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4e5d('0x96'));_0x232ff7[_0x4e5d('0x43')]('openchannel_interaction_has_tags','it',_0x4e5d('0x83'));_0x232ff7[_0x4e5d('0x43')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x232ff7[_0x4e5d('0x1c')](_0x4f9d30[_0x4e5d('0x1c')]);_0x232ff7[_0x4e5d('0x34')](_0x4f9d30[_0x4e5d('0x34')]);return db[_0x4e5d('0x89')]['query'](_0x232ff7[_0x4e5d('0x73')](),_0x36846c);})['then'](function(_0x14b3e5){_0x5ee547[_0x4e5d('0x3e')](_0x4e5d('0x97'),_[_0x4e5d('0x64')](_0x14b3e5,'id'));return db[_0x4e5d('0x89')][_0x4e5d('0x2d')](_0x5ee547[_0x4e5d('0x73')](),_0x36846c)[_0x4e5d('0x25')](function(_0x1c2619){var _0x2ddef0=_['groupBy'](_0x1c2619,_0x4e5d('0x98'));_0x14b3e5[_0x4e5d('0x69')](function(_0x17014a){if(_0x2ddef0[_0x17014a['id']]){_0x17014a['Users']=_[_0x4e5d('0x64')](_0x2ddef0[_0x17014a['id']],function(_0x2385f0){return{'id':_0x2385f0['id']};});}if(_0x17014a[_0x4e5d('0x96')]){_0x17014a[_0x4e5d('0x99')]=[];_0x17014a[_0x4e5d('0x96')][_0x4e5d('0x9a')](',')[_0x4e5d('0x69')](function(_0x29c1aa){_0x17014a[_0x4e5d('0x99')][_0x4e5d('0x72')](_0x9097a3[_0x29c1aa]);});}delete _0x17014a[_0x4e5d('0x96')];});return _0x14b3e5;});});})[_0x4e5d('0x25')](function(_0x504614){_0x313f7d['rows']=_0x504614;return _0x313f7d;})[_0x4e5d('0x25')](respondWithFilteredResult(_0x49f888,_0x4f9d30))[_0x4e5d('0x9b')](handleError(_0x49f888,null));};exports[_0x4e5d('0x9c')]=function(_0x5e124d,_0x22107a){var _0x1d4f21={'raw':![],'where':{'id':_0x5e124d['params']['id']}},_0xc3e07a={};_0xc3e07a[_0x4e5d('0x2b')]=_['keys'](db[_0x4e5d('0x29')][_0x4e5d('0x2a')]);_0xc3e07a[_0x4e5d('0x2d')]=_['keys'](_0x5e124d['query']);_0xc3e07a['filters']=_[_0x4e5d('0x2f')](_0xc3e07a['model'],_0xc3e07a[_0x4e5d('0x2d')]);_0x1d4f21['attributes']=_['intersection'](_0xc3e07a[_0x4e5d('0x2b')],qs[_0x4e5d('0x31')](_0x5e124d[_0x4e5d('0x2d')]['fields']));_0x1d4f21['attributes']=_0x1d4f21['attributes'][_0x4e5d('0x32')]?_0x1d4f21[_0x4e5d('0x30')]:_0xc3e07a[_0x4e5d('0x2b')];if(_0x5e124d[_0x4e5d('0x2d')]['includeAll']){_0x1d4f21['include']=[{'all':!![]}];}_0x1d4f21=_[_0x4e5d('0x9d')]({},_0x1d4f21,_0x5e124d['options']);return db[_0x4e5d('0x29')][_0x4e5d('0x9e')](_0x1d4f21)[_0x4e5d('0x25')](handleEntityNotFound(_0x22107a,null))['then'](respondWithResult(_0x22107a,null))['catch'](handleError(_0x22107a,null));};exports['create']=function(_0x4a4bc8,_0x2688f5){return db[_0x4e5d('0x29')]['create'](_0x4a4bc8[_0x4e5d('0x9f')],{})['then'](respondWithResult(_0x2688f5,0xc9))[_0x4e5d('0x9b')](handleError(_0x2688f5,null));};exports[_0x4e5d('0x23')]=function(_0x1d639a,_0x415f4a){if(_0x1d639a[_0x4e5d('0x9f')]['id']){delete _0x1d639a[_0x4e5d('0x9f')]['id'];}return db[_0x4e5d('0x29')][_0x4e5d('0x9e')]({'where':{'id':_0x1d639a[_0x4e5d('0xa0')]['id']}})[_0x4e5d('0x25')](handleEntityNotFound(_0x415f4a,null))['then'](saveUpdates(_0x1d639a['body'],null))[_0x4e5d('0x25')](respondWithResult(_0x415f4a,null))['catch'](handleError(_0x415f4a,null));};exports[_0x4e5d('0x24')]=function(_0x1599ff,_0x569464){return db[_0x4e5d('0x29')]['find']({'where':{'id':_0x1599ff[_0x4e5d('0xa0')]['id']}})[_0x4e5d('0x25')](handleEntityNotFound(_0x569464,null))[_0x4e5d('0x25')](removeEntity(_0x569464,null))[_0x4e5d('0x9b')](handleError(_0x569464,null));};exports['describe']=function(_0x4b33ab,_0x398720){return db[_0x4e5d('0x29')][_0x4e5d('0xa1')]()[_0x4e5d('0x25')](respondWithResult(_0x398720,null))[_0x4e5d('0x9b')](handleError(_0x398720,null));};exports['addMessage']=function(_0x358655,_0x5beea3,_0xe7144f){return db[_0x4e5d('0xa2')][_0x4e5d('0x9e')]({'where':{'id':_0x358655['params']['id']}})[_0x4e5d('0x25')](handleEntityNotFound(_0x5beea3,null))[_0x4e5d('0x25')](function(_0x34ec7c){if(_0x34ec7c){return _0x34ec7c[_0x4e5d('0xa3')](_0x358655[_0x4e5d('0x9f')][_0x4e5d('0xa4')],_[_0x4e5d('0xa5')](_0x358655[_0x4e5d('0x9f')],[_0x4e5d('0xa4'),'id'])||{});}})[_0x4e5d('0x25')](respondWithResult(_0x5beea3,null))['catch'](handleError(_0x5beea3,null));};exports[_0x4e5d('0xa6')]=function(_0x32f737,_0x3fa8e4,_0x20f8e2){var _0x1dd564={'raw':![],'where':{}};var _0x4ed2fe={};var _0x5493ae={'count':0x0,'rows':[]};return db[_0x4e5d('0x29')]['findOne']({'where':{'id':_0x32f737[_0x4e5d('0xa0')]['id']}})[_0x4e5d('0x25')](handleEntityNotFound(_0x3fa8e4,null))[_0x4e5d('0x25')](function(_0x1c7792){if(_0x1c7792){_0x4ed2fe[_0x4e5d('0x2b')]=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x4ed2fe['query']=_[_0x4e5d('0x2c')](_0x32f737[_0x4e5d('0x2d')]);_0x4ed2fe[_0x4e5d('0x2e')]=_[_0x4e5d('0x2f')](_0x4ed2fe[_0x4e5d('0x2b')],_0x4ed2fe['query']);_0x1dd564[_0x4e5d('0x30')]=_[_0x4e5d('0x2f')](_0x4ed2fe[_0x4e5d('0x2b')],qs[_0x4e5d('0x31')](_0x32f737[_0x4e5d('0x2d')]['fields']));_0x1dd564[_0x4e5d('0x30')]=_0x1dd564[_0x4e5d('0x30')][_0x4e5d('0x32')]?_0x1dd564[_0x4e5d('0x30')]:_0x4ed2fe[_0x4e5d('0x2b')];if(!_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x65')](_0x4e5d('0x33'))){_0x1dd564[_0x4e5d('0x1c')]=qs[_0x4e5d('0x1c')](_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x1c')]);_0x1dd564[_0x4e5d('0x34')]=qs[_0x4e5d('0x34')](_0x32f737['query'][_0x4e5d('0x34')]);}_0x1dd564[_0x4e5d('0x35')]=qs[_0x4e5d('0x36')](_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x36')]);_0x1dd564[_0x4e5d('0x3e')]=qs[_0x4e5d('0x2e')](_[_0x4e5d('0x37')](_0x32f737[_0x4e5d('0x2d')],_0x4ed2fe['filters']));_0x1dd564[_0x4e5d('0x3e')]['OpenchannelInteractionId']=_0x1c7792['id'];if(_0x32f737['query']['filter']){_0x1dd564[_0x4e5d('0x3e')]=_['merge'](_0x1dd564[_0x4e5d('0x3e')],{'$or':_[_0x4e5d('0x64')](_0x1dd564['attributes'],function(_0x3b4e03){var _0x4ffa8a={};_0x4ffa8a[_0x3b4e03]={'$like':'%'+_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x66')]+'%'};return _0x4ffa8a;})});}if(_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x6e')]){var _0x12acee=_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x6e')]['split'](',');var _0x175434={};_0x175434[_0x12acee[0x0]]={'$gte':moment(_0x12acee[0x1])[_0x4e5d('0x51')](_0x4e5d('0xa7'))};_0x1dd564[_0x4e5d('0x3e')]=_['merge'](_0x1dd564[_0x4e5d('0x3e')],_0x175434);}_0x1dd564=_[_0x4e5d('0x9d')]({},_0x1dd564,_0x32f737[_0x4e5d('0xa8')]);return db[_0x4e5d('0xa2')][_0x4e5d('0x8a')]({'where':_0x1dd564[_0x4e5d('0x3e')]})[_0x4e5d('0x25')](function(_0x578e0d){_0x5493ae['count']=_0x578e0d;if(_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0xa9')]){_0x1dd564['include']=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x1dd564);})[_0x4e5d('0x25')](function(_0x175116){_0x5493ae['rows']=_0x175116;return _0x5493ae;});}})[_0x4e5d('0x25')](respondWithFilteredResult(_0x3fa8e4,_0x1dd564))['catch'](handleError(_0x3fa8e4,null));};exports['addTags']=function(_0x4d0fc6,_0x4b3248,_0x4ccf59){return db[_0x4e5d('0x29')][_0x4e5d('0x9e')]({'where':{'id':_0x4d0fc6[_0x4e5d('0xa0')]['id']}})['then'](handleEntityNotFound(_0x4b3248,null))['then'](function(_0x34ceda){if(_0x34ceda){return _0x34ceda[_0x4e5d('0xaa')](_0x4d0fc6['body'][_0x4e5d('0xa4')],_['omit'](_0x4d0fc6[_0x4e5d('0x9f')],[_0x4e5d('0xa4'),'id'])||{})[_0x4e5d('0xab')](function(){return db[_0x4e5d('0xac')]['findAll']({'attributes':['id',_0x4e5d('0x26'),_0x4e5d('0xad')],'where':{'id':_0x4d0fc6[_0x4e5d('0x9f')]['ids']}});})['then'](function(_0x468c86){socket[_0x4e5d('0xae')](_0x4e5d('0xaf'),{'id':Number(_0x4d0fc6['params']['id']),'tags':_0x468c86||[]});return{'id':Number(_0x4d0fc6[_0x4e5d('0xa0')]['id']),'tags':_0x468c86||[]};});}})[_0x4e5d('0x25')](respondWithResult(_0x4b3248,null))['catch'](handleError(_0x4b3248,null));};exports['removeTags']=function(_0x38cb52,_0x343d0f,_0x58f3fd){return db[_0x4e5d('0x29')][_0x4e5d('0x9e')]({'where':{'id':_0x38cb52['params']['id']}})['then'](handleEntityNotFound(_0x343d0f,null))[_0x4e5d('0x25')](function(_0x1ee611){if(_0x1ee611){return _0x1ee611[_0x4e5d('0xb0')](_0x38cb52[_0x4e5d('0x2d')][_0x4e5d('0xa4')]);}})[_0x4e5d('0x25')](respondWithStatusCode(_0x343d0f,null))[_0x4e5d('0x9b')](handleError(_0x343d0f,null));};exports[_0x4e5d('0xb1')]=function(_0x30441b,_0x1a3b9f){var _0x42340a=moment()[_0x4e5d('0xb2')]()[_0x4e5d('0x73')]();var _0x58ca31=path[_0x4e5d('0x74')](config[_0x4e5d('0xb3')],'server',_0x4e5d('0xb4'),_0x4e5d('0xb5'));var _0x53bce9=path[_0x4e5d('0x74')](config[_0x4e5d('0xb3')],_0x4e5d('0xb6'),_0x4e5d('0xb4'),_0x4e5d('0xb7'));var _0x5d887d=path[_0x4e5d('0x74')](_0x58ca31,_0x42340a);var _0x4349e6=util['format']('transcript-%d-%s.zip',_0x30441b[_0x4e5d('0xa0')]['id'],_0x42340a);var _0x445ad1=path['join'](_0x58ca31,_0x4349e6);var _0x13c596=![];return db[_0x4e5d('0x29')]['find']({'where':{'id':_0x30441b[_0x4e5d('0xa0')]['id']},'include':[{'model':db[_0x4e5d('0xa2')],'as':_0x4e5d('0xb8'),'attributes':['id','body',_0x4e5d('0x4d'),_0x4e5d('0xb9'),'secret'],'include':[{'model':db[_0x4e5d('0xba')],'as':'User','attributes':['id','fullname'],'raw':!![]},{'model':db['CmContact'],'as':_0x4e5d('0xbb'),'attributes':['id',_0x4e5d('0xbc'),_0x4e5d('0xbd')],'raw':!![]},{'model':db['Attachment'],'as':_0x4e5d('0xbe'),'raw':!![]}]},{'model':db[_0x4e5d('0xbf')],'as':_0x4e5d('0xc0'),'attributes':['id',_0x4e5d('0x26')]},{'model':db[_0x4e5d('0xba')],'as':_0x4e5d('0xc1'),'attributes':['id','fullname']}]})[_0x4e5d('0x25')](handleEntityNotFound(_0x1a3b9f,null))[_0x4e5d('0x25')](function(_0x4210ab){if(_0x4210ab){var _0x1fd08a=_0x4210ab['get']({'plain':!![]});_0x13c596=!![];var _0xccb0d1={'format':'A4','border':'10px','header':{'height':_0x4e5d('0xc2'),'contents':{'first':_0x4e5d('0xc3')}},'footer':{'height':_0x4e5d('0xc4'),'contents':{'default':util[_0x4e5d('0x51')](_0x4e5d('0xc5'),util[_0x4e5d('0x51')](_0x4e5d('0xc6'),_0x4e5d('0xc7'),_0x1fd08a['id']),moment()[_0x4e5d('0x51')](_0x4e5d('0xc8'))[_0x4e5d('0x73')]())}}};fs[_0x4e5d('0xc9')](_0x5d887d);var _0x2e76e0={'channel':_0x4e5d('0xc7'),'account':_0x1fd08a['Account']['name'],'agent':_0x1fd08a[_0x4e5d('0xc1')]?_0x1fd08a[_0x4e5d('0xc1')]['fullname']:_0x4e5d('0xca'),'createdAt':moment(_0x1fd08a[_0x4e5d('0x4d')])[_0x4e5d('0x51')](_0x4e5d('0xa7'))['toString'](),'closedAt':_0x1fd08a[_0x4e5d('0xcb')]?moment(_0x1fd08a[_0x4e5d('0xcc')])[_0x4e5d('0x51')](_0x4e5d('0xa7'))[_0x4e5d('0x73')]():'','disposition':_0x1fd08a[_0x4e5d('0xcd')],'visibility':_0x1fd08a[_0x4e5d('0xce')]?_0x4e5d('0xcf'):_0x4e5d('0xd0'),'messages':_(_0x1fd08a[_0x4e5d('0xb8')])[_0x4e5d('0x66')]({'secret':![]})[_0x4e5d('0x64')](function(_0x16090d){if(_0x16090d[_0x4e5d('0xbe')]){var _0x59dfce=path['join'](_0x53bce9,_0x16090d[_0x4e5d('0xbe')]['basename']);if(fs[_0x4e5d('0xd1')](_0x59dfce)){fs['createReadStream'](_0x59dfce)['pipe'](fs[_0x4e5d('0xd2')](path[_0x4e5d('0x74')](_0x5d887d,_0x16090d[_0x4e5d('0xbe')][_0x4e5d('0xd3')])));}}return{'date':moment(_0x16090d[_0x4e5d('0x4d')])[_0x4e5d('0x51')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x16090d[_0x4e5d('0xb9')]===_0x4e5d('0xd4')?_0x16090d[_0x4e5d('0xba')]?_0x16090d[_0x4e5d('0xba')]['fullname']:_0x4e5d('0xd5'):_0x16090d['Contact'][_0x4e5d('0xbc')]+(_0x16090d[_0x4e5d('0xbb')][_0x4e5d('0xbd')]?'\x20'+_0x16090d['Contact']['lastName']:''),'body':_0x16090d[_0x4e5d('0xbe')]?_0x16090d[_0x4e5d('0xbe')][_0x4e5d('0xd3')]:_0x16090d[_0x4e5d('0x9f')],'direction':_0x16090d[_0x4e5d('0xb9')]===_0x4e5d('0xd4')?'A':'C','secret':_0x16090d['secret'],'attachment':_0x16090d['Attachment']};})[_0x4e5d('0x4e')]()};return ejs[_0x4e5d('0xd6')](path[_0x4e5d('0x74')](config['root'],'server','views',_0x4e5d('0xd7')),{'interaction':_0x2e76e0})[_0x4e5d('0x25')](function(_0x3be30f){return new BPromise(function(_0x5c0cdd,_0x3d5ce5){pdf[_0x4e5d('0xd8')](_0x3be30f,_0xccb0d1)['toFile'](path[_0x4e5d('0x74')](_0x5d887d,_0x4e5d('0xd9')+_0x1fd08a['id']+'-'+_0x42340a+'.pdf'),function(_0x15c5cc,_0x1f7109){if(_0x15c5cc)return _0x3d5ce5(_0x15c5cc);_0x5c0cdd(_0x1f7109);});});});}})['then'](function(){if(_0x13c596){return new BPromise(function(_0x35669f,_0x378d7e){zipdir(_0x5d887d,{'saveTo':_0x445ad1},function(_0x2df4e7,_0x22a04d){if(_0x2df4e7)return _0x378d7e(_0x2df4e7);return _0x35669f(_0x22a04d);});})[_0x4e5d('0x25')](function(){return new BPromise(function(_0x5a8bd9,_0xd6de){rimraf(_0x5d887d,function(_0x4934e3){if(_0x4934e3)_0xd6de(_0x4934e3);return _0x5a8bd9();});});})[_0x4e5d('0x25')](function(){return _0x1a3b9f[_0x4e5d('0xb1')](_0x445ad1,_0x4349e6,function(_0x2fcfc4){if(_0x2fcfc4){console[_0x4e5d('0xda')](_0x4e5d('0xdb'),_0x2fcfc4);}else{fs[_0x4e5d('0xdc')](_0x445ad1);}});});}else{return _0x1a3b9f[_0x4e5d('0x19')](0xc8);}})[_0x4e5d('0x9b')](handleError(_0x1a3b9f,null));};
\ No newline at end of file
+var _0x2e41=['isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','`Messages.count`\x20>\x200','sequelize','count','merge','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','Users','Tags','rows','catch','params','includeAll','include','options','find','create','body','describe','addMessage','ids','omit','getMessages','OpenchannelMessage','nolimit','OpenchannelInteractionId','setTags','spread','Tag','openchannelInteractionTags:save','removeTags','download','unix','server','files','tmp','root','attachments','Messages','direction','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Owner','get','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Openchannel','YYYY-MM-DD','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','Private','basename','createReadStream','createWriteStream','System','secret','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','err','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','sendStatus','status','end','json','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','OpenchannelInteraction','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filters','select','field','color','from','COUNT(*)','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','where','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','advancedFilter','parse','createdAt','dateStart','startOf','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','forEach','TagId','Messages.count','value','tableAlias','\x20=\x20?','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20IN\x20?','LIKE','ContactId','c.firstName','\x20<\x20?','map','filter'];(function(_0x49088a,_0xa2b35c){var _0x3a522d=function(_0x19cf27){while(--_0x19cf27){_0x49088a['push'](_0x49088a['shift']());}};_0x3a522d(++_0xa2b35c);}(_0x2e41,0x15e));var _0x12e4=function(_0x3b0042,_0x8e7550){_0x3b0042=_0x3b0042-0x0;var _0x41bf57=_0x2e41[_0x3b0042];return _0x41bf57;};'use strict';var pdf=require(_0x12e4('0x0'));var emlformat=require(_0x12e4('0x1'));var rimraf=require(_0x12e4('0x2'));var zipdir=require(_0x12e4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12e4('0x4'));var moment=require(_0x12e4('0x5'));var BPromise=require(_0x12e4('0x6'));var Mustache=require(_0x12e4('0x7'));var util=require(_0x12e4('0x8'));var path=require(_0x12e4('0x9'));var sox=require(_0x12e4('0xa'));var csv=require(_0x12e4('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x12e4('0xc'));var squel=require(_0x12e4('0xd'));var crypto=require(_0x12e4('0xe'));var jsforce=require(_0x12e4('0xf'));var deskjs=require(_0x12e4('0x10'));var toCsv=require(_0x12e4('0xb'));var querystring=require(_0x12e4('0x11'));var Papa=require(_0x12e4('0x12'));var Redis=require('ioredis');var authService=require(_0x12e4('0x13'));var qs=require(_0x12e4('0x14'));var hardwareService=require(_0x12e4('0x15'));var logger=require(_0x12e4('0x16'))(_0x12e4('0x17'));var utils=require(_0x12e4('0x18'));var config=require(_0x12e4('0x19'));var db=require(_0x12e4('0x1a'))['db'];config['redis']=_[_0x12e4('0x1b')](config[_0x12e4('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1b88cc,_0x34a6ef){_0x34a6ef=_0x34a6ef||0xcc;return function(_0x371c6b){if(_0x371c6b){return _0x1b88cc[_0x12e4('0x1d')](_0x34a6ef);}return _0x1b88cc[_0x12e4('0x1e')](_0x34a6ef)[_0x12e4('0x1f')]();};}function respondWithResult(_0x1ac9db,_0x4a0be4){_0x4a0be4=_0x4a0be4||0xc8;return function(_0x5cbdb7){if(_0x5cbdb7){return _0x1ac9db[_0x12e4('0x1e')](_0x4a0be4)[_0x12e4('0x20')](_0x5cbdb7);}};}function respondWithFilteredResult(_0x1640d9,_0xb9c349){return function(_0x5962c1){if(_0x5962c1){var _0x4dcec6=_0x5962c1['count'],_0x216035=_0xb9c349[_0x12e4('0x21')],_0x1f05a8=_0xb9c349[_0x12e4('0x21')]+_0xb9c349['limit'],_0x303cbe;if(_0x1f05a8>=_0x4dcec6){_0x1f05a8=_0x4dcec6;_0x303cbe=0xc8;}else{_0x303cbe=0xce;}_0x1640d9[_0x12e4('0x1e')](_0x303cbe);return _0x1640d9['set'](_0x12e4('0x22'),_0x216035+'-'+_0x1f05a8+'/'+_0x4dcec6)[_0x12e4('0x20')](_0x5962c1);}return null;};}function patchUpdates(_0xb513d7){return function(_0x9b7237){try{jsonpatch[_0x12e4('0x23')](_0x9b7237,_0xb513d7,!![]);}catch(_0x43bc2a){return BPromise[_0x12e4('0x24')](_0x43bc2a);}return _0x9b7237['save']();};}function saveUpdates(_0x1dbc17,_0x3a608f){return function(_0x52083b){if(_0x52083b){return _0x52083b[_0x12e4('0x25')](_0x1dbc17)[_0x12e4('0x26')](function(_0x2cbbe9){return _0x2cbbe9;});}return null;};}function removeEntity(_0x516f81,_0x3a5d98){return function(_0x3ea7c9){if(_0x3ea7c9){return _0x3ea7c9[_0x12e4('0x27')]()[_0x12e4('0x26')](function(){_0x516f81[_0x12e4('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xca9cf,_0x5e211c){return function(_0x3db6f9){if(!_0x3db6f9){_0xca9cf[_0x12e4('0x1d')](0x194);}return _0x3db6f9;};}function handleError(_0x2767b3,_0x44c1e4){_0x44c1e4=_0x44c1e4||0x1f4;return function(_0x4a3b35){logger[_0x12e4('0x28')](_0x4a3b35[_0x12e4('0x29')]);if(_0x4a3b35[_0x12e4('0x2a')]){delete _0x4a3b35[_0x12e4('0x2a')];}_0x2767b3['status'](_0x44c1e4)[_0x12e4('0x2b')](_0x4a3b35);};}exports[_0x12e4('0x2c')]=function(_0x15f608,_0x409a2d){var _0x56fbed={},_0x2c9bfd={},_0x487a88={'count':0x0,'rows':[]};var _0x3adc67=db[_0x12e4('0x2d')][_0x12e4('0x2e')];_0x2c9bfd['model']=_[_0x12e4('0x2f')](_0x3adc67);_0x2c9bfd[_0x12e4('0x30')]=_[_0x12e4('0x2f')](_0x15f608[_0x12e4('0x30')]);_0x2c9bfd['filters']=_[_0x12e4('0x31')](_0x2c9bfd[_0x12e4('0x32')],_0x2c9bfd['query']);_0x56fbed[_0x12e4('0x33')]=_[_0x12e4('0x31')](_0x2c9bfd[_0x12e4('0x32')],qs['fields'](_0x15f608[_0x12e4('0x30')][_0x12e4('0x34')]));_0x56fbed[_0x12e4('0x33')]=_0x56fbed['attributes'][_0x12e4('0x35')]?_0x56fbed[_0x12e4('0x33')]:_0x2c9bfd[_0x12e4('0x32')];if(!_0x15f608[_0x12e4('0x30')][_0x12e4('0x36')]('nolimit')){_0x56fbed['limit']=qs[_0x12e4('0x37')](_0x15f608['query'][_0x12e4('0x37')]);_0x56fbed[_0x12e4('0x21')]=qs[_0x12e4('0x21')](_0x15f608[_0x12e4('0x30')][_0x12e4('0x21')]);}_0x56fbed[_0x12e4('0x38')]=qs[_0x12e4('0x39')](_0x15f608['query']['sort']);_0x56fbed['where']=qs['filters'](_[_0x12e4('0x3a')](_0x15f608[_0x12e4('0x30')],_0x2c9bfd[_0x12e4('0x3b')]));var _0x1975f8=[];var _0x233313=squel[_0x12e4('0x3c')]()[_0x12e4('0x3d')]('id')[_0x12e4('0x3d')]('name')[_0x12e4('0x3d')](_0x12e4('0x3e'))[_0x12e4('0x3f')]('tools_tags');var _0x697f11=squel[_0x12e4('0x3c')]()[_0x12e4('0x3d')](_0x12e4('0x40'))['from'](_0x12e4('0x41'),'me')['where'](_0x12e4('0x42'))[_0x12e4('0x43')](_0x12e4('0x44'))['where'](_0x12e4('0x45'));var _0x3456f6=squel[_0x12e4('0x3c')]()['field'](_0x12e4('0x46'))[_0x12e4('0x3d')]('ui.OpenchannelInteractionId')[_0x12e4('0x3f')](_0x12e4('0x47'),'ui')[_0x12e4('0x48')]('users','u',_0x12e4('0x49'));var _0x5df6e8=squel['select']()[_0x12e4('0x3f')](_0x12e4('0x4a'),'i')['left_join']('user_has_openchannel_interactions','ui','ui.UserId\x20=\x20i.UserId')[_0x12e4('0x48')](_0x12e4('0x4b'),'u',_0x12e4('0x49'))[_0x12e4('0x48')](_0x12e4('0x4c'),'c',_0x12e4('0x4d'))[_0x12e4('0x48')](_0x12e4('0x4b'),'o',_0x12e4('0x4e'))[_0x12e4('0x48')](_0x12e4('0x4f'),'a',_0x12e4('0x50'))['left_join'](_0x12e4('0x41'),'me','me.OpenchannelInteractionId\x20=\x20i.id');var _0x4a8cd8=squel['expr']();if(_0x15f608[_0x12e4('0x30')][_0x12e4('0x51')]){var _0x19ecfe=JSON[_0x12e4('0x52')](_0x15f608[_0x12e4('0x30')][_0x12e4('0x51')]);_[_0x12e4('0x2f')](_0x19ecfe)['forEach'](function(_0x27096a){var _0x5162e3=_0x19ecfe[_0x27096a];if(_0x27096a===_0x12e4('0x53')){var _0x49b838=moment(_0x5162e3['value'][_0x12e4('0x54')])[_0x12e4('0x55')]('day')[_0x12e4('0x56')]()[_0x12e4('0x57')]();var _0x5e2ff5=moment(_0x5e2ff5)[_0x12e4('0x56')]()[_0x12e4('0x58')]('day')[_0x12e4('0x57')]();_0x4a8cd8[_0x12e4('0x59')](_0x12e4('0x5a'),_0x49b838,_0x5e2ff5);}else{if(_[_0x12e4('0x5b')](_0x5162e3[_0x12e4('0x5c')])){_0x5162e3[_0x12e4('0x5c')][_0x12e4('0x5d')](function(_0x59328c){switch(_0x5162e3[_0x12e4('0x5c')]['value']){case'IS':if(_0x27096a!==_0x12e4('0x5e')&&_0x27096a!==_0x12e4('0x5f')){if(_[_0x12e4('0x5b')](_0x5162e3[_0x12e4('0x60')])&&_0x5162e3[_0x12e4('0x60')][_0x12e4('0x35')]>0x1){_0x4a8cd8['and'](_0x5162e3['tableAlias']+'.'+_0x27096a+'\x20IN\x20?',_0x5162e3[_0x12e4('0x60')]);}else{_0x4a8cd8[_0x12e4('0x59')](_0x5162e3[_0x12e4('0x61')]+'.'+_0x27096a+'\x20=\x20?',_0x5162e3['value'][0x0]);}}break;case'=':_0x4a8cd8[_0x12e4('0x59')](_0x5162e3[_0x12e4('0x61')]+'.'+_0x27096a+_0x12e4('0x62'),_0x5162e3['value']);break;case'LIKE':if(_0x27096a==='ContactId'){_0x4a8cd8[_0x12e4('0x59')]('c.firstName'+_0x12e4('0x63'),'%'+_0x5162e3[_0x12e4('0x60')]+'%');_0x4a8cd8['or'](_0x12e4('0x64')+_0x12e4('0x63'),'%'+_0x5162e3[_0x12e4('0x60')]+'%');_0x4a8cd8['or'](_0x12e4('0x65')+_0x12e4('0x63'),'%'+_0x5162e3[_0x12e4('0x60')]+'%');}else{_0x4a8cd8[_0x12e4('0x59')](_0x5162e3['tableAlias']+'.'+_0x27096a+'\x20LIKE\x20?','%'+_0x5162e3[_0x12e4('0x60')]+'%');}break;case'>':_0x4a8cd8['and'](_0x5162e3['tableAlias']+'.'+_0x27096a+_0x12e4('0x66'),_0x5162e3['value']);break;case'<':_0x4a8cd8['and'](_0x5162e3['tableAlias']+'.'+_0x27096a+'\x20<\x20?',_0x5162e3['value']);break;}});}else{switch(_0x5162e3[_0x12e4('0x5c')][_0x12e4('0x60')]){case'IS':if(_0x27096a!==_0x12e4('0x5e')&&_0x27096a!==_0x12e4('0x5f')){if(_[_0x12e4('0x5b')](_0x5162e3[_0x12e4('0x60')])&&_0x5162e3[_0x12e4('0x60')][_0x12e4('0x35')]>0x1){_0x4a8cd8['and'](_0x5162e3[_0x12e4('0x61')]+'.'+_0x27096a+_0x12e4('0x67'),_0x5162e3[_0x12e4('0x60')]);}else{_0x4a8cd8[_0x12e4('0x59')](_0x5162e3[_0x12e4('0x61')]+'.'+_0x27096a+_0x12e4('0x62'),_0x5162e3['value'][0x0]);}}break;case'=':_0x4a8cd8[_0x12e4('0x59')](_0x5162e3[_0x12e4('0x61')]+'.'+_0x27096a+_0x12e4('0x62'),_0x5162e3[_0x12e4('0x60')]);break;case _0x12e4('0x68'):if(_0x27096a===_0x12e4('0x69')){_0x4a8cd8[_0x12e4('0x59')](_0x12e4('0x6a')+_0x12e4('0x63'),'%'+_0x5162e3[_0x12e4('0x60')]+'%');_0x4a8cd8['or'](_0x12e4('0x64')+_0x12e4('0x63'),'%'+_0x5162e3[_0x12e4('0x60')]+'%');_0x4a8cd8['or'](_0x12e4('0x65')+_0x12e4('0x63'),'%'+_0x5162e3['value']+'%');}else{_0x4a8cd8[_0x12e4('0x59')](_0x5162e3['tableAlias']+'.'+_0x27096a+_0x12e4('0x63'),'%'+_0x5162e3[_0x12e4('0x60')]+'%');}break;case'>':_0x4a8cd8['and'](_0x5162e3[_0x12e4('0x61')]+'.'+_0x27096a+_0x12e4('0x66'),_0x5162e3[_0x12e4('0x60')]);break;case'<':_0x4a8cd8['and'](_0x5162e3[_0x12e4('0x61')]+'.'+_0x27096a+_0x12e4('0x6b'),_0x5162e3[_0x12e4('0x60')]);break;}}}});}else{var _0x480c10=_(Object[_0x12e4('0x2f')](_0x15f608[_0x12e4('0x30')]))[_0x12e4('0x6c')](function(_0x172498){return _0x3adc67[_0x12e4('0x36')](_0x172498)?_0x172498:undefined;})[_0x12e4('0x6d')](function(_0x27184f){return!_['isNil'](_0x27184f);})[_0x12e4('0x60')]();if(!_[_0x12e4('0x6e')](_0x480c10)){_0x480c10[_0x12e4('0x5d')](function(_0x2ccfeb){if(_0x2ccfeb===_0x12e4('0x6f')){_0x5df6e8[_0x12e4('0x43')](_0x12e4('0x70'),[][_0x12e4('0x71')](_0x15f608['query'][_0x2ccfeb]));}else if(_0x2ccfeb==='createdAt'){var _0x3b67da=JSON['parse'](_0x15f608[_0x12e4('0x30')][_0x2ccfeb])['$gte'];var _0x600c05=JSON['parse'](_0x15f608[_0x12e4('0x30')][_0x2ccfeb])['$lte'];_0x5df6e8[_0x12e4('0x43')](_0x12e4('0x5a'),_0x3b67da,_0x600c05);}else{_0x5df6e8[_0x12e4('0x43')]('i.'+_0x2ccfeb+_0x12e4('0x62'),_0x15f608[_0x12e4('0x30')][_0x2ccfeb]);}});}if(_0x15f608[_0x12e4('0x30')]['filter']){var _0x520c53=_0x15f608[_0x12e4('0x30')][_0x12e4('0x6d')][_0x12e4('0x72')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x12e4('0x73'));if(qs[_0x12e4('0x74')](_0x520c53)){_0x4a8cd8['or'](_0x12e4('0x75'),_0x520c53+'%');}else{var _0x22ad49=[];_0x520c53[_0x12e4('0x76')]('\x20')[_0x12e4('0x5d')](function(_0x434a78){_0x22ad49[_0x12e4('0x77')]('+'+_0x434a78[_0x12e4('0x78')]());});var _0xd8d0bf=_0x22ad49[_0x12e4('0x79')]('\x20');_0x4a8cd8['or'](_0x12e4('0x7a'),_0xd8d0bf)['or']('i.from\x20LIKE\x20?',_0x520c53+'%')['or'](_0x12e4('0x7b'),_0x520c53+'%');}}}_0x5df6e8[_0x12e4('0x43')](_0x4a8cd8);if(_0x56fbed[_0x12e4('0x38')]){_0x56fbed[_0x12e4('0x38')][_0x12e4('0x5d')](function(_0x50a4d7){_0x5df6e8[_0x12e4('0x38')]('i.'+_0x50a4d7[0x0],_0x50a4d7[0x1]==='DESC'?![]:!![]);});}_0x5df6e8['group'](_0x12e4('0x7c'));var _0x46ec4d={'type':db[_0x12e4('0x7d')][_0x12e4('0x7e')][_0x12e4('0x7f')],'raw':!![]};var _0x234802=_0x5df6e8[_0x12e4('0x80')]()[_0x12e4('0x3d')](_0x12e4('0x40'));if(!_0x15f608['query'][_0x12e4('0x51')]){if(_0x15f608['query'][_0x12e4('0x81')]){if(_0x15f608['query'][_0x12e4('0x81')]==0x1){_0x234802[_0x12e4('0x43')](util[_0x12e4('0x57')](_0x12e4('0x82'),_0x697f11[_0x12e4('0x78')]()));_0x5df6e8[_0x12e4('0x83')](_0x12e4('0x84'));}else{_0x234802[_0x12e4('0x43')](util['format'](_0x12e4('0x85'),_0x697f11['toString']()));_0x5df6e8[_0x12e4('0x83')]('`Messages.count`\x20>\x200');}}if(_0x15f608[_0x12e4('0x30')]['tag']){var _0x30875b=_[_0x12e4('0x5b')](_0x15f608[_0x12e4('0x30')][_0x12e4('0x86')])?_0x15f608[_0x12e4('0x30')][_0x12e4('0x86')]:new Array(_0x15f608[_0x12e4('0x30')][_0x12e4('0x86')]);var _0x26910d=squel[_0x12e4('0x87')]();_0x30875b['forEach'](function(_0x262b5f){_0x26910d['or'](_0x12e4('0x88'),'%,'+_0x262b5f+',%');});_0x5df6e8[_0x12e4('0x83')](_0x26910d);_0x234802['left_join'](_0x12e4('0x89'),'it','it.OpenchannelInteractionId\x20=\x20i.id');_0x234802['left_join']('tools_tags','t',_0x12e4('0x8a'));_0x234802[_0x12e4('0x43')](_0x12e4('0x8b'),_0x30875b);}}else{var _0x19ecfe=JSON[_0x12e4('0x52')](_0x15f608[_0x12e4('0x30')][_0x12e4('0x51')]);_[_0x12e4('0x2f')](_0x19ecfe)[_0x12e4('0x5d')](function(_0x39e80d){var _0x1080af=_0x19ecfe[_0x39e80d];if(_0x39e80d===_0x12e4('0x5e')){var _0x47d496=_0x1080af[_0x12e4('0x60')];var _0x2d74da=squel[_0x12e4('0x87')]();_0x47d496[_0x12e4('0x5d')](function(_0xfe9d04){_0x2d74da['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xfe9d04+',%');});_0x5df6e8[_0x12e4('0x83')](_0x2d74da);_0x234802[_0x12e4('0x48')](_0x12e4('0x8c'),'it',_0x12e4('0x8d'));_0x234802[_0x12e4('0x48')](_0x12e4('0x8e'),'t',_0x12e4('0x8a'));_0x234802[_0x12e4('0x43')](_0x12e4('0x8b'),_0x47d496);}else if(_0x39e80d===_0x12e4('0x5f')){if(_0x1080af[_0x12e4('0x60')][_0x12e4('0x35')]===0x1){if(_0x1080af[_0x12e4('0x60')][0x0]===0x1){_0x234802['where'](util[_0x12e4('0x57')]('%s\x20=\x200',_0x697f11[_0x12e4('0x78')]()));_0x5df6e8[_0x12e4('0x83')](_0x12e4('0x84'));}else{_0x234802[_0x12e4('0x43')](util['format'](_0x12e4('0x85'),_0x697f11[_0x12e4('0x78')]()));_0x5df6e8['having'](_0x12e4('0x8f'));}}}});}db[_0x12e4('0x90')]['query'](_0x234802[_0x12e4('0x78')](),_0x46ec4d)[_0x12e4('0x26')](function(_0x46f8f1){_0x487a88['count']=_0x46f8f1['length'];if(_0x487a88[_0x12e4('0x91')]===0x0)return[];return db['sequelize'][_0x12e4('0x30')](_0x233313[_0x12e4('0x78')](),_0x46ec4d)[_0x12e4('0x26')](function(_0x437d3d){_0x1975f8=_['keyBy'](_0x437d3d,'id');_0x46ec4d=_[_0x12e4('0x92')](_0x46ec4d,{'model':db[_0x12e4('0x2d')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5df6e8[_0x12e4('0x3d')](_0x697f11,_0x12e4('0x5f'));_0x5df6e8[_0x12e4('0x3d')]('a.key',_0x12e4('0x93'));_0x5df6e8[_0x12e4('0x3d')](_0x12e4('0x94'));_0x5df6e8[_0x12e4('0x3d')](_0x12e4('0x6a'),_0x12e4('0x95'));_0x5df6e8[_0x12e4('0x3d')]('c.lastName',_0x12e4('0x96'));_0x5df6e8[_0x12e4('0x3d')](_0x12e4('0x65'),_0x12e4('0x97'));_0x5df6e8[_0x12e4('0x3d')](_0x12e4('0x98'),_0x12e4('0x99'));_0x5df6e8[_0x12e4('0x3d')]('c.mobile',_0x12e4('0x9a'));_0x5df6e8[_0x12e4('0x3d')](_0x12e4('0x9b'),'Contact.fax');_0x5df6e8[_0x12e4('0x3d')](_0x12e4('0x9c'),_0x12e4('0x9d'));_0x5df6e8[_0x12e4('0x3d')](_0x12e4('0x9e'),_0x12e4('0x9f'));_0x5df6e8[_0x12e4('0x48')]('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id');_0x5df6e8[_0x12e4('0x48')](_0x12e4('0x8e'),'t',_0x12e4('0x8a'));_0x5df6e8['limit'](_0x56fbed[_0x12e4('0x37')]);_0x5df6e8[_0x12e4('0x21')](_0x56fbed['offset']);return db[_0x12e4('0x90')]['query'](_0x5df6e8[_0x12e4('0x78')](),_0x46ec4d);})[_0x12e4('0x26')](function(_0x3dfee7){_0x3456f6[_0x12e4('0x43')](_0x12e4('0xa0'),_['map'](_0x3dfee7,'id'));return db[_0x12e4('0x90')][_0x12e4('0x30')](_0x3456f6['toString'](),_0x46ec4d)[_0x12e4('0x26')](function(_0x190d3b){var _0x368476=_[_0x12e4('0xa1')](_0x190d3b,'OpenchannelInteractionId');_0x3dfee7['forEach'](function(_0x2dab86){if(_0x368476[_0x2dab86['id']]){_0x2dab86[_0x12e4('0xa2')]=_[_0x12e4('0x6c')](_0x368476[_0x2dab86['id']],function(_0x295cad){return{'id':_0x295cad['id']};});}if(_0x2dab86[_0x12e4('0x9f')]){_0x2dab86[_0x12e4('0xa3')]=[];_0x2dab86[_0x12e4('0x9f')][_0x12e4('0x76')](',')['forEach'](function(_0x316039){_0x2dab86[_0x12e4('0xa3')][_0x12e4('0x77')](_0x1975f8[_0x316039]);});}delete _0x2dab86[_0x12e4('0x9f')];});return _0x3dfee7;});});})['then'](function(_0x1f7230){_0x487a88[_0x12e4('0xa4')]=_0x1f7230;return _0x487a88;})['then'](respondWithFilteredResult(_0x409a2d,_0x56fbed))[_0x12e4('0xa5')](handleError(_0x409a2d,null));};exports['show']=function(_0x3f793a,_0x481888){var _0xcd0cf0={'raw':![],'where':{'id':_0x3f793a[_0x12e4('0xa6')]['id']}},_0x28ab3c={};_0x28ab3c[_0x12e4('0x32')]=_['keys'](db[_0x12e4('0x2d')]['rawAttributes']);_0x28ab3c['query']=_[_0x12e4('0x2f')](_0x3f793a[_0x12e4('0x30')]);_0x28ab3c[_0x12e4('0x3b')]=_['intersection'](_0x28ab3c[_0x12e4('0x32')],_0x28ab3c[_0x12e4('0x30')]);_0xcd0cf0[_0x12e4('0x33')]=_[_0x12e4('0x31')](_0x28ab3c[_0x12e4('0x32')],qs[_0x12e4('0x34')](_0x3f793a[_0x12e4('0x30')][_0x12e4('0x34')]));_0xcd0cf0['attributes']=_0xcd0cf0['attributes'][_0x12e4('0x35')]?_0xcd0cf0[_0x12e4('0x33')]:_0x28ab3c[_0x12e4('0x32')];if(_0x3f793a[_0x12e4('0x30')][_0x12e4('0xa7')]){_0xcd0cf0[_0x12e4('0xa8')]=[{'all':!![]}];}_0xcd0cf0=_[_0x12e4('0x92')]({},_0xcd0cf0,_0x3f793a[_0x12e4('0xa9')]);return db[_0x12e4('0x2d')][_0x12e4('0xaa')](_0xcd0cf0)[_0x12e4('0x26')](handleEntityNotFound(_0x481888,null))[_0x12e4('0x26')](respondWithResult(_0x481888,null))[_0x12e4('0xa5')](handleError(_0x481888,null));};exports[_0x12e4('0xab')]=function(_0x44041e,_0x43baf8){return db[_0x12e4('0x2d')][_0x12e4('0xab')](_0x44041e['body'],{})[_0x12e4('0x26')](respondWithResult(_0x43baf8,0xc9))['catch'](handleError(_0x43baf8,null));};exports[_0x12e4('0x25')]=function(_0x4f3c5e,_0x561314){if(_0x4f3c5e['body']['id']){delete _0x4f3c5e[_0x12e4('0xac')]['id'];}return db[_0x12e4('0x2d')][_0x12e4('0xaa')]({'where':{'id':_0x4f3c5e[_0x12e4('0xa6')]['id']}})[_0x12e4('0x26')](handleEntityNotFound(_0x561314,null))['then'](saveUpdates(_0x4f3c5e[_0x12e4('0xac')],null))['then'](respondWithResult(_0x561314,null))[_0x12e4('0xa5')](handleError(_0x561314,null));};exports['destroy']=function(_0x30ed1f,_0x4b5add){return db[_0x12e4('0x2d')][_0x12e4('0xaa')]({'where':{'id':_0x30ed1f['params']['id']}})[_0x12e4('0x26')](handleEntityNotFound(_0x4b5add,null))[_0x12e4('0x26')](removeEntity(_0x4b5add,null))[_0x12e4('0xa5')](handleError(_0x4b5add,null));};exports[_0x12e4('0xad')]=function(_0x1a1ab1,_0x1104a9){return db['OpenchannelInteraction']['describe']()['then'](respondWithResult(_0x1104a9,null))['catch'](handleError(_0x1104a9,null));};exports[_0x12e4('0xae')]=function(_0x872975,_0x540c92,_0x31c261){return db['OpenchannelMessage'][_0x12e4('0xaa')]({'where':{'id':_0x872975[_0x12e4('0xa6')]['id']}})[_0x12e4('0x26')](handleEntityNotFound(_0x540c92,null))[_0x12e4('0x26')](function(_0x888138){if(_0x888138){return _0x888138['addMessage'](_0x872975[_0x12e4('0xac')][_0x12e4('0xaf')],_[_0x12e4('0xb0')](_0x872975['body'],[_0x12e4('0xaf'),'id'])||{});}})[_0x12e4('0x26')](respondWithResult(_0x540c92,null))[_0x12e4('0xa5')](handleError(_0x540c92,null));};exports[_0x12e4('0xb1')]=function(_0x262ee1,_0x27e85b,_0x340734){var _0x40fb71={'raw':![],'where':{}};var _0x47c6ad={};var _0x9d89ee={'count':0x0,'rows':[]};return db[_0x12e4('0x2d')]['findOne']({'where':{'id':_0x262ee1[_0x12e4('0xa6')]['id']}})[_0x12e4('0x26')](handleEntityNotFound(_0x27e85b,null))['then'](function(_0x38f28b){if(_0x38f28b){_0x47c6ad['model']=_[_0x12e4('0x2f')](db[_0x12e4('0xb2')][_0x12e4('0x2e')]);_0x47c6ad[_0x12e4('0x30')]=_[_0x12e4('0x2f')](_0x262ee1[_0x12e4('0x30')]);_0x47c6ad['filters']=_[_0x12e4('0x31')](_0x47c6ad[_0x12e4('0x32')],_0x47c6ad['query']);_0x40fb71[_0x12e4('0x33')]=_[_0x12e4('0x31')](_0x47c6ad[_0x12e4('0x32')],qs[_0x12e4('0x34')](_0x262ee1[_0x12e4('0x30')][_0x12e4('0x34')]));_0x40fb71[_0x12e4('0x33')]=_0x40fb71[_0x12e4('0x33')][_0x12e4('0x35')]?_0x40fb71[_0x12e4('0x33')]:_0x47c6ad['model'];if(!_0x262ee1[_0x12e4('0x30')][_0x12e4('0x36')](_0x12e4('0xb3'))){_0x40fb71[_0x12e4('0x37')]=qs[_0x12e4('0x37')](_0x262ee1[_0x12e4('0x30')]['limit']);_0x40fb71[_0x12e4('0x21')]=qs[_0x12e4('0x21')](_0x262ee1[_0x12e4('0x30')][_0x12e4('0x21')]);}_0x40fb71[_0x12e4('0x38')]=qs[_0x12e4('0x39')](_0x262ee1['query'][_0x12e4('0x39')]);_0x40fb71[_0x12e4('0x43')]=qs[_0x12e4('0x3b')](_[_0x12e4('0x3a')](_0x262ee1[_0x12e4('0x30')],_0x47c6ad[_0x12e4('0x3b')]));_0x40fb71[_0x12e4('0x43')][_0x12e4('0xb4')]=_0x38f28b['id'];if(_0x262ee1['query'][_0x12e4('0x6d')]){_0x40fb71[_0x12e4('0x43')]=_[_0x12e4('0x92')](_0x40fb71['where'],{'$or':_[_0x12e4('0x6c')](_0x40fb71[_0x12e4('0x33')],function(_0x15fff1){var _0x5c1079={};_0x5c1079[_0x15fff1]={'$like':'%'+_0x262ee1[_0x12e4('0x30')]['filter']+'%'};return _0x5c1079;})});}if(_0x262ee1['query']['$gte']){var _0x361a2a=_0x262ee1['query']['$gte'][_0x12e4('0x76')](',');var _0x33ab70={};_0x33ab70[_0x361a2a[0x0]]={'$gte':moment(_0x361a2a[0x1])[_0x12e4('0x57')]('YYYY-MM-DD\x20HH:mm:ss')};_0x40fb71[_0x12e4('0x43')]=_['merge'](_0x40fb71[_0x12e4('0x43')],_0x33ab70);}_0x40fb71=_[_0x12e4('0x92')]({},_0x40fb71,_0x262ee1[_0x12e4('0xa9')]);return db[_0x12e4('0xb2')][_0x12e4('0x91')]({'where':_0x40fb71[_0x12e4('0x43')]})[_0x12e4('0x26')](function(_0x1017da){_0x9d89ee['count']=_0x1017da;if(_0x262ee1['query'][_0x12e4('0xa7')]){_0x40fb71[_0x12e4('0xa8')]=[{'all':!![]}];}return db[_0x12e4('0xb2')]['findAll'](_0x40fb71);})[_0x12e4('0x26')](function(_0x5d4753){_0x9d89ee[_0x12e4('0xa4')]=_0x5d4753;return _0x9d89ee;});}})[_0x12e4('0x26')](respondWithFilteredResult(_0x27e85b,_0x40fb71))[_0x12e4('0xa5')](handleError(_0x27e85b,null));};exports['addTags']=function(_0x55ef60,_0x377553,_0x1ef2cc){return db[_0x12e4('0x2d')]['find']({'where':{'id':_0x55ef60[_0x12e4('0xa6')]['id']}})['then'](handleEntityNotFound(_0x377553,null))[_0x12e4('0x26')](function(_0x3937f6){if(_0x3937f6){return _0x3937f6[_0x12e4('0xb5')](_0x55ef60[_0x12e4('0xac')][_0x12e4('0xaf')],_['omit'](_0x55ef60[_0x12e4('0xac')],[_0x12e4('0xaf'),'id'])||{})[_0x12e4('0xb6')](function(){return db[_0x12e4('0xb7')]['findAll']({'attributes':['id',_0x12e4('0x2a'),_0x12e4('0x3e')],'where':{'id':_0x55ef60[_0x12e4('0xac')][_0x12e4('0xaf')]}});})[_0x12e4('0x26')](function(_0x214c3e){socket['emit'](_0x12e4('0xb8'),{'id':Number(_0x55ef60[_0x12e4('0xa6')]['id']),'tags':_0x214c3e||[]});return{'id':Number(_0x55ef60[_0x12e4('0xa6')]['id']),'tags':_0x214c3e||[]};});}})[_0x12e4('0x26')](respondWithResult(_0x377553,null))[_0x12e4('0xa5')](handleError(_0x377553,null));};exports[_0x12e4('0xb9')]=function(_0x5ca1eb,_0x351072,_0x2d4c1a){return db[_0x12e4('0x2d')][_0x12e4('0xaa')]({'where':{'id':_0x5ca1eb['params']['id']}})[_0x12e4('0x26')](handleEntityNotFound(_0x351072,null))[_0x12e4('0x26')](function(_0x10059b){if(_0x10059b){return _0x10059b[_0x12e4('0xb9')](_0x5ca1eb[_0x12e4('0x30')][_0x12e4('0xaf')]);}})['then'](respondWithStatusCode(_0x351072,null))[_0x12e4('0xa5')](handleError(_0x351072,null));};exports[_0x12e4('0xba')]=function(_0x4fb32d,_0x1f7977){var _0x2e1051=moment()[_0x12e4('0xbb')]()[_0x12e4('0x78')]();var _0x51f832=path[_0x12e4('0x79')](config['root'],_0x12e4('0xbc'),_0x12e4('0xbd'),_0x12e4('0xbe'));var _0x3a8634=path[_0x12e4('0x79')](config[_0x12e4('0xbf')],_0x12e4('0xbc'),_0x12e4('0xbd'),_0x12e4('0xc0'));var _0x850887=path['join'](_0x51f832,_0x2e1051);var _0x295e2f=util[_0x12e4('0x57')]('transcript-%d-%s.zip',_0x4fb32d[_0x12e4('0xa6')]['id'],_0x2e1051);var _0x5782ee=path[_0x12e4('0x79')](_0x51f832,_0x295e2f);var _0x2cb284=![];return db[_0x12e4('0x2d')][_0x12e4('0xaa')]({'where':{'id':_0x4fb32d[_0x12e4('0xa6')]['id']},'include':[{'model':db[_0x12e4('0xb2')],'as':_0x12e4('0xc1'),'attributes':['id',_0x12e4('0xac'),_0x12e4('0x53'),_0x12e4('0xc2'),'secret'],'include':[{'model':db[_0x12e4('0xc3')],'as':_0x12e4('0xc3'),'attributes':['id',_0x12e4('0xc4')],'raw':!![]},{'model':db[_0x12e4('0xc5')],'as':_0x12e4('0xc6'),'attributes':['id',_0x12e4('0xc7'),_0x12e4('0xc8')],'raw':!![]},{'model':db[_0x12e4('0xc9')],'as':_0x12e4('0xc9'),'raw':!![]}]},{'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0x12e4('0x2a')]},{'model':db[_0x12e4('0xc3')],'as':_0x12e4('0xca'),'attributes':['id','fullname']}]})[_0x12e4('0x26')](handleEntityNotFound(_0x1f7977,null))[_0x12e4('0x26')](function(_0x229611){if(_0x229611){var _0x520b22=_0x229611[_0x12e4('0xcb')]({'plain':!![]});_0x2cb284=!![];var _0x15569b={'format':'A4','border':_0x12e4('0xcc'),'header':{'height':'40px','contents':{'first':_0x12e4('0xcd')}},'footer':{'height':_0x12e4('0xce'),'contents':{'default':util[_0x12e4('0x57')](' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
',util[_0x12e4('0x57')](_0x12e4('0xcf'),_0x12e4('0xd0'),_0x520b22['id']),moment()[_0x12e4('0x57')](_0x12e4('0xd1'))['toString']())}}};fs['mkdirSync'](_0x850887);var _0x5dd075={'channel':_0x12e4('0xd0'),'account':_0x520b22[_0x12e4('0xd2')][_0x12e4('0x2a')],'agent':_0x520b22[_0x12e4('0xca')]?_0x520b22[_0x12e4('0xca')][_0x12e4('0xc4')]:_0x12e4('0xd3'),'createdAt':moment(_0x520b22['createdAt'])['format'](_0x12e4('0xd4'))['toString'](),'closedAt':_0x520b22['closed']?moment(_0x520b22[_0x12e4('0xd5')])[_0x12e4('0x57')](_0x12e4('0xd4'))[_0x12e4('0x78')]():'','disposition':_0x520b22[_0x12e4('0xd6')],'visibility':_0x520b22[_0x12e4('0xd7')]?_0x12e4('0xd8'):_0x12e4('0xd9'),'messages':_(_0x520b22['Messages'])[_0x12e4('0x6d')]({'secret':![]})[_0x12e4('0x6c')](function(_0x4982a9){if(_0x4982a9[_0x12e4('0xc9')]){var _0xfedf28=path[_0x12e4('0x79')](_0x3a8634,_0x4982a9[_0x12e4('0xc9')][_0x12e4('0xda')]);if(fs['existsSync'](_0xfedf28)){fs[_0x12e4('0xdb')](_0xfedf28)['pipe'](fs[_0x12e4('0xdc')](path['join'](_0x850887,_0x4982a9[_0x12e4('0xc9')]['basename'])));}}return{'date':moment(_0x4982a9['createdAt'])[_0x12e4('0x57')](_0x12e4('0xd4'))[_0x12e4('0x78')](),'sender':_0x4982a9[_0x12e4('0xc2')]==='out'?_0x4982a9['User']?_0x4982a9['User'][_0x12e4('0xc4')]:_0x12e4('0xdd'):_0x4982a9['Contact'][_0x12e4('0xc7')]+(_0x4982a9[_0x12e4('0xc6')][_0x12e4('0xc8')]?'\x20'+_0x4982a9['Contact']['lastName']:''),'body':_0x4982a9[_0x12e4('0xc9')]?_0x4982a9[_0x12e4('0xc9')][_0x12e4('0xda')]:_0x4982a9[_0x12e4('0xac')],'direction':_0x4982a9[_0x12e4('0xc2')]==='out'?'A':'C','secret':_0x4982a9[_0x12e4('0xde')],'attachment':_0x4982a9[_0x12e4('0xc9')]};})['value']()};return ejs[_0x12e4('0xdf')](path['join'](config[_0x12e4('0xbf')],_0x12e4('0xbc'),_0x12e4('0xe0'),_0x12e4('0xe1')),{'interaction':_0x5dd075})[_0x12e4('0x26')](function(_0x38c5d3){return new BPromise(function(_0x54eaca,_0x463f24){pdf['create'](_0x38c5d3,_0x15569b)[_0x12e4('0xe2')](path[_0x12e4('0x79')](_0x850887,_0x12e4('0xe3')+_0x520b22['id']+'-'+_0x2e1051+_0x12e4('0xe4')),function(_0x2edf1a,_0x550f10){if(_0x2edf1a)return _0x463f24(_0x2edf1a);_0x54eaca(_0x550f10);});});});}})['then'](function(){if(_0x2cb284){return new BPromise(function(_0x11d7f8,_0x452f37){zipdir(_0x850887,{'saveTo':_0x5782ee},function(_0x48d554,_0x43f6ea){if(_0x48d554)return _0x452f37(_0x48d554);return _0x11d7f8(_0x43f6ea);});})[_0x12e4('0x26')](function(){return new BPromise(function(_0xebfb86,_0x2299fd){rimraf(_0x850887,function(_0x4b1897){if(_0x4b1897)_0x2299fd(_0x4b1897);return _0xebfb86();});});})[_0x12e4('0x26')](function(){return _0x1f7977[_0x12e4('0xba')](_0x5782ee,_0x295e2f,function(_0x4b2faa){if(_0x4b2faa){console['log'](_0x12e4('0xe5'),_0x4b2faa);}else{fs['unlinkSync'](_0x5782ee);}});});}else{return _0x1f7977[_0x12e4('0x1d')](0xc8);}})['catch'](handleError(_0x1f7977,null));};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js
index 17a7149..9cd4392 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.events.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2941=['events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','emit','hook'];(function(_0x13feab,_0x4a2ff5){var _0x3cdec2=function(_0x1685a8){while(--_0x1685a8){_0x13feab['push'](_0x13feab['shift']());}};_0x3cdec2(++_0x4a2ff5);}(_0x2941,0x157));var _0x1294=function(_0xf0d35,_0xce9c1c){_0xf0d35=_0xf0d35-0x0;var _0x5ba3bc=_0x2941[_0xf0d35];return _0x5ba3bc;};'use strict';var EventEmitter=require(_0x1294('0x0'));var OpenchannelInteraction=require(_0x1294('0x1'))['db'][_0x1294('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1294('0x3')](0x0);var events={'afterCreate':_0x1294('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x999394){return function(_0x2364cc,_0x42d400,_0x35da8d){OpenchannelInteractionEvents[_0x1294('0x5')](_0x999394+':'+_0x2364cc['id'],_0x2364cc);OpenchannelInteractionEvents[_0x1294('0x5')](_0x999394,_0x2364cc);_0x35da8d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x1294('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x646b=['hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove'];(function(_0x8d5de5,_0x143d83){var _0x400b7d=function(_0x2abd97){while(--_0x2abd97){_0x8d5de5['push'](_0x8d5de5['shift']());}};_0x400b7d(++_0x143d83);}(_0x646b,0x123));var _0xb646=function(_0x55f549,_0x4f90ac){_0x55f549=_0x55f549-0x0;var _0x589a78=_0x646b[_0x55f549];return _0x589a78;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xb646('0x0'))['db'][_0xb646('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb646('0x2')](0x0);var events={'afterCreate':_0xb646('0x3'),'afterUpdate':_0xb646('0x4'),'afterDestroy':_0xb646('0x5')};function emitEvent(_0x354b2c){return function(_0xb2e618,_0x25f8bd,_0x1d1005){OpenchannelInteractionEvents['emit'](_0x354b2c+':'+_0xb2e618['id'],_0xb2e618);OpenchannelInteractionEvents['emit'](_0x354b2c,_0xb2e618);_0x1d1005(null);};}for(var e in events){if(events[_0xb646('0x6')](e)){var event=events[e];OpenchannelInteraction[_0xb646('0x7')](e,emitEvent(event));}}module[_0xb646('0x8')]=OpenchannelInteractionEvents;
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js
index 550a67e..d72de88 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.model.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x47c7=['./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x361ff5,_0x40bda2){var _0x107799=function(_0xf3a0e2){while(--_0xf3a0e2){_0x361ff5['push'](_0x361ff5['shift']());}};_0x107799(++_0x40bda2);}(_0x47c7,0x1ab));var _0x747c=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x47c7[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x747c('0x0'));var util=require('util');var logger=require(_0x747c('0x1'))(_0x747c('0x2'));var moment=require('moment');var BPromise=require(_0x747c('0x3'));var rp=require(_0x747c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x747c('0x5'));var config=require(_0x747c('0x6'));var attributes=require(_0x747c('0x7'));module[_0x747c('0x8')]=function(_0x5e991e,_0xa1148a){return _0x5e991e['define'](_0x747c('0x9'),attributes,{'tableName':_0x747c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10b9f0,_0x21e0f1,_0x363db1){if(_0x10b9f0['changed']('closed')){_0x10b9f0[_0x747c('0xb')]=moment()[_0x747c('0xc')](_0x747c('0xd'));}_0x363db1(null,_0x10b9f0);}}});};
\ No newline at end of file
+var _0xc23a=['exports','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','util','../../config/logger','api','bluebird','rimraf','./openchannelInteraction.attributes'];(function(_0x27a4ae,_0x4e458d){var _0x4248ec=function(_0x11fb9a){while(--_0x11fb9a){_0x27a4ae['push'](_0x27a4ae['shift']());}};_0x4248ec(++_0x4e458d);}(_0xc23a,0xd2));var _0xac23=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0xc23a[_0x419e17];return _0x1f2044;};'use strict';var _=require('lodash');var util=require(_0xac23('0x0'));var logger=require(_0xac23('0x1'))(_0xac23('0x2'));var moment=require('moment');var BPromise=require(_0xac23('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xac23('0x4'));var config=require('../../config/environment');var attributes=require(_0xac23('0x5'));module[_0xac23('0x6')]=function(_0xc71a6d,_0x4c1482){return _0xc71a6d['define'](_0xac23('0x7'),attributes,{'tableName':_0xac23('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20342c,_0x5b2705,_0x2bce0a){if(_0x20342c[_0xac23('0x9')](_0xac23('0xa'))){_0x20342c[_0xac23('0xb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2bce0a(null,_0x20342c);}}});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js
index 1b7482b..e943182 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.rpc.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb091=['../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelInteraction,\x20%s,\x20%s','info','catch','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','find','ids','omit','AddTags','util','moment','bluebird','randomstring'];(function(_0x4c22be,_0x339703){var _0x42c033=function(_0x4944fb){while(--_0x4944fb){_0x4c22be['push'](_0x4c22be['shift']());}};_0x42c033(++_0x339703);}(_0xb091,0x16e));var _0x1b09=function(_0x1de7a1,_0x5b5a17){_0x1de7a1=_0x1de7a1-0x0;var _0x55ef3c=_0xb091[_0x1de7a1];return _0x55ef3c;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});config[_0x1b09('0x9')]=_['defaults'](config[_0x1b09('0x9')],{'host':_0x1b09('0xa'),'port':0x18eb});var socket=require(_0x1b09('0xb'))(new Redis(config[_0x1b09('0x9')]));require(_0x1b09('0xc'))[_0x1b09('0xd')](socket);function respondWithRpcPromise(_0x211f05,_0x124d02,_0x3249a1){return new BPromise(function(_0x36aa1b,_0x14dac6){return client['request'](_0x211f05,_0x3249a1)[_0x1b09('0xe')](function(_0x894b73){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x124d02,_0x1b09('0xf'));logger[_0x1b09('0x10')](_0x1b09('0x11'),_0x124d02,_0x1b09('0xf'),JSON[_0x1b09('0x12')](_0x894b73));if(_0x894b73[_0x1b09('0x13')]){if(_0x894b73[_0x1b09('0x13')]['code']===0x1f4){logger[_0x1b09('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x124d02,_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);return _0x14dac6(_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);}logger[_0x1b09('0x13')](_0x1b09('0x15'),_0x124d02,_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);return _0x36aa1b(_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);}else{logger[_0x1b09('0x16')](_0x1b09('0x15'),_0x124d02,_0x1b09('0xf'));_0x36aa1b(_0x894b73['result'][_0x1b09('0x14')]);}})[_0x1b09('0x17')](function(_0x5483ef){logger['error'](_0x1b09('0x15'),_0x124d02,_0x5483ef);_0x14dac6(_0x5483ef);});});}exports['UpdateOpenchannelInteraction']=function(_0x267b5e){var _0x5bb127=this;return new Promise(function(_0x136697,_0x4b2eab){return db[_0x1b09('0x18')][_0x1b09('0x19')](_0x267b5e[_0x1b09('0x1a')],{'raw':_0x267b5e[_0x1b09('0x1b')]?_0x267b5e[_0x1b09('0x1b')][_0x1b09('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x267b5e['options']?_0x267b5e['options'][_0x1b09('0x1d')]||null:null,'attributes':_0x267b5e[_0x1b09('0x1b')]?_0x267b5e['options'][_0x1b09('0x1e')]||null:null,'limit':_0x267b5e[_0x1b09('0x1b')]?_0x267b5e[_0x1b09('0x1b')][_0x1b09('0x1f')]||null:null})['then'](function(_0xe0d931){logger[_0x1b09('0x16')]('UpdateOpenchannelInteraction',_0x267b5e);logger[_0x1b09('0x10')](_0x1b09('0x20'),_0x267b5e,JSON['stringify'](_0xe0d931));_0x136697(_0xe0d931);})[_0x1b09('0x17')](function(_0x108d80){logger[_0x1b09('0x13')](_0x1b09('0x20'),_0x108d80['message'],_0x267b5e);_0x4b2eab(_0x5bb127[_0x1b09('0x13')](0x1f4,_0x108d80[_0x1b09('0x14')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x2d1ec0){return new Promise(function(_0x406748,_0x26befb){return db[_0x1b09('0x18')][_0x1b09('0x21')]({'where':_0x2d1ec0[_0x1b09('0x1b')]?_0x2d1ec0[_0x1b09('0x1b')]['where']||null:null})[_0x1b09('0xe')](function(_0x3e6a4d){if(_0x3e6a4d){return _0x3e6a4d['addTags'](_0x2d1ec0[_0x1b09('0x1a')][_0x1b09('0x22')],_[_0x1b09('0x23')](_0x2d1ec0[_0x1b09('0x1a')],[_0x1b09('0x22'),'id'])||{});}})['spread'](function(_0x4540de){logger['info'](_0x1b09('0x24'),_0x2d1ec0);logger['debug'](_0x1b09('0x24'),_0x2d1ec0,JSON[_0x1b09('0x12')](_0x4540de));_0x406748(_0x4540de);})[_0x1b09('0x17')](function(_0x2cf3cb){logger[_0x1b09('0x13')](_0x1b09('0x24'),_0x2cf3cb[_0x1b09('0x14')],_0x2d1ec0);_0x26befb(_this[_0x1b09('0x13')](0x1f4,_0x2cf3cb[_0x1b09('0x14')]));});});};
\ No newline at end of file
+var _0x1261=['../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelInteraction','options','raw','where','attributes','then','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','body','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x149cf0,_0x3746f2){_0x149cf0=_0x149cf0-0x0;var _0x2ee2c8=_0x1261[_0x149cf0];return _0x2ee2c8;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['UpdateOpenchannelInteraction']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['update'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22ed37[_0x1126('0x1a')]?_0x22ed37['options'][_0x1126('0x1c')]||null:null,'attributes':_0x22ed37[_0x1126('0x1a')]?_0x22ed37['options'][_0x1126('0x1d')]||null:null,'limit':_0x22ed37['options']?_0x22ed37['options']['limit']||null:null})[_0x1126('0x1e')](function(_0x15bcc3){logger[_0x1126('0x17')](_0x1126('0x1f'),_0x22ed37);logger[_0x1126('0x11')](_0x1126('0x1f'),_0x22ed37,JSON[_0x1126('0x13')](_0x15bcc3));_0x2f70ac(_0x15bcc3);})[_0x1126('0x18')](function(_0x589725){logger[_0x1126('0x14')](_0x1126('0x1f'),_0x589725[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19['error'](0x1f4,_0x589725['message']));});});};exports[_0x1126('0x20')]=function(_0x39bf0e){return new Promise(function(_0x55e195,_0x2fb797){return db[_0x1126('0x19')]['find']({'where':_0x39bf0e[_0x1126('0x1a')]?_0x39bf0e['options'][_0x1126('0x1c')]||null:null})['then'](function(_0x771bb8){if(_0x771bb8){return _0x771bb8['addTags'](_0x39bf0e[_0x1126('0x21')]['ids'],_['omit'](_0x39bf0e['body'],[_0x1126('0x22'),'id'])||{});}})[_0x1126('0x23')](function(_0x1cef48){logger['info'](_0x1126('0x24'),_0x39bf0e);logger[_0x1126('0x11')]('AddTags',_0x39bf0e,JSON[_0x1126('0x13')](_0x1cef48));_0x55e195(_0x1cef48);})[_0x1126('0x18')](function(_0x2d8127){logger[_0x1126('0x14')]('AddTags',_0x2d8127['message'],_0x39bf0e);_0x2fb797(_this[_0x1126('0x14')](0x1f4,_0x2d8127[_0x1126('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js
index 3ed2885..ed0ee05 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.socket.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xacc8=['./openchannelInteraction.events','save','remove','update','removeListener','register','length','openchannelInteraction:'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xacc8,0x70));var _0x8acc=function(_0x407604,_0x58f902){_0x407604=_0x407604-0x0;var _0x2da97a=_0xacc8[_0x407604];return _0x2da97a;};'use strict';var OpenchannelInteractionEvents=require(_0x8acc('0x0'));var events=[_0x8acc('0x1'),_0x8acc('0x2'),_0x8acc('0x3')];function createListener(_0x55bbce,_0x50ee9a){return function(_0x151799){_0x50ee9a['emit'](_0x55bbce,_0x151799);};}function removeListener(_0x4a979d,_0x4920e1){return function(){OpenchannelInteractionEvents[_0x8acc('0x4')](_0x4a979d,_0x4920e1);};}exports[_0x8acc('0x5')]=function(_0x2b0ab6){for(var _0x51ed95=0x0,_0x275c5d=events[_0x8acc('0x6')];_0x51ed95<_0x275c5d;_0x51ed95++){var _0x3a8a99=events[_0x51ed95];var _0x528740=createListener(_0x8acc('0x7')+_0x3a8a99,_0x2b0ab6);OpenchannelInteractionEvents['on'](_0x3a8a99,_0x528740);}};
\ No newline at end of file
+var _0x7bc5=['openchannelInteraction:','./openchannelInteraction.events','update','emit','removeListener','length'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x7bc5,0x1a5));var _0x57bc=function(_0x569fef,_0x49c37a){_0x569fef=_0x569fef-0x0;var _0x11f20b=_0x7bc5[_0x569fef];return _0x11f20b;};'use strict';var OpenchannelInteractionEvents=require(_0x57bc('0x0'));var events=['save','remove',_0x57bc('0x1')];function createListener(_0x1b2371,_0x2933fb){return function(_0x32cdd8){_0x2933fb[_0x57bc('0x2')](_0x1b2371,_0x32cdd8);};}function removeListener(_0x3b50ca,_0x41d4ff){return function(){OpenchannelInteractionEvents[_0x57bc('0x3')](_0x3b50ca,_0x41d4ff);};}exports['register']=function(_0x17ebf2){for(var _0x4012a5=0x0,_0x40a4b3=events[_0x57bc('0x4')];_0x4012a5<_0x40a4b3;_0x4012a5++){var _0x402d9f=events[_0x4012a5];var _0x3d26e3=createListener(_0x57bc('0x5')+_0x402d9f,_0x17ebf2);OpenchannelInteractionEvents['on'](_0x402d9f,_0x3d26e3);}};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js
index d207439..85086fc 100644
--- a/server/api/openchannelMessage/index.js
+++ b/server/api/openchannelMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x83f3=['index','/describe','describe','show','tracked','openchannel','openchannelmessage:create','put','/:id','update','/:id/accept','delete','destroy','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x49bf94,_0x1b48c7){var _0x88831d=function(_0x555f68){while(--_0x555f68){_0x49bf94['push'](_0x49bf94['shift']());}};_0x88831d(++_0x1b48c7);}(_0x83f3,0x15d));var _0x383f=function(_0x58af0e,_0x5f544f){_0x58af0e=_0x58af0e-0x0;var _0x36d3b0=_0x83f3[_0x58af0e];return _0x36d3b0;};'use strict';var multer=require(_0x383f('0x0'));var util=require(_0x383f('0x1'));var path=require(_0x383f('0x2'));var timeout=require(_0x383f('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x383f('0x4'));var config=require(_0x383f('0x5'));var controller=require('./openchannelMessage.controller');router[_0x383f('0x6')]('/',auth[_0x383f('0x7')](),controller[_0x383f('0x8')]);router[_0x383f('0x6')](_0x383f('0x9'),auth[_0x383f('0x7')](),controller[_0x383f('0xa')]);router[_0x383f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x383f('0xb')]);router['post']('/',auth[_0x383f('0x7')](),interaction[_0x383f('0xc')](_0x383f('0xd'),_0x383f('0xe')),controller['create']);router[_0x383f('0xf')](_0x383f('0x10'),auth[_0x383f('0x7')](),controller[_0x383f('0x11')]);router[_0x383f('0xf')](_0x383f('0x12'),auth[_0x383f('0x7')](),controller['accept']);router[_0x383f('0xf')]('/:id/reject',auth[_0x383f('0x7')](),controller['reject']);router[_0x383f('0x13')](_0x383f('0x10'),auth['isAuthenticated'](),controller[_0x383f('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x23f2=['/:id/reject','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','describe','/:id','show','tracked','openchannel','openchannelmessage:create','create','put','update','/:id/accept'];(function(_0x17337b,_0x36028a){var _0x57d672=function(_0x156356){while(--_0x156356){_0x17337b['push'](_0x17337b['shift']());}};_0x57d672(++_0x36028a);}(_0x23f2,0x1ce));var _0x223f=function(_0x179e7f,_0x398527){_0x179e7f=_0x179e7f-0x0;var _0x35e7c4=_0x23f2[_0x179e7f];return _0x35e7c4;};'use strict';var multer=require('multer');var util=require(_0x223f('0x0'));var path=require(_0x223f('0x1'));var timeout=require(_0x223f('0x2'));var express=require(_0x223f('0x3'));var router=express['Router']();var auth=require(_0x223f('0x4'));var interaction=require(_0x223f('0x5'));var config=require(_0x223f('0x6'));var controller=require(_0x223f('0x7'));router[_0x223f('0x8')]('/',auth[_0x223f('0x9')](),controller[_0x223f('0xa')]);router[_0x223f('0x8')]('/describe',auth[_0x223f('0x9')](),controller[_0x223f('0xb')]);router['get'](_0x223f('0xc'),auth['isAuthenticated'](),controller[_0x223f('0xd')]);router['post']('/',auth[_0x223f('0x9')](),interaction[_0x223f('0xe')](_0x223f('0xf'),_0x223f('0x10')),controller[_0x223f('0x11')]);router[_0x223f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x223f('0x13')]);router[_0x223f('0x12')](_0x223f('0x14'),auth[_0x223f('0x9')](),controller['accept']);router[_0x223f('0x12')](_0x223f('0x15'),auth[_0x223f('0x9')](),controller['reject']);router['delete']('/:id',auth[_0x223f('0x9')](),controller[_0x223f('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js
index 6b9c29a..f37d013 100644
--- a/server/api/openchannelMessage/openchannelMessage.attributes.js
+++ b/server/api/openchannelMessage/openchannelMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x007d=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x9315ee,_0x16e94a){var _0x5543eb=function(_0x1e094c){while(--_0x1e094c){_0x9315ee['push'](_0x9315ee['shift']());}};_0x5543eb(++_0x16e94a);}(_0x007d,0xb5));var _0xd007=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x007d[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xd007('0x0'));module['exports']={'body':{'type':Sequelize[_0xd007('0x1')](_0xd007('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd007('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd007('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd007('0x4')]('in',_0xd007('0x5')),'defaultValue':_0xd007('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd007('0x6')]}};
\ No newline at end of file
+var _0x1092=['exports','TEXT','medium','BOOLEAN','out','sequelize'];(function(_0x251bef,_0x3e7636){var _0x122f90=function(_0x23e493){while(--_0x23e493){_0x251bef['push'](_0x251bef['shift']());}};_0x122f90(++_0x3e7636);}(_0x1092,0xbf));var _0x2109=function(_0x520ecf,_0x10dcd6){_0x520ecf=_0x520ecf-0x0;var _0x2390a8=_0x1092[_0x520ecf];return _0x2390a8;};'use strict';var Sequelize=require(_0x2109('0x0'));module[_0x2109('0x1')]={'body':{'type':Sequelize[_0x2109('0x2')](_0x2109('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2109('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2109('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2109('0x5')),'defaultValue':_0x2109('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js
index e32ccef..94f149c 100644
--- a/server/api/openchannelMessage/openchannelMessage.controller.js
+++ b/server/api/openchannelMessage/openchannelMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf84d=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','json','count','offset','limit','set','reject','save','update','destroy','end','sendStatus','stack','name','send','index','OpenchannelMessage','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','map','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','channel','event','EventManager','acceptmessage','openchannel','agent','get','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','SIP/%s','rejectmessage','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3cdec6,_0x29f82b){var _0x484f68=function(_0x3be51e){while(--_0x3be51e){_0x3cdec6['push'](_0x3cdec6['shift']());}};_0x484f68(++_0x29f82b);}(_0xf84d,0x161));var _0xdf84=function(_0x134d5e,_0x2a47d8){_0x134d5e=_0x134d5e-0x0;var _0x1e166a=_0xf84d[_0x134d5e];return _0x1e166a;};'use strict';var pdf=require(_0xdf84('0x0'));var emlformat=require(_0xdf84('0x1'));var rimraf=require(_0xdf84('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdf84('0x3'));var moment=require(_0xdf84('0x4'));var BPromise=require(_0xdf84('0x5'));var Mustache=require('mustache');var util=require(_0xdf84('0x6'));var path=require(_0xdf84('0x7'));var sox=require(_0xdf84('0x8'));var csv=require(_0xdf84('0x9'));var ejs=require(_0xdf84('0xa'));var fs=require('fs');var _=require(_0xdf84('0xb'));var squel=require(_0xdf84('0xc'));var crypto=require(_0xdf84('0xd'));var jsforce=require(_0xdf84('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdf84('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdf84('0xf'));var authService=require(_0xdf84('0x10'));var qs=require(_0xdf84('0x11'));var hardwareService=require(_0xdf84('0x12'));var logger=require(_0xdf84('0x13'))(_0xdf84('0x14'));var utils=require(_0xdf84('0x15'));var config=require(_0xdf84('0x16'));var db=require(_0xdf84('0x17'))['db'];config[_0xdf84('0x18')]=_[_0xdf84('0x19')](config['redis'],{'host':_0xdf84('0x1a'),'port':0x18eb});var socket=require(_0xdf84('0x1b'))(new Redis(config['redis']));require(_0xdf84('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xdf84('0x1d')][_0xdf84('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x4719f3,_0x471a1a,_0x4ec05e){if(_0x4ec05e){var _0xc4e002=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc4e002[_0xdf84('0x1f')](_0x471a1a)){return _0x4719f3;}else{throw new Error(_0xdf84('0x20'));}}else{return _0x4719f3;}}function respondWithRpcPromise(_0x266b70,_0x1b6f90,_0x50a2c1,_0x4874ae){return new BPromise(function(_0x3acbaf,_0x50b896){var _0x58956d=_0x4874ae||client;return _0x58956d[_0xdf84('0x21')](_0x266b70,_0x50a2c1)[_0xdf84('0x22')](function(_0x1be124){logger[_0xdf84('0x23')](_0xdf84('0x24'),_0x1b6f90,'request\x20sent');logger['debug'](_0xdf84('0x25'),_0x1b6f90,'request\x20sent',JSON[_0xdf84('0x26')](_0x1be124));if(_0x1be124[_0xdf84('0x27')]){if(_0x1be124[_0xdf84('0x27')][_0xdf84('0x28')]===0x1f4){logger[_0xdf84('0x27')](_0xdf84('0x24'),_0x1b6f90,_0x1be124[_0xdf84('0x27')][_0xdf84('0x29')]);return _0x50b896(_0x1be124[_0xdf84('0x27')][_0xdf84('0x29')]);}logger['error'](_0xdf84('0x24'),_0x1b6f90,_0x1be124[_0xdf84('0x27')][_0xdf84('0x29')]);return _0x3acbaf(_0x1be124[_0xdf84('0x27')]['message']);}else{logger[_0xdf84('0x23')](_0xdf84('0x24'),_0x1b6f90,_0xdf84('0x2a'));_0x3acbaf(_0x1be124[_0xdf84('0x2b')][_0xdf84('0x29')]);}})[_0xdf84('0x2c')](function(_0x7a4ca8){logger[_0xdf84('0x27')](_0xdf84('0x24'),_0x1b6f90,_0x7a4ca8);_0x50b896(_0x7a4ca8);});});}function respondWithStatusCode(_0x23170c,_0x53a757){_0x53a757=_0x53a757||0xcc;return function(_0x163411){if(_0x163411){return _0x23170c['sendStatus'](_0x53a757);}return _0x23170c[_0xdf84('0x2d')](_0x53a757)['end']();};}function respondWithResult(_0x575416,_0x7ff5da){_0x7ff5da=_0x7ff5da||0xc8;return function(_0x597e86){if(_0x597e86){return _0x575416[_0xdf84('0x2d')](_0x7ff5da)[_0xdf84('0x2e')](_0x597e86);}};}function respondWithFilteredResult(_0x3cdc64,_0x546996){return function(_0x4a8903){if(_0x4a8903){var _0x2c15a9=_0x4a8903[_0xdf84('0x2f')],_0x8e0487=_0x546996[_0xdf84('0x30')],_0x2874e0=_0x546996[_0xdf84('0x30')]+_0x546996[_0xdf84('0x31')],_0x5bba5f;if(_0x2874e0>=_0x2c15a9){_0x2874e0=_0x2c15a9;_0x5bba5f=0xc8;}else{_0x5bba5f=0xce;}_0x3cdc64[_0xdf84('0x2d')](_0x5bba5f);return _0x3cdc64[_0xdf84('0x32')]('Content-Range',_0x8e0487+'-'+_0x2874e0+'/'+_0x2c15a9)['json'](_0x4a8903);}return null;};}function patchUpdates(_0x328940){return function(_0x1257ff){try{jsonpatch['apply'](_0x1257ff,_0x328940,!![]);}catch(_0xd7b4d3){return BPromise[_0xdf84('0x33')](_0xd7b4d3);}return _0x1257ff[_0xdf84('0x34')]();};}function saveUpdates(_0x39d0af,_0x571009){return function(_0x5b8486){if(_0x5b8486){return _0x5b8486[_0xdf84('0x35')](_0x39d0af)[_0xdf84('0x22')](function(_0x1df0bc){return _0x1df0bc;});}return null;};}function removeEntity(_0x408043,_0x56a66d){return function(_0x14eab0){if(_0x14eab0){return _0x14eab0[_0xdf84('0x36')]()[_0xdf84('0x22')](function(){_0x408043[_0xdf84('0x2d')](0xcc)[_0xdf84('0x37')]();});}};}function handleEntityNotFound(_0x3e0f19,_0x339c22){return function(_0x506fac){if(!_0x506fac){_0x3e0f19[_0xdf84('0x38')](0x194);}return _0x506fac;};}function handleError(_0x430fc8,_0x33bc52){_0x33bc52=_0x33bc52||0x1f4;return function(_0x4be2f0){logger[_0xdf84('0x27')](_0x4be2f0[_0xdf84('0x39')]);if(_0x4be2f0[_0xdf84('0x3a')]){delete _0x4be2f0[_0xdf84('0x3a')];}_0x430fc8[_0xdf84('0x2d')](_0x33bc52)[_0xdf84('0x3b')](_0x4be2f0);};}exports[_0xdf84('0x3c')]=function(_0x69faf7,_0x332d60){var _0x48f40c={},_0x18feab={},_0x15e65b={'count':0x0,'rows':[]};var _0x54de4c=db[_0xdf84('0x3d')]['rawAttributes'];_0x18feab[_0xdf84('0x3e')]=_[_0xdf84('0x3f')](_0x54de4c);_0x18feab[_0xdf84('0x40')]=_[_0xdf84('0x3f')](_0x69faf7[_0xdf84('0x40')]);_0x18feab[_0xdf84('0x41')]=_[_0xdf84('0x42')](_0x18feab['model'],_0x18feab[_0xdf84('0x40')]);_0x48f40c[_0xdf84('0x43')]=_['intersection'](_0x18feab[_0xdf84('0x3e')],qs[_0xdf84('0x44')](_0x69faf7[_0xdf84('0x40')][_0xdf84('0x44')]));_0x48f40c[_0xdf84('0x43')]=_0x48f40c['attributes'][_0xdf84('0x45')]?_0x48f40c['attributes']:_0x18feab[_0xdf84('0x3e')];if(!_0x69faf7[_0xdf84('0x40')]['hasOwnProperty'](_0xdf84('0x46'))){_0x48f40c[_0xdf84('0x31')]=qs[_0xdf84('0x31')](_0x69faf7[_0xdf84('0x40')][_0xdf84('0x31')]);_0x48f40c[_0xdf84('0x30')]=qs[_0xdf84('0x30')](_0x69faf7[_0xdf84('0x40')]['offset']);}_0x48f40c[_0xdf84('0x47')]=qs['sort'](_0x69faf7[_0xdf84('0x40')][_0xdf84('0x48')]);_0x48f40c['where']=qs['filters'](_[_0xdf84('0x49')](_0x69faf7['query'],_0x18feab['filters']));if(_0x69faf7[_0xdf84('0x40')][_0xdf84('0x4a')]){_0x48f40c[_0xdf84('0x4b')]=_['merge'](_0x48f40c['where'],{'$or':_[_0xdf84('0x4c')](_0x54de4c,function(_0x486f1c){if(_0x486f1c[_0xdf84('0x4d')]['key']!==_0xdf84('0x4e')){var _0x3685a4={};_0x3685a4[_0x486f1c['field']]={'$like':'%'+_0x69faf7[_0xdf84('0x40')][_0xdf84('0x4a')]+'%'};return _0x3685a4;}})});}_0x48f40c=_[_0xdf84('0x4f')]({},_0x48f40c,_0x69faf7[_0xdf84('0x50')]);var _0x4edf1c={'where':_0x48f40c[_0xdf84('0x4b')]};return db[_0xdf84('0x3d')]['count'](_0x4edf1c)[_0xdf84('0x22')](function(_0x1264dc){_0x15e65b[_0xdf84('0x2f')]=_0x1264dc;if(_0x69faf7[_0xdf84('0x40')][_0xdf84('0x51')]){_0x48f40c[_0xdf84('0x52')]=[{'all':!![]}];}return db[_0xdf84('0x3d')][_0xdf84('0x53')](_0x48f40c);})['then'](function(_0x30f890){_0x15e65b[_0xdf84('0x54')]=_0x30f890;return _0x15e65b;})[_0xdf84('0x22')](respondWithFilteredResult(_0x332d60,_0x48f40c))[_0xdf84('0x2c')](handleError(_0x332d60,null));};exports[_0xdf84('0x55')]=function(_0x37e3bd,_0x9d677f){var _0x4a6a71={'raw':!![],'where':{'id':_0x37e3bd['params']['id']}},_0xce3f33={};_0xce3f33[_0xdf84('0x3e')]=_[_0xdf84('0x3f')](db['OpenchannelMessage'][_0xdf84('0x56')]);_0xce3f33[_0xdf84('0x40')]=_[_0xdf84('0x3f')](_0x37e3bd['query']);_0xce3f33[_0xdf84('0x41')]=_[_0xdf84('0x42')](_0xce3f33[_0xdf84('0x3e')],_0xce3f33['query']);_0x4a6a71[_0xdf84('0x43')]=_[_0xdf84('0x42')](_0xce3f33[_0xdf84('0x3e')],qs['fields'](_0x37e3bd['query'][_0xdf84('0x44')]));_0x4a6a71[_0xdf84('0x43')]=_0x4a6a71[_0xdf84('0x43')][_0xdf84('0x45')]?_0x4a6a71[_0xdf84('0x43')]:_0xce3f33['model'];if(_0x37e3bd[_0xdf84('0x40')][_0xdf84('0x51')]){_0x4a6a71[_0xdf84('0x52')]=[{'all':!![]}];}_0x4a6a71=_[_0xdf84('0x4f')]({},_0x4a6a71,_0x37e3bd[_0xdf84('0x50')]);return db[_0xdf84('0x3d')][_0xdf84('0x57')](_0x4a6a71)[_0xdf84('0x22')](handleEntityNotFound(_0x9d677f,null))[_0xdf84('0x22')](respondWithResult(_0x9d677f,null))[_0xdf84('0x2c')](handleError(_0x9d677f,null));};exports[_0xdf84('0x58')]=function(_0x2e1f1f,_0x3339eb){return db[_0xdf84('0x3d')][_0xdf84('0x58')](_0x2e1f1f[_0xdf84('0x59')],{})[_0xdf84('0x22')](respondWithResult(_0x3339eb,0xc9))[_0xdf84('0x2c')](handleError(_0x3339eb,null));};exports['update']=function(_0x32ad71,_0xc8fa){if(_0x32ad71[_0xdf84('0x59')]['id']){delete _0x32ad71['body']['id'];}return db[_0xdf84('0x3d')][_0xdf84('0x57')]({'where':{'id':_0x32ad71[_0xdf84('0x5a')]['id']}})[_0xdf84('0x22')](handleEntityNotFound(_0xc8fa,null))[_0xdf84('0x22')](saveUpdates(_0x32ad71['body'],null))['then'](respondWithResult(_0xc8fa,null))[_0xdf84('0x2c')](handleError(_0xc8fa,null));};exports[_0xdf84('0x36')]=function(_0xefe04f,_0x1bc630){return db[_0xdf84('0x3d')][_0xdf84('0x57')]({'where':{'id':_0xefe04f[_0xdf84('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1bc630,null))[_0xdf84('0x22')](removeEntity(_0x1bc630,null))[_0xdf84('0x2c')](handleError(_0x1bc630,null));};exports['describe']=function(_0x7c892d,_0x491ce1){return db[_0xdf84('0x3d')][_0xdf84('0x5b')]()[_0xdf84('0x22')](respondWithResult(_0x491ce1,null))[_0xdf84('0x2c')](handleError(_0x491ce1,null));};var interaction_log=require('../../config/logger')(_0xdf84('0x5c'));exports[_0xdf84('0x5d')]=function(_0x8d8b9e,_0x3c3c82,_0x1fbaf8){var _0x581ac0={'channel':'openchannel'};if(_0x8d8b9e[_0xdf84('0x59')]['id']){delete _0x8d8b9e[_0xdf84('0x59')]['id'];}_0x8d8b9e[_0xdf84('0x59')][_0xdf84('0x5e')]=!![];_0x8d8b9e[_0xdf84('0x59')][_0xdf84('0x5f')]=moment()[_0xdf84('0x60')](_0xdf84('0x61'));_0x8d8b9e[_0xdf84('0x59')][_0xdf84('0x62')]=_0x8d8b9e[_0xdf84('0x59')][_0xdf84('0x62')]||_0x8d8b9e[_0xdf84('0x63')]['id'];return db[_0xdf84('0x3d')]['find']({'where':{'id':_0x8d8b9e[_0xdf84('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0xdf84('0x64')],'as':_0xdf84('0x65')}]})[_0xdf84('0x22')](handleEntityNotFound(_0x3c3c82,null))[_0xdf84('0x22')](saveUpdates(_0x8d8b9e[_0xdf84('0x59')],null))[_0xdf84('0x22')](function(_0x4756a1){if(_0x4756a1){_0x581ac0[_0xdf84('0x29')]=_0x4756a1['get']({'plain':!![]});return db[_0xdf84('0x66')]['find']({'where':{'id':_0x4756a1[_0xdf84('0x67')]}});}return null;})[_0xdf84('0x22')](handleEntityNotFound(_0x3c3c82,null))['then'](function(_0x5b1d0d){if(_0x5b1d0d){return _0x5b1d0d[_0xdf84('0x35')]({'UserId':_0x8d8b9e[_0xdf84('0x59')]['UserId'],'read1stAt':_[_0xdf84('0x68')](_0x5b1d0d[_0xdf84('0x69')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdf84('0x22')](function(_0x55c758){if(_0x55c758){_0x581ac0[_0xdf84('0x6a')]=_0x55c758['get']({'plain':!![]});interaction_log[_0xdf84('0x23')](_0xdf84('0x6b'),_0x8d8b9e['user']['id'],_0x8d8b9e[_0xdf84('0x63')][_0xdf84('0x3a')],_0x8d8b9e[_0xdf84('0x63')][_0xdf84('0x6c')],_0x581ac0['interaction']['id'],_0x8d8b9e[_0xdf84('0x59')]?JSON[_0xdf84('0x26')](_0x8d8b9e[_0xdf84('0x59')]):_0xdf84('0x6d'));return respondWithRpcPromise(_0xdf84('0x6e'),'acceptMessage',_0x581ac0);}return null;})[_0xdf84('0x22')](function(_0xa78018){if(_0xa78018){if(_0x8d8b9e[_0xdf84('0x59')]['manual']){_0x581ac0[_0xdf84('0x29')]['interface']=util[_0xdf84('0x60')]('SIP/%s',_0x8d8b9e['user'][_0xdf84('0x3a')]);_0x581ac0[_0xdf84('0x29')][_0xdf84('0x6f')]=_0x581ac0[_0xdf84('0x6f')];_0x581ac0[_0xdf84('0x29')][_0xdf84('0x70')]=_0xdf84('0x5d');return respondWithRpcPromise(_0xdf84('0x71'),_0xdf84('0x71'),{'event':_0xdf84('0x72'),'message':_0x581ac0[_0xdf84('0x29')]},client9002)[_0xdf84('0x22')](function(){return _0x581ac0;});}return _0x581ac0;}return null;})[_0xdf84('0x22')](respondWithResult(_0x3c3c82,null))[_0xdf84('0x2c')](handleError(_0x3c3c82,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xdf84('0x33')]=function(_0x1012a0,_0x10ddf2,_0x48dc8c){var _0x242e8a={'agent':{},'channel':_0xdf84('0x73')};if(_0x1012a0[_0xdf84('0x59')]['id']){delete _0x1012a0[_0xdf84('0x59')]['id'];}_0x1012a0[_0xdf84('0x59')]['UserId']=_0x1012a0[_0xdf84('0x59')]['UserId']||_0x1012a0['user']['id'];_0x242e8a[_0xdf84('0x74')]['id']=_0x1012a0[_0xdf84('0x59')][_0xdf84('0x62')];return db[_0xdf84('0x3d')]['find']({'where':{'id':_0x1012a0[_0xdf84('0x5a')]['id'],'UserId':null}})[_0xdf84('0x22')](handleEntityNotFound(_0x10ddf2,null))[_0xdf84('0x22')](function(_0x3c554e){if(_0x3c554e){_0x242e8a[_0xdf84('0x29')]=_0x3c554e[_0xdf84('0x75')]({'plain':!![]});return db['OpenchannelInteraction'][_0xdf84('0x57')]({'where':{'id':_0x3c554e[_0xdf84('0x67')]}});}return null;})[_0xdf84('0x22')](handleEntityNotFound(_0x10ddf2,null))[_0xdf84('0x22')](function(_0x1217c9){if(_0x1217c9){_0x242e8a[_0xdf84('0x6a')]=_0x1217c9[_0xdf84('0x75')]({'plain':!![]});interaction_log['info'](_0xdf84('0x76'),_0x1012a0[_0xdf84('0x63')]['id'],_0x1012a0[_0xdf84('0x63')]['name'],_0x1012a0['user'][_0xdf84('0x6c')],_0x242e8a['interaction']['id'],_0x1012a0[_0xdf84('0x59')]?JSON[_0xdf84('0x26')](_0x1012a0[_0xdf84('0x59')]):_0xdf84('0x6d'));return respondWithRpcPromise(_0xdf84('0x77'),_0xdf84('0x78'),_0x242e8a);}return null;})['then'](function(_0x95fdcf){if(_0x95fdcf){_0x95fdcf[_0xdf84('0x29')][_0xdf84('0x79')]=util[_0xdf84('0x60')](_0xdf84('0x7a'),_0x1012a0['user']['name']);_0x95fdcf[_0xdf84('0x29')]['channel']=_0x242e8a[_0xdf84('0x6f')];_0x95fdcf[_0xdf84('0x29')]['event']=_0xdf84('0x33');respondWithRpcPromise(_0xdf84('0x71'),_0xdf84('0x71'),{'event':_0xdf84('0x7b'),'message':_0x95fdcf[_0xdf84('0x29')]},client9002);return _0x242e8a;}return null;})[_0xdf84('0x22')](respondWithResult(_0x10ddf2,null))['catch'](handleError(_0x10ddf2,null));};
\ No newline at end of file
+var _0x9bd1=['ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','Content-Range','json','apply','save','update','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','count','includeAll','include','params','find','create','body','describe','openchannel-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','OpenchannelInteractionId','isNil','read1stAt','format','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','reject','openchannel','agent','get','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x5cb138,_0x1d2a80){var _0x16127a=function(_0x44daf4){while(--_0x44daf4){_0x5cb138['push'](_0x5cb138['shift']());}};_0x16127a(++_0x1d2a80);}(_0x9bd1,0x153));var _0x19bd=function(_0x310774,_0x415fab){_0x310774=_0x310774-0x0;var _0x49e695=_0x9bd1[_0x310774];return _0x49e695;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x19bd('0x0'));var rimraf=require(_0x19bd('0x1'));var zipdir=require(_0x19bd('0x2'));var jsonpatch=require(_0x19bd('0x3'));var rp=require(_0x19bd('0x4'));var moment=require(_0x19bd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x19bd('0x6'));var util=require(_0x19bd('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x19bd('0x8'));var squel=require('squel');var crypto=require(_0x19bd('0x9'));var jsforce=require(_0x19bd('0xa'));var deskjs=require(_0x19bd('0xb'));var toCsv=require(_0x19bd('0xc'));var querystring=require(_0x19bd('0xd'));var Papa=require(_0x19bd('0xe'));var Redis=require(_0x19bd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x19bd('0x10'));var logger=require(_0x19bd('0x11'))(_0x19bd('0x12'));var utils=require(_0x19bd('0x13'));var config=require(_0x19bd('0x14'));var db=require('../../mysqldb')['db'];config[_0x19bd('0x15')]=_['defaults'](config['redis'],{'host':_0x19bd('0x16'),'port':0x18eb});var socket=require(_0x19bd('0x17'))(new Redis(config[_0x19bd('0x15')]));require('./openchannelMessage.socket')[_0x19bd('0x18')](socket);var jayson=require(_0x19bd('0x19'));var client=jayson['client'][_0x19bd('0x1a')]({'port':0x232c});var client9002=jayson[_0x19bd('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x48170,_0x4ecd48,_0x13c915){if(_0x13c915){var _0x5994a4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5994a4['test'](_0x4ecd48)){return _0x48170;}else{throw new Error(_0x19bd('0x1c'));}}else{return _0x48170;}}function respondWithRpcPromise(_0x5e563d,_0x476b89,_0x3a9068,_0x517779){return new BPromise(function(_0x16f97e,_0x23e15a){var _0xe29c8f=_0x517779||client;return _0xe29c8f[_0x19bd('0x1d')](_0x5e563d,_0x3a9068)[_0x19bd('0x1e')](function(_0x2e1e0d){logger[_0x19bd('0x1f')](_0x19bd('0x20'),_0x476b89,'request\x20sent');logger[_0x19bd('0x21')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x476b89,_0x19bd('0x22'),JSON[_0x19bd('0x23')](_0x2e1e0d));if(_0x2e1e0d[_0x19bd('0x24')]){if(_0x2e1e0d[_0x19bd('0x24')][_0x19bd('0x25')]===0x1f4){logger[_0x19bd('0x24')](_0x19bd('0x20'),_0x476b89,_0x2e1e0d[_0x19bd('0x24')][_0x19bd('0x26')]);return _0x23e15a(_0x2e1e0d[_0x19bd('0x24')][_0x19bd('0x26')]);}logger['error'](_0x19bd('0x20'),_0x476b89,_0x2e1e0d['error'][_0x19bd('0x26')]);return _0x16f97e(_0x2e1e0d[_0x19bd('0x24')][_0x19bd('0x26')]);}else{logger[_0x19bd('0x1f')](_0x19bd('0x20'),_0x476b89,'request\x20sent');_0x16f97e(_0x2e1e0d[_0x19bd('0x27')][_0x19bd('0x26')]);}})[_0x19bd('0x28')](function(_0x2e97e2){logger[_0x19bd('0x24')](_0x19bd('0x20'),_0x476b89,_0x2e97e2);_0x23e15a(_0x2e97e2);});});}function respondWithStatusCode(_0x5c90da,_0x24c726){_0x24c726=_0x24c726||0xcc;return function(_0x3c9949){if(_0x3c9949){return _0x5c90da[_0x19bd('0x29')](_0x24c726);}return _0x5c90da[_0x19bd('0x2a')](_0x24c726)[_0x19bd('0x2b')]();};}function respondWithResult(_0x3d4abe,_0x4c67e1){_0x4c67e1=_0x4c67e1||0xc8;return function(_0x22892b){if(_0x22892b){return _0x3d4abe[_0x19bd('0x2a')](_0x4c67e1)['json'](_0x22892b);}};}function respondWithFilteredResult(_0x24acd6,_0x342270){return function(_0x5379c2){if(_0x5379c2){var _0x3d1703=_0x5379c2['count'],_0x2c8b60=_0x342270[_0x19bd('0x2c')],_0x42bb06=_0x342270[_0x19bd('0x2c')]+_0x342270[_0x19bd('0x2d')],_0x34fa1c;if(_0x42bb06>=_0x3d1703){_0x42bb06=_0x3d1703;_0x34fa1c=0xc8;}else{_0x34fa1c=0xce;}_0x24acd6[_0x19bd('0x2a')](_0x34fa1c);return _0x24acd6['set'](_0x19bd('0x2e'),_0x2c8b60+'-'+_0x42bb06+'/'+_0x3d1703)[_0x19bd('0x2f')](_0x5379c2);}return null;};}function patchUpdates(_0x52b584){return function(_0x68ec98){try{jsonpatch[_0x19bd('0x30')](_0x68ec98,_0x52b584,!![]);}catch(_0x2cedfe){return BPromise['reject'](_0x2cedfe);}return _0x68ec98[_0x19bd('0x31')]();};}function saveUpdates(_0x1d2926,_0x1a3371){return function(_0x525ad8){if(_0x525ad8){return _0x525ad8[_0x19bd('0x32')](_0x1d2926)['then'](function(_0xf7295b){return _0xf7295b;});}return null;};}function removeEntity(_0x128e03,_0x47f53b){return function(_0x4b16b8){if(_0x4b16b8){return _0x4b16b8[_0x19bd('0x33')]()[_0x19bd('0x1e')](function(){_0x128e03[_0x19bd('0x2a')](0xcc)[_0x19bd('0x2b')]();});}};}function handleEntityNotFound(_0x1a92e1,_0x4a7775){return function(_0x4e69b7){if(!_0x4e69b7){_0x1a92e1['sendStatus'](0x194);}return _0x4e69b7;};}function handleError(_0x101f63,_0x3eaec4){_0x3eaec4=_0x3eaec4||0x1f4;return function(_0x13f066){logger[_0x19bd('0x24')](_0x13f066[_0x19bd('0x34')]);if(_0x13f066[_0x19bd('0x35')]){delete _0x13f066['name'];}_0x101f63['status'](_0x3eaec4)[_0x19bd('0x36')](_0x13f066);};}exports[_0x19bd('0x37')]=function(_0xd113ec,_0xab75c2){var _0x2da127={},_0x1e19a7={},_0xa8b503={'count':0x0,'rows':[]};var _0x4a69a0=db[_0x19bd('0x38')][_0x19bd('0x39')];_0x1e19a7['model']=_[_0x19bd('0x3a')](_0x4a69a0);_0x1e19a7[_0x19bd('0x3b')]=_[_0x19bd('0x3a')](_0xd113ec[_0x19bd('0x3b')]);_0x1e19a7[_0x19bd('0x3c')]=_['intersection'](_0x1e19a7[_0x19bd('0x3d')],_0x1e19a7[_0x19bd('0x3b')]);_0x2da127[_0x19bd('0x3e')]=_[_0x19bd('0x3f')](_0x1e19a7[_0x19bd('0x3d')],qs['fields'](_0xd113ec[_0x19bd('0x3b')][_0x19bd('0x40')]));_0x2da127[_0x19bd('0x3e')]=_0x2da127[_0x19bd('0x3e')][_0x19bd('0x41')]?_0x2da127[_0x19bd('0x3e')]:_0x1e19a7['model'];if(!_0xd113ec[_0x19bd('0x3b')]['hasOwnProperty'](_0x19bd('0x42'))){_0x2da127['limit']=qs[_0x19bd('0x2d')](_0xd113ec[_0x19bd('0x3b')][_0x19bd('0x2d')]);_0x2da127[_0x19bd('0x2c')]=qs[_0x19bd('0x2c')](_0xd113ec[_0x19bd('0x3b')][_0x19bd('0x2c')]);}_0x2da127[_0x19bd('0x43')]=qs[_0x19bd('0x44')](_0xd113ec[_0x19bd('0x3b')][_0x19bd('0x44')]);_0x2da127[_0x19bd('0x45')]=qs[_0x19bd('0x3c')](_[_0x19bd('0x46')](_0xd113ec[_0x19bd('0x3b')],_0x1e19a7[_0x19bd('0x3c')]));if(_0xd113ec[_0x19bd('0x3b')][_0x19bd('0x47')]){_0x2da127[_0x19bd('0x45')]=_[_0x19bd('0x48')](_0x2da127[_0x19bd('0x45')],{'$or':_[_0x19bd('0x49')](_0x4a69a0,function(_0x4480ca){if(_0x4480ca[_0x19bd('0x4a')]['key']!==_0x19bd('0x4b')){var _0x8a8c66={};_0x8a8c66[_0x4480ca['field']]={'$like':'%'+_0xd113ec[_0x19bd('0x3b')][_0x19bd('0x47')]+'%'};return _0x8a8c66;}})});}_0x2da127=_[_0x19bd('0x48')]({},_0x2da127,_0xd113ec[_0x19bd('0x4c')]);var _0x30ecf5={'where':_0x2da127['where']};return db[_0x19bd('0x38')][_0x19bd('0x4d')](_0x30ecf5)[_0x19bd('0x1e')](function(_0x599399){_0xa8b503[_0x19bd('0x4d')]=_0x599399;if(_0xd113ec[_0x19bd('0x3b')][_0x19bd('0x4e')]){_0x2da127[_0x19bd('0x4f')]=[{'all':!![]}];}return db[_0x19bd('0x38')]['findAll'](_0x2da127);})[_0x19bd('0x1e')](function(_0x988180){_0xa8b503['rows']=_0x988180;return _0xa8b503;})[_0x19bd('0x1e')](respondWithFilteredResult(_0xab75c2,_0x2da127))[_0x19bd('0x28')](handleError(_0xab75c2,null));};exports['show']=function(_0x3d7549,_0xbf136){var _0x4367cc={'raw':!![],'where':{'id':_0x3d7549[_0x19bd('0x50')]['id']}},_0x3a1c37={};_0x3a1c37[_0x19bd('0x3d')]=_[_0x19bd('0x3a')](db[_0x19bd('0x38')][_0x19bd('0x39')]);_0x3a1c37[_0x19bd('0x3b')]=_[_0x19bd('0x3a')](_0x3d7549[_0x19bd('0x3b')]);_0x3a1c37[_0x19bd('0x3c')]=_[_0x19bd('0x3f')](_0x3a1c37[_0x19bd('0x3d')],_0x3a1c37[_0x19bd('0x3b')]);_0x4367cc['attributes']=_['intersection'](_0x3a1c37[_0x19bd('0x3d')],qs[_0x19bd('0x40')](_0x3d7549[_0x19bd('0x3b')][_0x19bd('0x40')]));_0x4367cc[_0x19bd('0x3e')]=_0x4367cc[_0x19bd('0x3e')][_0x19bd('0x41')]?_0x4367cc[_0x19bd('0x3e')]:_0x3a1c37[_0x19bd('0x3d')];if(_0x3d7549[_0x19bd('0x3b')]['includeAll']){_0x4367cc['include']=[{'all':!![]}];}_0x4367cc=_[_0x19bd('0x48')]({},_0x4367cc,_0x3d7549[_0x19bd('0x4c')]);return db[_0x19bd('0x38')][_0x19bd('0x51')](_0x4367cc)[_0x19bd('0x1e')](handleEntityNotFound(_0xbf136,null))[_0x19bd('0x1e')](respondWithResult(_0xbf136,null))[_0x19bd('0x28')](handleError(_0xbf136,null));};exports[_0x19bd('0x52')]=function(_0x3e2607,_0x50d101){return db[_0x19bd('0x38')][_0x19bd('0x52')](_0x3e2607[_0x19bd('0x53')],{})['then'](respondWithResult(_0x50d101,0xc9))['catch'](handleError(_0x50d101,null));};exports['update']=function(_0x170568,_0x461d53){if(_0x170568['body']['id']){delete _0x170568[_0x19bd('0x53')]['id'];}return db['OpenchannelMessage'][_0x19bd('0x51')]({'where':{'id':_0x170568[_0x19bd('0x50')]['id']}})['then'](handleEntityNotFound(_0x461d53,null))[_0x19bd('0x1e')](saveUpdates(_0x170568[_0x19bd('0x53')],null))[_0x19bd('0x1e')](respondWithResult(_0x461d53,null))['catch'](handleError(_0x461d53,null));};exports['destroy']=function(_0x3cebaf,_0x44fab1){return db['OpenchannelMessage']['find']({'where':{'id':_0x3cebaf[_0x19bd('0x50')]['id']}})[_0x19bd('0x1e')](handleEntityNotFound(_0x44fab1,null))[_0x19bd('0x1e')](removeEntity(_0x44fab1,null))['catch'](handleError(_0x44fab1,null));};exports[_0x19bd('0x54')]=function(_0x268f70,_0x2faf99){return db[_0x19bd('0x38')][_0x19bd('0x54')]()[_0x19bd('0x1e')](respondWithResult(_0x2faf99,null))[_0x19bd('0x28')](handleError(_0x2faf99,null));};var interaction_log=require('../../config/logger')(_0x19bd('0x55'));exports['accept']=function(_0x3ca74c,_0x189401,_0x248618){var _0x488e0f={'channel':'openchannel'};if(_0x3ca74c[_0x19bd('0x53')]['id']){delete _0x3ca74c[_0x19bd('0x53')]['id'];}_0x3ca74c[_0x19bd('0x53')][_0x19bd('0x56')]=!![];_0x3ca74c[_0x19bd('0x53')][_0x19bd('0x57')]=moment()['format'](_0x19bd('0x58'));_0x3ca74c['body'][_0x19bd('0x59')]=_0x3ca74c[_0x19bd('0x53')][_0x19bd('0x59')]||_0x3ca74c[_0x19bd('0x5a')]['id'];return db[_0x19bd('0x38')][_0x19bd('0x51')]({'where':{'id':_0x3ca74c[_0x19bd('0x50')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x19bd('0x5b')}]})[_0x19bd('0x1e')](handleEntityNotFound(_0x189401,null))[_0x19bd('0x1e')](saveUpdates(_0x3ca74c[_0x19bd('0x53')],null))[_0x19bd('0x1e')](function(_0x3496c4){if(_0x3496c4){_0x488e0f[_0x19bd('0x26')]=_0x3496c4['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x19bd('0x51')]({'where':{'id':_0x3496c4[_0x19bd('0x5c')]}});}return null;})['then'](handleEntityNotFound(_0x189401,null))[_0x19bd('0x1e')](function(_0xe4e8fc){if(_0xe4e8fc){return _0xe4e8fc[_0x19bd('0x32')]({'UserId':_0x3ca74c['body']['UserId'],'read1stAt':_[_0x19bd('0x5d')](_0xe4e8fc[_0x19bd('0x5e')])?moment()[_0x19bd('0x5f')](_0x19bd('0x58')):undefined});}return null;})[_0x19bd('0x1e')](function(_0x300d29){if(_0x300d29){_0x488e0f['interaction']=_0x300d29['get']({'plain':!![]});interaction_log[_0x19bd('0x1f')](_0x19bd('0x60'),_0x3ca74c['user']['id'],_0x3ca74c[_0x19bd('0x5a')][_0x19bd('0x35')],_0x3ca74c[_0x19bd('0x5a')][_0x19bd('0x61')],_0x488e0f[_0x19bd('0x62')]['id'],_0x3ca74c[_0x19bd('0x53')]?JSON['stringify'](_0x3ca74c['body']):'null');return respondWithRpcPromise(_0x19bd('0x63'),_0x19bd('0x64'),_0x488e0f);}return null;})['then'](function(_0x1fcfe6){if(_0x1fcfe6){if(_0x3ca74c[_0x19bd('0x53')][_0x19bd('0x65')]){_0x488e0f[_0x19bd('0x26')][_0x19bd('0x66')]=util[_0x19bd('0x5f')](_0x19bd('0x67'),_0x3ca74c['user'][_0x19bd('0x35')]);_0x488e0f[_0x19bd('0x26')][_0x19bd('0x68')]=_0x488e0f[_0x19bd('0x68')];_0x488e0f[_0x19bd('0x26')][_0x19bd('0x69')]=_0x19bd('0x6a');return respondWithRpcPromise('EventManager',_0x19bd('0x6b'),{'event':'acceptmessage','message':_0x488e0f[_0x19bd('0x26')]},client9002)[_0x19bd('0x1e')](function(){return _0x488e0f;});}return _0x488e0f;}return null;})['then'](respondWithResult(_0x189401,null))['catch'](handleError(_0x189401,null));};var interaction_log=require('../../config/logger')(_0x19bd('0x55'));exports[_0x19bd('0x6c')]=function(_0x5c3a70,_0xd24b0f,_0x25e49e){var _0xd243e8={'agent':{},'channel':_0x19bd('0x6d')};if(_0x5c3a70['body']['id']){delete _0x5c3a70[_0x19bd('0x53')]['id'];}_0x5c3a70[_0x19bd('0x53')]['UserId']=_0x5c3a70[_0x19bd('0x53')]['UserId']||_0x5c3a70[_0x19bd('0x5a')]['id'];_0xd243e8[_0x19bd('0x6e')]['id']=_0x5c3a70['body']['UserId'];return db[_0x19bd('0x38')][_0x19bd('0x51')]({'where':{'id':_0x5c3a70[_0x19bd('0x50')]['id'],'UserId':null}})[_0x19bd('0x1e')](handleEntityNotFound(_0xd24b0f,null))[_0x19bd('0x1e')](function(_0x52bf70){if(_0x52bf70){_0xd243e8[_0x19bd('0x26')]=_0x52bf70[_0x19bd('0x6f')]({'plain':!![]});return db[_0x19bd('0x70')][_0x19bd('0x51')]({'where':{'id':_0x52bf70['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xd24b0f,null))[_0x19bd('0x1e')](function(_0x5dbd3c){if(_0x5dbd3c){_0xd243e8['interaction']=_0x5dbd3c['get']({'plain':!![]});interaction_log[_0x19bd('0x1f')](_0x19bd('0x71'),_0x5c3a70[_0x19bd('0x5a')]['id'],_0x5c3a70[_0x19bd('0x5a')]['name'],_0x5c3a70[_0x19bd('0x5a')][_0x19bd('0x61')],_0xd243e8['interaction']['id'],_0x5c3a70[_0x19bd('0x53')]?JSON['stringify'](_0x5c3a70[_0x19bd('0x53')]):_0x19bd('0x72'));return respondWithRpcPromise(_0x19bd('0x73'),_0x19bd('0x74'),_0xd243e8);}return null;})[_0x19bd('0x1e')](function(_0x40a960){if(_0x40a960){_0x40a960[_0x19bd('0x26')][_0x19bd('0x66')]=util[_0x19bd('0x5f')](_0x19bd('0x67'),_0x5c3a70[_0x19bd('0x5a')][_0x19bd('0x35')]);_0x40a960['message'][_0x19bd('0x68')]=_0xd243e8[_0x19bd('0x68')];_0x40a960['message'][_0x19bd('0x69')]=_0x19bd('0x6c');respondWithRpcPromise(_0x19bd('0x6b'),_0x19bd('0x6b'),{'event':_0x19bd('0x75'),'message':_0x40a960[_0x19bd('0x26')]},client9002);return _0xd243e8;}return null;})[_0x19bd('0x1e')](respondWithResult(_0xd24b0f,null))['catch'](handleError(_0xd24b0f,null));};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js
index 900cbf6..e760d07 100644
--- a/server/api/openchannelMessage/openchannelMessage.events.js
+++ b/server/api/openchannelMessage/openchannelMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2c64=['hasOwnProperty','exports','events','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x2c64,0xbf));var _0x42c6=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x2c64[_0x1e4150];return _0x1ce3ee;};'use strict';var EventEmitter=require(_0x42c6('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x42c6('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x42c6('0x2')](0x0);var events={'afterCreate':_0x42c6('0x3'),'afterUpdate':_0x42c6('0x4'),'afterDestroy':_0x42c6('0x5')};function emitEvent(_0x588165){return function(_0x336832,_0x12e96f,_0x530259){OpenchannelMessageEvents[_0x42c6('0x6')](_0x588165+':'+_0x336832['id'],_0x336832);OpenchannelMessageEvents[_0x42c6('0x6')](_0x588165,_0x336832);_0x530259(null);};}for(var e in events){if(events[_0x42c6('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x42c6('0x8')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x6326=['save','update','remove','emit','exports','../../mysqldb','setMaxListeners'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6326,0x101));var _0x6632=function(_0x4b31ee,_0x44d2ea){_0x4b31ee=_0x4b31ee-0x0;var _0x2d5fb0=_0x6326[_0x4b31ee];return _0x2d5fb0;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x6632('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x6632('0x1')](0x0);var events={'afterCreate':_0x6632('0x2'),'afterUpdate':_0x6632('0x3'),'afterDestroy':_0x6632('0x4')};function emitEvent(_0x31f2fe){return function(_0x524488,_0x571ccf,_0x391ba4){OpenchannelMessageEvents['emit'](_0x31f2fe+':'+_0x524488['id'],_0x524488);OpenchannelMessageEvents[_0x6632('0x5')](_0x31f2fe,_0x524488);_0x391ba4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x6632('0x6')]=OpenchannelMessageEvents;
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js
index 3088d47..0c73ef8 100644
--- a/server/api/openchannelMessage/openchannelMessage.model.js
+++ b/server/api/openchannelMessage/openchannelMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8111=['OpenchannelMessage','openchannel_messages','body','FULLTEXT','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','then','createdAt','catch','CmContact','describe','find','Interactions','Contact','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','length','Interaction','omit','POST','method','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','inspect','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8111,0x1d6));var _0x1811=function(_0x25565e,_0x4690f6){_0x25565e=_0x25565e-0x0;var _0x910ec5=_0x8111[_0x25565e];return _0x910ec5;};'use strict';var _=require(_0x1811('0x0'));var util=require(_0x1811('0x1'));var logger=require(_0x1811('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1811('0x3'));var rp=require(_0x1811('0x4'));var fs=require('fs');var path=require(_0x1811('0x5'));var rimraf=require(_0x1811('0x6'));var config=require(_0x1811('0x7'));var attributes=require(_0x1811('0x8'));module[_0x1811('0x9')]=function(_0xd28d18,_0xcd155e){return _0xd28d18['define'](_0x1811('0xa'),attributes,{'tableName':_0x1811('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x1811('0xc')],'type':_0x1811('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x25da83,_0x27d585,_0x16e668){var _0x5b5df8=_0xd28d18['models'];var _0x13ae70=_0x25da83['get']({'plain':!![]});if(_0x13ae70[_0x1811('0xe')]['toLowerCase']()==='in'||_0x13ae70[_0x1811('0xe')][_0x1811('0xf')]()===_0x1811('0x10')&&!_0x13ae70['secret']&&!_[_0x1811('0x11')](_0x13ae70[_0x1811('0x12')])){_0x5b5df8[_0x1811('0x13')][_0x1811('0x14')]({'where':{'id':_0x13ae70['OpenchannelInteractionId']}})[_0x1811('0x15')](function(_0x2e0557){if(_0x2e0557){_0x2e0557['update']({'lastMsgAt':_0x13ae70[_0x1811('0x16')],'lastMsgDirection':_0x13ae70[_0x1811('0xe')]['toLowerCase']()});}})[_0x1811('0x17')](function(_0xc12cc1){console['error'](_0xc12cc1);});}if(_0x13ae70[_0x1811('0xe')]===_0x1811('0x10')&&!_0x13ae70['secret']){var _0x124538;_0x5b5df8[_0x1811('0x18')][_0x1811('0x19')]()[_0x1811('0x15')](function(_0x3c5290){return _0x5b5df8['OpenchannelAccount'][_0x1811('0x1a')]({'where':{'id':_0x13ae70['OpenchannelAccountId']},'include':[{'model':_0x5b5df8[_0x1811('0x13')],'as':_0x1811('0x1b'),'where':{'id':_0x13ae70['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x5b5df8[_0x1811('0x18')],'as':_0x1811('0x1c'),'attributes':_['keys'](_0x3c5290)}]}]});})[_0x1811('0x15')](function(_0x3957e2){_0x124538=_0x3957e2[_0x1811('0x1d')]({'plain':!![]});if(_0x124538&&_0x124538[_0x1811('0x1e')]){logger[_0x1811('0x1f')](_0x1811('0x20'),'afterCreate',util[_0x1811('0x21')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x13ae70['id'],_0x124538[_0x1811('0x1e')]));if(_0x124538[_0x1811('0x1b')]&&_0x124538['Interactions'][_0x1811('0x22')]){_0x13ae70[_0x1811('0x23')]=_[_0x1811('0x24')](_0x124538[_0x1811('0x1b')][0x0],_0x1811('0x1c'));_0x13ae70[_0x1811('0x1c')]=_0x124538[_0x1811('0x1b')][0x0][_0x1811('0x1c')];}var _0x27d585={'method':_0x1811('0x25'),'uri':encodeURI(_0x124538[_0x1811('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x27d585[_0x1811('0x26')]){case _0x1811('0x27'):_0x27d585['qs']=_0x13ae70;break;case _0x1811('0x25'):_0x27d585[_0x1811('0xc')]=_0x13ae70;break;}return rp(_0x27d585)['then'](function(_0x5984aa){logger[_0x1811('0x1f')](_0x1811('0x20'),_0x1811('0x28'),util[_0x1811('0x21')](_0x1811('0x29'),_0x13ae70['id'],_0x124538[_0x1811('0x1e')]));if(_0x5984aa[_0x1811('0xc')][_0x1811('0x2a')]&&_0x5984aa[_0x1811('0xc')]['threadId']!=_0x13ae70[_0x1811('0x23')][_0x1811('0x2a')]){return _0x5b5df8[_0x1811('0x13')][_0x1811('0x2b')]({'threadId':_0x5984aa[_0x1811('0xc')][_0x1811('0x2a')]},{'logging':!![],'where':{'id':_0x13ae70[_0x1811('0x23')]['id']}});}else{return;}})[_0x1811('0x15')](function(){return _0x25da83[_0x1811('0x2b')]({'read':!![]});})[_0x1811('0x17')](function(_0x25dc3b){logger[_0x1811('0x2c')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x1811('0x2d')](_0x25dc3b,{'showHidden':![],'depth':null}));_0x16e668();});}else{_0x16e668();}})[_0x1811('0x2e')](function(){_0x16e668();});}else{_0x16e668();}}},'charset':'utf8mb4','collate':_0x1811('0x2f')});};
\ No newline at end of file
+var _0xaf2c=['OpenchannelInteractionId','then','createdAt','direction','catch','error','CmContact','describe','find','OpenchannelInteraction','Interactions','Contact','get','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','replyUri','length','omit','POST','method','GET','format','threadId','Interaction','update','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','toLowerCase','out','secret','findOne'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xaf2c,0xb3));var _0xcaf2=function(_0x31e87e,_0x14f1da){_0x31e87e=_0x31e87e-0x0;var _0x2c5d24=_0xaf2c[_0x31e87e];return _0x2c5d24;};'use strict';var _=require(_0xcaf2('0x0'));var util=require(_0xcaf2('0x1'));var logger=require(_0xcaf2('0x2'))(_0xcaf2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcaf2('0x4'));var fs=require('fs');var path=require(_0xcaf2('0x5'));var rimraf=require(_0xcaf2('0x6'));var config=require(_0xcaf2('0x7'));var attributes=require(_0xcaf2('0x8'));module[_0xcaf2('0x9')]=function(_0xa06dff,_0x9d5b16){return _0xa06dff[_0xcaf2('0xa')](_0xcaf2('0xb'),attributes,{'tableName':_0xcaf2('0xc'),'paranoid':![],'indexes':[{'name':_0xcaf2('0xd'),'fields':[_0xcaf2('0xe')],'type':_0xcaf2('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39bcb4,_0x42663e,_0x2e8775){var _0x2b8a6c=_0xa06dff[_0xcaf2('0x10')];var _0x23e934=_0x39bcb4['get']({'plain':!![]});if(_0x23e934['direction'][_0xcaf2('0x11')]()==='in'||_0x23e934['direction'][_0xcaf2('0x11')]()===_0xcaf2('0x12')&&!_0x23e934[_0xcaf2('0x13')]&&!_['isNil'](_0x23e934['UserId'])){_0x2b8a6c['OpenchannelInteraction'][_0xcaf2('0x14')]({'where':{'id':_0x23e934[_0xcaf2('0x15')]}})[_0xcaf2('0x16')](function(_0x5c7b1b){if(_0x5c7b1b){_0x5c7b1b['update']({'lastMsgAt':_0x23e934[_0xcaf2('0x17')],'lastMsgDirection':_0x23e934[_0xcaf2('0x18')][_0xcaf2('0x11')]()});}})[_0xcaf2('0x19')](function(_0x4cefef){console[_0xcaf2('0x1a')](_0x4cefef);});}if(_0x23e934['direction']===_0xcaf2('0x12')&&!_0x23e934[_0xcaf2('0x13')]){var _0x3f0885;_0x2b8a6c[_0xcaf2('0x1b')][_0xcaf2('0x1c')]()['then'](function(_0x733d61){return _0x2b8a6c['OpenchannelAccount'][_0xcaf2('0x1d')]({'where':{'id':_0x23e934['OpenchannelAccountId']},'include':[{'model':_0x2b8a6c[_0xcaf2('0x1e')],'as':_0xcaf2('0x1f'),'where':{'id':_0x23e934['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x2b8a6c[_0xcaf2('0x1b')],'as':_0xcaf2('0x20'),'attributes':_['keys'](_0x733d61)}]}]});})['then'](function(_0x47502a){_0x3f0885=_0x47502a[_0xcaf2('0x21')]({'plain':!![]});if(_0x3f0885&&_0x3f0885['replyUri']){logger[_0xcaf2('0x22')](_0xcaf2('0x23'),_0xcaf2('0x24'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x23e934['id'],_0x3f0885[_0xcaf2('0x25')]));if(_0x3f0885['Interactions']&&_0x3f0885[_0xcaf2('0x1f')][_0xcaf2('0x26')]){_0x23e934['Interaction']=_[_0xcaf2('0x27')](_0x3f0885[_0xcaf2('0x1f')][0x0],_0xcaf2('0x20'));_0x23e934['Contact']=_0x3f0885[_0xcaf2('0x1f')][0x0][_0xcaf2('0x20')];}var _0x42663e={'method':_0xcaf2('0x28'),'uri':encodeURI(_0x3f0885[_0xcaf2('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x42663e[_0xcaf2('0x29')]){case _0xcaf2('0x2a'):_0x42663e['qs']=_0x23e934;break;case _0xcaf2('0x28'):_0x42663e['body']=_0x23e934;break;}return rp(_0x42663e)[_0xcaf2('0x16')](function(_0x396e60){logger[_0xcaf2('0x22')](_0xcaf2('0x23'),_0xcaf2('0x24'),util[_0xcaf2('0x2b')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x23e934['id'],_0x3f0885[_0xcaf2('0x25')]));if(_0x396e60['body'][_0xcaf2('0x2c')]&&_0x396e60['body']['threadId']!=_0x23e934[_0xcaf2('0x2d')][_0xcaf2('0x2c')]){return _0x2b8a6c[_0xcaf2('0x1e')][_0xcaf2('0x2e')]({'threadId':_0x396e60[_0xcaf2('0xe')][_0xcaf2('0x2c')]},{'logging':!![],'where':{'id':_0x23e934[_0xcaf2('0x2d')]['id']}});}else{return;}})[_0xcaf2('0x16')](function(){return _0x39bcb4[_0xcaf2('0x2e')]({'read':!![]});})[_0xcaf2('0x19')](function(_0x61286){logger[_0xcaf2('0x1a')](_0xcaf2('0x23'),_0xcaf2('0x24'),util['inspect'](_0x61286,{'showHidden':![],'depth':null}));_0x2e8775();});}else{_0x2e8775();}})[_0xcaf2('0x2f')](function(){_0x2e8775();});}else{_0x2e8775();}}},'charset':_0xcaf2('0x30'),'collate':_0xcaf2('0x31')});};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js
index 119232b..398a037 100644
--- a/server/api/openchannelMessage/openchannelMessage.rpc.js
+++ b/server/api/openchannelMessage/openchannelMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3366=['OpenchannelMessage','create','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','CreateOpenchannelMessage'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x3366,0xc5));var _0x6336=function(_0x2fc6cf,_0x2bb133){_0x2fc6cf=_0x2fc6cf-0x0;var _0xf2ade3=_0x3366[_0x2fc6cf];return _0xf2ade3;};'use strict';var _=require(_0x6336('0x0'));var util=require(_0x6336('0x1'));var moment=require(_0x6336('0x2'));var BPromise=require(_0x6336('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6336('0x4'));var db=require(_0x6336('0x5'))['db'];var utils=require(_0x6336('0x6'));var logger=require(_0x6336('0x7'))(_0x6336('0x8'));var config=require(_0x6336('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6336('0xa')][_0x6336('0xb')]({'port':0x232a});config[_0x6336('0xc')]=_['defaults'](config[_0x6336('0xc')],{'host':_0x6336('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6336('0xc')]));require(_0x6336('0xe'))[_0x6336('0xf')](socket);function respondWithRpcPromise(_0x2dc4ca,_0x13f8e5,_0x456559){return new BPromise(function(_0x77d817,_0x2dd108){return client[_0x6336('0x10')](_0x2dc4ca,_0x456559)[_0x6336('0x11')](function(_0xc18bcb){logger['info'](_0x6336('0x12'),_0x13f8e5,'request\x20sent');logger[_0x6336('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x13f8e5,'request\x20sent',JSON[_0x6336('0x14')](_0xc18bcb));if(_0xc18bcb['error']){if(_0xc18bcb['error']['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x13f8e5,_0xc18bcb[_0x6336('0x15')][_0x6336('0x16')]);return _0x2dd108(_0xc18bcb[_0x6336('0x15')]['message']);}logger[_0x6336('0x15')]('OpenchannelMessage,\x20%s,\x20%s',_0x13f8e5,_0xc18bcb[_0x6336('0x15')][_0x6336('0x16')]);return _0x77d817(_0xc18bcb[_0x6336('0x15')][_0x6336('0x16')]);}else{logger[_0x6336('0x17')](_0x6336('0x12'),_0x13f8e5,_0x6336('0x18'));_0x77d817(_0xc18bcb[_0x6336('0x19')][_0x6336('0x16')]);}})['catch'](function(_0x7cc184){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x13f8e5,_0x7cc184);_0x2dd108(_0x7cc184);});});}exports[_0x6336('0x1a')]=function(_0x1809f2){var _0x50cf53=this;return new Promise(function(_0xee1f87,_0x262920){return db[_0x6336('0x1b')][_0x6336('0x1c')](_0x1809f2['body'],{'raw':_0x1809f2['options']?_0x1809f2[_0x6336('0x1d')][_0x6336('0x1e')]===undefined?!![]:![]:!![]})[_0x6336('0x11')](function(_0x58c1bf){logger[_0x6336('0x17')]('CreateOpenchannelMessage',_0x1809f2);logger[_0x6336('0x13')](_0x6336('0x1a'),_0x1809f2,JSON[_0x6336('0x14')](_0x58c1bf));_0xee1f87(_0x58c1bf);})[_0x6336('0x1f')](function(_0x3eaf47){logger[_0x6336('0x15')](_0x6336('0x1a'),_0x3eaf47[_0x6336('0x16')],_0x1809f2);_0x262920(_0x50cf53[_0x6336('0x15')](0x1f4,_0x3eaf47[_0x6336('0x16')]));});});};
\ No newline at end of file
+var _0x7567=['OpenchannelMessage','create','options','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','request','then','info','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','CreateOpenchannelMessage'];(function(_0x33bbea,_0x4337c5){var _0x516ac2=function(_0x123bbc){while(--_0x123bbc){_0x33bbea['push'](_0x33bbea['shift']());}};_0x516ac2(++_0x4337c5);}(_0x7567,0x143));var _0x7756=function(_0x303a50,_0x56405b){_0x303a50=_0x303a50-0x0;var _0xf71a9c=_0x7567[_0x303a50];return _0xf71a9c;};'use strict';var _=require(_0x7756('0x0'));var util=require(_0x7756('0x1'));var moment=require(_0x7756('0x2'));var BPromise=require(_0x7756('0x3'));var rs=require(_0x7756('0x4'));var fs=require('fs');var Redis=require(_0x7756('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7756('0x6'));var logger=require(_0x7756('0x7'))(_0x7756('0x8'));var config=require(_0x7756('0x9'));var jayson=require(_0x7756('0xa'));var client=jayson['client'][_0x7756('0xb')]({'port':0x232a});config[_0x7756('0xc')]=_[_0x7756('0xd')](config[_0x7756('0xc')],{'host':_0x7756('0xe'),'port':0x18eb});var socket=require(_0x7756('0xf'))(new Redis(config[_0x7756('0xc')]));require(_0x7756('0x10'))['register'](socket);function respondWithRpcPromise(_0x58d891,_0x4f0081,_0x217251){return new BPromise(function(_0x59387c,_0x5ca726){return client[_0x7756('0x11')](_0x58d891,_0x217251)[_0x7756('0x12')](function(_0x23e939){logger[_0x7756('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f0081,_0x7756('0x14'));logger['debug'](_0x7756('0x15'),_0x4f0081,_0x7756('0x14'),JSON[_0x7756('0x16')](_0x23e939));if(_0x23e939[_0x7756('0x17')]){if(_0x23e939[_0x7756('0x17')]['code']===0x1f4){logger[_0x7756('0x17')](_0x7756('0x18'),_0x4f0081,_0x23e939[_0x7756('0x17')][_0x7756('0x19')]);return _0x5ca726(_0x23e939['error'][_0x7756('0x19')]);}logger[_0x7756('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f0081,_0x23e939[_0x7756('0x17')][_0x7756('0x19')]);return _0x59387c(_0x23e939[_0x7756('0x17')][_0x7756('0x19')]);}else{logger[_0x7756('0x13')](_0x7756('0x18'),_0x4f0081,'request\x20sent');_0x59387c(_0x23e939[_0x7756('0x1a')][_0x7756('0x19')]);}})[_0x7756('0x1b')](function(_0x10964a){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x4f0081,_0x10964a);_0x5ca726(_0x10964a);});});}exports[_0x7756('0x1c')]=function(_0x430ecd){var _0x432776=this;return new Promise(function(_0x34937a,_0x3c1be5){return db[_0x7756('0x1d')][_0x7756('0x1e')](_0x430ecd['body'],{'raw':_0x430ecd[_0x7756('0x1f')]?_0x430ecd[_0x7756('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x7756('0x12')](function(_0x1ac55d){logger[_0x7756('0x13')]('CreateOpenchannelMessage',_0x430ecd);logger['debug'](_0x7756('0x1c'),_0x430ecd,JSON[_0x7756('0x16')](_0x1ac55d));_0x34937a(_0x1ac55d);})[_0x7756('0x1b')](function(_0x579cb7){logger[_0x7756('0x17')]('CreateOpenchannelMessage',_0x579cb7[_0x7756('0x19')],_0x430ecd);_0x3c1be5(_0x432776[_0x7756('0x17')](0x1f4,_0x579cb7[_0x7756('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js
index dcc2679..866c05e 100644
--- a/server/api/openchannelMessage/openchannelMessage.socket.js
+++ b/server/api/openchannelMessage/openchannelMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5ad3=['register','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x32bce8,_0x54f965){_0x32bce8=_0x32bce8-0x0;var _0x38badc=_0x5ad3[_0x32bce8];return _0x38badc;};'use strict';var OpenchannelMessageEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){OpenchannelMessageEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);OpenchannelMessageEvents['on'](_0x292521,_0x3cec3e);}};
\ No newline at end of file
+var _0x57d4=['length','./openchannelMessage.events','save','update','emit','removeListener','register'];(function(_0x592763,_0x70d7d1){var _0x2c298b=function(_0xdb32d4){while(--_0xdb32d4){_0x592763['push'](_0x592763['shift']());}};_0x2c298b(++_0x70d7d1);}(_0x57d4,0x78));var _0x457d=function(_0x1f3227,_0x29e050){_0x1f3227=_0x1f3227-0x0;var _0x2c7cc7=_0x57d4[_0x1f3227];return _0x2c7cc7;};'use strict';var OpenchannelMessageEvents=require(_0x457d('0x0'));var events=[_0x457d('0x1'),'remove',_0x457d('0x2')];function createListener(_0xa408c8,_0x1e26ab){return function(_0x30a25c){_0x1e26ab[_0x457d('0x3')](_0xa408c8,_0x30a25c);};}function removeListener(_0x3c89b2,_0x3e2239){return function(){OpenchannelMessageEvents[_0x457d('0x4')](_0x3c89b2,_0x3e2239);};}exports[_0x457d('0x5')]=function(_0x247ec7){for(var _0x3fd867=0x0,_0x5c6816=events[_0x457d('0x6')];_0x3fd867<_0x5c6816;_0x3fd867++){var _0x381e22=events[_0x3fd867];var _0x4e32c0=createListener('openchannelMessage:'+_0x381e22,_0x247ec7);OpenchannelMessageEvents['on'](_0x381e22,_0x4e32c0);}};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js
index a9cff38..df09659 100644
--- a/server/api/openchannelQueue/index.js
+++ b/server/api/openchannelQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x568e=['../../components/interaction/service','./openchannelQueue.controller','isAuthenticated','index','/describe','describe','get','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','connect-timeout','Router','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x568e,0x1b0));var _0xe568=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x568e[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe568('0x0'));var express=require('express');var router=express[_0xe568('0x1')]();var auth=require(_0xe568('0x2'));var interaction=require(_0xe568('0x3'));var config=require('../../config/environment');var controller=require(_0xe568('0x4'));router['get']('/',auth[_0xe568('0x5')](),controller[_0xe568('0x6')]);router['get'](_0xe568('0x7'),auth[_0xe568('0x5')](),controller[_0xe568('0x8')]);router[_0xe568('0x9')]('/:id',auth[_0xe568('0x5')](),controller[_0xe568('0xa')]);router[_0xe568('0x9')](_0xe568('0xb'),auth[_0xe568('0x5')](),controller[_0xe568('0xc')]);router[_0xe568('0x9')]('/:id/teams',auth[_0xe568('0x5')](),controller[_0xe568('0xd')]);router[_0xe568('0x9')](_0xe568('0xe'),auth[_0xe568('0x5')](),controller[_0xe568('0xf')]);router['post']('/',auth[_0xe568('0x5')](),controller[_0xe568('0x10')]);router[_0xe568('0x11')](_0xe568('0x12'),auth[_0xe568('0x5')](),controller[_0xe568('0x13')]);router[_0xe568('0x11')](_0xe568('0xe'),auth[_0xe568('0x5')](),controller[_0xe568('0x14')]);router[_0xe568('0x15')](_0xe568('0x16'),auth['isAuthenticated'](),controller[_0xe568('0x17')]);router[_0xe568('0x18')](_0xe568('0x16'),auth[_0xe568('0x5')](),controller[_0xe568('0x19')]);router[_0xe568('0x18')](_0xe568('0x12'),auth['isAuthenticated'](),controller[_0xe568('0x1a')]);router[_0xe568('0x18')](_0xe568('0xe'),auth[_0xe568('0x5')](),controller[_0xe568('0x1b')]);module[_0xe568('0x1c')]=router;
\ No newline at end of file
+var _0xc6df=['post','create','addTeams','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x3b7ac6,_0x501f60){var _0x45a3f0=function(_0x1dbeff){while(--_0x1dbeff){_0x3b7ac6['push'](_0x3b7ac6['shift']());}};_0x45a3f0(++_0x501f60);}(_0xc6df,0x1c2));var _0xfc6d=function(_0x749b27,_0x16ead2){_0x749b27=_0x749b27-0x0;var _0x4a8a75=_0xc6df[_0x749b27];return _0x4a8a75;};'use strict';var multer=require(_0xfc6d('0x0'));var util=require(_0xfc6d('0x1'));var path=require(_0xfc6d('0x2'));var timeout=require(_0xfc6d('0x3'));var express=require(_0xfc6d('0x4'));var router=express['Router']();var auth=require(_0xfc6d('0x5'));var interaction=require(_0xfc6d('0x6'));var config=require(_0xfc6d('0x7'));var controller=require('./openchannelQueue.controller');router[_0xfc6d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfc6d('0x8')](_0xfc6d('0x9'),auth[_0xfc6d('0xa')](),controller['describe']);router[_0xfc6d('0x8')](_0xfc6d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xfc6d('0x8')](_0xfc6d('0xc'),auth[_0xfc6d('0xa')](),controller[_0xfc6d('0xd')]);router[_0xfc6d('0x8')](_0xfc6d('0xe'),auth[_0xfc6d('0xa')](),controller[_0xfc6d('0xf')]);router[_0xfc6d('0x8')](_0xfc6d('0x10'),auth['isAuthenticated'](),controller[_0xfc6d('0x11')]);router[_0xfc6d('0x12')]('/',auth[_0xfc6d('0xa')](),controller[_0xfc6d('0x13')]);router['post'](_0xfc6d('0xe'),auth[_0xfc6d('0xa')](),controller[_0xfc6d('0x14')]);router[_0xfc6d('0x12')]('/:id/users',auth[_0xfc6d('0xa')](),controller['addAgents']);router['put']('/:id',auth[_0xfc6d('0xa')](),controller[_0xfc6d('0x15')]);router['delete'](_0xfc6d('0xb'),auth[_0xfc6d('0xa')](),controller['destroy']);router[_0xfc6d('0x16')](_0xfc6d('0xe'),auth[_0xfc6d('0xa')](),controller[_0xfc6d('0x17')]);router[_0xfc6d('0x16')](_0xfc6d('0x10'),auth[_0xfc6d('0xa')](),controller[_0xfc6d('0x18')]);module[_0xfc6d('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js
index af6dbc9..4eda043 100644
--- a/server/api/openchannelQueue/openchannelQueue.attributes.js
+++ b/server/api/openchannelQueue/openchannelQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4955=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x2c31d3,_0x460193){var _0x3c4057=function(_0x5ec580){while(--_0x5ec580){_0x2c31d3['push'](_0x2c31d3['shift']());}};_0x3c4057(++_0x460193);}(_0x4955,0x1e7));var _0x5495=function(_0x270226,_0x2f4259){_0x270226=_0x270226-0x0;var _0x13bd07=_0x4955[_0x270226];return _0x13bd07;};'use strict';var Sequelize=require(_0x5495('0x0'));module['exports']={'name':{'type':Sequelize[_0x5495('0x1')],'unique':_0x5495('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5495('0x3')](_0x5495('0x4'),_0x5495('0x5'),_0x5495('0x6'))}};
\ No newline at end of file
+var _0x0cd2=['rrmemory','beepall','sequelize','exports','name','STRING','INTEGER','ENUM'];(function(_0x48f440,_0x205b56){var _0xcc60f=function(_0x320c20){while(--_0x320c20){_0x48f440['push'](_0x48f440['shift']());}};_0xcc60f(++_0x205b56);}(_0x0cd2,0x1ea));var _0x20cd=function(_0x1c6bb4,_0x3b98ba){_0x1c6bb4=_0x1c6bb4-0x0;var _0xd0ab8d=_0x0cd2[_0x1c6bb4];return _0xd0ab8d;};'use strict';var Sequelize=require(_0x20cd('0x0'));module[_0x20cd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x20cd('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x20cd('0x3')]},'timeout':{'type':Sequelize[_0x20cd('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x20cd('0x5')](_0x20cd('0x6'),_0x20cd('0x7'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js
index 15bcfa6..0cb428d 100644
--- a/server/api/openchannelQueue/openchannelQueue.controller.js
+++ b/server/api/openchannelQueue/openchannelQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd56=['redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','error','name','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','map','type','VIRTUAL','field','filter','options','OpenchannelQueue','count','include','findAll','catch','params','merge','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','teams','Team','Agents','interface','flatMap','transaction','addTeams','findOrCreate','forEach','emit','removeTeams','ids','select','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','includes','all','compact','value','isEmpty','removeAgents','addAgents','omit','userOpenchannelQueue:save','isArray','userOpenchannelQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x223b3e,_0x473457){var _0x210292=function(_0x5e1101){while(--_0x5e1101){_0x223b3e['push'](_0x223b3e['shift']());}};_0x210292(++_0x473457);}(_0xcd56,0xfa));var _0x6cd5=function(_0xccabf0,_0x3d82db){_0xccabf0=_0xccabf0-0x0;var _0x591c97=_0xcd56[_0xccabf0];return _0x591c97;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6cd5('0x0'));var zipdir=require(_0x6cd5('0x1'));var jsonpatch=require(_0x6cd5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6cd5('0x3'));var Mustache=require(_0x6cd5('0x4'));var util=require(_0x6cd5('0x5'));var path=require(_0x6cd5('0x6'));var sox=require(_0x6cd5('0x7'));var csv=require(_0x6cd5('0x8'));var ejs=require(_0x6cd5('0x9'));var fs=require('fs');var _=require(_0x6cd5('0xa'));var squel=require(_0x6cd5('0xb'));var crypto=require(_0x6cd5('0xc'));var jsforce=require(_0x6cd5('0xd'));var deskjs=require(_0x6cd5('0xe'));var toCsv=require(_0x6cd5('0x8'));var querystring=require(_0x6cd5('0xf'));var Papa=require(_0x6cd5('0x10'));var Redis=require('ioredis');var authService=require(_0x6cd5('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6cd5('0x12'));var logger=require(_0x6cd5('0x13'))(_0x6cd5('0x14'));var utils=require('../../config/utils');var config=require(_0x6cd5('0x15'));var db=require('../../mysqldb')['db'];config[_0x6cd5('0x16')]=_['defaults'](config[_0x6cd5('0x16')],{'host':_0x6cd5('0x17'),'port':0x18eb});var socket=require(_0x6cd5('0x18'))(new Redis(config[_0x6cd5('0x16')]));require(_0x6cd5('0x19'))[_0x6cd5('0x1a')](socket);function respondWithStatusCode(_0x1d719e,_0x5d66be){_0x5d66be=_0x5d66be||0xcc;return function(_0x1c1904){if(_0x1c1904){return _0x1d719e[_0x6cd5('0x1b')](_0x5d66be);}return _0x1d719e[_0x6cd5('0x1c')](_0x5d66be)['end']();};}function respondWithResult(_0x5671c4,_0x1a6783){_0x1a6783=_0x1a6783||0xc8;return function(_0x2c385c){if(_0x2c385c){return _0x5671c4[_0x6cd5('0x1c')](_0x1a6783)[_0x6cd5('0x1d')](_0x2c385c);}};}function respondWithFilteredResult(_0x4f0486,_0x2be766){return function(_0x2b21d0){if(_0x2b21d0){var _0x446cd5=_0x2b21d0['count'],_0x2de803=_0x2be766[_0x6cd5('0x1e')],_0x430511=_0x2be766[_0x6cd5('0x1e')]+_0x2be766['limit'],_0x3e4a45;if(_0x430511>=_0x446cd5){_0x430511=_0x446cd5;_0x3e4a45=0xc8;}else{_0x3e4a45=0xce;}_0x4f0486[_0x6cd5('0x1c')](_0x3e4a45);return _0x4f0486['set'](_0x6cd5('0x1f'),_0x2de803+'-'+_0x430511+'/'+_0x446cd5)[_0x6cd5('0x1d')](_0x2b21d0);}return null;};}function patchUpdates(_0x1f167c){return function(_0x3149d7){try{jsonpatch[_0x6cd5('0x20')](_0x3149d7,_0x1f167c,!![]);}catch(_0x10c2d1){return BPromise[_0x6cd5('0x21')](_0x10c2d1);}return _0x3149d7[_0x6cd5('0x22')]();};}function saveUpdates(_0x30682c,_0x125387){return function(_0x9d55c2){if(_0x9d55c2){return _0x9d55c2[_0x6cd5('0x23')](_0x30682c)[_0x6cd5('0x24')](function(_0x187dc7){return _0x187dc7;});}return null;};}function removeEntity(_0xa12467,_0x4236c7){return function(_0x80644c){if(_0x80644c){return _0x80644c[_0x6cd5('0x25')]()[_0x6cd5('0x24')](function(){var _0x34c4dc=_0x80644c['get']({'plain':!![]});var _0x14461f='OpenchannelQueues';return db[_0x6cd5('0x26')][_0x6cd5('0x25')]({'where':{'type':_0x14461f,'resourceId':_0x34c4dc['id']}})[_0x6cd5('0x24')](function(){return _0x80644c;});})[_0x6cd5('0x24')](function(){_0xa12467['status'](0xcc)[_0x6cd5('0x27')]();});}};}function handleEntityNotFound(_0x5e15b6,_0x4a0474){return function(_0x88d53b){if(!_0x88d53b){_0x5e15b6[_0x6cd5('0x1b')](0x194);}return _0x88d53b;};}function handleError(_0x5459fb,_0xf14bb0){_0xf14bb0=_0xf14bb0||0x1f4;return function(_0x3ffe93){logger[_0x6cd5('0x28')](_0x3ffe93['stack']);if(_0x3ffe93[_0x6cd5('0x29')]){delete _0x3ffe93[_0x6cd5('0x29')];}_0x5459fb[_0x6cd5('0x1c')](_0xf14bb0)['send'](_0x3ffe93);};}exports[_0x6cd5('0x2a')]=function(_0x56944c,_0x78b8fc){var _0x4a99da={},_0x4fcff0={},_0x18d716={'count':0x0,'rows':[]};var _0x17b84e=db['OpenchannelQueue'][_0x6cd5('0x2b')];_0x4fcff0[_0x6cd5('0x2c')]=_[_0x6cd5('0x2d')](_0x17b84e);_0x4fcff0[_0x6cd5('0x2e')]=_['keys'](_0x56944c[_0x6cd5('0x2e')]);_0x4fcff0[_0x6cd5('0x2f')]=_['intersection'](_0x4fcff0['model'],_0x4fcff0[_0x6cd5('0x2e')]);_0x4a99da['attributes']=_[_0x6cd5('0x30')](_0x4fcff0['model'],qs[_0x6cd5('0x31')](_0x56944c[_0x6cd5('0x2e')][_0x6cd5('0x31')]));_0x4a99da[_0x6cd5('0x32')]=_0x4a99da[_0x6cd5('0x32')][_0x6cd5('0x33')]?_0x4a99da[_0x6cd5('0x32')]:_0x4fcff0[_0x6cd5('0x2c')];if(!_0x56944c[_0x6cd5('0x2e')][_0x6cd5('0x34')]('nolimit')){_0x4a99da[_0x6cd5('0x35')]=qs[_0x6cd5('0x35')](_0x56944c[_0x6cd5('0x2e')][_0x6cd5('0x35')]);_0x4a99da[_0x6cd5('0x1e')]=qs['offset'](_0x56944c['query'][_0x6cd5('0x1e')]);}_0x4a99da[_0x6cd5('0x36')]=qs['sort'](_0x56944c['query'][_0x6cd5('0x37')]);_0x4a99da[_0x6cd5('0x38')]=qs[_0x6cd5('0x2f')](_[_0x6cd5('0x39')](_0x56944c[_0x6cd5('0x2e')],_0x4fcff0[_0x6cd5('0x2f')]));if(_0x56944c[_0x6cd5('0x2e')]['filter']){_0x4a99da['where']=_['merge'](_0x4a99da[_0x6cd5('0x38')],{'$or':_[_0x6cd5('0x3a')](_0x17b84e,function(_0x49c798){if(_0x49c798[_0x6cd5('0x3b')]['key']!==_0x6cd5('0x3c')){var _0x5f2008={};_0x5f2008[_0x49c798[_0x6cd5('0x3d')]]={'$like':'%'+_0x56944c[_0x6cd5('0x2e')][_0x6cd5('0x3e')]+'%'};return _0x5f2008;}})});}_0x4a99da=_['merge']({},_0x4a99da,_0x56944c[_0x6cd5('0x3f')]);var _0x4689d7={'where':_0x4a99da[_0x6cd5('0x38')]};return db[_0x6cd5('0x40')][_0x6cd5('0x41')](_0x4689d7)['then'](function(_0x105c9a){_0x18d716[_0x6cd5('0x41')]=_0x105c9a;if(_0x56944c[_0x6cd5('0x2e')]['includeAll']){_0x4a99da[_0x6cd5('0x42')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x6cd5('0x43')](_0x4a99da);})[_0x6cd5('0x24')](function(_0xbc9419){_0x18d716['rows']=_0xbc9419;return _0x18d716;})['then'](respondWithFilteredResult(_0x78b8fc,_0x4a99da))[_0x6cd5('0x44')](handleError(_0x78b8fc,null));};exports['show']=function(_0x1445e7,_0x5c4572){var _0x35680c={'raw':!![],'where':{'id':_0x1445e7[_0x6cd5('0x45')]['id']}},_0x5b1d1f={};_0x5b1d1f[_0x6cd5('0x2c')]=_['keys'](db[_0x6cd5('0x40')]['rawAttributes']);_0x5b1d1f[_0x6cd5('0x2e')]=_[_0x6cd5('0x2d')](_0x1445e7['query']);_0x5b1d1f[_0x6cd5('0x2f')]=_[_0x6cd5('0x30')](_0x5b1d1f[_0x6cd5('0x2c')],_0x5b1d1f[_0x6cd5('0x2e')]);_0x35680c[_0x6cd5('0x32')]=_[_0x6cd5('0x30')](_0x5b1d1f['model'],qs['fields'](_0x1445e7[_0x6cd5('0x2e')]['fields']));_0x35680c[_0x6cd5('0x32')]=_0x35680c['attributes'][_0x6cd5('0x33')]?_0x35680c[_0x6cd5('0x32')]:_0x5b1d1f['model'];if(_0x1445e7['query']['includeAll']){_0x35680c[_0x6cd5('0x42')]=[{'all':!![]}];}_0x35680c=_[_0x6cd5('0x46')]({},_0x35680c,_0x1445e7[_0x6cd5('0x3f')]);return db[_0x6cd5('0x40')]['find'](_0x35680c)[_0x6cd5('0x24')](handleEntityNotFound(_0x5c4572,null))[_0x6cd5('0x24')](respondWithResult(_0x5c4572,null))[_0x6cd5('0x44')](handleError(_0x5c4572,null));};exports[_0x6cd5('0x47')]=function(_0x227ee5,_0x46dc91){return db['OpenchannelQueue'][_0x6cd5('0x47')](_0x227ee5[_0x6cd5('0x48')],{})[_0x6cd5('0x24')](function(_0x2bf7c4){var _0x43bb25=_0x227ee5[_0x6cd5('0x49')][_0x6cd5('0x4a')]({'plain':!![]});if(!_0x43bb25)throw new Error(_0x6cd5('0x4b'));if(_0x43bb25[_0x6cd5('0x4c')]===_0x6cd5('0x49')){var _0x2e7b2b=_0x2bf7c4['get']({'plain':!![]});var _0x4b2412=_0x6cd5('0x4d');return db[_0x6cd5('0x4e')][_0x6cd5('0x4f')]({'where':{'name':_0x4b2412,'userProfileId':_0x43bb25['userProfileId']},'raw':!![]})[_0x6cd5('0x24')](function(_0x38aa9f){if(_0x38aa9f&&_0x38aa9f[_0x6cd5('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x2e7b2b['name'],'resourceId':_0x2e7b2b['id'],'type':_0x38aa9f[_0x6cd5('0x29')],'sectionId':_0x38aa9f['id']},{})[_0x6cd5('0x24')](function(){return _0x2bf7c4;});}else{return _0x2bf7c4;}})[_0x6cd5('0x44')](function(_0x428cbc){logger[_0x6cd5('0x28')](_0x6cd5('0x51'),_0x428cbc);throw _0x428cbc;});}return _0x2bf7c4;})[_0x6cd5('0x24')](respondWithResult(_0x46dc91,0xc9))['catch'](handleError(_0x46dc91,null));};exports[_0x6cd5('0x23')]=function(_0x3767bb,_0x50e09b){if(_0x3767bb[_0x6cd5('0x48')]['id']){delete _0x3767bb[_0x6cd5('0x48')]['id'];}return db[_0x6cd5('0x40')]['find']({'where':{'id':_0x3767bb[_0x6cd5('0x45')]['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x50e09b,null))['then'](saveUpdates(_0x3767bb['body'],null))[_0x6cd5('0x24')](respondWithResult(_0x50e09b,null))[_0x6cd5('0x44')](handleError(_0x50e09b,null));};exports[_0x6cd5('0x25')]=function(_0xadce10,_0x5b5077){return db[_0x6cd5('0x40')]['find']({'where':{'id':_0xadce10['params']['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x5b5077,null))['then'](removeEntity(_0x5b5077,null))[_0x6cd5('0x44')](handleError(_0x5b5077,null));};exports[_0x6cd5('0x52')]=function(_0x5f0cc5,_0xca0d78){return db[_0x6cd5('0x40')][_0x6cd5('0x52')]()[_0x6cd5('0x24')](respondWithResult(_0xca0d78,null))[_0x6cd5('0x44')](handleError(_0xca0d78,null));};exports[_0x6cd5('0x53')]=function(_0x264139,_0x1b0da0,_0x575209){var _0x18fc60={'raw':!![],'where':{}},_0x1ad30b={},_0x378977;return db[_0x6cd5('0x40')][_0x6cd5('0x54')]({'where':{'id':_0x264139[_0x6cd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b0da0,null))[_0x6cd5('0x24')](function(_0x8d8f5b){if(_0x8d8f5b){_0x378977=_0x8d8f5b[_0x6cd5('0x4a')]({'plain':!![]});_0x1ad30b[_0x6cd5('0x2c')]=_['keys'](db['UserOpenchannelQueue']['rawAttributes']);_0x1ad30b[_0x6cd5('0x2e')]=_[_0x6cd5('0x2d')](_0x264139[_0x6cd5('0x2e')]);_0x1ad30b[_0x6cd5('0x2f')]=_[_0x6cd5('0x30')](_0x1ad30b[_0x6cd5('0x2c')],_0x1ad30b['query']);_0x18fc60['attributes']=_[_0x6cd5('0x30')](_0x1ad30b[_0x6cd5('0x2c')],qs[_0x6cd5('0x31')](_0x264139[_0x6cd5('0x2e')][_0x6cd5('0x31')]));_0x18fc60['attributes']=_0x18fc60[_0x6cd5('0x32')][_0x6cd5('0x33')]?_0x18fc60['attributes']:_0x1ad30b[_0x6cd5('0x2c')];if(!_0x264139['query'][_0x6cd5('0x34')](_0x6cd5('0x55'))){_0x18fc60[_0x6cd5('0x35')]=qs[_0x6cd5('0x35')](_0x264139[_0x6cd5('0x2e')]['limit']);_0x18fc60[_0x6cd5('0x1e')]=qs[_0x6cd5('0x1e')](_0x264139[_0x6cd5('0x2e')][_0x6cd5('0x1e')]);}_0x18fc60[_0x6cd5('0x36')]=qs[_0x6cd5('0x37')](_0x264139[_0x6cd5('0x2e')][_0x6cd5('0x37')]);_0x18fc60[_0x6cd5('0x38')]=qs[_0x6cd5('0x2f')](_[_0x6cd5('0x39')](_0x264139[_0x6cd5('0x2e')],_0x1ad30b['filters']));_0x18fc60['where'][_0x6cd5('0x56')]=_0x8d8f5b['id'];if(_0x264139['query'][_0x6cd5('0x3e')]){_0x18fc60['where']=_[_0x6cd5('0x46')](_0x18fc60['where'],{'$or':_['map'](_0x18fc60[_0x6cd5('0x32')],function(_0x3b8ba2){var _0x2a3d02={};_0x2a3d02[_0x3b8ba2]={'$like':'%'+_0x264139['query']['filter']+'%'};return _0x2a3d02;})});}_0x18fc60=_[_0x6cd5('0x46')]({},_0x18fc60,_0x264139[_0x6cd5('0x3f')]);return db[_0x6cd5('0x57')][_0x6cd5('0x43')](_0x18fc60);}})[_0x6cd5('0x24')](function(_0x5ced86){if(_0x5ced86){return db[_0x6cd5('0x58')][_0x6cd5('0x59')]({'where':{'id':_[_0x6cd5('0x3a')](_0x5ced86,_0x6cd5('0x5a')),'role':_0x6cd5('0x5b')},'attributes':['id',_0x6cd5('0x29'),_0x6cd5('0x5c'),_0x6cd5('0x5d'),_0x6cd5('0x5e')]});}})['then'](function(_0xcb3f84){if(_0xcb3f84){return{'count':_0xcb3f84[_0x6cd5('0x41')],'rows':_['map'](_0xcb3f84['rows'],function(_0x38bfa5){return{'membername':_0x38bfa5[_0x6cd5('0x29')],'UserId':_0x38bfa5['id'],'queue_name':_0x378977[_0x6cd5('0x29')],'OpenchannelQueueId':_0x378977['id'],'interface':util['format'](_0x6cd5('0x5f'),_0x6cd5('0x60'),_0x38bfa5[_0x6cd5('0x29')]),'penalty':0x0,'paused':_0x38bfa5['openchannelPause'],'createdAt':_0x38bfa5[_0x6cd5('0x5e')],'updatedAt':_0x38bfa5[_0x6cd5('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6cd5('0x24')](respondWithFilteredResult(_0x1b0da0,_0x18fc60))[_0x6cd5('0x44')](handleError(_0x1b0da0,null));};exports[_0x6cd5('0x61')]=function(_0x21a2d9,_0x118bda,_0x3cfcd5){var _0xfecd32={};var _0x43126b={};var _0xc7b8af;var _0x3d5eb0;return db[_0x6cd5('0x40')]['findOne']({'where':{'id':_0x21a2d9['params']['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x118bda,null))[_0x6cd5('0x24')](function(_0x465554){if(_0x465554){_0xc7b8af=_0x465554;_0x43126b['model']=_[_0x6cd5('0x2d')](db['Team'][_0x6cd5('0x2b')]);_0x43126b['query']=_[_0x6cd5('0x2d')](_0x21a2d9[_0x6cd5('0x2e')]);_0x43126b[_0x6cd5('0x2f')]=_[_0x6cd5('0x30')](_0x43126b['model'],_0x43126b[_0x6cd5('0x2e')]);_0xfecd32[_0x6cd5('0x32')]=_['intersection'](_0x43126b[_0x6cd5('0x2c')],qs[_0x6cd5('0x31')](_0x21a2d9[_0x6cd5('0x2e')]['fields']));_0xfecd32[_0x6cd5('0x32')]=_0xfecd32[_0x6cd5('0x32')]['length']?_0xfecd32[_0x6cd5('0x32')]:_0x43126b['model'];_0xfecd32[_0x6cd5('0x36')]=qs[_0x6cd5('0x37')](_0x21a2d9[_0x6cd5('0x2e')][_0x6cd5('0x37')]);_0xfecd32[_0x6cd5('0x38')]=qs[_0x6cd5('0x2f')](_[_0x6cd5('0x39')](_0x21a2d9[_0x6cd5('0x2e')],_0x43126b[_0x6cd5('0x2f')]));if(_0x21a2d9[_0x6cd5('0x2e')][_0x6cd5('0x3e')]){_0xfecd32['where']=_[_0x6cd5('0x46')](_0xfecd32[_0x6cd5('0x38')],{'$or':_['map'](_0xfecd32[_0x6cd5('0x32')],function(_0x86eeaf){var _0x33c050={};_0x33c050[_0x86eeaf]={'$like':'%'+_0x21a2d9[_0x6cd5('0x2e')][_0x6cd5('0x3e')]+'%'};return _0x33c050;})});}_0xfecd32=_['merge']({},_0xfecd32,_0x21a2d9[_0x6cd5('0x3f')]);return _0xc7b8af['getTeams'](_0xfecd32);}})[_0x6cd5('0x24')](function(_0x145bb5){if(_0x145bb5){_0x3d5eb0=_0x145bb5['length'];if(!_0x21a2d9['query'][_0x6cd5('0x34')](_0x6cd5('0x55'))){_0xfecd32['limit']=qs['limit'](_0x21a2d9['query'][_0x6cd5('0x35')]);_0xfecd32[_0x6cd5('0x1e')]=qs['offset'](_0x21a2d9[_0x6cd5('0x2e')][_0x6cd5('0x1e')]);}return _0xc7b8af[_0x6cd5('0x61')](_0xfecd32);}})[_0x6cd5('0x24')](function(_0x18fb59){if(_0x18fb59){return _0x18fb59?{'count':_0x3d5eb0,'rows':_0x18fb59}:null;}})[_0x6cd5('0x24')](respondWithResult(_0x118bda,null))[_0x6cd5('0x44')](handleError(_0x118bda,null));};exports['addTeams']=function(_0x162e4c,_0x5393e0,_0x229e5a){var _0x4a5898=_0x162e4c[_0x6cd5('0x48')][_0x6cd5('0x62')];return db[_0x6cd5('0x63')][_0x6cd5('0x43')]({'where':{'id':_[_0x6cd5('0x3a')](_0x4a5898,'id')},'attributes':['id'],'include':[{'model':db[_0x6cd5('0x58')],'as':_0x6cd5('0x64'),'attributes':['id','name','online','voicePause',_0x6cd5('0x65')],'raw':!![]}]})[_0x6cd5('0x24')](function(_0x27298e){if(_0x27298e){var _0xeb227e=_[_0x6cd5('0x66')](_0x27298e,function(_0x2b4f9b){var _0x4f23ca=_0x2b4f9b[_0x6cd5('0x4a')]({'plain':!![]});return _0x4f23ca[_0x6cd5('0x64')];});return db[_0x6cd5('0x40')][_0x6cd5('0x4f')]({'where':{'id':_0x162e4c[_0x6cd5('0x45')]['id']}})['then'](function(_0x2cbc1f){return db['sequelize'][_0x6cd5('0x67')](function(_0xbb2341){return _0x2cbc1f[_0x6cd5('0x68')](_[_0x6cd5('0x3a')](_0x4a5898,'id'),{'transaction':_0xbb2341})[_0x6cd5('0x24')](function(){return BPromise['each'](_0xeb227e,function(_0x4fb1be){return db[_0x6cd5('0x57')][_0x6cd5('0x69')]({'where':{'UserId':_0x4fb1be['id'],'OpenchannelQueueId':_0x162e4c['params']['id']},'transaction':_0xbb2341});});})[_0x6cd5('0x24')](function(){_0xeb227e[_0x6cd5('0x6a')](function(_0x6fff2d){socket[_0x6cd5('0x6b')]('userOpenchannelQueue:save',{'UserId':_0x6fff2d['id'],'OpenchannelQueueId':_0x2cbc1f['id']});});});});});}})[_0x6cd5('0x24')](respondWithStatusCode(_0x5393e0,null))[_0x6cd5('0x44')](handleError(_0x5393e0,null));};exports[_0x6cd5('0x6c')]=function(_0xda0c3d,_0xac7bff,_0x1eeb28){return db['Team'][_0x6cd5('0x43')]({'where':{'id':_0xda0c3d[_0x6cd5('0x2e')][_0x6cd5('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x6cd5('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6cd5('0x24')](handleEntityNotFound(_0xac7bff,null))[_0x6cd5('0x24')](function(_0x78cd17){var _0x20aa88=_[_0x6cd5('0x3a')](_0x78cd17,'id');var _0x5f4f16=[];var _0x3e039e=[];var _0x16741f=squel[_0x6cd5('0x6e')]();_0x16741f['field'](_0x6cd5('0x6f'))[_0x6cd5('0x70')](_0x6cd5('0x71'),'tq')[_0x6cd5('0x72')](_0x6cd5('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6cd5('0x38')](_0x6cd5('0x74'),_0xda0c3d[_0x6cd5('0x45')]['id']);for(var _0x59f87d=0x0;_0x59f87d<_0x78cd17['length'];_0x59f87d+=0x1){let _0x8fac0e=_0x78cd17[_0x59f87d];for(var _0x5b2aa1=0x0;_0x5b2aa1<_0x8fac0e['Agents'][_0x6cd5('0x33')];_0x5b2aa1+=0x1){let _0x38f59e=_0x8fac0e[_0x6cd5('0x64')][_0x5b2aa1];var _0x39affd=_0x16741f[_0x6cd5('0x75')]();_0x39affd[_0x6cd5('0x38')](_0x6cd5('0x76'),_0x38f59e['id']);_0x3e039e[_0x6cd5('0x77')](db[_0x6cd5('0x78')][_0x6cd5('0x2e')](_0x39affd[_0x6cd5('0x79')](),{'type':db[_0x6cd5('0x78')][_0x6cd5('0x7a')][_0x6cd5('0x7b')]})['then'](function(_0x52002c){if(_0x52002c['length']===0x1){return _0x38f59e['id'];}else{var _0x4c6947=_['every'](_['map'](_0x52002c,'TeamId'),function(_0x564751){return _[_0x6cd5('0x7c')](_0x20aa88,_0x564751);});if(_0x4c6947){return _0x38f59e['id'];}}}));}}return BPromise[_0x6cd5('0x7d')](_0x3e039e)[_0x6cd5('0x24')](function(_0x58072f){_0x5f4f16=_(_0x5f4f16)['union'](_0x58072f)[_0x6cd5('0x7e')]()[_0x6cd5('0x7f')]();return db['OpenchannelQueue'][_0x6cd5('0x4f')]({'where':{'id':_0xda0c3d['params']['id']}})[_0x6cd5('0x24')](function(_0x50de7e){return db[_0x6cd5('0x78')][_0x6cd5('0x67')](function(_0x459b83){return _0x50de7e['removeTeams'](_0xda0c3d['query'][_0x6cd5('0x6d')],{'transaction':_0x459b83})[_0x6cd5('0x24')](function(){if(!_[_0x6cd5('0x80')](_0x5f4f16)){return _0x50de7e[_0x6cd5('0x81')](_0x5f4f16,{'transaction':_0x459b83});}})[_0x6cd5('0x24')](function(){_0x5f4f16[_0x6cd5('0x6a')](function(_0x3d1cb7){socket[_0x6cd5('0x6b')]('userOpenchannelQueue:remove',{'UserId':_0x3d1cb7,'OpenchannelQueueId':_0x50de7e['id']});});});});});});})[_0x6cd5('0x24')](respondWithStatusCode(_0xac7bff,null))[_0x6cd5('0x44')](handleError(_0xac7bff,null));};exports[_0x6cd5('0x82')]=function(_0x56f85e,_0x40bac,_0x6aefff){return db['OpenchannelQueue']['find']({'where':{'id':_0x56f85e[_0x6cd5('0x45')]['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x40bac,null))['then'](function(_0x2f5c75){if(_0x2f5c75){return _0x2f5c75['addAgents'](_0x56f85e['body'][_0x6cd5('0x6d')],_[_0x6cd5('0x83')](_0x56f85e[_0x6cd5('0x48')],[_0x6cd5('0x6d'),'id'])||{})['spread'](function(_0x2c34b3){for(var _0x2d29fe=0x0;_0x2d29fe<_0x56f85e['body'][_0x6cd5('0x6d')][_0x6cd5('0x33')];_0x2d29fe+=0x1){socket[_0x6cd5('0x6b')](_0x6cd5('0x84'),{'UserId':_0x56f85e[_0x6cd5('0x48')][_0x6cd5('0x6d')][_0x2d29fe],'OpenchannelQueueId':_0x56f85e[_0x6cd5('0x45')]['id']});}return _0x2c34b3;});}})['then'](respondWithResult(_0x40bac,null))[_0x6cd5('0x44')](handleError(_0x40bac,null));};exports[_0x6cd5('0x81')]=function(_0x2bef4c,_0x11c1b5,_0x1ab9d5){return db[_0x6cd5('0x40')][_0x6cd5('0x4f')]({'where':{'id':_0x2bef4c['params']['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x11c1b5,null))['then'](function(_0xef702a){if(_0xef702a){return _0xef702a['removeAgents'](_0x2bef4c[_0x6cd5('0x2e')][_0x6cd5('0x6d')])['then'](function(){if(_[_0x6cd5('0x85')](_0x2bef4c[_0x6cd5('0x2e')]['ids'])){for(var _0x157b7d=0x0;_0x157b7d<_0x2bef4c['query'][_0x6cd5('0x6d')][_0x6cd5('0x33')];_0x157b7d+=0x1){socket[_0x6cd5('0x6b')](_0x6cd5('0x86'),{'UserId':Number(_0x2bef4c[_0x6cd5('0x2e')][_0x6cd5('0x6d')][_0x157b7d]),'OpenchannelQueueId':Number(_0x2bef4c[_0x6cd5('0x45')]['id'])});}}else{socket['emit'](_0x6cd5('0x86'),{'UserId':Number(_0x2bef4c['query']['ids']),'OpenchannelQueueId':Number(_0x2bef4c[_0x6cd5('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x11c1b5,null))[_0x6cd5('0x44')](handleError(_0x11c1b5,null));};exports['getAgents']=function(_0x31822b,_0x2dfbd1,_0x3ba698){var _0x388e35={};var _0xc7fa0b={};var _0x3650d6;var _0x127a56;return db[_0x6cd5('0x40')][_0x6cd5('0x54')]({'where':{'id':_0x31822b[_0x6cd5('0x45')]['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x2dfbd1,null))[_0x6cd5('0x24')](function(_0x55b275){if(_0x55b275){_0x3650d6=_0x55b275;_0xc7fa0b['model']=_[_0x6cd5('0x2d')](db[_0x6cd5('0x58')][_0x6cd5('0x2b')]);_0xc7fa0b['query']=_[_0x6cd5('0x2d')](_0x31822b[_0x6cd5('0x2e')]);_0xc7fa0b[_0x6cd5('0x2f')]=_['intersection'](_0xc7fa0b[_0x6cd5('0x2c')],_0xc7fa0b[_0x6cd5('0x2e')]);_0x388e35[_0x6cd5('0x32')]=_[_0x6cd5('0x30')](_0xc7fa0b[_0x6cd5('0x2c')],qs['fields'](_0x31822b['query'][_0x6cd5('0x31')]));_0x388e35['attributes']=_0x388e35[_0x6cd5('0x32')][_0x6cd5('0x33')]?_0x388e35[_0x6cd5('0x32')]:_0xc7fa0b[_0x6cd5('0x2c')];_0x388e35['order']=qs[_0x6cd5('0x37')](_0x31822b[_0x6cd5('0x2e')][_0x6cd5('0x37')]);_0x388e35[_0x6cd5('0x38')]=qs[_0x6cd5('0x2f')](_[_0x6cd5('0x39')](_0x31822b[_0x6cd5('0x2e')],_0xc7fa0b['filters']));if(_0x31822b['query'][_0x6cd5('0x3e')]){_0x388e35[_0x6cd5('0x38')]=_[_0x6cd5('0x46')](_0x388e35[_0x6cd5('0x38')],{'$or':_[_0x6cd5('0x3a')](_0x388e35[_0x6cd5('0x32')],function(_0x783882){var _0x2fa7bb={};_0x2fa7bb[_0x783882]={'$like':'%'+_0x31822b[_0x6cd5('0x2e')][_0x6cd5('0x3e')]+'%'};return _0x2fa7bb;})});}_0x388e35=_['merge']({},_0x388e35,_0x31822b[_0x6cd5('0x3f')]);return _0x3650d6[_0x6cd5('0x87')](_0x388e35);}})['then'](function(_0x505726){if(_0x505726){_0x127a56=_0x505726[_0x6cd5('0x33')];if(!_0x31822b['query'][_0x6cd5('0x34')](_0x6cd5('0x55'))){_0x388e35['limit']=qs[_0x6cd5('0x35')](_0x31822b[_0x6cd5('0x2e')][_0x6cd5('0x35')]);_0x388e35['offset']=qs[_0x6cd5('0x1e')](_0x31822b[_0x6cd5('0x2e')]['offset']);}return _0x3650d6[_0x6cd5('0x87')](_0x388e35);}})[_0x6cd5('0x24')](function(_0x532f73){if(_0x532f73){return _0x532f73?{'count':_0x127a56,'rows':_0x532f73}:null;}})[_0x6cd5('0x24')](respondWithResult(_0x2dfbd1,null))['catch'](handleError(_0x2dfbd1,null));};
\ No newline at end of file
+var _0xc213=['OpenchannelQueue','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','findAll','rows','catch','show','params','length','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','%s/%s','findOne','Team','getTeams','addTeams','teams','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','ids','tq.TeamId','team_has_openchannel_queues','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','get','OpenchannelQueues','UserProfileResource','stack','name','send','index'];(function(_0x66ae08,_0x36d4ea){var _0xbcb259=function(_0x320e4b){while(--_0x320e4b){_0x66ae08['push'](_0x66ae08['shift']());}};_0xbcb259(++_0x36d4ea);}(_0xc213,0x1e4));var _0x3c21=function(_0x5fba5e,_0x505192){_0x5fba5e=_0x5fba5e-0x0;var _0x3991ea=_0xc213[_0x5fba5e];return _0x3991ea;};'use strict';var pdf=require(_0x3c21('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3c21('0x1'));var zipdir=require(_0x3c21('0x2'));var jsonpatch=require(_0x3c21('0x3'));var rp=require('request-promise');var moment=require(_0x3c21('0x4'));var BPromise=require(_0x3c21('0x5'));var Mustache=require(_0x3c21('0x6'));var util=require(_0x3c21('0x7'));var path=require(_0x3c21('0x8'));var sox=require(_0x3c21('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3c21('0xa'));var squel=require(_0x3c21('0xb'));var crypto=require('crypto');var jsforce=require(_0x3c21('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3c21('0xd'));var querystring=require(_0x3c21('0xe'));var Papa=require(_0x3c21('0xf'));var Redis=require('ioredis');var authService=require(_0x3c21('0x10'));var qs=require(_0x3c21('0x11'));var hardwareService=require(_0x3c21('0x12'));var logger=require('../../config/logger')(_0x3c21('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x3c21('0x14')]=_[_0x3c21('0x15')](config[_0x3c21('0x14')],{'host':_0x3c21('0x16'),'port':0x18eb});var socket=require(_0x3c21('0x17'))(new Redis(config[_0x3c21('0x14')]));require('./openchannelQueue.socket')[_0x3c21('0x18')](socket);function respondWithStatusCode(_0x141cb7,_0x21409b){_0x21409b=_0x21409b||0xcc;return function(_0x2846c9){if(_0x2846c9){return _0x141cb7[_0x3c21('0x19')](_0x21409b);}return _0x141cb7[_0x3c21('0x1a')](_0x21409b)[_0x3c21('0x1b')]();};}function respondWithResult(_0x30c3ab,_0x173237){_0x173237=_0x173237||0xc8;return function(_0x1a1542){if(_0x1a1542){return _0x30c3ab['status'](_0x173237)[_0x3c21('0x1c')](_0x1a1542);}};}function respondWithFilteredResult(_0xcad627,_0x4465db){return function(_0x1b64f0){if(_0x1b64f0){var _0x3cf1d5=_0x1b64f0[_0x3c21('0x1d')],_0x18190b=_0x4465db[_0x3c21('0x1e')],_0x106a89=_0x4465db[_0x3c21('0x1e')]+_0x4465db[_0x3c21('0x1f')],_0x52b590;if(_0x106a89>=_0x3cf1d5){_0x106a89=_0x3cf1d5;_0x52b590=0xc8;}else{_0x52b590=0xce;}_0xcad627['status'](_0x52b590);return _0xcad627[_0x3c21('0x20')](_0x3c21('0x21'),_0x18190b+'-'+_0x106a89+'/'+_0x3cf1d5)[_0x3c21('0x1c')](_0x1b64f0);}return null;};}function patchUpdates(_0x568efe){return function(_0x2a6e81){try{jsonpatch['apply'](_0x2a6e81,_0x568efe,!![]);}catch(_0x46541e){return BPromise['reject'](_0x46541e);}return _0x2a6e81[_0x3c21('0x22')]();};}function saveUpdates(_0x558f74,_0x585526){return function(_0x3c2dcc){if(_0x3c2dcc){return _0x3c2dcc['update'](_0x558f74)[_0x3c21('0x23')](function(_0x17cb24){return _0x17cb24;});}return null;};}function removeEntity(_0x507811,_0x5974fa){return function(_0x250b11){if(_0x250b11){return _0x250b11[_0x3c21('0x24')]()[_0x3c21('0x23')](function(){var _0x1cd08e=_0x250b11[_0x3c21('0x25')]({'plain':!![]});var _0x49b925=_0x3c21('0x26');return db[_0x3c21('0x27')][_0x3c21('0x24')]({'where':{'type':_0x49b925,'resourceId':_0x1cd08e['id']}})['then'](function(){return _0x250b11;});})[_0x3c21('0x23')](function(){_0x507811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x75382,_0xd0f118){return function(_0x530afc){if(!_0x530afc){_0x75382[_0x3c21('0x19')](0x194);}return _0x530afc;};}function handleError(_0x25a439,_0x45907c){_0x45907c=_0x45907c||0x1f4;return function(_0x4f8772){logger['error'](_0x4f8772[_0x3c21('0x28')]);if(_0x4f8772[_0x3c21('0x29')]){delete _0x4f8772[_0x3c21('0x29')];}_0x25a439[_0x3c21('0x1a')](_0x45907c)[_0x3c21('0x2a')](_0x4f8772);};}exports[_0x3c21('0x2b')]=function(_0x3777d4,_0x2db083){var _0x22ed89={},_0x87ae18={},_0x11c0c0={'count':0x0,'rows':[]};var _0x50b313=db[_0x3c21('0x2c')][_0x3c21('0x2d')];_0x87ae18[_0x3c21('0x2e')]=_['keys'](_0x50b313);_0x87ae18[_0x3c21('0x2f')]=_[_0x3c21('0x30')](_0x3777d4[_0x3c21('0x2f')]);_0x87ae18[_0x3c21('0x31')]=_[_0x3c21('0x32')](_0x87ae18['model'],_0x87ae18[_0x3c21('0x2f')]);_0x22ed89['attributes']=_['intersection'](_0x87ae18[_0x3c21('0x2e')],qs[_0x3c21('0x33')](_0x3777d4[_0x3c21('0x2f')][_0x3c21('0x33')]));_0x22ed89[_0x3c21('0x34')]=_0x22ed89[_0x3c21('0x34')]['length']?_0x22ed89['attributes']:_0x87ae18[_0x3c21('0x2e')];if(!_0x3777d4[_0x3c21('0x2f')][_0x3c21('0x35')](_0x3c21('0x36'))){_0x22ed89[_0x3c21('0x1f')]=qs[_0x3c21('0x1f')](_0x3777d4[_0x3c21('0x2f')][_0x3c21('0x1f')]);_0x22ed89['offset']=qs[_0x3c21('0x1e')](_0x3777d4[_0x3c21('0x2f')][_0x3c21('0x1e')]);}_0x22ed89[_0x3c21('0x37')]=qs[_0x3c21('0x38')](_0x3777d4['query']['sort']);_0x22ed89[_0x3c21('0x39')]=qs[_0x3c21('0x31')](_[_0x3c21('0x3a')](_0x3777d4[_0x3c21('0x2f')],_0x87ae18[_0x3c21('0x31')]));if(_0x3777d4[_0x3c21('0x2f')][_0x3c21('0x3b')]){_0x22ed89['where']=_[_0x3c21('0x3c')](_0x22ed89[_0x3c21('0x39')],{'$or':_[_0x3c21('0x3d')](_0x50b313,function(_0x297d34){if(_0x297d34[_0x3c21('0x3e')]['key']!==_0x3c21('0x3f')){var _0x4e676d={};_0x4e676d[_0x297d34[_0x3c21('0x40')]]={'$like':'%'+_0x3777d4[_0x3c21('0x2f')][_0x3c21('0x3b')]+'%'};return _0x4e676d;}})});}_0x22ed89=_[_0x3c21('0x3c')]({},_0x22ed89,_0x3777d4['options']);var _0x3e31a5={'where':_0x22ed89['where']};return db[_0x3c21('0x2c')]['count'](_0x3e31a5)[_0x3c21('0x23')](function(_0x23b203){_0x11c0c0['count']=_0x23b203;if(_0x3777d4[_0x3c21('0x2f')]['includeAll']){_0x22ed89['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0x3c21('0x41')](_0x22ed89);})[_0x3c21('0x23')](function(_0x50ac0c){_0x11c0c0[_0x3c21('0x42')]=_0x50ac0c;return _0x11c0c0;})[_0x3c21('0x23')](respondWithFilteredResult(_0x2db083,_0x22ed89))[_0x3c21('0x43')](handleError(_0x2db083,null));};exports[_0x3c21('0x44')]=function(_0x480ef6,_0x567eb4){var _0x4e1a08={'raw':!![],'where':{'id':_0x480ef6[_0x3c21('0x45')]['id']}},_0xb9e294={};_0xb9e294['model']=_['keys'](db['OpenchannelQueue'][_0x3c21('0x2d')]);_0xb9e294[_0x3c21('0x2f')]=_[_0x3c21('0x30')](_0x480ef6['query']);_0xb9e294['filters']=_['intersection'](_0xb9e294['model'],_0xb9e294['query']);_0x4e1a08[_0x3c21('0x34')]=_['intersection'](_0xb9e294[_0x3c21('0x2e')],qs['fields'](_0x480ef6[_0x3c21('0x2f')]['fields']));_0x4e1a08['attributes']=_0x4e1a08[_0x3c21('0x34')][_0x3c21('0x46')]?_0x4e1a08[_0x3c21('0x34')]:_0xb9e294[_0x3c21('0x2e')];if(_0x480ef6[_0x3c21('0x2f')][_0x3c21('0x47')]){_0x4e1a08['include']=[{'all':!![]}];}_0x4e1a08=_['merge']({},_0x4e1a08,_0x480ef6[_0x3c21('0x48')]);return db[_0x3c21('0x2c')][_0x3c21('0x49')](_0x4e1a08)[_0x3c21('0x23')](handleEntityNotFound(_0x567eb4,null))[_0x3c21('0x23')](respondWithResult(_0x567eb4,null))[_0x3c21('0x43')](handleError(_0x567eb4,null));};exports[_0x3c21('0x4a')]=function(_0x4583cc,_0x2486f6){return db[_0x3c21('0x2c')]['create'](_0x4583cc['body'],{})[_0x3c21('0x23')](function(_0x558d5a){var _0x1c0889=_0x4583cc[_0x3c21('0x4b')][_0x3c21('0x25')]({'plain':!![]});if(!_0x1c0889)throw new Error(_0x3c21('0x4c'));if(_0x1c0889[_0x3c21('0x4d')]==='user'){var _0x3af3f1=_0x558d5a['get']({'plain':!![]});var _0x417ed4='OpenchannelQueues';return db[_0x3c21('0x4e')][_0x3c21('0x49')]({'where':{'name':_0x417ed4,'userProfileId':_0x1c0889['userProfileId']},'raw':!![]})[_0x3c21('0x23')](function(_0x4b60b4){if(_0x4b60b4&&_0x4b60b4['autoAssociation']===0x0){return db['UserProfileResource'][_0x3c21('0x4a')]({'name':_0x3af3f1[_0x3c21('0x29')],'resourceId':_0x3af3f1['id'],'type':_0x4b60b4['name'],'sectionId':_0x4b60b4['id']},{})[_0x3c21('0x23')](function(){return _0x558d5a;});}else{return _0x558d5a;}})[_0x3c21('0x43')](function(_0x5a09bc){logger['error'](_0x3c21('0x4f'),_0x5a09bc);throw _0x5a09bc;});}return _0x558d5a;})[_0x3c21('0x23')](respondWithResult(_0x2486f6,0xc9))[_0x3c21('0x43')](handleError(_0x2486f6,null));};exports['update']=function(_0x4d2b3f,_0x566d53){if(_0x4d2b3f[_0x3c21('0x50')]['id']){delete _0x4d2b3f['body']['id'];}return db['OpenchannelQueue'][_0x3c21('0x49')]({'where':{'id':_0x4d2b3f[_0x3c21('0x45')]['id']}})['then'](handleEntityNotFound(_0x566d53,null))[_0x3c21('0x23')](saveUpdates(_0x4d2b3f['body'],null))['then'](respondWithResult(_0x566d53,null))[_0x3c21('0x43')](handleError(_0x566d53,null));};exports[_0x3c21('0x24')]=function(_0x19ac8e,_0x59d861){return db[_0x3c21('0x2c')][_0x3c21('0x49')]({'where':{'id':_0x19ac8e[_0x3c21('0x45')]['id']}})[_0x3c21('0x23')](handleEntityNotFound(_0x59d861,null))[_0x3c21('0x23')](removeEntity(_0x59d861,null))[_0x3c21('0x43')](handleError(_0x59d861,null));};exports['describe']=function(_0x5aa69c,_0xdb8ded){return db[_0x3c21('0x2c')][_0x3c21('0x51')]()[_0x3c21('0x23')](respondWithResult(_0xdb8ded,null))[_0x3c21('0x43')](handleError(_0xdb8ded,null));};exports[_0x3c21('0x52')]=function(_0x4d70fd,_0x211ca6,_0x28cc4a){var _0x12feee={'raw':!![],'where':{}},_0x470171={},_0x2f92b0;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4d70fd[_0x3c21('0x45')]['id']}})[_0x3c21('0x23')](handleEntityNotFound(_0x211ca6,null))['then'](function(_0x450515){if(_0x450515){_0x2f92b0=_0x450515['get']({'plain':!![]});_0x470171[_0x3c21('0x2e')]=_[_0x3c21('0x30')](db[_0x3c21('0x53')][_0x3c21('0x2d')]);_0x470171['query']=_[_0x3c21('0x30')](_0x4d70fd['query']);_0x470171['filters']=_['intersection'](_0x470171['model'],_0x470171['query']);_0x12feee[_0x3c21('0x34')]=_[_0x3c21('0x32')](_0x470171[_0x3c21('0x2e')],qs['fields'](_0x4d70fd[_0x3c21('0x2f')][_0x3c21('0x33')]));_0x12feee[_0x3c21('0x34')]=_0x12feee[_0x3c21('0x34')][_0x3c21('0x46')]?_0x12feee[_0x3c21('0x34')]:_0x470171[_0x3c21('0x2e')];if(!_0x4d70fd[_0x3c21('0x2f')]['hasOwnProperty']('nolimit')){_0x12feee[_0x3c21('0x1f')]=qs['limit'](_0x4d70fd['query'][_0x3c21('0x1f')]);_0x12feee['offset']=qs[_0x3c21('0x1e')](_0x4d70fd[_0x3c21('0x2f')]['offset']);}_0x12feee[_0x3c21('0x37')]=qs[_0x3c21('0x38')](_0x4d70fd[_0x3c21('0x2f')][_0x3c21('0x38')]);_0x12feee[_0x3c21('0x39')]=qs['filters'](_[_0x3c21('0x3a')](_0x4d70fd[_0x3c21('0x2f')],_0x470171['filters']));_0x12feee['where'][_0x3c21('0x54')]=_0x450515['id'];if(_0x4d70fd[_0x3c21('0x2f')]['filter']){_0x12feee['where']=_[_0x3c21('0x3c')](_0x12feee[_0x3c21('0x39')],{'$or':_[_0x3c21('0x3d')](_0x12feee[_0x3c21('0x34')],function(_0x216ee5){var _0x55e0bd={};_0x55e0bd[_0x216ee5]={'$like':'%'+_0x4d70fd[_0x3c21('0x2f')]['filter']+'%'};return _0x55e0bd;})});}_0x12feee=_['merge']({},_0x12feee,_0x4d70fd['options']);return db[_0x3c21('0x53')][_0x3c21('0x41')](_0x12feee);}})[_0x3c21('0x23')](function(_0x3e30c3){if(_0x3e30c3){return db[_0x3c21('0x55')][_0x3c21('0x56')]({'where':{'id':_[_0x3c21('0x3d')](_0x3e30c3,'UserId'),'role':_0x3c21('0x57')},'attributes':['id','name',_0x3c21('0x58'),_0x3c21('0x59'),_0x3c21('0x5a')]});}})[_0x3c21('0x23')](function(_0x45dcb7){if(_0x45dcb7){return{'count':_0x45dcb7[_0x3c21('0x1d')],'rows':_[_0x3c21('0x3d')](_0x45dcb7[_0x3c21('0x42')],function(_0x5ac18f){return{'membername':_0x5ac18f[_0x3c21('0x29')],'UserId':_0x5ac18f['id'],'queue_name':_0x2f92b0['name'],'OpenchannelQueueId':_0x2f92b0['id'],'interface':util['format'](_0x3c21('0x5b'),'SIP',_0x5ac18f[_0x3c21('0x29')]),'penalty':0x0,'paused':_0x5ac18f[_0x3c21('0x58')],'createdAt':_0x5ac18f[_0x3c21('0x5a')],'updatedAt':_0x5ac18f[_0x3c21('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3c21('0x23')](respondWithFilteredResult(_0x211ca6,_0x12feee))['catch'](handleError(_0x211ca6,null));};exports['getTeams']=function(_0x589122,_0x1f2698,_0x3ec5eb){var _0x52c940={};var _0x3eaae6={};var _0x575847;var _0x5e3ea5;return db['OpenchannelQueue'][_0x3c21('0x5c')]({'where':{'id':_0x589122[_0x3c21('0x45')]['id']}})[_0x3c21('0x23')](handleEntityNotFound(_0x1f2698,null))['then'](function(_0x28d659){if(_0x28d659){_0x575847=_0x28d659;_0x3eaae6[_0x3c21('0x2e')]=_[_0x3c21('0x30')](db[_0x3c21('0x5d')][_0x3c21('0x2d')]);_0x3eaae6[_0x3c21('0x2f')]=_[_0x3c21('0x30')](_0x589122[_0x3c21('0x2f')]);_0x3eaae6[_0x3c21('0x31')]=_[_0x3c21('0x32')](_0x3eaae6[_0x3c21('0x2e')],_0x3eaae6[_0x3c21('0x2f')]);_0x52c940[_0x3c21('0x34')]=_[_0x3c21('0x32')](_0x3eaae6[_0x3c21('0x2e')],qs[_0x3c21('0x33')](_0x589122['query'][_0x3c21('0x33')]));_0x52c940[_0x3c21('0x34')]=_0x52c940[_0x3c21('0x34')][_0x3c21('0x46')]?_0x52c940[_0x3c21('0x34')]:_0x3eaae6[_0x3c21('0x2e')];_0x52c940[_0x3c21('0x37')]=qs['sort'](_0x589122[_0x3c21('0x2f')]['sort']);_0x52c940[_0x3c21('0x39')]=qs['filters'](_[_0x3c21('0x3a')](_0x589122[_0x3c21('0x2f')],_0x3eaae6[_0x3c21('0x31')]));if(_0x589122[_0x3c21('0x2f')]['filter']){_0x52c940[_0x3c21('0x39')]=_['merge'](_0x52c940[_0x3c21('0x39')],{'$or':_[_0x3c21('0x3d')](_0x52c940['attributes'],function(_0x4d2586){var _0x254d9e={};_0x254d9e[_0x4d2586]={'$like':'%'+_0x589122[_0x3c21('0x2f')]['filter']+'%'};return _0x254d9e;})});}_0x52c940=_[_0x3c21('0x3c')]({},_0x52c940,_0x589122[_0x3c21('0x48')]);return _0x575847[_0x3c21('0x5e')](_0x52c940);}})[_0x3c21('0x23')](function(_0x29239b){if(_0x29239b){_0x5e3ea5=_0x29239b['length'];if(!_0x589122['query'][_0x3c21('0x35')]('nolimit')){_0x52c940[_0x3c21('0x1f')]=qs[_0x3c21('0x1f')](_0x589122[_0x3c21('0x2f')]['limit']);_0x52c940[_0x3c21('0x1e')]=qs[_0x3c21('0x1e')](_0x589122[_0x3c21('0x2f')][_0x3c21('0x1e')]);}return _0x575847['getTeams'](_0x52c940);}})[_0x3c21('0x23')](function(_0x4e8f67){if(_0x4e8f67){return _0x4e8f67?{'count':_0x5e3ea5,'rows':_0x4e8f67}:null;}})[_0x3c21('0x23')](respondWithResult(_0x1f2698,null))['catch'](handleError(_0x1f2698,null));};exports[_0x3c21('0x5f')]=function(_0x9101a6,_0x5ace4d,_0x4b7dbd){var _0x197da0=_0x9101a6[_0x3c21('0x50')][_0x3c21('0x60')];return db[_0x3c21('0x5d')][_0x3c21('0x41')]({'where':{'id':_[_0x3c21('0x3d')](_0x197da0,'id')},'attributes':['id'],'include':[{'model':db[_0x3c21('0x55')],'as':_0x3c21('0x61'),'attributes':['id',_0x3c21('0x29'),'online',_0x3c21('0x62'),_0x3c21('0x63')],'raw':!![]}]})[_0x3c21('0x23')](function(_0x4733e4){if(_0x4733e4){var _0x4b1ff4=_[_0x3c21('0x64')](_0x4733e4,function(_0x4adcef){var _0x5956ee=_0x4adcef[_0x3c21('0x25')]({'plain':!![]});return _0x5956ee[_0x3c21('0x61')];});return db[_0x3c21('0x2c')]['find']({'where':{'id':_0x9101a6[_0x3c21('0x45')]['id']}})[_0x3c21('0x23')](function(_0x478c56){return db[_0x3c21('0x65')]['transaction'](function(_0x258904){return _0x478c56[_0x3c21('0x5f')](_['map'](_0x197da0,'id'),{'transaction':_0x258904})[_0x3c21('0x23')](function(){return BPromise[_0x3c21('0x66')](_0x4b1ff4,function(_0x236884){return db[_0x3c21('0x53')][_0x3c21('0x67')]({'where':{'UserId':_0x236884['id'],'OpenchannelQueueId':_0x9101a6[_0x3c21('0x45')]['id']},'transaction':_0x258904});});})[_0x3c21('0x23')](function(){_0x4b1ff4[_0x3c21('0x68')](function(_0x336aa4){socket['emit'](_0x3c21('0x69'),{'UserId':_0x336aa4['id'],'OpenchannelQueueId':_0x478c56['id']});});});});});}})[_0x3c21('0x23')](respondWithStatusCode(_0x5ace4d,null))[_0x3c21('0x43')](handleError(_0x5ace4d,null));};exports[_0x3c21('0x6a')]=function(_0x29a8ee,_0x466026,_0x4c642a){return db[_0x3c21('0x5d')][_0x3c21('0x41')]({'where':{'id':_0x29a8ee[_0x3c21('0x2f')][_0x3c21('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x3c21('0x55')],'as':_0x3c21('0x61'),'attributes':['id'],'raw':!![]}]})[_0x3c21('0x23')](handleEntityNotFound(_0x466026,null))[_0x3c21('0x23')](function(_0x37fc1c){var _0x5ea706=_[_0x3c21('0x3d')](_0x37fc1c,'id');var _0x30f619=[];var _0x39505c=[];var _0x2dd9d3=squel['select']();_0x2dd9d3[_0x3c21('0x40')](_0x3c21('0x6c'))['from'](_0x3c21('0x6d'),'tq')['join'](_0x3c21('0x6e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3c21('0x39')](_0x3c21('0x6f'),_0x29a8ee[_0x3c21('0x45')]['id']);for(var _0x5c9e2e=0x0;_0x5c9e2e<_0x37fc1c['length'];_0x5c9e2e+=0x1){let _0x49b4a5=_0x37fc1c[_0x5c9e2e];for(var _0x519672=0x0;_0x519672<_0x49b4a5[_0x3c21('0x61')]['length'];_0x519672+=0x1){let _0x24c51e=_0x49b4a5[_0x3c21('0x61')][_0x519672];var _0x1571ea=_0x2dd9d3[_0x3c21('0x70')]();_0x1571ea['where'](_0x3c21('0x71'),_0x24c51e['id']);_0x39505c[_0x3c21('0x72')](db[_0x3c21('0x65')][_0x3c21('0x2f')](_0x1571ea['toString'](),{'type':db[_0x3c21('0x65')][_0x3c21('0x73')][_0x3c21('0x74')]})[_0x3c21('0x23')](function(_0x2a9bbc){if(_0x2a9bbc['length']===0x1){return _0x24c51e['id'];}else{var _0x299bf4=_[_0x3c21('0x75')](_[_0x3c21('0x3d')](_0x2a9bbc,_0x3c21('0x76')),function(_0x975810){return _[_0x3c21('0x77')](_0x5ea706,_0x975810);});if(_0x299bf4){return _0x24c51e['id'];}}}));}}return BPromise[_0x3c21('0x78')](_0x39505c)[_0x3c21('0x23')](function(_0x438edf){_0x30f619=_(_0x30f619)[_0x3c21('0x79')](_0x438edf)[_0x3c21('0x7a')]()[_0x3c21('0x7b')]();return db[_0x3c21('0x2c')]['find']({'where':{'id':_0x29a8ee[_0x3c21('0x45')]['id']}})[_0x3c21('0x23')](function(_0x16c6de){return db[_0x3c21('0x65')]['transaction'](function(_0x65a69b){return _0x16c6de[_0x3c21('0x6a')](_0x29a8ee[_0x3c21('0x2f')]['ids'],{'transaction':_0x65a69b})[_0x3c21('0x23')](function(){if(!_[_0x3c21('0x7c')](_0x30f619)){return _0x16c6de[_0x3c21('0x7d')](_0x30f619,{'transaction':_0x65a69b});}})[_0x3c21('0x23')](function(){_0x30f619[_0x3c21('0x68')](function(_0x120196){socket[_0x3c21('0x7e')](_0x3c21('0x7f'),{'UserId':_0x120196,'OpenchannelQueueId':_0x16c6de['id']});});});});});});})['then'](respondWithStatusCode(_0x466026,null))[_0x3c21('0x43')](handleError(_0x466026,null));};exports[_0x3c21('0x80')]=function(_0x3500ac,_0x167ec1,_0x221411){return db['OpenchannelQueue'][_0x3c21('0x49')]({'where':{'id':_0x3500ac[_0x3c21('0x45')]['id']}})[_0x3c21('0x23')](handleEntityNotFound(_0x167ec1,null))[_0x3c21('0x23')](function(_0x3a1961){if(_0x3a1961){return _0x3a1961[_0x3c21('0x80')](_0x3500ac[_0x3c21('0x50')][_0x3c21('0x6b')],_[_0x3c21('0x81')](_0x3500ac[_0x3c21('0x50')],['ids','id'])||{})[_0x3c21('0x82')](function(_0x445118){for(var _0x2279b1=0x0;_0x2279b1<_0x3500ac['body'][_0x3c21('0x6b')][_0x3c21('0x46')];_0x2279b1+=0x1){socket[_0x3c21('0x7e')]('userOpenchannelQueue:save',{'UserId':_0x3500ac['body'][_0x3c21('0x6b')][_0x2279b1],'OpenchannelQueueId':_0x3500ac[_0x3c21('0x45')]['id']});}return _0x445118;});}})[_0x3c21('0x23')](respondWithResult(_0x167ec1,null))[_0x3c21('0x43')](handleError(_0x167ec1,null));};exports[_0x3c21('0x7d')]=function(_0x367a12,_0x4e55ba,_0x51f332){return db[_0x3c21('0x2c')][_0x3c21('0x49')]({'where':{'id':_0x367a12[_0x3c21('0x45')]['id']}})[_0x3c21('0x23')](handleEntityNotFound(_0x4e55ba,null))['then'](function(_0x3b9b2f){if(_0x3b9b2f){return _0x3b9b2f[_0x3c21('0x7d')](_0x367a12[_0x3c21('0x2f')][_0x3c21('0x6b')])[_0x3c21('0x23')](function(){if(_['isArray'](_0x367a12[_0x3c21('0x2f')][_0x3c21('0x6b')])){for(var _0x2953d9=0x0;_0x2953d9<_0x367a12['query'][_0x3c21('0x6b')][_0x3c21('0x46')];_0x2953d9+=0x1){socket[_0x3c21('0x7e')](_0x3c21('0x7f'),{'UserId':Number(_0x367a12['query'][_0x3c21('0x6b')][_0x2953d9]),'OpenchannelQueueId':Number(_0x367a12['params']['id'])});}}else{socket[_0x3c21('0x7e')](_0x3c21('0x7f'),{'UserId':Number(_0x367a12[_0x3c21('0x2f')][_0x3c21('0x6b')]),'OpenchannelQueueId':Number(_0x367a12[_0x3c21('0x45')]['id'])});}});}})[_0x3c21('0x23')](respondWithStatusCode(_0x4e55ba,null))[_0x3c21('0x43')](handleError(_0x4e55ba,null));};exports[_0x3c21('0x83')]=function(_0x2f7129,_0x158c67,_0x3c331d){var _0x17893e={};var _0x3867c9={};var _0x203f3d;var _0x2ddfdb;return db[_0x3c21('0x2c')][_0x3c21('0x5c')]({'where':{'id':_0x2f7129['params']['id']}})[_0x3c21('0x23')](handleEntityNotFound(_0x158c67,null))['then'](function(_0x16b29f){if(_0x16b29f){_0x203f3d=_0x16b29f;_0x3867c9[_0x3c21('0x2e')]=_[_0x3c21('0x30')](db['User'][_0x3c21('0x2d')]);_0x3867c9[_0x3c21('0x2f')]=_['keys'](_0x2f7129['query']);_0x3867c9[_0x3c21('0x31')]=_[_0x3c21('0x32')](_0x3867c9[_0x3c21('0x2e')],_0x3867c9['query']);_0x17893e['attributes']=_[_0x3c21('0x32')](_0x3867c9[_0x3c21('0x2e')],qs['fields'](_0x2f7129['query'][_0x3c21('0x33')]));_0x17893e[_0x3c21('0x34')]=_0x17893e['attributes']['length']?_0x17893e[_0x3c21('0x34')]:_0x3867c9['model'];_0x17893e['order']=qs[_0x3c21('0x38')](_0x2f7129[_0x3c21('0x2f')]['sort']);_0x17893e['where']=qs[_0x3c21('0x31')](_[_0x3c21('0x3a')](_0x2f7129[_0x3c21('0x2f')],_0x3867c9[_0x3c21('0x31')]));if(_0x2f7129[_0x3c21('0x2f')][_0x3c21('0x3b')]){_0x17893e[_0x3c21('0x39')]=_[_0x3c21('0x3c')](_0x17893e[_0x3c21('0x39')],{'$or':_['map'](_0x17893e[_0x3c21('0x34')],function(_0x31c8fb){var _0x7fe599={};_0x7fe599[_0x31c8fb]={'$like':'%'+_0x2f7129[_0x3c21('0x2f')][_0x3c21('0x3b')]+'%'};return _0x7fe599;})});}_0x17893e=_['merge']({},_0x17893e,_0x2f7129[_0x3c21('0x48')]);return _0x203f3d[_0x3c21('0x83')](_0x17893e);}})['then'](function(_0x4c5059){if(_0x4c5059){_0x2ddfdb=_0x4c5059[_0x3c21('0x46')];if(!_0x2f7129[_0x3c21('0x2f')][_0x3c21('0x35')](_0x3c21('0x36'))){_0x17893e[_0x3c21('0x1f')]=qs[_0x3c21('0x1f')](_0x2f7129[_0x3c21('0x2f')][_0x3c21('0x1f')]);_0x17893e[_0x3c21('0x1e')]=qs[_0x3c21('0x1e')](_0x2f7129[_0x3c21('0x2f')]['offset']);}return _0x203f3d[_0x3c21('0x83')](_0x17893e);}})[_0x3c21('0x23')](function(_0x5e6bd3){if(_0x5e6bd3){return _0x5e6bd3?{'count':_0x2ddfdb,'rows':_0x5e6bd3}:null;}})[_0x3c21('0x23')](respondWithResult(_0x158c67,null))['catch'](handleError(_0x158c67,null));};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js
index 8c739b9..ff232f1 100644
--- a/server/api/openchannelQueue/openchannelQueue.events.js
+++ b/server/api/openchannelQueue/openchannelQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e0b=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x378468,_0x12f853){var _0x4985e3=function(_0x25bdf6){while(--_0x25bdf6){_0x378468['push'](_0x378468['shift']());}};_0x4985e3(++_0x12f853);}(_0x4e0b,0x18b));var _0xb4e0=function(_0x3e24b3,_0x4efa5a){_0x3e24b3=_0x3e24b3-0x0;var _0x34a78c=_0x4e0b[_0x3e24b3];return _0x34a78c;};'use strict';var EventEmitter=require(_0xb4e0('0x0'));var OpenchannelQueue=require(_0xb4e0('0x1'))['db'][_0xb4e0('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xb4e0('0x3')](0x0);var events={'afterCreate':_0xb4e0('0x4'),'afterUpdate':_0xb4e0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5c0d34){return function(_0x50216c,_0x3b1006,_0xa44d2a){OpenchannelQueueEvents[_0xb4e0('0x6')](_0x5c0d34+':'+_0x50216c['id'],_0x50216c);OpenchannelQueueEvents[_0xb4e0('0x6')](_0x5c0d34,_0x50216c);_0xa44d2a(null);};}for(var e in events){if(events[_0xb4e0('0x7')](e)){var event=events[e];OpenchannelQueue[_0xb4e0('0x8')](e,emitEvent(event));}}module[_0xb4e0('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xdf20=['../../mysqldb','OpenchannelQueue','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x5da9e3,_0x3d80cd){var _0x5a68cd=function(_0x1e48a4){while(--_0x1e48a4){_0x5da9e3['push'](_0x5da9e3['shift']());}};_0x5a68cd(++_0x3d80cd);}(_0xdf20,0xf2));var _0x0df2=function(_0x262ff9,_0x4b1098){_0x262ff9=_0x262ff9-0x0;var _0x41ff15=_0xdf20[_0x262ff9];return _0x41ff15;};'use strict';var EventEmitter=require(_0x0df2('0x0'));var OpenchannelQueue=require(_0x0df2('0x1'))['db'][_0x0df2('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x0df2('0x3')](0x0);var events={'afterCreate':_0x0df2('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x579c2c){return function(_0x4bf5c7,_0x1828df,_0x116b5){OpenchannelQueueEvents[_0x0df2('0x5')](_0x579c2c+':'+_0x4bf5c7['id'],_0x4bf5c7);OpenchannelQueueEvents[_0x0df2('0x5')](_0x579c2c,_0x4bf5c7);_0x116b5(null);};}for(var e in events){if(events[_0x0df2('0x6')](e)){var event=events[e];OpenchannelQueue[_0x0df2('0x7')](e,emitEvent(event));}}module[_0x0df2('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js
index 41e31db..819f058 100644
--- a/server/api/openchannelQueue/openchannelQueue.model.js
+++ b/server/api/openchannelQueue/openchannelQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd25f=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger'];(function(_0x22bee0,_0x412ecb){var _0x2d295b=function(_0x59d4b5){while(--_0x59d4b5){_0x22bee0['push'](_0x22bee0['shift']());}};_0x2d295b(++_0x412ecb);}(_0xd25f,0xf4));var _0xfd25=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xd25f[_0x31b5a5];return _0x364cc9;};'use strict';var _=require(_0xfd25('0x0'));var util=require(_0xfd25('0x1'));var logger=require(_0xfd25('0x2'))(_0xfd25('0x3'));var moment=require(_0xfd25('0x4'));var BPromise=require('bluebird');var rp=require(_0xfd25('0x5'));var fs=require('fs');var path=require(_0xfd25('0x6'));var rimraf=require(_0xfd25('0x7'));var config=require(_0xfd25('0x8'));var attributes=require('./openchannelQueue.attributes');module[_0xfd25('0x9')]=function(_0x3ebf2e,_0x124d58){return _0x3ebf2e[_0xfd25('0xa')](_0xfd25('0xb'),attributes,{'tableName':_0xfd25('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc0c3=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','api','bluebird','path'];(function(_0x5654a4,_0x2bcbcb){var _0x72f009=function(_0x235d43){while(--_0x235d43){_0x5654a4['push'](_0x5654a4['shift']());}};_0x72f009(++_0x2bcbcb);}(_0xc0c3,0xd3));var _0x3c0c=function(_0x10e7de,_0x2e342d){_0x10e7de=_0x10e7de-0x0;var _0xa8f357=_0xc0c3[_0x10e7de];return _0xa8f357;};'use strict';var _=require(_0x3c0c('0x0'));var util=require(_0x3c0c('0x1'));var logger=require('../../config/logger')(_0x3c0c('0x2'));var moment=require('moment');var BPromise=require(_0x3c0c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c0c('0x4'));var rimraf=require(_0x3c0c('0x5'));var config=require(_0x3c0c('0x6'));var attributes=require(_0x3c0c('0x7'));module[_0x3c0c('0x8')]=function(_0x2698c2,_0x41e93a){return _0x2698c2[_0x3c0c('0x9')](_0x3c0c('0xa'),attributes,{'tableName':_0x3c0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js
index 2d89c6f..393a091 100644
--- a/server/api/openchannelQueue/openchannelQueue.rpc.js
+++ b/server/api/openchannelQueue/openchannelQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe107=['moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./openchannelQueue.socket','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','map','include','model','then','ShowOpenchannelQueue','find','lodash'];(function(_0x74ecfc,_0x33b113){var _0x5d9156=function(_0x31d1ab){while(--_0x31d1ab){_0x74ecfc['push'](_0x74ecfc['shift']());}};_0x5d9156(++_0x33b113);}(_0xe107,0xb3));var _0x7e10=function(_0x49a08e,_0x5731ad){_0x49a08e=_0x49a08e-0x0;var _0x33cecf=_0xe107[_0x49a08e];return _0x33cecf;};'use strict';var _=require(_0x7e10('0x0'));var util=require('util');var moment=require(_0x7e10('0x1'));var BPromise=require(_0x7e10('0x2'));var rs=require(_0x7e10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e10('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e10('0x5'));var config=require(_0x7e10('0x6'));var jayson=require(_0x7e10('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x7e10('0x8')]=_[_0x7e10('0x9')](config[_0x7e10('0x8')],{'host':_0x7e10('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7e10('0xb'))['register'](socket);function respondWithRpcPromise(_0x4e6825,_0x82e6f3,_0x303f73){return new BPromise(function(_0x2b2850,_0x2bd58a){return client[_0x7e10('0xc')](_0x4e6825,_0x303f73)['then'](function(_0x3576c2){logger['info'](_0x7e10('0xd'),_0x82e6f3,_0x7e10('0xe'));logger[_0x7e10('0xf')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x82e6f3,_0x7e10('0xe'),JSON[_0x7e10('0x10')](_0x3576c2));if(_0x3576c2[_0x7e10('0x11')]){if(_0x3576c2[_0x7e10('0x11')][_0x7e10('0x12')]===0x1f4){logger[_0x7e10('0x11')](_0x7e10('0xd'),_0x82e6f3,_0x3576c2[_0x7e10('0x11')]['message']);return _0x2bd58a(_0x3576c2[_0x7e10('0x11')][_0x7e10('0x13')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x82e6f3,_0x3576c2[_0x7e10('0x11')]['message']);return _0x2b2850(_0x3576c2[_0x7e10('0x11')][_0x7e10('0x13')]);}else{logger[_0x7e10('0x14')](_0x7e10('0xd'),_0x82e6f3,'request\x20sent');_0x2b2850(_0x3576c2[_0x7e10('0x15')][_0x7e10('0x13')]);}})[_0x7e10('0x16')](function(_0x5d9da3){logger[_0x7e10('0x11')](_0x7e10('0xd'),_0x82e6f3,_0x5d9da3);_0x2bd58a(_0x5d9da3);});});}exports[_0x7e10('0x17')]=function(_0x585df5){var _0xd742e4=this;return new Promise(function(_0x580ac7,_0x45a0cb){return db[_0x7e10('0x18')]['findAll']({'raw':_0x585df5[_0x7e10('0x19')]?_0x585df5[_0x7e10('0x19')][_0x7e10('0x1a')]===undefined?!![]:![]:!![],'where':_0x585df5[_0x7e10('0x19')]?_0x585df5['options'][_0x7e10('0x1b')]||null:null,'attributes':_0x585df5[_0x7e10('0x19')]?_0x585df5[_0x7e10('0x19')][_0x7e10('0x1c')]||null:null,'limit':_0x585df5[_0x7e10('0x19')]?_0x585df5[_0x7e10('0x19')][_0x7e10('0x1d')]||null:null,'include':_0x585df5[_0x7e10('0x19')]?_0x585df5['options']['include']?_[_0x7e10('0x1e')](_0x585df5[_0x7e10('0x19')][_0x7e10('0x1f')],function(_0x13eeb3){return{'model':db[_0x13eeb3['model']],'as':_0x13eeb3['as'],'attributes':_0x13eeb3['attributes'],'include':_0x13eeb3[_0x7e10('0x1f')]?_[_0x7e10('0x1e')](_0x13eeb3[_0x7e10('0x1f')],function(_0x13c7d4){return{'model':db[_0x13c7d4[_0x7e10('0x20')]],'as':_0x13c7d4['as'],'attributes':_0x13c7d4[_0x7e10('0x1c')],'include':_0x13c7d4[_0x7e10('0x1f')]?_[_0x7e10('0x1e')](_0x13c7d4[_0x7e10('0x1f')],function(_0x3b020c){return{'model':db[_0x3b020c[_0x7e10('0x20')]],'as':_0x3b020c['as'],'attributes':_0x3b020c['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e10('0x21')](function(_0x884343){logger['info']('GetOpenchannelQueue',_0x585df5);logger[_0x7e10('0xf')](_0x7e10('0x17'),_0x585df5,JSON['stringify'](_0x884343));_0x580ac7(_0x884343);})[_0x7e10('0x16')](function(_0x5db8c9){logger[_0x7e10('0x11')](_0x7e10('0x17'),_0x5db8c9[_0x7e10('0x13')],_0x585df5);_0x45a0cb(_0xd742e4[_0x7e10('0x11')](0x1f4,_0x5db8c9[_0x7e10('0x13')]));});});};exports[_0x7e10('0x22')]=function(_0x5bba9c){var _0x3567d2=this;return new Promise(function(_0x5dce0d,_0xc770e4){return db[_0x7e10('0x18')][_0x7e10('0x23')]({'raw':_0x5bba9c[_0x7e10('0x19')]?_0x5bba9c[_0x7e10('0x19')][_0x7e10('0x1a')]===undefined?!![]:![]:!![],'where':_0x5bba9c[_0x7e10('0x19')]?_0x5bba9c[_0x7e10('0x19')][_0x7e10('0x1b')]||null:null,'attributes':_0x5bba9c['options']?_0x5bba9c[_0x7e10('0x19')][_0x7e10('0x1c')]||null:null,'include':_0x5bba9c[_0x7e10('0x19')]?_0x5bba9c[_0x7e10('0x19')][_0x7e10('0x1f')]?_['map'](_0x5bba9c[_0x7e10('0x19')][_0x7e10('0x1f')],function(_0x919821){return{'model':db[_0x919821[_0x7e10('0x20')]],'as':_0x919821['as'],'attributes':_0x919821['attributes'],'include':_0x919821['include']?_[_0x7e10('0x1e')](_0x919821[_0x7e10('0x1f')],function(_0x3042c1){return{'model':db[_0x3042c1[_0x7e10('0x20')]],'as':_0x3042c1['as'],'attributes':_0x3042c1['attributes'],'include':_0x3042c1[_0x7e10('0x1f')]?_[_0x7e10('0x1e')](_0x3042c1['include'],function(_0x21cb6e){return{'model':db[_0x21cb6e[_0x7e10('0x20')]],'as':_0x21cb6e['as'],'attributes':_0x21cb6e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d5aaa){logger[_0x7e10('0x14')](_0x7e10('0x22'),_0x5bba9c);logger[_0x7e10('0xf')](_0x7e10('0x22'),_0x5bba9c,JSON[_0x7e10('0x10')](_0x4d5aaa));_0x5dce0d(_0x4d5aaa);})[_0x7e10('0x16')](function(_0x24a8ec){logger[_0x7e10('0x11')]('ShowOpenchannelQueue',_0x24a8ec[_0x7e10('0x13')],_0x5bba9c);_0xc770e4(_0x3567d2[_0x7e10('0x11')](0x1f4,_0x24a8ec[_0x7e10('0x13')]));});});};
\ No newline at end of file
+var _0x9f94=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','map','include','attributes','model','then','ShowOpenchannelQueue','find','raw','where','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1842c8,_0x5b11c8){var _0x2530c5=function(_0x9979c8){while(--_0x9979c8){_0x1842c8['push'](_0x1842c8['shift']());}};_0x2530c5(++_0x5b11c8);}(_0x9f94,0x1e7));var _0x49f9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9f94[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var moment=require(_0x49f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49f9('0x3'));var db=require(_0x49f9('0x4'))['db'];var utils=require(_0x49f9('0x5'));var logger=require(_0x49f9('0x6'))(_0x49f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x49f9('0x8'));var client=jayson[_0x49f9('0x9')][_0x49f9('0xa')]({'port':0x232a});config[_0x49f9('0xb')]=_[_0x49f9('0xc')](config[_0x49f9('0xb')],{'host':_0x49f9('0xd'),'port':0x18eb});var socket=require(_0x49f9('0xe'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x49f9('0xf')](socket);function respondWithRpcPromise(_0x5d235c,_0x20d4a6,_0x26dbfa){return new BPromise(function(_0x13cab2,_0x57b58e){return client[_0x49f9('0x10')](_0x5d235c,_0x26dbfa)['then'](function(_0x346b07){logger[_0x49f9('0x11')](_0x49f9('0x12'),_0x20d4a6,_0x49f9('0x13'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x20d4a6,_0x49f9('0x13'),JSON[_0x49f9('0x14')](_0x346b07));if(_0x346b07[_0x49f9('0x15')]){if(_0x346b07[_0x49f9('0x15')]['code']===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x20d4a6,_0x346b07[_0x49f9('0x15')]['message']);return _0x57b58e(_0x346b07[_0x49f9('0x15')]['message']);}logger[_0x49f9('0x15')](_0x49f9('0x12'),_0x20d4a6,_0x346b07['error'][_0x49f9('0x16')]);return _0x13cab2(_0x346b07[_0x49f9('0x15')][_0x49f9('0x16')]);}else{logger[_0x49f9('0x11')](_0x49f9('0x12'),_0x20d4a6,_0x49f9('0x13'));_0x13cab2(_0x346b07[_0x49f9('0x17')][_0x49f9('0x16')]);}})[_0x49f9('0x18')](function(_0x10ed61){logger[_0x49f9('0x15')](_0x49f9('0x12'),_0x20d4a6,_0x10ed61);_0x57b58e(_0x10ed61);});});}exports[_0x49f9('0x19')]=function(_0x3b6c8f){var _0x136836=this;return new Promise(function(_0x4bafb8,_0x4f0bc9){return db[_0x49f9('0x1a')]['findAll']({'raw':_0x3b6c8f[_0x49f9('0x1b')]?_0x3b6c8f['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b6c8f[_0x49f9('0x1b')]?_0x3b6c8f[_0x49f9('0x1b')]['where']||null:null,'attributes':_0x3b6c8f[_0x49f9('0x1b')]?_0x3b6c8f['options']['attributes']||null:null,'limit':_0x3b6c8f[_0x49f9('0x1b')]?_0x3b6c8f[_0x49f9('0x1b')]['limit']||null:null,'include':_0x3b6c8f[_0x49f9('0x1b')]?_0x3b6c8f[_0x49f9('0x1b')]['include']?_[_0x49f9('0x1c')](_0x3b6c8f[_0x49f9('0x1b')][_0x49f9('0x1d')],function(_0x2272d3){return{'model':db[_0x2272d3['model']],'as':_0x2272d3['as'],'attributes':_0x2272d3[_0x49f9('0x1e')],'include':_0x2272d3[_0x49f9('0x1d')]?_[_0x49f9('0x1c')](_0x2272d3[_0x49f9('0x1d')],function(_0x28e56f){return{'model':db[_0x28e56f[_0x49f9('0x1f')]],'as':_0x28e56f['as'],'attributes':_0x28e56f[_0x49f9('0x1e')],'include':_0x28e56f['include']?_['map'](_0x28e56f[_0x49f9('0x1d')],function(_0xc64e23){return{'model':db[_0xc64e23[_0x49f9('0x1f')]],'as':_0xc64e23['as'],'attributes':_0xc64e23[_0x49f9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x49f9('0x20')](function(_0x2d1e7d){logger[_0x49f9('0x11')](_0x49f9('0x19'),_0x3b6c8f);logger['debug'](_0x49f9('0x19'),_0x3b6c8f,JSON['stringify'](_0x2d1e7d));_0x4bafb8(_0x2d1e7d);})[_0x49f9('0x18')](function(_0x447f0c){logger[_0x49f9('0x15')]('GetOpenchannelQueue',_0x447f0c[_0x49f9('0x16')],_0x3b6c8f);_0x4f0bc9(_0x136836[_0x49f9('0x15')](0x1f4,_0x447f0c[_0x49f9('0x16')]));});});};exports[_0x49f9('0x21')]=function(_0x2d8092){var _0x175ff3=this;return new Promise(function(_0x2f3dac,_0x26f269){return db[_0x49f9('0x1a')][_0x49f9('0x22')]({'raw':_0x2d8092[_0x49f9('0x1b')]?_0x2d8092[_0x49f9('0x1b')][_0x49f9('0x23')]===undefined?!![]:![]:!![],'where':_0x2d8092[_0x49f9('0x1b')]?_0x2d8092[_0x49f9('0x1b')][_0x49f9('0x24')]||null:null,'attributes':_0x2d8092[_0x49f9('0x1b')]?_0x2d8092['options'][_0x49f9('0x1e')]||null:null,'include':_0x2d8092[_0x49f9('0x1b')]?_0x2d8092[_0x49f9('0x1b')][_0x49f9('0x1d')]?_['map'](_0x2d8092['options'][_0x49f9('0x1d')],function(_0x4b5b84){return{'model':db[_0x4b5b84[_0x49f9('0x1f')]],'as':_0x4b5b84['as'],'attributes':_0x4b5b84[_0x49f9('0x1e')],'include':_0x4b5b84[_0x49f9('0x1d')]?_[_0x49f9('0x1c')](_0x4b5b84[_0x49f9('0x1d')],function(_0x3732c4){return{'model':db[_0x3732c4[_0x49f9('0x1f')]],'as':_0x3732c4['as'],'attributes':_0x3732c4['attributes'],'include':_0x3732c4[_0x49f9('0x1d')]?_[_0x49f9('0x1c')](_0x3732c4['include'],function(_0x4f35b7){return{'model':db[_0x4f35b7['model']],'as':_0x4f35b7['as'],'attributes':_0x4f35b7[_0x49f9('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x571ce1){logger[_0x49f9('0x11')](_0x49f9('0x21'),_0x2d8092);logger[_0x49f9('0x25')](_0x49f9('0x21'),_0x2d8092,JSON['stringify'](_0x571ce1));_0x2f3dac(_0x571ce1);})[_0x49f9('0x18')](function(_0x5d4968){logger[_0x49f9('0x15')](_0x49f9('0x21'),_0x5d4968[_0x49f9('0x16')],_0x2d8092);_0x26f269(_0x175ff3[_0x49f9('0x15')](0x1f4,_0x5d4968[_0x49f9('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js
index 025ea9e..98d8801 100644
--- a/server/api/openchannelQueue/openchannelQueue.socket.js
+++ b/server/api/openchannelQueue/openchannelQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var OpenchannelQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){OpenchannelQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var OpenchannelQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){OpenchannelQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js
index ac8a2d0..a25600e 100644
--- a/server/api/openchannelQueueReport/index.js
+++ b/server/api/openchannelQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
+var _0xb10b=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x9d9f9e,_0x52a029){var _0x48cb13=function(_0x177d55){while(--_0x177d55){_0x9d9f9e['push'](_0x9d9f9e['shift']());}};_0x48cb13(++_0x52a029);}(_0xb10b,0x12a));var _0xbb10=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0xb10b[_0x230e39];return _0xa804e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
index 4deeded..57d9be4 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb171=['DATE','moment','sequelize','exports','STRING'];(function(_0x124c89,_0x5c77cc){var _0x41b67b=function(_0x1b6970){while(--_0x1b6970){_0x124c89['push'](_0x124c89['shift']());}};_0x41b67b(++_0x5c77cc);}(_0xb171,0x114));var _0x1b17=function(_0x14eb15,_0xabd837){_0x14eb15=_0x14eb15-0x0;var _0xef34fa=_0xb171[_0x14eb15];return _0xef34fa;};'use strict';var moment=require(_0x1b17('0x0'));var Sequelize=require(_0x1b17('0x1'));module[_0x1b17('0x2')]={'uniqueid':{'type':Sequelize[_0x1b17('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1b17('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1b17('0x4')]},'acceptAt':{'type':Sequelize[_0x1b17('0x4')]},'exitAt':{'type':Sequelize[_0x1b17('0x4')]},'reason':{'type':Sequelize[_0x1b17('0x3')]}};
\ No newline at end of file
+var _0x9862=['exports','STRING','DATE','moment','sequelize'];(function(_0x17e0ff,_0x4dbd1e){var _0x357979=function(_0x443276){while(--_0x443276){_0x17e0ff['push'](_0x17e0ff['shift']());}};_0x357979(++_0x4dbd1e);}(_0x9862,0x120));var _0x2986=function(_0x3b38f9,_0x6422c4){_0x3b38f9=_0x3b38f9-0x0;var _0x3c74a1=_0x9862[_0x3b38f9];return _0x3c74a1;};'use strict';var moment=require(_0x2986('0x0'));var Sequelize=require(_0x2986('0x1'));module[_0x2986('0x2')]={'uniqueid':{'type':Sequelize[_0x2986('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2986('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x2986('0x4')]},'acceptAt':{'type':Sequelize[_0x2986('0x4')]},'exitAt':{'type':Sequelize[_0x2986('0x4')]},'reason':{'type':Sequelize[_0x2986('0x3')]}};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js
index 1d318b9..af4863c 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8148=['type','VIRTUAL','field','filter','options','includeAll','include','rows','catch','params','length','create','body','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','order','sort','pick','where','merge','map'];(function(_0x433958,_0x231e64){var _0x1d24aa=function(_0x246be3){while(--_0x246be3){_0x433958['push'](_0x433958['shift']());}};_0x1d24aa(++_0x231e64);}(_0x8148,0x117));var _0x8814=function(_0x4b8d14,_0x4ec792){_0x4b8d14=_0x4b8d14-0x0;var _0x54aeba=_0x8148[_0x4b8d14];return _0x54aeba;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8814('0x0'));var jsonpatch=require(_0x8814('0x1'));var rp=require(_0x8814('0x2'));var moment=require('moment');var BPromise=require(_0x8814('0x3'));var Mustache=require('mustache');var util=require(_0x8814('0x4'));var path=require(_0x8814('0x5'));var sox=require('sox');var csv=require(_0x8814('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8814('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8814('0x8'));var deskjs=require(_0x8814('0x9'));var toCsv=require(_0x8814('0x6'));var querystring=require('querystring');var Papa=require(_0x8814('0xa'));var Redis=require(_0x8814('0xb'));var authService=require(_0x8814('0xc'));var qs=require(_0x8814('0xd'));var hardwareService=require(_0x8814('0xe'));var logger=require(_0x8814('0xf'))(_0x8814('0x10'));var utils=require(_0x8814('0x11'));var config=require(_0x8814('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x527d99,_0x5e7feb){_0x5e7feb=_0x5e7feb||0xcc;return function(_0x11de93){if(_0x11de93){return _0x527d99[_0x8814('0x13')](_0x5e7feb);}return _0x527d99[_0x8814('0x14')](_0x5e7feb)[_0x8814('0x15')]();};}function respondWithResult(_0xc5e0c6,_0x1663cf){_0x1663cf=_0x1663cf||0xc8;return function(_0x334dfe){if(_0x334dfe){return _0xc5e0c6[_0x8814('0x14')](_0x1663cf)[_0x8814('0x16')](_0x334dfe);}};}function respondWithFilteredResult(_0x364fe5,_0x2a1a69){return function(_0x561683){if(_0x561683){var _0x2462aa=_0x561683[_0x8814('0x17')],_0x286049=_0x2a1a69[_0x8814('0x18')],_0x3be012=_0x2a1a69[_0x8814('0x18')]+_0x2a1a69[_0x8814('0x19')],_0x661648;if(_0x3be012>=_0x2462aa){_0x3be012=_0x2462aa;_0x661648=0xc8;}else{_0x661648=0xce;}_0x364fe5[_0x8814('0x14')](_0x661648);return _0x364fe5['set'](_0x8814('0x1a'),_0x286049+'-'+_0x3be012+'/'+_0x2462aa)[_0x8814('0x16')](_0x561683);}return null;};}function patchUpdates(_0x4adbfe){return function(_0x5811e1){try{jsonpatch[_0x8814('0x1b')](_0x5811e1,_0x4adbfe,!![]);}catch(_0x5b5ada){return BPromise['reject'](_0x5b5ada);}return _0x5811e1['save']();};}function saveUpdates(_0x31513a,_0x1be9fb){return function(_0x47a3d6){if(_0x47a3d6){return _0x47a3d6[_0x8814('0x1c')](_0x31513a)[_0x8814('0x1d')](function(_0x30aec8){return _0x30aec8;});}return null;};}function removeEntity(_0xe1ba1d,_0x3c4456){return function(_0x429188){if(_0x429188){return _0x429188[_0x8814('0x1e')]()[_0x8814('0x1d')](function(){_0xe1ba1d['status'](0xcc)[_0x8814('0x15')]();});}};}function handleEntityNotFound(_0x53a187,_0x39635c){return function(_0x46e941){if(!_0x46e941){_0x53a187[_0x8814('0x13')](0x194);}return _0x46e941;};}function handleError(_0x51ad8b,_0x4b5200){_0x4b5200=_0x4b5200||0x1f4;return function(_0x33c036){logger[_0x8814('0x1f')](_0x33c036[_0x8814('0x20')]);if(_0x33c036[_0x8814('0x21')]){delete _0x33c036['name'];}_0x51ad8b[_0x8814('0x14')](_0x4b5200)[_0x8814('0x22')](_0x33c036);};}exports[_0x8814('0x23')]=function(_0x50bfb1,_0xf0cde5){var _0x1310b9={},_0x2f465a={},_0x112b20={'count':0x0,'rows':[]};var _0x105252=db[_0x8814('0x24')][_0x8814('0x25')];_0x2f465a[_0x8814('0x26')]=_[_0x8814('0x27')](_0x105252);_0x2f465a[_0x8814('0x28')]=_['keys'](_0x50bfb1['query']);_0x2f465a[_0x8814('0x29')]=_['intersection'](_0x2f465a[_0x8814('0x26')],_0x2f465a[_0x8814('0x28')]);_0x1310b9['attributes']=_[_0x8814('0x2a')](_0x2f465a[_0x8814('0x26')],qs['fields'](_0x50bfb1[_0x8814('0x28')][_0x8814('0x2b')]));_0x1310b9[_0x8814('0x2c')]=_0x1310b9[_0x8814('0x2c')]['length']?_0x1310b9['attributes']:_0x2f465a[_0x8814('0x26')];if(!_0x50bfb1[_0x8814('0x28')]['hasOwnProperty']('nolimit')){_0x1310b9[_0x8814('0x19')]=qs[_0x8814('0x19')](_0x50bfb1[_0x8814('0x28')][_0x8814('0x19')]);_0x1310b9[_0x8814('0x18')]=qs[_0x8814('0x18')](_0x50bfb1['query'][_0x8814('0x18')]);}_0x1310b9[_0x8814('0x2d')]=qs['sort'](_0x50bfb1[_0x8814('0x28')][_0x8814('0x2e')]);_0x1310b9['where']=qs['filters'](_[_0x8814('0x2f')](_0x50bfb1['query'],_0x2f465a[_0x8814('0x29')]));if(_0x50bfb1[_0x8814('0x28')]['filter']){_0x1310b9[_0x8814('0x30')]=_[_0x8814('0x31')](_0x1310b9[_0x8814('0x30')],{'$or':_[_0x8814('0x32')](_0x105252,function(_0x1ef877){if(_0x1ef877[_0x8814('0x33')]['key']!==_0x8814('0x34')){var _0x587e13={};_0x587e13[_0x1ef877[_0x8814('0x35')]]={'$like':'%'+_0x50bfb1['query'][_0x8814('0x36')]+'%'};return _0x587e13;}})});}_0x1310b9=_[_0x8814('0x31')]({},_0x1310b9,_0x50bfb1[_0x8814('0x37')]);var _0x47645e={'where':_0x1310b9[_0x8814('0x30')]};return db[_0x8814('0x24')][_0x8814('0x17')](_0x47645e)[_0x8814('0x1d')](function(_0x176992){_0x112b20[_0x8814('0x17')]=_0x176992;if(_0x50bfb1[_0x8814('0x28')][_0x8814('0x38')]){_0x1310b9[_0x8814('0x39')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x1310b9);})['then'](function(_0x342d23){_0x112b20[_0x8814('0x3a')]=_0x342d23;return _0x112b20;})[_0x8814('0x1d')](respondWithFilteredResult(_0xf0cde5,_0x1310b9))[_0x8814('0x3b')](handleError(_0xf0cde5,null));};exports['show']=function(_0x2e2cb1,_0x5564d3){var _0x3e7a52={'raw':!![],'where':{'id':_0x2e2cb1[_0x8814('0x3c')]['id']}},_0x2ae842={};_0x2ae842['model']=_[_0x8814('0x27')](db[_0x8814('0x24')]['rawAttributes']);_0x2ae842[_0x8814('0x28')]=_[_0x8814('0x27')](_0x2e2cb1[_0x8814('0x28')]);_0x2ae842[_0x8814('0x29')]=_['intersection'](_0x2ae842['model'],_0x2ae842[_0x8814('0x28')]);_0x3e7a52[_0x8814('0x2c')]=_[_0x8814('0x2a')](_0x2ae842[_0x8814('0x26')],qs['fields'](_0x2e2cb1[_0x8814('0x28')]['fields']));_0x3e7a52['attributes']=_0x3e7a52[_0x8814('0x2c')][_0x8814('0x3d')]?_0x3e7a52['attributes']:_0x2ae842[_0x8814('0x26')];if(_0x2e2cb1[_0x8814('0x28')][_0x8814('0x38')]){_0x3e7a52[_0x8814('0x39')]=[{'all':!![]}];}_0x3e7a52=_['merge']({},_0x3e7a52,_0x2e2cb1[_0x8814('0x37')]);return db[_0x8814('0x24')]['find'](_0x3e7a52)[_0x8814('0x1d')](handleEntityNotFound(_0x5564d3,null))[_0x8814('0x1d')](respondWithResult(_0x5564d3,null))[_0x8814('0x3b')](handleError(_0x5564d3,null));};exports[_0x8814('0x3e')]=function(_0x5c1bc1,_0xf385a9){return db[_0x8814('0x24')][_0x8814('0x3e')](_0x5c1bc1[_0x8814('0x3f')],{})[_0x8814('0x1d')](respondWithResult(_0xf385a9,0xc9))[_0x8814('0x3b')](handleError(_0xf385a9,null));};exports['update']=function(_0x508d11,_0x1cbdce){if(_0x508d11[_0x8814('0x3f')]['id']){delete _0x508d11['body']['id'];}return db[_0x8814('0x24')][_0x8814('0x40')]({'where':{'id':_0x508d11[_0x8814('0x3c')]['id']}})[_0x8814('0x1d')](handleEntityNotFound(_0x1cbdce,null))[_0x8814('0x1d')](saveUpdates(_0x508d11[_0x8814('0x3f')],null))[_0x8814('0x1d')](respondWithResult(_0x1cbdce,null))[_0x8814('0x3b')](handleError(_0x1cbdce,null));};exports['destroy']=function(_0x4c80ff,_0x423303){return db['OpenchannelQueueReport'][_0x8814('0x40')]({'where':{'id':_0x4c80ff[_0x8814('0x3c')]['id']}})[_0x8814('0x1d')](handleEntityNotFound(_0x423303,null))[_0x8814('0x1d')](removeEntity(_0x423303,null))[_0x8814('0x3b')](handleError(_0x423303,null));};exports['describe']=function(_0x38a8bc,_0x2dd7c9){return db[_0x8814('0x24')][_0x8814('0x41')]()[_0x8814('0x1d')](respondWithResult(_0x2dd7c9,null))['catch'](handleError(_0x2dd7c9,null));};
\ No newline at end of file
+var _0x1c05=['api','../../config/utils','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','options','OpenchannelQueueReport','includeAll','include','findAll','catch','show','params','keys','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x3a39e1,_0x291c97){var _0x4c7987=function(_0x22cb71){while(--_0x22cb71){_0x3a39e1['push'](_0x3a39e1['shift']());}};_0x4c7987(++_0x291c97);}(_0x1c05,0x157));var _0x51c0=function(_0x1ea4c2,_0x5f4e04){_0x1ea4c2=_0x1ea4c2-0x0;var _0x38de47=_0x1c05[_0x1ea4c2];return _0x38de47;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x51c0('0x0'));var rimraf=require(_0x51c0('0x1'));var zipdir=require(_0x51c0('0x2'));var jsonpatch=require(_0x51c0('0x3'));var rp=require(_0x51c0('0x4'));var moment=require(_0x51c0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x51c0('0x6'));var util=require(_0x51c0('0x7'));var path=require(_0x51c0('0x8'));var sox=require(_0x51c0('0x9'));var csv=require(_0x51c0('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x51c0('0xb'));var crypto=require(_0x51c0('0xc'));var jsforce=require(_0x51c0('0xd'));var deskjs=require(_0x51c0('0xe'));var toCsv=require(_0x51c0('0xa'));var querystring=require(_0x51c0('0xf'));var Papa=require(_0x51c0('0x10'));var Redis=require(_0x51c0('0x11'));var authService=require(_0x51c0('0x12'));var qs=require(_0x51c0('0x13'));var hardwareService=require(_0x51c0('0x14'));var logger=require(_0x51c0('0x15'))(_0x51c0('0x16'));var utils=require(_0x51c0('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x271538,_0x3c0b6e){_0x3c0b6e=_0x3c0b6e||0xcc;return function(_0x4ca037){if(_0x4ca037){return _0x271538['sendStatus'](_0x3c0b6e);}return _0x271538[_0x51c0('0x18')](_0x3c0b6e)[_0x51c0('0x19')]();};}function respondWithResult(_0xc312c2,_0x18e5d0){_0x18e5d0=_0x18e5d0||0xc8;return function(_0x5bae21){if(_0x5bae21){return _0xc312c2[_0x51c0('0x18')](_0x18e5d0)[_0x51c0('0x1a')](_0x5bae21);}};}function respondWithFilteredResult(_0x53717d,_0x1a2e26){return function(_0x44edbd){if(_0x44edbd){var _0x320322=_0x44edbd[_0x51c0('0x1b')],_0x1a7f8b=_0x1a2e26[_0x51c0('0x1c')],_0x1d3e58=_0x1a2e26[_0x51c0('0x1c')]+_0x1a2e26[_0x51c0('0x1d')],_0x1d3f68;if(_0x1d3e58>=_0x320322){_0x1d3e58=_0x320322;_0x1d3f68=0xc8;}else{_0x1d3f68=0xce;}_0x53717d['status'](_0x1d3f68);return _0x53717d[_0x51c0('0x1e')](_0x51c0('0x1f'),_0x1a7f8b+'-'+_0x1d3e58+'/'+_0x320322)['json'](_0x44edbd);}return null;};}function patchUpdates(_0x55a64f){return function(_0x2344f1){try{jsonpatch[_0x51c0('0x20')](_0x2344f1,_0x55a64f,!![]);}catch(_0x48de94){return BPromise[_0x51c0('0x21')](_0x48de94);}return _0x2344f1[_0x51c0('0x22')]();};}function saveUpdates(_0x2e6773,_0x111701){return function(_0x5e631a){if(_0x5e631a){return _0x5e631a[_0x51c0('0x23')](_0x2e6773)[_0x51c0('0x24')](function(_0x15b441){return _0x15b441;});}return null;};}function removeEntity(_0x59860d,_0x23d6de){return function(_0xedab26){if(_0xedab26){return _0xedab26[_0x51c0('0x25')]()[_0x51c0('0x24')](function(){_0x59860d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x455e3f,_0xea913){return function(_0x396126){if(!_0x396126){_0x455e3f['sendStatus'](0x194);}return _0x396126;};}function handleError(_0x314391,_0x37c02f){_0x37c02f=_0x37c02f||0x1f4;return function(_0x3a701d){logger[_0x51c0('0x26')](_0x3a701d[_0x51c0('0x27')]);if(_0x3a701d[_0x51c0('0x28')]){delete _0x3a701d['name'];}_0x314391[_0x51c0('0x18')](_0x37c02f)[_0x51c0('0x29')](_0x3a701d);};}exports['index']=function(_0x45f08e,_0x3e7fce){var _0x8f17fa={},_0x54358d={},_0x1cfe23={'count':0x0,'rows':[]};var _0x488f17=db['OpenchannelQueueReport'][_0x51c0('0x2a')];_0x54358d['model']=_['keys'](_0x488f17);_0x54358d[_0x51c0('0x2b')]=_['keys'](_0x45f08e[_0x51c0('0x2b')]);_0x54358d[_0x51c0('0x2c')]=_[_0x51c0('0x2d')](_0x54358d['model'],_0x54358d[_0x51c0('0x2b')]);_0x8f17fa[_0x51c0('0x2e')]=_[_0x51c0('0x2d')](_0x54358d[_0x51c0('0x2f')],qs[_0x51c0('0x30')](_0x45f08e[_0x51c0('0x2b')][_0x51c0('0x30')]));_0x8f17fa[_0x51c0('0x2e')]=_0x8f17fa[_0x51c0('0x2e')][_0x51c0('0x31')]?_0x8f17fa[_0x51c0('0x2e')]:_0x54358d['model'];if(!_0x45f08e['query'][_0x51c0('0x32')](_0x51c0('0x33'))){_0x8f17fa[_0x51c0('0x1d')]=qs[_0x51c0('0x1d')](_0x45f08e[_0x51c0('0x2b')][_0x51c0('0x1d')]);_0x8f17fa[_0x51c0('0x1c')]=qs[_0x51c0('0x1c')](_0x45f08e[_0x51c0('0x2b')][_0x51c0('0x1c')]);}_0x8f17fa[_0x51c0('0x34')]=qs[_0x51c0('0x35')](_0x45f08e['query'][_0x51c0('0x35')]);_0x8f17fa[_0x51c0('0x36')]=qs['filters'](_[_0x51c0('0x37')](_0x45f08e[_0x51c0('0x2b')],_0x54358d[_0x51c0('0x2c')]));if(_0x45f08e[_0x51c0('0x2b')][_0x51c0('0x38')]){_0x8f17fa['where']=_[_0x51c0('0x39')](_0x8f17fa[_0x51c0('0x36')],{'$or':_[_0x51c0('0x3a')](_0x488f17,function(_0x16a680){if(_0x16a680['type'][_0x51c0('0x3b')]!==_0x51c0('0x3c')){var _0x293d1e={};_0x293d1e[_0x16a680['field']]={'$like':'%'+_0x45f08e[_0x51c0('0x2b')][_0x51c0('0x38')]+'%'};return _0x293d1e;}})});}_0x8f17fa=_[_0x51c0('0x39')]({},_0x8f17fa,_0x45f08e[_0x51c0('0x3d')]);var _0x5253e5={'where':_0x8f17fa[_0x51c0('0x36')]};return db[_0x51c0('0x3e')]['count'](_0x5253e5)[_0x51c0('0x24')](function(_0x1280c9){_0x1cfe23[_0x51c0('0x1b')]=_0x1280c9;if(_0x45f08e[_0x51c0('0x2b')][_0x51c0('0x3f')]){_0x8f17fa[_0x51c0('0x40')]=[{'all':!![]}];}return db[_0x51c0('0x3e')][_0x51c0('0x41')](_0x8f17fa);})[_0x51c0('0x24')](function(_0x15e0b8){_0x1cfe23['rows']=_0x15e0b8;return _0x1cfe23;})['then'](respondWithFilteredResult(_0x3e7fce,_0x8f17fa))[_0x51c0('0x42')](handleError(_0x3e7fce,null));};exports[_0x51c0('0x43')]=function(_0xd3d138,_0x37b786){var _0x880a78={'raw':!![],'where':{'id':_0xd3d138[_0x51c0('0x44')]['id']}},_0x5c2edc={};_0x5c2edc[_0x51c0('0x2f')]=_[_0x51c0('0x45')](db[_0x51c0('0x3e')][_0x51c0('0x2a')]);_0x5c2edc[_0x51c0('0x2b')]=_[_0x51c0('0x45')](_0xd3d138[_0x51c0('0x2b')]);_0x5c2edc[_0x51c0('0x2c')]=_[_0x51c0('0x2d')](_0x5c2edc[_0x51c0('0x2f')],_0x5c2edc['query']);_0x880a78[_0x51c0('0x2e')]=_[_0x51c0('0x2d')](_0x5c2edc[_0x51c0('0x2f')],qs[_0x51c0('0x30')](_0xd3d138['query'][_0x51c0('0x30')]));_0x880a78[_0x51c0('0x2e')]=_0x880a78['attributes']['length']?_0x880a78[_0x51c0('0x2e')]:_0x5c2edc[_0x51c0('0x2f')];if(_0xd3d138[_0x51c0('0x2b')][_0x51c0('0x3f')]){_0x880a78[_0x51c0('0x40')]=[{'all':!![]}];}_0x880a78=_['merge']({},_0x880a78,_0xd3d138[_0x51c0('0x3d')]);return db[_0x51c0('0x3e')][_0x51c0('0x46')](_0x880a78)[_0x51c0('0x24')](handleEntityNotFound(_0x37b786,null))[_0x51c0('0x24')](respondWithResult(_0x37b786,null))[_0x51c0('0x42')](handleError(_0x37b786,null));};exports['create']=function(_0x421766,_0x16b790){return db[_0x51c0('0x3e')]['create'](_0x421766[_0x51c0('0x47')],{})[_0x51c0('0x24')](respondWithResult(_0x16b790,0xc9))[_0x51c0('0x42')](handleError(_0x16b790,null));};exports[_0x51c0('0x23')]=function(_0x1ed016,_0x528bf0){if(_0x1ed016[_0x51c0('0x47')]['id']){delete _0x1ed016['body']['id'];}return db[_0x51c0('0x3e')][_0x51c0('0x46')]({'where':{'id':_0x1ed016[_0x51c0('0x44')]['id']}})['then'](handleEntityNotFound(_0x528bf0,null))[_0x51c0('0x24')](saveUpdates(_0x1ed016[_0x51c0('0x47')],null))[_0x51c0('0x24')](respondWithResult(_0x528bf0,null))['catch'](handleError(_0x528bf0,null));};exports[_0x51c0('0x25')]=function(_0x2f2d91,_0xbd51d7){return db[_0x51c0('0x3e')][_0x51c0('0x46')]({'where':{'id':_0x2f2d91[_0x51c0('0x44')]['id']}})[_0x51c0('0x24')](handleEntityNotFound(_0xbd51d7,null))['then'](removeEntity(_0xbd51d7,null))[_0x51c0('0x42')](handleError(_0xbd51d7,null));};exports[_0x51c0('0x48')]=function(_0x497409,_0x2b0d00){return db[_0x51c0('0x3e')][_0x51c0('0x48')]()[_0x51c0('0x24')](respondWithResult(_0x2b0d00,null))[_0x51c0('0x42')](handleError(_0x2b0d00,null));};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js
index 8d6cb9f..c53ce43 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4fdb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelQueueReport.attributes','OpenchannelQueueReport','report_openchannel_queue','uniqueid'];(function(_0x5e291d,_0x335924){var _0x7597ec=function(_0x59ce56){while(--_0x59ce56){_0x5e291d['push'](_0x5e291d['shift']());}};_0x7597ec(++_0x335924);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x5ebcf4,_0xa13cd7){_0x5ebcf4=_0x5ebcf4-0x0;var _0x365cfd=_0x4fdb[_0x5ebcf4];return _0x365cfd;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var moment=require(_0xb4fd('0x4'));var BPromise=require(_0xb4fd('0x5'));var rp=require(_0xb4fd('0x6'));var fs=require('fs');var path=require(_0xb4fd('0x7'));var rimraf=require(_0xb4fd('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4fd('0x9'));module['exports']=function(_0x14052b,_0x5d8b39){return _0x14052b['define'](_0xb4fd('0xa'),attributes,{'tableName':_0xb4fd('0xb'),'paranoid':![],'indexes':[{'name':_0xb4fd('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf80=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport','uniqueid'];(function(_0x555081,_0x1589db){var _0xb5a98=function(_0x25d2b4){while(--_0x25d2b4){_0x555081['push'](_0x555081['shift']());}};_0xb5a98(++_0x1589db);}(_0xaf80,0x1ef));var _0x0af8=function(_0x2b5d7c,_0x568088){_0x2b5d7c=_0x2b5d7c-0x0;var _0x4a8387=_0xaf80[_0x2b5d7c];return _0x4a8387;};'use strict';var _=require(_0x0af8('0x0'));var util=require(_0x0af8('0x1'));var logger=require(_0x0af8('0x2'))(_0x0af8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0af8('0x4'));var rimraf=require(_0x0af8('0x5'));var config=require(_0x0af8('0x6'));var attributes=require(_0x0af8('0x7'));module[_0x0af8('0x8')]=function(_0x20fdc5,_0x5180bf){return _0x20fdc5['define'](_0x0af8('0x9'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0x0af8('0xa'),'fields':[_0x0af8('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
index 8f48fe2..4d5224d 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0704=['OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','CreateOpenchannelQueueReport'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x0704,0x196));var _0x4070=function(_0x2e99b7,_0x2d7115){_0x2e99b7=_0x2e99b7-0x0;var _0x1ae8a3=_0x0704[_0x2e99b7];return _0x1ae8a3;};'use strict';var _=require('lodash');var util=require(_0x4070('0x0'));var moment=require(_0x4070('0x1'));var BPromise=require(_0x4070('0x2'));var rs=require(_0x4070('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4070('0x4'))['db'];var utils=require(_0x4070('0x5'));var logger=require(_0x4070('0x6'))(_0x4070('0x7'));var config=require('../../config/environment');var jayson=require(_0x4070('0x8'));var client=jayson[_0x4070('0x9')][_0x4070('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a7e9d,_0x314a50,_0x206c6b){return new BPromise(function(_0xbe42ff,_0x5c2435){return client[_0x4070('0xb')](_0x3a7e9d,_0x206c6b)[_0x4070('0xc')](function(_0x4e14ca){logger[_0x4070('0xd')](_0x4070('0xe'),_0x314a50,'request\x20sent');logger[_0x4070('0xf')](_0x4070('0x10'),_0x314a50,'request\x20sent',JSON['stringify'](_0x4e14ca));if(_0x4e14ca[_0x4070('0x11')]){if(_0x4e14ca[_0x4070('0x11')]['code']===0x1f4){logger[_0x4070('0x11')](_0x4070('0xe'),_0x314a50,_0x4e14ca[_0x4070('0x11')][_0x4070('0x12')]);return _0x5c2435(_0x4e14ca[_0x4070('0x11')][_0x4070('0x12')]);}logger[_0x4070('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x314a50,_0x4e14ca[_0x4070('0x11')][_0x4070('0x12')]);return _0xbe42ff(_0x4e14ca[_0x4070('0x11')][_0x4070('0x12')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x314a50,_0x4070('0x13'));_0xbe42ff(_0x4e14ca[_0x4070('0x14')][_0x4070('0x12')]);}})[_0x4070('0x15')](function(_0x4ee31f){logger[_0x4070('0x11')](_0x4070('0xe'),_0x314a50,_0x4ee31f);_0x5c2435(_0x4ee31f);});});}exports[_0x4070('0x16')]=function(_0x146bbf){var _0x2348e0=this;return new Promise(function(_0x4f29cb,_0x11703f){return db[_0x4070('0x17')][_0x4070('0x18')](_0x146bbf[_0x4070('0x19')],{'raw':_0x146bbf[_0x4070('0x1a')]?_0x146bbf['options'][_0x4070('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x45c95a){logger[_0x4070('0xd')](_0x4070('0x16'),_0x146bbf);logger['debug'](_0x4070('0x16'),_0x146bbf,JSON[_0x4070('0x1c')](_0x45c95a));_0x4f29cb(_0x45c95a);})[_0x4070('0x15')](function(_0x5350a7){logger[_0x4070('0x11')](_0x4070('0x16'),_0x5350a7[_0x4070('0x12')],_0x146bbf);_0x11703f(_0x2348e0[_0x4070('0x11')](0x1f4,_0x5350a7[_0x4070('0x12')]));});});};exports[_0x4070('0x1d')]=function(_0x2668ce){var _0x3881ca=this;return new Promise(function(_0x24aae4,_0x326e04){return db[_0x4070('0x17')][_0x4070('0x1e')](_0x2668ce['body'],{'raw':_0x2668ce[_0x4070('0x1a')]?_0x2668ce[_0x4070('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2668ce[_0x4070('0x1a')]?_0x2668ce[_0x4070('0x1a')]['where']||null:null,'attributes':_0x2668ce[_0x4070('0x1a')]?_0x2668ce['options'][_0x4070('0x1f')]||null:null,'limit':_0x2668ce[_0x4070('0x1a')]?_0x2668ce[_0x4070('0x1a')][_0x4070('0x20')]||null:null})['then'](function(_0x44602a){logger[_0x4070('0xd')]('UpdateOpenchannelQueueReport',_0x2668ce);logger[_0x4070('0xf')](_0x4070('0x1d'),_0x2668ce,JSON[_0x4070('0x1c')](_0x44602a));_0x24aae4(_0x44602a);})[_0x4070('0x15')](function(_0x57a1e9){logger[_0x4070('0x11')](_0x4070('0x1d'),_0x57a1e9[_0x4070('0x12')],_0x2668ce);_0x326e04(_0x3881ca[_0x4070('0x11')](0x1f4,_0x57a1e9[_0x4070('0x12')]));});});};
\ No newline at end of file
+var _0x9d98=['message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','debug','update','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x50a739,_0x5c0ea8){var _0xc25db9=function(_0x342d9c){while(--_0x342d9c){_0x50a739['push'](_0x50a739['shift']());}};_0xc25db9(++_0x5c0ea8);}(_0x9d98,0x1ce));var _0x89d9=function(_0xc27899,_0x1e4d63){_0xc27899=_0xc27899-0x0;var _0x1ba91b=_0x9d98[_0xc27899];return _0x1ba91b;};'use strict';var _=require(_0x89d9('0x0'));var util=require('util');var moment=require(_0x89d9('0x1'));var BPromise=require(_0x89d9('0x2'));var rs=require(_0x89d9('0x3'));var fs=require('fs');var Redis=require(_0x89d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x89d9('0x5'))(_0x89d9('0x6'));var config=require(_0x89d9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x89d9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4108a4,_0x1b8abf,_0x2a65d9){return new BPromise(function(_0xfc9152,_0x139583){return client[_0x89d9('0x9')](_0x4108a4,_0x2a65d9)[_0x89d9('0xa')](function(_0x391b49){logger[_0x89d9('0xb')](_0x89d9('0xc'),_0x1b8abf,_0x89d9('0xd'));logger['debug'](_0x89d9('0xe'),_0x1b8abf,_0x89d9('0xd'),JSON[_0x89d9('0xf')](_0x391b49));if(_0x391b49[_0x89d9('0x10')]){if(_0x391b49['error'][_0x89d9('0x11')]===0x1f4){logger['error'](_0x89d9('0xc'),_0x1b8abf,_0x391b49['error'][_0x89d9('0x12')]);return _0x139583(_0x391b49['error']['message']);}logger[_0x89d9('0x10')](_0x89d9('0xc'),_0x1b8abf,_0x391b49[_0x89d9('0x10')][_0x89d9('0x12')]);return _0xfc9152(_0x391b49['error'][_0x89d9('0x12')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b8abf,_0x89d9('0xd'));_0xfc9152(_0x391b49['result'][_0x89d9('0x12')]);}})[_0x89d9('0x13')](function(_0x3c0aff){logger[_0x89d9('0x10')](_0x89d9('0xc'),_0x1b8abf,_0x3c0aff);_0x139583(_0x3c0aff);});});}exports[_0x89d9('0x14')]=function(_0x5d748f){var _0x5e63c8=this;return new Promise(function(_0x37b93b,_0x4546dd){return db[_0x89d9('0x15')][_0x89d9('0x16')](_0x5d748f[_0x89d9('0x17')],{'raw':_0x5d748f['options']?_0x5d748f[_0x89d9('0x18')][_0x89d9('0x19')]===undefined?!![]:![]:!![]})[_0x89d9('0xa')](function(_0x3ea6cf){logger[_0x89d9('0xb')]('CreateOpenchannelQueueReport',_0x5d748f);logger[_0x89d9('0x1a')](_0x89d9('0x14'),_0x5d748f,JSON[_0x89d9('0xf')](_0x3ea6cf));_0x37b93b(_0x3ea6cf);})[_0x89d9('0x13')](function(_0x22877f){logger['error'](_0x89d9('0x14'),_0x22877f['message'],_0x5d748f);_0x4546dd(_0x5e63c8['error'](0x1f4,_0x22877f[_0x89d9('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x15020b){var _0x3ee51a=this;return new Promise(function(_0x551228,_0x46dae7){return db[_0x89d9('0x15')][_0x89d9('0x1b')](_0x15020b['body'],{'raw':_0x15020b[_0x89d9('0x18')]?_0x15020b[_0x89d9('0x18')][_0x89d9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15020b[_0x89d9('0x18')]?_0x15020b[_0x89d9('0x18')][_0x89d9('0x1c')]||null:null,'attributes':_0x15020b[_0x89d9('0x18')]?_0x15020b[_0x89d9('0x18')][_0x89d9('0x1d')]||null:null,'limit':_0x15020b[_0x89d9('0x18')]?_0x15020b[_0x89d9('0x18')][_0x89d9('0x1e')]||null:null})[_0x89d9('0xa')](function(_0x41c8e1){logger['info'](_0x89d9('0x1f'),_0x15020b);logger[_0x89d9('0x1a')](_0x89d9('0x1f'),_0x15020b,JSON[_0x89d9('0xf')](_0x41c8e1));_0x551228(_0x41c8e1);})[_0x89d9('0x13')](function(_0x5a09e0){logger['error'](_0x89d9('0x1f'),_0x5a09e0[_0x89d9('0x12')],_0x15020b);_0x46dae7(_0x3ee51a[_0x89d9('0x10')](0x1f4,_0x5a09e0[_0x89d9('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js
index 77f5c98..390ee34 100644
--- a/server/api/openchannelTransferReport/index.js
+++ b/server/api/openchannelTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ed5=['post','create','put','update','delete','destroy','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x808770,_0x526386){var _0x5e6466=function(_0x28fcec){while(--_0x28fcec){_0x808770['push'](_0x808770['shift']());}};_0x5e6466(++_0x526386);}(_0x0ed5,0x114));var _0x50ed=function(_0x4b38d1,_0x34365a){_0x4b38d1=_0x4b38d1-0x0;var _0x19b924=_0x0ed5[_0x4b38d1];return _0x19b924;};'use strict';var multer=require(_0x50ed('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x50ed('0x1')]();var auth=require(_0x50ed('0x2'));var interaction=require(_0x50ed('0x3'));var config=require(_0x50ed('0x4'));var controller=require(_0x50ed('0x5'));router[_0x50ed('0x6')]('/',auth['isAuthenticated'](),controller[_0x50ed('0x7')]);router[_0x50ed('0x6')](_0x50ed('0x8'),auth[_0x50ed('0x9')](),controller[_0x50ed('0xa')]);router[_0x50ed('0x6')](_0x50ed('0xb'),auth[_0x50ed('0x9')](),controller['show']);router[_0x50ed('0xc')]('/',auth['isAuthenticated'](),controller[_0x50ed('0xd')]);router[_0x50ed('0xe')](_0x50ed('0xb'),auth['isAuthenticated'](),controller[_0x50ed('0xf')]);router[_0x50ed('0x10')]('/:id',auth[_0x50ed('0x9')](),controller[_0x50ed('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xd18c=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/:id','show','post','create','destroy','multer','util','path','connect-timeout'];(function(_0x540c20,_0x196525){var _0x304213=function(_0x172b5e){while(--_0x172b5e){_0x540c20['push'](_0x540c20['shift']());}};_0x304213(++_0x196525);}(_0xd18c,0x19c));var _0xcd18=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xd18c[_0x5beda8];return _0x2aa042;};'use strict';var multer=require(_0xcd18('0x0'));var util=require(_0xcd18('0x1'));var path=require(_0xcd18('0x2'));var timeout=require(_0xcd18('0x3'));var express=require(_0xcd18('0x4'));var router=express['Router']();var auth=require(_0xcd18('0x5'));var interaction=require(_0xcd18('0x6'));var config=require(_0xcd18('0x7'));var controller=require(_0xcd18('0x8'));router[_0xcd18('0x9')]('/',auth[_0xcd18('0xa')](),controller['index']);router[_0xcd18('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xcd18('0xb'),auth['isAuthenticated'](),controller[_0xcd18('0xc')]);router[_0xcd18('0xd')]('/',auth['isAuthenticated'](),controller[_0xcd18('0xe')]);router['put'](_0xcd18('0xb'),auth[_0xcd18('0xa')](),controller['update']);router['delete'](_0xcd18('0xb'),auth['isAuthenticated'](),controller[_0xcd18('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
index 393118f..6106fd1 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05a3=['sequelize','exports','STRING','ENUM','account','agent','queue','DATE','moment'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x05a3,0xbc));var _0x305a=function(_0x1b0f72,_0xe71dbd){_0x1b0f72=_0x1b0f72-0x0;var _0x214e11=_0x05a3[_0x1b0f72];return _0x214e11;};'use strict';var moment=require(_0x305a('0x0'));var Sequelize=require(_0x305a('0x1'));module[_0x305a('0x2')]={'uniqueid':{'type':Sequelize[_0x305a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x305a('0x4')](_0x305a('0x5'),_0x305a('0x6'),'queue'),'allowNull':![],'defaultValue':_0x305a('0x7')},'transferredAt':{'type':Sequelize[_0x305a('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xb698=['moment','STRING','ENUM','account','agent','queue','DATE','NOW'];(function(_0x339e9b,_0x4dd7c7){var _0x48028d=function(_0x4fb0e7){while(--_0x4fb0e7){_0x339e9b['push'](_0x339e9b['shift']());}};_0x48028d(++_0x4dd7c7);}(_0xb698,0x68));var _0x8b69=function(_0x4a9886,_0x51690e){_0x4a9886=_0x4a9886-0x0;var _0x41037c=_0xb698[_0x4a9886];return _0x41037c;};'use strict';var moment=require(_0x8b69('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x8b69('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8b69('0x2')](_0x8b69('0x3'),_0x8b69('0x4'),'queue'),'allowNull':![],'defaultValue':_0x8b69('0x5')},'transferredAt':{'type':Sequelize[_0x8b69('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x8b69('0x7')]}};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js
index 6c2efc2..252c09b 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','OpenchannelTransferReport','includeAll','findAll','show','params','rawAttributes','include','catch','create','body','find','describe','html-pdf','rimraf','fast-json-patch'];(function(_0x17bb79,_0x50097a){var _0x1964c=function(_0x175a63){while(--_0x175a63){_0x17bb79['push'](_0x17bb79['shift']());}};_0x1964c(++_0x50097a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xb7e7[_0x1b828b];return _0x98da1a;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7b7e('0x11'));var logger=require(_0x7b7e('0x12'))(_0x7b7e('0x13'));var utils=require(_0x7b7e('0x14'));var config=require(_0x7b7e('0x15'));var db=require(_0x7b7e('0x16'))['db'];function respondWithStatusCode(_0x36d2a3,_0x55620b){_0x55620b=_0x55620b||0xcc;return function(_0xaadda){if(_0xaadda){return _0x36d2a3['sendStatus'](_0x55620b);}return _0x36d2a3[_0x7b7e('0x17')](_0x55620b)[_0x7b7e('0x18')]();};}function respondWithResult(_0x50d7d2,_0x422d3a){_0x422d3a=_0x422d3a||0xc8;return function(_0x5976ac){if(_0x5976ac){return _0x50d7d2['status'](_0x422d3a)[_0x7b7e('0x19')](_0x5976ac);}};}function respondWithFilteredResult(_0xd304f5,_0xf067da){return function(_0x457ec5){if(_0x457ec5){var _0x3d2fb2=_0x457ec5[_0x7b7e('0x1a')],_0x5703fd=_0xf067da[_0x7b7e('0x1b')],_0x51baf6=_0xf067da[_0x7b7e('0x1b')]+_0xf067da[_0x7b7e('0x1c')],_0xc7f087;if(_0x51baf6>=_0x3d2fb2){_0x51baf6=_0x3d2fb2;_0xc7f087=0xc8;}else{_0xc7f087=0xce;}_0xd304f5[_0x7b7e('0x17')](_0xc7f087);return _0xd304f5[_0x7b7e('0x1d')](_0x7b7e('0x1e'),_0x5703fd+'-'+_0x51baf6+'/'+_0x3d2fb2)[_0x7b7e('0x19')](_0x457ec5);}return null;};}function patchUpdates(_0x429a0e){return function(_0x12e8e9){try{jsonpatch[_0x7b7e('0x1f')](_0x12e8e9,_0x429a0e,!![]);}catch(_0x448980){return BPromise[_0x7b7e('0x20')](_0x448980);}return _0x12e8e9[_0x7b7e('0x21')]();};}function saveUpdates(_0x864287,_0x3a7b8b){return function(_0x49eddb){if(_0x49eddb){return _0x49eddb[_0x7b7e('0x22')](_0x864287)[_0x7b7e('0x23')](function(_0x24718c){return _0x24718c;});}return null;};}function removeEntity(_0x4c0647,_0x313122){return function(_0xbf0cb3){if(_0xbf0cb3){return _0xbf0cb3[_0x7b7e('0x24')]()[_0x7b7e('0x23')](function(){_0x4c0647[_0x7b7e('0x17')](0xcc)[_0x7b7e('0x18')]();});}};}function handleEntityNotFound(_0x28bf43,_0x10a66a){return function(_0x53bbb3){if(!_0x53bbb3){_0x28bf43['sendStatus'](0x194);}return _0x53bbb3;};}function handleError(_0x4a836a,_0x26ee14){_0x26ee14=_0x26ee14||0x1f4;return function(_0x22598e){logger[_0x7b7e('0x25')](_0x22598e['stack']);if(_0x22598e['name']){delete _0x22598e['name'];}_0x4a836a[_0x7b7e('0x17')](_0x26ee14)[_0x7b7e('0x26')](_0x22598e);};}exports[_0x7b7e('0x27')]=function(_0x7aa71,_0x3ceaf5){var _0x48fad1={},_0x6a1e71={},_0x21a15={'count':0x0,'rows':[]};var _0x4c46b8=db['OpenchannelTransferReport']['rawAttributes'];_0x6a1e71[_0x7b7e('0x28')]=_[_0x7b7e('0x29')](_0x4c46b8);_0x6a1e71['query']=_[_0x7b7e('0x29')](_0x7aa71['query']);_0x6a1e71[_0x7b7e('0x2a')]=_[_0x7b7e('0x2b')](_0x6a1e71[_0x7b7e('0x28')],_0x6a1e71['query']);_0x48fad1[_0x7b7e('0x2c')]=_[_0x7b7e('0x2b')](_0x6a1e71[_0x7b7e('0x28')],qs[_0x7b7e('0x2d')](_0x7aa71[_0x7b7e('0x2e')]['fields']));_0x48fad1[_0x7b7e('0x2c')]=_0x48fad1['attributes'][_0x7b7e('0x2f')]?_0x48fad1[_0x7b7e('0x2c')]:_0x6a1e71[_0x7b7e('0x28')];if(!_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x30')](_0x7b7e('0x31'))){_0x48fad1[_0x7b7e('0x1c')]=qs['limit'](_0x7aa71['query'][_0x7b7e('0x1c')]);_0x48fad1[_0x7b7e('0x1b')]=qs['offset'](_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x1b')]);}_0x48fad1[_0x7b7e('0x32')]=qs['sort'](_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x33')]);_0x48fad1[_0x7b7e('0x34')]=qs[_0x7b7e('0x2a')](_[_0x7b7e('0x35')](_0x7aa71[_0x7b7e('0x2e')],_0x6a1e71[_0x7b7e('0x2a')]));if(_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x36')]){_0x48fad1[_0x7b7e('0x34')]=_[_0x7b7e('0x37')](_0x48fad1[_0x7b7e('0x34')],{'$or':_[_0x7b7e('0x38')](_0x4c46b8,function(_0xdcb8ef){if(_0xdcb8ef[_0x7b7e('0x39')][_0x7b7e('0x3a')]!=='VIRTUAL'){var _0x8c80d5={};_0x8c80d5[_0xdcb8ef[_0x7b7e('0x3b')]]={'$like':'%'+_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x36')]+'%'};return _0x8c80d5;}})});}_0x48fad1=_[_0x7b7e('0x37')]({},_0x48fad1,_0x7aa71[_0x7b7e('0x3c')]);var _0x7f15={'where':_0x48fad1[_0x7b7e('0x34')]};return db[_0x7b7e('0x3d')][_0x7b7e('0x1a')](_0x7f15)['then'](function(_0x3d6571){_0x21a15[_0x7b7e('0x1a')]=_0x3d6571;if(_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x3e')]){_0x48fad1['include']=[{'all':!![]}];}return db[_0x7b7e('0x3d')][_0x7b7e('0x3f')](_0x48fad1);})[_0x7b7e('0x23')](function(_0x5c58c0){_0x21a15['rows']=_0x5c58c0;return _0x21a15;})[_0x7b7e('0x23')](respondWithFilteredResult(_0x3ceaf5,_0x48fad1))['catch'](handleError(_0x3ceaf5,null));};exports[_0x7b7e('0x40')]=function(_0x3b16d7,_0x4de331){var _0xa5daaa={'raw':!![],'where':{'id':_0x3b16d7[_0x7b7e('0x41')]['id']}},_0x2074d1={};_0x2074d1[_0x7b7e('0x28')]=_[_0x7b7e('0x29')](db[_0x7b7e('0x3d')][_0x7b7e('0x42')]);_0x2074d1[_0x7b7e('0x2e')]=_[_0x7b7e('0x29')](_0x3b16d7['query']);_0x2074d1['filters']=_[_0x7b7e('0x2b')](_0x2074d1['model'],_0x2074d1[_0x7b7e('0x2e')]);_0xa5daaa['attributes']=_['intersection'](_0x2074d1[_0x7b7e('0x28')],qs['fields'](_0x3b16d7[_0x7b7e('0x2e')]['fields']));_0xa5daaa[_0x7b7e('0x2c')]=_0xa5daaa[_0x7b7e('0x2c')][_0x7b7e('0x2f')]?_0xa5daaa[_0x7b7e('0x2c')]:_0x2074d1['model'];if(_0x3b16d7[_0x7b7e('0x2e')][_0x7b7e('0x3e')]){_0xa5daaa[_0x7b7e('0x43')]=[{'all':!![]}];}_0xa5daaa=_[_0x7b7e('0x37')]({},_0xa5daaa,_0x3b16d7[_0x7b7e('0x3c')]);return db[_0x7b7e('0x3d')]['find'](_0xa5daaa)['then'](handleEntityNotFound(_0x4de331,null))['then'](respondWithResult(_0x4de331,null))[_0x7b7e('0x44')](handleError(_0x4de331,null));};exports[_0x7b7e('0x45')]=function(_0x2f9de2,_0x2cfe70){return db[_0x7b7e('0x3d')][_0x7b7e('0x45')](_0x2f9de2['body'],{})[_0x7b7e('0x23')](respondWithResult(_0x2cfe70,0xc9))[_0x7b7e('0x44')](handleError(_0x2cfe70,null));};exports['update']=function(_0x5efcb8,_0x1dcb88){if(_0x5efcb8[_0x7b7e('0x46')]['id']){delete _0x5efcb8[_0x7b7e('0x46')]['id'];}return db[_0x7b7e('0x3d')][_0x7b7e('0x47')]({'where':{'id':_0x5efcb8[_0x7b7e('0x41')]['id']}})['then'](handleEntityNotFound(_0x1dcb88,null))[_0x7b7e('0x23')](saveUpdates(_0x5efcb8['body'],null))[_0x7b7e('0x23')](respondWithResult(_0x1dcb88,null))[_0x7b7e('0x44')](handleError(_0x1dcb88,null));};exports[_0x7b7e('0x24')]=function(_0x5874e2,_0x58e4e6){return db[_0x7b7e('0x3d')][_0x7b7e('0x47')]({'where':{'id':_0x5874e2[_0x7b7e('0x41')]['id']}})[_0x7b7e('0x23')](handleEntityNotFound(_0x58e4e6,null))[_0x7b7e('0x23')](removeEntity(_0x58e4e6,null))['catch'](handleError(_0x58e4e6,null));};exports[_0x7b7e('0x48')]=function(_0x270c4a,_0x21868a){return db[_0x7b7e('0x3d')][_0x7b7e('0x48')]()['then'](respondWithResult(_0x21868a,null))[_0x7b7e('0x44')](handleError(_0x21868a,null));};
\ No newline at end of file
+var _0x4fc2=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','OpenchannelTransferReport','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','findAll','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x241e32,_0x177203){var _0x30b0bf=function(_0x5b6cbe){while(--_0x5b6cbe){_0x241e32['push'](_0x241e32['shift']());}};_0x30b0bf(++_0x177203);}(_0x4fc2,0x111));var _0x24fc=function(_0x3439ef,_0x198707){_0x3439ef=_0x3439ef-0x0;var _0x3c7937=_0x4fc2[_0x3439ef];return _0x3c7937;};'use strict';var pdf=require(_0x24fc('0x0'));var emlformat=require(_0x24fc('0x1'));var rimraf=require(_0x24fc('0x2'));var zipdir=require(_0x24fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fc('0x4'));var moment=require(_0x24fc('0x5'));var BPromise=require(_0x24fc('0x6'));var Mustache=require('mustache');var util=require(_0x24fc('0x7'));var path=require(_0x24fc('0x8'));var sox=require('sox');var csv=require(_0x24fc('0x9'));var ejs=require(_0x24fc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0x9'));var querystring=require(_0x24fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x10'));var authService=require(_0x24fc('0x11'));var qs=require(_0x24fc('0x12'));var hardwareService=require(_0x24fc('0x13'));var logger=require(_0x24fc('0x14'))(_0x24fc('0x15'));var utils=require(_0x24fc('0x16'));var config=require(_0x24fc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bd032,_0x1cde5d){_0x1cde5d=_0x1cde5d||0xcc;return function(_0x5cc65e){if(_0x5cc65e){return _0x3bd032[_0x24fc('0x18')](_0x1cde5d);}return _0x3bd032[_0x24fc('0x19')](_0x1cde5d)[_0x24fc('0x1a')]();};}function respondWithResult(_0x3bc30b,_0x30f19b){_0x30f19b=_0x30f19b||0xc8;return function(_0x326276){if(_0x326276){return _0x3bc30b['status'](_0x30f19b)[_0x24fc('0x1b')](_0x326276);}};}function respondWithFilteredResult(_0x18c0a7,_0x2ffed3){return function(_0x42cbe8){if(_0x42cbe8){var _0x4acd36=_0x42cbe8[_0x24fc('0x1c')],_0x2ac989=_0x2ffed3[_0x24fc('0x1d')],_0x588543=_0x2ffed3[_0x24fc('0x1d')]+_0x2ffed3[_0x24fc('0x1e')],_0x4af098;if(_0x588543>=_0x4acd36){_0x588543=_0x4acd36;_0x4af098=0xc8;}else{_0x4af098=0xce;}_0x18c0a7['status'](_0x4af098);return _0x18c0a7[_0x24fc('0x1f')](_0x24fc('0x20'),_0x2ac989+'-'+_0x588543+'/'+_0x4acd36)[_0x24fc('0x1b')](_0x42cbe8);}return null;};}function patchUpdates(_0x8ac114){return function(_0x4c5a43){try{jsonpatch[_0x24fc('0x21')](_0x4c5a43,_0x8ac114,!![]);}catch(_0x4073e0){return BPromise[_0x24fc('0x22')](_0x4073e0);}return _0x4c5a43['save']();};}function saveUpdates(_0x32a57d,_0x36a771){return function(_0xbf1d6b){if(_0xbf1d6b){return _0xbf1d6b[_0x24fc('0x23')](_0x32a57d)['then'](function(_0x323beb){return _0x323beb;});}return null;};}function removeEntity(_0x545939,_0x339b50){return function(_0x591c8f){if(_0x591c8f){return _0x591c8f[_0x24fc('0x24')]()[_0x24fc('0x25')](function(){_0x545939[_0x24fc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x313a25,_0x552035){return function(_0x35a9c7){if(!_0x35a9c7){_0x313a25[_0x24fc('0x18')](0x194);}return _0x35a9c7;};}function handleError(_0x36a9b4,_0x34b5b2){_0x34b5b2=_0x34b5b2||0x1f4;return function(_0x3296fc){logger[_0x24fc('0x26')](_0x3296fc[_0x24fc('0x27')]);if(_0x3296fc[_0x24fc('0x28')]){delete _0x3296fc[_0x24fc('0x28')];}_0x36a9b4[_0x24fc('0x19')](_0x34b5b2)['send'](_0x3296fc);};}exports[_0x24fc('0x29')]=function(_0x16f27f,_0x3ee302){var _0x5bb4c8={},_0xf2f77d={},_0x3d1ec8={'count':0x0,'rows':[]};var _0x35f9f9=db[_0x24fc('0x2a')][_0x24fc('0x2b')];_0xf2f77d[_0x24fc('0x2c')]=_['keys'](_0x35f9f9);_0xf2f77d[_0x24fc('0x2d')]=_[_0x24fc('0x2e')](_0x16f27f[_0x24fc('0x2d')]);_0xf2f77d[_0x24fc('0x2f')]=_[_0x24fc('0x30')](_0xf2f77d['model'],_0xf2f77d['query']);_0x5bb4c8['attributes']=_[_0x24fc('0x30')](_0xf2f77d['model'],qs[_0x24fc('0x31')](_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x31')]));_0x5bb4c8[_0x24fc('0x32')]=_0x5bb4c8['attributes'][_0x24fc('0x33')]?_0x5bb4c8[_0x24fc('0x32')]:_0xf2f77d['model'];if(!_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x34')]('nolimit')){_0x5bb4c8['limit']=qs[_0x24fc('0x1e')](_0x16f27f['query'][_0x24fc('0x1e')]);_0x5bb4c8[_0x24fc('0x1d')]=qs['offset'](_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x1d')]);}_0x5bb4c8[_0x24fc('0x35')]=qs[_0x24fc('0x36')](_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x36')]);_0x5bb4c8[_0x24fc('0x37')]=qs[_0x24fc('0x2f')](_[_0x24fc('0x38')](_0x16f27f['query'],_0xf2f77d[_0x24fc('0x2f')]));if(_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x39')]){_0x5bb4c8[_0x24fc('0x37')]=_[_0x24fc('0x3a')](_0x5bb4c8['where'],{'$or':_['map'](_0x35f9f9,function(_0xd52d10){if(_0xd52d10['type'][_0x24fc('0x3b')]!==_0x24fc('0x3c')){var _0x10399f={};_0x10399f[_0xd52d10[_0x24fc('0x3d')]]={'$like':'%'+_0x16f27f['query'][_0x24fc('0x39')]+'%'};return _0x10399f;}})});}_0x5bb4c8=_['merge']({},_0x5bb4c8,_0x16f27f[_0x24fc('0x3e')]);var _0x3b8fb6={'where':_0x5bb4c8[_0x24fc('0x37')]};return db[_0x24fc('0x2a')][_0x24fc('0x1c')](_0x3b8fb6)['then'](function(_0xadedb4){_0x3d1ec8[_0x24fc('0x1c')]=_0xadedb4;if(_0x16f27f[_0x24fc('0x2d')][_0x24fc('0x3f')]){_0x5bb4c8['include']=[{'all':!![]}];}return db[_0x24fc('0x2a')][_0x24fc('0x40')](_0x5bb4c8);})['then'](function(_0xf40435){_0x3d1ec8['rows']=_0xf40435;return _0x3d1ec8;})[_0x24fc('0x25')](respondWithFilteredResult(_0x3ee302,_0x5bb4c8))[_0x24fc('0x41')](handleError(_0x3ee302,null));};exports[_0x24fc('0x42')]=function(_0x1e045a,_0x431189){var _0x278b18={'raw':!![],'where':{'id':_0x1e045a[_0x24fc('0x43')]['id']}},_0x77b959={};_0x77b959['model']=_[_0x24fc('0x2e')](db[_0x24fc('0x2a')][_0x24fc('0x2b')]);_0x77b959['query']=_[_0x24fc('0x2e')](_0x1e045a[_0x24fc('0x2d')]);_0x77b959['filters']=_[_0x24fc('0x30')](_0x77b959[_0x24fc('0x2c')],_0x77b959[_0x24fc('0x2d')]);_0x278b18['attributes']=_[_0x24fc('0x30')](_0x77b959[_0x24fc('0x2c')],qs['fields'](_0x1e045a[_0x24fc('0x2d')][_0x24fc('0x31')]));_0x278b18[_0x24fc('0x32')]=_0x278b18[_0x24fc('0x32')]['length']?_0x278b18[_0x24fc('0x32')]:_0x77b959[_0x24fc('0x2c')];if(_0x1e045a[_0x24fc('0x2d')][_0x24fc('0x3f')]){_0x278b18[_0x24fc('0x44')]=[{'all':!![]}];}_0x278b18=_['merge']({},_0x278b18,_0x1e045a[_0x24fc('0x3e')]);return db[_0x24fc('0x2a')][_0x24fc('0x45')](_0x278b18)[_0x24fc('0x25')](handleEntityNotFound(_0x431189,null))['then'](respondWithResult(_0x431189,null))[_0x24fc('0x41')](handleError(_0x431189,null));};exports[_0x24fc('0x46')]=function(_0x5ea251,_0x5bbb6c){return db[_0x24fc('0x2a')]['create'](_0x5ea251['body'],{})[_0x24fc('0x25')](respondWithResult(_0x5bbb6c,0xc9))['catch'](handleError(_0x5bbb6c,null));};exports[_0x24fc('0x23')]=function(_0x264854,_0x5052c8){if(_0x264854['body']['id']){delete _0x264854[_0x24fc('0x47')]['id'];}return db[_0x24fc('0x2a')][_0x24fc('0x45')]({'where':{'id':_0x264854[_0x24fc('0x43')]['id']}})[_0x24fc('0x25')](handleEntityNotFound(_0x5052c8,null))[_0x24fc('0x25')](saveUpdates(_0x264854[_0x24fc('0x47')],null))[_0x24fc('0x25')](respondWithResult(_0x5052c8,null))['catch'](handleError(_0x5052c8,null));};exports['destroy']=function(_0x266378,_0x2f1a99){return db[_0x24fc('0x2a')]['find']({'where':{'id':_0x266378['params']['id']}})[_0x24fc('0x25')](handleEntityNotFound(_0x2f1a99,null))[_0x24fc('0x25')](removeEntity(_0x2f1a99,null))[_0x24fc('0x41')](handleError(_0x2f1a99,null));};exports[_0x24fc('0x48')]=function(_0x21f8b8,_0x42e22a){return db[_0x24fc('0x2a')][_0x24fc('0x48')]()[_0x24fc('0x25')](respondWithResult(_0x42e22a,null))[_0x24fc('0x41')](handleError(_0x42e22a,null));};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js
index a300b03..ebe3e7e 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.model.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3716=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x28eedc,_0x176917){var _0x575e59=function(_0x40f58d){while(--_0x40f58d){_0x28eedc['push'](_0x28eedc['shift']());}};_0x575e59(++_0x176917);}(_0x3716,0x76));var _0x6371=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x3716[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x6371('0x0'));var util=require('util');var logger=require(_0x6371('0x1'))(_0x6371('0x2'));var moment=require(_0x6371('0x3'));var BPromise=require('bluebird');var rp=require(_0x6371('0x4'));var fs=require('fs');var path=require(_0x6371('0x5'));var rimraf=require(_0x6371('0x6'));var config=require(_0x6371('0x7'));var attributes=require(_0x6371('0x8'));module[_0x6371('0x9')]=function(_0x3c1920,_0xe09db3){return _0x3c1920[_0x6371('0xa')](_0x6371('0xb'),attributes,{'tableName':_0x6371('0xc'),'paranoid':![],'indexes':[{'name':_0x6371('0xd'),'fields':[_0x6371('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdab1=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','uniqueid'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xdab1,0xdd));var _0x1dab=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xdab1[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var util=require(_0x1dab('0x0'));var logger=require(_0x1dab('0x1'))(_0x1dab('0x2'));var moment=require(_0x1dab('0x3'));var BPromise=require(_0x1dab('0x4'));var rp=require(_0x1dab('0x5'));var fs=require('fs');var path=require(_0x1dab('0x6'));var rimraf=require(_0x1dab('0x7'));var config=require(_0x1dab('0x8'));var attributes=require(_0x1dab('0x9'));module['exports']=function(_0x340098,_0x1f93f4){return _0x340098[_0x1dab('0xa')](_0x1dab('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x1dab('0xc'),'fields':[_0x1dab('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
index 8f87f0b..bc42b36 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x921c=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0x921c,0x1ab));var _0xc921=function(_0x56988e,_0x573e1c){_0x56988e=_0x56988e-0x0;var _0x3ec530=_0x921c[_0x56988e];return _0x3ec530;};'use strict';var _=require(_0xc921('0x0'));var util=require(_0xc921('0x1'));var moment=require(_0xc921('0x2'));var BPromise=require(_0xc921('0x3'));var rs=require(_0xc921('0x4'));var fs=require('fs');var Redis=require(_0xc921('0x5'));var db=require(_0xc921('0x6'))['db'];var utils=require(_0xc921('0x7'));var logger=require(_0xc921('0x8'))(_0xc921('0x9'));var config=require('../../config/environment');var jayson=require(_0xc921('0xa'));var client=jayson[_0xc921('0xb')][_0xc921('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1419e0,_0x5dec90,_0x14312a){return new BPromise(function(_0x22224d,_0x1db0e9){return client[_0xc921('0xd')](_0x1419e0,_0x14312a)[_0xc921('0xe')](function(_0x442b66){logger[_0xc921('0xf')](_0xc921('0x10'),_0x5dec90,'request\x20sent');logger[_0xc921('0x11')](_0xc921('0x12'),_0x5dec90,_0xc921('0x13'),JSON['stringify'](_0x442b66));if(_0x442b66['error']){if(_0x442b66['error'][_0xc921('0x14')]===0x1f4){logger[_0xc921('0x15')](_0xc921('0x10'),_0x5dec90,_0x442b66[_0xc921('0x15')]['message']);return _0x1db0e9(_0x442b66[_0xc921('0x15')][_0xc921('0x16')]);}logger[_0xc921('0x15')](_0xc921('0x10'),_0x5dec90,_0x442b66['error'][_0xc921('0x16')]);return _0x22224d(_0x442b66[_0xc921('0x15')][_0xc921('0x16')]);}else{logger[_0xc921('0xf')](_0xc921('0x10'),_0x5dec90,'request\x20sent');_0x22224d(_0x442b66[_0xc921('0x17')][_0xc921('0x16')]);}})[_0xc921('0x18')](function(_0x2a046f){logger['error'](_0xc921('0x10'),_0x5dec90,_0x2a046f);_0x1db0e9(_0x2a046f);});});}
\ No newline at end of file
+var _0x3dc1=['info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x34c4e1,_0x310387){var _0x5a11ef=function(_0x552f26){while(--_0x552f26){_0x34c4e1['push'](_0x34c4e1['shift']());}};_0x5a11ef(++_0x310387);}(_0x3dc1,0x127));var _0x13dc=function(_0x25e068,_0x31583b){_0x25e068=_0x25e068-0x0;var _0x11bd93=_0x3dc1[_0x25e068];return _0x11bd93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x13dc('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13dc('0x1'));var db=require(_0x13dc('0x2'))['db'];var utils=require(_0x13dc('0x3'));var logger=require(_0x13dc('0x4'))(_0x13dc('0x5'));var config=require('../../config/environment');var jayson=require(_0x13dc('0x6'));var client=jayson[_0x13dc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e34c3,_0x1e28ab,_0x4becff){return new BPromise(function(_0x5d358e,_0x3e732d){return client['request'](_0x5e34c3,_0x4becff)[_0x13dc('0x8')](function(_0x12ac72){logger[_0x13dc('0x9')](_0x13dc('0xa'),_0x1e28ab,'request\x20sent');logger[_0x13dc('0xb')](_0x13dc('0xc'),_0x1e28ab,'request\x20sent',JSON[_0x13dc('0xd')](_0x12ac72));if(_0x12ac72[_0x13dc('0xe')]){if(_0x12ac72[_0x13dc('0xe')]['code']===0x1f4){logger[_0x13dc('0xe')](_0x13dc('0xa'),_0x1e28ab,_0x12ac72['error'][_0x13dc('0xf')]);return _0x3e732d(_0x12ac72['error'][_0x13dc('0xf')]);}logger[_0x13dc('0xe')](_0x13dc('0xa'),_0x1e28ab,_0x12ac72[_0x13dc('0xe')][_0x13dc('0xf')]);return _0x5d358e(_0x12ac72['error'][_0x13dc('0xf')]);}else{logger[_0x13dc('0x9')](_0x13dc('0xa'),_0x1e28ab,_0x13dc('0x10'));_0x5d358e(_0x12ac72[_0x13dc('0x11')][_0x13dc('0xf')]);}})[_0x13dc('0x12')](function(_0x1d1e1e){logger[_0x13dc('0xe')](_0x13dc('0xa'),_0x1e28ab,_0x1d1e1e);_0x3e732d(_0x1d1e1e);});});}
\ No newline at end of file
diff --git a/server/api/pause/index.js b/server/api/pause/index.js
index 1695f34..901efdd 100644
--- a/server/api/pause/index.js
+++ b/server/api/pause/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2333=['./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x107b09,_0x269e08){var _0x34bc6a=function(_0x55ff0b){while(--_0x55ff0b){_0x107b09['push'](_0x107b09['shift']());}};_0x34bc6a(++_0x269e08);}(_0x2333,0x11a));var _0x3233=function(_0x2b1a24,_0x5f1534){_0x2b1a24=_0x2b1a24-0x0;var _0x3698eb=_0x2333[_0x2b1a24];return _0x3698eb;};'use strict';var multer=require(_0x3233('0x0'));var util=require(_0x3233('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3233('0x2'));var router=express[_0x3233('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3233('0x4'));var config=require(_0x3233('0x5'));var controller=require(_0x3233('0x6'));router[_0x3233('0x7')]('/',auth[_0x3233('0x8')](),controller[_0x3233('0x9')]);router[_0x3233('0x7')](_0x3233('0xa'),auth[_0x3233('0x8')](),controller[_0x3233('0xb')]);router[_0x3233('0xc')]('/',auth[_0x3233('0x8')](),controller[_0x3233('0xd')]);router[_0x3233('0xe')](_0x3233('0xa'),auth[_0x3233('0x8')](),controller[_0x3233('0xf')]);router[_0x3233('0x10')](_0x3233('0xa'),auth[_0x3233('0x8')](),controller[_0x3233('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x180f=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','show','post','isAuthenticated','create','put','/:id','update'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0x180f,0xf3));var _0xf180=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x180f[_0x277107];return _0x1da046;};'use strict';var multer=require(_0xf180('0x0'));var util=require(_0xf180('0x1'));var path=require('path');var timeout=require(_0xf180('0x2'));var express=require(_0xf180('0x3'));var router=express['Router']();var auth=require(_0xf180('0x4'));var interaction=require(_0xf180('0x5'));var config=require(_0xf180('0x6'));var controller=require(_0xf180('0x7'));router[_0xf180('0x8')]('/',auth['isAuthenticated'](),controller[_0xf180('0x9')]);router[_0xf180('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf180('0xa')]);router[_0xf180('0xb')]('/',auth[_0xf180('0xc')](),controller[_0xf180('0xd')]);router[_0xf180('0xe')](_0xf180('0xf'),auth[_0xf180('0xc')](),controller[_0xf180('0x10')]);router[_0xf180('0x11')]('/:id',auth[_0xf180('0xc')](),controller[_0xf180('0x12')]);module[_0xf180('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js
index 59eb3cb..f0cc828 100644
--- a/server/api/pause/pause.attributes.js
+++ b/server/api/pause/pause.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d6e=['sequelize','STRING'];(function(_0x2bf5ca,_0x308a4d){var _0x55342c=function(_0x45b80e){while(--_0x45b80e){_0x2bf5ca['push'](_0x2bf5ca['shift']());}};_0x55342c(++_0x308a4d);}(_0x4d6e,0x1bc));var _0xe4d6=function(_0x3e7804,_0x121853){_0x3e7804=_0x3e7804-0x0;var _0x56efda=_0x4d6e[_0x3e7804];return _0x56efda;};'use strict';var Sequelize=require(_0xe4d6('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4d6('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xe4d6('0x1')]}};
\ No newline at end of file
+var _0x32cd=['name','STRING'];(function(_0x1cf6a1,_0x5918e3){var _0x10b453=function(_0x375924){while(--_0x375924){_0x1cf6a1['push'](_0x1cf6a1['shift']());}};_0x10b453(++_0x5918e3);}(_0x32cd,0x8f));var _0xd32c=function(_0x5c3406,_0x55a196){_0x5c3406=_0x5c3406-0x0;var _0x1a5a12=_0x32cd[_0x5c3406];return _0x1a5a12;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd32c('0x0')],'unique':_0xd32c('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xd32c('0x0')]}};
\ No newline at end of file
diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js
index 87b9c64..744561c 100644
--- a/server/api/pause/pause.controller.js
+++ b/server/api/pause/pause.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa108=['length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','Pause','rawAttributes','model','keys','query','filters','intersection','attributes','fields'];(function(_0x488814,_0x3fec59){var _0x58138b=function(_0x575c59){while(--_0x575c59){_0x488814['push'](_0x488814['shift']());}};_0x58138b(++_0x3fec59);}(_0xa108,0xc3));var _0x8a10=function(_0x36ceb9,_0x48bd46){_0x36ceb9=_0x36ceb9-0x0;var _0x4cf26e=_0xa108[_0x36ceb9];return _0x4cf26e;};'use strict';var pdf=require(_0x8a10('0x0'));var emlformat=require(_0x8a10('0x1'));var rimraf=require(_0x8a10('0x2'));var zipdir=require(_0x8a10('0x3'));var jsonpatch=require(_0x8a10('0x4'));var rp=require(_0x8a10('0x5'));var moment=require(_0x8a10('0x6'));var BPromise=require(_0x8a10('0x7'));var Mustache=require(_0x8a10('0x8'));var util=require(_0x8a10('0x9'));var path=require(_0x8a10('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8a10('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8a10('0xc'));var crypto=require(_0x8a10('0xd'));var jsforce=require(_0x8a10('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8a10('0xf'));var querystring=require(_0x8a10('0x10'));var Papa=require(_0x8a10('0x11'));var Redis=require(_0x8a10('0x12'));var authService=require(_0x8a10('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8a10('0x14'));var utils=require(_0x8a10('0x15'));var config=require(_0x8a10('0x16'));var db=require(_0x8a10('0x17'))['db'];function respondWithStatusCode(_0x4dec6b,_0x58dc13){_0x58dc13=_0x58dc13||0xcc;return function(_0x2b9300){if(_0x2b9300){return _0x4dec6b[_0x8a10('0x18')](_0x58dc13);}return _0x4dec6b[_0x8a10('0x19')](_0x58dc13)[_0x8a10('0x1a')]();};}function respondWithResult(_0x14e642,_0x104ea8){_0x104ea8=_0x104ea8||0xc8;return function(_0x430b86){if(_0x430b86){return _0x14e642[_0x8a10('0x19')](_0x104ea8)[_0x8a10('0x1b')](_0x430b86);}};}function respondWithFilteredResult(_0x4f6040,_0x28de16){return function(_0x431938){if(_0x431938){var _0x4fb449=_0x431938[_0x8a10('0x1c')],_0x44b772=_0x28de16[_0x8a10('0x1d')],_0x5b2205=_0x28de16['offset']+_0x28de16[_0x8a10('0x1e')],_0x1a9f24;if(_0x5b2205>=_0x4fb449){_0x5b2205=_0x4fb449;_0x1a9f24=0xc8;}else{_0x1a9f24=0xce;}_0x4f6040[_0x8a10('0x19')](_0x1a9f24);return _0x4f6040[_0x8a10('0x1f')](_0x8a10('0x20'),_0x44b772+'-'+_0x5b2205+'/'+_0x4fb449)[_0x8a10('0x1b')](_0x431938);}return null;};}function patchUpdates(_0x12045f){return function(_0x6ddb0d){try{jsonpatch[_0x8a10('0x21')](_0x6ddb0d,_0x12045f,!![]);}catch(_0x2603fa){return BPromise['reject'](_0x2603fa);}return _0x6ddb0d['save']();};}function saveUpdates(_0x4cfc2f,_0x4525f2){return function(_0x4e9cf0){if(_0x4e9cf0){return _0x4e9cf0[_0x8a10('0x22')](_0x4cfc2f)[_0x8a10('0x23')](function(_0x56a0a7){return _0x56a0a7;});}return null;};}function removeEntity(_0x4c5880,_0x28ce8d){return function(_0x443450){if(_0x443450){return _0x443450[_0x8a10('0x24')]()[_0x8a10('0x23')](function(){var _0xf90065=_0x443450[_0x8a10('0x25')]({'plain':!![]});var _0x5a08fb=_0x8a10('0x26');return db[_0x8a10('0x27')][_0x8a10('0x24')]({'where':{'type':_0x5a08fb,'resourceId':_0xf90065['id']}})[_0x8a10('0x23')](function(){return _0x443450;});})[_0x8a10('0x23')](function(){_0x4c5880['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ad3c7,_0x1c3fee){return function(_0x73f09c){if(!_0x73f09c){_0x1ad3c7['sendStatus'](0x194);}return _0x73f09c;};}function handleError(_0x3b15be,_0x1e4615){_0x1e4615=_0x1e4615||0x1f4;return function(_0x1396e9){logger[_0x8a10('0x28')](_0x1396e9[_0x8a10('0x29')]);if(_0x1396e9[_0x8a10('0x2a')]){delete _0x1396e9[_0x8a10('0x2a')];}_0x3b15be['status'](_0x1e4615)[_0x8a10('0x2b')](_0x1396e9);};}exports[_0x8a10('0x2c')]=function(_0x299b92,_0x5cd7fa){var _0x13c521={},_0x465264={},_0x276d21={'count':0x0,'rows':[]};var _0x1dbbed=db[_0x8a10('0x2d')][_0x8a10('0x2e')];_0x465264[_0x8a10('0x2f')]=_[_0x8a10('0x30')](_0x1dbbed);_0x465264[_0x8a10('0x31')]=_[_0x8a10('0x30')](_0x299b92[_0x8a10('0x31')]);_0x465264[_0x8a10('0x32')]=_[_0x8a10('0x33')](_0x465264[_0x8a10('0x2f')],_0x465264[_0x8a10('0x31')]);_0x13c521[_0x8a10('0x34')]=_['intersection'](_0x465264[_0x8a10('0x2f')],qs[_0x8a10('0x35')](_0x299b92[_0x8a10('0x31')][_0x8a10('0x35')]));_0x13c521[_0x8a10('0x34')]=_0x13c521[_0x8a10('0x34')][_0x8a10('0x36')]?_0x13c521[_0x8a10('0x34')]:_0x465264[_0x8a10('0x2f')];if(!_0x299b92['query']['hasOwnProperty'](_0x8a10('0x37'))){_0x13c521[_0x8a10('0x1e')]=qs[_0x8a10('0x1e')](_0x299b92['query'][_0x8a10('0x1e')]);_0x13c521[_0x8a10('0x1d')]=qs[_0x8a10('0x1d')](_0x299b92[_0x8a10('0x31')][_0x8a10('0x1d')]);}_0x13c521[_0x8a10('0x38')]=qs[_0x8a10('0x39')](_0x299b92[_0x8a10('0x31')][_0x8a10('0x39')]);_0x13c521[_0x8a10('0x3a')]=qs[_0x8a10('0x32')](_[_0x8a10('0x3b')](_0x299b92[_0x8a10('0x31')],_0x465264[_0x8a10('0x32')]));if(_0x299b92[_0x8a10('0x31')][_0x8a10('0x3c')]){_0x13c521[_0x8a10('0x3a')]=_[_0x8a10('0x3d')](_0x13c521['where'],{'$or':_[_0x8a10('0x3e')](_0x1dbbed,function(_0x42d4ec){if(_0x42d4ec[_0x8a10('0x3f')][_0x8a10('0x40')]!==_0x8a10('0x41')){var _0x2de570={};_0x2de570[_0x42d4ec[_0x8a10('0x42')]]={'$like':'%'+_0x299b92[_0x8a10('0x31')]['filter']+'%'};return _0x2de570;}})});}_0x13c521=_[_0x8a10('0x3d')]({},_0x13c521,_0x299b92[_0x8a10('0x43')]);var _0x1039f5={'where':_0x13c521[_0x8a10('0x3a')]};return db[_0x8a10('0x2d')]['count'](_0x1039f5)[_0x8a10('0x23')](function(_0x503051){_0x276d21[_0x8a10('0x1c')]=_0x503051;if(_0x299b92[_0x8a10('0x31')]['includeAll']){_0x13c521[_0x8a10('0x44')]=[{'all':!![]}];}return db['Pause'][_0x8a10('0x45')](_0x13c521);})['then'](function(_0x94cbe){_0x276d21[_0x8a10('0x46')]=_0x94cbe;return _0x276d21;})[_0x8a10('0x23')](respondWithFilteredResult(_0x5cd7fa,_0x13c521))[_0x8a10('0x47')](handleError(_0x5cd7fa,null));};exports[_0x8a10('0x48')]=function(_0x5bd380,_0x231021){var _0x24d20c={'raw':!![],'where':{'id':_0x5bd380['params']['id']}},_0x47d1bf={};_0x47d1bf[_0x8a10('0x2f')]=_[_0x8a10('0x30')](db[_0x8a10('0x2d')][_0x8a10('0x2e')]);_0x47d1bf[_0x8a10('0x31')]=_['keys'](_0x5bd380[_0x8a10('0x31')]);_0x47d1bf[_0x8a10('0x32')]=_['intersection'](_0x47d1bf[_0x8a10('0x2f')],_0x47d1bf[_0x8a10('0x31')]);_0x24d20c[_0x8a10('0x34')]=_[_0x8a10('0x33')](_0x47d1bf['model'],qs[_0x8a10('0x35')](_0x5bd380[_0x8a10('0x31')]['fields']));_0x24d20c[_0x8a10('0x34')]=_0x24d20c[_0x8a10('0x34')][_0x8a10('0x36')]?_0x24d20c[_0x8a10('0x34')]:_0x47d1bf[_0x8a10('0x2f')];if(_0x5bd380[_0x8a10('0x31')][_0x8a10('0x49')]){_0x24d20c[_0x8a10('0x44')]=[{'all':!![]}];}_0x24d20c=_['merge']({},_0x24d20c,_0x5bd380[_0x8a10('0x43')]);return db[_0x8a10('0x2d')][_0x8a10('0x4a')](_0x24d20c)[_0x8a10('0x23')](handleEntityNotFound(_0x231021,null))[_0x8a10('0x23')](respondWithResult(_0x231021,null))[_0x8a10('0x47')](handleError(_0x231021,null));};exports['create']=function(_0x32def4,_0x636b7a){return db['Pause'][_0x8a10('0x4b')](_0x32def4[_0x8a10('0x4c')],{})['then'](function(_0x461bc5){var _0x3835fa=_0x32def4['user'][_0x8a10('0x25')]({'plain':!![]});if(!_0x3835fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3835fa[_0x8a10('0x4d')]===_0x8a10('0x4e')){var _0x1a4de2=_0x461bc5[_0x8a10('0x25')]({'plain':!![]});var _0x26ce70=_0x8a10('0x26');return db[_0x8a10('0x4f')]['find']({'where':{'name':_0x26ce70,'userProfileId':_0x3835fa[_0x8a10('0x50')]},'raw':!![]})[_0x8a10('0x23')](function(_0x30b91f){if(_0x30b91f&&_0x30b91f[_0x8a10('0x51')]===0x0){return db[_0x8a10('0x27')]['create']({'name':_0x1a4de2[_0x8a10('0x2a')],'resourceId':_0x1a4de2['id'],'type':_0x30b91f[_0x8a10('0x2a')],'sectionId':_0x30b91f['id']},{})[_0x8a10('0x23')](function(){return _0x461bc5;});}else{return _0x461bc5;}})[_0x8a10('0x47')](function(_0x16b548){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16b548);throw _0x16b548;});}return _0x461bc5;})[_0x8a10('0x23')](respondWithResult(_0x636b7a,0xc9))['catch'](handleError(_0x636b7a,null));};exports[_0x8a10('0x22')]=function(_0x16f53f,_0x349223){if(_0x16f53f[_0x8a10('0x4c')]['id']){delete _0x16f53f['body']['id'];}return db[_0x8a10('0x2d')][_0x8a10('0x4a')]({'where':{'id':_0x16f53f['params']['id']}})[_0x8a10('0x23')](handleEntityNotFound(_0x349223,null))[_0x8a10('0x23')](saveUpdates(_0x16f53f['body'],null))[_0x8a10('0x23')](respondWithResult(_0x349223,null))[_0x8a10('0x47')](handleError(_0x349223,null));};exports[_0x8a10('0x24')]=function(_0x4bb3ae,_0x41a47f){return db[_0x8a10('0x2d')][_0x8a10('0x4a')]({'where':{'id':_0x4bb3ae[_0x8a10('0x52')]['id']}})[_0x8a10('0x23')](handleEntityNotFound(_0x41a47f,null))['then'](removeEntity(_0x41a47f,null))['catch'](handleError(_0x41a47f,null));};
\ No newline at end of file
+var _0x8646=['rows','catch','show','params','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','error','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','set','json','apply','reject','save','update','then','Pauses','destroy','stack','name','send','Pause','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','VIRTUAL','include'];(function(_0x14afd4,_0x4d1f83){var _0x2c095f=function(_0x5a33be){while(--_0x5a33be){_0x14afd4['push'](_0x14afd4['shift']());}};_0x2c095f(++_0x4d1f83);}(_0x8646,0x19b));var _0x6864=function(_0x21532b,_0x5c34e7){_0x21532b=_0x21532b-0x0;var _0x19f87d=_0x8646[_0x21532b];return _0x19f87d;};'use strict';var pdf=require(_0x6864('0x0'));var emlformat=require(_0x6864('0x1'));var rimraf=require(_0x6864('0x2'));var zipdir=require(_0x6864('0x3'));var jsonpatch=require(_0x6864('0x4'));var rp=require(_0x6864('0x5'));var moment=require(_0x6864('0x6'));var BPromise=require(_0x6864('0x7'));var Mustache=require(_0x6864('0x8'));var util=require(_0x6864('0x9'));var path=require('path');var sox=require(_0x6864('0xa'));var csv=require(_0x6864('0xb'));var ejs=require(_0x6864('0xc'));var fs=require('fs');var _=require(_0x6864('0xd'));var squel=require(_0x6864('0xe'));var crypto=require(_0x6864('0xf'));var jsforce=require(_0x6864('0x10'));var deskjs=require(_0x6864('0x11'));var toCsv=require(_0x6864('0xb'));var querystring=require('querystring');var Papa=require(_0x6864('0x12'));var Redis=require(_0x6864('0x13'));var authService=require(_0x6864('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6864('0x15'));var logger=require(_0x6864('0x16'))('api');var utils=require(_0x6864('0x17'));var config=require(_0x6864('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b6a5f,_0x3292e1){_0x3292e1=_0x3292e1||0xcc;return function(_0x1511ef){if(_0x1511ef){return _0x1b6a5f[_0x6864('0x19')](_0x3292e1);}return _0x1b6a5f[_0x6864('0x1a')](_0x3292e1)['end']();};}function respondWithResult(_0x1a67f6,_0x4ebc6f){_0x4ebc6f=_0x4ebc6f||0xc8;return function(_0x22cf22){if(_0x22cf22){return _0x1a67f6[_0x6864('0x1a')](_0x4ebc6f)['json'](_0x22cf22);}};}function respondWithFilteredResult(_0x3516be,_0x545cca){return function(_0x4f3ad0){if(_0x4f3ad0){var _0x5046f1=_0x4f3ad0[_0x6864('0x1b')],_0x2a57a7=_0x545cca[_0x6864('0x1c')],_0x3819a0=_0x545cca['offset']+_0x545cca[_0x6864('0x1d')],_0x1d4109;if(_0x3819a0>=_0x5046f1){_0x3819a0=_0x5046f1;_0x1d4109=0xc8;}else{_0x1d4109=0xce;}_0x3516be[_0x6864('0x1a')](_0x1d4109);return _0x3516be[_0x6864('0x1e')]('Content-Range',_0x2a57a7+'-'+_0x3819a0+'/'+_0x5046f1)[_0x6864('0x1f')](_0x4f3ad0);}return null;};}function patchUpdates(_0x1886a1){return function(_0x2a0fe9){try{jsonpatch[_0x6864('0x20')](_0x2a0fe9,_0x1886a1,!![]);}catch(_0x436c35){return BPromise[_0x6864('0x21')](_0x436c35);}return _0x2a0fe9[_0x6864('0x22')]();};}function saveUpdates(_0x5eff4f,_0x25d9f6){return function(_0x8f0bb2){if(_0x8f0bb2){return _0x8f0bb2[_0x6864('0x23')](_0x5eff4f)[_0x6864('0x24')](function(_0x154797){return _0x154797;});}return null;};}function removeEntity(_0x18903a,_0x267bea){return function(_0xaeb3df){if(_0xaeb3df){return _0xaeb3df['destroy']()['then'](function(){var _0x5aa498=_0xaeb3df['get']({'plain':!![]});var _0x53f4a2=_0x6864('0x25');return db['UserProfileResource'][_0x6864('0x26')]({'where':{'type':_0x53f4a2,'resourceId':_0x5aa498['id']}})[_0x6864('0x24')](function(){return _0xaeb3df;});})[_0x6864('0x24')](function(){_0x18903a[_0x6864('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x445615,_0x27947b){return function(_0x429851){if(!_0x429851){_0x445615[_0x6864('0x19')](0x194);}return _0x429851;};}function handleError(_0x33b9cd,_0x1d8067){_0x1d8067=_0x1d8067||0x1f4;return function(_0x51c237){logger['error'](_0x51c237[_0x6864('0x27')]);if(_0x51c237[_0x6864('0x28')]){delete _0x51c237[_0x6864('0x28')];}_0x33b9cd[_0x6864('0x1a')](_0x1d8067)[_0x6864('0x29')](_0x51c237);};}exports['index']=function(_0x350c14,_0x47f2c1){var _0x3024e6={},_0x3650b2={},_0x3a62ac={'count':0x0,'rows':[]};var _0x39a003=db[_0x6864('0x2a')][_0x6864('0x2b')];_0x3650b2[_0x6864('0x2c')]=_[_0x6864('0x2d')](_0x39a003);_0x3650b2['query']=_[_0x6864('0x2d')](_0x350c14['query']);_0x3650b2[_0x6864('0x2e')]=_[_0x6864('0x2f')](_0x3650b2[_0x6864('0x2c')],_0x3650b2[_0x6864('0x30')]);_0x3024e6[_0x6864('0x31')]=_[_0x6864('0x2f')](_0x3650b2['model'],qs[_0x6864('0x32')](_0x350c14[_0x6864('0x30')][_0x6864('0x32')]));_0x3024e6[_0x6864('0x31')]=_0x3024e6[_0x6864('0x31')][_0x6864('0x33')]?_0x3024e6[_0x6864('0x31')]:_0x3650b2[_0x6864('0x2c')];if(!_0x350c14[_0x6864('0x30')][_0x6864('0x34')](_0x6864('0x35'))){_0x3024e6['limit']=qs[_0x6864('0x1d')](_0x350c14['query'][_0x6864('0x1d')]);_0x3024e6[_0x6864('0x1c')]=qs[_0x6864('0x1c')](_0x350c14[_0x6864('0x30')][_0x6864('0x1c')]);}_0x3024e6[_0x6864('0x36')]=qs[_0x6864('0x37')](_0x350c14['query']['sort']);_0x3024e6[_0x6864('0x38')]=qs[_0x6864('0x2e')](_[_0x6864('0x39')](_0x350c14[_0x6864('0x30')],_0x3650b2['filters']));if(_0x350c14[_0x6864('0x30')]['filter']){_0x3024e6[_0x6864('0x38')]=_[_0x6864('0x3a')](_0x3024e6['where'],{'$or':_['map'](_0x39a003,function(_0x201ec9){if(_0x201ec9[_0x6864('0x3b')][_0x6864('0x3c')]!==_0x6864('0x3d')){var _0x66400d={};_0x66400d[_0x201ec9['field']]={'$like':'%'+_0x350c14[_0x6864('0x30')]['filter']+'%'};return _0x66400d;}})});}_0x3024e6=_[_0x6864('0x3a')]({},_0x3024e6,_0x350c14['options']);var _0x50909e={'where':_0x3024e6[_0x6864('0x38')]};return db[_0x6864('0x2a')][_0x6864('0x1b')](_0x50909e)[_0x6864('0x24')](function(_0x3ea847){_0x3a62ac[_0x6864('0x1b')]=_0x3ea847;if(_0x350c14[_0x6864('0x30')]['includeAll']){_0x3024e6[_0x6864('0x3e')]=[{'all':!![]}];}return db[_0x6864('0x2a')]['findAll'](_0x3024e6);})[_0x6864('0x24')](function(_0x43bcce){_0x3a62ac[_0x6864('0x3f')]=_0x43bcce;return _0x3a62ac;})[_0x6864('0x24')](respondWithFilteredResult(_0x47f2c1,_0x3024e6))[_0x6864('0x40')](handleError(_0x47f2c1,null));};exports[_0x6864('0x41')]=function(_0xf4b93f,_0x2a7310){var _0x1ababc={'raw':!![],'where':{'id':_0xf4b93f[_0x6864('0x42')]['id']}},_0x6ab350={};_0x6ab350['model']=_[_0x6864('0x2d')](db['Pause']['rawAttributes']);_0x6ab350[_0x6864('0x30')]=_[_0x6864('0x2d')](_0xf4b93f[_0x6864('0x30')]);_0x6ab350[_0x6864('0x2e')]=_['intersection'](_0x6ab350['model'],_0x6ab350[_0x6864('0x30')]);_0x1ababc[_0x6864('0x31')]=_[_0x6864('0x2f')](_0x6ab350[_0x6864('0x2c')],qs['fields'](_0xf4b93f[_0x6864('0x30')][_0x6864('0x32')]));_0x1ababc[_0x6864('0x31')]=_0x1ababc[_0x6864('0x31')]['length']?_0x1ababc[_0x6864('0x31')]:_0x6ab350[_0x6864('0x2c')];if(_0xf4b93f[_0x6864('0x30')][_0x6864('0x43')]){_0x1ababc[_0x6864('0x3e')]=[{'all':!![]}];}_0x1ababc=_[_0x6864('0x3a')]({},_0x1ababc,_0xf4b93f[_0x6864('0x44')]);return db[_0x6864('0x2a')][_0x6864('0x45')](_0x1ababc)[_0x6864('0x24')](handleEntityNotFound(_0x2a7310,null))[_0x6864('0x24')](respondWithResult(_0x2a7310,null))[_0x6864('0x40')](handleError(_0x2a7310,null));};exports[_0x6864('0x46')]=function(_0x33c6a5,_0x338a3c){return db[_0x6864('0x2a')]['create'](_0x33c6a5[_0x6864('0x47')],{})[_0x6864('0x24')](function(_0x5ca259){var _0x5d7cd8=_0x33c6a5['user']['get']({'plain':!![]});if(!_0x5d7cd8)throw new Error(_0x6864('0x48'));if(_0x5d7cd8[_0x6864('0x49')]===_0x6864('0x4a')){var _0x275afb=_0x5ca259['get']({'plain':!![]});var _0x51cce7=_0x6864('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x51cce7,'userProfileId':_0x5d7cd8[_0x6864('0x4b')]},'raw':!![]})[_0x6864('0x24')](function(_0x2f9386){if(_0x2f9386&&_0x2f9386[_0x6864('0x4c')]===0x0){return db[_0x6864('0x4d')][_0x6864('0x46')]({'name':_0x275afb[_0x6864('0x28')],'resourceId':_0x275afb['id'],'type':_0x2f9386[_0x6864('0x28')],'sectionId':_0x2f9386['id']},{})[_0x6864('0x24')](function(){return _0x5ca259;});}else{return _0x5ca259;}})['catch'](function(_0x2b2fc2){logger[_0x6864('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b2fc2);throw _0x2b2fc2;});}return _0x5ca259;})['then'](respondWithResult(_0x338a3c,0xc9))['catch'](handleError(_0x338a3c,null));};exports[_0x6864('0x23')]=function(_0x593de7,_0x15068e){if(_0x593de7[_0x6864('0x47')]['id']){delete _0x593de7[_0x6864('0x47')]['id'];}return db[_0x6864('0x2a')][_0x6864('0x45')]({'where':{'id':_0x593de7[_0x6864('0x42')]['id']}})[_0x6864('0x24')](handleEntityNotFound(_0x15068e,null))['then'](saveUpdates(_0x593de7[_0x6864('0x47')],null))[_0x6864('0x24')](respondWithResult(_0x15068e,null))[_0x6864('0x40')](handleError(_0x15068e,null));};exports['destroy']=function(_0x442b58,_0x43bb8f){return db[_0x6864('0x2a')]['find']({'where':{'id':_0x442b58[_0x6864('0x42')]['id']}})[_0x6864('0x24')](handleEntityNotFound(_0x43bb8f,null))['then'](removeEntity(_0x43bb8f,null))['catch'](handleError(_0x43bb8f,null));};
\ No newline at end of file
diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js
index 3bae977..596c20c 100644
--- a/server/api/pause/pause.model.js
+++ b/server/api/pause/pause.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc439=['request-promise','rimraf','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x13b641,_0x18b7c7){var _0x1e9b7e=function(_0x505c76){while(--_0x505c76){_0x13b641['push'](_0x13b641['shift']());}};_0x1e9b7e(++_0x18b7c7);}(_0xc439,0x102));var _0x9c43=function(_0x2b4aa5,_0x32a8d4){_0x2b4aa5=_0x2b4aa5-0x0;var _0x5b0ed8=_0xc439[_0x2b4aa5];return _0x5b0ed8;};'use strict';var _=require(_0x9c43('0x0'));var util=require(_0x9c43('0x1'));var logger=require(_0x9c43('0x2'))(_0x9c43('0x3'));var moment=require(_0x9c43('0x4'));var BPromise=require(_0x9c43('0x5'));var rp=require(_0x9c43('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c43('0x7'));var config=require(_0x9c43('0x8'));var attributes=require(_0x9c43('0x9'));module['exports']=function(_0x268ba5,_0xf68949){return _0x268ba5[_0x9c43('0xa')](_0x9c43('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff8a=['define','Pause','lodash','util','request-promise','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xff8a,0x122));var _0xaff8=function(_0x2c4b78,_0x29afd0){_0x2c4b78=_0x2c4b78-0x0;var _0x562371=_0xff8a[_0x2c4b78];return _0x562371;};'use strict';var _=require(_0xaff8('0x0'));var util=require(_0xaff8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaff8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaff8('0x3'));var config=require(_0xaff8('0x4'));var attributes=require(_0xaff8('0x5'));module[_0xaff8('0x6')]=function(_0xbe96df,_0x30f3f0){return _0xbe96df[_0xaff8('0x7')](_0xaff8('0x8'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js
index 567c046..468a152 100644
--- a/server/api/pause/pause.rpc.js
+++ b/server/api/pause/pause.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb81a=['message','result','ShowPause','Pause','options','raw','where','attributes','include','map','model','then','util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','Pause,\x20%s,\x20%s'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0xb81a,0x186));var _0xab81=function(_0x28fce1,_0x787727){_0x28fce1=_0x28fce1-0x0;var _0x171ac3=_0xb81a[_0x28fce1];return _0x171ac3;};'use strict';var _=require('lodash');var util=require(_0xab81('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xab81('0x1'));var fs=require('fs');var Redis=require(_0xab81('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xab81('0x3'))(_0xab81('0x4'));var config=require('../../config/environment');var jayson=require(_0xab81('0x5'));var client=jayson[_0xab81('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x592bad,_0x152175,_0x5f6b1b){return new BPromise(function(_0x173e79,_0xefc9c6){return client[_0xab81('0x7')](_0x592bad,_0x5f6b1b)['then'](function(_0x41d595){logger[_0xab81('0x8')]('Pause,\x20%s,\x20%s',_0x152175,_0xab81('0x9'));logger[_0xab81('0xa')]('Pause,\x20%s,\x20%s,\x20%s',_0x152175,'request\x20sent',JSON[_0xab81('0xb')](_0x41d595));if(_0x41d595[_0xab81('0xc')]){if(_0x41d595[_0xab81('0xc')][_0xab81('0xd')]===0x1f4){logger['error'](_0xab81('0xe'),_0x152175,_0x41d595[_0xab81('0xc')]['message']);return _0xefc9c6(_0x41d595[_0xab81('0xc')][_0xab81('0xf')]);}logger[_0xab81('0xc')]('Pause,\x20%s,\x20%s',_0x152175,_0x41d595[_0xab81('0xc')][_0xab81('0xf')]);return _0x173e79(_0x41d595['error'][_0xab81('0xf')]);}else{logger['info'](_0xab81('0xe'),_0x152175,_0xab81('0x9'));_0x173e79(_0x41d595[_0xab81('0x10')]['message']);}})['catch'](function(_0x2f2dfa){logger[_0xab81('0xc')]('Pause,\x20%s,\x20%s',_0x152175,_0x2f2dfa);_0xefc9c6(_0x2f2dfa);});});}exports[_0xab81('0x11')]=function(_0x424fad){var _0x1a4e53=this;return new Promise(function(_0x34fe11,_0x2226d1){return db[_0xab81('0x12')]['find']({'raw':_0x424fad[_0xab81('0x13')]?_0x424fad[_0xab81('0x13')][_0xab81('0x14')]===undefined?!![]:![]:!![],'where':_0x424fad[_0xab81('0x13')]?_0x424fad[_0xab81('0x13')][_0xab81('0x15')]||null:null,'attributes':_0x424fad[_0xab81('0x13')]?_0x424fad[_0xab81('0x13')][_0xab81('0x16')]||null:null,'include':_0x424fad['options']?_0x424fad[_0xab81('0x13')][_0xab81('0x17')]?_[_0xab81('0x18')](_0x424fad[_0xab81('0x13')]['include'],function(_0x4c1b54){return{'model':db[_0x4c1b54[_0xab81('0x19')]],'as':_0x4c1b54['as'],'attributes':_0x4c1b54[_0xab81('0x16')],'include':_0x4c1b54[_0xab81('0x17')]?_[_0xab81('0x18')](_0x4c1b54['include'],function(_0xf3ce6f){return{'model':db[_0xf3ce6f[_0xab81('0x19')]],'as':_0xf3ce6f['as'],'attributes':_0xf3ce6f[_0xab81('0x16')],'include':_0xf3ce6f[_0xab81('0x17')]?_[_0xab81('0x18')](_0xf3ce6f[_0xab81('0x17')],function(_0x2d3d6c){return{'model':db[_0x2d3d6c[_0xab81('0x19')]],'as':_0x2d3d6c['as'],'attributes':_0x2d3d6c[_0xab81('0x16')]};}):[]};}):[]};}):[]:[]})[_0xab81('0x1a')](function(_0x30af24){logger['info'](_0xab81('0x11'),_0x424fad);logger[_0xab81('0xa')](_0xab81('0x11'),_0x424fad,JSON[_0xab81('0xb')](_0x30af24));_0x34fe11(_0x30af24);})['catch'](function(_0xb7429a){logger['error']('ShowPause',_0xb7429a[_0xab81('0xf')],_0x424fad);_0x2226d1(_0x1a4e53['error'](0x1f4,_0xb7429a[_0xab81('0xf')]));});});};
\ No newline at end of file
+var _0x9fca=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Pause,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowPause','Pause','find','options','raw','attributes','include','map','model','lodash','util'];(function(_0x2b0b9e,_0x1f1fbc){var _0x32eda7=function(_0x54718e){while(--_0x54718e){_0x2b0b9e['push'](_0x2b0b9e['shift']());}};_0x32eda7(++_0x1f1fbc);}(_0x9fca,0x1be));var _0xa9fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9fca[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xa9fc('0x0'));var util=require(_0xa9fc('0x1'));var moment=require(_0xa9fc('0x2'));var BPromise=require(_0xa9fc('0x3'));var rs=require(_0xa9fc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9fc('0x5'))['db'];var utils=require(_0xa9fc('0x6'));var logger=require(_0xa9fc('0x7'))(_0xa9fc('0x8'));var config=require(_0xa9fc('0x9'));var jayson=require(_0xa9fc('0xa'));var client=jayson[_0xa9fc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc656,_0x6f175,_0x1ea0b7){return new BPromise(function(_0x32702a,_0x278dc7){return client[_0xa9fc('0xc')](_0x4dc656,_0x1ea0b7)['then'](function(_0x3a1388){logger[_0xa9fc('0xd')](_0xa9fc('0xe'),_0x6f175,'request\x20sent');logger[_0xa9fc('0xf')]('Pause,\x20%s,\x20%s,\x20%s',_0x6f175,_0xa9fc('0x10'),JSON[_0xa9fc('0x11')](_0x3a1388));if(_0x3a1388[_0xa9fc('0x12')]){if(_0x3a1388[_0xa9fc('0x12')][_0xa9fc('0x13')]===0x1f4){logger[_0xa9fc('0x12')]('Pause,\x20%s,\x20%s',_0x6f175,_0x3a1388[_0xa9fc('0x12')]['message']);return _0x278dc7(_0x3a1388['error'][_0xa9fc('0x14')]);}logger['error'](_0xa9fc('0xe'),_0x6f175,_0x3a1388[_0xa9fc('0x12')][_0xa9fc('0x14')]);return _0x32702a(_0x3a1388[_0xa9fc('0x12')]['message']);}else{logger[_0xa9fc('0xd')](_0xa9fc('0xe'),_0x6f175,'request\x20sent');_0x32702a(_0x3a1388[_0xa9fc('0x15')][_0xa9fc('0x14')]);}})[_0xa9fc('0x16')](function(_0x56d871){logger[_0xa9fc('0x12')](_0xa9fc('0xe'),_0x6f175,_0x56d871);_0x278dc7(_0x56d871);});});}exports[_0xa9fc('0x17')]=function(_0x1c04c3){var _0x45d164=this;return new Promise(function(_0x149852,_0x529b15){return db[_0xa9fc('0x18')][_0xa9fc('0x19')]({'raw':_0x1c04c3[_0xa9fc('0x1a')]?_0x1c04c3[_0xa9fc('0x1a')][_0xa9fc('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c04c3[_0xa9fc('0x1a')]?_0x1c04c3[_0xa9fc('0x1a')]['where']||null:null,'attributes':_0x1c04c3[_0xa9fc('0x1a')]?_0x1c04c3[_0xa9fc('0x1a')][_0xa9fc('0x1c')]||null:null,'include':_0x1c04c3['options']?_0x1c04c3[_0xa9fc('0x1a')][_0xa9fc('0x1d')]?_[_0xa9fc('0x1e')](_0x1c04c3[_0xa9fc('0x1a')]['include'],function(_0x10c57a){return{'model':db[_0x10c57a[_0xa9fc('0x1f')]],'as':_0x10c57a['as'],'attributes':_0x10c57a[_0xa9fc('0x1c')],'include':_0x10c57a[_0xa9fc('0x1d')]?_[_0xa9fc('0x1e')](_0x10c57a['include'],function(_0x51a631){return{'model':db[_0x51a631[_0xa9fc('0x1f')]],'as':_0x51a631['as'],'attributes':_0x51a631[_0xa9fc('0x1c')],'include':_0x51a631['include']?_[_0xa9fc('0x1e')](_0x51a631[_0xa9fc('0x1d')],function(_0x3b1cd9){return{'model':db[_0x3b1cd9['model']],'as':_0x3b1cd9['as'],'attributes':_0x3b1cd9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14dfc5){logger['info'](_0xa9fc('0x17'),_0x1c04c3);logger['debug'](_0xa9fc('0x17'),_0x1c04c3,JSON['stringify'](_0x14dfc5));_0x149852(_0x14dfc5);})[_0xa9fc('0x16')](function(_0x76c65c){logger[_0xa9fc('0x12')](_0xa9fc('0x17'),_0x76c65c[_0xa9fc('0x14')],_0x1c04c3);_0x529b15(_0x45d164['error'](0x1f4,_0x76c65c[_0xa9fc('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js
index 61eb387..1a69122 100644
--- a/server/api/plugin/index.js
+++ b/server/api/plugin/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3945=['../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','isAuthenticated','show','/:id/download','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post','single','upload','webhookPost','put','update','delete','/:id','exports','multer','util','path','express','Router'];(function(_0x81697e,_0x552c16){var _0x1f6e36=function(_0x2a6bbd){while(--_0x2a6bbd){_0x81697e['push'](_0x81697e['shift']());}};_0x1f6e36(++_0x552c16);}(_0x3945,0x1b5));var _0x5394=function(_0x5dbbc5,_0x57a60d){_0x5dbbc5=_0x5dbbc5-0x0;var _0x2f1532=_0x3945[_0x5dbbc5];return _0x2f1532;};'use strict';var multer=require(_0x5394('0x0'));var util=require(_0x5394('0x1'));var path=require(_0x5394('0x2'));var timeout=require('connect-timeout');var express=require(_0x5394('0x3'));var router=express[_0x5394('0x4')]();var auth=require(_0x5394('0x5'));var interaction=require(_0x5394('0x6'));var config=require(_0x5394('0x7'));var controller=require(_0x5394('0x8'));router[_0x5394('0x9')]('/',auth['isAuthenticated'](),controller[_0x5394('0xa')]);router[_0x5394('0x9')](_0x5394('0xb'),controller[_0x5394('0xc')]);router['get']('/:id',auth[_0x5394('0xd')](),controller[_0x5394('0xe')]);router[_0x5394('0x9')](_0x5394('0xf'),auth[_0x5394('0xd')](),controller[_0x5394('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x328796,_0xd1a5bf,_0x2e1634){_0x2e1634(null,path[_0x5394('0x11')](config['root'],_0x5394('0x12')));},'filename':function(_0x4bbaee,_0x5aa828,_0x35b58d){_0x5aa828[_0x5394('0x13')]=_0x5aa828[_0x5394('0x13')][_0x5394('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x35b58d(null,util[_0x5394('0x15')](_0x5394('0x16'),path[_0x5394('0x17')](_0x5aa828['originalname'],path[_0x5394('0x18')](_0x5aa828[_0x5394('0x13')])),Date['now'](),path[_0x5394('0x18')](_0x5aa828[_0x5394('0x13')])));}})});router[_0x5394('0x19')]('/',upload[_0x5394('0x1a')]('file'),controller[_0x5394('0x1b')]);router[_0x5394('0x19')](_0x5394('0xb'),controller[_0x5394('0x1c')]);router[_0x5394('0x1d')]('/:id',auth[_0x5394('0xd')](),controller[_0x5394('0x1e')]);router[_0x5394('0x1f')](_0x5394('0x20'),auth[_0x5394('0xd')](),controller[_0x5394('0x1f')]);module[_0x5394('0x21')]=router;
\ No newline at end of file
+var _0x4a1e=['../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','%s-%s%s','basename','extname','single','file','upload','post','webhookPost','put','update','delete','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x23e674,_0x36c7c8){var _0x5cfcbf=function(_0x57a48e){while(--_0x57a48e){_0x23e674['push'](_0x23e674['shift']());}};_0x5cfcbf(++_0x36c7c8);}(_0x4a1e,0x1cc));var _0xe4a1=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x4a1e[_0x1cbcf1];return _0x3a06f0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe4a1('0x0'));var timeout=require(_0xe4a1('0x1'));var express=require(_0xe4a1('0x2'));var router=express[_0xe4a1('0x3')]();var auth=require(_0xe4a1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe4a1('0x5'));var controller=require('./plugin.controller');router[_0xe4a1('0x6')]('/',auth[_0xe4a1('0x7')](),controller[_0xe4a1('0x8')]);router['get'](_0xe4a1('0x9'),controller[_0xe4a1('0xa')]);router[_0xe4a1('0x6')](_0xe4a1('0xb'),auth[_0xe4a1('0x7')](),controller[_0xe4a1('0xc')]);router['get'](_0xe4a1('0xd'),auth['isAuthenticated'](),controller[_0xe4a1('0xe')]);var upload=multer({'storage':multer[_0xe4a1('0xf')]({'destination':function(_0x20b59d,_0x51591b,_0x546f20){_0x546f20(null,path[_0xe4a1('0x10')](config[_0xe4a1('0x11')],_0xe4a1('0x12')));},'filename':function(_0x141b46,_0x4186f8,_0xb5f83){_0x4186f8[_0xe4a1('0x13')]=_0x4186f8['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb5f83(null,util['format'](_0xe4a1('0x14'),path[_0xe4a1('0x15')](_0x4186f8[_0xe4a1('0x13')],path[_0xe4a1('0x16')](_0x4186f8[_0xe4a1('0x13')])),Date['now'](),path[_0xe4a1('0x16')](_0x4186f8['originalname'])));}})});router['post']('/',upload[_0xe4a1('0x17')](_0xe4a1('0x18')),controller[_0xe4a1('0x19')]);router[_0xe4a1('0x1a')](_0xe4a1('0x9'),controller[_0xe4a1('0x1b')]);router[_0xe4a1('0x1c')]('/:id',auth[_0xe4a1('0x7')](),controller[_0xe4a1('0x1d')]);router['delete'](_0xe4a1('0xb'),auth[_0xe4a1('0x7')](),controller[_0xe4a1('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js
index 4c5a7bc..059535b 100644
--- a/server/api/plugin/plugin.attributes.js
+++ b/server/api/plugin/plugin.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x225d=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','script'];(function(_0x5ba9e4,_0xe149ee){var _0x3764c9=function(_0x3ae0ee){while(--_0x3ae0ee){_0x5ba9e4['push'](_0x5ba9e4['shift']());}};_0x3764c9(++_0xe149ee);}(_0x225d,0x16f));var _0xd225=function(_0x41cfae,_0x1f02ec){_0x41cfae=_0x41cfae-0x0;var _0x5c6f7e=_0x225d[_0x41cfae];return _0x5c6f7e;};'use strict';var Sequelize=require(_0xd225('0x0'));module['exports']={'name':{'type':Sequelize[_0xd225('0x1')]},'type':{'type':Sequelize[_0xd225('0x2')](_0xd225('0x3'),_0xd225('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0xd225('0x5')},'active':{'type':Sequelize[_0xd225('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xd225('0x2')](_0xd225('0x7'),_0xd225('0x8'),_0xd225('0x9'),_0xd225('0xa')),'defaultValue':_0xd225('0x9'),'comment':_0xd225('0xb')},'icon':{'type':Sequelize[_0xd225('0x1')]},'adminUrl':{'type':Sequelize[_0xd225('0x1')]},'agentUrl':{'type':Sequelize[_0xd225('0x1')]},'scriptName':{'type':Sequelize[_0xd225('0x1')]},'scriptPath':{'type':Sequelize[_0xd225('0x1')]}};
\ No newline at end of file
+var _0x847e=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','script','TEXT','STRING'];(function(_0x1b02e9,_0x2d9c10){var _0x2d9269=function(_0x577eee){while(--_0x577eee){_0x1b02e9['push'](_0x1b02e9['shift']());}};_0x2d9269(++_0x2d9c10);}(_0x847e,0x12d));var _0xe847=function(_0x58a12a,_0x49fc50){_0x58a12a=_0x58a12a-0x0;var _0x37f945=_0x847e[_0x58a12a];return _0x37f945;};'use strict';var Sequelize=require(_0xe847('0x0'));module[_0xe847('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe847('0x2')](_0xe847('0x3'),_0xe847('0x4'))},'description':{'type':Sequelize[_0xe847('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xe847('0x6')],'comment':_0xe847('0x7')},'active':{'type':Sequelize[_0xe847('0x8')],'defaultValue':0x0,'comment':_0xe847('0x9')},'sidebar':{'type':Sequelize['ENUM'](_0xe847('0xa'),_0xe847('0xb'),_0xe847('0xc'),'never'),'defaultValue':_0xe847('0xc'),'comment':_0xe847('0xd')},'icon':{'type':Sequelize[_0xe847('0x6')]},'adminUrl':{'type':Sequelize[_0xe847('0x6')]},'agentUrl':{'type':Sequelize[_0xe847('0x6')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js
index e3f4790..6e8b0e8 100644
--- a/server/api/plugin/plugin.controller.js
+++ b/server/api/plugin/plugin.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcba7=['chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','plugins','create','body','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','headers','content-length','content-type','set','endsWith','statusCode','send','webhookPost','http://localhost:','%s%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','Plugins','UserProfileResource','destroy','error','stack','name','index','Plugin','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','download','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','basename','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s'];(function(_0x54b7b5,_0x40a71d){var _0x17beab=function(_0xdd0513){while(--_0xdd0513){_0x54b7b5['push'](_0x54b7b5['shift']());}};_0x17beab(++_0x40a71d);}(_0xcba7,0x199));var _0x7cba=function(_0x51065f,_0xd93aa8){_0x51065f=_0x51065f-0x0;var _0x42bed3=_0xcba7[_0x51065f];return _0x42bed3;};'use strict';var pdf=require(_0x7cba('0x0'));var emlformat=require(_0x7cba('0x1'));var rimraf=require(_0x7cba('0x2'));var zipdir=require(_0x7cba('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7cba('0x4'));var moment=require(_0x7cba('0x5'));var BPromise=require(_0x7cba('0x6'));var Mustache=require('mustache');var util=require(_0x7cba('0x7'));var path=require(_0x7cba('0x8'));var sox=require(_0x7cba('0x9'));var csv=require(_0x7cba('0xa'));var ejs=require(_0x7cba('0xb'));var fs=require('fs');var _=require(_0x7cba('0xc'));var squel=require(_0x7cba('0xd'));var crypto=require(_0x7cba('0xe'));var jsforce=require(_0x7cba('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7cba('0xa'));var querystring=require(_0x7cba('0x10'));var Papa=require(_0x7cba('0x11'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x7cba('0x12'));var Redis=require(_0x7cba('0x13'));var authService=require(_0x7cba('0x14'));var qs=require(_0x7cba('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cba('0x16'))(_0x7cba('0x17'));var utils=require(_0x7cba('0x18'));var config=require(_0x7cba('0x19'));var db=require(_0x7cba('0x1a'))['db'];config[_0x7cba('0x1b')]=_[_0x7cba('0x1c')](config[_0x7cba('0x1b')],{'host':_0x7cba('0x1d'),'port':0x18eb});var socket=require(_0x7cba('0x1e'))(new Redis(config[_0x7cba('0x1b')]));require(_0x7cba('0x1f'))['register'](socket);function respondWithStatusCode(_0x5877da,_0x252005){_0x252005=_0x252005||0xcc;return function(_0xbf5ce8){if(_0xbf5ce8){return _0x5877da[_0x7cba('0x20')](_0x252005);}return _0x5877da[_0x7cba('0x21')](_0x252005)[_0x7cba('0x22')]();};}function respondWithResult(_0x28dfd1,_0x384768){_0x384768=_0x384768||0xc8;return function(_0x40c869){if(_0x40c869){return _0x28dfd1[_0x7cba('0x21')](_0x384768)[_0x7cba('0x23')](_0x40c869);}};}function respondWithFilteredResult(_0x534503,_0x113e6b){return function(_0x587c41){if(_0x587c41){var _0x55ee32=_0x587c41['count'],_0x4503ec=_0x113e6b[_0x7cba('0x24')],_0x18400b=_0x113e6b['offset']+_0x113e6b[_0x7cba('0x25')],_0x13e2f6;if(_0x18400b>=_0x55ee32){_0x18400b=_0x55ee32;_0x13e2f6=0xc8;}else{_0x13e2f6=0xce;}_0x534503['status'](_0x13e2f6);return _0x534503['set'](_0x7cba('0x26'),_0x4503ec+'-'+_0x18400b+'/'+_0x55ee32)[_0x7cba('0x23')](_0x587c41);}return null;};}function patchUpdates(_0x20d6f4){return function(_0x194c46){try{jsonpatch[_0x7cba('0x27')](_0x194c46,_0x20d6f4,!![]);}catch(_0x4bc835){return BPromise[_0x7cba('0x28')](_0x4bc835);}return _0x194c46['save']();};}function saveUpdates(_0xb8ae3d,_0x3b1a8d){return function(_0x1d39c2){if(_0x1d39c2){return _0x1d39c2[_0x7cba('0x29')](_0xb8ae3d)[_0x7cba('0x2a')](function(_0x3cd540){return _0x3cd540;});}return null;};}function removeEntity(_0x3ebe2e,_0x4a6883){return function(_0x24446a){if(_0x24446a){return _0x24446a['destroy']()['then'](function(){var _0x1c9535=_0x24446a['get']({'plain':!![]});var _0x4af3ab=_0x7cba('0x2b');return db[_0x7cba('0x2c')][_0x7cba('0x2d')]({'where':{'type':_0x4af3ab,'resourceId':_0x1c9535['id']}})[_0x7cba('0x2a')](function(){return _0x24446a;});})['then'](function(){_0x3ebe2e[_0x7cba('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d9ce3,_0xd9b2af){return function(_0x1f8065){if(!_0x1f8065){_0x5d9ce3[_0x7cba('0x20')](0x194);}return _0x1f8065;};}function handleError(_0x336dcb,_0x2f4f15){_0x2f4f15=_0x2f4f15||0x1f4;return function(_0x213f3a){logger[_0x7cba('0x2e')](_0x213f3a[_0x7cba('0x2f')]);if(_0x213f3a[_0x7cba('0x30')]){delete _0x213f3a['name'];}_0x336dcb[_0x7cba('0x21')](_0x2f4f15)['send'](_0x213f3a);};}exports[_0x7cba('0x31')]=function(_0x404dec,_0x34b9e6){var _0x16bab3={},_0x42f825={},_0xdcfb3f={'count':0x0,'rows':[]};var _0x442c25=db[_0x7cba('0x32')]['rawAttributes'];_0x42f825[_0x7cba('0x33')]=_['keys'](_0x442c25);_0x42f825[_0x7cba('0x34')]=_[_0x7cba('0x35')](_0x404dec[_0x7cba('0x34')]);_0x42f825[_0x7cba('0x36')]=_[_0x7cba('0x37')](_0x42f825[_0x7cba('0x33')],_0x42f825['query']);_0x16bab3['attributes']=_[_0x7cba('0x37')](_0x42f825[_0x7cba('0x33')],qs[_0x7cba('0x38')](_0x404dec['query']['fields']));_0x16bab3[_0x7cba('0x39')]=_0x16bab3['attributes'][_0x7cba('0x3a')]?_0x16bab3[_0x7cba('0x39')]:_0x42f825[_0x7cba('0x33')];if(!_0x404dec[_0x7cba('0x34')][_0x7cba('0x3b')]('nolimit')){_0x16bab3[_0x7cba('0x25')]=qs[_0x7cba('0x25')](_0x404dec[_0x7cba('0x34')]['limit']);_0x16bab3['offset']=qs[_0x7cba('0x24')](_0x404dec['query'][_0x7cba('0x24')]);}_0x16bab3[_0x7cba('0x3c')]=qs['sort'](_0x404dec[_0x7cba('0x34')][_0x7cba('0x3d')]);_0x16bab3[_0x7cba('0x3e')]=qs[_0x7cba('0x36')](_[_0x7cba('0x3f')](_0x404dec[_0x7cba('0x34')],_0x42f825[_0x7cba('0x36')]));if(_0x404dec[_0x7cba('0x34')]['filter']){_0x16bab3[_0x7cba('0x3e')]=_[_0x7cba('0x40')](_0x16bab3[_0x7cba('0x3e')],{'$or':_[_0x7cba('0x41')](_0x442c25,function(_0x37a22a){if(_0x37a22a[_0x7cba('0x42')][_0x7cba('0x43')]!==_0x7cba('0x44')){var _0x2769f1={};_0x2769f1[_0x37a22a['field']]={'$like':'%'+_0x404dec['query']['filter']+'%'};return _0x2769f1;}})});}_0x16bab3=_['merge']({},_0x16bab3,_0x404dec['options']);var _0x330069={'where':_0x16bab3[_0x7cba('0x3e')]};return db[_0x7cba('0x32')]['count'](_0x330069)['then'](function(_0x3d4612){_0xdcfb3f[_0x7cba('0x45')]=_0x3d4612;if(_0x404dec['query'][_0x7cba('0x46')]){_0x16bab3[_0x7cba('0x47')]=[{'all':!![]}];}return db[_0x7cba('0x32')][_0x7cba('0x48')](_0x16bab3);})[_0x7cba('0x2a')](function(_0x5b5016){_0xdcfb3f[_0x7cba('0x49')]=_0x5b5016;return _0xdcfb3f;})[_0x7cba('0x2a')](respondWithFilteredResult(_0x34b9e6,_0x16bab3))[_0x7cba('0x4a')](handleError(_0x34b9e6,null));};exports[_0x7cba('0x4b')]=function(_0x53e0de,_0x18d59a){var _0x4d5aef={'raw':!![],'where':{'id':_0x53e0de[_0x7cba('0x4c')]['id']}},_0x3c3ffd={};_0x3c3ffd[_0x7cba('0x33')]=_[_0x7cba('0x35')](db[_0x7cba('0x32')][_0x7cba('0x4d')]);_0x3c3ffd[_0x7cba('0x34')]=_['keys'](_0x53e0de['query']);_0x3c3ffd[_0x7cba('0x36')]=_['intersection'](_0x3c3ffd['model'],_0x3c3ffd[_0x7cba('0x34')]);_0x4d5aef[_0x7cba('0x39')]=_[_0x7cba('0x37')](_0x3c3ffd[_0x7cba('0x33')],qs[_0x7cba('0x38')](_0x53e0de[_0x7cba('0x34')][_0x7cba('0x38')]));_0x4d5aef[_0x7cba('0x39')]=_0x4d5aef[_0x7cba('0x39')][_0x7cba('0x3a')]?_0x4d5aef[_0x7cba('0x39')]:_0x3c3ffd['model'];if(_0x53e0de['query']['includeAll']){_0x4d5aef[_0x7cba('0x47')]=[{'all':!![]}];}_0x4d5aef=_['merge']({},_0x4d5aef,_0x53e0de[_0x7cba('0x4e')]);return db[_0x7cba('0x32')][_0x7cba('0x4f')](_0x4d5aef)[_0x7cba('0x2a')](handleEntityNotFound(_0x18d59a,null))[_0x7cba('0x2a')](respondWithResult(_0x18d59a,null))['catch'](handleError(_0x18d59a,null));};exports[_0x7cba('0x50')]=function(_0x3acbf2,_0x5b077f,_0x6e8ab7){return db[_0x7cba('0x32')][_0x7cba('0x4f')]({'where':{'id':_0x3acbf2['params']['id']},'attributes':['name',_0x7cba('0x8')],'raw':!![]})[_0x7cba('0x2a')](handleEntityNotFound(_0x5b077f,null))[_0x7cba('0x2a')](function(_0x1804f5){if(_0x1804f5){var _0x582db0=path[_0x7cba('0x51')](config[_0x7cba('0x52')],_0x7cba('0x53'),util[_0x7cba('0x54')](_0x7cba('0x55'),path['basename'](_0x1804f5[_0x7cba('0x8')])));var _0x5d67e8=fs[_0x7cba('0x56')](_0x582db0);var _0xf0f9da=archiver(_0x7cba('0x57'),{'zlib':{'level':0x9}});_0xf0f9da['on']('warning',function(_0x18a05f){if(_0x18a05f[_0x7cba('0x58')]===_0x7cba('0x59')){logger['error'](_0x18a05f);}else{throw new db[(_0x7cba('0x5a'))][(_0x7cba('0x5b'))](_0x7cba('0x5c'));}});_0xf0f9da['on']('error',function(_0x189fca){throw new db['Sequelize']['Error'](_0x7cba('0x5c'));});_0xf0f9da[_0x7cba('0x5d')](_0x5d67e8);_0xf0f9da[_0x7cba('0x5e')]('**/*',{'cwd':path[_0x7cba('0x51')](config[_0x7cba('0x52')],_0x7cba('0x53'),path['dirname'](_0x1804f5['path'])),'ignore':[path['join'](path[_0x7cba('0x5f')](_0x1804f5[_0x7cba('0x8')]),'node_modules/**/*'),path['join'](path[_0x7cba('0x5f')](_0x1804f5[_0x7cba('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x7cba('0x60')]();_0x5d67e8['on'](_0x7cba('0x61'),function(){if(!fs[_0x7cba('0x62')](_0x582db0)){throw new db[(_0x7cba('0x5a'))][(_0x7cba('0x5b'))](_0x7cba('0x63'));}return _0x5b077f[_0x7cba('0x50')](_0x582db0,util[_0x7cba('0x54')](_0x7cba('0x55'),path[_0x7cba('0x5f')](_0x1804f5[_0x7cba('0x8')])),function(_0x581f8e){if(_0x581f8e){throw new db[(_0x7cba('0x5a'))][(_0x7cba('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x7cba('0x64')](_0x582db0);logger[_0x7cba('0x65')](_0x7cba('0x66'));logger['info'](_0x7cba('0x67'));});});}return null;})['catch'](handleError(_0x5b077f,null));};exports[_0x7cba('0x68')]=function(_0x4c7726,_0x3d21a2,_0x29429b){var _0x3fe6fb=path[_0x7cba('0x5f')](_0x4c7726[_0x7cba('0x69')][_0x7cba('0x6a')],path[_0x7cba('0x6b')](_0x4c7726['file'][_0x7cba('0x6a')]));var _0x4754f1=path[_0x7cba('0x51')](config[_0x7cba('0x52')],_0x7cba('0x53'),_0x4c7726['file']['filename']);var _0x10a90a=path[_0x7cba('0x51')](config[_0x7cba('0x52')],_0x7cba('0x53'),_0x3fe6fb);logger[_0x7cba('0x65')](_0x7cba('0x6c'),_0x4754f1);logger[_0x7cba('0x65')](_0x7cba('0x6d'),_0x10a90a);try{fs[_0x7cba('0x6e')](_0x4754f1,parseInt(_0x7cba('0x6f'),0x8));extract(_0x4754f1,{'dir':_0x10a90a},function(_0x9e5092){if(_0x9e5092){logger[_0x7cba('0x2e')](_0x9e5092);handleError(_0x9e5092,!![]);};var _0x25a03b=fs[_0x7cba('0x70')](_0x10a90a);if(_0x25a03b[_0x7cba('0x3a')]>0x1){removeReferences(_0x4754f1,_0x10a90a);logger[_0x7cba('0x2e')](_0x7cba('0x71'));return _0x29429b(new Error(_0x7cba('0x71')));}var _0x566bb1=fs[_0x7cba('0x72')](path[_0x7cba('0x51')](_0x10a90a,_0x25a03b[0x0]));if(_0x566bb1['isFile']()){removeReferences(_0x4754f1,_0x10a90a);logger[_0x7cba('0x2e')](_0x7cba('0x71'));return _0x29429b(new Error(_0x7cba('0x71')));}if(_0x566bb1[_0x7cba('0x73')]()){var _0x4832de=fs[_0x7cba('0x70')](path[_0x7cba('0x51')](_0x10a90a,_0x25a03b[0x0]));if(_0x4832de[_0x7cba('0x3a')]===0x0){removeReferences(_0x4754f1,_0x10a90a);logger[_0x7cba('0x2e')](_0x7cba('0x71'));return _0x29429b(new Error(_0x7cba('0x71')));}var _0x5e8a7a=_0x4832de[_0x7cba('0x74')](function(_0x21dac5){return _0x21dac5===_0x7cba('0x75');});if(!_0x5e8a7a){return _0x29429b(new Error(_0x7cba('0x76')));}var _0x339146=fs[_0x7cba('0x77')](path[_0x7cba('0x51')](_0x10a90a,_0x25a03b[0x0],_0x7cba('0x75')));var _0x3f2c78=JSON[_0x7cba('0x78')](_0x339146);if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x30')]){return _0x29429b(new Error(_0x7cba('0x7a')));}if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x42')]){return _0x29429b(new Error(_0x7cba('0x7b')));}if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x7c')]){return _0x29429b(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x7d')]){return _0x29429b(new Error(_0x7cba('0x7e')));}if(_0x3f2c78[_0x7cba('0x42')]===_0x7cba('0x7f')){if(_0x7cba('0x79')==typeof _0x3f2c78['parameters'][_0x7cba('0x80')]){return _0x29429b(new Error(_0x7cba('0x81')));}if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x80')][_0x7cba('0x82')]&&'undefined'==typeof _0x3f2c78['parameters'][_0x7cba('0x80')][_0x7cba('0x83')]){return _0x29429b(new Error(_0x7cba('0x84')));}}else if(_0x3f2c78[_0x7cba('0x42')]===_0x7cba('0x85')){if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x86')]){return _0x29429b(new Error(_0x7cba('0x87')));}if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x7d')]['scriptPath']){return _0x29429b(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x29429b(new Error(_0x7cba('0x88')));}var _0x382499=_0x3f2c78[_0x7cba('0x30')];var _0x434ea4=_0x3f2c78[_0x7cba('0x89')];var _0x10017c=_0x3f2c78[_0x7cba('0x42')];var _0x48ee56=_0x3f2c78[_0x7cba('0x8a')]?_0x3f2c78[_0x7cba('0x8a')]:_0x7cba('0x8b');var _0x202115=_0x3f2c78[_0x7cba('0x8c')]?_0x3f2c78[_0x7cba('0x8c')]:_0x7cba('0x8d');var _0xa315df='';var _0x5bf38d='';var _0x9ad875='';var _0xfc8c40='';var _0x838e04=_0x3f2c78[_0x7cba('0x7c')];if(_0x10017c===_0x7cba('0x7f')){if(_0x7cba('0x79')!=typeof _0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x80')][_0x7cba('0x82')]){var _0x140cf7=_0x3f2c78[_0x7cba('0x7d')]['views'][_0x7cba('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x7cba('0x8e')](_0x140cf7)){_0xa315df=path[_0x7cba('0x51')]('plugins',_0x3fe6fb,_0x25a03b[0x0],_0x140cf7);}else{_0xa315df=_0x140cf7;}}else{logger[_0x7cba('0x65')](_0x7cba('0x8f'));}if(_0x7cba('0x79')!=typeof _0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x80')]['agent']){var _0x3e0edf=_0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x80')][_0x7cba('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x7cba('0x8e')](_0x3e0edf)){_0x5bf38d=path[_0x7cba('0x51')]('plugins',_0x3fe6fb,_0x25a03b[0x0],_0x3e0edf);}else{_0x5bf38d=_0x3e0edf;}}else{logger[_0x7cba('0x65')](_0x7cba('0x90'));}}else if(_0x10017c==='script'){_0x9ad875=_0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x86')];_0xfc8c40=_0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x91')];if(_0x7cba('0x79')!=typeof _0x3f2c78[_0x7cba('0x7d')]['views']){if(_0x7cba('0x79')!=typeof _0x3f2c78['parameters']['views'][_0x7cba('0x82')]){var _0x140cf7=_0x3f2c78['parameters'][_0x7cba('0x80')][_0x7cba('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x7cba('0x8e')](_0x140cf7)){_0xa315df=path['join'](_0x7cba('0x92'),_0x3fe6fb,_0x25a03b[0x0],_0x140cf7);}else{_0xa315df=_0x140cf7;}}if(_0x7cba('0x79')!=typeof _0x3f2c78['parameters'][_0x7cba('0x80')]['agent']){var _0x3e0edf=_0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x80')][_0x7cba('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3e0edf)){_0x5bf38d=path[_0x7cba('0x51')](_0x7cba('0x92'),_0x3fe6fb,_0x25a03b[0x0],_0x3e0edf);}else{_0x5bf38d=_0x3e0edf;}}}}var _0x4354d8={'name':_0x382499,'description':_0x434ea4,'path':path[_0x7cba('0x51')](_0x3fe6fb,_0x25a03b[0x0]),'type':_0x10017c,'sidebar':_0x48ee56,'icon':_0x202115,'adminUrl':_0xa315df,'agentUrl':_0x5bf38d,'scriptName':_0x9ad875,'scriptPath':_0xfc8c40,'version':_0x838e04};removeReferences(_0x4754f1,null);return db[_0x7cba('0x32')][_0x7cba('0x93')](_0x4354d8)[_0x7cba('0x2a')](function(_0x10a9ad){var _0x49355f={'role':_0x4c7726[_0x7cba('0x94')]['role'],'userProfileId':_0x4c7726['body']['userProfileId']};if(!_0x49355f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49355f[_0x7cba('0x95')]==='user'){var _0xe7acf9=_0x10a9ad[_0x7cba('0x96')]({'plain':!![]});return db['UserProfileSection'][_0x7cba('0x4f')]({'where':{'name':'Plugins','userProfileId':_0x49355f['userProfileId']},'raw':!![]})[_0x7cba('0x2a')](function(_0x385ee3){if(_0x385ee3&&_0x385ee3['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xe7acf9[_0x7cba('0x30')],'resourceId':_0xe7acf9['id'],'type':_0x385ee3[_0x7cba('0x30')],'sectionId':_0x385ee3['id']},{})[_0x7cba('0x2a')](function(){return _0x10a9ad;});}else{return _0x10a9ad;}})[_0x7cba('0x4a')](function(_0x3fa333){logger[_0x7cba('0x2e')](_0x7cba('0x97'),_0x3fa333);throw _0x3fa333;});}return _0x10a9ad;})[_0x7cba('0x2a')](respondWithResult(_0x3d21a2,null))[_0x7cba('0x4a')](handleError(_0x3d21a2,null));}});}catch(_0x2a3ddb){_0x3d21a2[_0x7cba('0x21')](0x1f4)['send'](_0x2a3ddb);}};function removeReferences(_0x186ae0,_0x4df5db){try{if(_0x186ae0){fs[_0x7cba('0x64')](_0x186ae0);logger[_0x7cba('0x65')](_0x7cba('0x98'));}if(_0x4df5db){rimraf(_0x4df5db,function(){});logger[_0x7cba('0x65')](_0x7cba('0x99'));}}catch(_0x13d16c){logger[_0x7cba('0x2e')](_0x13d16c);}}exports[_0x7cba('0x29')]=function(_0x544d30,_0x3bbea4,_0x49559d){return db[_0x7cba('0x32')][_0x7cba('0x4f')]({'where':{'id':_0x544d30[_0x7cba('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3bbea4,null))[_0x7cba('0x2a')](saveUpdates(_0x544d30[_0x7cba('0x94')],null))[_0x7cba('0x2a')](respondWithResult(_0x3bbea4,null))['catch'](handleError(_0x3bbea4,null));};exports['delete']=function(_0x3e1cdd,_0x198683,_0x4c15ab){return db[_0x7cba('0x32')]['find']({'where':{'id':_0x3e1cdd[_0x7cba('0x4c')]['id']}})['then'](function(_0x15fbbf){if(_0x15fbbf){return _0x15fbbf[_0x7cba('0x2d')]();}})[_0x7cba('0x2a')](function(_0x1a8fdc){rimraf(path['join'](config[_0x7cba('0x52')],_0x7cba('0x53'),path[_0x7cba('0x9a')](_0x1a8fdc['path'])),function(){});return _0x1a8fdc;})['then'](handleEntityNotFound(_0x198683,null))['then'](respondWithStatusCode(_0x198683,null))[_0x7cba('0x4a')](handleError(_0x198683,null));};exports[_0x7cba('0x9b')]=function(_0x36f5d1,_0x412f24,_0x37ab13){return BPromise[_0x7cba('0x9c')]()[_0x7cba('0x2a')](function(){if(!_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x8')]){throw new Error(_0x7cba('0x9d'));}if(!_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x9e')]){throw new Error(_0x7cba('0x9f'));}var _0x34ff3c=_0x36f5d1[_0x7cba('0x34')]['hostname']?_0x36f5d1[_0x7cba('0x34')][_0x7cba('0xa0')]+':'+_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x9e')]:'http://localhost:'+_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x9e')];var _0x5b1402=_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x23')]?_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x23')]:!![];var _0x2a91b5=_0x36f5d1[_0x7cba('0x34')][_0x7cba('0xa1')]?_0x36f5d1[_0x7cba('0x34')]['encoding']:null;var _0x10000c={'method':_0x36f5d1[_0x7cba('0xa2')],'uri':util[_0x7cba('0x54')]('%s%s',_0x34ff3c,_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x8')]),'json':_0x5b1402,'resolveWithFullResponse':!![],'encoding':_0x2a91b5,'qs':_0x36f5d1[_0x7cba('0x34')]};if(_0x36f5d1[_0x7cba('0xa3')]){_0x10000c[_0x7cba('0xa3')]=_0x36f5d1['headers'];if(_0x10000c['headers'][_0x7cba('0xa4')]){delete _0x10000c[_0x7cba('0xa3')]['content-length'];}}if(_0x10000c[_0x7cba('0xa3')]['content-type']){delete _0x10000c[_0x7cba('0xa3')][_0x7cba('0xa5')];}return rp(_0x10000c);})[_0x7cba('0x2a')](function(_0x14046d){if(_0x14046d){_0x412f24[_0x7cba('0xa6')](_0x14046d[_0x7cba('0xa3')]);logger[_0x7cba('0x65')](_0x14046d['body']);if(_[_0x7cba('0xa7')](_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x8')],_0x7cba('0x50'))&&_0x14046d[_0x7cba('0xa8')]==0x1f4){return _0x412f24[_0x7cba('0x20')](_0x14046d[_0x7cba('0xa8')]);}else{return _0x412f24['status'](_0x14046d['statusCode'])[_0x7cba('0xa9')](_0x14046d[_0x7cba('0x94')]);}}else{return _0x412f24[_0x7cba('0x20')](0xc8);}})['catch'](handleError(_0x412f24,null));};exports[_0x7cba('0xaa')]=function(_0x4b4875,_0x5cf3e4,_0x44860b){return BPromise[_0x7cba('0x9c')]()[_0x7cba('0x2a')](function(){if(!_0x4b4875[_0x7cba('0x34')]['path']){throw new Error(_0x7cba('0x9d'));}if(!_0x4b4875['query'][_0x7cba('0x9e')]){throw new Error(_0x7cba('0x9f'));}var _0x2d2445=_0x4b4875[_0x7cba('0x34')]['hostname']?_0x4b4875[_0x7cba('0x34')]['hostname']+':'+_0x4b4875[_0x7cba('0x34')][_0x7cba('0x9e')]:_0x7cba('0xab')+_0x4b4875['query'][_0x7cba('0x9e')];var _0x4fc532=_0x4b4875[_0x7cba('0x34')][_0x7cba('0x23')]?_0x4b4875[_0x7cba('0x34')][_0x7cba('0x23')]:!![];var _0x21ed26=_0x4b4875['query'][_0x7cba('0xa1')]?_0x4b4875['query'][_0x7cba('0xa1')]:null;var _0x46948e={'method':_0x4b4875['method'],'uri':util[_0x7cba('0x54')](_0x7cba('0xac'),_0x2d2445,_0x4b4875[_0x7cba('0x34')][_0x7cba('0x8')]),'json':_0x4fc532,'resolveWithFullResponse':!![],'encoding':_0x21ed26,'body':_0x4b4875[_0x7cba('0x94')]};if(_0x4b4875[_0x7cba('0xa3')]){_0x46948e['headers']=_0x4b4875[_0x7cba('0xa3')];if(_0x46948e['headers']['content-length']){delete _0x46948e[_0x7cba('0xa3')][_0x7cba('0xa4')];}}if(_0x46948e['headers'][_0x7cba('0xa5')]){delete _0x46948e[_0x7cba('0xa3')][_0x7cba('0xa5')];}return rp(_0x46948e);})[_0x7cba('0x2a')](function(_0xdca2c9){if(_0xdca2c9){_0x5cf3e4['set'](_0xdca2c9[_0x7cba('0xa3')]);logger['info'](_0xdca2c9['body']);return _0x5cf3e4[_0x7cba('0x21')](_0xdca2c9[_0x7cba('0xa8')])[_0x7cba('0xa9')](_0xdca2c9[_0x7cba('0x94')]);}else{return _0x5cf3e4['sendStatus'](0xc8);}})[_0x7cba('0x4a')](handleError(_0x5cf3e4,null));};
\ No newline at end of file
+var _0x67f4=['delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','%s%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','archiver','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','count','set','Content-Range','save','destroy','then','get','Plugins','error','stack','send','index','Plugin','keys','query','filters','intersection','model','attributes','nolimit','limit','offset','sort','where','merge','map','type','key','filter','options','includeAll','include','catch','params','fields','length','find','path','join','format','%s.zip','basename','createWriteStream','zip','warning','code','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','server/files/plugins','attachments/**/*','close','Sequelize','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','undefined','name','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update'];(function(_0x330141,_0x1dd290){var _0x1b68a2=function(_0x4e7f3c){while(--_0x4e7f3c){_0x330141['push'](_0x330141['shift']());}};_0x1b68a2(++_0x1dd290);}(_0x67f4,0xb6));var _0x467f=function(_0x501f0f,_0x20e615){_0x501f0f=_0x501f0f-0x0;var _0x420f9e=_0x67f4[_0x501f0f];return _0x420f9e;};'use strict';var pdf=require(_0x467f('0x0'));var emlformat=require(_0x467f('0x1'));var rimraf=require(_0x467f('0x2'));var zipdir=require(_0x467f('0x3'));var jsonpatch=require(_0x467f('0x4'));var rp=require('request-promise');var moment=require(_0x467f('0x5'));var BPromise=require(_0x467f('0x6'));var Mustache=require(_0x467f('0x7'));var util=require(_0x467f('0x8'));var path=require('path');var sox=require(_0x467f('0x9'));var csv=require(_0x467f('0xa'));var ejs=require(_0x467f('0xb'));var fs=require('fs');var _=require(_0x467f('0xc'));var squel=require(_0x467f('0xd'));var crypto=require(_0x467f('0xe'));var jsforce=require(_0x467f('0xf'));var deskjs=require(_0x467f('0x10'));var toCsv=require('to-csv');var querystring=require(_0x467f('0x11'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require(_0x467f('0x2'));var archiver=require(_0x467f('0x12'));var Redis=require(_0x467f('0x13'));var authService=require(_0x467f('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x467f('0x15'));var logger=require(_0x467f('0x16'))(_0x467f('0x17'));var utils=require('../../config/utils');var config=require(_0x467f('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x467f('0x19')](config[_0x467f('0x1a')],{'host':_0x467f('0x1b'),'port':0x18eb});var socket=require(_0x467f('0x1c'))(new Redis(config[_0x467f('0x1a')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x56d4a7,_0x266dad){_0x266dad=_0x266dad||0xcc;return function(_0x3fb1ec){if(_0x3fb1ec){return _0x56d4a7[_0x467f('0x1d')](_0x266dad);}return _0x56d4a7[_0x467f('0x1e')](_0x266dad)[_0x467f('0x1f')]();};}function respondWithResult(_0x4735f0,_0x344725){_0x344725=_0x344725||0xc8;return function(_0x54e4ad){if(_0x54e4ad){return _0x4735f0[_0x467f('0x1e')](_0x344725)[_0x467f('0x20')](_0x54e4ad);}};}function respondWithFilteredResult(_0x18036c,_0xe00c31){return function(_0x36303b){if(_0x36303b){var _0x10912a=_0x36303b[_0x467f('0x21')],_0x5db6ff=_0xe00c31['offset'],_0xfeb0d9=_0xe00c31['offset']+_0xe00c31['limit'],_0xb157bf;if(_0xfeb0d9>=_0x10912a){_0xfeb0d9=_0x10912a;_0xb157bf=0xc8;}else{_0xb157bf=0xce;}_0x18036c['status'](_0xb157bf);return _0x18036c[_0x467f('0x22')](_0x467f('0x23'),_0x5db6ff+'-'+_0xfeb0d9+'/'+_0x10912a)[_0x467f('0x20')](_0x36303b);}return null;};}function patchUpdates(_0x2a705d){return function(_0x252558){try{jsonpatch['apply'](_0x252558,_0x2a705d,!![]);}catch(_0x244cf0){return BPromise['reject'](_0x244cf0);}return _0x252558[_0x467f('0x24')]();};}function saveUpdates(_0x3fc90b,_0x2dd4df){return function(_0x4b78b3){if(_0x4b78b3){return _0x4b78b3['update'](_0x3fc90b)['then'](function(_0x415337){return _0x415337;});}return null;};}function removeEntity(_0x7733d6,_0x18e6b1){return function(_0x1aa591){if(_0x1aa591){return _0x1aa591[_0x467f('0x25')]()[_0x467f('0x26')](function(){var _0xfc9323=_0x1aa591[_0x467f('0x27')]({'plain':!![]});var _0x593f7f=_0x467f('0x28');return db['UserProfileResource'][_0x467f('0x25')]({'where':{'type':_0x593f7f,'resourceId':_0xfc9323['id']}})['then'](function(){return _0x1aa591;});})[_0x467f('0x26')](function(){_0x7733d6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46b47b,_0x2cbbfd){return function(_0x2ee36d){if(!_0x2ee36d){_0x46b47b['sendStatus'](0x194);}return _0x2ee36d;};}function handleError(_0x4e3b4a,_0xf60ce6){_0xf60ce6=_0xf60ce6||0x1f4;return function(_0x455245){logger[_0x467f('0x29')](_0x455245[_0x467f('0x2a')]);if(_0x455245['name']){delete _0x455245['name'];}_0x4e3b4a[_0x467f('0x1e')](_0xf60ce6)[_0x467f('0x2b')](_0x455245);};}exports[_0x467f('0x2c')]=function(_0x2d3c9e,_0x1da2ff){var _0x474800={},_0x33d71f={},_0x35cba1={'count':0x0,'rows':[]};var _0x33aab6=db[_0x467f('0x2d')]['rawAttributes'];_0x33d71f['model']=_[_0x467f('0x2e')](_0x33aab6);_0x33d71f[_0x467f('0x2f')]=_[_0x467f('0x2e')](_0x2d3c9e[_0x467f('0x2f')]);_0x33d71f[_0x467f('0x30')]=_[_0x467f('0x31')](_0x33d71f[_0x467f('0x32')],_0x33d71f[_0x467f('0x2f')]);_0x474800[_0x467f('0x33')]=_[_0x467f('0x31')](_0x33d71f[_0x467f('0x32')],qs['fields'](_0x2d3c9e[_0x467f('0x2f')]['fields']));_0x474800[_0x467f('0x33')]=_0x474800['attributes']['length']?_0x474800[_0x467f('0x33')]:_0x33d71f[_0x467f('0x32')];if(!_0x2d3c9e[_0x467f('0x2f')]['hasOwnProperty'](_0x467f('0x34'))){_0x474800[_0x467f('0x35')]=qs[_0x467f('0x35')](_0x2d3c9e[_0x467f('0x2f')][_0x467f('0x35')]);_0x474800[_0x467f('0x36')]=qs[_0x467f('0x36')](_0x2d3c9e[_0x467f('0x2f')]['offset']);}_0x474800['order']=qs[_0x467f('0x37')](_0x2d3c9e[_0x467f('0x2f')][_0x467f('0x37')]);_0x474800[_0x467f('0x38')]=qs[_0x467f('0x30')](_['pick'](_0x2d3c9e[_0x467f('0x2f')],_0x33d71f[_0x467f('0x30')]));if(_0x2d3c9e[_0x467f('0x2f')]['filter']){_0x474800[_0x467f('0x38')]=_[_0x467f('0x39')](_0x474800[_0x467f('0x38')],{'$or':_[_0x467f('0x3a')](_0x33aab6,function(_0x3579eb){if(_0x3579eb[_0x467f('0x3b')][_0x467f('0x3c')]!=='VIRTUAL'){var _0x298713={};_0x298713[_0x3579eb['field']]={'$like':'%'+_0x2d3c9e['query'][_0x467f('0x3d')]+'%'};return _0x298713;}})});}_0x474800=_['merge']({},_0x474800,_0x2d3c9e[_0x467f('0x3e')]);var _0x3f62ef={'where':_0x474800[_0x467f('0x38')]};return db[_0x467f('0x2d')][_0x467f('0x21')](_0x3f62ef)[_0x467f('0x26')](function(_0xec6d94){_0x35cba1[_0x467f('0x21')]=_0xec6d94;if(_0x2d3c9e['query'][_0x467f('0x3f')]){_0x474800[_0x467f('0x40')]=[{'all':!![]}];}return db[_0x467f('0x2d')]['findAll'](_0x474800);})[_0x467f('0x26')](function(_0x1fa39a){_0x35cba1['rows']=_0x1fa39a;return _0x35cba1;})[_0x467f('0x26')](respondWithFilteredResult(_0x1da2ff,_0x474800))[_0x467f('0x41')](handleError(_0x1da2ff,null));};exports['show']=function(_0xf0508a,_0x59eb4d){var _0x1197c3={'raw':!![],'where':{'id':_0xf0508a[_0x467f('0x42')]['id']}},_0x15b822={};_0x15b822[_0x467f('0x32')]=_['keys'](db[_0x467f('0x2d')]['rawAttributes']);_0x15b822[_0x467f('0x2f')]=_[_0x467f('0x2e')](_0xf0508a['query']);_0x15b822['filters']=_[_0x467f('0x31')](_0x15b822[_0x467f('0x32')],_0x15b822[_0x467f('0x2f')]);_0x1197c3[_0x467f('0x33')]=_[_0x467f('0x31')](_0x15b822[_0x467f('0x32')],qs[_0x467f('0x43')](_0xf0508a[_0x467f('0x2f')]['fields']));_0x1197c3[_0x467f('0x33')]=_0x1197c3['attributes'][_0x467f('0x44')]?_0x1197c3[_0x467f('0x33')]:_0x15b822['model'];if(_0xf0508a[_0x467f('0x2f')][_0x467f('0x3f')]){_0x1197c3['include']=[{'all':!![]}];}_0x1197c3=_[_0x467f('0x39')]({},_0x1197c3,_0xf0508a[_0x467f('0x3e')]);return db[_0x467f('0x2d')][_0x467f('0x45')](_0x1197c3)[_0x467f('0x26')](handleEntityNotFound(_0x59eb4d,null))[_0x467f('0x26')](respondWithResult(_0x59eb4d,null))[_0x467f('0x41')](handleError(_0x59eb4d,null));};exports['download']=function(_0x352d27,_0x4b89ce,_0x4cb6e1){return db['Plugin']['find']({'where':{'id':_0x352d27[_0x467f('0x42')]['id']},'attributes':['name',_0x467f('0x46')],'raw':!![]})[_0x467f('0x26')](handleEntityNotFound(_0x4b89ce,null))[_0x467f('0x26')](function(_0x358aa6){if(_0x358aa6){var _0x35260a=path[_0x467f('0x47')](config['root'],'server/files/plugins',util[_0x467f('0x48')](_0x467f('0x49'),path[_0x467f('0x4a')](_0x358aa6[_0x467f('0x46')])));var _0x2c78a5=fs[_0x467f('0x4b')](_0x35260a);var _0x10ad2a=archiver(_0x467f('0x4c'),{'zlib':{'level':0x9}});_0x10ad2a['on'](_0x467f('0x4d'),function(_0x2b2f9f){if(_0x2b2f9f[_0x467f('0x4e')]==='ENOENT'){logger['error'](_0x2b2f9f);}else{throw new db['Sequelize'][(_0x467f('0x4f'))](_0x467f('0x50'));}});_0x10ad2a['on']('error',function(_0xfbf53b){throw new db['Sequelize'][(_0x467f('0x4f'))](_0x467f('0x50'));});_0x10ad2a[_0x467f('0x51')](_0x2c78a5);_0x10ad2a[_0x467f('0x52')](_0x467f('0x53'),{'cwd':path[_0x467f('0x47')](config[_0x467f('0x54')],_0x467f('0x55'),path['dirname'](_0x358aa6[_0x467f('0x46')])),'ignore':[path[_0x467f('0x47')](path[_0x467f('0x4a')](_0x358aa6[_0x467f('0x46')]),'node_modules/**/*'),path[_0x467f('0x47')](path[_0x467f('0x4a')](_0x358aa6['path']),_0x467f('0x56'))],'nodir':!![]})['finalize']();_0x2c78a5['on'](_0x467f('0x57'),function(){if(!fs['existsSync'](_0x35260a)){throw new db[(_0x467f('0x58'))][(_0x467f('0x4f'))](_0x467f('0x59'));}return _0x4b89ce[_0x467f('0x5a')](_0x35260a,util[_0x467f('0x48')](_0x467f('0x49'),path['basename'](_0x358aa6[_0x467f('0x46')])),function(_0x39b8c0){if(_0x39b8c0){throw new db[(_0x467f('0x58'))][(_0x467f('0x4f'))](_0x467f('0x5b'));}fs[_0x467f('0x5c')](_0x35260a);logger[_0x467f('0x5d')](_0x467f('0x5e'));logger[_0x467f('0x5d')]('Temporary\x20file\x20removed');});});}return null;})[_0x467f('0x41')](handleError(_0x4b89ce,null));};exports[_0x467f('0x5f')]=function(_0x61bd9c,_0x4ba1a3,_0x7e9021){var _0xf46e32=path[_0x467f('0x4a')](_0x61bd9c[_0x467f('0x60')][_0x467f('0x61')],path[_0x467f('0x62')](_0x61bd9c[_0x467f('0x60')][_0x467f('0x61')]));var _0xd9c70d=path[_0x467f('0x47')](config[_0x467f('0x54')],_0x467f('0x55'),_0x61bd9c['file'][_0x467f('0x61')]);var _0x272aa7=path[_0x467f('0x47')](config[_0x467f('0x54')],'server/files/plugins',_0xf46e32);logger[_0x467f('0x5d')](_0x467f('0x63'),_0xd9c70d);logger['info'](_0x467f('0x64'),_0x272aa7);try{fs[_0x467f('0x65')](_0xd9c70d,parseInt(_0x467f('0x66'),0x8));extract(_0xd9c70d,{'dir':_0x272aa7},function(_0x2d5969){if(_0x2d5969){logger[_0x467f('0x29')](_0x2d5969);handleError(_0x2d5969,!![]);};var _0x5056fb=fs[_0x467f('0x67')](_0x272aa7);if(_0x5056fb[_0x467f('0x44')]>0x1){removeReferences(_0xd9c70d,_0x272aa7);logger['error'](_0x467f('0x68'));return _0x7e9021(new Error(_0x467f('0x68')));}var _0x4cb49d=fs[_0x467f('0x69')](path[_0x467f('0x47')](_0x272aa7,_0x5056fb[0x0]));if(_0x4cb49d[_0x467f('0x6a')]()){removeReferences(_0xd9c70d,_0x272aa7);logger[_0x467f('0x29')](_0x467f('0x68'));return _0x7e9021(new Error('Invalid\x20plugin\x20structure'));}if(_0x4cb49d[_0x467f('0x6b')]()){var _0x1b8069=fs[_0x467f('0x67')](path['join'](_0x272aa7,_0x5056fb[0x0]));if(_0x1b8069[_0x467f('0x44')]===0x0){removeReferences(_0xd9c70d,_0x272aa7);logger[_0x467f('0x29')](_0x467f('0x68'));return _0x7e9021(new Error(_0x467f('0x68')));}var _0x596044=_0x1b8069['some'](function(_0x332ae0){return _0x332ae0===_0x467f('0x6c');});if(!_0x596044){return _0x7e9021(new Error(_0x467f('0x6d')));}var _0x5675b0=fs[_0x467f('0x6e')](path[_0x467f('0x47')](_0x272aa7,_0x5056fb[0x0],_0x467f('0x6c')));var _0x3e9e35=JSON['parse'](_0x5675b0);if(_0x467f('0x6f')==typeof _0x3e9e35[_0x467f('0x70')]){return _0x7e9021(new Error(_0x467f('0x71')));}if('undefined'==typeof _0x3e9e35[_0x467f('0x3b')]){return _0x7e9021(new Error(_0x467f('0x72')));}if('undefined'==typeof _0x3e9e35[_0x467f('0x73')]){return _0x7e9021(new Error(_0x467f('0x74')));}if(_0x467f('0x6f')==typeof _0x3e9e35['parameters']){return _0x7e9021(new Error(_0x467f('0x75')));}if(_0x3e9e35[_0x467f('0x3b')]===_0x467f('0x76')){if('undefined'==typeof _0x3e9e35[_0x467f('0x77')][_0x467f('0x78')]){return _0x7e9021(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x3e9e35['parameters'][_0x467f('0x78')][_0x467f('0x79')]&&'undefined'==typeof _0x3e9e35['parameters']['views'][_0x467f('0x7a')]){return _0x7e9021(new Error(_0x467f('0x7b')));}}else if(_0x3e9e35[_0x467f('0x3b')]===_0x467f('0x7c')){if('undefined'==typeof _0x3e9e35[_0x467f('0x77')]['scriptName']){return _0x7e9021(new Error(_0x467f('0x7d')));}if(_0x467f('0x6f')==typeof _0x3e9e35['parameters'][_0x467f('0x7e')]){return _0x7e9021(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x7e9021(new Error(_0x467f('0x7f')));}var _0x240ce4=_0x3e9e35[_0x467f('0x70')];var _0x2702dc=_0x3e9e35[_0x467f('0x80')];var _0x26d0d2=_0x3e9e35[_0x467f('0x3b')];var _0x5731b5=_0x3e9e35['sidebar']?_0x3e9e35[_0x467f('0x81')]:_0x467f('0x82');var _0x2586ff=_0x3e9e35[_0x467f('0x83')]?_0x3e9e35[_0x467f('0x83')]:_0x467f('0x84');var _0x3e8e84='';var _0x47ed7e='';var _0x55ed0b='';var _0x5bc418='';var _0x4dddc3=_0x3e9e35[_0x467f('0x73')];if(_0x26d0d2===_0x467f('0x76')){if(_0x467f('0x6f')!=typeof _0x3e9e35['parameters'][_0x467f('0x78')][_0x467f('0x79')]){var _0x50cc80=_0x3e9e35[_0x467f('0x77')]['views'][_0x467f('0x79')];if(!/^(f|ht)tps?:\/\//i['test'](_0x50cc80)){_0x3e8e84=path[_0x467f('0x47')](_0x467f('0x85'),_0xf46e32,_0x5056fb[0x0],_0x50cc80);}else{_0x3e8e84=_0x50cc80;}}else{logger['info'](_0x467f('0x86'));}if(_0x467f('0x6f')!=typeof _0x3e9e35[_0x467f('0x77')][_0x467f('0x78')][_0x467f('0x7a')]){var _0x2acad8=_0x3e9e35[_0x467f('0x77')][_0x467f('0x78')][_0x467f('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0x467f('0x87')](_0x2acad8)){_0x47ed7e=path[_0x467f('0x47')](_0x467f('0x85'),_0xf46e32,_0x5056fb[0x0],_0x2acad8);}else{_0x47ed7e=_0x2acad8;}}else{logger[_0x467f('0x5d')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x26d0d2==='script'){_0x55ed0b=_0x3e9e35['parameters'][_0x467f('0x88')];_0x5bc418=_0x3e9e35[_0x467f('0x77')][_0x467f('0x7e')];if(_0x467f('0x6f')!=typeof _0x3e9e35[_0x467f('0x77')][_0x467f('0x78')]){if(_0x467f('0x6f')!=typeof _0x3e9e35[_0x467f('0x77')][_0x467f('0x78')][_0x467f('0x79')]){var _0x50cc80=_0x3e9e35[_0x467f('0x77')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x50cc80)){_0x3e8e84=path[_0x467f('0x47')](_0x467f('0x85'),_0xf46e32,_0x5056fb[0x0],_0x50cc80);}else{_0x3e8e84=_0x50cc80;}}if(_0x467f('0x6f')!=typeof _0x3e9e35['parameters']['views'][_0x467f('0x7a')]){var _0x2acad8=_0x3e9e35['parameters'][_0x467f('0x78')][_0x467f('0x7a')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2acad8)){_0x47ed7e=path[_0x467f('0x47')](_0x467f('0x85'),_0xf46e32,_0x5056fb[0x0],_0x2acad8);}else{_0x47ed7e=_0x2acad8;}}}}var _0x10228e={'name':_0x240ce4,'description':_0x2702dc,'path':path[_0x467f('0x47')](_0xf46e32,_0x5056fb[0x0]),'type':_0x26d0d2,'sidebar':_0x5731b5,'icon':_0x2586ff,'adminUrl':_0x3e8e84,'agentUrl':_0x47ed7e,'scriptName':_0x55ed0b,'scriptPath':_0x5bc418,'version':_0x4dddc3};removeReferences(_0xd9c70d,null);return db[_0x467f('0x2d')][_0x467f('0x89')](_0x10228e)['then'](function(_0x21c359){var _0x14bc2b={'role':_0x61bd9c[_0x467f('0x8a')][_0x467f('0x8b')],'userProfileId':_0x61bd9c['body'][_0x467f('0x8c')]};if(!_0x14bc2b)throw new Error(_0x467f('0x8d'));if(_0x14bc2b[_0x467f('0x8b')]===_0x467f('0x8e')){var _0x4bd845=_0x21c359[_0x467f('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Plugins','userProfileId':_0x14bc2b[_0x467f('0x8c')]},'raw':!![]})[_0x467f('0x26')](function(_0x4550df){if(_0x4550df&&_0x4550df[_0x467f('0x8f')]===0x0){return db['UserProfileResource'][_0x467f('0x89')]({'name':_0x4bd845[_0x467f('0x70')],'resourceId':_0x4bd845['id'],'type':_0x4550df[_0x467f('0x70')],'sectionId':_0x4550df['id']},{})[_0x467f('0x26')](function(){return _0x21c359;});}else{return _0x21c359;}})[_0x467f('0x41')](function(_0xf395f9){logger[_0x467f('0x29')](_0x467f('0x90'),_0xf395f9);throw _0xf395f9;});}return _0x21c359;})['then'](respondWithResult(_0x4ba1a3,null))[_0x467f('0x41')](handleError(_0x4ba1a3,null));}});}catch(_0x560cf2){_0x4ba1a3['status'](0x1f4)[_0x467f('0x2b')](_0x560cf2);}};function removeReferences(_0x564511,_0x139db9){try{if(_0x564511){fs['unlinkSync'](_0x564511);logger['info'](_0x467f('0x91'));}if(_0x139db9){rimraf(_0x139db9,function(){});logger[_0x467f('0x5d')](_0x467f('0x92'));}}catch(_0x5ce8a1){logger[_0x467f('0x29')](_0x5ce8a1);}}exports[_0x467f('0x93')]=function(_0x25d1e1,_0x1597c2,_0x18e5b9){return db[_0x467f('0x2d')][_0x467f('0x45')]({'where':{'id':_0x25d1e1['params']['id']}})[_0x467f('0x26')](handleEntityNotFound(_0x1597c2,null))[_0x467f('0x26')](saveUpdates(_0x25d1e1[_0x467f('0x8a')],null))['then'](respondWithResult(_0x1597c2,null))[_0x467f('0x41')](handleError(_0x1597c2,null));};exports[_0x467f('0x94')]=function(_0x1e1877,_0x4916b9,_0x40218c){return db[_0x467f('0x2d')][_0x467f('0x45')]({'where':{'id':_0x1e1877['params']['id']}})[_0x467f('0x26')](function(_0x5c18e8){if(_0x5c18e8){return _0x5c18e8[_0x467f('0x25')]();}})['then'](function(_0x4765c7){rimraf(path[_0x467f('0x47')](config[_0x467f('0x54')],'server/files/plugins',path['dirname'](_0x4765c7[_0x467f('0x46')])),function(){});return _0x4765c7;})['then'](handleEntityNotFound(_0x4916b9,null))[_0x467f('0x26')](respondWithStatusCode(_0x4916b9,null))[_0x467f('0x41')](handleError(_0x4916b9,null));};exports[_0x467f('0x95')]=function(_0x274c70,_0x27c57b,_0x25ce88){return BPromise[_0x467f('0x96')]()[_0x467f('0x26')](function(){if(!_0x274c70['query']['path']){throw new Error(_0x467f('0x97'));}if(!_0x274c70[_0x467f('0x2f')][_0x467f('0x98')]){throw new Error(_0x467f('0x99'));}var _0x1c0d43=_0x274c70[_0x467f('0x2f')][_0x467f('0x9a')]?_0x274c70[_0x467f('0x2f')][_0x467f('0x9a')]+':'+_0x274c70[_0x467f('0x2f')][_0x467f('0x98')]:_0x467f('0x9b')+_0x274c70['query'][_0x467f('0x98')];var _0x18a1b1=_0x274c70['query'][_0x467f('0x20')]?_0x274c70[_0x467f('0x2f')][_0x467f('0x20')]:!![];var _0x28126e=_0x274c70[_0x467f('0x2f')][_0x467f('0x9c')]?_0x274c70[_0x467f('0x2f')][_0x467f('0x9c')]:null;var _0x44c089={'method':_0x274c70[_0x467f('0x9d')],'uri':util[_0x467f('0x48')]('%s%s',_0x1c0d43,_0x274c70[_0x467f('0x2f')]['path']),'json':_0x18a1b1,'resolveWithFullResponse':!![],'encoding':_0x28126e,'qs':_0x274c70['query']};if(_0x274c70[_0x467f('0x9e')]){_0x44c089['headers']=_0x274c70['headers'];if(_0x44c089['headers'][_0x467f('0x9f')]){delete _0x44c089['headers'][_0x467f('0x9f')];}}if(_0x44c089[_0x467f('0x9e')]['content-type']){delete _0x44c089[_0x467f('0x9e')][_0x467f('0xa0')];}return rp(_0x44c089);})[_0x467f('0x26')](function(_0x45115a){if(_0x45115a){_0x27c57b[_0x467f('0x22')](_0x45115a[_0x467f('0x9e')]);logger['info'](_0x45115a[_0x467f('0x8a')]);if(_[_0x467f('0xa1')](_0x274c70[_0x467f('0x2f')]['path'],_0x467f('0x5a'))&&_0x45115a[_0x467f('0xa2')]==0x1f4){return _0x27c57b['sendStatus'](_0x45115a[_0x467f('0xa2')]);}else{return _0x27c57b[_0x467f('0x1e')](_0x45115a['statusCode'])[_0x467f('0x2b')](_0x45115a[_0x467f('0x8a')]);}}else{return _0x27c57b[_0x467f('0x1d')](0xc8);}})[_0x467f('0x41')](handleError(_0x27c57b,null));};exports[_0x467f('0xa3')]=function(_0x5b66b4,_0xc0379b,_0x4921b4){return BPromise[_0x467f('0x96')]()[_0x467f('0x26')](function(){if(!_0x5b66b4['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5b66b4['query']['port']){throw new Error(_0x467f('0x99'));}var _0x15fb7a=_0x5b66b4[_0x467f('0x2f')][_0x467f('0x9a')]?_0x5b66b4[_0x467f('0x2f')][_0x467f('0x9a')]+':'+_0x5b66b4[_0x467f('0x2f')][_0x467f('0x98')]:_0x467f('0x9b')+_0x5b66b4[_0x467f('0x2f')][_0x467f('0x98')];var _0x4ee631=_0x5b66b4[_0x467f('0x2f')][_0x467f('0x20')]?_0x5b66b4['query']['json']:!![];var _0x4695c3=_0x5b66b4[_0x467f('0x2f')]['encoding']?_0x5b66b4[_0x467f('0x2f')]['encoding']:null;var _0x513079={'method':_0x5b66b4[_0x467f('0x9d')],'uri':util['format'](_0x467f('0xa4'),_0x15fb7a,_0x5b66b4[_0x467f('0x2f')][_0x467f('0x46')]),'json':_0x4ee631,'resolveWithFullResponse':!![],'encoding':_0x4695c3,'body':_0x5b66b4[_0x467f('0x8a')]};if(_0x5b66b4[_0x467f('0x9e')]){_0x513079[_0x467f('0x9e')]=_0x5b66b4['headers'];if(_0x513079[_0x467f('0x9e')][_0x467f('0x9f')]){delete _0x513079[_0x467f('0x9e')]['content-length'];}}if(_0x513079[_0x467f('0x9e')]['content-type']){delete _0x513079[_0x467f('0x9e')]['content-type'];}return rp(_0x513079);})[_0x467f('0x26')](function(_0xbe0dc5){if(_0xbe0dc5){_0xc0379b[_0x467f('0x22')](_0xbe0dc5[_0x467f('0x9e')]);logger['info'](_0xbe0dc5[_0x467f('0x8a')]);return _0xc0379b[_0x467f('0x1e')](_0xbe0dc5[_0x467f('0xa2')])['send'](_0xbe0dc5['body']);}else{return _0xc0379b[_0x467f('0x1d')](0xc8);}})[_0x467f('0x41')](handleError(_0xc0379b,null));};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js
index 91503b5..1cb7113 100644
--- a/server/api/plugin/plugin.events.js
+++ b/server/api/plugin/plugin.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x3ab351,_0x5e169a){var _0x4d0a1f=function(_0xa3466c){while(--_0xa3466c){_0x3ab351['push'](_0x3ab351['shift']());}};_0x4d0a1f(++_0x5e169a);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c217f,_0x82a1ae){_0x4c217f=_0x4c217f-0x0;var _0x4033b2=_0xb10b[_0x4c217f];return _0x4033b2;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Plugin=require('../../mysqldb')['db'][_0xbb10('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){PluginEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);PluginEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Plugin[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
+var _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x79d467,_0x6144d8){var _0x43f2a3=function(_0x59d696){while(--_0x59d696){_0x79d467['push'](_0x79d467['shift']());}};_0x43f2a3(++_0x6144d8);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0xb10b[_0x3d4ef1];return _0x409423;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Plugin=require('../../mysqldb')['db'][_0xbb10('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){PluginEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);PluginEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Plugin[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js
index 4a4a1ce..374dc8a 100644
--- a/server/api/plugin/plugin.model.js
+++ b/server/api/plugin/plugin.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6ac3=['lodash','util','api','bluebird','request-promise','../../config/environment','exports','define','Plugin','plugins'];(function(_0x11f313,_0x3c91c8){var _0x5d3a3a=function(_0xb0c9fd){while(--_0xb0c9fd){_0x11f313['push'](_0x11f313['shift']());}};_0x5d3a3a(++_0x3c91c8);}(_0x6ac3,0x14a));var _0x36ac=function(_0x8c6df2,_0x20fea7){_0x8c6df2=_0x8c6df2-0x0;var _0x38a7bf=_0x6ac3[_0x8c6df2];return _0x38a7bf;};'use strict';var _=require(_0x36ac('0x0'));var util=require(_0x36ac('0x1'));var logger=require('../../config/logger')(_0x36ac('0x2'));var moment=require('moment');var BPromise=require(_0x36ac('0x3'));var rp=require(_0x36ac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x36ac('0x5'));var attributes=require('./plugin.attributes');module[_0x36ac('0x6')]=function(_0xf94dce,_0xefd14){return _0xf94dce[_0x36ac('0x7')](_0x36ac('0x8'),attributes,{'tableName':_0x36ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9015=['Plugin','plugins','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','exports'];(function(_0x4792e0,_0x3c1bc0){var _0xfa5a37=function(_0x4d92bb){while(--_0x4d92bb){_0x4792e0['push'](_0x4792e0['shift']());}};_0xfa5a37(++_0x3c1bc0);}(_0x9015,0x1d6));var _0x5901=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x9015[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x5901('0x0'));var util=require(_0x5901('0x1'));var logger=require(_0x5901('0x2'))('api');var moment=require(_0x5901('0x3'));var BPromise=require(_0x5901('0x4'));var rp=require(_0x5901('0x5'));var fs=require('fs');var path=require(_0x5901('0x6'));var rimraf=require('rimraf');var config=require(_0x5901('0x7'));var attributes=require(_0x5901('0x8'));module[_0x5901('0x9')]=function(_0x40ef1f,_0x19254d){return _0x40ef1f['define'](_0x5901('0xa'),attributes,{'tableName':_0x5901('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js
index 7d79dbd..3edd5ce 100644
--- a/server/api/plugin/plugin.rpc.js
+++ b/server/api/plugin/plugin.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x914b=['./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreatePlugin','Plugin','create','options','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x50a064,_0x1dc725){var _0xd8d4d3=function(_0x359670){while(--_0x359670){_0x50a064['push'](_0x50a064['shift']());}};_0xd8d4d3(++_0x1dc725);}(_0x914b,0x15b));var _0xb914=function(_0x424329,_0x1a3e61){_0x424329=_0x424329-0x0;var _0x324625=_0x914b[_0x424329];return _0x324625;};'use strict';var _=require('lodash');var util=require(_0xb914('0x0'));var moment=require('moment');var BPromise=require(_0xb914('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb914('0x2'))['db'];var utils=require(_0xb914('0x3'));var logger=require(_0xb914('0x4'))(_0xb914('0x5'));var config=require('../../config/environment');var jayson=require(_0xb914('0x6'));var client=jayson[_0xb914('0x7')][_0xb914('0x8')]({'port':0x232a});config[_0xb914('0x9')]=_[_0xb914('0xa')](config[_0xb914('0x9')],{'host':_0xb914('0xb'),'port':0x18eb});var socket=require(_0xb914('0xc'))(new Redis(config[_0xb914('0x9')]));require(_0xb914('0xd'))[_0xb914('0xe')](socket);function respondWithRpcPromise(_0x28b482,_0x1caa18,_0x153b99){return new BPromise(function(_0x5a73ec,_0x49ff3d){return client['request'](_0x28b482,_0x153b99)[_0xb914('0xf')](function(_0xacc33d){logger[_0xb914('0x10')](_0xb914('0x11'),_0x1caa18,'request\x20sent');logger[_0xb914('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x1caa18,_0xb914('0x13'),JSON[_0xb914('0x14')](_0xacc33d));if(_0xacc33d[_0xb914('0x15')]){if(_0xacc33d['error'][_0xb914('0x16')]===0x1f4){logger[_0xb914('0x15')](_0xb914('0x11'),_0x1caa18,_0xacc33d[_0xb914('0x15')]['message']);return _0x49ff3d(_0xacc33d[_0xb914('0x15')][_0xb914('0x17')]);}logger[_0xb914('0x15')](_0xb914('0x11'),_0x1caa18,_0xacc33d[_0xb914('0x15')][_0xb914('0x17')]);return _0x5a73ec(_0xacc33d[_0xb914('0x15')][_0xb914('0x17')]);}else{logger[_0xb914('0x10')](_0xb914('0x11'),_0x1caa18,_0xb914('0x13'));_0x5a73ec(_0xacc33d[_0xb914('0x18')]['message']);}})['catch'](function(_0x17f326){logger[_0xb914('0x15')](_0xb914('0x11'),_0x1caa18,_0x17f326);_0x49ff3d(_0x17f326);});});}exports[_0xb914('0x19')]=function(_0x4a3c65){var _0x5a92fe=this;return new Promise(function(_0xb5929c,_0x1ee98d){return db[_0xb914('0x1a')][_0xb914('0x1b')](_0x4a3c65['body'],{'raw':_0x4a3c65['options']?_0x4a3c65[_0xb914('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xb914('0xf')](function(_0x4f6b78){logger['info'](_0xb914('0x19'),_0x4a3c65);logger[_0xb914('0x12')](_0xb914('0x19'),_0x4a3c65,JSON[_0xb914('0x14')](_0x4f6b78));_0xb5929c(_0x4f6b78);})[_0xb914('0x1d')](function(_0x5ac0b1){logger[_0xb914('0x15')]('CreatePlugin',_0x5ac0b1['message'],_0x4a3c65);_0x1ee98d(_0x5a92fe['error'](0x1f4,_0x5ac0b1[_0xb914('0x17')]));});});};
\ No newline at end of file
+var _0x47d1=['./plugin.socket','register','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreatePlugin','create','raw','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x1043ae,_0xab727b){var _0x38a1d7=function(_0x13b1d7){while(--_0x13b1d7){_0x1043ae['push'](_0x1043ae['shift']());}};_0x38a1d7(++_0xab727b);}(_0x47d1,0x132));var _0x147d=function(_0x184165,_0x4f9203){_0x184165=_0x184165-0x0;var _0x26eaa7=_0x47d1[_0x184165];return _0x26eaa7;};'use strict';var _=require(_0x147d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x147d('0x1'));var fs=require('fs');var Redis=require(_0x147d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x147d('0x3'));var logger=require(_0x147d('0x4'))(_0x147d('0x5'));var config=require(_0x147d('0x6'));var jayson=require(_0x147d('0x7'));var client=jayson[_0x147d('0x8')]['http']({'port':0x232a});config[_0x147d('0x9')]=_[_0x147d('0xa')](config['redis'],{'host':_0x147d('0xb'),'port':0x18eb});var socket=require(_0x147d('0xc'))(new Redis(config[_0x147d('0x9')]));require(_0x147d('0xd'))[_0x147d('0xe')](socket);function respondWithRpcPromise(_0x3d93bd,_0x2a9a61,_0x44d786){return new BPromise(function(_0x3689bb,_0x76742a){return client['request'](_0x3d93bd,_0x44d786)[_0x147d('0xf')](function(_0x5439a2){logger['info'](_0x147d('0x10'),_0x2a9a61,_0x147d('0x11'));logger[_0x147d('0x12')](_0x147d('0x13'),_0x2a9a61,'request\x20sent',JSON[_0x147d('0x14')](_0x5439a2));if(_0x5439a2[_0x147d('0x15')]){if(_0x5439a2[_0x147d('0x15')][_0x147d('0x16')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x2a9a61,_0x5439a2['error'][_0x147d('0x17')]);return _0x76742a(_0x5439a2[_0x147d('0x15')][_0x147d('0x17')]);}logger[_0x147d('0x15')](_0x147d('0x10'),_0x2a9a61,_0x5439a2[_0x147d('0x15')][_0x147d('0x17')]);return _0x3689bb(_0x5439a2[_0x147d('0x15')]['message']);}else{logger[_0x147d('0x18')](_0x147d('0x10'),_0x2a9a61,'request\x20sent');_0x3689bb(_0x5439a2['result'][_0x147d('0x17')]);}})[_0x147d('0x19')](function(_0x2d2b70){logger[_0x147d('0x15')](_0x147d('0x10'),_0x2a9a61,_0x2d2b70);_0x76742a(_0x2d2b70);});});}exports[_0x147d('0x1a')]=function(_0x2255d5){var _0x11eafa=this;return new Promise(function(_0x131d21,_0x2c6158){return db['Plugin'][_0x147d('0x1b')](_0x2255d5['body'],{'raw':_0x2255d5['options']?_0x2255d5['options'][_0x147d('0x1c')]===undefined?!![]:![]:!![]})[_0x147d('0xf')](function(_0x40347b){logger[_0x147d('0x18')](_0x147d('0x1a'),_0x2255d5);logger[_0x147d('0x12')](_0x147d('0x1a'),_0x2255d5,JSON[_0x147d('0x14')](_0x40347b));_0x131d21(_0x40347b);})['catch'](function(_0x8935c5){logger['error']('CreatePlugin',_0x8935c5['message'],_0x2255d5);_0x2c6158(_0x11eafa['error'](0x1f4,_0x8935c5[_0x147d('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js
index 8ae777d..c001ec7 100644
--- a/server/api/plugin/plugin.socket.js
+++ b/server/api/plugin/plugin.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x140a=['plugin:','./plugin.events','save','remove','emit','removeListener','register','length'];(function(_0x59b4c3,_0x3bcd23){var _0x1d18d4=function(_0x48b68e){while(--_0x48b68e){_0x59b4c3['push'](_0x59b4c3['shift']());}};_0x1d18d4(++_0x3bcd23);}(_0x140a,0x1a9));var _0xa140=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x140a[_0x397e5f];return _0x5302b8;};'use strict';var PluginEvents=require(_0xa140('0x0'));var events=[_0xa140('0x1'),_0xa140('0x2'),'update'];function createListener(_0x407332,_0x45b2fa){return function(_0x4362a2){_0x45b2fa[_0xa140('0x3')](_0x407332,_0x4362a2);};}function removeListener(_0xc5f3f1,_0xc9cccf){return function(){PluginEvents[_0xa140('0x4')](_0xc5f3f1,_0xc9cccf);};}exports[_0xa140('0x5')]=function(_0x5b4908){for(var _0xf3ac64=0x0,_0x2a922c=events[_0xa140('0x6')];_0xf3ac64<_0x2a922c;_0xf3ac64++){var _0x4783a4=events[_0xf3ac64];var _0x53d065=createListener(_0xa140('0x7')+_0x4783a4,_0x5b4908);PluginEvents['on'](_0x4783a4,_0x53d065);}};
\ No newline at end of file
+var _0xc485=['length','plugin:','./plugin.events','save','remove','emit','register'];(function(_0x277142,_0x27a6f4){var _0x522050=function(_0x235f5e){while(--_0x235f5e){_0x277142['push'](_0x277142['shift']());}};_0x522050(++_0x27a6f4);}(_0xc485,0x152));var _0x5c48=function(_0x20952d,_0x4eddd5){_0x20952d=_0x20952d-0x0;var _0x3b24d5=_0xc485[_0x20952d];return _0x3b24d5;};'use strict';var PluginEvents=require(_0x5c48('0x0'));var events=[_0x5c48('0x1'),_0x5c48('0x2'),'update'];function createListener(_0x4e850f,_0x10efee){return function(_0xe165f3){_0x10efee[_0x5c48('0x3')](_0x4e850f,_0xe165f3);};}function removeListener(_0x18e3e4,_0x68ca0f){return function(){PluginEvents['removeListener'](_0x18e3e4,_0x68ca0f);};}exports[_0x5c48('0x4')]=function(_0xf0dcd7){for(var _0x2edb18=0x0,_0x417d50=events[_0x5c48('0x5')];_0x2edb18<_0x417d50;_0x2edb18++){var _0x223eea=events[_0x2edb18];var _0x11289c=createListener(_0x5c48('0x6')+_0x223eea,_0xf0dcd7);PluginEvents['on'](_0x223eea,_0x11289c);}};
\ No newline at end of file
diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js
index 1d63171..2f6f7db 100644
--- a/server/api/pm2/index.js
+++ b/server/api/pm2/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x56bd70,_0x4f8b02){var _0x56486e=function(_0x2482a7){while(--_0x2482a7){_0x56bd70['push'](_0x56bd70['shift']());}};_0x56486e(++_0x4f8b02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
+var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x591a2a,_0x4db47b){var _0x360c09=function(_0x3d8d29){while(--_0x3d8d29){_0x591a2a['push'](_0x591a2a['shift']());}};_0x360c09(++_0x4db47b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js
index ff9e520..362b9ee 100644
--- a/server/api/pm2/pm2.controller.js
+++ b/server/api/pm2/pm2.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1e82=['length','then','catch','show','params','create','body','script','join','../../files/plugins','cwd','chdir','start','send','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','bluebird','status','stack','name','info','error','index','list','reject','express','motion2'];(function(_0x255c8f,_0x55c6b8){var _0x3fad91=function(_0x463d1c){while(--_0x463d1c){_0x255c8f['push'](_0x255c8f['shift']());}};_0x3fad91(++_0x55c6b8);}(_0x1e82,0x8b));var _0x21e8=function(_0x1d991b,_0x364ad6){_0x1d991b=_0x1d991b-0x0;var _0x28a722=_0x1e82[_0x1d991b];return _0x28a722;};'use strict';var _=require(_0x21e8('0x0'));var pm2=require(_0x21e8('0x1'));var logger=require(_0x21e8('0x2'))(_0x21e8('0x3'));var path=require(_0x21e8('0x4'));var exec=require(_0x21e8('0x5'))['exec'];var BPromise=require(_0x21e8('0x6'));function handleEntityNotFound(_0x436415,_0x59fa8f){return function(_0x468459){if(!_0x468459){_0x436415['sendStatus'](0x194);;}return _0x468459;};}function respondWithResult(_0x35a33a,_0x11e388){_0x11e388=_0x11e388||0xc8;return function(_0x38c3d0){if(_0x38c3d0){return _0x35a33a[_0x21e8('0x7')](_0x11e388)['json'](_0x38c3d0);}return null;};}function handleError(_0x45e5c1,_0x3754c9){_0x3754c9=_0x3754c9||0x1f4;return function(_0x43a873){logger['error'](_0x43a873[_0x21e8('0x8')]);if(_0x43a873[_0x21e8('0x9')]){delete _0x43a873[_0x21e8('0x9')];}_0x45e5c1[_0x21e8('0x7')](_0x3754c9)['send'](_0x43a873);};}function execChildProcess(){return new BPromise(function(_0x4d561a,_0x265ea1){exec('npm\x20install',function(_0x131349,_0xc55924,_0x5eb5b7){logger[_0x21e8('0xa')](_0xc55924);logger['info'](_0x5eb5b7);if(_0x131349){logger[_0x21e8('0xb')](_0x131349);return _0x265ea1(_0x131349);}return _0x4d561a(_0xc55924);});});}exports[_0x21e8('0xc')]=function(_0x16a877,_0x4eb523){return pm2[_0x21e8('0xd')]()['then'](function(_0x271ee6){if(_0x271ee6){var _0x3c6bf2=_[_0x21e8('0xe')](_0x271ee6,function(_0x4e3e29){return _0x4e3e29['name']===_0x21e8('0xf')||_0x4e3e29[_0x21e8('0x9')]===_0x21e8('0x10');});return{'rows':_0x3c6bf2,'count':_0x3c6bf2[_0x21e8('0x11')]};}return null;})[_0x21e8('0x12')](respondWithResult(_0x4eb523,null))[_0x21e8('0x13')](handleError(_0x4eb523,null));};exports[_0x21e8('0x14')]=function(_0x2f66f1,_0x1a8a5a){return pm2['describe'](_0x2f66f1[_0x21e8('0x15')]['id'])['then'](respondWithResult(_0x1a8a5a,null))['then'](handleEntityNotFound(_0x1a8a5a,null))[_0x21e8('0x13')](handleError(_0x1a8a5a,null));};exports[_0x21e8('0x16')]=function(_0x227925,_0x2030bb){if(_0x227925['body'][_0x21e8('0x9')]&&_0x227925[_0x21e8('0x17')][_0x21e8('0x18')]){var _0x2e5d89=path[_0x21e8('0x19')](__dirname,_0x21e8('0x1a'),_0x227925[_0x21e8('0x17')][_0x21e8('0x18')]);var _0x4bcb4c=process[_0x21e8('0x1b')]();process[_0x21e8('0x1c')](path['dirname'](_0x2e5d89));return execChildProcess()[_0x21e8('0x12')](function(_0x402f0f){process[_0x21e8('0x1c')](_0x4bcb4c);return pm2[_0x21e8('0x1d')]({'name':_0x227925[_0x21e8('0x17')][_0x21e8('0x9')],'script':_0x2e5d89});})[_0x21e8('0x12')](function(_0x3ed4c3){pm2['dump']();return _0x3ed4c3[0x0];})[_0x21e8('0x12')](respondWithResult(_0x2030bb,0xc9))['catch'](handleError(_0x2030bb,null));}else{return _0x2030bb[_0x21e8('0x7')](0x1f4)[_0x21e8('0x1e')]({'message':_0x21e8('0x1f')});}};exports['update']=function(_0x1bdd15,_0x526e32){if(_0x1bdd15[_0x21e8('0x17')]['id']){delete _0x1bdd15[_0x21e8('0x17')]['id'];}var _0x6de0b2={'online':'restart','stopped':_0x21e8('0x20')};if(_0x6de0b2[_0x21e8('0x21')](_0x1bdd15[_0x21e8('0x17')]['status'])){return pm2[_0x6de0b2[_0x1bdd15[_0x21e8('0x17')][_0x21e8('0x7')]]](_0x1bdd15[_0x21e8('0x15')]['id'])[_0x21e8('0x12')](respondWithResult(_0x526e32,0xc8))[_0x21e8('0x13')](handleError(_0x526e32,null));}else{return _0x526e32[_0x21e8('0x7')](0x1f4)[_0x21e8('0x1e')]({'message':_0x21e8('0x22')});}};exports[_0x21e8('0x23')]=function(_0xd4f119,_0x4711a4){if(_0xd4f119[_0x21e8('0x17')]['id']){delete _0xd4f119['body']['id'];}if(_0xd4f119[_0x21e8('0x15')]['id']){return pm2[_0x21e8('0x24')](_0xd4f119['params']['id'])['then'](function(_0x51e253){pm2[_0x21e8('0x25')]();return _0x51e253[0x0];})['then'](respondWithResult(_0x4711a4,null))[_0x21e8('0x13')](handleError(_0x4711a4,null));}else{return _0x4711a4[_0x21e8('0x7')](0x1f4)[_0x21e8('0x1e')]({'message':_0x21e8('0x26')});}};
\ No newline at end of file
+var _0xcdd3=['stop','hasOwnProperty','destroy','delete','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','sendStatus','status','stack','name','send','info','error','index','then','length','catch','show','params','create','body','script','join','../../files/plugins','cwd','chdir','dump','Missing\x20name\x20and/or\x20path','restart'];(function(_0x17f84d,_0x52cc85){var _0x19cb05=function(_0x120ba8){while(--_0x120ba8){_0x17f84d['push'](_0x17f84d['shift']());}};_0x19cb05(++_0x52cc85);}(_0xcdd3,0x115));var _0x3cdd=function(_0x263434,_0x5ad702){_0x263434=_0x263434-0x0;var _0x414bfe=_0xcdd3[_0x263434];return _0x414bfe;};'use strict';var _=require(_0x3cdd('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x3cdd('0x1'))(_0x3cdd('0x2'));var path=require(_0x3cdd('0x3'));var exec=require(_0x3cdd('0x4'))[_0x3cdd('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x5162c5,_0x3a9bde){return function(_0x4143f3){if(!_0x4143f3){_0x5162c5[_0x3cdd('0x6')](0x194);;}return _0x4143f3;};}function respondWithResult(_0x5e2c71,_0x387da3){_0x387da3=_0x387da3||0xc8;return function(_0x2cc415){if(_0x2cc415){return _0x5e2c71[_0x3cdd('0x7')](_0x387da3)['json'](_0x2cc415);}return null;};}function handleError(_0x5c2d73,_0x4326f2){_0x4326f2=_0x4326f2||0x1f4;return function(_0x59fa3c){logger['error'](_0x59fa3c[_0x3cdd('0x8')]);if(_0x59fa3c[_0x3cdd('0x9')]){delete _0x59fa3c[_0x3cdd('0x9')];}_0x5c2d73[_0x3cdd('0x7')](_0x4326f2)[_0x3cdd('0xa')](_0x59fa3c);};}function execChildProcess(){return new BPromise(function(_0x4d968c,_0x1342fb){exec('npm\x20install',function(_0x3a8578,_0x14b8bd,_0x570e36){logger[_0x3cdd('0xb')](_0x14b8bd);logger[_0x3cdd('0xb')](_0x570e36);if(_0x3a8578){logger[_0x3cdd('0xc')](_0x3a8578);return _0x1342fb(_0x3a8578);}return _0x4d968c(_0x14b8bd);});});}exports[_0x3cdd('0xd')]=function(_0x18c555,_0x6109d8){return pm2['list']()[_0x3cdd('0xe')](function(_0x57c1b9){if(_0x57c1b9){var _0x18f320=_['reject'](_0x57c1b9,function(_0x2cbf64){return _0x2cbf64[_0x3cdd('0x9')]==='express'||_0x2cbf64[_0x3cdd('0x9')]==='motion2';});return{'rows':_0x18f320,'count':_0x18f320[_0x3cdd('0xf')]};}return null;})['then'](respondWithResult(_0x6109d8,null))[_0x3cdd('0x10')](handleError(_0x6109d8,null));};exports[_0x3cdd('0x11')]=function(_0x2d2976,_0x14a5de){return pm2['describe'](_0x2d2976[_0x3cdd('0x12')]['id'])[_0x3cdd('0xe')](respondWithResult(_0x14a5de,null))[_0x3cdd('0xe')](handleEntityNotFound(_0x14a5de,null))[_0x3cdd('0x10')](handleError(_0x14a5de,null));};exports[_0x3cdd('0x13')]=function(_0x2f6d1f,_0x41f706){if(_0x2f6d1f[_0x3cdd('0x14')][_0x3cdd('0x9')]&&_0x2f6d1f['body'][_0x3cdd('0x15')]){var _0x44905e=path[_0x3cdd('0x16')](__dirname,_0x3cdd('0x17'),_0x2f6d1f[_0x3cdd('0x14')]['script']);var _0x367579=process[_0x3cdd('0x18')]();process[_0x3cdd('0x19')](path['dirname'](_0x44905e));return execChildProcess()[_0x3cdd('0xe')](function(_0xbbf73e){process[_0x3cdd('0x19')](_0x367579);return pm2['start']({'name':_0x2f6d1f[_0x3cdd('0x14')]['name'],'script':_0x44905e});})[_0x3cdd('0xe')](function(_0x254a3b){pm2[_0x3cdd('0x1a')]();return _0x254a3b[0x0];})[_0x3cdd('0xe')](respondWithResult(_0x41f706,0xc9))[_0x3cdd('0x10')](handleError(_0x41f706,null));}else{return _0x41f706[_0x3cdd('0x7')](0x1f4)[_0x3cdd('0xa')]({'message':_0x3cdd('0x1b')});}};exports['update']=function(_0x4b839d,_0x5411fa){if(_0x4b839d[_0x3cdd('0x14')]['id']){delete _0x4b839d[_0x3cdd('0x14')]['id'];}var _0x38fe2d={'online':_0x3cdd('0x1c'),'stopped':_0x3cdd('0x1d')};if(_0x38fe2d[_0x3cdd('0x1e')](_0x4b839d[_0x3cdd('0x14')][_0x3cdd('0x7')])){return pm2[_0x38fe2d[_0x4b839d[_0x3cdd('0x14')][_0x3cdd('0x7')]]](_0x4b839d[_0x3cdd('0x12')]['id'])[_0x3cdd('0xe')](respondWithResult(_0x5411fa,0xc8))['catch'](handleError(_0x5411fa,null));}else{return _0x5411fa[_0x3cdd('0x7')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0x3cdd('0x1f')]=function(_0x3c012a,_0x279b01){if(_0x3c012a[_0x3cdd('0x14')]['id']){delete _0x3c012a[_0x3cdd('0x14')]['id'];}if(_0x3c012a[_0x3cdd('0x12')]['id']){return pm2[_0x3cdd('0x20')](_0x3c012a[_0x3cdd('0x12')]['id'])['then'](function(_0x4894ac){pm2[_0x3cdd('0x1a')]();return _0x4894ac[0x0];})[_0x3cdd('0xe')](respondWithResult(_0x279b01,null))[_0x3cdd('0x10')](handleError(_0x279b01,null));}else{return _0x279b01[_0x3cdd('0x7')](0x1f4)['send']({'message':_0x3cdd('0x21')});}};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js
index 704274c..4df601e 100644
--- a/server/api/reportAgentPreview/index.js
+++ b/server/api/reportAgentPreview/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe08b=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path'];(function(_0x4c95cb,_0x1997fd){var _0x1aa0dc=function(_0x2b4961){while(--_0x2b4961){_0x4c95cb['push'](_0x4c95cb['shift']());}};_0x1aa0dc(++_0x1997fd);}(_0xe08b,0x10e));var _0xbe08=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0xe08b[_0x4c06a3];return _0x7ff53c;};'use strict';var multer=require(_0xbe08('0x0'));var util=require('util');var path=require(_0xbe08('0x1'));var timeout=require(_0xbe08('0x2'));var express=require('express');var router=express[_0xbe08('0x3')]();var auth=require(_0xbe08('0x4'));var interaction=require(_0xbe08('0x5'));var config=require(_0xbe08('0x6'));module[_0xbe08('0x7')]=router;
\ No newline at end of file
+var _0x292c=['express','Router','../../components/auth/service','../../config/environment','multer','path','connect-timeout'];(function(_0x593ae5,_0x52b82a){var _0x34d549=function(_0x2e0391){while(--_0x2e0391){_0x593ae5['push'](_0x593ae5['shift']());}};_0x34d549(++_0x52b82a);}(_0x292c,0x66));var _0xc292=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x292c[_0x236d24];return _0x1574cf;};'use strict';var multer=require(_0xc292('0x0'));var util=require('util');var path=require(_0xc292('0x1'));var timeout=require(_0xc292('0x2'));var express=require(_0xc292('0x3'));var router=express[_0xc292('0x4')]();var auth=require(_0xc292('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc292('0x6'));module['exports']=router;
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js
index 21c0b7f..ae35914 100644
--- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js
+++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9cbf=['STRING','DATE','INTEGER','sequelize','exports'];(function(_0xe932aa,_0x128838){var _0x4b9acf=function(_0x5676c){while(--_0x5676c){_0xe932aa['push'](_0xe932aa['shift']());}};_0x4b9acf(++_0x128838);}(_0x9cbf,0xfd));var _0xf9cb=function(_0x1bb42c,_0x2d327f){_0x1bb42c=_0x1bb42c-0x0;var _0x415829=_0x9cbf[_0x1bb42c];return _0x415829;};'use strict';var Sequelize=require(_0xf9cb('0x0'));module[_0xf9cb('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf9cb('0x2')]},'scheduledat':{'type':Sequelize[_0xf9cb('0x3')]},'uniqueid':{'type':Sequelize[_0xf9cb('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xf9cb('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf9cb('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf9cb('0x2')]}};
\ No newline at end of file
+var _0xed07=['DATE','STRING','INTEGER'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xed07,0x125));var _0x7ed0=function(_0x7435ac,_0x369287){_0x7435ac=_0x7435ac-0x0;var _0x1788f9=_0xed07[_0x7435ac];return _0x1788f9;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x7ed0('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x7ed0('0x1')]},'uniqueid':{'type':Sequelize[_0x7ed0('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x7ed0('0x1')]},'ringtime':{'type':Sequelize[_0x7ed0('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7ed0('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7ed0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js
index 7c5fa71..a1f0fb7 100644
--- a/server/api/reportAgentPreview/reportAgentPreview.model.js
+++ b/server/api/reportAgentPreview/reportAgentPreview.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x88f7=['api','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util','../../config/logger'];(function(_0x50915a,_0x5f05fb){var _0x287102=function(_0x2a046a){while(--_0x2a046a){_0x50915a['push'](_0x50915a['shift']());}};_0x287102(++_0x5f05fb);}(_0x88f7,0x106));var _0x788f=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x88f7[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require(_0x788f('0x0'));var logger=require(_0x788f('0x1'))(_0x788f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x788f('0x3'));var fs=require('fs');var path=require(_0x788f('0x4'));var rimraf=require(_0x788f('0x5'));var config=require(_0x788f('0x6'));var attributes=require(_0x788f('0x7'));module[_0x788f('0x8')]=function(_0x5cc93d,_0x5e0de5){return _0x5cc93d[_0x788f('0x9')](_0x788f('0xa'),attributes,{'tableName':_0x788f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4fd0=['report_agent_preview','api','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x4fd0,0x1f1));var _0x04fd=function(_0x11c331,_0x523ccf){_0x11c331=_0x11c331-0x0;var _0x1b89e1=_0x4fd0[_0x11c331];return _0x1b89e1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x04fd('0x0'));var moment=require('moment');var BPromise=require(_0x04fd('0x1'));var rp=require(_0x04fd('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04fd('0x3'));var config=require(_0x04fd('0x4'));var attributes=require(_0x04fd('0x5'));module['exports']=function(_0x516f33,_0x7f8f7d){return _0x516f33['define'](_0x04fd('0x6'),attributes,{'tableName':_0x04fd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js
index d8fdd20..a9536e7 100644
--- a/server/api/reportAgentPreview/reportAgentPreview.rpc.js
+++ b/server/api/reportAgentPreview/reportAgentPreview.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe87e=['options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','CreateReportAgentPreview','body'];(function(_0x4e1e67,_0x1e5858){var _0x28b433=function(_0x6d64d6){while(--_0x6d64d6){_0x4e1e67['push'](_0x4e1e67['shift']());}};_0x28b433(++_0x1e5858);}(_0xe87e,0x1ce));var _0xee87=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0xe87e[_0x264b9b];return _0x4c7a0e;};'use strict';var _=require(_0xee87('0x0'));var util=require(_0xee87('0x1'));var moment=require(_0xee87('0x2'));var BPromise=require(_0xee87('0x3'));var rs=require(_0xee87('0x4'));var fs=require('fs');var Redis=require(_0xee87('0x5'));var db=require(_0xee87('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xee87('0x7'))(_0xee87('0x8'));var config=require(_0xee87('0x9'));var jayson=require(_0xee87('0xa'));var client=jayson[_0xee87('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x344d65,_0xa11cca,_0x2d1be8){return new BPromise(function(_0x4ec17d,_0x2dc988){return client[_0xee87('0xc')](_0x344d65,_0x2d1be8)[_0xee87('0xd')](function(_0x5c1d4d){logger[_0xee87('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0xa11cca,_0xee87('0xf'));logger[_0xee87('0x10')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0xa11cca,_0xee87('0xf'),JSON[_0xee87('0x11')](_0x5c1d4d));if(_0x5c1d4d[_0xee87('0x12')]){if(_0x5c1d4d['error'][_0xee87('0x13')]===0x1f4){logger[_0xee87('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0xa11cca,_0x5c1d4d[_0xee87('0x12')][_0xee87('0x14')]);return _0x2dc988(_0x5c1d4d[_0xee87('0x12')][_0xee87('0x14')]);}logger['error'](_0xee87('0x15'),_0xa11cca,_0x5c1d4d[_0xee87('0x12')]['message']);return _0x4ec17d(_0x5c1d4d[_0xee87('0x12')][_0xee87('0x14')]);}else{logger['info'](_0xee87('0x15'),_0xa11cca,_0xee87('0xf'));_0x4ec17d(_0x5c1d4d['result'][_0xee87('0x14')]);}})['catch'](function(_0x4b5897){logger[_0xee87('0x12')](_0xee87('0x15'),_0xa11cca,_0x4b5897);_0x2dc988(_0x4b5897);});});}exports[_0xee87('0x16')]=function(_0x3cc389){var _0x5218a5=this;return new Promise(function(_0x5b4c5e,_0x14d5a5){return db['ReportAgentPreview']['create'](_0x3cc389[_0xee87('0x17')],{'raw':_0x3cc389[_0xee87('0x18')]?_0x3cc389[_0xee87('0x18')][_0xee87('0x19')]===undefined?!![]:![]:!![]})[_0xee87('0xd')](function(_0x134806){logger['info'](_0xee87('0x16'),_0x3cc389);logger[_0xee87('0x10')](_0xee87('0x16'),_0x3cc389,JSON[_0xee87('0x11')](_0x134806));_0x5b4c5e(_0x134806);})[_0xee87('0x1a')](function(_0x169b03){logger[_0xee87('0x12')]('CreateReportAgentPreview',_0x169b03[_0xee87('0x14')],_0x3cc389);_0x14d5a5(_0x5218a5['error'](0x1f4,_0x169b03[_0xee87('0x14')]));});});};
\ No newline at end of file
+var _0x55fe=['message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ReportAgentPreview,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55fe,0x1d8));var _0xe55f=function(_0x48ebff,_0x40c2db){_0x48ebff=_0x48ebff-0x0;var _0x2eedce=_0x55fe[_0x48ebff];return _0x2eedce;};'use strict';var _=require('lodash');var util=require(_0xe55f('0x0'));var moment=require(_0xe55f('0x1'));var BPromise=require('bluebird');var rs=require(_0xe55f('0x2'));var fs=require('fs');var Redis=require(_0xe55f('0x3'));var db=require(_0xe55f('0x4'))['db'];var utils=require(_0xe55f('0x5'));var logger=require(_0xe55f('0x6'))(_0xe55f('0x7'));var config=require(_0xe55f('0x8'));var jayson=require(_0xe55f('0x9'));var client=jayson[_0xe55f('0xa')][_0xe55f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x552035,_0x31142e,_0x13f80c){return new BPromise(function(_0x379434,_0x2dba66){return client[_0xe55f('0xc')](_0x552035,_0x13f80c)[_0xe55f('0xd')](function(_0x42ec13){logger[_0xe55f('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x31142e,'request\x20sent');logger[_0xe55f('0xf')](_0xe55f('0x10'),_0x31142e,_0xe55f('0x11'),JSON['stringify'](_0x42ec13));if(_0x42ec13['error']){if(_0x42ec13[_0xe55f('0x12')][_0xe55f('0x13')]===0x1f4){logger['error'](_0xe55f('0x14'),_0x31142e,_0x42ec13[_0xe55f('0x12')][_0xe55f('0x15')]);return _0x2dba66(_0x42ec13[_0xe55f('0x12')]['message']);}logger[_0xe55f('0x12')](_0xe55f('0x14'),_0x31142e,_0x42ec13['error'][_0xe55f('0x15')]);return _0x379434(_0x42ec13[_0xe55f('0x12')][_0xe55f('0x15')]);}else{logger[_0xe55f('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x31142e,_0xe55f('0x11'));_0x379434(_0x42ec13[_0xe55f('0x16')][_0xe55f('0x15')]);}})[_0xe55f('0x17')](function(_0x1b2485){logger['error'](_0xe55f('0x14'),_0x31142e,_0x1b2485);_0x2dba66(_0x1b2485);});});}exports[_0xe55f('0x18')]=function(_0x338988){var _0x3e22ed=this;return new Promise(function(_0x4bbcc5,_0x9c65da){return db[_0xe55f('0x19')][_0xe55f('0x1a')](_0x338988['body'],{'raw':_0x338988[_0xe55f('0x1b')]?_0x338988['options']['raw']===undefined?!![]:![]:!![]})[_0xe55f('0xd')](function(_0x3ac11b){logger[_0xe55f('0xe')](_0xe55f('0x18'),_0x338988);logger[_0xe55f('0xf')](_0xe55f('0x18'),_0x338988,JSON[_0xe55f('0x1c')](_0x3ac11b));_0x4bbcc5(_0x3ac11b);})[_0xe55f('0x17')](function(_0x3de576){logger[_0xe55f('0x12')]('CreateReportAgentPreview',_0x3de576[_0xe55f('0x15')],_0x338988);_0x9c65da(_0x3e22ed[_0xe55f('0x12')](0x1f4,_0x3de576[_0xe55f('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js
index 278de53..a730fc4 100644
--- a/server/api/rpc/index.js
+++ b/server/api/rpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x32c0=['/openchannel/queues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','agentCapacity','/telephones','telephones','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','exports','util','path','express','./rpc.controller','/voice/channels','voiceChannels','get','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts'];(function(_0x2aaa84,_0x8f150a){var _0x6ec863=function(_0x49dade){while(--_0x49dade){_0x2aaa84['push'](_0x2aaa84['shift']());}};_0x6ec863(++_0x8f150a);}(_0x32c0,0x1bb));var _0x032c=function(_0x2435f6,_0x59337f){_0x2435f6=_0x2435f6-0x0;var _0x5114f1=_0x32c0[_0x2435f6];return _0x5114f1;};'use strict';var multer=require('multer');var util=require(_0x032c('0x0'));var path=require(_0x032c('0x1'));var express=require(_0x032c('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x032c('0x3'));router['get'](_0x032c('0x4'),auth['isAuthenticated'](),controller[_0x032c('0x5')]);router[_0x032c('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x032c('0x7')]);router[_0x032c('0x6')](_0x032c('0x8'),auth[_0x032c('0x9')](),controller[_0x032c('0xa')]);router[_0x032c('0x6')](_0x032c('0xb'),auth[_0x032c('0x9')](),controller[_0x032c('0xc')]);router['get'](_0x032c('0xd'),auth[_0x032c('0x9')](),controller[_0x032c('0xe')]);router['get'](_0x032c('0xf'),auth['isAuthenticated'](),controller[_0x032c('0x10')]);router[_0x032c('0x6')](_0x032c('0x11'),auth['isAuthenticated'](),controller[_0x032c('0x12')]);router[_0x032c('0x6')](_0x032c('0x13'),auth[_0x032c('0x9')](),controller['openchannelQueues']);router[_0x032c('0x6')](_0x032c('0x14'),auth[_0x032c('0x9')](),controller[_0x032c('0x15')]);router[_0x032c('0x6')](_0x032c('0x16'),auth[_0x032c('0x9')](),controller[_0x032c('0x17')]);router[_0x032c('0x6')](_0x032c('0x18'),auth[_0x032c('0x9')](),controller[_0x032c('0x19')]);router[_0x032c('0x6')](_0x032c('0x1a'),auth['isAuthenticated'](),controller[_0x032c('0x1b')]);router[_0x032c('0x6')](_0x032c('0x1c'),auth[_0x032c('0x9')](),controller['voiceQueuesChannel']);router[_0x032c('0x6')](_0x032c('0x1d'),auth['isAuthenticated'](),controller[_0x032c('0x1e')]);router[_0x032c('0x6')](_0x032c('0x1f'),auth['isAuthenticated'](),controller[_0x032c('0x20')]);router[_0x032c('0x6')](_0x032c('0x21'),auth[_0x032c('0x9')](),controller['showVoiceQueues']);router['get'](_0x032c('0x22'),auth[_0x032c('0x9')](),controller[_0x032c('0x23')]);router[_0x032c('0x6')](_0x032c('0x24'),auth[_0x032c('0x9')](),controller[_0x032c('0x25')]);router[_0x032c('0x6')]('/agents',auth[_0x032c('0x9')](),controller['agents']);router['put'](_0x032c('0x26'),auth[_0x032c('0x9')](),controller[_0x032c('0x27')]);router['get'](_0x032c('0x28'),auth[_0x032c('0x9')](),controller[_0x032c('0x29')]);router[_0x032c('0x6')]('/trunks',auth[_0x032c('0x9')](),controller['trunks']);router['get'](_0x032c('0x2a'),auth[_0x032c('0x9')](),controller[_0x032c('0x2b')]);router[_0x032c('0x6')](_0x032c('0x2c'),auth[_0x032c('0x9')](),controller[_0x032c('0x2d')]);router['get'](_0x032c('0x2e'),auth[_0x032c('0x9')](),controller[_0x032c('0x2f')]);router[_0x032c('0x6')](_0x032c('0x30'),auth['isAuthenticated'](),controller[_0x032c('0x31')]);router['get'](_0x032c('0x32'),auth[_0x032c('0x9')](),controller[_0x032c('0x33')]);router['get'](_0x032c('0x34'),auth['isAuthenticated'](),controller[_0x032c('0x35')]);router[_0x032c('0x6')](_0x032c('0x36'),auth[_0x032c('0x9')](),controller[_0x032c('0x37')]);router[_0x032c('0x38')](_0x032c('0x39'),auth[_0x032c('0x9')](),controller[_0x032c('0x3a')](_0x032c('0x3b')));router[_0x032c('0x6')](_0x032c('0x3c'),auth[_0x032c('0x9')](),controller[_0x032c('0x3d')]);router['post'](_0x032c('0x3e'),auth[_0x032c('0x9')](),controller[_0x032c('0x3a')](_0x032c('0x3f')));router[_0x032c('0x6')](_0x032c('0x40'),auth[_0x032c('0x9')](),controller[_0x032c('0x41')]);router[_0x032c('0x38')](_0x032c('0x42'),auth[_0x032c('0x9')](),controller['queueNotify'](_0x032c('0x43')));router[_0x032c('0x6')](_0x032c('0x44'),auth[_0x032c('0x9')](),controller['showFaxQueues']);router[_0x032c('0x38')]('/openchannel/queues/:id/notify',auth[_0x032c('0x9')](),controller[_0x032c('0x3a')](_0x032c('0x45')));router['get'](_0x032c('0x46'),auth[_0x032c('0x9')](),controller[_0x032c('0x47')]);router[_0x032c('0x38')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('sms'));router[_0x032c('0x6')](_0x032c('0x48'),auth[_0x032c('0x9')](),controller[_0x032c('0x49')]);router[_0x032c('0x38')](_0x032c('0x4a'),auth[_0x032c('0x9')](),controller[_0x032c('0x4b')]);module[_0x032c('0x4c')]=router;
\ No newline at end of file
+var _0xfefc=['/outbound','outbound','/outbound/channels','outboundChannels','agents','put','/agents/:id/capacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','showSmsQueues','/agents/:id/notify','agentNotify','multer','util','path','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','smsQueues','/fax/queues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/:id'];(function(_0x58cd41,_0x5f0c65){var _0x2e6ebd=function(_0x2ee86d){while(--_0x2ee86d){_0x58cd41['push'](_0x58cd41['shift']());}};_0x2e6ebd(++_0x5f0c65);}(_0xfefc,0xfa));var _0xcfef=function(_0x230f09,_0x2b688c){_0x230f09=_0x230f09-0x0;var _0x2d187d=_0xfefc[_0x230f09];return _0x2d187d;};'use strict';var multer=require(_0xcfef('0x0'));var util=require(_0xcfef('0x1'));var path=require(_0xcfef('0x2'));var express=require(_0xcfef('0x3'));var router=express[_0xcfef('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0xcfef('0x5'));router[_0xcfef('0x6')](_0xcfef('0x7'),auth[_0xcfef('0x8')](),controller['voiceChannels']);router[_0xcfef('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xcfef('0x8')](),controller[_0xcfef('0x9')]);router['get'](_0xcfef('0xa'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0xcfef('0x6')](_0xcfef('0xb'),auth[_0xcfef('0x8')](),controller[_0xcfef('0xc')]);router[_0xcfef('0x6')](_0xcfef('0xd'),auth[_0xcfef('0x8')](),controller['chatQueues']);router['get'](_0xcfef('0xe'),auth[_0xcfef('0x8')](),controller[_0xcfef('0xf')]);router[_0xcfef('0x6')](_0xcfef('0x10'),auth[_0xcfef('0x8')](),controller['mailAccounts']);router['get'](_0xcfef('0x11'),auth['isAuthenticated'](),controller['openchannelQueues']);router[_0xcfef('0x6')]('/sms/queues',auth[_0xcfef('0x8')](),controller[_0xcfef('0x12')]);router[_0xcfef('0x6')](_0xcfef('0x13'),auth[_0xcfef('0x8')](),controller['faxQueues']);router[_0xcfef('0x6')]('/voice/queues/preview/:id',auth[_0xcfef('0x8')](),controller['voiceQueuesPreview']);router[_0xcfef('0x6')](_0xcfef('0x14'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x15')]);router[_0xcfef('0x6')](_0xcfef('0x16'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x17')]);router[_0xcfef('0x6')](_0xcfef('0x18'),auth[_0xcfef('0x8')](),controller['voiceQueuesChannelHangup']);router[_0xcfef('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xcfef('0x6')](_0xcfef('0x19'),auth[_0xcfef('0x8')](),controller['showVoiceQueues']);router[_0xcfef('0x6')](_0xcfef('0x1a'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x1b')]);router[_0xcfef('0x6')](_0xcfef('0x1c'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x1d')]);router[_0xcfef('0x6')]('/agents',auth['isAuthenticated'](),controller[_0xcfef('0x1e')]);router[_0xcfef('0x1f')](_0xcfef('0x20'),auth[_0xcfef('0x8')](),controller['agentCapacity']);router[_0xcfef('0x6')](_0xcfef('0x21'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x22')]);router['get'](_0xcfef('0x23'),auth['isAuthenticated'](),controller['trunks']);router[_0xcfef('0x6')](_0xcfef('0x24'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x25')]);router[_0xcfef('0x6')](_0xcfef('0x26'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x27')]);router[_0xcfef('0x6')](_0xcfef('0x28'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x29')]);router[_0xcfef('0x6')](_0xcfef('0x2a'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x2b')]);router[_0xcfef('0x6')](_0xcfef('0x2c'),auth['isAuthenticated'](),controller[_0xcfef('0x2d')]);router['get'](_0xcfef('0x2e'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x2f')]);router[_0xcfef('0x6')](_0xcfef('0x30'),auth['isAuthenticated'](),controller[_0xcfef('0x31')]);router[_0xcfef('0x32')](_0xcfef('0x33'),auth[_0xcfef('0x8')](),controller['queueNotify']('mail'));router[_0xcfef('0x6')](_0xcfef('0x34'),auth['isAuthenticated'](),controller[_0xcfef('0x35')]);router['post'](_0xcfef('0x36'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x37')](_0xcfef('0x38')));router[_0xcfef('0x6')](_0xcfef('0x39'),auth[_0xcfef('0x8')](),controller['showChatQueues']);router['post'](_0xcfef('0x3a'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x37')]('fax'));router[_0xcfef('0x6')](_0xcfef('0x3b'),auth['isAuthenticated'](),controller['showFaxQueues']);router['post'](_0xcfef('0x3c'),auth[_0xcfef('0x8')](),controller['queueNotify'](_0xcfef('0x3d')));router[_0xcfef('0x6')](_0xcfef('0x3e'),auth['isAuthenticated'](),controller[_0xcfef('0x3f')]);router[_0xcfef('0x32')](_0xcfef('0x40'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x37')](_0xcfef('0x41')));router['get']('/sms/queues/:id',auth[_0xcfef('0x8')](),controller[_0xcfef('0x42')]);router[_0xcfef('0x32')](_0xcfef('0x43'),auth[_0xcfef('0x8')](),controller[_0xcfef('0x44')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js
index 98f54be..7d88133 100644
--- a/server/api/rpc/rpc.controller.js
+++ b/server/api/rpc/rpc.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x912e=['openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','TransferReport','create','Start','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','Message','From','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','stack','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','name','hasOwnProperty','MemberReport','findAll','user','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','Trunks','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','showFaxQueues','faxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x912e,0x16b));var _0xe912=function(_0x1301ae,_0x85b28c){_0x1301ae=_0x1301ae-0x0;var _0x20a7af=_0x912e[_0x1301ae];return _0x20a7af;};'use strict';var BPromise=require(_0xe912('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var db=require(_0xe912('0x1'))['db'];var logger=require(_0xe912('0x2'))('api');var jayson=require(_0xe912('0x3'));var amiClient=jayson[_0xe912('0x4')]['http']({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson['client'][_0xe912('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x2d4f5c,_0x22fcef,_0x58ba0b){return new BPromise(function(_0x4d4702,_0x10e0e3){var _0x17ef62=_0x58ba0b?_0x58ba0b:amiClient;return _0x17ef62[_0xe912('0x6')](_0x2d4f5c,_0x22fcef)[_0xe912('0x7')](function(_0x452e9a){if(_0x452e9a['error']){if(_0x452e9a[_0xe912('0x8')]['code']===0x1f4){return _0x10e0e3(_0x452e9a['error'][_0xe912('0x9')]);}return _0x4d4702(_0x452e9a[_0xe912('0x8')][_0xe912('0x9')]);}else{_0x4d4702(_0x452e9a[_0xe912('0xa')]);}})[_0xe912('0xb')](function(_0x442469){_0x10e0e3(_0x442469);});});}function respondWithResult(_0x3f5558,_0xdc3606){_0xdc3606=_0xdc3606||0xc8;return function(_0x1efa0e){if(_0x1efa0e){return _0x3f5558[_0xe912('0xc')](_0xdc3606)[_0xe912('0xd')](_0x1efa0e);}return _0x3f5558[_0xe912('0xe')](0x194);};}function handleError(_0x4aa14c,_0x365e2e){_0x365e2e=_0x365e2e||0x1f4;return function(_0x3941c6){logger[_0xe912('0x8')](_0x3941c6[_0xe912('0xf')]);if(_0x3941c6['name']){delete _0x3941c6['name'];}_0x4aa14c[_0xe912('0xc')](_0x365e2e)['send'](_0x3941c6);};}function findById(_0x4386d0){return function(_0x161c6e){if(!_[_0xe912('0x10')](_0x4386d0)&&!_[_0xe912('0x10')](_0x161c6e)&&!_[_0xe912('0x10')](_0x161c6e[_0xe912('0x11')])){return _[_0xe912('0x12')](_0x161c6e['rows'],function(_0x71eb7e){return _0x71eb7e['id']==_0x4386d0;});}return null;};}exports[_0xe912('0x13')]=function(_0x4e0b58,_0xbf137a){return respondWithRpcPromise(_0xe912('0x14'),_0x4e0b58[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0xbf137a,null))['catch'](handleError(_0xbf137a,null));};exports[_0xe912('0x16')]=function(_0x36630e,_0x457a8a){return respondWithRpcPromise(_0xe912('0x17'),_[_0xe912('0x18')](_0x36630e[_0xe912('0x15')],_0x36630e[_0xe912('0x19')]))[_0xe912('0x7')](respondWithResult(_0x457a8a,null))['catch'](handleError(_0x457a8a,null));};exports[_0xe912('0x1a')]=function(_0x43b1f0,_0x50398a){return respondWithRpcPromise(_0xe912('0x1b'),_[_0xe912('0x18')](_0x43b1f0[_0xe912('0x15')],_0x43b1f0['params']))[_0xe912('0x7')](respondWithResult(_0x50398a,null))['catch'](handleError(_0x50398a,null));};exports[_0xe912('0x1c')]=function(_0x5bff6a,_0x3989c0){return respondWithRpcPromise(_0xe912('0x1d'),_0x5bff6a['query'])[_0xe912('0x7')](respondWithResult(_0x3989c0,null))['catch'](handleError(_0x3989c0,null));};exports[_0xe912('0x1e')]=function(_0x15ca96,_0x5746b2){return respondWithRpcPromise(_0xe912('0x1d'),_0x15ca96[_0xe912('0x15')])[_0xe912('0x7')](findById(_0x15ca96['params']['id']))['then'](respondWithResult(_0x5746b2,null))['catch'](handleError(_0x5746b2,null));};exports[_0xe912('0x1f')]=function(_0x4964a1,_0x34b9ae){return respondWithRpcPromise(_0xe912('0x20'),_[_0xe912('0x18')](_0x4964a1[_0xe912('0x15')],_0x4964a1['params']))[_0xe912('0x7')](respondWithResult(_0x34b9ae,null))['catch'](handleError(_0x34b9ae,null));};exports[_0xe912('0x21')]=function(_0x161f5c,_0x29b3f5){return respondWithRpcPromise(_0xe912('0x22'),_0x161f5c[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0x29b3f5,null))[_0xe912('0xb')](handleError(_0x29b3f5,null));};exports['voiceQueuesChannel']=function(_0x36dce7,_0x1a0882){return respondWithRpcPromise(_0xe912('0x23'),_[_0xe912('0x18')](_0x36dce7['query'],_0x36dce7[_0xe912('0x19')]))[_0xe912('0x7')](respondWithResult(_0x1a0882,null))[_0xe912('0xb')](handleError(_0x1a0882,null));};exports[_0xe912('0x24')]=function(_0x471c19,_0x22456b){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xe912('0x18')](_0x471c19[_0xe912('0x15')],_0x471c19[_0xe912('0x19')]))[_0xe912('0x7')](respondWithResult(_0x22456b,null))[_0xe912('0xb')](handleError(_0x22456b,null));};exports[_0xe912('0x25')]=function(_0x3c3575,_0x5f1e2c){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xe912('0x18')](_0x3c3575[_0xe912('0x15')],_0x3c3575['params']))[_0xe912('0x7')](respondWithResult(_0x5f1e2c,null))[_0xe912('0xb')](handleError(_0x5f1e2c,null));};exports[_0xe912('0x26')]=function(_0x3ba636,_0x3bef6c){return respondWithRpcPromise(_0xe912('0x27'),_0x3ba636[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0x3bef6c,null))[_0xe912('0xb')](handleError(_0x3bef6c,null));};exports[_0xe912('0x28')]=function(_0x1bed14,_0x266c52){return respondWithRpcPromise('OutboundChannels',_0x1bed14[_0xe912('0x15')])['then'](respondWithResult(_0x266c52,null))[_0xe912('0xb')](handleError(_0x266c52,null));};exports[_0xe912('0x29')]=function(_0x4053d9,_0x279a09){var _0xee201b;return respondWithRpcPromise('Agents',_0x4053d9[_0xe912('0x15')])['then'](function(_0x43569e){_0xee201b=_0x43569e;return respondWithRpcPromise(_0xe912('0x2a'),_0x4053d9[_0xe912('0x15')],routingClient);})[_0xe912('0x7')](function(_0x287ed6){return _[_0xe912('0x18')]({},_0x287ed6,_0xee201b);})[_0xe912('0x7')](respondWithResult(_0x279a09,null))[_0xe912('0xb')](handleError(_0x279a09,null));};exports[_0xe912('0x2b')]=function(_0x308e34,_0xa378ce){if(_0x308e34[_0xe912('0x2c')]&&_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')]&&_0x308e34['user']&&_0x308e34['user'][_0xe912('0x2e')]){for(var _0x29054c in _0x308e34[_0xe912('0x2c')][_0xe912('0x2d')]){if(_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0xe912('0x2f')](_0x29054c)){db[_0xe912('0x30')][_0xe912('0x31')]({'where':{'channel':_0x29054c,'membername':_0x308e34[_0xe912('0x32')][_0xe912('0x2e')],'type':_0xe912('0x33'),'exitAt':null,'uniqueid':_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0x29054c]&&_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0x29054c][_0xe912('0x34')]?{'$notIn':_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0x29054c]}:{'$ne':null}}})[_0xe912('0x7')](function(_0x4a8d77){var _0x3f632b=moment()[_0xe912('0x35')](_0xe912('0x36'));for(var _0x284b81=0x0,_0x4f19d1=_0x4a8d77[_0xe912('0x34')];_0x284b81<_0x4f19d1;_0x284b81+=0x1){_0x4a8d77[_0x284b81][_0xe912('0x37')]({'exitAt':_0x3f632b});}});for(var _0x4516ad=0x0;_0x4516ad<_0x308e34[_0xe912('0x2c')]['interaction'][_0x29054c][_0xe912('0x34')];_0x4516ad+=0x1){db[_0xe912('0x30')][_0xe912('0x38')]({'where':{'channel':_0x29054c,'membername':_0x308e34['user'][_0xe912('0x2e')],'type':_0xe912('0x33'),'uniqueid':_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0x29054c][_0x4516ad],'exitAt':null},'defaults':{'channel':_0x29054c,'membername':_0x308e34[_0xe912('0x32')][_0xe912('0x2e')],'interface':_[_0xe912('0x10')](_0x308e34['user'][_0xe912('0x39')])?util[_0xe912('0x35')](_0xe912('0x3a'),_0x308e34['user']['name']):_0x308e34[_0xe912('0x32')][_0xe912('0x39')],'type':_0xe912('0x33'),'enterAt':moment()[_0xe912('0x35')](_0xe912('0x36')),'role':_0xe912('0x3b'),'internal':_0x308e34[_0xe912('0x32')][_0xe912('0x3c')],'uniqueid':_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0x29054c][_0x4516ad]}});}}}}return respondWithRpcPromise(_0xe912('0x3d'),{'id':_0x308e34[_0xe912('0x19')]['id'],'capacity':_0x308e34[_0xe912('0x2c')]['capacity']},routingClient)[_0xe912('0x7')](respondWithResult(_0xa378ce,null))[_0xe912('0xb')](handleError(_0xa378ce,null));};exports['telephones']=function(_0x520327,_0x144fd7){return respondWithRpcPromise('Telephones',_0x520327[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0x144fd7,null))[_0xe912('0xb')](handleError(_0x144fd7,null));};exports['trunks']=function(_0x2700f3,_0x460713){return respondWithRpcPromise(_0xe912('0x3e'),_0x2700f3[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0x460713,null))[_0xe912('0xb')](handleError(_0x460713,null));};exports['campaigns']=function(_0x53144c,_0x1dcbd1){return respondWithRpcPromise('Campaigns',_0x53144c[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0x1dcbd1,null))[_0xe912('0xb')](handleError(_0x1dcbd1,null));};exports['chatQueues']=function(_0x5fed77,_0x4f20d1){return respondWithRpcPromise('ChatQueues',_0x5fed77[_0xe912('0x15')],routingClient)['then'](respondWithResult(_0x4f20d1,null))[_0xe912('0xb')](handleError(_0x4f20d1,null));};exports[_0xe912('0x3f')]=function(_0x268086,_0x52d67c){return respondWithRpcPromise(_0xe912('0x40'),_0x268086[_0xe912('0x15')],routingClient)['then'](findById(_0x268086[_0xe912('0x19')]['id']))[_0xe912('0x7')](respondWithResult(_0x52d67c,null))[_0xe912('0xb')](handleError(_0x52d67c,null));};exports[_0xe912('0x41')]=function(_0x44516b,_0x51dcdf){return respondWithRpcPromise(_0xe912('0x42'),_0x44516b[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x51dcdf,null))['catch'](handleError(_0x51dcdf,null));};exports[_0xe912('0x43')]=function(_0x57627a,_0x2e661e){return respondWithRpcPromise(_0xe912('0x42'),_0x57627a[_0xe912('0x15')],routingClient)[_0xe912('0x7')](findById(_0x57627a['params']['id']))[_0xe912('0x7')](respondWithResult(_0x2e661e,null))[_0xe912('0xb')](handleError(_0x2e661e,null));};exports[_0xe912('0x44')]=function(_0x5e7304,_0xe826a2){return respondWithRpcPromise(_0xe912('0x45'),_0x5e7304[_0xe912('0x15')],mailClient)[_0xe912('0x7')](respondWithResult(_0xe826a2,null))[_0xe912('0xb')](handleError(_0xe826a2,null));};exports[_0xe912('0x46')]=function(_0x9194e8,_0x5646f0){return respondWithRpcPromise(_0xe912('0x47'),_0x9194e8['query'],routingClient)['then'](respondWithResult(_0x5646f0,null))['catch'](handleError(_0x5646f0,null));};exports[_0xe912('0x48')]=function(_0xce7100,_0x429b7b){return respondWithRpcPromise(_0xe912('0x47'),_0xce7100[_0xe912('0x15')],routingClient)[_0xe912('0x7')](findById(_0xce7100['params']['id']))[_0xe912('0x7')](respondWithResult(_0x429b7b,null))[_0xe912('0xb')](handleError(_0x429b7b,null));};exports[_0xe912('0x49')]=function(_0x3ee385,_0x5a8083){return respondWithRpcPromise('SmsQueues',_0x3ee385[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x5a8083,null))[_0xe912('0xb')](handleError(_0x5a8083,null));};exports[_0xe912('0x4a')]=function(_0x5f0d29,_0x4a6d21){return respondWithRpcPromise(_0xe912('0x4b'),_0x5f0d29[_0xe912('0x15')],routingClient)['then'](findById(_0x5f0d29[_0xe912('0x19')]['id']))[_0xe912('0x7')](respondWithResult(_0x4a6d21,null))[_0xe912('0xb')](handleError(_0x4a6d21,null));};exports['faxQueues']=function(_0x3aa7b7,_0xb1423c){return respondWithRpcPromise('FaxQueues',_0x3aa7b7[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0xb1423c,null))['catch'](handleError(_0xb1423c,null));};exports[_0xe912('0x4c')]=function(_0x466b95,_0x5a8ee9){return respondWithRpcPromise('FaxQueues',_0x466b95[_0xe912('0x15')],routingClient)[_0xe912('0x7')](findById(_0x466b95[_0xe912('0x19')]['id']))['then'](respondWithResult(_0x5a8ee9,null))[_0xe912('0xb')](handleError(_0x5a8ee9,null));};exports[_0xe912('0x4d')]=function(_0x45352d,_0x12d90e){return respondWithRpcPromise('FaxAccounts',_0x45352d['query'])[_0xe912('0x7')](respondWithResult(_0x12d90e,null))[_0xe912('0xb')](handleError(_0x12d90e,null));};exports['chatQueuesWaitingInteractions']=function(_0x3ab685,_0x33ee68){return respondWithRpcPromise(_0xe912('0x4e'),_0x3ab685[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x33ee68,null))[_0xe912('0xb')](handleError(_0x33ee68,null));};exports[_0xe912('0x4f')]=function(_0x44d2ba,_0x57de72){return respondWithRpcPromise(_0xe912('0x50'),_0x44d2ba[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x57de72,null))['catch'](handleError(_0x57de72,null));};exports[_0xe912('0x51')]=function(_0x3950cf,_0x5e7883){return respondWithRpcPromise(_0xe912('0x52'),_0x3950cf[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x5e7883,null))[_0xe912('0xb')](handleError(_0x5e7883,null));};exports[_0xe912('0x53')]=function(_0x27a821,_0x3715f0){return respondWithRpcPromise(_0xe912('0x54'),_0x27a821[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x3715f0,null))[_0xe912('0xb')](handleError(_0x3715f0,null));};exports[_0xe912('0x55')]=function(_0x12c00f,_0x401e40){return respondWithRpcPromise(_0xe912('0x56'),_0x12c00f[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x401e40,null))['catch'](handleError(_0x401e40,null));};exports[_0xe912('0x57')]=function(_0x25db75){return function(_0x316445,_0x2088e0){var _0x40d0b3,_0x5dc705;var _0x36b01f=_[_0xe912('0x58')](_0x25db75);var _0x22051d=_0x25db75===_0xe912('0x59')?_0xe912('0x5a'):_0xe912('0x5b');return db[_0x36b01f+_0xe912('0x5c')]['findOne']({'raw':!![],'where':{'id':_0x316445[_0xe912('0x19')]['id']}})[_0xe912('0x7')](function(_0x4844ef){if(_[_0xe912('0x10')](_0x4844ef)){throw new Error(_0x36b01f+_0xe912('0x5d'));}_0x40d0b3=_0x4844ef;return db[_0x36b01f+'Message'][_0xe912('0x5e')]({'where':{'id':_0x316445['body'][_0xe912('0x5f')]},'include':[{'model':db[_0x36b01f+_0xe912('0x60')],'as':_0xe912('0x60')},{'model':db[_0x36b01f+_0x22051d],'as':_0xe912('0x5b')}]});})['then'](function(_0x524b97){if(_[_0xe912('0x10')](_0x524b97)){throw new Error(_0x36b01f+_0xe912('0x61'));}_0x5dc705=_0x524b97;return _0x524b97[_0xe912('0x62')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe912('0x7')](function(){var _0xb83669={'uniqueid':_0x25db75+'.'+_0x5dc705['id']+'.'+_0x5dc705[_0xe912('0x60')]['id'],'FromUserId':_0x316445['user']['id'],'type':'queue'};_0xb83669[_0x36b01f+_0xe912('0x63')]=_0x5dc705['id'];_0xb83669[_0x36b01f+_0xe912('0x64')]=_0x5dc705[_0xe912('0x60')]['id'];_0xb83669['From'+_0x36b01f+_0x22051d+'Id']=_0x5dc705['Account']['id'];_0xb83669['To'+_0x36b01f+'QueueId']=_0x40d0b3['id'];return db[_0x36b01f+_0xe912('0x65')][_0xe912('0x66')](_0xb83669);})[_0xe912('0x7')](function(){return respondWithRpcPromise(_0xe912('0x67'),{'channel':_0x25db75,'interaction':_0x5dc705[_0xe912('0x60')],'message':_0x5dc705,'account':_0x5dc705[_0xe912('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x40d0b3[_0xe912('0x2e')]+','+(_0x5dc705['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe912('0x7')](respondWithResult(_0x2088e0,null))[_0xe912('0xb')](handleError(_0x2088e0,null));};};exports[_0xe912('0x68')]=function(_0x1fe30f,_0x3731b3){var _0x3896bc,_0x3a4c4e;if(_['isNil'](_0x1fe30f[_0xe912('0x2c')][_0xe912('0x69')])){throw new Error(_0xe912('0x6a'));}var _0x122b16=_0x1fe30f[_0xe912('0x2c')][_0xe912('0x69')];var _0x10f1b7=_[_0xe912('0x58')](_0x122b16);var _0x5e6728=_0x122b16===_0xe912('0x59')?_0xe912('0x5a'):_0xe912('0x5b');return db[_0xe912('0x6b')][_0xe912('0x5e')]({'raw':!![],'where':{'id':_0x1fe30f[_0xe912('0x19')]['id'],'role':'agent'}})[_0xe912('0x7')](function(_0x31a893){if(_[_0xe912('0x10')](_0x31a893)){throw new Error(_0xe912('0x6c'));}_0x3896bc=_0x31a893;return db[_0x10f1b7+_0xe912('0x6d')][_0xe912('0x5e')]({'where':{'id':_0x1fe30f[_0xe912('0x2c')]['messageId']},'include':[{'model':db[_0x10f1b7+_0xe912('0x60')],'as':'Interaction'},{'model':db[_0x10f1b7+_0x5e6728],'as':_0xe912('0x5b')}]});})[_0xe912('0x7')](function(_0x68cbe0){if(_['isNil'](_0x68cbe0)){throw new Error(_0x10f1b7+_0xe912('0x61'));}_0x3a4c4e=_0x68cbe0;return _0x68cbe0[_0xe912('0x62')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe912('0x7')](function(){var _0x412e3b={'uniqueid':_0x122b16+'.'+_0x3a4c4e['id']+'.'+_0x3a4c4e['Interaction']['id'],'FromUserId':_0x1fe30f['user']['id'],'type':'queue','ToUserId':_0x3896bc['id']};_0x412e3b[_0x10f1b7+_0xe912('0x63')]=_0x3a4c4e['id'];_0x412e3b[_0x10f1b7+_0xe912('0x64')]=_0x3a4c4e['Interaction']['id'];_0x412e3b[_0xe912('0x6e')+_0x10f1b7+_0x5e6728+'Id']=_0x3a4c4e[_0xe912('0x5b')]['id'];return db[_0x10f1b7+_0xe912('0x65')][_0xe912('0x66')](_0x412e3b);})['then'](function(){return respondWithRpcPromise(_0xe912('0x67'),{'channel':_0x122b16,'interaction':_0x3a4c4e[_0xe912('0x60')],'message':_0x3a4c4e,'account':_0x3a4c4e[_0xe912('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe912('0x3b'),'appdata':_0x3896bc[_0xe912('0x2e')]+','+(_0x3a4c4e[_0xe912('0x5b')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x3731b3,null))[_0xe912('0xb')](handleError(_0x3731b3,null));};
\ No newline at end of file
+var _0x231d=['Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Website','User','Agent\x20not\x20found','messageId','update','create','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','client','http','request','error','code','message','result','catch','json','sendStatus','stack','name','status','send','isNil','rows','find','VoiceChannels','query','then','voiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','params','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','Agents','user','body','interaction','hasOwnProperty','MemberReport','findAll','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','format','SIP/%s','agent','internal','capacity'];(function(_0x2a09cf,_0x3ac804){var _0x316909=function(_0xc4b77d){while(--_0xc4b77d){_0x2a09cf['push'](_0x2a09cf['shift']());}};_0x316909(++_0x3ac804);}(_0x231d,0xae));var _0xd231=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x231d[_0x57b54c];return _0x59cc19;};'use strict';var BPromise=require(_0xd231('0x0'));var moment=require(_0xd231('0x1'));var _=require(_0xd231('0x2'));var util=require('util');var db=require(_0xd231('0x3'))['db'];var logger=require(_0xd231('0x4'))(_0xd231('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0xd231('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0xd231('0x6')][_0xd231('0x7')]({'port':0x232b});var routingClient=jayson[_0xd231('0x6')][_0xd231('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x32a4fa,_0x489cad,_0x1b6840){return new BPromise(function(_0x161880,_0x1ea683){var _0x1e96e8=_0x1b6840?_0x1b6840:amiClient;return _0x1e96e8[_0xd231('0x8')](_0x32a4fa,_0x489cad)['then'](function(_0x1ecb18){if(_0x1ecb18[_0xd231('0x9')]){if(_0x1ecb18[_0xd231('0x9')][_0xd231('0xa')]===0x1f4){return _0x1ea683(_0x1ecb18['error'][_0xd231('0xb')]);}return _0x161880(_0x1ecb18[_0xd231('0x9')][_0xd231('0xb')]);}else{_0x161880(_0x1ecb18[_0xd231('0xc')]);}})[_0xd231('0xd')](function(_0x325ae5){_0x1ea683(_0x325ae5);});});}function respondWithResult(_0x14c5e0,_0x28c1df){_0x28c1df=_0x28c1df||0xc8;return function(_0x4736f6){if(_0x4736f6){return _0x14c5e0['status'](_0x28c1df)[_0xd231('0xe')](_0x4736f6);}return _0x14c5e0[_0xd231('0xf')](0x194);};}function handleError(_0x34af73,_0x4e5958){_0x4e5958=_0x4e5958||0x1f4;return function(_0x46f888){logger[_0xd231('0x9')](_0x46f888[_0xd231('0x10')]);if(_0x46f888[_0xd231('0x11')]){delete _0x46f888['name'];}_0x34af73[_0xd231('0x12')](_0x4e5958)[_0xd231('0x13')](_0x46f888);};}function findById(_0x532d36){return function(_0x4775e1){if(!_[_0xd231('0x14')](_0x532d36)&&!_[_0xd231('0x14')](_0x4775e1)&&!_[_0xd231('0x14')](_0x4775e1[_0xd231('0x15')])){return _[_0xd231('0x16')](_0x4775e1[_0xd231('0x15')],function(_0x26d362){return _0x26d362['id']==_0x532d36;});}return null;};}exports['voiceChannels']=function(_0x1a4594,_0x1be9e0){return respondWithRpcPromise(_0xd231('0x17'),_0x1a4594[_0xd231('0x18')])[_0xd231('0x19')](respondWithResult(_0x1be9e0,null))['catch'](handleError(_0x1be9e0,null));};exports[_0xd231('0x1a')]=function(_0x3824c6,_0x2d1fd8){return respondWithRpcPromise('VoiceChannelMixMonitor',_['merge'](_0x3824c6[_0xd231('0x18')],_0x3824c6['params']))[_0xd231('0x19')](respondWithResult(_0x2d1fd8,null))[_0xd231('0xd')](handleError(_0x2d1fd8,null));};exports[_0xd231('0x1b')]=function(_0xd94b03,_0x2fae04){return respondWithRpcPromise(_0xd231('0x1c'),_[_0xd231('0x1d')](_0xd94b03[_0xd231('0x18')],_0xd94b03['params']))[_0xd231('0x19')](respondWithResult(_0x2fae04,null))[_0xd231('0xd')](handleError(_0x2fae04,null));};exports[_0xd231('0x1e')]=function(_0x373d69,_0x5aa186){return respondWithRpcPromise(_0xd231('0x1f'),_0x373d69[_0xd231('0x18')])['then'](respondWithResult(_0x5aa186,null))[_0xd231('0xd')](handleError(_0x5aa186,null));};exports[_0xd231('0x20')]=function(_0x32de44,_0x5bfca1){return respondWithRpcPromise(_0xd231('0x1f'),_0x32de44[_0xd231('0x18')])['then'](findById(_0x32de44[_0xd231('0x21')]['id']))[_0xd231('0x19')](respondWithResult(_0x5bfca1,null))[_0xd231('0xd')](handleError(_0x5bfca1,null));};exports[_0xd231('0x22')]=function(_0x27e5a2,_0x5134a1){return respondWithRpcPromise(_0xd231('0x23'),_[_0xd231('0x1d')](_0x27e5a2[_0xd231('0x18')],_0x27e5a2[_0xd231('0x21')]))[_0xd231('0x19')](respondWithResult(_0x5134a1,null))[_0xd231('0xd')](handleError(_0x5134a1,null));};exports['voiceQueuesChannels']=function(_0x1d727f,_0x5539af){return respondWithRpcPromise(_0xd231('0x24'),_0x1d727f[_0xd231('0x18')])[_0xd231('0x19')](respondWithResult(_0x5539af,null))[_0xd231('0xd')](handleError(_0x5539af,null));};exports[_0xd231('0x25')]=function(_0x150a77,_0x263dac){return respondWithRpcPromise(_0xd231('0x26'),_[_0xd231('0x1d')](_0x150a77['query'],_0x150a77[_0xd231('0x21')]))[_0xd231('0x19')](respondWithResult(_0x263dac,null))[_0xd231('0xd')](handleError(_0x263dac,null));};exports[_0xd231('0x27')]=function(_0x353444,_0x54cb33){return respondWithRpcPromise(_0xd231('0x28'),_[_0xd231('0x1d')](_0x353444[_0xd231('0x18')],_0x353444[_0xd231('0x21')]))['then'](respondWithResult(_0x54cb33,null))['catch'](handleError(_0x54cb33,null));};exports[_0xd231('0x29')]=function(_0x542fc5,_0x1628e0){return respondWithRpcPromise(_0xd231('0x2a'),_[_0xd231('0x1d')](_0x542fc5[_0xd231('0x18')],_0x542fc5[_0xd231('0x21')]))[_0xd231('0x19')](respondWithResult(_0x1628e0,null))[_0xd231('0xd')](handleError(_0x1628e0,null));};exports['outbound']=function(_0xfc9215,_0x18a2e9){return respondWithRpcPromise(_0xd231('0x2b'),_0xfc9215[_0xd231('0x18')])['then'](respondWithResult(_0x18a2e9,null))[_0xd231('0xd')](handleError(_0x18a2e9,null));};exports['outboundChannels']=function(_0x4e6d6a,_0x553def){return respondWithRpcPromise(_0xd231('0x2c'),_0x4e6d6a['query'])['then'](respondWithResult(_0x553def,null))['catch'](handleError(_0x553def,null));};exports['agents']=function(_0x2773dc,_0x2ab8d7){var _0x5be976;return respondWithRpcPromise(_0xd231('0x2d'),_0x2773dc['query'])[_0xd231('0x19')](function(_0x257141){_0x5be976=_0x257141;return respondWithRpcPromise('Agents',_0x2773dc[_0xd231('0x18')],routingClient);})[_0xd231('0x19')](function(_0x5055ab){return _[_0xd231('0x1d')]({},_0x5055ab,_0x5be976);})[_0xd231('0x19')](respondWithResult(_0x2ab8d7,null))[_0xd231('0xd')](handleError(_0x2ab8d7,null));};exports['agentCapacity']=function(_0x33f5c2,_0x2ab6fe){if(_0x33f5c2['body']&&_0x33f5c2['body']['interaction']&&_0x33f5c2[_0xd231('0x2e')]&&_0x33f5c2[_0xd231('0x2e')][_0xd231('0x11')]){for(var _0x3ed619 in _0x33f5c2[_0xd231('0x2f')]['interaction']){if(_0x33f5c2[_0xd231('0x2f')][_0xd231('0x30')][_0xd231('0x31')](_0x3ed619)){db[_0xd231('0x32')][_0xd231('0x33')]({'where':{'channel':_0x3ed619,'membername':_0x33f5c2['user'][_0xd231('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x33f5c2[_0xd231('0x2f')]['interaction'][_0x3ed619]&&_0x33f5c2[_0xd231('0x2f')][_0xd231('0x30')][_0x3ed619][_0xd231('0x34')]?{'$notIn':_0x33f5c2[_0xd231('0x2f')]['interaction'][_0x3ed619]}:{'$ne':null}}})['then'](function(_0x1432ff){var _0x3f2643=moment()['format'](_0xd231('0x35'));for(var _0x41b954=0x0,_0x3e96cd=_0x1432ff[_0xd231('0x34')];_0x41b954<_0x3e96cd;_0x41b954+=0x1){_0x1432ff[_0x41b954][_0xd231('0x36')]({'exitAt':_0x3f2643});}});for(var _0xedc966=0x0;_0xedc966<_0x33f5c2[_0xd231('0x2f')][_0xd231('0x30')][_0x3ed619][_0xd231('0x34')];_0xedc966+=0x1){db[_0xd231('0x32')]['findOrCreate']({'where':{'channel':_0x3ed619,'membername':_0x33f5c2[_0xd231('0x2e')]['name'],'type':_0xd231('0x37'),'uniqueid':_0x33f5c2[_0xd231('0x2f')][_0xd231('0x30')][_0x3ed619][_0xedc966],'exitAt':null},'defaults':{'channel':_0x3ed619,'membername':_0x33f5c2[_0xd231('0x2e')][_0xd231('0x11')],'interface':_[_0xd231('0x14')](_0x33f5c2[_0xd231('0x2e')][_0xd231('0x38')])?util[_0xd231('0x39')](_0xd231('0x3a'),_0x33f5c2[_0xd231('0x2e')]['name']):_0x33f5c2[_0xd231('0x2e')][_0xd231('0x38')],'type':_0xd231('0x37'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd231('0x3b'),'internal':_0x33f5c2[_0xd231('0x2e')][_0xd231('0x3c')],'uniqueid':_0x33f5c2[_0xd231('0x2f')][_0xd231('0x30')][_0x3ed619][_0xedc966]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x33f5c2[_0xd231('0x21')]['id'],'capacity':_0x33f5c2[_0xd231('0x2f')][_0xd231('0x3d')]},routingClient)['then'](respondWithResult(_0x2ab6fe,null))[_0xd231('0xd')](handleError(_0x2ab6fe,null));};exports['telephones']=function(_0x577b85,_0x491208){return respondWithRpcPromise(_0xd231('0x3e'),_0x577b85[_0xd231('0x18')])[_0xd231('0x19')](respondWithResult(_0x491208,null))['catch'](handleError(_0x491208,null));};exports[_0xd231('0x3f')]=function(_0x5b4080,_0x511394){return respondWithRpcPromise(_0xd231('0x40'),_0x5b4080['query'])[_0xd231('0x19')](respondWithResult(_0x511394,null))[_0xd231('0xd')](handleError(_0x511394,null));};exports[_0xd231('0x41')]=function(_0x4468d5,_0x2c5642){return respondWithRpcPromise(_0xd231('0x42'),_0x4468d5['query'])['then'](respondWithResult(_0x2c5642,null))[_0xd231('0xd')](handleError(_0x2c5642,null));};exports[_0xd231('0x43')]=function(_0xff09ac,_0x4ae5c1){return respondWithRpcPromise(_0xd231('0x44'),_0xff09ac[_0xd231('0x18')],routingClient)[_0xd231('0x19')](respondWithResult(_0x4ae5c1,null))[_0xd231('0xd')](handleError(_0x4ae5c1,null));};exports['showChatQueues']=function(_0x43c86d,_0x4c92a5){return respondWithRpcPromise('ChatQueues',_0x43c86d[_0xd231('0x18')],routingClient)[_0xd231('0x19')](findById(_0x43c86d[_0xd231('0x21')]['id']))[_0xd231('0x19')](respondWithResult(_0x4c92a5,null))['catch'](handleError(_0x4c92a5,null));};exports[_0xd231('0x45')]=function(_0x16645c,_0x401342){return respondWithRpcPromise(_0xd231('0x46'),_0x16645c[_0xd231('0x18')],routingClient)[_0xd231('0x19')](respondWithResult(_0x401342,null))['catch'](handleError(_0x401342,null));};exports[_0xd231('0x47')]=function(_0x31dff6,_0x430247){return respondWithRpcPromise('MailQueues',_0x31dff6['query'],routingClient)[_0xd231('0x19')](findById(_0x31dff6[_0xd231('0x21')]['id']))[_0xd231('0x19')](respondWithResult(_0x430247,null))['catch'](handleError(_0x430247,null));};exports['mailAccounts']=function(_0x25faa7,_0x52d043){return respondWithRpcPromise(_0xd231('0x48'),_0x25faa7[_0xd231('0x18')],mailClient)[_0xd231('0x19')](respondWithResult(_0x52d043,null))[_0xd231('0xd')](handleError(_0x52d043,null));};exports[_0xd231('0x49')]=function(_0x448a55,_0x17498f){return respondWithRpcPromise('OpenchannelQueues',_0x448a55[_0xd231('0x18')],routingClient)[_0xd231('0x19')](respondWithResult(_0x17498f,null))[_0xd231('0xd')](handleError(_0x17498f,null));};exports[_0xd231('0x4a')]=function(_0x28855a,_0x3af486){return respondWithRpcPromise(_0xd231('0x4b'),_0x28855a[_0xd231('0x18')],routingClient)['then'](findById(_0x28855a[_0xd231('0x21')]['id']))[_0xd231('0x19')](respondWithResult(_0x3af486,null))[_0xd231('0xd')](handleError(_0x3af486,null));};exports[_0xd231('0x4c')]=function(_0xd5dc9c,_0x2c8da3){return respondWithRpcPromise('SmsQueues',_0xd5dc9c['query'],routingClient)[_0xd231('0x19')](respondWithResult(_0x2c8da3,null))[_0xd231('0xd')](handleError(_0x2c8da3,null));};exports[_0xd231('0x4d')]=function(_0x261bcb,_0x57487f){return respondWithRpcPromise('SmsQueues',_0x261bcb['query'],routingClient)['then'](findById(_0x261bcb[_0xd231('0x21')]['id']))['then'](respondWithResult(_0x57487f,null))[_0xd231('0xd')](handleError(_0x57487f,null));};exports[_0xd231('0x4e')]=function(_0x5ed547,_0x5ef478){return respondWithRpcPromise('FaxQueues',_0x5ed547[_0xd231('0x18')],routingClient)[_0xd231('0x19')](respondWithResult(_0x5ef478,null))['catch'](handleError(_0x5ef478,null));};exports[_0xd231('0x4f')]=function(_0x13b783,_0x1d0dcf){return respondWithRpcPromise(_0xd231('0x50'),_0x13b783[_0xd231('0x18')],routingClient)[_0xd231('0x19')](findById(_0x13b783[_0xd231('0x21')]['id']))[_0xd231('0x19')](respondWithResult(_0x1d0dcf,null))[_0xd231('0xd')](handleError(_0x1d0dcf,null));};exports[_0xd231('0x51')]=function(_0xd96177,_0x193440){return respondWithRpcPromise('FaxAccounts',_0xd96177[_0xd231('0x18')])[_0xd231('0x19')](respondWithResult(_0x193440,null))[_0xd231('0xd')](handleError(_0x193440,null));};exports[_0xd231('0x52')]=function(_0x2e6df5,_0x5ebb6d){return respondWithRpcPromise(_0xd231('0x53'),_0x2e6df5[_0xd231('0x18')],routingClient)['then'](respondWithResult(_0x5ebb6d,null))['catch'](handleError(_0x5ebb6d,null));};exports[_0xd231('0x54')]=function(_0x5a0d7a,_0x22e0fb){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x5a0d7a['query'],routingClient)['then'](respondWithResult(_0x22e0fb,null))[_0xd231('0xd')](handleError(_0x22e0fb,null));};exports[_0xd231('0x55')]=function(_0x3a6e98,_0x24cc7f){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x3a6e98[_0xd231('0x18')],routingClient)[_0xd231('0x19')](respondWithResult(_0x24cc7f,null))[_0xd231('0xd')](handleError(_0x24cc7f,null));};exports[_0xd231('0x56')]=function(_0x570d97,_0x12110c){return respondWithRpcPromise(_0xd231('0x57'),_0x570d97[_0xd231('0x18')],routingClient)[_0xd231('0x19')](respondWithResult(_0x12110c,null))['catch'](handleError(_0x12110c,null));};exports[_0xd231('0x58')]=function(_0x11ee11,_0x2748fb){return respondWithRpcPromise(_0xd231('0x59'),_0x11ee11[_0xd231('0x18')],routingClient)[_0xd231('0x19')](respondWithResult(_0x2748fb,null))['catch'](handleError(_0x2748fb,null));};exports[_0xd231('0x5a')]=function(_0xc1b2d3){return function(_0x2a59b0,_0x42bd7f){var _0xb4540f,_0x84f94f;var _0x301301=_[_0xd231('0x5b')](_0xc1b2d3);var _0xed831a=_0xc1b2d3===_0xd231('0x5c')?'Website':_0xd231('0x5d');return db[_0x301301+_0xd231('0x5e')][_0xd231('0x5f')]({'raw':!![],'where':{'id':_0x2a59b0[_0xd231('0x21')]['id']}})[_0xd231('0x19')](function(_0x1dc3b2){if(_[_0xd231('0x14')](_0x1dc3b2)){throw new Error(_0x301301+_0xd231('0x60'));}_0xb4540f=_0x1dc3b2;return db[_0x301301+_0xd231('0x61')]['findOne']({'where':{'id':_0x2a59b0[_0xd231('0x2f')]['messageId']},'include':[{'model':db[_0x301301+_0xd231('0x62')],'as':'Interaction'},{'model':db[_0x301301+_0xed831a],'as':_0xd231('0x5d')}]});})[_0xd231('0x19')](function(_0x4a3300){if(_[_0xd231('0x14')](_0x4a3300)){throw new Error(_0x301301+_0xd231('0x63'));}_0x84f94f=_0x4a3300;return _0x4a3300['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd231('0x19')](function(){var _0x29f683={'uniqueid':_0xc1b2d3+'.'+_0x84f94f['id']+'.'+_0x84f94f['Interaction']['id'],'FromUserId':_0x2a59b0[_0xd231('0x2e')]['id'],'type':_0xd231('0x64')};_0x29f683[_0x301301+_0xd231('0x65')]=_0x84f94f['id'];_0x29f683[_0x301301+_0xd231('0x66')]=_0x84f94f[_0xd231('0x62')]['id'];_0x29f683[_0xd231('0x67')+_0x301301+_0xed831a+'Id']=_0x84f94f[_0xd231('0x5d')]['id'];_0x29f683['To'+_0x301301+_0xd231('0x68')]=_0xb4540f['id'];return db[_0x301301+_0xd231('0x69')]['create'](_0x29f683);})[_0xd231('0x19')](function(){return respondWithRpcPromise(_0xd231('0x6a'),{'channel':_0xc1b2d3,'interaction':_0x84f94f[_0xd231('0x62')],'message':_0x84f94f,'account':_0x84f94f[_0xd231('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0xb4540f[_0xd231('0x11')]+','+(_0x84f94f[_0xd231('0x5d')][_0xd231('0x6b')]||0x12c),'interval':_0xd231('0x6c')}]},routingClient);})[_0xd231('0x19')](respondWithResult(_0x42bd7f,null))[_0xd231('0xd')](handleError(_0x42bd7f,null));};};exports[_0xd231('0x6d')]=function(_0x12fff9,_0x4fa24a){var _0x56e9df,_0x2990d6;if(_[_0xd231('0x14')](_0x12fff9[_0xd231('0x2f')][_0xd231('0x6e')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x242a81=_0x12fff9[_0xd231('0x2f')]['channel'];var _0xfbd790=_[_0xd231('0x5b')](_0x242a81);var _0x46388c=_0x242a81==='chat'?_0xd231('0x6f'):_0xd231('0x5d');return db[_0xd231('0x70')][_0xd231('0x5f')]({'raw':!![],'where':{'id':_0x12fff9[_0xd231('0x21')]['id'],'role':_0xd231('0x3b')}})[_0xd231('0x19')](function(_0x5d7b0a){if(_[_0xd231('0x14')](_0x5d7b0a)){throw new Error(_0xd231('0x71'));}_0x56e9df=_0x5d7b0a;return db[_0xfbd790+_0xd231('0x61')][_0xd231('0x5f')]({'where':{'id':_0x12fff9[_0xd231('0x2f')][_0xd231('0x72')]},'include':[{'model':db[_0xfbd790+_0xd231('0x62')],'as':_0xd231('0x62')},{'model':db[_0xfbd790+_0x46388c],'as':_0xd231('0x5d')}]});})['then'](function(_0x1e7283){if(_[_0xd231('0x14')](_0x1e7283)){throw new Error(_0xfbd790+_0xd231('0x63'));}_0x2990d6=_0x1e7283;return _0x1e7283[_0xd231('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd231('0x19')](function(){var _0x118af5={'uniqueid':_0x242a81+'.'+_0x2990d6['id']+'.'+_0x2990d6[_0xd231('0x62')]['id'],'FromUserId':_0x12fff9['user']['id'],'type':_0xd231('0x64'),'ToUserId':_0x56e9df['id']};_0x118af5[_0xfbd790+_0xd231('0x65')]=_0x2990d6['id'];_0x118af5[_0xfbd790+_0xd231('0x66')]=_0x2990d6['Interaction']['id'];_0x118af5[_0xd231('0x67')+_0xfbd790+_0x46388c+'Id']=_0x2990d6[_0xd231('0x5d')]['id'];return db[_0xfbd790+_0xd231('0x69')][_0xd231('0x74')](_0x118af5);})['then'](function(){return respondWithRpcPromise(_0xd231('0x6a'),{'channel':_0x242a81,'interaction':_0x2990d6[_0xd231('0x62')],'message':_0x2990d6,'account':_0x2990d6[_0xd231('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x56e9df[_0xd231('0x11')]+','+(_0x2990d6[_0xd231('0x5d')][_0xd231('0x75')]||0x12c),'interval':_0xd231('0x6c')}]},routingClient);})[_0xd231('0x19')](respondWithResult(_0x4fa24a,null))['catch'](handleError(_0x4fa24a,null));};
\ No newline at end of file
diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js
index c70f20d..489cf98 100644
--- a/server/api/schedule/index.js
+++ b/server/api/schedule/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0594=['delete','exports','multer','express','Router','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/run','run','post','create','put','update'];(function(_0x4e18f8,_0x2c4615){var _0x767833=function(_0x5ae39d){while(--_0x5ae39d){_0x4e18f8['push'](_0x4e18f8['shift']());}};_0x767833(++_0x2c4615);}(_0x0594,0x112));var _0x4059=function(_0x42f5ee,_0x1e7c45){_0x42f5ee=_0x42f5ee-0x0;var _0x55b4ba=_0x0594[_0x42f5ee];return _0x55b4ba;};'use strict';var multer=require(_0x4059('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4059('0x1'));var router=express[_0x4059('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x4059('0x3'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0x4059('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4059('0x4')](_0x4059('0x5'),auth[_0x4059('0x6')](),controller[_0x4059('0x7')]);router[_0x4059('0x4')](_0x4059('0x8'),auth[_0x4059('0x6')](),controller[_0x4059('0x9')]);router[_0x4059('0xa')]('/',auth[_0x4059('0x6')](),controller[_0x4059('0xb')]);router[_0x4059('0xc')](_0x4059('0x5'),auth['isAuthenticated'](),controller[_0x4059('0xd')]);router[_0x4059('0xe')](_0x4059('0x5'),auth[_0x4059('0x6')](),controller['destroy']);module[_0x4059('0xf')]=router;
\ No newline at end of file
+var _0xb70a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','post','create','put','update','delete','destroy','multer','util','path'];(function(_0x5c4235,_0x426a46){var _0x60b1c5=function(_0xabd743){while(--_0xabd743){_0x5c4235['push'](_0x5c4235['shift']());}};_0x60b1c5(++_0x426a46);}(_0xb70a,0xe4));var _0xab70=function(_0x2ae811,_0x211f9b){_0x2ae811=_0x2ae811-0x0;var _0x55ba53=_0xb70a[_0x2ae811];return _0x55ba53;};'use strict';var multer=require(_0xab70('0x0'));var util=require(_0xab70('0x1'));var path=require(_0xab70('0x2'));var timeout=require(_0xab70('0x3'));var express=require(_0xab70('0x4'));var router=express[_0xab70('0x5')]();var auth=require(_0xab70('0x6'));var interaction=require(_0xab70('0x7'));var config=require('../../config/environment');var controller=require(_0xab70('0x8'));router[_0xab70('0x9')]('/',auth['isAuthenticated'](),controller[_0xab70('0xa')]);router['get'](_0xab70('0xb'),auth[_0xab70('0xc')](),controller[_0xab70('0xd')]);router[_0xab70('0x9')](_0xab70('0xe'),auth[_0xab70('0xc')](),controller['run']);router[_0xab70('0xf')]('/',auth['isAuthenticated'](),controller[_0xab70('0x10')]);router[_0xab70('0x11')](_0xab70('0xb'),auth['isAuthenticated'](),controller[_0xab70('0x12')]);router[_0xab70('0x13')](_0xab70('0xb'),auth[_0xab70('0xc')](),controller[_0xab70('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js
index 4b6ed90..c33368f 100644
--- a/server/api/schedule/schedule.attributes.js
+++ b/server/api/schedule/schedule.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9afb=['xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','csv','pdf'];(function(_0x363e6c,_0x17ff9c){var _0x30f48a=function(_0x166b2e){while(--_0x166b2e){_0x363e6c['push'](_0x363e6c['shift']());}};_0x30f48a(++_0x17ff9c);}(_0x9afb,0x130));var _0xb9af=function(_0x135a1c,_0x28b5f6){_0x135a1c=_0x135a1c-0x0;var _0x295c98=_0x9afb[_0x135a1c];return _0x295c98;};'use strict';var Sequelize=require(_0xb9af('0x0'));module[_0xb9af('0x1')]={'name':{'type':Sequelize[_0xb9af('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xb9af('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb9af('0x4')},'startAt':{'type':Sequelize[_0xb9af('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xb9af('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb9af('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb9af('0x7')](_0xb9af('0x8'),_0xb9af('0x9'),_0xb9af('0xa'),_0xb9af('0xb'),_0xb9af('0xc'),_0xb9af('0xd'),'minutes'),'allowNull':![],'defaultValue':_0xb9af('0xc')},'output':{'type':Sequelize[_0xb9af('0x7')](_0xb9af('0xe'),_0xb9af('0xf'),_0xb9af('0x10')),'allowNull':![],'defaultValue':_0xb9af('0xe')},'type':{'type':Sequelize['ENUM'](_0xb9af('0x11'),_0xb9af('0x12')),'allowNull':![],'defaultValue':_0xb9af('0x11')},'sendMail':{'type':Sequelize[_0xb9af('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xb9af('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xb9af('0x13')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x5cd7=['hours','pdf','xlsx','csv','custom','default','TEXT','BOOLEAN','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','years','quarters','weeks','days'];(function(_0x10acb2,_0x3ca870){var _0x186379=function(_0x294bbd){while(--_0x294bbd){_0x10acb2['push'](_0x10acb2['shift']());}};_0x186379(++_0x3ca870);}(_0x5cd7,0xf6));var _0x75cd=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0x5cd7[_0x2142c8];return _0x4286e9;};'use strict';var Sequelize=require(_0x75cd('0x0'));module[_0x75cd('0x1')]={'name':{'type':Sequelize[_0x75cd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x75cd('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x75cd('0x2')],'allowNull':![],'defaultValue':_0x75cd('0x3')},'startAt':{'type':Sequelize[_0x75cd('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x75cd('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x75cd('0x5'),_0x75cd('0x6'),'months',_0x75cd('0x7'),_0x75cd('0x8'),_0x75cd('0x9'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM']('csv',_0x75cd('0xa'),_0x75cd('0xb')),'allowNull':![],'defaultValue':_0x75cd('0xc')},'type':{'type':Sequelize['ENUM'](_0x75cd('0xd'),_0x75cd('0xe')),'allowNull':![],'defaultValue':_0x75cd('0xd')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x75cd('0x2')]},'cc':{'type':Sequelize[_0x75cd('0xf')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x75cd('0x10')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js
index b2b4d80..51ccab0 100644
--- a/server/api/schedule/schedule.controller.js
+++ b/server/api/schedule/schedule.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x397f=['field','merge','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','end','sendStatus','stack','name','send','index','Schedule','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL'];(function(_0xa9a28e,_0x2f74d2){var _0x1dc04c=function(_0x59d770){while(--_0x59d770){_0xa9a28e['push'](_0xa9a28e['shift']());}};_0x1dc04c(++_0x2f74d2);}(_0x397f,0x11d));var _0xf397=function(_0x407bac,_0x556c3f){_0x407bac=_0x407bac-0x0;var _0x133a07=_0x397f[_0x407bac];return _0x133a07;};'use strict';var pdf=require(_0xf397('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf397('0x1'));var zipdir=require(_0xf397('0x2'));var jsonpatch=require(_0xf397('0x3'));var rp=require(_0xf397('0x4'));var moment=require('moment');var BPromise=require(_0xf397('0x5'));var Mustache=require(_0xf397('0x6'));var util=require(_0xf397('0x7'));var path=require(_0xf397('0x8'));var sox=require('sox');var csv=require(_0xf397('0x9'));var ejs=require(_0xf397('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf397('0xb'));var crypto=require(_0xf397('0xc'));var jsforce=require(_0xf397('0xd'));var deskjs=require(_0xf397('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf397('0xf'));var Redis=require(_0xf397('0x10'));var authService=require(_0xf397('0x11'));var qs=require(_0xf397('0x12'));var hardwareService=require(_0xf397('0x13'));var logger=require(_0xf397('0x14'))(_0xf397('0x15'));var utils=require(_0xf397('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21b459,_0x1c1ea8){_0x1c1ea8=_0x1c1ea8||0xcc;return function(_0x5957db){if(_0x5957db){return _0x21b459['sendStatus'](_0x1c1ea8);}return _0x21b459[_0xf397('0x17')](_0x1c1ea8)['end']();};}function respondWithResult(_0x212ec1,_0x421df3){_0x421df3=_0x421df3||0xc8;return function(_0x562aba){if(_0x562aba){return _0x212ec1[_0xf397('0x17')](_0x421df3)[_0xf397('0x18')](_0x562aba);}};}function respondWithFilteredResult(_0x11e8d5,_0x4e3f6a){return function(_0x5cf555){if(_0x5cf555){var _0x143dc0=_0x5cf555['count'],_0xafd5e1=_0x4e3f6a[_0xf397('0x19')],_0x479cb9=_0x4e3f6a['offset']+_0x4e3f6a[_0xf397('0x1a')],_0x139611;if(_0x479cb9>=_0x143dc0){_0x479cb9=_0x143dc0;_0x139611=0xc8;}else{_0x139611=0xce;}_0x11e8d5['status'](_0x139611);return _0x11e8d5[_0xf397('0x1b')](_0xf397('0x1c'),_0xafd5e1+'-'+_0x479cb9+'/'+_0x143dc0)['json'](_0x5cf555);}return null;};}function patchUpdates(_0x33ca74){return function(_0x5363f0){try{jsonpatch[_0xf397('0x1d')](_0x5363f0,_0x33ca74,!![]);}catch(_0x66a78){return BPromise[_0xf397('0x1e')](_0x66a78);}return _0x5363f0[_0xf397('0x1f')]();};}function saveUpdates(_0x453bc8,_0x34e0d8){return function(_0x4b85ce){if(_0x4b85ce){return _0x4b85ce[_0xf397('0x20')](_0x453bc8)[_0xf397('0x21')](function(_0x2ec5b0){return _0x2ec5b0;});}return null;};}function removeEntity(_0x4bb7d0,_0xdd0ded){return function(_0x3cda2c){if(_0x3cda2c){return _0x3cda2c[_0xf397('0x22')]()[_0xf397('0x21')](function(){var _0x214e4e=_0x3cda2c[_0xf397('0x23')]({'plain':!![]});var _0x5a0e83=_0xf397('0x24');return db['UserProfileResource'][_0xf397('0x22')]({'where':{'type':_0x5a0e83,'resourceId':_0x214e4e['id']}})['then'](function(){return _0x3cda2c;});})['then'](function(){_0x4bb7d0['status'](0xcc)[_0xf397('0x25')]();});}};}function handleEntityNotFound(_0x4e6980,_0x57bfea){return function(_0x1bc649){if(!_0x1bc649){_0x4e6980[_0xf397('0x26')](0x194);}return _0x1bc649;};}function handleError(_0xcbc09b,_0x2c553a){_0x2c553a=_0x2c553a||0x1f4;return function(_0x3d17f6){logger['error'](_0x3d17f6[_0xf397('0x27')]);if(_0x3d17f6[_0xf397('0x28')]){delete _0x3d17f6[_0xf397('0x28')];}_0xcbc09b[_0xf397('0x17')](_0x2c553a)[_0xf397('0x29')](_0x3d17f6);};}exports[_0xf397('0x2a')]=function(_0x3a7a3d,_0x10fff1){var _0x2d0209={},_0x173285={},_0x4c728e={'count':0x0,'rows':[]};var _0x5c02b8=db[_0xf397('0x2b')][_0xf397('0x2c')];_0x173285[_0xf397('0x2d')]=_['keys'](_0x5c02b8);_0x173285[_0xf397('0x2e')]=_[_0xf397('0x2f')](_0x3a7a3d[_0xf397('0x2e')]);_0x173285[_0xf397('0x30')]=_['intersection'](_0x173285['model'],_0x173285['query']);_0x2d0209[_0xf397('0x31')]=_[_0xf397('0x32')](_0x173285[_0xf397('0x2d')],qs[_0xf397('0x33')](_0x3a7a3d[_0xf397('0x2e')][_0xf397('0x33')]));_0x2d0209[_0xf397('0x31')]=_0x2d0209['attributes'][_0xf397('0x34')]?_0x2d0209['attributes']:_0x173285[_0xf397('0x2d')];if(!_0x3a7a3d[_0xf397('0x2e')][_0xf397('0x35')](_0xf397('0x36'))){_0x2d0209['limit']=qs[_0xf397('0x1a')](_0x3a7a3d['query'][_0xf397('0x1a')]);_0x2d0209['offset']=qs['offset'](_0x3a7a3d[_0xf397('0x2e')][_0xf397('0x19')]);}_0x2d0209[_0xf397('0x37')]=qs[_0xf397('0x38')](_0x3a7a3d[_0xf397('0x2e')]['sort']);_0x2d0209[_0xf397('0x39')]=qs[_0xf397('0x30')](_[_0xf397('0x3a')](_0x3a7a3d[_0xf397('0x2e')],_0x173285[_0xf397('0x30')]));if(_0x3a7a3d[_0xf397('0x2e')][_0xf397('0x3b')]){_0x2d0209[_0xf397('0x39')]=_['merge'](_0x2d0209[_0xf397('0x39')],{'$or':_[_0xf397('0x3c')](_0x5c02b8,function(_0x408413){if(_0x408413[_0xf397('0x3d')]['key']!==_0xf397('0x3e')){var _0x4cdc9c={};_0x4cdc9c[_0x408413[_0xf397('0x3f')]]={'$like':'%'+_0x3a7a3d['query'][_0xf397('0x3b')]+'%'};return _0x4cdc9c;}})});}_0x2d0209=_[_0xf397('0x40')]({},_0x2d0209,_0x3a7a3d[_0xf397('0x41')]);var _0x22429d={'where':_0x2d0209['where']};return db[_0xf397('0x2b')][_0xf397('0x42')](_0x22429d)['then'](function(_0x29630a){_0x4c728e[_0xf397('0x42')]=_0x29630a;if(_0x3a7a3d[_0xf397('0x2e')]['includeAll']){_0x2d0209[_0xf397('0x43')]=[{'all':!![]}];}return db[_0xf397('0x2b')][_0xf397('0x44')](_0x2d0209);})[_0xf397('0x21')](function(_0x412e42){_0x4c728e[_0xf397('0x45')]=_0x412e42;return _0x4c728e;})[_0xf397('0x21')](respondWithFilteredResult(_0x10fff1,_0x2d0209))[_0xf397('0x46')](handleError(_0x10fff1,null));};exports[_0xf397('0x47')]=function(_0x3bf244,_0x2076b9){var _0x407ea0={'raw':![],'where':{'id':_0x3bf244[_0xf397('0x48')]['id']}},_0x2171bb={};_0x2171bb[_0xf397('0x2d')]=_['keys'](db['Schedule'][_0xf397('0x2c')]);_0x2171bb[_0xf397('0x2e')]=_[_0xf397('0x2f')](_0x3bf244[_0xf397('0x2e')]);_0x2171bb[_0xf397('0x30')]=_[_0xf397('0x32')](_0x2171bb[_0xf397('0x2d')],_0x2171bb[_0xf397('0x2e')]);_0x407ea0[_0xf397('0x31')]=_[_0xf397('0x32')](_0x2171bb[_0xf397('0x2d')],qs[_0xf397('0x33')](_0x3bf244['query'][_0xf397('0x33')]));_0x407ea0[_0xf397('0x31')]=_0x407ea0[_0xf397('0x31')][_0xf397('0x34')]?_0x407ea0['attributes']:_0x2171bb[_0xf397('0x2d')];if(_0x3bf244[_0xf397('0x2e')][_0xf397('0x49')]){_0x407ea0[_0xf397('0x43')]=[{'all':!![]}];}_0x407ea0=_['merge']({},_0x407ea0,_0x3bf244[_0xf397('0x41')]);return db[_0xf397('0x2b')][_0xf397('0x4a')](_0x407ea0)[_0xf397('0x21')](handleEntityNotFound(_0x2076b9,null))[_0xf397('0x21')](respondWithResult(_0x2076b9,null))['catch'](handleError(_0x2076b9,null));};exports[_0xf397('0x4b')]=function(_0x2677c2,_0x5c29cd){return db[_0xf397('0x2b')][_0xf397('0x4b')](_0x2677c2[_0xf397('0x4c')],{})['then'](function(_0x226721){var _0x377db8=_0x2677c2[_0xf397('0x4d')]['get']({'plain':!![]});if(!_0x377db8)throw new Error(_0xf397('0x4e'));if(_0x377db8[_0xf397('0x4f')]===_0xf397('0x4d')){var _0x259cb6=_0x226721[_0xf397('0x23')]({'plain':!![]});var _0x337c52=_0xf397('0x24');return db[_0xf397('0x50')][_0xf397('0x4a')]({'where':{'name':_0x337c52,'userProfileId':_0x377db8[_0xf397('0x51')]},'raw':!![]})[_0xf397('0x21')](function(_0x5048be){if(_0x5048be&&_0x5048be[_0xf397('0x52')]===0x0){return db[_0xf397('0x53')][_0xf397('0x4b')]({'name':_0x259cb6[_0xf397('0x28')],'resourceId':_0x259cb6['id'],'type':_0x5048be[_0xf397('0x28')],'sectionId':_0x5048be['id']},{})[_0xf397('0x21')](function(){return _0x226721;});}else{return _0x226721;}})[_0xf397('0x46')](function(_0x238c68){logger[_0xf397('0x54')](_0xf397('0x55'),_0x238c68);throw _0x238c68;});}return _0x226721;})[_0xf397('0x21')](respondWithResult(_0x5c29cd,0xc9))[_0xf397('0x46')](handleError(_0x5c29cd,null));};exports[_0xf397('0x20')]=function(_0x489e38,_0xbda52a){if(_0x489e38['body']['id']){delete _0x489e38['body']['id'];}return db[_0xf397('0x2b')][_0xf397('0x4a')]({'where':{'id':_0x489e38[_0xf397('0x48')]['id']}})[_0xf397('0x21')](handleEntityNotFound(_0xbda52a,null))[_0xf397('0x21')](saveUpdates(_0x489e38[_0xf397('0x4c')],null))[_0xf397('0x21')](respondWithResult(_0xbda52a,null))[_0xf397('0x46')](handleError(_0xbda52a,null));};exports[_0xf397('0x22')]=function(_0x5273da,_0x5d06d4){return db['Schedule'][_0xf397('0x4a')]({'where':{'id':_0x5273da[_0xf397('0x48')]['id']}})[_0xf397('0x21')](handleEntityNotFound(_0x5d06d4,null))[_0xf397('0x21')](removeEntity(_0x5d06d4,null))[_0xf397('0x46')](handleError(_0x5d06d4,null));};exports['run']=function(_0xa75d6e,_0x20ef64,_0x5ced03){var _0x3f4b7b=require(_0xf397('0x56'));return db[_0xf397('0x2b')][_0xf397('0x4a')]({'where':{'id':_0xa75d6e[_0xf397('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x20ef64,null))[_0xf397('0x21')](function(){_0x3f4b7b['run'](_0xa75d6e[_0xf397('0x48')]['id']);})['then'](respondWithStatusCode(_0x20ef64,null))['catch'](handleError(_0x20ef64,null));};
\ No newline at end of file
+var _0xab67=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','end','json','count','offset','limit','status','set','save','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','keys','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','Schedule','includeAll','findAll','rows','catch','params','rawAttributes','include','options','find','create','body','user','role','Scheduler','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel'];(function(_0x184cb4,_0x5c74af){var _0x2dd241=function(_0x3ff98e){while(--_0x3ff98e){_0x184cb4['push'](_0x184cb4['shift']());}};_0x2dd241(++_0x5c74af);}(_0xab67,0x132));var _0x7ab6=function(_0x51af96,_0x42104c){_0x51af96=_0x51af96-0x0;var _0x2bb16b=_0xab67[_0x51af96];return _0x2bb16b;};'use strict';var pdf=require(_0x7ab6('0x0'));var emlformat=require(_0x7ab6('0x1'));var rimraf=require(_0x7ab6('0x2'));var zipdir=require(_0x7ab6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ab6('0x4'));var moment=require(_0x7ab6('0x5'));var BPromise=require(_0x7ab6('0x6'));var Mustache=require(_0x7ab6('0x7'));var util=require(_0x7ab6('0x8'));var path=require(_0x7ab6('0x9'));var sox=require(_0x7ab6('0xa'));var csv=require(_0x7ab6('0xb'));var ejs=require(_0x7ab6('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7ab6('0xd'));var crypto=require(_0x7ab6('0xe'));var jsforce=require(_0x7ab6('0xf'));var deskjs=require(_0x7ab6('0x10'));var toCsv=require(_0x7ab6('0xb'));var querystring=require(_0x7ab6('0x11'));var Papa=require(_0x7ab6('0x12'));var Redis=require(_0x7ab6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7ab6('0x14'));var hardwareService=require(_0x7ab6('0x15'));var logger=require(_0x7ab6('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x7ab6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x490789,_0x4bc138){_0x4bc138=_0x4bc138||0xcc;return function(_0x26611f){if(_0x26611f){return _0x490789['sendStatus'](_0x4bc138);}return _0x490789['status'](_0x4bc138)[_0x7ab6('0x18')]();};}function respondWithResult(_0x1be7a9,_0x10e4df){_0x10e4df=_0x10e4df||0xc8;return function(_0x285d25){if(_0x285d25){return _0x1be7a9['status'](_0x10e4df)[_0x7ab6('0x19')](_0x285d25);}};}function respondWithFilteredResult(_0x5b31c9,_0x2a1e83){return function(_0x5a0f15){if(_0x5a0f15){var _0x2ad88a=_0x5a0f15[_0x7ab6('0x1a')],_0x33ebbe=_0x2a1e83[_0x7ab6('0x1b')],_0x2b797d=_0x2a1e83[_0x7ab6('0x1b')]+_0x2a1e83[_0x7ab6('0x1c')],_0x4b040e;if(_0x2b797d>=_0x2ad88a){_0x2b797d=_0x2ad88a;_0x4b040e=0xc8;}else{_0x4b040e=0xce;}_0x5b31c9[_0x7ab6('0x1d')](_0x4b040e);return _0x5b31c9[_0x7ab6('0x1e')]('Content-Range',_0x33ebbe+'-'+_0x2b797d+'/'+_0x2ad88a)[_0x7ab6('0x19')](_0x5a0f15);}return null;};}function patchUpdates(_0x151548){return function(_0x25ff25){try{jsonpatch['apply'](_0x25ff25,_0x151548,!![]);}catch(_0x318aff){return BPromise['reject'](_0x318aff);}return _0x25ff25[_0x7ab6('0x1f')]();};}function saveUpdates(_0x1042a0,_0x413fd8){return function(_0x3f91ca){if(_0x3f91ca){return _0x3f91ca['update'](_0x1042a0)[_0x7ab6('0x20')](function(_0x1df73a){return _0x1df73a;});}return null;};}function removeEntity(_0x1e8f32,_0x1a76c2){return function(_0x2c1857){if(_0x2c1857){return _0x2c1857[_0x7ab6('0x21')]()[_0x7ab6('0x20')](function(){var _0xa1dcea=_0x2c1857[_0x7ab6('0x22')]({'plain':!![]});var _0x2a7b35='Scheduler';return db[_0x7ab6('0x23')][_0x7ab6('0x21')]({'where':{'type':_0x2a7b35,'resourceId':_0xa1dcea['id']}})[_0x7ab6('0x20')](function(){return _0x2c1857;});})[_0x7ab6('0x20')](function(){_0x1e8f32[_0x7ab6('0x1d')](0xcc)[_0x7ab6('0x18')]();});}};}function handleEntityNotFound(_0x21fce0,_0x416503){return function(_0x50e94f){if(!_0x50e94f){_0x21fce0[_0x7ab6('0x24')](0x194);}return _0x50e94f;};}function handleError(_0x4d44f6,_0x32fff5){_0x32fff5=_0x32fff5||0x1f4;return function(_0x18f142){logger[_0x7ab6('0x25')](_0x18f142[_0x7ab6('0x26')]);if(_0x18f142[_0x7ab6('0x27')]){delete _0x18f142[_0x7ab6('0x27')];}_0x4d44f6[_0x7ab6('0x1d')](_0x32fff5)['send'](_0x18f142);};}exports[_0x7ab6('0x28')]=function(_0x428c50,_0x5a1724){var _0x59cd9b={},_0x2bf995={},_0x41029d={'count':0x0,'rows':[]};var _0x30d5a5=db['Schedule']['rawAttributes'];_0x2bf995['model']=_[_0x7ab6('0x29')](_0x30d5a5);_0x2bf995[_0x7ab6('0x2a')]=_['keys'](_0x428c50[_0x7ab6('0x2a')]);_0x2bf995[_0x7ab6('0x2b')]=_[_0x7ab6('0x2c')](_0x2bf995[_0x7ab6('0x2d')],_0x2bf995[_0x7ab6('0x2a')]);_0x59cd9b['attributes']=_[_0x7ab6('0x2c')](_0x2bf995['model'],qs[_0x7ab6('0x2e')](_0x428c50['query'][_0x7ab6('0x2e')]));_0x59cd9b[_0x7ab6('0x2f')]=_0x59cd9b[_0x7ab6('0x2f')][_0x7ab6('0x30')]?_0x59cd9b['attributes']:_0x2bf995['model'];if(!_0x428c50[_0x7ab6('0x2a')]['hasOwnProperty']('nolimit')){_0x59cd9b[_0x7ab6('0x1c')]=qs[_0x7ab6('0x1c')](_0x428c50[_0x7ab6('0x2a')][_0x7ab6('0x1c')]);_0x59cd9b[_0x7ab6('0x1b')]=qs[_0x7ab6('0x1b')](_0x428c50[_0x7ab6('0x2a')][_0x7ab6('0x1b')]);}_0x59cd9b[_0x7ab6('0x31')]=qs[_0x7ab6('0x32')](_0x428c50[_0x7ab6('0x2a')][_0x7ab6('0x32')]);_0x59cd9b[_0x7ab6('0x33')]=qs[_0x7ab6('0x2b')](_[_0x7ab6('0x34')](_0x428c50[_0x7ab6('0x2a')],_0x2bf995[_0x7ab6('0x2b')]));if(_0x428c50['query'][_0x7ab6('0x35')]){_0x59cd9b[_0x7ab6('0x33')]=_[_0x7ab6('0x36')](_0x59cd9b['where'],{'$or':_[_0x7ab6('0x37')](_0x30d5a5,function(_0x357307){if(_0x357307[_0x7ab6('0x38')][_0x7ab6('0x39')]!==_0x7ab6('0x3a')){var _0x44ef69={};_0x44ef69[_0x357307[_0x7ab6('0x3b')]]={'$like':'%'+_0x428c50['query'][_0x7ab6('0x35')]+'%'};return _0x44ef69;}})});}_0x59cd9b=_[_0x7ab6('0x36')]({},_0x59cd9b,_0x428c50['options']);var _0x20ed68={'where':_0x59cd9b[_0x7ab6('0x33')]};return db[_0x7ab6('0x3c')][_0x7ab6('0x1a')](_0x20ed68)[_0x7ab6('0x20')](function(_0x182458){_0x41029d[_0x7ab6('0x1a')]=_0x182458;if(_0x428c50['query'][_0x7ab6('0x3d')]){_0x59cd9b['include']=[{'all':!![]}];}return db[_0x7ab6('0x3c')][_0x7ab6('0x3e')](_0x59cd9b);})[_0x7ab6('0x20')](function(_0x4ae1e2){_0x41029d[_0x7ab6('0x3f')]=_0x4ae1e2;return _0x41029d;})[_0x7ab6('0x20')](respondWithFilteredResult(_0x5a1724,_0x59cd9b))[_0x7ab6('0x40')](handleError(_0x5a1724,null));};exports['show']=function(_0x5bfe7d,_0x5a597b){var _0x34f168={'raw':![],'where':{'id':_0x5bfe7d[_0x7ab6('0x41')]['id']}},_0x26dc75={};_0x26dc75[_0x7ab6('0x2d')]=_[_0x7ab6('0x29')](db[_0x7ab6('0x3c')][_0x7ab6('0x42')]);_0x26dc75[_0x7ab6('0x2a')]=_['keys'](_0x5bfe7d[_0x7ab6('0x2a')]);_0x26dc75['filters']=_[_0x7ab6('0x2c')](_0x26dc75[_0x7ab6('0x2d')],_0x26dc75[_0x7ab6('0x2a')]);_0x34f168['attributes']=_[_0x7ab6('0x2c')](_0x26dc75[_0x7ab6('0x2d')],qs[_0x7ab6('0x2e')](_0x5bfe7d['query'][_0x7ab6('0x2e')]));_0x34f168[_0x7ab6('0x2f')]=_0x34f168['attributes'][_0x7ab6('0x30')]?_0x34f168[_0x7ab6('0x2f')]:_0x26dc75[_0x7ab6('0x2d')];if(_0x5bfe7d[_0x7ab6('0x2a')][_0x7ab6('0x3d')]){_0x34f168[_0x7ab6('0x43')]=[{'all':!![]}];}_0x34f168=_[_0x7ab6('0x36')]({},_0x34f168,_0x5bfe7d[_0x7ab6('0x44')]);return db[_0x7ab6('0x3c')][_0x7ab6('0x45')](_0x34f168)['then'](handleEntityNotFound(_0x5a597b,null))[_0x7ab6('0x20')](respondWithResult(_0x5a597b,null))[_0x7ab6('0x40')](handleError(_0x5a597b,null));};exports[_0x7ab6('0x46')]=function(_0x5af42c,_0x3e3d99){return db[_0x7ab6('0x3c')]['create'](_0x5af42c[_0x7ab6('0x47')],{})[_0x7ab6('0x20')](function(_0x2fb657){var _0x21d949=_0x5af42c[_0x7ab6('0x48')][_0x7ab6('0x22')]({'plain':!![]});if(!_0x21d949)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21d949[_0x7ab6('0x49')]==='user'){var _0x410fa2=_0x2fb657[_0x7ab6('0x22')]({'plain':!![]});var _0x5dd61b=_0x7ab6('0x4a');return db['UserProfileSection'][_0x7ab6('0x45')]({'where':{'name':_0x5dd61b,'userProfileId':_0x21d949[_0x7ab6('0x4b')]},'raw':!![]})[_0x7ab6('0x20')](function(_0x57ca02){if(_0x57ca02&&_0x57ca02[_0x7ab6('0x4c')]===0x0){return db[_0x7ab6('0x23')][_0x7ab6('0x46')]({'name':_0x410fa2[_0x7ab6('0x27')],'resourceId':_0x410fa2['id'],'type':_0x57ca02['name'],'sectionId':_0x57ca02['id']},{})[_0x7ab6('0x20')](function(){return _0x2fb657;});}else{return _0x2fb657;}})[_0x7ab6('0x40')](function(_0x14a077){logger[_0x7ab6('0x25')](_0x7ab6('0x4d'),_0x14a077);throw _0x14a077;});}return _0x2fb657;})[_0x7ab6('0x20')](respondWithResult(_0x3e3d99,0xc9))[_0x7ab6('0x40')](handleError(_0x3e3d99,null));};exports[_0x7ab6('0x4e')]=function(_0x2df8cc,_0x131ee2){if(_0x2df8cc['body']['id']){delete _0x2df8cc[_0x7ab6('0x47')]['id'];}return db[_0x7ab6('0x3c')][_0x7ab6('0x45')]({'where':{'id':_0x2df8cc['params']['id']}})['then'](handleEntityNotFound(_0x131ee2,null))['then'](saveUpdates(_0x2df8cc[_0x7ab6('0x47')],null))[_0x7ab6('0x20')](respondWithResult(_0x131ee2,null))[_0x7ab6('0x40')](handleError(_0x131ee2,null));};exports[_0x7ab6('0x21')]=function(_0x2e0922,_0x489325){return db[_0x7ab6('0x3c')][_0x7ab6('0x45')]({'where':{'id':_0x2e0922[_0x7ab6('0x41')]['id']}})[_0x7ab6('0x20')](handleEntityNotFound(_0x489325,null))['then'](removeEntity(_0x489325,null))[_0x7ab6('0x40')](handleError(_0x489325,null));};exports[_0x7ab6('0x4f')]=function(_0x244253,_0x34ffe2,_0x19d0b7){var _0x6abf71=require('../../config/schedule');return db[_0x7ab6('0x3c')][_0x7ab6('0x45')]({'where':{'id':_0x244253[_0x7ab6('0x41')]['id']},'raw':!![]})[_0x7ab6('0x20')](handleEntityNotFound(_0x34ffe2,null))['then'](function(){_0x6abf71[_0x7ab6('0x4f')](_0x244253[_0x7ab6('0x41')]['id']);})[_0x7ab6('0x20')](respondWithStatusCode(_0x34ffe2,null))[_0x7ab6('0x40')](handleError(_0x34ffe2,null));};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js
index c2ede58..9c78ecd 100644
--- a/server/api/schedule/schedule.model.js
+++ b/server/api/schedule/schedule.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2c5b=['Schedule','tools_schedules','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define'];(function(_0x4ed7c6,_0x4715fe){var _0x18a7e4=function(_0xfb57b0){while(--_0xfb57b0){_0x4ed7c6['push'](_0x4ed7c6['shift']());}};_0x18a7e4(++_0x4715fe);}(_0x2c5b,0xd2));var _0xb2c5=function(_0x20fb9e,_0x5f66bb){_0x20fb9e=_0x20fb9e-0x0;var _0x19b17a=_0x2c5b[_0x20fb9e];return _0x19b17a;};'use strict';var _=require('lodash');var util=require(_0xb2c5('0x0'));var logger=require(_0xb2c5('0x1'))(_0xb2c5('0x2'));var moment=require(_0xb2c5('0x3'));var BPromise=require(_0xb2c5('0x4'));var rp=require(_0xb2c5('0x5'));var fs=require('fs');var path=require(_0xb2c5('0x6'));var rimraf=require(_0xb2c5('0x7'));var config=require('../../config/environment');var attributes=require(_0xb2c5('0x8'));module[_0xb2c5('0x9')]=function(_0x1d7470,_0xad49b8){return _0x1d7470[_0xb2c5('0xa')](_0xb2c5('0xb'),attributes,{'tableName':_0xb2c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd832=['api','bluebird','request-promise','path','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0x4fda88,_0x1a4d19){var _0xe37511=function(_0x51f461){while(--_0x51f461){_0x4fda88['push'](_0x4fda88['shift']());}};_0xe37511(++_0x1a4d19);}(_0xd832,0x19d));var _0x2d83=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0xd832[_0x35a274];return _0x40d905;};'use strict';var _=require(_0x2d83('0x0'));var util=require(_0x2d83('0x1'));var logger=require(_0x2d83('0x2'))(_0x2d83('0x3'));var moment=require('moment');var BPromise=require(_0x2d83('0x4'));var rp=require(_0x2d83('0x5'));var fs=require('fs');var path=require(_0x2d83('0x6'));var rimraf=require('rimraf');var config=require(_0x2d83('0x7'));var attributes=require(_0x2d83('0x8'));module[_0x2d83('0x9')]=function(_0x1057cb,_0x81f57){return _0x1057cb[_0x2d83('0xa')](_0x2d83('0xb'),attributes,{'tableName':_0x2d83('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js
index 7a6e0b3..fcb64ed 100644
--- a/server/api/schedule/schedule.rpc.js
+++ b/server/api/schedule/schedule.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcbfe=['../../config/environment','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','rpc'];(function(_0x39f5aa,_0x38cf43){var _0x5990d3=function(_0x145724){while(--_0x145724){_0x39f5aa['push'](_0x39f5aa['shift']());}};_0x5990d3(++_0x38cf43);}(_0xcbfe,0x72));var _0xecbf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcbfe[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xecbf('0x0'));var util=require(_0xecbf('0x1'));var moment=require(_0xecbf('0x2'));var BPromise=require(_0xecbf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecbf('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xecbf('0x5'));var config=require(_0xecbf('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xecbf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x13e8dd,_0x25e8f9,_0xc3cfeb){return new BPromise(function(_0x22aa8b,_0x51a284){return client[_0xecbf('0x8')](_0x13e8dd,_0xc3cfeb)[_0xecbf('0x9')](function(_0x2570bd){logger['info'](_0xecbf('0xa'),_0x25e8f9,_0xecbf('0xb'));logger[_0xecbf('0xc')](_0xecbf('0xd'),_0x25e8f9,'request\x20sent',JSON[_0xecbf('0xe')](_0x2570bd));if(_0x2570bd['error']){if(_0x2570bd[_0xecbf('0xf')][_0xecbf('0x10')]===0x1f4){logger[_0xecbf('0xf')](_0xecbf('0xa'),_0x25e8f9,_0x2570bd[_0xecbf('0xf')][_0xecbf('0x11')]);return _0x51a284(_0x2570bd[_0xecbf('0xf')]['message']);}logger[_0xecbf('0xf')]('Schedule,\x20%s,\x20%s',_0x25e8f9,_0x2570bd['error'][_0xecbf('0x11')]);return _0x22aa8b(_0x2570bd['error']['message']);}else{logger[_0xecbf('0x12')](_0xecbf('0xa'),_0x25e8f9,_0xecbf('0xb'));_0x22aa8b(_0x2570bd['result'][_0xecbf('0x11')]);}})[_0xecbf('0x13')](function(_0x701144){logger['error'](_0xecbf('0xa'),_0x25e8f9,_0x701144);_0x51a284(_0x701144);});});}
\ No newline at end of file
+var _0xf7e6=['Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','then','info'];(function(_0x31590b,_0x38d2c9){var _0x3c9d44=function(_0x464eaf){while(--_0x464eaf){_0x31590b['push'](_0x31590b['shift']());}};_0x3c9d44(++_0x38d2c9);}(_0xf7e6,0xe5));var _0x6f7e=function(_0x1688d2,_0x4a8b5c){_0x1688d2=_0x1688d2-0x0;var _0x4fc2fa=_0xf7e6[_0x1688d2];return _0x4fc2fa;};'use strict';var _=require(_0x6f7e('0x0'));var util=require(_0x6f7e('0x1'));var moment=require('moment');var BPromise=require(_0x6f7e('0x2'));var rs=require(_0x6f7e('0x3'));var fs=require('fs');var Redis=require(_0x6f7e('0x4'));var db=require(_0x6f7e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f7e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6f7e('0x7'));var client=jayson[_0x6f7e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12abd8,_0x5e9105,_0x24d775){return new BPromise(function(_0x4d6481,_0x9ba3e0){return client['request'](_0x12abd8,_0x24d775)[_0x6f7e('0x9')](function(_0x1cf89e){logger[_0x6f7e('0xa')](_0x6f7e('0xb'),_0x5e9105,_0x6f7e('0xc'));logger[_0x6f7e('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x5e9105,'request\x20sent',JSON[_0x6f7e('0xe')](_0x1cf89e));if(_0x1cf89e[_0x6f7e('0xf')]){if(_0x1cf89e[_0x6f7e('0xf')][_0x6f7e('0x10')]===0x1f4){logger[_0x6f7e('0xf')](_0x6f7e('0xb'),_0x5e9105,_0x1cf89e[_0x6f7e('0xf')][_0x6f7e('0x11')]);return _0x9ba3e0(_0x1cf89e[_0x6f7e('0xf')][_0x6f7e('0x11')]);}logger['error'](_0x6f7e('0xb'),_0x5e9105,_0x1cf89e[_0x6f7e('0xf')][_0x6f7e('0x11')]);return _0x4d6481(_0x1cf89e['error'][_0x6f7e('0x11')]);}else{logger[_0x6f7e('0xa')](_0x6f7e('0xb'),_0x5e9105,_0x6f7e('0xc'));_0x4d6481(_0x1cf89e[_0x6f7e('0x12')][_0x6f7e('0x11')]);}})[_0x6f7e('0x13')](function(_0x390a13){logger['error'](_0x6f7e('0xb'),_0x5e9105,_0x390a13);_0x9ba3e0(_0x390a13);});});}
\ No newline at end of file
diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js
index fe03cfc..cfd44fd 100644
--- a/server/api/screenRecording/index.js
+++ b/server/api/screenRecording/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2755=['describe','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index'];(function(_0x37a6ff,_0x1763e8){var _0x48b655=function(_0x16052d){while(--_0x16052d){_0x37a6ff['push'](_0x37a6ff['shift']());}};_0x48b655(++_0x1763e8);}(_0x2755,0x19a));var _0x5275=function(_0x323913,_0xe010e){_0x323913=_0x323913-0x0;var _0x59968c=_0x2755[_0x323913];return _0x59968c;};'use strict';var multer=require(_0x5275('0x0'));var util=require('util');var path=require(_0x5275('0x1'));var timeout=require(_0x5275('0x2'));var express=require(_0x5275('0x3'));var router=express['Router']();var auth=require(_0x5275('0x4'));var interaction=require(_0x5275('0x5'));var config=require('../../config/environment');var controller=require(_0x5275('0x6'));router[_0x5275('0x7')]('/',auth[_0x5275('0x8')](),controller[_0x5275('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5275('0xa')]);router[_0x5275('0x7')](_0x5275('0xb'),auth[_0x5275('0x8')](),controller[_0x5275('0xc')]);router['get'](_0x5275('0xd'),auth[_0x5275('0x8')](),controller[_0x5275('0xe')]);router[_0x5275('0xf')]('/',auth[_0x5275('0x8')](),controller[_0x5275('0x10')]);router[_0x5275('0x11')](_0x5275('0xb'),auth[_0x5275('0x8')](),controller['update']);router[_0x5275('0x12')]('/:id',auth[_0x5275('0x8')](),controller[_0x5275('0x13')]);module[_0x5275('0x14')]=router;
\ No newline at end of file
+var _0x458a=['describe','show','/:id/download','download','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x458a,0xc7));var _0xa458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x458a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa458('0x0'));var util=require(_0xa458('0x1'));var path=require(_0xa458('0x2'));var timeout=require('connect-timeout');var express=require(_0xa458('0x3'));var router=express[_0xa458('0x4')]();var auth=require(_0xa458('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa458('0x6'));var controller=require(_0xa458('0x7'));router['get']('/',auth[_0xa458('0x8')](),controller[_0xa458('0x9')]);router[_0xa458('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xa458('0xb')]);router[_0xa458('0xa')]('/:id',auth[_0xa458('0x8')](),controller[_0xa458('0xc')]);router[_0xa458('0xa')](_0xa458('0xd'),auth['isAuthenticated'](),controller[_0xa458('0xe')]);router[_0xa458('0xf')]('/',auth[_0xa458('0x8')](),controller[_0xa458('0x10')]);router['put']('/:id',auth[_0xa458('0x8')](),controller[_0xa458('0x11')]);router[_0xa458('0x12')]('/:id',auth[_0xa458('0x8')](),controller[_0xa458('0x13')]);module[_0xa458('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js
index 4bd8e9f..d73b4c3 100644
--- a/server/api/screenRecording/screenRecording.attributes.js
+++ b/server/api/screenRecording/screenRecording.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3349=['format','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','closedAt','DATE','startedAt','MM-DD-YYYY\x20HH:mm','toString','createdAt'];(function(_0x58b63d,_0x882db9){var _0x460714=function(_0x3df0d0){while(--_0x3df0d0){_0x58b63d['push'](_0x58b63d['shift']());}};_0x460714(++_0x882db9);}(_0x3349,0x142));var _0x9334=function(_0x504187,_0x407042){_0x504187=_0x504187-0x0;var _0x84c53d=_0x3349[_0x504187];return _0x84c53d;};'use strict';var Sequelize=require(_0x9334('0x0'));var moment=require(_0x9334('0x1'));var path=require(_0x9334('0x2'));var config=require(_0x9334('0x3'));module['exports']={'format':{'type':Sequelize[_0x9334('0x4')],'get':function(){return this['getDataValue'](_0x9334('0x5'))?path[_0x9334('0x6')](this[_0x9334('0x7')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x9334('0x8')]},'channel':{'type':Sequelize[_0x9334('0x8')]},'value':{'type':Sequelize[_0x9334('0x8')],'set':function(_0x116dd4){var _0x4dab4f=_0x116dd4[_0x9334('0x9')](/\\/g,'/');this[_0x9334('0xa')](_0x9334('0x5'),_0x4dab4f);}},'rating':{'type':Sequelize[_0x9334('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9334('0xb')],'set':function(_0x78eea){this[_0x9334('0xa')]('startedAt',moment()['subtract'](_0x78eea,'ms'));this['setDataValue'](_0x9334('0xc'),moment());this[_0x9334('0xa')]('duration',_0x78eea);}},'startedAt':{'type':Sequelize[_0x9334('0xd')],'get':function(){return moment(this[_0x9334('0x7')](_0x9334('0xe')))['format'](_0x9334('0xf'))[_0x9334('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9334('0x7')](_0x9334('0xc')))['format']('MM-DD-YYYY\x20HH:mm')[_0x9334('0x10')]();}},'createdAt':{'type':Sequelize[_0x9334('0xd')],'get':function(){return moment(this['getDataValue'](_0x9334('0x11')))[_0x9334('0x12')](_0x9334('0xf'))[_0x9334('0x10')]();}},'updatedAt':{'type':Sequelize[_0x9334('0xd')],'get':function(){return moment(this['getDataValue'](_0x9334('0x13')))['format'](_0x9334('0xf'))[_0x9334('0x10')]();}}};
\ No newline at end of file
+var _0x9d9b=['startedAt','MM-DD-YYYY\x20HH:mm','DATE','format','toString','moment','path','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','closedAt','duration'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x599da4,_0x2ec53d){_0x599da4=_0x599da4-0x0;var _0x380805=_0x9d9b[_0x599da4];return _0x380805;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb9d9('0x0'));var path=require(_0xb9d9('0x1'));var config=require('../../config/environment');module[_0xb9d9('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb9d9('0x3')](_0xb9d9('0x4'))?path[_0xb9d9('0x5')](this['getDataValue'](_0xb9d9('0x4'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb9d9('0x6')]},'value':{'type':Sequelize[_0xb9d9('0x6')],'set':function(_0x51af61){var _0x13743f=_0x51af61[_0xb9d9('0x7')](/\\/g,'/');this[_0xb9d9('0x8')](_0xb9d9('0x4'),_0x13743f);}},'rating':{'type':Sequelize[_0xb9d9('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb9d9('0x9')],'set':function(_0x1bfec3){this['setDataValue']('startedAt',moment()['subtract'](_0x1bfec3,'ms'));this['setDataValue'](_0xb9d9('0xa'),moment());this[_0xb9d9('0x8')](_0xb9d9('0xb'),_0x1bfec3);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb9d9('0x3')](_0xb9d9('0xc')))['format'](_0xb9d9('0xd'))['toString']();}},'closedAt':{'type':Sequelize[_0xb9d9('0xe')],'get':function(){return moment(this[_0xb9d9('0x3')](_0xb9d9('0xa')))[_0xb9d9('0xf')](_0xb9d9('0xd'))[_0xb9d9('0x10')]();}},'createdAt':{'type':Sequelize[_0xb9d9('0xe')],'get':function(){return moment(this[_0xb9d9('0x3')]('createdAt'))['format'](_0xb9d9('0xd'))[_0xb9d9('0x10')]();}},'updatedAt':{'type':Sequelize[_0xb9d9('0xe')],'get':function(){return moment(this[_0xb9d9('0x3')]('updatedAt'))['format'](_0xb9d9('0xd'))['toString']();}}};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js
index d9c8cd8..eebd406 100644
--- a/server/api/screenRecording/screenRecording.controller.js
+++ b/server/api/screenRecording/screenRecording.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9649=['uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','unlink','message','Not\x20found','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','ScreenRecording','rawAttributes','model','keys','format','query','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','key','options','includeAll','include','findAll','catch','show','params','intersection','create','body','createdAt','closedAt','value','find','describe','download','../../components/encryptor'];(function(_0x5d8ffd,_0x1f5837){var _0x4380b5=function(_0x14208a){while(--_0x14208a){_0x5d8ffd['push'](_0x5d8ffd['shift']());}};_0x4380b5(++_0x1f5837);}(_0x9649,0x118));var _0x9964=function(_0x1b207e,_0x26510d){_0x1b207e=_0x1b207e-0x0;var _0x3572fd=_0x9649[_0x1b207e];return _0x3572fd;};'use strict';var pdf=require(_0x9964('0x0'));var emlformat=require(_0x9964('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9964('0x2'));var jsonpatch=require(_0x9964('0x3'));var rp=require(_0x9964('0x4'));var moment=require('moment');var BPromise=require(_0x9964('0x5'));var Mustache=require(_0x9964('0x6'));var util=require(_0x9964('0x7'));var path=require(_0x9964('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9964('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9964('0xa'));var jsforce=require(_0x9964('0xb'));var deskjs=require(_0x9964('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9964('0xd'));var Papa=require(_0x9964('0xe'));var Redis=require(_0x9964('0xf'));var authService=require(_0x9964('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9964('0x11'));var logger=require('../../config/logger')(_0x9964('0x12'));var utils=require(_0x9964('0x13'));var config=require('../../config/environment');var db=require(_0x9964('0x14'))['db'];function respondWithStatusCode(_0xe9f792,_0x5d7939){_0x5d7939=_0x5d7939||0xcc;return function(_0x2bd6ff){if(_0x2bd6ff){return _0xe9f792['sendStatus'](_0x5d7939);}return _0xe9f792[_0x9964('0x15')](_0x5d7939)[_0x9964('0x16')]();};}function respondWithResult(_0x2473e9,_0x2451df){_0x2451df=_0x2451df||0xc8;return function(_0x22f5ce){if(_0x22f5ce){return _0x2473e9[_0x9964('0x15')](_0x2451df)[_0x9964('0x17')](_0x22f5ce);}};}function respondWithFilteredResult(_0x59efc7,_0x5b722f){return function(_0x37f137){if(_0x37f137){var _0x2be683=_0x37f137[_0x9964('0x18')],_0x561571=_0x5b722f[_0x9964('0x19')],_0x416340=_0x5b722f[_0x9964('0x19')]+_0x5b722f[_0x9964('0x1a')],_0x2b0aba;if(_0x416340>=_0x2be683){_0x416340=_0x2be683;_0x2b0aba=0xc8;}else{_0x2b0aba=0xce;}_0x59efc7['status'](_0x2b0aba);return _0x59efc7[_0x9964('0x1b')](_0x9964('0x1c'),_0x561571+'-'+_0x416340+'/'+_0x2be683)['json'](_0x37f137);}return null;};}function patchUpdates(_0x5bf270){return function(_0x541e4c){try{jsonpatch[_0x9964('0x1d')](_0x541e4c,_0x5bf270,!![]);}catch(_0xc4c0fe){return BPromise[_0x9964('0x1e')](_0xc4c0fe);}return _0x541e4c[_0x9964('0x1f')]();};}function saveUpdates(_0x5bafea,_0x3813d1){return function(_0x5f2bbd){if(_0x5f2bbd){return _0x5f2bbd[_0x9964('0x20')](_0x5bafea)[_0x9964('0x21')](function(_0x209929){return _0x209929;});}return null;};}function removeEntity(_0x3d14b7,_0x2829fb){return function(_0xea9fc2){if(_0xea9fc2){return _0xea9fc2[_0x9964('0x22')]()[_0x9964('0x21')](function(){_0x3d14b7['status'](0xcc)[_0x9964('0x16')]();});}};}function handleEntityNotFound(_0x3069d7,_0x1629f9){return function(_0x30ccf7){if(!_0x30ccf7){_0x3069d7['sendStatus'](0x194);}return _0x30ccf7;};}function handleError(_0x20c522,_0x988bf7){_0x988bf7=_0x988bf7||0x1f4;return function(_0x3b3793){logger[_0x9964('0x23')](_0x3b3793['stack']);if(_0x3b3793[_0x9964('0x24')]){delete _0x3b3793[_0x9964('0x24')];}_0x20c522[_0x9964('0x15')](_0x988bf7)[_0x9964('0x25')](_0x3b3793);};}exports[_0x9964('0x26')]=function(_0xd48c01,_0xcc5362){var _0x33be7b={},_0x4f9a8b={},_0x524564={'count':0x0,'rows':[]};var _0x194dc6=db[_0x9964('0x27')][_0x9964('0x28')];_0x4f9a8b[_0x9964('0x29')]=_['differenceBy'](_[_0x9964('0x2a')](_0x194dc6),[_0x9964('0x2b')]);_0x4f9a8b[_0x9964('0x2c')]=_[_0x9964('0x2a')](_0xd48c01[_0x9964('0x2c')]);_0x4f9a8b['filters']=_['intersection'](_0x4f9a8b[_0x9964('0x29')],_0x4f9a8b[_0x9964('0x2c')]);_0x33be7b['attributes']=_['intersection'](_0x4f9a8b['model'],qs[_0x9964('0x2d')](_0xd48c01[_0x9964('0x2c')][_0x9964('0x2d')]));_0x33be7b['attributes']=_0x33be7b[_0x9964('0x2e')][_0x9964('0x2f')]?_0x33be7b[_0x9964('0x2e')]:_0x4f9a8b[_0x9964('0x29')];if(!_0xd48c01[_0x9964('0x2c')][_0x9964('0x30')]('nolimit')){_0x33be7b[_0x9964('0x1a')]=qs[_0x9964('0x1a')](_0xd48c01[_0x9964('0x2c')]['limit']);_0x33be7b[_0x9964('0x19')]=qs[_0x9964('0x19')](_0xd48c01[_0x9964('0x2c')]['offset']);}_0x33be7b[_0x9964('0x31')]=qs[_0x9964('0x32')](_0xd48c01[_0x9964('0x2c')][_0x9964('0x32')]);_0x33be7b[_0x9964('0x33')]=qs[_0x9964('0x34')](_[_0x9964('0x35')](_0xd48c01[_0x9964('0x2c')],_0x4f9a8b[_0x9964('0x34')]));if(_0xd48c01[_0x9964('0x2c')][_0x9964('0x36')]){_0x33be7b[_0x9964('0x33')]=_[_0x9964('0x37')](_0x33be7b[_0x9964('0x33')],{'$or':_[_0x9964('0x38')](_0x194dc6,function(_0x5feb0e){if(_0x5feb0e[_0x9964('0x39')][_0x9964('0x3a')]!=='VIRTUAL'){var _0xfe79a3={};_0xfe79a3[_0x5feb0e['field']]={'$like':'%'+_0xd48c01[_0x9964('0x2c')][_0x9964('0x36')]+'%'};return _0xfe79a3;}})});}_0x33be7b=_['merge']({},_0x33be7b,_0xd48c01[_0x9964('0x3b')]);var _0x49e32f={'where':_0x33be7b[_0x9964('0x33')]};return db[_0x9964('0x27')][_0x9964('0x18')](_0x49e32f)[_0x9964('0x21')](function(_0x7f18e8){_0x524564[_0x9964('0x18')]=_0x7f18e8;if(_0xd48c01['query'][_0x9964('0x3c')]){_0x33be7b[_0x9964('0x3d')]=[{'all':!![]}];}return db[_0x9964('0x27')][_0x9964('0x3e')](_0x33be7b);})['then'](function(_0x1b3cbe){_0x524564['rows']=_0x1b3cbe;return _0x524564;})[_0x9964('0x21')](respondWithFilteredResult(_0xcc5362,_0x33be7b))[_0x9964('0x3f')](handleError(_0xcc5362,null));};exports[_0x9964('0x40')]=function(_0x2acc2e,_0x3a82d3){var _0x2014f8={'raw':![],'where':{'id':_0x2acc2e[_0x9964('0x41')]['id']}},_0x42eb44={};_0x42eb44[_0x9964('0x29')]=_[_0x9964('0x2a')](db[_0x9964('0x27')]['rawAttributes']);_0x42eb44[_0x9964('0x2c')]=_[_0x9964('0x2a')](_0x2acc2e[_0x9964('0x2c')]);_0x42eb44[_0x9964('0x34')]=_['intersection'](_0x42eb44[_0x9964('0x29')],_0x42eb44['query']);_0x2014f8['attributes']=_[_0x9964('0x42')](_0x42eb44['model'],qs[_0x9964('0x2d')](_0x2acc2e['query'][_0x9964('0x2d')]));_0x2014f8[_0x9964('0x2e')]=_0x2014f8[_0x9964('0x2e')]['length']?_0x2014f8['attributes']:_0x42eb44['model'];if(_0x2acc2e[_0x9964('0x2c')][_0x9964('0x3c')]){_0x2014f8['include']=[{'all':!![]}];}_0x2014f8=_[_0x9964('0x37')]({},_0x2014f8,_0x2acc2e[_0x9964('0x3b')]);return db[_0x9964('0x27')]['find'](_0x2014f8)[_0x9964('0x21')](handleEntityNotFound(_0x3a82d3,null))[_0x9964('0x21')](respondWithResult(_0x3a82d3,null))[_0x9964('0x3f')](handleError(_0x3a82d3,null));};exports[_0x9964('0x43')]=function(_0x562289,_0x35ae99){return db[_0x9964('0x27')][_0x9964('0x43')](_0x562289[_0x9964('0x44')],{})[_0x9964('0x21')](respondWithResult(_0x35ae99,0xc9))['catch'](handleError(_0x35ae99,null));};exports[_0x9964('0x20')]=function(_0x3499c5,_0x556530){if(_0x3499c5[_0x9964('0x44')]['id']){delete _0x3499c5[_0x9964('0x44')]['id'];}delete _0x3499c5[_0x9964('0x44')]['duration'];delete _0x3499c5[_0x9964('0x44')][_0x9964('0x45')];delete _0x3499c5[_0x9964('0x44')][_0x9964('0x46')];delete _0x3499c5['body'][_0x9964('0x47')];return db[_0x9964('0x27')][_0x9964('0x48')]({'where':{'id':_0x3499c5[_0x9964('0x41')]['id']}})['then'](handleEntityNotFound(_0x556530,null))[_0x9964('0x21')](saveUpdates(_0x3499c5[_0x9964('0x44')],null))[_0x9964('0x21')](respondWithResult(_0x556530,null))[_0x9964('0x3f')](handleError(_0x556530,null));};exports[_0x9964('0x22')]=function(_0x4f48d9,_0x20021d){return db[_0x9964('0x27')][_0x9964('0x48')]({'where':{'id':_0x4f48d9[_0x9964('0x41')]['id']}})[_0x9964('0x21')](handleEntityNotFound(_0x20021d,null))[_0x9964('0x21')](removeEntity(_0x20021d,null))[_0x9964('0x3f')](handleError(_0x20021d,null));};exports[_0x9964('0x49')]=function(_0x5e4ee5,_0x30f6c0){return db[_0x9964('0x27')][_0x9964('0x49')]()[_0x9964('0x21')](respondWithResult(_0x30f6c0,null))[_0x9964('0x3f')](handleError(_0x30f6c0,null));};exports[_0x9964('0x4a')]=function(_0x1ed5b5,_0x7641c5,_0x559e56){var _0x25faa5=require(_0x9964('0x4b'));var _0x58815f=![];var _0x17e971={};if(_0x1ed5b5[_0x9964('0x2c')]['type']&&_0x1ed5b5[_0x9964('0x2c')]['type']==='uniqueid'){_0x17e971[_0x9964('0x4c')]=_0x1ed5b5[_0x9964('0x41')]['id'];}else{_0x17e971['id']=_0x1ed5b5[_0x9964('0x41')]['id'];}return db[_0x9964('0x27')][_0x9964('0x48')]({'where':_0x17e971,'attributes':['id',_0x9964('0x47')],'raw':!![]})[_0x9964('0x21')](handleEntityNotFound(_0x7641c5,null))[_0x9964('0x21')](function(_0x19324f){if(_0x19324f){var _0x48e004=path[_0x9964('0x4d')](config[_0x9964('0x4e')],_0x9964('0x4f'),_0x19324f[_0x9964('0x47')]);var _0x2ab69=util[_0x9964('0x2b')]('%s.cypher',_0x48e004);if(fs[_0x9964('0x50')](_0x2ab69)){_0x58815f=!![];return _0x25faa5[_0x9964('0x51')](_0x2ab69,_0x48e004,config[_0x9964('0x52')]['recording'])['then'](function(){return _0x19324f;});}return _0x19324f;}})[_0x9964('0x21')](function(_0x543a43){if(_0x543a43){var _0x3d8653=path['join'](config[_0x9964('0x4e')],'server/files/screen_recordings',_0x543a43[_0x9964('0x47')]);if(!fs[_0x9964('0x50')](_0x3d8653)){throw new db[(_0x9964('0x53'))][(_0x9964('0x54'))]('ScreenRecording\x20not\x20found');}if(_0x543a43['filename']){return _0x7641c5[_0x9964('0x4a')](_0x3d8653,_0x543a43[_0x9964('0x55')]+path['extname'](_0x3d8653),function(){if(_0x58815f){fs[_0x9964('0x56')](_0x3d8653);}});}else{return _0x7641c5['download'](_0x3d8653,function(_0x145e2e){if(_0x58815f){fs[_0x9964('0x56')](_0x3d8653);}});}}})[_0x9964('0x3f')](function(_0x4b2654){if(_0x4b2654[_0x9964('0x57')]==='ScreenRecording\x20not\x20found'){_0x7641c5[_0x9964('0x15')](0x194)[_0x9964('0x25')](_0x9964('0x58'));}else{return handleError(_0x7641c5,null);}});};
\ No newline at end of file
+var _0xe189=['catch','show','params','create','body','duration','closedAt','value','find','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','html-pdf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','index','ScreenRecording','rawAttributes','model','differenceBy','format','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','filters','filter','where','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll'];(function(_0x52a938,_0x23b448){var _0x159942=function(_0x581cc4){while(--_0x581cc4){_0x52a938['push'](_0x52a938['shift']());}};_0x159942(++_0x23b448);}(_0xe189,0x194));var _0x9e18=function(_0x1dba0f,_0x4dee53){_0x1dba0f=_0x1dba0f-0x0;var _0x5d3552=_0xe189[_0x1dba0f];return _0x5d3552;};'use strict';var pdf=require(_0x9e18('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9e18('0x1'));var jsonpatch=require(_0x9e18('0x2'));var rp=require(_0x9e18('0x3'));var moment=require(_0x9e18('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e18('0x5'));var path=require(_0x9e18('0x6'));var sox=require(_0x9e18('0x7'));var csv=require(_0x9e18('0x8'));var ejs=require(_0x9e18('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9e18('0xa'));var crypto=require(_0x9e18('0xb'));var jsforce=require(_0x9e18('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9e18('0x8'));var querystring=require(_0x9e18('0xd'));var Papa=require(_0x9e18('0xe'));var Redis=require('ioredis');var authService=require(_0x9e18('0xf'));var qs=require(_0x9e18('0x10'));var hardwareService=require(_0x9e18('0x11'));var logger=require(_0x9e18('0x12'))(_0x9e18('0x13'));var utils=require(_0x9e18('0x14'));var config=require(_0x9e18('0x15'));var db=require(_0x9e18('0x16'))['db'];function respondWithStatusCode(_0x12cec3,_0x57e889){_0x57e889=_0x57e889||0xcc;return function(_0x3617b0){if(_0x3617b0){return _0x12cec3['sendStatus'](_0x57e889);}return _0x12cec3[_0x9e18('0x17')](_0x57e889)[_0x9e18('0x18')]();};}function respondWithResult(_0x4d87e7,_0x1178fd){_0x1178fd=_0x1178fd||0xc8;return function(_0x30516d){if(_0x30516d){return _0x4d87e7[_0x9e18('0x17')](_0x1178fd)[_0x9e18('0x19')](_0x30516d);}};}function respondWithFilteredResult(_0x566954,_0xbd877){return function(_0x58c360){if(_0x58c360){var _0x57bcd9=_0x58c360[_0x9e18('0x1a')],_0xb10405=_0xbd877[_0x9e18('0x1b')],_0x4e7bcb=_0xbd877[_0x9e18('0x1b')]+_0xbd877['limit'],_0x691a51;if(_0x4e7bcb>=_0x57bcd9){_0x4e7bcb=_0x57bcd9;_0x691a51=0xc8;}else{_0x691a51=0xce;}_0x566954['status'](_0x691a51);return _0x566954[_0x9e18('0x1c')](_0x9e18('0x1d'),_0xb10405+'-'+_0x4e7bcb+'/'+_0x57bcd9)['json'](_0x58c360);}return null;};}function patchUpdates(_0x1aa23f){return function(_0x523a4e){try{jsonpatch[_0x9e18('0x1e')](_0x523a4e,_0x1aa23f,!![]);}catch(_0x538b16){return BPromise[_0x9e18('0x1f')](_0x538b16);}return _0x523a4e[_0x9e18('0x20')]();};}function saveUpdates(_0x20b492,_0x25b134){return function(_0x1fb910){if(_0x1fb910){return _0x1fb910[_0x9e18('0x21')](_0x20b492)[_0x9e18('0x22')](function(_0xfeff85){return _0xfeff85;});}return null;};}function removeEntity(_0x11619d,_0x57501c){return function(_0x3a24ad){if(_0x3a24ad){return _0x3a24ad[_0x9e18('0x23')]()[_0x9e18('0x22')](function(){_0x11619d['status'](0xcc)[_0x9e18('0x18')]();});}};}function handleEntityNotFound(_0x4aec75,_0x4b591){return function(_0x50131d){if(!_0x50131d){_0x4aec75[_0x9e18('0x24')](0x194);}return _0x50131d;};}function handleError(_0x4eabe9,_0x210547){_0x210547=_0x210547||0x1f4;return function(_0x1bd289){logger['error'](_0x1bd289[_0x9e18('0x25')]);if(_0x1bd289['name']){delete _0x1bd289['name'];}_0x4eabe9[_0x9e18('0x17')](_0x210547)['send'](_0x1bd289);};}exports[_0x9e18('0x26')]=function(_0x49a3d6,_0xcf65ba){var _0x413dce={},_0x2cee0f={},_0xd115f3={'count':0x0,'rows':[]};var _0x33fbd5=db[_0x9e18('0x27')][_0x9e18('0x28')];_0x2cee0f[_0x9e18('0x29')]=_[_0x9e18('0x2a')](_['keys'](_0x33fbd5),[_0x9e18('0x2b')]);_0x2cee0f[_0x9e18('0x2c')]=_[_0x9e18('0x2d')](_0x49a3d6[_0x9e18('0x2c')]);_0x2cee0f['filters']=_['intersection'](_0x2cee0f[_0x9e18('0x29')],_0x2cee0f[_0x9e18('0x2c')]);_0x413dce[_0x9e18('0x2e')]=_[_0x9e18('0x2f')](_0x2cee0f[_0x9e18('0x29')],qs['fields'](_0x49a3d6[_0x9e18('0x2c')][_0x9e18('0x30')]));_0x413dce[_0x9e18('0x2e')]=_0x413dce[_0x9e18('0x2e')][_0x9e18('0x31')]?_0x413dce[_0x9e18('0x2e')]:_0x2cee0f['model'];if(!_0x49a3d6[_0x9e18('0x2c')][_0x9e18('0x32')](_0x9e18('0x33'))){_0x413dce[_0x9e18('0x34')]=qs[_0x9e18('0x34')](_0x49a3d6['query']['limit']);_0x413dce[_0x9e18('0x1b')]=qs[_0x9e18('0x1b')](_0x49a3d6[_0x9e18('0x2c')][_0x9e18('0x1b')]);}_0x413dce['order']=qs[_0x9e18('0x35')](_0x49a3d6[_0x9e18('0x2c')][_0x9e18('0x35')]);_0x413dce['where']=qs[_0x9e18('0x36')](_['pick'](_0x49a3d6[_0x9e18('0x2c')],_0x2cee0f['filters']));if(_0x49a3d6[_0x9e18('0x2c')][_0x9e18('0x37')]){_0x413dce[_0x9e18('0x38')]=_[_0x9e18('0x39')](_0x413dce[_0x9e18('0x38')],{'$or':_[_0x9e18('0x3a')](_0x33fbd5,function(_0x90019f){if(_0x90019f[_0x9e18('0x3b')][_0x9e18('0x3c')]!==_0x9e18('0x3d')){var _0x24712f={};_0x24712f[_0x90019f['field']]={'$like':'%'+_0x49a3d6[_0x9e18('0x2c')][_0x9e18('0x37')]+'%'};return _0x24712f;}})});}_0x413dce=_[_0x9e18('0x39')]({},_0x413dce,_0x49a3d6[_0x9e18('0x3e')]);var _0x437050={'where':_0x413dce[_0x9e18('0x38')]};return db[_0x9e18('0x27')][_0x9e18('0x1a')](_0x437050)[_0x9e18('0x22')](function(_0x41cf02){_0xd115f3[_0x9e18('0x1a')]=_0x41cf02;if(_0x49a3d6[_0x9e18('0x2c')][_0x9e18('0x3f')]){_0x413dce[_0x9e18('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0x9e18('0x41')](_0x413dce);})[_0x9e18('0x22')](function(_0x3dc07c){_0xd115f3['rows']=_0x3dc07c;return _0xd115f3;})[_0x9e18('0x22')](respondWithFilteredResult(_0xcf65ba,_0x413dce))[_0x9e18('0x42')](handleError(_0xcf65ba,null));};exports[_0x9e18('0x43')]=function(_0x2c9e9a,_0x33d301){var _0x44487e={'raw':![],'where':{'id':_0x2c9e9a[_0x9e18('0x44')]['id']}},_0x3ece34={};_0x3ece34[_0x9e18('0x29')]=_[_0x9e18('0x2d')](db['ScreenRecording']['rawAttributes']);_0x3ece34['query']=_[_0x9e18('0x2d')](_0x2c9e9a['query']);_0x3ece34['filters']=_[_0x9e18('0x2f')](_0x3ece34[_0x9e18('0x29')],_0x3ece34[_0x9e18('0x2c')]);_0x44487e['attributes']=_[_0x9e18('0x2f')](_0x3ece34[_0x9e18('0x29')],qs[_0x9e18('0x30')](_0x2c9e9a[_0x9e18('0x2c')][_0x9e18('0x30')]));_0x44487e['attributes']=_0x44487e[_0x9e18('0x2e')][_0x9e18('0x31')]?_0x44487e[_0x9e18('0x2e')]:_0x3ece34[_0x9e18('0x29')];if(_0x2c9e9a['query'][_0x9e18('0x3f')]){_0x44487e[_0x9e18('0x40')]=[{'all':!![]}];}_0x44487e=_[_0x9e18('0x39')]({},_0x44487e,_0x2c9e9a[_0x9e18('0x3e')]);return db[_0x9e18('0x27')]['find'](_0x44487e)[_0x9e18('0x22')](handleEntityNotFound(_0x33d301,null))[_0x9e18('0x22')](respondWithResult(_0x33d301,null))[_0x9e18('0x42')](handleError(_0x33d301,null));};exports[_0x9e18('0x45')]=function(_0x17effd,_0x57425c){return db['ScreenRecording']['create'](_0x17effd['body'],{})[_0x9e18('0x22')](respondWithResult(_0x57425c,0xc9))[_0x9e18('0x42')](handleError(_0x57425c,null));};exports[_0x9e18('0x21')]=function(_0x1989c3,_0x11a52e){if(_0x1989c3['body']['id']){delete _0x1989c3[_0x9e18('0x46')]['id'];}delete _0x1989c3[_0x9e18('0x46')][_0x9e18('0x47')];delete _0x1989c3[_0x9e18('0x46')]['createdAt'];delete _0x1989c3['body'][_0x9e18('0x48')];delete _0x1989c3[_0x9e18('0x46')][_0x9e18('0x49')];return db[_0x9e18('0x27')][_0x9e18('0x4a')]({'where':{'id':_0x1989c3[_0x9e18('0x44')]['id']}})['then'](handleEntityNotFound(_0x11a52e,null))[_0x9e18('0x22')](saveUpdates(_0x1989c3['body'],null))[_0x9e18('0x22')](respondWithResult(_0x11a52e,null))[_0x9e18('0x42')](handleError(_0x11a52e,null));};exports[_0x9e18('0x23')]=function(_0x225bf0,_0x43e89b){return db[_0x9e18('0x27')][_0x9e18('0x4a')]({'where':{'id':_0x225bf0[_0x9e18('0x44')]['id']}})[_0x9e18('0x22')](handleEntityNotFound(_0x43e89b,null))[_0x9e18('0x22')](removeEntity(_0x43e89b,null))[_0x9e18('0x42')](handleError(_0x43e89b,null));};exports[_0x9e18('0x4b')]=function(_0x1fb423,_0x3f76b5){return db[_0x9e18('0x27')]['describe']()[_0x9e18('0x22')](respondWithResult(_0x3f76b5,null))[_0x9e18('0x42')](handleError(_0x3f76b5,null));};exports[_0x9e18('0x4c')]=function(_0x324079,_0x2fe5c8,_0x4ce26e){var _0x2630aa=require(_0x9e18('0x4d'));var _0x3f790a=![];var _0x10f923={};if(_0x324079[_0x9e18('0x2c')][_0x9e18('0x3b')]&&_0x324079[_0x9e18('0x2c')][_0x9e18('0x3b')]===_0x9e18('0x4e')){_0x10f923[_0x9e18('0x4e')]=_0x324079[_0x9e18('0x44')]['id'];}else{_0x10f923['id']=_0x324079[_0x9e18('0x44')]['id'];}return db[_0x9e18('0x27')][_0x9e18('0x4a')]({'where':_0x10f923,'attributes':['id',_0x9e18('0x49')],'raw':!![]})[_0x9e18('0x22')](handleEntityNotFound(_0x2fe5c8,null))[_0x9e18('0x22')](function(_0x368066){if(_0x368066){var _0x3d9235=path[_0x9e18('0x4f')](config[_0x9e18('0x50')],_0x9e18('0x51'),_0x368066[_0x9e18('0x49')]);var _0x2d3fd2=util[_0x9e18('0x2b')](_0x9e18('0x52'),_0x3d9235);if(fs[_0x9e18('0x53')](_0x2d3fd2)){_0x3f790a=!![];return _0x2630aa['decryptFile'](_0x2d3fd2,_0x3d9235,config[_0x9e18('0x54')][_0x9e18('0x55')])[_0x9e18('0x22')](function(){return _0x368066;});}return _0x368066;}})[_0x9e18('0x22')](function(_0x11c3a8){if(_0x11c3a8){var _0xfc2328=path[_0x9e18('0x4f')](config['root'],_0x9e18('0x51'),_0x11c3a8[_0x9e18('0x49')]);if(!fs[_0x9e18('0x53')](_0xfc2328)){throw new db[(_0x9e18('0x56'))][(_0x9e18('0x57'))](_0x9e18('0x58'));}if(_0x11c3a8[_0x9e18('0x59')]){return _0x2fe5c8[_0x9e18('0x4c')](_0xfc2328,_0x11c3a8[_0x9e18('0x59')]+path['extname'](_0xfc2328),function(){if(_0x3f790a){fs[_0x9e18('0x5a')](_0xfc2328);}});}else{return _0x2fe5c8[_0x9e18('0x4c')](_0xfc2328,function(_0x4972ce){if(_0x3f790a){fs[_0x9e18('0x5a')](_0xfc2328);}});}}})[_0x9e18('0x42')](function(_0x3ac52e){if(_0x3ac52e[_0x9e18('0x5b')]===_0x9e18('0x58')){_0x2fe5c8[_0x9e18('0x17')](0x194)[_0x9e18('0x5c')](_0x9e18('0x5d'));}else{return handleError(_0x2fe5c8,null);}});};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js
index 3303f4f..da3c631 100644
--- a/server/api/screenRecording/screenRecording.model.js
+++ b/server/api/screenRecording/screenRecording.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6eca=['moment','bluebird','request-promise','path','exports','define','ScreenRecording','screen_recordings','interactionid','isNil','value','join','root','server','files','existsSync','log','lodash','util','api'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x6eca,0x1a1));var _0xa6ec=function(_0x6517c5,_0x566314){_0x6517c5=_0x6517c5-0x0;var _0x29a871=_0x6eca[_0x6517c5];return _0x29a871;};'use strict';var _=require(_0xa6ec('0x0'));var util=require(_0xa6ec('0x1'));var logger=require('../../config/logger')(_0xa6ec('0x2'));var moment=require(_0xa6ec('0x3'));var BPromise=require(_0xa6ec('0x4'));var rp=require(_0xa6ec('0x5'));var fs=require('fs');var path=require(_0xa6ec('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0xa6ec('0x7')]=function(_0x31d54b,_0x19b423){return _0x31d54b[_0xa6ec('0x8')](_0xa6ec('0x9'),attributes,{'tableName':_0xa6ec('0xa'),'paranoid':![],'indexes':[{'name':_0xa6ec('0xb'),'fields':[_0xa6ec('0xb')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x13e7a3,_0x369a02,_0x217e55){return new BPromise(function(_0x646373,_0x1a0c9f){if(!_[_0xa6ec('0xc')](_0x13e7a3[_0xa6ec('0xd')])){var _0x73a49f=path[_0xa6ec('0xe')](config[_0xa6ec('0xf')],_0xa6ec('0x10'),_0xa6ec('0x11'),'screen_recordings',_0x13e7a3[_0xa6ec('0xd')]);if(fs[_0xa6ec('0x12')](_0x73a49f)){rimraf(_0x73a49f,function(_0x4a7297){if(_0x4a7297){console[_0xa6ec('0x13')](_0x4a7297);}});}}_0x646373();})['catch'](function(_0x16b307){BPromise['resolve']();})['finally'](function(){_0x217e55();});}}});};
\ No newline at end of file
+var _0xd250=['resolve','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ScreenRecording','screen_recordings','interactionid','isNil','join','root','files','value','log'];(function(_0x1ddd0,_0x15f9f4){var _0x4d86d0=function(_0x3173d7){while(--_0x3173d7){_0x1ddd0['push'](_0x1ddd0['shift']());}};_0x4d86d0(++_0x15f9f4);}(_0xd250,0x70));var _0x0d25=function(_0x58fc2f,_0x111399){_0x58fc2f=_0x58fc2f-0x0;var _0x3a1312=_0xd250[_0x58fc2f];return _0x3a1312;};'use strict';var _=require(_0x0d25('0x0'));var util=require(_0x0d25('0x1'));var logger=require(_0x0d25('0x2'))(_0x0d25('0x3'));var moment=require(_0x0d25('0x4'));var BPromise=require(_0x0d25('0x5'));var rp=require(_0x0d25('0x6'));var fs=require('fs');var path=require(_0x0d25('0x7'));var rimraf=require(_0x0d25('0x8'));var config=require(_0x0d25('0x9'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x43a28d,_0x2bcbe8){return _0x43a28d[_0x0d25('0xa')](_0x0d25('0xb'),attributes,{'tableName':_0x0d25('0xc'),'paranoid':![],'indexes':[{'name':_0x0d25('0xd'),'fields':[_0x0d25('0xd')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x3ab687,_0x54b215,_0x1ea8b9){return new BPromise(function(_0x5750c4,_0x332a0b){if(!_[_0x0d25('0xe')](_0x3ab687['value'])){var _0x3a047a=path[_0x0d25('0xf')](config[_0x0d25('0x10')],'server',_0x0d25('0x11'),_0x0d25('0xc'),_0x3ab687[_0x0d25('0x12')]);if(fs['existsSync'](_0x3a047a)){rimraf(_0x3a047a,function(_0x3558e3){if(_0x3558e3){console[_0x0d25('0x13')](_0x3558e3);}});}}_0x5750c4();})['catch'](function(_0x4c44d0){BPromise[_0x0d25('0x14')]();})[_0x0d25('0x15')](function(){_0x1ea8b9();});}}});};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js
index 1ce620e..6b78375 100644
--- a/server/api/screenRecording/screenRecording.rpc.js
+++ b/server/api/screenRecording/screenRecording.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d9e=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','ScreenRecording,\x20%s,\x20%s','message','catch','lodash','bluebird','ioredis','../../config/utils'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x5005d9,_0x1a9652){_0x5005d9=_0x5005d9-0x0;var _0x527ac2=_0x4d9e[_0x5005d9];return _0x527ac2;};'use strict';var _=require(_0xe4d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe4d9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4d9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4d9('0x3'));var logger=require(_0xe4d9('0x4'))('rpc');var config=require(_0xe4d9('0x5'));var jayson=require(_0xe4d9('0x6'));var client=jayson[_0xe4d9('0x7')][_0xe4d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x125dbc,_0x32222c,_0x54a63a){return new BPromise(function(_0x36316f,_0x1d3810){return client[_0xe4d9('0x9')](_0x125dbc,_0x54a63a)[_0xe4d9('0xa')](function(_0x3f8937){logger[_0xe4d9('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x32222c,_0xe4d9('0xc'));logger[_0xe4d9('0xd')](_0xe4d9('0xe'),_0x32222c,_0xe4d9('0xc'),JSON[_0xe4d9('0xf')](_0x3f8937));if(_0x3f8937[_0xe4d9('0x10')]){if(_0x3f8937[_0xe4d9('0x10')]['code']===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x32222c,_0x3f8937['error']['message']);return _0x1d3810(_0x3f8937['error']['message']);}logger['error'](_0xe4d9('0x11'),_0x32222c,_0x3f8937[_0xe4d9('0x10')][_0xe4d9('0x12')]);return _0x36316f(_0x3f8937['error'][_0xe4d9('0x12')]);}else{logger[_0xe4d9('0xb')](_0xe4d9('0x11'),_0x32222c,_0xe4d9('0xc'));_0x36316f(_0x3f8937['result'][_0xe4d9('0x12')]);}})[_0xe4d9('0x13')](function(_0x4687f8){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x32222c,_0x4687f8);_0x1d3810(_0x4687f8);});});}
\ No newline at end of file
+var _0x81bd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x47d501,_0x1b9cf1){var _0x36c1a9=function(_0x52c5ce){while(--_0x52c5ce){_0x47d501['push'](_0x47d501['shift']());}};_0x36c1a9(++_0x1b9cf1);}(_0x81bd,0x7c));var _0xd81b=function(_0x1194ad,_0x435140){_0x1194ad=_0x1194ad-0x0;var _0x5f374d=_0x81bd[_0x1194ad];return _0x5f374d;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f3f2c,_0x562084,_0x5e14e8){return new BPromise(function(_0xa4cf97,_0x5468d5){return client[_0xd81b('0xc')](_0x1f3f2c,_0x5e14e8)[_0xd81b('0xd')](function(_0x3420a7){logger[_0xd81b('0xe')](_0xd81b('0xf'),_0x562084,_0xd81b('0x10'));logger[_0xd81b('0x11')](_0xd81b('0x12'),_0x562084,_0xd81b('0x10'),JSON[_0xd81b('0x13')](_0x3420a7));if(_0x3420a7[_0xd81b('0x14')]){if(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x15')]===0x1f4){logger['error'](_0xd81b('0xf'),_0x562084,_0x3420a7['error'][_0xd81b('0x16')]);return _0x5468d5(_0x3420a7[_0xd81b('0x14')]['message']);}logger[_0xd81b('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x562084,_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);return _0xa4cf97(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);}else{logger[_0xd81b('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x562084,_0xd81b('0x10'));_0xa4cf97(_0x3420a7[_0xd81b('0x17')]['message']);}})[_0xd81b('0x18')](function(_0x26df61){logger[_0xd81b('0x14')](_0xd81b('0xf'),_0x562084,_0x26df61);_0x5468d5(_0x26df61);});});}
\ No newline at end of file
diff --git a/server/api/setting/index.js b/server/api/setting/index.js
index 2049264..6539162 100644
--- a/server/api/setting/index.js
+++ b/server/api/setting/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34ef=['/:id/preferred','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','post','single','file','addLogo','%s%s','logologin','extname','addPreferred','put','update','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x34ef,0x7c));var _0xf34e=function(_0x49103d,_0x51360f){_0x49103d=_0x49103d-0x0;var _0xed1c35=_0x34ef[_0x49103d];return _0xed1c35;};'use strict';var multer=require(_0xf34e('0x0'));var util=require('util');var path=require(_0xf34e('0x1'));var timeout=require('connect-timeout');var express=require(_0xf34e('0x2'));var router=express[_0xf34e('0x3')]();var auth=require(_0xf34e('0x4'));var interaction=require(_0xf34e('0x5'));var config=require(_0xf34e('0x6'));var controller=require('./setting.controller');router['get']('/',auth[_0xf34e('0x7')](),controller[_0xf34e('0x8')]);router[_0xf34e('0x9')](_0xf34e('0xa'),controller['show']);router[_0xf34e('0x9')](_0xf34e('0xb'),controller[_0xf34e('0xc')]);router[_0xf34e('0x9')](_0xf34e('0xd'),controller[_0xf34e('0xe')]);router[_0xf34e('0x9')](_0xf34e('0xf'),controller['gdpr']);router[_0xf34e('0x9')](_0xf34e('0x10'),controller['getPreferred']);var upload=multer({'storage':multer[_0xf34e('0x11')]({'destination':function(_0x2c6637,_0x523e42,_0x38cf58){_0x38cf58(null,path[_0xf34e('0x12')](config[_0xf34e('0x13')],_0xf34e('0x14')));},'filename':function(_0x1161e9,_0x4402f2,_0x2a5adf){_0x2a5adf(null,util[_0xf34e('0x15')]('%s%s',_0xf34e('0x16'),path['extname'](_0x4402f2[_0xf34e('0x17')])));}})});router[_0xf34e('0x18')](_0xf34e('0xb'),upload[_0xf34e('0x19')](_0xf34e('0x1a')),controller[_0xf34e('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c948c,_0x1d71ff,_0x1f5940){_0x1f5940(null,path[_0xf34e('0x12')](config[_0xf34e('0x13')],_0xf34e('0x14')));},'filename':function(_0x441a3b,_0x44a618,_0x1f2a17){_0x1f2a17(null,util[_0xf34e('0x15')](_0xf34e('0x1c'),_0xf34e('0x1d'),path[_0xf34e('0x1e')](_0x44a618['originalname'])));}})});router[_0xf34e('0x18')](_0xf34e('0xd'),upload[_0xf34e('0x19')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xf34e('0x11')]({'destination':function(_0x2229df,_0x5d3592,_0x4075fa){_0x4075fa(null,path[_0xf34e('0x12')](config[_0xf34e('0x13')],_0xf34e('0x14')));},'filename':function(_0x373705,_0x547906,_0x3347bc){_0x3347bc(null,util['format']('%s%s','preferred',path[_0xf34e('0x1e')](_0x547906[_0xf34e('0x17')])));}})});router[_0xf34e('0x18')](_0xf34e('0x10'),upload[_0xf34e('0x19')]('file'),controller[_0xf34e('0x1f')]);router[_0xf34e('0x20')](_0xf34e('0xa'),auth[_0xf34e('0x7')](),controller[_0xf34e('0x21')]);module[_0xf34e('0x22')]=router;
\ No newline at end of file
+var _0x3370=['/:id/logo_login','addLogoLogin','server/files/images/logos/','preferred','originalname','addPreferred','update','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','join','%s%s','extname','single','file','addLogo','diskStorage','root','format','logologin','post'];(function(_0x35cfd9,_0x2f9611){var _0x41dd83=function(_0x354d67){while(--_0x354d67){_0x35cfd9['push'](_0x35cfd9['shift']());}};_0x41dd83(++_0x2f9611);}(_0x3370,0x97));var _0x0337=function(_0x57c079,_0xa426c0){_0x57c079=_0x57c079-0x0;var _0x18970b=_0x3370[_0x57c079];return _0x18970b;};'use strict';var multer=require(_0x0337('0x0'));var util=require(_0x0337('0x1'));var path=require('path');var timeout=require(_0x0337('0x2'));var express=require(_0x0337('0x3'));var router=express['Router']();var auth=require(_0x0337('0x4'));var interaction=require(_0x0337('0x5'));var config=require('../../config/environment');var controller=require(_0x0337('0x6'));router[_0x0337('0x7')]('/',auth[_0x0337('0x8')](),controller[_0x0337('0x9')]);router[_0x0337('0x7')](_0x0337('0xa'),controller[_0x0337('0xb')]);router[_0x0337('0x7')](_0x0337('0xc'),controller[_0x0337('0xd')]);router[_0x0337('0x7')]('/:id/logo_login',controller[_0x0337('0xe')]);router[_0x0337('0x7')](_0x0337('0xf'),controller['gdpr']);router[_0x0337('0x7')](_0x0337('0x10'),controller[_0x0337('0x11')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4522b2,_0xb6cabf,_0x2418e3){_0x2418e3(null,path[_0x0337('0x12')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1c5cb4,_0x5a0345,_0xdeca01){_0xdeca01(null,util['format'](_0x0337('0x13'),'logo',path[_0x0337('0x14')](_0x5a0345['originalname'])));}})});router['post'](_0x0337('0xc'),upload[_0x0337('0x15')](_0x0337('0x16')),controller[_0x0337('0x17')]);var upload=multer({'storage':multer[_0x0337('0x18')]({'destination':function(_0xd7ee02,_0x583cd2,_0x37a8fe){_0x37a8fe(null,path[_0x0337('0x12')](config[_0x0337('0x19')],'server/files/images/logos/'));},'filename':function(_0x1cc11b,_0x2b0a01,_0xe1a40b){_0xe1a40b(null,util[_0x0337('0x1a')](_0x0337('0x13'),_0x0337('0x1b'),path[_0x0337('0x14')](_0x2b0a01['originalname'])));}})});router[_0x0337('0x1c')](_0x0337('0x1d'),upload[_0x0337('0x15')](_0x0337('0x16')),controller[_0x0337('0x1e')]);var upload=multer({'storage':multer[_0x0337('0x18')]({'destination':function(_0x538e28,_0x5e84c0,_0x4a417a){_0x4a417a(null,path[_0x0337('0x12')](config[_0x0337('0x19')],_0x0337('0x1f')));},'filename':function(_0x59b68e,_0x3d400e,_0x45cb9a){_0x45cb9a(null,util[_0x0337('0x1a')](_0x0337('0x13'),_0x0337('0x20'),path[_0x0337('0x14')](_0x3d400e[_0x0337('0x21')])));}})});router[_0x0337('0x1c')]('/:id/preferred',upload[_0x0337('0x15')](_0x0337('0x16')),controller[_0x0337('0x22')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0337('0x23')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js
index dda3b12..b6fb494 100644
--- a/server/api/setting/setting.attributes.js
+++ b/server/api/setting/setting.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf893=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','sequelize','exports','INTEGER','min_internal'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf893,0x11c));var _0x3f89=function(_0x400358,_0x5427a9){_0x400358=_0x400358-0x0;var _0x2133cf=_0xf893[_0x400358];return _0x2133cf;};'use strict';var Sequelize=require(_0x3f89('0x0'));module[_0x3f89('0x1')]={'min_internal':{'type':Sequelize[_0x3f89('0x2')](0xb),'unique':_0x3f89('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x3f89('0x2')](0xb),'unique':_0x3f89('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x3f89('0x5')],'defaultValue':_0x3f89('0x6')},'logo':{'type':Sequelize[_0x3f89('0x5')]},'defaultLogo':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x3f89('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x3f89('0x5')]},'turnaddr':{'type':Sequelize[_0x3f89('0x5')]},'turnusername':{'type':Sequelize[_0x3f89('0x5')]},'turnpassword':{'type':Sequelize[_0x3f89('0x5')]},'pageTitle':{'type':Sequelize[_0x3f89('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x3f89('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x3f89('0x5')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x3f89('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x3f89('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3f89('0x8')},'chatTimeout':{'type':Sequelize[_0x3f89('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x3f89('0x5')]},'defaultPreferred':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x3f89('0x5')]}};
\ No newline at end of file
+var _0x4f62=['BOOLEAN','alternate','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x327bd2,_0x4657d7){var _0x1bf88b=function(_0x2e6038){while(--_0x2e6038){_0x327bd2['push'](_0x327bd2['shift']());}};_0x1bf88b(++_0x4657d7);}(_0x4f62,0x19a));var _0x24f6=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x4f62[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0x24f6('0x0'));module[_0x24f6('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x24f6('0x2')](0xb),'unique':_0x24f6('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x24f6('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x24f6('0x4')],'defaultValue':_0x24f6('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x24f6('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x24f6('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x24f6('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x24f6('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x24f6('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x24f6('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x24f6('0x4')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x24f6('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x24f6('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x24f6('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x24f6('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x24f6('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x24f6('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x24f6('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x24f6('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x24f6('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x24f6('0x4')],'defaultValue':_0x24f6('0x7')},'chatTimeout':{'type':Sequelize[_0x24f6('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x24f6('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x24f6('0x4')]},'defaultPreferred':{'type':Sequelize[_0x24f6('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x24f6('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x24f6('0x4')]}};
\ No newline at end of file
diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js
index 612ff86..92e6012 100644
--- a/server/api/setting/setting.controller.js
+++ b/server/api/setting/setting.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb45=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','update','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','Setting','findAll','catch','show','params','find','body','get','readFileSync','join','root','server/files/templates/stun.ejs','render','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_rtp_asterisk.so','addLogo','file','filename','addLogoLogin','../../config/license/util','getLogo','getLicense','logo','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default','custom','Sequelize','ValidationError','Logo\x20not\x20found','download','getLogoLogin','server/files/images/logos','loginLogo','default_loginLogo.png','upperFirst','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x268628,_0x544dfc){var _0x45c597=function(_0x4649b0){while(--_0x4649b0){_0x268628['push'](_0x268628['shift']());}};_0x45c597(++_0x544dfc);}(_0xfb45,0x6a));var _0x5fb4=function(_0x2f824c,_0x798538){_0x2f824c=_0x2f824c-0x0;var _0x20753d=_0xfb45[_0x2f824c];return _0x20753d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5fb4('0x0'));var rimraf=require(_0x5fb4('0x1'));var zipdir=require(_0x5fb4('0x2'));var jsonpatch=require(_0x5fb4('0x3'));var rp=require('request-promise');var moment=require(_0x5fb4('0x4'));var BPromise=require(_0x5fb4('0x5'));var Mustache=require(_0x5fb4('0x6'));var util=require(_0x5fb4('0x7'));var path=require(_0x5fb4('0x8'));var sox=require(_0x5fb4('0x9'));var csv=require(_0x5fb4('0xa'));var ejs=require(_0x5fb4('0xb'));var fs=require('fs');var _=require(_0x5fb4('0xc'));var squel=require('squel');var crypto=require(_0x5fb4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5fb4('0xe'));var toCsv=require(_0x5fb4('0xa'));var querystring=require('querystring');var Papa=require(_0x5fb4('0xf'));var Redis=require(_0x5fb4('0x10'));var authService=require(_0x5fb4('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5fb4('0x12'));var logger=require(_0x5fb4('0x13'))(_0x5fb4('0x14'));var utils=require(_0x5fb4('0x15'));var config=require(_0x5fb4('0x16'));var db=require(_0x5fb4('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x5fb4('0x18')][_0x5fb4('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2a8734,_0x1a9cac,_0x40f00b){if(_0x40f00b){var _0x195a48=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x195a48[_0x5fb4('0x1a')](_0x1a9cac)){return _0x2a8734;}else{throw new Error(_0x5fb4('0x1b'));}}else{return _0x2a8734;}}function respondWithRpcPromise(_0xc82862,_0x48651d,_0x538727,_0x4b9968){return new BPromise(function(_0x2315f8,_0x2d216e){var _0x578387=_0x4b9968||client;return _0x578387['request'](_0xc82862,_0x538727)[_0x5fb4('0x1c')](function(_0x59c84d){logger[_0x5fb4('0x1d')](_0x5fb4('0x1e'),_0x48651d,'request\x20sent');logger[_0x5fb4('0x1f')](_0x5fb4('0x20'),_0x48651d,_0x5fb4('0x21'),JSON['stringify'](_0x59c84d));if(_0x59c84d[_0x5fb4('0x22')]){if(_0x59c84d[_0x5fb4('0x22')][_0x5fb4('0x23')]===0x1f4){logger[_0x5fb4('0x22')](_0x5fb4('0x1e'),_0x48651d,_0x59c84d['error'][_0x5fb4('0x24')]);return _0x2d216e(_0x59c84d[_0x5fb4('0x22')][_0x5fb4('0x24')]);}logger['error'](_0x5fb4('0x1e'),_0x48651d,_0x59c84d[_0x5fb4('0x22')][_0x5fb4('0x24')]);return _0x2315f8(_0x59c84d['error'][_0x5fb4('0x24')]);}else{logger['info'](_0x5fb4('0x1e'),_0x48651d,_0x5fb4('0x21'));_0x2315f8(_0x59c84d[_0x5fb4('0x25')][_0x5fb4('0x24')]);}})['catch'](function(_0x128e78){logger[_0x5fb4('0x22')](_0x5fb4('0x1e'),_0x48651d,_0x128e78);_0x2d216e(_0x128e78);});});}function respondWithStatusCode(_0x2fae54,_0xca857f){_0xca857f=_0xca857f||0xcc;return function(_0x34f261){if(_0x34f261){return _0x2fae54[_0x5fb4('0x26')](_0xca857f);}return _0x2fae54['status'](_0xca857f)[_0x5fb4('0x27')]();};}function respondWithResult(_0x1f3cb4,_0x44e7f9){_0x44e7f9=_0x44e7f9||0xc8;return function(_0x27d935){if(_0x27d935){return _0x1f3cb4[_0x5fb4('0x28')](_0x44e7f9)['json'](_0x27d935);}};}function respondWithFilteredResult(_0x2901f2,_0x3413e7){return function(_0x227f50){if(_0x227f50){var _0x56daf8=_0x227f50[_0x5fb4('0x29')],_0x1a103c=_0x3413e7[_0x5fb4('0x2a')],_0x181fc1=_0x3413e7[_0x5fb4('0x2a')]+_0x3413e7[_0x5fb4('0x2b')],_0x4cb56e;if(_0x181fc1>=_0x56daf8){_0x181fc1=_0x56daf8;_0x4cb56e=0xc8;}else{_0x4cb56e=0xce;}_0x2901f2[_0x5fb4('0x28')](_0x4cb56e);return _0x2901f2['set'](_0x5fb4('0x2c'),_0x1a103c+'-'+_0x181fc1+'/'+_0x56daf8)[_0x5fb4('0x2d')](_0x227f50);}return null;};}function patchUpdates(_0x51a880){return function(_0x5d02a6){try{jsonpatch[_0x5fb4('0x2e')](_0x5d02a6,_0x51a880,!![]);}catch(_0x4512d7){return BPromise['reject'](_0x4512d7);}return _0x5d02a6['save']();};}function saveUpdates(_0x5d1cda,_0xc25f03){return function(_0xb4e41c){if(_0xb4e41c){return _0xb4e41c[_0x5fb4('0x2f')](_0x5d1cda)['then'](function(_0x374e86){return _0x374e86;});}return null;};}function removeEntity(_0x310feb,_0xb9a173){return function(_0x119506){if(_0x119506){return _0x119506['destroy']()[_0x5fb4('0x1c')](function(){_0x310feb[_0x5fb4('0x28')](0xcc)[_0x5fb4('0x27')]();});}};}function handleEntityNotFound(_0x469f67,_0x5abb12){return function(_0x3eb77f){if(!_0x3eb77f){_0x469f67[_0x5fb4('0x26')](0x194);}return _0x3eb77f;};}function handleError(_0xa2d48d,_0x29dca1){_0x29dca1=_0x29dca1||0x1f4;return function(_0x23ff83){logger[_0x5fb4('0x22')](_0x23ff83[_0x5fb4('0x30')]);if(_0x23ff83[_0x5fb4('0x31')]){delete _0x23ff83[_0x5fb4('0x31')];}_0xa2d48d['status'](_0x29dca1)[_0x5fb4('0x32')](_0x23ff83);};}exports[_0x5fb4('0x33')]=function(_0x2c2427,_0x8626cc){var _0x462ceb={},_0x16553c={},_0x520159={'count':0x0,'rows':[]};var _0x4feec3=db['Setting'][_0x5fb4('0x34')];_0x16553c[_0x5fb4('0x35')]=_[_0x5fb4('0x36')](_0x4feec3);_0x16553c[_0x5fb4('0x37')]=_[_0x5fb4('0x36')](_0x2c2427[_0x5fb4('0x37')]);_0x16553c[_0x5fb4('0x38')]=_['intersection'](_0x16553c[_0x5fb4('0x35')],_0x16553c['query']);_0x462ceb[_0x5fb4('0x39')]=_[_0x5fb4('0x3a')](_0x16553c['model'],qs[_0x5fb4('0x3b')](_0x2c2427[_0x5fb4('0x37')][_0x5fb4('0x3b')]));_0x462ceb[_0x5fb4('0x39')]=_0x462ceb['attributes'][_0x5fb4('0x3c')]?_0x462ceb[_0x5fb4('0x39')]:_0x16553c[_0x5fb4('0x35')];if(!_0x2c2427['query'][_0x5fb4('0x3d')](_0x5fb4('0x3e'))){_0x462ceb[_0x5fb4('0x2b')]=qs[_0x5fb4('0x2b')](_0x2c2427['query'][_0x5fb4('0x2b')]);_0x462ceb[_0x5fb4('0x2a')]=qs[_0x5fb4('0x2a')](_0x2c2427[_0x5fb4('0x37')]['offset']);}_0x462ceb[_0x5fb4('0x3f')]=qs['sort'](_0x2c2427[_0x5fb4('0x37')]['sort']);_0x462ceb[_0x5fb4('0x40')]=qs[_0x5fb4('0x38')](_[_0x5fb4('0x41')](_0x2c2427[_0x5fb4('0x37')],_0x16553c[_0x5fb4('0x38')]));if(_0x2c2427[_0x5fb4('0x37')][_0x5fb4('0x42')]){_0x462ceb[_0x5fb4('0x40')]=_[_0x5fb4('0x43')](_0x462ceb[_0x5fb4('0x40')],{'$or':_[_0x5fb4('0x44')](_0x4feec3,function(_0x4c6196){if(_0x4c6196['type'][_0x5fb4('0x45')]!==_0x5fb4('0x46')){var _0x1c53c7={};_0x1c53c7[_0x4c6196[_0x5fb4('0x47')]]={'$like':'%'+_0x2c2427[_0x5fb4('0x37')]['filter']+'%'};return _0x1c53c7;}})});}_0x462ceb=_[_0x5fb4('0x43')]({},_0x462ceb,_0x2c2427[_0x5fb4('0x48')]);var _0x3fdf37={'where':_0x462ceb[_0x5fb4('0x40')]};return db['Setting'][_0x5fb4('0x29')](_0x3fdf37)[_0x5fb4('0x1c')](function(_0x2b1e32){_0x520159[_0x5fb4('0x29')]=_0x2b1e32;if(_0x2c2427[_0x5fb4('0x37')][_0x5fb4('0x49')]){_0x462ceb[_0x5fb4('0x4a')]=[{'all':!![]}];}return db[_0x5fb4('0x4b')][_0x5fb4('0x4c')](_0x462ceb);})[_0x5fb4('0x1c')](function(_0x44706e){_0x520159['rows']=_0x44706e;return _0x520159;})[_0x5fb4('0x1c')](respondWithFilteredResult(_0x8626cc,_0x462ceb))[_0x5fb4('0x4d')](handleError(_0x8626cc,null));};exports[_0x5fb4('0x4e')]=function(_0x16c133,_0x289745){var _0x385a63={'raw':![],'where':{'id':_0x16c133[_0x5fb4('0x4f')]['id']}},_0x17f1da={};_0x17f1da['model']=_[_0x5fb4('0x36')](db['Setting'][_0x5fb4('0x34')]);_0x17f1da[_0x5fb4('0x37')]=_['keys'](_0x16c133[_0x5fb4('0x37')]);_0x17f1da['filters']=_[_0x5fb4('0x3a')](_0x17f1da[_0x5fb4('0x35')],_0x17f1da['query']);_0x385a63['attributes']=_[_0x5fb4('0x3a')](_0x17f1da['model'],qs[_0x5fb4('0x3b')](_0x16c133['query'][_0x5fb4('0x3b')]));_0x385a63[_0x5fb4('0x39')]=_0x385a63['attributes'][_0x5fb4('0x3c')]?_0x385a63[_0x5fb4('0x39')]:_0x17f1da[_0x5fb4('0x35')];if(_0x16c133[_0x5fb4('0x37')][_0x5fb4('0x49')]){_0x385a63[_0x5fb4('0x4a')]=[{'all':!![]}];}_0x385a63=_[_0x5fb4('0x43')]({},_0x385a63,_0x16c133[_0x5fb4('0x48')]);return db['Setting']['find'](_0x385a63)[_0x5fb4('0x1c')](handleEntityNotFound(_0x289745,null))['then'](respondWithResult(_0x289745,null))[_0x5fb4('0x4d')](handleError(_0x289745,null));};exports[_0x5fb4('0x2f')]=function(_0xd725cf,_0xc8aa21,_0xc5ded6){var _0x52ed9f;return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0xd725cf[_0x5fb4('0x4f')]['id']}})['then'](handleEntityNotFound(_0xc8aa21,null))[_0x5fb4('0x1c')](saveUpdates(_0xd725cf[_0x5fb4('0x51')],null))[_0x5fb4('0x1c')](function(_0x1b8768){if(_0x1b8768){_0x52ed9f=_0x1b8768[_0x5fb4('0x52')]({'plain':!![]});var _0x500569=fs[_0x5fb4('0x53')](path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x5fb4('0x56')),'utf8');var _0x14c066=ejs[_0x5fb4('0x57')](_0x500569,_0x52ed9f);var _0x206285=fs[_0x5fb4('0x53')](path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x5fb4('0x58')),_0x5fb4('0x59'));var _0xc47484=ejs['render'](_0x206285,_0x52ed9f);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x14c066);fs[_0x5fb4('0x5a')](_0x5fb4('0x5b'),_0xc47484);return respondWithRpcPromise('Reload',_0x5fb4('0x2f'),{'module':'res_stun_monitor.so'});}})[_0x5fb4('0x1c')](function(){return respondWithRpcPromise(_0x5fb4('0x5c'),_0x5fb4('0x2f'),{'module':_0x5fb4('0x5d')});})['then'](function(){return _0x52ed9f||null;})[_0x5fb4('0x1c')](respondWithResult(_0xc8aa21,null))[_0x5fb4('0x4d')](handleError(_0xc8aa21,null));};exports[_0x5fb4('0x5e')]=function(_0x38a0b4,_0x3ae33b,_0x8d4fb0){if(_0x38a0b4[_0x5fb4('0x5f')]&&_0x38a0b4['file'][_0x5fb4('0x60')]){_0x38a0b4[_0x5fb4('0x51')]['logo']=_0x38a0b4[_0x5fb4('0x5f')][_0x5fb4('0x60')];}return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0x38a0b4[_0x5fb4('0x4f')]['id']}})[_0x5fb4('0x1c')](handleEntityNotFound(_0x3ae33b,null))[_0x5fb4('0x1c')](saveUpdates(_0x38a0b4[_0x5fb4('0x51')],null))[_0x5fb4('0x1c')](respondWithResult(_0x3ae33b,null))[_0x5fb4('0x4d')](handleError(_0x3ae33b,null));};exports[_0x5fb4('0x61')]=function(_0x5ad474,_0x46d630,_0x40b813){if(_0x5ad474[_0x5fb4('0x5f')]&&_0x5ad474[_0x5fb4('0x5f')][_0x5fb4('0x60')]){_0x5ad474[_0x5fb4('0x51')]['loginLogo']=_0x5ad474[_0x5fb4('0x5f')][_0x5fb4('0x60')];}return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0x5ad474[_0x5fb4('0x4f')]['id']}})[_0x5fb4('0x1c')](handleEntityNotFound(_0x46d630,null))['then'](saveUpdates(_0x5ad474[_0x5fb4('0x51')],null))[_0x5fb4('0x1c')](respondWithResult(_0x46d630,null))['catch'](handleError(_0x46d630,null));};var utilLicense=require(_0x5fb4('0x62'));exports[_0x5fb4('0x63')]=function(_0x349955,_0x31d8c9,_0x4be7ed){var _0x2ef281='server/files/images/logos';var _0x214124={'custom':![]};return utilLicense[_0x5fb4('0x64')]()[_0x5fb4('0x1c')](function(_0x4d5221){if(_0x4d5221){_0x214124=_0x4d5221;}return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0x349955[_0x5fb4('0x4f')]['id']},'attributes':[_0x5fb4('0x65'),'loginLogo',_0x5fb4('0x66'),_0x5fb4('0x67'),_0x5fb4('0x68'),_0x5fb4('0x69')],'raw':!![]});})[_0x5fb4('0x1c')](handleEntityNotFound(_0x31d8c9,null))[_0x5fb4('0x1c')](function(_0x3d5704){if(_0x3d5704){var _0x4cad34=_0x3d5704['logo']&&fs[_0x5fb4('0x6a')](path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x2ef281,_['toLower'](_0x3d5704['logo'])))?path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x2ef281,_['toLower'](_0x3d5704['logo'])):path['join'](config[_0x5fb4('0x55')],_0x2ef281,_[_0x5fb4('0x6b')]('default_logo.png'));var _0x54278b=_0x5fb4('0x6c')+_['upperFirst'](_0x5fb4('0x65'));if(_0x3d5704[_0x54278b]||!_0x214124[_0x5fb4('0x6d')]){_0x4cad34=path[_0x5fb4('0x54')](config['root'],_0x2ef281,_['toLower']('default_logo.png'));}if(!fs[_0x5fb4('0x6a')](_0x4cad34)){throw new db[(_0x5fb4('0x6e'))][(_0x5fb4('0x6f'))](_0x5fb4('0x70'));}return _0x31d8c9[_0x5fb4('0x71')](_0x4cad34);}})[_0x5fb4('0x4d')](handleError(_0x31d8c9,null));};var utilLicense=require(_0x5fb4('0x62'));exports[_0x5fb4('0x72')]=function(_0x1d2b93,_0xaac510,_0x428d52){var _0x262e2f=_0x5fb4('0x73');var _0x1c2a92={'custom':![]};return utilLicense['getLicense']()[_0x5fb4('0x1c')](function(_0x341b01){if(_0x341b01){_0x1c2a92=_0x341b01;}return db['Setting']['find']({'where':{'id':_0x1d2b93[_0x5fb4('0x4f')]['id']},'attributes':['logo',_0x5fb4('0x74'),'preferred',_0x5fb4('0x67'),_0x5fb4('0x68'),_0x5fb4('0x69')],'raw':!![]});})['then'](handleEntityNotFound(_0xaac510,null))[_0x5fb4('0x1c')](function(_0x38e1b3){if(_0x38e1b3){var _0x1ab1b9=_0x38e1b3[_0x5fb4('0x74')]&&fs[_0x5fb4('0x6a')](path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x262e2f,_[_0x5fb4('0x6b')](_0x38e1b3[_0x5fb4('0x74')])))?path['join'](config[_0x5fb4('0x55')],_0x262e2f,_['toLower'](_0x38e1b3[_0x5fb4('0x74')])):path['join'](config[_0x5fb4('0x55')],_0x262e2f,_[_0x5fb4('0x6b')](_0x5fb4('0x75')));var _0x14b732='default'+_[_0x5fb4('0x76')](_0x5fb4('0x74'));if(_0x38e1b3[_0x14b732]||!_0x1c2a92[_0x5fb4('0x6d')]){_0x1ab1b9=path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x262e2f,_['toLower'](_0x5fb4('0x75')));}if(!fs[_0x5fb4('0x6a')](_0x1ab1b9)){throw new db[(_0x5fb4('0x6e'))][(_0x5fb4('0x6f'))](_0x5fb4('0x70'));}return _0xaac510[_0x5fb4('0x71')](_0x1ab1b9);}})[_0x5fb4('0x4d')](handleError(_0xaac510,null));};exports[_0x5fb4('0x77')]=function(_0xa7df89,_0x1018bb){return db[_0x5fb4('0x4b')]['find']({'where':{'id':_0xa7df89[_0x5fb4('0x4f')]['id']},'attributes':[_0x5fb4('0x78')]})[_0x5fb4('0x1c')](respondWithResult(_0x1018bb,null))[_0x5fb4('0x4d')](handleError(_0x1018bb,null));};exports[_0x5fb4('0x79')]=function(_0x2e04d1,_0x3cd3ff,_0xfa12a3){if(_0x2e04d1[_0x5fb4('0x5f')]&&_0x2e04d1[_0x5fb4('0x5f')][_0x5fb4('0x60')]){_0x2e04d1[_0x5fb4('0x51')][_0x5fb4('0x66')]=_0x2e04d1[_0x5fb4('0x5f')][_0x5fb4('0x60')];}return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0x2e04d1[_0x5fb4('0x4f')]['id']}})[_0x5fb4('0x1c')](handleEntityNotFound(_0x3cd3ff,null))['then'](saveUpdates(_0x2e04d1[_0x5fb4('0x51')],null))['then'](respondWithResult(_0x3cd3ff,null))[_0x5fb4('0x4d')](handleError(_0x3cd3ff,null));};var utilLicense=require(_0x5fb4('0x62'));exports[_0x5fb4('0x7a')]=function(_0x9488b7,_0x4638f8,_0x47c1c8){var _0x36d2c3=_0x5fb4('0x73');var _0x25aa57={'custom':![]};return utilLicense[_0x5fb4('0x64')]()[_0x5fb4('0x1c')](function(_0x2e0bc6){if(_0x2e0bc6){_0x25aa57=_0x2e0bc6;}return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0x9488b7[_0x5fb4('0x4f')]['id']},'attributes':[_0x5fb4('0x65'),_0x5fb4('0x74'),_0x5fb4('0x66'),_0x5fb4('0x67'),'defaultLoginLogo','defaultPreferred'],'raw':!![]});})['then'](handleEntityNotFound(_0x4638f8,null))[_0x5fb4('0x1c')](function(_0x21017f){if(_0x21017f){var _0x14f75f=_0x21017f['preferred']&&fs[_0x5fb4('0x6a')](path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x36d2c3,_[_0x5fb4('0x6b')](_0x21017f[_0x5fb4('0x66')])))?path[_0x5fb4('0x54')](config['root'],_0x36d2c3,_['toLower'](_0x21017f['preferred'])):path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x36d2c3,_[_0x5fb4('0x6b')](_0x5fb4('0x7b')));var _0x294b12=_0x5fb4('0x6c')+_['upperFirst'](_0x5fb4('0x66'));if(_0x21017f[_0x294b12]||!_0x25aa57[_0x5fb4('0x6d')]||!_0x25aa57[_0x5fb4('0x66')]){_0x14f75f=path[_0x5fb4('0x54')](config['root'],_0x36d2c3,_['toLower'](_0x5fb4('0x7b')));}if(!fs[_0x5fb4('0x6a')](_0x14f75f)){throw new db['Sequelize'][(_0x5fb4('0x6f'))](_0x5fb4('0x70'));}return _0x4638f8[_0x5fb4('0x71')](_0x14f75f);}})[_0x5fb4('0x4d')](handleError(_0x4638f8,null));};
\ No newline at end of file
+var _0x2a19=['mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','request\x20sent','error','code','Setting,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','merge','map','type','key','VIRTUAL','field','filter','Setting','includeAll','include','findAll','params','find','body','readFileSync','join','root','utf8','render','server/files/templates/turn.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','defaultLogo','defaultPreferred','existsSync','toLower','default','upperFirst','custom','Logo\x20not\x20found','getLogoLogin','preferred','default_loginLogo.png','download','getPreferred','defaultLoginLogo','default_preferred.png','Sequelize','ValidationError','fast-json-patch','request-promise','moment','bluebird'];(function(_0xdfd284,_0x41b233){var _0x85ac9a=function(_0xa1030a){while(--_0xa1030a){_0xdfd284['push'](_0xdfd284['shift']());}};_0x85ac9a(++_0x41b233);}(_0x2a19,0x1e0));var _0x92a1=function(_0x403bfc,_0x5e9452){_0x403bfc=_0x403bfc-0x0;var _0x55eb0f=_0x2a19[_0x403bfc];return _0x55eb0f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x92a1('0x0'));var rp=require(_0x92a1('0x1'));var moment=require(_0x92a1('0x2'));var BPromise=require(_0x92a1('0x3'));var Mustache=require(_0x92a1('0x4'));var util=require(_0x92a1('0x5'));var path=require(_0x92a1('0x6'));var sox=require(_0x92a1('0x7'));var csv=require(_0x92a1('0x8'));var ejs=require(_0x92a1('0x9'));var fs=require('fs');var _=require(_0x92a1('0xa'));var squel=require(_0x92a1('0xb'));var crypto=require(_0x92a1('0xc'));var jsforce=require(_0x92a1('0xd'));var deskjs=require(_0x92a1('0xe'));var toCsv=require(_0x92a1('0x8'));var querystring=require(_0x92a1('0xf'));var Papa=require(_0x92a1('0x10'));var Redis=require(_0x92a1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x92a1('0x12'));var hardwareService=require(_0x92a1('0x13'));var logger=require('../../config/logger')(_0x92a1('0x14'));var utils=require(_0x92a1('0x15'));var config=require(_0x92a1('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x92a1('0x17'));var client=jayson[_0x92a1('0x18')][_0x92a1('0x19')]({'port':0x232a});function checkPasswordPattern(_0xed2549,_0x57bb38,_0x2b5e14){if(_0x2b5e14){var _0x2e0be5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e0be5[_0x92a1('0x1a')](_0x57bb38)){return _0xed2549;}else{throw new Error(_0x92a1('0x1b'));}}else{return _0xed2549;}}function respondWithRpcPromise(_0x50c9f5,_0x30c945,_0x3c5b9d,_0x4e03eb){return new BPromise(function(_0x40b9fe,_0x531e52){var _0x17dad3=_0x4e03eb||client;return _0x17dad3[_0x92a1('0x1c')](_0x50c9f5,_0x3c5b9d)[_0x92a1('0x1d')](function(_0x2ae0b7){logger['info']('Setting,\x20%s,\x20%s',_0x30c945,'request\x20sent');logger[_0x92a1('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x30c945,_0x92a1('0x1f'),JSON['stringify'](_0x2ae0b7));if(_0x2ae0b7['error']){if(_0x2ae0b7[_0x92a1('0x20')][_0x92a1('0x21')]===0x1f4){logger[_0x92a1('0x20')](_0x92a1('0x22'),_0x30c945,_0x2ae0b7[_0x92a1('0x20')][_0x92a1('0x23')]);return _0x531e52(_0x2ae0b7[_0x92a1('0x20')][_0x92a1('0x23')]);}logger[_0x92a1('0x20')](_0x92a1('0x22'),_0x30c945,_0x2ae0b7[_0x92a1('0x20')][_0x92a1('0x23')]);return _0x40b9fe(_0x2ae0b7[_0x92a1('0x20')][_0x92a1('0x23')]);}else{logger[_0x92a1('0x24')](_0x92a1('0x22'),_0x30c945,_0x92a1('0x1f'));_0x40b9fe(_0x2ae0b7['result'][_0x92a1('0x23')]);}})[_0x92a1('0x25')](function(_0x13ef31){logger[_0x92a1('0x20')](_0x92a1('0x22'),_0x30c945,_0x13ef31);_0x531e52(_0x13ef31);});});}function respondWithStatusCode(_0x1c3b38,_0x1e4fac){_0x1e4fac=_0x1e4fac||0xcc;return function(_0x160a52){if(_0x160a52){return _0x1c3b38[_0x92a1('0x26')](_0x1e4fac);}return _0x1c3b38[_0x92a1('0x27')](_0x1e4fac)['end']();};}function respondWithResult(_0x100dee,_0x31bb1f){_0x31bb1f=_0x31bb1f||0xc8;return function(_0x42141c){if(_0x42141c){return _0x100dee['status'](_0x31bb1f)[_0x92a1('0x28')](_0x42141c);}};}function respondWithFilteredResult(_0x12b430,_0xbeb0c6){return function(_0xdd2c71){if(_0xdd2c71){var _0x4a4b7d=_0xdd2c71[_0x92a1('0x29')],_0x28e69c=_0xbeb0c6['offset'],_0x3fb425=_0xbeb0c6['offset']+_0xbeb0c6[_0x92a1('0x2a')],_0x30213e;if(_0x3fb425>=_0x4a4b7d){_0x3fb425=_0x4a4b7d;_0x30213e=0xc8;}else{_0x30213e=0xce;}_0x12b430['status'](_0x30213e);return _0x12b430[_0x92a1('0x2b')](_0x92a1('0x2c'),_0x28e69c+'-'+_0x3fb425+'/'+_0x4a4b7d)['json'](_0xdd2c71);}return null;};}function patchUpdates(_0xa30592){return function(_0x404eeb){try{jsonpatch[_0x92a1('0x2d')](_0x404eeb,_0xa30592,!![]);}catch(_0x25b764){return BPromise[_0x92a1('0x2e')](_0x25b764);}return _0x404eeb[_0x92a1('0x2f')]();};}function saveUpdates(_0x310599,_0x101308){return function(_0x5d1e8e){if(_0x5d1e8e){return _0x5d1e8e[_0x92a1('0x30')](_0x310599)[_0x92a1('0x1d')](function(_0x2f0c19){return _0x2f0c19;});}return null;};}function removeEntity(_0x4c592b,_0x2195ff){return function(_0x1d3aa5){if(_0x1d3aa5){return _0x1d3aa5[_0x92a1('0x31')]()[_0x92a1('0x1d')](function(){_0x4c592b[_0x92a1('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x297b08,_0x3f5323){return function(_0x3a1f43){if(!_0x3a1f43){_0x297b08[_0x92a1('0x26')](0x194);}return _0x3a1f43;};}function handleError(_0xcb24b0,_0x3d7ab1){_0x3d7ab1=_0x3d7ab1||0x1f4;return function(_0x589160){logger['error'](_0x589160[_0x92a1('0x32')]);if(_0x589160[_0x92a1('0x33')]){delete _0x589160[_0x92a1('0x33')];}_0xcb24b0[_0x92a1('0x27')](_0x3d7ab1)[_0x92a1('0x34')](_0x589160);};}exports['index']=function(_0x4225dc,_0x127c9c){var _0x1e862a={},_0x1c56f6={},_0x489ed7={'count':0x0,'rows':[]};var _0x1a7bcc=db['Setting'][_0x92a1('0x35')];_0x1c56f6[_0x92a1('0x36')]=_[_0x92a1('0x37')](_0x1a7bcc);_0x1c56f6['query']=_[_0x92a1('0x37')](_0x4225dc['query']);_0x1c56f6['filters']=_['intersection'](_0x1c56f6[_0x92a1('0x36')],_0x1c56f6[_0x92a1('0x38')]);_0x1e862a['attributes']=_[_0x92a1('0x39')](_0x1c56f6['model'],qs[_0x92a1('0x3a')](_0x4225dc['query'][_0x92a1('0x3a')]));_0x1e862a[_0x92a1('0x3b')]=_0x1e862a[_0x92a1('0x3b')]['length']?_0x1e862a[_0x92a1('0x3b')]:_0x1c56f6[_0x92a1('0x36')];if(!_0x4225dc['query'][_0x92a1('0x3c')](_0x92a1('0x3d'))){_0x1e862a['limit']=qs['limit'](_0x4225dc[_0x92a1('0x38')][_0x92a1('0x2a')]);_0x1e862a['offset']=qs[_0x92a1('0x3e')](_0x4225dc[_0x92a1('0x38')][_0x92a1('0x3e')]);}_0x1e862a[_0x92a1('0x3f')]=qs[_0x92a1('0x40')](_0x4225dc[_0x92a1('0x38')]['sort']);_0x1e862a[_0x92a1('0x41')]=qs['filters'](_[_0x92a1('0x42')](_0x4225dc[_0x92a1('0x38')],_0x1c56f6[_0x92a1('0x43')]));if(_0x4225dc[_0x92a1('0x38')]['filter']){_0x1e862a['where']=_[_0x92a1('0x44')](_0x1e862a[_0x92a1('0x41')],{'$or':_[_0x92a1('0x45')](_0x1a7bcc,function(_0x2b76d8){if(_0x2b76d8[_0x92a1('0x46')][_0x92a1('0x47')]!==_0x92a1('0x48')){var _0x5850ac={};_0x5850ac[_0x2b76d8[_0x92a1('0x49')]]={'$like':'%'+_0x4225dc['query'][_0x92a1('0x4a')]+'%'};return _0x5850ac;}})});}_0x1e862a=_[_0x92a1('0x44')]({},_0x1e862a,_0x4225dc['options']);var _0xb3c05b={'where':_0x1e862a['where']};return db[_0x92a1('0x4b')][_0x92a1('0x29')](_0xb3c05b)['then'](function(_0x54c7b8){_0x489ed7[_0x92a1('0x29')]=_0x54c7b8;if(_0x4225dc[_0x92a1('0x38')][_0x92a1('0x4c')]){_0x1e862a[_0x92a1('0x4d')]=[{'all':!![]}];}return db[_0x92a1('0x4b')][_0x92a1('0x4e')](_0x1e862a);})[_0x92a1('0x1d')](function(_0x50d943){_0x489ed7['rows']=_0x50d943;return _0x489ed7;})[_0x92a1('0x1d')](respondWithFilteredResult(_0x127c9c,_0x1e862a))[_0x92a1('0x25')](handleError(_0x127c9c,null));};exports['show']=function(_0x3c5d2e,_0x17dee3){var _0x220082={'raw':![],'where':{'id':_0x3c5d2e[_0x92a1('0x4f')]['id']}},_0x426fea={};_0x426fea[_0x92a1('0x36')]=_[_0x92a1('0x37')](db[_0x92a1('0x4b')][_0x92a1('0x35')]);_0x426fea[_0x92a1('0x38')]=_[_0x92a1('0x37')](_0x3c5d2e['query']);_0x426fea['filters']=_[_0x92a1('0x39')](_0x426fea['model'],_0x426fea[_0x92a1('0x38')]);_0x220082[_0x92a1('0x3b')]=_[_0x92a1('0x39')](_0x426fea[_0x92a1('0x36')],qs[_0x92a1('0x3a')](_0x3c5d2e[_0x92a1('0x38')]['fields']));_0x220082[_0x92a1('0x3b')]=_0x220082['attributes']['length']?_0x220082['attributes']:_0x426fea[_0x92a1('0x36')];if(_0x3c5d2e[_0x92a1('0x38')][_0x92a1('0x4c')]){_0x220082[_0x92a1('0x4d')]=[{'all':!![]}];}_0x220082=_[_0x92a1('0x44')]({},_0x220082,_0x3c5d2e['options']);return db[_0x92a1('0x4b')]['find'](_0x220082)[_0x92a1('0x1d')](handleEntityNotFound(_0x17dee3,null))[_0x92a1('0x1d')](respondWithResult(_0x17dee3,null))[_0x92a1('0x25')](handleError(_0x17dee3,null));};exports['update']=function(_0x5c746b,_0x4d509b,_0x46232e){var _0x1a5f89;return db[_0x92a1('0x4b')][_0x92a1('0x50')]({'where':{'id':_0x5c746b[_0x92a1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4d509b,null))[_0x92a1('0x1d')](saveUpdates(_0x5c746b[_0x92a1('0x51')],null))[_0x92a1('0x1d')](function(_0x13cd3e){if(_0x13cd3e){_0x1a5f89=_0x13cd3e['get']({'plain':!![]});var _0x242860=fs[_0x92a1('0x52')](path[_0x92a1('0x53')](config[_0x92a1('0x54')],'server/files/templates/stun.ejs'),_0x92a1('0x55'));var _0x13096c=ejs[_0x92a1('0x56')](_0x242860,_0x1a5f89);var _0x59c998=fs[_0x92a1('0x52')](path[_0x92a1('0x53')](config[_0x92a1('0x54')],_0x92a1('0x57')),_0x92a1('0x55'));var _0x5dd298=ejs[_0x92a1('0x56')](_0x59c998,_0x1a5f89);fs[_0x92a1('0x58')](_0x92a1('0x59'),_0x13096c);fs[_0x92a1('0x58')](_0x92a1('0x5a'),_0x5dd298);return respondWithRpcPromise(_0x92a1('0x5b'),_0x92a1('0x30'),{'module':_0x92a1('0x5c')});}})[_0x92a1('0x1d')](function(){return respondWithRpcPromise(_0x92a1('0x5b'),'update',{'module':_0x92a1('0x5d')});})[_0x92a1('0x1d')](function(){return _0x1a5f89||null;})[_0x92a1('0x1d')](respondWithResult(_0x4d509b,null))[_0x92a1('0x25')](handleError(_0x4d509b,null));};exports[_0x92a1('0x5e')]=function(_0x54ed25,_0x585949,_0xface0a){if(_0x54ed25[_0x92a1('0x5f')]&&_0x54ed25[_0x92a1('0x5f')]['filename']){_0x54ed25['body'][_0x92a1('0x60')]=_0x54ed25[_0x92a1('0x5f')][_0x92a1('0x61')];}return db['Setting'][_0x92a1('0x50')]({'where':{'id':_0x54ed25['params']['id']}})['then'](handleEntityNotFound(_0x585949,null))['then'](saveUpdates(_0x54ed25[_0x92a1('0x51')],null))[_0x92a1('0x1d')](respondWithResult(_0x585949,null))[_0x92a1('0x25')](handleError(_0x585949,null));};exports[_0x92a1('0x62')]=function(_0x4f11dc,_0x3a973d,_0x2df702){if(_0x4f11dc[_0x92a1('0x5f')]&&_0x4f11dc[_0x92a1('0x5f')][_0x92a1('0x61')]){_0x4f11dc['body'][_0x92a1('0x63')]=_0x4f11dc[_0x92a1('0x5f')][_0x92a1('0x61')];}return db['Setting']['find']({'where':{'id':_0x4f11dc[_0x92a1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3a973d,null))[_0x92a1('0x1d')](saveUpdates(_0x4f11dc['body'],null))['then'](respondWithResult(_0x3a973d,null))['catch'](handleError(_0x3a973d,null));};var utilLicense=require(_0x92a1('0x64'));exports[_0x92a1('0x65')]=function(_0x395f79,_0x3080f9,_0x2a2b4e){var _0x53738e=_0x92a1('0x66');var _0x43da5f={'custom':![]};return utilLicense[_0x92a1('0x67')]()[_0x92a1('0x1d')](function(_0x5ecc5e){if(_0x5ecc5e){_0x43da5f=_0x5ecc5e;}return db['Setting'][_0x92a1('0x50')]({'where':{'id':_0x395f79['params']['id']},'attributes':[_0x92a1('0x60'),'loginLogo','preferred',_0x92a1('0x68'),'defaultLoginLogo',_0x92a1('0x69')],'raw':!![]});})[_0x92a1('0x1d')](handleEntityNotFound(_0x3080f9,null))[_0x92a1('0x1d')](function(_0x29cc02){if(_0x29cc02){var _0x287b7f=_0x29cc02[_0x92a1('0x60')]&&fs[_0x92a1('0x6a')](path[_0x92a1('0x53')](config['root'],_0x53738e,_[_0x92a1('0x6b')](_0x29cc02[_0x92a1('0x60')])))?path['join'](config[_0x92a1('0x54')],_0x53738e,_[_0x92a1('0x6b')](_0x29cc02[_0x92a1('0x60')])):path[_0x92a1('0x53')](config[_0x92a1('0x54')],_0x53738e,_[_0x92a1('0x6b')]('default_logo.png'));var _0x33dec9=_0x92a1('0x6c')+_[_0x92a1('0x6d')]('logo');if(_0x29cc02[_0x33dec9]||!_0x43da5f[_0x92a1('0x6e')]){_0x287b7f=path[_0x92a1('0x53')](config[_0x92a1('0x54')],_0x53738e,_[_0x92a1('0x6b')]('default_logo.png'));}if(!fs[_0x92a1('0x6a')](_0x287b7f)){throw new db['Sequelize']['ValidationError'](_0x92a1('0x6f'));}return _0x3080f9['download'](_0x287b7f);}})['catch'](handleError(_0x3080f9,null));};var utilLicense=require('../../config/license/util');exports[_0x92a1('0x70')]=function(_0x3d7fb2,_0xd6c573,_0x4d159c){var _0x1b1bfb=_0x92a1('0x66');var _0x305d91={'custom':![]};return utilLicense['getLicense']()[_0x92a1('0x1d')](function(_0x3578a1){if(_0x3578a1){_0x305d91=_0x3578a1;}return db[_0x92a1('0x4b')][_0x92a1('0x50')]({'where':{'id':_0x3d7fb2[_0x92a1('0x4f')]['id']},'attributes':[_0x92a1('0x60'),_0x92a1('0x63'),_0x92a1('0x71'),_0x92a1('0x68'),'defaultLoginLogo',_0x92a1('0x69')],'raw':!![]});})[_0x92a1('0x1d')](handleEntityNotFound(_0xd6c573,null))['then'](function(_0x4c6e93){if(_0x4c6e93){var _0x5c2089=_0x4c6e93[_0x92a1('0x63')]&&fs[_0x92a1('0x6a')](path[_0x92a1('0x53')](config[_0x92a1('0x54')],_0x1b1bfb,_['toLower'](_0x4c6e93['loginLogo'])))?path['join'](config[_0x92a1('0x54')],_0x1b1bfb,_[_0x92a1('0x6b')](_0x4c6e93[_0x92a1('0x63')])):path[_0x92a1('0x53')](config[_0x92a1('0x54')],_0x1b1bfb,_[_0x92a1('0x6b')](_0x92a1('0x72')));var _0x229538='default'+_[_0x92a1('0x6d')](_0x92a1('0x63'));if(_0x4c6e93[_0x229538]||!_0x305d91[_0x92a1('0x6e')]){_0x5c2089=path[_0x92a1('0x53')](config[_0x92a1('0x54')],_0x1b1bfb,_['toLower'](_0x92a1('0x72')));}if(!fs['existsSync'](_0x5c2089)){throw new db['Sequelize']['ValidationError']('Logo\x20not\x20found');}return _0xd6c573[_0x92a1('0x73')](_0x5c2089);}})[_0x92a1('0x25')](handleError(_0xd6c573,null));};exports['gdpr']=function(_0x455e41,_0x3bd2b0){return db['Setting'][_0x92a1('0x50')]({'where':{'id':_0x455e41[_0x92a1('0x4f')]['id']},'attributes':['securePassword']})[_0x92a1('0x1d')](respondWithResult(_0x3bd2b0,null))[_0x92a1('0x25')](handleError(_0x3bd2b0,null));};exports['addPreferred']=function(_0x4289c5,_0x357ce3,_0x5bd3f4){if(_0x4289c5[_0x92a1('0x5f')]&&_0x4289c5[_0x92a1('0x5f')][_0x92a1('0x61')]){_0x4289c5[_0x92a1('0x51')][_0x92a1('0x71')]=_0x4289c5[_0x92a1('0x5f')]['filename'];}return db[_0x92a1('0x4b')][_0x92a1('0x50')]({'where':{'id':_0x4289c5[_0x92a1('0x4f')]['id']}})[_0x92a1('0x1d')](handleEntityNotFound(_0x357ce3,null))[_0x92a1('0x1d')](saveUpdates(_0x4289c5[_0x92a1('0x51')],null))[_0x92a1('0x1d')](respondWithResult(_0x357ce3,null))[_0x92a1('0x25')](handleError(_0x357ce3,null));};var utilLicense=require(_0x92a1('0x64'));exports[_0x92a1('0x74')]=function(_0x5df8ad,_0xb9899f,_0x1700a9){var _0x538923=_0x92a1('0x66');var _0x23788c={'custom':![]};return utilLicense[_0x92a1('0x67')]()[_0x92a1('0x1d')](function(_0x2efd07){if(_0x2efd07){_0x23788c=_0x2efd07;}return db[_0x92a1('0x4b')][_0x92a1('0x50')]({'where':{'id':_0x5df8ad['params']['id']},'attributes':[_0x92a1('0x60'),_0x92a1('0x63'),_0x92a1('0x71'),_0x92a1('0x68'),_0x92a1('0x75'),'defaultPreferred'],'raw':!![]});})[_0x92a1('0x1d')](handleEntityNotFound(_0xb9899f,null))[_0x92a1('0x1d')](function(_0x520def){if(_0x520def){var _0x378f2b=_0x520def[_0x92a1('0x71')]&&fs[_0x92a1('0x6a')](path[_0x92a1('0x53')](config['root'],_0x538923,_[_0x92a1('0x6b')](_0x520def['preferred'])))?path[_0x92a1('0x53')](config['root'],_0x538923,_[_0x92a1('0x6b')](_0x520def[_0x92a1('0x71')])):path[_0x92a1('0x53')](config[_0x92a1('0x54')],_0x538923,_[_0x92a1('0x6b')](_0x92a1('0x76')));var _0x2c211c=_0x92a1('0x6c')+_[_0x92a1('0x6d')]('preferred');if(_0x520def[_0x2c211c]||!_0x23788c[_0x92a1('0x6e')]||!_0x23788c[_0x92a1('0x71')]){_0x378f2b=path[_0x92a1('0x53')](config['root'],_0x538923,_[_0x92a1('0x6b')](_0x92a1('0x76')));}if(!fs[_0x92a1('0x6a')](_0x378f2b)){throw new db[(_0x92a1('0x77'))][(_0x92a1('0x78'))]('Logo\x20not\x20found');}return _0xb9899f[_0x92a1('0x73')](_0x378f2b);}})['catch'](handleError(_0xb9899f,null));};
\ No newline at end of file
diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js
index d4e403a..04f02ed 100644
--- a/server/api/setting/setting.model.js
+++ b/server/api/setting/setting.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcabc=['path','rimraf','../../config/environment','./setting.attributes','define','Setting','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2fc3ee,_0x56ab8c){var _0x2ad3f4=function(_0x101eca){while(--_0x101eca){_0x2fc3ee['push'](_0x2fc3ee['shift']());}};_0x2ad3f4(++_0x56ab8c);}(_0xcabc,0x7f));var _0xccab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcabc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xccab('0x0'))(_0xccab('0x1'));var moment=require(_0xccab('0x2'));var BPromise=require(_0xccab('0x3'));var rp=require(_0xccab('0x4'));var fs=require('fs');var path=require(_0xccab('0x5'));var rimraf=require(_0xccab('0x6'));var config=require(_0xccab('0x7'));var attributes=require(_0xccab('0x8'));module['exports']=function(_0x550f78,_0x535b46){return _0x550f78[_0xccab('0x9')](_0xccab('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3cb3=['../../config/environment','./setting.attributes','exports','define','settings','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x3cb3,0xf5));var _0x33cb=function(_0x1f6950,_0x26287a){_0x1f6950=_0x1f6950-0x0;var _0x51e57e=_0x3cb3[_0x1f6950];return _0x51e57e;};'use strict';var _=require('lodash');var util=require(_0x33cb('0x0'));var logger=require(_0x33cb('0x1'))(_0x33cb('0x2'));var moment=require(_0x33cb('0x3'));var BPromise=require(_0x33cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x33cb('0x5'));var rimraf=require(_0x33cb('0x6'));var config=require(_0x33cb('0x7'));var attributes=require(_0x33cb('0x8'));module[_0x33cb('0x9')]=function(_0x342cda,_0x3cd7a9){return _0x342cda[_0x33cb('0xa')]('Setting',attributes,{'tableName':_0x33cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js
index d2183bf..f7a6f83 100644
--- a/server/api/setting/setting.rpc.js
+++ b/server/api/setting/setting.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x93b8=['http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x65eb6d,_0x3cd45c){var _0x580e3d=function(_0x346085){while(--_0x346085){_0x65eb6d['push'](_0x65eb6d['shift']());}};_0x580e3d(++_0x3cd45c);}(_0x93b8,0x160));var _0x893b=function(_0x1e33fd,_0x12d3a5){_0x1e33fd=_0x1e33fd-0x0;var _0x4f4ea7=_0x93b8[_0x1e33fd];return _0x4f4ea7;};'use strict';var _=require(_0x893b('0x0'));var util=require(_0x893b('0x1'));var moment=require(_0x893b('0x2'));var BPromise=require(_0x893b('0x3'));var rs=require(_0x893b('0x4'));var fs=require('fs');var Redis=require(_0x893b('0x5'));var db=require(_0x893b('0x6'))['db'];var utils=require(_0x893b('0x7'));var logger=require(_0x893b('0x8'))(_0x893b('0x9'));var config=require('../../config/environment');var jayson=require(_0x893b('0xa'));var client=jayson[_0x893b('0xb')][_0x893b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3db73d,_0x310774,_0x48b5eb){return new BPromise(function(_0x135189,_0x3310dc){return client[_0x893b('0xd')](_0x3db73d,_0x48b5eb)[_0x893b('0xe')](function(_0x21c8ba){logger[_0x893b('0xf')](_0x893b('0x10'),_0x310774,_0x893b('0x11'));logger[_0x893b('0x12')](_0x893b('0x13'),_0x310774,_0x893b('0x11'),JSON[_0x893b('0x14')](_0x21c8ba));if(_0x21c8ba[_0x893b('0x15')]){if(_0x21c8ba[_0x893b('0x15')][_0x893b('0x16')]===0x1f4){logger[_0x893b('0x15')](_0x893b('0x10'),_0x310774,_0x21c8ba[_0x893b('0x15')][_0x893b('0x17')]);return _0x3310dc(_0x21c8ba['error']['message']);}logger[_0x893b('0x15')](_0x893b('0x10'),_0x310774,_0x21c8ba[_0x893b('0x15')]['message']);return _0x135189(_0x21c8ba[_0x893b('0x15')][_0x893b('0x17')]);}else{logger[_0x893b('0xf')](_0x893b('0x10'),_0x310774,_0x893b('0x11'));_0x135189(_0x21c8ba[_0x893b('0x18')][_0x893b('0x17')]);}})[_0x893b('0x19')](function(_0x8fcc83){logger[_0x893b('0x15')](_0x893b('0x10'),_0x310774,_0x8fcc83);_0x3310dc(_0x8fcc83);});});}
\ No newline at end of file
+var _0x96e6=['info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x6122fd,_0x31c7f3){var _0x5bc712=function(_0x4394b0){while(--_0x4394b0){_0x6122fd['push'](_0x6122fd['shift']());}};_0x5bc712(++_0x31c7f3);}(_0x96e6,0xab));var _0x696e=function(_0x442ffc,_0xcdb585){_0x442ffc=_0x442ffc-0x0;var _0xfc70a3=_0x96e6[_0x442ffc];return _0xfc70a3;};'use strict';var _=require(_0x696e('0x0'));var util=require(_0x696e('0x1'));var moment=require(_0x696e('0x2'));var BPromise=require('bluebird');var rs=require(_0x696e('0x3'));var fs=require('fs');var Redis=require(_0x696e('0x4'));var db=require(_0x696e('0x5'))['db'];var utils=require(_0x696e('0x6'));var logger=require(_0x696e('0x7'))('rpc');var config=require(_0x696e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x696e('0x9')][_0x696e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4827c5,_0xef6dbc,_0x4c8fda){return new BPromise(function(_0x475819,_0xd57064){return client[_0x696e('0xb')](_0x4827c5,_0x4c8fda)[_0x696e('0xc')](function(_0x341885){logger[_0x696e('0xd')](_0x696e('0xe'),_0xef6dbc,_0x696e('0xf'));logger['debug'](_0x696e('0x10'),_0xef6dbc,_0x696e('0xf'),JSON[_0x696e('0x11')](_0x341885));if(_0x341885[_0x696e('0x12')]){if(_0x341885[_0x696e('0x12')][_0x696e('0x13')]===0x1f4){logger[_0x696e('0x12')]('Setting,\x20%s,\x20%s',_0xef6dbc,_0x341885[_0x696e('0x12')][_0x696e('0x14')]);return _0xd57064(_0x341885[_0x696e('0x12')]['message']);}logger[_0x696e('0x12')](_0x696e('0xe'),_0xef6dbc,_0x341885[_0x696e('0x12')][_0x696e('0x14')]);return _0x475819(_0x341885[_0x696e('0x12')][_0x696e('0x14')]);}else{logger['info'](_0x696e('0xe'),_0xef6dbc,_0x696e('0xf'));_0x475819(_0x341885[_0x696e('0x15')]['message']);}})[_0x696e('0x16')](function(_0x43f0ae){logger['error']('Setting,\x20%s,\x20%s',_0xef6dbc,_0x43f0ae);_0xd57064(_0x43f0ae);});});}
\ No newline at end of file
diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js
index f37b631..05f8e5b 100644
--- a/server/api/smsAccount/index.js
+++ b/server/api/smsAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9cfb=['connect-timeout','../../components/auth/service','./smsAccount.controller','get','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/status','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','/:id/applications','addApplications','/:id/send','send','status','put','update','delete','removeAnswers','removeAgents','exports','multer','util'];(function(_0x3431fb,_0x8bf9e1){var _0x9c6a02=function(_0xf096d0){while(--_0xf096d0){_0x3431fb['push'](_0x3431fb['shift']());}};_0x9c6a02(++_0x8bf9e1);}(_0x9cfb,0xa8));var _0xb9cf=function(_0x3a25c3,_0x301d74){_0x3a25c3=_0x3a25c3-0x0;var _0x445638=_0x9cfb[_0x3a25c3];return _0x445638;};'use strict';var multer=require(_0xb9cf('0x0'));var util=require(_0xb9cf('0x1'));var path=require('path');var timeout=require(_0xb9cf('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xb9cf('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb9cf('0x4'));router[_0xb9cf('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb9cf('0x6'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x8')]);router[_0xb9cf('0x5')](_0xb9cf('0x9'),auth[_0xb9cf('0x7')](),controller['show']);router[_0xb9cf('0x5')](_0xb9cf('0xa'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0xb')]);router[_0xb9cf('0x5')](_0xb9cf('0xc'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0xd')]);router['get']('/:id/applications',auth[_0xb9cf('0x7')](),controller['getApplications']);router[_0xb9cf('0x5')]('/:id/interactions',auth[_0xb9cf('0x7')](),controller[_0xb9cf('0xe')]);router[_0xb9cf('0x5')](_0xb9cf('0xf'),controller['statusGet']);router[_0xb9cf('0x5')](_0xb9cf('0x10'),auth['isAuthenticated'](),controller[_0xb9cf('0x11')]);router[_0xb9cf('0x12')]('/',auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x13')]);router[_0xb9cf('0x12')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xb9cf('0x14')]);router[_0xb9cf('0x12')](_0xb9cf('0xc'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x15')]);router[_0xb9cf('0x12')]('/:id/notify',controller[_0xb9cf('0x16')]);router[_0xb9cf('0x12')](_0xb9cf('0x17'),auth['isAuthenticated'](),controller[_0xb9cf('0x18')]);router[_0xb9cf('0x12')](_0xb9cf('0x19'),auth['isAuthenticated'](),controller[_0xb9cf('0x1a')]);router[_0xb9cf('0x12')]('/:id/status',controller[_0xb9cf('0x1b')]);router[_0xb9cf('0x12')](_0xb9cf('0x10'),auth['isAuthenticated'](),controller['addAgents']);router[_0xb9cf('0x1c')](_0xb9cf('0x9'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x1d')]);router['delete'](_0xb9cf('0x9'),auth[_0xb9cf('0x7')](),controller['destroy']);router[_0xb9cf('0x1e')](_0xb9cf('0xa'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xb9cf('0xc'),auth['isAuthenticated'](),controller[_0xb9cf('0x1f')]);router['delete'](_0xb9cf('0x10'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x20')]);module[_0xb9cf('0x21')]=router;
\ No newline at end of file
+var _0x0c48=['addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/send','send','status'];(function(_0x34c553,_0x3e7dfc){var _0x1357d2=function(_0x3b509f){while(--_0x3b509f){_0x34c553['push'](_0x34c553['shift']());}};_0x1357d2(++_0x3e7dfc);}(_0x0c48,0x1e8));var _0x80c4=function(_0x143992,_0x3742f7){_0x143992=_0x143992-0x0;var _0x479be4=_0x0c48[_0x143992];return _0x479be4;};'use strict';var multer=require(_0x80c4('0x0'));var util=require(_0x80c4('0x1'));var path=require(_0x80c4('0x2'));var timeout=require(_0x80c4('0x3'));var express=require(_0x80c4('0x4'));var router=express[_0x80c4('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x80c4('0x6'));var config=require(_0x80c4('0x7'));var controller=require(_0x80c4('0x8'));router['get']('/',auth[_0x80c4('0x9')](),controller['index']);router[_0x80c4('0xa')](_0x80c4('0xb'),auth[_0x80c4('0x9')](),controller['describe']);router[_0x80c4('0xa')](_0x80c4('0xc'),auth[_0x80c4('0x9')](),controller[_0x80c4('0xd')]);router[_0x80c4('0xa')](_0x80c4('0xe'),auth[_0x80c4('0x9')](),controller[_0x80c4('0xf')]);router[_0x80c4('0xa')](_0x80c4('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x80c4('0xa')]('/:id/applications',auth[_0x80c4('0x9')](),controller['getApplications']);router['get'](_0x80c4('0x11'),auth[_0x80c4('0x9')](),controller['getInteractions']);router[_0x80c4('0xa')](_0x80c4('0x12'),controller[_0x80c4('0x13')]);router[_0x80c4('0xa')](_0x80c4('0x14'),auth[_0x80c4('0x9')](),controller[_0x80c4('0x15')]);router['post']('/',auth[_0x80c4('0x9')](),controller[_0x80c4('0x16')]);router[_0x80c4('0x17')](_0x80c4('0xe'),auth[_0x80c4('0x9')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x80c4('0x18')]);router[_0x80c4('0x17')](_0x80c4('0x19'),controller[_0x80c4('0x1a')]);router[_0x80c4('0x17')](_0x80c4('0x1b'),auth[_0x80c4('0x9')](),controller[_0x80c4('0x1c')]);router[_0x80c4('0x17')](_0x80c4('0x1d'),auth[_0x80c4('0x9')](),controller[_0x80c4('0x1e')]);router['post'](_0x80c4('0x12'),controller[_0x80c4('0x1f')]);router[_0x80c4('0x17')](_0x80c4('0x14'),auth[_0x80c4('0x9')](),controller[_0x80c4('0x20')]);router[_0x80c4('0x21')](_0x80c4('0xc'),auth[_0x80c4('0x9')](),controller[_0x80c4('0x22')]);router['delete'](_0x80c4('0xc'),auth['isAuthenticated'](),controller[_0x80c4('0x23')]);router[_0x80c4('0x24')]('/:id/dispositions',auth[_0x80c4('0x9')](),controller[_0x80c4('0x25')]);router['delete'](_0x80c4('0x10'),auth[_0x80c4('0x9')](),controller[_0x80c4('0x26')]);router[_0x80c4('0x24')](_0x80c4('0x14'),auth[_0x80c4('0x9')](),controller['removeAgents']);module[_0x80c4('0x27')]=router;
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js
index 564550d..1f589b5 100644
--- a/server/api/smsAccount/smsAccount.attributes.js
+++ b/server/api/smsAccount/smsAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb0b=['mandatoryDisposition','randomstring','STRING','name','generate','ENUM','twilio','connectel','clicksend','plivo','clickatell','BOOLEAN','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0xcb0b,0x7f));var _0xbcb0=function(_0x52effb,_0x2a610d){_0x52effb=_0x52effb-0x0;var _0x357175=_0xcb0b[_0x52effb];return _0x357175;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xbcb0('0x0'));module['exports']={'name':{'type':Sequelize[_0xbcb0('0x1')],'unique':_0xbcb0('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xbcb0('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xbcb0('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbcb0('0x3')]();}},'phone':{'type':Sequelize[_0xbcb0('0x1')]},'type':{'type':Sequelize[_0xbcb0('0x4')](_0xbcb0('0x5'),'skebby',_0xbcb0('0x6'),_0xbcb0('0x7'),_0xbcb0('0x8'),_0xbcb0('0x9'),'csc','infobip','intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xbcb0('0x1')]},'authToken':{'type':Sequelize[_0xbcb0('0x1')]},'smsMethod':{'type':Sequelize[_0xbcb0('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xbcb0('0x1')]},'password':{'type':Sequelize[_0xbcb0('0x1')]},'apiKey':{'type':Sequelize[_0xbcb0('0x1')]},'senderString':{'type':Sequelize[_0xbcb0('0x1')]},'deliveryReport':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':![]},'description':{'type':Sequelize[_0xbcb0('0x1')]},'notificationTemplate':{'type':Sequelize[_0xbcb0('0xb')],'defaultValue':function(){return _0xbcb0('0xc');}},'notificationSound':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbcb0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbcb0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xbcb0('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbcb0('0xd')],'comment':_0xbcb0('0xe')},'mandatoryDisposition':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':![],'comment':_0xbcb0('0xf'),'set':function(_0x5e2718){if(!_0x5e2718)this[_0xbcb0('0x10')]('mandatoryDispositionPauseId',null);this[_0xbcb0('0x10')](_0xbcb0('0x11'),_0x5e2718);}}};
\ No newline at end of file
+var _0x9d02=['csc','intelepeer','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','plivo','clickatell'];(function(_0x51623f,_0x44d074){var _0x393661=function(_0x43a24e){while(--_0x43a24e){_0x51623f['push'](_0x51623f['shift']());}};_0x393661(++_0x44d074);}(_0x9d02,0xf9));var _0x29d0=function(_0x54424c,_0x126ea5){_0x54424c=_0x54424c-0x0;var _0x2f2aba=_0x9d02[_0x54424c];return _0x2f2aba;};'use strict';var Sequelize=require(_0x29d0('0x0'));var rs=require('randomstring');module[_0x29d0('0x1')]={'name':{'type':Sequelize[_0x29d0('0x2')],'unique':_0x29d0('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x29d0('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x29d0('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x29d0('0x4')]();}},'phone':{'type':Sequelize[_0x29d0('0x2')]},'type':{'type':Sequelize[_0x29d0('0x5')](_0x29d0('0x6'),_0x29d0('0x7'),_0x29d0('0x8'),'clicksend',_0x29d0('0x9'),_0x29d0('0xa'),_0x29d0('0xb'),'infobip',_0x29d0('0xc'))},'accountSid':{'type':Sequelize[_0x29d0('0x2')]},'authId':{'type':Sequelize[_0x29d0('0x2')]},'authToken':{'type':Sequelize[_0x29d0('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x29d0('0x2')]},'password':{'type':Sequelize[_0x29d0('0x2')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x29d0('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x29d0('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x29d0('0xd');}},'notificationSound':{'type':Sequelize[_0x29d0('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x29d0('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x29d0('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x29d0('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x29d0('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x29d0('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29d0('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29d0('0xe')],'defaultValue':![],'comment':_0x29d0('0x10'),'set':function(_0x3b8a11){if(!_0x3b8a11)this[_0x29d0('0x11')](_0x29d0('0x12'),null);this[_0x29d0('0x11')](_0x29d0('0x13'),_0x3b8a11);}}};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js
index 54dd604..7080200 100644
--- a/server/api/smsAccount/smsAccount.controller.js
+++ b/server/api/smsAccount/smsAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0f58=['filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','map','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','account','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','Body','skebby','text','connectel','clicksend','messageId','message_id','plivo','From','Text','MessageUUID','results','originatingAddress','segmentedMessage','replyMessageId','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','ListId','DESC','omit','Contacts','defaults','contact','SmsInteraction','spread','created','autoclose','unmanaged','*,*,*,*','interaction','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','stringify','Content-Type','\x0a ','transaction','priority','getApplications','Contact','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','dataValues','Messages','push','log','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','clickatell','redif','error_code','infobip','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','status','json','count','offset','limit','set','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','index','Pause','SmsAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3bb961,_0x5cd081){var _0xa546f2=function(_0xc082cb){while(--_0xc082cb){_0x3bb961['push'](_0x3bb961['shift']());}};_0xa546f2(++_0x5cd081);}(_0x0f58,0x93));var _0x80f5=function(_0x24e23d,_0x26684a){_0x24e23d=_0x24e23d-0x0;var _0x14db43=_0x0f58[_0x24e23d];return _0x14db43;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x80f5('0x0'));var zipdir=require(_0x80f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x80f5('0x2'));var moment=require('moment');var BPromise=require(_0x80f5('0x3'));var Mustache=require(_0x80f5('0x4'));var util=require('util');var path=require(_0x80f5('0x5'));var sox=require(_0x80f5('0x6'));var csv=require(_0x80f5('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x80f5('0x8'));var squel=require(_0x80f5('0x9'));var crypto=require('crypto');var jsforce=require(_0x80f5('0xa'));var deskjs=require(_0x80f5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x80f5('0xc'));var Papa=require(_0x80f5('0xd'));var Redis=require(_0x80f5('0xe'));var authService=require(_0x80f5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x80f5('0x10'))(_0x80f5('0x11'));var utils=require('../../config/utils');var config=require(_0x80f5('0x12'));var db=require(_0x80f5('0x13'))['db'];config[_0x80f5('0x14')]=_['defaults'](config[_0x80f5('0x14')],{'host':_0x80f5('0x15'),'port':0x18eb});var socket=require(_0x80f5('0x16'))(new Redis(config[_0x80f5('0x14')]));require(_0x80f5('0x17'))['register'](socket);var jayson=require(_0x80f5('0x18'));var client=jayson[_0x80f5('0x19')][_0x80f5('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x1a9260,_0x2fcb53,_0x1eba6f){if(_0x1eba6f){var _0x294eff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x294eff[_0x80f5('0x1b')](_0x2fcb53)){return _0x1a9260;}else{throw new Error(_0x80f5('0x1c'));}}else{return _0x1a9260;}}function respondWithRpcPromise(_0x15f15e,_0x352747,_0x2ca2b3,_0x3f01a0){return new BPromise(function(_0x1ef192,_0x4af747){var _0x280a61=_0x3f01a0||client;return _0x280a61[_0x80f5('0x1d')](_0x15f15e,_0x2ca2b3)[_0x80f5('0x1e')](function(_0x120e94){logger[_0x80f5('0x1f')](_0x80f5('0x20'),_0x352747,'request\x20sent');logger['debug'](_0x80f5('0x21'),_0x352747,_0x80f5('0x22'),JSON['stringify'](_0x120e94));if(_0x120e94[_0x80f5('0x23')]){if(_0x120e94[_0x80f5('0x23')][_0x80f5('0x24')]===0x1f4){logger[_0x80f5('0x23')](_0x80f5('0x20'),_0x352747,_0x120e94[_0x80f5('0x23')][_0x80f5('0x25')]);return _0x4af747(_0x120e94[_0x80f5('0x23')][_0x80f5('0x25')]);}logger[_0x80f5('0x23')]('SmsAccount,\x20%s,\x20%s',_0x352747,_0x120e94['error'][_0x80f5('0x25')]);return _0x1ef192(_0x120e94[_0x80f5('0x23')][_0x80f5('0x25')]);}else{logger[_0x80f5('0x1f')](_0x80f5('0x20'),_0x352747,'request\x20sent');_0x1ef192(_0x120e94['result'][_0x80f5('0x25')]);}})[_0x80f5('0x26')](function(_0xc191f9){logger[_0x80f5('0x23')](_0x80f5('0x20'),_0x352747,_0xc191f9);_0x4af747(_0xc191f9);});});}function respondWithStatusCode(_0x34606a,_0x19c714){_0x19c714=_0x19c714||0xcc;return function(_0x4d37df){if(_0x4d37df){return _0x34606a['sendStatus'](_0x19c714);}return _0x34606a[_0x80f5('0x27')](_0x19c714)['end']();};}function respondWithResult(_0x6c4bc,_0xf7f43e){_0xf7f43e=_0xf7f43e||0xc8;return function(_0x84b8fb){if(_0x84b8fb){return _0x6c4bc[_0x80f5('0x27')](_0xf7f43e)[_0x80f5('0x28')](_0x84b8fb);}};}function respondWithFilteredResult(_0x4dbf7a,_0x238f35){return function(_0x1e0f7d){if(_0x1e0f7d){var _0x37713b=_0x1e0f7d[_0x80f5('0x29')],_0x49c70b=_0x238f35[_0x80f5('0x2a')],_0x2a6c23=_0x238f35['offset']+_0x238f35[_0x80f5('0x2b')],_0x14f159;if(_0x2a6c23>=_0x37713b){_0x2a6c23=_0x37713b;_0x14f159=0xc8;}else{_0x14f159=0xce;}_0x4dbf7a['status'](_0x14f159);return _0x4dbf7a[_0x80f5('0x2c')]('Content-Range',_0x49c70b+'-'+_0x2a6c23+'/'+_0x37713b)[_0x80f5('0x28')](_0x1e0f7d);}return null;};}function patchUpdates(_0x8dac6f){return function(_0x2b5472){try{jsonpatch['apply'](_0x2b5472,_0x8dac6f,!![]);}catch(_0x5c2a3e){return BPromise[_0x80f5('0x2d')](_0x5c2a3e);}return _0x2b5472[_0x80f5('0x2e')]();};}function saveUpdates(_0x3c0c88,_0x4c9a54){return function(_0x2f9d4d){if(_0x2f9d4d){return _0x2f9d4d[_0x80f5('0x2f')](_0x3c0c88)[_0x80f5('0x1e')](function(_0x44e41d){return _0x44e41d;});}return null;};}function removeEntity(_0x33efaa,_0x2fa497){return function(_0x5d7cd7){if(_0x5d7cd7){return _0x5d7cd7['destroy']()[_0x80f5('0x1e')](function(){var _0x12cea8=_0x5d7cd7[_0x80f5('0x30')]({'plain':!![]});var _0x68c0fc=_0x80f5('0x31');return db[_0x80f5('0x32')][_0x80f5('0x33')]({'where':{'type':_0x68c0fc,'resourceId':_0x12cea8['id']}})['then'](function(){return _0x5d7cd7;});})[_0x80f5('0x1e')](function(){_0x33efaa[_0x80f5('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5af48f,_0x5b5b45){return function(_0x5d5d8e){if(!_0x5d5d8e){_0x5af48f[_0x80f5('0x34')](0x194);}return _0x5d5d8e;};}function handleError(_0x38de2d,_0x1bca3c){_0x1bca3c=_0x1bca3c||0x1f4;return function(_0x297a97){logger['error'](_0x297a97[_0x80f5('0x35')]);if(_0x297a97['name']){delete _0x297a97[_0x80f5('0x36')];}_0x38de2d[_0x80f5('0x27')](_0x1bca3c)[_0x80f5('0x37')](_0x297a97);};}exports[_0x80f5('0x38')]=function(_0x334768,_0x88904f){var _0x257edf={'include':[{'model':db[_0x80f5('0x39')],'as':'mandatoryDispositionPause'}]},_0x17b531={},_0x1ba2dc={'count':0x0,'rows':[]};var _0x1bd5f6=db[_0x80f5('0x3a')][_0x80f5('0x3b')];_0x17b531[_0x80f5('0x3c')]=_[_0x80f5('0x3d')](_0x1bd5f6);_0x17b531['query']=_[_0x80f5('0x3d')](_0x334768[_0x80f5('0x3e')]);_0x17b531[_0x80f5('0x3f')]=_[_0x80f5('0x40')](_0x17b531[_0x80f5('0x3c')],_0x17b531[_0x80f5('0x3e')]);_0x257edf['attributes']=_[_0x80f5('0x40')](_0x17b531[_0x80f5('0x3c')],qs[_0x80f5('0x41')](_0x334768[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x257edf[_0x80f5('0x42')]=_0x257edf[_0x80f5('0x42')][_0x80f5('0x43')]?_0x257edf[_0x80f5('0x42')]:_0x17b531['model'];if(!_0x334768[_0x80f5('0x3e')][_0x80f5('0x44')](_0x80f5('0x45'))){_0x257edf[_0x80f5('0x2b')]=qs[_0x80f5('0x2b')](_0x334768[_0x80f5('0x3e')]['limit']);_0x257edf[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0x334768[_0x80f5('0x3e')][_0x80f5('0x2a')]);}_0x257edf[_0x80f5('0x46')]=qs[_0x80f5('0x47')](_0x334768[_0x80f5('0x3e')][_0x80f5('0x47')]);_0x257edf[_0x80f5('0x48')]=qs[_0x80f5('0x3f')](_[_0x80f5('0x49')](_0x334768[_0x80f5('0x3e')],_0x17b531[_0x80f5('0x3f')]));if(_0x334768[_0x80f5('0x3e')][_0x80f5('0x4a')]){_0x257edf['where']=_[_0x80f5('0x4b')](_0x257edf[_0x80f5('0x48')],{'$or':_['map'](_0x1bd5f6,function(_0x3030dd){if(_0x3030dd[_0x80f5('0x4c')]['key']!==_0x80f5('0x4d')){var _0x559d73={};_0x559d73[_0x3030dd[_0x80f5('0x4e')]]={'$like':'%'+_0x334768['query'][_0x80f5('0x4a')]+'%'};return _0x559d73;}})});}_0x257edf=_[_0x80f5('0x4b')]({},_0x257edf,_0x334768[_0x80f5('0x4f')]);var _0x47077c={'where':_0x257edf['where']};return db[_0x80f5('0x3a')][_0x80f5('0x29')](_0x47077c)[_0x80f5('0x1e')](function(_0x20fb43){_0x1ba2dc[_0x80f5('0x29')]=_0x20fb43;if(_0x334768[_0x80f5('0x3e')][_0x80f5('0x50')]){_0x257edf[_0x80f5('0x51')]=[{'all':!![]}];}return db['SmsAccount'][_0x80f5('0x52')](_0x257edf);})['then'](function(_0x4163e8){_0x1ba2dc[_0x80f5('0x53')]=_0x4163e8;return _0x1ba2dc;})[_0x80f5('0x1e')](respondWithFilteredResult(_0x88904f,_0x257edf))[_0x80f5('0x26')](handleError(_0x88904f,null));};exports[_0x80f5('0x54')]=function(_0x3ef5a8,_0x2ff441){var _0x5629e8={'raw':![],'where':{'id':_0x3ef5a8['params']['id']},'include':[{'model':db['Pause'],'as':_0x80f5('0x55')}]},_0x2e7fee={};_0x2e7fee[_0x80f5('0x3c')]=_[_0x80f5('0x3d')](db['SmsAccount'][_0x80f5('0x3b')]);_0x2e7fee[_0x80f5('0x3e')]=_[_0x80f5('0x3d')](_0x3ef5a8[_0x80f5('0x3e')]);_0x2e7fee[_0x80f5('0x3f')]=_[_0x80f5('0x40')](_0x2e7fee[_0x80f5('0x3c')],_0x2e7fee[_0x80f5('0x3e')]);_0x5629e8[_0x80f5('0x42')]=_[_0x80f5('0x40')](_0x2e7fee[_0x80f5('0x3c')],qs['fields'](_0x3ef5a8[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x5629e8[_0x80f5('0x42')]=_0x5629e8[_0x80f5('0x42')][_0x80f5('0x43')]?_0x5629e8[_0x80f5('0x42')]:_0x2e7fee[_0x80f5('0x3c')];if(_0x3ef5a8[_0x80f5('0x3e')][_0x80f5('0x50')]){_0x5629e8[_0x80f5('0x51')]=[{'all':!![]}];}_0x5629e8=_[_0x80f5('0x4b')]({},_0x5629e8,_0x3ef5a8['options']);return db[_0x80f5('0x3a')][_0x80f5('0x56')](_0x5629e8)[_0x80f5('0x1e')](handleEntityNotFound(_0x2ff441,null))['then'](respondWithResult(_0x2ff441,null))[_0x80f5('0x26')](handleError(_0x2ff441,null));};exports['create']=function(_0x222955,_0x3acf85){return db[_0x80f5('0x3a')]['create'](_0x222955[_0x80f5('0x57')],{})[_0x80f5('0x1e')](function(_0x2c11f3){var _0x323367=_0x222955[_0x80f5('0x58')][_0x80f5('0x30')]({'plain':!![]});if(!_0x323367)throw new Error(_0x80f5('0x59'));if(_0x323367[_0x80f5('0x5a')]===_0x80f5('0x58')){var _0x37cf6a=_0x2c11f3[_0x80f5('0x30')]({'plain':!![]});var _0x1f2948=_0x80f5('0x31');return db[_0x80f5('0x5b')][_0x80f5('0x56')]({'where':{'name':_0x1f2948,'userProfileId':_0x323367[_0x80f5('0x5c')]},'raw':!![]})[_0x80f5('0x1e')](function(_0x50d14e){if(_0x50d14e&&_0x50d14e[_0x80f5('0x5d')]===0x0){return db[_0x80f5('0x32')][_0x80f5('0x5e')]({'name':_0x37cf6a['name'],'resourceId':_0x37cf6a['id'],'type':_0x50d14e[_0x80f5('0x36')],'sectionId':_0x50d14e['id']},{})[_0x80f5('0x1e')](function(){return _0x2c11f3;});}else{return _0x2c11f3;}})['catch'](function(_0xbb48b2){logger['error'](_0x80f5('0x5f'),_0xbb48b2);throw _0xbb48b2;});}return _0x2c11f3;})[_0x80f5('0x1e')](respondWithResult(_0x3acf85,0xc9))[_0x80f5('0x26')](handleError(_0x3acf85,null));};exports[_0x80f5('0x2f')]=function(_0x1bcd23,_0x12e89a){if(_0x1bcd23[_0x80f5('0x57')]['id']){delete _0x1bcd23[_0x80f5('0x57')]['id'];}return db['SmsAccount'][_0x80f5('0x56')]({'where':{'id':_0x1bcd23['params']['id']},'include':[{'model':db[_0x80f5('0x39')],'as':_0x80f5('0x55')}]})['then'](handleEntityNotFound(_0x12e89a,null))[_0x80f5('0x1e')](saveUpdates(_0x1bcd23[_0x80f5('0x57')],null))[_0x80f5('0x1e')](respondWithResult(_0x12e89a,null))[_0x80f5('0x26')](handleError(_0x12e89a,null));};exports[_0x80f5('0x33')]=function(_0x26aa5d,_0x26d673){return db['SmsAccount'][_0x80f5('0x56')]({'where':{'id':_0x26aa5d[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x26d673,null))['then'](removeEntity(_0x26d673,null))[_0x80f5('0x26')](handleError(_0x26d673,null));};exports[_0x80f5('0x61')]=function(_0x295d08,_0x3c1de9){return db[_0x80f5('0x3a')][_0x80f5('0x61')]()[_0x80f5('0x1e')](respondWithResult(_0x3c1de9,null))['catch'](handleError(_0x3c1de9,null));};exports[_0x80f5('0x62')]=function(_0x50f8ff,_0x58143a,_0x451b36){if(_0x50f8ff[_0x80f5('0x57')]['id']){delete _0x50f8ff[_0x80f5('0x57')]['id'];}return db['SmsAccount'][_0x80f5('0x56')]({'where':{'id':_0x50f8ff[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x58143a,null))[_0x80f5('0x1e')](function(_0x151958){if(_0x151958){_0x50f8ff[_0x80f5('0x57')][_0x80f5('0x63')]=_0x151958['id'];return db['Disposition'][_0x80f5('0x5e')](_0x50f8ff[_0x80f5('0x57')]);}})[_0x80f5('0x1e')](respondWithResult(_0x58143a,null))['catch'](handleError(_0x58143a,null));};exports['getDispositions']=function(_0x14547b,_0xfeeb2,_0x7907c3){var _0x69d96f={'raw':![],'where':{}};var _0x508095={};var _0x2175f9={'count':0x0,'rows':[]};return db[_0x80f5('0x3a')][_0x80f5('0x64')]({'where':{'id':_0x14547b[_0x80f5('0x60')]['id']}})['then'](handleEntityNotFound(_0xfeeb2,null))[_0x80f5('0x1e')](function(_0x1b8ed0){if(_0x1b8ed0){_0x508095[_0x80f5('0x3c')]=_['keys'](db[_0x80f5('0x65')][_0x80f5('0x3b')]);_0x508095[_0x80f5('0x3e')]=_[_0x80f5('0x3d')](_0x14547b[_0x80f5('0x3e')]);_0x508095[_0x80f5('0x3f')]=_['intersection'](_0x508095['model'],_0x508095[_0x80f5('0x3e')]);_0x69d96f[_0x80f5('0x42')]=_['intersection'](_0x508095[_0x80f5('0x3c')],qs['fields'](_0x14547b[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x69d96f[_0x80f5('0x42')]=_0x69d96f['attributes'][_0x80f5('0x43')]?_0x69d96f[_0x80f5('0x42')]:_0x508095[_0x80f5('0x3c')];if(!_0x14547b[_0x80f5('0x3e')]['hasOwnProperty'](_0x80f5('0x45'))){_0x69d96f[_0x80f5('0x2b')]=qs[_0x80f5('0x2b')](_0x14547b[_0x80f5('0x3e')][_0x80f5('0x2b')]);_0x69d96f[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0x14547b[_0x80f5('0x3e')][_0x80f5('0x2a')]);}_0x69d96f[_0x80f5('0x46')]=qs[_0x80f5('0x47')](_0x14547b[_0x80f5('0x3e')][_0x80f5('0x47')]);_0x69d96f[_0x80f5('0x48')]=qs['filters'](_[_0x80f5('0x49')](_0x14547b[_0x80f5('0x3e')],_0x508095['filters']));_0x69d96f[_0x80f5('0x48')][_0x80f5('0x63')]=_0x1b8ed0['id'];if(_0x14547b[_0x80f5('0x3e')]['filter']){_0x69d96f[_0x80f5('0x48')]=_[_0x80f5('0x4b')](_0x69d96f['where'],{'$or':_['map'](_0x69d96f[_0x80f5('0x42')],function(_0xd963ea){var _0x54ce18={};_0x54ce18[_0xd963ea]={'$like':'%'+_0x14547b[_0x80f5('0x3e')][_0x80f5('0x4a')]+'%'};return _0x54ce18;})});}_0x69d96f=_[_0x80f5('0x4b')]({},_0x69d96f,_0x14547b[_0x80f5('0x4f')]);return db['Disposition']['count']({'where':_0x69d96f[_0x80f5('0x48')]})[_0x80f5('0x1e')](function(_0x4f6cef){_0x2175f9[_0x80f5('0x29')]=_0x4f6cef;if(_0x14547b[_0x80f5('0x3e')][_0x80f5('0x50')]){_0x69d96f[_0x80f5('0x51')]=[{'all':!![]}];}return db[_0x80f5('0x65')][_0x80f5('0x52')](_0x69d96f);})[_0x80f5('0x1e')](function(_0x129490){_0x2175f9[_0x80f5('0x53')]=_0x129490;return _0x2175f9;});}})[_0x80f5('0x1e')](respondWithFilteredResult(_0xfeeb2,_0x69d96f))['catch'](handleError(_0xfeeb2,null));};exports[_0x80f5('0x66')]=function(_0x401ef3,_0x35c623,_0x455e44){return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0x401ef3[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x35c623,null))[_0x80f5('0x1e')](function(_0x52df16){if(_0x52df16){return _0x52df16[_0x80f5('0x66')](_0x401ef3['query'][_0x80f5('0x67')]);}})[_0x80f5('0x1e')](respondWithStatusCode(_0x35c623,null))[_0x80f5('0x26')](handleError(_0x35c623,null));};exports[_0x80f5('0x68')]=function(_0x35a516,_0x13a5de,_0x398920){if(_0x35a516['body']['id']){delete _0x35a516[_0x80f5('0x57')]['id'];}return db[_0x80f5('0x3a')]['find']({'where':{'id':_0x35a516[_0x80f5('0x60')]['id']}})['then'](handleEntityNotFound(_0x13a5de,null))['then'](function(_0x365d42){if(_0x365d42){_0x35a516[_0x80f5('0x57')][_0x80f5('0x63')]=_0x365d42['id'];return db[_0x80f5('0x69')]['create'](_0x35a516[_0x80f5('0x57')]);}})[_0x80f5('0x1e')](respondWithResult(_0x13a5de,null))[_0x80f5('0x26')](handleError(_0x13a5de,null));};exports[_0x80f5('0x6a')]=function(_0x4d8537,_0x91fd94,_0x2ac42b){var _0x29b1dc={'raw':![],'where':{}};var _0x3748b0={};var _0x8d8c6c={'count':0x0,'rows':[]};return db[_0x80f5('0x3a')][_0x80f5('0x64')]({'where':{'id':_0x4d8537[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x91fd94,null))[_0x80f5('0x1e')](function(_0x52247d){if(_0x52247d){_0x3748b0['model']=_['keys'](db['CannedAnswer'][_0x80f5('0x3b')]);_0x3748b0[_0x80f5('0x3e')]=_['keys'](_0x4d8537[_0x80f5('0x3e')]);_0x3748b0[_0x80f5('0x3f')]=_[_0x80f5('0x40')](_0x3748b0['model'],_0x3748b0[_0x80f5('0x3e')]);_0x29b1dc['attributes']=_[_0x80f5('0x40')](_0x3748b0[_0x80f5('0x3c')],qs[_0x80f5('0x41')](_0x4d8537[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x29b1dc[_0x80f5('0x42')]=_0x29b1dc[_0x80f5('0x42')][_0x80f5('0x43')]?_0x29b1dc[_0x80f5('0x42')]:_0x3748b0[_0x80f5('0x3c')];if(!_0x4d8537[_0x80f5('0x3e')][_0x80f5('0x44')](_0x80f5('0x45'))){_0x29b1dc[_0x80f5('0x2b')]=qs[_0x80f5('0x2b')](_0x4d8537[_0x80f5('0x3e')][_0x80f5('0x2b')]);_0x29b1dc[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0x4d8537[_0x80f5('0x3e')]['offset']);}_0x29b1dc[_0x80f5('0x46')]=qs[_0x80f5('0x47')](_0x4d8537[_0x80f5('0x3e')]['sort']);_0x29b1dc['where']=qs[_0x80f5('0x3f')](_[_0x80f5('0x49')](_0x4d8537[_0x80f5('0x3e')],_0x3748b0[_0x80f5('0x3f')]));_0x29b1dc[_0x80f5('0x48')]['SmsAccountId']=_0x52247d['id'];if(_0x4d8537['query'][_0x80f5('0x4a')]){_0x29b1dc[_0x80f5('0x48')]=_[_0x80f5('0x4b')](_0x29b1dc['where'],{'$or':_[_0x80f5('0x6b')](_0x29b1dc['attributes'],function(_0x4c91d9){var _0x5be5c0={};_0x5be5c0[_0x4c91d9]={'$like':'%'+_0x4d8537[_0x80f5('0x3e')]['filter']+'%'};return _0x5be5c0;})});}_0x29b1dc=_['merge']({},_0x29b1dc,_0x4d8537['options']);return db[_0x80f5('0x69')][_0x80f5('0x29')]({'where':_0x29b1dc['where']})[_0x80f5('0x1e')](function(_0x3064dc){_0x8d8c6c[_0x80f5('0x29')]=_0x3064dc;if(_0x4d8537[_0x80f5('0x3e')][_0x80f5('0x50')]){_0x29b1dc['include']=[{'all':!![]}];}return db[_0x80f5('0x69')][_0x80f5('0x52')](_0x29b1dc);})[_0x80f5('0x1e')](function(_0x200ee5){_0x8d8c6c[_0x80f5('0x53')]=_0x200ee5;return _0x8d8c6c;});}})[_0x80f5('0x1e')](respondWithFilteredResult(_0x91fd94,_0x29b1dc))[_0x80f5('0x26')](handleError(_0x91fd94,null));};exports[_0x80f5('0x6c')]=function(_0x3f35ca,_0x5c6c48,_0x255648){return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0x3f35ca[_0x80f5('0x60')]['id']}})['then'](handleEntityNotFound(_0x5c6c48,null))['then'](function(_0x21af08){if(_0x21af08){return _0x21af08['removeAnswers'](_0x3f35ca['query'][_0x80f5('0x67')]);}})[_0x80f5('0x1e')](respondWithStatusCode(_0x5c6c48,null))[_0x80f5('0x26')](handleError(_0x5c6c48,null));};exports[_0x80f5('0x6d')]=function(_0x48dfde,_0x384faa,_0x4e6e7b){var _0x431093={'channel':_0x80f5('0x6e')};var _0x52627b=[];var _0x2367c4=[];var _0x5b610e={};return db['SmsAccount'][_0x80f5('0x56')]({'where':{'id':_0x48dfde[_0x80f5('0x60')]['id']},'include':[{'model':db[_0x80f5('0x6f')],'as':_0x80f5('0x70')}]})[_0x80f5('0x1e')](handleEntityNotFound(_0x384faa,null))[_0x80f5('0x1e')](function(_0x579319){_0x431093['account']=_0x579319;_0x431093[_0x80f5('0x71')]=_[_0x80f5('0x72')](_0x579319[_0x80f5('0x70')],['priority'],['asc']);if(_0x431093[_0x80f5('0x73')]['Applications']){delete _0x431093[_0x80f5('0x73')][_0x80f5('0x70')];}return db[_0x80f5('0x74')][_0x80f5('0x61')]();})[_0x80f5('0x1e')](function(_0x44503a){if(!_0x44503a){throw new db['Sequelize'][(_0x80f5('0x75'))](_0x80f5('0x76'));}_0x52627b=_[_0x80f5('0x77')](_[_0x80f5('0x3d')](_0x44503a),[_0x80f5('0x78'),_0x80f5('0x79')]);_0x2367c4=_[_0x80f5('0x77')](_['keys'](_0x44503a),[_0x80f5('0x78'),_0x80f5('0x79'),_0x80f5('0x7a'),'ListId']);_0x431093[_0x80f5('0x57')]={'mapKey':_0x80f5('0x7b')};if(_0x431093[_0x80f5('0x73')]['type']){switch(_0x431093['account'][_0x80f5('0x4c')]){case _0x80f5('0x7c'):_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')]=_0x48dfde[_0x80f5('0x57')]['From'];_0x431093[_0x80f5('0x57')][_0x80f5('0x57')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x7e')];_0x431093[_0x80f5('0x57')]['messageId']=_0x48dfde[_0x80f5('0x57')]['MessageSid'];break;case _0x80f5('0x7f'):_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')]='+'+_0x48dfde[_0x80f5('0x57')]['sender'];_0x431093['body']['body']=_0x48dfde['body'][_0x80f5('0x80')];break;case _0x80f5('0x81'):_0x431093['body'][_0x80f5('0x7d')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x7d')];_0x431093[_0x80f5('0x57')][_0x80f5('0x57')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x25')];break;case _0x80f5('0x82'):_0x431093['body'][_0x80f5('0x7d')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x7d')];_0x431093['body'][_0x80f5('0x57')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x57')];_0x431093['body'][_0x80f5('0x83')]=_0x48dfde['body'][_0x80f5('0x84')];break;case _0x80f5('0x85'):_0x431093['body'][_0x80f5('0x7d')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x86')];_0x431093[_0x80f5('0x57')][_0x80f5('0x57')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x87')];_0x431093[_0x80f5('0x57')][_0x80f5('0x83')]=_0x48dfde['body'][_0x80f5('0x88')];break;case'infobip':_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')]='+'+_0x48dfde['body'][_0x80f5('0x89')][0x0][_0x80f5('0x7d')];_0x431093['body'][_0x80f5('0x57')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x89')][0x0][_0x80f5('0x80')];_0x431093[_0x80f5('0x57')][_0x80f5('0x83')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x89')][0x0][_0x80f5('0x83')];break;case'csc':_0x431093['body'][_0x80f5('0x7d')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x8a')];_0x431093[_0x80f5('0x57')]['body']=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x8b')][_0x80f5('0x25')];break;case'clickatell':_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')]=_0x48dfde['body']['fromNumber'];_0x431093[_0x80f5('0x57')]['body']=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x80')];_0x431093['body'][_0x80f5('0x83')]=_0x48dfde['body'][_0x80f5('0x8c')];break;case _0x80f5('0x8d'):_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')]=_0x48dfde['body'][_0x80f5('0x7d')];_0x431093[_0x80f5('0x57')][_0x80f5('0x57')]=_0x48dfde['body'][_0x80f5('0x25')];_0x431093['body']['messageId']=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x8e')];break;}}if(_0x431093[_0x80f5('0x57')]['id']){delete _0x431093[_0x80f5('0x57')]['id'];}if(_[_0x80f5('0x8f')](_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')])){throw new db[(_0x80f5('0x90'))][(_0x80f5('0x75'))](_0x80f5('0x91'));}if(_[_0x80f5('0x8f')](_0x431093[_0x80f5('0x57')][_0x80f5('0x57')])||_0x431093['body'][_0x80f5('0x57')]===''){throw new db[(_0x80f5('0x90'))][(_0x80f5('0x75'))](_0x80f5('0x92'));}if(_['isNil'](_0x431093[_0x80f5('0x57')][_0x80f5('0x93')])){throw new db[(_0x80f5('0x90'))][(_0x80f5('0x75'))](_0x80f5('0x94')+_0x2367c4);}if(!_[_0x80f5('0x95')](_0x2367c4,_0x431093[_0x80f5('0x57')]['mapKey'])){throw new db[(_0x80f5('0x90'))][(_0x80f5('0x75'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2367c4);}_0x5b610e[_0x431093[_0x80f5('0x57')][_0x80f5('0x93')]]=_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')];return db[_0x80f5('0x96')][_0x80f5('0x56')]({'where':{'id':_0x431093[_0x80f5('0x73')][_0x80f5('0x97')]},'include':[{'model':db[_0x80f5('0x74')],'as':'Contacts','where':_0x5b610e,'limit':0x1,'order':[[_0x80f5('0x79'),_0x80f5('0x98')]]}]});})[_0x80f5('0x1e')](handleEntityNotFound(_0x384faa,null))[_0x80f5('0x1e')](function(_0x2bc449){if(_0x2bc449){_0x431093['list']=_[_0x80f5('0x99')](_0x2bc449,[_0x80f5('0x9a')]);if(_0x2bc449[_0x80f5('0x9a')][_0x80f5('0x43')]){return _0x2bc449[_0x80f5('0x9a')][0x0];}var _0x2acf80=_[_0x80f5('0x9b')](_0x431093[_0x80f5('0x57')],{'firstName':_0x431093[_0x80f5('0x57')]['from'],'ListId':_0x2bc449['id']});_0x2acf80[_0x431093[_0x80f5('0x57')][_0x80f5('0x93')]]=_0x431093[_0x80f5('0x57')]['from'];return db[_0x80f5('0x74')][_0x80f5('0x5e')](_0x2acf80,{'fields':_0x52627b,'raw':!![]});}})[_0x80f5('0x1e')](handleEntityNotFound(_0x384faa,null))[_0x80f5('0x1e')](function(_0x1a3b36){if(_0x1a3b36){_0x431093[_0x80f5('0x9c')]=_0x1a3b36;var _0x573062={'ContactId':_0x1a3b36['id'],'phone':_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')],'SmsAccountId':_0x48dfde[_0x80f5('0x60')]['id']};var _0x1cdcdc={'ContactId':_0x1a3b36['id'],'SmsAccountId':_0x48dfde['params']['id'],'closed':![]};return db[_0x80f5('0x9d')][_0x80f5('0x56')]({'where':_0x1cdcdc})[_0x80f5('0x1e')](function(_0x103d24){if(_0x103d24){return[_0x103d24,![]];}return db['SmsInteraction'][_0x80f5('0x5e')](_0x573062)['then'](function(_0x3c914a){return[_0x3c914a,!![]];});});}})[_0x80f5('0x9e')](function(_0x1857bd,_0x4f810e){_0x431093['interaction']=_0x1857bd[_0x80f5('0x30')]({'plain':!![]});_0x431093['interaction'][_0x80f5('0x9f')]=![];if(_0x4f810e){if(_0x431093[_0x80f5('0x73')][_0x80f5('0xa0')]){_0x431093[_0x80f5('0x71')]['push']({'id':0x0,'priority':_0x431093[_0x80f5('0x71')][_0x80f5('0x43')]+0x1,'app':'close','appdata':_0x80f5('0xa1'),'interval':_0x80f5('0xa2')});}_0x431093[_0x80f5('0xa3')][_0x80f5('0x9f')]=!![];}return db[_0x80f5('0xa4')][_0x80f5('0x5e')]({'phone':_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')],'messageId':_0x431093[_0x80f5('0x57')][_0x80f5('0x83')],'body':_0x431093[_0x80f5('0x57')][_0x80f5('0x57')],'SmsAccountId':_0x48dfde['params']['id'],'SmsInteractionId':_0x1857bd['id'],'direction':'in','ContactId':_0x1857bd[_0x80f5('0xa5')],'AttachmentId':_0x431093['body'][_0x80f5('0xa6')]});})['then'](function(_0x1fa9ae){_0x431093[_0x80f5('0x25')]=_0x1fa9ae;if(_0x431093['interaction'][_0x80f5('0xa7')]){return db[_0x80f5('0xa8')][_0x80f5('0x56')]({'attributes':['id',_0x80f5('0x36')],'where':{'id':_0x431093[_0x80f5('0xa3')][_0x80f5('0xa7')]}})[_0x80f5('0x1e')](function(_0x585906){if(_0x585906){_0x431093[_0x80f5('0x71')]['unshift']({'id':0x0,'priority':0x0,'app':_0x80f5('0xa9'),'appdata':_0x585906['name']+','+(_0x431093[_0x80f5('0x73')][_0x80f5('0xaa')]||0xa),'interval':_0x80f5('0xa2')});}return respondWithRpcPromise(_0x80f5('0xab'),_0x80f5('0xac'),_0x431093);});}return respondWithRpcPromise(_0x80f5('0xab'),'startRouting',_0x431093);})[_0x80f5('0x1e')](function(_0x5290f7){if(_0x5290f7){var _0x2ea2a1=0xc8;var _0x47e092=_0x80f5('0xad');logger[_0x80f5('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47e092,_0x2ea2a1,_0x80f5('0xae'));logger[_0x80f5('0xaf')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x47e092,_0x2ea2a1,_0x80f5('0xae'),JSON[_0x80f5('0xb0')](_0x5290f7));if(_0x431093[_0x80f5('0x73')][_0x80f5('0x4c')]===_0x80f5('0x7c')){return _0x384faa[_0x80f5('0x27')](_0x2ea2a1)[_0x80f5('0x2c')](_0x80f5('0xb1'),'text/xml')[_0x80f5('0x37')](_0x80f5('0xb2'));}else{return _0x384faa[_0x80f5('0x27')](_0x2ea2a1)[_0x80f5('0x28')](_0x5290f7);}}})['catch'](handleError(_0x384faa,null));};exports['addApplications']=function(_0x4946fb,_0x4f1cab,_0x3720d9){return db['SmsAccount'][_0x80f5('0x64')]({'where':{'id':_0x4946fb[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x4f1cab,null))[_0x80f5('0x1e')](function(_0x493b09){if(_0x493b09){return db['sequelize'][_0x80f5('0xb3')](function(_0x574898){return db[_0x80f5('0x6f')][_0x80f5('0x33')]({'where':{'SmsAccountId':_0x4946fb['params']['id']},'transaction':_0x574898})['then'](function(_0x4941a5){var _0x3c7fcc=_[_0x80f5('0x6b')](_0x4946fb[_0x80f5('0x57')],function(_0x84ecbe){_0x84ecbe['SmsAccountId']=_0x4946fb[_0x80f5('0x60')]['id'];return _0x84ecbe;});return db[_0x80f5('0x6f')]['bulkCreate'](_0x3c7fcc,{'transaction':_0x574898});});})['then'](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x4946fb[_0x80f5('0x60')]['id']},'order':_0x80f5('0xb4')});});}})[_0x80f5('0x1e')](respondWithResult(_0x4f1cab,null))[_0x80f5('0x26')](handleError(_0x4f1cab,null));};exports[_0x80f5('0xb5')]=function(_0x1a24d7,_0x5647db,_0x28948a){var _0x1d36e4={};var _0x2b8e07={};var _0x5d2da3;var _0x487e96;return db[_0x80f5('0x3a')]['findOne']({'where':{'id':_0x1a24d7[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x5647db,null))[_0x80f5('0x1e')](function(_0xc58a74){if(_0xc58a74){_0x5d2da3=_0xc58a74;_0x2b8e07[_0x80f5('0x3c')]=_[_0x80f5('0x3d')](db[_0x80f5('0x6f')][_0x80f5('0x3b')]);_0x2b8e07['query']=_[_0x80f5('0x3d')](_0x1a24d7['query']);_0x2b8e07[_0x80f5('0x3f')]=_[_0x80f5('0x40')](_0x2b8e07[_0x80f5('0x3c')],_0x2b8e07[_0x80f5('0x3e')]);_0x1d36e4['attributes']=_[_0x80f5('0x40')](_0x2b8e07[_0x80f5('0x3c')],qs[_0x80f5('0x41')](_0x1a24d7['query'][_0x80f5('0x41')]));_0x1d36e4[_0x80f5('0x42')]=_0x1d36e4['attributes'][_0x80f5('0x43')]?_0x1d36e4[_0x80f5('0x42')]:_0x2b8e07[_0x80f5('0x3c')];_0x1d36e4[_0x80f5('0x46')]=qs[_0x80f5('0x47')](_0x1a24d7[_0x80f5('0x3e')][_0x80f5('0x47')]);_0x1d36e4[_0x80f5('0x48')]=qs[_0x80f5('0x3f')](_[_0x80f5('0x49')](_0x1a24d7[_0x80f5('0x3e')],_0x2b8e07[_0x80f5('0x3f')]));if(_0x1a24d7[_0x80f5('0x3e')][_0x80f5('0x4a')]){_0x1d36e4['where']=_[_0x80f5('0x4b')](_0x1d36e4[_0x80f5('0x48')],{'$or':_['map'](_0x1d36e4['attributes'],function(_0xcc9f2b){var _0x5d2b4a={};_0x5d2b4a[_0xcc9f2b]={'$like':'%'+_0x1a24d7[_0x80f5('0x3e')][_0x80f5('0x4a')]+'%'};return _0x5d2b4a;})});}_0x1d36e4=_[_0x80f5('0x4b')]({},_0x1d36e4,_0x1a24d7[_0x80f5('0x4f')]);return _0x5d2da3[_0x80f5('0xb5')](_0x1d36e4);}})[_0x80f5('0x1e')](function(_0x1c7bfa){if(_0x1c7bfa){_0x487e96=_0x1c7bfa[_0x80f5('0x43')];if(!_0x1a24d7[_0x80f5('0x3e')]['hasOwnProperty']('nolimit')){_0x1d36e4[_0x80f5('0x2b')]=qs['limit'](_0x1a24d7[_0x80f5('0x3e')][_0x80f5('0x2b')]);_0x1d36e4[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0x1a24d7['query']['offset']);}return _0x5d2da3[_0x80f5('0xb5')](_0x1d36e4);}})['then'](function(_0x36eef0){if(_0x36eef0){return _0x36eef0?{'count':_0x487e96,'rows':_0x36eef0}:null;}})[_0x80f5('0x1e')](respondWithResult(_0x5647db,null))['catch'](handleError(_0x5647db,null));};exports['getInteractions']=function(_0xf891fc,_0x5d0f5d,_0x3bb68b){var _0x569070={'raw':![],'where':{}};var _0x140758={};var _0x598f06={'count':0x0,'rows':[]};return db[_0x80f5('0x3a')][_0x80f5('0x64')]({'where':{'id':_0xf891fc[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x5d0f5d,null))[_0x80f5('0x1e')](function(_0x31af4f){if(_0x31af4f){_0x140758[_0x80f5('0x3c')]=_['keys'](db[_0x80f5('0x9d')][_0x80f5('0x3b')]);_0x140758[_0x80f5('0x3e')]=_[_0x80f5('0x3d')](_0xf891fc[_0x80f5('0x3e')]);_0x140758['filters']=_[_0x80f5('0x40')](_0x140758[_0x80f5('0x3c')],_0x140758[_0x80f5('0x3e')]);_0x569070[_0x80f5('0x42')]=_[_0x80f5('0x40')](_0x140758[_0x80f5('0x3c')],qs[_0x80f5('0x41')](_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x569070[_0x80f5('0x42')]=_0x569070['attributes'][_0x80f5('0x43')]?_0x569070[_0x80f5('0x42')]:_0x140758[_0x80f5('0x3c')];if(!_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x44')](_0x80f5('0x45'))){_0x569070[_0x80f5('0x2b')]=qs[_0x80f5('0x2b')](_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x2b')]);_0x569070[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0xf891fc['query'][_0x80f5('0x2a')]);}_0x569070['order']=qs['sort'](_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x47')]);_0x569070['where']=qs[_0x80f5('0x3f')](_[_0x80f5('0x49')](_0xf891fc[_0x80f5('0x3e')],_0x140758[_0x80f5('0x3f')]));_0x569070['where'][_0x80f5('0x63')]=_0x31af4f['id'];if(_0xf891fc[_0x80f5('0x3e')]['filter']){_0x569070[_0x80f5('0x48')]=_[_0x80f5('0x4b')](_0x569070[_0x80f5('0x48')],{'$or':_['map'](_0x569070[_0x80f5('0x42')],function(_0x2b2b64){var _0x29a3d9={};_0x29a3d9[_0x2b2b64]={'$like':'%'+_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x4a')]+'%'};return _0x29a3d9;})});}_0x569070=_[_0x80f5('0x4b')]({},_0x569070,_0xf891fc[_0x80f5('0x4f')]);return db[_0x80f5('0x9d')][_0x80f5('0x29')]({'where':_0x569070[_0x80f5('0x48')]})['then'](function(_0x4ec956){_0x598f06[_0x80f5('0x29')]=_0x4ec956;if(_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x50')]){_0x569070['include']=[{'model':db['CmContact'],'as':_0x80f5('0xb6'),'required':![]},{'model':db[_0x80f5('0xa8')],'as':'Owner','attributes':['name','fullname',_0x80f5('0xb7')],'required':![]},{'model':db[_0x80f5('0xb8')],'as':_0x80f5('0xb9'),'attributes':['id',_0x80f5('0x36'),_0x80f5('0xba')],'where':_0xf891fc['query'][_0x80f5('0xbb')]?{'id':_0xf891fc[_0x80f5('0x3e')]['tag']}:undefined,'required':_0xf891fc[_0x80f5('0x3e')][_0x80f5('0xbb')]?!![]:![]}];}return db['SmsInteraction'][_0x80f5('0x52')](_0x569070);})[_0x80f5('0x1e')](function(_0x411dd3){_0x598f06[_0x80f5('0x53')]=_0x411dd3;return _0x598f06;});}})[_0x80f5('0x1e')](respondWithFilteredResult(_0x5d0f5d,_0x569070))[_0x80f5('0x26')](handleError(_0x5d0f5d,null));};exports[_0x80f5('0x37')]=function(_0x265d19,_0x5c01c8,_0x1383e4){var _0x45ebc3,_0x5b9048,_0x39689e;if(_[_0x80f5('0x8f')](_0x265d19[_0x80f5('0x57')][_0x80f5('0x57')])||_0x265d19[_0x80f5('0x57')][_0x80f5('0x57')]===''){throw new db[(_0x80f5('0x90'))][(_0x80f5('0x75'))](_0x80f5('0x92'));}if(_[_0x80f5('0x8f')](_0x265d19[_0x80f5('0x57')]['to'])){throw new db['Sequelize'][(_0x80f5('0x75'))](_0x80f5('0xbc'));}_0x45ebc3=_0x265d19[_0x80f5('0x57')]['to'];return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0x265d19[_0x80f5('0x60')]['id']},'include':[{'model':db[_0x80f5('0x96')],'as':_0x80f5('0xbd'),'include':[{'model':db['CmContact'],'as':_0x80f5('0x9a'),'where':{'mobile':_0x45ebc3},'limit':0x1,'order':[[_0x80f5('0x79'),'DESC']]}]}]})[_0x80f5('0x1e')](handleEntityNotFound(_0x5c01c8,null))['then'](function(_0x5c5fbc){if(_0x5c5fbc&&_0x5c5fbc[_0x80f5('0xbd')]){_0x5b9048=_0x5c5fbc['get']({'plain':!![]});if(_0x5b9048['List']&&_0x5b9048[_0x80f5('0xbd')][_0x80f5('0x9a')][_0x80f5('0x43')]){return _0x5b9048['List'][_0x80f5('0x9a')][0x0];}return db[_0x80f5('0x74')][_0x80f5('0x5e')](_[_0x80f5('0x9b')](_0x265d19[_0x80f5('0x57')],{'firstName':_0x45ebc3,'mobile':_0x45ebc3,'phone':_0x45ebc3,'ListId':_0x5b9048['ListId']}));}})[_0x80f5('0x1e')](handleEntityNotFound(_0x5c01c8,null))[_0x80f5('0x1e')](function(_0x2b4687){if(_0x2b4687){_0x39689e=_0x2b4687;return db['SmsInteraction'][_0x80f5('0x56')]({'where':{'ContactId':_0x39689e['id'],'closed':![],'SmsAccountId':_0x5b9048['id']}})[_0x80f5('0x1e')](function(_0x5946d0){if(_0x5946d0){return[_0x5946d0,![]];}return db['SmsInteraction'][_0x80f5('0x5e')]({'UserId':_0x265d19['user']['id'],'ContactId':_0x39689e['id'],'SmsAccountId':_0x5b9048['id'],'phone':_0x45ebc3,'firstMsgDirection':_0x80f5('0xbe'),'Messages':[_[_0x80f5('0x4b')](_0x265d19['body'],{'read':![],'body':_0x265d19[_0x80f5('0x57')]['body'],'phone':_0x45ebc3,'SmsAccountId':_0x5b9048['id'],'UserId':_0x265d19[_0x80f5('0x58')]['id'],'ContactId':_0x39689e['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x80f5('0x1e')](function(_0x171a0a){return[_0x171a0a,!![]];});});}})[_0x80f5('0x9e')](function(_0x3483fa,_0x39286d){if(_0x39286d){return _0x3483fa;}return db[_0x80f5('0xa4')][_0x80f5('0x5e')](_[_0x80f5('0x4b')](_0x265d19[_0x80f5('0x57')],{'read':![],'body':_0x265d19[_0x80f5('0x57')][_0x80f5('0x57')],'phone':_0x45ebc3,'SmsAccountId':_0x5b9048['id'],'SmsInteractionId':_0x3483fa['id'],'UserId':_0x265d19[_0x80f5('0x58')]['id'],'ContactId':_0x39689e['id']}))[_0x80f5('0x1e')](function(_0x4cc516){_0x3483fa[_0x80f5('0xbf')][_0x80f5('0xc0')]=[];_0x3483fa[_0x80f5('0xbf')]['Messages'][_0x80f5('0xc1')](_0x4cc516[_0x80f5('0xbf')]);return _0x3483fa;});})['then'](respondWithResult(_0x5c01c8,null))[_0x80f5('0x26')](handleError(_0x5c01c8,null));};exports[_0x80f5('0x27')]=function(_0xb76a1,_0x330422,_0x476277){if(_0xb76a1[_0x80f5('0x57')]['id']){delete _0xb76a1[_0x80f5('0x57')]['id'];}console[_0x80f5('0xc2')]('endpoint\x20/status\x20POST\x20/',_0xb76a1[_0x80f5('0x57')]);var _0x2ee3c7,_0x153048,_0x45b69d;return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0xb76a1[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x330422,null))['then'](function(_0x495904){if(_0x495904){_0x45b69d=_0x495904;logger['debug'](_0x80f5('0x21'),_0x80f5('0x27'),_0x80f5('0xc3'),_0x495904[_0x80f5('0x4c')],util[_0x80f5('0xc4')](_0xb76a1['body'],{'showHidden':![],'depth':null}));switch(_0x495904[_0x80f5('0x4c')]){case'skebby':if(_0xb76a1[_0x80f5('0x57')][_0x80f5('0xc5')]&&_0xb76a1[_0x80f5('0x57')]['status']){_0x153048=_0xb76a1['body'][_0x80f5('0x27')];return db[_0x80f5('0xa4')]['find']({'where':{'messageId':_0xb76a1[_0x80f5('0x57')][_0x80f5('0xc5')]}});}break;case _0x80f5('0x81'):if(_0xb76a1[_0x80f5('0x57')]['requestid']&&_0xb76a1[_0x80f5('0x57')]['statusInt']){_0x153048=_0xb76a1[_0x80f5('0x57')][_0x80f5('0xc6')];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0xb76a1[_0x80f5('0x57')][_0x80f5('0xc7')]}});}break;case _0x80f5('0x82'):if(_0xb76a1[_0x80f5('0x57')][_0x80f5('0x84')]&&_0xb76a1['body'][_0x80f5('0xc8')]){_0x153048=_0xb76a1['body'][_0x80f5('0xc8')];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0xb76a1[_0x80f5('0x57')][_0x80f5('0x84')]}});}break;case'infobip':var _0x92aac8=_0xb76a1[_0x80f5('0x57')][_0x80f5('0x89')][0x0];if(_0x92aac8[_0x80f5('0x83')]&&_0x92aac8[_0x80f5('0x27')][_0x80f5('0xc9')]===_0x80f5('0xca')){_0x153048=_0x92aac8[_0x80f5('0x27')][_0x80f5('0xc9')];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0x92aac8['messageId']}});}break;case _0x80f5('0xcb'):if(_0xb76a1['body'][_0x80f5('0x83')]&&_0xb76a1['body']['status']){_0x153048=_0xb76a1[_0x80f5('0x57')]['status'];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0xb76a1[_0x80f5('0x57')][_0x80f5('0x83')]}});}break;case _0x80f5('0x8d'):if(_0xb76a1[_0x80f5('0x57')][_0x80f5('0xcc')]&&_0xb76a1[_0x80f5('0x57')][_0x80f5('0x27')]){_0x153048=_0xb76a1[_0x80f5('0x57')][_0x80f5('0x27')];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0xb76a1['body']['redif']}});}break;}}})[_0x80f5('0x1e')](handleEntityNotFound(_0x330422,null))[_0x80f5('0x1e')](function(_0x3abaec){if(_0x3abaec){_0x2ee3c7=_0x3abaec;switch(_0x45b69d[_0x80f5('0x4c')]){case _0x80f5('0x7f'):if(_0x153048===_0x80f5('0xca')){return _0x2ee3c7[_0x80f5('0x2f')]({'read':!![]});}else{logger[_0x80f5('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x80f5('0x27'),_0x80f5('0x7f'),util[_0x80f5('0xc4')](_0xb76a1[_0x80f5('0x57')],{'showHidden':![],'depth':null}));}break;case _0x80f5('0x81'):if(_0x153048==='1'){return _0x2ee3c7[_0x80f5('0x2f')]({'read':!![]});}else{logger[_0x80f5('0x23')](_0x80f5('0x21'),'status','skebby',util[_0x80f5('0xc4')](_0xb76a1['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xb76a1[_0x80f5('0x57')][_0x80f5('0xcd')]&&_0x153048>=0xc8&&_0x153048<=0xce){return _0x2ee3c7['update']({'read':!![]});}else{logger[_0x80f5('0x23')](_0x80f5('0x21'),'status',_0x80f5('0x82'),util[_0x80f5('0xc4')](_0xb76a1[_0x80f5('0x57')],{'showHidden':![],'depth':null}));}break;case _0x80f5('0xce'):var _0x30c59a=_0xb76a1['body'][_0x80f5('0x89')][0x0];if(_0x30c59a[_0x80f5('0x27')][_0x80f5('0xc9')]===_0x80f5('0xca')){return _0x2ee3c7[_0x80f5('0x2f')]({'read':!![]});}else{logger[_0x80f5('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x80f5('0x27'),'infobip',util[_0x80f5('0xc4')](_0xb76a1[_0x80f5('0x57')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x153048=='DELIVERED_TO_GATEWAY'||_0x153048==_0x80f5('0xcf')){return _0x2ee3c7['update']({'read':!![]});}else{logger['error'](_0x80f5('0x21'),_0x80f5('0x27'),_0x80f5('0xcb'),util[_0x80f5('0xc4')](_0xb76a1['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x153048===_0x80f5('0xd0')||_0x153048===_0x80f5('0xd1')){return _0x2ee3c7[_0x80f5('0x2f')]({'read':!![]});}else{logger[_0x80f5('0x23')](_0x80f5('0x21'),_0x80f5('0x27'),_0x80f5('0x8d'),util['inspect'](_0xb76a1['body'],{'showHidden':![],'depth':null}));}break;}return _0x2ee3c7;}})[_0x80f5('0x1e')](respondWithResult(_0x330422,null))[_0x80f5('0x26')](handleError(_0x330422,null));};exports[_0x80f5('0xd2')]=function(_0x3a593c,_0x5128f0,_0x24badf){var _0x5a578c,_0x126728,_0x1a32cf;return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0x3a593c[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x5128f0,null))[_0x80f5('0x1e')](function(_0x2083bc){if(_0x2083bc){_0x1a32cf=_0x2083bc;logger['debug'](_0x80f5('0x21'),'status',_0x80f5('0xc3'),_0x2083bc[_0x80f5('0x4c')],util[_0x80f5('0xc4')](_0x3a593c[_0x80f5('0x3e')],{'showHidden':![],'depth':null}));switch(_0x2083bc[_0x80f5('0x4c')]){case _0x80f5('0xd3'):if(_0x3a593c[_0x80f5('0x3e')][_0x80f5('0xd4')]&&_0x3a593c['query'][_0x80f5('0xd5')]){_0x126728=_0x3a593c[_0x80f5('0x3e')][_0x80f5('0xd5')];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0x3a593c[_0x80f5('0x3e')][_0x80f5('0xd4')]}});}break;}}})[_0x80f5('0x1e')](handleEntityNotFound(_0x5128f0,null))[_0x80f5('0x1e')](function(_0x47f27e){if(_0x47f27e){_0x5a578c=_0x47f27e;switch(_0x1a32cf['type']){case _0x80f5('0xd3'):if(_0x126728==='2'||_0x126728==='6'){return _0x5a578c['update']({'read':!![]});}else{logger[_0x80f5('0x23')](_0x80f5('0x21'),_0x80f5('0x27'),_0x80f5('0xd3'),util[_0x80f5('0xc4')](_0x3a593c['query'],{'showHidden':![],'depth':null}));};break;}return _0x5a578c;}})[_0x80f5('0x1e')](respondWithResult(_0x5128f0,null))[_0x80f5('0x26')](handleError(_0x5128f0,null));};exports[_0x80f5('0xd6')]=function(_0x572927,_0x51e4a9,_0x780e47){return db['SmsAccount'][_0x80f5('0x56')]({'where':{'id':_0x572927[_0x80f5('0x60')]['id']}})['then'](handleEntityNotFound(_0x51e4a9,null))['then'](function(_0x456d72){if(_0x456d72){return _0x456d72[_0x80f5('0xd6')](_0x572927[_0x80f5('0x57')]['ids'],_[_0x80f5('0x99')](_0x572927[_0x80f5('0x57')],[_0x80f5('0x67'),'id'])||{})['spread'](function(_0x36264c){for(var _0x2f69f7=0x0;_0x2f69f7<_0x572927['body'][_0x80f5('0x67')][_0x80f5('0x43')];_0x2f69f7+=0x1){socket[_0x80f5('0xd7')](_0x80f5('0xd8'),{'UserId':_0x572927[_0x80f5('0x57')][_0x80f5('0x67')][_0x2f69f7],'SmsAccountId':_0x572927['params']['id']});}return _0x36264c;});}})[_0x80f5('0x1e')](respondWithResult(_0x51e4a9,null))[_0x80f5('0x26')](handleError(_0x51e4a9,null));};exports[_0x80f5('0xd9')]=function(_0x4965d3,_0x31d52e,_0x551799){return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0x4965d3[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x31d52e,null))[_0x80f5('0x1e')](function(_0x35eb8b){if(_0x35eb8b){return _0x35eb8b[_0x80f5('0xd9')](_0x4965d3['query'][_0x80f5('0x67')])[_0x80f5('0x1e')](function(){if(_[_0x80f5('0xda')](_0x4965d3[_0x80f5('0x3e')][_0x80f5('0x67')])){for(var _0x3362d9=0x0;_0x3362d9<_0x4965d3['query'][_0x80f5('0x67')]['length'];_0x3362d9+=0x1){socket[_0x80f5('0xd7')](_0x80f5('0xdb'),{'UserId':Number(_0x4965d3[_0x80f5('0x3e')]['ids'][_0x3362d9]),'SmsAccountId':Number(_0x4965d3[_0x80f5('0x60')]['id'])});}}else{socket['emit'](_0x80f5('0xdb'),{'UserId':Number(_0x4965d3[_0x80f5('0x3e')][_0x80f5('0x67')]),'SmsAccountId':Number(_0x4965d3[_0x80f5('0x60')]['id'])});}});}})[_0x80f5('0x1e')](respondWithStatusCode(_0x31d52e,null))[_0x80f5('0x26')](handleError(_0x31d52e,null));};exports[_0x80f5('0xdc')]=function(_0x3a4d09,_0x3c826f,_0x15e34b){var _0x37bd55={};var _0x203d80={};var _0x456cd0;var _0x425ba3;return db[_0x80f5('0x3a')][_0x80f5('0x64')]({'where':{'id':_0x3a4d09['params']['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x3c826f,null))[_0x80f5('0x1e')](function(_0x5176a5){if(_0x5176a5){_0x456cd0=_0x5176a5;_0x203d80[_0x80f5('0x3c')]=_[_0x80f5('0x3d')](db[_0x80f5('0xa8')][_0x80f5('0x3b')]);_0x203d80[_0x80f5('0x3e')]=_['keys'](_0x3a4d09['query']);_0x203d80[_0x80f5('0x3f')]=_[_0x80f5('0x40')](_0x203d80[_0x80f5('0x3c')],_0x203d80[_0x80f5('0x3e')]);_0x37bd55[_0x80f5('0x42')]=_[_0x80f5('0x40')](_0x203d80[_0x80f5('0x3c')],qs[_0x80f5('0x41')](_0x3a4d09[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x37bd55[_0x80f5('0x42')]=_0x37bd55[_0x80f5('0x42')][_0x80f5('0x43')]?_0x37bd55[_0x80f5('0x42')]:_0x203d80[_0x80f5('0x3c')];_0x37bd55[_0x80f5('0x46')]=qs[_0x80f5('0x47')](_0x3a4d09[_0x80f5('0x3e')][_0x80f5('0x47')]);_0x37bd55[_0x80f5('0x48')]=qs[_0x80f5('0x3f')](_[_0x80f5('0x49')](_0x3a4d09[_0x80f5('0x3e')],_0x203d80[_0x80f5('0x3f')]));if(_0x3a4d09[_0x80f5('0x3e')][_0x80f5('0x4a')]){_0x37bd55[_0x80f5('0x48')]=_[_0x80f5('0x4b')](_0x37bd55['where'],{'$or':_['map'](_0x37bd55['attributes'],function(_0x455fae){var _0x4f3375={};_0x4f3375[_0x455fae]={'$like':'%'+_0x3a4d09['query']['filter']+'%'};return _0x4f3375;})});}_0x37bd55=_[_0x80f5('0x4b')]({},_0x37bd55,_0x3a4d09[_0x80f5('0x4f')]);return _0x456cd0[_0x80f5('0xdc')](_0x37bd55);}})['then'](function(_0x4ad20a){if(_0x4ad20a){_0x425ba3=_0x4ad20a[_0x80f5('0x43')];if(!_0x3a4d09[_0x80f5('0x3e')][_0x80f5('0x44')](_0x80f5('0x45'))){_0x37bd55[_0x80f5('0x2b')]=qs[_0x80f5('0x2b')](_0x3a4d09[_0x80f5('0x3e')][_0x80f5('0x2b')]);_0x37bd55[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0x3a4d09[_0x80f5('0x3e')]['offset']);}return _0x456cd0['getAgents'](_0x37bd55);}})[_0x80f5('0x1e')](function(_0x17bb9c){if(_0x17bb9c){return _0x17bb9c?{'count':_0x425ba3,'rows':_0x17bb9c}:null;}})['then'](respondWithResult(_0x3c826f,null))[_0x80f5('0x26')](handleError(_0x3c826f,null));};
\ No newline at end of file
+var _0xe18c=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','request','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','sendStatus','end','json','offset','limit','status','apply','reject','destroy','get','SmsAccounts','stack','name','send','index','mandatoryDispositionPause','SmsAccount','rawAttributes','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Pause','describe','addDisposition','SmsAccountId','Disposition','getDispositions','length','removeDispositions','ids','CannedAnswer','findOne','removeAnswers','sms','SmsApplication','Applications','account','applications','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','twilio','From','Body','MessageSid','from','sender','text','connectel','clicksend','messageId','message_id','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','contact','SmsInteraction','spread','interaction','autoclose','push','unmanaged','*,*,*,*','created','SmsMessage','UserId','User','unshift','agent','Start','startRouting','receiveMessage','info','entity\x20found','set','Content-Type','text/xml','\x0a ','addApplications','bulkCreate','findAndCountAll','getApplications','getInteractions','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','List','out','Messages','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','redif','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','state','message-id','addAgents','omit','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto'];(function(_0x429feb,_0x5206c1){var _0x596717=function(_0x26ea3e){while(--_0x26ea3e){_0x429feb['push'](_0x429feb['shift']());}};_0x596717(++_0x5206c1);}(_0xe18c,0xcf));var _0xce18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe18c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xce18('0x0'));var emlformat=require(_0xce18('0x1'));var rimraf=require(_0xce18('0x2'));var zipdir=require(_0xce18('0x3'));var jsonpatch=require(_0xce18('0x4'));var rp=require(_0xce18('0x5'));var moment=require(_0xce18('0x6'));var BPromise=require(_0xce18('0x7'));var Mustache=require('mustache');var util=require(_0xce18('0x8'));var path=require('path');var sox=require(_0xce18('0x9'));var csv=require(_0xce18('0xa'));var ejs=require(_0xce18('0xb'));var fs=require('fs');var _=require(_0xce18('0xc'));var squel=require('squel');var crypto=require(_0xce18('0xd'));var jsforce=require(_0xce18('0xe'));var deskjs=require(_0xce18('0xf'));var toCsv=require(_0xce18('0xa'));var querystring=require(_0xce18('0x10'));var Papa=require(_0xce18('0x11'));var Redis=require(_0xce18('0x12'));var authService=require(_0xce18('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xce18('0x14'));var logger=require(_0xce18('0x15'))(_0xce18('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xce18('0x17'))['db'];config[_0xce18('0x18')]=_[_0xce18('0x19')](config[_0xce18('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xce18('0x1a'))(new Redis(config['redis']));require(_0xce18('0x1b'))[_0xce18('0x1c')](socket);var jayson=require(_0xce18('0x1d'));var client=jayson[_0xce18('0x1e')][_0xce18('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x273fb2,_0x1811aa,_0x251b6e){if(_0x251b6e){var _0x564a34=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x564a34[_0xce18('0x20')](_0x1811aa)){return _0x273fb2;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x273fb2;}}function respondWithRpcPromise(_0x26a86f,_0x4e8464,_0x1af093,_0x5e9e43){return new BPromise(function(_0x251a78,_0x56e2d){var _0x3916a9=_0x5e9e43||client;return _0x3916a9[_0xce18('0x21')](_0x26a86f,_0x1af093)[_0xce18('0x22')](function(_0x1b9d37){logger['info']('SmsAccount,\x20%s,\x20%s',_0x4e8464,_0xce18('0x23'));logger[_0xce18('0x24')](_0xce18('0x25'),_0x4e8464,'request\x20sent',JSON[_0xce18('0x26')](_0x1b9d37));if(_0x1b9d37[_0xce18('0x27')]){if(_0x1b9d37[_0xce18('0x27')][_0xce18('0x28')]===0x1f4){logger[_0xce18('0x27')]('SmsAccount,\x20%s,\x20%s',_0x4e8464,_0x1b9d37[_0xce18('0x27')][_0xce18('0x29')]);return _0x56e2d(_0x1b9d37[_0xce18('0x27')]['message']);}logger[_0xce18('0x27')](_0xce18('0x2a'),_0x4e8464,_0x1b9d37[_0xce18('0x27')]['message']);return _0x251a78(_0x1b9d37[_0xce18('0x27')][_0xce18('0x29')]);}else{logger['info'](_0xce18('0x2a'),_0x4e8464,_0xce18('0x23'));_0x251a78(_0x1b9d37[_0xce18('0x2b')][_0xce18('0x29')]);}})['catch'](function(_0x59d8ae){logger['error']('SmsAccount,\x20%s,\x20%s',_0x4e8464,_0x59d8ae);_0x56e2d(_0x59d8ae);});});}function respondWithStatusCode(_0x5550ae,_0x2ed767){_0x2ed767=_0x2ed767||0xcc;return function(_0x3de5c1){if(_0x3de5c1){return _0x5550ae[_0xce18('0x2c')](_0x2ed767);}return _0x5550ae['status'](_0x2ed767)[_0xce18('0x2d')]();};}function respondWithResult(_0x2a9830,_0x20cf7c){_0x20cf7c=_0x20cf7c||0xc8;return function(_0x3ba9bf){if(_0x3ba9bf){return _0x2a9830['status'](_0x20cf7c)[_0xce18('0x2e')](_0x3ba9bf);}};}function respondWithFilteredResult(_0x24ff7e,_0x4c0fe1){return function(_0x59fc03){if(_0x59fc03){var _0x5ab8ba=_0x59fc03['count'],_0x1305da=_0x4c0fe1['offset'],_0x331cb8=_0x4c0fe1[_0xce18('0x2f')]+_0x4c0fe1[_0xce18('0x30')],_0x7d3d33;if(_0x331cb8>=_0x5ab8ba){_0x331cb8=_0x5ab8ba;_0x7d3d33=0xc8;}else{_0x7d3d33=0xce;}_0x24ff7e[_0xce18('0x31')](_0x7d3d33);return _0x24ff7e['set']('Content-Range',_0x1305da+'-'+_0x331cb8+'/'+_0x5ab8ba)[_0xce18('0x2e')](_0x59fc03);}return null;};}function patchUpdates(_0x395109){return function(_0x46dbd0){try{jsonpatch[_0xce18('0x32')](_0x46dbd0,_0x395109,!![]);}catch(_0x51fbdb){return BPromise[_0xce18('0x33')](_0x51fbdb);}return _0x46dbd0['save']();};}function saveUpdates(_0x27ebe2,_0x355e0f){return function(_0x91869a){if(_0x91869a){return _0x91869a['update'](_0x27ebe2)['then'](function(_0x1af351){return _0x1af351;});}return null;};}function removeEntity(_0xca278a,_0x404f34){return function(_0x187d36){if(_0x187d36){return _0x187d36[_0xce18('0x34')]()[_0xce18('0x22')](function(){var _0x416335=_0x187d36[_0xce18('0x35')]({'plain':!![]});var _0x3f9992=_0xce18('0x36');return db['UserProfileResource'][_0xce18('0x34')]({'where':{'type':_0x3f9992,'resourceId':_0x416335['id']}})[_0xce18('0x22')](function(){return _0x187d36;});})[_0xce18('0x22')](function(){_0xca278a[_0xce18('0x31')](0xcc)[_0xce18('0x2d')]();});}};}function handleEntityNotFound(_0x2c8faa,_0x1a2a6c){return function(_0x2a91cb){if(!_0x2a91cb){_0x2c8faa['sendStatus'](0x194);}return _0x2a91cb;};}function handleError(_0x303c02,_0x7e0db){_0x7e0db=_0x7e0db||0x1f4;return function(_0x549f28){logger[_0xce18('0x27')](_0x549f28[_0xce18('0x37')]);if(_0x549f28[_0xce18('0x38')]){delete _0x549f28[_0xce18('0x38')];}_0x303c02[_0xce18('0x31')](_0x7e0db)[_0xce18('0x39')](_0x549f28);};}exports[_0xce18('0x3a')]=function(_0x136220,_0x2b5a39){var _0xa0a542={'include':[{'model':db['Pause'],'as':_0xce18('0x3b')}]},_0x328ede={},_0x1a7886={'count':0x0,'rows':[]};var _0x302195=db[_0xce18('0x3c')][_0xce18('0x3d')];_0x328ede['model']=_['keys'](_0x302195);_0x328ede[_0xce18('0x3e')]=_[_0xce18('0x3f')](_0x136220[_0xce18('0x3e')]);_0x328ede[_0xce18('0x40')]=_['intersection'](_0x328ede[_0xce18('0x41')],_0x328ede[_0xce18('0x3e')]);_0xa0a542[_0xce18('0x42')]=_[_0xce18('0x43')](_0x328ede[_0xce18('0x41')],qs[_0xce18('0x44')](_0x136220[_0xce18('0x3e')][_0xce18('0x44')]));_0xa0a542[_0xce18('0x42')]=_0xa0a542[_0xce18('0x42')]['length']?_0xa0a542[_0xce18('0x42')]:_0x328ede[_0xce18('0x41')];if(!_0x136220['query'][_0xce18('0x45')](_0xce18('0x46'))){_0xa0a542[_0xce18('0x30')]=qs[_0xce18('0x30')](_0x136220[_0xce18('0x3e')][_0xce18('0x30')]);_0xa0a542[_0xce18('0x2f')]=qs[_0xce18('0x2f')](_0x136220[_0xce18('0x3e')]['offset']);}_0xa0a542[_0xce18('0x47')]=qs[_0xce18('0x48')](_0x136220[_0xce18('0x3e')][_0xce18('0x48')]);_0xa0a542[_0xce18('0x49')]=qs['filters'](_[_0xce18('0x4a')](_0x136220[_0xce18('0x3e')],_0x328ede['filters']));if(_0x136220[_0xce18('0x3e')]['filter']){_0xa0a542[_0xce18('0x49')]=_[_0xce18('0x4b')](_0xa0a542[_0xce18('0x49')],{'$or':_[_0xce18('0x4c')](_0x302195,function(_0x339da8){if(_0x339da8[_0xce18('0x4d')]['key']!==_0xce18('0x4e')){var _0x2b3aaf={};_0x2b3aaf[_0x339da8[_0xce18('0x4f')]]={'$like':'%'+_0x136220[_0xce18('0x3e')][_0xce18('0x50')]+'%'};return _0x2b3aaf;}})});}_0xa0a542=_[_0xce18('0x4b')]({},_0xa0a542,_0x136220[_0xce18('0x51')]);var _0x42caf3={'where':_0xa0a542['where']};return db['SmsAccount'][_0xce18('0x52')](_0x42caf3)[_0xce18('0x22')](function(_0xd42e99){_0x1a7886[_0xce18('0x52')]=_0xd42e99;if(_0x136220[_0xce18('0x3e')]['includeAll']){_0xa0a542[_0xce18('0x53')]=[{'all':!![]}];}return db[_0xce18('0x3c')][_0xce18('0x54')](_0xa0a542);})['then'](function(_0x5f1e09){_0x1a7886[_0xce18('0x55')]=_0x5f1e09;return _0x1a7886;})[_0xce18('0x22')](respondWithFilteredResult(_0x2b5a39,_0xa0a542))[_0xce18('0x56')](handleError(_0x2b5a39,null));};exports[_0xce18('0x57')]=function(_0x383a28,_0x80f124){var _0x3bc139={'raw':![],'where':{'id':_0x383a28[_0xce18('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xce18('0x3b')}]},_0x5678c0={};_0x5678c0[_0xce18('0x41')]=_[_0xce18('0x3f')](db['SmsAccount']['rawAttributes']);_0x5678c0[_0xce18('0x3e')]=_['keys'](_0x383a28[_0xce18('0x3e')]);_0x5678c0[_0xce18('0x40')]=_[_0xce18('0x43')](_0x5678c0['model'],_0x5678c0[_0xce18('0x3e')]);_0x3bc139['attributes']=_[_0xce18('0x43')](_0x5678c0['model'],qs[_0xce18('0x44')](_0x383a28[_0xce18('0x3e')][_0xce18('0x44')]));_0x3bc139[_0xce18('0x42')]=_0x3bc139[_0xce18('0x42')]['length']?_0x3bc139[_0xce18('0x42')]:_0x5678c0[_0xce18('0x41')];if(_0x383a28[_0xce18('0x3e')][_0xce18('0x59')]){_0x3bc139[_0xce18('0x53')]=[{'all':!![]}];}_0x3bc139=_[_0xce18('0x4b')]({},_0x3bc139,_0x383a28[_0xce18('0x51')]);return db['SmsAccount'][_0xce18('0x5a')](_0x3bc139)[_0xce18('0x22')](handleEntityNotFound(_0x80f124,null))[_0xce18('0x22')](respondWithResult(_0x80f124,null))['catch'](handleError(_0x80f124,null));};exports[_0xce18('0x5b')]=function(_0x9c54e1,_0x388dd4){return db['SmsAccount'][_0xce18('0x5b')](_0x9c54e1[_0xce18('0x5c')],{})[_0xce18('0x22')](function(_0x1e148d){var _0xcd458e=_0x9c54e1['user'][_0xce18('0x35')]({'plain':!![]});if(!_0xcd458e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcd458e[_0xce18('0x5d')]===_0xce18('0x5e')){var _0x5ae1c0=_0x1e148d[_0xce18('0x35')]({'plain':!![]});var _0x54ea71=_0xce18('0x36');return db[_0xce18('0x5f')]['find']({'where':{'name':_0x54ea71,'userProfileId':_0xcd458e[_0xce18('0x60')]},'raw':!![]})[_0xce18('0x22')](function(_0x1b2f3f){if(_0x1b2f3f&&_0x1b2f3f[_0xce18('0x61')]===0x0){return db[_0xce18('0x62')][_0xce18('0x5b')]({'name':_0x5ae1c0[_0xce18('0x38')],'resourceId':_0x5ae1c0['id'],'type':_0x1b2f3f[_0xce18('0x38')],'sectionId':_0x1b2f3f['id']},{})[_0xce18('0x22')](function(){return _0x1e148d;});}else{return _0x1e148d;}})['catch'](function(_0x4cf446){logger[_0xce18('0x27')](_0xce18('0x63'),_0x4cf446);throw _0x4cf446;});}return _0x1e148d;})[_0xce18('0x22')](respondWithResult(_0x388dd4,0xc9))[_0xce18('0x56')](handleError(_0x388dd4,null));};exports[_0xce18('0x64')]=function(_0x551fd5,_0x23e45e){if(_0x551fd5[_0xce18('0x5c')]['id']){delete _0x551fd5[_0xce18('0x5c')]['id'];}return db[_0xce18('0x3c')][_0xce18('0x5a')]({'where':{'id':_0x551fd5['params']['id']},'include':[{'model':db[_0xce18('0x65')],'as':_0xce18('0x3b')}]})[_0xce18('0x22')](handleEntityNotFound(_0x23e45e,null))[_0xce18('0x22')](saveUpdates(_0x551fd5['body'],null))[_0xce18('0x22')](respondWithResult(_0x23e45e,null))[_0xce18('0x56')](handleError(_0x23e45e,null));};exports[_0xce18('0x34')]=function(_0x452927,_0xc01e3a){return db[_0xce18('0x3c')][_0xce18('0x5a')]({'where':{'id':_0x452927[_0xce18('0x58')]['id']}})[_0xce18('0x22')](handleEntityNotFound(_0xc01e3a,null))[_0xce18('0x22')](removeEntity(_0xc01e3a,null))[_0xce18('0x56')](handleError(_0xc01e3a,null));};exports[_0xce18('0x66')]=function(_0x4a41d7,_0x53ac4c){return db[_0xce18('0x3c')][_0xce18('0x66')]()[_0xce18('0x22')](respondWithResult(_0x53ac4c,null))[_0xce18('0x56')](handleError(_0x53ac4c,null));};exports[_0xce18('0x67')]=function(_0xc13dd,_0x63219e,_0x290f2c){if(_0xc13dd[_0xce18('0x5c')]['id']){delete _0xc13dd[_0xce18('0x5c')]['id'];}return db[_0xce18('0x3c')][_0xce18('0x5a')]({'where':{'id':_0xc13dd[_0xce18('0x58')]['id']}})[_0xce18('0x22')](handleEntityNotFound(_0x63219e,null))['then'](function(_0x3c59ab){if(_0x3c59ab){_0xc13dd[_0xce18('0x5c')][_0xce18('0x68')]=_0x3c59ab['id'];return db[_0xce18('0x69')][_0xce18('0x5b')](_0xc13dd['body']);}})[_0xce18('0x22')](respondWithResult(_0x63219e,null))[_0xce18('0x56')](handleError(_0x63219e,null));};exports[_0xce18('0x6a')]=function(_0x390476,_0x34b9b6,_0x558857){var _0x57238a={'raw':![],'where':{}};var _0x1e328d={};var _0x28e187={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x390476[_0xce18('0x58')]['id']}})['then'](handleEntityNotFound(_0x34b9b6,null))[_0xce18('0x22')](function(_0x555d7b){if(_0x555d7b){_0x1e328d[_0xce18('0x41')]=_['keys'](db[_0xce18('0x69')][_0xce18('0x3d')]);_0x1e328d[_0xce18('0x3e')]=_[_0xce18('0x3f')](_0x390476['query']);_0x1e328d[_0xce18('0x40')]=_[_0xce18('0x43')](_0x1e328d[_0xce18('0x41')],_0x1e328d['query']);_0x57238a[_0xce18('0x42')]=_[_0xce18('0x43')](_0x1e328d[_0xce18('0x41')],qs[_0xce18('0x44')](_0x390476['query'][_0xce18('0x44')]));_0x57238a['attributes']=_0x57238a[_0xce18('0x42')][_0xce18('0x6b')]?_0x57238a[_0xce18('0x42')]:_0x1e328d[_0xce18('0x41')];if(!_0x390476[_0xce18('0x3e')][_0xce18('0x45')](_0xce18('0x46'))){_0x57238a['limit']=qs['limit'](_0x390476[_0xce18('0x3e')][_0xce18('0x30')]);_0x57238a['offset']=qs[_0xce18('0x2f')](_0x390476['query'][_0xce18('0x2f')]);}_0x57238a['order']=qs[_0xce18('0x48')](_0x390476[_0xce18('0x3e')][_0xce18('0x48')]);_0x57238a[_0xce18('0x49')]=qs[_0xce18('0x40')](_[_0xce18('0x4a')](_0x390476[_0xce18('0x3e')],_0x1e328d['filters']));_0x57238a['where'][_0xce18('0x68')]=_0x555d7b['id'];if(_0x390476['query'][_0xce18('0x50')]){_0x57238a[_0xce18('0x49')]=_[_0xce18('0x4b')](_0x57238a[_0xce18('0x49')],{'$or':_[_0xce18('0x4c')](_0x57238a[_0xce18('0x42')],function(_0xa05762){var _0x5f405e={};_0x5f405e[_0xa05762]={'$like':'%'+_0x390476[_0xce18('0x3e')][_0xce18('0x50')]+'%'};return _0x5f405e;})});}_0x57238a=_['merge']({},_0x57238a,_0x390476[_0xce18('0x51')]);return db['Disposition'][_0xce18('0x52')]({'where':_0x57238a[_0xce18('0x49')]})[_0xce18('0x22')](function(_0xb993e8){_0x28e187[_0xce18('0x52')]=_0xb993e8;if(_0x390476[_0xce18('0x3e')][_0xce18('0x59')]){_0x57238a[_0xce18('0x53')]=[{'all':!![]}];}return db[_0xce18('0x69')][_0xce18('0x54')](_0x57238a);})[_0xce18('0x22')](function(_0x18f4c6){_0x28e187['rows']=_0x18f4c6;return _0x28e187;});}})[_0xce18('0x22')](respondWithFilteredResult(_0x34b9b6,_0x57238a))[_0xce18('0x56')](handleError(_0x34b9b6,null));};exports[_0xce18('0x6c')]=function(_0x32600c,_0x27bf81,_0x3e98b5){return db[_0xce18('0x3c')]['find']({'where':{'id':_0x32600c[_0xce18('0x58')]['id']}})[_0xce18('0x22')](handleEntityNotFound(_0x27bf81,null))[_0xce18('0x22')](function(_0x1f38f3){if(_0x1f38f3){return _0x1f38f3['removeDispositions'](_0x32600c[_0xce18('0x3e')][_0xce18('0x6d')]);}})['then'](respondWithStatusCode(_0x27bf81,null))[_0xce18('0x56')](handleError(_0x27bf81,null));};exports['addAnswer']=function(_0x30987f,_0x287ba8,_0xcd50a1){if(_0x30987f['body']['id']){delete _0x30987f[_0xce18('0x5c')]['id'];}return db[_0xce18('0x3c')][_0xce18('0x5a')]({'where':{'id':_0x30987f[_0xce18('0x58')]['id']}})[_0xce18('0x22')](handleEntityNotFound(_0x287ba8,null))[_0xce18('0x22')](function(_0x5e2b7e){if(_0x5e2b7e){_0x30987f[_0xce18('0x5c')][_0xce18('0x68')]=_0x5e2b7e['id'];return db[_0xce18('0x6e')][_0xce18('0x5b')](_0x30987f[_0xce18('0x5c')]);}})[_0xce18('0x22')](respondWithResult(_0x287ba8,null))[_0xce18('0x56')](handleError(_0x287ba8,null));};exports['getAnswers']=function(_0x2bc65b,_0x521716,_0x165cfa){var _0x2c0090={'raw':![],'where':{}};var _0x5bdf79={};var _0x1b55c8={'count':0x0,'rows':[]};return db['SmsAccount'][_0xce18('0x6f')]({'where':{'id':_0x2bc65b[_0xce18('0x58')]['id']}})[_0xce18('0x22')](handleEntityNotFound(_0x521716,null))[_0xce18('0x22')](function(_0x509f66){if(_0x509f66){_0x5bdf79[_0xce18('0x41')]=_['keys'](db[_0xce18('0x6e')][_0xce18('0x3d')]);_0x5bdf79[_0xce18('0x3e')]=_[_0xce18('0x3f')](_0x2bc65b['query']);_0x5bdf79[_0xce18('0x40')]=_['intersection'](_0x5bdf79[_0xce18('0x41')],_0x5bdf79['query']);_0x2c0090[_0xce18('0x42')]=_['intersection'](_0x5bdf79[_0xce18('0x41')],qs[_0xce18('0x44')](_0x2bc65b[_0xce18('0x3e')][_0xce18('0x44')]));_0x2c0090[_0xce18('0x42')]=_0x2c0090[_0xce18('0x42')][_0xce18('0x6b')]?_0x2c0090['attributes']:_0x5bdf79[_0xce18('0x41')];if(!_0x2bc65b[_0xce18('0x3e')][_0xce18('0x45')](_0xce18('0x46'))){_0x2c0090[_0xce18('0x30')]=qs['limit'](_0x2bc65b[_0xce18('0x3e')][_0xce18('0x30')]);_0x2c0090['offset']=qs[_0xce18('0x2f')](_0x2bc65b[_0xce18('0x3e')]['offset']);}_0x2c0090[_0xce18('0x47')]=qs[_0xce18('0x48')](_0x2bc65b[_0xce18('0x3e')][_0xce18('0x48')]);_0x2c0090[_0xce18('0x49')]=qs[_0xce18('0x40')](_[_0xce18('0x4a')](_0x2bc65b[_0xce18('0x3e')],_0x5bdf79[_0xce18('0x40')]));_0x2c0090[_0xce18('0x49')][_0xce18('0x68')]=_0x509f66['id'];if(_0x2bc65b[_0xce18('0x3e')][_0xce18('0x50')]){_0x2c0090[_0xce18('0x49')]=_['merge'](_0x2c0090[_0xce18('0x49')],{'$or':_[_0xce18('0x4c')](_0x2c0090[_0xce18('0x42')],function(_0xd48d78){var _0x133664={};_0x133664[_0xd48d78]={'$like':'%'+_0x2bc65b[_0xce18('0x3e')]['filter']+'%'};return _0x133664;})});}_0x2c0090=_[_0xce18('0x4b')]({},_0x2c0090,_0x2bc65b['options']);return db[_0xce18('0x6e')][_0xce18('0x52')]({'where':_0x2c0090[_0xce18('0x49')]})[_0xce18('0x22')](function(_0x54b143){_0x1b55c8[_0xce18('0x52')]=_0x54b143;if(_0x2bc65b[_0xce18('0x3e')][_0xce18('0x59')]){_0x2c0090[_0xce18('0x53')]=[{'all':!![]}];}return db[_0xce18('0x6e')]['findAll'](_0x2c0090);})['then'](function(_0x503659){_0x1b55c8[_0xce18('0x55')]=_0x503659;return _0x1b55c8;});}})[_0xce18('0x22')](respondWithFilteredResult(_0x521716,_0x2c0090))[_0xce18('0x56')](handleError(_0x521716,null));};exports[_0xce18('0x70')]=function(_0x2f2583,_0x34aff3,_0x58898f){return db['SmsAccount'][_0xce18('0x5a')]({'where':{'id':_0x2f2583['params']['id']}})[_0xce18('0x22')](handleEntityNotFound(_0x34aff3,null))[_0xce18('0x22')](function(_0x212132){if(_0x212132){return _0x212132['removeAnswers'](_0x2f2583[_0xce18('0x3e')]['ids']);}})[_0xce18('0x22')](respondWithStatusCode(_0x34aff3,null))[_0xce18('0x56')](handleError(_0x34aff3,null));};exports['notify']=function(_0xd9f76e,_0x13cbe1,_0xfb00e8){var _0x511e75={'channel':_0xce18('0x71')};var _0xf45898=[];var _0x2b6931=[];var _0x8098f={};return db[_0xce18('0x3c')][_0xce18('0x5a')]({'where':{'id':_0xd9f76e['params']['id']},'include':[{'model':db[_0xce18('0x72')],'as':_0xce18('0x73')}]})[_0xce18('0x22')](handleEntityNotFound(_0x13cbe1,null))[_0xce18('0x22')](function(_0x1d1486){_0x511e75[_0xce18('0x74')]=_0x1d1486;_0x511e75[_0xce18('0x75')]=_['orderBy'](_0x1d1486['Applications'],[_0xce18('0x76')],[_0xce18('0x77')]);if(_0x511e75[_0xce18('0x74')][_0xce18('0x73')]){delete _0x511e75[_0xce18('0x74')]['Applications'];}return db[_0xce18('0x78')]['describe']();})[_0xce18('0x22')](function(_0x2958e7){if(!_0x2958e7){throw new db[(_0xce18('0x79'))]['ValidationError'](_0xce18('0x7a'));}_0xf45898=_[_0xce18('0x7b')](_[_0xce18('0x3f')](_0x2958e7),['createdAt',_0xce18('0x7c')]);_0x2b6931=_[_0xce18('0x7b')](_[_0xce18('0x3f')](_0x2958e7),['createdAt',_0xce18('0x7c'),_0xce18('0x7d'),_0xce18('0x7e')]);_0x511e75[_0xce18('0x5c')]={'mapKey':'mobile'};if(_0x511e75[_0xce18('0x74')][_0xce18('0x4d')]){switch(_0x511e75['account'][_0xce18('0x4d')]){case _0xce18('0x7f'):_0x511e75[_0xce18('0x5c')]['from']=_0xd9f76e['body'][_0xce18('0x80')];_0x511e75['body'][_0xce18('0x5c')]=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x81')];_0x511e75['body']['messageId']=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x82')];break;case'skebby':_0x511e75[_0xce18('0x5c')][_0xce18('0x83')]='+'+_0xd9f76e[_0xce18('0x5c')][_0xce18('0x84')];_0x511e75[_0xce18('0x5c')][_0xce18('0x5c')]=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x85')];break;case _0xce18('0x86'):_0x511e75['body'][_0xce18('0x83')]=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x83')];_0x511e75[_0xce18('0x5c')][_0xce18('0x5c')]=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x29')];break;case _0xce18('0x87'):_0x511e75[_0xce18('0x5c')][_0xce18('0x83')]=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x83')];_0x511e75['body'][_0xce18('0x5c')]=_0xd9f76e['body'][_0xce18('0x5c')];_0x511e75['body'][_0xce18('0x88')]=_0xd9f76e['body'][_0xce18('0x89')];break;case _0xce18('0x8a'):_0x511e75[_0xce18('0x5c')]['from']=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x80')];_0x511e75[_0xce18('0x5c')][_0xce18('0x5c')]=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x8b')];_0x511e75['body'][_0xce18('0x88')]=_0xd9f76e[_0xce18('0x5c')]['MessageUUID'];break;case _0xce18('0x8c'):_0x511e75[_0xce18('0x5c')][_0xce18('0x83')]='+'+_0xd9f76e[_0xce18('0x5c')][_0xce18('0x8d')][0x0][_0xce18('0x83')];_0x511e75['body'][_0xce18('0x5c')]=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x8d')][0x0][_0xce18('0x85')];_0x511e75[_0xce18('0x5c')][_0xce18('0x88')]=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x8d')][0x0][_0xce18('0x88')];break;case _0xce18('0x8e'):_0x511e75['body'][_0xce18('0x83')]=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x8f')];_0x511e75[_0xce18('0x5c')]['body']=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x90')][_0xce18('0x29')];break;case _0xce18('0x91'):_0x511e75[_0xce18('0x5c')][_0xce18('0x83')]=_0xd9f76e[_0xce18('0x5c')]['fromNumber'];_0x511e75[_0xce18('0x5c')][_0xce18('0x5c')]=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x85')];_0x511e75[_0xce18('0x5c')]['messageId']=_0xd9f76e['body']['replyMessageId'];break;case _0xce18('0x92'):_0x511e75[_0xce18('0x5c')][_0xce18('0x83')]=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x83')];_0x511e75[_0xce18('0x5c')][_0xce18('0x5c')]=_0xd9f76e['body']['message'];_0x511e75[_0xce18('0x5c')]['messageId']=_0xd9f76e[_0xce18('0x5c')][_0xce18('0x93')];break;}}if(_0x511e75['body']['id']){delete _0x511e75['body']['id'];}if(_[_0xce18('0x94')](_0x511e75[_0xce18('0x5c')]['from'])){throw new db[(_0xce18('0x79'))][(_0xce18('0x95'))](_0xce18('0x96'));}if(_['isNil'](_0x511e75[_0xce18('0x5c')][_0xce18('0x5c')])||_0x511e75['body']['body']===''){throw new db[(_0xce18('0x79'))][(_0xce18('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x511e75[_0xce18('0x5c')][_0xce18('0x97')])){throw new db[(_0xce18('0x79'))]['ValidationError'](_0xce18('0x98')+_0x2b6931);}if(!_[_0xce18('0x99')](_0x2b6931,_0x511e75['body'][_0xce18('0x97')])){throw new db[(_0xce18('0x79'))][(_0xce18('0x95'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2b6931);}_0x8098f[_0x511e75['body'][_0xce18('0x97')]]=_0x511e75[_0xce18('0x5c')]['from'];return db[_0xce18('0x9a')][_0xce18('0x5a')]({'where':{'id':_0x511e75[_0xce18('0x74')]['ListId']},'include':[{'model':db[_0xce18('0x78')],'as':'Contacts','where':_0x8098f,'limit':0x1,'order':[[_0xce18('0x7c'),'DESC']]}]});})['then'](handleEntityNotFound(_0x13cbe1,null))['then'](function(_0x50a69d){if(_0x50a69d){_0x511e75['list']=_['omit'](_0x50a69d,[_0xce18('0x9b')]);if(_0x50a69d['Contacts'][_0xce18('0x6b')]){return _0x50a69d[_0xce18('0x9b')][0x0];}var _0x2fd8f3=_[_0xce18('0x19')](_0x511e75['body'],{'firstName':_0x511e75[_0xce18('0x5c')][_0xce18('0x83')],'ListId':_0x50a69d['id']});_0x2fd8f3[_0x511e75[_0xce18('0x5c')][_0xce18('0x97')]]=_0x511e75[_0xce18('0x5c')][_0xce18('0x83')];return db[_0xce18('0x78')]['create'](_0x2fd8f3,{'fields':_0xf45898,'raw':!![]});}})[_0xce18('0x22')](handleEntityNotFound(_0x13cbe1,null))['then'](function(_0x2f9847){if(_0x2f9847){_0x511e75[_0xce18('0x9c')]=_0x2f9847;var _0x593ff9={'ContactId':_0x2f9847['id'],'phone':_0x511e75[_0xce18('0x5c')][_0xce18('0x83')],'SmsAccountId':_0xd9f76e[_0xce18('0x58')]['id']};var _0x20c428={'ContactId':_0x2f9847['id'],'SmsAccountId':_0xd9f76e['params']['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x20c428})['then'](function(_0x4d53a9){if(_0x4d53a9){return[_0x4d53a9,![]];}return db[_0xce18('0x9d')][_0xce18('0x5b')](_0x593ff9)[_0xce18('0x22')](function(_0x2174a9){return[_0x2174a9,!![]];});});}})[_0xce18('0x9e')](function(_0x1ce0ca,_0x5305fc){_0x511e75[_0xce18('0x9f')]=_0x1ce0ca[_0xce18('0x35')]({'plain':!![]});_0x511e75[_0xce18('0x9f')]['created']=![];if(_0x5305fc){if(_0x511e75['account'][_0xce18('0xa0')]){_0x511e75[_0xce18('0x75')][_0xce18('0xa1')]({'id':0x0,'priority':_0x511e75[_0xce18('0x75')][_0xce18('0x6b')]+0x1,'app':'close','appdata':_0xce18('0xa2'),'interval':_0xce18('0xa3')});}_0x511e75[_0xce18('0x9f')][_0xce18('0xa4')]=!![];}return db[_0xce18('0xa5')][_0xce18('0x5b')]({'phone':_0x511e75[_0xce18('0x5c')][_0xce18('0x83')],'messageId':_0x511e75[_0xce18('0x5c')][_0xce18('0x88')],'body':_0x511e75['body'][_0xce18('0x5c')],'SmsAccountId':_0xd9f76e[_0xce18('0x58')]['id'],'SmsInteractionId':_0x1ce0ca['id'],'direction':'in','ContactId':_0x1ce0ca['ContactId'],'AttachmentId':_0x511e75[_0xce18('0x5c')]['AttachmentId']});})[_0xce18('0x22')](function(_0x48efd0){_0x511e75['message']=_0x48efd0;if(_0x511e75[_0xce18('0x9f')][_0xce18('0xa6')]){return db[_0xce18('0xa7')][_0xce18('0x5a')]({'attributes':['id',_0xce18('0x38')],'where':{'id':_0x511e75[_0xce18('0x9f')][_0xce18('0xa6')]}})[_0xce18('0x22')](function(_0x4ff4a1){if(_0x4ff4a1){_0x511e75['applications'][_0xce18('0xa8')]({'id':0x0,'priority':0x0,'app':_0xce18('0xa9'),'appdata':_0x4ff4a1['name']+','+(_0x511e75[_0xce18('0x74')]['waitForTheAssignedAgent']||0xa),'interval':_0xce18('0xa3')});}return respondWithRpcPromise(_0xce18('0xaa'),_0xce18('0xab'),_0x511e75);});}return respondWithRpcPromise(_0xce18('0xaa'),_0xce18('0xab'),_0x511e75);})['then'](function(_0x4da240){if(_0x4da240){var _0xfae9db=0xc8;var _0x14a4dd=_0xce18('0xac');logger[_0xce18('0xad')](_0xce18('0x25'),_0x14a4dd,_0xfae9db,_0xce18('0xae'));logger[_0xce18('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x14a4dd,_0xfae9db,_0xce18('0xae'),JSON[_0xce18('0x26')](_0x4da240));if(_0x511e75['account'][_0xce18('0x4d')]==='twilio'){return _0x13cbe1[_0xce18('0x31')](_0xfae9db)[_0xce18('0xaf')](_0xce18('0xb0'),_0xce18('0xb1'))[_0xce18('0x39')](_0xce18('0xb2'));}else{return _0x13cbe1[_0xce18('0x31')](_0xfae9db)[_0xce18('0x2e')](_0x4da240);}}})[_0xce18('0x56')](handleError(_0x13cbe1,null));};exports[_0xce18('0xb3')]=function(_0x36c4f9,_0x33a46b,_0x304d2b){return db[_0xce18('0x3c')]['findOne']({'where':{'id':_0x36c4f9[_0xce18('0x58')]['id']}})[_0xce18('0x22')](handleEntityNotFound(_0x33a46b,null))[_0xce18('0x22')](function(_0x47ceb1){if(_0x47ceb1){return db['sequelize']['transaction'](function(_0x4a7c6f){return db[_0xce18('0x72')][_0xce18('0x34')]({'where':{'SmsAccountId':_0x36c4f9[_0xce18('0x58')]['id']},'transaction':_0x4a7c6f})[_0xce18('0x22')](function(_0x48b4e3){var _0x4dcb04=_['map'](_0x36c4f9['body'],function(_0xc38e7a){_0xc38e7a[_0xce18('0x68')]=_0x36c4f9['params']['id'];return _0xc38e7a;});return db[_0xce18('0x72')][_0xce18('0xb4')](_0x4dcb04,{'transaction':_0x4a7c6f});});})['then'](function(){return db[_0xce18('0x72')][_0xce18('0xb5')]({'where':{'SmsAccountId':_0x36c4f9['params']['id']},'order':_0xce18('0x76')});});}})[_0xce18('0x22')](respondWithResult(_0x33a46b,null))['catch'](handleError(_0x33a46b,null));};exports[_0xce18('0xb6')]=function(_0x304b10,_0x1ddc20,_0x2d1e7a){var _0x699a0e={};var _0x5a7970={};var _0x464ca1;var _0xbe44d7;return db[_0xce18('0x3c')][_0xce18('0x6f')]({'where':{'id':_0x304b10[_0xce18('0x58')]['id']}})[_0xce18('0x22')](handleEntityNotFound(_0x1ddc20,null))[_0xce18('0x22')](function(_0x4f1e07){if(_0x4f1e07){_0x464ca1=_0x4f1e07;_0x5a7970[_0xce18('0x41')]=_[_0xce18('0x3f')](db[_0xce18('0x72')]['rawAttributes']);_0x5a7970[_0xce18('0x3e')]=_[_0xce18('0x3f')](_0x304b10[_0xce18('0x3e')]);_0x5a7970['filters']=_[_0xce18('0x43')](_0x5a7970['model'],_0x5a7970[_0xce18('0x3e')]);_0x699a0e['attributes']=_[_0xce18('0x43')](_0x5a7970[_0xce18('0x41')],qs['fields'](_0x304b10[_0xce18('0x3e')]['fields']));_0x699a0e[_0xce18('0x42')]=_0x699a0e[_0xce18('0x42')]['length']?_0x699a0e[_0xce18('0x42')]:_0x5a7970[_0xce18('0x41')];_0x699a0e[_0xce18('0x47')]=qs[_0xce18('0x48')](_0x304b10['query']['sort']);_0x699a0e['where']=qs['filters'](_[_0xce18('0x4a')](_0x304b10[_0xce18('0x3e')],_0x5a7970['filters']));if(_0x304b10[_0xce18('0x3e')]['filter']){_0x699a0e['where']=_[_0xce18('0x4b')](_0x699a0e[_0xce18('0x49')],{'$or':_[_0xce18('0x4c')](_0x699a0e[_0xce18('0x42')],function(_0x281189){var _0x358d73={};_0x358d73[_0x281189]={'$like':'%'+_0x304b10[_0xce18('0x3e')]['filter']+'%'};return _0x358d73;})});}_0x699a0e=_[_0xce18('0x4b')]({},_0x699a0e,_0x304b10['options']);return _0x464ca1[_0xce18('0xb6')](_0x699a0e);}})[_0xce18('0x22')](function(_0x2c204a){if(_0x2c204a){_0xbe44d7=_0x2c204a['length'];if(!_0x304b10[_0xce18('0x3e')]['hasOwnProperty'](_0xce18('0x46'))){_0x699a0e['limit']=qs[_0xce18('0x30')](_0x304b10[_0xce18('0x3e')]['limit']);_0x699a0e['offset']=qs['offset'](_0x304b10[_0xce18('0x3e')][_0xce18('0x2f')]);}return _0x464ca1[_0xce18('0xb6')](_0x699a0e);}})['then'](function(_0x28ef4c){if(_0x28ef4c){return _0x28ef4c?{'count':_0xbe44d7,'rows':_0x28ef4c}:null;}})[_0xce18('0x22')](respondWithResult(_0x1ddc20,null))[_0xce18('0x56')](handleError(_0x1ddc20,null));};exports[_0xce18('0xb7')]=function(_0x8be9c8,_0x542616,_0x130bf0){var _0x5a4955={'raw':![],'where':{}};var _0x189aea={};var _0x44aa8c={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x8be9c8[_0xce18('0x58')]['id']}})[_0xce18('0x22')](handleEntityNotFound(_0x542616,null))['then'](function(_0x47ee6a){if(_0x47ee6a){_0x189aea[_0xce18('0x41')]=_[_0xce18('0x3f')](db[_0xce18('0x9d')][_0xce18('0x3d')]);_0x189aea[_0xce18('0x3e')]=_[_0xce18('0x3f')](_0x8be9c8[_0xce18('0x3e')]);_0x189aea[_0xce18('0x40')]=_[_0xce18('0x43')](_0x189aea[_0xce18('0x41')],_0x189aea[_0xce18('0x3e')]);_0x5a4955['attributes']=_[_0xce18('0x43')](_0x189aea['model'],qs[_0xce18('0x44')](_0x8be9c8['query'][_0xce18('0x44')]));_0x5a4955['attributes']=_0x5a4955['attributes'][_0xce18('0x6b')]?_0x5a4955[_0xce18('0x42')]:_0x189aea[_0xce18('0x41')];if(!_0x8be9c8[_0xce18('0x3e')][_0xce18('0x45')](_0xce18('0x46'))){_0x5a4955['limit']=qs[_0xce18('0x30')](_0x8be9c8[_0xce18('0x3e')][_0xce18('0x30')]);_0x5a4955['offset']=qs[_0xce18('0x2f')](_0x8be9c8[_0xce18('0x3e')][_0xce18('0x2f')]);}_0x5a4955[_0xce18('0x47')]=qs[_0xce18('0x48')](_0x8be9c8[_0xce18('0x3e')][_0xce18('0x48')]);_0x5a4955[_0xce18('0x49')]=qs['filters'](_[_0xce18('0x4a')](_0x8be9c8[_0xce18('0x3e')],_0x189aea[_0xce18('0x40')]));_0x5a4955[_0xce18('0x49')][_0xce18('0x68')]=_0x47ee6a['id'];if(_0x8be9c8[_0xce18('0x3e')][_0xce18('0x50')]){_0x5a4955[_0xce18('0x49')]=_['merge'](_0x5a4955[_0xce18('0x49')],{'$or':_[_0xce18('0x4c')](_0x5a4955[_0xce18('0x42')],function(_0x7efd7b){var _0x2c3fb4={};_0x2c3fb4[_0x7efd7b]={'$like':'%'+_0x8be9c8['query']['filter']+'%'};return _0x2c3fb4;})});}_0x5a4955=_[_0xce18('0x4b')]({},_0x5a4955,_0x8be9c8[_0xce18('0x51')]);return db[_0xce18('0x9d')][_0xce18('0x52')]({'where':_0x5a4955['where']})[_0xce18('0x22')](function(_0x142188){_0x44aa8c[_0xce18('0x52')]=_0x142188;if(_0x8be9c8[_0xce18('0x3e')][_0xce18('0x59')]){_0x5a4955[_0xce18('0x53')]=[{'model':db[_0xce18('0x78')],'as':'Contact','required':![]},{'model':db[_0xce18('0xa7')],'as':'Owner','attributes':[_0xce18('0x38'),_0xce18('0xb8'),_0xce18('0xb9')],'required':![]},{'model':db[_0xce18('0xba')],'as':_0xce18('0xbb'),'attributes':['id','name',_0xce18('0xbc')],'where':_0x8be9c8[_0xce18('0x3e')][_0xce18('0xbd')]?{'id':_0x8be9c8[_0xce18('0x3e')][_0xce18('0xbd')]}:undefined,'required':_0x8be9c8['query'][_0xce18('0xbd')]?!![]:![]}];}return db[_0xce18('0x9d')][_0xce18('0x54')](_0x5a4955);})['then'](function(_0x338a64){_0x44aa8c['rows']=_0x338a64;return _0x44aa8c;});}})[_0xce18('0x22')](respondWithFilteredResult(_0x542616,_0x5a4955))[_0xce18('0x56')](handleError(_0x542616,null));};exports[_0xce18('0x39')]=function(_0x443764,_0x3757a6,_0x15328d){var _0x1a5038,_0x3e605f,_0x446d92;if(_[_0xce18('0x94')](_0x443764[_0xce18('0x5c')][_0xce18('0x5c')])||_0x443764['body']['body']===''){throw new db[(_0xce18('0x79'))][(_0xce18('0x95'))](_0xce18('0xbe'));}if(_[_0xce18('0x94')](_0x443764[_0xce18('0x5c')]['to'])){throw new db[(_0xce18('0x79'))][(_0xce18('0x95'))]('to\x20is\x20mandatory');}_0x1a5038=_0x443764[_0xce18('0x5c')]['to'];return db[_0xce18('0x3c')]['find']({'where':{'id':_0x443764['params']['id']},'include':[{'model':db[_0xce18('0x9a')],'as':'List','include':[{'model':db[_0xce18('0x78')],'as':_0xce18('0x9b'),'where':{'mobile':_0x1a5038},'limit':0x1,'order':[[_0xce18('0x7c'),_0xce18('0xbf')]]}]}]})[_0xce18('0x22')](handleEntityNotFound(_0x3757a6,null))[_0xce18('0x22')](function(_0x15a2fb){if(_0x15a2fb&&_0x15a2fb['List']){_0x3e605f=_0x15a2fb['get']({'plain':!![]});if(_0x3e605f[_0xce18('0xc0')]&&_0x3e605f[_0xce18('0xc0')]['Contacts']['length']){return _0x3e605f[_0xce18('0xc0')]['Contacts'][0x0];}return db[_0xce18('0x78')][_0xce18('0x5b')](_[_0xce18('0x19')](_0x443764[_0xce18('0x5c')],{'firstName':_0x1a5038,'mobile':_0x1a5038,'phone':_0x1a5038,'ListId':_0x3e605f[_0xce18('0x7e')]}));}})[_0xce18('0x22')](handleEntityNotFound(_0x3757a6,null))[_0xce18('0x22')](function(_0x1f818d){if(_0x1f818d){_0x446d92=_0x1f818d;return db[_0xce18('0x9d')]['find']({'where':{'ContactId':_0x446d92['id'],'closed':![],'SmsAccountId':_0x3e605f['id']}})[_0xce18('0x22')](function(_0x2fa389){if(_0x2fa389){return[_0x2fa389,![]];}return db[_0xce18('0x9d')][_0xce18('0x5b')]({'UserId':_0x443764[_0xce18('0x5e')]['id'],'ContactId':_0x446d92['id'],'SmsAccountId':_0x3e605f['id'],'phone':_0x1a5038,'firstMsgDirection':_0xce18('0xc1'),'Messages':[_[_0xce18('0x4b')](_0x443764[_0xce18('0x5c')],{'read':![],'body':_0x443764[_0xce18('0x5c')]['body'],'phone':_0x1a5038,'SmsAccountId':_0x3e605f['id'],'UserId':_0x443764[_0xce18('0x5e')]['id'],'ContactId':_0x446d92['id']})]},{'include':[{'model':db[_0xce18('0xa5')],'as':_0xce18('0xc2')}]})[_0xce18('0x22')](function(_0x3d2870){return[_0x3d2870,!![]];});});}})['spread'](function(_0x5e49fd,_0xfd7321){if(_0xfd7321){return _0x5e49fd;}return db['SmsMessage'][_0xce18('0x5b')](_['merge'](_0x443764['body'],{'read':![],'body':_0x443764[_0xce18('0x5c')][_0xce18('0x5c')],'phone':_0x1a5038,'SmsAccountId':_0x3e605f['id'],'SmsInteractionId':_0x5e49fd['id'],'UserId':_0x443764[_0xce18('0x5e')]['id'],'ContactId':_0x446d92['id']}))['then'](function(_0x32db48){_0x5e49fd[_0xce18('0xc3')][_0xce18('0xc2')]=[];_0x5e49fd[_0xce18('0xc3')][_0xce18('0xc2')][_0xce18('0xa1')](_0x32db48[_0xce18('0xc3')]);return _0x5e49fd;});})['then'](respondWithResult(_0x3757a6,null))[_0xce18('0x56')](handleError(_0x3757a6,null));};exports[_0xce18('0x31')]=function(_0x2865aa,_0x234717,_0x2cd5fc){if(_0x2865aa[_0xce18('0x5c')]['id']){delete _0x2865aa['body']['id'];}console[_0xce18('0xc4')](_0xce18('0xc5'),_0x2865aa[_0xce18('0x5c')]);var _0x393647,_0x560c24,_0x22b997;return db[_0xce18('0x3c')][_0xce18('0x5a')]({'where':{'id':_0x2865aa[_0xce18('0x58')]['id']}})[_0xce18('0x22')](handleEntityNotFound(_0x234717,null))[_0xce18('0x22')](function(_0x55cf49){if(_0x55cf49){_0x22b997=_0x55cf49;logger[_0xce18('0x24')](_0xce18('0x25'),_0xce18('0x31'),_0xce18('0xc6'),_0x55cf49[_0xce18('0x4d')],util[_0xce18('0xc7')](_0x2865aa[_0xce18('0x5c')],{'showHidden':![],'depth':null}));switch(_0x55cf49['type']){case _0xce18('0xc8'):if(_0x2865aa[_0xce18('0x5c')][_0xce18('0xc9')]&&_0x2865aa[_0xce18('0x5c')][_0xce18('0x31')]){_0x560c24=_0x2865aa['body'][_0xce18('0x31')];return db[_0xce18('0xa5')][_0xce18('0x5a')]({'where':{'messageId':_0x2865aa[_0xce18('0x5c')][_0xce18('0xc9')]}});}break;case'connectel':if(_0x2865aa[_0xce18('0x5c')][_0xce18('0xca')]&&_0x2865aa[_0xce18('0x5c')][_0xce18('0xcb')]){_0x560c24=_0x2865aa[_0xce18('0x5c')]['statusInt'];return db[_0xce18('0xa5')][_0xce18('0x5a')]({'where':{'messageId':_0x2865aa[_0xce18('0x5c')][_0xce18('0xca')]}});}break;case'clicksend':if(_0x2865aa['body'][_0xce18('0x89')]&&_0x2865aa[_0xce18('0x5c')][_0xce18('0xcc')]){_0x560c24=_0x2865aa[_0xce18('0x5c')]['status_code'];return db['SmsMessage']['find']({'where':{'messageId':_0x2865aa[_0xce18('0x5c')][_0xce18('0x89')]}});}break;case'infobip':var _0x6ed2d8=_0x2865aa[_0xce18('0x5c')][_0xce18('0x8d')][0x0];if(_0x6ed2d8[_0xce18('0x88')]&&_0x6ed2d8[_0xce18('0x31')][_0xce18('0xcd')]==='DELIVERED'){_0x560c24=_0x6ed2d8[_0xce18('0x31')][_0xce18('0xcd')];return db[_0xce18('0xa5')]['find']({'where':{'messageId':_0x6ed2d8[_0xce18('0x88')]}});}break;case _0xce18('0x91'):if(_0x2865aa[_0xce18('0x5c')][_0xce18('0x88')]&&_0x2865aa['body'][_0xce18('0x31')]){_0x560c24=_0x2865aa[_0xce18('0x5c')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x2865aa[_0xce18('0x5c')][_0xce18('0x88')]}});}break;case'intelepeer':if(_0x2865aa[_0xce18('0x5c')][_0xce18('0xce')]&&_0x2865aa[_0xce18('0x5c')][_0xce18('0x31')]){_0x560c24=_0x2865aa[_0xce18('0x5c')][_0xce18('0x31')];return db['SmsMessage']['find']({'where':{'messageId':_0x2865aa['body'][_0xce18('0xce')]}});}break;}}})['then'](handleEntityNotFound(_0x234717,null))['then'](function(_0x59d021){if(_0x59d021){_0x393647=_0x59d021;switch(_0x22b997[_0xce18('0x4d')]){case _0xce18('0xc8'):if(_0x560c24===_0xce18('0xcf')){return _0x393647['update']({'read':!![]});}else{logger[_0xce18('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xce18('0x31'),_0xce18('0xc8'),util[_0xce18('0xc7')](_0x2865aa[_0xce18('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xce18('0x86'):if(_0x560c24==='1'){return _0x393647[_0xce18('0x64')]({'read':!![]});}else{logger['error'](_0xce18('0x25'),_0xce18('0x31'),_0xce18('0xc8'),util['inspect'](_0x2865aa[_0xce18('0x5c')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x2865aa[_0xce18('0x5c')]['error_code']&&_0x560c24>=0xc8&&_0x560c24<=0xce){return _0x393647[_0xce18('0x64')]({'read':!![]});}else{logger[_0xce18('0x27')](_0xce18('0x25'),_0xce18('0x31'),_0xce18('0x87'),util[_0xce18('0xc7')](_0x2865aa[_0xce18('0x5c')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3792d3=_0x2865aa[_0xce18('0x5c')]['results'][0x0];if(_0x3792d3[_0xce18('0x31')][_0xce18('0xcd')]===_0xce18('0xcf')){return _0x393647['update']({'read':!![]});}else{logger[_0xce18('0x27')](_0xce18('0x25'),_0xce18('0x31'),_0xce18('0x8c'),util[_0xce18('0xc7')](_0x2865aa[_0xce18('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xce18('0x91'):if(_0x560c24==_0xce18('0xd0')||_0x560c24==_0xce18('0xd1')){return _0x393647['update']({'read':!![]});}else{logger[_0xce18('0x27')](_0xce18('0x25'),_0xce18('0x31'),_0xce18('0x91'),util[_0xce18('0xc7')](_0x2865aa[_0xce18('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xce18('0x92'):if(_0x560c24==='DELIVRD'||_0x560c24===_0xce18('0xd2')){return _0x393647[_0xce18('0x64')]({'read':!![]});}else{logger['error'](_0xce18('0x25'),'status',_0xce18('0x92'),util[_0xce18('0xc7')](_0x2865aa['body'],{'showHidden':![],'depth':null}));}break;}return _0x393647;}})[_0xce18('0x22')](respondWithResult(_0x234717,null))['catch'](handleError(_0x234717,null));};exports['statusGet']=function(_0xd1beb3,_0x90249c,_0x42e9d9){var _0x671dfe,_0x51cb74,_0x2484f9;return db[_0xce18('0x3c')]['find']({'where':{'id':_0xd1beb3['params']['id']}})['then'](handleEntityNotFound(_0x90249c,null))['then'](function(_0x4992f8){if(_0x4992f8){_0x2484f9=_0x4992f8;logger[_0xce18('0x24')](_0xce18('0x25'),_0xce18('0x31'),_0xce18('0xc6'),_0x4992f8['type'],util[_0xce18('0xc7')](_0xd1beb3[_0xce18('0x3e')],{'showHidden':![],'depth':null}));switch(_0x4992f8[_0xce18('0x4d')]){case _0xce18('0x8e'):if(_0xd1beb3['query']['message-id']&&_0xd1beb3[_0xce18('0x3e')][_0xce18('0xd3')]){_0x51cb74=_0xd1beb3[_0xce18('0x3e')][_0xce18('0xd3')];return db[_0xce18('0xa5')][_0xce18('0x5a')]({'where':{'messageId':_0xd1beb3[_0xce18('0x3e')][_0xce18('0xd4')]}});}break;}}})[_0xce18('0x22')](handleEntityNotFound(_0x90249c,null))['then'](function(_0x142cac){if(_0x142cac){_0x671dfe=_0x142cac;switch(_0x2484f9[_0xce18('0x4d')]){case _0xce18('0x8e'):if(_0x51cb74==='2'||_0x51cb74==='6'){return _0x671dfe['update']({'read':!![]});}else{logger[_0xce18('0x27')](_0xce18('0x25'),_0xce18('0x31'),_0xce18('0x8e'),util[_0xce18('0xc7')](_0xd1beb3[_0xce18('0x3e')],{'showHidden':![],'depth':null}));};break;}return _0x671dfe;}})[_0xce18('0x22')](respondWithResult(_0x90249c,null))[_0xce18('0x56')](handleError(_0x90249c,null));};exports['addAgents']=function(_0x190919,_0x2624ec,_0x18bfcc){return db[_0xce18('0x3c')][_0xce18('0x5a')]({'where':{'id':_0x190919[_0xce18('0x58')]['id']}})[_0xce18('0x22')](handleEntityNotFound(_0x2624ec,null))[_0xce18('0x22')](function(_0x3c4f0d){if(_0x3c4f0d){return _0x3c4f0d[_0xce18('0xd5')](_0x190919[_0xce18('0x5c')][_0xce18('0x6d')],_[_0xce18('0xd6')](_0x190919['body'],[_0xce18('0x6d'),'id'])||{})[_0xce18('0x9e')](function(_0x4cb20b){for(var _0x46e35e=0x0;_0x46e35e<_0x190919[_0xce18('0x5c')][_0xce18('0x6d')][_0xce18('0x6b')];_0x46e35e+=0x1){socket['emit'](_0xce18('0xd7'),{'UserId':_0x190919[_0xce18('0x5c')][_0xce18('0x6d')][_0x46e35e],'SmsAccountId':_0x190919[_0xce18('0x58')]['id']});}return _0x4cb20b;});}})[_0xce18('0x22')](respondWithResult(_0x2624ec,null))[_0xce18('0x56')](handleError(_0x2624ec,null));};exports[_0xce18('0xd8')]=function(_0xc10afa,_0x1dcb49,_0x6c0224){return db[_0xce18('0x3c')]['find']({'where':{'id':_0xc10afa[_0xce18('0x58')]['id']}})[_0xce18('0x22')](handleEntityNotFound(_0x1dcb49,null))[_0xce18('0x22')](function(_0x47aa42){if(_0x47aa42){return _0x47aa42['removeAgents'](_0xc10afa['query'][_0xce18('0x6d')])[_0xce18('0x22')](function(){if(_[_0xce18('0xd9')](_0xc10afa[_0xce18('0x3e')][_0xce18('0x6d')])){for(var _0x5d00bb=0x0;_0x5d00bb<_0xc10afa[_0xce18('0x3e')][_0xce18('0x6d')]['length'];_0x5d00bb+=0x1){socket[_0xce18('0xda')](_0xce18('0xdb'),{'UserId':Number(_0xc10afa[_0xce18('0x3e')][_0xce18('0x6d')][_0x5d00bb]),'SmsAccountId':Number(_0xc10afa['params']['id'])});}}else{socket[_0xce18('0xda')](_0xce18('0xdb'),{'UserId':Number(_0xc10afa['query']['ids']),'SmsAccountId':Number(_0xc10afa[_0xce18('0x58')]['id'])});}});}})[_0xce18('0x22')](respondWithStatusCode(_0x1dcb49,null))[_0xce18('0x56')](handleError(_0x1dcb49,null));};exports[_0xce18('0xdc')]=function(_0x274719,_0xd0ad5a,_0x4fc938){var _0x5bb0ad={};var _0x36fbf6={};var _0x27dae9;var _0x48d2a2;return db[_0xce18('0x3c')][_0xce18('0x6f')]({'where':{'id':_0x274719['params']['id']}})[_0xce18('0x22')](handleEntityNotFound(_0xd0ad5a,null))['then'](function(_0x33bbf8){if(_0x33bbf8){_0x27dae9=_0x33bbf8;_0x36fbf6[_0xce18('0x41')]=_['keys'](db[_0xce18('0xa7')]['rawAttributes']);_0x36fbf6[_0xce18('0x3e')]=_[_0xce18('0x3f')](_0x274719[_0xce18('0x3e')]);_0x36fbf6[_0xce18('0x40')]=_['intersection'](_0x36fbf6[_0xce18('0x41')],_0x36fbf6[_0xce18('0x3e')]);_0x5bb0ad[_0xce18('0x42')]=_[_0xce18('0x43')](_0x36fbf6[_0xce18('0x41')],qs[_0xce18('0x44')](_0x274719['query'][_0xce18('0x44')]));_0x5bb0ad['attributes']=_0x5bb0ad[_0xce18('0x42')][_0xce18('0x6b')]?_0x5bb0ad['attributes']:_0x36fbf6['model'];_0x5bb0ad[_0xce18('0x47')]=qs[_0xce18('0x48')](_0x274719[_0xce18('0x3e')][_0xce18('0x48')]);_0x5bb0ad[_0xce18('0x49')]=qs[_0xce18('0x40')](_['pick'](_0x274719[_0xce18('0x3e')],_0x36fbf6[_0xce18('0x40')]));if(_0x274719[_0xce18('0x3e')]['filter']){_0x5bb0ad['where']=_['merge'](_0x5bb0ad[_0xce18('0x49')],{'$or':_['map'](_0x5bb0ad[_0xce18('0x42')],function(_0x6d2f28){var _0xbb09ca={};_0xbb09ca[_0x6d2f28]={'$like':'%'+_0x274719[_0xce18('0x3e')][_0xce18('0x50')]+'%'};return _0xbb09ca;})});}_0x5bb0ad=_[_0xce18('0x4b')]({},_0x5bb0ad,_0x274719[_0xce18('0x51')]);return _0x27dae9[_0xce18('0xdc')](_0x5bb0ad);}})['then'](function(_0x1eb24f){if(_0x1eb24f){_0x48d2a2=_0x1eb24f[_0xce18('0x6b')];if(!_0x274719['query'][_0xce18('0x45')]('nolimit')){_0x5bb0ad[_0xce18('0x30')]=qs[_0xce18('0x30')](_0x274719[_0xce18('0x3e')][_0xce18('0x30')]);_0x5bb0ad[_0xce18('0x2f')]=qs[_0xce18('0x2f')](_0x274719[_0xce18('0x3e')][_0xce18('0x2f')]);}return _0x27dae9['getAgents'](_0x5bb0ad);}})[_0xce18('0x22')](function(_0xd00bd0){if(_0xd00bd0){return _0xd00bd0?{'count':_0x48d2a2,'rows':_0xd00bd0}:null;}})[_0xce18('0x22')](respondWithResult(_0xd0ad5a,null))[_0xce18('0x56')](handleError(_0xd0ad5a,null));};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js
index 325ccba..77461f6 100644
--- a/server/api/smsAccount/smsAccount.events.js
+++ b/server/api/smsAccount/smsAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x80f6=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xa7c3dc,_0x554be5){var _0x1e9be9=function(_0x4cd2c2){while(--_0x4cd2c2){_0xa7c3dc['push'](_0xa7c3dc['shift']());}};_0x1e9be9(++_0x554be5);}(_0x80f6,0xe9));var _0x680f=function(_0x52b1d2,_0x412824){_0x52b1d2=_0x52b1d2-0x0;var _0x4b2af3=_0x80f6[_0x52b1d2];return _0x4b2af3;};'use strict';var EventEmitter=require(_0x680f('0x0'));var SmsAccount=require(_0x680f('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x680f('0x2')](0x0);var events={'afterCreate':_0x680f('0x3'),'afterUpdate':'update','afterDestroy':_0x680f('0x4')};function emitEvent(_0x18c45d){return function(_0x5d0ca3,_0x1bf131,_0x3f00db){SmsAccountEvents[_0x680f('0x5')](_0x18c45d+':'+_0x5d0ca3['id'],_0x5d0ca3);SmsAccountEvents[_0x680f('0x5')](_0x18c45d,_0x5d0ca3);_0x3f00db(null);};}for(var e in events){if(events[_0x680f('0x6')](e)){var event=events[e];SmsAccount[_0x680f('0x7')](e,emitEvent(event));}}module[_0x680f('0x8')]=SmsAccountEvents;
\ No newline at end of file
+var _0x553c=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsAccount'];(function(_0x32d788,_0xbaa65e){var _0x1b671a=function(_0x1f8ff3){while(--_0x1f8ff3){_0x32d788['push'](_0x32d788['shift']());}};_0x1b671a(++_0xbaa65e);}(_0x553c,0x153));var _0xc553=function(_0x34ebca,_0x4afbd8){_0x34ebca=_0x34ebca-0x0;var _0x617b3d=_0x553c[_0x34ebca];return _0x617b3d;};'use strict';var EventEmitter=require(_0xc553('0x0'));var SmsAccount=require(_0xc553('0x1'))['db'][_0xc553('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc553('0x3'),'afterUpdate':_0xc553('0x4'),'afterDestroy':_0xc553('0x5')};function emitEvent(_0x574744){return function(_0x27543f,_0x4eb751,_0x54169c){SmsAccountEvents['emit'](_0x574744+':'+_0x27543f['id'],_0x27543f);SmsAccountEvents[_0xc553('0x6')](_0x574744,_0x27543f);_0x54169c(null);};}for(var e in events){if(events[_0xc553('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xc553('0x8')]=SmsAccountEvents;
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js
index d3a84f3..09c1c8e 100644
--- a/server/api/smsAccount/smsAccount.model.js
+++ b/server/api/smsAccount/smsAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2d6e=['util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./smsAccount.attributes','exports','define','lodash'];(function(_0x127580,_0x3903ff){var _0x2c7f9c=function(_0x2ade10){while(--_0x2ade10){_0x127580['push'](_0x127580['shift']());}};_0x2c7f9c(++_0x3903ff);}(_0x2d6e,0x13f));var _0xe2d6=function(_0x6876e1,_0x17ea11){_0x6876e1=_0x6876e1-0x0;var _0x4877f5=_0x2d6e[_0x6876e1];return _0x4877f5;};'use strict';var _=require(_0xe2d6('0x0'));var util=require(_0xe2d6('0x1'));var logger=require(_0xe2d6('0x2'))('api');var moment=require(_0xe2d6('0x3'));var BPromise=require(_0xe2d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe2d6('0x5'));var config=require(_0xe2d6('0x6'));var attributes=require(_0xe2d6('0x7'));module[_0xe2d6('0x8')]=function(_0x28c934,_0x869733){return _0x28c934[_0xe2d6('0x9')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5179=['define','SmsAccount','sms_accounts','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./smsAccount.attributes','exports'];(function(_0x9d46cf,_0x5237db){var _0x58d3ae=function(_0x4c97f3){while(--_0x4c97f3){_0x9d46cf['push'](_0x9d46cf['shift']());}};_0x58d3ae(++_0x5237db);}(_0x5179,0xf3));var _0x9517=function(_0x5401ae,_0x5e58ac){_0x5401ae=_0x5401ae-0x0;var _0x286068=_0x5179[_0x5401ae];return _0x286068;};'use strict';var _=require(_0x9517('0x0'));var util=require(_0x9517('0x1'));var logger=require('../../config/logger')(_0x9517('0x2'));var moment=require(_0x9517('0x3'));var BPromise=require(_0x9517('0x4'));var rp=require(_0x9517('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9517('0x6'));var attributes=require(_0x9517('0x7'));module[_0x9517('0x8')]=function(_0x59a81b,_0x59d4dc){return _0x59a81b[_0x9517('0x9')](_0x9517('0xa'),attributes,{'tableName':_0x9517('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js
index 6791873..5a698f4 100644
--- a/server/api/smsAccount/smsAccount.rpc.js
+++ b/server/api/smsAccount/smsAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca65=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsAccount.socket','register','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','debug','lodash','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca65,0x6a));var _0x5ca6=function(_0x690915,_0xa6d93){_0x690915=_0x690915-0x0;var _0x1f6047=_0xca65[_0x690915];return _0x1f6047;};'use strict';var _=require(_0x5ca6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5ca6('0x1'));var fs=require('fs');var Redis=require(_0x5ca6('0x2'));var db=require(_0x5ca6('0x3'))['db'];var utils=require(_0x5ca6('0x4'));var logger=require('../../config/logger')(_0x5ca6('0x5'));var config=require(_0x5ca6('0x6'));var jayson=require(_0x5ca6('0x7'));var client=jayson[_0x5ca6('0x8')][_0x5ca6('0x9')]({'port':0x232a});config[_0x5ca6('0xa')]=_['defaults'](config[_0x5ca6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ca6('0xb'))(new Redis(config[_0x5ca6('0xa')]));require(_0x5ca6('0xc'))[_0x5ca6('0xd')](socket);function respondWithRpcPromise(_0x36332d,_0x211fbc,_0x4d6190){return new BPromise(function(_0x3cbc45,_0x2e6424){return client['request'](_0x36332d,_0x4d6190)[_0x5ca6('0xe')](function(_0x397591){logger[_0x5ca6('0xf')]('SmsAccount,\x20%s,\x20%s',_0x211fbc,_0x5ca6('0x10'));logger['debug'](_0x5ca6('0x11'),_0x211fbc,_0x5ca6('0x10'),JSON[_0x5ca6('0x12')](_0x397591));if(_0x397591[_0x5ca6('0x13')]){if(_0x397591['error'][_0x5ca6('0x14')]===0x1f4){logger['error'](_0x5ca6('0x15'),_0x211fbc,_0x397591[_0x5ca6('0x13')]['message']);return _0x2e6424(_0x397591[_0x5ca6('0x13')][_0x5ca6('0x16')]);}logger['error'](_0x5ca6('0x15'),_0x211fbc,_0x397591[_0x5ca6('0x13')]['message']);return _0x3cbc45(_0x397591[_0x5ca6('0x13')][_0x5ca6('0x16')]);}else{logger[_0x5ca6('0xf')](_0x5ca6('0x15'),_0x211fbc,'request\x20sent');_0x3cbc45(_0x397591[_0x5ca6('0x17')]['message']);}})[_0x5ca6('0x18')](function(_0x325899){logger[_0x5ca6('0x13')](_0x5ca6('0x15'),_0x211fbc,_0x325899);_0x2e6424(_0x325899);});});}exports['ShowSmsAccount']=function(_0x45184c){var _0xd151d7=this;return new Promise(function(_0x58942,_0x2337b3){return db[_0x5ca6('0x19')][_0x5ca6('0x1a')]({'raw':_0x45184c[_0x5ca6('0x1b')]?_0x45184c[_0x5ca6('0x1b')][_0x5ca6('0x1c')]===undefined?!![]:![]:!![],'where':_0x45184c['options']?_0x45184c[_0x5ca6('0x1b')][_0x5ca6('0x1d')]||null:null,'attributes':_0x45184c[_0x5ca6('0x1b')]?_0x45184c[_0x5ca6('0x1b')][_0x5ca6('0x1e')]||null:null,'include':_0x45184c[_0x5ca6('0x1b')]?_0x45184c['options'][_0x5ca6('0x1f')]?_[_0x5ca6('0x20')](_0x45184c[_0x5ca6('0x1b')]['include'],function(_0x5b15a1){return{'model':db[_0x5b15a1[_0x5ca6('0x21')]],'as':_0x5b15a1['as'],'attributes':_0x5b15a1[_0x5ca6('0x1e')],'include':_0x5b15a1[_0x5ca6('0x1f')]?_['map'](_0x5b15a1[_0x5ca6('0x1f')],function(_0x144b79){return{'model':db[_0x144b79[_0x5ca6('0x21')]],'as':_0x144b79['as'],'attributes':_0x144b79[_0x5ca6('0x1e')],'include':_0x144b79[_0x5ca6('0x1f')]?_[_0x5ca6('0x20')](_0x144b79[_0x5ca6('0x1f')],function(_0xa1924d){return{'model':db[_0xa1924d[_0x5ca6('0x21')]],'as':_0xa1924d['as'],'attributes':_0xa1924d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ca6('0xe')](function(_0x5c0b1d){logger[_0x5ca6('0xf')](_0x5ca6('0x22'),_0x45184c);logger[_0x5ca6('0x23')](_0x5ca6('0x22'),_0x45184c,JSON[_0x5ca6('0x12')](_0x5c0b1d));_0x58942(_0x5c0b1d);})['catch'](function(_0x44be89){logger[_0x5ca6('0x13')](_0x5ca6('0x22'),_0x44be89[_0x5ca6('0x16')],_0x45184c);_0x2337b3(_0xd151d7[_0x5ca6('0x13')](0x1f4,_0x44be89['message']));});});};
\ No newline at end of file
+var _0x48ce=['include','model','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','find','options','raw','map'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x48ce,0x15a));var _0xe48c=function(_0x221cbe,_0x14920d){_0x221cbe=_0x221cbe-0x0;var _0x3ab3a8=_0x48ce[_0x221cbe];return _0x3ab3a8;};'use strict';var _=require(_0xe48c('0x0'));var util=require(_0xe48c('0x1'));var moment=require(_0xe48c('0x2'));var BPromise=require(_0xe48c('0x3'));var rs=require(_0xe48c('0x4'));var fs=require('fs');var Redis=require(_0xe48c('0x5'));var db=require(_0xe48c('0x6'))['db'];var utils=require(_0xe48c('0x7'));var logger=require(_0xe48c('0x8'))(_0xe48c('0x9'));var config=require(_0xe48c('0xa'));var jayson=require(_0xe48c('0xb'));var client=jayson[_0xe48c('0xc')]['http']({'port':0x232a});config[_0xe48c('0xd')]=_[_0xe48c('0xe')](config['redis'],{'host':_0xe48c('0xf'),'port':0x18eb});var socket=require(_0xe48c('0x10'))(new Redis(config['redis']));require(_0xe48c('0x11'))[_0xe48c('0x12')](socket);function respondWithRpcPromise(_0x838745,_0xfe1b04,_0x180528){return new BPromise(function(_0x4ca543,_0x12972f){return client['request'](_0x838745,_0x180528)[_0xe48c('0x13')](function(_0x295222){logger[_0xe48c('0x14')](_0xe48c('0x15'),_0xfe1b04,_0xe48c('0x16'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfe1b04,_0xe48c('0x16'),JSON[_0xe48c('0x17')](_0x295222));if(_0x295222[_0xe48c('0x18')]){if(_0x295222[_0xe48c('0x18')][_0xe48c('0x19')]===0x1f4){logger['error'](_0xe48c('0x15'),_0xfe1b04,_0x295222[_0xe48c('0x18')]['message']);return _0x12972f(_0x295222[_0xe48c('0x18')]['message']);}logger[_0xe48c('0x18')](_0xe48c('0x15'),_0xfe1b04,_0x295222[_0xe48c('0x18')][_0xe48c('0x1a')]);return _0x4ca543(_0x295222[_0xe48c('0x18')][_0xe48c('0x1a')]);}else{logger[_0xe48c('0x14')](_0xe48c('0x15'),_0xfe1b04,'request\x20sent');_0x4ca543(_0x295222[_0xe48c('0x1b')][_0xe48c('0x1a')]);}})[_0xe48c('0x1c')](function(_0x37af8e){logger[_0xe48c('0x18')](_0xe48c('0x15'),_0xfe1b04,_0x37af8e);_0x12972f(_0x37af8e);});});}exports[_0xe48c('0x1d')]=function(_0x43aae6){var _0x56bb88=this;return new Promise(function(_0x39e486,_0x2bd96e){return db['SmsAccount'][_0xe48c('0x1e')]({'raw':_0x43aae6[_0xe48c('0x1f')]?_0x43aae6['options'][_0xe48c('0x20')]===undefined?!![]:![]:!![],'where':_0x43aae6[_0xe48c('0x1f')]?_0x43aae6[_0xe48c('0x1f')]['where']||null:null,'attributes':_0x43aae6['options']?_0x43aae6['options']['attributes']||null:null,'include':_0x43aae6['options']?_0x43aae6[_0xe48c('0x1f')]['include']?_[_0xe48c('0x21')](_0x43aae6[_0xe48c('0x1f')][_0xe48c('0x22')],function(_0x358eec){return{'model':db[_0x358eec[_0xe48c('0x23')]],'as':_0x358eec['as'],'attributes':_0x358eec[_0xe48c('0x24')],'include':_0x358eec[_0xe48c('0x22')]?_['map'](_0x358eec[_0xe48c('0x22')],function(_0x21934b){return{'model':db[_0x21934b[_0xe48c('0x23')]],'as':_0x21934b['as'],'attributes':_0x21934b['attributes'],'include':_0x21934b[_0xe48c('0x22')]?_[_0xe48c('0x21')](_0x21934b[_0xe48c('0x22')],function(_0x459557){return{'model':db[_0x459557[_0xe48c('0x23')]],'as':_0x459557['as'],'attributes':_0x459557[_0xe48c('0x24')]};}):[]};}):[]};}):[]:[]})[_0xe48c('0x13')](function(_0x2bb4c4){logger[_0xe48c('0x14')](_0xe48c('0x1d'),_0x43aae6);logger[_0xe48c('0x25')](_0xe48c('0x1d'),_0x43aae6,JSON[_0xe48c('0x17')](_0x2bb4c4));_0x39e486(_0x2bb4c4);})[_0xe48c('0x1c')](function(_0x2ac001){logger[_0xe48c('0x18')](_0xe48c('0x1d'),_0x2ac001[_0xe48c('0x1a')],_0x43aae6);_0x2bd96e(_0x56bb88[_0xe48c('0x18')](0x1f4,_0x2ac001[_0xe48c('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js
index a349836..60dc7a4 100644
--- a/server/api/smsAccount/smsAccount.socket.js
+++ b/server/api/smsAccount/smsAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x38b6=['emit','register','./smsAccount.events','save','remove','update'];(function(_0x2da111,_0x3e3fc7){var _0xafc70=function(_0x1e52e0){while(--_0x1e52e0){_0x2da111['push'](_0x2da111['shift']());}};_0xafc70(++_0x3e3fc7);}(_0x38b6,0x116));var _0x638b=function(_0x457e90,_0x7098cb){_0x457e90=_0x457e90-0x0;var _0x960f26=_0x38b6[_0x457e90];return _0x960f26;};'use strict';var SmsAccountEvents=require(_0x638b('0x0'));var events=[_0x638b('0x1'),_0x638b('0x2'),_0x638b('0x3')];function createListener(_0x3c8fee,_0x4b35eb){return function(_0x511534){_0x4b35eb[_0x638b('0x4')](_0x3c8fee,_0x511534);};}function removeListener(_0x3847d9,_0x28a707){return function(){SmsAccountEvents['removeListener'](_0x3847d9,_0x28a707);};}exports[_0x638b('0x5')]=function(_0x4fa0a1){for(var _0x28def8=0x0,_0x56604f=events['length'];_0x28def8<_0x56604f;_0x28def8++){var _0x29ce95=events[_0x28def8];var _0x45b72b=createListener('smsAccount:'+_0x29ce95,_0x4fa0a1);SmsAccountEvents['on'](_0x29ce95,_0x45b72b);}};
\ No newline at end of file
+var _0x5758=['register','length','smsAccount:','update','emit','removeListener'];(function(_0x55daf2,_0x1b48de){var _0x1c8500=function(_0x4686b5){while(--_0x4686b5){_0x55daf2['push'](_0x55daf2['shift']());}};_0x1c8500(++_0x1b48de);}(_0x5758,0x1e3));var _0x8575=function(_0x37b2ac,_0x21ad06){_0x37b2ac=_0x37b2ac-0x0;var _0x502638=_0x5758[_0x37b2ac];return _0x502638;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=['save','remove',_0x8575('0x0')];function createListener(_0x282fe0,_0x17e5d9){return function(_0xe70bb7){_0x17e5d9[_0x8575('0x1')](_0x282fe0,_0xe70bb7);};}function removeListener(_0x171d1a,_0x309a07){return function(){SmsAccountEvents[_0x8575('0x2')](_0x171d1a,_0x309a07);};}exports[_0x8575('0x3')]=function(_0x289736){for(var _0x26afc3=0x0,_0x1f819d=events[_0x8575('0x4')];_0x26afc3<_0x1f819d;_0x26afc3++){var _0x111452=events[_0x26afc3];var _0x5aedb1=createListener(_0x8575('0x5')+_0x111452,_0x289736);SmsAccountEvents['on'](_0x111452,_0x5aedb1);}};
\ No newline at end of file
diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js
index 02f4b1f..0e6737b 100644
--- a/server/api/smsApplication/index.js
+++ b/server/api/smsApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x88b2=['isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./smsApplication.controller'];(function(_0x5b73ff,_0x1cba4d){var _0x1c4ba4=function(_0x319db1){while(--_0x319db1){_0x5b73ff['push'](_0x5b73ff['shift']());}};_0x1c4ba4(++_0x1cba4d);}(_0x88b2,0x1df));var _0x288b=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x88b2[_0x2e2681];return _0x368a64;};'use strict';var multer=require(_0x288b('0x0'));var util=require(_0x288b('0x1'));var path=require(_0x288b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x288b('0x3')]();var auth=require(_0x288b('0x4'));var interaction=require(_0x288b('0x5'));var config=require('../../config/environment');var controller=require(_0x288b('0x6'));router['get']('/',auth[_0x288b('0x7')](),controller[_0x288b('0x8')]);router[_0x288b('0x9')]('/:id',auth[_0x288b('0x7')](),controller[_0x288b('0xa')]);router[_0x288b('0xb')]('/',auth[_0x288b('0x7')](),controller['create']);router[_0x288b('0xc')](_0x288b('0xd'),auth[_0x288b('0x7')](),controller[_0x288b('0xe')]);router[_0x288b('0xf')](_0x288b('0xd'),auth['isAuthenticated'](),controller[_0x288b('0x10')]);module[_0x288b('0x11')]=router;
\ No newline at end of file
+var _0xf033=['get','index','post','put','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xf033,0x8e));var _0x3f03=function(_0x424900,_0x5565b8){_0x424900=_0x424900-0x0;var _0x32968d=_0xf033[_0x424900];return _0x32968d;};'use strict';var multer=require(_0x3f03('0x0'));var util=require(_0x3f03('0x1'));var path=require(_0x3f03('0x2'));var timeout=require(_0x3f03('0x3'));var express=require(_0x3f03('0x4'));var router=express[_0x3f03('0x5')]();var auth=require(_0x3f03('0x6'));var interaction=require(_0x3f03('0x7'));var config=require(_0x3f03('0x8'));var controller=require(_0x3f03('0x9'));router[_0x3f03('0xa')]('/',auth['isAuthenticated'](),controller[_0x3f03('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3f03('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3f03('0xd')](_0x3f03('0xe'),auth[_0x3f03('0xf')](),controller[_0x3f03('0x10')]);router['delete'](_0x3f03('0xe'),auth[_0x3f03('0xf')](),controller[_0x3f03('0x11')]);module[_0x3f03('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js
index 4e495e2..b6ce1bb 100644
--- a/server/api/smsApplication/smsApplication.attributes.js
+++ b/server/api/smsApplication/smsApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfbc5=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x45192c,_0x53519d){var _0x5c3816=function(_0x113cdc){while(--_0x113cdc){_0x45192c['push'](_0x45192c['shift']());}};_0x5c3816(++_0x53519d);}(_0xfbc5,0x1ab));var _0x5fbc=function(_0x5ec407,_0x392526){_0x5ec407=_0x5ec407-0x0;var _0x5d1dd5=_0xfbc5[_0x5ec407];return _0x5d1dd5;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x5fbc('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x5fbc('0x1')],'allowNull':![],'defaultValue':_0x5fbc('0x2')},'appdata':{'type':Sequelize[_0x5fbc('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5fbc('0x1')],'defaultValue':_0x5fbc('0x4')}};
\ No newline at end of file
+var _0xaf97=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x37c350,_0x25a7cd){var _0x3007eb=function(_0x171308){while(--_0x171308){_0x37c350['push'](_0x37c350['shift']());}};_0x3007eb(++_0x25a7cd);}(_0xaf97,0x15a));var _0x7af9=function(_0x3217a5,_0x646a1b){_0x3217a5=_0x3217a5-0x0;var _0x3e275c=_0xaf97[_0x3217a5];return _0x3e275c;};'use strict';var Sequelize=require(_0x7af9('0x0'));module[_0x7af9('0x1')]={'priority':{'type':Sequelize[_0x7af9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7af9('0x3')],'allowNull':![],'defaultValue':_0x7af9('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7af9('0x3')]},'interval':{'type':Sequelize[_0x7af9('0x3')],'defaultValue':_0x7af9('0x5')}};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js
index f1eff67..d27e957 100644
--- a/server/api/smsApplication/smsApplication.controller.js
+++ b/server/api/smsApplication/smsApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd3f3=['limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','SmsApplication','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','field','options','includeAll','include','findAll','params','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset'];(function(_0x95b2a1,_0x2b4e22){var _0x1c1f23=function(_0x4f6322){while(--_0x4f6322){_0x95b2a1['push'](_0x95b2a1['shift']());}};_0x1c1f23(++_0x2b4e22);}(_0xd3f3,0x72));var _0x3d3f=function(_0x2bad97,_0x14832c){_0x2bad97=_0x2bad97-0x0;var _0xa7ec73=_0xd3f3[_0x2bad97];return _0xa7ec73;};'use strict';var pdf=require(_0x3d3f('0x0'));var emlformat=require(_0x3d3f('0x1'));var rimraf=require(_0x3d3f('0x2'));var zipdir=require(_0x3d3f('0x3'));var jsonpatch=require(_0x3d3f('0x4'));var rp=require(_0x3d3f('0x5'));var moment=require('moment');var BPromise=require(_0x3d3f('0x6'));var Mustache=require(_0x3d3f('0x7'));var util=require(_0x3d3f('0x8'));var path=require('path');var sox=require(_0x3d3f('0x9'));var csv=require('to-csv');var ejs=require(_0x3d3f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3d3f('0xb'));var crypto=require('crypto');var jsforce=require(_0x3d3f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3d3f('0xd'));var querystring=require(_0x3d3f('0xe'));var Papa=require(_0x3d3f('0xf'));var Redis=require(_0x3d3f('0x10'));var authService=require(_0x3d3f('0x11'));var qs=require(_0x3d3f('0x12'));var hardwareService=require(_0x3d3f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3d3f('0x14'));var config=require(_0x3d3f('0x15'));var db=require(_0x3d3f('0x16'))['db'];function respondWithStatusCode(_0x30f6ce,_0x412144){_0x412144=_0x412144||0xcc;return function(_0x13bb47){if(_0x13bb47){return _0x30f6ce[_0x3d3f('0x17')](_0x412144);}return _0x30f6ce[_0x3d3f('0x18')](_0x412144)['end']();};}function respondWithResult(_0x551bda,_0x13a203){_0x13a203=_0x13a203||0xc8;return function(_0x2a19e9){if(_0x2a19e9){return _0x551bda[_0x3d3f('0x18')](_0x13a203)[_0x3d3f('0x19')](_0x2a19e9);}};}function respondWithFilteredResult(_0x408218,_0xb518f){return function(_0x27894e){if(_0x27894e){var _0x5a121f=_0x27894e[_0x3d3f('0x1a')],_0x1f6732=_0xb518f[_0x3d3f('0x1b')],_0x57b1ad=_0xb518f[_0x3d3f('0x1b')]+_0xb518f[_0x3d3f('0x1c')],_0x45b75b;if(_0x57b1ad>=_0x5a121f){_0x57b1ad=_0x5a121f;_0x45b75b=0xc8;}else{_0x45b75b=0xce;}_0x408218[_0x3d3f('0x18')](_0x45b75b);return _0x408218[_0x3d3f('0x1d')](_0x3d3f('0x1e'),_0x1f6732+'-'+_0x57b1ad+'/'+_0x5a121f)[_0x3d3f('0x19')](_0x27894e);}return null;};}function patchUpdates(_0x51c01f){return function(_0x5054c1){try{jsonpatch[_0x3d3f('0x1f')](_0x5054c1,_0x51c01f,!![]);}catch(_0x39894c){return BPromise[_0x3d3f('0x20')](_0x39894c);}return _0x5054c1[_0x3d3f('0x21')]();};}function saveUpdates(_0x4288c2,_0x132dfa){return function(_0x37eefd){if(_0x37eefd){return _0x37eefd[_0x3d3f('0x22')](_0x4288c2)[_0x3d3f('0x23')](function(_0x365795){return _0x365795;});}return null;};}function removeEntity(_0x11c817,_0x2cc404){return function(_0x46d818){if(_0x46d818){return _0x46d818[_0x3d3f('0x24')]()[_0x3d3f('0x23')](function(){_0x11c817[_0x3d3f('0x18')](0xcc)[_0x3d3f('0x25')]();});}};}function handleEntityNotFound(_0x4ba69,_0x7df3ef){return function(_0x5cbb49){if(!_0x5cbb49){_0x4ba69[_0x3d3f('0x17')](0x194);}return _0x5cbb49;};}function handleError(_0x235ec7,_0x35bb29){_0x35bb29=_0x35bb29||0x1f4;return function(_0x564919){logger['error'](_0x564919['stack']);if(_0x564919[_0x3d3f('0x26')]){delete _0x564919[_0x3d3f('0x26')];}_0x235ec7[_0x3d3f('0x18')](_0x35bb29)[_0x3d3f('0x27')](_0x564919);};}exports[_0x3d3f('0x28')]=function(_0x385490,_0x505814){var _0x2eb91c={},_0x1b8702={},_0x2d8233={'count':0x0,'rows':[]};var _0x5161f3=db[_0x3d3f('0x29')][_0x3d3f('0x2a')];_0x1b8702[_0x3d3f('0x2b')]=_['keys'](_0x5161f3);_0x1b8702[_0x3d3f('0x2c')]=_[_0x3d3f('0x2d')](_0x385490[_0x3d3f('0x2c')]);_0x1b8702[_0x3d3f('0x2e')]=_[_0x3d3f('0x2f')](_0x1b8702[_0x3d3f('0x2b')],_0x1b8702[_0x3d3f('0x2c')]);_0x2eb91c[_0x3d3f('0x30')]=_[_0x3d3f('0x2f')](_0x1b8702[_0x3d3f('0x2b')],qs[_0x3d3f('0x31')](_0x385490['query'][_0x3d3f('0x31')]));_0x2eb91c[_0x3d3f('0x30')]=_0x2eb91c[_0x3d3f('0x30')][_0x3d3f('0x32')]?_0x2eb91c[_0x3d3f('0x30')]:_0x1b8702[_0x3d3f('0x2b')];if(!_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x33')](_0x3d3f('0x34'))){_0x2eb91c[_0x3d3f('0x1c')]=qs[_0x3d3f('0x1c')](_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x1c')]);_0x2eb91c[_0x3d3f('0x1b')]=qs[_0x3d3f('0x1b')](_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x1b')]);}_0x2eb91c[_0x3d3f('0x35')]=qs[_0x3d3f('0x36')](_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x36')]);_0x2eb91c['where']=qs[_0x3d3f('0x2e')](_[_0x3d3f('0x37')](_0x385490[_0x3d3f('0x2c')],_0x1b8702[_0x3d3f('0x2e')]));if(_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x38')]){_0x2eb91c[_0x3d3f('0x39')]=_[_0x3d3f('0x3a')](_0x2eb91c[_0x3d3f('0x39')],{'$or':_[_0x3d3f('0x3b')](_0x5161f3,function(_0x1ff9e1){if(_0x1ff9e1['type']['key']!==_0x3d3f('0x3c')){var _0x3a7879={};_0x3a7879[_0x1ff9e1[_0x3d3f('0x3d')]]={'$like':'%'+_0x385490[_0x3d3f('0x2c')]['filter']+'%'};return _0x3a7879;}})});}_0x2eb91c=_['merge']({},_0x2eb91c,_0x385490[_0x3d3f('0x3e')]);var _0xdc03d9={'where':_0x2eb91c['where']};return db['SmsApplication'][_0x3d3f('0x1a')](_0xdc03d9)[_0x3d3f('0x23')](function(_0x4cdb8d){_0x2d8233[_0x3d3f('0x1a')]=_0x4cdb8d;if(_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x3f')]){_0x2eb91c[_0x3d3f('0x40')]=[{'all':!![]}];}return db[_0x3d3f('0x29')][_0x3d3f('0x41')](_0x2eb91c);})[_0x3d3f('0x23')](function(_0x496eda){_0x2d8233['rows']=_0x496eda;return _0x2d8233;})[_0x3d3f('0x23')](respondWithFilteredResult(_0x505814,_0x2eb91c))['catch'](handleError(_0x505814,null));};exports['show']=function(_0x4cbfce,_0x3ae97d){var _0x217cf8={'raw':!![],'where':{'id':_0x4cbfce[_0x3d3f('0x42')]['id']}},_0x51a3ca={};_0x51a3ca['model']=_['keys'](db[_0x3d3f('0x29')][_0x3d3f('0x2a')]);_0x51a3ca[_0x3d3f('0x2c')]=_['keys'](_0x4cbfce[_0x3d3f('0x2c')]);_0x51a3ca['filters']=_['intersection'](_0x51a3ca[_0x3d3f('0x2b')],_0x51a3ca['query']);_0x217cf8[_0x3d3f('0x30')]=_[_0x3d3f('0x2f')](_0x51a3ca[_0x3d3f('0x2b')],qs['fields'](_0x4cbfce['query'][_0x3d3f('0x31')]));_0x217cf8['attributes']=_0x217cf8[_0x3d3f('0x30')]['length']?_0x217cf8['attributes']:_0x51a3ca[_0x3d3f('0x2b')];if(_0x4cbfce[_0x3d3f('0x2c')][_0x3d3f('0x3f')]){_0x217cf8[_0x3d3f('0x40')]=[{'all':!![]}];}_0x217cf8=_[_0x3d3f('0x3a')]({},_0x217cf8,_0x4cbfce[_0x3d3f('0x3e')]);return db['SmsApplication'][_0x3d3f('0x43')](_0x217cf8)['then'](handleEntityNotFound(_0x3ae97d,null))[_0x3d3f('0x23')](respondWithResult(_0x3ae97d,null))[_0x3d3f('0x44')](handleError(_0x3ae97d,null));};exports[_0x3d3f('0x45')]=function(_0x311775,_0x102976){return db[_0x3d3f('0x29')][_0x3d3f('0x45')](_0x311775[_0x3d3f('0x46')],{})[_0x3d3f('0x23')](respondWithResult(_0x102976,0xc9))[_0x3d3f('0x44')](handleError(_0x102976,null));};exports[_0x3d3f('0x22')]=function(_0x1fdc5a,_0x77351e){if(_0x1fdc5a[_0x3d3f('0x46')]['id']){delete _0x1fdc5a['body']['id'];}return db[_0x3d3f('0x29')]['find']({'where':{'id':_0x1fdc5a[_0x3d3f('0x42')]['id']}})[_0x3d3f('0x23')](handleEntityNotFound(_0x77351e,null))[_0x3d3f('0x23')](saveUpdates(_0x1fdc5a[_0x3d3f('0x46')],null))['then'](respondWithResult(_0x77351e,null))[_0x3d3f('0x44')](handleError(_0x77351e,null));};exports['destroy']=function(_0x2584d1,_0x49f656){return db['SmsApplication'][_0x3d3f('0x43')]({'where':{'id':_0x2584d1[_0x3d3f('0x42')]['id']}})[_0x3d3f('0x23')](handleEntityNotFound(_0x49f656,null))['then'](removeEntity(_0x49f656,null))[_0x3d3f('0x44')](handleError(_0x49f656,null));};
\ No newline at end of file
+var _0x78f9=['reject','update','then','destroy','error','stack','name','send','index','SmsApplication','rawAttributes','model','keys','query','filters','fields','attributes','length','nolimit','offset','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','json','apply'];(function(_0x1b70f7,_0x45f311){var _0x1c5189=function(_0x21f37c){while(--_0x21f37c){_0x1b70f7['push'](_0x1b70f7['shift']());}};_0x1c5189(++_0x45f311);}(_0x78f9,0x14f));var _0x978f=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x78f9[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0x978f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x978f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x978f('0x2'));var rp=require('request-promise');var moment=require(_0x978f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x978f('0x4'));var util=require(_0x978f('0x5'));var path=require(_0x978f('0x6'));var sox=require(_0x978f('0x7'));var csv=require(_0x978f('0x8'));var ejs=require(_0x978f('0x9'));var fs=require('fs');var _=require(_0x978f('0xa'));var squel=require('squel');var crypto=require(_0x978f('0xb'));var jsforce=require(_0x978f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x978f('0x8'));var querystring=require(_0x978f('0xd'));var Papa=require(_0x978f('0xe'));var Redis=require(_0x978f('0xf'));var authService=require(_0x978f('0x10'));var qs=require(_0x978f('0x11'));var hardwareService=require(_0x978f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x978f('0x13'));var config=require(_0x978f('0x14'));var db=require(_0x978f('0x15'))['db'];function respondWithStatusCode(_0x3beb60,_0x2b0ed7){_0x2b0ed7=_0x2b0ed7||0xcc;return function(_0x383959){if(_0x383959){return _0x3beb60[_0x978f('0x16')](_0x2b0ed7);}return _0x3beb60[_0x978f('0x17')](_0x2b0ed7)[_0x978f('0x18')]();};}function respondWithResult(_0x569168,_0x3ea0b5){_0x3ea0b5=_0x3ea0b5||0xc8;return function(_0x50157a){if(_0x50157a){return _0x569168[_0x978f('0x17')](_0x3ea0b5)['json'](_0x50157a);}};}function respondWithFilteredResult(_0x1a3fe8,_0x53a2b7){return function(_0x19f9ea){if(_0x19f9ea){var _0x911a92=_0x19f9ea[_0x978f('0x19')],_0x3787d8=_0x53a2b7['offset'],_0x35fd1f=_0x53a2b7['offset']+_0x53a2b7[_0x978f('0x1a')],_0x2223a5;if(_0x35fd1f>=_0x911a92){_0x35fd1f=_0x911a92;_0x2223a5=0xc8;}else{_0x2223a5=0xce;}_0x1a3fe8[_0x978f('0x17')](_0x2223a5);return _0x1a3fe8[_0x978f('0x1b')]('Content-Range',_0x3787d8+'-'+_0x35fd1f+'/'+_0x911a92)[_0x978f('0x1c')](_0x19f9ea);}return null;};}function patchUpdates(_0x175c14){return function(_0x23d7f6){try{jsonpatch[_0x978f('0x1d')](_0x23d7f6,_0x175c14,!![]);}catch(_0x45e76d){return BPromise[_0x978f('0x1e')](_0x45e76d);}return _0x23d7f6['save']();};}function saveUpdates(_0x21aa34,_0x1823ca){return function(_0x52c0a9){if(_0x52c0a9){return _0x52c0a9[_0x978f('0x1f')](_0x21aa34)[_0x978f('0x20')](function(_0x3b47a2){return _0x3b47a2;});}return null;};}function removeEntity(_0x13cc41,_0x529daf){return function(_0x4b9c5d){if(_0x4b9c5d){return _0x4b9c5d[_0x978f('0x21')]()['then'](function(){_0x13cc41['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7043a0,_0x2c01fa){return function(_0x1fb16b){if(!_0x1fb16b){_0x7043a0[_0x978f('0x16')](0x194);}return _0x1fb16b;};}function handleError(_0x22e604,_0xb27147){_0xb27147=_0xb27147||0x1f4;return function(_0x2f39ba){logger[_0x978f('0x22')](_0x2f39ba[_0x978f('0x23')]);if(_0x2f39ba['name']){delete _0x2f39ba[_0x978f('0x24')];}_0x22e604[_0x978f('0x17')](_0xb27147)[_0x978f('0x25')](_0x2f39ba);};}exports[_0x978f('0x26')]=function(_0x5755f2,_0x1c0be5){var _0x48f5e6={},_0x3f59bc={},_0x38aec5={'count':0x0,'rows':[]};var _0x2a3a2a=db[_0x978f('0x27')][_0x978f('0x28')];_0x3f59bc[_0x978f('0x29')]=_[_0x978f('0x2a')](_0x2a3a2a);_0x3f59bc['query']=_[_0x978f('0x2a')](_0x5755f2[_0x978f('0x2b')]);_0x3f59bc[_0x978f('0x2c')]=_['intersection'](_0x3f59bc[_0x978f('0x29')],_0x3f59bc['query']);_0x48f5e6['attributes']=_['intersection'](_0x3f59bc[_0x978f('0x29')],qs[_0x978f('0x2d')](_0x5755f2[_0x978f('0x2b')][_0x978f('0x2d')]));_0x48f5e6['attributes']=_0x48f5e6[_0x978f('0x2e')][_0x978f('0x2f')]?_0x48f5e6[_0x978f('0x2e')]:_0x3f59bc[_0x978f('0x29')];if(!_0x5755f2[_0x978f('0x2b')]['hasOwnProperty'](_0x978f('0x30'))){_0x48f5e6[_0x978f('0x1a')]=qs[_0x978f('0x1a')](_0x5755f2[_0x978f('0x2b')][_0x978f('0x1a')]);_0x48f5e6['offset']=qs[_0x978f('0x31')](_0x5755f2[_0x978f('0x2b')][_0x978f('0x31')]);}_0x48f5e6[_0x978f('0x32')]=qs[_0x978f('0x33')](_0x5755f2[_0x978f('0x2b')][_0x978f('0x33')]);_0x48f5e6[_0x978f('0x34')]=qs['filters'](_[_0x978f('0x35')](_0x5755f2[_0x978f('0x2b')],_0x3f59bc[_0x978f('0x2c')]));if(_0x5755f2[_0x978f('0x2b')]['filter']){_0x48f5e6[_0x978f('0x34')]=_[_0x978f('0x36')](_0x48f5e6['where'],{'$or':_[_0x978f('0x37')](_0x2a3a2a,function(_0x996c07){if(_0x996c07[_0x978f('0x38')][_0x978f('0x39')]!==_0x978f('0x3a')){var _0x422988={};_0x422988[_0x996c07[_0x978f('0x3b')]]={'$like':'%'+_0x5755f2[_0x978f('0x2b')][_0x978f('0x3c')]+'%'};return _0x422988;}})});}_0x48f5e6=_[_0x978f('0x36')]({},_0x48f5e6,_0x5755f2[_0x978f('0x3d')]);var _0xdb5dec={'where':_0x48f5e6[_0x978f('0x34')]};return db[_0x978f('0x27')][_0x978f('0x19')](_0xdb5dec)['then'](function(_0x14d81e){_0x38aec5[_0x978f('0x19')]=_0x14d81e;if(_0x5755f2[_0x978f('0x2b')][_0x978f('0x3e')]){_0x48f5e6[_0x978f('0x3f')]=[{'all':!![]}];}return db[_0x978f('0x27')][_0x978f('0x40')](_0x48f5e6);})[_0x978f('0x20')](function(_0x24dd89){_0x38aec5[_0x978f('0x41')]=_0x24dd89;return _0x38aec5;})[_0x978f('0x20')](respondWithFilteredResult(_0x1c0be5,_0x48f5e6))[_0x978f('0x42')](handleError(_0x1c0be5,null));};exports[_0x978f('0x43')]=function(_0x2df743,_0x3affc8){var _0x296890={'raw':!![],'where':{'id':_0x2df743[_0x978f('0x44')]['id']}},_0x226cad={};_0x226cad['model']=_[_0x978f('0x2a')](db[_0x978f('0x27')][_0x978f('0x28')]);_0x226cad[_0x978f('0x2b')]=_[_0x978f('0x2a')](_0x2df743[_0x978f('0x2b')]);_0x226cad[_0x978f('0x2c')]=_[_0x978f('0x45')](_0x226cad['model'],_0x226cad[_0x978f('0x2b')]);_0x296890['attributes']=_[_0x978f('0x45')](_0x226cad[_0x978f('0x29')],qs['fields'](_0x2df743[_0x978f('0x2b')]['fields']));_0x296890[_0x978f('0x2e')]=_0x296890[_0x978f('0x2e')][_0x978f('0x2f')]?_0x296890[_0x978f('0x2e')]:_0x226cad[_0x978f('0x29')];if(_0x2df743[_0x978f('0x2b')][_0x978f('0x3e')]){_0x296890['include']=[{'all':!![]}];}_0x296890=_[_0x978f('0x36')]({},_0x296890,_0x2df743[_0x978f('0x3d')]);return db['SmsApplication'][_0x978f('0x46')](_0x296890)[_0x978f('0x20')](handleEntityNotFound(_0x3affc8,null))[_0x978f('0x20')](respondWithResult(_0x3affc8,null))[_0x978f('0x42')](handleError(_0x3affc8,null));};exports[_0x978f('0x47')]=function(_0x29b8f2,_0x52ce80){return db['SmsApplication'][_0x978f('0x47')](_0x29b8f2[_0x978f('0x48')],{})[_0x978f('0x20')](respondWithResult(_0x52ce80,0xc9))[_0x978f('0x42')](handleError(_0x52ce80,null));};exports[_0x978f('0x1f')]=function(_0x468399,_0x1f8980){if(_0x468399[_0x978f('0x48')]['id']){delete _0x468399[_0x978f('0x48')]['id'];}return db[_0x978f('0x27')][_0x978f('0x46')]({'where':{'id':_0x468399['params']['id']}})[_0x978f('0x20')](handleEntityNotFound(_0x1f8980,null))[_0x978f('0x20')](saveUpdates(_0x468399[_0x978f('0x48')],null))[_0x978f('0x20')](respondWithResult(_0x1f8980,null))['catch'](handleError(_0x1f8980,null));};exports[_0x978f('0x21')]=function(_0x273115,_0x324b6f){return db[_0x978f('0x27')]['find']({'where':{'id':_0x273115['params']['id']}})[_0x978f('0x20')](handleEntityNotFound(_0x324b6f,null))[_0x978f('0x20')](removeEntity(_0x324b6f,null))[_0x978f('0x42')](handleError(_0x324b6f,null));};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js
index a25aa5e..0e1ea0d 100644
--- a/server/api/smsApplication/smsApplication.model.js
+++ b/server/api/smsApplication/smsApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./smsApplication.attributes','exports','define'];(function(_0x1d5352,_0x4f7974){var _0x3395c2=function(_0x1f062a){while(--_0x1f062a){_0x1d5352['push'](_0x1d5352['shift']());}};_0x3395c2(++_0x4f7974);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5b0149,_0x1b1155){_0x5b0149=_0x5b0149-0x0;var _0x54a814=_0x5f2f[_0x5b0149];return _0x54a814;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf5f2('0xc'),'collate':_0xf5f2('0xd')});};
\ No newline at end of file
+var _0x7a54=['sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication'];(function(_0xb97ac7,_0x23986d){var _0x243537=function(_0x59cfc5){while(--_0x59cfc5){_0xb97ac7['push'](_0xb97ac7['shift']());}};_0x243537(++_0x23986d);}(_0x7a54,0x106));var _0x47a5=function(_0xe53d6f,_0x3d2f0c){_0xe53d6f=_0xe53d6f-0x0;var _0x7b349=_0x7a54[_0xe53d6f];return _0x7b349;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x47a5('0xc')});};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js
index 327e26b..feedfb3 100644
--- a/server/api/smsApplication/smsApplication.rpc.js
+++ b/server/api/smsApplication/smsApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f6f=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x52085a,_0x1e5058){var _0x32ac7e=function(_0x17c5c5){while(--_0x17c5c5){_0x52085a['push'](_0x52085a['shift']());}};_0x32ac7e(++_0x1e5058);}(_0x9f6f,0x1c7));var _0xf9f6=function(_0x2a553a,_0x247f96){_0x2a553a=_0x2a553a-0x0;var _0x5055cb=_0x9f6f[_0x2a553a];return _0x5055cb;};'use strict';var _=require(_0xf9f6('0x0'));var util=require(_0xf9f6('0x1'));var moment=require(_0xf9f6('0x2'));var BPromise=require(_0xf9f6('0x3'));var rs=require(_0xf9f6('0x4'));var fs=require('fs');var Redis=require(_0xf9f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf9f6('0x6'));var logger=require(_0xf9f6('0x7'))(_0xf9f6('0x8'));var config=require('../../config/environment');var jayson=require(_0xf9f6('0x9'));var client=jayson[_0xf9f6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58b287,_0x138677,_0x4d5001){return new BPromise(function(_0x268831,_0x3cca85){return client['request'](_0x58b287,_0x4d5001)[_0xf9f6('0xb')](function(_0x3056a6){logger[_0xf9f6('0xc')](_0xf9f6('0xd'),_0x138677,_0xf9f6('0xe'));logger[_0xf9f6('0xf')](_0xf9f6('0x10'),_0x138677,_0xf9f6('0xe'),JSON[_0xf9f6('0x11')](_0x3056a6));if(_0x3056a6['error']){if(_0x3056a6['error'][_0xf9f6('0x12')]===0x1f4){logger[_0xf9f6('0x13')]('SmsApplication,\x20%s,\x20%s',_0x138677,_0x3056a6[_0xf9f6('0x13')][_0xf9f6('0x14')]);return _0x3cca85(_0x3056a6[_0xf9f6('0x13')][_0xf9f6('0x14')]);}logger[_0xf9f6('0x13')](_0xf9f6('0xd'),_0x138677,_0x3056a6[_0xf9f6('0x13')]['message']);return _0x268831(_0x3056a6[_0xf9f6('0x13')][_0xf9f6('0x14')]);}else{logger[_0xf9f6('0xc')](_0xf9f6('0xd'),_0x138677,'request\x20sent');_0x268831(_0x3056a6[_0xf9f6('0x15')][_0xf9f6('0x14')]);}})[_0xf9f6('0x16')](function(_0x5460ec){logger[_0xf9f6('0x13')](_0xf9f6('0xd'),_0x138677,_0x5460ec);_0x3cca85(_0x5460ec);});});}
\ No newline at end of file
+var _0x74e0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4d0a31,_0x3f8a83){var _0x44a467=function(_0x312c7e){while(--_0x312c7e){_0x4d0a31['push'](_0x4d0a31['shift']());}};_0x44a467(++_0x3f8a83);}(_0x74e0,0x113));var _0x074e=function(_0xc7d3de,_0x564949){_0xc7d3de=_0xc7d3de-0x0;var _0x35e47b=_0x74e0[_0xc7d3de];return _0x35e47b;};'use strict';var _=require(_0x074e('0x0'));var util=require(_0x074e('0x1'));var moment=require(_0x074e('0x2'));var BPromise=require(_0x074e('0x3'));var rs=require(_0x074e('0x4'));var fs=require('fs');var Redis=require(_0x074e('0x5'));var db=require(_0x074e('0x6'))['db'];var utils=require(_0x074e('0x7'));var logger=require(_0x074e('0x8'))(_0x074e('0x9'));var config=require('../../config/environment');var jayson=require(_0x074e('0xa'));var client=jayson['client'][_0x074e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f72b1,_0x5f36e6,_0x5e20cf){return new BPromise(function(_0x5aadc2,_0x41fc5c){return client['request'](_0x3f72b1,_0x5e20cf)['then'](function(_0x47e546){logger[_0x074e('0xc')](_0x074e('0xd'),_0x5f36e6,_0x074e('0xe'));logger[_0x074e('0xf')](_0x074e('0x10'),_0x5f36e6,_0x074e('0xe'),JSON[_0x074e('0x11')](_0x47e546));if(_0x47e546[_0x074e('0x12')]){if(_0x47e546[_0x074e('0x12')][_0x074e('0x13')]===0x1f4){logger[_0x074e('0x12')](_0x074e('0xd'),_0x5f36e6,_0x47e546[_0x074e('0x12')][_0x074e('0x14')]);return _0x41fc5c(_0x47e546[_0x074e('0x12')][_0x074e('0x14')]);}logger[_0x074e('0x12')](_0x074e('0xd'),_0x5f36e6,_0x47e546['error'][_0x074e('0x14')]);return _0x5aadc2(_0x47e546[_0x074e('0x12')][_0x074e('0x14')]);}else{logger[_0x074e('0xc')](_0x074e('0xd'),_0x5f36e6,_0x074e('0xe'));_0x5aadc2(_0x47e546[_0x074e('0x15')][_0x074e('0x14')]);}})[_0x074e('0x16')](function(_0x2b2f19){logger[_0x074e('0x12')](_0x074e('0xd'),_0x5f36e6,_0x2b2f19);_0x41fc5c(_0x2b2f19);});});}
\ No newline at end of file
diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js
index 5d6fa96..95939cf 100644
--- a/server/api/smsInteraction/index.js
+++ b/server/api/smsInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x512b=['./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x512b,0xbf));var _0xb512=function(_0x46ea8f,_0x21cead){_0x46ea8f=_0x46ea8f-0x0;var _0x108e2f=_0x512b[_0x46ea8f];return _0x108e2f;};'use strict';var multer=require(_0xb512('0x0'));var util=require(_0xb512('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb512('0x2'));var router=express[_0xb512('0x3')]();var auth=require(_0xb512('0x4'));var interaction=require(_0xb512('0x5'));var config=require(_0xb512('0x6'));var controller=require(_0xb512('0x7'));router[_0xb512('0x8')]('/',auth[_0xb512('0x9')](),controller[_0xb512('0xa')]);router['get'](_0xb512('0xb'),auth['isAuthenticated'](),controller[_0xb512('0xc')]);router[_0xb512('0x8')](_0xb512('0xd'),auth[_0xb512('0x9')](),controller[_0xb512('0xe')]);router['get'](_0xb512('0xf'),auth[_0xb512('0x9')](),controller[_0xb512('0x10')]);router[_0xb512('0x8')](_0xb512('0x11'),auth[_0xb512('0x9')](),controller[_0xb512('0x12')]);router['post']('/',auth[_0xb512('0x9')](),controller['create']);router[_0xb512('0x13')](_0xb512('0xf'),auth[_0xb512('0x9')](),controller[_0xb512('0x14')]);router[_0xb512('0x13')](_0xb512('0x15'),auth[_0xb512('0x9')](),interaction['tracked'](_0xb512('0x16'),_0xb512('0x17')),controller[_0xb512('0x18')]);router[_0xb512('0x19')](_0xb512('0xd'),auth['isAuthenticated'](),interaction['tracked']('sms',_0xb512('0x1a')),controller[_0xb512('0x1b')]);router[_0xb512('0x1c')]('/:id',auth['isAuthenticated'](),interaction[_0xb512('0x1d')](_0xb512('0x16'),_0xb512('0x1e')),controller[_0xb512('0x1f')]);router[_0xb512('0x1c')](_0xb512('0x15'),auth['isAuthenticated'](),controller['removeTags']);module[_0xb512('0x20')]=router;
\ No newline at end of file
+var _0xde35=['removeTags','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','/:id/tags'];(function(_0x2ae40f,_0x24721b){var _0x52225d=function(_0x4486f4){while(--_0x4486f4){_0x2ae40f['push'](_0x2ae40f['shift']());}};_0x52225d(++_0x24721b);}(_0xde35,0x176));var _0x5de3=function(_0xe7e1b7,_0x3106d7){_0xe7e1b7=_0xe7e1b7-0x0;var _0x70813=_0xde35[_0xe7e1b7];return _0x70813;};'use strict';var multer=require(_0x5de3('0x0'));var util=require(_0x5de3('0x1'));var path=require(_0x5de3('0x2'));var timeout=require(_0x5de3('0x3'));var express=require(_0x5de3('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5de3('0x5'));var config=require(_0x5de3('0x6'));var controller=require(_0x5de3('0x7'));router[_0x5de3('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5de3('0x8')](_0x5de3('0x9'),auth[_0x5de3('0xa')](),controller[_0x5de3('0xb')]);router[_0x5de3('0x8')](_0x5de3('0xc'),auth['isAuthenticated'](),controller[_0x5de3('0xd')]);router[_0x5de3('0x8')](_0x5de3('0xe'),auth['isAuthenticated'](),controller[_0x5de3('0xf')]);router[_0x5de3('0x8')](_0x5de3('0x10'),auth[_0x5de3('0xa')](),controller['download']);router[_0x5de3('0x11')]('/',auth[_0x5de3('0xa')](),controller[_0x5de3('0x12')]);router[_0x5de3('0x11')]('/:id/messages',auth[_0x5de3('0xa')](),controller[_0x5de3('0x13')]);router[_0x5de3('0x11')]('/:id/tags',auth[_0x5de3('0xa')](),interaction[_0x5de3('0x14')](_0x5de3('0x15'),_0x5de3('0x16')),controller[_0x5de3('0x17')]);router[_0x5de3('0x18')]('/:id',auth[_0x5de3('0xa')](),interaction[_0x5de3('0x14')](_0x5de3('0x15'),'smsinteraction:update'),controller[_0x5de3('0x19')]);router[_0x5de3('0x1a')]('/:id',auth[_0x5de3('0xa')](),interaction[_0x5de3('0x14')](_0x5de3('0x15'),_0x5de3('0x1b')),controller['destroy']);router[_0x5de3('0x1a')](_0x5de3('0x1c'),auth[_0x5de3('0xa')](),controller[_0x5de3('0x1d')]);module[_0x5de3('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js
index 375f2a8..ee13233 100644
--- a/server/api/smsInteraction/smsInteraction.attributes.js
+++ b/server/api/smsInteraction/smsInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd0c=['DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x24e721,_0x4aec0c){var _0x16434e=function(_0x273166){while(--_0x273166){_0x24e721['push'](_0x24e721['shift']());}};_0x16434e(++_0x4aec0c);}(_0xfd0c,0x146));var _0xcfd0=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0xfd0c[_0x7275e9];return _0x17b99d;};'use strict';var Sequelize=require(_0xcfd0('0x0'));var moment=require(_0xcfd0('0x1'));module[_0xcfd0('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcfd0('0x3')]},'disposition':{'type':Sequelize[_0xcfd0('0x4')]},'note':{'type':Sequelize[_0xcfd0('0x4')]},'phone':{'type':Sequelize[_0xcfd0('0x4')]},'read1stAt':{'type':Sequelize[_0xcfd0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcfd0('0x5')]('in',_0xcfd0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcfd0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcfd0('0x5')]('in',_0xcfd0('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x64aa=['moment','DATE','STRING','ENUM','out','sequelize'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x64aa,0xad));var _0xa64a=function(_0x27a1a0,_0x32380c){_0x27a1a0=_0x27a1a0-0x0;var _0x38cf5c=_0x64aa[_0x27a1a0];return _0x38cf5c;};'use strict';var Sequelize=require(_0xa64a('0x0'));var moment=require(_0xa64a('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa64a('0x2')]},'disposition':{'type':Sequelize[_0xa64a('0x3')]},'note':{'type':Sequelize[_0xa64a('0x3')]},'phone':{'type':Sequelize[_0xa64a('0x3')]},'read1stAt':{'type':Sequelize[_0xa64a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xa64a('0x4')]('in',_0xa64a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa64a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xa64a('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js
index d13192d..30c7ee4 100644
--- a/server/api/smsInteraction/smsInteraction.controller.js
+++ b/server/api/smsInteraction/smsInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfcf0=['tag','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','%s\x20=\x200','`Messages.count`\x20>\x200','sequelize','merge','Account.key','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','Tags','split','rows','catch','show','params','SmsInteraction','include','options','find','create','body','describe','SmsMessage','addMessage','ids','findOne','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','spread','Tag','color','emit','smsInteractionTags:save','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','Messages','direction','User','fullname','CmContact','Contact','firstName','lastName','SmsAccount','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Sms','mkdirSync','Account','Owner','N.A.','closedAt','disposition','System','out','renderFile','downloadInteraction.html','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','count','offset','limit','set','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','COUNT(*)','from','me.SmsInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','sms_interactions','ui.UserId\x20=\x20i.UserId','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_messages','expr','advancedFilter','parse','forEach','value','dateStart','startOf','format','utc','endOf','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','isArray','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','Messages.count','c.lastName','map','isNil','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','filter','replace','\x27\x27\x27\x27','isNumeric','push','toString','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','i.id','Sequelize','QueryTypes','clone','read','having','`Messages.count`\x20=\x200'];(function(_0x124e2d,_0x3ec839){var _0x345e75=function(_0x59f7f9){while(--_0x59f7f9){_0x124e2d['push'](_0x124e2d['shift']());}};_0x345e75(++_0x3ec839);}(_0xfcf0,0x138));var _0x0fcf=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0xfcf0[_0x4dbba7];return _0x43ef83;};'use strict';var pdf=require(_0x0fcf('0x0'));var emlformat=require(_0x0fcf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0fcf('0x2'));var jsonpatch=require(_0x0fcf('0x3'));var rp=require(_0x0fcf('0x4'));var moment=require(_0x0fcf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0fcf('0x6'));var util=require(_0x0fcf('0x7'));var path=require(_0x0fcf('0x8'));var sox=require(_0x0fcf('0x9'));var csv=require(_0x0fcf('0xa'));var ejs=require(_0x0fcf('0xb'));var fs=require('fs');var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0xa'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0fcf('0x13'));var logger=require('../../config/logger')(_0x0fcf('0x14'));var utils=require(_0x0fcf('0x15'));var config=require(_0x0fcf('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0fcf('0x17')](config[_0x0fcf('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fcf('0x19'))(new Redis(config[_0x0fcf('0x18')]));require(_0x0fcf('0x1a'))[_0x0fcf('0x1b')](socket);function respondWithStatusCode(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xcc;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x1c')](_0x48bba6);}return _0x25fadc[_0x0fcf('0x1d')](_0x48bba6)['end']();};}function respondWithResult(_0x3c09c4,_0x610106){_0x610106=_0x610106||0xc8;return function(_0x445207){if(_0x445207){return _0x3c09c4[_0x0fcf('0x1d')](_0x610106)['json'](_0x445207);}};}function respondWithFilteredResult(_0x3e78d0,_0x2f8289){return function(_0x1a8477){if(_0x1a8477){var _0x8581bd=_0x1a8477[_0x0fcf('0x1e')],_0x19cfbd=_0x2f8289['offset'],_0x567320=_0x2f8289[_0x0fcf('0x1f')]+_0x2f8289[_0x0fcf('0x20')],_0x18ea32;if(_0x567320>=_0x8581bd){_0x567320=_0x8581bd;_0x18ea32=0xc8;}else{_0x18ea32=0xce;}_0x3e78d0['status'](_0x18ea32);return _0x3e78d0[_0x0fcf('0x21')]('Content-Range',_0x19cfbd+'-'+_0x567320+'/'+_0x8581bd)[_0x0fcf('0x22')](_0x1a8477);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x23')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x24')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x25')](_0x2f03ce)[_0x0fcf('0x26')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x27')]()[_0x0fcf('0x26')](function(){_0x5841a9[_0x0fcf('0x1d')](0xcc)[_0x0fcf('0x28')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x29')](_0x41b7a2[_0x0fcf('0x2a')]);if(_0x41b7a2[_0x0fcf('0x2b')]){delete _0x41b7a2[_0x0fcf('0x2b')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x2c')](_0x41b7a2);};}exports[_0x0fcf('0x2d')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=db['SmsInteraction'][_0x0fcf('0x2e')];_0x5d9bcd[_0x0fcf('0x2f')]=_['keys'](_0x428194);_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x200517[_0x0fcf('0x30')]);_0x5d9bcd[_0x0fcf('0x32')]=_[_0x0fcf('0x33')](_0x5d9bcd[_0x0fcf('0x2f')],_0x5d9bcd['query']);_0x49fd0e[_0x0fcf('0x34')]=_[_0x0fcf('0x33')](_0x5d9bcd[_0x0fcf('0x2f')],qs[_0x0fcf('0x35')](_0x200517[_0x0fcf('0x30')][_0x0fcf('0x35')]));_0x49fd0e['attributes']=_0x49fd0e[_0x0fcf('0x34')][_0x0fcf('0x36')]?_0x49fd0e[_0x0fcf('0x34')]:_0x5d9bcd[_0x0fcf('0x2f')];if(!_0x200517[_0x0fcf('0x30')][_0x0fcf('0x37')](_0x0fcf('0x38'))){_0x49fd0e[_0x0fcf('0x20')]=qs[_0x0fcf('0x20')](_0x200517[_0x0fcf('0x30')][_0x0fcf('0x20')]);_0x49fd0e[_0x0fcf('0x1f')]=qs[_0x0fcf('0x1f')](_0x200517[_0x0fcf('0x30')]['offset']);}_0x49fd0e['order']=qs[_0x0fcf('0x39')](_0x200517['query']['sort']);_0x49fd0e[_0x0fcf('0x3a')]=qs[_0x0fcf('0x32')](_[_0x0fcf('0x3b')](_0x200517['query'],_0x5d9bcd['filters']));var _0x1417ac=[];var _0x15db0d=squel[_0x0fcf('0x3c')]()['field']('id')[_0x0fcf('0x3d')](_0x0fcf('0x2b'))[_0x0fcf('0x3d')]('color')['from']('tools_tags');var _0x3c24cb=squel[_0x0fcf('0x3c')]()[_0x0fcf('0x3d')](_0x0fcf('0x3e'))[_0x0fcf('0x3f')]('sms_messages','me')[_0x0fcf('0x3a')](_0x0fcf('0x40'))[_0x0fcf('0x3a')]('me.direction\x20=\x20\x27in\x27')['where'](_0x0fcf('0x41'));var _0xe97d6b=squel[_0x0fcf('0x3c')]()[_0x0fcf('0x3d')](_0x0fcf('0x42'))['field'](_0x0fcf('0x43'))[_0x0fcf('0x3f')](_0x0fcf('0x44'),'ui')[_0x0fcf('0x45')]('users','u','u.id\x20=\x20ui.UserId');var _0x252000=squel[_0x0fcf('0x3c')]()['from'](_0x0fcf('0x46'),'i')[_0x0fcf('0x45')]('user_has_sms_interactions','ui',_0x0fcf('0x47'))[_0x0fcf('0x45')](_0x0fcf('0x48'),'u',_0x0fcf('0x49'))[_0x0fcf('0x45')]('cm_contacts','c',_0x0fcf('0x4a'))[_0x0fcf('0x45')]('users','o','o.id\x20=\x20i.UserId')[_0x0fcf('0x45')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0x0fcf('0x45')](_0x0fcf('0x4b'),'me',_0x0fcf('0x40'));var _0xb9b6ff=squel[_0x0fcf('0x4c')]();if(_0x200517[_0x0fcf('0x30')][_0x0fcf('0x4d')]){var _0x5cebd8=JSON[_0x0fcf('0x4e')](_0x200517[_0x0fcf('0x30')]['advancedFilter']);_[_0x0fcf('0x31')](_0x5cebd8)[_0x0fcf('0x4f')](function(_0x3e24fc){var _0x4b2308=_0x5cebd8[_0x3e24fc];if(_0x3e24fc==='createdAt'){var _0x41b297=moment(_0x4b2308[_0x0fcf('0x50')][_0x0fcf('0x51')])[_0x0fcf('0x52')]('day')['utc']()[_0x0fcf('0x53')]();var _0x3c06c3=moment(_0x3c06c3)[_0x0fcf('0x54')]()[_0x0fcf('0x55')](_0x0fcf('0x56'))[_0x0fcf('0x53')]();_0xb9b6ff[_0x0fcf('0x57')](_0x0fcf('0x58'),_0x41b297,_0x3c06c3);}else{if(_['isArray'](_0x4b2308['condition'])){_0x4b2308[_0x0fcf('0x59')][_0x0fcf('0x4f')](function(_0x28d2f4){switch(_0x4b2308[_0x0fcf('0x59')][_0x0fcf('0x50')]){case'IS':if(_0x3e24fc!==_0x0fcf('0x5a')&&_0x3e24fc!=='Messages.count'){if(_[_0x0fcf('0x5b')](_0x4b2308[_0x0fcf('0x50')])&&_0x4b2308['value'][_0x0fcf('0x36')]>0x1){_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x5d'),_0x4b2308['value']);}else{_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x5e'),_0x4b2308[_0x0fcf('0x50')][0x0]);}}break;case'=':_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x5e'),_0x4b2308[_0x0fcf('0x50')]);break;case _0x0fcf('0x5f'):if(_0x3e24fc===_0x0fcf('0x60')){_0xb9b6ff[_0x0fcf('0x57')](_0x0fcf('0x61')+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');_0xb9b6ff['or']('c.lastName'+_0x0fcf('0x62'),'%'+_0x4b2308['value']+'%');_0xb9b6ff['or'](_0x0fcf('0x63')+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');}else{_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+'\x20LIKE\x20?','%'+_0x4b2308[_0x0fcf('0x50')]+'%');}break;case'>':_0xb9b6ff['and'](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x64'),_0x4b2308['value']);break;case'<':_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+'\x20<\x20?',_0x4b2308[_0x0fcf('0x50')]);break;}});}else{switch(_0x4b2308[_0x0fcf('0x59')][_0x0fcf('0x50')]){case'IS':if(_0x3e24fc!==_0x0fcf('0x5a')&&_0x3e24fc!==_0x0fcf('0x65')){if(_['isArray'](_0x4b2308['value'])&&_0x4b2308[_0x0fcf('0x50')]['length']>0x1){_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+'\x20IN\x20?',_0x4b2308['value']);}else{_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x5e'),_0x4b2308['value'][0x0]);}}break;case'=':_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308['tableAlias']+'.'+_0x3e24fc+_0x0fcf('0x5e'),_0x4b2308[_0x0fcf('0x50')]);break;case _0x0fcf('0x5f'):if(_0x3e24fc==='ContactId'){_0xb9b6ff[_0x0fcf('0x57')](_0x0fcf('0x61')+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');_0xb9b6ff['or'](_0x0fcf('0x66')+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');_0xb9b6ff['or'](_0x0fcf('0x63')+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');}else{_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308['tableAlias']+'.'+_0x3e24fc+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');}break;case'>':_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x64'),_0x4b2308[_0x0fcf('0x50')]);break;case'<':_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308['tableAlias']+'.'+_0x3e24fc+'\x20<\x20?',_0x4b2308[_0x0fcf('0x50')]);break;}}}});}else{var _0x38c2e0=_(Object['keys'](_0x200517[_0x0fcf('0x30')]))[_0x0fcf('0x67')](function(_0x447c25){return _0x428194[_0x0fcf('0x37')](_0x447c25)?_0x447c25:undefined;})['filter'](function(_0x540859){return!_[_0x0fcf('0x68')](_0x540859);})[_0x0fcf('0x50')]();if(!_[_0x0fcf('0x69')](_0x38c2e0)){_0x38c2e0[_0x0fcf('0x4f')](function(_0x1abf75){if(_0x1abf75==='SmsAccountId'){_0x252000[_0x0fcf('0x3a')](_0x0fcf('0x6a'),[][_0x0fcf('0x6b')](_0x200517[_0x0fcf('0x30')][_0x1abf75]));}else if(_0x1abf75===_0x0fcf('0x6c')){var _0x52cb97=JSON['parse'](_0x200517[_0x0fcf('0x30')][_0x1abf75])[_0x0fcf('0x6d')];var _0x8c2777=JSON[_0x0fcf('0x4e')](_0x200517[_0x0fcf('0x30')][_0x1abf75])[_0x0fcf('0x6e')];_0x252000[_0x0fcf('0x3a')](_0x0fcf('0x58'),_0x52cb97,_0x8c2777);}else{_0x252000[_0x0fcf('0x3a')]('i.'+_0x1abf75+_0x0fcf('0x5e'),_0x200517['query'][_0x1abf75]);}});}if(_0x200517[_0x0fcf('0x30')][_0x0fcf('0x6f')]){var _0x1c5ec1=_0x200517[_0x0fcf('0x30')][_0x0fcf('0x6f')][_0x0fcf('0x70')]('\x5c','\x5c\x5c')[_0x0fcf('0x70')]('\x27\x27',_0x0fcf('0x71'));if(qs[_0x0fcf('0x72')](_0x1c5ec1)){_0xb9b6ff['or']('i.id\x20LIKE\x20?',_0x1c5ec1+'%')['or']('i.phone\x20LIKE\x20?',_0x1c5ec1+'%');}else{var _0x5a1cd9=[];_0x1c5ec1['split']('\x20')[_0x0fcf('0x4f')](function(_0x57c221){_0x5a1cd9[_0x0fcf('0x73')]('+'+_0x57c221[_0x0fcf('0x74')]());});var _0x3da414=_0x5a1cd9['join']('\x20');_0xb9b6ff['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x3da414)['or'](_0x0fcf('0x75'),_0x1c5ec1+'%');}}}_0x252000[_0x0fcf('0x3a')](_0xb9b6ff);if(_0x49fd0e['order']){_0x49fd0e[_0x0fcf('0x76')][_0x0fcf('0x4f')](function(_0x5936a6){_0x252000[_0x0fcf('0x76')]('i.'+_0x5936a6[0x0],_0x5936a6[0x1]===_0x0fcf('0x77')?![]:!![]);});}_0x252000[_0x0fcf('0x78')](_0x0fcf('0x79'));var _0x7cc9a0={'type':db[_0x0fcf('0x7a')][_0x0fcf('0x7b')]['SELECT'],'raw':!![]};var _0x3edb41=_0x252000[_0x0fcf('0x7c')]()[_0x0fcf('0x3d')](_0x0fcf('0x3e'));if(!_0x200517[_0x0fcf('0x30')][_0x0fcf('0x4d')]){if(_0x200517['query']['read']){if(_0x200517[_0x0fcf('0x30')][_0x0fcf('0x7d')]==0x1){_0x3edb41[_0x0fcf('0x3a')](util[_0x0fcf('0x53')]('%s\x20=\x200',_0x3c24cb[_0x0fcf('0x74')]()));_0x252000[_0x0fcf('0x7e')](_0x0fcf('0x7f'));}else{_0x3edb41[_0x0fcf('0x3a')](util[_0x0fcf('0x53')]('%s\x20>\x200',_0x3c24cb['toString']()));_0x252000[_0x0fcf('0x7e')]('`Messages.count`\x20>\x200');}}if(_0x200517[_0x0fcf('0x30')]['tag']){var _0x4ebc2f=_[_0x0fcf('0x5b')](_0x200517[_0x0fcf('0x30')][_0x0fcf('0x80')])?_0x200517[_0x0fcf('0x30')]['tag']:new Array(_0x200517[_0x0fcf('0x30')][_0x0fcf('0x80')]);var _0x1bbaca=squel[_0x0fcf('0x4c')]();_0x4ebc2f['forEach'](function(_0x376d26){_0x1bbaca['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x376d26+',%');});_0x252000[_0x0fcf('0x7e')](_0x1bbaca);_0x3edb41['left_join'](_0x0fcf('0x81'),'it',_0x0fcf('0x82'));_0x3edb41['left_join'](_0x0fcf('0x83'),'t',_0x0fcf('0x84'));_0x3edb41[_0x0fcf('0x3a')]('t.id\x20IN\x20?',_0x4ebc2f);}}else{var _0x5cebd8=JSON['parse'](_0x200517[_0x0fcf('0x30')]['advancedFilter']);_[_0x0fcf('0x31')](_0x5cebd8)[_0x0fcf('0x4f')](function(_0x38c703){var _0xf0c6d2=_0x5cebd8[_0x38c703];if(_0x38c703===_0x0fcf('0x5a')){var _0x17662e=_0xf0c6d2[_0x0fcf('0x50')];var _0x344720=squel[_0x0fcf('0x4c')]();_0x17662e['forEach'](function(_0x27d46a){_0x344720['or'](_0x0fcf('0x85'),'%,'+_0x27d46a+',%');});_0x252000[_0x0fcf('0x7e')](_0x344720);_0x3edb41[_0x0fcf('0x45')](_0x0fcf('0x86'),'it',_0x0fcf('0x87'));_0x3edb41[_0x0fcf('0x45')](_0x0fcf('0x83'),'t','t.id\x20=\x20it.TagId');_0x3edb41[_0x0fcf('0x3a')](_0x0fcf('0x88'),_0x17662e);}else if(_0x38c703===_0x0fcf('0x65')){if(_0xf0c6d2[_0x0fcf('0x50')][_0x0fcf('0x36')]===0x1){if(_0xf0c6d2[_0x0fcf('0x50')][0x0]===0x1){_0x3edb41[_0x0fcf('0x3a')](util['format'](_0x0fcf('0x89'),_0x3c24cb['toString']()));_0x252000[_0x0fcf('0x7e')](_0x0fcf('0x7f'));}else{_0x3edb41[_0x0fcf('0x3a')](util['format']('%s\x20>\x200',_0x3c24cb['toString']()));_0x252000['having'](_0x0fcf('0x8a'));}}}});}db[_0x0fcf('0x8b')][_0x0fcf('0x30')](_0x3edb41[_0x0fcf('0x74')](),_0x7cc9a0)[_0x0fcf('0x26')](function(_0x3259e4){_0x4af80d[_0x0fcf('0x1e')]=_0x3259e4[_0x0fcf('0x36')];if(_0x4af80d[_0x0fcf('0x1e')]===0x0)return[];return db[_0x0fcf('0x8b')][_0x0fcf('0x30')](_0x15db0d['toString'](),_0x7cc9a0)[_0x0fcf('0x26')](function(_0xdfdf98){_0x1417ac=_['keyBy'](_0xdfdf98,'id');_0x7cc9a0=_[_0x0fcf('0x8c')](_0x7cc9a0,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x252000[_0x0fcf('0x3d')](_0x3c24cb,_0x0fcf('0x65'));_0x252000['field']('a.key',_0x0fcf('0x8d'));_0x252000[_0x0fcf('0x3d')]('i.*');_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x61'),_0x0fcf('0x8e'));_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x66'),_0x0fcf('0x8f'));_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x63'),'Contact.email');_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x90'),_0x0fcf('0x91'));_0x252000[_0x0fcf('0x3d')]('c.mobile',_0x0fcf('0x92'));_0x252000['field']('c.fax','Contact.fax');_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x93'),_0x0fcf('0x94'));_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x95'),_0x0fcf('0x96'));_0x252000[_0x0fcf('0x45')](_0x0fcf('0x81'),'it',_0x0fcf('0x82'));_0x252000['left_join'](_0x0fcf('0x83'),'t',_0x0fcf('0x84'));_0x252000[_0x0fcf('0x20')](_0x49fd0e[_0x0fcf('0x20')]);_0x252000[_0x0fcf('0x1f')](_0x49fd0e[_0x0fcf('0x1f')]);return db[_0x0fcf('0x8b')][_0x0fcf('0x30')](_0x252000[_0x0fcf('0x74')](),_0x7cc9a0);})['then'](function(_0x56e098){_0xe97d6b['where'](_0x0fcf('0x97'),_[_0x0fcf('0x67')](_0x56e098,'id'));return db[_0x0fcf('0x8b')][_0x0fcf('0x30')](_0xe97d6b['toString'](),_0x7cc9a0)['then'](function(_0x5c7fd7){var _0x9f5010=_['groupBy'](_0x5c7fd7,_0x0fcf('0x98'));_0x56e098['forEach'](function(_0xaadf5d){if(_0x9f5010[_0xaadf5d['id']]){_0xaadf5d['Users']=_[_0x0fcf('0x67')](_0x9f5010[_0xaadf5d['id']],function(_0x5214f0){return{'id':_0x5214f0['id']};});}if(_0xaadf5d['TagIds']){_0xaadf5d[_0x0fcf('0x99')]=[];_0xaadf5d['TagIds'][_0x0fcf('0x9a')](',')[_0x0fcf('0x4f')](function(_0x3e26d5){_0xaadf5d[_0x0fcf('0x99')][_0x0fcf('0x73')](_0x1417ac[_0x3e26d5]);});}delete _0xaadf5d[_0x0fcf('0x96')];});return _0x56e098;});});})[_0x0fcf('0x26')](function(_0x512dbd){_0x4af80d[_0x0fcf('0x9b')]=_0x512dbd;return _0x4af80d;})[_0x0fcf('0x26')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x9c')](handleError(_0x35180d,null));};exports[_0x0fcf('0x9d')]=function(_0x180702,_0x57a1c0){var _0x1031a1={'raw':![],'where':{'id':_0x180702[_0x0fcf('0x9e')]['id']}},_0x3bc4a5={};_0x3bc4a5[_0x0fcf('0x2f')]=_[_0x0fcf('0x31')](db[_0x0fcf('0x9f')][_0x0fcf('0x2e')]);_0x3bc4a5[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x180702['query']);_0x3bc4a5[_0x0fcf('0x32')]=_[_0x0fcf('0x33')](_0x3bc4a5[_0x0fcf('0x2f')],_0x3bc4a5[_0x0fcf('0x30')]);_0x1031a1[_0x0fcf('0x34')]=_[_0x0fcf('0x33')](_0x3bc4a5[_0x0fcf('0x2f')],qs[_0x0fcf('0x35')](_0x180702[_0x0fcf('0x30')][_0x0fcf('0x35')]));_0x1031a1[_0x0fcf('0x34')]=_0x1031a1[_0x0fcf('0x34')][_0x0fcf('0x36')]?_0x1031a1['attributes']:_0x3bc4a5[_0x0fcf('0x2f')];if(_0x180702[_0x0fcf('0x30')]['includeAll']){_0x1031a1[_0x0fcf('0xa0')]=[{'all':!![]}];}_0x1031a1=_[_0x0fcf('0x8c')]({},_0x1031a1,_0x180702[_0x0fcf('0xa1')]);return db[_0x0fcf('0x9f')][_0x0fcf('0xa2')](_0x1031a1)['then'](handleEntityNotFound(_0x57a1c0,null))['then'](respondWithResult(_0x57a1c0,null))['catch'](handleError(_0x57a1c0,null));};exports[_0x0fcf('0xa3')]=function(_0x4b0216,_0x2bce6e){return db[_0x0fcf('0x9f')]['create'](_0x4b0216[_0x0fcf('0xa4')],{})[_0x0fcf('0x26')](respondWithResult(_0x2bce6e,0xc9))[_0x0fcf('0x9c')](handleError(_0x2bce6e,null));};exports[_0x0fcf('0x25')]=function(_0x173f04,_0x3545d5){if(_0x173f04[_0x0fcf('0xa4')]['id']){delete _0x173f04[_0x0fcf('0xa4')]['id'];}return db[_0x0fcf('0x9f')]['find']({'where':{'id':_0x173f04[_0x0fcf('0x9e')]['id']}})[_0x0fcf('0x26')](handleEntityNotFound(_0x3545d5,null))[_0x0fcf('0x26')](saveUpdates(_0x173f04['body'],null))[_0x0fcf('0x26')](respondWithResult(_0x3545d5,null))[_0x0fcf('0x9c')](handleError(_0x3545d5,null));};exports[_0x0fcf('0x27')]=function(_0x71ac37,_0x208a1e){return db[_0x0fcf('0x9f')][_0x0fcf('0xa2')]({'where':{'id':_0x71ac37['params']['id']}})[_0x0fcf('0x26')](handleEntityNotFound(_0x208a1e,null))[_0x0fcf('0x26')](removeEntity(_0x208a1e,null))[_0x0fcf('0x9c')](handleError(_0x208a1e,null));};exports[_0x0fcf('0xa5')]=function(_0x57d614,_0x42a9e8){return db['SmsInteraction'][_0x0fcf('0xa5')]()[_0x0fcf('0x26')](respondWithResult(_0x42a9e8,null))['catch'](handleError(_0x42a9e8,null));};exports['addMessage']=function(_0x10d4d0,_0x142fd1,_0xed8835){return db[_0x0fcf('0xa6')][_0x0fcf('0xa2')]({'where':{'id':_0x10d4d0[_0x0fcf('0x9e')]['id']}})[_0x0fcf('0x26')](handleEntityNotFound(_0x142fd1,null))[_0x0fcf('0x26')](function(_0x2a0ba3){if(_0x2a0ba3){return _0x2a0ba3[_0x0fcf('0xa7')](_0x10d4d0['body'][_0x0fcf('0xa8')],_['omit'](_0x10d4d0['body'],[_0x0fcf('0xa8'),'id'])||{});}})['then'](respondWithResult(_0x142fd1,null))['catch'](handleError(_0x142fd1,null));};exports['getMessages']=function(_0x22c9d9,_0x33cd4f,_0x3d7267){var _0x1e43af={'raw':![],'where':{}};var _0x1169f5={};var _0x17486b={'count':0x0,'rows':[]};return db[_0x0fcf('0x9f')][_0x0fcf('0xa9')]({'where':{'id':_0x22c9d9[_0x0fcf('0x9e')]['id']}})['then'](handleEntityNotFound(_0x33cd4f,null))[_0x0fcf('0x26')](function(_0x2f14a3){if(_0x2f14a3){_0x1169f5[_0x0fcf('0x2f')]=_[_0x0fcf('0x31')](db[_0x0fcf('0xa6')][_0x0fcf('0x2e')]);_0x1169f5['query']=_[_0x0fcf('0x31')](_0x22c9d9[_0x0fcf('0x30')]);_0x1169f5[_0x0fcf('0x32')]=_[_0x0fcf('0x33')](_0x1169f5[_0x0fcf('0x2f')],_0x1169f5['query']);_0x1e43af[_0x0fcf('0x34')]=_[_0x0fcf('0x33')](_0x1169f5[_0x0fcf('0x2f')],qs[_0x0fcf('0x35')](_0x22c9d9[_0x0fcf('0x30')]['fields']));_0x1e43af[_0x0fcf('0x34')]=_0x1e43af[_0x0fcf('0x34')][_0x0fcf('0x36')]?_0x1e43af[_0x0fcf('0x34')]:_0x1169f5['model'];if(!_0x22c9d9[_0x0fcf('0x30')][_0x0fcf('0x37')](_0x0fcf('0x38'))){_0x1e43af['limit']=qs['limit'](_0x22c9d9[_0x0fcf('0x30')][_0x0fcf('0x20')]);_0x1e43af[_0x0fcf('0x1f')]=qs[_0x0fcf('0x1f')](_0x22c9d9[_0x0fcf('0x30')]['offset']);}_0x1e43af[_0x0fcf('0x76')]=qs[_0x0fcf('0x39')](_0x22c9d9[_0x0fcf('0x30')]['sort']);_0x1e43af[_0x0fcf('0x3a')]=qs[_0x0fcf('0x32')](_['pick'](_0x22c9d9[_0x0fcf('0x30')],_0x1169f5[_0x0fcf('0x32')]));_0x1e43af[_0x0fcf('0x3a')][_0x0fcf('0x98')]=_0x2f14a3['id'];if(_0x22c9d9[_0x0fcf('0x30')]['filter']){_0x1e43af[_0x0fcf('0x3a')]=_['merge'](_0x1e43af[_0x0fcf('0x3a')],{'$or':_['map'](_0x1e43af['attributes'],function(_0x24eb94){var _0x302d0a={};_0x302d0a[_0x24eb94]={'$like':'%'+_0x22c9d9[_0x0fcf('0x30')][_0x0fcf('0x6f')]+'%'};return _0x302d0a;})});}if(_0x22c9d9[_0x0fcf('0x30')][_0x0fcf('0x6d')]){var _0x3753b6=_0x22c9d9[_0x0fcf('0x30')][_0x0fcf('0x6d')]['split'](',');var _0x1e805c={};_0x1e805c[_0x3753b6[0x0]]={'$gte':moment(_0x3753b6[0x1])[_0x0fcf('0x53')](_0x0fcf('0xaa'))};_0x1e43af[_0x0fcf('0x3a')]=_[_0x0fcf('0x8c')](_0x1e43af[_0x0fcf('0x3a')],_0x1e805c);}_0x1e43af=_[_0x0fcf('0x8c')]({},_0x1e43af,_0x22c9d9['options']);return db[_0x0fcf('0xa6')][_0x0fcf('0x1e')]({'where':_0x1e43af['where']})[_0x0fcf('0x26')](function(_0x59ef9e){_0x17486b[_0x0fcf('0x1e')]=_0x59ef9e;if(_0x22c9d9['query'][_0x0fcf('0xab')]){_0x1e43af[_0x0fcf('0xa0')]=[{'all':!![]}];}return db[_0x0fcf('0xa6')][_0x0fcf('0xac')](_0x1e43af);})[_0x0fcf('0x26')](function(_0x291b94){_0x17486b['rows']=_0x291b94;return _0x17486b;});}})[_0x0fcf('0x26')](respondWithFilteredResult(_0x33cd4f,_0x1e43af))[_0x0fcf('0x9c')](handleError(_0x33cd4f,null));};exports[_0x0fcf('0xad')]=function(_0x4310fd,_0x142a45,_0x4cf71e){return db['SmsInteraction'][_0x0fcf('0xa2')]({'where':{'id':_0x4310fd[_0x0fcf('0x9e')]['id']}})[_0x0fcf('0x26')](handleEntityNotFound(_0x142a45,null))[_0x0fcf('0x26')](function(_0x3c24a7){if(_0x3c24a7){return _0x3c24a7['setTags'](_0x4310fd[_0x0fcf('0xa4')][_0x0fcf('0xa8')],_['omit'](_0x4310fd['body'],[_0x0fcf('0xa8'),'id'])||{})[_0x0fcf('0xae')](function(){return db[_0x0fcf('0xaf')][_0x0fcf('0xac')]({'attributes':['id',_0x0fcf('0x2b'),_0x0fcf('0xb0')],'where':{'id':_0x4310fd[_0x0fcf('0xa4')][_0x0fcf('0xa8')]}});})[_0x0fcf('0x26')](function(_0x1a8991){socket[_0x0fcf('0xb1')](_0x0fcf('0xb2'),{'id':Number(_0x4310fd[_0x0fcf('0x9e')]['id']),'tags':_0x1a8991||[]});return{'id':Number(_0x4310fd[_0x0fcf('0x9e')]['id']),'tags':_0x1a8991||[]};});}})[_0x0fcf('0x26')](respondWithResult(_0x142a45,null))[_0x0fcf('0x9c')](handleError(_0x142a45,null));};exports['removeTags']=function(_0x5da695,_0x427c18,_0x29d642){return db[_0x0fcf('0x9f')][_0x0fcf('0xa2')]({'where':{'id':_0x5da695[_0x0fcf('0x9e')]['id']}})[_0x0fcf('0x26')](handleEntityNotFound(_0x427c18,null))['then'](function(_0x16b1e2){if(_0x16b1e2){return _0x16b1e2['removeTags'](_0x5da695[_0x0fcf('0x30')]['ids']);}})['then'](respondWithStatusCode(_0x427c18,null))[_0x0fcf('0x9c')](handleError(_0x427c18,null));};exports[_0x0fcf('0xb3')]=function(_0xe72342,_0x5a5b50){var _0x5beacc=moment()[_0x0fcf('0xb4')]()[_0x0fcf('0x74')]();var _0x111178=path[_0x0fcf('0xb5')](config[_0x0fcf('0xb6')],'server',_0x0fcf('0xb7'),_0x0fcf('0xb8'));var _0x1a64e8=path[_0x0fcf('0xb5')](config[_0x0fcf('0xb6')],_0x0fcf('0xb9'),_0x0fcf('0xb7'),_0x0fcf('0xba'));var _0x1ec4d4=path[_0x0fcf('0xb5')](_0x111178,_0x5beacc);var _0x28b94f=util[_0x0fcf('0x53')](_0x0fcf('0xbb'),_0xe72342[_0x0fcf('0x9e')]['id'],_0x5beacc);var _0x36dd2e=path[_0x0fcf('0xb5')](_0x111178,_0x28b94f);var _0x4e80c7=![];return db['SmsInteraction']['find']({'where':{'id':_0xe72342[_0x0fcf('0x9e')]['id']},'include':[{'model':db['SmsMessage'],'as':_0x0fcf('0xbc'),'attributes':['id',_0x0fcf('0xa4'),'createdAt',_0x0fcf('0xbd'),'secret'],'include':[{'model':db[_0x0fcf('0xbe')],'as':'User','attributes':['id',_0x0fcf('0xbf')],'raw':!![]},{'model':db[_0x0fcf('0xc0')],'as':_0x0fcf('0xc1'),'attributes':['id',_0x0fcf('0xc2'),_0x0fcf('0xc3')],'raw':!![]}]},{'model':db[_0x0fcf('0xc4')],'as':'Account','attributes':['id',_0x0fcf('0x2b')]},{'model':db[_0x0fcf('0xbe')],'as':'Owner','attributes':['id',_0x0fcf('0xbf')]}]})['then'](handleEntityNotFound(_0x5a5b50,null))['then'](function(_0x205af2){if(_0x205af2){var _0x6c9166=_0x205af2[_0x0fcf('0xc5')]({'plain':!![]});_0x4e80c7=!![];var _0x3eec37={'format':'A4','border':_0x0fcf('0xc6'),'header':{'height':_0x0fcf('0xc7'),'contents':{'first':_0x0fcf('0xc8')}},'footer':{'height':_0x0fcf('0xc9'),'contents':{'default':util['format'](_0x0fcf('0xca'),util[_0x0fcf('0x53')](_0x0fcf('0xcb'),_0x0fcf('0xcc'),_0x6c9166['id']),moment()['format']('YYYY-MM-DD')[_0x0fcf('0x74')]())}}};fs[_0x0fcf('0xcd')](_0x1ec4d4);var _0x119aea={'channel':_0x0fcf('0xcc'),'account':_0x6c9166[_0x0fcf('0xce')]['name'],'agent':_0x6c9166['Owner']?_0x6c9166[_0x0fcf('0xcf')][_0x0fcf('0xbf')]:_0x0fcf('0xd0'),'createdAt':moment(_0x6c9166[_0x0fcf('0x6c')])['format'](_0x0fcf('0xaa'))[_0x0fcf('0x74')](),'closedAt':_0x6c9166['closed']?moment(_0x6c9166[_0x0fcf('0xd1')])[_0x0fcf('0x53')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0fcf('0x74')]():'','disposition':_0x6c9166[_0x0fcf('0xd2')],'messages':_(_0x6c9166[_0x0fcf('0xbc')])[_0x0fcf('0x6f')]({'secret':![]})[_0x0fcf('0x67')](function(_0x3e6783){return{'date':moment(_0x3e6783[_0x0fcf('0x6c')])['format'](_0x0fcf('0xaa'))[_0x0fcf('0x74')](),'sender':_0x3e6783[_0x0fcf('0xbd')]==='out'?_0x3e6783[_0x0fcf('0xbe')]?_0x3e6783[_0x0fcf('0xbe')][_0x0fcf('0xbf')]:_0x0fcf('0xd3'):_0x3e6783[_0x0fcf('0xc1')][_0x0fcf('0xc2')]+(_0x3e6783[_0x0fcf('0xc1')][_0x0fcf('0xc3')]?'\x20'+_0x3e6783[_0x0fcf('0xc1')][_0x0fcf('0xc3')]:''),'body':_0x3e6783[_0x0fcf('0xa4')],'direction':_0x3e6783['direction']===_0x0fcf('0xd4')?'A':'C','secret':_0x3e6783['secret']};})[_0x0fcf('0x50')]()};return ejs[_0x0fcf('0xd5')](path[_0x0fcf('0xb5')](config['root'],_0x0fcf('0xb9'),'views',_0x0fcf('0xd6')),{'interaction':_0x119aea})['then'](function(_0x1e8a19){return new BPromise(function(_0x1ead7e,_0x56bbcd){pdf[_0x0fcf('0xa3')](_0x1e8a19,_0x3eec37)['toFile'](path[_0x0fcf('0xb5')](_0x1ec4d4,_0x0fcf('0xd7')+_0x6c9166['id']+'-'+_0x5beacc+_0x0fcf('0xd8')),function(_0x5c2961,_0x467f82){if(_0x5c2961)return _0x56bbcd(_0x5c2961);_0x1ead7e(_0x467f82);});});});}})['then'](function(){if(_0x4e80c7){return new BPromise(function(_0x37f0dd,_0x46fafb){zipdir(_0x1ec4d4,{'saveTo':_0x36dd2e},function(_0x38de26,_0x371be6){if(_0x38de26)return _0x46fafb(_0x38de26);return _0x37f0dd(_0x371be6);});})[_0x0fcf('0x26')](function(){return new BPromise(function(_0x394831,_0x1ac087){rimraf(_0x1ec4d4,function(_0x3a6ae0){if(_0x3a6ae0)_0x1ac087(_0x3a6ae0);return _0x394831();});});})[_0x0fcf('0x26')](function(){return _0x5a5b50[_0x0fcf('0xb3')](_0x36dd2e,_0x28b94f,function(_0x4d8911){if(_0x4d8911){console[_0x0fcf('0xd9')](_0x0fcf('0xda'),_0x4d8911);}else{fs[_0x0fcf('0xdb')](_0x36dd2e);}});});}else{return _0x5a5b50[_0x0fcf('0x1c')](0xc8);}})['catch'](handleError(_0x5a5b50,null));};
\ No newline at end of file
+var _0x4975=['i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','TagId','tableAlias','and','\x20=\x20?','LIKE','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20IN\x20?','ContactId','\x20>\x20?','\x20<\x20?','map','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','split','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','group','Sequelize','QueryTypes','SELECT','clone','read','having','`Messages.count`\x20=\x200','%s\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','Messages.count','%s\x20=\x200','`Messages.count`\x20>\x200','count','sequelize','keyBy','a.key','Account.key','Contact.lastName','Contact.mobile','c.fax','Contact.fax','u.fullname','User.name','TagIds','groupBy','SmsInteractionId','Users','Tags','rows','catch','show','SmsInteraction','rawAttributes','includeAll','merge','options','find','create','body','params','describe','addMessage','SmsMessage','ids','omit','findOne','pick','include','findAll','setTags','spread','Tag','emit','removeTags','download','unix','root','server','files','tmp','transcript-%d-%s.zip','Messages','secret','User','fullname','CmContact','Contact','firstName','lastName','Owner','40px',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','mkdirSync','Sms','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','out','renderFile','views','downloadInteraction.html','toFile','transcript-','log','err','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','field','color','from','select','COUNT(*)','sms_messages','where','me.SmsInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','ui.UserId\x20=\x20i.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','expr','advancedFilter','parse','forEach','startOf','day','utc','format','endOf'];(function(_0x599b13,_0x18162a){var _0x575454=function(_0x42e046){while(--_0x42e046){_0x599b13['push'](_0x599b13['shift']());}};_0x575454(++_0x18162a);}(_0x4975,0x86));var _0x5497=function(_0x301732,_0x52a519){_0x301732=_0x301732-0x0;var _0x5fecc9=_0x4975[_0x301732];return _0x5fecc9;};'use strict';var pdf=require(_0x5497('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5497('0x1'));var zipdir=require(_0x5497('0x2'));var jsonpatch=require(_0x5497('0x3'));var rp=require(_0x5497('0x4'));var moment=require(_0x5497('0x5'));var BPromise=require(_0x5497('0x6'));var Mustache=require(_0x5497('0x7'));var util=require(_0x5497('0x8'));var path=require(_0x5497('0x9'));var sox=require(_0x5497('0xa'));var csv=require('to-csv');var ejs=require(_0x5497('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xf'));var querystring=require('querystring');var Papa=require(_0x5497('0x10'));var Redis=require(_0x5497('0x11'));var authService=require(_0x5497('0x12'));var qs=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require(_0x5497('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x5497('0x18')](config[_0x5497('0x19')],{'host':_0x5497('0x1a'),'port':0x18eb});var socket=require(_0x5497('0x1b'))(new Redis(config[_0x5497('0x19')]));require(_0x5497('0x1c'))[_0x5497('0x1d')](socket);function respondWithStatusCode(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xcc;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['sendStatus'](_0x363a5b);}return _0xaca97d[_0x5497('0x1e')](_0x363a5b)['end']();};}function respondWithResult(_0x4237a9,_0x2bfd8a){_0x2bfd8a=_0x2bfd8a||0xc8;return function(_0x19e5f3){if(_0x19e5f3){return _0x4237a9[_0x5497('0x1e')](_0x2bfd8a)[_0x5497('0x1f')](_0x19e5f3);}};}function respondWithFilteredResult(_0x4073e6,_0x2f2997){return function(_0x575f6b){if(_0x575f6b){var _0x56a788=_0x575f6b['count'],_0x3f4d20=_0x2f2997[_0x5497('0x20')],_0x1bf442=_0x2f2997[_0x5497('0x20')]+_0x2f2997[_0x5497('0x21')],_0x3a47fd;if(_0x1bf442>=_0x56a788){_0x1bf442=_0x56a788;_0x3a47fd=0xc8;}else{_0x3a47fd=0xce;}_0x4073e6[_0x5497('0x1e')](_0x3a47fd);return _0x4073e6[_0x5497('0x22')](_0x5497('0x23'),_0x3f4d20+'-'+_0x1bf442+'/'+_0x56a788)[_0x5497('0x1f')](_0x575f6b);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x24')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x25')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x26')](_0x4d1b27)[_0x5497('0x27')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x28')]()[_0x5497('0x27')](function(){_0x3b2fbc[_0x5497('0x1e')](0xcc)[_0x5497('0x29')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x2a')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x2b')](_0x34a1a5[_0x5497('0x2c')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x2d')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=db['SmsInteraction']['rawAttributes'];_0xc3465['model']=_[_0x5497('0x2e')](_0x1cf908);_0xc3465[_0x5497('0x2f')]=_[_0x5497('0x2e')](_0x39a2b7['query']);_0xc3465['filters']=_['intersection'](_0xc3465[_0x5497('0x30')],_0xc3465['query']);_0x5e9356[_0x5497('0x31')]=_[_0x5497('0x32')](_0xc3465[_0x5497('0x30')],qs['fields'](_0x39a2b7[_0x5497('0x2f')][_0x5497('0x33')]));_0x5e9356['attributes']=_0x5e9356[_0x5497('0x31')][_0x5497('0x34')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2f')][_0x5497('0x35')](_0x5497('0x36'))){_0x5e9356[_0x5497('0x21')]=qs[_0x5497('0x21')](_0x39a2b7['query'][_0x5497('0x21')]);_0x5e9356[_0x5497('0x20')]=qs['offset'](_0x39a2b7[_0x5497('0x2f')][_0x5497('0x20')]);}_0x5e9356[_0x5497('0x37')]=qs[_0x5497('0x38')](_0x39a2b7[_0x5497('0x2f')][_0x5497('0x38')]);_0x5e9356['where']=qs[_0x5497('0x39')](_['pick'](_0x39a2b7[_0x5497('0x2f')],_0xc3465[_0x5497('0x39')]));var _0x2751f5=[];var _0x5ab18c=squel['select']()[_0x5497('0x3a')]('id')[_0x5497('0x3a')](_0x5497('0x2d'))[_0x5497('0x3a')](_0x5497('0x3b'))[_0x5497('0x3c')]('tools_tags');var _0x2c5c3a=squel[_0x5497('0x3d')]()[_0x5497('0x3a')](_0x5497('0x3e'))[_0x5497('0x3c')](_0x5497('0x3f'),'me')[_0x5497('0x40')](_0x5497('0x41'))[_0x5497('0x40')]('me.direction\x20=\x20\x27in\x27')[_0x5497('0x40')](_0x5497('0x42'));var _0x1e9616=squel[_0x5497('0x3d')]()[_0x5497('0x3a')](_0x5497('0x43'))[_0x5497('0x3a')]('ui.SmsInteractionId')[_0x5497('0x3c')](_0x5497('0x44'),'ui')[_0x5497('0x45')](_0x5497('0x46'),'u',_0x5497('0x47'));var _0x125526=squel[_0x5497('0x3d')]()['from'](_0x5497('0x48'),'i')[_0x5497('0x45')](_0x5497('0x44'),'ui',_0x5497('0x49'))[_0x5497('0x45')](_0x5497('0x46'),'u',_0x5497('0x47'))[_0x5497('0x45')](_0x5497('0x4a'),'c',_0x5497('0x4b'))['left_join'](_0x5497('0x46'),'o','o.id\x20=\x20i.UserId')[_0x5497('0x45')](_0x5497('0x4c'),'a',_0x5497('0x4d'))[_0x5497('0x45')](_0x5497('0x3f'),'me','me.SmsInteractionId\x20=\x20i.id');var _0x1f7c90=squel[_0x5497('0x4e')]();if(_0x39a2b7['query'][_0x5497('0x4f')]){var _0x46a700=JSON[_0x5497('0x50')](_0x39a2b7['query'][_0x5497('0x4f')]);_[_0x5497('0x2e')](_0x46a700)[_0x5497('0x51')](function(_0x3a852a){var _0xbf2f0=_0x46a700[_0x3a852a];if(_0x3a852a==='createdAt'){var _0x495068=moment(_0xbf2f0['value']['dateStart'])[_0x5497('0x52')](_0x5497('0x53'))[_0x5497('0x54')]()[_0x5497('0x55')]();var _0x3cb32c=moment(_0x3cb32c)[_0x5497('0x54')]()[_0x5497('0x56')](_0x5497('0x53'))[_0x5497('0x55')]();_0x1f7c90['and'](_0x5497('0x57'),_0x495068,_0x3cb32c);}else{if(_[_0x5497('0x58')](_0xbf2f0[_0x5497('0x59')])){_0xbf2f0['condition'][_0x5497('0x51')](function(_0x530475){switch(_0xbf2f0[_0x5497('0x59')][_0x5497('0x5a')]){case'IS':if(_0x3a852a!==_0x5497('0x5b')&&_0x3a852a!=='Messages.count'){if(_[_0x5497('0x58')](_0xbf2f0[_0x5497('0x5a')])&&_0xbf2f0['value'][_0x5497('0x34')]>0x1){_0x1f7c90['and'](_0xbf2f0[_0x5497('0x5c')]+'.'+_0x3a852a+'\x20IN\x20?',_0xbf2f0[_0x5497('0x5a')]);}else{_0x1f7c90[_0x5497('0x5d')](_0xbf2f0[_0x5497('0x5c')]+'.'+_0x3a852a+_0x5497('0x5e'),_0xbf2f0[_0x5497('0x5a')][0x0]);}}break;case'=':_0x1f7c90[_0x5497('0x5d')](_0xbf2f0[_0x5497('0x5c')]+'.'+_0x3a852a+_0x5497('0x5e'),_0xbf2f0['value']);break;case _0x5497('0x5f'):if(_0x3a852a==='ContactId'){_0x1f7c90['and'](_0x5497('0x60')+_0x5497('0x61'),'%'+_0xbf2f0['value']+'%');_0x1f7c90['or'](_0x5497('0x62')+_0x5497('0x61'),'%'+_0xbf2f0[_0x5497('0x5a')]+'%');_0x1f7c90['or'](_0x5497('0x63')+'\x20LIKE\x20?','%'+_0xbf2f0[_0x5497('0x5a')]+'%');}else{_0x1f7c90['and'](_0xbf2f0['tableAlias']+'.'+_0x3a852a+_0x5497('0x61'),'%'+_0xbf2f0[_0x5497('0x5a')]+'%');}break;case'>':_0x1f7c90[_0x5497('0x5d')](_0xbf2f0['tableAlias']+'.'+_0x3a852a+'\x20>\x20?',_0xbf2f0[_0x5497('0x5a')]);break;case'<':_0x1f7c90['and'](_0xbf2f0[_0x5497('0x5c')]+'.'+_0x3a852a+'\x20<\x20?',_0xbf2f0[_0x5497('0x5a')]);break;}});}else{switch(_0xbf2f0['condition'][_0x5497('0x5a')]){case'IS':if(_0x3a852a!==_0x5497('0x5b')&&_0x3a852a!=='Messages.count'){if(_[_0x5497('0x58')](_0xbf2f0['value'])&&_0xbf2f0['value'][_0x5497('0x34')]>0x1){_0x1f7c90[_0x5497('0x5d')](_0xbf2f0['tableAlias']+'.'+_0x3a852a+_0x5497('0x64'),_0xbf2f0[_0x5497('0x5a')]);}else{_0x1f7c90[_0x5497('0x5d')](_0xbf2f0[_0x5497('0x5c')]+'.'+_0x3a852a+_0x5497('0x5e'),_0xbf2f0[_0x5497('0x5a')][0x0]);}}break;case'=':_0x1f7c90['and'](_0xbf2f0[_0x5497('0x5c')]+'.'+_0x3a852a+'\x20=\x20?',_0xbf2f0['value']);break;case'LIKE':if(_0x3a852a===_0x5497('0x65')){_0x1f7c90[_0x5497('0x5d')](_0x5497('0x60')+'\x20LIKE\x20?','%'+_0xbf2f0[_0x5497('0x5a')]+'%');_0x1f7c90['or']('c.lastName'+'\x20LIKE\x20?','%'+_0xbf2f0[_0x5497('0x5a')]+'%');_0x1f7c90['or'](_0x5497('0x63')+_0x5497('0x61'),'%'+_0xbf2f0[_0x5497('0x5a')]+'%');}else{_0x1f7c90[_0x5497('0x5d')](_0xbf2f0[_0x5497('0x5c')]+'.'+_0x3a852a+'\x20LIKE\x20?','%'+_0xbf2f0[_0x5497('0x5a')]+'%');}break;case'>':_0x1f7c90[_0x5497('0x5d')](_0xbf2f0[_0x5497('0x5c')]+'.'+_0x3a852a+_0x5497('0x66'),_0xbf2f0['value']);break;case'<':_0x1f7c90[_0x5497('0x5d')](_0xbf2f0[_0x5497('0x5c')]+'.'+_0x3a852a+_0x5497('0x67'),_0xbf2f0[_0x5497('0x5a')]);break;}}}});}else{var _0x5823f6=_(Object[_0x5497('0x2e')](_0x39a2b7[_0x5497('0x2f')]))[_0x5497('0x68')](function(_0x542bcf){return _0x1cf908[_0x5497('0x35')](_0x542bcf)?_0x542bcf:undefined;})['filter'](function(_0x5b4e84){return!_['isNil'](_0x5b4e84);})[_0x5497('0x5a')]();if(!_[_0x5497('0x69')](_0x5823f6)){_0x5823f6[_0x5497('0x51')](function(_0x4e7d4c){if(_0x4e7d4c===_0x5497('0x6a')){_0x125526[_0x5497('0x40')](_0x5497('0x6b'),[][_0x5497('0x6c')](_0x39a2b7['query'][_0x4e7d4c]));}else if(_0x4e7d4c===_0x5497('0x6d')){var _0x43b681=JSON[_0x5497('0x50')](_0x39a2b7['query'][_0x4e7d4c])[_0x5497('0x6e')];var _0x465bed=JSON[_0x5497('0x50')](_0x39a2b7[_0x5497('0x2f')][_0x4e7d4c])[_0x5497('0x6f')];_0x125526[_0x5497('0x40')](_0x5497('0x57'),_0x43b681,_0x465bed);}else{_0x125526['where']('i.'+_0x4e7d4c+_0x5497('0x5e'),_0x39a2b7[_0x5497('0x2f')][_0x4e7d4c]);}});}if(_0x39a2b7[_0x5497('0x2f')][_0x5497('0x70')]){var _0x4b6eaf=_0x39a2b7['query']['filter'][_0x5497('0x71')]('\x5c','\x5c\x5c')[_0x5497('0x71')]('\x27\x27',_0x5497('0x72'));if(qs['isNumeric'](_0x4b6eaf)){_0x1f7c90['or'](_0x5497('0x73'),_0x4b6eaf+'%')['or'](_0x5497('0x74'),_0x4b6eaf+'%');}else{var _0x3c1363=[];_0x4b6eaf[_0x5497('0x75')]('\x20')[_0x5497('0x51')](function(_0x4338d4){_0x3c1363[_0x5497('0x76')]('+'+_0x4338d4[_0x5497('0x77')]());});var _0x21da3d=_0x3c1363[_0x5497('0x78')]('\x20');_0x1f7c90['or'](_0x5497('0x79'),_0x21da3d)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4b6eaf+'%');}}}_0x125526[_0x5497('0x40')](_0x1f7c90);if(_0x5e9356[_0x5497('0x37')]){_0x5e9356[_0x5497('0x37')]['forEach'](function(_0x5794ff){_0x125526['order']('i.'+_0x5794ff[0x0],_0x5794ff[0x1]===_0x5497('0x7a')?![]:!![]);});}_0x125526[_0x5497('0x7b')]('i.id');var _0x2c67d7={'type':db[_0x5497('0x7c')][_0x5497('0x7d')][_0x5497('0x7e')],'raw':!![]};var _0x535dba=_0x125526[_0x5497('0x7f')]()[_0x5497('0x3a')](_0x5497('0x3e'));if(!_0x39a2b7['query'][_0x5497('0x4f')]){if(_0x39a2b7[_0x5497('0x2f')]['read']){if(_0x39a2b7[_0x5497('0x2f')][_0x5497('0x80')]==0x1){_0x535dba[_0x5497('0x40')](util['format']('%s\x20=\x200',_0x2c5c3a[_0x5497('0x77')]()));_0x125526[_0x5497('0x81')](_0x5497('0x82'));}else{_0x535dba[_0x5497('0x40')](util[_0x5497('0x55')](_0x5497('0x83'),_0x2c5c3a[_0x5497('0x77')]()));_0x125526['having']('`Messages.count`\x20>\x200');}}if(_0x39a2b7[_0x5497('0x2f')][_0x5497('0x84')]){var _0x540362=_[_0x5497('0x58')](_0x39a2b7[_0x5497('0x2f')][_0x5497('0x84')])?_0x39a2b7['query'][_0x5497('0x84')]:new Array(_0x39a2b7[_0x5497('0x2f')]['tag']);var _0x338957=squel[_0x5497('0x4e')]();_0x540362[_0x5497('0x51')](function(_0x42d745){_0x338957['or'](_0x5497('0x85'),'%,'+_0x42d745+',%');});_0x125526['having'](_0x338957);_0x535dba[_0x5497('0x45')](_0x5497('0x86'),'it',_0x5497('0x87'));_0x535dba[_0x5497('0x45')](_0x5497('0x88'),'t','t.id\x20=\x20it.TagId');_0x535dba[_0x5497('0x40')](_0x5497('0x89'),_0x540362);}}else{var _0x46a700=JSON[_0x5497('0x50')](_0x39a2b7['query'][_0x5497('0x4f')]);_[_0x5497('0x2e')](_0x46a700)['forEach'](function(_0xb72eed){var _0x40dc61=_0x46a700[_0xb72eed];if(_0xb72eed===_0x5497('0x5b')){var _0x3a8cf9=_0x40dc61['value'];var _0x547de7=squel['expr']();_0x3a8cf9['forEach'](function(_0x594761){_0x547de7['or'](_0x5497('0x85'),'%,'+_0x594761+',%');});_0x125526[_0x5497('0x81')](_0x547de7);_0x535dba[_0x5497('0x45')](_0x5497('0x8a'),'it',_0x5497('0x8b'));_0x535dba['left_join']('tools_tags','t',_0x5497('0x8c'));_0x535dba[_0x5497('0x40')](_0x5497('0x89'),_0x3a8cf9);}else if(_0xb72eed===_0x5497('0x8d')){if(_0x40dc61[_0x5497('0x5a')][_0x5497('0x34')]===0x1){if(_0x40dc61[_0x5497('0x5a')][0x0]===0x1){_0x535dba[_0x5497('0x40')](util[_0x5497('0x55')](_0x5497('0x8e'),_0x2c5c3a['toString']()));_0x125526[_0x5497('0x81')](_0x5497('0x82'));}else{_0x535dba[_0x5497('0x40')](util[_0x5497('0x55')](_0x5497('0x83'),_0x2c5c3a[_0x5497('0x77')]()));_0x125526['having'](_0x5497('0x8f'));}}}});}db['sequelize'][_0x5497('0x2f')](_0x535dba[_0x5497('0x77')](),_0x2c67d7)[_0x5497('0x27')](function(_0x5b0f9d){_0xb14593['count']=_0x5b0f9d[_0x5497('0x34')];if(_0xb14593[_0x5497('0x90')]===0x0)return[];return db[_0x5497('0x91')][_0x5497('0x2f')](_0x5ab18c[_0x5497('0x77')](),_0x2c67d7)[_0x5497('0x27')](function(_0x2a1d6e){_0x2751f5=_[_0x5497('0x92')](_0x2a1d6e,'id');_0x2c67d7=_['merge'](_0x2c67d7,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x125526['field'](_0x2c5c3a,_0x5497('0x8d'));_0x125526[_0x5497('0x3a')](_0x5497('0x93'),_0x5497('0x94'));_0x125526['field']('i.*');_0x125526[_0x5497('0x3a')](_0x5497('0x60'),'Contact.firstName');_0x125526[_0x5497('0x3a')](_0x5497('0x62'),_0x5497('0x95'));_0x125526[_0x5497('0x3a')]('c.email','Contact.email');_0x125526['field']('c.phone','Contact.phone');_0x125526[_0x5497('0x3a')]('c.mobile',_0x5497('0x96'));_0x125526['field'](_0x5497('0x97'),_0x5497('0x98'));_0x125526[_0x5497('0x3a')](_0x5497('0x99'),_0x5497('0x9a'));_0x125526[_0x5497('0x3a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5497('0x9b'));_0x125526['left_join'](_0x5497('0x86'),'it',_0x5497('0x87'));_0x125526[_0x5497('0x45')](_0x5497('0x88'),'t',_0x5497('0x8c'));_0x125526[_0x5497('0x21')](_0x5e9356[_0x5497('0x21')]);_0x125526[_0x5497('0x20')](_0x5e9356[_0x5497('0x20')]);return db[_0x5497('0x91')]['query'](_0x125526[_0x5497('0x77')](),_0x2c67d7);})['then'](function(_0x41ec68){_0x1e9616[_0x5497('0x40')]('ui.SmsInteractionId\x20IN\x20?',_[_0x5497('0x68')](_0x41ec68,'id'));return db[_0x5497('0x91')][_0x5497('0x2f')](_0x1e9616[_0x5497('0x77')](),_0x2c67d7)[_0x5497('0x27')](function(_0x4641ae){var _0x3e0b9f=_[_0x5497('0x9c')](_0x4641ae,_0x5497('0x9d'));_0x41ec68[_0x5497('0x51')](function(_0x208a62){if(_0x3e0b9f[_0x208a62['id']]){_0x208a62[_0x5497('0x9e')]=_[_0x5497('0x68')](_0x3e0b9f[_0x208a62['id']],function(_0x22426e){return{'id':_0x22426e['id']};});}if(_0x208a62['TagIds']){_0x208a62[_0x5497('0x9f')]=[];_0x208a62[_0x5497('0x9b')][_0x5497('0x75')](',')[_0x5497('0x51')](function(_0xab602f){_0x208a62['Tags'][_0x5497('0x76')](_0x2751f5[_0xab602f]);});}delete _0x208a62[_0x5497('0x9b')];});return _0x41ec68;});});})['then'](function(_0x58fe2a){_0xb14593[_0x5497('0xa0')]=_0x58fe2a;return _0xb14593;})[_0x5497('0x27')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0xa1')](handleError(_0x48d146,null));};exports[_0x5497('0xa2')]=function(_0x3d649c,_0x585ad6){var _0x4881f2={'raw':![],'where':{'id':_0x3d649c['params']['id']}},_0x3344fe={};_0x3344fe[_0x5497('0x30')]=_[_0x5497('0x2e')](db[_0x5497('0xa3')][_0x5497('0xa4')]);_0x3344fe[_0x5497('0x2f')]=_[_0x5497('0x2e')](_0x3d649c['query']);_0x3344fe['filters']=_[_0x5497('0x32')](_0x3344fe[_0x5497('0x30')],_0x3344fe[_0x5497('0x2f')]);_0x4881f2['attributes']=_[_0x5497('0x32')](_0x3344fe['model'],qs[_0x5497('0x33')](_0x3d649c['query']['fields']));_0x4881f2[_0x5497('0x31')]=_0x4881f2[_0x5497('0x31')]['length']?_0x4881f2[_0x5497('0x31')]:_0x3344fe[_0x5497('0x30')];if(_0x3d649c[_0x5497('0x2f')][_0x5497('0xa5')]){_0x4881f2['include']=[{'all':!![]}];}_0x4881f2=_[_0x5497('0xa6')]({},_0x4881f2,_0x3d649c[_0x5497('0xa7')]);return db[_0x5497('0xa3')][_0x5497('0xa8')](_0x4881f2)[_0x5497('0x27')](handleEntityNotFound(_0x585ad6,null))['then'](respondWithResult(_0x585ad6,null))[_0x5497('0xa1')](handleError(_0x585ad6,null));};exports['create']=function(_0x28aab8,_0xd4a0fa){return db[_0x5497('0xa3')][_0x5497('0xa9')](_0x28aab8[_0x5497('0xaa')],{})[_0x5497('0x27')](respondWithResult(_0xd4a0fa,0xc9))[_0x5497('0xa1')](handleError(_0xd4a0fa,null));};exports[_0x5497('0x26')]=function(_0x21a8c5,_0x1660b4){if(_0x21a8c5[_0x5497('0xaa')]['id']){delete _0x21a8c5['body']['id'];}return db[_0x5497('0xa3')][_0x5497('0xa8')]({'where':{'id':_0x21a8c5[_0x5497('0xab')]['id']}})[_0x5497('0x27')](handleEntityNotFound(_0x1660b4,null))[_0x5497('0x27')](saveUpdates(_0x21a8c5[_0x5497('0xaa')],null))[_0x5497('0x27')](respondWithResult(_0x1660b4,null))[_0x5497('0xa1')](handleError(_0x1660b4,null));};exports[_0x5497('0x28')]=function(_0x44318c,_0x270fba){return db['SmsInteraction'][_0x5497('0xa8')]({'where':{'id':_0x44318c[_0x5497('0xab')]['id']}})[_0x5497('0x27')](handleEntityNotFound(_0x270fba,null))[_0x5497('0x27')](removeEntity(_0x270fba,null))[_0x5497('0xa1')](handleError(_0x270fba,null));};exports[_0x5497('0xac')]=function(_0x27bc07,_0x1d15f5){return db[_0x5497('0xa3')][_0x5497('0xac')]()[_0x5497('0x27')](respondWithResult(_0x1d15f5,null))[_0x5497('0xa1')](handleError(_0x1d15f5,null));};exports[_0x5497('0xad')]=function(_0x86839a,_0x5b15a5,_0x5b58ae){return db[_0x5497('0xae')][_0x5497('0xa8')]({'where':{'id':_0x86839a[_0x5497('0xab')]['id']}})['then'](handleEntityNotFound(_0x5b15a5,null))[_0x5497('0x27')](function(_0x20a59f){if(_0x20a59f){return _0x20a59f[_0x5497('0xad')](_0x86839a[_0x5497('0xaa')][_0x5497('0xaf')],_[_0x5497('0xb0')](_0x86839a[_0x5497('0xaa')],[_0x5497('0xaf'),'id'])||{});}})['then'](respondWithResult(_0x5b15a5,null))['catch'](handleError(_0x5b15a5,null));};exports['getMessages']=function(_0x1ce864,_0xba8dcd,_0x4dab6a){var _0x649ca7={'raw':![],'where':{}};var _0x27f42b={};var _0x1bef85={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x5497('0xb1')]({'where':{'id':_0x1ce864['params']['id']}})[_0x5497('0x27')](handleEntityNotFound(_0xba8dcd,null))[_0x5497('0x27')](function(_0x2a5db8){if(_0x2a5db8){_0x27f42b['model']=_[_0x5497('0x2e')](db[_0x5497('0xae')]['rawAttributes']);_0x27f42b[_0x5497('0x2f')]=_[_0x5497('0x2e')](_0x1ce864[_0x5497('0x2f')]);_0x27f42b['filters']=_[_0x5497('0x32')](_0x27f42b[_0x5497('0x30')],_0x27f42b[_0x5497('0x2f')]);_0x649ca7[_0x5497('0x31')]=_[_0x5497('0x32')](_0x27f42b[_0x5497('0x30')],qs[_0x5497('0x33')](_0x1ce864[_0x5497('0x2f')][_0x5497('0x33')]));_0x649ca7[_0x5497('0x31')]=_0x649ca7[_0x5497('0x31')][_0x5497('0x34')]?_0x649ca7[_0x5497('0x31')]:_0x27f42b[_0x5497('0x30')];if(!_0x1ce864[_0x5497('0x2f')]['hasOwnProperty'](_0x5497('0x36'))){_0x649ca7['limit']=qs[_0x5497('0x21')](_0x1ce864[_0x5497('0x2f')]['limit']);_0x649ca7['offset']=qs[_0x5497('0x20')](_0x1ce864[_0x5497('0x2f')][_0x5497('0x20')]);}_0x649ca7[_0x5497('0x37')]=qs['sort'](_0x1ce864[_0x5497('0x2f')][_0x5497('0x38')]);_0x649ca7['where']=qs['filters'](_[_0x5497('0xb2')](_0x1ce864[_0x5497('0x2f')],_0x27f42b[_0x5497('0x39')]));_0x649ca7[_0x5497('0x40')][_0x5497('0x9d')]=_0x2a5db8['id'];if(_0x1ce864['query']['filter']){_0x649ca7[_0x5497('0x40')]=_[_0x5497('0xa6')](_0x649ca7['where'],{'$or':_[_0x5497('0x68')](_0x649ca7[_0x5497('0x31')],function(_0x2e09ad){var _0x24f64c={};_0x24f64c[_0x2e09ad]={'$like':'%'+_0x1ce864[_0x5497('0x2f')][_0x5497('0x70')]+'%'};return _0x24f64c;})});}if(_0x1ce864[_0x5497('0x2f')][_0x5497('0x6e')]){var _0x2d5cc1=_0x1ce864['query']['$gte'][_0x5497('0x75')](',');var _0x450744={};_0x450744[_0x2d5cc1[0x0]]={'$gte':moment(_0x2d5cc1[0x1])[_0x5497('0x55')]('YYYY-MM-DD\x20HH:mm:ss')};_0x649ca7[_0x5497('0x40')]=_[_0x5497('0xa6')](_0x649ca7[_0x5497('0x40')],_0x450744);}_0x649ca7=_['merge']({},_0x649ca7,_0x1ce864[_0x5497('0xa7')]);return db[_0x5497('0xae')]['count']({'where':_0x649ca7['where']})[_0x5497('0x27')](function(_0x327474){_0x1bef85['count']=_0x327474;if(_0x1ce864[_0x5497('0x2f')]['includeAll']){_0x649ca7[_0x5497('0xb3')]=[{'all':!![]}];}return db[_0x5497('0xae')][_0x5497('0xb4')](_0x649ca7);})[_0x5497('0x27')](function(_0x31d47d){_0x1bef85[_0x5497('0xa0')]=_0x31d47d;return _0x1bef85;});}})[_0x5497('0x27')](respondWithFilteredResult(_0xba8dcd,_0x649ca7))['catch'](handleError(_0xba8dcd,null));};exports['addTags']=function(_0x3f02fc,_0x3cf8e1,_0x4ec65c){return db['SmsInteraction'][_0x5497('0xa8')]({'where':{'id':_0x3f02fc[_0x5497('0xab')]['id']}})[_0x5497('0x27')](handleEntityNotFound(_0x3cf8e1,null))[_0x5497('0x27')](function(_0x1eda10){if(_0x1eda10){return _0x1eda10[_0x5497('0xb5')](_0x3f02fc['body'][_0x5497('0xaf')],_[_0x5497('0xb0')](_0x3f02fc[_0x5497('0xaa')],[_0x5497('0xaf'),'id'])||{})[_0x5497('0xb6')](function(){return db[_0x5497('0xb7')]['findAll']({'attributes':['id',_0x5497('0x2d'),'color'],'where':{'id':_0x3f02fc[_0x5497('0xaa')][_0x5497('0xaf')]}});})[_0x5497('0x27')](function(_0x5cbacc){socket[_0x5497('0xb8')]('smsInteractionTags:save',{'id':Number(_0x3f02fc['params']['id']),'tags':_0x5cbacc||[]});return{'id':Number(_0x3f02fc[_0x5497('0xab')]['id']),'tags':_0x5cbacc||[]};});}})[_0x5497('0x27')](respondWithResult(_0x3cf8e1,null))['catch'](handleError(_0x3cf8e1,null));};exports[_0x5497('0xb9')]=function(_0x2852cb,_0x1ffcb4,_0x839eb2){return db[_0x5497('0xa3')][_0x5497('0xa8')]({'where':{'id':_0x2852cb[_0x5497('0xab')]['id']}})[_0x5497('0x27')](handleEntityNotFound(_0x1ffcb4,null))[_0x5497('0x27')](function(_0x5e584e){if(_0x5e584e){return _0x5e584e[_0x5497('0xb9')](_0x2852cb[_0x5497('0x2f')][_0x5497('0xaf')]);}})[_0x5497('0x27')](respondWithStatusCode(_0x1ffcb4,null))[_0x5497('0xa1')](handleError(_0x1ffcb4,null));};exports[_0x5497('0xba')]=function(_0x273e07,_0x1285c1){var _0x1cae63=moment()[_0x5497('0xbb')]()[_0x5497('0x77')]();var _0x217341=path[_0x5497('0x78')](config[_0x5497('0xbc')],_0x5497('0xbd'),_0x5497('0xbe'),_0x5497('0xbf'));var _0x1aa446=path[_0x5497('0x78')](config['root'],_0x5497('0xbd'),_0x5497('0xbe'),'attachments');var _0x586700=path[_0x5497('0x78')](_0x217341,_0x1cae63);var _0x5d01c0=util[_0x5497('0x55')](_0x5497('0xc0'),_0x273e07[_0x5497('0xab')]['id'],_0x1cae63);var _0x2d185e=path[_0x5497('0x78')](_0x217341,_0x5d01c0);var _0x2fc2b5=![];return db[_0x5497('0xa3')][_0x5497('0xa8')]({'where':{'id':_0x273e07[_0x5497('0xab')]['id']},'include':[{'model':db[_0x5497('0xae')],'as':_0x5497('0xc1'),'attributes':['id','body',_0x5497('0x6d'),'direction',_0x5497('0xc2')],'include':[{'model':db[_0x5497('0xc3')],'as':_0x5497('0xc3'),'attributes':['id',_0x5497('0xc4')],'raw':!![]},{'model':db[_0x5497('0xc5')],'as':_0x5497('0xc6'),'attributes':['id',_0x5497('0xc7'),_0x5497('0xc8')],'raw':!![]}]},{'model':db['SmsAccount'],'as':'Account','attributes':['id',_0x5497('0x2d')]},{'model':db[_0x5497('0xc3')],'as':_0x5497('0xc9'),'attributes':['id',_0x5497('0xc4')]}]})[_0x5497('0x27')](handleEntityNotFound(_0x1285c1,null))['then'](function(_0xda1230){if(_0xda1230){var _0x5a1f5a=_0xda1230['get']({'plain':!![]});_0x2fc2b5=!![];var _0x4f112a={'format':'A4','border':'10px','header':{'height':_0x5497('0xca'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':'30px','contents':{'default':util[_0x5497('0x55')](_0x5497('0xcb'),util[_0x5497('0x55')](_0x5497('0xcc'),'Sms',_0x5a1f5a['id']),moment()[_0x5497('0x55')]('YYYY-MM-DD')['toString']())}}};fs[_0x5497('0xcd')](_0x586700);var _0x51e6ba={'channel':_0x5497('0xce'),'account':_0x5a1f5a[_0x5497('0xcf')][_0x5497('0x2d')],'agent':_0x5a1f5a['Owner']?_0x5a1f5a[_0x5497('0xc9')]['fullname']:_0x5497('0xd0'),'createdAt':moment(_0x5a1f5a[_0x5497('0x6d')])[_0x5497('0x55')](_0x5497('0xd1'))[_0x5497('0x77')](),'closedAt':_0x5a1f5a[_0x5497('0xd2')]?moment(_0x5a1f5a[_0x5497('0xd3')])[_0x5497('0x55')](_0x5497('0xd1'))['toString']():'','disposition':_0x5a1f5a[_0x5497('0xd4')],'messages':_(_0x5a1f5a[_0x5497('0xc1')])[_0x5497('0x70')]({'secret':![]})['map'](function(_0x273940){return{'date':moment(_0x273940[_0x5497('0x6d')])[_0x5497('0x55')](_0x5497('0xd1'))[_0x5497('0x77')](),'sender':_0x273940['direction']===_0x5497('0xd5')?_0x273940[_0x5497('0xc3')]?_0x273940[_0x5497('0xc3')][_0x5497('0xc4')]:'System':_0x273940[_0x5497('0xc6')][_0x5497('0xc7')]+(_0x273940[_0x5497('0xc6')][_0x5497('0xc8')]?'\x20'+_0x273940[_0x5497('0xc6')][_0x5497('0xc8')]:''),'body':_0x273940[_0x5497('0xaa')],'direction':_0x273940['direction']===_0x5497('0xd5')?'A':'C','secret':_0x273940['secret']};})[_0x5497('0x5a')]()};return ejs[_0x5497('0xd6')](path['join'](config['root'],'server',_0x5497('0xd7'),_0x5497('0xd8')),{'interaction':_0x51e6ba})[_0x5497('0x27')](function(_0x420d15){return new BPromise(function(_0x5b4e68,_0x2bc1c1){pdf[_0x5497('0xa9')](_0x420d15,_0x4f112a)[_0x5497('0xd9')](path[_0x5497('0x78')](_0x586700,_0x5497('0xda')+_0x5a1f5a['id']+'-'+_0x1cae63+'.pdf'),function(_0x5000e4,_0x56e241){if(_0x5000e4)return _0x2bc1c1(_0x5000e4);_0x5b4e68(_0x56e241);});});});}})[_0x5497('0x27')](function(){if(_0x2fc2b5){return new BPromise(function(_0x1fa3a4,_0x464c97){zipdir(_0x586700,{'saveTo':_0x2d185e},function(_0x267861,_0x5cd164){if(_0x267861)return _0x464c97(_0x267861);return _0x1fa3a4(_0x5cd164);});})['then'](function(){return new BPromise(function(_0x3cad8a,_0x4afce7){rimraf(_0x586700,function(_0x2e00e6){if(_0x2e00e6)_0x4afce7(_0x2e00e6);return _0x3cad8a();});});})['then'](function(){return _0x1285c1[_0x5497('0xba')](_0x2d185e,_0x5d01c0,function(_0x5b3441){if(_0x5b3441){console[_0x5497('0xdb')](_0x5497('0xdc'),_0x5b3441);}else{fs['unlinkSync'](_0x2d185e);}});});}else{return _0x1285c1[_0x5497('0x2a')](0xc8);}})[_0x5497('0xa1')](handleError(_0x1285c1,null));};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js
index 0251646..c900812 100644
--- a/server/api/smsInteraction/smsInteraction.events.js
+++ b/server/api/smsInteraction/smsInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdc4e=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5cca33,_0x1a1607){var _0x1fbc89=function(_0x22312e){while(--_0x22312e){_0x5cca33['push'](_0x5cca33['shift']());}};_0x1fbc89(++_0x1a1607);}(_0xdc4e,0x1cd));var _0xedc4=function(_0x1b46fb,_0x57ba0a){_0x1b46fb=_0x1b46fb-0x0;var _0x15b9c6=_0xdc4e[_0x1b46fb];return _0x15b9c6;};'use strict';var EventEmitter=require(_0xedc4('0x0'));var SmsInteraction=require(_0xedc4('0x1'))['db']['SmsInteraction'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xedc4('0x2')](0x0);var events={'afterCreate':_0xedc4('0x3'),'afterUpdate':'update','afterDestroy':_0xedc4('0x4')};function emitEvent(_0x4cbaf2){return function(_0x1c8d8c,_0x3e4cbc,_0x13f464){SmsInteractionEvents[_0xedc4('0x5')](_0x4cbaf2+':'+_0x1c8d8c['id'],_0x1c8d8c);SmsInteractionEvents['emit'](_0x4cbaf2,_0x1c8d8c);_0x13f464(null);};}for(var e in events){if(events[_0xedc4('0x6')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xedc4('0x7')]=SmsInteractionEvents;
\ No newline at end of file
+var _0xa73d=['hook','exports','../../mysqldb','SmsInteraction','save','update','remove','emit','hasOwnProperty'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa73d,0x1b2));var _0xda73=function(_0x23c4e3,_0x8e350e){_0x23c4e3=_0x23c4e3-0x0;var _0x5b4454=_0xa73d[_0x23c4e3];return _0x5b4454;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xda73('0x0'))['db'][_0xda73('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xda73('0x2'),'afterUpdate':_0xda73('0x3'),'afterDestroy':_0xda73('0x4')};function emitEvent(_0x40210c){return function(_0x437b73,_0x1da196,_0x27bc64){SmsInteractionEvents[_0xda73('0x5')](_0x40210c+':'+_0x437b73['id'],_0x437b73);SmsInteractionEvents[_0xda73('0x5')](_0x40210c,_0x437b73);_0x27bc64(null);};}for(var e in events){if(events[_0xda73('0x6')](e)){var event=events[e];SmsInteraction[_0xda73('0x7')](e,emitEvent(event));}}module[_0xda73('0x8')]=SmsInteractionEvents;
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js
index 0f5ea42..cf73b26 100644
--- a/server/api/smsInteraction/smsInteraction.model.js
+++ b/server/api/smsInteraction/smsInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6931=['changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define'];(function(_0x225ea2,_0x1cf40c){var _0x1247bf=function(_0x406658){while(--_0x406658){_0x225ea2['push'](_0x225ea2['shift']());}};_0x1247bf(++_0x1cf40c);}(_0x6931,0xb7));var _0x1693=function(_0x4c35a8,_0xb4be1c){_0x4c35a8=_0x4c35a8-0x0;var _0x402d59=_0x6931[_0x4c35a8];return _0x402d59;};'use strict';var _=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var logger=require(_0x1693('0x2'))(_0x1693('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1693('0x4'));var fs=require('fs');var path=require(_0x1693('0x5'));var rimraf=require(_0x1693('0x6'));var config=require(_0x1693('0x7'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0xf9873c,_0x3b8a78){return _0xf9873c[_0x1693('0x8')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x25ed0b,_0x5096c3,_0x506091){if(_0x25ed0b[_0x1693('0x9')]('closed')){_0x25ed0b['closedAt']=moment()[_0x1693('0xa')](_0x1693('0xb'));}_0x506091(null,_0x25ed0b);}}});};
\ No newline at end of file
+var _0xdd28=['define','SmsInteraction','changed','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd28,0x1d8));var _0x8dd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd28[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8dd2('0x0'));var util=require('util');var logger=require(_0x8dd2('0x1'))(_0x8dd2('0x2'));var moment=require('moment');var BPromise=require(_0x8dd2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dd2('0x4'));var rimraf=require(_0x8dd2('0x5'));var config=require(_0x8dd2('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x8dd2('0x7')]=function(_0x184303,_0x1b89b1){return _0x184303[_0x8dd2('0x8')](_0x8dd2('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b866a,_0x55da2f,_0x38b031){if(_0x2b866a[_0x8dd2('0xa')]('closed')){_0x2b866a['closedAt']=moment()['format'](_0x8dd2('0xb'));}_0x38b031(null,_0x2b866a);}}});};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js
index 5ef77b8..ab7e8b3 100644
--- a/server/api/smsInteraction/smsInteraction.rpc.js
+++ b/server/api/smsInteraction/smsInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf05c=['client','http','redis','defaults','localhost','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','SmsInteraction','update','options','attributes','UpdateSmsInteraction','AddTagsToSmsInteraction','where','addTags','body','omit','ids','AddTags','lodash','util','ioredis','rpc','../../config/environment'];(function(_0x5578c0,_0x4f9a4d){var _0x24ae5d=function(_0x2c004a){while(--_0x2c004a){_0x5578c0['push'](_0x5578c0['shift']());}};_0x24ae5d(++_0x4f9a4d);}(_0xf05c,0x12d));var _0xcf05=function(_0x204a46,_0x428ae9){_0x204a46=_0x204a46-0x0;var _0xcd8d81=_0xf05c[_0x204a46];return _0xcd8d81;};'use strict';var _=require(_0xcf05('0x0'));var util=require(_0xcf05('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf05('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcf05('0x3'));var config=require(_0xcf05('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xcf05('0x5')][_0xcf05('0x6')]({'port':0x232a});config[_0xcf05('0x7')]=_[_0xcf05('0x8')](config[_0xcf05('0x7')],{'host':_0xcf05('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcf05('0xa'))['register'](socket);function respondWithRpcPromise(_0x4b3426,_0x3b4826,_0x31188d){return new BPromise(function(_0x8bbcf2,_0x2a86e9){return client[_0xcf05('0xb')](_0x4b3426,_0x31188d)[_0xcf05('0xc')](function(_0x27244a){logger[_0xcf05('0xd')](_0xcf05('0xe'),_0x3b4826,_0xcf05('0xf'));logger[_0xcf05('0x10')](_0xcf05('0x11'),_0x3b4826,_0xcf05('0xf'),JSON[_0xcf05('0x12')](_0x27244a));if(_0x27244a['error']){if(_0x27244a[_0xcf05('0x13')]['code']===0x1f4){logger[_0xcf05('0x13')](_0xcf05('0xe'),_0x3b4826,_0x27244a['error'][_0xcf05('0x14')]);return _0x2a86e9(_0x27244a[_0xcf05('0x13')][_0xcf05('0x14')]);}logger[_0xcf05('0x13')](_0xcf05('0xe'),_0x3b4826,_0x27244a['error'][_0xcf05('0x14')]);return _0x8bbcf2(_0x27244a[_0xcf05('0x13')]['message']);}else{logger[_0xcf05('0xd')](_0xcf05('0xe'),_0x3b4826,'request\x20sent');_0x8bbcf2(_0x27244a['result']['message']);}})[_0xcf05('0x15')](function(_0x35d971){logger['error'](_0xcf05('0xe'),_0x3b4826,_0x35d971);_0x2a86e9(_0x35d971);});});}exports['UpdateSmsInteraction']=function(_0x4a4c9f){var _0x242192=this;return new Promise(function(_0x169901,_0x17cb0d){return db[_0xcf05('0x16')][_0xcf05('0x17')](_0x4a4c9f['body'],{'raw':_0x4a4c9f[_0xcf05('0x18')]?_0x4a4c9f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a4c9f[_0xcf05('0x18')]?_0x4a4c9f['options']['where']||null:null,'attributes':_0x4a4c9f[_0xcf05('0x18')]?_0x4a4c9f[_0xcf05('0x18')][_0xcf05('0x19')]||null:null,'limit':_0x4a4c9f['options']?_0x4a4c9f[_0xcf05('0x18')]['limit']||null:null})[_0xcf05('0xc')](function(_0x4abbf7){logger[_0xcf05('0xd')](_0xcf05('0x1a'),_0x4a4c9f);logger[_0xcf05('0x10')](_0xcf05('0x1a'),_0x4a4c9f,JSON[_0xcf05('0x12')](_0x4abbf7));_0x169901(_0x4abbf7);})[_0xcf05('0x15')](function(_0x5f3ee2){logger[_0xcf05('0x13')](_0xcf05('0x1a'),_0x5f3ee2[_0xcf05('0x14')],_0x4a4c9f);_0x17cb0d(_0x242192[_0xcf05('0x13')](0x1f4,_0x5f3ee2[_0xcf05('0x14')]));});});};exports[_0xcf05('0x1b')]=function(_0x2c404a){return new Promise(function(_0x25756d,_0x5005a9){return db[_0xcf05('0x16')]['find']({'where':_0x2c404a['options']?_0x2c404a[_0xcf05('0x18')][_0xcf05('0x1c')]||null:null})[_0xcf05('0xc')](function(_0x3ba32f){if(_0x3ba32f){return _0x3ba32f[_0xcf05('0x1d')](_0x2c404a[_0xcf05('0x1e')]['ids'],_[_0xcf05('0x1f')](_0x2c404a[_0xcf05('0x1e')],[_0xcf05('0x20'),'id'])||{});}})['spread'](function(_0x13a3c4){logger['info'](_0xcf05('0x21'),_0x2c404a);logger[_0xcf05('0x10')](_0xcf05('0x21'),_0x2c404a,JSON['stringify'](_0x13a3c4));_0x25756d(_0x13a3c4);})[_0xcf05('0x15')](function(_0x58e14e){logger['error'](_0xcf05('0x21'),_0x58e14e['message'],_0x2c404a);_0x5005a9(_this['error'](0x1f4,_0x58e14e['message']));});});};
\ No newline at end of file
+var _0x10c7=['omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','redis','defaults','localhost','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','AddTagsToSmsInteraction','find','ids'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x10c7,0x10d));var _0x710c=function(_0x374ba3,_0x4af646){_0x374ba3=_0x374ba3-0x0;var _0x51d852=_0x10c7[_0x374ba3];return _0x51d852;};'use strict';var _=require(_0x710c('0x0'));var util=require(_0x710c('0x1'));var moment=require(_0x710c('0x2'));var BPromise=require(_0x710c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x710c('0x4'));var db=require(_0x710c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x710c('0x6'))(_0x710c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x710c('0x8')]=_[_0x710c('0x9')](config[_0x710c('0x8')],{'host':_0x710c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x710c('0xb'))['register'](socket);function respondWithRpcPromise(_0x48bf2d,_0x2bc9db,_0x532979){return new BPromise(function(_0x5d911f,_0x15ade1){return client[_0x710c('0xc')](_0x48bf2d,_0x532979)[_0x710c('0xd')](function(_0x43eba2){logger[_0x710c('0xe')](_0x710c('0xf'),_0x2bc9db,_0x710c('0x10'));logger[_0x710c('0x11')](_0x710c('0x12'),_0x2bc9db,_0x710c('0x10'),JSON[_0x710c('0x13')](_0x43eba2));if(_0x43eba2[_0x710c('0x14')]){if(_0x43eba2[_0x710c('0x14')][_0x710c('0x15')]===0x1f4){logger[_0x710c('0x14')](_0x710c('0xf'),_0x2bc9db,_0x43eba2[_0x710c('0x14')][_0x710c('0x16')]);return _0x15ade1(_0x43eba2[_0x710c('0x14')][_0x710c('0x16')]);}logger[_0x710c('0x14')](_0x710c('0xf'),_0x2bc9db,_0x43eba2[_0x710c('0x14')][_0x710c('0x16')]);return _0x5d911f(_0x43eba2[_0x710c('0x14')][_0x710c('0x16')]);}else{logger[_0x710c('0xe')](_0x710c('0xf'),_0x2bc9db,_0x710c('0x10'));_0x5d911f(_0x43eba2[_0x710c('0x17')][_0x710c('0x16')]);}})[_0x710c('0x18')](function(_0xf2643b){logger[_0x710c('0x14')](_0x710c('0xf'),_0x2bc9db,_0xf2643b);_0x15ade1(_0xf2643b);});});}exports[_0x710c('0x19')]=function(_0x1792f8){var _0x4b384b=this;return new Promise(function(_0x3a1aa5,_0x2a2442){return db[_0x710c('0x1a')]['update'](_0x1792f8[_0x710c('0x1b')],{'raw':_0x1792f8[_0x710c('0x1c')]?_0x1792f8[_0x710c('0x1c')][_0x710c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1792f8[_0x710c('0x1c')]?_0x1792f8[_0x710c('0x1c')][_0x710c('0x1e')]||null:null,'attributes':_0x1792f8[_0x710c('0x1c')]?_0x1792f8[_0x710c('0x1c')][_0x710c('0x1f')]||null:null,'limit':_0x1792f8['options']?_0x1792f8['options']['limit']||null:null})['then'](function(_0x4eb96e){logger[_0x710c('0xe')](_0x710c('0x19'),_0x1792f8);logger[_0x710c('0x11')](_0x710c('0x19'),_0x1792f8,JSON[_0x710c('0x13')](_0x4eb96e));_0x3a1aa5(_0x4eb96e);})[_0x710c('0x18')](function(_0x3c15ea){logger['error'](_0x710c('0x19'),_0x3c15ea['message'],_0x1792f8);_0x2a2442(_0x4b384b[_0x710c('0x14')](0x1f4,_0x3c15ea[_0x710c('0x16')]));});});};exports[_0x710c('0x20')]=function(_0x58a49d){return new Promise(function(_0x22d4df,_0x9bb67a){return db['SmsInteraction'][_0x710c('0x21')]({'where':_0x58a49d[_0x710c('0x1c')]?_0x58a49d[_0x710c('0x1c')][_0x710c('0x1e')]||null:null})[_0x710c('0xd')](function(_0x4f1a07){if(_0x4f1a07){return _0x4f1a07['addTags'](_0x58a49d[_0x710c('0x1b')][_0x710c('0x22')],_[_0x710c('0x23')](_0x58a49d[_0x710c('0x1b')],[_0x710c('0x22'),'id'])||{});}})[_0x710c('0x24')](function(_0x57f722){logger[_0x710c('0xe')]('AddTags',_0x58a49d);logger['debug'](_0x710c('0x25'),_0x58a49d,JSON[_0x710c('0x13')](_0x57f722));_0x22d4df(_0x57f722);})[_0x710c('0x18')](function(_0x9a9de4){logger[_0x710c('0x14')]('AddTags',_0x9a9de4[_0x710c('0x16')],_0x58a49d);_0x9bb67a(_this[_0x710c('0x14')](0x1f4,_0x9a9de4[_0x710c('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js
index a27303b..a143425 100644
--- a/server/api/smsInteraction/smsInteraction.socket.js
+++ b/server/api/smsInteraction/smsInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1bd7=['update','emit','removeListener','length','smsInteraction:','./smsInteraction.events','remove'];(function(_0x3daa9d,_0x4d5b17){var _0x348d4b=function(_0x564e6e){while(--_0x564e6e){_0x3daa9d['push'](_0x3daa9d['shift']());}};_0x348d4b(++_0x4d5b17);}(_0x1bd7,0x9f));var _0x71bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1bd7[_0x2641f9];return _0x585741;};'use strict';var SmsInteractionEvents=require(_0x71bd('0x0'));var events=['save',_0x71bd('0x1'),_0x71bd('0x2')];function createListener(_0x579d1d,_0x31ed57){return function(_0x40a50c){_0x31ed57[_0x71bd('0x3')](_0x579d1d,_0x40a50c);};}function removeListener(_0x22d4f2,_0x2c0dee){return function(){SmsInteractionEvents[_0x71bd('0x4')](_0x22d4f2,_0x2c0dee);};}exports['register']=function(_0x133e0b){for(var _0x36c67d=0x0,_0x12d94e=events[_0x71bd('0x5')];_0x36c67d<_0x12d94e;_0x36c67d++){var _0x496ab9=events[_0x36c67d];var _0x30f53c=createListener(_0x71bd('0x6')+_0x496ab9,_0x133e0b);SmsInteractionEvents['on'](_0x496ab9,_0x30f53c);}};
\ No newline at end of file
+var _0xcb03=['remove','emit','removeListener','length','smsInteraction:','./smsInteraction.events'];(function(_0x17f743,_0x2da41c){var _0x2a4675=function(_0x217f65){while(--_0x217f65){_0x17f743['push'](_0x17f743['shift']());}};_0x2a4675(++_0x2da41c);}(_0xcb03,0x95));var _0x3cb0=function(_0x35f957,_0x4f71ae){_0x35f957=_0x35f957-0x0;var _0x458c6f=_0xcb03[_0x35f957];return _0x458c6f;};'use strict';var SmsInteractionEvents=require(_0x3cb0('0x0'));var events=['save',_0x3cb0('0x1'),'update'];function createListener(_0x34b641,_0x3a0823){return function(_0x28235d){_0x3a0823[_0x3cb0('0x2')](_0x34b641,_0x28235d);};}function removeListener(_0x523ce5,_0x41a536){return function(){SmsInteractionEvents[_0x3cb0('0x3')](_0x523ce5,_0x41a536);};}exports['register']=function(_0x1ea9bf){for(var _0x2ed82b=0x0,_0x583246=events[_0x3cb0('0x4')];_0x2ed82b<_0x583246;_0x2ed82b++){var _0x525ccf=events[_0x2ed82b];var _0x20552f=createListener(_0x3cb0('0x5')+_0x525ccf,_0x1ea9bf);SmsInteractionEvents['on'](_0x525ccf,_0x20552f);}};
\ No newline at end of file
diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js
index 2182f29..de747d9 100644
--- a/server/api/smsMessage/index.js
+++ b/server/api/smsMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d47=['post','tracked','create','status','update','put','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1c9b46,_0x507d41){var _0x2d199c=function(_0x4740a8){while(--_0x4740a8){_0x1c9b46['push'](_0x1c9b46['shift']());}};_0x2d199c(++_0x507d41);}(_0x6d47,0x98));var _0x76d4=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x6d47[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x76d4('0x0'));var util=require(_0x76d4('0x1'));var path=require(_0x76d4('0x2'));var timeout=require(_0x76d4('0x3'));var express=require(_0x76d4('0x4'));var router=express[_0x76d4('0x5')]();var auth=require(_0x76d4('0x6'));var interaction=require(_0x76d4('0x7'));var config=require('../../config/environment');var controller=require(_0x76d4('0x8'));router[_0x76d4('0x9')]('/',auth[_0x76d4('0xa')](),controller[_0x76d4('0xb')]);router[_0x76d4('0x9')](_0x76d4('0xc'),auth[_0x76d4('0xa')](),controller[_0x76d4('0xd')]);router[_0x76d4('0x9')](_0x76d4('0xe'),auth[_0x76d4('0xa')](),controller[_0x76d4('0xf')]);router[_0x76d4('0x10')]('/',auth[_0x76d4('0xa')](),interaction[_0x76d4('0x11')]('sms','smsmessage:create'),controller[_0x76d4('0x12')]);router[_0x76d4('0x10')]('/:id/status',controller[_0x76d4('0x13')]);router['put'](_0x76d4('0xe'),auth[_0x76d4('0xa')](),controller[_0x76d4('0x14')]);router[_0x76d4('0x15')]('/:id/accept',auth[_0x76d4('0xa')](),controller[_0x76d4('0x16')]);router['put'](_0x76d4('0x17'),auth[_0x76d4('0xa')](),controller[_0x76d4('0x18')]);router[_0x76d4('0x19')](_0x76d4('0xe'),auth[_0x76d4('0xa')](),controller[_0x76d4('0x1a')]);module[_0x76d4('0x1b')]=router;
\ No newline at end of file
+var _0xf902=['tracked','sms','create','/:id/status','status','update','/:id/accept','put','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','/:id','post'];(function(_0x2628b2,_0x9a9894){var _0x4348e7=function(_0x553ccb){while(--_0x553ccb){_0x2628b2['push'](_0x2628b2['shift']());}};_0x4348e7(++_0x9a9894);}(_0xf902,0x12b));var _0x2f90=function(_0xa07782,_0xfb20be){_0xa07782=_0xa07782-0x0;var _0x1cce9c=_0xf902[_0xa07782];return _0x1cce9c;};'use strict';var multer=require('multer');var util=require(_0x2f90('0x0'));var path=require(_0x2f90('0x1'));var timeout=require(_0x2f90('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x2f90('0x3'));var interaction=require(_0x2f90('0x4'));var config=require(_0x2f90('0x5'));var controller=require(_0x2f90('0x6'));router['get']('/',auth[_0x2f90('0x7')](),controller[_0x2f90('0x8')]);router[_0x2f90('0x9')](_0x2f90('0xa'),auth[_0x2f90('0x7')](),controller['describe']);router[_0x2f90('0x9')](_0x2f90('0xb'),auth[_0x2f90('0x7')](),controller['show']);router[_0x2f90('0xc')]('/',auth['isAuthenticated'](),interaction[_0x2f90('0xd')](_0x2f90('0xe'),'smsmessage:create'),controller[_0x2f90('0xf')]);router[_0x2f90('0xc')](_0x2f90('0x10'),controller[_0x2f90('0x11')]);router['put'](_0x2f90('0xb'),auth[_0x2f90('0x7')](),controller[_0x2f90('0x12')]);router['put'](_0x2f90('0x13'),auth['isAuthenticated'](),controller['accept']);router[_0x2f90('0x14')](_0x2f90('0x15'),auth['isAuthenticated'](),controller[_0x2f90('0x16')]);router[_0x2f90('0x17')](_0x2f90('0xb'),auth[_0x2f90('0x7')](),controller[_0x2f90('0x18')]);module[_0x2f90('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js
index 94105b8..5d99bde 100644
--- a/server/api/smsMessage/smsMessage.attributes.js
+++ b/server/api/smsMessage/smsMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x737d=['DATE','BOOLEAN','sequelize','exports','out','STRING'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0x737d,0xbc));var _0xd737=function(_0x46eb1a,_0x2ec67e){_0x46eb1a=_0x46eb1a-0x0;var _0x4ddb9f=_0x737d[_0x46eb1a];return _0x4ddb9f;};'use strict';var Sequelize=require(_0xd737('0x0'));module[_0xd737('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd737('0x2')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd737('0x3')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xd737('0x4')]},'secret':{'type':Sequelize[_0xd737('0x5')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6dac=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x18b1af,_0xeb2b6){var _0x40aaa8=function(_0x19ef69){while(--_0x19ef69){_0x18b1af['push'](_0x18b1af['shift']());}};_0x40aaa8(++_0xeb2b6);}(_0x6dac,0x16e));var _0xc6da=function(_0x315842,_0x227f87){_0x315842=_0x315842-0x0;var _0x423e7d=_0x6dac[_0x315842];return _0x423e7d;};'use strict';var Sequelize=require(_0xc6da('0x0'));module[_0xc6da('0x1')]={'body':{'type':Sequelize[_0xc6da('0x2')](_0xc6da('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc6da('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc6da('0x5')]('in',_0xc6da('0x6')),'defaultValue':_0xc6da('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc6da('0x7')](0xbe)},'phone':{'type':Sequelize[_0xc6da('0x7')]},'readAt':{'type':Sequelize[_0xc6da('0x8')]},'secret':{'type':Sequelize[_0xc6da('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js
index eba6b87..f91361e 100644
--- a/server/api/smsMessage/smsMessage.controller.js
+++ b/server/api/smsMessage/smsMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','SmsMessage','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','include','find','create','body','params','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','SIP/%s','channel','EventManager','acceptmessage','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','event','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','sent','delivered','Status','infobip','groupName','DELIVERED','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash'];(function(_0x4b8412,_0x235b3d){var _0x1ed9ed=function(_0x455209){while(--_0x455209){_0x4b8412['push'](_0x4b8412['shift']());}};_0x1ed9ed(++_0x235b3d);}(_0x7217,0x19e));var _0x7721=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x7217[_0x3b5250];return _0xc844a1;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];config[_0x7721('0x1a')]=_[_0x7721('0x1b')](config['redis'],{'host':_0x7721('0x1c'),'port':0x18eb});var socket=require(_0x7721('0x1d'))(new Redis(config['redis']));require(_0x7721('0x1e'))[_0x7721('0x1f')](socket);var jayson=require(_0x7721('0x20'));var client=jayson[_0x7721('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x7721('0x21')][_0x7721('0x22')]({'port':0x232a});function checkPasswordPattern(_0x534f1b,_0x4e199a,_0x4b183e){if(_0x4b183e){var _0x5ed54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5ed54[_0x7721('0x23')](_0x4e199a)){return _0x534f1b;}else{throw new Error(_0x7721('0x24'));}}else{return _0x534f1b;}}function respondWithRpcPromise(_0x32550d,_0x5ed94b,_0x20f669,_0x54a838){return new BPromise(function(_0x3fc09e,_0x5cb0e6){var _0xfec626=_0x54a838||client;return _0xfec626[_0x7721('0x25')](_0x32550d,_0x20f669)[_0x7721('0x26')](function(_0x3e140d){logger[_0x7721('0x27')](_0x7721('0x28'),_0x5ed94b,_0x7721('0x29'));logger[_0x7721('0x2a')](_0x7721('0x2b'),_0x5ed94b,_0x7721('0x29'),JSON['stringify'](_0x3e140d));if(_0x3e140d[_0x7721('0x2c')]){if(_0x3e140d[_0x7721('0x2c')][_0x7721('0x2d')]===0x1f4){logger[_0x7721('0x2c')]('SmsMessage,\x20%s,\x20%s',_0x5ed94b,_0x3e140d[_0x7721('0x2c')]['message']);return _0x5cb0e6(_0x3e140d[_0x7721('0x2c')][_0x7721('0x2e')]);}logger[_0x7721('0x2c')](_0x7721('0x28'),_0x5ed94b,_0x3e140d[_0x7721('0x2c')][_0x7721('0x2e')]);return _0x3fc09e(_0x3e140d[_0x7721('0x2c')]['message']);}else{logger[_0x7721('0x27')](_0x7721('0x28'),_0x5ed94b,_0x7721('0x29'));_0x3fc09e(_0x3e140d[_0x7721('0x2f')][_0x7721('0x2e')]);}})[_0x7721('0x30')](function(_0x424e05){logger[_0x7721('0x2c')](_0x7721('0x28'),_0x5ed94b,_0x424e05);_0x5cb0e6(_0x424e05);});});}function respondWithStatusCode(_0x52316e,_0x258ddf){_0x258ddf=_0x258ddf||0xcc;return function(_0x5b0551){if(_0x5b0551){return _0x52316e['sendStatus'](_0x258ddf);}return _0x52316e[_0x7721('0x31')](_0x258ddf)[_0x7721('0x32')]();};}function respondWithResult(_0x53c904,_0x158d98){_0x158d98=_0x158d98||0xc8;return function(_0x1ea4d){if(_0x1ea4d){return _0x53c904[_0x7721('0x31')](_0x158d98)[_0x7721('0x33')](_0x1ea4d);}};}function respondWithFilteredResult(_0x1da2d8,_0x5c54f0){return function(_0x471651){if(_0x471651){var _0x2871c5=_0x471651[_0x7721('0x34')],_0x497f9f=_0x5c54f0['offset'],_0x4a25c9=_0x5c54f0[_0x7721('0x35')]+_0x5c54f0[_0x7721('0x36')],_0xfde9ec;if(_0x4a25c9>=_0x2871c5){_0x4a25c9=_0x2871c5;_0xfde9ec=0xc8;}else{_0xfde9ec=0xce;}_0x1da2d8[_0x7721('0x31')](_0xfde9ec);return _0x1da2d8['set'](_0x7721('0x37'),_0x497f9f+'-'+_0x4a25c9+'/'+_0x2871c5)[_0x7721('0x33')](_0x471651);}return null;};}function patchUpdates(_0x1492d4){return function(_0x3f15e2){try{jsonpatch[_0x7721('0x38')](_0x3f15e2,_0x1492d4,!![]);}catch(_0x508202){return BPromise[_0x7721('0x39')](_0x508202);}return _0x3f15e2[_0x7721('0x3a')]();};}function saveUpdates(_0xb2386d,_0x5c5b33){return function(_0x35de7a){if(_0x35de7a){return _0x35de7a[_0x7721('0x3b')](_0xb2386d)['then'](function(_0x217592){return _0x217592;});}return null;};}function removeEntity(_0x5ce026,_0x2d6ba0){return function(_0x326c50){if(_0x326c50){return _0x326c50[_0x7721('0x3c')]()[_0x7721('0x26')](function(){_0x5ce026[_0x7721('0x31')](0xcc)[_0x7721('0x32')]();});}};}function handleEntityNotFound(_0x2f1fe0,_0x15545a){return function(_0x25bdd9){if(!_0x25bdd9){_0x2f1fe0[_0x7721('0x3d')](0x194);}return _0x25bdd9;};}function handleError(_0x385454,_0x5c806d){_0x5c806d=_0x5c806d||0x1f4;return function(_0xd1df68){logger['error'](_0xd1df68[_0x7721('0x3e')]);if(_0xd1df68[_0x7721('0x3f')]){delete _0xd1df68[_0x7721('0x3f')];}_0x385454[_0x7721('0x31')](_0x5c806d)[_0x7721('0x40')](_0xd1df68);};}exports[_0x7721('0x41')]=function(_0x482b70,_0x557c34){var _0x4cadef={},_0x539560={},_0x18001c={'count':0x0,'rows':[]};var _0x1b3f8d=db[_0x7721('0x42')][_0x7721('0x43')];_0x539560['model']=_[_0x7721('0x44')](_0x1b3f8d);_0x539560['query']=_[_0x7721('0x44')](_0x482b70[_0x7721('0x45')]);_0x539560['filters']=_[_0x7721('0x46')](_0x539560[_0x7721('0x47')],_0x539560['query']);_0x4cadef['attributes']=_[_0x7721('0x46')](_0x539560[_0x7721('0x47')],qs[_0x7721('0x48')](_0x482b70[_0x7721('0x45')]['fields']));_0x4cadef[_0x7721('0x49')]=_0x4cadef[_0x7721('0x49')][_0x7721('0x4a')]?_0x4cadef[_0x7721('0x49')]:_0x539560[_0x7721('0x47')];if(!_0x482b70['query'][_0x7721('0x4b')]('nolimit')){_0x4cadef[_0x7721('0x36')]=qs['limit'](_0x482b70[_0x7721('0x45')][_0x7721('0x36')]);_0x4cadef[_0x7721('0x35')]=qs['offset'](_0x482b70[_0x7721('0x45')][_0x7721('0x35')]);}_0x4cadef[_0x7721('0x4c')]=qs['sort'](_0x482b70[_0x7721('0x45')][_0x7721('0x4d')]);_0x4cadef[_0x7721('0x4e')]=qs[_0x7721('0x4f')](_[_0x7721('0x50')](_0x482b70[_0x7721('0x45')],_0x539560[_0x7721('0x4f')]));if(_0x482b70['query']['filter']){_0x4cadef[_0x7721('0x4e')]=_[_0x7721('0x51')](_0x4cadef[_0x7721('0x4e')],{'$or':_[_0x7721('0x52')](_0x1b3f8d,function(_0x335145){if(_0x335145[_0x7721('0x53')][_0x7721('0x54')]!==_0x7721('0x55')){var _0xa601bc={};_0xa601bc[_0x335145[_0x7721('0x56')]]={'$like':'%'+_0x482b70['query']['filter']+'%'};return _0xa601bc;}})});}_0x4cadef=_[_0x7721('0x51')]({},_0x4cadef,_0x482b70[_0x7721('0x57')]);var _0x151f69={'where':_0x4cadef[_0x7721('0x4e')]};return db['SmsMessage'][_0x7721('0x34')](_0x151f69)[_0x7721('0x26')](function(_0x56c3d9){_0x18001c[_0x7721('0x34')]=_0x56c3d9;if(_0x482b70['query'][_0x7721('0x58')]){_0x4cadef['include']=[{'all':!![]}];}return db[_0x7721('0x42')][_0x7721('0x59')](_0x4cadef);})[_0x7721('0x26')](function(_0x4eda58){_0x18001c[_0x7721('0x5a')]=_0x4eda58;return _0x18001c;})[_0x7721('0x26')](respondWithFilteredResult(_0x557c34,_0x4cadef))['catch'](handleError(_0x557c34,null));};exports[_0x7721('0x5b')]=function(_0x1196c2,_0xf88e8c){var _0x5c4078={'raw':!![],'where':{'id':_0x1196c2['params']['id']}},_0x20ba21={};_0x20ba21[_0x7721('0x47')]=_[_0x7721('0x44')](db[_0x7721('0x42')][_0x7721('0x43')]);_0x20ba21[_0x7721('0x45')]=_[_0x7721('0x44')](_0x1196c2[_0x7721('0x45')]);_0x20ba21[_0x7721('0x4f')]=_[_0x7721('0x46')](_0x20ba21[_0x7721('0x47')],_0x20ba21[_0x7721('0x45')]);_0x5c4078[_0x7721('0x49')]=_[_0x7721('0x46')](_0x20ba21[_0x7721('0x47')],qs[_0x7721('0x48')](_0x1196c2['query'][_0x7721('0x48')]));_0x5c4078[_0x7721('0x49')]=_0x5c4078[_0x7721('0x49')][_0x7721('0x4a')]?_0x5c4078[_0x7721('0x49')]:_0x20ba21[_0x7721('0x47')];if(_0x1196c2[_0x7721('0x45')]['includeAll']){_0x5c4078[_0x7721('0x5c')]=[{'all':!![]}];}_0x5c4078=_[_0x7721('0x51')]({},_0x5c4078,_0x1196c2[_0x7721('0x57')]);return db[_0x7721('0x42')][_0x7721('0x5d')](_0x5c4078)[_0x7721('0x26')](handleEntityNotFound(_0xf88e8c,null))[_0x7721('0x26')](respondWithResult(_0xf88e8c,null))[_0x7721('0x30')](handleError(_0xf88e8c,null));};exports[_0x7721('0x5e')]=function(_0x3b968d,_0x8eca10){return db['SmsMessage'][_0x7721('0x5e')](_0x3b968d[_0x7721('0x5f')],{})[_0x7721('0x26')](respondWithResult(_0x8eca10,0xc9))[_0x7721('0x30')](handleError(_0x8eca10,null));};exports[_0x7721('0x3b')]=function(_0x3e7918,_0x41644f){if(_0x3e7918[_0x7721('0x5f')]['id']){delete _0x3e7918[_0x7721('0x5f')]['id'];}return db[_0x7721('0x42')][_0x7721('0x5d')]({'where':{'id':_0x3e7918[_0x7721('0x60')]['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x41644f,null))[_0x7721('0x26')](saveUpdates(_0x3e7918[_0x7721('0x5f')],null))['then'](respondWithResult(_0x41644f,null))['catch'](handleError(_0x41644f,null));};exports['destroy']=function(_0x885a3a,_0x4f2fe6){return db['SmsMessage']['find']({'where':{'id':_0x885a3a['params']['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x4f2fe6,null))[_0x7721('0x26')](removeEntity(_0x4f2fe6,null))[_0x7721('0x30')](handleError(_0x4f2fe6,null));};exports['describe']=function(_0x5181d7,_0x5925b7){return db['SmsMessage']['describe']()[_0x7721('0x26')](respondWithResult(_0x5925b7,null))['catch'](handleError(_0x5925b7,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x7721('0x61')]=function(_0x2e9155,_0x1ff090,_0x4a94c8){var _0x2a025c={'channel':_0x7721('0x62')};if(_0x2e9155[_0x7721('0x5f')]['id']){delete _0x2e9155[_0x7721('0x5f')]['id'];}_0x2e9155[_0x7721('0x5f')][_0x7721('0x63')]=!![];_0x2e9155[_0x7721('0x5f')][_0x7721('0x64')]=moment()[_0x7721('0x65')](_0x7721('0x66'));_0x2e9155[_0x7721('0x5f')][_0x7721('0x67')]=_0x2e9155[_0x7721('0x5f')][_0x7721('0x67')]||_0x2e9155[_0x7721('0x68')]['id'];return db['SmsMessage'][_0x7721('0x5d')]({'where':{'id':_0x2e9155[_0x7721('0x60')]['id'],'UserId':null},'include':[{'model':db[_0x7721('0x69')],'as':_0x7721('0x6a')}]})['then'](handleEntityNotFound(_0x1ff090,null))[_0x7721('0x26')](saveUpdates(_0x2e9155[_0x7721('0x5f')],null))['then'](function(_0x3e7df3){if(_0x3e7df3){_0x2a025c['message']=_0x3e7df3[_0x7721('0x6b')]({'plain':!![]});return db[_0x7721('0x6c')][_0x7721('0x5d')]({'where':{'id':_0x3e7df3[_0x7721('0x6d')]}});}return null;})[_0x7721('0x26')](handleEntityNotFound(_0x1ff090,null))[_0x7721('0x26')](function(_0x3121e0){if(_0x3121e0){return _0x3121e0[_0x7721('0x3b')]({'UserId':_0x2e9155[_0x7721('0x5f')]['UserId'],'read1stAt':_[_0x7721('0x6e')](_0x3121e0[_0x7721('0x6f')])?moment()[_0x7721('0x65')](_0x7721('0x66')):undefined});}return null;})[_0x7721('0x26')](function(_0x3ed425){if(_0x3ed425){_0x2a025c[_0x7721('0x70')]=_0x3ed425['get']({'plain':!![]});interaction_log[_0x7721('0x27')](_0x7721('0x71'),_0x2e9155['user']['id'],_0x2e9155[_0x7721('0x68')]['name'],_0x2e9155[_0x7721('0x68')][_0x7721('0x72')],_0x2a025c[_0x7721('0x70')]['id'],_0x2e9155[_0x7721('0x5f')]?JSON[_0x7721('0x73')](_0x2e9155[_0x7721('0x5f')]):_0x7721('0x74'));return respondWithRpcPromise('AcceptMessage',_0x7721('0x75'),_0x2a025c);}return null;})[_0x7721('0x26')](function(_0x280b1d){if(_0x280b1d){if(_0x2e9155['body']['manual']){_0x2a025c['message']['interface']=util['format'](_0x7721('0x76'),_0x2e9155[_0x7721('0x68')]['name']);_0x2a025c[_0x7721('0x2e')][_0x7721('0x77')]=_0x2a025c[_0x7721('0x77')];_0x2a025c[_0x7721('0x2e')]['event']=_0x7721('0x61');return respondWithRpcPromise(_0x7721('0x78'),_0x7721('0x78'),{'event':_0x7721('0x79'),'message':_0x2a025c[_0x7721('0x2e')]},client9002)['then'](function(){return _0x2a025c;});}return _0x2a025c;}return null;})[_0x7721('0x26')](respondWithResult(_0x1ff090,null))[_0x7721('0x30')](handleError(_0x1ff090,null));};var interaction_log=require(_0x7721('0x15'))('sms-interactions');exports['reject']=function(_0x76d89e,_0x752564,_0x423040){var _0x42ca24={'agent':{},'channel':_0x7721('0x62')};if(_0x76d89e['body']['id']){delete _0x76d89e['body']['id'];}_0x76d89e[_0x7721('0x5f')][_0x7721('0x67')]=_0x76d89e[_0x7721('0x5f')][_0x7721('0x67')]||_0x76d89e[_0x7721('0x68')]['id'];_0x42ca24[_0x7721('0x7a')]['id']=_0x76d89e[_0x7721('0x5f')]['UserId'];return db[_0x7721('0x42')][_0x7721('0x5d')]({'where':{'id':_0x76d89e[_0x7721('0x60')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x752564,null))[_0x7721('0x26')](function(_0x1a53d6){if(_0x1a53d6){_0x42ca24[_0x7721('0x2e')]=_0x1a53d6[_0x7721('0x6b')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x1a53d6[_0x7721('0x6d')]}});}return null;})[_0x7721('0x26')](handleEntityNotFound(_0x752564,null))[_0x7721('0x26')](function(_0x42c849){if(_0x42c849){_0x42ca24[_0x7721('0x70')]=_0x42c849[_0x7721('0x6b')]({'plain':!![]});interaction_log['info'](_0x7721('0x7b'),_0x76d89e[_0x7721('0x68')]['id'],_0x76d89e[_0x7721('0x68')]['name'],_0x76d89e[_0x7721('0x68')][_0x7721('0x72')],_0x42ca24[_0x7721('0x70')]['id'],_0x76d89e[_0x7721('0x5f')]?JSON[_0x7721('0x73')](_0x76d89e['body']):_0x7721('0x74'));return respondWithRpcPromise('RejectMessage',_0x7721('0x7c'),_0x42ca24);}return null;})[_0x7721('0x26')](function(_0x2d5433){if(_0x2d5433){_0x2d5433[_0x7721('0x2e')][_0x7721('0x7d')]=util[_0x7721('0x65')](_0x7721('0x76'),_0x76d89e[_0x7721('0x68')][_0x7721('0x3f')]);_0x2d5433[_0x7721('0x2e')][_0x7721('0x77')]=_0x42ca24['channel'];_0x2d5433[_0x7721('0x2e')][_0x7721('0x7e')]=_0x7721('0x39');respondWithRpcPromise('EventManager',_0x7721('0x78'),{'event':_0x7721('0x7f'),'message':_0x2d5433[_0x7721('0x2e')]},client9002);return _0x42ca24;}return null;})[_0x7721('0x26')](respondWithResult(_0x752564,null))[_0x7721('0x30')](handleError(_0x752564,null));};exports['status']=function(_0x1276ce,_0x22f15a,_0x44326d){if(_0x1276ce[_0x7721('0x5f')]['id']){delete _0x1276ce[_0x7721('0x5f')]['id'];}var _0x51f3d7;return db['SmsMessage'][_0x7721('0x5d')]({'where':{'id':_0x1276ce[_0x7721('0x60')]['id']}})['then'](handleEntityNotFound(_0x22f15a,null))[_0x7721('0x26')](function(_0x4c8fb9){if(_0x4c8fb9){_0x51f3d7=_0x4c8fb9;return db[_0x7721('0x80')][_0x7721('0x5d')]({'where':{'id':_0x4c8fb9['SmsAccountId']}});}})[_0x7721('0x26')](handleEntityNotFound(_0x22f15a,null))['then'](function(_0x56069f){if(_0x56069f){logger['debug'](_0x7721('0x2b'),_0x7721('0x31'),_0x7721('0x81'),_0x56069f['type'],util['inspect'](_0x1276ce['body'],{'showHidden':![],'depth':null}));switch(_0x56069f[_0x7721('0x53')]){case _0x7721('0x82'):if(_0x1276ce[_0x7721('0x5f')][_0x7721('0x83')]&&_0x1276ce[_0x7721('0x5f')][_0x7721('0x83')]===_0x51f3d7['messageId']){return _0x51f3d7[_0x7721('0x3b')]({'read':!![]});}else{logger[_0x7721('0x2c')](_0x7721('0x84'),_0x7721('0x31'),_0x7721('0x82'),util[_0x7721('0x85')](_0x1276ce[_0x7721('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x7721('0x86'):if(_0x1276ce[_0x7721('0x5f')][_0x7721('0x87')]&&_0x1276ce[_0x7721('0x5f')][_0x7721('0x87')]===_0x51f3d7['messageId']&&_['indexOf']([_0x7721('0x88'),_0x7721('0x89')],_0x1276ce['body'][_0x7721('0x8a')])>=0x0){return _0x51f3d7['update']({'read':!![]});}else{logger['error'](_0x7721('0x84'),'status','plivio',util[_0x7721('0x85')](_0x1276ce[_0x7721('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x7721('0x8b'):var _0x3698b3=_0x1276ce[_0x7721('0x5f')]['results'][0x0];if(_0x3698b3[_0x7721('0x31')][_0x7721('0x8c')]===_0x7721('0x8d')){return _0x51f3d7[_0x7721('0x3b')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7721('0x31'),_0x7721('0x8b'),util['inspect'](_0x1276ce[_0x7721('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x51f3d7;}})[_0x7721('0x26')](respondWithResult(_0x22f15a,null))['catch'](handleError(_0x22f15a,null));};
\ No newline at end of file
+var _0x9c5a=['params','describe','../../config/logger','sms-interactions','accept','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','interaction','role','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','delivered','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','name','send','SmsMessage','rawAttributes','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','options','count','includeAll','include','rows','create','body','find'];(function(_0x4f3c10,_0x2f7308){var _0x2293af=function(_0x32f77d){while(--_0x32f77d){_0x4f3c10['push'](_0x4f3c10['shift']());}};_0x2293af(++_0x2f7308);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x259acd,_0x5ecd52){_0x259acd=_0x259acd-0x0;var _0x8b8298=_0x9c5a[_0x259acd];return _0x8b8298;};'use strict';var pdf=require(_0xa9c5('0x0'));var emlformat=require(_0xa9c5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa9c5('0x2'));var jsonpatch=require(_0xa9c5('0x3'));var rp=require(_0xa9c5('0x4'));var moment=require(_0xa9c5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa9c5('0x6'));var util=require(_0xa9c5('0x7'));var path=require('path');var sox=require(_0xa9c5('0x8'));var csv=require('to-csv');var ejs=require(_0xa9c5('0x9'));var fs=require('fs');var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa9c5('0x11'));var utils=require(_0xa9c5('0x12'));var config=require(_0xa9c5('0x13'));var db=require(_0xa9c5('0x14'))['db'];config[_0xa9c5('0x15')]=_[_0xa9c5('0x16')](config[_0xa9c5('0x15')],{'host':_0xa9c5('0x17'),'port':0x18eb});var socket=require(_0xa9c5('0x18'))(new Redis(config[_0xa9c5('0x15')]));require('./smsMessage.socket')[_0xa9c5('0x19')](socket);var jayson=require(_0xa9c5('0x1a'));var client=jayson[_0xa9c5('0x1b')][_0xa9c5('0x1c')]({'port':0x232c});var client9002=jayson[_0xa9c5('0x1b')][_0xa9c5('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x251099,_0x40b001,_0x19a43e){if(_0x19a43e){var _0xcf13f2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcf13f2['test'](_0x40b001)){return _0x251099;}else{throw new Error(_0xa9c5('0x1d'));}}else{return _0x251099;}}function respondWithRpcPromise(_0xd85c32,_0x1ee5ac,_0x55cce5,_0x2cda1b){return new BPromise(function(_0x1142d9,_0x2b9ac5){var _0x3b8cf7=_0x2cda1b||client;return _0x3b8cf7[_0xa9c5('0x1e')](_0xd85c32,_0x55cce5)[_0xa9c5('0x1f')](function(_0x3b8d4d){logger[_0xa9c5('0x20')](_0xa9c5('0x21'),_0x1ee5ac,_0xa9c5('0x22'));logger[_0xa9c5('0x23')](_0xa9c5('0x24'),_0x1ee5ac,'request\x20sent',JSON[_0xa9c5('0x25')](_0x3b8d4d));if(_0x3b8d4d[_0xa9c5('0x26')]){if(_0x3b8d4d['error']['code']===0x1f4){logger[_0xa9c5('0x26')](_0xa9c5('0x21'),_0x1ee5ac,_0x3b8d4d[_0xa9c5('0x26')][_0xa9c5('0x27')]);return _0x2b9ac5(_0x3b8d4d[_0xa9c5('0x26')][_0xa9c5('0x27')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x1ee5ac,_0x3b8d4d[_0xa9c5('0x26')][_0xa9c5('0x27')]);return _0x1142d9(_0x3b8d4d['error'][_0xa9c5('0x27')]);}else{logger[_0xa9c5('0x20')](_0xa9c5('0x21'),_0x1ee5ac,_0xa9c5('0x22'));_0x1142d9(_0x3b8d4d[_0xa9c5('0x28')][_0xa9c5('0x27')]);}})[_0xa9c5('0x29')](function(_0x51b64a){logger['error'](_0xa9c5('0x21'),_0x1ee5ac,_0x51b64a);_0x2b9ac5(_0x51b64a);});});}function respondWithStatusCode(_0x4cd5e6,_0x1762ac){_0x1762ac=_0x1762ac||0xcc;return function(_0x830bad){if(_0x830bad){return _0x4cd5e6['sendStatus'](_0x1762ac);}return _0x4cd5e6[_0xa9c5('0x2a')](_0x1762ac)[_0xa9c5('0x2b')]();};}function respondWithResult(_0x5f468b,_0x413edf){_0x413edf=_0x413edf||0xc8;return function(_0x32baf9){if(_0x32baf9){return _0x5f468b[_0xa9c5('0x2a')](_0x413edf)[_0xa9c5('0x2c')](_0x32baf9);}};}function respondWithFilteredResult(_0x325c65,_0x4f6e70){return function(_0x36f267){if(_0x36f267){var _0x4cee90=_0x36f267['count'],_0x3c3da7=_0x4f6e70[_0xa9c5('0x2d')],_0x1ef388=_0x4f6e70[_0xa9c5('0x2d')]+_0x4f6e70['limit'],_0x2eeed1;if(_0x1ef388>=_0x4cee90){_0x1ef388=_0x4cee90;_0x2eeed1=0xc8;}else{_0x2eeed1=0xce;}_0x325c65[_0xa9c5('0x2a')](_0x2eeed1);return _0x325c65[_0xa9c5('0x2e')](_0xa9c5('0x2f'),_0x3c3da7+'-'+_0x1ef388+'/'+_0x4cee90)[_0xa9c5('0x2c')](_0x36f267);}return null;};}function patchUpdates(_0x22ee21){return function(_0x3392d0){try{jsonpatch[_0xa9c5('0x30')](_0x3392d0,_0x22ee21,!![]);}catch(_0x4b9104){return BPromise[_0xa9c5('0x31')](_0x4b9104);}return _0x3392d0[_0xa9c5('0x32')]();};}function saveUpdates(_0xf4a9f3,_0x1c01f9){return function(_0x1c617c){if(_0x1c617c){return _0x1c617c[_0xa9c5('0x33')](_0xf4a9f3)[_0xa9c5('0x1f')](function(_0x36b599){return _0x36b599;});}return null;};}function removeEntity(_0x57ebb7,_0x4e3f3e){return function(_0x1487a4){if(_0x1487a4){return _0x1487a4[_0xa9c5('0x34')]()[_0xa9c5('0x1f')](function(){_0x57ebb7[_0xa9c5('0x2a')](0xcc)[_0xa9c5('0x2b')]();});}};}function handleEntityNotFound(_0x25121e,_0x4dfdb5){return function(_0x598920){if(!_0x598920){_0x25121e['sendStatus'](0x194);}return _0x598920;};}function handleError(_0x314010,_0x27d614){_0x27d614=_0x27d614||0x1f4;return function(_0x5087e4){logger[_0xa9c5('0x26')](_0x5087e4['stack']);if(_0x5087e4[_0xa9c5('0x35')]){delete _0x5087e4[_0xa9c5('0x35')];}_0x314010[_0xa9c5('0x2a')](_0x27d614)[_0xa9c5('0x36')](_0x5087e4);};}exports['index']=function(_0x675588,_0x2cd721){var _0x191153={},_0x39782d={},_0x814c1a={'count':0x0,'rows':[]};var _0x17ef8e=db[_0xa9c5('0x37')][_0xa9c5('0x38')];_0x39782d['model']=_[_0xa9c5('0x39')](_0x17ef8e);_0x39782d[_0xa9c5('0x3a')]=_[_0xa9c5('0x39')](_0x675588[_0xa9c5('0x3a')]);_0x39782d[_0xa9c5('0x3b')]=_[_0xa9c5('0x3c')](_0x39782d['model'],_0x39782d[_0xa9c5('0x3a')]);_0x191153['attributes']=_[_0xa9c5('0x3c')](_0x39782d['model'],qs[_0xa9c5('0x3d')](_0x675588[_0xa9c5('0x3a')][_0xa9c5('0x3d')]));_0x191153['attributes']=_0x191153[_0xa9c5('0x3e')][_0xa9c5('0x3f')]?_0x191153[_0xa9c5('0x3e')]:_0x39782d[_0xa9c5('0x40')];if(!_0x675588['query'][_0xa9c5('0x41')](_0xa9c5('0x42'))){_0x191153[_0xa9c5('0x43')]=qs[_0xa9c5('0x43')](_0x675588[_0xa9c5('0x3a')]['limit']);_0x191153[_0xa9c5('0x2d')]=qs['offset'](_0x675588[_0xa9c5('0x3a')][_0xa9c5('0x2d')]);}_0x191153[_0xa9c5('0x44')]=qs[_0xa9c5('0x45')](_0x675588[_0xa9c5('0x3a')][_0xa9c5('0x45')]);_0x191153[_0xa9c5('0x46')]=qs[_0xa9c5('0x3b')](_[_0xa9c5('0x47')](_0x675588[_0xa9c5('0x3a')],_0x39782d['filters']));if(_0x675588[_0xa9c5('0x3a')][_0xa9c5('0x48')]){_0x191153[_0xa9c5('0x46')]=_[_0xa9c5('0x49')](_0x191153[_0xa9c5('0x46')],{'$or':_[_0xa9c5('0x4a')](_0x17ef8e,function(_0x583ec9){if(_0x583ec9[_0xa9c5('0x4b')][_0xa9c5('0x4c')]!=='VIRTUAL'){var _0x52cfbf={};_0x52cfbf[_0x583ec9['field']]={'$like':'%'+_0x675588['query']['filter']+'%'};return _0x52cfbf;}})});}_0x191153=_[_0xa9c5('0x49')]({},_0x191153,_0x675588[_0xa9c5('0x4d')]);var _0x245f9d={'where':_0x191153[_0xa9c5('0x46')]};return db[_0xa9c5('0x37')][_0xa9c5('0x4e')](_0x245f9d)[_0xa9c5('0x1f')](function(_0x5b00a6){_0x814c1a[_0xa9c5('0x4e')]=_0x5b00a6;if(_0x675588[_0xa9c5('0x3a')][_0xa9c5('0x4f')]){_0x191153[_0xa9c5('0x50')]=[{'all':!![]}];}return db[_0xa9c5('0x37')]['findAll'](_0x191153);})[_0xa9c5('0x1f')](function(_0x5e17f4){_0x814c1a[_0xa9c5('0x51')]=_0x5e17f4;return _0x814c1a;})[_0xa9c5('0x1f')](respondWithFilteredResult(_0x2cd721,_0x191153))['catch'](handleError(_0x2cd721,null));};exports['show']=function(_0xf00970,_0x32e64a){var _0xeb0720={'raw':!![],'where':{'id':_0xf00970['params']['id']}},_0x4e41c7={};_0x4e41c7[_0xa9c5('0x40')]=_[_0xa9c5('0x39')](db['SmsMessage'][_0xa9c5('0x38')]);_0x4e41c7[_0xa9c5('0x3a')]=_[_0xa9c5('0x39')](_0xf00970[_0xa9c5('0x3a')]);_0x4e41c7[_0xa9c5('0x3b')]=_[_0xa9c5('0x3c')](_0x4e41c7['model'],_0x4e41c7['query']);_0xeb0720['attributes']=_[_0xa9c5('0x3c')](_0x4e41c7[_0xa9c5('0x40')],qs[_0xa9c5('0x3d')](_0xf00970[_0xa9c5('0x3a')][_0xa9c5('0x3d')]));_0xeb0720[_0xa9c5('0x3e')]=_0xeb0720['attributes'][_0xa9c5('0x3f')]?_0xeb0720[_0xa9c5('0x3e')]:_0x4e41c7[_0xa9c5('0x40')];if(_0xf00970[_0xa9c5('0x3a')][_0xa9c5('0x4f')]){_0xeb0720[_0xa9c5('0x50')]=[{'all':!![]}];}_0xeb0720=_['merge']({},_0xeb0720,_0xf00970['options']);return db[_0xa9c5('0x37')]['find'](_0xeb0720)[_0xa9c5('0x1f')](handleEntityNotFound(_0x32e64a,null))['then'](respondWithResult(_0x32e64a,null))[_0xa9c5('0x29')](handleError(_0x32e64a,null));};exports[_0xa9c5('0x52')]=function(_0x23abfc,_0x5c7d7c){return db[_0xa9c5('0x37')][_0xa9c5('0x52')](_0x23abfc[_0xa9c5('0x53')],{})[_0xa9c5('0x1f')](respondWithResult(_0x5c7d7c,0xc9))['catch'](handleError(_0x5c7d7c,null));};exports['update']=function(_0x176261,_0x2b66ee){if(_0x176261[_0xa9c5('0x53')]['id']){delete _0x176261['body']['id'];}return db[_0xa9c5('0x37')][_0xa9c5('0x54')]({'where':{'id':_0x176261[_0xa9c5('0x55')]['id']}})[_0xa9c5('0x1f')](handleEntityNotFound(_0x2b66ee,null))[_0xa9c5('0x1f')](saveUpdates(_0x176261[_0xa9c5('0x53')],null))[_0xa9c5('0x1f')](respondWithResult(_0x2b66ee,null))[_0xa9c5('0x29')](handleError(_0x2b66ee,null));};exports['destroy']=function(_0x41f528,_0x5a9d4f){return db[_0xa9c5('0x37')][_0xa9c5('0x54')]({'where':{'id':_0x41f528[_0xa9c5('0x55')]['id']}})['then'](handleEntityNotFound(_0x5a9d4f,null))[_0xa9c5('0x1f')](removeEntity(_0x5a9d4f,null))[_0xa9c5('0x29')](handleError(_0x5a9d4f,null));};exports['describe']=function(_0x1edab3,_0x550144){return db[_0xa9c5('0x37')][_0xa9c5('0x56')]()['then'](respondWithResult(_0x550144,null))[_0xa9c5('0x29')](handleError(_0x550144,null));};var interaction_log=require(_0xa9c5('0x57'))(_0xa9c5('0x58'));exports[_0xa9c5('0x59')]=function(_0x54e501,_0x5538ad,_0x367727){var _0x3deb64={'channel':_0xa9c5('0x5a')};if(_0x54e501[_0xa9c5('0x53')]['id']){delete _0x54e501[_0xa9c5('0x53')]['id'];}_0x54e501[_0xa9c5('0x53')]['read']=!![];_0x54e501[_0xa9c5('0x53')][_0xa9c5('0x5b')]=moment()[_0xa9c5('0x5c')](_0xa9c5('0x5d'));_0x54e501[_0xa9c5('0x53')][_0xa9c5('0x5e')]=_0x54e501[_0xa9c5('0x53')][_0xa9c5('0x5e')]||_0x54e501[_0xa9c5('0x5f')]['id'];return db[_0xa9c5('0x37')]['find']({'where':{'id':_0x54e501['params']['id'],'UserId':null},'include':[{'model':db[_0xa9c5('0x60')],'as':_0xa9c5('0x61')}]})[_0xa9c5('0x1f')](handleEntityNotFound(_0x5538ad,null))[_0xa9c5('0x1f')](saveUpdates(_0x54e501['body'],null))[_0xa9c5('0x1f')](function(_0x4aa699){if(_0x4aa699){_0x3deb64[_0xa9c5('0x27')]=_0x4aa699[_0xa9c5('0x62')]({'plain':!![]});return db[_0xa9c5('0x63')][_0xa9c5('0x54')]({'where':{'id':_0x4aa699[_0xa9c5('0x64')]}});}return null;})[_0xa9c5('0x1f')](handleEntityNotFound(_0x5538ad,null))[_0xa9c5('0x1f')](function(_0x3890b4){if(_0x3890b4){return _0x3890b4[_0xa9c5('0x33')]({'UserId':_0x54e501[_0xa9c5('0x53')][_0xa9c5('0x5e')],'read1stAt':_[_0xa9c5('0x65')](_0x3890b4['read1stAt'])?moment()[_0xa9c5('0x5c')](_0xa9c5('0x5d')):undefined});}return null;})[_0xa9c5('0x1f')](function(_0xce9c8c){if(_0xce9c8c){_0x3deb64[_0xa9c5('0x66')]=_0xce9c8c[_0xa9c5('0x62')]({'plain':!![]});interaction_log[_0xa9c5('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x54e501['user']['id'],_0x54e501[_0xa9c5('0x5f')]['name'],_0x54e501[_0xa9c5('0x5f')][_0xa9c5('0x67')],_0x3deb64['interaction']['id'],_0x54e501[_0xa9c5('0x53')]?JSON[_0xa9c5('0x25')](_0x54e501['body']):'null');return respondWithRpcPromise(_0xa9c5('0x68'),_0xa9c5('0x69'),_0x3deb64);}return null;})[_0xa9c5('0x1f')](function(_0x514f3d){if(_0x514f3d){if(_0x54e501['body'][_0xa9c5('0x6a')]){_0x3deb64[_0xa9c5('0x27')]['interface']=util[_0xa9c5('0x5c')](_0xa9c5('0x6b'),_0x54e501[_0xa9c5('0x5f')][_0xa9c5('0x35')]);_0x3deb64[_0xa9c5('0x27')][_0xa9c5('0x6c')]=_0x3deb64['channel'];_0x3deb64[_0xa9c5('0x27')][_0xa9c5('0x6d')]=_0xa9c5('0x59');return respondWithRpcPromise(_0xa9c5('0x6e'),'EventManager',{'event':_0xa9c5('0x6f'),'message':_0x3deb64[_0xa9c5('0x27')]},client9002)['then'](function(){return _0x3deb64;});}return _0x3deb64;}return null;})[_0xa9c5('0x1f')](respondWithResult(_0x5538ad,null))[_0xa9c5('0x29')](handleError(_0x5538ad,null));};var interaction_log=require(_0xa9c5('0x57'))('sms-interactions');exports[_0xa9c5('0x31')]=function(_0x408214,_0x18dbfa,_0x2e00f5){var _0x2d449a={'agent':{},'channel':_0xa9c5('0x5a')};if(_0x408214[_0xa9c5('0x53')]['id']){delete _0x408214['body']['id'];}_0x408214[_0xa9c5('0x53')][_0xa9c5('0x5e')]=_0x408214[_0xa9c5('0x53')][_0xa9c5('0x5e')]||_0x408214[_0xa9c5('0x5f')]['id'];_0x2d449a[_0xa9c5('0x70')]['id']=_0x408214[_0xa9c5('0x53')][_0xa9c5('0x5e')];return db[_0xa9c5('0x37')][_0xa9c5('0x54')]({'where':{'id':_0x408214[_0xa9c5('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x18dbfa,null))[_0xa9c5('0x1f')](function(_0x2c4b50){if(_0x2c4b50){_0x2d449a['message']=_0x2c4b50[_0xa9c5('0x62')]({'plain':!![]});return db[_0xa9c5('0x63')][_0xa9c5('0x54')]({'where':{'id':_0x2c4b50['SmsInteractionId']}});}return null;})[_0xa9c5('0x1f')](handleEntityNotFound(_0x18dbfa,null))[_0xa9c5('0x1f')](function(_0x22dfd7){if(_0x22dfd7){_0x2d449a[_0xa9c5('0x66')]=_0x22dfd7['get']({'plain':!![]});interaction_log[_0xa9c5('0x20')](_0xa9c5('0x71'),_0x408214['user']['id'],_0x408214['user']['name'],_0x408214['user']['role'],_0x2d449a['interaction']['id'],_0x408214['body']?JSON['stringify'](_0x408214[_0xa9c5('0x53')]):_0xa9c5('0x72'));return respondWithRpcPromise(_0xa9c5('0x73'),_0xa9c5('0x74'),_0x2d449a);}return null;})[_0xa9c5('0x1f')](function(_0x592594){if(_0x592594){_0x592594['message']['interface']=util['format'](_0xa9c5('0x6b'),_0x408214[_0xa9c5('0x5f')][_0xa9c5('0x35')]);_0x592594[_0xa9c5('0x27')]['channel']=_0x2d449a['channel'];_0x592594[_0xa9c5('0x27')][_0xa9c5('0x6d')]=_0xa9c5('0x31');respondWithRpcPromise(_0xa9c5('0x6e'),_0xa9c5('0x6e'),{'event':'rejectmessage','message':_0x592594[_0xa9c5('0x27')]},client9002);return _0x2d449a;}return null;})[_0xa9c5('0x1f')](respondWithResult(_0x18dbfa,null))[_0xa9c5('0x29')](handleError(_0x18dbfa,null));};exports['status']=function(_0x26c81e,_0x2741df,_0x29541b){if(_0x26c81e[_0xa9c5('0x53')]['id']){delete _0x26c81e['body']['id'];}var _0x34fcea;return db[_0xa9c5('0x37')]['find']({'where':{'id':_0x26c81e['params']['id']}})[_0xa9c5('0x1f')](handleEntityNotFound(_0x2741df,null))['then'](function(_0x55b236){if(_0x55b236){_0x34fcea=_0x55b236;return db[_0xa9c5('0x75')][_0xa9c5('0x54')]({'where':{'id':_0x55b236[_0xa9c5('0x76')]}});}})[_0xa9c5('0x1f')](handleEntityNotFound(_0x2741df,null))[_0xa9c5('0x1f')](function(_0x5bc433){if(_0x5bc433){logger[_0xa9c5('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa9c5('0x2a'),_0xa9c5('0x77'),_0x5bc433[_0xa9c5('0x4b')],util[_0xa9c5('0x78')](_0x26c81e['body'],{'showHidden':![],'depth':null}));switch(_0x5bc433['type']){case _0xa9c5('0x79'):if(_0x26c81e['body']['MessageSid']&&_0x26c81e[_0xa9c5('0x53')][_0xa9c5('0x7a')]===_0x34fcea['messageId']){return _0x34fcea['update']({'read':!![]});}else{logger[_0xa9c5('0x26')](_0xa9c5('0x7b'),_0xa9c5('0x2a'),_0xa9c5('0x79'),util['inspect'](_0x26c81e['body'],{'showHidden':![],'depth':null}));}break;case _0xa9c5('0x7c'):if(_0x26c81e[_0xa9c5('0x53')][_0xa9c5('0x7d')]&&_0x26c81e[_0xa9c5('0x53')][_0xa9c5('0x7d')]===_0x34fcea[_0xa9c5('0x7e')]&&_[_0xa9c5('0x7f')](['sent',_0xa9c5('0x80')],_0x26c81e[_0xa9c5('0x53')]['Status'])>=0x0){return _0x34fcea[_0xa9c5('0x33')]({'read':!![]});}else{logger[_0xa9c5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa9c5('0x2a'),_0xa9c5('0x81'),util[_0xa9c5('0x78')](_0x26c81e[_0xa9c5('0x53')],{'showHidden':![],'depth':null}));}break;case _0xa9c5('0x82'):var _0x35a424=_0x26c81e[_0xa9c5('0x53')][_0xa9c5('0x83')][0x0];if(_0x35a424[_0xa9c5('0x2a')][_0xa9c5('0x84')]===_0xa9c5('0x85')){return _0x34fcea[_0xa9c5('0x33')]({'read':!![]});}else{logger[_0xa9c5('0x26')](_0xa9c5('0x7b'),_0xa9c5('0x2a'),_0xa9c5('0x82'),util[_0xa9c5('0x78')](_0x26c81e['body'],{'showHidden':![],'depth':null}));}break;}return _0x34fcea;}})[_0xa9c5('0x1f')](respondWithResult(_0x2741df,null))[_0xa9c5('0x29')](handleError(_0x2741df,null));};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js
index e94640e..4d61a90 100644
--- a/server/api/smsMessage/smsMessage.events.js
+++ b/server/api/smsMessage/smsMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9565=['remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0xb4063c,_0x555fb4){var _0x52594e=function(_0x38b017){while(--_0x38b017){_0xb4063c['push'](_0xb4063c['shift']());}};_0x52594e(++_0x555fb4);}(_0x9565,0x18c));var _0x5956=function(_0x234f49,_0x202a45){_0x234f49=_0x234f49-0x0;var _0x3b8171=_0x9565[_0x234f49];return _0x3b8171;};'use strict';var EventEmitter=require(_0x5956('0x0'));var SmsMessage=require(_0x5956('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5956('0x2'),'afterUpdate':'update','afterDestroy':_0x5956('0x3')};function emitEvent(_0x2a170f){return function(_0x4c602e,_0x18a7d9,_0x5b1b83){SmsMessageEvents[_0x5956('0x4')](_0x2a170f+':'+_0x4c602e['id'],_0x4c602e);SmsMessageEvents[_0x5956('0x4')](_0x2a170f,_0x4c602e);_0x5b1b83(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x5956('0x5')](e,emitEvent(event));}}module[_0x5956('0x6')]=SmsMessageEvents;
\ No newline at end of file
+var _0x5b66=['emit','hook','exports','events','SmsMessage','setMaxListeners','update','remove'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5b66,0x7b));var _0x65b6=function(_0x2c4e30,_0x3ee172){_0x2c4e30=_0x2c4e30-0x0;var _0x3dfdf8=_0x5b66[_0x2c4e30];return _0x3dfdf8;};'use strict';var EventEmitter=require(_0x65b6('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x65b6('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x65b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x65b6('0x3'),'afterDestroy':_0x65b6('0x4')};function emitEvent(_0x2b3cf9){return function(_0x53ec09,_0x7b5602,_0xb6feb3){SmsMessageEvents[_0x65b6('0x5')](_0x2b3cf9+':'+_0x53ec09['id'],_0x53ec09);SmsMessageEvents[_0x65b6('0x5')](_0x2b3cf9,_0x53ec09);_0xb6feb3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x65b6('0x6')](e,emitEvent(event));}}module[_0x65b6('0x7')]=SmsMessageEvents;
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js
index 2ab7f10..b35d62f 100644
--- a/server/api/smsMessage/smsMessage.model.js
+++ b/server/api/smsMessage/smsMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x442b=['sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','timestamp','keys','sort','createHash','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','then','update','direction','catch','error','find','type','accountSid','authToken','phone','create','body','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','username','&password=','split'];(function(_0x1891b3,_0x48cd0a){var _0xfc8cd=function(_0xd95825){while(--_0xd95825){_0x1891b3['push'](_0x1891b3['shift']());}};_0xfc8cd(++_0x48cd0a);}(_0x442b,0x134));var _0xb442=function(_0x176734,_0x326384){_0x176734=_0x176734-0x0;var _0xfac033=_0x442b[_0x176734];return _0xfac033;};'use strict';var _=require('lodash');var util=require(_0xb442('0x0'));var logger=require(_0xb442('0x1'))('api');var moment=require(_0xb442('0x2'));var BPromise=require(_0xb442('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb442('0x4'));var rimraf=require(_0xb442('0x5'));var config=require('../../config/environment');var attributes=require(_0xb442('0x6'));module[_0xb442('0x7')]=function(_0x485203,_0x38b808){return _0x485203['define'](_0xb442('0x8'),attributes,{'tableName':_0xb442('0x9'),'paranoid':![],'indexes':[{'name':_0xb442('0xa'),'fields':[_0xb442('0xa')]},{'name':'fti_sms_messages','fields':['body'],'type':_0xb442('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57bab0,_0x2b4769,_0x342b44){var _0x563996=_0x485203[_0xb442('0xc')];var _0x1b2470=_0x57bab0[_0xb442('0xd')]({'plain':!![]});if(_0x1b2470['direction']['toLowerCase']()==='in'||_0x1b2470['direction'][_0xb442('0xe')]()===_0xb442('0xf')&&!_0x1b2470[_0xb442('0x10')]&&!_[_0xb442('0x11')](_0x1b2470[_0xb442('0x12')])){_0x563996[_0xb442('0x13')][_0xb442('0x14')]({'where':{'id':_0x1b2470['SmsInteractionId']}})[_0xb442('0x15')](function(_0x2f5096){if(_0x2f5096){_0x2f5096[_0xb442('0x16')]({'lastMsgAt':_0x1b2470['createdAt'],'lastMsgDirection':_0x1b2470[_0xb442('0x17')][_0xb442('0xe')]()});}})[_0xb442('0x18')](function(_0x427000){console[_0xb442('0x19')](_0x427000);});}if(_0x1b2470[_0xb442('0x17')]==='out'&&!_0x1b2470[_0xb442('0x10')]){var _0x1a7aef;_0x563996['SmsAccount'][_0xb442('0x1a')]({'where':{'id':_0x1b2470['SmsAccountId']},'raw':!![]})[_0xb442('0x15')](function(_0x2adc45){_0x1a7aef=_0x2adc45;if(_0x1a7aef&&_0x1a7aef[_0xb442('0x1b')]){switch(_0x1a7aef['type']){case'twilio':var _0x2b74d5=require('twilio');if(_0x1a7aef[_0xb442('0x1c')]&&_0x1a7aef[_0xb442('0x1d')]&&_0x1a7aef[_0xb442('0x1e')]){var _0x28cd5b=new _0x2b74d5(_0x1a7aef[_0xb442('0x1c')],_0x1a7aef[_0xb442('0x1d')]);_0x28cd5b['messages'][_0xb442('0x1f')]({'body':_0x1b2470[_0xb442('0x20')],'to':_0x1b2470['phone'],'from':_0x1a7aef[_0xb442('0x1e')],'statusCallback':_0x1a7aef['remote']+_0xb442('0x21')+_0x1b2470['id']+_0xb442('0x22')+_0x1a7aef[_0xb442('0x23')]})[_0xb442('0x15')](function(_0x768619){if(_0x768619['sid']){return _0x57bab0['update']({'messageId':_0x768619[_0xb442('0x24')]});}})[_0xb442('0x18')](function(_0x326705){logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x27'),util['inspect'](_0x326705,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb442('0x27'),_0xb442('0x28'));}break;case _0xb442('0x29'):var _0x4bf15e=_0xb442('0x2a');if(_0x1a7aef['username']&&_0x1a7aef[_0xb442('0x2b')]){var _0x4aac64={'recipient':[_0x1b2470[_0xb442('0x1e')]],'message':_0x1b2470['body'],'message_type':_0x1a7aef[_0xb442('0x2c')]};var _0x18bdc1={'url':_0x4bf15e+_0xb442('0x2d')+_0x1a7aef[_0xb442('0x2e')]+_0xb442('0x2f')+_0x1a7aef[_0xb442('0x2b')],'method':'GET'};rp(_0x18bdc1)['then'](function(_0x3555e9){var _0x5e7552=_0x3555e9[_0xb442('0x30')](';');var _0x568eeb={'user_key':_0x5e7552[0x0],'session_key':_0x5e7552[0x1]};_0x18bdc1={'url':_0x4bf15e+_0xb442('0x31'),'method':_0xb442('0x32'),'headers':{'user_key':_0x568eeb[_0xb442('0x33')],'Session_key':_0x568eeb[_0xb442('0x34')]},'json':!![],'body':_0x4aac64};return rp(_0x18bdc1);})[_0xb442('0x15')](function(_0x2aeff3){if(_0x2aeff3['total_sent']>=0x1){var _0x40c141={'messageId':_0x2aeff3[_0xb442('0x35')]};if(_0x1a7aef[_0xb442('0x2c')]!=='GP'||!_0x1a7aef[_0xb442('0x36')]){_0x40c141[_0xb442('0x37')]=!![];}return _0x57bab0['update'](_0x40c141);}else{return logger['error'](_0xb442('0x25'),'afterCreate',_0xb442('0x29'),util['inspect'](_0x2aeff3,{'showHidden':![],'depth':null}));}})[_0xb442('0x18')](function(_0x20a1b1){return logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x29'),util[_0xb442('0x38')](_0x20a1b1,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x29'),_0xb442('0x39'));}break;case _0xb442('0x3a'):if(_0x1a7aef[_0xb442('0x1d')]){var _0x1eb6b0={'recipient':_0x1b2470['phone'],'message':_0x1b2470[_0xb442('0x20')],'sender':_0x1a7aef[_0xb442('0x3b')]||_0x1a7aef[_0xb442('0x1e')],'authorization':_0x1a7aef[_0xb442('0x1d')]};var _0x2b4769={'method':_0xb442('0x32'),'uri':_0xb442('0x3c'),'body':_0x1eb6b0,'json':!![]};rp(_0x2b4769)[_0xb442('0x15')](function(_0x3501c9){var _0x1413a0={'messageId':_0x3501c9[_0xb442('0x3d')]};if(!_0x1a7aef['deliveryReport']){_0x1413a0['read']=!![];}return _0x57bab0[_0xb442('0x16')](_0x1413a0);})[_0xb442('0x18')](function(_0x32f2cd){logger['error'](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x3a'),util[_0xb442('0x38')](_0x32f2cd,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0xb442('0x3e'));}break;case _0xb442('0x3f'):if(_0x1a7aef['username']&&_0x1a7aef[_0xb442('0x2b')]){var _0x1eb6b0={'messages':[{'source':_0xb442('0x40'),'to':_0x1b2470['phone'],'body':_0x1b2470['body'],'from':_0x1a7aef[_0xb442('0x3b')]||_0x1a7aef[_0xb442('0x1e')]}]};var _0x2a6e6a=util[_0xb442('0x41')](_0xb442('0x42'),_0x1a7aef[_0xb442('0x2e')],_0x1a7aef['password']);var _0x2b4769={'method':_0xb442('0x32'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1eb6b0,'headers':{'Authorization':util['format'](_0xb442('0x43'),new Buffer(_0x2a6e6a)['toString'](_0xb442('0x44')))},'json':!![]};rp(_0x2b4769)[_0xb442('0x15')](function(_0x10eac1){if(_0x10eac1[_0xb442('0x45')]>=0xc8&&_0x10eac1['http_code']<=0xce){if(_0x10eac1['data']&&_0x10eac1[_0xb442('0x46')][_0xb442('0x47')]>0x0){var _0x2e305a=_[_0xb442('0x48')](_0x10eac1[_0xb442('0x46')][_0xb442('0x49')]);var _0x180e35={'messageId':_0x2e305a[_0xb442('0x4a')]};if(!_0x1a7aef[_0xb442('0x36')]){_0x180e35[_0xb442('0x37')]=!![];}return _0x57bab0[_0xb442('0x16')](_0x180e35);}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x4b'),util[_0xb442('0x38')](_0x10eac1,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xb442('0x25'),_0xb442('0x26'),'clickSend',util['inspect'](_0x10eac1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x518787){logger['error'](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x4b'),util[_0xb442('0x38')](_0x518787,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x4b'),_0xb442('0x39'));}break;case _0xb442('0x4c'):if(_0x1a7aef[_0xb442('0x4d')]&&_0x1a7aef[_0xb442('0x1d')]){var _0x1eb6b0={'dst':_0x1b2470[_0xb442('0x1e')],'text':_0x1b2470[_0xb442('0x20')],'src':_0x1a7aef[_0xb442('0x3b')]||_0x1a7aef['phone'],'url':_0x1a7aef[_0xb442('0x4e')]+_0xb442('0x21')+_0x1b2470['id']+_0xb442('0x22')+_0x1a7aef['token']};var _0x2a6e6a=util['format'](_0xb442('0x42'),_0x1a7aef[_0xb442('0x4d')],_0x1a7aef[_0xb442('0x1d')]);var _0x2b4769={'method':_0xb442('0x32'),'uri':util['format'](_0xb442('0x4f'),_0x1a7aef[_0xb442('0x4d')]),'body':_0x1eb6b0,'headers':{'Authorization':util[_0xb442('0x41')](_0xb442('0x43'),new Buffer(_0x2a6e6a)[_0xb442('0x50')](_0xb442('0x44')))},'json':!![]};rp(_0x2b4769)[_0xb442('0x15')](function(_0x21f54c){var _0x240278={'messageId':_0x21f54c['message_uuid'][0x0]};return _0x57bab0[_0xb442('0x16')](_0x240278);})[_0xb442('0x18')](function(_0x46e6ed){logger[_0xb442('0x19')](_0xb442('0x25'),'afterCreate',_0xb442('0x4c'),util[_0xb442('0x38')](_0x46e6ed,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x4c'),_0xb442('0x51'));}break;case _0xb442('0x52'):if(_0x1a7aef['username']&&_0x1a7aef[_0xb442('0x2b')]){if(_0x1a7aef[_0xb442('0x53')]){var _0x21a948={'method':'POST','uri':_0x1a7aef['baseUrl']+_0xb442('0x54'),'body':{'username':_0x1a7aef['username'],'password':_0x1a7aef[_0xb442('0x2b')]},'json':!![]};return rp(_0x21a948)['then'](function(_0x26ec03){var _0x1092ee={'method':_0xb442('0x32'),'uri':_0x1a7aef[_0xb442('0x53')]+_0xb442('0x55'),'body':{'messages':[{'from':_0x1a7aef['phone'],'destinations':[{'to':_0x1b2470[_0xb442('0x1e')]}],'text':_0x1b2470[_0xb442('0x20')],'notifyUrl':_0x1a7aef[_0xb442('0x4e')]+_0xb442('0x21')+_0x1b2470['id']+_0xb442('0x22')+_0x1a7aef[_0xb442('0x23')],'notifyContentType':_0xb442('0x56'),'callbackData':_0x1a7aef['phone']+';'+_0x1b2470[_0xb442('0x20')]}]},'headers':{'Authorization':_0xb442('0x57')+_0x26ec03[_0xb442('0x23')]},'json':!![]};return rp(_0x1092ee)[_0xb442('0x15')](function(_0x4d14fd){if(_0x4d14fd[_0xb442('0x49')]){var _0x13ab4e={'messageId':_0x4d14fd[_0xb442('0x49')][0x0][_0xb442('0xa')]};if(!_0x1a7aef[_0xb442('0x36')]){_0x13ab4e[_0xb442('0x37')]=!![];}return _0x57bab0[_0xb442('0x16')](_0x13ab4e);}else{return logger[_0xb442('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb442('0x26'),'infobip',util[_0xb442('0x38')](_0x4d14fd,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x151c9d){return logger[_0xb442('0x19')](_0xb442('0x25'),'afterCreate',_0xb442('0x52'),util[_0xb442('0x38')](_0x151c9d,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb442('0x26'),_0xb442('0x52'),_0xb442('0x58'));}}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case _0xb442('0x59'):var _0x5814a6=require(_0xb442('0x5a'));if(_0x1a7aef[_0xb442('0x5b')]){var _0x3c03d7={};_0x3c03d7[_0xb442('0x5c')]=_0x1a7aef[_0xb442('0x2e')];_0x3c03d7['phone']=_0x1b2470[_0xb442('0x1e')];_0x3c03d7[_0xb442('0x5d')]=_0x1a7aef[_0xb442('0x1e')];_0x3c03d7[_0xb442('0x5e')]=_0x1b2470[_0xb442('0x20')];_0x3c03d7[_0xb442('0x5f')]=+new Date();var _0x40c4b3='';var _0x53aa70='';var _0x325b25=Object[_0xb442('0x60')](_0x3c03d7);_0x325b25[_0xb442('0x61')]();for(var _0x10071f=0x0;_0x10071f<_0x325b25['length'];_0x10071f++){if(_0x40c4b3!=''){_0x40c4b3+='&';}_0x40c4b3+=_0x325b25[_0x10071f]+'='+encodeURIComponent(_0x3c03d7[_0x325b25[_0x10071f]]);_0x53aa70+=_0x3c03d7[_0x325b25[_0x10071f]];}_0x53aa70+=_0x1a7aef[_0xb442('0x5b')];_0x53aa70=_0x5814a6[_0xb442('0x62')]('md5')[_0xb442('0x16')](_0x53aa70)['digest']('hex');if(_0x40c4b3!==''){_0x40c4b3+='&';}_0x40c4b3+=_0xb442('0x63')+_0x53aa70;var _0x18bdc1={'method':'GET','uri':_0xb442('0x64')+_0x40c4b3,'json':!![]};return rp(_0x18bdc1)[_0xb442('0x15')](function(_0x4604e1){var _0x44ce3f=Object[_0xb442('0x60')](_0x4604e1);if(_0x4604e1[_0x44ce3f[0x0]]['error']&&parseInt(_0x4604e1[_0x44ce3f[0x0]][_0xb442('0x19')])===0x0){var _0x4ba675={'messageId':_0x4604e1[_0x44ce3f[0x0]][_0xb442('0x65')]};if(!_0x1a7aef[_0xb442('0x36')]){_0x4ba675[_0xb442('0x37')]=!![];}return _0x57bab0['update'](_0x4ba675);}else{return logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),'csc',util[_0xb442('0x38')](_0x4604e1[_0xb442('0x19')],{'showHidden':![],'depth':null}));}})[_0xb442('0x18')](function(_0x2dd72f){return logger['error'](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x59'),util[_0xb442('0x38')](_0x2dd72f,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x59'),_0xb442('0x66'));}break;case'clickatell':if(_0x1a7aef[_0xb442('0x5b')]){var _0x42af01={'method':_0xb442('0x32'),'uri':_0xb442('0x67'),'headers':{'Authorization':_0x1a7aef['apiKey']},'body':{'content':_0x1b2470[_0xb442('0x20')],'to':[_0x1b2470[_0xb442('0x1e')]],'from':_0x1a7aef['phone'],'binary':![],'clientMessageId':_0xb442('0x68'),'charset':_0xb442('0x69')},'json':!![]};rp(_0x42af01)[_0xb442('0x15')](function(_0x11cf78){if(!_0x11cf78[_0xb442('0x19')]){var _0x153987={'messageId':_0x11cf78['messages'][0x0]['apiMessageId']};if(!_0x1a7aef['deliveryReport']){_0x153987['read']=!![];}return _0x57bab0[_0xb442('0x16')](_0x153987);}else{return logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x6a'),util[_0xb442('0x38')](_0x11cf78['error'],{'showHidden':![],'depth':null}));}})[_0xb442('0x18')](function(_0x32c194){return logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),'clickatell',util[_0xb442('0x38')](_0x32c194,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x6a'),_0xb442('0x66'));}break;case _0xb442('0x6b'):if(_0x1a7aef[_0xb442('0x5b')]){var _0x50cb6={};var _0x18bdc1={'method':_0xb442('0x32'),'uri':_0xb442('0x6c'),'headers':{'Authorization':_0xb442('0x6d')+_0x1a7aef[_0xb442('0x5b')],'Content-Type':'application/json'},'body':{'from':_0x1a7aef['phone'],'to':_0x1b2470['phone'],'text':_0x1b2470['body']},'json':!![]};return rp(_0x18bdc1)[_0xb442('0x15')](function(_0x3b8aa7){if(_0x3b8aa7[_0xb442('0x6e')]==0xca){_0x50cb6[_0xb442('0x6f')]=_0x3b8aa7;var _0x5efd86={'method':_0xb442('0x32'),'uri':_0xb442('0x70'),'headers':{'Authorization':_0xb442('0x6d')+_0x1a7aef[_0xb442('0x5b')],'Content-Type':'application/json'},'body':{'refid':_0x50cb6[_0xb442('0x6f')]['refid']},'json':!![]};return rp(_0x5efd86)[_0xb442('0x15')](function(_0xa823e0){_0x50cb6[_0xb442('0x71')]=_0xa823e0;var _0x23b043={'messageId':_0x50cb6[_0xb442('0x6f')][_0xb442('0x72')],'read':!![]};return _0x57bab0[_0xb442('0x16')](_0x23b043);});}else{return logger['error'](_0xb442('0x25'),'afterCreate',_0xb442('0x6b'),util['inspect'](_0x3b8aa7,{'showHidden':![],'depth':null}));}})[_0xb442('0x18')](function(_0xe58090){return logger['error'](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x6b'),util[_0xb442('0x38')](_0xe58090,{'showHidden':![],'depth':null}));});}else{return logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x6b'),_0xb442('0x73'));}break;}}})[_0xb442('0x74')](function(){_0x342b44();});}else{_0x342b44();}}},'charset':_0xb442('0x75'),'collate':_0xb442('0x76')});};
\ No newline at end of file
+var _0x2204=['authId','/api/sms/messages/','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','findOne','SmsInteractionId','then','update','catch','error','find','type','twilio','accountSid','authToken','phone','messages','create','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','username','&password=','GET','split','POST','user_key','session_key','internal_order_id','deliveryReport','read','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','format','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0x2204,0x178));var _0x4220=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2204[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4220('0x0'));var util=require('util');var logger=require(_0x4220('0x1'))('api');var moment=require(_0x4220('0x2'));var BPromise=require(_0x4220('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4220('0x4'));var rimraf=require(_0x4220('0x5'));var config=require(_0x4220('0x6'));var attributes=require('./smsMessage.attributes');module[_0x4220('0x7')]=function(_0x1049a4,_0x5426ba){return _0x1049a4['define'](_0x4220('0x8'),attributes,{'tableName':_0x4220('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4220('0xa')]},{'name':_0x4220('0xb'),'fields':[_0x4220('0xc')],'type':_0x4220('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x749d48,_0x4afba9,_0x30d4fb){var _0x178053=_0x1049a4['models'];var _0x57e6eb=_0x749d48[_0x4220('0xe')]({'plain':!![]});if(_0x57e6eb['direction'][_0x4220('0xf')]()==='in'||_0x57e6eb[_0x4220('0x10')][_0x4220('0xf')]()===_0x4220('0x11')&&!_0x57e6eb[_0x4220('0x12')]&&!_[_0x4220('0x13')](_0x57e6eb['UserId'])){_0x178053['SmsInteraction'][_0x4220('0x14')]({'where':{'id':_0x57e6eb[_0x4220('0x15')]}})[_0x4220('0x16')](function(_0x347f41){if(_0x347f41){_0x347f41[_0x4220('0x17')]({'lastMsgAt':_0x57e6eb['createdAt'],'lastMsgDirection':_0x57e6eb[_0x4220('0x10')]['toLowerCase']()});}})[_0x4220('0x18')](function(_0x3bc962){console[_0x4220('0x19')](_0x3bc962);});}if(_0x57e6eb[_0x4220('0x10')]===_0x4220('0x11')&&!_0x57e6eb[_0x4220('0x12')]){var _0x1a3f95;_0x178053['SmsAccount'][_0x4220('0x1a')]({'where':{'id':_0x57e6eb['SmsAccountId']},'raw':!![]})[_0x4220('0x16')](function(_0x4a8eee){_0x1a3f95=_0x4a8eee;if(_0x1a3f95&&_0x1a3f95['type']){switch(_0x1a3f95[_0x4220('0x1b')]){case _0x4220('0x1c'):var _0x5ef0b8=require(_0x4220('0x1c'));if(_0x1a3f95[_0x4220('0x1d')]&&_0x1a3f95[_0x4220('0x1e')]&&_0x1a3f95[_0x4220('0x1f')]){var _0x4245d9=new _0x5ef0b8(_0x1a3f95[_0x4220('0x1d')],_0x1a3f95[_0x4220('0x1e')]);_0x4245d9[_0x4220('0x20')][_0x4220('0x21')]({'body':_0x57e6eb[_0x4220('0xc')],'to':_0x57e6eb['phone'],'from':_0x1a3f95['phone'],'statusCallback':_0x1a3f95['remote']+'/api/sms/messages/'+_0x57e6eb['id']+_0x4220('0x22')+_0x1a3f95[_0x4220('0x23')]})[_0x4220('0x16')](function(_0x363193){if(_0x363193['sid']){return _0x749d48['update']({'messageId':_0x363193[_0x4220('0x24')]});}})['catch'](function(_0x178182){logger['error'](_0x4220('0x25'),_0x4220('0x26'),'twilio',util[_0x4220('0x27')](_0x178182,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4220('0x1c'),_0x4220('0x28'));}break;case _0x4220('0x29'):var _0x21746a=_0x4220('0x2a');if(_0x1a3f95['username']&&_0x1a3f95[_0x4220('0x2b')]){var _0x457582={'recipient':[_0x57e6eb[_0x4220('0x1f')]],'message':_0x57e6eb['body'],'message_type':_0x1a3f95[_0x4220('0x2c')]};var _0x3deb0b={'url':_0x21746a+_0x4220('0x2d')+_0x1a3f95[_0x4220('0x2e')]+_0x4220('0x2f')+_0x1a3f95[_0x4220('0x2b')],'method':_0x4220('0x30')};rp(_0x3deb0b)[_0x4220('0x16')](function(_0x1fd9b5){var _0x321345=_0x1fd9b5[_0x4220('0x31')](';');var _0x261ece={'user_key':_0x321345[0x0],'session_key':_0x321345[0x1]};_0x3deb0b={'url':_0x21746a+'sms','method':_0x4220('0x32'),'headers':{'user_key':_0x261ece[_0x4220('0x33')],'Session_key':_0x261ece[_0x4220('0x34')]},'json':!![],'body':_0x457582};return rp(_0x3deb0b);})[_0x4220('0x16')](function(_0x2532e4){if(_0x2532e4['total_sent']>=0x1){var _0x1b16f6={'messageId':_0x2532e4[_0x4220('0x35')]};if(_0x1a3f95['smsMethod']!=='GP'||!_0x1a3f95[_0x4220('0x36')]){_0x1b16f6[_0x4220('0x37')]=!![];}return _0x749d48[_0x4220('0x17')](_0x1b16f6);}else{return logger['error'](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x29'),util[_0x4220('0x27')](_0x2532e4,{'showHidden':![],'depth':null}));}})[_0x4220('0x18')](function(_0x3fc8c9){return logger[_0x4220('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4220('0x29'),util[_0x4220('0x27')](_0x3fc8c9,{'showHidden':![],'depth':null}));});}else{logger[_0x4220('0x19')](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x29'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4220('0x38'):if(_0x1a3f95['authToken']){var _0x2ba2b3={'recipient':_0x57e6eb[_0x4220('0x1f')],'message':_0x57e6eb[_0x4220('0xc')],'sender':_0x1a3f95[_0x4220('0x39')]||_0x1a3f95[_0x4220('0x1f')],'authorization':_0x1a3f95[_0x4220('0x1e')]};var _0x4afba9={'method':_0x4220('0x32'),'uri':_0x4220('0x3a'),'body':_0x2ba2b3,'json':!![]};rp(_0x4afba9)[_0x4220('0x16')](function(_0x1b1385){var _0x102526={'messageId':_0x1b1385[_0x4220('0x3b')]};if(!_0x1a3f95['deliveryReport']){_0x102526[_0x4220('0x37')]=!![];}return _0x749d48['update'](_0x102526);})['catch'](function(_0x5d71c3){logger['error'](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x38'),util['inspect'](_0x5d71c3,{'showHidden':![],'depth':null}));});}else{logger[_0x4220('0x19')](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x38'),_0x4220('0x3c'));}break;case'clicksend':if(_0x1a3f95['username']&&_0x1a3f95[_0x4220('0x2b')]){var _0x2ba2b3={'messages':[{'source':'xCALLY\x20Motion','to':_0x57e6eb[_0x4220('0x1f')],'body':_0x57e6eb['body'],'from':_0x1a3f95[_0x4220('0x39')]||_0x1a3f95[_0x4220('0x1f')]}]};var _0x3eac3c=util['format']('%s:%s',_0x1a3f95[_0x4220('0x2e')],_0x1a3f95[_0x4220('0x2b')]);var _0x4afba9={'method':_0x4220('0x32'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x2ba2b3,'headers':{'Authorization':util[_0x4220('0x3d')](_0x4220('0x3e'),new Buffer(_0x3eac3c)[_0x4220('0x3f')]('base64'))},'json':!![]};rp(_0x4afba9)[_0x4220('0x16')](function(_0x5d36ef){if(_0x5d36ef['http_code']>=0xc8&&_0x5d36ef[_0x4220('0x40')]<=0xce){if(_0x5d36ef['data']&&_0x5d36ef[_0x4220('0x41')][_0x4220('0x42')]>0x0){var _0x16f70c=_[_0x4220('0x43')](_0x5d36ef[_0x4220('0x41')]['messages']);var _0x59de57={'messageId':_0x16f70c[_0x4220('0x44')]};if(!_0x1a3f95[_0x4220('0x36')]){_0x59de57[_0x4220('0x37')]=!![];}return _0x749d48[_0x4220('0x17')](_0x59de57);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4220('0x26'),_0x4220('0x45'),util['inspect'](_0x5d36ef,{'showHidden':![],'depth':null}));}}else{logger[_0x4220('0x19')](_0x4220('0x25'),'afterCreate',_0x4220('0x45'),util['inspect'](_0x5d36ef,{'showHidden':![],'depth':null}));}})[_0x4220('0x18')](function(_0x12ca8a){logger[_0x4220('0x19')](_0x4220('0x25'),'afterCreate',_0x4220('0x45'),util['inspect'](_0x12ca8a,{'showHidden':![],'depth':null}));});}else{logger[_0x4220('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4220('0x26'),_0x4220('0x45'),_0x4220('0x46'));}break;case _0x4220('0x47'):if(_0x1a3f95[_0x4220('0x48')]&&_0x1a3f95['authToken']){var _0x2ba2b3={'dst':_0x57e6eb[_0x4220('0x1f')],'text':_0x57e6eb[_0x4220('0xc')],'src':_0x1a3f95[_0x4220('0x39')]||_0x1a3f95[_0x4220('0x1f')],'url':_0x1a3f95['remote']+_0x4220('0x49')+_0x57e6eb['id']+_0x4220('0x22')+_0x1a3f95['token']};var _0x3eac3c=util[_0x4220('0x3d')](_0x4220('0x4a'),_0x1a3f95['authId'],_0x1a3f95[_0x4220('0x1e')]);var _0x4afba9={'method':_0x4220('0x32'),'uri':util[_0x4220('0x3d')](_0x4220('0x4b'),_0x1a3f95[_0x4220('0x48')]),'body':_0x2ba2b3,'headers':{'Authorization':util['format'](_0x4220('0x3e'),new Buffer(_0x3eac3c)[_0x4220('0x3f')](_0x4220('0x4c')))},'json':!![]};rp(_0x4afba9)[_0x4220('0x16')](function(_0x2d22c3){var _0x5b4183={'messageId':_0x2d22c3[_0x4220('0x4d')][0x0]};return _0x749d48[_0x4220('0x17')](_0x5b4183);})[_0x4220('0x18')](function(_0x5b3db9){logger[_0x4220('0x19')](_0x4220('0x25'),'afterCreate',_0x4220('0x47'),util[_0x4220('0x27')](_0x5b3db9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4220('0x25'),'afterCreate',_0x4220('0x47'),_0x4220('0x4e'));}break;case _0x4220('0x4f'):if(_0x1a3f95[_0x4220('0x2e')]&&_0x1a3f95[_0x4220('0x2b')]){if(_0x1a3f95[_0x4220('0x50')]){var _0x4eb33b={'method':'POST','uri':_0x1a3f95[_0x4220('0x50')]+_0x4220('0x51'),'body':{'username':_0x1a3f95[_0x4220('0x2e')],'password':_0x1a3f95[_0x4220('0x2b')]},'json':!![]};return rp(_0x4eb33b)[_0x4220('0x16')](function(_0x1f9275){var _0x32d598={'method':'POST','uri':_0x1a3f95[_0x4220('0x50')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1a3f95[_0x4220('0x1f')],'destinations':[{'to':_0x57e6eb[_0x4220('0x1f')]}],'text':_0x57e6eb['body'],'notifyUrl':_0x1a3f95['remote']+'/api/sms/messages/'+_0x57e6eb['id']+_0x4220('0x22')+_0x1a3f95[_0x4220('0x23')],'notifyContentType':_0x4220('0x52'),'callbackData':_0x1a3f95['phone']+';'+_0x57e6eb[_0x4220('0xc')]}]},'headers':{'Authorization':_0x4220('0x53')+_0x1f9275[_0x4220('0x23')]},'json':!![]};return rp(_0x32d598)['then'](function(_0x4af15c){if(_0x4af15c[_0x4220('0x20')]){var _0x490611={'messageId':_0x4af15c[_0x4220('0x20')][0x0]['messageId']};if(!_0x1a3f95[_0x4220('0x36')]){_0x490611[_0x4220('0x37')]=!![];}return _0x749d48['update'](_0x490611);}else{return logger[_0x4220('0x19')](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x4f'),util[_0x4220('0x27')](_0x4af15c,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x3f9d6b){return logger[_0x4220('0x19')](_0x4220('0x25'),'afterCreate',_0x4220('0x4f'),util[_0x4220('0x27')](_0x3f9d6b,{'showHidden':![],'depth':null}));});}else{logger[_0x4220('0x19')](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x4f'),_0x4220('0x54'));}}else{logger[_0x4220('0x19')](_0x4220('0x25'),'afterCreate',_0x4220('0x4f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4220('0x55'):var _0x3d27c3=require(_0x4220('0x56'));if(_0x1a3f95[_0x4220('0x57')]){var _0x57b20a={};_0x57b20a[_0x4220('0x58')]=_0x1a3f95['username'];_0x57b20a[_0x4220('0x1f')]=_0x57e6eb['phone'];_0x57b20a['sender']=_0x1a3f95[_0x4220('0x1f')];_0x57b20a[_0x4220('0x59')]=_0x57e6eb[_0x4220('0xc')];_0x57b20a[_0x4220('0x5a')]=+new Date();var _0x18c5eb='';var _0x2a07c6='';var _0x3d38fa=Object[_0x4220('0x5b')](_0x57b20a);_0x3d38fa[_0x4220('0x5c')]();for(var _0x398409=0x0;_0x398409<_0x3d38fa[_0x4220('0x5d')];_0x398409++){if(_0x18c5eb!=''){_0x18c5eb+='&';}_0x18c5eb+=_0x3d38fa[_0x398409]+'='+encodeURIComponent(_0x57b20a[_0x3d38fa[_0x398409]]);_0x2a07c6+=_0x57b20a[_0x3d38fa[_0x398409]];}_0x2a07c6+=_0x1a3f95[_0x4220('0x57')];_0x2a07c6=_0x3d27c3[_0x4220('0x5e')](_0x4220('0x5f'))[_0x4220('0x17')](_0x2a07c6)[_0x4220('0x60')](_0x4220('0x61'));if(_0x18c5eb!==''){_0x18c5eb+='&';}_0x18c5eb+=_0x4220('0x62')+_0x2a07c6;var _0x3deb0b={'method':_0x4220('0x30'),'uri':'https://sms.csc.lv/external/get/send.php?'+_0x18c5eb,'json':!![]};return rp(_0x3deb0b)[_0x4220('0x16')](function(_0x372316){var _0x213123=Object[_0x4220('0x5b')](_0x372316);if(_0x372316[_0x213123[0x0]][_0x4220('0x19')]&&parseInt(_0x372316[_0x213123[0x0]][_0x4220('0x19')])===0x0){var _0x4e98a5={'messageId':_0x372316[_0x213123[0x0]]['id_sms']};if(!_0x1a3f95[_0x4220('0x36')]){_0x4e98a5['read']=!![];}return _0x749d48['update'](_0x4e98a5);}else{return logger[_0x4220('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4220('0x26'),_0x4220('0x55'),util[_0x4220('0x27')](_0x372316[_0x4220('0x19')],{'showHidden':![],'depth':null}));}})[_0x4220('0x18')](function(_0x258c4d){return logger[_0x4220('0x19')](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x55'),util['inspect'](_0x258c4d,{'showHidden':![],'depth':null}));});}else{logger[_0x4220('0x19')](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x55'),'Missing\x20parameters:\x20apiKey');}break;case _0x4220('0x63'):if(_0x1a3f95['apiKey']){var _0x94405a={'method':_0x4220('0x32'),'uri':_0x4220('0x64'),'headers':{'Authorization':_0x1a3f95[_0x4220('0x57')]},'body':{'content':_0x57e6eb[_0x4220('0xc')],'to':[_0x57e6eb['phone']],'from':_0x1a3f95['phone'],'binary':![],'clientMessageId':_0x4220('0x65'),'charset':'UTF-8'},'json':!![]};rp(_0x94405a)[_0x4220('0x16')](function(_0x3cbf09){if(!_0x3cbf09[_0x4220('0x19')]){var _0x485634={'messageId':_0x3cbf09['messages'][0x0][_0x4220('0x66')]};if(!_0x1a3f95[_0x4220('0x36')]){_0x485634[_0x4220('0x37')]=!![];}return _0x749d48[_0x4220('0x17')](_0x485634);}else{return logger[_0x4220('0x19')](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x63'),util['inspect'](_0x3cbf09[_0x4220('0x19')],{'showHidden':![],'depth':null}));}})[_0x4220('0x18')](function(_0x36ab15){return logger[_0x4220('0x19')](_0x4220('0x25'),'afterCreate','clickatell',util[_0x4220('0x27')](_0x36ab15,{'showHidden':![],'depth':null}));});}else{logger[_0x4220('0x19')](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x63'),_0x4220('0x67'));}break;case _0x4220('0x68'):if(_0x1a3f95[_0x4220('0x57')]){var _0x14b2bd={};var _0x3deb0b={'method':_0x4220('0x32'),'uri':_0x4220('0x69'),'headers':{'Authorization':_0x4220('0x6a')+_0x1a3f95['apiKey'],'Content-Type':_0x4220('0x52')},'body':{'from':_0x1a3f95['phone'],'to':_0x57e6eb[_0x4220('0x1f')],'text':_0x57e6eb['body']},'json':!![]};return rp(_0x3deb0b)[_0x4220('0x16')](function(_0xfb5132){if(_0xfb5132[_0x4220('0x6b')]==0xca){_0x14b2bd[_0x4220('0x6c')]=_0xfb5132;var _0x2d57cb={'method':_0x4220('0x32'),'uri':_0x4220('0x6d'),'headers':{'Authorization':_0x4220('0x6a')+_0x1a3f95['apiKey'],'Content-Type':_0x4220('0x52')},'body':{'refid':_0x14b2bd[_0x4220('0x6c')][_0x4220('0x6e')]},'json':!![]};return rp(_0x2d57cb)['then'](function(_0x1baee6){_0x14b2bd['status']=_0x1baee6;var _0x4baa99={'messageId':_0x14b2bd[_0x4220('0x6c')][_0x4220('0x6e')],'read':!![]};return _0x749d48[_0x4220('0x17')](_0x4baa99);});}else{return logger[_0x4220('0x19')](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x68'),util['inspect'](_0xfb5132,{'showHidden':![],'depth':null}));}})[_0x4220('0x18')](function(_0x443325){return logger[_0x4220('0x19')](_0x4220('0x25'),_0x4220('0x26'),'intelepeer',util[_0x4220('0x27')](_0x443325,{'showHidden':![],'depth':null}));});}else{return logger[_0x4220('0x19')](_0x4220('0x25'),_0x4220('0x26'),_0x4220('0x68'),_0x4220('0x6f'));}break;}}})['finally'](function(){_0x30d4fb();});}else{_0x30d4fb();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js
index 1e98523..fc8bff0 100644
--- a/server/api/smsMessage/smsMessage.rpc.js
+++ b/server/api/smsMessage/smsMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2975=['info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then'];(function(_0x13c635,_0x2021b0){var _0x576ac6=function(_0x573352){while(--_0x573352){_0x13c635['push'](_0x13c635['shift']());}};_0x576ac6(++_0x2021b0);}(_0x2975,0x192));var _0x5297=function(_0x422cfe,_0x54920a){_0x422cfe=_0x422cfe-0x0;var _0x31f9bd=_0x2975[_0x422cfe];return _0x31f9bd;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var moment=require('moment');var BPromise=require(_0x5297('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5297('0x2'));var db=require(_0x5297('0x3'))['db'];var utils=require(_0x5297('0x4'));var logger=require(_0x5297('0x5'))(_0x5297('0x6'));var config=require(_0x5297('0x7'));var jayson=require(_0x5297('0x8'));var client=jayson[_0x5297('0x9')]['http']({'port':0x232a});config[_0x5297('0xa')]=_[_0x5297('0xb')](config[_0x5297('0xa')],{'host':_0x5297('0xc'),'port':0x18eb});var socket=require(_0x5297('0xd'))(new Redis(config[_0x5297('0xa')]));require(_0x5297('0xe'))[_0x5297('0xf')](socket);function respondWithRpcPromise(_0x35c282,_0x1d53e3,_0x5ca71c){return new BPromise(function(_0x37fddc,_0x14e19a){return client[_0x5297('0x10')](_0x35c282,_0x5ca71c)[_0x5297('0x11')](function(_0x2a85b1){logger[_0x5297('0x12')](_0x5297('0x13'),_0x1d53e3,'request\x20sent');logger[_0x5297('0x14')](_0x5297('0x15'),_0x1d53e3,_0x5297('0x16'),JSON[_0x5297('0x17')](_0x2a85b1));if(_0x2a85b1['error']){if(_0x2a85b1[_0x5297('0x18')][_0x5297('0x19')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x1d53e3,_0x2a85b1[_0x5297('0x18')][_0x5297('0x1a')]);return _0x14e19a(_0x2a85b1['error'][_0x5297('0x1a')]);}logger['error'](_0x5297('0x13'),_0x1d53e3,_0x2a85b1[_0x5297('0x18')][_0x5297('0x1a')]);return _0x37fddc(_0x2a85b1['error'][_0x5297('0x1a')]);}else{logger[_0x5297('0x12')](_0x5297('0x13'),_0x1d53e3,_0x5297('0x16'));_0x37fddc(_0x2a85b1[_0x5297('0x1b')][_0x5297('0x1a')]);}})[_0x5297('0x1c')](function(_0x3db466){logger[_0x5297('0x18')]('SmsMessage,\x20%s,\x20%s',_0x1d53e3,_0x3db466);_0x14e19a(_0x3db466);});});}exports['CreateSmsMessage']=function(_0x4a549e){var _0x4a2cc0=this;return new Promise(function(_0x202f0f,_0x513754){return db[_0x5297('0x1d')][_0x5297('0x1e')](_0x4a549e[_0x5297('0x1f')],{'raw':_0x4a549e[_0x5297('0x20')]?_0x4a549e[_0x5297('0x20')][_0x5297('0x21')]===undefined?!![]:![]:!![]})[_0x5297('0x11')](function(_0x102063){logger['info']('CreateSmsMessage',_0x4a549e);logger[_0x5297('0x14')](_0x5297('0x22'),_0x4a549e,JSON[_0x5297('0x17')](_0x102063));_0x202f0f(_0x102063);})[_0x5297('0x1c')](function(_0x6eb5ab){logger['error'](_0x5297('0x22'),_0x6eb5ab[_0x5297('0x1a')],_0x4a549e);_0x513754(_0x4a2cc0[_0x5297('0x18')](0x1f4,_0x6eb5ab[_0x5297('0x1a')]));});});};
\ No newline at end of file
+var _0x4e8c=['request\x20sent','stringify','error','code','message','result','CreateSmsMessage','SmsMessage','create','body','options','raw','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x4e8c,0x91));var _0xc4e8=function(_0x83560f,_0x3d005f){_0x83560f=_0x83560f-0x0;var _0x5d4a9f=_0x4e8c[_0x83560f];return _0x5d4a9f;};'use strict';var _=require(_0xc4e8('0x0'));var util=require(_0xc4e8('0x1'));var moment=require(_0xc4e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc4e8('0x3'));var logger=require(_0xc4e8('0x4'))(_0xc4e8('0x5'));var config=require(_0xc4e8('0x6'));var jayson=require(_0xc4e8('0x7'));var client=jayson[_0xc4e8('0x8')][_0xc4e8('0x9')]({'port':0x232a});config['redis']=_[_0xc4e8('0xa')](config['redis'],{'host':_0xc4e8('0xb'),'port':0x18eb});var socket=require(_0xc4e8('0xc'))(new Redis(config[_0xc4e8('0xd')]));require(_0xc4e8('0xe'))[_0xc4e8('0xf')](socket);function respondWithRpcPromise(_0x140e1a,_0x45ffbf,_0x1a1da2){return new BPromise(function(_0x2f2e34,_0x235910){return client[_0xc4e8('0x10')](_0x140e1a,_0x1a1da2)['then'](function(_0x2cce7d){logger[_0xc4e8('0x11')](_0xc4e8('0x12'),_0x45ffbf,'request\x20sent');logger['debug'](_0xc4e8('0x13'),_0x45ffbf,_0xc4e8('0x14'),JSON[_0xc4e8('0x15')](_0x2cce7d));if(_0x2cce7d['error']){if(_0x2cce7d[_0xc4e8('0x16')][_0xc4e8('0x17')]===0x1f4){logger[_0xc4e8('0x16')](_0xc4e8('0x12'),_0x45ffbf,_0x2cce7d[_0xc4e8('0x16')][_0xc4e8('0x18')]);return _0x235910(_0x2cce7d[_0xc4e8('0x16')][_0xc4e8('0x18')]);}logger[_0xc4e8('0x16')]('SmsMessage,\x20%s,\x20%s',_0x45ffbf,_0x2cce7d[_0xc4e8('0x16')][_0xc4e8('0x18')]);return _0x2f2e34(_0x2cce7d[_0xc4e8('0x16')][_0xc4e8('0x18')]);}else{logger[_0xc4e8('0x11')](_0xc4e8('0x12'),_0x45ffbf,_0xc4e8('0x14'));_0x2f2e34(_0x2cce7d[_0xc4e8('0x19')][_0xc4e8('0x18')]);}})['catch'](function(_0x3b27c8){logger['error'](_0xc4e8('0x12'),_0x45ffbf,_0x3b27c8);_0x235910(_0x3b27c8);});});}exports[_0xc4e8('0x1a')]=function(_0x54d77e){var _0x24b81d=this;return new Promise(function(_0x64395b,_0x3f7b87){return db[_0xc4e8('0x1b')][_0xc4e8('0x1c')](_0x54d77e[_0xc4e8('0x1d')],{'raw':_0x54d77e[_0xc4e8('0x1e')]?_0x54d77e[_0xc4e8('0x1e')][_0xc4e8('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x2c438c){logger['info'](_0xc4e8('0x1a'),_0x54d77e);logger['debug'](_0xc4e8('0x1a'),_0x54d77e,JSON[_0xc4e8('0x15')](_0x2c438c));_0x64395b(_0x2c438c);})[_0xc4e8('0x20')](function(_0x3ea8be){logger[_0xc4e8('0x16')](_0xc4e8('0x1a'),_0x3ea8be[_0xc4e8('0x18')],_0x54d77e);_0x3f7b87(_0x24b81d[_0xc4e8('0x16')](0x1f4,_0x3ea8be['message']));});});};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js
index 60d9c2a..e8351e1 100644
--- a/server/api/smsMessage/smsMessage.socket.js
+++ b/server/api/smsMessage/smsMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7fbe=['save','remove','update','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7fbe,0x8f));var _0xe7fb=function(_0x14f6db,_0x4d9f26){_0x14f6db=_0x14f6db-0x0;var _0x45344d=_0x7fbe[_0x14f6db];return _0x45344d;};'use strict';var SmsMessageEvents=require(_0xe7fb('0x0'));var events=[_0xe7fb('0x1'),_0xe7fb('0x2'),_0xe7fb('0x3')];function createListener(_0x267428,_0x2fdd18){return function(_0x137f39){_0x2fdd18['emit'](_0x267428,_0x137f39);};}function removeListener(_0x1413e0,_0x3ffefe){return function(){SmsMessageEvents[_0xe7fb('0x4')](_0x1413e0,_0x3ffefe);};}exports[_0xe7fb('0x5')]=function(_0x5e7ee0){for(var _0x591bc5=0x0,_0x31fceb=events[_0xe7fb('0x6')];_0x591bc5<_0x31fceb;_0x591bc5++){var _0x2a58f7=events[_0x591bc5];var _0x1f1ccf=createListener(_0xe7fb('0x7')+_0x2a58f7,_0x5e7ee0);SmsMessageEvents['on'](_0x2a58f7,_0x1f1ccf);}};
\ No newline at end of file
+var _0xcce9=['removeListener','register','length','smsMessage:','./smsMessage.events','remove','update','emit'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0xcce9,0x134));var _0x9cce=function(_0x671d70,_0x32dc77){_0x671d70=_0x671d70-0x0;var _0x37a644=_0xcce9[_0x671d70];return _0x37a644;};'use strict';var SmsMessageEvents=require(_0x9cce('0x0'));var events=['save',_0x9cce('0x1'),_0x9cce('0x2')];function createListener(_0x24db1e,_0x1389c8){return function(_0xaff7ad){_0x1389c8[_0x9cce('0x3')](_0x24db1e,_0xaff7ad);};}function removeListener(_0x207b55,_0x57eff1){return function(){SmsMessageEvents[_0x9cce('0x4')](_0x207b55,_0x57eff1);};}exports[_0x9cce('0x5')]=function(_0x20d5ae){for(var _0x50bfda=0x0,_0x15c639=events[_0x9cce('0x6')];_0x50bfda<_0x15c639;_0x50bfda++){var _0x2d16b8=events[_0x50bfda];var _0x32c709=createListener(_0x9cce('0x7')+_0x2d16b8,_0x20d5ae);SmsMessageEvents['on'](_0x2d16b8,_0x32c709);}};
\ No newline at end of file
diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js
index 368aee6..50fa331 100644
--- a/server/api/smsQueue/index.js
+++ b/server/api/smsQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8c93=['show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','put','delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0x8c93,0x96));var _0x38c9=function(_0x1d787e,_0x300518){_0x1d787e=_0x1d787e-0x0;var _0x28b3e2=_0x8c93[_0x1d787e];return _0x28b3e2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x38c9('0x0'));var timeout=require(_0x38c9('0x1'));var express=require(_0x38c9('0x2'));var router=express['Router']();var auth=require(_0x38c9('0x3'));var interaction=require(_0x38c9('0x4'));var config=require(_0x38c9('0x5'));var controller=require(_0x38c9('0x6'));router[_0x38c9('0x7')]('/',auth[_0x38c9('0x8')](),controller['index']);router[_0x38c9('0x7')](_0x38c9('0x9'),auth[_0x38c9('0x8')](),controller[_0x38c9('0xa')]);router[_0x38c9('0x7')](_0x38c9('0xb'),auth['isAuthenticated'](),controller[_0x38c9('0xc')]);router[_0x38c9('0x7')](_0x38c9('0xd'),auth[_0x38c9('0x8')](),controller[_0x38c9('0xe')]);router[_0x38c9('0x7')](_0x38c9('0xf'),auth[_0x38c9('0x8')](),controller[_0x38c9('0x10')]);router[_0x38c9('0x7')]('/:id/users',auth[_0x38c9('0x8')](),controller[_0x38c9('0x11')]);router[_0x38c9('0x12')]('/',auth[_0x38c9('0x8')](),controller[_0x38c9('0x13')]);router['post']('/:id/teams',auth[_0x38c9('0x8')](),controller['addTeams']);router['post'](_0x38c9('0x14'),auth[_0x38c9('0x8')](),controller['addAgents']);router[_0x38c9('0x15')]('/:id',auth[_0x38c9('0x8')](),controller['update']);router[_0x38c9('0x16')](_0x38c9('0xb'),auth['isAuthenticated'](),controller[_0x38c9('0x17')]);router[_0x38c9('0x16')]('/:id/teams',auth[_0x38c9('0x8')](),controller[_0x38c9('0x18')]);router[_0x38c9('0x16')]('/:id/users',auth[_0x38c9('0x8')](),controller[_0x38c9('0x19')]);module[_0x38c9('0x1a')]=router;
\ No newline at end of file
+var _0x3b3a=['create','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post'];(function(_0x5e74e1,_0x18fd1b){var _0x5bcc0c=function(_0x1428c2){while(--_0x1428c2){_0x5e74e1['push'](_0x5e74e1['shift']());}};_0x5bcc0c(++_0x18fd1b);}(_0x3b3a,0x174));var _0xa3b3=function(_0x4a7f88,_0x635486){_0x4a7f88=_0x4a7f88-0x0;var _0x5448a1=_0x3b3a[_0x4a7f88];return _0x5448a1;};'use strict';var multer=require(_0xa3b3('0x0'));var util=require('util');var path=require(_0xa3b3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa3b3('0x2')]();var auth=require(_0xa3b3('0x3'));var interaction=require(_0xa3b3('0x4'));var config=require(_0xa3b3('0x5'));var controller=require(_0xa3b3('0x6'));router[_0xa3b3('0x7')]('/',auth[_0xa3b3('0x8')](),controller[_0xa3b3('0x9')]);router[_0xa3b3('0x7')](_0xa3b3('0xa'),auth[_0xa3b3('0x8')](),controller[_0xa3b3('0xb')]);router[_0xa3b3('0x7')](_0xa3b3('0xc'),auth['isAuthenticated'](),controller[_0xa3b3('0xd')]);router[_0xa3b3('0x7')](_0xa3b3('0xe'),auth[_0xa3b3('0x8')](),controller[_0xa3b3('0xf')]);router['get'](_0xa3b3('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0xa3b3('0x7')](_0xa3b3('0x11'),auth[_0xa3b3('0x8')](),controller[_0xa3b3('0x12')]);router[_0xa3b3('0x13')]('/',auth[_0xa3b3('0x8')](),controller[_0xa3b3('0x14')]);router[_0xa3b3('0x13')]('/:id/teams',auth[_0xa3b3('0x8')](),controller['addTeams']);router[_0xa3b3('0x13')](_0xa3b3('0x11'),auth['isAuthenticated'](),controller[_0xa3b3('0x15')]);router[_0xa3b3('0x16')](_0xa3b3('0xc'),auth['isAuthenticated'](),controller[_0xa3b3('0x17')]);router['delete'](_0xa3b3('0xc'),auth[_0xa3b3('0x8')](),controller[_0xa3b3('0x18')]);router[_0xa3b3('0x19')]('/:id/teams',auth[_0xa3b3('0x8')](),controller[_0xa3b3('0x1a')]);router['delete'](_0xa3b3('0x11'),auth[_0xa3b3('0x8')](),controller[_0xa3b3('0x1b')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js
index 8e73cd7..9ffd5ad 100644
--- a/server/api/smsQueue/smsQueue.attributes.js
+++ b/server/api/smsQueue/smsQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1a8d=['INTEGER','rrmemory','roundrobin','STRING','name'];(function(_0x3bd8aa,_0x225695){var _0x976907=function(_0xd4c77a){while(--_0xd4c77a){_0x3bd8aa['push'](_0x3bd8aa['shift']());}};_0x976907(++_0x225695);}(_0x1a8d,0xb2));var _0xd1a8=function(_0xbac667,_0x3f113f){_0xbac667=_0xbac667-0x0;var _0xfce68f=_0x1a8d[_0xbac667];return _0xfce68f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd1a8('0x0')],'unique':_0xd1a8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd1a8('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd1a8('0x3'),'beepall',_0xd1a8('0x4'))}};
\ No newline at end of file
+var _0x2ae5=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x890db7,_0x4dcf2c){var _0x46412=function(_0x2685df){while(--_0x2685df){_0x890db7['push'](_0x890db7['shift']());}};_0x46412(++_0x4dcf2c);}(_0x2ae5,0x16c));var _0x52ae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2ae5[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x52ae('0x0'));module[_0x52ae('0x1')]={'name':{'type':Sequelize[_0x52ae('0x2')],'unique':_0x52ae('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x52ae('0x2')]},'timeout':{'type':Sequelize[_0x52ae('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x52ae('0x5')](_0x52ae('0x6'),_0x52ae('0x7'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js
index 8ad6868..ecbfd98 100644
--- a/server/api/smsQueue/smsQueue.controller.js
+++ b/server/api/smsQueue/smsQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca66=['spread','isArray','getAgents','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','index','SmsQueue','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','type','key','VIRTUAL','field','options','include','findAll','catch','params','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','rows','format','%s/%s','smsPause','createdAt','getTeams','Team','addTeams','teams','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','SELECT','includes','all','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xca66,0x8b));var _0x6ca6=function(_0x15130f,_0x332f3f){_0x15130f=_0x15130f-0x0;var _0x255ee9=_0xca66[_0x15130f];return _0x255ee9;};'use strict';var pdf=require(_0x6ca6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ca6('0x1'));var jsonpatch=require(_0x6ca6('0x2'));var rp=require(_0x6ca6('0x3'));var moment=require('moment');var BPromise=require(_0x6ca6('0x4'));var Mustache=require('mustache');var util=require(_0x6ca6('0x5'));var path=require('path');var sox=require(_0x6ca6('0x6'));var csv=require(_0x6ca6('0x7'));var ejs=require(_0x6ca6('0x8'));var fs=require('fs');var _=require(_0x6ca6('0x9'));var squel=require(_0x6ca6('0xa'));var crypto=require(_0x6ca6('0xb'));var jsforce=require(_0x6ca6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6ca6('0x7'));var querystring=require(_0x6ca6('0xd'));var Papa=require(_0x6ca6('0xe'));var Redis=require(_0x6ca6('0xf'));var authService=require(_0x6ca6('0x10'));var qs=require(_0x6ca6('0x11'));var hardwareService=require(_0x6ca6('0x12'));var logger=require('../../config/logger')(_0x6ca6('0x13'));var utils=require(_0x6ca6('0x14'));var config=require(_0x6ca6('0x15'));var db=require(_0x6ca6('0x16'))['db'];config[_0x6ca6('0x17')]=_[_0x6ca6('0x18')](config['redis'],{'host':_0x6ca6('0x19'),'port':0x18eb});var socket=require(_0x6ca6('0x1a'))(new Redis(config['redis']));require(_0x6ca6('0x1b'))[_0x6ca6('0x1c')](socket);function respondWithStatusCode(_0x3f417f,_0x3570f1){_0x3570f1=_0x3570f1||0xcc;return function(_0xc774c){if(_0xc774c){return _0x3f417f[_0x6ca6('0x1d')](_0x3570f1);}return _0x3f417f['status'](_0x3570f1)['end']();};}function respondWithResult(_0x5785b1,_0x36ff3e){_0x36ff3e=_0x36ff3e||0xc8;return function(_0x19e94f){if(_0x19e94f){return _0x5785b1[_0x6ca6('0x1e')](_0x36ff3e)[_0x6ca6('0x1f')](_0x19e94f);}};}function respondWithFilteredResult(_0x2c4a5c,_0x3d7f3f){return function(_0x25dc6c){if(_0x25dc6c){var _0x4f056d=_0x25dc6c[_0x6ca6('0x20')],_0x2391ce=_0x3d7f3f[_0x6ca6('0x21')],_0x10be57=_0x3d7f3f[_0x6ca6('0x21')]+_0x3d7f3f[_0x6ca6('0x22')],_0xc97f0;if(_0x10be57>=_0x4f056d){_0x10be57=_0x4f056d;_0xc97f0=0xc8;}else{_0xc97f0=0xce;}_0x2c4a5c[_0x6ca6('0x1e')](_0xc97f0);return _0x2c4a5c[_0x6ca6('0x23')](_0x6ca6('0x24'),_0x2391ce+'-'+_0x10be57+'/'+_0x4f056d)[_0x6ca6('0x1f')](_0x25dc6c);}return null;};}function patchUpdates(_0x4c3be9){return function(_0x28a982){try{jsonpatch[_0x6ca6('0x25')](_0x28a982,_0x4c3be9,!![]);}catch(_0x38cad4){return BPromise[_0x6ca6('0x26')](_0x38cad4);}return _0x28a982[_0x6ca6('0x27')]();};}function saveUpdates(_0x438694,_0x593f15){return function(_0xfb962d){if(_0xfb962d){return _0xfb962d[_0x6ca6('0x28')](_0x438694)['then'](function(_0x4927c1){return _0x4927c1;});}return null;};}function removeEntity(_0xfbf496,_0x216701){return function(_0xfe0760){if(_0xfe0760){return _0xfe0760[_0x6ca6('0x29')]()[_0x6ca6('0x2a')](function(){var _0x541122=_0xfe0760[_0x6ca6('0x2b')]({'plain':!![]});var _0x1d6caa=_0x6ca6('0x2c');return db[_0x6ca6('0x2d')][_0x6ca6('0x29')]({'where':{'type':_0x1d6caa,'resourceId':_0x541122['id']}})[_0x6ca6('0x2a')](function(){return _0xfe0760;});})[_0x6ca6('0x2a')](function(){_0xfbf496[_0x6ca6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55b07f,_0x144ec5){return function(_0x9467bd){if(!_0x9467bd){_0x55b07f[_0x6ca6('0x1d')](0x194);}return _0x9467bd;};}function handleError(_0x141c0f,_0x552f3e){_0x552f3e=_0x552f3e||0x1f4;return function(_0x5ea6f7){logger[_0x6ca6('0x2e')](_0x5ea6f7['stack']);if(_0x5ea6f7['name']){delete _0x5ea6f7[_0x6ca6('0x2f')];}_0x141c0f[_0x6ca6('0x1e')](_0x552f3e)['send'](_0x5ea6f7);};}exports[_0x6ca6('0x30')]=function(_0xf829ee,_0xac50e8){var _0x566543={},_0x484411={},_0x28af50={'count':0x0,'rows':[]};var _0x23112a=db[_0x6ca6('0x31')][_0x6ca6('0x32')];_0x484411['model']=_[_0x6ca6('0x33')](_0x23112a);_0x484411[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0xf829ee[_0x6ca6('0x34')]);_0x484411['filters']=_['intersection'](_0x484411['model'],_0x484411['query']);_0x566543['attributes']=_[_0x6ca6('0x35')](_0x484411[_0x6ca6('0x36')],qs[_0x6ca6('0x37')](_0xf829ee['query'][_0x6ca6('0x37')]));_0x566543[_0x6ca6('0x38')]=_0x566543[_0x6ca6('0x38')][_0x6ca6('0x39')]?_0x566543['attributes']:_0x484411[_0x6ca6('0x36')];if(!_0xf829ee[_0x6ca6('0x34')][_0x6ca6('0x3a')](_0x6ca6('0x3b'))){_0x566543['limit']=qs[_0x6ca6('0x22')](_0xf829ee['query'][_0x6ca6('0x22')]);_0x566543['offset']=qs['offset'](_0xf829ee[_0x6ca6('0x34')][_0x6ca6('0x21')]);}_0x566543[_0x6ca6('0x3c')]=qs[_0x6ca6('0x3d')](_0xf829ee['query']['sort']);_0x566543[_0x6ca6('0x3e')]=qs[_0x6ca6('0x3f')](_['pick'](_0xf829ee[_0x6ca6('0x34')],_0x484411['filters']));if(_0xf829ee[_0x6ca6('0x34')]['filter']){_0x566543[_0x6ca6('0x3e')]=_[_0x6ca6('0x40')](_0x566543[_0x6ca6('0x3e')],{'$or':_[_0x6ca6('0x41')](_0x23112a,function(_0x33b5e6){if(_0x33b5e6[_0x6ca6('0x42')][_0x6ca6('0x43')]!==_0x6ca6('0x44')){var _0x5c3ffc={};_0x5c3ffc[_0x33b5e6[_0x6ca6('0x45')]]={'$like':'%'+_0xf829ee['query']['filter']+'%'};return _0x5c3ffc;}})});}_0x566543=_[_0x6ca6('0x40')]({},_0x566543,_0xf829ee[_0x6ca6('0x46')]);var _0x52cc41={'where':_0x566543[_0x6ca6('0x3e')]};return db['SmsQueue'][_0x6ca6('0x20')](_0x52cc41)[_0x6ca6('0x2a')](function(_0x3f9e8f){_0x28af50[_0x6ca6('0x20')]=_0x3f9e8f;if(_0xf829ee['query']['includeAll']){_0x566543[_0x6ca6('0x47')]=[{'all':!![]}];}return db[_0x6ca6('0x31')][_0x6ca6('0x48')](_0x566543);})[_0x6ca6('0x2a')](function(_0x4e6d4){_0x28af50['rows']=_0x4e6d4;return _0x28af50;})[_0x6ca6('0x2a')](respondWithFilteredResult(_0xac50e8,_0x566543))[_0x6ca6('0x49')](handleError(_0xac50e8,null));};exports['show']=function(_0x317b5e,_0x3b60db){var _0x323051={'raw':!![],'where':{'id':_0x317b5e[_0x6ca6('0x4a')]['id']}},_0x2fda54={};_0x2fda54[_0x6ca6('0x36')]=_[_0x6ca6('0x33')](db[_0x6ca6('0x31')][_0x6ca6('0x32')]);_0x2fda54['query']=_[_0x6ca6('0x33')](_0x317b5e[_0x6ca6('0x34')]);_0x2fda54[_0x6ca6('0x3f')]=_[_0x6ca6('0x35')](_0x2fda54[_0x6ca6('0x36')],_0x2fda54[_0x6ca6('0x34')]);_0x323051[_0x6ca6('0x38')]=_[_0x6ca6('0x35')](_0x2fda54['model'],qs['fields'](_0x317b5e[_0x6ca6('0x34')][_0x6ca6('0x37')]));_0x323051[_0x6ca6('0x38')]=_0x323051[_0x6ca6('0x38')][_0x6ca6('0x39')]?_0x323051[_0x6ca6('0x38')]:_0x2fda54[_0x6ca6('0x36')];if(_0x317b5e['query']['includeAll']){_0x323051[_0x6ca6('0x47')]=[{'all':!![]}];}_0x323051=_[_0x6ca6('0x40')]({},_0x323051,_0x317b5e['options']);return db[_0x6ca6('0x31')][_0x6ca6('0x4b')](_0x323051)[_0x6ca6('0x2a')](handleEntityNotFound(_0x3b60db,null))[_0x6ca6('0x2a')](respondWithResult(_0x3b60db,null))[_0x6ca6('0x49')](handleError(_0x3b60db,null));};exports[_0x6ca6('0x4c')]=function(_0x13efc1,_0x5f27f5){return db[_0x6ca6('0x31')][_0x6ca6('0x4c')](_0x13efc1[_0x6ca6('0x4d')],{})['then'](function(_0x408df3){var _0x4dd78d=_0x13efc1[_0x6ca6('0x4e')]['get']({'plain':!![]});if(!_0x4dd78d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4dd78d['role']===_0x6ca6('0x4e')){var _0x1603a7=_0x408df3[_0x6ca6('0x2b')]({'plain':!![]});var _0x5546c3=_0x6ca6('0x2c');return db['UserProfileSection'][_0x6ca6('0x4b')]({'where':{'name':_0x5546c3,'userProfileId':_0x4dd78d[_0x6ca6('0x4f')]},'raw':!![]})[_0x6ca6('0x2a')](function(_0x18602d){if(_0x18602d&&_0x18602d[_0x6ca6('0x50')]===0x0){return db[_0x6ca6('0x2d')][_0x6ca6('0x4c')]({'name':_0x1603a7[_0x6ca6('0x2f')],'resourceId':_0x1603a7['id'],'type':_0x18602d[_0x6ca6('0x2f')],'sectionId':_0x18602d['id']},{})[_0x6ca6('0x2a')](function(){return _0x408df3;});}else{return _0x408df3;}})[_0x6ca6('0x49')](function(_0x5578fb){logger[_0x6ca6('0x2e')](_0x6ca6('0x51'),_0x5578fb);throw _0x5578fb;});}return _0x408df3;})[_0x6ca6('0x2a')](respondWithResult(_0x5f27f5,0xc9))[_0x6ca6('0x49')](handleError(_0x5f27f5,null));};exports[_0x6ca6('0x28')]=function(_0x594209,_0x14d87a){if(_0x594209[_0x6ca6('0x4d')]['id']){delete _0x594209[_0x6ca6('0x4d')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x594209['params']['id']}})['then'](handleEntityNotFound(_0x14d87a,null))[_0x6ca6('0x2a')](saveUpdates(_0x594209[_0x6ca6('0x4d')],null))[_0x6ca6('0x2a')](respondWithResult(_0x14d87a,null))['catch'](handleError(_0x14d87a,null));};exports['destroy']=function(_0x387adf,_0x2cbf30){return db[_0x6ca6('0x31')]['find']({'where':{'id':_0x387adf[_0x6ca6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2cbf30,null))[_0x6ca6('0x2a')](removeEntity(_0x2cbf30,null))[_0x6ca6('0x49')](handleError(_0x2cbf30,null));};exports[_0x6ca6('0x52')]=function(_0x16af08,_0x511eb1){return db[_0x6ca6('0x31')]['describe']()['then'](respondWithResult(_0x511eb1,null))[_0x6ca6('0x49')](handleError(_0x511eb1,null));};exports[_0x6ca6('0x53')]=function(_0x1b9da5,_0x35854a,_0x50321f){var _0x2b893c={'raw':!![],'where':{}},_0x1c12ae={},_0x2c4053;return db[_0x6ca6('0x31')][_0x6ca6('0x54')]({'where':{'id':_0x1b9da5[_0x6ca6('0x4a')]['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x35854a,null))[_0x6ca6('0x2a')](function(_0x98004d){if(_0x98004d){_0x2c4053=_0x98004d[_0x6ca6('0x2b')]({'plain':!![]});_0x1c12ae[_0x6ca6('0x36')]=_[_0x6ca6('0x33')](db[_0x6ca6('0x55')][_0x6ca6('0x32')]);_0x1c12ae[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0x1b9da5['query']);_0x1c12ae[_0x6ca6('0x3f')]=_[_0x6ca6('0x35')](_0x1c12ae[_0x6ca6('0x36')],_0x1c12ae[_0x6ca6('0x34')]);_0x2b893c[_0x6ca6('0x38')]=_[_0x6ca6('0x35')](_0x1c12ae[_0x6ca6('0x36')],qs[_0x6ca6('0x37')](_0x1b9da5[_0x6ca6('0x34')][_0x6ca6('0x37')]));_0x2b893c[_0x6ca6('0x38')]=_0x2b893c[_0x6ca6('0x38')][_0x6ca6('0x39')]?_0x2b893c[_0x6ca6('0x38')]:_0x1c12ae[_0x6ca6('0x36')];if(!_0x1b9da5[_0x6ca6('0x34')]['hasOwnProperty'](_0x6ca6('0x3b'))){_0x2b893c[_0x6ca6('0x22')]=qs[_0x6ca6('0x22')](_0x1b9da5[_0x6ca6('0x34')][_0x6ca6('0x22')]);_0x2b893c[_0x6ca6('0x21')]=qs['offset'](_0x1b9da5['query']['offset']);}_0x2b893c[_0x6ca6('0x3c')]=qs[_0x6ca6('0x3d')](_0x1b9da5['query'][_0x6ca6('0x3d')]);_0x2b893c[_0x6ca6('0x3e')]=qs[_0x6ca6('0x3f')](_['pick'](_0x1b9da5[_0x6ca6('0x34')],_0x1c12ae[_0x6ca6('0x3f')]));_0x2b893c[_0x6ca6('0x3e')][_0x6ca6('0x56')]=_0x98004d['id'];if(_0x1b9da5[_0x6ca6('0x34')]['filter']){_0x2b893c['where']=_[_0x6ca6('0x40')](_0x2b893c[_0x6ca6('0x3e')],{'$or':_['map'](_0x2b893c[_0x6ca6('0x38')],function(_0x43ec39){var _0x217dc8={};_0x217dc8[_0x43ec39]={'$like':'%'+_0x1b9da5[_0x6ca6('0x34')][_0x6ca6('0x57')]+'%'};return _0x217dc8;})});}_0x2b893c=_[_0x6ca6('0x40')]({},_0x2b893c,_0x1b9da5[_0x6ca6('0x46')]);return db[_0x6ca6('0x55')][_0x6ca6('0x48')](_0x2b893c);}})['then'](function(_0x4d6098){if(_0x4d6098){return db[_0x6ca6('0x58')][_0x6ca6('0x59')]({'where':{'id':_[_0x6ca6('0x41')](_0x4d6098,_0x6ca6('0x5a')),'role':_0x6ca6('0x5b')},'attributes':['id',_0x6ca6('0x2f'),'smsPause',_0x6ca6('0x5c'),'createdAt']});}})[_0x6ca6('0x2a')](function(_0x44bbe6){if(_0x44bbe6){return{'count':_0x44bbe6[_0x6ca6('0x20')],'rows':_[_0x6ca6('0x41')](_0x44bbe6[_0x6ca6('0x5d')],function(_0x5a2775){return{'membername':_0x5a2775['name'],'UserId':_0x5a2775['id'],'queue_name':_0x2c4053[_0x6ca6('0x2f')],'SmsQueueId':_0x2c4053['id'],'interface':util[_0x6ca6('0x5e')](_0x6ca6('0x5f'),'SIP',_0x5a2775[_0x6ca6('0x2f')]),'penalty':0x0,'paused':_0x5a2775[_0x6ca6('0x60')],'createdAt':_0x5a2775[_0x6ca6('0x61')],'updatedAt':_0x5a2775[_0x6ca6('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x35854a,_0x2b893c))[_0x6ca6('0x49')](handleError(_0x35854a,null));};exports[_0x6ca6('0x62')]=function(_0x3637c9,_0x48d7cb,_0x680c6f){var _0x574c7a={};var _0x6f225b={};var _0x1652f7;var _0x246535;return db[_0x6ca6('0x31')][_0x6ca6('0x54')]({'where':{'id':_0x3637c9[_0x6ca6('0x4a')]['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x48d7cb,null))['then'](function(_0x5d9d14){if(_0x5d9d14){_0x1652f7=_0x5d9d14;_0x6f225b[_0x6ca6('0x36')]=_[_0x6ca6('0x33')](db[_0x6ca6('0x63')]['rawAttributes']);_0x6f225b[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0x3637c9[_0x6ca6('0x34')]);_0x6f225b[_0x6ca6('0x3f')]=_[_0x6ca6('0x35')](_0x6f225b[_0x6ca6('0x36')],_0x6f225b['query']);_0x574c7a['attributes']=_[_0x6ca6('0x35')](_0x6f225b['model'],qs[_0x6ca6('0x37')](_0x3637c9[_0x6ca6('0x34')][_0x6ca6('0x37')]));_0x574c7a[_0x6ca6('0x38')]=_0x574c7a[_0x6ca6('0x38')][_0x6ca6('0x39')]?_0x574c7a[_0x6ca6('0x38')]:_0x6f225b['model'];_0x574c7a[_0x6ca6('0x3c')]=qs[_0x6ca6('0x3d')](_0x3637c9[_0x6ca6('0x34')][_0x6ca6('0x3d')]);_0x574c7a['where']=qs['filters'](_['pick'](_0x3637c9[_0x6ca6('0x34')],_0x6f225b[_0x6ca6('0x3f')]));if(_0x3637c9[_0x6ca6('0x34')][_0x6ca6('0x57')]){_0x574c7a[_0x6ca6('0x3e')]=_['merge'](_0x574c7a[_0x6ca6('0x3e')],{'$or':_[_0x6ca6('0x41')](_0x574c7a['attributes'],function(_0x233193){var _0x33791f={};_0x33791f[_0x233193]={'$like':'%'+_0x3637c9[_0x6ca6('0x34')]['filter']+'%'};return _0x33791f;})});}_0x574c7a=_[_0x6ca6('0x40')]({},_0x574c7a,_0x3637c9[_0x6ca6('0x46')]);return _0x1652f7['getTeams'](_0x574c7a);}})[_0x6ca6('0x2a')](function(_0x5d97d4){if(_0x5d97d4){_0x246535=_0x5d97d4[_0x6ca6('0x39')];if(!_0x3637c9[_0x6ca6('0x34')][_0x6ca6('0x3a')](_0x6ca6('0x3b'))){_0x574c7a[_0x6ca6('0x22')]=qs['limit'](_0x3637c9[_0x6ca6('0x34')]['limit']);_0x574c7a[_0x6ca6('0x21')]=qs[_0x6ca6('0x21')](_0x3637c9[_0x6ca6('0x34')]['offset']);}return _0x1652f7['getTeams'](_0x574c7a);}})[_0x6ca6('0x2a')](function(_0x250106){if(_0x250106){return _0x250106?{'count':_0x246535,'rows':_0x250106}:null;}})[_0x6ca6('0x2a')](respondWithResult(_0x48d7cb,null))[_0x6ca6('0x49')](handleError(_0x48d7cb,null));};exports[_0x6ca6('0x64')]=function(_0x2b224f,_0x1b8c6e,_0x43f97f){var _0x5ed025=_0x2b224f[_0x6ca6('0x4d')][_0x6ca6('0x65')];return db[_0x6ca6('0x63')][_0x6ca6('0x48')]({'where':{'id':_[_0x6ca6('0x41')](_0x5ed025,'id')},'attributes':['id'],'include':[{'model':db[_0x6ca6('0x58')],'as':_0x6ca6('0x66'),'attributes':['id',_0x6ca6('0x2f'),_0x6ca6('0x67'),_0x6ca6('0x68'),'interface'],'raw':!![]}]})[_0x6ca6('0x2a')](function(_0x2753e5){if(_0x2753e5){var _0x2b0a5b=_[_0x6ca6('0x69')](_0x2753e5,function(_0x471049){var _0x1e3c64=_0x471049['get']({'plain':!![]});return _0x1e3c64[_0x6ca6('0x66')];});return db[_0x6ca6('0x31')][_0x6ca6('0x4b')]({'where':{'id':_0x2b224f['params']['id']}})[_0x6ca6('0x2a')](function(_0x4d5c23){return db[_0x6ca6('0x6a')][_0x6ca6('0x6b')](function(_0x435e0d){return _0x4d5c23['addTeams'](_[_0x6ca6('0x41')](_0x5ed025,'id'),{'transaction':_0x435e0d})['then'](function(){return BPromise[_0x6ca6('0x6c')](_0x2b0a5b,function(_0x5a1da4){return db['UserSmsQueue'][_0x6ca6('0x6d')]({'where':{'UserId':_0x5a1da4['id'],'SmsQueueId':_0x2b224f[_0x6ca6('0x4a')]['id']},'transaction':_0x435e0d});});})[_0x6ca6('0x2a')](function(){_0x2b0a5b[_0x6ca6('0x6e')](function(_0x3aeba2){socket['emit'](_0x6ca6('0x6f'),{'UserId':_0x3aeba2['id'],'SmsQueueId':_0x4d5c23['id']});});});});});}})[_0x6ca6('0x2a')](respondWithStatusCode(_0x1b8c6e,null))[_0x6ca6('0x49')](handleError(_0x1b8c6e,null));};exports[_0x6ca6('0x70')]=function(_0x231894,_0x203030,_0x5e6f79){return db[_0x6ca6('0x63')][_0x6ca6('0x48')]({'where':{'id':_0x231894[_0x6ca6('0x34')][_0x6ca6('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6ca6('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x203030,null))[_0x6ca6('0x2a')](function(_0x54a9c0){var _0x1b04cd=_[_0x6ca6('0x41')](_0x54a9c0,'id');var _0x239cf5=[];var _0x5a7711=[];var _0x31cec5=squel[_0x6ca6('0x72')]();_0x31cec5['field'](_0x6ca6('0x73'))['from'](_0x6ca6('0x74'),'tq')[_0x6ca6('0x75')](_0x6ca6('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6ca6('0x3e')]('SmsQueueId\x20=\x20?',_0x231894[_0x6ca6('0x4a')]['id']);for(var _0x4c0dc3=0x0;_0x4c0dc3<_0x54a9c0[_0x6ca6('0x39')];_0x4c0dc3+=0x1){let _0x20f752=_0x54a9c0[_0x4c0dc3];for(var _0x49d7a6=0x0;_0x49d7a6<_0x20f752[_0x6ca6('0x66')][_0x6ca6('0x39')];_0x49d7a6+=0x1){let _0x50be27=_0x20f752[_0x6ca6('0x66')][_0x49d7a6];var _0x29bb05=_0x31cec5[_0x6ca6('0x77')]();_0x29bb05[_0x6ca6('0x3e')](_0x6ca6('0x78'),_0x50be27['id']);_0x5a7711[_0x6ca6('0x79')](db[_0x6ca6('0x6a')][_0x6ca6('0x34')](_0x29bb05['toString'](),{'type':db[_0x6ca6('0x6a')]['QueryTypes'][_0x6ca6('0x7a')]})['then'](function(_0x49a777){if(_0x49a777[_0x6ca6('0x39')]===0x1){return _0x50be27['id'];}else{var _0x327de1=_['every'](_[_0x6ca6('0x41')](_0x49a777,'TeamId'),function(_0x575777){return _[_0x6ca6('0x7b')](_0x1b04cd,_0x575777);});if(_0x327de1){return _0x50be27['id'];}}}));}}return BPromise[_0x6ca6('0x7c')](_0x5a7711)[_0x6ca6('0x2a')](function(_0x1ae672){_0x239cf5=_(_0x239cf5)[_0x6ca6('0x7d')](_0x1ae672)[_0x6ca6('0x7e')]()[_0x6ca6('0x7f')]();return db[_0x6ca6('0x31')][_0x6ca6('0x4b')]({'where':{'id':_0x231894['params']['id']}})[_0x6ca6('0x2a')](function(_0x5f57a8){return db['sequelize']['transaction'](function(_0x138e13){return _0x5f57a8[_0x6ca6('0x70')](_0x231894[_0x6ca6('0x34')][_0x6ca6('0x71')],{'transaction':_0x138e13})[_0x6ca6('0x2a')](function(){if(!_[_0x6ca6('0x80')](_0x239cf5)){return _0x5f57a8[_0x6ca6('0x81')](_0x239cf5,{'transaction':_0x138e13});}})[_0x6ca6('0x2a')](function(){_0x239cf5[_0x6ca6('0x6e')](function(_0x377b88){socket[_0x6ca6('0x82')](_0x6ca6('0x83'),{'UserId':_0x377b88,'SmsQueueId':_0x5f57a8['id']});});});});});});})[_0x6ca6('0x2a')](respondWithStatusCode(_0x203030,null))[_0x6ca6('0x49')](handleError(_0x203030,null));};exports[_0x6ca6('0x84')]=function(_0x151e6b,_0x414c95,_0x4badbe){return db['SmsQueue'][_0x6ca6('0x4b')]({'where':{'id':_0x151e6b[_0x6ca6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x414c95,null))['then'](function(_0x9edf69){if(_0x9edf69){return _0x9edf69[_0x6ca6('0x84')](_0x151e6b[_0x6ca6('0x4d')][_0x6ca6('0x71')],_['omit'](_0x151e6b[_0x6ca6('0x4d')],[_0x6ca6('0x71'),'id'])||{})[_0x6ca6('0x85')](function(_0x17ed8a){for(var _0x387c7e=0x0;_0x387c7e<_0x151e6b[_0x6ca6('0x4d')][_0x6ca6('0x71')][_0x6ca6('0x39')];_0x387c7e+=0x1){socket[_0x6ca6('0x82')](_0x6ca6('0x6f'),{'UserId':_0x151e6b[_0x6ca6('0x4d')]['ids'][_0x387c7e],'SmsQueueId':_0x151e6b[_0x6ca6('0x4a')]['id']});}return _0x17ed8a;});}})[_0x6ca6('0x2a')](respondWithResult(_0x414c95,null))[_0x6ca6('0x49')](handleError(_0x414c95,null));};exports['removeAgents']=function(_0x49945e,_0x1abfda,_0x10916e){return db[_0x6ca6('0x31')][_0x6ca6('0x4b')]({'where':{'id':_0x49945e['params']['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x1abfda,null))[_0x6ca6('0x2a')](function(_0x333596){if(_0x333596){return _0x333596[_0x6ca6('0x81')](_0x49945e[_0x6ca6('0x34')][_0x6ca6('0x71')])[_0x6ca6('0x2a')](function(){if(_[_0x6ca6('0x86')](_0x49945e[_0x6ca6('0x34')][_0x6ca6('0x71')])){for(var _0x81faf=0x0;_0x81faf<_0x49945e[_0x6ca6('0x34')][_0x6ca6('0x71')][_0x6ca6('0x39')];_0x81faf+=0x1){socket[_0x6ca6('0x82')](_0x6ca6('0x83'),{'UserId':Number(_0x49945e[_0x6ca6('0x34')][_0x6ca6('0x71')][_0x81faf]),'SmsQueueId':Number(_0x49945e['params']['id'])});}}else{socket['emit'](_0x6ca6('0x83'),{'UserId':Number(_0x49945e['query'][_0x6ca6('0x71')]),'SmsQueueId':Number(_0x49945e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1abfda,null))[_0x6ca6('0x49')](handleError(_0x1abfda,null));};exports[_0x6ca6('0x87')]=function(_0x281b6e,_0x3cb167,_0x4b830d){var _0x4d5528={};var _0x34ea3e={};var _0x3050a6;var _0x3fc98e;return db[_0x6ca6('0x31')]['findOne']({'where':{'id':_0x281b6e[_0x6ca6('0x4a')]['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x3cb167,null))[_0x6ca6('0x2a')](function(_0x5de503){if(_0x5de503){_0x3050a6=_0x5de503;_0x34ea3e[_0x6ca6('0x36')]=_['keys'](db[_0x6ca6('0x58')][_0x6ca6('0x32')]);_0x34ea3e[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0x281b6e[_0x6ca6('0x34')]);_0x34ea3e[_0x6ca6('0x3f')]=_[_0x6ca6('0x35')](_0x34ea3e[_0x6ca6('0x36')],_0x34ea3e[_0x6ca6('0x34')]);_0x4d5528[_0x6ca6('0x38')]=_[_0x6ca6('0x35')](_0x34ea3e[_0x6ca6('0x36')],qs['fields'](_0x281b6e[_0x6ca6('0x34')][_0x6ca6('0x37')]));_0x4d5528[_0x6ca6('0x38')]=_0x4d5528[_0x6ca6('0x38')][_0x6ca6('0x39')]?_0x4d5528[_0x6ca6('0x38')]:_0x34ea3e[_0x6ca6('0x36')];_0x4d5528[_0x6ca6('0x3c')]=qs[_0x6ca6('0x3d')](_0x281b6e[_0x6ca6('0x34')]['sort']);_0x4d5528['where']=qs[_0x6ca6('0x3f')](_['pick'](_0x281b6e[_0x6ca6('0x34')],_0x34ea3e[_0x6ca6('0x3f')]));if(_0x281b6e[_0x6ca6('0x34')][_0x6ca6('0x57')]){_0x4d5528['where']=_['merge'](_0x4d5528['where'],{'$or':_[_0x6ca6('0x41')](_0x4d5528[_0x6ca6('0x38')],function(_0x3564c1){var _0x4721d8={};_0x4721d8[_0x3564c1]={'$like':'%'+_0x281b6e[_0x6ca6('0x34')][_0x6ca6('0x57')]+'%'};return _0x4721d8;})});}_0x4d5528=_['merge']({},_0x4d5528,_0x281b6e[_0x6ca6('0x46')]);return _0x3050a6[_0x6ca6('0x87')](_0x4d5528);}})[_0x6ca6('0x2a')](function(_0x1b270c){if(_0x1b270c){_0x3fc98e=_0x1b270c[_0x6ca6('0x39')];if(!_0x281b6e['query'][_0x6ca6('0x3a')](_0x6ca6('0x3b'))){_0x4d5528['limit']=qs[_0x6ca6('0x22')](_0x281b6e[_0x6ca6('0x34')][_0x6ca6('0x22')]);_0x4d5528[_0x6ca6('0x21')]=qs[_0x6ca6('0x21')](_0x281b6e['query'][_0x6ca6('0x21')]);}return _0x3050a6[_0x6ca6('0x87')](_0x4d5528);}})[_0x6ca6('0x2a')](function(_0x453109){if(_0x453109){return _0x453109?{'count':_0x3fc98e,'rows':_0x453109}:null;}})[_0x6ca6('0x2a')](respondWithResult(_0x3cb167,null))[_0x6ca6('0x49')](handleError(_0x3cb167,null));};
\ No newline at end of file
+var _0x9f62=['Content-Range','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','rawAttributes','keys','query','model','attributes','intersection','fields','length','limit','order','sort','where','filters','filter','key','field','options','SmsQueue','count','includeAll','include','findAll','show','params','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsQueues','find','autoAssociation','catch','UserSmsQueue','nolimit','pick','SmsQueueId','User','map','UserId','agent','smsPause','updatedAt','createdAt','format','SIP','getTeams','findOne','hasOwnProperty','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','tq.TeamId','from','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','value','removeAgents','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./smsQueue.socket','register','sendStatus','status','end','json','offset','set'];(function(_0x469348,_0x39af3d){var _0x5a13a1=function(_0x48324a){while(--_0x48324a){_0x469348['push'](_0x469348['shift']());}};_0x5a13a1(++_0x39af3d);}(_0x9f62,0x154));var _0x29f6=function(_0x2a7ddb,_0x1ec653){_0x2a7ddb=_0x2a7ddb-0x0;var _0x27b712=_0x9f62[_0x2a7ddb];return _0x27b712;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x29f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29f6('0x1'));var jsonpatch=require(_0x29f6('0x2'));var rp=require(_0x29f6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x29f6('0x4'));var util=require(_0x29f6('0x5'));var path=require(_0x29f6('0x6'));var sox=require(_0x29f6('0x7'));var csv=require('to-csv');var ejs=require(_0x29f6('0x8'));var fs=require('fs');var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29f6('0xd'));var authService=require(_0x29f6('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29f6('0xf'))(_0x29f6('0x10'));var utils=require('../../config/utils');var config=require(_0x29f6('0x11'));var db=require(_0x29f6('0x12'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x29f6('0x13'))(new Redis(config[_0x29f6('0x14')]));require(_0x29f6('0x15'))[_0x29f6('0x16')](socket);function respondWithStatusCode(_0x17de6e,_0x156c96){_0x156c96=_0x156c96||0xcc;return function(_0x35d2e2){if(_0x35d2e2){return _0x17de6e[_0x29f6('0x17')](_0x156c96);}return _0x17de6e[_0x29f6('0x18')](_0x156c96)[_0x29f6('0x19')]();};}function respondWithResult(_0x28d314,_0x370484){_0x370484=_0x370484||0xc8;return function(_0x1dde97){if(_0x1dde97){return _0x28d314[_0x29f6('0x18')](_0x370484)[_0x29f6('0x1a')](_0x1dde97);}};}function respondWithFilteredResult(_0x14dd56,_0x3584a1){return function(_0x5bfda7){if(_0x5bfda7){var _0x51c92f=_0x5bfda7['count'],_0x2e66d3=_0x3584a1[_0x29f6('0x1b')],_0x3af478=_0x3584a1[_0x29f6('0x1b')]+_0x3584a1['limit'],_0xb31436;if(_0x3af478>=_0x51c92f){_0x3af478=_0x51c92f;_0xb31436=0xc8;}else{_0xb31436=0xce;}_0x14dd56[_0x29f6('0x18')](_0xb31436);return _0x14dd56[_0x29f6('0x1c')](_0x29f6('0x1d'),_0x2e66d3+'-'+_0x3af478+'/'+_0x51c92f)[_0x29f6('0x1a')](_0x5bfda7);}return null;};}function patchUpdates(_0xb6e7a9){return function(_0x2bfb3d){try{jsonpatch['apply'](_0x2bfb3d,_0xb6e7a9,!![]);}catch(_0xfb8fd2){return BPromise['reject'](_0xfb8fd2);}return _0x2bfb3d['save']();};}function saveUpdates(_0x470019,_0x1fa159){return function(_0x39c6b3){if(_0x39c6b3){return _0x39c6b3[_0x29f6('0x1e')](_0x470019)['then'](function(_0x2c672e){return _0x2c672e;});}return null;};}function removeEntity(_0x49f67d,_0xd4179c){return function(_0xcce041){if(_0xcce041){return _0xcce041[_0x29f6('0x1f')]()[_0x29f6('0x20')](function(){var _0x4fc725=_0xcce041[_0x29f6('0x21')]({'plain':!![]});var _0x4d494f='SmsQueues';return db[_0x29f6('0x22')][_0x29f6('0x1f')]({'where':{'type':_0x4d494f,'resourceId':_0x4fc725['id']}})[_0x29f6('0x20')](function(){return _0xcce041;});})[_0x29f6('0x20')](function(){_0x49f67d[_0x29f6('0x18')](0xcc)[_0x29f6('0x19')]();});}};}function handleEntityNotFound(_0x23c630,_0x50cdd2){return function(_0x2183b7){if(!_0x2183b7){_0x23c630[_0x29f6('0x17')](0x194);}return _0x2183b7;};}function handleError(_0x1ab8d8,_0x3dace7){_0x3dace7=_0x3dace7||0x1f4;return function(_0xda0a63){logger[_0x29f6('0x23')](_0xda0a63[_0x29f6('0x24')]);if(_0xda0a63[_0x29f6('0x25')]){delete _0xda0a63[_0x29f6('0x25')];}_0x1ab8d8[_0x29f6('0x18')](_0x3dace7)[_0x29f6('0x26')](_0xda0a63);};}exports[_0x29f6('0x27')]=function(_0x40c830,_0x304c28){var _0x375564={},_0x218931={},_0x3a7249={'count':0x0,'rows':[]};var _0x5492c2=db['SmsQueue'][_0x29f6('0x28')];_0x218931['model']=_[_0x29f6('0x29')](_0x5492c2);_0x218931[_0x29f6('0x2a')]=_[_0x29f6('0x29')](_0x40c830[_0x29f6('0x2a')]);_0x218931['filters']=_['intersection'](_0x218931[_0x29f6('0x2b')],_0x218931[_0x29f6('0x2a')]);_0x375564[_0x29f6('0x2c')]=_[_0x29f6('0x2d')](_0x218931[_0x29f6('0x2b')],qs[_0x29f6('0x2e')](_0x40c830[_0x29f6('0x2a')][_0x29f6('0x2e')]));_0x375564[_0x29f6('0x2c')]=_0x375564[_0x29f6('0x2c')][_0x29f6('0x2f')]?_0x375564[_0x29f6('0x2c')]:_0x218931[_0x29f6('0x2b')];if(!_0x40c830[_0x29f6('0x2a')]['hasOwnProperty']('nolimit')){_0x375564[_0x29f6('0x30')]=qs[_0x29f6('0x30')](_0x40c830[_0x29f6('0x2a')]['limit']);_0x375564[_0x29f6('0x1b')]=qs[_0x29f6('0x1b')](_0x40c830[_0x29f6('0x2a')][_0x29f6('0x1b')]);}_0x375564[_0x29f6('0x31')]=qs['sort'](_0x40c830[_0x29f6('0x2a')][_0x29f6('0x32')]);_0x375564[_0x29f6('0x33')]=qs[_0x29f6('0x34')](_['pick'](_0x40c830[_0x29f6('0x2a')],_0x218931[_0x29f6('0x34')]));if(_0x40c830[_0x29f6('0x2a')][_0x29f6('0x35')]){_0x375564['where']=_['merge'](_0x375564[_0x29f6('0x33')],{'$or':_['map'](_0x5492c2,function(_0x10f077){if(_0x10f077['type'][_0x29f6('0x36')]!=='VIRTUAL'){var _0x34b1ea={};_0x34b1ea[_0x10f077[_0x29f6('0x37')]]={'$like':'%'+_0x40c830['query'][_0x29f6('0x35')]+'%'};return _0x34b1ea;}})});}_0x375564=_['merge']({},_0x375564,_0x40c830[_0x29f6('0x38')]);var _0x10b4c0={'where':_0x375564['where']};return db[_0x29f6('0x39')][_0x29f6('0x3a')](_0x10b4c0)[_0x29f6('0x20')](function(_0x1e9d5a){_0x3a7249['count']=_0x1e9d5a;if(_0x40c830[_0x29f6('0x2a')][_0x29f6('0x3b')]){_0x375564[_0x29f6('0x3c')]=[{'all':!![]}];}return db[_0x29f6('0x39')][_0x29f6('0x3d')](_0x375564);})['then'](function(_0xb5f2b1){_0x3a7249['rows']=_0xb5f2b1;return _0x3a7249;})[_0x29f6('0x20')](respondWithFilteredResult(_0x304c28,_0x375564))['catch'](handleError(_0x304c28,null));};exports[_0x29f6('0x3e')]=function(_0x3a8a12,_0x4b1524){var _0x28046c={'raw':!![],'where':{'id':_0x3a8a12[_0x29f6('0x3f')]['id']}},_0x2c371f={};_0x2c371f[_0x29f6('0x2b')]=_['keys'](db[_0x29f6('0x39')][_0x29f6('0x28')]);_0x2c371f[_0x29f6('0x2a')]=_['keys'](_0x3a8a12[_0x29f6('0x2a')]);_0x2c371f['filters']=_[_0x29f6('0x2d')](_0x2c371f['model'],_0x2c371f['query']);_0x28046c['attributes']=_[_0x29f6('0x2d')](_0x2c371f[_0x29f6('0x2b')],qs[_0x29f6('0x2e')](_0x3a8a12[_0x29f6('0x2a')][_0x29f6('0x2e')]));_0x28046c[_0x29f6('0x2c')]=_0x28046c[_0x29f6('0x2c')][_0x29f6('0x2f')]?_0x28046c[_0x29f6('0x2c')]:_0x2c371f[_0x29f6('0x2b')];if(_0x3a8a12['query']['includeAll']){_0x28046c[_0x29f6('0x3c')]=[{'all':!![]}];}_0x28046c=_[_0x29f6('0x40')]({},_0x28046c,_0x3a8a12[_0x29f6('0x38')]);return db[_0x29f6('0x39')]['find'](_0x28046c)[_0x29f6('0x20')](handleEntityNotFound(_0x4b1524,null))[_0x29f6('0x20')](respondWithResult(_0x4b1524,null))['catch'](handleError(_0x4b1524,null));};exports[_0x29f6('0x41')]=function(_0xd8514a,_0x123e2f){return db[_0x29f6('0x39')][_0x29f6('0x41')](_0xd8514a[_0x29f6('0x42')],{})[_0x29f6('0x20')](function(_0x1f03b6){var _0x2ca712=_0xd8514a[_0x29f6('0x43')][_0x29f6('0x21')]({'plain':!![]});if(!_0x2ca712)throw new Error(_0x29f6('0x44'));if(_0x2ca712['role']===_0x29f6('0x43')){var _0x463551=_0x1f03b6[_0x29f6('0x21')]({'plain':!![]});var _0x314e9b=_0x29f6('0x45');return db['UserProfileSection'][_0x29f6('0x46')]({'where':{'name':_0x314e9b,'userProfileId':_0x2ca712['userProfileId']},'raw':!![]})['then'](function(_0x9dfc77){if(_0x9dfc77&&_0x9dfc77[_0x29f6('0x47')]===0x0){return db[_0x29f6('0x22')][_0x29f6('0x41')]({'name':_0x463551[_0x29f6('0x25')],'resourceId':_0x463551['id'],'type':_0x9dfc77['name'],'sectionId':_0x9dfc77['id']},{})[_0x29f6('0x20')](function(){return _0x1f03b6;});}else{return _0x1f03b6;}})[_0x29f6('0x48')](function(_0x5f42f3){logger[_0x29f6('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f42f3);throw _0x5f42f3;});}return _0x1f03b6;})[_0x29f6('0x20')](respondWithResult(_0x123e2f,0xc9))[_0x29f6('0x48')](handleError(_0x123e2f,null));};exports[_0x29f6('0x1e')]=function(_0x292567,_0x5c9113){if(_0x292567[_0x29f6('0x42')]['id']){delete _0x292567[_0x29f6('0x42')]['id'];}return db[_0x29f6('0x39')][_0x29f6('0x46')]({'where':{'id':_0x292567[_0x29f6('0x3f')]['id']}})[_0x29f6('0x20')](handleEntityNotFound(_0x5c9113,null))[_0x29f6('0x20')](saveUpdates(_0x292567['body'],null))[_0x29f6('0x20')](respondWithResult(_0x5c9113,null))[_0x29f6('0x48')](handleError(_0x5c9113,null));};exports[_0x29f6('0x1f')]=function(_0xdbfc0f,_0x36e52c){return db[_0x29f6('0x39')][_0x29f6('0x46')]({'where':{'id':_0xdbfc0f[_0x29f6('0x3f')]['id']}})[_0x29f6('0x20')](handleEntityNotFound(_0x36e52c,null))[_0x29f6('0x20')](removeEntity(_0x36e52c,null))['catch'](handleError(_0x36e52c,null));};exports['describe']=function(_0x29f210,_0xf609d0){return db[_0x29f6('0x39')]['describe']()[_0x29f6('0x20')](respondWithResult(_0xf609d0,null))['catch'](handleError(_0xf609d0,null));};exports['getMembers']=function(_0x22b8ef,_0x234d30,_0x56d41b){var _0x49aec5={'raw':!![],'where':{}},_0x3e22f8={},_0x46998c;return db[_0x29f6('0x39')]['findOne']({'where':{'id':_0x22b8ef[_0x29f6('0x3f')]['id']}})[_0x29f6('0x20')](handleEntityNotFound(_0x234d30,null))[_0x29f6('0x20')](function(_0x41143a){if(_0x41143a){_0x46998c=_0x41143a[_0x29f6('0x21')]({'plain':!![]});_0x3e22f8[_0x29f6('0x2b')]=_[_0x29f6('0x29')](db[_0x29f6('0x49')][_0x29f6('0x28')]);_0x3e22f8[_0x29f6('0x2a')]=_[_0x29f6('0x29')](_0x22b8ef[_0x29f6('0x2a')]);_0x3e22f8[_0x29f6('0x34')]=_['intersection'](_0x3e22f8['model'],_0x3e22f8[_0x29f6('0x2a')]);_0x49aec5['attributes']=_[_0x29f6('0x2d')](_0x3e22f8[_0x29f6('0x2b')],qs[_0x29f6('0x2e')](_0x22b8ef[_0x29f6('0x2a')][_0x29f6('0x2e')]));_0x49aec5['attributes']=_0x49aec5[_0x29f6('0x2c')][_0x29f6('0x2f')]?_0x49aec5[_0x29f6('0x2c')]:_0x3e22f8[_0x29f6('0x2b')];if(!_0x22b8ef[_0x29f6('0x2a')]['hasOwnProperty'](_0x29f6('0x4a'))){_0x49aec5['limit']=qs['limit'](_0x22b8ef[_0x29f6('0x2a')][_0x29f6('0x30')]);_0x49aec5['offset']=qs[_0x29f6('0x1b')](_0x22b8ef[_0x29f6('0x2a')]['offset']);}_0x49aec5[_0x29f6('0x31')]=qs[_0x29f6('0x32')](_0x22b8ef[_0x29f6('0x2a')][_0x29f6('0x32')]);_0x49aec5[_0x29f6('0x33')]=qs[_0x29f6('0x34')](_[_0x29f6('0x4b')](_0x22b8ef['query'],_0x3e22f8[_0x29f6('0x34')]));_0x49aec5['where'][_0x29f6('0x4c')]=_0x41143a['id'];if(_0x22b8ef['query']['filter']){_0x49aec5[_0x29f6('0x33')]=_[_0x29f6('0x40')](_0x49aec5[_0x29f6('0x33')],{'$or':_['map'](_0x49aec5[_0x29f6('0x2c')],function(_0x373cf6){var _0x3e600b={};_0x3e600b[_0x373cf6]={'$like':'%'+_0x22b8ef['query'][_0x29f6('0x35')]+'%'};return _0x3e600b;})});}_0x49aec5=_[_0x29f6('0x40')]({},_0x49aec5,_0x22b8ef[_0x29f6('0x38')]);return db[_0x29f6('0x49')][_0x29f6('0x3d')](_0x49aec5);}})[_0x29f6('0x20')](function(_0x6587f3){if(_0x6587f3){return db[_0x29f6('0x4d')]['findAndCountAll']({'where':{'id':_[_0x29f6('0x4e')](_0x6587f3,_0x29f6('0x4f')),'role':_0x29f6('0x50')},'attributes':['id',_0x29f6('0x25'),_0x29f6('0x51'),_0x29f6('0x52'),_0x29f6('0x53')]});}})[_0x29f6('0x20')](function(_0x4e4e81){if(_0x4e4e81){return{'count':_0x4e4e81[_0x29f6('0x3a')],'rows':_[_0x29f6('0x4e')](_0x4e4e81['rows'],function(_0x45464a){return{'membername':_0x45464a['name'],'UserId':_0x45464a['id'],'queue_name':_0x46998c[_0x29f6('0x25')],'SmsQueueId':_0x46998c['id'],'interface':util[_0x29f6('0x54')]('%s/%s',_0x29f6('0x55'),_0x45464a[_0x29f6('0x25')]),'penalty':0x0,'paused':_0x45464a['smsPause'],'createdAt':_0x45464a['createdAt'],'updatedAt':_0x45464a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x29f6('0x20')](respondWithFilteredResult(_0x234d30,_0x49aec5))[_0x29f6('0x48')](handleError(_0x234d30,null));};exports[_0x29f6('0x56')]=function(_0x3125af,_0x291663,_0x35fdb5){var _0x26cb85={};var _0x4d575d={};var _0x11ef85;var _0x1a4efa;return db[_0x29f6('0x39')][_0x29f6('0x57')]({'where':{'id':_0x3125af['params']['id']}})[_0x29f6('0x20')](handleEntityNotFound(_0x291663,null))[_0x29f6('0x20')](function(_0x32a862){if(_0x32a862){_0x11ef85=_0x32a862;_0x4d575d[_0x29f6('0x2b')]=_[_0x29f6('0x29')](db['Team'][_0x29f6('0x28')]);_0x4d575d[_0x29f6('0x2a')]=_[_0x29f6('0x29')](_0x3125af[_0x29f6('0x2a')]);_0x4d575d[_0x29f6('0x34')]=_[_0x29f6('0x2d')](_0x4d575d['model'],_0x4d575d[_0x29f6('0x2a')]);_0x26cb85['attributes']=_['intersection'](_0x4d575d['model'],qs[_0x29f6('0x2e')](_0x3125af['query'][_0x29f6('0x2e')]));_0x26cb85[_0x29f6('0x2c')]=_0x26cb85[_0x29f6('0x2c')][_0x29f6('0x2f')]?_0x26cb85[_0x29f6('0x2c')]:_0x4d575d[_0x29f6('0x2b')];_0x26cb85[_0x29f6('0x31')]=qs['sort'](_0x3125af[_0x29f6('0x2a')]['sort']);_0x26cb85[_0x29f6('0x33')]=qs[_0x29f6('0x34')](_[_0x29f6('0x4b')](_0x3125af[_0x29f6('0x2a')],_0x4d575d[_0x29f6('0x34')]));if(_0x3125af[_0x29f6('0x2a')][_0x29f6('0x35')]){_0x26cb85[_0x29f6('0x33')]=_[_0x29f6('0x40')](_0x26cb85[_0x29f6('0x33')],{'$or':_[_0x29f6('0x4e')](_0x26cb85[_0x29f6('0x2c')],function(_0x565c20){var _0x4eb7c9={};_0x4eb7c9[_0x565c20]={'$like':'%'+_0x3125af['query'][_0x29f6('0x35')]+'%'};return _0x4eb7c9;})});}_0x26cb85=_[_0x29f6('0x40')]({},_0x26cb85,_0x3125af['options']);return _0x11ef85[_0x29f6('0x56')](_0x26cb85);}})['then'](function(_0x2f9d2d){if(_0x2f9d2d){_0x1a4efa=_0x2f9d2d[_0x29f6('0x2f')];if(!_0x3125af[_0x29f6('0x2a')][_0x29f6('0x58')](_0x29f6('0x4a'))){_0x26cb85[_0x29f6('0x30')]=qs[_0x29f6('0x30')](_0x3125af[_0x29f6('0x2a')][_0x29f6('0x30')]);_0x26cb85[_0x29f6('0x1b')]=qs['offset'](_0x3125af[_0x29f6('0x2a')]['offset']);}return _0x11ef85[_0x29f6('0x56')](_0x26cb85);}})[_0x29f6('0x20')](function(_0x2f4b68){if(_0x2f4b68){return _0x2f4b68?{'count':_0x1a4efa,'rows':_0x2f4b68}:null;}})[_0x29f6('0x20')](respondWithResult(_0x291663,null))[_0x29f6('0x48')](handleError(_0x291663,null));};exports[_0x29f6('0x59')]=function(_0x41d718,_0x286f2e,_0x546e14){var _0x21bcee=_0x41d718[_0x29f6('0x42')]['teams'];return db['Team'][_0x29f6('0x3d')]({'where':{'id':_[_0x29f6('0x4e')](_0x21bcee,'id')},'attributes':['id'],'include':[{'model':db[_0x29f6('0x4d')],'as':_0x29f6('0x5a'),'attributes':['id',_0x29f6('0x25'),_0x29f6('0x5b'),_0x29f6('0x5c'),_0x29f6('0x5d')],'raw':!![]}]})[_0x29f6('0x20')](function(_0x267187){if(_0x267187){var _0x244fc8=_[_0x29f6('0x5e')](_0x267187,function(_0x55bb4d){var _0x4b9631=_0x55bb4d[_0x29f6('0x21')]({'plain':!![]});return _0x4b9631[_0x29f6('0x5a')];});return db['SmsQueue'][_0x29f6('0x46')]({'where':{'id':_0x41d718[_0x29f6('0x3f')]['id']}})[_0x29f6('0x20')](function(_0x7056e6){return db[_0x29f6('0x5f')][_0x29f6('0x60')](function(_0x21cc84){return _0x7056e6['addTeams'](_[_0x29f6('0x4e')](_0x21bcee,'id'),{'transaction':_0x21cc84})[_0x29f6('0x20')](function(){return BPromise[_0x29f6('0x61')](_0x244fc8,function(_0x577f52){return db[_0x29f6('0x49')][_0x29f6('0x62')]({'where':{'UserId':_0x577f52['id'],'SmsQueueId':_0x41d718['params']['id']},'transaction':_0x21cc84});});})[_0x29f6('0x20')](function(){_0x244fc8[_0x29f6('0x63')](function(_0x4c6186){socket[_0x29f6('0x64')]('userSmsQueue:save',{'UserId':_0x4c6186['id'],'SmsQueueId':_0x7056e6['id']});});});});});}})[_0x29f6('0x20')](respondWithStatusCode(_0x286f2e,null))[_0x29f6('0x48')](handleError(_0x286f2e,null));};exports[_0x29f6('0x65')]=function(_0x3a7064,_0x344a5d,_0x23d311){return db['Team']['findAll']({'where':{'id':_0x3a7064[_0x29f6('0x2a')][_0x29f6('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x29f6('0x5a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x344a5d,null))[_0x29f6('0x20')](function(_0x1f28ad){var _0xaa5519=_[_0x29f6('0x4e')](_0x1f28ad,'id');var _0x13d7b7=[];var _0x2a7b8a=[];var _0x3454f8=squel['select']();_0x3454f8[_0x29f6('0x37')](_0x29f6('0x67'))[_0x29f6('0x68')]('team_has_sms_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x29f6('0x33')]('SmsQueueId\x20=\x20?',_0x3a7064['params']['id']);for(var _0x4ef1d4=0x0;_0x4ef1d4<_0x1f28ad[_0x29f6('0x2f')];_0x4ef1d4+=0x1){let _0x32678b=_0x1f28ad[_0x4ef1d4];for(var _0x37e2b9=0x0;_0x37e2b9<_0x32678b[_0x29f6('0x5a')][_0x29f6('0x2f')];_0x37e2b9+=0x1){let _0x5acdcc=_0x32678b[_0x29f6('0x5a')][_0x37e2b9];var _0x519ec6=_0x3454f8[_0x29f6('0x69')]();_0x519ec6[_0x29f6('0x33')](_0x29f6('0x6a'),_0x5acdcc['id']);_0x2a7b8a[_0x29f6('0x6b')](db['sequelize']['query'](_0x519ec6[_0x29f6('0x6c')](),{'type':db[_0x29f6('0x5f')][_0x29f6('0x6d')]['SELECT']})[_0x29f6('0x20')](function(_0x1ec17e){if(_0x1ec17e['length']===0x1){return _0x5acdcc['id'];}else{var _0x310f91=_[_0x29f6('0x6e')](_[_0x29f6('0x4e')](_0x1ec17e,_0x29f6('0x6f')),function(_0x234549){return _[_0x29f6('0x70')](_0xaa5519,_0x234549);});if(_0x310f91){return _0x5acdcc['id'];}}}));}}return BPromise[_0x29f6('0x71')](_0x2a7b8a)[_0x29f6('0x20')](function(_0x451438){_0x13d7b7=_(_0x13d7b7)[_0x29f6('0x72')](_0x451438)['compact']()[_0x29f6('0x73')]();return db['SmsQueue']['find']({'where':{'id':_0x3a7064['params']['id']}})[_0x29f6('0x20')](function(_0x39ed86){return db['sequelize']['transaction'](function(_0x3e1339){return _0x39ed86[_0x29f6('0x65')](_0x3a7064['query']['ids'],{'transaction':_0x3e1339})['then'](function(){if(!_['isEmpty'](_0x13d7b7)){return _0x39ed86[_0x29f6('0x74')](_0x13d7b7,{'transaction':_0x3e1339});}})['then'](function(){_0x13d7b7[_0x29f6('0x63')](function(_0xdedffd){socket['emit'](_0x29f6('0x75'),{'UserId':_0xdedffd,'SmsQueueId':_0x39ed86['id']});});});});});});})[_0x29f6('0x20')](respondWithStatusCode(_0x344a5d,null))['catch'](handleError(_0x344a5d,null));};exports[_0x29f6('0x76')]=function(_0x3d98c1,_0x31032c,_0x31dbe8){return db[_0x29f6('0x39')][_0x29f6('0x46')]({'where':{'id':_0x3d98c1[_0x29f6('0x3f')]['id']}})[_0x29f6('0x20')](handleEntityNotFound(_0x31032c,null))[_0x29f6('0x20')](function(_0xf8d1de){if(_0xf8d1de){return _0xf8d1de[_0x29f6('0x76')](_0x3d98c1[_0x29f6('0x42')][_0x29f6('0x66')],_[_0x29f6('0x77')](_0x3d98c1['body'],[_0x29f6('0x66'),'id'])||{})[_0x29f6('0x78')](function(_0xa3981d){for(var _0x264617=0x0;_0x264617<_0x3d98c1[_0x29f6('0x42')][_0x29f6('0x66')][_0x29f6('0x2f')];_0x264617+=0x1){socket['emit'](_0x29f6('0x79'),{'UserId':_0x3d98c1['body'][_0x29f6('0x66')][_0x264617],'SmsQueueId':_0x3d98c1[_0x29f6('0x3f')]['id']});}return _0xa3981d;});}})[_0x29f6('0x20')](respondWithResult(_0x31032c,null))[_0x29f6('0x48')](handleError(_0x31032c,null));};exports[_0x29f6('0x74')]=function(_0x63517e,_0x2dc960,_0x312a6f){return db[_0x29f6('0x39')]['find']({'where':{'id':_0x63517e[_0x29f6('0x3f')]['id']}})[_0x29f6('0x20')](handleEntityNotFound(_0x2dc960,null))['then'](function(_0x569561){if(_0x569561){return _0x569561[_0x29f6('0x74')](_0x63517e[_0x29f6('0x2a')][_0x29f6('0x66')])[_0x29f6('0x20')](function(){if(_['isArray'](_0x63517e[_0x29f6('0x2a')][_0x29f6('0x66')])){for(var _0x4dfb51=0x0;_0x4dfb51<_0x63517e[_0x29f6('0x2a')][_0x29f6('0x66')][_0x29f6('0x2f')];_0x4dfb51+=0x1){socket[_0x29f6('0x64')](_0x29f6('0x75'),{'UserId':Number(_0x63517e[_0x29f6('0x2a')][_0x29f6('0x66')][_0x4dfb51]),'SmsQueueId':Number(_0x63517e[_0x29f6('0x3f')]['id'])});}}else{socket[_0x29f6('0x64')](_0x29f6('0x75'),{'UserId':Number(_0x63517e[_0x29f6('0x2a')][_0x29f6('0x66')]),'SmsQueueId':Number(_0x63517e[_0x29f6('0x3f')]['id'])});}});}})['then'](respondWithStatusCode(_0x2dc960,null))[_0x29f6('0x48')](handleError(_0x2dc960,null));};exports[_0x29f6('0x7a')]=function(_0x16ec76,_0x211c16,_0x5c3e55){var _0x29f5de={};var _0x2ffad1={};var _0x37ea1b;var _0x510aed;return db[_0x29f6('0x39')][_0x29f6('0x57')]({'where':{'id':_0x16ec76['params']['id']}})[_0x29f6('0x20')](handleEntityNotFound(_0x211c16,null))[_0x29f6('0x20')](function(_0x26f030){if(_0x26f030){_0x37ea1b=_0x26f030;_0x2ffad1[_0x29f6('0x2b')]=_[_0x29f6('0x29')](db[_0x29f6('0x4d')][_0x29f6('0x28')]);_0x2ffad1[_0x29f6('0x2a')]=_[_0x29f6('0x29')](_0x16ec76[_0x29f6('0x2a')]);_0x2ffad1[_0x29f6('0x34')]=_['intersection'](_0x2ffad1['model'],_0x2ffad1[_0x29f6('0x2a')]);_0x29f5de[_0x29f6('0x2c')]=_[_0x29f6('0x2d')](_0x2ffad1[_0x29f6('0x2b')],qs[_0x29f6('0x2e')](_0x16ec76[_0x29f6('0x2a')][_0x29f6('0x2e')]));_0x29f5de[_0x29f6('0x2c')]=_0x29f5de['attributes']['length']?_0x29f5de['attributes']:_0x2ffad1[_0x29f6('0x2b')];_0x29f5de[_0x29f6('0x31')]=qs[_0x29f6('0x32')](_0x16ec76[_0x29f6('0x2a')]['sort']);_0x29f5de[_0x29f6('0x33')]=qs[_0x29f6('0x34')](_['pick'](_0x16ec76[_0x29f6('0x2a')],_0x2ffad1['filters']));if(_0x16ec76[_0x29f6('0x2a')][_0x29f6('0x35')]){_0x29f5de[_0x29f6('0x33')]=_[_0x29f6('0x40')](_0x29f5de['where'],{'$or':_[_0x29f6('0x4e')](_0x29f5de['attributes'],function(_0x47785a){var _0x69f4b5={};_0x69f4b5[_0x47785a]={'$like':'%'+_0x16ec76[_0x29f6('0x2a')][_0x29f6('0x35')]+'%'};return _0x69f4b5;})});}_0x29f5de=_[_0x29f6('0x40')]({},_0x29f5de,_0x16ec76[_0x29f6('0x38')]);return _0x37ea1b['getAgents'](_0x29f5de);}})['then'](function(_0x255770){if(_0x255770){_0x510aed=_0x255770['length'];if(!_0x16ec76['query'][_0x29f6('0x58')]('nolimit')){_0x29f5de[_0x29f6('0x30')]=qs[_0x29f6('0x30')](_0x16ec76[_0x29f6('0x2a')][_0x29f6('0x30')]);_0x29f5de[_0x29f6('0x1b')]=qs[_0x29f6('0x1b')](_0x16ec76['query'][_0x29f6('0x1b')]);}return _0x37ea1b[_0x29f6('0x7a')](_0x29f5de);}})[_0x29f6('0x20')](function(_0x3b2594){if(_0x3b2594){return _0x3b2594?{'count':_0x510aed,'rows':_0x3b2594}:null;}})[_0x29f6('0x20')](respondWithResult(_0x211c16,null))[_0x29f6('0x48')](handleError(_0x211c16,null));};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js
index 48d77b4..fabaf59 100644
--- a/server/api/smsQueue/smsQueue.events.js
+++ b/server/api/smsQueue/smsQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaede=['events','SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x18b66a,_0x238c7c){var _0x3c2d0d=function(_0x2fb978){while(--_0x2fb978){_0x18b66a['push'](_0x18b66a['shift']());}};_0x3c2d0d(++_0x238c7c);}(_0xaede,0x6c));var _0xeaed=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xaede[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xeaed('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xeaed('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xeaed('0x2')](0x0);var events={'afterCreate':_0xeaed('0x3'),'afterUpdate':'update','afterDestroy':_0xeaed('0x4')};function emitEvent(_0x5c5c9b){return function(_0x28570e,_0x36f78f,_0x49bd46){SmsQueueEvents[_0xeaed('0x5')](_0x5c5c9b+':'+_0x28570e['id'],_0x28570e);SmsQueueEvents[_0xeaed('0x5')](_0x5c5c9b,_0x28570e);_0x49bd46(null);};}for(var e in events){if(events[_0xeaed('0x6')](e)){var event=events[e];SmsQueue[_0xeaed('0x7')](e,emitEvent(event));}}module[_0xeaed('0x8')]=SmsQueueEvents;
\ No newline at end of file
+var _0x7950=['SmsQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x56a335,_0x50bd5c){var _0x40efc0=function(_0x59434d){while(--_0x59434d){_0x56a335['push'](_0x56a335['shift']());}};_0x40efc0(++_0x50bd5c);}(_0x7950,0x182));var _0x0795=function(_0x4d4cf2,_0x969f41){_0x4d4cf2=_0x4d4cf2-0x0;var _0xcf6d21=_0x7950[_0x4d4cf2];return _0xcf6d21;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x0795('0x0'))['db'][_0x0795('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x0795('0x2')](0x0);var events={'afterCreate':_0x0795('0x3'),'afterUpdate':_0x0795('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3b5c21){return function(_0x1e885a,_0x4fa23e,_0x4ef8a5){SmsQueueEvents[_0x0795('0x5')](_0x3b5c21+':'+_0x1e885a['id'],_0x1e885a);SmsQueueEvents[_0x0795('0x5')](_0x3b5c21,_0x1e885a);_0x4ef8a5(null);};}for(var e in events){if(events[_0x0795('0x6')](e)){var event=events[e];SmsQueue[_0x0795('0x7')](e,emitEvent(event));}}module[_0x0795('0x8')]=SmsQueueEvents;
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js
index 3c7c663..089944d 100644
--- a/server/api/smsQueue/smsQueue.model.js
+++ b/server/api/smsQueue/smsQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4c60=['define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','bluebird','./smsQueue.attributes','exports'];(function(_0x4f9ad5,_0x3a7fed){var _0x4bc194=function(_0x4e6d61){while(--_0x4e6d61){_0x4f9ad5['push'](_0x4f9ad5['shift']());}};_0x4bc194(++_0x3a7fed);}(_0x4c60,0xc1));var _0x04c6=function(_0x32b58a,_0x43447e){_0x32b58a=_0x32b58a-0x0;var _0x13b2b3=_0x4c60[_0x32b58a];return _0x13b2b3;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04c6('0x5'));module[_0x04c6('0x6')]=function(_0x2054da,_0x12bd5d){return _0x2054da[_0x04c6('0x7')](_0x04c6('0x8'),attributes,{'tableName':_0x04c6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x02a7=['sms_queues','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue'];(function(_0x4b2ed7,_0x5b3100){var _0x55a953=function(_0x4b7abd){while(--_0x4b7abd){_0x4b2ed7['push'](_0x4b2ed7['shift']());}};_0x55a953(++_0x5b3100);}(_0x02a7,0x7a));var _0x702a=function(_0x556ad0,_0x170eaa){_0x556ad0=_0x556ad0-0x0;var _0x4cb56e=_0x02a7[_0x556ad0];return _0x4cb56e;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x702a('0x1'));var BPromise=require(_0x702a('0x2'));var rp=require(_0x702a('0x3'));var fs=require('fs');var path=require(_0x702a('0x4'));var rimraf=require(_0x702a('0x5'));var config=require(_0x702a('0x6'));var attributes=require(_0x702a('0x7'));module['exports']=function(_0x1bcfe5,_0x5b7d8c){return _0x1bcfe5[_0x702a('0x8')](_0x702a('0x9'),attributes,{'tableName':_0x702a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js
index cf70134..0b1c597 100644
--- a/server/api/smsQueue/smsQueue.rpc.js
+++ b/server/api/smsQueue/smsQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf40=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','include','model','attributes','map','ShowSmsQueue','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xaf40,0x75));var _0x0af4=function(_0x526196,_0x5ef7ec){_0x526196=_0x526196-0x0;var _0x3bd4b6=_0xaf40[_0x526196];return _0x3bd4b6;};'use strict';var _=require('lodash');var util=require(_0x0af4('0x0'));var moment=require(_0x0af4('0x1'));var BPromise=require(_0x0af4('0x2'));var rs=require(_0x0af4('0x3'));var fs=require('fs');var Redis=require(_0x0af4('0x4'));var db=require(_0x0af4('0x5'))['db'];var utils=require(_0x0af4('0x6'));var logger=require(_0x0af4('0x7'))(_0x0af4('0x8'));var config=require(_0x0af4('0x9'));var jayson=require(_0x0af4('0xa'));var client=jayson[_0x0af4('0xb')][_0x0af4('0xc')]({'port':0x232a});config[_0x0af4('0xd')]=_[_0x0af4('0xe')](config['redis'],{'host':_0x0af4('0xf'),'port':0x18eb});var socket=require(_0x0af4('0x10'))(new Redis(config[_0x0af4('0xd')]));require(_0x0af4('0x11'))['register'](socket);function respondWithRpcPromise(_0x51b6bd,_0x16e623,_0x1681a6){return new BPromise(function(_0x1cb9ab,_0x565b2a){return client[_0x0af4('0x12')](_0x51b6bd,_0x1681a6)[_0x0af4('0x13')](function(_0x17387b){logger[_0x0af4('0x14')](_0x0af4('0x15'),_0x16e623,'request\x20sent');logger[_0x0af4('0x16')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x16e623,_0x0af4('0x17'),JSON[_0x0af4('0x18')](_0x17387b));if(_0x17387b[_0x0af4('0x19')]){if(_0x17387b[_0x0af4('0x19')][_0x0af4('0x1a')]===0x1f4){logger[_0x0af4('0x19')](_0x0af4('0x15'),_0x16e623,_0x17387b[_0x0af4('0x19')][_0x0af4('0x1b')]);return _0x565b2a(_0x17387b['error'][_0x0af4('0x1b')]);}logger[_0x0af4('0x19')](_0x0af4('0x15'),_0x16e623,_0x17387b[_0x0af4('0x19')][_0x0af4('0x1b')]);return _0x1cb9ab(_0x17387b[_0x0af4('0x19')][_0x0af4('0x1b')]);}else{logger[_0x0af4('0x14')](_0x0af4('0x15'),_0x16e623,_0x0af4('0x17'));_0x1cb9ab(_0x17387b[_0x0af4('0x1c')][_0x0af4('0x1b')]);}})[_0x0af4('0x1d')](function(_0x8d5d9a){logger[_0x0af4('0x19')](_0x0af4('0x15'),_0x16e623,_0x8d5d9a);_0x565b2a(_0x8d5d9a);});});}exports[_0x0af4('0x1e')]=function(_0x2d7c81){var _0x158b61=this;return new Promise(function(_0xee965e,_0x3a35db){return db[_0x0af4('0x1f')][_0x0af4('0x20')]({'raw':_0x2d7c81[_0x0af4('0x21')]?_0x2d7c81[_0x0af4('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x2d7c81[_0x0af4('0x21')]?_0x2d7c81[_0x0af4('0x21')][_0x0af4('0x22')]||null:null,'attributes':_0x2d7c81[_0x0af4('0x21')]?_0x2d7c81[_0x0af4('0x21')]['attributes']||null:null,'limit':_0x2d7c81[_0x0af4('0x21')]?_0x2d7c81[_0x0af4('0x21')]['limit']||null:null,'include':_0x2d7c81[_0x0af4('0x21')]?_0x2d7c81['options'][_0x0af4('0x23')]?_['map'](_0x2d7c81[_0x0af4('0x21')][_0x0af4('0x23')],function(_0x22b8cb){return{'model':db[_0x22b8cb[_0x0af4('0x24')]],'as':_0x22b8cb['as'],'attributes':_0x22b8cb[_0x0af4('0x25')],'include':_0x22b8cb[_0x0af4('0x23')]?_[_0x0af4('0x26')](_0x22b8cb[_0x0af4('0x23')],function(_0x4a25df){return{'model':db[_0x4a25df[_0x0af4('0x24')]],'as':_0x4a25df['as'],'attributes':_0x4a25df[_0x0af4('0x25')],'include':_0x4a25df[_0x0af4('0x23')]?_[_0x0af4('0x26')](_0x4a25df['include'],function(_0x671395){return{'model':db[_0x671395['model']],'as':_0x671395['as'],'attributes':_0x671395['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x55ac36){logger[_0x0af4('0x14')](_0x0af4('0x1e'),_0x2d7c81);logger[_0x0af4('0x16')](_0x0af4('0x1e'),_0x2d7c81,JSON[_0x0af4('0x18')](_0x55ac36));_0xee965e(_0x55ac36);})[_0x0af4('0x1d')](function(_0x40d858){logger[_0x0af4('0x19')](_0x0af4('0x1e'),_0x40d858[_0x0af4('0x1b')],_0x2d7c81);_0x3a35db(_0x158b61[_0x0af4('0x19')](0x1f4,_0x40d858[_0x0af4('0x1b')]));});});};exports[_0x0af4('0x27')]=function(_0xee6ec0){var _0x365a54=this;return new Promise(function(_0x274bc3,_0x1615eb){return db['SmsQueue']['find']({'raw':_0xee6ec0['options']?_0xee6ec0[_0x0af4('0x21')][_0x0af4('0x28')]===undefined?!![]:![]:!![],'where':_0xee6ec0[_0x0af4('0x21')]?_0xee6ec0[_0x0af4('0x21')]['where']||null:null,'attributes':_0xee6ec0[_0x0af4('0x21')]?_0xee6ec0[_0x0af4('0x21')][_0x0af4('0x25')]||null:null,'include':_0xee6ec0[_0x0af4('0x21')]?_0xee6ec0['options'][_0x0af4('0x23')]?_[_0x0af4('0x26')](_0xee6ec0['options'][_0x0af4('0x23')],function(_0x22039f){return{'model':db[_0x22039f[_0x0af4('0x24')]],'as':_0x22039f['as'],'attributes':_0x22039f['attributes'],'include':_0x22039f[_0x0af4('0x23')]?_[_0x0af4('0x26')](_0x22039f[_0x0af4('0x23')],function(_0x5a1371){return{'model':db[_0x5a1371[_0x0af4('0x24')]],'as':_0x5a1371['as'],'attributes':_0x5a1371[_0x0af4('0x25')],'include':_0x5a1371[_0x0af4('0x23')]?_['map'](_0x5a1371[_0x0af4('0x23')],function(_0x4021eb){return{'model':db[_0x4021eb[_0x0af4('0x24')]],'as':_0x4021eb['as'],'attributes':_0x4021eb[_0x0af4('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x280446){logger[_0x0af4('0x14')](_0x0af4('0x27'),_0xee6ec0);logger[_0x0af4('0x16')](_0x0af4('0x27'),_0xee6ec0,JSON[_0x0af4('0x18')](_0x280446));_0x274bc3(_0x280446);})[_0x0af4('0x1d')](function(_0x17dc7d){logger[_0x0af4('0x19')](_0x0af4('0x27'),_0x17dc7d['message'],_0xee6ec0);_0x1615eb(_0x365a54[_0x0af4('0x19')](0x1f4,_0x17dc7d['message']));});});};
\ No newline at end of file
+var _0x9d8c=['ShowSmsQueue','find','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','then','info','request\x20sent','debug','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','limit','map','include','model'];(function(_0x3e80e5,_0x5ba461){var _0x43a128=function(_0x403688){while(--_0x403688){_0x3e80e5['push'](_0x3e80e5['shift']());}};_0x43a128(++_0x5ba461);}(_0x9d8c,0x162));var _0xc9d8=function(_0x1863ae,_0x4cd4ab){_0x1863ae=_0x1863ae-0x0;var _0x4388c3=_0x9d8c[_0x1863ae];return _0x4388c3;};'use strict';var _=require(_0xc9d8('0x0'));var util=require('util');var moment=require(_0xc9d8('0x1'));var BPromise=require(_0xc9d8('0x2'));var rs=require(_0xc9d8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9d8('0x4'))['db'];var utils=require(_0xc9d8('0x5'));var logger=require(_0xc9d8('0x6'))(_0xc9d8('0x7'));var config=require('../../config/environment');var jayson=require(_0xc9d8('0x8'));var client=jayson[_0xc9d8('0x9')]['http']({'port':0x232a});config[_0xc9d8('0xa')]=_[_0xc9d8('0xb')](config[_0xc9d8('0xa')],{'host':_0xc9d8('0xc'),'port':0x18eb});var socket=require(_0xc9d8('0xd'))(new Redis(config[_0xc9d8('0xa')]));require(_0xc9d8('0xe'))[_0xc9d8('0xf')](socket);function respondWithRpcPromise(_0x12edee,_0x234deb,_0x976906){return new BPromise(function(_0x52087c,_0x40369e){return client['request'](_0x12edee,_0x976906)[_0xc9d8('0x10')](function(_0x581905){logger[_0xc9d8('0x11')]('SmsQueue,\x20%s,\x20%s',_0x234deb,_0xc9d8('0x12'));logger[_0xc9d8('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x234deb,_0xc9d8('0x12'),JSON[_0xc9d8('0x14')](_0x581905));if(_0x581905[_0xc9d8('0x15')]){if(_0x581905[_0xc9d8('0x15')][_0xc9d8('0x16')]===0x1f4){logger[_0xc9d8('0x15')](_0xc9d8('0x17'),_0x234deb,_0x581905[_0xc9d8('0x15')][_0xc9d8('0x18')]);return _0x40369e(_0x581905[_0xc9d8('0x15')][_0xc9d8('0x18')]);}logger['error'](_0xc9d8('0x17'),_0x234deb,_0x581905[_0xc9d8('0x15')][_0xc9d8('0x18')]);return _0x52087c(_0x581905[_0xc9d8('0x15')][_0xc9d8('0x18')]);}else{logger[_0xc9d8('0x11')](_0xc9d8('0x17'),_0x234deb,_0xc9d8('0x12'));_0x52087c(_0x581905['result'][_0xc9d8('0x18')]);}})[_0xc9d8('0x19')](function(_0x5c4172){logger[_0xc9d8('0x15')](_0xc9d8('0x17'),_0x234deb,_0x5c4172);_0x40369e(_0x5c4172);});});}exports[_0xc9d8('0x1a')]=function(_0x2b72b0){var _0x2a28ab=this;return new Promise(function(_0x43c33d,_0x54d11a){return db[_0xc9d8('0x1b')][_0xc9d8('0x1c')]({'raw':_0x2b72b0['options']?_0x2b72b0[_0xc9d8('0x1d')][_0xc9d8('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b72b0[_0xc9d8('0x1d')]?_0x2b72b0[_0xc9d8('0x1d')]['where']||null:null,'attributes':_0x2b72b0[_0xc9d8('0x1d')]?_0x2b72b0['options'][_0xc9d8('0x1f')]||null:null,'limit':_0x2b72b0[_0xc9d8('0x1d')]?_0x2b72b0['options'][_0xc9d8('0x20')]||null:null,'include':_0x2b72b0[_0xc9d8('0x1d')]?_0x2b72b0[_0xc9d8('0x1d')]['include']?_[_0xc9d8('0x21')](_0x2b72b0[_0xc9d8('0x1d')][_0xc9d8('0x22')],function(_0x2553a9){return{'model':db[_0x2553a9['model']],'as':_0x2553a9['as'],'attributes':_0x2553a9[_0xc9d8('0x1f')],'include':_0x2553a9['include']?_[_0xc9d8('0x21')](_0x2553a9[_0xc9d8('0x22')],function(_0x929cfd){return{'model':db[_0x929cfd[_0xc9d8('0x23')]],'as':_0x929cfd['as'],'attributes':_0x929cfd['attributes'],'include':_0x929cfd['include']?_[_0xc9d8('0x21')](_0x929cfd[_0xc9d8('0x22')],function(_0x3b2a5d){return{'model':db[_0x3b2a5d['model']],'as':_0x3b2a5d['as'],'attributes':_0x3b2a5d[_0xc9d8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33892d){logger[_0xc9d8('0x11')](_0xc9d8('0x1a'),_0x2b72b0);logger[_0xc9d8('0x13')]('GetSmsQueue',_0x2b72b0,JSON[_0xc9d8('0x14')](_0x33892d));_0x43c33d(_0x33892d);})[_0xc9d8('0x19')](function(_0x2b702b){logger[_0xc9d8('0x15')](_0xc9d8('0x1a'),_0x2b702b[_0xc9d8('0x18')],_0x2b72b0);_0x54d11a(_0x2a28ab[_0xc9d8('0x15')](0x1f4,_0x2b702b[_0xc9d8('0x18')]));});});};exports[_0xc9d8('0x24')]=function(_0x4f7d34){var _0x42ccfb=this;return new Promise(function(_0x2a5da2,_0x2eacc1){return db[_0xc9d8('0x1b')][_0xc9d8('0x25')]({'raw':_0x4f7d34[_0xc9d8('0x1d')]?_0x4f7d34['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f7d34['options']?_0x4f7d34[_0xc9d8('0x1d')][_0xc9d8('0x26')]||null:null,'attributes':_0x4f7d34[_0xc9d8('0x1d')]?_0x4f7d34[_0xc9d8('0x1d')][_0xc9d8('0x1f')]||null:null,'include':_0x4f7d34[_0xc9d8('0x1d')]?_0x4f7d34[_0xc9d8('0x1d')][_0xc9d8('0x22')]?_[_0xc9d8('0x21')](_0x4f7d34[_0xc9d8('0x1d')]['include'],function(_0x3b124a){return{'model':db[_0x3b124a[_0xc9d8('0x23')]],'as':_0x3b124a['as'],'attributes':_0x3b124a[_0xc9d8('0x1f')],'include':_0x3b124a[_0xc9d8('0x22')]?_['map'](_0x3b124a[_0xc9d8('0x22')],function(_0x475c70){return{'model':db[_0x475c70['model']],'as':_0x475c70['as'],'attributes':_0x475c70[_0xc9d8('0x1f')],'include':_0x475c70[_0xc9d8('0x22')]?_[_0xc9d8('0x21')](_0x475c70['include'],function(_0x250212){return{'model':db[_0x250212[_0xc9d8('0x23')]],'as':_0x250212['as'],'attributes':_0x250212[_0xc9d8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc9d8('0x10')](function(_0x389221){logger[_0xc9d8('0x11')]('ShowSmsQueue',_0x4f7d34);logger['debug'](_0xc9d8('0x24'),_0x4f7d34,JSON[_0xc9d8('0x14')](_0x389221));_0x2a5da2(_0x389221);})[_0xc9d8('0x19')](function(_0x1fa77e){logger[_0xc9d8('0x15')](_0xc9d8('0x24'),_0x1fa77e[_0xc9d8('0x18')],_0x4f7d34);_0x2eacc1(_0x42ccfb[_0xc9d8('0x15')](0x1f4,_0x1fa77e[_0xc9d8('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js
index f37479e..0639a9b 100644
--- a/server/api/smsQueue/smsQueue.socket.js
+++ b/server/api/smsQueue/smsQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe314=['update','emit','removeListener','length','smsQueue:','save','remove'];(function(_0x226642,_0x5b611d){var _0x41ec1a=function(_0x3d1b32){while(--_0x3d1b32){_0x226642['push'](_0x226642['shift']());}};_0x41ec1a(++_0x5b611d);}(_0xe314,0x7c));var _0x4e31=function(_0x8131d9,_0x2b2b89){_0x8131d9=_0x8131d9-0x0;var _0x55b063=_0xe314[_0x8131d9];return _0x55b063;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x4e31('0x0'),_0x4e31('0x1'),_0x4e31('0x2')];function createListener(_0xc8a121,_0x27fc63){return function(_0x21e52f){_0x27fc63[_0x4e31('0x3')](_0xc8a121,_0x21e52f);};}function removeListener(_0x13b7fa,_0x63cecc){return function(){SmsQueueEvents[_0x4e31('0x4')](_0x13b7fa,_0x63cecc);};}exports['register']=function(_0x49b2a7){for(var _0x3c5e06=0x0,_0x29d63d=events[_0x4e31('0x5')];_0x3c5e06<_0x29d63d;_0x3c5e06++){var _0x311a10=events[_0x3c5e06];var _0x430fb9=createListener(_0x4e31('0x6')+_0x311a10,_0x49b2a7);SmsQueueEvents['on'](_0x311a10,_0x430fb9);}};
\ No newline at end of file
+var _0x5bba=['length','save','remove','update','emit','removeListener','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5bba,0x9b));var _0xa5bb=function(_0x109a3f,_0x5c34f0){_0x109a3f=_0x109a3f-0x0;var _0x1598b5=_0x5bba[_0x109a3f];return _0x1598b5;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xa5bb('0x0'),_0xa5bb('0x1'),_0xa5bb('0x2')];function createListener(_0x8d7932,_0x55ccbd){return function(_0x20b43c){_0x55ccbd[_0xa5bb('0x3')](_0x8d7932,_0x20b43c);};}function removeListener(_0x1daeb7,_0x2059d7){return function(){SmsQueueEvents[_0xa5bb('0x4')](_0x1daeb7,_0x2059d7);};}exports[_0xa5bb('0x5')]=function(_0x3993f7){for(var _0x1e667a=0x0,_0x22a89c=events[_0xa5bb('0x6')];_0x1e667a<_0x22a89c;_0x1e667a++){var _0x723c22=events[_0x1e667a];var _0x454970=createListener('smsQueue:'+_0x723c22,_0x3993f7);SmsQueueEvents['on'](_0x723c22,_0x454970);}};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js
index 182c0ec..4e0f543 100644
--- a/server/api/smsQueueReport/index.js
+++ b/server/api/smsQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf603=['./smsQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf603,0x124));var _0x3f60=function(_0xfa8a07,_0x36234a){_0xfa8a07=_0xfa8a07-0x0;var _0x5911e8=_0xf603[_0xfa8a07];return _0x5911e8;};'use strict';var multer=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var path=require('path');var timeout=require(_0x3f60('0x2'));var express=require(_0x3f60('0x3'));var router=express[_0x3f60('0x4')]();var auth=require(_0x3f60('0x5'));var interaction=require(_0x3f60('0x6'));var config=require(_0x3f60('0x7'));var controller=require(_0x3f60('0x8'));router[_0x3f60('0x9')]('/',auth[_0x3f60('0xa')](),controller['index']);router['get']('/describe',auth[_0x3f60('0xa')](),controller[_0x3f60('0xb')]);router[_0x3f60('0x9')](_0x3f60('0xc'),auth[_0x3f60('0xa')](),controller[_0x3f60('0xd')]);router[_0x3f60('0xe')]('/',auth[_0x3f60('0xa')](),controller[_0x3f60('0xf')]);router[_0x3f60('0x10')](_0x3f60('0xc'),auth[_0x3f60('0xa')](),controller[_0x3f60('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3f60('0x12')]);module[_0x3f60('0x13')]=router;
\ No newline at end of file
+var _0xa1aa=['delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','update'];(function(_0x267005,_0x381227){var _0xc3b812=function(_0x4b9f71){while(--_0x4b9f71){_0x267005['push'](_0x267005['shift']());}};_0xc3b812(++_0x381227);}(_0xa1aa,0x88));var _0xaa1a=function(_0x1518b1,_0x1685b7){_0x1518b1=_0x1518b1-0x0;var _0x418a30=_0xa1aa[_0x1518b1];return _0x418a30;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaa1a('0x0'));var timeout=require(_0xaa1a('0x1'));var express=require(_0xaa1a('0x2'));var router=express[_0xaa1a('0x3')]();var auth=require(_0xaa1a('0x4'));var interaction=require(_0xaa1a('0x5'));var config=require(_0xaa1a('0x6'));var controller=require('./smsQueueReport.controller');router[_0xaa1a('0x7')]('/',auth[_0xaa1a('0x8')](),controller['index']);router[_0xaa1a('0x7')](_0xaa1a('0x9'),auth[_0xaa1a('0x8')](),controller[_0xaa1a('0xa')]);router[_0xaa1a('0x7')](_0xaa1a('0xb'),auth[_0xaa1a('0x8')](),controller[_0xaa1a('0xc')]);router[_0xaa1a('0xd')]('/',auth['isAuthenticated'](),controller[_0xaa1a('0xe')]);router['put'](_0xaa1a('0xb'),auth[_0xaa1a('0x8')](),controller[_0xaa1a('0xf')]);router[_0xaa1a('0x10')](_0xaa1a('0xb'),auth[_0xaa1a('0x8')](),controller[_0xaa1a('0x11')]);module[_0xaa1a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js
index 5fa9a97..d590235 100644
--- a/server/api/smsQueueReport/smsQueueReport.attributes.js
+++ b/server/api/smsQueueReport/smsQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb471=['STRING','DATE','moment','sequelize'];(function(_0x3e3064,_0x3dd6f5){var _0x4547e1=function(_0x785d07){while(--_0x785d07){_0x3e3064['push'](_0x3e3064['shift']());}};_0x4547e1(++_0x3dd6f5);}(_0xb471,0xb2));var _0x1b47=function(_0x512076,_0x21509b){_0x512076=_0x512076-0x0;var _0x88c447=_0xb471[_0x512076];return _0x88c447;};'use strict';var moment=require(_0x1b47('0x0'));var Sequelize=require(_0x1b47('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x1b47('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1b47('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1b47('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1b47('0x3')]},'reason':{'type':Sequelize[_0x1b47('0x2')]}};
\ No newline at end of file
+var _0xa1ab=['exports','DATE','moment'];(function(_0x496c46,_0x36e110){var _0x416d16=function(_0x3925e9){while(--_0x3925e9){_0x496c46['push'](_0x496c46['shift']());}};_0x416d16(++_0x36e110);}(_0xa1ab,0x1d0));var _0xba1a=function(_0x773c36,_0x1244f3){_0x773c36=_0x773c36-0x0;var _0xff4620=_0xa1ab[_0x773c36];return _0xff4620;};'use strict';var moment=require(_0xba1a('0x0'));var Sequelize=require('sequelize');module[_0xba1a('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xba1a('0x2')]},'leaveAt':{'type':Sequelize[_0xba1a('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xba1a('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js
index dba94f6..2960710 100644
--- a/server/api/smsQueueReport/smsQueueReport.controller.js
+++ b/server/api/smsQueueReport/smsQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3746=['hasOwnProperty','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','length','include','find','create','update','body','params','describe','html-pdf','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','end','stack','name','send','SmsQueueReport','rawAttributes','model','query','keys','intersection','attributes'];(function(_0x530e0e,_0x54d536){var _0x2742fb=function(_0x248145){while(--_0x248145){_0x530e0e['push'](_0x530e0e['shift']());}};_0x2742fb(++_0x54d536);}(_0x3746,0xa9));var _0x6374=function(_0x27e4df,_0x5258e8){_0x27e4df=_0x27e4df-0x0;var _0xb0b082=_0x3746[_0x27e4df];return _0xb0b082;};'use strict';var pdf=require(_0x6374('0x0'));var emlformat=require(_0x6374('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6374('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6374('0x3'));var moment=require(_0x6374('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6374('0x5'));var path=require(_0x6374('0x6'));var sox=require(_0x6374('0x7'));var csv=require(_0x6374('0x8'));var ejs=require(_0x6374('0x9'));var fs=require('fs');var _=require(_0x6374('0xa'));var squel=require(_0x6374('0xb'));var crypto=require(_0x6374('0xc'));var jsforce=require(_0x6374('0xd'));var deskjs=require(_0x6374('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6374('0xf'));var Papa=require('papaparse');var Redis=require(_0x6374('0x10'));var authService=require(_0x6374('0x11'));var qs=require(_0x6374('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6374('0x13'))(_0x6374('0x14'));var utils=require(_0x6374('0x15'));var config=require('../../config/environment');var db=require(_0x6374('0x16'))['db'];function respondWithStatusCode(_0x874f4e,_0x4d3a4e){_0x4d3a4e=_0x4d3a4e||0xcc;return function(_0x8c230){if(_0x8c230){return _0x874f4e[_0x6374('0x17')](_0x4d3a4e);}return _0x874f4e[_0x6374('0x18')](_0x4d3a4e)['end']();};}function respondWithResult(_0x24289e,_0x397b4c){_0x397b4c=_0x397b4c||0xc8;return function(_0x3916b5){if(_0x3916b5){return _0x24289e['status'](_0x397b4c)[_0x6374('0x19')](_0x3916b5);}};}function respondWithFilteredResult(_0x55ae57,_0x485331){return function(_0x22c866){if(_0x22c866){var _0x4ffe00=_0x22c866[_0x6374('0x1a')],_0x17d71b=_0x485331[_0x6374('0x1b')],_0x3a2b3a=_0x485331[_0x6374('0x1b')]+_0x485331[_0x6374('0x1c')],_0x1fdaa6;if(_0x3a2b3a>=_0x4ffe00){_0x3a2b3a=_0x4ffe00;_0x1fdaa6=0xc8;}else{_0x1fdaa6=0xce;}_0x55ae57[_0x6374('0x18')](_0x1fdaa6);return _0x55ae57[_0x6374('0x1d')](_0x6374('0x1e'),_0x17d71b+'-'+_0x3a2b3a+'/'+_0x4ffe00)[_0x6374('0x19')](_0x22c866);}return null;};}function patchUpdates(_0xd6236b){return function(_0x4f8db8){try{jsonpatch[_0x6374('0x1f')](_0x4f8db8,_0xd6236b,!![]);}catch(_0x435ab6){return BPromise[_0x6374('0x20')](_0x435ab6);}return _0x4f8db8[_0x6374('0x21')]();};}function saveUpdates(_0x3b8ed2,_0x3ec117){return function(_0x101d49){if(_0x101d49){return _0x101d49['update'](_0x3b8ed2)['then'](function(_0x2c29ae){return _0x2c29ae;});}return null;};}function removeEntity(_0x5a406a,_0x465c25){return function(_0x43d559){if(_0x43d559){return _0x43d559[_0x6374('0x22')]()[_0x6374('0x23')](function(){_0x5a406a['status'](0xcc)[_0x6374('0x24')]();});}};}function handleEntityNotFound(_0x2227c9,_0x190870){return function(_0x1148e5){if(!_0x1148e5){_0x2227c9[_0x6374('0x17')](0x194);}return _0x1148e5;};}function handleError(_0xd0a6b5,_0x46a3e2){_0x46a3e2=_0x46a3e2||0x1f4;return function(_0x1a8808){logger['error'](_0x1a8808[_0x6374('0x25')]);if(_0x1a8808[_0x6374('0x26')]){delete _0x1a8808[_0x6374('0x26')];}_0xd0a6b5['status'](_0x46a3e2)[_0x6374('0x27')](_0x1a8808);};}exports['index']=function(_0x39fcba,_0x46bb34){var _0x8d5419={},_0x1cb029={},_0x42bc95={'count':0x0,'rows':[]};var _0x3cf16d=db[_0x6374('0x28')][_0x6374('0x29')];_0x1cb029[_0x6374('0x2a')]=_['keys'](_0x3cf16d);_0x1cb029[_0x6374('0x2b')]=_[_0x6374('0x2c')](_0x39fcba[_0x6374('0x2b')]);_0x1cb029['filters']=_[_0x6374('0x2d')](_0x1cb029[_0x6374('0x2a')],_0x1cb029['query']);_0x8d5419[_0x6374('0x2e')]=_['intersection'](_0x1cb029['model'],qs['fields'](_0x39fcba['query']['fields']));_0x8d5419[_0x6374('0x2e')]=_0x8d5419['attributes']['length']?_0x8d5419[_0x6374('0x2e')]:_0x1cb029[_0x6374('0x2a')];if(!_0x39fcba[_0x6374('0x2b')][_0x6374('0x2f')]('nolimit')){_0x8d5419[_0x6374('0x1c')]=qs['limit'](_0x39fcba[_0x6374('0x2b')][_0x6374('0x1c')]);_0x8d5419[_0x6374('0x1b')]=qs[_0x6374('0x1b')](_0x39fcba[_0x6374('0x2b')][_0x6374('0x1b')]);}_0x8d5419[_0x6374('0x30')]=qs[_0x6374('0x31')](_0x39fcba[_0x6374('0x2b')]['sort']);_0x8d5419[_0x6374('0x32')]=qs[_0x6374('0x33')](_['pick'](_0x39fcba[_0x6374('0x2b')],_0x1cb029[_0x6374('0x33')]));if(_0x39fcba[_0x6374('0x2b')][_0x6374('0x34')]){_0x8d5419[_0x6374('0x32')]=_[_0x6374('0x35')](_0x8d5419['where'],{'$or':_[_0x6374('0x36')](_0x3cf16d,function(_0x2a4220){if(_0x2a4220[_0x6374('0x37')][_0x6374('0x38')]!==_0x6374('0x39')){var _0x45d194={};_0x45d194[_0x2a4220[_0x6374('0x3a')]]={'$like':'%'+_0x39fcba['query'][_0x6374('0x34')]+'%'};return _0x45d194;}})});}_0x8d5419=_[_0x6374('0x35')]({},_0x8d5419,_0x39fcba[_0x6374('0x3b')]);var _0x5096a0={'where':_0x8d5419[_0x6374('0x32')]};return db[_0x6374('0x28')]['count'](_0x5096a0)[_0x6374('0x23')](function(_0x2ea34c){_0x42bc95[_0x6374('0x1a')]=_0x2ea34c;if(_0x39fcba[_0x6374('0x2b')][_0x6374('0x3c')]){_0x8d5419['include']=[{'all':!![]}];}return db[_0x6374('0x28')][_0x6374('0x3d')](_0x8d5419);})[_0x6374('0x23')](function(_0x4808af){_0x42bc95[_0x6374('0x3e')]=_0x4808af;return _0x42bc95;})[_0x6374('0x23')](respondWithFilteredResult(_0x46bb34,_0x8d5419))[_0x6374('0x3f')](handleError(_0x46bb34,null));};exports['show']=function(_0x42bcbd,_0x5804e3){var _0x100d53={'raw':!![],'where':{'id':_0x42bcbd['params']['id']}},_0x50fde9={};_0x50fde9[_0x6374('0x2a')]=_[_0x6374('0x2c')](db['SmsQueueReport'][_0x6374('0x29')]);_0x50fde9[_0x6374('0x2b')]=_['keys'](_0x42bcbd[_0x6374('0x2b')]);_0x50fde9[_0x6374('0x33')]=_[_0x6374('0x2d')](_0x50fde9[_0x6374('0x2a')],_0x50fde9[_0x6374('0x2b')]);_0x100d53[_0x6374('0x2e')]=_[_0x6374('0x2d')](_0x50fde9['model'],qs['fields'](_0x42bcbd['query']['fields']));_0x100d53['attributes']=_0x100d53['attributes'][_0x6374('0x40')]?_0x100d53['attributes']:_0x50fde9[_0x6374('0x2a')];if(_0x42bcbd[_0x6374('0x2b')]['includeAll']){_0x100d53[_0x6374('0x41')]=[{'all':!![]}];}_0x100d53=_[_0x6374('0x35')]({},_0x100d53,_0x42bcbd[_0x6374('0x3b')]);return db[_0x6374('0x28')][_0x6374('0x42')](_0x100d53)[_0x6374('0x23')](handleEntityNotFound(_0x5804e3,null))['then'](respondWithResult(_0x5804e3,null))[_0x6374('0x3f')](handleError(_0x5804e3,null));};exports[_0x6374('0x43')]=function(_0x1b4ae5,_0x178527){return db['SmsQueueReport'][_0x6374('0x43')](_0x1b4ae5['body'],{})[_0x6374('0x23')](respondWithResult(_0x178527,0xc9))['catch'](handleError(_0x178527,null));};exports[_0x6374('0x44')]=function(_0x5cdb59,_0x140ac4){if(_0x5cdb59[_0x6374('0x45')]['id']){delete _0x5cdb59['body']['id'];}return db[_0x6374('0x28')][_0x6374('0x42')]({'where':{'id':_0x5cdb59[_0x6374('0x46')]['id']}})[_0x6374('0x23')](handleEntityNotFound(_0x140ac4,null))[_0x6374('0x23')](saveUpdates(_0x5cdb59[_0x6374('0x45')],null))[_0x6374('0x23')](respondWithResult(_0x140ac4,null))[_0x6374('0x3f')](handleError(_0x140ac4,null));};exports[_0x6374('0x22')]=function(_0x20187a,_0x2588b5){return db[_0x6374('0x28')][_0x6374('0x42')]({'where':{'id':_0x20187a[_0x6374('0x46')]['id']}})['then'](handleEntityNotFound(_0x2588b5,null))['then'](removeEntity(_0x2588b5,null))['catch'](handleError(_0x2588b5,null));};exports[_0x6374('0x47')]=function(_0x449658,_0x3dfa0d){return db[_0x6374('0x28')][_0x6374('0x47')]()[_0x6374('0x23')](respondWithResult(_0x3dfa0d,null))['catch'](handleError(_0x3dfa0d,null));};
\ No newline at end of file
+var _0x7334=['field','filter','options','count','include','rows','catch','show','keys','rawAttributes','length','includeAll','find','create','body','update','destroy','params','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','save','then','error','stack','name','send','index','SmsQueueReport','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','merge','map','type','key','VIRTUAL'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7334,0x184));var _0x4733=function(_0x58620d,_0x482b7b){_0x58620d=_0x58620d-0x0;var _0x187153=_0x7334[_0x58620d];return _0x187153;};'use strict';var pdf=require(_0x4733('0x0'));var emlformat=require(_0x4733('0x1'));var rimraf=require(_0x4733('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4733('0x3'));var moment=require('moment');var BPromise=require(_0x4733('0x4'));var Mustache=require(_0x4733('0x5'));var util=require(_0x4733('0x6'));var path=require(_0x4733('0x7'));var sox=require(_0x4733('0x8'));var csv=require(_0x4733('0x9'));var ejs=require(_0x4733('0xa'));var fs=require('fs');var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x9'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4733('0x14'));var logger=require(_0x4733('0x15'))('api');var utils=require(_0x4733('0x16'));var config=require('../../config/environment');var db=require(_0x4733('0x17'))['db'];function respondWithStatusCode(_0x380b2e,_0x44cb92){_0x44cb92=_0x44cb92||0xcc;return function(_0x461f74){if(_0x461f74){return _0x380b2e[_0x4733('0x18')](_0x44cb92);}return _0x380b2e[_0x4733('0x19')](_0x44cb92)[_0x4733('0x1a')]();};}function respondWithResult(_0x5e4b06,_0x57e554){_0x57e554=_0x57e554||0xc8;return function(_0x543caf){if(_0x543caf){return _0x5e4b06[_0x4733('0x19')](_0x57e554)[_0x4733('0x1b')](_0x543caf);}};}function respondWithFilteredResult(_0x2e5b1b,_0x22283e){return function(_0x3813df){if(_0x3813df){var _0x167016=_0x3813df['count'],_0x12f111=_0x22283e[_0x4733('0x1c')],_0x9fff=_0x22283e[_0x4733('0x1c')]+_0x22283e['limit'],_0x1920ce;if(_0x9fff>=_0x167016){_0x9fff=_0x167016;_0x1920ce=0xc8;}else{_0x1920ce=0xce;}_0x2e5b1b[_0x4733('0x19')](_0x1920ce);return _0x2e5b1b[_0x4733('0x1d')](_0x4733('0x1e'),_0x12f111+'-'+_0x9fff+'/'+_0x167016)[_0x4733('0x1b')](_0x3813df);}return null;};}function patchUpdates(_0x579f67){return function(_0x517fbc){try{jsonpatch[_0x4733('0x1f')](_0x517fbc,_0x579f67,!![]);}catch(_0x3b730a){return BPromise['reject'](_0x3b730a);}return _0x517fbc[_0x4733('0x20')]();};}function saveUpdates(_0x1943bc,_0x15339c){return function(_0x7a4e0){if(_0x7a4e0){return _0x7a4e0['update'](_0x1943bc)[_0x4733('0x21')](function(_0xb45e1){return _0xb45e1;});}return null;};}function removeEntity(_0x5d058d,_0x2aa2f4){return function(_0x18da47){if(_0x18da47){return _0x18da47['destroy']()[_0x4733('0x21')](function(){_0x5d058d[_0x4733('0x19')](0xcc)[_0x4733('0x1a')]();});}};}function handleEntityNotFound(_0x1a0643,_0x3a2542){return function(_0x24db74){if(!_0x24db74){_0x1a0643[_0x4733('0x18')](0x194);}return _0x24db74;};}function handleError(_0x2bb78f,_0x523697){_0x523697=_0x523697||0x1f4;return function(_0x3e6976){logger[_0x4733('0x22')](_0x3e6976[_0x4733('0x23')]);if(_0x3e6976[_0x4733('0x24')]){delete _0x3e6976[_0x4733('0x24')];}_0x2bb78f[_0x4733('0x19')](_0x523697)[_0x4733('0x25')](_0x3e6976);};}exports[_0x4733('0x26')]=function(_0x13bc12,_0x23fe6c){var _0x521855={},_0x3aeb57={},_0x4c91bc={'count':0x0,'rows':[]};var _0x5b6fc0=db[_0x4733('0x27')]['rawAttributes'];_0x3aeb57[_0x4733('0x28')]=_['keys'](_0x5b6fc0);_0x3aeb57['query']=_['keys'](_0x13bc12[_0x4733('0x29')]);_0x3aeb57[_0x4733('0x2a')]=_[_0x4733('0x2b')](_0x3aeb57[_0x4733('0x28')],_0x3aeb57['query']);_0x521855['attributes']=_['intersection'](_0x3aeb57[_0x4733('0x28')],qs['fields'](_0x13bc12['query'][_0x4733('0x2c')]));_0x521855[_0x4733('0x2d')]=_0x521855[_0x4733('0x2d')]['length']?_0x521855['attributes']:_0x3aeb57[_0x4733('0x28')];if(!_0x13bc12[_0x4733('0x29')][_0x4733('0x2e')](_0x4733('0x2f'))){_0x521855[_0x4733('0x30')]=qs['limit'](_0x13bc12[_0x4733('0x29')][_0x4733('0x30')]);_0x521855[_0x4733('0x1c')]=qs[_0x4733('0x1c')](_0x13bc12[_0x4733('0x29')]['offset']);}_0x521855['order']=qs[_0x4733('0x31')](_0x13bc12[_0x4733('0x29')][_0x4733('0x31')]);_0x521855[_0x4733('0x32')]=qs[_0x4733('0x2a')](_['pick'](_0x13bc12[_0x4733('0x29')],_0x3aeb57[_0x4733('0x2a')]));if(_0x13bc12[_0x4733('0x29')]['filter']){_0x521855[_0x4733('0x32')]=_[_0x4733('0x33')](_0x521855[_0x4733('0x32')],{'$or':_[_0x4733('0x34')](_0x5b6fc0,function(_0x463976){if(_0x463976[_0x4733('0x35')][_0x4733('0x36')]!==_0x4733('0x37')){var _0x4f70bf={};_0x4f70bf[_0x463976[_0x4733('0x38')]]={'$like':'%'+_0x13bc12['query'][_0x4733('0x39')]+'%'};return _0x4f70bf;}})});}_0x521855=_[_0x4733('0x33')]({},_0x521855,_0x13bc12[_0x4733('0x3a')]);var _0x1654d4={'where':_0x521855[_0x4733('0x32')]};return db[_0x4733('0x27')][_0x4733('0x3b')](_0x1654d4)[_0x4733('0x21')](function(_0x592fc2){_0x4c91bc[_0x4733('0x3b')]=_0x592fc2;if(_0x13bc12[_0x4733('0x29')]['includeAll']){_0x521855[_0x4733('0x3c')]=[{'all':!![]}];}return db[_0x4733('0x27')]['findAll'](_0x521855);})[_0x4733('0x21')](function(_0x50849a){_0x4c91bc[_0x4733('0x3d')]=_0x50849a;return _0x4c91bc;})['then'](respondWithFilteredResult(_0x23fe6c,_0x521855))[_0x4733('0x3e')](handleError(_0x23fe6c,null));};exports[_0x4733('0x3f')]=function(_0x5d4b95,_0x515720){var _0x3a766b={'raw':!![],'where':{'id':_0x5d4b95['params']['id']}},_0x1d7112={};_0x1d7112[_0x4733('0x28')]=_[_0x4733('0x40')](db[_0x4733('0x27')][_0x4733('0x41')]);_0x1d7112[_0x4733('0x29')]=_[_0x4733('0x40')](_0x5d4b95[_0x4733('0x29')]);_0x1d7112[_0x4733('0x2a')]=_[_0x4733('0x2b')](_0x1d7112[_0x4733('0x28')],_0x1d7112[_0x4733('0x29')]);_0x3a766b[_0x4733('0x2d')]=_[_0x4733('0x2b')](_0x1d7112[_0x4733('0x28')],qs[_0x4733('0x2c')](_0x5d4b95[_0x4733('0x29')][_0x4733('0x2c')]));_0x3a766b[_0x4733('0x2d')]=_0x3a766b['attributes'][_0x4733('0x42')]?_0x3a766b[_0x4733('0x2d')]:_0x1d7112[_0x4733('0x28')];if(_0x5d4b95[_0x4733('0x29')][_0x4733('0x43')]){_0x3a766b[_0x4733('0x3c')]=[{'all':!![]}];}_0x3a766b=_[_0x4733('0x33')]({},_0x3a766b,_0x5d4b95[_0x4733('0x3a')]);return db[_0x4733('0x27')][_0x4733('0x44')](_0x3a766b)[_0x4733('0x21')](handleEntityNotFound(_0x515720,null))[_0x4733('0x21')](respondWithResult(_0x515720,null))[_0x4733('0x3e')](handleError(_0x515720,null));};exports[_0x4733('0x45')]=function(_0x561377,_0x555d00){return db[_0x4733('0x27')][_0x4733('0x45')](_0x561377[_0x4733('0x46')],{})[_0x4733('0x21')](respondWithResult(_0x555d00,0xc9))[_0x4733('0x3e')](handleError(_0x555d00,null));};exports[_0x4733('0x47')]=function(_0x23ffaf,_0x297edb){if(_0x23ffaf[_0x4733('0x46')]['id']){delete _0x23ffaf[_0x4733('0x46')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x23ffaf['params']['id']}})['then'](handleEntityNotFound(_0x297edb,null))[_0x4733('0x21')](saveUpdates(_0x23ffaf[_0x4733('0x46')],null))[_0x4733('0x21')](respondWithResult(_0x297edb,null))[_0x4733('0x3e')](handleError(_0x297edb,null));};exports[_0x4733('0x48')]=function(_0x45b9cf,_0x1c6abf){return db[_0x4733('0x27')][_0x4733('0x44')]({'where':{'id':_0x45b9cf[_0x4733('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c6abf,null))['then'](removeEntity(_0x1c6abf,null))[_0x4733('0x3e')](handleError(_0x1c6abf,null));};exports['describe']=function(_0x2882ed,_0x17e686){return db[_0x4733('0x27')]['describe']()[_0x4733('0x21')](respondWithResult(_0x17e686,null))[_0x4733('0x3e')](handleError(_0x17e686,null));};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js
index f054870..102fafa 100644
--- a/server/api/smsQueueReport/smsQueueReport.model.js
+++ b/server/api/smsQueueReport/smsQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9559=['define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','request-promise','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x2c7505,_0xfb5c33){var _0x216b84=function(_0xecd3ea){while(--_0xecd3ea){_0x2c7505['push'](_0x2c7505['shift']());}};_0x216b84(++_0xfb5c33);}(_0x9559,0x7c));var _0x9955=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0x9559[_0x22ee1e];return _0x49a5c9;};'use strict';var _=require(_0x9955('0x0'));var util=require(_0x9955('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9955('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9955('0x3'));var attributes=require(_0x9955('0x4'));module[_0x9955('0x5')]=function(_0x47e155,_0x571f91){return _0x47e155[_0x9955('0x6')](_0x9955('0x7'),attributes,{'tableName':_0x9955('0x8'),'paranoid':![],'indexes':[{'name':_0x9955('0x9'),'fields':[_0x9955('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3a8=['exports','report_sms_queue','uniqueid','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes'];(function(_0x2e6c8d,_0x17c7ef){var _0x259c0f=function(_0x97387a){while(--_0x97387a){_0x2e6c8d['push'](_0x2e6c8d['shift']());}};_0x259c0f(++_0x17c7ef);}(_0xe3a8,0x1e7));var _0x8e3a=function(_0x1609eb,_0x40a935){_0x1609eb=_0x1609eb-0x0;var _0x20aaa3=_0xe3a8[_0x1609eb];return _0x20aaa3;};'use strict';var _=require('lodash');var util=require(_0x8e3a('0x0'));var logger=require(_0x8e3a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8e3a('0x2'));var rp=require(_0x8e3a('0x3'));var fs=require('fs');var path=require(_0x8e3a('0x4'));var rimraf=require(_0x8e3a('0x5'));var config=require(_0x8e3a('0x6'));var attributes=require(_0x8e3a('0x7'));module[_0x8e3a('0x8')]=function(_0x2c9eba,_0x30ce1b){return _0x2c9eba['define']('SmsQueueReport',attributes,{'tableName':_0x8e3a('0x9'),'paranoid':![],'indexes':[{'name':_0x8e3a('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js
index 0334a67..02ae7bf 100644
--- a/server/api/smsQueueReport/smsQueueReport.rpc.js
+++ b/server/api/smsQueueReport/smsQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x327b=['SmsQueueReport','create','body','options','raw','update','where','attributes','limit','UpdateSmsQueueReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','code','error','SmsQueueReport,\x20%s,\x20%s','message','result','catch','CreateSmsQueueReport'];(function(_0x110121,_0x1e538a){var _0x77bcf0=function(_0x359894){while(--_0x359894){_0x110121['push'](_0x110121['shift']());}};_0x77bcf0(++_0x1e538a);}(_0x327b,0x1c4));var _0xb327=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x327b[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb327('0x0'));var BPromise=require(_0xb327('0x1'));var rs=require(_0xb327('0x2'));var fs=require('fs');var Redis=require(_0xb327('0x3'));var db=require(_0xb327('0x4'))['db'];var utils=require(_0xb327('0x5'));var logger=require(_0xb327('0x6'))(_0xb327('0x7'));var config=require(_0xb327('0x8'));var jayson=require(_0xb327('0x9'));var client=jayson['client'][_0xb327('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38a618,_0x411363,_0x287e0f){return new BPromise(function(_0x578cec,_0x3c7ab3){return client[_0xb327('0xb')](_0x38a618,_0x287e0f)[_0xb327('0xc')](function(_0x2c6f5d){logger[_0xb327('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x411363,'request\x20sent');logger[_0xb327('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x411363,_0xb327('0xf'),JSON[_0xb327('0x10')](_0x2c6f5d));if(_0x2c6f5d['error']){if(_0x2c6f5d['error'][_0xb327('0x11')]===0x1f4){logger[_0xb327('0x12')](_0xb327('0x13'),_0x411363,_0x2c6f5d[_0xb327('0x12')][_0xb327('0x14')]);return _0x3c7ab3(_0x2c6f5d['error'][_0xb327('0x14')]);}logger[_0xb327('0x12')](_0xb327('0x13'),_0x411363,_0x2c6f5d[_0xb327('0x12')][_0xb327('0x14')]);return _0x578cec(_0x2c6f5d[_0xb327('0x12')]['message']);}else{logger[_0xb327('0xd')](_0xb327('0x13'),_0x411363,_0xb327('0xf'));_0x578cec(_0x2c6f5d[_0xb327('0x15')]['message']);}})[_0xb327('0x16')](function(_0x10d8e6){logger[_0xb327('0x12')](_0xb327('0x13'),_0x411363,_0x10d8e6);_0x3c7ab3(_0x10d8e6);});});}exports[_0xb327('0x17')]=function(_0x2b8427){var _0x194f1c=this;return new Promise(function(_0x194ed6,_0x4f3270){return db[_0xb327('0x18')][_0xb327('0x19')](_0x2b8427[_0xb327('0x1a')],{'raw':_0x2b8427[_0xb327('0x1b')]?_0x2b8427[_0xb327('0x1b')][_0xb327('0x1c')]===undefined?!![]:![]:!![]})[_0xb327('0xc')](function(_0x3480e0){logger[_0xb327('0xd')]('CreateSmsQueueReport',_0x2b8427);logger[_0xb327('0xe')](_0xb327('0x17'),_0x2b8427,JSON[_0xb327('0x10')](_0x3480e0));_0x194ed6(_0x3480e0);})[_0xb327('0x16')](function(_0x319340){logger['error']('CreateSmsQueueReport',_0x319340[_0xb327('0x14')],_0x2b8427);_0x4f3270(_0x194f1c[_0xb327('0x12')](0x1f4,_0x319340[_0xb327('0x14')]));});});};exports['UpdateSmsQueueReport']=function(_0x107a65){var _0x38f176=this;return new Promise(function(_0x3050ca,_0x3e99d4){return db[_0xb327('0x18')][_0xb327('0x1d')](_0x107a65[_0xb327('0x1a')],{'raw':_0x107a65[_0xb327('0x1b')]?_0x107a65[_0xb327('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x107a65[_0xb327('0x1b')]?_0x107a65[_0xb327('0x1b')][_0xb327('0x1e')]||null:null,'attributes':_0x107a65[_0xb327('0x1b')]?_0x107a65[_0xb327('0x1b')][_0xb327('0x1f')]||null:null,'limit':_0x107a65['options']?_0x107a65[_0xb327('0x1b')][_0xb327('0x20')]||null:null})[_0xb327('0xc')](function(_0x3e4784){logger[_0xb327('0xd')](_0xb327('0x21'),_0x107a65);logger[_0xb327('0xe')](_0xb327('0x21'),_0x107a65,JSON['stringify'](_0x3e4784));_0x3050ca(_0x3e4784);})['catch'](function(_0x52e68b){logger[_0xb327('0x12')]('UpdateSmsQueueReport',_0x52e68b['message'],_0x107a65);_0x3e99d4(_0x38f176[_0xb327('0x12')](0x1f4,_0x52e68b[_0xb327('0x14')]));});});};
\ No newline at end of file
+var _0xea20=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','catch','UpdateSmsQueueReport','update','where','lodash'];(function(_0x3f8d39,_0x57f2a7){var _0x30bf45=function(_0x4aa292){while(--_0x4aa292){_0x3f8d39['push'](_0x3f8d39['shift']());}};_0x30bf45(++_0x57f2a7);}(_0xea20,0x18b));var _0x0ea2=function(_0x10885d,_0x253111){_0x10885d=_0x10885d-0x0;var _0x1a6e17=_0xea20[_0x10885d];return _0x1a6e17;};'use strict';var _=require(_0x0ea2('0x0'));var util=require(_0x0ea2('0x1'));var moment=require(_0x0ea2('0x2'));var BPromise=require(_0x0ea2('0x3'));var rs=require(_0x0ea2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ea2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ea2('0x6'))(_0x0ea2('0x7'));var config=require(_0x0ea2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0ea2('0x9')][_0x0ea2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x816555,_0x258313,_0x467df3){return new BPromise(function(_0x16d763,_0x123740){return client[_0x0ea2('0xb')](_0x816555,_0x467df3)[_0x0ea2('0xc')](function(_0x57f74f){logger[_0x0ea2('0xd')](_0x0ea2('0xe'),_0x258313,'request\x20sent');logger[_0x0ea2('0xf')](_0x0ea2('0x10'),_0x258313,_0x0ea2('0x11'),JSON[_0x0ea2('0x12')](_0x57f74f));if(_0x57f74f[_0x0ea2('0x13')]){if(_0x57f74f[_0x0ea2('0x13')][_0x0ea2('0x14')]===0x1f4){logger['error'](_0x0ea2('0xe'),_0x258313,_0x57f74f[_0x0ea2('0x13')][_0x0ea2('0x15')]);return _0x123740(_0x57f74f[_0x0ea2('0x13')][_0x0ea2('0x15')]);}logger[_0x0ea2('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x258313,_0x57f74f[_0x0ea2('0x13')][_0x0ea2('0x15')]);return _0x16d763(_0x57f74f[_0x0ea2('0x13')][_0x0ea2('0x15')]);}else{logger[_0x0ea2('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x258313,'request\x20sent');_0x16d763(_0x57f74f[_0x0ea2('0x16')][_0x0ea2('0x15')]);}})['catch'](function(_0x432659){logger[_0x0ea2('0x13')](_0x0ea2('0xe'),_0x258313,_0x432659);_0x123740(_0x432659);});});}exports[_0x0ea2('0x17')]=function(_0x42038b){var _0x1114f6=this;return new Promise(function(_0x304d67,_0x22d9c9){return db[_0x0ea2('0x18')][_0x0ea2('0x19')](_0x42038b[_0x0ea2('0x1a')],{'raw':_0x42038b['options']?_0x42038b[_0x0ea2('0x1b')][_0x0ea2('0x1c')]===undefined?!![]:![]:!![]})[_0x0ea2('0xc')](function(_0x3d2756){logger['info'](_0x0ea2('0x17'),_0x42038b);logger[_0x0ea2('0xf')](_0x0ea2('0x17'),_0x42038b,JSON[_0x0ea2('0x12')](_0x3d2756));_0x304d67(_0x3d2756);})[_0x0ea2('0x1d')](function(_0x3a1252){logger[_0x0ea2('0x13')](_0x0ea2('0x17'),_0x3a1252[_0x0ea2('0x15')],_0x42038b);_0x22d9c9(_0x1114f6[_0x0ea2('0x13')](0x1f4,_0x3a1252['message']));});});};exports[_0x0ea2('0x1e')]=function(_0x23745a){var _0xf4616f=this;return new Promise(function(_0x56abc1,_0x538e90){return db['SmsQueueReport'][_0x0ea2('0x1f')](_0x23745a[_0x0ea2('0x1a')],{'raw':_0x23745a['options']?_0x23745a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23745a[_0x0ea2('0x1b')]?_0x23745a[_0x0ea2('0x1b')][_0x0ea2('0x20')]||null:null,'attributes':_0x23745a[_0x0ea2('0x1b')]?_0x23745a[_0x0ea2('0x1b')]['attributes']||null:null,'limit':_0x23745a[_0x0ea2('0x1b')]?_0x23745a[_0x0ea2('0x1b')]['limit']||null:null})[_0x0ea2('0xc')](function(_0x2885f0){logger[_0x0ea2('0xd')](_0x0ea2('0x1e'),_0x23745a);logger[_0x0ea2('0xf')]('UpdateSmsQueueReport',_0x23745a,JSON[_0x0ea2('0x12')](_0x2885f0));_0x56abc1(_0x2885f0);})[_0x0ea2('0x1d')](function(_0x3326cc){logger[_0x0ea2('0x13')](_0x0ea2('0x1e'),_0x3326cc[_0x0ea2('0x15')],_0x23745a);_0x538e90(_0xf4616f[_0x0ea2('0x13')](0x1f4,_0x3326cc[_0x0ea2('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js
index 6908fb8..4d7af6a 100644
--- a/server/api/smsTransferReport/index.js
+++ b/server/api/smsTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e94=['post','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5a8194,_0x7621f7){var _0x58534d=function(_0x2d2db3){while(--_0x2d2db3){_0x5a8194['push'](_0x5a8194['shift']());}};_0x58534d(++_0x7621f7);}(_0x2e94,0x15d));var _0x42e9=function(_0x33fb76,_0x16578f){_0x33fb76=_0x33fb76-0x0;var _0x1d6134=_0x2e94[_0x33fb76];return _0x1d6134;};'use strict';var multer=require(_0x42e9('0x0'));var util=require('util');var path=require(_0x42e9('0x1'));var timeout=require('connect-timeout');var express=require(_0x42e9('0x2'));var router=express[_0x42e9('0x3')]();var auth=require(_0x42e9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x42e9('0x5')]('/',auth[_0x42e9('0x6')](),controller[_0x42e9('0x7')]);router[_0x42e9('0x5')](_0x42e9('0x8'),auth[_0x42e9('0x6')](),controller[_0x42e9('0x9')]);router[_0x42e9('0x5')](_0x42e9('0xa'),auth[_0x42e9('0x6')](),controller[_0x42e9('0xb')]);router[_0x42e9('0xc')]('/',auth[_0x42e9('0x6')](),controller[_0x42e9('0xd')]);router[_0x42e9('0xe')](_0x42e9('0xa'),auth[_0x42e9('0x6')](),controller[_0x42e9('0xf')]);router[_0x42e9('0x10')]('/:id',auth[_0x42e9('0x6')](),controller[_0x42e9('0x11')]);module[_0x42e9('0x12')]=router;
\ No newline at end of file
+var _0x3bb4=['describe','create','/:id','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x3bb4,0x157));var _0x43bb=function(_0x3799b2,_0x3728da){_0x3799b2=_0x3799b2-0x0;var _0x1d7571=_0x3bb4[_0x3799b2];return _0x1d7571;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x43bb('0x0'));var timeout=require('connect-timeout');var express=require(_0x43bb('0x1'));var router=express[_0x43bb('0x2')]();var auth=require(_0x43bb('0x3'));var interaction=require(_0x43bb('0x4'));var config=require(_0x43bb('0x5'));var controller=require('./smsTransferReport.controller');router[_0x43bb('0x6')]('/',auth['isAuthenticated'](),controller[_0x43bb('0x7')]);router[_0x43bb('0x6')]('/describe',auth[_0x43bb('0x8')](),controller[_0x43bb('0x9')]);router['get']('/:id',auth[_0x43bb('0x8')](),controller['show']);router['post']('/',auth[_0x43bb('0x8')](),controller[_0x43bb('0xa')]);router['put'](_0x43bb('0xb'),auth['isAuthenticated'](),controller[_0x43bb('0xc')]);router[_0x43bb('0xd')](_0x43bb('0xb'),auth[_0x43bb('0x8')](),controller[_0x43bb('0xe')]);module[_0x43bb('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js
index 3dbfd56..3300c83 100644
--- a/server/api/smsTransferReport/smsTransferReport.attributes.js
+++ b/server/api/smsTransferReport/smsTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x80dc=['exports','ENUM','agent','queue','DATE','NOW','moment'];(function(_0x22b5f0,_0x2d55bb){var _0x308d7b=function(_0x5a8839){while(--_0x5a8839){_0x22b5f0['push'](_0x22b5f0['shift']());}};_0x308d7b(++_0x2d55bb);}(_0x80dc,0x92));var _0xc80d=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x80dc[_0xbd08b4];return _0x314f1e;};'use strict';var moment=require(_0xc80d('0x0'));var Sequelize=require('sequelize');module[_0xc80d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc80d('0x2')]('account',_0xc80d('0x3'),'queue'),'allowNull':![],'defaultValue':_0xc80d('0x4')},'transferredAt':{'type':Sequelize[_0xc80d('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xc80d('0x6')]}};
\ No newline at end of file
+var _0x6597=['moment','sequelize','exports','ENUM','agent','NOW'];(function(_0x4e259f,_0x3caf2c){var _0x5d86d0=function(_0x358046){while(--_0x358046){_0x4e259f['push'](_0x4e259f['shift']());}};_0x5d86d0(++_0x3caf2c);}(_0x6597,0x16e));var _0x7659=function(_0x501c3e,_0x3511f1){_0x501c3e=_0x501c3e-0x0;var _0x2acfa1=_0x6597[_0x501c3e];return _0x2acfa1;};'use strict';var moment=require(_0x7659('0x0'));var Sequelize=require(_0x7659('0x1'));module[_0x7659('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7659('0x3')]('account',_0x7659('0x4'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x7659('0x5')]}};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js
index d8b60b6..8046be4 100644
--- a/server/api/smsTransferReport/smsTransferReport.controller.js
+++ b/server/api/smsTransferReport/smsTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46f1=['eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','merge','type','key','VIRTUAL','field','filter','options','SmsTransferReport','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x46f1,0x12c));var _0x146f=function(_0x34f12b,_0x5ab1e1){_0x34f12b=_0x34f12b-0x0;var _0x551f17=_0x46f1[_0x34f12b];return _0x551f17;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x146f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x146f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x146f('0x2'));var moment=require(_0x146f('0x3'));var BPromise=require(_0x146f('0x4'));var Mustache=require(_0x146f('0x5'));var util=require(_0x146f('0x6'));var path=require(_0x146f('0x7'));var sox=require(_0x146f('0x8'));var csv=require('to-csv');var ejs=require(_0x146f('0x9'));var fs=require('fs');var _=require(_0x146f('0xa'));var squel=require(_0x146f('0xb'));var crypto=require(_0x146f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x146f('0xd'));var toCsv=require(_0x146f('0xe'));var querystring=require(_0x146f('0xf'));var Papa=require(_0x146f('0x10'));var Redis=require(_0x146f('0x11'));var authService=require(_0x146f('0x12'));var qs=require(_0x146f('0x13'));var hardwareService=require(_0x146f('0x14'));var logger=require(_0x146f('0x15'))(_0x146f('0x16'));var utils=require(_0x146f('0x17'));var config=require(_0x146f('0x18'));var db=require(_0x146f('0x19'))['db'];function respondWithStatusCode(_0x11c50c,_0x1b5dda){_0x1b5dda=_0x1b5dda||0xcc;return function(_0x20b7f1){if(_0x20b7f1){return _0x11c50c[_0x146f('0x1a')](_0x1b5dda);}return _0x11c50c[_0x146f('0x1b')](_0x1b5dda)[_0x146f('0x1c')]();};}function respondWithResult(_0x3df018,_0x348d49){_0x348d49=_0x348d49||0xc8;return function(_0x3e3bdb){if(_0x3e3bdb){return _0x3df018[_0x146f('0x1b')](_0x348d49)[_0x146f('0x1d')](_0x3e3bdb);}};}function respondWithFilteredResult(_0x3e42ed,_0x4d8b8e){return function(_0x2716c){if(_0x2716c){var _0x556595=_0x2716c[_0x146f('0x1e')],_0x3bf1cc=_0x4d8b8e['offset'],_0x4826f3=_0x4d8b8e[_0x146f('0x1f')]+_0x4d8b8e[_0x146f('0x20')],_0x5063d0;if(_0x4826f3>=_0x556595){_0x4826f3=_0x556595;_0x5063d0=0xc8;}else{_0x5063d0=0xce;}_0x3e42ed[_0x146f('0x1b')](_0x5063d0);return _0x3e42ed[_0x146f('0x21')](_0x146f('0x22'),_0x3bf1cc+'-'+_0x4826f3+'/'+_0x556595)[_0x146f('0x1d')](_0x2716c);}return null;};}function patchUpdates(_0x3dc6a9){return function(_0x30cb7f){try{jsonpatch[_0x146f('0x23')](_0x30cb7f,_0x3dc6a9,!![]);}catch(_0x2a96e7){return BPromise[_0x146f('0x24')](_0x2a96e7);}return _0x30cb7f[_0x146f('0x25')]();};}function saveUpdates(_0x58ebd3,_0x6aacd9){return function(_0x5a04c1){if(_0x5a04c1){return _0x5a04c1[_0x146f('0x26')](_0x58ebd3)[_0x146f('0x27')](function(_0xba6554){return _0xba6554;});}return null;};}function removeEntity(_0x1063c5,_0x41d9fc){return function(_0xe86836){if(_0xe86836){return _0xe86836[_0x146f('0x28')]()[_0x146f('0x27')](function(){_0x1063c5[_0x146f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x162fa8,_0x3416e5){return function(_0x25e5b2){if(!_0x25e5b2){_0x162fa8[_0x146f('0x1a')](0x194);}return _0x25e5b2;};}function handleError(_0x1e3a7e,_0x56b823){_0x56b823=_0x56b823||0x1f4;return function(_0x1c8873){logger[_0x146f('0x29')](_0x1c8873['stack']);if(_0x1c8873[_0x146f('0x2a')]){delete _0x1c8873[_0x146f('0x2a')];}_0x1e3a7e[_0x146f('0x1b')](_0x56b823)['send'](_0x1c8873);};}exports[_0x146f('0x2b')]=function(_0x44da29,_0xdba92e){var _0x171367={},_0x40f2e3={},_0x1cbdec={'count':0x0,'rows':[]};var _0x4bf655=db['SmsTransferReport'][_0x146f('0x2c')];_0x40f2e3[_0x146f('0x2d')]=_['keys'](_0x4bf655);_0x40f2e3[_0x146f('0x2e')]=_[_0x146f('0x2f')](_0x44da29[_0x146f('0x2e')]);_0x40f2e3['filters']=_[_0x146f('0x30')](_0x40f2e3[_0x146f('0x2d')],_0x40f2e3[_0x146f('0x2e')]);_0x171367[_0x146f('0x31')]=_[_0x146f('0x30')](_0x40f2e3['model'],qs[_0x146f('0x32')](_0x44da29[_0x146f('0x2e')][_0x146f('0x32')]));_0x171367[_0x146f('0x31')]=_0x171367[_0x146f('0x31')]['length']?_0x171367['attributes']:_0x40f2e3['model'];if(!_0x44da29['query'][_0x146f('0x33')](_0x146f('0x34'))){_0x171367[_0x146f('0x20')]=qs['limit'](_0x44da29[_0x146f('0x2e')][_0x146f('0x20')]);_0x171367[_0x146f('0x1f')]=qs[_0x146f('0x1f')](_0x44da29[_0x146f('0x2e')][_0x146f('0x1f')]);}_0x171367['order']=qs['sort'](_0x44da29[_0x146f('0x2e')][_0x146f('0x35')]);_0x171367[_0x146f('0x36')]=qs[_0x146f('0x37')](_['pick'](_0x44da29[_0x146f('0x2e')],_0x40f2e3[_0x146f('0x37')]));if(_0x44da29[_0x146f('0x2e')]['filter']){_0x171367[_0x146f('0x36')]=_[_0x146f('0x38')](_0x171367['where'],{'$or':_['map'](_0x4bf655,function(_0x541034){if(_0x541034[_0x146f('0x39')][_0x146f('0x3a')]!==_0x146f('0x3b')){var _0x33d784={};_0x33d784[_0x541034[_0x146f('0x3c')]]={'$like':'%'+_0x44da29[_0x146f('0x2e')][_0x146f('0x3d')]+'%'};return _0x33d784;}})});}_0x171367=_[_0x146f('0x38')]({},_0x171367,_0x44da29[_0x146f('0x3e')]);var _0x5f502d={'where':_0x171367[_0x146f('0x36')]};return db[_0x146f('0x3f')]['count'](_0x5f502d)[_0x146f('0x27')](function(_0x3acda6){_0x1cbdec[_0x146f('0x1e')]=_0x3acda6;if(_0x44da29['query'][_0x146f('0x40')]){_0x171367[_0x146f('0x41')]=[{'all':!![]}];}return db[_0x146f('0x3f')][_0x146f('0x42')](_0x171367);})[_0x146f('0x27')](function(_0x33a680){_0x1cbdec[_0x146f('0x43')]=_0x33a680;return _0x1cbdec;})['then'](respondWithFilteredResult(_0xdba92e,_0x171367))[_0x146f('0x44')](handleError(_0xdba92e,null));};exports['show']=function(_0x37b525,_0x5b6cd0){var _0x524b86={'raw':!![],'where':{'id':_0x37b525[_0x146f('0x45')]['id']}},_0x4fcd96={};_0x4fcd96[_0x146f('0x2d')]=_[_0x146f('0x2f')](db['SmsTransferReport']['rawAttributes']);_0x4fcd96[_0x146f('0x2e')]=_[_0x146f('0x2f')](_0x37b525[_0x146f('0x2e')]);_0x4fcd96['filters']=_['intersection'](_0x4fcd96['model'],_0x4fcd96[_0x146f('0x2e')]);_0x524b86[_0x146f('0x31')]=_[_0x146f('0x30')](_0x4fcd96[_0x146f('0x2d')],qs[_0x146f('0x32')](_0x37b525['query']['fields']));_0x524b86[_0x146f('0x31')]=_0x524b86['attributes'][_0x146f('0x46')]?_0x524b86[_0x146f('0x31')]:_0x4fcd96[_0x146f('0x2d')];if(_0x37b525[_0x146f('0x2e')][_0x146f('0x40')]){_0x524b86[_0x146f('0x41')]=[{'all':!![]}];}_0x524b86=_[_0x146f('0x38')]({},_0x524b86,_0x37b525[_0x146f('0x3e')]);return db[_0x146f('0x3f')][_0x146f('0x47')](_0x524b86)[_0x146f('0x27')](handleEntityNotFound(_0x5b6cd0,null))[_0x146f('0x27')](respondWithResult(_0x5b6cd0,null))[_0x146f('0x44')](handleError(_0x5b6cd0,null));};exports['create']=function(_0x4f00cb,_0x4633aa){return db[_0x146f('0x3f')][_0x146f('0x48')](_0x4f00cb[_0x146f('0x49')],{})[_0x146f('0x27')](respondWithResult(_0x4633aa,0xc9))['catch'](handleError(_0x4633aa,null));};exports[_0x146f('0x26')]=function(_0x206b1b,_0x176400){if(_0x206b1b[_0x146f('0x49')]['id']){delete _0x206b1b[_0x146f('0x49')]['id'];}return db[_0x146f('0x3f')][_0x146f('0x47')]({'where':{'id':_0x206b1b['params']['id']}})[_0x146f('0x27')](handleEntityNotFound(_0x176400,null))[_0x146f('0x27')](saveUpdates(_0x206b1b['body'],null))['then'](respondWithResult(_0x176400,null))[_0x146f('0x44')](handleError(_0x176400,null));};exports[_0x146f('0x28')]=function(_0x19db67,_0x156900){return db[_0x146f('0x3f')][_0x146f('0x47')]({'where':{'id':_0x19db67[_0x146f('0x45')]['id']}})[_0x146f('0x27')](handleEntityNotFound(_0x156900,null))[_0x146f('0x27')](removeEntity(_0x156900,null))[_0x146f('0x44')](handleError(_0x156900,null));};exports[_0x146f('0x4a')]=function(_0x181180,_0x5ba60f){return db[_0x146f('0x3f')][_0x146f('0x4a')]()['then'](respondWithResult(_0x5ba60f,null))[_0x146f('0x44')](handleError(_0x5ba60f,null));};
\ No newline at end of file
+var _0x48fa=['VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','options','find','create','body','eml-format','fast-json-patch','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SmsTransferReport','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key'];(function(_0x2fd88e,_0x295524){var _0x52a474=function(_0x3528b1){while(--_0x3528b1){_0x2fd88e['push'](_0x2fd88e['shift']());}};_0x52a474(++_0x295524);}(_0x48fa,0x1b2));var _0xa48f=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x48fa[_0x1beef3];return _0x5af964;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa48f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa48f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa48f('0x2'));var Mustache=require('mustache');var util=require(_0xa48f('0x3'));var path=require('path');var sox=require(_0xa48f('0x4'));var csv=require(_0xa48f('0x5'));var ejs=require(_0xa48f('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa48f('0x7'));var crypto=require(_0xa48f('0x8'));var jsforce=require(_0xa48f('0x9'));var deskjs=require(_0xa48f('0xa'));var toCsv=require(_0xa48f('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa48f('0xb'));var authService=require(_0xa48f('0xc'));var qs=require(_0xa48f('0xd'));var hardwareService=require(_0xa48f('0xe'));var logger=require(_0xa48f('0xf'))(_0xa48f('0x10'));var utils=require(_0xa48f('0x11'));var config=require(_0xa48f('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x587283,_0x4063d0){_0x4063d0=_0x4063d0||0xcc;return function(_0x1e482c){if(_0x1e482c){return _0x587283[_0xa48f('0x13')](_0x4063d0);}return _0x587283[_0xa48f('0x14')](_0x4063d0)[_0xa48f('0x15')]();};}function respondWithResult(_0x12a33d,_0x4c664c){_0x4c664c=_0x4c664c||0xc8;return function(_0x5c8274){if(_0x5c8274){return _0x12a33d['status'](_0x4c664c)[_0xa48f('0x16')](_0x5c8274);}};}function respondWithFilteredResult(_0x58505c,_0x3b965b){return function(_0x3da8c7){if(_0x3da8c7){var _0x833f44=_0x3da8c7[_0xa48f('0x17')],_0x1506c8=_0x3b965b[_0xa48f('0x18')],_0x3a5d38=_0x3b965b[_0xa48f('0x18')]+_0x3b965b[_0xa48f('0x19')],_0x446292;if(_0x3a5d38>=_0x833f44){_0x3a5d38=_0x833f44;_0x446292=0xc8;}else{_0x446292=0xce;}_0x58505c[_0xa48f('0x14')](_0x446292);return _0x58505c['set'](_0xa48f('0x1a'),_0x1506c8+'-'+_0x3a5d38+'/'+_0x833f44)[_0xa48f('0x16')](_0x3da8c7);}return null;};}function patchUpdates(_0x344dce){return function(_0x454361){try{jsonpatch[_0xa48f('0x1b')](_0x454361,_0x344dce,!![]);}catch(_0x4e1957){return BPromise[_0xa48f('0x1c')](_0x4e1957);}return _0x454361[_0xa48f('0x1d')]();};}function saveUpdates(_0x148ebc,_0x108e93){return function(_0x38779a){if(_0x38779a){return _0x38779a[_0xa48f('0x1e')](_0x148ebc)[_0xa48f('0x1f')](function(_0x146a4b){return _0x146a4b;});}return null;};}function removeEntity(_0x586be0,_0x222712){return function(_0x2a736f){if(_0x2a736f){return _0x2a736f[_0xa48f('0x20')]()[_0xa48f('0x1f')](function(){_0x586be0[_0xa48f('0x14')](0xcc)[_0xa48f('0x15')]();});}};}function handleEntityNotFound(_0x4b6fb2,_0x32041a){return function(_0x293dc8){if(!_0x293dc8){_0x4b6fb2[_0xa48f('0x13')](0x194);}return _0x293dc8;};}function handleError(_0xcc6f06,_0x32eb98){_0x32eb98=_0x32eb98||0x1f4;return function(_0x1036db){logger[_0xa48f('0x21')](_0x1036db[_0xa48f('0x22')]);if(_0x1036db[_0xa48f('0x23')]){delete _0x1036db['name'];}_0xcc6f06[_0xa48f('0x14')](_0x32eb98)[_0xa48f('0x24')](_0x1036db);};}exports[_0xa48f('0x25')]=function(_0x37f9cf,_0x2b56ba){var _0x55187f={},_0xdb6bac={},_0x45f98c={'count':0x0,'rows':[]};var _0x3df8f9=db[_0xa48f('0x26')]['rawAttributes'];_0xdb6bac[_0xa48f('0x27')]=_[_0xa48f('0x28')](_0x3df8f9);_0xdb6bac['query']=_[_0xa48f('0x28')](_0x37f9cf[_0xa48f('0x29')]);_0xdb6bac[_0xa48f('0x2a')]=_[_0xa48f('0x2b')](_0xdb6bac[_0xa48f('0x27')],_0xdb6bac[_0xa48f('0x29')]);_0x55187f[_0xa48f('0x2c')]=_[_0xa48f('0x2b')](_0xdb6bac['model'],qs['fields'](_0x37f9cf[_0xa48f('0x29')]['fields']));_0x55187f[_0xa48f('0x2c')]=_0x55187f[_0xa48f('0x2c')][_0xa48f('0x2d')]?_0x55187f[_0xa48f('0x2c')]:_0xdb6bac[_0xa48f('0x27')];if(!_0x37f9cf[_0xa48f('0x29')][_0xa48f('0x2e')](_0xa48f('0x2f'))){_0x55187f[_0xa48f('0x19')]=qs[_0xa48f('0x19')](_0x37f9cf[_0xa48f('0x29')][_0xa48f('0x19')]);_0x55187f[_0xa48f('0x18')]=qs[_0xa48f('0x18')](_0x37f9cf[_0xa48f('0x29')]['offset']);}_0x55187f['order']=qs[_0xa48f('0x30')](_0x37f9cf['query'][_0xa48f('0x30')]);_0x55187f[_0xa48f('0x31')]=qs[_0xa48f('0x2a')](_[_0xa48f('0x32')](_0x37f9cf[_0xa48f('0x29')],_0xdb6bac[_0xa48f('0x2a')]));if(_0x37f9cf[_0xa48f('0x29')][_0xa48f('0x33')]){_0x55187f[_0xa48f('0x31')]=_[_0xa48f('0x34')](_0x55187f[_0xa48f('0x31')],{'$or':_[_0xa48f('0x35')](_0x3df8f9,function(_0x33da9b){if(_0x33da9b[_0xa48f('0x36')][_0xa48f('0x37')]!==_0xa48f('0x38')){var _0xb7dc02={};_0xb7dc02[_0x33da9b['field']]={'$like':'%'+_0x37f9cf['query'][_0xa48f('0x33')]+'%'};return _0xb7dc02;}})});}_0x55187f=_[_0xa48f('0x34')]({},_0x55187f,_0x37f9cf['options']);var _0x108cca={'where':_0x55187f[_0xa48f('0x31')]};return db[_0xa48f('0x26')][_0xa48f('0x17')](_0x108cca)[_0xa48f('0x1f')](function(_0x5d9cf9){_0x45f98c[_0xa48f('0x17')]=_0x5d9cf9;if(_0x37f9cf['query'][_0xa48f('0x39')]){_0x55187f[_0xa48f('0x3a')]=[{'all':!![]}];}return db[_0xa48f('0x26')][_0xa48f('0x3b')](_0x55187f);})[_0xa48f('0x1f')](function(_0x388e51){_0x45f98c[_0xa48f('0x3c')]=_0x388e51;return _0x45f98c;})['then'](respondWithFilteredResult(_0x2b56ba,_0x55187f))[_0xa48f('0x3d')](handleError(_0x2b56ba,null));};exports[_0xa48f('0x3e')]=function(_0x1ce466,_0x12fdbf){var _0x361db0={'raw':!![],'where':{'id':_0x1ce466[_0xa48f('0x3f')]['id']}},_0x16c2a0={};_0x16c2a0['model']=_[_0xa48f('0x28')](db[_0xa48f('0x26')][_0xa48f('0x40')]);_0x16c2a0[_0xa48f('0x29')]=_[_0xa48f('0x28')](_0x1ce466[_0xa48f('0x29')]);_0x16c2a0[_0xa48f('0x2a')]=_['intersection'](_0x16c2a0[_0xa48f('0x27')],_0x16c2a0['query']);_0x361db0[_0xa48f('0x2c')]=_[_0xa48f('0x2b')](_0x16c2a0[_0xa48f('0x27')],qs['fields'](_0x1ce466[_0xa48f('0x29')][_0xa48f('0x41')]));_0x361db0['attributes']=_0x361db0[_0xa48f('0x2c')][_0xa48f('0x2d')]?_0x361db0[_0xa48f('0x2c')]:_0x16c2a0[_0xa48f('0x27')];if(_0x1ce466[_0xa48f('0x29')][_0xa48f('0x39')]){_0x361db0[_0xa48f('0x3a')]=[{'all':!![]}];}_0x361db0=_[_0xa48f('0x34')]({},_0x361db0,_0x1ce466[_0xa48f('0x42')]);return db[_0xa48f('0x26')][_0xa48f('0x43')](_0x361db0)['then'](handleEntityNotFound(_0x12fdbf,null))['then'](respondWithResult(_0x12fdbf,null))[_0xa48f('0x3d')](handleError(_0x12fdbf,null));};exports[_0xa48f('0x44')]=function(_0x5b4084,_0x4fe629){return db[_0xa48f('0x26')][_0xa48f('0x44')](_0x5b4084[_0xa48f('0x45')],{})[_0xa48f('0x1f')](respondWithResult(_0x4fe629,0xc9))[_0xa48f('0x3d')](handleError(_0x4fe629,null));};exports['update']=function(_0xd677cf,_0x3ef1f9){if(_0xd677cf[_0xa48f('0x45')]['id']){delete _0xd677cf['body']['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0xd677cf[_0xa48f('0x3f')]['id']}})[_0xa48f('0x1f')](handleEntityNotFound(_0x3ef1f9,null))['then'](saveUpdates(_0xd677cf['body'],null))[_0xa48f('0x1f')](respondWithResult(_0x3ef1f9,null))[_0xa48f('0x3d')](handleError(_0x3ef1f9,null));};exports[_0xa48f('0x20')]=function(_0x5d64c8,_0x2529b2){return db[_0xa48f('0x26')][_0xa48f('0x43')]({'where':{'id':_0x5d64c8[_0xa48f('0x3f')]['id']}})[_0xa48f('0x1f')](handleEntityNotFound(_0x2529b2,null))[_0xa48f('0x1f')](removeEntity(_0x2529b2,null))['catch'](handleError(_0x2529b2,null));};exports['describe']=function(_0xfb9d03,_0x3075c2){return db[_0xa48f('0x26')]['describe']()['then'](respondWithResult(_0x3075c2,null))['catch'](handleError(_0x3075c2,null));};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js
index 4a0c856..9b83a7c 100644
--- a/server/api/smsTransferReport/smsTransferReport.model.js
+++ b/server/api/smsTransferReport/smsTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x409c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x5e4d7a,_0x474456){var _0x446c84=function(_0x254e70){while(--_0x254e70){_0x5e4d7a['push'](_0x5e4d7a['shift']());}};_0x446c84(++_0x474456);}(_0x409c,0x1df));var _0xc409=function(_0x27edfd,_0x10ef8f){_0x27edfd=_0x27edfd-0x0;var _0x17741b=_0x409c[_0x27edfd];return _0x17741b;};'use strict';var _=require(_0xc409('0x0'));var util=require(_0xc409('0x1'));var logger=require(_0xc409('0x2'))(_0xc409('0x3'));var moment=require(_0xc409('0x4'));var BPromise=require(_0xc409('0x5'));var rp=require(_0xc409('0x6'));var fs=require('fs');var path=require(_0xc409('0x7'));var rimraf=require(_0xc409('0x8'));var config=require(_0xc409('0x9'));var attributes=require(_0xc409('0xa'));module['exports']=function(_0x460a02,_0x15edbe){return _0x460a02[_0xc409('0xb')](_0xc409('0xc'),attributes,{'tableName':_0xc409('0xd'),'paranoid':![],'indexes':[{'name':_0xc409('0xe'),'fields':[_0xc409('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6776=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer'];(function(_0x3c82e2,_0x2bff81){var _0x1317b8=function(_0x23694b){while(--_0x23694b){_0x3c82e2['push'](_0x3c82e2['shift']());}};_0x1317b8(++_0x2bff81);}(_0x6776,0x197));var _0x6677=function(_0x5f1964,_0x527e61){_0x5f1964=_0x5f1964-0x0;var _0x328f07=_0x6776[_0x5f1964];return _0x328f07;};'use strict';var _=require('lodash');var util=require(_0x6677('0x0'));var logger=require(_0x6677('0x1'))(_0x6677('0x2'));var moment=require(_0x6677('0x3'));var BPromise=require(_0x6677('0x4'));var rp=require(_0x6677('0x5'));var fs=require('fs');var path=require(_0x6677('0x6'));var rimraf=require(_0x6677('0x7'));var config=require(_0x6677('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0x6677('0x9')]=function(_0x1cc698,_0x318c3e){return _0x1cc698[_0x6677('0xa')](_0x6677('0xb'),attributes,{'tableName':_0x6677('0xc'),'paranoid':![],'indexes':[{'name':_0x6677('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js
index a0d1901..abf2624 100644
--- a/server/api/smsTransferReport/smsTransferReport.rpc.js
+++ b/server/api/smsTransferReport/smsTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b0d=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','util'];(function(_0x3bb859,_0x589816){var _0x3bf534=function(_0xa586c){while(--_0xa586c){_0x3bb859['push'](_0x3bb859['shift']());}};_0x3bf534(++_0x589816);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x273f73,_0x1f54ef){_0x273f73=_0x273f73-0x0;var _0xd9181=_0x9b0d[_0x273f73];return _0xd9181;};'use strict';var _=require('lodash');var util=require(_0xd9b0('0x0'));var moment=require(_0xd9b0('0x1'));var BPromise=require(_0xd9b0('0x2'));var rs=require(_0xd9b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9b0('0x4'))['db'];var utils=require(_0xd9b0('0x5'));var logger=require(_0xd9b0('0x6'))(_0xd9b0('0x7'));var config=require('../../config/environment');var jayson=require(_0xd9b0('0x8'));var client=jayson[_0xd9b0('0x9')][_0xd9b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31c012,_0x58bd64,_0x384d09){return new BPromise(function(_0x33f402,_0x510adc){return client[_0xd9b0('0xb')](_0x31c012,_0x384d09)[_0xd9b0('0xc')](function(_0x48181a){logger[_0xd9b0('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x58bd64,_0xd9b0('0xe'));logger['debug'](_0xd9b0('0xf'),_0x58bd64,_0xd9b0('0xe'),JSON[_0xd9b0('0x10')](_0x48181a));if(_0x48181a[_0xd9b0('0x11')]){if(_0x48181a[_0xd9b0('0x11')][_0xd9b0('0x12')]===0x1f4){logger['error'](_0xd9b0('0x13'),_0x58bd64,_0x48181a[_0xd9b0('0x11')]['message']);return _0x510adc(_0x48181a[_0xd9b0('0x11')][_0xd9b0('0x14')]);}logger[_0xd9b0('0x11')](_0xd9b0('0x13'),_0x58bd64,_0x48181a[_0xd9b0('0x11')][_0xd9b0('0x14')]);return _0x33f402(_0x48181a['error'][_0xd9b0('0x14')]);}else{logger['info'](_0xd9b0('0x13'),_0x58bd64,_0xd9b0('0xe'));_0x33f402(_0x48181a[_0xd9b0('0x15')][_0xd9b0('0x14')]);}})[_0xd9b0('0x16')](function(_0x3e7547){logger[_0xd9b0('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x58bd64,_0x3e7547);_0x510adc(_0x3e7547);});});}
\ No newline at end of file
+var _0xa5c9=['util','moment','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash'];(function(_0xd7faf8,_0x434693){var _0x5ba80b=function(_0xa48c96){while(--_0xa48c96){_0xd7faf8['push'](_0xd7faf8['shift']());}};_0x5ba80b(++_0x434693);}(_0xa5c9,0x143));var _0x9a5c=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0xa5c9[_0x4c6d6f];return _0x2d4478;};'use strict';var _=require(_0x9a5c('0x0'));var util=require(_0x9a5c('0x1'));var moment=require(_0x9a5c('0x2'));var BPromise=require(_0x9a5c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a5c('0x4'))['db'];var utils=require(_0x9a5c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9a5c('0x6'));var client=jayson[_0x9a5c('0x7')][_0x9a5c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3bb6f2,_0x594e67,_0x8de4e9){return new BPromise(function(_0x4ea491,_0xc96c1c){return client[_0x9a5c('0x9')](_0x3bb6f2,_0x8de4e9)['then'](function(_0x127932){logger[_0x9a5c('0xa')](_0x9a5c('0xb'),_0x594e67,'request\x20sent');logger['debug'](_0x9a5c('0xc'),_0x594e67,_0x9a5c('0xd'),JSON[_0x9a5c('0xe')](_0x127932));if(_0x127932[_0x9a5c('0xf')]){if(_0x127932[_0x9a5c('0xf')][_0x9a5c('0x10')]===0x1f4){logger[_0x9a5c('0xf')](_0x9a5c('0xb'),_0x594e67,_0x127932[_0x9a5c('0xf')][_0x9a5c('0x11')]);return _0xc96c1c(_0x127932[_0x9a5c('0xf')][_0x9a5c('0x11')]);}logger['error'](_0x9a5c('0xb'),_0x594e67,_0x127932[_0x9a5c('0xf')][_0x9a5c('0x11')]);return _0x4ea491(_0x127932['error'][_0x9a5c('0x11')]);}else{logger[_0x9a5c('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x594e67,_0x9a5c('0xd'));_0x4ea491(_0x127932['result'][_0x9a5c('0x11')]);}})['catch'](function(_0x29d3cd){logger[_0x9a5c('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x594e67,_0x29d3cd);_0xc96c1c(_0x29d3cd);});});}
\ No newline at end of file
diff --git a/server/api/sound/index.js b/server/api/sound/index.js
index 01d8cae..360cabd 100644
--- a/server/api/sound/index.js
+++ b/server/api/sound/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe1d5=['../../config/environment','./sound.controller','isAuthenticated','/:id','show','get','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xfc2420,_0x149f71){var _0x59db5b=function(_0x3dcfa0){while(--_0x3dcfa0){_0xfc2420['push'](_0xfc2420['shift']());}};_0x59db5b(++_0x149f71);}(_0xe1d5,0xd9));var _0x5e1d=function(_0x5d8884,_0x39205b){_0x5d8884=_0x5d8884-0x0;var _0x36cd24=_0xe1d5[_0x5d8884];return _0x36cd24;};'use strict';var multer=require(_0x5e1d('0x0'));var util=require(_0x5e1d('0x1'));var path=require('path');var timeout=require(_0x5e1d('0x2'));var express=require(_0x5e1d('0x3'));var router=express[_0x5e1d('0x4')]();var auth=require(_0x5e1d('0x5'));var interaction=require(_0x5e1d('0x6'));var config=require(_0x5e1d('0x7'));var controller=require(_0x5e1d('0x8'));router['get']('/',auth[_0x5e1d('0x9')](),controller['index']);router['get'](_0x5e1d('0xa'),auth['isAuthenticated'](),controller[_0x5e1d('0xb')]);router[_0x5e1d('0xc')](_0x5e1d('0xd'),auth[_0x5e1d('0x9')](),controller[_0x5e1d('0xe')]);var upload=multer({'storage':multer[_0x5e1d('0xf')]({'destination':function(_0x50b2ed,_0x2af64a,_0x1bac72){_0x1bac72(null,path[_0x5e1d('0x10')](config[_0x5e1d('0x11')],_0x5e1d('0x12')));},'filename':function(_0x1edb72,_0x29a448,_0x451cfc){_0x29a448[_0x5e1d('0x13')]=_0x29a448['originalname'][_0x5e1d('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x451cfc(null,util['format'](_0x5e1d('0x15'),path[_0x5e1d('0x16')](_0x29a448[_0x5e1d('0x13')],path[_0x5e1d('0x17')](_0x29a448['originalname'])),Date[_0x5e1d('0x18')](),path[_0x5e1d('0x17')](_0x29a448[_0x5e1d('0x13')])));}})});router[_0x5e1d('0x19')]('/',upload[_0x5e1d('0x1a')](_0x5e1d('0x1b')),controller[_0x5e1d('0x1c')]);router[_0x5e1d('0x1d')]('/:id',auth[_0x5e1d('0x9')](),controller[_0x5e1d('0x1e')]);router[_0x5e1d('0x1f')](_0x5e1d('0xa'),auth['isAuthenticated'](),controller[_0x5e1d('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0x0b64=['format','%s-%s%s','basename','now','extname','post','file','put','update','delete','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace'];(function(_0x5a5e8a,_0x1d5c2f){var _0x49a1c2=function(_0x46e880){while(--_0x46e880){_0x5a5e8a['push'](_0x5a5e8a['shift']());}};_0x49a1c2(++_0x1d5c2f);}(_0x0b64,0x68));var _0x40b6=function(_0x43d04f,_0x3e5287){_0x43d04f=_0x43d04f-0x0;var _0x5213e2=_0x0b64[_0x43d04f];return _0x5213e2;};'use strict';var multer=require(_0x40b6('0x0'));var util=require('util');var path=require(_0x40b6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x40b6('0x2')]();var auth=require(_0x40b6('0x3'));var interaction=require(_0x40b6('0x4'));var config=require(_0x40b6('0x5'));var controller=require(_0x40b6('0x6'));router[_0x40b6('0x7')]('/',auth['isAuthenticated'](),controller[_0x40b6('0x8')]);router[_0x40b6('0x7')](_0x40b6('0x9'),auth[_0x40b6('0xa')](),controller[_0x40b6('0xb')]);router[_0x40b6('0x7')](_0x40b6('0xc'),auth[_0x40b6('0xa')](),controller[_0x40b6('0xd')]);var upload=multer({'storage':multer[_0x40b6('0xe')]({'destination':function(_0x3e9b55,_0x1923aa,_0x262e45){_0x262e45(null,path[_0x40b6('0xf')](config[_0x40b6('0x10')],_0x40b6('0x11')));},'filename':function(_0x93b376,_0x4d31b3,_0x42d4f4){_0x4d31b3[_0x40b6('0x12')]=_0x4d31b3[_0x40b6('0x12')][_0x40b6('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x42d4f4(null,util[_0x40b6('0x14')](_0x40b6('0x15'),path[_0x40b6('0x16')](_0x4d31b3[_0x40b6('0x12')],path['extname'](_0x4d31b3[_0x40b6('0x12')])),Date[_0x40b6('0x17')](),path[_0x40b6('0x18')](_0x4d31b3[_0x40b6('0x12')])));}})});router[_0x40b6('0x19')]('/',upload['single'](_0x40b6('0x1a')),controller['create']);router[_0x40b6('0x1b')](_0x40b6('0x9'),auth['isAuthenticated'](),controller[_0x40b6('0x1c')]);router[_0x40b6('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x40b6('0x1d')]);module[_0x40b6('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js
index 1fb0b84..94b245c 100644
--- a/server/api/sound/sound.attributes.js
+++ b/server/api/sound/sound.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe72d=['FLOAT','INTEGER','BIGINT','sequelize','STRING','name'];(function(_0x87d93b,_0x5225e9){var _0x1c0f01=function(_0x28d911){while(--_0x28d911){_0x87d93b['push'](_0x87d93b['shift']());}};_0x1c0f01(++_0x5225e9);}(_0xe72d,0x129));var _0xde72=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xe72d[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0xde72('0x0'));module['exports']={'name':{'type':Sequelize[_0xde72('0x1')],'unique':_0xde72('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xde72('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xde72('0x1')]},'original_format':{'type':Sequelize[_0xde72('0x1')]},'original_duration':{'type':Sequelize[_0xde72('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xde72('0x4')]},'original_bitRate':{'type':Sequelize[_0xde72('0x5')]},'original_sampleRate':{'type':Sequelize[_0xde72('0x4')]},'converted_format':{'type':Sequelize[_0xde72('0x1')]},'converted_duration':{'type':Sequelize[_0xde72('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xde72('0x5')]},'converted_channelCount':{'type':Sequelize[_0xde72('0x4')]},'converted_bitRate':{'type':Sequelize[_0xde72('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xde72('0x4')]}};
\ No newline at end of file
+var _0x8e03=['INTEGER','sequelize','STRING','name','FLOAT','BIGINT'];(function(_0x3e9a70,_0x4532f7){var _0xa6223e=function(_0x57a0f2){while(--_0x57a0f2){_0x3e9a70['push'](_0x3e9a70['shift']());}};_0xa6223e(++_0x4532f7);}(_0x8e03,0x187));var _0x38e0=function(_0x2f291b,_0x35fb97){_0x2f291b=_0x2f291b-0x0;var _0x4f6b96=_0x8e03[_0x2f291b];return _0x4f6b96;};'use strict';var Sequelize=require(_0x38e0('0x0'));module['exports']={'name':{'type':Sequelize[_0x38e0('0x1')],'unique':_0x38e0('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x38e0('0x1')]},'display_name':{'type':Sequelize[_0x38e0('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x38e0('0x1')]},'original_duration':{'type':Sequelize[_0x38e0('0x3')]},'original_sampleCount':{'type':Sequelize[_0x38e0('0x4')]},'original_channelCount':{'type':Sequelize[_0x38e0('0x5')]},'original_bitRate':{'type':Sequelize[_0x38e0('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x38e0('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x38e0('0x5')]}};
\ No newline at end of file
diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js
index f207e5e..98efbd0 100644
--- a/server/api/sound/sound.controller.js
+++ b/server/api/sound/sound.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf486=['save_name','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','format','converted_format','%s.%s','file','originalname','basename','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','UserProfileResource','delete','original_format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','limit','set','save','then','destroy','Sounds','sendStatus','error','stack','name','send','index','Sound','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','field','options','count','include','findAll','rows','catch','show','params','keys','download','find'];(function(_0x442ffd,_0x13ce65){var _0x1264d2=function(_0x2b5ea0){while(--_0x2b5ea0){_0x442ffd['push'](_0x442ffd['shift']());}};_0x1264d2(++_0x13ce65);}(_0xf486,0x19d));var _0x6f48=function(_0x33829d,_0x184f9e){_0x33829d=_0x33829d-0x0;var _0x72b35d=_0xf486[_0x33829d];return _0x72b35d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6f48('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f48('0x1'));var rp=require(_0x6f48('0x2'));var moment=require(_0x6f48('0x3'));var BPromise=require(_0x6f48('0x4'));var Mustache=require(_0x6f48('0x5'));var util=require(_0x6f48('0x6'));var path=require(_0x6f48('0x7'));var sox=require(_0x6f48('0x8'));var csv=require(_0x6f48('0x9'));var ejs=require(_0x6f48('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6f48('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f48('0xc'));var deskjs=require(_0x6f48('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6f48('0xe'));var Papa=require(_0x6f48('0xf'));var Redis=require('ioredis');var authService=require(_0x6f48('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6f48('0x11'));var logger=require(_0x6f48('0x12'))(_0x6f48('0x13'));var utils=require('../../config/utils');var config=require(_0x6f48('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x551f9f,_0x34c2b0){_0x34c2b0=_0x34c2b0||0xcc;return function(_0x4ff494){if(_0x4ff494){return _0x551f9f['sendStatus'](_0x34c2b0);}return _0x551f9f[_0x6f48('0x15')](_0x34c2b0)[_0x6f48('0x16')]();};}function respondWithResult(_0x528d4c,_0x3ab0a3){_0x3ab0a3=_0x3ab0a3||0xc8;return function(_0x54c81a){if(_0x54c81a){return _0x528d4c['status'](_0x3ab0a3)[_0x6f48('0x17')](_0x54c81a);}};}function respondWithFilteredResult(_0x25ed41,_0x300259){return function(_0x530e83){if(_0x530e83){var _0xe283e5=_0x530e83['count'],_0x56af75=_0x300259[_0x6f48('0x18')],_0x1a9987=_0x300259['offset']+_0x300259[_0x6f48('0x19')],_0x2d0816;if(_0x1a9987>=_0xe283e5){_0x1a9987=_0xe283e5;_0x2d0816=0xc8;}else{_0x2d0816=0xce;}_0x25ed41[_0x6f48('0x15')](_0x2d0816);return _0x25ed41[_0x6f48('0x1a')]('Content-Range',_0x56af75+'-'+_0x1a9987+'/'+_0xe283e5)[_0x6f48('0x17')](_0x530e83);}return null;};}function patchUpdates(_0x36c53b){return function(_0x1476eb){try{jsonpatch['apply'](_0x1476eb,_0x36c53b,!![]);}catch(_0x4833c0){return BPromise['reject'](_0x4833c0);}return _0x1476eb[_0x6f48('0x1b')]();};}function saveUpdates(_0x35d0da,_0x52fe54){return function(_0x36c847){if(_0x36c847){return _0x36c847['update'](_0x35d0da)[_0x6f48('0x1c')](function(_0x5e8323){return _0x5e8323;});}return null;};}function removeEntity(_0x77b9bc,_0x47e09c){return function(_0x5a0945){if(_0x5a0945){return _0x5a0945[_0x6f48('0x1d')]()[_0x6f48('0x1c')](function(){var _0x31fbbe=_0x5a0945['get']({'plain':!![]});var _0x202eec=_0x6f48('0x1e');return db['UserProfileResource'][_0x6f48('0x1d')]({'where':{'type':_0x202eec,'resourceId':_0x31fbbe['id']}})[_0x6f48('0x1c')](function(){return _0x5a0945;});})[_0x6f48('0x1c')](function(){_0x77b9bc[_0x6f48('0x15')](0xcc)[_0x6f48('0x16')]();});}};}function handleEntityNotFound(_0x1fcab0,_0x45ed2b){return function(_0x38e31d){if(!_0x38e31d){_0x1fcab0[_0x6f48('0x1f')](0x194);}return _0x38e31d;};}function handleError(_0x518cf2,_0x126848){_0x126848=_0x126848||0x1f4;return function(_0x2e788b){logger[_0x6f48('0x20')](_0x2e788b[_0x6f48('0x21')]);if(_0x2e788b[_0x6f48('0x22')]){delete _0x2e788b[_0x6f48('0x22')];}_0x518cf2[_0x6f48('0x15')](_0x126848)[_0x6f48('0x23')](_0x2e788b);};}exports[_0x6f48('0x24')]=function(_0x696bfb,_0xf4d652){var _0x30414e={},_0x2f7393={},_0x1741f4={'count':0x0,'rows':[]};var _0x1c6a32=db[_0x6f48('0x25')][_0x6f48('0x26')];_0x2f7393[_0x6f48('0x27')]=_['keys'](_0x1c6a32);_0x2f7393['query']=_['keys'](_0x696bfb[_0x6f48('0x28')]);_0x2f7393[_0x6f48('0x29')]=_[_0x6f48('0x2a')](_0x2f7393[_0x6f48('0x27')],_0x2f7393[_0x6f48('0x28')]);_0x30414e[_0x6f48('0x2b')]=_[_0x6f48('0x2a')](_0x2f7393['model'],qs[_0x6f48('0x2c')](_0x696bfb[_0x6f48('0x28')][_0x6f48('0x2c')]));_0x30414e['attributes']=_0x30414e[_0x6f48('0x2b')][_0x6f48('0x2d')]?_0x30414e[_0x6f48('0x2b')]:_0x2f7393['model'];if(!_0x696bfb[_0x6f48('0x28')]['hasOwnProperty'](_0x6f48('0x2e'))){_0x30414e[_0x6f48('0x19')]=qs['limit'](_0x696bfb[_0x6f48('0x28')][_0x6f48('0x19')]);_0x30414e[_0x6f48('0x18')]=qs[_0x6f48('0x18')](_0x696bfb[_0x6f48('0x28')]['offset']);}_0x30414e[_0x6f48('0x2f')]=qs[_0x6f48('0x30')](_0x696bfb[_0x6f48('0x28')][_0x6f48('0x30')]);_0x30414e[_0x6f48('0x31')]=qs['filters'](_[_0x6f48('0x32')](_0x696bfb['query'],_0x2f7393[_0x6f48('0x29')]));if(_0x696bfb[_0x6f48('0x28')][_0x6f48('0x33')]){_0x30414e[_0x6f48('0x31')]=_[_0x6f48('0x34')](_0x30414e[_0x6f48('0x31')],{'$or':_[_0x6f48('0x35')](_0x1c6a32,function(_0x294b21){if(_0x294b21[_0x6f48('0x36')]['key']!=='VIRTUAL'){var _0x4622c6={};_0x4622c6[_0x294b21[_0x6f48('0x37')]]={'$like':'%'+_0x696bfb[_0x6f48('0x28')][_0x6f48('0x33')]+'%'};return _0x4622c6;}})});}_0x30414e=_[_0x6f48('0x34')]({},_0x30414e,_0x696bfb[_0x6f48('0x38')]);var _0x25d528={'where':_0x30414e[_0x6f48('0x31')]};return db[_0x6f48('0x25')][_0x6f48('0x39')](_0x25d528)[_0x6f48('0x1c')](function(_0x3877a6){_0x1741f4[_0x6f48('0x39')]=_0x3877a6;if(_0x696bfb[_0x6f48('0x28')]['includeAll']){_0x30414e[_0x6f48('0x3a')]=[{'all':!![]}];}return db[_0x6f48('0x25')][_0x6f48('0x3b')](_0x30414e);})['then'](function(_0x59f9ad){_0x1741f4[_0x6f48('0x3c')]=_0x59f9ad;return _0x1741f4;})['then'](respondWithFilteredResult(_0xf4d652,_0x30414e))[_0x6f48('0x3d')](handleError(_0xf4d652,null));};exports[_0x6f48('0x3e')]=function(_0x5ca755,_0x2fca2f){var _0x377b2b={'raw':!![],'where':{'id':_0x5ca755[_0x6f48('0x3f')]['id']}},_0x14baf4={};_0x14baf4[_0x6f48('0x27')]=_[_0x6f48('0x40')](db['Sound']['rawAttributes']);_0x14baf4['query']=_[_0x6f48('0x40')](_0x5ca755[_0x6f48('0x28')]);_0x14baf4[_0x6f48('0x29')]=_['intersection'](_0x14baf4['model'],_0x14baf4[_0x6f48('0x28')]);_0x377b2b[_0x6f48('0x2b')]=_[_0x6f48('0x2a')](_0x14baf4[_0x6f48('0x27')],qs['fields'](_0x5ca755[_0x6f48('0x28')]['fields']));_0x377b2b[_0x6f48('0x2b')]=_0x377b2b['attributes']['length']?_0x377b2b[_0x6f48('0x2b')]:_0x14baf4['model'];if(_0x5ca755[_0x6f48('0x28')]['includeAll']){_0x377b2b['include']=[{'all':!![]}];}_0x377b2b=_[_0x6f48('0x34')]({},_0x377b2b,_0x5ca755[_0x6f48('0x38')]);return db[_0x6f48('0x25')]['find'](_0x377b2b)[_0x6f48('0x1c')](handleEntityNotFound(_0x2fca2f,null))[_0x6f48('0x1c')](respondWithResult(_0x2fca2f,null))[_0x6f48('0x3d')](handleError(_0x2fca2f,null));};exports[_0x6f48('0x41')]=function(_0x468212,_0x4a1d13,_0x1984c1){return db[_0x6f48('0x25')][_0x6f48('0x42')]({'where':{'id':_0x468212[_0x6f48('0x3f')]['id']},'attributes':[_0x6f48('0x22'),_0x6f48('0x43'),'converted_format'],'raw':!![]})[_0x6f48('0x1c')](handleEntityNotFound(_0x4a1d13,null))[_0x6f48('0x1c')](function(_0x82702f){if(_0x82702f){if(!fs[_0x6f48('0x44')](path[_0x6f48('0x45')](config['root'],_0x6f48('0x46'),_0x82702f[_0x6f48('0x43')]+'.'+_0x82702f['converted_format']))){throw new db[(_0x6f48('0x47'))][(_0x6f48('0x48'))](_0x6f48('0x49'));}return _0x4a1d13[_0x6f48('0x41')](path[_0x6f48('0x45')](config[_0x6f48('0x4a')],_0x6f48('0x46'),util[_0x6f48('0x4b')]('%s.%s',_0x82702f[_0x6f48('0x43')],_0x82702f[_0x6f48('0x4c')])),util['format'](_0x6f48('0x4d'),_0x82702f['name'],_0x82702f['converted_format']));}return null;})[_0x6f48('0x3d')](handleError(_0x4a1d13,null));};exports['create']=function(_0x266ec5,_0x325106,_0x1d6913){var _0x209167={'name':path['basename'](_0x266ec5[_0x6f48('0x4e')][_0x6f48('0x4f')],path['extname'](_0x266ec5['file'][_0x6f48('0x4f')])),'save_name':path[_0x6f48('0x50')](_0x266ec5[_0x6f48('0x4e')]['filename'],path[_0x6f48('0x51')](_0x266ec5[_0x6f48('0x4e')][_0x6f48('0x52')])),'original_format':path[_0x6f48('0x51')](_0x266ec5['file'][_0x6f48('0x4f')])[_0x6f48('0x53')](0x1),'converted_format':_0x6f48('0x54')};var _0x3d1aa0=path[_0x6f48('0x45')](config[_0x6f48('0x4a')],_0x6f48('0x55'),_0x266ec5['file'][_0x6f48('0x52')]);var _0x3d47e6=path[_0x6f48('0x45')](config[_0x6f48('0x4a')],_0x6f48('0x46'),util[_0x6f48('0x4b')]('%s.%s',path['basename'](_0x266ec5[_0x6f48('0x4e')]['filename'],path[_0x6f48('0x51')](_0x266ec5[_0x6f48('0x4e')][_0x6f48('0x52')])),_0x209167[_0x6f48('0x4c')]));logger[_0x6f48('0x56')](_0x6f48('0x57'),_0x3d1aa0);logger[_0x6f48('0x56')](_0x6f48('0x58'),_0x3d47e6);try{fs[_0x6f48('0x59')](_0x3d1aa0,parseInt(_0x6f48('0x5a'),0x8));var _0x54c4ff=sox[_0x6f48('0x5b')](_0x3d1aa0,_0x3d47e6,{'sampleRate':0x1f40,'format':_0x6f48('0x54'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x54c4ff['on'](_0x6f48('0x20'),function(_0x10b7c2){fs[_0x6f48('0x5c')](_0x3d1aa0);_0x325106[_0x6f48('0x15')](0x1f4)[_0x6f48('0x23')](_0x10b7c2);});_0x54c4ff['on']('src',function(_0x57a108){_0x209167[_0x6f48('0x5d')]=isNaN(_0x57a108[_0x6f48('0x5e')])?null:_0x57a108[_0x6f48('0x5e')]*0x3e8;_0x209167[_0x6f48('0x5f')]=isNaN(_0x57a108[_0x6f48('0x60')])?null:_0x57a108[_0x6f48('0x60')];_0x209167[_0x6f48('0x61')]=isNaN(_0x57a108[_0x6f48('0x62')])?null:_0x57a108[_0x6f48('0x62')];_0x209167[_0x6f48('0x63')]=isNaN(_0x57a108[_0x6f48('0x64')])?null:_0x57a108[_0x6f48('0x64')];_0x209167[_0x6f48('0x65')]=isNaN(_0x57a108['sampleRate'])?null:_0x57a108[_0x6f48('0x66')];});_0x54c4ff['on']('dest',function(_0x4e4d54){_0x209167[_0x6f48('0x67')]=isNaN(_0x4e4d54[_0x6f48('0x5e')])?null:_0x4e4d54['duration']*0x3e8;_0x209167[_0x6f48('0x68')]=isNaN(_0x4e4d54['sampleCount'])?null:_0x4e4d54['sampleCount'];_0x209167[_0x6f48('0x69')]=isNaN(_0x4e4d54['channelCount'])?null:_0x4e4d54[_0x6f48('0x62')];_0x209167[_0x6f48('0x6a')]=isNaN(_0x4e4d54['bitRate'])?null:_0x4e4d54[_0x6f48('0x64')];_0x209167[_0x6f48('0x6b')]=isNaN(_0x4e4d54['sampleRate'])?null:_0x4e4d54['sampleRate'];});_0x54c4ff['on'](_0x6f48('0x16'),function(){fs[_0x6f48('0x59')](_0x3d47e6,parseInt(_0x6f48('0x5a'),0x8));return db['Sound'][_0x6f48('0x6c')](_0x209167)['then'](function(_0x5b49ff){var _0x37eca4={'role':_0x266ec5[_0x6f48('0x6d')][_0x6f48('0x6e')],'userProfileId':_0x266ec5[_0x6f48('0x6d')][_0x6f48('0x6f')]};if(!_0x37eca4)throw new Error(_0x6f48('0x70'));if(_0x37eca4[_0x6f48('0x6e')]===_0x6f48('0x71')){var _0xd4aec1=_0x5b49ff[_0x6f48('0x72')]({'plain':!![]});return db[_0x6f48('0x73')][_0x6f48('0x42')]({'where':{'name':_0x6f48('0x1e'),'userProfileId':_0x37eca4[_0x6f48('0x6f')]},'raw':!![]})[_0x6f48('0x1c')](function(_0x301dae){if(_0x301dae&&_0x301dae[_0x6f48('0x74')]===0x0){return db[_0x6f48('0x75')][_0x6f48('0x6c')]({'name':_0xd4aec1[_0x6f48('0x22')],'resourceId':_0xd4aec1['id'],'type':_0x301dae[_0x6f48('0x22')],'sectionId':_0x301dae['id']},{})[_0x6f48('0x1c')](function(){return _0x5b49ff;});}else{return _0x5b49ff;}})[_0x6f48('0x3d')](function(_0x4e54ce){logger[_0x6f48('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e54ce);throw _0x4e54ce;});}return _0x5b49ff;})[_0x6f48('0x1c')](respondWithResult(_0x325106,null))[_0x6f48('0x3d')](handleError(_0x325106,null));});_0x54c4ff['start']();}catch(_0x3a6157){_0x325106[_0x6f48('0x15')](0x1f4)[_0x6f48('0x23')](_0x3a6157);}};exports['update']=function(_0x3658e2,_0xb30a8e,_0x3ac648){return db[_0x6f48('0x25')][_0x6f48('0x42')]({'where':{'id':_0x3658e2[_0x6f48('0x3f')]['id']}})[_0x6f48('0x1c')](handleEntityNotFound(_0xb30a8e,null))[_0x6f48('0x1c')](saveUpdates(_['pick'](_0x3658e2[_0x6f48('0x6d')],[_0x6f48('0x22'),'description']),null))[_0x6f48('0x1c')](respondWithResult(_0xb30a8e,null))[_0x6f48('0x3d')](handleError(_0xb30a8e,null));};exports[_0x6f48('0x76')]=function(_0x8a01c5,_0xbe6eb2,_0x54ca6f){return db[_0x6f48('0x25')][_0x6f48('0x42')]({'where':{'id':_0x8a01c5[_0x6f48('0x3f')]['id']}})[_0x6f48('0x1c')](function(_0x208bf1){if(_0x208bf1){return _0x208bf1['destroy']();}})[_0x6f48('0x1c')](function(_0x5efb03){var _0x59029c=path[_0x6f48('0x45')](config[_0x6f48('0x4a')],_0x6f48('0x55'),util[_0x6f48('0x4b')]('%s.%s',_0x5efb03['save_name'],_0x5efb03[_0x6f48('0x77')]));var _0x1c5eb9=path[_0x6f48('0x45')](config[_0x6f48('0x4a')],'server/files/sounds/converted',util[_0x6f48('0x4b')](_0x6f48('0x4d'),_0x5efb03[_0x6f48('0x43')],_0x5efb03[_0x6f48('0x4c')]));fs[_0x6f48('0x5c')](_0x59029c);fs['unlinkSync'](_0x1c5eb9);return _0x5efb03;})[_0x6f48('0x1c')](function(_0x4c32b3){if(_0x4c32b3){return _0xbe6eb2[_0x6f48('0x15')](0xcc)['end']();}})['then'](handleEntityNotFound(_0xbe6eb2,null))[_0x6f48('0x3d')](handleError(_0xbe6eb2,null));};
\ No newline at end of file
+var _0x3db3=['save','update','destroy','then','get','Sounds','end','error','stack','name','send','index','Sound','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','download','save_name','converted_format','existsSync','root','Sequelize','ValidationError','Sound\x20not\x20found','join','server/files/sounds/converted','%s.%s','format','create','basename','file','originalname','extname','filename','wav','info','chmodSync','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_channelCount','channelCount','converted_bitRate','converted_sampleRate','0777','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','server/files/sounds/original','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply'];(function(_0x2d2bcb,_0x3051fc){var _0x303f0f=function(_0x3fd68f){while(--_0x3fd68f){_0x2d2bcb['push'](_0x2d2bcb['shift']());}};_0x303f0f(++_0x3051fc);}(_0x3db3,0x1d7));var _0x33db=function(_0x1aebc8,_0x235ef3){_0x1aebc8=_0x1aebc8-0x0;var _0x24e4f5=_0x3db3[_0x1aebc8];return _0x24e4f5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x33db('0x0'));var rimraf=require(_0x33db('0x1'));var zipdir=require(_0x33db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x33db('0x3'));var moment=require(_0x33db('0x4'));var BPromise=require(_0x33db('0x5'));var Mustache=require(_0x33db('0x6'));var util=require(_0x33db('0x7'));var path=require(_0x33db('0x8'));var sox=require(_0x33db('0x9'));var csv=require(_0x33db('0xa'));var ejs=require(_0x33db('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x33db('0xc'));var deskjs=require(_0x33db('0xd'));var toCsv=require(_0x33db('0xa'));var querystring=require(_0x33db('0xe'));var Papa=require(_0x33db('0xf'));var Redis=require(_0x33db('0x10'));var authService=require(_0x33db('0x11'));var qs=require(_0x33db('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33db('0x13'))(_0x33db('0x14'));var utils=require(_0x33db('0x15'));var config=require(_0x33db('0x16'));var db=require(_0x33db('0x17'))['db'];function respondWithStatusCode(_0x3d0d91,_0x327965){_0x327965=_0x327965||0xcc;return function(_0x3303cd){if(_0x3303cd){return _0x3d0d91[_0x33db('0x18')](_0x327965);}return _0x3d0d91[_0x33db('0x19')](_0x327965)['end']();};}function respondWithResult(_0x5b1980,_0x3a1f97){_0x3a1f97=_0x3a1f97||0xc8;return function(_0x59df95){if(_0x59df95){return _0x5b1980[_0x33db('0x19')](_0x3a1f97)[_0x33db('0x1a')](_0x59df95);}};}function respondWithFilteredResult(_0x91958c,_0x4ea0da){return function(_0x4cc00){if(_0x4cc00){var _0x3b162b=_0x4cc00[_0x33db('0x1b')],_0x5a755c=_0x4ea0da[_0x33db('0x1c')],_0x311ec0=_0x4ea0da[_0x33db('0x1c')]+_0x4ea0da[_0x33db('0x1d')],_0x295f9f;if(_0x311ec0>=_0x3b162b){_0x311ec0=_0x3b162b;_0x295f9f=0xc8;}else{_0x295f9f=0xce;}_0x91958c[_0x33db('0x19')](_0x295f9f);return _0x91958c[_0x33db('0x1e')](_0x33db('0x1f'),_0x5a755c+'-'+_0x311ec0+'/'+_0x3b162b)[_0x33db('0x1a')](_0x4cc00);}return null;};}function patchUpdates(_0x155035){return function(_0x595f6c){try{jsonpatch[_0x33db('0x20')](_0x595f6c,_0x155035,!![]);}catch(_0x4ec534){return BPromise['reject'](_0x4ec534);}return _0x595f6c[_0x33db('0x21')]();};}function saveUpdates(_0x4807d8,_0x21ae61){return function(_0x1fa840){if(_0x1fa840){return _0x1fa840[_0x33db('0x22')](_0x4807d8)['then'](function(_0x1270d1){return _0x1270d1;});}return null;};}function removeEntity(_0x4906e6,_0x110399){return function(_0x506ca3){if(_0x506ca3){return _0x506ca3[_0x33db('0x23')]()[_0x33db('0x24')](function(){var _0x21850c=_0x506ca3[_0x33db('0x25')]({'plain':!![]});var _0xeeea12=_0x33db('0x26');return db['UserProfileResource'][_0x33db('0x23')]({'where':{'type':_0xeeea12,'resourceId':_0x21850c['id']}})[_0x33db('0x24')](function(){return _0x506ca3;});})[_0x33db('0x24')](function(){_0x4906e6[_0x33db('0x19')](0xcc)[_0x33db('0x27')]();});}};}function handleEntityNotFound(_0x522030,_0x3b5c49){return function(_0x5b2f69){if(!_0x5b2f69){_0x522030[_0x33db('0x18')](0x194);}return _0x5b2f69;};}function handleError(_0x5a5989,_0x4aecf2){_0x4aecf2=_0x4aecf2||0x1f4;return function(_0x46f2b5){logger[_0x33db('0x28')](_0x46f2b5[_0x33db('0x29')]);if(_0x46f2b5[_0x33db('0x2a')]){delete _0x46f2b5['name'];}_0x5a5989['status'](_0x4aecf2)[_0x33db('0x2b')](_0x46f2b5);};}exports[_0x33db('0x2c')]=function(_0xd8e4f1,_0x32d1be){var _0x598c94={},_0x2fb28b={},_0x284779={'count':0x0,'rows':[]};var _0x254a60=db[_0x33db('0x2d')]['rawAttributes'];_0x2fb28b[_0x33db('0x2e')]=_['keys'](_0x254a60);_0x2fb28b[_0x33db('0x2f')]=_['keys'](_0xd8e4f1[_0x33db('0x2f')]);_0x2fb28b[_0x33db('0x30')]=_[_0x33db('0x31')](_0x2fb28b[_0x33db('0x2e')],_0x2fb28b[_0x33db('0x2f')]);_0x598c94['attributes']=_['intersection'](_0x2fb28b['model'],qs[_0x33db('0x32')](_0xd8e4f1['query']['fields']));_0x598c94['attributes']=_0x598c94[_0x33db('0x33')]['length']?_0x598c94[_0x33db('0x33')]:_0x2fb28b['model'];if(!_0xd8e4f1[_0x33db('0x2f')][_0x33db('0x34')]('nolimit')){_0x598c94[_0x33db('0x1d')]=qs['limit'](_0xd8e4f1[_0x33db('0x2f')][_0x33db('0x1d')]);_0x598c94[_0x33db('0x1c')]=qs[_0x33db('0x1c')](_0xd8e4f1[_0x33db('0x2f')][_0x33db('0x1c')]);}_0x598c94[_0x33db('0x35')]=qs[_0x33db('0x36')](_0xd8e4f1[_0x33db('0x2f')][_0x33db('0x36')]);_0x598c94[_0x33db('0x37')]=qs[_0x33db('0x30')](_[_0x33db('0x38')](_0xd8e4f1[_0x33db('0x2f')],_0x2fb28b[_0x33db('0x30')]));if(_0xd8e4f1[_0x33db('0x2f')][_0x33db('0x39')]){_0x598c94['where']=_[_0x33db('0x3a')](_0x598c94[_0x33db('0x37')],{'$or':_[_0x33db('0x3b')](_0x254a60,function(_0x1aa34e){if(_0x1aa34e[_0x33db('0x3c')][_0x33db('0x3d')]!==_0x33db('0x3e')){var _0x4297c7={};_0x4297c7[_0x1aa34e[_0x33db('0x3f')]]={'$like':'%'+_0xd8e4f1['query'][_0x33db('0x39')]+'%'};return _0x4297c7;}})});}_0x598c94=_[_0x33db('0x3a')]({},_0x598c94,_0xd8e4f1[_0x33db('0x40')]);var _0x184d06={'where':_0x598c94[_0x33db('0x37')]};return db[_0x33db('0x2d')][_0x33db('0x1b')](_0x184d06)[_0x33db('0x24')](function(_0x11c857){_0x284779[_0x33db('0x1b')]=_0x11c857;if(_0xd8e4f1[_0x33db('0x2f')][_0x33db('0x41')]){_0x598c94['include']=[{'all':!![]}];}return db[_0x33db('0x2d')][_0x33db('0x42')](_0x598c94);})[_0x33db('0x24')](function(_0x4207e7){_0x284779[_0x33db('0x43')]=_0x4207e7;return _0x284779;})['then'](respondWithFilteredResult(_0x32d1be,_0x598c94))[_0x33db('0x44')](handleError(_0x32d1be,null));};exports[_0x33db('0x45')]=function(_0x3e40a7,_0x2d16ba){var _0x575dc0={'raw':!![],'where':{'id':_0x3e40a7[_0x33db('0x46')]['id']}},_0x5d6020={};_0x5d6020[_0x33db('0x2e')]=_[_0x33db('0x47')](db[_0x33db('0x2d')][_0x33db('0x48')]);_0x5d6020[_0x33db('0x2f')]=_[_0x33db('0x47')](_0x3e40a7[_0x33db('0x2f')]);_0x5d6020[_0x33db('0x30')]=_[_0x33db('0x31')](_0x5d6020[_0x33db('0x2e')],_0x5d6020[_0x33db('0x2f')]);_0x575dc0[_0x33db('0x33')]=_['intersection'](_0x5d6020['model'],qs[_0x33db('0x32')](_0x3e40a7[_0x33db('0x2f')]['fields']));_0x575dc0[_0x33db('0x33')]=_0x575dc0['attributes'][_0x33db('0x49')]?_0x575dc0[_0x33db('0x33')]:_0x5d6020[_0x33db('0x2e')];if(_0x3e40a7['query']['includeAll']){_0x575dc0[_0x33db('0x4a')]=[{'all':!![]}];}_0x575dc0=_[_0x33db('0x3a')]({},_0x575dc0,_0x3e40a7[_0x33db('0x40')]);return db[_0x33db('0x2d')][_0x33db('0x4b')](_0x575dc0)[_0x33db('0x24')](handleEntityNotFound(_0x2d16ba,null))['then'](respondWithResult(_0x2d16ba,null))[_0x33db('0x44')](handleError(_0x2d16ba,null));};exports[_0x33db('0x4c')]=function(_0x24a335,_0x5dfe93,_0x159d5f){return db[_0x33db('0x2d')]['find']({'where':{'id':_0x24a335[_0x33db('0x46')]['id']},'attributes':[_0x33db('0x2a'),_0x33db('0x4d'),_0x33db('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x5dfe93,null))[_0x33db('0x24')](function(_0x1892a3){if(_0x1892a3){if(!fs[_0x33db('0x4f')](path['join'](config[_0x33db('0x50')],'server/files/sounds/converted',_0x1892a3['save_name']+'.'+_0x1892a3[_0x33db('0x4e')]))){throw new db[(_0x33db('0x51'))][(_0x33db('0x52'))](_0x33db('0x53'));}return _0x5dfe93['download'](path[_0x33db('0x54')](config[_0x33db('0x50')],_0x33db('0x55'),util['format'](_0x33db('0x56'),_0x1892a3[_0x33db('0x4d')],_0x1892a3[_0x33db('0x4e')])),util[_0x33db('0x57')]('%s.%s',_0x1892a3[_0x33db('0x2a')],_0x1892a3[_0x33db('0x4e')]));}return null;})[_0x33db('0x44')](handleError(_0x5dfe93,null));};exports[_0x33db('0x58')]=function(_0x11ae39,_0x2f13e4,_0x3cb98e){var _0x413ed1={'name':path[_0x33db('0x59')](_0x11ae39[_0x33db('0x5a')][_0x33db('0x5b')],path[_0x33db('0x5c')](_0x11ae39[_0x33db('0x5a')]['originalname'])),'save_name':path[_0x33db('0x59')](_0x11ae39[_0x33db('0x5a')]['filename'],path[_0x33db('0x5c')](_0x11ae39[_0x33db('0x5a')][_0x33db('0x5d')])),'original_format':path[_0x33db('0x5c')](_0x11ae39['file']['originalname'])['substring'](0x1),'converted_format':_0x33db('0x5e')};var _0x3a226d=path['join'](config[_0x33db('0x50')],'server/files/sounds/original',_0x11ae39['file'][_0x33db('0x5d')]);var _0xebcb66=path['join'](config[_0x33db('0x50')],_0x33db('0x55'),util[_0x33db('0x57')](_0x33db('0x56'),path[_0x33db('0x59')](_0x11ae39[_0x33db('0x5a')][_0x33db('0x5d')],path['extname'](_0x11ae39[_0x33db('0x5a')][_0x33db('0x5d')])),_0x413ed1[_0x33db('0x4e')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x3a226d);logger[_0x33db('0x5f')]('Sound\x20upload\x20destination:\x20%s',_0xebcb66);try{fs[_0x33db('0x60')](_0x3a226d,parseInt('0777',0x8));var _0x1580b0=sox[_0x33db('0x61')](_0x3a226d,_0xebcb66,{'sampleRate':0x1f40,'format':_0x33db('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1580b0['on'](_0x33db('0x28'),function(_0x2217dd){fs[_0x33db('0x62')](_0x3a226d);_0x2f13e4['status'](0x1f4)[_0x33db('0x2b')](_0x2217dd);});_0x1580b0['on']('src',function(_0x3a29b5){_0x413ed1[_0x33db('0x63')]=isNaN(_0x3a29b5[_0x33db('0x64')])?null:_0x3a29b5[_0x33db('0x64')]*0x3e8;_0x413ed1[_0x33db('0x65')]=isNaN(_0x3a29b5[_0x33db('0x66')])?null:_0x3a29b5['sampleCount'];_0x413ed1[_0x33db('0x67')]=isNaN(_0x3a29b5['channelCount'])?null:_0x3a29b5['channelCount'];_0x413ed1[_0x33db('0x68')]=isNaN(_0x3a29b5[_0x33db('0x69')])?null:_0x3a29b5[_0x33db('0x69')];_0x413ed1[_0x33db('0x6a')]=isNaN(_0x3a29b5[_0x33db('0x6b')])?null:_0x3a29b5[_0x33db('0x6b')];});_0x1580b0['on']('dest',function(_0x49d03b){_0x413ed1[_0x33db('0x6c')]=isNaN(_0x49d03b[_0x33db('0x64')])?null:_0x49d03b[_0x33db('0x64')]*0x3e8;_0x413ed1['converted_sampleCount']=isNaN(_0x49d03b[_0x33db('0x66')])?null:_0x49d03b[_0x33db('0x66')];_0x413ed1[_0x33db('0x6d')]=isNaN(_0x49d03b[_0x33db('0x6e')])?null:_0x49d03b[_0x33db('0x6e')];_0x413ed1[_0x33db('0x6f')]=isNaN(_0x49d03b[_0x33db('0x69')])?null:_0x49d03b[_0x33db('0x69')];_0x413ed1[_0x33db('0x70')]=isNaN(_0x49d03b[_0x33db('0x6b')])?null:_0x49d03b[_0x33db('0x6b')];});_0x1580b0['on']('end',function(){fs[_0x33db('0x60')](_0xebcb66,parseInt(_0x33db('0x71'),0x8));return db[_0x33db('0x2d')][_0x33db('0x58')](_0x413ed1)[_0x33db('0x24')](function(_0x4f4a90){var _0x492aae={'role':_0x11ae39[_0x33db('0x72')][_0x33db('0x73')],'userProfileId':_0x11ae39[_0x33db('0x72')]['userProfileId']};if(!_0x492aae)throw new Error(_0x33db('0x74'));if(_0x492aae[_0x33db('0x73')]==='user'){var _0x2e91f2=_0x4f4a90['get']({'plain':!![]});return db[_0x33db('0x75')][_0x33db('0x4b')]({'where':{'name':_0x33db('0x26'),'userProfileId':_0x492aae[_0x33db('0x76')]},'raw':!![]})[_0x33db('0x24')](function(_0x5c13d2){if(_0x5c13d2&&_0x5c13d2[_0x33db('0x77')]===0x0){return db[_0x33db('0x78')]['create']({'name':_0x2e91f2[_0x33db('0x2a')],'resourceId':_0x2e91f2['id'],'type':_0x5c13d2[_0x33db('0x2a')],'sectionId':_0x5c13d2['id']},{})[_0x33db('0x24')](function(){return _0x4f4a90;});}else{return _0x4f4a90;}})['catch'](function(_0xe1955f){logger[_0x33db('0x28')](_0x33db('0x79'),_0xe1955f);throw _0xe1955f;});}return _0x4f4a90;})['then'](respondWithResult(_0x2f13e4,null))['catch'](handleError(_0x2f13e4,null));});_0x1580b0[_0x33db('0x7a')]();}catch(_0x41f8fc){_0x2f13e4[_0x33db('0x19')](0x1f4)[_0x33db('0x2b')](_0x41f8fc);}};exports[_0x33db('0x22')]=function(_0x133d17,_0x177f04,_0x473e7f){return db[_0x33db('0x2d')][_0x33db('0x4b')]({'where':{'id':_0x133d17[_0x33db('0x46')]['id']}})[_0x33db('0x24')](handleEntityNotFound(_0x177f04,null))[_0x33db('0x24')](saveUpdates(_[_0x33db('0x38')](_0x133d17[_0x33db('0x72')],['name',_0x33db('0x7b')]),null))[_0x33db('0x24')](respondWithResult(_0x177f04,null))[_0x33db('0x44')](handleError(_0x177f04,null));};exports[_0x33db('0x7c')]=function(_0x45cb09,_0xc05ec,_0x3881b2){return db['Sound'][_0x33db('0x4b')]({'where':{'id':_0x45cb09['params']['id']}})[_0x33db('0x24')](function(_0x56daf4){if(_0x56daf4){return _0x56daf4[_0x33db('0x23')]();}})[_0x33db('0x24')](function(_0x131163){var _0x4e617e=path[_0x33db('0x54')](config[_0x33db('0x50')],_0x33db('0x7d'),util[_0x33db('0x57')](_0x33db('0x56'),_0x131163['save_name'],_0x131163['original_format']));var _0x2ff25b=path[_0x33db('0x54')](config[_0x33db('0x50')],_0x33db('0x55'),util[_0x33db('0x57')](_0x33db('0x56'),_0x131163[_0x33db('0x4d')],_0x131163[_0x33db('0x4e')]));fs[_0x33db('0x62')](_0x4e617e);fs['unlinkSync'](_0x2ff25b);return _0x131163;})[_0x33db('0x24')](function(_0x4fb443){if(_0x4fb443){return _0xc05ec[_0x33db('0x19')](0xcc)['end']();}})[_0x33db('0x24')](handleEntityNotFound(_0xc05ec,null))['catch'](handleError(_0xc05ec,null));};
\ No newline at end of file
diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js
index d7ff37f..d75ca1b 100644
--- a/server/api/sound/sound.model.js
+++ b/server/api/sound/sound.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b20=['./sound.attributes','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2bc4df,_0x397a6f){var _0x4bcc54=function(_0xc72ce8){while(--_0xc72ce8){_0x2bc4df['push'](_0x2bc4df['shift']());}};_0x4bcc54(++_0x397a6f);}(_0x1b20,0xc6));var _0x01b2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1b20[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x01b2('0x0'));var util=require(_0x01b2('0x1'));var logger=require(_0x01b2('0x2'))(_0x01b2('0x3'));var moment=require(_0x01b2('0x4'));var BPromise=require(_0x01b2('0x5'));var rp=require(_0x01b2('0x6'));var fs=require('fs');var path=require(_0x01b2('0x7'));var rimraf=require(_0x01b2('0x8'));var config=require(_0x01b2('0x9'));var attributes=require(_0x01b2('0xa'));module['exports']=function(_0x46956f,_0x1d38f9){return _0x46956f['define'](_0x01b2('0xb'),attributes,{'tableName':_0x01b2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeca7=['exports','define','Sound','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes'];(function(_0x533daf,_0x19a7bf){var _0x3c161f=function(_0x521824){while(--_0x521824){_0x533daf['push'](_0x533daf['shift']());}};_0x3c161f(++_0x19a7bf);}(_0xeca7,0x17c));var _0x7eca=function(_0x253e1f,_0xd247f0){_0x253e1f=_0x253e1f-0x0;var _0x1adb58=_0xeca7[_0x253e1f];return _0x1adb58;};'use strict';var _=require(_0x7eca('0x0'));var util=require(_0x7eca('0x1'));var logger=require(_0x7eca('0x2'))(_0x7eca('0x3'));var moment=require(_0x7eca('0x4'));var BPromise=require('bluebird');var rp=require(_0x7eca('0x5'));var fs=require('fs');var path=require(_0x7eca('0x6'));var rimraf=require(_0x7eca('0x7'));var config=require(_0x7eca('0x8'));var attributes=require(_0x7eca('0x9'));module[_0x7eca('0xa')]=function(_0x40bff0,_0x5da2e9){return _0x40bff0[_0x7eca('0xb')](_0x7eca('0xc'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js
index c866ea0..09eca47 100644
--- a/server/api/sound/sound.rpc.js
+++ b/server/api/sound/sound.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x1b1173,_0x2ffb6c){var _0xb5bbbf=function(_0x3e8ee2){while(--_0x3e8ee2){_0x1b1173['push'](_0x1b1173['shift']());}};_0xb5bbbf(++_0x2ffb6c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});};
\ No newline at end of file
+var _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x6a4a6f,_0x2a71d5){var _0x271407=function(_0xd10329){while(--_0xd10329){_0x6a4a6f['push'](_0x6a4a6f['shift']());}};_0x271407(++_0x2a71d5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js
index 0cc34d4..55ffa5b 100644
--- a/server/api/squareMessage/index.js
+++ b/server/api/squareMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x33f5=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x33f5,0xfa));var _0x533f=function(_0x474906,_0x2777a2){_0x474906=_0x474906-0x0;var _0x64b28a=_0x33f5[_0x474906];return _0x64b28a;};'use strict';var multer=require('multer');var util=require(_0x533f('0x0'));var path=require(_0x533f('0x1'));var timeout=require('connect-timeout');var express=require(_0x533f('0x2'));var router=express['Router']();var auth=require(_0x533f('0x3'));var interaction=require(_0x533f('0x4'));var config=require(_0x533f('0x5'));var controller=require(_0x533f('0x6'));router[_0x533f('0x7')]('/',auth[_0x533f('0x8')](),controller[_0x533f('0x9')]);router['get'](_0x533f('0xa'),auth['isAuthenticated'](),controller[_0x533f('0xb')]);router[_0x533f('0xc')]('/',auth[_0x533f('0x8')](),controller[_0x533f('0xd')]);router[_0x533f('0xe')]('/:id',auth[_0x533f('0x8')](),controller['update']);router[_0x533f('0xf')](_0x533f('0xa'),auth[_0x533f('0x8')](),controller[_0x533f('0x10')]);module[_0x533f('0x11')]=router;
\ No newline at end of file
+var _0x98d8=['show','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./squareMessage.controller','index','/:id'];(function(_0x52b392,_0x5e83ea){var _0x20518c=function(_0x38a4e7){while(--_0x38a4e7){_0x52b392['push'](_0x52b392['shift']());}};_0x20518c(++_0x5e83ea);}(_0x98d8,0xce));var _0x898d=function(_0xe2ebaa,_0x138483){_0xe2ebaa=_0xe2ebaa-0x0;var _0x563838=_0x98d8[_0xe2ebaa];return _0x563838;};'use strict';var multer=require(_0x898d('0x0'));var util=require(_0x898d('0x1'));var path=require(_0x898d('0x2'));var timeout=require(_0x898d('0x3'));var express=require(_0x898d('0x4'));var router=express[_0x898d('0x5')]();var auth=require(_0x898d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x898d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x898d('0x8')]);router['get'](_0x898d('0x9'),auth['isAuthenticated'](),controller[_0x898d('0xa')]);router['post']('/',auth[_0x898d('0xb')](),controller[_0x898d('0xc')]);router[_0x898d('0xd')](_0x898d('0x9'),auth[_0x898d('0xb')](),controller[_0x898d('0xe')]);router[_0x898d('0xf')](_0x898d('0x9'),auth[_0x898d('0xb')](),controller[_0x898d('0x10')]);module[_0x898d('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js
index 7b5fd54..77ad20e 100644
--- a/server/api/squareMessage/squareMessage.attributes.js
+++ b/server/api/squareMessage/squareMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8d1b=['medium','ENUM','out','sequelize','TEXT'];(function(_0x293dcd,_0x32543b){var _0x1b68fb=function(_0x4b7249){while(--_0x4b7249){_0x293dcd['push'](_0x293dcd['shift']());}};_0x1b68fb(++_0x32543b);}(_0x8d1b,0x8a));var _0xb8d1=function(_0x4de3d8,_0x3cbcec){_0x4de3d8=_0x4de3d8-0x0;var _0x36b156=_0x8d1b[_0x4de3d8];return _0x36b156;};'use strict';var Sequelize=require(_0xb8d1('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xb8d1('0x1')](_0xb8d1('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xb8d1('0x3')]('in',_0xb8d1('0x4')),'defaultValue':_0xb8d1('0x4'),'allowNull':![]}};
\ No newline at end of file
+var _0x0c0b=['out','STRING','TEXT','ENUM'];(function(_0x443609,_0x3b2142){var _0x40b678=function(_0xe8ba98){while(--_0xe8ba98){_0x443609['push'](_0x443609['shift']());}};_0x40b678(++_0x3b2142);}(_0x0c0b,0xad));var _0xb0c0=function(_0x3d6614,_0xff2913){_0x3d6614=_0x3d6614-0x0;var _0x378d00=_0x0c0b[_0x3d6614];return _0x378d00;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb0c0('0x0')]},'body':{'type':Sequelize[_0xb0c0('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xb0c0('0x2')]('in',_0xb0c0('0x3')),'defaultValue':_0xb0c0('0x3'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js
index a06780e..678846c 100644
--- a/server/api/squareMessage/squareMessage.controller.js
+++ b/server/api/squareMessage/squareMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2605=['attributes','fields','nolimit','sort','where','pick','merge','map','type','filter','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','SquareMessage','query','filters','intersection','model'];(function(_0x503139,_0x494581){var _0x396ea6=function(_0x5b36dd){while(--_0x5b36dd){_0x503139['push'](_0x503139['shift']());}};_0x396ea6(++_0x494581);}(_0x2605,0xe8));var _0x5260=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0x2605[_0xb24fad];return _0x173226;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5260('0x0'));var rimraf=require(_0x5260('0x1'));var zipdir=require(_0x5260('0x2'));var jsonpatch=require(_0x5260('0x3'));var rp=require(_0x5260('0x4'));var moment=require(_0x5260('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5260('0x6'));var util=require(_0x5260('0x7'));var path=require(_0x5260('0x8'));var sox=require('sox');var csv=require(_0x5260('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5260('0xa'));var squel=require(_0x5260('0xb'));var crypto=require(_0x5260('0xc'));var jsforce=require(_0x5260('0xd'));var deskjs=require(_0x5260('0xe'));var toCsv=require(_0x5260('0x9'));var querystring=require(_0x5260('0xf'));var Papa=require('papaparse');var Redis=require(_0x5260('0x10'));var authService=require(_0x5260('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5260('0x12'))(_0x5260('0x13'));var utils=require(_0x5260('0x14'));var config=require(_0x5260('0x15'));var db=require(_0x5260('0x16'))['db'];function respondWithStatusCode(_0x4aca08,_0x27ca87){_0x27ca87=_0x27ca87||0xcc;return function(_0xc5a8c5){if(_0xc5a8c5){return _0x4aca08[_0x5260('0x17')](_0x27ca87);}return _0x4aca08['status'](_0x27ca87)['end']();};}function respondWithResult(_0x24a830,_0x476967){_0x476967=_0x476967||0xc8;return function(_0x2ec8ed){if(_0x2ec8ed){return _0x24a830[_0x5260('0x18')](_0x476967)['json'](_0x2ec8ed);}};}function respondWithFilteredResult(_0x58cf16,_0x46c4e3){return function(_0x21a3a4){if(_0x21a3a4){var _0x5cef4e=_0x21a3a4[_0x5260('0x19')],_0x1cfc82=_0x46c4e3[_0x5260('0x1a')],_0x500ac5=_0x46c4e3[_0x5260('0x1a')]+_0x46c4e3[_0x5260('0x1b')],_0x52e4fd;if(_0x500ac5>=_0x5cef4e){_0x500ac5=_0x5cef4e;_0x52e4fd=0xc8;}else{_0x52e4fd=0xce;}_0x58cf16[_0x5260('0x18')](_0x52e4fd);return _0x58cf16[_0x5260('0x1c')](_0x5260('0x1d'),_0x1cfc82+'-'+_0x500ac5+'/'+_0x5cef4e)[_0x5260('0x1e')](_0x21a3a4);}return null;};}function patchUpdates(_0x1aeb38){return function(_0x336c94){try{jsonpatch[_0x5260('0x1f')](_0x336c94,_0x1aeb38,!![]);}catch(_0x2eb676){return BPromise[_0x5260('0x20')](_0x2eb676);}return _0x336c94[_0x5260('0x21')]();};}function saveUpdates(_0x2dd570,_0x2fb150){return function(_0x1472b3){if(_0x1472b3){return _0x1472b3[_0x5260('0x22')](_0x2dd570)['then'](function(_0x2f430a){return _0x2f430a;});}return null;};}function removeEntity(_0x56e8e7,_0x1a307f){return function(_0x2b0c26){if(_0x2b0c26){return _0x2b0c26[_0x5260('0x23')]()[_0x5260('0x24')](function(){_0x56e8e7[_0x5260('0x18')](0xcc)[_0x5260('0x25')]();});}};}function handleEntityNotFound(_0x116a1b,_0x55e2c2){return function(_0x19a6d7){if(!_0x19a6d7){_0x116a1b['sendStatus'](0x194);}return _0x19a6d7;};}function handleError(_0x10f52a,_0x57d8f6){_0x57d8f6=_0x57d8f6||0x1f4;return function(_0x257d2a){logger[_0x5260('0x26')](_0x257d2a[_0x5260('0x27')]);if(_0x257d2a[_0x5260('0x28')]){delete _0x257d2a[_0x5260('0x28')];}_0x10f52a[_0x5260('0x18')](_0x57d8f6)[_0x5260('0x29')](_0x257d2a);};}exports[_0x5260('0x2a')]=function(_0x5b58f4,_0x3b3b13){var _0x2f3a03={},_0x492253={},_0x26dc73={'count':0x0,'rows':[]};var _0x2b61b0=db[_0x5260('0x2b')]['rawAttributes'];_0x492253['model']=_['keys'](_0x2b61b0);_0x492253[_0x5260('0x2c')]=_['keys'](_0x5b58f4['query']);_0x492253[_0x5260('0x2d')]=_[_0x5260('0x2e')](_0x492253[_0x5260('0x2f')],_0x492253[_0x5260('0x2c')]);_0x2f3a03[_0x5260('0x30')]=_['intersection'](_0x492253[_0x5260('0x2f')],qs[_0x5260('0x31')](_0x5b58f4[_0x5260('0x2c')][_0x5260('0x31')]));_0x2f3a03['attributes']=_0x2f3a03['attributes']['length']?_0x2f3a03[_0x5260('0x30')]:_0x492253['model'];if(!_0x5b58f4['query']['hasOwnProperty'](_0x5260('0x32'))){_0x2f3a03[_0x5260('0x1b')]=qs['limit'](_0x5b58f4['query'][_0x5260('0x1b')]);_0x2f3a03['offset']=qs[_0x5260('0x1a')](_0x5b58f4['query'][_0x5260('0x1a')]);}_0x2f3a03['order']=qs[_0x5260('0x33')](_0x5b58f4['query'][_0x5260('0x33')]);_0x2f3a03[_0x5260('0x34')]=qs[_0x5260('0x2d')](_[_0x5260('0x35')](_0x5b58f4[_0x5260('0x2c')],_0x492253[_0x5260('0x2d')]));if(_0x5b58f4[_0x5260('0x2c')]['filter']){_0x2f3a03['where']=_[_0x5260('0x36')](_0x2f3a03[_0x5260('0x34')],{'$or':_[_0x5260('0x37')](_0x2b61b0,function(_0x217466){if(_0x217466[_0x5260('0x38')]['key']!=='VIRTUAL'){var _0x3f3250={};_0x3f3250[_0x217466['field']]={'$like':'%'+_0x5b58f4[_0x5260('0x2c')][_0x5260('0x39')]+'%'};return _0x3f3250;}})});}_0x2f3a03=_['merge']({},_0x2f3a03,_0x5b58f4['options']);var _0x52cd18={'where':_0x2f3a03[_0x5260('0x34')]};return db['SquareMessage'][_0x5260('0x19')](_0x52cd18)[_0x5260('0x24')](function(_0x241067){_0x26dc73[_0x5260('0x19')]=_0x241067;if(_0x5b58f4[_0x5260('0x2c')][_0x5260('0x3a')]){_0x2f3a03[_0x5260('0x3b')]=[{'all':!![]}];}return db[_0x5260('0x2b')][_0x5260('0x3c')](_0x2f3a03);})[_0x5260('0x24')](function(_0x3cf8dd){_0x26dc73[_0x5260('0x3d')]=_0x3cf8dd;return _0x26dc73;})[_0x5260('0x24')](respondWithFilteredResult(_0x3b3b13,_0x2f3a03))[_0x5260('0x3e')](handleError(_0x3b3b13,null));};exports[_0x5260('0x3f')]=function(_0x4c89fb,_0x2c1493){var _0x2326dc={'raw':!![],'where':{'id':_0x4c89fb[_0x5260('0x40')]['id']}},_0x109af9={};_0x109af9[_0x5260('0x2f')]=_['keys'](db['SquareMessage']['rawAttributes']);_0x109af9[_0x5260('0x2c')]=_[_0x5260('0x41')](_0x4c89fb[_0x5260('0x2c')]);_0x109af9['filters']=_[_0x5260('0x2e')](_0x109af9[_0x5260('0x2f')],_0x109af9[_0x5260('0x2c')]);_0x2326dc[_0x5260('0x30')]=_[_0x5260('0x2e')](_0x109af9['model'],qs['fields'](_0x4c89fb[_0x5260('0x2c')][_0x5260('0x31')]));_0x2326dc['attributes']=_0x2326dc['attributes'][_0x5260('0x42')]?_0x2326dc[_0x5260('0x30')]:_0x109af9[_0x5260('0x2f')];if(_0x4c89fb['query'][_0x5260('0x3a')]){_0x2326dc['include']=[{'all':!![]}];}_0x2326dc=_['merge']({},_0x2326dc,_0x4c89fb['options']);return db[_0x5260('0x2b')][_0x5260('0x43')](_0x2326dc)[_0x5260('0x24')](handleEntityNotFound(_0x2c1493,null))[_0x5260('0x24')](respondWithResult(_0x2c1493,null))['catch'](handleError(_0x2c1493,null));};exports['create']=function(_0x9df75a,_0x3c1e1e){return db[_0x5260('0x2b')][_0x5260('0x44')](_0x9df75a[_0x5260('0x45')],{})[_0x5260('0x24')](respondWithResult(_0x3c1e1e,0xc9))['catch'](handleError(_0x3c1e1e,null));};exports[_0x5260('0x22')]=function(_0xf64a8b,_0x1a1d35){if(_0xf64a8b[_0x5260('0x45')]['id']){delete _0xf64a8b[_0x5260('0x45')]['id'];}return db[_0x5260('0x2b')][_0x5260('0x43')]({'where':{'id':_0xf64a8b[_0x5260('0x40')]['id']}})['then'](handleEntityNotFound(_0x1a1d35,null))[_0x5260('0x24')](saveUpdates(_0xf64a8b[_0x5260('0x45')],null))[_0x5260('0x24')](respondWithResult(_0x1a1d35,null))['catch'](handleError(_0x1a1d35,null));};exports[_0x5260('0x23')]=function(_0xc5409e,_0x565a6e){return db[_0x5260('0x2b')][_0x5260('0x43')]({'where':{'id':_0xc5409e[_0x5260('0x40')]['id']}})['then'](handleEntityNotFound(_0x565a6e,null))['then'](removeEntity(_0x565a6e,null))[_0x5260('0x3e')](handleError(_0x565a6e,null));};
\ No newline at end of file
+var _0xbd0e=['../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','reject','update','then','destroy','error','name','send','index','SquareMessage','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','rawAttributes','length','find','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbd0e,0x187));var _0xebd0=function(_0x4283e9,_0x55c057){_0x4283e9=_0x4283e9-0x0;var _0x4e4c67=_0xbd0e[_0x4283e9];return _0x4e4c67;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xebd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xebd0('0x1'));var jsonpatch=require(_0xebd0('0x2'));var rp=require(_0xebd0('0x3'));var moment=require(_0xebd0('0x4'));var BPromise=require(_0xebd0('0x5'));var Mustache=require(_0xebd0('0x6'));var util=require('util');var path=require('path');var sox=require(_0xebd0('0x7'));var csv=require(_0xebd0('0x8'));var ejs=require(_0xebd0('0x9'));var fs=require('fs');var _=require(_0xebd0('0xa'));var squel=require(_0xebd0('0xb'));var crypto=require(_0xebd0('0xc'));var jsforce=require(_0xebd0('0xd'));var deskjs=require(_0xebd0('0xe'));var toCsv=require(_0xebd0('0x8'));var querystring=require('querystring');var Papa=require(_0xebd0('0xf'));var Redis=require(_0xebd0('0x10'));var authService=require(_0xebd0('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xebd0('0x12'));var logger=require(_0xebd0('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xebd0('0x14'));var db=require(_0xebd0('0x15'))['db'];function respondWithStatusCode(_0x24f22a,_0x3a481b){_0x3a481b=_0x3a481b||0xcc;return function(_0xfbd0b7){if(_0xfbd0b7){return _0x24f22a['sendStatus'](_0x3a481b);}return _0x24f22a[_0xebd0('0x16')](_0x3a481b)[_0xebd0('0x17')]();};}function respondWithResult(_0xf5952f,_0x57e9b1){_0x57e9b1=_0x57e9b1||0xc8;return function(_0x298300){if(_0x298300){return _0xf5952f[_0xebd0('0x16')](_0x57e9b1)[_0xebd0('0x18')](_0x298300);}};}function respondWithFilteredResult(_0x45d97e,_0x248ad0){return function(_0x406cff){if(_0x406cff){var _0x2bf066=_0x406cff[_0xebd0('0x19')],_0x44822c=_0x248ad0[_0xebd0('0x1a')],_0x25097c=_0x248ad0[_0xebd0('0x1a')]+_0x248ad0[_0xebd0('0x1b')],_0x426f14;if(_0x25097c>=_0x2bf066){_0x25097c=_0x2bf066;_0x426f14=0xc8;}else{_0x426f14=0xce;}_0x45d97e[_0xebd0('0x16')](_0x426f14);return _0x45d97e['set'](_0xebd0('0x1c'),_0x44822c+'-'+_0x25097c+'/'+_0x2bf066)[_0xebd0('0x18')](_0x406cff);}return null;};}function patchUpdates(_0xb9309b){return function(_0x2834ad){try{jsonpatch['apply'](_0x2834ad,_0xb9309b,!![]);}catch(_0x37eff9){return BPromise[_0xebd0('0x1d')](_0x37eff9);}return _0x2834ad['save']();};}function saveUpdates(_0x22bb7f,_0x4ef17f){return function(_0x4720d5){if(_0x4720d5){return _0x4720d5[_0xebd0('0x1e')](_0x22bb7f)[_0xebd0('0x1f')](function(_0x1827ae){return _0x1827ae;});}return null;};}function removeEntity(_0x58b5e5,_0x441a33){return function(_0x4ad73a){if(_0x4ad73a){return _0x4ad73a[_0xebd0('0x20')]()[_0xebd0('0x1f')](function(){_0x58b5e5[_0xebd0('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x234548,_0x47fe4){return function(_0x254979){if(!_0x254979){_0x234548['sendStatus'](0x194);}return _0x254979;};}function handleError(_0x3f08a8,_0x262f56){_0x262f56=_0x262f56||0x1f4;return function(_0x36f3db){logger[_0xebd0('0x21')](_0x36f3db['stack']);if(_0x36f3db['name']){delete _0x36f3db[_0xebd0('0x22')];}_0x3f08a8[_0xebd0('0x16')](_0x262f56)[_0xebd0('0x23')](_0x36f3db);};}exports[_0xebd0('0x24')]=function(_0x30d96b,_0x553abc){var _0x411eb4={},_0x20990b={},_0x3fb1c9={'count':0x0,'rows':[]};var _0x388eea=db[_0xebd0('0x25')]['rawAttributes'];_0x20990b['model']=_['keys'](_0x388eea);_0x20990b['query']=_[_0xebd0('0x26')](_0x30d96b[_0xebd0('0x27')]);_0x20990b[_0xebd0('0x28')]=_['intersection'](_0x20990b['model'],_0x20990b['query']);_0x411eb4[_0xebd0('0x29')]=_[_0xebd0('0x2a')](_0x20990b[_0xebd0('0x2b')],qs[_0xebd0('0x2c')](_0x30d96b[_0xebd0('0x27')][_0xebd0('0x2c')]));_0x411eb4[_0xebd0('0x29')]=_0x411eb4[_0xebd0('0x29')]['length']?_0x411eb4[_0xebd0('0x29')]:_0x20990b[_0xebd0('0x2b')];if(!_0x30d96b[_0xebd0('0x27')][_0xebd0('0x2d')](_0xebd0('0x2e'))){_0x411eb4[_0xebd0('0x1b')]=qs['limit'](_0x30d96b[_0xebd0('0x27')]['limit']);_0x411eb4['offset']=qs['offset'](_0x30d96b[_0xebd0('0x27')][_0xebd0('0x1a')]);}_0x411eb4[_0xebd0('0x2f')]=qs[_0xebd0('0x30')](_0x30d96b[_0xebd0('0x27')]['sort']);_0x411eb4[_0xebd0('0x31')]=qs[_0xebd0('0x28')](_[_0xebd0('0x32')](_0x30d96b[_0xebd0('0x27')],_0x20990b[_0xebd0('0x28')]));if(_0x30d96b[_0xebd0('0x27')][_0xebd0('0x33')]){_0x411eb4[_0xebd0('0x31')]=_[_0xebd0('0x34')](_0x411eb4['where'],{'$or':_[_0xebd0('0x35')](_0x388eea,function(_0x5a4a44){if(_0x5a4a44[_0xebd0('0x36')][_0xebd0('0x37')]!==_0xebd0('0x38')){var _0x519e1b={};_0x519e1b[_0x5a4a44[_0xebd0('0x39')]]={'$like':'%'+_0x30d96b['query'][_0xebd0('0x33')]+'%'};return _0x519e1b;}})});}_0x411eb4=_[_0xebd0('0x34')]({},_0x411eb4,_0x30d96b[_0xebd0('0x3a')]);var _0x4e1b1b={'where':_0x411eb4[_0xebd0('0x31')]};return db[_0xebd0('0x25')]['count'](_0x4e1b1b)[_0xebd0('0x1f')](function(_0x225c66){_0x3fb1c9[_0xebd0('0x19')]=_0x225c66;if(_0x30d96b[_0xebd0('0x27')]['includeAll']){_0x411eb4[_0xebd0('0x3b')]=[{'all':!![]}];}return db[_0xebd0('0x25')][_0xebd0('0x3c')](_0x411eb4);})[_0xebd0('0x1f')](function(_0x46c7b7){_0x3fb1c9[_0xebd0('0x3d')]=_0x46c7b7;return _0x3fb1c9;})[_0xebd0('0x1f')](respondWithFilteredResult(_0x553abc,_0x411eb4))[_0xebd0('0x3e')](handleError(_0x553abc,null));};exports['show']=function(_0x5d030d,_0x153d1f){var _0x503b4b={'raw':!![],'where':{'id':_0x5d030d['params']['id']}},_0x488857={};_0x488857['model']=_[_0xebd0('0x26')](db[_0xebd0('0x25')][_0xebd0('0x3f')]);_0x488857[_0xebd0('0x27')]=_[_0xebd0('0x26')](_0x5d030d[_0xebd0('0x27')]);_0x488857[_0xebd0('0x28')]=_['intersection'](_0x488857[_0xebd0('0x2b')],_0x488857[_0xebd0('0x27')]);_0x503b4b[_0xebd0('0x29')]=_['intersection'](_0x488857['model'],qs[_0xebd0('0x2c')](_0x5d030d['query'][_0xebd0('0x2c')]));_0x503b4b[_0xebd0('0x29')]=_0x503b4b[_0xebd0('0x29')][_0xebd0('0x40')]?_0x503b4b[_0xebd0('0x29')]:_0x488857[_0xebd0('0x2b')];if(_0x5d030d[_0xebd0('0x27')]['includeAll']){_0x503b4b[_0xebd0('0x3b')]=[{'all':!![]}];}_0x503b4b=_[_0xebd0('0x34')]({},_0x503b4b,_0x5d030d[_0xebd0('0x3a')]);return db[_0xebd0('0x25')][_0xebd0('0x41')](_0x503b4b)[_0xebd0('0x1f')](handleEntityNotFound(_0x153d1f,null))['then'](respondWithResult(_0x153d1f,null))[_0xebd0('0x3e')](handleError(_0x153d1f,null));};exports['create']=function(_0x47e808,_0x4329a8){return db['SquareMessage']['create'](_0x47e808[_0xebd0('0x42')],{})[_0xebd0('0x1f')](respondWithResult(_0x4329a8,0xc9))[_0xebd0('0x3e')](handleError(_0x4329a8,null));};exports[_0xebd0('0x1e')]=function(_0x3aceaf,_0x490191){if(_0x3aceaf[_0xebd0('0x42')]['id']){delete _0x3aceaf['body']['id'];}return db['SquareMessage'][_0xebd0('0x41')]({'where':{'id':_0x3aceaf[_0xebd0('0x43')]['id']}})['then'](handleEntityNotFound(_0x490191,null))[_0xebd0('0x1f')](saveUpdates(_0x3aceaf[_0xebd0('0x42')],null))[_0xebd0('0x1f')](respondWithResult(_0x490191,null))[_0xebd0('0x3e')](handleError(_0x490191,null));};exports[_0xebd0('0x20')]=function(_0x18675a,_0x778fa1){return db[_0xebd0('0x25')][_0xebd0('0x41')]({'where':{'id':_0x18675a['params']['id']}})[_0xebd0('0x1f')](handleEntityNotFound(_0x778fa1,null))[_0xebd0('0x1f')](removeEntity(_0x778fa1,null))[_0xebd0('0x3e')](handleError(_0x778fa1,null));};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js
index 0e7ede1..9df2046 100644
--- a/server/api/squareMessage/squareMessage.model.js
+++ b/server/api/squareMessage/squareMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa65a=['exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5eeea3,_0x5cd230){var _0x20bb43=function(_0x265a91){while(--_0x265a91){_0x5eeea3['push'](_0x5eeea3['shift']());}};_0x20bb43(++_0x5cd230);}(_0xa65a,0x97));var _0xaa65=function(_0x3a00e0,_0x498b47){_0x3a00e0=_0x3a00e0-0x0;var _0x4f1e06=_0xa65a[_0x3a00e0];return _0x4f1e06;};'use strict';var _=require(_0xaa65('0x0'));var util=require('util');var logger=require(_0xaa65('0x1'))(_0xaa65('0x2'));var moment=require(_0xaa65('0x3'));var BPromise=require(_0xaa65('0x4'));var rp=require(_0xaa65('0x5'));var fs=require('fs');var path=require(_0xaa65('0x6'));var rimraf=require(_0xaa65('0x7'));var config=require(_0xaa65('0x8'));var attributes=require('./squareMessage.attributes');module[_0xaa65('0x9')]=function(_0x55350f,_0x39ccb4){return _0x55350f['define']('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd598=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','util'];(function(_0x443b6d,_0x4285ec){var _0x2bb152=function(_0x59ee3e){while(--_0x59ee3e){_0x443b6d['push'](_0x443b6d['shift']());}};_0x2bb152(++_0x4285ec);}(_0xd598,0x151));var _0x8d59=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd598[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x8d59('0x0'));var logger=require(_0x8d59('0x1'))(_0x8d59('0x2'));var moment=require(_0x8d59('0x3'));var BPromise=require(_0x8d59('0x4'));var rp=require(_0x8d59('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d59('0x6'));var config=require(_0x8d59('0x7'));var attributes=require(_0x8d59('0x8'));module[_0x8d59('0x9')]=function(_0x43cc16,_0x4a3a76){return _0x43cc16[_0x8d59('0xa')](_0x8d59('0xb'),attributes,{'tableName':_0x8d59('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js
index e00a8b0..a2df5b2 100644
--- a/server/api/squareMessage/squareMessage.rpc.js
+++ b/server/api/squareMessage/squareMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b61=['catch','CreateSquareMessage','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x3d0bdc,_0x565310){var _0x4888ca=function(_0x49119c){while(--_0x49119c){_0x3d0bdc['push'](_0x3d0bdc['shift']());}};_0x4888ca(++_0x565310);}(_0x0b61,0x1d0));var _0x10b6=function(_0x3e0fab,_0x285e29){_0x3e0fab=_0x3e0fab-0x0;var _0x36cde8=_0x0b61[_0x3e0fab];return _0x36cde8;};'use strict';var _=require(_0x10b6('0x0'));var util=require(_0x10b6('0x1'));var moment=require(_0x10b6('0x2'));var BPromise=require('bluebird');var rs=require(_0x10b6('0x3'));var fs=require('fs');var Redis=require(_0x10b6('0x4'));var db=require(_0x10b6('0x5'))['db'];var utils=require(_0x10b6('0x6'));var logger=require(_0x10b6('0x7'))(_0x10b6('0x8'));var config=require(_0x10b6('0x9'));var jayson=require(_0x10b6('0xa'));var client=jayson[_0x10b6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d46a1,_0x5ada32,_0xc1eda0){return new BPromise(function(_0x1c1c7d,_0x5e44a5){return client[_0x10b6('0xc')](_0x3d46a1,_0xc1eda0)[_0x10b6('0xd')](function(_0x5432eb){logger['info'](_0x10b6('0xe'),_0x5ada32,_0x10b6('0xf'));logger[_0x10b6('0x10')](_0x10b6('0x11'),_0x5ada32,_0x10b6('0xf'),JSON[_0x10b6('0x12')](_0x5432eb));if(_0x5432eb['error']){if(_0x5432eb[_0x10b6('0x13')]['code']===0x1f4){logger[_0x10b6('0x13')]('SquareMessage,\x20%s,\x20%s',_0x5ada32,_0x5432eb['error'][_0x10b6('0x14')]);return _0x5e44a5(_0x5432eb[_0x10b6('0x13')][_0x10b6('0x14')]);}logger['error'](_0x10b6('0xe'),_0x5ada32,_0x5432eb[_0x10b6('0x13')]['message']);return _0x1c1c7d(_0x5432eb[_0x10b6('0x13')][_0x10b6('0x14')]);}else{logger[_0x10b6('0x15')](_0x10b6('0xe'),_0x5ada32,'request\x20sent');_0x1c1c7d(_0x5432eb['result'][_0x10b6('0x14')]);}})[_0x10b6('0x16')](function(_0x1e040d){logger[_0x10b6('0x13')]('SquareMessage,\x20%s,\x20%s',_0x5ada32,_0x1e040d);_0x5e44a5(_0x1e040d);});});}exports[_0x10b6('0x17')]=function(_0x4c025b){var _0x546e63=this;return new Promise(function(_0x5682d0,_0x219a9a){return db['SquareMessage']['create'](_0x4c025b[_0x10b6('0x18')],{'raw':_0x4c025b[_0x10b6('0x19')]?_0x4c025b['options'][_0x10b6('0x1a')]===undefined?!![]:![]:!![]})[_0x10b6('0xd')](function(_0x3afaf7){logger['info']('CreateSquareMessage',_0x4c025b);logger[_0x10b6('0x10')](_0x10b6('0x17'),_0x4c025b,JSON[_0x10b6('0x12')](_0x3afaf7));_0x5682d0(_0x3afaf7);})[_0x10b6('0x16')](function(_0x20f192){logger[_0x10b6('0x13')]('CreateSquareMessage',_0x20f192[_0x10b6('0x14')],_0x4c025b);_0x219a9a(_0x546e63['error'](0x1f4,_0x20f192['message']));});});};
\ No newline at end of file
+var _0x392e=['stringify','error','message','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x40644b,_0x5de686){var _0xfb5684=function(_0x16a6b5){while(--_0x16a6b5){_0x40644b['push'](_0x40644b['shift']());}};_0xfb5684(++_0x5de686);}(_0x392e,0x1ae));var _0xe392=function(_0x2bf0a2,_0x1604ed){_0x2bf0a2=_0x2bf0a2-0x0;var _0x19f24e=_0x392e[_0x2bf0a2];return _0x19f24e;};'use strict';var _=require(_0xe392('0x0'));var util=require(_0xe392('0x1'));var moment=require('moment');var BPromise=require(_0xe392('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe392('0x3'));var db=require(_0xe392('0x4'))['db'];var utils=require(_0xe392('0x5'));var logger=require(_0xe392('0x6'))(_0xe392('0x7'));var config=require(_0xe392('0x8'));var jayson=require(_0xe392('0x9'));var client=jayson[_0xe392('0xa')][_0xe392('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcf68cc,_0x1ce3f6,_0x22d38d){return new BPromise(function(_0x517b04,_0x3015f2){return client['request'](_0xcf68cc,_0x22d38d)[_0xe392('0xc')](function(_0xb7eb9d){logger[_0xe392('0xd')](_0xe392('0xe'),_0x1ce3f6,'request\x20sent');logger[_0xe392('0xf')](_0xe392('0x10'),_0x1ce3f6,_0xe392('0x11'),JSON[_0xe392('0x12')](_0xb7eb9d));if(_0xb7eb9d[_0xe392('0x13')]){if(_0xb7eb9d['error']['code']===0x1f4){logger['error'](_0xe392('0xe'),_0x1ce3f6,_0xb7eb9d[_0xe392('0x13')][_0xe392('0x14')]);return _0x3015f2(_0xb7eb9d['error']['message']);}logger[_0xe392('0x13')](_0xe392('0xe'),_0x1ce3f6,_0xb7eb9d[_0xe392('0x13')]['message']);return _0x517b04(_0xb7eb9d[_0xe392('0x13')]['message']);}else{logger[_0xe392('0xd')]('SquareMessage,\x20%s,\x20%s',_0x1ce3f6,_0xe392('0x11'));_0x517b04(_0xb7eb9d['result'][_0xe392('0x14')]);}})[_0xe392('0x15')](function(_0x3a0c7b){logger[_0xe392('0x13')](_0xe392('0xe'),_0x1ce3f6,_0x3a0c7b);_0x3015f2(_0x3a0c7b);});});}exports['CreateSquareMessage']=function(_0x46523d){var _0x2dfaf4=this;return new Promise(function(_0x1cd4be,_0x1cd3e8){return db[_0xe392('0x16')][_0xe392('0x17')](_0x46523d[_0xe392('0x18')],{'raw':_0x46523d[_0xe392('0x19')]?_0x46523d['options'][_0xe392('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2c7c85){logger[_0xe392('0xd')]('CreateSquareMessage',_0x46523d);logger[_0xe392('0xf')](_0xe392('0x1b'),_0x46523d,JSON[_0xe392('0x12')](_0x2c7c85));_0x1cd4be(_0x2c7c85);})[_0xe392('0x15')](function(_0x26182a){logger[_0xe392('0x13')]('CreateSquareMessage',_0x26182a[_0xe392('0x14')],_0x46523d);_0x1cd3e8(_0x2dfaf4[_0xe392('0x13')](0x1f4,_0x26182a[_0xe392('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js
index 7cbe1b3..005e937 100644
--- a/server/api/squareOdbc/index.js
+++ b/server/api/squareOdbc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7fc=['Router','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','15s','post','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x37a06b,_0x340326){var _0x5d9300=function(_0x81df56){while(--_0x81df56){_0x37a06b['push'](_0x37a06b['shift']());}};_0x5d9300(++_0x340326);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0xb7fc[_0x95ac8b];return _0x5b0792;};'use strict';var multer=require(_0xcb7f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcb7f('0x1'));var express=require(_0xcb7f('0x2'));var router=express[_0xcb7f('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcb7f('0x4'));var controller=require(_0xcb7f('0x5'));router[_0xcb7f('0x6')]('/',auth[_0xcb7f('0x7')](),controller[_0xcb7f('0x8')]);router[_0xcb7f('0x6')]('/:id',auth[_0xcb7f('0x7')](),controller[_0xcb7f('0x9')]);router[_0xcb7f('0x6')]('/:id/test',auth[_0xcb7f('0x7')](),timeout(_0xcb7f('0xa')),controller['test']);router[_0xcb7f('0xb')]('/',auth[_0xcb7f('0x7')](),controller['create']);router[_0xcb7f('0xc')](_0xcb7f('0xd'),auth[_0xcb7f('0x7')](),controller[_0xcb7f('0xe')]);router[_0xcb7f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xcb7f('0x10')]);module[_0xcb7f('0x11')]=router;
\ No newline at end of file
+var _0xd404=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3acfb4,_0x3546e2){var _0x16f569=function(_0x466e76){while(--_0x466e76){_0x3acfb4['push'](_0x3acfb4['shift']());}};_0x16f569(++_0x3546e2);}(_0xd404,0x15b));var _0x4d40=function(_0x3c6fec,_0x3cd7fe){_0x3c6fec=_0x3c6fec-0x0;var _0x3a302c=_0xd404[_0x3c6fec];return _0x3a302c;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var auth=require(_0x4d40('0x4'));var interaction=require(_0x4d40('0x5'));var config=require(_0x4d40('0x6'));var controller=require(_0x4d40('0x7'));router[_0x4d40('0x8')]('/',auth[_0x4d40('0x9')](),controller[_0x4d40('0xa')]);router[_0x4d40('0x8')](_0x4d40('0xb'),auth['isAuthenticated'](),controller[_0x4d40('0xc')]);router[_0x4d40('0x8')]('/:id/test',auth[_0x4d40('0x9')](),timeout('15s'),controller['test']);router[_0x4d40('0xd')]('/',auth[_0x4d40('0x9')](),controller[_0x4d40('0xe')]);router[_0x4d40('0xf')](_0x4d40('0xb'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x10')]);router[_0x4d40('0x11')](_0x4d40('0xb'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x12')]);module[_0x4d40('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js
index 8ec8d37..7fead03 100644
--- a/server/api/squareOdbc/squareOdbc.attributes.js
+++ b/server/api/squareOdbc/squareOdbc.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb4c=['sequelize','STRING'];(function(_0x3ddb2,_0x386ec3){var _0x41cc1f=function(_0x13e620){while(--_0x13e620){_0x3ddb2['push'](_0x3ddb2['shift']());}};_0x41cc1f(++_0x386ec3);}(_0xeb4c,0x1b2));var _0xceb4=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xeb4c[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0xceb4('0x0'));module['exports']={'name':{'type':Sequelize[_0xceb4('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xceb4('0x1')]},'description':{'type':Sequelize[_0xceb4('0x1')]}};
\ No newline at end of file
+var _0x1f0a=['name','exports','STRING'];(function(_0x4b94b9,_0x190691){var _0x4882f7=function(_0x333519){while(--_0x333519){_0x4b94b9['push'](_0x4b94b9['shift']());}};_0x4882f7(++_0x190691);}(_0x1f0a,0x133));var _0xa1f0=function(_0x3857b1,_0x8ac71f){_0x3857b1=_0x3857b1-0x0;var _0x1ad85c=_0x1f0a[_0x3857b1];return _0x1ad85c;};'use strict';var Sequelize=require('sequelize');module[_0xa1f0('0x0')]={'name':{'type':Sequelize[_0xa1f0('0x1')],'unique':_0xa1f0('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xa1f0('0x1')]},'description':{'type':Sequelize[_0xa1f0('0x1')]}};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js
index 2ba4b06..64fc009 100644
--- a/server/api/squareOdbc/squareOdbc.controller.js
+++ b/server/api/squareOdbc/squareOdbc.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1156=['index','SquareOdbc','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','dsn','odbc','openSync','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','Content-Range','json','apply','reject','save','then','get','ODBC','UserProfileResource','destroy','end','error','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1156,0x181));var _0x6115=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x1156[_0x13b02f];return _0x12e9a6;};'use strict';var pdf=require(_0x6115('0x0'));var emlformat=require(_0x6115('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6115('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6115('0x3'));var moment=require(_0x6115('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6115('0x5'));var util=require('util');var path=require(_0x6115('0x6'));var sox=require(_0x6115('0x7'));var csv=require(_0x6115('0x8'));var ejs=require(_0x6115('0x9'));var fs=require('fs');var _=require(_0x6115('0xa'));var squel=require(_0x6115('0xb'));var crypto=require(_0x6115('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6115('0xd'));var toCsv=require(_0x6115('0x8'));var querystring=require(_0x6115('0xe'));var Papa=require(_0x6115('0xf'));var Redis=require(_0x6115('0x10'));var authService=require(_0x6115('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6115('0x12'));var logger=require(_0x6115('0x13'))('api');var utils=require(_0x6115('0x14'));var config=require(_0x6115('0x15'));var db=require(_0x6115('0x16'))['db'];function respondWithStatusCode(_0xa5fb38,_0x13a616){_0x13a616=_0x13a616||0xcc;return function(_0x2a1034){if(_0x2a1034){return _0xa5fb38[_0x6115('0x17')](_0x13a616);}return _0xa5fb38[_0x6115('0x18')](_0x13a616)['end']();};}function respondWithResult(_0x55fb1a,_0x2547f9){_0x2547f9=_0x2547f9||0xc8;return function(_0x5e95af){if(_0x5e95af){return _0x55fb1a[_0x6115('0x18')](_0x2547f9)['json'](_0x5e95af);}};}function respondWithFilteredResult(_0x4a54e1,_0x410899){return function(_0x9b9b01){if(_0x9b9b01){var _0x585edc=_0x9b9b01[_0x6115('0x19')],_0x26b237=_0x410899[_0x6115('0x1a')],_0x878f6=_0x410899['offset']+_0x410899['limit'],_0x138f8d;if(_0x878f6>=_0x585edc){_0x878f6=_0x585edc;_0x138f8d=0xc8;}else{_0x138f8d=0xce;}_0x4a54e1[_0x6115('0x18')](_0x138f8d);return _0x4a54e1['set'](_0x6115('0x1b'),_0x26b237+'-'+_0x878f6+'/'+_0x585edc)[_0x6115('0x1c')](_0x9b9b01);}return null;};}function patchUpdates(_0x5d8089){return function(_0x455f9f){try{jsonpatch[_0x6115('0x1d')](_0x455f9f,_0x5d8089,!![]);}catch(_0x1581cd){return BPromise[_0x6115('0x1e')](_0x1581cd);}return _0x455f9f[_0x6115('0x1f')]();};}function saveUpdates(_0x3e1a70,_0x39cbe6){return function(_0x1e8869){if(_0x1e8869){return _0x1e8869['update'](_0x3e1a70)[_0x6115('0x20')](function(_0x2e9c15){return _0x2e9c15;});}return null;};}function removeEntity(_0x4e30f1,_0x48a88f){return function(_0x44e968){if(_0x44e968){return _0x44e968['destroy']()[_0x6115('0x20')](function(){var _0x2b0673=_0x44e968[_0x6115('0x21')]({'plain':!![]});var _0x35da55=_0x6115('0x22');return db[_0x6115('0x23')][_0x6115('0x24')]({'where':{'type':_0x35da55,'resourceId':_0x2b0673['id']}})['then'](function(){return _0x44e968;});})[_0x6115('0x20')](function(){_0x4e30f1[_0x6115('0x18')](0xcc)[_0x6115('0x25')]();});}};}function handleEntityNotFound(_0x44658e,_0x36f681){return function(_0x506ec3){if(!_0x506ec3){_0x44658e[_0x6115('0x17')](0x194);}return _0x506ec3;};}function handleError(_0x348a55,_0x3f361b){_0x3f361b=_0x3f361b||0x1f4;return function(_0x4a9c29){logger[_0x6115('0x26')](_0x4a9c29['stack']);if(_0x4a9c29[_0x6115('0x27')]){delete _0x4a9c29[_0x6115('0x27')];}_0x348a55[_0x6115('0x18')](_0x3f361b)['send'](_0x4a9c29);};}exports[_0x6115('0x28')]=function(_0x31611c,_0x1b95c3){var _0x498464={},_0x3670b9={},_0x3e825f={'count':0x0,'rows':[]};var _0x14422d=db[_0x6115('0x29')]['rawAttributes'];_0x3670b9['model']=_[_0x6115('0x2a')](_0x14422d);_0x3670b9[_0x6115('0x2b')]=_[_0x6115('0x2a')](_0x31611c[_0x6115('0x2b')]);_0x3670b9[_0x6115('0x2c')]=_[_0x6115('0x2d')](_0x3670b9[_0x6115('0x2e')],_0x3670b9[_0x6115('0x2b')]);_0x498464[_0x6115('0x2f')]=_['intersection'](_0x3670b9[_0x6115('0x2e')],qs[_0x6115('0x30')](_0x31611c['query'][_0x6115('0x30')]));_0x498464[_0x6115('0x2f')]=_0x498464[_0x6115('0x2f')][_0x6115('0x31')]?_0x498464[_0x6115('0x2f')]:_0x3670b9[_0x6115('0x2e')];if(!_0x31611c[_0x6115('0x2b')]['hasOwnProperty'](_0x6115('0x32'))){_0x498464['limit']=qs[_0x6115('0x33')](_0x31611c[_0x6115('0x2b')][_0x6115('0x33')]);_0x498464['offset']=qs[_0x6115('0x1a')](_0x31611c[_0x6115('0x2b')][_0x6115('0x1a')]);}_0x498464[_0x6115('0x34')]=qs[_0x6115('0x35')](_0x31611c[_0x6115('0x2b')]['sort']);_0x498464['where']=qs['filters'](_[_0x6115('0x36')](_0x31611c[_0x6115('0x2b')],_0x3670b9['filters']));if(_0x31611c[_0x6115('0x2b')]['filter']){_0x498464[_0x6115('0x37')]=_[_0x6115('0x38')](_0x498464['where'],{'$or':_[_0x6115('0x39')](_0x14422d,function(_0x1a6816){if(_0x1a6816[_0x6115('0x3a')][_0x6115('0x3b')]!==_0x6115('0x3c')){var _0x1437b2={};_0x1437b2[_0x1a6816[_0x6115('0x3d')]]={'$like':'%'+_0x31611c[_0x6115('0x2b')][_0x6115('0x3e')]+'%'};return _0x1437b2;}})});}_0x498464=_[_0x6115('0x38')]({},_0x498464,_0x31611c[_0x6115('0x3f')]);var _0x127b61={'where':_0x498464[_0x6115('0x37')]};return db[_0x6115('0x29')]['count'](_0x127b61)[_0x6115('0x20')](function(_0x2412ab){_0x3e825f[_0x6115('0x19')]=_0x2412ab;if(_0x31611c[_0x6115('0x2b')]['includeAll']){_0x498464['include']=[{'all':!![]}];}return db[_0x6115('0x29')][_0x6115('0x40')](_0x498464);})[_0x6115('0x20')](function(_0x3ecbdb){_0x3e825f[_0x6115('0x41')]=_0x3ecbdb;return _0x3e825f;})[_0x6115('0x20')](respondWithFilteredResult(_0x1b95c3,_0x498464))[_0x6115('0x42')](handleError(_0x1b95c3,null));};exports[_0x6115('0x43')]=function(_0x269625,_0x55a6b3){var _0x19cd51={'raw':!![],'where':{'id':_0x269625[_0x6115('0x44')]['id']}},_0x18753a={};_0x18753a[_0x6115('0x2e')]=_[_0x6115('0x2a')](db[_0x6115('0x29')][_0x6115('0x45')]);_0x18753a[_0x6115('0x2b')]=_[_0x6115('0x2a')](_0x269625[_0x6115('0x2b')]);_0x18753a[_0x6115('0x2c')]=_[_0x6115('0x2d')](_0x18753a[_0x6115('0x2e')],_0x18753a[_0x6115('0x2b')]);_0x19cd51[_0x6115('0x2f')]=_[_0x6115('0x2d')](_0x18753a[_0x6115('0x2e')],qs[_0x6115('0x30')](_0x269625[_0x6115('0x2b')]['fields']));_0x19cd51[_0x6115('0x2f')]=_0x19cd51['attributes']['length']?_0x19cd51[_0x6115('0x2f')]:_0x18753a[_0x6115('0x2e')];if(_0x269625[_0x6115('0x2b')][_0x6115('0x46')]){_0x19cd51[_0x6115('0x47')]=[{'all':!![]}];}_0x19cd51=_[_0x6115('0x38')]({},_0x19cd51,_0x269625['options']);return db[_0x6115('0x29')][_0x6115('0x48')](_0x19cd51)[_0x6115('0x20')](handleEntityNotFound(_0x55a6b3,null))[_0x6115('0x20')](respondWithResult(_0x55a6b3,null))[_0x6115('0x42')](handleError(_0x55a6b3,null));};exports[_0x6115('0x49')]=function(_0x49d4d3,_0x30f199){return db[_0x6115('0x29')][_0x6115('0x49')](_0x49d4d3['body'],{})[_0x6115('0x20')](function(_0x48a946){var _0xe7eeca=_0x49d4d3[_0x6115('0x4a')][_0x6115('0x21')]({'plain':!![]});if(!_0xe7eeca)throw new Error(_0x6115('0x4b'));if(_0xe7eeca[_0x6115('0x4c')]===_0x6115('0x4a')){var _0x458d08=_0x48a946['get']({'plain':!![]});var _0x2dfff8=_0x6115('0x22');return db[_0x6115('0x4d')][_0x6115('0x48')]({'where':{'name':_0x2dfff8,'userProfileId':_0xe7eeca['userProfileId']},'raw':!![]})[_0x6115('0x20')](function(_0x58cc59){if(_0x58cc59&&_0x58cc59[_0x6115('0x4e')]===0x0){return db['UserProfileResource'][_0x6115('0x49')]({'name':_0x458d08[_0x6115('0x27')],'resourceId':_0x458d08['id'],'type':_0x58cc59[_0x6115('0x27')],'sectionId':_0x58cc59['id']},{})[_0x6115('0x20')](function(){return _0x48a946;});}else{return _0x48a946;}})[_0x6115('0x42')](function(_0x2e01a8){logger[_0x6115('0x26')](_0x6115('0x4f'),_0x2e01a8);throw _0x2e01a8;});}return _0x48a946;})['then'](respondWithResult(_0x30f199,0xc9))[_0x6115('0x42')](handleError(_0x30f199,null));};exports[_0x6115('0x50')]=function(_0x1b05cd,_0x5901d2){if(_0x1b05cd[_0x6115('0x51')]['id']){delete _0x1b05cd[_0x6115('0x51')]['id'];}return db[_0x6115('0x29')][_0x6115('0x48')]({'where':{'id':_0x1b05cd[_0x6115('0x44')]['id']}})[_0x6115('0x20')](handleEntityNotFound(_0x5901d2,null))[_0x6115('0x20')](saveUpdates(_0x1b05cd['body'],null))[_0x6115('0x20')](respondWithResult(_0x5901d2,null))[_0x6115('0x42')](handleError(_0x5901d2,null));};exports[_0x6115('0x24')]=function(_0x3efbba,_0x2c261a){return db[_0x6115('0x29')][_0x6115('0x48')]({'where':{'id':_0x3efbba[_0x6115('0x44')]['id']}})[_0x6115('0x20')](handleEntityNotFound(_0x2c261a,null))[_0x6115('0x20')](removeEntity(_0x2c261a,null))[_0x6115('0x42')](handleError(_0x2c261a,null));};exports['test']=function(_0x21a1d5,_0x47e06b,_0x4e5bc5){var _0xd594d1;return db['SquareOdbc']['find']({'where':{'id':_0x21a1d5[_0x6115('0x44')]['id']},'attributes':['id',_0x6115('0x52')]})[_0x6115('0x20')](handleEntityNotFound(_0x47e06b,null))['then'](function(_0x1d8c30){if(_0x1d8c30){var _0x315d24=require(_0x6115('0x53'))();_0x315d24[_0x6115('0x54')](_0x1d8c30[_0x6115('0x52')]);_0x315d24['closeSync']();return _0x1d8c30;}})['then'](respondWithResult(_0x47e06b,null))[_0x6115('0x42')](handleError(_0x47e06b,null));};
\ No newline at end of file
+var _0xaec5=['map','type','options','includeAll','include','findAll','catch','show','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','test','openSync','dsn','closeSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','get','ODBC','UserProfileResource','sendStatus','error','stack','name','send','index','SquareOdbc','model','keys','query','filters','intersection','attributes','length','nolimit','sort','pick','filter','where','merge'];(function(_0xbaac95,_0x343742){var _0x5ad2b9=function(_0x5cf7a5){while(--_0x5cf7a5){_0xbaac95['push'](_0xbaac95['shift']());}};_0x5ad2b9(++_0x343742);}(_0xaec5,0x67));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5aec('0x0'));var rimraf=require(_0x5aec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5aec('0x2'));var rp=require(_0x5aec('0x3'));var moment=require('moment');var BPromise=require(_0x5aec('0x4'));var Mustache=require(_0x5aec('0x5'));var util=require(_0x5aec('0x6'));var path=require(_0x5aec('0x7'));var sox=require(_0x5aec('0x8'));var csv=require('to-csv');var ejs=require(_0x5aec('0x9'));var fs=require('fs');var _=require(_0x5aec('0xa'));var squel=require(_0x5aec('0xb'));var crypto=require(_0x5aec('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5aec('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5aec('0xe'));var Papa=require(_0x5aec('0xf'));var Redis=require(_0x5aec('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5aec('0x11'));var logger=require('../../config/logger')(_0x5aec('0x12'));var utils=require(_0x5aec('0x13'));var config=require(_0x5aec('0x14'));var db=require(_0x5aec('0x15'))['db'];function respondWithStatusCode(_0xa0d9b5,_0x45bc81){_0x45bc81=_0x45bc81||0xcc;return function(_0x5c74b2){if(_0x5c74b2){return _0xa0d9b5['sendStatus'](_0x45bc81);}return _0xa0d9b5[_0x5aec('0x16')](_0x45bc81)[_0x5aec('0x17')]();};}function respondWithResult(_0x37f4d3,_0x7c60ee){_0x7c60ee=_0x7c60ee||0xc8;return function(_0x2e4099){if(_0x2e4099){return _0x37f4d3[_0x5aec('0x16')](_0x7c60ee)[_0x5aec('0x18')](_0x2e4099);}};}function respondWithFilteredResult(_0x42898c,_0x662fcd){return function(_0x5b19d3){if(_0x5b19d3){var _0x43c15e=_0x5b19d3[_0x5aec('0x19')],_0x25fab8=_0x662fcd[_0x5aec('0x1a')],_0x395a34=_0x662fcd[_0x5aec('0x1a')]+_0x662fcd[_0x5aec('0x1b')],_0x4a1fc5;if(_0x395a34>=_0x43c15e){_0x395a34=_0x43c15e;_0x4a1fc5=0xc8;}else{_0x4a1fc5=0xce;}_0x42898c['status'](_0x4a1fc5);return _0x42898c[_0x5aec('0x1c')](_0x5aec('0x1d'),_0x25fab8+'-'+_0x395a34+'/'+_0x43c15e)[_0x5aec('0x18')](_0x5b19d3);}return null;};}function patchUpdates(_0x3dca55){return function(_0x1d4700){try{jsonpatch['apply'](_0x1d4700,_0x3dca55,!![]);}catch(_0xa498e3){return BPromise[_0x5aec('0x1e')](_0xa498e3);}return _0x1d4700[_0x5aec('0x1f')]();};}function saveUpdates(_0x23451b,_0x50c8d3){return function(_0x2557d0){if(_0x2557d0){return _0x2557d0['update'](_0x23451b)['then'](function(_0x503ac8){return _0x503ac8;});}return null;};}function removeEntity(_0xcbd040,_0x56abf7){return function(_0xc479de){if(_0xc479de){return _0xc479de[_0x5aec('0x20')]()[_0x5aec('0x21')](function(){var _0xf9dffe=_0xc479de[_0x5aec('0x22')]({'plain':!![]});var _0x3cc7d3=_0x5aec('0x23');return db[_0x5aec('0x24')][_0x5aec('0x20')]({'where':{'type':_0x3cc7d3,'resourceId':_0xf9dffe['id']}})[_0x5aec('0x21')](function(){return _0xc479de;});})['then'](function(){_0xcbd040[_0x5aec('0x16')](0xcc)[_0x5aec('0x17')]();});}};}function handleEntityNotFound(_0x5787c4,_0x16d1df){return function(_0x2770e5){if(!_0x2770e5){_0x5787c4[_0x5aec('0x25')](0x194);}return _0x2770e5;};}function handleError(_0x1d6d0e,_0x4ebaeb){_0x4ebaeb=_0x4ebaeb||0x1f4;return function(_0x18ff79){logger[_0x5aec('0x26')](_0x18ff79[_0x5aec('0x27')]);if(_0x18ff79[_0x5aec('0x28')]){delete _0x18ff79[_0x5aec('0x28')];}_0x1d6d0e[_0x5aec('0x16')](_0x4ebaeb)[_0x5aec('0x29')](_0x18ff79);};}exports[_0x5aec('0x2a')]=function(_0x2570c2,_0x481402){var _0xa18fa4={},_0x4c725d={},_0x402d07={'count':0x0,'rows':[]};var _0x26fc82=db[_0x5aec('0x2b')]['rawAttributes'];_0x4c725d[_0x5aec('0x2c')]=_[_0x5aec('0x2d')](_0x26fc82);_0x4c725d[_0x5aec('0x2e')]=_[_0x5aec('0x2d')](_0x2570c2['query']);_0x4c725d[_0x5aec('0x2f')]=_[_0x5aec('0x30')](_0x4c725d[_0x5aec('0x2c')],_0x4c725d[_0x5aec('0x2e')]);_0xa18fa4['attributes']=_[_0x5aec('0x30')](_0x4c725d[_0x5aec('0x2c')],qs['fields'](_0x2570c2['query']['fields']));_0xa18fa4[_0x5aec('0x31')]=_0xa18fa4[_0x5aec('0x31')][_0x5aec('0x32')]?_0xa18fa4[_0x5aec('0x31')]:_0x4c725d[_0x5aec('0x2c')];if(!_0x2570c2[_0x5aec('0x2e')]['hasOwnProperty'](_0x5aec('0x33'))){_0xa18fa4[_0x5aec('0x1b')]=qs[_0x5aec('0x1b')](_0x2570c2['query'][_0x5aec('0x1b')]);_0xa18fa4[_0x5aec('0x1a')]=qs[_0x5aec('0x1a')](_0x2570c2[_0x5aec('0x2e')][_0x5aec('0x1a')]);}_0xa18fa4['order']=qs['sort'](_0x2570c2[_0x5aec('0x2e')][_0x5aec('0x34')]);_0xa18fa4['where']=qs[_0x5aec('0x2f')](_[_0x5aec('0x35')](_0x2570c2['query'],_0x4c725d[_0x5aec('0x2f')]));if(_0x2570c2[_0x5aec('0x2e')][_0x5aec('0x36')]){_0xa18fa4[_0x5aec('0x37')]=_[_0x5aec('0x38')](_0xa18fa4[_0x5aec('0x37')],{'$or':_[_0x5aec('0x39')](_0x26fc82,function(_0x4eb985){if(_0x4eb985[_0x5aec('0x3a')]['key']!=='VIRTUAL'){var _0x3c7145={};_0x3c7145[_0x4eb985['field']]={'$like':'%'+_0x2570c2[_0x5aec('0x2e')]['filter']+'%'};return _0x3c7145;}})});}_0xa18fa4=_[_0x5aec('0x38')]({},_0xa18fa4,_0x2570c2[_0x5aec('0x3b')]);var _0xf39fb1={'where':_0xa18fa4['where']};return db['SquareOdbc']['count'](_0xf39fb1)['then'](function(_0x11c728){_0x402d07[_0x5aec('0x19')]=_0x11c728;if(_0x2570c2[_0x5aec('0x2e')][_0x5aec('0x3c')]){_0xa18fa4[_0x5aec('0x3d')]=[{'all':!![]}];}return db[_0x5aec('0x2b')][_0x5aec('0x3e')](_0xa18fa4);})[_0x5aec('0x21')](function(_0x23ac5b){_0x402d07['rows']=_0x23ac5b;return _0x402d07;})[_0x5aec('0x21')](respondWithFilteredResult(_0x481402,_0xa18fa4))[_0x5aec('0x3f')](handleError(_0x481402,null));};exports[_0x5aec('0x40')]=function(_0x5abf4a,_0x5a8f8c){var _0x2aa3e4={'raw':!![],'where':{'id':_0x5abf4a['params']['id']}},_0x4a9bc6={};_0x4a9bc6[_0x5aec('0x2c')]=_[_0x5aec('0x2d')](db[_0x5aec('0x2b')][_0x5aec('0x41')]);_0x4a9bc6['query']=_[_0x5aec('0x2d')](_0x5abf4a['query']);_0x4a9bc6[_0x5aec('0x2f')]=_[_0x5aec('0x30')](_0x4a9bc6['model'],_0x4a9bc6['query']);_0x2aa3e4[_0x5aec('0x31')]=_[_0x5aec('0x30')](_0x4a9bc6[_0x5aec('0x2c')],qs[_0x5aec('0x42')](_0x5abf4a[_0x5aec('0x2e')]['fields']));_0x2aa3e4[_0x5aec('0x31')]=_0x2aa3e4[_0x5aec('0x31')]['length']?_0x2aa3e4[_0x5aec('0x31')]:_0x4a9bc6['model'];if(_0x5abf4a[_0x5aec('0x2e')][_0x5aec('0x3c')]){_0x2aa3e4[_0x5aec('0x3d')]=[{'all':!![]}];}_0x2aa3e4=_[_0x5aec('0x38')]({},_0x2aa3e4,_0x5abf4a['options']);return db[_0x5aec('0x2b')][_0x5aec('0x43')](_0x2aa3e4)[_0x5aec('0x21')](handleEntityNotFound(_0x5a8f8c,null))['then'](respondWithResult(_0x5a8f8c,null))[_0x5aec('0x3f')](handleError(_0x5a8f8c,null));};exports[_0x5aec('0x44')]=function(_0x4ab80e,_0x272055){return db[_0x5aec('0x2b')][_0x5aec('0x44')](_0x4ab80e[_0x5aec('0x45')],{})['then'](function(_0x5412ae){var _0x2eb0c5=_0x4ab80e[_0x5aec('0x46')][_0x5aec('0x22')]({'plain':!![]});if(!_0x2eb0c5)throw new Error(_0x5aec('0x47'));if(_0x2eb0c5[_0x5aec('0x48')]==='user'){var _0x6cbec4=_0x5412ae[_0x5aec('0x22')]({'plain':!![]});var _0x182c98='ODBC';return db[_0x5aec('0x49')][_0x5aec('0x43')]({'where':{'name':_0x182c98,'userProfileId':_0x2eb0c5['userProfileId']},'raw':!![]})['then'](function(_0x1b6ad0){if(_0x1b6ad0&&_0x1b6ad0[_0x5aec('0x4a')]===0x0){return db[_0x5aec('0x24')][_0x5aec('0x44')]({'name':_0x6cbec4[_0x5aec('0x28')],'resourceId':_0x6cbec4['id'],'type':_0x1b6ad0[_0x5aec('0x28')],'sectionId':_0x1b6ad0['id']},{})[_0x5aec('0x21')](function(){return _0x5412ae;});}else{return _0x5412ae;}})['catch'](function(_0x61f3d7){logger[_0x5aec('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x61f3d7);throw _0x61f3d7;});}return _0x5412ae;})[_0x5aec('0x21')](respondWithResult(_0x272055,0xc9))[_0x5aec('0x3f')](handleError(_0x272055,null));};exports['update']=function(_0x404386,_0x4fc132){if(_0x404386[_0x5aec('0x45')]['id']){delete _0x404386[_0x5aec('0x45')]['id'];}return db[_0x5aec('0x2b')][_0x5aec('0x43')]({'where':{'id':_0x404386[_0x5aec('0x4b')]['id']}})[_0x5aec('0x21')](handleEntityNotFound(_0x4fc132,null))[_0x5aec('0x21')](saveUpdates(_0x404386[_0x5aec('0x45')],null))[_0x5aec('0x21')](respondWithResult(_0x4fc132,null))['catch'](handleError(_0x4fc132,null));};exports[_0x5aec('0x20')]=function(_0x355e00,_0x710f2d){return db['SquareOdbc'][_0x5aec('0x43')]({'where':{'id':_0x355e00[_0x5aec('0x4b')]['id']}})[_0x5aec('0x21')](handleEntityNotFound(_0x710f2d,null))[_0x5aec('0x21')](removeEntity(_0x710f2d,null))['catch'](handleError(_0x710f2d,null));};exports[_0x5aec('0x4c')]=function(_0x4e26ad,_0x52079c,_0x88edb2){var _0x27275b;return db[_0x5aec('0x2b')][_0x5aec('0x43')]({'where':{'id':_0x4e26ad[_0x5aec('0x4b')]['id']},'attributes':['id','dsn']})[_0x5aec('0x21')](handleEntityNotFound(_0x52079c,null))[_0x5aec('0x21')](function(_0xbec77f){if(_0xbec77f){var _0xc246f3=require('odbc')();_0xc246f3[_0x5aec('0x4d')](_0xbec77f[_0x5aec('0x4e')]);_0xc246f3[_0x5aec('0x4f')]();return _0xbec77f;}})[_0x5aec('0x21')](respondWithResult(_0x52079c,null))[_0x5aec('0x3f')](handleError(_0x52079c,null));};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js
index 580942c..17dda7e 100644
--- a/server/api/squareOdbc/squareOdbc.model.js
+++ b/server/api/squareOdbc/squareOdbc.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef83=['SquareOdbc','square_odbc','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define'];(function(_0x2e0a25,_0x2da7a6){var _0x359873=function(_0x47fb4b){while(--_0x47fb4b){_0x2e0a25['push'](_0x2e0a25['shift']());}};_0x359873(++_0x2da7a6);}(_0xef83,0x8e));var _0x3ef8=function(_0x23cfaf,_0x1d8545){_0x23cfaf=_0x23cfaf-0x0;var _0xf8af44=_0xef83[_0x23cfaf];return _0xf8af44;};'use strict';var _=require(_0x3ef8('0x0'));var util=require(_0x3ef8('0x1'));var logger=require('../../config/logger')(_0x3ef8('0x2'));var moment=require(_0x3ef8('0x3'));var BPromise=require(_0x3ef8('0x4'));var rp=require(_0x3ef8('0x5'));var fs=require('fs');var path=require(_0x3ef8('0x6'));var rimraf=require(_0x3ef8('0x7'));var config=require(_0x3ef8('0x8'));var attributes=require(_0x3ef8('0x9'));module[_0x3ef8('0xa')]=function(_0x4fc6ae,_0x323a95){return _0x4fc6ae[_0x3ef8('0xb')](_0x3ef8('0xc'),attributes,{'tableName':_0x3ef8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd23f=['SquareOdbc','square_odbc','util','api','moment','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xd23f,0xe6));var _0xfd23=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xd23f[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require('lodash');var util=require(_0xfd23('0x0'));var logger=require('../../config/logger')(_0xfd23('0x1'));var moment=require(_0xfd23('0x2'));var BPromise=require('bluebird');var rp=require(_0xfd23('0x3'));var fs=require('fs');var path=require(_0xfd23('0x4'));var rimraf=require(_0xfd23('0x5'));var config=require(_0xfd23('0x6'));var attributes=require(_0xfd23('0x7'));module[_0xfd23('0x8')]=function(_0x4aa248,_0x5eb8c5){return _0x4aa248[_0xfd23('0x9')](_0xfd23('0xa'),attributes,{'tableName':_0xfd23('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js
index 06047b6..ca416e5 100644
--- a/server/api/squareOdbc/squareOdbc.rpc.js
+++ b/server/api/squareOdbc/squareOdbc.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xecc1=['request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','where','include','map','attributes','model','stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','info','SquareOdbc,\x20%s,\x20%s'];(function(_0x305da3,_0x4e4517){var _0x9a0b13=function(_0x2ca0e8){while(--_0x2ca0e8){_0x305da3['push'](_0x305da3['shift']());}};_0x9a0b13(++_0x4e4517);}(_0xecc1,0x129));var _0x1ecc=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0xecc1[_0xf26c2e];return _0x46ecb4;};'use strict';var _=require(_0x1ecc('0x0'));var util=require('util');var moment=require(_0x1ecc('0x1'));var BPromise=require(_0x1ecc('0x2'));var rs=require(_0x1ecc('0x3'));var fs=require('fs');var Redis=require(_0x1ecc('0x4'));var db=require(_0x1ecc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ecc('0x6'))(_0x1ecc('0x7'));var config=require('../../config/environment');var jayson=require(_0x1ecc('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25136e,_0x288756,_0x9cbcb3){return new BPromise(function(_0x20ab19,_0xdd040d){return client['request'](_0x25136e,_0x9cbcb3)['then'](function(_0x1db777){logger[_0x1ecc('0x9')](_0x1ecc('0xa'),_0x288756,_0x1ecc('0xb'));logger[_0x1ecc('0xc')](_0x1ecc('0xd'),_0x288756,_0x1ecc('0xb'),JSON['stringify'](_0x1db777));if(_0x1db777[_0x1ecc('0xe')]){if(_0x1db777[_0x1ecc('0xe')]['code']===0x1f4){logger['error'](_0x1ecc('0xa'),_0x288756,_0x1db777[_0x1ecc('0xe')]['message']);return _0xdd040d(_0x1db777[_0x1ecc('0xe')][_0x1ecc('0xf')]);}logger[_0x1ecc('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x288756,_0x1db777['error'][_0x1ecc('0xf')]);return _0x20ab19(_0x1db777['error'][_0x1ecc('0xf')]);}else{logger[_0x1ecc('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x288756,_0x1ecc('0xb'));_0x20ab19(_0x1db777[_0x1ecc('0x10')]['message']);}})['catch'](function(_0x33d8b4){logger[_0x1ecc('0xe')](_0x1ecc('0xa'),_0x288756,_0x33d8b4);_0xdd040d(_0x33d8b4);});});}exports[_0x1ecc('0x11')]=function(_0x3803f0){var _0x504d07=this;return new Promise(function(_0x5a6d64,_0xfa6b52){return db[_0x1ecc('0x12')][_0x1ecc('0x13')]({'raw':_0x3803f0[_0x1ecc('0x14')]?_0x3803f0['options']['raw']===undefined?!![]:![]:!![],'where':_0x3803f0['options']?_0x3803f0[_0x1ecc('0x14')][_0x1ecc('0x15')]||null:null,'attributes':_0x3803f0[_0x1ecc('0x14')]?_0x3803f0[_0x1ecc('0x14')]['attributes']||null:null,'include':_0x3803f0[_0x1ecc('0x14')]?_0x3803f0[_0x1ecc('0x14')][_0x1ecc('0x16')]?_[_0x1ecc('0x17')](_0x3803f0[_0x1ecc('0x14')][_0x1ecc('0x16')],function(_0x4e9459){return{'model':db[_0x4e9459['model']],'as':_0x4e9459['as'],'attributes':_0x4e9459[_0x1ecc('0x18')],'include':_0x4e9459['include']?_['map'](_0x4e9459['include'],function(_0x2ec80e){return{'model':db[_0x2ec80e[_0x1ecc('0x19')]],'as':_0x2ec80e['as'],'attributes':_0x2ec80e[_0x1ecc('0x18')],'include':_0x2ec80e[_0x1ecc('0x16')]?_[_0x1ecc('0x17')](_0x2ec80e['include'],function(_0x30e7a6){return{'model':db[_0x30e7a6[_0x1ecc('0x19')]],'as':_0x30e7a6['as'],'attributes':_0x30e7a6[_0x1ecc('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x556d88){logger['info']('ShowSquareOdbc',_0x3803f0);logger[_0x1ecc('0xc')]('ShowSquareOdbc',_0x3803f0,JSON[_0x1ecc('0x1a')](_0x556d88));_0x5a6d64(_0x556d88);})[_0x1ecc('0x1b')](function(_0x570194){logger[_0x1ecc('0xe')]('ShowSquareOdbc',_0x570194['message'],_0x3803f0);_0xfa6b52(_0x504d07['error'](0x1f4,_0x570194['message']));});});};
\ No newline at end of file
+var _0xe707=['lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','error','message','info','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map','model','attributes'];(function(_0x3cf387,_0x31ed26){var _0x24425f=function(_0x500fc6){while(--_0x500fc6){_0x3cf387['push'](_0x3cf387['shift']());}};_0x24425f(++_0x31ed26);}(_0xe707,0x16c));var _0x7e70=function(_0x114282,_0x903c22){_0x114282=_0x114282-0x0;var _0xda699c=_0xe707[_0x114282];return _0xda699c;};'use strict';var _=require(_0x7e70('0x0'));var util=require(_0x7e70('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7e70('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e70('0x3'))['db'];var utils=require(_0x7e70('0x4'));var logger=require(_0x7e70('0x5'))(_0x7e70('0x6'));var config=require('../../config/environment');var jayson=require(_0x7e70('0x7'));var client=jayson[_0x7e70('0x8')][_0x7e70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x300532,_0x161b84,_0x4b5f5e){return new BPromise(function(_0x958a62,_0xe79997){return client[_0x7e70('0xa')](_0x300532,_0x4b5f5e)[_0x7e70('0xb')](function(_0xb4b4a9){logger['info'](_0x7e70('0xc'),_0x161b84,_0x7e70('0xd'));logger[_0x7e70('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x161b84,_0x7e70('0xd'),JSON['stringify'](_0xb4b4a9));if(_0xb4b4a9[_0x7e70('0xf')]){if(_0xb4b4a9[_0x7e70('0xf')]['code']===0x1f4){logger['error'](_0x7e70('0xc'),_0x161b84,_0xb4b4a9['error']['message']);return _0xe79997(_0xb4b4a9[_0x7e70('0xf')][_0x7e70('0x10')]);}logger[_0x7e70('0xf')](_0x7e70('0xc'),_0x161b84,_0xb4b4a9[_0x7e70('0xf')][_0x7e70('0x10')]);return _0x958a62(_0xb4b4a9['error'][_0x7e70('0x10')]);}else{logger[_0x7e70('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x161b84,_0x7e70('0xd'));_0x958a62(_0xb4b4a9['result'][_0x7e70('0x10')]);}})['catch'](function(_0x1e58df){logger['error'](_0x7e70('0xc'),_0x161b84,_0x1e58df);_0xe79997(_0x1e58df);});});}exports[_0x7e70('0x12')]=function(_0x2d4724){var _0x159b79=this;return new Promise(function(_0x68ee4c,_0x66d2d4){return db[_0x7e70('0x13')][_0x7e70('0x14')]({'raw':_0x2d4724[_0x7e70('0x15')]?_0x2d4724[_0x7e70('0x15')][_0x7e70('0x16')]===undefined?!![]:![]:!![],'where':_0x2d4724['options']?_0x2d4724[_0x7e70('0x15')][_0x7e70('0x17')]||null:null,'attributes':_0x2d4724[_0x7e70('0x15')]?_0x2d4724[_0x7e70('0x15')]['attributes']||null:null,'include':_0x2d4724[_0x7e70('0x15')]?_0x2d4724[_0x7e70('0x15')][_0x7e70('0x18')]?_[_0x7e70('0x19')](_0x2d4724[_0x7e70('0x15')][_0x7e70('0x18')],function(_0x3e2fb4){return{'model':db[_0x3e2fb4[_0x7e70('0x1a')]],'as':_0x3e2fb4['as'],'attributes':_0x3e2fb4[_0x7e70('0x1b')],'include':_0x3e2fb4[_0x7e70('0x18')]?_[_0x7e70('0x19')](_0x3e2fb4[_0x7e70('0x18')],function(_0x1d742e){return{'model':db[_0x1d742e['model']],'as':_0x1d742e['as'],'attributes':_0x1d742e[_0x7e70('0x1b')],'include':_0x1d742e[_0x7e70('0x18')]?_[_0x7e70('0x19')](_0x1d742e[_0x7e70('0x18')],function(_0x2d4e75){return{'model':db[_0x2d4e75[_0x7e70('0x1a')]],'as':_0x2d4e75['as'],'attributes':_0x2d4e75[_0x7e70('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7e70('0xb')](function(_0x505146){logger[_0x7e70('0x11')](_0x7e70('0x12'),_0x2d4724);logger[_0x7e70('0xe')](_0x7e70('0x12'),_0x2d4724,JSON['stringify'](_0x505146));_0x68ee4c(_0x505146);})['catch'](function(_0xf047c9){logger['error'](_0x7e70('0x12'),_0xf047c9[_0x7e70('0x10')],_0x2d4724);_0x66d2d4(_0x159b79[_0x7e70('0xf')](0x1f4,_0xf047c9['message']));});});};
\ No newline at end of file
diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js
index c29a1da..540a544 100644
--- a/server/api/squareProject/index.js
+++ b/server/api/squareProject/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8e9f=['/:id/users','getUsers','post','create','addUsers','put','update','/:id','destroy','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x8e9f,0x170));var _0xf8e9=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x8e9f[_0x3ea913];return _0x2b4f28;};'use strict';var multer=require(_0xf8e9('0x0'));var util=require(_0xf8e9('0x1'));var path=require('path');var timeout=require(_0xf8e9('0x2'));var express=require('express');var router=express[_0xf8e9('0x3')]();var auth=require(_0xf8e9('0x4'));var interaction=require(_0xf8e9('0x5'));var config=require(_0xf8e9('0x6'));var controller=require(_0xf8e9('0x7'));router[_0xf8e9('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf8e9('0x8')]('/:id',auth[_0xf8e9('0x9')](),controller['show']);router[_0xf8e9('0x8')](_0xf8e9('0xa'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0xb')]);router[_0xf8e9('0xc')]('/',auth['isAuthenticated'](),controller[_0xf8e9('0xd')]);router['post']('/:id/users',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0xe')]);router[_0xf8e9('0xf')]('/:id',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x10')]);router['delete'](_0xf8e9('0x11'),auth['isAuthenticated'](),controller[_0xf8e9('0x12')]);router[_0xf8e9('0x13')](_0xf8e9('0xa'),auth[_0xf8e9('0x9')](),controller['removeUsers']);module[_0xf8e9('0x14')]=router;
\ No newline at end of file
+var _0xc0b5=['put','update','delete','destroy','removeUsers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated','show','getUsers','post','/:id/users','addUsers'];(function(_0x41f33c,_0xdba0f5){var _0x3e8ee3=function(_0x249b09){while(--_0x249b09){_0x41f33c['push'](_0x41f33c['shift']());}};_0x3e8ee3(++_0xdba0f5);}(_0xc0b5,0xad));var _0x5c0b=function(_0x4566d6,_0x1c6214){_0x4566d6=_0x4566d6-0x0;var _0x4a0070=_0xc0b5[_0x4566d6];return _0x4a0070;};'use strict';var multer=require(_0x5c0b('0x0'));var util=require(_0x5c0b('0x1'));var path=require(_0x5c0b('0x2'));var timeout=require(_0x5c0b('0x3'));var express=require(_0x5c0b('0x4'));var router=express[_0x5c0b('0x5')]();var auth=require(_0x5c0b('0x6'));var interaction=require(_0x5c0b('0x7'));var config=require(_0x5c0b('0x8'));var controller=require(_0x5c0b('0x9'));router[_0x5c0b('0xa')]('/',auth['isAuthenticated'](),controller[_0x5c0b('0xb')]);router[_0x5c0b('0xa')](_0x5c0b('0xc'),auth[_0x5c0b('0xd')](),controller[_0x5c0b('0xe')]);router[_0x5c0b('0xa')]('/:id/users',auth[_0x5c0b('0xd')](),controller[_0x5c0b('0xf')]);router['post']('/',auth[_0x5c0b('0xd')](),controller['create']);router[_0x5c0b('0x10')](_0x5c0b('0x11'),auth['isAuthenticated'](),controller[_0x5c0b('0x12')]);router[_0x5c0b('0x13')]('/:id',auth[_0x5c0b('0xd')](),controller[_0x5c0b('0x14')]);router[_0x5c0b('0x15')]('/:id',auth[_0x5c0b('0xd')](),controller[_0x5c0b('0x16')]);router['delete']('/:id/users',auth[_0x5c0b('0xd')](),controller[_0x5c0b('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js
index 7c6fbed..dcf11de 100644
--- a/server/api/squareProject/squareProject.attributes.js
+++ b/server/api/squareProject/squareProject.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec46=['getDataValue','preproduction','utf8','production','toString','sequelize','exports','STRING','name','BLOB','long'];(function(_0x3482d8,_0x1bfebc){var _0x2eb94d=function(_0x17cfe2){while(--_0x17cfe2){_0x3482d8['push'](_0x3482d8['shift']());}};_0x2eb94d(++_0x1bfebc);}(_0xec46,0x19c));var _0x6ec4=function(_0x2b0d9d,_0x2f313f){_0x2b0d9d=_0x2b0d9d-0x0;var _0x482cc9=_0xec46[_0x2b0d9d];return _0x482cc9;};'use strict';var Sequelize=require(_0x6ec4('0x0'));module[_0x6ec4('0x1')]={'name':{'type':Sequelize[_0x6ec4('0x2')],'unique':_0x6ec4('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x6ec4('0x4')](_0x6ec4('0x5')),'get':function(){if(this[_0x6ec4('0x6')]('preproduction')){return this[_0x6ec4('0x6')](_0x6ec4('0x7'))['toString'](_0x6ec4('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x6ec4('0x5')),'get':function(){if(this[_0x6ec4('0x6')](_0x6ec4('0x9'))){return this[_0x6ec4('0x6')](_0x6ec4('0x9'))[_0x6ec4('0xa')](_0x6ec4('0x8'));}}}};
\ No newline at end of file
+var _0x3c94=['toString','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','utf8','production'];(function(_0x5eccca,_0x511b6d){var _0x27140e=function(_0x1cafc5){while(--_0x1cafc5){_0x5eccca['push'](_0x5eccca['shift']());}};_0x27140e(++_0x511b6d);}(_0x3c94,0xcd));var _0x43c9=function(_0x1135b1,_0x644ab2){_0x1135b1=_0x1135b1-0x0;var _0x387f6b=_0x3c94[_0x1135b1];return _0x387f6b;};'use strict';var Sequelize=require(_0x43c9('0x0'));module[_0x43c9('0x1')]={'name':{'type':Sequelize[_0x43c9('0x2')],'unique':_0x43c9('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x43c9('0x2')]},'notes':{'type':Sequelize[_0x43c9('0x4')]},'preproduction':{'type':Sequelize[_0x43c9('0x5')](_0x43c9('0x6')),'get':function(){if(this[_0x43c9('0x7')](_0x43c9('0x8'))){return this[_0x43c9('0x7')](_0x43c9('0x8'))['toString'](_0x43c9('0x9'));}}},'production':{'type':Sequelize[_0x43c9('0x5')](_0x43c9('0x6')),'get':function(){if(this[_0x43c9('0x7')](_0x43c9('0xa'))){return this[_0x43c9('0x7')](_0x43c9('0xa'))[_0x43c9('0xb')](_0x43c9('0x9'));}}}};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js
index 4ea6d13..84ca17c 100644
--- a/server/api/squareProject/squareProject.controller.js
+++ b/server/api/squareProject/squareProject.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe1c7=['omit','ids','isArray','userSquareProject:remove','emit','getUsers','findOne','User','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','./squareProject.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','UserProfileResource','error','stack','send','index','SquareProject','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','includeAll','include','findAll','show','params','options','find','catch','create','body','user','get','SquareProjects','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe1c7,0x67));var _0x7e1c=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0xe1c7[_0x421e36];return _0x20b3e3;};'use strict';var pdf=require(_0x7e1c('0x0'));var emlformat=require(_0x7e1c('0x1'));var rimraf=require(_0x7e1c('0x2'));var zipdir=require(_0x7e1c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e1c('0x4'));var moment=require(_0x7e1c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7e1c('0x6'));var util=require(_0x7e1c('0x7'));var path=require(_0x7e1c('0x8'));var sox=require(_0x7e1c('0x9'));var csv=require(_0x7e1c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e1c('0xb'));var squel=require(_0x7e1c('0xc'));var crypto=require(_0x7e1c('0xd'));var jsforce=require(_0x7e1c('0xe'));var deskjs=require(_0x7e1c('0xf'));var toCsv=require(_0x7e1c('0xa'));var querystring=require(_0x7e1c('0x10'));var Papa=require('papaparse');var Redis=require(_0x7e1c('0x11'));var authService=require(_0x7e1c('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e1c('0x13'))(_0x7e1c('0x14'));var utils=require(_0x7e1c('0x15'));var config=require(_0x7e1c('0x16'));var db=require('../../mysqldb')['db'];config[_0x7e1c('0x17')]=_['defaults'](config[_0x7e1c('0x17')],{'host':_0x7e1c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7e1c('0x19'))[_0x7e1c('0x1a')](socket);function respondWithStatusCode(_0x401e5a,_0x1c5263){_0x1c5263=_0x1c5263||0xcc;return function(_0x2e6f86){if(_0x2e6f86){return _0x401e5a[_0x7e1c('0x1b')](_0x1c5263);}return _0x401e5a[_0x7e1c('0x1c')](_0x1c5263)[_0x7e1c('0x1d')]();};}function respondWithResult(_0x75f91,_0x2ed1a0){_0x2ed1a0=_0x2ed1a0||0xc8;return function(_0x2c1828){if(_0x2c1828){return _0x75f91[_0x7e1c('0x1c')](_0x2ed1a0)['json'](_0x2c1828);}};}function respondWithFilteredResult(_0x2f4067,_0x501786){return function(_0x193711){if(_0x193711){var _0x23c256=_0x193711[_0x7e1c('0x1e')],_0x17de31=_0x501786['offset'],_0x584b2f=_0x501786[_0x7e1c('0x1f')]+_0x501786[_0x7e1c('0x20')],_0x1357cb;if(_0x584b2f>=_0x23c256){_0x584b2f=_0x23c256;_0x1357cb=0xc8;}else{_0x1357cb=0xce;}_0x2f4067[_0x7e1c('0x1c')](_0x1357cb);return _0x2f4067[_0x7e1c('0x21')](_0x7e1c('0x22'),_0x17de31+'-'+_0x584b2f+'/'+_0x23c256)[_0x7e1c('0x23')](_0x193711);}return null;};}function patchUpdates(_0x3c9bcb){return function(_0x238b97){try{jsonpatch[_0x7e1c('0x24')](_0x238b97,_0x3c9bcb,!![]);}catch(_0x1f525c){return BPromise[_0x7e1c('0x25')](_0x1f525c);}return _0x238b97[_0x7e1c('0x26')]();};}function saveUpdates(_0x598c4e,_0x424714){return function(_0x1ec2e2){if(_0x1ec2e2){return _0x1ec2e2['update'](_0x598c4e)[_0x7e1c('0x27')](function(_0xedf63c){return _0xedf63c;});}return null;};}function removeEntity(_0x326cc9,_0x744313){return function(_0x2b3115){if(_0x2b3115){return _0x2b3115[_0x7e1c('0x28')]()[_0x7e1c('0x27')](function(){var _0x43e2cb=_0x2b3115['get']({'plain':!![]});var _0x5396c5='SquareProjects';return db[_0x7e1c('0x29')]['destroy']({'where':{'type':_0x5396c5,'resourceId':_0x43e2cb['id']}})[_0x7e1c('0x27')](function(){return _0x2b3115;});})[_0x7e1c('0x27')](function(){_0x326cc9[_0x7e1c('0x1c')](0xcc)[_0x7e1c('0x1d')]();});}};}function handleEntityNotFound(_0x34837f,_0x13244e){return function(_0x231317){if(!_0x231317){_0x34837f[_0x7e1c('0x1b')](0x194);}return _0x231317;};}function handleError(_0x206285,_0x29ee42){_0x29ee42=_0x29ee42||0x1f4;return function(_0x11ebdf){logger[_0x7e1c('0x2a')](_0x11ebdf[_0x7e1c('0x2b')]);if(_0x11ebdf['name']){delete _0x11ebdf['name'];}_0x206285[_0x7e1c('0x1c')](_0x29ee42)[_0x7e1c('0x2c')](_0x11ebdf);};}exports[_0x7e1c('0x2d')]=function(_0x1ecc55,_0x58b4a0){var _0x3e274f={},_0x41d2d6={},_0x1cec9a={'count':0x0,'rows':[]};var _0x47ebc5=db[_0x7e1c('0x2e')][_0x7e1c('0x2f')];_0x41d2d6['model']=_['keys'](_0x47ebc5);_0x41d2d6[_0x7e1c('0x30')]=_[_0x7e1c('0x31')](_0x1ecc55['query']);_0x41d2d6[_0x7e1c('0x32')]=_['intersection'](_0x41d2d6[_0x7e1c('0x33')],_0x41d2d6[_0x7e1c('0x30')]);_0x3e274f[_0x7e1c('0x34')]=_[_0x7e1c('0x35')](_0x41d2d6[_0x7e1c('0x33')],qs['fields'](_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x36')]));_0x3e274f['attributes']=_0x3e274f[_0x7e1c('0x34')][_0x7e1c('0x37')]?_0x3e274f[_0x7e1c('0x34')]:_0x41d2d6[_0x7e1c('0x33')];if(!_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x38')](_0x7e1c('0x39'))){_0x3e274f['limit']=qs['limit'](_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x20')]);_0x3e274f['offset']=qs[_0x7e1c('0x1f')](_0x1ecc55[_0x7e1c('0x30')]['offset']);}_0x3e274f[_0x7e1c('0x3a')]=qs[_0x7e1c('0x3b')](_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x3b')]);_0x3e274f[_0x7e1c('0x3c')]=qs[_0x7e1c('0x32')](_[_0x7e1c('0x3d')](_0x1ecc55['query'],_0x41d2d6[_0x7e1c('0x32')]));if(_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x3e')]){_0x3e274f[_0x7e1c('0x3c')]=_[_0x7e1c('0x3f')](_0x3e274f[_0x7e1c('0x3c')],{'$or':_[_0x7e1c('0x40')](_0x47ebc5,function(_0x3b0fcb){if(_0x3b0fcb[_0x7e1c('0x41')]['key']!==_0x7e1c('0x42')){var _0x127759={};_0x127759[_0x3b0fcb[_0x7e1c('0x43')]]={'$like':'%'+_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x3e')]+'%'};return _0x127759;}})});}_0x3e274f=_[_0x7e1c('0x3f')]({},_0x3e274f,_0x1ecc55['options']);var _0x22c7f3={'where':_0x3e274f[_0x7e1c('0x3c')]};return db[_0x7e1c('0x2e')][_0x7e1c('0x1e')](_0x22c7f3)[_0x7e1c('0x27')](function(_0x23cbc2){_0x1cec9a[_0x7e1c('0x1e')]=_0x23cbc2;if(_0x1ecc55['query'][_0x7e1c('0x44')]){_0x3e274f[_0x7e1c('0x45')]=[{'all':!![]}];}return db['SquareProject'][_0x7e1c('0x46')](_0x3e274f);})[_0x7e1c('0x27')](function(_0x5ea775){_0x1cec9a['rows']=_0x5ea775;return _0x1cec9a;})[_0x7e1c('0x27')](respondWithFilteredResult(_0x58b4a0,_0x3e274f))['catch'](handleError(_0x58b4a0,null));};exports[_0x7e1c('0x47')]=function(_0x570326,_0x58c114){var _0x432f0e={'raw':![],'where':{'id':_0x570326[_0x7e1c('0x48')]['id']}},_0x4bd543={};_0x4bd543[_0x7e1c('0x33')]=_[_0x7e1c('0x31')](db['SquareProject'][_0x7e1c('0x2f')]);_0x4bd543[_0x7e1c('0x30')]=_[_0x7e1c('0x31')](_0x570326[_0x7e1c('0x30')]);_0x4bd543[_0x7e1c('0x32')]=_[_0x7e1c('0x35')](_0x4bd543[_0x7e1c('0x33')],_0x4bd543['query']);_0x432f0e['attributes']=_['intersection'](_0x4bd543[_0x7e1c('0x33')],qs[_0x7e1c('0x36')](_0x570326['query']['fields']));_0x432f0e[_0x7e1c('0x34')]=_0x432f0e[_0x7e1c('0x34')][_0x7e1c('0x37')]?_0x432f0e[_0x7e1c('0x34')]:_0x4bd543[_0x7e1c('0x33')];if(_0x570326[_0x7e1c('0x30')][_0x7e1c('0x44')]){_0x432f0e[_0x7e1c('0x45')]=[{'all':!![]}];}_0x432f0e=_[_0x7e1c('0x3f')]({},_0x432f0e,_0x570326[_0x7e1c('0x49')]);return db[_0x7e1c('0x2e')][_0x7e1c('0x4a')](_0x432f0e)[_0x7e1c('0x27')](handleEntityNotFound(_0x58c114,null))[_0x7e1c('0x27')](respondWithResult(_0x58c114,null))[_0x7e1c('0x4b')](handleError(_0x58c114,null));};exports[_0x7e1c('0x4c')]=function(_0x18d7cf,_0x214c44){return db['SquareProject'][_0x7e1c('0x4c')](_0x18d7cf[_0x7e1c('0x4d')],{})[_0x7e1c('0x27')](function(_0x547d39){var _0x5855cf=_0x18d7cf[_0x7e1c('0x4e')]['get']({'plain':!![]});if(!_0x5855cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5855cf['role']===_0x7e1c('0x4e')){var _0x341ca7=_0x547d39[_0x7e1c('0x4f')]({'plain':!![]});var _0x26bf5b=_0x7e1c('0x50');return db[_0x7e1c('0x51')][_0x7e1c('0x4a')]({'where':{'name':_0x26bf5b,'userProfileId':_0x5855cf[_0x7e1c('0x52')]},'raw':!![]})['then'](function(_0x285115){if(_0x285115&&_0x285115[_0x7e1c('0x53')]===0x0){return db[_0x7e1c('0x29')][_0x7e1c('0x4c')]({'name':_0x341ca7[_0x7e1c('0x54')],'resourceId':_0x341ca7['id'],'type':_0x285115[_0x7e1c('0x54')],'sectionId':_0x285115['id']},{})['then'](function(){return _0x547d39;});}else{return _0x547d39;}})['catch'](function(_0x3cf70e){logger[_0x7e1c('0x2a')](_0x7e1c('0x55'),_0x3cf70e);throw _0x3cf70e;});}return _0x547d39;})[_0x7e1c('0x27')](respondWithResult(_0x214c44,0xc9))[_0x7e1c('0x4b')](handleError(_0x214c44,null));};exports['update']=function(_0x36636b,_0x4384eb){if(_0x36636b[_0x7e1c('0x4d')]['id']){delete _0x36636b[_0x7e1c('0x4d')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x36636b[_0x7e1c('0x48')]['id']}})[_0x7e1c('0x27')](handleEntityNotFound(_0x4384eb,null))[_0x7e1c('0x27')](saveUpdates(_0x36636b[_0x7e1c('0x4d')],null))[_0x7e1c('0x27')](respondWithResult(_0x4384eb,null))[_0x7e1c('0x4b')](handleError(_0x4384eb,null));};exports['destroy']=function(_0x52dd3e,_0x252027){return db[_0x7e1c('0x2e')][_0x7e1c('0x4a')]({'where':{'id':_0x52dd3e[_0x7e1c('0x48')]['id']}})[_0x7e1c('0x27')](handleEntityNotFound(_0x252027,null))[_0x7e1c('0x27')](removeEntity(_0x252027,null))[_0x7e1c('0x4b')](handleError(_0x252027,null));};exports['addUsers']=function(_0x9b6c66,_0x5ef455,_0x411024){return db[_0x7e1c('0x2e')][_0x7e1c('0x4a')]({'where':{'id':_0x9b6c66[_0x7e1c('0x48')]['id']}})[_0x7e1c('0x27')](handleEntityNotFound(_0x5ef455,null))[_0x7e1c('0x27')](function(_0x52584f){if(_0x52584f){return _0x52584f[_0x7e1c('0x56')](_0x9b6c66[_0x7e1c('0x4d')]['ids'],_[_0x7e1c('0x57')](_0x9b6c66[_0x7e1c('0x4d')],['ids','id'])||{});}})[_0x7e1c('0x27')](respondWithResult(_0x5ef455,null))['catch'](handleError(_0x5ef455,null));};exports['removeUsers']=function(_0xb18358,_0x1e3b24,_0x32227e){return db['SquareProject'][_0x7e1c('0x4a')]({'where':{'id':_0xb18358[_0x7e1c('0x48')]['id']}})[_0x7e1c('0x27')](handleEntityNotFound(_0x1e3b24,null))[_0x7e1c('0x27')](function(_0x5c35d9){if(_0x5c35d9){return _0x5c35d9['removeUsers'](_0xb18358[_0x7e1c('0x30')][_0x7e1c('0x58')])[_0x7e1c('0x27')](function(){if(_[_0x7e1c('0x59')](_0xb18358['query'][_0x7e1c('0x58')])){for(var _0x3f2957=0x0;_0x3f2957<_0xb18358[_0x7e1c('0x30')][_0x7e1c('0x58')][_0x7e1c('0x37')];_0x3f2957+=0x1){socket['emit'](_0x7e1c('0x5a'),{'UserId':Number(_0xb18358[_0x7e1c('0x30')][_0x7e1c('0x58')][_0x3f2957]),'SquareProjectId':Number(_0xb18358[_0x7e1c('0x48')]['id'])});}}else{socket[_0x7e1c('0x5b')](_0x7e1c('0x5a'),{'UserId':Number(_0xb18358['query'][_0x7e1c('0x58')]),'SquareProjectId':Number(_0xb18358[_0x7e1c('0x48')]['id'])});}});}})[_0x7e1c('0x27')](respondWithStatusCode(_0x1e3b24,null))[_0x7e1c('0x4b')](handleError(_0x1e3b24,null));};exports[_0x7e1c('0x5c')]=function(_0x3d48db,_0x57e793,_0x4c81e1){var _0x4af3d6={};var _0x8e12ff={};var _0x2d72f1;var _0x4eb740;return db[_0x7e1c('0x2e')][_0x7e1c('0x5d')]({'where':{'id':_0x3d48db['params']['id']}})[_0x7e1c('0x27')](handleEntityNotFound(_0x57e793,null))[_0x7e1c('0x27')](function(_0x4762a7){if(_0x4762a7){_0x2d72f1=_0x4762a7;_0x8e12ff['model']=_['keys'](db[_0x7e1c('0x5e')][_0x7e1c('0x2f')]);_0x8e12ff['query']=_[_0x7e1c('0x31')](_0x3d48db[_0x7e1c('0x30')]);_0x8e12ff[_0x7e1c('0x32')]=_['intersection'](_0x8e12ff[_0x7e1c('0x33')],_0x8e12ff[_0x7e1c('0x30')]);_0x4af3d6[_0x7e1c('0x34')]=_[_0x7e1c('0x35')](_0x8e12ff[_0x7e1c('0x33')],qs[_0x7e1c('0x36')](_0x3d48db[_0x7e1c('0x30')][_0x7e1c('0x36')]));_0x4af3d6[_0x7e1c('0x34')]=_0x4af3d6[_0x7e1c('0x34')][_0x7e1c('0x37')]?_0x4af3d6[_0x7e1c('0x34')]:_0x8e12ff[_0x7e1c('0x33')];_0x4af3d6[_0x7e1c('0x3a')]=qs[_0x7e1c('0x3b')](_0x3d48db[_0x7e1c('0x30')][_0x7e1c('0x3b')]);_0x4af3d6[_0x7e1c('0x3c')]=qs[_0x7e1c('0x32')](_[_0x7e1c('0x3d')](_0x3d48db[_0x7e1c('0x30')],_0x8e12ff[_0x7e1c('0x32')]));if(_0x3d48db['query']['filter']){_0x4af3d6[_0x7e1c('0x3c')]=_[_0x7e1c('0x3f')](_0x4af3d6[_0x7e1c('0x3c')],{'$or':_[_0x7e1c('0x40')](_0x4af3d6[_0x7e1c('0x34')],function(_0x36f673){var _0x11c394={};_0x11c394[_0x36f673]={'$like':'%'+_0x3d48db[_0x7e1c('0x30')][_0x7e1c('0x3e')]+'%'};return _0x11c394;})});}_0x4af3d6=_['merge']({},_0x4af3d6,_0x3d48db[_0x7e1c('0x49')]);return _0x2d72f1[_0x7e1c('0x5c')](_0x4af3d6);}})[_0x7e1c('0x27')](function(_0x12348c){if(_0x12348c){_0x4eb740=_0x12348c[_0x7e1c('0x37')];if(!_0x3d48db[_0x7e1c('0x30')][_0x7e1c('0x38')]('nolimit')){_0x4af3d6[_0x7e1c('0x20')]=qs[_0x7e1c('0x20')](_0x3d48db['query']['limit']);_0x4af3d6[_0x7e1c('0x1f')]=qs[_0x7e1c('0x1f')](_0x3d48db[_0x7e1c('0x30')][_0x7e1c('0x1f')]);}return _0x2d72f1['getUsers'](_0x4af3d6);}})[_0x7e1c('0x27')](function(_0x5121ee){if(_0x5121ee){return _0x5121ee?{'count':_0x4eb740,'rows':_0x5121ee}:null;}})[_0x7e1c('0x27')](respondWithResult(_0x57e793,null))[_0x7e1c('0x4b')](handleError(_0x57e793,null));};
\ No newline at end of file
+var _0xc123=['destroy','SquareProjects','error','stack','name','index','SquareProject','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','field','options','includeAll','include','findAll','rows','catch','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','body','params','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','map','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','count','offset','set','Content-Range','apply','reject','save','update','then'];(function(_0x20eacd,_0x2394e2){var _0x57942a=function(_0xd86eda){while(--_0xd86eda){_0x20eacd['push'](_0x20eacd['shift']());}};_0x57942a(++_0x2394e2);}(_0xc123,0xff));var _0x3c12=function(_0x3778aa,_0x773090){_0x3778aa=_0x3778aa-0x0;var _0x4d4be8=_0xc123[_0x3778aa];return _0x4d4be8;};'use strict';var pdf=require(_0x3c12('0x0'));var emlformat=require(_0x3c12('0x1'));var rimraf=require(_0x3c12('0x2'));var zipdir=require(_0x3c12('0x3'));var jsonpatch=require(_0x3c12('0x4'));var rp=require(_0x3c12('0x5'));var moment=require(_0x3c12('0x6'));var BPromise=require(_0x3c12('0x7'));var Mustache=require(_0x3c12('0x8'));var util=require(_0x3c12('0x9'));var path=require(_0x3c12('0xa'));var sox=require(_0x3c12('0xb'));var csv=require(_0x3c12('0xc'));var ejs=require(_0x3c12('0xd'));var fs=require('fs');var _=require(_0x3c12('0xe'));var squel=require(_0x3c12('0xf'));var crypto=require(_0x3c12('0x10'));var jsforce=require(_0x3c12('0x11'));var deskjs=require(_0x3c12('0x12'));var toCsv=require(_0x3c12('0xc'));var querystring=require(_0x3c12('0x13'));var Papa=require('papaparse');var Redis=require(_0x3c12('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x3c12('0x15'));var hardwareService=require(_0x3c12('0x16'));var logger=require(_0x3c12('0x17'))(_0x3c12('0x18'));var utils=require(_0x3c12('0x19'));var config=require(_0x3c12('0x1a'));var db=require(_0x3c12('0x1b'))['db'];config[_0x3c12('0x1c')]=_[_0x3c12('0x1d')](config[_0x3c12('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x3c12('0x1e'))(new Redis(config[_0x3c12('0x1c')]));require(_0x3c12('0x1f'))[_0x3c12('0x20')](socket);function respondWithStatusCode(_0x1a05ee,_0x302a36){_0x302a36=_0x302a36||0xcc;return function(_0x4d5808){if(_0x4d5808){return _0x1a05ee[_0x3c12('0x21')](_0x302a36);}return _0x1a05ee['status'](_0x302a36)[_0x3c12('0x22')]();};}function respondWithResult(_0x33dd64,_0x4be71e){_0x4be71e=_0x4be71e||0xc8;return function(_0x4f2cc2){if(_0x4f2cc2){return _0x33dd64[_0x3c12('0x23')](_0x4be71e)['json'](_0x4f2cc2);}};}function respondWithFilteredResult(_0x5c2298,_0x555086){return function(_0x4561e0){if(_0x4561e0){var _0x392170=_0x4561e0[_0x3c12('0x24')],_0x22e85a=_0x555086[_0x3c12('0x25')],_0x595eae=_0x555086['offset']+_0x555086['limit'],_0x468d0f;if(_0x595eae>=_0x392170){_0x595eae=_0x392170;_0x468d0f=0xc8;}else{_0x468d0f=0xce;}_0x5c2298[_0x3c12('0x23')](_0x468d0f);return _0x5c2298[_0x3c12('0x26')](_0x3c12('0x27'),_0x22e85a+'-'+_0x595eae+'/'+_0x392170)['json'](_0x4561e0);}return null;};}function patchUpdates(_0x5817f0){return function(_0xa67d28){try{jsonpatch[_0x3c12('0x28')](_0xa67d28,_0x5817f0,!![]);}catch(_0x53e49a){return BPromise[_0x3c12('0x29')](_0x53e49a);}return _0xa67d28[_0x3c12('0x2a')]();};}function saveUpdates(_0x31e2b7,_0x50092b){return function(_0xd21ee0){if(_0xd21ee0){return _0xd21ee0[_0x3c12('0x2b')](_0x31e2b7)[_0x3c12('0x2c')](function(_0x3928ad){return _0x3928ad;});}return null;};}function removeEntity(_0x3b934f,_0x15d55a){return function(_0x327b8d){if(_0x327b8d){return _0x327b8d[_0x3c12('0x2d')]()['then'](function(){var _0x439433=_0x327b8d['get']({'plain':!![]});var _0x424f02=_0x3c12('0x2e');return db['UserProfileResource'][_0x3c12('0x2d')]({'where':{'type':_0x424f02,'resourceId':_0x439433['id']}})['then'](function(){return _0x327b8d;});})[_0x3c12('0x2c')](function(){_0x3b934f[_0x3c12('0x23')](0xcc)[_0x3c12('0x22')]();});}};}function handleEntityNotFound(_0x4fde97,_0x5586b3){return function(_0x1affee){if(!_0x1affee){_0x4fde97[_0x3c12('0x21')](0x194);}return _0x1affee;};}function handleError(_0x4b299d,_0x5da64b){_0x5da64b=_0x5da64b||0x1f4;return function(_0x4c6cc0){logger[_0x3c12('0x2f')](_0x4c6cc0[_0x3c12('0x30')]);if(_0x4c6cc0['name']){delete _0x4c6cc0[_0x3c12('0x31')];}_0x4b299d['status'](_0x5da64b)['send'](_0x4c6cc0);};}exports[_0x3c12('0x32')]=function(_0x4aca02,_0xfaa9ea){var _0x223ff8={},_0x2d5574={},_0x28a870={'count':0x0,'rows':[]};var _0x461bf6=db[_0x3c12('0x33')][_0x3c12('0x34')];_0x2d5574[_0x3c12('0x35')]=_['keys'](_0x461bf6);_0x2d5574[_0x3c12('0x36')]=_[_0x3c12('0x37')](_0x4aca02['query']);_0x2d5574[_0x3c12('0x38')]=_[_0x3c12('0x39')](_0x2d5574[_0x3c12('0x35')],_0x2d5574['query']);_0x223ff8[_0x3c12('0x3a')]=_[_0x3c12('0x39')](_0x2d5574[_0x3c12('0x35')],qs[_0x3c12('0x3b')](_0x4aca02[_0x3c12('0x36')][_0x3c12('0x3b')]));_0x223ff8[_0x3c12('0x3a')]=_0x223ff8['attributes'][_0x3c12('0x3c')]?_0x223ff8[_0x3c12('0x3a')]:_0x2d5574[_0x3c12('0x35')];if(!_0x4aca02[_0x3c12('0x36')][_0x3c12('0x3d')](_0x3c12('0x3e'))){_0x223ff8[_0x3c12('0x3f')]=qs[_0x3c12('0x3f')](_0x4aca02[_0x3c12('0x36')][_0x3c12('0x3f')]);_0x223ff8[_0x3c12('0x25')]=qs[_0x3c12('0x25')](_0x4aca02['query']['offset']);}_0x223ff8[_0x3c12('0x40')]=qs[_0x3c12('0x41')](_0x4aca02['query']['sort']);_0x223ff8[_0x3c12('0x42')]=qs[_0x3c12('0x38')](_[_0x3c12('0x43')](_0x4aca02['query'],_0x2d5574[_0x3c12('0x38')]));if(_0x4aca02[_0x3c12('0x36')][_0x3c12('0x44')]){_0x223ff8[_0x3c12('0x42')]=_[_0x3c12('0x45')](_0x223ff8[_0x3c12('0x42')],{'$or':_['map'](_0x461bf6,function(_0x25b3ab){if(_0x25b3ab[_0x3c12('0x46')][_0x3c12('0x47')]!=='VIRTUAL'){var _0x519859={};_0x519859[_0x25b3ab[_0x3c12('0x48')]]={'$like':'%'+_0x4aca02[_0x3c12('0x36')][_0x3c12('0x44')]+'%'};return _0x519859;}})});}_0x223ff8=_[_0x3c12('0x45')]({},_0x223ff8,_0x4aca02[_0x3c12('0x49')]);var _0x223731={'where':_0x223ff8[_0x3c12('0x42')]};return db['SquareProject'][_0x3c12('0x24')](_0x223731)[_0x3c12('0x2c')](function(_0xd0eabd){_0x28a870['count']=_0xd0eabd;if(_0x4aca02['query'][_0x3c12('0x4a')]){_0x223ff8[_0x3c12('0x4b')]=[{'all':!![]}];}return db['SquareProject'][_0x3c12('0x4c')](_0x223ff8);})[_0x3c12('0x2c')](function(_0x3cf681){_0x28a870[_0x3c12('0x4d')]=_0x3cf681;return _0x28a870;})[_0x3c12('0x2c')](respondWithFilteredResult(_0xfaa9ea,_0x223ff8))[_0x3c12('0x4e')](handleError(_0xfaa9ea,null));};exports['show']=function(_0x5c00fc,_0x1825cb){var _0x2e7a54={'raw':![],'where':{'id':_0x5c00fc['params']['id']}},_0x40e0dc={};_0x40e0dc[_0x3c12('0x35')]=_[_0x3c12('0x37')](db[_0x3c12('0x33')]['rawAttributes']);_0x40e0dc[_0x3c12('0x36')]=_[_0x3c12('0x37')](_0x5c00fc[_0x3c12('0x36')]);_0x40e0dc[_0x3c12('0x38')]=_[_0x3c12('0x39')](_0x40e0dc[_0x3c12('0x35')],_0x40e0dc['query']);_0x2e7a54[_0x3c12('0x3a')]=_['intersection'](_0x40e0dc[_0x3c12('0x35')],qs['fields'](_0x5c00fc[_0x3c12('0x36')][_0x3c12('0x3b')]));_0x2e7a54[_0x3c12('0x3a')]=_0x2e7a54['attributes'][_0x3c12('0x3c')]?_0x2e7a54[_0x3c12('0x3a')]:_0x40e0dc['model'];if(_0x5c00fc[_0x3c12('0x36')][_0x3c12('0x4a')]){_0x2e7a54[_0x3c12('0x4b')]=[{'all':!![]}];}_0x2e7a54=_['merge']({},_0x2e7a54,_0x5c00fc['options']);return db['SquareProject'][_0x3c12('0x4f')](_0x2e7a54)['then'](handleEntityNotFound(_0x1825cb,null))['then'](respondWithResult(_0x1825cb,null))[_0x3c12('0x4e')](handleError(_0x1825cb,null));};exports['create']=function(_0x47e25a,_0x33ad1f){return db[_0x3c12('0x33')][_0x3c12('0x50')](_0x47e25a['body'],{})[_0x3c12('0x2c')](function(_0x5c7a01){var _0x8fc2fe=_0x47e25a[_0x3c12('0x51')][_0x3c12('0x52')]({'plain':!![]});if(!_0x8fc2fe)throw new Error(_0x3c12('0x53'));if(_0x8fc2fe['role']===_0x3c12('0x51')){var _0x1248db=_0x5c7a01[_0x3c12('0x52')]({'plain':!![]});var _0x26fcdb=_0x3c12('0x2e');return db[_0x3c12('0x54')][_0x3c12('0x4f')]({'where':{'name':_0x26fcdb,'userProfileId':_0x8fc2fe[_0x3c12('0x55')]},'raw':!![]})['then'](function(_0x25e44c){if(_0x25e44c&&_0x25e44c['autoAssociation']===0x0){return db[_0x3c12('0x56')][_0x3c12('0x50')]({'name':_0x1248db['name'],'resourceId':_0x1248db['id'],'type':_0x25e44c['name'],'sectionId':_0x25e44c['id']},{})[_0x3c12('0x2c')](function(){return _0x5c7a01;});}else{return _0x5c7a01;}})['catch'](function(_0x1c3c43){logger[_0x3c12('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c3c43);throw _0x1c3c43;});}return _0x5c7a01;})['then'](respondWithResult(_0x33ad1f,0xc9))[_0x3c12('0x4e')](handleError(_0x33ad1f,null));};exports[_0x3c12('0x2b')]=function(_0x401133,_0x226427){if(_0x401133[_0x3c12('0x57')]['id']){delete _0x401133[_0x3c12('0x57')]['id'];}return db[_0x3c12('0x33')][_0x3c12('0x4f')]({'where':{'id':_0x401133[_0x3c12('0x58')]['id']}})[_0x3c12('0x2c')](handleEntityNotFound(_0x226427,null))['then'](saveUpdates(_0x401133[_0x3c12('0x57')],null))[_0x3c12('0x2c')](respondWithResult(_0x226427,null))['catch'](handleError(_0x226427,null));};exports[_0x3c12('0x2d')]=function(_0x103422,_0x112d78){return db[_0x3c12('0x33')]['find']({'where':{'id':_0x103422[_0x3c12('0x58')]['id']}})[_0x3c12('0x2c')](handleEntityNotFound(_0x112d78,null))[_0x3c12('0x2c')](removeEntity(_0x112d78,null))['catch'](handleError(_0x112d78,null));};exports['addUsers']=function(_0x5d52e1,_0x3ebb02,_0x49b01d){return db['SquareProject'][_0x3c12('0x4f')]({'where':{'id':_0x5d52e1[_0x3c12('0x58')]['id']}})['then'](handleEntityNotFound(_0x3ebb02,null))[_0x3c12('0x2c')](function(_0x543344){if(_0x543344){return _0x543344[_0x3c12('0x59')](_0x5d52e1[_0x3c12('0x57')]['ids'],_[_0x3c12('0x5a')](_0x5d52e1[_0x3c12('0x57')],[_0x3c12('0x5b'),'id'])||{});}})[_0x3c12('0x2c')](respondWithResult(_0x3ebb02,null))[_0x3c12('0x4e')](handleError(_0x3ebb02,null));};exports['removeUsers']=function(_0xfec1c5,_0x42a985,_0x437fe7){return db[_0x3c12('0x33')]['find']({'where':{'id':_0xfec1c5['params']['id']}})[_0x3c12('0x2c')](handleEntityNotFound(_0x42a985,null))[_0x3c12('0x2c')](function(_0x219188){if(_0x219188){return _0x219188[_0x3c12('0x5c')](_0xfec1c5[_0x3c12('0x36')][_0x3c12('0x5b')])[_0x3c12('0x2c')](function(){if(_[_0x3c12('0x5d')](_0xfec1c5['query'][_0x3c12('0x5b')])){for(var _0x2f1a86=0x0;_0x2f1a86<_0xfec1c5[_0x3c12('0x36')][_0x3c12('0x5b')][_0x3c12('0x3c')];_0x2f1a86+=0x1){socket[_0x3c12('0x5e')](_0x3c12('0x5f'),{'UserId':Number(_0xfec1c5[_0x3c12('0x36')][_0x3c12('0x5b')][_0x2f1a86]),'SquareProjectId':Number(_0xfec1c5[_0x3c12('0x58')]['id'])});}}else{socket[_0x3c12('0x5e')](_0x3c12('0x5f'),{'UserId':Number(_0xfec1c5[_0x3c12('0x36')]['ids']),'SquareProjectId':Number(_0xfec1c5[_0x3c12('0x58')]['id'])});}});}})[_0x3c12('0x2c')](respondWithStatusCode(_0x42a985,null))['catch'](handleError(_0x42a985,null));};exports[_0x3c12('0x60')]=function(_0x442a63,_0x2f267a,_0x15d4b2){var _0x428acb={};var _0x148cea={};var _0x4ceb96;var _0x137be3;return db[_0x3c12('0x33')][_0x3c12('0x61')]({'where':{'id':_0x442a63[_0x3c12('0x58')]['id']}})[_0x3c12('0x2c')](handleEntityNotFound(_0x2f267a,null))[_0x3c12('0x2c')](function(_0x1d6f0c){if(_0x1d6f0c){_0x4ceb96=_0x1d6f0c;_0x148cea['model']=_[_0x3c12('0x37')](db[_0x3c12('0x62')]['rawAttributes']);_0x148cea[_0x3c12('0x36')]=_[_0x3c12('0x37')](_0x442a63[_0x3c12('0x36')]);_0x148cea[_0x3c12('0x38')]=_[_0x3c12('0x39')](_0x148cea['model'],_0x148cea[_0x3c12('0x36')]);_0x428acb[_0x3c12('0x3a')]=_['intersection'](_0x148cea['model'],qs[_0x3c12('0x3b')](_0x442a63[_0x3c12('0x36')][_0x3c12('0x3b')]));_0x428acb['attributes']=_0x428acb[_0x3c12('0x3a')][_0x3c12('0x3c')]?_0x428acb['attributes']:_0x148cea[_0x3c12('0x35')];_0x428acb[_0x3c12('0x40')]=qs['sort'](_0x442a63[_0x3c12('0x36')][_0x3c12('0x41')]);_0x428acb[_0x3c12('0x42')]=qs[_0x3c12('0x38')](_[_0x3c12('0x43')](_0x442a63[_0x3c12('0x36')],_0x148cea[_0x3c12('0x38')]));if(_0x442a63[_0x3c12('0x36')][_0x3c12('0x44')]){_0x428acb[_0x3c12('0x42')]=_[_0x3c12('0x45')](_0x428acb[_0x3c12('0x42')],{'$or':_[_0x3c12('0x63')](_0x428acb[_0x3c12('0x3a')],function(_0x1b53c6){var _0x3174cb={};_0x3174cb[_0x1b53c6]={'$like':'%'+_0x442a63['query'][_0x3c12('0x44')]+'%'};return _0x3174cb;})});}_0x428acb=_[_0x3c12('0x45')]({},_0x428acb,_0x442a63[_0x3c12('0x49')]);return _0x4ceb96[_0x3c12('0x60')](_0x428acb);}})[_0x3c12('0x2c')](function(_0x495fb1){if(_0x495fb1){_0x137be3=_0x495fb1[_0x3c12('0x3c')];if(!_0x442a63['query'][_0x3c12('0x3d')](_0x3c12('0x3e'))){_0x428acb[_0x3c12('0x3f')]=qs[_0x3c12('0x3f')](_0x442a63[_0x3c12('0x36')][_0x3c12('0x3f')]);_0x428acb[_0x3c12('0x25')]=qs[_0x3c12('0x25')](_0x442a63[_0x3c12('0x36')][_0x3c12('0x25')]);}return _0x4ceb96[_0x3c12('0x60')](_0x428acb);}})['then'](function(_0x2407e3){if(_0x2407e3){return _0x2407e3?{'count':_0x137be3,'rows':_0x2407e3}:null;}})[_0x3c12('0x2c')](respondWithResult(_0x2f267a,null))['catch'](handleError(_0x2f267a,null));};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js
index efb6da4..597863a 100644
--- a/server/api/squareProject/squareProject.events.js
+++ b/server/api/squareProject/squareProject.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0fc7=['exports','../../mysqldb','SquareProject','save','remove','hasOwnProperty','hook'];(function(_0x37aa85,_0x39ceaf){var _0xfb9983=function(_0x444151){while(--_0x444151){_0x37aa85['push'](_0x37aa85['shift']());}};_0xfb9983(++_0x39ceaf);}(_0x0fc7,0xb0));var _0x70fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0fc7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x70fc('0x0'))['db'][_0x70fc('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x70fc('0x2'),'afterUpdate':'update','afterDestroy':_0x70fc('0x3')};function emitEvent(_0x29ee23){return function(_0x4dde0e,_0x29fdaa,_0x467379){SquareProjectEvents['emit'](_0x29ee23+':'+_0x4dde0e['id'],_0x4dde0e);SquareProjectEvents['emit'](_0x29ee23,_0x4dde0e);_0x467379(null);};}for(var e in events){if(events[_0x70fc('0x4')](e)){var event=events[e];SquareProject[_0x70fc('0x5')](e,emitEvent(event));}}module[_0x70fc('0x6')]=SquareProjectEvents;
\ No newline at end of file
+var _0x6988=['hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','remove','emit'];(function(_0x25f2e8,_0x5510fd){var _0x2e225a=function(_0x1198e6){while(--_0x1198e6){_0x25f2e8['push'](_0x25f2e8['shift']());}};_0x2e225a(++_0x5510fd);}(_0x6988,0x81));var _0x8698=function(_0x565291,_0x539d04){_0x565291=_0x565291-0x0;var _0x3cd9f1=_0x6988[_0x565291];return _0x3cd9f1;};'use strict';var EventEmitter=require(_0x8698('0x0'));var SquareProject=require(_0x8698('0x1'))['db'][_0x8698('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8698('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8698('0x4')};function emitEvent(_0x395ea1){return function(_0x388c2b,_0x246376,_0x47d069){SquareProjectEvents[_0x8698('0x5')](_0x395ea1+':'+_0x388c2b['id'],_0x388c2b);SquareProjectEvents['emit'](_0x395ea1,_0x388c2b);_0x47d069(null);};}for(var e in events){if(events[_0x8698('0x6')](e)){var event=events[e];SquareProject[_0x8698('0x7')](e,emitEvent(event));}}module[_0x8698('0x8')]=SquareProjectEvents;
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js
index 949f421..1aa7759 100644
--- a/server/api/squareProject/squareProject.model.js
+++ b/server/api/squareProject/squareProject.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xba04=['square_projects','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x57ba30,_0x26d7ba){var _0x26276d=function(_0x36b15c){while(--_0x36b15c){_0x57ba30['push'](_0x57ba30['shift']());}};_0x26276d(++_0x26d7ba);}(_0xba04,0x1e1));var _0x4ba0=function(_0x220d04,_0x2df8a1){_0x220d04=_0x220d04-0x0;var _0x2316fe=_0xba04[_0x220d04];return _0x2316fe;};'use strict';var _=require(_0x4ba0('0x0'));var util=require(_0x4ba0('0x1'));var logger=require(_0x4ba0('0x2'))(_0x4ba0('0x3'));var moment=require(_0x4ba0('0x4'));var BPromise=require(_0x4ba0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ba0('0x6'));var rimraf=require(_0x4ba0('0x7'));var config=require(_0x4ba0('0x8'));var attributes=require('./squareProject.attributes');module[_0x4ba0('0x9')]=function(_0x299e3c,_0xc8c1c5){return _0x299e3c[_0x4ba0('0xa')]('SquareProject',attributes,{'tableName':_0x4ba0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd079=['api','moment','bluebird','path','../../config/environment','./squareProject.attributes','exports','lodash','../../config/logger'];(function(_0xaec935,_0x5f3d12){var _0x28a8e1=function(_0x4ca7a1){while(--_0x4ca7a1){_0xaec935['push'](_0xaec935['shift']());}};_0x28a8e1(++_0x5f3d12);}(_0xd079,0x18a));var _0x9d07=function(_0x4acce7,_0x117865){_0x4acce7=_0x4acce7-0x0;var _0x2d69ee=_0xd079[_0x4acce7];return _0x2d69ee;};'use strict';var _=require(_0x9d07('0x0'));var util=require('util');var logger=require(_0x9d07('0x1'))(_0x9d07('0x2'));var moment=require(_0x9d07('0x3'));var BPromise=require(_0x9d07('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d07('0x5'));var rimraf=require('rimraf');var config=require(_0x9d07('0x6'));var attributes=require(_0x9d07('0x7'));module[_0x9d07('0x8')]=function(_0x546d9e,_0x319dda){return _0x546d9e['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js
index a58ca25..ef42360 100644
--- a/server/api/squareProject/squareProject.rpc.js
+++ b/server/api/squareProject/squareProject.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x3cae90,_0xff850b){var _0x4fe50e=function(_0x39be82){while(--_0x39be82){_0x3cae90['push'](_0x3cae90['shift']());}};_0x4fe50e(++_0xff850b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});};
\ No newline at end of file
+var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5e42f2,_0x18ed32){var _0x2ef04e=function(_0x5b5eab){while(--_0x5b5eab){_0x5e42f2['push'](_0x5e42f2['shift']());}};_0x2ef04e(++_0x18ed32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js
index a169bbc..fc92a4e 100644
--- a/server/api/squareProject/squareProject.socket.js
+++ b/server/api/squareProject/squareProject.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6b61=['update','emit','register','length','squareProject:','./squareProject.events','remove'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x6b61,0x16a));var _0x16b6=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x6b61[_0x3b96cf];return _0x2e315a;};'use strict';var SquareProjectEvents=require(_0x16b6('0x0'));var events=['save',_0x16b6('0x1'),_0x16b6('0x2')];function createListener(_0xbeab11,_0x2f73f2){return function(_0xffc401){_0x2f73f2[_0x16b6('0x3')](_0xbeab11,_0xffc401);};}function removeListener(_0x213f9e,_0x12ffdd){return function(){SquareProjectEvents['removeListener'](_0x213f9e,_0x12ffdd);};}exports[_0x16b6('0x4')]=function(_0x173c5d){for(var _0x594a8f=0x0,_0x3d06d6=events[_0x16b6('0x5')];_0x594a8f<_0x3d06d6;_0x594a8f++){var _0x59552d=events[_0x594a8f];var _0x460269=createListener(_0x16b6('0x6')+_0x59552d,_0x173c5d);SquareProjectEvents['on'](_0x59552d,_0x460269);}};
\ No newline at end of file
+var _0x057a=['length','squareProject:','./squareProject.events','save','remove','emit','removeListener'];(function(_0x2afb3a,_0x563228){var _0x382182=function(_0x4548b5){while(--_0x4548b5){_0x2afb3a['push'](_0x2afb3a['shift']());}};_0x382182(++_0x563228);}(_0x057a,0x1a6));var _0xa057=function(_0x2031f6,_0x30db44){_0x2031f6=_0x2031f6-0x0;var _0x125fed=_0x057a[_0x2031f6];return _0x125fed;};'use strict';var SquareProjectEvents=require(_0xa057('0x0'));var events=[_0xa057('0x1'),_0xa057('0x2'),'update'];function createListener(_0x139daf,_0x51a623){return function(_0x37ce08){_0x51a623[_0xa057('0x3')](_0x139daf,_0x37ce08);};}function removeListener(_0x5481b7,_0x2320cf){return function(){SquareProjectEvents[_0xa057('0x4')](_0x5481b7,_0x2320cf);};}exports['register']=function(_0x55b99c){for(var _0x466f7d=0x0,_0x395aca=events[_0xa057('0x5')];_0x466f7d<_0x395aca;_0x466f7d++){var _0x4509c6=events[_0x466f7d];var _0x3ca78d=createListener(_0xa057('0x6')+_0x4509c6,_0x55b99c);SquareProjectEvents['on'](_0x4509c6,_0x3ca78d);}};
\ No newline at end of file
diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js
index fcd84a6..ed08077 100644
--- a/server/api/squareRecording/index.js
+++ b/server/api/squareRecording/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a0f=['delete','exports','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','download','post','create','put'];(function(_0x21de93,_0x83f4a9){var _0x18952d=function(_0xa0f2e0){while(--_0xa0f2e0){_0x21de93['push'](_0x21de93['shift']());}};_0x18952d(++_0x83f4a9);}(_0x3a0f,0x145));var _0xf3a0=function(_0x9806fb,_0x52cd4d){_0x9806fb=_0x9806fb-0x0;var _0x173a7b=_0x3a0f[_0x9806fb];return _0x173a7b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf3a0('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf3a0('0x1')]();var auth=require(_0xf3a0('0x2'));var interaction=require(_0xf3a0('0x3'));var config=require(_0xf3a0('0x4'));var controller=require(_0xf3a0('0x5'));router[_0xf3a0('0x6')]('/',auth[_0xf3a0('0x7')](),controller[_0xf3a0('0x8')]);router['get'](_0xf3a0('0x9'),auth[_0xf3a0('0x7')](),controller[_0xf3a0('0xa')]);router[_0xf3a0('0x6')]('/:id/download',auth[_0xf3a0('0x7')](),controller[_0xf3a0('0xb')]);router[_0xf3a0('0xc')]('/',auth[_0xf3a0('0x7')](),controller[_0xf3a0('0xd')]);router[_0xf3a0('0xe')](_0xf3a0('0x9'),auth[_0xf3a0('0x7')](),controller['update']);router[_0xf3a0('0xf')](_0xf3a0('0x9'),auth[_0xf3a0('0x7')](),controller['destroy']);module[_0xf3a0('0x10')]=router;
\ No newline at end of file
+var _0x59c3=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','create','put','update','delete','destroy','exports','multer'];(function(_0xe26811,_0x34059d){var _0xc665e4=function(_0x59aec1){while(--_0x59aec1){_0xe26811['push'](_0xe26811['shift']());}};_0xc665e4(++_0x34059d);}(_0x59c3,0x133));var _0x359c=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x59c3[_0x28d18d];return _0x470640;};'use strict';var multer=require(_0x359c('0x0'));var util=require(_0x359c('0x1'));var path=require(_0x359c('0x2'));var timeout=require(_0x359c('0x3'));var express=require(_0x359c('0x4'));var router=express[_0x359c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x359c('0x6'));var config=require(_0x359c('0x7'));var controller=require(_0x359c('0x8'));router[_0x359c('0x9')]('/',auth[_0x359c('0xa')](),controller[_0x359c('0xb')]);router['get'](_0x359c('0xc'),auth['isAuthenticated'](),controller[_0x359c('0xd')]);router[_0x359c('0x9')](_0x359c('0xe'),auth[_0x359c('0xa')](),controller['download']);router[_0x359c('0xf')]('/',auth['isAuthenticated'](),controller[_0x359c('0x10')]);router[_0x359c('0x11')](_0x359c('0xc'),auth[_0x359c('0xa')](),controller[_0x359c('0x12')]);router[_0x359c('0x13')]('/:id',auth[_0x359c('0xa')](),controller[_0x359c('0x14')]);module[_0x359c('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js
index 2d7efd4..0d42858 100644
--- a/server/api/squareRecording/squareRecording.attributes.js
+++ b/server/api/squareRecording/squareRecording.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6814=['STRING','sequelize'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0x6814,0x113));var _0x4681=function(_0x5bc59c,_0x4ea9a5){_0x5bc59c=_0x5bc59c-0x0;var _0x3322d8=_0x6814[_0x5bc59c];return _0x3322d8;};'use strict';var Sequelize=require(_0x4681('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x4681('0x1')]},'calleridname':{'type':Sequelize[_0x4681('0x1')]},'context':{'type':Sequelize[_0x4681('0x1')]},'extension':{'type':Sequelize[_0x4681('0x1')]},'priority':{'type':Sequelize[_0x4681('0x1')]},'accountcode':{'type':Sequelize[_0x4681('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x4681('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4681('0x1')]},'savePath':{'type':Sequelize[_0x4681('0x1')]}};
\ No newline at end of file
+var _0xea4d=['exports','STRING','sequelize'];(function(_0x3fcfda,_0xa0bfeb){var _0x132ce0=function(_0x5d227b){while(--_0x5d227b){_0x3fcfda['push'](_0x3fcfda['shift']());}};_0x132ce0(++_0xa0bfeb);}(_0xea4d,0x18e));var _0xdea4=function(_0x3df381,_0x3317ca){_0x3df381=_0x3df381-0x0;var _0x961d91=_0xea4d[_0x3df381];return _0x961d91;};'use strict';var Sequelize=require(_0xdea4('0x0'));module[_0xdea4('0x1')]={'uniqueid':{'type':Sequelize[_0xdea4('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdea4('0x2')]},'context':{'type':Sequelize[_0xdea4('0x2')]},'extension':{'type':Sequelize[_0xdea4('0x2')]},'priority':{'type':Sequelize[_0xdea4('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xdea4('0x2')]},'savePath':{'type':Sequelize[_0xdea4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js
index fded558..c44658c 100644
--- a/server/api/squareRecording/squareRecording.controller.js
+++ b/server/api/squareRecording/squareRecording.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5ec6=['attributes','fields','length','nolimit','order','sort','pick','filter','where','map','type','VIRTUAL','field','options','SquareRecording','includeAll','include','findAll','rows','catch','params','merge','find','create','body','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection'];(function(_0x190e03,_0x2b861a){var _0x3cca82=function(_0x91a386){while(--_0x91a386){_0x190e03['push'](_0x190e03['shift']());}};_0x3cca82(++_0x2b861a);}(_0x5ec6,0x7f));var _0x65ec=function(_0x197d21,_0x481fcb){_0x197d21=_0x197d21-0x0;var _0x5b9aba=_0x5ec6[_0x197d21];return _0x5b9aba;};'use strict';var pdf=require(_0x65ec('0x0'));var emlformat=require(_0x65ec('0x1'));var rimraf=require(_0x65ec('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65ec('0x3'));var rp=require('request-promise');var moment=require(_0x65ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x65ec('0x5'));var util=require('util');var path=require(_0x65ec('0x6'));var sox=require('sox');var csv=require(_0x65ec('0x7'));var ejs=require(_0x65ec('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0x7'));var querystring=require(_0x65ec('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x65ec('0xe'));var logger=require(_0x65ec('0xf'))('api');var utils=require(_0x65ec('0x10'));var config=require(_0x65ec('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43f87a,_0x45cfb0){_0x45cfb0=_0x45cfb0||0xcc;return function(_0x53d62b){if(_0x53d62b){return _0x43f87a[_0x65ec('0x12')](_0x45cfb0);}return _0x43f87a[_0x65ec('0x13')](_0x45cfb0)[_0x65ec('0x14')]();};}function respondWithResult(_0x2b1c1a,_0x2c8314){_0x2c8314=_0x2c8314||0xc8;return function(_0x434e20){if(_0x434e20){return _0x2b1c1a[_0x65ec('0x13')](_0x2c8314)[_0x65ec('0x15')](_0x434e20);}};}function respondWithFilteredResult(_0x58c81f,_0x28be8b){return function(_0x3ed6f7){if(_0x3ed6f7){var _0x35d06b=_0x3ed6f7[_0x65ec('0x16')],_0x4bbe88=_0x28be8b[_0x65ec('0x17')],_0x5a0442=_0x28be8b['offset']+_0x28be8b[_0x65ec('0x18')],_0x25cdd4;if(_0x5a0442>=_0x35d06b){_0x5a0442=_0x35d06b;_0x25cdd4=0xc8;}else{_0x25cdd4=0xce;}_0x58c81f[_0x65ec('0x13')](_0x25cdd4);return _0x58c81f[_0x65ec('0x19')](_0x65ec('0x1a'),_0x4bbe88+'-'+_0x5a0442+'/'+_0x35d06b)[_0x65ec('0x15')](_0x3ed6f7);}return null;};}function patchUpdates(_0xd81ed3){return function(_0x37c494){try{jsonpatch[_0x65ec('0x1b')](_0x37c494,_0xd81ed3,!![]);}catch(_0x2127e2){return BPromise[_0x65ec('0x1c')](_0x2127e2);}return _0x37c494[_0x65ec('0x1d')]();};}function saveUpdates(_0x3a8cef,_0x2e9b1d){return function(_0x1467ac){if(_0x1467ac){return _0x1467ac[_0x65ec('0x1e')](_0x3a8cef)[_0x65ec('0x1f')](function(_0x15d4eb){return _0x15d4eb;});}return null;};}function removeEntity(_0x130d4e,_0x1326cc){return function(_0x4ff93c){if(_0x4ff93c){return _0x4ff93c[_0x65ec('0x20')]()[_0x65ec('0x1f')](function(){_0x130d4e[_0x65ec('0x13')](0xcc)[_0x65ec('0x14')]();});}};}function handleEntityNotFound(_0x1d60fb,_0x163e55){return function(_0x47288d){if(!_0x47288d){_0x1d60fb['sendStatus'](0x194);}return _0x47288d;};}function handleError(_0xf1ff97,_0xd598d2){_0xd598d2=_0xd598d2||0x1f4;return function(_0x13ac27){logger[_0x65ec('0x21')](_0x13ac27[_0x65ec('0x22')]);if(_0x13ac27[_0x65ec('0x23')]){delete _0x13ac27[_0x65ec('0x23')];}_0xf1ff97[_0x65ec('0x13')](_0xd598d2)[_0x65ec('0x24')](_0x13ac27);};}exports['index']=function(_0x10baef,_0x30f0cf){var _0x251831={},_0x23b1a3={},_0x4de451={'count':0x0,'rows':[]};var _0x3f98c9=db['SquareRecording'][_0x65ec('0x25')];_0x23b1a3[_0x65ec('0x26')]=_[_0x65ec('0x27')](_0x3f98c9);_0x23b1a3[_0x65ec('0x28')]=_[_0x65ec('0x27')](_0x10baef[_0x65ec('0x28')]);_0x23b1a3[_0x65ec('0x29')]=_[_0x65ec('0x2a')](_0x23b1a3[_0x65ec('0x26')],_0x23b1a3[_0x65ec('0x28')]);_0x251831[_0x65ec('0x2b')]=_['intersection'](_0x23b1a3['model'],qs[_0x65ec('0x2c')](_0x10baef['query'][_0x65ec('0x2c')]));_0x251831[_0x65ec('0x2b')]=_0x251831['attributes'][_0x65ec('0x2d')]?_0x251831[_0x65ec('0x2b')]:_0x23b1a3[_0x65ec('0x26')];if(!_0x10baef[_0x65ec('0x28')]['hasOwnProperty'](_0x65ec('0x2e'))){_0x251831[_0x65ec('0x18')]=qs[_0x65ec('0x18')](_0x10baef[_0x65ec('0x28')][_0x65ec('0x18')]);_0x251831[_0x65ec('0x17')]=qs[_0x65ec('0x17')](_0x10baef[_0x65ec('0x28')][_0x65ec('0x17')]);}_0x251831[_0x65ec('0x2f')]=qs['sort'](_0x10baef[_0x65ec('0x28')][_0x65ec('0x30')]);_0x251831['where']=qs[_0x65ec('0x29')](_[_0x65ec('0x31')](_0x10baef[_0x65ec('0x28')],_0x23b1a3[_0x65ec('0x29')]));if(_0x10baef[_0x65ec('0x28')][_0x65ec('0x32')]){_0x251831[_0x65ec('0x33')]=_['merge'](_0x251831[_0x65ec('0x33')],{'$or':_[_0x65ec('0x34')](_0x3f98c9,function(_0x40efca){if(_0x40efca[_0x65ec('0x35')]['key']!==_0x65ec('0x36')){var _0xaa4b9d={};_0xaa4b9d[_0x40efca[_0x65ec('0x37')]]={'$like':'%'+_0x10baef[_0x65ec('0x28')]['filter']+'%'};return _0xaa4b9d;}})});}_0x251831=_['merge']({},_0x251831,_0x10baef[_0x65ec('0x38')]);var _0x5cfe58={'where':_0x251831[_0x65ec('0x33')]};return db[_0x65ec('0x39')]['count'](_0x5cfe58)[_0x65ec('0x1f')](function(_0x1fbc2b){_0x4de451[_0x65ec('0x16')]=_0x1fbc2b;if(_0x10baef[_0x65ec('0x28')][_0x65ec('0x3a')]){_0x251831[_0x65ec('0x3b')]=[{'all':!![]}];}return db[_0x65ec('0x39')][_0x65ec('0x3c')](_0x251831);})[_0x65ec('0x1f')](function(_0x2ce56f){_0x4de451[_0x65ec('0x3d')]=_0x2ce56f;return _0x4de451;})['then'](respondWithFilteredResult(_0x30f0cf,_0x251831))[_0x65ec('0x3e')](handleError(_0x30f0cf,null));};exports['show']=function(_0x2654b2,_0x278d43){var _0x218e3f={'raw':!![],'where':{'id':_0x2654b2[_0x65ec('0x3f')]['id']}},_0x1bfc44={};_0x1bfc44[_0x65ec('0x26')]=_['keys'](db[_0x65ec('0x39')]['rawAttributes']);_0x1bfc44['query']=_[_0x65ec('0x27')](_0x2654b2[_0x65ec('0x28')]);_0x1bfc44[_0x65ec('0x29')]=_[_0x65ec('0x2a')](_0x1bfc44[_0x65ec('0x26')],_0x1bfc44['query']);_0x218e3f['attributes']=_[_0x65ec('0x2a')](_0x1bfc44[_0x65ec('0x26')],qs[_0x65ec('0x2c')](_0x2654b2[_0x65ec('0x28')][_0x65ec('0x2c')]));_0x218e3f['attributes']=_0x218e3f['attributes'][_0x65ec('0x2d')]?_0x218e3f[_0x65ec('0x2b')]:_0x1bfc44[_0x65ec('0x26')];if(_0x2654b2[_0x65ec('0x28')][_0x65ec('0x3a')]){_0x218e3f[_0x65ec('0x3b')]=[{'all':!![]}];}_0x218e3f=_[_0x65ec('0x40')]({},_0x218e3f,_0x2654b2['options']);return db[_0x65ec('0x39')][_0x65ec('0x41')](_0x218e3f)[_0x65ec('0x1f')](handleEntityNotFound(_0x278d43,null))['then'](respondWithResult(_0x278d43,null))[_0x65ec('0x3e')](handleError(_0x278d43,null));};exports[_0x65ec('0x42')]=function(_0x549c82,_0x11fa5f){return db[_0x65ec('0x39')][_0x65ec('0x42')](_0x549c82[_0x65ec('0x43')],{})[_0x65ec('0x1f')](respondWithResult(_0x11fa5f,0xc9))['catch'](handleError(_0x11fa5f,null));};exports[_0x65ec('0x1e')]=function(_0x3a5d81,_0x83305e){if(_0x3a5d81[_0x65ec('0x43')]['id']){delete _0x3a5d81['body']['id'];}return db[_0x65ec('0x39')]['find']({'where':{'id':_0x3a5d81[_0x65ec('0x3f')]['id']}})[_0x65ec('0x1f')](handleEntityNotFound(_0x83305e,null))[_0x65ec('0x1f')](saveUpdates(_0x3a5d81['body'],null))['then'](respondWithResult(_0x83305e,null))[_0x65ec('0x3e')](handleError(_0x83305e,null));};exports[_0x65ec('0x20')]=function(_0xf5419,_0x2111af){return db[_0x65ec('0x39')][_0x65ec('0x41')]({'where':{'id':_0xf5419[_0x65ec('0x3f')]['id']}})[_0x65ec('0x1f')](handleEntityNotFound(_0x2111af,null))[_0x65ec('0x1f')](removeEntity(_0x2111af,null))[_0x65ec('0x3e')](handleError(_0x2111af,null));};exports[_0x65ec('0x44')]=function(_0x4058e4,_0x2150bc,_0x308209){var _0x11d2d6=require(_0x65ec('0x45'));var _0x22c28c=![];var _0x5eb6d3={};if(_0x4058e4[_0x65ec('0x28')][_0x65ec('0x35')]&&_0x4058e4['query'][_0x65ec('0x35')]===_0x65ec('0x46')){_0x5eb6d3[_0x65ec('0x46')]=_0x4058e4['params']['id'];}else{_0x5eb6d3['id']=_0x4058e4[_0x65ec('0x3f')]['id'];}return db[_0x65ec('0x39')][_0x65ec('0x41')]({'where':_0x5eb6d3,'attributes':['id','savePath',_0x65ec('0x47')],'raw':!![]})['then'](handleEntityNotFound(_0x2150bc,null))['then'](function(_0x2b2af6){if(_0x2b2af6){var _0x8d0bae=_0x2b2af6[_0x65ec('0x48')];var _0x5cb107=util[_0x65ec('0x49')](_0x65ec('0x4a'),_0x8d0bae);if(fs[_0x65ec('0x4b')](_0x5cb107)){_0x22c28c=!![];return _0x11d2d6[_0x65ec('0x4c')](_0x5cb107,_0x8d0bae,config[_0x65ec('0x4d')][_0x65ec('0x4e')])[_0x65ec('0x1f')](function(){return _0x2b2af6;});}return _0x2b2af6;}})[_0x65ec('0x1f')](function(_0x462ed5){if(_0x462ed5){var _0x4b7658=_0x462ed5['savePath'];if(!fs[_0x65ec('0x4b')](_0x4b7658)){throw new db['Sequelize'][(_0x65ec('0x4f'))]('SquareRecording\x20not\x20found');}if(_0x462ed5[_0x65ec('0x47')]){return _0x2150bc[_0x65ec('0x44')](_0x4b7658,_0x462ed5[_0x65ec('0x47')]+path[_0x65ec('0x50')](_0x4b7658),function(){if(_0x22c28c){fs[_0x65ec('0x51')](_0x4b7658);}});}else{return _0x2150bc[_0x65ec('0x44')](_0x4b7658,function(_0x355c4c){if(_0x22c28c){fs['unlink'](_0x4b7658);}});}}})[_0x65ec('0x3e')](function(_0x474bc0){if(_0x474bc0[_0x65ec('0x52')]===_0x65ec('0x53')){_0x2150bc[_0x65ec('0x13')](0x194)['send'](_0x65ec('0x54'));}else{return handleError(_0x2150bc,null);}});};
\ No newline at end of file
+var _0x5eb8=['%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','Not\x20found','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','save','destroy','then','error','name','send','index','SquareRecording','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','length','options','find','create','body','download','savePath','format'];(function(_0x3ca7a1,_0x5ed7ac){var _0x529e3d=function(_0x4af657){while(--_0x4af657){_0x3ca7a1['push'](_0x3ca7a1['shift']());}};_0x529e3d(++_0x5ed7ac);}(_0x5eb8,0xb0));var _0x85eb=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0x5eb8[_0x383dbb];return _0x6e8bde;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x85eb('0x0'));var zipdir=require(_0x85eb('0x1'));var jsonpatch=require(_0x85eb('0x2'));var rp=require(_0x85eb('0x3'));var moment=require(_0x85eb('0x4'));var BPromise=require(_0x85eb('0x5'));var Mustache=require(_0x85eb('0x6'));var util=require(_0x85eb('0x7'));var path=require(_0x85eb('0x8'));var sox=require(_0x85eb('0x9'));var csv=require(_0x85eb('0xa'));var ejs=require(_0x85eb('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0xa'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var hardwareService=require(_0x85eb('0x13'));var logger=require(_0x85eb('0x14'))(_0x85eb('0x15'));var utils=require('../../config/utils');var config=require(_0x85eb('0x16'));var db=require(_0x85eb('0x17'))['db'];function respondWithStatusCode(_0x5c52a4,_0x2af376){_0x2af376=_0x2af376||0xcc;return function(_0x784583){if(_0x784583){return _0x5c52a4[_0x85eb('0x18')](_0x2af376);}return _0x5c52a4[_0x85eb('0x19')](_0x2af376)['end']();};}function respondWithResult(_0x548628,_0x394c74){_0x394c74=_0x394c74||0xc8;return function(_0x5c760a){if(_0x5c760a){return _0x548628[_0x85eb('0x19')](_0x394c74)[_0x85eb('0x1a')](_0x5c760a);}};}function respondWithFilteredResult(_0x600a7f,_0x1604ba){return function(_0x183b0c){if(_0x183b0c){var _0x49efdf=_0x183b0c[_0x85eb('0x1b')],_0x2e5c0a=_0x1604ba[_0x85eb('0x1c')],_0x59237b=_0x1604ba[_0x85eb('0x1c')]+_0x1604ba['limit'],_0x17140b;if(_0x59237b>=_0x49efdf){_0x59237b=_0x49efdf;_0x17140b=0xc8;}else{_0x17140b=0xce;}_0x600a7f['status'](_0x17140b);return _0x600a7f['set'](_0x85eb('0x1d'),_0x2e5c0a+'-'+_0x59237b+'/'+_0x49efdf)[_0x85eb('0x1a')](_0x183b0c);}return null;};}function patchUpdates(_0x10cf2f){return function(_0x2e986c){try{jsonpatch[_0x85eb('0x1e')](_0x2e986c,_0x10cf2f,!![]);}catch(_0x34f875){return BPromise['reject'](_0x34f875);}return _0x2e986c[_0x85eb('0x1f')]();};}function saveUpdates(_0x7244fc,_0xd9f06d){return function(_0x4e8041){if(_0x4e8041){return _0x4e8041['update'](_0x7244fc)['then'](function(_0x55b9e4){return _0x55b9e4;});}return null;};}function removeEntity(_0x244667,_0x3fa785){return function(_0x329fc5){if(_0x329fc5){return _0x329fc5[_0x85eb('0x20')]()[_0x85eb('0x21')](function(){_0x244667[_0x85eb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5491d5,_0x5b48d9){return function(_0x298e84){if(!_0x298e84){_0x5491d5[_0x85eb('0x18')](0x194);}return _0x298e84;};}function handleError(_0x3f7a4d,_0x28b87d){_0x28b87d=_0x28b87d||0x1f4;return function(_0x312b3e){logger[_0x85eb('0x22')](_0x312b3e['stack']);if(_0x312b3e[_0x85eb('0x23')]){delete _0x312b3e[_0x85eb('0x23')];}_0x3f7a4d[_0x85eb('0x19')](_0x28b87d)[_0x85eb('0x24')](_0x312b3e);};}exports[_0x85eb('0x25')]=function(_0x57a03c,_0x2e5aa3){var _0x792d3a={},_0x291557={},_0x3e7eb9={'count':0x0,'rows':[]};var _0x40f13e=db[_0x85eb('0x26')]['rawAttributes'];_0x291557['model']=_[_0x85eb('0x27')](_0x40f13e);_0x291557['query']=_[_0x85eb('0x27')](_0x57a03c['query']);_0x291557[_0x85eb('0x28')]=_[_0x85eb('0x29')](_0x291557[_0x85eb('0x2a')],_0x291557[_0x85eb('0x2b')]);_0x792d3a[_0x85eb('0x2c')]=_[_0x85eb('0x29')](_0x291557[_0x85eb('0x2a')],qs['fields'](_0x57a03c[_0x85eb('0x2b')][_0x85eb('0x2d')]));_0x792d3a['attributes']=_0x792d3a[_0x85eb('0x2c')]['length']?_0x792d3a['attributes']:_0x291557[_0x85eb('0x2a')];if(!_0x57a03c[_0x85eb('0x2b')][_0x85eb('0x2e')](_0x85eb('0x2f'))){_0x792d3a[_0x85eb('0x30')]=qs[_0x85eb('0x30')](_0x57a03c[_0x85eb('0x2b')][_0x85eb('0x30')]);_0x792d3a[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x57a03c['query'][_0x85eb('0x1c')]);}_0x792d3a[_0x85eb('0x31')]=qs['sort'](_0x57a03c['query'][_0x85eb('0x32')]);_0x792d3a[_0x85eb('0x33')]=qs[_0x85eb('0x28')](_[_0x85eb('0x34')](_0x57a03c[_0x85eb('0x2b')],_0x291557[_0x85eb('0x28')]));if(_0x57a03c[_0x85eb('0x2b')][_0x85eb('0x35')]){_0x792d3a[_0x85eb('0x33')]=_[_0x85eb('0x36')](_0x792d3a[_0x85eb('0x33')],{'$or':_[_0x85eb('0x37')](_0x40f13e,function(_0x317d86){if(_0x317d86[_0x85eb('0x38')]['key']!==_0x85eb('0x39')){var _0x3dfe74={};_0x3dfe74[_0x317d86['field']]={'$like':'%'+_0x57a03c['query'][_0x85eb('0x35')]+'%'};return _0x3dfe74;}})});}_0x792d3a=_[_0x85eb('0x36')]({},_0x792d3a,_0x57a03c['options']);var _0x4317bc={'where':_0x792d3a['where']};return db[_0x85eb('0x26')]['count'](_0x4317bc)[_0x85eb('0x21')](function(_0x5ce7e4){_0x3e7eb9[_0x85eb('0x1b')]=_0x5ce7e4;if(_0x57a03c['query'][_0x85eb('0x3a')]){_0x792d3a[_0x85eb('0x3b')]=[{'all':!![]}];}return db['SquareRecording'][_0x85eb('0x3c')](_0x792d3a);})['then'](function(_0x2a6baa){_0x3e7eb9[_0x85eb('0x3d')]=_0x2a6baa;return _0x3e7eb9;})['then'](respondWithFilteredResult(_0x2e5aa3,_0x792d3a))[_0x85eb('0x3e')](handleError(_0x2e5aa3,null));};exports['show']=function(_0x5495cf,_0x1b8a71){var _0x4edb2d={'raw':!![],'where':{'id':_0x5495cf[_0x85eb('0x3f')]['id']}},_0x17cc20={};_0x17cc20['model']=_['keys'](db[_0x85eb('0x26')][_0x85eb('0x40')]);_0x17cc20['query']=_['keys'](_0x5495cf[_0x85eb('0x2b')]);_0x17cc20[_0x85eb('0x28')]=_[_0x85eb('0x29')](_0x17cc20[_0x85eb('0x2a')],_0x17cc20[_0x85eb('0x2b')]);_0x4edb2d['attributes']=_[_0x85eb('0x29')](_0x17cc20[_0x85eb('0x2a')],qs[_0x85eb('0x2d')](_0x5495cf[_0x85eb('0x2b')][_0x85eb('0x2d')]));_0x4edb2d[_0x85eb('0x2c')]=_0x4edb2d[_0x85eb('0x2c')][_0x85eb('0x41')]?_0x4edb2d[_0x85eb('0x2c')]:_0x17cc20['model'];if(_0x5495cf[_0x85eb('0x2b')][_0x85eb('0x3a')]){_0x4edb2d['include']=[{'all':!![]}];}_0x4edb2d=_[_0x85eb('0x36')]({},_0x4edb2d,_0x5495cf[_0x85eb('0x42')]);return db[_0x85eb('0x26')][_0x85eb('0x43')](_0x4edb2d)[_0x85eb('0x21')](handleEntityNotFound(_0x1b8a71,null))[_0x85eb('0x21')](respondWithResult(_0x1b8a71,null))['catch'](handleError(_0x1b8a71,null));};exports[_0x85eb('0x44')]=function(_0x1258bc,_0x1ead1d){return db[_0x85eb('0x26')][_0x85eb('0x44')](_0x1258bc[_0x85eb('0x45')],{})[_0x85eb('0x21')](respondWithResult(_0x1ead1d,0xc9))[_0x85eb('0x3e')](handleError(_0x1ead1d,null));};exports['update']=function(_0x1298d4,_0x26b226){if(_0x1298d4[_0x85eb('0x45')]['id']){delete _0x1298d4[_0x85eb('0x45')]['id'];}return db[_0x85eb('0x26')][_0x85eb('0x43')]({'where':{'id':_0x1298d4[_0x85eb('0x3f')]['id']}})[_0x85eb('0x21')](handleEntityNotFound(_0x26b226,null))[_0x85eb('0x21')](saveUpdates(_0x1298d4[_0x85eb('0x45')],null))[_0x85eb('0x21')](respondWithResult(_0x26b226,null))[_0x85eb('0x3e')](handleError(_0x26b226,null));};exports['destroy']=function(_0x11da79,_0x2c951b){return db[_0x85eb('0x26')]['find']({'where':{'id':_0x11da79[_0x85eb('0x3f')]['id']}})[_0x85eb('0x21')](handleEntityNotFound(_0x2c951b,null))[_0x85eb('0x21')](removeEntity(_0x2c951b,null))[_0x85eb('0x3e')](handleError(_0x2c951b,null));};exports[_0x85eb('0x46')]=function(_0x4a7506,_0x2ef4d1,_0x12c4cc){var _0x458e93=require('../../components/encryptor');var _0xc5cb43=![];var _0x4550fd={};if(_0x4a7506[_0x85eb('0x2b')]['type']&&_0x4a7506['query'][_0x85eb('0x38')]==='uniqueid'){_0x4550fd['uniqueid']=_0x4a7506[_0x85eb('0x3f')]['id'];}else{_0x4550fd['id']=_0x4a7506['params']['id'];}return db[_0x85eb('0x26')][_0x85eb('0x43')]({'where':_0x4550fd,'attributes':['id','savePath','filename'],'raw':!![]})[_0x85eb('0x21')](handleEntityNotFound(_0x2ef4d1,null))[_0x85eb('0x21')](function(_0x178d76){if(_0x178d76){var _0x40d64d=_0x178d76[_0x85eb('0x47')];var _0x49cef1=util[_0x85eb('0x48')](_0x85eb('0x49'),_0x40d64d);if(fs[_0x85eb('0x4a')](_0x49cef1)){_0xc5cb43=!![];return _0x458e93[_0x85eb('0x4b')](_0x49cef1,_0x40d64d,config[_0x85eb('0x4c')]['recording'])[_0x85eb('0x21')](function(){return _0x178d76;});}return _0x178d76;}})['then'](function(_0xd2e792){if(_0xd2e792){var _0x40d846=_0xd2e792['savePath'];if(!fs[_0x85eb('0x4a')](_0x40d846)){throw new db[(_0x85eb('0x4d'))][(_0x85eb('0x4e'))](_0x85eb('0x4f'));}if(_0xd2e792[_0x85eb('0x50')]){return _0x2ef4d1[_0x85eb('0x46')](_0x40d846,_0xd2e792['filename']+path[_0x85eb('0x51')](_0x40d846),function(){if(_0xc5cb43){fs['unlink'](_0x40d846);}});}else{return _0x2ef4d1[_0x85eb('0x46')](_0x40d846,function(_0x20f4b3){if(_0xc5cb43){fs['unlink'](_0x40d846);}});}}})[_0x85eb('0x3e')](function(_0x2a0f8b){if(_0x2a0f8b['message']===_0x85eb('0x4f')){_0x2ef4d1['status'](0x194)[_0x85eb('0x24')](_0x85eb('0x52'));}else{return handleError(_0x2ef4d1,null);}});};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js
index 77a582c..b9edb2b 100644
--- a/server/api/squareRecording/squareRecording.model.js
+++ b/server/api/squareRecording/squareRecording.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6dda=['path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','../../config/logger','moment'];(function(_0x1a5c5f,_0x38f990){var _0x589676=function(_0x5814a6){while(--_0x5814a6){_0x1a5c5f['push'](_0x1a5c5f['shift']());}};_0x589676(++_0x38f990);}(_0x6dda,0x80));var _0xa6dd=function(_0x510ee2,_0x3b9cfa){_0x510ee2=_0x510ee2-0x0;var _0x19ba14=_0x6dda[_0x510ee2];return _0x19ba14;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa6dd('0x0'))('api');var moment=require(_0xa6dd('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6dd('0x2'));var rimraf=require(_0xa6dd('0x3'));var config=require(_0xa6dd('0x4'));var attributes=require(_0xa6dd('0x5'));module[_0xa6dd('0x6')]=function(_0x314f6e,_0x530edc){return _0x314f6e[_0xa6dd('0x7')](_0xa6dd('0x8'),attributes,{'tableName':_0xa6dd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f58=['exports','define','SquareRecording','square_recordings','lodash','api','bluebird','rimraf','../../config/environment'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x9f58,0x1d8));var _0x89f5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9f58[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x89f5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x89f5('0x1'));var moment=require('moment');var BPromise=require(_0x89f5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x89f5('0x3'));var config=require(_0x89f5('0x4'));var attributes=require('./squareRecording.attributes');module[_0x89f5('0x5')]=function(_0x592340,_0x4c9c66){return _0x592340[_0x89f5('0x6')](_0x89f5('0x7'),attributes,{'tableName':_0x89f5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js
index 19d1cba..2bdce2e 100644
--- a/server/api/squareRecording/squareRecording.rpc.js
+++ b/server/api/squareRecording/squareRecording.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e9f=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareRecording,\x20%s,\x20%s','catch','CreateSquareRecording','create','body','options'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2e9f,0x6e));var _0xf2e9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2e9f[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf2e9('0x0'));var BPromise=require(_0xf2e9('0x1'));var rs=require(_0xf2e9('0x2'));var fs=require('fs');var Redis=require(_0xf2e9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2e9('0x4'));var logger=require('../../config/logger')(_0xf2e9('0x5'));var config=require(_0xf2e9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf2e9('0x7')][_0xf2e9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33484a,_0x9577be,_0x5f2dd0){return new BPromise(function(_0x37a68f,_0x50133f){return client['request'](_0x33484a,_0x5f2dd0)['then'](function(_0x1a8054){logger[_0xf2e9('0x9')]('SquareRecording,\x20%s,\x20%s',_0x9577be,_0xf2e9('0xa'));logger[_0xf2e9('0xb')](_0xf2e9('0xc'),_0x9577be,_0xf2e9('0xa'),JSON[_0xf2e9('0xd')](_0x1a8054));if(_0x1a8054['error']){if(_0x1a8054['error']['code']===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x9577be,_0x1a8054[_0xf2e9('0xe')]['message']);return _0x50133f(_0x1a8054[_0xf2e9('0xe')][_0xf2e9('0xf')]);}logger[_0xf2e9('0xe')](_0xf2e9('0x10'),_0x9577be,_0x1a8054['error'][_0xf2e9('0xf')]);return _0x37a68f(_0x1a8054[_0xf2e9('0xe')][_0xf2e9('0xf')]);}else{logger[_0xf2e9('0x9')](_0xf2e9('0x10'),_0x9577be,_0xf2e9('0xa'));_0x37a68f(_0x1a8054['result']['message']);}})[_0xf2e9('0x11')](function(_0x1ee2af){logger[_0xf2e9('0xe')](_0xf2e9('0x10'),_0x9577be,_0x1ee2af);_0x50133f(_0x1ee2af);});});}exports[_0xf2e9('0x12')]=function(_0x4147cf){var _0x3c283a=this;return new Promise(function(_0x28fc5a,_0x9ca7c4){return db['SquareRecording'][_0xf2e9('0x13')](_0x4147cf[_0xf2e9('0x14')],{'raw':_0x4147cf[_0xf2e9('0x15')]?_0x4147cf[_0xf2e9('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1c8a15){logger[_0xf2e9('0x9')](_0xf2e9('0x12'),_0x4147cf);logger[_0xf2e9('0xb')](_0xf2e9('0x12'),_0x4147cf,JSON[_0xf2e9('0xd')](_0x1c8a15));_0x28fc5a(_0x1c8a15);})[_0xf2e9('0x11')](function(_0x117778){logger[_0xf2e9('0xe')](_0xf2e9('0x12'),_0x117778['message'],_0x4147cf);_0x9ca7c4(_0x3c283a[_0xf2e9('0xe')](0x1f4,_0x117778[_0xf2e9('0xf')]));});});};
\ No newline at end of file
+var _0x8024=['SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','create','body','options','raw','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x232af5,_0x29fd50){var _0x3e618a=function(_0x1d0371){while(--_0x1d0371){_0x232af5['push'](_0x232af5['shift']());}};_0x3e618a(++_0x29fd50);}(_0x8024,0xec));var _0x4802=function(_0xd8762f,_0x2559d2){_0xd8762f=_0xd8762f-0x0;var _0x2d0232=_0x8024[_0xd8762f];return _0x2d0232;};'use strict';var _=require(_0x4802('0x0'));var util=require('util');var moment=require(_0x4802('0x1'));var BPromise=require(_0x4802('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4802('0x3'))['db'];var utils=require(_0x4802('0x4'));var logger=require(_0x4802('0x5'))('rpc');var config=require(_0x4802('0x6'));var jayson=require(_0x4802('0x7'));var client=jayson[_0x4802('0x8')][_0x4802('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23b95d,_0x58a8bf,_0x139ef8){return new BPromise(function(_0x246891,_0x312ad9){return client[_0x4802('0xa')](_0x23b95d,_0x139ef8)[_0x4802('0xb')](function(_0x13a84d){logger[_0x4802('0xc')](_0x4802('0xd'),_0x58a8bf,_0x4802('0xe'));logger[_0x4802('0xf')](_0x4802('0x10'),_0x58a8bf,_0x4802('0xe'),JSON[_0x4802('0x11')](_0x13a84d));if(_0x13a84d[_0x4802('0x12')]){if(_0x13a84d[_0x4802('0x12')][_0x4802('0x13')]===0x1f4){logger[_0x4802('0x12')](_0x4802('0xd'),_0x58a8bf,_0x13a84d['error'][_0x4802('0x14')]);return _0x312ad9(_0x13a84d[_0x4802('0x12')][_0x4802('0x14')]);}logger[_0x4802('0x12')]('SquareRecording,\x20%s,\x20%s',_0x58a8bf,_0x13a84d[_0x4802('0x12')][_0x4802('0x14')]);return _0x246891(_0x13a84d[_0x4802('0x12')]['message']);}else{logger[_0x4802('0xc')](_0x4802('0xd'),_0x58a8bf,_0x4802('0xe'));_0x246891(_0x13a84d[_0x4802('0x15')][_0x4802('0x14')]);}})[_0x4802('0x16')](function(_0x219cc0){logger[_0x4802('0x12')](_0x4802('0xd'),_0x58a8bf,_0x219cc0);_0x312ad9(_0x219cc0);});});}exports[_0x4802('0x17')]=function(_0x117fbd){var _0x5b5b38=this;return new Promise(function(_0x2315e5,_0x5828c1){return db['SquareRecording'][_0x4802('0x18')](_0x117fbd[_0x4802('0x19')],{'raw':_0x117fbd['options']?_0x117fbd[_0x4802('0x1a')][_0x4802('0x1b')]===undefined?!![]:![]:!![]})[_0x4802('0xb')](function(_0xa80838){logger[_0x4802('0xc')](_0x4802('0x17'),_0x117fbd);logger[_0x4802('0xf')](_0x4802('0x17'),_0x117fbd,JSON[_0x4802('0x11')](_0xa80838));_0x2315e5(_0xa80838);})[_0x4802('0x16')](function(_0x5c6043){logger['error'](_0x4802('0x17'),_0x5c6043[_0x4802('0x14')],_0x117fbd);_0x5828c1(_0x5b5b38[_0x4802('0x12')](0x1f4,_0x5c6043[_0x4802('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js
index dbb5f70..b375803 100644
--- a/server/api/squareReport/index.js
+++ b/server/api/squareReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1c9c=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','/describe','isAuthenticated','show','post','put','/:id','delete'];(function(_0x568591,_0x12546f){var _0x37865c=function(_0x186a5d){while(--_0x186a5d){_0x568591['push'](_0x568591['shift']());}};_0x37865c(++_0x12546f);}(_0x1c9c,0xe6));var _0xc1c9=function(_0x257e65,_0x3f4a68){_0x257e65=_0x257e65-0x0;var _0x3eef2f=_0x1c9c[_0x257e65];return _0x3eef2f;};'use strict';var multer=require(_0xc1c9('0x0'));var util=require(_0xc1c9('0x1'));var path=require(_0xc1c9('0x2'));var timeout=require(_0xc1c9('0x3'));var express=require('express');var router=express[_0xc1c9('0x4')]();var auth=require(_0xc1c9('0x5'));var interaction=require(_0xc1c9('0x6'));var config=require(_0xc1c9('0x7'));var controller=require(_0xc1c9('0x8'));router[_0xc1c9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc1c9('0x9')](_0xc1c9('0xa'),auth[_0xc1c9('0xb')](),controller['describe']);router['get']('/:id',auth[_0xc1c9('0xb')](),controller[_0xc1c9('0xc')]);router[_0xc1c9('0xd')]('/',auth[_0xc1c9('0xb')](),controller['create']);router[_0xc1c9('0xe')](_0xc1c9('0xf'),auth[_0xc1c9('0xb')](),controller['update']);router[_0xc1c9('0x10')](_0xc1c9('0xf'),auth[_0xc1c9('0xb')](),controller[_0xc1c9('0x11')]);module[_0xc1c9('0x12')]=router;
\ No newline at end of file
+var _0x9174=['isAuthenticated','get','/describe','describe','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x9174,0x15b));var _0x4917=function(_0x3027e2,_0x2d03b2){_0x3027e2=_0x3027e2-0x0;var _0x108a35=_0x9174[_0x3027e2];return _0x108a35;};'use strict';var multer=require(_0x4917('0x0'));var util=require(_0x4917('0x1'));var path=require(_0x4917('0x2'));var timeout=require(_0x4917('0x3'));var express=require(_0x4917('0x4'));var router=express[_0x4917('0x5')]();var auth=require(_0x4917('0x6'));var interaction=require(_0x4917('0x7'));var config=require(_0x4917('0x8'));var controller=require(_0x4917('0x9'));router['get']('/',auth[_0x4917('0xa')](),controller['index']);router[_0x4917('0xb')](_0x4917('0xc'),auth[_0x4917('0xa')](),controller[_0x4917('0xd')]);router[_0x4917('0xb')]('/:id',auth[_0x4917('0xa')](),controller['show']);router[_0x4917('0xe')]('/',auth[_0x4917('0xa')](),controller[_0x4917('0xf')]);router[_0x4917('0x10')](_0x4917('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x4917('0x12')]('/:id',auth[_0x4917('0xa')](),controller[_0x4917('0x13')]);module[_0x4917('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js
index 789007d..ba56c53 100644
--- a/server/api/squareReport/squareReport.attributes.js
+++ b/server/api/squareReport/squareReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0884=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x20714a,_0x7de591){var _0x15e877=function(_0x3f9f8d){while(--_0x3f9f8d){_0x20714a['push'](_0x20714a['shift']());}};_0x15e877(++_0x7de591);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4088('0x0'));module[_0x4088('0x1')]={'network':{'type':Sequelize[_0x4088('0x2')]},'network_script':{'type':Sequelize[_0x4088('0x2')]},'request':{'type':Sequelize[_0x4088('0x2')]},'channel':{'type':Sequelize[_0x4088('0x2')]},'language':{'type':Sequelize[_0x4088('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4088('0x2')]},'version':{'type':Sequelize[_0x4088('0x2')]},'callerid':{'type':Sequelize[_0x4088('0x2')]},'calleridname':{'type':Sequelize[_0x4088('0x2')]},'callingpres':{'type':Sequelize[_0x4088('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x4088('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x4088('0x2')]},'context':{'type':Sequelize[_0x4088('0x2')]},'extension':{'type':Sequelize[_0x4088('0x2')]},'priority':{'type':Sequelize[_0x4088('0x2')]},'enhanced':{'type':Sequelize[_0x4088('0x2')]},'accountcode':{'type':Sequelize[_0x4088('0x2')]},'threadid':{'type':Sequelize[_0x4088('0x2')]},'project_name':{'type':Sequelize[_0x4088('0x2')]},'joinAt':{'type':Sequelize[_0x4088('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x4088('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x130d=['STRING','DATE','sequelize'];(function(_0x8bb4c1,_0x2d6e53){var _0x67a6e1=function(_0x1155e5){while(--_0x1155e5){_0x8bb4c1['push'](_0x8bb4c1['shift']());}};_0x67a6e1(++_0x2d6e53);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd130('0x0'));module['exports']={'network':{'type':Sequelize[_0xd130('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xd130('0x1')]},'channel':{'type':Sequelize[_0xd130('0x1')]},'language':{'type':Sequelize[_0xd130('0x1')]},'type':{'type':Sequelize[_0xd130('0x1')]},'uniqueid':{'type':Sequelize[_0xd130('0x1')]},'version':{'type':Sequelize[_0xd130('0x1')]},'callerid':{'type':Sequelize[_0xd130('0x1')]},'calleridname':{'type':Sequelize[_0xd130('0x1')]},'callingpres':{'type':Sequelize[_0xd130('0x1')]},'callingani2':{'type':Sequelize[_0xd130('0x1')]},'callington':{'type':Sequelize[_0xd130('0x1')]},'callingtns':{'type':Sequelize[_0xd130('0x1')]},'dnid':{'type':Sequelize[_0xd130('0x1')]},'rdnis':{'type':Sequelize[_0xd130('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xd130('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xd130('0x1')]},'accountcode':{'type':Sequelize[_0xd130('0x1')]},'threadid':{'type':Sequelize[_0xd130('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd130('0x2')]},'leaveAt':{'type':Sequelize[_0xd130('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js
index d77c984..2875e33 100644
--- a/server/api/squareReport/squareReport.controller.js
+++ b/server/api/squareReport/squareReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa7a=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','update','then','error','stack','name','index','SquareReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','filter','map','type','key','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','html-pdf'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0xaa7a,0x1db));var _0xaaa7=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0xaa7a[_0xef4ef0];return _0x39b60b;};'use strict';var pdf=require(_0xaaa7('0x0'));var emlformat=require(_0xaaa7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaaa7('0x2'));var jsonpatch=require(_0xaaa7('0x3'));var rp=require(_0xaaa7('0x4'));var moment=require(_0xaaa7('0x5'));var BPromise=require(_0xaaa7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaaa7('0x7'));var sox=require(_0xaaa7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xaaa7('0x9'));var crypto=require(_0xaaa7('0xa'));var jsforce=require(_0xaaa7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaaa7('0xc'));var querystring=require(_0xaaa7('0xd'));var Papa=require(_0xaaa7('0xe'));var Redis=require(_0xaaa7('0xf'));var authService=require(_0xaaa7('0x10'));var qs=require(_0xaaa7('0x11'));var hardwareService=require(_0xaaa7('0x12'));var logger=require(_0xaaa7('0x13'))(_0xaaa7('0x14'));var utils=require(_0xaaa7('0x15'));var config=require(_0xaaa7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26cc96,_0xb3148d){_0xb3148d=_0xb3148d||0xcc;return function(_0x4d58ac){if(_0x4d58ac){return _0x26cc96[_0xaaa7('0x17')](_0xb3148d);}return _0x26cc96[_0xaaa7('0x18')](_0xb3148d)[_0xaaa7('0x19')]();};}function respondWithResult(_0x52737b,_0x572f49){_0x572f49=_0x572f49||0xc8;return function(_0x4e44c0){if(_0x4e44c0){return _0x52737b['status'](_0x572f49)[_0xaaa7('0x1a')](_0x4e44c0);}};}function respondWithFilteredResult(_0x1750cf,_0x57d19f){return function(_0x26a5c7){if(_0x26a5c7){var _0x47a9b9=_0x26a5c7[_0xaaa7('0x1b')],_0x2dbb9a=_0x57d19f[_0xaaa7('0x1c')],_0x42320f=_0x57d19f['offset']+_0x57d19f['limit'],_0x11b612;if(_0x42320f>=_0x47a9b9){_0x42320f=_0x47a9b9;_0x11b612=0xc8;}else{_0x11b612=0xce;}_0x1750cf[_0xaaa7('0x18')](_0x11b612);return _0x1750cf['set'](_0xaaa7('0x1d'),_0x2dbb9a+'-'+_0x42320f+'/'+_0x47a9b9)[_0xaaa7('0x1a')](_0x26a5c7);}return null;};}function patchUpdates(_0xc786d4){return function(_0x27de9e){try{jsonpatch[_0xaaa7('0x1e')](_0x27de9e,_0xc786d4,!![]);}catch(_0x1f617f){return BPromise['reject'](_0x1f617f);}return _0x27de9e['save']();};}function saveUpdates(_0x2fc63b,_0x32f496){return function(_0x29299f){if(_0x29299f){return _0x29299f[_0xaaa7('0x1f')](_0x2fc63b)['then'](function(_0x15c814){return _0x15c814;});}return null;};}function removeEntity(_0xce22a6,_0x167193){return function(_0x52e601){if(_0x52e601){return _0x52e601['destroy']()[_0xaaa7('0x20')](function(){_0xce22a6[_0xaaa7('0x18')](0xcc)[_0xaaa7('0x19')]();});}};}function handleEntityNotFound(_0x553923,_0x42f48d){return function(_0x5d5735){if(!_0x5d5735){_0x553923[_0xaaa7('0x17')](0x194);}return _0x5d5735;};}function handleError(_0x21592c,_0x15994d){_0x15994d=_0x15994d||0x1f4;return function(_0x1396e0){logger[_0xaaa7('0x21')](_0x1396e0[_0xaaa7('0x22')]);if(_0x1396e0[_0xaaa7('0x23')]){delete _0x1396e0[_0xaaa7('0x23')];}_0x21592c[_0xaaa7('0x18')](_0x15994d)['send'](_0x1396e0);};}exports[_0xaaa7('0x24')]=function(_0x31d31f,_0x19c22f){var _0x138890={},_0x21b4e7={},_0x1a2320={'count':0x0,'rows':[]};var _0x145c37=db[_0xaaa7('0x25')][_0xaaa7('0x26')];_0x21b4e7[_0xaaa7('0x27')]=_[_0xaaa7('0x28')](_0x145c37);_0x21b4e7[_0xaaa7('0x29')]=_[_0xaaa7('0x28')](_0x31d31f[_0xaaa7('0x29')]);_0x21b4e7[_0xaaa7('0x2a')]=_[_0xaaa7('0x2b')](_0x21b4e7[_0xaaa7('0x27')],_0x21b4e7['query']);_0x138890[_0xaaa7('0x2c')]=_[_0xaaa7('0x2b')](_0x21b4e7[_0xaaa7('0x27')],qs[_0xaaa7('0x2d')](_0x31d31f[_0xaaa7('0x29')][_0xaaa7('0x2d')]));_0x138890[_0xaaa7('0x2c')]=_0x138890[_0xaaa7('0x2c')][_0xaaa7('0x2e')]?_0x138890['attributes']:_0x21b4e7['model'];if(!_0x31d31f['query'][_0xaaa7('0x2f')]('nolimit')){_0x138890[_0xaaa7('0x30')]=qs[_0xaaa7('0x30')](_0x31d31f[_0xaaa7('0x29')][_0xaaa7('0x30')]);_0x138890['offset']=qs[_0xaaa7('0x1c')](_0x31d31f[_0xaaa7('0x29')][_0xaaa7('0x1c')]);}_0x138890[_0xaaa7('0x31')]=qs['sort'](_0x31d31f[_0xaaa7('0x29')]['sort']);_0x138890[_0xaaa7('0x32')]=qs['filters'](_['pick'](_0x31d31f[_0xaaa7('0x29')],_0x21b4e7[_0xaaa7('0x2a')]));if(_0x31d31f['query'][_0xaaa7('0x33')]){_0x138890[_0xaaa7('0x32')]=_['merge'](_0x138890['where'],{'$or':_[_0xaaa7('0x34')](_0x145c37,function(_0x22dfaf){if(_0x22dfaf[_0xaaa7('0x35')][_0xaaa7('0x36')]!=='VIRTUAL'){var _0x9717f2={};_0x9717f2[_0x22dfaf['field']]={'$like':'%'+_0x31d31f[_0xaaa7('0x29')][_0xaaa7('0x33')]+'%'};return _0x9717f2;}})});}_0x138890=_[_0xaaa7('0x37')]({},_0x138890,_0x31d31f[_0xaaa7('0x38')]);var _0x4ec28a={'where':_0x138890[_0xaaa7('0x32')]};return db['SquareReport'][_0xaaa7('0x1b')](_0x4ec28a)[_0xaaa7('0x20')](function(_0x3c2a1b){_0x1a2320[_0xaaa7('0x1b')]=_0x3c2a1b;if(_0x31d31f[_0xaaa7('0x29')][_0xaaa7('0x39')]){_0x138890[_0xaaa7('0x3a')]=[{'all':!![]}];}return db[_0xaaa7('0x25')][_0xaaa7('0x3b')](_0x138890);})[_0xaaa7('0x20')](function(_0x48c512){_0x1a2320[_0xaaa7('0x3c')]=_0x48c512;return _0x1a2320;})['then'](respondWithFilteredResult(_0x19c22f,_0x138890))[_0xaaa7('0x3d')](handleError(_0x19c22f,null));};exports['show']=function(_0x1bda94,_0x276cfc){var _0x50d915={'raw':!![],'where':{'id':_0x1bda94[_0xaaa7('0x3e')]['id']}},_0x4ef059={};_0x4ef059[_0xaaa7('0x27')]=_[_0xaaa7('0x28')](db[_0xaaa7('0x25')]['rawAttributes']);_0x4ef059[_0xaaa7('0x29')]=_[_0xaaa7('0x28')](_0x1bda94[_0xaaa7('0x29')]);_0x4ef059[_0xaaa7('0x2a')]=_[_0xaaa7('0x2b')](_0x4ef059[_0xaaa7('0x27')],_0x4ef059[_0xaaa7('0x29')]);_0x50d915['attributes']=_[_0xaaa7('0x2b')](_0x4ef059[_0xaaa7('0x27')],qs[_0xaaa7('0x2d')](_0x1bda94[_0xaaa7('0x29')][_0xaaa7('0x2d')]));_0x50d915[_0xaaa7('0x2c')]=_0x50d915['attributes'][_0xaaa7('0x2e')]?_0x50d915['attributes']:_0x4ef059[_0xaaa7('0x27')];if(_0x1bda94[_0xaaa7('0x29')][_0xaaa7('0x39')]){_0x50d915[_0xaaa7('0x3a')]=[{'all':!![]}];}_0x50d915=_['merge']({},_0x50d915,_0x1bda94[_0xaaa7('0x38')]);return db[_0xaaa7('0x25')][_0xaaa7('0x3f')](_0x50d915)[_0xaaa7('0x20')](handleEntityNotFound(_0x276cfc,null))[_0xaaa7('0x20')](respondWithResult(_0x276cfc,null))[_0xaaa7('0x3d')](handleError(_0x276cfc,null));};exports[_0xaaa7('0x40')]=function(_0x2c41ff,_0x6c5c6b){return db['SquareReport']['create'](_0x2c41ff[_0xaaa7('0x41')],{})[_0xaaa7('0x20')](respondWithResult(_0x6c5c6b,0xc9))['catch'](handleError(_0x6c5c6b,null));};exports[_0xaaa7('0x1f')]=function(_0x44eeab,_0x5deee5){if(_0x44eeab[_0xaaa7('0x41')]['id']){delete _0x44eeab['body']['id'];}return db[_0xaaa7('0x25')][_0xaaa7('0x3f')]({'where':{'id':_0x44eeab[_0xaaa7('0x3e')]['id']}})[_0xaaa7('0x20')](handleEntityNotFound(_0x5deee5,null))[_0xaaa7('0x20')](saveUpdates(_0x44eeab[_0xaaa7('0x41')],null))[_0xaaa7('0x20')](respondWithResult(_0x5deee5,null))[_0xaaa7('0x3d')](handleError(_0x5deee5,null));};exports[_0xaaa7('0x42')]=function(_0x3b2344,_0x557346){return db[_0xaaa7('0x25')][_0xaaa7('0x3f')]({'where':{'id':_0x3b2344[_0xaaa7('0x3e')]['id']}})[_0xaaa7('0x20')](handleEntityNotFound(_0x557346,null))[_0xaaa7('0x20')](removeEntity(_0x557346,null))['catch'](handleError(_0x557346,null));};exports[_0xaaa7('0x43')]=function(_0x3b0291,_0x9ea366){return db[_0xaaa7('0x25')]['describe']()['then'](respondWithResult(_0x9ea366,null))[_0xaaa7('0x3d')](handleError(_0x9ea366,null));};
\ No newline at end of file
+var _0xb5ac=['apply','save','update','then','destroy','name','send','index','SquareReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','merge','map','type','key','filter','include','findAll','catch','show','params','includeAll','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','limit','status','set'];(function(_0x113d12,_0x17137e){var _0x336960=function(_0x32484f){while(--_0x32484f){_0x113d12['push'](_0x113d12['shift']());}};_0x336960(++_0x17137e);}(_0xb5ac,0xf7));var _0xcb5a=function(_0x24a3dc,_0x4cd182){_0x24a3dc=_0x24a3dc-0x0;var _0xa3ff0a=_0xb5ac[_0x24a3dc];return _0xa3ff0a;};'use strict';var pdf=require(_0xcb5a('0x0'));var emlformat=require(_0xcb5a('0x1'));var rimraf=require(_0xcb5a('0x2'));var zipdir=require(_0xcb5a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb5a('0x4'));var moment=require(_0xcb5a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcb5a('0x6'));var util=require(_0xcb5a('0x7'));var path=require(_0xcb5a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcb5a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcb5a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcb5a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xcb5a('0xc'));var Papa=require(_0xcb5a('0xd'));var Redis=require(_0xcb5a('0xe'));var authService=require(_0xcb5a('0xf'));var qs=require(_0xcb5a('0x10'));var hardwareService=require(_0xcb5a('0x11'));var logger=require(_0xcb5a('0x12'))(_0xcb5a('0x13'));var utils=require(_0xcb5a('0x14'));var config=require(_0xcb5a('0x15'));var db=require(_0xcb5a('0x16'))['db'];function respondWithStatusCode(_0x497a80,_0x44325b){_0x44325b=_0x44325b||0xcc;return function(_0x4cab80){if(_0x4cab80){return _0x497a80[_0xcb5a('0x17')](_0x44325b);}return _0x497a80['status'](_0x44325b)['end']();};}function respondWithResult(_0x2a69a1,_0x54a9c2){_0x54a9c2=_0x54a9c2||0xc8;return function(_0x130ec5){if(_0x130ec5){return _0x2a69a1['status'](_0x54a9c2)[_0xcb5a('0x18')](_0x130ec5);}};}function respondWithFilteredResult(_0x1c043b,_0x23cfd0){return function(_0x39281b){if(_0x39281b){var _0x276f5d=_0x39281b[_0xcb5a('0x19')],_0x2c3b14=_0x23cfd0['offset'],_0x57af22=_0x23cfd0['offset']+_0x23cfd0[_0xcb5a('0x1a')],_0x6d4e40;if(_0x57af22>=_0x276f5d){_0x57af22=_0x276f5d;_0x6d4e40=0xc8;}else{_0x6d4e40=0xce;}_0x1c043b[_0xcb5a('0x1b')](_0x6d4e40);return _0x1c043b[_0xcb5a('0x1c')]('Content-Range',_0x2c3b14+'-'+_0x57af22+'/'+_0x276f5d)['json'](_0x39281b);}return null;};}function patchUpdates(_0x2ea589){return function(_0x2dcd60){try{jsonpatch[_0xcb5a('0x1d')](_0x2dcd60,_0x2ea589,!![]);}catch(_0x47da3d){return BPromise['reject'](_0x47da3d);}return _0x2dcd60[_0xcb5a('0x1e')]();};}function saveUpdates(_0x1105a8,_0x298a2f){return function(_0x5d3088){if(_0x5d3088){return _0x5d3088[_0xcb5a('0x1f')](_0x1105a8)[_0xcb5a('0x20')](function(_0x5e3ef5){return _0x5e3ef5;});}return null;};}function removeEntity(_0x54d2c2,_0x1e47fc){return function(_0x53e253){if(_0x53e253){return _0x53e253[_0xcb5a('0x21')]()[_0xcb5a('0x20')](function(){_0x54d2c2[_0xcb5a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38e310,_0x548f21){return function(_0xbf342c){if(!_0xbf342c){_0x38e310[_0xcb5a('0x17')](0x194);}return _0xbf342c;};}function handleError(_0x1de08a,_0xc446b2){_0xc446b2=_0xc446b2||0x1f4;return function(_0x54f4b3){logger['error'](_0x54f4b3['stack']);if(_0x54f4b3[_0xcb5a('0x22')]){delete _0x54f4b3['name'];}_0x1de08a[_0xcb5a('0x1b')](_0xc446b2)[_0xcb5a('0x23')](_0x54f4b3);};}exports[_0xcb5a('0x24')]=function(_0x15e57d,_0x1ef08){var _0x1e5f83={},_0xf8dafb={},_0x301bf3={'count':0x0,'rows':[]};var _0xe2b0ae=db[_0xcb5a('0x25')][_0xcb5a('0x26')];_0xf8dafb[_0xcb5a('0x27')]=_[_0xcb5a('0x28')](_0xe2b0ae);_0xf8dafb[_0xcb5a('0x29')]=_[_0xcb5a('0x28')](_0x15e57d[_0xcb5a('0x29')]);_0xf8dafb[_0xcb5a('0x2a')]=_['intersection'](_0xf8dafb[_0xcb5a('0x27')],_0xf8dafb[_0xcb5a('0x29')]);_0x1e5f83[_0xcb5a('0x2b')]=_[_0xcb5a('0x2c')](_0xf8dafb[_0xcb5a('0x27')],qs['fields'](_0x15e57d[_0xcb5a('0x29')][_0xcb5a('0x2d')]));_0x1e5f83[_0xcb5a('0x2b')]=_0x1e5f83[_0xcb5a('0x2b')][_0xcb5a('0x2e')]?_0x1e5f83[_0xcb5a('0x2b')]:_0xf8dafb[_0xcb5a('0x27')];if(!_0x15e57d[_0xcb5a('0x29')][_0xcb5a('0x2f')](_0xcb5a('0x30'))){_0x1e5f83[_0xcb5a('0x1a')]=qs['limit'](_0x15e57d[_0xcb5a('0x29')][_0xcb5a('0x1a')]);_0x1e5f83[_0xcb5a('0x31')]=qs['offset'](_0x15e57d['query'][_0xcb5a('0x31')]);}_0x1e5f83[_0xcb5a('0x32')]=qs['sort'](_0x15e57d['query'][_0xcb5a('0x33')]);_0x1e5f83['where']=qs['filters'](_['pick'](_0x15e57d[_0xcb5a('0x29')],_0xf8dafb[_0xcb5a('0x2a')]));if(_0x15e57d[_0xcb5a('0x29')]['filter']){_0x1e5f83[_0xcb5a('0x34')]=_[_0xcb5a('0x35')](_0x1e5f83[_0xcb5a('0x34')],{'$or':_[_0xcb5a('0x36')](_0xe2b0ae,function(_0x334b2e){if(_0x334b2e[_0xcb5a('0x37')][_0xcb5a('0x38')]!=='VIRTUAL'){var _0x2e6e50={};_0x2e6e50[_0x334b2e['field']]={'$like':'%'+_0x15e57d[_0xcb5a('0x29')][_0xcb5a('0x39')]+'%'};return _0x2e6e50;}})});}_0x1e5f83=_['merge']({},_0x1e5f83,_0x15e57d['options']);var _0x57a234={'where':_0x1e5f83['where']};return db[_0xcb5a('0x25')][_0xcb5a('0x19')](_0x57a234)['then'](function(_0xe398ce){_0x301bf3[_0xcb5a('0x19')]=_0xe398ce;if(_0x15e57d[_0xcb5a('0x29')]['includeAll']){_0x1e5f83[_0xcb5a('0x3a')]=[{'all':!![]}];}return db[_0xcb5a('0x25')][_0xcb5a('0x3b')](_0x1e5f83);})['then'](function(_0x2a9abb){_0x301bf3['rows']=_0x2a9abb;return _0x301bf3;})['then'](respondWithFilteredResult(_0x1ef08,_0x1e5f83))[_0xcb5a('0x3c')](handleError(_0x1ef08,null));};exports[_0xcb5a('0x3d')]=function(_0xcd3ddd,_0x478aca){var _0x5cc98b={'raw':!![],'where':{'id':_0xcd3ddd[_0xcb5a('0x3e')]['id']}},_0x769cab={};_0x769cab[_0xcb5a('0x27')]=_['keys'](db[_0xcb5a('0x25')]['rawAttributes']);_0x769cab[_0xcb5a('0x29')]=_['keys'](_0xcd3ddd[_0xcb5a('0x29')]);_0x769cab['filters']=_[_0xcb5a('0x2c')](_0x769cab[_0xcb5a('0x27')],_0x769cab[_0xcb5a('0x29')]);_0x5cc98b['attributes']=_[_0xcb5a('0x2c')](_0x769cab[_0xcb5a('0x27')],qs[_0xcb5a('0x2d')](_0xcd3ddd[_0xcb5a('0x29')][_0xcb5a('0x2d')]));_0x5cc98b[_0xcb5a('0x2b')]=_0x5cc98b['attributes'][_0xcb5a('0x2e')]?_0x5cc98b[_0xcb5a('0x2b')]:_0x769cab[_0xcb5a('0x27')];if(_0xcd3ddd['query'][_0xcb5a('0x3f')]){_0x5cc98b['include']=[{'all':!![]}];}_0x5cc98b=_[_0xcb5a('0x35')]({},_0x5cc98b,_0xcd3ddd[_0xcb5a('0x40')]);return db['SquareReport'][_0xcb5a('0x41')](_0x5cc98b)[_0xcb5a('0x20')](handleEntityNotFound(_0x478aca,null))[_0xcb5a('0x20')](respondWithResult(_0x478aca,null))[_0xcb5a('0x3c')](handleError(_0x478aca,null));};exports[_0xcb5a('0x42')]=function(_0x395cea,_0x3599b7){return db[_0xcb5a('0x25')][_0xcb5a('0x42')](_0x395cea['body'],{})[_0xcb5a('0x20')](respondWithResult(_0x3599b7,0xc9))[_0xcb5a('0x3c')](handleError(_0x3599b7,null));};exports['update']=function(_0x57f260,_0x515e00){if(_0x57f260['body']['id']){delete _0x57f260[_0xcb5a('0x43')]['id'];}return db[_0xcb5a('0x25')][_0xcb5a('0x41')]({'where':{'id':_0x57f260[_0xcb5a('0x3e')]['id']}})[_0xcb5a('0x20')](handleEntityNotFound(_0x515e00,null))['then'](saveUpdates(_0x57f260[_0xcb5a('0x43')],null))[_0xcb5a('0x20')](respondWithResult(_0x515e00,null))['catch'](handleError(_0x515e00,null));};exports[_0xcb5a('0x21')]=function(_0xfbaea2,_0x364695){return db[_0xcb5a('0x25')]['find']({'where':{'id':_0xfbaea2[_0xcb5a('0x3e')]['id']}})[_0xcb5a('0x20')](handleEntityNotFound(_0x364695,null))['then'](removeEntity(_0x364695,null))[_0xcb5a('0x3c')](handleError(_0x364695,null));};exports[_0xcb5a('0x44')]=function(_0x52a2e2,_0x1bfb73){return db[_0xcb5a('0x25')]['describe']()[_0xcb5a('0x20')](respondWithResult(_0x1bfb73,null))[_0xcb5a('0x3c')](handleError(_0x1bfb73,null));};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js
index 4b6b3b7..3de705f 100644
--- a/server/api/squareReport/squareReport.model.js
+++ b/server/api/squareReport/squareReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['exports','define','SquareReport','uniqueid','leaveAt','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x5322f6,_0x517a5c){var _0x5d4125=function(_0x5494cd){while(--_0x5494cd){_0x5322f6['push'](_0x5322f6['shift']());}};_0x5d4125(++_0x517a5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0a9e('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x0a9e('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger'];(function(_0x65a751,_0x371a7f){var _0x2024d4=function(_0x2da2c6){while(--_0x2da2c6){_0x65a751['push'](_0x65a751['shift']());}};_0x2024d4(++_0x371a7f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'project_name']},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js
index 4bc247f..a45c5cd 100644
--- a/server/api/squareReport/squareReport.rpc.js
+++ b/server/api/squareReport/squareReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3fcf=['request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareReport','body','options','raw','update','where','attributes','limit','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0x3fcf,0x115));var _0xf3fc=function(_0x2c9197,_0x4fc20c){_0x2c9197=_0x2c9197-0x0;var _0x3045aa=_0x3fcf[_0x2c9197];return _0x3045aa;};'use strict';var _=require(_0xf3fc('0x0'));var util=require(_0xf3fc('0x1'));var moment=require(_0xf3fc('0x2'));var BPromise=require(_0xf3fc('0x3'));var rs=require(_0xf3fc('0x4'));var fs=require('fs');var Redis=require(_0xf3fc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3fc('0x6'));var logger=require('../../config/logger')(_0xf3fc('0x7'));var config=require(_0xf3fc('0x8'));var jayson=require(_0xf3fc('0x9'));var client=jayson['client'][_0xf3fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b708b,_0x3ae032,_0x5a8de5){return new BPromise(function(_0x51ddc8,_0x124f72){return client[_0xf3fc('0xb')](_0x5b708b,_0x5a8de5)[_0xf3fc('0xc')](function(_0x56af6c){logger[_0xf3fc('0xd')](_0xf3fc('0xe'),_0x3ae032,_0xf3fc('0xf'));logger[_0xf3fc('0x10')](_0xf3fc('0x11'),_0x3ae032,'request\x20sent',JSON[_0xf3fc('0x12')](_0x56af6c));if(_0x56af6c['error']){if(_0x56af6c['error']['code']===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x3ae032,_0x56af6c[_0xf3fc('0x13')][_0xf3fc('0x14')]);return _0x124f72(_0x56af6c[_0xf3fc('0x13')][_0xf3fc('0x14')]);}logger[_0xf3fc('0x13')]('SquareReport,\x20%s,\x20%s',_0x3ae032,_0x56af6c[_0xf3fc('0x13')][_0xf3fc('0x14')]);return _0x51ddc8(_0x56af6c[_0xf3fc('0x13')][_0xf3fc('0x14')]);}else{logger[_0xf3fc('0xd')](_0xf3fc('0xe'),_0x3ae032,_0xf3fc('0xf'));_0x51ddc8(_0x56af6c[_0xf3fc('0x15')][_0xf3fc('0x14')]);}})[_0xf3fc('0x16')](function(_0x27d0b0){logger[_0xf3fc('0x13')](_0xf3fc('0xe'),_0x3ae032,_0x27d0b0);_0x124f72(_0x27d0b0);});});}exports[_0xf3fc('0x17')]=function(_0xb21f4e){var _0x8519e0=this;return new Promise(function(_0x409179,_0x3965f7){return db['SquareReport']['create'](_0xb21f4e[_0xf3fc('0x18')],{'raw':_0xb21f4e[_0xf3fc('0x19')]?_0xb21f4e[_0xf3fc('0x19')][_0xf3fc('0x1a')]===undefined?!![]:![]:!![]})[_0xf3fc('0xc')](function(_0x28d9e6){logger['info'](_0xf3fc('0x17'),_0xb21f4e);logger[_0xf3fc('0x10')](_0xf3fc('0x17'),_0xb21f4e,JSON[_0xf3fc('0x12')](_0x28d9e6));_0x409179(_0x28d9e6);})['catch'](function(_0x51d20a){logger[_0xf3fc('0x13')]('CreateSquareReport',_0x51d20a[_0xf3fc('0x14')],_0xb21f4e);_0x3965f7(_0x8519e0[_0xf3fc('0x13')](0x1f4,_0x51d20a[_0xf3fc('0x14')]));});});};exports['UpdateSquareReport']=function(_0x48efce){var _0x8e58eb=this;return new Promise(function(_0x7dcda2,_0x48f636){return db['SquareReport'][_0xf3fc('0x1b')](_0x48efce['body'],{'raw':_0x48efce['options']?_0x48efce[_0xf3fc('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48efce['options']?_0x48efce[_0xf3fc('0x19')][_0xf3fc('0x1c')]||null:null,'attributes':_0x48efce[_0xf3fc('0x19')]?_0x48efce['options'][_0xf3fc('0x1d')]||null:null,'limit':_0x48efce['options']?_0x48efce[_0xf3fc('0x19')][_0xf3fc('0x1e')]||null:null})[_0xf3fc('0xc')](function(_0x17fe27){logger[_0xf3fc('0xd')](_0xf3fc('0x1f'),_0x48efce);logger[_0xf3fc('0x10')](_0xf3fc('0x1f'),_0x48efce,JSON['stringify'](_0x17fe27));_0x7dcda2(_0x17fe27);})[_0xf3fc('0x16')](function(_0x1020ca){logger[_0xf3fc('0x13')](_0xf3fc('0x1f'),_0x1020ca[_0xf3fc('0x14')],_0x48efce);_0x48f636(_0x8e58eb[_0xf3fc('0x13')](0x1f4,_0x1020ca[_0xf3fc('0x14')]));});});};
\ No newline at end of file
+var _0xd15c=['result','catch','CreateSquareReport','SquareReport','create','body','options','raw','debug','stringify','UpdateSquareReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','SquareReport,\x20%s,\x20%s,\x20%s','error','code','SquareReport,\x20%s,\x20%s','message','request\x20sent'];(function(_0x29aaa1,_0x5f2852){var _0x27b433=function(_0x14e2ec){while(--_0x14e2ec){_0x29aaa1['push'](_0x29aaa1['shift']());}};_0x27b433(++_0x5f2852);}(_0xd15c,0x141));var _0xcd15=function(_0x5b63fb,_0x1b8b63){_0x5b63fb=_0x5b63fb-0x0;var _0x54a456=_0xd15c[_0x5b63fb];return _0x54a456;};'use strict';var _=require(_0xcd15('0x0'));var util=require('util');var moment=require(_0xcd15('0x1'));var BPromise=require(_0xcd15('0x2'));var rs=require(_0xcd15('0x3'));var fs=require('fs');var Redis=require(_0xcd15('0x4'));var db=require(_0xcd15('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd15('0x6'))(_0xcd15('0x7'));var config=require(_0xcd15('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcd15('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb1c07d,_0x4dbe63,_0x1b745a){return new BPromise(function(_0x3d6b6d,_0x46246b){return client[_0xcd15('0xa')](_0xb1c07d,_0x1b745a)[_0xcd15('0xb')](function(_0x5dc774){logger[_0xcd15('0xc')]('SquareReport,\x20%s,\x20%s',_0x4dbe63,'request\x20sent');logger['debug'](_0xcd15('0xd'),_0x4dbe63,'request\x20sent',JSON['stringify'](_0x5dc774));if(_0x5dc774[_0xcd15('0xe')]){if(_0x5dc774[_0xcd15('0xe')][_0xcd15('0xf')]===0x1f4){logger[_0xcd15('0xe')](_0xcd15('0x10'),_0x4dbe63,_0x5dc774[_0xcd15('0xe')][_0xcd15('0x11')]);return _0x46246b(_0x5dc774['error'][_0xcd15('0x11')]);}logger[_0xcd15('0xe')](_0xcd15('0x10'),_0x4dbe63,_0x5dc774[_0xcd15('0xe')][_0xcd15('0x11')]);return _0x3d6b6d(_0x5dc774['error'][_0xcd15('0x11')]);}else{logger[_0xcd15('0xc')](_0xcd15('0x10'),_0x4dbe63,_0xcd15('0x12'));_0x3d6b6d(_0x5dc774[_0xcd15('0x13')]['message']);}})[_0xcd15('0x14')](function(_0x3baf29){logger[_0xcd15('0xe')](_0xcd15('0x10'),_0x4dbe63,_0x3baf29);_0x46246b(_0x3baf29);});});}exports[_0xcd15('0x15')]=function(_0x311b1d){var _0x1d7ddd=this;return new Promise(function(_0x29b41f,_0x34df40){return db[_0xcd15('0x16')][_0xcd15('0x17')](_0x311b1d[_0xcd15('0x18')],{'raw':_0x311b1d[_0xcd15('0x19')]?_0x311b1d[_0xcd15('0x19')][_0xcd15('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2bc7ad){logger[_0xcd15('0xc')](_0xcd15('0x15'),_0x311b1d);logger[_0xcd15('0x1b')](_0xcd15('0x15'),_0x311b1d,JSON[_0xcd15('0x1c')](_0x2bc7ad));_0x29b41f(_0x2bc7ad);})[_0xcd15('0x14')](function(_0x11a944){logger['error'](_0xcd15('0x15'),_0x11a944[_0xcd15('0x11')],_0x311b1d);_0x34df40(_0x1d7ddd['error'](0x1f4,_0x11a944['message']));});});};exports[_0xcd15('0x1d')]=function(_0x32a5d8){var _0x5c0fae=this;return new Promise(function(_0x60ead8,_0x30af28){return db[_0xcd15('0x16')][_0xcd15('0x1e')](_0x32a5d8[_0xcd15('0x18')],{'raw':_0x32a5d8[_0xcd15('0x19')]?_0x32a5d8[_0xcd15('0x19')][_0xcd15('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32a5d8[_0xcd15('0x19')]?_0x32a5d8['options'][_0xcd15('0x1f')]||null:null,'attributes':_0x32a5d8[_0xcd15('0x19')]?_0x32a5d8[_0xcd15('0x19')][_0xcd15('0x20')]||null:null,'limit':_0x32a5d8[_0xcd15('0x19')]?_0x32a5d8[_0xcd15('0x19')][_0xcd15('0x21')]||null:null})['then'](function(_0x392e0a){logger[_0xcd15('0xc')](_0xcd15('0x1d'),_0x32a5d8);logger['debug'](_0xcd15('0x1d'),_0x32a5d8,JSON['stringify'](_0x392e0a));_0x60ead8(_0x392e0a);})[_0xcd15('0x14')](function(_0x4f6a67){logger[_0xcd15('0xe')](_0xcd15('0x1d'),_0x4f6a67[_0xcd15('0x11')],_0x32a5d8);_0x30af28(_0x5c0fae[_0xcd15('0xe')](0x1f4,_0x4f6a67['message']));});});};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js
index 44cca9a..bc95c99 100644
--- a/server/api/squareReportDetail/index.js
+++ b/server/api/squareReportDetail/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7599=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe','post','create','/:id','update','delete','destroy','exports','multer'];(function(_0x59680f,_0x32d41b){var _0xb20b44=function(_0x4583d4){while(--_0x4583d4){_0x59680f['push'](_0x59680f['shift']());}};_0xb20b44(++_0x32d41b);}(_0x7599,0x179));var _0x9759=function(_0x11796f,_0x582c16){_0x11796f=_0x11796f-0x0;var _0x2ea120=_0x7599[_0x11796f];return _0x2ea120;};'use strict';var multer=require(_0x9759('0x0'));var util=require(_0x9759('0x1'));var path=require(_0x9759('0x2'));var timeout=require(_0x9759('0x3'));var express=require(_0x9759('0x4'));var router=express[_0x9759('0x5')]();var auth=require(_0x9759('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9759('0x7'));var controller=require(_0x9759('0x8'));router['get']('/',auth[_0x9759('0x9')](),controller[_0x9759('0xa')]);router[_0x9759('0xb')](_0x9759('0xc'),auth['isAuthenticated'](),controller[_0x9759('0xd')]);router[_0x9759('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9759('0xe')]('/',auth['isAuthenticated'](),controller[_0x9759('0xf')]);router['put'](_0x9759('0x10'),auth['isAuthenticated'](),controller[_0x9759('0x11')]);router[_0x9759('0x12')](_0x9759('0x10'),auth['isAuthenticated'](),controller[_0x9759('0x13')]);module[_0x9759('0x14')]=router;
\ No newline at end of file
+var _0xf4aa=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4aa,0xf6));var _0xaf4a=function(_0x4f91d4,_0x40f706){_0x4f91d4=_0x4f91d4-0x0;var _0xfb49ae=_0xf4aa[_0x4f91d4];return _0xfb49ae;};'use strict';var multer=require(_0xaf4a('0x0'));var util=require(_0xaf4a('0x1'));var path=require(_0xaf4a('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf4a('0x3'));var router=express['Router']();var auth=require(_0xaf4a('0x4'));var interaction=require(_0xaf4a('0x5'));var config=require(_0xaf4a('0x6'));var controller=require(_0xaf4a('0x7'));router[_0xaf4a('0x8')]('/',auth[_0xaf4a('0x9')](),controller[_0xaf4a('0xa')]);router[_0xaf4a('0x8')](_0xaf4a('0xb'),auth[_0xaf4a('0x9')](),controller[_0xaf4a('0xc')]);router[_0xaf4a('0x8')](_0xaf4a('0xd'),auth['isAuthenticated'](),controller[_0xaf4a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaf4a('0xf')]);router[_0xaf4a('0x10')]('/:id',auth[_0xaf4a('0x9')](),controller[_0xaf4a('0x11')]);router[_0xaf4a('0x12')]('/:id',auth[_0xaf4a('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js
index 60ca4b4..f499590 100644
--- a/server/api/squareReportDetail/squareReportDetail.attributes.js
+++ b/server/api/squareReportDetail/squareReportDetail.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xccee=['TEXT','exports','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xccee,0x1de));var _0xecce=function(_0x173355,_0x21be8e){_0x173355=_0x173355-0x0;var _0x3bcf27=_0xccee[_0x173355];return _0x3bcf27;};'use strict';var Sequelize=require('sequelize');module[_0xecce('0x0')]={'uniqueid':{'type':Sequelize[_0xecce('0x1')]},'node':{'type':Sequelize[_0xecce('0x1')]},'application':{'type':Sequelize[_0xecce('0x1')]},'data':{'type':Sequelize[_0xecce('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xecce('0x1')]}};
\ No newline at end of file
+var _0x342b=['exports','STRING','TEXT','sequelize'];(function(_0x533ef3,_0x42fc7c){var _0x25ceac=function(_0x462932){while(--_0x462932){_0x533ef3['push'](_0x533ef3['shift']());}};_0x25ceac(++_0x42fc7c);}(_0x342b,0xe7));var _0xb342=function(_0x1b7d23,_0x266ca8){_0x1b7d23=_0x1b7d23-0x0;var _0x30c7f4=_0x342b[_0x1b7d23];return _0x30c7f4;};'use strict';var Sequelize=require(_0xb342('0x0'));module[_0xb342('0x1')]={'uniqueid':{'type':Sequelize[_0xb342('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xb342('0x2')]},'data':{'type':Sequelize[_0xb342('0x3')]},'project_name':{'type':Sequelize[_0xb342('0x2')]},'callerid':{'type':Sequelize[_0xb342('0x2')]}};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js
index dc424a1..3fa1bd2 100644
--- a/server/api/squareReportDetail/squareReportDetail.controller.js
+++ b/server/api/squareReportDetail/squareReportDetail.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcace=['options','find','create','body','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','update','destroy','then','end','error','stack','name','send','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','SquareDetailsReport','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x36549f,_0x5c74f9){var _0x174066=function(_0x211330){while(--_0x211330){_0x36549f['push'](_0x36549f['shift']());}};_0x174066(++_0x5c74f9);}(_0xcace,0x1b5));var _0xecac=function(_0x2570b1,_0x3fed7f){_0x2570b1=_0x2570b1-0x0;var _0x5b4e74=_0xcace[_0x2570b1];return _0x5b4e74;};'use strict';var pdf=require(_0xecac('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xecac('0x1'));var zipdir=require(_0xecac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xecac('0x3'));var moment=require(_0xecac('0x4'));var BPromise=require(_0xecac('0x5'));var Mustache=require(_0xecac('0x6'));var util=require(_0xecac('0x7'));var path=require('path');var sox=require(_0xecac('0x8'));var csv=require('to-csv');var ejs=require(_0xecac('0x9'));var fs=require('fs');var _=require(_0xecac('0xa'));var squel=require(_0xecac('0xb'));var crypto=require(_0xecac('0xc'));var jsforce=require(_0xecac('0xd'));var deskjs=require(_0xecac('0xe'));var toCsv=require(_0xecac('0xf'));var querystring=require(_0xecac('0x10'));var Papa=require(_0xecac('0x11'));var Redis=require('ioredis');var authService=require(_0xecac('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xecac('0x13'));var logger=require(_0xecac('0x14'))(_0xecac('0x15'));var utils=require(_0xecac('0x16'));var config=require('../../config/environment');var db=require(_0xecac('0x17'))['db'];function respondWithStatusCode(_0xbc271c,_0x3f1978){_0x3f1978=_0x3f1978||0xcc;return function(_0x260c99){if(_0x260c99){return _0xbc271c[_0xecac('0x18')](_0x3f1978);}return _0xbc271c[_0xecac('0x19')](_0x3f1978)['end']();};}function respondWithResult(_0xaec840,_0x56077c){_0x56077c=_0x56077c||0xc8;return function(_0x416cce){if(_0x416cce){return _0xaec840[_0xecac('0x19')](_0x56077c)[_0xecac('0x1a')](_0x416cce);}};}function respondWithFilteredResult(_0x28ddc2,_0xd0b5fd){return function(_0x84e22d){if(_0x84e22d){var _0x160a80=_0x84e22d[_0xecac('0x1b')],_0x4879fa=_0xd0b5fd[_0xecac('0x1c')],_0x1da81e=_0xd0b5fd[_0xecac('0x1c')]+_0xd0b5fd['limit'],_0x3b2882;if(_0x1da81e>=_0x160a80){_0x1da81e=_0x160a80;_0x3b2882=0xc8;}else{_0x3b2882=0xce;}_0x28ddc2['status'](_0x3b2882);return _0x28ddc2['set'](_0xecac('0x1d'),_0x4879fa+'-'+_0x1da81e+'/'+_0x160a80)[_0xecac('0x1a')](_0x84e22d);}return null;};}function patchUpdates(_0x2ae07d){return function(_0x264888){try{jsonpatch[_0xecac('0x1e')](_0x264888,_0x2ae07d,!![]);}catch(_0x5a495b){return BPromise['reject'](_0x5a495b);}return _0x264888['save']();};}function saveUpdates(_0x36af2a,_0x3c45f7){return function(_0x459eca){if(_0x459eca){return _0x459eca[_0xecac('0x1f')](_0x36af2a)['then'](function(_0x2b359a){return _0x2b359a;});}return null;};}function removeEntity(_0x16826f,_0x507444){return function(_0xa703a8){if(_0xa703a8){return _0xa703a8[_0xecac('0x20')]()[_0xecac('0x21')](function(){_0x16826f[_0xecac('0x19')](0xcc)[_0xecac('0x22')]();});}};}function handleEntityNotFound(_0x4ca379,_0x4af6e7){return function(_0x1180f6){if(!_0x1180f6){_0x4ca379['sendStatus'](0x194);}return _0x1180f6;};}function handleError(_0x4f534b,_0x22aa57){_0x22aa57=_0x22aa57||0x1f4;return function(_0x41f84d){logger[_0xecac('0x23')](_0x41f84d[_0xecac('0x24')]);if(_0x41f84d[_0xecac('0x25')]){delete _0x41f84d[_0xecac('0x25')];}_0x4f534b['status'](_0x22aa57)[_0xecac('0x26')](_0x41f84d);};}exports['index']=function(_0x14e6b4,_0x282e6f){var _0x2b1f83={},_0x5d9e62={},_0x3c76f3={'count':0x0,'rows':[]};var _0x7f0b5e=db['SquareDetailsReport']['rawAttributes'];_0x5d9e62['model']=_[_0xecac('0x27')](_0x7f0b5e);_0x5d9e62[_0xecac('0x28')]=_['keys'](_0x14e6b4[_0xecac('0x28')]);_0x5d9e62[_0xecac('0x29')]=_[_0xecac('0x2a')](_0x5d9e62[_0xecac('0x2b')],_0x5d9e62['query']);_0x2b1f83[_0xecac('0x2c')]=_['intersection'](_0x5d9e62[_0xecac('0x2b')],qs['fields'](_0x14e6b4[_0xecac('0x28')][_0xecac('0x2d')]));_0x2b1f83[_0xecac('0x2c')]=_0x2b1f83['attributes'][_0xecac('0x2e')]?_0x2b1f83[_0xecac('0x2c')]:_0x5d9e62[_0xecac('0x2b')];if(!_0x14e6b4[_0xecac('0x28')]['hasOwnProperty'](_0xecac('0x2f'))){_0x2b1f83[_0xecac('0x30')]=qs[_0xecac('0x30')](_0x14e6b4[_0xecac('0x28')][_0xecac('0x30')]);_0x2b1f83['offset']=qs['offset'](_0x14e6b4[_0xecac('0x28')]['offset']);}_0x2b1f83[_0xecac('0x31')]=qs['sort'](_0x14e6b4[_0xecac('0x28')][_0xecac('0x32')]);_0x2b1f83[_0xecac('0x33')]=qs[_0xecac('0x29')](_[_0xecac('0x34')](_0x14e6b4[_0xecac('0x28')],_0x5d9e62[_0xecac('0x29')]));if(_0x14e6b4[_0xecac('0x28')][_0xecac('0x35')]){_0x2b1f83[_0xecac('0x33')]=_[_0xecac('0x36')](_0x2b1f83['where'],{'$or':_[_0xecac('0x37')](_0x7f0b5e,function(_0x64fdea){if(_0x64fdea['type'][_0xecac('0x38')]!==_0xecac('0x39')){var _0x204ecc={};_0x204ecc[_0x64fdea[_0xecac('0x3a')]]={'$like':'%'+_0x14e6b4[_0xecac('0x28')][_0xecac('0x35')]+'%'};return _0x204ecc;}})});}_0x2b1f83=_[_0xecac('0x36')]({},_0x2b1f83,_0x14e6b4['options']);var _0x3b7890={'where':_0x2b1f83['where']};return db[_0xecac('0x3b')]['count'](_0x3b7890)[_0xecac('0x21')](function(_0x36baf7){_0x3c76f3[_0xecac('0x1b')]=_0x36baf7;if(_0x14e6b4[_0xecac('0x28')]['includeAll']){_0x2b1f83[_0xecac('0x3c')]=[{'all':!![]}];}return db[_0xecac('0x3b')][_0xecac('0x3d')](_0x2b1f83);})['then'](function(_0x1544f7){_0x3c76f3[_0xecac('0x3e')]=_0x1544f7;return _0x3c76f3;})[_0xecac('0x21')](respondWithFilteredResult(_0x282e6f,_0x2b1f83))[_0xecac('0x3f')](handleError(_0x282e6f,null));};exports[_0xecac('0x40')]=function(_0x17df8a,_0x2f2696){var _0x182fff={'raw':!![],'where':{'id':_0x17df8a[_0xecac('0x41')]['id']}},_0x52bd4d={};_0x52bd4d[_0xecac('0x2b')]=_[_0xecac('0x27')](db['SquareDetailsReport'][_0xecac('0x42')]);_0x52bd4d[_0xecac('0x28')]=_['keys'](_0x17df8a[_0xecac('0x28')]);_0x52bd4d['filters']=_[_0xecac('0x2a')](_0x52bd4d['model'],_0x52bd4d['query']);_0x182fff[_0xecac('0x2c')]=_[_0xecac('0x2a')](_0x52bd4d[_0xecac('0x2b')],qs[_0xecac('0x2d')](_0x17df8a[_0xecac('0x28')][_0xecac('0x2d')]));_0x182fff[_0xecac('0x2c')]=_0x182fff['attributes'][_0xecac('0x2e')]?_0x182fff[_0xecac('0x2c')]:_0x52bd4d[_0xecac('0x2b')];if(_0x17df8a[_0xecac('0x28')]['includeAll']){_0x182fff['include']=[{'all':!![]}];}_0x182fff=_[_0xecac('0x36')]({},_0x182fff,_0x17df8a[_0xecac('0x43')]);return db[_0xecac('0x3b')][_0xecac('0x44')](_0x182fff)[_0xecac('0x21')](handleEntityNotFound(_0x2f2696,null))['then'](respondWithResult(_0x2f2696,null))[_0xecac('0x3f')](handleError(_0x2f2696,null));};exports['create']=function(_0x3528b7,_0x490472){return db[_0xecac('0x3b')][_0xecac('0x45')](_0x3528b7[_0xecac('0x46')],{})[_0xecac('0x21')](respondWithResult(_0x490472,0xc9))[_0xecac('0x3f')](handleError(_0x490472,null));};exports[_0xecac('0x1f')]=function(_0x13bc95,_0x18d457){if(_0x13bc95['body']['id']){delete _0x13bc95[_0xecac('0x46')]['id'];}return db[_0xecac('0x3b')][_0xecac('0x44')]({'where':{'id':_0x13bc95[_0xecac('0x41')]['id']}})[_0xecac('0x21')](handleEntityNotFound(_0x18d457,null))[_0xecac('0x21')](saveUpdates(_0x13bc95['body'],null))[_0xecac('0x21')](respondWithResult(_0x18d457,null))['catch'](handleError(_0x18d457,null));};exports['destroy']=function(_0x3808e1,_0x18539e){return db[_0xecac('0x3b')][_0xecac('0x44')]({'where':{'id':_0x3808e1['params']['id']}})['then'](handleEntityNotFound(_0x18539e,null))[_0xecac('0x21')](removeEntity(_0x18539e,null))[_0xecac('0x3f')](handleError(_0x18539e,null));};exports['describe']=function(_0x5b69b5,_0x9230d8){return db[_0xecac('0x3b')][_0xecac('0x47')]()[_0xecac('0x21')](respondWithResult(_0x9230d8,null))[_0xecac('0x3f')](handleError(_0x9230d8,null));};
\ No newline at end of file
+var _0xf548=['query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','count','includeAll','rows','catch','show','include','find','create','body','destroy','describe','html-pdf','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','reject','save','update','then','error','stack','name','index','SquareDetailsReport','rawAttributes','model','keys'];(function(_0x3dbc74,_0x34e5a5){var _0x24e804=function(_0x3fc387){while(--_0x3fc387){_0x3dbc74['push'](_0x3dbc74['shift']());}};_0x24e804(++_0x34e5a5);}(_0xf548,0x139));var _0x8f54=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0xf548[_0x383356];return _0x32ee5a;};'use strict';var pdf=require(_0x8f54('0x0'));var emlformat=require(_0x8f54('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8f54('0x2'));var BPromise=require(_0x8f54('0x3'));var Mustache=require(_0x8f54('0x4'));var util=require(_0x8f54('0x5'));var path=require(_0x8f54('0x6'));var sox=require(_0x8f54('0x7'));var csv=require(_0x8f54('0x8'));var ejs=require(_0x8f54('0x9'));var fs=require('fs');var _=require(_0x8f54('0xa'));var squel=require(_0x8f54('0xb'));var crypto=require(_0x8f54('0xc'));var jsforce=require(_0x8f54('0xd'));var deskjs=require(_0x8f54('0xe'));var toCsv=require(_0x8f54('0x8'));var querystring=require(_0x8f54('0xf'));var Papa=require('papaparse');var Redis=require(_0x8f54('0x10'));var authService=require(_0x8f54('0x11'));var qs=require(_0x8f54('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f54('0x13'))(_0x8f54('0x14'));var utils=require(_0x8f54('0x15'));var config=require(_0x8f54('0x16'));var db=require(_0x8f54('0x17'))['db'];function respondWithStatusCode(_0x434324,_0x37134f){_0x37134f=_0x37134f||0xcc;return function(_0x2cbda6){if(_0x2cbda6){return _0x434324[_0x8f54('0x18')](_0x37134f);}return _0x434324[_0x8f54('0x19')](_0x37134f)[_0x8f54('0x1a')]();};}function respondWithResult(_0xf7da1a,_0x549dd9){_0x549dd9=_0x549dd9||0xc8;return function(_0x15688f){if(_0x15688f){return _0xf7da1a['status'](_0x549dd9)[_0x8f54('0x1b')](_0x15688f);}};}function respondWithFilteredResult(_0x421ed8,_0x505dae){return function(_0x13f84c){if(_0x13f84c){var _0x2894ec=_0x13f84c['count'],_0xe75647=_0x505dae[_0x8f54('0x1c')],_0x163210=_0x505dae['offset']+_0x505dae[_0x8f54('0x1d')],_0x3dbdc;if(_0x163210>=_0x2894ec){_0x163210=_0x2894ec;_0x3dbdc=0xc8;}else{_0x3dbdc=0xce;}_0x421ed8['status'](_0x3dbdc);return _0x421ed8['set']('Content-Range',_0xe75647+'-'+_0x163210+'/'+_0x2894ec)[_0x8f54('0x1b')](_0x13f84c);}return null;};}function patchUpdates(_0x47d066){return function(_0xb5dd65){try{jsonpatch['apply'](_0xb5dd65,_0x47d066,!![]);}catch(_0x48f2be){return BPromise[_0x8f54('0x1e')](_0x48f2be);}return _0xb5dd65[_0x8f54('0x1f')]();};}function saveUpdates(_0x285ec9,_0x1ef5e4){return function(_0x240252){if(_0x240252){return _0x240252[_0x8f54('0x20')](_0x285ec9)[_0x8f54('0x21')](function(_0x19939a){return _0x19939a;});}return null;};}function removeEntity(_0x307685,_0x523c1c){return function(_0x5a1898){if(_0x5a1898){return _0x5a1898['destroy']()['then'](function(){_0x307685[_0x8f54('0x19')](0xcc)[_0x8f54('0x1a')]();});}};}function handleEntityNotFound(_0x5e3a5d,_0x323c17){return function(_0x55e963){if(!_0x55e963){_0x5e3a5d['sendStatus'](0x194);}return _0x55e963;};}function handleError(_0x5e17eb,_0x224a4e){_0x224a4e=_0x224a4e||0x1f4;return function(_0x3ec8e3){logger[_0x8f54('0x22')](_0x3ec8e3[_0x8f54('0x23')]);if(_0x3ec8e3['name']){delete _0x3ec8e3[_0x8f54('0x24')];}_0x5e17eb['status'](_0x224a4e)['send'](_0x3ec8e3);};}exports[_0x8f54('0x25')]=function(_0x4e4aa9,_0x215ddb){var _0x16c7b9={},_0x56eabd={},_0x58817f={'count':0x0,'rows':[]};var _0x22caac=db[_0x8f54('0x26')][_0x8f54('0x27')];_0x56eabd[_0x8f54('0x28')]=_[_0x8f54('0x29')](_0x22caac);_0x56eabd['query']=_[_0x8f54('0x29')](_0x4e4aa9[_0x8f54('0x2a')]);_0x56eabd[_0x8f54('0x2b')]=_[_0x8f54('0x2c')](_0x56eabd[_0x8f54('0x28')],_0x56eabd[_0x8f54('0x2a')]);_0x16c7b9[_0x8f54('0x2d')]=_[_0x8f54('0x2c')](_0x56eabd[_0x8f54('0x28')],qs[_0x8f54('0x2e')](_0x4e4aa9['query'][_0x8f54('0x2e')]));_0x16c7b9['attributes']=_0x16c7b9['attributes'][_0x8f54('0x2f')]?_0x16c7b9['attributes']:_0x56eabd[_0x8f54('0x28')];if(!_0x4e4aa9[_0x8f54('0x2a')]['hasOwnProperty'](_0x8f54('0x30'))){_0x16c7b9[_0x8f54('0x1d')]=qs[_0x8f54('0x1d')](_0x4e4aa9[_0x8f54('0x2a')]['limit']);_0x16c7b9[_0x8f54('0x1c')]=qs[_0x8f54('0x1c')](_0x4e4aa9[_0x8f54('0x2a')][_0x8f54('0x1c')]);}_0x16c7b9[_0x8f54('0x31')]=qs[_0x8f54('0x32')](_0x4e4aa9[_0x8f54('0x2a')][_0x8f54('0x32')]);_0x16c7b9[_0x8f54('0x33')]=qs[_0x8f54('0x2b')](_[_0x8f54('0x34')](_0x4e4aa9['query'],_0x56eabd[_0x8f54('0x2b')]));if(_0x4e4aa9[_0x8f54('0x2a')][_0x8f54('0x35')]){_0x16c7b9[_0x8f54('0x33')]=_[_0x8f54('0x36')](_0x16c7b9[_0x8f54('0x33')],{'$or':_[_0x8f54('0x37')](_0x22caac,function(_0x3c48c){if(_0x3c48c['type'][_0x8f54('0x38')]!==_0x8f54('0x39')){var _0x57ba5a={};_0x57ba5a[_0x3c48c[_0x8f54('0x3a')]]={'$like':'%'+_0x4e4aa9['query'][_0x8f54('0x35')]+'%'};return _0x57ba5a;}})});}_0x16c7b9=_['merge']({},_0x16c7b9,_0x4e4aa9[_0x8f54('0x3b')]);var _0x2dfa5c={'where':_0x16c7b9[_0x8f54('0x33')]};return db[_0x8f54('0x26')][_0x8f54('0x3c')](_0x2dfa5c)[_0x8f54('0x21')](function(_0x183831){_0x58817f[_0x8f54('0x3c')]=_0x183831;if(_0x4e4aa9[_0x8f54('0x2a')][_0x8f54('0x3d')]){_0x16c7b9['include']=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x16c7b9);})[_0x8f54('0x21')](function(_0x4e47e9){_0x58817f[_0x8f54('0x3e')]=_0x4e47e9;return _0x58817f;})[_0x8f54('0x21')](respondWithFilteredResult(_0x215ddb,_0x16c7b9))[_0x8f54('0x3f')](handleError(_0x215ddb,null));};exports[_0x8f54('0x40')]=function(_0x5456ad,_0x5cd523){var _0x2496d5={'raw':!![],'where':{'id':_0x5456ad['params']['id']}},_0x57adaf={};_0x57adaf[_0x8f54('0x28')]=_[_0x8f54('0x29')](db[_0x8f54('0x26')][_0x8f54('0x27')]);_0x57adaf[_0x8f54('0x2a')]=_[_0x8f54('0x29')](_0x5456ad[_0x8f54('0x2a')]);_0x57adaf[_0x8f54('0x2b')]=_[_0x8f54('0x2c')](_0x57adaf['model'],_0x57adaf[_0x8f54('0x2a')]);_0x2496d5[_0x8f54('0x2d')]=_[_0x8f54('0x2c')](_0x57adaf[_0x8f54('0x28')],qs['fields'](_0x5456ad[_0x8f54('0x2a')]['fields']));_0x2496d5[_0x8f54('0x2d')]=_0x2496d5['attributes'][_0x8f54('0x2f')]?_0x2496d5[_0x8f54('0x2d')]:_0x57adaf['model'];if(_0x5456ad[_0x8f54('0x2a')]['includeAll']){_0x2496d5[_0x8f54('0x41')]=[{'all':!![]}];}_0x2496d5=_['merge']({},_0x2496d5,_0x5456ad[_0x8f54('0x3b')]);return db[_0x8f54('0x26')][_0x8f54('0x42')](_0x2496d5)[_0x8f54('0x21')](handleEntityNotFound(_0x5cd523,null))[_0x8f54('0x21')](respondWithResult(_0x5cd523,null))['catch'](handleError(_0x5cd523,null));};exports['create']=function(_0x2db294,_0x4a8f79){return db[_0x8f54('0x26')][_0x8f54('0x43')](_0x2db294[_0x8f54('0x44')],{})['then'](respondWithResult(_0x4a8f79,0xc9))[_0x8f54('0x3f')](handleError(_0x4a8f79,null));};exports[_0x8f54('0x20')]=function(_0x356e83,_0x6d49e4){if(_0x356e83[_0x8f54('0x44')]['id']){delete _0x356e83[_0x8f54('0x44')]['id'];}return db[_0x8f54('0x26')][_0x8f54('0x42')]({'where':{'id':_0x356e83['params']['id']}})['then'](handleEntityNotFound(_0x6d49e4,null))['then'](saveUpdates(_0x356e83[_0x8f54('0x44')],null))[_0x8f54('0x21')](respondWithResult(_0x6d49e4,null))[_0x8f54('0x3f')](handleError(_0x6d49e4,null));};exports[_0x8f54('0x45')]=function(_0x35709f,_0x1a5337){return db[_0x8f54('0x26')][_0x8f54('0x42')]({'where':{'id':_0x35709f['params']['id']}})[_0x8f54('0x21')](handleEntityNotFound(_0x1a5337,null))[_0x8f54('0x21')](removeEntity(_0x1a5337,null))[_0x8f54('0x3f')](handleError(_0x1a5337,null));};exports[_0x8f54('0x46')]=function(_0x378731,_0x226612){return db[_0x8f54('0x26')][_0x8f54('0x46')]()[_0x8f54('0x21')](respondWithResult(_0x226612,null))[_0x8f54('0x3f')](handleError(_0x226612,null));};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js
index 2b8dbe5..f9d1be5 100644
--- a/server/api/squareReportDetail/squareReportDetail.model.js
+++ b/server/api/squareReportDetail/squareReportDetail.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe9ef=['bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','report_square_details','lodash','../../config/logger','api'];(function(_0x354083,_0x1a40bb){var _0x37e5a2=function(_0x42505e){while(--_0x42505e){_0x354083['push'](_0x354083['shift']());}};_0x37e5a2(++_0x1a40bb);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0xe9ef[_0x154192];return _0x3c2792;};'use strict';var _=require(_0xfe9e('0x0'));var util=require('util');var logger=require(_0xfe9e('0x1'))(_0xfe9e('0x2'));var moment=require('moment');var BPromise=require(_0xfe9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe9e('0x4'));var rimraf=require(_0xfe9e('0x5'));var config=require(_0xfe9e('0x6'));var attributes=require(_0xfe9e('0x7'));module['exports']=function(_0x448c5b,_0x929d6d){return _0x448c5b['define']('SquareDetailsReport',attributes,{'tableName':_0xfe9e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0e5=['util','../../config/logger','api','moment','path','../../config/environment','exports','SquareDetailsReport','report_square_details','lodash'];(function(_0x4d2a6e,_0x185f42){var _0x2fa8bf=function(_0x48f9d4){while(--_0x48f9d4){_0x4d2a6e['push'](_0x4d2a6e['shift']());}};_0x2fa8bf(++_0x185f42);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0x4a232c,_0x4db76b){_0x4a232c=_0x4a232c-0x0;var _0xb5807f=_0xb0e5[_0x4a232c];return _0xb5807f;};'use strict';var _=require(_0x5b0e('0x0'));var util=require(_0x5b0e('0x1'));var logger=require(_0x5b0e('0x2'))(_0x5b0e('0x3'));var moment=require(_0x5b0e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b0e('0x5'));var rimraf=require('rimraf');var config=require(_0x5b0e('0x6'));var attributes=require('./squareReportDetail.attributes');module[_0x5b0e('0x7')]=function(_0x3f9d1b,_0x5222fe){return _0x3f9d1b['define'](_0x5b0e('0x8'),attributes,{'tableName':_0x5b0e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js
index ca5a8ce..b61b4e7 100644
--- a/server/api/squareReportDetail/squareReportDetail.rpc.js
+++ b/server/api/squareReportDetail/squareReportDetail.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8c79=['lodash','randomstring','../../mysqldb','../../config/utils','rpc','http','then','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','catch'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x8c79,0xa8));var _0x98c7=function(_0x4cc3a4,_0x219374){_0x4cc3a4=_0x4cc3a4-0x0;var _0x3f64c2=_0x8c79[_0x4cc3a4];return _0x3f64c2;};'use strict';var _=require(_0x98c7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x98c7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98c7('0x2'))['db'];var utils=require(_0x98c7('0x3'));var logger=require('../../config/logger')(_0x98c7('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x98c7('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x57b072,_0x2cba7b,_0x25dd4c){return new BPromise(function(_0x513208,_0x538a81){return client['request'](_0x57b072,_0x25dd4c)[_0x98c7('0x6')](function(_0x18ccbe){logger[_0x98c7('0x7')]('SquareDetailsReport,\x20%s,\x20%s',_0x2cba7b,_0x98c7('0x8'));logger['debug'](_0x98c7('0x9'),_0x2cba7b,_0x98c7('0x8'),JSON[_0x98c7('0xa')](_0x18ccbe));if(_0x18ccbe[_0x98c7('0xb')]){if(_0x18ccbe[_0x98c7('0xb')][_0x98c7('0xc')]===0x1f4){logger[_0x98c7('0xb')](_0x98c7('0xd'),_0x2cba7b,_0x18ccbe[_0x98c7('0xb')][_0x98c7('0xe')]);return _0x538a81(_0x18ccbe[_0x98c7('0xb')][_0x98c7('0xe')]);}logger[_0x98c7('0xb')](_0x98c7('0xd'),_0x2cba7b,_0x18ccbe[_0x98c7('0xb')][_0x98c7('0xe')]);return _0x513208(_0x18ccbe['error']['message']);}else{logger[_0x98c7('0x7')](_0x98c7('0xd'),_0x2cba7b,_0x98c7('0x8'));_0x513208(_0x18ccbe[_0x98c7('0xf')]['message']);}})['catch'](function(_0x228a73){logger['error'](_0x98c7('0xd'),_0x2cba7b,_0x228a73);_0x538a81(_0x228a73);});});}exports[_0x98c7('0x10')]=function(_0x22b669){var _0x3fb47e=this;return new Promise(function(_0x5df15b,_0x298283){return db[_0x98c7('0x11')][_0x98c7('0x12')](_0x22b669[_0x98c7('0x13')],{'raw':_0x22b669[_0x98c7('0x14')]?_0x22b669[_0x98c7('0x14')][_0x98c7('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x3d2a3d){logger[_0x98c7('0x7')]('CreateSquareDetailsReport',_0x22b669);logger[_0x98c7('0x16')](_0x98c7('0x10'),_0x22b669,JSON[_0x98c7('0xa')](_0x3d2a3d));_0x5df15b(_0x3d2a3d);})[_0x98c7('0x17')](function(_0x206000){logger[_0x98c7('0xb')](_0x98c7('0x10'),_0x206000[_0x98c7('0xe')],_0x22b669);_0x298283(_0x3fb47e[_0x98c7('0xb')](0x1f4,_0x206000[_0x98c7('0xe')]));});});};
\ No newline at end of file
+var _0x3c70=['info','result','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4a6399,_0x549821){var _0xe27f8c=function(_0x51de61){while(--_0x51de61){_0x4a6399['push'](_0x4a6399['shift']());}};_0xe27f8c(++_0x549821);}(_0x3c70,0x10c));var _0x03c7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x3c70[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var moment=require(_0x03c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x03c7('0x3'));var fs=require('fs');var Redis=require(_0x03c7('0x4'));var db=require(_0x03c7('0x5'))['db'];var utils=require(_0x03c7('0x6'));var logger=require(_0x03c7('0x7'))(_0x03c7('0x8'));var config=require('../../config/environment');var jayson=require(_0x03c7('0x9'));var client=jayson['client'][_0x03c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fb51b,_0x44022f,_0x4d8212){return new BPromise(function(_0x263185,_0x1b6acc){return client[_0x03c7('0xb')](_0x3fb51b,_0x4d8212)['then'](function(_0xc030ba){logger['info'](_0x03c7('0xc'),_0x44022f,_0x03c7('0xd'));logger['debug'](_0x03c7('0xe'),_0x44022f,_0x03c7('0xd'),JSON[_0x03c7('0xf')](_0xc030ba));if(_0xc030ba[_0x03c7('0x10')]){if(_0xc030ba[_0x03c7('0x10')]['code']===0x1f4){logger['error'](_0x03c7('0xc'),_0x44022f,_0xc030ba[_0x03c7('0x10')]['message']);return _0x1b6acc(_0xc030ba[_0x03c7('0x10')][_0x03c7('0x11')]);}logger[_0x03c7('0x10')](_0x03c7('0xc'),_0x44022f,_0xc030ba[_0x03c7('0x10')]['message']);return _0x263185(_0xc030ba[_0x03c7('0x10')]['message']);}else{logger[_0x03c7('0x12')](_0x03c7('0xc'),_0x44022f,'request\x20sent');_0x263185(_0xc030ba[_0x03c7('0x13')][_0x03c7('0x11')]);}})[_0x03c7('0x14')](function(_0x5e8b01){logger[_0x03c7('0x10')](_0x03c7('0xc'),_0x44022f,_0x5e8b01);_0x1b6acc(_0x5e8b01);});});}exports[_0x03c7('0x15')]=function(_0xdb40cc){var _0x37118f=this;return new Promise(function(_0x2946d7,_0x523a76){return db['SquareDetailsReport'][_0x03c7('0x16')](_0xdb40cc[_0x03c7('0x17')],{'raw':_0xdb40cc[_0x03c7('0x18')]?_0xdb40cc[_0x03c7('0x18')][_0x03c7('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1e3de1){logger[_0x03c7('0x12')]('CreateSquareDetailsReport',_0xdb40cc);logger['debug']('CreateSquareDetailsReport',_0xdb40cc,JSON[_0x03c7('0xf')](_0x1e3de1));_0x2946d7(_0x1e3de1);})[_0x03c7('0x14')](function(_0x3a5da2){logger[_0x03c7('0x10')](_0x03c7('0x15'),_0x3a5da2[_0x03c7('0x11')],_0xdb40cc);_0x523a76(_0x37118f[_0x03c7('0x10')](0x1f4,_0x3a5da2['message']));});});};
\ No newline at end of file
diff --git a/server/api/system/index.js b/server/api/system/index.js
index 3c5519d..fc2b11e 100644
--- a/server/api/system/index.js
+++ b/server/api/system/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe022=['index','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x55c9fd,_0x3bcb8f){var _0x10d95a=function(_0x48b148){while(--_0x48b148){_0x55c9fd['push'](_0x55c9fd['shift']());}};_0x10d95a(++_0x3bcb8f);}(_0xe022,0x1ea));var _0x2e02=function(_0x3e092e,_0x243ca5){_0x3e092e=_0x3e092e-0x0;var _0x11df90=_0xe022[_0x3e092e];return _0x11df90;};'use strict';var express=require(_0x2e02('0x0'));var router=express[_0x2e02('0x1')]();var auth=require(_0x2e02('0x2'));var controller=require('./system.controller');router[_0x2e02('0x3')]('/',auth[_0x2e02('0x4')](),controller[_0x2e02('0x5')]);router[_0x2e02('0x3')](_0x2e02('0x6'),auth[_0x2e02('0x4')](),controller[_0x2e02('0x7')]);module[_0x2e02('0x8')]=router;
\ No newline at end of file
+var _0x1bfd=['get','killProcess','express','Router','../../components/auth/service','./system.controller','isAuthenticated','index'];(function(_0x5c4178,_0x11471c){var _0x384e71=function(_0x4ff0db){while(--_0x4ff0db){_0x5c4178['push'](_0x5c4178['shift']());}};_0x384e71(++_0x11471c);}(_0x1bfd,0x132));var _0xd1bf=function(_0x489ba5,_0xa1a03c){_0x489ba5=_0x489ba5-0x0;var _0x3727e9=_0x1bfd[_0x489ba5];return _0x3727e9;};'use strict';var express=require(_0xd1bf('0x0'));var router=express[_0xd1bf('0x1')]();var auth=require(_0xd1bf('0x2'));var controller=require(_0xd1bf('0x3'));router['get']('/',auth[_0xd1bf('0x4')](),controller[_0xd1bf('0x5')]);router[_0xd1bf('0x6')]('/process/:pid/kill',auth[_0xd1bf('0x4')](),controller[_0xd1bf('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js
index 72e1ffa..ecade07 100644
--- a/server/api/system/system.controller.js
+++ b/server/api/system/system.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5421=['SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','child_process','exec','../../config/logger','util','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','send','index','getAllData','json','status','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','then','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill'];(function(_0x3763da,_0x58158b){var _0x5d192f=function(_0x329668){while(--_0x329668){_0x3763da['push'](_0x3763da['shift']());}};_0x5d192f(++_0x58158b);}(_0x5421,0xc9));var _0x1542=function(_0x12f35c,_0x23fe06){_0x12f35c=_0x12f35c-0x0;var _0xe7442a=_0x5421[_0x12f35c];return _0xe7442a;};'use strict';var info=require('systeminformation');var exec=require(_0x1542('0x0'))[_0x1542('0x1')];var logger=require(_0x1542('0x2'))('api');var util=require(_0x1542('0x3'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x40b34a,_0x30b470,_0x51c5bd){_0x30b470=_0x30b470||0x1f4;return function(_0x3a6b18){logger[_0x1542('0x4')](_0x1542('0x5'),_0x51c5bd,_0x30b470,util['inspect'](_0x3a6b18,{'showHidden':![],'depth':null}));delete _0x3a6b18['name'];_0x40b34a['status'](_0x30b470)[_0x1542('0x6')](_0x3a6b18);};}exports[_0x1542('0x7')]=function(_0x15f796,_0x3ec7ac){return info[_0x1542('0x8')]()['then'](function(_0x6d7ad5){return _0x3ec7ac['status'](0xc8)[_0x1542('0x9')](_0x6d7ad5);})['catch'](function(_0x3b56f8){return _0x3ec7ac[_0x1542('0xa')](0x1f4)[_0x1542('0x9')](_0x3b56f8);});};exports['killProcess']=function(_0x5be261,_0x18d704){var _0x22c6d1=['components/import/cm'];return new BPromise(function(_0x3bc64f,_0x1ee7d1){return exec(util[_0x1542('0xb')](_0x1542('0xc'),_0x5be261['params'][_0x1542('0xd')]),function(_0xdfa924,_0xe838f1,_0x39a850){if(_0xdfa924){return _0x1ee7d1(_0xdfa924);}return _0x3bc64f(_0xe838f1);});})[_0x1542('0xe')](function(_0xe299db){var _0x370102=![];var _0x544390=_0xe299db['split'](/\n/);for(var _0x21df8a=0x0,_0x2b63da=_0x22c6d1[_0x1542('0xf')];_0x21df8a<_0x2b63da,_0x370102===![];_0x21df8a+=0x1){if(_0xe299db[_0x1542('0x10')](_0x22c6d1[_0x21df8a])>=0x0){_0x370102=!![];}}if(!_0x370102){throw new Error(util[_0x1542('0xb')](_0x1542('0x11'),_0x5be261['params'][_0x1542('0xd')]));}process[_0x1542('0x12')](_0x5be261['params'][_0x1542('0xd')],_0x1542('0x13'));return _0x18d704[_0x1542('0xa')](0xc8)[_0x1542('0x9')]({'message':util[_0x1542('0xb')](_0x1542('0x14'),_0x5be261['params'][_0x1542('0xd')])});})['catch'](handleError(_0x18d704,null,_0x1542('0x15')));};
\ No newline at end of file
+var _0xd11c=['format','systeminformation','exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT'];(function(_0x55ec3a,_0x3e9b1c){var _0x5ae8e7=function(_0xd47865){while(--_0xd47865){_0x55ec3a['push'](_0x55ec3a['shift']());}};_0x5ae8e7(++_0x3e9b1c);}(_0xd11c,0x151));var _0xcd11=function(_0x4a6162,_0x145f1f){_0x4a6162=_0x4a6162-0x0;var _0x3e49ac=_0xd11c[_0x4a6162];return _0x3e49ac;};'use strict';var info=require(_0xcd11('0x0'));var exec=require('child_process')[_0xcd11('0x1')];var logger=require(_0xcd11('0x2'))(_0xcd11('0x3'));var util=require(_0xcd11('0x4'));var BPromise=require(_0xcd11('0x5'));var _=require('lodash');function handleError(_0x24d4c2,_0x3701cd,_0xee86bf){_0x3701cd=_0x3701cd||0x1f4;return function(_0x3b2be2){logger[_0xcd11('0x6')](_0xcd11('0x7'),_0xee86bf,_0x3701cd,util[_0xcd11('0x8')](_0x3b2be2,{'showHidden':![],'depth':null}));delete _0x3b2be2[_0xcd11('0x9')];_0x24d4c2[_0xcd11('0xa')](_0x3701cd)[_0xcd11('0xb')](_0x3b2be2);};}exports[_0xcd11('0xc')]=function(_0x328a75,_0x66588c){return info[_0xcd11('0xd')]()[_0xcd11('0xe')](function(_0xa3709a){return _0x66588c['status'](0xc8)[_0xcd11('0xf')](_0xa3709a);})[_0xcd11('0x10')](function(_0x44a28c){return _0x66588c['status'](0x1f4)['json'](_0x44a28c);});};exports[_0xcd11('0x11')]=function(_0xde71c9,_0x55ea81){var _0x397f9e=[_0xcd11('0x12')];return new BPromise(function(_0x3fa71d,_0x523226){return exec(util['format'](_0xcd11('0x13'),_0xde71c9[_0xcd11('0x14')][_0xcd11('0x15')]),function(_0x4b2252,_0x3da481,_0x3db5dd){if(_0x4b2252){return _0x523226(_0x4b2252);}return _0x3fa71d(_0x3da481);});})['then'](function(_0x2f488e){var _0x5c3aa0=![];var _0x3d42ae=_0x2f488e['split'](/\n/);for(var _0x5d34a7=0x0,_0x501d70=_0x397f9e[_0xcd11('0x16')];_0x5d34a7<_0x501d70,_0x5c3aa0===![];_0x5d34a7+=0x1){if(_0x2f488e[_0xcd11('0x17')](_0x397f9e[_0x5d34a7])>=0x0){_0x5c3aa0=!![];}}if(!_0x5c3aa0){throw new Error(util['format'](_0xcd11('0x18'),_0xde71c9['params'][_0xcd11('0x15')]));}process[_0xcd11('0x19')](_0xde71c9['params']['pid'],_0xcd11('0x1a'));return _0x55ea81[_0xcd11('0xa')](0xc8)['json']({'message':util[_0xcd11('0x1b')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0xde71c9[_0xcd11('0x14')]['pid'])});})[_0xcd11('0x10')](handleError(_0x55ea81,null,_0xcd11('0x11')));};
\ No newline at end of file
diff --git a/server/api/tag/index.js b/server/api/tag/index.js
index 01151af..335cfa6 100644
--- a/server/api/tag/index.js
+++ b/server/api/tag/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8603=['../../config/environment','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x553c2a,_0x592c23){var _0x37988b=function(_0x5ccdf1){while(--_0x5ccdf1){_0x553c2a['push'](_0x553c2a['shift']());}};_0x37988b(++_0x592c23);}(_0x8603,0x190));var _0x3860=function(_0x5528c3,_0x35a416){_0x5528c3=_0x5528c3-0x0;var _0x47ec1b=_0x8603[_0x5528c3];return _0x47ec1b;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3860('0x3'));var interaction=require(_0x3860('0x4'));var config=require(_0x3860('0x5'));var controller=require('./tag.controller');router[_0x3860('0x6')]('/',auth['isAuthenticated'](),controller[_0x3860('0x7')]);router[_0x3860('0x6')](_0x3860('0x8'),auth[_0x3860('0x9')](),controller[_0x3860('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3860('0xb')](_0x3860('0x8'),auth['isAuthenticated'](),controller[_0x3860('0xc')]);router[_0x3860('0xd')]('/:id',auth[_0x3860('0x9')](),controller[_0x3860('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','post','create','put','update','exports'];(function(_0x4a2ba2,_0x5901b9){var _0x1d09fd=function(_0x28648b){while(--_0x28648b){_0x4a2ba2['push'](_0x4a2ba2['shift']());}};_0x1d09fd(++_0x5901b9);}(_0x0b0e,0x187));var _0xe0b0=function(_0xb77dfe,_0x39c4c7){_0xb77dfe=_0xb77dfe-0x0;var _0x5e4f5d=_0x0b0e[_0xb77dfe];return _0x5e4f5d;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe0b0('0xc')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router[_0xe0b0('0xe')]('/:id',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xf')]);router['delete'](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js
index 1cd1e8c..b0e8530 100644
--- a/server/api/tag/tag.attributes.js
+++ b/server/api/tag/tag.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3916=['sequelize','exports','STRING','name','#0091EA'];(function(_0x2cf7a5,_0x44dd28){var _0x241fba=function(_0x5fc7b4){while(--_0x5fc7b4){_0x2cf7a5['push'](_0x2cf7a5['shift']());}};_0x241fba(++_0x44dd28);}(_0x3916,0x1c7));var _0x6391=function(_0xfbe06e,_0x2fb7ab){_0xfbe06e=_0xfbe06e-0x0;var _0x24e5b6=_0x3916[_0xfbe06e];return _0x24e5b6;};'use strict';var Sequelize=require(_0x6391('0x0'));module[_0x6391('0x1')]={'name':{'type':Sequelize[_0x6391('0x2')],'unique':_0x6391('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x6391('0x4')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4aa0=['name','sequelize','exports','STRING'];(function(_0x572861,_0x2caac5){var _0x53fcfd=function(_0x48deda){while(--_0x48deda){_0x572861['push'](_0x572861['shift']());}};_0x53fcfd(++_0x2caac5);}(_0x4aa0,0x18d));var _0x04aa=function(_0x2d7320,_0x34e8c4){_0x2d7320=_0x2d7320-0x0;var _0x5d9bdf=_0x4aa0[_0x2d7320];return _0x5d9bdf;};'use strict';var Sequelize=require(_0x04aa('0x0'));module[_0x04aa('0x1')]={'name':{'type':Sequelize[_0x04aa('0x2')],'unique':_0x04aa('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x04aa('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x04aa('0x2')]}};
\ No newline at end of file
diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js
index c4aa9a6..d8757e7 100644
--- a/server/api/tag/tag.controller.js
+++ b/server/api/tag/tag.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5cfc=['../../config/environment','status','count','offset','limit','set','json','reject','update','then','destroy','Tags','UserProfileResource','end','sendStatus','error','stack','index','Tag','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','catch','body','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0x5cfc,0x15d));var _0xc5cf=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x5cfc[_0x5a1cc9];return _0x471761;};'use strict';var pdf=require(_0xc5cf('0x0'));var emlformat=require(_0xc5cf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc5cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5cf('0x3'));var moment=require(_0xc5cf('0x4'));var BPromise=require(_0xc5cf('0x5'));var Mustache=require(_0xc5cf('0x6'));var util=require('util');var path=require(_0xc5cf('0x7'));var sox=require(_0xc5cf('0x8'));var csv=require('to-csv');var ejs=require(_0xc5cf('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc5cf('0xa'));var crypto=require(_0xc5cf('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc5cf('0xc'));var toCsv=require(_0xc5cf('0xd'));var querystring=require('querystring');var Papa=require(_0xc5cf('0xe'));var Redis=require(_0xc5cf('0xf'));var authService=require(_0xc5cf('0x10'));var qs=require(_0xc5cf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5cf('0x12'))(_0xc5cf('0x13'));var utils=require(_0xc5cf('0x14'));var config=require(_0xc5cf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x568972,_0x24ab95){_0x24ab95=_0x24ab95||0xcc;return function(_0x48c549){if(_0x48c549){return _0x568972['sendStatus'](_0x24ab95);}return _0x568972[_0xc5cf('0x16')](_0x24ab95)['end']();};}function respondWithResult(_0x157e8e,_0x550695){_0x550695=_0x550695||0xc8;return function(_0x4f284b){if(_0x4f284b){return _0x157e8e['status'](_0x550695)['json'](_0x4f284b);}};}function respondWithFilteredResult(_0x113d05,_0x5742c3){return function(_0x44ce40){if(_0x44ce40){var _0x6f65e3=_0x44ce40[_0xc5cf('0x17')],_0x4275e6=_0x5742c3[_0xc5cf('0x18')],_0x372b1d=_0x5742c3['offset']+_0x5742c3[_0xc5cf('0x19')],_0x9eba43;if(_0x372b1d>=_0x6f65e3){_0x372b1d=_0x6f65e3;_0x9eba43=0xc8;}else{_0x9eba43=0xce;}_0x113d05[_0xc5cf('0x16')](_0x9eba43);return _0x113d05[_0xc5cf('0x1a')]('Content-Range',_0x4275e6+'-'+_0x372b1d+'/'+_0x6f65e3)[_0xc5cf('0x1b')](_0x44ce40);}return null;};}function patchUpdates(_0x324dc0){return function(_0x161f97){try{jsonpatch['apply'](_0x161f97,_0x324dc0,!![]);}catch(_0x5ba4ca){return BPromise[_0xc5cf('0x1c')](_0x5ba4ca);}return _0x161f97['save']();};}function saveUpdates(_0x545fb7,_0x43472a){return function(_0x5e81b2){if(_0x5e81b2){return _0x5e81b2[_0xc5cf('0x1d')](_0x545fb7)[_0xc5cf('0x1e')](function(_0x426c30){return _0x426c30;});}return null;};}function removeEntity(_0x512ddb,_0x5394db){return function(_0x330a3a){if(_0x330a3a){return _0x330a3a[_0xc5cf('0x1f')]()[_0xc5cf('0x1e')](function(){var _0x23209f=_0x330a3a['get']({'plain':!![]});var _0x9672e0=_0xc5cf('0x20');return db[_0xc5cf('0x21')][_0xc5cf('0x1f')]({'where':{'type':_0x9672e0,'resourceId':_0x23209f['id']}})[_0xc5cf('0x1e')](function(){return _0x330a3a;});})[_0xc5cf('0x1e')](function(){_0x512ddb['status'](0xcc)[_0xc5cf('0x22')]();});}};}function handleEntityNotFound(_0x3a3525,_0x215468){return function(_0x30a9c2){if(!_0x30a9c2){_0x3a3525[_0xc5cf('0x23')](0x194);}return _0x30a9c2;};}function handleError(_0x275b42,_0x27633e){_0x27633e=_0x27633e||0x1f4;return function(_0x59c3fe){logger[_0xc5cf('0x24')](_0x59c3fe[_0xc5cf('0x25')]);if(_0x59c3fe['name']){delete _0x59c3fe['name'];}_0x275b42[_0xc5cf('0x16')](_0x27633e)['send'](_0x59c3fe);};}exports[_0xc5cf('0x26')]=function(_0x213525,_0x55d119){var _0x404bfe={},_0x1aac55={},_0x3e938a={'count':0x0,'rows':[]};var _0x46bf2e=db[_0xc5cf('0x27')][_0xc5cf('0x28')];_0x1aac55[_0xc5cf('0x29')]=_[_0xc5cf('0x2a')](_0x46bf2e);_0x1aac55[_0xc5cf('0x2b')]=_[_0xc5cf('0x2a')](_0x213525[_0xc5cf('0x2b')]);_0x1aac55[_0xc5cf('0x2c')]=_[_0xc5cf('0x2d')](_0x1aac55[_0xc5cf('0x29')],_0x1aac55[_0xc5cf('0x2b')]);_0x404bfe[_0xc5cf('0x2e')]=_[_0xc5cf('0x2d')](_0x1aac55[_0xc5cf('0x29')],qs[_0xc5cf('0x2f')](_0x213525['query'][_0xc5cf('0x2f')]));_0x404bfe[_0xc5cf('0x2e')]=_0x404bfe['attributes'][_0xc5cf('0x30')]?_0x404bfe['attributes']:_0x1aac55['model'];if(!_0x213525[_0xc5cf('0x2b')][_0xc5cf('0x31')]('nolimit')){_0x404bfe[_0xc5cf('0x19')]=qs[_0xc5cf('0x19')](_0x213525[_0xc5cf('0x2b')]['limit']);_0x404bfe[_0xc5cf('0x18')]=qs['offset'](_0x213525[_0xc5cf('0x2b')]['offset']);}_0x404bfe['order']=qs['sort'](_0x213525['query']['sort']);_0x404bfe[_0xc5cf('0x32')]=qs[_0xc5cf('0x2c')](_[_0xc5cf('0x33')](_0x213525[_0xc5cf('0x2b')],_0x1aac55[_0xc5cf('0x2c')]));if(_0x213525['query'][_0xc5cf('0x34')]){_0x404bfe[_0xc5cf('0x32')]=_[_0xc5cf('0x35')](_0x404bfe['where'],{'$or':_[_0xc5cf('0x36')](_0x46bf2e,function(_0x589e4f){if(_0x589e4f[_0xc5cf('0x37')]['key']!==_0xc5cf('0x38')){var _0x302cd3={};_0x302cd3[_0x589e4f[_0xc5cf('0x39')]]={'$like':'%'+_0x213525[_0xc5cf('0x2b')][_0xc5cf('0x34')]+'%'};return _0x302cd3;}})});}_0x404bfe=_[_0xc5cf('0x35')]({},_0x404bfe,_0x213525[_0xc5cf('0x3a')]);var _0xdea622={'where':_0x404bfe['where']};return db[_0xc5cf('0x27')]['count'](_0xdea622)[_0xc5cf('0x1e')](function(_0x3fb118){_0x3e938a[_0xc5cf('0x17')]=_0x3fb118;if(_0x213525[_0xc5cf('0x2b')][_0xc5cf('0x3b')]){_0x404bfe[_0xc5cf('0x3c')]=[{'all':!![]}];}return db['Tag'][_0xc5cf('0x3d')](_0x404bfe);})['then'](function(_0x48ac65){_0x3e938a[_0xc5cf('0x3e')]=_0x48ac65;return _0x3e938a;})[_0xc5cf('0x1e')](respondWithFilteredResult(_0x55d119,_0x404bfe))['catch'](handleError(_0x55d119,null));};exports['show']=function(_0x1771e8,_0x26f395){var _0x170300={'raw':!![],'where':{'id':_0x1771e8[_0xc5cf('0x3f')]['id']}},_0x3ba6ce={};_0x3ba6ce[_0xc5cf('0x29')]=_[_0xc5cf('0x2a')](db['Tag'][_0xc5cf('0x28')]);_0x3ba6ce[_0xc5cf('0x2b')]=_[_0xc5cf('0x2a')](_0x1771e8[_0xc5cf('0x2b')]);_0x3ba6ce[_0xc5cf('0x2c')]=_['intersection'](_0x3ba6ce[_0xc5cf('0x29')],_0x3ba6ce[_0xc5cf('0x2b')]);_0x170300[_0xc5cf('0x2e')]=_['intersection'](_0x3ba6ce[_0xc5cf('0x29')],qs[_0xc5cf('0x2f')](_0x1771e8[_0xc5cf('0x2b')][_0xc5cf('0x2f')]));_0x170300[_0xc5cf('0x2e')]=_0x170300['attributes'][_0xc5cf('0x30')]?_0x170300[_0xc5cf('0x2e')]:_0x3ba6ce[_0xc5cf('0x29')];if(_0x1771e8[_0xc5cf('0x2b')][_0xc5cf('0x3b')]){_0x170300[_0xc5cf('0x3c')]=[{'all':!![]}];}_0x170300=_['merge']({},_0x170300,_0x1771e8['options']);return db[_0xc5cf('0x27')][_0xc5cf('0x40')](_0x170300)['then'](handleEntityNotFound(_0x26f395,null))[_0xc5cf('0x1e')](respondWithResult(_0x26f395,null))['catch'](handleError(_0x26f395,null));};exports['create']=function(_0x59fde2,_0x1d86eb){return db['Tag']['create'](_0x59fde2['body'],{})[_0xc5cf('0x1e')](function(_0x51062f){var _0x57572d=_0x59fde2[_0xc5cf('0x41')]['get']({'plain':!![]});if(!_0x57572d)throw new Error(_0xc5cf('0x42'));if(_0x57572d[_0xc5cf('0x43')]===_0xc5cf('0x41')){var _0x596ce5=_0x51062f['get']({'plain':!![]});var _0x1c7239=_0xc5cf('0x20');return db[_0xc5cf('0x44')][_0xc5cf('0x40')]({'where':{'name':_0x1c7239,'userProfileId':_0x57572d[_0xc5cf('0x45')]},'raw':!![]})[_0xc5cf('0x1e')](function(_0x52088f){if(_0x52088f&&_0x52088f[_0xc5cf('0x46')]===0x0){return db[_0xc5cf('0x21')]['create']({'name':_0x596ce5[_0xc5cf('0x47')],'resourceId':_0x596ce5['id'],'type':_0x52088f[_0xc5cf('0x47')],'sectionId':_0x52088f['id']},{})['then'](function(){return _0x51062f;});}else{return _0x51062f;}})[_0xc5cf('0x48')](function(_0x37e443){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37e443);throw _0x37e443;});}return _0x51062f;})[_0xc5cf('0x1e')](respondWithResult(_0x1d86eb,0xc9))[_0xc5cf('0x48')](handleError(_0x1d86eb,null));};exports[_0xc5cf('0x1d')]=function(_0x15594c,_0x485739){if(_0x15594c['body']['id']){delete _0x15594c[_0xc5cf('0x49')]['id'];}return db['Tag'][_0xc5cf('0x40')]({'where':{'id':_0x15594c[_0xc5cf('0x3f')]['id']}})[_0xc5cf('0x1e')](handleEntityNotFound(_0x485739,null))[_0xc5cf('0x1e')](saveUpdates(_0x15594c[_0xc5cf('0x49')],null))[_0xc5cf('0x1e')](respondWithResult(_0x485739,null))[_0xc5cf('0x48')](handleError(_0x485739,null));};exports['destroy']=function(_0xd28ac9,_0x41e8e2){return db[_0xc5cf('0x27')]['find']({'where':{'id':_0xd28ac9[_0xc5cf('0x3f')]['id']}})[_0xc5cf('0x1e')](handleEntityNotFound(_0x41e8e2,null))[_0xc5cf('0x1e')](removeEntity(_0x41e8e2,null))[_0xc5cf('0x48')](handleError(_0x41e8e2,null));};
\ No newline at end of file
+var _0x4aab=['rows','catch','find','create','body','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','Tags','UserProfileResource','error','stack','name','send','index','Tag','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','map','type','key','VIRTUAL','field','merge','options','include','findAll'];(function(_0x3627b4,_0x24cb16){var _0x4d4a62=function(_0x38e4ca){while(--_0x38e4ca){_0x3627b4['push'](_0x3627b4['shift']());}};_0x4d4a62(++_0x24cb16);}(_0x4aab,0xaa));var _0xb4aa=function(_0x15c14a,_0x431b99){_0x15c14a=_0x15c14a-0x0;var _0x136a34=_0x4aab[_0x15c14a];return _0x136a34;};'use strict';var pdf=require(_0xb4aa('0x0'));var emlformat=require(_0xb4aa('0x1'));var rimraf=require(_0xb4aa('0x2'));var zipdir=require(_0xb4aa('0x3'));var jsonpatch=require(_0xb4aa('0x4'));var rp=require(_0xb4aa('0x5'));var moment=require(_0xb4aa('0x6'));var BPromise=require(_0xb4aa('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb4aa('0x8'));var sox=require(_0xb4aa('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb4aa('0xa'));var crypto=require('crypto');var jsforce=require(_0xb4aa('0xb'));var deskjs=require(_0xb4aa('0xc'));var toCsv=require(_0xb4aa('0xd'));var querystring=require('querystring');var Papa=require(_0xb4aa('0xe'));var Redis=require(_0xb4aa('0xf'));var authService=require(_0xb4aa('0x10'));var qs=require(_0xb4aa('0x11'));var hardwareService=require(_0xb4aa('0x12'));var logger=require('../../config/logger')(_0xb4aa('0x13'));var utils=require(_0xb4aa('0x14'));var config=require(_0xb4aa('0x15'));var db=require(_0xb4aa('0x16'))['db'];function respondWithStatusCode(_0x5e4cbb,_0x2572cc){_0x2572cc=_0x2572cc||0xcc;return function(_0x203d64){if(_0x203d64){return _0x5e4cbb[_0xb4aa('0x17')](_0x2572cc);}return _0x5e4cbb[_0xb4aa('0x18')](_0x2572cc)[_0xb4aa('0x19')]();};}function respondWithResult(_0x50ebd6,_0xa81443){_0xa81443=_0xa81443||0xc8;return function(_0x196fed){if(_0x196fed){return _0x50ebd6[_0xb4aa('0x18')](_0xa81443)[_0xb4aa('0x1a')](_0x196fed);}};}function respondWithFilteredResult(_0x16415b,_0x5d54ad){return function(_0x15f473){if(_0x15f473){var _0x273b01=_0x15f473[_0xb4aa('0x1b')],_0x9c09a4=_0x5d54ad['offset'],_0x3e69b2=_0x5d54ad[_0xb4aa('0x1c')]+_0x5d54ad['limit'],_0x1e68a9;if(_0x3e69b2>=_0x273b01){_0x3e69b2=_0x273b01;_0x1e68a9=0xc8;}else{_0x1e68a9=0xce;}_0x16415b['status'](_0x1e68a9);return _0x16415b[_0xb4aa('0x1d')]('Content-Range',_0x9c09a4+'-'+_0x3e69b2+'/'+_0x273b01)['json'](_0x15f473);}return null;};}function patchUpdates(_0x5d6fb8){return function(_0xeb7984){try{jsonpatch[_0xb4aa('0x1e')](_0xeb7984,_0x5d6fb8,!![]);}catch(_0x345f63){return BPromise[_0xb4aa('0x1f')](_0x345f63);}return _0xeb7984[_0xb4aa('0x20')]();};}function saveUpdates(_0x4cab76,_0x17a453){return function(_0x11911b){if(_0x11911b){return _0x11911b[_0xb4aa('0x21')](_0x4cab76)[_0xb4aa('0x22')](function(_0x449102){return _0x449102;});}return null;};}function removeEntity(_0x2f48f2,_0x248641){return function(_0x28c1c7){if(_0x28c1c7){return _0x28c1c7[_0xb4aa('0x23')]()[_0xb4aa('0x22')](function(){var _0x5df5bb=_0x28c1c7['get']({'plain':!![]});var _0x3ac69c=_0xb4aa('0x24');return db[_0xb4aa('0x25')][_0xb4aa('0x23')]({'where':{'type':_0x3ac69c,'resourceId':_0x5df5bb['id']}})[_0xb4aa('0x22')](function(){return _0x28c1c7;});})['then'](function(){_0x2f48f2[_0xb4aa('0x18')](0xcc)[_0xb4aa('0x19')]();});}};}function handleEntityNotFound(_0x13c934,_0x207301){return function(_0x1e5ffa){if(!_0x1e5ffa){_0x13c934[_0xb4aa('0x17')](0x194);}return _0x1e5ffa;};}function handleError(_0x23fbf9,_0x3d98ce){_0x3d98ce=_0x3d98ce||0x1f4;return function(_0x5e90b0){logger[_0xb4aa('0x26')](_0x5e90b0[_0xb4aa('0x27')]);if(_0x5e90b0[_0xb4aa('0x28')]){delete _0x5e90b0['name'];}_0x23fbf9[_0xb4aa('0x18')](_0x3d98ce)[_0xb4aa('0x29')](_0x5e90b0);};}exports[_0xb4aa('0x2a')]=function(_0x1e82d5,_0xd49d90){var _0x4ce24e={},_0x410afb={},_0x4f5beb={'count':0x0,'rows':[]};var _0x2501a8=db[_0xb4aa('0x2b')]['rawAttributes'];_0x410afb['model']=_['keys'](_0x2501a8);_0x410afb[_0xb4aa('0x2c')]=_[_0xb4aa('0x2d')](_0x1e82d5[_0xb4aa('0x2c')]);_0x410afb['filters']=_[_0xb4aa('0x2e')](_0x410afb[_0xb4aa('0x2f')],_0x410afb[_0xb4aa('0x2c')]);_0x4ce24e[_0xb4aa('0x30')]=_[_0xb4aa('0x2e')](_0x410afb[_0xb4aa('0x2f')],qs['fields'](_0x1e82d5[_0xb4aa('0x2c')][_0xb4aa('0x31')]));_0x4ce24e[_0xb4aa('0x30')]=_0x4ce24e[_0xb4aa('0x30')][_0xb4aa('0x32')]?_0x4ce24e[_0xb4aa('0x30')]:_0x410afb[_0xb4aa('0x2f')];if(!_0x1e82d5['query'][_0xb4aa('0x33')]('nolimit')){_0x4ce24e[_0xb4aa('0x34')]=qs[_0xb4aa('0x34')](_0x1e82d5[_0xb4aa('0x2c')][_0xb4aa('0x34')]);_0x4ce24e[_0xb4aa('0x1c')]=qs['offset'](_0x1e82d5['query'][_0xb4aa('0x1c')]);}_0x4ce24e[_0xb4aa('0x35')]=qs[_0xb4aa('0x36')](_0x1e82d5[_0xb4aa('0x2c')]['sort']);_0x4ce24e[_0xb4aa('0x37')]=qs[_0xb4aa('0x38')](_[_0xb4aa('0x39')](_0x1e82d5['query'],_0x410afb[_0xb4aa('0x38')]));if(_0x1e82d5[_0xb4aa('0x2c')]['filter']){_0x4ce24e[_0xb4aa('0x37')]=_['merge'](_0x4ce24e[_0xb4aa('0x37')],{'$or':_[_0xb4aa('0x3a')](_0x2501a8,function(_0x4a53e9){if(_0x4a53e9[_0xb4aa('0x3b')][_0xb4aa('0x3c')]!==_0xb4aa('0x3d')){var _0x7a34bd={};_0x7a34bd[_0x4a53e9[_0xb4aa('0x3e')]]={'$like':'%'+_0x1e82d5[_0xb4aa('0x2c')]['filter']+'%'};return _0x7a34bd;}})});}_0x4ce24e=_[_0xb4aa('0x3f')]({},_0x4ce24e,_0x1e82d5[_0xb4aa('0x40')]);var _0x1bfc2a={'where':_0x4ce24e['where']};return db[_0xb4aa('0x2b')][_0xb4aa('0x1b')](_0x1bfc2a)['then'](function(_0x4c4f5d){_0x4f5beb['count']=_0x4c4f5d;if(_0x1e82d5['query']['includeAll']){_0x4ce24e[_0xb4aa('0x41')]=[{'all':!![]}];}return db[_0xb4aa('0x2b')][_0xb4aa('0x42')](_0x4ce24e);})[_0xb4aa('0x22')](function(_0x3ab992){_0x4f5beb[_0xb4aa('0x43')]=_0x3ab992;return _0x4f5beb;})['then'](respondWithFilteredResult(_0xd49d90,_0x4ce24e))[_0xb4aa('0x44')](handleError(_0xd49d90,null));};exports['show']=function(_0x378150,_0x1d08af){var _0x397f87={'raw':!![],'where':{'id':_0x378150['params']['id']}},_0x24307e={};_0x24307e[_0xb4aa('0x2f')]=_[_0xb4aa('0x2d')](db[_0xb4aa('0x2b')]['rawAttributes']);_0x24307e['query']=_[_0xb4aa('0x2d')](_0x378150['query']);_0x24307e[_0xb4aa('0x38')]=_['intersection'](_0x24307e['model'],_0x24307e[_0xb4aa('0x2c')]);_0x397f87[_0xb4aa('0x30')]=_[_0xb4aa('0x2e')](_0x24307e[_0xb4aa('0x2f')],qs[_0xb4aa('0x31')](_0x378150[_0xb4aa('0x2c')][_0xb4aa('0x31')]));_0x397f87[_0xb4aa('0x30')]=_0x397f87['attributes'][_0xb4aa('0x32')]?_0x397f87[_0xb4aa('0x30')]:_0x24307e[_0xb4aa('0x2f')];if(_0x378150[_0xb4aa('0x2c')]['includeAll']){_0x397f87[_0xb4aa('0x41')]=[{'all':!![]}];}_0x397f87=_['merge']({},_0x397f87,_0x378150[_0xb4aa('0x40')]);return db[_0xb4aa('0x2b')][_0xb4aa('0x45')](_0x397f87)[_0xb4aa('0x22')](handleEntityNotFound(_0x1d08af,null))[_0xb4aa('0x22')](respondWithResult(_0x1d08af,null))[_0xb4aa('0x44')](handleError(_0x1d08af,null));};exports['create']=function(_0x29f136,_0x17a68c){return db[_0xb4aa('0x2b')][_0xb4aa('0x46')](_0x29f136[_0xb4aa('0x47')],{})[_0xb4aa('0x22')](function(_0x1147b7){var _0x1d92ce=_0x29f136[_0xb4aa('0x48')][_0xb4aa('0x49')]({'plain':!![]});if(!_0x1d92ce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d92ce[_0xb4aa('0x4a')]==='user'){var _0x137759=_0x1147b7['get']({'plain':!![]});var _0x27b58b=_0xb4aa('0x24');return db[_0xb4aa('0x4b')]['find']({'where':{'name':_0x27b58b,'userProfileId':_0x1d92ce['userProfileId']},'raw':!![]})[_0xb4aa('0x22')](function(_0xd2e134){if(_0xd2e134&&_0xd2e134[_0xb4aa('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x137759['name'],'resourceId':_0x137759['id'],'type':_0xd2e134[_0xb4aa('0x28')],'sectionId':_0xd2e134['id']},{})['then'](function(){return _0x1147b7;});}else{return _0x1147b7;}})[_0xb4aa('0x44')](function(_0x9de9ea){logger[_0xb4aa('0x26')](_0xb4aa('0x4d'),_0x9de9ea);throw _0x9de9ea;});}return _0x1147b7;})[_0xb4aa('0x22')](respondWithResult(_0x17a68c,0xc9))[_0xb4aa('0x44')](handleError(_0x17a68c,null));};exports[_0xb4aa('0x21')]=function(_0xf4f024,_0x421cd2){if(_0xf4f024[_0xb4aa('0x47')]['id']){delete _0xf4f024[_0xb4aa('0x47')]['id'];}return db[_0xb4aa('0x2b')][_0xb4aa('0x45')]({'where':{'id':_0xf4f024[_0xb4aa('0x4e')]['id']}})[_0xb4aa('0x22')](handleEntityNotFound(_0x421cd2,null))[_0xb4aa('0x22')](saveUpdates(_0xf4f024[_0xb4aa('0x47')],null))[_0xb4aa('0x22')](respondWithResult(_0x421cd2,null))['catch'](handleError(_0x421cd2,null));};exports[_0xb4aa('0x23')]=function(_0x1ee324,_0x47eb9e){return db['Tag'][_0xb4aa('0x45')]({'where':{'id':_0x1ee324[_0xb4aa('0x4e')]['id']}})['then'](handleEntityNotFound(_0x47eb9e,null))[_0xb4aa('0x22')](removeEntity(_0x47eb9e,null))[_0xb4aa('0x44')](handleError(_0x47eb9e,null));};
\ No newline at end of file
diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js
index c1e34af..09d5f74 100644
--- a/server/api/tag/tag.model.js
+++ b/server/api/tag/tag.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8d19=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x46d84a,_0x130941){var _0x1d5080=function(_0x5a6531){while(--_0x5a6531){_0x46d84a['push'](_0x46d84a['shift']());}};_0x1d5080(++_0x130941);}(_0x8d19,0x16e));var _0x98d1=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x8d19[_0x6173fc];return _0x965fbe;};'use strict';var _=require(_0x98d1('0x0'));var util=require(_0x98d1('0x1'));var logger=require(_0x98d1('0x2'))(_0x98d1('0x3'));var moment=require(_0x98d1('0x4'));var BPromise=require(_0x98d1('0x5'));var rp=require(_0x98d1('0x6'));var fs=require('fs');var path=require(_0x98d1('0x7'));var rimraf=require(_0x98d1('0x8'));var config=require(_0x98d1('0x9'));var attributes=require(_0x98d1('0xa'));module[_0x98d1('0xb')]=function(_0x5c27bc,_0x5c00c2){return _0x5c27bc[_0x98d1('0xc')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7176=['define','Tag','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports'];(function(_0x21dc70,_0x287214){var _0x47e638=function(_0x41445d){while(--_0x41445d){_0x21dc70['push'](_0x21dc70['shift']());}};_0x47e638(++_0x287214);}(_0x7176,0x136));var _0x6717=function(_0x1dc10c,_0xa4533d){_0x1dc10c=_0x1dc10c-0x0;var _0x5b72d4=_0x7176[_0x1dc10c];return _0x5b72d4;};'use strict';var _=require(_0x6717('0x0'));var util=require(_0x6717('0x1'));var logger=require(_0x6717('0x2'))(_0x6717('0x3'));var moment=require(_0x6717('0x4'));var BPromise=require('bluebird');var rp=require(_0x6717('0x5'));var fs=require('fs');var path=require(_0x6717('0x6'));var rimraf=require(_0x6717('0x7'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x6717('0x8')]=function(_0x10f2ff,_0x53d602){return _0x10f2ff[_0x6717('0x9')](_0x6717('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js
index d800bac..4d648ab 100644
--- a/server/api/tag/tag.rpc.js
+++ b/server/api/tag/tag.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa4a=['client','http','then','info','Tag,\x20%s,\x20%s','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x372431,_0x5df362){var _0xd43b03=function(_0x4cda84){while(--_0x4cda84){_0x372431['push'](_0x372431['shift']());}};_0xd43b03(++_0x5df362);}(_0xaa4a,0x109));var _0xaaa4=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xaa4a[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xaaa4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaaa4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaaa4('0x2'))['db'];var utils=require(_0xaaa4('0x3'));var logger=require(_0xaaa4('0x4'))(_0xaaa4('0x5'));var config=require(_0xaaa4('0x6'));var jayson=require(_0xaaa4('0x7'));var client=jayson[_0xaaa4('0x8')][_0xaaa4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf660f7,_0x52e20f,_0x127562){return new BPromise(function(_0x59a02f,_0x178961){return client['request'](_0xf660f7,_0x127562)[_0xaaa4('0xa')](function(_0x45a410){logger[_0xaaa4('0xb')](_0xaaa4('0xc'),_0x52e20f,'request\x20sent');logger['debug'](_0xaaa4('0xd'),_0x52e20f,'request\x20sent',JSON[_0xaaa4('0xe')](_0x45a410));if(_0x45a410['error']){if(_0x45a410[_0xaaa4('0xf')][_0xaaa4('0x10')]===0x1f4){logger['error'](_0xaaa4('0xc'),_0x52e20f,_0x45a410['error'][_0xaaa4('0x11')]);return _0x178961(_0x45a410[_0xaaa4('0xf')][_0xaaa4('0x11')]);}logger[_0xaaa4('0xf')](_0xaaa4('0xc'),_0x52e20f,_0x45a410[_0xaaa4('0xf')][_0xaaa4('0x11')]);return _0x59a02f(_0x45a410[_0xaaa4('0xf')]['message']);}else{logger[_0xaaa4('0xb')](_0xaaa4('0xc'),_0x52e20f,_0xaaa4('0x12'));_0x59a02f(_0x45a410[_0xaaa4('0x13')][_0xaaa4('0x11')]);}})[_0xaaa4('0x14')](function(_0x1f2ee9){logger[_0xaaa4('0xf')](_0xaaa4('0xc'),_0x52e20f,_0x1f2ee9);_0x178961(_0x1f2ee9);});});}
\ No newline at end of file
+var _0x2472=['debug','request\x20sent','error','code','message','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s'];(function(_0x67f30a,_0x2e62de){var _0x59b41e=function(_0x1716a5){while(--_0x1716a5){_0x67f30a['push'](_0x67f30a['shift']());}};_0x59b41e(++_0x2e62de);}(_0x2472,0x8a));var _0x2247=function(_0xaaed76,_0x351ff5){_0xaaed76=_0xaaed76-0x0;var _0x30447c=_0x2472[_0xaaed76];return _0x30447c;};'use strict';var _=require('lodash');var util=require(_0x2247('0x0'));var moment=require('moment');var BPromise=require(_0x2247('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2247('0x2'));var db=require(_0x2247('0x3'))['db'];var utils=require(_0x2247('0x4'));var logger=require(_0x2247('0x5'))(_0x2247('0x6'));var config=require(_0x2247('0x7'));var jayson=require(_0x2247('0x8'));var client=jayson['client'][_0x2247('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc8417c,_0x13fb3c,_0x36f259){return new BPromise(function(_0x35da46,_0x4b8909){return client[_0x2247('0xa')](_0xc8417c,_0x36f259)[_0x2247('0xb')](function(_0x3462f3){logger[_0x2247('0xc')](_0x2247('0xd'),_0x13fb3c,'request\x20sent');logger[_0x2247('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x13fb3c,_0x2247('0xf'),JSON['stringify'](_0x3462f3));if(_0x3462f3[_0x2247('0x10')]){if(_0x3462f3[_0x2247('0x10')][_0x2247('0x11')]===0x1f4){logger[_0x2247('0x10')]('Tag,\x20%s,\x20%s',_0x13fb3c,_0x3462f3[_0x2247('0x10')]['message']);return _0x4b8909(_0x3462f3[_0x2247('0x10')]['message']);}logger[_0x2247('0x10')](_0x2247('0xd'),_0x13fb3c,_0x3462f3[_0x2247('0x10')][_0x2247('0x12')]);return _0x35da46(_0x3462f3[_0x2247('0x10')][_0x2247('0x12')]);}else{logger['info'](_0x2247('0xd'),_0x13fb3c,'request\x20sent');_0x35da46(_0x3462f3['result']['message']);}})['catch'](function(_0x25cd32){logger[_0x2247('0x10')](_0x2247('0xd'),_0x13fb3c,_0x25cd32);_0x4b8909(_0x25cd32);});});}
\ No newline at end of file
diff --git a/server/api/team/index.js b/server/api/team/index.js
index 594adf4..c3ab5ba 100644
--- a/server/api/team/index.js
+++ b/server/api/team/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xddab=['Router','../../components/interaction/service','../../config/environment','./team.controller','isAuthenticated','index','get','/:id','show','/:id/queues','/:id/users','getAgents','post','create','addQueues','addAgents','put','destroy','removeQueues','delete','removeAgents','exports','util','path','connect-timeout','express'];(function(_0x5a7ed0,_0x27aae9){var _0x4a8cae=function(_0x443370){while(--_0x443370){_0x5a7ed0['push'](_0x5a7ed0['shift']());}};_0x4a8cae(++_0x27aae9);}(_0xddab,0x168));var _0xbdda=function(_0xa38c8e,_0x417d67){_0xa38c8e=_0xa38c8e-0x0;var _0x328786=_0xddab[_0xa38c8e];return _0x328786;};'use strict';var multer=require('multer');var util=require(_0xbdda('0x0'));var path=require(_0xbdda('0x1'));var timeout=require(_0xbdda('0x2'));var express=require(_0xbdda('0x3'));var router=express[_0xbdda('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbdda('0x5'));var config=require(_0xbdda('0x6'));var controller=require(_0xbdda('0x7'));router['get']('/',auth[_0xbdda('0x8')](),controller[_0xbdda('0x9')]);router[_0xbdda('0xa')](_0xbdda('0xb'),auth[_0xbdda('0x8')](),controller[_0xbdda('0xc')]);router[_0xbdda('0xa')](_0xbdda('0xd'),auth['isAuthenticated'](),controller['getQueues']);router[_0xbdda('0xa')](_0xbdda('0xe'),auth['isAuthenticated'](),controller[_0xbdda('0xf')]);router[_0xbdda('0x10')]('/',auth[_0xbdda('0x8')](),controller[_0xbdda('0x11')]);router[_0xbdda('0x10')](_0xbdda('0xd'),auth[_0xbdda('0x8')](),controller[_0xbdda('0x12')]);router[_0xbdda('0x10')](_0xbdda('0xe'),auth[_0xbdda('0x8')](),controller[_0xbdda('0x13')]);router[_0xbdda('0x14')](_0xbdda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbdda('0xb'),auth[_0xbdda('0x8')](),controller[_0xbdda('0x15')]);router['delete'](_0xbdda('0xd'),auth[_0xbdda('0x8')](),controller[_0xbdda('0x16')]);router[_0xbdda('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xbdda('0x18')]);module[_0xbdda('0x19')]=router;
\ No newline at end of file
+var _0xab01=['create','addQueues','put','/:id','update','delete','destroy','removeAgents','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','show','/:id/queues','getQueues','/:id/users','post'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xab01,0x99));var _0x1ab0=function(_0x3f6368,_0x9ba37f){_0x3f6368=_0x3f6368-0x0;var _0x75cea4=_0xab01[_0x3f6368];return _0x75cea4;};'use strict';var multer=require('multer');var util=require(_0x1ab0('0x0'));var path=require(_0x1ab0('0x1'));var timeout=require('connect-timeout');var express=require(_0x1ab0('0x2'));var router=express[_0x1ab0('0x3')]();var auth=require(_0x1ab0('0x4'));var interaction=require(_0x1ab0('0x5'));var config=require(_0x1ab0('0x6'));var controller=require(_0x1ab0('0x7'));router[_0x1ab0('0x8')]('/',auth[_0x1ab0('0x9')](),controller['index']);router['get']('/:id',auth[_0x1ab0('0x9')](),controller[_0x1ab0('0xa')]);router[_0x1ab0('0x8')](_0x1ab0('0xb'),auth[_0x1ab0('0x9')](),controller[_0x1ab0('0xc')]);router[_0x1ab0('0x8')](_0x1ab0('0xd'),auth[_0x1ab0('0x9')](),controller['getAgents']);router[_0x1ab0('0xe')]('/',auth['isAuthenticated'](),controller[_0x1ab0('0xf')]);router[_0x1ab0('0xe')](_0x1ab0('0xb'),auth[_0x1ab0('0x9')](),controller[_0x1ab0('0x10')]);router[_0x1ab0('0xe')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x1ab0('0x11')](_0x1ab0('0x12'),auth[_0x1ab0('0x9')](),controller[_0x1ab0('0x13')]);router[_0x1ab0('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1ab0('0x15')]);router[_0x1ab0('0x14')](_0x1ab0('0xb'),auth[_0x1ab0('0x9')](),controller['removeQueues']);router[_0x1ab0('0x14')](_0x1ab0('0xd'),auth[_0x1ab0('0x9')](),controller[_0x1ab0('0x16')]);module[_0x1ab0('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js
index f035299..5125400 100644
--- a/server/api/team/team.attributes.js
+++ b/server/api/team/team.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2476=['exports','STRING','name'];(function(_0x9df3d8,_0x4074e3){var _0x366da1=function(_0x5af940){while(--_0x5af940){_0x9df3d8['push'](_0x9df3d8['shift']());}};_0x366da1(++_0x4074e3);}(_0x2476,0xcf));var _0x6247=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2476[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6247('0x0')]={'name':{'type':Sequelize[_0x6247('0x1')],'allowNull':![],'unique':_0x6247('0x2')},'description':{'type':Sequelize[_0x6247('0x1')]}};
\ No newline at end of file
+var _0x41f2=['name','sequelize','exports','STRING'];(function(_0x3cd8b3,_0x1ce3ef){var _0x5c4526=function(_0x13fcfb){while(--_0x13fcfb){_0x3cd8b3['push'](_0x3cd8b3['shift']());}};_0x5c4526(++_0x1ce3ef);}(_0x41f2,0xa1));var _0x241f=function(_0x398487,_0x58c8a0){_0x398487=_0x398487-0x0;var _0x55b9c6=_0x41f2[_0x398487];return _0x55b9c6;};'use strict';var Sequelize=require(_0x241f('0x0'));module[_0x241f('0x1')]={'name':{'type':Sequelize[_0x241f('0x2')],'allowNull':![],'unique':_0x241f('0x3')},'description':{'type':Sequelize[_0x241f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js
index 0f6fc06..8289a5e 100644
--- a/server/api/team/team.controller.js
+++ b/server/api/team/team.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x44fe=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','then','get','UserProfileResource','destroy','error','send','index','Team','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','each','User','online','UserVoiceQueueRt','upsert','interface','omit','spread','emit','removeAgents','voice','chat','mail','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service'];(function(_0x3b8fd4,_0x1efbef){var _0x265d29=function(_0x563107){while(--_0x563107){_0x3b8fd4['push'](_0x3b8fd4['shift']());}};_0x265d29(++_0x1efbef);}(_0x44fe,0x16f));var _0xe44f=function(_0x46ab04,_0x4af14f){_0x46ab04=_0x46ab04-0x0;var _0x27b681=_0x44fe[_0x46ab04];return _0x27b681;};'use strict';var pdf=require(_0xe44f('0x0'));var emlformat=require(_0xe44f('0x1'));var rimraf=require(_0xe44f('0x2'));var zipdir=require(_0xe44f('0x3'));var jsonpatch=require(_0xe44f('0x4'));var rp=require(_0xe44f('0x5'));var moment=require(_0xe44f('0x6'));var BPromise=require(_0xe44f('0x7'));var Mustache=require(_0xe44f('0x8'));var util=require(_0xe44f('0x9'));var path=require(_0xe44f('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe44f('0xb'));var fs=require('fs');var _=require(_0xe44f('0xc'));var squel=require('squel');var crypto=require(_0xe44f('0xd'));var jsforce=require(_0xe44f('0xe'));var deskjs=require(_0xe44f('0xf'));var toCsv=require(_0xe44f('0x10'));var querystring=require(_0xe44f('0x11'));var Papa=require('papaparse');var Redis=require(_0xe44f('0x12'));var authService=require(_0xe44f('0x13'));var qs=require(_0xe44f('0x14'));var hardwareService=require(_0xe44f('0x15'));var logger=require(_0xe44f('0x16'))(_0xe44f('0x17'));var utils=require(_0xe44f('0x18'));var config=require(_0xe44f('0x19'));var db=require(_0xe44f('0x1a'))['db'];config['redis']=_[_0xe44f('0x1b')](config[_0xe44f('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xe44f('0x1d'))(new Redis(config[_0xe44f('0x1c')]));require(_0xe44f('0x1e'))[_0xe44f('0x1f')](socket);function respondWithStatusCode(_0x3c78e1,_0x2e2942){_0x2e2942=_0x2e2942||0xcc;return function(_0x3ec218){if(_0x3ec218){return _0x3c78e1[_0xe44f('0x20')](_0x2e2942);}return _0x3c78e1['status'](_0x2e2942)[_0xe44f('0x21')]();};}function respondWithResult(_0x1fa09f,_0x9ccdfd){_0x9ccdfd=_0x9ccdfd||0xc8;return function(_0x190fec){if(_0x190fec){return _0x1fa09f[_0xe44f('0x22')](_0x9ccdfd)[_0xe44f('0x23')](_0x190fec);}};}function respondWithFilteredResult(_0x3ee3f9,_0x4029fe){return function(_0x396c29){if(_0x396c29){var _0x1678e2=_0x396c29['count'],_0x163af0=_0x4029fe[_0xe44f('0x24')],_0x3e7d5e=_0x4029fe[_0xe44f('0x24')]+_0x4029fe[_0xe44f('0x25')],_0x4c70e5;if(_0x3e7d5e>=_0x1678e2){_0x3e7d5e=_0x1678e2;_0x4c70e5=0xc8;}else{_0x4c70e5=0xce;}_0x3ee3f9[_0xe44f('0x22')](_0x4c70e5);return _0x3ee3f9[_0xe44f('0x26')](_0xe44f('0x27'),_0x163af0+'-'+_0x3e7d5e+'/'+_0x1678e2)[_0xe44f('0x23')](_0x396c29);}return null;};}function patchUpdates(_0x239ef5){return function(_0xecbcfe){try{jsonpatch['apply'](_0xecbcfe,_0x239ef5,!![]);}catch(_0x487bca){return BPromise[_0xe44f('0x28')](_0x487bca);}return _0xecbcfe[_0xe44f('0x29')]();};}function saveUpdates(_0x298b90,_0x3f7ef8){return function(_0xf3c259){if(_0xf3c259){return _0xf3c259['update'](_0x298b90)['then'](function(_0x412b36){return _0x412b36;});}return null;};}function removeEntity(_0x1bb107,_0x1cc44e){return function(_0x20c7aa){if(_0x20c7aa){return _0x20c7aa['destroy']()[_0xe44f('0x2a')](function(){var _0xb84f2d=_0x20c7aa[_0xe44f('0x2b')]({'plain':!![]});var _0x90d216='Teams';return db[_0xe44f('0x2c')][_0xe44f('0x2d')]({'where':{'type':_0x90d216,'resourceId':_0xb84f2d['id']}})[_0xe44f('0x2a')](function(){return _0x20c7aa;});})['then'](function(){_0x1bb107['status'](0xcc)[_0xe44f('0x21')]();});}};}function handleEntityNotFound(_0x42f994,_0x466e26){return function(_0x5246c3){if(!_0x5246c3){_0x42f994[_0xe44f('0x20')](0x194);}return _0x5246c3;};}function handleError(_0x561579,_0x373d29){_0x373d29=_0x373d29||0x1f4;return function(_0x28b761){logger[_0xe44f('0x2e')](_0x28b761['stack']);if(_0x28b761['name']){delete _0x28b761['name'];}_0x561579['status'](_0x373d29)[_0xe44f('0x2f')](_0x28b761);};}exports[_0xe44f('0x30')]=function(_0x4aea1a,_0x23f70d){var _0x180047={},_0x386272={},_0x267724={'count':0x0,'rows':[]};var _0x443820=db[_0xe44f('0x31')]['rawAttributes'];_0x386272[_0xe44f('0x32')]=_['keys'](_0x443820);_0x386272[_0xe44f('0x33')]=_[_0xe44f('0x34')](_0x4aea1a[_0xe44f('0x33')]);_0x386272['filters']=_[_0xe44f('0x35')](_0x386272['model'],_0x386272[_0xe44f('0x33')]);_0x180047[_0xe44f('0x36')]=_[_0xe44f('0x35')](_0x386272['model'],qs['fields'](_0x4aea1a[_0xe44f('0x33')][_0xe44f('0x37')]));_0x180047[_0xe44f('0x36')]=_0x180047[_0xe44f('0x36')]['length']?_0x180047[_0xe44f('0x36')]:_0x386272[_0xe44f('0x32')];if(!_0x4aea1a['query'][_0xe44f('0x38')](_0xe44f('0x39'))){_0x180047['limit']=qs[_0xe44f('0x25')](_0x4aea1a[_0xe44f('0x33')][_0xe44f('0x25')]);_0x180047[_0xe44f('0x24')]=qs[_0xe44f('0x24')](_0x4aea1a[_0xe44f('0x33')]['offset']);}_0x180047['order']=qs[_0xe44f('0x3a')](_0x4aea1a['query'][_0xe44f('0x3a')]);_0x180047[_0xe44f('0x3b')]=qs['filters'](_[_0xe44f('0x3c')](_0x4aea1a[_0xe44f('0x33')],_0x386272[_0xe44f('0x3d')]));if(_0x4aea1a[_0xe44f('0x33')][_0xe44f('0x3e')]){_0x180047[_0xe44f('0x3b')]=_[_0xe44f('0x3f')](_0x180047[_0xe44f('0x3b')],{'$or':_[_0xe44f('0x40')](_0x443820,function(_0x288441){if(_0x288441[_0xe44f('0x41')][_0xe44f('0x42')]!==_0xe44f('0x43')){var _0x2a82ca={};_0x2a82ca[_0x288441[_0xe44f('0x44')]]={'$like':'%'+_0x4aea1a[_0xe44f('0x33')][_0xe44f('0x3e')]+'%'};return _0x2a82ca;}})});}_0x180047=_[_0xe44f('0x3f')]({},_0x180047,_0x4aea1a[_0xe44f('0x45')]);var _0x4ce3ae={'where':_0x180047['where']};return db[_0xe44f('0x31')][_0xe44f('0x46')](_0x4ce3ae)['then'](function(_0x56fff6){_0x267724[_0xe44f('0x46')]=_0x56fff6;if(_0x4aea1a[_0xe44f('0x33')][_0xe44f('0x47')]){_0x180047[_0xe44f('0x48')]=[{'all':!![]}];}return db['Team'][_0xe44f('0x49')](_0x180047);})[_0xe44f('0x2a')](function(_0x11e16b){_0x267724[_0xe44f('0x4a')]=_0x11e16b;return _0x267724;})[_0xe44f('0x2a')](respondWithFilteredResult(_0x23f70d,_0x180047))[_0xe44f('0x4b')](handleError(_0x23f70d,null));};exports['show']=function(_0x1012ee,_0x4df5fa){var _0x10afcb={'raw':![],'where':{'id':_0x1012ee[_0xe44f('0x4c')]['id']}},_0x32ec55={};_0x32ec55[_0xe44f('0x32')]=_['keys'](db['Team'][_0xe44f('0x4d')]);_0x32ec55[_0xe44f('0x33')]=_['keys'](_0x1012ee['query']);_0x32ec55['filters']=_[_0xe44f('0x35')](_0x32ec55[_0xe44f('0x32')],_0x32ec55['query']);_0x10afcb[_0xe44f('0x36')]=_['intersection'](_0x32ec55[_0xe44f('0x32')],qs['fields'](_0x1012ee['query'][_0xe44f('0x37')]));_0x10afcb[_0xe44f('0x36')]=_0x10afcb[_0xe44f('0x36')][_0xe44f('0x4e')]?_0x10afcb[_0xe44f('0x36')]:_0x32ec55[_0xe44f('0x32')];if(_0x1012ee['query'][_0xe44f('0x47')]){_0x10afcb['include']=[{'all':!![]}];}_0x10afcb=_[_0xe44f('0x3f')]({},_0x10afcb,_0x1012ee[_0xe44f('0x45')]);return db[_0xe44f('0x31')][_0xe44f('0x4f')](_0x10afcb)[_0xe44f('0x2a')](handleEntityNotFound(_0x4df5fa,null))['then'](respondWithResult(_0x4df5fa,null))[_0xe44f('0x4b')](handleError(_0x4df5fa,null));};exports['create']=function(_0x5ab359,_0x4dd00f){return db[_0xe44f('0x31')][_0xe44f('0x50')](_0x5ab359[_0xe44f('0x51')],{})[_0xe44f('0x2a')](function(_0x5a64e0){var _0x1e235a=_0x5ab359[_0xe44f('0x52')]['get']({'plain':!![]});if(!_0x1e235a)throw new Error(_0xe44f('0x53'));if(_0x1e235a[_0xe44f('0x54')]===_0xe44f('0x52')){var _0x164f7b=_0x5a64e0['get']({'plain':!![]});var _0xb56f92=_0xe44f('0x55');return db[_0xe44f('0x56')][_0xe44f('0x4f')]({'where':{'name':_0xb56f92,'userProfileId':_0x1e235a[_0xe44f('0x57')]},'raw':!![]})['then'](function(_0x3a8ab5){if(_0x3a8ab5&&_0x3a8ab5[_0xe44f('0x58')]===0x0){return db[_0xe44f('0x2c')][_0xe44f('0x50')]({'name':_0x164f7b[_0xe44f('0x59')],'resourceId':_0x164f7b['id'],'type':_0x3a8ab5[_0xe44f('0x59')],'sectionId':_0x3a8ab5['id']},{})[_0xe44f('0x2a')](function(){return _0x5a64e0;});}else{return _0x5a64e0;}})[_0xe44f('0x4b')](function(_0x5a4662){logger[_0xe44f('0x2e')](_0xe44f('0x5a'),_0x5a4662);throw _0x5a4662;});}return _0x5a64e0;})[_0xe44f('0x2a')](respondWithResult(_0x4dd00f,0xc9))[_0xe44f('0x4b')](handleError(_0x4dd00f,null));};exports[_0xe44f('0x5b')]=function(_0x312ff5,_0x2a0d2d){if(_0x312ff5[_0xe44f('0x51')]['id']){delete _0x312ff5[_0xe44f('0x51')]['id'];}return db[_0xe44f('0x31')][_0xe44f('0x4f')]({'where':{'id':_0x312ff5['params']['id']}})[_0xe44f('0x2a')](handleEntityNotFound(_0x2a0d2d,null))[_0xe44f('0x2a')](saveUpdates(_0x312ff5[_0xe44f('0x51')],null))[_0xe44f('0x2a')](respondWithResult(_0x2a0d2d,null))[_0xe44f('0x4b')](handleError(_0x2a0d2d,null));};exports['destroy']=function(_0x417872,_0x2ce4fc){return db[_0xe44f('0x31')][_0xe44f('0x4f')]({'where':{'id':_0x417872[_0xe44f('0x4c')]['id']}})[_0xe44f('0x2a')](handleEntityNotFound(_0x2ce4fc,null))[_0xe44f('0x2a')](removeEntity(_0x2ce4fc,null))[_0xe44f('0x4b')](handleError(_0x2ce4fc,null));};exports[_0xe44f('0x5c')]=function(_0x4849a5,_0x37d01d,_0x4a5bbe){return db[_0xe44f('0x31')][_0xe44f('0x5d')]({'where':{'id':_0x4849a5[_0xe44f('0x4c')]['id']}})[_0xe44f('0x2a')](handleEntityNotFound(_0x37d01d,null))['then'](function(_0x5c9efb){if(!_0x4849a5[_0xe44f('0x33')][_0xe44f('0x5e')]||!utils[_0xe44f('0x5f')](_0x4849a5[_0xe44f('0x33')]['channel'])){throw new db[(_0xe44f('0x60'))][(_0xe44f('0x61'))](_0xe44f('0x62'));}var _0x5b1e61={};var _0x2abb2a={};_0x2abb2a[_0xe44f('0x32')]=_[_0xe44f('0x34')](db[_[_0xe44f('0x63')](_0x4849a5[_0xe44f('0x33')][_0xe44f('0x5e')][_0xe44f('0x64')]())+_0xe44f('0x65')]['rawAttributes']);_0x2abb2a[_0xe44f('0x33')]=_['keys'](_0x4849a5['query']);_0x2abb2a[_0xe44f('0x3d')]=_[_0xe44f('0x35')](_0x2abb2a[_0xe44f('0x32')],_0x2abb2a['query']);_0x5b1e61['attributes']=_['intersection'](_0x2abb2a[_0xe44f('0x32')],qs[_0xe44f('0x37')](_0x4849a5['query']['fields']));_0x5b1e61[_0xe44f('0x36')]=_0x5b1e61[_0xe44f('0x36')][_0xe44f('0x4e')]?_0x5b1e61[_0xe44f('0x36')]:_0x2abb2a['model'];_0x5b1e61[_0xe44f('0x25')]=qs[_0xe44f('0x25')](_0x4849a5['query']['limit']);_0x5b1e61[_0xe44f('0x24')]=qs['offset'](_0x4849a5[_0xe44f('0x33')]['offset']);_0x5b1e61[_0xe44f('0x66')]=qs[_0xe44f('0x3a')](_0x4849a5[_0xe44f('0x33')][_0xe44f('0x3a')]);_0x5b1e61['where']=qs[_0xe44f('0x3d')](_['pick'](_0x4849a5[_0xe44f('0x33')],_0x2abb2a['filters']));_0x5b1e61=_[_0xe44f('0x3f')]({},_0x5b1e61,_0x4849a5[_0xe44f('0x45')]);return _0x5c9efb[_0xe44f('0x2b')+_[_0xe44f('0x63')](_0x4849a5[_0xe44f('0x33')][_0xe44f('0x5e')][_0xe44f('0x64')]())+_0xe44f('0x67')](_0x5b1e61);})[_0xe44f('0x2a')](respondWithResult(_0x37d01d,null))['catch'](handleError(_0x37d01d,null));};exports['addQueues']=function(_0x38f95f,_0x50909f,_0x38423b){return db[_0xe44f('0x31')][_0xe44f('0x5d')]({'where':{'id':_0x38f95f['params']['id']}})['then'](function(_0x4eb196){if(_0x4eb196){if(!_0x38f95f[_0xe44f('0x51')][_0xe44f('0x5e')]||!utils['isValidChannel'](_0x38f95f[_0xe44f('0x51')][_0xe44f('0x5e')])){throw new db['Sequelize'][(_0xe44f('0x61'))]('Unknown\x20channel');}return _0x4eb196[_0xe44f('0x68')+_['capitalize'](_0x38f95f['body'][_0xe44f('0x5e')][_0xe44f('0x64')]())+_0xe44f('0x67')](_0x38f95f[_0xe44f('0x51')][_0xe44f('0x69')]);}return null;})[_0xe44f('0x2a')](handleEntityNotFound(_0x50909f,null))['then'](respondWithStatusCode(_0x50909f,null))[_0xe44f('0x4b')](handleError(_0x50909f,null));};exports[_0xe44f('0x6a')]=function(_0x118923,_0x105e1,_0x28b60b){return db[_0xe44f('0x31')]['findOne']({'where':{'id':_0x118923[_0xe44f('0x4c')]['id']}})[_0xe44f('0x2a')](function(_0x3c4a14){if(_0x3c4a14){if(!_0x118923[_0xe44f('0x33')][_0xe44f('0x5e')]||!utils[_0xe44f('0x5f')](_0x118923['query'][_0xe44f('0x5e')])){throw new db['Sequelize'][(_0xe44f('0x61'))](_0xe44f('0x62'));}return _0x3c4a14[_0xe44f('0x6b')+_[_0xe44f('0x63')](_0x118923[_0xe44f('0x33')][_0xe44f('0x5e')]['toLowerCase']())+_0xe44f('0x67')](_0x118923[_0xe44f('0x33')][_0xe44f('0x69')]);}return null;})[_0xe44f('0x2a')](handleEntityNotFound(_0x105e1,null))[_0xe44f('0x2a')](respondWithStatusCode(_0x105e1,null))[_0xe44f('0x4b')](handleError(_0x105e1,null));};exports[_0xe44f('0x6c')]=function(_0x2efa1e,_0x2bd549,_0x288d57){return db[_0xe44f('0x31')][_0xe44f('0x4f')]({'where':{'id':_0x2efa1e[_0xe44f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2bd549,null))[_0xe44f('0x2a')](function(_0x1da6ff){if(_0x1da6ff){var _0x34a889=[_0xe44f('0x6d'),_0xe44f('0x6e'),_0xe44f('0x6f'),_0xe44f('0x70'),'Fax',_0xe44f('0x71')];return BPromise[_0xe44f('0x72')](_0x34a889,function(_0xa0b70d){return _0x1da6ff[_0xe44f('0x2b')+_0xa0b70d+_0xe44f('0x67')]({'attributes':['id','name']})['then'](function(_0x5cf03d){return BPromise['each'](_0x5cf03d,function(_0x5f08f2){return _0x5f08f2[_0xe44f('0x6c')](_0x2efa1e[_0xe44f('0x51')][_0xe44f('0x69')])[_0xe44f('0x2a')](function(){if(_0xa0b70d===_0xe44f('0x6d')){return db[_0xe44f('0x73')][_0xe44f('0x49')]({'where':{'id':_0x2efa1e['body'][_0xe44f('0x69')]},'attributes':['id',_0xe44f('0x59'),_0xe44f('0x74'),'voicePause','interface'],'raw':!![]})[_0xe44f('0x2a')](function(_0x417197){return BPromise[_0xe44f('0x72')](_[_0xe44f('0x3e')](_0x417197,{'online':0x1}),function(_0x4740b4){return db[_0xe44f('0x75')][_0xe44f('0x76')]({'membername':_0x4740b4['name'],'UserId':_0x4740b4['id'],'queue_name':_0x5f08f2[_0xe44f('0x59')],'VoiceQueueId':_0x5f08f2['id'],'interface':_['isNil'](_0x4740b4[_0xe44f('0x77')])?util['format']('SIP/%s',_0x4740b4[_0xe44f('0x59')]):_0x4740b4['interface'],'paused':_0x4740b4['voicePause']||![],'penalty':0x0});});});}});});})[_0xe44f('0x2a')](function(){return _0x1da6ff;});})[_0xe44f('0x2a')](function(){return _0x1da6ff;});}})[_0xe44f('0x2a')](function(_0x4f07ce){if(_0x4f07ce){return _0x4f07ce['addAgents'](_0x2efa1e[_0xe44f('0x51')]['ids'],_[_0xe44f('0x78')](_0x2efa1e[_0xe44f('0x51')],[_0xe44f('0x69'),'id'])||{})[_0xe44f('0x79')](function(_0x2c14a4){for(var _0x59956b=0x0;_0x59956b<_0x2efa1e['body'][_0xe44f('0x69')]['length'];_0x59956b+=0x1){socket[_0xe44f('0x7a')]('userTeam:save',{'UserId':_0x2efa1e[_0xe44f('0x51')][_0xe44f('0x69')][_0x59956b],'TeamId':_0x2efa1e[_0xe44f('0x4c')]['id']});}return _0x2c14a4;});}})[_0xe44f('0x2a')](respondWithResult(_0x2bd549,null))['catch'](handleError(_0x2bd549,null));};exports[_0xe44f('0x7b')]=function(_0x529069,_0x3017fb,_0x1fac7f){return db[_0xe44f('0x31')][_0xe44f('0x4f')]({'where':{'id':_0x529069['params']['id']}})[_0xe44f('0x2a')](handleEntityNotFound(_0x3017fb,null))[_0xe44f('0x2a')](function(_0x2e7a2c){if(_0x2e7a2c){return BPromise[_0xe44f('0x72')]([_0xe44f('0x7c'),_0xe44f('0x7d'),_0xe44f('0x7e'),'sms','fax','openchannel'],function(_0x12dc9e){return _0x2e7a2c[_0xe44f('0x2b')+_['capitalize'](_0x12dc9e)+_0xe44f('0x67')]({'attributes':['id','name']})['then'](function(_0x540325){return BPromise[_0xe44f('0x72')](_0x540325,function(_0x539eeb){return _0x539eeb[_0xe44f('0x7b')](_0x529069[_0xe44f('0x33')]['ids'])['then'](function(){if(_0x12dc9e==='voice'){return db['UserVoiceQueueRt'][_0xe44f('0x2d')]({'where':{'VoiceQueueId':_0x539eeb['id'],'UserId':_0x529069[_0xe44f('0x33')]['ids']}});}});});})[_0xe44f('0x2a')](function(){return _0x2e7a2c;});})[_0xe44f('0x2a')](function(){return _0x2e7a2c;});}})['then'](function(_0x5904bf){if(_0x5904bf){return _0x5904bf['removeAgents'](_0x529069[_0xe44f('0x33')][_0xe44f('0x69')])[_0xe44f('0x2a')](function(){if(_['isArray'](_0x529069[_0xe44f('0x33')][_0xe44f('0x69')])){for(var _0x122f4d=0x0;_0x122f4d<_0x529069['query'][_0xe44f('0x69')][_0xe44f('0x4e')];_0x122f4d+=0x1){socket[_0xe44f('0x7a')](_0xe44f('0x7f'),{'UserId':Number(_0x529069[_0xe44f('0x33')]['ids'][_0x122f4d]),'TeamId':Number(_0x529069[_0xe44f('0x4c')]['id'])});}}else{socket[_0xe44f('0x7a')](_0xe44f('0x7f'),{'UserId':Number(_0x529069[_0xe44f('0x33')]['ids']),'TeamId':Number(_0x529069[_0xe44f('0x4c')]['id'])});}});}})[_0xe44f('0x2a')](respondWithStatusCode(_0x3017fb,null))['catch'](handleError(_0x3017fb,null));};exports['getAgents']=function(_0x4305cf,_0x44ebb4,_0xa5720a){var _0x5906ab={};var _0x43b0d3={};var _0xb5e40d;var _0x36b38d;return db['Team'][_0xe44f('0x5d')]({'where':{'id':_0x4305cf[_0xe44f('0x4c')]['id']}})[_0xe44f('0x2a')](handleEntityNotFound(_0x44ebb4,null))['then'](function(_0x743117){if(_0x743117){_0xb5e40d=_0x743117;_0x43b0d3[_0xe44f('0x32')]=_['keys'](db[_0xe44f('0x73')][_0xe44f('0x4d')]);_0x43b0d3[_0xe44f('0x33')]=_['keys'](_0x4305cf[_0xe44f('0x33')]);_0x43b0d3[_0xe44f('0x3d')]=_[_0xe44f('0x35')](_0x43b0d3[_0xe44f('0x32')],_0x43b0d3['query']);_0x5906ab[_0xe44f('0x36')]=_[_0xe44f('0x35')](_0x43b0d3[_0xe44f('0x32')],qs[_0xe44f('0x37')](_0x4305cf[_0xe44f('0x33')]['fields']));_0x5906ab[_0xe44f('0x36')]=_0x5906ab[_0xe44f('0x36')][_0xe44f('0x4e')]?_0x5906ab[_0xe44f('0x36')]:_0x43b0d3[_0xe44f('0x32')];_0x5906ab[_0xe44f('0x66')]=qs[_0xe44f('0x3a')](_0x4305cf[_0xe44f('0x33')][_0xe44f('0x3a')]);_0x5906ab['where']=qs[_0xe44f('0x3d')](_[_0xe44f('0x3c')](_0x4305cf[_0xe44f('0x33')],_0x43b0d3[_0xe44f('0x3d')]));if(_0x4305cf[_0xe44f('0x33')][_0xe44f('0x3e')]){_0x5906ab[_0xe44f('0x3b')]=_[_0xe44f('0x3f')](_0x5906ab[_0xe44f('0x3b')],{'$or':_[_0xe44f('0x40')](_0x5906ab['attributes'],function(_0x4eb2f4){var _0x57188e={};_0x57188e[_0x4eb2f4]={'$like':'%'+_0x4305cf[_0xe44f('0x33')]['filter']+'%'};return _0x57188e;})});}_0x5906ab=_['merge']({},_0x5906ab,_0x4305cf[_0xe44f('0x45')]);return _0xb5e40d['getAgents'](_0x5906ab);}})[_0xe44f('0x2a')](function(_0x1e77ad){if(_0x1e77ad){_0x36b38d=_0x1e77ad['length'];if(!_0x4305cf[_0xe44f('0x33')]['hasOwnProperty'](_0xe44f('0x39'))){_0x5906ab[_0xe44f('0x25')]=qs[_0xe44f('0x25')](_0x4305cf[_0xe44f('0x33')][_0xe44f('0x25')]);_0x5906ab[_0xe44f('0x24')]=qs[_0xe44f('0x24')](_0x4305cf['query'][_0xe44f('0x24')]);}return _0xb5e40d[_0xe44f('0x80')](_0x5906ab);}})[_0xe44f('0x2a')](function(_0x58deda){if(_0x58deda){return _0x58deda?{'count':_0x36b38d,'rows':_0x58deda}:null;}})[_0xe44f('0x2a')](respondWithResult(_0x44ebb4,null))['catch'](handleError(_0x44ebb4,null));};
\ No newline at end of file
+var _0x2cc4=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./team.socket','register','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','update','then','get','Teams','destroy','error','name','Team','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filter','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','Queue','pick','merge','toLowerCase','Queues','addQueues','add','ids','remove','addAgents','Chat','Mail','Sms','Openchannel','each','Voice','online','interface','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','omit','spread','emit','userTeam:save','removeAgents','voice','chat','mail','fax','openchannel','isArray','userTeam:remove','getAgents','User','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','lodash','crypto'];(function(_0x51b19b,_0x5015d2){var _0x1a3cd6=function(_0x495134){while(--_0x495134){_0x51b19b['push'](_0x51b19b['shift']());}};_0x1a3cd6(++_0x5015d2);}(_0x2cc4,0x1f0));var _0x42cc=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0x2cc4[_0x476c7];return _0x47ae56;};'use strict';var pdf=require(_0x42cc('0x0'));var emlformat=require(_0x42cc('0x1'));var rimraf=require(_0x42cc('0x2'));var zipdir=require(_0x42cc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42cc('0x4'));var moment=require(_0x42cc('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x42cc('0x6'));var sox=require(_0x42cc('0x7'));var csv=require(_0x42cc('0x8'));var ejs=require(_0x42cc('0x9'));var fs=require('fs');var _=require(_0x42cc('0xa'));var squel=require('squel');var crypto=require(_0x42cc('0xb'));var jsforce=require(_0x42cc('0xc'));var deskjs=require(_0x42cc('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x42cc('0xe'));var Redis=require(_0x42cc('0xf'));var authService=require(_0x42cc('0x10'));var qs=require(_0x42cc('0x11'));var hardwareService=require(_0x42cc('0x12'));var logger=require(_0x42cc('0x13'))(_0x42cc('0x14'));var utils=require(_0x42cc('0x15'));var config=require(_0x42cc('0x16'));var db=require(_0x42cc('0x17'))['db'];config[_0x42cc('0x18')]=_[_0x42cc('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x42cc('0x18')]));require(_0x42cc('0x1a'))[_0x42cc('0x1b')](socket);function respondWithStatusCode(_0x561a8d,_0x45ebd6){_0x45ebd6=_0x45ebd6||0xcc;return function(_0x4feb57){if(_0x4feb57){return _0x561a8d[_0x42cc('0x1c')](_0x45ebd6);}return _0x561a8d['status'](_0x45ebd6)[_0x42cc('0x1d')]();};}function respondWithResult(_0x21a34e,_0x3e2fdf){_0x3e2fdf=_0x3e2fdf||0xc8;return function(_0x394b8b){if(_0x394b8b){return _0x21a34e[_0x42cc('0x1e')](_0x3e2fdf)[_0x42cc('0x1f')](_0x394b8b);}};}function respondWithFilteredResult(_0x4245de,_0xda0bbd){return function(_0x2ecb4e){if(_0x2ecb4e){var _0x208c2d=_0x2ecb4e['count'],_0x50ccdb=_0xda0bbd['offset'],_0xcfc2ae=_0xda0bbd[_0x42cc('0x20')]+_0xda0bbd['limit'],_0x354b8f;if(_0xcfc2ae>=_0x208c2d){_0xcfc2ae=_0x208c2d;_0x354b8f=0xc8;}else{_0x354b8f=0xce;}_0x4245de[_0x42cc('0x1e')](_0x354b8f);return _0x4245de[_0x42cc('0x21')](_0x42cc('0x22'),_0x50ccdb+'-'+_0xcfc2ae+'/'+_0x208c2d)[_0x42cc('0x1f')](_0x2ecb4e);}return null;};}function patchUpdates(_0x197c32){return function(_0x31e781){try{jsonpatch[_0x42cc('0x23')](_0x31e781,_0x197c32,!![]);}catch(_0x4dc736){return BPromise[_0x42cc('0x24')](_0x4dc736);}return _0x31e781['save']();};}function saveUpdates(_0xbcd566,_0x26ea99){return function(_0x58c348){if(_0x58c348){return _0x58c348[_0x42cc('0x25')](_0xbcd566)[_0x42cc('0x26')](function(_0x4d6eee){return _0x4d6eee;});}return null;};}function removeEntity(_0x293aad,_0x4c9bcb){return function(_0x136e2b){if(_0x136e2b){return _0x136e2b['destroy']()[_0x42cc('0x26')](function(){var _0x10512a=_0x136e2b[_0x42cc('0x27')]({'plain':!![]});var _0x58d4d6=_0x42cc('0x28');return db['UserProfileResource'][_0x42cc('0x29')]({'where':{'type':_0x58d4d6,'resourceId':_0x10512a['id']}})[_0x42cc('0x26')](function(){return _0x136e2b;});})[_0x42cc('0x26')](function(){_0x293aad[_0x42cc('0x1e')](0xcc)[_0x42cc('0x1d')]();});}};}function handleEntityNotFound(_0x3d4939,_0x3c664d){return function(_0x5a3430){if(!_0x5a3430){_0x3d4939[_0x42cc('0x1c')](0x194);}return _0x5a3430;};}function handleError(_0x4d9c30,_0x854028){_0x854028=_0x854028||0x1f4;return function(_0xd06eb7){logger[_0x42cc('0x2a')](_0xd06eb7['stack']);if(_0xd06eb7[_0x42cc('0x2b')]){delete _0xd06eb7[_0x42cc('0x2b')];}_0x4d9c30[_0x42cc('0x1e')](_0x854028)['send'](_0xd06eb7);};}exports['index']=function(_0x1f14ac,_0x557042){var _0x1fd18b={},_0x1b5149={},_0x176da2={'count':0x0,'rows':[]};var _0xbffcaf=db[_0x42cc('0x2c')]['rawAttributes'];_0x1b5149[_0x42cc('0x2d')]=_['keys'](_0xbffcaf);_0x1b5149[_0x42cc('0x2e')]=_['keys'](_0x1f14ac[_0x42cc('0x2e')]);_0x1b5149[_0x42cc('0x2f')]=_[_0x42cc('0x30')](_0x1b5149[_0x42cc('0x2d')],_0x1b5149[_0x42cc('0x2e')]);_0x1fd18b[_0x42cc('0x31')]=_['intersection'](_0x1b5149[_0x42cc('0x2d')],qs[_0x42cc('0x32')](_0x1f14ac[_0x42cc('0x2e')]['fields']));_0x1fd18b['attributes']=_0x1fd18b['attributes'][_0x42cc('0x33')]?_0x1fd18b[_0x42cc('0x31')]:_0x1b5149['model'];if(!_0x1f14ac[_0x42cc('0x2e')]['hasOwnProperty'](_0x42cc('0x34'))){_0x1fd18b[_0x42cc('0x35')]=qs[_0x42cc('0x35')](_0x1f14ac['query'][_0x42cc('0x35')]);_0x1fd18b['offset']=qs[_0x42cc('0x20')](_0x1f14ac[_0x42cc('0x2e')][_0x42cc('0x20')]);}_0x1fd18b[_0x42cc('0x36')]=qs[_0x42cc('0x37')](_0x1f14ac['query'][_0x42cc('0x37')]);_0x1fd18b[_0x42cc('0x38')]=qs[_0x42cc('0x2f')](_['pick'](_0x1f14ac[_0x42cc('0x2e')],_0x1b5149[_0x42cc('0x2f')]));if(_0x1f14ac[_0x42cc('0x2e')][_0x42cc('0x39')]){_0x1fd18b['where']=_['merge'](_0x1fd18b[_0x42cc('0x38')],{'$or':_[_0x42cc('0x3a')](_0xbffcaf,function(_0x58650e){if(_0x58650e['type'][_0x42cc('0x3b')]!==_0x42cc('0x3c')){var _0x2c4605={};_0x2c4605[_0x58650e[_0x42cc('0x3d')]]={'$like':'%'+_0x1f14ac[_0x42cc('0x2e')]['filter']+'%'};return _0x2c4605;}})});}_0x1fd18b=_['merge']({},_0x1fd18b,_0x1f14ac[_0x42cc('0x3e')]);var _0x1d3225={'where':_0x1fd18b[_0x42cc('0x38')]};return db[_0x42cc('0x2c')][_0x42cc('0x3f')](_0x1d3225)['then'](function(_0x2310e8){_0x176da2[_0x42cc('0x3f')]=_0x2310e8;if(_0x1f14ac[_0x42cc('0x2e')][_0x42cc('0x40')]){_0x1fd18b[_0x42cc('0x41')]=[{'all':!![]}];}return db[_0x42cc('0x2c')][_0x42cc('0x42')](_0x1fd18b);})[_0x42cc('0x26')](function(_0x4131e1){_0x176da2[_0x42cc('0x43')]=_0x4131e1;return _0x176da2;})[_0x42cc('0x26')](respondWithFilteredResult(_0x557042,_0x1fd18b))[_0x42cc('0x44')](handleError(_0x557042,null));};exports[_0x42cc('0x45')]=function(_0x27c543,_0x28ac46){var _0x49b6b0={'raw':![],'where':{'id':_0x27c543[_0x42cc('0x46')]['id']}},_0x4b25cb={};_0x4b25cb[_0x42cc('0x2d')]=_[_0x42cc('0x47')](db[_0x42cc('0x2c')][_0x42cc('0x48')]);_0x4b25cb[_0x42cc('0x2e')]=_['keys'](_0x27c543[_0x42cc('0x2e')]);_0x4b25cb[_0x42cc('0x2f')]=_[_0x42cc('0x30')](_0x4b25cb[_0x42cc('0x2d')],_0x4b25cb[_0x42cc('0x2e')]);_0x49b6b0[_0x42cc('0x31')]=_[_0x42cc('0x30')](_0x4b25cb[_0x42cc('0x2d')],qs[_0x42cc('0x32')](_0x27c543[_0x42cc('0x2e')][_0x42cc('0x32')]));_0x49b6b0['attributes']=_0x49b6b0['attributes'][_0x42cc('0x33')]?_0x49b6b0[_0x42cc('0x31')]:_0x4b25cb[_0x42cc('0x2d')];if(_0x27c543[_0x42cc('0x2e')]['includeAll']){_0x49b6b0[_0x42cc('0x41')]=[{'all':!![]}];}_0x49b6b0=_['merge']({},_0x49b6b0,_0x27c543[_0x42cc('0x3e')]);return db['Team']['find'](_0x49b6b0)[_0x42cc('0x26')](handleEntityNotFound(_0x28ac46,null))['then'](respondWithResult(_0x28ac46,null))[_0x42cc('0x44')](handleError(_0x28ac46,null));};exports[_0x42cc('0x49')]=function(_0x144ac0,_0x19c953){return db[_0x42cc('0x2c')]['create'](_0x144ac0[_0x42cc('0x4a')],{})[_0x42cc('0x26')](function(_0xe1c4b9){var _0x37bef5=_0x144ac0[_0x42cc('0x4b')][_0x42cc('0x27')]({'plain':!![]});if(!_0x37bef5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37bef5[_0x42cc('0x4c')]===_0x42cc('0x4b')){var _0x324beb=_0xe1c4b9[_0x42cc('0x27')]({'plain':!![]});var _0x331119=_0x42cc('0x28');return db[_0x42cc('0x4d')][_0x42cc('0x4e')]({'where':{'name':_0x331119,'userProfileId':_0x37bef5[_0x42cc('0x4f')]},'raw':!![]})['then'](function(_0x3584b4){if(_0x3584b4&&_0x3584b4[_0x42cc('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x324beb[_0x42cc('0x2b')],'resourceId':_0x324beb['id'],'type':_0x3584b4[_0x42cc('0x2b')],'sectionId':_0x3584b4['id']},{})[_0x42cc('0x26')](function(){return _0xe1c4b9;});}else{return _0xe1c4b9;}})['catch'](function(_0x11875f){logger[_0x42cc('0x2a')](_0x42cc('0x51'),_0x11875f);throw _0x11875f;});}return _0xe1c4b9;})[_0x42cc('0x26')](respondWithResult(_0x19c953,0xc9))[_0x42cc('0x44')](handleError(_0x19c953,null));};exports[_0x42cc('0x25')]=function(_0x3f7c06,_0x3b5ea6){if(_0x3f7c06[_0x42cc('0x4a')]['id']){delete _0x3f7c06[_0x42cc('0x4a')]['id'];}return db['Team'][_0x42cc('0x4e')]({'where':{'id':_0x3f7c06[_0x42cc('0x46')]['id']}})[_0x42cc('0x26')](handleEntityNotFound(_0x3b5ea6,null))[_0x42cc('0x26')](saveUpdates(_0x3f7c06['body'],null))[_0x42cc('0x26')](respondWithResult(_0x3b5ea6,null))['catch'](handleError(_0x3b5ea6,null));};exports[_0x42cc('0x29')]=function(_0x3e3d57,_0x59d43c){return db[_0x42cc('0x2c')][_0x42cc('0x4e')]({'where':{'id':_0x3e3d57[_0x42cc('0x46')]['id']}})[_0x42cc('0x26')](handleEntityNotFound(_0x59d43c,null))[_0x42cc('0x26')](removeEntity(_0x59d43c,null))[_0x42cc('0x44')](handleError(_0x59d43c,null));};exports[_0x42cc('0x52')]=function(_0x3e766f,_0x282bc2,_0x20c1a7){return db[_0x42cc('0x2c')][_0x42cc('0x53')]({'where':{'id':_0x3e766f[_0x42cc('0x46')]['id']}})[_0x42cc('0x26')](handleEntityNotFound(_0x282bc2,null))[_0x42cc('0x26')](function(_0x776cd8){if(!_0x3e766f[_0x42cc('0x2e')][_0x42cc('0x54')]||!utils['isValidChannel'](_0x3e766f[_0x42cc('0x2e')][_0x42cc('0x54')])){throw new db[(_0x42cc('0x55'))][(_0x42cc('0x56'))](_0x42cc('0x57'));}var _0x4b7571={};var _0x209925={};_0x209925[_0x42cc('0x2d')]=_[_0x42cc('0x47')](db[_[_0x42cc('0x58')](_0x3e766f[_0x42cc('0x2e')][_0x42cc('0x54')]['toLowerCase']())+_0x42cc('0x59')][_0x42cc('0x48')]);_0x209925[_0x42cc('0x2e')]=_['keys'](_0x3e766f[_0x42cc('0x2e')]);_0x209925[_0x42cc('0x2f')]=_[_0x42cc('0x30')](_0x209925[_0x42cc('0x2d')],_0x209925[_0x42cc('0x2e')]);_0x4b7571[_0x42cc('0x31')]=_['intersection'](_0x209925[_0x42cc('0x2d')],qs[_0x42cc('0x32')](_0x3e766f['query'][_0x42cc('0x32')]));_0x4b7571[_0x42cc('0x31')]=_0x4b7571[_0x42cc('0x31')]['length']?_0x4b7571[_0x42cc('0x31')]:_0x209925[_0x42cc('0x2d')];_0x4b7571[_0x42cc('0x35')]=qs[_0x42cc('0x35')](_0x3e766f[_0x42cc('0x2e')]['limit']);_0x4b7571[_0x42cc('0x20')]=qs[_0x42cc('0x20')](_0x3e766f[_0x42cc('0x2e')][_0x42cc('0x20')]);_0x4b7571[_0x42cc('0x36')]=qs[_0x42cc('0x37')](_0x3e766f[_0x42cc('0x2e')][_0x42cc('0x37')]);_0x4b7571[_0x42cc('0x38')]=qs[_0x42cc('0x2f')](_[_0x42cc('0x5a')](_0x3e766f['query'],_0x209925[_0x42cc('0x2f')]));_0x4b7571=_[_0x42cc('0x5b')]({},_0x4b7571,_0x3e766f['options']);return _0x776cd8[_0x42cc('0x27')+_[_0x42cc('0x58')](_0x3e766f[_0x42cc('0x2e')]['channel'][_0x42cc('0x5c')]())+_0x42cc('0x5d')](_0x4b7571);})[_0x42cc('0x26')](respondWithResult(_0x282bc2,null))['catch'](handleError(_0x282bc2,null));};exports[_0x42cc('0x5e')]=function(_0xdd439,_0x265632,_0xc30a8e){return db['Team'][_0x42cc('0x53')]({'where':{'id':_0xdd439[_0x42cc('0x46')]['id']}})['then'](function(_0x56c603){if(_0x56c603){if(!_0xdd439[_0x42cc('0x4a')][_0x42cc('0x54')]||!utils['isValidChannel'](_0xdd439[_0x42cc('0x4a')][_0x42cc('0x54')])){throw new db[(_0x42cc('0x55'))][(_0x42cc('0x56'))](_0x42cc('0x57'));}return _0x56c603[_0x42cc('0x5f')+_[_0x42cc('0x58')](_0xdd439['body'][_0x42cc('0x54')]['toLowerCase']())+_0x42cc('0x5d')](_0xdd439[_0x42cc('0x4a')][_0x42cc('0x60')]);}return null;})[_0x42cc('0x26')](handleEntityNotFound(_0x265632,null))[_0x42cc('0x26')](respondWithStatusCode(_0x265632,null))[_0x42cc('0x44')](handleError(_0x265632,null));};exports['removeQueues']=function(_0x325714,_0x5af6aa,_0x25caa2){return db[_0x42cc('0x2c')][_0x42cc('0x53')]({'where':{'id':_0x325714[_0x42cc('0x46')]['id']}})[_0x42cc('0x26')](function(_0x528e79){if(_0x528e79){if(!_0x325714[_0x42cc('0x2e')][_0x42cc('0x54')]||!utils['isValidChannel'](_0x325714[_0x42cc('0x2e')]['channel'])){throw new db[(_0x42cc('0x55'))][(_0x42cc('0x56'))](_0x42cc('0x57'));}return _0x528e79[_0x42cc('0x61')+_[_0x42cc('0x58')](_0x325714[_0x42cc('0x2e')][_0x42cc('0x54')][_0x42cc('0x5c')]())+_0x42cc('0x5d')](_0x325714[_0x42cc('0x2e')][_0x42cc('0x60')]);}return null;})[_0x42cc('0x26')](handleEntityNotFound(_0x5af6aa,null))['then'](respondWithStatusCode(_0x5af6aa,null))[_0x42cc('0x44')](handleError(_0x5af6aa,null));};exports[_0x42cc('0x62')]=function(_0x1714a0,_0x315ee3,_0x5eeea8){return db[_0x42cc('0x2c')][_0x42cc('0x4e')]({'where':{'id':_0x1714a0[_0x42cc('0x46')]['id']}})[_0x42cc('0x26')](handleEntityNotFound(_0x315ee3,null))[_0x42cc('0x26')](function(_0xab3f24){if(_0xab3f24){var _0x916ff6=['Voice',_0x42cc('0x63'),_0x42cc('0x64'),_0x42cc('0x65'),'Fax',_0x42cc('0x66')];return BPromise[_0x42cc('0x67')](_0x916ff6,function(_0x4b0f44){return _0xab3f24[_0x42cc('0x27')+_0x4b0f44+'Queues']({'attributes':['id',_0x42cc('0x2b')]})[_0x42cc('0x26')](function(_0x22c98d){return BPromise[_0x42cc('0x67')](_0x22c98d,function(_0x3d90b9){return _0x3d90b9[_0x42cc('0x62')](_0x1714a0[_0x42cc('0x4a')]['ids'])[_0x42cc('0x26')](function(){if(_0x4b0f44===_0x42cc('0x68')){return db['User']['findAll']({'where':{'id':_0x1714a0['body'][_0x42cc('0x60')]},'attributes':['id',_0x42cc('0x2b'),_0x42cc('0x69'),'voicePause',_0x42cc('0x6a')],'raw':!![]})[_0x42cc('0x26')](function(_0x46c77b){return BPromise[_0x42cc('0x67')](_[_0x42cc('0x39')](_0x46c77b,{'online':0x1}),function(_0x44084f){return db[_0x42cc('0x6b')]['upsert']({'membername':_0x44084f[_0x42cc('0x2b')],'UserId':_0x44084f['id'],'queue_name':_0x3d90b9[_0x42cc('0x2b')],'VoiceQueueId':_0x3d90b9['id'],'interface':_[_0x42cc('0x6c')](_0x44084f['interface'])?util[_0x42cc('0x6d')](_0x42cc('0x6e'),_0x44084f[_0x42cc('0x2b')]):_0x44084f['interface'],'paused':_0x44084f[_0x42cc('0x6f')]||![],'penalty':0x0});});});}});});})[_0x42cc('0x26')](function(){return _0xab3f24;});})[_0x42cc('0x26')](function(){return _0xab3f24;});}})['then'](function(_0x3cc59a){if(_0x3cc59a){return _0x3cc59a['addAgents'](_0x1714a0[_0x42cc('0x4a')]['ids'],_[_0x42cc('0x70')](_0x1714a0[_0x42cc('0x4a')],['ids','id'])||{})[_0x42cc('0x71')](function(_0x2a3491){for(var _0xcda161=0x0;_0xcda161<_0x1714a0[_0x42cc('0x4a')][_0x42cc('0x60')]['length'];_0xcda161+=0x1){socket[_0x42cc('0x72')](_0x42cc('0x73'),{'UserId':_0x1714a0[_0x42cc('0x4a')]['ids'][_0xcda161],'TeamId':_0x1714a0[_0x42cc('0x46')]['id']});}return _0x2a3491;});}})[_0x42cc('0x26')](respondWithResult(_0x315ee3,null))[_0x42cc('0x44')](handleError(_0x315ee3,null));};exports[_0x42cc('0x74')]=function(_0x3b693a,_0x42246b,_0x5b6809){return db[_0x42cc('0x2c')][_0x42cc('0x4e')]({'where':{'id':_0x3b693a[_0x42cc('0x46')]['id']}})[_0x42cc('0x26')](handleEntityNotFound(_0x42246b,null))[_0x42cc('0x26')](function(_0x2d9170){if(_0x2d9170){return BPromise[_0x42cc('0x67')]([_0x42cc('0x75'),_0x42cc('0x76'),_0x42cc('0x77'),'sms',_0x42cc('0x78'),_0x42cc('0x79')],function(_0x25aca9){return _0x2d9170[_0x42cc('0x27')+_[_0x42cc('0x58')](_0x25aca9)+'Queues']({'attributes':['id',_0x42cc('0x2b')]})[_0x42cc('0x26')](function(_0x5c25e7){return BPromise[_0x42cc('0x67')](_0x5c25e7,function(_0x2ae733){return _0x2ae733['removeAgents'](_0x3b693a['query'][_0x42cc('0x60')])[_0x42cc('0x26')](function(){if(_0x25aca9==='voice'){return db[_0x42cc('0x6b')][_0x42cc('0x29')]({'where':{'VoiceQueueId':_0x2ae733['id'],'UserId':_0x3b693a['query'][_0x42cc('0x60')]}});}});});})['then'](function(){return _0x2d9170;});})[_0x42cc('0x26')](function(){return _0x2d9170;});}})[_0x42cc('0x26')](function(_0x467bd8){if(_0x467bd8){return _0x467bd8[_0x42cc('0x74')](_0x3b693a[_0x42cc('0x2e')][_0x42cc('0x60')])[_0x42cc('0x26')](function(){if(_[_0x42cc('0x7a')](_0x3b693a[_0x42cc('0x2e')]['ids'])){for(var _0x223ed2=0x0;_0x223ed2<_0x3b693a['query'][_0x42cc('0x60')][_0x42cc('0x33')];_0x223ed2+=0x1){socket[_0x42cc('0x72')](_0x42cc('0x7b'),{'UserId':Number(_0x3b693a[_0x42cc('0x2e')]['ids'][_0x223ed2]),'TeamId':Number(_0x3b693a[_0x42cc('0x46')]['id'])});}}else{socket[_0x42cc('0x72')](_0x42cc('0x7b'),{'UserId':Number(_0x3b693a[_0x42cc('0x2e')][_0x42cc('0x60')]),'TeamId':Number(_0x3b693a[_0x42cc('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x42246b,null))[_0x42cc('0x44')](handleError(_0x42246b,null));};exports[_0x42cc('0x7c')]=function(_0x3c6fe1,_0x8097e5,_0x3d2c40){var _0x456bd1={};var _0x4289ef={};var _0x3049e2;var _0x2c9287;return db[_0x42cc('0x2c')][_0x42cc('0x53')]({'where':{'id':_0x3c6fe1['params']['id']}})[_0x42cc('0x26')](handleEntityNotFound(_0x8097e5,null))['then'](function(_0x4ecc0a){if(_0x4ecc0a){_0x3049e2=_0x4ecc0a;_0x4289ef[_0x42cc('0x2d')]=_[_0x42cc('0x47')](db[_0x42cc('0x7d')][_0x42cc('0x48')]);_0x4289ef[_0x42cc('0x2e')]=_[_0x42cc('0x47')](_0x3c6fe1['query']);_0x4289ef[_0x42cc('0x2f')]=_[_0x42cc('0x30')](_0x4289ef['model'],_0x4289ef[_0x42cc('0x2e')]);_0x456bd1[_0x42cc('0x31')]=_['intersection'](_0x4289ef[_0x42cc('0x2d')],qs['fields'](_0x3c6fe1[_0x42cc('0x2e')]['fields']));_0x456bd1[_0x42cc('0x31')]=_0x456bd1['attributes'][_0x42cc('0x33')]?_0x456bd1[_0x42cc('0x31')]:_0x4289ef[_0x42cc('0x2d')];_0x456bd1[_0x42cc('0x36')]=qs[_0x42cc('0x37')](_0x3c6fe1[_0x42cc('0x2e')][_0x42cc('0x37')]);_0x456bd1[_0x42cc('0x38')]=qs['filters'](_[_0x42cc('0x5a')](_0x3c6fe1[_0x42cc('0x2e')],_0x4289ef['filters']));if(_0x3c6fe1['query'][_0x42cc('0x39')]){_0x456bd1[_0x42cc('0x38')]=_['merge'](_0x456bd1[_0x42cc('0x38')],{'$or':_[_0x42cc('0x3a')](_0x456bd1['attributes'],function(_0xfb0d94){var _0x5e90c3={};_0x5e90c3[_0xfb0d94]={'$like':'%'+_0x3c6fe1['query'][_0x42cc('0x39')]+'%'};return _0x5e90c3;})});}_0x456bd1=_[_0x42cc('0x5b')]({},_0x456bd1,_0x3c6fe1[_0x42cc('0x3e')]);return _0x3049e2[_0x42cc('0x7c')](_0x456bd1);}})['then'](function(_0x5bf5de){if(_0x5bf5de){_0x2c9287=_0x5bf5de[_0x42cc('0x33')];if(!_0x3c6fe1['query'][_0x42cc('0x7e')]('nolimit')){_0x456bd1['limit']=qs['limit'](_0x3c6fe1['query'][_0x42cc('0x35')]);_0x456bd1[_0x42cc('0x20')]=qs['offset'](_0x3c6fe1['query'][_0x42cc('0x20')]);}return _0x3049e2['getAgents'](_0x456bd1);}})[_0x42cc('0x26')](function(_0xa82887){if(_0xa82887){return _0xa82887?{'count':_0x2c9287,'rows':_0xa82887}:null;}})['then'](respondWithResult(_0x8097e5,null))['catch'](handleError(_0x8097e5,null));};
\ No newline at end of file
diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js
index 4096d29..4c2048a 100644
--- a/server/api/team/team.events.js
+++ b/server/api/team/team.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x33bc=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xfdec06,_0x9fa2f4){var _0x58a539=function(_0xfc799c){while(--_0xfc799c){_0xfdec06['push'](_0xfdec06['shift']());}};_0x58a539(++_0x9fa2f4);}(_0x33bc,0x1e5));var _0xc33b=function(_0x54e532,_0x183b26){_0x54e532=_0x54e532-0x0;var _0x216cd8=_0x33bc[_0x54e532];return _0x216cd8;};'use strict';var EventEmitter=require(_0xc33b('0x0'));var Team=require(_0xc33b('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc33b('0x2'),'afterUpdate':_0xc33b('0x3'),'afterDestroy':_0xc33b('0x4')};function emitEvent(_0x4f0e91){return function(_0x4ec9f9,_0x36d095,_0x412bff){TeamEvents['emit'](_0x4f0e91+':'+_0x4ec9f9['id'],_0x4ec9f9);TeamEvents[_0xc33b('0x5')](_0x4f0e91,_0x4ec9f9);_0x412bff(null);};}for(var e in events){if(events[_0xc33b('0x6')](e)){var event=events[e];Team[_0xc33b('0x7')](e,emitEvent(event));}}module[_0xc33b('0x8')]=TeamEvents;
\ No newline at end of file
+var _0x85e5=['setMaxListeners','remove','emit','hasOwnProperty','events','Team'];(function(_0x1afde2,_0x13d0ec){var _0x2b0db6=function(_0x1e12f8){while(--_0x1e12f8){_0x1afde2['push'](_0x1afde2['shift']());}};_0x2b0db6(++_0x13d0ec);}(_0x85e5,0x1b4));var _0x585e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x85e5[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x585e('0x0'));var Team=require('../../mysqldb')['db'][_0x585e('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x585e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x585e('0x3')};function emitEvent(_0x35b686){return function(_0xcda417,_0xca673d,_0x699104){TeamEvents[_0x585e('0x4')](_0x35b686+':'+_0xcda417['id'],_0xcda417);TeamEvents[_0x585e('0x4')](_0x35b686,_0xcda417);_0x699104(null);};}for(var e in events){if(events[_0x585e('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js
index e99d247..9c00c70 100644
--- a/server/api/team/team.model.js
+++ b/server/api/team/team.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9832=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','teams','lodash','util'];(function(_0x5850c0,_0x3c2c){var _0x113882=function(_0x1d8200){while(--_0x1d8200){_0x5850c0['push'](_0x5850c0['shift']());}};_0x113882(++_0x3c2c);}(_0x9832,0x1ec));var _0x2983=function(_0x37edba,_0xa77c93){_0x37edba=_0x37edba-0x0;var _0x14b6c0=_0x9832[_0x37edba];return _0x14b6c0;};'use strict';var _=require(_0x2983('0x0'));var util=require(_0x2983('0x1'));var logger=require(_0x2983('0x2'))(_0x2983('0x3'));var moment=require(_0x2983('0x4'));var BPromise=require(_0x2983('0x5'));var rp=require(_0x2983('0x6'));var fs=require('fs');var path=require(_0x2983('0x7'));var rimraf=require(_0x2983('0x8'));var config=require(_0x2983('0x9'));var attributes=require(_0x2983('0xa'));module[_0x2983('0xb')]=function(_0x263b82,_0x3d6755){return _0x263b82['define']('Team',attributes,{'tableName':_0x2983('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4de7=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0x4de7,0x7e));var _0x74de=function(_0x48d64e,_0x3bd937){_0x48d64e=_0x48d64e-0x0;var _0x590147=_0x4de7[_0x48d64e];return _0x590147;};'use strict';var _=require(_0x74de('0x0'));var util=require(_0x74de('0x1'));var logger=require(_0x74de('0x2'))(_0x74de('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x74de('0x4'));var fs=require('fs');var path=require(_0x74de('0x5'));var rimraf=require(_0x74de('0x6'));var config=require(_0x74de('0x7'));var attributes=require('./team.attributes');module['exports']=function(_0x399530,_0x48cc34){return _0x399530[_0x74de('0x8')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js
index 91bf92d..a9f6f25 100644
--- a/server/api/team/team.rpc.js
+++ b/server/api/team/team.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3052=['redis','localhost','socket.io-emitter','./team.socket','register','request','then','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','Team,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x3052,0xb9));var _0x2305=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3052[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x2305('0x0'));var moment=require(_0x2305('0x1'));var BPromise=require('bluebird');var rs=require(_0x2305('0x2'));var fs=require('fs');var Redis=require(_0x2305('0x3'));var db=require(_0x2305('0x4'))['db'];var utils=require(_0x2305('0x5'));var logger=require('../../config/logger')(_0x2305('0x6'));var config=require(_0x2305('0x7'));var jayson=require(_0x2305('0x8'));var client=jayson[_0x2305('0x9')][_0x2305('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2305('0xb')],{'host':_0x2305('0xc'),'port':0x18eb});var socket=require(_0x2305('0xd'))(new Redis(config[_0x2305('0xb')]));require(_0x2305('0xe'))[_0x2305('0xf')](socket);function respondWithRpcPromise(_0x29c63f,_0x450082,_0x43a2ea){return new BPromise(function(_0x275b0f,_0x457c70){return client[_0x2305('0x10')](_0x29c63f,_0x43a2ea)[_0x2305('0x11')](function(_0x5dddff){logger['info']('Team,\x20%s,\x20%s',_0x450082,_0x2305('0x12'));logger[_0x2305('0x13')](_0x2305('0x14'),_0x450082,_0x2305('0x12'),JSON['stringify'](_0x5dddff));if(_0x5dddff[_0x2305('0x15')]){if(_0x5dddff[_0x2305('0x15')][_0x2305('0x16')]===0x1f4){logger[_0x2305('0x15')](_0x2305('0x17'),_0x450082,_0x5dddff[_0x2305('0x15')][_0x2305('0x18')]);return _0x457c70(_0x5dddff['error']['message']);}logger[_0x2305('0x15')](_0x2305('0x17'),_0x450082,_0x5dddff[_0x2305('0x15')][_0x2305('0x18')]);return _0x275b0f(_0x5dddff[_0x2305('0x15')][_0x2305('0x18')]);}else{logger[_0x2305('0x19')]('Team,\x20%s,\x20%s',_0x450082,_0x2305('0x12'));_0x275b0f(_0x5dddff[_0x2305('0x1a')]['message']);}})[_0x2305('0x1b')](function(_0x991a95){logger[_0x2305('0x15')](_0x2305('0x17'),_0x450082,_0x991a95);_0x457c70(_0x991a95);});});}
\ No newline at end of file
+var _0x4855=['redis','defaults','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x343ba9,_0x864b3){var _0x303eff=function(_0x39e01a){while(--_0x39e01a){_0x343ba9['push'](_0x343ba9['shift']());}};_0x303eff(++_0x864b3);}(_0x4855,0x1be));var _0x5485=function(_0x449158,_0x44e1b0){_0x449158=_0x449158-0x0;var _0x1f3c3a=_0x4855[_0x449158];return _0x1f3c3a;};'use strict';var _=require(_0x5485('0x0'));var util=require(_0x5485('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5485('0x2'));var fs=require('fs');var Redis=require(_0x5485('0x3'));var db=require(_0x5485('0x4'))['db'];var utils=require(_0x5485('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5485('0x6'));var jayson=require(_0x5485('0x7'));var client=jayson[_0x5485('0x8')][_0x5485('0x9')]({'port':0x232a});config[_0x5485('0xa')]=_[_0x5485('0xb')](config[_0x5485('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5485('0xc'))(new Redis(config['redis']));require(_0x5485('0xd'))[_0x5485('0xe')](socket);function respondWithRpcPromise(_0x3e8e3b,_0x1aa1dc,_0x74fd13){return new BPromise(function(_0x194002,_0x366f42){return client[_0x5485('0xf')](_0x3e8e3b,_0x74fd13)['then'](function(_0x1482e8){logger[_0x5485('0x10')](_0x5485('0x11'),_0x1aa1dc,_0x5485('0x12'));logger['debug'](_0x5485('0x13'),_0x1aa1dc,_0x5485('0x12'),JSON[_0x5485('0x14')](_0x1482e8));if(_0x1482e8[_0x5485('0x15')]){if(_0x1482e8[_0x5485('0x15')]['code']===0x1f4){logger[_0x5485('0x15')](_0x5485('0x11'),_0x1aa1dc,_0x1482e8[_0x5485('0x15')][_0x5485('0x16')]);return _0x366f42(_0x1482e8['error'][_0x5485('0x16')]);}logger[_0x5485('0x15')](_0x5485('0x11'),_0x1aa1dc,_0x1482e8[_0x5485('0x15')]['message']);return _0x194002(_0x1482e8[_0x5485('0x15')][_0x5485('0x16')]);}else{logger[_0x5485('0x10')](_0x5485('0x11'),_0x1aa1dc,_0x5485('0x12'));_0x194002(_0x1482e8['result']['message']);}})[_0x5485('0x17')](function(_0x219bb4){logger[_0x5485('0x15')](_0x5485('0x11'),_0x1aa1dc,_0x219bb4);_0x366f42(_0x219bb4);});});}
\ No newline at end of file
diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js
index e96628d..1b3a42d 100644
--- a/server/api/team/team.socket.js
+++ b/server/api/team/team.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf31d=['save','remove','update','emit','removeListener','register','length','./team.events'];(function(_0x1dd2cc,_0x36ddfe){var _0x305d8e=function(_0x27df09){while(--_0x27df09){_0x1dd2cc['push'](_0x1dd2cc['shift']());}};_0x305d8e(++_0x36ddfe);}(_0xf31d,0x67));var _0xdf31=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0xf31d[_0x4d674b];return _0x535a1f;};'use strict';var TeamEvents=require(_0xdf31('0x0'));var events=[_0xdf31('0x1'),_0xdf31('0x2'),_0xdf31('0x3')];function createListener(_0x220f89,_0x44c97b){return function(_0xe9b786){_0x44c97b[_0xdf31('0x4')](_0x220f89,_0xe9b786);};}function removeListener(_0x2ee298,_0x24d19f){return function(){TeamEvents[_0xdf31('0x5')](_0x2ee298,_0x24d19f);};}exports[_0xdf31('0x6')]=function(_0x19afba){for(var _0x527641=0x0,_0x4d6ec9=events[_0xdf31('0x7')];_0x527641<_0x4d6ec9;_0x527641++){var _0xb08798=events[_0x527641];var _0x1b0d3a=createListener('team:'+_0xb08798,_0x19afba);TeamEvents['on'](_0xb08798,_0x1b0d3a);}};
\ No newline at end of file
+var _0xf00e=['length','team:','./team.events','save','remove','update','emit','removeListener','register'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xf00e,0xfe));var _0xef00=function(_0x3de67e,_0x251953){_0x3de67e=_0x3de67e-0x0;var _0x3c474b=_0xf00e[_0x3de67e];return _0x3c474b;};'use strict';var TeamEvents=require(_0xef00('0x0'));var events=[_0xef00('0x1'),_0xef00('0x2'),_0xef00('0x3')];function createListener(_0x354b56,_0x1aff7f){return function(_0x498897){_0x1aff7f[_0xef00('0x4')](_0x354b56,_0x498897);};}function removeListener(_0x550d83,_0x177c06){return function(){TeamEvents[_0xef00('0x5')](_0x550d83,_0x177c06);};}exports[_0xef00('0x6')]=function(_0xa168f7){for(var _0x12aa53=0x0,_0x179032=events[_0xef00('0x7')];_0x12aa53<_0x179032;_0x12aa53++){var _0x874cc8=events[_0x12aa53];var _0x3aac26=createListener(_0xef00('0x8')+_0x874cc8,_0xa168f7);TeamEvents['on'](_0x874cc8,_0x3aac26);}};
\ No newline at end of file
diff --git a/server/api/template/index.js b/server/api/template/index.js
index b1cd3f0..4dcc4cb 100644
--- a/server/api/template/index.js
+++ b/server/api/template/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf542=['multer','util','path','connect-timeout','../../components/interaction/service','./template.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf542,0xe0));var _0x2f54=function(_0x54cf10,_0x28563b){_0x54cf10=_0x54cf10-0x0;var _0xf08413=_0xf542[_0x54cf10];return _0xf08413;};'use strict';var multer=require(_0x2f54('0x0'));var util=require(_0x2f54('0x1'));var path=require(_0x2f54('0x2'));var timeout=require(_0x2f54('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2f54('0x4'));var config=require('../../config/environment');var controller=require(_0x2f54('0x5'));router['get']('/',auth[_0x2f54('0x6')](),controller[_0x2f54('0x7')]);router[_0x2f54('0x8')]('/:id',auth[_0x2f54('0x6')](),controller[_0x2f54('0x9')]);router[_0x2f54('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2f54('0xb')](_0x2f54('0xc'),auth['isAuthenticated'](),controller[_0x2f54('0xd')]);router[_0x2f54('0xe')](_0x2f54('0xc'),auth['isAuthenticated'](),controller[_0x2f54('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x9b9e=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated'];(function(_0x29f023,_0x3d9270){var _0x37e29f=function(_0x28c0bf){while(--_0x28c0bf){_0x29f023['push'](_0x29f023['shift']());}};_0x37e29f(++_0x3d9270);}(_0x9b9e,0x160));var _0xe9b9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9b9e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe9b9('0x0'));var util=require(_0xe9b9('0x1'));var path=require(_0xe9b9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe9b9('0x3')]();var auth=require(_0xe9b9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe9b9('0x5'));var controller=require(_0xe9b9('0x6'));router[_0xe9b9('0x7')]('/',auth[_0xe9b9('0x8')](),controller[_0xe9b9('0x9')]);router[_0xe9b9('0x7')](_0xe9b9('0xa'),auth[_0xe9b9('0x8')](),controller[_0xe9b9('0xb')]);router[_0xe9b9('0xc')]('/',auth['isAuthenticated'](),controller[_0xe9b9('0xd')]);router[_0xe9b9('0xe')]('/:id',auth[_0xe9b9('0x8')](),controller[_0xe9b9('0xf')]);router[_0xe9b9('0x10')](_0xe9b9('0xa'),auth['isAuthenticated'](),controller[_0xe9b9('0x11')]);module[_0xe9b9('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js
index a65c1ae..058a998 100644
--- a/server/api/template/template.attributes.js
+++ b/server/api/template/template.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9099=['STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9099,0x188));var _0x9909=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x9099[_0x1e381c];return _0x9b5ea9;};'use strict';var Sequelize=require(_0x9909('0x0'));module['exports']={'name':{'type':Sequelize[_0x9909('0x1')]},'description':{'type':Sequelize[_0x9909('0x1')]},'html':{'type':Sequelize[_0x9909('0x2')]}};
\ No newline at end of file
+var _0x1b88=['TEXT','sequelize','STRING'];(function(_0x5097a8,_0x456cf9){var _0x15241e=function(_0x335d5b){while(--_0x335d5b){_0x5097a8['push'](_0x5097a8['shift']());}};_0x15241e(++_0x456cf9);}(_0x1b88,0x169));var _0x81b8=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x1b88[_0x486f4a];return _0x135d99;};'use strict';var Sequelize=require(_0x81b8('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x81b8('0x1')]},'html':{'type':Sequelize[_0x81b8('0x2')]}};
\ No newline at end of file
diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js
index a219db9..3733cb6 100644
--- a/server/api/template/template.controller.js
+++ b/server/api/template/template.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7995=['save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Template','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','findAll','catch','show','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply'];(function(_0x4b5c23,_0x101faa){var _0x262cfd=function(_0x48aa2a){while(--_0x48aa2a){_0x4b5c23['push'](_0x4b5c23['shift']());}};_0x262cfd(++_0x101faa);}(_0x7995,0x81));var _0x5799=function(_0x36c288,_0x24bdfa){_0x36c288=_0x36c288-0x0;var _0x3cdedd=_0x7995[_0x36c288];return _0x3cdedd;};'use strict';var pdf=require(_0x5799('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5799('0x1'));var jsonpatch=require(_0x5799('0x2'));var rp=require('request-promise');var moment=require(_0x5799('0x3'));var BPromise=require(_0x5799('0x4'));var Mustache=require(_0x5799('0x5'));var util=require(_0x5799('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5799('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5799('0x8'));var squel=require('squel');var crypto=require(_0x5799('0x9'));var jsforce=require(_0x5799('0xa'));var deskjs=require(_0x5799('0xb'));var toCsv=require(_0x5799('0x7'));var querystring=require('querystring');var Papa=require(_0x5799('0xc'));var Redis=require(_0x5799('0xd'));var authService=require(_0x5799('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5799('0xf'))(_0x5799('0x10'));var utils=require(_0x5799('0x11'));var config=require(_0x5799('0x12'));var db=require(_0x5799('0x13'))['db'];function respondWithStatusCode(_0x386a1f,_0x3b8ea5){_0x3b8ea5=_0x3b8ea5||0xcc;return function(_0x1520c1){if(_0x1520c1){return _0x386a1f[_0x5799('0x14')](_0x3b8ea5);}return _0x386a1f[_0x5799('0x15')](_0x3b8ea5)[_0x5799('0x16')]();};}function respondWithResult(_0x49675b,_0x40f45a){_0x40f45a=_0x40f45a||0xc8;return function(_0x5e10f0){if(_0x5e10f0){return _0x49675b['status'](_0x40f45a)[_0x5799('0x17')](_0x5e10f0);}};}function respondWithFilteredResult(_0x382d71,_0x5d0528){return function(_0x1b0b87){if(_0x1b0b87){var _0x363381=_0x1b0b87[_0x5799('0x18')],_0x4cd9b5=_0x5d0528['offset'],_0x42d1d4=_0x5d0528[_0x5799('0x19')]+_0x5d0528[_0x5799('0x1a')],_0x25ac56;if(_0x42d1d4>=_0x363381){_0x42d1d4=_0x363381;_0x25ac56=0xc8;}else{_0x25ac56=0xce;}_0x382d71[_0x5799('0x15')](_0x25ac56);return _0x382d71['set'](_0x5799('0x1b'),_0x4cd9b5+'-'+_0x42d1d4+'/'+_0x363381)[_0x5799('0x17')](_0x1b0b87);}return null;};}function patchUpdates(_0x26ba11){return function(_0x26997e){try{jsonpatch[_0x5799('0x1c')](_0x26997e,_0x26ba11,!![]);}catch(_0x4f2ebf){return BPromise['reject'](_0x4f2ebf);}return _0x26997e[_0x5799('0x1d')]();};}function saveUpdates(_0x132825,_0x2cc9b3){return function(_0x278eca){if(_0x278eca){return _0x278eca[_0x5799('0x1e')](_0x132825)[_0x5799('0x1f')](function(_0x59b2dd){return _0x59b2dd;});}return null;};}function removeEntity(_0x464e4a,_0x244b2e){return function(_0xacc7c){if(_0xacc7c){return _0xacc7c[_0x5799('0x20')]()[_0x5799('0x1f')](function(){var _0x1ae881=_0xacc7c[_0x5799('0x21')]({'plain':!![]});var _0x5d06f3='Templates';return db[_0x5799('0x22')][_0x5799('0x20')]({'where':{'type':_0x5d06f3,'resourceId':_0x1ae881['id']}})[_0x5799('0x1f')](function(){return _0xacc7c;});})[_0x5799('0x1f')](function(){_0x464e4a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15e3f7,_0x10c4d1){return function(_0x148934){if(!_0x148934){_0x15e3f7[_0x5799('0x14')](0x194);}return _0x148934;};}function handleError(_0x42d7c1,_0x8fa645){_0x8fa645=_0x8fa645||0x1f4;return function(_0x2c72b5){logger[_0x5799('0x23')](_0x2c72b5[_0x5799('0x24')]);if(_0x2c72b5[_0x5799('0x25')]){delete _0x2c72b5[_0x5799('0x25')];}_0x42d7c1[_0x5799('0x15')](_0x8fa645)[_0x5799('0x26')](_0x2c72b5);};}exports[_0x5799('0x27')]=function(_0x17d42c,_0x3a1c85){var _0x428e06={},_0x251224={},_0x12543e={'count':0x0,'rows':[]};var _0x58cd95=db[_0x5799('0x28')][_0x5799('0x29')];_0x251224[_0x5799('0x2a')]=_['keys'](_0x58cd95);_0x251224['query']=_['keys'](_0x17d42c[_0x5799('0x2b')]);_0x251224[_0x5799('0x2c')]=_[_0x5799('0x2d')](_0x251224[_0x5799('0x2a')],_0x251224[_0x5799('0x2b')]);_0x428e06[_0x5799('0x2e')]=_['intersection'](_0x251224[_0x5799('0x2a')],qs['fields'](_0x17d42c[_0x5799('0x2b')][_0x5799('0x2f')]));_0x428e06[_0x5799('0x2e')]=_0x428e06[_0x5799('0x2e')][_0x5799('0x30')]?_0x428e06[_0x5799('0x2e')]:_0x251224[_0x5799('0x2a')];if(!_0x17d42c[_0x5799('0x2b')][_0x5799('0x31')](_0x5799('0x32'))){_0x428e06[_0x5799('0x1a')]=qs[_0x5799('0x1a')](_0x17d42c['query'][_0x5799('0x1a')]);_0x428e06[_0x5799('0x19')]=qs['offset'](_0x17d42c['query'][_0x5799('0x19')]);}_0x428e06[_0x5799('0x33')]=qs[_0x5799('0x34')](_0x17d42c[_0x5799('0x2b')][_0x5799('0x34')]);_0x428e06[_0x5799('0x35')]=qs['filters'](_[_0x5799('0x36')](_0x17d42c[_0x5799('0x2b')],_0x251224[_0x5799('0x2c')]));if(_0x17d42c[_0x5799('0x2b')][_0x5799('0x37')]){_0x428e06['where']=_[_0x5799('0x38')](_0x428e06[_0x5799('0x35')],{'$or':_['map'](_0x58cd95,function(_0x5c3ee0){if(_0x5c3ee0[_0x5799('0x39')][_0x5799('0x3a')]!==_0x5799('0x3b')){var _0x557fc7={};_0x557fc7[_0x5c3ee0[_0x5799('0x3c')]]={'$like':'%'+_0x17d42c['query'][_0x5799('0x37')]+'%'};return _0x557fc7;}})});}_0x428e06=_[_0x5799('0x38')]({},_0x428e06,_0x17d42c['options']);var _0x2bfe9a={'where':_0x428e06[_0x5799('0x35')]};return db['Template'][_0x5799('0x18')](_0x2bfe9a)[_0x5799('0x1f')](function(_0x4ba71e){_0x12543e['count']=_0x4ba71e;if(_0x17d42c[_0x5799('0x2b')][_0x5799('0x3d')]){_0x428e06['include']=[{'all':!![]}];}return db[_0x5799('0x28')][_0x5799('0x3e')](_0x428e06);})[_0x5799('0x1f')](function(_0x184cb4){_0x12543e['rows']=_0x184cb4;return _0x12543e;})[_0x5799('0x1f')](respondWithFilteredResult(_0x3a1c85,_0x428e06))[_0x5799('0x3f')](handleError(_0x3a1c85,null));};exports[_0x5799('0x40')]=function(_0x326d05,_0x1a5bdc){var _0x2532e2={'raw':!![],'where':{'id':_0x326d05[_0x5799('0x41')]['id']}},_0x3ab3dc={};_0x3ab3dc[_0x5799('0x2a')]=_['keys'](db['Template'][_0x5799('0x29')]);_0x3ab3dc[_0x5799('0x2b')]=_[_0x5799('0x42')](_0x326d05[_0x5799('0x2b')]);_0x3ab3dc[_0x5799('0x2c')]=_[_0x5799('0x2d')](_0x3ab3dc[_0x5799('0x2a')],_0x3ab3dc[_0x5799('0x2b')]);_0x2532e2[_0x5799('0x2e')]=_[_0x5799('0x2d')](_0x3ab3dc['model'],qs[_0x5799('0x2f')](_0x326d05[_0x5799('0x2b')][_0x5799('0x2f')]));_0x2532e2[_0x5799('0x2e')]=_0x2532e2[_0x5799('0x2e')][_0x5799('0x30')]?_0x2532e2[_0x5799('0x2e')]:_0x3ab3dc[_0x5799('0x2a')];if(_0x326d05[_0x5799('0x2b')]['includeAll']){_0x2532e2[_0x5799('0x43')]=[{'all':!![]}];}_0x2532e2=_[_0x5799('0x38')]({},_0x2532e2,_0x326d05['options']);return db[_0x5799('0x28')][_0x5799('0x44')](_0x2532e2)[_0x5799('0x1f')](handleEntityNotFound(_0x1a5bdc,null))[_0x5799('0x1f')](respondWithResult(_0x1a5bdc,null))[_0x5799('0x3f')](handleError(_0x1a5bdc,null));};exports[_0x5799('0x45')]=function(_0x4f03c0,_0x521fcd){return db['Template'][_0x5799('0x45')](_0x4f03c0[_0x5799('0x46')],{})[_0x5799('0x1f')](function(_0x53c883){var _0x52b54b=_0x4f03c0[_0x5799('0x47')]['get']({'plain':!![]});if(!_0x52b54b)throw new Error(_0x5799('0x48'));if(_0x52b54b[_0x5799('0x49')]===_0x5799('0x47')){var _0x339826=_0x53c883[_0x5799('0x21')]({'plain':!![]});var _0x52e7ac=_0x5799('0x4a');return db[_0x5799('0x4b')][_0x5799('0x44')]({'where':{'name':_0x52e7ac,'userProfileId':_0x52b54b[_0x5799('0x4c')]},'raw':!![]})['then'](function(_0x1c91ab){if(_0x1c91ab&&_0x1c91ab[_0x5799('0x4d')]===0x0){return db['UserProfileResource'][_0x5799('0x45')]({'name':_0x339826[_0x5799('0x25')],'resourceId':_0x339826['id'],'type':_0x1c91ab[_0x5799('0x25')],'sectionId':_0x1c91ab['id']},{})[_0x5799('0x1f')](function(){return _0x53c883;});}else{return _0x53c883;}})[_0x5799('0x3f')](function(_0x5cfbec){logger[_0x5799('0x23')](_0x5799('0x4e'),_0x5cfbec);throw _0x5cfbec;});}return _0x53c883;})[_0x5799('0x1f')](respondWithResult(_0x521fcd,0xc9))[_0x5799('0x3f')](handleError(_0x521fcd,null));};exports[_0x5799('0x1e')]=function(_0x4d1d23,_0x98c3b6){if(_0x4d1d23[_0x5799('0x46')]['id']){delete _0x4d1d23[_0x5799('0x46')]['id'];}return db[_0x5799('0x28')]['find']({'where':{'id':_0x4d1d23[_0x5799('0x41')]['id']}})[_0x5799('0x1f')](handleEntityNotFound(_0x98c3b6,null))['then'](saveUpdates(_0x4d1d23[_0x5799('0x46')],null))['then'](respondWithResult(_0x98c3b6,null))[_0x5799('0x3f')](handleError(_0x98c3b6,null));};exports[_0x5799('0x20')]=function(_0x281da4,_0x523c63){return db[_0x5799('0x28')][_0x5799('0x44')]({'where':{'id':_0x281da4['params']['id']}})[_0x5799('0x1f')](handleEntityNotFound(_0x523c63,null))[_0x5799('0x1f')](removeEntity(_0x523c63,null))[_0x5799('0x3f')](handleError(_0x523c63,null));};
\ No newline at end of file
+var _0x7697=['send','index','Template','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','end','count','offset','limit','status','set','Content-Range','json','apply','update','then','destroy','Templates','error','stack','name'];(function(_0x15b14f,_0x40d924){var _0x1a37af=function(_0xf9e913){while(--_0xf9e913){_0x15b14f['push'](_0x15b14f['shift']());}};_0x1a37af(++_0x40d924);}(_0x7697,0x7c));var _0x7769=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0x7697[_0x1af98d];return _0x3553ea;};'use strict';var pdf=require(_0x7769('0x0'));var emlformat=require(_0x7769('0x1'));var rimraf=require(_0x7769('0x2'));var zipdir=require(_0x7769('0x3'));var jsonpatch=require(_0x7769('0x4'));var rp=require('request-promise');var moment=require(_0x7769('0x5'));var BPromise=require(_0x7769('0x6'));var Mustache=require(_0x7769('0x7'));var util=require(_0x7769('0x8'));var path=require('path');var sox=require(_0x7769('0x9'));var csv=require(_0x7769('0xa'));var ejs=require(_0x7769('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7769('0xc'));var crypto=require(_0x7769('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7769('0xe'));var toCsv=require(_0x7769('0xa'));var querystring=require(_0x7769('0xf'));var Papa=require(_0x7769('0x10'));var Redis=require(_0x7769('0x11'));var authService=require(_0x7769('0x12'));var qs=require(_0x7769('0x13'));var hardwareService=require(_0x7769('0x14'));var logger=require(_0x7769('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4350b1,_0x1be6bb){_0x1be6bb=_0x1be6bb||0xcc;return function(_0x4f26a0){if(_0x4f26a0){return _0x4350b1['sendStatus'](_0x1be6bb);}return _0x4350b1['status'](_0x1be6bb)[_0x7769('0x16')]();};}function respondWithResult(_0x376e7f,_0x5a2cc4){_0x5a2cc4=_0x5a2cc4||0xc8;return function(_0x4d32ab){if(_0x4d32ab){return _0x376e7f['status'](_0x5a2cc4)['json'](_0x4d32ab);}};}function respondWithFilteredResult(_0x2278a0,_0x52c860){return function(_0x4610d7){if(_0x4610d7){var _0x208739=_0x4610d7[_0x7769('0x17')],_0x445ebf=_0x52c860[_0x7769('0x18')],_0x350198=_0x52c860[_0x7769('0x18')]+_0x52c860[_0x7769('0x19')],_0x355df7;if(_0x350198>=_0x208739){_0x350198=_0x208739;_0x355df7=0xc8;}else{_0x355df7=0xce;}_0x2278a0[_0x7769('0x1a')](_0x355df7);return _0x2278a0[_0x7769('0x1b')](_0x7769('0x1c'),_0x445ebf+'-'+_0x350198+'/'+_0x208739)[_0x7769('0x1d')](_0x4610d7);}return null;};}function patchUpdates(_0x1e4b69){return function(_0x2f1bf7){try{jsonpatch[_0x7769('0x1e')](_0x2f1bf7,_0x1e4b69,!![]);}catch(_0x285aad){return BPromise['reject'](_0x285aad);}return _0x2f1bf7['save']();};}function saveUpdates(_0xa2aa59,_0x3f1b79){return function(_0x211caf){if(_0x211caf){return _0x211caf[_0x7769('0x1f')](_0xa2aa59)[_0x7769('0x20')](function(_0x111572){return _0x111572;});}return null;};}function removeEntity(_0x40cb67,_0x4de33a){return function(_0x243cdb){if(_0x243cdb){return _0x243cdb[_0x7769('0x21')]()['then'](function(){var _0x14caf8=_0x243cdb['get']({'plain':!![]});var _0x32933e=_0x7769('0x22');return db['UserProfileResource'][_0x7769('0x21')]({'where':{'type':_0x32933e,'resourceId':_0x14caf8['id']}})['then'](function(){return _0x243cdb;});})[_0x7769('0x20')](function(){_0x40cb67['status'](0xcc)[_0x7769('0x16')]();});}};}function handleEntityNotFound(_0x41d177,_0xdc0d3){return function(_0x492446){if(!_0x492446){_0x41d177['sendStatus'](0x194);}return _0x492446;};}function handleError(_0x19c4bb,_0x1ec584){_0x1ec584=_0x1ec584||0x1f4;return function(_0x47f364){logger[_0x7769('0x23')](_0x47f364[_0x7769('0x24')]);if(_0x47f364[_0x7769('0x25')]){delete _0x47f364[_0x7769('0x25')];}_0x19c4bb[_0x7769('0x1a')](_0x1ec584)[_0x7769('0x26')](_0x47f364);};}exports[_0x7769('0x27')]=function(_0x4f5b85,_0x442135){var _0xcde6e2={},_0x3a5551={},_0x21834c={'count':0x0,'rows':[]};var _0x4dfd75=db[_0x7769('0x28')][_0x7769('0x29')];_0x3a5551[_0x7769('0x2a')]=_[_0x7769('0x2b')](_0x4dfd75);_0x3a5551['query']=_[_0x7769('0x2b')](_0x4f5b85[_0x7769('0x2c')]);_0x3a5551[_0x7769('0x2d')]=_[_0x7769('0x2e')](_0x3a5551[_0x7769('0x2a')],_0x3a5551['query']);_0xcde6e2['attributes']=_[_0x7769('0x2e')](_0x3a5551[_0x7769('0x2a')],qs[_0x7769('0x2f')](_0x4f5b85[_0x7769('0x2c')][_0x7769('0x2f')]));_0xcde6e2[_0x7769('0x30')]=_0xcde6e2[_0x7769('0x30')][_0x7769('0x31')]?_0xcde6e2[_0x7769('0x30')]:_0x3a5551['model'];if(!_0x4f5b85['query'][_0x7769('0x32')](_0x7769('0x33'))){_0xcde6e2[_0x7769('0x19')]=qs[_0x7769('0x19')](_0x4f5b85[_0x7769('0x2c')][_0x7769('0x19')]);_0xcde6e2[_0x7769('0x18')]=qs[_0x7769('0x18')](_0x4f5b85['query'][_0x7769('0x18')]);}_0xcde6e2[_0x7769('0x34')]=qs[_0x7769('0x35')](_0x4f5b85[_0x7769('0x2c')][_0x7769('0x35')]);_0xcde6e2['where']=qs['filters'](_[_0x7769('0x36')](_0x4f5b85[_0x7769('0x2c')],_0x3a5551[_0x7769('0x2d')]));if(_0x4f5b85[_0x7769('0x2c')][_0x7769('0x37')]){_0xcde6e2[_0x7769('0x38')]=_[_0x7769('0x39')](_0xcde6e2[_0x7769('0x38')],{'$or':_[_0x7769('0x3a')](_0x4dfd75,function(_0x23ebe6){if(_0x23ebe6[_0x7769('0x3b')][_0x7769('0x3c')]!==_0x7769('0x3d')){var _0x2e88e3={};_0x2e88e3[_0x23ebe6[_0x7769('0x3e')]]={'$like':'%'+_0x4f5b85['query'][_0x7769('0x37')]+'%'};return _0x2e88e3;}})});}_0xcde6e2=_[_0x7769('0x39')]({},_0xcde6e2,_0x4f5b85[_0x7769('0x3f')]);var _0x20ddad={'where':_0xcde6e2[_0x7769('0x38')]};return db[_0x7769('0x28')][_0x7769('0x17')](_0x20ddad)['then'](function(_0x448888){_0x21834c['count']=_0x448888;if(_0x4f5b85[_0x7769('0x2c')][_0x7769('0x40')]){_0xcde6e2['include']=[{'all':!![]}];}return db['Template'][_0x7769('0x41')](_0xcde6e2);})[_0x7769('0x20')](function(_0x28e2d3){_0x21834c[_0x7769('0x42')]=_0x28e2d3;return _0x21834c;})[_0x7769('0x20')](respondWithFilteredResult(_0x442135,_0xcde6e2))[_0x7769('0x43')](handleError(_0x442135,null));};exports[_0x7769('0x44')]=function(_0x437f03,_0x2c9ac0){var _0x1e76a8={'raw':!![],'where':{'id':_0x437f03[_0x7769('0x45')]['id']}},_0x57f173={};_0x57f173['model']=_[_0x7769('0x2b')](db[_0x7769('0x28')][_0x7769('0x29')]);_0x57f173[_0x7769('0x2c')]=_[_0x7769('0x2b')](_0x437f03[_0x7769('0x2c')]);_0x57f173[_0x7769('0x2d')]=_[_0x7769('0x2e')](_0x57f173[_0x7769('0x2a')],_0x57f173[_0x7769('0x2c')]);_0x1e76a8['attributes']=_[_0x7769('0x2e')](_0x57f173[_0x7769('0x2a')],qs[_0x7769('0x2f')](_0x437f03[_0x7769('0x2c')][_0x7769('0x2f')]));_0x1e76a8['attributes']=_0x1e76a8[_0x7769('0x30')][_0x7769('0x31')]?_0x1e76a8[_0x7769('0x30')]:_0x57f173[_0x7769('0x2a')];if(_0x437f03[_0x7769('0x2c')][_0x7769('0x40')]){_0x1e76a8[_0x7769('0x46')]=[{'all':!![]}];}_0x1e76a8=_[_0x7769('0x39')]({},_0x1e76a8,_0x437f03['options']);return db['Template']['find'](_0x1e76a8)['then'](handleEntityNotFound(_0x2c9ac0,null))['then'](respondWithResult(_0x2c9ac0,null))[_0x7769('0x43')](handleError(_0x2c9ac0,null));};exports[_0x7769('0x47')]=function(_0x2ab05b,_0x448425){return db[_0x7769('0x28')]['create'](_0x2ab05b[_0x7769('0x48')],{})[_0x7769('0x20')](function(_0x5c2fee){var _0x2e433d=_0x2ab05b[_0x7769('0x49')]['get']({'plain':!![]});if(!_0x2e433d)throw new Error(_0x7769('0x4a'));if(_0x2e433d[_0x7769('0x4b')]===_0x7769('0x49')){var _0x33b12b=_0x5c2fee['get']({'plain':!![]});var _0x1bffdd='Templates';return db[_0x7769('0x4c')][_0x7769('0x4d')]({'where':{'name':_0x1bffdd,'userProfileId':_0x2e433d[_0x7769('0x4e')]},'raw':!![]})[_0x7769('0x20')](function(_0x5954fe){if(_0x5954fe&&_0x5954fe[_0x7769('0x4f')]===0x0){return db['UserProfileResource'][_0x7769('0x47')]({'name':_0x33b12b[_0x7769('0x25')],'resourceId':_0x33b12b['id'],'type':_0x5954fe[_0x7769('0x25')],'sectionId':_0x5954fe['id']},{})['then'](function(){return _0x5c2fee;});}else{return _0x5c2fee;}})[_0x7769('0x43')](function(_0x328d45){logger['error'](_0x7769('0x50'),_0x328d45);throw _0x328d45;});}return _0x5c2fee;})[_0x7769('0x20')](respondWithResult(_0x448425,0xc9))[_0x7769('0x43')](handleError(_0x448425,null));};exports[_0x7769('0x1f')]=function(_0x2c2eb1,_0x1800a1){if(_0x2c2eb1[_0x7769('0x48')]['id']){delete _0x2c2eb1[_0x7769('0x48')]['id'];}return db[_0x7769('0x28')][_0x7769('0x4d')]({'where':{'id':_0x2c2eb1[_0x7769('0x45')]['id']}})[_0x7769('0x20')](handleEntityNotFound(_0x1800a1,null))['then'](saveUpdates(_0x2c2eb1[_0x7769('0x48')],null))['then'](respondWithResult(_0x1800a1,null))[_0x7769('0x43')](handleError(_0x1800a1,null));};exports['destroy']=function(_0x346309,_0x3b596f){return db[_0x7769('0x28')]['find']({'where':{'id':_0x346309[_0x7769('0x45')]['id']}})[_0x7769('0x20')](handleEntityNotFound(_0x3b596f,null))[_0x7769('0x20')](removeEntity(_0x3b596f,null))[_0x7769('0x43')](handleError(_0x3b596f,null));};
\ No newline at end of file
diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js
index 13a1ae0..5a85914 100644
--- a/server/api/template/template.model.js
+++ b/server/api/template/template.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda3f=['../../config/environment','exports','Template','tools_templates','util','../../config/logger','request-promise','rimraf'];(function(_0x5c10ef,_0x39e0fd){var _0x1d2a7f=function(_0x343176){while(--_0x343176){_0x5c10ef['push'](_0x5c10ef['shift']());}};_0x1d2a7f(++_0x39e0fd);}(_0xda3f,0xec));var _0xfda3=function(_0x5e7729,_0x487970){_0x5e7729=_0x5e7729-0x0;var _0x30596b=_0xda3f[_0x5e7729];return _0x30596b;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfda3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var attributes=require('./template.attributes');module[_0xfda3('0x5')]=function(_0x43a010,_0x47e7e2){return _0x43a010['define'](_0xfda3('0x6'),attributes,{'tableName':_0xfda3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7708=['../../config/environment','exports','define','Template','tools_templates','lodash','util','api','rimraf'];(function(_0x4b8556,_0x3fc58d){var _0x32b2c1=function(_0x48635d){while(--_0x48635d){_0x4b8556['push'](_0x4b8556['shift']());}};_0x32b2c1(++_0x3fc58d);}(_0x7708,0x188));var _0x8770=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0x7708[_0x7ad6cb];return _0x22a0ba;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./template.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js
index eb929c6..075cca0 100644
--- a/server/api/template/template.rpc.js
+++ b/server/api/template/template.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec96=['../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetTemplate','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1c84b9,_0x57e875){var _0x57cb07=function(_0x1fcc8b){while(--_0x1fcc8b){_0x1c84b9['push'](_0x1c84b9['shift']());}};_0x57cb07(++_0x57e875);}(_0xec96,0x158));var _0x6ec9=function(_0x174a51,_0x529bdb){_0x174a51=_0x174a51-0x0;var _0xe7b380=_0xec96[_0x174a51];return _0xe7b380;};'use strict';var _=require(_0x6ec9('0x0'));var util=require(_0x6ec9('0x1'));var moment=require(_0x6ec9('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ec9('0x3'));var fs=require('fs');var Redis=require(_0x6ec9('0x4'));var db=require(_0x6ec9('0x5'))['db'];var utils=require(_0x6ec9('0x6'));var logger=require('../../config/logger')(_0x6ec9('0x7'));var config=require(_0x6ec9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6ec9('0x9')][_0x6ec9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36a411,_0x45c283,_0x4ed3f5){return new BPromise(function(_0x3a3675,_0x677534){return client[_0x6ec9('0xb')](_0x36a411,_0x4ed3f5)[_0x6ec9('0xc')](function(_0x251c2e){logger[_0x6ec9('0xd')](_0x6ec9('0xe'),_0x45c283,'request\x20sent');logger[_0x6ec9('0xf')](_0x6ec9('0x10'),_0x45c283,'request\x20sent',JSON[_0x6ec9('0x11')](_0x251c2e));if(_0x251c2e['error']){if(_0x251c2e[_0x6ec9('0x12')]['code']===0x1f4){logger[_0x6ec9('0x12')](_0x6ec9('0xe'),_0x45c283,_0x251c2e[_0x6ec9('0x12')][_0x6ec9('0x13')]);return _0x677534(_0x251c2e[_0x6ec9('0x12')][_0x6ec9('0x13')]);}logger[_0x6ec9('0x12')](_0x6ec9('0xe'),_0x45c283,_0x251c2e[_0x6ec9('0x12')][_0x6ec9('0x13')]);return _0x3a3675(_0x251c2e[_0x6ec9('0x12')]['message']);}else{logger[_0x6ec9('0xd')](_0x6ec9('0xe'),_0x45c283,_0x6ec9('0x14'));_0x3a3675(_0x251c2e[_0x6ec9('0x15')][_0x6ec9('0x13')]);}})[_0x6ec9('0x16')](function(_0x1fb008){logger[_0x6ec9('0x12')](_0x6ec9('0xe'),_0x45c283,_0x1fb008);_0x677534(_0x1fb008);});});}exports[_0x6ec9('0x17')]=function(_0x326696){var _0x4a312f=this;return new Promise(function(_0x2588c0,_0x4e89ef){return db['Template']['findAll']({'raw':_0x326696[_0x6ec9('0x18')]?_0x326696[_0x6ec9('0x18')][_0x6ec9('0x19')]===undefined?!![]:![]:!![],'where':_0x326696[_0x6ec9('0x18')]?_0x326696[_0x6ec9('0x18')][_0x6ec9('0x1a')]||null:null,'attributes':_0x326696[_0x6ec9('0x18')]?_0x326696['options'][_0x6ec9('0x1b')]||null:null,'limit':_0x326696[_0x6ec9('0x18')]?_0x326696[_0x6ec9('0x18')][_0x6ec9('0x1c')]||null:null,'include':_0x326696[_0x6ec9('0x18')]?_0x326696[_0x6ec9('0x18')][_0x6ec9('0x1d')]?_[_0x6ec9('0x1e')](_0x326696[_0x6ec9('0x18')]['include'],function(_0x398c17){return{'model':db[_0x398c17[_0x6ec9('0x1f')]],'as':_0x398c17['as'],'attributes':_0x398c17['attributes'],'include':_0x398c17[_0x6ec9('0x1d')]?_[_0x6ec9('0x1e')](_0x398c17['include'],function(_0x43a4d3){return{'model':db[_0x43a4d3['model']],'as':_0x43a4d3['as'],'attributes':_0x43a4d3[_0x6ec9('0x1b')],'include':_0x43a4d3[_0x6ec9('0x1d')]?_[_0x6ec9('0x1e')](_0x43a4d3[_0x6ec9('0x1d')],function(_0xd90bc9){return{'model':db[_0xd90bc9[_0x6ec9('0x1f')]],'as':_0xd90bc9['as'],'attributes':_0xd90bc9['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ec9('0xc')](function(_0x58b469){logger[_0x6ec9('0xd')]('GetTemplate',_0x326696);logger[_0x6ec9('0xf')](_0x6ec9('0x17'),_0x326696,JSON[_0x6ec9('0x11')](_0x58b469));_0x2588c0(_0x58b469);})['catch'](function(_0x4e9f86){logger['error'](_0x6ec9('0x17'),_0x4e9f86['message'],_0x326696);_0x4e89ef(_0x4a312f[_0x6ec9('0x12')](0x1f4,_0x4e9f86['message']));});});};
\ No newline at end of file
+var _0xea3c=['Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x58fdaa,_0x540caf){var _0x18de89=function(_0x4504ef){while(--_0x4504ef){_0x58fdaa['push'](_0x58fdaa['shift']());}};_0x18de89(++_0x540caf);}(_0xea3c,0x1ad));var _0xcea3=function(_0x1fe1cc,_0x3162f6){_0x1fe1cc=_0x1fe1cc-0x0;var _0x509e3e=_0xea3c[_0x1fe1cc];return _0x509e3e;};'use strict';var _=require(_0xcea3('0x0'));var util=require(_0xcea3('0x1'));var moment=require(_0xcea3('0x2'));var BPromise=require(_0xcea3('0x3'));var rs=require(_0xcea3('0x4'));var fs=require('fs');var Redis=require(_0xcea3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcea3('0x6'));var logger=require('../../config/logger')(_0xcea3('0x7'));var config=require(_0xcea3('0x8'));var jayson=require(_0xcea3('0x9'));var client=jayson['client'][_0xcea3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5597e9,_0xb94e0d,_0x5471c2){return new BPromise(function(_0x3d11d5,_0x283582){return client[_0xcea3('0xb')](_0x5597e9,_0x5471c2)['then'](function(_0x2b4d61){logger[_0xcea3('0xc')](_0xcea3('0xd'),_0xb94e0d,_0xcea3('0xe'));logger[_0xcea3('0xf')](_0xcea3('0x10'),_0xb94e0d,_0xcea3('0xe'),JSON[_0xcea3('0x11')](_0x2b4d61));if(_0x2b4d61[_0xcea3('0x12')]){if(_0x2b4d61[_0xcea3('0x12')][_0xcea3('0x13')]===0x1f4){logger['error'](_0xcea3('0xd'),_0xb94e0d,_0x2b4d61[_0xcea3('0x12')][_0xcea3('0x14')]);return _0x283582(_0x2b4d61[_0xcea3('0x12')][_0xcea3('0x14')]);}logger[_0xcea3('0x12')](_0xcea3('0xd'),_0xb94e0d,_0x2b4d61[_0xcea3('0x12')][_0xcea3('0x14')]);return _0x3d11d5(_0x2b4d61[_0xcea3('0x12')][_0xcea3('0x14')]);}else{logger[_0xcea3('0xc')](_0xcea3('0xd'),_0xb94e0d,_0xcea3('0xe'));_0x3d11d5(_0x2b4d61['result'][_0xcea3('0x14')]);}})[_0xcea3('0x15')](function(_0xdfee08){logger[_0xcea3('0x12')](_0xcea3('0xd'),_0xb94e0d,_0xdfee08);_0x283582(_0xdfee08);});});}exports[_0xcea3('0x16')]=function(_0x33734b){var _0x299ca8=this;return new Promise(function(_0x42854b,_0x2a2e67){return db[_0xcea3('0x17')][_0xcea3('0x18')]({'raw':_0x33734b['options']?_0x33734b[_0xcea3('0x19')][_0xcea3('0x1a')]===undefined?!![]:![]:!![],'where':_0x33734b[_0xcea3('0x19')]?_0x33734b[_0xcea3('0x19')][_0xcea3('0x1b')]||null:null,'attributes':_0x33734b['options']?_0x33734b['options'][_0xcea3('0x1c')]||null:null,'limit':_0x33734b[_0xcea3('0x19')]?_0x33734b['options'][_0xcea3('0x1d')]||null:null,'include':_0x33734b['options']?_0x33734b[_0xcea3('0x19')][_0xcea3('0x1e')]?_[_0xcea3('0x1f')](_0x33734b[_0xcea3('0x19')]['include'],function(_0x11a7c2){return{'model':db[_0x11a7c2[_0xcea3('0x20')]],'as':_0x11a7c2['as'],'attributes':_0x11a7c2[_0xcea3('0x1c')],'include':_0x11a7c2[_0xcea3('0x1e')]?_[_0xcea3('0x1f')](_0x11a7c2[_0xcea3('0x1e')],function(_0x1c9e70){return{'model':db[_0x1c9e70[_0xcea3('0x20')]],'as':_0x1c9e70['as'],'attributes':_0x1c9e70[_0xcea3('0x1c')],'include':_0x1c9e70[_0xcea3('0x1e')]?_[_0xcea3('0x1f')](_0x1c9e70[_0xcea3('0x1e')],function(_0x1d4688){return{'model':db[_0x1d4688[_0xcea3('0x20')]],'as':_0x1d4688['as'],'attributes':_0x1d4688[_0xcea3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcea3('0x21')](function(_0x2c069a){logger[_0xcea3('0xc')](_0xcea3('0x16'),_0x33734b);logger[_0xcea3('0xf')]('GetTemplate',_0x33734b,JSON[_0xcea3('0x11')](_0x2c069a));_0x42854b(_0x2c069a);})[_0xcea3('0x15')](function(_0x1242ce){logger[_0xcea3('0x12')]('GetTemplate',_0x1242ce['message'],_0x33734b);_0x2a2e67(_0x299ca8[_0xcea3('0x12')](0x1f4,_0x1242ce[_0xcea3('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js
index ca15c27..c6dd8c5 100644
--- a/server/api/trigger/index.js
+++ b/server/api/trigger/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x1650a1,_0x4d0f7a){var _0x4b71b6=function(_0x3af31a){while(--_0x3af31a){_0x1650a1['push'](_0x1650a1['shift']());}};_0x4b71b6(++_0x4d0f7a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x434042,_0x2ab85f){var _0x19043e=function(_0x2f486d){while(--_0x2f486d){_0x434042['push'](_0x434042['shift']());}};_0x19043e(++_0x2ab85f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js
index 959f8ef..f414cf8 100644
--- a/server/api/trigger/trigger.attributes.js
+++ b/server/api/trigger/trigger.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8e17=['STRING','BOOLEAN'];(function(_0x305549,_0xe40434){var _0x116f81=function(_0xbcdae){while(--_0xbcdae){_0x305549['push'](_0x305549['shift']());}};_0x116f81(++_0xe40434);}(_0x8e17,0x18a));var _0x78e1=function(_0x400f02,_0x5efbc6){_0x400f02=_0x400f02-0x0;var _0x5161c4=_0x8e17[_0x400f02];return _0x5161c4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x78e1('0x0')]},'channel':{'type':Sequelize[_0x78e1('0x0')]},'description':{'type':Sequelize[_0x78e1('0x0')]},'status':{'type':Sequelize[_0x78e1('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc547=['STRING'];(function(_0x432bd3,_0x173894){var _0x4586d1=function(_0x49fe54){while(--_0x49fe54){_0x432bd3['push'](_0x432bd3['shift']());}};_0x4586d1(++_0x173894);}(_0xc547,0x13f));var _0x7c54=function(_0x261bcb,_0x1a53eb){_0x261bcb=_0x261bcb-0x0;var _0x416bb8=_0xc547[_0x261bcb];return _0x416bb8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7c54('0x0')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7c54('0x0')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js
index daedd13..45433a6 100644
--- a/server/api/trigger/trigger.controller.js
+++ b/server/api/trigger/trigger.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','addAllCondition','Condition','TriggerAnyId','findOne','map','getAllConditions','hasOwnProperty','getAnyConditions','pick','addAction','TriggerId','getActions','Action','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Trigger','rows','catch','show','params'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Triggers';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Trigger'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Trigger']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Trigger'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Triggers';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){if(_0x439340[_0x0a9e('0x4b')]['id']){delete _0x439340['body']['id'];}return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){_0x439340[_0x0a9e('0x4b')]['TriggerAllId']=_0x5ce9ac['id'];return db[_0x0a9e('0x4d')]['create'](_0x439340['body']);}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));};exports['addAnyCondition']=function(_0x2f7092,_0x65432,_0x3cfd00){if(_0x2f7092[_0x0a9e('0x4b')]['id']){delete _0x2f7092[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0x2f7092[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x65432,null))[_0x0a9e('0x1f')](function(_0x121cef){if(_0x121cef){_0x2f7092[_0x0a9e('0x4b')][_0x0a9e('0x4e')]=_0x121cef['id'];return db[_0x0a9e('0x4d')][_0x0a9e('0x43')](_0x2f7092['body']);}})[_0x0a9e('0x1f')](respondWithResult(_0x65432,null))[_0x0a9e('0x3e')](handleError(_0x65432,null));};exports['getAllConditions']=function(_0x3649cc,_0x5cc8fb,_0x20c668){var _0x5ba1f9={};var _0x4b3c1a={};var _0x5674ee;var _0x273cb5;return db['Trigger'][_0x0a9e('0x4f')]({'where':{'id':_0x3649cc[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5cc8fb,null))[_0x0a9e('0x1f')](function(_0x1cca9f){if(_0x1cca9f){_0x5674ee=_0x1cca9f;_0x4b3c1a[_0x0a9e('0x28')]=_['keys'](db[_0x0a9e('0x4d')]['rawAttributes']);_0x4b3c1a[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x3649cc[_0x0a9e('0x2a')]);_0x4b3c1a['filters']=_[_0x0a9e('0x2c')](_0x4b3c1a[_0x0a9e('0x28')],_0x4b3c1a[_0x0a9e('0x2a')]);_0x5ba1f9[_0x0a9e('0x2d')]=_['intersection'](_0x4b3c1a[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x3649cc['query'][_0x0a9e('0x2e')]));_0x5ba1f9[_0x0a9e('0x2d')]=_0x5ba1f9[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x5ba1f9[_0x0a9e('0x2d')]:_0x4b3c1a['model'];_0x5ba1f9[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x3649cc[_0x0a9e('0x2a')]['sort']);_0x5ba1f9[_0x0a9e('0x33')]=qs['filters'](_['pick'](_0x3649cc[_0x0a9e('0x2a')],_0x4b3c1a[_0x0a9e('0x2b')]));if(_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x5ba1f9[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x5ba1f9[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x5ba1f9[_0x0a9e('0x2d')],function(_0x1cc4f3){var _0x2e89b7={};_0x2e89b7[_0x1cc4f3]={'$like':'%'+_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x2e89b7;})});}_0x5ba1f9=_[_0x0a9e('0x41')]({},_0x5ba1f9,_0x3649cc[_0x0a9e('0x39')]);return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})[_0x0a9e('0x1f')](function(_0x4257c9){if(_0x4257c9){_0x273cb5=_0x4257c9['length'];if(!_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x5ba1f9['limit']=qs[_0x0a9e('0x19')](_0x3649cc[_0x0a9e('0x2a')]['limit']);_0x5ba1f9[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})['then'](function(_0x50cdce){if(_0x50cdce){return _0x50cdce?{'count':_0x273cb5,'rows':_0x50cdce}:null;}})['then'](respondWithResult(_0x5cc8fb,null))[_0x0a9e('0x3e')](handleError(_0x5cc8fb,null));};exports[_0x0a9e('0x53')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x1104ad[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x1f')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db['Condition'][_0x0a9e('0x27')]);_0xeef20[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1104ad[_0x0a9e('0x2a')]);_0xeef20['filters']=_[_0x0a9e('0x2c')](_0xeef20[_0x0a9e('0x28')],_0xeef20[_0x0a9e('0x2a')]);_0x380ab3[_0x0a9e('0x2d')]=_['intersection'](_0xeef20[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x380ab3[_0x0a9e('0x2d')]:_0xeef20[_0x0a9e('0x28')];_0x380ab3[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x380ab3[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x1104ad[_0x0a9e('0x2a')],_0xeef20[_0x0a9e('0x2b')]));if(_0x1104ad[_0x0a9e('0x2a')]['filter']){_0x380ab3[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x380ab3[_0x0a9e('0x33')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x2d')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2a')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x39')]);return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x52')]('nolimit')){_0x380ab3[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x380ab3[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x1104ad[_0x0a9e('0x2a')]['offset']);}return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})[_0x0a9e('0x1f')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x55')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){if(_0xf0db1['body']['id']){delete _0xf0db1[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0xf0db1[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x4bf3a5,null))['then'](function(_0x353384){if(_0x353384){_0xf0db1[_0x0a9e('0x4b')][_0x0a9e('0x56')]=_0x353384['id'];return db['Action'][_0x0a9e('0x43')](_0xf0db1[_0x0a9e('0x4b')]);}})['then'](respondWithResult(_0x4bf3a5,null))['catch'](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x57')]=function(_0x56acca,_0x5ea541,_0x4dc6b3){var _0x81d748={};var _0xf3601c={};var _0x9044fe;var _0x3bfadf;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x56acca['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5ea541,null))['then'](function(_0x2871c1){if(_0x2871c1){_0x9044fe=_0x2871c1;_0xf3601c[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x58')]['rawAttributes']);_0xf3601c[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x56acca[_0x0a9e('0x2a')]);_0xf3601c['filters']=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],_0xf3601c[_0x0a9e('0x2a')]);_0x81d748[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x56acca[_0x0a9e('0x2a')]['fields']));_0x81d748[_0x0a9e('0x2d')]=_0x81d748[_0x0a9e('0x2d')]['length']?_0x81d748[_0x0a9e('0x2d')]:_0xf3601c[_0x0a9e('0x28')];_0x81d748[_0x0a9e('0x31')]=qs['sort'](_0x56acca[_0x0a9e('0x2a')]['sort']);_0x81d748[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x56acca[_0x0a9e('0x2a')],_0xf3601c[_0x0a9e('0x2b')]));if(_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x81d748[_0x0a9e('0x33')]=_['merge'](_0x81d748[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x81d748[_0x0a9e('0x2d')],function(_0x30ef6e){var _0x28e60a={};_0x28e60a[_0x30ef6e]={'$like':'%'+_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x28e60a;})});}_0x81d748=_[_0x0a9e('0x41')]({},_0x81d748,_0x56acca[_0x0a9e('0x39')]);return _0x9044fe[_0x0a9e('0x57')](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x3754e2){if(_0x3754e2){_0x3bfadf=_0x3754e2[_0x0a9e('0x2f')];if(!_0x56acca['query'][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x81d748[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x56acca[_0x0a9e('0x2a')]['limit']);_0x81d748[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x56acca['query'][_0x0a9e('0x18')]);}return _0x9044fe['getActions'](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x27041d){if(_0x27041d){return _0x27041d?{'count':_0x3bfadf,'rows':_0x27041d}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5ea541,null))[_0x0a9e('0x3e')](handleError(_0x5ea541,null));};
\ No newline at end of file
+var _0xa9e0=['merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','addAllCondition','Condition','TriggerAnyId','findOne','map','getAllConditions','hasOwnProperty','getAnyConditions','pick','addAction','TriggerId','getActions','Action','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Trigger','rows','catch','show','params'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Triggers';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Trigger'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Trigger']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Trigger'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Triggers';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){if(_0x439340[_0x0a9e('0x4b')]['id']){delete _0x439340['body']['id'];}return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){_0x439340[_0x0a9e('0x4b')]['TriggerAllId']=_0x5ce9ac['id'];return db[_0x0a9e('0x4d')]['create'](_0x439340['body']);}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));};exports['addAnyCondition']=function(_0x2f7092,_0x65432,_0x3cfd00){if(_0x2f7092[_0x0a9e('0x4b')]['id']){delete _0x2f7092[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0x2f7092[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x65432,null))[_0x0a9e('0x1f')](function(_0x121cef){if(_0x121cef){_0x2f7092[_0x0a9e('0x4b')][_0x0a9e('0x4e')]=_0x121cef['id'];return db[_0x0a9e('0x4d')][_0x0a9e('0x43')](_0x2f7092['body']);}})[_0x0a9e('0x1f')](respondWithResult(_0x65432,null))[_0x0a9e('0x3e')](handleError(_0x65432,null));};exports['getAllConditions']=function(_0x3649cc,_0x5cc8fb,_0x20c668){var _0x5ba1f9={};var _0x4b3c1a={};var _0x5674ee;var _0x273cb5;return db['Trigger'][_0x0a9e('0x4f')]({'where':{'id':_0x3649cc[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5cc8fb,null))[_0x0a9e('0x1f')](function(_0x1cca9f){if(_0x1cca9f){_0x5674ee=_0x1cca9f;_0x4b3c1a[_0x0a9e('0x28')]=_['keys'](db[_0x0a9e('0x4d')]['rawAttributes']);_0x4b3c1a[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x3649cc[_0x0a9e('0x2a')]);_0x4b3c1a['filters']=_[_0x0a9e('0x2c')](_0x4b3c1a[_0x0a9e('0x28')],_0x4b3c1a[_0x0a9e('0x2a')]);_0x5ba1f9[_0x0a9e('0x2d')]=_['intersection'](_0x4b3c1a[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x3649cc['query'][_0x0a9e('0x2e')]));_0x5ba1f9[_0x0a9e('0x2d')]=_0x5ba1f9[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x5ba1f9[_0x0a9e('0x2d')]:_0x4b3c1a['model'];_0x5ba1f9[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x3649cc[_0x0a9e('0x2a')]['sort']);_0x5ba1f9[_0x0a9e('0x33')]=qs['filters'](_['pick'](_0x3649cc[_0x0a9e('0x2a')],_0x4b3c1a[_0x0a9e('0x2b')]));if(_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x5ba1f9[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x5ba1f9[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x5ba1f9[_0x0a9e('0x2d')],function(_0x1cc4f3){var _0x2e89b7={};_0x2e89b7[_0x1cc4f3]={'$like':'%'+_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x2e89b7;})});}_0x5ba1f9=_[_0x0a9e('0x41')]({},_0x5ba1f9,_0x3649cc[_0x0a9e('0x39')]);return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})[_0x0a9e('0x1f')](function(_0x4257c9){if(_0x4257c9){_0x273cb5=_0x4257c9['length'];if(!_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x5ba1f9['limit']=qs[_0x0a9e('0x19')](_0x3649cc[_0x0a9e('0x2a')]['limit']);_0x5ba1f9[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})['then'](function(_0x50cdce){if(_0x50cdce){return _0x50cdce?{'count':_0x273cb5,'rows':_0x50cdce}:null;}})['then'](respondWithResult(_0x5cc8fb,null))[_0x0a9e('0x3e')](handleError(_0x5cc8fb,null));};exports[_0x0a9e('0x53')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x1104ad[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x1f')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db['Condition'][_0x0a9e('0x27')]);_0xeef20[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1104ad[_0x0a9e('0x2a')]);_0xeef20['filters']=_[_0x0a9e('0x2c')](_0xeef20[_0x0a9e('0x28')],_0xeef20[_0x0a9e('0x2a')]);_0x380ab3[_0x0a9e('0x2d')]=_['intersection'](_0xeef20[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x380ab3[_0x0a9e('0x2d')]:_0xeef20[_0x0a9e('0x28')];_0x380ab3[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x380ab3[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x1104ad[_0x0a9e('0x2a')],_0xeef20[_0x0a9e('0x2b')]));if(_0x1104ad[_0x0a9e('0x2a')]['filter']){_0x380ab3[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x380ab3[_0x0a9e('0x33')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x2d')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2a')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x39')]);return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x52')]('nolimit')){_0x380ab3[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x380ab3[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x1104ad[_0x0a9e('0x2a')]['offset']);}return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})[_0x0a9e('0x1f')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x55')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){if(_0xf0db1['body']['id']){delete _0xf0db1[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0xf0db1[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x4bf3a5,null))['then'](function(_0x353384){if(_0x353384){_0xf0db1[_0x0a9e('0x4b')][_0x0a9e('0x56')]=_0x353384['id'];return db['Action'][_0x0a9e('0x43')](_0xf0db1[_0x0a9e('0x4b')]);}})['then'](respondWithResult(_0x4bf3a5,null))['catch'](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x57')]=function(_0x56acca,_0x5ea541,_0x4dc6b3){var _0x81d748={};var _0xf3601c={};var _0x9044fe;var _0x3bfadf;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x56acca['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5ea541,null))['then'](function(_0x2871c1){if(_0x2871c1){_0x9044fe=_0x2871c1;_0xf3601c[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x58')]['rawAttributes']);_0xf3601c[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x56acca[_0x0a9e('0x2a')]);_0xf3601c['filters']=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],_0xf3601c[_0x0a9e('0x2a')]);_0x81d748[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x56acca[_0x0a9e('0x2a')]['fields']));_0x81d748[_0x0a9e('0x2d')]=_0x81d748[_0x0a9e('0x2d')]['length']?_0x81d748[_0x0a9e('0x2d')]:_0xf3601c[_0x0a9e('0x28')];_0x81d748[_0x0a9e('0x31')]=qs['sort'](_0x56acca[_0x0a9e('0x2a')]['sort']);_0x81d748[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x56acca[_0x0a9e('0x2a')],_0xf3601c[_0x0a9e('0x2b')]));if(_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x81d748[_0x0a9e('0x33')]=_['merge'](_0x81d748[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x81d748[_0x0a9e('0x2d')],function(_0x30ef6e){var _0x28e60a={};_0x28e60a[_0x30ef6e]={'$like':'%'+_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x28e60a;})});}_0x81d748=_[_0x0a9e('0x41')]({},_0x81d748,_0x56acca[_0x0a9e('0x39')]);return _0x9044fe[_0x0a9e('0x57')](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x3754e2){if(_0x3754e2){_0x3bfadf=_0x3754e2[_0x0a9e('0x2f')];if(!_0x56acca['query'][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x81d748[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x56acca[_0x0a9e('0x2a')]['limit']);_0x81d748[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x56acca['query'][_0x0a9e('0x18')]);}return _0x9044fe['getActions'](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x27041d){if(_0x27041d){return _0x27041d?{'count':_0x3bfadf,'rows':_0x27041d}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5ea541,null))[_0x0a9e('0x3e')](handleError(_0x5ea541,null));};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js
index c1f59fe..9f4ab4f 100644
--- a/server/api/trigger/trigger.model.js
+++ b/server/api/trigger/trigger.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4fc2=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./trigger.attributes','Trigger','tools_triggers','lodash','util'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0x4fc2,0x111));var _0x24fc=function(_0x3495e7,_0x2f6a1f){_0x3495e7=_0x3495e7-0x0;var _0x5cbb6f=_0x4fc2[_0x3495e7];return _0x5cbb6f;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','util'];(function(_0x256f90,_0x2187a6){var _0x415016=function(_0x43fcd6){while(--_0x43fcd6){_0x256f90['push'](_0x256f90['shift']());}};_0x415016(++_0x2187a6);}(_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 logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js
index 3800eb8..df34195 100644
--- a/server/api/trigger/trigger.rpc.js
+++ b/server/api/trigger/trigger.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x02f2=['info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','code','error','message','catch','GetTrigger','Trigger','findAll','options','where','attributes','limit','map','include','model','stringify','ShowTrigger','find','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x02f2,0xbb));var _0x202f=function(_0x296118,_0x20fd4f){_0x296118=_0x296118-0x0;var _0x49d5c0=_0x02f2[_0x296118];return _0x49d5c0;};'use strict';var _=require('lodash');var util=require(_0x202f('0x0'));var moment=require(_0x202f('0x1'));var BPromise=require(_0x202f('0x2'));var rs=require(_0x202f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x202f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x202f('0x5'));var config=require(_0x202f('0x6'));var jayson=require(_0x202f('0x7'));var client=jayson[_0x202f('0x8')][_0x202f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3db856,_0x56cad3,_0x45e26a){return new BPromise(function(_0x1b2476,_0xf026df){return client['request'](_0x3db856,_0x45e26a)[_0x202f('0xa')](function(_0x494204){logger[_0x202f('0xb')](_0x202f('0xc'),_0x56cad3,_0x202f('0xd'));logger[_0x202f('0xe')](_0x202f('0xf'),_0x56cad3,_0x202f('0xd'),JSON['stringify'](_0x494204));if(_0x494204['error']){if(_0x494204['error'][_0x202f('0x10')]===0x1f4){logger['error'](_0x202f('0xc'),_0x56cad3,_0x494204[_0x202f('0x11')]['message']);return _0xf026df(_0x494204[_0x202f('0x11')]['message']);}logger[_0x202f('0x11')](_0x202f('0xc'),_0x56cad3,_0x494204[_0x202f('0x11')][_0x202f('0x12')]);return _0x1b2476(_0x494204[_0x202f('0x11')][_0x202f('0x12')]);}else{logger[_0x202f('0xb')](_0x202f('0xc'),_0x56cad3,_0x202f('0xd'));_0x1b2476(_0x494204['result'][_0x202f('0x12')]);}})[_0x202f('0x13')](function(_0x1355b3){logger[_0x202f('0x11')](_0x202f('0xc'),_0x56cad3,_0x1355b3);_0xf026df(_0x1355b3);});});}exports[_0x202f('0x14')]=function(_0x1bac5d){var _0x325483=this;return new Promise(function(_0x5431e7,_0x38283b){return db[_0x202f('0x15')][_0x202f('0x16')]({'raw':_0x1bac5d[_0x202f('0x17')]?_0x1bac5d['options']['raw']===undefined?!![]:![]:!![],'where':_0x1bac5d['options']?_0x1bac5d[_0x202f('0x17')][_0x202f('0x18')]||null:null,'attributes':_0x1bac5d[_0x202f('0x17')]?_0x1bac5d[_0x202f('0x17')][_0x202f('0x19')]||null:null,'limit':_0x1bac5d[_0x202f('0x17')]?_0x1bac5d[_0x202f('0x17')][_0x202f('0x1a')]||null:null,'include':_0x1bac5d[_0x202f('0x17')]?_0x1bac5d['options']['include']?_[_0x202f('0x1b')](_0x1bac5d[_0x202f('0x17')][_0x202f('0x1c')],function(_0xa670f5){return{'model':db[_0xa670f5[_0x202f('0x1d')]],'as':_0xa670f5['as'],'attributes':_0xa670f5[_0x202f('0x19')],'include':_0xa670f5[_0x202f('0x1c')]?_[_0x202f('0x1b')](_0xa670f5[_0x202f('0x1c')],function(_0x3bc52e){return{'model':db[_0x3bc52e['model']],'as':_0x3bc52e['as'],'attributes':_0x3bc52e[_0x202f('0x19')],'include':_0x3bc52e['include']?_[_0x202f('0x1b')](_0x3bc52e[_0x202f('0x1c')],function(_0x12d011){return{'model':db[_0x12d011[_0x202f('0x1d')]],'as':_0x12d011['as'],'attributes':_0x12d011[_0x202f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x202f('0xa')](function(_0x207d71){logger[_0x202f('0xb')](_0x202f('0x14'),_0x1bac5d);logger[_0x202f('0xe')]('GetTrigger',_0x1bac5d,JSON[_0x202f('0x1e')](_0x207d71));_0x5431e7(_0x207d71);})[_0x202f('0x13')](function(_0x33d81a){logger[_0x202f('0x11')](_0x202f('0x14'),_0x33d81a[_0x202f('0x12')],_0x1bac5d);_0x38283b(_0x325483[_0x202f('0x11')](0x1f4,_0x33d81a[_0x202f('0x12')]));});});};exports[_0x202f('0x1f')]=function(_0x484180){var _0x62ef50=this;return new Promise(function(_0x4aad64,_0x32a22c){return db[_0x202f('0x15')][_0x202f('0x20')]({'raw':_0x484180[_0x202f('0x17')]?_0x484180[_0x202f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x484180[_0x202f('0x17')]?_0x484180[_0x202f('0x17')][_0x202f('0x18')]||null:null,'attributes':_0x484180[_0x202f('0x17')]?_0x484180['options'][_0x202f('0x19')]||null:null,'include':_0x484180['options']?_0x484180[_0x202f('0x17')][_0x202f('0x1c')]?_['map'](_0x484180[_0x202f('0x17')][_0x202f('0x1c')],function(_0xa31d5b){return{'model':db[_0xa31d5b['model']],'as':_0xa31d5b['as'],'attributes':_0xa31d5b[_0x202f('0x19')],'include':_0xa31d5b[_0x202f('0x1c')]?_['map'](_0xa31d5b[_0x202f('0x1c')],function(_0x11092a){return{'model':db[_0x11092a[_0x202f('0x1d')]],'as':_0x11092a['as'],'attributes':_0x11092a[_0x202f('0x19')],'include':_0x11092a[_0x202f('0x1c')]?_['map'](_0x11092a[_0x202f('0x1c')],function(_0x199d55){return{'model':db[_0x199d55[_0x202f('0x1d')]],'as':_0x199d55['as'],'attributes':_0x199d55['attributes']};}):[]};}):[]};}):[]:[]})[_0x202f('0xa')](function(_0x10c5a3){logger['info']('ShowTrigger',_0x484180);logger['debug'](_0x202f('0x1f'),_0x484180,JSON[_0x202f('0x1e')](_0x10c5a3));_0x4aad64(_0x10c5a3);})['catch'](function(_0x28160a){logger[_0x202f('0x11')]('ShowTrigger',_0x28160a[_0x202f('0x12')],_0x484180);_0x32a22c(_0x62ef50['error'](0x1f4,_0x28160a[_0x202f('0x12')]));});});};
\ No newline at end of file
+var _0xa28a=['GetTrigger','findAll','options','raw','include','map','model','attributes','stringify','catch','ShowTrigger','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','message','info','result'];(function(_0x52f495,_0x1b4f4b){var _0x4aa824=function(_0x4efae7){while(--_0x4efae7){_0x52f495['push'](_0x52f495['shift']());}};_0x4aa824(++_0x1b4f4b);}(_0xa28a,0x175));var _0xaa28=function(_0xe6a9e1,_0x2c2117){_0xe6a9e1=_0xe6a9e1-0x0;var _0x8cc109=_0xa28a[_0xe6a9e1];return _0x8cc109;};'use strict';var _=require(_0xaa28('0x0'));var util=require(_0xaa28('0x1'));var moment=require(_0xaa28('0x2'));var BPromise=require(_0xaa28('0x3'));var rs=require(_0xaa28('0x4'));var fs=require('fs');var Redis=require(_0xaa28('0x5'));var db=require(_0xaa28('0x6'))['db'];var utils=require(_0xaa28('0x7'));var logger=require(_0xaa28('0x8'))(_0xaa28('0x9'));var config=require(_0xaa28('0xa'));var jayson=require(_0xaa28('0xb'));var client=jayson[_0xaa28('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a8a25,_0x202ce6,_0x4fc541){return new BPromise(function(_0x3f61c7,_0x5c27fa){return client[_0xaa28('0xd')](_0x4a8a25,_0x4fc541)[_0xaa28('0xe')](function(_0x2003c3){logger['info'](_0xaa28('0xf'),_0x202ce6,_0xaa28('0x10'));logger[_0xaa28('0x11')](_0xaa28('0x12'),_0x202ce6,_0xaa28('0x10'),JSON['stringify'](_0x2003c3));if(_0x2003c3[_0xaa28('0x13')]){if(_0x2003c3[_0xaa28('0x13')]['code']===0x1f4){logger[_0xaa28('0x13')](_0xaa28('0xf'),_0x202ce6,_0x2003c3[_0xaa28('0x13')][_0xaa28('0x14')]);return _0x5c27fa(_0x2003c3['error'][_0xaa28('0x14')]);}logger[_0xaa28('0x13')](_0xaa28('0xf'),_0x202ce6,_0x2003c3[_0xaa28('0x13')]['message']);return _0x3f61c7(_0x2003c3[_0xaa28('0x13')]['message']);}else{logger[_0xaa28('0x15')]('Trigger,\x20%s,\x20%s',_0x202ce6,_0xaa28('0x10'));_0x3f61c7(_0x2003c3[_0xaa28('0x16')]['message']);}})['catch'](function(_0x4f7180){logger[_0xaa28('0x13')](_0xaa28('0xf'),_0x202ce6,_0x4f7180);_0x5c27fa(_0x4f7180);});});}exports[_0xaa28('0x17')]=function(_0x1b1398){var _0x3b554e=this;return new Promise(function(_0x4c9dd2,_0xeb229d){return db['Trigger'][_0xaa28('0x18')]({'raw':_0x1b1398[_0xaa28('0x19')]?_0x1b1398[_0xaa28('0x19')][_0xaa28('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b1398[_0xaa28('0x19')]?_0x1b1398[_0xaa28('0x19')]['where']||null:null,'attributes':_0x1b1398['options']?_0x1b1398[_0xaa28('0x19')]['attributes']||null:null,'limit':_0x1b1398['options']?_0x1b1398[_0xaa28('0x19')]['limit']||null:null,'include':_0x1b1398[_0xaa28('0x19')]?_0x1b1398[_0xaa28('0x19')][_0xaa28('0x1b')]?_[_0xaa28('0x1c')](_0x1b1398['options'][_0xaa28('0x1b')],function(_0xbaac60){return{'model':db[_0xbaac60[_0xaa28('0x1d')]],'as':_0xbaac60['as'],'attributes':_0xbaac60[_0xaa28('0x1e')],'include':_0xbaac60[_0xaa28('0x1b')]?_[_0xaa28('0x1c')](_0xbaac60[_0xaa28('0x1b')],function(_0x28dabc){return{'model':db[_0x28dabc[_0xaa28('0x1d')]],'as':_0x28dabc['as'],'attributes':_0x28dabc['attributes'],'include':_0x28dabc[_0xaa28('0x1b')]?_[_0xaa28('0x1c')](_0x28dabc['include'],function(_0x4ead6b){return{'model':db[_0x4ead6b[_0xaa28('0x1d')]],'as':_0x4ead6b['as'],'attributes':_0x4ead6b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bc872){logger[_0xaa28('0x15')](_0xaa28('0x17'),_0x1b1398);logger[_0xaa28('0x11')](_0xaa28('0x17'),_0x1b1398,JSON[_0xaa28('0x1f')](_0x5bc872));_0x4c9dd2(_0x5bc872);})[_0xaa28('0x20')](function(_0x1b8e77){logger[_0xaa28('0x13')](_0xaa28('0x17'),_0x1b8e77[_0xaa28('0x14')],_0x1b1398);_0xeb229d(_0x3b554e[_0xaa28('0x13')](0x1f4,_0x1b8e77[_0xaa28('0x14')]));});});};exports[_0xaa28('0x21')]=function(_0x2b070b){var _0x3ed965=this;return new Promise(function(_0x5ad4e5,_0x580687){return db['Trigger'][_0xaa28('0x22')]({'raw':_0x2b070b[_0xaa28('0x19')]?_0x2b070b[_0xaa28('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2b070b['options']?_0x2b070b[_0xaa28('0x19')][_0xaa28('0x23')]||null:null,'attributes':_0x2b070b[_0xaa28('0x19')]?_0x2b070b[_0xaa28('0x19')]['attributes']||null:null,'include':_0x2b070b[_0xaa28('0x19')]?_0x2b070b[_0xaa28('0x19')][_0xaa28('0x1b')]?_[_0xaa28('0x1c')](_0x2b070b[_0xaa28('0x19')][_0xaa28('0x1b')],function(_0xad1ee6){return{'model':db[_0xad1ee6[_0xaa28('0x1d')]],'as':_0xad1ee6['as'],'attributes':_0xad1ee6['attributes'],'include':_0xad1ee6[_0xaa28('0x1b')]?_['map'](_0xad1ee6['include'],function(_0x2381e1){return{'model':db[_0x2381e1[_0xaa28('0x1d')]],'as':_0x2381e1['as'],'attributes':_0x2381e1[_0xaa28('0x1e')],'include':_0x2381e1[_0xaa28('0x1b')]?_[_0xaa28('0x1c')](_0x2381e1[_0xaa28('0x1b')],function(_0x45a551){return{'model':db[_0x45a551['model']],'as':_0x45a551['as'],'attributes':_0x45a551['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa28('0xe')](function(_0x12cb81){logger[_0xaa28('0x15')](_0xaa28('0x21'),_0x2b070b);logger['debug'](_0xaa28('0x21'),_0x2b070b,JSON[_0xaa28('0x1f')](_0x12cb81));_0x5ad4e5(_0x12cb81);})[_0xaa28('0x20')](function(_0x423a27){logger['error']('ShowTrigger',_0x423a27[_0xaa28('0x14')],_0x2b070b);_0x580687(_0x3ed965[_0xaa28('0x13')](0x1f4,_0x423a27[_0xaa28('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js
index 871389d..f6ea542 100644
--- a/server/api/trunk/index.js
+++ b/server/api/trunk/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe79d=['delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','post','/:id/clone','clone','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe79d,0x192));var _0xde79=function(_0x3afe30,_0x12424d){_0x3afe30=_0x3afe30-0x0;var _0x43fcfd=_0xe79d[_0x3afe30];return _0x43fcfd;};'use strict';var multer=require(_0xde79('0x0'));var util=require(_0xde79('0x1'));var path=require('path');var timeout=require(_0xde79('0x2'));var express=require('express');var router=express[_0xde79('0x3')]();var auth=require(_0xde79('0x4'));var interaction=require(_0xde79('0x5'));var config=require(_0xde79('0x6'));var controller=require(_0xde79('0x7'));router['get']('/',auth[_0xde79('0x8')](),controller[_0xde79('0x9')]);router[_0xde79('0xa')](_0xde79('0xb'),auth['isAuthenticated'](),controller[_0xde79('0xc')]);router[_0xde79('0xd')](_0xde79('0xe'),auth[_0xde79('0x8')](),controller[_0xde79('0xf')]);router['post']('/',auth[_0xde79('0x8')](),controller[_0xde79('0x10')]);router[_0xde79('0x11')](_0xde79('0xb'),auth[_0xde79('0x8')](),controller['update']);router[_0xde79('0x12')]('/:id',auth[_0xde79('0x8')](),controller[_0xde79('0x13')]);module[_0xde79('0x14')]=router;
\ No newline at end of file
+var _0x3ee7=['exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','clone','create','put','delete','destroy'];(function(_0x1047c4,_0xf5df8a){var _0x2e6eb1=function(_0x4d924a){while(--_0x4d924a){_0x1047c4['push'](_0x1047c4['shift']());}};_0x2e6eb1(++_0xf5df8a);}(_0x3ee7,0xd2));var _0x73ee=function(_0x3fb539,_0x386423){_0x3fb539=_0x3fb539-0x0;var _0x3ebf14=_0x3ee7[_0x3fb539];return _0x3ebf14;};'use strict';var multer=require(_0x73ee('0x0'));var util=require(_0x73ee('0x1'));var path=require(_0x73ee('0x2'));var timeout=require('connect-timeout');var express=require(_0x73ee('0x3'));var router=express['Router']();var auth=require(_0x73ee('0x4'));var interaction=require(_0x73ee('0x5'));var config=require(_0x73ee('0x6'));var controller=require('./trunk.controller');router[_0x73ee('0x7')]('/',auth[_0x73ee('0x8')](),controller[_0x73ee('0x9')]);router[_0x73ee('0x7')](_0x73ee('0xa'),auth['isAuthenticated'](),controller[_0x73ee('0xb')]);router[_0x73ee('0xc')]('/:id/clone',auth[_0x73ee('0x8')](),controller[_0x73ee('0xd')]);router[_0x73ee('0xc')]('/',auth[_0x73ee('0x8')](),controller[_0x73ee('0xe')]);router[_0x73ee('0xf')](_0x73ee('0xa'),auth[_0x73ee('0x8')](),controller['update']);router[_0x73ee('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x73ee('0x11')]);module[_0x73ee('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js
index 24f8da1..4a76d00 100644
--- a/server/api/trunk/trunk.attributes.js
+++ b/server/api/trunk/trunk.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','originate','uac','uas','pai','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','friend','user','peer','STRING','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','inband','auto','yes','nonat'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0d8b('0x2'),_0x0d8b('0x3'),_0x0d8b('0x4')),'allowNull':![],'defaultValue':_0x0d8b('0x2')},'context':{'type':Sequelize[_0x0d8b('0x5')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x0d8b('0x6'),_0x0d8b('0x7'),_0x0d8b('0x8'),'ALLOWED',_0x0d8b('0x9'),_0x0d8b('0xa'),'PROHIB_FAILED_SCREEN',_0x0d8b('0xb'))},'deny':{'type':Sequelize[_0x0d8b('0x5')]},'permit':{'type':Sequelize[_0x0d8b('0x5')]},'secret':{'type':Sequelize[_0x0d8b('0x5')]},'md5secret':{'type':Sequelize[_0x0d8b('0x5')]},'remotesecret':{'type':Sequelize[_0x0d8b('0x5')]},'transport':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':_0x0d8b('0xc'),'set':function(_0x48fa16){this[_0x0d8b('0xd')]('transport',_0x48fa16?_0x48fa16[_0x0d8b('0xe')](','):null);},'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x10'))?this[_0x0d8b('0xf')](_0x0d8b('0x10'))[_0x0d8b('0x11')](','):null;},'comment':_0x0d8b('0x12')},'dtmfmode':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x15'),_0x0d8b('0x16'),_0x0d8b('0x17'),_0x0d8b('0x18')),'defaultValue':_0x0d8b('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no',_0x0d8b('0x1a'),_0x0d8b('0x1b'),_0x0d8b('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0d8b('0x13')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0d8b('0x5')]},'directmediadeny':{'type':Sequelize[_0x0d8b('0x5')]},'nat':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':_0x0d8b('0x1d'),'set':function(_0x333674){this[_0x0d8b('0xd')](_0x0d8b('0x1e'),_0x333674?_0x333674[_0x0d8b('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x0d8b('0x1e'))?this[_0x0d8b('0xf')](_0x0d8b('0x1e'))[_0x0d8b('0x11')](','):null;},'comment':_0x0d8b('0x1f')},'callgroup':{'type':Sequelize[_0x0d8b('0x5')]},'namedcallgroup':{'type':Sequelize[_0x0d8b('0x5')]},'pickupgroup':{'type':Sequelize[_0x0d8b('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0d8b('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0d8b('0x20'),'set':function(_0x2b924f){this[_0x0d8b('0xd')](_0x0d8b('0x21'),_0x2b924f?_0x2b924f[_0x0d8b('0xe')](';'):_0x0d8b('0x20'));},'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x21'))?this[_0x0d8b('0xf')]('allow')[_0x0d8b('0x11')](';'):null;},'comment':_0x0d8b('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0x23'),'set':function(_0x234bdd){this[_0x0d8b('0xd')]('insecure',_0x234bdd?_0x234bdd['join'](','):null);},'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x24'))?this['getDataValue'](_0x0d8b('0x24'))['split'](','):null;},'comment':_0x0d8b('0x25')},'trustrpid':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no','never')},'promiscredir':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x0d8b('0x13')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x0d8b('0x5')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x0d8b('0x19')},'busylevel':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x0d8b('0x5')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no',_0x0d8b('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'mailbox':{'type':Sequelize[_0x0d8b('0x5')]},'session_timers':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x28'),'refuse',_0x0d8b('0x29'))},'session_expires':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x2a'),_0x0d8b('0x2b')),'defaultValue':_0x0d8b('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x0d8b('0x5')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x0d8b('0x5')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no'),'defaultValue':_0x0d8b('0x19')},'keepalive':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x0d8b('0x5')]},'defaultuser':{'type':Sequelize[_0x0d8b('0x5')]},'rtptimeout':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no',_0x0d8b('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0d8b('0x5')]},'callbackextension':{'type':Sequelize[_0x0d8b('0x5')]},'timert1':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x0d8b('0x5')]},'contactdeny':{'type':Sequelize[_0x0d8b('0x5')]},'contactacl':{'type':Sequelize[_0x0d8b('0x5')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x0d8b('0x5')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'force_avp':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'icesupport':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x0d8b('0x5')]},'dtlsprivatekey':{'type':Sequelize[_0x0d8b('0x5')]},'dtlscipher':{'type':Sequelize[_0x0d8b('0x5')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x2d'),_0x0d8b('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0d8b('0x5')]},'usereqphone':{'type':Sequelize[_0x0d8b('0x13')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x0d8b('0x5')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0d8b('0x13')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no')},'vmexten':{'type':Sequelize[_0x0d8b('0x5')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':_0x0d8b('0x2f')},'canreinvite':{'type':Sequelize[_0x0d8b('0x13')]('yes','no',_0x0d8b('0x1a'),_0x0d8b('0x1b'),_0x0d8b('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0d8b('0x5')]},'otherFields':{'type':Sequelize[_0x0d8b('0x5')]},'active':{'type':Sequelize[_0x0d8b('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':'no'}};
\ No newline at end of file
+var _0x2032=['all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','exports','STRING','name','friend','user','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','getDataValue','rfc2833','inband','auto','yes','nonat','update','outgoing','setDataValue','join','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x43e0e1,_0xedfdaf){var _0x2ec9f0=function(_0x4069dd){while(--_0x4069dd){_0x43e0e1['push'](_0x43e0e1['shift']());}};_0x2ec9f0(++_0xedfdaf);}(_0x2032,0xd9));var _0x2203=function(_0x434493,_0x42fe6d){_0x434493=_0x434493-0x0;var _0x2e8dbb=_0x2032[_0x434493];return _0x2e8dbb;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x2203('0x3'),_0x2203('0x4'),'peer'),'allowNull':![],'defaultValue':_0x2203('0x3')},'context':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'defaultValue':_0x2203('0x5')},'callingpres':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x7'),_0x2203('0x8'),_0x2203('0x9'),_0x2203('0xa'),_0x2203('0xb'),_0x2203('0xc'),_0x2203('0xd'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x2203('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x2203('0x1')]},'remotesecret':{'type':Sequelize[_0x2203('0x1')]},'transport':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'udp','set':function(_0x849049){this['setDataValue'](_0x2203('0xe'),_0x849049?_0x849049['join'](','):null);},'get':function(){return this[_0x2203('0xf')](_0x2203('0xe'))?this['getDataValue']('transport')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x2203('0x10'),'info','shortinfo',_0x2203('0x11'),_0x2203('0x12')),'defaultValue':_0x2203('0x10')},'directmedia':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no',_0x2203('0x14'),_0x2203('0x15'),_0x2203('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x2203('0x1')]},'nat':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x3f9ef6){this[_0x2203('0x17')]('nat',_0x3f9ef6?_0x3f9ef6[_0x2203('0x18')](','):null);},'get':function(){return this['getDataValue'](_0x2203('0x19'))?this[_0x2203('0xf')](_0x2203('0x19'))[_0x2203('0x1a')](','):null;},'comment':_0x2203('0x1b')},'callgroup':{'type':Sequelize[_0x2203('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x2203('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2203('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x1c')},'allow':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3ee25b){this['setDataValue']('allow',_0x3ee25b?_0x3ee25b[_0x2203('0x18')](';'):_0x2203('0x1d'));},'get':function(){return this[_0x2203('0xf')](_0x2203('0x1e'))?this[_0x2203('0xf')](_0x2203('0x1e'))[_0x2203('0x1a')](';'):null;},'comment':_0x2203('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'insecure':{'type':Sequelize[_0x2203('0x1')],'defaultValue':_0x2203('0x20'),'set':function(_0x5f11bf){this[_0x2203('0x17')](_0x2203('0x21'),_0x5f11bf?_0x5f11bf['join'](','):null);},'get':function(){return this[_0x2203('0xf')](_0x2203('0x21'))?this[_0x2203('0xf')](_0x2203('0x21'))[_0x2203('0x1a')](','):null;},'comment':_0x2203('0x22')},'trustrpid':{'type':Sequelize[_0x2203('0x6')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no','never')},'promiscredir':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'useclientcode':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x2203('0x1')]},'callerid':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x2203('0x6')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x2203('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'allowsubscribe':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x2203('0x1')]},'template':{'type':Sequelize[_0x2203('0x1')]},'videosupport':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no',_0x2203('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2203('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'mailbox':{'type':Sequelize[_0x2203('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x2203('0x25'),_0x2203('0x26'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x2203('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x2203('0x27'),_0x2203('0x28')),'defaultValue':_0x2203('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x2203('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x2203('0x23')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2203('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x2203('0x1')]},'defaultuser':{'type':Sequelize[_0x2203('0x1')]},'rtptimeout':{'type':Sequelize[_0x2203('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2203('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x2203('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2203('0x1')]},'callbackextension':{'type':Sequelize[_0x2203('0x1')]},'timert1':{'type':Sequelize[_0x2203('0x23')](0xb)},'timerb':{'type':Sequelize[_0x2203('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2203('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x2203('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x2203('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x2203('0x1')]},'use_q850_reason':{'type':Sequelize[_0x2203('0x1')]},'maxforwards':{'type':Sequelize[_0x2203('0x23')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'force_avp':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no')},'icesupport':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x13'),'no',_0x2203('0x2a'),_0x2203('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x2203('0x23')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x2203('0x1')]},'dtlscipher':{'type':Sequelize[_0x2203('0x1')]},'dtlscafile':{'type':Sequelize[_0x2203('0x1')]},'dtlscapath':{'type':Sequelize[_0x2203('0x1')]},'dtlssetup':{'type':Sequelize[_0x2203('0x6')](_0x2203('0x2c'),_0x2203('0x2d'),_0x2203('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2203('0x1')]},'usereqphone':{'type':Sequelize[_0x2203('0x6')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2203('0x1')]},'recordofffeature':{'type':Sequelize[_0x2203('0x1')]},'call_limit':{'type':Sequelize[_0x2203('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2203('0x6')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x2203('0x13'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x2203('0x1')]},'mohsuggest':{'type':Sequelize[_0x2203('0x1')]},'parkinglot':{'type':Sequelize[_0x2203('0x1')]},'description':{'type':Sequelize[_0x2203('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x2f')},'canreinvite':{'type':Sequelize[_0x2203('0x6')]('yes','no',_0x2203('0x14'),_0x2203('0x15'),_0x2203('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2203('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'no'}};
\ No newline at end of file
diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js
index c3a5490..04fc1d6 100644
--- a/server/api/trunk/trunk.controller.js
+++ b/server/api/trunk/trunk.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef7b=['find','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','chan_sip.so','userProfileId','utf8','readFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','Trunk,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','Trunks','stack','name','send','Trunk','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','includeAll','include','rows','catch','params','rawAttributes'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0xef7b,0x87));var _0xbef7=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0xef7b[_0x30cc1a];return _0xb3f18f;};'use strict';var pdf=require(_0xbef7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbef7('0x1'));var zipdir=require(_0xbef7('0x2'));var jsonpatch=require(_0xbef7('0x3'));var rp=require(_0xbef7('0x4'));var moment=require(_0xbef7('0x5'));var BPromise=require(_0xbef7('0x6'));var Mustache=require(_0xbef7('0x7'));var util=require('util');var path=require(_0xbef7('0x8'));var sox=require('sox');var csv=require(_0xbef7('0x9'));var ejs=require(_0xbef7('0xa'));var fs=require('fs');var _=require(_0xbef7('0xb'));var squel=require(_0xbef7('0xc'));var crypto=require(_0xbef7('0xd'));var jsforce=require(_0xbef7('0xe'));var deskjs=require(_0xbef7('0xf'));var toCsv=require(_0xbef7('0x9'));var querystring=require(_0xbef7('0x10'));var Papa=require('papaparse');var Redis=require(_0xbef7('0x11'));var authService=require(_0xbef7('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbef7('0x13'));var utils=require(_0xbef7('0x14'));var config=require(_0xbef7('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xbef7('0x16'));var client=jayson['client'][_0xbef7('0x17')]({'port':0x232a});function checkPasswordPattern(_0x4751af,_0x16cca8,_0x4c4a75){if(_0x4c4a75){var _0x9d7f07=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9d7f07['test'](_0x16cca8)){return _0x4751af;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4751af;}}function respondWithRpcPromise(_0x2a2b8d,_0x587af2,_0x556bf8,_0x1b4926){return new BPromise(function(_0xa60e2e,_0x2cbe6e){var _0x3d3c26=_0x1b4926||client;return _0x3d3c26[_0xbef7('0x18')](_0x2a2b8d,_0x556bf8)[_0xbef7('0x19')](function(_0x544b88){logger[_0xbef7('0x1a')]('Trunk,\x20%s,\x20%s',_0x587af2,_0xbef7('0x1b'));logger[_0xbef7('0x1c')](_0xbef7('0x1d'),_0x587af2,_0xbef7('0x1b'),JSON['stringify'](_0x544b88));if(_0x544b88[_0xbef7('0x1e')]){if(_0x544b88[_0xbef7('0x1e')][_0xbef7('0x1f')]===0x1f4){logger[_0xbef7('0x1e')](_0xbef7('0x20'),_0x587af2,_0x544b88['error'][_0xbef7('0x21')]);return _0x2cbe6e(_0x544b88[_0xbef7('0x1e')][_0xbef7('0x21')]);}logger['error'](_0xbef7('0x20'),_0x587af2,_0x544b88[_0xbef7('0x1e')][_0xbef7('0x21')]);return _0xa60e2e(_0x544b88[_0xbef7('0x1e')][_0xbef7('0x21')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x587af2,_0xbef7('0x1b'));_0xa60e2e(_0x544b88[_0xbef7('0x22')][_0xbef7('0x21')]);}})['catch'](function(_0x233020){logger[_0xbef7('0x1e')]('Trunk,\x20%s,\x20%s',_0x587af2,_0x233020);_0x2cbe6e(_0x233020);});});}function respondWithStatusCode(_0x4ca6d9,_0x2b837f){_0x2b837f=_0x2b837f||0xcc;return function(_0xc95ec6){if(_0xc95ec6){return _0x4ca6d9[_0xbef7('0x23')](_0x2b837f);}return _0x4ca6d9[_0xbef7('0x24')](_0x2b837f)[_0xbef7('0x25')]();};}function respondWithResult(_0x33918d,_0x4be6e4){_0x4be6e4=_0x4be6e4||0xc8;return function(_0xfcb9f2){if(_0xfcb9f2){return _0x33918d[_0xbef7('0x24')](_0x4be6e4)[_0xbef7('0x26')](_0xfcb9f2);}};}function respondWithFilteredResult(_0x37a821,_0x5ef8d2){return function(_0xd3f9a9){if(_0xd3f9a9){var _0x3ba3f8=_0xd3f9a9[_0xbef7('0x27')],_0xa63c84=_0x5ef8d2[_0xbef7('0x28')],_0x2e8f72=_0x5ef8d2[_0xbef7('0x28')]+_0x5ef8d2[_0xbef7('0x29')],_0x50466f;if(_0x2e8f72>=_0x3ba3f8){_0x2e8f72=_0x3ba3f8;_0x50466f=0xc8;}else{_0x50466f=0xce;}_0x37a821[_0xbef7('0x24')](_0x50466f);return _0x37a821[_0xbef7('0x2a')](_0xbef7('0x2b'),_0xa63c84+'-'+_0x2e8f72+'/'+_0x3ba3f8)[_0xbef7('0x26')](_0xd3f9a9);}return null;};}function patchUpdates(_0x259c78){return function(_0x1ec98d){try{jsonpatch[_0xbef7('0x2c')](_0x1ec98d,_0x259c78,!![]);}catch(_0x751860){return BPromise[_0xbef7('0x2d')](_0x751860);}return _0x1ec98d[_0xbef7('0x2e')]();};}function saveUpdates(_0x27c1db,_0x4454be){return function(_0x290a66){if(_0x290a66){return _0x290a66[_0xbef7('0x2f')](_0x27c1db)[_0xbef7('0x19')](function(_0x60d852){return _0x60d852;});}return null;};}function removeEntity(_0x2d6cc1,_0x37e6c7){return function(_0x5cde96){if(_0x5cde96){return _0x5cde96[_0xbef7('0x30')]()['then'](function(){var _0x21ad3c=_0x5cde96[_0xbef7('0x31')]({'plain':!![]});var _0x53237c=_0xbef7('0x32');return db['UserProfileResource'][_0xbef7('0x30')]({'where':{'type':_0x53237c,'resourceId':_0x21ad3c['id']}})[_0xbef7('0x19')](function(){return _0x5cde96;});})['then'](function(){_0x2d6cc1[_0xbef7('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x446270,_0xb04d6a){return function(_0x52d955){if(!_0x52d955){_0x446270[_0xbef7('0x23')](0x194);}return _0x52d955;};}function handleError(_0xb4c0e4,_0x4d9d30){_0x4d9d30=_0x4d9d30||0x1f4;return function(_0x8ab067){logger[_0xbef7('0x1e')](_0x8ab067[_0xbef7('0x33')]);if(_0x8ab067[_0xbef7('0x34')]){delete _0x8ab067['name'];}_0xb4c0e4[_0xbef7('0x24')](_0x4d9d30)[_0xbef7('0x35')](_0x8ab067);};}exports['index']=function(_0x15de0f,_0x3b0f7d){var _0xc856e3={},_0x59ce7a={},_0x212e58={'count':0x0,'rows':[]};var _0x280f92=db[_0xbef7('0x36')]['rawAttributes'];_0x59ce7a[_0xbef7('0x37')]=_[_0xbef7('0x38')](_0x280f92);_0x59ce7a[_0xbef7('0x39')]=_[_0xbef7('0x38')](_0x15de0f[_0xbef7('0x39')]);_0x59ce7a[_0xbef7('0x3a')]=_[_0xbef7('0x3b')](_0x59ce7a[_0xbef7('0x37')],_0x59ce7a[_0xbef7('0x39')]);_0xc856e3['attributes']=_[_0xbef7('0x3b')](_0x59ce7a[_0xbef7('0x37')],qs[_0xbef7('0x3c')](_0x15de0f['query'][_0xbef7('0x3c')]));_0xc856e3[_0xbef7('0x3d')]=_0xc856e3[_0xbef7('0x3d')][_0xbef7('0x3e')]?_0xc856e3[_0xbef7('0x3d')]:_0x59ce7a['model'];if(!_0x15de0f['query'][_0xbef7('0x3f')](_0xbef7('0x40'))){_0xc856e3[_0xbef7('0x29')]=qs['limit'](_0x15de0f['query']['limit']);_0xc856e3[_0xbef7('0x28')]=qs[_0xbef7('0x28')](_0x15de0f['query'][_0xbef7('0x28')]);}_0xc856e3[_0xbef7('0x41')]=qs[_0xbef7('0x42')](_0x15de0f[_0xbef7('0x39')][_0xbef7('0x42')]);_0xc856e3[_0xbef7('0x43')]=qs[_0xbef7('0x3a')](_[_0xbef7('0x44')](_0x15de0f[_0xbef7('0x39')],_0x59ce7a[_0xbef7('0x3a')]));if(_0x15de0f[_0xbef7('0x39')][_0xbef7('0x45')]){_0xc856e3[_0xbef7('0x43')]=_[_0xbef7('0x46')](_0xc856e3[_0xbef7('0x43')],{'$or':_[_0xbef7('0x47')](_0x280f92,function(_0x1544d5){if(_0x1544d5['type']['key']!==_0xbef7('0x48')){var _0x44232b={};_0x44232b[_0x1544d5[_0xbef7('0x49')]]={'$like':'%'+_0x15de0f['query'][_0xbef7('0x45')]+'%'};return _0x44232b;}})});}_0xc856e3=_[_0xbef7('0x46')]({},_0xc856e3,_0x15de0f[_0xbef7('0x4a')]);var _0x140f21={'where':_0xc856e3[_0xbef7('0x43')]};return db[_0xbef7('0x36')][_0xbef7('0x27')](_0x140f21)[_0xbef7('0x19')](function(_0x351e65){_0x212e58[_0xbef7('0x27')]=_0x351e65;if(_0x15de0f[_0xbef7('0x39')][_0xbef7('0x4b')]){_0xc856e3[_0xbef7('0x4c')]=[{'all':!![]}];}return db[_0xbef7('0x36')]['findAll'](_0xc856e3);})[_0xbef7('0x19')](function(_0x58cce2){_0x212e58[_0xbef7('0x4d')]=_0x58cce2;return _0x212e58;})[_0xbef7('0x19')](respondWithFilteredResult(_0x3b0f7d,_0xc856e3))[_0xbef7('0x4e')](handleError(_0x3b0f7d,null));};exports['show']=function(_0x59bcd5,_0x5dc6ce){var _0x3f0c6d={'raw':![],'where':{'id':_0x59bcd5[_0xbef7('0x4f')]['id']}},_0x3f51f4={};_0x3f51f4[_0xbef7('0x37')]=_[_0xbef7('0x38')](db[_0xbef7('0x36')][_0xbef7('0x50')]);_0x3f51f4[_0xbef7('0x39')]=_['keys'](_0x59bcd5[_0xbef7('0x39')]);_0x3f51f4['filters']=_[_0xbef7('0x3b')](_0x3f51f4[_0xbef7('0x37')],_0x3f51f4[_0xbef7('0x39')]);_0x3f0c6d[_0xbef7('0x3d')]=_[_0xbef7('0x3b')](_0x3f51f4[_0xbef7('0x37')],qs[_0xbef7('0x3c')](_0x59bcd5[_0xbef7('0x39')][_0xbef7('0x3c')]));_0x3f0c6d[_0xbef7('0x3d')]=_0x3f0c6d['attributes'][_0xbef7('0x3e')]?_0x3f0c6d[_0xbef7('0x3d')]:_0x3f51f4['model'];if(_0x59bcd5[_0xbef7('0x39')]['includeAll']){_0x3f0c6d['include']=[{'all':!![]}];}_0x3f0c6d=_[_0xbef7('0x46')]({},_0x3f0c6d,_0x59bcd5[_0xbef7('0x4a')]);return db[_0xbef7('0x36')][_0xbef7('0x51')](_0x3f0c6d)[_0xbef7('0x19')](handleEntityNotFound(_0x5dc6ce,null))['then'](respondWithResult(_0x5dc6ce,null))[_0xbef7('0x4e')](handleError(_0x5dc6ce,null));};exports['clone']=function(_0x3e0c03,_0x2f1a59){var _0x55971e={'raw':![],'where':{'id':_0x3e0c03['params']['id']}},_0xe2431={};_0xe2431[_0xbef7('0x37')]=_['keys'](db['Trunk'][_0xbef7('0x50')]);_0x55971e[_0xbef7('0x3d')]=_[_0xbef7('0x3b')](_0xe2431[_0xbef7('0x37')],qs[_0xbef7('0x3c')](_0x3e0c03[_0xbef7('0x39')][_0xbef7('0x3c')]));_0x55971e['attributes']=_0x55971e[_0xbef7('0x3d')]['length']?_0x55971e['attributes']:_0xe2431['model'];if(_0x3e0c03['query'][_0xbef7('0x4b')]){_0x55971e[_0xbef7('0x4c')]=[{'all':!![]}];}_0x55971e=_['merge']({},_0x55971e,_0x3e0c03[_0xbef7('0x4a')]);return db[_0xbef7('0x36')]['find'](_0x55971e)[_0xbef7('0x19')](handleEntityNotFound(_0x2f1a59,null))[_0xbef7('0x19')](function(_0xc01a6b){if(_0xc01a6b){var _0x170ef0=_0xc01a6b['get']({'plain':!![]});_0x170ef0=qs['omit'](_0x170ef0,['id',_0xbef7('0x52'),_0xbef7('0x53')]);_0x3e0c03[_0xbef7('0x54')]=_[_0xbef7('0x55')](_0x3e0c03[_0xbef7('0x54')],['id','createdAt','updatedAt']);return db['Trunk'][_0xbef7('0x56')](_[_0xbef7('0x46')](_0x170ef0,_0x3e0c03[_0xbef7('0x54')]),{'include':_0x3e0c03[_0xbef7('0x39')][_0xbef7('0x4b')]?[{'all':!![]}]:undefined})[_0xbef7('0x19')](function(_0x22efe4){var _0x5a6d1a=_0x3e0c03[_0xbef7('0x57')][_0xbef7('0x31')]({'plain':!![]});if(!_0x5a6d1a)throw new Error(_0xbef7('0x58'));if(_0x5a6d1a[_0xbef7('0x59')]===_0xbef7('0x57')){var _0x41a7e9=_0x22efe4['get']({'plain':!![]});var _0xe9c9c8=_0xbef7('0x32');return db[_0xbef7('0x5a')][_0xbef7('0x51')]({'where':{'name':_0xe9c9c8,'userProfileId':_0x5a6d1a['userProfileId']},'raw':!![]})[_0xbef7('0x19')](function(_0x366ef1){if(_0x366ef1&&_0x366ef1[_0xbef7('0x5b')]===0x0){return db[_0xbef7('0x5c')][_0xbef7('0x56')]({'name':_0x41a7e9['name'],'resourceId':_0x41a7e9['id'],'type':_0x366ef1['name'],'sectionId':_0x366ef1['id']},{})[_0xbef7('0x19')](function(){return _0x22efe4;});}else{return _0x22efe4;}})[_0xbef7('0x4e')](function(_0x25007f){logger[_0xbef7('0x1e')](_0xbef7('0x5d'),_0x25007f);throw _0x25007f;});}return _0x22efe4;});}})[_0xbef7('0x19')](respondWithResult(_0x2f1a59,0xc9))['catch'](handleError(_0x2f1a59,null));};exports['create']=function(_0x551526,_0x32fdf9,_0xfe4a93){var _0x3b8b30;return db[_0xbef7('0x36')][_0xbef7('0x56')](_0x551526[_0xbef7('0x54')],{'raw':!![]})['then'](function(_0x5b8f75){_0x3b8b30=_0x5b8f75;return db[_0xbef7('0x36')]['findAll']({'raw':!![]});})[_0xbef7('0x19')](function(_0x54a2e3){var _0x530022=fs['readFileSync'](path['join'](config[_0xbef7('0x5e')],_0xbef7('0x5f')),'utf8');var _0x56a9ae=fs['readFileSync'](path[_0xbef7('0x60')](config[_0xbef7('0x5e')],_0xbef7('0x61')),'utf8');var _0x1ed990=ejs[_0xbef7('0x62')](_0x530022,{'trunks':_0x54a2e3||[]});fs['writeFileSync'](_0xbef7('0x63'),_0x1ed990);if(_0x3b8b30[_0xbef7('0x64')]){var _0x2ec195=ejs[_0xbef7('0x62')](_0x56a9ae,{'trunks':_0x54a2e3||[]});fs[_0xbef7('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x2ec195);}})[_0xbef7('0x19')](function(){return respondWithRpcPromise('Reload','create',{'module':_0xbef7('0x66')});})[_0xbef7('0x19')](function(){var _0x16c2cf=_0x551526[_0xbef7('0x57')][_0xbef7('0x31')]({'plain':!![]});if(!_0x16c2cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16c2cf['role']===_0xbef7('0x57')){var _0xefae11=_0x3b8b30[_0xbef7('0x31')]({'plain':!![]});return db[_0xbef7('0x5a')]['find']({'where':{'name':_0xbef7('0x32'),'userProfileId':_0x16c2cf[_0xbef7('0x67')]},'raw':!![]})[_0xbef7('0x19')](function(_0x14160){if(_0x14160&&_0x14160['autoAssociation']===0x0){return db[_0xbef7('0x5c')][_0xbef7('0x56')]({'name':_0xefae11['name'],'resourceId':_0xefae11['id'],'type':_0x14160['name'],'sectionId':_0x14160['id']},{})['then'](function(){return _0x3b8b30;});}else{return _0x3b8b30;}})['catch'](function(_0x2a23c7){logger[_0xbef7('0x1e')](_0xbef7('0x5d'),_0x2a23c7);throw _0x2a23c7;});}return _0x3b8b30;})[_0xbef7('0x19')](respondWithResult(_0x32fdf9,0xc9))[_0xbef7('0x4e')](handleError(_0x32fdf9,null));};exports[_0xbef7('0x2f')]=function(_0x4701cd,_0x3011f6,_0x390959){var _0x53d6df;return db[_0xbef7('0x36')][_0xbef7('0x51')]({'where':{'id':_0x4701cd[_0xbef7('0x4f')]['id']}})[_0xbef7('0x19')](handleEntityNotFound(_0x3011f6,null))[_0xbef7('0x19')](saveUpdates(_0x4701cd['body'],null))[_0xbef7('0x19')](function(_0x18122c){if(_0x18122c){_0x53d6df=_0x18122c;return db[_0xbef7('0x36')]['findAll']({'raw':!![]});}})[_0xbef7('0x19')](function(_0x53eb79){if(_0x53eb79){var _0x1060a6=fs['readFileSync'](path[_0xbef7('0x60')](config[_0xbef7('0x5e')],_0xbef7('0x5f')),_0xbef7('0x68'));var _0x3147=fs[_0xbef7('0x69')](path[_0xbef7('0x60')](config[_0xbef7('0x5e')],_0xbef7('0x61')),_0xbef7('0x68'));var _0x131c0b=ejs['render'](_0x1060a6,{'trunks':_0x53eb79||[]});fs[_0xbef7('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x131c0b);var _0x3a9a1e=ejs[_0xbef7('0x62')](_0x3147,{'trunks':_0x53eb79||[]});fs['writeFileSync'](_0xbef7('0x6a'),_0x3a9a1e);return respondWithRpcPromise(_0xbef7('0x6b'),'update',{'module':_0xbef7('0x66')});}return null;})['then'](function(_0x2e2b62){if(_0x2e2b62){return _0x53d6df;}})[_0xbef7('0x19')](respondWithResult(_0x3011f6,null))[_0xbef7('0x4e')](handleError(_0x3011f6,null));};exports[_0xbef7('0x30')]=function(_0x15e245,_0x57a7a8,_0x4bdbc1){var _0x3f4ebd;return db[_0xbef7('0x36')][_0xbef7('0x51')]({'where':{'id':_0x15e245[_0xbef7('0x4f')]['id']}})[_0xbef7('0x19')](handleEntityNotFound(_0x57a7a8,null))['then'](removeEntity(_0x57a7a8,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x115c43){var _0x3ec116=fs[_0xbef7('0x69')](path['join'](config['root'],_0xbef7('0x5f')),_0xbef7('0x68'));var _0x395299=fs[_0xbef7('0x69')](path[_0xbef7('0x60')](config[_0xbef7('0x5e')],_0xbef7('0x61')),_0xbef7('0x68'));var _0x30a3fa=ejs[_0xbef7('0x62')](_0x3ec116,{'trunks':_0x115c43});var _0x54653b=ejs[_0xbef7('0x62')](_0x395299,{'trunks':_0x115c43});fs['writeFileSync'](_0xbef7('0x63'),_0x30a3fa);fs[_0xbef7('0x65')](_0xbef7('0x6a'),_0x54653b);return respondWithRpcPromise(_0xbef7('0x6b'),'destroy',{'module':_0xbef7('0x66')});})[_0xbef7('0x4e')](handleError(_0x57a7a8,null));};
\ No newline at end of file
+var _0xd970=['debug','request\x20sent','error','code','message','info','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','update','then','get','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','find','params','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','destroy','server/files/templates/registry.ejs','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','crypto','jsforce','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','Trunk,\x20%s,\x20%s'];(function(_0x3326b4,_0x43daf4){var _0x4d97d7=function(_0x36b84b){while(--_0x36b84b){_0x3326b4['push'](_0x3326b4['shift']());}};_0x4d97d7(++_0x43daf4);}(_0xd970,0xbc));var _0x0d97=function(_0xcae378,_0x810fa4){_0xcae378=_0xcae378-0x0;var _0x26ecaa=_0xd970[_0xcae378];return _0x26ecaa;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0d97('0x0'));var zipdir=require(_0x0d97('0x1'));var jsonpatch=require(_0x0d97('0x2'));var rp=require(_0x0d97('0x3'));var moment=require('moment');var BPromise=require(_0x0d97('0x4'));var Mustache=require(_0x0d97('0x5'));var util=require('util');var path=require(_0x0d97('0x6'));var sox=require(_0x0d97('0x7'));var csv=require(_0x0d97('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0d97('0x9'));var jsforce=require(_0x0d97('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0d97('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0d97('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0d97('0xc'));var logger=require(_0x0d97('0xd'))('api');var utils=require(_0x0d97('0xe'));var config=require(_0x0d97('0xf'));var db=require(_0x0d97('0x10'))['db'];var jayson=require(_0x0d97('0x11'));var client=jayson[_0x0d97('0x12')][_0x0d97('0x13')]({'port':0x232a});function checkPasswordPattern(_0x528de7,_0x180f24,_0x16d37a){if(_0x16d37a){var _0x267d58=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x267d58[_0x0d97('0x14')](_0x180f24)){return _0x528de7;}else{throw new Error(_0x0d97('0x15'));}}else{return _0x528de7;}}function respondWithRpcPromise(_0x268070,_0x588540,_0x22b090,_0x3cb427){return new BPromise(function(_0x4036d9,_0x1142d9){var _0x58616a=_0x3cb427||client;return _0x58616a[_0x0d97('0x16')](_0x268070,_0x22b090)['then'](function(_0xf348db){logger['info'](_0x0d97('0x17'),_0x588540,'request\x20sent');logger[_0x0d97('0x18')]('Trunk,\x20%s,\x20%s,\x20%s',_0x588540,_0x0d97('0x19'),JSON['stringify'](_0xf348db));if(_0xf348db[_0x0d97('0x1a')]){if(_0xf348db[_0x0d97('0x1a')][_0x0d97('0x1b')]===0x1f4){logger[_0x0d97('0x1a')](_0x0d97('0x17'),_0x588540,_0xf348db[_0x0d97('0x1a')][_0x0d97('0x1c')]);return _0x1142d9(_0xf348db[_0x0d97('0x1a')]['message']);}logger[_0x0d97('0x1a')](_0x0d97('0x17'),_0x588540,_0xf348db[_0x0d97('0x1a')][_0x0d97('0x1c')]);return _0x4036d9(_0xf348db['error'][_0x0d97('0x1c')]);}else{logger[_0x0d97('0x1d')](_0x0d97('0x17'),_0x588540,_0x0d97('0x19'));_0x4036d9(_0xf348db[_0x0d97('0x1e')][_0x0d97('0x1c')]);}})[_0x0d97('0x1f')](function(_0x14a163){logger[_0x0d97('0x1a')](_0x0d97('0x17'),_0x588540,_0x14a163);_0x1142d9(_0x14a163);});});}function respondWithStatusCode(_0x4533b0,_0x388ca3){_0x388ca3=_0x388ca3||0xcc;return function(_0x1ec72a){if(_0x1ec72a){return _0x4533b0[_0x0d97('0x20')](_0x388ca3);}return _0x4533b0[_0x0d97('0x21')](_0x388ca3)['end']();};}function respondWithResult(_0x2af2ca,_0x2cbff2){_0x2cbff2=_0x2cbff2||0xc8;return function(_0x5cdc44){if(_0x5cdc44){return _0x2af2ca[_0x0d97('0x21')](_0x2cbff2)[_0x0d97('0x22')](_0x5cdc44);}};}function respondWithFilteredResult(_0x3ec2b5,_0x2f251b){return function(_0x5229a8){if(_0x5229a8){var _0x1e2502=_0x5229a8['count'],_0x3af749=_0x2f251b[_0x0d97('0x23')],_0x44cb61=_0x2f251b[_0x0d97('0x23')]+_0x2f251b[_0x0d97('0x24')],_0x1f3b2f;if(_0x44cb61>=_0x1e2502){_0x44cb61=_0x1e2502;_0x1f3b2f=0xc8;}else{_0x1f3b2f=0xce;}_0x3ec2b5[_0x0d97('0x21')](_0x1f3b2f);return _0x3ec2b5['set'](_0x0d97('0x25'),_0x3af749+'-'+_0x44cb61+'/'+_0x1e2502)[_0x0d97('0x22')](_0x5229a8);}return null;};}function patchUpdates(_0x120a3b){return function(_0x583516){try{jsonpatch[_0x0d97('0x26')](_0x583516,_0x120a3b,!![]);}catch(_0x7c5795){return BPromise[_0x0d97('0x27')](_0x7c5795);}return _0x583516['save']();};}function saveUpdates(_0x5ed40d,_0x2c99bd){return function(_0x597c58){if(_0x597c58){return _0x597c58[_0x0d97('0x28')](_0x5ed40d)[_0x0d97('0x29')](function(_0x43d3ae){return _0x43d3ae;});}return null;};}function removeEntity(_0x5ca609,_0x4408e7){return function(_0xbe1f3){if(_0xbe1f3){return _0xbe1f3['destroy']()[_0x0d97('0x29')](function(){var _0x2910ce=_0xbe1f3[_0x0d97('0x2a')]({'plain':!![]});var _0x5e57e9=_0x0d97('0x2b');return db[_0x0d97('0x2c')]['destroy']({'where':{'type':_0x5e57e9,'resourceId':_0x2910ce['id']}})[_0x0d97('0x29')](function(){return _0xbe1f3;});})[_0x0d97('0x29')](function(){_0x5ca609['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x171519,_0x7b5d76){return function(_0x22027d){if(!_0x22027d){_0x171519[_0x0d97('0x20')](0x194);}return _0x22027d;};}function handleError(_0x2e953a,_0x3ff721){_0x3ff721=_0x3ff721||0x1f4;return function(_0x97d446){logger[_0x0d97('0x1a')](_0x97d446[_0x0d97('0x2d')]);if(_0x97d446['name']){delete _0x97d446[_0x0d97('0x2e')];}_0x2e953a['status'](_0x3ff721)[_0x0d97('0x2f')](_0x97d446);};}exports[_0x0d97('0x30')]=function(_0x2c6a45,_0x8885e6){var _0xdbb2f2={},_0x1a5ba1={},_0x50e7a4={'count':0x0,'rows':[]};var _0x16e555=db[_0x0d97('0x31')][_0x0d97('0x32')];_0x1a5ba1['model']=_[_0x0d97('0x33')](_0x16e555);_0x1a5ba1[_0x0d97('0x34')]=_[_0x0d97('0x33')](_0x2c6a45[_0x0d97('0x34')]);_0x1a5ba1[_0x0d97('0x35')]=_['intersection'](_0x1a5ba1[_0x0d97('0x36')],_0x1a5ba1['query']);_0xdbb2f2[_0x0d97('0x37')]=_[_0x0d97('0x38')](_0x1a5ba1[_0x0d97('0x36')],qs[_0x0d97('0x39')](_0x2c6a45[_0x0d97('0x34')][_0x0d97('0x39')]));_0xdbb2f2['attributes']=_0xdbb2f2[_0x0d97('0x37')][_0x0d97('0x3a')]?_0xdbb2f2['attributes']:_0x1a5ba1[_0x0d97('0x36')];if(!_0x2c6a45[_0x0d97('0x34')][_0x0d97('0x3b')](_0x0d97('0x3c'))){_0xdbb2f2[_0x0d97('0x24')]=qs[_0x0d97('0x24')](_0x2c6a45['query'][_0x0d97('0x24')]);_0xdbb2f2['offset']=qs[_0x0d97('0x23')](_0x2c6a45[_0x0d97('0x34')]['offset']);}_0xdbb2f2['order']=qs[_0x0d97('0x3d')](_0x2c6a45['query'][_0x0d97('0x3d')]);_0xdbb2f2[_0x0d97('0x3e')]=qs[_0x0d97('0x35')](_[_0x0d97('0x3f')](_0x2c6a45[_0x0d97('0x34')],_0x1a5ba1[_0x0d97('0x35')]));if(_0x2c6a45[_0x0d97('0x34')][_0x0d97('0x40')]){_0xdbb2f2[_0x0d97('0x3e')]=_[_0x0d97('0x41')](_0xdbb2f2[_0x0d97('0x3e')],{'$or':_[_0x0d97('0x42')](_0x16e555,function(_0x30f87a){if(_0x30f87a[_0x0d97('0x43')][_0x0d97('0x44')]!==_0x0d97('0x45')){var _0x1d88ed={};_0x1d88ed[_0x30f87a[_0x0d97('0x46')]]={'$like':'%'+_0x2c6a45[_0x0d97('0x34')][_0x0d97('0x40')]+'%'};return _0x1d88ed;}})});}_0xdbb2f2=_['merge']({},_0xdbb2f2,_0x2c6a45[_0x0d97('0x47')]);var _0xe95955={'where':_0xdbb2f2['where']};return db['Trunk'][_0x0d97('0x48')](_0xe95955)[_0x0d97('0x29')](function(_0x4e8b42){_0x50e7a4[_0x0d97('0x48')]=_0x4e8b42;if(_0x2c6a45['query'][_0x0d97('0x49')]){_0xdbb2f2[_0x0d97('0x4a')]=[{'all':!![]}];}return db['Trunk'][_0x0d97('0x4b')](_0xdbb2f2);})[_0x0d97('0x29')](function(_0x3f36d9){_0x50e7a4[_0x0d97('0x4c')]=_0x3f36d9;return _0x50e7a4;})[_0x0d97('0x29')](respondWithFilteredResult(_0x8885e6,_0xdbb2f2))[_0x0d97('0x1f')](handleError(_0x8885e6,null));};exports[_0x0d97('0x4d')]=function(_0x4622bc,_0x1f49b8){var _0x1156ba={'raw':![],'where':{'id':_0x4622bc['params']['id']}},_0x477242={};_0x477242[_0x0d97('0x36')]=_[_0x0d97('0x33')](db[_0x0d97('0x31')][_0x0d97('0x32')]);_0x477242[_0x0d97('0x34')]=_['keys'](_0x4622bc[_0x0d97('0x34')]);_0x477242[_0x0d97('0x35')]=_[_0x0d97('0x38')](_0x477242[_0x0d97('0x36')],_0x477242[_0x0d97('0x34')]);_0x1156ba['attributes']=_['intersection'](_0x477242['model'],qs[_0x0d97('0x39')](_0x4622bc[_0x0d97('0x34')][_0x0d97('0x39')]));_0x1156ba['attributes']=_0x1156ba['attributes'][_0x0d97('0x3a')]?_0x1156ba[_0x0d97('0x37')]:_0x477242[_0x0d97('0x36')];if(_0x4622bc[_0x0d97('0x34')]['includeAll']){_0x1156ba[_0x0d97('0x4a')]=[{'all':!![]}];}_0x1156ba=_[_0x0d97('0x41')]({},_0x1156ba,_0x4622bc['options']);return db[_0x0d97('0x31')][_0x0d97('0x4e')](_0x1156ba)[_0x0d97('0x29')](handleEntityNotFound(_0x1f49b8,null))[_0x0d97('0x29')](respondWithResult(_0x1f49b8,null))['catch'](handleError(_0x1f49b8,null));};exports['clone']=function(_0x2db75d,_0xf2dca3){var _0x3b1756={'raw':![],'where':{'id':_0x2db75d[_0x0d97('0x4f')]['id']}},_0x3f4289={};_0x3f4289['model']=_[_0x0d97('0x33')](db['Trunk']['rawAttributes']);_0x3b1756[_0x0d97('0x37')]=_[_0x0d97('0x38')](_0x3f4289[_0x0d97('0x36')],qs[_0x0d97('0x39')](_0x2db75d[_0x0d97('0x34')][_0x0d97('0x39')]));_0x3b1756[_0x0d97('0x37')]=_0x3b1756['attributes'][_0x0d97('0x3a')]?_0x3b1756[_0x0d97('0x37')]:_0x3f4289['model'];if(_0x2db75d[_0x0d97('0x34')][_0x0d97('0x49')]){_0x3b1756[_0x0d97('0x4a')]=[{'all':!![]}];}_0x3b1756=_[_0x0d97('0x41')]({},_0x3b1756,_0x2db75d[_0x0d97('0x47')]);return db['Trunk'][_0x0d97('0x4e')](_0x3b1756)[_0x0d97('0x29')](handleEntityNotFound(_0xf2dca3,null))[_0x0d97('0x29')](function(_0x276a7e){if(_0x276a7e){var _0x2b5429=_0x276a7e['get']({'plain':!![]});_0x2b5429=qs[_0x0d97('0x50')](_0x2b5429,['id',_0x0d97('0x51'),_0x0d97('0x52')]);_0x2db75d['body']=_[_0x0d97('0x50')](_0x2db75d[_0x0d97('0x53')],['id',_0x0d97('0x51'),_0x0d97('0x52')]);return db['Trunk'][_0x0d97('0x54')](_[_0x0d97('0x41')](_0x2b5429,_0x2db75d[_0x0d97('0x53')]),{'include':_0x2db75d[_0x0d97('0x34')][_0x0d97('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x1270e7){var _0xbdb09=_0x2db75d['user'][_0x0d97('0x2a')]({'plain':!![]});if(!_0xbdb09)throw new Error(_0x0d97('0x55'));if(_0xbdb09[_0x0d97('0x56')]===_0x0d97('0x57')){var _0x51e72a=_0x1270e7[_0x0d97('0x2a')]({'plain':!![]});var _0x25a751=_0x0d97('0x2b');return db[_0x0d97('0x58')][_0x0d97('0x4e')]({'where':{'name':_0x25a751,'userProfileId':_0xbdb09[_0x0d97('0x59')]},'raw':!![]})[_0x0d97('0x29')](function(_0x1eaa56){if(_0x1eaa56&&_0x1eaa56[_0x0d97('0x5a')]===0x0){return db['UserProfileResource'][_0x0d97('0x54')]({'name':_0x51e72a[_0x0d97('0x2e')],'resourceId':_0x51e72a['id'],'type':_0x1eaa56[_0x0d97('0x2e')],'sectionId':_0x1eaa56['id']},{})['then'](function(){return _0x1270e7;});}else{return _0x1270e7;}})[_0x0d97('0x1f')](function(_0x4190d8){logger[_0x0d97('0x1a')](_0x0d97('0x5b'),_0x4190d8);throw _0x4190d8;});}return _0x1270e7;});}})[_0x0d97('0x29')](respondWithResult(_0xf2dca3,0xc9))[_0x0d97('0x1f')](handleError(_0xf2dca3,null));};exports['create']=function(_0x438f16,_0x45019f,_0x6dbb2e){var _0x2cbb9d;return db['Trunk'][_0x0d97('0x54')](_0x438f16[_0x0d97('0x53')],{'raw':!![]})[_0x0d97('0x29')](function(_0x12d827){_0x2cbb9d=_0x12d827;return db[_0x0d97('0x31')]['findAll']({'raw':!![]});})[_0x0d97('0x29')](function(_0x5ae9f1){var _0x37a3d1=fs[_0x0d97('0x5c')](path[_0x0d97('0x5d')](config['root'],_0x0d97('0x5e')),_0x0d97('0x5f'));var _0x1ab745=fs[_0x0d97('0x5c')](path['join'](config[_0x0d97('0x60')],'server/files/templates/registry.ejs'),_0x0d97('0x5f'));var _0x3f8fa3=ejs[_0x0d97('0x61')](_0x37a3d1,{'trunks':_0x5ae9f1||[]});fs[_0x0d97('0x62')](_0x0d97('0x63'),_0x3f8fa3);if(_0x2cbb9d[_0x0d97('0x64')]){var _0x551fbc=ejs[_0x0d97('0x61')](_0x1ab745,{'trunks':_0x5ae9f1||[]});fs[_0x0d97('0x62')](_0x0d97('0x65'),_0x551fbc);}})['then'](function(){return respondWithRpcPromise(_0x0d97('0x66'),_0x0d97('0x54'),{'module':_0x0d97('0x67')});})[_0x0d97('0x29')](function(){var _0x22d80c=_0x438f16[_0x0d97('0x57')][_0x0d97('0x2a')]({'plain':!![]});if(!_0x22d80c)throw new Error(_0x0d97('0x55'));if(_0x22d80c[_0x0d97('0x56')]==='user'){var _0x458eef=_0x2cbb9d['get']({'plain':!![]});return db[_0x0d97('0x58')][_0x0d97('0x4e')]({'where':{'name':_0x0d97('0x2b'),'userProfileId':_0x22d80c[_0x0d97('0x59')]},'raw':!![]})[_0x0d97('0x29')](function(_0x2e20a3){if(_0x2e20a3&&_0x2e20a3[_0x0d97('0x5a')]===0x0){return db[_0x0d97('0x2c')][_0x0d97('0x54')]({'name':_0x458eef[_0x0d97('0x2e')],'resourceId':_0x458eef['id'],'type':_0x2e20a3[_0x0d97('0x2e')],'sectionId':_0x2e20a3['id']},{})[_0x0d97('0x29')](function(){return _0x2cbb9d;});}else{return _0x2cbb9d;}})['catch'](function(_0x378f44){logger['error'](_0x0d97('0x5b'),_0x378f44);throw _0x378f44;});}return _0x2cbb9d;})[_0x0d97('0x29')](respondWithResult(_0x45019f,0xc9))[_0x0d97('0x1f')](handleError(_0x45019f,null));};exports['update']=function(_0x2647bc,_0x2c7c91,_0x2e5e97){var _0x1ceb38;return db['Trunk']['find']({'where':{'id':_0x2647bc[_0x0d97('0x4f')]['id']}})[_0x0d97('0x29')](handleEntityNotFound(_0x2c7c91,null))[_0x0d97('0x29')](saveUpdates(_0x2647bc['body'],null))[_0x0d97('0x29')](function(_0x1246ba){if(_0x1246ba){_0x1ceb38=_0x1246ba;return db[_0x0d97('0x31')][_0x0d97('0x4b')]({'raw':!![]});}})[_0x0d97('0x29')](function(_0x3a69d9){if(_0x3a69d9){var _0x564def=fs[_0x0d97('0x5c')](path['join'](config[_0x0d97('0x60')],'server/files/templates/trunk.ejs'),'utf8');var _0x118567=fs[_0x0d97('0x5c')](path[_0x0d97('0x5d')](config[_0x0d97('0x60')],'server/files/templates/registry.ejs'),_0x0d97('0x5f'));var _0x6c78c7=ejs[_0x0d97('0x61')](_0x564def,{'trunks':_0x3a69d9||[]});fs['writeFileSync'](_0x0d97('0x63'),_0x6c78c7);var _0x2c0ce2=ejs[_0x0d97('0x61')](_0x118567,{'trunks':_0x3a69d9||[]});fs[_0x0d97('0x62')](_0x0d97('0x65'),_0x2c0ce2);return respondWithRpcPromise(_0x0d97('0x66'),_0x0d97('0x28'),{'module':_0x0d97('0x67')});}return null;})['then'](function(_0x1103ea){if(_0x1103ea){return _0x1ceb38;}})[_0x0d97('0x29')](respondWithResult(_0x2c7c91,null))['catch'](handleError(_0x2c7c91,null));};exports[_0x0d97('0x68')]=function(_0x293760,_0x57c0b9,_0x5d1cdd){var _0x1256a;return db['Trunk'][_0x0d97('0x4e')]({'where':{'id':_0x293760['params']['id']}})[_0x0d97('0x29')](handleEntityNotFound(_0x57c0b9,null))['then'](removeEntity(_0x57c0b9,null))[_0x0d97('0x29')](function(){return db['Trunk'][_0x0d97('0x4b')]({'raw':!![]});})[_0x0d97('0x29')](function(_0x77f73c){var _0x326cc6=fs['readFileSync'](path[_0x0d97('0x5d')](config[_0x0d97('0x60')],_0x0d97('0x5e')),_0x0d97('0x5f'));var _0x419c91=fs[_0x0d97('0x5c')](path[_0x0d97('0x5d')](config['root'],_0x0d97('0x69')),_0x0d97('0x5f'));var _0xcd055d=ejs[_0x0d97('0x61')](_0x326cc6,{'trunks':_0x77f73c});var _0x19f173=ejs[_0x0d97('0x61')](_0x419c91,{'trunks':_0x77f73c});fs[_0x0d97('0x62')](_0x0d97('0x63'),_0xcd055d);fs[_0x0d97('0x62')](_0x0d97('0x65'),_0x19f173);return respondWithRpcPromise(_0x0d97('0x66'),_0x0d97('0x68'),{'module':_0x0d97('0x67')});})[_0x0d97('0x1f')](handleError(_0x57c0b9,null));};
\ No newline at end of file
diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js
index 925f4d9..ba3df56 100644
--- a/server/api/trunk/trunk.model.js
+++ b/server/api/trunk/trunk.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3248=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./trunk.attributes','define','Trunk','tools_trunks'];(function(_0x161ce3,_0x4f0c0e){var _0x3e53b9=function(_0x3c1efe){while(--_0x3c1efe){_0x161ce3['push'](_0x161ce3['shift']());}};_0x3e53b9(++_0x4f0c0e);}(_0x3248,0x1b0));var _0x8324=function(_0x3f82a4,_0x52276e){_0x3f82a4=_0x3f82a4-0x0;var _0x20886e=_0x3248[_0x3f82a4];return _0x20886e;};'use strict';var _=require(_0x8324('0x0'));var util=require(_0x8324('0x1'));var logger=require(_0x8324('0x2'))(_0x8324('0x3'));var moment=require(_0x8324('0x4'));var BPromise=require(_0x8324('0x5'));var rp=require(_0x8324('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8324('0x7'));var attributes=require(_0x8324('0x8'));module['exports']=function(_0x18edd2,_0x283f5f){return _0x18edd2[_0x8324('0x9')](_0x8324('0xa'),attributes,{'tableName':_0x8324('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaba6=['define','tools_trunks','lodash','util','request-promise','path','../../config/environment','./trunk.attributes'];(function(_0x2ff707,_0x4d8fa2){var _0x116b45=function(_0xbd31ae){while(--_0xbd31ae){_0x2ff707['push'](_0x2ff707['shift']());}};_0x116b45(++_0x4d8fa2);}(_0xaba6,0xe2));var _0x6aba=function(_0x11c361,_0x4f5b42){_0x11c361=_0x11c361-0x0;var _0x1f5355=_0xaba6[_0x11c361];return _0x1f5355;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6aba('0x2'));var fs=require('fs');var path=require(_0x6aba('0x3'));var rimraf=require('rimraf');var config=require(_0x6aba('0x4'));var attributes=require(_0x6aba('0x5'));module['exports']=function(_0x4e929a,_0x5ae14c){return _0x4e929a[_0x6aba('0x6')]('Trunk',attributes,{'tableName':_0x6aba('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js
index d572430..3944488 100644
--- a/server/api/trunk/trunk.rpc.js
+++ b/server/api/trunk/trunk.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f0e=['options','raw','where','limit','include','map','model','attributes','then','debug','ShowTrunk','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','Trunk,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','GetTrunk','findAll'];(function(_0x1d4987,_0x2858f9){var _0x518d4c=function(_0x550e6b){while(--_0x550e6b){_0x1d4987['push'](_0x1d4987['shift']());}};_0x518d4c(++_0x2858f9);}(_0x6f0e,0x6f));var _0xe6f0=function(_0x11fd15,_0x54f416){_0x11fd15=_0x11fd15-0x0;var _0xe2210b=_0x6f0e[_0x11fd15];return _0xe2210b;};'use strict';var _=require('lodash');var util=require(_0xe6f0('0x0'));var moment=require('moment');var BPromise=require(_0xe6f0('0x1'));var rs=require(_0xe6f0('0x2'));var fs=require('fs');var Redis=require(_0xe6f0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6f0('0x4'));var logger=require(_0xe6f0('0x5'))('rpc');var config=require(_0xe6f0('0x6'));var jayson=require(_0xe6f0('0x7'));var client=jayson[_0xe6f0('0x8')][_0xe6f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d9d0d,_0xdd4e6e,_0x3c8872){return new BPromise(function(_0x238a96,_0x43e11d){return client[_0xe6f0('0xa')](_0x3d9d0d,_0x3c8872)['then'](function(_0x785b3){logger['info'](_0xe6f0('0xb'),_0xdd4e6e,'request\x20sent');logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0xdd4e6e,'request\x20sent',JSON[_0xe6f0('0xc')](_0x785b3));if(_0x785b3[_0xe6f0('0xd')]){if(_0x785b3[_0xe6f0('0xd')][_0xe6f0('0xe')]===0x1f4){logger[_0xe6f0('0xd')](_0xe6f0('0xb'),_0xdd4e6e,_0x785b3[_0xe6f0('0xd')][_0xe6f0('0xf')]);return _0x43e11d(_0x785b3[_0xe6f0('0xd')]['message']);}logger[_0xe6f0('0xd')](_0xe6f0('0xb'),_0xdd4e6e,_0x785b3[_0xe6f0('0xd')]['message']);return _0x238a96(_0x785b3[_0xe6f0('0xd')]['message']);}else{logger[_0xe6f0('0x10')]('Trunk,\x20%s,\x20%s',_0xdd4e6e,_0xe6f0('0x11'));_0x238a96(_0x785b3[_0xe6f0('0x12')]['message']);}})['catch'](function(_0x2dd199){logger[_0xe6f0('0xd')]('Trunk,\x20%s,\x20%s',_0xdd4e6e,_0x2dd199);_0x43e11d(_0x2dd199);});});}exports[_0xe6f0('0x13')]=function(_0x2de4b1){var _0x2e46eb=this;return new Promise(function(_0x19ec61,_0x1add5c){return db['Trunk'][_0xe6f0('0x14')]({'raw':_0x2de4b1['options']?_0x2de4b1[_0xe6f0('0x15')][_0xe6f0('0x16')]===undefined?!![]:![]:!![],'where':_0x2de4b1[_0xe6f0('0x15')]?_0x2de4b1['options'][_0xe6f0('0x17')]||null:null,'attributes':_0x2de4b1[_0xe6f0('0x15')]?_0x2de4b1['options']['attributes']||null:null,'limit':_0x2de4b1[_0xe6f0('0x15')]?_0x2de4b1[_0xe6f0('0x15')][_0xe6f0('0x18')]||null:null,'include':_0x2de4b1[_0xe6f0('0x15')]?_0x2de4b1[_0xe6f0('0x15')][_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0x2de4b1['options']['include'],function(_0x489111){return{'model':db[_0x489111[_0xe6f0('0x1b')]],'as':_0x489111['as'],'attributes':_0x489111[_0xe6f0('0x1c')],'include':_0x489111[_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0x489111[_0xe6f0('0x19')],function(_0x4c28a6){return{'model':db[_0x4c28a6[_0xe6f0('0x1b')]],'as':_0x4c28a6['as'],'attributes':_0x4c28a6[_0xe6f0('0x1c')],'include':_0x4c28a6[_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0x4c28a6[_0xe6f0('0x19')],function(_0x14507c){return{'model':db[_0x14507c[_0xe6f0('0x1b')]],'as':_0x14507c['as'],'attributes':_0x14507c[_0xe6f0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe6f0('0x1d')](function(_0x113099){logger['info'](_0xe6f0('0x13'),_0x2de4b1);logger[_0xe6f0('0x1e')]('GetTrunk',_0x2de4b1,JSON[_0xe6f0('0xc')](_0x113099));_0x19ec61(_0x113099);})['catch'](function(_0x282f43){logger[_0xe6f0('0xd')](_0xe6f0('0x13'),_0x282f43[_0xe6f0('0xf')],_0x2de4b1);_0x1add5c(_0x2e46eb[_0xe6f0('0xd')](0x1f4,_0x282f43[_0xe6f0('0xf')]));});});};exports['ShowTrunk']=function(_0x918a4){var _0x10db1a=this;return new Promise(function(_0x3f1c51,_0x82e9a3){return db['Trunk']['find']({'raw':_0x918a4[_0xe6f0('0x15')]?_0x918a4[_0xe6f0('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x918a4['options']?_0x918a4['options'][_0xe6f0('0x17')]||null:null,'attributes':_0x918a4[_0xe6f0('0x15')]?_0x918a4['options']['attributes']||null:null,'include':_0x918a4[_0xe6f0('0x15')]?_0x918a4[_0xe6f0('0x15')][_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0x918a4[_0xe6f0('0x15')][_0xe6f0('0x19')],function(_0x55a620){return{'model':db[_0x55a620[_0xe6f0('0x1b')]],'as':_0x55a620['as'],'attributes':_0x55a620['attributes'],'include':_0x55a620[_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0x55a620[_0xe6f0('0x19')],function(_0xa26b10){return{'model':db[_0xa26b10[_0xe6f0('0x1b')]],'as':_0xa26b10['as'],'attributes':_0xa26b10[_0xe6f0('0x1c')],'include':_0xa26b10[_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0xa26b10[_0xe6f0('0x19')],function(_0x502070){return{'model':db[_0x502070[_0xe6f0('0x1b')]],'as':_0x502070['as'],'attributes':_0x502070[_0xe6f0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe6f0('0x1d')](function(_0x11e749){logger[_0xe6f0('0x10')](_0xe6f0('0x1f'),_0x918a4);logger[_0xe6f0('0x1e')]('ShowTrunk',_0x918a4,JSON[_0xe6f0('0xc')](_0x11e749));_0x3f1c51(_0x11e749);})[_0xe6f0('0x20')](function(_0x54d5ef){logger['error'](_0xe6f0('0x1f'),_0x54d5ef[_0xe6f0('0xf')],_0x918a4);_0x82e9a3(_0x10db1a['error'](0x1f4,_0x54d5ef[_0xe6f0('0xf')]));});});};
\ No newline at end of file
+var _0x3c02=['debug','stringify','error','code','message','info','result','catch','Trunk','findAll','options','raw','where','attributes','include','map','model','GetTrunk','ShowTrunk','find','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x3c02,0x1a1));var _0x23c0=function(_0x150b23,_0x308d06){_0x150b23=_0x150b23-0x0;var _0x1a3b11=_0x3c02[_0x150b23];return _0x1a3b11;};'use strict';var _=require(_0x23c0('0x0'));var util=require(_0x23c0('0x1'));var moment=require(_0x23c0('0x2'));var BPromise=require(_0x23c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x23c0('0x4'));var logger=require(_0x23c0('0x5'))(_0x23c0('0x6'));var config=require('../../config/environment');var jayson=require(_0x23c0('0x7'));var client=jayson[_0x23c0('0x8')][_0x23c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x414b20,_0x22f713,_0x19906){return new BPromise(function(_0x56570e,_0x2a0751){return client['request'](_0x414b20,_0x19906)['then'](function(_0x32c13a){logger['info'](_0x23c0('0xa'),_0x22f713,_0x23c0('0xb'));logger[_0x23c0('0xc')]('Trunk,\x20%s,\x20%s,\x20%s',_0x22f713,'request\x20sent',JSON[_0x23c0('0xd')](_0x32c13a));if(_0x32c13a[_0x23c0('0xe')]){if(_0x32c13a[_0x23c0('0xe')][_0x23c0('0xf')]===0x1f4){logger[_0x23c0('0xe')](_0x23c0('0xa'),_0x22f713,_0x32c13a[_0x23c0('0xe')]['message']);return _0x2a0751(_0x32c13a['error']['message']);}logger['error']('Trunk,\x20%s,\x20%s',_0x22f713,_0x32c13a['error'][_0x23c0('0x10')]);return _0x56570e(_0x32c13a['error'][_0x23c0('0x10')]);}else{logger[_0x23c0('0x11')](_0x23c0('0xa'),_0x22f713,_0x23c0('0xb'));_0x56570e(_0x32c13a[_0x23c0('0x12')][_0x23c0('0x10')]);}})[_0x23c0('0x13')](function(_0x56d71b){logger[_0x23c0('0xe')](_0x23c0('0xa'),_0x22f713,_0x56d71b);_0x2a0751(_0x56d71b);});});}exports['GetTrunk']=function(_0x191d02){var _0x571aed=this;return new Promise(function(_0x57e58c,_0x2f4edf){return db[_0x23c0('0x14')][_0x23c0('0x15')]({'raw':_0x191d02[_0x23c0('0x16')]?_0x191d02[_0x23c0('0x16')][_0x23c0('0x17')]===undefined?!![]:![]:!![],'where':_0x191d02[_0x23c0('0x16')]?_0x191d02[_0x23c0('0x16')][_0x23c0('0x18')]||null:null,'attributes':_0x191d02[_0x23c0('0x16')]?_0x191d02[_0x23c0('0x16')][_0x23c0('0x19')]||null:null,'limit':_0x191d02[_0x23c0('0x16')]?_0x191d02['options']['limit']||null:null,'include':_0x191d02['options']?_0x191d02[_0x23c0('0x16')][_0x23c0('0x1a')]?_[_0x23c0('0x1b')](_0x191d02[_0x23c0('0x16')][_0x23c0('0x1a')],function(_0x36cf9b){return{'model':db[_0x36cf9b[_0x23c0('0x1c')]],'as':_0x36cf9b['as'],'attributes':_0x36cf9b[_0x23c0('0x19')],'include':_0x36cf9b[_0x23c0('0x1a')]?_[_0x23c0('0x1b')](_0x36cf9b[_0x23c0('0x1a')],function(_0x548849){return{'model':db[_0x548849[_0x23c0('0x1c')]],'as':_0x548849['as'],'attributes':_0x548849['attributes'],'include':_0x548849[_0x23c0('0x1a')]?_[_0x23c0('0x1b')](_0x548849[_0x23c0('0x1a')],function(_0x3e5b3){return{'model':db[_0x3e5b3[_0x23c0('0x1c')]],'as':_0x3e5b3['as'],'attributes':_0x3e5b3[_0x23c0('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f8c7e){logger[_0x23c0('0x11')](_0x23c0('0x1d'),_0x191d02);logger[_0x23c0('0xc')](_0x23c0('0x1d'),_0x191d02,JSON[_0x23c0('0xd')](_0x4f8c7e));_0x57e58c(_0x4f8c7e);})[_0x23c0('0x13')](function(_0x2322d6){logger[_0x23c0('0xe')](_0x23c0('0x1d'),_0x2322d6['message'],_0x191d02);_0x2f4edf(_0x571aed['error'](0x1f4,_0x2322d6[_0x23c0('0x10')]));});});};exports[_0x23c0('0x1e')]=function(_0x24c67d){var _0x59f436=this;return new Promise(function(_0xaba58a,_0xa932e4){return db[_0x23c0('0x14')][_0x23c0('0x1f')]({'raw':_0x24c67d[_0x23c0('0x16')]?_0x24c67d['options'][_0x23c0('0x17')]===undefined?!![]:![]:!![],'where':_0x24c67d[_0x23c0('0x16')]?_0x24c67d[_0x23c0('0x16')][_0x23c0('0x18')]||null:null,'attributes':_0x24c67d['options']?_0x24c67d['options']['attributes']||null:null,'include':_0x24c67d[_0x23c0('0x16')]?_0x24c67d[_0x23c0('0x16')][_0x23c0('0x1a')]?_[_0x23c0('0x1b')](_0x24c67d['options'][_0x23c0('0x1a')],function(_0x5f03f2){return{'model':db[_0x5f03f2['model']],'as':_0x5f03f2['as'],'attributes':_0x5f03f2[_0x23c0('0x19')],'include':_0x5f03f2[_0x23c0('0x1a')]?_[_0x23c0('0x1b')](_0x5f03f2[_0x23c0('0x1a')],function(_0x2176dd){return{'model':db[_0x2176dd[_0x23c0('0x1c')]],'as':_0x2176dd['as'],'attributes':_0x2176dd['attributes'],'include':_0x2176dd['include']?_[_0x23c0('0x1b')](_0x2176dd[_0x23c0('0x1a')],function(_0x6fd583){return{'model':db[_0x6fd583[_0x23c0('0x1c')]],'as':_0x6fd583['as'],'attributes':_0x6fd583['attributes']};}):[]};}):[]};}):[]:[]})[_0x23c0('0x20')](function(_0x34c94b){logger[_0x23c0('0x11')]('ShowTrunk',_0x24c67d);logger[_0x23c0('0xc')](_0x23c0('0x1e'),_0x24c67d,JSON[_0x23c0('0xd')](_0x34c94b));_0xaba58a(_0x34c94b);})[_0x23c0('0x13')](function(_0x4623cd){logger[_0x23c0('0xe')](_0x23c0('0x1e'),_0x4623cd[_0x23c0('0x10')],_0x24c67d);_0xa932e4(_0x59f436['error'](0x1f4,_0x4623cd[_0x23c0('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/user/index.js b/server/api/user/index.js
index 75aafd2..4a86a28 100644
--- a/server/api/user/index.js
+++ b/server/api/user/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6a7f=['/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addMailAccounts','addSmsAccounts','addSquareProjects','createApiKey','put','changePassword','removeQueues','/:id/teams','removeTeams','delete','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeChatWebsites','/:id/square_projects','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','addContacts','create','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname'];(function(_0x3a50ae,_0x4a505b){var _0x3a16f4=function(_0x508359){while(--_0x508359){_0x3a50ae['push'](_0x3a50ae['shift']());}};_0x3a16f4(++_0x4a505b);}(_0x6a7f,0x106));var _0xf6a7=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6a7f[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xf6a7('0x0'));var util=require(_0xf6a7('0x1'));var path=require(_0xf6a7('0x2'));var timeout=require(_0xf6a7('0x3'));var express=require(_0xf6a7('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf6a7('0x5'));var controller=require(_0xf6a7('0x6'));router['get']('/',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x8')]);router[_0xf6a7('0x9')](_0xf6a7('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xf6a7('0x9')](_0xf6a7('0xb'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0xc')]);router['get']('/:id/avatar',controller[_0xf6a7('0xd')]);router[_0xf6a7('0x9')](_0xf6a7('0xe'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0xf')]);router[_0xf6a7('0x9')](_0xf6a7('0x10'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x11')]);router['get']('/:id/queues_rt',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x12')]);router[_0xf6a7('0x9')](_0xf6a7('0x13'),auth['isAuthenticated'](),controller[_0xf6a7('0x14')]);router['get'](_0xf6a7('0x15'),auth['isAuthenticated'](),controller[_0xf6a7('0x16')]);router[_0xf6a7('0x9')](_0xf6a7('0x17'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x18')]);router['get'](_0xf6a7('0x19'),auth[_0xf6a7('0x7')](),controller['getChatInteractions']);router[_0xf6a7('0x9')](_0xf6a7('0x1a'),auth['isAuthenticated'](),controller[_0xf6a7('0x1b')]);router[_0xf6a7('0x9')](_0xf6a7('0x1c'),auth['isAuthenticated'](),controller[_0xf6a7('0x1d')]);router[_0xf6a7('0x9')]('/:id/sms/interactions',auth[_0xf6a7('0x7')](),controller['getSmsInteractions']);router['get'](_0xf6a7('0x1e'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x1f')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xf6a7('0x20')]);router[_0xf6a7('0x9')](_0xf6a7('0x21'),auth['isAuthenticated'](),controller[_0xf6a7('0x22')]);router[_0xf6a7('0x9')](_0xf6a7('0x23'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x24')]);router['get'](_0xf6a7('0x25'),auth['isAuthenticated'](),controller[_0xf6a7('0x26')]);router[_0xf6a7('0x9')](_0xf6a7('0x27'),auth['isAuthenticated'](),controller[_0xf6a7('0x28')]);router[_0xf6a7('0x9')](_0xf6a7('0x29'),auth[_0xf6a7('0x7')](),controller['getMailAccounts']);router[_0xf6a7('0x9')](_0xf6a7('0x2a'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x2b')]);router[_0xf6a7('0x9')](_0xf6a7('0x2c'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x2d')]);router[_0xf6a7('0x9')](_0xf6a7('0x2e'),auth['isAuthenticated'](),controller['getChatWebsites']);router['get']('/:id/square_projects',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x2f')]);router[_0xf6a7('0x9')](_0xf6a7('0x30'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x31')]);router['get'](_0xf6a7('0x32'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x33')]);router[_0xf6a7('0x34')](_0xf6a7('0x35'),auth[_0xf6a7('0x7')](),controller['bulkCreate']);router[_0xf6a7('0x34')](_0xf6a7('0xe'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x36')]);router[_0xf6a7('0x34')]('/',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x37')]);router[_0xf6a7('0x34')](_0xf6a7('0x10'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x38')]);var upload=multer({'storage':multer[_0xf6a7('0x39')]({'destination':function(_0x54f324,_0x308a38,_0x34ecc6){_0x34ecc6(null,path[_0xf6a7('0x3a')](config[_0xf6a7('0x3b')],_0xf6a7('0x3c')));},'filename':function(_0x1442c2,_0x5a2253,_0x53cfff){_0x53cfff(null,util[_0xf6a7('0x3d')](_0xf6a7('0x3e'),Date[_0xf6a7('0x3f')](),_0x5a2253[_0xf6a7('0x40')]));}})});router[_0xf6a7('0x34')](_0xf6a7('0x41'),upload[_0xf6a7('0x42')](_0xf6a7('0x43')),controller[_0xf6a7('0x44')]);router['post'](_0xf6a7('0x45'),auth['isAuthenticated'](),controller[_0xf6a7('0x46')]);router['post'](_0xf6a7('0x47'),auth['isAuthenticated'](),controller[_0xf6a7('0x48')]);router[_0xf6a7('0x34')](_0xf6a7('0x49'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x4a')]);router[_0xf6a7('0x34')]('/:id/unpause',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x4b')]);router[_0xf6a7('0x34')]('/:id/teams',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x4c')]);router[_0xf6a7('0x34')](_0xf6a7('0x4d'),auth['isAuthenticated'](),controller[_0xf6a7('0x4e')]);router[_0xf6a7('0x34')]('/:id/mail_interactions',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x4f')]);router['post']('/:id/fax_interactions',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x50')]);router[_0xf6a7('0x34')](_0xf6a7('0x51'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x52')]);router[_0xf6a7('0x34')]('/:id/openchannel_interactions',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x53')]);router[_0xf6a7('0x34')](_0xf6a7('0x27'),auth[_0xf6a7('0x7')](),controller['addFaxAccounts']);router[_0xf6a7('0x34')](_0xf6a7('0x29'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x54')]);router[_0xf6a7('0x34')](_0xf6a7('0x2a'),auth[_0xf6a7('0x7')](),controller['addOpenchannelAccounts']);router[_0xf6a7('0x34')](_0xf6a7('0x2c'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x55')]);router['post']('/:id/chat_websites',auth['isAuthenticated'](),controller['addChatWebsites']);router[_0xf6a7('0x34')]('/:id/square_projects',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x56')]);router[_0xf6a7('0x34')](_0xf6a7('0x32'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x57')]);router['put'](_0xf6a7('0xb'),auth[_0xf6a7('0x7')](),controller['update']);router[_0xf6a7('0x58')]('/:id/password',auth['isAuthenticated'](),controller[_0xf6a7('0x59')]);router['delete'](_0xf6a7('0x10'),auth['isAuthenticated'](),controller[_0xf6a7('0x5a')]);router['delete'](_0xf6a7('0x5b'),auth['isAuthenticated'](),controller[_0xf6a7('0x5c')]);router[_0xf6a7('0x5d')](_0xf6a7('0xb'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x5e')]);router[_0xf6a7('0x5d')](_0xf6a7('0x4d'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x5f')]);router[_0xf6a7('0x5d')](_0xf6a7('0x60'),auth['isAuthenticated'](),controller[_0xf6a7('0x61')]);router[_0xf6a7('0x5d')](_0xf6a7('0x62'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x63')]);router[_0xf6a7('0x5d')](_0xf6a7('0x51'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router[_0xf6a7('0x5d')](_0xf6a7('0x64'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x65')]);router[_0xf6a7('0x5d')](_0xf6a7('0x27'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x66')]);router[_0xf6a7('0x5d')](_0xf6a7('0x29'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x67')]);router['delete'](_0xf6a7('0x2a'),auth[_0xf6a7('0x7')](),controller['removeOpenchannelAccounts']);router[_0xf6a7('0x5d')](_0xf6a7('0x2c'),auth[_0xf6a7('0x7')](),controller['removeSmsAccounts']);router[_0xf6a7('0x5d')](_0xf6a7('0x2e'),auth['isAuthenticated'](),controller[_0xf6a7('0x68')]);router[_0xf6a7('0x5d')](_0xf6a7('0x69'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x6a')]);router['delete'](_0xf6a7('0x32'),auth['isAuthenticated'](),controller[_0xf6a7('0x6b')]);module[_0xf6a7('0x6c')]=router;
\ No newline at end of file
+var _0x0b49=['addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','put','update','/:id/password','delete','/:id','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeSmsAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','show','/:id/avatar','getAvatar','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','/:id/chat/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/teams','getLists','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','/create_many','addContacts','create','diskStorage','root','format','%s-%s','now','file','/:id/login','login','/:id/logout','logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/fax_accounts','addMailAccounts'];(function(_0x4cb802,_0x18f32e){var _0x552fbb=function(_0x1aa77f){while(--_0x1aa77f){_0x4cb802['push'](_0x4cb802['shift']());}};_0x552fbb(++_0x18f32e);}(_0x0b49,0x69));var _0x90b4=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x0b49[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x90b4('0x0'));var util=require(_0x90b4('0x1'));var path=require(_0x90b4('0x2'));var timeout=require('connect-timeout');var express=require(_0x90b4('0x3'));var router=express['Router']();var auth=require(_0x90b4('0x4'));var interaction=require(_0x90b4('0x5'));var config=require(_0x90b4('0x6'));var controller=require(_0x90b4('0x7'));router['get']('/',auth[_0x90b4('0x8')](),controller[_0x90b4('0x9')]);router[_0x90b4('0xa')](_0x90b4('0xb'),auth[_0x90b4('0x8')](),controller[_0x90b4('0xc')]);router[_0x90b4('0xa')]('/:id',auth[_0x90b4('0x8')](),controller[_0x90b4('0xd')]);router[_0x90b4('0xa')](_0x90b4('0xe'),controller[_0x90b4('0xf')]);router[_0x90b4('0xa')](_0x90b4('0x10'),auth[_0x90b4('0x8')](),controller['getContacts']);router[_0x90b4('0xa')](_0x90b4('0x11'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x12')]);router[_0x90b4('0xa')](_0x90b4('0x13'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x14')]);router[_0x90b4('0xa')](_0x90b4('0x15'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x16')]);router[_0x90b4('0xa')](_0x90b4('0x17'),auth[_0x90b4('0x8')](),controller['getRecordings']);router['get'](_0x90b4('0x18'),auth['isAuthenticated'](),controller['getScreenRecordings']);router['get'](_0x90b4('0x19'),auth[_0x90b4('0x8')](),controller['getChatInteractions']);router[_0x90b4('0xa')]('/:id/openchannel/interactions',auth[_0x90b4('0x8')](),controller['getOpenchannelInteractions']);router[_0x90b4('0xa')]('/:id/mail/interactions',auth[_0x90b4('0x8')](),controller[_0x90b4('0x1a')]);router[_0x90b4('0xa')](_0x90b4('0x1b'),auth['isAuthenticated'](),controller[_0x90b4('0x1c')]);router[_0x90b4('0xa')](_0x90b4('0x1d'),auth[_0x90b4('0x8')](),controller['getFaxInteractions']);router[_0x90b4('0xa')](_0x90b4('0x1e'),auth[_0x90b4('0x8')](),controller['getTeams']);router['get']('/:id/lists',auth[_0x90b4('0x8')](),controller[_0x90b4('0x1f')]);router[_0x90b4('0xa')]('/:id/agents',auth[_0x90b4('0x8')](),controller[_0x90b4('0x20')]);router['get'](_0x90b4('0x21'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x22')]);router[_0x90b4('0xa')]('/:id/fax_accounts',auth[_0x90b4('0x8')](),controller[_0x90b4('0x23')]);router['get'](_0x90b4('0x24'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x25')]);router[_0x90b4('0xa')](_0x90b4('0x26'),auth[_0x90b4('0x8')](),controller['getOpenchannelAccounts']);router[_0x90b4('0xa')](_0x90b4('0x27'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x28')]);router[_0x90b4('0xa')](_0x90b4('0x29'),auth[_0x90b4('0x8')](),controller['getChatWebsites']);router[_0x90b4('0xa')](_0x90b4('0x2a'),auth[_0x90b4('0x8')](),controller['getSquareProjects']);router[_0x90b4('0xa')](_0x90b4('0x2b'),auth[_0x90b4('0x8')](),controller['getScheduledCalls']);router[_0x90b4('0xa')](_0x90b4('0x2c'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x2d')]);router[_0x90b4('0x2e')](_0x90b4('0x2f'),auth[_0x90b4('0x8')](),controller['bulkCreate']);router[_0x90b4('0x2e')](_0x90b4('0x10'),auth['isAuthenticated'](),controller[_0x90b4('0x30')]);router[_0x90b4('0x2e')]('/',auth[_0x90b4('0x8')](),controller[_0x90b4('0x31')]);router[_0x90b4('0x2e')](_0x90b4('0x11'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0x90b4('0x32')]({'destination':function(_0x1938d8,_0x4afd9b,_0x2af4fb){_0x2af4fb(null,path['join'](config[_0x90b4('0x33')],'server/files/images/'));},'filename':function(_0x50f80f,_0x450fe8,_0x24e27e){_0x24e27e(null,util[_0x90b4('0x34')](_0x90b4('0x35'),Date[_0x90b4('0x36')](),_0x450fe8['originalname']));}})});router['post'](_0x90b4('0xe'),upload['single'](_0x90b4('0x37')),controller['addAvatar']);router[_0x90b4('0x2e')](_0x90b4('0x38'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x39')]);router[_0x90b4('0x2e')](_0x90b4('0x3a'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x3b')]);router[_0x90b4('0x2e')](_0x90b4('0x3c'),auth[_0x90b4('0x8')](),controller['pause']);router['post'](_0x90b4('0x3d'),auth['isAuthenticated'](),controller[_0x90b4('0x3e')]);router[_0x90b4('0x2e')](_0x90b4('0x1e'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x3f')]);router[_0x90b4('0x2e')](_0x90b4('0x40'),auth[_0x90b4('0x8')](),controller['addChatInteractions']);router[_0x90b4('0x2e')](_0x90b4('0x41'),auth[_0x90b4('0x8')](),controller['addMailInteractions']);router[_0x90b4('0x2e')](_0x90b4('0x42'),auth[_0x90b4('0x8')](),controller['addFaxInteractions']);router[_0x90b4('0x2e')](_0x90b4('0x43'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x44')]);router[_0x90b4('0x2e')](_0x90b4('0x45'),auth['isAuthenticated'](),controller[_0x90b4('0x46')]);router[_0x90b4('0x2e')](_0x90b4('0x47'),auth[_0x90b4('0x8')](),controller['addFaxAccounts']);router[_0x90b4('0x2e')](_0x90b4('0x24'),auth['isAuthenticated'](),controller[_0x90b4('0x48')]);router['post'](_0x90b4('0x26'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0x90b4('0x2e')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x90b4('0x49')]);router['post'](_0x90b4('0x29'),auth['isAuthenticated'](),controller[_0x90b4('0x4a')]);router[_0x90b4('0x2e')]('/:id/square_projects',auth[_0x90b4('0x8')](),controller[_0x90b4('0x4b')]);router[_0x90b4('0x2e')](_0x90b4('0x2c'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x4c')]);router[_0x90b4('0x4d')]('/:id',auth[_0x90b4('0x8')](),controller[_0x90b4('0x4e')]);router[_0x90b4('0x4d')](_0x90b4('0x4f'),auth[_0x90b4('0x8')](),controller['changePassword']);router['delete'](_0x90b4('0x11'),auth['isAuthenticated'](),controller['removeQueues']);router[_0x90b4('0x50')]('/:id/teams',auth[_0x90b4('0x8')](),controller['removeTeams']);router[_0x90b4('0x50')](_0x90b4('0x51'),auth[_0x90b4('0x8')](),controller['destroy']);router[_0x90b4('0x50')](_0x90b4('0x40'),auth[_0x90b4('0x8')](),controller['removeChatInteractions']);router['delete']('/:id/mail_interactions',auth[_0x90b4('0x8')](),controller[_0x90b4('0x52')]);router[_0x90b4('0x50')]('/:id/fax_interactions',auth[_0x90b4('0x8')](),controller['removeFaxInteractions']);router[_0x90b4('0x50')](_0x90b4('0x43'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x53')]);router[_0x90b4('0x50')](_0x90b4('0x45'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x54')]);router['delete'](_0x90b4('0x47'),auth[_0x90b4('0x8')](),controller['removeFaxAccounts']);router[_0x90b4('0x50')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x90b4('0x50')](_0x90b4('0x26'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router['delete'](_0x90b4('0x27'),auth['isAuthenticated'](),controller[_0x90b4('0x55')]);router['delete'](_0x90b4('0x29'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0x90b4('0x50')](_0x90b4('0x2a'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x56')]);router['delete'](_0x90b4('0x2c'),auth[_0x90b4('0x8')](),controller[_0x90b4('0x57')]);module[_0x90b4('0x58')]=router;
\ No newline at end of file
diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js
index 5cb28fb..e48a453 100644
--- a/server/api/user/user.attributes.js
+++ b/server/api/user/user.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4977=['PROHIB','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','outgoing','force_rport,comedia','nat','join','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','refuse','originate','uas','fingerprint','active','passive','update,nonat','showWebBar','get','wss','udp','encryption','icesupport','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsenable','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','admin','user','agent','telephone','INTEGER','accountcode','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','ENUM','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED'];(function(_0x2598e7,_0x5129c9){var _0x36120e=function(_0x34d15a){while(--_0x34d15a){_0x2598e7['push'](_0x2598e7['shift']());}};_0x36120e(++_0x5129c9);}(_0x4977,0x8e));var _0x7497=function(_0x2259c9,_0x44be9a){_0x2259c9=_0x2259c9-0x0;var _0x2f5271=_0x4977[_0x2259c9];return _0x2f5271;};'use strict';var Sequelize=require(_0x7497('0x0'));var moment=require(_0x7497('0x1'));var util=require(_0x7497('0x2'));var _=require(_0x7497('0x3'));module[_0x7497('0x4')]={'name':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'unique':_0x7497('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5b8968){this['setDataValue'](_0x7497('0x6'),_0x5b8968);this[_0x7497('0x7')](_0x7497('0x8'),_0x5b8968);},'comment':_0x7497('0x9')},'fullname':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'set':function(_0x39ea56){this['setDataValue'](_0x7497('0xa'),_0x39ea56);this[_0x7497('0x7')](_0x7497('0xb'),util[_0x7497('0xc')](_0x7497('0xd'),_0x39ea56,this['getDataValue'](_0x7497('0xe'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'unique':_0x7497('0xf'),'validate':{'isEmail':!![]},'set':function(_0x445e36){if(_0x445e36){this[_0x7497('0x7')](_0x7497('0xf'),_0x445e36[_0x7497('0x10')]());}}},'role':{'type':Sequelize['ENUM'](_0x7497('0x11'),_0x7497('0x12'),_0x7497('0x13'),_0x7497('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':![],'unique':_0x7497('0xe'),'set':function(_0x1e9ca0){this[_0x7497('0x7')](_0x7497('0xe'),_0x1e9ca0);this[_0x7497('0x7')](_0x7497('0x16'),_0x1e9ca0);this[_0x7497('0x7')]('callerid',util[_0x7497('0xc')]('\x22%s\x22\x20<%s>',this[_0x7497('0x17')](_0x7497('0xa')),_0x1e9ca0));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x7497('0x5')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x7497('0x5')]},'zipcode':{'type':Sequelize[_0x7497('0x5')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7497('0x5')]},'country':{'type':Sequelize[_0x7497('0x5')]},'online':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x7497('0x19')},'lastPauseAt':{'type':Sequelize[_0x7497('0x1a')]},'chatCapacity':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x7497('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x7497('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![],'defaultValue':_0x7497('0x1b')},'ipaddr':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x7497('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x7497('0x1c')]('friend','user','peer'),'allowNull':!![],'defaultValue':_0x7497('0x1d')},'context':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x1e'),_0x7497('0x1f'),'ALLOWED_FAILED_SCREEN',_0x7497('0x20'),_0x7497('0x21'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x7497('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0x2326b8){this[_0x7497('0x7')]('transport',_0x2326b8?_0x2326b8['join'](','):null);},'get':function(){return this[_0x7497('0x17')]('transport')?this['getDataValue'](_0x7497('0x23'))[_0x7497('0x24')](','):null;},'comment':_0x7497('0x25')},'dtmfmode':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x26'),_0x7497('0x27'),_0x7497('0x28'),_0x7497('0x29'),_0x7497('0x2a')),'allowNull':!![],'defaultValue':_0x7497('0x26')},'directmedia':{'type':Sequelize[_0x7497('0x1c')]('yes','no',_0x7497('0x2b'),'update',_0x7497('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7497('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![],'defaultValue':_0x7497('0x2d'),'set':function(_0x4b7e2c){this[_0x7497('0x7')](_0x7497('0x2e'),_0x4b7e2c?_0x4b7e2c[_0x7497('0x2f')](','):null);},'get':function(){return this[_0x7497('0x17')]('nat')?this['getDataValue'](_0x7497('0x2e'))[_0x7497('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x7497('0x5')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x7497('0x5')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7497('0x5')]},'disallow':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'defaultValue':_0x7497('0x30')},'allow':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1ca97d){this[_0x7497('0x7')](_0x7497('0x31'),_0x1ca97d?_0x1ca97d['join'](';'):_0x7497('0x32'));},'get':function(){return this[_0x7497('0x17')]('allow')?this[_0x7497('0x17')](_0x7497('0x31'))[_0x7497('0x24')](';'):null;},'comment':_0x7497('0x33')},'autoframing':{'type':Sequelize['ENUM'](_0x7497('0x34'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x19d86c){this[_0x7497('0x7')](_0x7497('0x35'),_0x19d86c?_0x19d86c[_0x7497('0x2f')](','):null);},'get':function(){return this[_0x7497('0x17')](_0x7497('0x35'))?this[_0x7497('0x17')](_0x7497('0x35'))[_0x7497('0x24')](','):null;},'comment':_0x7497('0x36')},'trustrpid':{'type':Sequelize[_0x7497('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no',_0x7497('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x7497('0x34'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x7497('0x34'),'no'),'allowNull':!![],'defaultValue':_0x7497('0x34')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no',_0x7497('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x7497('0x39'),_0x7497('0x3a'),_0x7497('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x7497('0x1c')]('uac','uas'),'allowNull':!![],'defaultValue':_0x7497('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x7497('0x1c')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no',_0x7497('0x3d'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x3e'),_0x7497('0x3f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x7497('0x34'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no','nonat','update',_0x7497('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x7497('0x1a')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x31cfaa){this[_0x7497('0x7')](_0x7497('0x41'),_0x31cfaa);var _0x4716ba=this[_0x7497('0x42')]({'plain':!![]});switch(_0x31cfaa){case 0x0:case 0x1:var _0x4524d0=_0x4716ba[_0x7497('0x23')]?_['isArray'](_0x4716ba['transport'])?_0x4716ba['transport'][_0x7497('0x2f')]():_0x4716ba[_0x7497('0x23')]:'udp';if(_0x4524d0===_0x7497('0x43')){_0x4524d0=_0x7497('0x44');}this['setDataValue']('transport',_0x4524d0);this[_0x7497('0x7')](_0x7497('0x45'),'no');this[_0x7497('0x7')]('avpf',null);this[_0x7497('0x7')]('force_avp',null);this[_0x7497('0x7')](_0x7497('0x46'),null);this[_0x7497('0x7')]('dtlsenable',null);this[_0x7497('0x7')](_0x7497('0x47'),null);this[_0x7497('0x7')](_0x7497('0x48'),null);this[_0x7497('0x7')](_0x7497('0x49'),null);this[_0x7497('0x7')]('dtlsprivatekey',null);this[_0x7497('0x7')](_0x7497('0x4a'),'no');break;case 0x2:this['setDataValue'](_0x7497('0x23'),'wss');this['setDataValue'](_0x7497('0x45'),'yes');this[_0x7497('0x7')](_0x7497('0x4b'),_0x7497('0x34'));this[_0x7497('0x7')]('force_avp',_0x7497('0x34'));this[_0x7497('0x7')](_0x7497('0x46'),_0x7497('0x34'));this[_0x7497('0x7')](_0x7497('0x4c'),_0x7497('0x34'));this['setDataValue'](_0x7497('0x47'),'no');this[_0x7497('0x7')](_0x7497('0x48'),_0x7497('0x4d'));this[_0x7497('0x7')](_0x7497('0x49'),_0x4716ba[_0x7497('0x49')]||_0x7497('0x4e'));this[_0x7497('0x7')]('dtlsprivatekey',_0x4716ba[_0x7497('0x4f')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x7497('0x4a'),_0x7497('0x34'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x5578ec){this[_0x7497('0x7')]('permissions',_0x5578ec?_0x5578ec['join'](','):[]);},'get':function(){return this[_0x7497('0x17')](_0x7497('0x50'))?_[_0x7497('0x51')](this[_0x7497('0x17')](_0x7497('0x50'))[_0x7497('0x24')](','),function(_0x59e004){return parseInt(_0x59e004,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x7497('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x7497('0x5')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x7497('0x18')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x7497('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x7497('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize[_0x7497('0x1a')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x7497('0x52')],'get':function(){return this[_0x7497('0x17')](_0x7497('0x53'))?this[_0x7497('0x17')](_0x7497('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x1eb6c3){if(typeof _0x1eb6c3===_0x7497('0x54')){var _0x59a692=_0x1eb6c3==='1'?!![]:_0x1eb6c3==='0'?![]:_0x1eb6c3===_0x7497('0x55')?!![]:_0x1eb6c3===_0x7497('0x56')?![]:![];this['setDataValue']('screenrecording',_0x59a692);}else{this[_0x7497('0x7')](_0x7497('0x57'),_0x1eb6c3);}}}};
\ No newline at end of file
+var _0x5093=['sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','user','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','nonat','update','outgoing','nat','join','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','get','isArray','wss','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlsprivatekey','rtcp_mux','force_avp','dtlscertfile','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false'];(function(_0x2379a1,_0x554793){var _0x1df2c0=function(_0x28edd8){while(--_0x28edd8){_0x2379a1['push'](_0x2379a1['shift']());}};_0x1df2c0(++_0x554793);}(_0x5093,0x102));var _0x3509=function(_0x5b8310,_0x77ea6f){_0x5b8310=_0x5b8310-0x0;var _0xd3ebc1=_0x5093[_0x5b8310];return _0xd3ebc1;};'use strict';var Sequelize=require(_0x3509('0x0'));var moment=require(_0x3509('0x1'));var util=require(_0x3509('0x2'));var _=require('lodash');module[_0x3509('0x3')]={'name':{'type':Sequelize[_0x3509('0x4')],'allowNull':![],'unique':_0x3509('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2a345c){this['setDataValue'](_0x3509('0x5'),_0x2a345c);this[_0x3509('0x6')](_0x3509('0x7'),_0x2a345c);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5dde87){this[_0x3509('0x6')](_0x3509('0x8'),_0x5dde87);this['setDataValue'](_0x3509('0x9'),util[_0x3509('0xa')](_0x3509('0xb'),_0x5dde87,this[_0x3509('0xc')](_0x3509('0xd'))));}},'alias':{'type':Sequelize[_0x3509('0x4')]},'email':{'type':Sequelize[_0x3509('0x4')],'allowNull':![],'unique':_0x3509('0xe'),'validate':{'isEmail':!![]},'set':function(_0x592a54){if(_0x592a54){this[_0x3509('0x6')](_0x3509('0xe'),_0x592a54[_0x3509('0xf')]());}}},'role':{'type':Sequelize['ENUM'](_0x3509('0x10'),_0x3509('0x11'),_0x3509('0x12'),_0x3509('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x3509('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x3509('0x4')],'defaultValue':_0x3509('0x14')},'internal':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':![],'unique':_0x3509('0xd'),'set':function(_0x636ad4){this['setDataValue']('internal',_0x636ad4);this[_0x3509('0x6')](_0x3509('0x16'),_0x636ad4);this[_0x3509('0x6')]('callerid',util[_0x3509('0xa')]('\x22%s\x22\x20<%s>',this['getDataValue'](_0x3509('0x8')),_0x636ad4));}},'salt':{'type':Sequelize[_0x3509('0x4')]},'phone':{'type':Sequelize[_0x3509('0x4')]},'mobile':{'type':Sequelize[_0x3509('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x3509('0x4')]},'userpic':{'type':Sequelize[_0x3509('0x4')]},'city':{'type':Sequelize[_0x3509('0x4')]},'country':{'type':Sequelize[_0x3509('0x4')]},'online':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x3509('0x18')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x3509('0x4')],'defaultValue':_0x3509('0x19')},'lastPauseAt':{'type':Sequelize[_0x3509('0x18')]},'chatCapacity':{'type':Sequelize[_0x3509('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x3509('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x3509('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x3509('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x3509('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![],'defaultValue':_0x3509('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x3509('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x3509('0x1b'),_0x3509('0x11'),'peer'),'allowNull':!![],'defaultValue':_0x3509('0x1b')},'context':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x1d'),_0x3509('0x1e'),'ALLOWED_FAILED_SCREEN',_0x3509('0x1f'),_0x3509('0x20'),_0x3509('0x21'),_0x3509('0x22'),_0x3509('0x23')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![],'defaultValue':_0x3509('0x24'),'set':function(_0x4b7ee4){this[_0x3509('0x6')]('transport',_0x4b7ee4?_0x4b7ee4['join'](','):null);},'get':function(){return this[_0x3509('0xc')](_0x3509('0x25'))?this[_0x3509('0xc')]('transport')[_0x3509('0x26')](','):null;},'comment':_0x3509('0x27')},'dtmfmode':{'type':Sequelize['ENUM'](_0x3509('0x28'),_0x3509('0x29'),'shortinfo','inband',_0x3509('0x2a')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no',_0x3509('0x2c'),_0x3509('0x2d'),_0x3509('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0xeb34f1){this[_0x3509('0x6')](_0x3509('0x2f'),_0xeb34f1?_0xeb34f1[_0x3509('0x30')](','):null);},'get':function(){return this[_0x3509('0xc')](_0x3509('0x2f'))?this[_0x3509('0xc')]('nat')[_0x3509('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x3509('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x3509('0x4')]},'language':{'type':Sequelize[_0x3509('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3509('0x4')]},'disallow':{'type':Sequelize[_0x3509('0x4')],'allowNull':![],'defaultValue':_0x3509('0x31')},'allow':{'type':Sequelize[_0x3509('0x4')],'allowNull':![],'defaultValue':_0x3509('0x32'),'set':function(_0x146f61){this[_0x3509('0x6')](_0x3509('0x33'),_0x146f61?_0x146f61['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x3509('0xc')](_0x3509('0x33'))?this[_0x3509('0xc')]('allow')[_0x3509('0x26')](';'):null;},'comment':_0x3509('0x34')},'autoframing':{'type':Sequelize['ENUM'](_0x3509('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![],'set':function(_0x423324){this['setDataValue']('insecure',_0x423324?_0x423324['join'](','):null);},'get':function(){return this[_0x3509('0xc')]('insecure')?this[_0x3509('0xc')]('insecure')['split'](','):null;},'comment':_0x3509('0x35')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x3509('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x3509('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3509('0x36')},'amaflags':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x3509('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':_0x3509('0x2b')},'busylevel':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x3509('0x1c')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no',_0x3509('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x38'),'refuse',_0x3509('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x3a'),_0x3509('0x3b')),'allowNull':!![],'defaultValue':_0x3509('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x3509('0x1c')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x3509('0x1c')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x3509('0x2b'),'no',_0x3509('0x3c'),_0x3509('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x3509('0x3e'),_0x3509('0x3f'),_0x3509('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x3509('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x3509('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x3509('0x1c')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no',_0x3509('0x2c'),_0x3509('0x2d'),_0x3509('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x3509('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0x3509('0x15')],'defaultValue':0x0,'set':function(_0x1201b8){this[_0x3509('0x6')](_0x3509('0x42'),_0x1201b8);var _0x571e11=this[_0x3509('0x43')]({'plain':!![]});switch(_0x1201b8){case 0x0:case 0x1:var _0x9be177=_0x571e11[_0x3509('0x25')]?_[_0x3509('0x44')](_0x571e11[_0x3509('0x25')])?_0x571e11[_0x3509('0x25')]['join']():_0x571e11[_0x3509('0x25')]:_0x3509('0x24');if(_0x9be177===_0x3509('0x45')){_0x9be177=_0x3509('0x24');}this[_0x3509('0x6')](_0x3509('0x25'),_0x9be177);this['setDataValue'](_0x3509('0x46'),'no');this[_0x3509('0x6')](_0x3509('0x47'),null);this['setDataValue']('force_avp',null);this[_0x3509('0x6')](_0x3509('0x48'),null);this[_0x3509('0x6')](_0x3509('0x49'),null);this[_0x3509('0x6')](_0x3509('0x4a'),null);this['setDataValue']('dtlssetup',null);this[_0x3509('0x6')]('dtlscertfile',null);this['setDataValue'](_0x3509('0x4b'),null);this[_0x3509('0x6')](_0x3509('0x4c'),'no');break;case 0x2:this[_0x3509('0x6')](_0x3509('0x25'),_0x3509('0x45'));this[_0x3509('0x6')]('encryption',_0x3509('0x2b'));this[_0x3509('0x6')](_0x3509('0x47'),_0x3509('0x2b'));this[_0x3509('0x6')](_0x3509('0x4d'),_0x3509('0x2b'));this['setDataValue'](_0x3509('0x48'),_0x3509('0x2b'));this['setDataValue'](_0x3509('0x49'),_0x3509('0x2b'));this['setDataValue'](_0x3509('0x4a'),'no');this[_0x3509('0x6')]('dtlssetup',_0x3509('0x40'));this['setDataValue']('dtlscertfile',_0x571e11[_0x3509('0x4e')]||'/etc/pki/tls/certs/motion.crt');this[_0x3509('0x6')](_0x3509('0x4b'),_0x571e11[_0x3509('0x4b')]||'/etc/pki/tls/private/motion.key');this['setDataValue']('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x17dd3b){this['setDataValue'](_0x3509('0x4f'),_0x17dd3b?_0x17dd3b[_0x3509('0x30')](','):[]);},'get':function(){return this[_0x3509('0xc')](_0x3509('0x4f'))?_[_0x3509('0x50')](this[_0x3509('0xc')](_0x3509('0x4f'))[_0x3509('0x26')](','),function(_0x431b76){return parseInt(_0x431b76,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x3509('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x3509('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x3509('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x3509('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x3509('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x3509('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x3509('0x1c')](_0x3509('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x3509('0x4')]},'passwordResetAt':{'type':Sequelize[_0x3509('0x18')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x3509('0x51')],'get':function(){return this[_0x3509('0xc')](_0x3509('0x52'))?this['getDataValue'](_0x3509('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x3509('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x3509('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x3509('0x17')],'defaultValue':![],'set':function(_0x1103fa){if(typeof _0x1103fa===_0x3509('0x53')){var _0x15de0c=_0x1103fa==='1'?!![]:_0x1103fa==='0'?![]:_0x1103fa===_0x3509('0x54')?!![]:_0x1103fa===_0x3509('0x55')?![]:![];this[_0x3509('0x6')]('screenrecording',_0x15de0c);}else{this[_0x3509('0x6')]('screenrecording',_0x1103fa);}}}};
\ No newline at end of file
diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js
index 8e14280..7164b79 100644
--- a/server/api/user/user.controller.js
+++ b/server/api/user/user.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xae21=['toLowerCase','QueueId','emit','Queue:save','VoiceQueue','voice','push','SIP/%s','voicePause','each','UserVoiceQueueRt','upsert','removeQueues','remove','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','server/files/images/','getContacts','pick','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','LOGIN','PAUSE','concat','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','type','unpause','chatPause','faxPause','openchannelPause','smsPause','pauseType','manual','mail','chat','fax','sms','openchannel','%s%s','Pause','getTeams','Team','addTeams','removeTeams','getLists','CmList','getAgents','getVoiceQueues','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','getFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','removeSquareProjects','$gte','$lt','$not','$in','$like','$iLike','$notILike','$overlap','$contains','$contained','CmHopper','firstName','lastName','Contact','dialActive','getApiKey','No\x20API\x20access\x20key\x20found!','createApiKey','apiKeyIat','removeApiKey','apiKeyNonce','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./user.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','save','update','destroy','get','Users','user','Agents','agent','filter','ignore','map','value','includes','role','find','UserProfileResource','stack','name','send','User','model','differenceBy','salt','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','sequelize','lower','col','field','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','password','bulkCreate','body','describe','addContacts','omit','ids','agent\x20role','telephone','admin','getLicense','telephones','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','Setting','findById','securePassword','min_internal','max','isNil','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','from','voicemail','mailbox','VoiceMail','permissions','102','103','110','104','106','107','108','109','Unable\x20to\x20retrieve\x20the\x20current\x20user','Telephones','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','oldPassword','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20one','Sequelize','authenticate','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','Queues','penalty','spread'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0xae21,0xa0));var _0x1ae2=function(_0x1e655b,_0xbaecbc){_0x1e655b=_0x1e655b-0x0;var _0x2ae698=_0xae21[_0x1e655b];return _0x2ae698;};'use strict';var pdf=require(_0x1ae2('0x0'));var emlformat=require(_0x1ae2('0x1'));var rimraf=require(_0x1ae2('0x2'));var zipdir=require(_0x1ae2('0x3'));var jsonpatch=require(_0x1ae2('0x4'));var rp=require(_0x1ae2('0x5'));var moment=require('moment');var BPromise=require(_0x1ae2('0x6'));var Mustache=require(_0x1ae2('0x7'));var util=require('util');var path=require(_0x1ae2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ae2('0x9'));var fs=require('fs');var _=require(_0x1ae2('0xa'));var squel=require(_0x1ae2('0xb'));var crypto=require(_0x1ae2('0xc'));var jsforce=require(_0x1ae2('0xd'));var deskjs=require(_0x1ae2('0xe'));var toCsv=require(_0x1ae2('0xf'));var querystring=require('querystring');var Papa=require(_0x1ae2('0x10'));var Redis=require('ioredis');var authService=require(_0x1ae2('0x11'));var qs=require(_0x1ae2('0x12'));var hardwareService=require(_0x1ae2('0x13'));var logger=require(_0x1ae2('0x14'))(_0x1ae2('0x15'));var utils=require(_0x1ae2('0x16'));var config=require(_0x1ae2('0x17'));var db=require(_0x1ae2('0x18'))['db'];config['redis']=_[_0x1ae2('0x19')](config[_0x1ae2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ae2('0x1a')]));require(_0x1ae2('0x1b'))[_0x1ae2('0x1c')](socket);var jayson=require(_0x1ae2('0x1d'));var client=jayson[_0x1ae2('0x1e')][_0x1ae2('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x42de23,_0x321f68,_0x144ee4){if(_0x144ee4){var _0x330067=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x330067[_0x1ae2('0x20')](_0x321f68)){return _0x42de23;}else{throw new Error(_0x1ae2('0x21'));}}else{return _0x42de23;}}function respondWithRpcPromise(_0x5ee660,_0x6ca6ba,_0x5a97c8,_0x3a4a45){return new BPromise(function(_0x4df182,_0x1a019d){var _0x20c8da=_0x3a4a45||client;return _0x20c8da['request'](_0x5ee660,_0x5a97c8)[_0x1ae2('0x22')](function(_0x132968){logger[_0x1ae2('0x23')](_0x1ae2('0x24'),_0x6ca6ba,_0x1ae2('0x25'));logger[_0x1ae2('0x26')](_0x1ae2('0x27'),_0x6ca6ba,'request\x20sent',JSON[_0x1ae2('0x28')](_0x132968));if(_0x132968[_0x1ae2('0x29')]){if(_0x132968['error'][_0x1ae2('0x2a')]===0x1f4){logger[_0x1ae2('0x29')](_0x1ae2('0x24'),_0x6ca6ba,_0x132968[_0x1ae2('0x29')]['message']);return _0x1a019d(_0x132968[_0x1ae2('0x29')][_0x1ae2('0x2b')]);}logger[_0x1ae2('0x29')]('User,\x20%s,\x20%s',_0x6ca6ba,_0x132968[_0x1ae2('0x29')][_0x1ae2('0x2b')]);return _0x4df182(_0x132968[_0x1ae2('0x29')]['message']);}else{logger[_0x1ae2('0x23')](_0x1ae2('0x24'),_0x6ca6ba,'request\x20sent');_0x4df182(_0x132968[_0x1ae2('0x2c')][_0x1ae2('0x2b')]);}})[_0x1ae2('0x2d')](function(_0x5b43e3){logger['error'](_0x1ae2('0x24'),_0x6ca6ba,_0x5b43e3);_0x1a019d(_0x5b43e3);});});}function respondWithStatusCode(_0xbd7dae,_0x3a17e3){_0x3a17e3=_0x3a17e3||0xcc;return function(_0x49d7a7){if(_0x49d7a7){return _0xbd7dae[_0x1ae2('0x2e')](_0x3a17e3);}return _0xbd7dae['status'](_0x3a17e3)[_0x1ae2('0x2f')]();};}function respondWithResult(_0x515aac,_0x34cb1d){_0x34cb1d=_0x34cb1d||0xc8;return function(_0x1a2575){if(_0x1a2575){return _0x515aac[_0x1ae2('0x30')](_0x34cb1d)[_0x1ae2('0x31')](_0x1a2575);}};}function respondWithFilteredResult(_0x2591aa,_0x155819){return function(_0x3707cf){if(_0x3707cf){var _0x587d42=_0x3707cf['count'],_0x136b94=_0x155819[_0x1ae2('0x32')],_0x32863a=_0x155819[_0x1ae2('0x32')]+_0x155819[_0x1ae2('0x33')],_0x23dc8b;if(_0x32863a>=_0x587d42){_0x32863a=_0x587d42;_0x23dc8b=0xc8;}else{_0x23dc8b=0xce;}_0x2591aa['status'](_0x23dc8b);return _0x2591aa[_0x1ae2('0x34')](_0x1ae2('0x35'),_0x136b94+'-'+_0x32863a+'/'+_0x587d42)[_0x1ae2('0x31')](_0x3707cf);}return null;};}function patchUpdates(_0x593555){return function(_0x4f8193){try{jsonpatch[_0x1ae2('0x36')](_0x4f8193,_0x593555,!![]);}catch(_0x4390e8){return BPromise['reject'](_0x4390e8);}return _0x4f8193[_0x1ae2('0x37')]();};}function saveUpdates(_0x32bc8a,_0x5634c5){return function(_0x41e197){if(_0x41e197){return _0x41e197[_0x1ae2('0x38')](_0x32bc8a)[_0x1ae2('0x22')](function(_0x1d118d){return _0x1d118d;});}return null;};}function removeEntity(_0x526d17,_0x553694){return function(_0x30b3fd){if(_0x30b3fd){return _0x30b3fd[_0x1ae2('0x39')]()[_0x1ae2('0x22')](function(){var _0x2bde1e=_0x30b3fd[_0x1ae2('0x3a')]({'plain':!![]});var _0x17965a=[{'name':_0x1ae2('0x3b'),'value':_0x1ae2('0x3c'),'ignore':!![]},{'name':_0x1ae2('0x3d'),'value':_0x1ae2('0x3e'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x2bd6fb=_(_0x17965a)[_0x1ae2('0x3f')](_0x1ae2('0x40'))[_0x1ae2('0x41')](_0x1ae2('0x42'))[_0x1ae2('0x42')]();if(_[_0x1ae2('0x43')](_0x2bd6fb,_0x2bde1e[_0x1ae2('0x44')])){return;}var _0x2ed9ce=_[_0x1ae2('0x45')](_0x17965a,['value',_0x2bde1e[_0x1ae2('0x44')]])['name'];return db[_0x1ae2('0x46')][_0x1ae2('0x39')]({'where':{'type':_0x2ed9ce,'resourceId':_0x2bde1e['id']}})[_0x1ae2('0x22')](function(){return _0x30b3fd;});})[_0x1ae2('0x22')](function(){_0x526d17[_0x1ae2('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2398fc,_0x565a0b){return function(_0xecb5f2){if(!_0xecb5f2){_0x2398fc[_0x1ae2('0x2e')](0x194);}return _0xecb5f2;};}function handleError(_0x2339f9,_0x3e2566){_0x3e2566=_0x3e2566||0x1f4;return function(_0x15a558){logger[_0x1ae2('0x29')](_0x15a558[_0x1ae2('0x47')]);if(_0x15a558[_0x1ae2('0x48')]){delete _0x15a558['name'];}_0x2339f9[_0x1ae2('0x30')](_0x3e2566)[_0x1ae2('0x49')](_0x15a558);};}exports['index']=function(_0x206718,_0x23e5ea){var _0x1956ef={},_0x24fe93={},_0x5b5227={'count':0x0,'rows':[]};var _0xa29bd6=db[_0x1ae2('0x4a')]['rawAttributes'];_0x24fe93[_0x1ae2('0x4b')]=_[_0x1ae2('0x4c')](_['keys'](_0xa29bd6),['password',_0x1ae2('0x4d')]);_0x24fe93[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x206718[_0x1ae2('0x4e')]);_0x24fe93[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x24fe93['model'],_0x24fe93[_0x1ae2('0x4e')]);_0x1956ef[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x24fe93[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x206718['query'][_0x1ae2('0x53')]));_0x1956ef[_0x1ae2('0x52')]=_0x1956ef[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x1956ef[_0x1ae2('0x52')]:_0x24fe93[_0x1ae2('0x4b')];if(!_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x55')]('nolimit')){_0x1956ef[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x1956ef['offset']=qs[_0x1ae2('0x32')](_0x206718['query'][_0x1ae2('0x32')]);}_0x1956ef[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x1956ef[_0x1ae2('0x58')]=qs['filters'](_['pick'](_0x206718[_0x1ae2('0x4e')],_0x24fe93[_0x1ae2('0x50')]));if(_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x1956ef[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x1956ef[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0xa29bd6,function(_0x5f1a63){return db[_0x1ae2('0x5a')][_0x1ae2('0x58')](db[_0x1ae2('0x5a')]['fn'](_0x1ae2('0x5b'),db[_0x1ae2('0x5a')][_0x1ae2('0x5c')](_0x5f1a63[_0x1ae2('0x5d')])),{'$like':db[_0x1ae2('0x5a')]['fn'](_0x1ae2('0x5b'),'%'+_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%')});})});}_0x1956ef=_[_0x1ae2('0x59')]({},_0x1956ef,_0x206718[_0x1ae2('0x5e')]);var _0x85fc96={'where':_0x1956ef['where']};return db[_0x1ae2('0x4a')][_0x1ae2('0x5f')](_0x85fc96)[_0x1ae2('0x22')](function(_0x507308){_0x5b5227[_0x1ae2('0x5f')]=_0x507308;if(_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x60')]){_0x1956ef[_0x1ae2('0x61')]=[{'all':!![]}];}return db[_0x1ae2('0x4a')][_0x1ae2('0x62')](_0x1956ef);})[_0x1ae2('0x22')](function(_0x470b5b){_0x5b5227[_0x1ae2('0x63')]=_0x470b5b;return _0x5b5227;})[_0x1ae2('0x22')](respondWithFilteredResult(_0x23e5ea,_0x1956ef))['catch'](handleError(_0x23e5ea,null));};exports[_0x1ae2('0x64')]=function(_0x999c58,_0x1fea33){var _0x3adced={'raw':![],'where':{'id':_0x999c58[_0x1ae2('0x65')]['id']}},_0x521d87={};_0x521d87[_0x1ae2('0x4b')]=_['differenceBy'](_[_0x1ae2('0x4f')](db[_0x1ae2('0x4a')][_0x1ae2('0x66')]),[_0x1ae2('0x67'),_0x1ae2('0x4d')]);_0x521d87[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x999c58['query']);_0x521d87[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x521d87['model'],_0x521d87[_0x1ae2('0x4e')]);_0x3adced[_0x1ae2('0x52')]=_['intersection'](_0x521d87['model'],qs[_0x1ae2('0x53')](_0x999c58[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x3adced[_0x1ae2('0x52')]=_0x3adced[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x3adced[_0x1ae2('0x52')]:_0x521d87[_0x1ae2('0x4b')];if(_0x999c58[_0x1ae2('0x4e')][_0x1ae2('0x60')]){_0x3adced[_0x1ae2('0x61')]=[{'all':!![]}];}_0x3adced=_['merge']({},_0x3adced,_0x999c58['options']);return db['User'][_0x1ae2('0x45')](_0x3adced)['then'](handleEntityNotFound(_0x1fea33,null))[_0x1ae2('0x22')](respondWithResult(_0x1fea33,null))[_0x1ae2('0x2d')](handleError(_0x1fea33,null));};exports[_0x1ae2('0x68')]=function(_0x5ce68b,_0x14869b){return db[_0x1ae2('0x4a')][_0x1ae2('0x68')](_0x5ce68b[_0x1ae2('0x69')],{'raw':![],'individualHooks':!![]})[_0x1ae2('0x22')](respondWithResult(_0x14869b,0xc9))[_0x1ae2('0x2d')](handleError(_0x14869b,null));};exports[_0x1ae2('0x38')]=function(_0xe44647,_0xd1098a){if(_0xe44647['body']['id']){delete _0xe44647[_0x1ae2('0x69')]['id'];}delete _0xe44647['body']['role'];return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0xe44647[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0xd1098a,null))[_0x1ae2('0x22')](saveUpdates(_0xe44647[_0x1ae2('0x69')],null))[_0x1ae2('0x22')](respondWithResult(_0xd1098a,null))[_0x1ae2('0x2d')](handleError(_0xd1098a,null));};exports[_0x1ae2('0x6a')]=function(_0x502f22,_0x3102af){return db[_0x1ae2('0x4a')][_0x1ae2('0x6a')]()[_0x1ae2('0x22')](respondWithResult(_0x3102af,null))[_0x1ae2('0x2d')](handleError(_0x3102af,null));};exports['addContacts']=function(_0x527b17,_0x448a20,_0xcadf2f){return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x527b17[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x448a20,null))['then'](function(_0x3cb462){if(_0x3cb462){return _0x3cb462[_0x1ae2('0x6b')](_0x527b17[_0x1ae2('0x69')]['ids'],_[_0x1ae2('0x6c')](_0x527b17[_0x1ae2('0x69')],[_0x1ae2('0x6d'),'id'])||{});}})[_0x1ae2('0x22')](respondWithResult(_0x448a20,null))[_0x1ae2('0x2d')](handleError(_0x448a20,null));};var getLicense=function(_0x3114a2){return new BPromise(function(_0xf7a68,_0x4bbf30){var _0x177ea4=0x0;_0x3114a2[_0x1ae2('0x69')][_0x1ae2('0x44')]===_0x1ae2('0x3e')&&_0xf7a68(_0x1ae2('0x6e'));return db[_0x1ae2('0x4a')][_0x1ae2('0x5f')]({'where':{'$or':[{'role':_0x3114a2[_0x1ae2('0x69')][_0x1ae2('0x44')]===_0x1ae2('0x6f')?_0x1ae2('0x6f'):[_0x1ae2('0x70'),_0x1ae2('0x3c')]}]}})[_0x1ae2('0x22')](function(_0x21703e){_0x177ea4=_0x21703e;return require('../../config/license/util')[_0x1ae2('0x71')]();})[_0x1ae2('0x22')](function(_0x479bf8){var _0x1e2c55=_0x3114a2[_0x1ae2('0x69')][_0x1ae2('0x44')]==='telephone'?_0x1ae2('0x72'):'users';if(!_['isNil'](_0x479bf8[_0x1e2c55])&&_0x177ea4>=_0x479bf8[_0x1e2c55]){return _0x4bbf30({'message':_0x1ae2('0x73')});}return _0xf7a68(util[_0x1ae2('0x74')](_0x1ae2('0x75'),_0x1e2c55,_0x177ea4));})[_0x1ae2('0x2d')](function(_0x13c55c){return _0x4bbf30(_0x13c55c);});});};exports[_0x1ae2('0x76')]=function(_0x2038c3,_0x2780f1){return getLicense(_0x2038c3)[_0x1ae2('0x22')](function(_0x246258){if(!_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')]){var _0x276f67;return db[_0x1ae2('0x78')][_0x1ae2('0x79')](0x1)['then'](function(_0x2207e4){_0x2207e4[_0x1ae2('0x7a')]=!![];return checkPasswordPattern(_0x2207e4,_0x2038c3[_0x1ae2('0x69')]['password'],_0x2207e4[_0x1ae2('0x7a')]);})[_0x1ae2('0x22')](function(_0x380234){_0x276f67=_0x380234[_0x1ae2('0x7b')];return db[_0x1ae2('0x4a')][_0x1ae2('0x7c')](_0x1ae2('0x77'));})[_0x1ae2('0x22')](function(_0x5e06ce){if(_[_0x1ae2('0x7d')](_0x5e06ce)){if(_0x276f67){_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')]=_0x276f67;}else{_0x2038c3['body'][_0x1ae2('0x77')]=0x1;}}else{if(_[_0x1ae2('0x7d')](_0x276f67)||_0x276f67==_0x5e06ce){_0x2038c3['body'][_0x1ae2('0x77')]=_0x5e06ce+0x1;}else if(_0x276f67>_0x5e06ce){_0x2038c3[_0x1ae2('0x69')]['internal']=_0x276f67;}else{return db[_0x1ae2('0x5a')][_0x1ae2('0x4e')](_0x1ae2('0x7e'),{'type':db['sequelize']['QueryTypes'][_0x1ae2('0x7f')]})[_0x1ae2('0x22')](function(_0x5ed24c){if(_0x5ed24c&&_0x5ed24c[_0x1ae2('0x54')]){for(var _0x52cfdd=0x0,_0x4819ab=_0x5ed24c[_0x1ae2('0x54')];_0x52cfdd<_0x4819ab&&_[_0x1ae2('0x7d')](_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')]);_0x52cfdd++){if(_0x276f67<=_0x5ed24c[_0x52cfdd][_0x1ae2('0x80')]){_0x2038c3[_0x1ae2('0x69')]['internal']=_0x5ed24c[_0x52cfdd][_0x1ae2('0x80')];}else if(_0x276f67>_0x5ed24c[_0x52cfdd]['from']&&_0x276f67<=_0x5ed24c[_0x52cfdd]['to']){_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')]=_0x276f67;}}}if(_[_0x1ae2('0x7d')](_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')])){_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')]=_0x5e06ce+0x1;}});}}});}})[_0x1ae2('0x22')](function(){if(_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x81')]){_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x82')]=_0x2038c3[_0x1ae2('0x69')]['internal'];_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x83')]={'mailbox':_0x2038c3['body'][_0x1ae2('0x77')],'password':_0x2038c3[_0x1ae2('0x69')]['password'],'fullname':_0x2038c3[_0x1ae2('0x69')]['fullname'],'email':_0x2038c3[_0x1ae2('0x69')]['email']};}if(_0x2038c3[_0x1ae2('0x69')]&&_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x44')]===_0x1ae2('0x3e')){_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x84')]=['101',_0x1ae2('0x85'),_0x1ae2('0x86'),_0x1ae2('0x87'),_0x1ae2('0x88'),'105',_0x1ae2('0x89'),_0x1ae2('0x8a'),_0x1ae2('0x8b'),_0x1ae2('0x8c'),'100','111'];}return db[_0x1ae2('0x4a')][_0x1ae2('0x76')](_0x2038c3[_0x1ae2('0x69')],{'include':[{'model':db[_0x1ae2('0x83')],'as':_0x1ae2('0x83')}]});})[_0x1ae2('0x22')](function(_0x2adf64){if(_0x2038c3['body']['role']===_0x1ae2('0x3c'))return _0x2adf64;var _0x191b35=_0x2038c3[_0x1ae2('0x3c')][_0x1ae2('0x3a')]({'plain':!![]});if(!_0x191b35)throw new Error(_0x1ae2('0x8d'));if(_0x191b35[_0x1ae2('0x44')]==='user'){var _0x7d1374=_0x2adf64[_0x1ae2('0x3a')]({'plain':!![]});var _0x3527f1=[{'name':_0x1ae2('0x3d'),'value':_0x1ae2('0x3e')},{'name':_0x1ae2('0x8e'),'value':'telephone'}];var _0x471446=_['find'](_0x3527f1,[_0x1ae2('0x42'),_0x7d1374[_0x1ae2('0x44')]])[_0x1ae2('0x48')];return db[_0x1ae2('0x8f')]['find']({'where':{'name':_0x471446,'userProfileId':_0x191b35['userProfileId']},'raw':!![]})[_0x1ae2('0x22')](function(_0x27ed09){if(_0x27ed09&&_0x27ed09['autoAssociation']===0x0){return db[_0x1ae2('0x46')][_0x1ae2('0x76')]({'name':_0x7d1374[_0x1ae2('0x48')],'resourceId':_0x7d1374['id'],'type':_0x27ed09[_0x1ae2('0x48')],'sectionId':_0x27ed09['id']},{})[_0x1ae2('0x22')](function(){return _0x2adf64;});}else{return _0x2adf64;}})[_0x1ae2('0x2d')](function(_0x58fe89){logger[_0x1ae2('0x29')](_0x1ae2('0x90'),_0x58fe89);throw _0x58fe89;});}return _0x2adf64;})[_0x1ae2('0x22')](respondWithResult(_0x2780f1,0xc9))['catch'](handleError(_0x2780f1,null));};exports[_0x1ae2('0x91')]=function(_0x5c7fc0,_0x106ae1,_0x143a0e){var _0x2b6c75=![];if(_0x5c7fc0[_0x1ae2('0x69')]['id']){delete _0x5c7fc0[_0x1ae2('0x69')]['id'];}if(!_['isNil'](_0x5c7fc0[_0x1ae2('0x69')]['oldPassword'])){if(_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x92')]===_0x5c7fc0['body'][_0x1ae2('0x93')]){throw new Error(_0x1ae2('0x94'));}}return db['User'][_0x1ae2('0x45')]({'where':{'id':_0x5c7fc0['params']['id']}})['then'](function(_0x23d2e9){if(_0x23d2e9){if(_0x23d2e9['id']==_0x5c7fc0[_0x1ae2('0x3c')]['id']){if(!_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x92')]||!_0x5c7fc0['body'][_0x1ae2('0x93')]){throw new db[(_0x1ae2('0x95'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x23d2e9[_0x1ae2('0x96')](_0x5c7fc0['body'][_0x1ae2('0x92')])){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0x98'));}if(_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x92')]==_0x5c7fc0['body'][_0x1ae2('0x93')]){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0x99'));}return _0x23d2e9;}else if(_0x5c7fc0[_0x1ae2('0x3c')][_0x1ae2('0x44')]=='admin'){if(!_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x93')]){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x23d2e9;}else if(_0x5c7fc0[_0x1ae2('0x3c')][_0x1ae2('0x44')]==_0x1ae2('0x3c')){if(!_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x93')]){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0x9a'));}if(_0x23d2e9[_0x1ae2('0x44')]!=_0x1ae2('0x3e')){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0x9b'));}return _0x23d2e9;}else{throw new db[(_0x1ae2('0x95'))]['ValidationError'](_0x1ae2('0x9b'));}}return null;})['then'](handleEntityNotFound(_0x106ae1,null))[_0x1ae2('0x22')](function(_0x17f913){return db[_0x1ae2('0x78')][_0x1ae2('0x9c')]({'attributes':['id','securePassword']})[_0x1ae2('0x22')](function(_0x1dd981){_0x2b6c75=_0x1dd981[_0x1ae2('0x7a')];return checkPasswordPattern(_0x17f913,_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x93')],_0x2b6c75);});})[_0x1ae2('0x22')](saveUpdates({'password':_0x5c7fc0['body'][_0x1ae2('0x93')],'passwordResetAt':_0x5c7fc0[_0x1ae2('0x3c')]['id']==_0x5c7fc0[_0x1ae2('0x65')]['id']?moment():null},null))[_0x1ae2('0x22')](respondWithResult(_0x106ae1,null))[_0x1ae2('0x2d')](handleError(_0x106ae1,null));};exports['addQueues']=function(_0x429fdd,_0x228936,_0x23941a){var _0x5b2430=_0x429fdd[_0x1ae2('0x69')][_0x1ae2('0x9d')];return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x429fdd[_0x1ae2('0x65')]['id']},'attributes':['id',_0x1ae2('0x48'),'role',_0x1ae2('0x9e'),_0x1ae2('0x9f'),'voicePause',_0x1ae2('0xa0')]})[_0x1ae2('0x22')](handleEntityNotFound(_0x228936,null))[_0x1ae2('0x22')](function(_0x1c075b){if(_0x1c075b){if(!utils[_0x1ae2('0xa1')](_0x5b2430)){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0xa2'));}return _0x1c075b[_0x1ae2('0xa3')+_[_0x1ae2('0xa4')](_0x5b2430['toLowerCase']())+_0x1ae2('0xa5')](_0x429fdd[_0x1ae2('0x69')][_0x1ae2('0x6d')],{'penalty':_0x429fdd[_0x1ae2('0x69')][_0x1ae2('0xa6')]||0x0})[_0x1ae2('0xa7')](function(_0x3c618d){for(var _0x103f09=0x0;_0x103f09<_0x429fdd['body'][_0x1ae2('0x6d')][_0x1ae2('0x54')];_0x103f09+=0x1){var _0x175ad8={'UserId':_0x429fdd[_0x1ae2('0x65')]['id']};_0x175ad8[_['capitalize'](_0x5b2430[_0x1ae2('0xa8')]())+_0x1ae2('0xa9')]=_0x429fdd[_0x1ae2('0x69')][_0x1ae2('0x6d')][_0x103f09];socket[_0x1ae2('0xaa')](_0x1ae2('0x3c')+_[_0x1ae2('0xa4')](_0x5b2430[_0x1ae2('0xa8')]())+_0x1ae2('0xab'),_0x175ad8);}return _0x3c618d;})[_0x1ae2('0x22')](function(){if(_0x5b2430==='voice'){return db[_0x1ae2('0xac')][_0x1ae2('0x62')]({'where':{'id':_0x429fdd[_0x1ae2('0x69')][_0x1ae2('0x6d')]||[]},'raw':!![],'attributes':['id',_0x1ae2('0x48')]});}})['then'](function(_0x2faed1){var _0x64a62=_0x1c075b[_0x1ae2('0x3a')]({'plain':!![]});var _0x4523fa=[];if(_0x5b2430===_0x1ae2('0xad')&&_0x64a62[_0x1ae2('0x44')]===_0x1ae2('0x3e')&&_0x64a62[_0x1ae2('0x9e')]){for(var _0xe18ba3=0x0;_0xe18ba3<_0x2faed1['length'];_0xe18ba3+=0x1){_0x4523fa[_0x1ae2('0xae')]({'membername':_0x64a62[_0x1ae2('0x48')],'UserId':_0x64a62['id'],'queue_name':_0x2faed1[_0xe18ba3][_0x1ae2('0x48')],'VoiceQueueId':_0x2faed1[_0xe18ba3]['id'],'interface':_['isNil'](_0x64a62[_0x1ae2('0xa0')])?util[_0x1ae2('0x74')](_0x1ae2('0xaf'),_0x64a62[_0x1ae2('0x48')]):_0x64a62['interface'],'paused':_0x64a62[_0x1ae2('0xb0')]||![],'penalty':_0x429fdd['body'][_0x1ae2('0xa6')]||0x0});}return BPromise[_0x1ae2('0xb1')](_0x4523fa,function(_0x579d8d){return db[_0x1ae2('0xb2')][_0x1ae2('0xb3')](_0x579d8d);});}return _0x1c075b;});}})[_0x1ae2('0x22')](respondWithStatusCode(_0x228936,null))[_0x1ae2('0x2d')](handleError(_0x228936,null));};exports[_0x1ae2('0xb4')]=function(_0xe9c276,_0x4d2b80,_0x56bb8a){var _0x4cb34b;return db['User'][_0x1ae2('0x45')]({'where':{'id':_0xe9c276[_0x1ae2('0x65')]['id']},'attributes':['id',_0x1ae2('0x48'),_0x1ae2('0x44')]})[_0x1ae2('0x22')](handleEntityNotFound(_0x4d2b80,null))[_0x1ae2('0x22')](function(_0x1903dc){if(_0x1903dc){_0x4cb34b=_0x1903dc;if(!_0xe9c276[_0x1ae2('0x4e')]['channel']||!utils['isValidChannel'](_0xe9c276['query'][_0x1ae2('0x9d')])){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0xa2'));}return _0x1903dc[_0x1ae2('0xb5')+_[_0x1ae2('0xa4')](_0xe9c276[_0x1ae2('0x4e')][_0x1ae2('0x9d')][_0x1ae2('0xa8')]())+_0x1ae2('0xa5')](_0xe9c276[_0x1ae2('0x4e')][_0x1ae2('0x6d')]);}})[_0x1ae2('0x22')](function(_0x2d5aa3){for(var _0x1a3905=0x0;_0x1a3905<_0xe9c276[_0x1ae2('0x4e')][_0x1ae2('0x6d')][_0x1ae2('0x54')];_0x1a3905+=0x1){var _0x5ebfbd={'UserId':_0xe9c276[_0x1ae2('0x65')]['id']};_0x5ebfbd[_[_0x1ae2('0xa4')](_0xe9c276[_0x1ae2('0x4e')]['channel'][_0x1ae2('0xa8')]())+_0x1ae2('0xa9')]=_0xe9c276[_0x1ae2('0x4e')][_0x1ae2('0x6d')][_0x1a3905];socket['emit'](_0x1ae2('0x3c')+_[_0x1ae2('0xa4')](_0xe9c276[_0x1ae2('0x4e')]['channel'][_0x1ae2('0xa8')]())+'Queue:remove',_0x5ebfbd);}return _0x2d5aa3;})[_0x1ae2('0x22')](function(){if(_0xe9c276[_0x1ae2('0x4e')][_0x1ae2('0x9d')]===_0x1ae2('0xad')){return db['UserVoiceQueueRt'][_0x1ae2('0x39')]({'where':{'UserId':_0xe9c276[_0x1ae2('0x65')]['id'],'VoiceQueueId':_0xe9c276['query']['ids']},'individualHooks':!![]})[_0x1ae2('0x22')](function(){return _0x4cb34b;});}return _0x4cb34b;})['then'](respondWithStatusCode(_0x4d2b80,null))[_0x1ae2('0x2d')](handleError(_0x4d2b80,null));};exports[_0x1ae2('0xb6')]=function(_0x981575,_0x1c5931,_0x5d9e73){_0x981575['body'][_0x1ae2('0xb7')]=_0x981575[_0x1ae2('0xb8')]['filename'];return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x981575[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x1c5931,null))[_0x1ae2('0x22')](saveUpdates(_0x981575[_0x1ae2('0x69')],null))[_0x1ae2('0x22')](respondWithResult(_0x1c5931,null))[_0x1ae2('0x2d')](handleError(_0x1c5931,null));};exports[_0x1ae2('0xb9')]=function(_0x182953,_0x54cd9c,_0x134d20){var _0x37f4e1=path[_0x1ae2('0xba')](config[_0x1ae2('0xbb')],_0x1ae2('0xbc'));return db['User'][_0x1ae2('0x45')]({'where':{'id':_0x182953[_0x1ae2('0x65')]['id']},'attributes':['id',_0x1ae2('0xb7')],'raw':!![]})[_0x1ae2('0x22')](handleEntityNotFound(_0x54cd9c,null))[_0x1ae2('0x22')](function(_0x24bb17){if(_0x24bb17){if(_[_0x1ae2('0x7d')](_0x24bb17[_0x1ae2('0xb7')])){return _0x54cd9c[_0x1ae2('0xbd')](_0x37f4e1);}else{if(!fs['existsSync'](path['join'](config['root'],_0x1ae2('0xbe'),_0x24bb17['userpic']))){return _0x54cd9c['download'](_0x37f4e1);}return _0x54cd9c['download'](path[_0x1ae2('0xba')](config['root'],_0x1ae2('0xbe'),_0x24bb17[_0x1ae2('0xb7')]));}}})[_0x1ae2('0x2d')](handleError(_0x54cd9c,null));};exports[_0x1ae2('0xbf')]=function(_0x4343e7,_0x24aad7,_0x4de631){var _0x3b9167={};var _0x32f018={};var _0x21e7fc;var _0x6024a1;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x4343e7[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x24aad7,null))[_0x1ae2('0x22')](function(_0x5b1b06){if(_0x5b1b06){_0x21e7fc=_0x5b1b06;_0x32f018[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db['CmContact'][_0x1ae2('0x66')]);_0x32f018['query']=_[_0x1ae2('0x4f')](_0x4343e7[_0x1ae2('0x4e')]);_0x32f018[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x32f018[_0x1ae2('0x4b')],_0x32f018[_0x1ae2('0x4e')]);_0x3b9167['attributes']=_[_0x1ae2('0x51')](_0x32f018['model'],qs[_0x1ae2('0x53')](_0x4343e7[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x3b9167['attributes']=_0x3b9167[_0x1ae2('0x52')]['length']?_0x3b9167[_0x1ae2('0x52')]:_0x32f018[_0x1ae2('0x4b')];_0x3b9167[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x4343e7[_0x1ae2('0x4e')]['sort']);_0x3b9167['where']=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x4343e7[_0x1ae2('0x4e')],_0x32f018[_0x1ae2('0x50')]));if(_0x4343e7[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x3b9167[_0x1ae2('0x58')]=_['merge'](_0x3b9167[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x3b9167[_0x1ae2('0x52')],function(_0x2402ce){var _0x533eb9={};_0x533eb9[_0x2402ce]={'$like':'%'+_0x4343e7['query'][_0x1ae2('0x3f')]+'%'};return _0x533eb9;})});}_0x3b9167=_[_0x1ae2('0x59')]({},_0x3b9167,_0x4343e7['options']);return _0x21e7fc[_0x1ae2('0xbf')](_0x3b9167);}})['then'](function(_0x12af75){if(_0x12af75){_0x6024a1=_0x12af75['length'];if(_0x4343e7[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0x60'))){_0x3b9167['include']=[{'model':db['CmList'],'as':_0x1ae2('0xc1'),'required':![]},{'model':db[_0x1ae2('0xc2')],'as':_0x1ae2('0xc3'),'attributes':['id',_0x1ae2('0x48'),_0x1ae2('0xc4')],'where':_0x4343e7['query'][_0x1ae2('0xc5')]?{'id':_0x4343e7['query'][_0x1ae2('0xc5')]}:undefined,'required':_0x4343e7['query']['tag']?!![]:![]}];}if(!_0x4343e7['query']['hasOwnProperty'](_0x1ae2('0xc6'))){_0x3b9167[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x4343e7[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x3b9167[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x4343e7[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}return _0x21e7fc[_0x1ae2('0xbf')](_0x3b9167);}})[_0x1ae2('0x22')](function(_0x413c58){if(_0x413c58){return _0x413c58?{'count':_0x6024a1,'rows':_0x413c58}:null;}})['then'](respondWithResult(_0x24aad7,null))['catch'](handleError(_0x24aad7,null));};exports[_0x1ae2('0xc7')]=function(_0x53107b,_0x5853f0,_0x441499){var _0x430063;var _0x3cd564;var _0x3dcd4c={};var _0x6f9bb5;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x53107b[_0x1ae2('0x65')]['id']},'attributes':['id',_0x1ae2('0x48'),_0x1ae2('0x44')]})[_0x1ae2('0x22')](handleEntityNotFound(_0x5853f0,null))[_0x1ae2('0x22')](function(_0x42671d){if(!utils[_0x1ae2('0xa1')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x9d')])){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0xa2'));}_0x430063=_0x42671d;var _0x18a259={};_0x18a259[_0x1ae2('0x4b')]=_['keys'](db[_[_0x1ae2('0xa4')](_0x53107b[_0x1ae2('0x4e')]['channel'])+_0x1ae2('0xc8')][_0x1ae2('0x66')]);_0x18a259[_0x1ae2('0x4e')]=_['keys'](_0x53107b[_0x1ae2('0x4e')]);_0x18a259['filters']=_['intersection'](_0x18a259[_0x1ae2('0x4b')],_0x18a259[_0x1ae2('0x4e')]);_0x3dcd4c[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x18a259['model'],qs[_0x1ae2('0x53')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x3dcd4c[_0x1ae2('0x52')]=_0x3dcd4c[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x3dcd4c[_0x1ae2('0x52')]:_0x18a259[_0x1ae2('0x4b')];_0x3dcd4c[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x3dcd4c[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x53107b[_0x1ae2('0x4e')],_0x18a259[_0x1ae2('0x50')]));if(_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x3dcd4c[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x3dcd4c[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x3dcd4c[_0x1ae2('0x52')],function(_0x56341a){var _0x358a37={};_0x358a37[_0x56341a]={'$like':'%'+_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x358a37;})});}_0x3dcd4c=_[_0x1ae2('0x59')]({},_0x3dcd4c,_0x53107b[_0x1ae2('0x5e')]);switch(_0x430063[_0x1ae2('0x44')]){case'admin':return db[_['capitalize'](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x9d')])+_0x1ae2('0xc8')]['findAll'](_0x3dcd4c);case'user':case _0x1ae2('0x3e'):return _0x430063['get'+_[_0x1ae2('0xa4')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x9d')])+'Queues'](_0x3dcd4c);default:throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0xc9'));}})[_0x1ae2('0x22')](function(_0x2d8445){_0x6f9bb5=_0x2d8445[_0x1ae2('0x54')];if(!_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x3dcd4c[_0x1ae2('0x33')]=qs['limit'](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x3dcd4c[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}switch(_0x430063[_0x1ae2('0x44')]){case _0x1ae2('0x70'):return db[_[_0x1ae2('0xa4')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x9d')])+_0x1ae2('0xc8')][_0x1ae2('0x62')](_0x3dcd4c);case _0x1ae2('0x3c'):case'agent':return _0x430063[_0x1ae2('0x3a')+_[_0x1ae2('0xa4')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x9d')])+_0x1ae2('0xa5')](_0x3dcd4c);}})[_0x1ae2('0x22')](function(_0x1009e8){return{'count':_0x6f9bb5,'rows':_0x1009e8};})['then'](respondWithResult(_0x5853f0,null))[_0x1ae2('0x2d')](handleError(_0x5853f0,null));};exports['getVoiceQueuesRt']=function(_0x9922f7,_0x4d990f,_0x57f2b9){var _0x3c7614={};var _0x2d594f={};var _0xdf4935;var _0x1c39f2;return db['User'][_0x1ae2('0x9c')]({'where':{'id':_0x9922f7['params']['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x4d990f,null))[_0x1ae2('0x22')](function(_0x34272c){if(_0x34272c){_0xdf4935=_0x34272c;_0x2d594f[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db[_0x1ae2('0xb2')][_0x1ae2('0x66')]);_0x2d594f[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x9922f7['query']);_0x2d594f[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x2d594f[_0x1ae2('0x4b')],_0x2d594f[_0x1ae2('0x4e')]);_0x3c7614[_0x1ae2('0x52')]=_['intersection'](_0x2d594f[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x9922f7[_0x1ae2('0x4e')]['fields']));_0x3c7614['attributes']=_0x3c7614[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x3c7614[_0x1ae2('0x52')]:_0x2d594f[_0x1ae2('0x4b')];_0x3c7614[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x9922f7[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x3c7614['where']=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x9922f7[_0x1ae2('0x4e')],_0x2d594f[_0x1ae2('0x50')]));if(_0x9922f7[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x3c7614['where']=_[_0x1ae2('0x59')](_0x3c7614['where'],{'$or':_['map'](_0x3c7614[_0x1ae2('0x52')],function(_0x76e7a2){var _0x45d2ee={};_0x45d2ee[_0x76e7a2]={'$like':'%'+_0x9922f7[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x45d2ee;})});}_0x3c7614=_[_0x1ae2('0x59')]({},_0x3c7614,_0x9922f7[_0x1ae2('0x5e')]);return _0xdf4935['getVoiceQueuesRt'](_0x3c7614);}})[_0x1ae2('0x22')](function(_0x59b50a){if(_0x59b50a){_0x1c39f2=_0x59b50a[_0x1ae2('0x54')];if(!_0x9922f7[_0x1ae2('0x4e')]['hasOwnProperty'](_0x1ae2('0xc6'))){_0x3c7614[_0x1ae2('0x33')]=qs['limit'](_0x9922f7[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x3c7614[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x9922f7[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}return _0xdf4935[_0x1ae2('0xca')](_0x3c7614);}})[_0x1ae2('0x22')](function(_0x5b8823){if(_0x5b8823){return _0x5b8823?{'count':_0x1c39f2,'rows':_0x5b8823}:null;}})[_0x1ae2('0x22')](respondWithResult(_0x4d990f,null))['catch'](handleError(_0x4d990f,null));};exports[_0x1ae2('0xcb')]=function(_0x3cb3b4,_0x5d612f,_0x3e0f0f){var _0x44f748={};var _0x5c2651={};var _0x3a6383;var _0x195299;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x3cb3b4['params']['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x5d612f,null))['then'](function(_0xf42e92){if(_0xf42e92){_0x3a6383=_0xf42e92;_0x5c2651['model']=_[_0x1ae2('0x4f')](db['ChatGroup'][_0x1ae2('0x66')]);_0x5c2651[_0x1ae2('0x4e')]=_['keys'](_0x3cb3b4[_0x1ae2('0x4e')]);_0x5c2651[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x5c2651['model'],_0x5c2651[_0x1ae2('0x4e')]);_0x44f748[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x5c2651['model'],qs[_0x1ae2('0x53')](_0x3cb3b4['query'][_0x1ae2('0x53')]));_0x44f748[_0x1ae2('0x52')]=_0x44f748[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x44f748[_0x1ae2('0x52')]:_0x5c2651[_0x1ae2('0x4b')];_0x44f748['order']=qs[_0x1ae2('0x57')](_0x3cb3b4[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x44f748[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_['pick'](_0x3cb3b4['query'],_0x5c2651[_0x1ae2('0x50')]));if(_0x3cb3b4[_0x1ae2('0x4e')]['filter']){_0x44f748[_0x1ae2('0x58')]=_['merge'](_0x44f748['where'],{'$or':_[_0x1ae2('0x41')](_0x44f748[_0x1ae2('0x52')],function(_0x36375a){var _0x1394fb={};_0x1394fb[_0x36375a]={'$like':'%'+_0x3cb3b4['query'][_0x1ae2('0x3f')]+'%'};return _0x1394fb;})});}_0x44f748=_['merge']({},_0x44f748,_0x3cb3b4[_0x1ae2('0x5e')]);return _0x3a6383[_0x1ae2('0xcb')](_0x44f748);}})[_0x1ae2('0x22')](function(_0x5db503){if(_0x5db503){_0x195299=_0x5db503['length'];if(!_0x3cb3b4[_0x1ae2('0x4e')]['hasOwnProperty'](_0x1ae2('0xc6'))){_0x44f748[_0x1ae2('0x33')]=qs['limit'](_0x3cb3b4[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x44f748[_0x1ae2('0x32')]=qs['offset'](_0x3cb3b4[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}return _0x3a6383['getGroups'](_0x44f748);}})['then'](function(_0x2207ec){if(_0x2207ec){return _0x2207ec?{'count':_0x195299,'rows':_0x2207ec}:null;}})[_0x1ae2('0x22')](respondWithResult(_0x5d612f,null))['catch'](handleError(_0x5d612f,null));};exports[_0x1ae2('0xcc')]=function(_0xc5ebbd,_0x2bc980,_0xc50b48){var _0x5cf485={'raw':!![],'where':{}};var _0x3251e9={};var _0x565063={'count':0x0,'rows':[]};return db[_0x1ae2('0x4a')]['findOne']({'where':{'id':_0xc5ebbd[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x2bc980,null))['then'](function(_0x1bea83){if(_0x1bea83){_0x3251e9[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db[_0x1ae2('0xcd')][_0x1ae2('0x66')]);_0x3251e9[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0xc5ebbd[_0x1ae2('0x4e')]);_0x3251e9['filters']=_[_0x1ae2('0x51')](_0x3251e9[_0x1ae2('0x4b')],_0x3251e9[_0x1ae2('0x4e')]);_0x5cf485[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x3251e9['model'],qs[_0x1ae2('0x53')](_0xc5ebbd[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x5cf485[_0x1ae2('0x52')]=_0x5cf485[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x5cf485[_0x1ae2('0x52')]:_0x3251e9[_0x1ae2('0x4b')];if(!_0xc5ebbd['query'][_0x1ae2('0x55')]('nolimit')){_0x5cf485[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0xc5ebbd[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x5cf485['offset']=qs[_0x1ae2('0x32')](_0xc5ebbd['query'][_0x1ae2('0x32')]);}_0x5cf485[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0xc5ebbd[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x5cf485[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0xc5ebbd['query'],_0x3251e9[_0x1ae2('0x50')]));_0x5cf485[_0x1ae2('0x58')][_0x1ae2('0xce')]=_0x1bea83['id'];if(_0xc5ebbd[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x5cf485[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x5cf485[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x5cf485[_0x1ae2('0x52')],function(_0x170dba){var _0x597c28={};_0x597c28[_0x170dba]={'$like':'%'+_0xc5ebbd[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x597c28;})});}_0x5cf485=_[_0x1ae2('0x59')]({},_0x5cf485,_0xc5ebbd[_0x1ae2('0x5e')]);return db[_0x1ae2('0xcd')][_0x1ae2('0x5f')]({'where':_0x5cf485[_0x1ae2('0x58')]})[_0x1ae2('0x22')](function(_0x56314a){_0x565063[_0x1ae2('0x5f')]=_0x56314a;if(_0xc5ebbd['query'][_0x1ae2('0x60')]){_0x5cf485[_0x1ae2('0x61')]=[{'all':!![]}];}return db['VoiceRecording'][_0x1ae2('0x62')](_0x5cf485);})[_0x1ae2('0x22')](function(_0xb08016){_0x565063[_0x1ae2('0x63')]=_0xb08016;return _0x565063;});}})['then'](respondWithFilteredResult(_0x2bc980,_0x5cf485))[_0x1ae2('0x2d')](handleError(_0x2bc980,null));};exports['getScreenRecordings']=function(_0x38eaa0,_0x26bd97,_0x65d881){var _0x420d6c={'raw':!![],'where':{}};var _0x53c434={};var _0x334846={'count':0x0,'rows':[]};return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x38eaa0[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x26bd97,null))['then'](function(_0x222545){if(_0x222545){_0x53c434[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db[_0x1ae2('0xcf')][_0x1ae2('0x66')]);_0x53c434[_0x1ae2('0x4e')]=_['keys'](_0x38eaa0[_0x1ae2('0x4e')]);_0x53c434[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x53c434[_0x1ae2('0x4b')],_0x53c434[_0x1ae2('0x4e')]);_0x420d6c[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x53c434[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x420d6c[_0x1ae2('0x52')]=_0x420d6c[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x420d6c[_0x1ae2('0x52')]:_0x53c434[_0x1ae2('0x4b')];if(!_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x420d6c[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x420d6c['offset']=qs[_0x1ae2('0x32')](_0x38eaa0['query'][_0x1ae2('0x32')]);}_0x420d6c[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x420d6c[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x38eaa0[_0x1ae2('0x4e')],_0x53c434['filters']));_0x420d6c['where'][_0x1ae2('0xce')]=_0x222545['id'];if(_0x38eaa0['query']['filter']){_0x420d6c[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x420d6c[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x420d6c[_0x1ae2('0x52')],function(_0x33be5d){var _0x59e265={};_0x59e265[_0x33be5d]={'$like':'%'+_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x59e265;})});}_0x420d6c=_[_0x1ae2('0x59')]({},_0x420d6c,_0x38eaa0[_0x1ae2('0x5e')]);return db[_0x1ae2('0xcf')]['count']({'where':_0x420d6c['where']})[_0x1ae2('0x22')](function(_0x113489){_0x334846[_0x1ae2('0x5f')]=_0x113489;if(_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x60')]){_0x420d6c['include']=[{'all':!![]}];}return db[_0x1ae2('0xcf')]['findAll'](_0x420d6c);})['then'](function(_0x58da09){_0x334846[_0x1ae2('0x63')]=_0x58da09;return _0x334846;});}})[_0x1ae2('0x22')](respondWithFilteredResult(_0x26bd97,_0x420d6c))[_0x1ae2('0x2d')](handleError(_0x26bd97,null));};exports[_0x1ae2('0xd0')]=function(_0x5b7c13,_0xd92e1c,_0x1840da){var _0x34fa88={};var _0x12950e={};var _0x553548;var _0x5d5bca;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x5b7c13[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0xd92e1c,null))['then'](function(_0x10ce8c){if(_0x10ce8c){_0x553548=_0x10ce8c;_0x12950e['model']=_[_0x1ae2('0x4f')](db['ChatInteraction'][_0x1ae2('0x66')]);_0x12950e[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x5b7c13[_0x1ae2('0x4e')]);_0x12950e[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x12950e[_0x1ae2('0x4b')],_0x12950e['query']);_0x34fa88['attributes']=_[_0x1ae2('0x51')](_0x12950e[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x5b7c13['query']['fields']));_0x34fa88['attributes']=_0x34fa88['attributes'][_0x1ae2('0x54')]?_0x34fa88[_0x1ae2('0x52')]:_0x12950e['model'];_0x34fa88['order']=qs['sort'](_0x5b7c13['query']['sort']);_0x34fa88[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x5b7c13[_0x1ae2('0x4e')],_0x12950e[_0x1ae2('0x50')]));if(_0x5b7c13[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x34fa88[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x34fa88['where'],{'$or':_[_0x1ae2('0x41')](_0x34fa88[_0x1ae2('0x52')],function(_0x5cd45a){var _0xf7e18={};_0xf7e18[_0x5cd45a]={'$like':'%'+_0x5b7c13['query'][_0x1ae2('0x3f')]+'%'};return _0xf7e18;})});}_0x34fa88=_[_0x1ae2('0x59')]({},_0x34fa88,_0x5b7c13['options']);return _0x553548['getChatInteractions'](_0x34fa88);}})['then'](function(_0x5ca5dd){if(_0x5ca5dd){_0x5d5bca=_0x5ca5dd['length'];if(!_0x5b7c13[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x34fa88[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x5b7c13[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x34fa88[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x5b7c13[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}return _0x553548['getChatInteractions'](_0x34fa88);}})[_0x1ae2('0x22')](function(_0xf1513f){if(_0xf1513f){return _0xf1513f?{'count':_0x5d5bca,'rows':_0xf1513f}:null;}})[_0x1ae2('0x22')](respondWithResult(_0xd92e1c,null))[_0x1ae2('0x2d')](handleError(_0xd92e1c,null));};exports[_0x1ae2('0xd1')]=function(_0x3085a1,_0x369d7a,_0x377bd7){var _0x35e526={};var _0x58d9c0={};var _0x2e7409;var _0x2c6813;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x3085a1['params']['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x369d7a,null))[_0x1ae2('0x22')](function(_0xb596b3){if(_0xb596b3){_0x2e7409=_0xb596b3;_0x58d9c0['model']=_[_0x1ae2('0x4f')](db[_0x1ae2('0xd2')]['rawAttributes']);_0x58d9c0[_0x1ae2('0x4e')]=_['keys'](_0x3085a1['query']);_0x58d9c0[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x58d9c0['model'],_0x58d9c0[_0x1ae2('0x4e')]);_0x35e526[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x58d9c0[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x3085a1[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x35e526[_0x1ae2('0x52')]=_0x35e526[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x35e526[_0x1ae2('0x52')]:_0x58d9c0[_0x1ae2('0x4b')];_0x35e526['order']=qs['sort'](_0x3085a1[_0x1ae2('0x4e')]['sort']);_0x35e526[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x3085a1['query'],_0x58d9c0[_0x1ae2('0x50')]));if(_0x3085a1[_0x1ae2('0x4e')]['filter']){_0x35e526[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x35e526[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x35e526[_0x1ae2('0x52')],function(_0x1dabd1){var _0x4781c6={};_0x4781c6[_0x1dabd1]={'$like':'%'+_0x3085a1['query'][_0x1ae2('0x3f')]+'%'};return _0x4781c6;})});}_0x35e526=_[_0x1ae2('0x59')]({},_0x35e526,_0x3085a1[_0x1ae2('0x5e')]);return _0x2e7409[_0x1ae2('0xd1')](_0x35e526);}})[_0x1ae2('0x22')](function(_0x3c97a5){if(_0x3c97a5){_0x2c6813=_0x3c97a5['length'];if(!_0x3085a1['query'][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x35e526[_0x1ae2('0x33')]=qs['limit'](_0x3085a1[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x35e526[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x3085a1[_0x1ae2('0x4e')]['offset']);}return _0x2e7409['getOpenchannelInteractions'](_0x35e526);}})[_0x1ae2('0x22')](function(_0x180afc){if(_0x180afc){return _0x180afc?{'count':_0x2c6813,'rows':_0x180afc}:null;}})['then'](respondWithResult(_0x369d7a,null))[_0x1ae2('0x2d')](handleError(_0x369d7a,null));};exports[_0x1ae2('0xd3')]=function(_0xaa5ba0,_0x324405,_0x32e17b){var _0x50a3bf={'raw':!![],'where':{}};var _0x46a04f={};var _0x516fa7={'count':0x0,'rows':[]};return db['User'][_0x1ae2('0x9c')]({'where':{'id':_0xaa5ba0[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x324405,null))[_0x1ae2('0x22')](function(_0x343729){if(_0x343729){_0x46a04f['model']=_[_0x1ae2('0x4f')](db[_0x1ae2('0xd4')]['rawAttributes']);_0x46a04f['query']=_[_0x1ae2('0x4f')](_0xaa5ba0[_0x1ae2('0x4e')]);_0x46a04f[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x46a04f[_0x1ae2('0x4b')],_0x46a04f[_0x1ae2('0x4e')]);_0x50a3bf[_0x1ae2('0x52')]=_['intersection'](_0x46a04f[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0xaa5ba0['query'][_0x1ae2('0x53')]));_0x50a3bf[_0x1ae2('0x52')]=_0x50a3bf[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x50a3bf[_0x1ae2('0x52')]:_0x46a04f[_0x1ae2('0x4b')];if(!_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x55')]('nolimit')){_0x50a3bf[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x50a3bf[_0x1ae2('0x32')]=qs['offset'](_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}_0x50a3bf[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x50a3bf['where']=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0xaa5ba0['query'],_0x46a04f[_0x1ae2('0x50')]));_0x50a3bf[_0x1ae2('0x58')]['UserId']=_0x343729['id'];if(_0xaa5ba0['query'][_0x1ae2('0x3f')]){_0x50a3bf[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x50a3bf[_0x1ae2('0x58')],{'$or':_['map'](_0x50a3bf[_0x1ae2('0x52')],function(_0xd5c93b){var _0x3f2493={};_0x3f2493[_0xd5c93b]={'$like':'%'+_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x3f2493;})});}_0x50a3bf=_['merge']({},_0x50a3bf,_0xaa5ba0['options']);return db[_0x1ae2('0xd4')][_0x1ae2('0x5f')]({'where':_0x50a3bf['where']})['then'](function(_0x2e960b){_0x516fa7['count']=_0x2e960b;if(_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x60')]){_0x50a3bf[_0x1ae2('0x61')]=[{'all':!![]}];}return db[_0x1ae2('0xd4')][_0x1ae2('0x62')](_0x50a3bf);})[_0x1ae2('0x22')](function(_0x310a4a){_0x516fa7['rows']=_0x310a4a;return _0x516fa7;});}})[_0x1ae2('0x22')](respondWithFilteredResult(_0x324405,_0x50a3bf))[_0x1ae2('0x2d')](handleError(_0x324405,null));};exports[_0x1ae2('0xd5')]=function(_0x4b203a,_0x5b4521,_0x4630d4){var _0x4a365d={};var _0x56968a={};var _0x37c416;var _0x302cee;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x4b203a['params']['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x5b4521,null))[_0x1ae2('0x22')](function(_0x30ee39){if(_0x30ee39){_0x37c416=_0x30ee39;_0x56968a[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db[_0x1ae2('0xd6')][_0x1ae2('0x66')]);_0x56968a['query']=_[_0x1ae2('0x4f')](_0x4b203a['query']);_0x56968a[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x56968a[_0x1ae2('0x4b')],_0x56968a['query']);_0x4a365d[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x56968a[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x4b203a[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x4a365d[_0x1ae2('0x52')]=_0x4a365d['attributes'][_0x1ae2('0x54')]?_0x4a365d[_0x1ae2('0x52')]:_0x56968a['model'];_0x4a365d[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x4b203a[_0x1ae2('0x4e')]['sort']);_0x4a365d[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_['pick'](_0x4b203a[_0x1ae2('0x4e')],_0x56968a[_0x1ae2('0x50')]));if(_0x4b203a[_0x1ae2('0x4e')]['filter']){_0x4a365d['where']=_[_0x1ae2('0x59')](_0x4a365d[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x4a365d[_0x1ae2('0x52')],function(_0x491bcc){var _0x1416d0={};_0x1416d0[_0x491bcc]={'$like':'%'+_0x4b203a['query'][_0x1ae2('0x3f')]+'%'};return _0x1416d0;})});}_0x4a365d=_[_0x1ae2('0x59')]({},_0x4a365d,_0x4b203a['options']);return _0x37c416[_0x1ae2('0xd5')](_0x4a365d);}})[_0x1ae2('0x22')](function(_0x292707){if(_0x292707){_0x302cee=_0x292707[_0x1ae2('0x54')];if(!_0x4b203a[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x4a365d[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x4b203a[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x4a365d[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x4b203a[_0x1ae2('0x4e')]['offset']);}return _0x37c416[_0x1ae2('0xd5')](_0x4a365d);}})[_0x1ae2('0x22')](function(_0x37303a){if(_0x37303a){return _0x37303a?{'count':_0x302cee,'rows':_0x37303a}:null;}})[_0x1ae2('0x22')](respondWithResult(_0x5b4521,null))[_0x1ae2('0x2d')](handleError(_0x5b4521,null));};exports['getFaxInteractions']=function(_0x5721e7,_0x5e94b1,_0x2ab791){var _0x1420ff={};var _0x511b97={};var _0x1b265f;var _0x5bc36e;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x5721e7[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x5e94b1,null))[_0x1ae2('0x22')](function(_0x54fd8c){if(_0x54fd8c){_0x1b265f=_0x54fd8c;_0x511b97[_0x1ae2('0x4b')]=_['keys'](db[_0x1ae2('0xd7')][_0x1ae2('0x66')]);_0x511b97[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x5721e7[_0x1ae2('0x4e')]);_0x511b97[_0x1ae2('0x50')]=_['intersection'](_0x511b97[_0x1ae2('0x4b')],_0x511b97['query']);_0x1420ff['attributes']=_[_0x1ae2('0x51')](_0x511b97[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x5721e7[_0x1ae2('0x4e')]['fields']));_0x1420ff['attributes']=_0x1420ff[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x1420ff[_0x1ae2('0x52')]:_0x511b97['model'];_0x1420ff[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x5721e7[_0x1ae2('0x4e')]['sort']);_0x1420ff['where']=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x5721e7[_0x1ae2('0x4e')],_0x511b97[_0x1ae2('0x50')]));if(_0x5721e7['query'][_0x1ae2('0x3f')]){_0x1420ff[_0x1ae2('0x58')]=_['merge'](_0x1420ff['where'],{'$or':_[_0x1ae2('0x41')](_0x1420ff[_0x1ae2('0x52')],function(_0x2dcd1b){var _0x4b478f={};_0x4b478f[_0x2dcd1b]={'$like':'%'+_0x5721e7[_0x1ae2('0x4e')]['filter']+'%'};return _0x4b478f;})});}_0x1420ff=_[_0x1ae2('0x59')]({},_0x1420ff,_0x5721e7[_0x1ae2('0x5e')]);return _0x1b265f[_0x1ae2('0xd8')](_0x1420ff);}})[_0x1ae2('0x22')](function(_0xb77ba6){if(_0xb77ba6){_0x5bc36e=_0xb77ba6[_0x1ae2('0x54')];if(!_0x5721e7[_0x1ae2('0x4e')][_0x1ae2('0x55')]('nolimit')){_0x1420ff['limit']=qs[_0x1ae2('0x33')](_0x5721e7['query'][_0x1ae2('0x33')]);_0x1420ff[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x5721e7[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}return _0x1b265f['getFaxInteractions'](_0x1420ff);}})[_0x1ae2('0x22')](function(_0xc5a05a){if(_0xc5a05a){return _0xc5a05a?{'count':_0x5bc36e,'rows':_0xc5a05a}:null;}})[_0x1ae2('0x22')](respondWithResult(_0x5e94b1,null))[_0x1ae2('0x2d')](handleError(_0x5e94b1,null));};exports[_0x1ae2('0xd9')]=function(_0x251dc8,_0x22bc3a,_0x26c653){var _0x2495a3;var _0x40cbaf;var _0x496486;return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x251dc8[_0x1ae2('0x65')]['id'],'role':_0x1ae2('0x3e')},'attributes':['id',_0x1ae2('0x48'),_0x1ae2('0xda'),_0x1ae2('0xdb'),'role',_0x1ae2('0x77'),_0x1ae2('0x9f')]})[_0x1ae2('0x22')](handleEntityNotFound(_0x22bc3a,null))['then'](function(_0x4c6584){if(_0x4c6584){_0x2495a3=_0x4c6584;if(_0x251dc8['body'][_0x1ae2('0xa0')]){_0x496486=util[_0x1ae2('0x74')](_0x1ae2('0xdc'),_0x2495a3[_0x251dc8[_0x1ae2('0x69')][_0x1ae2('0xa0')]]);}else if(_0x251dc8[_0x1ae2('0x69')][_0x1ae2('0xdd')]){_0x496486=util[_0x1ae2('0x74')](_0x1ae2('0xaf'),_0x251dc8[_0x1ae2('0x69')][_0x1ae2('0xdd')]);}else{_0x496486=util['format'](_0x1ae2('0xaf'),_0x2495a3[_0x1ae2('0x48')]);}socket['to'](util['format'](_0x1ae2('0xde'),_0x2495a3[_0x1ae2('0x48')]))[_0x1ae2('0xaa')](_0x1ae2('0xdf'),{'ip':_0x251dc8[_0x1ae2('0xe0')][_0x1ae2('0xe1')]||_0x251dc8[_0x1ae2('0xe2')][_0x1ae2('0xe3')]||_0x251dc8['socket']['remoteAddress']||_0x251dc8['connection'][_0x1ae2('0xe4')]['remoteAddress']});return db[_0x1ae2('0xb2')][_0x1ae2('0x39')]({'where':{'membername':_0x2495a3['name']},'individualHooks':!![]});}})[_0x1ae2('0x22')](function(_0x58a11f){if(_0x2495a3){return _0x2495a3['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x314c76){var _0x2122d9=[];if(_0x314c76){_0x40cbaf=_0x314c76;if(_0x40cbaf[_0x1ae2('0x54')]){for(var _0x217f8b=0x0;_0x217f8b<_0x40cbaf[_0x1ae2('0x54')];_0x217f8b++){_0x2122d9[_0x1ae2('0xae')]({'membername':_0x2495a3[_0x1ae2('0x48')],'UserId':_0x2495a3['id'],'queue_name':_0x40cbaf[_0x217f8b][_0x1ae2('0x48')],'VoiceQueueId':_0x40cbaf[_0x217f8b]['id'],'interface':_0x496486,'paused':_0x2495a3[_0x1ae2('0x9f')]||![],'penalty':_0x40cbaf[_0x217f8b][_0x1ae2('0xe5')]||0x0});}return BPromise['each'](_0x2122d9,function(_0x3f57b7){return db[_0x1ae2('0xb2')]['upsert'](_0x3f57b7);});}}})[_0x1ae2('0x22')](function(){return db[_0x1ae2('0xe6')][_0x1ae2('0x62')]({'where':{'membername':_0x2495a3['name'],'exitAt':null}});})[_0x1ae2('0x22')](function(_0x18a1c4){var _0x434b69=[];_0x18a1c4[_0x1ae2('0xe7')](function(_0x503f62){_0x434b69[_0x1ae2('0xae')](_0x503f62['update']({'exitAt':moment()['format'](_0x1ae2('0xe8'))}));});return BPromise[_0x1ae2('0xe9')](_0x434b69);})[_0x1ae2('0x22')](function(){var _0x4941fa=[];var _0x5eb0e2=[];var _0x1ebeee=utils[_0x1ae2('0xea')]();var _0xe5d3c5={'membername':_0x2495a3[_0x1ae2('0x48')],'interface':_0x496486,'enterAt':moment()[_0x1ae2('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2495a3['role'],'internal':_0x2495a3['internal']};_0x1ebeee['forEach'](function(_0x54fe6e){_0x4941fa[_0x1ae2('0xae')](_['merge']({'channel':_0x54fe6e,'type':_0x1ae2('0xeb'),'data1':_0x251dc8[_0x1ae2('0x69')]['device'],'data2':_0x496486},_0xe5d3c5));if(_0x2495a3['loginInPause']){_0x5eb0e2[_0x1ae2('0xae')](_[_0x1ae2('0x59')]({'channel':_0x54fe6e,'type':_0x1ae2('0xec'),'data1':'LOGININPAUSE'},_0xe5d3c5));}});return db[_0x1ae2('0xe6')][_0x1ae2('0x68')](_0x4941fa[_0x1ae2('0xed')](_0x5eb0e2),{'individualHooks':!![]});})['then'](function(){return _0x2495a3['update']({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2495a3[_0x1ae2('0x9f')]||![],'mailPause':_0x2495a3[_0x1ae2('0x9f')]||![],'chatPause':_0x2495a3[_0x1ae2('0x9f')]||![],'faxPause':_0x2495a3['loginInPause']||![],'smsPause':_0x2495a3[_0x1ae2('0x9f')]||![],'openchannelPause':_0x2495a3['loginInPause']||![],'pauseType':_0x2495a3[_0x1ae2('0x9f')]?'LOGININPAUSE':null,'interface':_0x496486,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x1ae2('0x22')](respondWithResult(_0x22bc3a,null))[_0x1ae2('0x2d')](handleError(_0x22bc3a,null));};exports[_0x1ae2('0xee')]=function(_0x5422a7,_0x5cbb20,_0x5cd722){var _0x537864;return db[_0x1ae2('0x4a')]['find']({'where':{'id':_0x5422a7['params']['id'],'role':'agent'},'attributes':['id','name','role']})[_0x1ae2('0x22')](handleEntityNotFound(_0x5cbb20,null))['then'](function(_0x2b2038){if(_0x2b2038){_0x537864=_0x2b2038;return db[_0x1ae2('0xb2')][_0x1ae2('0x39')]({'where':{'membername':_0x537864[_0x1ae2('0x48')]},'individualHooks':!![]});}})[_0x1ae2('0x22')](function(){return db['MemberReport'][_0x1ae2('0x62')]({'where':{'membername':_0x537864[_0x1ae2('0x48')],'exitAt':null}});})[_0x1ae2('0x22')](function(_0x24220c){var _0x519532=[];_0x24220c[_0x1ae2('0xe7')](function(_0x4e474f){_0x519532[_0x1ae2('0xae')](_0x4e474f[_0x1ae2('0x38')]({'exitAt':moment()[_0x1ae2('0x74')](_0x1ae2('0xe8'))}));});return BPromise[_0x1ae2('0xe9')](_0x519532);})['then'](function(){return _0x537864['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x1ae2('0x22')](respondWithResult(_0x5cbb20,null))['catch'](handleError(_0x5cbb20,null));};exports[_0x1ae2('0xef')]=function(_0x43978d,_0x4faa5c,_0x358460){var _0x3a4728;return db[_0x1ae2('0xb2')][_0x1ae2('0x38')]({'paused':0x1},{'where':{'UserId':_0x43978d[_0x1ae2('0x65')]['id']},'individualHooks':!![]})[_0x1ae2('0x22')](function(){return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x43978d[_0x1ae2('0x65')]['id'],'role':_0x1ae2('0x3e')},'attributes':['id',_0x1ae2('0x48'),_0x1ae2('0x44'),_0x1ae2('0x77'),_0x1ae2('0xa0')]});})[_0x1ae2('0x22')](handleEntityNotFound(_0x4faa5c,null))[_0x1ae2('0x22')](function(_0x154d9e){if(_0x154d9e){_0x3a4728=_0x154d9e;return respondWithRpcPromise(_0x1ae2('0xf0'),_0x1ae2('0xef'),{'id':_0x3a4728['id'],'name':_0x3a4728[_0x1ae2('0x48')],'pause':!![]});}})[_0x1ae2('0x22')](function(){if(_0x3a4728){return db[_0x1ae2('0xe6')][_0x1ae2('0x62')]({'where':{'membername':_0x3a4728[_0x1ae2('0x48')],'type':_0x1ae2('0xec'),'exitAt':null}});}})['then'](function(_0x23282c){if(_0x23282c[_0x1ae2('0x54')]){var _0x2ad03a=moment()[_0x1ae2('0x74')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2b1fb4=0x0,_0x586be5=_0x23282c['length'];_0x2b1fb4<_0x586be5;_0x2b1fb4++){_0x23282c[_0x2b1fb4][_0x1ae2('0xf1')]({'exitAt':_0x2ad03a});}}})[_0x1ae2('0x22')](function(){var _0x185f4a=[];var _0x594e2c=utils[_0x1ae2('0xea')]();_0x594e2c[_0x1ae2('0xe7')](function(_0x3d8a71){_0x185f4a['push']({'channel':_0x3d8a71,'membername':_0x3a4728[_0x1ae2('0x48')],'interface':_[_0x1ae2('0x7d')](_0x3a4728[_0x1ae2('0xa0')])?util[_0x1ae2('0x74')](_0x1ae2('0xaf'),_0x3a4728['name']):_0x3a4728['interface'],'type':'PAUSE','enterAt':moment()['format'](_0x1ae2('0xe8')),'data1':_0x43978d[_0x1ae2('0x69')]['type']||_0x1ae2('0xf2'),'role':_0x3a4728['role'],'internal':_0x3a4728[_0x1ae2('0x77')]});});return db['MemberReport'][_0x1ae2('0x68')](_0x185f4a,{'individualHooks':!![]});})[_0x1ae2('0x22')](function(){return _0x3a4728[_0x1ae2('0x38')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x43978d[_0x1ae2('0x69')][_0x1ae2('0xf3')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0x1ae2('0xe8'))});})['then'](respondWithResult(_0x4faa5c,null))['catch'](handleError(_0x4faa5c,null));};exports[_0x1ae2('0xf4')]=function(_0x2d9f97,_0x5087e8,_0x3ccb5c){var _0x39b56b;return db['User']['find']({'where':{'id':_0x2d9f97[_0x1ae2('0x65')]['id']},'attributes':['id',_0x1ae2('0x48'),'role',_0x1ae2('0xb0'),'mailPause',_0x1ae2('0xf5'),_0x1ae2('0xf6'),_0x1ae2('0xf7'),_0x1ae2('0xf8'),_0x1ae2('0xf9'),'lastPauseAt']})[_0x1ae2('0x22')](handleEntityNotFound(_0x5087e8,null))[_0x1ae2('0x22')](function(_0x2adc19){if(_0x2adc19){_0x39b56b=_0x2adc19;if(_0x2d9f97[_0x1ae2('0x69')][_0x1ae2('0x9d')]&&!utils[_0x1ae2('0xa1')](_0x2d9f97['body'][_0x1ae2('0x9d')])){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0xa2'));}switch(_0x2d9f97[_0x1ae2('0x69')]['channel']){case'voice':return respondWithRpcPromise(_0x1ae2('0xf0'),'unpause',{'id':_0x39b56b['id'],'name':_0x39b56b[_0x1ae2('0x48')],'pause':![]})[_0x1ae2('0x22')](function(){return db[_0x1ae2('0xb2')]['update']({'paused':0x0},{'where':{'UserId':_0x39b56b['id']},'individualHooks':!![]});})['then'](function(){return db[_0x1ae2('0xe6')][_0x1ae2('0x45')]({'where':{'channel':_0x2d9f97[_0x1ae2('0x69')][_0x1ae2('0x9d')],'membername':_0x39b56b[_0x1ae2('0x48')],'type':'PAUSE','exitAt':null}});})[_0x1ae2('0x22')](function(_0x47f8d2){if(_0x47f8d2){return _0x47f8d2[_0x1ae2('0x38')]({'exitAt':moment()[_0x1ae2('0x74')](_0x1ae2('0xe8')),'data2':_0x1ae2('0xfa')},{'individualHooks':!![]});}return null;})[_0x1ae2('0x22')](function(){return _0x39b56b['update']({'voicePause':![]});});case _0x1ae2('0xfb'):case _0x1ae2('0xfc'):case _0x1ae2('0xfd'):case _0x1ae2('0xfe'):case _0x1ae2('0xff'):return db['MemberReport'][_0x1ae2('0x45')]({'where':{'channel':_0x2d9f97['body'][_0x1ae2('0x9d')],'membername':_0x39b56b['name'],'type':_0x1ae2('0xec'),'exitAt':null}})['then'](function(_0x282647){if(_0x282647){return _0x282647[_0x1ae2('0x38')]({'exitAt':moment()[_0x1ae2('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x1ae2('0xfa')},{'individualHooks':!![]});}return null;})[_0x1ae2('0x22')](function(){var _0x261e38={};_['set'](_0x261e38,util[_0x1ae2('0x74')](_0x1ae2('0x100'),_0x2d9f97['body'][_0x1ae2('0x9d')],_0x1ae2('0x101')),![]);return _0x39b56b[_0x1ae2('0x38')](_0x261e38);});default:return respondWithRpcPromise(_0x1ae2('0xf0'),_0x1ae2('0xf4'),{'id':_0x39b56b['id'],'name':_0x39b56b[_0x1ae2('0x48')],'pause':![]})['then'](function(){return db[_0x1ae2('0xb2')][_0x1ae2('0x38')]({'paused':0x0},{'where':{'UserId':_0x39b56b['id']}});})[_0x1ae2('0x22')](function(){return db['MemberReport'][_0x1ae2('0x62')]({'where':{'membername':_0x39b56b[_0x1ae2('0x48')],'type':'PAUSE','exitAt':null}});})[_0x1ae2('0x22')](function(_0x29302f){var _0x53c091=[];_0x29302f['forEach'](function(_0x2c4182){_0x53c091[_0x1ae2('0xae')](_0x2c4182[_0x1ae2('0x38')]({'exitAt':moment()[_0x1ae2('0x74')](_0x1ae2('0xe8')),'data2':_0x1ae2('0xfa')}));});return BPromise[_0x1ae2('0xe9')](_0x53c091);})[_0x1ae2('0x22')](function(){return _0x39b56b[_0x1ae2('0x38')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x5087e8,null))[_0x1ae2('0x2d')](handleError(_0x5087e8,null));};exports[_0x1ae2('0x102')]=function(_0x2e392a,_0x58051f,_0x386618){var _0x227ddf={};var _0x247694={};var _0x4d9e01;var _0x2b6b4d;return db[_0x1ae2('0x4a')]['findOne']({'where':{'id':_0x2e392a['params']['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x58051f,null))[_0x1ae2('0x22')](function(_0x2e5b7e){if(_0x2e5b7e){_0x4d9e01=_0x2e5b7e;_0x247694['model']=_['keys'](db[_0x1ae2('0x103')][_0x1ae2('0x66')]);_0x247694['query']=_[_0x1ae2('0x4f')](_0x2e392a[_0x1ae2('0x4e')]);_0x247694['filters']=_[_0x1ae2('0x51')](_0x247694[_0x1ae2('0x4b')],_0x247694[_0x1ae2('0x4e')]);_0x227ddf[_0x1ae2('0x52')]=_['intersection'](_0x247694[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x2e392a[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x227ddf[_0x1ae2('0x52')]=_0x227ddf[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x227ddf[_0x1ae2('0x52')]:_0x247694['model'];_0x227ddf[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x2e392a[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x227ddf[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_['pick'](_0x2e392a[_0x1ae2('0x4e')],_0x247694[_0x1ae2('0x50')]));if(_0x2e392a[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x227ddf[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x227ddf[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x227ddf['attributes'],function(_0x267e6a){var _0x3d4a60={};_0x3d4a60[_0x267e6a]={'$like':'%'+_0x2e392a[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x3d4a60;})});}_0x227ddf=_[_0x1ae2('0x59')]({},_0x227ddf,_0x2e392a[_0x1ae2('0x5e')]);return _0x4d9e01['getTeams'](_0x227ddf);}})[_0x1ae2('0x22')](function(_0x24c08e){if(_0x24c08e){_0x2b6b4d=_0x24c08e[_0x1ae2('0x54')];if(!_0x2e392a['query'][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x227ddf[_0x1ae2('0x33')]=qs['limit'](_0x2e392a[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x227ddf[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x2e392a['query']['offset']);}return _0x4d9e01[_0x1ae2('0x102')](_0x227ddf);}})[_0x1ae2('0x22')](function(_0xbe776){if(_0xbe776){return _0xbe776?{'count':_0x2b6b4d,'rows':_0xbe776}:null;}})['then'](respondWithResult(_0x58051f,null))[_0x1ae2('0x2d')](handleError(_0x58051f,null));};exports['addTeams']=function(_0x178850,_0x29a764,_0x2d0df9){return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x178850[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x29a764,null))['then'](function(_0x23867e){if(_0x23867e){return _0x23867e[_0x1ae2('0x104')](_0x178850[_0x1ae2('0x69')][_0x1ae2('0x6d')],_[_0x1ae2('0x6c')](_0x178850[_0x1ae2('0x69')],[_0x1ae2('0x6d'),'id'])||{});}})[_0x1ae2('0x22')](respondWithResult(_0x29a764,null))['catch'](handleError(_0x29a764,null));};exports['removeTeams']=function(_0x168a30,_0x374b46,_0x589828){return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x168a30[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x374b46,null))[_0x1ae2('0x22')](function(_0x18f820){if(_0x18f820){return _0x18f820[_0x1ae2('0x105')](_0x168a30['query']['ids']);}})[_0x1ae2('0x22')](respondWithStatusCode(_0x374b46,null))[_0x1ae2('0x2d')](handleError(_0x374b46,null));};exports[_0x1ae2('0x106')]=function(_0x3858ab,_0x90467b,_0x497f9e){var _0x39ab53={};var _0x42487e={};var _0x4acc3d;var _0x117bdf;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x3858ab[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x90467b,null))[_0x1ae2('0x22')](function(_0x5b0f03){if(_0x5b0f03){_0x4acc3d=_0x5b0f03;_0x42487e[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db[_0x1ae2('0x107')][_0x1ae2('0x66')]);_0x42487e[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x3858ab[_0x1ae2('0x4e')]);_0x42487e[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x42487e[_0x1ae2('0x4b')],_0x42487e['query']);_0x39ab53['attributes']=_[_0x1ae2('0x51')](_0x42487e[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x39ab53[_0x1ae2('0x52')]=_0x39ab53['attributes'][_0x1ae2('0x54')]?_0x39ab53['attributes']:_0x42487e[_0x1ae2('0x4b')];_0x39ab53[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x39ab53[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_['pick'](_0x3858ab['query'],_0x42487e[_0x1ae2('0x50')]));if(_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x39ab53[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x39ab53[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x39ab53['attributes'],function(_0x55dff5){var _0x1dab7f={};_0x1dab7f[_0x55dff5]={'$like':'%'+_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x1dab7f;})});}_0x39ab53=_['merge']({},_0x39ab53,_0x3858ab[_0x1ae2('0x5e')]);return _0x4acc3d[_0x1ae2('0x106')](_0x39ab53);}})[_0x1ae2('0x22')](function(_0x300f06){if(_0x300f06){_0x117bdf=_0x300f06[_0x1ae2('0x54')];if(!_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x39ab53[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x39ab53['offset']=qs[_0x1ae2('0x32')](_0x3858ab['query'][_0x1ae2('0x32')]);}return _0x4acc3d[_0x1ae2('0x106')](_0x39ab53);}})[_0x1ae2('0x22')](function(_0x4cc176){if(_0x4cc176){return _0x4cc176?{'count':_0x117bdf,'rows':_0x4cc176}:null;}})[_0x1ae2('0x22')](respondWithResult(_0x90467b,null))['catch'](handleError(_0x90467b,null));};exports[_0x1ae2('0x108')]=function(_0x2bbb0c,_0x72c852,_0x2b6714){var _0xc58301={};var _0x59f78a={};var _0x1428f2;var _0x3fca94;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x2bbb0c[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x72c852,null))[_0x1ae2('0x22')](function(_0x264b71){if(_0x264b71){_0x1428f2=_0x264b71;_0x59f78a[_0x1ae2('0x4b')]=_['keys'](db[_0x1ae2('0x4a')][_0x1ae2('0x66')]);_0x59f78a[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x2bbb0c['query']);_0x59f78a[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x59f78a[_0x1ae2('0x4b')],_0x59f78a[_0x1ae2('0x4e')]);_0xc58301[_0x1ae2('0x52')]=_['intersection'](_0x59f78a[_0x1ae2('0x4b')],qs['fields'](_0x2bbb0c[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0xc58301[_0x1ae2('0x52')]=_0xc58301['attributes'][_0x1ae2('0x54')]?_0xc58301['attributes']:_0x59f78a[_0x1ae2('0x4b')];_0xc58301[_0x1ae2('0x56')]=qs['sort'](_0x2bbb0c[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0xc58301['where']=qs['filters'](_[_0x1ae2('0xc0')](_0x2bbb0c[_0x1ae2('0x4e')],_0x59f78a[_0x1ae2('0x50')]));if(_0x2bbb0c[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0xc58301[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0xc58301[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0xc58301[_0x1ae2('0x52')],function(_0x4ebb60){var _0x5db535={};_0x5db535[_0x4ebb60]={'$like':'%'+_0x2bbb0c[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x5db535;})});}_0xc58301[_0x1ae2('0x4b')]=db[_0x1ae2('0x4a')];_0xc58301['as']='Agents';_0xc58301=_[_0x1ae2('0x59')]({},_0xc58301,_0x2bbb0c[_0x1ae2('0x5e')]);return _0x1428f2[_0x1ae2('0x109')]({'include':[_0xc58301]});}})[_0x1ae2('0x22')](function(_0x1b31fd){if(_0x1b31fd){var _0x83aaa0={},_0x41b63b=[],_0xc46250=0x0;for(var _0x530921=0x0;_0x530921<_0x1b31fd[_0x1ae2('0x54')];_0x530921+=0x1){for(var _0x2c0be0=0x0,_0x6b25f5;_0x2c0be0<_0x1b31fd[_0x530921][_0x1ae2('0x3d')][_0x1ae2('0x54')];_0x2c0be0+=0x1){_0x6b25f5=_0x1b31fd[_0x530921]['Agents'][_0x2c0be0][_0x1ae2('0x3a')]({'plain':!![]});_0x83aaa0[_0x6b25f5['id']]=_0x6b25f5;}}_0x83aaa0=_['values'](_0x83aaa0);for(var _0x3e1bc4=qs['offset'](_0x2bbb0c[_0x1ae2('0x4e')][_0x1ae2('0x32')]);_0x3e1bc4<_0x83aaa0[_0x1ae2('0x54')]&&_0x41b63b[_0x1ae2('0x54')]=_0xeeffda){_0x588f27=_0xeeffda;_0x469352=0xc8;}else{_0x469352=0xce;}_0x38edf9[_0x9009('0x2d')](_0x469352);return _0x38edf9['set'](_0x9009('0x2e'),_0x40b5d5+'-'+_0x588f27+'/'+_0xeeffda)[_0x9009('0x2f')](_0x47c158);}return null;};}function patchUpdates(_0x588a6d){return function(_0xedc5ba){try{jsonpatch['apply'](_0xedc5ba,_0x588a6d,!![]);}catch(_0x471e93){return BPromise[_0x9009('0x30')](_0x471e93);}return _0xedc5ba[_0x9009('0x31')]();};}function saveUpdates(_0x1ebd58,_0x4344f2){return function(_0x409318){if(_0x409318){return _0x409318[_0x9009('0x32')](_0x1ebd58)['then'](function(_0x45a710){return _0x45a710;});}return null;};}function removeEntity(_0x51d650,_0x4c2da0){return function(_0x22c191){if(_0x22c191){return _0x22c191['destroy']()[_0x9009('0x20')](function(){var _0x51f81d=_0x22c191['get']({'plain':!![]});var _0xa67cf4=[{'name':_0x9009('0x33'),'value':_0x9009('0x34'),'ignore':!![]},{'name':_0x9009('0x35'),'value':_0x9009('0x36'),'ignore':![]},{'name':_0x9009('0x37'),'value':'telephone','ignore':![]}];var _0x64b96e=_(_0xa67cf4)[_0x9009('0x38')](_0x9009('0x39'))['map']('value')[_0x9009('0x3a')]();if(_[_0x9009('0x3b')](_0x64b96e,_0x51f81d['role'])){return;}var _0x4565b6=_[_0x9009('0x3c')](_0xa67cf4,[_0x9009('0x3a'),_0x51f81d[_0x9009('0x3d')]])[_0x9009('0x3e')];return db[_0x9009('0x3f')]['destroy']({'where':{'type':_0x4565b6,'resourceId':_0x51f81d['id']}})[_0x9009('0x20')](function(){return _0x22c191;});})[_0x9009('0x20')](function(){_0x51d650[_0x9009('0x2d')](0xcc)[_0x9009('0x40')]();});}};}function handleEntityNotFound(_0x1f6eb1,_0x2724ac){return function(_0xf58e0){if(!_0xf58e0){_0x1f6eb1[_0x9009('0x41')](0x194);}return _0xf58e0;};}function handleError(_0x18d16c,_0x4e9eb1){_0x4e9eb1=_0x4e9eb1||0x1f4;return function(_0x8b5bb4){logger[_0x9009('0x25')](_0x8b5bb4[_0x9009('0x42')]);if(_0x8b5bb4[_0x9009('0x3e')]){delete _0x8b5bb4[_0x9009('0x3e')];}_0x18d16c[_0x9009('0x2d')](_0x4e9eb1)[_0x9009('0x43')](_0x8b5bb4);};}exports['index']=function(_0x556cdb,_0x2ad736){var _0x243f4b={},_0xa38876={},_0x5d2fb8={'count':0x0,'rows':[]};var _0x314b48=db[_0x9009('0x44')][_0x9009('0x45')];_0xa38876[_0x9009('0x46')]=_[_0x9009('0x47')](_['keys'](_0x314b48),[_0x9009('0x48'),'salt']);_0xa38876[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x556cdb[_0x9009('0x49')]);_0xa38876[_0x9009('0x4b')]=_[_0x9009('0x4c')](_0xa38876[_0x9009('0x46')],_0xa38876['query']);_0x243f4b[_0x9009('0x4d')]=_['intersection'](_0xa38876[_0x9009('0x46')],qs[_0x9009('0x4e')](_0x556cdb[_0x9009('0x49')]['fields']));_0x243f4b[_0x9009('0x4d')]=_0x243f4b[_0x9009('0x4d')]['length']?_0x243f4b[_0x9009('0x4d')]:_0xa38876[_0x9009('0x46')];if(!_0x556cdb[_0x9009('0x49')][_0x9009('0x4f')](_0x9009('0x50'))){_0x243f4b['limit']=qs[_0x9009('0x2c')](_0x556cdb[_0x9009('0x49')][_0x9009('0x2c')]);_0x243f4b[_0x9009('0x2b')]=qs['offset'](_0x556cdb['query'][_0x9009('0x2b')]);}_0x243f4b[_0x9009('0x51')]=qs[_0x9009('0x52')](_0x556cdb[_0x9009('0x49')][_0x9009('0x52')]);_0x243f4b[_0x9009('0x53')]=qs[_0x9009('0x4b')](_[_0x9009('0x54')](_0x556cdb[_0x9009('0x49')],_0xa38876[_0x9009('0x4b')]));if(_0x556cdb[_0x9009('0x49')][_0x9009('0x38')]){_0x243f4b[_0x9009('0x53')]=_[_0x9009('0x55')](_0x243f4b['where'],{'$or':_[_0x9009('0x56')](_0x314b48,function(_0x1334f7){return db[_0x9009('0x57')][_0x9009('0x53')](db[_0x9009('0x57')]['fn']('lower',db[_0x9009('0x57')][_0x9009('0x58')](_0x1334f7['field'])),{'$like':db[_0x9009('0x57')]['fn'](_0x9009('0x59'),'%'+_0x556cdb[_0x9009('0x49')][_0x9009('0x38')]+'%')});})});}_0x243f4b=_['merge']({},_0x243f4b,_0x556cdb[_0x9009('0x5a')]);var _0x279cfa={'where':_0x243f4b[_0x9009('0x53')]};return db[_0x9009('0x44')][_0x9009('0x2a')](_0x279cfa)[_0x9009('0x20')](function(_0x188f01){_0x5d2fb8[_0x9009('0x2a')]=_0x188f01;if(_0x556cdb[_0x9009('0x49')][_0x9009('0x5b')]){_0x243f4b[_0x9009('0x5c')]=[{'all':!![]}];}return db[_0x9009('0x44')][_0x9009('0x5d')](_0x243f4b);})[_0x9009('0x20')](function(_0x121567){_0x5d2fb8[_0x9009('0x5e')]=_0x121567;return _0x5d2fb8;})['then'](respondWithFilteredResult(_0x2ad736,_0x243f4b))[_0x9009('0x5f')](handleError(_0x2ad736,null));};exports[_0x9009('0x60')]=function(_0x14fcaa,_0x423b63){var _0x239cf7={'raw':![],'where':{'id':_0x14fcaa['params']['id']}},_0x309cad={};_0x309cad[_0x9009('0x46')]=_['differenceBy'](_[_0x9009('0x4a')](db[_0x9009('0x44')][_0x9009('0x45')]),[_0x9009('0x48'),_0x9009('0x61')]);_0x309cad['query']=_[_0x9009('0x4a')](_0x14fcaa['query']);_0x309cad[_0x9009('0x4b')]=_[_0x9009('0x4c')](_0x309cad['model'],_0x309cad[_0x9009('0x49')]);_0x239cf7['attributes']=_['intersection'](_0x309cad[_0x9009('0x46')],qs['fields'](_0x14fcaa[_0x9009('0x49')][_0x9009('0x4e')]));_0x239cf7[_0x9009('0x4d')]=_0x239cf7[_0x9009('0x4d')]['length']?_0x239cf7[_0x9009('0x4d')]:_0x309cad[_0x9009('0x46')];if(_0x14fcaa['query']['includeAll']){_0x239cf7[_0x9009('0x5c')]=[{'all':!![]}];}_0x239cf7=_[_0x9009('0x55')]({},_0x239cf7,_0x14fcaa[_0x9009('0x5a')]);return db[_0x9009('0x44')]['find'](_0x239cf7)['then'](handleEntityNotFound(_0x423b63,null))[_0x9009('0x20')](respondWithResult(_0x423b63,null))[_0x9009('0x5f')](handleError(_0x423b63,null));};exports[_0x9009('0x62')]=function(_0x251ee2,_0x25a87e){return db[_0x9009('0x44')][_0x9009('0x62')](_0x251ee2[_0x9009('0x63')],{'raw':![],'individualHooks':!![]})[_0x9009('0x20')](respondWithResult(_0x25a87e,0xc9))[_0x9009('0x5f')](handleError(_0x25a87e,null));};exports['update']=function(_0xc969df,_0x575328){if(_0xc969df[_0x9009('0x63')]['id']){delete _0xc969df[_0x9009('0x63')]['id'];}delete _0xc969df[_0x9009('0x63')][_0x9009('0x3d')];return db['User']['find']({'where':{'id':_0xc969df[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x575328,null))['then'](saveUpdates(_0xc969df[_0x9009('0x63')],null))[_0x9009('0x20')](respondWithResult(_0x575328,null))[_0x9009('0x5f')](handleError(_0x575328,null));};exports['describe']=function(_0x53dfd6,_0x37ee09){return db[_0x9009('0x44')][_0x9009('0x65')]()[_0x9009('0x20')](respondWithResult(_0x37ee09,null))[_0x9009('0x5f')](handleError(_0x37ee09,null));};exports[_0x9009('0x66')]=function(_0x4658e1,_0x30de64,_0x5f5cfa){return db[_0x9009('0x44')][_0x9009('0x3c')]({'where':{'id':_0x4658e1[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x30de64,null))['then'](function(_0x3792e2){if(_0x3792e2){return _0x3792e2[_0x9009('0x66')](_0x4658e1[_0x9009('0x63')]['ids'],_[_0x9009('0x67')](_0x4658e1[_0x9009('0x63')],[_0x9009('0x68'),'id'])||{});}})[_0x9009('0x20')](respondWithResult(_0x30de64,null))[_0x9009('0x5f')](handleError(_0x30de64,null));};var getLicense=function(_0x468d42){return new BPromise(function(_0x2ecbf1,_0x2dd4d1){var _0x32d738=0x0;_0x468d42[_0x9009('0x63')][_0x9009('0x3d')]==='agent'&&_0x2ecbf1(_0x9009('0x69'));return db[_0x9009('0x44')]['count']({'where':{'$or':[{'role':_0x468d42[_0x9009('0x63')][_0x9009('0x3d')]==='telephone'?_0x9009('0x6a'):[_0x9009('0x6b'),_0x9009('0x34')]}]}})[_0x9009('0x20')](function(_0x142389){_0x32d738=_0x142389;return require(_0x9009('0x6c'))[_0x9009('0x6d')]();})[_0x9009('0x20')](function(_0xca52cc){var _0x582a8d=_0x468d42[_0x9009('0x63')][_0x9009('0x3d')]==='telephone'?_0x9009('0x6e'):_0x9009('0x6f');if(!_[_0x9009('0x70')](_0xca52cc[_0x582a8d])&&_0x32d738>=_0xca52cc[_0x582a8d]){return _0x2dd4d1({'message':_0x9009('0x71')});}return _0x2ecbf1(util[_0x9009('0x72')]('count\x20%s:\x20%s',_0x582a8d,_0x32d738));})[_0x9009('0x5f')](function(_0x273eb8){return _0x2dd4d1(_0x273eb8);});});};exports[_0x9009('0x73')]=function(_0x51478e,_0x5b79f2){return getLicense(_0x51478e)[_0x9009('0x20')](function(_0x33b73b){if(!_0x51478e['body'][_0x9009('0x74')]){var _0x48a9e1;return db[_0x9009('0x75')][_0x9009('0x76')](0x1)[_0x9009('0x20')](function(_0x401887){_0x401887[_0x9009('0x77')]=!![];return checkPasswordPattern(_0x401887,_0x51478e['body'][_0x9009('0x48')],_0x401887['securePassword']);})['then'](function(_0x263be5){_0x48a9e1=_0x263be5[_0x9009('0x78')];return db[_0x9009('0x44')]['max'](_0x9009('0x74'));})[_0x9009('0x20')](function(_0x3f035e){if(_[_0x9009('0x70')](_0x3f035e)){if(_0x48a9e1){_0x51478e[_0x9009('0x63')][_0x9009('0x74')]=_0x48a9e1;}else{_0x51478e[_0x9009('0x63')][_0x9009('0x74')]=0x1;}}else{if(_[_0x9009('0x70')](_0x48a9e1)||_0x48a9e1==_0x3f035e){_0x51478e[_0x9009('0x63')][_0x9009('0x74')]=_0x3f035e+0x1;}else if(_0x48a9e1>_0x3f035e){_0x51478e[_0x9009('0x63')][_0x9009('0x74')]=_0x48a9e1;}else{return db[_0x9009('0x57')][_0x9009('0x49')](_0x9009('0x79'),{'type':db[_0x9009('0x57')][_0x9009('0x7a')]['SELECT']})[_0x9009('0x20')](function(_0x31728d){if(_0x31728d&&_0x31728d['length']){for(var _0x1abe6a=0x0,_0x1861f9=_0x31728d['length'];_0x1abe6a<_0x1861f9&&_['isNil'](_0x51478e[_0x9009('0x63')][_0x9009('0x74')]);_0x1abe6a++){if(_0x48a9e1<=_0x31728d[_0x1abe6a][_0x9009('0x7b')]){_0x51478e['body'][_0x9009('0x74')]=_0x31728d[_0x1abe6a][_0x9009('0x7b')];}else if(_0x48a9e1>_0x31728d[_0x1abe6a][_0x9009('0x7b')]&&_0x48a9e1<=_0x31728d[_0x1abe6a]['to']){_0x51478e['body']['internal']=_0x48a9e1;}}}if(_[_0x9009('0x70')](_0x51478e['body'][_0x9009('0x74')])){_0x51478e[_0x9009('0x63')]['internal']=_0x3f035e+0x1;}});}}});}})['then'](function(){if(_0x51478e['body']['voicemail']){_0x51478e[_0x9009('0x63')][_0x9009('0x7c')]=_0x51478e['body'][_0x9009('0x74')];_0x51478e[_0x9009('0x63')]['VoiceMail']={'mailbox':_0x51478e[_0x9009('0x63')]['internal'],'password':_0x51478e['body']['password'],'fullname':_0x51478e[_0x9009('0x63')][_0x9009('0x7d')],'email':_0x51478e[_0x9009('0x63')][_0x9009('0x7e')]};}if(_0x51478e[_0x9009('0x63')]&&_0x51478e['body'][_0x9009('0x3d')]===_0x9009('0x36')){_0x51478e[_0x9009('0x63')][_0x9009('0x7f')]=[_0x9009('0x80'),'102',_0x9009('0x81'),_0x9009('0x82'),_0x9009('0x83'),_0x9009('0x84'),_0x9009('0x85'),'107','108',_0x9009('0x86'),'100',_0x9009('0x87')];}return db[_0x9009('0x44')][_0x9009('0x73')](_0x51478e[_0x9009('0x63')],{'include':[{'model':db[_0x9009('0x88')],'as':_0x9009('0x88')}]});})['then'](function(_0x2fc882){if(_0x51478e['body'][_0x9009('0x3d')]===_0x9009('0x34'))return _0x2fc882;var _0x332082=_0x51478e[_0x9009('0x34')][_0x9009('0x89')]({'plain':!![]});if(!_0x332082)throw new Error(_0x9009('0x8a'));if(_0x332082[_0x9009('0x3d')]===_0x9009('0x34')){var _0x5d64a2=_0x2fc882['get']({'plain':!![]});var _0xec08b7=[{'name':'Agents','value':'agent'},{'name':'Telephones','value':_0x9009('0x6a')}];var _0x17b9b8=_['find'](_0xec08b7,[_0x9009('0x3a'),_0x5d64a2[_0x9009('0x3d')]])['name'];return db[_0x9009('0x8b')][_0x9009('0x3c')]({'where':{'name':_0x17b9b8,'userProfileId':_0x332082['userProfileId']},'raw':!![]})[_0x9009('0x20')](function(_0x258924){if(_0x258924&&_0x258924[_0x9009('0x8c')]===0x0){return db[_0x9009('0x3f')][_0x9009('0x73')]({'name':_0x5d64a2[_0x9009('0x3e')],'resourceId':_0x5d64a2['id'],'type':_0x258924[_0x9009('0x3e')],'sectionId':_0x258924['id']},{})[_0x9009('0x20')](function(){return _0x2fc882;});}else{return _0x2fc882;}})['catch'](function(_0xb3305c){logger[_0x9009('0x25')](_0x9009('0x8d'),_0xb3305c);throw _0xb3305c;});}return _0x2fc882;})[_0x9009('0x20')](respondWithResult(_0x5b79f2,0xc9))[_0x9009('0x5f')](handleError(_0x5b79f2,null));};exports[_0x9009('0x8e')]=function(_0x457873,_0x17c052,_0x4ccceb){var _0x3ec647=![];if(_0x457873[_0x9009('0x63')]['id']){delete _0x457873[_0x9009('0x63')]['id'];}if(!_[_0x9009('0x70')](_0x457873[_0x9009('0x63')][_0x9009('0x8f')])){if(_0x457873[_0x9009('0x63')][_0x9009('0x8f')]===_0x457873['body'][_0x9009('0x90')]){throw new Error(_0x9009('0x91'));}}return db[_0x9009('0x44')][_0x9009('0x3c')]({'where':{'id':_0x457873['params']['id']}})[_0x9009('0x20')](function(_0x54fc98){if(_0x54fc98){if(_0x54fc98['id']==_0x457873[_0x9009('0x34')]['id']){if(!_0x457873[_0x9009('0x63')][_0x9009('0x8f')]||!_0x457873[_0x9009('0x63')][_0x9009('0x90')]){throw new db[(_0x9009('0x92'))]['ValidationError'](_0x9009('0x93'));}if(!_0x54fc98['authenticate'](_0x457873[_0x9009('0x63')][_0x9009('0x8f')])){throw new db[(_0x9009('0x92'))][(_0x9009('0x94'))](_0x9009('0x95'));}if(_0x457873[_0x9009('0x63')]['oldPassword']==_0x457873[_0x9009('0x63')][_0x9009('0x90')]){throw new db['Sequelize'][(_0x9009('0x94'))](_0x9009('0x96'));}return _0x54fc98;}else if(_0x457873[_0x9009('0x34')][_0x9009('0x3d')]==_0x9009('0x6b')){if(!_0x457873[_0x9009('0x63')][_0x9009('0x90')]){throw new db[(_0x9009('0x92'))][(_0x9009('0x94'))](_0x9009('0x97'));}return _0x54fc98;}else if(_0x457873['user'][_0x9009('0x3d')]=='user'){if(!_0x457873[_0x9009('0x63')][_0x9009('0x90')]){throw new db['Sequelize'][(_0x9009('0x94'))](_0x9009('0x97'));}if(_0x54fc98[_0x9009('0x3d')]!='agent'){throw new db[(_0x9009('0x92'))][(_0x9009('0x94'))](_0x9009('0x98'));}return _0x54fc98;}else{throw new db[(_0x9009('0x92'))][(_0x9009('0x94'))](_0x9009('0x98'));}}return null;})[_0x9009('0x20')](handleEntityNotFound(_0x17c052,null))[_0x9009('0x20')](function(_0x1c3e88){return db['Setting'][_0x9009('0x99')]({'attributes':['id',_0x9009('0x77')]})[_0x9009('0x20')](function(_0x40e8eb){_0x3ec647=_0x40e8eb[_0x9009('0x77')];return checkPasswordPattern(_0x1c3e88,_0x457873[_0x9009('0x63')]['newPassword'],_0x3ec647);});})[_0x9009('0x20')](saveUpdates({'password':_0x457873[_0x9009('0x63')][_0x9009('0x90')],'passwordResetAt':_0x457873[_0x9009('0x34')]['id']==_0x457873['params']['id']?moment():null},null))[_0x9009('0x20')](respondWithResult(_0x17c052,null))[_0x9009('0x5f')](handleError(_0x17c052,null));};exports['addQueues']=function(_0x505501,_0x1994f8,_0x54efd1){var _0x4a9bcc=_0x505501[_0x9009('0x63')][_0x9009('0x9a')];return db[_0x9009('0x44')][_0x9009('0x3c')]({'where':{'id':_0x505501[_0x9009('0x64')]['id']},'attributes':['id',_0x9009('0x3e'),_0x9009('0x3d'),_0x9009('0x9b'),'loginInPause',_0x9009('0x9c'),'interface']})['then'](handleEntityNotFound(_0x1994f8,null))[_0x9009('0x20')](function(_0x222a37){if(_0x222a37){if(!utils[_0x9009('0x9d')](_0x4a9bcc)){throw new db['Sequelize'][(_0x9009('0x94'))](_0x9009('0x9e'));}return _0x222a37[_0x9009('0x9f')+_[_0x9009('0xa0')](_0x4a9bcc[_0x9009('0xa1')]())+_0x9009('0xa2')](_0x505501[_0x9009('0x63')][_0x9009('0x68')],{'penalty':_0x505501[_0x9009('0x63')][_0x9009('0xa3')]||0x0})['spread'](function(_0x5caf3a){for(var _0x44c632=0x0;_0x44c632<_0x505501['body'][_0x9009('0x68')][_0x9009('0xa4')];_0x44c632+=0x1){var _0x2814cc={'UserId':_0x505501[_0x9009('0x64')]['id']};_0x2814cc[_[_0x9009('0xa0')](_0x4a9bcc['toLowerCase']())+_0x9009('0xa5')]=_0x505501[_0x9009('0x63')][_0x9009('0x68')][_0x44c632];socket[_0x9009('0xa6')](_0x9009('0x34')+_['capitalize'](_0x4a9bcc[_0x9009('0xa1')]())+'Queue:save',_0x2814cc);}return _0x5caf3a;})[_0x9009('0x20')](function(){if(_0x4a9bcc==='voice'){return db[_0x9009('0xa7')][_0x9009('0x5d')]({'where':{'id':_0x505501[_0x9009('0x63')][_0x9009('0x68')]||[]},'raw':!![],'attributes':['id',_0x9009('0x3e')]});}})[_0x9009('0x20')](function(_0x3e7c7f){var _0x53f353=_0x222a37[_0x9009('0x89')]({'plain':!![]});var _0x55159f=[];if(_0x4a9bcc===_0x9009('0xa8')&&_0x53f353[_0x9009('0x3d')]===_0x9009('0x36')&&_0x53f353[_0x9009('0x9b')]){for(var _0x5ad28d=0x0;_0x5ad28d<_0x3e7c7f[_0x9009('0xa4')];_0x5ad28d+=0x1){_0x55159f[_0x9009('0xa9')]({'membername':_0x53f353[_0x9009('0x3e')],'UserId':_0x53f353['id'],'queue_name':_0x3e7c7f[_0x5ad28d][_0x9009('0x3e')],'VoiceQueueId':_0x3e7c7f[_0x5ad28d]['id'],'interface':_[_0x9009('0x70')](_0x53f353[_0x9009('0xaa')])?util[_0x9009('0x72')]('SIP/%s',_0x53f353[_0x9009('0x3e')]):_0x53f353[_0x9009('0xaa')],'paused':_0x53f353['voicePause']||![],'penalty':_0x505501[_0x9009('0x63')]['penalty']||0x0});}return BPromise[_0x9009('0xab')](_0x55159f,function(_0x3e28d8){return db[_0x9009('0xac')][_0x9009('0xad')](_0x3e28d8);});}return _0x222a37;});}})[_0x9009('0x20')](respondWithStatusCode(_0x1994f8,null))[_0x9009('0x5f')](handleError(_0x1994f8,null));};exports['removeQueues']=function(_0x195a22,_0x2c20ed,_0x324789){var _0x310b57;return db[_0x9009('0x44')][_0x9009('0x3c')]({'where':{'id':_0x195a22[_0x9009('0x64')]['id']},'attributes':['id','name','role']})[_0x9009('0x20')](handleEntityNotFound(_0x2c20ed,null))['then'](function(_0x4d80ae){if(_0x4d80ae){_0x310b57=_0x4d80ae;if(!_0x195a22[_0x9009('0x49')]['channel']||!utils[_0x9009('0x9d')](_0x195a22[_0x9009('0x49')][_0x9009('0x9a')])){throw new db[(_0x9009('0x92'))]['ValidationError']('Unknown\x20channel');}return _0x4d80ae[_0x9009('0xae')+_[_0x9009('0xa0')](_0x195a22[_0x9009('0x49')][_0x9009('0x9a')][_0x9009('0xa1')]())+_0x9009('0xa2')](_0x195a22['query'][_0x9009('0x68')]);}})[_0x9009('0x20')](function(_0x1dfbd7){for(var _0x4fac1c=0x0;_0x4fac1c<_0x195a22[_0x9009('0x49')][_0x9009('0x68')][_0x9009('0xa4')];_0x4fac1c+=0x1){var _0x4061eb={'UserId':_0x195a22[_0x9009('0x64')]['id']};_0x4061eb[_[_0x9009('0xa0')](_0x195a22['query'][_0x9009('0x9a')]['toLowerCase']())+'QueueId']=_0x195a22[_0x9009('0x49')][_0x9009('0x68')][_0x4fac1c];socket[_0x9009('0xa6')](_0x9009('0x34')+_[_0x9009('0xa0')](_0x195a22[_0x9009('0x49')][_0x9009('0x9a')][_0x9009('0xa1')]())+_0x9009('0xaf'),_0x4061eb);}return _0x1dfbd7;})['then'](function(){if(_0x195a22['query'][_0x9009('0x9a')]===_0x9009('0xa8')){return db[_0x9009('0xac')][_0x9009('0xb0')]({'where':{'UserId':_0x195a22[_0x9009('0x64')]['id'],'VoiceQueueId':_0x195a22[_0x9009('0x49')][_0x9009('0x68')]},'individualHooks':!![]})['then'](function(){return _0x310b57;});}return _0x310b57;})['then'](respondWithStatusCode(_0x2c20ed,null))[_0x9009('0x5f')](handleError(_0x2c20ed,null));};exports[_0x9009('0xb1')]=function(_0x58b674,_0xf3cc5b,_0x14bde1){_0x58b674[_0x9009('0x63')][_0x9009('0xb2')]=_0x58b674[_0x9009('0xb3')][_0x9009('0xb4')];return db[_0x9009('0x44')][_0x9009('0x3c')]({'where':{'id':_0x58b674[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0xf3cc5b,null))[_0x9009('0x20')](saveUpdates(_0x58b674['body'],null))[_0x9009('0x20')](respondWithResult(_0xf3cc5b,null))[_0x9009('0x5f')](handleError(_0xf3cc5b,null));};exports[_0x9009('0xb5')]=function(_0x3a2b90,_0x11bec9,_0x559160){var _0x24a233=path[_0x9009('0xb6')](config[_0x9009('0xb7')],_0x9009('0xb8'));return db[_0x9009('0x44')][_0x9009('0x3c')]({'where':{'id':_0x3a2b90[_0x9009('0x64')]['id']},'attributes':['id',_0x9009('0xb2')],'raw':!![]})['then'](handleEntityNotFound(_0x11bec9,null))[_0x9009('0x20')](function(_0x23fea7){if(_0x23fea7){if(_[_0x9009('0x70')](_0x23fea7['userpic'])){return _0x11bec9[_0x9009('0xb9')](_0x24a233);}else{if(!fs['existsSync'](path['join'](config[_0x9009('0xb7')],_0x9009('0xba'),_0x23fea7[_0x9009('0xb2')]))){return _0x11bec9[_0x9009('0xb9')](_0x24a233);}return _0x11bec9[_0x9009('0xb9')](path['join'](config[_0x9009('0xb7')],_0x9009('0xba'),_0x23fea7['userpic']));}}})[_0x9009('0x5f')](handleError(_0x11bec9,null));};exports[_0x9009('0xbb')]=function(_0x37b469,_0x2bdc6b,_0x4acd78){var _0x25d20e={};var _0x26ea8d={};var _0x33b5b6;var _0xa57745;return db[_0x9009('0x44')][_0x9009('0x99')]({'where':{'id':_0x37b469[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x2bdc6b,null))[_0x9009('0x20')](function(_0x4bac69){if(_0x4bac69){_0x33b5b6=_0x4bac69;_0x26ea8d[_0x9009('0x46')]=_['keys'](db[_0x9009('0xbc')][_0x9009('0x45')]);_0x26ea8d[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x37b469[_0x9009('0x49')]);_0x26ea8d[_0x9009('0x4b')]=_[_0x9009('0x4c')](_0x26ea8d['model'],_0x26ea8d[_0x9009('0x49')]);_0x25d20e[_0x9009('0x4d')]=_[_0x9009('0x4c')](_0x26ea8d[_0x9009('0x46')],qs[_0x9009('0x4e')](_0x37b469[_0x9009('0x49')][_0x9009('0x4e')]));_0x25d20e[_0x9009('0x4d')]=_0x25d20e[_0x9009('0x4d')][_0x9009('0xa4')]?_0x25d20e[_0x9009('0x4d')]:_0x26ea8d[_0x9009('0x46')];_0x25d20e[_0x9009('0x51')]=qs['sort'](_0x37b469['query'][_0x9009('0x52')]);_0x25d20e[_0x9009('0x53')]=qs[_0x9009('0x4b')](_[_0x9009('0x54')](_0x37b469[_0x9009('0x49')],_0x26ea8d[_0x9009('0x4b')]));if(_0x37b469[_0x9009('0x49')][_0x9009('0x38')]){_0x25d20e['where']=_[_0x9009('0x55')](_0x25d20e[_0x9009('0x53')],{'$or':_[_0x9009('0x56')](_0x25d20e[_0x9009('0x4d')],function(_0x483b28){var _0x1469ed={};_0x1469ed[_0x483b28]={'$like':'%'+_0x37b469['query'][_0x9009('0x38')]+'%'};return _0x1469ed;})});}_0x25d20e=_['merge']({},_0x25d20e,_0x37b469[_0x9009('0x5a')]);return _0x33b5b6[_0x9009('0xbb')](_0x25d20e);}})[_0x9009('0x20')](function(_0x53687c){if(_0x53687c){_0xa57745=_0x53687c[_0x9009('0xa4')];if(_0x37b469[_0x9009('0x49')][_0x9009('0x4f')](_0x9009('0x5b'))){_0x25d20e[_0x9009('0x5c')]=[{'model':db[_0x9009('0xbd')],'as':_0x9009('0xbe'),'required':![]},{'model':db[_0x9009('0xbf')],'as':_0x9009('0xc0'),'attributes':['id',_0x9009('0x3e'),_0x9009('0xc1')],'where':_0x37b469[_0x9009('0x49')]['tag']?{'id':_0x37b469[_0x9009('0x49')][_0x9009('0xc2')]}:undefined,'required':_0x37b469[_0x9009('0x49')][_0x9009('0xc2')]?!![]:![]}];}if(!_0x37b469['query'][_0x9009('0x4f')](_0x9009('0x50'))){_0x25d20e[_0x9009('0x2c')]=qs[_0x9009('0x2c')](_0x37b469[_0x9009('0x49')][_0x9009('0x2c')]);_0x25d20e[_0x9009('0x2b')]=qs['offset'](_0x37b469[_0x9009('0x49')][_0x9009('0x2b')]);}return _0x33b5b6['getContacts'](_0x25d20e);}})[_0x9009('0x20')](function(_0x12c3c2){if(_0x12c3c2){return _0x12c3c2?{'count':_0xa57745,'rows':_0x12c3c2}:null;}})[_0x9009('0x20')](respondWithResult(_0x2bdc6b,null))[_0x9009('0x5f')](handleError(_0x2bdc6b,null));};exports[_0x9009('0xc3')]=function(_0x4a5189,_0x423c34,_0xaf2b2f){var _0x1f9dc3;var _0xa4128d;var _0x4f1817={};var _0x26700e;return db[_0x9009('0x44')][_0x9009('0x99')]({'where':{'id':_0x4a5189[_0x9009('0x64')]['id']},'attributes':['id',_0x9009('0x3e'),_0x9009('0x3d')]})[_0x9009('0x20')](handleEntityNotFound(_0x423c34,null))[_0x9009('0x20')](function(_0x442aa4){if(!utils[_0x9009('0x9d')](_0x4a5189['query'][_0x9009('0x9a')])){throw new db[(_0x9009('0x92'))][(_0x9009('0x94'))]('Unknown\x20channel');}_0x1f9dc3=_0x442aa4;var _0x13b51f={};_0x13b51f[_0x9009('0x46')]=_[_0x9009('0x4a')](db[_[_0x9009('0xa0')](_0x4a5189[_0x9009('0x49')][_0x9009('0x9a')])+_0x9009('0xc4')][_0x9009('0x45')]);_0x13b51f[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x4a5189[_0x9009('0x49')]);_0x13b51f[_0x9009('0x4b')]=_[_0x9009('0x4c')](_0x13b51f['model'],_0x13b51f[_0x9009('0x49')]);_0x4f1817[_0x9009('0x4d')]=_[_0x9009('0x4c')](_0x13b51f[_0x9009('0x46')],qs[_0x9009('0x4e')](_0x4a5189['query'][_0x9009('0x4e')]));_0x4f1817[_0x9009('0x4d')]=_0x4f1817['attributes'][_0x9009('0xa4')]?_0x4f1817[_0x9009('0x4d')]:_0x13b51f[_0x9009('0x46')];_0x4f1817['order']=qs[_0x9009('0x52')](_0x4a5189[_0x9009('0x49')]['sort']);_0x4f1817[_0x9009('0x53')]=qs[_0x9009('0x4b')](_[_0x9009('0x54')](_0x4a5189[_0x9009('0x49')],_0x13b51f[_0x9009('0x4b')]));if(_0x4a5189[_0x9009('0x49')][_0x9009('0x38')]){_0x4f1817[_0x9009('0x53')]=_['merge'](_0x4f1817[_0x9009('0x53')],{'$or':_[_0x9009('0x56')](_0x4f1817[_0x9009('0x4d')],function(_0x3d6dba){var _0x59f077={};_0x59f077[_0x3d6dba]={'$like':'%'+_0x4a5189[_0x9009('0x49')][_0x9009('0x38')]+'%'};return _0x59f077;})});}_0x4f1817=_[_0x9009('0x55')]({},_0x4f1817,_0x4a5189[_0x9009('0x5a')]);switch(_0x1f9dc3[_0x9009('0x3d')]){case _0x9009('0x6b'):return db[_[_0x9009('0xa0')](_0x4a5189[_0x9009('0x49')][_0x9009('0x9a')])+_0x9009('0xc4')][_0x9009('0x5d')](_0x4f1817);case _0x9009('0x34'):case _0x9009('0x36'):return _0x1f9dc3[_0x9009('0x89')+_[_0x9009('0xa0')](_0x4a5189[_0x9009('0x49')][_0x9009('0x9a')])+'Queues'](_0x4f1817);default:throw new db[(_0x9009('0x92'))][(_0x9009('0x94'))](_0x9009('0xc5'));}})[_0x9009('0x20')](function(_0x375fed){_0x26700e=_0x375fed[_0x9009('0xa4')];if(!_0x4a5189['query'][_0x9009('0x4f')](_0x9009('0x50'))){_0x4f1817[_0x9009('0x2c')]=qs[_0x9009('0x2c')](_0x4a5189[_0x9009('0x49')][_0x9009('0x2c')]);_0x4f1817[_0x9009('0x2b')]=qs[_0x9009('0x2b')](_0x4a5189[_0x9009('0x49')][_0x9009('0x2b')]);}switch(_0x1f9dc3[_0x9009('0x3d')]){case _0x9009('0x6b'):return db[_[_0x9009('0xa0')](_0x4a5189['query'][_0x9009('0x9a')])+_0x9009('0xc4')][_0x9009('0x5d')](_0x4f1817);case _0x9009('0x34'):case _0x9009('0x36'):return _0x1f9dc3[_0x9009('0x89')+_[_0x9009('0xa0')](_0x4a5189[_0x9009('0x49')][_0x9009('0x9a')])+'Queues'](_0x4f1817);}})['then'](function(_0x5634a5){return{'count':_0x26700e,'rows':_0x5634a5};})[_0x9009('0x20')](respondWithResult(_0x423c34,null))[_0x9009('0x5f')](handleError(_0x423c34,null));};exports[_0x9009('0xc6')]=function(_0x3b598d,_0xe8c239,_0x451e){var _0x4998f7={};var _0x1122a3={};var _0x48d23a;var _0x298ed6;return db[_0x9009('0x44')][_0x9009('0x99')]({'where':{'id':_0x3b598d[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0xe8c239,null))[_0x9009('0x20')](function(_0x4d3e9e){if(_0x4d3e9e){_0x48d23a=_0x4d3e9e;_0x1122a3['model']=_[_0x9009('0x4a')](db['UserVoiceQueueRt']['rawAttributes']);_0x1122a3[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x3b598d[_0x9009('0x49')]);_0x1122a3[_0x9009('0x4b')]=_[_0x9009('0x4c')](_0x1122a3['model'],_0x1122a3[_0x9009('0x49')]);_0x4998f7[_0x9009('0x4d')]=_[_0x9009('0x4c')](_0x1122a3[_0x9009('0x46')],qs['fields'](_0x3b598d[_0x9009('0x49')][_0x9009('0x4e')]));_0x4998f7[_0x9009('0x4d')]=_0x4998f7[_0x9009('0x4d')][_0x9009('0xa4')]?_0x4998f7[_0x9009('0x4d')]:_0x1122a3['model'];_0x4998f7[_0x9009('0x51')]=qs[_0x9009('0x52')](_0x3b598d[_0x9009('0x49')][_0x9009('0x52')]);_0x4998f7[_0x9009('0x53')]=qs[_0x9009('0x4b')](_[_0x9009('0x54')](_0x3b598d[_0x9009('0x49')],_0x1122a3[_0x9009('0x4b')]));if(_0x3b598d[_0x9009('0x49')][_0x9009('0x38')]){_0x4998f7[_0x9009('0x53')]=_[_0x9009('0x55')](_0x4998f7['where'],{'$or':_[_0x9009('0x56')](_0x4998f7[_0x9009('0x4d')],function(_0x322043){var _0x1c3bf4={};_0x1c3bf4[_0x322043]={'$like':'%'+_0x3b598d[_0x9009('0x49')][_0x9009('0x38')]+'%'};return _0x1c3bf4;})});}_0x4998f7=_[_0x9009('0x55')]({},_0x4998f7,_0x3b598d[_0x9009('0x5a')]);return _0x48d23a[_0x9009('0xc6')](_0x4998f7);}})[_0x9009('0x20')](function(_0x27c0ca){if(_0x27c0ca){_0x298ed6=_0x27c0ca[_0x9009('0xa4')];if(!_0x3b598d[_0x9009('0x49')][_0x9009('0x4f')](_0x9009('0x50'))){_0x4998f7[_0x9009('0x2c')]=qs[_0x9009('0x2c')](_0x3b598d[_0x9009('0x49')]['limit']);_0x4998f7[_0x9009('0x2b')]=qs[_0x9009('0x2b')](_0x3b598d[_0x9009('0x49')][_0x9009('0x2b')]);}return _0x48d23a[_0x9009('0xc6')](_0x4998f7);}})[_0x9009('0x20')](function(_0x1c2a75){if(_0x1c2a75){return _0x1c2a75?{'count':_0x298ed6,'rows':_0x1c2a75}:null;}})['then'](respondWithResult(_0xe8c239,null))['catch'](handleError(_0xe8c239,null));};exports[_0x9009('0xc7')]=function(_0x3ef4ed,_0xb6e49a,_0x3b4399){var _0x3a451f={};var _0x456717={};var _0xda68c;var _0x207c09;return db[_0x9009('0x44')][_0x9009('0x99')]({'where':{'id':_0x3ef4ed[_0x9009('0x64')]['id']}})['then'](handleEntityNotFound(_0xb6e49a,null))[_0x9009('0x20')](function(_0x123361){if(_0x123361){_0xda68c=_0x123361;_0x456717[_0x9009('0x46')]=_[_0x9009('0x4a')](db[_0x9009('0xc8')][_0x9009('0x45')]);_0x456717[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x3ef4ed[_0x9009('0x49')]);_0x456717['filters']=_[_0x9009('0x4c')](_0x456717[_0x9009('0x46')],_0x456717[_0x9009('0x49')]);_0x3a451f[_0x9009('0x4d')]=_[_0x9009('0x4c')](_0x456717[_0x9009('0x46')],qs['fields'](_0x3ef4ed[_0x9009('0x49')][_0x9009('0x4e')]));_0x3a451f[_0x9009('0x4d')]=_0x3a451f[_0x9009('0x4d')][_0x9009('0xa4')]?_0x3a451f['attributes']:_0x456717[_0x9009('0x46')];_0x3a451f[_0x9009('0x51')]=qs[_0x9009('0x52')](_0x3ef4ed[_0x9009('0x49')][_0x9009('0x52')]);_0x3a451f[_0x9009('0x53')]=qs[_0x9009('0x4b')](_[_0x9009('0x54')](_0x3ef4ed[_0x9009('0x49')],_0x456717[_0x9009('0x4b')]));if(_0x3ef4ed['query'][_0x9009('0x38')]){_0x3a451f[_0x9009('0x53')]=_['merge'](_0x3a451f[_0x9009('0x53')],{'$or':_[_0x9009('0x56')](_0x3a451f[_0x9009('0x4d')],function(_0x39f22d){var _0x3a32d5={};_0x3a32d5[_0x39f22d]={'$like':'%'+_0x3ef4ed['query'][_0x9009('0x38')]+'%'};return _0x3a32d5;})});}_0x3a451f=_['merge']({},_0x3a451f,_0x3ef4ed['options']);return _0xda68c[_0x9009('0xc7')](_0x3a451f);}})['then'](function(_0x12676e){if(_0x12676e){_0x207c09=_0x12676e['length'];if(!_0x3ef4ed['query'][_0x9009('0x4f')](_0x9009('0x50'))){_0x3a451f[_0x9009('0x2c')]=qs[_0x9009('0x2c')](_0x3ef4ed[_0x9009('0x49')][_0x9009('0x2c')]);_0x3a451f[_0x9009('0x2b')]=qs['offset'](_0x3ef4ed[_0x9009('0x49')][_0x9009('0x2b')]);}return _0xda68c[_0x9009('0xc7')](_0x3a451f);}})[_0x9009('0x20')](function(_0x11685a){if(_0x11685a){return _0x11685a?{'count':_0x207c09,'rows':_0x11685a}:null;}})[_0x9009('0x20')](respondWithResult(_0xb6e49a,null))[_0x9009('0x5f')](handleError(_0xb6e49a,null));};exports[_0x9009('0xc9')]=function(_0x28c10b,_0x295521,_0x4b956a){var _0x1e943f={'raw':!![],'where':{}};var _0x59b212={};var _0x5562d1={'count':0x0,'rows':[]};return db[_0x9009('0x44')][_0x9009('0x99')]({'where':{'id':_0x28c10b[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x295521,null))[_0x9009('0x20')](function(_0x46b468){if(_0x46b468){_0x59b212['model']=_['keys'](db[_0x9009('0xca')][_0x9009('0x45')]);_0x59b212[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x28c10b[_0x9009('0x49')]);_0x59b212[_0x9009('0x4b')]=_['intersection'](_0x59b212['model'],_0x59b212['query']);_0x1e943f[_0x9009('0x4d')]=_['intersection'](_0x59b212['model'],qs[_0x9009('0x4e')](_0x28c10b[_0x9009('0x49')][_0x9009('0x4e')]));_0x1e943f['attributes']=_0x1e943f[_0x9009('0x4d')][_0x9009('0xa4')]?_0x1e943f['attributes']:_0x59b212[_0x9009('0x46')];if(!_0x28c10b[_0x9009('0x49')][_0x9009('0x4f')](_0x9009('0x50'))){_0x1e943f[_0x9009('0x2c')]=qs['limit'](_0x28c10b['query'][_0x9009('0x2c')]);_0x1e943f[_0x9009('0x2b')]=qs[_0x9009('0x2b')](_0x28c10b[_0x9009('0x49')]['offset']);}_0x1e943f[_0x9009('0x51')]=qs['sort'](_0x28c10b[_0x9009('0x49')][_0x9009('0x52')]);_0x1e943f[_0x9009('0x53')]=qs[_0x9009('0x4b')](_['pick'](_0x28c10b[_0x9009('0x49')],_0x59b212['filters']));_0x1e943f[_0x9009('0x53')][_0x9009('0xcb')]=_0x46b468['id'];if(_0x28c10b[_0x9009('0x49')][_0x9009('0x38')]){_0x1e943f[_0x9009('0x53')]=_[_0x9009('0x55')](_0x1e943f[_0x9009('0x53')],{'$or':_['map'](_0x1e943f[_0x9009('0x4d')],function(_0x201bf6){var _0x5dc818={};_0x5dc818[_0x201bf6]={'$like':'%'+_0x28c10b[_0x9009('0x49')][_0x9009('0x38')]+'%'};return _0x5dc818;})});}_0x1e943f=_[_0x9009('0x55')]({},_0x1e943f,_0x28c10b[_0x9009('0x5a')]);return db[_0x9009('0xca')][_0x9009('0x2a')]({'where':_0x1e943f[_0x9009('0x53')]})[_0x9009('0x20')](function(_0x394ee9){_0x5562d1['count']=_0x394ee9;if(_0x28c10b['query']['includeAll']){_0x1e943f[_0x9009('0x5c')]=[{'all':!![]}];}return db['VoiceRecording'][_0x9009('0x5d')](_0x1e943f);})[_0x9009('0x20')](function(_0xe6196c){_0x5562d1[_0x9009('0x5e')]=_0xe6196c;return _0x5562d1;});}})['then'](respondWithFilteredResult(_0x295521,_0x1e943f))['catch'](handleError(_0x295521,null));};exports[_0x9009('0xcc')]=function(_0x41f243,_0x282186,_0x195cdb){var _0x4e5458={'raw':!![],'where':{}};var _0x48507b={};var _0x2c568d={'count':0x0,'rows':[]};return db[_0x9009('0x44')][_0x9009('0x99')]({'where':{'id':_0x41f243['params']['id']}})['then'](handleEntityNotFound(_0x282186,null))[_0x9009('0x20')](function(_0x2770d4){if(_0x2770d4){_0x48507b[_0x9009('0x46')]=_['keys'](db['ScreenRecording'][_0x9009('0x45')]);_0x48507b[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x41f243[_0x9009('0x49')]);_0x48507b['filters']=_[_0x9009('0x4c')](_0x48507b['model'],_0x48507b[_0x9009('0x49')]);_0x4e5458[_0x9009('0x4d')]=_[_0x9009('0x4c')](_0x48507b[_0x9009('0x46')],qs[_0x9009('0x4e')](_0x41f243[_0x9009('0x49')][_0x9009('0x4e')]));_0x4e5458[_0x9009('0x4d')]=_0x4e5458[_0x9009('0x4d')][_0x9009('0xa4')]?_0x4e5458[_0x9009('0x4d')]:_0x48507b[_0x9009('0x46')];if(!_0x41f243['query']['hasOwnProperty'](_0x9009('0x50'))){_0x4e5458[_0x9009('0x2c')]=qs[_0x9009('0x2c')](_0x41f243[_0x9009('0x49')][_0x9009('0x2c')]);_0x4e5458['offset']=qs[_0x9009('0x2b')](_0x41f243[_0x9009('0x49')][_0x9009('0x2b')]);}_0x4e5458[_0x9009('0x51')]=qs[_0x9009('0x52')](_0x41f243[_0x9009('0x49')][_0x9009('0x52')]);_0x4e5458[_0x9009('0x53')]=qs['filters'](_[_0x9009('0x54')](_0x41f243[_0x9009('0x49')],_0x48507b[_0x9009('0x4b')]));_0x4e5458['where']['UserId']=_0x2770d4['id'];if(_0x41f243['query'][_0x9009('0x38')]){_0x4e5458[_0x9009('0x53')]=_[_0x9009('0x55')](_0x4e5458[_0x9009('0x53')],{'$or':_[_0x9009('0x56')](_0x4e5458[_0x9009('0x4d')],function(_0x16927f){var _0x522cfe={};_0x522cfe[_0x16927f]={'$like':'%'+_0x41f243[_0x9009('0x49')]['filter']+'%'};return _0x522cfe;})});}_0x4e5458=_[_0x9009('0x55')]({},_0x4e5458,_0x41f243['options']);return db[_0x9009('0xcd')]['count']({'where':_0x4e5458[_0x9009('0x53')]})[_0x9009('0x20')](function(_0x5ac2e4){_0x2c568d['count']=_0x5ac2e4;if(_0x41f243[_0x9009('0x49')]['includeAll']){_0x4e5458[_0x9009('0x5c')]=[{'all':!![]}];}return db[_0x9009('0xcd')][_0x9009('0x5d')](_0x4e5458);})[_0x9009('0x20')](function(_0xc47eae){_0x2c568d[_0x9009('0x5e')]=_0xc47eae;return _0x2c568d;});}})[_0x9009('0x20')](respondWithFilteredResult(_0x282186,_0x4e5458))[_0x9009('0x5f')](handleError(_0x282186,null));};exports[_0x9009('0xce')]=function(_0x49929d,_0x3a122f,_0x3372f3){var _0x1f2f54={};var _0x3b9055={};var _0x487a80;var _0x3b47a3;return db[_0x9009('0x44')]['findOne']({'where':{'id':_0x49929d['params']['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x3a122f,null))[_0x9009('0x20')](function(_0x656a6d){if(_0x656a6d){_0x487a80=_0x656a6d;_0x3b9055[_0x9009('0x46')]=_[_0x9009('0x4a')](db[_0x9009('0xcf')][_0x9009('0x45')]);_0x3b9055[_0x9009('0x49')]=_['keys'](_0x49929d[_0x9009('0x49')]);_0x3b9055[_0x9009('0x4b')]=_['intersection'](_0x3b9055[_0x9009('0x46')],_0x3b9055[_0x9009('0x49')]);_0x1f2f54[_0x9009('0x4d')]=_[_0x9009('0x4c')](_0x3b9055[_0x9009('0x46')],qs[_0x9009('0x4e')](_0x49929d[_0x9009('0x49')][_0x9009('0x4e')]));_0x1f2f54[_0x9009('0x4d')]=_0x1f2f54[_0x9009('0x4d')][_0x9009('0xa4')]?_0x1f2f54[_0x9009('0x4d')]:_0x3b9055[_0x9009('0x46')];_0x1f2f54['order']=qs['sort'](_0x49929d[_0x9009('0x49')][_0x9009('0x52')]);_0x1f2f54['where']=qs['filters'](_['pick'](_0x49929d[_0x9009('0x49')],_0x3b9055['filters']));if(_0x49929d[_0x9009('0x49')][_0x9009('0x38')]){_0x1f2f54[_0x9009('0x53')]=_[_0x9009('0x55')](_0x1f2f54[_0x9009('0x53')],{'$or':_[_0x9009('0x56')](_0x1f2f54[_0x9009('0x4d')],function(_0xd2bf3){var _0x38ca0c={};_0x38ca0c[_0xd2bf3]={'$like':'%'+_0x49929d[_0x9009('0x49')][_0x9009('0x38')]+'%'};return _0x38ca0c;})});}_0x1f2f54=_[_0x9009('0x55')]({},_0x1f2f54,_0x49929d[_0x9009('0x5a')]);return _0x487a80[_0x9009('0xce')](_0x1f2f54);}})[_0x9009('0x20')](function(_0x1e3910){if(_0x1e3910){_0x3b47a3=_0x1e3910['length'];if(!_0x49929d['query']['hasOwnProperty'](_0x9009('0x50'))){_0x1f2f54[_0x9009('0x2c')]=qs[_0x9009('0x2c')](_0x49929d[_0x9009('0x49')][_0x9009('0x2c')]);_0x1f2f54[_0x9009('0x2b')]=qs[_0x9009('0x2b')](_0x49929d[_0x9009('0x49')]['offset']);}return _0x487a80['getChatInteractions'](_0x1f2f54);}})[_0x9009('0x20')](function(_0x599f05){if(_0x599f05){return _0x599f05?{'count':_0x3b47a3,'rows':_0x599f05}:null;}})['then'](respondWithResult(_0x3a122f,null))[_0x9009('0x5f')](handleError(_0x3a122f,null));};exports['getOpenchannelInteractions']=function(_0x400f51,_0x4ab51f,_0x42dc7f){var _0x50d972={};var _0x16e3cb={};var _0x1b474f;var _0x1ebe18;return db['User'][_0x9009('0x99')]({'where':{'id':_0x400f51[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x4ab51f,null))[_0x9009('0x20')](function(_0x5a94ac){if(_0x5a94ac){_0x1b474f=_0x5a94ac;_0x16e3cb[_0x9009('0x46')]=_[_0x9009('0x4a')](db[_0x9009('0xd0')][_0x9009('0x45')]);_0x16e3cb[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x400f51[_0x9009('0x49')]);_0x16e3cb[_0x9009('0x4b')]=_[_0x9009('0x4c')](_0x16e3cb[_0x9009('0x46')],_0x16e3cb[_0x9009('0x49')]);_0x50d972['attributes']=_[_0x9009('0x4c')](_0x16e3cb[_0x9009('0x46')],qs[_0x9009('0x4e')](_0x400f51[_0x9009('0x49')][_0x9009('0x4e')]));_0x50d972['attributes']=_0x50d972['attributes'][_0x9009('0xa4')]?_0x50d972[_0x9009('0x4d')]:_0x16e3cb[_0x9009('0x46')];_0x50d972[_0x9009('0x51')]=qs[_0x9009('0x52')](_0x400f51[_0x9009('0x49')][_0x9009('0x52')]);_0x50d972['where']=qs['filters'](_['pick'](_0x400f51[_0x9009('0x49')],_0x16e3cb['filters']));if(_0x400f51['query'][_0x9009('0x38')]){_0x50d972[_0x9009('0x53')]=_[_0x9009('0x55')](_0x50d972[_0x9009('0x53')],{'$or':_[_0x9009('0x56')](_0x50d972[_0x9009('0x4d')],function(_0x433b01){var _0x403b75={};_0x403b75[_0x433b01]={'$like':'%'+_0x400f51[_0x9009('0x49')][_0x9009('0x38')]+'%'};return _0x403b75;})});}_0x50d972=_[_0x9009('0x55')]({},_0x50d972,_0x400f51['options']);return _0x1b474f[_0x9009('0xd1')](_0x50d972);}})[_0x9009('0x20')](function(_0x109dbc){if(_0x109dbc){_0x1ebe18=_0x109dbc['length'];if(!_0x400f51[_0x9009('0x49')]['hasOwnProperty']('nolimit')){_0x50d972[_0x9009('0x2c')]=qs[_0x9009('0x2c')](_0x400f51[_0x9009('0x49')][_0x9009('0x2c')]);_0x50d972[_0x9009('0x2b')]=qs[_0x9009('0x2b')](_0x400f51['query'][_0x9009('0x2b')]);}return _0x1b474f['getOpenchannelInteractions'](_0x50d972);}})[_0x9009('0x20')](function(_0x26c679){if(_0x26c679){return _0x26c679?{'count':_0x1ebe18,'rows':_0x26c679}:null;}})['then'](respondWithResult(_0x4ab51f,null))[_0x9009('0x5f')](handleError(_0x4ab51f,null));};exports[_0x9009('0xd2')]=function(_0x5cc88d,_0x11ace7,_0x5c944c){var _0x3ed374={'raw':!![],'where':{}};var _0x4d18d4={};var _0x55bd88={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x5cc88d[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x11ace7,null))[_0x9009('0x20')](function(_0x31c6ed){if(_0x31c6ed){_0x4d18d4['model']=_['keys'](db[_0x9009('0xd3')]['rawAttributes']);_0x4d18d4[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x5cc88d[_0x9009('0x49')]);_0x4d18d4[_0x9009('0x4b')]=_[_0x9009('0x4c')](_0x4d18d4[_0x9009('0x46')],_0x4d18d4[_0x9009('0x49')]);_0x3ed374[_0x9009('0x4d')]=_['intersection'](_0x4d18d4['model'],qs[_0x9009('0x4e')](_0x5cc88d[_0x9009('0x49')][_0x9009('0x4e')]));_0x3ed374[_0x9009('0x4d')]=_0x3ed374['attributes'][_0x9009('0xa4')]?_0x3ed374[_0x9009('0x4d')]:_0x4d18d4['model'];if(!_0x5cc88d[_0x9009('0x49')][_0x9009('0x4f')]('nolimit')){_0x3ed374[_0x9009('0x2c')]=qs[_0x9009('0x2c')](_0x5cc88d[_0x9009('0x49')][_0x9009('0x2c')]);_0x3ed374['offset']=qs[_0x9009('0x2b')](_0x5cc88d[_0x9009('0x49')]['offset']);}_0x3ed374[_0x9009('0x51')]=qs[_0x9009('0x52')](_0x5cc88d[_0x9009('0x49')][_0x9009('0x52')]);_0x3ed374['where']=qs[_0x9009('0x4b')](_[_0x9009('0x54')](_0x5cc88d[_0x9009('0x49')],_0x4d18d4[_0x9009('0x4b')]));_0x3ed374[_0x9009('0x53')]['UserId']=_0x31c6ed['id'];if(_0x5cc88d['query'][_0x9009('0x38')]){_0x3ed374[_0x9009('0x53')]=_['merge'](_0x3ed374[_0x9009('0x53')],{'$or':_['map'](_0x3ed374[_0x9009('0x4d')],function(_0x492d73){var _0x518619={};_0x518619[_0x492d73]={'$like':'%'+_0x5cc88d[_0x9009('0x49')][_0x9009('0x38')]+'%'};return _0x518619;})});}_0x3ed374=_[_0x9009('0x55')]({},_0x3ed374,_0x5cc88d[_0x9009('0x5a')]);return db[_0x9009('0xd3')][_0x9009('0x2a')]({'where':_0x3ed374[_0x9009('0x53')]})['then'](function(_0x281999){_0x55bd88[_0x9009('0x2a')]=_0x281999;if(_0x5cc88d['query'][_0x9009('0x5b')]){_0x3ed374[_0x9009('0x5c')]=[{'all':!![]}];}return db[_0x9009('0xd3')]['findAll'](_0x3ed374);})[_0x9009('0x20')](function(_0x2daa45){_0x55bd88[_0x9009('0x5e')]=_0x2daa45;return _0x55bd88;});}})['then'](respondWithFilteredResult(_0x11ace7,_0x3ed374))[_0x9009('0x5f')](handleError(_0x11ace7,null));};exports[_0x9009('0xd4')]=function(_0x2eb9fd,_0x596172,_0x5a3011){var _0x329ef0={};var _0x1bedec={};var _0x5f8c27;var _0x2744f7;return db[_0x9009('0x44')][_0x9009('0x99')]({'where':{'id':_0x2eb9fd[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x596172,null))['then'](function(_0x273d75){if(_0x273d75){_0x5f8c27=_0x273d75;_0x1bedec[_0x9009('0x46')]=_[_0x9009('0x4a')](db[_0x9009('0xd5')][_0x9009('0x45')]);_0x1bedec['query']=_['keys'](_0x2eb9fd[_0x9009('0x49')]);_0x1bedec[_0x9009('0x4b')]=_['intersection'](_0x1bedec[_0x9009('0x46')],_0x1bedec[_0x9009('0x49')]);_0x329ef0['attributes']=_['intersection'](_0x1bedec[_0x9009('0x46')],qs[_0x9009('0x4e')](_0x2eb9fd['query'][_0x9009('0x4e')]));_0x329ef0[_0x9009('0x4d')]=_0x329ef0[_0x9009('0x4d')][_0x9009('0xa4')]?_0x329ef0[_0x9009('0x4d')]:_0x1bedec[_0x9009('0x46')];_0x329ef0[_0x9009('0x51')]=qs[_0x9009('0x52')](_0x2eb9fd[_0x9009('0x49')][_0x9009('0x52')]);_0x329ef0[_0x9009('0x53')]=qs[_0x9009('0x4b')](_[_0x9009('0x54')](_0x2eb9fd[_0x9009('0x49')],_0x1bedec[_0x9009('0x4b')]));if(_0x2eb9fd[_0x9009('0x49')]['filter']){_0x329ef0['where']=_[_0x9009('0x55')](_0x329ef0[_0x9009('0x53')],{'$or':_[_0x9009('0x56')](_0x329ef0['attributes'],function(_0x3b1a0c){var _0x4087d6={};_0x4087d6[_0x3b1a0c]={'$like':'%'+_0x2eb9fd[_0x9009('0x49')][_0x9009('0x38')]+'%'};return _0x4087d6;})});}_0x329ef0=_[_0x9009('0x55')]({},_0x329ef0,_0x2eb9fd['options']);return _0x5f8c27['getSmsInteractions'](_0x329ef0);}})[_0x9009('0x20')](function(_0x2398b1){if(_0x2398b1){_0x2744f7=_0x2398b1['length'];if(!_0x2eb9fd[_0x9009('0x49')]['hasOwnProperty'](_0x9009('0x50'))){_0x329ef0[_0x9009('0x2c')]=qs[_0x9009('0x2c')](_0x2eb9fd[_0x9009('0x49')]['limit']);_0x329ef0[_0x9009('0x2b')]=qs[_0x9009('0x2b')](_0x2eb9fd[_0x9009('0x49')][_0x9009('0x2b')]);}return _0x5f8c27[_0x9009('0xd4')](_0x329ef0);}})['then'](function(_0x1f56ae){if(_0x1f56ae){return _0x1f56ae?{'count':_0x2744f7,'rows':_0x1f56ae}:null;}})[_0x9009('0x20')](respondWithResult(_0x596172,null))['catch'](handleError(_0x596172,null));};exports[_0x9009('0xd6')]=function(_0x4cd872,_0x58480d,_0x27f507){var _0x48677d={};var _0x2ae74d={};var _0x1193f7;var _0x420c1c;return db['User'][_0x9009('0x99')]({'where':{'id':_0x4cd872[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x58480d,null))[_0x9009('0x20')](function(_0x3680c0){if(_0x3680c0){_0x1193f7=_0x3680c0;_0x2ae74d[_0x9009('0x46')]=_['keys'](db[_0x9009('0xd7')][_0x9009('0x45')]);_0x2ae74d['query']=_[_0x9009('0x4a')](_0x4cd872[_0x9009('0x49')]);_0x2ae74d[_0x9009('0x4b')]=_[_0x9009('0x4c')](_0x2ae74d['model'],_0x2ae74d[_0x9009('0x49')]);_0x48677d[_0x9009('0x4d')]=_[_0x9009('0x4c')](_0x2ae74d['model'],qs['fields'](_0x4cd872[_0x9009('0x49')][_0x9009('0x4e')]));_0x48677d[_0x9009('0x4d')]=_0x48677d[_0x9009('0x4d')][_0x9009('0xa4')]?_0x48677d[_0x9009('0x4d')]:_0x2ae74d[_0x9009('0x46')];_0x48677d[_0x9009('0x51')]=qs[_0x9009('0x52')](_0x4cd872[_0x9009('0x49')][_0x9009('0x52')]);_0x48677d[_0x9009('0x53')]=qs['filters'](_[_0x9009('0x54')](_0x4cd872['query'],_0x2ae74d[_0x9009('0x4b')]));if(_0x4cd872[_0x9009('0x49')][_0x9009('0x38')]){_0x48677d[_0x9009('0x53')]=_[_0x9009('0x55')](_0x48677d[_0x9009('0x53')],{'$or':_['map'](_0x48677d[_0x9009('0x4d')],function(_0x4e11f6){var _0x46b209={};_0x46b209[_0x4e11f6]={'$like':'%'+_0x4cd872[_0x9009('0x49')][_0x9009('0x38')]+'%'};return _0x46b209;})});}_0x48677d=_[_0x9009('0x55')]({},_0x48677d,_0x4cd872[_0x9009('0x5a')]);return _0x1193f7[_0x9009('0xd6')](_0x48677d);}})['then'](function(_0x1680e4){if(_0x1680e4){_0x420c1c=_0x1680e4[_0x9009('0xa4')];if(!_0x4cd872[_0x9009('0x49')][_0x9009('0x4f')](_0x9009('0x50'))){_0x48677d[_0x9009('0x2c')]=qs[_0x9009('0x2c')](_0x4cd872['query'][_0x9009('0x2c')]);_0x48677d[_0x9009('0x2b')]=qs[_0x9009('0x2b')](_0x4cd872[_0x9009('0x49')][_0x9009('0x2b')]);}return _0x1193f7[_0x9009('0xd6')](_0x48677d);}})['then'](function(_0xfb6db7){if(_0xfb6db7){return _0xfb6db7?{'count':_0x420c1c,'rows':_0xfb6db7}:null;}})['then'](respondWithResult(_0x58480d,null))['catch'](handleError(_0x58480d,null));};exports[_0x9009('0xd8')]=function(_0x3a6abd,_0x55c8da,_0x275118){var _0x221780;var _0xde70a2;var _0x3cf135;return db[_0x9009('0x44')]['find']({'where':{'id':_0x3a6abd['params']['id'],'role':_0x9009('0x36')},'attributes':['id',_0x9009('0x3e'),_0x9009('0xd9'),_0x9009('0xda'),_0x9009('0x3d'),'internal','loginInPause']})[_0x9009('0x20')](handleEntityNotFound(_0x55c8da,null))['then'](function(_0x16b3c8){if(_0x16b3c8){_0x221780=_0x16b3c8;if(_0x3a6abd[_0x9009('0x63')][_0x9009('0xaa')]){_0x3cf135=util[_0x9009('0x72')](_0x9009('0xdb'),_0x221780[_0x3a6abd[_0x9009('0x63')][_0x9009('0xaa')]]);}else if(_0x3a6abd[_0x9009('0x63')][_0x9009('0xdc')]){_0x3cf135=util[_0x9009('0x72')]('SIP/%s',_0x3a6abd[_0x9009('0x63')][_0x9009('0xdc')]);}else{_0x3cf135=util[_0x9009('0x72')](_0x9009('0xdd'),_0x221780[_0x9009('0x3e')]);}socket['to'](util[_0x9009('0x72')](_0x9009('0xde'),_0x221780['name']))[_0x9009('0xa6')](_0x9009('0xdf'),{'ip':_0x3a6abd[_0x9009('0xe0')][_0x9009('0xe1')]||_0x3a6abd[_0x9009('0xe2')][_0x9009('0xe3')]||_0x3a6abd[_0x9009('0xe4')][_0x9009('0xe3')]||_0x3a6abd[_0x9009('0xe2')][_0x9009('0xe4')][_0x9009('0xe3')]});return db[_0x9009('0xac')][_0x9009('0xb0')]({'where':{'membername':_0x221780[_0x9009('0x3e')]},'individualHooks':!![]});}})[_0x9009('0x20')](function(_0x3c306f){if(_0x221780){return _0x221780[_0x9009('0xe5')]({'raw':!![]});}})[_0x9009('0x20')](function(_0x4c8a70){var _0x238998=[];if(_0x4c8a70){_0xde70a2=_0x4c8a70;if(_0xde70a2[_0x9009('0xa4')]){for(var _0x256a43=0x0;_0x256a43<_0xde70a2[_0x9009('0xa4')];_0x256a43++){_0x238998[_0x9009('0xa9')]({'membername':_0x221780[_0x9009('0x3e')],'UserId':_0x221780['id'],'queue_name':_0xde70a2[_0x256a43][_0x9009('0x3e')],'VoiceQueueId':_0xde70a2[_0x256a43]['id'],'interface':_0x3cf135,'paused':_0x221780[_0x9009('0xe6')]||![],'penalty':_0xde70a2[_0x256a43][_0x9009('0xe7')]||0x0});}return BPromise['each'](_0x238998,function(_0x48c435){return db[_0x9009('0xac')]['upsert'](_0x48c435);});}}})[_0x9009('0x20')](function(){return db[_0x9009('0xe8')]['findAll']({'where':{'membername':_0x221780['name'],'exitAt':null}});})[_0x9009('0x20')](function(_0x164856){var _0xe723e1=[];_0x164856[_0x9009('0xe9')](function(_0x28b289){_0xe723e1[_0x9009('0xa9')](_0x28b289[_0x9009('0x32')]({'exitAt':moment()[_0x9009('0x72')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x9009('0xea')](_0xe723e1);})['then'](function(){var _0x169f32=[];var _0x566ec2=[];var _0x5ef9ba=utils[_0x9009('0xeb')]();var _0x3736a0={'membername':_0x221780[_0x9009('0x3e')],'interface':_0x3cf135,'enterAt':moment()['format'](_0x9009('0xec')),'role':_0x221780[_0x9009('0x3d')],'internal':_0x221780[_0x9009('0x74')]};_0x5ef9ba[_0x9009('0xe9')](function(_0x1ebcba){_0x169f32[_0x9009('0xa9')](_[_0x9009('0x55')]({'channel':_0x1ebcba,'type':_0x9009('0xed'),'data1':_0x3a6abd[_0x9009('0x63')][_0x9009('0xee')],'data2':_0x3cf135},_0x3736a0));if(_0x221780[_0x9009('0xe6')]){_0x566ec2['push'](_[_0x9009('0x55')]({'channel':_0x1ebcba,'type':_0x9009('0xef'),'data1':_0x9009('0xf0')},_0x3736a0));}});return db['MemberReport'][_0x9009('0x62')](_0x169f32['concat'](_0x566ec2),{'individualHooks':!![]});})['then'](function(){return _0x221780[_0x9009('0x32')]({'online':!![],'lastLoginAt':moment()[_0x9009('0x72')](_0x9009('0xec')),'voicePause':_0x221780[_0x9009('0xe6')]||![],'mailPause':_0x221780[_0x9009('0xe6')]||![],'chatPause':_0x221780[_0x9009('0xe6')]||![],'faxPause':_0x221780[_0x9009('0xe6')]||![],'smsPause':_0x221780['loginInPause']||![],'openchannelPause':_0x221780[_0x9009('0xe6')]||![],'pauseType':_0x221780[_0x9009('0xe6')]?_0x9009('0xf0'):null,'interface':_0x3cf135,'lastPauseAt':moment()[_0x9009('0x72')](_0x9009('0xec'))});})[_0x9009('0x20')](respondWithResult(_0x55c8da,null))[_0x9009('0x5f')](handleError(_0x55c8da,null));};exports[_0x9009('0xf1')]=function(_0x4b863f,_0x6bb5c8,_0x571e8a){var _0x4e2c88;return db[_0x9009('0x44')][_0x9009('0x3c')]({'where':{'id':_0x4b863f['params']['id'],'role':_0x9009('0x36')},'attributes':['id',_0x9009('0x3e'),_0x9009('0x3d')]})[_0x9009('0x20')](handleEntityNotFound(_0x6bb5c8,null))[_0x9009('0x20')](function(_0x5104ba){if(_0x5104ba){_0x4e2c88=_0x5104ba;return db[_0x9009('0xac')]['destroy']({'where':{'membername':_0x4e2c88[_0x9009('0x3e')]},'individualHooks':!![]});}})[_0x9009('0x20')](function(){return db[_0x9009('0xe8')][_0x9009('0x5d')]({'where':{'membername':_0x4e2c88[_0x9009('0x3e')],'exitAt':null}});})['then'](function(_0x3f8333){var _0x123ecb=[];_0x3f8333[_0x9009('0xe9')](function(_0x5045fb){_0x123ecb[_0x9009('0xa9')](_0x5045fb[_0x9009('0x32')]({'exitAt':moment()[_0x9009('0x72')](_0x9009('0xec'))}));});return BPromise[_0x9009('0xea')](_0x123ecb);})[_0x9009('0x20')](function(){return _0x4e2c88['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x9009('0x20')](respondWithResult(_0x6bb5c8,null))[_0x9009('0x5f')](handleError(_0x6bb5c8,null));};exports[_0x9009('0xf2')]=function(_0x55bfa9,_0x5cd6ce,_0x302e8f){var _0x260851;return db[_0x9009('0xac')][_0x9009('0x32')]({'paused':0x1},{'where':{'UserId':_0x55bfa9[_0x9009('0x64')]['id']},'individualHooks':!![]})[_0x9009('0x20')](function(){return db['User']['find']({'where':{'id':_0x55bfa9[_0x9009('0x64')]['id'],'role':_0x9009('0x36')},'attributes':['id','name',_0x9009('0x3d'),_0x9009('0x74'),_0x9009('0xaa')]});})[_0x9009('0x20')](handleEntityNotFound(_0x5cd6ce,null))['then'](function(_0x2698ba){if(_0x2698ba){_0x260851=_0x2698ba;return respondWithRpcPromise(_0x9009('0xf3'),'pause',{'id':_0x260851['id'],'name':_0x260851['name'],'pause':!![]});}})[_0x9009('0x20')](function(){if(_0x260851){return db[_0x9009('0xe8')][_0x9009('0x5d')]({'where':{'membername':_0x260851[_0x9009('0x3e')],'type':'PAUSE','exitAt':null}});}})[_0x9009('0x20')](function(_0x359027){if(_0x359027[_0x9009('0xa4')]){var _0x431678=moment()[_0x9009('0x72')](_0x9009('0xec'));for(var _0xe679bf=0x0,_0x5776f3=_0x359027[_0x9009('0xa4')];_0xe679bf<_0x5776f3;_0xe679bf++){_0x359027[_0xe679bf][_0x9009('0xf4')]({'exitAt':_0x431678});}}})[_0x9009('0x20')](function(){var _0x20df5c=[];var _0x23f67f=utils[_0x9009('0xeb')]();_0x23f67f[_0x9009('0xe9')](function(_0x56e015){_0x20df5c[_0x9009('0xa9')]({'channel':_0x56e015,'membername':_0x260851[_0x9009('0x3e')],'interface':_['isNil'](_0x260851['interface'])?util[_0x9009('0x72')](_0x9009('0xdd'),_0x260851[_0x9009('0x3e')]):_0x260851[_0x9009('0xaa')],'type':_0x9009('0xef'),'enterAt':moment()[_0x9009('0x72')](_0x9009('0xec')),'data1':_0x55bfa9[_0x9009('0x63')][_0x9009('0xf5')]||_0x9009('0xf6'),'role':_0x260851[_0x9009('0x3d')],'internal':_0x260851[_0x9009('0x74')]});});return db[_0x9009('0xe8')][_0x9009('0x62')](_0x20df5c,{'individualHooks':!![]});})[_0x9009('0x20')](function(){return _0x260851[_0x9009('0x32')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x55bfa9[_0x9009('0x63')][_0x9009('0xf5')]||_0x9009('0xf6'),'lastPauseAt':moment()[_0x9009('0x72')](_0x9009('0xec'))});})[_0x9009('0x20')](respondWithResult(_0x5cd6ce,null))[_0x9009('0x5f')](handleError(_0x5cd6ce,null));};exports[_0x9009('0xf7')]=function(_0x57353b,_0x5b48e0,_0x3bb67){var _0x1b24a0;return db[_0x9009('0x44')]['find']({'where':{'id':_0x57353b[_0x9009('0x64')]['id']},'attributes':['id','name','role',_0x9009('0x9c'),_0x9009('0xf8'),'chatPause',_0x9009('0xf9'),_0x9009('0xfa'),_0x9009('0xfb'),_0x9009('0xfc'),_0x9009('0xfd')]})['then'](handleEntityNotFound(_0x5b48e0,null))[_0x9009('0x20')](function(_0x1878c5){if(_0x1878c5){_0x1b24a0=_0x1878c5;if(_0x57353b[_0x9009('0x63')]['channel']&&!utils[_0x9009('0x9d')](_0x57353b[_0x9009('0x63')][_0x9009('0x9a')])){throw new db[(_0x9009('0x92'))][(_0x9009('0x94'))](_0x9009('0x9e'));}switch(_0x57353b['body'][_0x9009('0x9a')]){case'voice':return respondWithRpcPromise(_0x9009('0xf3'),_0x9009('0xf7'),{'id':_0x1b24a0['id'],'name':_0x1b24a0[_0x9009('0x3e')],'pause':![]})[_0x9009('0x20')](function(){return db[_0x9009('0xac')][_0x9009('0x32')]({'paused':0x0},{'where':{'UserId':_0x1b24a0['id']},'individualHooks':!![]});})[_0x9009('0x20')](function(){return db[_0x9009('0xe8')][_0x9009('0x3c')]({'where':{'channel':_0x57353b['body']['channel'],'membername':_0x1b24a0['name'],'type':_0x9009('0xef'),'exitAt':null}});})['then'](function(_0x5b7b00){if(_0x5b7b00){return _0x5b7b00[_0x9009('0x32')]({'exitAt':moment()['format'](_0x9009('0xec')),'data2':_0x9009('0xfe')},{'individualHooks':!![]});}return null;})[_0x9009('0x20')](function(){return _0x1b24a0[_0x9009('0x32')]({'voicePause':![]});});case'mail':case _0x9009('0xff'):case'fax':case _0x9009('0x100'):case _0x9009('0x101'):return db[_0x9009('0xe8')]['find']({'where':{'channel':_0x57353b[_0x9009('0x63')][_0x9009('0x9a')],'membername':_0x1b24a0['name'],'type':_0x9009('0xef'),'exitAt':null}})[_0x9009('0x20')](function(_0x7df2ab){if(_0x7df2ab){return _0x7df2ab[_0x9009('0x32')]({'exitAt':moment()[_0x9009('0x72')](_0x9009('0xec')),'data2':_0x9009('0xfe')},{'individualHooks':!![]});}return null;})[_0x9009('0x20')](function(){var _0x127921={};_['set'](_0x127921,util[_0x9009('0x72')](_0x9009('0x102'),_0x57353b['body']['channel'],_0x9009('0x103')),![]);return _0x1b24a0[_0x9009('0x32')](_0x127921);});default:return respondWithRpcPromise(_0x9009('0xf3'),_0x9009('0xf7'),{'id':_0x1b24a0['id'],'name':_0x1b24a0[_0x9009('0x3e')],'pause':![]})[_0x9009('0x20')](function(){return db[_0x9009('0xac')][_0x9009('0x32')]({'paused':0x0},{'where':{'UserId':_0x1b24a0['id']}});})['then'](function(){return db['MemberReport'][_0x9009('0x5d')]({'where':{'membername':_0x1b24a0[_0x9009('0x3e')],'type':_0x9009('0xef'),'exitAt':null}});})[_0x9009('0x20')](function(_0x343594){var _0x5b9eb4=[];_0x343594[_0x9009('0xe9')](function(_0x473116){_0x5b9eb4[_0x9009('0xa9')](_0x473116[_0x9009('0x32')]({'exitAt':moment()[_0x9009('0x72')](_0x9009('0xec')),'data2':_0x9009('0xfe')}));});return BPromise[_0x9009('0xea')](_0x5b9eb4);})[_0x9009('0x20')](function(){return _0x1b24a0[_0x9009('0x32')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x9009('0x20')](respondWithResult(_0x5b48e0,null))[_0x9009('0x5f')](handleError(_0x5b48e0,null));};exports[_0x9009('0x104')]=function(_0x4b1eb7,_0xd54109,_0x76b752){var _0x4257da={};var _0x3503ea={};var _0x2d903d;var _0x161ff1;return db[_0x9009('0x44')][_0x9009('0x99')]({'where':{'id':_0x4b1eb7[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0xd54109,null))['then'](function(_0x14407e){if(_0x14407e){_0x2d903d=_0x14407e;_0x3503ea['model']=_[_0x9009('0x4a')](db[_0x9009('0x105')][_0x9009('0x45')]);_0x3503ea[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x4b1eb7['query']);_0x3503ea[_0x9009('0x4b')]=_[_0x9009('0x4c')](_0x3503ea['model'],_0x3503ea['query']);_0x4257da[_0x9009('0x4d')]=_[_0x9009('0x4c')](_0x3503ea[_0x9009('0x46')],qs[_0x9009('0x4e')](_0x4b1eb7[_0x9009('0x49')]['fields']));_0x4257da[_0x9009('0x4d')]=_0x4257da[_0x9009('0x4d')][_0x9009('0xa4')]?_0x4257da[_0x9009('0x4d')]:_0x3503ea[_0x9009('0x46')];_0x4257da[_0x9009('0x51')]=qs[_0x9009('0x52')](_0x4b1eb7[_0x9009('0x49')][_0x9009('0x52')]);_0x4257da[_0x9009('0x53')]=qs[_0x9009('0x4b')](_['pick'](_0x4b1eb7[_0x9009('0x49')],_0x3503ea[_0x9009('0x4b')]));if(_0x4b1eb7['query'][_0x9009('0x38')]){_0x4257da[_0x9009('0x53')]=_[_0x9009('0x55')](_0x4257da[_0x9009('0x53')],{'$or':_['map'](_0x4257da[_0x9009('0x4d')],function(_0xf1f49c){var _0x666787={};_0x666787[_0xf1f49c]={'$like':'%'+_0x4b1eb7[_0x9009('0x49')][_0x9009('0x38')]+'%'};return _0x666787;})});}_0x4257da=_[_0x9009('0x55')]({},_0x4257da,_0x4b1eb7['options']);return _0x2d903d[_0x9009('0x104')](_0x4257da);}})[_0x9009('0x20')](function(_0x3c78cd){if(_0x3c78cd){_0x161ff1=_0x3c78cd[_0x9009('0xa4')];if(!_0x4b1eb7[_0x9009('0x49')][_0x9009('0x4f')](_0x9009('0x50'))){_0x4257da[_0x9009('0x2c')]=qs[_0x9009('0x2c')](_0x4b1eb7[_0x9009('0x49')][_0x9009('0x2c')]);_0x4257da[_0x9009('0x2b')]=qs[_0x9009('0x2b')](_0x4b1eb7[_0x9009('0x49')][_0x9009('0x2b')]);}return _0x2d903d['getTeams'](_0x4257da);}})[_0x9009('0x20')](function(_0x3b24c0){if(_0x3b24c0){return _0x3b24c0?{'count':_0x161ff1,'rows':_0x3b24c0}:null;}})[_0x9009('0x20')](respondWithResult(_0xd54109,null))['catch'](handleError(_0xd54109,null));};exports['addTeams']=function(_0x42742f,_0x3f29d7,_0x38c18d){return db[_0x9009('0x44')][_0x9009('0x3c')]({'where':{'id':_0x42742f[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x3f29d7,null))[_0x9009('0x20')](function(_0xa2a2e8){if(_0xa2a2e8){return _0xa2a2e8['addTeams'](_0x42742f['body'][_0x9009('0x68')],_[_0x9009('0x67')](_0x42742f[_0x9009('0x63')],['ids','id'])||{});}})['then'](respondWithResult(_0x3f29d7,null))[_0x9009('0x5f')](handleError(_0x3f29d7,null));};exports[_0x9009('0x106')]=function(_0x450e3d,_0x3817a4,_0x323804){return db['User'][_0x9009('0x3c')]({'where':{'id':_0x450e3d['params']['id']}})['then'](handleEntityNotFound(_0x3817a4,null))[_0x9009('0x20')](function(_0x53cec1){if(_0x53cec1){return _0x53cec1[_0x9009('0x106')](_0x450e3d[_0x9009('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x3817a4,null))[_0x9009('0x5f')](handleError(_0x3817a4,null));};exports['getLists']=function(_0x108f7e,_0x58d11b,_0x3f8a2c){var _0xf3efb2={};var _0x51fd82={};var _0x926dd;var _0x16e087;return db[_0x9009('0x44')][_0x9009('0x99')]({'where':{'id':_0x108f7e['params']['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x58d11b,null))[_0x9009('0x20')](function(_0x20cbee){if(_0x20cbee){_0x926dd=_0x20cbee;_0x51fd82[_0x9009('0x46')]=_[_0x9009('0x4a')](db[_0x9009('0xbd')]['rawAttributes']);_0x51fd82[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x108f7e['query']);_0x51fd82[_0x9009('0x4b')]=_[_0x9009('0x4c')](_0x51fd82[_0x9009('0x46')],_0x51fd82[_0x9009('0x49')]);_0xf3efb2[_0x9009('0x4d')]=_[_0x9009('0x4c')](_0x51fd82[_0x9009('0x46')],qs[_0x9009('0x4e')](_0x108f7e[_0x9009('0x49')][_0x9009('0x4e')]));_0xf3efb2[_0x9009('0x4d')]=_0xf3efb2[_0x9009('0x4d')][_0x9009('0xa4')]?_0xf3efb2['attributes']:_0x51fd82[_0x9009('0x46')];_0xf3efb2[_0x9009('0x51')]=qs[_0x9009('0x52')](_0x108f7e[_0x9009('0x49')][_0x9009('0x52')]);_0xf3efb2[_0x9009('0x53')]=qs[_0x9009('0x4b')](_[_0x9009('0x54')](_0x108f7e[_0x9009('0x49')],_0x51fd82[_0x9009('0x4b')]));if(_0x108f7e[_0x9009('0x49')][_0x9009('0x38')]){_0xf3efb2[_0x9009('0x53')]=_[_0x9009('0x55')](_0xf3efb2[_0x9009('0x53')],{'$or':_[_0x9009('0x56')](_0xf3efb2[_0x9009('0x4d')],function(_0x5e9da3){var _0x1afdb6={};_0x1afdb6[_0x5e9da3]={'$like':'%'+_0x108f7e[_0x9009('0x49')][_0x9009('0x38')]+'%'};return _0x1afdb6;})});}_0xf3efb2=_[_0x9009('0x55')]({},_0xf3efb2,_0x108f7e[_0x9009('0x5a')]);return _0x926dd[_0x9009('0x107')](_0xf3efb2);}})[_0x9009('0x20')](function(_0x3da10d){if(_0x3da10d){_0x16e087=_0x3da10d['length'];if(!_0x108f7e[_0x9009('0x49')][_0x9009('0x4f')]('nolimit')){_0xf3efb2[_0x9009('0x2c')]=qs['limit'](_0x108f7e[_0x9009('0x49')][_0x9009('0x2c')]);_0xf3efb2[_0x9009('0x2b')]=qs[_0x9009('0x2b')](_0x108f7e['query'][_0x9009('0x2b')]);}return _0x926dd[_0x9009('0x107')](_0xf3efb2);}})[_0x9009('0x20')](function(_0x2d7fe6){if(_0x2d7fe6){return _0x2d7fe6?{'count':_0x16e087,'rows':_0x2d7fe6}:null;}})['then'](respondWithResult(_0x58d11b,null))[_0x9009('0x5f')](handleError(_0x58d11b,null));};exports['getAgents']=function(_0x258704,_0x4f6b12,_0x506063){var _0x192da5={};var _0x2a2ebf={};var _0x21b411;var _0xd97c14;return db[_0x9009('0x44')]['findOne']({'where':{'id':_0x258704[_0x9009('0x64')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x4f6b12,null))[_0x9009('0x20')](function(_0x598aa1){if(_0x598aa1){_0x21b411=_0x598aa1;_0x2a2ebf[_0x9009('0x46')]=_[_0x9009('0x4a')](db[_0x9009('0x44')][_0x9009('0x45')]);_0x2a2ebf[_0x9009('0x49')]=_[_0x9009('0x4a')](_0x258704[_0x9009('0x49')]);_0x2a2ebf['filters']=_[_0x9009('0x4c')](_0x2a2ebf[_0x9009('0x46')],_0x2a2ebf[_0x9009('0x49')]);_0x192da5[_0x9009('0x4d')]=_[_0x9009('0x4c')](_0x2a2ebf[_0x9009('0x46')],qs[_0x9009('0x4e')](_0x258704[_0x9009('0x49')]['fields']));_0x192da5[_0x9009('0x4d')]=_0x192da5[_0x9009('0x4d')][_0x9009('0xa4')]?_0x192da5['attributes']:_0x2a2ebf[_0x9009('0x46')];_0x192da5[_0x9009('0x51')]=qs[_0x9009('0x52')](_0x258704['query'][_0x9009('0x52')]);_0x192da5[_0x9009('0x53')]=qs[_0x9009('0x4b')](_['pick'](_0x258704[_0x9009('0x49')],_0x2a2ebf[_0x9009('0x4b')]));if(_0x258704[_0x9009('0x49')][_0x9009('0x38')]){_0x192da5['where']=_[_0x9009('0x55')](_0x192da5[_0x9009('0x53')],{'$or':_['map'](_0x192da5['attributes'],function(_0x13e8cf){var _0x4a1e18={};_0x4a1e18[_0x13e8cf]={'$like':'%'+_0x258704[_0x9009('0x49')]['filter']+'%'};return _0x4a1e18;})});}_0x192da5[_0x9009('0x46')]=db['User'];_0x192da5['as']=_0x9009('0x35');_0x192da5=_[_0x9009('0x55')]({},_0x192da5,_0x258704['options']);return _0x21b411['getVoiceQueues']({'include':[_0x192da5]});}})[_0x9009('0x20')](function(_0x78ba9e){if(_0x78ba9e){var _0x4e4ea9={},_0x551e4d=[],_0x1ab7a1=0x0;for(var _0x3bcdb8=0x0;_0x3bcdb8<_0x78ba9e[_0x9009('0xa4')];_0x3bcdb8+=0x1){for(var _0x21daaa=0x0,_0x3ec235;_0x21daaa<_0x78ba9e[_0x3bcdb8]['Agents'][_0x9009('0xa4')];_0x21daaa+=0x1){_0x3ec235=_0x78ba9e[_0x3bcdb8]['Agents'][_0x21daaa][_0x9009('0x89')]({'plain':!![]});_0x4e4ea9[_0x3ec235['id']]=_0x3ec235;}}_0x4e4ea9=_['values'](_0x4e4ea9);for(var _0xa103a9=qs[_0x9009('0x2b')](_0x258704['query'][_0x9009('0x2b')]);_0xa103a9<_0x4e4ea9[_0x9009('0xa4')]&&_0x551e4d['length']=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});};
\ No newline at end of file
+var _0xb10b=['destroy','length','LoginUser','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','User','options','where','attributes','limit','include','map','model','ShowUser','find','raw','PauseUser','name','role','interface','UserVoiceQueueRt','MemberReport','findAll','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','type','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','update','system','chat','fax','sms','openchannel','set','Pause','all','LogoutUser'];(function(_0x287f8c,_0x4aa7e4){var _0x16de20=function(_0x5a4032){while(--_0x5a4032){_0x287f8c['push'](_0x287f8c['shift']());}};_0x16de20(++_0x4aa7e4);}(_0xb10b,0x12a));var _0xbb10=function(_0x3b6112,_0x31a6f3){_0x3b6112=_0x3b6112-0x0;var _0x263088=_0xb10b[_0x3b6112];return _0x263088;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['findAll']({'raw':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x19f48d['options']?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'limit':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x22')]||null:null,'include':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x19f48d['options']['include'],function(_0x4fb5e0){return{'model':db[_0x4fb5e0[_0xbb10('0x25')]],'as':_0x4fb5e0['as'],'attributes':_0x4fb5e0[_0xbb10('0x21')],'include':_0x4fb5e0[_0xbb10('0x23')]?_['map'](_0x4fb5e0[_0xbb10('0x23')],function(_0x24d586){return{'model':db[_0x24d586[_0xbb10('0x25')]],'as':_0x24d586['as'],'attributes':_0x24d586[_0xbb10('0x21')],'include':_0x24d586[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x24d586[_0xbb10('0x23')],function(_0x4aabb9){return{'model':db[_0x4aabb9[_0xbb10('0x25')]],'as':_0x4aabb9['as'],'attributes':_0x4aabb9[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x2e0249){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger['debug'](_0xbb10('0x1d'),_0x19f48d,JSON['stringify'](_0x2e0249));_0x109908(_0x2e0249);})[_0xbb10('0x1c')](function(_0x56f2da){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x56f2da[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x56f2da['message']));});});};exports[_0xbb10('0x26')]=function(_0x34f65e){var _0x4f590d=this;return new Promise(function(_0x359ad4,_0x37dde7){return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'raw':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x28')]===undefined?!![]:![]:!![],'where':_0x34f65e['options']?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'include':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x34f65e['options'][_0xbb10('0x23')],function(_0x150107){return{'model':db[_0x150107[_0xbb10('0x25')]],'as':_0x150107['as'],'attributes':_0x150107[_0xbb10('0x21')],'include':_0x150107['include']?_[_0xbb10('0x24')](_0x150107['include'],function(_0x4e2754){return{'model':db[_0x4e2754[_0xbb10('0x25')]],'as':_0x4e2754['as'],'attributes':_0x4e2754[_0xbb10('0x21')],'include':_0x4e2754[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x4e2754[_0xbb10('0x23')],function(_0x29d11a){return{'model':db[_0x29d11a['model']],'as':_0x29d11a['as'],'attributes':_0x29d11a[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x52de31){logger['info']('ShowUser',_0x34f65e);logger[_0xbb10('0x14')](_0xbb10('0x26'),_0x34f65e,JSON[_0xbb10('0x16')](_0x52de31));_0x359ad4(_0x52de31);})['catch'](function(_0x3c0cd7){logger[_0xbb10('0x17')](_0xbb10('0x26'),_0x3c0cd7['message'],_0x34f65e);_0x37dde7(_0x4f590d[_0xbb10('0x17')](0x1f4,_0x3c0cd7[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x29')]=function(_0x446f49){var _0x4f1cdd=this;return new Promise(function(_0xd238e9,_0x110eb5){var _0x5835fd;return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'where':_0x446f49[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'internal',_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x3e7b4c){if(_0x3e7b4c){_0x5835fd=_0x3e7b4c;return db[_0xbb10('0x2d')]['update']({'paused':0x1},{'where':{'UserId':_0x5835fd['id']},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0x5835fd){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5835fd[_0xbb10('0x2a')],'type':'PAUSE','exitAt':null}});}})[_0xbb10('0x11')](function(_0x202c60){if(_0x5835fd){if(_0x202c60&&_0x202c60['length']){var _0x5d9a4f=moment()[_0xbb10('0x30')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x318984=0x0,_0x180933=_0x202c60['length'];_0x318984<_0x180933;_0x318984++){_0x202c60[_0x318984][_0xbb10('0x31')]({'exitAt':_0x5d9a4f});}}}})[_0xbb10('0x11')](function(){if(_0x5835fd){var _0x474e99=[];var _0x5cf4f8=utils[_0xbb10('0x32')]();_0x5cf4f8[_0xbb10('0x33')](function(_0x3b9fdf){_0x474e99[_0xbb10('0x34')]({'channel':_0x3b9fdf,'membername':_0x5835fd[_0xbb10('0x2a')],'interface':_[_0xbb10('0x35')](_0x5835fd[_0xbb10('0x2c')])?util[_0xbb10('0x30')](_0xbb10('0x36'),_0x5835fd[_0xbb10('0x2a')]):_0x5835fd[_0xbb10('0x2c')],'type':_0xbb10('0x37'),'enterAt':moment()['format'](_0xbb10('0x38')),'data1':_0x446f49[_0xbb10('0x39')]['type']||_0xbb10('0x3a'),'role':_0x5835fd[_0xbb10('0x2b')],'internal':_0x5835fd[_0xbb10('0x3b')],'uniqueid':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3c')]||null});});return db[_0xbb10('0x2e')][_0xbb10('0x3d')](_0x474e99,{'individualHooks':!![]});}})['then'](function(){if(_0x5835fd){return _0x5835fd['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3e')]||_0xbb10('0x3a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xbb10('0x11')](function(_0x34cf4e){_0xd238e9(_0x34cf4e);})[_0xbb10('0x1c')](function(_0xf820fe){_0x110eb5(_0x4f1cdd[_0xbb10('0x17')](0x1f4,_0xf820fe[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x3f')]=function(_0x460788){var _0x2626d8=this;return new Promise(function(_0x3d7e7e,_0x550111){var _0x5eafac;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x460788[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x358e7e){if(_0x358e7e){_0x5eafac=_0x358e7e;if(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]&&!utils[_0xbb10('0x42')](_0x460788[_0xbb10('0x39')][_0xbb10('0x41')])){throw new Error(_0xbb10('0x43'));}switch(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]){case'voice':return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})[_0xbb10('0x11')](function(){return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788[_0xbb10('0x39')][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x180400){if(_0x180400){return _0x180400[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});}return null;})[_0xbb10('0x11')](function(){return _0x5eafac[_0xbb10('0x44')]({'voicePause':![]});});case'mail':case _0xbb10('0x46'):case _0xbb10('0x47'):case _0xbb10('0x48'):case _0xbb10('0x49'):return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788['body'][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}})[_0xbb10('0x11')](function(_0x432728){return _0x432728[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});})[_0xbb10('0x11')](function(){var _0x2eb05a={};_[_0xbb10('0x4a')](_0x2eb05a,util[_0xbb10('0x30')]('%s%s',_0x460788['body'][_0xbb10('0x41')],_0xbb10('0x4b')),![]);return _0x5eafac[_0xbb10('0x44')](_0x2eb05a);});default:return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})['then'](function(){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x3e9753){var _0x45c0dc=[];_0x3e9753['forEach'](function(_0x117e84){_0x45c0dc[_0xbb10('0x34')](_0x117e84['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0x45')}));});return BPromise[_0xbb10('0x4c')](_0x45c0dc);})[_0xbb10('0x11')](function(){return _0x5eafac['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x5846d1){_0x3d7e7e(_0x5846d1);})[_0xbb10('0x1c')](function(_0x249b33){_0x550111(_0x2626d8[_0xbb10('0x17')](0x1f4,_0x249b33['message']));});});};exports[_0xbb10('0x4d')]=function(_0x13131c){var _0x5a6538=this;return new Promise(function(_0x4a560c,_0x27d7b9){var _0x308896;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x13131c['options'][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x5202d7){if(_0x5202d7){_0x308896=_0x5202d7;return db[_0xbb10('0x2d')][_0xbb10('0x4e')]({'where':{'membername':_0x308896[_0xbb10('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x308896){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x308896[_0xbb10('0x2a')],'exitAt':null}});}})[_0xbb10('0x11')](function(_0x5e4a6e){if(_0x308896){if(_0x5e4a6e&&_0x5e4a6e[_0xbb10('0x4f')]){var _0x258e55=[];_0x5e4a6e[_0xbb10('0x33')](function(_0x2d0f4b){_0x258e55['push'](_0x2d0f4b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x258e55);}}})[_0xbb10('0x11')](function(){if(_0x308896){return _0x308896[_0xbb10('0x44')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbb10('0x11')](function(_0x4a30c5){_0x4a560c(_0x4a30c5);})['catch'](function(_0x5acd5e){_0x27d7b9(_0x5a6538[_0xbb10('0x17')](0x1f4,_0x5acd5e[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x50')]=function(_0x5c9afc){var _0x5cd089=this;return new Promise(function(_0x46f462,_0x1b11c0){var _0xd9e743;var _0x3a9677;var _0x260e06;var _0x1ad2ed;return db['User'][_0xbb10('0x40')]({'where':_0x5c9afc[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'mobile','phone','internal',_0xbb10('0x51'),_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x21459e){if(_0x21459e){_0xd9e743=_0x21459e;_0x1ad2ed=_0x5c9afc[_0xbb10('0x39')][_0xbb10('0x2c')]?_0x5c9afc['body'][_0xbb10('0x2c')]:util['format']('SIP/%s',_0xd9e743['name']);return db[_0xbb10('0x1e')][_0xbb10('0x52')]({'where':{'role':_0xbb10('0x53'),'online':!![],'id':{'$ne':_0xd9e743['id']}}});}})[_0xbb10('0x11')](function(_0x5ce94f){if(_0x5ce94f){_0x260e06=_0x5ce94f;return require(_0xbb10('0x54'))['getLicense']();}})['then'](function(_0x165fe9){if(_0x165fe9&&_0x165fe9[_0xbb10('0x55')]&&_0x260e06>=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js
index 46df812..47f40cc 100644
--- a/server/api/user/user.socket.js
+++ b/server/api/user/user.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb082=['./user.events','remove','update','emit','removeListener','register','length'];(function(_0x43374b,_0x3931b3){var _0x50859a=function(_0x297e86){while(--_0x297e86){_0x43374b['push'](_0x43374b['shift']());}};_0x50859a(++_0x3931b3);}(_0xb082,0x1b2));var _0x2b08=function(_0x4c8f27,_0xf36871){_0x4c8f27=_0x4c8f27-0x0;var _0x5690bf=_0xb082[_0x4c8f27];return _0x5690bf;};'use strict';var UserEvents=require(_0x2b08('0x0'));var events=['save',_0x2b08('0x1'),_0x2b08('0x2')];function createListener(_0x3ae1e1,_0x3000a4){return function(_0x11ee0f){_0x3000a4[_0x2b08('0x3')](_0x3ae1e1,_0x11ee0f);};}function removeListener(_0x143579,_0x476ddd){return function(){UserEvents[_0x2b08('0x4')](_0x143579,_0x476ddd);};}exports[_0x2b08('0x5')]=function(_0x460b6e){for(var _0x4c5d4f=0x0,_0x39c6c0=events[_0x2b08('0x6')];_0x4c5d4f<_0x39c6c0;_0x4c5d4f++){var _0x3adea0=events[_0x4c5d4f];var _0x2db405=createListener('user:'+_0x3adea0,_0x460b6e);UserEvents['on'](_0x3adea0,_0x2db405);}};
\ No newline at end of file
+var _0x9a1e=['removeListener','register','./user.events','remove','update'];(function(_0x1ef093,_0x44e1ed){var _0x3728ca=function(_0x5225d3){while(--_0x5225d3){_0x1ef093['push'](_0x1ef093['shift']());}};_0x3728ca(++_0x44e1ed);}(_0x9a1e,0x165));var _0xe9a1=function(_0x5bdee3,_0x554cc7){_0x5bdee3=_0x5bdee3-0x0;var _0x6493e6=_0x9a1e[_0x5bdee3];return _0x6493e6;};'use strict';var UserEvents=require(_0xe9a1('0x0'));var events=['save',_0xe9a1('0x1'),_0xe9a1('0x2')];function createListener(_0x377d5b,_0x3e8fe8){return function(_0x526250){_0x3e8fe8['emit'](_0x377d5b,_0x526250);};}function removeListener(_0x9398ad,_0x1d59a9){return function(){UserEvents[_0xe9a1('0x3')](_0x9398ad,_0x1d59a9);};}exports[_0xe9a1('0x4')]=function(_0x4bbabb){for(var _0x377f49=0x0,_0x254ec3=events['length'];_0x377f49<_0x254ec3;_0x377f49++){var _0x12fbab=events[_0x377f49];var _0x4f901b=createListener('user:'+_0x12fbab,_0x4bbabb);UserEvents['on'](_0x12fbab,_0x4f901b);}};
\ No newline at end of file
diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js
index 93dc305..23ee7b6 100644
--- a/server/api/userChatQueue/index.js
+++ b/server/api/userChatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa4dc=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xab92b5,_0x184d79){var _0x3a758c=function(_0x3eae35){while(--_0x3eae35){_0xab92b5['push'](_0xab92b5['shift']());}};_0x3a758c(++_0x184d79);}(_0xa4dc,0x16a));var _0xca4d=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xa4dc[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca4d('0x2'));var router=express[_0xca4d('0x3')]();var auth=require(_0xca4d('0x4'));var interaction=require(_0xca4d('0x5'));var config=require(_0xca4d('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x7046=['Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','path','connect-timeout'];(function(_0x9f0cc4,_0x149d9e){var _0x15f6f3=function(_0x310a7d){while(--_0x310a7d){_0x9f0cc4['push'](_0x9f0cc4['shift']());}};_0x15f6f3(++_0x149d9e);}(_0x7046,0x144));var _0x6704=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7046[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var auth=require(_0x6704('0x5'));var interaction=require(_0x6704('0x6'));var config=require('../../config/environment');module[_0x6704('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js
index 56c0dbe..94f306f 100644
--- a/server/api/userChatQueue/userChatQueue.attributes.js
+++ b/server/api/userChatQueue/userChatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6b25=['exports','sequelize'];(function(_0xb0ed66,_0x424e5e){var _0x15de71=function(_0x3ec047){while(--_0x3ec047){_0xb0ed66['push'](_0xb0ed66['shift']());}};_0x15de71(++_0x424e5e);}(_0x6b25,0x19b));var _0x56b2=function(_0x5d7ebd,_0x3471c0){_0x5d7ebd=_0x5d7ebd-0x0;var _0x306386=_0x6b25[_0x5d7ebd];return _0x306386;};'use strict';var Sequelize=require(_0x56b2('0x0'));module[_0x56b2('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5d74=['exports','INTEGER'];(function(_0x55b93f,_0x22f49c){var _0x3ee414=function(_0xafdae3){while(--_0xafdae3){_0x55b93f['push'](_0x55b93f['shift']());}};_0x3ee414(++_0x22f49c);}(_0x5d74,0x1dc));var _0x45d7=function(_0x142246,_0x3730e7){_0x142246=_0x142246-0x0;var _0x2835a5=_0x5d74[_0x142246];return _0x2835a5;};'use strict';var Sequelize=require('sequelize');module[_0x45d7('0x0')]={'penalty':{'type':Sequelize[_0x45d7('0x1')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js
index 6bf7a79..4295934 100644
--- a/server/api/userChatQueue/userChatQueue.model.js
+++ b/server/api/userChatQueue/userChatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4468=['define','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58a274,_0x400d8c){var _0x32964f=function(_0x201683){while(--_0x201683){_0x58a274['push'](_0x58a274['shift']());}};_0x32964f(++_0x400d8c);}(_0x4468,0xd4));var _0x8446=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x4468[_0x341e0f];return _0x59555a;};'use strict';var _=require('lodash');var util=require(_0x8446('0x0'));var logger=require(_0x8446('0x1'))(_0x8446('0x2'));var moment=require(_0x8446('0x3'));var BPromise=require(_0x8446('0x4'));var rp=require(_0x8446('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8446('0x6'));var config=require(_0x8446('0x7'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x83bbdf,_0x26a0db){return _0x83bbdf[_0x8446('0x8')]('UserChatQueue',attributes,{'tableName':_0x8446('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x10bb=['path','rimraf','../../config/environment','exports','define','UserChatQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x10bb,0x1a6));var _0xb10b=function(_0x220014,_0x21828b){_0x220014=_0x220014-0x0;var _0x1f8210=_0x10bb[_0x220014];return _0x1f8210;};'use strict';var _=require(_0xb10b('0x0'));var util=require(_0xb10b('0x1'));var logger=require(_0xb10b('0x2'))(_0xb10b('0x3'));var moment=require(_0xb10b('0x4'));var BPromise=require(_0xb10b('0x5'));var rp=require(_0xb10b('0x6'));var fs=require('fs');var path=require(_0xb10b('0x7'));var rimraf=require(_0xb10b('0x8'));var config=require(_0xb10b('0x9'));var attributes=require('./userChatQueue.attributes');module[_0xb10b('0xa')]=function(_0x1723c7,_0x3fe9d3){return _0x1723c7[_0xb10b('0xb')](_0xb10b('0xc'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js
index 7c5de99..f1878fb 100644
--- a/server/api/userChatQueue/userChatQueue.rpc.js
+++ b/server/api/userChatQueue/userChatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x645a=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x645a,0x1cf));var _0xa645=function(_0x89c40f,_0xd92eb2){_0x89c40f=_0x89c40f-0x0;var _0x17acbb=_0x645a[_0x89c40f];return _0x17acbb;};'use strict';var _=require(_0xa645('0x0'));var util=require(_0xa645('0x1'));var moment=require(_0xa645('0x2'));var BPromise=require('bluebird');var rs=require(_0xa645('0x3'));var fs=require('fs');var Redis=require(_0xa645('0x4'));var db=require(_0xa645('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa645('0x6'))(_0xa645('0x7'));var config=require(_0xa645('0x8'));var jayson=require(_0xa645('0x9'));var client=jayson[_0xa645('0xa')][_0xa645('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a511c,_0x2159bf,_0x3d21fe){return new BPromise(function(_0x2f9489,_0x11ecf1){return client['request'](_0x3a511c,_0x3d21fe)[_0xa645('0xc')](function(_0x2b97ff){logger[_0xa645('0xd')](_0xa645('0xe'),_0x2159bf,_0xa645('0xf'));logger[_0xa645('0x10')](_0xa645('0x11'),_0x2159bf,_0xa645('0xf'),JSON[_0xa645('0x12')](_0x2b97ff));if(_0x2b97ff[_0xa645('0x13')]){if(_0x2b97ff[_0xa645('0x13')]['code']===0x1f4){logger[_0xa645('0x13')](_0xa645('0xe'),_0x2159bf,_0x2b97ff['error'][_0xa645('0x14')]);return _0x11ecf1(_0x2b97ff[_0xa645('0x13')][_0xa645('0x14')]);}logger[_0xa645('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x2159bf,_0x2b97ff[_0xa645('0x13')][_0xa645('0x14')]);return _0x2f9489(_0x2b97ff[_0xa645('0x13')]['message']);}else{logger[_0xa645('0xd')](_0xa645('0xe'),_0x2159bf,_0xa645('0xf'));_0x2f9489(_0x2b97ff[_0xa645('0x15')][_0xa645('0x14')]);}})['catch'](function(_0x2fb3a1){logger[_0xa645('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x2159bf,_0x2fb3a1);_0x11ecf1(_0x2fb3a1);});});}
\ No newline at end of file
+var _0x90ef=['then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x90ef,0x8f));var _0xf90e=function(_0x208e02,_0x3c37af){_0x208e02=_0x208e02-0x0;var _0x464f1f=_0x90ef[_0x208e02];return _0x464f1f;};'use strict';var _=require(_0xf90e('0x0'));var util=require('util');var moment=require(_0xf90e('0x1'));var BPromise=require(_0xf90e('0x2'));var rs=require(_0xf90e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf90e('0x4'));var config=require(_0xf90e('0x5'));var jayson=require(_0xf90e('0x6'));var client=jayson['client'][_0xf90e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x59086f,_0x4883ed,_0x3c65fa){return new BPromise(function(_0x21b10e,_0x1b2d7e){return client[_0xf90e('0x8')](_0x59086f,_0x3c65fa)[_0xf90e('0x9')](function(_0x1262f3){logger[_0xf90e('0xa')](_0xf90e('0xb'),_0x4883ed,_0xf90e('0xc'));logger[_0xf90e('0xd')](_0xf90e('0xe'),_0x4883ed,_0xf90e('0xc'),JSON['stringify'](_0x1262f3));if(_0x1262f3[_0xf90e('0xf')]){if(_0x1262f3['error'][_0xf90e('0x10')]===0x1f4){logger['error'](_0xf90e('0xb'),_0x4883ed,_0x1262f3[_0xf90e('0xf')][_0xf90e('0x11')]);return _0x1b2d7e(_0x1262f3[_0xf90e('0xf')][_0xf90e('0x11')]);}logger[_0xf90e('0xf')](_0xf90e('0xb'),_0x4883ed,_0x1262f3[_0xf90e('0xf')][_0xf90e('0x11')]);return _0x21b10e(_0x1262f3[_0xf90e('0xf')][_0xf90e('0x11')]);}else{logger[_0xf90e('0xa')](_0xf90e('0xb'),_0x4883ed,_0xf90e('0xc'));_0x21b10e(_0x1262f3[_0xf90e('0x12')]['message']);}})['catch'](function(_0x2abf44){logger[_0xf90e('0xf')](_0xf90e('0xb'),_0x4883ed,_0x2abf44);_0x1b2d7e(_0x2abf44);});});}
\ No newline at end of file
diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js
index 495c22e..64597e6 100644
--- a/server/api/userFaxQueue/index.js
+++ b/server/api/userFaxQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4f0d=['../../components/interaction/service','exports','Router','../../components/auth/service'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0xdb01a,_0x54a83a){_0xdb01a=_0xdb01a-0x0;var _0x107ede=_0x4f0d[_0xdb01a];return _0x107ede;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd4f0('0x0')]();var auth=require(_0xd4f0('0x1'));var interaction=require(_0xd4f0('0x2'));var config=require('../../config/environment');module[_0xd4f0('0x3')]=router;
\ No newline at end of file
+var _0xa786=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','path','connect-timeout','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa786,0x1d2));var _0x6a78=function(_0x5fbf5d,_0x4c1c42){_0x5fbf5d=_0x5fbf5d-0x0;var _0x51ef53=_0xa786[_0x5fbf5d];return _0x51ef53;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6a78('0x0'));var timeout=require(_0x6a78('0x1'));var express=require(_0x6a78('0x2'));var router=express[_0x6a78('0x3')]();var auth=require(_0x6a78('0x4'));var interaction=require(_0x6a78('0x5'));var config=require(_0x6a78('0x6'));module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js
index ece2822..15ca59a 100644
--- a/server/api/userFaxQueue/userFaxQueue.attributes.js
+++ b/server/api/userFaxQueue/userFaxQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7192=['STRING','sequelize','exports'];(function(_0x434a02,_0x42739f){var _0x3be474=function(_0x4e837a){while(--_0x4e837a){_0x434a02['push'](_0x434a02['shift']());}};_0x3be474(++_0x42739f);}(_0x7192,0x17e));var _0x2719=function(_0x28239a,_0x1ab8b0){_0x28239a=_0x28239a-0x0;var _0x2b0ceb=_0x7192[_0x28239a];return _0x2b0ceb;};'use strict';var Sequelize=require(_0x2719('0x0'));module[_0x2719('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x2719('0x2')]}};
\ No newline at end of file
+var _0xab5e=['sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab5e,0x138));var _0xeab5=function(_0x12a5e3,_0x49a71e){_0x12a5e3=_0x12a5e3-0x0;var _0x48e212=_0xab5e[_0x12a5e3];return _0x48e212;};'use strict';var Sequelize=require(_0xeab5('0x0'));module[_0xeab5('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xeab5('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js
index f8813de..06192f1 100644
--- a/server/api/userFaxQueue/userFaxQueue.model.js
+++ b/server/api/userFaxQueue/userFaxQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e27=['request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment'];(function(_0x39ec3b,_0x853748){var _0x104228=function(_0x575224){while(--_0x575224){_0x39ec3b['push'](_0x39ec3b['shift']());}};_0x104228(++_0x853748);}(_0x2e27,0x128));var _0x72e2=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0x2e27[_0x34232c];return _0x4d4f4e;};'use strict';var _=require(_0x72e2('0x0'));var util=require(_0x72e2('0x1'));var logger=require(_0x72e2('0x2'))('api');var moment=require(_0x72e2('0x3'));var BPromise=require('bluebird');var rp=require(_0x72e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72e2('0x5'));var config=require(_0x72e2('0x6'));var attributes=require(_0x72e2('0x7'));module[_0x72e2('0x8')]=function(_0x4431a4,_0x119899){return _0x4431a4[_0x72e2('0x9')](_0x72e2('0xa'),attributes,{'tableName':_0x72e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc50a=['path','../../config/environment','exports','define','UserFaxQueue','lodash','api','moment','bluebird','request-promise'];(function(_0x5dc637,_0x563e1b){var _0x34c8fa=function(_0x1094da){while(--_0x1094da){_0x5dc637['push'](_0x5dc637['shift']());}};_0x34c8fa(++_0x563e1b);}(_0xc50a,0x1b3));var _0xac50=function(_0x4bf64f,_0x472ec0){_0x4bf64f=_0x4bf64f-0x0;var _0x316df=_0xc50a[_0x4bf64f];return _0x316df;};'use strict';var _=require(_0xac50('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xac50('0x1'));var moment=require(_0xac50('0x2'));var BPromise=require(_0xac50('0x3'));var rp=require(_0xac50('0x4'));var fs=require('fs');var path=require(_0xac50('0x5'));var rimraf=require('rimraf');var config=require(_0xac50('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0xac50('0x7')]=function(_0xc2c45a,_0x26d8f4){return _0xc2c45a[_0xac50('0x8')](_0xac50('0x9'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js
index 4236462..6913822 100644
--- a/server/api/userFaxQueue/userFaxQueue.rpc.js
+++ b/server/api/userFaxQueue/userFaxQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4478=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment'];(function(_0x41c0b9,_0xcaa6da){var _0x123245=function(_0x12b62d){while(--_0x12b62d){_0x41c0b9['push'](_0x41c0b9['shift']());}};_0x123245(++_0xcaa6da);}(_0x4478,0x131));var _0x8447=function(_0x417dd6,_0x209f6a){_0x417dd6=_0x417dd6-0x0;var _0x1d115a=_0x4478[_0x417dd6];return _0x1d115a;};'use strict';var _=require(_0x8447('0x0'));var util=require(_0x8447('0x1'));var moment=require(_0x8447('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8447('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8447('0x4'));var logger=require(_0x8447('0x5'))(_0x8447('0x6'));var config=require(_0x8447('0x7'));var jayson=require(_0x8447('0x8'));var client=jayson[_0x8447('0x9')][_0x8447('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x290588,_0x1e27f8,_0x5bb567){return new BPromise(function(_0x88c060,_0x5a502c){return client[_0x8447('0xb')](_0x290588,_0x5bb567)[_0x8447('0xc')](function(_0x1dbbf4){logger['info'](_0x8447('0xd'),_0x1e27f8,_0x8447('0xe'));logger[_0x8447('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x1e27f8,'request\x20sent',JSON[_0x8447('0x10')](_0x1dbbf4));if(_0x1dbbf4[_0x8447('0x11')]){if(_0x1dbbf4[_0x8447('0x11')][_0x8447('0x12')]===0x1f4){logger[_0x8447('0x11')](_0x8447('0xd'),_0x1e27f8,_0x1dbbf4[_0x8447('0x11')]['message']);return _0x5a502c(_0x1dbbf4[_0x8447('0x11')]['message']);}logger[_0x8447('0x11')](_0x8447('0xd'),_0x1e27f8,_0x1dbbf4[_0x8447('0x11')][_0x8447('0x13')]);return _0x88c060(_0x1dbbf4[_0x8447('0x11')][_0x8447('0x13')]);}else{logger[_0x8447('0x14')](_0x8447('0xd'),_0x1e27f8,_0x8447('0xe'));_0x88c060(_0x1dbbf4['result'][_0x8447('0x13')]);}})[_0x8447('0x15')](function(_0x155dd0){logger['error'](_0x8447('0xd'),_0x1e27f8,_0x155dd0);_0x5a502c(_0x155dd0);});});}
\ No newline at end of file
+var _0xb791=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4b988f,_0x20870e){var _0x1334c8=function(_0x153472){while(--_0x153472){_0x4b988f['push'](_0x4b988f['shift']());}};_0x1334c8(++_0x20870e);}(_0xb791,0x131));var _0x1b79=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0xb791[_0x24679e];return _0x291f21;};'use strict';var _=require(_0x1b79('0x0'));var util=require(_0x1b79('0x1'));var moment=require(_0x1b79('0x2'));var BPromise=require(_0x1b79('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b79('0x4'));var db=require(_0x1b79('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b79('0x6'))('rpc');var config=require(_0x1b79('0x7'));var jayson=require(_0x1b79('0x8'));var client=jayson[_0x1b79('0x9')][_0x1b79('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x436792,_0x3a9b4a,_0x2147af){return new BPromise(function(_0x5dac63,_0x535e77){return client[_0x1b79('0xb')](_0x436792,_0x2147af)[_0x1b79('0xc')](function(_0x204fc2){logger[_0x1b79('0xd')](_0x1b79('0xe'),_0x3a9b4a,_0x1b79('0xf'));logger[_0x1b79('0x10')](_0x1b79('0x11'),_0x3a9b4a,_0x1b79('0xf'),JSON[_0x1b79('0x12')](_0x204fc2));if(_0x204fc2['error']){if(_0x204fc2[_0x1b79('0x13')]['code']===0x1f4){logger[_0x1b79('0x13')](_0x1b79('0xe'),_0x3a9b4a,_0x204fc2[_0x1b79('0x13')][_0x1b79('0x14')]);return _0x535e77(_0x204fc2[_0x1b79('0x13')][_0x1b79('0x14')]);}logger[_0x1b79('0x13')](_0x1b79('0xe'),_0x3a9b4a,_0x204fc2['error'][_0x1b79('0x14')]);return _0x5dac63(_0x204fc2[_0x1b79('0x13')][_0x1b79('0x14')]);}else{logger[_0x1b79('0xd')](_0x1b79('0xe'),_0x3a9b4a,_0x1b79('0xf'));_0x5dac63(_0x204fc2[_0x1b79('0x15')][_0x1b79('0x14')]);}})[_0x1b79('0x16')](function(_0x5336cd){logger['error'](_0x1b79('0xe'),_0x3a9b4a,_0x5336cd);_0x535e77(_0x5336cd);});});}
\ No newline at end of file
diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js
index 34a0d9d..63498d4 100644
--- a/server/api/userMailQueue/index.js
+++ b/server/api/userMailQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x96fd=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util'];(function(_0x181f75,_0x1ca919){var _0x3aa04d=function(_0x22a755){while(--_0x22a755){_0x181f75['push'](_0x181f75['shift']());}};_0x3aa04d(++_0x1ca919);}(_0x96fd,0x1e9));var _0xd96f=function(_0x6d1554,_0x47dd86){_0x6d1554=_0x6d1554-0x0;var _0x313e9f=_0x96fd[_0x6d1554];return _0x313e9f;};'use strict';var multer=require('multer');var util=require(_0xd96f('0x0'));var path=require('path');var timeout=require(_0xd96f('0x1'));var express=require(_0xd96f('0x2'));var router=express['Router']();var auth=require(_0xd96f('0x3'));var interaction=require(_0xd96f('0x4'));var config=require(_0xd96f('0x5'));module[_0xd96f('0x6')]=router;
\ No newline at end of file
+var _0x15b2=['../../components/interaction/service','../../config/environment','exports','util','connect-timeout','express','../../components/auth/service'];(function(_0xd723be,_0x3c5571){var _0x3d1e14=function(_0x29a978){while(--_0x29a978){_0xd723be['push'](_0xd723be['shift']());}};_0x3d1e14(++_0x3c5571);}(_0x15b2,0x145));var _0x215b=function(_0x13fb21,_0xfc7475){_0x13fb21=_0x13fb21-0x0;var _0x4067a1=_0x15b2[_0x13fb21];return _0x4067a1;};'use strict';var multer=require('multer');var util=require(_0x215b('0x0'));var path=require('path');var timeout=require(_0x215b('0x1'));var express=require(_0x215b('0x2'));var router=express['Router']();var auth=require(_0x215b('0x3'));var interaction=require(_0x215b('0x4'));var config=require(_0x215b('0x5'));module[_0x215b('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js
index 6948d75..fff4329 100644
--- a/server/api/userMailQueue/userMailQueue.attributes.js
+++ b/server/api/userMailQueue/userMailQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x09ab=['exports'];(function(_0x559a83,_0x1236f4){var _0x5c18bc=function(_0x3a1d07){while(--_0x3a1d07){_0x559a83['push'](_0x559a83['shift']());}};_0x5c18bc(++_0x1236f4);}(_0x09ab,0x188));var _0xb09a=function(_0x50b499,_0x507650){_0x50b499=_0x50b499-0x0;var _0x20e29a=_0x09ab[_0x50b499];return _0x20e29a;};'use strict';var Sequelize=require('sequelize');module[_0xb09a('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xeabc=['sequelize','INTEGER'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0xeabc,0x1a8));var _0xceab=function(_0x5754cf,_0x16fbde){_0x5754cf=_0x5754cf-0x0;var _0x4392de=_0xeabc[_0x5754cf];return _0x4392de;};'use strict';var Sequelize=require(_0xceab('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xceab('0x1')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js
index 77ee662..8f8e088 100644
--- a/server/api/userMailQueue/userMailQueue.model.js
+++ b/server/api/userMailQueue/userMailQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xafc4=['path','exports','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xafc4,0x69));var _0x4afc=function(_0x8146da,_0x142b00){_0x8146da=_0x8146da-0x0;var _0x2dfc41=_0xafc4[_0x8146da];return _0x2dfc41;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xacf4=['define','UserMailQueue','user_has_mail_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports'];(function(_0x1428a1,_0x342a4c){var _0x56cd58=function(_0x2d5710){while(--_0x2d5710){_0x1428a1['push'](_0x1428a1['shift']());}};_0x56cd58(++_0x342a4c);}(_0xacf4,0xe7));var _0x4acf=function(_0x11df3e,_0x21249e){_0x11df3e=_0x11df3e-0x0;var _0x5139c4=_0xacf4[_0x11df3e];return _0x5139c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js
index 1fc90bb..6045700 100644
--- a/server/api/userMailQueue/userMailQueue.rpc.js
+++ b/server/api/userMailQueue/userMailQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa96d=['lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0xa96d,0x1e0));var _0xda96=function(_0x5d2f39,_0x11e2f4){_0x5d2f39=_0x5d2f39-0x0;var _0x3df8f6=_0xa96d[_0x5d2f39];return _0x3df8f6;};'use strict';var _=require(_0xda96('0x0'));var util=require(_0xda96('0x1'));var moment=require('moment');var BPromise=require(_0xda96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda96('0x3'))['db'];var utils=require(_0xda96('0x4'));var logger=require(_0xda96('0x5'))(_0xda96('0x6'));var config=require(_0xda96('0x7'));var jayson=require(_0xda96('0x8'));var client=jayson['client'][_0xda96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x295920,_0x5850b6,_0x2bc101){return new BPromise(function(_0x5eeb81,_0x269bd1){return client[_0xda96('0xa')](_0x295920,_0x2bc101)[_0xda96('0xb')](function(_0x261cb3){logger[_0xda96('0xc')](_0xda96('0xd'),_0x5850b6,_0xda96('0xe'));logger[_0xda96('0xf')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x5850b6,_0xda96('0xe'),JSON['stringify'](_0x261cb3));if(_0x261cb3[_0xda96('0x10')]){if(_0x261cb3[_0xda96('0x10')]['code']===0x1f4){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x5850b6,_0x261cb3[_0xda96('0x10')][_0xda96('0x11')]);return _0x269bd1(_0x261cb3['error']['message']);}logger[_0xda96('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x5850b6,_0x261cb3[_0xda96('0x10')]['message']);return _0x5eeb81(_0x261cb3[_0xda96('0x10')][_0xda96('0x11')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x5850b6,_0xda96('0xe'));_0x5eeb81(_0x261cb3[_0xda96('0x12')][_0xda96('0x11')]);}})[_0xda96('0x13')](function(_0x528f22){logger[_0xda96('0x10')](_0xda96('0xd'),_0x5850b6,_0x528f22);_0x269bd1(_0x528f22);});});}
\ No newline at end of file
+var _0xbab8=['http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbab8,0x1f0));var _0x8bab=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0xbab8[_0xee3051];return _0x139e81;};'use strict';var _=require(_0x8bab('0x0'));var util=require(_0x8bab('0x1'));var moment=require(_0x8bab('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bab('0x4'));var logger=require(_0x8bab('0x5'))(_0x8bab('0x6'));var config=require('../../config/environment');var jayson=require(_0x8bab('0x7'));var client=jayson['client'][_0x8bab('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x474da6,_0x2040ca,_0x2b48dd){return new BPromise(function(_0x171774,_0x136db2){return client['request'](_0x474da6,_0x2b48dd)[_0x8bab('0x9')](function(_0x3670bb){logger[_0x8bab('0xa')](_0x8bab('0xb'),_0x2040ca,_0x8bab('0xc'));logger[_0x8bab('0xd')](_0x8bab('0xe'),_0x2040ca,'request\x20sent',JSON[_0x8bab('0xf')](_0x3670bb));if(_0x3670bb[_0x8bab('0x10')]){if(_0x3670bb[_0x8bab('0x10')][_0x8bab('0x11')]===0x1f4){logger[_0x8bab('0x10')](_0x8bab('0xb'),_0x2040ca,_0x3670bb[_0x8bab('0x10')]['message']);return _0x136db2(_0x3670bb['error'][_0x8bab('0x12')]);}logger[_0x8bab('0x10')](_0x8bab('0xb'),_0x2040ca,_0x3670bb['error']['message']);return _0x171774(_0x3670bb[_0x8bab('0x10')][_0x8bab('0x12')]);}else{logger[_0x8bab('0xa')]('UserMailQueue,\x20%s,\x20%s',_0x2040ca,'request\x20sent');_0x171774(_0x3670bb[_0x8bab('0x13')][_0x8bab('0x12')]);}})[_0x8bab('0x14')](function(_0x4d61a3){logger['error'](_0x8bab('0xb'),_0x2040ca,_0x4d61a3);_0x136db2(_0x4d61a3);});});}
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js
index 0e6f5d2..3af5289 100644
--- a/server/api/userOpenchannelQueue/index.js
+++ b/server/api/userOpenchannelQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6c45=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout'];(function(_0x39c3a6,_0x15a952){var _0x31d76=function(_0x3de2fa){while(--_0x3de2fa){_0x39c3a6['push'](_0x39c3a6['shift']());}};_0x31d76(++_0x15a952);}(_0x6c45,0xb1));var _0x56c4=function(_0x4e7d06,_0x223f5f){_0x4e7d06=_0x4e7d06-0x0;var _0x316689=_0x6c45[_0x4e7d06];return _0x316689;};'use strict';var multer=require(_0x56c4('0x0'));var util=require(_0x56c4('0x1'));var path=require('path');var timeout=require(_0x56c4('0x2'));var express=require(_0x56c4('0x3'));var router=express[_0x56c4('0x4')]();var auth=require(_0x56c4('0x5'));var interaction=require(_0x56c4('0x6'));var config=require(_0x56c4('0x7'));module[_0x56c4('0x8')]=router;
\ No newline at end of file
+var _0xaf11=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x2fbb34,_0x358b15){var _0x26914a=function(_0x240fc1){while(--_0x240fc1){_0x2fbb34['push'](_0x2fbb34['shift']());}};_0x26914a(++_0x358b15);}(_0xaf11,0x12f));var _0x1af1=function(_0x1c2b4f,_0xab7cd3){_0x1c2b4f=_0x1c2b4f-0x0;var _0x35488d=_0xaf11[_0x1c2b4f];return _0x35488d;};'use strict';var multer=require(_0x1af1('0x0'));var util=require(_0x1af1('0x1'));var path=require(_0x1af1('0x2'));var timeout=require(_0x1af1('0x3'));var express=require('express');var router=express[_0x1af1('0x4')]();var auth=require(_0x1af1('0x5'));var interaction=require(_0x1af1('0x6'));var config=require('../../config/environment');module[_0x1af1('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
index 3630ccd..ed5616b 100644
--- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
+++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2189=['sequelize','exports','INTEGER'];(function(_0x767f0c,_0x51b30b){var _0x28a43e=function(_0x3a93b2){while(--_0x3a93b2){_0x767f0c['push'](_0x767f0c['shift']());}};_0x28a43e(++_0x51b30b);}(_0x2189,0x96));var _0x9218=function(_0x22a63d,_0xfcb397){_0x22a63d=_0x22a63d-0x0;var _0x278ca3=_0x2189[_0x22a63d];return _0x278ca3;};'use strict';var Sequelize=require(_0x9218('0x0'));module[_0x9218('0x1')]={'penalty':{'type':Sequelize[_0x9218('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0b30=['INTEGER'];(function(_0x5e2bbd,_0x1add30){var _0x34b41=function(_0x342a65){while(--_0x342a65){_0x5e2bbd['push'](_0x5e2bbd['shift']());}};_0x34b41(++_0x1add30);}(_0x0b30,0xbe));var _0x00b3=function(_0x3e65a8,_0x2cdf71){_0x3e65a8=_0x3e65a8-0x0;var _0x193653=_0x0b30[_0x3e65a8];return _0x193653;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x00b3('0x0')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
index 2fbca1d..45da0e6 100644
--- a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
+++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7865=['api','moment','request-promise','path','rimraf','./userOpenchannelQueue.attributes','UserOpenchannelQueue','../../config/logger'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7865,0x1a7));var _0x5786=function(_0x515e20,_0x50c7d4){_0x515e20=_0x515e20-0x0;var _0x39dca2=_0x7865[_0x515e20];return _0x39dca2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5786('0x0'))(_0x5786('0x1'));var moment=require(_0x5786('0x2'));var BPromise=require('bluebird');var rp=require(_0x5786('0x3'));var fs=require('fs');var path=require(_0x5786('0x4'));var rimraf=require(_0x5786('0x5'));var config=require('../../config/environment');var attributes=require(_0x5786('0x6'));module['exports']=function(_0x333725,_0x4f5801){return _0x333725['define'](_0x5786('0x7'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b6b=['request-promise','path','rimraf','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8b6b,0xff));var _0xb8b6=function(_0x1f7a55,_0x352d22){_0x1f7a55=_0x1f7a55-0x0;var _0x2a291b=_0x8b6b[_0x1f7a55];return _0x2a291b;};'use strict';var _=require(_0xb8b6('0x0'));var util=require(_0xb8b6('0x1'));var logger=require(_0xb8b6('0x2'))('api');var moment=require(_0xb8b6('0x3'));var BPromise=require(_0xb8b6('0x4'));var rp=require(_0xb8b6('0x5'));var fs=require('fs');var path=require(_0xb8b6('0x6'));var rimraf=require(_0xb8b6('0x7'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x23e58a,_0x12de22){return _0x23e58a['define'](_0xb8b6('0x8'),attributes,{'tableName':_0xb8b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
index b8d7a2d..46a3041 100644
--- a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
+++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd615=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x357e00,_0x38bd08){var _0x3e22cf=function(_0x58e2e1){while(--_0x58e2e1){_0x357e00['push'](_0x357e00['shift']());}};_0x3e22cf(++_0x38bd08);}(_0xd615,0x13a));var _0x5d61=function(_0x57ec6f,_0x431603){_0x57ec6f=_0x57ec6f-0x0;var _0x3d8f2c=_0xd615[_0x57ec6f];return _0x3d8f2c;};'use strict';var _=require(_0x5d61('0x0'));var util=require(_0x5d61('0x1'));var moment=require(_0x5d61('0x2'));var BPromise=require(_0x5d61('0x3'));var rs=require(_0x5d61('0x4'));var fs=require('fs');var Redis=require(_0x5d61('0x5'));var db=require(_0x5d61('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d61('0x7'))('rpc');var config=require(_0x5d61('0x8'));var jayson=require(_0x5d61('0x9'));var client=jayson[_0x5d61('0xa')][_0x5d61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492f39,_0x5164db,_0x2304a8){return new BPromise(function(_0x5abee2,_0x51e1f3){return client['request'](_0x492f39,_0x2304a8)[_0x5d61('0xc')](function(_0xb3d772){logger[_0x5d61('0xd')](_0x5d61('0xe'),_0x5164db,_0x5d61('0xf'));logger[_0x5d61('0x10')](_0x5d61('0x11'),_0x5164db,_0x5d61('0xf'),JSON['stringify'](_0xb3d772));if(_0xb3d772[_0x5d61('0x12')]){if(_0xb3d772[_0x5d61('0x12')]['code']===0x1f4){logger[_0x5d61('0x12')](_0x5d61('0xe'),_0x5164db,_0xb3d772[_0x5d61('0x12')][_0x5d61('0x13')]);return _0x51e1f3(_0xb3d772[_0x5d61('0x12')][_0x5d61('0x13')]);}logger[_0x5d61('0x12')](_0x5d61('0xe'),_0x5164db,_0xb3d772[_0x5d61('0x12')][_0x5d61('0x13')]);return _0x5abee2(_0xb3d772[_0x5d61('0x12')][_0x5d61('0x13')]);}else{logger['info'](_0x5d61('0xe'),_0x5164db,_0x5d61('0xf'));_0x5abee2(_0xb3d772[_0x5d61('0x14')][_0x5d61('0x13')]);}})[_0x5d61('0x15')](function(_0x30ab9e){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x5164db,_0x30ab9e);_0x51e1f3(_0x30ab9e);});});}
\ No newline at end of file
+var _0x014b=['code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2af6ea,_0x4bbd52){var _0x5e6cd4=function(_0x22ba84){while(--_0x22ba84){_0x2af6ea['push'](_0x2af6ea['shift']());}};_0x5e6cd4(++_0x4bbd52);}(_0x014b,0x11b));var _0xb014=function(_0x5e2ec6,_0x12ae93){_0x5e2ec6=_0x5e2ec6-0x0;var _0x105de4=_0x014b[_0x5e2ec6];return _0x105de4;};'use strict';var _=require(_0xb014('0x0'));var util=require(_0xb014('0x1'));var moment=require('moment');var BPromise=require(_0xb014('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb014('0x3'));var db=require(_0xb014('0x4'))['db'];var utils=require(_0xb014('0x5'));var logger=require(_0xb014('0x6'))(_0xb014('0x7'));var config=require(_0xb014('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb014('0x9')][_0xb014('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x82bfd9,_0x4a5ec5,_0x79928){return new BPromise(function(_0x32bfc4,_0x459c25){return client[_0xb014('0xb')](_0x82bfd9,_0x79928)[_0xb014('0xc')](function(_0x42d245){logger['info'](_0xb014('0xd'),_0x4a5ec5,_0xb014('0xe'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4a5ec5,_0xb014('0xe'),JSON[_0xb014('0xf')](_0x42d245));if(_0x42d245[_0xb014('0x10')]){if(_0x42d245[_0xb014('0x10')][_0xb014('0x11')]===0x1f4){logger['error'](_0xb014('0xd'),_0x4a5ec5,_0x42d245['error']['message']);return _0x459c25(_0x42d245[_0xb014('0x10')][_0xb014('0x12')]);}logger[_0xb014('0x10')](_0xb014('0xd'),_0x4a5ec5,_0x42d245[_0xb014('0x10')][_0xb014('0x12')]);return _0x32bfc4(_0x42d245[_0xb014('0x10')][_0xb014('0x12')]);}else{logger['info'](_0xb014('0xd'),_0x4a5ec5,'request\x20sent');_0x32bfc4(_0x42d245[_0xb014('0x13')][_0xb014('0x12')]);}})['catch'](function(_0x5edff3){logger[_0xb014('0x10')](_0xb014('0xd'),_0x4a5ec5,_0x5edff3);_0x459c25(_0x5edff3);});});}
\ No newline at end of file
diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js
index 189df18..5ec365d 100644
--- a/server/api/userProfile/index.js
+++ b/server/api/userProfile/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xae6a=['delete','removeSections','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','show','/:id/resources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','/:id','update'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xae6a,0xb9));var _0xaae6=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xae6a[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0xaae6('0x0'));var util=require('util');var path=require(_0xaae6('0x1'));var timeout=require(_0xaae6('0x2'));var express=require(_0xaae6('0x3'));var router=express[_0xaae6('0x4')]();var auth=require(_0xaae6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaae6('0x6'));var controller=require(_0xaae6('0x7'));router[_0xaae6('0x8')]('/',auth[_0xaae6('0x9')](),controller['index']);router[_0xaae6('0x8')](_0xaae6('0xa'),auth[_0xaae6('0x9')](),controller[_0xaae6('0xb')]);router[_0xaae6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xaae6('0xc')]);router[_0xaae6('0x8')](_0xaae6('0xd'),auth[_0xaae6('0x9')](),controller['getResources']);router[_0xaae6('0xe')]('/',auth[_0xaae6('0x9')](),controller[_0xaae6('0xf')]);router[_0xaae6('0xe')](_0xaae6('0x10'),auth['isAuthenticated'](),controller[_0xaae6('0x11')]);router[_0xaae6('0xe')](_0xaae6('0x12'),auth[_0xaae6('0x9')](),controller[_0xaae6('0x13')]);router[_0xaae6('0xe')](_0xaae6('0xd'),auth['isAuthenticated'](),controller[_0xaae6('0x14')]);router['put'](_0xaae6('0x15'),auth[_0xaae6('0x9')](),controller[_0xaae6('0x16')]);router[_0xaae6('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xaae6('0x17')](_0xaae6('0x12'),auth[_0xaae6('0x9')](),controller[_0xaae6('0x18')]);router[_0xaae6('0x17')]('/:id/resources',auth[_0xaae6('0x9')](),controller['removeResources']);module[_0xaae6('0x19')]=router;
\ No newline at end of file
+var _0x8b1e=['removeSections','multer','util','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','show','getResources','post','/:id/clone','clone','/:id/sections','addSections','/:id/resources','addResources','put','/:id','delete'];(function(_0x5dbc80,_0x556414){var _0x210c47=function(_0x38ceaa){while(--_0x38ceaa){_0x5dbc80['push'](_0x5dbc80['shift']());}};_0x210c47(++_0x556414);}(_0x8b1e,0x1e4));var _0xe8b1=function(_0x4a5dbf,_0x39e82f){_0x4a5dbf=_0x4a5dbf-0x0;var _0x4c3e50=_0x8b1e[_0x4a5dbf];return _0x4c3e50;};'use strict';var multer=require(_0xe8b1('0x0'));var util=require(_0xe8b1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xe8b1('0x2'));var interaction=require(_0xe8b1('0x3'));var config=require('../../config/environment');var controller=require(_0xe8b1('0x4'));router[_0xe8b1('0x5')]('/',auth[_0xe8b1('0x6')](),controller[_0xe8b1('0x7')]);router[_0xe8b1('0x5')](_0xe8b1('0x8'),auth[_0xe8b1('0x6')](),controller[_0xe8b1('0x9')]);router[_0xe8b1('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xe8b1('0xa')]);router[_0xe8b1('0x5')]('/:id/resources',auth[_0xe8b1('0x6')](),controller[_0xe8b1('0xb')]);router['post']('/',auth[_0xe8b1('0x6')](),controller['create']);router[_0xe8b1('0xc')](_0xe8b1('0xd'),auth['isAuthenticated'](),controller[_0xe8b1('0xe')]);router[_0xe8b1('0xc')](_0xe8b1('0xf'),auth[_0xe8b1('0x6')](),controller[_0xe8b1('0x10')]);router[_0xe8b1('0xc')](_0xe8b1('0x11'),auth[_0xe8b1('0x6')](),controller[_0xe8b1('0x12')]);router[_0xe8b1('0x13')](_0xe8b1('0x14'),auth[_0xe8b1('0x6')](),controller['update']);router[_0xe8b1('0x15')](_0xe8b1('0x14'),auth['isAuthenticated'](),controller['destroy']);router[_0xe8b1('0x15')](_0xe8b1('0xf'),auth[_0xe8b1('0x6')](),controller[_0xe8b1('0x16')]);router['delete'](_0xe8b1('0x11'),auth[_0xe8b1('0x6')](),controller['removeResources']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js
index 56ce40a..6b87216 100644
--- a/server/api/userProfile/userProfile.attributes.js
+++ b/server/api/userProfile/userProfile.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a20=['setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING'];(function(_0x2efcbf,_0x259bea){var _0x9c2aee=function(_0xc974f6){while(--_0xc974f6){_0x2efcbf['push'](_0x2efcbf['shift']());}};_0x9c2aee(++_0x259bea);}(_0x3a20,0x85));var _0x03a2=function(_0x4d7926,_0x1ca121){_0x4d7926=_0x4d7926-0x0;var _0x47f41a=_0x3a20[_0x4d7926];return _0x47f41a;};'use strict';var Sequelize=require(_0x03a2('0x0'));module[_0x03a2('0x1')]={'name':{'type':Sequelize[_0x03a2('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x03a2('0x2')],'set':function(_0x3b1f4a){this[_0x03a2('0x3')](_0x03a2('0x4'),_0x3b1f4a?_0x3b1f4a[_0x03a2('0x5')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x03a2('0x6')](_0x03a2('0x4'))[_0x03a2('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x03a2('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x0725=['join','getDataValue','crudPermissions','split','exports','name','setDataValue'];(function(_0x56acc4,_0x1accb4){var _0x4fc1eb=function(_0x339ae7){while(--_0x339ae7){_0x56acc4['push'](_0x56acc4['shift']());}};_0x4fc1eb(++_0x1accb4);}(_0x0725,0xac));var _0x5072=function(_0x15f229,_0xb22bf7){_0x15f229=_0x15f229-0x0;var _0x15290b=_0x0725[_0x15f229];return _0x15290b;};'use strict';var Sequelize=require('sequelize');module[_0x5072('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5072('0x1')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1280d3){this[_0x5072('0x2')]('crudPermissions',_0x1280d3?_0x1280d3[_0x5072('0x3')](''):[]);},'get':function(){return this[_0x5072('0x4')](_0x5072('0x5'))?this[_0x5072('0x4')]('crudPermissions')[_0x5072('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js
index 878d247..0f171e1 100644
--- a/server/api/userProfile/userProfile.controller.js
+++ b/server/api/userProfile/userProfile.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8803=['Content-Range','reject','save','update','then','error','name','send','index','UserProfile','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','find','create','clone','params','omit','createdAt','updatedAt','body','sequelize','transaction','get','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','addSections','removeSections','ids','addResources','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','push','findOne','all','ignore','union','hasOwnProperty','AnalyticExtractedReport','foreignKey','associatedResources','forEach','reportType','default','reportId','custom','CmContact','color','tag','Tag','value','resourceId','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','projectName','contacts','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','teams','voicequeues','queuecampaigns','VoiceQueues','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','Trunk','variables','Variable','extractedreports','Reports','AnalyticMetric','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../mysqldb','defaults','redis','socket.io-emitter','./userProfile.socket','register','sendStatus','json','offset','limit','status','set'];(function(_0x15ca05,_0x2b5b95){var _0x12f94a=function(_0x466688){while(--_0x466688){_0x15ca05['push'](_0x15ca05['shift']());}};_0x12f94a(++_0x2b5b95);}(_0x8803,0x1af));var _0x3880=function(_0x3a9b21,_0x5bc7c5){_0x3a9b21=_0x3a9b21-0x0;var _0x55a238=_0x8803[_0x3a9b21];return _0x55a238;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3880('0x0'));var rimraf=require(_0x3880('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3880('0x2'));var rp=require(_0x3880('0x3'));var moment=require(_0x3880('0x4'));var BPromise=require(_0x3880('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3880('0x6'));var csv=require(_0x3880('0x7'));var ejs=require(_0x3880('0x8'));var fs=require('fs');var _=require(_0x3880('0x9'));var squel=require(_0x3880('0xa'));var crypto=require(_0x3880('0xb'));var jsforce=require(_0x3880('0xc'));var deskjs=require(_0x3880('0xd'));var toCsv=require(_0x3880('0x7'));var querystring=require(_0x3880('0xe'));var Papa=require(_0x3880('0xf'));var Redis=require('ioredis');var authService=require(_0x3880('0x10'));var qs=require(_0x3880('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3880('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3880('0x13'))['db'];config['redis']=_[_0x3880('0x14')](config[_0x3880('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x3880('0x16'))(new Redis(config[_0x3880('0x15')]));require(_0x3880('0x17'))[_0x3880('0x18')](socket);function respondWithStatusCode(_0x43ca95,_0x41984a){_0x41984a=_0x41984a||0xcc;return function(_0x3b3606){if(_0x3b3606){return _0x43ca95[_0x3880('0x19')](_0x41984a);}return _0x43ca95['status'](_0x41984a)['end']();};}function respondWithResult(_0x2acf9c,_0x240c5d){_0x240c5d=_0x240c5d||0xc8;return function(_0x1b48c1){if(_0x1b48c1){return _0x2acf9c['status'](_0x240c5d)[_0x3880('0x1a')](_0x1b48c1);}};}function respondWithFilteredResult(_0x4293f8,_0x276758){return function(_0x451bc3){if(_0x451bc3){var _0x8628b8=_0x451bc3['count'],_0x23b1a8=_0x276758['offset'],_0x11bef4=_0x276758[_0x3880('0x1b')]+_0x276758[_0x3880('0x1c')],_0x2ffd2d;if(_0x11bef4>=_0x8628b8){_0x11bef4=_0x8628b8;_0x2ffd2d=0xc8;}else{_0x2ffd2d=0xce;}_0x4293f8[_0x3880('0x1d')](_0x2ffd2d);return _0x4293f8[_0x3880('0x1e')](_0x3880('0x1f'),_0x23b1a8+'-'+_0x11bef4+'/'+_0x8628b8)[_0x3880('0x1a')](_0x451bc3);}return null;};}function patchUpdates(_0x5ceb79){return function(_0x42eed9){try{jsonpatch['apply'](_0x42eed9,_0x5ceb79,!![]);}catch(_0x5cff23){return BPromise[_0x3880('0x20')](_0x5cff23);}return _0x42eed9[_0x3880('0x21')]();};}function saveUpdates(_0x563c26,_0x1c5b3a){return function(_0x2812a0){if(_0x2812a0){return _0x2812a0[_0x3880('0x22')](_0x563c26)['then'](function(_0xc78a0c){return _0xc78a0c;});}return null;};}function removeEntity(_0x4070c7,_0x516df4){return function(_0x3ba068){if(_0x3ba068){return _0x3ba068['destroy']()[_0x3880('0x23')](function(){_0x4070c7[_0x3880('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2028f5,_0x532123){return function(_0x30a047){if(!_0x30a047){_0x2028f5[_0x3880('0x19')](0x194);}return _0x30a047;};}function handleError(_0x21e070,_0x417709){_0x417709=_0x417709||0x1f4;return function(_0x1276e7){logger[_0x3880('0x24')](_0x1276e7['stack']);if(_0x1276e7[_0x3880('0x25')]){delete _0x1276e7[_0x3880('0x25')];}_0x21e070[_0x3880('0x1d')](_0x417709)[_0x3880('0x26')](_0x1276e7);};}exports[_0x3880('0x27')]=function(_0x21500d,_0x2a9995){var _0x19c282={},_0xc8c42a={},_0x5b704e={'count':0x0,'rows':[]};var _0x4177e5=db[_0x3880('0x28')][_0x3880('0x29')];_0xc8c42a['model']=_[_0x3880('0x2a')](_0x4177e5);_0xc8c42a[_0x3880('0x2b')]=_[_0x3880('0x2a')](_0x21500d[_0x3880('0x2b')]);_0xc8c42a[_0x3880('0x2c')]=_[_0x3880('0x2d')](_0xc8c42a[_0x3880('0x2e')],_0xc8c42a[_0x3880('0x2b')]);_0x19c282[_0x3880('0x2f')]=_[_0x3880('0x2d')](_0xc8c42a['model'],qs[_0x3880('0x30')](_0x21500d[_0x3880('0x2b')][_0x3880('0x30')]));_0x19c282['attributes']=_0x19c282['attributes'][_0x3880('0x31')]?_0x19c282[_0x3880('0x2f')]:_0xc8c42a[_0x3880('0x2e')];if(!_0x21500d['query']['hasOwnProperty'](_0x3880('0x32'))){_0x19c282[_0x3880('0x1c')]=qs[_0x3880('0x1c')](_0x21500d[_0x3880('0x2b')]['limit']);_0x19c282['offset']=qs[_0x3880('0x1b')](_0x21500d[_0x3880('0x2b')][_0x3880('0x1b')]);}_0x19c282[_0x3880('0x33')]=qs[_0x3880('0x34')](_0x21500d['query']['sort']);_0x19c282[_0x3880('0x35')]=qs['filters'](_['pick'](_0x21500d[_0x3880('0x2b')],_0xc8c42a[_0x3880('0x2c')]));if(_0x21500d[_0x3880('0x2b')][_0x3880('0x36')]){_0x19c282['where']=_[_0x3880('0x37')](_0x19c282[_0x3880('0x35')],{'$or':_[_0x3880('0x38')](_0x4177e5,function(_0x138f1e){if(_0x138f1e[_0x3880('0x39')][_0x3880('0x3a')]!==_0x3880('0x3b')){var _0x56084c={};_0x56084c[_0x138f1e[_0x3880('0x3c')]]={'$like':'%'+_0x21500d[_0x3880('0x2b')][_0x3880('0x36')]+'%'};return _0x56084c;}})});}_0x19c282=_[_0x3880('0x37')]({},_0x19c282,_0x21500d[_0x3880('0x3d')]);var _0x3e5a8e={'where':_0x19c282[_0x3880('0x35')]};return db[_0x3880('0x28')][_0x3880('0x3e')](_0x3e5a8e)[_0x3880('0x23')](function(_0xba7aae){_0x5b704e[_0x3880('0x3e')]=_0xba7aae;if(_0x21500d[_0x3880('0x2b')][_0x3880('0x3f')]){_0x19c282[_0x3880('0x40')]=[{'all':!![]}];}return db['UserProfile'][_0x3880('0x41')](_0x19c282);})[_0x3880('0x23')](function(_0x37eae7){_0x5b704e[_0x3880('0x42')]=_0x37eae7;return _0x5b704e;})['then'](respondWithFilteredResult(_0x2a9995,_0x19c282))[_0x3880('0x43')](handleError(_0x2a9995,null));};exports[_0x3880('0x44')]=function(_0x126d3d,_0x1d3a60){var _0x2f0bfb={'raw':![],'where':{'id':_0x126d3d['params']['id']}},_0x214499={};_0x214499[_0x3880('0x2e')]=_[_0x3880('0x2a')](db[_0x3880('0x28')][_0x3880('0x29')]);_0x214499[_0x3880('0x2b')]=_['keys'](_0x126d3d[_0x3880('0x2b')]);_0x214499['filters']=_[_0x3880('0x2d')](_0x214499['model'],_0x214499[_0x3880('0x2b')]);_0x2f0bfb[_0x3880('0x2f')]=_[_0x3880('0x2d')](_0x214499[_0x3880('0x2e')],qs['fields'](_0x126d3d[_0x3880('0x2b')][_0x3880('0x30')]));_0x2f0bfb['attributes']=_0x2f0bfb[_0x3880('0x2f')]['length']?_0x2f0bfb[_0x3880('0x2f')]:_0x214499[_0x3880('0x2e')];if(_0x126d3d['query']['includeAll']){_0x2f0bfb[_0x3880('0x40')]=[{'all':!![]}];}_0x2f0bfb=_[_0x3880('0x37')]({},_0x2f0bfb,_0x126d3d[_0x3880('0x3d')]);return db[_0x3880('0x28')][_0x3880('0x45')](_0x2f0bfb)[_0x3880('0x23')](handleEntityNotFound(_0x1d3a60,null))[_0x3880('0x23')](respondWithResult(_0x1d3a60,null))[_0x3880('0x43')](handleError(_0x1d3a60,null));};exports[_0x3880('0x46')]=function(_0x291013,_0x24d744){return db['UserProfile'][_0x3880('0x46')](_0x291013['body'],{})['then'](respondWithResult(_0x24d744,0xc9))[_0x3880('0x43')](handleError(_0x24d744,null));};exports[_0x3880('0x47')]=function(_0x2959aa,_0x4fbc68){var _0x5a68ec={'raw':![],'where':{'id':_0x2959aa[_0x3880('0x48')]['id']}},_0xf9fe2e={};_0xf9fe2e[_0x3880('0x2e')]=_[_0x3880('0x2a')](db['UserProfile'][_0x3880('0x29')]);_0x5a68ec[_0x3880('0x2f')]=_['intersection'](_0xf9fe2e['model'],qs['fields'](_0x2959aa[_0x3880('0x2b')][_0x3880('0x30')]));_0x5a68ec[_0x3880('0x2f')]=_0x5a68ec[_0x3880('0x2f')]['length']?_0x5a68ec[_0x3880('0x2f')]:_0xf9fe2e[_0x3880('0x2e')];if(_0x2959aa[_0x3880('0x2b')]['includeAll']){_0x5a68ec[_0x3880('0x40')]=[{'all':!![]}];}_0x5a68ec=_[_0x3880('0x37')]({},_0x5a68ec,_0x2959aa[_0x3880('0x3d')]);return db[_0x3880('0x28')][_0x3880('0x45')](_0x5a68ec)[_0x3880('0x23')](handleEntityNotFound(_0x4fbc68,null))['then'](function(_0x289e8d){if(_0x289e8d){var _0x20a3bb=_0x289e8d['get']({'plain':!![]});_0x20a3bb=qs[_0x3880('0x49')](_0x20a3bb,['id',_0x3880('0x4a'),_0x3880('0x4b'),'crudPermissions']);_0x2959aa[_0x3880('0x4c')]=_[_0x3880('0x49')](_0x2959aa['body'],['id',_0x3880('0x4a'),_0x3880('0x4b')]);return db[_0x3880('0x4d')][_0x3880('0x4e')](function(_0x170ffa){return db[_0x3880('0x28')]['create'](_[_0x3880('0x37')](_0x20a3bb,_0x2959aa[_0x3880('0x4c')]),{'include':_0x2959aa[_0x3880('0x2b')][_0x3880('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x170ffa})[_0x3880('0x23')](function(_0x5744f6){var _0x3bb2a1=_0x5744f6[_0x3880('0x4f')]({'plain':!![]});return db[_0x3880('0x50')]['findAll']({'where':{'userProfileId':_0x2959aa[_0x3880('0x48')]['id']},'raw':!![]})[_0x3880('0x23')](function(_0x33253e){if(_0x33253e){return BPromise[_0x3880('0x51')](_0x33253e,function(_0x6d8a86){return new BPromise(function(_0x5c5b86,_0x5373ee){if(_0x6d8a86[_0x3880('0x52')]===null||_0x6d8a86[_0x3880('0x52')]===0x1)_0x5c5b86(null);return db[_0x3880('0x53')][_0x3880('0x41')]({'where':{'sectionId':_0x6d8a86['id']},'raw':!![]})[_0x3880('0x23')](function(_0x1347af){var _0x125204=_[_0x3880('0x38')](_0x1347af,function(_0x3f57a5){return qs['omit'](_0x3f57a5,['id',_0x3880('0x4a'),_0x3880('0x4b'),_0x3880('0x54')]);});_0x5c5b86(_0x125204);})[_0x3880('0x43')](function(_0x5e6bb9){_0x5373ee(_0x5e6bb9);});})[_0x3880('0x23')](function(_0x39e7cf){var _0x2dd330=qs['omit'](_0x6d8a86,['id','createdAt',_0x3880('0x4b')]);_0x2dd330[_0x3880('0x55')]=_0x3bb2a1['id'];if(_0x39e7cf)_0x2dd330['Resources']=_0x39e7cf;return _0x2dd330;})[_0x3880('0x23')](function(_0x1a0ec0){return db['UserProfileSection'][_0x3880('0x46')](_0x1a0ec0,{'include':[{'model':db['UserProfileResource'],'as':_0x3880('0x56')}],'raw':!![],'transaction':_0x170ffa});});})[_0x3880('0x23')](function(){return _0x3bb2a1;});}});});});}})[_0x3880('0x23')](respondWithResult(_0x4fbc68,0xc9))['catch'](handleError(_0x4fbc68,null));};exports[_0x3880('0x22')]=function(_0x4981ce,_0x303a66){if(_0x4981ce[_0x3880('0x4c')]['id']){delete _0x4981ce[_0x3880('0x4c')]['id'];}return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x4981ce['params']['id']}})[_0x3880('0x23')](handleEntityNotFound(_0x303a66,null))['then'](saveUpdates(_0x4981ce[_0x3880('0x4c')],null))[_0x3880('0x23')](respondWithResult(_0x303a66,null))[_0x3880('0x43')](handleError(_0x303a66,null));};exports[_0x3880('0x57')]=function(_0x13b109,_0x3e9436){return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x13b109['params']['id']}})['then'](handleEntityNotFound(_0x3e9436,null))[_0x3880('0x23')](removeEntity(_0x3e9436,null))[_0x3880('0x43')](handleError(_0x3e9436,null));};exports['describe']=function(_0x3c5155,_0x4fcfdf){return db['UserProfile']['describe']()[_0x3880('0x23')](respondWithResult(_0x4fcfdf,null))[_0x3880('0x43')](handleError(_0x4fcfdf,null));};exports[_0x3880('0x58')]=function(_0x2895dc,_0xe8ef0a){var _0x11038a=_0x2895dc[_0x3880('0x4c')];return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x2895dc[_0x3880('0x48')]['id']}})[_0x3880('0x23')](handleEntityNotFound(_0xe8ef0a,null))[_0x3880('0x23')](function(_0x3da3e0){if(_0x3da3e0){return db['sequelize'][_0x3880('0x4e')](function(_0x1a20ea){return db[_0x3880('0x50')][_0x3880('0x57')]({'where':{'userProfileId':_0x2895dc[_0x3880('0x48')]['id'],'sectionId':_[_0x3880('0x38')](_0x11038a,function(_0x36401c){return _0x36401c[_0x3880('0x54')];})},'transaction':_0x1a20ea})[_0x3880('0x23')](function(){var _0x29f922=_['map'](_0x11038a,function(_0x29da3a){_0x29da3a[_0x3880('0x55')]=_0x2895dc[_0x3880('0x48')]['id'];return _0x29da3a;});var _0x5ddd75=[];return BPromise[_0x3880('0x51')](_0x29f922,function(_0x32beef){return db[_0x3880('0x50')][_0x3880('0x46')](_0x32beef,{'include':[{'model':db[_0x3880('0x53')],'as':'Resources'}],'raw':!![],'transaction':_0x1a20ea})[_0x3880('0x23')](function(_0x5127da){_0x5ddd75['push'](_0x5127da[_0x3880('0x4f')]({'plain':!![]}));});})[_0x3880('0x23')](function(){return _0x5ddd75;});});});}})[_0x3880('0x23')](function(_0x1c4f68){return _0x1c4f68;})['then'](respondWithResult(_0xe8ef0a,null))[_0x3880('0x43')](handleError(_0xe8ef0a,null));};exports[_0x3880('0x59')]=function(_0x3ab93e,_0x33afe9){var _0x3d7bab;return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x3ab93e[_0x3880('0x48')]['id']},'attributes':['id',_0x3880('0x25')]})['then'](handleEntityNotFound(_0x33afe9,null))[_0x3880('0x23')](function(_0x521c97){if(_0x521c97){_0x3d7bab=_0x521c97;return db['UserProfileSection'][_0x3880('0x57')]({'where':{'userProfileId':_0x3ab93e['params']['id'],'sectionId':_0x3ab93e[_0x3880('0x2b')][_0x3880('0x5a')]}});}})[_0x3880('0x23')](function(){return _0x3d7bab;})[_0x3880('0x23')](respondWithStatusCode(_0x33afe9,null))[_0x3880('0x43')](handleError(_0x33afe9,null));};exports[_0x3880('0x5b')]=function(_0x576c4d,_0x2e67e0){return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x576c4d[_0x3880('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e67e0,null))[_0x3880('0x23')](function(_0x2eb431){if(_0x2eb431){return db[_0x3880('0x4d')][_0x3880('0x4e')](function(_0x4741df){return db[_0x3880('0x50')][_0x3880('0x41')]({'where':{'userProfileId':_0x576c4d['params']['id']},'attributes':['id'],'raw':!![]})[_0x3880('0x23')](function(_0x5aec2b){if(_0x5aec2b){return db[_0x3880('0x50')][_0x3880('0x57')]({'where':{'userProfileId':_0x576c4d['params']['id'],'id':_[_0x3880('0x38')](_0x5aec2b,function(_0xb2217b){return _0xb2217b['id'];})},'transaction':_0x4741df});}})[_0x3880('0x23')](function(_0x3412ab){var _0xb29868=_[_0x3880('0x38')](_0x576c4d[_0x3880('0x4c')],function(_0x342c0e){_0x342c0e[_0x3880('0x55')]=_0x576c4d[_0x3880('0x48')]['id'];return _0x342c0e;});return db[_0x3880('0x50')][_0x3880('0x5c')](_0xb29868,{'raw':!![],'transaction':_0x4741df});})[_0x3880('0x23')](function(_0x4e7618){var _0x3940b1=_['filter'](_['map'](_0x4e7618,function(_0x49729d){return _0x49729d[_0x3880('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x3940b1){return db[_0x3880('0x50')]['findAll']({'where':{'userProfileId':_0x576c4d[_0x3880('0x48')]['id'],'sectionId':_[_0x3880('0x38')](_0x3940b1,function(_0x52087f){return _0x52087f[_0x3880('0x54')];})},'attributes':['id',_0x3880('0x54')],'raw':!![]})['then'](function(_0x719520){var _0x4d4792=_[_0x3880('0x38')](_0x576c4d[_0x3880('0x4c')],function(_0x2edd3a){_0x2edd3a[_0x3880('0x55')]=_0x576c4d[_0x3880('0x48')]['id'];return _0x2edd3a;});return db['UserProfileResource'][_0x3880('0x5c')](_0x4d4792,{'raw':!![],'transaction':_0x4741df});});}})[_0x3880('0x43')](handleError(_0x2e67e0,null));});}})[_0x3880('0x23')](function(_0x165ba9){var _0x2176c6=_['map'](_0x165ba9,function(_0x4d5f77){return _0x4d5f77[_0x3880('0x4f')]({'plain':!![]});});})[_0x3880('0x23')](respondWithResult(_0x2e67e0,null))[_0x3880('0x43')](handleError(_0x2e67e0,null));};exports[_0x3880('0x5d')]=function(_0x58bcc2,_0x37ff2f,_0x26feff){return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x58bcc2['params']['id']}})[_0x3880('0x23')](handleEntityNotFound(_0x37ff2f,null))[_0x3880('0x23')](function(_0x5208a4){if(_0x5208a4){return _0x5208a4[_0x3880('0x5d')](_0x58bcc2['query']['ids']);}})[_0x3880('0x23')](respondWithStatusCode(_0x37ff2f,null))['catch'](handleError(_0x37ff2f,null));};exports[_0x3880('0x5e')]=function(_0x3be6c8,_0x3ceef5){var _0x53368a={'raw':![],'where':{}};var _0x267e18={};var _0x24c80f={'count':0x0,'rows':[]};var _0x2174de=_0x3be6c8[_0x3880('0x2b')][_0x3880('0x5f')];if(typeof _0x2174de===_0x3880('0x60')){throw new db[(_0x3880('0x61'))][(_0x3880('0x62'))](_0x3880('0x63'));}var _0x1c3353=_0x3be6c8['query'][_0x3880('0x64')]||![];var _0x41c8fc=getQueryModels(_0x2174de,_0x1c3353);if(typeof _0x41c8fc[_0x3880('0x65')]==='undefined'){throw new db[(_0x3880('0x61'))][(_0x3880('0x62'))](_0x3880('0x66')+_0x2174de+'\x27');}var _0x2a2943=[];if(!_[_0x3880('0x67')](_0x41c8fc[_0x3880('0x68')])){_0x2a2943=_0x41c8fc[_0x3880('0x68')];}else{_0x2a2943=[{'name':_0x2174de}];}return db[_0x3880('0x28')]['findOne']({'where':{'id':_0x3be6c8[_0x3880('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ceef5,null))['then'](function(_0x3792ea){if(_0x3792ea){var _0x21726b=[];for(var _0x5f0587=0x0;_0x5f0587<_0x2a2943[_0x3880('0x31')];_0x5f0587++){_0x21726b[_0x3880('0x69')](db[_0x3880('0x50')][_0x3880('0x6a')]({'where':{'userProfileId':_0x3792ea['id'],'name':_0x2a2943[_0x5f0587][_0x3880('0x25')]},'raw':!![]}));}return BPromise[_0x3880('0x6b')](_0x21726b);}})[_0x3880('0x23')](function(_0x5a9381){var _0xd5a0a5=_['filter'](_0x5a9381,function(_0x3d4294){return _0x3d4294?_0x3d4294:undefined;});var _0x53a524=_[_0x3880('0x36')](_0x2a2943,[_0x3880('0x6c'),!![]]);var _0x47ba7b=_['isEmpty'](_0xd5a0a5)&&_[_0x3880('0x67')](_0x53a524)?null:_[_0x3880('0x6d')](_0x53a524,_0xd5a0a5);if(_0x47ba7b){var _0x285620=[];for(var _0x668c39=0x0;_0x668c39<_0x47ba7b['length'];_0x668c39++){var _0x5564cd=_[_0x3880('0x45')](_0x2a2943,function(_0x2e63ec){return _0x47ba7b[_0x668c39]?_0x2e63ec[_0x3880('0x25')]===_0x47ba7b[_0x668c39][_0x3880('0x25')]:null;});if(_0x5564cd){if(_0x47ba7b[_0x668c39][_0x3880('0x6c')]){_0x285620[_0x3880('0x69')](getAllResources(_0x41c8fc[_0x3880('0x65')],_0x47ba7b[_0x668c39]));}else{if(!_0x47ba7b[_0x668c39][_0x3880('0x52')]){_0x285620['push'](getAllowedResources(_0x5564cd,_0x47ba7b[_0x668c39],_0x41c8fc[_0x3880('0x65')]));}else{if(_0x5564cd['model']){_0x285620[_0x3880('0x69')](getAllFilteredResources(_0x5564cd,_0x47ba7b[_0x668c39]));}}}}}return BPromise[_0x3880('0x6b')](_0x285620);}else{return null;}})['then'](function(_0x2fdf5c){var _0x44e697=_0x2fdf5c;var _0x1109fa=null;if(_0x44e697){_0x1109fa=_0x44e697[_0x3880('0x31')]===0x1?_0x44e697[0x0]:null;}if(_0x1109fa||_0x44e697){var _0x1ddbfe=db[_0x41c8fc[_0x3880('0x65')]][_0x3880('0x29')];_0x267e18[_0x3880('0x2e')]=_[_0x3880('0x2a')](_0x1ddbfe);_0x267e18[_0x3880('0x2b')]=_['keys'](_0x3be6c8[_0x3880('0x2b')]);_0x267e18[_0x3880('0x2c')]=_[_0x3880('0x2d')](_0x267e18['model'],_0x267e18[_0x3880('0x2b')]);_0x53368a[_0x3880('0x2f')]=_[_0x3880('0x2d')](_0x267e18[_0x3880('0x2e')],qs[_0x3880('0x30')](_0x3be6c8[_0x3880('0x2b')][_0x3880('0x30')]));_0x53368a['attributes']=_0x53368a[_0x3880('0x2f')][_0x3880('0x31')]?_0x53368a['attributes']:_0x267e18[_0x3880('0x2e')];if(!_0x3be6c8['query'][_0x3880('0x6e')](_0x3880('0x32'))){_0x53368a['limit']=qs[_0x3880('0x1c')](_0x3be6c8[_0x3880('0x2b')]['limit']);_0x53368a[_0x3880('0x1b')]=qs[_0x3880('0x1b')](_0x3be6c8[_0x3880('0x2b')]['offset']);}_0x53368a[_0x3880('0x33')]=qs[_0x3880('0x34')](_0x3be6c8[_0x3880('0x2b')]['sort']);_0x53368a[_0x3880('0x35')]=qs['filters'](_['pick'](_0x3be6c8['query'],_0x267e18[_0x3880('0x2c')]));if(_0x3be6c8[_0x3880('0x2b')][_0x3880('0x36')]){_0x53368a['where']=_[_0x3880('0x37')](_0x53368a[_0x3880('0x35')],{'$or':_[_0x3880('0x38')](_0x1ddbfe,function(_0x122a6b){if(_0x122a6b[_0x3880('0x39')][_0x3880('0x3a')]!==_0x3880('0x3b')){var _0x314fdb={};_0x314fdb[_0x122a6b[_0x3880('0x3c')]]={'$like':'%'+_0x3be6c8[_0x3880('0x2b')][_0x3880('0x36')]+'%'};return _0x314fdb;}})});}var _0x349289=[];if(_0x1109fa){var _0x29ec72=_[_0x3880('0x45')](_0x2a2943,[_0x3880('0x25'),_0x1109fa[_0x3880('0x25')]]);if(_0x29ec72[_0x3880('0x3c')]){var _0x36de2e={};if(_0x41c8fc[_0x3880('0x65')]===_0x3880('0x6f')){_0x36de2e[_0x29ec72[_0x3880('0x70')]]=_[_0x3880('0x38')](_0x1109fa[_0x3880('0x71')],'id');}else{_0x36de2e[_0x29ec72[_0x3880('0x70')]]=_0x1109fa[_0x3880('0x71')];}_0x349289[_0x3880('0x69')](_0x36de2e);}else{_0x53368a['where']['id']=_0x1109fa[_0x3880('0x71')];}}else{for(var _0x699e21=0x0;_0x699e21<_0x44e697[_0x3880('0x31')];_0x699e21++){var _0x29ec72=_[_0x3880('0x45')](_0x2a2943,[_0x3880('0x25'),_0x44e697[_0x699e21][_0x3880('0x25')]]);if(_0x29ec72[_0x3880('0x3c')]){var _0x36de2e={};_0x36de2e[_0x29ec72[_0x3880('0x70')]]=_0x44e697[_0x699e21][_0x3880('0x71')];_0x349289['push'](_0x36de2e);}else{if(!_0x53368a[_0x3880('0x35')]['id'])_0x53368a['where']['id']=[];_0x44e697[_0x699e21][_0x3880('0x71')][_0x3880('0x72')](function(_0x2b161d){_0x53368a[_0x3880('0x35')]['id']['push'](_0x2b161d);});}}}if(!_[_0x3880('0x67')](_0x349289)){_0x53368a['where']=_[_0x3880('0x37')](_0x53368a['where'],{'$and':{'$or':_0x349289}});}_0x53368a=_['merge']({},_0x53368a,_0x3be6c8[_0x3880('0x3d')]);if(_0x1109fa&&!_0x1109fa[_0x3880('0x52')]&&_0x41c8fc['childModel']===_0x3880('0x6f')){if(_0x3be6c8[_0x3880('0x2b')][_0x3880('0x3f')]){_0x53368a[_0x3880('0x40')]=[{'all':!![]}];}return db[_0x41c8fc[_0x3880('0x65')]][_0x3880('0x41')](_0x53368a)[_0x3880('0x23')](function(_0x337ef8){var _0x56f7d5=[];_0x337ef8['forEach'](function(_0x125b3c){var _0x3c537c;switch(_0x125b3c[_0x3880('0x73')]){case _0x3880('0x74'):_0x3c537c=_[_0x3880('0x45')](_0x1109fa[_0x3880('0x71')],function(_0x2ee8dc){return _0x2ee8dc['id']===_0x125b3c[_0x3880('0x75')]&&_0x2ee8dc[_0x3880('0x39')]==='DefaultReports';});break;case _0x3880('0x76'):_0x3c537c=_[_0x3880('0x45')](_0x1109fa[_0x3880('0x71')],function(_0x52744b){return _0x52744b['id']===_0x125b3c[_0x3880('0x75')]&&_0x52744b[_0x3880('0x39')]==='CustomReports';});break;}if(_0x3c537c)_0x56f7d5[_0x3880('0x69')](_0x125b3c);});_0x24c80f[_0x3880('0x3e')]=_0x56f7d5[_0x3880('0x31')];_0x24c80f[_0x3880('0x42')]=_0x56f7d5;return _0x24c80f;});}else{return db[_0x41c8fc[_0x3880('0x65')]][_0x3880('0x3e')]({'where':_0x53368a['where']})['then'](function(_0x5d9352){_0x24c80f['count']=_0x5d9352;if(_0x3be6c8[_0x3880('0x2b')][_0x3880('0x3f')]){if(_0x41c8fc['childModel']===_0x3880('0x77')){_0x53368a[_0x3880('0x40')]=[{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x3880('0x78')],'required':_0x3be6c8[_0x3880('0x2b')][_0x3880('0x79')]?!![]:![]},{'model':db[_0x3880('0x7a')],'as':'ThroughTags','attributes':['id',_0x3880('0x25'),_0x3880('0x78')],'through':_0x3be6c8[_0x3880('0x2b')]['tag']?{'attributes':[],'where':{'TagId':_0x3be6c8[_0x3880('0x2b')][_0x3880('0x79')]||undefined}}:{},'required':_0x3be6c8[_0x3880('0x2b')][_0x3880('0x79')]?!![]:![]}];}else{_0x53368a[_0x3880('0x40')]=[{'all':!![]}];}}return db[_0x41c8fc[_0x3880('0x65')]][_0x3880('0x41')](_0x53368a);})['then'](function(_0x4c3b9c){_0x24c80f[_0x3880('0x42')]=_0x4c3b9c;return _0x24c80f;});}}else{return _0x24c80f;}})[_0x3880('0x23')](respondWithFilteredResult(_0x3ceef5,_0x53368a))[_0x3880('0x43')](handleError(_0x3ceef5,null));};function getAllResources(_0x324e94,_0x5863a0){return new BPromise(function(_0xe36398,_0x495764){if(_0x5863a0){var _0x367097=_0x5863a0['filter']?{[_0x5863a0[_0x3880('0x36')][_0x3880('0x3c')]]:_0x5863a0[_0x3880('0x36')]['value']}:undefined;return db[_0x324e94][_0x3880('0x41')]({'where':_0x367097,'raw':!![]})['then'](function(_0x5f1f3f){_0x5863a0[_0x3880('0x71')]=_[_0x3880('0x38')](_0x5f1f3f,'id');_0xe36398(_0x5863a0);})[_0x3880('0x43')](function(_0x39e588){_0x495764(_0x39e588);});}else{_0xe36398(null);}});}function getAllFilteredResources(_0x443c77,_0x4b420e){return new BPromise(function(_0x408b36,_0xea604c){var _0x3cb7de=_0x443c77[_0x3880('0x36')]?{[_0x443c77['filter'][_0x3880('0x3c')]]:_0x443c77[_0x3880('0x36')][_0x3880('0x7b')]}:undefined;return db[_0x443c77[_0x3880('0x2e')]][_0x3880('0x41')]({'where':_0x3cb7de,'raw':!![]})[_0x3880('0x23')](function(_0xabc2f8){_0x4b420e['associatedResources']=_[_0x3880('0x38')](_0xabc2f8,function(_0x1dd3aa){return _0x1dd3aa[_0x3880('0x25')];});_0x408b36(_0x4b420e);})[_0x3880('0x43')](function(_0x331d78){_0xea604c(_0x331d78);});});}function getAllowedResources(_0x27d396,_0x2bb1ad,_0x563b1b){return new BPromise(function(_0x3fdb35,_0x264128){if(_0x2bb1ad){return db['UserProfileResource'][_0x3880('0x41')]({'where':{'sectionId':_0x2bb1ad['id']},'raw':!![]})['then'](function(_0x5c8814){if(_0x27d396[_0x3880('0x3c')]&&_0x27d396[_0x3880('0x3c')]!=='id'){_0x2bb1ad['associatedResources']=_[_0x3880('0x38')](_0x5c8814,function(_0x484af0){return _0x484af0[_0x27d396[_0x3880('0x3c')]];});}else{if(_0x563b1b===_0x3880('0x6f')){_0x2bb1ad[_0x3880('0x71')]=_[_0x3880('0x38')](_0x5c8814,function(_0xcaf7e3){return{'id':_0xcaf7e3[_0x3880('0x7c')],'type':_0xcaf7e3['type']};});}else{_0x2bb1ad[_0x3880('0x71')]=_[_0x3880('0x38')](_0x5c8814,function(_0x3501c9){return _0x3501c9[_0x3880('0x7c')];});}}_0x3fdb35(_0x2bb1ad);})[_0x3880('0x43')](function(_0x18fffa){_0x264128(_0x18fffa);});}else{_0x3fdb35(null);}});}function getQueryModels(_0x627b20,_0x4a0c73){var _0x50cb63=_0x627b20[_0x3880('0x7d')]();var _0x147f7a={'childModel':undefined,'parentSections':[]};switch(_0x50cb63){case _0x3880('0x7e'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x7f');break;case _0x3880('0x80'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x81');break;case'squarerecordings':_0x147f7a[_0x3880('0x65')]=_0x3880('0x82');_0x147f7a['parentSections']=[{'name':_0x3880('0x83'),'field':'name','foreignKey':_0x3880('0x84')}];break;case'projects':_0x147f7a[_0x3880('0x65')]='JscriptyProject';break;case _0x3880('0x85'):_0x147f7a[_0x3880('0x65')]='CmContact';_0x147f7a[_0x3880('0x68')]=[{'name':_0x3880('0x86'),'field':'id','foreignKey':_0x3880('0x87')}];break;case _0x3880('0x88'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x89');break;case _0x3880('0x8a'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x8b');break;case _0x3880('0x8c'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x8d');break;case _0x3880('0x8e'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x8f');break;case _0x3880('0x90'):_0x147f7a['childModel']=_0x3880('0x91');break;case _0x3880('0x92'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x93');break;case _0x3880('0x94'):_0x147f7a['childModel']=_0x3880('0x95');break;case _0x3880('0x96'):case _0x3880('0x97'):case _0x3880('0x98'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x99');break;case'contexts':_0x147f7a['childModel']='VoiceContext';break;case _0x3880('0x9a'):_0x147f7a[_0x3880('0x65')]='VoiceMail';break;case _0x3880('0x9b'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x9c');_0x147f7a[_0x3880('0x68')]=[{'name':_0x3880('0x9d'),'field':_0x3880('0x25'),'foreignKey':_0x3880('0x9e'),'model':_0x3880('0x9f'),'filter':{'field':_0x3880('0xa0'),'value':[_0x3880('0xa1')]}},{'name':_0x3880('0xa2'),'field':_0x3880('0x25'),'foreignKey':_0x3880('0x9e'),'model':_0x3880('0x9f'),'filter':{'field':_0x3880('0xa0'),'value':[_0x3880('0xa3')]}},{'name':'VoiceQueues','field':_0x3880('0x25'),'foreignKey':'queue','model':_0x3880('0xa4'),'filter':{'field':_0x3880('0x39'),'value':[_0x3880('0xa5')]}},{'name':_0x3880('0xa6'),'field':_0x3880('0x25'),'foreignKey':_0x3880('0xa7'),'model':_0x3880('0xa4'),'filter':{'field':_0x3880('0x39'),'value':[_0x3880('0xa8')]}}];break;case _0x3880('0xa9'):_0x147f7a['childModel']='VoiceMusicOnHold';break;case _0x3880('0xaa'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xab');break;case _0x3880('0xac'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xad');break;case'ivrcampaigns':_0x147f7a[_0x3880('0x65')]=_0x3880('0xae');break;case _0x3880('0xaf'):_0x147f7a['childModel']=_0x3880('0xb0');break;case _0x3880('0xb1'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xb2');break;case _0x3880('0xb3'):_0x147f7a['childModel']=_0x3880('0xb4');break;case _0x3880('0xb5'):_0x147f7a['childModel']=_0x3880('0xb6');break;case _0x3880('0xb7'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xb8');break;case _0x3880('0xb9'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xba');break;case _0x3880('0xbb'):_0x147f7a[_0x3880('0x65')]='SmsAccount';break;case _0x3880('0xbc'):_0x147f7a[_0x3880('0x65')]='Team';break;case _0x3880('0xbd'):case _0x3880('0xbe'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xa4');if(_0x4a0c73){_0x147f7a['parentSections']=[{'name':_0x3880('0xbf')},{'name':_0x3880('0xa6')}];}break;case'users':case'agents':case _0x3880('0xc0'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x9f');if(_0x4a0c73){_0x147f7a[_0x3880('0x68')]=[{'name':_0x3880('0xc1'),'filter':{'field':_0x3880('0xa0'),'value':[_0x3880('0xc2'),_0x3880('0xc3')]},'ignore':!![]},{'name':_0x3880('0x9d')},{'name':_0x3880('0xa2')}];}break;case _0x3880('0xc4'):_0x147f7a['childModel']=_0x3880('0xc5');break;case _0x3880('0xc6'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xc7');break;case _0x3880('0xc8'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xc9');break;case _0x3880('0xca'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xcb');break;case _0x3880('0xcc'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xcd');break;case _0x3880('0xce'):_0x147f7a['childModel']='ZohoAccount';break;case _0x3880('0xcf'):_0x147f7a[_0x3880('0x65')]='User';break;case _0x3880('0xd0'):_0x147f7a['childModel']=_0x3880('0xd1');break;case _0x3880('0xd2'):_0x147f7a['childModel']=_0x3880('0xd3');break;case _0x3880('0xd4'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xd5');break;case _0x3880('0xd6'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xd7');break;case'pauses':_0x147f7a[_0x3880('0x65')]=_0x3880('0xd8');break;case _0x3880('0xd9'):_0x147f7a['childModel']=_0x3880('0xda');break;case _0x3880('0xdb'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xdc');break;case _0x3880('0xdd'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x7a');break;case _0x3880('0xde'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xdf');break;case _0x3880('0xe0'):_0x147f7a[_0x3880('0x65')]='Trigger';break;case'trunks':_0x147f7a[_0x3880('0x65')]=_0x3880('0xe1');break;case _0x3880('0xe2'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xe3');break;case'plugins':_0x147f7a[_0x3880('0x65')]='Plugin';break;case _0x3880('0xe4'):_0x147f7a[_0x3880('0x65')]='AnalyticExtractedReport';_0x147f7a['parentSections']=[{'name':_0x3880('0xe5'),'field':'id','foreignKey':_0x3880('0x75')}];break;case'metrics':_0x147f7a['childModel']=_0x3880('0xe6');break;default:return _0x147f7a;}return _0x147f7a;}
\ No newline at end of file
+var _0xb91b=['where','merge','map','type','key','VIRTUAL','field','options','findAll','rows','catch','params','rawAttributes','length','create','body','clone','includeAll','include','find','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','Resources','describe','addSections','sectionId','userProfileId','each','push','removeSections','ids','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','all','union','ignore','AnalyticExtractedReport','associatedResources','foreignKey','forEach','reportType','reportId','custom','CustomReports','CmContact','Tag','Tags','color','ThroughTags','tag','value','resourceId','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareProjects','projectName','JscriptyProject','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxAccount','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','teams','Team','voicequeues','queuecampaigns','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','Sound','tags','templates','Template','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','metrics','AnalyticMetric','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','UserProfile','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0xb91b,0x191));var _0xbb91=function(_0x94e9ed,_0x4243e5){_0x94e9ed=_0x94e9ed-0x0;var _0x5d3ded=_0xb91b[_0x94e9ed];return _0x5d3ded;};'use strict';var pdf=require(_0xbb91('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb91('0x1'));var zipdir=require(_0xbb91('0x2'));var jsonpatch=require(_0xbb91('0x3'));var rp=require(_0xbb91('0x4'));var moment=require(_0xbb91('0x5'));var BPromise=require(_0xbb91('0x6'));var Mustache=require(_0xbb91('0x7'));var util=require('util');var path=require(_0xbb91('0x8'));var sox=require(_0xbb91('0x9'));var csv=require('to-csv');var ejs=require(_0xbb91('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbb91('0xb'));var jsforce=require(_0xbb91('0xc'));var deskjs=require(_0xbb91('0xd'));var toCsv=require(_0xbb91('0xe'));var querystring=require(_0xbb91('0xf'));var Papa=require(_0xbb91('0x10'));var Redis=require(_0xbb91('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbb91('0x12'));var hardwareService=require(_0xbb91('0x13'));var logger=require(_0xbb91('0x14'))(_0xbb91('0x15'));var utils=require(_0xbb91('0x16'));var config=require(_0xbb91('0x17'));var db=require(_0xbb91('0x18'))['db'];config['redis']=_['defaults'](config[_0xbb91('0x19')],{'host':_0xbb91('0x1a'),'port':0x18eb});var socket=require(_0xbb91('0x1b'))(new Redis(config[_0xbb91('0x19')]));require(_0xbb91('0x1c'))[_0xbb91('0x1d')](socket);function respondWithStatusCode(_0x2e4e16,_0x502313){_0x502313=_0x502313||0xcc;return function(_0x29e39d){if(_0x29e39d){return _0x2e4e16[_0xbb91('0x1e')](_0x502313);}return _0x2e4e16['status'](_0x502313)['end']();};}function respondWithResult(_0x11e14f,_0x2d3e98){_0x2d3e98=_0x2d3e98||0xc8;return function(_0xb75d36){if(_0xb75d36){return _0x11e14f[_0xbb91('0x1f')](_0x2d3e98)[_0xbb91('0x20')](_0xb75d36);}};}function respondWithFilteredResult(_0x5baa5b,_0x3a46ad){return function(_0x56d5a5){if(_0x56d5a5){var _0x1f56c3=_0x56d5a5[_0xbb91('0x21')],_0x4fada3=_0x3a46ad[_0xbb91('0x22')],_0x1de745=_0x3a46ad[_0xbb91('0x22')]+_0x3a46ad[_0xbb91('0x23')],_0x30dbf2;if(_0x1de745>=_0x1f56c3){_0x1de745=_0x1f56c3;_0x30dbf2=0xc8;}else{_0x30dbf2=0xce;}_0x5baa5b[_0xbb91('0x1f')](_0x30dbf2);return _0x5baa5b[_0xbb91('0x24')](_0xbb91('0x25'),_0x4fada3+'-'+_0x1de745+'/'+_0x1f56c3)[_0xbb91('0x20')](_0x56d5a5);}return null;};}function patchUpdates(_0x32b7d3){return function(_0x4f9b12){try{jsonpatch['apply'](_0x4f9b12,_0x32b7d3,!![]);}catch(_0x16a21b){return BPromise[_0xbb91('0x26')](_0x16a21b);}return _0x4f9b12[_0xbb91('0x27')]();};}function saveUpdates(_0x3d08fc,_0x2277a1){return function(_0x5a12a0){if(_0x5a12a0){return _0x5a12a0[_0xbb91('0x28')](_0x3d08fc)[_0xbb91('0x29')](function(_0x2e8038){return _0x2e8038;});}return null;};}function removeEntity(_0x12a657,_0x3bae18){return function(_0x3165be){if(_0x3165be){return _0x3165be[_0xbb91('0x2a')]()[_0xbb91('0x29')](function(){_0x12a657[_0xbb91('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x85ecf,_0x4e8b7f){return function(_0x5d5a46){if(!_0x5d5a46){_0x85ecf[_0xbb91('0x1e')](0x194);}return _0x5d5a46;};}function handleError(_0x22b673,_0x24b102){_0x24b102=_0x24b102||0x1f4;return function(_0x5a9095){logger[_0xbb91('0x2b')](_0x5a9095['stack']);if(_0x5a9095[_0xbb91('0x2c')]){delete _0x5a9095[_0xbb91('0x2c')];}_0x22b673['status'](_0x24b102)[_0xbb91('0x2d')](_0x5a9095);};}exports[_0xbb91('0x2e')]=function(_0x3cb8fd,_0x35e42c){var _0x1d99a2={},_0x496c8d={},_0x648cc3={'count':0x0,'rows':[]};var _0x36ac81=db[_0xbb91('0x2f')]['rawAttributes'];_0x496c8d['model']=_['keys'](_0x36ac81);_0x496c8d[_0xbb91('0x30')]=_[_0xbb91('0x31')](_0x3cb8fd['query']);_0x496c8d[_0xbb91('0x32')]=_[_0xbb91('0x33')](_0x496c8d[_0xbb91('0x34')],_0x496c8d[_0xbb91('0x30')]);_0x1d99a2[_0xbb91('0x35')]=_['intersection'](_0x496c8d[_0xbb91('0x34')],qs[_0xbb91('0x36')](_0x3cb8fd['query']['fields']));_0x1d99a2['attributes']=_0x1d99a2[_0xbb91('0x35')]['length']?_0x1d99a2[_0xbb91('0x35')]:_0x496c8d[_0xbb91('0x34')];if(!_0x3cb8fd[_0xbb91('0x30')][_0xbb91('0x37')](_0xbb91('0x38'))){_0x1d99a2['limit']=qs['limit'](_0x3cb8fd['query'][_0xbb91('0x23')]);_0x1d99a2['offset']=qs[_0xbb91('0x22')](_0x3cb8fd[_0xbb91('0x30')]['offset']);}_0x1d99a2[_0xbb91('0x39')]=qs['sort'](_0x3cb8fd[_0xbb91('0x30')][_0xbb91('0x3a')]);_0x1d99a2['where']=qs[_0xbb91('0x32')](_[_0xbb91('0x3b')](_0x3cb8fd[_0xbb91('0x30')],_0x496c8d[_0xbb91('0x32')]));if(_0x3cb8fd[_0xbb91('0x30')][_0xbb91('0x3c')]){_0x1d99a2[_0xbb91('0x3d')]=_[_0xbb91('0x3e')](_0x1d99a2['where'],{'$or':_[_0xbb91('0x3f')](_0x36ac81,function(_0x1ea922){if(_0x1ea922[_0xbb91('0x40')][_0xbb91('0x41')]!==_0xbb91('0x42')){var _0x212e16={};_0x212e16[_0x1ea922[_0xbb91('0x43')]]={'$like':'%'+_0x3cb8fd['query']['filter']+'%'};return _0x212e16;}})});}_0x1d99a2=_[_0xbb91('0x3e')]({},_0x1d99a2,_0x3cb8fd[_0xbb91('0x44')]);var _0x42d4c8={'where':_0x1d99a2[_0xbb91('0x3d')]};return db[_0xbb91('0x2f')][_0xbb91('0x21')](_0x42d4c8)[_0xbb91('0x29')](function(_0x3883a1){_0x648cc3[_0xbb91('0x21')]=_0x3883a1;if(_0x3cb8fd[_0xbb91('0x30')]['includeAll']){_0x1d99a2['include']=[{'all':!![]}];}return db[_0xbb91('0x2f')][_0xbb91('0x45')](_0x1d99a2);})[_0xbb91('0x29')](function(_0x3dd0a1){_0x648cc3[_0xbb91('0x46')]=_0x3dd0a1;return _0x648cc3;})[_0xbb91('0x29')](respondWithFilteredResult(_0x35e42c,_0x1d99a2))[_0xbb91('0x47')](handleError(_0x35e42c,null));};exports['show']=function(_0x5b79e6,_0x2cf0dd){var _0x567cc6={'raw':![],'where':{'id':_0x5b79e6[_0xbb91('0x48')]['id']}},_0x504d64={};_0x504d64['model']=_[_0xbb91('0x31')](db[_0xbb91('0x2f')][_0xbb91('0x49')]);_0x504d64[_0xbb91('0x30')]=_[_0xbb91('0x31')](_0x5b79e6[_0xbb91('0x30')]);_0x504d64['filters']=_[_0xbb91('0x33')](_0x504d64['model'],_0x504d64['query']);_0x567cc6['attributes']=_[_0xbb91('0x33')](_0x504d64[_0xbb91('0x34')],qs['fields'](_0x5b79e6[_0xbb91('0x30')][_0xbb91('0x36')]));_0x567cc6[_0xbb91('0x35')]=_0x567cc6[_0xbb91('0x35')][_0xbb91('0x4a')]?_0x567cc6[_0xbb91('0x35')]:_0x504d64['model'];if(_0x5b79e6[_0xbb91('0x30')]['includeAll']){_0x567cc6['include']=[{'all':!![]}];}_0x567cc6=_[_0xbb91('0x3e')]({},_0x567cc6,_0x5b79e6[_0xbb91('0x44')]);return db['UserProfile']['find'](_0x567cc6)[_0xbb91('0x29')](handleEntityNotFound(_0x2cf0dd,null))[_0xbb91('0x29')](respondWithResult(_0x2cf0dd,null))[_0xbb91('0x47')](handleError(_0x2cf0dd,null));};exports[_0xbb91('0x4b')]=function(_0x5b664f,_0x533800){return db[_0xbb91('0x2f')]['create'](_0x5b664f[_0xbb91('0x4c')],{})[_0xbb91('0x29')](respondWithResult(_0x533800,0xc9))[_0xbb91('0x47')](handleError(_0x533800,null));};exports[_0xbb91('0x4d')]=function(_0x64e82c,_0x3e3699){var _0x5c3c46={'raw':![],'where':{'id':_0x64e82c[_0xbb91('0x48')]['id']}},_0x34bb1f={};_0x34bb1f[_0xbb91('0x34')]=_['keys'](db[_0xbb91('0x2f')][_0xbb91('0x49')]);_0x5c3c46['attributes']=_[_0xbb91('0x33')](_0x34bb1f[_0xbb91('0x34')],qs[_0xbb91('0x36')](_0x64e82c[_0xbb91('0x30')][_0xbb91('0x36')]));_0x5c3c46[_0xbb91('0x35')]=_0x5c3c46[_0xbb91('0x35')][_0xbb91('0x4a')]?_0x5c3c46[_0xbb91('0x35')]:_0x34bb1f[_0xbb91('0x34')];if(_0x64e82c[_0xbb91('0x30')][_0xbb91('0x4e')]){_0x5c3c46[_0xbb91('0x4f')]=[{'all':!![]}];}_0x5c3c46=_['merge']({},_0x5c3c46,_0x64e82c[_0xbb91('0x44')]);return db['UserProfile'][_0xbb91('0x50')](_0x5c3c46)[_0xbb91('0x29')](handleEntityNotFound(_0x3e3699,null))[_0xbb91('0x29')](function(_0x50d7ff){if(_0x50d7ff){var _0x1fc7c3=_0x50d7ff[_0xbb91('0x51')]({'plain':!![]});_0x1fc7c3=qs[_0xbb91('0x52')](_0x1fc7c3,['id','createdAt',_0xbb91('0x53'),_0xbb91('0x54')]);_0x64e82c[_0xbb91('0x4c')]=_[_0xbb91('0x52')](_0x64e82c['body'],['id',_0xbb91('0x55'),'updatedAt']);return db[_0xbb91('0x56')][_0xbb91('0x57')](function(_0x38a564){return db[_0xbb91('0x2f')][_0xbb91('0x4b')](_[_0xbb91('0x3e')](_0x1fc7c3,_0x64e82c[_0xbb91('0x4c')]),{'include':_0x64e82c[_0xbb91('0x30')][_0xbb91('0x4e')]?[{'all':!![]}]:undefined,'transaction':_0x38a564})[_0xbb91('0x29')](function(_0x1b3606){var _0x131fd8=_0x1b3606[_0xbb91('0x51')]({'plain':!![]});return db[_0xbb91('0x58')][_0xbb91('0x45')]({'where':{'userProfileId':_0x64e82c[_0xbb91('0x48')]['id']},'raw':!![]})[_0xbb91('0x29')](function(_0x86d412){if(_0x86d412){return BPromise['each'](_0x86d412,function(_0x2074bc){return new BPromise(function(_0x2ee966,_0x18995e){if(_0x2074bc[_0xbb91('0x59')]===null||_0x2074bc[_0xbb91('0x59')]===0x1)_0x2ee966(null);return db[_0xbb91('0x5a')]['findAll']({'where':{'sectionId':_0x2074bc['id']},'raw':!![]})['then'](function(_0x125856){var _0x182800=_[_0xbb91('0x3f')](_0x125856,function(_0x1f5d35){return qs['omit'](_0x1f5d35,['id',_0xbb91('0x55'),_0xbb91('0x53'),'sectionId']);});_0x2ee966(_0x182800);})[_0xbb91('0x47')](function(_0x215ecb){_0x18995e(_0x215ecb);});})[_0xbb91('0x29')](function(_0x5f44cc){var _0x3bf88d=qs[_0xbb91('0x52')](_0x2074bc,['id',_0xbb91('0x55'),_0xbb91('0x53')]);_0x3bf88d['userProfileId']=_0x131fd8['id'];if(_0x5f44cc)_0x3bf88d[_0xbb91('0x5b')]=_0x5f44cc;return _0x3bf88d;})[_0xbb91('0x29')](function(_0x4ca032){return db[_0xbb91('0x58')][_0xbb91('0x4b')](_0x4ca032,{'include':[{'model':db['UserProfileResource'],'as':_0xbb91('0x5b')}],'raw':!![],'transaction':_0x38a564});});})['then'](function(){return _0x131fd8;});}});});});}})[_0xbb91('0x29')](respondWithResult(_0x3e3699,0xc9))[_0xbb91('0x47')](handleError(_0x3e3699,null));};exports[_0xbb91('0x28')]=function(_0x48edd2,_0x39f920){if(_0x48edd2[_0xbb91('0x4c')]['id']){delete _0x48edd2[_0xbb91('0x4c')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x48edd2[_0xbb91('0x48')]['id']}})[_0xbb91('0x29')](handleEntityNotFound(_0x39f920,null))[_0xbb91('0x29')](saveUpdates(_0x48edd2[_0xbb91('0x4c')],null))[_0xbb91('0x29')](respondWithResult(_0x39f920,null))[_0xbb91('0x47')](handleError(_0x39f920,null));};exports[_0xbb91('0x2a')]=function(_0x157dcb,_0x21474e){return db[_0xbb91('0x2f')]['find']({'where':{'id':_0x157dcb['params']['id']}})[_0xbb91('0x29')](handleEntityNotFound(_0x21474e,null))[_0xbb91('0x29')](removeEntity(_0x21474e,null))[_0xbb91('0x47')](handleError(_0x21474e,null));};exports[_0xbb91('0x5c')]=function(_0x43ef45,_0x35f94e){return db[_0xbb91('0x2f')][_0xbb91('0x5c')]()['then'](respondWithResult(_0x35f94e,null))[_0xbb91('0x47')](handleError(_0x35f94e,null));};exports[_0xbb91('0x5d')]=function(_0x56b445,_0x5eb895){var _0x2deeb7=_0x56b445[_0xbb91('0x4c')];return db[_0xbb91('0x2f')]['find']({'where':{'id':_0x56b445[_0xbb91('0x48')]['id']}})['then'](handleEntityNotFound(_0x5eb895,null))[_0xbb91('0x29')](function(_0x15d403){if(_0x15d403){return db[_0xbb91('0x56')][_0xbb91('0x57')](function(_0x255661){return db['UserProfileSection'][_0xbb91('0x2a')]({'where':{'userProfileId':_0x56b445[_0xbb91('0x48')]['id'],'sectionId':_[_0xbb91('0x3f')](_0x2deeb7,function(_0x453585){return _0x453585[_0xbb91('0x5e')];})},'transaction':_0x255661})['then'](function(){var _0x4815f6=_[_0xbb91('0x3f')](_0x2deeb7,function(_0x48e50f){_0x48e50f[_0xbb91('0x5f')]=_0x56b445['params']['id'];return _0x48e50f;});var _0x4f316c=[];return BPromise[_0xbb91('0x60')](_0x4815f6,function(_0xccef80){return db[_0xbb91('0x58')][_0xbb91('0x4b')](_0xccef80,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x255661})[_0xbb91('0x29')](function(_0x5eb55e){_0x4f316c[_0xbb91('0x61')](_0x5eb55e[_0xbb91('0x51')]({'plain':!![]}));});})['then'](function(){return _0x4f316c;});});});}})[_0xbb91('0x29')](function(_0x2d305d){return _0x2d305d;})[_0xbb91('0x29')](respondWithResult(_0x5eb895,null))[_0xbb91('0x47')](handleError(_0x5eb895,null));};exports[_0xbb91('0x62')]=function(_0x47330d,_0x57bac7){var _0x12b96b;return db[_0xbb91('0x2f')][_0xbb91('0x50')]({'where':{'id':_0x47330d[_0xbb91('0x48')]['id']},'attributes':['id',_0xbb91('0x2c')]})['then'](handleEntityNotFound(_0x57bac7,null))['then'](function(_0x3a00b0){if(_0x3a00b0){_0x12b96b=_0x3a00b0;return db[_0xbb91('0x58')]['destroy']({'where':{'userProfileId':_0x47330d[_0xbb91('0x48')]['id'],'sectionId':_0x47330d[_0xbb91('0x30')][_0xbb91('0x63')]}});}})[_0xbb91('0x29')](function(){return _0x12b96b;})[_0xbb91('0x29')](respondWithStatusCode(_0x57bac7,null))['catch'](handleError(_0x57bac7,null));};exports['addResources']=function(_0x30f103,_0x3c8d6b){return db[_0xbb91('0x2f')][_0xbb91('0x50')]({'where':{'id':_0x30f103['params']['id']}})[_0xbb91('0x29')](handleEntityNotFound(_0x3c8d6b,null))['then'](function(_0x1561ae){if(_0x1561ae){return db[_0xbb91('0x56')][_0xbb91('0x57')](function(_0x56869e){return db[_0xbb91('0x58')]['findAll']({'where':{'userProfileId':_0x30f103[_0xbb91('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0xbb91('0x29')](function(_0x2ec5a3){if(_0x2ec5a3){return db['UserProfileSection'][_0xbb91('0x2a')]({'where':{'userProfileId':_0x30f103[_0xbb91('0x48')]['id'],'id':_[_0xbb91('0x3f')](_0x2ec5a3,function(_0x3001b4){return _0x3001b4['id'];})},'transaction':_0x56869e});}})[_0xbb91('0x29')](function(_0x41bcc7){var _0x20eb62=_['map'](_0x30f103['body'],function(_0x25411e){_0x25411e[_0xbb91('0x5f')]=_0x30f103['params']['id'];return _0x25411e;});return db[_0xbb91('0x58')][_0xbb91('0x64')](_0x20eb62,{'raw':!![],'transaction':_0x56869e});})[_0xbb91('0x29')](function(_0x1854f2){var _0x2eabcc=_[_0xbb91('0x3c')](_[_0xbb91('0x3f')](_0x1854f2,function(_0x5ef81f){return _0x5ef81f[_0xbb91('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x2eabcc){return db[_0xbb91('0x58')][_0xbb91('0x45')]({'where':{'userProfileId':_0x30f103[_0xbb91('0x48')]['id'],'sectionId':_['map'](_0x2eabcc,function(_0x234b3b){return _0x234b3b[_0xbb91('0x5e')];})},'attributes':['id',_0xbb91('0x5e')],'raw':!![]})['then'](function(_0x56b2c1){var _0x43d0b9=_[_0xbb91('0x3f')](_0x30f103[_0xbb91('0x4c')],function(_0x3076f5){_0x3076f5['userProfileId']=_0x30f103[_0xbb91('0x48')]['id'];return _0x3076f5;});return db[_0xbb91('0x5a')]['bulkCreate'](_0x43d0b9,{'raw':!![],'transaction':_0x56869e});});}})['catch'](handleError(_0x3c8d6b,null));});}})[_0xbb91('0x29')](function(_0x3a5c52){var _0x3c5ee0=_[_0xbb91('0x3f')](_0x3a5c52,function(_0x53a6e4){return _0x53a6e4[_0xbb91('0x51')]({'plain':!![]});});})[_0xbb91('0x29')](respondWithResult(_0x3c8d6b,null))[_0xbb91('0x47')](handleError(_0x3c8d6b,null));};exports[_0xbb91('0x65')]=function(_0x4f5c02,_0x50f7ba,_0x3d167c){return db[_0xbb91('0x2f')]['find']({'where':{'id':_0x4f5c02[_0xbb91('0x48')]['id']}})['then'](handleEntityNotFound(_0x50f7ba,null))[_0xbb91('0x29')](function(_0x18c373){if(_0x18c373){return _0x18c373[_0xbb91('0x65')](_0x4f5c02[_0xbb91('0x30')][_0xbb91('0x63')]);}})[_0xbb91('0x29')](respondWithStatusCode(_0x50f7ba,null))[_0xbb91('0x47')](handleError(_0x50f7ba,null));};exports[_0xbb91('0x66')]=function(_0x368eb8,_0x1fba87){var _0xa80b45={'raw':![],'where':{}};var _0x293bed={};var _0xde5a30={'count':0x0,'rows':[]};var _0x31651a=_0x368eb8['query'][_0xbb91('0x67')];if(typeof _0x31651a===_0xbb91('0x68')){throw new db[(_0xbb91('0x69'))][(_0xbb91('0x6a'))](_0xbb91('0x6b'));}var _0x50e44f=_0x368eb8[_0xbb91('0x30')]['mergeResources']||![];var _0x43bb2f=getQueryModels(_0x31651a,_0x50e44f);if(typeof _0x43bb2f[_0xbb91('0x6c')]===_0xbb91('0x68')){throw new db[(_0xbb91('0x69'))][(_0xbb91('0x6a'))](_0xbb91('0x6d')+_0x31651a+'\x27');}var _0x171f2d=[];if(!_[_0xbb91('0x6e')](_0x43bb2f[_0xbb91('0x6f')])){_0x171f2d=_0x43bb2f['parentSections'];}else{_0x171f2d=[{'name':_0x31651a}];}return db[_0xbb91('0x2f')][_0xbb91('0x70')]({'where':{'id':_0x368eb8['params']['id']}})[_0xbb91('0x29')](handleEntityNotFound(_0x1fba87,null))[_0xbb91('0x29')](function(_0x437154){if(_0x437154){var _0x2014f1=[];for(var _0x5ef08e=0x0;_0x5ef08e<_0x171f2d['length'];_0x5ef08e++){_0x2014f1[_0xbb91('0x61')](db['UserProfileSection'][_0xbb91('0x70')]({'where':{'userProfileId':_0x437154['id'],'name':_0x171f2d[_0x5ef08e]['name']},'raw':!![]}));}return BPromise[_0xbb91('0x71')](_0x2014f1);}})[_0xbb91('0x29')](function(_0x54c262){var _0x38fd53=_[_0xbb91('0x3c')](_0x54c262,function(_0x4731c7){return _0x4731c7?_0x4731c7:undefined;});var _0x5f32e4=_[_0xbb91('0x3c')](_0x171f2d,['ignore',!![]]);var _0x2b9838=_[_0xbb91('0x6e')](_0x38fd53)&&_[_0xbb91('0x6e')](_0x5f32e4)?null:_[_0xbb91('0x72')](_0x5f32e4,_0x38fd53);if(_0x2b9838){var _0x44aef6=[];for(var _0x269b16=0x0;_0x269b16<_0x2b9838[_0xbb91('0x4a')];_0x269b16++){var _0xc124ca=_[_0xbb91('0x50')](_0x171f2d,function(_0x1c4c9a){return _0x2b9838[_0x269b16]?_0x1c4c9a[_0xbb91('0x2c')]===_0x2b9838[_0x269b16][_0xbb91('0x2c')]:null;});if(_0xc124ca){if(_0x2b9838[_0x269b16][_0xbb91('0x73')]){_0x44aef6[_0xbb91('0x61')](getAllResources(_0x43bb2f[_0xbb91('0x6c')],_0x2b9838[_0x269b16]));}else{if(!_0x2b9838[_0x269b16][_0xbb91('0x59')]){_0x44aef6[_0xbb91('0x61')](getAllowedResources(_0xc124ca,_0x2b9838[_0x269b16],_0x43bb2f[_0xbb91('0x6c')]));}else{if(_0xc124ca[_0xbb91('0x34')]){_0x44aef6[_0xbb91('0x61')](getAllFilteredResources(_0xc124ca,_0x2b9838[_0x269b16]));}}}}}return BPromise[_0xbb91('0x71')](_0x44aef6);}else{return null;}})[_0xbb91('0x29')](function(_0x519418){var _0x59e21e=_0x519418;var _0x111d8d=null;if(_0x59e21e){_0x111d8d=_0x59e21e['length']===0x1?_0x59e21e[0x0]:null;}if(_0x111d8d||_0x59e21e){var _0x2568ac=db[_0x43bb2f[_0xbb91('0x6c')]]['rawAttributes'];_0x293bed['model']=_[_0xbb91('0x31')](_0x2568ac);_0x293bed['query']=_[_0xbb91('0x31')](_0x368eb8[_0xbb91('0x30')]);_0x293bed[_0xbb91('0x32')]=_['intersection'](_0x293bed[_0xbb91('0x34')],_0x293bed[_0xbb91('0x30')]);_0xa80b45['attributes']=_[_0xbb91('0x33')](_0x293bed[_0xbb91('0x34')],qs[_0xbb91('0x36')](_0x368eb8[_0xbb91('0x30')][_0xbb91('0x36')]));_0xa80b45[_0xbb91('0x35')]=_0xa80b45[_0xbb91('0x35')]['length']?_0xa80b45[_0xbb91('0x35')]:_0x293bed[_0xbb91('0x34')];if(!_0x368eb8[_0xbb91('0x30')]['hasOwnProperty'](_0xbb91('0x38'))){_0xa80b45[_0xbb91('0x23')]=qs[_0xbb91('0x23')](_0x368eb8[_0xbb91('0x30')][_0xbb91('0x23')]);_0xa80b45[_0xbb91('0x22')]=qs[_0xbb91('0x22')](_0x368eb8[_0xbb91('0x30')][_0xbb91('0x22')]);}_0xa80b45['order']=qs[_0xbb91('0x3a')](_0x368eb8['query'][_0xbb91('0x3a')]);_0xa80b45[_0xbb91('0x3d')]=qs['filters'](_['pick'](_0x368eb8[_0xbb91('0x30')],_0x293bed[_0xbb91('0x32')]));if(_0x368eb8[_0xbb91('0x30')][_0xbb91('0x3c')]){_0xa80b45[_0xbb91('0x3d')]=_['merge'](_0xa80b45[_0xbb91('0x3d')],{'$or':_['map'](_0x2568ac,function(_0x7a1197){if(_0x7a1197['type']['key']!=='VIRTUAL'){var _0x5edb94={};_0x5edb94[_0x7a1197[_0xbb91('0x43')]]={'$like':'%'+_0x368eb8[_0xbb91('0x30')]['filter']+'%'};return _0x5edb94;}})});}var _0x4ff324=[];if(_0x111d8d){var _0x3dad0a=_['find'](_0x171f2d,[_0xbb91('0x2c'),_0x111d8d[_0xbb91('0x2c')]]);if(_0x3dad0a[_0xbb91('0x43')]){var _0x597612={};if(_0x43bb2f['childModel']===_0xbb91('0x74')){_0x597612[_0x3dad0a['foreignKey']]=_['map'](_0x111d8d[_0xbb91('0x75')],'id');}else{_0x597612[_0x3dad0a['foreignKey']]=_0x111d8d[_0xbb91('0x75')];}_0x4ff324[_0xbb91('0x61')](_0x597612);}else{_0xa80b45['where']['id']=_0x111d8d[_0xbb91('0x75')];}}else{for(var _0x3aba17=0x0;_0x3aba17<_0x59e21e[_0xbb91('0x4a')];_0x3aba17++){var _0x3dad0a=_[_0xbb91('0x50')](_0x171f2d,['name',_0x59e21e[_0x3aba17][_0xbb91('0x2c')]]);if(_0x3dad0a['field']){var _0x597612={};_0x597612[_0x3dad0a[_0xbb91('0x76')]]=_0x59e21e[_0x3aba17]['associatedResources'];_0x4ff324[_0xbb91('0x61')](_0x597612);}else{if(!_0xa80b45[_0xbb91('0x3d')]['id'])_0xa80b45[_0xbb91('0x3d')]['id']=[];_0x59e21e[_0x3aba17][_0xbb91('0x75')]['forEach'](function(_0x434b2e){_0xa80b45['where']['id'][_0xbb91('0x61')](_0x434b2e);});}}}if(!_[_0xbb91('0x6e')](_0x4ff324)){_0xa80b45['where']=_['merge'](_0xa80b45['where'],{'$and':{'$or':_0x4ff324}});}_0xa80b45=_[_0xbb91('0x3e')]({},_0xa80b45,_0x368eb8[_0xbb91('0x44')]);if(_0x111d8d&&!_0x111d8d[_0xbb91('0x59')]&&_0x43bb2f['childModel']===_0xbb91('0x74')){if(_0x368eb8[_0xbb91('0x30')][_0xbb91('0x4e')]){_0xa80b45[_0xbb91('0x4f')]=[{'all':!![]}];}return db[_0x43bb2f[_0xbb91('0x6c')]]['findAll'](_0xa80b45)[_0xbb91('0x29')](function(_0x54dad5){var _0x11db3e=[];_0x54dad5[_0xbb91('0x77')](function(_0x3436c0){var _0x5d7957;switch(_0x3436c0[_0xbb91('0x78')]){case'default':_0x5d7957=_['find'](_0x111d8d['associatedResources'],function(_0x109950){return _0x109950['id']===_0x3436c0[_0xbb91('0x79')]&&_0x109950[_0xbb91('0x40')]==='DefaultReports';});break;case _0xbb91('0x7a'):_0x5d7957=_[_0xbb91('0x50')](_0x111d8d[_0xbb91('0x75')],function(_0x152177){return _0x152177['id']===_0x3436c0[_0xbb91('0x79')]&&_0x152177[_0xbb91('0x40')]===_0xbb91('0x7b');});break;}if(_0x5d7957)_0x11db3e['push'](_0x3436c0);});_0xde5a30[_0xbb91('0x21')]=_0x11db3e['length'];_0xde5a30[_0xbb91('0x46')]=_0x11db3e;return _0xde5a30;});}else{return db[_0x43bb2f['childModel']]['count']({'where':_0xa80b45['where']})[_0xbb91('0x29')](function(_0x5a376f){_0xde5a30[_0xbb91('0x21')]=_0x5a376f;if(_0x368eb8[_0xbb91('0x30')][_0xbb91('0x4e')]){if(_0x43bb2f[_0xbb91('0x6c')]===_0xbb91('0x7c')){_0xa80b45[_0xbb91('0x4f')]=[{'model':db[_0xbb91('0x7d')],'as':_0xbb91('0x7e'),'attributes':['id','name',_0xbb91('0x7f')],'required':_0x368eb8[_0xbb91('0x30')]['tag']?!![]:![]},{'model':db[_0xbb91('0x7d')],'as':_0xbb91('0x80'),'attributes':['id',_0xbb91('0x2c'),_0xbb91('0x7f')],'through':_0x368eb8['query'][_0xbb91('0x81')]?{'attributes':[],'where':{'TagId':_0x368eb8[_0xbb91('0x30')]['tag']||undefined}}:{},'required':_0x368eb8[_0xbb91('0x30')]['tag']?!![]:![]}];}else{_0xa80b45['include']=[{'all':!![]}];}}return db[_0x43bb2f[_0xbb91('0x6c')]][_0xbb91('0x45')](_0xa80b45);})[_0xbb91('0x29')](function(_0x3017b8){_0xde5a30[_0xbb91('0x46')]=_0x3017b8;return _0xde5a30;});}}else{return _0xde5a30;}})['then'](respondWithFilteredResult(_0x1fba87,_0xa80b45))[_0xbb91('0x47')](handleError(_0x1fba87,null));};function getAllResources(_0xbd6804,_0x3b99c3){return new BPromise(function(_0x5b4d62,_0xefb17f){if(_0x3b99c3){var _0x10ab5a=_0x3b99c3[_0xbb91('0x3c')]?{[_0x3b99c3[_0xbb91('0x3c')][_0xbb91('0x43')]]:_0x3b99c3[_0xbb91('0x3c')][_0xbb91('0x82')]}:undefined;return db[_0xbd6804][_0xbb91('0x45')]({'where':_0x10ab5a,'raw':!![]})['then'](function(_0x57c83a){_0x3b99c3[_0xbb91('0x75')]=_[_0xbb91('0x3f')](_0x57c83a,'id');_0x5b4d62(_0x3b99c3);})[_0xbb91('0x47')](function(_0x3733ff){_0xefb17f(_0x3733ff);});}else{_0x5b4d62(null);}});}function getAllFilteredResources(_0x47f7e0,_0x464836){return new BPromise(function(_0x11213d,_0x1c9869){var _0x47c757=_0x47f7e0[_0xbb91('0x3c')]?{[_0x47f7e0[_0xbb91('0x3c')][_0xbb91('0x43')]]:_0x47f7e0[_0xbb91('0x3c')][_0xbb91('0x82')]}:undefined;return db[_0x47f7e0['model']][_0xbb91('0x45')]({'where':_0x47c757,'raw':!![]})['then'](function(_0x1a64cc){_0x464836['associatedResources']=_[_0xbb91('0x3f')](_0x1a64cc,function(_0x1fcd7d){return _0x1fcd7d[_0xbb91('0x2c')];});_0x11213d(_0x464836);})[_0xbb91('0x47')](function(_0x48d823){_0x1c9869(_0x48d823);});});}function getAllowedResources(_0x34ab0f,_0x4a672e,_0x42d638){return new BPromise(function(_0x4eeaeb,_0x42a98a){if(_0x4a672e){return db[_0xbb91('0x5a')][_0xbb91('0x45')]({'where':{'sectionId':_0x4a672e['id']},'raw':!![]})['then'](function(_0x1e819a){if(_0x34ab0f['field']&&_0x34ab0f[_0xbb91('0x43')]!=='id'){_0x4a672e[_0xbb91('0x75')]=_[_0xbb91('0x3f')](_0x1e819a,function(_0x16882a){return _0x16882a[_0x34ab0f[_0xbb91('0x43')]];});}else{if(_0x42d638===_0xbb91('0x74')){_0x4a672e[_0xbb91('0x75')]=_[_0xbb91('0x3f')](_0x1e819a,function(_0xe8389c){return{'id':_0xe8389c[_0xbb91('0x83')],'type':_0xe8389c[_0xbb91('0x40')]};});}else{_0x4a672e[_0xbb91('0x75')]=_[_0xbb91('0x3f')](_0x1e819a,function(_0x4b8bb7){return _0x4b8bb7[_0xbb91('0x83')];});}}_0x4eeaeb(_0x4a672e);})[_0xbb91('0x47')](function(_0x3a6dae){_0x42a98a(_0x3a6dae);});}else{_0x4eeaeb(null);}});}function getQueryModels(_0x55c032,_0x496702){var _0x5de991=_0x55c032[_0xbb91('0x84')]();var _0x3b965d={'childModel':undefined,'parentSections':[]};switch(_0x5de991){case _0xbb91('0x85'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0x86');break;case _0xbb91('0x87'):_0x3b965d['childModel']=_0xbb91('0x88');break;case _0xbb91('0x89'):_0x3b965d['childModel']='SquareRecording';_0x3b965d[_0xbb91('0x6f')]=[{'name':_0xbb91('0x8a'),'field':_0xbb91('0x2c'),'foreignKey':_0xbb91('0x8b')}];break;case'projects':_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0x8c');break;case'contacts':_0x3b965d['childModel']=_0xbb91('0x7c');_0x3b965d[_0xbb91('0x6f')]=[{'name':_0xbb91('0x8d'),'field':'id','foreignKey':_0xbb91('0x8e')}];break;case _0xbb91('0x8f'):_0x3b965d['childModel']=_0xbb91('0x90');break;case _0xbb91('0x91'):_0x3b965d['childModel']='CmCompany';break;case _0xbb91('0x92'):_0x3b965d['childModel']=_0xbb91('0x93');break;case _0xbb91('0x94'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0x95');break;case _0xbb91('0x96'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0x97');break;case _0xbb91('0x98'):_0x3b965d[_0xbb91('0x6c')]='FaxQueue';break;case'faxaccounts':_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0x99');break;case'inboundroutes':case _0xbb91('0x9a'):case _0xbb91('0x9b'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0x9c');break;case'contexts':_0x3b965d['childModel']=_0xbb91('0x9d');break;case _0xbb91('0x9e'):_0x3b965d[_0xbb91('0x6c')]='VoiceMail';break;case _0xbb91('0x9f'):_0x3b965d['childModel']=_0xbb91('0xa0');_0x3b965d[_0xbb91('0x6f')]=[{'name':_0xbb91('0xa1'),'field':'name','foreignKey':_0xbb91('0xa2'),'model':_0xbb91('0xa3'),'filter':{'field':_0xbb91('0xa4'),'value':[_0xbb91('0xa5')]}},{'name':_0xbb91('0xa6'),'field':'name','foreignKey':_0xbb91('0xa2'),'model':_0xbb91('0xa3'),'filter':{'field':_0xbb91('0xa4'),'value':[_0xbb91('0xa7')]}},{'name':_0xbb91('0xa8'),'field':_0xbb91('0x2c'),'foreignKey':_0xbb91('0xa9'),'model':_0xbb91('0xaa'),'filter':{'field':_0xbb91('0x40'),'value':[_0xbb91('0xab')]}},{'name':_0xbb91('0xac'),'field':_0xbb91('0x2c'),'foreignKey':_0xbb91('0xa9'),'model':_0xbb91('0xaa'),'filter':{'field':'type','value':['outbound']}}];break;case'musiconholds':_0x3b965d['childModel']=_0xbb91('0xad');break;case'chanspies':_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xae');break;case _0xbb91('0xaf'):_0x3b965d['childModel']=_0xbb91('0xb0');break;case _0xbb91('0xb1'):_0x3b965d[_0xbb91('0x6c')]='Campaign';break;case _0xbb91('0xb2'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xb3');break;case _0xbb91('0xb4'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xb5');break;case _0xbb91('0xb6'):_0x3b965d['childModel']=_0xbb91('0xb7');break;case'openchannelqueues':_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xb8');break;case _0xbb91('0xb9'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xba');break;case _0xbb91('0xbb'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xbc');break;case _0xbb91('0xbd'):_0x3b965d[_0xbb91('0x6c')]='SmsAccount';break;case _0xbb91('0xbe'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xbf');break;case _0xbb91('0xc0'):case _0xbb91('0xc1'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xaa');if(_0x496702){_0x3b965d[_0xbb91('0x6f')]=[{'name':_0xbb91('0xa8')},{'name':_0xbb91('0xac')}];}break;case'users':case'agents':case'telephones':_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xa3');if(_0x496702){_0x3b965d[_0xbb91('0x6f')]=[{'name':'Users','filter':{'field':_0xbb91('0xa4'),'value':[_0xbb91('0xc2'),_0xbb91('0xc3')]},'ignore':!![]},{'name':'Agents'},{'name':_0xbb91('0xa6')}];}break;case _0xbb91('0xc4'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xc5');break;case _0xbb91('0xc6'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xc7');break;case _0xbb91('0xc8'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xc9');break;case _0xbb91('0xca'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xcb');break;case _0xbb91('0xcc'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xcd');break;case'zohoaccounts':_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xce');break;case _0xbb91('0xcf'):_0x3b965d['childModel']=_0xbb91('0xa3');break;case _0xbb91('0xd0'):_0x3b965d['childModel']='CannedAnswer';break;case _0xbb91('0xd1'):_0x3b965d['childModel']=_0xbb91('0xd2');break;case _0xbb91('0xd3'):_0x3b965d['childModel']=_0xbb91('0xd4');break;case _0xbb91('0xd5'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xd6');break;case'pauses':_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xd7');break;case _0xbb91('0xd8'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xd9');break;case'sounds':_0x3b965d['childModel']=_0xbb91('0xda');break;case _0xbb91('0xdb'):_0x3b965d['childModel']=_0xbb91('0x7d');break;case _0xbb91('0xdc'):_0x3b965d['childModel']=_0xbb91('0xdd');break;case _0xbb91('0xde'):_0x3b965d[_0xbb91('0x6c')]='Trigger';break;case _0xbb91('0xdf'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xe0');break;case _0xbb91('0xe1'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xe2');break;case _0xbb91('0xe3'):_0x3b965d['childModel']=_0xbb91('0xe4');break;case'extractedreports':_0x3b965d[_0xbb91('0x6c')]='AnalyticExtractedReport';_0x3b965d[_0xbb91('0x6f')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0xbb91('0xe5'):_0x3b965d[_0xbb91('0x6c')]=_0xbb91('0xe6');break;default:return _0x3b965d;}return _0x3b965d;}
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js
index 3605e65..d5b5517 100644
--- a/server/api/userProfile/userProfile.events.js
+++ b/server/api/userProfile/userProfile.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x553a=['emit','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x4aa4af,_0x210cde){var _0x3bf44a=function(_0x4a8126){while(--_0x4a8126){_0x4aa4af['push'](_0x4aa4af['shift']());}};_0x3bf44a(++_0x210cde);}(_0x553a,0x192));var _0xa553=function(_0x4684af,_0x34880f){_0x4684af=_0x4684af-0x0;var _0x3bb413=_0x553a[_0x4684af];return _0x3bb413;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa553('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa553('0x1')](0x0);var events={'afterCreate':_0xa553('0x2'),'afterUpdate':_0xa553('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d5106){return function(_0x367421,_0x50ecee,_0x4b0e9b){UserProfileEvents[_0xa553('0x4')](_0x4d5106+':'+_0x367421['id'],_0x367421);UserProfileEvents['emit'](_0x4d5106,_0x367421);_0x4b0e9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xa553('0x5')](e,emitEvent(event));}}module[_0xa553('0x6')]=UserProfileEvents;
\ No newline at end of file
+var _0xfdcd=['UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0xa22665,_0x3190e0){var _0x275aed=function(_0x145dbd){while(--_0x145dbd){_0xa22665['push'](_0xa22665['shift']());}};_0x275aed(++_0x3190e0);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfdcd[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xdfdc('0x0'))['db'][_0xdfdc('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xdfdc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdfdc('0x3'),'afterDestroy':_0xdfdc('0x4')};function emitEvent(_0x274740){return function(_0x789311,_0x453c75,_0x349d57){UserProfileEvents[_0xdfdc('0x5')](_0x274740+':'+_0x789311['id'],_0x789311);UserProfileEvents[_0xdfdc('0x5')](_0x274740,_0x789311);_0x349d57(null);};}for(var e in events){if(events[_0xdfdc('0x6')](e)){var event=events[e];UserProfile[_0xdfdc('0x7')](e,emitEvent(event));}}module[_0xdfdc('0x8')]=UserProfileEvents;
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js
index 994974f..e22220d 100644
--- a/server/api/userProfile/userProfile.model.js
+++ b/server/api/userProfile/userProfile.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad07=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfile.attributes','exports','define','UserProfile','user_profiles'];(function(_0x49f626,_0x3667dd){var _0x109c63=function(_0x27e67e){while(--_0x27e67e){_0x49f626['push'](_0x49f626['shift']());}};_0x109c63(++_0x3667dd);}(_0xad07,0xfd));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7ad0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7ad0('0x1'));var BPromise=require(_0x7ad0('0x2'));var rp=require(_0x7ad0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ad0('0x4'));var config=require(_0x7ad0('0x5'));var attributes=require(_0x7ad0('0x6'));module[_0x7ad0('0x7')]=function(_0x869b82,_0x115677){return _0x869b82[_0x7ad0('0x8')](_0x7ad0('0x9'),attributes,{'tableName':_0x7ad0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x97f4=['request-promise','path','rimraf','exports','define','UserProfile','user_profiles','lodash','util','api','moment','bluebird'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x97f4,0xc7));var _0x497f=function(_0x57522a,_0x97b26b){_0x57522a=_0x57522a-0x0;var _0x19c012=_0x97f4[_0x57522a];return _0x19c012;};'use strict';var _=require(_0x497f('0x0'));var util=require(_0x497f('0x1'));var logger=require('../../config/logger')(_0x497f('0x2'));var moment=require(_0x497f('0x3'));var BPromise=require(_0x497f('0x4'));var rp=require(_0x497f('0x5'));var fs=require('fs');var path=require(_0x497f('0x6'));var rimraf=require(_0x497f('0x7'));var config=require('../../config/environment');var attributes=require('./userProfile.attributes');module[_0x497f('0x8')]=function(_0xf136cc,_0x2efc45){return _0xf136cc[_0x497f('0x9')](_0x497f('0xa'),attributes,{'tableName':_0x497f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js
index ca27b7c..cca2103 100644
--- a/server/api/userProfile/userProfile.rpc.js
+++ b/server/api/userProfile/userProfile.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ca1=['rpc','../../config/environment','http','localhost','redis','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x424ebf,_0x4c64d3){var _0x4c6aef=function(_0x3e17eb){while(--_0x3e17eb){_0x424ebf['push'](_0x424ebf['shift']());}};_0x4c6aef(++_0x4c64d3);}(_0x2ca1,0x76));var _0x12ca=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x2ca1[_0x46361e];return _0x14e302;};'use strict';var _=require(_0x12ca('0x0'));var util=require(_0x12ca('0x1'));var moment=require(_0x12ca('0x2'));var BPromise=require(_0x12ca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x12ca('0x5'));var logger=require(_0x12ca('0x6'))(_0x12ca('0x7'));var config=require(_0x12ca('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x12ca('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x12ca('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12ca('0xb')]));require(_0x12ca('0xc'))[_0x12ca('0xd')](socket);function respondWithRpcPromise(_0x5f5226,_0x2496ef,_0x5d582e){return new BPromise(function(_0xcf0973,_0x5b0634){return client[_0x12ca('0xe')](_0x5f5226,_0x5d582e)[_0x12ca('0xf')](function(_0x39c971){logger['info'](_0x12ca('0x10'),_0x2496ef,_0x12ca('0x11'));logger[_0x12ca('0x12')](_0x12ca('0x13'),_0x2496ef,_0x12ca('0x11'),JSON[_0x12ca('0x14')](_0x39c971));if(_0x39c971[_0x12ca('0x15')]){if(_0x39c971[_0x12ca('0x15')][_0x12ca('0x16')]===0x1f4){logger[_0x12ca('0x15')](_0x12ca('0x10'),_0x2496ef,_0x39c971[_0x12ca('0x15')][_0x12ca('0x17')]);return _0x5b0634(_0x39c971['error'][_0x12ca('0x17')]);}logger[_0x12ca('0x15')]('UserProfile,\x20%s,\x20%s',_0x2496ef,_0x39c971[_0x12ca('0x15')][_0x12ca('0x17')]);return _0xcf0973(_0x39c971[_0x12ca('0x15')][_0x12ca('0x17')]);}else{logger['info'](_0x12ca('0x10'),_0x2496ef,'request\x20sent');_0xcf0973(_0x39c971[_0x12ca('0x18')]['message']);}})['catch'](function(_0x4b337b){logger[_0x12ca('0x15')]('UserProfile,\x20%s,\x20%s',_0x2496ef,_0x4b337b);_0x5b0634(_0x4b337b);});});}
\ No newline at end of file
+var _0xb17f=['UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x8d9399,_0x490955){var _0x5a0645=function(_0x404d19){while(--_0x404d19){_0x8d9399['push'](_0x8d9399['shift']());}};_0x5a0645(++_0x490955);}(_0xb17f,0x1df));var _0xfb17=function(_0x303901,_0x576535){_0x303901=_0x303901-0x0;var _0x1e419b=_0xb17f[_0x303901];return _0x1e419b;};'use strict';var _=require(_0xfb17('0x0'));var util=require(_0xfb17('0x1'));var moment=require(_0xfb17('0x2'));var BPromise=require(_0xfb17('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb17('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfb17('0x5'));var jayson=require(_0xfb17('0x6'));var client=jayson['client'][_0xfb17('0x7')]({'port':0x232a});config[_0xfb17('0x8')]=_[_0xfb17('0x9')](config[_0xfb17('0x8')],{'host':_0xfb17('0xa'),'port':0x18eb});var socket=require(_0xfb17('0xb'))(new Redis(config[_0xfb17('0x8')]));require(_0xfb17('0xc'))[_0xfb17('0xd')](socket);function respondWithRpcPromise(_0x4306df,_0x165dc3,_0x2050d7){return new BPromise(function(_0x397ae3,_0x433ed9){return client[_0xfb17('0xe')](_0x4306df,_0x2050d7)[_0xfb17('0xf')](function(_0x14bcec){logger['info']('UserProfile,\x20%s,\x20%s',_0x165dc3,_0xfb17('0x10'));logger[_0xfb17('0x11')](_0xfb17('0x12'),_0x165dc3,'request\x20sent',JSON[_0xfb17('0x13')](_0x14bcec));if(_0x14bcec[_0xfb17('0x14')]){if(_0x14bcec[_0xfb17('0x14')]['code']===0x1f4){logger[_0xfb17('0x14')](_0xfb17('0x15'),_0x165dc3,_0x14bcec[_0xfb17('0x14')][_0xfb17('0x16')]);return _0x433ed9(_0x14bcec[_0xfb17('0x14')][_0xfb17('0x16')]);}logger[_0xfb17('0x14')](_0xfb17('0x15'),_0x165dc3,_0x14bcec[_0xfb17('0x14')]['message']);return _0x397ae3(_0x14bcec[_0xfb17('0x14')][_0xfb17('0x16')]);}else{logger['info'](_0xfb17('0x15'),_0x165dc3,_0xfb17('0x10'));_0x397ae3(_0x14bcec[_0xfb17('0x17')][_0xfb17('0x16')]);}})[_0xfb17('0x18')](function(_0x1388af){logger['error'](_0xfb17('0x15'),_0x165dc3,_0x1388af);_0x433ed9(_0x1388af);});});}
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js
index 1aa7f0e..dfe7942 100644
--- a/server/api/userProfile/userProfile.socket.js
+++ b/server/api/userProfile/userProfile.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf95f=['length','userProfile:','./userProfile.events','save','remove','update','emit','removeListener'];(function(_0x2417bc,_0x15e3be){var _0x2a99af=function(_0x5b35e2){while(--_0x5b35e2){_0x2417bc['push'](_0x2417bc['shift']());}};_0x2a99af(++_0x15e3be);}(_0xf95f,0x142));var _0xff95=function(_0x27e2c8,_0x5f40a0){_0x27e2c8=_0x27e2c8-0x0;var _0x5454d4=_0xf95f[_0x27e2c8];return _0x5454d4;};'use strict';var UserProfileEvents=require(_0xff95('0x0'));var events=[_0xff95('0x1'),_0xff95('0x2'),_0xff95('0x3')];function createListener(_0x109eae,_0x2c7ada){return function(_0x1a42e0){_0x2c7ada[_0xff95('0x4')](_0x109eae,_0x1a42e0);};}function removeListener(_0x1e81fe,_0x498f22){return function(){UserProfileEvents[_0xff95('0x5')](_0x1e81fe,_0x498f22);};}exports['register']=function(_0x3f72b4){for(var _0x4fb1ed=0x0,_0x314fb4=events[_0xff95('0x6')];_0x4fb1ed<_0x314fb4;_0x4fb1ed++){var _0x2b9ce9=events[_0x4fb1ed];var _0x1a42b2=createListener(_0xff95('0x7')+_0x2b9ce9,_0x3f72b4);UserProfileEvents['on'](_0x2b9ce9,_0x1a42b2);}};
\ No newline at end of file
+var _0x6eed=['emit','removeListener','register','./userProfile.events','save','remove','update'];(function(_0x476bcd,_0x2f6582){var _0x47b60f=function(_0x406a6e){while(--_0x406a6e){_0x476bcd['push'](_0x476bcd['shift']());}};_0x47b60f(++_0x2f6582);}(_0x6eed,0xff));var _0xd6ee=function(_0x31dbf1,_0x424a9c){_0x31dbf1=_0x31dbf1-0x0;var _0x3966cb=_0x6eed[_0x31dbf1];return _0x3966cb;};'use strict';var UserProfileEvents=require(_0xd6ee('0x0'));var events=[_0xd6ee('0x1'),_0xd6ee('0x2'),_0xd6ee('0x3')];function createListener(_0x1a734a,_0x4e325a){return function(_0x25a92a){_0x4e325a[_0xd6ee('0x4')](_0x1a734a,_0x25a92a);};}function removeListener(_0x588715,_0x53cce9){return function(){UserProfileEvents[_0xd6ee('0x5')](_0x588715,_0x53cce9);};}exports[_0xd6ee('0x6')]=function(_0x1c4f36){for(var _0x37abca=0x0,_0x10c1d7=events['length'];_0x37abca<_0x10c1d7;_0x37abca++){var _0x514dc3=events[_0x37abca];var _0x2e6369=createListener('userProfile:'+_0x514dc3,_0x1c4f36);UserProfileEvents['on'](_0x514dc3,_0x2e6369);}};
\ No newline at end of file
diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js
index 8881970..d6927e0 100644
--- a/server/api/userProfileResource/index.js
+++ b/server/api/userProfileResource/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd3c8=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xd3c8,0x161));var _0x8d3c=function(_0x7bdb48,_0x3ce177){_0x7bdb48=_0x7bdb48-0x0;var _0x5f0847=_0xd3c8[_0x7bdb48];return _0x5f0847;};'use strict';var multer=require(_0x8d3c('0x0'));var util=require(_0x8d3c('0x1'));var path=require(_0x8d3c('0x2'));var timeout=require(_0x8d3c('0x3'));var express=require(_0x8d3c('0x4'));var router=express['Router']();var auth=require(_0x8d3c('0x5'));var interaction=require(_0x8d3c('0x6'));var config=require(_0x8d3c('0x7'));var controller=require(_0x8d3c('0x8'));router['get']('/',auth[_0x8d3c('0x9')](),controller[_0x8d3c('0xa')]);router[_0x8d3c('0xb')](_0x8d3c('0xc'),auth[_0x8d3c('0x9')](),controller[_0x8d3c('0xd')]);router[_0x8d3c('0xb')](_0x8d3c('0xe'),auth[_0x8d3c('0x9')](),controller[_0x8d3c('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8d3c('0x10')](_0x8d3c('0xe'),auth[_0x8d3c('0x9')](),controller[_0x8d3c('0x11')]);router[_0x8d3c('0x12')](_0x8d3c('0xe'),auth[_0x8d3c('0x9')](),controller[_0x8d3c('0x13')]);module[_0x8d3c('0x14')]=router;
\ No newline at end of file
+var _0x11f3=['post','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x337439,_0x3a6e6e){var _0x2b2573=function(_0x2529ff){while(--_0x2529ff){_0x337439['push'](_0x337439['shift']());}};_0x2b2573(++_0x3a6e6e);}(_0x11f3,0x149));var _0x311f=function(_0x37c9b4,_0x5d743d){_0x37c9b4=_0x37c9b4-0x0;var _0x1b28db=_0x11f3[_0x37c9b4];return _0x1b28db;};'use strict';var multer=require(_0x311f('0x0'));var util=require(_0x311f('0x1'));var path=require(_0x311f('0x2'));var timeout=require('connect-timeout');var express=require(_0x311f('0x3'));var router=express['Router']();var auth=require(_0x311f('0x4'));var interaction=require(_0x311f('0x5'));var config=require(_0x311f('0x6'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0x311f('0x7')](),controller['index']);router[_0x311f('0x8')](_0x311f('0x9'),auth[_0x311f('0x7')](),controller[_0x311f('0xa')]);router['get'](_0x311f('0xb'),auth[_0x311f('0x7')](),controller[_0x311f('0xc')]);router[_0x311f('0xd')]('/',auth[_0x311f('0x7')](),controller['create']);router[_0x311f('0xe')](_0x311f('0xb'),auth[_0x311f('0x7')](),controller[_0x311f('0xf')]);router[_0x311f('0x10')](_0x311f('0xb'),auth[_0x311f('0x7')](),controller[_0x311f('0x11')]);module[_0x311f('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js
index 89582a0..5afdc22 100644
--- a/server/api/userProfileResource/userProfileResource.attributes.js
+++ b/server/api/userProfileResource/userProfileResource.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfaff=['STRING','INTEGER'];(function(_0x3be988,_0x5e92d8){var _0x4d194a=function(_0x3827b3){while(--_0x3827b3){_0x3be988['push'](_0x3be988['shift']());}};_0x4d194a(++_0x5e92d8);}(_0xfaff,0xde));var _0xffaf=function(_0x35576b,_0x34c6c8){_0x35576b=_0x35576b-0x0;var _0x269e5c=_0xfaff[_0x35576b];return _0x269e5c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xffaf('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xffaf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xffaf('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0xe5b9=['sequelize','exports','STRING'];(function(_0x19db15,_0x1a3ff0){var _0x3f1572=function(_0x12ef49){while(--_0x12ef49){_0x19db15['push'](_0x19db15['shift']());}};_0x3f1572(++_0x1a3ff0);}(_0xe5b9,0x19e));var _0x9e5b=function(_0x1541c0,_0x35236f){_0x1541c0=_0x1541c0-0x0;var _0x12b57f=_0xe5b9[_0x1541c0];return _0x12b57f;};'use strict';var Sequelize=require(_0x9e5b('0x0'));module[_0x9e5b('0x1')]={'name':{'type':Sequelize[_0x9e5b('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x9e5b('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js
index 9d79168..ad2d9d7 100644
--- a/server/api/userProfileResource/userProfileResource.controller.js
+++ b/server/api/userProfileResource/userProfileResource.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4abf=['error','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','UserProfileResource','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','destroy','describe','html-pdf','eml-format','zip-dir','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','reject','then','sendStatus'];(function(_0x3dd5d2,_0x52b2f5){var _0x8b5683=function(_0x5550a2){while(--_0x5550a2){_0x3dd5d2['push'](_0x3dd5d2['shift']());}};_0x8b5683(++_0x52b2f5);}(_0x4abf,0xac));var _0xf4ab=function(_0x436b7f,_0xe5b65f){_0x436b7f=_0x436b7f-0x0;var _0x590b79=_0x4abf[_0x436b7f];return _0x590b79;};'use strict';var pdf=require(_0xf4ab('0x0'));var emlformat=require(_0xf4ab('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf4ab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf4ab('0x3'));var Mustache=require(_0xf4ab('0x4'));var util=require('util');var path=require('path');var sox=require(_0xf4ab('0x5'));var csv=require(_0xf4ab('0x6'));var ejs=require(_0xf4ab('0x7'));var fs=require('fs');var _=require(_0xf4ab('0x8'));var squel=require('squel');var crypto=require(_0xf4ab('0x9'));var jsforce=require(_0xf4ab('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf4ab('0x6'));var querystring=require('querystring');var Papa=require(_0xf4ab('0xb'));var Redis=require(_0xf4ab('0xc'));var authService=require(_0xf4ab('0xd'));var qs=require(_0xf4ab('0xe'));var hardwareService=require(_0xf4ab('0xf'));var logger=require(_0xf4ab('0x10'))(_0xf4ab('0x11'));var utils=require(_0xf4ab('0x12'));var config=require(_0xf4ab('0x13'));var db=require(_0xf4ab('0x14'))['db'];function respondWithStatusCode(_0x1df98f,_0x2d2e13){_0x2d2e13=_0x2d2e13||0xcc;return function(_0x1968f6){if(_0x1968f6){return _0x1df98f['sendStatus'](_0x2d2e13);}return _0x1df98f['status'](_0x2d2e13)[_0xf4ab('0x15')]();};}function respondWithResult(_0x54eabf,_0x35eab2){_0x35eab2=_0x35eab2||0xc8;return function(_0x1b7453){if(_0x1b7453){return _0x54eabf[_0xf4ab('0x16')](_0x35eab2)[_0xf4ab('0x17')](_0x1b7453);}};}function respondWithFilteredResult(_0x1f2d12,_0x37bbd6){return function(_0x47abb8){if(_0x47abb8){var _0x2e7b69=_0x47abb8[_0xf4ab('0x18')],_0x1c5202=_0x37bbd6[_0xf4ab('0x19')],_0xc26111=_0x37bbd6['offset']+_0x37bbd6[_0xf4ab('0x1a')],_0x5d50cb;if(_0xc26111>=_0x2e7b69){_0xc26111=_0x2e7b69;_0x5d50cb=0xc8;}else{_0x5d50cb=0xce;}_0x1f2d12[_0xf4ab('0x16')](_0x5d50cb);return _0x1f2d12[_0xf4ab('0x1b')](_0xf4ab('0x1c'),_0x1c5202+'-'+_0xc26111+'/'+_0x2e7b69)[_0xf4ab('0x17')](_0x47abb8);}return null;};}function patchUpdates(_0x2ac208){return function(_0x2ae65c){try{jsonpatch['apply'](_0x2ae65c,_0x2ac208,!![]);}catch(_0x4d8753){return BPromise[_0xf4ab('0x1d')](_0x4d8753);}return _0x2ae65c['save']();};}function saveUpdates(_0x18355c,_0x1727af){return function(_0x3c1394){if(_0x3c1394){return _0x3c1394['update'](_0x18355c)[_0xf4ab('0x1e')](function(_0x2fb02d){return _0x2fb02d;});}return null;};}function removeEntity(_0x3df1ef,_0x43e837){return function(_0xcd9799){if(_0xcd9799){return _0xcd9799['destroy']()[_0xf4ab('0x1e')](function(){_0x3df1ef[_0xf4ab('0x16')](0xcc)[_0xf4ab('0x15')]();});}};}function handleEntityNotFound(_0x248d13,_0x152d48){return function(_0xb5c618){if(!_0xb5c618){_0x248d13[_0xf4ab('0x1f')](0x194);}return _0xb5c618;};}function handleError(_0x5e4442,_0x910ef1){_0x910ef1=_0x910ef1||0x1f4;return function(_0x54e816){logger[_0xf4ab('0x20')](_0x54e816['stack']);if(_0x54e816['name']){delete _0x54e816['name'];}_0x5e4442['status'](_0x910ef1)['send'](_0x54e816);};}exports['index']=function(_0x5f5af2,_0x19d6a8){var _0x9863d1={},_0x1abd31={},_0x425e4e={'count':0x0,'rows':[]};var _0x1efb48=db['UserProfileResource']['rawAttributes'];_0x1abd31[_0xf4ab('0x21')]=_[_0xf4ab('0x22')](_0x1efb48);_0x1abd31['query']=_[_0xf4ab('0x22')](_0x5f5af2['query']);_0x1abd31[_0xf4ab('0x23')]=_[_0xf4ab('0x24')](_0x1abd31[_0xf4ab('0x21')],_0x1abd31[_0xf4ab('0x25')]);_0x9863d1[_0xf4ab('0x26')]=_[_0xf4ab('0x24')](_0x1abd31[_0xf4ab('0x21')],qs[_0xf4ab('0x27')](_0x5f5af2[_0xf4ab('0x25')][_0xf4ab('0x27')]));_0x9863d1[_0xf4ab('0x26')]=_0x9863d1['attributes'][_0xf4ab('0x28')]?_0x9863d1['attributes']:_0x1abd31[_0xf4ab('0x21')];if(!_0x5f5af2[_0xf4ab('0x25')]['hasOwnProperty']('nolimit')){_0x9863d1[_0xf4ab('0x1a')]=qs[_0xf4ab('0x1a')](_0x5f5af2[_0xf4ab('0x25')][_0xf4ab('0x1a')]);_0x9863d1[_0xf4ab('0x19')]=qs['offset'](_0x5f5af2['query'][_0xf4ab('0x19')]);}_0x9863d1[_0xf4ab('0x29')]=qs[_0xf4ab('0x2a')](_0x5f5af2['query'][_0xf4ab('0x2a')]);_0x9863d1[_0xf4ab('0x2b')]=qs[_0xf4ab('0x23')](_[_0xf4ab('0x2c')](_0x5f5af2[_0xf4ab('0x25')],_0x1abd31[_0xf4ab('0x23')]));if(_0x5f5af2[_0xf4ab('0x25')][_0xf4ab('0x2d')]){_0x9863d1[_0xf4ab('0x2b')]=_[_0xf4ab('0x2e')](_0x9863d1[_0xf4ab('0x2b')],{'$or':_[_0xf4ab('0x2f')](_0x1efb48,function(_0x5f1722){if(_0x5f1722[_0xf4ab('0x30')][_0xf4ab('0x31')]!==_0xf4ab('0x32')){var _0x460637={};_0x460637[_0x5f1722[_0xf4ab('0x33')]]={'$like':'%'+_0x5f5af2[_0xf4ab('0x25')][_0xf4ab('0x2d')]+'%'};return _0x460637;}})});}_0x9863d1=_[_0xf4ab('0x2e')]({},_0x9863d1,_0x5f5af2[_0xf4ab('0x34')]);var _0x179ff2={'where':_0x9863d1[_0xf4ab('0x2b')]};return db[_0xf4ab('0x35')][_0xf4ab('0x18')](_0x179ff2)[_0xf4ab('0x1e')](function(_0x4ed7d4){_0x425e4e[_0xf4ab('0x18')]=_0x4ed7d4;if(_0x5f5af2[_0xf4ab('0x25')][_0xf4ab('0x36')]){_0x9863d1[_0xf4ab('0x37')]=[{'all':!![]}];}return db['UserProfileResource'][_0xf4ab('0x38')](_0x9863d1);})[_0xf4ab('0x1e')](function(_0x220281){_0x425e4e[_0xf4ab('0x39')]=_0x220281;return _0x425e4e;})['then'](respondWithFilteredResult(_0x19d6a8,_0x9863d1))[_0xf4ab('0x3a')](handleError(_0x19d6a8,null));};exports[_0xf4ab('0x3b')]=function(_0x2c97c1,_0x4bde74){var _0x1aeacb={'raw':![],'where':{'id':_0x2c97c1[_0xf4ab('0x3c')]['id']}},_0x4cf010={};_0x4cf010[_0xf4ab('0x21')]=_[_0xf4ab('0x22')](db[_0xf4ab('0x35')][_0xf4ab('0x3d')]);_0x4cf010['query']=_[_0xf4ab('0x22')](_0x2c97c1[_0xf4ab('0x25')]);_0x4cf010['filters']=_[_0xf4ab('0x24')](_0x4cf010[_0xf4ab('0x21')],_0x4cf010[_0xf4ab('0x25')]);_0x1aeacb['attributes']=_[_0xf4ab('0x24')](_0x4cf010['model'],qs[_0xf4ab('0x27')](_0x2c97c1[_0xf4ab('0x25')]['fields']));_0x1aeacb[_0xf4ab('0x26')]=_0x1aeacb[_0xf4ab('0x26')][_0xf4ab('0x28')]?_0x1aeacb[_0xf4ab('0x26')]:_0x4cf010['model'];if(_0x2c97c1['query'][_0xf4ab('0x36')]){_0x1aeacb['include']=[{'all':!![]}];}_0x1aeacb=_['merge']({},_0x1aeacb,_0x2c97c1[_0xf4ab('0x34')]);return db[_0xf4ab('0x35')][_0xf4ab('0x3e')](_0x1aeacb)[_0xf4ab('0x1e')](handleEntityNotFound(_0x4bde74,null))[_0xf4ab('0x1e')](respondWithResult(_0x4bde74,null))[_0xf4ab('0x3a')](handleError(_0x4bde74,null));};exports[_0xf4ab('0x3f')]=function(_0x2fe6b9,_0x2f99b5){return db[_0xf4ab('0x35')][_0xf4ab('0x3f')](_0x2fe6b9[_0xf4ab('0x40')],{})[_0xf4ab('0x1e')](respondWithResult(_0x2f99b5,0xc9))['catch'](handleError(_0x2f99b5,null));};exports[_0xf4ab('0x41')]=function(_0x1c5501,_0x571adc){if(_0x1c5501[_0xf4ab('0x40')]['id']){delete _0x1c5501[_0xf4ab('0x40')]['id'];}return db[_0xf4ab('0x35')]['find']({'where':{'id':_0x1c5501[_0xf4ab('0x3c')]['id']}})['then'](handleEntityNotFound(_0x571adc,null))[_0xf4ab('0x1e')](saveUpdates(_0x1c5501[_0xf4ab('0x40')],null))[_0xf4ab('0x1e')](respondWithResult(_0x571adc,null))[_0xf4ab('0x3a')](handleError(_0x571adc,null));};exports[_0xf4ab('0x42')]=function(_0x448646,_0x25e6cc){return db['UserProfileResource'][_0xf4ab('0x3e')]({'where':{'id':_0x448646[_0xf4ab('0x3c')]['id']}})[_0xf4ab('0x1e')](handleEntityNotFound(_0x25e6cc,null))[_0xf4ab('0x1e')](removeEntity(_0x25e6cc,null))[_0xf4ab('0x3a')](handleError(_0x25e6cc,null));};exports[_0xf4ab('0x43')]=function(_0x271eae,_0x4412f4){return db[_0xf4ab('0x35')][_0xf4ab('0x43')]()['then'](respondWithResult(_0x4412f4,null))[_0xf4ab('0x3a')](handleError(_0x4412f4,null));};
\ No newline at end of file
+var _0xc4a1=['desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','index','UserProfileResource','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x350494,_0x161014){_0x350494=_0x350494-0x0;var _0x12946f=_0xc4a1[_0x350494];return _0x12946f;};'use strict';var pdf=require(_0x1c4a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1c4a('0x1'));var zipdir=require(_0x1c4a('0x2'));var jsonpatch=require(_0x1c4a('0x3'));var rp=require('request-promise');var moment=require(_0x1c4a('0x4'));var BPromise=require(_0x1c4a('0x5'));var Mustache=require(_0x1c4a('0x6'));var util=require(_0x1c4a('0x7'));var path=require(_0x1c4a('0x8'));var sox=require(_0x1c4a('0x9'));var csv=require(_0x1c4a('0xa'));var ejs=require(_0x1c4a('0xb'));var fs=require('fs');var _=require(_0x1c4a('0xc'));var squel=require(_0x1c4a('0xd'));var crypto=require(_0x1c4a('0xe'));var jsforce=require(_0x1c4a('0xf'));var deskjs=require(_0x1c4a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1c4a('0x11'));var Papa=require(_0x1c4a('0x12'));var Redis=require('ioredis');var authService=require(_0x1c4a('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c4a('0x14'))(_0x1c4a('0x15'));var utils=require('../../config/utils');var config=require(_0x1c4a('0x16'));var db=require(_0x1c4a('0x17'))['db'];function respondWithStatusCode(_0x55f35c,_0x56b1f0){_0x56b1f0=_0x56b1f0||0xcc;return function(_0x3aa5f4){if(_0x3aa5f4){return _0x55f35c[_0x1c4a('0x18')](_0x56b1f0);}return _0x55f35c['status'](_0x56b1f0)['end']();};}function respondWithResult(_0x2211e6,_0x4137d4){_0x4137d4=_0x4137d4||0xc8;return function(_0x343ec9){if(_0x343ec9){return _0x2211e6[_0x1c4a('0x19')](_0x4137d4)[_0x1c4a('0x1a')](_0x343ec9);}};}function respondWithFilteredResult(_0xd0a83f,_0x9a2091){return function(_0xa6e823){if(_0xa6e823){var _0x2867d4=_0xa6e823[_0x1c4a('0x1b')],_0x22b2f6=_0x9a2091[_0x1c4a('0x1c')],_0x48c1af=_0x9a2091[_0x1c4a('0x1c')]+_0x9a2091['limit'],_0x3be487;if(_0x48c1af>=_0x2867d4){_0x48c1af=_0x2867d4;_0x3be487=0xc8;}else{_0x3be487=0xce;}_0xd0a83f['status'](_0x3be487);return _0xd0a83f[_0x1c4a('0x1d')](_0x1c4a('0x1e'),_0x22b2f6+'-'+_0x48c1af+'/'+_0x2867d4)[_0x1c4a('0x1a')](_0xa6e823);}return null;};}function patchUpdates(_0x5f4cac){return function(_0x4a5055){try{jsonpatch[_0x1c4a('0x1f')](_0x4a5055,_0x5f4cac,!![]);}catch(_0x25252c){return BPromise['reject'](_0x25252c);}return _0x4a5055[_0x1c4a('0x20')]();};}function saveUpdates(_0x16dfe5,_0x22f46e){return function(_0x5324a9){if(_0x5324a9){return _0x5324a9['update'](_0x16dfe5)[_0x1c4a('0x21')](function(_0x119a48){return _0x119a48;});}return null;};}function removeEntity(_0x49a73a,_0x481d52){return function(_0x9843ce){if(_0x9843ce){return _0x9843ce[_0x1c4a('0x22')]()[_0x1c4a('0x21')](function(){_0x49a73a[_0x1c4a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31bf76,_0x41d351){return function(_0x3f8542){if(!_0x3f8542){_0x31bf76[_0x1c4a('0x18')](0x194);}return _0x3f8542;};}function handleError(_0x10cff7,_0x644d50){_0x644d50=_0x644d50||0x1f4;return function(_0x3ada0e){logger[_0x1c4a('0x23')](_0x3ada0e[_0x1c4a('0x24')]);if(_0x3ada0e[_0x1c4a('0x25')]){delete _0x3ada0e[_0x1c4a('0x25')];}_0x10cff7[_0x1c4a('0x19')](_0x644d50)['send'](_0x3ada0e);};}exports[_0x1c4a('0x26')]=function(_0x41ffbc,_0xa368c8){var _0x16feaf={},_0x3a5ffb={},_0x3dbc2e={'count':0x0,'rows':[]};var _0x291fc8=db[_0x1c4a('0x27')][_0x1c4a('0x28')];_0x3a5ffb[_0x1c4a('0x29')]=_[_0x1c4a('0x2a')](_0x291fc8);_0x3a5ffb[_0x1c4a('0x2b')]=_[_0x1c4a('0x2a')](_0x41ffbc[_0x1c4a('0x2b')]);_0x3a5ffb[_0x1c4a('0x2c')]=_[_0x1c4a('0x2d')](_0x3a5ffb[_0x1c4a('0x29')],_0x3a5ffb[_0x1c4a('0x2b')]);_0x16feaf[_0x1c4a('0x2e')]=_['intersection'](_0x3a5ffb[_0x1c4a('0x29')],qs['fields'](_0x41ffbc[_0x1c4a('0x2b')][_0x1c4a('0x2f')]));_0x16feaf[_0x1c4a('0x2e')]=_0x16feaf['attributes'][_0x1c4a('0x30')]?_0x16feaf['attributes']:_0x3a5ffb[_0x1c4a('0x29')];if(!_0x41ffbc[_0x1c4a('0x2b')][_0x1c4a('0x31')](_0x1c4a('0x32'))){_0x16feaf[_0x1c4a('0x33')]=qs['limit'](_0x41ffbc['query'][_0x1c4a('0x33')]);_0x16feaf['offset']=qs[_0x1c4a('0x1c')](_0x41ffbc[_0x1c4a('0x2b')][_0x1c4a('0x1c')]);}_0x16feaf[_0x1c4a('0x34')]=qs['sort'](_0x41ffbc['query'][_0x1c4a('0x35')]);_0x16feaf[_0x1c4a('0x36')]=qs[_0x1c4a('0x2c')](_[_0x1c4a('0x37')](_0x41ffbc[_0x1c4a('0x2b')],_0x3a5ffb['filters']));if(_0x41ffbc[_0x1c4a('0x2b')][_0x1c4a('0x38')]){_0x16feaf['where']=_[_0x1c4a('0x39')](_0x16feaf[_0x1c4a('0x36')],{'$or':_['map'](_0x291fc8,function(_0x54409c){if(_0x54409c['type'][_0x1c4a('0x3a')]!==_0x1c4a('0x3b')){var _0x45bbac={};_0x45bbac[_0x54409c['field']]={'$like':'%'+_0x41ffbc[_0x1c4a('0x2b')][_0x1c4a('0x38')]+'%'};return _0x45bbac;}})});}_0x16feaf=_[_0x1c4a('0x39')]({},_0x16feaf,_0x41ffbc[_0x1c4a('0x3c')]);var _0x365460={'where':_0x16feaf[_0x1c4a('0x36')]};return db['UserProfileResource']['count'](_0x365460)[_0x1c4a('0x21')](function(_0x1995be){_0x3dbc2e['count']=_0x1995be;if(_0x41ffbc[_0x1c4a('0x2b')][_0x1c4a('0x3d')]){_0x16feaf[_0x1c4a('0x3e')]=[{'all':!![]}];}return db['UserProfileResource'][_0x1c4a('0x3f')](_0x16feaf);})['then'](function(_0x3f19da){_0x3dbc2e[_0x1c4a('0x40')]=_0x3f19da;return _0x3dbc2e;})[_0x1c4a('0x21')](respondWithFilteredResult(_0xa368c8,_0x16feaf))[_0x1c4a('0x41')](handleError(_0xa368c8,null));};exports[_0x1c4a('0x42')]=function(_0x1c9bd3,_0x3ad033){var _0x3f57ec={'raw':![],'where':{'id':_0x1c9bd3['params']['id']}},_0x31e4c2={};_0x31e4c2[_0x1c4a('0x29')]=_['keys'](db[_0x1c4a('0x27')][_0x1c4a('0x28')]);_0x31e4c2[_0x1c4a('0x2b')]=_[_0x1c4a('0x2a')](_0x1c9bd3[_0x1c4a('0x2b')]);_0x31e4c2[_0x1c4a('0x2c')]=_[_0x1c4a('0x2d')](_0x31e4c2[_0x1c4a('0x29')],_0x31e4c2[_0x1c4a('0x2b')]);_0x3f57ec[_0x1c4a('0x2e')]=_[_0x1c4a('0x2d')](_0x31e4c2[_0x1c4a('0x29')],qs[_0x1c4a('0x2f')](_0x1c9bd3[_0x1c4a('0x2b')][_0x1c4a('0x2f')]));_0x3f57ec[_0x1c4a('0x2e')]=_0x3f57ec['attributes'][_0x1c4a('0x30')]?_0x3f57ec[_0x1c4a('0x2e')]:_0x31e4c2[_0x1c4a('0x29')];if(_0x1c9bd3[_0x1c4a('0x2b')][_0x1c4a('0x3d')]){_0x3f57ec[_0x1c4a('0x3e')]=[{'all':!![]}];}_0x3f57ec=_[_0x1c4a('0x39')]({},_0x3f57ec,_0x1c9bd3[_0x1c4a('0x3c')]);return db[_0x1c4a('0x27')][_0x1c4a('0x43')](_0x3f57ec)[_0x1c4a('0x21')](handleEntityNotFound(_0x3ad033,null))[_0x1c4a('0x21')](respondWithResult(_0x3ad033,null))[_0x1c4a('0x41')](handleError(_0x3ad033,null));};exports['create']=function(_0x5615c0,_0x2c1345){return db[_0x1c4a('0x27')][_0x1c4a('0x44')](_0x5615c0[_0x1c4a('0x45')],{})[_0x1c4a('0x21')](respondWithResult(_0x2c1345,0xc9))['catch'](handleError(_0x2c1345,null));};exports[_0x1c4a('0x46')]=function(_0x50ae13,_0x5b6d1c){if(_0x50ae13[_0x1c4a('0x45')]['id']){delete _0x50ae13[_0x1c4a('0x45')]['id'];}return db[_0x1c4a('0x27')][_0x1c4a('0x43')]({'where':{'id':_0x50ae13[_0x1c4a('0x47')]['id']}})[_0x1c4a('0x21')](handleEntityNotFound(_0x5b6d1c,null))[_0x1c4a('0x21')](saveUpdates(_0x50ae13[_0x1c4a('0x45')],null))[_0x1c4a('0x21')](respondWithResult(_0x5b6d1c,null))[_0x1c4a('0x41')](handleError(_0x5b6d1c,null));};exports[_0x1c4a('0x22')]=function(_0x376f68,_0x10f204){return db[_0x1c4a('0x27')][_0x1c4a('0x43')]({'where':{'id':_0x376f68[_0x1c4a('0x47')]['id']}})['then'](handleEntityNotFound(_0x10f204,null))[_0x1c4a('0x21')](removeEntity(_0x10f204,null))[_0x1c4a('0x41')](handleError(_0x10f204,null));};exports[_0x1c4a('0x48')]=function(_0x18ee1b,_0x5f473f){return db[_0x1c4a('0x27')][_0x1c4a('0x48')]()[_0x1c4a('0x21')](respondWithResult(_0x5f473f,null))['catch'](handleError(_0x5f473f,null));};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js
index cb3d55f..b8957dc 100644
--- a/server/api/userProfileResource/userProfileResource.model.js
+++ b/server/api/userProfileResource/userProfileResource.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7221=['rimraf','./userProfileResource.attributes','exports','user_profile_has_resources','compositeIndex','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4148a2,_0x39c942){var _0x27b22f=function(_0x12451c){while(--_0x12451c){_0x4148a2['push'](_0x4148a2['shift']());}};_0x27b22f(++_0x39c942);}(_0x7221,0x198));var _0x1722=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x7221[_0x3c51d4];return _0x53c45f;};'use strict';var _=require(_0x1722('0x0'));var util=require(_0x1722('0x1'));var logger=require(_0x1722('0x2'))(_0x1722('0x3'));var moment=require(_0x1722('0x4'));var BPromise=require(_0x1722('0x5'));var rp=require(_0x1722('0x6'));var fs=require('fs');var path=require(_0x1722('0x7'));var rimraf=require(_0x1722('0x8'));var config=require('../../config/environment');var attributes=require(_0x1722('0x9'));module[_0x1722('0xa')]=function(_0x56311f,_0x529ea1){return _0x56311f['define']('UserProfileResource',attributes,{'tableName':_0x1722('0xb'),'paranoid':![],'indexes':[{'name':_0x1722('0xc'),'fields':['resourceId','sectionId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x019a=['sectionId','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x019a,0x1ed));var _0xa019=function(_0x3d7ca9,_0x3ff74c){_0x3d7ca9=_0x3d7ca9-0x0;var _0x3f1333=_0x019a[_0x3d7ca9];return _0x3f1333;};'use strict';var _=require(_0xa019('0x0'));var util=require(_0xa019('0x1'));var logger=require(_0xa019('0x2'))('api');var moment=require(_0xa019('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa019('0x4'));var config=require(_0xa019('0x5'));var attributes=require(_0xa019('0x6'));module[_0xa019('0x7')]=function(_0x4211b9,_0x3f1099){return _0x4211b9[_0xa019('0x8')]('UserProfileResource',attributes,{'tableName':_0xa019('0x9'),'paranoid':![],'indexes':[{'name':_0xa019('0xa'),'fields':['resourceId',_0xa019('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js
index 0063b97..ccd5496 100644
--- a/server/api/userProfileResource/userProfileResource.rpc.js
+++ b/server/api/userProfileResource/userProfileResource.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7b84=['jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x56e414,_0x271b18){var _0x46a7b1=function(_0x1cd640){while(--_0x1cd640){_0x56e414['push'](_0x56e414['shift']());}};_0x46a7b1(++_0x271b18);}(_0x7b84,0x17c));var _0x47b8=function(_0x5bd8ed,_0x536443){_0x5bd8ed=_0x5bd8ed-0x0;var _0x1254db=_0x7b84[_0x5bd8ed];return _0x1254db;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('UserProfileResource,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});}
\ No newline at end of file
+var _0xacf4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xacf4,0xe7));var _0x4acf=function(_0x3758b5,_0x41d0ec){_0x3758b5=_0x3758b5-0x0;var _0x2673cc=_0xacf4[_0x3758b5];return _0x2673cc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}
\ No newline at end of file
diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js
index 541ca40..1396856 100644
--- a/server/api/userProfileSection/index.js
+++ b/server/api/userProfileSection/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6bec=['post','put','update','delete','exports','multer','util','path','connect-timeout','express','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x5a133b,_0xfa797){var _0x5ef421=function(_0xa9339f){while(--_0xa9339f){_0x5a133b['push'](_0x5a133b['shift']());}};_0x5ef421(++_0xfa797);}(_0x6bec,0x8d));var _0xc6be=function(_0x22d208,_0x5dea90){_0x22d208=_0x22d208-0x0;var _0xff3ba=_0x6bec[_0x22d208];return _0xff3ba;};'use strict';var multer=require(_0xc6be('0x0'));var util=require(_0xc6be('0x1'));var path=require(_0xc6be('0x2'));var timeout=require(_0xc6be('0x3'));var express=require(_0xc6be('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc6be('0x5'));var controller=require('./userProfileSection.controller');router[_0xc6be('0x6')]('/',auth[_0xc6be('0x7')](),controller[_0xc6be('0x8')]);router['get']('/describe',auth[_0xc6be('0x7')](),controller[_0xc6be('0x9')]);router['get'](_0xc6be('0xa'),auth[_0xc6be('0x7')](),controller[_0xc6be('0xb')]);router[_0xc6be('0xc')]('/',auth[_0xc6be('0x7')](),controller['create']);router[_0xc6be('0xd')](_0xc6be('0xa'),auth['isAuthenticated'](),controller[_0xc6be('0xe')]);router[_0xc6be('0xf')](_0xc6be('0xa'),auth[_0xc6be('0x7')](),controller['destroy']);module[_0xc6be('0x10')]=router;
\ No newline at end of file
+var _0x9f20=['update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post','create'];(function(_0xdbc69a,_0x238884){var _0x27cdfe=function(_0x1b6bb4){while(--_0x1b6bb4){_0xdbc69a['push'](_0xdbc69a['shift']());}};_0x27cdfe(++_0x238884);}(_0x9f20,0xc3));var _0x09f2=function(_0x588f26,_0x1e55a7){_0x588f26=_0x588f26-0x0;var _0x492596=_0x9f20[_0x588f26];return _0x492596;};'use strict';var multer=require(_0x09f2('0x0'));var util=require(_0x09f2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09f2('0x2'));var router=express[_0x09f2('0x3')]();var auth=require(_0x09f2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x09f2('0x5'));var controller=require('./userProfileSection.controller');router[_0x09f2('0x6')]('/',auth[_0x09f2('0x7')](),controller[_0x09f2('0x8')]);router[_0x09f2('0x6')]('/describe',auth[_0x09f2('0x7')](),controller[_0x09f2('0x9')]);router[_0x09f2('0x6')](_0x09f2('0xa'),auth[_0x09f2('0x7')](),controller['show']);router[_0x09f2('0xb')]('/',auth[_0x09f2('0x7')](),controller[_0x09f2('0xc')]);router['put']('/:id',auth[_0x09f2('0x7')](),controller[_0x09f2('0xd')]);router[_0x09f2('0xe')]('/:id',auth[_0x09f2('0x7')](),controller[_0x09f2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js
index 5751630..d82201c 100644
--- a/server/api/userProfileSection/userProfileSection.attributes.js
+++ b/server/api/userProfileSection/userProfileSection.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['BOOLEAN','crudPermissions','getDataValue','split','STRING','INTEGER'];(function(_0x2e48ad,_0x564396){var _0x4719d4=function(_0x4ee8d1){while(--_0x4ee8d1){_0x2e48ad['push'](_0x2e48ad['shift']());}};_0x4719d4(++_0x564396);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x49c4('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x49c4('0x0')],'set':function(_0x4e0313){this['setDataValue'](_0x49c4('0x3'),_0x4e0313?_0x4e0313['join'](''):[]);},'get':function(){return this[_0x49c4('0x4')](_0x49c4('0x3'))?this[_0x49c4('0x4')](_0x49c4('0x3'))[_0x49c4('0x5')](''):[];}}};
\ No newline at end of file
+var _0xcb91=['BOOLEAN','crudPermissions','join','getDataValue','split','STRING','INTEGER'];(function(_0x2e132f,_0x3e5854){var _0x284b59=function(_0x6467){while(--_0x6467){_0x2e132f['push'](_0x2e132f['shift']());}};_0x284b59(++_0x3e5854);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xcb91[_0xef8146];return _0x5a6cb0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x1cb9('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x1cb9('0x0')],'set':function(_0x2c17b8){this['setDataValue'](_0x1cb9('0x3'),_0x2c17b8?_0x2c17b8[_0x1cb9('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x1cb9('0x3'))?this[_0x1cb9('0x5')]('crudPermissions')[_0x1cb9('0x6')](''):[];}}};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js
index 97ddd01..9c5e2ec 100644
--- a/server/api/userProfileSection/userProfileSection.controller.js
+++ b/server/api/userProfileSection/userProfileSection.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a3e=['reject','save','then','destroy','end','error','stack','name','index','UserProfileSection','rawAttributes','query','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','keys','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply'];(function(_0x4853fc,_0x52cd55){var _0x23be73=function(_0x541448){while(--_0x541448){_0x4853fc['push'](_0x4853fc['shift']());}};_0x23be73(++_0x52cd55);}(_0x7a3e,0x199));var _0xe7a3=function(_0x19a751,_0x2cabc5){_0x19a751=_0x19a751-0x0;var _0x310874=_0x7a3e[_0x19a751];return _0x310874;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe7a3('0x0'));var rimraf=require(_0xe7a3('0x1'));var zipdir=require(_0xe7a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7a3('0x3'));var moment=require(_0xe7a3('0x4'));var BPromise=require(_0xe7a3('0x5'));var Mustache=require(_0xe7a3('0x6'));var util=require(_0xe7a3('0x7'));var path=require(_0xe7a3('0x8'));var sox=require(_0xe7a3('0x9'));var csv=require(_0xe7a3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe7a3('0xb'));var squel=require('squel');var crypto=require(_0xe7a3('0xc'));var jsforce=require(_0xe7a3('0xd'));var deskjs=require(_0xe7a3('0xe'));var toCsv=require(_0xe7a3('0xa'));var querystring=require(_0xe7a3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe7a3('0x10'));var hardwareService=require(_0xe7a3('0x11'));var logger=require(_0xe7a3('0x12'))(_0xe7a3('0x13'));var utils=require('../../config/utils');var config=require(_0xe7a3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57a106,_0x517471){_0x517471=_0x517471||0xcc;return function(_0x9009af){if(_0x9009af){return _0x57a106[_0xe7a3('0x15')](_0x517471);}return _0x57a106[_0xe7a3('0x16')](_0x517471)['end']();};}function respondWithResult(_0x1723e3,_0x362216){_0x362216=_0x362216||0xc8;return function(_0x299305){if(_0x299305){return _0x1723e3[_0xe7a3('0x16')](_0x362216)[_0xe7a3('0x17')](_0x299305);}};}function respondWithFilteredResult(_0x4e09f0,_0x1fc5f7){return function(_0x13a573){if(_0x13a573){var _0x315b01=_0x13a573[_0xe7a3('0x18')],_0x8362ac=_0x1fc5f7[_0xe7a3('0x19')],_0x4c4046=_0x1fc5f7[_0xe7a3('0x19')]+_0x1fc5f7['limit'],_0x79c347;if(_0x4c4046>=_0x315b01){_0x4c4046=_0x315b01;_0x79c347=0xc8;}else{_0x79c347=0xce;}_0x4e09f0[_0xe7a3('0x16')](_0x79c347);return _0x4e09f0[_0xe7a3('0x1a')](_0xe7a3('0x1b'),_0x8362ac+'-'+_0x4c4046+'/'+_0x315b01)[_0xe7a3('0x17')](_0x13a573);}return null;};}function patchUpdates(_0x16b471){return function(_0x2da287){try{jsonpatch[_0xe7a3('0x1c')](_0x2da287,_0x16b471,!![]);}catch(_0x5aa0e9){return BPromise[_0xe7a3('0x1d')](_0x5aa0e9);}return _0x2da287[_0xe7a3('0x1e')]();};}function saveUpdates(_0x160b05,_0x293e37){return function(_0x532c74){if(_0x532c74){return _0x532c74['update'](_0x160b05)[_0xe7a3('0x1f')](function(_0x43b9eb){return _0x43b9eb;});}return null;};}function removeEntity(_0x4ed737,_0x28dcef){return function(_0xa4d8a3){if(_0xa4d8a3){return _0xa4d8a3[_0xe7a3('0x20')]()[_0xe7a3('0x1f')](function(){_0x4ed737[_0xe7a3('0x16')](0xcc)[_0xe7a3('0x21')]();});}};}function handleEntityNotFound(_0x40a418,_0x2b735b){return function(_0x116b9d){if(!_0x116b9d){_0x40a418['sendStatus'](0x194);}return _0x116b9d;};}function handleError(_0x28f1d2,_0xa04857){_0xa04857=_0xa04857||0x1f4;return function(_0x32bfe4){logger[_0xe7a3('0x22')](_0x32bfe4[_0xe7a3('0x23')]);if(_0x32bfe4[_0xe7a3('0x24')]){delete _0x32bfe4['name'];}_0x28f1d2[_0xe7a3('0x16')](_0xa04857)['send'](_0x32bfe4);};}exports[_0xe7a3('0x25')]=function(_0x58146a,_0x4851d2){var _0x45ad84={},_0x124213={},_0x1fd004={'count':0x0,'rows':[]};var _0x4ca85c=db[_0xe7a3('0x26')][_0xe7a3('0x27')];_0x124213['model']=_['keys'](_0x4ca85c);_0x124213[_0xe7a3('0x28')]=_['keys'](_0x58146a['query']);_0x124213['filters']=_[_0xe7a3('0x29')](_0x124213[_0xe7a3('0x2a')],_0x124213[_0xe7a3('0x28')]);_0x45ad84[_0xe7a3('0x2b')]=_[_0xe7a3('0x29')](_0x124213[_0xe7a3('0x2a')],qs[_0xe7a3('0x2c')](_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x2c')]));_0x45ad84['attributes']=_0x45ad84[_0xe7a3('0x2b')][_0xe7a3('0x2d')]?_0x45ad84[_0xe7a3('0x2b')]:_0x124213[_0xe7a3('0x2a')];if(!_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x2e')]('nolimit')){_0x45ad84[_0xe7a3('0x2f')]=qs[_0xe7a3('0x2f')](_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x2f')]);_0x45ad84['offset']=qs['offset'](_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x19')]);}_0x45ad84[_0xe7a3('0x30')]=qs[_0xe7a3('0x31')](_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x31')]);_0x45ad84[_0xe7a3('0x32')]=qs[_0xe7a3('0x33')](_[_0xe7a3('0x34')](_0x58146a['query'],_0x124213[_0xe7a3('0x33')]));if(_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x35')]){_0x45ad84[_0xe7a3('0x32')]=_[_0xe7a3('0x36')](_0x45ad84[_0xe7a3('0x32')],{'$or':_[_0xe7a3('0x37')](_0x4ca85c,function(_0x161dc3){if(_0x161dc3[_0xe7a3('0x38')][_0xe7a3('0x39')]!==_0xe7a3('0x3a')){var _0x20437c={};_0x20437c[_0x161dc3[_0xe7a3('0x3b')]]={'$like':'%'+_0x58146a[_0xe7a3('0x28')]['filter']+'%'};return _0x20437c;}})});}_0x45ad84=_['merge']({},_0x45ad84,_0x58146a[_0xe7a3('0x3c')]);var _0x5380bf={'where':_0x45ad84[_0xe7a3('0x32')]};return db[_0xe7a3('0x26')][_0xe7a3('0x18')](_0x5380bf)[_0xe7a3('0x1f')](function(_0x43f13d){_0x1fd004[_0xe7a3('0x18')]=_0x43f13d;if(_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x3d')]){_0x45ad84['include']=[{'all':!![]}];}return db[_0xe7a3('0x26')][_0xe7a3('0x3e')](_0x45ad84);})['then'](function(_0x3499e3){_0x1fd004[_0xe7a3('0x3f')]=_0x3499e3;return _0x1fd004;})[_0xe7a3('0x1f')](respondWithFilteredResult(_0x4851d2,_0x45ad84))[_0xe7a3('0x40')](handleError(_0x4851d2,null));};exports['show']=function(_0x1d89d7,_0x45a6b0){var _0x543d5a={'raw':![],'where':{'id':_0x1d89d7[_0xe7a3('0x41')]['id']}},_0x876f2={};_0x876f2['model']=_[_0xe7a3('0x42')](db[_0xe7a3('0x26')]['rawAttributes']);_0x876f2['query']=_[_0xe7a3('0x42')](_0x1d89d7[_0xe7a3('0x28')]);_0x876f2[_0xe7a3('0x33')]=_[_0xe7a3('0x29')](_0x876f2['model'],_0x876f2[_0xe7a3('0x28')]);_0x543d5a[_0xe7a3('0x2b')]=_['intersection'](_0x876f2['model'],qs[_0xe7a3('0x2c')](_0x1d89d7[_0xe7a3('0x28')]['fields']));_0x543d5a[_0xe7a3('0x2b')]=_0x543d5a[_0xe7a3('0x2b')][_0xe7a3('0x2d')]?_0x543d5a[_0xe7a3('0x2b')]:_0x876f2[_0xe7a3('0x2a')];if(_0x1d89d7[_0xe7a3('0x28')]['includeAll']){_0x543d5a[_0xe7a3('0x43')]=[{'all':!![]}];}_0x543d5a=_[_0xe7a3('0x36')]({},_0x543d5a,_0x1d89d7[_0xe7a3('0x3c')]);return db[_0xe7a3('0x26')][_0xe7a3('0x44')](_0x543d5a)['then'](handleEntityNotFound(_0x45a6b0,null))[_0xe7a3('0x1f')](respondWithResult(_0x45a6b0,null))['catch'](handleError(_0x45a6b0,null));};exports[_0xe7a3('0x45')]=function(_0x5c4d10,_0x5e66c6){return db[_0xe7a3('0x26')][_0xe7a3('0x45')](_0x5c4d10[_0xe7a3('0x46')],{})[_0xe7a3('0x1f')](respondWithResult(_0x5e66c6,0xc9))[_0xe7a3('0x40')](handleError(_0x5e66c6,null));};exports[_0xe7a3('0x47')]=function(_0x1d1ec0,_0x1bd15c){if(_0x1d1ec0['body']['id']){delete _0x1d1ec0[_0xe7a3('0x46')]['id'];}return db[_0xe7a3('0x26')][_0xe7a3('0x44')]({'where':{'id':_0x1d1ec0[_0xe7a3('0x41')]['id']}})['then'](handleEntityNotFound(_0x1bd15c,null))[_0xe7a3('0x1f')](saveUpdates(_0x1d1ec0[_0xe7a3('0x46')],null))[_0xe7a3('0x1f')](respondWithResult(_0x1bd15c,null))[_0xe7a3('0x40')](handleError(_0x1bd15c,null));};exports[_0xe7a3('0x20')]=function(_0x1d8c6e,_0xf3604d){return db[_0xe7a3('0x26')][_0xe7a3('0x44')]({'where':{'id':_0x1d8c6e[_0xe7a3('0x41')]['id']}})[_0xe7a3('0x1f')](handleEntityNotFound(_0xf3604d,null))[_0xe7a3('0x1f')](removeEntity(_0xf3604d,null))[_0xe7a3('0x40')](handleError(_0xf3604d,null));};exports[_0xe7a3('0x48')]=function(_0x37b09a,_0x2ee268){return db[_0xe7a3('0x26')][_0xe7a3('0x48')]()[_0xe7a3('0x1f')](respondWithResult(_0x2ee268,null))[_0xe7a3('0x40')](handleError(_0x2ee268,null));};
\ No newline at end of file
+var _0x0410=['rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','count','then','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','set','reject','save','destroy','error','stack','name','send','index','UserProfileSection'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0410,0x104));var _0x0041=function(_0xd7e0a3,_0x4bd5a6){_0xd7e0a3=_0xd7e0a3-0x0;var _0x2e010d=_0x0410[_0xd7e0a3];return _0x2e010d;};'use strict';var pdf=require(_0x0041('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0041('0x1'));var zipdir=require(_0x0041('0x2'));var jsonpatch=require(_0x0041('0x3'));var rp=require(_0x0041('0x4'));var moment=require(_0x0041('0x5'));var BPromise=require(_0x0041('0x6'));var Mustache=require(_0x0041('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0041('0x8'));var csv=require(_0x0041('0x9'));var ejs=require(_0x0041('0xa'));var fs=require('fs');var _=require(_0x0041('0xb'));var squel=require(_0x0041('0xc'));var crypto=require(_0x0041('0xd'));var jsforce=require(_0x0041('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0041('0x9'));var querystring=require(_0x0041('0xf'));var Papa=require(_0x0041('0x10'));var Redis=require(_0x0041('0x11'));var authService=require(_0x0041('0x12'));var qs=require(_0x0041('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0041('0x14'))(_0x0041('0x15'));var utils=require(_0x0041('0x16'));var config=require(_0x0041('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f0784,_0x13ae53){_0x13ae53=_0x13ae53||0xcc;return function(_0x81549b){if(_0x81549b){return _0x5f0784[_0x0041('0x18')](_0x13ae53);}return _0x5f0784['status'](_0x13ae53)[_0x0041('0x19')]();};}function respondWithResult(_0x2eda36,_0x5aa8d3){_0x5aa8d3=_0x5aa8d3||0xc8;return function(_0x2dad2b){if(_0x2dad2b){return _0x2eda36[_0x0041('0x1a')](_0x5aa8d3)[_0x0041('0x1b')](_0x2dad2b);}};}function respondWithFilteredResult(_0x4fdcfd,_0x5d60a0){return function(_0x49fe6c){if(_0x49fe6c){var _0x54b5a0=_0x49fe6c['count'],_0x552132=_0x5d60a0[_0x0041('0x1c')],_0x4a1830=_0x5d60a0['offset']+_0x5d60a0[_0x0041('0x1d')],_0x34f431;if(_0x4a1830>=_0x54b5a0){_0x4a1830=_0x54b5a0;_0x34f431=0xc8;}else{_0x34f431=0xce;}_0x4fdcfd[_0x0041('0x1a')](_0x34f431);return _0x4fdcfd[_0x0041('0x1e')]('Content-Range',_0x552132+'-'+_0x4a1830+'/'+_0x54b5a0)[_0x0041('0x1b')](_0x49fe6c);}return null;};}function patchUpdates(_0x41b167){return function(_0x4e4759){try{jsonpatch['apply'](_0x4e4759,_0x41b167,!![]);}catch(_0x1b0517){return BPromise[_0x0041('0x1f')](_0x1b0517);}return _0x4e4759[_0x0041('0x20')]();};}function saveUpdates(_0x2e5a19,_0x93d744){return function(_0x11395d){if(_0x11395d){return _0x11395d['update'](_0x2e5a19)['then'](function(_0xade47f){return _0xade47f;});}return null;};}function removeEntity(_0x55d84e,_0x2fa20b){return function(_0x2837c3){if(_0x2837c3){return _0x2837c3[_0x0041('0x21')]()['then'](function(){_0x55d84e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x901f2,_0x2aa693){return function(_0x1e1613){if(!_0x1e1613){_0x901f2[_0x0041('0x18')](0x194);}return _0x1e1613;};}function handleError(_0x7230e,_0x3902b5){_0x3902b5=_0x3902b5||0x1f4;return function(_0x27de36){logger[_0x0041('0x22')](_0x27de36[_0x0041('0x23')]);if(_0x27de36[_0x0041('0x24')]){delete _0x27de36[_0x0041('0x24')];}_0x7230e[_0x0041('0x1a')](_0x3902b5)[_0x0041('0x25')](_0x27de36);};}exports[_0x0041('0x26')]=function(_0x56cf47,_0x1e11a9){var _0x134028={},_0x8cdcb1={},_0x5d9ff1={'count':0x0,'rows':[]};var _0x5bbdd0=db[_0x0041('0x27')][_0x0041('0x28')];_0x8cdcb1[_0x0041('0x29')]=_[_0x0041('0x2a')](_0x5bbdd0);_0x8cdcb1[_0x0041('0x2b')]=_[_0x0041('0x2a')](_0x56cf47[_0x0041('0x2b')]);_0x8cdcb1[_0x0041('0x2c')]=_[_0x0041('0x2d')](_0x8cdcb1['model'],_0x8cdcb1[_0x0041('0x2b')]);_0x134028[_0x0041('0x2e')]=_[_0x0041('0x2d')](_0x8cdcb1['model'],qs[_0x0041('0x2f')](_0x56cf47[_0x0041('0x2b')][_0x0041('0x2f')]));_0x134028['attributes']=_0x134028[_0x0041('0x2e')][_0x0041('0x30')]?_0x134028[_0x0041('0x2e')]:_0x8cdcb1[_0x0041('0x29')];if(!_0x56cf47[_0x0041('0x2b')][_0x0041('0x31')](_0x0041('0x32'))){_0x134028['limit']=qs[_0x0041('0x1d')](_0x56cf47[_0x0041('0x2b')][_0x0041('0x1d')]);_0x134028[_0x0041('0x1c')]=qs[_0x0041('0x1c')](_0x56cf47[_0x0041('0x2b')][_0x0041('0x1c')]);}_0x134028[_0x0041('0x33')]=qs[_0x0041('0x34')](_0x56cf47['query']['sort']);_0x134028[_0x0041('0x35')]=qs[_0x0041('0x2c')](_[_0x0041('0x36')](_0x56cf47[_0x0041('0x2b')],_0x8cdcb1[_0x0041('0x2c')]));if(_0x56cf47[_0x0041('0x2b')][_0x0041('0x37')]){_0x134028['where']=_[_0x0041('0x38')](_0x134028[_0x0041('0x35')],{'$or':_[_0x0041('0x39')](_0x5bbdd0,function(_0x572fd2){if(_0x572fd2[_0x0041('0x3a')][_0x0041('0x3b')]!==_0x0041('0x3c')){var _0x55cf0a={};_0x55cf0a[_0x572fd2[_0x0041('0x3d')]]={'$like':'%'+_0x56cf47[_0x0041('0x2b')][_0x0041('0x37')]+'%'};return _0x55cf0a;}})});}_0x134028=_[_0x0041('0x38')]({},_0x134028,_0x56cf47['options']);var _0x16be97={'where':_0x134028[_0x0041('0x35')]};return db[_0x0041('0x27')][_0x0041('0x3e')](_0x16be97)[_0x0041('0x3f')](function(_0x4f21e2){_0x5d9ff1[_0x0041('0x3e')]=_0x4f21e2;if(_0x56cf47[_0x0041('0x2b')][_0x0041('0x40')]){_0x134028[_0x0041('0x41')]=[{'all':!![]}];}return db['UserProfileSection'][_0x0041('0x42')](_0x134028);})[_0x0041('0x3f')](function(_0x20a7c9){_0x5d9ff1[_0x0041('0x43')]=_0x20a7c9;return _0x5d9ff1;})[_0x0041('0x3f')](respondWithFilteredResult(_0x1e11a9,_0x134028))[_0x0041('0x44')](handleError(_0x1e11a9,null));};exports['show']=function(_0x2add68,_0x174f05){var _0xde7ae5={'raw':![],'where':{'id':_0x2add68[_0x0041('0x45')]['id']}},_0x16eaa3={};_0x16eaa3[_0x0041('0x29')]=_[_0x0041('0x2a')](db[_0x0041('0x27')][_0x0041('0x28')]);_0x16eaa3[_0x0041('0x2b')]=_[_0x0041('0x2a')](_0x2add68[_0x0041('0x2b')]);_0x16eaa3['filters']=_[_0x0041('0x2d')](_0x16eaa3[_0x0041('0x29')],_0x16eaa3['query']);_0xde7ae5[_0x0041('0x2e')]=_[_0x0041('0x2d')](_0x16eaa3[_0x0041('0x29')],qs[_0x0041('0x2f')](_0x2add68[_0x0041('0x2b')][_0x0041('0x2f')]));_0xde7ae5[_0x0041('0x2e')]=_0xde7ae5[_0x0041('0x2e')][_0x0041('0x30')]?_0xde7ae5[_0x0041('0x2e')]:_0x16eaa3[_0x0041('0x29')];if(_0x2add68[_0x0041('0x2b')][_0x0041('0x40')]){_0xde7ae5[_0x0041('0x41')]=[{'all':!![]}];}_0xde7ae5=_['merge']({},_0xde7ae5,_0x2add68[_0x0041('0x46')]);return db[_0x0041('0x27')][_0x0041('0x47')](_0xde7ae5)[_0x0041('0x3f')](handleEntityNotFound(_0x174f05,null))[_0x0041('0x3f')](respondWithResult(_0x174f05,null))['catch'](handleError(_0x174f05,null));};exports[_0x0041('0x48')]=function(_0x1dd0e8,_0x65aef9){return db[_0x0041('0x27')][_0x0041('0x48')](_0x1dd0e8[_0x0041('0x49')],{})[_0x0041('0x3f')](respondWithResult(_0x65aef9,0xc9))[_0x0041('0x44')](handleError(_0x65aef9,null));};exports['update']=function(_0x1b75b6,_0x5efe83){if(_0x1b75b6[_0x0041('0x49')]['id']){delete _0x1b75b6[_0x0041('0x49')]['id'];}return db[_0x0041('0x27')]['find']({'where':{'id':_0x1b75b6['params']['id']}})[_0x0041('0x3f')](handleEntityNotFound(_0x5efe83,null))['then'](saveUpdates(_0x1b75b6[_0x0041('0x49')],null))[_0x0041('0x3f')](respondWithResult(_0x5efe83,null))[_0x0041('0x44')](handleError(_0x5efe83,null));};exports[_0x0041('0x21')]=function(_0x4967cf,_0x522370){return db[_0x0041('0x27')][_0x0041('0x47')]({'where':{'id':_0x4967cf[_0x0041('0x45')]['id']}})['then'](handleEntityNotFound(_0x522370,null))[_0x0041('0x3f')](removeEntity(_0x522370,null))[_0x0041('0x44')](handleError(_0x522370,null));};exports['describe']=function(_0x4d71f1,_0x405d5d){return db[_0x0041('0x27')][_0x0041('0x4a')]()[_0x0041('0x3f')](respondWithResult(_0x405d5d,null))['catch'](handleError(_0x405d5d,null));};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js
index 6181a2a..1c5d436 100644
--- a/server/api/userProfileSection/userProfileSection.model.js
+++ b/server/api/userProfileSection/userProfileSection.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x207c=['path','../../config/environment','define','UserProfileSection','compositeIndex','sectionId','userProfileId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x216e58,_0x497adc){var _0x5adcad=function(_0x22197f){while(--_0x22197f){_0x216e58['push'](_0x216e58['shift']());}};_0x5adcad(++_0x497adc);}(_0x207c,0x1e8));var _0xc207=function(_0x1a4c27,_0x5a4b45){_0x1a4c27=_0x1a4c27-0x0;var _0x578d9=_0x207c[_0x1a4c27];return _0x578d9;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var logger=require(_0xc207('0x1'))(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var BPromise=require(_0xc207('0x4'));var rp=require(_0xc207('0x5'));var fs=require('fs');var path=require(_0xc207('0x6'));var rimraf=require('rimraf');var config=require(_0xc207('0x7'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x55023e,_0xc88789){return _0x55023e[_0xc207('0x8')](_0xc207('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xc207('0xa'),'fields':[_0xc207('0xb'),_0xc207('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8343=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','moment','bluebird','path','rimraf','./userProfileSection.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8343,0xd7));var _0x3834=function(_0x4165db,_0x5b86d1){_0x4165db=_0x4165db-0x0;var _0x35706e=_0x8343[_0x4165db];return _0x35706e;};'use strict';var _=require(_0x3834('0x0'));var util=require(_0x3834('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3834('0x2'));var BPromise=require(_0x3834('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3834('0x4'));var rimraf=require(_0x3834('0x5'));var config=require('../../config/environment');var attributes=require(_0x3834('0x6'));module[_0x3834('0x7')]=function(_0x50b7d0,_0x2f0044){return _0x50b7d0[_0x3834('0x8')](_0x3834('0x9'),attributes,{'tableName':_0x3834('0xa'),'paranoid':![],'indexes':[{'name':_0x3834('0xb'),'fields':[_0x3834('0xc'),_0x3834('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js
index 37de796..8feb14a 100644
--- a/server/api/userProfileSection/userProfileSection.rpc.js
+++ b/server/api/userProfileSection/userProfileSection.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5638=['http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5638,0xb3));var _0x8563=function(_0x5ec5f3,_0x5da82a){_0x5ec5f3=_0x5ec5f3-0x0;var _0x1ad7be=_0x5638[_0x5ec5f3];return _0x1ad7be;};'use strict';var _=require(_0x8563('0x0'));var util=require(_0x8563('0x1'));var moment=require(_0x8563('0x2'));var BPromise=require('bluebird');var rs=require(_0x8563('0x3'));var fs=require('fs');var Redis=require(_0x8563('0x4'));var db=require(_0x8563('0x5'))['db'];var utils=require(_0x8563('0x6'));var logger=require('../../config/logger')(_0x8563('0x7'));var config=require(_0x8563('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8563('0x9')][_0x8563('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30e2ea,_0x13454a,_0xa29962){return new BPromise(function(_0x3c4b71,_0x45ead6){return client[_0x8563('0xb')](_0x30e2ea,_0xa29962)[_0x8563('0xc')](function(_0xa0bedb){logger[_0x8563('0xd')](_0x8563('0xe'),_0x13454a,'request\x20sent');logger[_0x8563('0xf')](_0x8563('0x10'),_0x13454a,_0x8563('0x11'),JSON['stringify'](_0xa0bedb));if(_0xa0bedb['error']){if(_0xa0bedb[_0x8563('0x12')]['code']===0x1f4){logger[_0x8563('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x13454a,_0xa0bedb[_0x8563('0x12')][_0x8563('0x13')]);return _0x45ead6(_0xa0bedb[_0x8563('0x12')][_0x8563('0x13')]);}logger['error'](_0x8563('0xe'),_0x13454a,_0xa0bedb[_0x8563('0x12')][_0x8563('0x13')]);return _0x3c4b71(_0xa0bedb[_0x8563('0x12')][_0x8563('0x13')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x13454a,_0x8563('0x11'));_0x3c4b71(_0xa0bedb['result'][_0x8563('0x13')]);}})[_0x8563('0x14')](function(_0x4d199a){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x13454a,_0x4d199a);_0x45ead6(_0x4d199a);});});}
\ No newline at end of file
+var _0xca82=['client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0xca82,0x7b));var _0x2ca8=function(_0x34ebc6,_0x201e65){_0x34ebc6=_0x34ebc6-0x0;var _0x16f800=_0xca82[_0x34ebc6];return _0x16f800;};'use strict';var _=require(_0x2ca8('0x0'));var util=require(_0x2ca8('0x1'));var moment=require('moment');var BPromise=require(_0x2ca8('0x2'));var rs=require(_0x2ca8('0x3'));var fs=require('fs');var Redis=require(_0x2ca8('0x4'));var db=require(_0x2ca8('0x5'))['db'];var utils=require(_0x2ca8('0x6'));var logger=require(_0x2ca8('0x7'))('rpc');var config=require(_0x2ca8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2ca8('0x9')][_0x2ca8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bd736,_0x2cfa9c,_0x5c8444){return new BPromise(function(_0xdc716a,_0x4e8914){return client['request'](_0x2bd736,_0x5c8444)[_0x2ca8('0xb')](function(_0x4ecc9c){logger[_0x2ca8('0xc')](_0x2ca8('0xd'),_0x2cfa9c,_0x2ca8('0xe'));logger[_0x2ca8('0xf')](_0x2ca8('0x10'),_0x2cfa9c,'request\x20sent',JSON['stringify'](_0x4ecc9c));if(_0x4ecc9c[_0x2ca8('0x11')]){if(_0x4ecc9c[_0x2ca8('0x11')][_0x2ca8('0x12')]===0x1f4){logger[_0x2ca8('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x2cfa9c,_0x4ecc9c['error'][_0x2ca8('0x13')]);return _0x4e8914(_0x4ecc9c[_0x2ca8('0x11')][_0x2ca8('0x13')]);}logger[_0x2ca8('0x11')](_0x2ca8('0xd'),_0x2cfa9c,_0x4ecc9c['error'][_0x2ca8('0x13')]);return _0xdc716a(_0x4ecc9c[_0x2ca8('0x11')]['message']);}else{logger['info'](_0x2ca8('0xd'),_0x2cfa9c,'request\x20sent');_0xdc716a(_0x4ecc9c[_0x2ca8('0x14')][_0x2ca8('0x13')]);}})[_0x2ca8('0x15')](function(_0x481909){logger[_0x2ca8('0x11')](_0x2ca8('0xd'),_0x2cfa9c,_0x481909);_0x4e8914(_0x481909);});});}
\ No newline at end of file
diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js
index cc87399..714a03e 100644
--- a/server/api/userSmsQueue/index.js
+++ b/server/api/userSmsQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6931=['../../components/interaction/service','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x57c9cb,_0x4735d8){var _0x5ef282=function(_0x43ab6e){while(--_0x43ab6e){_0x57c9cb['push'](_0x57c9cb['shift']());}};_0x5ef282(++_0x4735d8);}(_0x6931,0x1a9));var _0x1693=function(_0x2d20a8,_0x2d500e){_0x2d20a8=_0x2d20a8-0x0;var _0x46d9db=_0x6931[_0x2d20a8];return _0x46d9db;};'use strict';var multer=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var path=require(_0x1693('0x2'));var timeout=require(_0x1693('0x3'));var express=require(_0x1693('0x4'));var router=express[_0x1693('0x5')]();var auth=require(_0x1693('0x6'));var interaction=require(_0x1693('0x7'));var config=require('../../config/environment');module[_0x1693('0x8')]=router;
\ No newline at end of file
+var _0x9a5a=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0x9a5a,0x194));var _0xa9a5=function(_0x43a3f5,_0xbf4385){_0x43a3f5=_0x43a3f5-0x0;var _0x2a868c=_0x9a5a[_0x43a3f5];return _0x2a868c;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var auth=require(_0xa9a5('0x5'));var interaction=require(_0xa9a5('0x6'));var config=require(_0xa9a5('0x7'));module[_0xa9a5('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js
index b488fd5..5c91677 100644
--- a/server/api/userSmsQueue/userSmsQueue.attributes.js
+++ b/server/api/userSmsQueue/userSmsQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb042=['exports','INTEGER','sequelize'];(function(_0x1a0620,_0x4f40c3){var _0x475abc=function(_0x276d92){while(--_0x276d92){_0x1a0620['push'](_0x1a0620['shift']());}};_0x475abc(++_0x4f40c3);}(_0xb042,0x1be));var _0x2b04=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xb042[_0x39e283];return _0x7de89f;};'use strict';var Sequelize=require(_0x2b04('0x0'));module[_0x2b04('0x1')]={'penalty':{'type':Sequelize[_0x2b04('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6e6d=['exports','sequelize'];(function(_0x15d4f2,_0x188f9f){var _0x2747a1=function(_0x24286a){while(--_0x24286a){_0x15d4f2['push'](_0x15d4f2['shift']());}};_0x2747a1(++_0x188f9f);}(_0x6e6d,0x17d));var _0xd6e6=function(_0x253fd1,_0x23f18f){_0x253fd1=_0x253fd1-0x0;var _0x337124=_0x6e6d[_0x253fd1];return _0x337124;};'use strict';var Sequelize=require(_0xd6e6('0x0'));module[_0xd6e6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js
index e14b648..a4ee17b 100644
--- a/server/api/userSmsQueue/userSmsQueue.model.js
+++ b/server/api/userSmsQueue/userSmsQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6efe=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define'];(function(_0x59ed01,_0x18bd6b){var _0x1441ef=function(_0x1a79b2){while(--_0x1a79b2){_0x59ed01['push'](_0x59ed01['shift']());}};_0x1441ef(++_0x18bd6b);}(_0x6efe,0xc6));var _0xe6ef=function(_0xf8db3d,_0x36c144){_0xf8db3d=_0xf8db3d-0x0;var _0x4ea659=_0x6efe[_0xf8db3d];return _0x4ea659;};'use strict';var _=require(_0xe6ef('0x0'));var util=require(_0xe6ef('0x1'));var logger=require(_0xe6ef('0x2'))(_0xe6ef('0x3'));var moment=require(_0xe6ef('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6ef('0x5'));var rimraf=require(_0xe6ef('0x6'));var config=require(_0xe6ef('0x7'));var attributes=require(_0xe6ef('0x8'));module[_0xe6ef('0x9')]=function(_0x573395,_0x17fc74){return _0x573395[_0xe6ef('0xa')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf69c=['../../config/environment','exports','define','UserSmsQueue','lodash','../../config/logger','api','bluebird','path'];(function(_0x456919,_0x4c175d){var _0x41a512=function(_0x44c4dd){while(--_0x44c4dd){_0x456919['push'](_0x456919['shift']());}};_0x41a512(++_0x4c175d);}(_0xf69c,0x151));var _0xcf69=function(_0x4944f1,_0x482a52){_0x4944f1=_0x4944f1-0x0;var _0x433494=_0xf69c[_0x4944f1];return _0x433494;};'use strict';var _=require(_0xcf69('0x0'));var util=require('util');var logger=require(_0xcf69('0x1'))(_0xcf69('0x2'));var moment=require('moment');var BPromise=require(_0xcf69('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf69('0x4'));var rimraf=require('rimraf');var config=require(_0xcf69('0x5'));var attributes=require('./userSmsQueue.attributes');module[_0xcf69('0x6')]=function(_0x168197,_0x225c65){return _0x168197[_0xcf69('0x7')](_0xcf69('0x8'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js
index f7f05c4..13ea5f9 100644
--- a/server/api/userSmsQueue/userSmsQueue.rpc.js
+++ b/server/api/userSmsQueue/userSmsQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9605=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserSmsQueue,\x20%s,\x20%s','catch'];(function(_0x4b9f35,_0x287585){var _0x200ea1=function(_0x9bf668){while(--_0x9bf668){_0x4b9f35['push'](_0x4b9f35['shift']());}};_0x200ea1(++_0x287585);}(_0x9605,0x1f4));var _0x5960=function(_0x23f07a,_0x2f6593){_0x23f07a=_0x23f07a-0x0;var _0x5c5870=_0x9605[_0x23f07a];return _0x5c5870;};'use strict';var _=require('lodash');var util=require(_0x5960('0x0'));var moment=require('moment');var BPromise=require(_0x5960('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5960('0x2'))['db'];var utils=require(_0x5960('0x3'));var logger=require(_0x5960('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5960('0x5'));var client=jayson[_0x5960('0x6')][_0x5960('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x266ea9,_0x244332,_0x1a4f60){return new BPromise(function(_0x54d0f4,_0x213ef6){return client[_0x5960('0x8')](_0x266ea9,_0x1a4f60)[_0x5960('0x9')](function(_0x28ea23){logger[_0x5960('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x244332,_0x5960('0xb'));logger[_0x5960('0xc')](_0x5960('0xd'),_0x244332,_0x5960('0xb'),JSON[_0x5960('0xe')](_0x28ea23));if(_0x28ea23['error']){if(_0x28ea23[_0x5960('0xf')][_0x5960('0x10')]===0x1f4){logger[_0x5960('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x244332,_0x28ea23[_0x5960('0xf')][_0x5960('0x11')]);return _0x213ef6(_0x28ea23[_0x5960('0xf')][_0x5960('0x11')]);}logger[_0x5960('0xf')](_0x5960('0x12'),_0x244332,_0x28ea23[_0x5960('0xf')][_0x5960('0x11')]);return _0x54d0f4(_0x28ea23[_0x5960('0xf')][_0x5960('0x11')]);}else{logger[_0x5960('0xa')](_0x5960('0x12'),_0x244332,_0x5960('0xb'));_0x54d0f4(_0x28ea23['result'][_0x5960('0x11')]);}})[_0x5960('0x13')](function(_0x19c39a){logger['error'](_0x5960('0x12'),_0x244332,_0x19c39a);_0x213ef6(_0x19c39a);});});}
\ No newline at end of file
+var _0x2d60=['client','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x343dab,_0x134185){var _0xa7e52d=function(_0x37a2b8){while(--_0x37a2b8){_0x343dab['push'](_0x343dab['shift']());}};_0xa7e52d(++_0x134185);}(_0x2d60,0x198));var _0x02d6=function(_0x1986a4,_0x443391){_0x1986a4=_0x1986a4-0x0;var _0x1c3525=_0x2d60[_0x1986a4];return _0x1c3525;};'use strict';var _=require(_0x02d6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x02d6('0x1'));var rs=require(_0x02d6('0x2'));var fs=require('fs');var Redis=require(_0x02d6('0x3'));var db=require(_0x02d6('0x4'))['db'];var utils=require(_0x02d6('0x5'));var logger=require(_0x02d6('0x6'))(_0x02d6('0x7'));var config=require(_0x02d6('0x8'));var jayson=require(_0x02d6('0x9'));var client=jayson[_0x02d6('0xa')][_0x02d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219c63,_0x5ad58b,_0x1ab1a3){return new BPromise(function(_0x2d41db,_0x1ee6fe){return client[_0x02d6('0xc')](_0x219c63,_0x1ab1a3)[_0x02d6('0xd')](function(_0x584971){logger['info'](_0x02d6('0xe'),_0x5ad58b,_0x02d6('0xf'));logger['debug'](_0x02d6('0x10'),_0x5ad58b,'request\x20sent',JSON[_0x02d6('0x11')](_0x584971));if(_0x584971[_0x02d6('0x12')]){if(_0x584971['error'][_0x02d6('0x13')]===0x1f4){logger[_0x02d6('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x5ad58b,_0x584971['error'][_0x02d6('0x14')]);return _0x1ee6fe(_0x584971[_0x02d6('0x12')]['message']);}logger[_0x02d6('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x5ad58b,_0x584971['error'][_0x02d6('0x14')]);return _0x2d41db(_0x584971[_0x02d6('0x12')]['message']);}else{logger['info'](_0x02d6('0xe'),_0x5ad58b,_0x02d6('0xf'));_0x2d41db(_0x584971['result'][_0x02d6('0x14')]);}})[_0x02d6('0x15')](function(_0x1d4096){logger[_0x02d6('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x5ad58b,_0x1d4096);_0x1ee6fe(_0x1d4096);});});}
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js
index fb400e0..2c645bb 100644
--- a/server/api/userVoiceQueue/index.js
+++ b/server/api/userVoiceQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2bd8=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x185631,_0x5f306a){var _0x57c8f8=function(_0x45b24c){while(--_0x45b24c){_0x185631['push'](_0x185631['shift']());}};_0x57c8f8(++_0x5f306a);}(_0x2bd8,0x130));var _0x82bd=function(_0xe2f52,_0x45fd6c){_0xe2f52=_0xe2f52-0x0;var _0x544b7c=_0x2bd8[_0xe2f52];return _0x544b7c;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var auth=require(_0x82bd('0x5'));var interaction=require(_0x82bd('0x6'));var config=require(_0x82bd('0x7'));module['exports']=router;
\ No newline at end of file
+var _0x1b65=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','Router'];(function(_0x2f02d4,_0x27b24a){var _0x4b707d=function(_0x52f3ba){while(--_0x52f3ba){_0x2f02d4['push'](_0x2f02d4['shift']());}};_0x4b707d(++_0x27b24a);}(_0x1b65,0x1b4));var _0x51b6=function(_0x3da312,_0x391ccd){_0x3da312=_0x3da312-0x0;var _0x28fb08=_0x1b65[_0x3da312];return _0x28fb08;};'use strict';var multer=require(_0x51b6('0x0'));var util=require(_0x51b6('0x1'));var path=require(_0x51b6('0x2'));var timeout=require(_0x51b6('0x3'));var express=require('express');var router=express[_0x51b6('0x4')]();var auth=require(_0x51b6('0x5'));var interaction=require(_0x51b6('0x6'));var config=require(_0x51b6('0x7'));module[_0x51b6('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js
index 577b43d..08c1157 100644
--- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js
+++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee6f=['INTEGER','sequelize','exports'];(function(_0x40eba9,_0x1937ff){var _0x142491=function(_0x3a8db3){while(--_0x3a8db3){_0x40eba9['push'](_0x40eba9['shift']());}};_0x142491(++_0x1937ff);}(_0xee6f,0x19f));var _0xfee6=function(_0x3ab164,_0x2fa5e9){_0x3ab164=_0x3ab164-0x0;var _0x39565e=_0xee6f[_0x3ab164];return _0x39565e;};'use strict';var Sequelize=require(_0xfee6('0x0'));module[_0xfee6('0x1')]={'penalty':{'type':Sequelize[_0xfee6('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9d51=['exports','INTEGER','sequelize'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0x9d51,0x1a6));var _0x19d5=function(_0x3c19ca,_0x131d1c){_0x3c19ca=_0x3c19ca-0x0;var _0x425bee=_0x9d51[_0x3c19ca];return _0x425bee;};'use strict';var Sequelize=require(_0x19d5('0x0'));module[_0x19d5('0x1')]={'penalty':{'type':Sequelize[_0x19d5('0x2')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js
index 14b3508..62216f0 100644
--- a/server/api/userVoiceQueue/userVoiceQueue.model.js
+++ b/server/api/userVoiceQueue/userVoiceQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x127b=['rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','api','bluebird','request-promise'];(function(_0x30e0f5,_0x5e4826){var _0x3b5800=function(_0x3d9155){while(--_0x3d9155){_0x30e0f5['push'](_0x30e0f5['shift']());}};_0x3b5800(++_0x5e4826);}(_0x127b,0xa0));var _0xb127=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x127b[_0x36ed48];return _0x51c63a;};'use strict';var _=require('lodash');var util=require(_0xb127('0x0'));var logger=require(_0xb127('0x1'))(_0xb127('0x2'));var moment=require('moment');var BPromise=require(_0xb127('0x3'));var rp=require(_0xb127('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb127('0x5'));var config=require(_0xb127('0x6'));var attributes=require(_0xb127('0x7'));module['exports']=function(_0x211ab9,_0x3e1878){return _0x211ab9[_0xb127('0x8')](_0xb127('0x9'),attributes,{'tableName':_0xb127('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x233f=['path','./userVoiceQueue.attributes','exports','UserVoiceQueue','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5db3c1,_0xebe166){var _0x433fa2=function(_0x302933){while(--_0x302933){_0x5db3c1['push'](_0x5db3c1['shift']());}};_0x433fa2(++_0xebe166);}(_0x233f,0x180));var _0xf233=function(_0xfdc27,_0x498b00){_0xfdc27=_0xfdc27-0x0;var _0x26aeea=_0x233f[_0xfdc27];return _0x26aeea;};'use strict';var _=require(_0xf233('0x0'));var util=require(_0xf233('0x1'));var logger=require(_0xf233('0x2'))(_0xf233('0x3'));var moment=require(_0xf233('0x4'));var BPromise=require('bluebird');var rp=require(_0xf233('0x5'));var fs=require('fs');var path=require(_0xf233('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf233('0x7'));module[_0xf233('0x8')]=function(_0xe06ff5,_0x5632ab){return _0xe06ff5['define'](_0xf233('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js
index 19e17ec..b5f9459 100644
--- a/server/api/userVoiceQueue/userVoiceQueue.rpc.js
+++ b/server/api/userVoiceQueue/userVoiceQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a70=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x34f276,_0x1c41fc){var _0x24e21a=function(_0xa8c8bc){while(--_0xa8c8bc){_0x34f276['push'](_0x34f276['shift']());}};_0x24e21a(++_0x1c41fc);}(_0x2a70,0x134));var _0x02a7=function(_0x463e29,_0xfc1e0c){_0x463e29=_0x463e29-0x0;var _0x4a09ad=_0x2a70[_0x463e29];return _0x4a09ad;};'use strict';var _=require(_0x02a7('0x0'));var util=require(_0x02a7('0x1'));var moment=require(_0x02a7('0x2'));var BPromise=require(_0x02a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02a7('0x4'));var db=require(_0x02a7('0x5'))['db'];var utils=require(_0x02a7('0x6'));var logger=require('../../config/logger')(_0x02a7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x02a7('0x8')][_0x02a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1eb3b0,_0x41bd44,_0xdac391){return new BPromise(function(_0x3d7760,_0x165122){return client[_0x02a7('0xa')](_0x1eb3b0,_0xdac391)[_0x02a7('0xb')](function(_0x32c74d){logger[_0x02a7('0xc')](_0x02a7('0xd'),_0x41bd44,'request\x20sent');logger[_0x02a7('0xe')](_0x02a7('0xf'),_0x41bd44,'request\x20sent',JSON[_0x02a7('0x10')](_0x32c74d));if(_0x32c74d['error']){if(_0x32c74d[_0x02a7('0x11')][_0x02a7('0x12')]===0x1f4){logger[_0x02a7('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x41bd44,_0x32c74d['error'][_0x02a7('0x13')]);return _0x165122(_0x32c74d[_0x02a7('0x11')][_0x02a7('0x13')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x41bd44,_0x32c74d[_0x02a7('0x11')][_0x02a7('0x13')]);return _0x3d7760(_0x32c74d[_0x02a7('0x11')]['message']);}else{logger[_0x02a7('0xc')](_0x02a7('0xd'),_0x41bd44,_0x02a7('0x14'));_0x3d7760(_0x32c74d[_0x02a7('0x15')][_0x02a7('0x13')]);}})['catch'](function(_0x24ff1d){logger['error'](_0x02a7('0xd'),_0x41bd44,_0x24ff1d);_0x165122(_0x24ff1d);});});}
\ No newline at end of file
+var _0xb730=['info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb730,0x6c));var _0x0b73=function(_0x5bdb98,_0x271f14){_0x5bdb98=_0x5bdb98-0x0;var _0xaac4c4=_0xb730[_0x5bdb98];return _0xaac4c4;};'use strict';var _=require(_0x0b73('0x0'));var util=require(_0x0b73('0x1'));var moment=require(_0x0b73('0x2'));var BPromise=require(_0x0b73('0x3'));var rs=require(_0x0b73('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b73('0x5'))['db'];var utils=require(_0x0b73('0x6'));var logger=require(_0x0b73('0x7'))(_0x0b73('0x8'));var config=require(_0x0b73('0x9'));var jayson=require(_0x0b73('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x348e1a,_0xa6699f,_0x388d57){return new BPromise(function(_0x28bc3b,_0x4bd59f){return client['request'](_0x348e1a,_0x388d57)[_0x0b73('0xb')](function(_0x1ca995){logger[_0x0b73('0xc')](_0x0b73('0xd'),_0xa6699f,_0x0b73('0xe'));logger[_0x0b73('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0xa6699f,'request\x20sent',JSON[_0x0b73('0x10')](_0x1ca995));if(_0x1ca995[_0x0b73('0x11')]){if(_0x1ca995[_0x0b73('0x11')]['code']===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0xa6699f,_0x1ca995[_0x0b73('0x11')][_0x0b73('0x12')]);return _0x4bd59f(_0x1ca995[_0x0b73('0x11')][_0x0b73('0x12')]);}logger[_0x0b73('0x11')](_0x0b73('0xd'),_0xa6699f,_0x1ca995[_0x0b73('0x11')][_0x0b73('0x12')]);return _0x28bc3b(_0x1ca995[_0x0b73('0x11')]['message']);}else{logger['info'](_0x0b73('0xd'),_0xa6699f,'request\x20sent');_0x28bc3b(_0x1ca995['result'][_0x0b73('0x12')]);}})[_0x0b73('0x13')](function(_0x29ab15){logger['error'](_0x0b73('0xd'),_0xa6699f,_0x29ab15);_0x4bd59f(_0x29ab15);});});}
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js
index 478a8d8..4c56662 100644
--- a/server/api/userVoiceQueueRt/index.js
+++ b/server/api/userVoiceQueueRt/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc6ac=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x50b0c1,_0x1a847d){_0x50b0c1=_0x50b0c1-0x0;var _0x2cde07=_0xc6ac[_0x50b0c1];return _0x2cde07;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var auth=require(_0xcc6a('0x6'));var interaction=require(_0xcc6a('0x7'));var config=require(_0xcc6a('0x8'));module[_0xcc6a('0x9')]=router;
\ No newline at end of file
+var _0x598a=['util','path','connect-timeout','express','../../components/auth/service','multer'];(function(_0x1aaaab,_0x30a962){var _0x312772=function(_0x18d63d){while(--_0x18d63d){_0x1aaaab['push'](_0x1aaaab['shift']());}};_0x312772(++_0x30a962);}(_0x598a,0xfb));var _0xa598=function(_0x515b6c,_0xd053a2){_0x515b6c=_0x515b6c-0x0;var _0x580cc7=_0x598a[_0x515b6c];return _0x580cc7;};'use strict';var multer=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var path=require(_0xa598('0x2'));var timeout=require(_0xa598('0x3'));var express=require(_0xa598('0x4'));var router=express['Router']();var auth=require(_0xa598('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
index 4a01161..bcf00db 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec40=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x57014b,_0x360c0f){var _0x2b258a=function(_0x52c4a3){while(--_0x52c4a3){_0x57014b['push'](_0x57014b['shift']());}};_0x2b258a(++_0x360c0f);}(_0xec40,0xb9));var _0x0ec4=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0xec40[_0x329437];return _0x3789d9;};'use strict';var Sequelize=require(_0x0ec4('0x0'));module[_0x0ec4('0x1')]={'uniqueid':{'type':Sequelize[_0x0ec4('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0ec4('0x3')},'membername':{'type':Sequelize[_0x0ec4('0x4')],'allowNull':![],'comment':_0x0ec4('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0ec4('0x4')],'allowNull':![],'unique':_0x0ec4('0x5'),'comment':_0x0ec4('0x3')},'VoiceQueueId':{'type':Sequelize[_0x0ec4('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0ec4('0x5'),'comment':_0x0ec4('0x3')},'penalty':{'type':Sequelize[_0x0ec4('0x2')](0xb),'defaultValue':0x0,'comment':_0x0ec4('0x3')},'paused':{'type':Sequelize[_0x0ec4('0x2')](0xb),'defaultValue':0x0,'comment':_0x0ec4('0x3')}};
\ No newline at end of file
+var _0xbb3e=['INTEGER','STRING','queue_interface','Required\x20by\x20Asterisk','sequelize','exports'];(function(_0xe929f1,_0x27af72){var _0x2d625b=function(_0x156d5e){while(--_0x156d5e){_0xe929f1['push'](_0xe929f1['shift']());}};_0x2d625b(++_0x27af72);}(_0xbb3e,0x13c));var _0xebb3=function(_0x261b38,_0x26df5f){_0x261b38=_0x261b38-0x0;var _0x51a5a2=_0xbb3e[_0x261b38];return _0x51a5a2;};'use strict';var Sequelize=require(_0xebb3('0x0'));module[_0xebb3('0x1')]={'uniqueid':{'type':Sequelize[_0xebb3('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xebb3('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xebb3('0x3')],'allowNull':![],'unique':_0xebb3('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xebb3('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xebb3('0x3')],'allowNull':![],'unique':_0xebb3('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xebb3('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xebb3('0x2')](0xb),'defaultValue':0x0,'comment':_0xebb3('0x5')}};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
index 2daecb2..325ca54 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf369=['hook','exports','events','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xf369,0x17c));var _0x9f36=function(_0x2168bf,_0x3e93f4){_0x2168bf=_0x2168bf-0x0;var _0x3008bc=_0xf369[_0x2168bf];return _0x3008bc;};'use strict';var EventEmitter=require(_0x9f36('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x9f36('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9f36('0x2')](0x0);var events={'afterCreate':_0x9f36('0x3'),'afterUpdate':_0x9f36('0x4'),'afterDestroy':_0x9f36('0x5')};function emitEvent(_0x3b497a){return function(_0x17158e,_0x357665,_0x471c3c){UserVoiceQueueRtEvents[_0x9f36('0x6')](_0x3b497a+':'+_0x17158e['id'],_0x17158e);UserVoiceQueueRtEvents['emit'](_0x3b497a,_0x17158e);_0x471c3c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x9f36('0x7')](e,emitEvent(event));}}module[_0x9f36('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xe4e0=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x241610,_0x372e8c){var _0x483c63=function(_0x54f67a){while(--_0x54f67a){_0x241610['push'](_0x241610['shift']());}};_0x483c63(++_0x372e8c);}(_0xe4e0,0x15c));var _0x0e4e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe4e0[_0x4cf98e];return _0x1623ac;};'use strict';var EventEmitter=require(_0x0e4e('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0e4e('0x1')](0x0);var events={'afterCreate':_0x0e4e('0x2'),'afterUpdate':_0x0e4e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2da7ff){return function(_0x1e32f1,_0x5351d9,_0x52fbbe){UserVoiceQueueRtEvents[_0x0e4e('0x4')](_0x2da7ff+':'+_0x1e32f1['id'],_0x1e32f1);UserVoiceQueueRtEvents[_0x0e4e('0x4')](_0x2da7ff,_0x1e32f1);_0x52fbbe(null);};}for(var e in events){if(events[_0x0e4e('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x0e4e('0x6')](e,emitEvent(event));}}module[_0x0e4e('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
index 8a6b426..50fb42f 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0110=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x3f4f4c,_0x152171){var _0x3d48b3=function(_0x18a8a4){while(--_0x18a8a4){_0x3f4f4c['push'](_0x3f4f4c['shift']());}};_0x3d48b3(++_0x152171);}(_0x0110,0x128));var _0x0011=function(_0x5a55e5,_0x5e7139){_0x5a55e5=_0x5a55e5-0x0;var _0x5b3ad8=_0x0110[_0x5a55e5];return _0x5b3ad8;};'use strict';var _=require(_0x0011('0x0'));var util=require(_0x0011('0x1'));var logger=require(_0x0011('0x2'))(_0x0011('0x3'));var moment=require(_0x0011('0x4'));var BPromise=require(_0x0011('0x5'));var rp=require(_0x0011('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0011('0x7'));var config=require(_0x0011('0x8'));var attributes=require(_0x0011('0x9'));module[_0x0011('0xa')]=function(_0x300571,_0x180dfc){return _0x300571[_0x0011('0xb')](_0x0011('0xc'),attributes,{'tableName':_0x0011('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd1f7=['exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','path','./userVoiceQueueRt.attributes'];(function(_0x41eccd,_0x2052f4){var _0x4ebf84=function(_0x270f6b){while(--_0x270f6b){_0x41eccd['push'](_0x41eccd['shift']());}};_0x4ebf84(++_0x2052f4);}(_0xd1f7,0x14e));var _0x7d1f=function(_0x4c7b6e,_0x4b60bd){_0x4c7b6e=_0x4c7b6e-0x0;var _0x392efb=_0xd1f7[_0x4c7b6e];return _0x392efb;};'use strict';var _=require(_0x7d1f('0x0'));var util=require(_0x7d1f('0x1'));var logger=require(_0x7d1f('0x2'))('api');var moment=require(_0x7d1f('0x3'));var BPromise=require(_0x7d1f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d1f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7d1f('0x6'));module[_0x7d1f('0x7')]=function(_0x2b444f,_0x4c6154){return _0x2b444f[_0x7d1f('0x8')](_0x7d1f('0x9'),attributes,{'tableName':_0x7d1f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
index b73de82..b82a2b0 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6e03=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','request\x20sent','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x6e03,0x18c));var _0x36e0=function(_0x3dcd8f,_0x2381a1){_0x3dcd8f=_0x3dcd8f-0x0;var _0x585be7=_0x6e03[_0x3dcd8f];return _0x585be7;};'use strict';var _=require('lodash');var util=require(_0x36e0('0x0'));var moment=require(_0x36e0('0x1'));var BPromise=require(_0x36e0('0x2'));var rs=require(_0x36e0('0x3'));var fs=require('fs');var Redis=require(_0x36e0('0x4'));var db=require(_0x36e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x36e0('0x6'));var config=require(_0x36e0('0x7'));var jayson=require(_0x36e0('0x8'));var client=jayson['client'][_0x36e0('0x9')]({'port':0x232a});config[_0x36e0('0xa')]=_[_0x36e0('0xb')](config['redis'],{'host':_0x36e0('0xc'),'port':0x18eb});var socket=require(_0x36e0('0xd'))(new Redis(config[_0x36e0('0xa')]));require(_0x36e0('0xe'))['register'](socket);function respondWithRpcPromise(_0x1b071e,_0x3bdecc,_0x338bb5){return new BPromise(function(_0x41cc94,_0x2ef880){return client[_0x36e0('0xf')](_0x1b071e,_0x338bb5)[_0x36e0('0x10')](function(_0x19c83b){logger['info'](_0x36e0('0x11'),_0x3bdecc,'request\x20sent');logger[_0x36e0('0x12')](_0x36e0('0x13'),_0x3bdecc,'request\x20sent',JSON[_0x36e0('0x14')](_0x19c83b));if(_0x19c83b['error']){if(_0x19c83b['error'][_0x36e0('0x15')]===0x1f4){logger[_0x36e0('0x16')](_0x36e0('0x11'),_0x3bdecc,_0x19c83b[_0x36e0('0x16')][_0x36e0('0x17')]);return _0x2ef880(_0x19c83b[_0x36e0('0x16')][_0x36e0('0x17')]);}logger[_0x36e0('0x16')](_0x36e0('0x11'),_0x3bdecc,_0x19c83b['error']['message']);return _0x41cc94(_0x19c83b[_0x36e0('0x16')][_0x36e0('0x17')]);}else{logger[_0x36e0('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3bdecc,_0x36e0('0x19'));_0x41cc94(_0x19c83b[_0x36e0('0x1a')][_0x36e0('0x17')]);}})[_0x36e0('0x1b')](function(_0x131b16){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3bdecc,_0x131b16);_0x2ef880(_0x131b16);});});}exports[_0x36e0('0x1c')]=function(_0x3b0b90){var _0x5d2b01=this;return new Promise(function(_0x1f6e08,_0x466b12){return db['UserVoiceQueueRt'][_0x36e0('0x1d')]({'raw':_0x3b0b90[_0x36e0('0x1e')]?_0x3b0b90[_0x36e0('0x1e')][_0x36e0('0x1f')]===undefined?!![]:![]:!![],'where':_0x3b0b90[_0x36e0('0x1e')]?_0x3b0b90[_0x36e0('0x1e')][_0x36e0('0x20')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x36e0('0x21')]['fn']('IF',db[_0x36e0('0x21')]['literal'](_0x36e0('0x22')))),_0x36e0('0x23')]]})['then'](function(_0x4602f2){logger[_0x36e0('0x18')](_0x36e0('0x1c'),_0x3b0b90);logger['debug'](_0x36e0('0x1c'),_0x3b0b90,JSON[_0x36e0('0x14')](_0x4602f2));_0x1f6e08(_0x4602f2);})[_0x36e0('0x1b')](function(_0x23c8c7){logger[_0x36e0('0x16')](_0x36e0('0x1c'),_0x23c8c7[_0x36e0('0x17')],_0x3b0b90);_0x466b12(_0x5d2b01[_0x36e0('0x16')](0x1f4,_0x23c8c7[_0x36e0('0x17')]));});});};
\ No newline at end of file
+var _0x7286=['code','UserVoiceQueueRt,\x20%s,\x20%s','message','info','request\x20sent','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','then','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','request','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x64f4ae,_0x43bd40){var _0x4be1ce=function(_0x2ebcac){while(--_0x2ebcac){_0x64f4ae['push'](_0x64f4ae['shift']());}};_0x4be1ce(++_0x43bd40);}(_0x7286,0xbd));var _0x6728=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x7286[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6728('0x0'));var rs=require(_0x6728('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6728('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6728('0x3'));var jayson=require(_0x6728('0x4'));var client=jayson['client']['http']({'port':0x232a});config[_0x6728('0x5')]=_['defaults'](config[_0x6728('0x5')],{'host':_0x6728('0x6'),'port':0x18eb});var socket=require(_0x6728('0x7'))(new Redis(config[_0x6728('0x5')]));require('./userVoiceQueueRt.socket')[_0x6728('0x8')](socket);function respondWithRpcPromise(_0x5db7fd,_0x5f45d7,_0x4f4c21){return new BPromise(function(_0x3b0837,_0x319ea3){return client[_0x6728('0x9')](_0x5db7fd,_0x4f4c21)['then'](function(_0xc010b1){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5f45d7,'request\x20sent');logger[_0x6728('0xa')](_0x6728('0xb'),_0x5f45d7,'request\x20sent',JSON[_0x6728('0xc')](_0xc010b1));if(_0xc010b1[_0x6728('0xd')]){if(_0xc010b1[_0x6728('0xd')][_0x6728('0xe')]===0x1f4){logger['error'](_0x6728('0xf'),_0x5f45d7,_0xc010b1['error'][_0x6728('0x10')]);return _0x319ea3(_0xc010b1[_0x6728('0xd')][_0x6728('0x10')]);}logger[_0x6728('0xd')](_0x6728('0xf'),_0x5f45d7,_0xc010b1[_0x6728('0xd')][_0x6728('0x10')]);return _0x3b0837(_0xc010b1['error'][_0x6728('0x10')]);}else{logger[_0x6728('0x11')](_0x6728('0xf'),_0x5f45d7,_0x6728('0x12'));_0x3b0837(_0xc010b1[_0x6728('0x13')]['message']);}})['catch'](function(_0x2e3e2d){logger[_0x6728('0xd')](_0x6728('0xf'),_0x5f45d7,_0x2e3e2d);_0x319ea3(_0x2e3e2d);});});}exports[_0x6728('0x14')]=function(_0x22f04b){var _0x2343f4=this;return new Promise(function(_0x2909b8,_0x2684e2){return db[_0x6728('0x15')]['findAll']({'raw':_0x22f04b[_0x6728('0x16')]?_0x22f04b[_0x6728('0x16')][_0x6728('0x17')]===undefined?!![]:![]:!![],'where':_0x22f04b[_0x6728('0x16')]?_0x22f04b['options'][_0x6728('0x18')]||null:null,'attributes':[[db[_0x6728('0x19')]['fn'](_0x6728('0x1a'),db[_0x6728('0x19')]['fn']('IF',db[_0x6728('0x19')][_0x6728('0x1b')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0x6728('0x1c')](function(_0x8f0804){logger[_0x6728('0x11')](_0x6728('0x14'),_0x22f04b);logger[_0x6728('0xa')]('GetVoiceQueueRtPauses',_0x22f04b,JSON['stringify'](_0x8f0804));_0x2909b8(_0x8f0804);})['catch'](function(_0x45035c){logger[_0x6728('0xd')](_0x6728('0x14'),_0x45035c[_0x6728('0x10')],_0x22f04b);_0x2684e2(_0x2343f4['error'](0x1f4,_0x45035c[_0x6728('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
index e63888c..670d648 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c09=['save','remove','emit','removeListener','length','userVoiceQueueRt:'];(function(_0x65f773,_0x16dab4){var _0xbe68a6=function(_0x202ab5){while(--_0x202ab5){_0x65f773['push'](_0x65f773['shift']());}};_0xbe68a6(++_0x16dab4);}(_0x7c09,0x102));var _0x97c0=function(_0x1abe3f,_0x49a6df){_0x1abe3f=_0x1abe3f-0x0;var _0x1520b0=_0x7c09[_0x1abe3f];return _0x1520b0;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x97c0('0x0'),_0x97c0('0x1'),'update'];function createListener(_0xfbf689,_0x7d8f6f){return function(_0x2d04b9){_0x7d8f6f[_0x97c0('0x2')](_0xfbf689,_0x2d04b9);};}function removeListener(_0x12eb6d,_0x99bf54){return function(){UserVoiceQueueRtEvents[_0x97c0('0x3')](_0x12eb6d,_0x99bf54);};}exports['register']=function(_0x4b2f81){for(var _0x590368=0x0,_0x46fdd9=events[_0x97c0('0x4')];_0x590368<_0x46fdd9;_0x590368++){var _0x2c19fa=events[_0x590368];var _0x109bc8=createListener(_0x97c0('0x5')+_0x2c19fa,_0x4b2f81);UserVoiceQueueRtEvents['on'](_0x2c19fa,_0x109bc8);}};
\ No newline at end of file
+var _0x425d=['./userVoiceQueueRt.events','remove','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x425d,0x1e0));var _0xd425=function(_0x17bdab,_0x199650){_0x17bdab=_0x17bdab-0x0;var _0x4e2989=_0x425d[_0x17bdab];return _0x4e2989;};'use strict';var UserVoiceQueueRtEvents=require(_0xd425('0x0'));var events=['save',_0xd425('0x1'),_0xd425('0x2')];function createListener(_0x314a2b,_0x97e370){return function(_0x183caa){_0x97e370[_0xd425('0x3')](_0x314a2b,_0x183caa);};}function removeListener(_0x47043f,_0x596be7){return function(){UserVoiceQueueRtEvents[_0xd425('0x4')](_0x47043f,_0x596be7);};}exports[_0xd425('0x5')]=function(_0xc4e080){for(var _0x36866e=0x0,_0x1d97d9=events[_0xd425('0x6')];_0x36866e<_0x1d97d9;_0x36866e++){var _0x50b061=events[_0x36866e];var _0xb6ba8e=createListener(_0xd425('0x7')+_0x50b061,_0xc4e080);UserVoiceQueueRtEvents['on'](_0x50b061,_0xb6ba8e);}};
\ No newline at end of file
diff --git a/server/api/variable/index.js b/server/api/variable/index.js
index a7fb37d..36b87e5 100644
--- a/server/api/variable/index.js
+++ b/server/api/variable/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c00=['/:id','show','post','put','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated'];(function(_0xf2d165,_0x40bd94){var _0x1465dc=function(_0x141382){while(--_0x141382){_0xf2d165['push'](_0xf2d165['shift']());}};_0x1465dc(++_0x40bd94);}(_0x9c00,0x1a0));var _0x09c0=function(_0x24c086,_0x58503a){_0x24c086=_0x24c086-0x0;var _0x437816=_0x9c00[_0x24c086];return _0x437816;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x09c0('0x4'));var config=require(_0x09c0('0x5'));var controller=require(_0x09c0('0x6'));router[_0x09c0('0x7')]('/',auth[_0x09c0('0x8')](),controller['index']);router['get'](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xa')]);router[_0x09c0('0xb')]('/',auth[_0x09c0('0x8')](),controller['create']);router[_0x09c0('0xc')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xd')]);router[_0x09c0('0xe')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xf')]);module[_0x09c0('0x10')]=router;
\ No newline at end of file
+var _0x55e0=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55e0,0xdc));var _0x055e=function(_0x54749f,_0x58a224){_0x54749f=_0x54749f-0x0;var _0x2dc80b=_0x55e0[_0x54749f];return _0x2dc80b;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x055e('0x4'));var interaction=require(_0x055e('0x5'));var config=require(_0x055e('0x6'));var controller=require(_0x055e('0x7'));router[_0x055e('0x8')]('/',auth[_0x055e('0x9')](),controller['index']);router['get'](_0x055e('0xa'),auth['isAuthenticated'](),controller[_0x055e('0xb')]);router[_0x055e('0xc')]('/',auth[_0x055e('0x9')](),controller[_0x055e('0xd')]);router[_0x055e('0xe')]('/:id',auth[_0x055e('0x9')](),controller[_0x055e('0xf')]);router[_0x055e('0x10')](_0x055e('0xa'),auth[_0x055e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js
index 35860b0..0982ef2 100644
--- a/server/api/variable/variable.attributes.js
+++ b/server/api/variable/variable.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa1e=['sequelize','exports','STRING','name'];(function(_0x580381,_0x587ccb){var _0x31c9aa=function(_0x370a03){while(--_0x370a03){_0x580381['push'](_0x580381['shift']());}};_0x31c9aa(++_0x587ccb);}(_0xaa1e,0x7c));var _0xeaa1=function(_0x2e48bf,_0x4bde87){_0x2e48bf=_0x2e48bf-0x0;var _0x2b6b2d=_0xaa1e[_0x2e48bf];return _0x2b6b2d;};'use strict';var Sequelize=require(_0xeaa1('0x0'));module[_0xeaa1('0x1')]={'name':{'type':Sequelize[_0xeaa1('0x2')],'unique':_0xeaa1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeaa1('0x2')]}};
\ No newline at end of file
+var _0xbb78=['STRING'];(function(_0x4360c,_0x3fe19b){var _0x34f8fe=function(_0xe04dd6){while(--_0xe04dd6){_0x4360c['push'](_0x4360c['shift']());}};_0x34f8fe(++_0x3fe19b);}(_0xbb78,0xf4));var _0x8bb7=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xbb78[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8bb7('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8bb7('0x0')]}};
\ No newline at end of file
diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js
index c23e392..9e18005 100644
--- a/server/api/variable/variable.controller.js
+++ b/server/api/variable/variable.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc368=['then','destroy','Variables','UserProfileResource','error','name','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','Variable','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update'];(function(_0x332e03,_0x376dff){var _0x3af09e=function(_0x2b2122){while(--_0x2b2122){_0x332e03['push'](_0x332e03['shift']());}};_0x3af09e(++_0x376dff);}(_0xc368,0x7b));var _0x8c36=function(_0x25f985,_0x25b3ec){_0x25f985=_0x25f985-0x0;var _0x448c3f=_0xc368[_0x25f985];return _0x448c3f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8c36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c36('0x1'));var jsonpatch=require(_0x8c36('0x2'));var rp=require(_0x8c36('0x3'));var moment=require(_0x8c36('0x4'));var BPromise=require(_0x8c36('0x5'));var Mustache=require('mustache');var util=require(_0x8c36('0x6'));var path=require(_0x8c36('0x7'));var sox=require(_0x8c36('0x8'));var csv=require(_0x8c36('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8c36('0xa'));var crypto=require(_0x8c36('0xb'));var jsforce=require(_0x8c36('0xc'));var deskjs=require(_0x8c36('0xd'));var toCsv=require(_0x8c36('0x9'));var querystring=require(_0x8c36('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8c36('0xf'));var hardwareService=require(_0x8c36('0x10'));var logger=require('../../config/logger')(_0x8c36('0x11'));var utils=require(_0x8c36('0x12'));var config=require(_0x8c36('0x13'));var db=require(_0x8c36('0x14'))['db'];function respondWithStatusCode(_0x2a8e73,_0x451c24){_0x451c24=_0x451c24||0xcc;return function(_0xa09884){if(_0xa09884){return _0x2a8e73[_0x8c36('0x15')](_0x451c24);}return _0x2a8e73[_0x8c36('0x16')](_0x451c24)[_0x8c36('0x17')]();};}function respondWithResult(_0x43736d,_0x25a83e){_0x25a83e=_0x25a83e||0xc8;return function(_0x3c824b){if(_0x3c824b){return _0x43736d[_0x8c36('0x16')](_0x25a83e)['json'](_0x3c824b);}};}function respondWithFilteredResult(_0x31d8bf,_0x5e32ad){return function(_0xea7509){if(_0xea7509){var _0x3f83aa=_0xea7509[_0x8c36('0x18')],_0x29e791=_0x5e32ad[_0x8c36('0x19')],_0x1fc68e=_0x5e32ad[_0x8c36('0x19')]+_0x5e32ad[_0x8c36('0x1a')],_0xcfdbf7;if(_0x1fc68e>=_0x3f83aa){_0x1fc68e=_0x3f83aa;_0xcfdbf7=0xc8;}else{_0xcfdbf7=0xce;}_0x31d8bf['status'](_0xcfdbf7);return _0x31d8bf[_0x8c36('0x1b')](_0x8c36('0x1c'),_0x29e791+'-'+_0x1fc68e+'/'+_0x3f83aa)[_0x8c36('0x1d')](_0xea7509);}return null;};}function patchUpdates(_0x2d5e5b){return function(_0x3ef5ba){try{jsonpatch['apply'](_0x3ef5ba,_0x2d5e5b,!![]);}catch(_0x15100f){return BPromise[_0x8c36('0x1e')](_0x15100f);}return _0x3ef5ba[_0x8c36('0x1f')]();};}function saveUpdates(_0x137d5c,_0xc30310){return function(_0x2b07ad){if(_0x2b07ad){return _0x2b07ad[_0x8c36('0x20')](_0x137d5c)[_0x8c36('0x21')](function(_0x153735){return _0x153735;});}return null;};}function removeEntity(_0x474c5d,_0x2ed541){return function(_0x14ee6b){if(_0x14ee6b){return _0x14ee6b[_0x8c36('0x22')]()['then'](function(){var _0x5891ef=_0x14ee6b['get']({'plain':!![]});var _0x55b844=_0x8c36('0x23');return db[_0x8c36('0x24')][_0x8c36('0x22')]({'where':{'type':_0x55b844,'resourceId':_0x5891ef['id']}})[_0x8c36('0x21')](function(){return _0x14ee6b;});})[_0x8c36('0x21')](function(){_0x474c5d[_0x8c36('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d39ca,_0x49f6f9){return function(_0x40b66f){if(!_0x40b66f){_0x1d39ca['sendStatus'](0x194);}return _0x40b66f;};}function handleError(_0x10613e,_0x1afee4){_0x1afee4=_0x1afee4||0x1f4;return function(_0x271ec4){logger[_0x8c36('0x25')](_0x271ec4['stack']);if(_0x271ec4['name']){delete _0x271ec4[_0x8c36('0x26')];}_0x10613e[_0x8c36('0x16')](_0x1afee4)['send'](_0x271ec4);};}exports['index']=function(_0x418663,_0x2b5a8c){var _0x502fa3={},_0x1280a1={},_0xb29f20={'count':0x0,'rows':[]};var _0x3ca98e=db['Variable']['rawAttributes'];_0x1280a1[_0x8c36('0x27')]=_[_0x8c36('0x28')](_0x3ca98e);_0x1280a1[_0x8c36('0x29')]=_[_0x8c36('0x28')](_0x418663[_0x8c36('0x29')]);_0x1280a1[_0x8c36('0x2a')]=_[_0x8c36('0x2b')](_0x1280a1[_0x8c36('0x27')],_0x1280a1[_0x8c36('0x29')]);_0x502fa3[_0x8c36('0x2c')]=_[_0x8c36('0x2b')](_0x1280a1[_0x8c36('0x27')],qs[_0x8c36('0x2d')](_0x418663[_0x8c36('0x29')][_0x8c36('0x2d')]));_0x502fa3[_0x8c36('0x2c')]=_0x502fa3[_0x8c36('0x2c')]['length']?_0x502fa3['attributes']:_0x1280a1['model'];if(!_0x418663[_0x8c36('0x29')][_0x8c36('0x2e')](_0x8c36('0x2f'))){_0x502fa3[_0x8c36('0x1a')]=qs[_0x8c36('0x1a')](_0x418663[_0x8c36('0x29')][_0x8c36('0x1a')]);_0x502fa3['offset']=qs[_0x8c36('0x19')](_0x418663['query'][_0x8c36('0x19')]);}_0x502fa3['order']=qs[_0x8c36('0x30')](_0x418663[_0x8c36('0x29')][_0x8c36('0x30')]);_0x502fa3['where']=qs[_0x8c36('0x2a')](_[_0x8c36('0x31')](_0x418663[_0x8c36('0x29')],_0x1280a1[_0x8c36('0x2a')]));if(_0x418663[_0x8c36('0x29')][_0x8c36('0x32')]){_0x502fa3[_0x8c36('0x33')]=_[_0x8c36('0x34')](_0x502fa3[_0x8c36('0x33')],{'$or':_[_0x8c36('0x35')](_0x3ca98e,function(_0x4719de){if(_0x4719de[_0x8c36('0x36')][_0x8c36('0x37')]!==_0x8c36('0x38')){var _0x250bf7={};_0x250bf7[_0x4719de[_0x8c36('0x39')]]={'$like':'%'+_0x418663[_0x8c36('0x29')]['filter']+'%'};return _0x250bf7;}})});}_0x502fa3=_[_0x8c36('0x34')]({},_0x502fa3,_0x418663['options']);var _0x51960e={'where':_0x502fa3[_0x8c36('0x33')]};return db[_0x8c36('0x3a')][_0x8c36('0x18')](_0x51960e)['then'](function(_0x5a50d6){_0xb29f20[_0x8c36('0x18')]=_0x5a50d6;if(_0x418663[_0x8c36('0x29')][_0x8c36('0x3b')]){_0x502fa3['include']=[{'all':!![]}];}return db['Variable'][_0x8c36('0x3c')](_0x502fa3);})['then'](function(_0x568290){_0xb29f20[_0x8c36('0x3d')]=_0x568290;return _0xb29f20;})[_0x8c36('0x21')](respondWithFilteredResult(_0x2b5a8c,_0x502fa3))[_0x8c36('0x3e')](handleError(_0x2b5a8c,null));};exports[_0x8c36('0x3f')]=function(_0x2a0272,_0x3acf07){var _0x3033fd={'raw':!![],'where':{'id':_0x2a0272[_0x8c36('0x40')]['id']}},_0x343be6={};_0x343be6[_0x8c36('0x27')]=_['keys'](db[_0x8c36('0x3a')][_0x8c36('0x41')]);_0x343be6[_0x8c36('0x29')]=_[_0x8c36('0x28')](_0x2a0272[_0x8c36('0x29')]);_0x343be6['filters']=_[_0x8c36('0x2b')](_0x343be6[_0x8c36('0x27')],_0x343be6[_0x8c36('0x29')]);_0x3033fd[_0x8c36('0x2c')]=_[_0x8c36('0x2b')](_0x343be6[_0x8c36('0x27')],qs['fields'](_0x2a0272[_0x8c36('0x29')][_0x8c36('0x2d')]));_0x3033fd[_0x8c36('0x2c')]=_0x3033fd[_0x8c36('0x2c')][_0x8c36('0x42')]?_0x3033fd[_0x8c36('0x2c')]:_0x343be6[_0x8c36('0x27')];if(_0x2a0272['query'][_0x8c36('0x3b')]){_0x3033fd[_0x8c36('0x43')]=[{'all':!![]}];}_0x3033fd=_[_0x8c36('0x34')]({},_0x3033fd,_0x2a0272[_0x8c36('0x44')]);return db[_0x8c36('0x3a')][_0x8c36('0x45')](_0x3033fd)[_0x8c36('0x21')](handleEntityNotFound(_0x3acf07,null))[_0x8c36('0x21')](respondWithResult(_0x3acf07,null))[_0x8c36('0x3e')](handleError(_0x3acf07,null));};exports[_0x8c36('0x46')]=function(_0x1303ea,_0x114d10){return db['Variable']['create'](_0x1303ea[_0x8c36('0x47')],{})[_0x8c36('0x21')](function(_0xd46608){var _0x3e61d2=_0x1303ea['user'][_0x8c36('0x48')]({'plain':!![]});if(!_0x3e61d2)throw new Error(_0x8c36('0x49'));if(_0x3e61d2['role']==='user'){var _0x4edf8e=_0xd46608[_0x8c36('0x48')]({'plain':!![]});var _0x23189b=_0x8c36('0x23');return db[_0x8c36('0x4a')][_0x8c36('0x45')]({'where':{'name':_0x23189b,'userProfileId':_0x3e61d2[_0x8c36('0x4b')]},'raw':!![]})['then'](function(_0x3e4be4){if(_0x3e4be4&&_0x3e4be4[_0x8c36('0x4c')]===0x0){return db[_0x8c36('0x24')][_0x8c36('0x46')]({'name':_0x4edf8e['name'],'resourceId':_0x4edf8e['id'],'type':_0x3e4be4['name'],'sectionId':_0x3e4be4['id']},{})['then'](function(){return _0xd46608;});}else{return _0xd46608;}})[_0x8c36('0x3e')](function(_0x3e4b78){logger[_0x8c36('0x25')](_0x8c36('0x4d'),_0x3e4b78);throw _0x3e4b78;});}return _0xd46608;})[_0x8c36('0x21')](respondWithResult(_0x114d10,0xc9))[_0x8c36('0x3e')](handleError(_0x114d10,null));};exports[_0x8c36('0x20')]=function(_0xd2b403,_0x2c9d63){if(_0xd2b403['body']['id']){delete _0xd2b403['body']['id'];}return db[_0x8c36('0x3a')]['find']({'where':{'id':_0xd2b403['params']['id']}})[_0x8c36('0x21')](handleEntityNotFound(_0x2c9d63,null))['then'](saveUpdates(_0xd2b403[_0x8c36('0x47')],null))[_0x8c36('0x21')](respondWithResult(_0x2c9d63,null))['catch'](handleError(_0x2c9d63,null));};exports[_0x8c36('0x22')]=function(_0x5af860,_0x31fbde){return db[_0x8c36('0x3a')][_0x8c36('0x45')]({'where':{'id':_0x5af860['params']['id']}})[_0x8c36('0x21')](handleEntityNotFound(_0x31fbde,null))[_0x8c36('0x21')](removeEntity(_0x31fbde,null))[_0x8c36('0x3e')](handleError(_0x31fbde,null));};
\ No newline at end of file
+var _0xbc9d=['field','options','includeAll','findAll','rows','catch','show','params','Variable','rawAttributes','include','merge','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','limit','set','Content-Range','json','save','then','Variables','UserProfileResource','destroy','sendStatus','stack','name','send','index','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','type'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x55dfa5,_0x9ebcdd){_0x55dfa5=_0x55dfa5-0x0;var _0x5ecbbb=_0xbc9d[_0x55dfa5];return _0x5ecbbb;};'use strict';var pdf=require(_0xdbc9('0x0'));var emlformat=require(_0xdbc9('0x1'));var rimraf=require(_0xdbc9('0x2'));var zipdir=require(_0xdbc9('0x3'));var jsonpatch=require(_0xdbc9('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdbc9('0x5'));var util=require(_0xdbc9('0x6'));var path=require(_0xdbc9('0x7'));var sox=require(_0xdbc9('0x8'));var csv=require(_0xdbc9('0x9'));var ejs=require(_0xdbc9('0xa'));var fs=require('fs');var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var hardwareService=require(_0xdbc9('0x12'));var logger=require(_0xdbc9('0x13'))('api');var utils=require(_0xdbc9('0x14'));var config=require(_0xdbc9('0x15'));var db=require(_0xdbc9('0x16'))['db'];function respondWithStatusCode(_0xd026bc,_0x34a15d){_0x34a15d=_0x34a15d||0xcc;return function(_0x103d54){if(_0x103d54){return _0xd026bc['sendStatus'](_0x34a15d);}return _0xd026bc['status'](_0x34a15d)[_0xdbc9('0x17')]();};}function respondWithResult(_0x15c0a6,_0x3df2dd){_0x3df2dd=_0x3df2dd||0xc8;return function(_0x436e50){if(_0x436e50){return _0x15c0a6[_0xdbc9('0x18')](_0x3df2dd)['json'](_0x436e50);}};}function respondWithFilteredResult(_0x2b7bd,_0x1e41cf){return function(_0x3a8a7b){if(_0x3a8a7b){var _0x4c7b4f=_0x3a8a7b[_0xdbc9('0x19')],_0x1b4616=_0x1e41cf[_0xdbc9('0x1a')],_0x1abee8=_0x1e41cf[_0xdbc9('0x1a')]+_0x1e41cf[_0xdbc9('0x1b')],_0x4fdb81;if(_0x1abee8>=_0x4c7b4f){_0x1abee8=_0x4c7b4f;_0x4fdb81=0xc8;}else{_0x4fdb81=0xce;}_0x2b7bd[_0xdbc9('0x18')](_0x4fdb81);return _0x2b7bd[_0xdbc9('0x1c')](_0xdbc9('0x1d'),_0x1b4616+'-'+_0x1abee8+'/'+_0x4c7b4f)[_0xdbc9('0x1e')](_0x3a8a7b);}return null;};}function patchUpdates(_0x2ad952){return function(_0x981fc0){try{jsonpatch['apply'](_0x981fc0,_0x2ad952,!![]);}catch(_0x1ca5fd){return BPromise['reject'](_0x1ca5fd);}return _0x981fc0[_0xdbc9('0x1f')]();};}function saveUpdates(_0x124ce5,_0x510710){return function(_0x4408e9){if(_0x4408e9){return _0x4408e9['update'](_0x124ce5)['then'](function(_0x4ab00d){return _0x4ab00d;});}return null;};}function removeEntity(_0x4f3b5d,_0x2f229c){return function(_0x2011a2){if(_0x2011a2){return _0x2011a2['destroy']()[_0xdbc9('0x20')](function(){var _0x20563e=_0x2011a2['get']({'plain':!![]});var _0x1bc073=_0xdbc9('0x21');return db[_0xdbc9('0x22')][_0xdbc9('0x23')]({'where':{'type':_0x1bc073,'resourceId':_0x20563e['id']}})[_0xdbc9('0x20')](function(){return _0x2011a2;});})[_0xdbc9('0x20')](function(){_0x4f3b5d[_0xdbc9('0x18')](0xcc)[_0xdbc9('0x17')]();});}};}function handleEntityNotFound(_0x3c8c1d,_0x4a868b){return function(_0x550bef){if(!_0x550bef){_0x3c8c1d[_0xdbc9('0x24')](0x194);}return _0x550bef;};}function handleError(_0x446ab9,_0x1053ca){_0x1053ca=_0x1053ca||0x1f4;return function(_0x24fdec){logger['error'](_0x24fdec[_0xdbc9('0x25')]);if(_0x24fdec[_0xdbc9('0x26')]){delete _0x24fdec['name'];}_0x446ab9['status'](_0x1053ca)[_0xdbc9('0x27')](_0x24fdec);};}exports[_0xdbc9('0x28')]=function(_0x473430,_0x59bfd2){var _0x13a432={},_0x539e57={},_0x561f8e={'count':0x0,'rows':[]};var _0x210a40=db['Variable']['rawAttributes'];_0x539e57[_0xdbc9('0x29')]=_[_0xdbc9('0x2a')](_0x210a40);_0x539e57[_0xdbc9('0x2b')]=_['keys'](_0x473430[_0xdbc9('0x2b')]);_0x539e57[_0xdbc9('0x2c')]=_['intersection'](_0x539e57['model'],_0x539e57[_0xdbc9('0x2b')]);_0x13a432[_0xdbc9('0x2d')]=_[_0xdbc9('0x2e')](_0x539e57[_0xdbc9('0x29')],qs[_0xdbc9('0x2f')](_0x473430[_0xdbc9('0x2b')][_0xdbc9('0x2f')]));_0x13a432['attributes']=_0x13a432[_0xdbc9('0x2d')][_0xdbc9('0x30')]?_0x13a432[_0xdbc9('0x2d')]:_0x539e57[_0xdbc9('0x29')];if(!_0x473430[_0xdbc9('0x2b')][_0xdbc9('0x31')]('nolimit')){_0x13a432[_0xdbc9('0x1b')]=qs['limit'](_0x473430['query']['limit']);_0x13a432['offset']=qs['offset'](_0x473430[_0xdbc9('0x2b')][_0xdbc9('0x1a')]);}_0x13a432[_0xdbc9('0x32')]=qs['sort'](_0x473430[_0xdbc9('0x2b')][_0xdbc9('0x33')]);_0x13a432[_0xdbc9('0x34')]=qs[_0xdbc9('0x2c')](_[_0xdbc9('0x35')](_0x473430[_0xdbc9('0x2b')],_0x539e57['filters']));if(_0x473430[_0xdbc9('0x2b')][_0xdbc9('0x36')]){_0x13a432[_0xdbc9('0x34')]=_['merge'](_0x13a432[_0xdbc9('0x34')],{'$or':_[_0xdbc9('0x37')](_0x210a40,function(_0x30fa5c){if(_0x30fa5c[_0xdbc9('0x38')]['key']!=='VIRTUAL'){var _0x115ef4={};_0x115ef4[_0x30fa5c[_0xdbc9('0x39')]]={'$like':'%'+_0x473430[_0xdbc9('0x2b')][_0xdbc9('0x36')]+'%'};return _0x115ef4;}})});}_0x13a432=_['merge']({},_0x13a432,_0x473430[_0xdbc9('0x3a')]);var _0x3827be={'where':_0x13a432[_0xdbc9('0x34')]};return db['Variable'][_0xdbc9('0x19')](_0x3827be)[_0xdbc9('0x20')](function(_0x444219){_0x561f8e['count']=_0x444219;if(_0x473430[_0xdbc9('0x2b')][_0xdbc9('0x3b')]){_0x13a432['include']=[{'all':!![]}];}return db['Variable'][_0xdbc9('0x3c')](_0x13a432);})[_0xdbc9('0x20')](function(_0x387b57){_0x561f8e[_0xdbc9('0x3d')]=_0x387b57;return _0x561f8e;})['then'](respondWithFilteredResult(_0x59bfd2,_0x13a432))[_0xdbc9('0x3e')](handleError(_0x59bfd2,null));};exports[_0xdbc9('0x3f')]=function(_0x577725,_0x8445b8){var _0x1f71b1={'raw':!![],'where':{'id':_0x577725[_0xdbc9('0x40')]['id']}},_0x4e6aaf={};_0x4e6aaf[_0xdbc9('0x29')]=_[_0xdbc9('0x2a')](db[_0xdbc9('0x41')][_0xdbc9('0x42')]);_0x4e6aaf[_0xdbc9('0x2b')]=_[_0xdbc9('0x2a')](_0x577725['query']);_0x4e6aaf['filters']=_[_0xdbc9('0x2e')](_0x4e6aaf[_0xdbc9('0x29')],_0x4e6aaf[_0xdbc9('0x2b')]);_0x1f71b1[_0xdbc9('0x2d')]=_[_0xdbc9('0x2e')](_0x4e6aaf[_0xdbc9('0x29')],qs[_0xdbc9('0x2f')](_0x577725[_0xdbc9('0x2b')][_0xdbc9('0x2f')]));_0x1f71b1[_0xdbc9('0x2d')]=_0x1f71b1[_0xdbc9('0x2d')]['length']?_0x1f71b1['attributes']:_0x4e6aaf[_0xdbc9('0x29')];if(_0x577725[_0xdbc9('0x2b')][_0xdbc9('0x3b')]){_0x1f71b1[_0xdbc9('0x43')]=[{'all':!![]}];}_0x1f71b1=_[_0xdbc9('0x44')]({},_0x1f71b1,_0x577725[_0xdbc9('0x3a')]);return db[_0xdbc9('0x41')][_0xdbc9('0x45')](_0x1f71b1)['then'](handleEntityNotFound(_0x8445b8,null))['then'](respondWithResult(_0x8445b8,null))[_0xdbc9('0x3e')](handleError(_0x8445b8,null));};exports[_0xdbc9('0x46')]=function(_0x2838a3,_0xd401f){return db[_0xdbc9('0x41')][_0xdbc9('0x46')](_0x2838a3[_0xdbc9('0x47')],{})[_0xdbc9('0x20')](function(_0x43e3ec){var _0x589557=_0x2838a3[_0xdbc9('0x48')][_0xdbc9('0x49')]({'plain':!![]});if(!_0x589557)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x589557['role']===_0xdbc9('0x48')){var _0xc3db3c=_0x43e3ec[_0xdbc9('0x49')]({'plain':!![]});var _0x49a55c=_0xdbc9('0x21');return db[_0xdbc9('0x4a')][_0xdbc9('0x45')]({'where':{'name':_0x49a55c,'userProfileId':_0x589557[_0xdbc9('0x4b')]},'raw':!![]})['then'](function(_0x26964a){if(_0x26964a&&_0x26964a[_0xdbc9('0x4c')]===0x0){return db[_0xdbc9('0x22')][_0xdbc9('0x46')]({'name':_0xc3db3c['name'],'resourceId':_0xc3db3c['id'],'type':_0x26964a[_0xdbc9('0x26')],'sectionId':_0x26964a['id']},{})[_0xdbc9('0x20')](function(){return _0x43e3ec;});}else{return _0x43e3ec;}})[_0xdbc9('0x3e')](function(_0x2897ec){logger[_0xdbc9('0x4d')](_0xdbc9('0x4e'),_0x2897ec);throw _0x2897ec;});}return _0x43e3ec;})[_0xdbc9('0x20')](respondWithResult(_0xd401f,0xc9))[_0xdbc9('0x3e')](handleError(_0xd401f,null));};exports['update']=function(_0x1c6e6e,_0x4d09e1){if(_0x1c6e6e[_0xdbc9('0x47')]['id']){delete _0x1c6e6e[_0xdbc9('0x47')]['id'];}return db['Variable']['find']({'where':{'id':_0x1c6e6e[_0xdbc9('0x40')]['id']}})['then'](handleEntityNotFound(_0x4d09e1,null))[_0xdbc9('0x20')](saveUpdates(_0x1c6e6e[_0xdbc9('0x47')],null))[_0xdbc9('0x20')](respondWithResult(_0x4d09e1,null))['catch'](handleError(_0x4d09e1,null));};exports[_0xdbc9('0x23')]=function(_0x1c52e6,_0x3d8b01){return db[_0xdbc9('0x41')][_0xdbc9('0x45')]({'where':{'id':_0x1c52e6[_0xdbc9('0x40')]['id']}})[_0xdbc9('0x20')](handleEntityNotFound(_0x3d8b01,null))[_0xdbc9('0x20')](removeEntity(_0x3d8b01,null))['catch'](handleError(_0x3d8b01,null));};
\ No newline at end of file
diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js
index f9f3956..420a5fe 100644
--- a/server/api/variable/variable.model.js
+++ b/server/api/variable/variable.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5e8d=['request-promise','rimraf','../../config/environment','exports','Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2aa32b,_0x3f058c){var _0x29ae13=function(_0x331163){while(--_0x331163){_0x2aa32b['push'](_0x2aa32b['shift']());}};_0x29ae13(++_0x3f058c);}(_0x5e8d,0x11a));var _0xd5e8=function(_0x1d6855,_0x2221cd){_0x1d6855=_0x1d6855-0x0;var _0x2f369c=_0x5e8d[_0x1d6855];return _0x2f369c;};'use strict';var _=require(_0xd5e8('0x0'));var util=require(_0xd5e8('0x1'));var logger=require(_0xd5e8('0x2'))(_0xd5e8('0x3'));var moment=require(_0xd5e8('0x4'));var BPromise=require(_0xd5e8('0x5'));var rp=require(_0xd5e8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5e8('0x7'));var config=require(_0xd5e8('0x8'));var attributes=require('./variable.attributes');module[_0xd5e8('0x9')]=function(_0x2ea3be,_0x195f41){return _0x2ea3be['define'](_0xd5e8('0xa'),attributes,{'tableName':_0xd5e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf96b=['bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment'];(function(_0x569347,_0x55e1a1){var _0x4dfcf4=function(_0x1c24e0){while(--_0x1c24e0){_0x569347['push'](_0x569347['shift']());}};_0x4dfcf4(++_0x55e1a1);}(_0xf96b,0x109));var _0xbf96=function(_0x35371b,_0x7a9b18){_0x35371b=_0x35371b-0x0;var _0x2d2aa4=_0xf96b[_0x35371b];return _0x2d2aa4;};'use strict';var _=require(_0xbf96('0x0'));var util=require(_0xbf96('0x1'));var logger=require(_0xbf96('0x2'))(_0xbf96('0x3'));var moment=require(_0xbf96('0x4'));var BPromise=require(_0xbf96('0x5'));var rp=require(_0xbf96('0x6'));var fs=require('fs');var path=require(_0xbf96('0x7'));var rimraf=require(_0xbf96('0x8'));var config=require(_0xbf96('0x9'));var attributes=require(_0xbf96('0xa'));module[_0xbf96('0xb')]=function(_0x162c19,_0x4de1c3){return _0x162c19[_0xbf96('0xc')](_0xbf96('0xd'),attributes,{'tableName':_0xbf96('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js
index f2277a3..de3e138 100644
--- a/server/api/variable/variable.rpc.js
+++ b/server/api/variable/variable.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8e89=['result','catch','ShowVariable','Variable','find','options','raw','include','map','model','attributes','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','error','message','info'];(function(_0x5ecf44,_0x15dfe7){var _0x1bee63=function(_0x3c4b48){while(--_0x3c4b48){_0x5ecf44['push'](_0x5ecf44['shift']());}};_0x1bee63(++_0x15dfe7);}(_0x8e89,0x156));var _0x98e8=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0x8e89[_0x384231];return _0x2480bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x98e8('0x0'));var BPromise=require(_0x98e8('0x1'));var rs=require(_0x98e8('0x2'));var fs=require('fs');var Redis=require(_0x98e8('0x3'));var db=require(_0x98e8('0x4'))['db'];var utils=require(_0x98e8('0x5'));var logger=require(_0x98e8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x98e8('0x7'));var client=jayson[_0x98e8('0x8')][_0x98e8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b2e01,_0x549645,_0x16c5d8){return new BPromise(function(_0x2854d5,_0x5273a3){return client[_0x98e8('0xa')](_0x2b2e01,_0x16c5d8)[_0x98e8('0xb')](function(_0x120808){logger['info'](_0x98e8('0xc'),_0x549645,_0x98e8('0xd'));logger[_0x98e8('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x549645,_0x98e8('0xd'),JSON['stringify'](_0x120808));if(_0x120808[_0x98e8('0xf')]){if(_0x120808[_0x98e8('0xf')]['code']===0x1f4){logger[_0x98e8('0xf')]('Variable,\x20%s,\x20%s',_0x549645,_0x120808[_0x98e8('0xf')][_0x98e8('0x10')]);return _0x5273a3(_0x120808[_0x98e8('0xf')][_0x98e8('0x10')]);}logger['error'](_0x98e8('0xc'),_0x549645,_0x120808[_0x98e8('0xf')]['message']);return _0x2854d5(_0x120808[_0x98e8('0xf')][_0x98e8('0x10')]);}else{logger[_0x98e8('0x11')](_0x98e8('0xc'),_0x549645,_0x98e8('0xd'));_0x2854d5(_0x120808[_0x98e8('0x12')][_0x98e8('0x10')]);}})[_0x98e8('0x13')](function(_0x211a74){logger['error'](_0x98e8('0xc'),_0x549645,_0x211a74);_0x5273a3(_0x211a74);});});}exports[_0x98e8('0x14')]=function(_0x9f8fe5){var _0xfe915a=this;return new Promise(function(_0x5b69ff,_0x1277f){return db[_0x98e8('0x15')][_0x98e8('0x16')]({'raw':_0x9f8fe5[_0x98e8('0x17')]?_0x9f8fe5[_0x98e8('0x17')][_0x98e8('0x18')]===undefined?!![]:![]:!![],'where':_0x9f8fe5[_0x98e8('0x17')]?_0x9f8fe5[_0x98e8('0x17')]['where']||null:null,'attributes':_0x9f8fe5[_0x98e8('0x17')]?_0x9f8fe5['options']['attributes']||null:null,'include':_0x9f8fe5[_0x98e8('0x17')]?_0x9f8fe5[_0x98e8('0x17')][_0x98e8('0x19')]?_[_0x98e8('0x1a')](_0x9f8fe5[_0x98e8('0x17')][_0x98e8('0x19')],function(_0x41e31d){return{'model':db[_0x41e31d[_0x98e8('0x1b')]],'as':_0x41e31d['as'],'attributes':_0x41e31d[_0x98e8('0x1c')],'include':_0x41e31d[_0x98e8('0x19')]?_[_0x98e8('0x1a')](_0x41e31d[_0x98e8('0x19')],function(_0x746373){return{'model':db[_0x746373[_0x98e8('0x1b')]],'as':_0x746373['as'],'attributes':_0x746373[_0x98e8('0x1c')],'include':_0x746373[_0x98e8('0x19')]?_[_0x98e8('0x1a')](_0x746373['include'],function(_0x323be8){return{'model':db[_0x323be8['model']],'as':_0x323be8['as'],'attributes':_0x323be8['attributes']};}):[]};}):[]};}):[]:[]})[_0x98e8('0xb')](function(_0x227edd){logger[_0x98e8('0x11')](_0x98e8('0x14'),_0x9f8fe5);logger[_0x98e8('0xe')](_0x98e8('0x14'),_0x9f8fe5,JSON[_0x98e8('0x1d')](_0x227edd));_0x5b69ff(_0x227edd);})[_0x98e8('0x13')](function(_0x26ed5c){logger[_0x98e8('0xf')](_0x98e8('0x14'),_0x26ed5c[_0x98e8('0x10')],_0x9f8fe5);_0x1277f(_0xfe915a[_0x98e8('0xf')](0x1f4,_0x26ed5c[_0x98e8('0x10')]));});});};
\ No newline at end of file
+var _0x2b60=['Variable','find','options','where','include','map','model','attributes','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable'];(function(_0x26d82e,_0x4f7287){var _0x20502d=function(_0x351731){while(--_0x351731){_0x26d82e['push'](_0x26d82e['shift']());}};_0x20502d(++_0x4f7287);}(_0x2b60,0xe9));var _0x02b6=function(_0x37eb03,_0x56ca3f){_0x37eb03=_0x37eb03-0x0;var _0x23a3e2=_0x2b60[_0x37eb03];return _0x23a3e2;};'use strict';var _=require('lodash');var util=require(_0x02b6('0x0'));var moment=require(_0x02b6('0x1'));var BPromise=require(_0x02b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02b6('0x3'));var db=require(_0x02b6('0x4'))['db'];var utils=require(_0x02b6('0x5'));var logger=require(_0x02b6('0x6'))('rpc');var config=require(_0x02b6('0x7'));var jayson=require(_0x02b6('0x8'));var client=jayson[_0x02b6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17e742,_0x43e6d5,_0x49cee0){return new BPromise(function(_0x4a3f07,_0x16c92d){return client[_0x02b6('0xa')](_0x17e742,_0x49cee0)[_0x02b6('0xb')](function(_0x4a08dd){logger[_0x02b6('0xc')](_0x02b6('0xd'),_0x43e6d5,_0x02b6('0xe'));logger[_0x02b6('0xf')](_0x02b6('0x10'),_0x43e6d5,_0x02b6('0xe'),JSON[_0x02b6('0x11')](_0x4a08dd));if(_0x4a08dd[_0x02b6('0x12')]){if(_0x4a08dd[_0x02b6('0x12')][_0x02b6('0x13')]===0x1f4){logger[_0x02b6('0x12')](_0x02b6('0xd'),_0x43e6d5,_0x4a08dd[_0x02b6('0x12')]['message']);return _0x16c92d(_0x4a08dd[_0x02b6('0x12')][_0x02b6('0x14')]);}logger['error'](_0x02b6('0xd'),_0x43e6d5,_0x4a08dd['error'][_0x02b6('0x14')]);return _0x4a3f07(_0x4a08dd['error'][_0x02b6('0x14')]);}else{logger[_0x02b6('0xc')]('Variable,\x20%s,\x20%s',_0x43e6d5,_0x02b6('0xe'));_0x4a3f07(_0x4a08dd[_0x02b6('0x15')][_0x02b6('0x14')]);}})['catch'](function(_0x3663c3){logger[_0x02b6('0x12')]('Variable,\x20%s,\x20%s',_0x43e6d5,_0x3663c3);_0x16c92d(_0x3663c3);});});}exports[_0x02b6('0x16')]=function(_0x57abf7){var _0x6b9b5=this;return new Promise(function(_0x2c7352,_0x33e646){return db[_0x02b6('0x17')][_0x02b6('0x18')]({'raw':_0x57abf7['options']?_0x57abf7['options']['raw']===undefined?!![]:![]:!![],'where':_0x57abf7[_0x02b6('0x19')]?_0x57abf7[_0x02b6('0x19')][_0x02b6('0x1a')]||null:null,'attributes':_0x57abf7[_0x02b6('0x19')]?_0x57abf7[_0x02b6('0x19')]['attributes']||null:null,'include':_0x57abf7['options']?_0x57abf7[_0x02b6('0x19')][_0x02b6('0x1b')]?_[_0x02b6('0x1c')](_0x57abf7[_0x02b6('0x19')][_0x02b6('0x1b')],function(_0x414cb7){return{'model':db[_0x414cb7[_0x02b6('0x1d')]],'as':_0x414cb7['as'],'attributes':_0x414cb7['attributes'],'include':_0x414cb7[_0x02b6('0x1b')]?_[_0x02b6('0x1c')](_0x414cb7[_0x02b6('0x1b')],function(_0x1aea78){return{'model':db[_0x1aea78['model']],'as':_0x1aea78['as'],'attributes':_0x1aea78[_0x02b6('0x1e')],'include':_0x1aea78[_0x02b6('0x1b')]?_[_0x02b6('0x1c')](_0x1aea78[_0x02b6('0x1b')],function(_0x19497c){return{'model':db[_0x19497c[_0x02b6('0x1d')]],'as':_0x19497c['as'],'attributes':_0x19497c[_0x02b6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x02b6('0xb')](function(_0x1cdb28){logger[_0x02b6('0xc')](_0x02b6('0x16'),_0x57abf7);logger[_0x02b6('0xf')](_0x02b6('0x16'),_0x57abf7,JSON[_0x02b6('0x11')](_0x1cdb28));_0x2c7352(_0x1cdb28);})[_0x02b6('0x1f')](function(_0x38b3de){logger[_0x02b6('0x12')]('ShowVariable',_0x38b3de[_0x02b6('0x14')],_0x57abf7);_0x33e646(_0x6b9b5[_0x02b6('0x12')](0x1f4,_0x38b3de[_0x02b6('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/version/index.js b/server/api/version/index.js
index 6d9400d..43bec4a 100644
--- a/server/api/version/index.js
+++ b/server/api/version/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf61e=['reset','pull','/restart','restart','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset'];(function(_0x11d31c,_0x10975c){var _0x4b6a13=function(_0x117e19){while(--_0x117e19){_0x11d31c['push'](_0x11d31c['shift']());}};_0x4b6a13(++_0x10975c);}(_0xf61e,0xf6));var _0xef61=function(_0x3bbcf2,_0x12edce){_0x3bbcf2=_0x3bbcf2-0x0;var _0x10aaeb=_0xf61e[_0x3bbcf2];return _0x10aaeb;};'use strict';var express=require('express');var router=express[_0xef61('0x0')]();var auth=require(_0xef61('0x1'));var controller=require(_0xef61('0x2'));router[_0xef61('0x3')]('/',controller[_0xef61('0x4')]);router[_0xef61('0x3')](_0xef61('0x5'),auth[_0xef61('0x6')](),auth[_0xef61('0x7')](),controller[_0xef61('0x8')]);router['get'](_0xef61('0x9'),auth['isAuthenticated'](),auth[_0xef61('0x7')](),controller[_0xef61('0xa')]);router[_0xef61('0x3')]('/pull',auth['isAuthenticated'](),auth[_0xef61('0x7')](),controller[_0xef61('0xb')]);router[_0xef61('0x3')](_0xef61('0xc'),auth[_0xef61('0x6')](),controller[_0xef61('0xd')]);router[_0xef61('0x3')]('/migrations',controller[_0xef61('0xe')]);module[_0xef61('0xf')]=router;
\ No newline at end of file
+var _0x0c50=['isAuthenticated','reset','pull','restart','migrations','../../components/auth/service','./version.controller','get','index','/fetch','canUpdate'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x0c50,0x139));var _0x00c5=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x0c50[_0xf50820];return _0x2a9b10;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x00c5('0x0'));var controller=require(_0x00c5('0x1'));router[_0x00c5('0x2')]('/',controller[_0x00c5('0x3')]);router['get'](_0x00c5('0x4'),auth['isAuthenticated'](),auth[_0x00c5('0x5')](),controller['fetch']);router[_0x00c5('0x2')]('/reset',auth[_0x00c5('0x6')](),auth[_0x00c5('0x5')](),controller[_0x00c5('0x7')]);router[_0x00c5('0x2')]('/pull',auth[_0x00c5('0x6')](),auth[_0x00c5('0x5')](),controller[_0x00c5('0x8')]);router[_0x00c5('0x2')]('/restart',auth['isAuthenticated'](),controller[_0x00c5('0x9')]);router[_0x00c5('0x2')]('/migrations',controller[_0x00c5('0xa')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js
index 3315b91..0fbca98 100644
--- a/server/api/version/version.controller.js
+++ b/server/api/version/version.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8bea=['status','json','origin','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','.js','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','fetch','tags','exports','latest','2.0.0'];(function(_0x337441,_0x58e955){var _0x544ad7=function(_0x1e0eb4){while(--_0x1e0eb4){_0x337441['push'](_0x337441['shift']());}};_0x544ad7(++_0x58e955);}(_0x8bea,0x132));var _0xa8be=function(_0x4cffd0,_0x43de82){_0x4cffd0=_0x4cffd0-0x0;var _0x12ac47=_0x8bea[_0x4cffd0];return _0x12ac47;};'use strict';var Umzug=require(_0xa8be('0x0'));var path=require(_0xa8be('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0xa8be('0x2'));var compareVersions=require(_0xa8be('0x3'));var exec=require(_0xa8be('0x4'))[_0xa8be('0x5')];var db=require(_0xa8be('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xa8be('0x7'));var logger=require(_0xa8be('0x8'))(_0xa8be('0x9'));var git=require(_0xa8be('0xa'))(config[_0xa8be('0xb')]);exports[_0xa8be('0xc')]=function(_0x4624f6,_0x96917d){var _0x5d7f2d={'current':module['exports'][_0xa8be('0x2')],'phonebar':0x2};if(_0x4624f6['query']&&_0x4624f6['query']['latest']){return git[_0xa8be('0xd')]()[_0xa8be('0xe')](function(_0x43cb95,_0xc76b97){_0x5d7f2d['latest']=(_0x43cb95?module[_0xa8be('0xf')][_0xa8be('0x2')]:_0xc76b97[_0xa8be('0x10')])||_0xa8be('0x11');return _0x96917d[_0xa8be('0x12')](0xc8)['json'](_0x5d7f2d);});}else{return _0x96917d[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')](_0x5d7f2d);}};exports[_0xa8be('0xd')]=function(_0x3d1893,_0x4c9ef9){return git[_0xa8be('0xd')]([_0xa8be('0x14'),'master'],function(_0x2cdd88){if(_0x2cdd88){logger[_0xa8be('0x15')](_0x2cdd88);return _0x4c9ef9[_0xa8be('0x12')](0x1f4)['json'](_0x2cdd88);}logger[_0xa8be('0x16')]('git\x20fetch');return _0x4c9ef9[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':_0xa8be('0x17')});});};exports[_0xa8be('0x18')]=function(_0x204598,_0x284461){return git[_0xa8be('0x18')]([_0xa8be('0x19'),_0xa8be('0x1a')],function(_0x26230c){if(_0x26230c){logger[_0xa8be('0x15')](_0x26230c);return _0x284461[_0xa8be('0x12')](0x1f4)[_0xa8be('0x13')](_0x26230c);}logger[_0xa8be('0x16')](_0xa8be('0x1b'));return _0x284461[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':_0xa8be('0x1c')});});};exports[_0xa8be('0x1d')]=function(_0x264e5a,_0x49be0e){exec(_0xa8be('0x1e'),function(_0x463588,_0x218a2f,_0x307ad3){logger[_0xa8be('0x16')](_0x218a2f);logger[_0xa8be('0x16')](_0x307ad3);if(_0x463588){logger['error'](_0x463588);return _0x49be0e[_0xa8be('0x12')](0x1f4)[_0xa8be('0x13')](_0x463588);}return _0x49be0e['status'](0xc8)[_0xa8be('0x13')]({'output':_0x218a2f});});};exports[_0xa8be('0x1f')]=function(_0x5cfbb8,_0xd75b99){return pm2[_0xa8be('0x1f')](_0xa8be('0x20'))[_0xa8be('0x21')](function(_0x141401){logger[_0xa8be('0x16')](_0xa8be('0x22'),_0x141401);return _0xd75b99[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xa8be('0x23')](function(_0xfe7ced){logger['error'](_0xfe7ced);return _0xd75b99[_0xa8be('0x12')](0x1f4)['json'](_0xfe7ced);});};exports[_0xa8be('0x24')]=function(_0x5d6391,_0x294522){var _0x28620e=fs[_0xa8be('0x25')](path[_0xa8be('0x26')](config[_0xa8be('0xb')],_0xa8be('0x27'),_0xa8be('0x24')));var _0x510d49=[];for(var _0x4bc671=0x0;_0x4bc671<_0x28620e['length'];_0x4bc671++){var _0x27a520=_0x28620e[_0x4bc671]['replace'](_0xa8be('0x28'),'');if(compareVersions(module[_0xa8be('0xf')][_0xa8be('0x2')],_0x27a520)===-0x1){_0x510d49['push'](_0x27a520);}}if(_0x510d49[_0xa8be('0x29')]){var _0x9e9c43=_0x510d49[_0xa8be('0x2a')](compareVersions);var _0x4e15b1=new Umzug({'storage':_0xa8be('0x2b'),'storageOptions':{'model':db[_0xa8be('0x2c')],'modelName':'Migration','columnName':_0xa8be('0x2')},'migrations':{'params':[db[_0xa8be('0x2b')][_0xa8be('0x2d')](),db['sequelize'][_0xa8be('0x2e')],function(){throw new Error(_0xa8be('0x2f'));}],'path':path[_0xa8be('0x26')](config[_0xa8be('0xb')],_0xa8be('0x27'),_0xa8be('0x24')),'pattern':/\.js$/}});_0x4e15b1['up']({'migrations':_[_0xa8be('0x30')](_0x9e9c43,function(_0xca81e2){return _0xca81e2+_0xa8be('0x28');})})[_0xa8be('0x21')](function(){return _0x294522[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':_0xa8be('0x31')+module[_0xa8be('0xf')][_0xa8be('0x2')]+_0xa8be('0x32')+_[_0xa8be('0x33')](_0x9e9c43),'migrations':_[_0xa8be('0x26')](_0x9e9c43)});})[_0xa8be('0x23')](function(_0x27a3dc){if(_0x27a3dc instanceof db['sequelize'][_0xa8be('0x34')]){return _0x294522[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x294522['status'](0x1f4)[_0xa8be('0x13')](_0x27a3dc);}});}else{return _0x294522[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':_0xa8be('0x35')});}};
\ No newline at end of file
+var _0x0203=['git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','json','status','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD'];(function(_0xf98d20,_0x39a333){var _0x496c3d=function(_0x30c2a8){while(--_0x30c2a8){_0xf98d20['push'](_0xf98d20['shift']());}};_0x496c3d(++_0x39a333);}(_0x0203,0x164));var _0x3020=function(_0x1dbfb2,_0x2ea4d6){_0x1dbfb2=_0x1dbfb2-0x0;var _0x24af26=_0x0203[_0x1dbfb2];return _0x24af26;};'use strict';var Umzug=require(_0x3020('0x0'));var path=require(_0x3020('0x1'));var fs=require('fs');var _=require(_0x3020('0x2'));var pkginfo=require(_0x3020('0x3'))(module,_0x3020('0x4'));var compareVersions=require(_0x3020('0x5'));var exec=require(_0x3020('0x6'))['exec'];var db=require(_0x3020('0x7'))['db'];var config=require('../../config/environment');var pm2=require(_0x3020('0x8'));var logger=require(_0x3020('0x9'))(_0x3020('0xa'));var git=require(_0x3020('0xb'))(config[_0x3020('0xc')]);exports[_0x3020('0xd')]=function(_0x107094,_0x621af6){var _0x5b4ac2={'current':module[_0x3020('0xe')]['version'],'phonebar':0x2};if(_0x107094[_0x3020('0xf')]&&_0x107094[_0x3020('0xf')][_0x3020('0x10')]){return git[_0x3020('0x11')]()['tags'](function(_0x295a82,_0x840672){_0x5b4ac2[_0x3020('0x10')]=(_0x295a82?module['exports']['version']:_0x840672[_0x3020('0x10')])||'2.0.0';return _0x621af6['status'](0xc8)[_0x3020('0x12')](_0x5b4ac2);});}else{return _0x621af6[_0x3020('0x13')](0xc8)[_0x3020('0x12')](_0x5b4ac2);}};exports[_0x3020('0x11')]=function(_0x2927c5,_0xe011e7){return git[_0x3020('0x11')]([_0x3020('0x14'),_0x3020('0x15')],function(_0xea3221){if(_0xea3221){logger[_0x3020('0x16')](_0xea3221);return _0xe011e7[_0x3020('0x13')](0x1f4)[_0x3020('0x12')](_0xea3221);}logger[_0x3020('0x17')](_0x3020('0x18'));return _0xe011e7[_0x3020('0x13')](0xc8)[_0x3020('0x12')]({'output':_0x3020('0x19')});});};exports[_0x3020('0x1a')]=function(_0x453921,_0x1ddf87){return git[_0x3020('0x1a')]([_0x3020('0x1b'),_0x3020('0x1c')],function(_0x100134){if(_0x100134){logger[_0x3020('0x16')](_0x100134);return _0x1ddf87['status'](0x1f4)[_0x3020('0x12')](_0x100134);}logger[_0x3020('0x17')](_0x3020('0x1d'));return _0x1ddf87[_0x3020('0x13')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x3020('0x1e')]=function(_0x5e817d,_0x5b961f){exec(_0x3020('0x1f'),function(_0x4d464e,_0x1dd0ae,_0x38d564){logger['info'](_0x1dd0ae);logger[_0x3020('0x17')](_0x38d564);if(_0x4d464e){logger[_0x3020('0x16')](_0x4d464e);return _0x5b961f['status'](0x1f4)['json'](_0x4d464e);}return _0x5b961f[_0x3020('0x13')](0xc8)[_0x3020('0x12')]({'output':_0x1dd0ae});});};exports[_0x3020('0x20')]=function(_0x1a35fd,_0x54bd5d){return pm2['restart']('motion2')[_0x3020('0x21')](function(_0x16d202){logger[_0x3020('0x17')](_0x3020('0x22'),_0x16d202);return _0x54bd5d[_0x3020('0x13')](0xc8)[_0x3020('0x12')]({'output':_0x3020('0x23')});})[_0x3020('0x24')](function(_0x5755ad){logger[_0x3020('0x16')](_0x5755ad);return _0x54bd5d['status'](0x1f4)[_0x3020('0x12')](_0x5755ad);});};exports[_0x3020('0x25')]=function(_0x3a146e,_0x237988){var _0x48c3e1=fs[_0x3020('0x26')](path[_0x3020('0x27')](config[_0x3020('0xc')],_0x3020('0x28'),_0x3020('0x25')));var _0x348443=[];for(var _0x36baee=0x0;_0x36baee<_0x48c3e1[_0x3020('0x29')];_0x36baee++){var _0x131fbd=_0x48c3e1[_0x36baee]['replace'](_0x3020('0x2a'),'');if(compareVersions(module[_0x3020('0xe')][_0x3020('0x4')],_0x131fbd)===-0x1){_0x348443[_0x3020('0x2b')](_0x131fbd);}}if(_0x348443[_0x3020('0x29')]){var _0x2d1574=_0x348443[_0x3020('0x2c')](compareVersions);var _0x1d2fc4=new Umzug({'storage':_0x3020('0x2d'),'storageOptions':{'model':db[_0x3020('0x2e')],'modelName':'Migration','columnName':_0x3020('0x4')},'migrations':{'params':[db[_0x3020('0x2d')][_0x3020('0x2f')](),db[_0x3020('0x2d')][_0x3020('0x30')],function(){throw new Error(_0x3020('0x31'));}],'path':path['join'](config[_0x3020('0xc')],_0x3020('0x28'),_0x3020('0x25')),'pattern':/\.js$/}});_0x1d2fc4['up']({'migrations':_['map'](_0x2d1574,function(_0x127fdf){return _0x127fdf+_0x3020('0x2a');})})['then'](function(){return _0x237988[_0x3020('0x13')](0xc8)['json']({'output':_0x3020('0x32')+module[_0x3020('0xe')][_0x3020('0x4')]+_0x3020('0x33')+_[_0x3020('0x34')](_0x2d1574),'migrations':_[_0x3020('0x27')](_0x2d1574)});})[_0x3020('0x24')](function(_0x146f7e){if(_0x146f7e instanceof db[_0x3020('0x2d')][_0x3020('0x35')]){return _0x237988[_0x3020('0x13')](0xc8)[_0x3020('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x237988[_0x3020('0x13')](0x1f4)[_0x3020('0x12')](_0x146f7e);}});}else{return _0x237988[_0x3020('0x13')](0xc8)[_0x3020('0x12')]({'output':_0x3020('0x36')});}};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js
index 969a2b0..ab91da4 100644
--- a/server/api/voiceAgentReport/index.js
+++ b/server/api/voiceAgentReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','/describe','describe','/:id','isAuthenticated','show','create','put','destroy'];(function(_0x1306f3,_0x1da761){var _0xc1c7bf=function(_0x1ca08e){while(--_0x1ca08e){_0x1306f3['push'](_0x1306f3['shift']());}};_0xc1c7bf(++_0x1da761);}(_0x1261,0x144));var _0x1126=function(_0x41eb44,_0x229d85){_0x41eb44=_0x41eb44-0x0;var _0x334ba7=_0x1261[_0x41eb44];return _0x334ba7;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1126('0x9')](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0xb')]);router[_0x1126('0x9')](_0x1126('0xc'),auth[_0x1126('0xd')](),controller[_0x1126('0xe')]);router['post']('/',auth[_0x1126('0xd')](),controller[_0x1126('0xf')]);router[_0x1126('0x10')]('/:id',auth[_0x1126('0xd')](),controller['update']);router['delete'](_0x1126('0xc'),auth['isAuthenticated'](),controller[_0x1126('0x11')]);module[_0x1126('0x12')]=router;
\ No newline at end of file
+var _0x7046=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x3f5a67,_0x5a49cf){var _0x317103=function(_0x25a639){while(--_0x25a639){_0x3f5a67['push'](_0x3f5a67['shift']());}};_0x317103(++_0x5a49cf);}(_0x7046,0x144));var _0x6704=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x7046[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var auth=require(_0x6704('0x5'));var interaction=require(_0x6704('0x6'));var config=require('../../config/environment');var controller=require(_0x6704('0x7'));router[_0x6704('0x8')]('/',auth[_0x6704('0x9')](),controller[_0x6704('0xa')]);router[_0x6704('0x8')]('/describe',auth[_0x6704('0x9')](),controller['describe']);router['get'](_0x6704('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6704('0xc')]('/',auth[_0x6704('0x9')](),controller[_0x6704('0xd')]);router[_0x6704('0xe')](_0x6704('0xb'),auth[_0x6704('0x9')](),controller[_0x6704('0xf')]);router[_0x6704('0x10')]('/:id',auth[_0x6704('0x9')](),controller[_0x6704('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js
index c422d2a..f4ab38c 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe1a5=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe1a5,0xd7));var _0x5e1a=function(_0x184902,_0x271a88){_0x184902=_0x184902-0x0;var _0x38de0c=_0xe1a5[_0x184902];return _0x38de0c;};'use strict';var Sequelize=require(_0x5e1a('0x0'));module[_0x5e1a('0x1')]={'type':{'type':Sequelize[_0x5e1a('0x2')]},'uniqueid':{'type':Sequelize[_0x5e1a('0x2')]},'calleridnum':{'type':Sequelize[_0x5e1a('0x2')]},'calleridname':{'type':Sequelize[_0x5e1a('0x2')]},'queue':{'type':Sequelize[_0x5e1a('0x2')]},'interface':{'type':Sequelize[_0x5e1a('0x2')]},'membername':{'type':Sequelize[_0x5e1a('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x5e1a('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x5e1a('0x3')]},'agentdumpAt':{'type':Sequelize[_0x5e1a('0x3')]},'holdtime':{'type':Sequelize[_0x5e1a('0x4')]},'agentcomplete':{'type':Sequelize[_0x5e1a('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x5e1a('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5e1a('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5e1a('0x4')]},'agentacw':{'type':Sequelize[_0x5e1a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x5e1a('0x2')]},'lastevent':{'type':Sequelize[_0x5e1a('0x2')]},'channel':{'type':Sequelize[_0x5e1a('0x2')]},'channelstate':{'type':Sequelize[_0x5e1a('0x4')]},'channelstatedesc':{'type':Sequelize[_0x5e1a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5e1a('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5e1a('0x2')]},'accountcode':{'type':Sequelize[_0x5e1a('0x2')]},'context':{'type':Sequelize[_0x5e1a('0x2')]},'exten':{'type':Sequelize[_0x5e1a('0x2')]},'priority':{'type':Sequelize[_0x5e1a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x5e1a('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x5e1a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5e1a('0x2')]},'destcalleridname':{'type':Sequelize[_0x5e1a('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x5e1a('0x2')]},'destlanguage':{'type':Sequelize[_0x5e1a('0x2')]},'destaccountcode':{'type':Sequelize[_0x5e1a('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x5e1a('0x2')]},'destpriority':{'type':Sequelize[_0x5e1a('0x2')]},'destuniqueid':{'type':Sequelize[_0x5e1a('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x5e1a('0x2')]},'transfer':{'type':Sequelize[_0x5e1a('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5e1a('0x2')],'comment':_0x5e1a('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x5e1a('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xce74=['exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x348dcf,_0x3397d5){var _0x57dd19=function(_0xbe6e05){while(--_0xbe6e05){_0x348dcf['push'](_0x348dcf['shift']());}};_0x57dd19(++_0x3397d5);}(_0xce74,0x154));var _0x4ce7=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xce74[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require('sequelize');module[_0x4ce7('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4ce7('0x1')]},'calleridnum':{'type':Sequelize[_0x4ce7('0x1')]},'calleridname':{'type':Sequelize[_0x4ce7('0x1')]},'queue':{'type':Sequelize[_0x4ce7('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4ce7('0x1')]},'agentcalledAt':{'type':Sequelize[_0x4ce7('0x2')]},'agentconnectAt':{'type':Sequelize[_0x4ce7('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x4ce7('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x4ce7('0x2')]},'agentdumpAt':{'type':Sequelize[_0x4ce7('0x2')]},'holdtime':{'type':Sequelize[_0x4ce7('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4ce7('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4ce7('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x4ce7('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x4ce7('0x1')]},'lastevent':{'type':Sequelize[_0x4ce7('0x1')]},'channel':{'type':Sequelize[_0x4ce7('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x4ce7('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4ce7('0x1')]},'connectedlinename':{'type':Sequelize[_0x4ce7('0x1')]},'language':{'type':Sequelize[_0x4ce7('0x1')]},'accountcode':{'type':Sequelize[_0x4ce7('0x1')]},'context':{'type':Sequelize[_0x4ce7('0x1')]},'exten':{'type':Sequelize[_0x4ce7('0x1')]},'priority':{'type':Sequelize[_0x4ce7('0x1')]},'destchannel':{'type':Sequelize[_0x4ce7('0x1')]},'destchannelstate':{'type':Sequelize[_0x4ce7('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x4ce7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x4ce7('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x4ce7('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4ce7('0x1')]},'destlanguage':{'type':Sequelize[_0x4ce7('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x4ce7('0x1')]},'destexten':{'type':Sequelize[_0x4ce7('0x1')]},'destpriority':{'type':Sequelize[_0x4ce7('0x1')]},'destuniqueid':{'type':Sequelize[_0x4ce7('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4ce7('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x4ce7('0x1')]},'transferuniqueid':{'type':Sequelize[_0x4ce7('0x1')]},'agententerreason':{'type':Sequelize[_0x4ce7('0x3')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js
index 3ecfb88..5fee442 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.controller.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfdde=['save','then','destroy','error','stack','name','send','index','VoiceAgentReport','rawAttributes','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','key','field','merge','includeAll','include','findAll','rows','catch','show','params','fields','create','body','update','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x3aa657,_0x14a170){var _0x2802c7=function(_0xc8832a){while(--_0xc8832a){_0x3aa657['push'](_0x3aa657['shift']());}};_0x2802c7(++_0x14a170);}(_0xfdde,0x104));var _0xefdd=function(_0x57e196,_0x428408){_0x57e196=_0x57e196-0x0;var _0x5941ab=_0xfdde[_0x57e196];return _0x5941ab;};'use strict';var pdf=require(_0xefdd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xefdd('0x1'));var zipdir=require(_0xefdd('0x2'));var jsonpatch=require(_0xefdd('0x3'));var rp=require(_0xefdd('0x4'));var moment=require('moment');var BPromise=require(_0xefdd('0x5'));var Mustache=require(_0xefdd('0x6'));var util=require(_0xefdd('0x7'));var path=require(_0xefdd('0x8'));var sox=require(_0xefdd('0x9'));var csv=require(_0xefdd('0xa'));var ejs=require(_0xefdd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xefdd('0xc'));var crypto=require(_0xefdd('0xd'));var jsforce=require(_0xefdd('0xe'));var deskjs=require(_0xefdd('0xf'));var toCsv=require(_0xefdd('0xa'));var querystring=require('querystring');var Papa=require(_0xefdd('0x10'));var Redis=require(_0xefdd('0x11'));var authService=require(_0xefdd('0x12'));var qs=require(_0xefdd('0x13'));var hardwareService=require(_0xefdd('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e2dc5,_0x590363){_0x590363=_0x590363||0xcc;return function(_0x1f22a1){if(_0x1f22a1){return _0x5e2dc5[_0xefdd('0x15')](_0x590363);}return _0x5e2dc5[_0xefdd('0x16')](_0x590363)[_0xefdd('0x17')]();};}function respondWithResult(_0x9c8ab7,_0x4e6df9){_0x4e6df9=_0x4e6df9||0xc8;return function(_0x3c0d85){if(_0x3c0d85){return _0x9c8ab7[_0xefdd('0x16')](_0x4e6df9)[_0xefdd('0x18')](_0x3c0d85);}};}function respondWithFilteredResult(_0xa68fe5,_0x2d1a68){return function(_0x26124a){if(_0x26124a){var _0x3c3f99=_0x26124a[_0xefdd('0x19')],_0x375a6d=_0x2d1a68[_0xefdd('0x1a')],_0x10f46c=_0x2d1a68[_0xefdd('0x1a')]+_0x2d1a68[_0xefdd('0x1b')],_0x385d93;if(_0x10f46c>=_0x3c3f99){_0x10f46c=_0x3c3f99;_0x385d93=0xc8;}else{_0x385d93=0xce;}_0xa68fe5[_0xefdd('0x16')](_0x385d93);return _0xa68fe5[_0xefdd('0x1c')](_0xefdd('0x1d'),_0x375a6d+'-'+_0x10f46c+'/'+_0x3c3f99)[_0xefdd('0x18')](_0x26124a);}return null;};}function patchUpdates(_0x5172f7){return function(_0x2a05ff){try{jsonpatch[_0xefdd('0x1e')](_0x2a05ff,_0x5172f7,!![]);}catch(_0x4cb48f){return BPromise[_0xefdd('0x1f')](_0x4cb48f);}return _0x2a05ff[_0xefdd('0x20')]();};}function saveUpdates(_0x1bb7db,_0x279e69){return function(_0x43d729){if(_0x43d729){return _0x43d729['update'](_0x1bb7db)[_0xefdd('0x21')](function(_0x48fa76){return _0x48fa76;});}return null;};}function removeEntity(_0x12fbb7,_0x45c2c7){return function(_0x403f80){if(_0x403f80){return _0x403f80[_0xefdd('0x22')]()[_0xefdd('0x21')](function(){_0x12fbb7['status'](0xcc)[_0xefdd('0x17')]();});}};}function handleEntityNotFound(_0x7eff74,_0x204df4){return function(_0x12446c){if(!_0x12446c){_0x7eff74[_0xefdd('0x15')](0x194);}return _0x12446c;};}function handleError(_0x4650b5,_0x2de0e2){_0x2de0e2=_0x2de0e2||0x1f4;return function(_0x4cef25){logger[_0xefdd('0x23')](_0x4cef25[_0xefdd('0x24')]);if(_0x4cef25[_0xefdd('0x25')]){delete _0x4cef25[_0xefdd('0x25')];}_0x4650b5[_0xefdd('0x16')](_0x2de0e2)[_0xefdd('0x26')](_0x4cef25);};}exports[_0xefdd('0x27')]=function(_0x5e0642,_0x521db4){var _0x1aec1d={},_0x1dac48={},_0x17caff={'count':0x0,'rows':[]};var _0x114a06=db[_0xefdd('0x28')][_0xefdd('0x29')];_0x1dac48[_0xefdd('0x2a')]=_['keys'](_0x114a06);_0x1dac48[_0xefdd('0x2b')]=_[_0xefdd('0x2c')](_0x5e0642[_0xefdd('0x2b')]);_0x1dac48[_0xefdd('0x2d')]=_[_0xefdd('0x2e')](_0x1dac48[_0xefdd('0x2a')],_0x1dac48['query']);_0x1aec1d[_0xefdd('0x2f')]=_[_0xefdd('0x2e')](_0x1dac48[_0xefdd('0x2a')],qs['fields'](_0x5e0642[_0xefdd('0x2b')]['fields']));_0x1aec1d[_0xefdd('0x2f')]=_0x1aec1d['attributes'][_0xefdd('0x30')]?_0x1aec1d[_0xefdd('0x2f')]:_0x1dac48['model'];if(!_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x31')](_0xefdd('0x32'))){_0x1aec1d[_0xefdd('0x1b')]=qs['limit'](_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x1b')]);_0x1aec1d[_0xefdd('0x1a')]=qs['offset'](_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x1a')]);}_0x1aec1d[_0xefdd('0x33')]=qs[_0xefdd('0x34')](_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x34')]);_0x1aec1d['where']=qs[_0xefdd('0x2d')](_[_0xefdd('0x35')](_0x5e0642[_0xefdd('0x2b')],_0x1dac48['filters']));if(_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x36')]){_0x1aec1d[_0xefdd('0x37')]=_['merge'](_0x1aec1d['where'],{'$or':_[_0xefdd('0x38')](_0x114a06,function(_0x5a5aef){if(_0x5a5aef['type'][_0xefdd('0x39')]!=='VIRTUAL'){var _0x2c6c47={};_0x2c6c47[_0x5a5aef[_0xefdd('0x3a')]]={'$like':'%'+_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x36')]+'%'};return _0x2c6c47;}})});}_0x1aec1d=_[_0xefdd('0x3b')]({},_0x1aec1d,_0x5e0642['options']);var _0x5f4730={'where':_0x1aec1d['where']};return db['VoiceAgentReport'][_0xefdd('0x19')](_0x5f4730)[_0xefdd('0x21')](function(_0xf14967){_0x17caff[_0xefdd('0x19')]=_0xf14967;if(_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x3c')]){_0x1aec1d[_0xefdd('0x3d')]=[{'all':!![]}];}return db[_0xefdd('0x28')][_0xefdd('0x3e')](_0x1aec1d);})[_0xefdd('0x21')](function(_0x5b8873){_0x17caff[_0xefdd('0x3f')]=_0x5b8873;return _0x17caff;})[_0xefdd('0x21')](respondWithFilteredResult(_0x521db4,_0x1aec1d))[_0xefdd('0x40')](handleError(_0x521db4,null));};exports[_0xefdd('0x41')]=function(_0x5d7322,_0x4ff923){var _0x59e534={'raw':![],'where':{'id':_0x5d7322[_0xefdd('0x42')]['id']}},_0x2c6b6a={};_0x2c6b6a[_0xefdd('0x2a')]=_[_0xefdd('0x2c')](db[_0xefdd('0x28')]['rawAttributes']);_0x2c6b6a['query']=_[_0xefdd('0x2c')](_0x5d7322[_0xefdd('0x2b')]);_0x2c6b6a['filters']=_[_0xefdd('0x2e')](_0x2c6b6a[_0xefdd('0x2a')],_0x2c6b6a['query']);_0x59e534[_0xefdd('0x2f')]=_['intersection'](_0x2c6b6a[_0xefdd('0x2a')],qs[_0xefdd('0x43')](_0x5d7322[_0xefdd('0x2b')][_0xefdd('0x43')]));_0x59e534[_0xefdd('0x2f')]=_0x59e534[_0xefdd('0x2f')][_0xefdd('0x30')]?_0x59e534[_0xefdd('0x2f')]:_0x2c6b6a[_0xefdd('0x2a')];if(_0x5d7322[_0xefdd('0x2b')][_0xefdd('0x3c')]){_0x59e534[_0xefdd('0x3d')]=[{'all':!![]}];}_0x59e534=_[_0xefdd('0x3b')]({},_0x59e534,_0x5d7322['options']);return db['VoiceAgentReport']['find'](_0x59e534)['then'](handleEntityNotFound(_0x4ff923,null))[_0xefdd('0x21')](respondWithResult(_0x4ff923,null))['catch'](handleError(_0x4ff923,null));};exports[_0xefdd('0x44')]=function(_0x4e4448,_0x5634ee){return db[_0xefdd('0x28')]['create'](_0x4e4448[_0xefdd('0x45')],{})[_0xefdd('0x21')](respondWithResult(_0x5634ee,0xc9))[_0xefdd('0x40')](handleError(_0x5634ee,null));};exports[_0xefdd('0x46')]=function(_0x2b0521,_0x5d2ce1){if(_0x2b0521[_0xefdd('0x45')]['id']){delete _0x2b0521[_0xefdd('0x45')]['id'];}return db['VoiceAgentReport']['find']({'where':{'id':_0x2b0521[_0xefdd('0x42')]['id']}})[_0xefdd('0x21')](handleEntityNotFound(_0x5d2ce1,null))[_0xefdd('0x21')](saveUpdates(_0x2b0521[_0xefdd('0x45')],null))[_0xefdd('0x21')](respondWithResult(_0x5d2ce1,null))['catch'](handleError(_0x5d2ce1,null));};exports['destroy']=function(_0x2a1fac,_0x125f3){return db[_0xefdd('0x28')][_0xefdd('0x47')]({'where':{'id':_0x2a1fac['params']['id']}})['then'](handleEntityNotFound(_0x125f3,null))[_0xefdd('0x21')](removeEntity(_0x125f3,null))[_0xefdd('0x40')](handleError(_0x125f3,null));};exports[_0xefdd('0x48')]=function(_0x39453a,_0x31c50a){return db[_0xefdd('0x28')]['describe']()['then'](respondWithResult(_0x31c50a,null))[_0xefdd('0x40')](handleError(_0x31c50a,null));};
\ No newline at end of file
+var _0xbe19=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','length','create','body','find','describe','html-pdf','eml-format'];(function(_0x39be3d,_0x1f9980){var _0x559201=function(_0x459627){while(--_0x459627){_0x39be3d['push'](_0x39be3d['shift']());}};_0x559201(++_0x1f9980);}(_0xbe19,0x126));var _0x9be1=function(_0x525367,_0x3bf165){_0x525367=_0x525367-0x0;var _0x25bb61=_0xbe19[_0x525367];return _0x25bb61;};'use strict';var pdf=require(_0x9be1('0x0'));var emlformat=require(_0x9be1('0x1'));var rimraf=require(_0x9be1('0x2'));var zipdir=require(_0x9be1('0x3'));var jsonpatch=require(_0x9be1('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9be1('0x5'));var Mustache=require(_0x9be1('0x6'));var util=require(_0x9be1('0x7'));var path=require(_0x9be1('0x8'));var sox=require(_0x9be1('0x9'));var csv=require(_0x9be1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9be1('0xb'));var squel=require(_0x9be1('0xc'));var crypto=require(_0x9be1('0xd'));var jsforce=require(_0x9be1('0xe'));var deskjs=require(_0x9be1('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9be1('0x10'));var Redis=require(_0x9be1('0x11'));var authService=require(_0x9be1('0x12'));var qs=require(_0x9be1('0x13'));var hardwareService=require(_0x9be1('0x14'));var logger=require(_0x9be1('0x15'))(_0x9be1('0x16'));var utils=require(_0x9be1('0x17'));var config=require(_0x9be1('0x18'));var db=require(_0x9be1('0x19'))['db'];function respondWithStatusCode(_0x30270a,_0x5b4f09){_0x5b4f09=_0x5b4f09||0xcc;return function(_0x4f141d){if(_0x4f141d){return _0x30270a[_0x9be1('0x1a')](_0x5b4f09);}return _0x30270a[_0x9be1('0x1b')](_0x5b4f09)[_0x9be1('0x1c')]();};}function respondWithResult(_0x421782,_0x72af8){_0x72af8=_0x72af8||0xc8;return function(_0x4da3ae){if(_0x4da3ae){return _0x421782[_0x9be1('0x1b')](_0x72af8)['json'](_0x4da3ae);}};}function respondWithFilteredResult(_0x4a34ec,_0x1169c8){return function(_0x50ff6f){if(_0x50ff6f){var _0x8ec23d=_0x50ff6f['count'],_0x36fd82=_0x1169c8[_0x9be1('0x1d')],_0xa8f993=_0x1169c8[_0x9be1('0x1d')]+_0x1169c8[_0x9be1('0x1e')],_0x2bc588;if(_0xa8f993>=_0x8ec23d){_0xa8f993=_0x8ec23d;_0x2bc588=0xc8;}else{_0x2bc588=0xce;}_0x4a34ec[_0x9be1('0x1b')](_0x2bc588);return _0x4a34ec[_0x9be1('0x1f')](_0x9be1('0x20'),_0x36fd82+'-'+_0xa8f993+'/'+_0x8ec23d)[_0x9be1('0x21')](_0x50ff6f);}return null;};}function patchUpdates(_0x2b7c3b){return function(_0xa8a367){try{jsonpatch['apply'](_0xa8a367,_0x2b7c3b,!![]);}catch(_0x3a6583){return BPromise[_0x9be1('0x22')](_0x3a6583);}return _0xa8a367['save']();};}function saveUpdates(_0x1cff6d,_0x46a3c4){return function(_0xa64e6f){if(_0xa64e6f){return _0xa64e6f[_0x9be1('0x23')](_0x1cff6d)[_0x9be1('0x24')](function(_0x1d48b6){return _0x1d48b6;});}return null;};}function removeEntity(_0x21b2b8,_0x4f98e7){return function(_0x56acce){if(_0x56acce){return _0x56acce[_0x9be1('0x25')]()[_0x9be1('0x24')](function(){_0x21b2b8['status'](0xcc)[_0x9be1('0x1c')]();});}};}function handleEntityNotFound(_0x2de60c,_0x5f5b0a){return function(_0x412461){if(!_0x412461){_0x2de60c[_0x9be1('0x1a')](0x194);}return _0x412461;};}function handleError(_0x5e4298,_0x341618){_0x341618=_0x341618||0x1f4;return function(_0xc6d86){logger['error'](_0xc6d86[_0x9be1('0x26')]);if(_0xc6d86[_0x9be1('0x27')]){delete _0xc6d86['name'];}_0x5e4298[_0x9be1('0x1b')](_0x341618)[_0x9be1('0x28')](_0xc6d86);};}exports[_0x9be1('0x29')]=function(_0x379103,_0x14c15c){var _0x4ea29b={},_0x14ceda={},_0x55e702={'count':0x0,'rows':[]};var _0x298557=db[_0x9be1('0x2a')][_0x9be1('0x2b')];_0x14ceda['model']=_[_0x9be1('0x2c')](_0x298557);_0x14ceda[_0x9be1('0x2d')]=_[_0x9be1('0x2c')](_0x379103['query']);_0x14ceda[_0x9be1('0x2e')]=_[_0x9be1('0x2f')](_0x14ceda['model'],_0x14ceda[_0x9be1('0x2d')]);_0x4ea29b[_0x9be1('0x30')]=_[_0x9be1('0x2f')](_0x14ceda[_0x9be1('0x31')],qs['fields'](_0x379103['query'][_0x9be1('0x32')]));_0x4ea29b[_0x9be1('0x30')]=_0x4ea29b[_0x9be1('0x30')]['length']?_0x4ea29b[_0x9be1('0x30')]:_0x14ceda[_0x9be1('0x31')];if(!_0x379103[_0x9be1('0x2d')][_0x9be1('0x33')](_0x9be1('0x34'))){_0x4ea29b['limit']=qs['limit'](_0x379103[_0x9be1('0x2d')]['limit']);_0x4ea29b[_0x9be1('0x1d')]=qs[_0x9be1('0x1d')](_0x379103[_0x9be1('0x2d')]['offset']);}_0x4ea29b[_0x9be1('0x35')]=qs['sort'](_0x379103[_0x9be1('0x2d')][_0x9be1('0x36')]);_0x4ea29b[_0x9be1('0x37')]=qs[_0x9be1('0x2e')](_[_0x9be1('0x38')](_0x379103[_0x9be1('0x2d')],_0x14ceda['filters']));if(_0x379103['query']['filter']){_0x4ea29b[_0x9be1('0x37')]=_[_0x9be1('0x39')](_0x4ea29b[_0x9be1('0x37')],{'$or':_['map'](_0x298557,function(_0x19a038){if(_0x19a038[_0x9be1('0x3a')][_0x9be1('0x3b')]!==_0x9be1('0x3c')){var _0x1ebea5={};_0x1ebea5[_0x19a038['field']]={'$like':'%'+_0x379103[_0x9be1('0x2d')]['filter']+'%'};return _0x1ebea5;}})});}_0x4ea29b=_[_0x9be1('0x39')]({},_0x4ea29b,_0x379103[_0x9be1('0x3d')]);var _0x35859b={'where':_0x4ea29b[_0x9be1('0x37')]};return db[_0x9be1('0x2a')][_0x9be1('0x3e')](_0x35859b)[_0x9be1('0x24')](function(_0x36ff0d){_0x55e702[_0x9be1('0x3e')]=_0x36ff0d;if(_0x379103[_0x9be1('0x2d')][_0x9be1('0x3f')]){_0x4ea29b[_0x9be1('0x40')]=[{'all':!![]}];}return db[_0x9be1('0x2a')]['findAll'](_0x4ea29b);})[_0x9be1('0x24')](function(_0x243f1c){_0x55e702[_0x9be1('0x41')]=_0x243f1c;return _0x55e702;})[_0x9be1('0x24')](respondWithFilteredResult(_0x14c15c,_0x4ea29b))[_0x9be1('0x42')](handleError(_0x14c15c,null));};exports[_0x9be1('0x43')]=function(_0x19c780,_0x2be386){var _0x1a1509={'raw':![],'where':{'id':_0x19c780[_0x9be1('0x44')]['id']}},_0x19398d={};_0x19398d[_0x9be1('0x31')]=_[_0x9be1('0x2c')](db['VoiceAgentReport']['rawAttributes']);_0x19398d[_0x9be1('0x2d')]=_[_0x9be1('0x2c')](_0x19c780['query']);_0x19398d[_0x9be1('0x2e')]=_[_0x9be1('0x2f')](_0x19398d[_0x9be1('0x31')],_0x19398d[_0x9be1('0x2d')]);_0x1a1509[_0x9be1('0x30')]=_[_0x9be1('0x2f')](_0x19398d[_0x9be1('0x31')],qs[_0x9be1('0x32')](_0x19c780[_0x9be1('0x2d')]['fields']));_0x1a1509[_0x9be1('0x30')]=_0x1a1509['attributes'][_0x9be1('0x45')]?_0x1a1509[_0x9be1('0x30')]:_0x19398d[_0x9be1('0x31')];if(_0x19c780[_0x9be1('0x2d')][_0x9be1('0x3f')]){_0x1a1509['include']=[{'all':!![]}];}_0x1a1509=_[_0x9be1('0x39')]({},_0x1a1509,_0x19c780[_0x9be1('0x3d')]);return db[_0x9be1('0x2a')]['find'](_0x1a1509)[_0x9be1('0x24')](handleEntityNotFound(_0x2be386,null))[_0x9be1('0x24')](respondWithResult(_0x2be386,null))['catch'](handleError(_0x2be386,null));};exports[_0x9be1('0x46')]=function(_0x940d7d,_0x1444e5){return db[_0x9be1('0x2a')]['create'](_0x940d7d[_0x9be1('0x47')],{})['then'](respondWithResult(_0x1444e5,0xc9))[_0x9be1('0x42')](handleError(_0x1444e5,null));};exports[_0x9be1('0x23')]=function(_0x54e9d0,_0x5ca44a){if(_0x54e9d0['body']['id']){delete _0x54e9d0[_0x9be1('0x47')]['id'];}return db['VoiceAgentReport'][_0x9be1('0x48')]({'where':{'id':_0x54e9d0['params']['id']}})[_0x9be1('0x24')](handleEntityNotFound(_0x5ca44a,null))[_0x9be1('0x24')](saveUpdates(_0x54e9d0[_0x9be1('0x47')],null))[_0x9be1('0x24')](respondWithResult(_0x5ca44a,null))[_0x9be1('0x42')](handleError(_0x5ca44a,null));};exports[_0x9be1('0x25')]=function(_0x3f348a,_0x49b802){return db[_0x9be1('0x2a')][_0x9be1('0x48')]({'where':{'id':_0x3f348a[_0x9be1('0x44')]['id']}})[_0x9be1('0x24')](handleEntityNotFound(_0x49b802,null))['then'](removeEntity(_0x49b802,null))[_0x9be1('0x42')](handleError(_0x49b802,null));};exports[_0x9be1('0x49')]=function(_0x3f6d17,_0xd0271a){return db[_0x9be1('0x2a')][_0x9be1('0x49')]()[_0x9be1('0x24')](respondWithResult(_0xd0271a,null))[_0x9be1('0x42')](handleError(_0xd0271a,null));};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js
index b61ca70..d6daf55 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.model.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda4f=['path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash','util','api','moment','request-promise'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0xda4f,0x167));var _0xfda4=function(_0x577c12,_0x516ebc){_0x577c12=_0x577c12-0x0;var _0x58ae0f=_0xda4f[_0x577c12];return _0x58ae0f;};'use strict';var _=require(_0xfda4('0x0'));var util=require(_0xfda4('0x1'));var logger=require('../../config/logger')(_0xfda4('0x2'));var moment=require(_0xfda4('0x3'));var BPromise=require('bluebird');var rp=require(_0xfda4('0x4'));var fs=require('fs');var path=require(_0xfda4('0x5'));var rimraf=require(_0xfda4('0x6'));var config=require(_0xfda4('0x7'));var attributes=require(_0xfda4('0x8'));module[_0xfda4('0x9')]=function(_0x1757d1,_0x3d73db){return _0x1757d1[_0xfda4('0xa')]('VoiceAgentReport',attributes,{'tableName':_0xfda4('0xb'),'paranoid':![],'indexes':[{'fields':[_0xfda4('0xc'),_0xfda4('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6c5=['VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x56e43f,_0xb85e91){var _0x11bbb0=function(_0x5ed503){while(--_0x5ed503){_0x56e43f['push'](_0x56e43f['shift']());}};_0x11bbb0(++_0xb85e91);}(_0xe6c5,0x11c));var _0x5e6c=function(_0x3715fb,_0x28e8d1){_0x3715fb=_0x3715fb-0x0;var _0xa47abf=_0xe6c5[_0x3715fb];return _0xa47abf;};'use strict';var _=require(_0x5e6c('0x0'));var util=require(_0x5e6c('0x1'));var logger=require(_0x5e6c('0x2'))(_0x5e6c('0x3'));var moment=require(_0x5e6c('0x4'));var BPromise=require(_0x5e6c('0x5'));var rp=require(_0x5e6c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e6c('0x7'));var config=require(_0x5e6c('0x8'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0xa6aedc,_0x4791bf){return _0xa6aedc[_0x5e6c('0x9')](_0x5e6c('0xa'),attributes,{'tableName':_0x5e6c('0xb'),'paranoid':![],'indexes':[{'fields':[_0x5e6c('0xc'),_0x5e6c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js
index bc7669f..9e7e263 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceAgentReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','then','lodash','util'];(function(_0x410b6a,_0x505cb3){var _0x44e11d=function(_0x543712){while(--_0x543712){_0x410b6a['push'](_0x410b6a['shift']());}};_0x44e11d(++_0x505cb3);}(_0x7a54,0x106));var _0x47a5=function(_0x42318b,_0x2e033b){_0x42318b=_0x42318b-0x0;var _0x2ece27=_0x7a54[_0x42318b];return _0x2ece27;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateVoiceAgentReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateVoiceAgentReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceAgentReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','then','lodash','util'];(function(_0x404692,_0x4b59cf){var _0x35562b=function(_0x393aac){while(--_0x393aac){_0x404692['push'](_0x404692['shift']());}};_0x35562b(++_0x4b59cf);}(_0x7a54,0x106));var _0x47a5=function(_0x57cef4,_0x27ce5a){_0x57cef4=_0x57cef4-0x0;var _0x58218e=_0x7a54[_0x57cef4];return _0x58218e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateVoiceAgentReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateVoiceAgentReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js
index 1ebc833..6ea5090 100644
--- a/server/api/voiceCallReport/index.js
+++ b/server/api/voiceCallReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8801=['get','isAuthenticated','index','/describe','show','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x10b975,_0xc0742c){var _0x42bbc8=function(_0x13ac57){while(--_0x13ac57){_0x10b975['push'](_0x10b975['shift']());}};_0x42bbc8(++_0xc0742c);}(_0x8801,0x15f));var _0x1880=function(_0x2263db,_0x4a8c53){_0x2263db=_0x2263db-0x0;var _0x28a9e5=_0x8801[_0x2263db];return _0x28a9e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1880('0x0'));var timeout=require(_0x1880('0x1'));var express=require(_0x1880('0x2'));var router=express[_0x1880('0x3')]();var auth=require(_0x1880('0x4'));var interaction=require(_0x1880('0x5'));var config=require('../../config/environment');var controller=require('./voiceCallReport.controller');router[_0x1880('0x6')]('/',auth[_0x1880('0x7')](),controller[_0x1880('0x8')]);router[_0x1880('0x6')](_0x1880('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x1880('0x6')]('/:id',auth[_0x1880('0x7')](),controller[_0x1880('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1880('0xb')](_0x1880('0xc'),auth[_0x1880('0x7')](),controller[_0x1880('0xd')]);router[_0x1880('0xe')]('/:id',auth[_0x1880('0x7')](),controller[_0x1880('0xf')]);module[_0x1880('0x10')]=router;
\ No newline at end of file
+var _0x7e07=['destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update'];(function(_0x11552f,_0x242f07){var _0x100d47=function(_0x5c1cd4){while(--_0x5c1cd4){_0x11552f['push'](_0x11552f['shift']());}};_0x100d47(++_0x242f07);}(_0x7e07,0x1dd));var _0x77e0=function(_0xf3ad46,_0x5d812f){_0xf3ad46=_0xf3ad46-0x0;var _0x3862ef=_0x7e07[_0xf3ad46];return _0x3862ef;};'use strict';var multer=require(_0x77e0('0x0'));var util=require(_0x77e0('0x1'));var path=require('path');var timeout=require(_0x77e0('0x2'));var express=require(_0x77e0('0x3'));var router=express['Router']();var auth=require(_0x77e0('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x77e0('0x5'));router[_0x77e0('0x6')]('/',auth[_0x77e0('0x7')](),controller[_0x77e0('0x8')]);router[_0x77e0('0x6')](_0x77e0('0x9'),auth[_0x77e0('0x7')](),controller[_0x77e0('0xa')]);router[_0x77e0('0x6')]('/:id',auth[_0x77e0('0x7')](),controller[_0x77e0('0xb')]);router[_0x77e0('0xc')]('/',auth[_0x77e0('0x7')](),controller[_0x77e0('0xd')]);router[_0x77e0('0xe')](_0x77e0('0xf'),auth[_0x77e0('0x7')](),controller[_0x77e0('0x10')]);router['delete'](_0x77e0('0xf'),auth[_0x77e0('0x7')](),controller[_0x77e0('0x11')]);module[_0x77e0('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js
index 06757a4..6b2296c 100644
--- a/server/api/voiceCallReport/voiceCallReport.attributes.js
+++ b/server/api/voiceCallReport/voiceCallReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf958=['outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','inbound','internal','inbound-fax'];(function(_0x11ae72,_0x52e8da){var _0xcacb7e=function(_0x4a5b4a){while(--_0x4a5b4a){_0x11ae72['push'](_0x11ae72['shift']());}};_0xcacb7e(++_0x52e8da);}(_0xf958,0x1e9));var _0x8f95=function(_0x37eec6,_0x42111d){_0x37eec6=_0x37eec6-0x0;var _0x531cfb=_0xf958[_0x37eec6];return _0x531cfb;};'use strict';var Sequelize=require(_0x8f95('0x0'));module[_0x8f95('0x1')]={'uniqueid':{'type':Sequelize[_0x8f95('0x2')]},'type':{'type':Sequelize['ENUM'](_0x8f95('0x3'),_0x8f95('0x4'),'outbound',_0x8f95('0x5'),_0x8f95('0x6'),_0x8f95('0x7'))},'tag':{'type':Sequelize[_0x8f95('0x2')]},'accountcode':{'type':Sequelize[_0x8f95('0x2')]},'source':{'type':Sequelize[_0x8f95('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x8f95('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8f95('0x2')]},'destinationchannel':{'type':Sequelize[_0x8f95('0x2')]},'lastapplication':{'type':Sequelize[_0x8f95('0x2')]},'lastdata':{'type':Sequelize[_0x8f95('0x8')]},'starttime':{'type':Sequelize[_0x8f95('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x8f95('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x8f95('0xa')]},'billableseconds':{'type':Sequelize[_0x8f95('0xa')]},'mohtime':{'type':Sequelize[_0x8f95('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8f95('0x2')]},'userfield':{'type':Sequelize[_0x8f95('0x2')]},'userDisposition':{'type':Sequelize[_0x8f95('0x2')]},'note':{'type':Sequelize[_0x8f95('0x2')]},'prefix':{'type':Sequelize[_0x8f95('0x2')]},'routeid':{'type':Sequelize[_0x8f95('0xa')]},'sipcallid':{'type':Sequelize[_0x8f95('0x2')]}};
\ No newline at end of file
+var _0xb0e2=['sequelize','STRING','inbound','internal','outbound','outbound-fax','dialer','TEXT','DATE','INTEGER'];(function(_0x4c06ab,_0x20be04){var _0x33b78f=function(_0x287065){while(--_0x287065){_0x4c06ab['push'](_0x4c06ab['shift']());}};_0x33b78f(++_0x20be04);}(_0xb0e2,0xf0));var _0x2b0e=function(_0x20679e,_0x5b24dc){_0x20679e=_0x20679e-0x0;var _0x4c1383=_0xb0e2[_0x20679e];return _0x4c1383;};'use strict';var Sequelize=require(_0x2b0e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2b0e('0x1')]},'type':{'type':Sequelize['ENUM'](_0x2b0e('0x2'),_0x2b0e('0x3'),_0x2b0e('0x4'),'inbound-fax',_0x2b0e('0x5'),_0x2b0e('0x6'))},'tag':{'type':Sequelize[_0x2b0e('0x1')]},'accountcode':{'type':Sequelize[_0x2b0e('0x1')]},'source':{'type':Sequelize[_0x2b0e('0x1')]},'destination':{'type':Sequelize[_0x2b0e('0x1')]},'destinationcontext':{'type':Sequelize[_0x2b0e('0x1')]},'callerid':{'type':Sequelize[_0x2b0e('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x2b0e('0x1')]},'lastdata':{'type':Sequelize[_0x2b0e('0x7')]},'starttime':{'type':Sequelize[_0x2b0e('0x8')]},'systemanswertime':{'type':Sequelize[_0x2b0e('0x8')]},'answertime':{'type':Sequelize[_0x2b0e('0x8')]},'endtime':{'type':Sequelize[_0x2b0e('0x8')]},'duration':{'type':Sequelize[_0x2b0e('0x9')]},'billableseconds':{'type':Sequelize[_0x2b0e('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2b0e('0x1')]},'amaflags':{'type':Sequelize[_0x2b0e('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x2b0e('0x1')]},'note':{'type':Sequelize[_0x2b0e('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x2b0e('0x9')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js
index 747be80..7d15ecb 100644
--- a/server/api/voiceCallReport/voiceCallReport.controller.js
+++ b/server/api/voiceCallReport/voiceCallReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6011=['status','end','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','type','field','options','VoiceCallReport','count','fullname','alias','User','findAll','rows','catch','show','includeAll','find','create','body','params','describe','uniqueid','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x4e0f70,_0x870a71){var _0x460281=function(_0x3f4a9f){while(--_0x3f4a9f){_0x4e0f70['push'](_0x4e0f70['shift']());}};_0x460281(++_0x870a71);}(_0x6011,0x196));var _0x1601=function(_0x3daa91,_0x199f26){_0x3daa91=_0x3daa91-0x0;var _0x4c14c0=_0x6011[_0x3daa91];return _0x4c14c0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1601('0x0'));var moment=require(_0x1601('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x1601('0x2'));var util=require(_0x1601('0x3'));var path=require(_0x1601('0x4'));var sox=require(_0x1601('0x5'));var csv=require(_0x1601('0x6'));var ejs=require(_0x1601('0x7'));var fs=require('fs');var _=require(_0x1601('0x8'));var squel=require(_0x1601('0x9'));var crypto=require(_0x1601('0xa'));var jsforce=require(_0x1601('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1601('0x6'));var querystring=require(_0x1601('0xc'));var Papa=require(_0x1601('0xd'));var Redis=require(_0x1601('0xe'));var authService=require(_0x1601('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1601('0x10'));var utils=require('../../config/utils');var config=require(_0x1601('0x11'));var db=require(_0x1601('0x12'))['db'];function respondWithStatusCode(_0x14db9f,_0x24cc39){_0x24cc39=_0x24cc39||0xcc;return function(_0x263bef){if(_0x263bef){return _0x14db9f[_0x1601('0x13')](_0x24cc39);}return _0x14db9f[_0x1601('0x14')](_0x24cc39)[_0x1601('0x15')]();};}function respondWithResult(_0x5da646,_0x11bbe5){_0x11bbe5=_0x11bbe5||0xc8;return function(_0x555d4f){if(_0x555d4f){return _0x5da646[_0x1601('0x14')](_0x11bbe5)['json'](_0x555d4f);}};}function respondWithFilteredResult(_0x2f0837,_0x3b6554){return function(_0x4bb5c1){if(_0x4bb5c1){var _0x1b40be=_0x4bb5c1['count'],_0x39873a=_0x3b6554[_0x1601('0x16')],_0x12ddb0=_0x3b6554[_0x1601('0x16')]+_0x3b6554[_0x1601('0x17')],_0x595c96;if(_0x12ddb0>=_0x1b40be){_0x12ddb0=_0x1b40be;_0x595c96=0xc8;}else{_0x595c96=0xce;}_0x2f0837[_0x1601('0x14')](_0x595c96);return _0x2f0837[_0x1601('0x18')](_0x1601('0x19'),_0x39873a+'-'+_0x12ddb0+'/'+_0x1b40be)[_0x1601('0x1a')](_0x4bb5c1);}return null;};}function patchUpdates(_0x3ae0c6){return function(_0x1ce2b2){try{jsonpatch['apply'](_0x1ce2b2,_0x3ae0c6,!![]);}catch(_0x4d077e){return BPromise[_0x1601('0x1b')](_0x4d077e);}return _0x1ce2b2[_0x1601('0x1c')]();};}function saveUpdates(_0xb09057,_0x5bd8fb){return function(_0x2c3b5d){if(_0x2c3b5d){return _0x2c3b5d[_0x1601('0x1d')](_0xb09057)[_0x1601('0x1e')](function(_0x2e2e0d){return _0x2e2e0d;});}return null;};}function removeEntity(_0x3fa19f,_0x54398a){return function(_0x1b8314){if(_0x1b8314){return _0x1b8314[_0x1601('0x1f')]()[_0x1601('0x1e')](function(){_0x3fa19f['status'](0xcc)[_0x1601('0x15')]();});}};}function handleEntityNotFound(_0x330033,_0x4f918b){return function(_0x2b01da){if(!_0x2b01da){_0x330033[_0x1601('0x13')](0x194);}return _0x2b01da;};}function handleError(_0x5c9543,_0x5ae062){_0x5ae062=_0x5ae062||0x1f4;return function(_0x65fb4f){logger[_0x1601('0x20')](_0x65fb4f[_0x1601('0x21')]);if(_0x65fb4f['name']){delete _0x65fb4f[_0x1601('0x22')];}_0x5c9543[_0x1601('0x14')](_0x5ae062)[_0x1601('0x23')](_0x65fb4f);};}exports[_0x1601('0x24')]=function(_0x296c34,_0x47ed39){var _0x4b2f0d={},_0x1fa0a6={},_0x1aef35={'count':0x0,'rows':[]};var _0x18509c=db['VoiceCallReport'][_0x1601('0x25')];_0x1fa0a6['model']=_[_0x1601('0x26')](_0x18509c);_0x1fa0a6[_0x1601('0x27')]=_[_0x1601('0x26')](_0x296c34['query']);_0x1fa0a6[_0x1601('0x28')]=_[_0x1601('0x29')](_0x1fa0a6[_0x1601('0x2a')],_0x1fa0a6[_0x1601('0x27')]);_0x4b2f0d['attributes']=_[_0x1601('0x29')](_0x1fa0a6[_0x1601('0x2a')],qs[_0x1601('0x2b')](_0x296c34[_0x1601('0x27')][_0x1601('0x2b')]));_0x4b2f0d[_0x1601('0x2c')]=_0x4b2f0d[_0x1601('0x2c')][_0x1601('0x2d')]?_0x4b2f0d[_0x1601('0x2c')]:_0x1fa0a6[_0x1601('0x2a')];if(!_0x296c34[_0x1601('0x27')][_0x1601('0x2e')](_0x1601('0x2f'))){_0x4b2f0d['limit']=qs[_0x1601('0x17')](_0x296c34[_0x1601('0x27')][_0x1601('0x17')]);_0x4b2f0d[_0x1601('0x16')]=qs[_0x1601('0x16')](_0x296c34['query'][_0x1601('0x16')]);}_0x4b2f0d[_0x1601('0x30')]=qs['sort'](_0x296c34[_0x1601('0x27')]['sort']);_0x4b2f0d[_0x1601('0x31')]=qs[_0x1601('0x28')](_['pick'](_0x296c34[_0x1601('0x27')],_0x1fa0a6[_0x1601('0x28')]));if(_0x296c34[_0x1601('0x27')][_0x1601('0x32')]){_0x4b2f0d[_0x1601('0x31')]=_[_0x1601('0x33')](_0x4b2f0d[_0x1601('0x31')],{'$or':_['map'](_0x18509c,function(_0x39da55){if(_0x39da55[_0x1601('0x34')]['key']!=='VIRTUAL'){var _0x431439={};_0x431439[_0x39da55[_0x1601('0x35')]]={'$like':'%'+_0x296c34[_0x1601('0x27')][_0x1601('0x32')]+'%'};return _0x431439;}})});}_0x4b2f0d=_[_0x1601('0x33')]({},_0x4b2f0d,_0x296c34[_0x1601('0x36')]);var _0x36d496={'where':_0x4b2f0d['where']};return db[_0x1601('0x37')][_0x1601('0x38')](_0x36d496)['then'](function(_0x5c79d2){_0x1aef35[_0x1601('0x38')]=_0x5c79d2;if(_0x296c34['query']['includeAll']){_0x4b2f0d['include']=[{'attributes':['id',_0x1601('0x22'),_0x1601('0x39'),_0x1601('0x3a')],'model':db[_0x1601('0x3b')],'as':_0x1601('0x3b')}];}return db[_0x1601('0x37')][_0x1601('0x3c')](_0x4b2f0d);})[_0x1601('0x1e')](function(_0x388f3b){_0x1aef35[_0x1601('0x3d')]=_0x388f3b;return _0x1aef35;})[_0x1601('0x1e')](respondWithFilteredResult(_0x47ed39,_0x4b2f0d))[_0x1601('0x3e')](handleError(_0x47ed39,null));};exports[_0x1601('0x3f')]=function(_0x50a517,_0x44ae24){var _0x47dddd={'raw':!![],'where':{'id':_0x50a517['params']['id']}},_0x5acf66={};_0x5acf66[_0x1601('0x2a')]=_[_0x1601('0x26')](db[_0x1601('0x37')]['rawAttributes']);_0x5acf66['query']=_[_0x1601('0x26')](_0x50a517[_0x1601('0x27')]);_0x5acf66[_0x1601('0x28')]=_['intersection'](_0x5acf66[_0x1601('0x2a')],_0x5acf66['query']);_0x47dddd[_0x1601('0x2c')]=_[_0x1601('0x29')](_0x5acf66[_0x1601('0x2a')],qs[_0x1601('0x2b')](_0x50a517['query'][_0x1601('0x2b')]));_0x47dddd['attributes']=_0x47dddd[_0x1601('0x2c')][_0x1601('0x2d')]?_0x47dddd['attributes']:_0x5acf66[_0x1601('0x2a')];if(_0x50a517[_0x1601('0x27')][_0x1601('0x40')]){_0x47dddd['include']=[{'all':!![]}];}_0x47dddd=_[_0x1601('0x33')]({},_0x47dddd,_0x50a517['options']);return db[_0x1601('0x37')][_0x1601('0x41')](_0x47dddd)[_0x1601('0x1e')](handleEntityNotFound(_0x44ae24,null))[_0x1601('0x1e')](respondWithResult(_0x44ae24,null))[_0x1601('0x3e')](handleError(_0x44ae24,null));};exports[_0x1601('0x42')]=function(_0x3c2f96,_0x2bccd0){return db[_0x1601('0x37')]['create'](_0x3c2f96[_0x1601('0x43')],{})['then'](respondWithResult(_0x2bccd0,0xc9))[_0x1601('0x3e')](handleError(_0x2bccd0,null));};exports[_0x1601('0x1f')]=function(_0x4a8039,_0xbaeefc){return db[_0x1601('0x37')]['find']({'where':{'id':_0x4a8039[_0x1601('0x44')]['id']}})[_0x1601('0x1e')](handleEntityNotFound(_0xbaeefc,null))[_0x1601('0x1e')](removeEntity(_0xbaeefc,null))[_0x1601('0x3e')](handleError(_0xbaeefc,null));};exports[_0x1601('0x45')]=function(_0xf14c98,_0x2b422c){return db[_0x1601('0x37')][_0x1601('0x45')]()[_0x1601('0x1e')](respondWithResult(_0x2b422c,null))['catch'](handleError(_0x2b422c,null));};exports[_0x1601('0x1d')]=function(_0x4b6f90,_0x354deb){if(_0x4b6f90[_0x1601('0x43')][_0x1601('0x46')]){delete _0x4b6f90['body']['uniqueid'];}return db[_0x1601('0x37')][_0x1601('0x41')]({'where':{'uniqueid':_0x4b6f90['params']['id'],'UserId':{'$or':[null,_0x4b6f90['user']['id']]}}})['then'](handleEntityNotFound(_0x354deb,null))[_0x1601('0x1e')](saveUpdates(_0x4b6f90['body'],null))[_0x1601('0x1e')](respondWithResult(_0x354deb,null))[_0x1601('0x3e')](handleError(_0x354deb,null));};
\ No newline at end of file
+var _0xba34=['model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','includeAll','include','alias','User','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','update','uniqueid','user','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','VoiceCallReport'];(function(_0x7a4b16,_0x2c3b70){var _0x59e441=function(_0xfc8375){while(--_0xfc8375){_0x7a4b16['push'](_0x7a4b16['shift']());}};_0x59e441(++_0x2c3b70);}(_0xba34,0x119));var _0x4ba3=function(_0x663827,_0x16d8d5){_0x663827=_0x663827-0x0;var _0x3cb000=_0xba34[_0x663827];return _0x3cb000;};'use strict';var pdf=require(_0x4ba3('0x0'));var emlformat=require(_0x4ba3('0x1'));var rimraf=require(_0x4ba3('0x2'));var zipdir=require(_0x4ba3('0x3'));var jsonpatch=require(_0x4ba3('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4ba3('0x5'));var util=require(_0x4ba3('0x6'));var path=require(_0x4ba3('0x7'));var sox=require(_0x4ba3('0x8'));var csv=require(_0x4ba3('0x9'));var ejs=require(_0x4ba3('0xa'));var fs=require('fs');var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x9'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var hardwareService=require(_0x4ba3('0x14'));var logger=require(_0x4ba3('0x15'))('api');var utils=require(_0x4ba3('0x16'));var config=require(_0x4ba3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ff93a,_0x567709){_0x567709=_0x567709||0xcc;return function(_0x1073d4){if(_0x1073d4){return _0x3ff93a['sendStatus'](_0x567709);}return _0x3ff93a[_0x4ba3('0x18')](_0x567709)[_0x4ba3('0x19')]();};}function respondWithResult(_0x29e498,_0x3515e9){_0x3515e9=_0x3515e9||0xc8;return function(_0x2bc796){if(_0x2bc796){return _0x29e498[_0x4ba3('0x18')](_0x3515e9)[_0x4ba3('0x1a')](_0x2bc796);}};}function respondWithFilteredResult(_0x12ac90,_0x1dec48){return function(_0x401366){if(_0x401366){var _0x36638b=_0x401366[_0x4ba3('0x1b')],_0x301359=_0x1dec48[_0x4ba3('0x1c')],_0x29a9d1=_0x1dec48['offset']+_0x1dec48[_0x4ba3('0x1d')],_0x25f584;if(_0x29a9d1>=_0x36638b){_0x29a9d1=_0x36638b;_0x25f584=0xc8;}else{_0x25f584=0xce;}_0x12ac90[_0x4ba3('0x18')](_0x25f584);return _0x12ac90[_0x4ba3('0x1e')](_0x4ba3('0x1f'),_0x301359+'-'+_0x29a9d1+'/'+_0x36638b)['json'](_0x401366);}return null;};}function patchUpdates(_0x2519bb){return function(_0xe4eff9){try{jsonpatch[_0x4ba3('0x20')](_0xe4eff9,_0x2519bb,!![]);}catch(_0x1e2ce5){return BPromise[_0x4ba3('0x21')](_0x1e2ce5);}return _0xe4eff9[_0x4ba3('0x22')]();};}function saveUpdates(_0x4b2791,_0x57de6a){return function(_0x2278b0){if(_0x2278b0){return _0x2278b0['update'](_0x4b2791)[_0x4ba3('0x23')](function(_0x163967){return _0x163967;});}return null;};}function removeEntity(_0x413bb3,_0xbc7023){return function(_0x46f1f5){if(_0x46f1f5){return _0x46f1f5[_0x4ba3('0x24')]()['then'](function(){_0x413bb3[_0x4ba3('0x18')](0xcc)[_0x4ba3('0x19')]();});}};}function handleEntityNotFound(_0x5c28f9,_0x28bb3d){return function(_0x4ffe39){if(!_0x4ffe39){_0x5c28f9[_0x4ba3('0x25')](0x194);}return _0x4ffe39;};}function handleError(_0x18abb3,_0x11a917){_0x11a917=_0x11a917||0x1f4;return function(_0x37e6f3){logger[_0x4ba3('0x26')](_0x37e6f3[_0x4ba3('0x27')]);if(_0x37e6f3[_0x4ba3('0x28')]){delete _0x37e6f3[_0x4ba3('0x28')];}_0x18abb3[_0x4ba3('0x18')](_0x11a917)[_0x4ba3('0x29')](_0x37e6f3);};}exports['index']=function(_0x252f37,_0x13c353){var _0x2311ed={},_0x5adaab={},_0x10537e={'count':0x0,'rows':[]};var _0x1fe5e2=db[_0x4ba3('0x2a')]['rawAttributes'];_0x5adaab[_0x4ba3('0x2b')]=_[_0x4ba3('0x2c')](_0x1fe5e2);_0x5adaab[_0x4ba3('0x2d')]=_[_0x4ba3('0x2c')](_0x252f37['query']);_0x5adaab['filters']=_[_0x4ba3('0x2e')](_0x5adaab[_0x4ba3('0x2b')],_0x5adaab[_0x4ba3('0x2d')]);_0x2311ed[_0x4ba3('0x2f')]=_[_0x4ba3('0x2e')](_0x5adaab[_0x4ba3('0x2b')],qs['fields'](_0x252f37[_0x4ba3('0x2d')][_0x4ba3('0x30')]));_0x2311ed[_0x4ba3('0x2f')]=_0x2311ed[_0x4ba3('0x2f')][_0x4ba3('0x31')]?_0x2311ed[_0x4ba3('0x2f')]:_0x5adaab[_0x4ba3('0x2b')];if(!_0x252f37[_0x4ba3('0x2d')][_0x4ba3('0x32')](_0x4ba3('0x33'))){_0x2311ed['limit']=qs['limit'](_0x252f37['query'][_0x4ba3('0x1d')]);_0x2311ed[_0x4ba3('0x1c')]=qs[_0x4ba3('0x1c')](_0x252f37[_0x4ba3('0x2d')][_0x4ba3('0x1c')]);}_0x2311ed[_0x4ba3('0x34')]=qs[_0x4ba3('0x35')](_0x252f37[_0x4ba3('0x2d')][_0x4ba3('0x35')]);_0x2311ed[_0x4ba3('0x36')]=qs[_0x4ba3('0x37')](_[_0x4ba3('0x38')](_0x252f37['query'],_0x5adaab[_0x4ba3('0x37')]));if(_0x252f37[_0x4ba3('0x2d')][_0x4ba3('0x39')]){_0x2311ed['where']=_[_0x4ba3('0x3a')](_0x2311ed['where'],{'$or':_[_0x4ba3('0x3b')](_0x1fe5e2,function(_0x1cc70e){if(_0x1cc70e[_0x4ba3('0x3c')][_0x4ba3('0x3d')]!==_0x4ba3('0x3e')){var _0x3d977c={};_0x3d977c[_0x1cc70e['field']]={'$like':'%'+_0x252f37[_0x4ba3('0x2d')][_0x4ba3('0x39')]+'%'};return _0x3d977c;}})});}_0x2311ed=_[_0x4ba3('0x3a')]({},_0x2311ed,_0x252f37['options']);var _0x1865b8={'where':_0x2311ed[_0x4ba3('0x36')]};return db['VoiceCallReport'][_0x4ba3('0x1b')](_0x1865b8)['then'](function(_0x4c126d){_0x10537e[_0x4ba3('0x1b')]=_0x4c126d;if(_0x252f37[_0x4ba3('0x2d')][_0x4ba3('0x3f')]){_0x2311ed[_0x4ba3('0x40')]=[{'attributes':['id',_0x4ba3('0x28'),'fullname',_0x4ba3('0x41')],'model':db[_0x4ba3('0x42')],'as':_0x4ba3('0x42')}];}return db[_0x4ba3('0x2a')][_0x4ba3('0x43')](_0x2311ed);})[_0x4ba3('0x23')](function(_0x349af4){_0x10537e[_0x4ba3('0x44')]=_0x349af4;return _0x10537e;})['then'](respondWithFilteredResult(_0x13c353,_0x2311ed))[_0x4ba3('0x45')](handleError(_0x13c353,null));};exports[_0x4ba3('0x46')]=function(_0x3cb07f,_0x3338d9){var _0xa1757={'raw':!![],'where':{'id':_0x3cb07f[_0x4ba3('0x47')]['id']}},_0x25b2c9={};_0x25b2c9[_0x4ba3('0x2b')]=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2a')][_0x4ba3('0x48')]);_0x25b2c9[_0x4ba3('0x2d')]=_[_0x4ba3('0x2c')](_0x3cb07f[_0x4ba3('0x2d')]);_0x25b2c9['filters']=_['intersection'](_0x25b2c9['model'],_0x25b2c9['query']);_0xa1757['attributes']=_[_0x4ba3('0x2e')](_0x25b2c9['model'],qs[_0x4ba3('0x30')](_0x3cb07f['query'][_0x4ba3('0x30')]));_0xa1757[_0x4ba3('0x2f')]=_0xa1757[_0x4ba3('0x2f')][_0x4ba3('0x31')]?_0xa1757[_0x4ba3('0x2f')]:_0x25b2c9['model'];if(_0x3cb07f[_0x4ba3('0x2d')]['includeAll']){_0xa1757[_0x4ba3('0x40')]=[{'all':!![]}];}_0xa1757=_['merge']({},_0xa1757,_0x3cb07f[_0x4ba3('0x49')]);return db[_0x4ba3('0x2a')][_0x4ba3('0x4a')](_0xa1757)[_0x4ba3('0x23')](handleEntityNotFound(_0x3338d9,null))[_0x4ba3('0x23')](respondWithResult(_0x3338d9,null))[_0x4ba3('0x45')](handleError(_0x3338d9,null));};exports[_0x4ba3('0x4b')]=function(_0x5d5714,_0xc3652a){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')](_0x5d5714[_0x4ba3('0x4c')],{})[_0x4ba3('0x23')](respondWithResult(_0xc3652a,0xc9))['catch'](handleError(_0xc3652a,null));};exports['destroy']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2a')]['find']({'where':{'id':_0xa4bbb2[_0x4ba3('0x47')]['id']}})[_0x4ba3('0x23')](handleEntityNotFound(_0x1fe115,null))[_0x4ba3('0x23')](removeEntity(_0x1fe115,null))['catch'](handleError(_0x1fe115,null));};exports['describe']=function(_0x34dc04,_0x482a83){return db[_0x4ba3('0x2a')][_0x4ba3('0x4d')]()[_0x4ba3('0x23')](respondWithResult(_0x482a83,null))[_0x4ba3('0x45')](handleError(_0x482a83,null));};exports[_0x4ba3('0x4e')]=function(_0x213eb0,_0x590739){if(_0x213eb0[_0x4ba3('0x4c')][_0x4ba3('0x4f')]){delete _0x213eb0['body'][_0x4ba3('0x4f')];}return db[_0x4ba3('0x2a')][_0x4ba3('0x4a')]({'where':{'uniqueid':_0x213eb0[_0x4ba3('0x47')]['id'],'UserId':{'$or':[null,_0x213eb0[_0x4ba3('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x590739,null))[_0x4ba3('0x23')](saveUpdates(_0x213eb0[_0x4ba3('0x4c')],null))['then'](respondWithResult(_0x590739,null))[_0x4ba3('0x45')](handleError(_0x590739,null));};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js
index 48185f0..e6b5c22 100644
--- a/server/api/voiceCallReport/voiceCallReport.model.js
+++ b/server/api/voiceCallReport/voiceCallReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa418=['define','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x2da690,_0x555497){var _0x2e9697=function(_0x36f859){while(--_0x36f859){_0x2da690['push'](_0x2da690['shift']());}};_0x2e9697(++_0x555497);}(_0xa418,0x153));var _0x8a41=function(_0x104999,_0xe4a670){_0x104999=_0x104999-0x0;var _0x1c9492=_0xa418[_0x104999];return _0x1c9492;};'use strict';var _=require('lodash');var util=require(_0x8a41('0x0'));var logger=require(_0x8a41('0x1'))(_0x8a41('0x2'));var moment=require(_0x8a41('0x3'));var BPromise=require(_0x8a41('0x4'));var rp=require(_0x8a41('0x5'));var fs=require('fs');var path=require(_0x8a41('0x6'));var rimraf=require(_0x8a41('0x7'));var config=require(_0x8a41('0x8'));var attributes=require(_0x8a41('0x9'));module[_0x8a41('0xa')]=function(_0x35efe7,_0x260c82){return _0x35efe7[_0x8a41('0xb')]('VoiceCallReport',attributes,{'tableName':_0x8a41('0xc'),'paranoid':![],'indexes':[{'fields':[_0x8a41('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xddb8=['../../config/environment','./voiceCallReport.attributes','define','report_call','lodash','util','bluebird','request-promise','rimraf'];(function(_0xbb7ae1,_0xe49219){var _0x31eb45=function(_0x3b9ecf){while(--_0x3b9ecf){_0xbb7ae1['push'](_0xbb7ae1['shift']());}};_0x31eb45(++_0xe49219);}(_0xddb8,0xee));var _0x8ddb=function(_0x10c89e,_0xe836f4){_0x10c89e=_0x10c89e-0x0;var _0x5314f9=_0xddb8[_0x10c89e];return _0x5314f9;};'use strict';var _=require(_0x8ddb('0x0'));var util=require(_0x8ddb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8ddb('0x2'));var rp=require(_0x8ddb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ddb('0x4'));var config=require(_0x8ddb('0x5'));var attributes=require(_0x8ddb('0x6'));module['exports']=function(_0x4aa4af,_0x14d680){return _0x4aa4af[_0x8ddb('0x7')]('VoiceCallReport',attributes,{'tableName':_0x8ddb('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js
index 3aa7000..5485f6a 100644
--- a/server/api/voiceCallReport/voiceCallReport.rpc.js
+++ b/server/api/voiceCallReport/voiceCallReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f85=['code','message','VoiceCallReport,\x20%s,\x20%s','result','GetVoiceCallReport','options','raw','where','attributes','map','include','model','catch','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','VoiceCallReport','update','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','client','http','then','info','debug','request\x20sent','stringify','error'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x5f85,0x1b8));var _0x55f8=function(_0x58f629,_0x1e23ff){_0x58f629=_0x58f629-0x0;var _0x55eeb0=_0x5f85[_0x58f629];return _0x55eeb0;};'use strict';var _=require(_0x55f8('0x0'));var util=require(_0x55f8('0x1'));var moment=require(_0x55f8('0x2'));var BPromise=require(_0x55f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55f8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x55f8('0x5'));var logger=require('../../config/logger')(_0x55f8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x55f8('0x7')][_0x55f8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23120b,_0x2ef985,_0x4d8801){return new BPromise(function(_0x337215,_0x1c97a8){return client['request'](_0x23120b,_0x4d8801)[_0x55f8('0x9')](function(_0x537013){logger[_0x55f8('0xa')]('VoiceCallReport,\x20%s,\x20%s',_0x2ef985,'request\x20sent');logger[_0x55f8('0xb')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x2ef985,_0x55f8('0xc'),JSON[_0x55f8('0xd')](_0x537013));if(_0x537013[_0x55f8('0xe')]){if(_0x537013[_0x55f8('0xe')][_0x55f8('0xf')]===0x1f4){logger[_0x55f8('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x2ef985,_0x537013[_0x55f8('0xe')]['message']);return _0x1c97a8(_0x537013['error'][_0x55f8('0x10')]);}logger[_0x55f8('0xe')](_0x55f8('0x11'),_0x2ef985,_0x537013[_0x55f8('0xe')][_0x55f8('0x10')]);return _0x337215(_0x537013[_0x55f8('0xe')][_0x55f8('0x10')]);}else{logger[_0x55f8('0xa')](_0x55f8('0x11'),_0x2ef985,_0x55f8('0xc'));_0x337215(_0x537013[_0x55f8('0x12')][_0x55f8('0x10')]);}})['catch'](function(_0x5ac0a6){logger['error'](_0x55f8('0x11'),_0x2ef985,_0x5ac0a6);_0x1c97a8(_0x5ac0a6);});});}exports[_0x55f8('0x13')]=function(_0x3f2b38){var _0x2d249b=this;return new Promise(function(_0x69bd15,_0x189e9b){return db['VoiceCallReport']['findAll']({'raw':_0x3f2b38[_0x55f8('0x14')]?_0x3f2b38[_0x55f8('0x14')][_0x55f8('0x15')]===undefined?!![]:![]:!![],'where':_0x3f2b38[_0x55f8('0x14')]?_0x3f2b38[_0x55f8('0x14')][_0x55f8('0x16')]||null:null,'attributes':_0x3f2b38['options']?_0x3f2b38[_0x55f8('0x14')][_0x55f8('0x17')]||null:null,'limit':_0x3f2b38[_0x55f8('0x14')]?_0x3f2b38[_0x55f8('0x14')]['limit']||null:null,'include':_0x3f2b38[_0x55f8('0x14')]?_0x3f2b38[_0x55f8('0x14')]['include']?_[_0x55f8('0x18')](_0x3f2b38[_0x55f8('0x14')][_0x55f8('0x19')],function(_0x408e5c){return{'model':db[_0x408e5c['model']],'as':_0x408e5c['as'],'attributes':_0x408e5c['attributes'],'include':_0x408e5c[_0x55f8('0x19')]?_['map'](_0x408e5c[_0x55f8('0x19')],function(_0x4e38f7){return{'model':db[_0x4e38f7[_0x55f8('0x1a')]],'as':_0x4e38f7['as'],'attributes':_0x4e38f7[_0x55f8('0x17')],'include':_0x4e38f7[_0x55f8('0x19')]?_[_0x55f8('0x18')](_0x4e38f7['include'],function(_0x4d855d){return{'model':db[_0x4d855d[_0x55f8('0x1a')]],'as':_0x4d855d['as'],'attributes':_0x4d855d[_0x55f8('0x17')]};}):[]};}):[]};}):[]:[]})[_0x55f8('0x9')](function(_0x5a345f){logger[_0x55f8('0xa')](_0x55f8('0x13'),_0x3f2b38);logger['debug'](_0x55f8('0x13'),_0x3f2b38,JSON[_0x55f8('0xd')](_0x5a345f));_0x69bd15(_0x5a345f);})[_0x55f8('0x1b')](function(_0xc02dac){logger[_0x55f8('0xe')]('GetVoiceCallReport',_0xc02dac[_0x55f8('0x10')],_0x3f2b38);_0x189e9b(_0x2d249b['error'](0x1f4,_0xc02dac[_0x55f8('0x10')]));});});};exports['CreateVoiceCallReport']=function(_0x450c94){var _0x57edeb=this;return new Promise(function(_0x48a3d,_0x3a7f8b){return db['VoiceCallReport'][_0x55f8('0x1c')](_0x450c94[_0x55f8('0x1d')],{'raw':_0x450c94[_0x55f8('0x14')]?_0x450c94[_0x55f8('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x55f8('0x9')](function(_0xdab32){logger[_0x55f8('0xa')]('CreateVoiceCallReport',_0x450c94);logger[_0x55f8('0xb')](_0x55f8('0x1e'),_0x450c94,JSON['stringify'](_0xdab32));_0x48a3d(_0xdab32);})[_0x55f8('0x1b')](function(_0x3a76bf){logger['error'](_0x55f8('0x1e'),_0x3a76bf[_0x55f8('0x10')],_0x450c94);_0x3a7f8b(_0x57edeb[_0x55f8('0xe')](0x1f4,_0x3a76bf[_0x55f8('0x10')]));});});};exports[_0x55f8('0x1f')]=function(_0x5469da){var _0x22487d=this;return new Promise(function(_0x288cb3,_0x5c3be4){return db[_0x55f8('0x20')][_0x55f8('0x21')](_0x5469da['body'],{'raw':_0x5469da[_0x55f8('0x14')]?_0x5469da[_0x55f8('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5469da['options']?_0x5469da[_0x55f8('0x14')][_0x55f8('0x16')]||null:null,'attributes':_0x5469da[_0x55f8('0x14')]?_0x5469da[_0x55f8('0x14')][_0x55f8('0x17')]||null:null,'limit':_0x5469da[_0x55f8('0x14')]?_0x5469da[_0x55f8('0x14')][_0x55f8('0x22')]||null:null})['then'](function(_0x55d209){logger[_0x55f8('0xa')]('UpdateVoiceCallReport',_0x5469da);logger[_0x55f8('0xb')](_0x55f8('0x1f'),_0x5469da,JSON[_0x55f8('0xd')](_0x55d209));_0x288cb3(_0x55d209);})['catch'](function(_0xdf6169){logger[_0x55f8('0xe')](_0x55f8('0x1f'),_0xdf6169[_0x55f8('0x10')],_0x5469da);_0x5c3be4(_0x22487d[_0x55f8('0xe')](0x1f4,_0xdf6169['message']));});});};
\ No newline at end of file
+var _0x014b=['then','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','info','debug','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','body','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x52355b,_0x89404e){var _0xf86f90=function(_0x146a84){while(--_0x146a84){_0x52355b['push'](_0x52355b['shift']());}};_0xf86f90(++_0x89404e);}(_0x014b,0xde));var _0xb014=function(_0x94036e,_0x1fd2ef){_0x94036e=_0x94036e-0x0;var _0x1b3ba9=_0x014b[_0x94036e];return _0x1b3ba9;};'use strict';var _=require(_0xb014('0x0'));var util=require(_0xb014('0x1'));var moment=require(_0xb014('0x2'));var BPromise=require('bluebird');var rs=require(_0xb014('0x3'));var fs=require('fs');var Redis=require(_0xb014('0x4'));var db=require(_0xb014('0x5'))['db'];var utils=require(_0xb014('0x6'));var logger=require(_0xb014('0x7'))('rpc');var config=require(_0xb014('0x8'));var jayson=require(_0xb014('0x9'));var client=jayson['client'][_0xb014('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39dc43,_0x2940ed,_0x2c16eb){return new BPromise(function(_0x3124f2,_0x32bca8){return client[_0xb014('0xb')](_0x39dc43,_0x2c16eb)[_0xb014('0xc')](function(_0x46bcb7){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x2940ed,'request\x20sent');logger['debug'](_0xb014('0xd'),_0x2940ed,_0xb014('0xe'),JSON[_0xb014('0xf')](_0x46bcb7));if(_0x46bcb7[_0xb014('0x10')]){if(_0x46bcb7[_0xb014('0x10')][_0xb014('0x11')]===0x1f4){logger[_0xb014('0x10')](_0xb014('0x12'),_0x2940ed,_0x46bcb7[_0xb014('0x10')][_0xb014('0x13')]);return _0x32bca8(_0x46bcb7[_0xb014('0x10')][_0xb014('0x13')]);}logger[_0xb014('0x10')](_0xb014('0x12'),_0x2940ed,_0x46bcb7[_0xb014('0x10')][_0xb014('0x13')]);return _0x3124f2(_0x46bcb7[_0xb014('0x10')][_0xb014('0x13')]);}else{logger['info'](_0xb014('0x12'),_0x2940ed,_0xb014('0xe'));_0x3124f2(_0x46bcb7['result']['message']);}})[_0xb014('0x14')](function(_0x2dcb6c){logger[_0xb014('0x10')](_0xb014('0x12'),_0x2940ed,_0x2dcb6c);_0x32bca8(_0x2dcb6c);});});}exports[_0xb014('0x15')]=function(_0xcae813){var _0x15aebc=this;return new Promise(function(_0x3c3eac,_0x48d5a6){return db[_0xb014('0x16')][_0xb014('0x17')]({'raw':_0xcae813['options']?_0xcae813[_0xb014('0x18')][_0xb014('0x19')]===undefined?!![]:![]:!![],'where':_0xcae813['options']?_0xcae813['options'][_0xb014('0x1a')]||null:null,'attributes':_0xcae813[_0xb014('0x18')]?_0xcae813[_0xb014('0x18')][_0xb014('0x1b')]||null:null,'limit':_0xcae813[_0xb014('0x18')]?_0xcae813[_0xb014('0x18')][_0xb014('0x1c')]||null:null,'include':_0xcae813[_0xb014('0x18')]?_0xcae813['options'][_0xb014('0x1d')]?_[_0xb014('0x1e')](_0xcae813[_0xb014('0x18')][_0xb014('0x1d')],function(_0x501f3d){return{'model':db[_0x501f3d[_0xb014('0x1f')]],'as':_0x501f3d['as'],'attributes':_0x501f3d[_0xb014('0x1b')],'include':_0x501f3d[_0xb014('0x1d')]?_[_0xb014('0x1e')](_0x501f3d['include'],function(_0x59c844){return{'model':db[_0x59c844[_0xb014('0x1f')]],'as':_0x59c844['as'],'attributes':_0x59c844['attributes'],'include':_0x59c844[_0xb014('0x1d')]?_[_0xb014('0x1e')](_0x59c844[_0xb014('0x1d')],function(_0x2b825a){return{'model':db[_0x2b825a[_0xb014('0x1f')]],'as':_0x2b825a['as'],'attributes':_0x2b825a[_0xb014('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb014('0xc')](function(_0x2124c2){logger[_0xb014('0x20')](_0xb014('0x15'),_0xcae813);logger[_0xb014('0x21')](_0xb014('0x15'),_0xcae813,JSON[_0xb014('0xf')](_0x2124c2));_0x3c3eac(_0x2124c2);})['catch'](function(_0x4260da){logger[_0xb014('0x10')]('GetVoiceCallReport',_0x4260da['message'],_0xcae813);_0x48d5a6(_0x15aebc[_0xb014('0x10')](0x1f4,_0x4260da[_0xb014('0x13')]));});});};exports[_0xb014('0x22')]=function(_0x3b8b6d){var _0x430513=this;return new Promise(function(_0x5ae67a,_0x2b04ee){return db['VoiceCallReport'][_0xb014('0x23')](_0x3b8b6d['body'],{'raw':_0x3b8b6d[_0xb014('0x18')]?_0x3b8b6d[_0xb014('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xb014('0xc')](function(_0x3dffbe){logger[_0xb014('0x20')](_0xb014('0x22'),_0x3b8b6d);logger[_0xb014('0x21')](_0xb014('0x22'),_0x3b8b6d,JSON['stringify'](_0x3dffbe));_0x5ae67a(_0x3dffbe);})[_0xb014('0x14')](function(_0x3a1cae){logger[_0xb014('0x10')]('CreateVoiceCallReport',_0x3a1cae[_0xb014('0x13')],_0x3b8b6d);_0x2b04ee(_0x430513[_0xb014('0x10')](0x1f4,_0x3a1cae[_0xb014('0x13')]));});});};exports[_0xb014('0x24')]=function(_0x47a09b){var _0x17658c=this;return new Promise(function(_0x2292bc,_0x2547fc){return db['VoiceCallReport'][_0xb014('0x25')](_0x47a09b[_0xb014('0x26')],{'raw':_0x47a09b[_0xb014('0x18')]?_0x47a09b[_0xb014('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47a09b['options']?_0x47a09b[_0xb014('0x18')][_0xb014('0x1a')]||null:null,'attributes':_0x47a09b[_0xb014('0x18')]?_0x47a09b[_0xb014('0x18')][_0xb014('0x1b')]||null:null,'limit':_0x47a09b[_0xb014('0x18')]?_0x47a09b[_0xb014('0x18')][_0xb014('0x1c')]||null:null})[_0xb014('0xc')](function(_0x58b30c){logger[_0xb014('0x20')](_0xb014('0x24'),_0x47a09b);logger[_0xb014('0x21')](_0xb014('0x24'),_0x47a09b,JSON['stringify'](_0x58b30c));_0x2292bc(_0x58b30c);})[_0xb014('0x14')](function(_0x57e112){logger[_0xb014('0x10')]('UpdateVoiceCallReport',_0x57e112['message'],_0x47a09b);_0x2547fc(_0x17658c[_0xb014('0x10')](0x1f4,_0x57e112[_0xb014('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js
index d24bf27..0c78ace 100644
--- a/server/api/voiceChanSpy/index.js
+++ b/server/api/voiceChanSpy/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4098=['./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','Router','../../components/auth/service'];(function(_0xcb259a,_0x37c291){var _0x21e90b=function(_0x1056c9){while(--_0x1056c9){_0xcb259a['push'](_0xcb259a['shift']());}};_0x21e90b(++_0x37c291);}(_0x4098,0x129));var _0x8409=function(_0x1ebb10,_0x156b3e){_0x1ebb10=_0x1ebb10-0x0;var _0x20d709=_0x4098[_0x1ebb10];return _0x20d709;};'use strict';var multer=require(_0x8409('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8409('0x1')]();var auth=require(_0x8409('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8409('0x3'));router[_0x8409('0x4')]('/',auth['isAuthenticated'](),controller[_0x8409('0x5')]);router[_0x8409('0x4')](_0x8409('0x6'),auth[_0x8409('0x7')](),controller[_0x8409('0x8')]);router[_0x8409('0x9')]('/',auth[_0x8409('0x7')](),controller['create']);router[_0x8409('0xa')]('/:id',auth[_0x8409('0x7')](),controller[_0x8409('0xb')]);router[_0x8409('0xc')](_0x8409('0x6'),auth['isAuthenticated'](),controller[_0x8409('0xd')]);module[_0x8409('0xe')]=router;
\ No newline at end of file
+var _0xeb69=['post','create','put','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0xeb69,0x14a));var _0x9eb6=function(_0xb764ce,_0x40efa3){_0xb764ce=_0xb764ce-0x0;var _0x2d0ccd=_0xeb69[_0xb764ce];return _0x2d0ccd;};'use strict';var multer=require(_0x9eb6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9eb6('0x1'));var express=require(_0x9eb6('0x2'));var router=express[_0x9eb6('0x3')]();var auth=require(_0x9eb6('0x4'));var interaction=require(_0x9eb6('0x5'));var config=require(_0x9eb6('0x6'));var controller=require(_0x9eb6('0x7'));router[_0x9eb6('0x8')]('/',auth[_0x9eb6('0x9')](),controller[_0x9eb6('0xa')]);router[_0x9eb6('0x8')](_0x9eb6('0xb'),auth[_0x9eb6('0x9')](),controller['show']);router[_0x9eb6('0xc')]('/',auth[_0x9eb6('0x9')](),controller[_0x9eb6('0xd')]);router[_0x9eb6('0xe')]('/:id',auth[_0x9eb6('0x9')](),controller[_0x9eb6('0xf')]);router[_0x9eb6('0x10')](_0x9eb6('0xb'),auth[_0x9eb6('0x9')](),controller[_0x9eb6('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js
index 87fc3df..b416025 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.attributes.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5807=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x55eef6,_0x1550bb){var _0x367185=function(_0xb24b49){while(--_0xb24b49){_0x55eef6['push'](_0x55eef6['shift']());}};_0x367185(++_0x1550bb);}(_0x5807,0xe8));var _0x7580=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0x5807[_0x351509];return _0x4e9861;};'use strict';var Sequelize=require(_0x7580('0x0'));module[_0x7580('0x1')]={'name':{'type':Sequelize[_0x7580('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x7580('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x36567c){this[_0x7580('0x4')](_0x7580('0x5'),_0x36567c?_0x36567c[_0x7580('0x6')](''):[]);},'get':function(){return this[_0x7580('0x7')](_0x7580('0x5'))?this[_0x7580('0x7')](_0x7580('0x5'))[_0x7580('0x8')](''):[];}},'auth':{'type':Sequelize[_0x7580('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x7580('0x2')]},'record':{'type':Sequelize[_0x7580('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xdc98=['options','BOOLEAN','exports','STRING','name','setDataValue','getDataValue'];(function(_0x17f63a,_0x56ca2b){var _0x25abc9=function(_0x38b686){while(--_0x38b686){_0x17f63a['push'](_0x17f63a['shift']());}};_0x25abc9(++_0x56ca2b);}(_0xdc98,0x175));var _0x8dc9=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xdc98[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0x8dc9('0x0')]={'name':{'type':Sequelize[_0x8dc9('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x8dc9('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x10d296){this[_0x8dc9('0x3')]('options',_0x10d296?_0x10d296['join'](''):[]);},'get':function(){return this[_0x8dc9('0x4')](_0x8dc9('0x5'))?this[_0x8dc9('0x4')]('options')['split'](''):[];}},'auth':{'type':Sequelize[_0x8dc9('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x8dc9('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x8dc9('0x1')]},'description':{'type':Sequelize[_0x8dc9('0x1')]}};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js
index b1b3152..1f7ec71 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.controller.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05bf=['filter','map','type','VIRTUAL','field','merge','options','include','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','send','VoiceChanSpy','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x37bd36,_0x32f3a2){var _0x3beb96=function(_0x4f058d){while(--_0x4f058d){_0x37bd36['push'](_0x37bd36['shift']());}};_0x3beb96(++_0x32f3a2);}(_0x05bf,0x10e));var _0xf05b=function(_0x3a99a7,_0x4e2892){_0x3a99a7=_0x3a99a7-0x0;var _0x1a6bed=_0x05bf[_0x3a99a7];return _0x1a6bed;};'use strict';var pdf=require(_0xf05b('0x0'));var emlformat=require(_0xf05b('0x1'));var rimraf=require(_0xf05b('0x2'));var zipdir=require(_0xf05b('0x3'));var jsonpatch=require(_0xf05b('0x4'));var rp=require('request-promise');var moment=require(_0xf05b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf05b('0x6'));var util=require(_0xf05b('0x7'));var path=require(_0xf05b('0x8'));var sox=require(_0xf05b('0x9'));var csv=require('to-csv');var ejs=require(_0xf05b('0xa'));var fs=require('fs');var _=require(_0xf05b('0xb'));var squel=require(_0xf05b('0xc'));var crypto=require(_0xf05b('0xd'));var jsforce=require(_0xf05b('0xe'));var deskjs=require(_0xf05b('0xf'));var toCsv=require(_0xf05b('0x10'));var querystring=require(_0xf05b('0x11'));var Papa=require(_0xf05b('0x12'));var Redis=require('ioredis');var authService=require(_0xf05b('0x13'));var qs=require(_0xf05b('0x14'));var hardwareService=require(_0xf05b('0x15'));var logger=require(_0xf05b('0x16'))(_0xf05b('0x17'));var utils=require(_0xf05b('0x18'));var config=require(_0xf05b('0x19'));var db=require(_0xf05b('0x1a'))['db'];function respondWithStatusCode(_0x390eb4,_0x4daf49){_0x4daf49=_0x4daf49||0xcc;return function(_0x4e0ac8){if(_0x4e0ac8){return _0x390eb4[_0xf05b('0x1b')](_0x4daf49);}return _0x390eb4[_0xf05b('0x1c')](_0x4daf49)[_0xf05b('0x1d')]();};}function respondWithResult(_0x59823a,_0x29303c){_0x29303c=_0x29303c||0xc8;return function(_0x119406){if(_0x119406){return _0x59823a['status'](_0x29303c)['json'](_0x119406);}};}function respondWithFilteredResult(_0x7983e7,_0x34202e){return function(_0x3e5d53){if(_0x3e5d53){var _0xc9d746=_0x3e5d53[_0xf05b('0x1e')],_0x46d18d=_0x34202e[_0xf05b('0x1f')],_0x2d72ea=_0x34202e[_0xf05b('0x1f')]+_0x34202e[_0xf05b('0x20')],_0x235d57;if(_0x2d72ea>=_0xc9d746){_0x2d72ea=_0xc9d746;_0x235d57=0xc8;}else{_0x235d57=0xce;}_0x7983e7['status'](_0x235d57);return _0x7983e7[_0xf05b('0x21')](_0xf05b('0x22'),_0x46d18d+'-'+_0x2d72ea+'/'+_0xc9d746)[_0xf05b('0x23')](_0x3e5d53);}return null;};}function patchUpdates(_0x45a80d){return function(_0x50e4aa){try{jsonpatch[_0xf05b('0x24')](_0x50e4aa,_0x45a80d,!![]);}catch(_0x1d5e36){return BPromise[_0xf05b('0x25')](_0x1d5e36);}return _0x50e4aa[_0xf05b('0x26')]();};}function saveUpdates(_0x5a2998,_0x3278fd){return function(_0x2dd06d){if(_0x2dd06d){return _0x2dd06d[_0xf05b('0x27')](_0x5a2998)[_0xf05b('0x28')](function(_0xdecd8a){return _0xdecd8a;});}return null;};}function removeEntity(_0x5b7c29,_0x1be651){return function(_0x397a97){if(_0x397a97){return _0x397a97[_0xf05b('0x29')]()[_0xf05b('0x28')](function(){var _0x1c3f2d=_0x397a97[_0xf05b('0x2a')]({'plain':!![]});var _0x9a39dd=_0xf05b('0x2b');return db[_0xf05b('0x2c')][_0xf05b('0x29')]({'where':{'type':_0x9a39dd,'resourceId':_0x1c3f2d['id']}})[_0xf05b('0x28')](function(){return _0x397a97;});})[_0xf05b('0x28')](function(){_0x5b7c29['status'](0xcc)[_0xf05b('0x1d')]();});}};}function handleEntityNotFound(_0x27fe10,_0x4ff7ea){return function(_0x535010){if(!_0x535010){_0x27fe10[_0xf05b('0x1b')](0x194);}return _0x535010;};}function handleError(_0x250161,_0x532d2f){_0x532d2f=_0x532d2f||0x1f4;return function(_0x5a4c6f){logger[_0xf05b('0x2d')](_0x5a4c6f[_0xf05b('0x2e')]);if(_0x5a4c6f['name']){delete _0x5a4c6f['name'];}_0x250161[_0xf05b('0x1c')](_0x532d2f)[_0xf05b('0x2f')](_0x5a4c6f);};}exports['index']=function(_0x23dc4,_0x2a2d06){var _0x2e3a05={},_0x2616ce={},_0x4704ff={'count':0x0,'rows':[]};var _0x4da1bd=db[_0xf05b('0x30')]['rawAttributes'];_0x2616ce['model']=_[_0xf05b('0x31')](_0x4da1bd);_0x2616ce[_0xf05b('0x32')]=_[_0xf05b('0x31')](_0x23dc4['query']);_0x2616ce[_0xf05b('0x33')]=_[_0xf05b('0x34')](_0x2616ce[_0xf05b('0x35')],_0x2616ce['query']);_0x2e3a05[_0xf05b('0x36')]=_['intersection'](_0x2616ce['model'],qs[_0xf05b('0x37')](_0x23dc4['query'][_0xf05b('0x37')]));_0x2e3a05['attributes']=_0x2e3a05['attributes'][_0xf05b('0x38')]?_0x2e3a05[_0xf05b('0x36')]:_0x2616ce[_0xf05b('0x35')];if(!_0x23dc4[_0xf05b('0x32')][_0xf05b('0x39')]('nolimit')){_0x2e3a05['limit']=qs['limit'](_0x23dc4[_0xf05b('0x32')][_0xf05b('0x20')]);_0x2e3a05[_0xf05b('0x1f')]=qs['offset'](_0x23dc4[_0xf05b('0x32')][_0xf05b('0x1f')]);}_0x2e3a05[_0xf05b('0x3a')]=qs[_0xf05b('0x3b')](_0x23dc4[_0xf05b('0x32')][_0xf05b('0x3b')]);_0x2e3a05[_0xf05b('0x3c')]=qs[_0xf05b('0x33')](_[_0xf05b('0x3d')](_0x23dc4[_0xf05b('0x32')],_0x2616ce[_0xf05b('0x33')]));if(_0x23dc4['query'][_0xf05b('0x3e')]){_0x2e3a05['where']=_['merge'](_0x2e3a05[_0xf05b('0x3c')],{'$or':_[_0xf05b('0x3f')](_0x4da1bd,function(_0x3839c4){if(_0x3839c4[_0xf05b('0x40')]['key']!==_0xf05b('0x41')){var _0x49aaaa={};_0x49aaaa[_0x3839c4[_0xf05b('0x42')]]={'$like':'%'+_0x23dc4['query'][_0xf05b('0x3e')]+'%'};return _0x49aaaa;}})});}_0x2e3a05=_[_0xf05b('0x43')]({},_0x2e3a05,_0x23dc4[_0xf05b('0x44')]);var _0x5d45d5={'where':_0x2e3a05['where']};return db[_0xf05b('0x30')][_0xf05b('0x1e')](_0x5d45d5)[_0xf05b('0x28')](function(_0x1efd65){_0x4704ff[_0xf05b('0x1e')]=_0x1efd65;if(_0x23dc4[_0xf05b('0x32')]['includeAll']){_0x2e3a05[_0xf05b('0x45')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x2e3a05);})[_0xf05b('0x28')](function(_0x76b334){_0x4704ff['rows']=_0x76b334;return _0x4704ff;})['then'](respondWithFilteredResult(_0x2a2d06,_0x2e3a05))[_0xf05b('0x46')](handleError(_0x2a2d06,null));};exports['show']=function(_0xce0776,_0x2231cf){var _0x449b06={'raw':![],'where':{'id':_0xce0776[_0xf05b('0x47')]['id']}},_0x42f9ca={};_0x42f9ca[_0xf05b('0x35')]=_[_0xf05b('0x31')](db[_0xf05b('0x30')]['rawAttributes']);_0x42f9ca[_0xf05b('0x32')]=_[_0xf05b('0x31')](_0xce0776['query']);_0x42f9ca[_0xf05b('0x33')]=_[_0xf05b('0x34')](_0x42f9ca[_0xf05b('0x35')],_0x42f9ca[_0xf05b('0x32')]);_0x449b06['attributes']=_[_0xf05b('0x34')](_0x42f9ca[_0xf05b('0x35')],qs[_0xf05b('0x37')](_0xce0776['query']['fields']));_0x449b06[_0xf05b('0x36')]=_0x449b06['attributes'][_0xf05b('0x38')]?_0x449b06[_0xf05b('0x36')]:_0x42f9ca['model'];if(_0xce0776[_0xf05b('0x32')][_0xf05b('0x48')]){_0x449b06['include']=[{'all':!![]}];}_0x449b06=_[_0xf05b('0x43')]({},_0x449b06,_0xce0776['options']);return db[_0xf05b('0x30')][_0xf05b('0x49')](_0x449b06)[_0xf05b('0x28')](handleEntityNotFound(_0x2231cf,null))['then'](respondWithResult(_0x2231cf,null))[_0xf05b('0x46')](handleError(_0x2231cf,null));};exports[_0xf05b('0x4a')]=function(_0x211ae0,_0x28e584){return db[_0xf05b('0x30')][_0xf05b('0x4a')](_0x211ae0[_0xf05b('0x4b')],{})[_0xf05b('0x28')](function(_0x552f20){var _0x5093fb=_0x211ae0[_0xf05b('0x4c')][_0xf05b('0x2a')]({'plain':!![]});if(!_0x5093fb)throw new Error(_0xf05b('0x4d'));if(_0x5093fb[_0xf05b('0x4e')]==='user'){var _0x226435=_0x552f20['get']({'plain':!![]});var _0x4f5710=_0xf05b('0x2b');return db[_0xf05b('0x4f')][_0xf05b('0x49')]({'where':{'name':_0x4f5710,'userProfileId':_0x5093fb['userProfileId']},'raw':!![]})[_0xf05b('0x28')](function(_0x18acaf){if(_0x18acaf&&_0x18acaf[_0xf05b('0x50')]===0x0){return db[_0xf05b('0x2c')][_0xf05b('0x4a')]({'name':_0x226435[_0xf05b('0x51')],'resourceId':_0x226435['id'],'type':_0x18acaf[_0xf05b('0x51')],'sectionId':_0x18acaf['id']},{})[_0xf05b('0x28')](function(){return _0x552f20;});}else{return _0x552f20;}})[_0xf05b('0x46')](function(_0x571ab6){logger[_0xf05b('0x2d')](_0xf05b('0x52'),_0x571ab6);throw _0x571ab6;});}return _0x552f20;})['then'](respondWithResult(_0x28e584,0xc9))[_0xf05b('0x46')](handleError(_0x28e584,null));};exports[_0xf05b('0x27')]=function(_0x2abe25,_0x1c1fbb){if(_0x2abe25[_0xf05b('0x4b')]['id']){delete _0x2abe25[_0xf05b('0x4b')]['id'];}return db[_0xf05b('0x30')][_0xf05b('0x49')]({'where':{'id':_0x2abe25[_0xf05b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c1fbb,null))['then'](saveUpdates(_0x2abe25[_0xf05b('0x4b')],null))[_0xf05b('0x28')](respondWithResult(_0x1c1fbb,null))[_0xf05b('0x46')](handleError(_0x1c1fbb,null));};exports[_0xf05b('0x29')]=function(_0x194f4c,_0x48b38e){return db[_0xf05b('0x30')][_0xf05b('0x49')]({'where':{'id':_0x194f4c[_0xf05b('0x47')]['id']}})[_0xf05b('0x28')](handleEntityNotFound(_0x48b38e,null))['then'](removeEntity(_0x48b38e,null))[_0xf05b('0x46')](handleError(_0x48b38e,null));};
\ No newline at end of file
+var _0xd14c=['mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','ChanSpies','error','stack','index','VoiceChanSpy','rawAttributes','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','where','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x167a87,_0xe1455c){var _0x5e9076=function(_0x3b5773){while(--_0x3b5773){_0x167a87['push'](_0x167a87['shift']());}};_0x5e9076(++_0xe1455c);}(_0xd14c,0x180));var _0xcd14=function(_0x4ca526,_0x404b13){_0x4ca526=_0x4ca526-0x0;var _0x3b14dc=_0xd14c[_0x4ca526];return _0x3b14dc;};'use strict';var pdf=require(_0xcd14('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcd14('0x1'));var zipdir=require(_0xcd14('0x2'));var jsonpatch=require(_0xcd14('0x3'));var rp=require('request-promise');var moment=require(_0xcd14('0x4'));var BPromise=require(_0xcd14('0x5'));var Mustache=require(_0xcd14('0x6'));var util=require(_0xcd14('0x7'));var path=require(_0xcd14('0x8'));var sox=require(_0xcd14('0x9'));var csv=require(_0xcd14('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcd14('0xb'));var squel=require(_0xcd14('0xc'));var crypto=require('crypto');var jsforce=require(_0xcd14('0xd'));var deskjs=require(_0xcd14('0xe'));var toCsv=require(_0xcd14('0xa'));var querystring=require(_0xcd14('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcd14('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xcd14('0x11'));var logger=require('../../config/logger')(_0xcd14('0x12'));var utils=require('../../config/utils');var config=require(_0xcd14('0x13'));var db=require(_0xcd14('0x14'))['db'];function respondWithStatusCode(_0x3ed017,_0x4d4236){_0x4d4236=_0x4d4236||0xcc;return function(_0x148440){if(_0x148440){return _0x3ed017[_0xcd14('0x15')](_0x4d4236);}return _0x3ed017['status'](_0x4d4236)[_0xcd14('0x16')]();};}function respondWithResult(_0x5b2f4,_0x359a4d){_0x359a4d=_0x359a4d||0xc8;return function(_0x5c7934){if(_0x5c7934){return _0x5b2f4[_0xcd14('0x17')](_0x359a4d)[_0xcd14('0x18')](_0x5c7934);}};}function respondWithFilteredResult(_0x49d467,_0x5059ef){return function(_0x404d1d){if(_0x404d1d){var _0x1d6e73=_0x404d1d[_0xcd14('0x19')],_0xd7a3a1=_0x5059ef['offset'],_0x42e598=_0x5059ef[_0xcd14('0x1a')]+_0x5059ef[_0xcd14('0x1b')],_0x31075b;if(_0x42e598>=_0x1d6e73){_0x42e598=_0x1d6e73;_0x31075b=0xc8;}else{_0x31075b=0xce;}_0x49d467[_0xcd14('0x17')](_0x31075b);return _0x49d467[_0xcd14('0x1c')]('Content-Range',_0xd7a3a1+'-'+_0x42e598+'/'+_0x1d6e73)[_0xcd14('0x18')](_0x404d1d);}return null;};}function patchUpdates(_0xcc1e0b){return function(_0x21662e){try{jsonpatch[_0xcd14('0x1d')](_0x21662e,_0xcc1e0b,!![]);}catch(_0x2fe6b0){return BPromise[_0xcd14('0x1e')](_0x2fe6b0);}return _0x21662e[_0xcd14('0x1f')]();};}function saveUpdates(_0x5ea884,_0x43bd64){return function(_0x43dda8){if(_0x43dda8){return _0x43dda8[_0xcd14('0x20')](_0x5ea884)[_0xcd14('0x21')](function(_0x1d88bd){return _0x1d88bd;});}return null;};}function removeEntity(_0x34ba0c,_0x457349){return function(_0x21d586){if(_0x21d586){return _0x21d586[_0xcd14('0x22')]()[_0xcd14('0x21')](function(){var _0x2e22f5=_0x21d586[_0xcd14('0x23')]({'plain':!![]});var _0x5a6bfd=_0xcd14('0x24');return db['UserProfileResource'][_0xcd14('0x22')]({'where':{'type':_0x5a6bfd,'resourceId':_0x2e22f5['id']}})[_0xcd14('0x21')](function(){return _0x21d586;});})[_0xcd14('0x21')](function(){_0x34ba0c['status'](0xcc)[_0xcd14('0x16')]();});}};}function handleEntityNotFound(_0x2d1ed9,_0x589403){return function(_0x5b1a14){if(!_0x5b1a14){_0x2d1ed9['sendStatus'](0x194);}return _0x5b1a14;};}function handleError(_0xc1a05b,_0x3950d5){_0x3950d5=_0x3950d5||0x1f4;return function(_0x11e659){logger[_0xcd14('0x25')](_0x11e659[_0xcd14('0x26')]);if(_0x11e659['name']){delete _0x11e659['name'];}_0xc1a05b[_0xcd14('0x17')](_0x3950d5)['send'](_0x11e659);};}exports[_0xcd14('0x27')]=function(_0x1d45de,_0x40a8d4){var _0x355c85={},_0x5c0ff1={},_0x2c80f9={'count':0x0,'rows':[]};var _0x4b1025=db[_0xcd14('0x28')][_0xcd14('0x29')];_0x5c0ff1[_0xcd14('0x2a')]=_[_0xcd14('0x2b')](_0x4b1025);_0x5c0ff1['query']=_[_0xcd14('0x2b')](_0x1d45de[_0xcd14('0x2c')]);_0x5c0ff1[_0xcd14('0x2d')]=_['intersection'](_0x5c0ff1[_0xcd14('0x2a')],_0x5c0ff1[_0xcd14('0x2c')]);_0x355c85[_0xcd14('0x2e')]=_[_0xcd14('0x2f')](_0x5c0ff1[_0xcd14('0x2a')],qs['fields'](_0x1d45de[_0xcd14('0x2c')]['fields']));_0x355c85[_0xcd14('0x2e')]=_0x355c85[_0xcd14('0x2e')][_0xcd14('0x30')]?_0x355c85[_0xcd14('0x2e')]:_0x5c0ff1[_0xcd14('0x2a')];if(!_0x1d45de[_0xcd14('0x2c')][_0xcd14('0x31')](_0xcd14('0x32'))){_0x355c85[_0xcd14('0x1b')]=qs['limit'](_0x1d45de[_0xcd14('0x2c')][_0xcd14('0x1b')]);_0x355c85[_0xcd14('0x1a')]=qs['offset'](_0x1d45de[_0xcd14('0x2c')][_0xcd14('0x1a')]);}_0x355c85[_0xcd14('0x33')]=qs['sort'](_0x1d45de[_0xcd14('0x2c')]['sort']);_0x355c85[_0xcd14('0x34')]=qs[_0xcd14('0x2d')](_['pick'](_0x1d45de['query'],_0x5c0ff1['filters']));if(_0x1d45de['query']['filter']){_0x355c85['where']=_[_0xcd14('0x35')](_0x355c85[_0xcd14('0x34')],{'$or':_[_0xcd14('0x36')](_0x4b1025,function(_0x3cb5d6){if(_0x3cb5d6[_0xcd14('0x37')][_0xcd14('0x38')]!==_0xcd14('0x39')){var _0x128c8e={};_0x128c8e[_0x3cb5d6[_0xcd14('0x3a')]]={'$like':'%'+_0x1d45de[_0xcd14('0x2c')]['filter']+'%'};return _0x128c8e;}})});}_0x355c85=_['merge']({},_0x355c85,_0x1d45de['options']);var _0x29b76a={'where':_0x355c85['where']};return db[_0xcd14('0x28')][_0xcd14('0x19')](_0x29b76a)[_0xcd14('0x21')](function(_0x36ff61){_0x2c80f9[_0xcd14('0x19')]=_0x36ff61;if(_0x1d45de[_0xcd14('0x2c')][_0xcd14('0x3b')]){_0x355c85[_0xcd14('0x3c')]=[{'all':!![]}];}return db[_0xcd14('0x28')][_0xcd14('0x3d')](_0x355c85);})[_0xcd14('0x21')](function(_0x5eb7da){_0x2c80f9[_0xcd14('0x3e')]=_0x5eb7da;return _0x2c80f9;})[_0xcd14('0x21')](respondWithFilteredResult(_0x40a8d4,_0x355c85))['catch'](handleError(_0x40a8d4,null));};exports[_0xcd14('0x3f')]=function(_0x4f98f5,_0x19493e){var _0x3cc8b0={'raw':![],'where':{'id':_0x4f98f5[_0xcd14('0x40')]['id']}},_0x51139a={};_0x51139a[_0xcd14('0x2a')]=_[_0xcd14('0x2b')](db['VoiceChanSpy'][_0xcd14('0x29')]);_0x51139a[_0xcd14('0x2c')]=_[_0xcd14('0x2b')](_0x4f98f5[_0xcd14('0x2c')]);_0x51139a['filters']=_[_0xcd14('0x2f')](_0x51139a['model'],_0x51139a[_0xcd14('0x2c')]);_0x3cc8b0[_0xcd14('0x2e')]=_[_0xcd14('0x2f')](_0x51139a[_0xcd14('0x2a')],qs[_0xcd14('0x41')](_0x4f98f5[_0xcd14('0x2c')]['fields']));_0x3cc8b0[_0xcd14('0x2e')]=_0x3cc8b0[_0xcd14('0x2e')][_0xcd14('0x30')]?_0x3cc8b0[_0xcd14('0x2e')]:_0x51139a[_0xcd14('0x2a')];if(_0x4f98f5[_0xcd14('0x2c')][_0xcd14('0x3b')]){_0x3cc8b0[_0xcd14('0x3c')]=[{'all':!![]}];}_0x3cc8b0=_[_0xcd14('0x35')]({},_0x3cc8b0,_0x4f98f5[_0xcd14('0x42')]);return db[_0xcd14('0x28')][_0xcd14('0x43')](_0x3cc8b0)['then'](handleEntityNotFound(_0x19493e,null))[_0xcd14('0x21')](respondWithResult(_0x19493e,null))[_0xcd14('0x44')](handleError(_0x19493e,null));};exports[_0xcd14('0x45')]=function(_0x4e33f4,_0x44069f){return db[_0xcd14('0x28')]['create'](_0x4e33f4[_0xcd14('0x46')],{})[_0xcd14('0x21')](function(_0x253b6e){var _0x433bde=_0x4e33f4[_0xcd14('0x47')][_0xcd14('0x23')]({'plain':!![]});if(!_0x433bde)throw new Error(_0xcd14('0x48'));if(_0x433bde[_0xcd14('0x49')]===_0xcd14('0x47')){var _0x4422bc=_0x253b6e[_0xcd14('0x23')]({'plain':!![]});var _0x200982=_0xcd14('0x24');return db['UserProfileSection'][_0xcd14('0x43')]({'where':{'name':_0x200982,'userProfileId':_0x433bde['userProfileId']},'raw':!![]})['then'](function(_0x4be5b7){if(_0x4be5b7&&_0x4be5b7[_0xcd14('0x4a')]===0x0){return db[_0xcd14('0x4b')][_0xcd14('0x45')]({'name':_0x4422bc[_0xcd14('0x4c')],'resourceId':_0x4422bc['id'],'type':_0x4be5b7[_0xcd14('0x4c')],'sectionId':_0x4be5b7['id']},{})[_0xcd14('0x21')](function(){return _0x253b6e;});}else{return _0x253b6e;}})[_0xcd14('0x44')](function(_0x59bcde){logger[_0xcd14('0x25')](_0xcd14('0x4d'),_0x59bcde);throw _0x59bcde;});}return _0x253b6e;})[_0xcd14('0x21')](respondWithResult(_0x44069f,0xc9))[_0xcd14('0x44')](handleError(_0x44069f,null));};exports[_0xcd14('0x20')]=function(_0x298741,_0x1f3953){if(_0x298741[_0xcd14('0x46')]['id']){delete _0x298741[_0xcd14('0x46')]['id'];}return db['VoiceChanSpy'][_0xcd14('0x43')]({'where':{'id':_0x298741[_0xcd14('0x40')]['id']}})[_0xcd14('0x21')](handleEntityNotFound(_0x1f3953,null))[_0xcd14('0x21')](saveUpdates(_0x298741['body'],null))[_0xcd14('0x21')](respondWithResult(_0x1f3953,null))[_0xcd14('0x44')](handleError(_0x1f3953,null));};exports[_0xcd14('0x22')]=function(_0x417f4f,_0x38fc76){return db[_0xcd14('0x28')][_0xcd14('0x43')]({'where':{'id':_0x417f4f[_0xcd14('0x40')]['id']}})[_0xcd14('0x21')](handleEntityNotFound(_0x38fc76,null))['then'](removeEntity(_0x38fc76,null))[_0xcd14('0x44')](handleError(_0x38fc76,null));};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js
index 3ce679e..a346140 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.model.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcc73=['SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','catch','models','VoiceChanSpy','then','bulkCreate','destroy','VoiceExtension','util','bluebird','context','from-sip','format','%s%s','prefix','push','merge','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','Authenticate','password','ChanSpy'];(function(_0x10afec,_0x181559){var _0x34c458=function(_0x46e5c8){while(--_0x46e5c8){_0x10afec['push'](_0x10afec['shift']());}};_0x34c458(++_0x181559);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xcc73[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x3cc7('0x0'));var BPromise=require(_0x3cc7('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x5055f9,_0x11b326,_0x571514){var _0x445dce=0x1;var _0x5054fb=[];var _0x5de4be={'context':_0x11b326[_0x3cc7('0x2')]||_0x3cc7('0x3'),'exten':util[_0x3cc7('0x4')](_0x3cc7('0x5'),_0x5055f9[_0x3cc7('0x6')],_0x571514),'type':'system','isApp':![],'ChanSpyId':_0x5055f9['id'],'UserId':_0x11b326['id']};_0x5054fb[_0x3cc7('0x7')](_[_0x3cc7('0x8')]({'app':_0x3cc7('0x9'),'appdata':util[_0x3cc7('0x4')]('CDR(type)=%s',_0x3cc7('0xa')),'priority':_0x445dce++},_0x5de4be));if(_0x5055f9[_0x3cc7('0xb')]){_0x5054fb[_0x3cc7('0x7')](_[_0x3cc7('0x8')]({'app':_0x3cc7('0xc'),'appdata':util[_0x3cc7('0x4')](_0x3cc7('0xd'),_0x5055f9['recordingFormat']),'priority':_0x445dce++},_0x5de4be));}if(_0x5055f9['auth']){_0x5054fb[_0x3cc7('0x7')](_['merge']({'app':_0x3cc7('0xe'),'appdata':_0x5055f9[_0x3cc7('0xf')],'priority':_0x445dce++},_0x5de4be));}_0x5054fb[_0x3cc7('0x7')](_[_0x3cc7('0x8')]({'app':_0x3cc7('0x10'),'appdata':util[_0x3cc7('0x4')](_0x3cc7('0x11'),_0x11b326[_0x3cc7('0x12')],_0x5055f9[_0x3cc7('0x13')]?_0x5055f9[_0x3cc7('0x13')][_0x3cc7('0x14')](''):''),'priority':_0x445dce++},_0x5de4be));if(_0x5055f9[_0x3cc7('0xb')]){_0x5054fb[_0x3cc7('0x7')](_[_0x3cc7('0x8')]({'app':_0x3cc7('0x15'),'priority':_0x445dce++},_0x5de4be));}return _0x5054fb;};var getChanSpyApplications=function(_0x857775,_0x2c4688){var _0x1320a8=[];for(var _0x386a31=0x0,_0x3f1ef0=0x1;_0x386a31<_0x2c4688[_0x3cc7('0x16')];_0x386a31++,_0x3f1ef0=0x1){_0x1320a8=_0x1320a8[_0x3cc7('0x17')](getUserApplications(_0x857775,_0x2c4688[_0x386a31],_0x2c4688[_0x386a31][_0x3cc7('0x18')]));if(_0x2c4688[_0x386a31][_0x3cc7('0x18')]!=_0x2c4688[_0x386a31][_0x3cc7('0x12')]){_0x1320a8=_0x1320a8[_0x3cc7('0x17')](getUserApplications(_0x857775,_0x2c4688[_0x386a31],_0x2c4688[_0x386a31][_0x3cc7('0x12')]));}}return _0x1320a8;};var getChanSpyPromise=function(_0x2483c9,_0x382727){return new BPromise(function(_0x54f825,_0x4d2396){return _0x2483c9[_0x3cc7('0x19')]['findAll']({'attributes':['id',_0x3cc7('0x12'),_0x3cc7('0x18')],'where':{'role':_0x3cc7('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x490730){if(_0x490730){return _0x54f825(getChanSpyApplications(_0x382727,_0x490730));}return _0x54f825([]);})[_0x3cc7('0x1b')](function(_0xffbcd9){_0x4d2396(_0xffbcd9);});});};module['exports']=function(_0x40906b,_0x2ff800){var _0x4bc893=_0x40906b[_0x3cc7('0x1c')];return _0x40906b['define'](_0x3cc7('0x1d'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1cfcee,_0x3b1fe6,_0x8f8709){return getChanSpyPromise(_0x4bc893,_0x1cfcee)[_0x3cc7('0x1e')](function(_0x29d2c8){if(_0x29d2c8&&_0x29d2c8[_0x3cc7('0x16')]){return _0x4bc893['VoiceExtension'][_0x3cc7('0x1f')](_0x29d2c8);}})[_0x3cc7('0x1e')](function(){_0x8f8709();})[_0x3cc7('0x1b')](function(_0x5f0a09){_0x8f8709(_0x5f0a09);});},'afterUpdate':function(_0x358c12,_0x595e7e,_0x58793b){return _0x4bc893['VoiceExtension'][_0x3cc7('0x20')]({'where':{'ChanSpyId':_0x358c12['id']}})[_0x3cc7('0x1e')](function(){return getChanSpyPromise(_0x4bc893,_0x358c12);})['then'](function(_0x5518cf){if(_0x5518cf&&_0x5518cf[_0x3cc7('0x16')]){return _0x4bc893[_0x3cc7('0x21')][_0x3cc7('0x1f')](_0x5518cf);}})[_0x3cc7('0x1e')](function(){_0x58793b();})[_0x3cc7('0x1b')](function(_0x3af533){_0x58793b(_0x3af533);});},'afterDestroy':function(_0x1e14b4,_0x3a5d5b,_0x30ccb6){return _0x4bc893[_0x3cc7('0x21')][_0x3cc7('0x20')]({'where':{'ChanSpyId':_0x1e14b4['id']}})[_0x3cc7('0x1e')](function(){_0x30ccb6();})[_0x3cc7('0x1b')](function(_0x160474){_0x30ccb6(_0x160474);});}}});};
\ No newline at end of file
+var _0x2f74=['options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,ab','recordingFormat','auth','push','password','ChanSpy','SIP/%s,%s','name'];(function(_0x3c22e1,_0x14ed36){var _0x4b3944=function(_0x5e4ab2){while(--_0x5e4ab2){_0x3c22e1['push'](_0x3c22e1['shift']());}};_0x4b3944(++_0x14ed36);}(_0x2f74,0xb7));var _0x42f7=function(_0x5670cb,_0xe6e20d){_0x5670cb=_0x5670cb-0x0;var _0x11dc29=_0x2f74[_0x5670cb];return _0x11dc29;};'use strict';var _=require(_0x42f7('0x0'));var util=require(_0x42f7('0x1'));var BPromise=require(_0x42f7('0x2'));var attributes=require(_0x42f7('0x3'));var getUserApplications=function(_0x414a24,_0x58d22d,_0x2d74c1){var _0x6b9bbe=0x1;var _0x15c1d6=[];var _0x499e0f={'context':_0x58d22d['context']||_0x42f7('0x4'),'exten':util[_0x42f7('0x5')](_0x42f7('0x6'),_0x414a24[_0x42f7('0x7')],_0x2d74c1),'type':_0x42f7('0x8'),'isApp':![],'ChanSpyId':_0x414a24['id'],'UserId':_0x58d22d['id']};_0x15c1d6['push'](_[_0x42f7('0x9')]({'app':_0x42f7('0xa'),'appdata':util[_0x42f7('0x5')](_0x42f7('0xb'),_0x42f7('0xc')),'priority':_0x6b9bbe++},_0x499e0f));if(_0x414a24[_0x42f7('0xd')]){_0x15c1d6['push'](_[_0x42f7('0x9')]({'app':'MixMonitor','appdata':util[_0x42f7('0x5')](_0x42f7('0xe'),_0x414a24[_0x42f7('0xf')]),'priority':_0x6b9bbe++},_0x499e0f));}if(_0x414a24[_0x42f7('0x10')]){_0x15c1d6[_0x42f7('0x11')](_[_0x42f7('0x9')]({'app':'Authenticate','appdata':_0x414a24[_0x42f7('0x12')],'priority':_0x6b9bbe++},_0x499e0f));}_0x15c1d6[_0x42f7('0x11')](_[_0x42f7('0x9')]({'app':_0x42f7('0x13'),'appdata':util['format'](_0x42f7('0x14'),_0x58d22d[_0x42f7('0x15')],_0x414a24[_0x42f7('0x16')]?_0x414a24[_0x42f7('0x16')][_0x42f7('0x17')](''):''),'priority':_0x6b9bbe++},_0x499e0f));if(_0x414a24[_0x42f7('0xd')]){_0x15c1d6[_0x42f7('0x11')](_[_0x42f7('0x9')]({'app':_0x42f7('0x18'),'priority':_0x6b9bbe++},_0x499e0f));}return _0x15c1d6;};var getChanSpyApplications=function(_0x2a6664,_0x45c185){var _0x155e54=[];for(var _0x2d321c=0x0,_0x4faeea=0x1;_0x2d321c<_0x45c185[_0x42f7('0x19')];_0x2d321c++,_0x4faeea=0x1){_0x155e54=_0x155e54[_0x42f7('0x1a')](getUserApplications(_0x2a6664,_0x45c185[_0x2d321c],_0x45c185[_0x2d321c][_0x42f7('0x1b')]));if(_0x45c185[_0x2d321c][_0x42f7('0x1b')]!=_0x45c185[_0x2d321c][_0x42f7('0x15')]){_0x155e54=_0x155e54[_0x42f7('0x1a')](getUserApplications(_0x2a6664,_0x45c185[_0x2d321c],_0x45c185[_0x2d321c][_0x42f7('0x15')]));}}return _0x155e54;};var getChanSpyPromise=function(_0x43a036,_0xa82a8d){return new BPromise(function(_0x2b75e0,_0xc9547c){return _0x43a036[_0x42f7('0x1c')][_0x42f7('0x1d')]({'attributes':['id',_0x42f7('0x15'),_0x42f7('0x1b')],'where':{'role':_0x42f7('0x1e'),'chanspy':!![]},'raw':!![]})[_0x42f7('0x1f')](function(_0x473f9b){if(_0x473f9b){return _0x2b75e0(getChanSpyApplications(_0xa82a8d,_0x473f9b));}return _0x2b75e0([]);})['catch'](function(_0x14b937){_0xc9547c(_0x14b937);});});};module[_0x42f7('0x20')]=function(_0x42f1da,_0x577e3c){var _0x4d82e2=_0x42f1da[_0x42f7('0x21')];return _0x42f1da[_0x42f7('0x22')](_0x42f7('0x23'),attributes,{'tableName':_0x42f7('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x27f6d9,_0x28167a,_0x1179a7){return getChanSpyPromise(_0x4d82e2,_0x27f6d9)[_0x42f7('0x1f')](function(_0x26cb01){if(_0x26cb01&&_0x26cb01[_0x42f7('0x19')]){return _0x4d82e2[_0x42f7('0x25')][_0x42f7('0x26')](_0x26cb01);}})['then'](function(){_0x1179a7();})[_0x42f7('0x27')](function(_0x453183){_0x1179a7(_0x453183);});},'afterUpdate':function(_0xc4a3c5,_0x482e8e,_0x1bc0cd){return _0x4d82e2['VoiceExtension'][_0x42f7('0x28')]({'where':{'ChanSpyId':_0xc4a3c5['id']}})[_0x42f7('0x1f')](function(){return getChanSpyPromise(_0x4d82e2,_0xc4a3c5);})['then'](function(_0x130349){if(_0x130349&&_0x130349['length']){return _0x4d82e2[_0x42f7('0x25')][_0x42f7('0x26')](_0x130349);}})[_0x42f7('0x1f')](function(){_0x1bc0cd();})[_0x42f7('0x27')](function(_0x3d877f){_0x1bc0cd(_0x3d877f);});},'afterDestroy':function(_0x362024,_0x13a553,_0x3f1962){return _0x4d82e2[_0x42f7('0x25')][_0x42f7('0x28')]({'where':{'ChanSpyId':_0x362024['id']}})['then'](function(){_0x3f1962();})[_0x42f7('0x27')](function(_0x6c4e2){_0x3f1962(_0x6c4e2);});}}});};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js
index 7aa4ecb..a47eece 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x32f8=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x4653f7,_0x3d3ae3){var _0x5454da=function(_0x448f55){while(--_0x448f55){_0x4653f7['push'](_0x4653f7['shift']());}};_0x5454da(++_0x3d3ae3);}(_0x32f8,0xaf));var _0x832f=function(_0x104146,_0x37b3c6){_0x104146=_0x104146-0x0;var _0x11fd8f=_0x32f8[_0x104146];return _0x11fd8f;};'use strict';var _=require(_0x832f('0x0'));var util=require(_0x832f('0x1'));var moment=require(_0x832f('0x2'));var BPromise=require('bluebird');var rs=require(_0x832f('0x3'));var fs=require('fs');var Redis=require(_0x832f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x832f('0x5'));var logger=require(_0x832f('0x6'))(_0x832f('0x7'));var config=require(_0x832f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x832f('0x9')][_0x832f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x449633,_0x4ebc6f,_0x418e83){return new BPromise(function(_0x34b9de,_0x568d25){return client[_0x832f('0xb')](_0x449633,_0x418e83)[_0x832f('0xc')](function(_0x1dd4ff){logger[_0x832f('0xd')](_0x832f('0xe'),_0x4ebc6f,'request\x20sent');logger[_0x832f('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x4ebc6f,_0x832f('0x10'),JSON[_0x832f('0x11')](_0x1dd4ff));if(_0x1dd4ff['error']){if(_0x1dd4ff[_0x832f('0x12')][_0x832f('0x13')]===0x1f4){logger[_0x832f('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x4ebc6f,_0x1dd4ff[_0x832f('0x12')][_0x832f('0x14')]);return _0x568d25(_0x1dd4ff[_0x832f('0x12')][_0x832f('0x14')]);}logger[_0x832f('0x12')](_0x832f('0xe'),_0x4ebc6f,_0x1dd4ff[_0x832f('0x12')]['message']);return _0x34b9de(_0x1dd4ff[_0x832f('0x12')][_0x832f('0x14')]);}else{logger[_0x832f('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x4ebc6f,_0x832f('0x10'));_0x34b9de(_0x1dd4ff['result'][_0x832f('0x14')]);}})[_0x832f('0x15')](function(_0x5f4977){logger['error'](_0x832f('0xe'),_0x4ebc6f,_0x5f4977);_0x568d25(_0x5f4977);});});}
\ No newline at end of file
+var _0x49ef=['http','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xd21fe7,_0x225a39){var _0x14d570=function(_0x3c0674){while(--_0x3c0674){_0xd21fe7['push'](_0xd21fe7['shift']());}};_0x14d570(++_0x225a39);}(_0x49ef,0x74));var _0xf49e=function(_0x28853c,_0x1aaf11){_0x28853c=_0x28853c-0x0;var _0x8b47=_0x49ef[_0x28853c];return _0x8b47;};'use strict';var _=require(_0xf49e('0x0'));var util=require('util');var moment=require(_0xf49e('0x1'));var BPromise=require(_0xf49e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf49e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf49e('0x4'));var logger=require(_0xf49e('0x5'))(_0xf49e('0x6'));var config=require(_0xf49e('0x7'));var jayson=require(_0xf49e('0x8'));var client=jayson[_0xf49e('0x9')][_0xf49e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c79bb,_0x3156f7,_0x5bdaa5){return new BPromise(function(_0x4d4377,_0x1ff9c0){return client['request'](_0x4c79bb,_0x5bdaa5)[_0xf49e('0xb')](function(_0x35142b){logger['info'](_0xf49e('0xc'),_0x3156f7,_0xf49e('0xd'));logger[_0xf49e('0xe')](_0xf49e('0xf'),_0x3156f7,_0xf49e('0xd'),JSON[_0xf49e('0x10')](_0x35142b));if(_0x35142b[_0xf49e('0x11')]){if(_0x35142b[_0xf49e('0x11')]['code']===0x1f4){logger['error'](_0xf49e('0xc'),_0x3156f7,_0x35142b[_0xf49e('0x11')][_0xf49e('0x12')]);return _0x1ff9c0(_0x35142b[_0xf49e('0x11')]['message']);}logger[_0xf49e('0x11')](_0xf49e('0xc'),_0x3156f7,_0x35142b['error'][_0xf49e('0x12')]);return _0x4d4377(_0x35142b[_0xf49e('0x11')][_0xf49e('0x12')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x3156f7,'request\x20sent');_0x4d4377(_0x35142b[_0xf49e('0x13')]['message']);}})[_0xf49e('0x14')](function(_0x2f0187){logger['error'](_0xf49e('0xc'),_0x3156f7,_0x2f0187);_0x1ff9c0(_0x2f0187);});});}
\ No newline at end of file
diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js
index 5e260f2..ed22627 100644
--- a/server/api/voiceContext/index.js
+++ b/server/api/voiceContext/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6582=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x3f79cc,_0x4e3db4){var _0x3fc412=function(_0xd39269){while(--_0xd39269){_0x3f79cc['push'](_0x3f79cc['shift']());}};_0x3fc412(++_0x4e3db4);}(_0x6582,0x108));var _0x2658=function(_0x332684,_0x4c5b5b){_0x332684=_0x332684-0x0;var _0x42c520=_0x6582[_0x332684];return _0x42c520;};'use strict';var multer=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var path=require(_0x2658('0x2'));var timeout=require(_0x2658('0x3'));var express=require(_0x2658('0x4'));var router=express['Router']();var auth=require(_0x2658('0x5'));var interaction=require(_0x2658('0x6'));var config=require(_0x2658('0x7'));var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2658('0x8')]);router[_0x2658('0x9')](_0x2658('0xa'),auth[_0x2658('0xb')](),controller[_0x2658('0xc')]);router[_0x2658('0xd')]('/',auth['isAuthenticated'](),controller[_0x2658('0xe')]);router[_0x2658('0xf')](_0x2658('0xa'),auth[_0x2658('0xb')](),controller[_0x2658('0x10')]);router[_0x2658('0x11')](_0x2658('0xa'),auth[_0x2658('0xb')](),controller[_0x2658('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x7033=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','create','put','delete','multer','util'];(function(_0xf1603b,_0x257c11){var _0x298fab=function(_0x5a96fd){while(--_0x5a96fd){_0xf1603b['push'](_0xf1603b['shift']());}};_0x298fab(++_0x257c11);}(_0x7033,0x19e));var _0x3703=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7033[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x3703('0x0'));var util=require(_0x3703('0x1'));var path=require(_0x3703('0x2'));var timeout=require(_0x3703('0x3'));var express=require('express');var router=express[_0x3703('0x4')]();var auth=require(_0x3703('0x5'));var interaction=require(_0x3703('0x6'));var config=require(_0x3703('0x7'));var controller=require(_0x3703('0x8'));router[_0x3703('0x9')]('/',auth[_0x3703('0xa')](),controller[_0x3703('0xb')]);router[_0x3703('0x9')](_0x3703('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x3703('0xa')](),controller[_0x3703('0xd')]);router[_0x3703('0xe')](_0x3703('0xc'),auth[_0x3703('0xa')](),controller['update']);router[_0x3703('0xf')](_0x3703('0xc'),auth[_0x3703('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js
index 673cc8b..50b5e25 100644
--- a/server/api/voiceContext/voiceContext.attributes.js
+++ b/server/api/voiceContext/voiceContext.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x37ad=['BOOLEAN'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x37ad,0x113));var _0xd37a=function(_0x44353d,_0x267761){_0x44353d=_0x44353d-0x0;var _0x93dd90=_0x37ad[_0x44353d];return _0x93dd90;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd37a('0x0')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3889=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x5c3c9f,_0x2b6352){var _0x53f7e9=function(_0x1bef11){while(--_0x1bef11){_0x5c3c9f['push'](_0x5c3c9f['shift']());}};_0x53f7e9(++_0x2b6352);}(_0x3889,0xc7));var _0x9388=function(_0x339d70,_0x1f20de){_0x339d70=_0x339d70-0x0;var _0x26ddbd=_0x3889[_0x339d70];return _0x26ddbd;};'use strict';var Sequelize=require(_0x9388('0x0'));module[_0x9388('0x1')]={'name':{'type':Sequelize[_0x9388('0x2')],'unique':_0x9388('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9388('0x4')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js
index dc1c2de..8a3883e 100644
--- a/server/api/voiceContext/voiceContext.controller.js
+++ b/server/api/voiceContext/voiceContext.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1d25=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','set','json','apply','reject','save','update','then','Contexts','UserProfileResource','destroy','stack','name','send','index','VoiceContext','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','show','params','find','create','body','findAll','readFileSync','join','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','Reload','root','render','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','request','info','VoiceContext,\x20%s,\x20%s'];(function(_0x3da10c,_0x4cf1b3){var _0x9ccf1=function(_0x427814){while(--_0x427814){_0x3da10c['push'](_0x3da10c['shift']());}};_0x9ccf1(++_0x4cf1b3);}(_0x1d25,0x185));var _0x51d2=function(_0x328534,_0x33b41e){_0x328534=_0x328534-0x0;var _0x2796c0=_0x1d25[_0x328534];return _0x2796c0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x51d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51d2('0x1'));var jsonpatch=require(_0x51d2('0x2'));var rp=require(_0x51d2('0x3'));var moment=require(_0x51d2('0x4'));var BPromise=require(_0x51d2('0x5'));var Mustache=require(_0x51d2('0x6'));var util=require(_0x51d2('0x7'));var path=require(_0x51d2('0x8'));var sox=require(_0x51d2('0x9'));var csv=require(_0x51d2('0xa'));var ejs=require(_0x51d2('0xb'));var fs=require('fs');var _=require(_0x51d2('0xc'));var squel=require('squel');var crypto=require(_0x51d2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x51d2('0xe'));var toCsv=require(_0x51d2('0xa'));var querystring=require(_0x51d2('0xf'));var Papa=require('papaparse');var Redis=require(_0x51d2('0x10'));var authService=require(_0x51d2('0x11'));var qs=require(_0x51d2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x51d2('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x51d2('0x14'));var db=require(_0x51d2('0x15'))['db'];var jayson=require(_0x51d2('0x16'));var client=jayson['client'][_0x51d2('0x17')]({'port':0x232a});function checkPasswordPattern(_0x262b1a,_0xa9807c,_0x1ada88){if(_0x1ada88){var _0x449f5a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x449f5a['test'](_0xa9807c)){return _0x262b1a;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x262b1a;}}function respondWithRpcPromise(_0x10bc4e,_0x3505b7,_0x3eca27,_0x23a504){return new BPromise(function(_0x185b63,_0x3809b0){var _0x31f997=_0x23a504||client;return _0x31f997[_0x51d2('0x18')](_0x10bc4e,_0x3eca27)['then'](function(_0x49df3c){logger[_0x51d2('0x19')](_0x51d2('0x1a'),_0x3505b7,_0x51d2('0x1b'));logger[_0x51d2('0x1c')](_0x51d2('0x1d'),_0x3505b7,_0x51d2('0x1b'),JSON[_0x51d2('0x1e')](_0x49df3c));if(_0x49df3c['error']){if(_0x49df3c[_0x51d2('0x1f')][_0x51d2('0x20')]===0x1f4){logger[_0x51d2('0x1f')](_0x51d2('0x1a'),_0x3505b7,_0x49df3c[_0x51d2('0x1f')]['message']);return _0x3809b0(_0x49df3c[_0x51d2('0x1f')][_0x51d2('0x21')]);}logger['error'](_0x51d2('0x1a'),_0x3505b7,_0x49df3c[_0x51d2('0x1f')][_0x51d2('0x21')]);return _0x185b63(_0x49df3c[_0x51d2('0x1f')][_0x51d2('0x21')]);}else{logger[_0x51d2('0x19')]('VoiceContext,\x20%s,\x20%s',_0x3505b7,_0x51d2('0x1b'));_0x185b63(_0x49df3c['result']['message']);}})[_0x51d2('0x22')](function(_0x22d116){logger[_0x51d2('0x1f')](_0x51d2('0x1a'),_0x3505b7,_0x22d116);_0x3809b0(_0x22d116);});});}function respondWithStatusCode(_0x3f16b8,_0x4e5c1d){_0x4e5c1d=_0x4e5c1d||0xcc;return function(_0x45104f){if(_0x45104f){return _0x3f16b8[_0x51d2('0x23')](_0x4e5c1d);}return _0x3f16b8[_0x51d2('0x24')](_0x4e5c1d)[_0x51d2('0x25')]();};}function respondWithResult(_0x5a3d5b,_0x2c2e6c){_0x2c2e6c=_0x2c2e6c||0xc8;return function(_0x5a047b){if(_0x5a047b){return _0x5a3d5b[_0x51d2('0x24')](_0x2c2e6c)['json'](_0x5a047b);}};}function respondWithFilteredResult(_0x54832c,_0x366a67){return function(_0x25d1b4){if(_0x25d1b4){var _0x397007=_0x25d1b4[_0x51d2('0x26')],_0x5e4189=_0x366a67[_0x51d2('0x27')],_0x26d73b=_0x366a67['offset']+_0x366a67['limit'],_0x5e9c4a;if(_0x26d73b>=_0x397007){_0x26d73b=_0x397007;_0x5e9c4a=0xc8;}else{_0x5e9c4a=0xce;}_0x54832c[_0x51d2('0x24')](_0x5e9c4a);return _0x54832c[_0x51d2('0x28')]('Content-Range',_0x5e4189+'-'+_0x26d73b+'/'+_0x397007)[_0x51d2('0x29')](_0x25d1b4);}return null;};}function patchUpdates(_0x3db14f){return function(_0x4bebf2){try{jsonpatch[_0x51d2('0x2a')](_0x4bebf2,_0x3db14f,!![]);}catch(_0x13562c){return BPromise[_0x51d2('0x2b')](_0x13562c);}return _0x4bebf2[_0x51d2('0x2c')]();};}function saveUpdates(_0x340f31,_0x3af390){return function(_0x5de86){if(_0x5de86){return _0x5de86[_0x51d2('0x2d')](_0x340f31)[_0x51d2('0x2e')](function(_0x57ca0e){return _0x57ca0e;});}return null;};}function removeEntity(_0x33ff1d,_0x1aab01){return function(_0x49f48c){if(_0x49f48c){return _0x49f48c['destroy']()[_0x51d2('0x2e')](function(){var _0x1fb20e=_0x49f48c['get']({'plain':!![]});var _0xf58089=_0x51d2('0x2f');return db[_0x51d2('0x30')][_0x51d2('0x31')]({'where':{'type':_0xf58089,'resourceId':_0x1fb20e['id']}})[_0x51d2('0x2e')](function(){return _0x49f48c;});})[_0x51d2('0x2e')](function(){_0x33ff1d[_0x51d2('0x24')](0xcc)[_0x51d2('0x25')]();});}};}function handleEntityNotFound(_0x242007,_0x2651fc){return function(_0x4038eb){if(!_0x4038eb){_0x242007[_0x51d2('0x23')](0x194);}return _0x4038eb;};}function handleError(_0x37fe38,_0xc82c70){_0xc82c70=_0xc82c70||0x1f4;return function(_0x5aae22){logger['error'](_0x5aae22[_0x51d2('0x32')]);if(_0x5aae22[_0x51d2('0x33')]){delete _0x5aae22[_0x51d2('0x33')];}_0x37fe38['status'](_0xc82c70)[_0x51d2('0x34')](_0x5aae22);};}exports[_0x51d2('0x35')]=function(_0x15cea6,_0x45628d){var _0x2a651d={},_0x365b75={},_0x35d43d={'count':0x0,'rows':[]};var _0x1a6bb7=db[_0x51d2('0x36')][_0x51d2('0x37')];_0x365b75[_0x51d2('0x38')]=_['keys'](_0x1a6bb7);_0x365b75[_0x51d2('0x39')]=_[_0x51d2('0x3a')](_0x15cea6[_0x51d2('0x39')]);_0x365b75[_0x51d2('0x3b')]=_[_0x51d2('0x3c')](_0x365b75[_0x51d2('0x38')],_0x365b75[_0x51d2('0x39')]);_0x2a651d[_0x51d2('0x3d')]=_[_0x51d2('0x3c')](_0x365b75[_0x51d2('0x38')],qs['fields'](_0x15cea6['query'][_0x51d2('0x3e')]));_0x2a651d[_0x51d2('0x3d')]=_0x2a651d['attributes'][_0x51d2('0x3f')]?_0x2a651d[_0x51d2('0x3d')]:_0x365b75[_0x51d2('0x38')];if(!_0x15cea6['query'][_0x51d2('0x40')](_0x51d2('0x41'))){_0x2a651d[_0x51d2('0x42')]=qs[_0x51d2('0x42')](_0x15cea6[_0x51d2('0x39')][_0x51d2('0x42')]);_0x2a651d['offset']=qs[_0x51d2('0x27')](_0x15cea6['query'][_0x51d2('0x27')]);}_0x2a651d['order']=qs[_0x51d2('0x43')](_0x15cea6[_0x51d2('0x39')]['sort']);_0x2a651d[_0x51d2('0x44')]=qs[_0x51d2('0x3b')](_[_0x51d2('0x45')](_0x15cea6[_0x51d2('0x39')],_0x365b75[_0x51d2('0x3b')]));if(_0x15cea6[_0x51d2('0x39')][_0x51d2('0x46')]){_0x2a651d['where']=_[_0x51d2('0x47')](_0x2a651d['where'],{'$or':_[_0x51d2('0x48')](_0x1a6bb7,function(_0xe2650f){if(_0xe2650f[_0x51d2('0x49')]['key']!==_0x51d2('0x4a')){var _0x46165e={};_0x46165e[_0xe2650f[_0x51d2('0x4b')]]={'$like':'%'+_0x15cea6['query'][_0x51d2('0x46')]+'%'};return _0x46165e;}})});}_0x2a651d=_[_0x51d2('0x47')]({},_0x2a651d,_0x15cea6[_0x51d2('0x4c')]);var _0x30926c={'where':_0x2a651d[_0x51d2('0x44')]};return db['VoiceContext'][_0x51d2('0x26')](_0x30926c)[_0x51d2('0x2e')](function(_0x14a5fa){_0x35d43d[_0x51d2('0x26')]=_0x14a5fa;if(_0x15cea6[_0x51d2('0x39')][_0x51d2('0x4d')]){_0x2a651d[_0x51d2('0x4e')]=[{'all':!![]}];}return db[_0x51d2('0x36')]['findAll'](_0x2a651d);})[_0x51d2('0x2e')](function(_0x5c2218){_0x35d43d[_0x51d2('0x4f')]=_0x5c2218;return _0x35d43d;})[_0x51d2('0x2e')](respondWithFilteredResult(_0x45628d,_0x2a651d))[_0x51d2('0x22')](handleError(_0x45628d,null));};exports[_0x51d2('0x50')]=function(_0x1c72f4,_0x549ee4){var _0x2d87d6={'raw':![],'where':{'id':_0x1c72f4[_0x51d2('0x51')]['id']}},_0x45c35a={};_0x45c35a[_0x51d2('0x38')]=_['keys'](db[_0x51d2('0x36')][_0x51d2('0x37')]);_0x45c35a[_0x51d2('0x39')]=_['keys'](_0x1c72f4[_0x51d2('0x39')]);_0x45c35a[_0x51d2('0x3b')]=_[_0x51d2('0x3c')](_0x45c35a[_0x51d2('0x38')],_0x45c35a['query']);_0x2d87d6[_0x51d2('0x3d')]=_[_0x51d2('0x3c')](_0x45c35a[_0x51d2('0x38')],qs[_0x51d2('0x3e')](_0x1c72f4[_0x51d2('0x39')]['fields']));_0x2d87d6['attributes']=_0x2d87d6[_0x51d2('0x3d')][_0x51d2('0x3f')]?_0x2d87d6['attributes']:_0x45c35a[_0x51d2('0x38')];if(_0x1c72f4[_0x51d2('0x39')][_0x51d2('0x4d')]){_0x2d87d6[_0x51d2('0x4e')]=[{'all':!![]}];}_0x2d87d6=_[_0x51d2('0x47')]({},_0x2d87d6,_0x1c72f4[_0x51d2('0x4c')]);return db[_0x51d2('0x36')][_0x51d2('0x52')](_0x2d87d6)[_0x51d2('0x2e')](handleEntityNotFound(_0x549ee4,null))[_0x51d2('0x2e')](respondWithResult(_0x549ee4,null))[_0x51d2('0x22')](handleError(_0x549ee4,null));};exports['create']=function(_0xbc65e6,_0xc16140,_0x12793d){var _0xb45cf4;return db[_0x51d2('0x36')][_0x51d2('0x53')](_0xbc65e6[_0x51d2('0x54')],{'raw':!![]})[_0x51d2('0x2e')](function(_0x176503){_0xb45cf4=_0x176503;return db[_0x51d2('0x36')][_0x51d2('0x55')]({'raw':!![]});})[_0x51d2('0x2e')](function(_0x59a386){var _0x346512=fs[_0x51d2('0x56')](path[_0x51d2('0x57')](config['root'],_0x51d2('0x58')),'utf8');var _0x1a30f1=ejs['render'](_0x346512,{'contexts':_0x59a386||[]});fs[_0x51d2('0x59')](_0x51d2('0x5a'),_0x1a30f1);})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x51d2('0x5b')});})[_0x51d2('0x2e')](function(){var _0x4ddcce=_0xbc65e6[_0x51d2('0x5c')][_0x51d2('0x5d')]({'plain':!![]});if(!_0x4ddcce)throw new Error(_0x51d2('0x5e'));if(_0x4ddcce[_0x51d2('0x5f')]===_0x51d2('0x5c')){var _0x434904=_0xb45cf4[_0x51d2('0x5d')]({'plain':!![]});return db[_0x51d2('0x60')]['find']({'where':{'name':_0x51d2('0x2f'),'userProfileId':_0x4ddcce[_0x51d2('0x61')]},'raw':!![]})[_0x51d2('0x2e')](function(_0x526364){if(_0x526364&&_0x526364[_0x51d2('0x62')]===0x0){return db[_0x51d2('0x30')][_0x51d2('0x53')]({'name':_0x434904[_0x51d2('0x33')],'resourceId':_0x434904['id'],'type':_0x526364['name'],'sectionId':_0x526364['id']},{})[_0x51d2('0x2e')](function(){return _0xb45cf4;});}else{return _0xb45cf4;}})[_0x51d2('0x22')](function(_0x578bb7){logger[_0x51d2('0x1f')](_0x51d2('0x63'),_0x578bb7);throw _0x578bb7;});}return _0xb45cf4;})[_0x51d2('0x2e')](respondWithResult(_0xc16140,0xc9))[_0x51d2('0x22')](handleError(_0xc16140,null));};exports[_0x51d2('0x2d')]=function(_0x481aba,_0x9effd8,_0x1fd038){var _0x5b7f23;return db[_0x51d2('0x36')][_0x51d2('0x52')]({'where':{'id':_0x481aba[_0x51d2('0x51')]['id']}})[_0x51d2('0x2e')](handleEntityNotFound(_0x9effd8,null))['then'](saveUpdates(_0x481aba[_0x51d2('0x54')],null))[_0x51d2('0x2e')](function(_0x173a01){if(_0x173a01){_0x5b7f23=_0x173a01;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x51d2('0x2e')](function(_0x288622){var _0x5897ad=fs['readFileSync'](path[_0x51d2('0x57')](config['root'],_0x51d2('0x58')),_0x51d2('0x64'));var _0x579e40=ejs['render'](_0x5897ad,{'contexts':_0x288622||[]});fs[_0x51d2('0x59')](_0x51d2('0x5a'),_0x579e40);})[_0x51d2('0x2e')](function(){return respondWithRpcPromise(_0x51d2('0x65'),_0x51d2('0x2d'),{'module':'chan_sip.so'});})[_0x51d2('0x2e')](function(){return _0x5b7f23;})[_0x51d2('0x2e')](respondWithResult(_0x9effd8,null))[_0x51d2('0x22')](handleError(_0x9effd8,null));};exports[_0x51d2('0x31')]=function(_0x8c7896,_0x5de6aa,_0x4eab51){var _0x468024;return db[_0x51d2('0x36')][_0x51d2('0x52')]({'where':{'id':_0x8c7896['params']['id']}})[_0x51d2('0x2e')](handleEntityNotFound(_0x5de6aa,null))['then'](removeEntity(_0x5de6aa,null))[_0x51d2('0x2e')](function(){return db['VoiceContext'][_0x51d2('0x55')]({'raw':!![]});})[_0x51d2('0x2e')](function(_0x2a5d14){var _0x4f83dc=fs['readFileSync'](path[_0x51d2('0x57')](config[_0x51d2('0x66')],'server/files/templates/context.ejs'),_0x51d2('0x64'));var _0xc6bbdf=ejs[_0x51d2('0x67')](_0x4f83dc,{'contexts':_0x2a5d14});fs[_0x51d2('0x59')](_0x51d2('0x5a'),_0xc6bbdf);return respondWithRpcPromise(_0x51d2('0x65'),'destroy',{'module':_0x51d2('0x5b')});})[_0x51d2('0x22')](handleError(_0x5de6aa,null));};
\ No newline at end of file
+var _0xbd5b=['offset','sort','where','filter','merge','type','VIRTUAL','field','VoiceContext','count','includeAll','include','findAll','rows','options','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','find','userProfileId','autoAssociation','params','writeFileSync','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','sendStatus','status','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','end','stack','name','send','index','rawAttributes','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x2b2244,_0x20010a){var _0x1723e8=function(_0x1d90ad){while(--_0x1d90ad){_0x2b2244['push'](_0x2b2244['shift']());}};_0x1723e8(++_0x20010a);}(_0xbd5b,0xee));var _0xbbd5=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0xbd5b[_0x64aff8];return _0x5488a3;};'use strict';var pdf=require(_0xbbd5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbbd5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbbd5('0x2'));var moment=require(_0xbbd5('0x3'));var BPromise=require(_0xbbd5('0x4'));var Mustache=require(_0xbbd5('0x5'));var util=require(_0xbbd5('0x6'));var path=require('path');var sox=require(_0xbbd5('0x7'));var csv=require(_0xbbd5('0x8'));var ejs=require(_0xbbd5('0x9'));var fs=require('fs');var _=require(_0xbbd5('0xa'));var squel=require(_0xbbd5('0xb'));var crypto=require(_0xbbd5('0xc'));var jsforce=require(_0xbbd5('0xd'));var deskjs=require(_0xbbd5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbbd5('0xf'));var Papa=require('papaparse');var Redis=require(_0xbbd5('0x10'));var authService=require(_0xbbd5('0x11'));var qs=require(_0xbbd5('0x12'));var hardwareService=require(_0xbbd5('0x13'));var logger=require(_0xbbd5('0x14'))('api');var utils=require(_0xbbd5('0x15'));var config=require(_0xbbd5('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xbbd5('0x17'));var client=jayson[_0xbbd5('0x18')][_0xbbd5('0x19')]({'port':0x232a});function checkPasswordPattern(_0x17e94a,_0x3c2eb4,_0x46dfce){if(_0x46dfce){var _0x5a547f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a547f[_0xbbd5('0x1a')](_0x3c2eb4)){return _0x17e94a;}else{throw new Error(_0xbbd5('0x1b'));}}else{return _0x17e94a;}}function respondWithRpcPromise(_0x1de3a6,_0x352bbc,_0x3d4cfa,_0x3d3bdd){return new BPromise(function(_0x16a283,_0x178c9c){var _0x18cf8c=_0x3d3bdd||client;return _0x18cf8c[_0xbbd5('0x1c')](_0x1de3a6,_0x3d4cfa)[_0xbbd5('0x1d')](function(_0x378531){logger['info'](_0xbbd5('0x1e'),_0x352bbc,_0xbbd5('0x1f'));logger[_0xbbd5('0x20')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x352bbc,_0xbbd5('0x1f'),JSON[_0xbbd5('0x21')](_0x378531));if(_0x378531[_0xbbd5('0x22')]){if(_0x378531[_0xbbd5('0x22')]['code']===0x1f4){logger[_0xbbd5('0x22')](_0xbbd5('0x1e'),_0x352bbc,_0x378531[_0xbbd5('0x22')]['message']);return _0x178c9c(_0x378531[_0xbbd5('0x22')]['message']);}logger[_0xbbd5('0x22')](_0xbbd5('0x1e'),_0x352bbc,_0x378531['error'][_0xbbd5('0x23')]);return _0x16a283(_0x378531[_0xbbd5('0x22')][_0xbbd5('0x23')]);}else{logger[_0xbbd5('0x24')](_0xbbd5('0x1e'),_0x352bbc,'request\x20sent');_0x16a283(_0x378531[_0xbbd5('0x25')][_0xbbd5('0x23')]);}})[_0xbbd5('0x26')](function(_0x49c21d){logger[_0xbbd5('0x22')]('VoiceContext,\x20%s,\x20%s',_0x352bbc,_0x49c21d);_0x178c9c(_0x49c21d);});});}function respondWithStatusCode(_0x25ef02,_0x1c1b53){_0x1c1b53=_0x1c1b53||0xcc;return function(_0xb691b4){if(_0xb691b4){return _0x25ef02[_0xbbd5('0x27')](_0x1c1b53);}return _0x25ef02['status'](_0x1c1b53)['end']();};}function respondWithResult(_0x532e88,_0x5ba22f){_0x5ba22f=_0x5ba22f||0xc8;return function(_0x2522c8){if(_0x2522c8){return _0x532e88[_0xbbd5('0x28')](_0x5ba22f)['json'](_0x2522c8);}};}function respondWithFilteredResult(_0x2a0f9d,_0x3d4931){return function(_0x3353b2){if(_0x3353b2){var _0x48c286=_0x3353b2['count'],_0x416c1a=_0x3d4931['offset'],_0x1f4c4e=_0x3d4931['offset']+_0x3d4931[_0xbbd5('0x29')],_0x57962e;if(_0x1f4c4e>=_0x48c286){_0x1f4c4e=_0x48c286;_0x57962e=0xc8;}else{_0x57962e=0xce;}_0x2a0f9d[_0xbbd5('0x28')](_0x57962e);return _0x2a0f9d[_0xbbd5('0x2a')](_0xbbd5('0x2b'),_0x416c1a+'-'+_0x1f4c4e+'/'+_0x48c286)[_0xbbd5('0x2c')](_0x3353b2);}return null;};}function patchUpdates(_0x50d1e9){return function(_0x187ba6){try{jsonpatch[_0xbbd5('0x2d')](_0x187ba6,_0x50d1e9,!![]);}catch(_0x2aa338){return BPromise[_0xbbd5('0x2e')](_0x2aa338);}return _0x187ba6[_0xbbd5('0x2f')]();};}function saveUpdates(_0x13b699,_0x432ee9){return function(_0x6e0419){if(_0x6e0419){return _0x6e0419[_0xbbd5('0x30')](_0x13b699)['then'](function(_0x148b14){return _0x148b14;});}return null;};}function removeEntity(_0x10d317,_0x535d92){return function(_0x556075){if(_0x556075){return _0x556075[_0xbbd5('0x31')]()['then'](function(){var _0x28e893=_0x556075[_0xbbd5('0x32')]({'plain':!![]});var _0x41f79a=_0xbbd5('0x33');return db[_0xbbd5('0x34')][_0xbbd5('0x31')]({'where':{'type':_0x41f79a,'resourceId':_0x28e893['id']}})['then'](function(){return _0x556075;});})[_0xbbd5('0x1d')](function(){_0x10d317[_0xbbd5('0x28')](0xcc)[_0xbbd5('0x35')]();});}};}function handleEntityNotFound(_0x531073,_0x284eeb){return function(_0x2a0b5a){if(!_0x2a0b5a){_0x531073['sendStatus'](0x194);}return _0x2a0b5a;};}function handleError(_0x30d956,_0xfacec6){_0xfacec6=_0xfacec6||0x1f4;return function(_0x18084f){logger['error'](_0x18084f[_0xbbd5('0x36')]);if(_0x18084f['name']){delete _0x18084f[_0xbbd5('0x37')];}_0x30d956[_0xbbd5('0x28')](_0xfacec6)[_0xbbd5('0x38')](_0x18084f);};}exports[_0xbbd5('0x39')]=function(_0x462721,_0x3daa12){var _0x25d3ab={},_0x4d9da0={},_0x1ca6f6={'count':0x0,'rows':[]};var _0x194733=db['VoiceContext'][_0xbbd5('0x3a')];_0x4d9da0['model']=_['keys'](_0x194733);_0x4d9da0['query']=_[_0xbbd5('0x3b')](_0x462721[_0xbbd5('0x3c')]);_0x4d9da0[_0xbbd5('0x3d')]=_['intersection'](_0x4d9da0[_0xbbd5('0x3e')],_0x4d9da0['query']);_0x25d3ab['attributes']=_[_0xbbd5('0x3f')](_0x4d9da0[_0xbbd5('0x3e')],qs['fields'](_0x462721['query'][_0xbbd5('0x40')]));_0x25d3ab[_0xbbd5('0x41')]=_0x25d3ab['attributes'][_0xbbd5('0x42')]?_0x25d3ab[_0xbbd5('0x41')]:_0x4d9da0['model'];if(!_0x462721['query'][_0xbbd5('0x43')]('nolimit')){_0x25d3ab[_0xbbd5('0x29')]=qs[_0xbbd5('0x29')](_0x462721[_0xbbd5('0x3c')][_0xbbd5('0x29')]);_0x25d3ab[_0xbbd5('0x44')]=qs[_0xbbd5('0x44')](_0x462721['query'][_0xbbd5('0x44')]);}_0x25d3ab['order']=qs[_0xbbd5('0x45')](_0x462721['query']['sort']);_0x25d3ab[_0xbbd5('0x46')]=qs[_0xbbd5('0x3d')](_['pick'](_0x462721['query'],_0x4d9da0[_0xbbd5('0x3d')]));if(_0x462721[_0xbbd5('0x3c')][_0xbbd5('0x47')]){_0x25d3ab[_0xbbd5('0x46')]=_[_0xbbd5('0x48')](_0x25d3ab[_0xbbd5('0x46')],{'$or':_['map'](_0x194733,function(_0x24890a){if(_0x24890a[_0xbbd5('0x49')]['key']!==_0xbbd5('0x4a')){var _0x4306bb={};_0x4306bb[_0x24890a[_0xbbd5('0x4b')]]={'$like':'%'+_0x462721['query']['filter']+'%'};return _0x4306bb;}})});}_0x25d3ab=_[_0xbbd5('0x48')]({},_0x25d3ab,_0x462721['options']);var _0x12451d={'where':_0x25d3ab[_0xbbd5('0x46')]};return db[_0xbbd5('0x4c')][_0xbbd5('0x4d')](_0x12451d)[_0xbbd5('0x1d')](function(_0x10d56a){_0x1ca6f6['count']=_0x10d56a;if(_0x462721[_0xbbd5('0x3c')][_0xbbd5('0x4e')]){_0x25d3ab[_0xbbd5('0x4f')]=[{'all':!![]}];}return db[_0xbbd5('0x4c')][_0xbbd5('0x50')](_0x25d3ab);})['then'](function(_0x392fe9){_0x1ca6f6[_0xbbd5('0x51')]=_0x392fe9;return _0x1ca6f6;})['then'](respondWithFilteredResult(_0x3daa12,_0x25d3ab))[_0xbbd5('0x26')](handleError(_0x3daa12,null));};exports['show']=function(_0xc66ceb,_0x323383){var _0x460b18={'raw':![],'where':{'id':_0xc66ceb['params']['id']}},_0x4619f9={};_0x4619f9['model']=_[_0xbbd5('0x3b')](db[_0xbbd5('0x4c')]['rawAttributes']);_0x4619f9[_0xbbd5('0x3c')]=_['keys'](_0xc66ceb[_0xbbd5('0x3c')]);_0x4619f9['filters']=_[_0xbbd5('0x3f')](_0x4619f9['model'],_0x4619f9['query']);_0x460b18[_0xbbd5('0x41')]=_[_0xbbd5('0x3f')](_0x4619f9[_0xbbd5('0x3e')],qs[_0xbbd5('0x40')](_0xc66ceb[_0xbbd5('0x3c')][_0xbbd5('0x40')]));_0x460b18['attributes']=_0x460b18[_0xbbd5('0x41')][_0xbbd5('0x42')]?_0x460b18[_0xbbd5('0x41')]:_0x4619f9[_0xbbd5('0x3e')];if(_0xc66ceb[_0xbbd5('0x3c')][_0xbbd5('0x4e')]){_0x460b18[_0xbbd5('0x4f')]=[{'all':!![]}];}_0x460b18=_[_0xbbd5('0x48')]({},_0x460b18,_0xc66ceb[_0xbbd5('0x52')]);return db[_0xbbd5('0x4c')]['find'](_0x460b18)[_0xbbd5('0x1d')](handleEntityNotFound(_0x323383,null))[_0xbbd5('0x1d')](respondWithResult(_0x323383,null))[_0xbbd5('0x26')](handleError(_0x323383,null));};exports[_0xbbd5('0x53')]=function(_0x19ecea,_0x4741df,_0x2be454){var _0x5b1ea8;return db[_0xbbd5('0x4c')][_0xbbd5('0x53')](_0x19ecea[_0xbbd5('0x54')],{'raw':!![]})['then'](function(_0x1038e8){_0x5b1ea8=_0x1038e8;return db[_0xbbd5('0x4c')]['findAll']({'raw':!![]});})[_0xbbd5('0x1d')](function(_0x3f477e){var _0x1f69c3=fs[_0xbbd5('0x55')](path[_0xbbd5('0x56')](config[_0xbbd5('0x57')],_0xbbd5('0x58')),_0xbbd5('0x59'));var _0x3b0668=ejs[_0xbbd5('0x5a')](_0x1f69c3,{'contexts':_0x3f477e||[]});fs['writeFileSync'](_0xbbd5('0x5b'),_0x3b0668);})[_0xbbd5('0x1d')](function(){return respondWithRpcPromise(_0xbbd5('0x5c'),'create',{'module':_0xbbd5('0x5d')});})['then'](function(){var _0x1e1675=_0x19ecea[_0xbbd5('0x5e')]['get']({'plain':!![]});if(!_0x1e1675)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e1675[_0xbbd5('0x5f')]===_0xbbd5('0x5e')){var _0x348ff6=_0x5b1ea8[_0xbbd5('0x32')]({'plain':!![]});return db[_0xbbd5('0x60')][_0xbbd5('0x61')]({'where':{'name':_0xbbd5('0x33'),'userProfileId':_0x1e1675[_0xbbd5('0x62')]},'raw':!![]})[_0xbbd5('0x1d')](function(_0x11c9f1){if(_0x11c9f1&&_0x11c9f1[_0xbbd5('0x63')]===0x0){return db[_0xbbd5('0x34')][_0xbbd5('0x53')]({'name':_0x348ff6['name'],'resourceId':_0x348ff6['id'],'type':_0x11c9f1[_0xbbd5('0x37')],'sectionId':_0x11c9f1['id']},{})[_0xbbd5('0x1d')](function(){return _0x5b1ea8;});}else{return _0x5b1ea8;}})[_0xbbd5('0x26')](function(_0x4177ac){logger[_0xbbd5('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4177ac);throw _0x4177ac;});}return _0x5b1ea8;})[_0xbbd5('0x1d')](respondWithResult(_0x4741df,0xc9))['catch'](handleError(_0x4741df,null));};exports[_0xbbd5('0x30')]=function(_0x522909,_0x51186d,_0x2d1b67){var _0x4f5c8f;return db[_0xbbd5('0x4c')][_0xbbd5('0x61')]({'where':{'id':_0x522909[_0xbbd5('0x64')]['id']}})[_0xbbd5('0x1d')](handleEntityNotFound(_0x51186d,null))[_0xbbd5('0x1d')](saveUpdates(_0x522909[_0xbbd5('0x54')],null))[_0xbbd5('0x1d')](function(_0x3245bd){if(_0x3245bd){_0x4f5c8f=_0x3245bd;return db['VoiceContext'][_0xbbd5('0x50')]({'raw':!![]});}})[_0xbbd5('0x1d')](function(_0x437045){var _0x95697f=fs[_0xbbd5('0x55')](path['join'](config['root'],_0xbbd5('0x58')),_0xbbd5('0x59'));var _0x48506e=ejs[_0xbbd5('0x5a')](_0x95697f,{'contexts':_0x437045||[]});fs[_0xbbd5('0x65')](_0xbbd5('0x5b'),_0x48506e);})[_0xbbd5('0x1d')](function(){return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});})[_0xbbd5('0x1d')](function(){return _0x4f5c8f;})[_0xbbd5('0x1d')](respondWithResult(_0x51186d,null))[_0xbbd5('0x26')](handleError(_0x51186d,null));};exports[_0xbbd5('0x31')]=function(_0x3caa1d,_0x1a2c8b,_0x227a6d){var _0x5520af;return db[_0xbbd5('0x4c')][_0xbbd5('0x61')]({'where':{'id':_0x3caa1d[_0xbbd5('0x64')]['id']}})[_0xbbd5('0x1d')](handleEntityNotFound(_0x1a2c8b,null))[_0xbbd5('0x1d')](removeEntity(_0x1a2c8b,null))[_0xbbd5('0x1d')](function(){return db[_0xbbd5('0x4c')][_0xbbd5('0x50')]({'raw':!![]});})[_0xbbd5('0x1d')](function(_0x48591d){var _0x151bf5=fs[_0xbbd5('0x55')](path['join'](config[_0xbbd5('0x57')],_0xbbd5('0x58')),'utf8');var _0x4afc13=ejs[_0xbbd5('0x5a')](_0x151bf5,{'contexts':_0x48591d});fs[_0xbbd5('0x65')](_0xbbd5('0x5b'),_0x4afc13);return respondWithRpcPromise(_0xbbd5('0x5c'),_0xbbd5('0x31'),{'module':'chan_sip.so'});})['catch'](handleError(_0x1a2c8b,null));};
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js
index 3de21f2..5c8687e 100644
--- a/server/api/voiceContext/voiceContext.model.js
+++ b/server/api/voiceContext/voiceContext.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd4c=['./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3885ea,_0x539be0){var _0x24d3c5=function(_0x3eedc6){while(--_0x3eedc6){_0x3885ea['push'](_0x3885ea['shift']());}};_0x24d3c5(++_0x539be0);}(_0xfd4c,0x1e6));var _0xcfd4=function(_0x1063f3,_0x12453d){_0x1063f3=_0x1063f3-0x0;var _0x46f4b8=_0xfd4c[_0x1063f3];return _0x46f4b8;};'use strict';var _=require(_0xcfd4('0x0'));var util=require(_0xcfd4('0x1'));var logger=require('../../config/logger')(_0xcfd4('0x2'));var moment=require(_0xcfd4('0x3'));var BPromise=require('bluebird');var rp=require(_0xcfd4('0x4'));var fs=require('fs');var path=require(_0xcfd4('0x5'));var rimraf=require(_0xcfd4('0x6'));var config=require(_0xcfd4('0x7'));var attributes=require(_0xcfd4('0x8'));module[_0xcfd4('0x9')]=function(_0x58e90d,_0x10f821){return _0x58e90d[_0xcfd4('0xa')](_0xcfd4('0xb'),attributes,{'tableName':_0xcfd4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6137=['voice_contexts','lodash','api','moment','request-promise','path','../../config/environment','exports','VoiceContext'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6137,0x91));var _0x7613=function(_0x1e35d3,_0x39be18){_0x1e35d3=_0x1e35d3-0x0;var _0x32bfb1=_0x6137[_0x1e35d3];return _0x32bfb1;};'use strict';var _=require(_0x7613('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7613('0x1'));var moment=require(_0x7613('0x2'));var BPromise=require('bluebird');var rp=require(_0x7613('0x3'));var fs=require('fs');var path=require(_0x7613('0x4'));var rimraf=require('rimraf');var config=require(_0x7613('0x5'));var attributes=require('./voiceContext.attributes');module[_0x7613('0x6')]=function(_0xa648fe,_0x4d4a39){return _0xa648fe['define'](_0x7613('0x7'),attributes,{'tableName':_0x7613('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js
index aa14525..63f0d71 100644
--- a/server/api/voiceContext/voiceContext.rpc.js
+++ b/server/api/voiceContext/voiceContext.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7e25=['then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x52a181,_0x32dedc){var _0x4655dd=function(_0x2b6d67){while(--_0x2b6d67){_0x52a181['push'](_0x52a181['shift']());}};_0x4655dd(++_0x32dedc);}(_0x7e25,0xdd));var _0x57e2=function(_0x81697e,_0x552c16){_0x81697e=_0x81697e-0x0;var _0x1f6e36=_0x7e25[_0x81697e];return _0x1f6e36;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x57e2('0x0'));var BPromise=require(_0x57e2('0x1'));var rs=require(_0x57e2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57e2('0x3'))['db'];var utils=require(_0x57e2('0x4'));var logger=require(_0x57e2('0x5'))(_0x57e2('0x6'));var config=require('../../config/environment');var jayson=require(_0x57e2('0x7'));var client=jayson['client'][_0x57e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18d95d,_0x47bd40,_0x38a668){return new BPromise(function(_0x109b25,_0x24af83){return client[_0x57e2('0x9')](_0x18d95d,_0x38a668)[_0x57e2('0xa')](function(_0x2b0171){logger[_0x57e2('0xb')](_0x57e2('0xc'),_0x47bd40,_0x57e2('0xd'));logger[_0x57e2('0xe')](_0x57e2('0xf'),_0x47bd40,_0x57e2('0xd'),JSON['stringify'](_0x2b0171));if(_0x2b0171['error']){if(_0x2b0171[_0x57e2('0x10')][_0x57e2('0x11')]===0x1f4){logger[_0x57e2('0x10')]('VoiceContext,\x20%s,\x20%s',_0x47bd40,_0x2b0171[_0x57e2('0x10')][_0x57e2('0x12')]);return _0x24af83(_0x2b0171[_0x57e2('0x10')][_0x57e2('0x12')]);}logger[_0x57e2('0x10')](_0x57e2('0xc'),_0x47bd40,_0x2b0171[_0x57e2('0x10')][_0x57e2('0x12')]);return _0x109b25(_0x2b0171[_0x57e2('0x10')][_0x57e2('0x12')]);}else{logger[_0x57e2('0xb')](_0x57e2('0xc'),_0x47bd40,'request\x20sent');_0x109b25(_0x2b0171[_0x57e2('0x13')][_0x57e2('0x12')]);}})[_0x57e2('0x14')](function(_0x4a1eb2){logger[_0x57e2('0x10')]('VoiceContext,\x20%s,\x20%s',_0x47bd40,_0x4a1eb2);_0x24af83(_0x4a1eb2);});});}
\ No newline at end of file
+var _0x0c39=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x4c31c4,_0x26e60c){var _0x1859cf=function(_0x69654e){while(--_0x69654e){_0x4c31c4['push'](_0x4c31c4['shift']());}};_0x1859cf(++_0x26e60c);}(_0x0c39,0x11b));var _0x90c3=function(_0x1a307c,_0x2db142){_0x1a307c=_0x1a307c-0x0;var _0x59a413=_0x0c39[_0x1a307c];return _0x59a413;};'use strict';var _=require('lodash');var util=require(_0x90c3('0x0'));var moment=require(_0x90c3('0x1'));var BPromise=require(_0x90c3('0x2'));var rs=require(_0x90c3('0x3'));var fs=require('fs');var Redis=require(_0x90c3('0x4'));var db=require(_0x90c3('0x5'))['db'];var utils=require(_0x90c3('0x6'));var logger=require(_0x90c3('0x7'))('rpc');var config=require(_0x90c3('0x8'));var jayson=require(_0x90c3('0x9'));var client=jayson[_0x90c3('0xa')][_0x90c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2376a3,_0x480ba7,_0x269906){return new BPromise(function(_0x29ce45,_0x2c0bc1){return client[_0x90c3('0xc')](_0x2376a3,_0x269906)[_0x90c3('0xd')](function(_0x3cfba3){logger[_0x90c3('0xe')](_0x90c3('0xf'),_0x480ba7,_0x90c3('0x10'));logger[_0x90c3('0x11')](_0x90c3('0x12'),_0x480ba7,_0x90c3('0x10'),JSON[_0x90c3('0x13')](_0x3cfba3));if(_0x3cfba3[_0x90c3('0x14')]){if(_0x3cfba3[_0x90c3('0x14')][_0x90c3('0x15')]===0x1f4){logger[_0x90c3('0x14')](_0x90c3('0xf'),_0x480ba7,_0x3cfba3['error'][_0x90c3('0x16')]);return _0x2c0bc1(_0x3cfba3[_0x90c3('0x14')][_0x90c3('0x16')]);}logger[_0x90c3('0x14')]('VoiceContext,\x20%s,\x20%s',_0x480ba7,_0x3cfba3[_0x90c3('0x14')]['message']);return _0x29ce45(_0x3cfba3[_0x90c3('0x14')][_0x90c3('0x16')]);}else{logger[_0x90c3('0xe')](_0x90c3('0xf'),_0x480ba7,'request\x20sent');_0x29ce45(_0x3cfba3[_0x90c3('0x17')][_0x90c3('0x16')]);}})[_0x90c3('0x18')](function(_0x4333ca){logger[_0x90c3('0x14')](_0x90c3('0xf'),_0x480ba7,_0x4333ca);_0x2c0bc1(_0x4333ca);});});}
\ No newline at end of file
diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js
index 689c622..a9e7a0c 100644
--- a/server/api/voiceDialReport/index.js
+++ b/server/api/voiceDialReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd74c=['destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','post','create','put','/:id','delete'];(function(_0x5e436d,_0x592fe8){var _0x355f6e=function(_0x3981a0){while(--_0x3981a0){_0x5e436d['push'](_0x5e436d['shift']());}};_0x355f6e(++_0x592fe8);}(_0xd74c,0x112));var _0xcd74=function(_0x3e460f,_0x3b405a){_0x3e460f=_0x3e460f-0x0;var _0x47c13b=_0xd74c[_0x3e460f];return _0x47c13b;};'use strict';var multer=require('multer');var util=require(_0xcd74('0x0'));var path=require(_0xcd74('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcd74('0x2')]();var auth=require(_0xcd74('0x3'));var interaction=require(_0xcd74('0x4'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0xcd74('0x5')]('/',auth[_0xcd74('0x6')](),controller[_0xcd74('0x7')]);router[_0xcd74('0x5')]('/describe',auth[_0xcd74('0x6')](),controller[_0xcd74('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xcd74('0x9')]('/',auth[_0xcd74('0x6')](),controller[_0xcd74('0xa')]);router[_0xcd74('0xb')](_0xcd74('0xc'),auth[_0xcd74('0x6')](),controller['update']);router[_0xcd74('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xcd74('0xe')]);module[_0xcd74('0xf')]=router;
\ No newline at end of file
+var _0xc120=['isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./voiceDialReport.controller','get'];(function(_0x5246d6,_0x3cbdb0){var _0xf00776=function(_0xcbaa3){while(--_0xcbaa3){_0x5246d6['push'](_0x5246d6['shift']());}};_0xf00776(++_0x3cbdb0);}(_0xc120,0xa3));var _0x0c12=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xc120[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0c12('0x0'));var util=require(_0x0c12('0x1'));var path=require(_0x0c12('0x2'));var timeout=require(_0x0c12('0x3'));var express=require(_0x0c12('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0c12('0x5'));var config=require('../../config/environment');var controller=require(_0x0c12('0x6'));router[_0x0c12('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0c12('0x7')]('/describe',auth[_0x0c12('0x8')](),controller[_0x0c12('0x9')]);router[_0x0c12('0x7')](_0x0c12('0xa'),auth[_0x0c12('0x8')](),controller[_0x0c12('0xb')]);router[_0x0c12('0xc')]('/',auth['isAuthenticated'](),controller[_0x0c12('0xd')]);router[_0x0c12('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0c12('0xf')]);router[_0x0c12('0x10')](_0x0c12('0xa'),auth[_0x0c12('0x8')](),controller[_0x0c12('0x11')]);module[_0x0c12('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js
index 20d6734..bdca6c6 100644
--- a/server/api/voiceDialReport/voiceDialReport.attributes.js
+++ b/server/api/voiceDialReport/voiceDialReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7ff=['sequelize','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x3ebc3a,_0x2f47ea){var _0x158c41=function(_0x39a877){while(--_0x39a877){_0x3ebc3a['push'](_0x3ebc3a['shift']());}};_0x158c41(++_0x2f47ea);}(_0xb7ff,0x6e));var _0xfb7f=function(_0x34f64e,_0x36b50c){_0x34f64e=_0x34f64e-0x0;var _0x5eecc6=_0xb7ff[_0x34f64e];return _0x5eecc6;};'use strict';var Sequelize=require(_0xfb7f('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xfb7f('0x1')]},'channel':{'type':Sequelize[_0xfb7f('0x1')]},'channelstate':{'type':Sequelize[_0xfb7f('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xfb7f('0x1')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xfb7f('0x1')]},'connectedlinename':{'type':Sequelize[_0xfb7f('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xfb7f('0x1')]},'context':{'type':Sequelize[_0xfb7f('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xfb7f('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xfb7f('0x1')]},'destchannel':{'type':Sequelize[_0xfb7f('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xfb7f('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xfb7f('0x1')]},'destexten':{'type':Sequelize[_0xfb7f('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xfb7f('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xfb7f('0x1')]},'dialstatus':{'type':Sequelize[_0xfb7f('0x1')]},'starttime':{'type':Sequelize[_0xfb7f('0x3')]},'answertime':{'type':Sequelize[_0xfb7f('0x3')]},'endtime':{'type':Sequelize[_0xfb7f('0x3')]},'lastevent':{'type':Sequelize[_0xfb7f('0x1')],'comment':_0xfb7f('0x4')},'routeId':{'type':Sequelize[_0xfb7f('0x2')]},'duration':{'type':Sequelize[_0xfb7f('0x2')]},'holdtime':{'type':Sequelize[_0xfb7f('0x2')]},'billableseconds':{'type':Sequelize[_0xfb7f('0x2')]}};
\ No newline at end of file
+var _0x1db0=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x17b97a,_0x310f93){var _0x113473=function(_0x138e8c){while(--_0x138e8c){_0x17b97a['push'](_0x17b97a['shift']());}};_0x113473(++_0x310f93);}(_0x1db0,0x1e8));var _0x01db=function(_0x31c27f,_0x40294c){_0x31c27f=_0x31c27f-0x0;var _0x28f9c6=_0x1db0[_0x31c27f];return _0x28f9c6;};'use strict';var Sequelize=require(_0x01db('0x0'));module[_0x01db('0x1')]={'privilege':{'type':Sequelize[_0x01db('0x2')]},'channel':{'type':Sequelize[_0x01db('0x2')]},'channelstate':{'type':Sequelize[_0x01db('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x01db('0x2')]},'calleridname':{'type':Sequelize[_0x01db('0x2')]},'connectedlinenum':{'type':Sequelize[_0x01db('0x2')]},'connectedlinename':{'type':Sequelize[_0x01db('0x2')]},'language':{'type':Sequelize[_0x01db('0x2')]},'accountcode':{'type':Sequelize[_0x01db('0x2')]},'context':{'type':Sequelize[_0x01db('0x2')]},'exten':{'type':Sequelize[_0x01db('0x2')]},'priority':{'type':Sequelize[_0x01db('0x3')]},'uniqueid':{'type':Sequelize[_0x01db('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x01db('0x2')]},'destchannelstate':{'type':Sequelize[_0x01db('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x01db('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x01db('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x01db('0x2')]},'destcontext':{'type':Sequelize[_0x01db('0x2')]},'destexten':{'type':Sequelize[_0x01db('0x2')]},'destpriority':{'type':Sequelize[_0x01db('0x3')]},'destuniqueid':{'type':Sequelize[_0x01db('0x2')]},'destlinkedid':{'type':Sequelize[_0x01db('0x2')]},'dialstring':{'type':Sequelize[_0x01db('0x2')]},'dialstatus':{'type':Sequelize[_0x01db('0x2')]},'starttime':{'type':Sequelize[_0x01db('0x4')]},'answertime':{'type':Sequelize[_0x01db('0x4')]},'endtime':{'type':Sequelize[_0x01db('0x4')]},'lastevent':{'type':Sequelize[_0x01db('0x2')],'comment':_0x01db('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x01db('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x01db('0x3')]}};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js
index 3db2a7d..466cd9c 100644
--- a/server/api/voiceDialReport/voiceDialReport.controller.js
+++ b/server/api/voiceDialReport/voiceDialReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa0e2=['order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','VoiceDialReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0xa0e2,0xaa));var _0x2a0e=function(_0x52af0a,_0x2a86e3){_0x52af0a=_0x52af0a-0x0;var _0x2bfc96=_0xa0e2[_0x52af0a];return _0x2bfc96;};'use strict';var pdf=require(_0x2a0e('0x0'));var emlformat=require(_0x2a0e('0x1'));var rimraf=require(_0x2a0e('0x2'));var zipdir=require(_0x2a0e('0x3'));var jsonpatch=require(_0x2a0e('0x4'));var rp=require(_0x2a0e('0x5'));var moment=require(_0x2a0e('0x6'));var BPromise=require(_0x2a0e('0x7'));var Mustache=require(_0x2a0e('0x8'));var util=require(_0x2a0e('0x9'));var path=require(_0x2a0e('0xa'));var sox=require('sox');var csv=require(_0x2a0e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2a0e('0xc'));var jsforce=require(_0x2a0e('0xd'));var deskjs=require(_0x2a0e('0xe'));var toCsv=require(_0x2a0e('0xb'));var querystring=require(_0x2a0e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2a0e('0x10'));var hardwareService=require(_0x2a0e('0x11'));var logger=require(_0x2a0e('0x12'))(_0x2a0e('0x13'));var utils=require(_0x2a0e('0x14'));var config=require(_0x2a0e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x262f88,_0xc78297){_0xc78297=_0xc78297||0xcc;return function(_0x59322f){if(_0x59322f){return _0x262f88[_0x2a0e('0x16')](_0xc78297);}return _0x262f88[_0x2a0e('0x17')](_0xc78297)[_0x2a0e('0x18')]();};}function respondWithResult(_0x24989a,_0x1628b0){_0x1628b0=_0x1628b0||0xc8;return function(_0xe3b396){if(_0xe3b396){return _0x24989a[_0x2a0e('0x17')](_0x1628b0)[_0x2a0e('0x19')](_0xe3b396);}};}function respondWithFilteredResult(_0x2daf40,_0x2530cd){return function(_0x48cb5b){if(_0x48cb5b){var _0x62c4e8=_0x48cb5b[_0x2a0e('0x1a')],_0x23f640=_0x2530cd[_0x2a0e('0x1b')],_0x426646=_0x2530cd[_0x2a0e('0x1b')]+_0x2530cd['limit'],_0x1adc2d;if(_0x426646>=_0x62c4e8){_0x426646=_0x62c4e8;_0x1adc2d=0xc8;}else{_0x1adc2d=0xce;}_0x2daf40[_0x2a0e('0x17')](_0x1adc2d);return _0x2daf40[_0x2a0e('0x1c')](_0x2a0e('0x1d'),_0x23f640+'-'+_0x426646+'/'+_0x62c4e8)[_0x2a0e('0x19')](_0x48cb5b);}return null;};}function patchUpdates(_0x31d271){return function(_0x5265b7){try{jsonpatch[_0x2a0e('0x1e')](_0x5265b7,_0x31d271,!![]);}catch(_0x24e7f7){return BPromise[_0x2a0e('0x1f')](_0x24e7f7);}return _0x5265b7['save']();};}function saveUpdates(_0x19972b,_0x961c0a){return function(_0x160c8f){if(_0x160c8f){return _0x160c8f[_0x2a0e('0x20')](_0x19972b)[_0x2a0e('0x21')](function(_0x75ead2){return _0x75ead2;});}return null;};}function removeEntity(_0x2e5a29,_0x49ba44){return function(_0x2762b2){if(_0x2762b2){return _0x2762b2[_0x2a0e('0x22')]()[_0x2a0e('0x21')](function(){_0x2e5a29[_0x2a0e('0x17')](0xcc)[_0x2a0e('0x18')]();});}};}function handleEntityNotFound(_0x575860,_0x229e23){return function(_0x179e7f){if(!_0x179e7f){_0x575860['sendStatus'](0x194);}return _0x179e7f;};}function handleError(_0x2e6081,_0x44ca42){_0x44ca42=_0x44ca42||0x1f4;return function(_0x213719){logger[_0x2a0e('0x23')](_0x213719[_0x2a0e('0x24')]);if(_0x213719[_0x2a0e('0x25')]){delete _0x213719[_0x2a0e('0x25')];}_0x2e6081[_0x2a0e('0x17')](_0x44ca42)['send'](_0x213719);};}exports[_0x2a0e('0x26')]=function(_0x44f5b6,_0x5d8d67){var _0x26d967={},_0x2eb3cc={},_0x183e78={'count':0x0,'rows':[]};var _0x48fd28=db[_0x2a0e('0x27')][_0x2a0e('0x28')];_0x2eb3cc[_0x2a0e('0x29')]=_['keys'](_0x48fd28);_0x2eb3cc[_0x2a0e('0x2a')]=_[_0x2a0e('0x2b')](_0x44f5b6[_0x2a0e('0x2a')]);_0x2eb3cc[_0x2a0e('0x2c')]=_[_0x2a0e('0x2d')](_0x2eb3cc[_0x2a0e('0x29')],_0x2eb3cc[_0x2a0e('0x2a')]);_0x26d967[_0x2a0e('0x2e')]=_[_0x2a0e('0x2d')](_0x2eb3cc['model'],qs[_0x2a0e('0x2f')](_0x44f5b6['query'][_0x2a0e('0x2f')]));_0x26d967[_0x2a0e('0x2e')]=_0x26d967['attributes'][_0x2a0e('0x30')]?_0x26d967['attributes']:_0x2eb3cc[_0x2a0e('0x29')];if(!_0x44f5b6['query'][_0x2a0e('0x31')](_0x2a0e('0x32'))){_0x26d967['limit']=qs[_0x2a0e('0x33')](_0x44f5b6[_0x2a0e('0x2a')][_0x2a0e('0x33')]);_0x26d967['offset']=qs['offset'](_0x44f5b6['query'][_0x2a0e('0x1b')]);}_0x26d967[_0x2a0e('0x34')]=qs[_0x2a0e('0x35')](_0x44f5b6[_0x2a0e('0x2a')][_0x2a0e('0x35')]);_0x26d967[_0x2a0e('0x36')]=qs[_0x2a0e('0x2c')](_[_0x2a0e('0x37')](_0x44f5b6[_0x2a0e('0x2a')],_0x2eb3cc[_0x2a0e('0x2c')]));if(_0x44f5b6[_0x2a0e('0x2a')][_0x2a0e('0x38')]){_0x26d967[_0x2a0e('0x36')]=_[_0x2a0e('0x39')](_0x26d967[_0x2a0e('0x36')],{'$or':_[_0x2a0e('0x3a')](_0x48fd28,function(_0x6bdaa5){if(_0x6bdaa5[_0x2a0e('0x3b')][_0x2a0e('0x3c')]!==_0x2a0e('0x3d')){var _0x2c0ac4={};_0x2c0ac4[_0x6bdaa5[_0x2a0e('0x3e')]]={'$like':'%'+_0x44f5b6[_0x2a0e('0x2a')][_0x2a0e('0x38')]+'%'};return _0x2c0ac4;}})});}_0x26d967=_[_0x2a0e('0x39')]({},_0x26d967,_0x44f5b6[_0x2a0e('0x3f')]);var _0x24f020={'where':_0x26d967[_0x2a0e('0x36')]};return db[_0x2a0e('0x27')][_0x2a0e('0x1a')](_0x24f020)['then'](function(_0x59734f){_0x183e78[_0x2a0e('0x1a')]=_0x59734f;if(_0x44f5b6[_0x2a0e('0x2a')][_0x2a0e('0x40')]){_0x26d967[_0x2a0e('0x41')]=[{'all':!![]}];}return db[_0x2a0e('0x27')]['findAll'](_0x26d967);})['then'](function(_0x1f6db3){_0x183e78[_0x2a0e('0x42')]=_0x1f6db3;return _0x183e78;})[_0x2a0e('0x21')](respondWithFilteredResult(_0x5d8d67,_0x26d967))[_0x2a0e('0x43')](handleError(_0x5d8d67,null));};exports[_0x2a0e('0x44')]=function(_0x41bd5d,_0x2ace69){var _0x3e75e9={'raw':!![],'where':{'id':_0x41bd5d[_0x2a0e('0x45')]['id']}},_0x1133ff={};_0x1133ff[_0x2a0e('0x29')]=_[_0x2a0e('0x2b')](db[_0x2a0e('0x27')]['rawAttributes']);_0x1133ff[_0x2a0e('0x2a')]=_[_0x2a0e('0x2b')](_0x41bd5d[_0x2a0e('0x2a')]);_0x1133ff[_0x2a0e('0x2c')]=_[_0x2a0e('0x2d')](_0x1133ff[_0x2a0e('0x29')],_0x1133ff[_0x2a0e('0x2a')]);_0x3e75e9[_0x2a0e('0x2e')]=_['intersection'](_0x1133ff[_0x2a0e('0x29')],qs[_0x2a0e('0x2f')](_0x41bd5d['query'][_0x2a0e('0x2f')]));_0x3e75e9[_0x2a0e('0x2e')]=_0x3e75e9['attributes'][_0x2a0e('0x30')]?_0x3e75e9['attributes']:_0x1133ff[_0x2a0e('0x29')];if(_0x41bd5d['query']['includeAll']){_0x3e75e9[_0x2a0e('0x41')]=[{'all':!![]}];}_0x3e75e9=_[_0x2a0e('0x39')]({},_0x3e75e9,_0x41bd5d[_0x2a0e('0x3f')]);return db[_0x2a0e('0x27')][_0x2a0e('0x46')](_0x3e75e9)[_0x2a0e('0x21')](handleEntityNotFound(_0x2ace69,null))[_0x2a0e('0x21')](respondWithResult(_0x2ace69,null))[_0x2a0e('0x43')](handleError(_0x2ace69,null));};exports[_0x2a0e('0x47')]=function(_0x5ce514,_0x538a92){return db[_0x2a0e('0x27')]['create'](_0x5ce514[_0x2a0e('0x48')],{})['then'](respondWithResult(_0x538a92,0xc9))[_0x2a0e('0x43')](handleError(_0x538a92,null));};exports[_0x2a0e('0x20')]=function(_0x1f01f3,_0x417952){if(_0x1f01f3[_0x2a0e('0x48')]['id']){delete _0x1f01f3[_0x2a0e('0x48')]['id'];}return db[_0x2a0e('0x27')][_0x2a0e('0x46')]({'where':{'id':_0x1f01f3[_0x2a0e('0x45')]['id']}})[_0x2a0e('0x21')](handleEntityNotFound(_0x417952,null))[_0x2a0e('0x21')](saveUpdates(_0x1f01f3[_0x2a0e('0x48')],null))[_0x2a0e('0x21')](respondWithResult(_0x417952,null))['catch'](handleError(_0x417952,null));};exports['destroy']=function(_0x387efc,_0xb5227){return db[_0x2a0e('0x27')]['find']({'where':{'id':_0x387efc['params']['id']}})[_0x2a0e('0x21')](handleEntityNotFound(_0xb5227,null))[_0x2a0e('0x21')](removeEntity(_0xb5227,null))[_0x2a0e('0x43')](handleError(_0xb5227,null));};exports[_0x2a0e('0x49')]=function(_0x5504f5,_0x5e515d){return db[_0x2a0e('0x27')]['describe']()[_0x2a0e('0x21')](respondWithResult(_0x5e515d,null))[_0x2a0e('0x43')](handleError(_0x5e515d,null));};
\ No newline at end of file
+var _0xdbe1=['length','nolimit','order','sort','where','pick','filter','merge','map','field','options','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','reject','save','update','then','destroy','sendStatus','error','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields'];(function(_0x356311,_0x2d4ab3){var _0x47c80e=function(_0x2a9073){while(--_0x2a9073){_0x356311['push'](_0x356311['shift']());}};_0x47c80e(++_0x2d4ab3);}(_0xdbe1,0x137));var _0x1dbe=function(_0x460db8,_0x53d2f0){_0x460db8=_0x460db8-0x0;var _0x217a40=_0xdbe1[_0x460db8];return _0x217a40;};'use strict';var pdf=require(_0x1dbe('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1dbe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1dbe('0x2'));var rp=require(_0x1dbe('0x3'));var moment=require('moment');var BPromise=require(_0x1dbe('0x4'));var Mustache=require(_0x1dbe('0x5'));var util=require(_0x1dbe('0x6'));var path=require('path');var sox=require(_0x1dbe('0x7'));var csv=require(_0x1dbe('0x8'));var ejs=require(_0x1dbe('0x9'));var fs=require('fs');var _=require(_0x1dbe('0xa'));var squel=require(_0x1dbe('0xb'));var crypto=require(_0x1dbe('0xc'));var jsforce=require(_0x1dbe('0xd'));var deskjs=require(_0x1dbe('0xe'));var toCsv=require(_0x1dbe('0x8'));var querystring=require(_0x1dbe('0xf'));var Papa=require(_0x1dbe('0x10'));var Redis=require(_0x1dbe('0x11'));var authService=require(_0x1dbe('0x12'));var qs=require(_0x1dbe('0x13'));var hardwareService=require(_0x1dbe('0x14'));var logger=require(_0x1dbe('0x15'))('api');var utils=require(_0x1dbe('0x16'));var config=require(_0x1dbe('0x17'));var db=require(_0x1dbe('0x18'))['db'];function respondWithStatusCode(_0x3376c2,_0x2ab040){_0x2ab040=_0x2ab040||0xcc;return function(_0x2eb79e){if(_0x2eb79e){return _0x3376c2['sendStatus'](_0x2ab040);}return _0x3376c2[_0x1dbe('0x19')](_0x2ab040)[_0x1dbe('0x1a')]();};}function respondWithResult(_0x38fdb8,_0x70cecf){_0x70cecf=_0x70cecf||0xc8;return function(_0x3c7978){if(_0x3c7978){return _0x38fdb8[_0x1dbe('0x19')](_0x70cecf)[_0x1dbe('0x1b')](_0x3c7978);}};}function respondWithFilteredResult(_0x17da48,_0x3970a0){return function(_0x4124c0){if(_0x4124c0){var _0x182c90=_0x4124c0[_0x1dbe('0x1c')],_0x3445e6=_0x3970a0[_0x1dbe('0x1d')],_0x3f9277=_0x3970a0[_0x1dbe('0x1d')]+_0x3970a0[_0x1dbe('0x1e')],_0x669753;if(_0x3f9277>=_0x182c90){_0x3f9277=_0x182c90;_0x669753=0xc8;}else{_0x669753=0xce;}_0x17da48[_0x1dbe('0x19')](_0x669753);return _0x17da48['set']('Content-Range',_0x3445e6+'-'+_0x3f9277+'/'+_0x182c90)[_0x1dbe('0x1b')](_0x4124c0);}return null;};}function patchUpdates(_0x29a8bf){return function(_0x36b342){try{jsonpatch['apply'](_0x36b342,_0x29a8bf,!![]);}catch(_0x48c365){return BPromise[_0x1dbe('0x1f')](_0x48c365);}return _0x36b342[_0x1dbe('0x20')]();};}function saveUpdates(_0x2ee906,_0x4a822d){return function(_0x2af6d8){if(_0x2af6d8){return _0x2af6d8[_0x1dbe('0x21')](_0x2ee906)[_0x1dbe('0x22')](function(_0x192c75){return _0x192c75;});}return null;};}function removeEntity(_0x1b2bac,_0x10967f){return function(_0x39ad77){if(_0x39ad77){return _0x39ad77[_0x1dbe('0x23')]()[_0x1dbe('0x22')](function(){_0x1b2bac[_0x1dbe('0x19')](0xcc)[_0x1dbe('0x1a')]();});}};}function handleEntityNotFound(_0x110b52,_0x44a9ce){return function(_0x147ac2){if(!_0x147ac2){_0x110b52[_0x1dbe('0x24')](0x194);}return _0x147ac2;};}function handleError(_0x4ac486,_0x3ded76){_0x3ded76=_0x3ded76||0x1f4;return function(_0x33ef9b){logger[_0x1dbe('0x25')](_0x33ef9b['stack']);if(_0x33ef9b[_0x1dbe('0x26')]){delete _0x33ef9b['name'];}_0x4ac486[_0x1dbe('0x19')](_0x3ded76)[_0x1dbe('0x27')](_0x33ef9b);};}exports[_0x1dbe('0x28')]=function(_0x23daac,_0x29acba){var _0x5a542f={},_0x3c7a20={},_0x25be03={'count':0x0,'rows':[]};var _0x552bf7=db['VoiceDialReport'][_0x1dbe('0x29')];_0x3c7a20[_0x1dbe('0x2a')]=_[_0x1dbe('0x2b')](_0x552bf7);_0x3c7a20[_0x1dbe('0x2c')]=_[_0x1dbe('0x2b')](_0x23daac[_0x1dbe('0x2c')]);_0x3c7a20[_0x1dbe('0x2d')]=_['intersection'](_0x3c7a20[_0x1dbe('0x2a')],_0x3c7a20[_0x1dbe('0x2c')]);_0x5a542f[_0x1dbe('0x2e')]=_[_0x1dbe('0x2f')](_0x3c7a20[_0x1dbe('0x2a')],qs['fields'](_0x23daac[_0x1dbe('0x2c')][_0x1dbe('0x30')]));_0x5a542f[_0x1dbe('0x2e')]=_0x5a542f[_0x1dbe('0x2e')][_0x1dbe('0x31')]?_0x5a542f[_0x1dbe('0x2e')]:_0x3c7a20[_0x1dbe('0x2a')];if(!_0x23daac['query']['hasOwnProperty'](_0x1dbe('0x32'))){_0x5a542f['limit']=qs[_0x1dbe('0x1e')](_0x23daac[_0x1dbe('0x2c')][_0x1dbe('0x1e')]);_0x5a542f[_0x1dbe('0x1d')]=qs['offset'](_0x23daac[_0x1dbe('0x2c')][_0x1dbe('0x1d')]);}_0x5a542f[_0x1dbe('0x33')]=qs[_0x1dbe('0x34')](_0x23daac[_0x1dbe('0x2c')][_0x1dbe('0x34')]);_0x5a542f[_0x1dbe('0x35')]=qs['filters'](_[_0x1dbe('0x36')](_0x23daac['query'],_0x3c7a20['filters']));if(_0x23daac[_0x1dbe('0x2c')][_0x1dbe('0x37')]){_0x5a542f[_0x1dbe('0x35')]=_[_0x1dbe('0x38')](_0x5a542f['where'],{'$or':_[_0x1dbe('0x39')](_0x552bf7,function(_0x1068a6){if(_0x1068a6['type']['key']!=='VIRTUAL'){var _0x2f185d={};_0x2f185d[_0x1068a6[_0x1dbe('0x3a')]]={'$like':'%'+_0x23daac[_0x1dbe('0x2c')][_0x1dbe('0x37')]+'%'};return _0x2f185d;}})});}_0x5a542f=_[_0x1dbe('0x38')]({},_0x5a542f,_0x23daac[_0x1dbe('0x3b')]);var _0x59a93d={'where':_0x5a542f[_0x1dbe('0x35')]};return db[_0x1dbe('0x3c')][_0x1dbe('0x1c')](_0x59a93d)['then'](function(_0x5b6914){_0x25be03[_0x1dbe('0x1c')]=_0x5b6914;if(_0x23daac[_0x1dbe('0x2c')][_0x1dbe('0x3d')]){_0x5a542f[_0x1dbe('0x3e')]=[{'all':!![]}];}return db[_0x1dbe('0x3c')][_0x1dbe('0x3f')](_0x5a542f);})['then'](function(_0x53879d){_0x25be03[_0x1dbe('0x40')]=_0x53879d;return _0x25be03;})[_0x1dbe('0x22')](respondWithFilteredResult(_0x29acba,_0x5a542f))[_0x1dbe('0x41')](handleError(_0x29acba,null));};exports[_0x1dbe('0x42')]=function(_0x10937b,_0x23d79b){var _0x318dac={'raw':!![],'where':{'id':_0x10937b[_0x1dbe('0x43')]['id']}},_0x18e884={};_0x18e884[_0x1dbe('0x2a')]=_[_0x1dbe('0x2b')](db[_0x1dbe('0x3c')][_0x1dbe('0x29')]);_0x18e884['query']=_[_0x1dbe('0x2b')](_0x10937b[_0x1dbe('0x2c')]);_0x18e884[_0x1dbe('0x2d')]=_['intersection'](_0x18e884[_0x1dbe('0x2a')],_0x18e884['query']);_0x318dac[_0x1dbe('0x2e')]=_[_0x1dbe('0x2f')](_0x18e884[_0x1dbe('0x2a')],qs[_0x1dbe('0x30')](_0x10937b[_0x1dbe('0x2c')]['fields']));_0x318dac[_0x1dbe('0x2e')]=_0x318dac[_0x1dbe('0x2e')][_0x1dbe('0x31')]?_0x318dac[_0x1dbe('0x2e')]:_0x18e884[_0x1dbe('0x2a')];if(_0x10937b[_0x1dbe('0x2c')][_0x1dbe('0x3d')]){_0x318dac[_0x1dbe('0x3e')]=[{'all':!![]}];}_0x318dac=_[_0x1dbe('0x38')]({},_0x318dac,_0x10937b[_0x1dbe('0x3b')]);return db[_0x1dbe('0x3c')]['find'](_0x318dac)[_0x1dbe('0x22')](handleEntityNotFound(_0x23d79b,null))[_0x1dbe('0x22')](respondWithResult(_0x23d79b,null))[_0x1dbe('0x41')](handleError(_0x23d79b,null));};exports[_0x1dbe('0x44')]=function(_0x31e17c,_0x1932b5){return db[_0x1dbe('0x3c')][_0x1dbe('0x44')](_0x31e17c[_0x1dbe('0x45')],{})[_0x1dbe('0x22')](respondWithResult(_0x1932b5,0xc9))[_0x1dbe('0x41')](handleError(_0x1932b5,null));};exports['update']=function(_0x33aaec,_0x9bc56f){if(_0x33aaec[_0x1dbe('0x45')]['id']){delete _0x33aaec[_0x1dbe('0x45')]['id'];}return db[_0x1dbe('0x3c')]['find']({'where':{'id':_0x33aaec[_0x1dbe('0x43')]['id']}})[_0x1dbe('0x22')](handleEntityNotFound(_0x9bc56f,null))['then'](saveUpdates(_0x33aaec[_0x1dbe('0x45')],null))[_0x1dbe('0x22')](respondWithResult(_0x9bc56f,null))[_0x1dbe('0x41')](handleError(_0x9bc56f,null));};exports['destroy']=function(_0xf23604,_0x2c6f4e){return db[_0x1dbe('0x3c')][_0x1dbe('0x46')]({'where':{'id':_0xf23604['params']['id']}})['then'](handleEntityNotFound(_0x2c6f4e,null))['then'](removeEntity(_0x2c6f4e,null))[_0x1dbe('0x41')](handleError(_0x2c6f4e,null));};exports['describe']=function(_0x1e6e67,_0x1046a3){return db[_0x1dbe('0x3c')][_0x1dbe('0x47')]()[_0x1dbe('0x22')](respondWithResult(_0x1046a3,null))[_0x1dbe('0x41')](handleError(_0x1046a3,null));};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js
index 43c7028..532dd67 100644
--- a/server/api/voiceDialReport/voiceDialReport.model.js
+++ b/server/api/voiceDialReport/voiceDialReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0f69=['uniqueid','../../config/logger','moment','bluebird','path','rimraf','./voiceDialReport.attributes','define','VoiceDialReport','report_dial'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x0f69,0x173));var _0x90f6=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x0f69[_0x20a558];return _0x53d3f7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x90f6('0x0'))('api');var moment=require(_0x90f6('0x1'));var BPromise=require(_0x90f6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90f6('0x3'));var rimraf=require(_0x90f6('0x4'));var config=require('../../config/environment');var attributes=require(_0x90f6('0x5'));module['exports']=function(_0x1840a5,_0x3dfd95){return _0x1840a5[_0x90f6('0x6')](_0x90f6('0x7'),attributes,{'tableName':_0x90f6('0x8'),'paranoid':![],'indexes':[{'fields':[_0x90f6('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb350=['../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0xb350,0x6f));var _0x0b35=function(_0x39d658,_0x132f3d){_0x39d658=_0x39d658-0x0;var _0x392885=_0xb350[_0x39d658];return _0x392885;};'use strict';var _=require(_0x0b35('0x0'));var util=require(_0x0b35('0x1'));var logger=require(_0x0b35('0x2'))(_0x0b35('0x3'));var moment=require('moment');var BPromise=require(_0x0b35('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b35('0x5'));var rimraf=require('rimraf');var config=require(_0x0b35('0x6'));var attributes=require(_0x0b35('0x7'));module[_0x0b35('0x8')]=function(_0x1218c3,_0x417722){return _0x1218c3[_0x0b35('0x9')](_0x0b35('0xa'),attributes,{'tableName':_0x0b35('0xb'),'paranoid':![],'indexes':[{'fields':[_0x0b35('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js
index ce94969..9e695bd 100644
--- a/server/api/voiceDialReport/voiceDialReport.rpc.js
+++ b/server/api/voiceDialReport/voiceDialReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x57cf=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceDialReport','body','options','CreateVoiceDialReport','raw','where','attributes','then','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring'];(function(_0x12cbd8,_0x8ef0ce){var _0x2fb1ab=function(_0x57242c){while(--_0x57242c){_0x12cbd8['push'](_0x12cbd8['shift']());}};_0x2fb1ab(++_0x8ef0ce);}(_0x57cf,0x11b));var _0xf57c=function(_0x130705,_0x2d266b){_0x130705=_0x130705-0x0;var _0x1fa991=_0x57cf[_0x130705];return _0x1fa991;};'use strict';var _=require(_0xf57c('0x0'));var util=require(_0xf57c('0x1'));var moment=require(_0xf57c('0x2'));var BPromise=require(_0xf57c('0x3'));var rs=require(_0xf57c('0x4'));var fs=require('fs');var Redis=require(_0xf57c('0x5'));var db=require(_0xf57c('0x6'))['db'];var utils=require(_0xf57c('0x7'));var logger=require(_0xf57c('0x8'))(_0xf57c('0x9'));var config=require('../../config/environment');var jayson=require(_0xf57c('0xa'));var client=jayson['client'][_0xf57c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5816f5,_0x53ed52,_0x21a69d){return new BPromise(function(_0x4867f6,_0x2cbb69){return client[_0xf57c('0xc')](_0x5816f5,_0x21a69d)['then'](function(_0x5b5314){logger[_0xf57c('0xd')](_0xf57c('0xe'),_0x53ed52,_0xf57c('0xf'));logger[_0xf57c('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x53ed52,_0xf57c('0xf'),JSON[_0xf57c('0x11')](_0x5b5314));if(_0x5b5314[_0xf57c('0x12')]){if(_0x5b5314['error'][_0xf57c('0x13')]===0x1f4){logger['error'](_0xf57c('0xe'),_0x53ed52,_0x5b5314[_0xf57c('0x12')]['message']);return _0x2cbb69(_0x5b5314[_0xf57c('0x12')]['message']);}logger[_0xf57c('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x53ed52,_0x5b5314[_0xf57c('0x12')][_0xf57c('0x14')]);return _0x4867f6(_0x5b5314[_0xf57c('0x12')][_0xf57c('0x14')]);}else{logger[_0xf57c('0xd')](_0xf57c('0xe'),_0x53ed52,_0xf57c('0xf'));_0x4867f6(_0x5b5314[_0xf57c('0x15')]['message']);}})[_0xf57c('0x16')](function(_0x524084){logger[_0xf57c('0x12')](_0xf57c('0xe'),_0x53ed52,_0x524084);_0x2cbb69(_0x524084);});});}exports['CreateVoiceDialReport']=function(_0x385a4f){var _0x36723a=this;return new Promise(function(_0x3eb951,_0x9ede98){return db[_0xf57c('0x17')]['create'](_0x385a4f[_0xf57c('0x18')],{'raw':_0x385a4f[_0xf57c('0x19')]?_0x385a4f[_0xf57c('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3ac299){logger[_0xf57c('0xd')](_0xf57c('0x1a'),_0x385a4f);logger[_0xf57c('0x10')](_0xf57c('0x1a'),_0x385a4f,JSON[_0xf57c('0x11')](_0x3ac299));_0x3eb951(_0x3ac299);})[_0xf57c('0x16')](function(_0x396e18){logger[_0xf57c('0x12')]('CreateVoiceDialReport',_0x396e18[_0xf57c('0x14')],_0x385a4f);_0x9ede98(_0x36723a[_0xf57c('0x12')](0x1f4,_0x396e18['message']));});});};exports['UpdateVoiceDialReport']=function(_0x3c4923){var _0x53ea83=this;return new Promise(function(_0x1741cd,_0xcde0f0){return db[_0xf57c('0x17')]['update'](_0x3c4923[_0xf57c('0x18')],{'raw':_0x3c4923[_0xf57c('0x19')]?_0x3c4923['options'][_0xf57c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c4923[_0xf57c('0x19')]?_0x3c4923[_0xf57c('0x19')][_0xf57c('0x1c')]||null:null,'attributes':_0x3c4923[_0xf57c('0x19')]?_0x3c4923[_0xf57c('0x19')][_0xf57c('0x1d')]||null:null,'limit':_0x3c4923[_0xf57c('0x19')]?_0x3c4923[_0xf57c('0x19')]['limit']||null:null})[_0xf57c('0x1e')](function(_0x1f5f3b){logger['info'](_0xf57c('0x1f'),_0x3c4923);logger[_0xf57c('0x10')](_0xf57c('0x1f'),_0x3c4923,JSON[_0xf57c('0x11')](_0x1f5f3b));_0x1741cd(_0x1f5f3b);})[_0xf57c('0x16')](function(_0x3bf095){logger[_0xf57c('0x12')](_0xf57c('0x1f'),_0x3bf095[_0xf57c('0x14')],_0x3c4923);_0xcde0f0(_0x53ea83[_0xf57c('0x12')](0x1f4,_0x3bf095['message']));});});};
\ No newline at end of file
+var _0xd6ce=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','debug','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util'];(function(_0x194e9f,_0x29e7ef){var _0x2c3af5=function(_0x30cf32){while(--_0x30cf32){_0x194e9f['push'](_0x194e9f['shift']());}};_0x2c3af5(++_0x29e7ef);}(_0xd6ce,0x127));var _0xed6c=function(_0x147b3f,_0x60dbbd){_0x147b3f=_0x147b3f-0x0;var _0x1b76cf=_0xd6ce[_0x147b3f];return _0x1b76cf;};'use strict';var _=require(_0xed6c('0x0'));var util=require(_0xed6c('0x1'));var moment=require(_0xed6c('0x2'));var BPromise=require(_0xed6c('0x3'));var rs=require(_0xed6c('0x4'));var fs=require('fs');var Redis=require(_0xed6c('0x5'));var db=require(_0xed6c('0x6'))['db'];var utils=require(_0xed6c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xed6c('0x8'));var jayson=require(_0xed6c('0x9'));var client=jayson[_0xed6c('0xa')][_0xed6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a6546,_0x5e0e3a,_0x7668a7){return new BPromise(function(_0x46e2c4,_0x4fd673){return client['request'](_0x4a6546,_0x7668a7)[_0xed6c('0xc')](function(_0xc996c4){logger[_0xed6c('0xd')](_0xed6c('0xe'),_0x5e0e3a,'request\x20sent');logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x5e0e3a,'request\x20sent',JSON[_0xed6c('0xf')](_0xc996c4));if(_0xc996c4['error']){if(_0xc996c4['error'][_0xed6c('0x10')]===0x1f4){logger[_0xed6c('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x5e0e3a,_0xc996c4[_0xed6c('0x11')]['message']);return _0x4fd673(_0xc996c4[_0xed6c('0x11')][_0xed6c('0x12')]);}logger['error'](_0xed6c('0xe'),_0x5e0e3a,_0xc996c4[_0xed6c('0x11')][_0xed6c('0x12')]);return _0x46e2c4(_0xc996c4[_0xed6c('0x11')]['message']);}else{logger['info'](_0xed6c('0xe'),_0x5e0e3a,_0xed6c('0x13'));_0x46e2c4(_0xc996c4[_0xed6c('0x14')]['message']);}})[_0xed6c('0x15')](function(_0x526c54){logger[_0xed6c('0x11')](_0xed6c('0xe'),_0x5e0e3a,_0x526c54);_0x4fd673(_0x526c54);});});}exports[_0xed6c('0x16')]=function(_0x1fe8c0){var _0x4a920e=this;return new Promise(function(_0x387ba1,_0x1856f7){return db[_0xed6c('0x17')]['create'](_0x1fe8c0[_0xed6c('0x18')],{'raw':_0x1fe8c0[_0xed6c('0x19')]?_0x1fe8c0[_0xed6c('0x19')][_0xed6c('0x1a')]===undefined?!![]:![]:!![]})[_0xed6c('0xc')](function(_0x5e86ad){logger[_0xed6c('0xd')]('CreateVoiceDialReport',_0x1fe8c0);logger[_0xed6c('0x1b')](_0xed6c('0x16'),_0x1fe8c0,JSON[_0xed6c('0xf')](_0x5e86ad));_0x387ba1(_0x5e86ad);})[_0xed6c('0x15')](function(_0x49a583){logger[_0xed6c('0x11')]('CreateVoiceDialReport',_0x49a583[_0xed6c('0x12')],_0x1fe8c0);_0x1856f7(_0x4a920e['error'](0x1f4,_0x49a583[_0xed6c('0x12')]));});});};exports[_0xed6c('0x1c')]=function(_0x51876b){var _0x28ccfd=this;return new Promise(function(_0x391970,_0x1c3aca){return db[_0xed6c('0x17')][_0xed6c('0x1d')](_0x51876b[_0xed6c('0x18')],{'raw':_0x51876b[_0xed6c('0x19')]?_0x51876b[_0xed6c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51876b[_0xed6c('0x19')]?_0x51876b[_0xed6c('0x19')][_0xed6c('0x1e')]||null:null,'attributes':_0x51876b[_0xed6c('0x19')]?_0x51876b[_0xed6c('0x19')][_0xed6c('0x1f')]||null:null,'limit':_0x51876b['options']?_0x51876b[_0xed6c('0x19')][_0xed6c('0x20')]||null:null})[_0xed6c('0xc')](function(_0x4e0a5a){logger['info']('UpdateVoiceDialReport',_0x51876b);logger['debug'](_0xed6c('0x1c'),_0x51876b,JSON['stringify'](_0x4e0a5a));_0x391970(_0x4e0a5a);})[_0xed6c('0x15')](function(_0x4d4feb){logger[_0xed6c('0x11')](_0xed6c('0x1c'),_0x4d4feb['message'],_0x51876b);_0x1c3aca(_0x28ccfd[_0xed6c('0x11')](0x1f4,_0x4d4feb[_0xed6c('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js
index 5063e0b..dfdca0c 100644
--- a/server/api/voiceExtension/index.js
+++ b/server/api/voiceExtension/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c71=['get','isAuthenticated','index','/:id','post','addApplications','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c71,0xfb));var _0x10c7=function(_0x525d27,_0x28306c){_0x525d27=_0x525d27-0x0;var _0x59ef61=_0x0c71[_0x525d27];return _0x59ef61;};'use strict';var multer=require('multer');var util=require(_0x10c7('0x0'));var path=require('path');var timeout=require(_0x10c7('0x1'));var express=require(_0x10c7('0x2'));var router=express[_0x10c7('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x10c7('0x4'));var controller=require('./voiceExtension.controller');router[_0x10c7('0x5')]('/',auth[_0x10c7('0x6')](),controller[_0x10c7('0x7')]);router[_0x10c7('0x5')](_0x10c7('0x8'),auth[_0x10c7('0x6')](),controller['show']);router[_0x10c7('0x9')]('/',auth[_0x10c7('0x6')](),controller['create']);router[_0x10c7('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x10c7('0xa')]);router[_0x10c7('0xb')]('/:id',auth[_0x10c7('0x6')](),controller[_0x10c7('0xc')]);router[_0x10c7('0xd')](_0x10c7('0x8'),auth[_0x10c7('0x6')](),controller[_0x10c7('0xe')]);module[_0x10c7('0xf')]=router;
\ No newline at end of file
+var _0x5ea2=['index','get','/:id','isAuthenticated','show','post','create','addApplications','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller'];(function(_0x15af87,_0x45491a){var _0x2daedc=function(_0x600296){while(--_0x600296){_0x15af87['push'](_0x15af87['shift']());}};_0x2daedc(++_0x45491a);}(_0x5ea2,0x99));var _0x25ea=function(_0x5cc9b5,_0x54784e){_0x5cc9b5=_0x5cc9b5-0x0;var _0x56ceba=_0x5ea2[_0x5cc9b5];return _0x56ceba;};'use strict';var multer=require(_0x25ea('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x25ea('0x1'));var express=require(_0x25ea('0x2'));var router=express[_0x25ea('0x3')]();var auth=require(_0x25ea('0x4'));var interaction=require(_0x25ea('0x5'));var config=require('../../config/environment');var controller=require(_0x25ea('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x25ea('0x7')]);router[_0x25ea('0x8')](_0x25ea('0x9'),auth[_0x25ea('0xa')](),controller[_0x25ea('0xb')]);router[_0x25ea('0xc')]('/',auth[_0x25ea('0xa')](),controller[_0x25ea('0xd')]);router[_0x25ea('0xc')]('/:id/applications',auth[_0x25ea('0xa')](),controller[_0x25ea('0xe')]);router[_0x25ea('0xf')](_0x25ea('0x9'),auth['isAuthenticated'](),controller[_0x25ea('0x10')]);router[_0x25ea('0x11')](_0x25ea('0x9'),auth[_0x25ea('0xa')](),controller[_0x25ea('0x12')]);module[_0x25ea('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js
index 68b8ad4..a749bcf 100644
--- a/server/api/voiceExtension/voiceExtension.attributes.js
+++ b/server/api/voiceExtension/voiceExtension.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e81=['NoOp','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','exten','sequelize','exports','STRING','compositeIndex'];(function(_0x55e5b9,_0x1be20e){var _0x58d1e7=function(_0x3cba6d){while(--_0x3cba6d){_0x55e5b9['push'](_0x55e5b9['shift']());}};_0x58d1e7(++_0x1be20e);}(_0x4e81,0x1bc));var _0x14e8=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x4e81[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'context':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x14e8('0x3')},'tag':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'defaultValue':_0x14e8('0x4')},'appdata':{'type':Sequelize[_0x14e8('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0x14e8('0x5'),_0x14e8('0x6'),_0x14e8('0x7'),_0x14e8('0x8'),_0x14e8('0x9'),_0x14e8('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x14e8('0x2')]},'interval':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'defaultValue':_0x14e8('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x14e8('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x14e8('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x14e8('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x14e8('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x14e8('0xd')]},'recordingFormat':{'type':Sequelize[_0x14e8('0x2')],'defaultValue':_0x14e8('0xe')},'answer':{'type':Sequelize[_0x14e8('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x37eccb){return this['getDataValue'](_0x14e8('0xf'));}}};
\ No newline at end of file
+var _0x76dc=['getDataValue','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','inbound-fax','outbound-fax','system','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL'];(function(_0x40b325,_0x51126c){var _0x35bf8d=function(_0x265844){while(--_0x265844){_0x40b325['push'](_0x40b325['shift']());}};_0x35bf8d(++_0x51126c);}(_0x76dc,0x1f2));var _0xc76d=function(_0x235c49,_0x30ee7f){_0x235c49=_0x235c49-0x0;var _0x2bc889=_0x76dc[_0x235c49];return _0x2bc889;};'use strict';var Sequelize=require(_0xc76d('0x0'));module[_0xc76d('0x1')]={'context':{'type':Sequelize[_0xc76d('0x2')],'allowNull':![],'unique':_0xc76d('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc76d('0x3')},'priority':{'type':Sequelize[_0xc76d('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xc76d('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xc76d('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xc76d('0x4')](_0xc76d('0x5'),'outbound','internal',_0xc76d('0x6'),_0xc76d('0x7'),_0xc76d('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc76d('0x2')],'allowNull':![],'defaultValue':_0xc76d('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xc76d('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xc76d('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xc76d('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xc76d('0xb')]},'recordingFormat':{'type':Sequelize[_0xc76d('0x2')],'defaultValue':_0xc76d('0xc')},'answer':{'type':Sequelize[_0xc76d('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xc76d('0xd')],'get':function(_0x2e02e9){return this[_0xc76d('0xe')](_0xc76d('0xf'));}}};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js
index 51b286d..4f57ad2 100644
--- a/server/api/voiceExtension/voiceExtension.controller.js
+++ b/server/api/voiceExtension/voiceExtension.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6587=['../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','set','Content-Range','reject','update','then','destroy','InboundRoutes','inbound','OutboundRoutes','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','VoiceExtension','keys','query','model','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filters','pick','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','startsWith','concat','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x6587,0x1eb));var _0x7658=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x6587[_0x3c4737];return _0x2bb926;};'use strict';var pdf=require(_0x7658('0x0'));var emlformat=require(_0x7658('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7658('0x2'));var jsonpatch=require(_0x7658('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7658('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7658('0x5'));var sox=require(_0x7658('0x6'));var csv=require(_0x7658('0x7'));var ejs=require(_0x7658('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7658('0x9'));var crypto=require(_0x7658('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7658('0x7'));var querystring=require(_0x7658('0xb'));var Papa=require(_0x7658('0xc'));var Redis=require(_0x7658('0xd'));var authService=require(_0x7658('0xe'));var qs=require(_0x7658('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7658('0x10'))(_0x7658('0x11'));var utils=require(_0x7658('0x12'));var config=require(_0x7658('0x13'));var db=require(_0x7658('0x14'))['db'];config['redis']=_[_0x7658('0x15')](config['redis'],{'host':_0x7658('0x16'),'port':0x18eb});var socket=require(_0x7658('0x17'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x7658('0x18')](socket);function respondWithStatusCode(_0x46b7e9,_0x5d4e0c){_0x5d4e0c=_0x5d4e0c||0xcc;return function(_0x52192d){if(_0x52192d){return _0x46b7e9[_0x7658('0x19')](_0x5d4e0c);}return _0x46b7e9['status'](_0x5d4e0c)[_0x7658('0x1a')]();};}function respondWithResult(_0x10ef41,_0x35d94a){_0x35d94a=_0x35d94a||0xc8;return function(_0x1e8418){if(_0x1e8418){return _0x10ef41[_0x7658('0x1b')](_0x35d94a)[_0x7658('0x1c')](_0x1e8418);}};}function respondWithFilteredResult(_0xa0186d,_0x5028e8){return function(_0x16d113){if(_0x16d113){var _0x455ee3=_0x16d113[_0x7658('0x1d')],_0x27ae39=_0x5028e8[_0x7658('0x1e')],_0x34114e=_0x5028e8[_0x7658('0x1e')]+_0x5028e8['limit'],_0x4b11e9;if(_0x34114e>=_0x455ee3){_0x34114e=_0x455ee3;_0x4b11e9=0xc8;}else{_0x4b11e9=0xce;}_0xa0186d['status'](_0x4b11e9);return _0xa0186d[_0x7658('0x1f')](_0x7658('0x20'),_0x27ae39+'-'+_0x34114e+'/'+_0x455ee3)['json'](_0x16d113);}return null;};}function patchUpdates(_0x786281){return function(_0x424667){try{jsonpatch['apply'](_0x424667,_0x786281,!![]);}catch(_0x5c49b7){return BPromise[_0x7658('0x21')](_0x5c49b7);}return _0x424667['save']();};}function saveUpdates(_0x2ffb3f,_0x1ac2b1){return function(_0x3c382f){if(_0x3c382f){return _0x3c382f[_0x7658('0x22')](_0x2ffb3f)[_0x7658('0x23')](function(_0x3434df){return _0x3434df;});}return null;};}function removeEntity(_0x2380f7,_0x456c89){return function(_0x859db0){if(_0x859db0){return _0x859db0[_0x7658('0x24')]()[_0x7658('0x23')](function(){var _0x30915b=_0x859db0['get']({'plain':!![]});var _0x21df63=[{'name':_0x7658('0x25'),'value':_0x7658('0x26'),'ignore':![]},{'name':_0x7658('0x27'),'value':_0x7658('0x28'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x247431=_(_0x21df63)[_0x7658('0x29')](_0x7658('0x2a'))[_0x7658('0x2b')]('value')[_0x7658('0x2c')]();if(_[_0x7658('0x2d')](_0x247431,_0x30915b[_0x7658('0x2e')])){return;}var _0x89e500=_[_0x7658('0x2f')](_0x21df63,['value',_0x30915b[_0x7658('0x2e')]])[_0x7658('0x30')];return db[_0x7658('0x31')][_0x7658('0x24')]({'where':{'type':_0x89e500,'resourceId':_0x30915b['id']}})[_0x7658('0x23')](function(){return _0x859db0;});})[_0x7658('0x23')](function(){_0x2380f7[_0x7658('0x1b')](0xcc)[_0x7658('0x1a')]();});}};}function handleEntityNotFound(_0x1587cc,_0x436f6a){return function(_0x2665a4){if(!_0x2665a4){_0x1587cc['sendStatus'](0x194);}return _0x2665a4;};}function handleError(_0x1e3270,_0x70cac6){_0x70cac6=_0x70cac6||0x1f4;return function(_0x1310f2){logger[_0x7658('0x32')](_0x1310f2['stack']);if(_0x1310f2[_0x7658('0x30')]){delete _0x1310f2[_0x7658('0x30')];}_0x1e3270[_0x7658('0x1b')](_0x70cac6)[_0x7658('0x33')](_0x1310f2);};}exports[_0x7658('0x34')]=function(_0xfa9efc,_0x5856c1){var _0x5d9710={},_0xae434c={},_0x48e708={'count':0x0,'rows':[]};var _0x3eeecc=db[_0x7658('0x35')]['rawAttributes'];_0xae434c['model']=_[_0x7658('0x36')](_0x3eeecc);_0xae434c['query']=_[_0x7658('0x36')](_0xfa9efc[_0x7658('0x37')]);_0xae434c['filters']=_['intersection'](_0xae434c[_0x7658('0x38')],_0xae434c[_0x7658('0x37')]);_0x5d9710[_0x7658('0x39')]=_[_0x7658('0x3a')](_0xae434c[_0x7658('0x38')],qs[_0x7658('0x3b')](_0xfa9efc[_0x7658('0x37')][_0x7658('0x3b')]));_0x5d9710[_0x7658('0x39')]=_0x5d9710[_0x7658('0x39')][_0x7658('0x3c')]?_0x5d9710[_0x7658('0x39')]:_0xae434c[_0x7658('0x38')];if(!_0xfa9efc[_0x7658('0x37')]['hasOwnProperty'](_0x7658('0x3d'))){_0x5d9710[_0x7658('0x3e')]=qs[_0x7658('0x3e')](_0xfa9efc[_0x7658('0x37')][_0x7658('0x3e')]);_0x5d9710[_0x7658('0x1e')]=qs[_0x7658('0x1e')](_0xfa9efc[_0x7658('0x37')][_0x7658('0x1e')]);}_0x5d9710[_0x7658('0x3f')]=qs[_0x7658('0x40')](_0xfa9efc[_0x7658('0x37')]['sort']);_0x5d9710[_0x7658('0x41')]=qs[_0x7658('0x42')](_[_0x7658('0x43')](_0xfa9efc[_0x7658('0x37')],_0xae434c[_0x7658('0x42')]));if(_0xfa9efc[_0x7658('0x37')][_0x7658('0x29')]){_0x5d9710[_0x7658('0x41')]=_[_0x7658('0x44')](_0x5d9710['where'],{'$or':_[_0x7658('0x2b')](_0x3eeecc,function(_0x4b2a7a){if(_0x4b2a7a['type'][_0x7658('0x45')]!==_0x7658('0x46')){var _0x36003f={};_0x36003f[_0x4b2a7a[_0x7658('0x47')]]={'$like':'%'+_0xfa9efc[_0x7658('0x37')][_0x7658('0x29')]+'%'};return _0x36003f;}})});}_0x5d9710=_[_0x7658('0x44')]({},_0x5d9710,_0xfa9efc[_0x7658('0x48')]);var _0x1bd9d3={'where':_0x5d9710[_0x7658('0x41')]};return db[_0x7658('0x35')]['count'](_0x1bd9d3)[_0x7658('0x23')](function(_0x362b70){_0x48e708['count']=_0x362b70;if(_0xfa9efc[_0x7658('0x37')][_0x7658('0x49')]){_0x5d9710[_0x7658('0x4a')]=[{'all':!![]}];}return db[_0x7658('0x35')][_0x7658('0x4b')](_0x5d9710);})[_0x7658('0x23')](function(_0x3228f1){_0x48e708[_0x7658('0x4c')]=_0x3228f1;return _0x48e708;})[_0x7658('0x23')](respondWithFilteredResult(_0x5856c1,_0x5d9710))[_0x7658('0x4d')](handleError(_0x5856c1,null));};exports[_0x7658('0x4e')]=function(_0x918496,_0x30145e){var _0xc97ef4={'raw':![],'where':{'id':_0x918496[_0x7658('0x4f')]['id']}},_0x3ef77a={};_0x3ef77a[_0x7658('0x38')]=_[_0x7658('0x36')](db[_0x7658('0x35')][_0x7658('0x50')]);_0x3ef77a[_0x7658('0x37')]=_[_0x7658('0x36')](_0x918496[_0x7658('0x37')]);_0x3ef77a[_0x7658('0x42')]=_[_0x7658('0x3a')](_0x3ef77a['model'],_0x3ef77a[_0x7658('0x37')]);_0xc97ef4[_0x7658('0x39')]=_[_0x7658('0x3a')](_0x3ef77a[_0x7658('0x38')],qs[_0x7658('0x3b')](_0x918496['query']['fields']));_0xc97ef4[_0x7658('0x39')]=_0xc97ef4[_0x7658('0x39')][_0x7658('0x3c')]?_0xc97ef4[_0x7658('0x39')]:_0x3ef77a[_0x7658('0x38')];if(_0x918496[_0x7658('0x37')]['includeAll']){_0xc97ef4[_0x7658('0x4a')]=[{'all':!![]}];}_0xc97ef4=_[_0x7658('0x44')]({},_0xc97ef4,_0x918496['options']);return db[_0x7658('0x35')][_0x7658('0x2f')](_0xc97ef4)['then'](handleEntityNotFound(_0x30145e,null))[_0x7658('0x23')](respondWithResult(_0x30145e,null))[_0x7658('0x4d')](handleError(_0x30145e,null));};exports[_0x7658('0x24')]=function(_0x4d4a6e,_0x3f3606){return db[_0x7658('0x35')][_0x7658('0x2f')]({'where':{'id':_0x4d4a6e[_0x7658('0x4f')]['id']}})[_0x7658('0x23')](handleEntityNotFound(_0x3f3606,null))[_0x7658('0x23')](removeEntity(_0x3f3606,null))['catch'](handleError(_0x3f3606,null));};exports['create']=function(_0x3b9076,_0x3281ce){if(_0x3b9076[_0x7658('0x51')]['type']===_0x7658('0x28')&&!_[_0x7658('0x52')](_0x3b9076[_0x7658('0x51')]['exten'],'_')){_0x3b9076[_0x7658('0x51')]['exten']='_'[_0x7658('0x53')](_0x3b9076[_0x7658('0x51')]['exten']);}return db[_0x7658('0x35')][_0x7658('0x54')](_0x3b9076[_0x7658('0x51')],{'raw':![]})[_0x7658('0x23')](function(_0x36c9a8){var _0x321b8f=_0x3b9076['user']['get']({'plain':!![]});if(!_0x321b8f)throw new Error(_0x7658('0x55'));if(_0x321b8f['role']===_0x7658('0x56')){var _0x3133c3=_0x36c9a8['get']({'plain':!![]});var _0x5996fb=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x7658('0x27'),'value':_0x7658('0x28')},{'name':'InternalRoutes','value':'internal'}];var _0x5b3524=_['find'](_0x5996fb,[_0x7658('0x2c'),_0x3133c3[_0x7658('0x2e')]])['name'];return db[_0x7658('0x57')]['find']({'where':{'name':_0x5b3524,'userProfileId':_0x321b8f['userProfileId']},'raw':!![]})[_0x7658('0x23')](function(_0x51c520){if(_0x51c520&&_0x51c520[_0x7658('0x58')]===0x0){return db[_0x7658('0x31')][_0x7658('0x54')]({'name':_0x3133c3[_0x7658('0x30')],'resourceId':_0x3133c3['id'],'type':_0x51c520[_0x7658('0x30')],'sectionId':_0x51c520['id']},{})[_0x7658('0x23')](function(){return _0x36c9a8;});}else{return _0x36c9a8;}})['catch'](function(_0x50314f){logger['error'](_0x7658('0x59'),_0x50314f);throw _0x50314f;});}return _0x36c9a8;})[_0x7658('0x23')](respondWithResult(_0x3281ce,0xc9))[_0x7658('0x4d')](handleError(_0x3281ce,null));};exports[_0x7658('0x22')]=function(_0x4866df,_0x95846b){if(_0x4866df[_0x7658('0x51')]['id']){delete _0x4866df[_0x7658('0x51')]['id'];}return db[_0x7658('0x35')][_0x7658('0x2f')]({'where':{'id':_0x4866df[_0x7658('0x4f')]['id']}})[_0x7658('0x23')](handleEntityNotFound(_0x95846b,null))[_0x7658('0x23')](function(_0x3ddbd1){if(_0x3ddbd1){return db[_0x7658('0x35')][_0x7658('0x22')](_[_0x7658('0x43')](_0x4866df[_0x7658('0x51')],[_0x7658('0x5a'),_0x7658('0x5b'),_0x7658('0x5c'),_0x7658('0x5d'),_0x7658('0x5e'),_0x7658('0x5f')]),{'where':{'context':_0x3ddbd1[_0x7658('0x5b')],'exten':_0x3ddbd1[_0x7658('0x5a')]},'individualHooks':!![]})['then'](function(_0x5aae3d){return _0x5aae3d;});}return null;})[_0x7658('0x23')](respondWithStatusCode(_0x95846b,null))[_0x7658('0x4d')](handleError(_0x95846b,null));};exports[_0x7658('0x60')]=function(_0x274c1a,_0x1a19af,_0x6a7515){return db['VoiceExtension'][_0x7658('0x61')]({'where':{'id':_0x274c1a['params']['id']}})[_0x7658('0x23')](handleEntityNotFound(_0x1a19af,null))[_0x7658('0x23')](function(_0x4f3554){if(_0x4f3554){return db[_0x7658('0x62')][_0x7658('0x63')](function(_0x471bdc){return db[_0x7658('0x35')]['destroy']({'where':{'VoiceExtensionId':_0x274c1a['params']['id']},'transaction':_0x471bdc})[_0x7658('0x23')](function(_0x2f0cc3){var _0x143b74=_[_0x7658('0x2b')](_0x274c1a['body'],function(_0x65fe9b){_0x65fe9b[_0x7658('0x64')]=_0x274c1a[_0x7658('0x4f')]['id'];return _0x65fe9b;});return db[_0x7658('0x35')][_0x7658('0x65')](_0x143b74,{'transaction':_0x471bdc});});})[_0x7658('0x23')](function(){return db[_0x7658('0x35')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x274c1a[_0x7658('0x4f')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x7658('0x23')](respondWithResult(_0x1a19af,null))[_0x7658('0x4d')](handleError(_0x1a19af,null));};
\ No newline at end of file
+var _0x76ad=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','InboundRoutes','OutboundRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','error','index','VoiceExtension','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','pick','key','VIRTUAL','field','merge','options','include','findAll','rows','show','params','catch','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x108196,_0x5692de){var _0x2a0865=function(_0x12bea1){while(--_0x12bea1){_0x108196['push'](_0x108196['shift']());}};_0x2a0865(++_0x5692de);}(_0x76ad,0x1eb));var _0xd76a=function(_0x2706db,_0x2c03f6){_0x2706db=_0x2706db-0x0;var _0x19939b=_0x76ad[_0x2706db];return _0x19939b;};'use strict';var pdf=require(_0xd76a('0x0'));var emlformat=require(_0xd76a('0x1'));var rimraf=require(_0xd76a('0x2'));var zipdir=require(_0xd76a('0x3'));var jsonpatch=require(_0xd76a('0x4'));var rp=require(_0xd76a('0x5'));var moment=require(_0xd76a('0x6'));var BPromise=require(_0xd76a('0x7'));var Mustache=require(_0xd76a('0x8'));var util=require('util');var path=require(_0xd76a('0x9'));var sox=require(_0xd76a('0xa'));var csv=require(_0xd76a('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd76a('0xc'));var jsforce=require(_0xd76a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd76a('0xe'));var Redis=require('ioredis');var authService=require(_0xd76a('0xf'));var qs=require(_0xd76a('0x10'));var hardwareService=require(_0xd76a('0x11'));var logger=require('../../config/logger')(_0xd76a('0x12'));var utils=require('../../config/utils');var config=require(_0xd76a('0x13'));var db=require(_0xd76a('0x14'))['db'];config[_0xd76a('0x15')]=_[_0xd76a('0x16')](config[_0xd76a('0x15')],{'host':_0xd76a('0x17'),'port':0x18eb});var socket=require(_0xd76a('0x18'))(new Redis(config[_0xd76a('0x15')]));require('./voiceExtension.socket')[_0xd76a('0x19')](socket);function respondWithStatusCode(_0x2f05ff,_0x57ed9d){_0x57ed9d=_0x57ed9d||0xcc;return function(_0x2ee983){if(_0x2ee983){return _0x2f05ff['sendStatus'](_0x57ed9d);}return _0x2f05ff[_0xd76a('0x1a')](_0x57ed9d)[_0xd76a('0x1b')]();};}function respondWithResult(_0xa9b8b,_0x2a6272){_0x2a6272=_0x2a6272||0xc8;return function(_0xd1f29f){if(_0xd1f29f){return _0xa9b8b[_0xd76a('0x1a')](_0x2a6272)[_0xd76a('0x1c')](_0xd1f29f);}};}function respondWithFilteredResult(_0x186d79,_0x21a6b9){return function(_0x737c32){if(_0x737c32){var _0x4f04ca=_0x737c32[_0xd76a('0x1d')],_0x5f0dd5=_0x21a6b9['offset'],_0x153a4b=_0x21a6b9['offset']+_0x21a6b9[_0xd76a('0x1e')],_0x2bc2af;if(_0x153a4b>=_0x4f04ca){_0x153a4b=_0x4f04ca;_0x2bc2af=0xc8;}else{_0x2bc2af=0xce;}_0x186d79[_0xd76a('0x1a')](_0x2bc2af);return _0x186d79['set'](_0xd76a('0x1f'),_0x5f0dd5+'-'+_0x153a4b+'/'+_0x4f04ca)[_0xd76a('0x1c')](_0x737c32);}return null;};}function patchUpdates(_0x3da338){return function(_0x1841e1){try{jsonpatch[_0xd76a('0x20')](_0x1841e1,_0x3da338,!![]);}catch(_0x5bb828){return BPromise[_0xd76a('0x21')](_0x5bb828);}return _0x1841e1[_0xd76a('0x22')]();};}function saveUpdates(_0x18afdf,_0x4851e4){return function(_0x4215e4){if(_0x4215e4){return _0x4215e4[_0xd76a('0x23')](_0x18afdf)[_0xd76a('0x24')](function(_0x2cc074){return _0x2cc074;});}return null;};}function removeEntity(_0x13f0e0,_0x3d0733){return function(_0x137554){if(_0x137554){return _0x137554[_0xd76a('0x25')]()[_0xd76a('0x24')](function(){var _0x2cd7ae=_0x137554[_0xd76a('0x26')]({'plain':!![]});var _0x1ca77e=[{'name':_0xd76a('0x27'),'value':'inbound','ignore':![]},{'name':_0xd76a('0x28'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0xd76a('0x29'),'ignore':![]}];var _0x1b7c88=_(_0x1ca77e)[_0xd76a('0x2a')]('ignore')[_0xd76a('0x2b')](_0xd76a('0x2c'))['value']();if(_[_0xd76a('0x2d')](_0x1b7c88,_0x2cd7ae[_0xd76a('0x2e')])){return;}var _0x2c544f=_[_0xd76a('0x2f')](_0x1ca77e,[_0xd76a('0x2c'),_0x2cd7ae[_0xd76a('0x2e')]])[_0xd76a('0x30')];return db[_0xd76a('0x31')]['destroy']({'where':{'type':_0x2c544f,'resourceId':_0x2cd7ae['id']}})[_0xd76a('0x24')](function(){return _0x137554;});})[_0xd76a('0x24')](function(){_0x13f0e0[_0xd76a('0x1a')](0xcc)[_0xd76a('0x1b')]();});}};}function handleEntityNotFound(_0x119095,_0xce83b3){return function(_0x2425df){if(!_0x2425df){_0x119095['sendStatus'](0x194);}return _0x2425df;};}function handleError(_0x16ed06,_0x4bf87d){_0x4bf87d=_0x4bf87d||0x1f4;return function(_0x20ecdc){logger[_0xd76a('0x32')](_0x20ecdc['stack']);if(_0x20ecdc[_0xd76a('0x30')]){delete _0x20ecdc[_0xd76a('0x30')];}_0x16ed06[_0xd76a('0x1a')](_0x4bf87d)['send'](_0x20ecdc);};}exports[_0xd76a('0x33')]=function(_0x1b2c3c,_0x120ca4){var _0x437d29={},_0x215c02={},_0x4c5aaf={'count':0x0,'rows':[]};var _0x13c9e7=db[_0xd76a('0x34')][_0xd76a('0x35')];_0x215c02[_0xd76a('0x36')]=_['keys'](_0x13c9e7);_0x215c02['query']=_[_0xd76a('0x37')](_0x1b2c3c[_0xd76a('0x38')]);_0x215c02[_0xd76a('0x39')]=_[_0xd76a('0x3a')](_0x215c02[_0xd76a('0x36')],_0x215c02[_0xd76a('0x38')]);_0x437d29['attributes']=_[_0xd76a('0x3a')](_0x215c02['model'],qs[_0xd76a('0x3b')](_0x1b2c3c[_0xd76a('0x38')]['fields']));_0x437d29[_0xd76a('0x3c')]=_0x437d29[_0xd76a('0x3c')][_0xd76a('0x3d')]?_0x437d29[_0xd76a('0x3c')]:_0x215c02[_0xd76a('0x36')];if(!_0x1b2c3c[_0xd76a('0x38')][_0xd76a('0x3e')]('nolimit')){_0x437d29[_0xd76a('0x1e')]=qs['limit'](_0x1b2c3c[_0xd76a('0x38')][_0xd76a('0x1e')]);_0x437d29[_0xd76a('0x3f')]=qs['offset'](_0x1b2c3c[_0xd76a('0x38')][_0xd76a('0x3f')]);}_0x437d29[_0xd76a('0x40')]=qs[_0xd76a('0x41')](_0x1b2c3c[_0xd76a('0x38')][_0xd76a('0x41')]);_0x437d29[_0xd76a('0x42')]=qs[_0xd76a('0x39')](_[_0xd76a('0x43')](_0x1b2c3c[_0xd76a('0x38')],_0x215c02[_0xd76a('0x39')]));if(_0x1b2c3c[_0xd76a('0x38')]['filter']){_0x437d29[_0xd76a('0x42')]=_['merge'](_0x437d29[_0xd76a('0x42')],{'$or':_[_0xd76a('0x2b')](_0x13c9e7,function(_0x24071e){if(_0x24071e[_0xd76a('0x2e')][_0xd76a('0x44')]!==_0xd76a('0x45')){var _0x1aab18={};_0x1aab18[_0x24071e[_0xd76a('0x46')]]={'$like':'%'+_0x1b2c3c[_0xd76a('0x38')][_0xd76a('0x2a')]+'%'};return _0x1aab18;}})});}_0x437d29=_[_0xd76a('0x47')]({},_0x437d29,_0x1b2c3c[_0xd76a('0x48')]);var _0x43c805={'where':_0x437d29[_0xd76a('0x42')]};return db[_0xd76a('0x34')]['count'](_0x43c805)[_0xd76a('0x24')](function(_0x45d239){_0x4c5aaf[_0xd76a('0x1d')]=_0x45d239;if(_0x1b2c3c['query']['includeAll']){_0x437d29[_0xd76a('0x49')]=[{'all':!![]}];}return db['VoiceExtension'][_0xd76a('0x4a')](_0x437d29);})[_0xd76a('0x24')](function(_0x4a93f3){_0x4c5aaf[_0xd76a('0x4b')]=_0x4a93f3;return _0x4c5aaf;})[_0xd76a('0x24')](respondWithFilteredResult(_0x120ca4,_0x437d29))['catch'](handleError(_0x120ca4,null));};exports[_0xd76a('0x4c')]=function(_0x30e179,_0x2d3e61){var _0x4f8d86={'raw':![],'where':{'id':_0x30e179[_0xd76a('0x4d')]['id']}},_0x11aad9={};_0x11aad9[_0xd76a('0x36')]=_['keys'](db[_0xd76a('0x34')][_0xd76a('0x35')]);_0x11aad9[_0xd76a('0x38')]=_[_0xd76a('0x37')](_0x30e179['query']);_0x11aad9[_0xd76a('0x39')]=_[_0xd76a('0x3a')](_0x11aad9[_0xd76a('0x36')],_0x11aad9[_0xd76a('0x38')]);_0x4f8d86[_0xd76a('0x3c')]=_['intersection'](_0x11aad9[_0xd76a('0x36')],qs[_0xd76a('0x3b')](_0x30e179['query']['fields']));_0x4f8d86[_0xd76a('0x3c')]=_0x4f8d86[_0xd76a('0x3c')][_0xd76a('0x3d')]?_0x4f8d86[_0xd76a('0x3c')]:_0x11aad9['model'];if(_0x30e179['query']['includeAll']){_0x4f8d86['include']=[{'all':!![]}];}_0x4f8d86=_[_0xd76a('0x47')]({},_0x4f8d86,_0x30e179[_0xd76a('0x48')]);return db[_0xd76a('0x34')][_0xd76a('0x2f')](_0x4f8d86)['then'](handleEntityNotFound(_0x2d3e61,null))[_0xd76a('0x24')](respondWithResult(_0x2d3e61,null))[_0xd76a('0x4e')](handleError(_0x2d3e61,null));};exports[_0xd76a('0x25')]=function(_0x9783ad,_0x2650e7){return db[_0xd76a('0x34')][_0xd76a('0x2f')]({'where':{'id':_0x9783ad[_0xd76a('0x4d')]['id']}})[_0xd76a('0x24')](handleEntityNotFound(_0x2650e7,null))[_0xd76a('0x24')](removeEntity(_0x2650e7,null))[_0xd76a('0x4e')](handleError(_0x2650e7,null));};exports[_0xd76a('0x4f')]=function(_0x165503,_0xaeb6da){if(_0x165503[_0xd76a('0x50')][_0xd76a('0x2e')]==='outbound'&&!_['startsWith'](_0x165503[_0xd76a('0x50')][_0xd76a('0x51')],'_')){_0x165503[_0xd76a('0x50')]['exten']='_'[_0xd76a('0x52')](_0x165503[_0xd76a('0x50')][_0xd76a('0x51')]);}return db[_0xd76a('0x34')][_0xd76a('0x4f')](_0x165503[_0xd76a('0x50')],{'raw':![]})[_0xd76a('0x24')](function(_0x93dcf6){var _0x140518=_0x165503[_0xd76a('0x53')][_0xd76a('0x26')]({'plain':!![]});if(!_0x140518)throw new Error(_0xd76a('0x54'));if(_0x140518[_0xd76a('0x55')]===_0xd76a('0x53')){var _0x2896ab=_0x93dcf6[_0xd76a('0x26')]({'plain':!![]});var _0x1e73eb=[{'name':'InboundRoutes','value':_0xd76a('0x56')},{'name':'OutboundRoutes','value':_0xd76a('0x57')},{'name':'InternalRoutes','value':_0xd76a('0x29')}];var _0x3a318f=_[_0xd76a('0x2f')](_0x1e73eb,[_0xd76a('0x2c'),_0x2896ab[_0xd76a('0x2e')]])['name'];return db[_0xd76a('0x58')]['find']({'where':{'name':_0x3a318f,'userProfileId':_0x140518[_0xd76a('0x59')]},'raw':!![]})['then'](function(_0x3b8ab7){if(_0x3b8ab7&&_0x3b8ab7[_0xd76a('0x5a')]===0x0){return db[_0xd76a('0x31')][_0xd76a('0x4f')]({'name':_0x2896ab[_0xd76a('0x30')],'resourceId':_0x2896ab['id'],'type':_0x3b8ab7[_0xd76a('0x30')],'sectionId':_0x3b8ab7['id']},{})[_0xd76a('0x24')](function(){return _0x93dcf6;});}else{return _0x93dcf6;}})[_0xd76a('0x4e')](function(_0x337f04){logger['error'](_0xd76a('0x5b'),_0x337f04);throw _0x337f04;});}return _0x93dcf6;})['then'](respondWithResult(_0xaeb6da,0xc9))[_0xd76a('0x4e')](handleError(_0xaeb6da,null));};exports[_0xd76a('0x23')]=function(_0x5cc8c1,_0x6fb5cf){if(_0x5cc8c1[_0xd76a('0x50')]['id']){delete _0x5cc8c1[_0xd76a('0x50')]['id'];}return db[_0xd76a('0x34')][_0xd76a('0x2f')]({'where':{'id':_0x5cc8c1[_0xd76a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x6fb5cf,null))[_0xd76a('0x24')](function(_0x17efd9){if(_0x17efd9){return db[_0xd76a('0x34')][_0xd76a('0x23')](_[_0xd76a('0x43')](_0x5cc8c1[_0xd76a('0x50')],['exten',_0xd76a('0x5c'),'description','recordingFormat',_0xd76a('0x5d'),_0xd76a('0x5e')]),{'where':{'context':_0x17efd9[_0xd76a('0x5c')],'exten':_0x17efd9['exten']},'individualHooks':!![]})[_0xd76a('0x24')](function(_0x1cc83a){return _0x1cc83a;});}return null;})[_0xd76a('0x24')](respondWithStatusCode(_0x6fb5cf,null))[_0xd76a('0x4e')](handleError(_0x6fb5cf,null));};exports[_0xd76a('0x5f')]=function(_0x118230,_0x598255,_0x439fca){return db['VoiceExtension'][_0xd76a('0x60')]({'where':{'id':_0x118230[_0xd76a('0x4d')]['id']}})[_0xd76a('0x24')](handleEntityNotFound(_0x598255,null))[_0xd76a('0x24')](function(_0x18ccd0){if(_0x18ccd0){return db[_0xd76a('0x61')]['transaction'](function(_0x35eb4b){return db[_0xd76a('0x34')]['destroy']({'where':{'VoiceExtensionId':_0x118230[_0xd76a('0x4d')]['id']},'transaction':_0x35eb4b})['then'](function(_0x5227e7){var _0x408af0=_[_0xd76a('0x2b')](_0x118230['body'],function(_0xa973b8){_0xa973b8[_0xd76a('0x62')]=_0x118230[_0xd76a('0x4d')]['id'];return _0xa973b8;});return db[_0xd76a('0x34')][_0xd76a('0x63')](_0x408af0,{'transaction':_0x35eb4b});});})[_0xd76a('0x24')](function(){return db[_0xd76a('0x34')][_0xd76a('0x64')]({'where':{'isApp':!![],'VoiceExtensionId':_0x118230['params']['id']},'order':_0xd76a('0x65')});});}})['then'](respondWithResult(_0x598255,null))[_0xd76a('0x4e')](handleError(_0x598255,null));};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js
index 6313bc8..01d3b6d 100644
--- a/server/api/voiceExtension/voiceExtension.events.js
+++ b/server/api/voiceExtension/voiceExtension.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x11c4=['remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x69f185,_0x1c72b6){var _0x1c6a87=function(_0x165b1b){while(--_0x165b1b){_0x69f185['push'](_0x69f185['shift']());}};_0x1c6a87(++_0x1c72b6);}(_0x11c4,0x129));var _0x411c=function(_0x2a5d4d,_0x4489da){_0x2a5d4d=_0x2a5d4d-0x0;var _0x3e1687=_0x11c4[_0x2a5d4d];return _0x3e1687;};'use strict';var EventEmitter=require(_0x411c('0x0'));var VoiceExtension=require(_0x411c('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x411c('0x2')](0x0);var events={'afterCreate':_0x411c('0x3'),'afterUpdate':'update','afterDestroy':_0x411c('0x4')};function emitEvent(_0x3796ec){return function(_0x299f23,_0x595127,_0x2a1c5b){VoiceExtensionEvents[_0x411c('0x5')](_0x3796ec+':'+_0x299f23['id'],_0x299f23);VoiceExtensionEvents[_0x411c('0x5')](_0x3796ec,_0x299f23);_0x2a1c5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x411c('0x6')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x83b7=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save'];(function(_0x44dea3,_0x57aff8){var _0x3224ea=function(_0x569f34){while(--_0x569f34){_0x44dea3['push'](_0x44dea3['shift']());}};_0x3224ea(++_0x57aff8);}(_0x83b7,0x100));var _0x783b=function(_0x479851,_0x49cfda){_0x479851=_0x479851-0x0;var _0x36cb2a=_0x83b7[_0x479851];return _0x36cb2a;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x783b('0x0'))['db'][_0x783b('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x783b('0x2')](0x0);var events={'afterCreate':_0x783b('0x3'),'afterUpdate':_0x783b('0x4'),'afterDestroy':_0x783b('0x5')};function emitEvent(_0x509338){return function(_0x20cc7c,_0x2e3025,_0x318d14){VoiceExtensionEvents[_0x783b('0x6')](_0x509338+':'+_0x20cc7c['id'],_0x20cc7c);VoiceExtensionEvents[_0x783b('0x6')](_0x509338,_0x20cc7c);_0x318d14(null);};}for(var e in events){if(events[_0x783b('0x7')](e)){var event=events[e];VoiceExtension[_0x783b('0x8')](e,emitEvent(event));}}module[_0x783b('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js
index 69914ac..afe29bd 100644
--- a/server/api/voiceExtension/voiceExtension.model.js
+++ b/server/api/voiceExtension/voiceExtension.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d3d=['api','request-promise','path','rimraf','exports','define','voice_extensions','lodash','util','../../config/logger'];(function(_0x3fce78,_0x17ab27){var _0x4035d1=function(_0x392bed){while(--_0x392bed){_0x3fce78['push'](_0x3fce78['shift']());}};_0x4035d1(++_0x17ab27);}(_0x0d3d,0x1ab));var _0xd0d3=function(_0x25485c,_0x2c375d){_0x25485c=_0x25485c-0x0;var _0x3d6270=_0x0d3d[_0x25485c];return _0x3d6270;};'use strict';var _=require(_0xd0d3('0x0'));var util=require(_0xd0d3('0x1'));var logger=require(_0xd0d3('0x2'))(_0xd0d3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd0d3('0x4'));var fs=require('fs');var path=require(_0xd0d3('0x5'));var rimraf=require(_0xd0d3('0x6'));var config=require('../../config/environment');var attributes=require('./voiceExtension.attributes');module[_0xd0d3('0x7')]=function(_0x34ab79,_0x30db12){return _0x34ab79[_0xd0d3('0x8')]('VoiceExtension',attributes,{'tableName':_0xd0d3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1009=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','voice_extensions'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1009,0x90));var _0x9100=function(_0x54b06f,_0x296c5e){_0x54b06f=_0x54b06f-0x0;var _0x4fd514=_0x1009[_0x54b06f];return _0x4fd514;};'use strict';var _=require(_0x9100('0x0'));var util=require('util');var logger=require(_0x9100('0x1'))(_0x9100('0x2'));var moment=require(_0x9100('0x3'));var BPromise=require(_0x9100('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9100('0x5'));var rimraf=require(_0x9100('0x6'));var config=require(_0x9100('0x7'));var attributes=require(_0x9100('0x8'));module[_0x9100('0x9')]=function(_0x4eb07a,_0x591ba1){return _0x4eb07a[_0x9100('0xa')]('VoiceExtension',attributes,{'tableName':_0x9100('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js
index edaaa86..16fd626 100644
--- a/server/api/voiceExtension/voiceExtension.rpc.js
+++ b/server/api/voiceExtension/voiceExtension.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4483=['message','request\x20sent','GetVoiceExtension','VoiceExtension','findAll','options','where','limit','map','include','model','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','register','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','VoiceExtension,\x20%s,\x20%s'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4483,0x1a3));var _0x3448=function(_0x2ed4ce,_0x281b1a){_0x2ed4ce=_0x2ed4ce-0x0;var _0xf09301=_0x4483[_0x2ed4ce];return _0xf09301;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});config[_0x3448('0xc')]=_[_0x3448('0xd')](config[_0x3448('0xc')],{'host':_0x3448('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3448('0xf'))[_0x3448('0x10')](socket);function respondWithRpcPromise(_0xc36409,_0x6f82ca,_0x3f4364){return new BPromise(function(_0x1e645a,_0x2bdf02){return client[_0x3448('0x11')](_0xc36409,_0x3f4364)[_0x3448('0x12')](function(_0x35bb7b){logger[_0x3448('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x6f82ca,'request\x20sent');logger[_0x3448('0x14')](_0x3448('0x15'),_0x6f82ca,'request\x20sent',JSON[_0x3448('0x16')](_0x35bb7b));if(_0x35bb7b[_0x3448('0x17')]){if(_0x35bb7b[_0x3448('0x17')]['code']===0x1f4){logger[_0x3448('0x17')](_0x3448('0x18'),_0x6f82ca,_0x35bb7b['error'][_0x3448('0x19')]);return _0x2bdf02(_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);}logger['error'](_0x3448('0x18'),_0x6f82ca,_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);return _0x1e645a(_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);}else{logger[_0x3448('0x13')](_0x3448('0x18'),_0x6f82ca,_0x3448('0x1a'));_0x1e645a(_0x35bb7b['result'][_0x3448('0x19')]);}})['catch'](function(_0x48f94a){logger['error'](_0x3448('0x18'),_0x6f82ca,_0x48f94a);_0x2bdf02(_0x48f94a);});});}exports[_0x3448('0x1b')]=function(_0xda4040){var _0x5b5e26=this;return new Promise(function(_0x3df082,_0x392c8d){return db[_0x3448('0x1c')][_0x3448('0x1d')]({'raw':_0xda4040[_0x3448('0x1e')]?_0xda4040[_0x3448('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xda4040['options']?_0xda4040['options'][_0x3448('0x1f')]||null:null,'attributes':_0xda4040[_0x3448('0x1e')]?_0xda4040['options']['attributes']||null:null,'limit':_0xda4040[_0x3448('0x1e')]?_0xda4040[_0x3448('0x1e')][_0x3448('0x20')]||null:null,'include':_0xda4040[_0x3448('0x1e')]?_0xda4040[_0x3448('0x1e')]['include']?_[_0x3448('0x21')](_0xda4040[_0x3448('0x1e')][_0x3448('0x22')],function(_0x2088de){return{'model':db[_0x2088de[_0x3448('0x23')]],'as':_0x2088de['as'],'attributes':_0x2088de['attributes'],'include':_0x2088de[_0x3448('0x22')]?_[_0x3448('0x21')](_0x2088de['include'],function(_0x19a479){return{'model':db[_0x19a479[_0x3448('0x23')]],'as':_0x19a479['as'],'attributes':_0x19a479[_0x3448('0x24')],'include':_0x19a479[_0x3448('0x22')]?_[_0x3448('0x21')](_0x19a479[_0x3448('0x22')],function(_0x31be64){return{'model':db[_0x31be64[_0x3448('0x23')]],'as':_0x31be64['as'],'attributes':_0x31be64['attributes']};}):[]};}):[]};}):[]:[]})[_0x3448('0x12')](function(_0x450704){logger[_0x3448('0x13')]('GetVoiceExtension',_0xda4040);logger[_0x3448('0x14')]('GetVoiceExtension',_0xda4040,JSON['stringify'](_0x450704));_0x3df082(_0x450704);})['catch'](function(_0x52fb48){logger[_0x3448('0x17')]('GetVoiceExtension',_0x52fb48['message'],_0xda4040);_0x392c8d(_0x5b5e26[_0x3448('0x17')](0x1f4,_0x52fb48[_0x3448('0x19')]));});});};
\ No newline at end of file
+var _0x0713=['raw','where','limit','include','map','attributes','model','debug','GetVoiceExtension','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','error','message','result','catch','VoiceExtension','options'];(function(_0x588c4a,_0x54033b){var _0x19018d=function(_0x2652b1){while(--_0x2652b1){_0x588c4a['push'](_0x588c4a['shift']());}};_0x19018d(++_0x54033b);}(_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});config[_0x3071('0xb')]=_[_0x3071('0xc')](config[_0x3071('0xb')],{'host':_0x3071('0xd'),'port':0x18eb});var socket=require(_0x3071('0xe'))(new Redis(config[_0x3071('0xb')]));require(_0x3071('0xf'))['register'](socket);function respondWithRpcPromise(_0x3457cd,_0x2610b4,_0x937259){return new BPromise(function(_0xff9a29,_0x1ce844){return client['request'](_0x3457cd,_0x937259)[_0x3071('0x10')](function(_0x11a7ee){logger[_0x3071('0x11')](_0x3071('0x12'),_0x2610b4,_0x3071('0x13'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x2610b4,_0x3071('0x13'),JSON['stringify'](_0x11a7ee));if(_0x11a7ee[_0x3071('0x14')]){if(_0x11a7ee[_0x3071('0x14')]['code']===0x1f4){logger[_0x3071('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x2610b4,_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);return _0x1ce844(_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);}logger[_0x3071('0x14')](_0x3071('0x12'),_0x2610b4,_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);return _0xff9a29(_0x11a7ee[_0x3071('0x14')][_0x3071('0x15')]);}else{logger['info'](_0x3071('0x12'),_0x2610b4,_0x3071('0x13'));_0xff9a29(_0x11a7ee[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x17aee2){logger[_0x3071('0x14')](_0x3071('0x12'),_0x2610b4,_0x17aee2);_0x1ce844(_0x17aee2);});});}exports['GetVoiceExtension']=function(_0x359e66){var _0x2bfa33=this;return new Promise(function(_0xd3e23d,_0x56c267){return db[_0x3071('0x18')]['findAll']({'raw':_0x359e66[_0x3071('0x19')]?_0x359e66[_0x3071('0x19')][_0x3071('0x1a')]===undefined?!![]:![]:!![],'where':_0x359e66[_0x3071('0x19')]?_0x359e66[_0x3071('0x19')][_0x3071('0x1b')]||null:null,'attributes':_0x359e66[_0x3071('0x19')]?_0x359e66[_0x3071('0x19')]['attributes']||null:null,'limit':_0x359e66['options']?_0x359e66[_0x3071('0x19')][_0x3071('0x1c')]||null:null,'include':_0x359e66[_0x3071('0x19')]?_0x359e66[_0x3071('0x19')][_0x3071('0x1d')]?_[_0x3071('0x1e')](_0x359e66[_0x3071('0x19')][_0x3071('0x1d')],function(_0x1de5fb){return{'model':db[_0x1de5fb['model']],'as':_0x1de5fb['as'],'attributes':_0x1de5fb[_0x3071('0x1f')],'include':_0x1de5fb[_0x3071('0x1d')]?_[_0x3071('0x1e')](_0x1de5fb['include'],function(_0x4fb1ca){return{'model':db[_0x4fb1ca[_0x3071('0x20')]],'as':_0x4fb1ca['as'],'attributes':_0x4fb1ca[_0x3071('0x1f')],'include':_0x4fb1ca[_0x3071('0x1d')]?_[_0x3071('0x1e')](_0x4fb1ca[_0x3071('0x1d')],function(_0x177b5f){return{'model':db[_0x177b5f[_0x3071('0x20')]],'as':_0x177b5f['as'],'attributes':_0x177b5f[_0x3071('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3071('0x10')](function(_0x254fc8){logger['info']('GetVoiceExtension',_0x359e66);logger[_0x3071('0x21')](_0x3071('0x22'),_0x359e66,JSON[_0x3071('0x23')](_0x254fc8));_0xd3e23d(_0x254fc8);})[_0x3071('0x17')](function(_0x3f6d90){logger[_0x3071('0x14')](_0x3071('0x22'),_0x3f6d90[_0x3071('0x15')],_0x359e66);_0x56c267(_0x2bfa33['error'](0x1f4,_0x3f6d90['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js
index ff88d75..7c1d5d7 100644
--- a/server/api/voiceExtension/voiceExtension.socket.js
+++ b/server/api/voiceExtension/voiceExtension.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf1c=['removeListener','register','voiceExtension:','save','remove','update','emit'];(function(_0x592efc,_0x275170){var _0x416bb7=function(_0x3b071a){while(--_0x3b071a){_0x592efc['push'](_0x592efc['shift']());}};_0x416bb7(++_0x275170);}(_0xaf1c,0x168));var _0xcaf1=function(_0xea0069,_0x750a62){_0xea0069=_0xea0069-0x0;var _0x4def95=_0xaf1c[_0xea0069];return _0x4def95;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0xcaf1('0x0'),_0xcaf1('0x1'),_0xcaf1('0x2')];function createListener(_0x45bc31,_0x4e62d3){return function(_0x46a63b){_0x4e62d3[_0xcaf1('0x3')](_0x45bc31,_0x46a63b);};}function removeListener(_0x1a9dd0,_0x209b3f){return function(){VoiceExtensionEvents[_0xcaf1('0x4')](_0x1a9dd0,_0x209b3f);};}exports[_0xcaf1('0x5')]=function(_0x134b75){for(var _0x599f9e=0x0,_0x26d550=events['length'];_0x599f9e<_0x26d550;_0x599f9e++){var _0x4291e5=events[_0x599f9e];var _0x439f2a=createListener(_0xcaf1('0x6')+_0x4291e5,_0x134b75);VoiceExtensionEvents['on'](_0x4291e5,_0x439f2a);}};
\ No newline at end of file
+var _0x41ca=['register','voiceExtension:','./voiceExtension.events','emit'];(function(_0x5ab238,_0x4ddda9){var _0x236db6=function(_0x5f1f3f){while(--_0x5f1f3f){_0x5ab238['push'](_0x5ab238['shift']());}};_0x236db6(++_0x4ddda9);}(_0x41ca,0xe2));var _0xa41c=function(_0x42fac3,_0x1f59de){_0x42fac3=_0x42fac3-0x0;var _0x3908e0=_0x41ca[_0x42fac3];return _0x3908e0;};'use strict';var VoiceExtensionEvents=require(_0xa41c('0x0'));var events=['save','remove','update'];function createListener(_0x29b258,_0x3960d6){return function(_0x5c661a){_0x3960d6[_0xa41c('0x1')](_0x29b258,_0x5c661a);};}function removeListener(_0x53d0c5,_0x575e3f){return function(){VoiceExtensionEvents['removeListener'](_0x53d0c5,_0x575e3f);};}exports[_0xa41c('0x2')]=function(_0x481713){for(var _0x545fe8=0x0,_0x17e880=events['length'];_0x545fe8<_0x17e880;_0x545fe8++){var _0x182f38=events[_0x545fe8];var _0x1fa70b=createListener(_0xa41c('0x3')+_0x182f38,_0x481713);VoiceExtensionEvents['on'](_0x182f38,_0x1fa70b);}};
\ No newline at end of file
diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js
index 80f6522..7ff930f 100644
--- a/server/api/voiceMail/index.js
+++ b/server/api/voiceMail/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e1c=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','isAuthenticated','show','getMessages','post','put','/:id','destroy','exports','multer'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x4e1c,0x71));var _0xc4e1=function(_0x7c8431,_0x3837d3){_0x7c8431=_0x7c8431-0x0;var _0x2e27eb=_0x4e1c[_0x7c8431];return _0x2e27eb;};'use strict';var multer=require(_0xc4e1('0x0'));var util=require(_0xc4e1('0x1'));var path=require(_0xc4e1('0x2'));var timeout=require('connect-timeout');var express=require(_0xc4e1('0x3'));var router=express[_0xc4e1('0x4')]();var auth=require(_0xc4e1('0x5'));var interaction=require(_0xc4e1('0x6'));var config=require(_0xc4e1('0x7'));var controller=require(_0xc4e1('0x8'));router[_0xc4e1('0x9')]('/',auth['isAuthenticated'](),controller[_0xc4e1('0xa')]);router[_0xc4e1('0x9')]('/:id',auth[_0xc4e1('0xb')](),controller[_0xc4e1('0xc')]);router[_0xc4e1('0x9')]('/:id/messages',auth[_0xc4e1('0xb')](),controller[_0xc4e1('0xd')]);router[_0xc4e1('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc4e1('0xf')](_0xc4e1('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc4e1('0x10'),auth[_0xc4e1('0xb')](),controller[_0xc4e1('0x11')]);module[_0xc4e1('0x12')]=router;
\ No newline at end of file
+var _0xb459=['delete','/:id','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','getMessages','post','create','put'];(function(_0x2eff28,_0x4645cf){var _0xaedea8=function(_0x1a147f){while(--_0x1a147f){_0x2eff28['push'](_0x2eff28['shift']());}};_0xaedea8(++_0x4645cf);}(_0xb459,0x11b));var _0x9b45=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0xb459[_0x48b5e0];return _0x4287ea;};'use strict';var multer=require('multer');var util=require(_0x9b45('0x0'));var path=require('path');var timeout=require(_0x9b45('0x1'));var express=require(_0x9b45('0x2'));var router=express[_0x9b45('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x9b45('0x4'));var config=require(_0x9b45('0x5'));var controller=require('./voiceMail.controller');router['get']('/',auth[_0x9b45('0x6')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth[_0x9b45('0x6')](),controller[_0x9b45('0x7')]);router[_0x9b45('0x8')]('/',auth[_0x9b45('0x6')](),controller[_0x9b45('0x9')]);router[_0x9b45('0xa')]('/:id',auth[_0x9b45('0x6')](),controller['update']);router[_0x9b45('0xb')](_0x9b45('0xc'),auth[_0x9b45('0x6')](),controller['destroy']);module[_0x9b45('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js
index 76c366f..9ab8c85 100644
--- a/server/api/voiceMail/voiceMail.attributes.js
+++ b/server/api/voiceMail/voiceMail.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc99e=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','trim','ENUM','yes'];(function(_0x235712,_0x403217){var _0x47e607=function(_0x5e8254){while(--_0x5e8254){_0x235712['push'](_0x235712['shift']());}};_0x47e607(++_0x403217);}(_0xc99e,0x7f));var _0xec99=function(_0x132c1b,_0x5739d1){_0x132c1b=_0x132c1b-0x0;var _0x559dc9=_0xc99e[_0x132c1b];return _0x559dc9;};'use strict';var Sequelize=require(_0xec99('0x0'));module[_0xec99('0x1')]={'customer_id':{'type':Sequelize[_0xec99('0x2')]},'context':{'type':Sequelize[_0xec99('0x2')],'defaultValue':'from-voicemail','unique':_0xec99('0x3')},'mailbox':{'type':Sequelize[_0xec99('0x2')],'defaultValue':'','allowNull':![],'unique':_0xec99('0x3')},'password':{'type':Sequelize[_0xec99('0x2')]},'fullname':{'type':Sequelize[_0xec99('0x2')]},'email':{'type':Sequelize[_0xec99('0x2')],'validate':{'isEmail':!![]},'set':function(_0x560545){this[_0xec99('0x4')]('email',typeof _0x560545==='string'&&_0x560545['trim']()?_0x560545[_0xec99('0x5')]():null);}},'pager':{'type':Sequelize[_0xec99('0x2')]},'tz':{'type':Sequelize[_0xec99('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xec99('0x6')]('yes','no'),'defaultValue':_0xec99('0x7'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xec99('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xec99('0x2')]},'callback':{'type':Sequelize[_0xec99('0x2')]},'review':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xec99('0x6')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xec99('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xec99('0x6')]('yes','no'),'defaultValue':_0xec99('0x7'),'allowNull':![]},'stamp':{'type':_0xec99('0x8')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xec99('0x2')]},'maxsecs':{'type':Sequelize[_0xec99('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xec99('0xa')],'get':function(){return this[_0xec99('0xb')](_0xec99('0xc'))+_0xec99('0xd')+this[_0xec99('0xb')](_0xec99('0xe'));}}};
\ No newline at end of file
+var _0x07a5=['VIRTUAL','\x20-\x20','getDataValue','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x354c32,_0x227ecf){var _0x15589b=function(_0x51e716){while(--_0x51e716){_0x354c32['push'](_0x354c32['shift']());}};_0x15589b(++_0x227ecf);}(_0x07a5,0x159));var _0x507a=function(_0x245e2d,_0x1515a6){_0x245e2d=_0x245e2d-0x0;var _0x2d1b6f=_0x07a5[_0x245e2d];return _0x2d1b6f;};'use strict';var Sequelize=require(_0x507a('0x0'));module[_0x507a('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x507a('0x2')],'defaultValue':_0x507a('0x3'),'unique':_0x507a('0x4')},'mailbox':{'type':Sequelize[_0x507a('0x2')],'defaultValue':'','allowNull':![],'unique':_0x507a('0x4')},'password':{'type':Sequelize[_0x507a('0x2')]},'fullname':{'type':Sequelize[_0x507a('0x2')]},'email':{'type':Sequelize[_0x507a('0x2')],'validate':{'isEmail':!![]},'set':function(_0x15ed3d){this[_0x507a('0x5')](_0x507a('0x6'),typeof _0x15ed3d===_0x507a('0x7')&&_0x15ed3d[_0x507a('0x8')]()?_0x15ed3d['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x507a('0x2')],'defaultValue':_0x507a('0x9')},'attach':{'type':Sequelize[_0x507a('0xa')](_0x507a('0xb'),'no'),'defaultValue':_0x507a('0xb'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x507a('0xb'),'no'),'defaultValue':_0x507a('0xb'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x507a('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x507a('0xa')](_0x507a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x507a('0xa')](_0x507a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x507a('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x507a('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x507a('0xa')](_0x507a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x507a('0xa')](_0x507a('0xb'),'no'),'defaultValue':_0x507a('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x507a('0xa')](_0x507a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x507a('0xa')](_0x507a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x507a('0xa')](_0x507a('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x507a('0xd')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x507a('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x507a('0xf')],'get':function(){return this['getDataValue']('fullname')+_0x507a('0x10')+this[_0x507a('0x11')]('mailbox');}}};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js
index b23dc76..df82e34 100644
--- a/server/api/voiceMail/voiceMail.controller.js
+++ b/server/api/voiceMail/voiceMail.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x368f=['findOne','VoiceMailMessage','pick','map','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','Voicemails','UserProfileResource','then','sendStatus','error','stack','name','send','index','VoiceMail','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0x368f,0xbe));var _0xf368=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x368f[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xf368('0x0'));var emlformat=require(_0xf368('0x1'));var rimraf=require(_0xf368('0x2'));var zipdir=require(_0xf368('0x3'));var jsonpatch=require(_0xf368('0x4'));var rp=require(_0xf368('0x5'));var moment=require(_0xf368('0x6'));var BPromise=require(_0xf368('0x7'));var Mustache=require(_0xf368('0x8'));var util=require(_0xf368('0x9'));var path=require(_0xf368('0xa'));var sox=require(_0xf368('0xb'));var csv=require(_0xf368('0xc'));var ejs=require(_0xf368('0xd'));var fs=require('fs');var _=require(_0xf368('0xe'));var squel=require(_0xf368('0xf'));var crypto=require(_0xf368('0x10'));var jsforce=require(_0xf368('0x11'));var deskjs=require(_0xf368('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf368('0x13'));var authService=require(_0xf368('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf368('0x15'))('api');var utils=require(_0xf368('0x16'));var config=require(_0xf368('0x17'));var db=require(_0xf368('0x18'))['db'];function respondWithStatusCode(_0xa32c91,_0x3ab876){_0x3ab876=_0x3ab876||0xcc;return function(_0x2ccb9c){if(_0x2ccb9c){return _0xa32c91['sendStatus'](_0x3ab876);}return _0xa32c91[_0xf368('0x19')](_0x3ab876)[_0xf368('0x1a')]();};}function respondWithResult(_0x364498,_0x187b83){_0x187b83=_0x187b83||0xc8;return function(_0x3e6509){if(_0x3e6509){return _0x364498['status'](_0x187b83)[_0xf368('0x1b')](_0x3e6509);}};}function respondWithFilteredResult(_0x18d7af,_0x22c0aa){return function(_0x2c7fe1){if(_0x2c7fe1){var _0x36e3c0=_0x2c7fe1[_0xf368('0x1c')],_0x1781cb=_0x22c0aa[_0xf368('0x1d')],_0x3352b1=_0x22c0aa[_0xf368('0x1d')]+_0x22c0aa[_0xf368('0x1e')],_0x1fa78e;if(_0x3352b1>=_0x36e3c0){_0x3352b1=_0x36e3c0;_0x1fa78e=0xc8;}else{_0x1fa78e=0xce;}_0x18d7af['status'](_0x1fa78e);return _0x18d7af[_0xf368('0x1f')](_0xf368('0x20'),_0x1781cb+'-'+_0x3352b1+'/'+_0x36e3c0)[_0xf368('0x1b')](_0x2c7fe1);}return null;};}function patchUpdates(_0x4b96e7){return function(_0x5059f2){try{jsonpatch['apply'](_0x5059f2,_0x4b96e7,!![]);}catch(_0x41c9a1){return BPromise[_0xf368('0x21')](_0x41c9a1);}return _0x5059f2[_0xf368('0x22')]();};}function saveUpdates(_0x59cf3d,_0x4513cf){return function(_0x3da262){if(_0x3da262){return _0x3da262[_0xf368('0x23')](_0x59cf3d)['then'](function(_0x528a60){return _0x528a60;});}return null;};}function removeEntity(_0x1781b0,_0x596cae){return function(_0x186202){if(_0x186202){return _0x186202[_0xf368('0x24')]()['then'](function(){var _0x5e7142=_0x186202[_0xf368('0x25')]({'plain':!![]});var _0x124102=_0xf368('0x26');return db[_0xf368('0x27')]['destroy']({'where':{'type':_0x124102,'resourceId':_0x5e7142['id']}})['then'](function(){return _0x186202;});})[_0xf368('0x28')](function(){_0x1781b0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed9687,_0x165949){return function(_0x2b9fb2){if(!_0x2b9fb2){_0xed9687[_0xf368('0x29')](0x194);}return _0x2b9fb2;};}function handleError(_0x1c9443,_0x33a98b){_0x33a98b=_0x33a98b||0x1f4;return function(_0x428a7c){logger[_0xf368('0x2a')](_0x428a7c[_0xf368('0x2b')]);if(_0x428a7c[_0xf368('0x2c')]){delete _0x428a7c[_0xf368('0x2c')];}_0x1c9443[_0xf368('0x19')](_0x33a98b)[_0xf368('0x2d')](_0x428a7c);};}exports[_0xf368('0x2e')]=function(_0x4e183e,_0x2fb7d5){var _0x3eea23={},_0x42549b={},_0x4277a6={'count':0x0,'rows':[]};var _0x54c8c5=db[_0xf368('0x2f')][_0xf368('0x30')];_0x42549b[_0xf368('0x31')]=_['keys'](_0x54c8c5);_0x42549b['query']=_[_0xf368('0x32')](_0x4e183e[_0xf368('0x33')]);_0x42549b[_0xf368('0x34')]=_['intersection'](_0x42549b['model'],_0x42549b['query']);_0x3eea23[_0xf368('0x35')]=_[_0xf368('0x36')](_0x42549b['model'],qs[_0xf368('0x37')](_0x4e183e[_0xf368('0x33')][_0xf368('0x37')]));_0x3eea23['attributes']=_0x3eea23['attributes'][_0xf368('0x38')]?_0x3eea23[_0xf368('0x35')]:_0x42549b[_0xf368('0x31')];if(!_0x4e183e[_0xf368('0x33')][_0xf368('0x39')](_0xf368('0x3a'))){_0x3eea23[_0xf368('0x1e')]=qs[_0xf368('0x1e')](_0x4e183e['query'][_0xf368('0x1e')]);_0x3eea23['offset']=qs['offset'](_0x4e183e['query']['offset']);}_0x3eea23[_0xf368('0x3b')]=qs[_0xf368('0x3c')](_0x4e183e[_0xf368('0x33')][_0xf368('0x3c')]);_0x3eea23[_0xf368('0x3d')]=qs[_0xf368('0x34')](_['pick'](_0x4e183e[_0xf368('0x33')],_0x42549b[_0xf368('0x34')]));if(_0x4e183e['query'][_0xf368('0x3e')]){_0x3eea23[_0xf368('0x3d')]=_[_0xf368('0x3f')](_0x3eea23[_0xf368('0x3d')],{'$or':_['map'](_0x54c8c5,function(_0x51be7a){if(_0x51be7a[_0xf368('0x40')][_0xf368('0x41')]!==_0xf368('0x42')){var _0x39d974={};_0x39d974[_0x51be7a[_0xf368('0x43')]]={'$like':'%'+_0x4e183e[_0xf368('0x33')][_0xf368('0x3e')]+'%'};return _0x39d974;}})});}_0x3eea23=_[_0xf368('0x3f')]({},_0x3eea23,_0x4e183e[_0xf368('0x44')]);var _0x27269b={'where':_0x3eea23[_0xf368('0x3d')]};return db[_0xf368('0x2f')]['count'](_0x27269b)[_0xf368('0x28')](function(_0x1f66bf){_0x4277a6[_0xf368('0x1c')]=_0x1f66bf;if(_0x4e183e[_0xf368('0x33')][_0xf368('0x45')]){_0x3eea23[_0xf368('0x46')]=[{'all':!![]}];}return db[_0xf368('0x2f')][_0xf368('0x47')](_0x3eea23);})['then'](function(_0x340803){_0x4277a6[_0xf368('0x48')]=_0x340803;return _0x4277a6;})[_0xf368('0x28')](respondWithFilteredResult(_0x2fb7d5,_0x3eea23))['catch'](handleError(_0x2fb7d5,null));};exports[_0xf368('0x49')]=function(_0x595914,_0x22e75f){var _0x3fa371={'raw':!![],'where':{'id':_0x595914[_0xf368('0x4a')]['id']}},_0x1f43d0={};_0x1f43d0[_0xf368('0x31')]=_[_0xf368('0x32')](db['VoiceMail'][_0xf368('0x30')]);_0x1f43d0[_0xf368('0x33')]=_['keys'](_0x595914[_0xf368('0x33')]);_0x1f43d0[_0xf368('0x34')]=_[_0xf368('0x36')](_0x1f43d0[_0xf368('0x31')],_0x1f43d0[_0xf368('0x33')]);_0x3fa371[_0xf368('0x35')]=_[_0xf368('0x36')](_0x1f43d0[_0xf368('0x31')],qs[_0xf368('0x37')](_0x595914[_0xf368('0x33')][_0xf368('0x37')]));_0x3fa371['attributes']=_0x3fa371[_0xf368('0x35')][_0xf368('0x38')]?_0x3fa371[_0xf368('0x35')]:_0x1f43d0['model'];if(_0x595914[_0xf368('0x33')][_0xf368('0x45')]){_0x3fa371[_0xf368('0x46')]=[{'all':!![]}];}_0x3fa371=_[_0xf368('0x3f')]({},_0x3fa371,_0x595914[_0xf368('0x44')]);return db['VoiceMail'][_0xf368('0x4b')](_0x3fa371)[_0xf368('0x28')](handleEntityNotFound(_0x22e75f,null))['then'](respondWithResult(_0x22e75f,null))[_0xf368('0x4c')](handleError(_0x22e75f,null));};exports[_0xf368('0x4d')]=function(_0x26b979,_0x4aaf3d){return db[_0xf368('0x2f')][_0xf368('0x4d')](_0x26b979[_0xf368('0x4e')],{})[_0xf368('0x28')](function(_0x36a064){var _0x5db82f=_0x26b979['user'][_0xf368('0x25')]({'plain':!![]});if(!_0x5db82f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5db82f[_0xf368('0x4f')]===_0xf368('0x50')){var _0x3f0e05=_0x36a064[_0xf368('0x25')]({'plain':!![]});var _0x4ce38e=_0xf368('0x26');return db[_0xf368('0x51')][_0xf368('0x4b')]({'where':{'name':_0x4ce38e,'userProfileId':_0x5db82f[_0xf368('0x52')]},'raw':!![]})['then'](function(_0x10462b){if(_0x10462b&&_0x10462b[_0xf368('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x3f0e05[_0xf368('0x2c')],'resourceId':_0x3f0e05['id'],'type':_0x10462b['name'],'sectionId':_0x10462b['id']},{})['then'](function(){return _0x36a064;});}else{return _0x36a064;}})[_0xf368('0x4c')](function(_0x41395a){logger[_0xf368('0x2a')](_0xf368('0x54'),_0x41395a);throw _0x41395a;});}return _0x36a064;})[_0xf368('0x28')](respondWithResult(_0x4aaf3d,0xc9))[_0xf368('0x4c')](handleError(_0x4aaf3d,null));};exports[_0xf368('0x23')]=function(_0x9bc90,_0x1003ae){if(_0x9bc90['body']['id']){delete _0x9bc90[_0xf368('0x4e')]['id'];}return db[_0xf368('0x2f')][_0xf368('0x4b')]({'where':{'id':_0x9bc90[_0xf368('0x4a')]['id']}})[_0xf368('0x28')](handleEntityNotFound(_0x1003ae,null))['then'](saveUpdates(_0x9bc90[_0xf368('0x4e')],null))[_0xf368('0x28')](respondWithResult(_0x1003ae,null))[_0xf368('0x4c')](handleError(_0x1003ae,null));};exports[_0xf368('0x24')]=function(_0x5c9eac,_0x3118de){return db[_0xf368('0x2f')]['find']({'where':{'id':_0x5c9eac[_0xf368('0x4a')]['id']}})[_0xf368('0x28')](handleEntityNotFound(_0x3118de,null))[_0xf368('0x28')](removeEntity(_0x3118de,null))['catch'](handleError(_0x3118de,null));};exports[_0xf368('0x55')]=function(_0x2f50d6,_0x41b6ce,_0x7a9290){return db['VoiceMail'][_0xf368('0x56')]({'where':{'id':_0x2f50d6[_0xf368('0x4a')]['id']}})[_0xf368('0x28')](handleEntityNotFound(_0x41b6ce,null))[_0xf368('0x28')](function(_0x764e69){var _0x3cc5e7;var _0x68af10={},_0x583b33={};_0x583b33[_0xf368('0x31')]=_[_0xf368('0x32')](db[_0xf368('0x57')][_0xf368('0x30')]);_0x583b33[_0xf368('0x33')]=_[_0xf368('0x32')](_0x2f50d6['query']);_0x583b33[_0xf368('0x34')]=_['intersection'](_0x583b33[_0xf368('0x31')],_0x583b33[_0xf368('0x33')]);_0x68af10[_0xf368('0x35')]=_[_0xf368('0x36')](_0x583b33[_0xf368('0x31')],qs['fields'](_0x2f50d6[_0xf368('0x33')][_0xf368('0x37')]));_0x68af10[_0xf368('0x35')]=_0x68af10[_0xf368('0x35')][_0xf368('0x38')]?_0x68af10[_0xf368('0x35')]:_0x583b33['model'];if(!_0x2f50d6[_0xf368('0x33')][_0xf368('0x39')](_0xf368('0x3a'))){_0x68af10[_0xf368('0x1e')]=qs[_0xf368('0x1e')](_0x2f50d6['query']['limit']);_0x68af10[_0xf368('0x1d')]=qs[_0xf368('0x1d')](_0x2f50d6['query'][_0xf368('0x1d')]);}_0x68af10[_0xf368('0x3b')]=qs[_0xf368('0x3c')](_0x2f50d6['query']['sort']);_0x68af10[_0xf368('0x3d')]=qs['filters'](_[_0xf368('0x58')](_0x2f50d6[_0xf368('0x33')],_0x583b33[_0xf368('0x34')]));if(_0x2f50d6['query'][_0xf368('0x3e')]){_0x68af10[_0xf368('0x3d')]=_[_0xf368('0x3f')](_0x68af10[_0xf368('0x3d')],{'$or':_[_0xf368('0x59')](_0x68af10['attributes'],function(_0x420de7){var _0x5585c1={};_0x5585c1[_0x420de7]={'$like':'%'+_0x2f50d6[_0xf368('0x33')][_0xf368('0x3e')]+'%'};return _0x5585c1;})});}_0x68af10[_0xf368('0x3d')]=_[_0xf368('0x3f')](_0x68af10[_0xf368('0x3d')],{'mailboxuser':_0x764e69[_0xf368('0x5a')]});_0x68af10=_[_0xf368('0x3f')]({},_0x68af10,_0x2f50d6['options']);return db['VoiceMailMessage'][_0xf368('0x5b')](_0x68af10)['then'](respondWithFilteredResult(_0x41b6ce,_0x68af10));})['catch'](handleError(_0x41b6ce,null));};
\ No newline at end of file
+var _0xbf3c=['count','offset','limit','set','Content-Range','apply','save','update','destroy','then','Voicemails','UserProfileResource','sendStatus','error','stack','name','index','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','map','type','VIRTUAL','field','options','VoiceMail','includeAll','include','rows','show','params','rawAttributes','find','catch','body','user','get','role','UserProfileSection','autoAssociation','create','findOne','VoiceMailMessage','order','filter','mailbox','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','status','end','json'];(function(_0x12877b,_0x8650cf){var _0x3549ff=function(_0x4f96b7){while(--_0x4f96b7){_0x12877b['push'](_0x12877b['shift']());}};_0x3549ff(++_0x8650cf);}(_0xbf3c,0x1ce));var _0xcbf3=function(_0x4277ad,_0x1c62fa){_0x4277ad=_0x4277ad-0x0;var _0x7fc3f3=_0xbf3c[_0x4277ad];return _0x7fc3f3;};'use strict';var pdf=require(_0xcbf3('0x0'));var emlformat=require(_0xcbf3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcbf3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbf3('0x3'));var moment=require(_0xcbf3('0x4'));var BPromise=require(_0xcbf3('0x5'));var Mustache=require(_0xcbf3('0x6'));var util=require(_0xcbf3('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcbf3('0x8'));var fs=require('fs');var _=require(_0xcbf3('0x9'));var squel=require(_0xcbf3('0xa'));var crypto=require(_0xcbf3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcbf3('0xc'));var toCsv=require(_0xcbf3('0xd'));var querystring=require(_0xcbf3('0xe'));var Papa=require('papaparse');var Redis=require(_0xcbf3('0xf'));var authService=require(_0xcbf3('0x10'));var qs=require(_0xcbf3('0x11'));var hardwareService=require(_0xcbf3('0x12'));var logger=require('../../config/logger')(_0xcbf3('0x13'));var utils=require('../../config/utils');var config=require(_0xcbf3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1222e,_0x3a3fe0){_0x3a3fe0=_0x3a3fe0||0xcc;return function(_0x1a7d7d){if(_0x1a7d7d){return _0x1222e['sendStatus'](_0x3a3fe0);}return _0x1222e[_0xcbf3('0x15')](_0x3a3fe0)[_0xcbf3('0x16')]();};}function respondWithResult(_0x446a24,_0x70a66c){_0x70a66c=_0x70a66c||0xc8;return function(_0x4db571){if(_0x4db571){return _0x446a24[_0xcbf3('0x15')](_0x70a66c)[_0xcbf3('0x17')](_0x4db571);}};}function respondWithFilteredResult(_0x37a385,_0x20283d){return function(_0x572f62){if(_0x572f62){var _0xfd8db1=_0x572f62[_0xcbf3('0x18')],_0x13c768=_0x20283d[_0xcbf3('0x19')],_0x4b1368=_0x20283d[_0xcbf3('0x19')]+_0x20283d[_0xcbf3('0x1a')],_0x11075f;if(_0x4b1368>=_0xfd8db1){_0x4b1368=_0xfd8db1;_0x11075f=0xc8;}else{_0x11075f=0xce;}_0x37a385[_0xcbf3('0x15')](_0x11075f);return _0x37a385[_0xcbf3('0x1b')](_0xcbf3('0x1c'),_0x13c768+'-'+_0x4b1368+'/'+_0xfd8db1)[_0xcbf3('0x17')](_0x572f62);}return null;};}function patchUpdates(_0x1fdbfb){return function(_0x2537ef){try{jsonpatch[_0xcbf3('0x1d')](_0x2537ef,_0x1fdbfb,!![]);}catch(_0x24cb43){return BPromise['reject'](_0x24cb43);}return _0x2537ef[_0xcbf3('0x1e')]();};}function saveUpdates(_0x50937c,_0x15d145){return function(_0x43f226){if(_0x43f226){return _0x43f226[_0xcbf3('0x1f')](_0x50937c)['then'](function(_0x1dfb8f){return _0x1dfb8f;});}return null;};}function removeEntity(_0x4f8fa1,_0x725603){return function(_0x1ba716){if(_0x1ba716){return _0x1ba716[_0xcbf3('0x20')]()[_0xcbf3('0x21')](function(){var _0x273a0a=_0x1ba716['get']({'plain':!![]});var _0x54dbad=_0xcbf3('0x22');return db[_0xcbf3('0x23')]['destroy']({'where':{'type':_0x54dbad,'resourceId':_0x273a0a['id']}})['then'](function(){return _0x1ba716;});})[_0xcbf3('0x21')](function(){_0x4f8fa1['status'](0xcc)[_0xcbf3('0x16')]();});}};}function handleEntityNotFound(_0x1feeb3,_0x2f364d){return function(_0x21663a){if(!_0x21663a){_0x1feeb3[_0xcbf3('0x24')](0x194);}return _0x21663a;};}function handleError(_0x2839e9,_0x1f6eed){_0x1f6eed=_0x1f6eed||0x1f4;return function(_0x53cad5){logger[_0xcbf3('0x25')](_0x53cad5[_0xcbf3('0x26')]);if(_0x53cad5[_0xcbf3('0x27')]){delete _0x53cad5[_0xcbf3('0x27')];}_0x2839e9[_0xcbf3('0x15')](_0x1f6eed)['send'](_0x53cad5);};}exports[_0xcbf3('0x28')]=function(_0x2be897,_0x41eb0b){var _0x41900f={},_0x56d5c0={},_0x504e22={'count':0x0,'rows':[]};var _0x3f71d0=db['VoiceMail']['rawAttributes'];_0x56d5c0[_0xcbf3('0x29')]=_[_0xcbf3('0x2a')](_0x3f71d0);_0x56d5c0[_0xcbf3('0x2b')]=_['keys'](_0x2be897[_0xcbf3('0x2b')]);_0x56d5c0[_0xcbf3('0x2c')]=_['intersection'](_0x56d5c0[_0xcbf3('0x29')],_0x56d5c0['query']);_0x41900f[_0xcbf3('0x2d')]=_[_0xcbf3('0x2e')](_0x56d5c0[_0xcbf3('0x29')],qs[_0xcbf3('0x2f')](_0x2be897[_0xcbf3('0x2b')][_0xcbf3('0x2f')]));_0x41900f[_0xcbf3('0x2d')]=_0x41900f[_0xcbf3('0x2d')][_0xcbf3('0x30')]?_0x41900f[_0xcbf3('0x2d')]:_0x56d5c0[_0xcbf3('0x29')];if(!_0x2be897[_0xcbf3('0x2b')][_0xcbf3('0x31')](_0xcbf3('0x32'))){_0x41900f['limit']=qs['limit'](_0x2be897[_0xcbf3('0x2b')][_0xcbf3('0x1a')]);_0x41900f[_0xcbf3('0x19')]=qs[_0xcbf3('0x19')](_0x2be897['query'][_0xcbf3('0x19')]);}_0x41900f['order']=qs[_0xcbf3('0x33')](_0x2be897[_0xcbf3('0x2b')]['sort']);_0x41900f['where']=qs['filters'](_[_0xcbf3('0x34')](_0x2be897[_0xcbf3('0x2b')],_0x56d5c0['filters']));if(_0x2be897[_0xcbf3('0x2b')]['filter']){_0x41900f[_0xcbf3('0x35')]=_[_0xcbf3('0x36')](_0x41900f[_0xcbf3('0x35')],{'$or':_[_0xcbf3('0x37')](_0x3f71d0,function(_0x5756c8){if(_0x5756c8[_0xcbf3('0x38')]['key']!==_0xcbf3('0x39')){var _0x3de759={};_0x3de759[_0x5756c8[_0xcbf3('0x3a')]]={'$like':'%'+_0x2be897[_0xcbf3('0x2b')]['filter']+'%'};return _0x3de759;}})});}_0x41900f=_[_0xcbf3('0x36')]({},_0x41900f,_0x2be897[_0xcbf3('0x3b')]);var _0x2f0b05={'where':_0x41900f[_0xcbf3('0x35')]};return db[_0xcbf3('0x3c')][_0xcbf3('0x18')](_0x2f0b05)['then'](function(_0x91edd){_0x504e22[_0xcbf3('0x18')]=_0x91edd;if(_0x2be897[_0xcbf3('0x2b')][_0xcbf3('0x3d')]){_0x41900f[_0xcbf3('0x3e')]=[{'all':!![]}];}return db[_0xcbf3('0x3c')]['findAll'](_0x41900f);})[_0xcbf3('0x21')](function(_0x59e565){_0x504e22[_0xcbf3('0x3f')]=_0x59e565;return _0x504e22;})['then'](respondWithFilteredResult(_0x41eb0b,_0x41900f))['catch'](handleError(_0x41eb0b,null));};exports[_0xcbf3('0x40')]=function(_0xba874b,_0x4509fc){var _0x27d2e7={'raw':!![],'where':{'id':_0xba874b[_0xcbf3('0x41')]['id']}},_0x52c619={};_0x52c619['model']=_[_0xcbf3('0x2a')](db[_0xcbf3('0x3c')][_0xcbf3('0x42')]);_0x52c619[_0xcbf3('0x2b')]=_[_0xcbf3('0x2a')](_0xba874b[_0xcbf3('0x2b')]);_0x52c619['filters']=_[_0xcbf3('0x2e')](_0x52c619['model'],_0x52c619['query']);_0x27d2e7['attributes']=_[_0xcbf3('0x2e')](_0x52c619[_0xcbf3('0x29')],qs[_0xcbf3('0x2f')](_0xba874b[_0xcbf3('0x2b')][_0xcbf3('0x2f')]));_0x27d2e7[_0xcbf3('0x2d')]=_0x27d2e7['attributes'][_0xcbf3('0x30')]?_0x27d2e7['attributes']:_0x52c619['model'];if(_0xba874b[_0xcbf3('0x2b')]['includeAll']){_0x27d2e7['include']=[{'all':!![]}];}_0x27d2e7=_[_0xcbf3('0x36')]({},_0x27d2e7,_0xba874b[_0xcbf3('0x3b')]);return db[_0xcbf3('0x3c')][_0xcbf3('0x43')](_0x27d2e7)['then'](handleEntityNotFound(_0x4509fc,null))['then'](respondWithResult(_0x4509fc,null))[_0xcbf3('0x44')](handleError(_0x4509fc,null));};exports['create']=function(_0x186f43,_0x44fca6){return db[_0xcbf3('0x3c')]['create'](_0x186f43[_0xcbf3('0x45')],{})[_0xcbf3('0x21')](function(_0x26674d){var _0x1ef271=_0x186f43[_0xcbf3('0x46')][_0xcbf3('0x47')]({'plain':!![]});if(!_0x1ef271)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ef271[_0xcbf3('0x48')]==='user'){var _0x3fa786=_0x26674d['get']({'plain':!![]});var _0x171c24=_0xcbf3('0x22');return db[_0xcbf3('0x49')][_0xcbf3('0x43')]({'where':{'name':_0x171c24,'userProfileId':_0x1ef271['userProfileId']},'raw':!![]})[_0xcbf3('0x21')](function(_0x450e1f){if(_0x450e1f&&_0x450e1f[_0xcbf3('0x4a')]===0x0){return db[_0xcbf3('0x23')][_0xcbf3('0x4b')]({'name':_0x3fa786[_0xcbf3('0x27')],'resourceId':_0x3fa786['id'],'type':_0x450e1f['name'],'sectionId':_0x450e1f['id']},{})[_0xcbf3('0x21')](function(){return _0x26674d;});}else{return _0x26674d;}})[_0xcbf3('0x44')](function(_0x14a306){logger[_0xcbf3('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14a306);throw _0x14a306;});}return _0x26674d;})[_0xcbf3('0x21')](respondWithResult(_0x44fca6,0xc9))[_0xcbf3('0x44')](handleError(_0x44fca6,null));};exports[_0xcbf3('0x1f')]=function(_0x360af7,_0x2f0f3e){if(_0x360af7['body']['id']){delete _0x360af7[_0xcbf3('0x45')]['id'];}return db[_0xcbf3('0x3c')][_0xcbf3('0x43')]({'where':{'id':_0x360af7[_0xcbf3('0x41')]['id']}})[_0xcbf3('0x21')](handleEntityNotFound(_0x2f0f3e,null))[_0xcbf3('0x21')](saveUpdates(_0x360af7[_0xcbf3('0x45')],null))[_0xcbf3('0x21')](respondWithResult(_0x2f0f3e,null))[_0xcbf3('0x44')](handleError(_0x2f0f3e,null));};exports[_0xcbf3('0x20')]=function(_0x287eea,_0x45a58a){return db[_0xcbf3('0x3c')][_0xcbf3('0x43')]({'where':{'id':_0x287eea[_0xcbf3('0x41')]['id']}})[_0xcbf3('0x21')](handleEntityNotFound(_0x45a58a,null))['then'](removeEntity(_0x45a58a,null))[_0xcbf3('0x44')](handleError(_0x45a58a,null));};exports['getMessages']=function(_0x3ca050,_0x2ba9e2,_0x4a862c){return db[_0xcbf3('0x3c')][_0xcbf3('0x4c')]({'where':{'id':_0x3ca050[_0xcbf3('0x41')]['id']}})[_0xcbf3('0x21')](handleEntityNotFound(_0x2ba9e2,null))[_0xcbf3('0x21')](function(_0x83c669){var _0x375c2a;var _0x5bfb66={},_0x25bdd7={};_0x25bdd7[_0xcbf3('0x29')]=_[_0xcbf3('0x2a')](db[_0xcbf3('0x4d')]['rawAttributes']);_0x25bdd7[_0xcbf3('0x2b')]=_['keys'](_0x3ca050[_0xcbf3('0x2b')]);_0x25bdd7['filters']=_[_0xcbf3('0x2e')](_0x25bdd7['model'],_0x25bdd7[_0xcbf3('0x2b')]);_0x5bfb66[_0xcbf3('0x2d')]=_[_0xcbf3('0x2e')](_0x25bdd7['model'],qs[_0xcbf3('0x2f')](_0x3ca050[_0xcbf3('0x2b')][_0xcbf3('0x2f')]));_0x5bfb66[_0xcbf3('0x2d')]=_0x5bfb66[_0xcbf3('0x2d')][_0xcbf3('0x30')]?_0x5bfb66[_0xcbf3('0x2d')]:_0x25bdd7[_0xcbf3('0x29')];if(!_0x3ca050[_0xcbf3('0x2b')][_0xcbf3('0x31')](_0xcbf3('0x32'))){_0x5bfb66[_0xcbf3('0x1a')]=qs[_0xcbf3('0x1a')](_0x3ca050[_0xcbf3('0x2b')]['limit']);_0x5bfb66[_0xcbf3('0x19')]=qs['offset'](_0x3ca050[_0xcbf3('0x2b')][_0xcbf3('0x19')]);}_0x5bfb66[_0xcbf3('0x4e')]=qs[_0xcbf3('0x33')](_0x3ca050[_0xcbf3('0x2b')]['sort']);_0x5bfb66[_0xcbf3('0x35')]=qs[_0xcbf3('0x2c')](_[_0xcbf3('0x34')](_0x3ca050[_0xcbf3('0x2b')],_0x25bdd7[_0xcbf3('0x2c')]));if(_0x3ca050[_0xcbf3('0x2b')][_0xcbf3('0x4f')]){_0x5bfb66[_0xcbf3('0x35')]=_[_0xcbf3('0x36')](_0x5bfb66[_0xcbf3('0x35')],{'$or':_[_0xcbf3('0x37')](_0x5bfb66['attributes'],function(_0x2d82e7){var _0x4fd894={};_0x4fd894[_0x2d82e7]={'$like':'%'+_0x3ca050[_0xcbf3('0x2b')][_0xcbf3('0x4f')]+'%'};return _0x4fd894;})});}_0x5bfb66[_0xcbf3('0x35')]=_['merge'](_0x5bfb66[_0xcbf3('0x35')],{'mailboxuser':_0x83c669[_0xcbf3('0x50')]});_0x5bfb66=_[_0xcbf3('0x36')]({},_0x5bfb66,_0x3ca050[_0xcbf3('0x3b')]);return db[_0xcbf3('0x4d')]['findAndCountAll'](_0x5bfb66)['then'](respondWithFilteredResult(_0x2ba9e2,_0x5bfb66));})[_0xcbf3('0x44')](handleError(_0x2ba9e2,null));};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js
index 4843037..c20105f 100644
--- a/server/api/voiceMail/voiceMail.model.js
+++ b/server/api/voiceMail/voiceMail.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec8d=['util','api','moment','bluebird','request-promise','path','./voiceMail.attributes','exports','define','voice_voicemail','mailbox'];(function(_0xc73b7a,_0x5043d8){var _0x29b837=function(_0x34b8dd){while(--_0x34b8dd){_0xc73b7a['push'](_0xc73b7a['shift']());}};_0x29b837(++_0x5043d8);}(_0xec8d,0x16b));var _0xdec8=function(_0x2d2e85,_0x22faa9){_0x2d2e85=_0x2d2e85-0x0;var _0x3e9f5e=_0xec8d[_0x2d2e85];return _0x3e9f5e;};'use strict';var _=require('lodash');var util=require(_0xdec8('0x0'));var logger=require('../../config/logger')(_0xdec8('0x1'));var moment=require(_0xdec8('0x2'));var BPromise=require(_0xdec8('0x3'));var rp=require(_0xdec8('0x4'));var fs=require('fs');var path=require(_0xdec8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdec8('0x6'));module[_0xdec8('0x7')]=function(_0xece6b2,_0x104ac6){return _0xece6b2[_0xdec8('0x8')]('VoiceMail',attributes,{'tableName':_0xdec8('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xdec8('0xa'),'context']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x58e2=['api','bluebird','rimraf','../../config/environment','exports','VoiceMail','voice_voicemail','mailbox_context','context','lodash'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x58e2,0x9f));var _0x258e=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x58e2[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0x258e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x258e('0x1'));var moment=require('moment');var BPromise=require(_0x258e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x258e('0x3'));var config=require(_0x258e('0x4'));var attributes=require('./voiceMail.attributes');module[_0x258e('0x5')]=function(_0x5edfac,_0x383d89){return _0x5edfac['define'](_0x258e('0x6'),attributes,{'tableName':_0x258e('0x7'),'paranoid':![],'indexes':[{'name':_0x258e('0x8'),'fields':['mailbox',_0x258e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js
index 96da7fc..7d33103 100644
--- a/server/api/voiceMail/voiceMail.rpc.js
+++ b/server/api/voiceMail/voiceMail.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f56=['info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x40fd35,_0x2368e9){var _0x581a3e=function(_0x8df041){while(--_0x8df041){_0x40fd35['push'](_0x40fd35['shift']());}};_0x581a3e(++_0x2368e9);}(_0x9f56,0x1d6));var _0x69f5=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x9f56[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x69f5('0x0'));var util=require(_0x69f5('0x1'));var moment=require('moment');var BPromise=require(_0x69f5('0x2'));var rs=require(_0x69f5('0x3'));var fs=require('fs');var Redis=require(_0x69f5('0x4'));var db=require(_0x69f5('0x5'))['db'];var utils=require(_0x69f5('0x6'));var logger=require(_0x69f5('0x7'))(_0x69f5('0x8'));var config=require('../../config/environment');var jayson=require(_0x69f5('0x9'));var client=jayson[_0x69f5('0xa')][_0x69f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15264a,_0x2c52fa,_0x352da3){return new BPromise(function(_0x3b68a0,_0x181760){return client[_0x69f5('0xc')](_0x15264a,_0x352da3)['then'](function(_0x4dbf71){logger[_0x69f5('0xd')]('VoiceMail,\x20%s,\x20%s',_0x2c52fa,_0x69f5('0xe'));logger[_0x69f5('0xf')](_0x69f5('0x10'),_0x2c52fa,'request\x20sent',JSON[_0x69f5('0x11')](_0x4dbf71));if(_0x4dbf71[_0x69f5('0x12')]){if(_0x4dbf71[_0x69f5('0x12')][_0x69f5('0x13')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x2c52fa,_0x4dbf71[_0x69f5('0x12')][_0x69f5('0x14')]);return _0x181760(_0x4dbf71['error'][_0x69f5('0x14')]);}logger[_0x69f5('0x12')](_0x69f5('0x15'),_0x2c52fa,_0x4dbf71[_0x69f5('0x12')][_0x69f5('0x14')]);return _0x3b68a0(_0x4dbf71[_0x69f5('0x12')]['message']);}else{logger['info'](_0x69f5('0x15'),_0x2c52fa,'request\x20sent');_0x3b68a0(_0x4dbf71[_0x69f5('0x16')]['message']);}})['catch'](function(_0x233452){logger[_0x69f5('0x12')](_0x69f5('0x15'),_0x2c52fa,_0x233452);_0x181760(_0x233452);});});}
\ No newline at end of file
+var _0x70bd=['client','http','info','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x114bf1,_0x16ac4a){var _0x58072f=function(_0x377d8a){while(--_0x377d8a){_0x114bf1['push'](_0x114bf1['shift']());}};_0x58072f(++_0x16ac4a);}(_0x70bd,0x12b));var _0xd70b=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x70bd[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require(_0xd70b('0x0'));var moment=require(_0xd70b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd70b('0x2'))['db'];var utils=require(_0xd70b('0x3'));var logger=require('../../config/logger')(_0xd70b('0x4'));var config=require(_0xd70b('0x5'));var jayson=require(_0xd70b('0x6'));var client=jayson[_0xd70b('0x7')][_0xd70b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42447c,_0x263c0b,_0x4d8187){return new BPromise(function(_0x5f3b0e,_0x1d3d2e){return client['request'](_0x42447c,_0x4d8187)['then'](function(_0x420dc4){logger[_0xd70b('0x9')]('VoiceMail,\x20%s,\x20%s',_0x263c0b,_0xd70b('0xa'));logger['debug'](_0xd70b('0xb'),_0x263c0b,_0xd70b('0xa'),JSON[_0xd70b('0xc')](_0x420dc4));if(_0x420dc4[_0xd70b('0xd')]){if(_0x420dc4[_0xd70b('0xd')][_0xd70b('0xe')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x263c0b,_0x420dc4[_0xd70b('0xd')][_0xd70b('0xf')]);return _0x1d3d2e(_0x420dc4[_0xd70b('0xd')][_0xd70b('0xf')]);}logger[_0xd70b('0xd')]('VoiceMail,\x20%s,\x20%s',_0x263c0b,_0x420dc4[_0xd70b('0xd')][_0xd70b('0xf')]);return _0x5f3b0e(_0x420dc4[_0xd70b('0xd')][_0xd70b('0xf')]);}else{logger[_0xd70b('0x9')](_0xd70b('0x10'),_0x263c0b,_0xd70b('0xa'));_0x5f3b0e(_0x420dc4['result'][_0xd70b('0xf')]);}})['catch'](function(_0x546633){logger[_0xd70b('0xd')](_0xd70b('0x10'),_0x263c0b,_0x546633);_0x1d3d2e(_0x546633);});});}
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js
index 232edc6..865e126 100644
--- a/server/api/voiceMailMessage/index.js
+++ b/server/api/voiceMailMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x94f8=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','util','path'];(function(_0x3c5a7a,_0x47f782){var _0x4eeb5f=function(_0x19c7b9){while(--_0x19c7b9){_0x3c5a7a['push'](_0x3c5a7a['shift']());}};_0x4eeb5f(++_0x47f782);}(_0x94f8,0xb9));var _0x894f=function(_0x4301c7,_0x34373b){_0x4301c7=_0x4301c7-0x0;var _0x167782=_0x94f8[_0x4301c7];return _0x167782;};'use strict';var multer=require('multer');var util=require(_0x894f('0x0'));var path=require(_0x894f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x894f('0x2'));var interaction=require(_0x894f('0x3'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0x894f('0x4')]('/',auth[_0x894f('0x5')](),controller[_0x894f('0x6')]);router[_0x894f('0x4')](_0x894f('0x7'),auth[_0x894f('0x5')](),controller[_0x894f('0x8')]);router[_0x894f('0x4')](_0x894f('0x9'),auth[_0x894f('0x5')](),controller[_0x894f('0xa')]);router[_0x894f('0xb')]('/',auth[_0x894f('0x5')](),controller[_0x894f('0xc')]);router[_0x894f('0xd')](_0x894f('0x7'),auth[_0x894f('0x5')](),controller['update']);router[_0x894f('0xe')](_0x894f('0x7'),auth[_0x894f('0x5')](),controller[_0x894f('0xf')]);module[_0x894f('0x10')]=router;
\ No newline at end of file
+var _0x25aa=['../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','download','post','create','/:id','update','delete','destroy','multer','util','express','Router'];(function(_0x46d97e,_0x58e0e2){var _0x8bbe08=function(_0x2b012b){while(--_0x2b012b){_0x46d97e['push'](_0x46d97e['shift']());}};_0x8bbe08(++_0x58e0e2);}(_0x25aa,0xf8));var _0xa25a=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0x25aa[_0x3df9dd];return _0x4f11e4;};'use strict';var multer=require(_0xa25a('0x0'));var util=require(_0xa25a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa25a('0x2'));var router=express[_0xa25a('0x3')]();var auth=require(_0xa25a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa25a('0x5'));var controller=require(_0xa25a('0x6'));router[_0xa25a('0x7')]('/',auth[_0xa25a('0x8')](),controller[_0xa25a('0x9')]);router['get']('/:id',auth[_0xa25a('0x8')](),controller[_0xa25a('0xa')]);router['get']('/:id/download',auth[_0xa25a('0x8')](),controller[_0xa25a('0xb')]);router[_0xa25a('0xc')]('/',auth[_0xa25a('0x8')](),controller[_0xa25a('0xd')]);router['put'](_0xa25a('0xe'),auth[_0xa25a('0x8')](),controller[_0xa25a('0xf')]);router[_0xa25a('0x10')](_0xa25a('0xe'),auth[_0xa25a('0x8')](),controller[_0xa25a('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js
index 758560a..2390ea8 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.attributes.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4dfd=['INTEGER','STRING','long','TIMESTAMP','VIRTUAL','getDataValue'];(function(_0xa76be9,_0x1929f8){var _0x2faaaf=function(_0x223240){while(--_0x223240){_0xa76be9['push'](_0xa76be9['shift']());}};_0x2faaaf(++_0x1929f8);}(_0x4dfd,0x148));var _0xd4df=function(_0x234b2f,_0x608519){_0x234b2f=_0x234b2f-0x0;var _0x7c0659=_0x4dfd[_0x234b2f];return _0x7c0659;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd4df('0x0')],'get':function(_0x1a04f4){return this[_0xd4df('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xd4df('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xd4df('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'stamp':{'type':_0xd4df('0x5'),'allowNull':![]}};
\ No newline at end of file
+var _0xb605=['STRING','BLOB','TIMESTAMP','sequelize','exports','getDataValue'];(function(_0x4eb15c,_0x35b6c7){var _0xe2fe3c=function(_0x1f1f44){while(--_0x1f1f44){_0x4eb15c['push'](_0x4eb15c['shift']());}};_0xe2fe3c(++_0x35b6c7);}(_0xb605,0x99));var _0x5b60=function(_0xcaf223,_0xd39f07){_0xcaf223=_0xcaf223-0x0;var _0x17e00d=_0xb605[_0xcaf223];return _0x17e00d;};'use strict';var Sequelize=require(_0x5b60('0x0'));module[_0x5b60('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x530276){return this[_0x5b60('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5b60('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x5b60('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5b60('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x5b60('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5b60('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5b60('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x5b60('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x5b60('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x5b60('0x5'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js
index 903d573..f519ac0 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.controller.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9aea=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','rawAttributes','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','VoiceMailMessage','find','create','body','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','recording','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0xa221f5,_0x3cc639){var _0x3762ca=function(_0x4038bd){while(--_0x4038bd){_0xa221f5['push'](_0xa221f5['shift']());}};_0x3762ca(++_0x3cc639);}(_0x9aea,0xdd));var _0xa9ae=function(_0x1ac867,_0x444598){_0x1ac867=_0x1ac867-0x0;var _0x224334=_0x9aea[_0x1ac867];return _0x224334;};'use strict';var pdf=require(_0xa9ae('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa9ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9ae('0x2'));var rp=require(_0xa9ae('0x3'));var moment=require('moment');var BPromise=require(_0xa9ae('0x4'));var Mustache=require(_0xa9ae('0x5'));var util=require(_0xa9ae('0x6'));var path=require(_0xa9ae('0x7'));var sox=require(_0xa9ae('0x8'));var csv=require('to-csv');var ejs=require(_0xa9ae('0x9'));var fs=require('fs');var _=require(_0xa9ae('0xa'));var squel=require(_0xa9ae('0xb'));var crypto=require('crypto');var jsforce=require(_0xa9ae('0xc'));var deskjs=require(_0xa9ae('0xd'));var toCsv=require(_0xa9ae('0xe'));var querystring=require(_0xa9ae('0xf'));var Papa=require(_0xa9ae('0x10'));var Redis=require(_0xa9ae('0x11'));var authService=require(_0xa9ae('0x12'));var qs=require(_0xa9ae('0x13'));var hardwareService=require(_0xa9ae('0x14'));var logger=require('../../config/logger')(_0xa9ae('0x15'));var utils=require('../../config/utils');var config=require(_0xa9ae('0x16'));var db=require(_0xa9ae('0x17'))['db'];function respondWithStatusCode(_0x112ab5,_0x378871){_0x378871=_0x378871||0xcc;return function(_0x35f861){if(_0x35f861){return _0x112ab5[_0xa9ae('0x18')](_0x378871);}return _0x112ab5[_0xa9ae('0x19')](_0x378871)[_0xa9ae('0x1a')]();};}function respondWithResult(_0x56de45,_0x1859c3){_0x1859c3=_0x1859c3||0xc8;return function(_0x365e90){if(_0x365e90){return _0x56de45[_0xa9ae('0x19')](_0x1859c3)[_0xa9ae('0x1b')](_0x365e90);}};}function respondWithFilteredResult(_0x4d0bd9,_0x28ce2d){return function(_0x1ec742){if(_0x1ec742){var _0x31c03e=_0x1ec742['count'],_0x40b756=_0x28ce2d[_0xa9ae('0x1c')],_0x77b0a4=_0x28ce2d[_0xa9ae('0x1c')]+_0x28ce2d[_0xa9ae('0x1d')],_0xddb095;if(_0x77b0a4>=_0x31c03e){_0x77b0a4=_0x31c03e;_0xddb095=0xc8;}else{_0xddb095=0xce;}_0x4d0bd9['status'](_0xddb095);return _0x4d0bd9['set'](_0xa9ae('0x1e'),_0x40b756+'-'+_0x77b0a4+'/'+_0x31c03e)['json'](_0x1ec742);}return null;};}function patchUpdates(_0x59e7dd){return function(_0x18911b){try{jsonpatch[_0xa9ae('0x1f')](_0x18911b,_0x59e7dd,!![]);}catch(_0xbfd2ff){return BPromise[_0xa9ae('0x20')](_0xbfd2ff);}return _0x18911b['save']();};}function saveUpdates(_0x27371a,_0x3d5d81){return function(_0x39f133){if(_0x39f133){return _0x39f133[_0xa9ae('0x21')](_0x27371a)[_0xa9ae('0x22')](function(_0x2e204d){return _0x2e204d;});}return null;};}function removeEntity(_0x971ee1,_0x5a062d){return function(_0xc021cf){if(_0xc021cf){return _0xc021cf['destroy']()['then'](function(){_0x971ee1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1afd07,_0x4edd55){return function(_0x13fb05){if(!_0x13fb05){_0x1afd07['sendStatus'](0x194);}return _0x13fb05;};}function handleError(_0x2ff25c,_0x38eaeb){_0x38eaeb=_0x38eaeb||0x1f4;return function(_0x93d637){logger[_0xa9ae('0x23')](_0x93d637[_0xa9ae('0x24')]);if(_0x93d637[_0xa9ae('0x25')]){delete _0x93d637[_0xa9ae('0x25')];}_0x2ff25c['status'](_0x38eaeb)[_0xa9ae('0x26')](_0x93d637);};}exports[_0xa9ae('0x27')]=function(_0x2aac9e,_0xfe9ef1){var _0x222db7={},_0x428934={},_0xb12fa8={'count':0x0,'rows':[]};var _0x5dfcd7=db['VoiceMailMessage'][_0xa9ae('0x28')];_0x428934[_0xa9ae('0x29')]=_[_0xa9ae('0x2a')](_[_0xa9ae('0x2b')](_0x5dfcd7),[_0xa9ae('0x25')]);_0x428934['query']=_['keys'](_0x2aac9e[_0xa9ae('0x2c')]);_0x428934[_0xa9ae('0x2d')]=_[_0xa9ae('0x2e')](_0x428934[_0xa9ae('0x29')],_0x428934[_0xa9ae('0x2c')]);_0x222db7[_0xa9ae('0x2f')]=_['intersection'](_0x428934['model'],qs[_0xa9ae('0x30')](_0x2aac9e[_0xa9ae('0x2c')][_0xa9ae('0x30')]));_0x222db7[_0xa9ae('0x2f')]=_0x222db7[_0xa9ae('0x2f')][_0xa9ae('0x31')]?_0x222db7[_0xa9ae('0x2f')]:_0x428934[_0xa9ae('0x29')];if(!_0x2aac9e['query'][_0xa9ae('0x32')]('nolimit')){_0x222db7[_0xa9ae('0x1d')]=qs[_0xa9ae('0x1d')](_0x2aac9e[_0xa9ae('0x2c')]['limit']);_0x222db7[_0xa9ae('0x1c')]=qs[_0xa9ae('0x1c')](_0x2aac9e[_0xa9ae('0x2c')][_0xa9ae('0x1c')]);}_0x222db7[_0xa9ae('0x33')]=qs['sort'](_0x2aac9e[_0xa9ae('0x2c')][_0xa9ae('0x34')]);_0x222db7[_0xa9ae('0x35')]=qs['filters'](_['pick'](_0x2aac9e[_0xa9ae('0x2c')],_0x428934[_0xa9ae('0x2d')]));if(_0x2aac9e[_0xa9ae('0x2c')][_0xa9ae('0x36')]){_0x222db7['where']=_[_0xa9ae('0x37')](_0x222db7[_0xa9ae('0x35')],{'$or':_[_0xa9ae('0x38')](_0x5dfcd7,function(_0x9766c9){if(_0x9766c9[_0xa9ae('0x39')]['key']!==_0xa9ae('0x3a')){var _0x4b890e={};_0x4b890e[_0x9766c9[_0xa9ae('0x3b')]]={'$like':'%'+_0x2aac9e[_0xa9ae('0x2c')][_0xa9ae('0x36')]+'%'};return _0x4b890e;}})});}_0x222db7=_['merge']({},_0x222db7,_0x2aac9e[_0xa9ae('0x3c')]);var _0x1ffcab={'where':_0x222db7[_0xa9ae('0x35')]};return db['VoiceMailMessage'][_0xa9ae('0x3d')](_0x1ffcab)[_0xa9ae('0x22')](function(_0x4e2001){_0xb12fa8[_0xa9ae('0x3d')]=_0x4e2001;if(_0x2aac9e['query'][_0xa9ae('0x3e')]){_0x222db7[_0xa9ae('0x3f')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xa9ae('0x40')](_0x222db7);})[_0xa9ae('0x22')](function(_0x234da5){_0xb12fa8[_0xa9ae('0x41')]=_0x234da5;return _0xb12fa8;})[_0xa9ae('0x22')](respondWithFilteredResult(_0xfe9ef1,_0x222db7))[_0xa9ae('0x42')](handleError(_0xfe9ef1,null));};exports['show']=function(_0x3da6ce,_0xa12887){var _0x511fb2={'raw':!![],'where':{'id':_0x3da6ce[_0xa9ae('0x43')]['id']}},_0x5609d4={};_0x5609d4[_0xa9ae('0x29')]=_[_0xa9ae('0x2b')](db[_0xa9ae('0x44')]['rawAttributes']);_0x5609d4[_0xa9ae('0x2c')]=_[_0xa9ae('0x2b')](_0x3da6ce[_0xa9ae('0x2c')]);_0x5609d4[_0xa9ae('0x2d')]=_[_0xa9ae('0x2e')](_0x5609d4[_0xa9ae('0x29')],_0x5609d4[_0xa9ae('0x2c')]);_0x511fb2['attributes']=_[_0xa9ae('0x2e')](_0x5609d4[_0xa9ae('0x29')],qs['fields'](_0x3da6ce[_0xa9ae('0x2c')]['fields']));_0x511fb2[_0xa9ae('0x2f')]=_0x511fb2[_0xa9ae('0x2f')][_0xa9ae('0x31')]?_0x511fb2[_0xa9ae('0x2f')]:_0x5609d4[_0xa9ae('0x29')];if(_0x3da6ce[_0xa9ae('0x2c')][_0xa9ae('0x3e')]){_0x511fb2['include']=[{'all':!![]}];}_0x511fb2=_[_0xa9ae('0x37')]({},_0x511fb2,_0x3da6ce[_0xa9ae('0x3c')]);return db['VoiceMailMessage'][_0xa9ae('0x45')](_0x511fb2)[_0xa9ae('0x22')](handleEntityNotFound(_0xa12887,null))[_0xa9ae('0x22')](respondWithResult(_0xa12887,null))[_0xa9ae('0x42')](handleError(_0xa12887,null));};exports[_0xa9ae('0x46')]=function(_0x76502d,_0x571cb4){return db[_0xa9ae('0x44')]['create'](_0x76502d[_0xa9ae('0x47')],{})[_0xa9ae('0x22')](respondWithResult(_0x571cb4,0xc9))['catch'](handleError(_0x571cb4,null));};exports['update']=function(_0x1c2861,_0x3c558e){if(_0x1c2861[_0xa9ae('0x47')]['id']){delete _0x1c2861[_0xa9ae('0x47')]['id'];}return db[_0xa9ae('0x44')][_0xa9ae('0x45')]({'where':{'id':_0x1c2861[_0xa9ae('0x43')]['id']}})[_0xa9ae('0x22')](handleEntityNotFound(_0x3c558e,null))['then'](saveUpdates(_0x1c2861['body'],null))[_0xa9ae('0x22')](respondWithResult(_0x3c558e,null))[_0xa9ae('0x42')](handleError(_0x3c558e,null));};exports['destroy']=function(_0x2aada4,_0x38f24c){return db[_0xa9ae('0x44')][_0xa9ae('0x45')]({'where':{'id':_0x2aada4[_0xa9ae('0x43')]['id']}})[_0xa9ae('0x22')](handleEntityNotFound(_0x38f24c,null))[_0xa9ae('0x22')](removeEntity(_0x38f24c,null))[_0xa9ae('0x42')](handleError(_0x38f24c,null));};exports['download']=function(_0x30cc88,_0x1713cb,_0x5ea18d){return db[_0xa9ae('0x44')]['find']({'where':{'id':_0x30cc88['params']['id']},'attributes':['id','recording',_0xa9ae('0x48')]})[_0xa9ae('0x22')](handleEntityNotFound(_0x1713cb,null))['then'](function(_0x4840ea){if(_0x4840ea){if(!_0x4840ea['recording']){throw new db[(_0xa9ae('0x49'))]['ValidationError'](_0xa9ae('0x4a'));}var _0x2c1976={'Content-Type':'audio/wav','Content-Disposition':_0xa9ae('0x4b')};if(_0x4840ea['msg_id']){_0x2c1976[_0xa9ae('0x4c')]=_0xa9ae('0x4d')+_0x4840ea[_0xa9ae('0x48')]+_0xa9ae('0x4e');}_0x1713cb[_0xa9ae('0x4f')](_0x2c1976);return _0x1713cb[_0xa9ae('0x26')](new Buffer(_0x4840ea[_0xa9ae('0x50')]));}})[_0xa9ae('0x42')](handleError(_0x1713cb,null));};
\ No newline at end of file
+var _0x57d4=['filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','Content-Range','reject','save','update','then','sendStatus','error','stack','index','rawAttributes','model','keys','name','query'];(function(_0x40b0b7,_0xf53ae5){var _0x5dfb0b=function(_0x5a9c9e){while(--_0x5a9c9e){_0x40b0b7['push'](_0x40b0b7['shift']());}};_0x5dfb0b(++_0xf53ae5);}(_0x57d4,0x78));var _0x457d=function(_0x3ab8f9,_0x1b17ee){_0x3ab8f9=_0x3ab8f9-0x0;var _0x4d1cab=_0x57d4[_0x3ab8f9];return _0x4d1cab;};'use strict';var pdf=require(_0x457d('0x0'));var emlformat=require(_0x457d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x457d('0x2'));var jsonpatch=require(_0x457d('0x3'));var rp=require(_0x457d('0x4'));var moment=require(_0x457d('0x5'));var BPromise=require(_0x457d('0x6'));var Mustache=require(_0x457d('0x7'));var util=require(_0x457d('0x8'));var path=require(_0x457d('0x9'));var sox=require(_0x457d('0xa'));var csv=require(_0x457d('0xb'));var ejs=require(_0x457d('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x457d('0xd'));var crypto=require(_0x457d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x457d('0xb'));var querystring=require(_0x457d('0xf'));var Papa=require(_0x457d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x457d('0x11'));var logger=require(_0x457d('0x12'))(_0x457d('0x13'));var utils=require(_0x457d('0x14'));var config=require(_0x457d('0x15'));var db=require(_0x457d('0x16'))['db'];function respondWithStatusCode(_0x354ae4,_0x24cf65){_0x24cf65=_0x24cf65||0xcc;return function(_0xe7d200){if(_0xe7d200){return _0x354ae4['sendStatus'](_0x24cf65);}return _0x354ae4[_0x457d('0x17')](_0x24cf65)[_0x457d('0x18')]();};}function respondWithResult(_0x557aa6,_0x5e1841){_0x5e1841=_0x5e1841||0xc8;return function(_0x44740f){if(_0x44740f){return _0x557aa6[_0x457d('0x17')](_0x5e1841)[_0x457d('0x19')](_0x44740f);}};}function respondWithFilteredResult(_0x610d41,_0x2ac416){return function(_0x3e62f8){if(_0x3e62f8){var _0xeac953=_0x3e62f8[_0x457d('0x1a')],_0x38cce1=_0x2ac416[_0x457d('0x1b')],_0x55c6e4=_0x2ac416['offset']+_0x2ac416['limit'],_0xc9b3f8;if(_0x55c6e4>=_0xeac953){_0x55c6e4=_0xeac953;_0xc9b3f8=0xc8;}else{_0xc9b3f8=0xce;}_0x610d41[_0x457d('0x17')](_0xc9b3f8);return _0x610d41['set'](_0x457d('0x1c'),_0x38cce1+'-'+_0x55c6e4+'/'+_0xeac953)[_0x457d('0x19')](_0x3e62f8);}return null;};}function patchUpdates(_0x50e78f){return function(_0x2a22b6){try{jsonpatch['apply'](_0x2a22b6,_0x50e78f,!![]);}catch(_0x5e6400){return BPromise[_0x457d('0x1d')](_0x5e6400);}return _0x2a22b6[_0x457d('0x1e')]();};}function saveUpdates(_0x3acb5a,_0x16594b){return function(_0xc47d13){if(_0xc47d13){return _0xc47d13[_0x457d('0x1f')](_0x3acb5a)[_0x457d('0x20')](function(_0x4141fc){return _0x4141fc;});}return null;};}function removeEntity(_0x2087a5,_0x46fe6a){return function(_0x57f229){if(_0x57f229){return _0x57f229['destroy']()['then'](function(){_0x2087a5[_0x457d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5177cf,_0x55bcb9){return function(_0x206fdc){if(!_0x206fdc){_0x5177cf[_0x457d('0x21')](0x194);}return _0x206fdc;};}function handleError(_0x5bf818,_0x1c9dc7){_0x1c9dc7=_0x1c9dc7||0x1f4;return function(_0x115b1b){logger[_0x457d('0x22')](_0x115b1b[_0x457d('0x23')]);if(_0x115b1b['name']){delete _0x115b1b['name'];}_0x5bf818[_0x457d('0x17')](_0x1c9dc7)['send'](_0x115b1b);};}exports[_0x457d('0x24')]=function(_0x21a102,_0x2eb87e){var _0x1bc311={},_0x54de66={},_0x298dd4={'count':0x0,'rows':[]};var _0x57a47f=db['VoiceMailMessage'][_0x457d('0x25')];_0x54de66[_0x457d('0x26')]=_['differenceBy'](_[_0x457d('0x27')](_0x57a47f),[_0x457d('0x28')]);_0x54de66['query']=_[_0x457d('0x27')](_0x21a102[_0x457d('0x29')]);_0x54de66[_0x457d('0x2a')]=_[_0x457d('0x2b')](_0x54de66[_0x457d('0x26')],_0x54de66[_0x457d('0x29')]);_0x1bc311[_0x457d('0x2c')]=_[_0x457d('0x2b')](_0x54de66[_0x457d('0x26')],qs[_0x457d('0x2d')](_0x21a102[_0x457d('0x29')][_0x457d('0x2d')]));_0x1bc311[_0x457d('0x2c')]=_0x1bc311[_0x457d('0x2c')][_0x457d('0x2e')]?_0x1bc311[_0x457d('0x2c')]:_0x54de66[_0x457d('0x26')];if(!_0x21a102[_0x457d('0x29')]['hasOwnProperty'](_0x457d('0x2f'))){_0x1bc311[_0x457d('0x30')]=qs['limit'](_0x21a102['query'][_0x457d('0x30')]);_0x1bc311[_0x457d('0x1b')]=qs['offset'](_0x21a102[_0x457d('0x29')][_0x457d('0x1b')]);}_0x1bc311[_0x457d('0x31')]=qs[_0x457d('0x32')](_0x21a102[_0x457d('0x29')][_0x457d('0x32')]);_0x1bc311[_0x457d('0x33')]=qs[_0x457d('0x2a')](_[_0x457d('0x34')](_0x21a102[_0x457d('0x29')],_0x54de66[_0x457d('0x2a')]));if(_0x21a102[_0x457d('0x29')][_0x457d('0x35')]){_0x1bc311[_0x457d('0x33')]=_[_0x457d('0x36')](_0x1bc311['where'],{'$or':_[_0x457d('0x37')](_0x57a47f,function(_0x4a4cea){if(_0x4a4cea['type']['key']!==_0x457d('0x38')){var _0x548a89={};_0x548a89[_0x4a4cea[_0x457d('0x39')]]={'$like':'%'+_0x21a102['query']['filter']+'%'};return _0x548a89;}})});}_0x1bc311=_[_0x457d('0x36')]({},_0x1bc311,_0x21a102[_0x457d('0x3a')]);var _0x2618f4={'where':_0x1bc311[_0x457d('0x33')]};return db[_0x457d('0x3b')][_0x457d('0x1a')](_0x2618f4)[_0x457d('0x20')](function(_0x818fa3){_0x298dd4[_0x457d('0x1a')]=_0x818fa3;if(_0x21a102[_0x457d('0x29')][_0x457d('0x3c')]){_0x1bc311[_0x457d('0x3d')]=[{'all':!![]}];}return db[_0x457d('0x3b')][_0x457d('0x3e')](_0x1bc311);})[_0x457d('0x20')](function(_0x1bbd9d){_0x298dd4[_0x457d('0x3f')]=_0x1bbd9d;return _0x298dd4;})['then'](respondWithFilteredResult(_0x2eb87e,_0x1bc311))[_0x457d('0x40')](handleError(_0x2eb87e,null));};exports['show']=function(_0xaa8ded,_0x428610){var _0x3ab4b2={'raw':!![],'where':{'id':_0xaa8ded[_0x457d('0x41')]['id']}},_0x15571f={};_0x15571f['model']=_['keys'](db[_0x457d('0x3b')]['rawAttributes']);_0x15571f[_0x457d('0x29')]=_[_0x457d('0x27')](_0xaa8ded[_0x457d('0x29')]);_0x15571f['filters']=_[_0x457d('0x2b')](_0x15571f[_0x457d('0x26')],_0x15571f[_0x457d('0x29')]);_0x3ab4b2[_0x457d('0x2c')]=_[_0x457d('0x2b')](_0x15571f[_0x457d('0x26')],qs[_0x457d('0x2d')](_0xaa8ded[_0x457d('0x29')][_0x457d('0x2d')]));_0x3ab4b2['attributes']=_0x3ab4b2['attributes'][_0x457d('0x2e')]?_0x3ab4b2[_0x457d('0x2c')]:_0x15571f[_0x457d('0x26')];if(_0xaa8ded[_0x457d('0x29')][_0x457d('0x3c')]){_0x3ab4b2[_0x457d('0x3d')]=[{'all':!![]}];}_0x3ab4b2=_['merge']({},_0x3ab4b2,_0xaa8ded[_0x457d('0x3a')]);return db[_0x457d('0x3b')][_0x457d('0x42')](_0x3ab4b2)['then'](handleEntityNotFound(_0x428610,null))[_0x457d('0x20')](respondWithResult(_0x428610,null))[_0x457d('0x40')](handleError(_0x428610,null));};exports[_0x457d('0x43')]=function(_0x4d0507,_0x1b8072){return db[_0x457d('0x3b')][_0x457d('0x43')](_0x4d0507[_0x457d('0x44')],{})['then'](respondWithResult(_0x1b8072,0xc9))[_0x457d('0x40')](handleError(_0x1b8072,null));};exports[_0x457d('0x1f')]=function(_0x22ab35,_0x24980f){if(_0x22ab35[_0x457d('0x44')]['id']){delete _0x22ab35[_0x457d('0x44')]['id'];}return db[_0x457d('0x3b')][_0x457d('0x42')]({'where':{'id':_0x22ab35[_0x457d('0x41')]['id']}})[_0x457d('0x20')](handleEntityNotFound(_0x24980f,null))['then'](saveUpdates(_0x22ab35[_0x457d('0x44')],null))[_0x457d('0x20')](respondWithResult(_0x24980f,null))[_0x457d('0x40')](handleError(_0x24980f,null));};exports[_0x457d('0x45')]=function(_0x481a89,_0x450ad7){return db[_0x457d('0x3b')][_0x457d('0x42')]({'where':{'id':_0x481a89[_0x457d('0x41')]['id']}})[_0x457d('0x20')](handleEntityNotFound(_0x450ad7,null))[_0x457d('0x20')](removeEntity(_0x450ad7,null))[_0x457d('0x40')](handleError(_0x450ad7,null));};exports[_0x457d('0x46')]=function(_0x4805ac,_0x5c4970,_0xec7449){return db[_0x457d('0x3b')][_0x457d('0x42')]({'where':{'id':_0x4805ac[_0x457d('0x41')]['id']},'attributes':['id',_0x457d('0x47'),_0x457d('0x48')]})[_0x457d('0x20')](handleEntityNotFound(_0x5c4970,null))[_0x457d('0x20')](function(_0x3a80ea){if(_0x3a80ea){if(!_0x3a80ea[_0x457d('0x47')]){throw new db[(_0x457d('0x49'))][(_0x457d('0x4a'))](_0x457d('0x4b'));}var _0x29d93c={'Content-Type':'audio/wav','Content-Disposition':_0x457d('0x4c')};if(_0x3a80ea[_0x457d('0x48')]){_0x29d93c[_0x457d('0x4d')]=_0x457d('0x4e')+_0x3a80ea['msg_id']+_0x457d('0x4f');}_0x5c4970[_0x457d('0x50')](_0x29d93c);return _0x5c4970['send'](new Buffer(_0x3a80ea[_0x457d('0x47')]));}})[_0x457d('0x40')](handleError(_0x5c4970,null));};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js
index c5977ec..b30149f 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.model.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3580=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define'];(function(_0x3bdc60,_0x1097ed){var _0x3358a3=function(_0x3687f1){while(--_0x3687f1){_0x3bdc60['push'](_0x3bdc60['shift']());}};_0x3358a3(++_0x1097ed);}(_0x3580,0x1b6));var _0x0358=function(_0x24fb96,_0x4d1674){_0x24fb96=_0x24fb96-0x0;var _0x584c04=_0x3580[_0x24fb96];return _0x584c04;};'use strict';var _=require(_0x0358('0x0'));var util=require(_0x0358('0x1'));var logger=require(_0x0358('0x2'))(_0x0358('0x3'));var moment=require(_0x0358('0x4'));var BPromise=require(_0x0358('0x5'));var rp=require(_0x0358('0x6'));var fs=require('fs');var path=require(_0x0358('0x7'));var rimraf=require(_0x0358('0x8'));var config=require('../../config/environment');var attributes=require(_0x0358('0x9'));module[_0x0358('0xa')]=function(_0x23ee51,_0x5e9b3b){return _0x23ee51[_0x0358('0xb')](_0x0358('0xc'),attributes,{'tableName':_0x0358('0xd'),'paranoid':![],'indexes':[{'name':_0x0358('0xe'),'fields':[_0x0358('0xe')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xe7bf=['request-promise','path','../../config/environment','./voiceMailMessage.attributes','define','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','bluebird'];(function(_0xed58fb,_0x3ad96e){var _0x34ff8a=function(_0x35cbfe){while(--_0x35cbfe){_0xed58fb['push'](_0xed58fb['shift']());}};_0x34ff8a(++_0x3ad96e);}(_0xe7bf,0x8b));var _0xfe7b=function(_0x41888c,_0x3a5f1c){_0x41888c=_0x41888c-0x0;var _0x143565=_0xe7bf[_0x41888c];return _0x143565;};'use strict';var _=require(_0xfe7b('0x0'));var util=require('util');var logger=require(_0xfe7b('0x1'))(_0xfe7b('0x2'));var moment=require(_0xfe7b('0x3'));var BPromise=require(_0xfe7b('0x4'));var rp=require(_0xfe7b('0x5'));var fs=require('fs');var path=require(_0xfe7b('0x6'));var rimraf=require('rimraf');var config=require(_0xfe7b('0x7'));var attributes=require(_0xfe7b('0x8'));module['exports']=function(_0x2223b9,_0x2f2a40){return _0x2223b9[_0xfe7b('0x9')]('VoiceMailMessage',attributes,{'tableName':_0xfe7b('0xa'),'paranoid':![],'indexes':[{'name':_0xfe7b('0xb'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js
index 668282a..47ce654 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfc19=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xfc19,0xd1));var _0x9fc1=function(_0x41d1fa,_0xa250bf){_0x41d1fa=_0x41d1fa-0x0;var _0x450b97=_0xfc19[_0x41d1fa];return _0x450b97;};'use strict';var _=require(_0x9fc1('0x0'));var util=require(_0x9fc1('0x1'));var moment=require(_0x9fc1('0x2'));var BPromise=require(_0x9fc1('0x3'));var rs=require(_0x9fc1('0x4'));var fs=require('fs');var Redis=require(_0x9fc1('0x5'));var db=require(_0x9fc1('0x6'))['db'];var utils=require(_0x9fc1('0x7'));var logger=require(_0x9fc1('0x8'))(_0x9fc1('0x9'));var config=require(_0x9fc1('0xa'));var jayson=require(_0x9fc1('0xb'));var client=jayson[_0x9fc1('0xc')][_0x9fc1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5e28ac,_0x5bcddc,_0x537e55){return new BPromise(function(_0x2fdd7a,_0x541628){return client[_0x9fc1('0xe')](_0x5e28ac,_0x537e55)[_0x9fc1('0xf')](function(_0x134b8a){logger[_0x9fc1('0x10')](_0x9fc1('0x11'),_0x5bcddc,'request\x20sent');logger[_0x9fc1('0x12')](_0x9fc1('0x13'),_0x5bcddc,_0x9fc1('0x14'),JSON[_0x9fc1('0x15')](_0x134b8a));if(_0x134b8a['error']){if(_0x134b8a[_0x9fc1('0x16')]['code']===0x1f4){logger['error'](_0x9fc1('0x11'),_0x5bcddc,_0x134b8a[_0x9fc1('0x16')][_0x9fc1('0x17')]);return _0x541628(_0x134b8a[_0x9fc1('0x16')]['message']);}logger[_0x9fc1('0x16')](_0x9fc1('0x11'),_0x5bcddc,_0x134b8a[_0x9fc1('0x16')]['message']);return _0x2fdd7a(_0x134b8a['error'][_0x9fc1('0x17')]);}else{logger[_0x9fc1('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x5bcddc,'request\x20sent');_0x2fdd7a(_0x134b8a[_0x9fc1('0x18')][_0x9fc1('0x17')]);}})[_0x9fc1('0x19')](function(_0x142481){logger[_0x9fc1('0x16')](_0x9fc1('0x11'),_0x5bcddc,_0x142481);_0x541628(_0x142481);});});}
\ No newline at end of file
+var _0xbb14=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x30019c,_0x45be10){var _0x328a68=function(_0x45daed){while(--_0x45daed){_0x30019c['push'](_0x30019c['shift']());}};_0x328a68(++_0x45be10);}(_0xbb14,0x1bc));var _0x4bb1=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbb14[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x4bb1('0x0'));var util=require(_0x4bb1('0x1'));var moment=require(_0x4bb1('0x2'));var BPromise=require(_0x4bb1('0x3'));var rs=require(_0x4bb1('0x4'));var fs=require('fs');var Redis=require(_0x4bb1('0x5'));var db=require(_0x4bb1('0x6'))['db'];var utils=require(_0x4bb1('0x7'));var logger=require(_0x4bb1('0x8'))('rpc');var config=require(_0x4bb1('0x9'));var jayson=require(_0x4bb1('0xa'));var client=jayson['client'][_0x4bb1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a5490,_0xcfe3fe,_0x34b3fe){return new BPromise(function(_0x4650c6,_0x498ad2){return client[_0x4bb1('0xc')](_0x2a5490,_0x34b3fe)['then'](function(_0x5ed326){logger[_0x4bb1('0xd')](_0x4bb1('0xe'),_0xcfe3fe,_0x4bb1('0xf'));logger[_0x4bb1('0x10')](_0x4bb1('0x11'),_0xcfe3fe,_0x4bb1('0xf'),JSON['stringify'](_0x5ed326));if(_0x5ed326[_0x4bb1('0x12')]){if(_0x5ed326[_0x4bb1('0x12')]['code']===0x1f4){logger[_0x4bb1('0x12')](_0x4bb1('0xe'),_0xcfe3fe,_0x5ed326['error'][_0x4bb1('0x13')]);return _0x498ad2(_0x5ed326[_0x4bb1('0x12')]['message']);}logger[_0x4bb1('0x12')](_0x4bb1('0xe'),_0xcfe3fe,_0x5ed326[_0x4bb1('0x12')][_0x4bb1('0x13')]);return _0x4650c6(_0x5ed326[_0x4bb1('0x12')][_0x4bb1('0x13')]);}else{logger[_0x4bb1('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0xcfe3fe,'request\x20sent');_0x4650c6(_0x5ed326[_0x4bb1('0x14')][_0x4bb1('0x13')]);}})[_0x4bb1('0x15')](function(_0x4a48aa){logger[_0x4bb1('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0xcfe3fe,_0x4a48aa);_0x498ad2(_0x4a48aa);});});}
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js
index 6b2a71f..6d1e2d1 100644
--- a/server/api/voiceMusicOnHold/index.js
+++ b/server/api/voiceMusicOnHold/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd3d1=['getSounds','create','post','addSound','put','update','delete','destroy','removeSound','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds'];(function(_0x3afaae,_0x1ee943){var _0x21c7cc=function(_0x4f545d){while(--_0x4f545d){_0x3afaae['push'](_0x3afaae['shift']());}};_0x21c7cc(++_0x1ee943);}(_0xd3d1,0x172));var _0x1d3d=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xd3d1[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d3d('0x2'));var router=express[_0x1d3d('0x3')]();var auth=require(_0x1d3d('0x4'));var interaction=require(_0x1d3d('0x5'));var config=require(_0x1d3d('0x6'));var controller=require(_0x1d3d('0x7'));router[_0x1d3d('0x8')]('/',auth[_0x1d3d('0x9')](),controller[_0x1d3d('0xa')]);router[_0x1d3d('0x8')](_0x1d3d('0xb'),auth[_0x1d3d('0x9')](),controller[_0x1d3d('0xc')]);router[_0x1d3d('0x8')](_0x1d3d('0xd'),auth[_0x1d3d('0x9')](),controller[_0x1d3d('0xe')]);router['post']('/',auth[_0x1d3d('0x9')](),controller[_0x1d3d('0xf')]);router[_0x1d3d('0x10')](_0x1d3d('0xd'),auth[_0x1d3d('0x9')](),controller[_0x1d3d('0x11')]);router[_0x1d3d('0x12')](_0x1d3d('0xb'),auth[_0x1d3d('0x9')](),controller[_0x1d3d('0x13')]);router[_0x1d3d('0x14')]('/:id',auth[_0x1d3d('0x9')](),controller[_0x1d3d('0x15')]);router['delete']('/:id/sounds/:id2',auth[_0x1d3d('0x9')](),controller[_0x1d3d('0x16')]);module[_0x1d3d('0x17')]=router;
\ No newline at end of file
+var _0x0bb5=['get','isAuthenticated','/:id','show','getSounds','post','create','/:id/sounds','addSound','put','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x2e13aa,_0x48c8cd){var _0x3a3810=function(_0xcb2366){while(--_0xcb2366){_0x2e13aa['push'](_0x2e13aa['shift']());}};_0x3a3810(++_0x48c8cd);}(_0x0bb5,0x148));var _0x50bb=function(_0x1374af,_0x6dc1a2){_0x1374af=_0x1374af-0x0;var _0x264ff3=_0x0bb5[_0x1374af];return _0x264ff3;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var auth=require(_0x50bb('0x4'));var interaction=require(_0x50bb('0x5'));var config=require(_0x50bb('0x6'));var controller=require(_0x50bb('0x7'));router[_0x50bb('0x8')]('/',auth[_0x50bb('0x9')](),controller['index']);router['get'](_0x50bb('0xa'),auth[_0x50bb('0x9')](),controller[_0x50bb('0xb')]);router[_0x50bb('0x8')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x50bb('0xc')]);router[_0x50bb('0xd')]('/',auth[_0x50bb('0x9')](),controller[_0x50bb('0xe')]);router['post'](_0x50bb('0xf'),auth[_0x50bb('0x9')](),controller[_0x50bb('0x10')]);router[_0x50bb('0x11')](_0x50bb('0xa'),auth[_0x50bb('0x9')](),controller[_0x50bb('0x12')]);router['delete'](_0x50bb('0xa'),auth['isAuthenticated'](),controller[_0x50bb('0x13')]);router[_0x50bb('0x14')](_0x50bb('0x15'),auth['isAuthenticated'](),controller[_0x50bb('0x16')]);module[_0x50bb('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
index 2b85e8b..1d25d44 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1cd4=['mp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','ENUM','files'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1cd4,0x95));var _0x41cd=function(_0x3f2f56,_0x27e1b8){_0x3f2f56=_0x3f2f56-0x0;var _0x26a4a7=_0x1cd4[_0x3f2f56];return _0x26a4a7;};'use strict';var Sequelize=require(_0x41cd('0x0'));module['exports']={'name':{'type':Sequelize[_0x41cd('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x41cd('0x2')]('custom',_0x41cd('0x3'),_0x41cd('0x4'),'quietmp3nb','quietmp3',_0x41cd('0x5')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x41cd('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x41cd('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x41cd('0x6')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x41cd('0x7')},'defaultEntry':{'type':Sequelize[_0x41cd('0x8')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6210=['quietmp3nb','quietmp3','alpha','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x6210,0x178));var _0x0621=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x6210[_0x20ef64];return _0x3707d8;};'use strict';var Sequelize=require(_0x0621('0x0'));module[_0x0621('0x1')]={'name':{'type':Sequelize[_0x0621('0x2')],'allowNull':![],'unique':_0x0621('0x3')},'mode':{'type':Sequelize[_0x0621('0x4')](_0x0621('0x5'),_0x0621('0x6'),_0x0621('0x7'),_0x0621('0x8'),_0x0621('0x9'),'mp3'),'allowNull':!![],'defaultValue':_0x0621('0x6')},'directory':{'type':Sequelize[_0x0621('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x0621('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x0621('0x2')],'allowNull':!![],'defaultValue':_0x0621('0xa')},'format':{'type':Sequelize[_0x0621('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x0621('0xb')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
index 1b1df97..2a22f82 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x385c=['rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','findAll','catch','show','find','body','params','sequelize','transaction','files','directory','join','root','server/files/moh','create','mode','mkdirSync','user','MusicOnHolds','autoAssociation','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','Sound','converted_format','createdAt','format','%s.%s','save_name','symlinkSync','removeSound','findOne','id2','getSounds','sort','nolimit','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','error','name','send','index','VoiceMusicOnHold'];(function(_0x2d7125,_0x595e62){var _0x14ce33=function(_0x113ca0){while(--_0x113ca0){_0x2d7125['push'](_0x2d7125['shift']());}};_0x14ce33(++_0x595e62);}(_0x385c,0xa1));var _0xc385=function(_0x24f33f,_0x41f78d){_0x24f33f=_0x24f33f-0x0;var _0xd91e63=_0x385c[_0x24f33f];return _0xd91e63;};'use strict';var pdf=require(_0xc385('0x0'));var emlformat=require(_0xc385('0x1'));var rimraf=require(_0xc385('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc385('0x3'));var rp=require(_0xc385('0x4'));var moment=require(_0xc385('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc385('0x6'));var util=require(_0xc385('0x7'));var path=require('path');var sox=require(_0xc385('0x8'));var csv=require(_0xc385('0x9'));var ejs=require(_0xc385('0xa'));var fs=require('fs');var _=require(_0xc385('0xb'));var squel=require(_0xc385('0xc'));var crypto=require('crypto');var jsforce=require(_0xc385('0xd'));var deskjs=require(_0xc385('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc385('0xf'));var Redis=require(_0xc385('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc385('0x11'));var hardwareService=require(_0xc385('0x12'));var logger=require('../../config/logger')(_0xc385('0x13'));var utils=require(_0xc385('0x14'));var config=require('../../config/environment');var db=require(_0xc385('0x15'))['db'];function respondWithStatusCode(_0x2f5628,_0x5aedc6){_0x5aedc6=_0x5aedc6||0xcc;return function(_0x2afe27){if(_0x2afe27){return _0x2f5628[_0xc385('0x16')](_0x5aedc6);}return _0x2f5628['status'](_0x5aedc6)[_0xc385('0x17')]();};}function respondWithResult(_0x45a1ad,_0x386df5){_0x386df5=_0x386df5||0xc8;return function(_0x4a9603){if(_0x4a9603){return _0x45a1ad['status'](_0x386df5)[_0xc385('0x18')](_0x4a9603);}};}function respondWithFilteredResult(_0x22f356,_0x2d7c61){return function(_0xe9c466){if(_0xe9c466){var _0x26dd74=_0xe9c466['count'],_0x5e15c5=_0x2d7c61[_0xc385('0x19')],_0x480d94=_0x2d7c61[_0xc385('0x19')]+_0x2d7c61[_0xc385('0x1a')],_0x139acb;if(_0x480d94>=_0x26dd74){_0x480d94=_0x26dd74;_0x139acb=0xc8;}else{_0x139acb=0xce;}_0x22f356[_0xc385('0x1b')](_0x139acb);return _0x22f356[_0xc385('0x1c')](_0xc385('0x1d'),_0x5e15c5+'-'+_0x480d94+'/'+_0x26dd74)[_0xc385('0x18')](_0xe9c466);}return null;};}function patchUpdates(_0x45c160){return function(_0x530058){try{jsonpatch[_0xc385('0x1e')](_0x530058,_0x45c160,!![]);}catch(_0xd1a295){return BPromise[_0xc385('0x1f')](_0xd1a295);}return _0x530058[_0xc385('0x20')]();};}function saveUpdates(_0x5dd1ef,_0x1248db){return function(_0x53eeb1){if(_0x53eeb1){return _0x53eeb1[_0xc385('0x21')](_0x5dd1ef)['then'](function(_0x8a3bc5){return _0x8a3bc5;});}return null;};}function removeEntity(_0x5c51b1,_0x551af4){return function(_0x1c69db){if(_0x1c69db){return _0x1c69db[_0xc385('0x22')]()[_0xc385('0x23')](function(){var _0x48ff96=_0x1c69db[_0xc385('0x24')]({'plain':!![]});var _0x16e965='MusicOnHolds';return db[_0xc385('0x25')][_0xc385('0x22')]({'where':{'type':_0x16e965,'resourceId':_0x48ff96['id']}})[_0xc385('0x23')](function(){return _0x1c69db;});})[_0xc385('0x23')](function(){_0x5c51b1[_0xc385('0x1b')](0xcc)[_0xc385('0x17')]();});}};}function handleEntityNotFound(_0x50309d,_0x45b48e){return function(_0x5aeb3c){if(!_0x5aeb3c){_0x50309d['sendStatus'](0x194);}return _0x5aeb3c;};}function handleError(_0x15019d,_0x130032){_0x130032=_0x130032||0x1f4;return function(_0x40a121){logger[_0xc385('0x26')](_0x40a121['stack']);if(_0x40a121[_0xc385('0x27')]){delete _0x40a121['name'];}_0x15019d[_0xc385('0x1b')](_0x130032)[_0xc385('0x28')](_0x40a121);};}exports[_0xc385('0x29')]=function(_0x23046e,_0x26fbce){var _0x5a4393={},_0x5eedf6={},_0x485381={'count':0x0,'rows':[]};var _0x2584bb=db[_0xc385('0x2a')][_0xc385('0x2b')];_0x5eedf6[_0xc385('0x2c')]=_[_0xc385('0x2d')](_0x2584bb);_0x5eedf6[_0xc385('0x2e')]=_['keys'](_0x23046e[_0xc385('0x2e')]);_0x5eedf6[_0xc385('0x2f')]=_[_0xc385('0x30')](_0x5eedf6[_0xc385('0x2c')],_0x5eedf6[_0xc385('0x2e')]);_0x5a4393['attributes']=_[_0xc385('0x30')](_0x5eedf6[_0xc385('0x2c')],qs[_0xc385('0x31')](_0x23046e[_0xc385('0x2e')][_0xc385('0x31')]));_0x5a4393[_0xc385('0x32')]=_0x5a4393[_0xc385('0x32')][_0xc385('0x33')]?_0x5a4393[_0xc385('0x32')]:_0x5eedf6[_0xc385('0x2c')];if(!_0x23046e['query'][_0xc385('0x34')]('nolimit')){_0x5a4393['limit']=qs[_0xc385('0x1a')](_0x23046e[_0xc385('0x2e')]['limit']);_0x5a4393[_0xc385('0x19')]=qs[_0xc385('0x19')](_0x23046e['query'][_0xc385('0x19')]);}_0x5a4393['order']=qs['sort'](_0x23046e[_0xc385('0x2e')]['sort']);_0x5a4393['where']=qs[_0xc385('0x2f')](_[_0xc385('0x35')](_0x23046e[_0xc385('0x2e')],_0x5eedf6['filters']));if(_0x23046e[_0xc385('0x2e')][_0xc385('0x36')]){_0x5a4393['where']=_[_0xc385('0x37')](_0x5a4393['where'],{'$or':_[_0xc385('0x38')](_0x2584bb,function(_0x47aab5){if(_0x47aab5[_0xc385('0x39')][_0xc385('0x3a')]!==_0xc385('0x3b')){var _0x1af4e9={};_0x1af4e9[_0x47aab5[_0xc385('0x3c')]]={'$like':'%'+_0x23046e[_0xc385('0x2e')][_0xc385('0x36')]+'%'};return _0x1af4e9;}})});}_0x5a4393=_[_0xc385('0x37')]({},_0x5a4393,_0x23046e[_0xc385('0x3d')]);var _0x2144f2={'where':_0x5a4393['where']};return db['VoiceMusicOnHold'][_0xc385('0x3e')](_0x2144f2)[_0xc385('0x23')](function(_0x2f360e){_0x485381[_0xc385('0x3e')]=_0x2f360e;if(_0x23046e[_0xc385('0x2e')][_0xc385('0x3f')]){_0x5a4393['include']=[{'all':!![]}];}return db[_0xc385('0x2a')][_0xc385('0x40')](_0x5a4393);})['then'](function(_0xbd8f27){_0x485381['rows']=_0xbd8f27;return _0x485381;})[_0xc385('0x23')](respondWithFilteredResult(_0x26fbce,_0x5a4393))[_0xc385('0x41')](handleError(_0x26fbce,null));};exports[_0xc385('0x42')]=function(_0x384d2a,_0x4e5ae7){var _0x3ecac0={'raw':![],'where':{'id':_0x384d2a['params']['id']}},_0x559fca={};_0x559fca[_0xc385('0x2c')]=_[_0xc385('0x2d')](db[_0xc385('0x2a')][_0xc385('0x2b')]);_0x559fca[_0xc385('0x2e')]=_['keys'](_0x384d2a[_0xc385('0x2e')]);_0x559fca['filters']=_['intersection'](_0x559fca[_0xc385('0x2c')],_0x559fca[_0xc385('0x2e')]);_0x3ecac0[_0xc385('0x32')]=_[_0xc385('0x30')](_0x559fca[_0xc385('0x2c')],qs[_0xc385('0x31')](_0x384d2a[_0xc385('0x2e')][_0xc385('0x31')]));_0x3ecac0[_0xc385('0x32')]=_0x3ecac0[_0xc385('0x32')][_0xc385('0x33')]?_0x3ecac0[_0xc385('0x32')]:_0x559fca[_0xc385('0x2c')];if(_0x384d2a[_0xc385('0x2e')]['includeAll']){_0x3ecac0['include']=[{'all':!![]}];}_0x3ecac0=_['merge']({},_0x3ecac0,_0x384d2a[_0xc385('0x3d')]);return db[_0xc385('0x2a')][_0xc385('0x43')](_0x3ecac0)[_0xc385('0x23')](handleEntityNotFound(_0x4e5ae7,null))[_0xc385('0x23')](respondWithResult(_0x4e5ae7,null))['catch'](handleError(_0x4e5ae7,null));};exports[_0xc385('0x21')]=function(_0x2f164f,_0x4955ea){if(_0x2f164f['body']['id']){delete _0x2f164f[_0xc385('0x44')]['id'];}return db[_0xc385('0x2a')]['find']({'where':{'id':_0x2f164f[_0xc385('0x45')]['id']}})['then'](handleEntityNotFound(_0x4955ea,null))[_0xc385('0x23')](saveUpdates(_0x2f164f[_0xc385('0x44')],null))['then'](respondWithResult(_0x4955ea,null))[_0xc385('0x41')](handleError(_0x4955ea,null));};exports['create']=function(_0x56db5e,_0x429d8e,_0x5ef535){return db[_0xc385('0x46')][_0xc385('0x47')](function(_0x44921f){if(_0x56db5e['body']['mode']===_0xc385('0x48')){_0x56db5e['body'][_0xc385('0x49')]=path[_0xc385('0x4a')](config[_0xc385('0x4b')],_0xc385('0x4c'),_0x56db5e['body'][_0xc385('0x27')]);}return db[_0xc385('0x2a')][_0xc385('0x4d')](_0x56db5e[_0xc385('0x44')],{'transaction':_0x44921f})[_0xc385('0x23')](function(_0x5a7bf2){if(_0x56db5e[_0xc385('0x44')][_0xc385('0x4e')]==='files'){fs[_0xc385('0x4f')](_0x5a7bf2[_0xc385('0x49')],parseInt('0777',0x8));}var _0x5d84c4=_0x56db5e[_0xc385('0x50')]['get']({'plain':!![]});if(!_0x5d84c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d84c4['role']===_0xc385('0x50')){var _0x5554e6=_0x5a7bf2['get']({'plain':!![]});return db['UserProfileSection'][_0xc385('0x43')]({'where':{'name':_0xc385('0x51'),'userProfileId':_0x5d84c4['userProfileId']},'raw':!![]})[_0xc385('0x23')](function(_0x5f6125){if(_0x5f6125&&_0x5f6125[_0xc385('0x52')]===0x0){return db[_0xc385('0x25')][_0xc385('0x4d')]({'name':_0x5554e6['name'],'resourceId':_0x5554e6['id'],'type':_0x5f6125[_0xc385('0x27')],'sectionId':_0x5f6125['id']},{})[_0xc385('0x23')](function(){return _0x5a7bf2;});}else{return _0x5a7bf2;}})[_0xc385('0x41')](function(_0x1fc40f){logger[_0xc385('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1fc40f);});}return _0x5a7bf2;});})[_0xc385('0x23')](respondWithResult(_0x429d8e,0xc9))[_0xc385('0x41')](handleError(_0x429d8e,null));};exports['destroy']=function(_0x1d9b5b,_0x3282f5,_0x3589ee){var _0x3f605d;return db[_0xc385('0x2a')]['find']({'where':{'id':_0x1d9b5b[_0xc385('0x45')]['id']}})[_0xc385('0x23')](function(_0x4e9e07){if(_0x4e9e07){return db[_0xc385('0x46')][_0xc385('0x47')](function(_0x17fa82){return _0x4e9e07[_0xc385('0x22')]({'transaction':_0x17fa82,'raw':!![]})[_0xc385('0x23')](function(_0x2a4bb2){if(_0x2a4bb2['directory']){fs[_0xc385('0x53')](_0x2a4bb2['directory'])['forEach'](function(_0x58c7b7){fs[_0xc385('0x54')](path['join'](_0x2a4bb2[_0xc385('0x49')],_0x58c7b7));});fs[_0xc385('0x55')](_0x2a4bb2[_0xc385('0x49')]);}return _0x2a4bb2;});})[_0xc385('0x41')](function(_0x4eb458){throw new db[(_0xc385('0x56'))][(_0xc385('0x57'))](_0x4eb458[_0xc385('0x58')]);});}})[_0xc385('0x23')](handleEntityNotFound(_0x3282f5,null))[_0xc385('0x23')](removeEntity(_0x3282f5,null))['catch'](handleError(_0x3282f5,null));};exports['addSound']=function(_0x25245e,_0x26f6f5,_0x97a59a){return db[_0xc385('0x46')][_0xc385('0x47')](function(_0x1c7381){var _0x564f62;return db[_0xc385('0x2a')][_0xc385('0x43')]({'where':{'id':_0x25245e['params']['id']}})[_0xc385('0x23')](function(_0x208635){if(_0x208635){_0x564f62=_0x208635;return _0x208635['addSound'](_0x25245e[_0xc385('0x44')]['id'],{'transaction':_0x1c7381});}})[_0xc385('0x23')](function(_0x134b34){if(_0x134b34){return db[_0xc385('0x59')]['findOne']({'where':{'id':_0x25245e['body']['id']},'attributes':['id','name','save_name',_0xc385('0x5a'),_0xc385('0x5b')],'raw':!![]});}})['then'](function(_0x330796){if(_0x330796){var _0x1e7260=path[_0xc385('0x4a')](config['root'],'server/files/sounds/converted',util[_0xc385('0x5c')](_0xc385('0x5d'),path['basename'](_0x330796['save_name'],path['extname'](_0x330796[_0xc385('0x5e')])),_0x330796['converted_format']));var _0x3d1aef=path[_0xc385('0x4a')](config[_0xc385('0x4b')],_0xc385('0x4c'),_0x564f62[_0xc385('0x27')],util[_0xc385('0x5c')](_0xc385('0x5d'),_0x330796[_0xc385('0x27')],_0x330796[_0xc385('0x5a')]));fs[_0xc385('0x5f')](_0x1e7260,_0x3d1aef);return _0x330796;}})[_0xc385('0x41')](function(_0x52d102){throw new db[(_0xc385('0x56'))]['ValidationError'](_0x52d102['message']);});})['then'](handleEntityNotFound(_0x26f6f5,null))[_0xc385('0x23')](respondWithResult(_0x26f6f5,0xc9))['catch'](handleError(_0x26f6f5,null));};exports[_0xc385('0x60')]=function(_0x33bbdb,_0x230c54,_0x135091){return db['sequelize'][_0xc385('0x47')](function(_0x532c56){var _0x545249;return db[_0xc385('0x2a')][_0xc385('0x61')]({'where':{'id':_0x33bbdb['params']['id']}})[_0xc385('0x23')](handleEntityNotFound(_0x230c54,null))['then'](function(_0x4be8c1){if(_0x4be8c1){_0x545249=_0x4be8c1;return _0x4be8c1[_0xc385('0x60')](_0x33bbdb['params'][_0xc385('0x62')]);}})[_0xc385('0x23')](function(_0x2d255e){if(_0x2d255e){return db['Sound'][_0xc385('0x61')]({'where':{'id':_0x33bbdb[_0xc385('0x45')]['id2']},'attributes':['id',_0xc385('0x27'),_0xc385('0x5e'),'converted_format',_0xc385('0x5b')],'raw':!![]});}})[_0xc385('0x23')](function(_0x42635b){if(_0x42635b){fs[_0xc385('0x54')](path[_0xc385('0x4a')](_0x545249[_0xc385('0x49')],util['format'](_0xc385('0x5d'),_0x42635b[_0xc385('0x27')],_0x42635b[_0xc385('0x5a')])));return _0x42635b;}})[_0xc385('0x41')](function(_0x4879bb){throw new db['Sequelize']['ValidationError'](_0x4879bb['message']);});})[_0xc385('0x23')](handleEntityNotFound(_0x230c54,null))[_0xc385('0x23')](respondWithStatusCode(_0x230c54,0xcc))[_0xc385('0x41')](handleError(_0x230c54,null));};exports[_0xc385('0x63')]=function(_0x1fa2c9,_0x237298,_0x360afb){var _0x2efb7e={};var _0x2e057f={};var _0x5db4eb;var _0xf44f37;return db[_0xc385('0x2a')][_0xc385('0x61')]({'where':{'id':_0x1fa2c9[_0xc385('0x45')]['id']}})[_0xc385('0x23')](handleEntityNotFound(_0x237298,null))[_0xc385('0x23')](function(_0x335086){if(_0x335086){_0x5db4eb=_0x335086;_0x2e057f['model']=_['keys'](db[_0xc385('0x59')]['rawAttributes']);_0x2e057f[_0xc385('0x2e')]=_[_0xc385('0x2d')](_0x1fa2c9[_0xc385('0x2e')]);_0x2e057f[_0xc385('0x2f')]=_[_0xc385('0x30')](_0x2e057f['model'],_0x2e057f[_0xc385('0x2e')]);_0x2efb7e[_0xc385('0x32')]=_[_0xc385('0x30')](_0x2e057f[_0xc385('0x2c')],qs[_0xc385('0x31')](_0x1fa2c9[_0xc385('0x2e')][_0xc385('0x31')]));_0x2efb7e[_0xc385('0x32')]=_0x2efb7e[_0xc385('0x32')][_0xc385('0x33')]?_0x2efb7e['attributes']:_0x2e057f['model'];_0x2efb7e['order']=qs[_0xc385('0x64')](_0x1fa2c9[_0xc385('0x2e')][_0xc385('0x64')]);_0x2efb7e['where']=qs[_0xc385('0x2f')](_[_0xc385('0x35')](_0x1fa2c9['query'],_0x2e057f[_0xc385('0x2f')]));if(_0x1fa2c9['query'][_0xc385('0x36')]){_0x2efb7e['where']=_[_0xc385('0x37')](_0x2efb7e['where'],{'$or':_[_0xc385('0x38')](_0x2efb7e[_0xc385('0x32')],function(_0x16c81a){var _0x4b715b={};_0x4b715b[_0x16c81a]={'$like':'%'+_0x1fa2c9[_0xc385('0x2e')][_0xc385('0x36')]+'%'};return _0x4b715b;})});}_0x2efb7e=_[_0xc385('0x37')]({},_0x2efb7e,_0x1fa2c9['options']);return _0x5db4eb[_0xc385('0x63')](_0x2efb7e);}})[_0xc385('0x23')](function(_0x5f2725){if(_0x5f2725){_0xf44f37=_0x5f2725[_0xc385('0x33')];if(!_0x1fa2c9[_0xc385('0x2e')][_0xc385('0x34')](_0xc385('0x65'))){_0x2efb7e['limit']=qs[_0xc385('0x1a')](_0x1fa2c9[_0xc385('0x2e')][_0xc385('0x1a')]);_0x2efb7e[_0xc385('0x19')]=qs['offset'](_0x1fa2c9[_0xc385('0x2e')]['offset']);}return _0x5db4eb[_0xc385('0x63')](_0x2efb7e);}})[_0xc385('0x23')](function(_0x280db0){if(_0x280db0){return _0x280db0?{'count':_0xf44f37,'rows':_0x280db0}:null;}})[_0xc385('0x23')](respondWithResult(_0x237298,null))['catch'](handleError(_0x237298,null));};
\ No newline at end of file
+var _0xa25c=['mode','files','directory','root','create','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','basename','server/files/moh','%s.%s','symlinkSync','removeSound','id2','converted_format','getSounds','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','count','offset','apply','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','name','index','VoiceMusicOnHold','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','params','find','body','transaction'];(function(_0x4c702d,_0x9e5545){var _0xe11eb2=function(_0x4100d0){while(--_0x4100d0){_0x4c702d['push'](_0x4c702d['shift']());}};_0xe11eb2(++_0x9e5545);}(_0xa25c,0x8e));var _0xca25=function(_0x21a6f0,_0x34f377){_0x21a6f0=_0x21a6f0-0x0;var _0x394ada=_0xa25c[_0x21a6f0];return _0x394ada;};'use strict';var pdf=require(_0xca25('0x0'));var emlformat=require(_0xca25('0x1'));var rimraf=require(_0xca25('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xca25('0x3'));var moment=require(_0xca25('0x4'));var BPromise=require(_0xca25('0x5'));var Mustache=require(_0xca25('0x6'));var util=require('util');var path=require(_0xca25('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xca25('0x8'));var fs=require('fs');var _=require(_0xca25('0x9'));var squel=require(_0xca25('0xa'));var crypto=require(_0xca25('0xb'));var jsforce=require(_0xca25('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xca25('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xca25('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xca25('0xf'));var logger=require('../../config/logger')(_0xca25('0x10'));var utils=require(_0xca25('0x11'));var config=require('../../config/environment');var db=require(_0xca25('0x12'))['db'];function respondWithStatusCode(_0x15ce43,_0x5dbe68){_0x5dbe68=_0x5dbe68||0xcc;return function(_0x12eef0){if(_0x12eef0){return _0x15ce43['sendStatus'](_0x5dbe68);}return _0x15ce43[_0xca25('0x13')](_0x5dbe68)[_0xca25('0x14')]();};}function respondWithResult(_0x808303,_0x34aaf2){_0x34aaf2=_0x34aaf2||0xc8;return function(_0x3753bb){if(_0x3753bb){return _0x808303['status'](_0x34aaf2)[_0xca25('0x15')](_0x3753bb);}};}function respondWithFilteredResult(_0x3e663a,_0x3a3229){return function(_0x112e82){if(_0x112e82){var _0x480c47=_0x112e82[_0xca25('0x16')],_0x6f6e34=_0x3a3229[_0xca25('0x17')],_0x3786ad=_0x3a3229['offset']+_0x3a3229['limit'],_0x45428c;if(_0x3786ad>=_0x480c47){_0x3786ad=_0x480c47;_0x45428c=0xc8;}else{_0x45428c=0xce;}_0x3e663a[_0xca25('0x13')](_0x45428c);return _0x3e663a['set']('Content-Range',_0x6f6e34+'-'+_0x3786ad+'/'+_0x480c47)[_0xca25('0x15')](_0x112e82);}return null;};}function patchUpdates(_0x474b9e){return function(_0x113b37){try{jsonpatch[_0xca25('0x18')](_0x113b37,_0x474b9e,!![]);}catch(_0x5b93a3){return BPromise[_0xca25('0x19')](_0x5b93a3);}return _0x113b37['save']();};}function saveUpdates(_0x16a8ec,_0x45eee4){return function(_0x3c8200){if(_0x3c8200){return _0x3c8200[_0xca25('0x1a')](_0x16a8ec)[_0xca25('0x1b')](function(_0x89cd8a){return _0x89cd8a;});}return null;};}function removeEntity(_0x13b4e7,_0x5376be){return function(_0x71af6){if(_0x71af6){return _0x71af6[_0xca25('0x1c')]()[_0xca25('0x1b')](function(){var _0x14de11=_0x71af6[_0xca25('0x1d')]({'plain':!![]});var _0x32f1d8=_0xca25('0x1e');return db[_0xca25('0x1f')][_0xca25('0x1c')]({'where':{'type':_0x32f1d8,'resourceId':_0x14de11['id']}})['then'](function(){return _0x71af6;});})[_0xca25('0x1b')](function(){_0x13b4e7[_0xca25('0x13')](0xcc)[_0xca25('0x14')]();});}};}function handleEntityNotFound(_0x188568,_0x4893b9){return function(_0x11a031){if(!_0x11a031){_0x188568[_0xca25('0x20')](0x194);}return _0x11a031;};}function handleError(_0x27c364,_0x32e8eb){_0x32e8eb=_0x32e8eb||0x1f4;return function(_0x42d396){logger[_0xca25('0x21')](_0x42d396['stack']);if(_0x42d396['name']){delete _0x42d396[_0xca25('0x22')];}_0x27c364[_0xca25('0x13')](_0x32e8eb)['send'](_0x42d396);};}exports[_0xca25('0x23')]=function(_0x6ec088,_0x5ccd61){var _0x69ebc9={},_0x5be3f9={},_0x1b1fc1={'count':0x0,'rows':[]};var _0x1cd4fa=db[_0xca25('0x24')][_0xca25('0x25')];_0x5be3f9[_0xca25('0x26')]=_[_0xca25('0x27')](_0x1cd4fa);_0x5be3f9[_0xca25('0x28')]=_[_0xca25('0x27')](_0x6ec088[_0xca25('0x28')]);_0x5be3f9['filters']=_[_0xca25('0x29')](_0x5be3f9[_0xca25('0x26')],_0x5be3f9[_0xca25('0x28')]);_0x69ebc9[_0xca25('0x2a')]=_['intersection'](_0x5be3f9[_0xca25('0x26')],qs[_0xca25('0x2b')](_0x6ec088[_0xca25('0x28')][_0xca25('0x2b')]));_0x69ebc9[_0xca25('0x2a')]=_0x69ebc9['attributes'][_0xca25('0x2c')]?_0x69ebc9[_0xca25('0x2a')]:_0x5be3f9[_0xca25('0x26')];if(!_0x6ec088[_0xca25('0x28')][_0xca25('0x2d')](_0xca25('0x2e'))){_0x69ebc9[_0xca25('0x2f')]=qs[_0xca25('0x2f')](_0x6ec088[_0xca25('0x28')][_0xca25('0x2f')]);_0x69ebc9[_0xca25('0x17')]=qs['offset'](_0x6ec088[_0xca25('0x28')][_0xca25('0x17')]);}_0x69ebc9[_0xca25('0x30')]=qs[_0xca25('0x31')](_0x6ec088[_0xca25('0x28')][_0xca25('0x31')]);_0x69ebc9[_0xca25('0x32')]=qs['filters'](_[_0xca25('0x33')](_0x6ec088['query'],_0x5be3f9[_0xca25('0x34')]));if(_0x6ec088[_0xca25('0x28')][_0xca25('0x35')]){_0x69ebc9['where']=_[_0xca25('0x36')](_0x69ebc9[_0xca25('0x32')],{'$or':_[_0xca25('0x37')](_0x1cd4fa,function(_0x4cc823){if(_0x4cc823[_0xca25('0x38')][_0xca25('0x39')]!==_0xca25('0x3a')){var _0x36d6fc={};_0x36d6fc[_0x4cc823[_0xca25('0x3b')]]={'$like':'%'+_0x6ec088[_0xca25('0x28')][_0xca25('0x35')]+'%'};return _0x36d6fc;}})});}_0x69ebc9=_['merge']({},_0x69ebc9,_0x6ec088[_0xca25('0x3c')]);var _0x35a347={'where':_0x69ebc9[_0xca25('0x32')]};return db[_0xca25('0x24')]['count'](_0x35a347)[_0xca25('0x1b')](function(_0x5d2cd3){_0x1b1fc1[_0xca25('0x16')]=_0x5d2cd3;if(_0x6ec088['query'][_0xca25('0x3d')]){_0x69ebc9[_0xca25('0x3e')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xca25('0x3f')](_0x69ebc9);})[_0xca25('0x1b')](function(_0x333ae8){_0x1b1fc1['rows']=_0x333ae8;return _0x1b1fc1;})[_0xca25('0x1b')](respondWithFilteredResult(_0x5ccd61,_0x69ebc9))[_0xca25('0x40')](handleError(_0x5ccd61,null));};exports[_0xca25('0x41')]=function(_0x2f7352,_0x3cfcb9){var _0x3720e0={'raw':![],'where':{'id':_0x2f7352[_0xca25('0x42')]['id']}},_0x275574={};_0x275574['model']=_['keys'](db[_0xca25('0x24')]['rawAttributes']);_0x275574['query']=_[_0xca25('0x27')](_0x2f7352[_0xca25('0x28')]);_0x275574['filters']=_[_0xca25('0x29')](_0x275574[_0xca25('0x26')],_0x275574[_0xca25('0x28')]);_0x3720e0['attributes']=_[_0xca25('0x29')](_0x275574['model'],qs['fields'](_0x2f7352[_0xca25('0x28')][_0xca25('0x2b')]));_0x3720e0[_0xca25('0x2a')]=_0x3720e0[_0xca25('0x2a')][_0xca25('0x2c')]?_0x3720e0[_0xca25('0x2a')]:_0x275574['model'];if(_0x2f7352['query'][_0xca25('0x3d')]){_0x3720e0[_0xca25('0x3e')]=[{'all':!![]}];}_0x3720e0=_[_0xca25('0x36')]({},_0x3720e0,_0x2f7352['options']);return db['VoiceMusicOnHold'][_0xca25('0x43')](_0x3720e0)['then'](handleEntityNotFound(_0x3cfcb9,null))[_0xca25('0x1b')](respondWithResult(_0x3cfcb9,null))[_0xca25('0x40')](handleError(_0x3cfcb9,null));};exports[_0xca25('0x1a')]=function(_0x181094,_0x8b3508){if(_0x181094[_0xca25('0x44')]['id']){delete _0x181094[_0xca25('0x44')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x181094['params']['id']}})['then'](handleEntityNotFound(_0x8b3508,null))[_0xca25('0x1b')](saveUpdates(_0x181094[_0xca25('0x44')],null))[_0xca25('0x1b')](respondWithResult(_0x8b3508,null))[_0xca25('0x40')](handleError(_0x8b3508,null));};exports['create']=function(_0x1a59a4,_0x2a25ba,_0x5790c0){return db['sequelize'][_0xca25('0x45')](function(_0x851a85){if(_0x1a59a4[_0xca25('0x44')][_0xca25('0x46')]===_0xca25('0x47')){_0x1a59a4[_0xca25('0x44')][_0xca25('0x48')]=path['join'](config[_0xca25('0x49')],'server/files/moh',_0x1a59a4[_0xca25('0x44')][_0xca25('0x22')]);}return db[_0xca25('0x24')][_0xca25('0x4a')](_0x1a59a4[_0xca25('0x44')],{'transaction':_0x851a85})[_0xca25('0x1b')](function(_0x34fdf3){if(_0x1a59a4[_0xca25('0x44')][_0xca25('0x46')]===_0xca25('0x47')){fs[_0xca25('0x4b')](_0x34fdf3[_0xca25('0x48')],parseInt(_0xca25('0x4c'),0x8));}var _0xe50320=_0x1a59a4[_0xca25('0x4d')][_0xca25('0x1d')]({'plain':!![]});if(!_0xe50320)throw new Error(_0xca25('0x4e'));if(_0xe50320[_0xca25('0x4f')]==='user'){var _0x413f55=_0x34fdf3[_0xca25('0x1d')]({'plain':!![]});return db[_0xca25('0x50')][_0xca25('0x43')]({'where':{'name':_0xca25('0x1e'),'userProfileId':_0xe50320['userProfileId']},'raw':!![]})[_0xca25('0x1b')](function(_0x733102){if(_0x733102&&_0x733102[_0xca25('0x51')]===0x0){return db[_0xca25('0x1f')][_0xca25('0x4a')]({'name':_0x413f55['name'],'resourceId':_0x413f55['id'],'type':_0x733102[_0xca25('0x22')],'sectionId':_0x733102['id']},{})[_0xca25('0x1b')](function(){return _0x34fdf3;});}else{return _0x34fdf3;}})[_0xca25('0x40')](function(_0x466473){logger[_0xca25('0x21')](_0xca25('0x52'),_0x466473);});}return _0x34fdf3;});})[_0xca25('0x1b')](respondWithResult(_0x2a25ba,0xc9))[_0xca25('0x40')](handleError(_0x2a25ba,null));};exports['destroy']=function(_0xae3b03,_0x33fd51,_0x366ef9){var _0x57cf4d;return db[_0xca25('0x24')][_0xca25('0x43')]({'where':{'id':_0xae3b03['params']['id']}})['then'](function(_0x31bcab){if(_0x31bcab){return db[_0xca25('0x53')]['transaction'](function(_0x39c019){return _0x31bcab[_0xca25('0x1c')]({'transaction':_0x39c019,'raw':!![]})[_0xca25('0x1b')](function(_0x4e4aa4){if(_0x4e4aa4[_0xca25('0x48')]){fs[_0xca25('0x54')](_0x4e4aa4['directory'])['forEach'](function(_0xd58ffa){fs[_0xca25('0x55')](path[_0xca25('0x56')](_0x4e4aa4[_0xca25('0x48')],_0xd58ffa));});fs[_0xca25('0x57')](_0x4e4aa4[_0xca25('0x48')]);}return _0x4e4aa4;});})[_0xca25('0x40')](function(_0x2140b7){throw new db[(_0xca25('0x58'))][(_0xca25('0x59'))](_0x2140b7[_0xca25('0x5a')]);});}})[_0xca25('0x1b')](handleEntityNotFound(_0x33fd51,null))[_0xca25('0x1b')](removeEntity(_0x33fd51,null))[_0xca25('0x40')](handleError(_0x33fd51,null));};exports[_0xca25('0x5b')]=function(_0x38eb9e,_0x4ae1f4,_0x354e98){return db[_0xca25('0x53')][_0xca25('0x45')](function(_0x37933e){var _0x186b64;return db[_0xca25('0x24')][_0xca25('0x43')]({'where':{'id':_0x38eb9e[_0xca25('0x42')]['id']}})[_0xca25('0x1b')](function(_0x10a0b7){if(_0x10a0b7){_0x186b64=_0x10a0b7;return _0x10a0b7[_0xca25('0x5b')](_0x38eb9e['body']['id'],{'transaction':_0x37933e});}})[_0xca25('0x1b')](function(_0x284ed2){if(_0x284ed2){return db[_0xca25('0x5c')][_0xca25('0x5d')]({'where':{'id':_0x38eb9e[_0xca25('0x44')]['id']},'attributes':['id',_0xca25('0x22'),_0xca25('0x5e'),'converted_format',_0xca25('0x5f')],'raw':!![]});}})[_0xca25('0x1b')](function(_0x122a90){if(_0x122a90){var _0x49ba15=path[_0xca25('0x56')](config[_0xca25('0x49')],_0xca25('0x60'),util[_0xca25('0x61')]('%s.%s',path[_0xca25('0x62')](_0x122a90[_0xca25('0x5e')],path['extname'](_0x122a90[_0xca25('0x5e')])),_0x122a90['converted_format']));var _0x385d86=path['join'](config[_0xca25('0x49')],_0xca25('0x63'),_0x186b64[_0xca25('0x22')],util[_0xca25('0x61')](_0xca25('0x64'),_0x122a90[_0xca25('0x22')],_0x122a90['converted_format']));fs[_0xca25('0x65')](_0x49ba15,_0x385d86);return _0x122a90;}})['catch'](function(_0x499fbb){throw new db[(_0xca25('0x58'))][(_0xca25('0x59'))](_0x499fbb[_0xca25('0x5a')]);});})[_0xca25('0x1b')](handleEntityNotFound(_0x4ae1f4,null))[_0xca25('0x1b')](respondWithResult(_0x4ae1f4,0xc9))[_0xca25('0x40')](handleError(_0x4ae1f4,null));};exports[_0xca25('0x66')]=function(_0x27b9fb,_0x2fb13b,_0x14df7f){return db['sequelize']['transaction'](function(_0x56711c){var _0x19014c;return db['VoiceMusicOnHold'][_0xca25('0x5d')]({'where':{'id':_0x27b9fb[_0xca25('0x42')]['id']}})[_0xca25('0x1b')](handleEntityNotFound(_0x2fb13b,null))[_0xca25('0x1b')](function(_0x34dc40){if(_0x34dc40){_0x19014c=_0x34dc40;return _0x34dc40['removeSound'](_0x27b9fb[_0xca25('0x42')]['id2']);}})[_0xca25('0x1b')](function(_0x328eb5){if(_0x328eb5){return db[_0xca25('0x5c')][_0xca25('0x5d')]({'where':{'id':_0x27b9fb[_0xca25('0x42')][_0xca25('0x67')]},'attributes':['id',_0xca25('0x22'),_0xca25('0x5e'),_0xca25('0x68'),_0xca25('0x5f')],'raw':!![]});}})['then'](function(_0x3a7891){if(_0x3a7891){fs['unlinkSync'](path[_0xca25('0x56')](_0x19014c['directory'],util['format']('%s.%s',_0x3a7891['name'],_0x3a7891[_0xca25('0x68')])));return _0x3a7891;}})[_0xca25('0x40')](function(_0x10ab84){throw new db[(_0xca25('0x58'))][(_0xca25('0x59'))](_0x10ab84[_0xca25('0x5a')]);});})[_0xca25('0x1b')](handleEntityNotFound(_0x2fb13b,null))[_0xca25('0x1b')](respondWithStatusCode(_0x2fb13b,0xcc))[_0xca25('0x40')](handleError(_0x2fb13b,null));};exports[_0xca25('0x69')]=function(_0x5a80da,_0x5bcf24,_0x225944){var _0x5a2614={};var _0x128f5f={};var _0xc4f9de;var _0x233a82;return db[_0xca25('0x24')]['findOne']({'where':{'id':_0x5a80da['params']['id']}})[_0xca25('0x1b')](handleEntityNotFound(_0x5bcf24,null))[_0xca25('0x1b')](function(_0x4b9231){if(_0x4b9231){_0xc4f9de=_0x4b9231;_0x128f5f[_0xca25('0x26')]=_[_0xca25('0x27')](db[_0xca25('0x5c')][_0xca25('0x25')]);_0x128f5f['query']=_[_0xca25('0x27')](_0x5a80da[_0xca25('0x28')]);_0x128f5f[_0xca25('0x34')]=_[_0xca25('0x29')](_0x128f5f['model'],_0x128f5f[_0xca25('0x28')]);_0x5a2614[_0xca25('0x2a')]=_[_0xca25('0x29')](_0x128f5f['model'],qs[_0xca25('0x2b')](_0x5a80da[_0xca25('0x28')]['fields']));_0x5a2614['attributes']=_0x5a2614[_0xca25('0x2a')][_0xca25('0x2c')]?_0x5a2614[_0xca25('0x2a')]:_0x128f5f[_0xca25('0x26')];_0x5a2614[_0xca25('0x30')]=qs[_0xca25('0x31')](_0x5a80da[_0xca25('0x28')]['sort']);_0x5a2614[_0xca25('0x32')]=qs['filters'](_['pick'](_0x5a80da[_0xca25('0x28')],_0x128f5f['filters']));if(_0x5a80da['query'][_0xca25('0x35')]){_0x5a2614[_0xca25('0x32')]=_[_0xca25('0x36')](_0x5a2614[_0xca25('0x32')],{'$or':_[_0xca25('0x37')](_0x5a2614[_0xca25('0x2a')],function(_0x1820d8){var _0x213181={};_0x213181[_0x1820d8]={'$like':'%'+_0x5a80da['query']['filter']+'%'};return _0x213181;})});}_0x5a2614=_[_0xca25('0x36')]({},_0x5a2614,_0x5a80da[_0xca25('0x3c')]);return _0xc4f9de[_0xca25('0x69')](_0x5a2614);}})[_0xca25('0x1b')](function(_0x13796e){if(_0x13796e){_0x233a82=_0x13796e[_0xca25('0x2c')];if(!_0x5a80da[_0xca25('0x28')][_0xca25('0x2d')](_0xca25('0x2e'))){_0x5a2614[_0xca25('0x2f')]=qs[_0xca25('0x2f')](_0x5a80da['query'][_0xca25('0x2f')]);_0x5a2614[_0xca25('0x17')]=qs[_0xca25('0x17')](_0x5a80da[_0xca25('0x28')][_0xca25('0x17')]);}return _0xc4f9de[_0xca25('0x69')](_0x5a2614);}})[_0xca25('0x1b')](function(_0x4c8063){if(_0x4c8063){return _0x4c8063?{'count':_0x233a82,'rows':_0x4c8063}:null;}})[_0xca25('0x1b')](respondWithResult(_0x5bcf24,null))[_0xca25('0x40')](handleError(_0x5bcf24,null));};
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
index 32e3626..66d4f15 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0da0=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x0da0,0x1ac));var _0x00da=function(_0x30e285,_0x3a5f8b){_0x30e285=_0x30e285-0x0;var _0x20c72a=_0x0da0[_0x30e285];return _0x20c72a;};'use strict';var _=require(_0x00da('0x0'));var util=require(_0x00da('0x1'));var logger=require(_0x00da('0x2'))(_0x00da('0x3'));var moment=require(_0x00da('0x4'));var BPromise=require(_0x00da('0x5'));var rp=require(_0x00da('0x6'));var fs=require('fs');var path=require(_0x00da('0x7'));var rimraf=require('rimraf');var config=require(_0x00da('0x8'));var attributes=require(_0x00da('0x9'));module[_0x00da('0xa')]=function(_0x40f367,_0x1da7ed){return _0x40f367['define'](_0x00da('0xb'),attributes,{'tableName':_0x00da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1fff=['bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','util','../../config/logger','moment'];(function(_0x137163,_0x1f95eb){var _0x102b59=function(_0x513ddc){while(--_0x513ddc){_0x137163['push'](_0x137163['shift']());}};_0x102b59(++_0x1f95eb);}(_0x1fff,0xbc));var _0xf1ff=function(_0x1c5b96,_0x306f35){_0x1c5b96=_0x1c5b96-0x0;var _0x1f1655=_0x1fff[_0x1c5b96];return _0x1f1655;};'use strict';var _=require(_0xf1ff('0x0'));var util=require(_0xf1ff('0x1'));var logger=require(_0xf1ff('0x2'))('api');var moment=require(_0xf1ff('0x3'));var BPromise=require(_0xf1ff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1ff('0x5'));var rimraf=require(_0xf1ff('0x6'));var config=require(_0xf1ff('0x7'));var attributes=require(_0xf1ff('0x8'));module[_0xf1ff('0x9')]=function(_0x1bb24b,_0x5b2a66){return _0x1bb24b[_0xf1ff('0xa')](_0xf1ff('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
index a5c4899..b13bf47 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x78cb=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3c03c5,_0x36e62e){var _0xd6c224=function(_0x124e0e){while(--_0x124e0e){_0x3c03c5['push'](_0x3c03c5['shift']());}};_0xd6c224(++_0x36e62e);}(_0x78cb,0x1d7));var _0xb78c=function(_0xad6ce9,_0x997b4b){_0xad6ce9=_0xad6ce9-0x0;var _0x1a34de=_0x78cb[_0xad6ce9];return _0x1a34de;};'use strict';var _=require(_0xb78c('0x0'));var util=require('util');var moment=require(_0xb78c('0x1'));var BPromise=require(_0xb78c('0x2'));var rs=require(_0xb78c('0x3'));var fs=require('fs');var Redis=require(_0xb78c('0x4'));var db=require(_0xb78c('0x5'))['db'];var utils=require(_0xb78c('0x6'));var logger=require(_0xb78c('0x7'))(_0xb78c('0x8'));var config=require(_0xb78c('0x9'));var jayson=require(_0xb78c('0xa'));var client=jayson[_0xb78c('0xb')][_0xb78c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x446cf6,_0x446463,_0x58eaec){return new BPromise(function(_0x3adf16,_0x2b18fb){return client[_0xb78c('0xd')](_0x446cf6,_0x58eaec)[_0xb78c('0xe')](function(_0x4517d6){logger[_0xb78c('0xf')](_0xb78c('0x10'),_0x446463,'request\x20sent');logger[_0xb78c('0x11')](_0xb78c('0x12'),_0x446463,_0xb78c('0x13'),JSON[_0xb78c('0x14')](_0x4517d6));if(_0x4517d6[_0xb78c('0x15')]){if(_0x4517d6[_0xb78c('0x15')][_0xb78c('0x16')]===0x1f4){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x446463,_0x4517d6[_0xb78c('0x15')]['message']);return _0x2b18fb(_0x4517d6[_0xb78c('0x15')][_0xb78c('0x17')]);}logger[_0xb78c('0x15')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x446463,_0x4517d6[_0xb78c('0x15')][_0xb78c('0x17')]);return _0x3adf16(_0x4517d6['error']['message']);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x446463,_0xb78c('0x13'));_0x3adf16(_0x4517d6[_0xb78c('0x18')][_0xb78c('0x17')]);}})[_0xb78c('0x19')](function(_0x1df03b){logger[_0xb78c('0x15')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x446463,_0x1df03b);_0x2b18fb(_0x1df03b);});});}
\ No newline at end of file
+var _0x10a7=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x10a7,0xd4));var _0x710a=function(_0x117a6a,_0x433d4a){_0x117a6a=_0x117a6a-0x0;var _0x54eea0=_0x10a7[_0x117a6a];return _0x54eea0;};'use strict';var _=require(_0x710a('0x0'));var util=require(_0x710a('0x1'));var moment=require(_0x710a('0x2'));var BPromise=require(_0x710a('0x3'));var rs=require(_0x710a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x710a('0x5'))['db'];var utils=require(_0x710a('0x6'));var logger=require(_0x710a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x710a('0x8')][_0x710a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5da46a,_0x12c446,_0x485920){return new BPromise(function(_0x3a700f,_0x4dedb7){return client[_0x710a('0xa')](_0x5da46a,_0x485920)[_0x710a('0xb')](function(_0x3841e6){logger[_0x710a('0xc')](_0x710a('0xd'),_0x12c446,_0x710a('0xe'));logger[_0x710a('0xf')](_0x710a('0x10'),_0x12c446,_0x710a('0xe'),JSON[_0x710a('0x11')](_0x3841e6));if(_0x3841e6['error']){if(_0x3841e6[_0x710a('0x12')]['code']===0x1f4){logger[_0x710a('0x12')](_0x710a('0xd'),_0x12c446,_0x3841e6[_0x710a('0x12')]['message']);return _0x4dedb7(_0x3841e6[_0x710a('0x12')][_0x710a('0x13')]);}logger[_0x710a('0x12')](_0x710a('0xd'),_0x12c446,_0x3841e6[_0x710a('0x12')]['message']);return _0x3a700f(_0x3841e6[_0x710a('0x12')][_0x710a('0x13')]);}else{logger[_0x710a('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x12c446,'request\x20sent');_0x3a700f(_0x3841e6['result'][_0x710a('0x13')]);}})[_0x710a('0x14')](function(_0x50ddc1){logger[_0x710a('0x12')](_0x710a('0xd'),_0x12c446,_0x50ddc1);_0x4dedb7(_0x50ddc1);});});}
\ No newline at end of file
diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js
index 28e4274..b76fa31 100644
--- a/server/api/voicePrefix/index.js
+++ b/server/api/voicePrefix/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x50a8=['get','isAuthenticated','index','/describe','/:id','show','/:id/users','post','create','update','delete','destroy','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller'];(function(_0x1fbeaf,_0x256fbd){var _0x13daa3=function(_0x295348){while(--_0x295348){_0x1fbeaf['push'](_0x1fbeaf['shift']());}};_0x13daa3(++_0x256fbd);}(_0x50a8,0x198));var _0x850a=function(_0x1194d1,_0x71821b){_0x1194d1=_0x1194d1-0x0;var _0x24c777=_0x50a8[_0x1194d1];return _0x24c777;};'use strict';var multer=require(_0x850a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x850a('0x1'));var router=express['Router']();var auth=require(_0x850a('0x2'));var interaction=require(_0x850a('0x3'));var config=require(_0x850a('0x4'));var controller=require(_0x850a('0x5'));router[_0x850a('0x6')]('/',auth[_0x850a('0x7')](),controller[_0x850a('0x8')]);router[_0x850a('0x6')](_0x850a('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x850a('0x6')](_0x850a('0xa'),auth[_0x850a('0x7')](),controller[_0x850a('0xb')]);router['get'](_0x850a('0xc'),auth['isAuthenticated'](),controller['getAgents']);router[_0x850a('0xd')]('/',auth[_0x850a('0x7')](),controller[_0x850a('0xe')]);router[_0x850a('0xd')](_0x850a('0xc'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x850a('0xa'),auth['isAuthenticated'](),controller[_0x850a('0xf')]);router[_0x850a('0x10')](_0x850a('0xa'),auth[_0x850a('0x7')](),controller[_0x850a('0x11')]);router['delete'](_0x850a('0xc'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x7e8e=['/:id/users','post','create','put','update','delete','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','index','get','isAuthenticated','describe','/:id','show'];(function(_0x2efc3d,_0x48d0e2){var _0x49b35b=function(_0x23038d){while(--_0x23038d){_0x2efc3d['push'](_0x2efc3d['shift']());}};_0x49b35b(++_0x48d0e2);}(_0x7e8e,0x91));var _0xe7e8=function(_0x4c2d60,_0x92e137){_0x4c2d60=_0x4c2d60-0x0;var _0x29664f=_0x7e8e[_0x4c2d60];return _0x29664f;};'use strict';var multer=require(_0xe7e8('0x0'));var util=require(_0xe7e8('0x1'));var path=require(_0xe7e8('0x2'));var timeout=require(_0xe7e8('0x3'));var express=require(_0xe7e8('0x4'));var router=express[_0xe7e8('0x5')]();var auth=require(_0xe7e8('0x6'));var interaction=require(_0xe7e8('0x7'));var config=require(_0xe7e8('0x8'));var controller=require(_0xe7e8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe7e8('0xa')]);router[_0xe7e8('0xb')]('/describe',auth[_0xe7e8('0xc')](),controller[_0xe7e8('0xd')]);router[_0xe7e8('0xb')](_0xe7e8('0xe'),auth[_0xe7e8('0xc')](),controller[_0xe7e8('0xf')]);router[_0xe7e8('0xb')](_0xe7e8('0x10'),auth[_0xe7e8('0xc')](),controller['getAgents']);router[_0xe7e8('0x11')]('/',auth['isAuthenticated'](),controller[_0xe7e8('0x12')]);router[_0xe7e8('0x11')]('/:id/users',auth[_0xe7e8('0xc')](),controller['addAgents']);router[_0xe7e8('0x13')](_0xe7e8('0xe'),auth[_0xe7e8('0xc')](),controller[_0xe7e8('0x14')]);router['delete'](_0xe7e8('0xe'),auth[_0xe7e8('0xc')](),controller['destroy']);router[_0xe7e8('0x15')](_0xe7e8('0x10'),auth[_0xe7e8('0xc')](),controller[_0xe7e8('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js
index 4327747..8c847c6 100644
--- a/server/api/voicePrefix/voicePrefix.attributes.js
+++ b/server/api/voicePrefix/voicePrefix.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x188d=['name','system-','getDataValue','STRING','INTEGER','sequelize','exports'];(function(_0x1fde72,_0x22eda2){var _0x6d633=function(_0x22775f){while(--_0x22775f){_0x1fde72['push'](_0x1fde72['shift']());}};_0x6d633(++_0x22eda2);}(_0x188d,0x140));var _0xd188=function(_0x24c39a,_0x48fc91){_0x24c39a=_0x24c39a-0x0;var _0x4c2fa6=_0x188d[_0x24c39a];return _0x4c2fa6;};'use strict';var Sequelize=require(_0xd188('0x0'));module[_0xd188('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd188('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x21894c){return _0xd188('0x3')+this[_0xd188('0x4')](_0xd188('0x2'))+'-';}},'description':{'type':Sequelize[_0xd188('0x5')]},'callerIdAll':{'type':Sequelize[_0xd188('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0xd188('0x6')]}};
\ No newline at end of file
+var _0x11a5=['STRING','INTEGER','sequelize','name','VIRTUAL','getDataValue'];(function(_0x43ce2f,_0x44c523){var _0x763bcb=function(_0x404e21){while(--_0x404e21){_0x43ce2f['push'](_0x43ce2f['shift']());}};_0x763bcb(++_0x44c523);}(_0x11a5,0x128));var _0x511a=function(_0x5a75e7,_0x3ad506){_0x5a75e7=_0x5a75e7-0x0;var _0x15c695=_0x11a5[_0x5a75e7];return _0x15c695;};'use strict';var Sequelize=require(_0x511a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x511a('0x1')},'prefix':{'type':Sequelize[_0x511a('0x2')],'get':function(_0x5ba331){return'system-'+this[_0x511a('0x3')](_0x511a('0x1'))+'-';}},'description':{'type':Sequelize[_0x511a('0x4')]},'callerIdAll':{'type':Sequelize[_0x511a('0x4')]},'VoiceExtensionId':{'type':Sequelize[_0x511a('0x5')]}};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js
index cb37cbf..b69523a 100644
--- a/server/api/voicePrefix/voicePrefix.controller.js
+++ b/server/api/voicePrefix/voicePrefix.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe0ae=['VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','map','Extensions\x20creation\x20failed','CDR(prefix)=','callerIdAll','push','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','system-','sequelize','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','end','error','stack','name','index','VoicePrefix','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include','findAll','catch','params','options','find','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection'];(function(_0x50ac27,_0x1306e3){var _0x45f86a=function(_0x512a96){while(--_0x512a96){_0x50ac27['push'](_0x50ac27['shift']());}};_0x45f86a(++_0x1306e3);}(_0xe0ae,0xa1));var _0xee0a=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0xe0ae[_0x3238ea];return _0x4aaac2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xee0a('0x0'));var zipdir=require(_0xee0a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee0a('0x2'));var moment=require('moment');var BPromise=require(_0xee0a('0x3'));var Mustache=require(_0xee0a('0x4'));var util=require('util');var path=require(_0xee0a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xee0a('0x6'));var fs=require('fs');var _=require(_0xee0a('0x7'));var squel=require(_0xee0a('0x8'));var crypto=require(_0xee0a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xee0a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee0a('0xb'));var Redis=require(_0xee0a('0xc'));var authService=require(_0xee0a('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xee0a('0xe'));var logger=require(_0xee0a('0xf'))('api');var utils=require(_0xee0a('0x10'));var config=require('../../config/environment');var db=require(_0xee0a('0x11'))['db'];config[_0xee0a('0x12')]=_['defaults'](config[_0xee0a('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0xee0a('0x13'))(new Redis(config[_0xee0a('0x12')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x325a8e,_0x41b70a){_0x41b70a=_0x41b70a||0xcc;return function(_0x347604){if(_0x347604){return _0x325a8e[_0xee0a('0x14')](_0x41b70a);}return _0x325a8e[_0xee0a('0x15')](_0x41b70a)['end']();};}function respondWithResult(_0xb891a9,_0xd39431){_0xd39431=_0xd39431||0xc8;return function(_0x50063f){if(_0x50063f){return _0xb891a9[_0xee0a('0x15')](_0xd39431)[_0xee0a('0x16')](_0x50063f);}};}function respondWithFilteredResult(_0x1bc8e1,_0x198b61){return function(_0x4f711b){if(_0x4f711b){var _0x3114b2=_0x4f711b[_0xee0a('0x17')],_0x1d7a8a=_0x198b61[_0xee0a('0x18')],_0x14ef67=_0x198b61[_0xee0a('0x18')]+_0x198b61[_0xee0a('0x19')],_0x55c474;if(_0x14ef67>=_0x3114b2){_0x14ef67=_0x3114b2;_0x55c474=0xc8;}else{_0x55c474=0xce;}_0x1bc8e1['status'](_0x55c474);return _0x1bc8e1[_0xee0a('0x1a')](_0xee0a('0x1b'),_0x1d7a8a+'-'+_0x14ef67+'/'+_0x3114b2)[_0xee0a('0x16')](_0x4f711b);}return null;};}function patchUpdates(_0x201d32){return function(_0x5c981e){try{jsonpatch[_0xee0a('0x1c')](_0x5c981e,_0x201d32,!![]);}catch(_0xff2f14){return BPromise[_0xee0a('0x1d')](_0xff2f14);}return _0x5c981e[_0xee0a('0x1e')]();};}function saveUpdates(_0x39fa96,_0x1eb176){return function(_0x2c543c){if(_0x2c543c){return _0x2c543c['update'](_0x39fa96)[_0xee0a('0x1f')](function(_0x3d5459){return _0x3d5459;});}return null;};}function removeEntity(_0x27989c,_0x38d029){return function(_0x567810){if(_0x567810){return _0x567810[_0xee0a('0x20')]()[_0xee0a('0x1f')](function(){var _0x1fe1a3=_0x567810[_0xee0a('0x21')]({'plain':!![]});var _0x4c61e2='VoicePrefixes';return db['UserProfileResource'][_0xee0a('0x20')]({'where':{'type':_0x4c61e2,'resourceId':_0x1fe1a3['id']}})['then'](function(){return _0x567810;});})['then'](function(){_0x27989c[_0xee0a('0x15')](0xcc)[_0xee0a('0x22')]();});}};}function handleEntityNotFound(_0xe5365f,_0x50d415){return function(_0x3c3d48){if(!_0x3c3d48){_0xe5365f[_0xee0a('0x14')](0x194);}return _0x3c3d48;};}function handleError(_0x15b1c0,_0x30d1f1){_0x30d1f1=_0x30d1f1||0x1f4;return function(_0x2e7f18){logger[_0xee0a('0x23')](_0x2e7f18[_0xee0a('0x24')]);if(_0x2e7f18[_0xee0a('0x25')]){delete _0x2e7f18[_0xee0a('0x25')];}_0x15b1c0[_0xee0a('0x15')](_0x30d1f1)['send'](_0x2e7f18);};}exports[_0xee0a('0x26')]=function(_0x1a97e0,_0x284be5){var _0x34569c={},_0x45feeb={},_0x3faad3={'count':0x0,'rows':[]};var _0x4cf1df=db[_0xee0a('0x27')][_0xee0a('0x28')];_0x45feeb[_0xee0a('0x29')]=_[_0xee0a('0x2a')](_0x4cf1df);_0x45feeb['query']=_[_0xee0a('0x2a')](_0x1a97e0['query']);_0x45feeb[_0xee0a('0x2b')]=_[_0xee0a('0x2c')](_0x45feeb[_0xee0a('0x29')],_0x45feeb[_0xee0a('0x2d')]);_0x34569c[_0xee0a('0x2e')]=_[_0xee0a('0x2c')](_0x45feeb[_0xee0a('0x29')],qs[_0xee0a('0x2f')](_0x1a97e0['query'][_0xee0a('0x2f')]));_0x34569c[_0xee0a('0x2e')]=_0x34569c['attributes'][_0xee0a('0x30')]?_0x34569c[_0xee0a('0x2e')]:_0x45feeb[_0xee0a('0x29')];if(!_0x1a97e0['query'][_0xee0a('0x31')](_0xee0a('0x32'))){_0x34569c[_0xee0a('0x19')]=qs['limit'](_0x1a97e0[_0xee0a('0x2d')][_0xee0a('0x19')]);_0x34569c[_0xee0a('0x18')]=qs['offset'](_0x1a97e0['query'][_0xee0a('0x18')]);}_0x34569c[_0xee0a('0x33')]=qs[_0xee0a('0x34')](_0x1a97e0[_0xee0a('0x2d')][_0xee0a('0x34')]);_0x34569c[_0xee0a('0x35')]=qs[_0xee0a('0x2b')](_[_0xee0a('0x36')](_0x1a97e0[_0xee0a('0x2d')],_0x45feeb['filters']));if(_0x1a97e0[_0xee0a('0x2d')][_0xee0a('0x37')]){_0x34569c['where']=_[_0xee0a('0x38')](_0x34569c[_0xee0a('0x35')],{'$or':_['map'](_0x4cf1df,function(_0x2fdf87){if(_0x2fdf87[_0xee0a('0x39')][_0xee0a('0x3a')]!==_0xee0a('0x3b')){var _0x10f9ac={};_0x10f9ac[_0x2fdf87[_0xee0a('0x3c')]]={'$like':'%'+_0x1a97e0[_0xee0a('0x2d')][_0xee0a('0x37')]+'%'};return _0x10f9ac;}})});}_0x34569c=_[_0xee0a('0x38')]({},_0x34569c,_0x1a97e0['options']);var _0x429eca={'where':_0x34569c[_0xee0a('0x35')]};return db[_0xee0a('0x27')][_0xee0a('0x17')](_0x429eca)['then'](function(_0x4857ea){_0x3faad3[_0xee0a('0x17')]=_0x4857ea;if(_0x1a97e0[_0xee0a('0x2d')][_0xee0a('0x3d')]){_0x34569c[_0xee0a('0x3e')]=[{'all':!![]}];}return db[_0xee0a('0x27')][_0xee0a('0x3f')](_0x34569c);})[_0xee0a('0x1f')](function(_0x4c398c){_0x3faad3['rows']=_0x4c398c;return _0x3faad3;})[_0xee0a('0x1f')](respondWithFilteredResult(_0x284be5,_0x34569c))[_0xee0a('0x40')](handleError(_0x284be5,null));};exports['show']=function(_0x3293b5,_0x9cd98d){var _0x5f2071={'raw':![],'where':{'id':_0x3293b5[_0xee0a('0x41')]['id']}},_0x140783={};_0x140783[_0xee0a('0x29')]=_[_0xee0a('0x2a')](db[_0xee0a('0x27')][_0xee0a('0x28')]);_0x140783[_0xee0a('0x2d')]=_['keys'](_0x3293b5['query']);_0x140783[_0xee0a('0x2b')]=_['intersection'](_0x140783['model'],_0x140783['query']);_0x5f2071[_0xee0a('0x2e')]=_[_0xee0a('0x2c')](_0x140783['model'],qs['fields'](_0x3293b5['query']['fields']));_0x5f2071[_0xee0a('0x2e')]=_0x5f2071[_0xee0a('0x2e')][_0xee0a('0x30')]?_0x5f2071[_0xee0a('0x2e')]:_0x140783[_0xee0a('0x29')];if(_0x3293b5[_0xee0a('0x2d')]['includeAll']){_0x5f2071[_0xee0a('0x3e')]=[{'all':!![]}];}_0x5f2071=_['merge']({},_0x5f2071,_0x3293b5[_0xee0a('0x42')]);return db[_0xee0a('0x27')][_0xee0a('0x43')](_0x5f2071)[_0xee0a('0x1f')](handleEntityNotFound(_0x9cd98d,null))['then'](respondWithResult(_0x9cd98d,null))[_0xee0a('0x40')](handleError(_0x9cd98d,null));};exports[_0xee0a('0x20')]=function(_0x290940,_0x12e47f){return db[_0xee0a('0x27')][_0xee0a('0x43')]({'where':{'id':_0x290940[_0xee0a('0x41')]['id']}})['then'](handleEntityNotFound(_0x12e47f,null))['then'](removeEntity(_0x12e47f,null))[_0xee0a('0x40')](handleError(_0x12e47f,null));};exports[_0xee0a('0x44')]=function(_0x1936c8,_0x4590b8){return db[_0xee0a('0x27')][_0xee0a('0x44')]()[_0xee0a('0x1f')](respondWithResult(_0x4590b8,null))[_0xee0a('0x40')](handleError(_0x4590b8,null));};exports[_0xee0a('0x45')]=function(_0x364766,_0x3fdd2e){var _0x335356;return db['sequelize'][_0xee0a('0x46')](function(_0x33fee4){return db[_0xee0a('0x27')][_0xee0a('0x45')](_0x364766[_0xee0a('0x47')],{'transaction':_0x33fee4})['then'](function(_0xc053b5){_0x335356=_0xc053b5[_0xee0a('0x21')]({'plain':!![]});return db[_0xee0a('0x48')][_0xee0a('0x43')]({'where':{'id':_0x335356[_0xee0a('0x49')]},'raw':!![]})['then'](function(_0x1cd43f){return createVoicePrefixExtensions(_0x335356,_0x1cd43f,_0x33fee4);});});})[_0xee0a('0x1f')](function(){var _0x176201=_0x364766[_0xee0a('0x4a')][_0xee0a('0x21')]({'plain':!![]});if(!_0x176201)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x176201[_0xee0a('0x4b')]===_0xee0a('0x4a')){var _0x1dc00d=_0x335356;return db[_0xee0a('0x4c')][_0xee0a('0x43')]({'where':{'name':_0xee0a('0x4d'),'userProfileId':_0x176201[_0xee0a('0x4e')]},'raw':!![]})[_0xee0a('0x1f')](function(_0x407d00){if(_0x407d00&&_0x407d00[_0xee0a('0x4f')]===0x0){return db[_0xee0a('0x50')][_0xee0a('0x45')]({'name':_0x1dc00d[_0xee0a('0x25')],'resourceId':_0x1dc00d['id'],'type':_0x407d00[_0xee0a('0x25')],'sectionId':_0x407d00['id']},{})[_0xee0a('0x1f')](function(){return _0x335356;});}else{return _0x335356;}})[_0xee0a('0x40')](function(_0x3e4ed5){logger[_0xee0a('0x23')](_0xee0a('0x51'),_0x3e4ed5);throw _0x3e4ed5;});}return _0x335356;})[_0xee0a('0x1f')](respondWithResult(_0x3fdd2e,null))[_0xee0a('0x40')](handleError(_0x3fdd2e,null));};function Extension(_0x3abf82,_0x509c7e,_0x51b1a8,_0x59a52a){this[_0xee0a('0x52')]='from-sip';this[_0xee0a('0x53')]=_0x3abf82;this[_0xee0a('0x54')]=_0x51b1a8;this[_0xee0a('0x39')]=_0xee0a('0x55');this['description']=_0xee0a('0x56');this[_0xee0a('0x57')]=_0x509c7e;this[_0xee0a('0x58')]=_0x59a52a;}function createVoicePrefixExtensions(_0x1d6398,_0x301f69,_0x99e2b0){return new BPromise(function(_0xf576ea,_0x3c9456){var _0x101c8e=new Extension(formatPrefixName(_0x1d6398[_0xee0a('0x59')]),0x1,_0xee0a('0x5a'),_0xee0a('0x5b'));_0x101c8e[_0xee0a('0x5c')]=_0x1d6398['id'];return db[_0xee0a('0x48')]['create'](_0x101c8e,{'transaction':_0x99e2b0})[_0xee0a('0x1f')](function(_0x5cb68f){var _0x2dcfc5=_0x5cb68f[_0xee0a('0x21')]({'plain':!![]});var _0x4a5197=_[_0xee0a('0x5d')](addVoicePrefixExtensions(_0x1d6398,_0x301f69),function(_0x501baa){_0x501baa[_0xee0a('0x49')]=_0x2dcfc5['id'];_0x501baa['VoicePrefixId']=_0x1d6398['id'];return _0x501baa;});return db['VoiceExtension']['bulkCreate'](_0x4a5197,{'transaction':_0x99e2b0})[_0xee0a('0x1f')](function(_0x368e77){if(!_0x368e77){return _0x3c9456(_0xee0a('0x5e'));}else{return _0xf576ea(_0x368e77);}})[_0xee0a('0x40')](function(_0x14e1f1){return _0x3c9456(_0x14e1f1);});});;});};function addVoicePrefixExtensions(_0x45919b,_0x44ac69){var _0xe583e5=[];var _0x5c05dc=formatPrefixName(_0x45919b[_0xee0a('0x59')]);_0xe583e5['push'](new Extension(_0x5c05dc,0x2,'Set',_0xee0a('0x5f')+_0x45919b[_0xee0a('0x25')]));if(_0x45919b[_0xee0a('0x60')]){_0xe583e5[_0xee0a('0x61')](new Extension(_0x5c05dc,0x3,_0xee0a('0x62'),_0xee0a('0x63')+_0x45919b[_0xee0a('0x60')]));}else{_0xe583e5[_0xee0a('0x61')](new Extension(_0x5c05dc,0x3,'NoOp',_0xee0a('0x64')));}_0xe583e5['push'](new Extension(_0x5c05dc,0x4,_0xee0a('0x65'),_0x44ac69[_0xee0a('0x52')]+','+_0xee0a('0x66')+(0x8+_0x45919b[_0xee0a('0x25')][_0xee0a('0x30')])+'}'+','+0x1));return _0xe583e5;}function formatPrefixName(_0x2c7bba){var _0x56fcc8='_';for(var _0x25e37c=0x0;_0x25e37c<_0x2c7bba[_0xee0a('0x30')];_0x25e37c++){if(_0x2c7bba[_0xee0a('0x67')](_0x25e37c)=='-'){_0x56fcc8+=_0x2c7bba['charAt'](_0x25e37c);}else{_0x56fcc8+='['+_0x2c7bba[_0xee0a('0x67')](_0x25e37c)+']';}}_0x56fcc8+='.';return _0x56fcc8;}exports[_0xee0a('0x68')]=function(_0x4d5c5b,_0x46e0b1,_0x4b76b9){var _0x491ea3=_0x4d5c5b['body'];_0x491ea3['prefix']=_0xee0a('0x69')+_0x491ea3['name']+'-';return db[_0xee0a('0x6a')]['transaction'](function(_0x318c5a){return db[_0xee0a('0x27')][_0xee0a('0x68')](_0x491ea3,{'where':{'id':_0x491ea3['id']},'transaction':_0x318c5a})[_0xee0a('0x1f')](function(){return db['VoiceExtension'][_0xee0a('0x20')]({'where':{'VoicePrefixId':_0x491ea3['id']},'transaction':_0x318c5a})[_0xee0a('0x1f')](function(){return db[_0xee0a('0x48')][_0xee0a('0x43')]({'where':{'id':_0x491ea3[_0xee0a('0x49')]},'raw':!![]})['then'](function(_0x10aeda){return createVoicePrefixExtensions(_0x491ea3,_0x10aeda,_0x318c5a);});});});})[_0xee0a('0x1f')](function(){return db[_0xee0a('0x27')]['findById'](_0x491ea3['id']);})[_0xee0a('0x1f')](respondWithResult(_0x46e0b1,null))[_0xee0a('0x40')](handleError(_0x46e0b1,null));};exports['addAgents']=function(_0x122c18,_0x3d78ac,_0x3f701d){return db[_0xee0a('0x27')][_0xee0a('0x43')]({'where':{'id':_0x122c18[_0xee0a('0x41')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x3d78ac,null))[_0xee0a('0x1f')](function(_0x55e141){if(_0x55e141){return _0x55e141[_0xee0a('0x6b')](_0x122c18[_0xee0a('0x47')][_0xee0a('0x6c')],_[_0xee0a('0x6d')](_0x122c18[_0xee0a('0x47')],[_0xee0a('0x6c'),'id'])||{})[_0xee0a('0x6e')](function(_0x58e951){for(var _0x3752cc=0x0;_0x3752cc<_0x122c18[_0xee0a('0x47')][_0xee0a('0x6c')][_0xee0a('0x30')];_0x3752cc+=0x1){socket['emit'](_0xee0a('0x6f'),{'UserId':_0x122c18[_0xee0a('0x47')][_0xee0a('0x6c')][_0x3752cc],'VoicePrefixId':_0x122c18[_0xee0a('0x41')]['id']});}return _0x58e951;});}})[_0xee0a('0x1f')](respondWithResult(_0x3d78ac,null))['catch'](handleError(_0x3d78ac,null));};exports['removeAgents']=function(_0x357bc0,_0x11ffbb,_0x2a3eaf){return db['VoicePrefix'][_0xee0a('0x43')]({'where':{'id':_0x357bc0[_0xee0a('0x41')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x11ffbb,null))[_0xee0a('0x1f')](function(_0x118592){if(_0x118592){return _0x118592[_0xee0a('0x70')](_0x357bc0[_0xee0a('0x2d')][_0xee0a('0x6c')])['then'](function(){if(_[_0xee0a('0x71')](_0x357bc0[_0xee0a('0x2d')][_0xee0a('0x6c')])){for(var _0x2f3324=0x0;_0x2f3324<_0x357bc0[_0xee0a('0x2d')]['ids'][_0xee0a('0x30')];_0x2f3324+=0x1){socket[_0xee0a('0x72')](_0xee0a('0x73'),{'UserId':Number(_0x357bc0[_0xee0a('0x2d')][_0xee0a('0x6c')][_0x2f3324]),'VoicePrefixId':Number(_0x357bc0['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x357bc0['query'][_0xee0a('0x6c')]),'VoicePrefixId':Number(_0x357bc0['params']['id'])});}});}})[_0xee0a('0x1f')](respondWithStatusCode(_0x11ffbb,null))[_0xee0a('0x40')](handleError(_0x11ffbb,null));};exports['getAgents']=function(_0x1dacee,_0x59dd8b,_0xaf2aac){var _0x5750bb={};var _0x1f9f9e={};var _0x1c6713;var _0x527470;return db[_0xee0a('0x27')][_0xee0a('0x74')]({'where':{'id':_0x1dacee[_0xee0a('0x41')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x59dd8b,null))['then'](function(_0x1baba3){if(_0x1baba3){_0x1c6713=_0x1baba3;_0x1f9f9e[_0xee0a('0x29')]=_[_0xee0a('0x2a')](db[_0xee0a('0x75')][_0xee0a('0x28')]);_0x1f9f9e[_0xee0a('0x2d')]=_['keys'](_0x1dacee[_0xee0a('0x2d')]);_0x1f9f9e[_0xee0a('0x2b')]=_[_0xee0a('0x2c')](_0x1f9f9e[_0xee0a('0x29')],_0x1f9f9e[_0xee0a('0x2d')]);_0x5750bb[_0xee0a('0x2e')]=_['intersection'](_0x1f9f9e[_0xee0a('0x29')],qs[_0xee0a('0x2f')](_0x1dacee[_0xee0a('0x2d')][_0xee0a('0x2f')]));_0x5750bb[_0xee0a('0x2e')]=_0x5750bb[_0xee0a('0x2e')]['length']?_0x5750bb[_0xee0a('0x2e')]:_0x1f9f9e[_0xee0a('0x29')];_0x5750bb[_0xee0a('0x33')]=qs[_0xee0a('0x34')](_0x1dacee[_0xee0a('0x2d')][_0xee0a('0x34')]);_0x5750bb[_0xee0a('0x35')]=qs[_0xee0a('0x2b')](_[_0xee0a('0x36')](_0x1dacee[_0xee0a('0x2d')],_0x1f9f9e[_0xee0a('0x2b')]));if(_0x1dacee[_0xee0a('0x2d')][_0xee0a('0x37')]){_0x5750bb[_0xee0a('0x35')]=_[_0xee0a('0x38')](_0x5750bb['where'],{'$or':_[_0xee0a('0x5d')](_0x5750bb[_0xee0a('0x2e')],function(_0x5529b7){var _0x16641b={};_0x16641b[_0x5529b7]={'$like':'%'+_0x1dacee[_0xee0a('0x2d')]['filter']+'%'};return _0x16641b;})});}_0x5750bb=_['merge']({},_0x5750bb,_0x1dacee[_0xee0a('0x42')]);return _0x1c6713['getAgents'](_0x5750bb);}})[_0xee0a('0x1f')](function(_0x375cea){if(_0x375cea){_0x527470=_0x375cea['length'];if(!_0x1dacee[_0xee0a('0x2d')][_0xee0a('0x31')](_0xee0a('0x32'))){_0x5750bb[_0xee0a('0x19')]=qs[_0xee0a('0x19')](_0x1dacee['query'][_0xee0a('0x19')]);_0x5750bb[_0xee0a('0x18')]=qs[_0xee0a('0x18')](_0x1dacee[_0xee0a('0x2d')][_0xee0a('0x18')]);}return _0x1c6713[_0xee0a('0x76')](_0x5750bb);}})[_0xee0a('0x1f')](function(_0x2f9b13){if(_0x2f9b13){return _0x2f9b13?{'count':_0x527470,'rows':_0x2f9b13}:null;}})[_0xee0a('0x1f')](respondWithResult(_0x59dd8b,null))[_0xee0a('0x40')](handleError(_0x59dd8b,null));};
\ No newline at end of file
+var _0x0b78=['order','sort','where','filter','merge','map','type','key','field','options','VoicePrefix','includeAll','include','rows','show','params','length','find','catch','describe','create','transaction','VoiceExtension','VoiceExtensionId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','charAt','system-','update','findById','addAgents','ids','body','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit'];(function(_0x5b2974,_0x116c8f){var _0x5b304b=function(_0x4f689e){while(--_0x4f689e){_0x5b2974['push'](_0x5b2974['shift']());}};_0x5b304b(++_0x116c8f);}(_0x0b78,0x1ad));var _0x80b7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0b78[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x80b7('0x0'));var emlformat=require(_0x80b7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x80b7('0x2'));var jsonpatch=require(_0x80b7('0x3'));var rp=require('request-promise');var moment=require(_0x80b7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x80b7('0x5'));var util=require(_0x80b7('0x6'));var path=require(_0x80b7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x80b7('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x80b7('0x9'));var crypto=require(_0x80b7('0xa'));var jsforce=require(_0x80b7('0xb'));var deskjs=require(_0x80b7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x80b7('0xd'));var Papa=require(_0x80b7('0xe'));var Redis=require(_0x80b7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x80b7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80b7('0x11'))(_0x80b7('0x12'));var utils=require(_0x80b7('0x13'));var config=require(_0x80b7('0x14'));var db=require(_0x80b7('0x15'))['db'];config[_0x80b7('0x16')]=_[_0x80b7('0x17')](config[_0x80b7('0x16')],{'host':_0x80b7('0x18'),'port':0x18eb});var socket=require(_0x80b7('0x19'))(new Redis(config[_0x80b7('0x16')]));require('./voicePrefix.socket')[_0x80b7('0x1a')](socket);function respondWithStatusCode(_0x401ad3,_0x527c5b){_0x527c5b=_0x527c5b||0xcc;return function(_0x2ee168){if(_0x2ee168){return _0x401ad3[_0x80b7('0x1b')](_0x527c5b);}return _0x401ad3['status'](_0x527c5b)[_0x80b7('0x1c')]();};}function respondWithResult(_0x3b6b13,_0x21ea65){_0x21ea65=_0x21ea65||0xc8;return function(_0x2c0c4e){if(_0x2c0c4e){return _0x3b6b13[_0x80b7('0x1d')](_0x21ea65)[_0x80b7('0x1e')](_0x2c0c4e);}};}function respondWithFilteredResult(_0x1e3d1c,_0x974b08){return function(_0x2d4008){if(_0x2d4008){var _0x34299c=_0x2d4008[_0x80b7('0x1f')],_0x4c12b1=_0x974b08[_0x80b7('0x20')],_0x3bb691=_0x974b08['offset']+_0x974b08['limit'],_0x1d62ed;if(_0x3bb691>=_0x34299c){_0x3bb691=_0x34299c;_0x1d62ed=0xc8;}else{_0x1d62ed=0xce;}_0x1e3d1c[_0x80b7('0x1d')](_0x1d62ed);return _0x1e3d1c[_0x80b7('0x21')](_0x80b7('0x22'),_0x4c12b1+'-'+_0x3bb691+'/'+_0x34299c)[_0x80b7('0x1e')](_0x2d4008);}return null;};}function patchUpdates(_0x574e5c){return function(_0x4f6eec){try{jsonpatch[_0x80b7('0x23')](_0x4f6eec,_0x574e5c,!![]);}catch(_0x3aed77){return BPromise[_0x80b7('0x24')](_0x3aed77);}return _0x4f6eec[_0x80b7('0x25')]();};}function saveUpdates(_0x527d0f,_0x18d407){return function(_0x4c3bed){if(_0x4c3bed){return _0x4c3bed['update'](_0x527d0f)[_0x80b7('0x26')](function(_0xdab5e0){return _0xdab5e0;});}return null;};}function removeEntity(_0x65d31d,_0x155c00){return function(_0x3f3aa5){if(_0x3f3aa5){return _0x3f3aa5[_0x80b7('0x27')]()[_0x80b7('0x26')](function(){var _0x8fa95e=_0x3f3aa5[_0x80b7('0x28')]({'plain':!![]});var _0x1e751a=_0x80b7('0x29');return db[_0x80b7('0x2a')][_0x80b7('0x27')]({'where':{'type':_0x1e751a,'resourceId':_0x8fa95e['id']}})[_0x80b7('0x26')](function(){return _0x3f3aa5;});})[_0x80b7('0x26')](function(){_0x65d31d['status'](0xcc)[_0x80b7('0x1c')]();});}};}function handleEntityNotFound(_0x1661be,_0x5e3f6f){return function(_0x370bfb){if(!_0x370bfb){_0x1661be[_0x80b7('0x1b')](0x194);}return _0x370bfb;};}function handleError(_0x17d845,_0x5497e2){_0x5497e2=_0x5497e2||0x1f4;return function(_0x1b7715){logger[_0x80b7('0x2b')](_0x1b7715[_0x80b7('0x2c')]);if(_0x1b7715[_0x80b7('0x2d')]){delete _0x1b7715[_0x80b7('0x2d')];}_0x17d845[_0x80b7('0x1d')](_0x5497e2)[_0x80b7('0x2e')](_0x1b7715);};}exports[_0x80b7('0x2f')]=function(_0x3fbdf3,_0x940c7a){var _0x3fb3da={},_0x44c3ec={},_0xf35e83={'count':0x0,'rows':[]};var _0x4ae8ad=db['VoicePrefix'][_0x80b7('0x30')];_0x44c3ec[_0x80b7('0x31')]=_['keys'](_0x4ae8ad);_0x44c3ec['query']=_[_0x80b7('0x32')](_0x3fbdf3[_0x80b7('0x33')]);_0x44c3ec[_0x80b7('0x34')]=_[_0x80b7('0x35')](_0x44c3ec[_0x80b7('0x31')],_0x44c3ec[_0x80b7('0x33')]);_0x3fb3da['attributes']=_[_0x80b7('0x35')](_0x44c3ec[_0x80b7('0x31')],qs[_0x80b7('0x36')](_0x3fbdf3[_0x80b7('0x33')]['fields']));_0x3fb3da[_0x80b7('0x37')]=_0x3fb3da[_0x80b7('0x37')]['length']?_0x3fb3da[_0x80b7('0x37')]:_0x44c3ec[_0x80b7('0x31')];if(!_0x3fbdf3[_0x80b7('0x33')][_0x80b7('0x38')](_0x80b7('0x39'))){_0x3fb3da[_0x80b7('0x3a')]=qs[_0x80b7('0x3a')](_0x3fbdf3[_0x80b7('0x33')]['limit']);_0x3fb3da['offset']=qs['offset'](_0x3fbdf3[_0x80b7('0x33')][_0x80b7('0x20')]);}_0x3fb3da[_0x80b7('0x3b')]=qs[_0x80b7('0x3c')](_0x3fbdf3[_0x80b7('0x33')][_0x80b7('0x3c')]);_0x3fb3da[_0x80b7('0x3d')]=qs[_0x80b7('0x34')](_['pick'](_0x3fbdf3[_0x80b7('0x33')],_0x44c3ec[_0x80b7('0x34')]));if(_0x3fbdf3[_0x80b7('0x33')][_0x80b7('0x3e')]){_0x3fb3da[_0x80b7('0x3d')]=_[_0x80b7('0x3f')](_0x3fb3da['where'],{'$or':_[_0x80b7('0x40')](_0x4ae8ad,function(_0x53f51c){if(_0x53f51c[_0x80b7('0x41')][_0x80b7('0x42')]!=='VIRTUAL'){var _0x5566f9={};_0x5566f9[_0x53f51c[_0x80b7('0x43')]]={'$like':'%'+_0x3fbdf3['query']['filter']+'%'};return _0x5566f9;}})});}_0x3fb3da=_[_0x80b7('0x3f')]({},_0x3fb3da,_0x3fbdf3[_0x80b7('0x44')]);var _0x58fb35={'where':_0x3fb3da[_0x80b7('0x3d')]};return db[_0x80b7('0x45')]['count'](_0x58fb35)['then'](function(_0x2fdd6d){_0xf35e83[_0x80b7('0x1f')]=_0x2fdd6d;if(_0x3fbdf3[_0x80b7('0x33')][_0x80b7('0x46')]){_0x3fb3da[_0x80b7('0x47')]=[{'all':!![]}];}return db[_0x80b7('0x45')]['findAll'](_0x3fb3da);})[_0x80b7('0x26')](function(_0x46f4e9){_0xf35e83[_0x80b7('0x48')]=_0x46f4e9;return _0xf35e83;})[_0x80b7('0x26')](respondWithFilteredResult(_0x940c7a,_0x3fb3da))['catch'](handleError(_0x940c7a,null));};exports[_0x80b7('0x49')]=function(_0x5741ec,_0x382fd7){var _0x199c29={'raw':![],'where':{'id':_0x5741ec[_0x80b7('0x4a')]['id']}},_0x16250b={};_0x16250b[_0x80b7('0x31')]=_[_0x80b7('0x32')](db[_0x80b7('0x45')][_0x80b7('0x30')]);_0x16250b[_0x80b7('0x33')]=_[_0x80b7('0x32')](_0x5741ec[_0x80b7('0x33')]);_0x16250b[_0x80b7('0x34')]=_[_0x80b7('0x35')](_0x16250b['model'],_0x16250b[_0x80b7('0x33')]);_0x199c29[_0x80b7('0x37')]=_['intersection'](_0x16250b[_0x80b7('0x31')],qs['fields'](_0x5741ec['query'][_0x80b7('0x36')]));_0x199c29['attributes']=_0x199c29['attributes'][_0x80b7('0x4b')]?_0x199c29[_0x80b7('0x37')]:_0x16250b['model'];if(_0x5741ec[_0x80b7('0x33')][_0x80b7('0x46')]){_0x199c29[_0x80b7('0x47')]=[{'all':!![]}];}_0x199c29=_['merge']({},_0x199c29,_0x5741ec[_0x80b7('0x44')]);return db[_0x80b7('0x45')][_0x80b7('0x4c')](_0x199c29)[_0x80b7('0x26')](handleEntityNotFound(_0x382fd7,null))['then'](respondWithResult(_0x382fd7,null))['catch'](handleError(_0x382fd7,null));};exports['destroy']=function(_0x1ee2f9,_0x5c33b5){return db[_0x80b7('0x45')][_0x80b7('0x4c')]({'where':{'id':_0x1ee2f9[_0x80b7('0x4a')]['id']}})[_0x80b7('0x26')](handleEntityNotFound(_0x5c33b5,null))[_0x80b7('0x26')](removeEntity(_0x5c33b5,null))[_0x80b7('0x4d')](handleError(_0x5c33b5,null));};exports['describe']=function(_0x588bab,_0x25afd7){return db[_0x80b7('0x45')][_0x80b7('0x4e')]()[_0x80b7('0x26')](respondWithResult(_0x25afd7,null))[_0x80b7('0x4d')](handleError(_0x25afd7,null));};exports[_0x80b7('0x4f')]=function(_0x5936d6,_0x4546de){var _0x36e5a5;return db['sequelize'][_0x80b7('0x50')](function(_0x40b524){return db[_0x80b7('0x45')]['create'](_0x5936d6['body'],{'transaction':_0x40b524})[_0x80b7('0x26')](function(_0x66202){_0x36e5a5=_0x66202[_0x80b7('0x28')]({'plain':!![]});return db[_0x80b7('0x51')][_0x80b7('0x4c')]({'where':{'id':_0x36e5a5[_0x80b7('0x52')]},'raw':!![]})['then'](function(_0x1b81a2){return createVoicePrefixExtensions(_0x36e5a5,_0x1b81a2,_0x40b524);});});})[_0x80b7('0x26')](function(){var _0xeece0a=_0x5936d6[_0x80b7('0x53')][_0x80b7('0x28')]({'plain':!![]});if(!_0xeece0a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xeece0a['role']===_0x80b7('0x53')){var _0x2129d3=_0x36e5a5;return db[_0x80b7('0x54')]['find']({'where':{'name':_0x80b7('0x29'),'userProfileId':_0xeece0a['userProfileId']},'raw':!![]})[_0x80b7('0x26')](function(_0xc02413){if(_0xc02413&&_0xc02413[_0x80b7('0x55')]===0x0){return db[_0x80b7('0x2a')][_0x80b7('0x4f')]({'name':_0x2129d3[_0x80b7('0x2d')],'resourceId':_0x2129d3['id'],'type':_0xc02413[_0x80b7('0x2d')],'sectionId':_0xc02413['id']},{})[_0x80b7('0x26')](function(){return _0x36e5a5;});}else{return _0x36e5a5;}})[_0x80b7('0x4d')](function(_0x4f2588){logger[_0x80b7('0x2b')](_0x80b7('0x56'),_0x4f2588);throw _0x4f2588;});}return _0x36e5a5;})[_0x80b7('0x26')](respondWithResult(_0x4546de,null))[_0x80b7('0x4d')](handleError(_0x4546de,null));};function Extension(_0x5215f1,_0x42c810,_0x2a9fb2,_0x317c3f){this[_0x80b7('0x57')]=_0x80b7('0x58');this[_0x80b7('0x59')]=_0x5215f1;this[_0x80b7('0x5a')]=_0x2a9fb2;this['type']=_0x80b7('0x5b');this[_0x80b7('0x5c')]=_0x80b7('0x5d');this[_0x80b7('0x5e')]=_0x42c810;this['appdata']=_0x317c3f;}function createVoicePrefixExtensions(_0x3dff62,_0x3d7769,_0x4c041b){return new BPromise(function(_0x275509,_0x220114){var _0x5eea20=new Extension(formatPrefixName(_0x3dff62[_0x80b7('0x5f')]),0x1,_0x80b7('0x60'),'Voice\x20Prefix');_0x5eea20['VoicePrefixId']=_0x3dff62['id'];return db[_0x80b7('0x51')]['create'](_0x5eea20,{'transaction':_0x4c041b})[_0x80b7('0x26')](function(_0x2c2005){var _0x57d361=_0x2c2005[_0x80b7('0x28')]({'plain':!![]});var _0x151939=_['map'](addVoicePrefixExtensions(_0x3dff62,_0x3d7769),function(_0x33c86c){_0x33c86c[_0x80b7('0x52')]=_0x57d361['id'];_0x33c86c[_0x80b7('0x61')]=_0x3dff62['id'];return _0x33c86c;});return db[_0x80b7('0x51')][_0x80b7('0x62')](_0x151939,{'transaction':_0x4c041b})[_0x80b7('0x26')](function(_0x222466){if(!_0x222466){return _0x220114(_0x80b7('0x63'));}else{return _0x275509(_0x222466);}})[_0x80b7('0x4d')](function(_0x5f255e){return _0x220114(_0x5f255e);});});;});};function addVoicePrefixExtensions(_0x4c0d12,_0x6d7c1e){var _0x4dcbf7=[];var _0x24f889=formatPrefixName(_0x4c0d12[_0x80b7('0x5f')]);_0x4dcbf7[_0x80b7('0x64')](new Extension(_0x24f889,0x2,'Set',_0x80b7('0x65')+_0x4c0d12[_0x80b7('0x2d')]));if(_0x4c0d12['callerIdAll']){_0x4dcbf7[_0x80b7('0x64')](new Extension(_0x24f889,0x3,_0x80b7('0x66'),_0x80b7('0x67')+_0x4c0d12[_0x80b7('0x68')]));}else{_0x4dcbf7['push'](new Extension(_0x24f889,0x3,'NoOp',_0x80b7('0x69')));}_0x4dcbf7[_0x80b7('0x64')](new Extension(_0x24f889,0x4,_0x80b7('0x6a'),_0x6d7c1e['context']+','+'${EXTEN:'+(0x8+_0x4c0d12[_0x80b7('0x2d')][_0x80b7('0x4b')])+'}'+','+0x1));return _0x4dcbf7;}function formatPrefixName(_0x16bb46){var _0x5c3324='_';for(var _0x33b76f=0x0;_0x33b76f<_0x16bb46[_0x80b7('0x4b')];_0x33b76f++){if(_0x16bb46[_0x80b7('0x6b')](_0x33b76f)=='-'){_0x5c3324+=_0x16bb46[_0x80b7('0x6b')](_0x33b76f);}else{_0x5c3324+='['+_0x16bb46['charAt'](_0x33b76f)+']';}}_0x5c3324+='.';return _0x5c3324;}exports['update']=function(_0x32257f,_0x3615df,_0x5a3bb8){var _0x5cf1df=_0x32257f['body'];_0x5cf1df['prefix']=_0x80b7('0x6c')+_0x5cf1df['name']+'-';return db['sequelize'][_0x80b7('0x50')](function(_0x215308){return db[_0x80b7('0x45')][_0x80b7('0x6d')](_0x5cf1df,{'where':{'id':_0x5cf1df['id']},'transaction':_0x215308})[_0x80b7('0x26')](function(){return db[_0x80b7('0x51')][_0x80b7('0x27')]({'where':{'VoicePrefixId':_0x5cf1df['id']},'transaction':_0x215308})[_0x80b7('0x26')](function(){return db[_0x80b7('0x51')]['find']({'where':{'id':_0x5cf1df['VoiceExtensionId']},'raw':!![]})['then'](function(_0x3fe3c3){return createVoicePrefixExtensions(_0x5cf1df,_0x3fe3c3,_0x215308);});});});})[_0x80b7('0x26')](function(){return db[_0x80b7('0x45')][_0x80b7('0x6e')](_0x5cf1df['id']);})['then'](respondWithResult(_0x3615df,null))[_0x80b7('0x4d')](handleError(_0x3615df,null));};exports[_0x80b7('0x6f')]=function(_0x51a86a,_0x4ee23b,_0x4ac8fb){return db[_0x80b7('0x45')][_0x80b7('0x4c')]({'where':{'id':_0x51a86a['params']['id']}})[_0x80b7('0x26')](handleEntityNotFound(_0x4ee23b,null))['then'](function(_0x5b1fef){if(_0x5b1fef){return _0x5b1fef['addAgents'](_0x51a86a['body']['ids'],_['omit'](_0x51a86a['body'],[_0x80b7('0x70'),'id'])||{})['spread'](function(_0x3d0469){for(var _0x57b55e=0x0;_0x57b55e<_0x51a86a[_0x80b7('0x71')][_0x80b7('0x70')][_0x80b7('0x4b')];_0x57b55e+=0x1){socket['emit'](_0x80b7('0x72'),{'UserId':_0x51a86a[_0x80b7('0x71')]['ids'][_0x57b55e],'VoicePrefixId':_0x51a86a[_0x80b7('0x4a')]['id']});}return _0x3d0469;});}})[_0x80b7('0x26')](respondWithResult(_0x4ee23b,null))['catch'](handleError(_0x4ee23b,null));};exports[_0x80b7('0x73')]=function(_0x2292b7,_0x476880,_0x5896e9){return db[_0x80b7('0x45')]['find']({'where':{'id':_0x2292b7['params']['id']}})['then'](handleEntityNotFound(_0x476880,null))[_0x80b7('0x26')](function(_0x531232){if(_0x531232){return _0x531232['removeAgents'](_0x2292b7[_0x80b7('0x33')][_0x80b7('0x70')])[_0x80b7('0x26')](function(){if(_[_0x80b7('0x74')](_0x2292b7[_0x80b7('0x33')][_0x80b7('0x70')])){for(var _0x3cc421=0x0;_0x3cc421<_0x2292b7[_0x80b7('0x33')][_0x80b7('0x70')][_0x80b7('0x4b')];_0x3cc421+=0x1){socket[_0x80b7('0x75')](_0x80b7('0x76'),{'UserId':Number(_0x2292b7['query'][_0x80b7('0x70')][_0x3cc421]),'VoicePrefixId':Number(_0x2292b7[_0x80b7('0x4a')]['id'])});}}else{socket[_0x80b7('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x2292b7[_0x80b7('0x33')][_0x80b7('0x70')]),'VoicePrefixId':Number(_0x2292b7[_0x80b7('0x4a')]['id'])});}});}})[_0x80b7('0x26')](respondWithStatusCode(_0x476880,null))[_0x80b7('0x4d')](handleError(_0x476880,null));};exports[_0x80b7('0x77')]=function(_0x3c94e6,_0x34aa0f,_0x53ebf4){var _0x224806={};var _0x2239df={};var _0x242954;var _0x5e7846;return db['VoicePrefix'][_0x80b7('0x78')]({'where':{'id':_0x3c94e6[_0x80b7('0x4a')]['id']}})[_0x80b7('0x26')](handleEntityNotFound(_0x34aa0f,null))[_0x80b7('0x26')](function(_0x56d823){if(_0x56d823){_0x242954=_0x56d823;_0x2239df[_0x80b7('0x31')]=_[_0x80b7('0x32')](db[_0x80b7('0x79')][_0x80b7('0x30')]);_0x2239df['query']=_[_0x80b7('0x32')](_0x3c94e6[_0x80b7('0x33')]);_0x2239df[_0x80b7('0x34')]=_['intersection'](_0x2239df[_0x80b7('0x31')],_0x2239df[_0x80b7('0x33')]);_0x224806[_0x80b7('0x37')]=_[_0x80b7('0x35')](_0x2239df[_0x80b7('0x31')],qs[_0x80b7('0x36')](_0x3c94e6['query'][_0x80b7('0x36')]));_0x224806[_0x80b7('0x37')]=_0x224806[_0x80b7('0x37')]['length']?_0x224806[_0x80b7('0x37')]:_0x2239df[_0x80b7('0x31')];_0x224806[_0x80b7('0x3b')]=qs[_0x80b7('0x3c')](_0x3c94e6[_0x80b7('0x33')]['sort']);_0x224806[_0x80b7('0x3d')]=qs[_0x80b7('0x34')](_['pick'](_0x3c94e6[_0x80b7('0x33')],_0x2239df['filters']));if(_0x3c94e6[_0x80b7('0x33')]['filter']){_0x224806[_0x80b7('0x3d')]=_[_0x80b7('0x3f')](_0x224806['where'],{'$or':_[_0x80b7('0x40')](_0x224806[_0x80b7('0x37')],function(_0x41a7cc){var _0xfcd79b={};_0xfcd79b[_0x41a7cc]={'$like':'%'+_0x3c94e6[_0x80b7('0x33')]['filter']+'%'};return _0xfcd79b;})});}_0x224806=_['merge']({},_0x224806,_0x3c94e6['options']);return _0x242954[_0x80b7('0x77')](_0x224806);}})[_0x80b7('0x26')](function(_0x50e258){if(_0x50e258){_0x5e7846=_0x50e258['length'];if(!_0x3c94e6[_0x80b7('0x33')][_0x80b7('0x38')](_0x80b7('0x39'))){_0x224806[_0x80b7('0x3a')]=qs[_0x80b7('0x3a')](_0x3c94e6[_0x80b7('0x33')][_0x80b7('0x3a')]);_0x224806['offset']=qs[_0x80b7('0x20')](_0x3c94e6[_0x80b7('0x33')][_0x80b7('0x20')]);}return _0x242954[_0x80b7('0x77')](_0x224806);}})[_0x80b7('0x26')](function(_0x75a296){if(_0x75a296){return _0x75a296?{'count':_0x5e7846,'rows':_0x75a296}:null;}})[_0x80b7('0x26')](respondWithResult(_0x34aa0f,null))[_0x80b7('0x4d')](handleError(_0x34aa0f,null));};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js
index c24dfa9..3ff9c9a 100644
--- a/server/api/voicePrefix/voicePrefix.events.js
+++ b/server/api/voicePrefix/voicePrefix.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcca7=['../../mysqldb','VoicePrefix','setMaxListeners','remove','emit','hasOwnProperty','events'];(function(_0x132889,_0x2207a8){var _0xd93752=function(_0x572faa){while(--_0x572faa){_0x132889['push'](_0x132889['shift']());}};_0xd93752(++_0x2207a8);}(_0xcca7,0x1aa));var _0x7cca=function(_0x80e6b6,_0x480dc8){_0x80e6b6=_0x80e6b6-0x0;var _0x402f71=_0xcca7[_0x80e6b6];return _0x402f71;};'use strict';var EventEmitter=require(_0x7cca('0x0'));var VoicePrefix=require(_0x7cca('0x1'))['db'][_0x7cca('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7cca('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7cca('0x4')};function emitEvent(_0x533b00){return function(_0x3b86a4,_0x9523f7,_0x2126f7){VoicePrefixEvents[_0x7cca('0x5')](_0x533b00+':'+_0x3b86a4['id'],_0x3b86a4);VoicePrefixEvents[_0x7cca('0x5')](_0x533b00,_0x3b86a4);_0x2126f7(null);};}for(var e in events){if(events[_0x7cca('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
+var _0xbd50=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','save'];(function(_0x1402e2,_0x5eccdb){var _0xb6112d=function(_0x74c9e5){while(--_0x74c9e5){_0x1402e2['push'](_0x1402e2['shift']());}};_0xb6112d(++_0x5eccdb);}(_0xbd50,0x196));var _0x0bd5=function(_0x2e1946,_0x491df7){_0x2e1946=_0x2e1946-0x0;var _0x51a593=_0xbd50[_0x2e1946];return _0x51a593;};'use strict';var EventEmitter=require(_0x0bd5('0x0'));var VoicePrefix=require(_0x0bd5('0x1'))['db'][_0x0bd5('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0bd5('0x3'),'afterUpdate':_0x0bd5('0x4'),'afterDestroy':_0x0bd5('0x5')};function emitEvent(_0x1e9877){return function(_0x15620d,_0x4c17ee,_0x558e89){VoicePrefixEvents['emit'](_0x1e9877+':'+_0x15620d['id'],_0x15620d);VoicePrefixEvents[_0x0bd5('0x6')](_0x1e9877,_0x15620d);_0x558e89(null);};}for(var e in events){if(events[_0x0bd5('0x7')](e)){var event=events[e];VoicePrefix[_0x0bd5('0x8')](e,emitEvent(event));}}module[_0x0bd5('0x9')]=VoicePrefixEvents;
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js
index 0deafc1..001137c 100644
--- a/server/api/voicePrefix/voicePrefix.model.js
+++ b/server/api/voicePrefix/voicePrefix.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0419=['request-promise','path','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment'];(function(_0x389cda,_0x31155c){var _0x5889bc=function(_0x32f473){while(--_0x32f473){_0x389cda['push'](_0x389cda['shift']());}};_0x5889bc(++_0x31155c);}(_0x0419,0xe5));var _0x9041=function(_0x85f077,_0x362348){_0x85f077=_0x85f077-0x0;var _0x37f55d=_0x0419[_0x85f077];return _0x37f55d;};'use strict';var _=require(_0x9041('0x0'));var util=require(_0x9041('0x1'));var logger=require(_0x9041('0x2'))(_0x9041('0x3'));var moment=require(_0x9041('0x4'));var BPromise=require('bluebird');var rp=require(_0x9041('0x5'));var fs=require('fs');var path=require(_0x9041('0x6'));var rimraf=require('rimraf');var config=require(_0x9041('0x7'));var attributes=require(_0x9041('0x8'));module[_0x9041('0x9')]=function(_0xc8a0ad,_0x49f26b){return _0xc8a0ad[_0x9041('0xa')](_0x9041('0xb'),attributes,{'tableName':_0x9041('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9bca=['VoicePrefix','voice_prefixes','lodash','util','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x522050,_0x3d6191){var _0x5a65ec=function(_0x14c0f8){while(--_0x14c0f8){_0x522050['push'](_0x522050['shift']());}};_0x5a65ec(++_0x3d6191);}(_0x9bca,0x1c4));var _0xa9bc=function(_0xda5614,_0x4f2ca7){_0xda5614=_0xda5614-0x0;var _0x17e044=_0x9bca[_0xda5614];return _0x17e044;};'use strict';var _=require(_0xa9bc('0x0'));var util=require(_0xa9bc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa9bc('0x2'));var BPromise=require('bluebird');var rp=require(_0xa9bc('0x3'));var fs=require('fs');var path=require(_0xa9bc('0x4'));var rimraf=require(_0xa9bc('0x5'));var config=require(_0xa9bc('0x6'));var attributes=require('./voicePrefix.attributes');module[_0xa9bc('0x7')]=function(_0x5d5b20,_0x5cbe68){return _0x5d5b20['define'](_0xa9bc('0x8'),attributes,{'tableName':_0xa9bc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js
index 0b81884..776cb59 100644
--- a/server/api/voicePrefix/voicePrefix.rpc.js
+++ b/server/api/voicePrefix/voicePrefix.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb866=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2387bc,_0x2caed2){var _0x58c250=function(_0x9441e6){while(--_0x9441e6){_0x2387bc['push'](_0x2387bc['shift']());}};_0x58c250(++_0x2caed2);}(_0xb866,0x1d5));var _0x6b86=function(_0x1b02bd,_0x3ae7f2){_0x1b02bd=_0x1b02bd-0x0;var _0x368901=_0xb866[_0x1b02bd];return _0x368901;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6b86('0x0'));var BPromise=require('bluebird');var rs=require(_0x6b86('0x1'));var fs=require('fs');var Redis=require(_0x6b86('0x2'));var db=require(_0x6b86('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b86('0x4'))(_0x6b86('0x5'));var config=require(_0x6b86('0x6'));var jayson=require(_0x6b86('0x7'));var client=jayson[_0x6b86('0x8')][_0x6b86('0x9')]({'port':0x232a});config[_0x6b86('0xa')]=_[_0x6b86('0xb')](config[_0x6b86('0xa')],{'host':_0x6b86('0xc'),'port':0x18eb});var socket=require(_0x6b86('0xd'))(new Redis(config[_0x6b86('0xa')]));require(_0x6b86('0xe'))['register'](socket);function respondWithRpcPromise(_0x53e9ab,_0x48724b,_0x1cb7c1){return new BPromise(function(_0x3e4ed9,_0x392dfe){return client[_0x6b86('0xf')](_0x53e9ab,_0x1cb7c1)['then'](function(_0x18da85){logger[_0x6b86('0x10')](_0x6b86('0x11'),_0x48724b,'request\x20sent');logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x48724b,_0x6b86('0x12'),JSON[_0x6b86('0x13')](_0x18da85));if(_0x18da85[_0x6b86('0x14')]){if(_0x18da85['error'][_0x6b86('0x15')]===0x1f4){logger['error'](_0x6b86('0x11'),_0x48724b,_0x18da85[_0x6b86('0x14')][_0x6b86('0x16')]);return _0x392dfe(_0x18da85[_0x6b86('0x14')][_0x6b86('0x16')]);}logger[_0x6b86('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x48724b,_0x18da85['error']['message']);return _0x3e4ed9(_0x18da85[_0x6b86('0x14')][_0x6b86('0x16')]);}else{logger[_0x6b86('0x10')](_0x6b86('0x11'),_0x48724b,_0x6b86('0x12'));_0x3e4ed9(_0x18da85[_0x6b86('0x17')]['message']);}})[_0x6b86('0x18')](function(_0xcaf5fb){logger[_0x6b86('0x14')](_0x6b86('0x11'),_0x48724b,_0xcaf5fb);_0x392dfe(_0xcaf5fb);});});}
\ No newline at end of file
+var _0x1195=['VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request'];(function(_0x18bf72,_0x1da52){var _0x3bc765=function(_0x34cbb7){while(--_0x34cbb7){_0x18bf72['push'](_0x18bf72['shift']());}};_0x3bc765(++_0x1da52);}(_0x1195,0x136));var _0x5119=function(_0x38de33,_0x4361bb){_0x38de33=_0x38de33-0x0;var _0x40f16d=_0x1195[_0x38de33];return _0x40f16d;};'use strict';var _=require('lodash');var util=require(_0x5119('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5119('0x1'));var fs=require('fs');var Redis=require(_0x5119('0x2'));var db=require(_0x5119('0x3'))['db'];var utils=require(_0x5119('0x4'));var logger=require(_0x5119('0x5'))(_0x5119('0x6'));var config=require('../../config/environment');var jayson=require(_0x5119('0x7'));var client=jayson[_0x5119('0x8')][_0x5119('0x9')]({'port':0x232a});config[_0x5119('0xa')]=_[_0x5119('0xb')](config[_0x5119('0xa')],{'host':_0x5119('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')[_0x5119('0xd')](socket);function respondWithRpcPromise(_0x2c48ad,_0x2375de,_0xc3ba9a){return new BPromise(function(_0x5b0e14,_0x4fe1ee){return client[_0x5119('0xe')](_0x2c48ad,_0xc3ba9a)['then'](function(_0x22e855){logger['info'](_0x5119('0xf'),_0x2375de,'request\x20sent');logger[_0x5119('0x10')](_0x5119('0x11'),_0x2375de,_0x5119('0x12'),JSON[_0x5119('0x13')](_0x22e855));if(_0x22e855[_0x5119('0x14')]){if(_0x22e855[_0x5119('0x14')][_0x5119('0x15')]===0x1f4){logger[_0x5119('0x14')](_0x5119('0xf'),_0x2375de,_0x22e855[_0x5119('0x14')][_0x5119('0x16')]);return _0x4fe1ee(_0x22e855[_0x5119('0x14')]['message']);}logger['error'](_0x5119('0xf'),_0x2375de,_0x22e855['error'][_0x5119('0x16')]);return _0x5b0e14(_0x22e855[_0x5119('0x14')]['message']);}else{logger[_0x5119('0x17')](_0x5119('0xf'),_0x2375de,_0x5119('0x12'));_0x5b0e14(_0x22e855['result'][_0x5119('0x16')]);}})[_0x5119('0x18')](function(_0xe4b545){logger[_0x5119('0x14')](_0x5119('0xf'),_0x2375de,_0xe4b545);_0x4fe1ee(_0xe4b545);});});}
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js
index 255e2a4..54a50fe 100644
--- a/server/api/voicePrefix/voicePrefix.socket.js
+++ b/server/api/voicePrefix/voicePrefix.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x979b=['voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','length'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x979b,0x1c9));var _0xb979=function(_0x223c0d,_0x3ec04d){_0x223c0d=_0x223c0d-0x0;var _0x207827=_0x979b[_0x223c0d];return _0x207827;};'use strict';var VoicePrefixEvents=require(_0xb979('0x0'));var events=[_0xb979('0x1'),_0xb979('0x2'),_0xb979('0x3')];function createListener(_0x5bef4d,_0x122884){return function(_0x5aa7e1){_0x122884[_0xb979('0x4')](_0x5bef4d,_0x5aa7e1);};}function removeListener(_0x1b8154,_0xb81e52){return function(){VoicePrefixEvents[_0xb979('0x5')](_0x1b8154,_0xb81e52);};}exports['register']=function(_0x1db7a6){for(var _0x1a71e1=0x0,_0x57f045=events[_0xb979('0x6')];_0x1a71e1<_0x57f045;_0x1a71e1++){var _0x21fee0=events[_0x1a71e1];var _0x1ec814=createListener(_0xb979('0x7')+_0x21fee0,_0x1db7a6);VoicePrefixEvents['on'](_0x21fee0,_0x1ec814);}};
\ No newline at end of file
+var _0x612c=['./voicePrefix.events','save','update','emit','register'];(function(_0x2bd1ec,_0x3fe65f){var _0x2f7577=function(_0x5234fb){while(--_0x5234fb){_0x2bd1ec['push'](_0x2bd1ec['shift']());}};_0x2f7577(++_0x3fe65f);}(_0x612c,0x186));var _0xc612=function(_0x195e35,_0x5c1890){_0x195e35=_0x195e35-0x0;var _0xfd0a74=_0x612c[_0x195e35];return _0xfd0a74;};'use strict';var VoicePrefixEvents=require(_0xc612('0x0'));var events=[_0xc612('0x1'),'remove',_0xc612('0x2')];function createListener(_0x1ba255,_0x231101){return function(_0x198996){_0x231101[_0xc612('0x3')](_0x1ba255,_0x198996);};}function removeListener(_0x3380fd,_0x3cfc3e){return function(){VoicePrefixEvents['removeListener'](_0x3380fd,_0x3cfc3e);};}exports[_0xc612('0x4')]=function(_0x212c51){for(var _0x32a75d=0x0,_0x10155d=events['length'];_0x32a75d<_0x10155d;_0x32a75d++){var _0x3b8fcd=events[_0x32a75d];var _0x4389f7=createListener('voicePrefix:'+_0x3b8fcd,_0x212c51);VoicePrefixEvents['on'](_0x3b8fcd,_0x4389f7);}};
\ No newline at end of file
diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js
index 84e1445..7c5100a 100644
--- a/server/api/voiceQueue/index.js
+++ b/server/api/voiceQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2a0=['index','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/teams','addTeams','addAgents','addLists','addBlackLists','put','update','delete','destroy','removeTeams','removeLists','removeBlackLists','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get'];(function(_0xbb24fe,_0x2365ad){var _0x2f372e=function(_0x319098){while(--_0x319098){_0xbb24fe['push'](_0xbb24fe['shift']());}};_0x2f372e(++_0x2365ad);}(_0xf2a0,0x7e));var _0x0f2a=function(_0x52dd39,_0xdb90a5){_0x52dd39=_0x52dd39-0x0;var _0x1d4076=_0xf2a0[_0x52dd39];return _0x1d4076;};'use strict';var multer=require('multer');var util=require(_0x0f2a('0x0'));var path=require(_0x0f2a('0x1'));var timeout=require(_0x0f2a('0x2'));var express=require('express');var router=express[_0x0f2a('0x3')]();var auth=require(_0x0f2a('0x4'));var interaction=require(_0x0f2a('0x5'));var config=require(_0x0f2a('0x6'));var controller=require(_0x0f2a('0x7'));router[_0x0f2a('0x8')]('/',auth['isAuthenticated'](),controller[_0x0f2a('0x9')]);router['get'](_0x0f2a('0xa'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0xc')]);router[_0x0f2a('0x8')]('/:id/hoppers',auth[_0x0f2a('0xb')](),controller[_0x0f2a('0xd')]);router[_0x0f2a('0x8')](_0x0f2a('0xe'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0xf')]);router[_0x0f2a('0x8')](_0x0f2a('0x10'),auth['isAuthenticated'](),controller[_0x0f2a('0x11')]);router[_0x0f2a('0x8')](_0x0f2a('0x12'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x0f2a('0x8')]('/:id/teams',auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x13')]);router['get'](_0x0f2a('0x14'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x15')]);router['get'](_0x0f2a('0x16'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x17')]);router[_0x0f2a('0x8')](_0x0f2a('0x18'),auth['isAuthenticated'](),controller[_0x0f2a('0x19')]);router[_0x0f2a('0x8')](_0x0f2a('0x1a'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x1b')]);router[_0x0f2a('0x1c')]('/',auth['isAuthenticated'](),controller[_0x0f2a('0x1d')]);router[_0x0f2a('0x1c')](_0x0f2a('0x1e'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x1f')]);router[_0x0f2a('0x1c')](_0x0f2a('0x20'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x21')]);router[_0x0f2a('0x1c')](_0x0f2a('0x14'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x22')]);router['post'](_0x0f2a('0x18'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x23')]);router[_0x0f2a('0x1c')](_0x0f2a('0x1a'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x24')]);router[_0x0f2a('0x25')](_0x0f2a('0xa'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x26')]);router[_0x0f2a('0x27')](_0x0f2a('0xa'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x28')]);router[_0x0f2a('0x27')](_0x0f2a('0x20'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x29')]);router[_0x0f2a('0x27')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router[_0x0f2a('0x27')](_0x0f2a('0x18'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x2a')]);router[_0x0f2a('0x27')](_0x0f2a('0x1a'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x2b')]);module[_0x0f2a('0x2c')]=router;
\ No newline at end of file
+var _0xe615=['/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','isAuthenticated','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','/:id/blacklists','create','post','clone','addTeams','/:id/lists','addBlackLists','put','/:id','update','delete','destroy','removeLists','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe615,0xb9));var _0x5e61=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0xe615[_0x3ab353];return _0x1e2285;};'use strict';var multer=require(_0x5e61('0x0'));var util=require(_0x5e61('0x1'));var path=require('path');var timeout=require(_0x5e61('0x2'));var express=require(_0x5e61('0x3'));var router=express['Router']();var auth=require(_0x5e61('0x4'));var interaction=require(_0x5e61('0x5'));var config=require(_0x5e61('0x6'));var controller=require(_0x5e61('0x7'));router[_0x5e61('0x8')]('/',auth['isAuthenticated'](),controller[_0x5e61('0x9')]);router[_0x5e61('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5e61('0x8')](_0x5e61('0xa'),auth['isAuthenticated'](),controller[_0x5e61('0xb')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x5e61('0xc')]);router[_0x5e61('0x8')](_0x5e61('0xd'),auth['isAuthenticated'](),controller[_0x5e61('0xe')]);router['get'](_0x5e61('0xf'),auth['isAuthenticated'](),controller[_0x5e61('0x10')]);router[_0x5e61('0x8')](_0x5e61('0x11'),auth[_0x5e61('0x12')](),controller[_0x5e61('0x13')]);router[_0x5e61('0x8')](_0x5e61('0x14'),auth[_0x5e61('0x12')](),controller[_0x5e61('0x15')]);router[_0x5e61('0x8')](_0x5e61('0x16'),auth[_0x5e61('0x12')](),controller[_0x5e61('0x17')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0x5e61('0x18')]);router[_0x5e61('0x8')](_0x5e61('0x19'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0x5e61('0x1a')]);router[_0x5e61('0x1b')]('/:id/clone',auth[_0x5e61('0x12')](),controller[_0x5e61('0x1c')]);router[_0x5e61('0x1b')]('/:id/teams',auth[_0x5e61('0x12')](),controller[_0x5e61('0x1d')]);router[_0x5e61('0x1b')](_0x5e61('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0x5e61('0x1b')](_0x5e61('0x1e'),auth[_0x5e61('0x12')](),controller['addLists']);router[_0x5e61('0x1b')](_0x5e61('0x19'),auth['isAuthenticated'](),controller[_0x5e61('0x1f')]);router[_0x5e61('0x20')](_0x5e61('0x21'),auth[_0x5e61('0x12')](),controller[_0x5e61('0x22')]);router[_0x5e61('0x23')](_0x5e61('0x21'),auth[_0x5e61('0x12')](),controller[_0x5e61('0x24')]);router[_0x5e61('0x23')](_0x5e61('0x11'),auth[_0x5e61('0x12')](),controller['removeTeams']);router[_0x5e61('0x23')]('/:id/users',auth[_0x5e61('0x12')](),controller['removeAgents']);router['delete'](_0x5e61('0x1e'),auth[_0x5e61('0x12')](),controller[_0x5e61('0x25')]);router['delete'](_0x5e61('0x19'),auth[_0x5e61('0x12')](),controller['removeBlackLists']);module[_0x5e61('0x26')]=router;
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js
index 4930a7b..d623de9 100644
--- a/server/api/voiceQueue/voiceQueue.attributes.js
+++ b/server/api/voiceQueue/voiceQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd0f=['INTEGER','yes','all','once','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#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\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','default','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','booked','roundrobin','predictive'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x3e40d4,_0x13173a){_0x3e40d4=_0x3e40d4-0x0;var _0x49d47a=_0xfd0f[_0x3e40d4];return _0x49d47a;};'use strict';var Sequelize=require(_0xffd0('0x0'));module[_0xffd0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xffd0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xffd0('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xffd0('0x5')},'announce':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0xffd0('0x3')]('rr',_0xffd0('0x7'),_0xffd0('0x8'),_0xffd0('0x9'),_0xffd0('0xa'),_0xffd0('0xb'),_0xffd0('0xc'),'wrandom',_0xffd0('0xd')),'allowNull':![],'defaultValue':_0xffd0('0x7'),'set':function(_0x1b3842){this[_0xffd0('0xe')]('strategy',_0x1b3842?_0x1b3842:'rrmemory');},'get':function(){var _0x2c343c=this[_0xffd0('0xf')](_0xffd0('0x10'));var _0x4d36ba=this['getDataValue'](_0xffd0('0x11'));var _0x4edae9=this['getDataValue'](_0xffd0('0x12'));if(_0x2c343c===_0xffd0('0x4')){return _0x4edae9;}if(_0x4d36ba===_0xffd0('0x13')&&_0x4edae9==='rrmemory'||_0x4d36ba===_0xffd0('0x13')&&_0x4edae9===_0xffd0('0x14')){return _0x4edae9;}if(_0x4d36ba==='progressive'||_0x4d36ba===_0xffd0('0x15')||_0x4d36ba==='power'){return _0x4edae9;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xffd0('0x6')]},'weight':{'type':Sequelize[_0xffd0('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xffd0('0x17')},'autopause':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no',_0xffd0('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xffd0('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xffd0('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xffd0('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xffd0('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':_0xffd0('0x17')},'announce_holdtime':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no',_0xffd0('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0xffd0('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xffd0('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xffd0('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xffd0('0x6')]},'queue_quantity1':{'type':Sequelize[_0xffd0('0x6')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xffd0('0x6')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x56f39a){this[_0xffd0('0xe')](_0xffd0('0x1a'),_0x56f39a?_0x56f39a[_0xffd0('0x1b')](','):[]);},'get':function(){return this[_0xffd0('0xf')](_0xffd0('0x1a'))?this[_0xffd0('0xf')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xffd0('0x17'),'set':function(_0x5bb7f1){this[_0xffd0('0xe')](_0xffd0('0x1c'),_0x5bb7f1?_0x5bb7f1['join'](','):[]);},'get':function(){return this[_0xffd0('0xf')]('joinempty')?this['getDataValue']('joinempty')[_0xffd0('0x1d')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':'no','set':function(_0x25f6ad){this[_0xffd0('0xe')](_0xffd0('0x1e'),_0x25f6ad?_0x25f6ad['join'](','):[]);},'get':function(){return this[_0xffd0('0xf')](_0xffd0('0x1e'))?this['getDataValue'](_0xffd0('0x1e'))[_0xffd0('0x1d')](','):[];}},'reportholdtime':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xffd0('0x6')]},'acw':{'type':Sequelize[_0xffd0('0x1f')],'defaultValue':0x0,'set':function(_0x49e076){this[_0xffd0('0xe')](_0xffd0('0x20'),_0x49e076);if(_0x49e076){if(this['getDataValue'](_0xffd0('0x21'))<0x2){this['setDataValue'](_0xffd0('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xffd0('0x22')},'dialMethod':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x23'),_0xffd0('0x24'),_0xffd0('0x25'),_0xffd0('0x15'),_0xffd0('0x13')),'defaultValue':_0xffd0('0x24'),'comment':_0xffd0('0x26')},'dialLimitChannel':{'type':Sequelize[_0xffd0('0x16')](0x4)[_0xffd0('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xffd0('0x28')},'dialLimitQueue':{'type':Sequelize[_0xffd0('0x16')](0x4)[_0xffd0('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xffd0('0x29')},'dialPowerLevel':{'type':Sequelize[_0xffd0('0x2a')](0x2)[_0xffd0('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x2b'),_0xffd0('0x2c')),'defaultValue':_0xffd0('0x2c'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xffd0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xffd0('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xffd0('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xffd0('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd0('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':_0xffd0('0x2f'),'comment':_0xffd0('0x30')},'dialQueueTimeout':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd0('0x31')},'dialQueueProject':{'type':Sequelize[_0xffd0('0x6')],'comment':_0xffd0('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd0('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xffd0('0x16')](0x5)[_0xffd0('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffd0('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xffd0('0x16')](0x5)[_0xffd0('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffd0('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x3,'comment':_0xffd0('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xffd0('0x16')](0x5)[_0xffd0('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffd0('0x37')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xffd0('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xffd0('0x38')},'dialTimezone':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':_0xffd0('0x39')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xffd0('0x3a'),_0xffd0('0x3b')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xffd0('0x1f')],'defaultValue':0x0,'comment':_0xffd0('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0xffd0('0x16')](0x9)[_0xffd0('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xffd0('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0xffd0('0x16')](0x9)[_0xffd0('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xffd0('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xffd0('0x16')](0x9)[_0xffd0('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xffd0('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xffd0('0x16')](0x9)[_0xffd0('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xffd0('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xffd0('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xffd0('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xffd0('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xffd0('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xffd0('0x42')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xffd0('0x16')](0x5)[_0xffd0('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xffd0('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0xffd0('0x16')](0x5)[_0xffd0('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xffd0('0x44')},'dialRecallInQueue':{'type':Sequelize[_0xffd0('0x1f')],'defaultValue':0x0,'comment':_0xffd0('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x46'),_0xffd0('0x47')),'defaultValue':_0xffd0('0x46')},'dialQueueProject2':{'type':Sequelize[_0xffd0('0x6')],'comment':_0xffd0('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xffd0('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xffd0('0x48')},'dialCutDigit':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xffd0('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xffd0('0x4a')},'mandatoryDisposition':{'type':Sequelize[_0xffd0('0x1f')],'defaultValue':![],'comment':_0xffd0('0x4b'),'set':function(_0x25e029){if(!_0x25e029)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xffd0('0x4c'),_0x25e029);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0x7a0e=['setDataValue','getDataValue','type','dialMethod','strategy','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','exports','STRING','name','ENUM','outbound','inbound','default','ringall','random','rrmemory','linear','wrandom','rrordered'];(function(_0x4fb0d8,_0x319fb6){var _0x24eb91=function(_0x294409){while(--_0x294409){_0x4fb0d8['push'](_0x4fb0d8['shift']());}};_0x24eb91(++_0x319fb6);}(_0x7a0e,0x113));var _0xe7a0=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x7a0e[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0xe7a0('0x0')]={'name':{'type':Sequelize[_0xe7a0('0x1')],'allowNull':![],'unique':_0xe7a0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe7a0('0x3')]('inbound',_0xe7a0('0x4')),'allowNull':![],'defaultValue':_0xe7a0('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xe7a0('0x6')},'announce':{'type':Sequelize[_0xe7a0('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe7a0('0x3')]('rr',_0xe7a0('0x7'),'leastrecent','fewestcalls',_0xe7a0('0x8'),_0xe7a0('0x9'),_0xe7a0('0xa'),_0xe7a0('0xb'),_0xe7a0('0xc')),'allowNull':![],'defaultValue':_0xe7a0('0x7'),'set':function(_0xbfe8a2){this[_0xe7a0('0xd')]('strategy',_0xbfe8a2?_0xbfe8a2:_0xe7a0('0x9'));},'get':function(){var _0x4b596e=this[_0xe7a0('0xe')](_0xe7a0('0xf'));var _0x2ef4c2=this[_0xe7a0('0xe')](_0xe7a0('0x10'));var _0x2955b5=this[_0xe7a0('0xe')](_0xe7a0('0x11'));if(_0x4b596e===_0xe7a0('0x5')){return _0x2955b5;}if(_0x2ef4c2===_0xe7a0('0x12')&&_0x2955b5===_0xe7a0('0x9')||_0x2ef4c2==='booked'&&_0x2955b5==='roundrobin'){return _0x2955b5;}if(_0x2ef4c2===_0xe7a0('0x13')||_0x2ef4c2===_0xe7a0('0x14')||_0x2ef4c2===_0xe7a0('0x15')){return _0x2955b5;}return null;}},'servicelevel':{'type':Sequelize[_0xe7a0('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe7a0('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe7a0('0x16')](0xb)},'timeout':{'type':Sequelize[_0xe7a0('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe7a0('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xe7a0('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe7a0('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe7a0('0x3')](_0xe7a0('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM']('yes','no',_0xe7a0('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe7a0('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xe7a0('0x3')](_0xe7a0('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe7a0('0x3')](_0xe7a0('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe7a0('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe7a0('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe7a0('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xe7a0('0x3')](_0xe7a0('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe7a0('0x3')](_0xe7a0('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xe7a0('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe7a0('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe7a0('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe7a0('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe7a0('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe7a0('0x3')](_0xe7a0('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xe7a0('0x17'),'no'),'defaultValue':_0xe7a0('0x17')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xe7a0('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xe7a0('0x3')](_0xe7a0('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0xe7a0('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe7a0('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xe7a0('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe7a0('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe7a0('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe7a0('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe7a0('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe7a0('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe7a0('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe7a0('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xe7a0('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xe7a0('0x1')]},'queue_less_than':{'type':Sequelize[_0xe7a0('0x1')]},'periodic_announce':{'type':Sequelize[_0xe7a0('0x1a')],'set':function(_0x45ee0b){this[_0xe7a0('0xd')](_0xe7a0('0x1b'),_0x45ee0b?_0x45ee0b[_0xe7a0('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0xe7a0('0x1b'))?this[_0xe7a0('0xe')](_0xe7a0('0x1b'))[_0xe7a0('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0xe7a0('0x1')],'defaultValue':_0xe7a0('0x17'),'set':function(_0x171db6){this['setDataValue'](_0xe7a0('0x1e'),_0x171db6?_0x171db6[_0xe7a0('0x1c')](','):[]);},'get':function(){return this[_0xe7a0('0xe')](_0xe7a0('0x1e'))?this[_0xe7a0('0xe')]('joinempty')[_0xe7a0('0x1d')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xe7a0('0x1')],'defaultValue':'no','set':function(_0x47dfe5){this[_0xe7a0('0xd')](_0xe7a0('0x1f'),_0x47dfe5?_0x47dfe5['join'](','):[]);},'get':function(){return this['getDataValue'](_0xe7a0('0x1f'))?this[_0xe7a0('0xe')]('leavewhenempty')['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0xe7a0('0x3')](_0xe7a0('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe7a0('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe7a0('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xe7a0('0x3')](_0xe7a0('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe7a0('0x1')]},'description':{'type':Sequelize[_0xe7a0('0x1')]},'acw':{'type':Sequelize[_0xe7a0('0x20')],'defaultValue':0x0,'set':function(_0x504b8b){this['setDataValue'](_0xe7a0('0x21'),_0x504b8b);if(_0x504b8b){if(this[_0xe7a0('0xe')](_0xe7a0('0x22'))<0x2){this[_0xe7a0('0xd')](_0xe7a0('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xe7a0('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe7a0('0x20')],'defaultValue':0x0,'comment':_0xe7a0('0x23')},'dialMethod':{'type':Sequelize[_0xe7a0('0x3')](_0xe7a0('0x24'),_0xe7a0('0x13'),_0xe7a0('0x15'),_0xe7a0('0x14'),_0xe7a0('0x12')),'defaultValue':_0xe7a0('0x13'),'comment':_0xe7a0('0x25')},'dialLimitChannel':{'type':Sequelize[_0xe7a0('0x16')](0x4)[_0xe7a0('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xe7a0('0x16')](0x4)[_0xe7a0('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe7a0('0x27')},'dialPowerLevel':{'type':Sequelize[_0xe7a0('0x28')](0x2)[_0xe7a0('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe7a0('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0xe7a0('0x3')]('agentBusyFactor',_0xe7a0('0x2a')),'defaultValue':_0xe7a0('0x2a'),'comment':_0xe7a0('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xe7a0('0x28')](0x2)[_0xe7a0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xe7a0('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xe7a0('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe7a0('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xe7a0('0x16')](0x3)[_0xe7a0('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe7a0('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xe7a0('0x2d'),'comment':_0xe7a0('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0xe7a0('0x16')](0x3)[_0xe7a0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe7a0('0x2f')},'dialQueueProject':{'type':Sequelize[_0xe7a0('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe7a0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe7a0('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe7a0('0x16')](0x5)[_0xe7a0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe7a0('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0xe7a0('0x16')](0x3)[_0xe7a0('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe7a0('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe7a0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe7a0('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xe7a0('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe7a0('0x16')](0x5)[_0xe7a0('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe7a0('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe7a0('0x16')](0x3)['UNSIGNED'],'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['STRING'],'defaultValue':_0xe7a0('0x36')},'dialPrefix':{'type':Sequelize[_0xe7a0('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe7a0('0x3')](_0xe7a0('0x37'),_0xe7a0('0x38'),_0xe7a0('0x39')),'defaultValue':_0xe7a0('0x37')},'dialAMDActive':{'type':Sequelize[_0xe7a0('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xe7a0('0x16')](0x9)[_0xe7a0('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xe7a0('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe7a0('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe7a0('0x16')](0x9)[_0xe7a0('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe7a0('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xe7a0('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe7a0('0x3c')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xe7a0('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe7a0('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe7a0('0x16')](0x9)[_0xe7a0('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe7a0('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe7a0('0x16')](0x9)[_0xe7a0('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe7a0('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe7a0('0x16')](0x5)[_0xe7a0('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe7a0('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe7a0('0x16')](0x9)[_0xe7a0('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe7a0('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0xe7a0('0x16')](0x5)[_0xe7a0('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xe7a0('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xe7a0('0x42'),_0xe7a0('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe7a0('0x16')](0x3)[_0xe7a0('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe7a0('0x44')},'dialCutDigit':{'type':Sequelize[_0xe7a0('0x16')](0x3)[_0xe7a0('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe7a0('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe7a0('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe7a0('0x20')],'defaultValue':![],'comment':_0xe7a0('0x46'),'set':function(_0x37bd43){if(!_0x37bd43)this[_0xe7a0('0xd')]('mandatoryDispositionPauseId',null);this[_0xe7a0('0xd')](_0xe7a0('0x47'),_0x37bd43);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe7a0('0x16')](0x3)[_0xe7a0('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe7a0('0x16')](0x3)[_0xe7a0('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js
index 68b9f25..bf593f9 100644
--- a/server/api/voiceQueue/voiceQueue.controller.js
+++ b/server/api/voiceQueue/voiceQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9ffd=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','update','then','inbound','outbound','filter','ignore','value','includes','type','find','name','UserProfileResource','destroy','error','stack','index','VoiceQueue','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','filters','merge','where','key','VIRTUAL','field','options','includeAll','include','findAll','catch','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','QueueCampaigns','autoAssociation','findOne','CmHopper','hasOwnProperty','pick','map','rows','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','transaction','each','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','team_has_voice_queues','user_has_teams','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','all','removeAgents','addAgents','spread','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x306989,_0x1a986e){var _0xaab1bf=function(_0x308e6d){while(--_0x308e6d){_0x306989['push'](_0x306989['shift']());}};_0xaab1bf(++_0x1a986e);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5ac992,_0x3e25b3){_0x5ac992=_0x5ac992-0x0;var _0x536470=_0x9ffd[_0x5ac992];return _0x536470;};'use strict';var pdf=require(_0xd9ff('0x0'));var emlformat=require(_0xd9ff('0x1'));var rimraf=require(_0xd9ff('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9ff('0x3'));var rp=require(_0xd9ff('0x4'));var moment=require(_0xd9ff('0x5'));var BPromise=require(_0xd9ff('0x6'));var Mustache=require('mustache');var util=require(_0xd9ff('0x7'));var path=require(_0xd9ff('0x8'));var sox=require('sox');var csv=require(_0xd9ff('0x9'));var ejs=require(_0xd9ff('0xa'));var fs=require('fs');var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x9'));var querystring=require(_0xd9ff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd9ff('0x11'));var logger=require(_0xd9ff('0x12'))(_0xd9ff('0x13'));var utils=require(_0xd9ff('0x14'));var config=require(_0xd9ff('0x15'));var db=require(_0xd9ff('0x16'))['db'];config[_0xd9ff('0x17')]=_[_0xd9ff('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd9ff('0x19'))(new Redis(config[_0xd9ff('0x17')]));require(_0xd9ff('0x1a'))[_0xd9ff('0x1b')](socket);function respondWithStatusCode(_0x12c39a,_0x556aa4){_0x556aa4=_0x556aa4||0xcc;return function(_0x2f78c1){if(_0x2f78c1){return _0x12c39a[_0xd9ff('0x1c')](_0x556aa4);}return _0x12c39a['status'](_0x556aa4)[_0xd9ff('0x1d')]();};}function respondWithResult(_0x5db010,_0x4ffe54){_0x4ffe54=_0x4ffe54||0xc8;return function(_0x547e28){if(_0x547e28){return _0x5db010['status'](_0x4ffe54)[_0xd9ff('0x1e')](_0x547e28);}};}function respondWithFilteredResult(_0x4f9d6d,_0x35679e){return function(_0xa30fd2){if(_0xa30fd2){var _0x39c6ce=_0xa30fd2[_0xd9ff('0x1f')],_0x3afd19=_0x35679e[_0xd9ff('0x20')],_0x5f45c4=_0x35679e[_0xd9ff('0x20')]+_0x35679e[_0xd9ff('0x21')],_0x2d4df1;if(_0x5f45c4>=_0x39c6ce){_0x5f45c4=_0x39c6ce;_0x2d4df1=0xc8;}else{_0x2d4df1=0xce;}_0x4f9d6d[_0xd9ff('0x22')](_0x2d4df1);return _0x4f9d6d[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x3afd19+'-'+_0x5f45c4+'/'+_0x39c6ce)['json'](_0xa30fd2);}return null;};}function patchUpdates(_0x4cf8ec){return function(_0x264a3d){try{jsonpatch[_0xd9ff('0x25')](_0x264a3d,_0x4cf8ec,!![]);}catch(_0x4eea4d){return BPromise['reject'](_0x4eea4d);}return _0x264a3d['save']();};}function saveUpdates(_0x4b1477,_0x1f4d9e){return function(_0x58eb5f){if(_0x58eb5f){return _0x58eb5f[_0xd9ff('0x26')](_0x4b1477)[_0xd9ff('0x27')](function(_0x291f52){return _0x291f52;});}return null;};}function removeEntity(_0x9f074e,_0x278b66){return function(_0x42a828){if(_0x42a828){return _0x42a828['destroy']()['then'](function(){var _0x1136e9=_0x42a828['get']({'plain':!![]});var _0x3ca906=[{'name':'VoiceQueues','value':_0xd9ff('0x28'),'ignore':![]},{'name':'QueueCampaigns','value':_0xd9ff('0x29'),'ignore':![]}];var _0x159e56=_(_0x3ca906)[_0xd9ff('0x2a')](_0xd9ff('0x2b'))['map'](_0xd9ff('0x2c'))[_0xd9ff('0x2c')]();if(_[_0xd9ff('0x2d')](_0x159e56,_0x1136e9[_0xd9ff('0x2e')])){return;}var _0x5c1c1f=_[_0xd9ff('0x2f')](_0x3ca906,[_0xd9ff('0x2c'),_0x1136e9[_0xd9ff('0x2e')]])[_0xd9ff('0x30')];return db[_0xd9ff('0x31')][_0xd9ff('0x32')]({'where':{'type':_0x5c1c1f,'resourceId':_0x1136e9['id']}})[_0xd9ff('0x27')](function(){return _0x42a828;});})[_0xd9ff('0x27')](function(){_0x9f074e[_0xd9ff('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcea5db,_0x4ba2be){return function(_0x1d55fd){if(!_0x1d55fd){_0xcea5db[_0xd9ff('0x1c')](0x194);}return _0x1d55fd;};}function handleError(_0xbdd352,_0x552d08){_0x552d08=_0x552d08||0x1f4;return function(_0x2ba4d3){logger[_0xd9ff('0x33')](_0x2ba4d3[_0xd9ff('0x34')]);if(_0x2ba4d3[_0xd9ff('0x30')]){delete _0x2ba4d3['name'];}_0xbdd352[_0xd9ff('0x22')](_0x552d08)['send'](_0x2ba4d3);};}exports[_0xd9ff('0x35')]=function(_0x2419f5,_0x323cb5){var _0x206424={},_0x20685b={},_0xdf3947={'count':0x0,'rows':[]};var _0x2cc2ae=db[_0xd9ff('0x36')][_0xd9ff('0x37')];_0x20685b[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](_0x2cc2ae);_0x20685b[_0xd9ff('0x3a')]=_[_0xd9ff('0x39')](_0x2419f5[_0xd9ff('0x3a')]);_0x20685b['filters']=_[_0xd9ff('0x3b')](_0x20685b[_0xd9ff('0x38')],_0x20685b[_0xd9ff('0x3a')]);_0x206424['attributes']=_[_0xd9ff('0x3b')](_0x20685b['model'],qs[_0xd9ff('0x3c')](_0x2419f5['query'][_0xd9ff('0x3c')]));_0x206424['attributes']=_0x206424[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x206424[_0xd9ff('0x3d')]:_0x20685b['model'];if(!_0x2419f5['query']['hasOwnProperty'](_0xd9ff('0x3f'))){_0x206424[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x2419f5[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x206424[_0xd9ff('0x20')]=qs['offset'](_0x2419f5['query']['offset']);}_0x206424[_0xd9ff('0x40')]=qs[_0xd9ff('0x41')](_0x2419f5[_0xd9ff('0x3a')][_0xd9ff('0x41')]);_0x206424['where']=qs[_0xd9ff('0x42')](_['pick'](_0x2419f5[_0xd9ff('0x3a')],_0x20685b[_0xd9ff('0x42')]));if(_0x2419f5[_0xd9ff('0x3a')][_0xd9ff('0x2a')]){_0x206424['where']=_[_0xd9ff('0x43')](_0x206424[_0xd9ff('0x44')],{'$or':_['map'](_0x2cc2ae,function(_0x459215){if(_0x459215[_0xd9ff('0x2e')][_0xd9ff('0x45')]!==_0xd9ff('0x46')){var _0x1fe44d={};_0x1fe44d[_0x459215[_0xd9ff('0x47')]]={'$like':'%'+_0x2419f5['query'][_0xd9ff('0x2a')]+'%'};return _0x1fe44d;}})});}_0x206424=_[_0xd9ff('0x43')]({},_0x206424,_0x2419f5[_0xd9ff('0x48')]);var _0x39fbbb={'where':_0x206424[_0xd9ff('0x44')]};return db['VoiceQueue'][_0xd9ff('0x1f')](_0x39fbbb)[_0xd9ff('0x27')](function(_0xe0bc49){_0xdf3947['count']=_0xe0bc49;if(_0x2419f5['query'][_0xd9ff('0x49')]){_0x206424[_0xd9ff('0x4a')]=[{'all':!![]}];}return db[_0xd9ff('0x36')][_0xd9ff('0x4b')](_0x206424);})[_0xd9ff('0x27')](function(_0x30c69d){_0xdf3947['rows']=_0x30c69d;return _0xdf3947;})[_0xd9ff('0x27')](respondWithFilteredResult(_0x323cb5,_0x206424))[_0xd9ff('0x4c')](handleError(_0x323cb5,null));};exports['show']=function(_0x1c6e88,_0x45a05e){var _0x13a1ec={'raw':![],'where':{'id':_0x1c6e88[_0xd9ff('0x4d')]['id']}},_0x477432={};_0x477432['model']=_['keys'](db['VoiceQueue'][_0xd9ff('0x37')]);_0x477432['query']=_[_0xd9ff('0x39')](_0x1c6e88[_0xd9ff('0x3a')]);_0x477432[_0xd9ff('0x42')]=_['intersection'](_0x477432[_0xd9ff('0x38')],_0x477432[_0xd9ff('0x3a')]);_0x13a1ec['attributes']=_[_0xd9ff('0x3b')](_0x477432[_0xd9ff('0x38')],qs[_0xd9ff('0x3c')](_0x1c6e88[_0xd9ff('0x3a')]['fields']));_0x13a1ec[_0xd9ff('0x3d')]=_0x13a1ec['attributes'][_0xd9ff('0x3e')]?_0x13a1ec['attributes']:_0x477432[_0xd9ff('0x38')];if(_0x1c6e88[_0xd9ff('0x3a')][_0xd9ff('0x49')]){_0x13a1ec[_0xd9ff('0x4a')]=[{'all':!![]}];}_0x13a1ec=_[_0xd9ff('0x43')]({},_0x13a1ec,_0x1c6e88['options']);return db[_0xd9ff('0x36')][_0xd9ff('0x2f')](_0x13a1ec)[_0xd9ff('0x27')](handleEntityNotFound(_0x45a05e,null))[_0xd9ff('0x27')](respondWithResult(_0x45a05e,null))['catch'](handleError(_0x45a05e,null));};exports['create']=function(_0x4c22dc,_0x7399a5){return db[_0xd9ff('0x36')][_0xd9ff('0x4e')](_0x4c22dc['body'],{})[_0xd9ff('0x27')](function(_0x61eec4){var _0x6d1082=_0x4c22dc[_0xd9ff('0x4f')][_0xd9ff('0x50')]({'plain':!![]});if(!_0x6d1082)throw new Error(_0xd9ff('0x51'));if(_0x6d1082[_0xd9ff('0x52')]===_0xd9ff('0x4f')){var _0x1ad160=_0x61eec4[_0xd9ff('0x50')]({'plain':!![]});var _0x5dcb5=[{'name':_0xd9ff('0x53'),'value':_0xd9ff('0x28')},{'name':'QueueCampaigns','value':_0xd9ff('0x29')}];var _0x4ccf41=_[_0xd9ff('0x2f')](_0x5dcb5,['value',_0x1ad160[_0xd9ff('0x2e')]])['name'];return db[_0xd9ff('0x54')]['find']({'where':{'name':_0x4ccf41,'userProfileId':_0x6d1082[_0xd9ff('0x55')]},'raw':!![]})['then'](function(_0x3fbeda){if(_0x3fbeda&&_0x3fbeda['autoAssociation']===0x0){return db[_0xd9ff('0x31')]['create']({'name':_0x1ad160[_0xd9ff('0x30')],'resourceId':_0x1ad160['id'],'type':_0x3fbeda[_0xd9ff('0x30')],'sectionId':_0x3fbeda['id']},{})[_0xd9ff('0x27')](function(){return _0x61eec4;});}else{return _0x61eec4;}})[_0xd9ff('0x4c')](function(_0x4df17b){logger[_0xd9ff('0x33')](_0xd9ff('0x56'),_0x4df17b);throw _0x4df17b;});}return _0x61eec4;})[_0xd9ff('0x27')](respondWithResult(_0x7399a5,0xc9))['catch'](handleError(_0x7399a5,null));};exports[_0xd9ff('0x57')]=function(_0x32e1b9,_0x19b033){var _0x2e29aa={'raw':![],'where':{'id':_0x32e1b9['params']['id']}},_0x11dd0c={};_0x11dd0c[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](db[_0xd9ff('0x36')][_0xd9ff('0x37')]);_0x2e29aa[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x11dd0c[_0xd9ff('0x38')],qs['fields'](_0x32e1b9[_0xd9ff('0x3a')][_0xd9ff('0x3c')]));_0x2e29aa['attributes']=_0x2e29aa[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x2e29aa['attributes']:_0x11dd0c[_0xd9ff('0x38')];if(_0x32e1b9[_0xd9ff('0x3a')][_0xd9ff('0x49')]){_0x2e29aa['include']=[{'all':!![]}];}_0x2e29aa=_['merge']({},_0x2e29aa,_0x32e1b9[_0xd9ff('0x48')]);return db['VoiceQueue'][_0xd9ff('0x2f')](_0x2e29aa)[_0xd9ff('0x27')](handleEntityNotFound(_0x19b033,null))[_0xd9ff('0x27')](function(_0x102aea){if(_0x102aea){var _0x53a230=_0x102aea['get']({'plain':!![]});_0x53a230=qs['omit'](_0x53a230,['id',_0xd9ff('0x58'),_0xd9ff('0x59')]);_0x32e1b9[_0xd9ff('0x5a')]=_[_0xd9ff('0x5b')](_0x32e1b9[_0xd9ff('0x5a')],['id','createdAt',_0xd9ff('0x59')]);return db['VoiceQueue'][_0xd9ff('0x4e')](_[_0xd9ff('0x43')](_0x53a230,_0x32e1b9[_0xd9ff('0x5a')]),{'include':_0x32e1b9[_0xd9ff('0x3a')][_0xd9ff('0x49')]?[{'all':!![]}]:undefined})[_0xd9ff('0x27')](function(_0xed12df){var _0xfcafbe=_0x32e1b9['user'][_0xd9ff('0x50')]({'plain':!![]});if(!_0xfcafbe)throw new Error(_0xd9ff('0x51'));if(_0xfcafbe['role']==='user'){var _0x3e8766=_0xed12df['get']({'plain':!![]});var _0x1c968f=[{'name':_0xd9ff('0x53'),'value':'inbound'},{'name':_0xd9ff('0x5c'),'value':_0xd9ff('0x29')}];var _0x54aca7=_[_0xd9ff('0x2f')](_0x1c968f,[_0xd9ff('0x2c'),_0x3e8766['type']])[_0xd9ff('0x30')];return db['UserProfileSection']['find']({'where':{'name':_0x54aca7,'userProfileId':_0xfcafbe[_0xd9ff('0x55')]},'raw':!![]})[_0xd9ff('0x27')](function(_0x1a08a9){if(_0x1a08a9&&_0x1a08a9[_0xd9ff('0x5d')]===0x0){return db['UserProfileResource'][_0xd9ff('0x4e')]({'name':_0x3e8766[_0xd9ff('0x30')],'resourceId':_0x3e8766['id'],'type':_0x1a08a9[_0xd9ff('0x30')],'sectionId':_0x1a08a9['id']},{})[_0xd9ff('0x27')](function(){return _0xed12df;});}else{return _0xed12df;}})[_0xd9ff('0x4c')](function(_0x255edf){logger[_0xd9ff('0x33')](_0xd9ff('0x56'),_0x255edf);throw _0x255edf;});}return _0xed12df;});}})['then'](respondWithResult(_0x19b033,0xc9))['catch'](handleError(_0x19b033,null));};exports['update']=function(_0x275fb9,_0x31db27){if(_0x275fb9['body']['id']){delete _0x275fb9[_0xd9ff('0x5a')]['id'];}return db[_0xd9ff('0x36')][_0xd9ff('0x2f')]({'where':{'id':_0x275fb9[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x31db27,null))[_0xd9ff('0x27')](saveUpdates(_0x275fb9[_0xd9ff('0x5a')],null))[_0xd9ff('0x27')](respondWithResult(_0x31db27,null))['catch'](handleError(_0x31db27,null));};exports[_0xd9ff('0x32')]=function(_0x1ef766,_0x228413){return db['VoiceQueue'][_0xd9ff('0x2f')]({'where':{'id':_0x1ef766['params']['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x228413,null))[_0xd9ff('0x27')](removeEntity(_0x228413,null))[_0xd9ff('0x4c')](handleError(_0x228413,null));};exports['getHoppers']=function(_0x24f1a2,_0xc94fb0,_0x4222e8){var _0x1cd620={'raw':![],'where':{}};var _0x56a74c={};var _0x29b8cd={'count':0x0,'rows':[]};return db[_0xd9ff('0x36')][_0xd9ff('0x5e')]({'where':{'id':_0x24f1a2['params']['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0xc94fb0,null))[_0xd9ff('0x27')](function(_0x2619c9){if(_0x2619c9){_0x56a74c['model']=_[_0xd9ff('0x39')](db[_0xd9ff('0x5f')][_0xd9ff('0x37')]);_0x56a74c[_0xd9ff('0x3a')]=_[_0xd9ff('0x39')](_0x24f1a2['query']);_0x56a74c[_0xd9ff('0x42')]=_[_0xd9ff('0x3b')](_0x56a74c['model'],_0x56a74c[_0xd9ff('0x3a')]);_0x1cd620[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x56a74c['model'],qs[_0xd9ff('0x3c')](_0x24f1a2['query'][_0xd9ff('0x3c')]));_0x1cd620['attributes']=_0x1cd620[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x1cd620[_0xd9ff('0x3d')]:_0x56a74c[_0xd9ff('0x38')];if(!_0x24f1a2[_0xd9ff('0x3a')][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x1cd620[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x24f1a2[_0xd9ff('0x3a')]['limit']);_0x1cd620[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x24f1a2[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}_0x1cd620[_0xd9ff('0x40')]=qs[_0xd9ff('0x41')](_0x24f1a2['query']['sort']);_0x1cd620[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x24f1a2[_0xd9ff('0x3a')],_0x56a74c[_0xd9ff('0x42')]));_0x1cd620[_0xd9ff('0x44')]['VoiceQueueId']=_0x2619c9['id'];if(_0x24f1a2[_0xd9ff('0x3a')][_0xd9ff('0x2a')]){_0x1cd620[_0xd9ff('0x44')]=_[_0xd9ff('0x43')](_0x1cd620[_0xd9ff('0x44')],{'$or':_[_0xd9ff('0x62')](_0x1cd620['attributes'],function(_0x124214){var _0x3aef79={};_0x3aef79[_0x124214]={'$like':'%'+_0x24f1a2[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x3aef79;})});}_0x1cd620=_[_0xd9ff('0x43')]({},_0x1cd620,_0x24f1a2[_0xd9ff('0x48')]);return db[_0xd9ff('0x5f')][_0xd9ff('0x1f')]({'where':_0x1cd620['where']})[_0xd9ff('0x27')](function(_0x4c2ad5){_0x29b8cd[_0xd9ff('0x1f')]=_0x4c2ad5;if(_0x24f1a2[_0xd9ff('0x3a')][_0xd9ff('0x49')]){_0x1cd620[_0xd9ff('0x4a')]=[{'all':!![]}];}return db[_0xd9ff('0x5f')][_0xd9ff('0x4b')](_0x1cd620);})[_0xd9ff('0x27')](function(_0x2b66f6){_0x29b8cd[_0xd9ff('0x63')]=_0x2b66f6;return _0x29b8cd;});}})[_0xd9ff('0x27')](respondWithFilteredResult(_0xc94fb0,_0x1cd620))[_0xd9ff('0x4c')](handleError(_0xc94fb0,null));};exports[_0xd9ff('0x64')]=function(_0xa908a3,_0x5d29b9,_0x4413c4){var _0x3d5742={'raw':!![],'where':{}};var _0x191786={};var _0x19ecf3={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xd9ff('0x5e')]({'where':{'id':_0xa908a3[_0xd9ff('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5d29b9,null))[_0xd9ff('0x27')](function(_0x1afdd4){if(_0x1afdd4){_0x191786[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](db[_0xd9ff('0x65')][_0xd9ff('0x37')]);_0x191786[_0xd9ff('0x3a')]=_['keys'](_0xa908a3[_0xd9ff('0x3a')]);_0x191786['filters']=_[_0xd9ff('0x3b')](_0x191786[_0xd9ff('0x38')],_0x191786[_0xd9ff('0x3a')]);_0x3d5742[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x191786[_0xd9ff('0x38')],qs[_0xd9ff('0x3c')](_0xa908a3[_0xd9ff('0x3a')][_0xd9ff('0x3c')]));_0x3d5742[_0xd9ff('0x3d')]=_0x3d5742[_0xd9ff('0x3d')]['length']?_0x3d5742[_0xd9ff('0x3d')]:_0x191786[_0xd9ff('0x38')];if(!_0xa908a3['query'][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x3d5742[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0xa908a3[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x3d5742['offset']=qs['offset'](_0xa908a3[_0xd9ff('0x3a')]['offset']);}_0x3d5742['order']=qs['sort'](_0xa908a3['query'][_0xd9ff('0x41')]);_0x3d5742[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_['pick'](_0xa908a3['query'],_0x191786[_0xd9ff('0x42')]));_0x3d5742['where'][_0xd9ff('0x66')]=_0x1afdd4['id'];if(_0xa908a3['query'][_0xd9ff('0x2a')]){_0x3d5742[_0xd9ff('0x44')]=_[_0xd9ff('0x43')](_0x3d5742[_0xd9ff('0x44')],{'$or':_[_0xd9ff('0x62')](_0x3d5742['attributes'],function(_0x511eb9){var _0x33c03c={};_0x33c03c[_0x511eb9]={'$like':'%'+_0xa908a3[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x33c03c;})});}_0x3d5742=_[_0xd9ff('0x43')]({},_0x3d5742,_0xa908a3[_0xd9ff('0x48')]);return db['CmHopperHistory'][_0xd9ff('0x1f')]({'where':_0x3d5742[_0xd9ff('0x44')]})[_0xd9ff('0x27')](function(_0x7fdc57){_0x19ecf3[_0xd9ff('0x1f')]=_0x7fdc57;if(_0xa908a3[_0xd9ff('0x3a')][_0xd9ff('0x49')]){_0x3d5742[_0xd9ff('0x4a')]=[{'all':!![]}];}return db[_0xd9ff('0x65')][_0xd9ff('0x4b')](_0x3d5742);})[_0xd9ff('0x27')](function(_0x311b25){_0x19ecf3[_0xd9ff('0x63')]=_0x311b25;return _0x19ecf3;});}})['then'](respondWithFilteredResult(_0x5d29b9,_0x3d5742))[_0xd9ff('0x4c')](handleError(_0x5d29b9,null));};exports[_0xd9ff('0x67')]=function(_0x548ac4,_0x57434d,_0x499020){var _0x34321b={'raw':!![],'where':{}};var _0x4eb4b0={};var _0x3a0425={'count':0x0,'rows':[]};return db[_0xd9ff('0x36')][_0xd9ff('0x5e')]({'where':{'id':_0x548ac4[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x57434d,null))[_0xd9ff('0x27')](function(_0x120391){if(_0x120391){_0x4eb4b0[_0xd9ff('0x38')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x4eb4b0[_0xd9ff('0x3a')]=_[_0xd9ff('0x39')](_0x548ac4[_0xd9ff('0x3a')]);_0x4eb4b0['filters']=_[_0xd9ff('0x3b')](_0x4eb4b0[_0xd9ff('0x38')],_0x4eb4b0[_0xd9ff('0x3a')]);_0x34321b[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x4eb4b0[_0xd9ff('0x38')],qs['fields'](_0x548ac4[_0xd9ff('0x3a')]['fields']));_0x34321b[_0xd9ff('0x3d')]=_0x34321b[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x34321b[_0xd9ff('0x3d')]:_0x4eb4b0['model'];if(!_0x548ac4[_0xd9ff('0x3a')][_0xd9ff('0x60')]('nolimit')){_0x34321b['limit']=qs['limit'](_0x548ac4[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x34321b['offset']=qs[_0xd9ff('0x20')](_0x548ac4[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}_0x34321b['order']=qs['sort'](_0x548ac4['query'][_0xd9ff('0x41')]);_0x34321b['where']=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x548ac4['query'],_0x4eb4b0[_0xd9ff('0x42')]));_0x34321b[_0xd9ff('0x44')][_0xd9ff('0x66')]=_0x120391['id'];if(_0x548ac4[_0xd9ff('0x3a')][_0xd9ff('0x2a')]){_0x34321b['where']=_[_0xd9ff('0x43')](_0x34321b['where'],{'$or':_['map'](_0x34321b['attributes'],function(_0x42d61f){var _0x373b7a={};_0x373b7a[_0x42d61f]={'$like':'%'+_0x548ac4[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x373b7a;})});}_0x34321b=_['merge']({},_0x34321b,_0x548ac4['options']);return db[_0xd9ff('0x68')][_0xd9ff('0x1f')]({'where':_0x34321b[_0xd9ff('0x44')]})[_0xd9ff('0x27')](function(_0x28afbb){_0x3a0425['count']=_0x28afbb;if(_0x548ac4['query'][_0xd9ff('0x49')]){_0x34321b[_0xd9ff('0x4a')]=[{'all':!![]}];}return db[_0xd9ff('0x68')][_0xd9ff('0x4b')](_0x34321b);})[_0xd9ff('0x27')](function(_0xd96303){_0x3a0425['rows']=_0xd96303;return _0x3a0425;});}})[_0xd9ff('0x27')](respondWithFilteredResult(_0x57434d,_0x34321b))['catch'](handleError(_0x57434d,null));};exports['getHopperBlacks']=function(_0x16c6fd,_0x397c39,_0x33fee6){var _0x348087={'raw':!![],'where':{}};var _0x49c47c={};var _0x4e3fdd={'count':0x0,'rows':[]};return db[_0xd9ff('0x36')]['findOne']({'where':{'id':_0x16c6fd['params']['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x397c39,null))['then'](function(_0x1035ff){if(_0x1035ff){_0x49c47c['model']=_[_0xd9ff('0x39')](db[_0xd9ff('0x69')][_0xd9ff('0x37')]);_0x49c47c[_0xd9ff('0x3a')]=_[_0xd9ff('0x39')](_0x16c6fd[_0xd9ff('0x3a')]);_0x49c47c[_0xd9ff('0x42')]=_['intersection'](_0x49c47c[_0xd9ff('0x38')],_0x49c47c['query']);_0x348087['attributes']=_[_0xd9ff('0x3b')](_0x49c47c[_0xd9ff('0x38')],qs['fields'](_0x16c6fd[_0xd9ff('0x3a')]['fields']));_0x348087['attributes']=_0x348087[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x348087[_0xd9ff('0x3d')]:_0x49c47c[_0xd9ff('0x38')];if(!_0x16c6fd[_0xd9ff('0x3a')][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x348087[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x16c6fd[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x348087[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x16c6fd['query']['offset']);}_0x348087['order']=qs[_0xd9ff('0x41')](_0x16c6fd['query'][_0xd9ff('0x41')]);_0x348087[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x16c6fd['query'],_0x49c47c[_0xd9ff('0x42')]));_0x348087['where'][_0xd9ff('0x66')]=_0x1035ff['id'];if(_0x16c6fd['query']['filter']){_0x348087['where']=_[_0xd9ff('0x43')](_0x348087['where'],{'$or':_[_0xd9ff('0x62')](_0x348087['attributes'],function(_0x3f443b){var _0x387c71={};_0x387c71[_0x3f443b]={'$like':'%'+_0x16c6fd[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x387c71;})});}_0x348087=_[_0xd9ff('0x43')]({},_0x348087,_0x16c6fd[_0xd9ff('0x48')]);return db['CmHopperBlack']['count']({'where':_0x348087[_0xd9ff('0x44')]})[_0xd9ff('0x27')](function(_0x3205ef){_0x4e3fdd[_0xd9ff('0x1f')]=_0x3205ef;if(_0x16c6fd[_0xd9ff('0x3a')]['includeAll']){_0x348087[_0xd9ff('0x4a')]=[{'all':!![]}];}return db[_0xd9ff('0x69')][_0xd9ff('0x4b')](_0x348087);})[_0xd9ff('0x27')](function(_0x3278f6){_0x4e3fdd[_0xd9ff('0x63')]=_0x3278f6;return _0x4e3fdd;});}})['then'](respondWithFilteredResult(_0x397c39,_0x348087))[_0xd9ff('0x4c')](handleError(_0x397c39,null));};exports[_0xd9ff('0x6a')]=function(_0x39aad6,_0x3d6ab3,_0x1b7050){var _0x3cf38a={};var _0x1c8e55={};var _0x1ae8b5;var _0x29fdb8;return db[_0xd9ff('0x36')][_0xd9ff('0x5e')]({'where':{'id':_0x39aad6[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x3d6ab3,null))[_0xd9ff('0x27')](function(_0x385787){if(_0x385787){_0x1ae8b5=_0x385787;_0x1c8e55[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](db[_0xd9ff('0x6b')]['rawAttributes']);_0x1c8e55[_0xd9ff('0x3a')]=_[_0xd9ff('0x39')](_0x39aad6[_0xd9ff('0x3a')]);_0x1c8e55[_0xd9ff('0x42')]=_[_0xd9ff('0x3b')](_0x1c8e55[_0xd9ff('0x38')],_0x1c8e55[_0xd9ff('0x3a')]);_0x3cf38a[_0xd9ff('0x3d')]=_['intersection'](_0x1c8e55[_0xd9ff('0x38')],qs['fields'](_0x39aad6[_0xd9ff('0x3a')][_0xd9ff('0x3c')]));_0x3cf38a[_0xd9ff('0x3d')]=_0x3cf38a[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x3cf38a[_0xd9ff('0x3d')]:_0x1c8e55[_0xd9ff('0x38')];_0x3cf38a['order']=qs[_0xd9ff('0x41')](_0x39aad6[_0xd9ff('0x3a')][_0xd9ff('0x41')]);_0x3cf38a[_0xd9ff('0x44')]=qs['filters'](_[_0xd9ff('0x61')](_0x39aad6[_0xd9ff('0x3a')],_0x1c8e55['filters']));if(_0x39aad6[_0xd9ff('0x3a')][_0xd9ff('0x2a')]){_0x3cf38a['where']=_['merge'](_0x3cf38a['where'],{'$or':_['map'](_0x3cf38a[_0xd9ff('0x3d')],function(_0x218279){var _0x31f1c0={};_0x31f1c0[_0x218279]={'$like':'%'+_0x39aad6['query']['filter']+'%'};return _0x31f1c0;})});}_0x3cf38a=_[_0xd9ff('0x43')]({},_0x3cf38a,_0x39aad6['options']);return _0x1ae8b5[_0xd9ff('0x6a')](_0x3cf38a);}})[_0xd9ff('0x27')](function(_0xc6c3e7){if(_0xc6c3e7){_0x29fdb8=_0xc6c3e7['length'];if(!_0x39aad6['query']['hasOwnProperty'](_0xd9ff('0x3f'))){_0x3cf38a[_0xd9ff('0x21')]=qs['limit'](_0x39aad6[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x3cf38a[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x39aad6[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}return _0x1ae8b5[_0xd9ff('0x6a')](_0x3cf38a);}})[_0xd9ff('0x27')](function(_0x34c584){if(_0x34c584){return _0x34c584?{'count':_0x29fdb8,'rows':_0x34c584}:null;}})[_0xd9ff('0x27')](respondWithResult(_0x3d6ab3,null))[_0xd9ff('0x4c')](handleError(_0x3d6ab3,null));};exports[_0xd9ff('0x6c')]=function(_0x1112d7,_0x2f83d5,_0x107734){var _0x11c2de=_0x1112d7[_0xd9ff('0x5a')][_0xd9ff('0x6d')];return db[_0xd9ff('0x6b')][_0xd9ff('0x4b')]({'where':{'id':_[_0xd9ff('0x62')](_0x11c2de,'id')},'attributes':['id'],'include':[{'model':db[_0xd9ff('0x6e')],'as':_0xd9ff('0x6f'),'attributes':['id',_0xd9ff('0x30'),_0xd9ff('0x70'),_0xd9ff('0x71'),_0xd9ff('0x72')],'raw':!![]}]})[_0xd9ff('0x27')](function(_0x45db83){if(_0x45db83){var _0x4a9657=_[_0xd9ff('0x73')](_0x45db83,function(_0x24c947){var _0x5df5af=_0x24c947[_0xd9ff('0x50')]({'plain':!![]});_0x5df5af[_0xd9ff('0x6f')][_0xd9ff('0x74')](function(_0x220781){_0x220781[_0xd9ff('0x75')]=_[_0xd9ff('0x2f')](_0x11c2de,{'id':_0x5df5af['id']})['penalty'];});return _0x5df5af['Agents'];});return db[_0xd9ff('0x36')]['find']({'where':{'id':_0x1112d7['params']['id']}})[_0xd9ff('0x27')](function(_0x3f0c4d){return db['sequelize'][_0xd9ff('0x76')](function(_0x972158){return _0x3f0c4d[_0xd9ff('0x6c')](_[_0xd9ff('0x62')](_0x11c2de,'id'),{'transaction':_0x972158})['then'](function(){return BPromise[_0xd9ff('0x77')](_0x4a9657,function(_0x4290e9){return db['UserVoiceQueue'][_0xd9ff('0x78')]({'where':{'UserId':_0x4290e9['id'],'VoiceQueueId':_0x1112d7[_0xd9ff('0x4d')]['id']},'defaults':{'penalty':_0x4290e9['penalty']},'transaction':_0x972158});});})[_0xd9ff('0x27')](function(){return BPromise[_0xd9ff('0x77')](_[_0xd9ff('0x2a')](_0x4a9657,{'online':!![]}),function(_0x5b2e9c){return db[_0xd9ff('0x79')][_0xd9ff('0x7a')]({'membername':_0x5b2e9c[_0xd9ff('0x30')],'UserId':_0x5b2e9c['id'],'queue_name':_0x3f0c4d['name'],'VoiceQueueId':_0x3f0c4d['id'],'interface':_[_0xd9ff('0x7b')](_0x5b2e9c['interface'])?util[_0xd9ff('0x7c')](_0xd9ff('0x7d'),_0x5b2e9c[_0xd9ff('0x30')]):_0x5b2e9c[_0xd9ff('0x72')],'paused':_0x5b2e9c[_0xd9ff('0x71')]||![],'penalty':_0x5b2e9c[_0xd9ff('0x75')]},{'transaction':_0x972158});});})['then'](function(){_0x4a9657[_0xd9ff('0x74')](function(_0x3cf2ef){socket[_0xd9ff('0x7e')](_0xd9ff('0x7f'),{'UserId':_0x3cf2ef['id'],'VoiceQueueId':_0x3f0c4d['id']});});});});});}})[_0xd9ff('0x27')](respondWithStatusCode(_0x2f83d5,null))['catch'](handleError(_0x2f83d5,null));};exports[_0xd9ff('0x80')]=function(_0x6e3861,_0x55a784,_0x1a89ef){return db[_0xd9ff('0x6b')][_0xd9ff('0x4b')]({'where':{'id':_0x6e3861[_0xd9ff('0x3a')][_0xd9ff('0x81')]},'attributes':['id'],'include':[{'model':db[_0xd9ff('0x6e')],'as':_0xd9ff('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xd9ff('0x27')](handleEntityNotFound(_0x55a784,null))[_0xd9ff('0x27')](function(_0x3566c4){var _0x236134=_[_0xd9ff('0x62')](_0x3566c4,'id');var _0x8be873=[];var _0x46a4e1=[];var _0x44fb42=squel[_0xd9ff('0x82')]();_0x44fb42['field']('tq.TeamId')['from'](_0xd9ff('0x83'),'tq')['join'](_0xd9ff('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoiceQueueId\x20=\x20?',_0x6e3861[_0xd9ff('0x4d')]['id']);for(var _0x57e0af=0x0;_0x57e0af<_0x3566c4['length'];_0x57e0af+=0x1){let _0x474b4c=_0x3566c4[_0x57e0af];for(var _0x144cf7=0x0;_0x144cf7<_0x474b4c[_0xd9ff('0x6f')][_0xd9ff('0x3e')];_0x144cf7+=0x1){let _0x23251b=_0x474b4c[_0xd9ff('0x6f')][_0x144cf7];var _0x2450da=_0x44fb42[_0xd9ff('0x57')]();_0x2450da[_0xd9ff('0x44')](_0xd9ff('0x85'),_0x23251b['id']);_0x46a4e1[_0xd9ff('0x86')](db[_0xd9ff('0x87')][_0xd9ff('0x3a')](_0x2450da[_0xd9ff('0x88')](),{'type':db['sequelize']['QueryTypes'][_0xd9ff('0x89')]})[_0xd9ff('0x27')](function(_0x131f51){if(_0x131f51[_0xd9ff('0x3e')]===0x1){return _0x23251b['id'];}else{var _0xdac6e4=_[_0xd9ff('0x8a')](_[_0xd9ff('0x62')](_0x131f51,_0xd9ff('0x8b')),function(_0x52b045){return _[_0xd9ff('0x2d')](_0x236134,_0x52b045);});if(_0xdac6e4){return _0x23251b['id'];}}}));}}return BPromise[_0xd9ff('0x8c')](_0x46a4e1)[_0xd9ff('0x27')](function(_0x2179c9){_0x8be873=_(_0x8be873)['union'](_0x2179c9)['compact']()[_0xd9ff('0x2c')]();return db[_0xd9ff('0x36')]['find']({'where':{'id':_0x6e3861[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](function(_0x5273c8){return db[_0xd9ff('0x87')][_0xd9ff('0x76')](function(_0x1ed60d){return _0x5273c8[_0xd9ff('0x80')](_0x6e3861[_0xd9ff('0x3a')][_0xd9ff('0x81')],{'transaction':_0x1ed60d})[_0xd9ff('0x27')](function(){if(!_['isEmpty'](_0x8be873)){return _0x5273c8[_0xd9ff('0x8d')](_0x8be873,{'transaction':_0x1ed60d})[_0xd9ff('0x27')](function(){return db[_0xd9ff('0x79')][_0xd9ff('0x32')]({'where':{'VoiceQueueId':_0x6e3861[_0xd9ff('0x4d')]['id'],'UserId':_0x8be873},'transaction':_0x1ed60d});});}})['then'](function(){_0x8be873[_0xd9ff('0x74')](function(_0x32b1d5){socket[_0xd9ff('0x7e')]('userVoiceQueue:remove',{'UserId':_0x32b1d5,'VoiceQueueId':_0x5273c8['id']});});});});});});})[_0xd9ff('0x27')](respondWithStatusCode(_0x55a784,null))[_0xd9ff('0x4c')](handleError(_0x55a784,null));};exports[_0xd9ff('0x8e')]=function(_0x51c346,_0x1c0405,_0x55e136){var _0x5e07ae,_0x5da4ad;return db['VoiceQueue']['find']({'where':{'id':_0x51c346[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x1c0405,null))['then'](function(_0x2d8405){if(_0x2d8405){_0x5da4ad=_0x2d8405;return _0x2d8405[_0xd9ff('0x8e')](_0x51c346[_0xd9ff('0x5a')]['ids'],_[_0xd9ff('0x5b')](_0x51c346['body'],['ids','id'])||{})[_0xd9ff('0x8f')](function(_0x21680f){for(var _0xdf5553=0x0;_0xdf5553<_0x51c346['body']['ids'][_0xd9ff('0x3e')];_0xdf5553+=0x1){socket[_0xd9ff('0x7e')]('userVoiceQueue:save',{'UserId':_0x51c346[_0xd9ff('0x5a')][_0xd9ff('0x81')][_0xdf5553],'VoiceQueueId':_0x51c346[_0xd9ff('0x4d')]['id']});}return _0x21680f;});}})[_0xd9ff('0x27')](function(_0x3cc589){_0x5e07ae=_0x3cc589||[];if(_0x5da4ad){return db[_0xd9ff('0x6e')][_0xd9ff('0x4b')]({'where':{'id':_0x51c346['body'][_0xd9ff('0x81')]},'attributes':['id',_0xd9ff('0x30'),'online',_0xd9ff('0x71'),_0xd9ff('0x72')],'raw':!![]});}})['then'](function(_0x703858){if(!_['isEmpty'](_0x703858)){var _0x2c4bd8=[];for(var _0x26999a=0x0;_0x26999a<_0x703858['length'];_0x26999a++){if(_0x703858[_0x26999a][_0xd9ff('0x70')]){_0x2c4bd8['push'](db[_0xd9ff('0x79')][_0xd9ff('0x7a')]({'membername':_0x703858[_0x26999a][_0xd9ff('0x30')],'UserId':_0x703858[_0x26999a]['id'],'queue_name':_0x5da4ad[_0xd9ff('0x30')],'VoiceQueueId':_0x5da4ad['id'],'interface':_[_0xd9ff('0x7b')](_0x703858[_0x26999a][_0xd9ff('0x72')])?util['format']('SIP/%s',_0x703858[_0x26999a][_0xd9ff('0x30')]):_0x703858[_0x26999a]['interface'],'paused':_0x703858[_0x26999a][_0xd9ff('0x71')]||![],'penalty':_0x51c346[_0xd9ff('0x5a')]['penalty']||0x0}));}}return BPromise['all'](_0x2c4bd8);}})['then'](function(){return _0x5e07ae;})[_0xd9ff('0x27')](respondWithResult(_0x1c0405,null))[_0xd9ff('0x4c')](handleError(_0x1c0405,null));};exports[_0xd9ff('0x8d')]=function(_0x4f1073,_0x378a24,_0x36d88f){return db[_0xd9ff('0x36')][_0xd9ff('0x2f')]({'where':{'id':_0x4f1073[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x378a24,null))[_0xd9ff('0x27')](function(_0x5e064d){if(_0x5e064d){return _0x5e064d[_0xd9ff('0x8d')](_0x4f1073[_0xd9ff('0x3a')][_0xd9ff('0x81')])[_0xd9ff('0x27')](function(){if(_[_0xd9ff('0x90')](_0x4f1073[_0xd9ff('0x3a')][_0xd9ff('0x81')])){for(var _0x21988b=0x0;_0x21988b<_0x4f1073[_0xd9ff('0x3a')][_0xd9ff('0x81')][_0xd9ff('0x3e')];_0x21988b+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x4f1073[_0xd9ff('0x3a')]['ids'][_0x21988b]),'VoiceQueueId':Number(_0x4f1073['params']['id'])});}}else{socket[_0xd9ff('0x7e')](_0xd9ff('0x91'),{'UserId':Number(_0x4f1073[_0xd9ff('0x3a')][_0xd9ff('0x81')]),'VoiceQueueId':Number(_0x4f1073[_0xd9ff('0x4d')]['id'])});}});}})['then'](function(_0x29fff7){return db['UserVoiceQueueRt'][_0xd9ff('0x32')]({'where':{'VoiceQueueId':_0x4f1073[_0xd9ff('0x4d')]['id'],'UserId':_0x4f1073['query'][_0xd9ff('0x81')]}})[_0xd9ff('0x27')](function(){return _0x29fff7;});})[_0xd9ff('0x27')](respondWithStatusCode(_0x378a24,null))[_0xd9ff('0x4c')](handleError(_0x378a24,null));};exports[_0xd9ff('0x92')]=function(_0x3f0d6c,_0x18a476,_0x538c67){var _0x3c03b3={};var _0x1e3932={};var _0x10f559;var _0x6228cb;return db[_0xd9ff('0x36')][_0xd9ff('0x5e')]({'where':{'id':_0x3f0d6c['params']['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x18a476,null))[_0xd9ff('0x27')](function(_0x109dc3){if(_0x109dc3){_0x10f559=_0x109dc3;_0x1e3932['model']=_[_0xd9ff('0x39')](db['User'][_0xd9ff('0x37')]);_0x1e3932['query']=_[_0xd9ff('0x39')](_0x3f0d6c[_0xd9ff('0x3a')]);_0x1e3932[_0xd9ff('0x42')]=_['intersection'](_0x1e3932[_0xd9ff('0x38')],_0x1e3932['query']);_0x3c03b3[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x1e3932[_0xd9ff('0x38')],qs[_0xd9ff('0x3c')](_0x3f0d6c[_0xd9ff('0x3a')]['fields']));_0x3c03b3[_0xd9ff('0x3d')]=_0x3c03b3[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x3c03b3[_0xd9ff('0x3d')]:_0x1e3932[_0xd9ff('0x38')];_0x3c03b3[_0xd9ff('0x40')]=qs['sort'](_0x3f0d6c['query'][_0xd9ff('0x41')]);_0x3c03b3[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x3f0d6c[_0xd9ff('0x3a')],_0x1e3932[_0xd9ff('0x42')]));if(_0x3f0d6c[_0xd9ff('0x3a')]['filter']){_0x3c03b3[_0xd9ff('0x44')]=_[_0xd9ff('0x43')](_0x3c03b3[_0xd9ff('0x44')],{'$or':_[_0xd9ff('0x62')](_0x3c03b3[_0xd9ff('0x3d')],function(_0x173293){var _0x4ffed7={};_0x4ffed7[_0x173293]={'$like':'%'+_0x3f0d6c[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x4ffed7;})});}_0x3c03b3=_[_0xd9ff('0x43')]({},_0x3c03b3,_0x3f0d6c[_0xd9ff('0x48')]);return _0x10f559[_0xd9ff('0x92')](_0x3c03b3);}})[_0xd9ff('0x27')](function(_0x5c0a6e){if(_0x5c0a6e){_0x6228cb=_0x5c0a6e['length'];if(!_0x3f0d6c[_0xd9ff('0x3a')][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x3c03b3[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x3f0d6c[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x3c03b3[_0xd9ff('0x20')]=qs['offset'](_0x3f0d6c[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}return _0x10f559[_0xd9ff('0x92')](_0x3c03b3);}})[_0xd9ff('0x27')](function(_0x219b57){if(_0x219b57){return _0x219b57?{'count':_0x6228cb,'rows':_0x219b57}:null;}})[_0xd9ff('0x27')](respondWithResult(_0x18a476,null))['catch'](handleError(_0x18a476,null));};exports[_0xd9ff('0x93')]=function(_0x586c56,_0x51209e,_0x23ed20){var _0x32e672={};var _0x2fdb78={};var _0x30abd8;var _0x3c8f01;return db[_0xd9ff('0x36')][_0xd9ff('0x5e')]({'where':{'id':_0x586c56[_0xd9ff('0x4d')]['id']}})['then'](handleEntityNotFound(_0x51209e,null))[_0xd9ff('0x27')](function(_0x4c07bf){if(_0x4c07bf){_0x30abd8=_0x4c07bf;_0x2fdb78[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](db[_0xd9ff('0x79')][_0xd9ff('0x37')]);_0x2fdb78['query']=_[_0xd9ff('0x39')](_0x586c56[_0xd9ff('0x3a')]);_0x2fdb78[_0xd9ff('0x42')]=_[_0xd9ff('0x3b')](_0x2fdb78[_0xd9ff('0x38')],_0x2fdb78[_0xd9ff('0x3a')]);_0x32e672[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x2fdb78[_0xd9ff('0x38')],qs['fields'](_0x586c56[_0xd9ff('0x3a')]['fields']));_0x32e672['attributes']=_0x32e672[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x32e672[_0xd9ff('0x3d')]:_0x2fdb78[_0xd9ff('0x38')];_0x32e672[_0xd9ff('0x40')]=qs[_0xd9ff('0x41')](_0x586c56[_0xd9ff('0x3a')][_0xd9ff('0x41')]);_0x32e672[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x586c56[_0xd9ff('0x3a')],_0x2fdb78['filters']));if(_0x586c56[_0xd9ff('0x3a')]['filter']){_0x32e672[_0xd9ff('0x44')]=_[_0xd9ff('0x43')](_0x32e672['where'],{'$or':_['map'](_0x32e672[_0xd9ff('0x3d')],function(_0x2ee0f3){var _0x51e968={};_0x51e968[_0x2ee0f3]={'$like':'%'+_0x586c56[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x51e968;})});}_0x32e672=_['merge']({},_0x32e672,_0x586c56[_0xd9ff('0x48')]);return _0x30abd8['getMembers'](_0x32e672);}})[_0xd9ff('0x27')](function(_0x210071){if(_0x210071){_0x3c8f01=_0x210071[_0xd9ff('0x3e')];if(!_0x586c56[_0xd9ff('0x3a')][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x32e672[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x586c56[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x32e672[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x586c56[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}return _0x30abd8['getMembers'](_0x32e672);}})[_0xd9ff('0x27')](function(_0xd68b90){return _0xd68b90?{'count':_0x3c8f01,'rows':_0xd68b90}:null;})[_0xd9ff('0x27')](respondWithResult(_0x51209e,null))[_0xd9ff('0x4c')](handleError(_0x51209e,null));};exports[_0xd9ff('0x94')]=function(_0x314f18,_0x534496,_0x5ba463){var _0x5a583d={};var _0x51f5f1={};var _0x4699d3;var _0x2e91a8;return db['VoiceQueue'][_0xd9ff('0x5e')]({'where':{'id':_0x314f18[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x534496,null))['then'](function(_0x5cd1e7){if(_0x5cd1e7){_0x4699d3=_0x5cd1e7;_0x51f5f1[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](db['CmList']['rawAttributes']);_0x51f5f1['query']=_['keys'](_0x314f18['query']);_0x51f5f1[_0xd9ff('0x42')]=_[_0xd9ff('0x3b')](_0x51f5f1[_0xd9ff('0x38')],_0x51f5f1[_0xd9ff('0x3a')]);_0x5a583d[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x51f5f1[_0xd9ff('0x38')],qs[_0xd9ff('0x3c')](_0x314f18[_0xd9ff('0x3a')][_0xd9ff('0x3c')]));_0x5a583d[_0xd9ff('0x3d')]=_0x5a583d[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x5a583d[_0xd9ff('0x3d')]:_0x51f5f1[_0xd9ff('0x38')];_0x5a583d[_0xd9ff('0x40')]=qs[_0xd9ff('0x41')](_0x314f18['query'][_0xd9ff('0x41')]);_0x5a583d['where']=qs[_0xd9ff('0x42')](_['pick'](_0x314f18[_0xd9ff('0x3a')],_0x51f5f1[_0xd9ff('0x42')]));if(_0x314f18[_0xd9ff('0x3a')]['filter']){_0x5a583d['where']=_['merge'](_0x5a583d['where'],{'$or':_['map'](_0x5a583d[_0xd9ff('0x3d')],function(_0x2031e9){var _0x3b50d9={};_0x3b50d9[_0x2031e9]={'$like':'%'+_0x314f18[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x3b50d9;})});}_0x5a583d=_[_0xd9ff('0x43')]({},_0x5a583d,_0x314f18['options']);return _0x4699d3[_0xd9ff('0x94')](_0x5a583d);}})[_0xd9ff('0x27')](function(_0x55cc92){if(_0x55cc92){_0x2e91a8=_0x55cc92['length'];if(!_0x314f18[_0xd9ff('0x3a')][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x5a583d['limit']=qs[_0xd9ff('0x21')](_0x314f18[_0xd9ff('0x3a')]['limit']);_0x5a583d[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x314f18[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}return _0x4699d3['getLists'](_0x5a583d);}})['then'](function(_0x46d12c){if(_0x46d12c){return _0x46d12c?{'count':_0x2e91a8,'rows':_0x46d12c}:null;}})[_0xd9ff('0x27')](respondWithResult(_0x534496,null))['catch'](handleError(_0x534496,null));};exports[_0xd9ff('0x95')]=function(_0x5c2f70,_0x39c2de,_0x70b6d8){var _0x10400b,_0x15bfd8;return db[_0xd9ff('0x36')][_0xd9ff('0x2f')]({'where':{'id':_0x5c2f70['params']['id']}})['then'](handleEntityNotFound(_0x39c2de,null))[_0xd9ff('0x27')](function(_0x47b1d7){if(_0x47b1d7){_0x15bfd8=_0x47b1d7;return _0x47b1d7[_0xd9ff('0x95')](_0x5c2f70['body'][_0xd9ff('0x81')],_[_0xd9ff('0x5b')](_0x5c2f70[_0xd9ff('0x5a')],['ids','id'])||{});}return null;})[_0xd9ff('0x8f')](function(_0xd4caa3){var _0x57cb46;_0x10400b=_0xd4caa3||[];var _0x4f8ed7=[];if(_0xd4caa3){for(var _0x538494=0x0;_0x538494<_0xd4caa3[_0xd9ff('0x3e')];_0x538494+=0x1){var _0x216224=_0xd4caa3[_0x538494][_0xd9ff('0x50')]({'plain':!![]});_0x15bfd8[_0xd9ff('0x96')]=_0x5c2f70[_0xd9ff('0x5a')][_0xd9ff('0x96')]?_0x5c2f70[_0xd9ff('0x5a')][_0xd9ff('0x96')]:_0x15bfd8['dialCheckDuplicateType'];switch(_0x15bfd8[_0xd9ff('0x96')]){case _0xd9ff('0x97'):_0x57cb46=squel[_0xd9ff('0x98')]()[_0xd9ff('0x99')](_0xd9ff('0x9a'))[_0xd9ff('0x9b')]([_0xd9ff('0x9c'),_0xd9ff('0x9d'),_0xd9ff('0x9e'),'ListId','VoiceQueueId','createdAt',_0xd9ff('0x59')],squel[_0xd9ff('0x82')]()['field'](_0xd9ff('0x9c'),'phone')['field'](_0xd9ff('0x9f'),_0xd9ff('0x9d'))[_0xd9ff('0x47')]('id',_0xd9ff('0x9e'))[_0xd9ff('0x47')](_0x216224[_0xd9ff('0xa0')]['toString'](),_0xd9ff('0xa1'))[_0xd9ff('0x47')](_0x5c2f70[_0xd9ff('0x4d')]['id'][_0xd9ff('0x88')](),_0xd9ff('0x66'))['field']('NOW()',_0xd9ff('0x58'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),_0xd9ff('0x59'))[_0xd9ff('0xa2')](_0xd9ff('0xa3'))[_0xd9ff('0x44')](_0xd9ff('0xa4'))[_0xd9ff('0x44')](_0xd9ff('0xa5'),_0x216224[_0xd9ff('0xa0')][_0xd9ff('0x88')]())[_0xd9ff('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0xd9ff('0x44')](_0xd9ff('0xa6'),squel[_0xd9ff('0x82')]()[_0xd9ff('0x47')](_0xd9ff('0xa7'))[_0xd9ff('0xa2')](_0xd9ff('0xa8'))[_0xd9ff('0x44')](_0xd9ff('0xa9'),_0x5c2f70[_0xd9ff('0x4d')]['id'][_0xd9ff('0x88')]()))[_0xd9ff('0x44')](_0xd9ff('0xa6'),squel['select']()[_0xd9ff('0x47')](_0xd9ff('0xaa'))[_0xd9ff('0xa2')](_0xd9ff('0x9a'))['where'](_0xd9ff('0xa9'),_0x5c2f70['params']['id']['toString']())))[_0xd9ff('0x88')]();break;case _0xd9ff('0xab'):_0x57cb46=squel[_0xd9ff('0x98')]()[_0xd9ff('0x99')](_0xd9ff('0x9a'))[_0xd9ff('0x9b')]([_0xd9ff('0x9c'),'scheduledAt',_0xd9ff('0x9e'),_0xd9ff('0xa1'),'VoiceQueueId',_0xd9ff('0x58'),_0xd9ff('0x59')],squel[_0xd9ff('0x82')]()[_0xd9ff('0x47')](_0xd9ff('0x9c'),_0xd9ff('0x9c'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),_0xd9ff('0x9d'))[_0xd9ff('0x47')]('id',_0xd9ff('0x9e'))['field'](_0x216224['CmListId'][_0xd9ff('0x88')](),_0xd9ff('0xa1'))[_0xd9ff('0x47')](_0x5c2f70[_0xd9ff('0x4d')]['id'][_0xd9ff('0x88')](),_0xd9ff('0x66'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),'createdAt')[_0xd9ff('0x47')]('NOW()',_0xd9ff('0x59'))[_0xd9ff('0xa2')]('cm_contacts')[_0xd9ff('0x44')](_0xd9ff('0xa4'))['where'](_0xd9ff('0xa5'),_0x216224['CmListId']['toString']())[_0xd9ff('0x44')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xd9ff('0xa6'),squel['select']()[_0xd9ff('0x47')](_0xd9ff('0xaa'))[_0xd9ff('0xa2')](_0xd9ff('0x9a'))[_0xd9ff('0x44')]('VoiceQueueId\x20=\x20?',_0x5c2f70[_0xd9ff('0x4d')]['id'][_0xd9ff('0x88')]())))['toString']();break;default:_0x57cb46=squel[_0xd9ff('0x98')]()[_0xd9ff('0x99')]('cm_hopper')['fromQuery']([_0xd9ff('0x9c'),'scheduledAt','ContactId','ListId',_0xd9ff('0x66'),'createdAt','updatedAt'],squel[_0xd9ff('0x82')]()[_0xd9ff('0x47')](_0xd9ff('0x9c'),_0xd9ff('0x9c'))['field'](_0xd9ff('0x9f'),_0xd9ff('0x9d'))[_0xd9ff('0x47')]('id',_0xd9ff('0x9e'))['field'](_0x216224[_0xd9ff('0xa0')]['toString'](),'ListId')[_0xd9ff('0x47')](_0x5c2f70[_0xd9ff('0x4d')]['id'][_0xd9ff('0x88')](),_0xd9ff('0x66'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),_0xd9ff('0x58'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),'updatedAt')[_0xd9ff('0xa2')](_0xd9ff('0xa3'))[_0xd9ff('0x44')](_0xd9ff('0xa4'))[_0xd9ff('0x44')](_0xd9ff('0xa5'),_0x216224['CmListId'][_0xd9ff('0x88')]())[_0xd9ff('0x44')](_0xd9ff('0xac')))[_0xd9ff('0x88')]();}_0x4f8ed7[_0xd9ff('0x86')](db['sequelize'][_0xd9ff('0x3a')](_0x57cb46));}return BPromise[_0xd9ff('0x8c')](_0x4f8ed7);}})[_0xd9ff('0x27')](function(){return _0x10400b;})[_0xd9ff('0x27')](respondWithResult(_0x39c2de,null))[_0xd9ff('0x4c')](handleError(_0x39c2de,null));};exports[_0xd9ff('0xad')]=function(_0x2dad33,_0x54fd9c,_0x18cd6f){return db[_0xd9ff('0x36')]['find']({'where':{'id':_0x2dad33[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x54fd9c,null))[_0xd9ff('0x27')](function(_0x24bfca){if(_0x24bfca){return _0x24bfca[_0xd9ff('0xad')](_0x2dad33[_0xd9ff('0x3a')][_0xd9ff('0x81')]);}})[_0xd9ff('0x27')](function(_0x2e542f){if(_0x2e542f){return db[_0xd9ff('0x5f')]['destroy']({'where':{'ListId':_0x2dad33[_0xd9ff('0x3a')][_0xd9ff('0x81')],'VoiceQueueId':_0x2dad33['params']['id']}})[_0xd9ff('0x27')](function(){return _0x2e542f;});}})['then'](respondWithStatusCode(_0x54fd9c,null))[_0xd9ff('0x4c')](handleError(_0x54fd9c,null));};exports[_0xd9ff('0xae')]=function(_0x4fef50,_0xb03842,_0x258eec){var _0x36df60={};var _0x4a4075={};var _0x96db43;var _0x5450c2;return db['VoiceQueue'][_0xd9ff('0x5e')]({'where':{'id':_0x4fef50[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0xb03842,null))[_0xd9ff('0x27')](function(_0x2277ad){if(_0x2277ad){_0x96db43=_0x2277ad;_0x4a4075['model']=_[_0xd9ff('0x39')](db[_0xd9ff('0xaf')][_0xd9ff('0x37')]);_0x4a4075[_0xd9ff('0x3a')]=_['keys'](_0x4fef50[_0xd9ff('0x3a')]);_0x4a4075[_0xd9ff('0x42')]=_[_0xd9ff('0x3b')](_0x4a4075[_0xd9ff('0x38')],_0x4a4075[_0xd9ff('0x3a')]);_0x36df60[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x4a4075[_0xd9ff('0x38')],qs['fields'](_0x4fef50[_0xd9ff('0x3a')][_0xd9ff('0x3c')]));_0x36df60[_0xd9ff('0x3d')]=_0x36df60['attributes'][_0xd9ff('0x3e')]?_0x36df60[_0xd9ff('0x3d')]:_0x4a4075[_0xd9ff('0x38')];_0x36df60['order']=qs[_0xd9ff('0x41')](_0x4fef50['query'][_0xd9ff('0x41')]);_0x36df60[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x4fef50[_0xd9ff('0x3a')],_0x4a4075[_0xd9ff('0x42')]));if(_0x4fef50[_0xd9ff('0x3a')][_0xd9ff('0x2a')]){_0x36df60[_0xd9ff('0x44')]=_[_0xd9ff('0x43')](_0x36df60[_0xd9ff('0x44')],{'$or':_[_0xd9ff('0x62')](_0x36df60[_0xd9ff('0x3d')],function(_0x12ed06){var _0x27b34c={};_0x27b34c[_0x12ed06]={'$like':'%'+_0x4fef50[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x27b34c;})});}_0x36df60=_[_0xd9ff('0x43')]({},_0x36df60,_0x4fef50[_0xd9ff('0x48')]);return _0x96db43[_0xd9ff('0xae')](_0x36df60);}})[_0xd9ff('0x27')](function(_0x5c09c4){if(_0x5c09c4){_0x5450c2=_0x5c09c4[_0xd9ff('0x3e')];if(!_0x4fef50[_0xd9ff('0x3a')]['hasOwnProperty']('nolimit')){_0x36df60[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x4fef50[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x36df60[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x4fef50['query'][_0xd9ff('0x20')]);}return _0x96db43[_0xd9ff('0xae')](_0x36df60);}})[_0xd9ff('0x27')](function(_0xed2875){if(_0xed2875){return _0xed2875?{'count':_0x5450c2,'rows':_0xed2875}:null;}})[_0xd9ff('0x27')](respondWithResult(_0xb03842,null))['catch'](handleError(_0xb03842,null));};exports['addBlackLists']=function(_0x12b512,_0xb4be84,_0x5de7ff){var _0x172027,_0x32119e;return db[_0xd9ff('0x36')][_0xd9ff('0x2f')]({'where':{'id':_0x12b512[_0xd9ff('0x4d')]['id']}})['then'](handleEntityNotFound(_0xb4be84,null))[_0xd9ff('0x27')](function(_0x4f378c){if(_0x4f378c){_0x32119e=_0x4f378c;return _0x4f378c[_0xd9ff('0xb0')](_0x12b512['body'][_0xd9ff('0x81')],_[_0xd9ff('0x5b')](_0x12b512[_0xd9ff('0x5a')],[_0xd9ff('0x81'),'id'])||{});}return null;})[_0xd9ff('0x8f')](function(_0x3c9f51){var _0x23c031;_0x172027=_0x3c9f51||[];var _0x57d141=[];if(_0x3c9f51){for(var _0x39417a=0x0;_0x39417a<_0x3c9f51['length'];_0x39417a+=0x1){var _0x558e6e=_0x3c9f51[_0x39417a]['get']({'plain':!![]});_0x23c031=squel['insert']()[_0xd9ff('0x99')](_0xd9ff('0xb1'))['fromQuery']([_0xd9ff('0x9c'),'ContactId',_0xd9ff('0xa1'),'VoiceQueueId',_0xd9ff('0x58'),_0xd9ff('0x59')],squel['select']()[_0xd9ff('0x47')](_0xd9ff('0x9c'),_0xd9ff('0x9c'))[_0xd9ff('0x47')]('id','ContactId')[_0xd9ff('0x47')](_0x558e6e[_0xd9ff('0xa0')][_0xd9ff('0x88')](),_0xd9ff('0xa1'))['field'](_0x12b512[_0xd9ff('0x4d')]['id']['toString'](),'VoiceQueueId')[_0xd9ff('0x47')](_0xd9ff('0x9f'),_0xd9ff('0x58'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),_0xd9ff('0x59'))['from'](_0xd9ff('0xa3'))[_0xd9ff('0x44')](_0xd9ff('0xa4'))[_0xd9ff('0x44')](_0xd9ff('0xa5'),_0x558e6e['CmListId'][_0xd9ff('0x88')]())[_0xd9ff('0x44')](_0xd9ff('0xac')))[_0xd9ff('0x88')]();_0x57d141[_0xd9ff('0x86')](db[_0xd9ff('0x87')][_0xd9ff('0x3a')](_0x23c031));}return BPromise[_0xd9ff('0x8c')](_0x57d141);}})['then'](function(){return _0x172027;})[_0xd9ff('0x27')](respondWithResult(_0xb4be84,null))['catch'](handleError(_0xb4be84,null));};exports[_0xd9ff('0xb2')]=function(_0x2c36b0,_0x35e09a,_0x2d605e){return db[_0xd9ff('0x36')][_0xd9ff('0x2f')]({'where':{'id':_0x2c36b0[_0xd9ff('0x4d')]['id']}})['then'](handleEntityNotFound(_0x35e09a,null))[_0xd9ff('0x27')](function(_0x4727d4){if(_0x4727d4){return _0x4727d4['removeBlackLists'](_0x2c36b0[_0xd9ff('0x3a')][_0xd9ff('0x81')]);}})[_0xd9ff('0x27')](function(_0x4d0ba8){if(_0x4d0ba8){return db['CmHopperBlack'][_0xd9ff('0x32')]({'where':{'ListId':_0x2c36b0[_0xd9ff('0x3a')][_0xd9ff('0x81')],'VoiceQueueId':_0x2c36b0['params']['id']}})[_0xd9ff('0x27')](function(){return _0x4d0ba8;});}})['then'](respondWithStatusCode(_0x35e09a,null))['catch'](handleError(_0x35e09a,null));};
\ No newline at end of file
+var _0x1a37=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','inbound','QueueCampaigns','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','VoiceQueue','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','options','count','include','findAll','rows','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','VoiceQueues','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','online','voicePause','interface','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','upsert','forEach','emit','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','union','compact','isEmpty','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','isNil','format','all','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ContactId','ListId','NOW()','scheduledAt','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','removeLists','getBlackLists','addBlackLists','removeBlackLists','html-pdf','eml-format'];(function(_0x355992,_0x478a8a){var _0x480f49=function(_0x386212){while(--_0x386212){_0x355992['push'](_0x355992['shift']());}};_0x480f49(++_0x478a8a);}(_0x1a37,0xb4));var _0x71a3=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x1a37[_0x334841];return _0x5beb4b;};'use strict';var pdf=require(_0x71a3('0x0'));var emlformat=require(_0x71a3('0x1'));var rimraf=require(_0x71a3('0x2'));var zipdir=require(_0x71a3('0x3'));var jsonpatch=require(_0x71a3('0x4'));var rp=require(_0x71a3('0x5'));var moment=require(_0x71a3('0x6'));var BPromise=require(_0x71a3('0x7'));var Mustache=require(_0x71a3('0x8'));var util=require(_0x71a3('0x9'));var path=require('path');var sox=require(_0x71a3('0xa'));var csv=require('to-csv');var ejs=require(_0x71a3('0xb'));var fs=require('fs');var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var hardwareService=require(_0x71a3('0x13'));var logger=require(_0x71a3('0x14'))(_0x71a3('0x15'));var utils=require(_0x71a3('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x71a3('0x17')](config[_0x71a3('0x18')],{'host':_0x71a3('0x19'),'port':0x18eb});var socket=require(_0x71a3('0x1a'))(new Redis(config[_0x71a3('0x18')]));require(_0x71a3('0x1b'))[_0x71a3('0x1c')](socket);function respondWithStatusCode(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xcc;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x1d')](_0x4dc4ed);}return _0x3b256c['status'](_0x4dc4ed)[_0x71a3('0x1e')]();};}function respondWithResult(_0x32591a,_0x59021f){_0x59021f=_0x59021f||0xc8;return function(_0x4aa918){if(_0x4aa918){return _0x32591a[_0x71a3('0x1f')](_0x59021f)[_0x71a3('0x20')](_0x4aa918);}};}function respondWithFilteredResult(_0xee797f,_0x201ed8){return function(_0x1af1bc){if(_0x1af1bc){var _0x318ff6=_0x1af1bc['count'],_0x5d4dee=_0x201ed8['offset'],_0x656cd2=_0x201ed8[_0x71a3('0x21')]+_0x201ed8[_0x71a3('0x22')],_0x27bfb4;if(_0x656cd2>=_0x318ff6){_0x656cd2=_0x318ff6;_0x27bfb4=0xc8;}else{_0x27bfb4=0xce;}_0xee797f[_0x71a3('0x1f')](_0x27bfb4);return _0xee797f[_0x71a3('0x23')](_0x71a3('0x24'),_0x5d4dee+'-'+_0x656cd2+'/'+_0x318ff6)['json'](_0x1af1bc);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x25')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x26')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x27')](_0x1af24b)[_0x71a3('0x28')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x29')]()[_0x71a3('0x28')](function(){var _0xb9c195=_0x5f33c5[_0x71a3('0x2a')]({'plain':!![]});var _0xb0f3aa=[{'name':'VoiceQueues','value':_0x71a3('0x2b'),'ignore':![]},{'name':_0x71a3('0x2c'),'value':'outbound','ignore':![]}];var _0x412746=_(_0xb0f3aa)['filter'](_0x71a3('0x2d'))[_0x71a3('0x2e')](_0x71a3('0x2f'))[_0x71a3('0x2f')]();if(_[_0x71a3('0x30')](_0x412746,_0xb9c195[_0x71a3('0x31')])){return;}var _0x2317ec=_[_0x71a3('0x32')](_0xb0f3aa,[_0x71a3('0x2f'),_0xb9c195[_0x71a3('0x31')]])[_0x71a3('0x33')];return db[_0x71a3('0x34')]['destroy']({'where':{'type':_0x2317ec,'resourceId':_0xb9c195['id']}})[_0x71a3('0x28')](function(){return _0x5f33c5;});})[_0x71a3('0x28')](function(){_0x452bc4[_0x71a3('0x1f')](0xcc)[_0x71a3('0x1e')]();});}};}function handleEntityNotFound(_0x4a750c,_0x18a8fe){return function(_0x216d84){if(!_0x216d84){_0x4a750c[_0x71a3('0x1d')](0x194);}return _0x216d84;};}function handleError(_0x114032,_0x39734f){_0x39734f=_0x39734f||0x1f4;return function(_0xa82e46){logger[_0x71a3('0x35')](_0xa82e46['stack']);if(_0xa82e46[_0x71a3('0x33')]){delete _0xa82e46[_0x71a3('0x33')];}_0x114032[_0x71a3('0x1f')](_0x39734f)[_0x71a3('0x36')](_0xa82e46);};}exports[_0x71a3('0x37')]=function(_0x73c8e7,_0x425d83){var _0x257bd7={},_0x3bf186={},_0x3eda28={'count':0x0,'rows':[]};var _0x2376e5=db[_0x71a3('0x38')][_0x71a3('0x39')];_0x3bf186['model']=_['keys'](_0x2376e5);_0x3bf186[_0x71a3('0x3a')]=_[_0x71a3('0x3b')](_0x73c8e7['query']);_0x3bf186[_0x71a3('0x3c')]=_[_0x71a3('0x3d')](_0x3bf186['model'],_0x3bf186[_0x71a3('0x3a')]);_0x257bd7[_0x71a3('0x3e')]=_[_0x71a3('0x3d')](_0x3bf186[_0x71a3('0x3f')],qs[_0x71a3('0x40')](_0x73c8e7[_0x71a3('0x3a')][_0x71a3('0x40')]));_0x257bd7['attributes']=_0x257bd7[_0x71a3('0x3e')][_0x71a3('0x41')]?_0x257bd7[_0x71a3('0x3e')]:_0x3bf186['model'];if(!_0x73c8e7[_0x71a3('0x3a')][_0x71a3('0x42')](_0x71a3('0x43'))){_0x257bd7[_0x71a3('0x22')]=qs[_0x71a3('0x22')](_0x73c8e7['query']['limit']);_0x257bd7[_0x71a3('0x21')]=qs[_0x71a3('0x21')](_0x73c8e7[_0x71a3('0x3a')][_0x71a3('0x21')]);}_0x257bd7[_0x71a3('0x44')]=qs['sort'](_0x73c8e7[_0x71a3('0x3a')][_0x71a3('0x45')]);_0x257bd7[_0x71a3('0x46')]=qs['filters'](_[_0x71a3('0x47')](_0x73c8e7['query'],_0x3bf186[_0x71a3('0x3c')]));if(_0x73c8e7[_0x71a3('0x3a')][_0x71a3('0x48')]){_0x257bd7[_0x71a3('0x46')]=_[_0x71a3('0x49')](_0x257bd7[_0x71a3('0x46')],{'$or':_[_0x71a3('0x2e')](_0x2376e5,function(_0x40a18f){if(_0x40a18f[_0x71a3('0x31')][_0x71a3('0x4a')]!=='VIRTUAL'){var _0xa49846={};_0xa49846[_0x40a18f['field']]={'$like':'%'+_0x73c8e7[_0x71a3('0x3a')][_0x71a3('0x48')]+'%'};return _0xa49846;}})});}_0x257bd7=_[_0x71a3('0x49')]({},_0x257bd7,_0x73c8e7[_0x71a3('0x4b')]);var _0x59c7c9={'where':_0x257bd7[_0x71a3('0x46')]};return db[_0x71a3('0x38')]['count'](_0x59c7c9)[_0x71a3('0x28')](function(_0x8c731){_0x3eda28[_0x71a3('0x4c')]=_0x8c731;if(_0x73c8e7[_0x71a3('0x3a')]['includeAll']){_0x257bd7[_0x71a3('0x4d')]=[{'all':!![]}];}return db[_0x71a3('0x38')][_0x71a3('0x4e')](_0x257bd7);})[_0x71a3('0x28')](function(_0x2ff60b){_0x3eda28[_0x71a3('0x4f')]=_0x2ff60b;return _0x3eda28;})[_0x71a3('0x28')](respondWithFilteredResult(_0x425d83,_0x257bd7))[_0x71a3('0x50')](handleError(_0x425d83,null));};exports[_0x71a3('0x51')]=function(_0x3a18c4,_0x18a9a2){var _0xf320cd={'raw':![],'where':{'id':_0x3a18c4[_0x71a3('0x52')]['id']}},_0x3ab522={};_0x3ab522[_0x71a3('0x3f')]=_[_0x71a3('0x3b')](db['VoiceQueue'][_0x71a3('0x39')]);_0x3ab522[_0x71a3('0x3a')]=_['keys'](_0x3a18c4[_0x71a3('0x3a')]);_0x3ab522[_0x71a3('0x3c')]=_[_0x71a3('0x3d')](_0x3ab522[_0x71a3('0x3f')],_0x3ab522[_0x71a3('0x3a')]);_0xf320cd['attributes']=_['intersection'](_0x3ab522[_0x71a3('0x3f')],qs[_0x71a3('0x40')](_0x3a18c4['query'][_0x71a3('0x40')]));_0xf320cd[_0x71a3('0x3e')]=_0xf320cd[_0x71a3('0x3e')][_0x71a3('0x41')]?_0xf320cd[_0x71a3('0x3e')]:_0x3ab522[_0x71a3('0x3f')];if(_0x3a18c4['query'][_0x71a3('0x53')]){_0xf320cd['include']=[{'all':!![]}];}_0xf320cd=_[_0x71a3('0x49')]({},_0xf320cd,_0x3a18c4[_0x71a3('0x4b')]);return db[_0x71a3('0x38')][_0x71a3('0x32')](_0xf320cd)[_0x71a3('0x28')](handleEntityNotFound(_0x18a9a2,null))['then'](respondWithResult(_0x18a9a2,null))[_0x71a3('0x50')](handleError(_0x18a9a2,null));};exports[_0x71a3('0x54')]=function(_0xa0e8aa,_0x4badc0){return db[_0x71a3('0x38')]['create'](_0xa0e8aa[_0x71a3('0x55')],{})[_0x71a3('0x28')](function(_0x5c6450){var _0x30cea2=_0xa0e8aa[_0x71a3('0x56')][_0x71a3('0x2a')]({'plain':!![]});if(!_0x30cea2)throw new Error(_0x71a3('0x57'));if(_0x30cea2[_0x71a3('0x58')]===_0x71a3('0x56')){var _0x13a9ed=_0x5c6450['get']({'plain':!![]});var _0x2d4a2e=[{'name':'VoiceQueues','value':_0x71a3('0x2b')},{'name':'QueueCampaigns','value':_0x71a3('0x59')}];var _0xa09676=_[_0x71a3('0x32')](_0x2d4a2e,[_0x71a3('0x2f'),_0x13a9ed['type']])['name'];return db[_0x71a3('0x5a')][_0x71a3('0x32')]({'where':{'name':_0xa09676,'userProfileId':_0x30cea2[_0x71a3('0x5b')]},'raw':!![]})[_0x71a3('0x28')](function(_0x4d9181){if(_0x4d9181&&_0x4d9181['autoAssociation']===0x0){return db[_0x71a3('0x34')][_0x71a3('0x54')]({'name':_0x13a9ed[_0x71a3('0x33')],'resourceId':_0x13a9ed['id'],'type':_0x4d9181[_0x71a3('0x33')],'sectionId':_0x4d9181['id']},{})[_0x71a3('0x28')](function(){return _0x5c6450;});}else{return _0x5c6450;}})['catch'](function(_0x421b6a){logger[_0x71a3('0x35')](_0x71a3('0x5c'),_0x421b6a);throw _0x421b6a;});}return _0x5c6450;})[_0x71a3('0x28')](respondWithResult(_0x4badc0,0xc9))[_0x71a3('0x50')](handleError(_0x4badc0,null));};exports[_0x71a3('0x5d')]=function(_0x2eb690,_0x43a276){var _0x573486={'raw':![],'where':{'id':_0x2eb690[_0x71a3('0x52')]['id']}},_0x384199={};_0x384199[_0x71a3('0x3f')]=_['keys'](db[_0x71a3('0x38')][_0x71a3('0x39')]);_0x573486[_0x71a3('0x3e')]=_[_0x71a3('0x3d')](_0x384199[_0x71a3('0x3f')],qs[_0x71a3('0x40')](_0x2eb690[_0x71a3('0x3a')][_0x71a3('0x40')]));_0x573486[_0x71a3('0x3e')]=_0x573486[_0x71a3('0x3e')]['length']?_0x573486[_0x71a3('0x3e')]:_0x384199[_0x71a3('0x3f')];if(_0x2eb690['query'][_0x71a3('0x53')]){_0x573486['include']=[{'all':!![]}];}_0x573486=_['merge']({},_0x573486,_0x2eb690[_0x71a3('0x4b')]);return db[_0x71a3('0x38')][_0x71a3('0x32')](_0x573486)[_0x71a3('0x28')](handleEntityNotFound(_0x43a276,null))[_0x71a3('0x28')](function(_0x5cffd2){if(_0x5cffd2){var _0x121b2d=_0x5cffd2[_0x71a3('0x2a')]({'plain':!![]});_0x121b2d=qs['omit'](_0x121b2d,['id',_0x71a3('0x5e'),'updatedAt']);_0x2eb690[_0x71a3('0x55')]=_[_0x71a3('0x5f')](_0x2eb690['body'],['id','createdAt',_0x71a3('0x60')]);return db[_0x71a3('0x38')]['create'](_[_0x71a3('0x49')](_0x121b2d,_0x2eb690[_0x71a3('0x55')]),{'include':_0x2eb690[_0x71a3('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x71a3('0x28')](function(_0x18494a){var _0x287c63=_0x2eb690[_0x71a3('0x56')][_0x71a3('0x2a')]({'plain':!![]});if(!_0x287c63)throw new Error(_0x71a3('0x57'));if(_0x287c63[_0x71a3('0x58')]===_0x71a3('0x56')){var _0xe03bb5=_0x18494a['get']({'plain':!![]});var _0x4e5ab1=[{'name':_0x71a3('0x61'),'value':_0x71a3('0x2b')},{'name':'QueueCampaigns','value':_0x71a3('0x59')}];var _0x22ed3e=_[_0x71a3('0x32')](_0x4e5ab1,[_0x71a3('0x2f'),_0xe03bb5[_0x71a3('0x31')]])[_0x71a3('0x33')];return db[_0x71a3('0x5a')][_0x71a3('0x32')]({'where':{'name':_0x22ed3e,'userProfileId':_0x287c63[_0x71a3('0x5b')]},'raw':!![]})['then'](function(_0x2e0a69){if(_0x2e0a69&&_0x2e0a69['autoAssociation']===0x0){return db[_0x71a3('0x34')]['create']({'name':_0xe03bb5['name'],'resourceId':_0xe03bb5['id'],'type':_0x2e0a69[_0x71a3('0x33')],'sectionId':_0x2e0a69['id']},{})['then'](function(){return _0x18494a;});}else{return _0x18494a;}})[_0x71a3('0x50')](function(_0x271e37){logger[_0x71a3('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x271e37);throw _0x271e37;});}return _0x18494a;});}})[_0x71a3('0x28')](respondWithResult(_0x43a276,0xc9))[_0x71a3('0x50')](handleError(_0x43a276,null));};exports['update']=function(_0x401367,_0x189320){if(_0x401367[_0x71a3('0x55')]['id']){delete _0x401367[_0x71a3('0x55')]['id'];}return db[_0x71a3('0x38')][_0x71a3('0x32')]({'where':{'id':_0x401367[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x189320,null))['then'](saveUpdates(_0x401367['body'],null))[_0x71a3('0x28')](respondWithResult(_0x189320,null))[_0x71a3('0x50')](handleError(_0x189320,null));};exports[_0x71a3('0x29')]=function(_0x5f4ef0,_0xa2b238){return db[_0x71a3('0x38')]['find']({'where':{'id':_0x5f4ef0[_0x71a3('0x52')]['id']}})['then'](handleEntityNotFound(_0xa2b238,null))[_0x71a3('0x28')](removeEntity(_0xa2b238,null))[_0x71a3('0x50')](handleError(_0xa2b238,null));};exports[_0x71a3('0x62')]=function(_0x184389,_0x528c4b,_0x7c9e78){var _0x3352c5={'raw':![],'where':{}};var _0x505c68={};var _0x296c6a={'count':0x0,'rows':[]};return db[_0x71a3('0x38')][_0x71a3('0x63')]({'where':{'id':_0x184389[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x528c4b,null))[_0x71a3('0x28')](function(_0x3fbbec){if(_0x3fbbec){_0x505c68[_0x71a3('0x3f')]=_[_0x71a3('0x3b')](db[_0x71a3('0x64')][_0x71a3('0x39')]);_0x505c68[_0x71a3('0x3a')]=_['keys'](_0x184389[_0x71a3('0x3a')]);_0x505c68['filters']=_[_0x71a3('0x3d')](_0x505c68[_0x71a3('0x3f')],_0x505c68[_0x71a3('0x3a')]);_0x3352c5[_0x71a3('0x3e')]=_[_0x71a3('0x3d')](_0x505c68[_0x71a3('0x3f')],qs[_0x71a3('0x40')](_0x184389[_0x71a3('0x3a')][_0x71a3('0x40')]));_0x3352c5[_0x71a3('0x3e')]=_0x3352c5[_0x71a3('0x3e')][_0x71a3('0x41')]?_0x3352c5[_0x71a3('0x3e')]:_0x505c68[_0x71a3('0x3f')];if(!_0x184389[_0x71a3('0x3a')][_0x71a3('0x42')](_0x71a3('0x43'))){_0x3352c5[_0x71a3('0x22')]=qs[_0x71a3('0x22')](_0x184389['query'][_0x71a3('0x22')]);_0x3352c5[_0x71a3('0x21')]=qs[_0x71a3('0x21')](_0x184389[_0x71a3('0x3a')][_0x71a3('0x21')]);}_0x3352c5[_0x71a3('0x44')]=qs[_0x71a3('0x45')](_0x184389['query'][_0x71a3('0x45')]);_0x3352c5['where']=qs['filters'](_['pick'](_0x184389['query'],_0x505c68['filters']));_0x3352c5['where'][_0x71a3('0x65')]=_0x3fbbec['id'];if(_0x184389[_0x71a3('0x3a')][_0x71a3('0x48')]){_0x3352c5[_0x71a3('0x46')]=_[_0x71a3('0x49')](_0x3352c5[_0x71a3('0x46')],{'$or':_[_0x71a3('0x2e')](_0x3352c5[_0x71a3('0x3e')],function(_0x24f195){var _0x291c32={};_0x291c32[_0x24f195]={'$like':'%'+_0x184389[_0x71a3('0x3a')][_0x71a3('0x48')]+'%'};return _0x291c32;})});}_0x3352c5=_[_0x71a3('0x49')]({},_0x3352c5,_0x184389['options']);return db[_0x71a3('0x64')][_0x71a3('0x4c')]({'where':_0x3352c5[_0x71a3('0x46')]})[_0x71a3('0x28')](function(_0x38f928){_0x296c6a[_0x71a3('0x4c')]=_0x38f928;if(_0x184389['query']['includeAll']){_0x3352c5['include']=[{'all':!![]}];}return db[_0x71a3('0x64')][_0x71a3('0x4e')](_0x3352c5);})[_0x71a3('0x28')](function(_0x49c2fb){_0x296c6a[_0x71a3('0x4f')]=_0x49c2fb;return _0x296c6a;});}})[_0x71a3('0x28')](respondWithFilteredResult(_0x528c4b,_0x3352c5))[_0x71a3('0x50')](handleError(_0x528c4b,null));};exports[_0x71a3('0x66')]=function(_0x2fb980,_0x1fdbdf,_0x3988d7){var _0x28c184={'raw':!![],'where':{}};var _0x2e281d={};var _0x583029={'count':0x0,'rows':[]};return db[_0x71a3('0x38')][_0x71a3('0x63')]({'where':{'id':_0x2fb980['params']['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x1fdbdf,null))['then'](function(_0x2d3b17){if(_0x2d3b17){_0x2e281d[_0x71a3('0x3f')]=_[_0x71a3('0x3b')](db[_0x71a3('0x67')][_0x71a3('0x39')]);_0x2e281d['query']=_[_0x71a3('0x3b')](_0x2fb980[_0x71a3('0x3a')]);_0x2e281d['filters']=_[_0x71a3('0x3d')](_0x2e281d[_0x71a3('0x3f')],_0x2e281d[_0x71a3('0x3a')]);_0x28c184['attributes']=_[_0x71a3('0x3d')](_0x2e281d[_0x71a3('0x3f')],qs[_0x71a3('0x40')](_0x2fb980['query']['fields']));_0x28c184[_0x71a3('0x3e')]=_0x28c184[_0x71a3('0x3e')][_0x71a3('0x41')]?_0x28c184['attributes']:_0x2e281d[_0x71a3('0x3f')];if(!_0x2fb980['query'][_0x71a3('0x42')](_0x71a3('0x43'))){_0x28c184[_0x71a3('0x22')]=qs['limit'](_0x2fb980[_0x71a3('0x3a')]['limit']);_0x28c184[_0x71a3('0x21')]=qs[_0x71a3('0x21')](_0x2fb980[_0x71a3('0x3a')][_0x71a3('0x21')]);}_0x28c184[_0x71a3('0x44')]=qs['sort'](_0x2fb980[_0x71a3('0x3a')][_0x71a3('0x45')]);_0x28c184['where']=qs['filters'](_[_0x71a3('0x47')](_0x2fb980[_0x71a3('0x3a')],_0x2e281d[_0x71a3('0x3c')]));_0x28c184['where'][_0x71a3('0x65')]=_0x2d3b17['id'];if(_0x2fb980[_0x71a3('0x3a')][_0x71a3('0x48')]){_0x28c184[_0x71a3('0x46')]=_[_0x71a3('0x49')](_0x28c184[_0x71a3('0x46')],{'$or':_[_0x71a3('0x2e')](_0x28c184['attributes'],function(_0x1b3b05){var _0xd87f34={};_0xd87f34[_0x1b3b05]={'$like':'%'+_0x2fb980[_0x71a3('0x3a')][_0x71a3('0x48')]+'%'};return _0xd87f34;})});}_0x28c184=_['merge']({},_0x28c184,_0x2fb980[_0x71a3('0x4b')]);return db[_0x71a3('0x67')][_0x71a3('0x4c')]({'where':_0x28c184[_0x71a3('0x46')]})[_0x71a3('0x28')](function(_0x220299){_0x583029[_0x71a3('0x4c')]=_0x220299;if(_0x2fb980[_0x71a3('0x3a')]['includeAll']){_0x28c184[_0x71a3('0x4d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x71a3('0x4e')](_0x28c184);})[_0x71a3('0x28')](function(_0x212596){_0x583029[_0x71a3('0x4f')]=_0x212596;return _0x583029;});}})['then'](respondWithFilteredResult(_0x1fdbdf,_0x28c184))['catch'](handleError(_0x1fdbdf,null));};exports['getHopperFinals']=function(_0x2fb60b,_0x38d740,_0x1dd77f){var _0x3fb03e={'raw':!![],'where':{}};var _0x2bd58f={};var _0x11014c={'count':0x0,'rows':[]};return db[_0x71a3('0x38')][_0x71a3('0x63')]({'where':{'id':_0x2fb60b[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x38d740,null))['then'](function(_0x841d6){if(_0x841d6){_0x2bd58f[_0x71a3('0x3f')]=_[_0x71a3('0x3b')](db[_0x71a3('0x68')][_0x71a3('0x39')]);_0x2bd58f[_0x71a3('0x3a')]=_['keys'](_0x2fb60b[_0x71a3('0x3a')]);_0x2bd58f['filters']=_[_0x71a3('0x3d')](_0x2bd58f['model'],_0x2bd58f[_0x71a3('0x3a')]);_0x3fb03e[_0x71a3('0x3e')]=_['intersection'](_0x2bd58f[_0x71a3('0x3f')],qs['fields'](_0x2fb60b[_0x71a3('0x3a')]['fields']));_0x3fb03e[_0x71a3('0x3e')]=_0x3fb03e[_0x71a3('0x3e')]['length']?_0x3fb03e[_0x71a3('0x3e')]:_0x2bd58f[_0x71a3('0x3f')];if(!_0x2fb60b[_0x71a3('0x3a')][_0x71a3('0x42')](_0x71a3('0x43'))){_0x3fb03e[_0x71a3('0x22')]=qs[_0x71a3('0x22')](_0x2fb60b[_0x71a3('0x3a')]['limit']);_0x3fb03e[_0x71a3('0x21')]=qs[_0x71a3('0x21')](_0x2fb60b[_0x71a3('0x3a')]['offset']);}_0x3fb03e[_0x71a3('0x44')]=qs[_0x71a3('0x45')](_0x2fb60b[_0x71a3('0x3a')]['sort']);_0x3fb03e['where']=qs[_0x71a3('0x3c')](_[_0x71a3('0x47')](_0x2fb60b['query'],_0x2bd58f[_0x71a3('0x3c')]));_0x3fb03e[_0x71a3('0x46')][_0x71a3('0x65')]=_0x841d6['id'];if(_0x2fb60b[_0x71a3('0x3a')][_0x71a3('0x48')]){_0x3fb03e[_0x71a3('0x46')]=_[_0x71a3('0x49')](_0x3fb03e['where'],{'$or':_[_0x71a3('0x2e')](_0x3fb03e[_0x71a3('0x3e')],function(_0x4e4573){var _0x5e7669={};_0x5e7669[_0x4e4573]={'$like':'%'+_0x2fb60b[_0x71a3('0x3a')][_0x71a3('0x48')]+'%'};return _0x5e7669;})});}_0x3fb03e=_['merge']({},_0x3fb03e,_0x2fb60b[_0x71a3('0x4b')]);return db[_0x71a3('0x68')][_0x71a3('0x4c')]({'where':_0x3fb03e['where']})['then'](function(_0x41d926){_0x11014c[_0x71a3('0x4c')]=_0x41d926;if(_0x2fb60b[_0x71a3('0x3a')][_0x71a3('0x53')]){_0x3fb03e[_0x71a3('0x4d')]=[{'all':!![]}];}return db[_0x71a3('0x68')][_0x71a3('0x4e')](_0x3fb03e);})[_0x71a3('0x28')](function(_0x17636b){_0x11014c['rows']=_0x17636b;return _0x11014c;});}})[_0x71a3('0x28')](respondWithFilteredResult(_0x38d740,_0x3fb03e))['catch'](handleError(_0x38d740,null));};exports[_0x71a3('0x69')]=function(_0x3f9fa4,_0x334546,_0x474438){var _0x5e224b={'raw':!![],'where':{}};var _0x500bd9={};var _0x2acec5={'count':0x0,'rows':[]};return db[_0x71a3('0x38')][_0x71a3('0x63')]({'where':{'id':_0x3f9fa4[_0x71a3('0x52')]['id']}})['then'](handleEntityNotFound(_0x334546,null))[_0x71a3('0x28')](function(_0x609352){if(_0x609352){_0x500bd9['model']=_[_0x71a3('0x3b')](db['CmHopperBlack'][_0x71a3('0x39')]);_0x500bd9[_0x71a3('0x3a')]=_[_0x71a3('0x3b')](_0x3f9fa4[_0x71a3('0x3a')]);_0x500bd9[_0x71a3('0x3c')]=_['intersection'](_0x500bd9[_0x71a3('0x3f')],_0x500bd9['query']);_0x5e224b[_0x71a3('0x3e')]=_[_0x71a3('0x3d')](_0x500bd9[_0x71a3('0x3f')],qs[_0x71a3('0x40')](_0x3f9fa4[_0x71a3('0x3a')][_0x71a3('0x40')]));_0x5e224b[_0x71a3('0x3e')]=_0x5e224b[_0x71a3('0x3e')][_0x71a3('0x41')]?_0x5e224b[_0x71a3('0x3e')]:_0x500bd9[_0x71a3('0x3f')];if(!_0x3f9fa4[_0x71a3('0x3a')][_0x71a3('0x42')](_0x71a3('0x43'))){_0x5e224b['limit']=qs['limit'](_0x3f9fa4['query'][_0x71a3('0x22')]);_0x5e224b['offset']=qs[_0x71a3('0x21')](_0x3f9fa4[_0x71a3('0x3a')][_0x71a3('0x21')]);}_0x5e224b[_0x71a3('0x44')]=qs['sort'](_0x3f9fa4[_0x71a3('0x3a')][_0x71a3('0x45')]);_0x5e224b[_0x71a3('0x46')]=qs[_0x71a3('0x3c')](_[_0x71a3('0x47')](_0x3f9fa4[_0x71a3('0x3a')],_0x500bd9[_0x71a3('0x3c')]));_0x5e224b[_0x71a3('0x46')][_0x71a3('0x65')]=_0x609352['id'];if(_0x3f9fa4['query'][_0x71a3('0x48')]){_0x5e224b['where']=_['merge'](_0x5e224b[_0x71a3('0x46')],{'$or':_[_0x71a3('0x2e')](_0x5e224b[_0x71a3('0x3e')],function(_0x3fe0f7){var _0x428801={};_0x428801[_0x3fe0f7]={'$like':'%'+_0x3f9fa4[_0x71a3('0x3a')]['filter']+'%'};return _0x428801;})});}_0x5e224b=_[_0x71a3('0x49')]({},_0x5e224b,_0x3f9fa4[_0x71a3('0x4b')]);return db[_0x71a3('0x6a')][_0x71a3('0x4c')]({'where':_0x5e224b[_0x71a3('0x46')]})[_0x71a3('0x28')](function(_0x49517e){_0x2acec5['count']=_0x49517e;if(_0x3f9fa4[_0x71a3('0x3a')][_0x71a3('0x53')]){_0x5e224b[_0x71a3('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x71a3('0x4e')](_0x5e224b);})[_0x71a3('0x28')](function(_0x1cb43b){_0x2acec5['rows']=_0x1cb43b;return _0x2acec5;});}})['then'](respondWithFilteredResult(_0x334546,_0x5e224b))[_0x71a3('0x50')](handleError(_0x334546,null));};exports[_0x71a3('0x6b')]=function(_0x4aef3e,_0xc2d8eb,_0x31e248){var _0x292568={};var _0xa539cc={};var _0x47cd2f;var _0x2fe697;return db[_0x71a3('0x38')][_0x71a3('0x63')]({'where':{'id':_0x4aef3e[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0xc2d8eb,null))[_0x71a3('0x28')](function(_0x3a66f8){if(_0x3a66f8){_0x47cd2f=_0x3a66f8;_0xa539cc[_0x71a3('0x3f')]=_[_0x71a3('0x3b')](db[_0x71a3('0x6c')][_0x71a3('0x39')]);_0xa539cc[_0x71a3('0x3a')]=_[_0x71a3('0x3b')](_0x4aef3e[_0x71a3('0x3a')]);_0xa539cc[_0x71a3('0x3c')]=_['intersection'](_0xa539cc[_0x71a3('0x3f')],_0xa539cc[_0x71a3('0x3a')]);_0x292568[_0x71a3('0x3e')]=_[_0x71a3('0x3d')](_0xa539cc[_0x71a3('0x3f')],qs[_0x71a3('0x40')](_0x4aef3e[_0x71a3('0x3a')][_0x71a3('0x40')]));_0x292568[_0x71a3('0x3e')]=_0x292568[_0x71a3('0x3e')][_0x71a3('0x41')]?_0x292568[_0x71a3('0x3e')]:_0xa539cc[_0x71a3('0x3f')];_0x292568[_0x71a3('0x44')]=qs[_0x71a3('0x45')](_0x4aef3e[_0x71a3('0x3a')]['sort']);_0x292568[_0x71a3('0x46')]=qs[_0x71a3('0x3c')](_[_0x71a3('0x47')](_0x4aef3e[_0x71a3('0x3a')],_0xa539cc['filters']));if(_0x4aef3e[_0x71a3('0x3a')][_0x71a3('0x48')]){_0x292568[_0x71a3('0x46')]=_[_0x71a3('0x49')](_0x292568[_0x71a3('0x46')],{'$or':_[_0x71a3('0x2e')](_0x292568['attributes'],function(_0x55ad02){var _0x457e88={};_0x457e88[_0x55ad02]={'$like':'%'+_0x4aef3e['query']['filter']+'%'};return _0x457e88;})});}_0x292568=_[_0x71a3('0x49')]({},_0x292568,_0x4aef3e[_0x71a3('0x4b')]);return _0x47cd2f[_0x71a3('0x6b')](_0x292568);}})[_0x71a3('0x28')](function(_0x4c23fd){if(_0x4c23fd){_0x2fe697=_0x4c23fd[_0x71a3('0x41')];if(!_0x4aef3e[_0x71a3('0x3a')]['hasOwnProperty'](_0x71a3('0x43'))){_0x292568[_0x71a3('0x22')]=qs[_0x71a3('0x22')](_0x4aef3e[_0x71a3('0x3a')][_0x71a3('0x22')]);_0x292568[_0x71a3('0x21')]=qs[_0x71a3('0x21')](_0x4aef3e[_0x71a3('0x3a')][_0x71a3('0x21')]);}return _0x47cd2f[_0x71a3('0x6b')](_0x292568);}})['then'](function(_0x1cf0bc){if(_0x1cf0bc){return _0x1cf0bc?{'count':_0x2fe697,'rows':_0x1cf0bc}:null;}})[_0x71a3('0x28')](respondWithResult(_0xc2d8eb,null))[_0x71a3('0x50')](handleError(_0xc2d8eb,null));};exports[_0x71a3('0x6d')]=function(_0x2d685b,_0x531756,_0x121c1b){var _0x5d7fa4=_0x2d685b['body'][_0x71a3('0x6e')];return db[_0x71a3('0x6c')][_0x71a3('0x4e')]({'where':{'id':_['map'](_0x5d7fa4,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x71a3('0x6f'),'attributes':['id',_0x71a3('0x33'),_0x71a3('0x70'),_0x71a3('0x71'),_0x71a3('0x72')],'raw':!![]}]})[_0x71a3('0x28')](function(_0x353a49){if(_0x353a49){var _0x1ff749=_['flatMap'](_0x353a49,function(_0x35416b){var _0x1ee735=_0x35416b[_0x71a3('0x2a')]({'plain':!![]});_0x1ee735[_0x71a3('0x6f')]['forEach'](function(_0x235b6c){_0x235b6c[_0x71a3('0x73')]=_['find'](_0x5d7fa4,{'id':_0x1ee735['id']})[_0x71a3('0x73')];});return _0x1ee735[_0x71a3('0x6f')];});return db[_0x71a3('0x38')]['find']({'where':{'id':_0x2d685b[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](function(_0x4c795d){return db[_0x71a3('0x74')][_0x71a3('0x75')](function(_0x39965e){return _0x4c795d[_0x71a3('0x6d')](_[_0x71a3('0x2e')](_0x5d7fa4,'id'),{'transaction':_0x39965e})[_0x71a3('0x28')](function(){return BPromise[_0x71a3('0x76')](_0x1ff749,function(_0x318a7e){return db[_0x71a3('0x77')][_0x71a3('0x78')]({'where':{'UserId':_0x318a7e['id'],'VoiceQueueId':_0x2d685b[_0x71a3('0x52')]['id']},'defaults':{'penalty':_0x318a7e[_0x71a3('0x73')]},'transaction':_0x39965e});});})[_0x71a3('0x28')](function(){return BPromise[_0x71a3('0x76')](_[_0x71a3('0x48')](_0x1ff749,{'online':!![]}),function(_0x34d86a){return db['UserVoiceQueueRt'][_0x71a3('0x79')]({'membername':_0x34d86a[_0x71a3('0x33')],'UserId':_0x34d86a['id'],'queue_name':_0x4c795d[_0x71a3('0x33')],'VoiceQueueId':_0x4c795d['id'],'interface':_['isNil'](_0x34d86a[_0x71a3('0x72')])?util['format']('SIP/%s',_0x34d86a['name']):_0x34d86a[_0x71a3('0x72')],'paused':_0x34d86a[_0x71a3('0x71')]||![],'penalty':_0x34d86a[_0x71a3('0x73')]},{'transaction':_0x39965e});});})[_0x71a3('0x28')](function(){_0x1ff749[_0x71a3('0x7a')](function(_0x448997){socket[_0x71a3('0x7b')](_0x71a3('0x7c'),{'UserId':_0x448997['id'],'VoiceQueueId':_0x4c795d['id']});});});});});}})[_0x71a3('0x28')](respondWithStatusCode(_0x531756,null))[_0x71a3('0x50')](handleError(_0x531756,null));};exports[_0x71a3('0x7d')]=function(_0x1f7f00,_0x3448aa,_0x8e6d9b){return db[_0x71a3('0x6c')]['findAll']({'where':{'id':_0x1f7f00[_0x71a3('0x3a')][_0x71a3('0x7e')]},'attributes':['id'],'include':[{'model':db[_0x71a3('0x7f')],'as':_0x71a3('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3448aa,null))[_0x71a3('0x28')](function(_0x18a69d){var _0x39a201=_[_0x71a3('0x2e')](_0x18a69d,'id');var _0x3548f8=[];var _0x5e1570=[];var _0x190ace=squel[_0x71a3('0x80')]();_0x190ace[_0x71a3('0x81')](_0x71a3('0x82'))[_0x71a3('0x83')](_0x71a3('0x84'),'tq')[_0x71a3('0x85')]('user_has_teams','ut',_0x71a3('0x86'))[_0x71a3('0x46')](_0x71a3('0x87'),_0x1f7f00[_0x71a3('0x52')]['id']);for(var _0x127147=0x0;_0x127147<_0x18a69d[_0x71a3('0x41')];_0x127147+=0x1){let _0x2584d3=_0x18a69d[_0x127147];for(var _0x49c2f3=0x0;_0x49c2f3<_0x2584d3['Agents'][_0x71a3('0x41')];_0x49c2f3+=0x1){let _0x241d8e=_0x2584d3[_0x71a3('0x6f')][_0x49c2f3];var _0x2b14a5=_0x190ace[_0x71a3('0x5d')]();_0x2b14a5['where']('ut.UserId\x20=\x20?',_0x241d8e['id']);_0x5e1570[_0x71a3('0x88')](db[_0x71a3('0x74')][_0x71a3('0x3a')](_0x2b14a5[_0x71a3('0x89')](),{'type':db['sequelize'][_0x71a3('0x8a')][_0x71a3('0x8b')]})[_0x71a3('0x28')](function(_0x47542f){if(_0x47542f['length']===0x1){return _0x241d8e['id'];}else{var _0x478445=_['every'](_['map'](_0x47542f,_0x71a3('0x8c')),function(_0x28af93){return _['includes'](_0x39a201,_0x28af93);});if(_0x478445){return _0x241d8e['id'];}}}));}}return BPromise['all'](_0x5e1570)[_0x71a3('0x28')](function(_0x53ed02){_0x3548f8=_(_0x3548f8)[_0x71a3('0x8d')](_0x53ed02)[_0x71a3('0x8e')]()[_0x71a3('0x2f')]();return db[_0x71a3('0x38')][_0x71a3('0x32')]({'where':{'id':_0x1f7f00[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](function(_0x2f719a){return db[_0x71a3('0x74')][_0x71a3('0x75')](function(_0x57179c){return _0x2f719a[_0x71a3('0x7d')](_0x1f7f00['query'][_0x71a3('0x7e')],{'transaction':_0x57179c})[_0x71a3('0x28')](function(){if(!_[_0x71a3('0x8f')](_0x3548f8)){return _0x2f719a['removeAgents'](_0x3548f8,{'transaction':_0x57179c})[_0x71a3('0x28')](function(){return db[_0x71a3('0x90')]['destroy']({'where':{'VoiceQueueId':_0x1f7f00[_0x71a3('0x52')]['id'],'UserId':_0x3548f8},'transaction':_0x57179c});});}})[_0x71a3('0x28')](function(){_0x3548f8[_0x71a3('0x7a')](function(_0x38594a){socket[_0x71a3('0x7b')](_0x71a3('0x91'),{'UserId':_0x38594a,'VoiceQueueId':_0x2f719a['id']});});});});});});})[_0x71a3('0x28')](respondWithStatusCode(_0x3448aa,null))[_0x71a3('0x50')](handleError(_0x3448aa,null));};exports[_0x71a3('0x92')]=function(_0x52969c,_0x38b5e5,_0x6f8959){var _0x3f09cb,_0x4f357a;return db['VoiceQueue'][_0x71a3('0x32')]({'where':{'id':_0x52969c[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x38b5e5,null))[_0x71a3('0x28')](function(_0x300692){if(_0x300692){_0x4f357a=_0x300692;return _0x300692[_0x71a3('0x92')](_0x52969c[_0x71a3('0x55')][_0x71a3('0x7e')],_['omit'](_0x52969c['body'],['ids','id'])||{})[_0x71a3('0x93')](function(_0x5de288){for(var _0xce9c8a=0x0;_0xce9c8a<_0x52969c[_0x71a3('0x55')][_0x71a3('0x7e')]['length'];_0xce9c8a+=0x1){socket[_0x71a3('0x7b')](_0x71a3('0x7c'),{'UserId':_0x52969c[_0x71a3('0x55')][_0x71a3('0x7e')][_0xce9c8a],'VoiceQueueId':_0x52969c[_0x71a3('0x52')]['id']});}return _0x5de288;});}})[_0x71a3('0x28')](function(_0x34aef0){_0x3f09cb=_0x34aef0||[];if(_0x4f357a){return db['User'][_0x71a3('0x4e')]({'where':{'id':_0x52969c[_0x71a3('0x55')]['ids']},'attributes':['id',_0x71a3('0x33'),_0x71a3('0x70'),_0x71a3('0x71'),'interface'],'raw':!![]});}})['then'](function(_0x6d03a8){if(!_[_0x71a3('0x8f')](_0x6d03a8)){var _0x1c6d52=[];for(var _0x57f484=0x0;_0x57f484<_0x6d03a8[_0x71a3('0x41')];_0x57f484++){if(_0x6d03a8[_0x57f484]['online']){_0x1c6d52[_0x71a3('0x88')](db[_0x71a3('0x90')]['upsert']({'membername':_0x6d03a8[_0x57f484][_0x71a3('0x33')],'UserId':_0x6d03a8[_0x57f484]['id'],'queue_name':_0x4f357a['name'],'VoiceQueueId':_0x4f357a['id'],'interface':_[_0x71a3('0x94')](_0x6d03a8[_0x57f484]['interface'])?util[_0x71a3('0x95')]('SIP/%s',_0x6d03a8[_0x57f484][_0x71a3('0x33')]):_0x6d03a8[_0x57f484]['interface'],'paused':_0x6d03a8[_0x57f484][_0x71a3('0x71')]||![],'penalty':_0x52969c[_0x71a3('0x55')]['penalty']||0x0}));}}return BPromise[_0x71a3('0x96')](_0x1c6d52);}})[_0x71a3('0x28')](function(){return _0x3f09cb;})[_0x71a3('0x28')](respondWithResult(_0x38b5e5,null))['catch'](handleError(_0x38b5e5,null));};exports[_0x71a3('0x97')]=function(_0x139287,_0x3e415c,_0x12de2a){return db[_0x71a3('0x38')]['find']({'where':{'id':_0x139287[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x3e415c,null))[_0x71a3('0x28')](function(_0xc93feb){if(_0xc93feb){return _0xc93feb[_0x71a3('0x97')](_0x139287['query'][_0x71a3('0x7e')])[_0x71a3('0x28')](function(){if(_[_0x71a3('0x98')](_0x139287[_0x71a3('0x3a')]['ids'])){for(var _0x7ceb33=0x0;_0x7ceb33<_0x139287[_0x71a3('0x3a')][_0x71a3('0x7e')][_0x71a3('0x41')];_0x7ceb33+=0x1){socket[_0x71a3('0x7b')](_0x71a3('0x91'),{'UserId':Number(_0x139287['query'][_0x71a3('0x7e')][_0x7ceb33]),'VoiceQueueId':Number(_0x139287['params']['id'])});}}else{socket[_0x71a3('0x7b')](_0x71a3('0x91'),{'UserId':Number(_0x139287[_0x71a3('0x3a')]['ids']),'VoiceQueueId':Number(_0x139287[_0x71a3('0x52')]['id'])});}});}})[_0x71a3('0x28')](function(_0xa7773b){return db[_0x71a3('0x90')]['destroy']({'where':{'VoiceQueueId':_0x139287[_0x71a3('0x52')]['id'],'UserId':_0x139287[_0x71a3('0x3a')][_0x71a3('0x7e')]}})['then'](function(){return _0xa7773b;});})[_0x71a3('0x28')](respondWithStatusCode(_0x3e415c,null))[_0x71a3('0x50')](handleError(_0x3e415c,null));};exports[_0x71a3('0x99')]=function(_0x5ba504,_0x252a4f,_0xc097c7){var _0x50b158={};var _0x4568fc={};var _0x489e03;var _0x13be59;return db['VoiceQueue'][_0x71a3('0x63')]({'where':{'id':_0x5ba504[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x252a4f,null))['then'](function(_0x7a5781){if(_0x7a5781){_0x489e03=_0x7a5781;_0x4568fc[_0x71a3('0x3f')]=_[_0x71a3('0x3b')](db[_0x71a3('0x7f')][_0x71a3('0x39')]);_0x4568fc['query']=_['keys'](_0x5ba504['query']);_0x4568fc[_0x71a3('0x3c')]=_[_0x71a3('0x3d')](_0x4568fc['model'],_0x4568fc['query']);_0x50b158['attributes']=_[_0x71a3('0x3d')](_0x4568fc['model'],qs[_0x71a3('0x40')](_0x5ba504[_0x71a3('0x3a')]['fields']));_0x50b158[_0x71a3('0x3e')]=_0x50b158[_0x71a3('0x3e')]['length']?_0x50b158['attributes']:_0x4568fc['model'];_0x50b158[_0x71a3('0x44')]=qs[_0x71a3('0x45')](_0x5ba504['query'][_0x71a3('0x45')]);_0x50b158['where']=qs[_0x71a3('0x3c')](_[_0x71a3('0x47')](_0x5ba504['query'],_0x4568fc[_0x71a3('0x3c')]));if(_0x5ba504[_0x71a3('0x3a')][_0x71a3('0x48')]){_0x50b158[_0x71a3('0x46')]=_[_0x71a3('0x49')](_0x50b158[_0x71a3('0x46')],{'$or':_[_0x71a3('0x2e')](_0x50b158['attributes'],function(_0x9b9a55){var _0x4ae12e={};_0x4ae12e[_0x9b9a55]={'$like':'%'+_0x5ba504[_0x71a3('0x3a')]['filter']+'%'};return _0x4ae12e;})});}_0x50b158=_[_0x71a3('0x49')]({},_0x50b158,_0x5ba504[_0x71a3('0x4b')]);return _0x489e03[_0x71a3('0x99')](_0x50b158);}})[_0x71a3('0x28')](function(_0x251c4b){if(_0x251c4b){_0x13be59=_0x251c4b[_0x71a3('0x41')];if(!_0x5ba504[_0x71a3('0x3a')][_0x71a3('0x42')](_0x71a3('0x43'))){_0x50b158[_0x71a3('0x22')]=qs[_0x71a3('0x22')](_0x5ba504[_0x71a3('0x3a')][_0x71a3('0x22')]);_0x50b158[_0x71a3('0x21')]=qs['offset'](_0x5ba504[_0x71a3('0x3a')][_0x71a3('0x21')]);}return _0x489e03[_0x71a3('0x99')](_0x50b158);}})[_0x71a3('0x28')](function(_0x4f766c){if(_0x4f766c){return _0x4f766c?{'count':_0x13be59,'rows':_0x4f766c}:null;}})['then'](respondWithResult(_0x252a4f,null))[_0x71a3('0x50')](handleError(_0x252a4f,null));};exports[_0x71a3('0x9a')]=function(_0xac4d66,_0x403c13,_0x4b7ec8){var _0x35dad6={};var _0x3017e8={};var _0x5f06f6;var _0xd32da7;return db['VoiceQueue'][_0x71a3('0x63')]({'where':{'id':_0xac4d66[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x403c13,null))[_0x71a3('0x28')](function(_0x2263c0){if(_0x2263c0){_0x5f06f6=_0x2263c0;_0x3017e8[_0x71a3('0x3f')]=_['keys'](db[_0x71a3('0x90')][_0x71a3('0x39')]);_0x3017e8[_0x71a3('0x3a')]=_[_0x71a3('0x3b')](_0xac4d66[_0x71a3('0x3a')]);_0x3017e8[_0x71a3('0x3c')]=_[_0x71a3('0x3d')](_0x3017e8[_0x71a3('0x3f')],_0x3017e8['query']);_0x35dad6[_0x71a3('0x3e')]=_[_0x71a3('0x3d')](_0x3017e8[_0x71a3('0x3f')],qs[_0x71a3('0x40')](_0xac4d66[_0x71a3('0x3a')][_0x71a3('0x40')]));_0x35dad6[_0x71a3('0x3e')]=_0x35dad6[_0x71a3('0x3e')][_0x71a3('0x41')]?_0x35dad6[_0x71a3('0x3e')]:_0x3017e8[_0x71a3('0x3f')];_0x35dad6['order']=qs[_0x71a3('0x45')](_0xac4d66[_0x71a3('0x3a')]['sort']);_0x35dad6['where']=qs['filters'](_[_0x71a3('0x47')](_0xac4d66[_0x71a3('0x3a')],_0x3017e8[_0x71a3('0x3c')]));if(_0xac4d66[_0x71a3('0x3a')]['filter']){_0x35dad6[_0x71a3('0x46')]=_[_0x71a3('0x49')](_0x35dad6[_0x71a3('0x46')],{'$or':_[_0x71a3('0x2e')](_0x35dad6[_0x71a3('0x3e')],function(_0x2c3ba4){var _0x551ef0={};_0x551ef0[_0x2c3ba4]={'$like':'%'+_0xac4d66['query'][_0x71a3('0x48')]+'%'};return _0x551ef0;})});}_0x35dad6=_[_0x71a3('0x49')]({},_0x35dad6,_0xac4d66['options']);return _0x5f06f6[_0x71a3('0x9a')](_0x35dad6);}})[_0x71a3('0x28')](function(_0x1d1d28){if(_0x1d1d28){_0xd32da7=_0x1d1d28[_0x71a3('0x41')];if(!_0xac4d66[_0x71a3('0x3a')][_0x71a3('0x42')](_0x71a3('0x43'))){_0x35dad6[_0x71a3('0x22')]=qs[_0x71a3('0x22')](_0xac4d66['query'][_0x71a3('0x22')]);_0x35dad6[_0x71a3('0x21')]=qs['offset'](_0xac4d66[_0x71a3('0x3a')][_0x71a3('0x21')]);}return _0x5f06f6[_0x71a3('0x9a')](_0x35dad6);}})[_0x71a3('0x28')](function(_0x1a2a25){return _0x1a2a25?{'count':_0xd32da7,'rows':_0x1a2a25}:null;})['then'](respondWithResult(_0x403c13,null))[_0x71a3('0x50')](handleError(_0x403c13,null));};exports[_0x71a3('0x9b')]=function(_0x2d2382,_0x3751db,_0x19ddba){var _0xc5327c={};var _0x276ffc={};var _0x994386;var _0x78955e;return db[_0x71a3('0x38')][_0x71a3('0x63')]({'where':{'id':_0x2d2382[_0x71a3('0x52')]['id']}})['then'](handleEntityNotFound(_0x3751db,null))['then'](function(_0x578a03){if(_0x578a03){_0x994386=_0x578a03;_0x276ffc[_0x71a3('0x3f')]=_['keys'](db[_0x71a3('0x9c')][_0x71a3('0x39')]);_0x276ffc[_0x71a3('0x3a')]=_[_0x71a3('0x3b')](_0x2d2382[_0x71a3('0x3a')]);_0x276ffc[_0x71a3('0x3c')]=_[_0x71a3('0x3d')](_0x276ffc[_0x71a3('0x3f')],_0x276ffc[_0x71a3('0x3a')]);_0xc5327c[_0x71a3('0x3e')]=_[_0x71a3('0x3d')](_0x276ffc['model'],qs[_0x71a3('0x40')](_0x2d2382[_0x71a3('0x3a')][_0x71a3('0x40')]));_0xc5327c[_0x71a3('0x3e')]=_0xc5327c[_0x71a3('0x3e')][_0x71a3('0x41')]?_0xc5327c[_0x71a3('0x3e')]:_0x276ffc[_0x71a3('0x3f')];_0xc5327c[_0x71a3('0x44')]=qs[_0x71a3('0x45')](_0x2d2382['query'][_0x71a3('0x45')]);_0xc5327c[_0x71a3('0x46')]=qs['filters'](_[_0x71a3('0x47')](_0x2d2382[_0x71a3('0x3a')],_0x276ffc[_0x71a3('0x3c')]));if(_0x2d2382[_0x71a3('0x3a')][_0x71a3('0x48')]){_0xc5327c[_0x71a3('0x46')]=_[_0x71a3('0x49')](_0xc5327c[_0x71a3('0x46')],{'$or':_[_0x71a3('0x2e')](_0xc5327c[_0x71a3('0x3e')],function(_0x7599d8){var _0x3ba638={};_0x3ba638[_0x7599d8]={'$like':'%'+_0x2d2382[_0x71a3('0x3a')][_0x71a3('0x48')]+'%'};return _0x3ba638;})});}_0xc5327c=_['merge']({},_0xc5327c,_0x2d2382['options']);return _0x994386[_0x71a3('0x9b')](_0xc5327c);}})[_0x71a3('0x28')](function(_0x43f224){if(_0x43f224){_0x78955e=_0x43f224['length'];if(!_0x2d2382[_0x71a3('0x3a')][_0x71a3('0x42')](_0x71a3('0x43'))){_0xc5327c[_0x71a3('0x22')]=qs[_0x71a3('0x22')](_0x2d2382['query'][_0x71a3('0x22')]);_0xc5327c[_0x71a3('0x21')]=qs['offset'](_0x2d2382[_0x71a3('0x3a')]['offset']);}return _0x994386[_0x71a3('0x9b')](_0xc5327c);}})[_0x71a3('0x28')](function(_0x2d27ea){if(_0x2d27ea){return _0x2d27ea?{'count':_0x78955e,'rows':_0x2d27ea}:null;}})[_0x71a3('0x28')](respondWithResult(_0x3751db,null))[_0x71a3('0x50')](handleError(_0x3751db,null));};exports[_0x71a3('0x9d')]=function(_0x1c9cec,_0x33d8c5,_0x20d8eb){var _0x3677ea,_0x3b8f10;return db[_0x71a3('0x38')][_0x71a3('0x32')]({'where':{'id':_0x1c9cec[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x33d8c5,null))[_0x71a3('0x28')](function(_0x2ec744){if(_0x2ec744){_0x3b8f10=_0x2ec744;return _0x2ec744['addLists'](_0x1c9cec[_0x71a3('0x55')]['ids'],_['omit'](_0x1c9cec[_0x71a3('0x55')],[_0x71a3('0x7e'),'id'])||{});}return null;})[_0x71a3('0x93')](function(_0x542fae){var _0xcca2cc;_0x3677ea=_0x542fae||[];var _0x4501bf=[];if(_0x542fae){for(var _0x45db3f=0x0;_0x45db3f<_0x542fae['length'];_0x45db3f+=0x1){var _0x4db4bf=_0x542fae[_0x45db3f][_0x71a3('0x2a')]({'plain':!![]});_0x3b8f10['dialCheckDuplicateType']=_0x1c9cec['body']['dialCheckDuplicateType']?_0x1c9cec[_0x71a3('0x55')]['dialCheckDuplicateType']:_0x3b8f10[_0x71a3('0x9e')];switch(_0x3b8f10[_0x71a3('0x9e')]){case _0x71a3('0x9f'):_0xcca2cc=squel['insert']()[_0x71a3('0xa0')](_0x71a3('0xa1'))[_0x71a3('0xa2')]([_0x71a3('0xa3'),'scheduledAt',_0x71a3('0xa4'),_0x71a3('0xa5'),_0x71a3('0x65'),_0x71a3('0x5e'),_0x71a3('0x60')],squel[_0x71a3('0x80')]()[_0x71a3('0x81')](_0x71a3('0xa3'),_0x71a3('0xa3'))[_0x71a3('0x81')](_0x71a3('0xa6'),_0x71a3('0xa7'))[_0x71a3('0x81')]('id',_0x71a3('0xa4'))[_0x71a3('0x81')](_0x4db4bf['CmListId'][_0x71a3('0x89')](),'ListId')[_0x71a3('0x81')](_0x1c9cec['params']['id'][_0x71a3('0x89')](),_0x71a3('0x65'))[_0x71a3('0x81')](_0x71a3('0xa6'),_0x71a3('0x5e'))[_0x71a3('0x81')](_0x71a3('0xa6'),_0x71a3('0x60'))[_0x71a3('0x83')](_0x71a3('0xa8'))['where'](_0x71a3('0xa9'))[_0x71a3('0x46')](_0x71a3('0xaa'),_0x4db4bf[_0x71a3('0xab')]['toString']())[_0x71a3('0x46')](_0x71a3('0xac'))[_0x71a3('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0x71a3('0x80')]()[_0x71a3('0x81')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x71a3('0xad'))[_0x71a3('0x46')](_0x71a3('0x87'),_0x1c9cec[_0x71a3('0x52')]['id'][_0x71a3('0x89')]()))[_0x71a3('0x46')](_0x71a3('0xae'),squel['select']()[_0x71a3('0x81')](_0x71a3('0xaf'))[_0x71a3('0x83')](_0x71a3('0xa1'))['where'](_0x71a3('0x87'),_0x1c9cec[_0x71a3('0x52')]['id']['toString']())))[_0x71a3('0x89')]();break;case _0x71a3('0xb0'):_0xcca2cc=squel[_0x71a3('0xb1')]()[_0x71a3('0xa0')](_0x71a3('0xa1'))[_0x71a3('0xa2')]([_0x71a3('0xa3'),'scheduledAt',_0x71a3('0xa4'),_0x71a3('0xa5'),_0x71a3('0x65'),_0x71a3('0x5e'),_0x71a3('0x60')],squel[_0x71a3('0x80')]()[_0x71a3('0x81')]('phone','phone')['field']('NOW()','scheduledAt')[_0x71a3('0x81')]('id','ContactId')[_0x71a3('0x81')](_0x4db4bf[_0x71a3('0xab')][_0x71a3('0x89')](),_0x71a3('0xa5'))[_0x71a3('0x81')](_0x1c9cec[_0x71a3('0x52')]['id'][_0x71a3('0x89')](),_0x71a3('0x65'))[_0x71a3('0x81')](_0x71a3('0xa6'),_0x71a3('0x5e'))['field']('NOW()','updatedAt')[_0x71a3('0x83')](_0x71a3('0xa8'))[_0x71a3('0x46')](_0x71a3('0xa9'))['where'](_0x71a3('0xaa'),_0x4db4bf[_0x71a3('0xab')][_0x71a3('0x89')]())[_0x71a3('0x46')](_0x71a3('0xac'))[_0x71a3('0x46')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x71a3('0x81')](_0x71a3('0xaf'))[_0x71a3('0x83')]('cm_hopper')[_0x71a3('0x46')](_0x71a3('0x87'),_0x1c9cec[_0x71a3('0x52')]['id'][_0x71a3('0x89')]())))[_0x71a3('0x89')]();break;default:_0xcca2cc=squel['insert']()['into'](_0x71a3('0xa1'))['fromQuery']([_0x71a3('0xa3'),'scheduledAt',_0x71a3('0xa4'),_0x71a3('0xa5'),_0x71a3('0x65'),_0x71a3('0x5e'),_0x71a3('0x60')],squel[_0x71a3('0x80')]()[_0x71a3('0x81')](_0x71a3('0xa3'),_0x71a3('0xa3'))[_0x71a3('0x81')](_0x71a3('0xa6'),_0x71a3('0xa7'))[_0x71a3('0x81')]('id','ContactId')['field'](_0x4db4bf['CmListId']['toString'](),_0x71a3('0xa5'))['field'](_0x1c9cec[_0x71a3('0x52')]['id'][_0x71a3('0x89')](),'VoiceQueueId')[_0x71a3('0x81')]('NOW()',_0x71a3('0x5e'))[_0x71a3('0x81')](_0x71a3('0xa6'),_0x71a3('0x60'))[_0x71a3('0x83')](_0x71a3('0xa8'))[_0x71a3('0x46')](_0x71a3('0xa9'))['where'](_0x71a3('0xaa'),_0x4db4bf['CmListId'][_0x71a3('0x89')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x4501bf[_0x71a3('0x88')](db[_0x71a3('0x74')][_0x71a3('0x3a')](_0xcca2cc));}return BPromise['all'](_0x4501bf);}})[_0x71a3('0x28')](function(){return _0x3677ea;})['then'](respondWithResult(_0x33d8c5,null))[_0x71a3('0x50')](handleError(_0x33d8c5,null));};exports[_0x71a3('0xb2')]=function(_0x29a55f,_0x2f0e23,_0x18ffa4){return db[_0x71a3('0x38')][_0x71a3('0x32')]({'where':{'id':_0x29a55f['params']['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x2f0e23,null))[_0x71a3('0x28')](function(_0x3acb4a){if(_0x3acb4a){return _0x3acb4a[_0x71a3('0xb2')](_0x29a55f[_0x71a3('0x3a')][_0x71a3('0x7e')]);}})['then'](function(_0x169817){if(_0x169817){return db[_0x71a3('0x64')][_0x71a3('0x29')]({'where':{'ListId':_0x29a55f['query']['ids'],'VoiceQueueId':_0x29a55f[_0x71a3('0x52')]['id']}})['then'](function(){return _0x169817;});}})['then'](respondWithStatusCode(_0x2f0e23,null))[_0x71a3('0x50')](handleError(_0x2f0e23,null));};exports['getBlackLists']=function(_0x3c7f43,_0x3bb6a9,_0xf0baa1){var _0x5edb9d={};var _0x33cfe2={};var _0x187a13;var _0x360b1f;return db['VoiceQueue'][_0x71a3('0x63')]({'where':{'id':_0x3c7f43['params']['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x3bb6a9,null))[_0x71a3('0x28')](function(_0x3396a6){if(_0x3396a6){_0x187a13=_0x3396a6;_0x33cfe2[_0x71a3('0x3f')]=_[_0x71a3('0x3b')](db[_0x71a3('0x9c')][_0x71a3('0x39')]);_0x33cfe2[_0x71a3('0x3a')]=_[_0x71a3('0x3b')](_0x3c7f43[_0x71a3('0x3a')]);_0x33cfe2[_0x71a3('0x3c')]=_[_0x71a3('0x3d')](_0x33cfe2[_0x71a3('0x3f')],_0x33cfe2[_0x71a3('0x3a')]);_0x5edb9d[_0x71a3('0x3e')]=_[_0x71a3('0x3d')](_0x33cfe2[_0x71a3('0x3f')],qs['fields'](_0x3c7f43[_0x71a3('0x3a')][_0x71a3('0x40')]));_0x5edb9d[_0x71a3('0x3e')]=_0x5edb9d[_0x71a3('0x3e')][_0x71a3('0x41')]?_0x5edb9d[_0x71a3('0x3e')]:_0x33cfe2[_0x71a3('0x3f')];_0x5edb9d[_0x71a3('0x44')]=qs[_0x71a3('0x45')](_0x3c7f43[_0x71a3('0x3a')][_0x71a3('0x45')]);_0x5edb9d[_0x71a3('0x46')]=qs[_0x71a3('0x3c')](_[_0x71a3('0x47')](_0x3c7f43['query'],_0x33cfe2[_0x71a3('0x3c')]));if(_0x3c7f43['query'][_0x71a3('0x48')]){_0x5edb9d[_0x71a3('0x46')]=_[_0x71a3('0x49')](_0x5edb9d['where'],{'$or':_[_0x71a3('0x2e')](_0x5edb9d['attributes'],function(_0x108e0b){var _0x1ef9e5={};_0x1ef9e5[_0x108e0b]={'$like':'%'+_0x3c7f43[_0x71a3('0x3a')]['filter']+'%'};return _0x1ef9e5;})});}_0x5edb9d=_['merge']({},_0x5edb9d,_0x3c7f43['options']);return _0x187a13['getBlackLists'](_0x5edb9d);}})[_0x71a3('0x28')](function(_0x305a0d){if(_0x305a0d){_0x360b1f=_0x305a0d[_0x71a3('0x41')];if(!_0x3c7f43[_0x71a3('0x3a')][_0x71a3('0x42')](_0x71a3('0x43'))){_0x5edb9d[_0x71a3('0x22')]=qs['limit'](_0x3c7f43[_0x71a3('0x3a')][_0x71a3('0x22')]);_0x5edb9d[_0x71a3('0x21')]=qs[_0x71a3('0x21')](_0x3c7f43['query'][_0x71a3('0x21')]);}return _0x187a13[_0x71a3('0xb3')](_0x5edb9d);}})[_0x71a3('0x28')](function(_0x4d1a93){if(_0x4d1a93){return _0x4d1a93?{'count':_0x360b1f,'rows':_0x4d1a93}:null;}})[_0x71a3('0x28')](respondWithResult(_0x3bb6a9,null))[_0x71a3('0x50')](handleError(_0x3bb6a9,null));};exports[_0x71a3('0xb4')]=function(_0x54000a,_0x893f62,_0x4da1f4){var _0x19389b,_0x3eb854;return db[_0x71a3('0x38')][_0x71a3('0x32')]({'where':{'id':_0x54000a[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x893f62,null))['then'](function(_0xa6b68f){if(_0xa6b68f){_0x3eb854=_0xa6b68f;return _0xa6b68f['addBlackLists'](_0x54000a[_0x71a3('0x55')][_0x71a3('0x7e')],_[_0x71a3('0x5f')](_0x54000a['body'],[_0x71a3('0x7e'),'id'])||{});}return null;})[_0x71a3('0x93')](function(_0x46d7cc){var _0x2e5d91;_0x19389b=_0x46d7cc||[];var _0x267ee0=[];if(_0x46d7cc){for(var _0x5d2237=0x0;_0x5d2237<_0x46d7cc[_0x71a3('0x41')];_0x5d2237+=0x1){var _0x371b35=_0x46d7cc[_0x5d2237][_0x71a3('0x2a')]({'plain':!![]});_0x2e5d91=squel[_0x71a3('0xb1')]()[_0x71a3('0xa0')]('cm_hopper_black')[_0x71a3('0xa2')]([_0x71a3('0xa3'),_0x71a3('0xa4'),_0x71a3('0xa5'),_0x71a3('0x65'),_0x71a3('0x5e'),'updatedAt'],squel[_0x71a3('0x80')]()[_0x71a3('0x81')]('phone',_0x71a3('0xa3'))[_0x71a3('0x81')]('id',_0x71a3('0xa4'))['field'](_0x371b35[_0x71a3('0xab')]['toString'](),_0x71a3('0xa5'))['field'](_0x54000a[_0x71a3('0x52')]['id'][_0x71a3('0x89')](),'VoiceQueueId')[_0x71a3('0x81')](_0x71a3('0xa6'),_0x71a3('0x5e'))[_0x71a3('0x81')](_0x71a3('0xa6'),_0x71a3('0x60'))[_0x71a3('0x83')]('cm_contacts')[_0x71a3('0x46')](_0x71a3('0xa9'))['where'](_0x71a3('0xaa'),_0x371b35['CmListId']['toString']())['where'](_0x71a3('0xac')))['toString']();_0x267ee0['push'](db[_0x71a3('0x74')]['query'](_0x2e5d91));}return BPromise[_0x71a3('0x96')](_0x267ee0);}})[_0x71a3('0x28')](function(){return _0x19389b;})[_0x71a3('0x28')](respondWithResult(_0x893f62,null))['catch'](handleError(_0x893f62,null));};exports[_0x71a3('0xb5')]=function(_0x4f1785,_0x1e873d,_0x49a7a7){return db[_0x71a3('0x38')][_0x71a3('0x32')]({'where':{'id':_0x4f1785[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](handleEntityNotFound(_0x1e873d,null))['then'](function(_0x15794f){if(_0x15794f){return _0x15794f[_0x71a3('0xb5')](_0x4f1785[_0x71a3('0x3a')][_0x71a3('0x7e')]);}})[_0x71a3('0x28')](function(_0x4fc963){if(_0x4fc963){return db[_0x71a3('0x6a')]['destroy']({'where':{'ListId':_0x4f1785[_0x71a3('0x3a')][_0x71a3('0x7e')],'VoiceQueueId':_0x4f1785[_0x71a3('0x52')]['id']}})[_0x71a3('0x28')](function(){return _0x4fc963;});}})[_0x71a3('0x28')](respondWithStatusCode(_0x1e873d,null))[_0x71a3('0x50')](handleError(_0x1e873d,null));};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js
index 9e4eb4a..56bc5ad 100644
--- a/server/api/voiceQueue/voiceQueue.events.js
+++ b/server/api/voiceQueue/voiceQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x79c6=['hook','events','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4cd357,_0x368b0e){var _0x126e8c=function(_0x527992){while(--_0x527992){_0x4cd357['push'](_0x4cd357['shift']());}};_0x126e8c(++_0x368b0e);}(_0x79c6,0x81));var _0x679c=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x79c6[_0x1b6c6d];return _0x290d9d;};'use strict';var EventEmitter=require(_0x679c('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x679c('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x679c('0x2')](0x0);var events={'afterCreate':_0x679c('0x3'),'afterUpdate':_0x679c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x56d9bf){return function(_0x596e9c,_0x3e24f6,_0x1b87a5){VoiceQueueEvents[_0x679c('0x5')](_0x56d9bf+':'+_0x596e9c['id'],_0x596e9c);VoiceQueueEvents[_0x679c('0x5')](_0x56d9bf,_0x596e9c);_0x1b87a5(null);};}for(var e in events){if(events[_0x679c('0x6')](e)){var event=events[e];VoiceQueue[_0x679c('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
+var _0x8630=['../../mysqldb','VoiceQueue','setMaxListeners','save','emit','hasOwnProperty','hook','events'];(function(_0x44c5c1,_0x4d9d55){var _0x467172=function(_0x584e24){while(--_0x584e24){_0x44c5c1['push'](_0x44c5c1['shift']());}};_0x467172(++_0x4d9d55);}(_0x8630,0x177));var _0x0863=function(_0x572f85,_0x88e7eb){_0x572f85=_0x572f85-0x0;var _0xfd8c47=_0x8630[_0x572f85];return _0xfd8c47;};'use strict';var EventEmitter=require(_0x0863('0x0'));var VoiceQueue=require(_0x0863('0x1'))['db'][_0x0863('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0863('0x3')](0x0);var events={'afterCreate':_0x0863('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xae7573){return function(_0x3084e5,_0x3423c5,_0x355e98){VoiceQueueEvents[_0x0863('0x5')](_0xae7573+':'+_0x3084e5['id'],_0x3084e5);VoiceQueueEvents[_0x0863('0x5')](_0xae7573,_0x3084e5);_0x355e98(null);};}for(var e in events){if(events[_0x0863('0x6')](e)){var event=events[e];VoiceQueue[_0x0863('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js
index 571aa4f..e3654d0 100644
--- a/server/api/voiceQueue/voiceQueue.model.js
+++ b/server/api/voiceQueue/voiceQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2750=['rimraf','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1b7611,_0x21db55){var _0x44bf5b=function(_0x5e1650){while(--_0x5e1650){_0x1b7611['push'](_0x1b7611['shift']());}};_0x44bf5b(++_0x21db55);}(_0x2750,0x13b));var _0x0275=function(_0x880368,_0x1175e0){_0x880368=_0x880368-0x0;var _0x547d64=_0x2750[_0x880368];return _0x547d64;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var fs=require('fs');var path=require(_0x0275('0x6'));var rimraf=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var attributes=require(_0x0275('0x9'));module[_0x0275('0xa')]=function(_0x5953f9,_0x3f645f){return _0x5953f9[_0x0275('0xb')](_0x0275('0xc'),attributes,{'tableName':_0x0275('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea28=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x217bae,_0x7c8dae){var _0x3b9d78=function(_0x1a98d6){while(--_0x1a98d6){_0x217bae['push'](_0x217bae['shift']());}};_0x3b9d78(++_0x7c8dae);}(_0xea28,0x13a));var _0x8ea2=function(_0x3fcffa,_0x5f17ce){_0x3fcffa=_0x3fcffa-0x0;var _0x4d6d08=_0xea28[_0x3fcffa];return _0x4d6d08;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));module[_0x8ea2('0xa')]=function(_0x513a0d,_0x29b82b){return _0x513a0d[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js
index 1df5408..f93e679 100644
--- a/server/api/voiceQueue/voiceQueue.rpc.js
+++ b/server/api/voiceQueue/voiceQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x339d2a,_0x3ffdf7){var _0x4f0363=function(_0x15c2ba){while(--_0x15c2ba){_0x339d2a['push'](_0x339d2a['shift']());}};_0x4f0363(++_0x3ffdf7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});};
\ No newline at end of file
+var _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x21ecd5,_0x563c48){var _0xaf0cf2=function(_0x5dbb06){while(--_0x5dbb06){_0x21ecd5['push'](_0x21ecd5['shift']());}};_0xaf0cf2(++_0x563c48);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js
index ac004fc..29f1198 100644
--- a/server/api/voiceQueue/voiceQueue.socket.js
+++ b/server/api/voiceQueue/voiceQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xea34=['voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener','length'];(function(_0x4944f1,_0x482a52){var _0x433494=function(_0x40d7f3){while(--_0x40d7f3){_0x4944f1['push'](_0x4944f1['shift']());}};_0x433494(++_0x482a52);}(_0xea34,0x99));var _0x4ea3=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0xea34[_0x30faec];return _0x29484f;};'use strict';var VoiceQueueEvents=require(_0x4ea3('0x0'));var events=[_0x4ea3('0x1'),_0x4ea3('0x2'),_0x4ea3('0x3')];function createListener(_0x158338,_0x3473c4){return function(_0x3df1e3){_0x3473c4[_0x4ea3('0x4')](_0x158338,_0x3df1e3);};}function removeListener(_0x1ab7e2,_0x5538e2){return function(){VoiceQueueEvents[_0x4ea3('0x5')](_0x1ab7e2,_0x5538e2);};}exports['register']=function(_0x437c2b){for(var _0x3e42fc=0x0,_0xd8cd79=events[_0x4ea3('0x6')];_0x3e42fc<_0xd8cd79;_0x3e42fc++){var _0x2716a2=events[_0x3e42fc];var _0x4401cd=createListener(_0x4ea3('0x7')+_0x2716a2,_0x437c2b);VoiceQueueEvents['on'](_0x2716a2,_0x4401cd);}};
\ No newline at end of file
+var _0x76e9=['voiceQueue:','./voiceQueue.events','save','remove','register','length'];(function(_0x248df5,_0x348d7a){var _0x284815=function(_0x21dd60){while(--_0x21dd60){_0x248df5['push'](_0x248df5['shift']());}};_0x284815(++_0x348d7a);}(_0x76e9,0xdf));var _0x976e=function(_0x5a4d3c,_0x515a8d){_0x5a4d3c=_0x5a4d3c-0x0;var _0x8cfdc9=_0x76e9[_0x5a4d3c];return _0x8cfdc9;};'use strict';var VoiceQueueEvents=require(_0x976e('0x0'));var events=[_0x976e('0x1'),_0x976e('0x2'),'update'];function createListener(_0xe48f68,_0x5d9991){return function(_0x240e2d){_0x5d9991['emit'](_0xe48f68,_0x240e2d);};}function removeListener(_0x312bd1,_0x4221d3){return function(){VoiceQueueEvents['removeListener'](_0x312bd1,_0x4221d3);};}exports[_0x976e('0x3')]=function(_0x24dc3e){for(var _0x10ce98=0x0,_0x394fef=events[_0x976e('0x4')];_0x10ce98<_0x394fef;_0x10ce98++){var _0x576996=events[_0x10ce98];var _0x396c1f=createListener(_0x976e('0x5')+_0x576996,_0x24dc3e);VoiceQueueEvents['on'](_0x576996,_0x396c1f);}};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js
index ec36f3f..40b48de 100644
--- a/server/api/voiceQueueReport/index.js
+++ b/server/api/voiceQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xabd0=['destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','getVoiceQueuesReport','/:id','show','create','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabd0,0x17d));var _0x0abd=function(_0x5d0fd0,_0x1a3f0d){_0x5d0fd0=_0x5d0fd0-0x0;var _0x556cfa=_0xabd0[_0x5d0fd0];return _0x556cfa;};'use strict';var multer=require('multer');var util=require(_0x0abd('0x0'));var path=require(_0x0abd('0x1'));var timeout=require(_0x0abd('0x2'));var express=require(_0x0abd('0x3'));var router=express[_0x0abd('0x4')]();var auth=require(_0x0abd('0x5'));var interaction=require(_0x0abd('0x6'));var config=require(_0x0abd('0x7'));var controller=require(_0x0abd('0x8'));router['get']('/',auth[_0x0abd('0x9')](),controller[_0x0abd('0xa')]);router[_0x0abd('0xb')](_0x0abd('0xc'),auth['isAuthenticated'](),controller[_0x0abd('0xd')]);router[_0x0abd('0xb')]('/index',auth['isAuthenticated'](),controller[_0x0abd('0xe')]);router[_0x0abd('0xb')](_0x0abd('0xf'),auth[_0x0abd('0x9')](),controller[_0x0abd('0x10')]);router['post']('/',auth[_0x0abd('0x9')](),controller[_0x0abd('0x11')]);router['put'](_0x0abd('0xf'),auth[_0x0abd('0x9')](),controller[_0x0abd('0x12')]);router['delete'](_0x0abd('0xf'),auth[_0x0abd('0x9')](),controller[_0x0abd('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x20be=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/index','getVoiceQueuesReport','/:id','show','post','create','update'];(function(_0x32a9be,_0x1c0d57){var _0x18ab22=function(_0x57dc57){while(--_0x57dc57){_0x32a9be['push'](_0x32a9be['shift']());}};_0x18ab22(++_0x1c0d57);}(_0x20be,0x1b8));var _0xe20b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x20be[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xe20b('0x0'));var util=require(_0xe20b('0x1'));var path=require(_0xe20b('0x2'));var timeout=require(_0xe20b('0x3'));var express=require(_0xe20b('0x4'));var router=express[_0xe20b('0x5')]();var auth=require(_0xe20b('0x6'));var interaction=require(_0xe20b('0x7'));var config=require(_0xe20b('0x8'));var controller=require('./voiceQueueReport.controller');router[_0xe20b('0x9')]('/',auth['isAuthenticated'](),controller[_0xe20b('0xa')]);router[_0xe20b('0x9')](_0xe20b('0xb'),auth[_0xe20b('0xc')](),controller['describe']);router[_0xe20b('0x9')](_0xe20b('0xd'),auth[_0xe20b('0xc')](),controller[_0xe20b('0xe')]);router[_0xe20b('0x9')](_0xe20b('0xf'),auth[_0xe20b('0xc')](),controller[_0xe20b('0x10')]);router[_0xe20b('0x11')]('/',auth[_0xe20b('0xc')](),controller[_0xe20b('0x12')]);router['put']('/:id',auth[_0xe20b('0xc')](),controller[_0xe20b('0x13')]);router[_0xe20b('0x14')](_0xe20b('0xf'),auth[_0xe20b('0xc')](),controller[_0xe20b('0x15')]);module[_0xe20b('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js
index 67a8d5a..f8b4a53 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.attributes.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4236=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x3aed78,_0x543bf4){var _0x589655=function(_0x5c5640){while(--_0x5c5640){_0x3aed78['push'](_0x3aed78['shift']());}};_0x589655(++_0x543bf4);}(_0x4236,0x134));var _0x6423=function(_0x43db25,_0x5204ae){_0x43db25=_0x43db25-0x0;var _0x5d0da1=_0x4236[_0x43db25];return _0x5d0da1;};'use strict';var Sequelize=require(_0x6423('0x0'));var moment=require(_0x6423('0x1'));module[_0x6423('0x2')]={'type':{'type':Sequelize[_0x6423('0x3')]},'uniqueid':{'type':Sequelize[_0x6423('0x3')]},'calleridnum':{'type':Sequelize[_0x6423('0x3')]},'calleridname':{'type':Sequelize[_0x6423('0x3')]},'queue':{'type':Sequelize[_0x6423('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x6423('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x2fa817){var _0x5e914a=moment(_0x2fa817);var _0x42d6e9=moment(this[_0x6423('0x5')]('queuecallerjoinAt'))['format'](_0x6423('0x6'));var _0x4a450e=_0x5e914a[_0x6423('0x7')](_0x42d6e9,_0x6423('0x8'));this[_0x6423('0x9')](_0x6423('0xa'),_0x2fa817);this[_0x6423('0x9')](_0x6423('0xb'),_0x4a450e||null);}},'position':{'type':Sequelize[_0x6423('0xc')]},'count':{'type':Sequelize[_0x6423('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x6423('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6423('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6423('0x4')]},'queuecallerexit':{'type':Sequelize[_0x6423('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x6423('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x6423('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x6423('0x3')]},'connectedlinenum':{'type':Sequelize[_0x6423('0x3')]},'connectedlinename':{'type':Sequelize[_0x6423('0x3')]},'accountcode':{'type':Sequelize[_0x6423('0x3')]},'context':{'type':Sequelize[_0x6423('0x3')]},'exten':{'type':Sequelize[_0x6423('0x3')]},'priority':{'type':Sequelize[_0x6423('0x3')]},'holdtime':{'type':Sequelize[_0x6423('0xc')]},'mohtime':{'type':Sequelize[_0x6423('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6423('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6423('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6423('0x3')],'comment':_0x6423('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x6423('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x29a7=['setDataValue','INTEGER','DATE','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss','seconds'];(function(_0xd12328,_0x31a737){var _0x5a3614=function(_0x1b35ad){while(--_0x1b35ad){_0xd12328['push'](_0xd12328['shift']());}};_0x5a3614(++_0x31a737);}(_0x29a7,0x159));var _0x729a=function(_0x4da279,_0x287048){_0x4da279=_0x4da279-0x0;var _0xca923f=_0x29a7[_0x4da279];return _0xca923f;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x729a('0x0')]={'type':{'type':Sequelize[_0x729a('0x1')]},'uniqueid':{'type':Sequelize[_0x729a('0x1')]},'calleridnum':{'type':Sequelize[_0x729a('0x1')]},'calleridname':{'type':Sequelize[_0x729a('0x1')]},'queue':{'type':Sequelize[_0x729a('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x2253c2){var _0x2ae417=moment(_0x2253c2);var _0xbaaed0=moment(this['getDataValue']('queuecallerjoinAt'))[_0x729a('0x2')](_0x729a('0x3'));var _0x2bfe21=_0x2ae417['diff'](_0xbaaed0,_0x729a('0x4'));this[_0x729a('0x5')]('queuecallerleaveAt',_0x2253c2);this[_0x729a('0x5')]('holdtime',_0x2bfe21||null);}},'position':{'type':Sequelize[_0x729a('0x6')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x729a('0x7')]},'queuecallerexitreason':{'type':Sequelize[_0x729a('0x1')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x729a('0x6')]},'channel':{'type':Sequelize[_0x729a('0x1')]},'connectedlinenum':{'type':Sequelize[_0x729a('0x1')]},'connectedlinename':{'type':Sequelize[_0x729a('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x729a('0x1')]},'priority':{'type':Sequelize[_0x729a('0x1')]},'holdtime':{'type':Sequelize[_0x729a('0x6')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x729a('0x8')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x729a('0x9')},'transferexten':{'type':Sequelize[_0x729a('0x1')]},'transferuniqueid':{'type':Sequelize[_0x729a('0x1')]},'disposition':{'type':Sequelize[_0x729a('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x729a('0x6')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js
index e50b175..15251c1 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.controller.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','VoiceQueueReport','rows','catch','show','params','merge','find','create','body','describe','getVoiceQueuesReport','pick','map','findAll','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voiceQueueReport.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x18')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x26')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x27')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x28')](_0x33161b);};}exports[_0x0a9e('0x29')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['VoiceQueueReport'][_0x0a9e('0x2a')];_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x14de77);_0x1538a4[_0x0a9e('0x2d')]=_['keys'](_0x25fba9[_0x0a9e('0x2d')]);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x2b')],_0x1538a4[_0x0a9e('0x2d')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x2b')],qs[_0x0a9e('0x31')](_0x25fba9['query'][_0x0a9e('0x31')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x2b')];if(!_0x25fba9[_0x0a9e('0x2d')]['hasOwnProperty'](_0x0a9e('0x33'))){_0x140511[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x25fba9[_0x0a9e('0x2d')][_0x0a9e('0x1d')]);_0x140511[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x25fba9[_0x0a9e('0x2d')]['offset']);}_0x140511[_0x0a9e('0x34')]=qs['sort'](_0x25fba9[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x140511[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_['pick'](_0x25fba9[_0x0a9e('0x2d')],_0x1538a4[_0x0a9e('0x2e')]));if(_0x25fba9[_0x0a9e('0x2d')][_0x0a9e('0x37')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x36')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x38')][_0x0a9e('0x39')]!==_0x0a9e('0x3a')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x3b')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2d')][_0x0a9e('0x37')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x36')]};return db['VoiceQueueReport']['count'](_0x1a180b)[_0x0a9e('0x23')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2d')][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db[_0x0a9e('0x3f')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x40')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x41')](handleError(_0x14433c,null));};exports[_0x0a9e('0x42')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':![],'where':{'id':_0x1459bb[_0x0a9e('0x43')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x3f')][_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1459bb[_0x0a9e('0x2d')]);_0x2cfea9[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x2cfea9[_0x0a9e('0x2b')],_0x2cfea9[_0x0a9e('0x2d')]);_0x316c8f[_0x0a9e('0x30')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x31')](_0x1459bb[_0x0a9e('0x2d')][_0x0a9e('0x31')]));_0x316c8f[_0x0a9e('0x30')]=_0x316c8f[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x316c8f[_0x0a9e('0x30')]:_0x2cfea9[_0x0a9e('0x2b')];if(_0x1459bb[_0x0a9e('0x2d')][_0x0a9e('0x3d')]){_0x316c8f[_0x0a9e('0x3e')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x44')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3f')][_0x0a9e('0x45')](_0x316c8f)[_0x0a9e('0x23')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x23')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x41')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x46')]=function(_0x21eb86,_0x44dd99){return db['VoiceQueueReport'][_0x0a9e('0x46')](_0x21eb86['body'],{})[_0x0a9e('0x23')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x41')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x22')]=function(_0x562fb4,_0x14bec2){if(_0x562fb4[_0x0a9e('0x47')]['id']){delete _0x562fb4[_0x0a9e('0x47')]['id'];}return db[_0x0a9e('0x3f')][_0x0a9e('0x45')]({'where':{'id':_0x562fb4[_0x0a9e('0x43')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x14bec2,null))['then'](saveUpdates(_0x562fb4[_0x0a9e('0x47')],null))[_0x0a9e('0x23')](respondWithResult(_0x14bec2,null))[_0x0a9e('0x41')](handleError(_0x14bec2,null));};exports[_0x0a9e('0x24')]=function(_0x409789,_0x992c77){return db[_0x0a9e('0x3f')][_0x0a9e('0x45')]({'where':{'id':_0x409789[_0x0a9e('0x43')]['id']}})['then'](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x23')](removeEntity(_0x992c77,null))[_0x0a9e('0x41')](handleError(_0x992c77,null));};exports['describe']=function(_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x3f')][_0x0a9e('0x48')]()[_0x0a9e('0x23')](respondWithResult(_0x5ddf84,null))[_0x0a9e('0x41')](handleError(_0x5ddf84,null));};exports[_0x0a9e('0x49')]=function(_0x30decb,_0x2e5165){var _0x375c18={},_0x5d38ae={},_0x4b1b9f={'count':0x0,'rows':[]};_0x5d38ae['model']=_[_0x0a9e('0x2c')](db[_0x0a9e('0x3f')][_0x0a9e('0x2a')]);_0x5d38ae['query']=_[_0x0a9e('0x2c')](_0x30decb[_0x0a9e('0x2d')]);_0x5d38ae['filters']=_['intersection'](_0x5d38ae[_0x0a9e('0x2b')],_0x5d38ae['query']);_0x375c18[_0x0a9e('0x30')]=_['intersection'](_0x5d38ae[_0x0a9e('0x2b')],qs[_0x0a9e('0x31')](_0x30decb[_0x0a9e('0x2d')]['fields']));_0x375c18[_0x0a9e('0x30')]=_0x375c18[_0x0a9e('0x30')]['length']?_0x375c18['attributes']:_0x5d38ae[_0x0a9e('0x2b')];if(!_0x30decb[_0x0a9e('0x2d')]['hasOwnProperty'](_0x0a9e('0x33'))){_0x375c18['limit']=qs[_0x0a9e('0x1d')](_0x30decb['query'][_0x0a9e('0x1d')]);_0x375c18['offset']=qs['offset'](_0x30decb['query'][_0x0a9e('0x1c')]);}_0x375c18['order']=qs[_0x0a9e('0x35')](_0x30decb[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x375c18[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x4a')](_0x30decb[_0x0a9e('0x2d')],_0x5d38ae[_0x0a9e('0x2e')]));if(_0x30decb['query'][_0x0a9e('0x37')]){_0x375c18[_0x0a9e('0x36')]=_[_0x0a9e('0x44')](_0x375c18[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x4b')](_0x375c18[_0x0a9e('0x30')],function(_0x5d86e9){var _0x956fbe={};_0x956fbe[_0x5d86e9]={'$like':'%'+_0x30decb[_0x0a9e('0x2d')]['filter']+'%'};return _0x956fbe;})});}_0x375c18=_[_0x0a9e('0x44')]({},_0x375c18,_0x30decb['options']);var _0x20c668={'where':_0x375c18['where']};return db['VoiceQueueReport']['count'](_0x20c668)[_0x0a9e('0x23')](function(_0x49d231){_0x4b1b9f[_0x0a9e('0x1b')]=_0x49d231;if(_0x30decb[_0x0a9e('0x2d')][_0x0a9e('0x3d')]){_0x375c18[_0x0a9e('0x3e')]=[{'all':!![]}];}return db[_0x0a9e('0x3f')][_0x0a9e('0x4c')](_0x375c18);})['then'](function(_0x1627a7){_0x4b1b9f['rows']=_0x1627a7;return _0x4b1b9f;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2e5165,_0x375c18,_0x0a9e('0x49')))[_0x0a9e('0x41')](handleError(_0x2e5165,null,'getVoiceQueuesReport'));};
\ No newline at end of file
+var _0x54ef=['error','name','index','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','type','field','options','VoiceQueueReport','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','describe','getVoiceQueuesReport','hasOwnProperty','filter','rows','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./voiceQueueReport.socket','register','sendStatus','status','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0x54ef,0x112));var _0xf54e=function(_0x479bdf,_0x5b5f8e){_0x479bdf=_0x479bdf-0x0;var _0x5a3945=_0x54ef[_0x479bdf];return _0x5a3945;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var hardwareService=require(_0xf54e('0x13'));var logger=require('../../config/logger')(_0xf54e('0x14'));var utils=require(_0xf54e('0x15'));var config=require(_0xf54e('0x16'));var db=require(_0xf54e('0x17'))['db'];config['redis']=_[_0xf54e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf54e('0x19'))(new Redis(config[_0xf54e('0x1a')]));require(_0xf54e('0x1b'))[_0xf54e('0x1c')](socket);function respondWithStatusCode(_0x5644aa,_0x331732){_0x331732=_0x331732||0xcc;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1d')](_0x331732);}return _0x5644aa[_0xf54e('0x1e')](_0x331732)['end']();};}function respondWithResult(_0x2366ee,_0x389abc){_0x389abc=_0x389abc||0xc8;return function(_0x3eb415){if(_0x3eb415){return _0x2366ee['status'](_0x389abc)['json'](_0x3eb415);}};}function respondWithFilteredResult(_0xd87020,_0x41fb35){return function(_0x1c02e7){if(_0x1c02e7){var _0x9647f=_0x1c02e7[_0xf54e('0x1f')],_0x15cc48=_0x41fb35[_0xf54e('0x20')],_0x3e7d96=_0x41fb35[_0xf54e('0x20')]+_0x41fb35[_0xf54e('0x21')],_0x2e27b6;if(_0x3e7d96>=_0x9647f){_0x3e7d96=_0x9647f;_0x2e27b6=0xc8;}else{_0x2e27b6=0xce;}_0xd87020['status'](_0x2e27b6);return _0xd87020['set'](_0xf54e('0x22'),_0x15cc48+'-'+_0x3e7d96+'/'+_0x9647f)['json'](_0x1c02e7);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x23')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x24')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x25')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x26')](_0x388aa0)[_0xf54e('0x27')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x28')]()[_0xf54e('0x27')](function(){_0x6f6d29[_0xf54e('0x1e')](0xcc)[_0xf54e('0x29')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x1d')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x2a')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x2b')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1e')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2c')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={},_0x25b643={},_0x3993e4={'count':0x0,'rows':[]};var _0x36f985=db['VoiceQueueReport']['rawAttributes'];_0x25b643[_0xf54e('0x2d')]=_[_0xf54e('0x2e')](_0x36f985);_0x25b643[_0xf54e('0x2f')]=_[_0xf54e('0x2e')](_0x269f47[_0xf54e('0x2f')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2d')],_0x25b643[_0xf54e('0x2f')]);_0xa13cd0[_0xf54e('0x32')]=_['intersection'](_0x25b643['model'],qs[_0xf54e('0x33')](_0x269f47[_0xf54e('0x2f')]['fields']));_0xa13cd0[_0xf54e('0x32')]=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643['model'];if(!_0x269f47['query']['hasOwnProperty'](_0xf54e('0x35'))){_0xa13cd0[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x269f47[_0xf54e('0x2f')][_0xf54e('0x21')]);_0xa13cd0[_0xf54e('0x20')]=qs['offset'](_0x269f47['query']['offset']);}_0xa13cd0[_0xf54e('0x36')]=qs[_0xf54e('0x37')](_0x269f47['query']['sort']);_0xa13cd0[_0xf54e('0x38')]=qs[_0xf54e('0x30')](_[_0xf54e('0x39')](_0x269f47['query'],_0x25b643[_0xf54e('0x30')]));if(_0x269f47[_0xf54e('0x2f')]['filter']){_0xa13cd0[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0xa13cd0[_0xf54e('0x38')],{'$or':_[_0xf54e('0x3b')](_0x36f985,function(_0x12ef97){if(_0x12ef97[_0xf54e('0x3c')]['key']!=='VIRTUAL'){var _0x3d5a68={};_0x3d5a68[_0x12ef97[_0xf54e('0x3d')]]={'$like':'%'+_0x269f47[_0xf54e('0x2f')]['filter']+'%'};return _0x3d5a68;}})});}_0xa13cd0=_[_0xf54e('0x3a')]({},_0xa13cd0,_0x269f47[_0xf54e('0x3e')]);var _0x448054={'where':_0xa13cd0[_0xf54e('0x38')]};return db[_0xf54e('0x3f')][_0xf54e('0x1f')](_0x448054)[_0xf54e('0x27')](function(_0x1345b0){_0x3993e4[_0xf54e('0x1f')]=_0x1345b0;if(_0x269f47[_0xf54e('0x2f')][_0xf54e('0x40')]){_0xa13cd0[_0xf54e('0x41')]=[{'all':!![]}];}return db[_0xf54e('0x3f')][_0xf54e('0x42')](_0xa13cd0);})[_0xf54e('0x27')](function(_0x5085c1){_0x3993e4['rows']=_0x5085c1;return _0x3993e4;})['then'](respondWithFilteredResult(_0x21ba00,_0xa13cd0))[_0xf54e('0x43')](handleError(_0x21ba00,null));};exports[_0xf54e('0x44')]=function(_0x5398b2,_0x3dae9b){var _0x311ce1={'raw':![],'where':{'id':_0x5398b2['params']['id']}},_0x381c03={};_0x381c03[_0xf54e('0x2d')]=_[_0xf54e('0x2e')](db[_0xf54e('0x3f')][_0xf54e('0x45')]);_0x381c03[_0xf54e('0x2f')]=_[_0xf54e('0x2e')](_0x5398b2[_0xf54e('0x2f')]);_0x381c03[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x381c03['model'],_0x381c03[_0xf54e('0x2f')]);_0x311ce1[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x381c03[_0xf54e('0x2d')],qs[_0xf54e('0x33')](_0x5398b2[_0xf54e('0x2f')]['fields']));_0x311ce1[_0xf54e('0x32')]=_0x311ce1['attributes'][_0xf54e('0x34')]?_0x311ce1['attributes']:_0x381c03[_0xf54e('0x2d')];if(_0x5398b2[_0xf54e('0x2f')][_0xf54e('0x40')]){_0x311ce1['include']=[{'all':!![]}];}_0x311ce1=_[_0xf54e('0x3a')]({},_0x311ce1,_0x5398b2[_0xf54e('0x3e')]);return db[_0xf54e('0x3f')][_0xf54e('0x46')](_0x311ce1)[_0xf54e('0x27')](handleEntityNotFound(_0x3dae9b,null))['then'](respondWithResult(_0x3dae9b,null))[_0xf54e('0x43')](handleError(_0x3dae9b,null));};exports[_0xf54e('0x47')]=function(_0x346bb4,_0x45592b){return db['VoiceQueueReport'][_0xf54e('0x47')](_0x346bb4[_0xf54e('0x48')],{})['then'](respondWithResult(_0x45592b,0xc9))[_0xf54e('0x43')](handleError(_0x45592b,null));};exports[_0xf54e('0x26')]=function(_0x3d24c7,_0xca0141){if(_0x3d24c7['body']['id']){delete _0x3d24c7[_0xf54e('0x48')]['id'];}return db[_0xf54e('0x3f')][_0xf54e('0x46')]({'where':{'id':_0x3d24c7[_0xf54e('0x49')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0xca0141,null))[_0xf54e('0x27')](saveUpdates(_0x3d24c7[_0xf54e('0x48')],null))[_0xf54e('0x27')](respondWithResult(_0xca0141,null))[_0xf54e('0x43')](handleError(_0xca0141,null));};exports[_0xf54e('0x28')]=function(_0xaf9bf0,_0x1f4cf8){return db[_0xf54e('0x3f')][_0xf54e('0x46')]({'where':{'id':_0xaf9bf0[_0xf54e('0x49')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x1f4cf8,null))[_0xf54e('0x27')](removeEntity(_0x1f4cf8,null))[_0xf54e('0x43')](handleError(_0x1f4cf8,null));};exports[_0xf54e('0x4a')]=function(_0x480c44,_0x4e25e4){return db['VoiceQueueReport'][_0xf54e('0x4a')]()[_0xf54e('0x27')](respondWithResult(_0x4e25e4,null))[_0xf54e('0x43')](handleError(_0x4e25e4,null));};exports[_0xf54e('0x4b')]=function(_0xba297c,_0x3b7f40){var _0x22763f={},_0x149d0b={},_0x89b811={'count':0x0,'rows':[]};_0x149d0b[_0xf54e('0x2d')]=_[_0xf54e('0x2e')](db['VoiceQueueReport'][_0xf54e('0x45')]);_0x149d0b[_0xf54e('0x2f')]=_[_0xf54e('0x2e')](_0xba297c[_0xf54e('0x2f')]);_0x149d0b[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x149d0b[_0xf54e('0x2d')],_0x149d0b['query']);_0x22763f[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x149d0b[_0xf54e('0x2d')],qs['fields'](_0xba297c[_0xf54e('0x2f')]['fields']));_0x22763f[_0xf54e('0x32')]=_0x22763f[_0xf54e('0x32')][_0xf54e('0x34')]?_0x22763f['attributes']:_0x149d0b[_0xf54e('0x2d')];if(!_0xba297c[_0xf54e('0x2f')][_0xf54e('0x4c')](_0xf54e('0x35'))){_0x22763f[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0xba297c[_0xf54e('0x2f')]['limit']);_0x22763f['offset']=qs[_0xf54e('0x20')](_0xba297c[_0xf54e('0x2f')]['offset']);}_0x22763f[_0xf54e('0x36')]=qs['sort'](_0xba297c[_0xf54e('0x2f')]['sort']);_0x22763f[_0xf54e('0x38')]=qs[_0xf54e('0x30')](_[_0xf54e('0x39')](_0xba297c[_0xf54e('0x2f')],_0x149d0b[_0xf54e('0x30')]));if(_0xba297c[_0xf54e('0x2f')]['filter']){_0x22763f['where']=_[_0xf54e('0x3a')](_0x22763f[_0xf54e('0x38')],{'$or':_['map'](_0x22763f['attributes'],function(_0x2a5e54){var _0x511a99={};_0x511a99[_0x2a5e54]={'$like':'%'+_0xba297c[_0xf54e('0x2f')][_0xf54e('0x4d')]+'%'};return _0x511a99;})});}_0x22763f=_[_0xf54e('0x3a')]({},_0x22763f,_0xba297c[_0xf54e('0x3e')]);var _0x1d7c52={'where':_0x22763f[_0xf54e('0x38')]};return db[_0xf54e('0x3f')][_0xf54e('0x1f')](_0x1d7c52)[_0xf54e('0x27')](function(_0x4d8040){_0x89b811[_0xf54e('0x1f')]=_0x4d8040;if(_0xba297c[_0xf54e('0x2f')][_0xf54e('0x40')]){_0x22763f[_0xf54e('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xf54e('0x42')](_0x22763f);})[_0xf54e('0x27')](function(_0xb7ff4d){_0x89b811[_0xf54e('0x4e')]=_0xb7ff4d;return _0x89b811;})[_0xf54e('0x27')](respondWithFilteredResult(_0x3b7f40,_0x22763f,'getVoiceQueuesReport'))[_0xf54e('0x43')](handleError(_0x3b7f40,null,_0xf54e('0x4b')));};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js
index f3a3e66..6787c93 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.events.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x122e=['hook','events','VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0x1d9e40,_0x1c44db){var _0x2ee94f=function(_0x37a330){while(--_0x37a330){_0x1d9e40['push'](_0x1d9e40['shift']());}};_0x2ee94f(++_0x1c44db);}(_0x122e,0x1d9));var _0xe122=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x122e[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xe122('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xe122('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe122('0x2')](0x0);var events={'afterCreate':_0xe122('0x3'),'afterUpdate':_0xe122('0x4'),'afterDestroy':_0xe122('0x5')};function emitEvent(_0x3a7fd3){return function(_0x2a9fc2,_0x25816c,_0x4cf89d){VoiceQueueReportEvents['emit'](_0x3a7fd3+':'+_0x2a9fc2['id'],_0x2a9fc2);VoiceQueueReportEvents[_0xe122('0x6')](_0x3a7fd3,_0x2a9fc2);_0x4cf89d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xe122('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xb810=['update','emit','hook','exports','../../mysqldb','VoiceQueueReport','save'];(function(_0x2b8a37,_0x3c3fde){var _0x40f9a0=function(_0x40dc1f){while(--_0x40dc1f){_0x2b8a37['push'](_0x2b8a37['shift']());}};_0x40f9a0(++_0x3c3fde);}(_0xb810,0xd6));var _0x0b81=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xb810[_0x47aa64];return _0x549c7a;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x0b81('0x0'))['db'][_0x0b81('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0b81('0x2'),'afterUpdate':_0x0b81('0x3'),'afterDestroy':'remove'};function emitEvent(_0x337295){return function(_0x594e67,_0x251a38,_0x17ae97){VoiceQueueReportEvents[_0x0b81('0x4')](_0x337295+':'+_0x594e67['id'],_0x594e67);VoiceQueueReportEvents[_0x0b81('0x4')](_0x337295,_0x594e67);_0x17ae97(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x0b81('0x5')](e,emitEvent(event));}}module[_0x0b81('0x6')]=VoiceQueueReportEvents;
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js
index edca0e0..dc4df38 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.model.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c05=['rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x1d219c,_0x50820a){var _0x3d9fde=function(_0x2e5b62){while(--_0x2e5b62){_0x1d219c['push'](_0x1d219c['shift']());}};_0x3d9fde(++_0x50820a);}(_0x3c05,0x120));var _0x53c0=function(_0x1a46de,_0xb41b5e){_0x1a46de=_0x1a46de-0x0;var _0x525c8a=_0x3c05[_0x1a46de];return _0x525c8a;};'use strict';var _=require(_0x53c0('0x0'));var util=require(_0x53c0('0x1'));var logger=require(_0x53c0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x53c0('0x3'));var rp=require(_0x53c0('0x4'));var fs=require('fs');var path=require(_0x53c0('0x5'));var rimraf=require(_0x53c0('0x6'));var config=require(_0x53c0('0x7'));var attributes=require(_0x53c0('0x8'));module['exports']=function(_0x23a1c8,_0x126f78){return _0x23a1c8[_0x53c0('0x9')](_0x53c0('0xa'),attributes,{'tableName':_0x53c0('0xb'),'paranoid':![],'indexes':[{'fields':[_0x53c0('0xc')]},{'fields':[_0x53c0('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d49=['../../config/logger','api','moment','bluebird','path','rimraf','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','uniqueid','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d49,0x1c5));var _0x97d4=function(_0x934754,_0x15bd40){_0x934754=_0x934754-0x0;var _0x5cf1fc=_0x7d49[_0x934754];return _0x5cf1fc;};'use strict';var _=require(_0x97d4('0x0'));var util=require(_0x97d4('0x1'));var logger=require(_0x97d4('0x2'))(_0x97d4('0x3'));var moment=require(_0x97d4('0x4'));var BPromise=require(_0x97d4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97d4('0x6'));var rimraf=require(_0x97d4('0x7'));var config=require('../../config/environment');var attributes=require(_0x97d4('0x8'));module[_0x97d4('0x9')]=function(_0x4eb794,_0x3515de){return _0x4eb794['define'](_0x97d4('0xa'),attributes,{'tableName':_0x97d4('0xb'),'paranoid':![],'indexes':[{'fields':[_0x97d4('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js
index b355490..c076141 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.rpc.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x64f4=['body','CreateVoiceQueueReport','update','UpdateVoiceQueueReport','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','VoiceQueueReport','create'];(function(_0x4c2f76,_0x449a49){var _0x2066a6=function(_0x3a6b8b){while(--_0x3a6b8b){_0x4c2f76['push'](_0x4c2f76['shift']());}};_0x2066a6(++_0x449a49);}(_0x64f4,0x1d8));var _0x464f=function(_0xa3b671,_0xd5c20b){_0xa3b671=_0xa3b671-0x0;var _0x626bb3=_0x64f4[_0xa3b671];return _0x626bb3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x464f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x464f('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x464f('0x2'));var logger=require(_0x464f('0x3'))(_0x464f('0x4'));var config=require(_0x464f('0x5'));var jayson=require(_0x464f('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x464f('0x7')]=_[_0x464f('0x8')](config[_0x464f('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x464f('0x9'))(new Redis(config[_0x464f('0x7')]));require(_0x464f('0xa'))[_0x464f('0xb')](socket);function respondWithRpcPromise(_0x576621,_0x1db2e6,_0x444e50){return new BPromise(function(_0x1fe20b,_0x54ef80){return client[_0x464f('0xc')](_0x576621,_0x444e50)[_0x464f('0xd')](function(_0x5ec5f5){logger[_0x464f('0xe')](_0x464f('0xf'),_0x1db2e6,_0x464f('0x10'));logger[_0x464f('0x11')](_0x464f('0x12'),_0x1db2e6,_0x464f('0x10'),JSON[_0x464f('0x13')](_0x5ec5f5));if(_0x5ec5f5[_0x464f('0x14')]){if(_0x5ec5f5['error']['code']===0x1f4){logger[_0x464f('0x14')](_0x464f('0xf'),_0x1db2e6,_0x5ec5f5[_0x464f('0x14')][_0x464f('0x15')]);return _0x54ef80(_0x5ec5f5['error'][_0x464f('0x15')]);}logger[_0x464f('0x14')](_0x464f('0xf'),_0x1db2e6,_0x5ec5f5[_0x464f('0x14')][_0x464f('0x15')]);return _0x1fe20b(_0x5ec5f5[_0x464f('0x14')][_0x464f('0x15')]);}else{logger['info'](_0x464f('0xf'),_0x1db2e6,_0x464f('0x10'));_0x1fe20b(_0x5ec5f5[_0x464f('0x16')][_0x464f('0x15')]);}})[_0x464f('0x17')](function(_0x17f05d){logger[_0x464f('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x1db2e6,_0x17f05d);_0x54ef80(_0x17f05d);});});}exports['GetVoiceQueueReport']=function(_0x16831f){var _0x189364=this;return new Promise(function(_0x14fce8,_0x5c54d8){return db['VoiceQueueReport']['findAll']({'raw':_0x16831f[_0x464f('0x18')]?_0x16831f[_0x464f('0x18')][_0x464f('0x19')]===undefined?!![]:![]:!![],'where':_0x16831f['options']?_0x16831f['options'][_0x464f('0x1a')]||null:null,'attributes':_0x16831f['options']?_0x16831f['options'][_0x464f('0x1b')]||null:null,'limit':_0x16831f[_0x464f('0x18')]?_0x16831f[_0x464f('0x18')][_0x464f('0x1c')]||null:null,'include':_0x16831f['options']?_0x16831f[_0x464f('0x18')][_0x464f('0x1d')]?_['map'](_0x16831f[_0x464f('0x18')]['include'],function(_0x53486b){return{'model':db[_0x53486b['model']],'as':_0x53486b['as'],'attributes':_0x53486b[_0x464f('0x1b')],'include':_0x53486b['include']?_['map'](_0x53486b[_0x464f('0x1d')],function(_0x138706){return{'model':db[_0x138706['model']],'as':_0x138706['as'],'attributes':_0x138706[_0x464f('0x1b')],'include':_0x138706[_0x464f('0x1d')]?_[_0x464f('0x1e')](_0x138706[_0x464f('0x1d')],function(_0x1cd8e4){return{'model':db[_0x1cd8e4[_0x464f('0x1f')]],'as':_0x1cd8e4['as'],'attributes':_0x1cd8e4[_0x464f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x464f('0xd')](function(_0x3ca987){logger[_0x464f('0xe')](_0x464f('0x20'),_0x16831f);logger[_0x464f('0x11')]('GetVoiceQueueReport',_0x16831f,JSON['stringify'](_0x3ca987));_0x14fce8(_0x3ca987);})[_0x464f('0x17')](function(_0x32f8a9){logger[_0x464f('0x14')](_0x464f('0x20'),_0x32f8a9[_0x464f('0x15')],_0x16831f);_0x5c54d8(_0x189364[_0x464f('0x14')](0x1f4,_0x32f8a9[_0x464f('0x15')]));});});};exports['CreateVoiceQueueReport']=function(_0x4fc2db){var _0xfd7966=this;return new Promise(function(_0x592eba,_0x37363c){return db[_0x464f('0x21')][_0x464f('0x22')](_0x4fc2db[_0x464f('0x23')],{'raw':_0x4fc2db[_0x464f('0x18')]?_0x4fc2db[_0x464f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x464f('0xd')](function(_0x2c3679){logger[_0x464f('0xe')]('CreateVoiceQueueReport',_0x4fc2db);logger[_0x464f('0x11')](_0x464f('0x24'),_0x4fc2db,JSON[_0x464f('0x13')](_0x2c3679));_0x592eba(_0x2c3679);})[_0x464f('0x17')](function(_0x55c516){logger[_0x464f('0x14')](_0x464f('0x24'),_0x55c516[_0x464f('0x15')],_0x4fc2db);_0x37363c(_0xfd7966[_0x464f('0x14')](0x1f4,_0x55c516[_0x464f('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x462b33){var _0x58ee28=this;return new Promise(function(_0x2d97f7,_0x15fd96){return db[_0x464f('0x21')][_0x464f('0x25')](_0x462b33[_0x464f('0x23')],{'raw':_0x462b33[_0x464f('0x18')]?_0x462b33[_0x464f('0x18')][_0x464f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x462b33[_0x464f('0x18')]?_0x462b33[_0x464f('0x18')][_0x464f('0x1a')]||null:null,'attributes':_0x462b33[_0x464f('0x18')]?_0x462b33[_0x464f('0x18')][_0x464f('0x1b')]||null:null,'limit':_0x462b33[_0x464f('0x18')]?_0x462b33[_0x464f('0x18')]['limit']||null:null})[_0x464f('0xd')](function(_0x2fe1b2){logger[_0x464f('0xe')](_0x464f('0x26'),_0x462b33);logger['debug'](_0x464f('0x26'),_0x462b33,JSON[_0x464f('0x13')](_0x2fe1b2));_0x2d97f7(_0x2fe1b2);})[_0x464f('0x17')](function(_0x1b1e6f){logger['error']('UpdateVoiceQueueReport',_0x1b1e6f[_0x464f('0x15')],_0x462b33);_0x15fd96(_0x58ee28['error'](0x1f4,_0x1b1e6f['message']));});});};
\ No newline at end of file
+var _0xb7d4=['code','message','result','catch','GetVoiceQueueReport','findAll','options','where','include','map','model','attributes','CreateVoiceQueueReport','VoiceQueueReport','create','raw','update','body','UpdateVoiceQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','socket.io-emitter','redis','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb7d4,0xef));var _0x4b7d=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb7d4[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x4b7d('0x0'));var util=require(_0x4b7d('0x1'));var moment=require('moment');var BPromise=require(_0x4b7d('0x2'));var rs=require(_0x4b7d('0x3'));var fs=require('fs');var Redis=require(_0x4b7d('0x4'));var db=require(_0x4b7d('0x5'))['db'];var utils=require(_0x4b7d('0x6'));var logger=require(_0x4b7d('0x7'))(_0x4b7d('0x8'));var config=require(_0x4b7d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4b7d('0xa')][_0x4b7d('0xb')]({'port':0x232a});config['redis']=_[_0x4b7d('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4b7d('0xd'))(new Redis(config[_0x4b7d('0xe')]));require('./voiceQueueReport.socket')[_0x4b7d('0xf')](socket);function respondWithRpcPromise(_0x14d6a6,_0x5f1d2a,_0x404187){return new BPromise(function(_0x9d78f6,_0x25cd84){return client[_0x4b7d('0x10')](_0x14d6a6,_0x404187)[_0x4b7d('0x11')](function(_0x2dcf77){logger[_0x4b7d('0x12')](_0x4b7d('0x13'),_0x5f1d2a,_0x4b7d('0x14'));logger[_0x4b7d('0x15')](_0x4b7d('0x16'),_0x5f1d2a,'request\x20sent',JSON[_0x4b7d('0x17')](_0x2dcf77));if(_0x2dcf77[_0x4b7d('0x18')]){if(_0x2dcf77[_0x4b7d('0x18')][_0x4b7d('0x19')]===0x1f4){logger['error'](_0x4b7d('0x13'),_0x5f1d2a,_0x2dcf77[_0x4b7d('0x18')][_0x4b7d('0x1a')]);return _0x25cd84(_0x2dcf77[_0x4b7d('0x18')][_0x4b7d('0x1a')]);}logger[_0x4b7d('0x18')](_0x4b7d('0x13'),_0x5f1d2a,_0x2dcf77[_0x4b7d('0x18')][_0x4b7d('0x1a')]);return _0x9d78f6(_0x2dcf77[_0x4b7d('0x18')][_0x4b7d('0x1a')]);}else{logger[_0x4b7d('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x5f1d2a,_0x4b7d('0x14'));_0x9d78f6(_0x2dcf77[_0x4b7d('0x1b')][_0x4b7d('0x1a')]);}})[_0x4b7d('0x1c')](function(_0x39444f){logger[_0x4b7d('0x18')](_0x4b7d('0x13'),_0x5f1d2a,_0x39444f);_0x25cd84(_0x39444f);});});}exports[_0x4b7d('0x1d')]=function(_0x2f1a2f){var _0x58db3e=this;return new Promise(function(_0x6e8850,_0x39c959){return db['VoiceQueueReport'][_0x4b7d('0x1e')]({'raw':_0x2f1a2f['options']?_0x2f1a2f[_0x4b7d('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2f1a2f['options']?_0x2f1a2f[_0x4b7d('0x1f')][_0x4b7d('0x20')]||null:null,'attributes':_0x2f1a2f['options']?_0x2f1a2f[_0x4b7d('0x1f')]['attributes']||null:null,'limit':_0x2f1a2f[_0x4b7d('0x1f')]?_0x2f1a2f[_0x4b7d('0x1f')]['limit']||null:null,'include':_0x2f1a2f[_0x4b7d('0x1f')]?_0x2f1a2f[_0x4b7d('0x1f')][_0x4b7d('0x21')]?_[_0x4b7d('0x22')](_0x2f1a2f[_0x4b7d('0x1f')]['include'],function(_0x161af2){return{'model':db[_0x161af2[_0x4b7d('0x23')]],'as':_0x161af2['as'],'attributes':_0x161af2[_0x4b7d('0x24')],'include':_0x161af2[_0x4b7d('0x21')]?_[_0x4b7d('0x22')](_0x161af2[_0x4b7d('0x21')],function(_0x5af5bd){return{'model':db[_0x5af5bd[_0x4b7d('0x23')]],'as':_0x5af5bd['as'],'attributes':_0x5af5bd[_0x4b7d('0x24')],'include':_0x5af5bd[_0x4b7d('0x21')]?_[_0x4b7d('0x22')](_0x5af5bd[_0x4b7d('0x21')],function(_0x49ca3c){return{'model':db[_0x49ca3c[_0x4b7d('0x23')]],'as':_0x49ca3c['as'],'attributes':_0x49ca3c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b7d('0x11')](function(_0x355236){logger[_0x4b7d('0x12')](_0x4b7d('0x1d'),_0x2f1a2f);logger[_0x4b7d('0x15')](_0x4b7d('0x1d'),_0x2f1a2f,JSON[_0x4b7d('0x17')](_0x355236));_0x6e8850(_0x355236);})['catch'](function(_0x577107){logger[_0x4b7d('0x18')](_0x4b7d('0x1d'),_0x577107[_0x4b7d('0x1a')],_0x2f1a2f);_0x39c959(_0x58db3e[_0x4b7d('0x18')](0x1f4,_0x577107[_0x4b7d('0x1a')]));});});};exports[_0x4b7d('0x25')]=function(_0x365067){var _0x1de0ec=this;return new Promise(function(_0x44adf5,_0x6d8a3b){return db[_0x4b7d('0x26')][_0x4b7d('0x27')](_0x365067['body'],{'raw':_0x365067['options']?_0x365067['options'][_0x4b7d('0x28')]===undefined?!![]:![]:!![]})[_0x4b7d('0x11')](function(_0x569172){logger['info'](_0x4b7d('0x25'),_0x365067);logger[_0x4b7d('0x15')](_0x4b7d('0x25'),_0x365067,JSON[_0x4b7d('0x17')](_0x569172));_0x44adf5(_0x569172);})[_0x4b7d('0x1c')](function(_0x4f01f9){logger['error']('CreateVoiceQueueReport',_0x4f01f9[_0x4b7d('0x1a')],_0x365067);_0x6d8a3b(_0x1de0ec[_0x4b7d('0x18')](0x1f4,_0x4f01f9[_0x4b7d('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x65edca){var _0x5bb18b=this;return new Promise(function(_0x22be57,_0x1c7dbf){return db[_0x4b7d('0x26')][_0x4b7d('0x29')](_0x65edca[_0x4b7d('0x2a')],{'raw':_0x65edca[_0x4b7d('0x1f')]?_0x65edca[_0x4b7d('0x1f')][_0x4b7d('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x65edca[_0x4b7d('0x1f')]?_0x65edca[_0x4b7d('0x1f')][_0x4b7d('0x20')]||null:null,'attributes':_0x65edca[_0x4b7d('0x1f')]?_0x65edca[_0x4b7d('0x1f')][_0x4b7d('0x24')]||null:null,'limit':_0x65edca[_0x4b7d('0x1f')]?_0x65edca[_0x4b7d('0x1f')]['limit']||null:null})[_0x4b7d('0x11')](function(_0x206b0f){logger[_0x4b7d('0x12')](_0x4b7d('0x2b'),_0x65edca);logger[_0x4b7d('0x15')](_0x4b7d('0x2b'),_0x65edca,JSON['stringify'](_0x206b0f));_0x22be57(_0x206b0f);})[_0x4b7d('0x1c')](function(_0x3d38b3){logger[_0x4b7d('0x18')]('UpdateVoiceQueueReport',_0x3d38b3[_0x4b7d('0x1a')],_0x65edca);_0x1c7dbf(_0x5bb18b[_0x4b7d('0x18')](0x1f4,_0x3d38b3[_0x4b7d('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js
index 23a383f..fe17540 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.socket.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa620=['save','remove','update','removeListener','length','voiceQueueReport:'];(function(_0x4e6b06,_0x2973df){var _0x46442c=function(_0x5159c9){while(--_0x5159c9){_0x4e6b06['push'](_0x4e6b06['shift']());}};_0x46442c(++_0x2973df);}(_0xa620,0x138));var _0x0a62=function(_0x40f991,_0x576819){_0x40f991=_0x40f991-0x0;var _0x38eca2=_0xa620[_0x40f991];return _0x38eca2;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x0a62('0x0'),_0x0a62('0x1'),_0x0a62('0x2')];function createListener(_0x1bd386,_0x5de26b){return function(_0x49c97c){_0x5de26b['emit'](_0x1bd386,_0x49c97c);};}function removeListener(_0x2bbb26,_0x4d4956){return function(){VoiceQueueReportEvents[_0x0a62('0x3')](_0x2bbb26,_0x4d4956);};}exports['register']=function(_0x3e31c2){for(var _0x56faff=0x0,_0x1a0416=events[_0x0a62('0x4')];_0x56faff<_0x1a0416;_0x56faff++){var _0x5967e5=events[_0x56faff];var _0x38016c=createListener(_0x0a62('0x5')+_0x5967e5,_0x3e31c2);VoiceQueueReportEvents['on'](_0x5967e5,_0x38016c);}};
\ No newline at end of file
+var _0x014c=['update','removeListener','register','length','save'];(function(_0x3ea933,_0x358ac9){var _0x3b4c2d=function(_0x3b26f5){while(--_0x3b26f5){_0x3ea933['push'](_0x3ea933['shift']());}};_0x3b4c2d(++_0x358ac9);}(_0x014c,0x17b));var _0xc014=function(_0x114d1f,_0x55548e){_0x114d1f=_0x114d1f-0x0;var _0x5b91d4=_0x014c[_0x114d1f];return _0x5b91d4;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xc014('0x0'),'remove',_0xc014('0x1')];function createListener(_0x2c3185,_0x22e595){return function(_0x4c56cf){_0x22e595['emit'](_0x2c3185,_0x4c56cf);};}function removeListener(_0x2d449e,_0x3cc3a9){return function(){VoiceQueueReportEvents[_0xc014('0x2')](_0x2d449e,_0x3cc3a9);};}exports[_0xc014('0x3')]=function(_0x10f3cb){for(var _0x5138a8=0x0,_0x398960=events[_0xc014('0x4')];_0x5138a8<_0x398960;_0x5138a8++){var _0x5785d1=events[_0x5138a8];var _0x175bdb=createListener('voiceQueueReport:'+_0x5785d1,_0x10f3cb);VoiceQueueReportEvents['on'](_0x5785d1,_0x175bdb);}};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js
index e071951..498d60e 100644
--- a/server/api/voiceQueuesLog/index.js
+++ b/server/api/voiceQueuesLog/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5bc1=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceQueuesLog.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy'];(function(_0x50edd8,_0x4d6889){var _0x1bcc3f=function(_0x7f901b){while(--_0x7f901b){_0x50edd8['push'](_0x50edd8['shift']());}};_0x1bcc3f(++_0x4d6889);}(_0x5bc1,0xb5));var _0x15bc=function(_0x2c921c,_0x3c6a85){_0x2c921c=_0x2c921c-0x0;var _0x440bf2=_0x5bc1[_0x2c921c];return _0x440bf2;};'use strict';var multer=require('multer');var util=require(_0x15bc('0x0'));var path=require(_0x15bc('0x1'));var timeout=require(_0x15bc('0x2'));var express=require(_0x15bc('0x3'));var router=express[_0x15bc('0x4')]();var auth=require(_0x15bc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x15bc('0x6'));router[_0x15bc('0x7')]('/',auth[_0x15bc('0x8')](),controller['index']);router[_0x15bc('0x7')]('/:id',auth[_0x15bc('0x8')](),controller[_0x15bc('0x9')]);router[_0x15bc('0xa')]('/',auth[_0x15bc('0x8')](),controller[_0x15bc('0xb')]);router[_0x15bc('0xc')](_0x15bc('0xd'),auth[_0x15bc('0x8')](),controller[_0x15bc('0xe')]);router[_0x15bc('0xf')]('/:id',auth[_0x15bc('0x8')](),controller[_0x15bc('0x10')]);module[_0x15bc('0x11')]=router;
\ No newline at end of file
+var _0x0120=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','show','post','create','/:id','update','delete','exports','multer','util','path'];(function(_0x286c2d,_0x4b7003){var _0x49356c=function(_0x1b7fe2){while(--_0x1b7fe2){_0x286c2d['push'](_0x286c2d['shift']());}};_0x49356c(++_0x4b7003);}(_0x0120,0x6f));var _0x0012=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0120[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var path=require(_0x0012('0x2'));var timeout=require(_0x0012('0x3'));var express=require(_0x0012('0x4'));var router=express[_0x0012('0x5')]();var auth=require(_0x0012('0x6'));var interaction=require(_0x0012('0x7'));var config=require(_0x0012('0x8'));var controller=require(_0x0012('0x9'));router[_0x0012('0xa')]('/',auth[_0x0012('0xb')](),controller['index']);router['get']('/:id',auth[_0x0012('0xb')](),controller[_0x0012('0xc')]);router[_0x0012('0xd')]('/',auth[_0x0012('0xb')](),controller[_0x0012('0xe')]);router['put'](_0x0012('0xf'),auth[_0x0012('0xb')](),controller[_0x0012('0x10')]);router[_0x0012('0x11')]('/:id',auth[_0x0012('0xb')](),controller['destroy']);module[_0x0012('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
index 70f3ac1..4f794ce 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd50=['sequelize','moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4a96ef,_0x5c1383){var _0x330714=function(_0x1bc221){while(--_0x1bc221){_0x4a96ef['push'](_0x4a96ef['shift']());}};_0x330714(++_0x5c1383);}(_0xbd50,0x196));var _0x0bd5=function(_0x446566,_0x11eb35){_0x446566=_0x446566-0x0;var _0x4a2966=_0xbd50[_0x446566];return _0x4a2966;};'use strict';var Sequelize=require(_0x0bd5('0x0'));var moment=require(_0x0bd5('0x1'));module[_0x0bd5('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0bd5('0x4')],'allowNull':![],'defaultValue':moment()[_0x0bd5('0x5')](_0x0bd5('0x6'))}};
\ No newline at end of file
+var _0xe14b=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','STRING'];(function(_0x11d430,_0x1bf933){var _0x2e9829=function(_0x573357){while(--_0x573357){_0x11d430['push'](_0x11d430['shift']());}};_0x2e9829(++_0x1bf933);}(_0xe14b,0x93));var _0xbe14=function(_0x56a309,_0x393554){_0x56a309=_0x56a309-0x0;var _0x118e7a=_0xe14b[_0x56a309];return _0x118e7a;};'use strict';var Sequelize=require(_0xbe14('0x0'));var moment=require(_0xbe14('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xbe14('0x3')],'allowNull':![],'defaultValue':moment()[_0xbe14('0x4')](_0xbe14('0x5'))}};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js
index 23dc3a4..9bbcf9b 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x47d2=['apply','reject','save','update','then','end','error','stack','name','send','VoiceQueuesLog','rawAttributes','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','include','rows','show','params','keys','includeAll','find','create','body','catch','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','set','Content-Range','json'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0x47d2,0x1d4));var _0x247d=function(_0x2ba049,_0x14ad52){_0x2ba049=_0x2ba049-0x0;var _0x1380e5=_0x47d2[_0x2ba049];return _0x1380e5;};'use strict';var pdf=require(_0x247d('0x0'));var emlformat=require(_0x247d('0x1'));var rimraf=require(_0x247d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x247d('0x3'));var rp=require(_0x247d('0x4'));var moment=require(_0x247d('0x5'));var BPromise=require(_0x247d('0x6'));var Mustache=require(_0x247d('0x7'));var util=require('util');var path=require('path');var sox=require(_0x247d('0x8'));var csv=require(_0x247d('0x9'));var ejs=require(_0x247d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x247d('0xb'));var crypto=require('crypto');var jsforce=require(_0x247d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x247d('0x9'));var querystring=require(_0x247d('0xd'));var Papa=require(_0x247d('0xe'));var Redis=require(_0x247d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x247d('0x10'));var hardwareService=require(_0x247d('0x11'));var logger=require(_0x247d('0x12'))(_0x247d('0x13'));var utils=require(_0x247d('0x14'));var config=require(_0x247d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x733789,_0x2c830f){_0x2c830f=_0x2c830f||0xcc;return function(_0x2e2f6d){if(_0x2e2f6d){return _0x733789[_0x247d('0x16')](_0x2c830f);}return _0x733789['status'](_0x2c830f)['end']();};}function respondWithResult(_0x44552c,_0x4c7b3b){_0x4c7b3b=_0x4c7b3b||0xc8;return function(_0x5017f1){if(_0x5017f1){return _0x44552c[_0x247d('0x17')](_0x4c7b3b)['json'](_0x5017f1);}};}function respondWithFilteredResult(_0x24f01e,_0x5dcca6){return function(_0x2e4238){if(_0x2e4238){var _0x617767=_0x2e4238[_0x247d('0x18')],_0x5a3789=_0x5dcca6[_0x247d('0x19')],_0x259b0f=_0x5dcca6[_0x247d('0x19')]+_0x5dcca6['limit'],_0x1f043c;if(_0x259b0f>=_0x617767){_0x259b0f=_0x617767;_0x1f043c=0xc8;}else{_0x1f043c=0xce;}_0x24f01e[_0x247d('0x17')](_0x1f043c);return _0x24f01e[_0x247d('0x1a')](_0x247d('0x1b'),_0x5a3789+'-'+_0x259b0f+'/'+_0x617767)[_0x247d('0x1c')](_0x2e4238);}return null;};}function patchUpdates(_0x30ed18){return function(_0x2417dc){try{jsonpatch[_0x247d('0x1d')](_0x2417dc,_0x30ed18,!![]);}catch(_0x4f96ce){return BPromise[_0x247d('0x1e')](_0x4f96ce);}return _0x2417dc[_0x247d('0x1f')]();};}function saveUpdates(_0x830428,_0x47d2e3){return function(_0x5af56e){if(_0x5af56e){return _0x5af56e[_0x247d('0x20')](_0x830428)[_0x247d('0x21')](function(_0x42fb92){return _0x42fb92;});}return null;};}function removeEntity(_0x16e080,_0x18f1a7){return function(_0x8489b4){if(_0x8489b4){return _0x8489b4['destroy']()[_0x247d('0x21')](function(){_0x16e080['status'](0xcc)[_0x247d('0x22')]();});}};}function handleEntityNotFound(_0x4d8116,_0x50d91a){return function(_0x5209eb){if(!_0x5209eb){_0x4d8116[_0x247d('0x16')](0x194);}return _0x5209eb;};}function handleError(_0x2bfd0b,_0x2569bc){_0x2569bc=_0x2569bc||0x1f4;return function(_0xd6dcff){logger[_0x247d('0x23')](_0xd6dcff[_0x247d('0x24')]);if(_0xd6dcff[_0x247d('0x25')]){delete _0xd6dcff[_0x247d('0x25')];}_0x2bfd0b[_0x247d('0x17')](_0x2569bc)[_0x247d('0x26')](_0xd6dcff);};}exports['index']=function(_0x344dc9,_0x1f3b04){var _0x5dcfc8={},_0x2caf1a={},_0xeee5ae={'count':0x0,'rows':[]};var _0x477807=db[_0x247d('0x27')][_0x247d('0x28')];_0x2caf1a[_0x247d('0x29')]=_['keys'](_0x477807);_0x2caf1a[_0x247d('0x2a')]=_['keys'](_0x344dc9[_0x247d('0x2a')]);_0x2caf1a[_0x247d('0x2b')]=_[_0x247d('0x2c')](_0x2caf1a['model'],_0x2caf1a[_0x247d('0x2a')]);_0x5dcfc8['attributes']=_['intersection'](_0x2caf1a[_0x247d('0x29')],qs[_0x247d('0x2d')](_0x344dc9[_0x247d('0x2a')][_0x247d('0x2d')]));_0x5dcfc8[_0x247d('0x2e')]=_0x5dcfc8[_0x247d('0x2e')]['length']?_0x5dcfc8[_0x247d('0x2e')]:_0x2caf1a['model'];if(!_0x344dc9['query'][_0x247d('0x2f')](_0x247d('0x30'))){_0x5dcfc8[_0x247d('0x31')]=qs[_0x247d('0x31')](_0x344dc9['query'][_0x247d('0x31')]);_0x5dcfc8[_0x247d('0x19')]=qs[_0x247d('0x19')](_0x344dc9[_0x247d('0x2a')][_0x247d('0x19')]);}_0x5dcfc8[_0x247d('0x32')]=qs['sort'](_0x344dc9[_0x247d('0x2a')][_0x247d('0x33')]);_0x5dcfc8[_0x247d('0x34')]=qs[_0x247d('0x2b')](_[_0x247d('0x35')](_0x344dc9[_0x247d('0x2a')],_0x2caf1a[_0x247d('0x2b')]));if(_0x344dc9[_0x247d('0x2a')][_0x247d('0x36')]){_0x5dcfc8[_0x247d('0x34')]=_[_0x247d('0x37')](_0x5dcfc8[_0x247d('0x34')],{'$or':_[_0x247d('0x38')](_0x477807,function(_0x59fd0f){if(_0x59fd0f['type']['key']!==_0x247d('0x39')){var _0x18a42f={};_0x18a42f[_0x59fd0f[_0x247d('0x3a')]]={'$like':'%'+_0x344dc9[_0x247d('0x2a')][_0x247d('0x36')]+'%'};return _0x18a42f;}})});}_0x5dcfc8=_[_0x247d('0x37')]({},_0x5dcfc8,_0x344dc9[_0x247d('0x3b')]);var _0x50a0ae={'where':_0x5dcfc8[_0x247d('0x34')]};return db['VoiceQueuesLog'][_0x247d('0x18')](_0x50a0ae)[_0x247d('0x21')](function(_0x2d962b){_0xeee5ae[_0x247d('0x18')]=_0x2d962b;if(_0x344dc9[_0x247d('0x2a')]['includeAll']){_0x5dcfc8[_0x247d('0x3c')]=[{'all':!![]}];}return db[_0x247d('0x27')]['findAll'](_0x5dcfc8);})[_0x247d('0x21')](function(_0x3483f9){_0xeee5ae[_0x247d('0x3d')]=_0x3483f9;return _0xeee5ae;})['then'](respondWithFilteredResult(_0x1f3b04,_0x5dcfc8))['catch'](handleError(_0x1f3b04,null));};exports[_0x247d('0x3e')]=function(_0x417a6b,_0x417daf){var _0x5a95b2={'raw':!![],'where':{'id':_0x417a6b[_0x247d('0x3f')]['id']}},_0xf27542={};_0xf27542['model']=_['keys'](db[_0x247d('0x27')][_0x247d('0x28')]);_0xf27542[_0x247d('0x2a')]=_[_0x247d('0x40')](_0x417a6b[_0x247d('0x2a')]);_0xf27542[_0x247d('0x2b')]=_[_0x247d('0x2c')](_0xf27542[_0x247d('0x29')],_0xf27542[_0x247d('0x2a')]);_0x5a95b2[_0x247d('0x2e')]=_[_0x247d('0x2c')](_0xf27542[_0x247d('0x29')],qs['fields'](_0x417a6b[_0x247d('0x2a')][_0x247d('0x2d')]));_0x5a95b2[_0x247d('0x2e')]=_0x5a95b2['attributes']['length']?_0x5a95b2['attributes']:_0xf27542['model'];if(_0x417a6b['query'][_0x247d('0x41')]){_0x5a95b2['include']=[{'all':!![]}];}_0x5a95b2=_[_0x247d('0x37')]({},_0x5a95b2,_0x417a6b['options']);return db['VoiceQueuesLog'][_0x247d('0x42')](_0x5a95b2)[_0x247d('0x21')](handleEntityNotFound(_0x417daf,null))[_0x247d('0x21')](respondWithResult(_0x417daf,null))['catch'](handleError(_0x417daf,null));};exports[_0x247d('0x43')]=function(_0x5745e6,_0x2dec4b){return db[_0x247d('0x27')]['create'](_0x5745e6[_0x247d('0x44')],{})[_0x247d('0x21')](respondWithResult(_0x2dec4b,0xc9))[_0x247d('0x45')](handleError(_0x2dec4b,null));};exports['update']=function(_0x372949,_0x201a16){if(_0x372949[_0x247d('0x44')]['id']){delete _0x372949['body']['id'];}return db[_0x247d('0x27')][_0x247d('0x42')]({'where':{'id':_0x372949[_0x247d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x201a16,null))['then'](saveUpdates(_0x372949[_0x247d('0x44')],null))[_0x247d('0x21')](respondWithResult(_0x201a16,null))[_0x247d('0x45')](handleError(_0x201a16,null));};exports[_0x247d('0x46')]=function(_0x4e7391,_0x5b3423){return db[_0x247d('0x27')][_0x247d('0x42')]({'where':{'id':_0x4e7391['params']['id']}})['then'](handleEntityNotFound(_0x5b3423,null))[_0x247d('0x21')](removeEntity(_0x5b3423,null))[_0x247d('0x45')](handleError(_0x5b3423,null));};
\ No newline at end of file
+var _0xbc81=['field','filter','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','index','VoiceQueuesLog','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','key','VIRTUAL'];(function(_0x9b1166,_0x384402){var _0x2ad057=function(_0x2b854d){while(--_0x2b854d){_0x9b1166['push'](_0x9b1166['shift']());}};_0x2ad057(++_0x384402);}(_0xbc81,0x12d));var _0x1bc8=function(_0x489c95,_0x53159c){_0x489c95=_0x489c95-0x0;var _0x10e7a7=_0xbc81[_0x489c95];return _0x10e7a7;};'use strict';var pdf=require(_0x1bc8('0x0'));var emlformat=require(_0x1bc8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1bc8('0x2'));var jsonpatch=require(_0x1bc8('0x3'));var rp=require(_0x1bc8('0x4'));var moment=require(_0x1bc8('0x5'));var BPromise=require(_0x1bc8('0x6'));var Mustache=require('mustache');var util=require(_0x1bc8('0x7'));var path=require(_0x1bc8('0x8'));var sox=require(_0x1bc8('0x9'));var csv=require(_0x1bc8('0xa'));var ejs=require(_0x1bc8('0xb'));var fs=require('fs');var _=require(_0x1bc8('0xc'));var squel=require(_0x1bc8('0xd'));var crypto=require(_0x1bc8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1bc8('0xf'));var toCsv=require(_0x1bc8('0xa'));var querystring=require('querystring');var Papa=require(_0x1bc8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1bc8('0x11'));var logger=require(_0x1bc8('0x12'))(_0x1bc8('0x13'));var utils=require(_0x1bc8('0x14'));var config=require(_0x1bc8('0x15'));var db=require(_0x1bc8('0x16'))['db'];function respondWithStatusCode(_0x300417,_0xe03420){_0xe03420=_0xe03420||0xcc;return function(_0x3d4c5f){if(_0x3d4c5f){return _0x300417['sendStatus'](_0xe03420);}return _0x300417[_0x1bc8('0x17')](_0xe03420)[_0x1bc8('0x18')]();};}function respondWithResult(_0x2d8688,_0x4ceb41){_0x4ceb41=_0x4ceb41||0xc8;return function(_0x133716){if(_0x133716){return _0x2d8688['status'](_0x4ceb41)[_0x1bc8('0x19')](_0x133716);}};}function respondWithFilteredResult(_0x232cbd,_0x3980da){return function(_0x32fb3d){if(_0x32fb3d){var _0x5472ee=_0x32fb3d[_0x1bc8('0x1a')],_0x193b48=_0x3980da[_0x1bc8('0x1b')],_0x446405=_0x3980da[_0x1bc8('0x1b')]+_0x3980da[_0x1bc8('0x1c')],_0x22ff55;if(_0x446405>=_0x5472ee){_0x446405=_0x5472ee;_0x22ff55=0xc8;}else{_0x22ff55=0xce;}_0x232cbd[_0x1bc8('0x17')](_0x22ff55);return _0x232cbd[_0x1bc8('0x1d')](_0x1bc8('0x1e'),_0x193b48+'-'+_0x446405+'/'+_0x5472ee)[_0x1bc8('0x19')](_0x32fb3d);}return null;};}function patchUpdates(_0x1b0010){return function(_0x305784){try{jsonpatch['apply'](_0x305784,_0x1b0010,!![]);}catch(_0x2366a8){return BPromise[_0x1bc8('0x1f')](_0x2366a8);}return _0x305784[_0x1bc8('0x20')]();};}function saveUpdates(_0x3ba2a3,_0x229a03){return function(_0x13a7b3){if(_0x13a7b3){return _0x13a7b3[_0x1bc8('0x21')](_0x3ba2a3)['then'](function(_0x31a982){return _0x31a982;});}return null;};}function removeEntity(_0xf3c69b,_0x228656){return function(_0x578b86){if(_0x578b86){return _0x578b86[_0x1bc8('0x22')]()[_0x1bc8('0x23')](function(){_0xf3c69b['status'](0xcc)[_0x1bc8('0x18')]();});}};}function handleEntityNotFound(_0x47536a,_0x33fe4a){return function(_0x42a57c){if(!_0x42a57c){_0x47536a[_0x1bc8('0x24')](0x194);}return _0x42a57c;};}function handleError(_0x2cd996,_0x401446){_0x401446=_0x401446||0x1f4;return function(_0x3e15f7){logger[_0x1bc8('0x25')](_0x3e15f7[_0x1bc8('0x26')]);if(_0x3e15f7[_0x1bc8('0x27')]){delete _0x3e15f7[_0x1bc8('0x27')];}_0x2cd996[_0x1bc8('0x17')](_0x401446)['send'](_0x3e15f7);};}exports[_0x1bc8('0x28')]=function(_0x12f04a,_0x51fba4){var _0x35c7a4={},_0x30dca1={},_0x8e54c8={'count':0x0,'rows':[]};var _0x5e39c5=db[_0x1bc8('0x29')][_0x1bc8('0x2a')];_0x30dca1['model']=_[_0x1bc8('0x2b')](_0x5e39c5);_0x30dca1[_0x1bc8('0x2c')]=_[_0x1bc8('0x2b')](_0x12f04a[_0x1bc8('0x2c')]);_0x30dca1[_0x1bc8('0x2d')]=_['intersection'](_0x30dca1['model'],_0x30dca1[_0x1bc8('0x2c')]);_0x35c7a4[_0x1bc8('0x2e')]=_[_0x1bc8('0x2f')](_0x30dca1[_0x1bc8('0x30')],qs[_0x1bc8('0x31')](_0x12f04a[_0x1bc8('0x2c')][_0x1bc8('0x31')]));_0x35c7a4[_0x1bc8('0x2e')]=_0x35c7a4[_0x1bc8('0x2e')][_0x1bc8('0x32')]?_0x35c7a4[_0x1bc8('0x2e')]:_0x30dca1[_0x1bc8('0x30')];if(!_0x12f04a[_0x1bc8('0x2c')][_0x1bc8('0x33')](_0x1bc8('0x34'))){_0x35c7a4[_0x1bc8('0x1c')]=qs[_0x1bc8('0x1c')](_0x12f04a[_0x1bc8('0x2c')][_0x1bc8('0x1c')]);_0x35c7a4[_0x1bc8('0x1b')]=qs[_0x1bc8('0x1b')](_0x12f04a['query'][_0x1bc8('0x1b')]);}_0x35c7a4['order']=qs[_0x1bc8('0x35')](_0x12f04a[_0x1bc8('0x2c')][_0x1bc8('0x35')]);_0x35c7a4[_0x1bc8('0x36')]=qs[_0x1bc8('0x2d')](_['pick'](_0x12f04a[_0x1bc8('0x2c')],_0x30dca1[_0x1bc8('0x2d')]));if(_0x12f04a[_0x1bc8('0x2c')]['filter']){_0x35c7a4[_0x1bc8('0x36')]=_[_0x1bc8('0x37')](_0x35c7a4[_0x1bc8('0x36')],{'$or':_['map'](_0x5e39c5,function(_0x4cff56){if(_0x4cff56[_0x1bc8('0x38')][_0x1bc8('0x39')]!==_0x1bc8('0x3a')){var _0x5c1ce3={};_0x5c1ce3[_0x4cff56[_0x1bc8('0x3b')]]={'$like':'%'+_0x12f04a[_0x1bc8('0x2c')][_0x1bc8('0x3c')]+'%'};return _0x5c1ce3;}})});}_0x35c7a4=_['merge']({},_0x35c7a4,_0x12f04a[_0x1bc8('0x3d')]);var _0x359046={'where':_0x35c7a4[_0x1bc8('0x36')]};return db[_0x1bc8('0x29')][_0x1bc8('0x1a')](_0x359046)[_0x1bc8('0x23')](function(_0xb332f3){_0x8e54c8[_0x1bc8('0x1a')]=_0xb332f3;if(_0x12f04a['query'][_0x1bc8('0x3e')]){_0x35c7a4[_0x1bc8('0x3f')]=[{'all':!![]}];}return db[_0x1bc8('0x29')][_0x1bc8('0x40')](_0x35c7a4);})[_0x1bc8('0x23')](function(_0x28c798){_0x8e54c8[_0x1bc8('0x41')]=_0x28c798;return _0x8e54c8;})[_0x1bc8('0x23')](respondWithFilteredResult(_0x51fba4,_0x35c7a4))['catch'](handleError(_0x51fba4,null));};exports[_0x1bc8('0x42')]=function(_0x47d17a,_0x5e569c){var _0x25a23f={'raw':!![],'where':{'id':_0x47d17a[_0x1bc8('0x43')]['id']}},_0x5493af={};_0x5493af[_0x1bc8('0x30')]=_[_0x1bc8('0x2b')](db[_0x1bc8('0x29')]['rawAttributes']);_0x5493af[_0x1bc8('0x2c')]=_['keys'](_0x47d17a['query']);_0x5493af['filters']=_[_0x1bc8('0x2f')](_0x5493af[_0x1bc8('0x30')],_0x5493af[_0x1bc8('0x2c')]);_0x25a23f[_0x1bc8('0x2e')]=_['intersection'](_0x5493af[_0x1bc8('0x30')],qs[_0x1bc8('0x31')](_0x47d17a[_0x1bc8('0x2c')][_0x1bc8('0x31')]));_0x25a23f[_0x1bc8('0x2e')]=_0x25a23f[_0x1bc8('0x2e')]['length']?_0x25a23f['attributes']:_0x5493af[_0x1bc8('0x30')];if(_0x47d17a['query'][_0x1bc8('0x3e')]){_0x25a23f[_0x1bc8('0x3f')]=[{'all':!![]}];}_0x25a23f=_[_0x1bc8('0x37')]({},_0x25a23f,_0x47d17a['options']);return db[_0x1bc8('0x29')]['find'](_0x25a23f)['then'](handleEntityNotFound(_0x5e569c,null))['then'](respondWithResult(_0x5e569c,null))[_0x1bc8('0x44')](handleError(_0x5e569c,null));};exports['create']=function(_0xe70a0b,_0x70f9f5){return db[_0x1bc8('0x29')][_0x1bc8('0x45')](_0xe70a0b[_0x1bc8('0x46')],{})[_0x1bc8('0x23')](respondWithResult(_0x70f9f5,0xc9))[_0x1bc8('0x44')](handleError(_0x70f9f5,null));};exports['update']=function(_0x3dcd9d,_0x4640c1){if(_0x3dcd9d[_0x1bc8('0x46')]['id']){delete _0x3dcd9d['body']['id'];}return db['VoiceQueuesLog'][_0x1bc8('0x47')]({'where':{'id':_0x3dcd9d[_0x1bc8('0x43')]['id']}})[_0x1bc8('0x23')](handleEntityNotFound(_0x4640c1,null))[_0x1bc8('0x23')](saveUpdates(_0x3dcd9d[_0x1bc8('0x46')],null))[_0x1bc8('0x23')](respondWithResult(_0x4640c1,null))[_0x1bc8('0x44')](handleError(_0x4640c1,null));};exports[_0x1bc8('0x22')]=function(_0x659959,_0x5f5afe){return db[_0x1bc8('0x29')]['find']({'where':{'id':_0x659959[_0x1bc8('0x43')]['id']}})[_0x1bc8('0x23')](handleEntityNotFound(_0x5f5afe,null))[_0x1bc8('0x23')](removeEntity(_0x5f5afe,null))[_0x1bc8('0x44')](handleError(_0x5f5afe,null));};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js
index 65e6e0a..8a10e89 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.model.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x15fa=['VoiceQueuesLog','event_dtm','dtm','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceQueuesLog.attributes'];(function(_0xfe1c6e,_0x4aeebf){var _0x284e19=function(_0x1993d4){while(--_0x1993d4){_0xfe1c6e['push'](_0xfe1c6e['shift']());}};_0x284e19(++_0x4aeebf);}(_0x15fa,0x1cb));var _0xa15f=function(_0x41584e,_0x489d3c){_0x41584e=_0x41584e-0x0;var _0x456c48=_0x15fa[_0x41584e];return _0x456c48;};'use strict';var _=require(_0xa15f('0x0'));var util=require(_0xa15f('0x1'));var logger=require(_0xa15f('0x2'))(_0xa15f('0x3'));var moment=require(_0xa15f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa15f('0x5'));var rimraf=require(_0xa15f('0x6'));var config=require(_0xa15f('0x7'));var attributes=require(_0xa15f('0x8'));module['exports']=function(_0x5eff86,_0x1dd048){return _0x5eff86['define'](_0xa15f('0x9'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xa15f('0xa'),'fields':['event',_0xa15f('0xb')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xb470=['moment','bluebird','path','rimraf','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','lodash','api'];(function(_0x2b3b07,_0xa237cb){var _0x553ac5=function(_0x3d9297){while(--_0x3d9297){_0x2b3b07['push'](_0x2b3b07['shift']());}};_0x553ac5(++_0xa237cb);}(_0xb470,0xee));var _0x0b47=function(_0x2b436e,_0x380493){_0x2b436e=_0x2b436e-0x0;var _0x4e953b=_0xb470[_0x2b436e];return _0x4e953b;};'use strict';var _=require(_0x0b47('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0b47('0x1'));var moment=require(_0x0b47('0x2'));var BPromise=require(_0x0b47('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b47('0x4'));var rimraf=require(_0x0b47('0x5'));var config=require('../../config/environment');var attributes=require(_0x0b47('0x6'));module['exports']=function(_0xcea248,_0x5f4993){return _0xcea248[_0x0b47('0x7')](_0x0b47('0x8'),attributes,{'tableName':_0x0b47('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','dtm']}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
index fb4745b..7bac773 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd28c=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x17b78c,_0x4a0e12){var _0x3ff573=function(_0x5e133c){while(--_0x5e133c){_0x17b78c['push'](_0x17b78c['shift']());}};_0x3ff573(++_0x4a0e12);}(_0xd28c,0x1c9));var _0xcd28=function(_0xd1f84,_0x1e955a){_0xd1f84=_0xd1f84-0x0;var _0x55651d=_0xd28c[_0xd1f84];return _0x55651d;};'use strict';var _=require(_0xcd28('0x0'));var util=require(_0xcd28('0x1'));var moment=require(_0xcd28('0x2'));var BPromise=require(_0xcd28('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd28('0x4'));var db=require(_0xcd28('0x5'))['db'];var utils=require(_0xcd28('0x6'));var logger=require(_0xcd28('0x7'))(_0xcd28('0x8'));var config=require('../../config/environment');var jayson=require(_0xcd28('0x9'));var client=jayson[_0xcd28('0xa')][_0xcd28('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x559104,_0x4b2431,_0xe46543){return new BPromise(function(_0x35c145,_0x257ef1){return client['request'](_0x559104,_0xe46543)[_0xcd28('0xc')](function(_0x4c9e77){logger[_0xcd28('0xd')](_0xcd28('0xe'),_0x4b2431,'request\x20sent');logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x4b2431,'request\x20sent',JSON[_0xcd28('0xf')](_0x4c9e77));if(_0x4c9e77[_0xcd28('0x10')]){if(_0x4c9e77['error'][_0xcd28('0x11')]===0x1f4){logger[_0xcd28('0x10')](_0xcd28('0xe'),_0x4b2431,_0x4c9e77[_0xcd28('0x10')]['message']);return _0x257ef1(_0x4c9e77[_0xcd28('0x10')][_0xcd28('0x12')]);}logger[_0xcd28('0x10')](_0xcd28('0xe'),_0x4b2431,_0x4c9e77['error'][_0xcd28('0x12')]);return _0x35c145(_0x4c9e77[_0xcd28('0x10')][_0xcd28('0x12')]);}else{logger['info'](_0xcd28('0xe'),_0x4b2431,_0xcd28('0x13'));_0x35c145(_0x4c9e77[_0xcd28('0x14')][_0xcd28('0x12')]);}})[_0xcd28('0x15')](function(_0x1c1f5a){logger[_0xcd28('0x10')](_0xcd28('0xe'),_0x4b2431,_0x1c1f5a);_0x257ef1(_0x1c1f5a);});});}
\ No newline at end of file
+var _0x0cc8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0cc8,0xb4));var _0x80cc=function(_0x2a6754,_0x277259){_0x2a6754=_0x2a6754-0x0;var _0x17feda=_0x0cc8[_0x2a6754];return _0x17feda;};'use strict';var _=require('lodash');var util=require(_0x80cc('0x0'));var moment=require(_0x80cc('0x1'));var BPromise=require(_0x80cc('0x2'));var rs=require(_0x80cc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80cc('0x4'))['db'];var utils=require(_0x80cc('0x5'));var logger=require(_0x80cc('0x6'))(_0x80cc('0x7'));var config=require(_0x80cc('0x8'));var jayson=require(_0x80cc('0x9'));var client=jayson[_0x80cc('0xa')][_0x80cc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c7657,_0x5bbe39,_0x1743d2){return new BPromise(function(_0x4ecc0b,_0x9f2fb){return client[_0x80cc('0xc')](_0x4c7657,_0x1743d2)['then'](function(_0x25f521){logger['info'](_0x80cc('0xd'),_0x5bbe39,_0x80cc('0xe'));logger[_0x80cc('0xf')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5bbe39,_0x80cc('0xe'),JSON[_0x80cc('0x10')](_0x25f521));if(_0x25f521[_0x80cc('0x11')]){if(_0x25f521[_0x80cc('0x11')][_0x80cc('0x12')]===0x1f4){logger[_0x80cc('0x11')](_0x80cc('0xd'),_0x5bbe39,_0x25f521[_0x80cc('0x11')][_0x80cc('0x13')]);return _0x9f2fb(_0x25f521['error']['message']);}logger[_0x80cc('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5bbe39,_0x25f521[_0x80cc('0x11')]['message']);return _0x4ecc0b(_0x25f521['error'][_0x80cc('0x13')]);}else{logger[_0x80cc('0x14')](_0x80cc('0xd'),_0x5bbe39,_0x80cc('0xe'));_0x4ecc0b(_0x25f521[_0x80cc('0x15')]['message']);}})[_0x80cc('0x16')](function(_0x4f24b8){logger[_0x80cc('0x11')](_0x80cc('0xd'),_0x5bbe39,_0x4f24b8);_0x9f2fb(_0x4f24b8);});});}
\ No newline at end of file
diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js
index 33f81c7..25332dc 100644
--- a/server/api/voiceRecording/index.js
+++ b/server/api/voiceRecording/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x780f=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/download','download','/:id/downloads','downloads','create','put','delete','destroy','multer','util'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x780f,0x6c));var _0xf780=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0x780f[_0x4327fe];return _0x138651;};'use strict';var multer=require(_0xf780('0x0'));var util=require(_0xf780('0x1'));var path=require(_0xf780('0x2'));var timeout=require(_0xf780('0x3'));var express=require(_0xf780('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf780('0x5'));var config=require(_0xf780('0x6'));var controller=require(_0xf780('0x7'));router[_0xf780('0x8')]('/',auth['isAuthenticated'](),controller[_0xf780('0x9')]);router['get'](_0xf780('0xa'),auth[_0xf780('0xb')](),controller[_0xf780('0xc')]);router[_0xf780('0x8')](_0xf780('0xd'),auth[_0xf780('0xb')](),controller['show']);router[_0xf780('0x8')](_0xf780('0xe'),auth[_0xf780('0xb')](),controller[_0xf780('0xf')]);router[_0xf780('0x8')](_0xf780('0x10'),controller[_0xf780('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf780('0x12')]);router[_0xf780('0x13')](_0xf780('0xd'),auth[_0xf780('0xb')](),controller['update']);router[_0xf780('0x14')](_0xf780('0xd'),auth[_0xf780('0xb')](),controller[_0xf780('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x6b19=['index','/describe','isAuthenticated','/:id/download','download','/:id/downloads','downloads','create','update','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6b19,0xe8));var _0x96b1=function(_0x3d6a68,_0x2479be){_0x3d6a68=_0x3d6a68-0x0;var _0x45cd5a=_0x6b19[_0x3d6a68];return _0x45cd5a;};'use strict';var multer=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var path=require('path');var timeout=require(_0x96b1('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x96b1('0x3'));var interaction=require(_0x96b1('0x4'));var config=require(_0x96b1('0x5'));var controller=require(_0x96b1('0x6'));router[_0x96b1('0x7')]('/',auth['isAuthenticated'](),controller[_0x96b1('0x8')]);router['get'](_0x96b1('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x96b1('0x7')]('/:id',auth[_0x96b1('0xa')](),controller['show']);router[_0x96b1('0x7')](_0x96b1('0xb'),auth[_0x96b1('0xa')](),controller[_0x96b1('0xc')]);router[_0x96b1('0x7')](_0x96b1('0xd'),controller[_0x96b1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x96b1('0xf')]);router['put']('/:id',auth[_0x96b1('0xa')](),controller[_0x96b1('0x10')]);router[_0x96b1('0x11')]('/:id',auth[_0x96b1('0xa')](),controller[_0x96b1('0x12')]);module[_0x96b1('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js
index d457d53..dfb5ef5 100644
--- a/server/api/voiceRecording/voiceRecording.attributes.js
+++ b/server/api/voiceRecording/voiceRecording.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e36=['DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','updatedAt','toString','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','split','INTEGER'];(function(_0x56e1e8,_0x5b0546){var _0x312201=function(_0x52a3f6){while(--_0x52a3f6){_0x56e1e8['push'](_0x56e1e8['shift']());}};_0x312201(++_0x5b0546);}(_0x4e36,0x138));var _0x64e3=function(_0x178477,_0x1597ea){_0x178477=_0x178477-0x0;var _0x1ddf8a=_0x4e36[_0x178477];return _0x1ddf8a;};'use strict';var Sequelize=require(_0x64e3('0x0'));var moment=require(_0x64e3('0x1'));var path=require(_0x64e3('0x2'));module[_0x64e3('0x3')]={'format':{'type':Sequelize[_0x64e3('0x4')],'get':function(){return this[_0x64e3('0x5')](_0x64e3('0x6'))?path[_0x64e3('0x7')](this[_0x64e3('0x5')](_0x64e3('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0x64e3('0x8')]},'channel':{'type':Sequelize[_0x64e3('0x8')],'set':function(_0x3c4a43){if(_0x3c4a43){this[_0x64e3('0x9')]('channel',_0x3c4a43);this[_0x64e3('0x9')]('membername',_0x3c4a43[_0x64e3('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x64e3('0x8')]},'calleridnum':{'type':Sequelize[_0x64e3('0x8')]},'calleridname':{'type':Sequelize[_0x64e3('0x8')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x64e3('0x8')]},'accountcode':{'type':Sequelize[_0x64e3('0x8')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x64e3('0x8')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x64e3('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x64e3('0x8')]},'userDisposition':{'type':Sequelize[_0x64e3('0x8')]},'createdAt':{'type':Sequelize[_0x64e3('0xc')],'get':function(){return moment(this[_0x64e3('0x5')](_0x64e3('0xd')))[_0x64e3('0xe')](_0x64e3('0xf'))['toString']();}},'updatedAt':{'type':Sequelize[_0x64e3('0xc')],'get':function(){return moment(this['getDataValue'](_0x64e3('0x10')))[_0x64e3('0xe')](_0x64e3('0xf'))[_0x64e3('0x11')]();}}};
\ No newline at end of file
+var _0x6820=['getDataValue','value','STRING','setDataValue','channel','membername','split','INTEGER','DATE','createdAt','format','updatedAt','toString','sequelize','path','exports','VIRTUAL'];(function(_0x289c58,_0x4382aa){var _0x280f15=function(_0x4530ac){while(--_0x4530ac){_0x289c58['push'](_0x289c58['shift']());}};_0x280f15(++_0x4382aa);}(_0x6820,0x1d8));var _0x0682=function(_0x32754f,_0x596a8b){_0x32754f=_0x32754f-0x0;var _0x4aa71d=_0x6820[_0x32754f];return _0x4aa71d;};'use strict';var Sequelize=require(_0x0682('0x0'));var moment=require('moment');var path=require(_0x0682('0x1'));module[_0x0682('0x2')]={'format':{'type':Sequelize[_0x0682('0x3')],'get':function(){return this[_0x0682('0x4')](_0x0682('0x5'))?path['extname'](this[_0x0682('0x4')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0x0682('0x6')]},'channel':{'type':Sequelize[_0x0682('0x6')],'set':function(_0x703b3e){if(_0x703b3e){this[_0x0682('0x7')](_0x0682('0x8'),_0x703b3e);this[_0x0682('0x7')](_0x0682('0x9'),_0x703b3e[_0x0682('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0682('0x6')]},'calleridnum':{'type':Sequelize[_0x0682('0x6')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0682('0x6')]},'connectedlinename':{'type':Sequelize[_0x0682('0x6')]},'accountcode':{'type':Sequelize[_0x0682('0x6')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x0682('0x6')]},'type':{'type':Sequelize[_0x0682('0x6')]},'rating':{'type':Sequelize[_0x0682('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x0682('0x6')]},'userDisposition':{'type':Sequelize[_0x0682('0x6')]},'createdAt':{'type':Sequelize[_0x0682('0xc')],'get':function(){return moment(this[_0x0682('0x4')](_0x0682('0xd')))[_0x0682('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0x0682('0xc')],'get':function(){return moment(this[_0x0682('0x4')](_0x0682('0xf')))[_0x0682('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x0682('0x10')]();}}};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js
index b4874a5..c609761 100644
--- a/server/api/voiceRecording/voiceRecording.controller.js
+++ b/server/api/voiceRecording/voiceRecording.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['pick','filter','merge','map','type','key','field','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','../../components/encryptor','uniqueid','format','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','download','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','token','push','value','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','VoiceRecording','rawAttributes','model','differenceBy','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0xcb91[_0x193e28];return _0x20ef59;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');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('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require(_0x1cb9('0x11'))('api');var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var db=require(_0x1cb9('0x14'))['db'];function respondWithStatusCode(_0x3fdd83,_0x46af58){_0x46af58=_0x46af58||0xcc;return function(_0x5445e1){if(_0x5445e1){return _0x3fdd83['sendStatus'](_0x46af58);}return _0x3fdd83['status'](_0x46af58)[_0x1cb9('0x15')]();};}function respondWithResult(_0x282bc6,_0x384496){_0x384496=_0x384496||0xc8;return function(_0x1c714f){if(_0x1c714f){return _0x282bc6['status'](_0x384496)[_0x1cb9('0x16')](_0x1c714f);}};}function respondWithFilteredResult(_0x6ef389,_0x1b3cd7){return function(_0x8dfa55){if(_0x8dfa55){var _0x3e2d11=_0x8dfa55[_0x1cb9('0x17')],_0x5806d8=_0x1b3cd7[_0x1cb9('0x18')],_0x5572cb=_0x1b3cd7[_0x1cb9('0x18')]+_0x1b3cd7[_0x1cb9('0x19')],_0xd446a3;if(_0x5572cb>=_0x3e2d11){_0x5572cb=_0x3e2d11;_0xd446a3=0xc8;}else{_0xd446a3=0xce;}_0x6ef389[_0x1cb9('0x1a')](_0xd446a3);return _0x6ef389[_0x1cb9('0x1b')]('Content-Range',_0x5806d8+'-'+_0x5572cb+'/'+_0x3e2d11)['json'](_0x8dfa55);}return null;};}function patchUpdates(_0x1b2fa6){return function(_0x41ac41){try{jsonpatch[_0x1cb9('0x1c')](_0x41ac41,_0x1b2fa6,!![]);}catch(_0x31481a){return BPromise[_0x1cb9('0x1d')](_0x31481a);}return _0x41ac41[_0x1cb9('0x1e')]();};}function saveUpdates(_0x24fa1f,_0x4ac422){return function(_0x559bcc){if(_0x559bcc){return _0x559bcc[_0x1cb9('0x1f')](_0x24fa1f)['then'](function(_0x4750b1){return _0x4750b1;});}return null;};}function removeEntity(_0x2265ea,_0x523b26){return function(_0x599275){if(_0x599275){return _0x599275[_0x1cb9('0x20')]()[_0x1cb9('0x21')](function(){_0x2265ea[_0x1cb9('0x1a')](0xcc)[_0x1cb9('0x15')]();});}};}function handleEntityNotFound(_0x45b8d3,_0x27db16){return function(_0x59ebea){if(!_0x59ebea){_0x45b8d3['sendStatus'](0x194);}return _0x59ebea;};}function handleError(_0x6c6f61,_0x557199){_0x557199=_0x557199||0x1f4;return function(_0x10a419){logger[_0x1cb9('0x22')](_0x10a419[_0x1cb9('0x23')]);if(_0x10a419[_0x1cb9('0x24')]){delete _0x10a419[_0x1cb9('0x24')];}_0x6c6f61['status'](_0x557199)[_0x1cb9('0x25')](_0x10a419);};}exports[_0x1cb9('0x26')]=function(_0x4c8d76,_0xd6891c){var _0x21effa={},_0x41a9a0={},_0x1804fd={'count':0x0,'rows':[]};var _0x406821=db[_0x1cb9('0x27')][_0x1cb9('0x28')];_0x41a9a0[_0x1cb9('0x29')]=_[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821),['format']);_0x41a9a0[_0x1cb9('0x2c')]=_['keys'](_0x4c8d76[_0x1cb9('0x2c')]);_0x41a9a0['filters']=_[_0x1cb9('0x2d')](_0x41a9a0[_0x1cb9('0x29')],_0x41a9a0[_0x1cb9('0x2c')]);_0x21effa[_0x1cb9('0x2e')]=_['intersection'](_0x41a9a0[_0x1cb9('0x29')],qs['fields'](_0x4c8d76[_0x1cb9('0x2c')][_0x1cb9('0x2f')]));_0x21effa[_0x1cb9('0x2e')]=_0x21effa['attributes'][_0x1cb9('0x30')]?_0x21effa['attributes']:_0x41a9a0[_0x1cb9('0x29')];if(!_0x4c8d76['query'][_0x1cb9('0x31')](_0x1cb9('0x32'))){_0x21effa[_0x1cb9('0x19')]=qs[_0x1cb9('0x19')](_0x4c8d76['query'][_0x1cb9('0x19')]);_0x21effa[_0x1cb9('0x18')]=qs[_0x1cb9('0x18')](_0x4c8d76[_0x1cb9('0x2c')][_0x1cb9('0x18')]);}_0x21effa[_0x1cb9('0x33')]=qs[_0x1cb9('0x34')](_0x4c8d76[_0x1cb9('0x2c')][_0x1cb9('0x34')]);_0x21effa[_0x1cb9('0x35')]=qs[_0x1cb9('0x36')](_[_0x1cb9('0x37')](_0x4c8d76[_0x1cb9('0x2c')],_0x41a9a0['filters']));if(_0x4c8d76['query'][_0x1cb9('0x38')]){_0x21effa[_0x1cb9('0x35')]=_[_0x1cb9('0x39')](_0x21effa[_0x1cb9('0x35')],{'$or':_[_0x1cb9('0x3a')](_0x406821,function(_0x3a06e6){if(_0x3a06e6[_0x1cb9('0x3b')][_0x1cb9('0x3c')]!=='VIRTUAL'){var _0x2aa59b={};_0x2aa59b[_0x3a06e6[_0x1cb9('0x3d')]]={'$like':'%'+_0x4c8d76[_0x1cb9('0x2c')]['filter']+'%'};return _0x2aa59b;}})});}_0x21effa=_[_0x1cb9('0x39')]({},_0x21effa,_0x4c8d76['options']);var _0x313e34={'where':_0x21effa['where']};return db[_0x1cb9('0x27')][_0x1cb9('0x17')](_0x313e34)[_0x1cb9('0x21')](function(_0x2bcacd){_0x1804fd[_0x1cb9('0x17')]=_0x2bcacd;if(_0x4c8d76[_0x1cb9('0x2c')][_0x1cb9('0x3e')]){_0x21effa['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x1cb9('0x3f')](_0x21effa);})[_0x1cb9('0x21')](function(_0x7a0d8b){_0x1804fd[_0x1cb9('0x40')]=_0x7a0d8b;return _0x1804fd;})[_0x1cb9('0x21')](respondWithFilteredResult(_0xd6891c,_0x21effa))[_0x1cb9('0x41')](handleError(_0xd6891c,null));};exports[_0x1cb9('0x42')]=function(_0x4a670c,_0xbcaa32){var _0x47edad={'raw':![],'where':{'id':_0x4a670c['params']['id']}},_0x576ef2={};_0x576ef2[_0x1cb9('0x29')]=_[_0x1cb9('0x2b')](db[_0x1cb9('0x27')][_0x1cb9('0x28')]);_0x576ef2[_0x1cb9('0x2c')]=_['keys'](_0x4a670c[_0x1cb9('0x2c')]);_0x576ef2['filters']=_[_0x1cb9('0x2d')](_0x576ef2[_0x1cb9('0x29')],_0x576ef2[_0x1cb9('0x2c')]);_0x47edad['attributes']=_[_0x1cb9('0x2d')](_0x576ef2['model'],qs[_0x1cb9('0x2f')](_0x4a670c[_0x1cb9('0x2c')]['fields']));_0x47edad['attributes']=_0x47edad[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x47edad[_0x1cb9('0x2e')]:_0x576ef2[_0x1cb9('0x29')];if(_0x4a670c[_0x1cb9('0x2c')]['includeAll']){_0x47edad[_0x1cb9('0x43')]=[{'all':!![]}];}_0x47edad=_['merge']({},_0x47edad,_0x4a670c['options']);return db['VoiceRecording'][_0x1cb9('0x44')](_0x47edad)[_0x1cb9('0x21')](handleEntityNotFound(_0xbcaa32,null))[_0x1cb9('0x21')](respondWithResult(_0xbcaa32,null))[_0x1cb9('0x41')](handleError(_0xbcaa32,null));};exports[_0x1cb9('0x45')]=function(_0x2a8b7f,_0x40ca68){return db[_0x1cb9('0x27')][_0x1cb9('0x45')](_0x2a8b7f[_0x1cb9('0x46')],{})[_0x1cb9('0x21')](respondWithResult(_0x40ca68,0xc9))['catch'](handleError(_0x40ca68,null));};exports[_0x1cb9('0x1f')]=function(_0x237125,_0xf082dd){if(_0x237125['body']['id']){delete _0x237125[_0x1cb9('0x46')]['id'];}return db[_0x1cb9('0x27')][_0x1cb9('0x44')]({'where':{'id':_0x237125[_0x1cb9('0x47')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0xf082dd,null))['then'](saveUpdates(_0x237125[_0x1cb9('0x46')],null))['then'](respondWithResult(_0xf082dd,null))[_0x1cb9('0x41')](handleError(_0xf082dd,null));};exports['destroy']=function(_0x1cf2ee,_0x3aed49){return db[_0x1cb9('0x27')][_0x1cb9('0x44')]({'where':{'id':_0x1cf2ee['params']['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x3aed49,null))[_0x1cb9('0x21')](removeEntity(_0x3aed49,null))[_0x1cb9('0x41')](handleError(_0x3aed49,null));};exports[_0x1cb9('0x48')]=function(_0x21072f,_0x3e6889){return db[_0x1cb9('0x27')][_0x1cb9('0x48')]()[_0x1cb9('0x21')](respondWithResult(_0x3e6889,null))[_0x1cb9('0x41')](handleError(_0x3e6889,null));};exports['download']=function(_0x5092a6,_0x28c65d,_0x1b3cdf){var _0x19e83a=require(_0x1cb9('0x49'));var _0x20b253=![];var _0x2d076b={};if(_0x5092a6[_0x1cb9('0x2c')][_0x1cb9('0x3b')]&&_0x5092a6[_0x1cb9('0x2c')][_0x1cb9('0x3b')]==='uniqueid'){_0x2d076b[_0x1cb9('0x4a')]=_0x5092a6['params']['id'];}else{_0x2d076b['id']=_0x5092a6[_0x1cb9('0x47')]['id'];}return db['VoiceRecording'][_0x1cb9('0x44')]({'where':_0x2d076b,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x28c65d,null))[_0x1cb9('0x21')](function(_0x3b0c2e){if(_0x3b0c2e){var _0x303da3=_0x3b0c2e['value'];var _0x3c157f=util[_0x1cb9('0x4b')]('%s.cypher',_0x303da3);if(fs['existsSync'](_0x3c157f)){_0x20b253=!![];return _0x19e83a[_0x1cb9('0x4c')](_0x3c157f,_0x303da3,config[_0x1cb9('0x4d')][_0x1cb9('0x4e')])[_0x1cb9('0x21')](function(){return _0x3b0c2e;});}return _0x3b0c2e;}})[_0x1cb9('0x21')](function(_0x310d6d){if(_0x310d6d){var _0x17ce94=_0x310d6d['value'];if(!fs[_0x1cb9('0x4f')](_0x17ce94)){throw new db[(_0x1cb9('0x50'))][(_0x1cb9('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x310d6d[_0x1cb9('0x52')]){return _0x28c65d[_0x1cb9('0x53')](_0x17ce94,_0x310d6d[_0x1cb9('0x52')]+path[_0x1cb9('0x54')](_0x17ce94),function(){if(_0x20b253){fs[_0x1cb9('0x55')](_0x17ce94);}});}else{return _0x28c65d[_0x1cb9('0x53')](_0x17ce94,function(_0x5ae762){if(_0x20b253){fs[_0x1cb9('0x55')](_0x17ce94);}});}}})[_0x1cb9('0x41')](function(_0x41e81f){if(_0x41e81f[_0x1cb9('0x56')]===_0x1cb9('0x57')){_0x28c65d[_0x1cb9('0x1a')](0x194)[_0x1cb9('0x25')](_0x1cb9('0x58'));}else{return handleError(_0x28c65d,null);}});};exports[_0x1cb9('0x59')]=function(_0x3a4cbe,_0x370c97,_0x55fb51){var _0xfc39e1=require(_0x1cb9('0x49'));var _0xebc79f=![];var _0x11fd9a={'$and':[db['sequelize']['where'](db[_0x1cb9('0x5a')]['fn'](_0x1cb9('0x5b'),db[_0x1cb9('0x5a')][_0x1cb9('0x5c')](_0x1cb9('0x4a'))),_0x3a4cbe[_0x1cb9('0x2c')][_0x1cb9('0x5d')])]};if(_0x3a4cbe[_0x1cb9('0x2c')]['type']&&_0x3a4cbe['query'][_0x1cb9('0x3b')]==='uniqueid'){_0x11fd9a['$and']['push']({'uniqueid':_0x3a4cbe['params']['id']});}else{_0x11fd9a['$and'][_0x1cb9('0x5e')]({'id':_0x3a4cbe[_0x1cb9('0x47')]['id']});}return db[_0x1cb9('0x27')][_0x1cb9('0x44')]({'where':_0x11fd9a,'attributes':['id',_0x1cb9('0x5f')],'raw':!![]})[_0x1cb9('0x21')](handleEntityNotFound(_0x370c97,null))['then'](function(_0x27d7ef){if(_0x27d7ef){var _0x3e1207=util['format']('%s.cypher',_0x27d7ef[_0x1cb9('0x5f')]);if(fs[_0x1cb9('0x4f')](_0x3e1207)){_0xebc79f=!![];return _0xfc39e1[_0x1cb9('0x4c')](_0x3e1207,_0x27d7ef[_0x1cb9('0x5f')],config[_0x1cb9('0x4d')]['recording'])['then'](function(){return _0x27d7ef;});}return _0x27d7ef;}})['then'](function(_0x270282){if(_0x270282){if(!fs[_0x1cb9('0x4f')](_0x270282[_0x1cb9('0x5f')])){throw new db[(_0x1cb9('0x50'))][(_0x1cb9('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x270282[_0x1cb9('0x52')]){return _0x370c97[_0x1cb9('0x53')](_0x270282['value'],_0x270282['filename']+path[_0x1cb9('0x54')](_0x270282['value']),function(){if(_0xebc79f){fs[_0x1cb9('0x55')](_0x270282[_0x1cb9('0x5f')]);}});}else{return _0x370c97[_0x1cb9('0x53')](_0x270282[_0x1cb9('0x5f')],function(_0x3619a2){if(_0xebc79f){fs[_0x1cb9('0x55')](_0x270282['value']);}});}}})[_0x1cb9('0x41')](handleError(_0x370c97,null));};
\ No newline at end of file
+var _0x5178=['%s.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','model','differenceBy','keys','format','query','intersection','attributes','fields','length','nolimit','limit','order','where','filters','filter','map','type','VIRTUAL','merge','options','VoiceRecording','includeAll','include','findAll','catch','show','params','find','create','body','describe','uniqueid','value','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','downloads','sequelize','token','$and','push'];(function(_0x2594b5,_0x1f0ec9){var _0x989874=function(_0x2fade4){while(--_0x2fade4){_0x2594b5['push'](_0x2594b5['shift']());}};_0x989874(++_0x1f0ec9);}(_0x5178,0x171));var _0x8517=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5178[_0x6131cd];return _0x47e916;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8517('0x0'));var rimraf=require(_0x8517('0x1'));var zipdir=require(_0x8517('0x2'));var jsonpatch=require(_0x8517('0x3'));var rp=require(_0x8517('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8517('0x5'));var util=require(_0x8517('0x6'));var path=require('path');var sox=require(_0x8517('0x7'));var csv=require('to-csv');var ejs=require(_0x8517('0x8'));var fs=require('fs');var _=require(_0x8517('0x9'));var squel=require(_0x8517('0xa'));var crypto=require(_0x8517('0xb'));var jsforce=require(_0x8517('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8517('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8517('0xe'));var authService=require(_0x8517('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8517('0x10'));var logger=require(_0x8517('0x11'))(_0x8517('0x12'));var utils=require(_0x8517('0x13'));var config=require(_0x8517('0x14'));var db=require(_0x8517('0x15'))['db'];function respondWithStatusCode(_0x2739ff,_0x12388f){_0x12388f=_0x12388f||0xcc;return function(_0x4b9768){if(_0x4b9768){return _0x2739ff[_0x8517('0x16')](_0x12388f);}return _0x2739ff[_0x8517('0x17')](_0x12388f)[_0x8517('0x18')]();};}function respondWithResult(_0x170214,_0x284a05){_0x284a05=_0x284a05||0xc8;return function(_0x49eba7){if(_0x49eba7){return _0x170214[_0x8517('0x17')](_0x284a05)[_0x8517('0x19')](_0x49eba7);}};}function respondWithFilteredResult(_0x126e0b,_0x100280){return function(_0x411d29){if(_0x411d29){var _0x18a984=_0x411d29[_0x8517('0x1a')],_0x260a15=_0x100280[_0x8517('0x1b')],_0x30cea1=_0x100280[_0x8517('0x1b')]+_0x100280['limit'],_0x504a92;if(_0x30cea1>=_0x18a984){_0x30cea1=_0x18a984;_0x504a92=0xc8;}else{_0x504a92=0xce;}_0x126e0b[_0x8517('0x17')](_0x504a92);return _0x126e0b[_0x8517('0x1c')](_0x8517('0x1d'),_0x260a15+'-'+_0x30cea1+'/'+_0x18a984)[_0x8517('0x19')](_0x411d29);}return null;};}function patchUpdates(_0x64875e){return function(_0x24ca7e){try{jsonpatch[_0x8517('0x1e')](_0x24ca7e,_0x64875e,!![]);}catch(_0x5b5408){return BPromise[_0x8517('0x1f')](_0x5b5408);}return _0x24ca7e['save']();};}function saveUpdates(_0x564571,_0x23f7d2){return function(_0x157bea){if(_0x157bea){return _0x157bea[_0x8517('0x20')](_0x564571)[_0x8517('0x21')](function(_0x238d75){return _0x238d75;});}return null;};}function removeEntity(_0xdfde16,_0x512458){return function(_0x4b145f){if(_0x4b145f){return _0x4b145f[_0x8517('0x22')]()[_0x8517('0x21')](function(){_0xdfde16[_0x8517('0x17')](0xcc)[_0x8517('0x18')]();});}};}function handleEntityNotFound(_0x3a5f0b,_0x2e6e47){return function(_0x5f02ee){if(!_0x5f02ee){_0x3a5f0b[_0x8517('0x16')](0x194);}return _0x5f02ee;};}function handleError(_0x7d601b,_0x5578f0){_0x5578f0=_0x5578f0||0x1f4;return function(_0x7f4cf8){logger[_0x8517('0x23')](_0x7f4cf8[_0x8517('0x24')]);if(_0x7f4cf8['name']){delete _0x7f4cf8[_0x8517('0x25')];}_0x7d601b['status'](_0x5578f0)[_0x8517('0x26')](_0x7f4cf8);};}exports[_0x8517('0x27')]=function(_0x448211,_0x2b0c19){var _0x238f2c={},_0x300e3f={},_0x481ceb={'count':0x0,'rows':[]};var _0x39764e=db['VoiceRecording'][_0x8517('0x28')];_0x300e3f[_0x8517('0x29')]=_[_0x8517('0x2a')](_[_0x8517('0x2b')](_0x39764e),[_0x8517('0x2c')]);_0x300e3f[_0x8517('0x2d')]=_['keys'](_0x448211[_0x8517('0x2d')]);_0x300e3f['filters']=_[_0x8517('0x2e')](_0x300e3f[_0x8517('0x29')],_0x300e3f[_0x8517('0x2d')]);_0x238f2c[_0x8517('0x2f')]=_[_0x8517('0x2e')](_0x300e3f[_0x8517('0x29')],qs[_0x8517('0x30')](_0x448211[_0x8517('0x2d')][_0x8517('0x30')]));_0x238f2c['attributes']=_0x238f2c[_0x8517('0x2f')][_0x8517('0x31')]?_0x238f2c[_0x8517('0x2f')]:_0x300e3f['model'];if(!_0x448211['query']['hasOwnProperty'](_0x8517('0x32'))){_0x238f2c[_0x8517('0x33')]=qs[_0x8517('0x33')](_0x448211[_0x8517('0x2d')][_0x8517('0x33')]);_0x238f2c[_0x8517('0x1b')]=qs['offset'](_0x448211[_0x8517('0x2d')][_0x8517('0x1b')]);}_0x238f2c[_0x8517('0x34')]=qs['sort'](_0x448211[_0x8517('0x2d')]['sort']);_0x238f2c[_0x8517('0x35')]=qs[_0x8517('0x36')](_['pick'](_0x448211['query'],_0x300e3f[_0x8517('0x36')]));if(_0x448211[_0x8517('0x2d')][_0x8517('0x37')]){_0x238f2c[_0x8517('0x35')]=_['merge'](_0x238f2c['where'],{'$or':_[_0x8517('0x38')](_0x39764e,function(_0x11a1b3){if(_0x11a1b3[_0x8517('0x39')]['key']!==_0x8517('0x3a')){var _0x10f4c1={};_0x10f4c1[_0x11a1b3['field']]={'$like':'%'+_0x448211[_0x8517('0x2d')][_0x8517('0x37')]+'%'};return _0x10f4c1;}})});}_0x238f2c=_[_0x8517('0x3b')]({},_0x238f2c,_0x448211[_0x8517('0x3c')]);var _0x57ca29={'where':_0x238f2c[_0x8517('0x35')]};return db[_0x8517('0x3d')][_0x8517('0x1a')](_0x57ca29)[_0x8517('0x21')](function(_0x285955){_0x481ceb[_0x8517('0x1a')]=_0x285955;if(_0x448211[_0x8517('0x2d')][_0x8517('0x3e')]){_0x238f2c[_0x8517('0x3f')]=[{'all':!![]}];}return db[_0x8517('0x3d')][_0x8517('0x40')](_0x238f2c);})[_0x8517('0x21')](function(_0x232e49){_0x481ceb['rows']=_0x232e49;return _0x481ceb;})['then'](respondWithFilteredResult(_0x2b0c19,_0x238f2c))[_0x8517('0x41')](handleError(_0x2b0c19,null));};exports[_0x8517('0x42')]=function(_0x4415fc,_0x30942f){var _0x1d1f28={'raw':![],'where':{'id':_0x4415fc[_0x8517('0x43')]['id']}},_0x4ddd77={};_0x4ddd77[_0x8517('0x29')]=_['keys'](db[_0x8517('0x3d')][_0x8517('0x28')]);_0x4ddd77[_0x8517('0x2d')]=_[_0x8517('0x2b')](_0x4415fc['query']);_0x4ddd77[_0x8517('0x36')]=_[_0x8517('0x2e')](_0x4ddd77['model'],_0x4ddd77[_0x8517('0x2d')]);_0x1d1f28[_0x8517('0x2f')]=_[_0x8517('0x2e')](_0x4ddd77['model'],qs[_0x8517('0x30')](_0x4415fc[_0x8517('0x2d')][_0x8517('0x30')]));_0x1d1f28[_0x8517('0x2f')]=_0x1d1f28[_0x8517('0x2f')][_0x8517('0x31')]?_0x1d1f28[_0x8517('0x2f')]:_0x4ddd77['model'];if(_0x4415fc[_0x8517('0x2d')][_0x8517('0x3e')]){_0x1d1f28['include']=[{'all':!![]}];}_0x1d1f28=_[_0x8517('0x3b')]({},_0x1d1f28,_0x4415fc[_0x8517('0x3c')]);return db[_0x8517('0x3d')][_0x8517('0x44')](_0x1d1f28)[_0x8517('0x21')](handleEntityNotFound(_0x30942f,null))[_0x8517('0x21')](respondWithResult(_0x30942f,null))['catch'](handleError(_0x30942f,null));};exports[_0x8517('0x45')]=function(_0x10c07a,_0x3a9778){return db['VoiceRecording'][_0x8517('0x45')](_0x10c07a[_0x8517('0x46')],{})['then'](respondWithResult(_0x3a9778,0xc9))[_0x8517('0x41')](handleError(_0x3a9778,null));};exports[_0x8517('0x20')]=function(_0x4c7815,_0x54b346){if(_0x4c7815['body']['id']){delete _0x4c7815[_0x8517('0x46')]['id'];}return db[_0x8517('0x3d')]['find']({'where':{'id':_0x4c7815[_0x8517('0x43')]['id']}})['then'](handleEntityNotFound(_0x54b346,null))['then'](saveUpdates(_0x4c7815[_0x8517('0x46')],null))[_0x8517('0x21')](respondWithResult(_0x54b346,null))[_0x8517('0x41')](handleError(_0x54b346,null));};exports[_0x8517('0x22')]=function(_0x580af9,_0x282601){return db[_0x8517('0x3d')][_0x8517('0x44')]({'where':{'id':_0x580af9['params']['id']}})[_0x8517('0x21')](handleEntityNotFound(_0x282601,null))[_0x8517('0x21')](removeEntity(_0x282601,null))[_0x8517('0x41')](handleError(_0x282601,null));};exports[_0x8517('0x47')]=function(_0x3f2a31,_0x10841c){return db[_0x8517('0x3d')]['describe']()[_0x8517('0x21')](respondWithResult(_0x10841c,null))['catch'](handleError(_0x10841c,null));};exports['download']=function(_0x2752b6,_0x776ee2,_0x29b5ea){var _0x2d604f=require('../../components/encryptor');var _0x1803d9=![];var _0x2da857={};if(_0x2752b6['query']['type']&&_0x2752b6[_0x8517('0x2d')][_0x8517('0x39')]===_0x8517('0x48')){_0x2da857['uniqueid']=_0x2752b6[_0x8517('0x43')]['id'];}else{_0x2da857['id']=_0x2752b6['params']['id'];}return db[_0x8517('0x3d')][_0x8517('0x44')]({'where':_0x2da857,'attributes':['id',_0x8517('0x49')],'raw':!![]})[_0x8517('0x21')](handleEntityNotFound(_0x776ee2,null))[_0x8517('0x21')](function(_0x126082){if(_0x126082){var _0x1d5be3=_0x126082[_0x8517('0x49')];var _0x23a97f=util['format']('%s.cypher',_0x1d5be3);if(fs[_0x8517('0x4a')](_0x23a97f)){_0x1803d9=!![];return _0x2d604f[_0x8517('0x4b')](_0x23a97f,_0x1d5be3,config[_0x8517('0x4c')]['recording'])[_0x8517('0x21')](function(){return _0x126082;});}return _0x126082;}})[_0x8517('0x21')](function(_0x445f9b){if(_0x445f9b){var _0x4cc9e2=_0x445f9b['value'];if(!fs[_0x8517('0x4a')](_0x4cc9e2)){throw new db[(_0x8517('0x4d'))][(_0x8517('0x4e'))](_0x8517('0x4f'));}if(_0x445f9b[_0x8517('0x50')]){return _0x776ee2[_0x8517('0x51')](_0x4cc9e2,_0x445f9b[_0x8517('0x50')]+path[_0x8517('0x52')](_0x4cc9e2),function(){if(_0x1803d9){fs[_0x8517('0x53')](_0x4cc9e2);}});}else{return _0x776ee2[_0x8517('0x51')](_0x4cc9e2,function(_0x3f6f67){if(_0x1803d9){fs[_0x8517('0x53')](_0x4cc9e2);}});}}})[_0x8517('0x41')](function(_0x20dc60){if(_0x20dc60[_0x8517('0x54')]===_0x8517('0x4f')){_0x776ee2['status'](0x194)[_0x8517('0x26')](_0x8517('0x55'));}else{return handleError(_0x776ee2,null);}});};exports[_0x8517('0x56')]=function(_0x80dd54,_0x1766a0,_0x2ed642){var _0x322682=require('../../components/encryptor');var _0x2e505a=![];var _0x46829c={'$and':[db[_0x8517('0x57')][_0x8517('0x35')](db[_0x8517('0x57')]['fn']('MD5',db[_0x8517('0x57')]['col'](_0x8517('0x48'))),_0x80dd54[_0x8517('0x2d')][_0x8517('0x58')])]};if(_0x80dd54[_0x8517('0x2d')][_0x8517('0x39')]&&_0x80dd54['query'][_0x8517('0x39')]===_0x8517('0x48')){_0x46829c[_0x8517('0x59')][_0x8517('0x5a')]({'uniqueid':_0x80dd54['params']['id']});}else{_0x46829c['$and'][_0x8517('0x5a')]({'id':_0x80dd54['params']['id']});}return db[_0x8517('0x3d')][_0x8517('0x44')]({'where':_0x46829c,'attributes':['id','value'],'raw':!![]})[_0x8517('0x21')](handleEntityNotFound(_0x1766a0,null))[_0x8517('0x21')](function(_0x4a483d){if(_0x4a483d){var _0x2e51ae=util[_0x8517('0x2c')](_0x8517('0x5b'),_0x4a483d[_0x8517('0x49')]);if(fs[_0x8517('0x4a')](_0x2e51ae)){_0x2e505a=!![];return _0x322682[_0x8517('0x4b')](_0x2e51ae,_0x4a483d[_0x8517('0x49')],config[_0x8517('0x4c')]['recording'])[_0x8517('0x21')](function(){return _0x4a483d;});}return _0x4a483d;}})[_0x8517('0x21')](function(_0xe47ad7){if(_0xe47ad7){if(!fs[_0x8517('0x4a')](_0xe47ad7['value'])){throw new db[(_0x8517('0x4d'))]['ValidationError'](_0x8517('0x4f'));}if(_0xe47ad7[_0x8517('0x50')]){return _0x1766a0[_0x8517('0x51')](_0xe47ad7[_0x8517('0x49')],_0xe47ad7['filename']+path['extname'](_0xe47ad7[_0x8517('0x49')]),function(){if(_0x2e505a){fs[_0x8517('0x53')](_0xe47ad7[_0x8517('0x49')]);}});}else{return _0x1766a0[_0x8517('0x51')](_0xe47ad7['value'],function(_0x11a801){if(_0x2e505a){fs[_0x8517('0x53')](_0xe47ad7[_0x8517('0x49')]);}});}}})[_0x8517('0x41')](handleError(_0x1766a0,null));};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js
index 574243a..1ea49ba 100644
--- a/server/api/voiceRecording/voiceRecording.model.js
+++ b/server/api/voiceRecording/voiceRecording.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3939=['request-promise','path','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2fb6a4,_0x8aa23b){var _0x1409a9=function(_0x67cdbd){while(--_0x67cdbd){_0x2fb6a4['push'](_0x2fb6a4['shift']());}};_0x1409a9(++_0x8aa23b);}(_0x3939,0x78));var _0x9393=function(_0x801232,_0x458ec4){_0x801232=_0x801232-0x0;var _0x59f4b5=_0x3939[_0x801232];return _0x59f4b5;};'use strict';var _=require(_0x9393('0x0'));var util=require(_0x9393('0x1'));var logger=require(_0x9393('0x2'))(_0x9393('0x3'));var moment=require(_0x9393('0x4'));var BPromise=require(_0x9393('0x5'));var rp=require(_0x9393('0x6'));var fs=require('fs');var path=require(_0x9393('0x7'));var rimraf=require('rimraf');var config=require(_0x9393('0x8'));var attributes=require(_0x9393('0x9'));module[_0x9393('0xa')]=function(_0x1e3174,_0x403360){return _0x1e3174[_0x9393('0xb')](_0x9393('0xc'),attributes,{'tableName':_0x9393('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8fae=['moment','request-promise','path','rimraf','exports','define','uniqueid','lodash','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8fae,0x15b));var _0xe8fa=function(_0x2e2f0d,_0x49d16c){_0x2e2f0d=_0x2e2f0d-0x0;var _0x5b137a=_0x8fae[_0x2e2f0d];return _0x5b137a;};'use strict';var _=require(_0xe8fa('0x0'));var util=require('util');var logger=require(_0xe8fa('0x1'))(_0xe8fa('0x2'));var moment=require(_0xe8fa('0x3'));var BPromise=require('bluebird');var rp=require(_0xe8fa('0x4'));var fs=require('fs');var path=require(_0xe8fa('0x5'));var rimraf=require(_0xe8fa('0x6'));var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module[_0xe8fa('0x7')]=function(_0x1cbd11,_0xbfe102){return _0x1cbd11[_0xe8fa('0x8')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xe8fa('0x9'),'fields':[_0xe8fa('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js
index 5dc06cf..e2d4245 100644
--- a/server/api/voiceRecording/voiceRecording.rpc.js
+++ b/server/api/voiceRecording/voiceRecording.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5331=['stringify','error','code','message','result','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','attributes','limit','debug','catch','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s'];(function(_0x57b449,_0x2be95c){var _0x2ab683=function(_0x3860ee){while(--_0x3860ee){_0x57b449['push'](_0x57b449['shift']());}};_0x2ab683(++_0x2be95c);}(_0x5331,0xa4));var _0x1533=function(_0x5deee9,_0xf7bae7){_0x5deee9=_0x5deee9-0x0;var _0x1d84e0=_0x5331[_0x5deee9];return _0x1d84e0;};'use strict';var _=require(_0x1533('0x0'));var util=require(_0x1533('0x1'));var moment=require(_0x1533('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1533('0x3'));var db=require(_0x1533('0x4'))['db'];var utils=require(_0x1533('0x5'));var logger=require('../../config/logger')(_0x1533('0x6'));var config=require(_0x1533('0x7'));var jayson=require(_0x1533('0x8'));var client=jayson[_0x1533('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b578e,_0x1b9d6e,_0x3f3ff9){return new BPromise(function(_0x286b7b,_0x43eef3){return client[_0x1533('0xa')](_0x5b578e,_0x3f3ff9)[_0x1533('0xb')](function(_0x3597c2){logger[_0x1533('0xc')](_0x1533('0xd'),_0x1b9d6e,_0x1533('0xe'));logger['debug'](_0x1533('0xf'),_0x1b9d6e,_0x1533('0xe'),JSON[_0x1533('0x10')](_0x3597c2));if(_0x3597c2[_0x1533('0x11')]){if(_0x3597c2[_0x1533('0x11')][_0x1533('0x12')]===0x1f4){logger['error'](_0x1533('0xd'),_0x1b9d6e,_0x3597c2[_0x1533('0x11')]['message']);return _0x43eef3(_0x3597c2[_0x1533('0x11')][_0x1533('0x13')]);}logger[_0x1533('0x11')](_0x1533('0xd'),_0x1b9d6e,_0x3597c2[_0x1533('0x11')]['message']);return _0x286b7b(_0x3597c2[_0x1533('0x11')][_0x1533('0x13')]);}else{logger[_0x1533('0xc')](_0x1533('0xd'),_0x1b9d6e,'request\x20sent');_0x286b7b(_0x3597c2[_0x1533('0x14')][_0x1533('0x13')]);}})['catch'](function(_0x3c30d7){logger['error'](_0x1533('0xd'),_0x1b9d6e,_0x3c30d7);_0x43eef3(_0x3c30d7);});});}exports[_0x1533('0x15')]=function(_0x3aac1d){var _0x4914c1=this;return new Promise(function(_0x158d9c,_0x48d149){return db[_0x1533('0x16')][_0x1533('0x17')](_0x3aac1d[_0x1533('0x18')],{'raw':_0x3aac1d[_0x1533('0x19')]?_0x3aac1d[_0x1533('0x19')][_0x1533('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aac1d[_0x1533('0x19')]?_0x3aac1d['options']['where']||null:null,'attributes':_0x3aac1d[_0x1533('0x19')]?_0x3aac1d[_0x1533('0x19')][_0x1533('0x1b')]||null:null,'limit':_0x3aac1d[_0x1533('0x19')]?_0x3aac1d['options'][_0x1533('0x1c')]||null:null})[_0x1533('0xb')](function(_0x44cddd){logger['info'](_0x1533('0x15'),_0x3aac1d);logger[_0x1533('0x1d')](_0x1533('0x15'),_0x3aac1d,JSON['stringify'](_0x44cddd));_0x158d9c(_0x44cddd);})[_0x1533('0x1e')](function(_0x548d5b){logger['error'](_0x1533('0x15'),_0x548d5b[_0x1533('0x13')],_0x3aac1d);_0x48d149(_0x4914c1['error'](0x1f4,_0x548d5b['message']));});});};exports[_0x1533('0x1f')]=function(_0x270172){var _0xc7f328=this;return new Promise(function(_0x42c28c,_0x12abc9){var _0x2bcb6e=require('../../components/encryptor');var _0x1ccb9d;return db[_0x1533('0x20')][_0x1533('0x21')]({'attributes':['id',_0x1533('0x22')],'where':{'id':0x1},'raw':!![]})[_0x1533('0xb')](function(_0x221fb1){_0x1ccb9d=_0x221fb1;return db['VoiceRecording'][_0x1533('0x23')](_0x270172[_0x1533('0x18')]);})['then'](function(_0x387631){if(_0x1ccb9d['callRecordingEncryption']&&fs[_0x1533('0x24')](_0x387631[_0x1533('0x25')])){var _0x193a2a=util[_0x1533('0x26')](_0x1533('0x27'),_0x387631[_0x1533('0x25')]);return _0x2bcb6e[_0x1533('0x28')](_0x387631['value'],_0x193a2a,config[_0x1533('0x29')][_0x1533('0x2a')])[_0x1533('0xb')](function(){fs[_0x1533('0x2b')](_0x387631[_0x1533('0x25')]);logger[_0x1533('0xc')](_0x1533('0x2c'));return _0x387631;});}return _0x387631;})[_0x1533('0xb')](function(_0x3ed06d){logger['info'](_0x1533('0x1f'),_0x270172);logger[_0x1533('0x1d')](_0x1533('0x1f'),_0x270172,JSON[_0x1533('0x10')](_0x3ed06d));_0x42c28c(_0x3ed06d);})[_0x1533('0x1e')](function(_0x3c891c){logger['error'](_0x1533('0x1f'),_0x3c891c[_0x1533('0x13')],_0x270172);_0x12abc9(_0xc7f328[_0x1533('0x11')](0x1f4,_0x3c891c['message']));});});};
\ No newline at end of file
+var _0x8d01=['unlink','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceRecording','update','body','raw','options','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording'];(function(_0x427e12,_0x1d1d0c){var _0x56ac01=function(_0x2cad49){while(--_0x2cad49){_0x427e12['push'](_0x427e12['shift']());}};_0x56ac01(++_0x1d1d0c);}(_0x8d01,0x127));var _0x18d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d01[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x18d0('0x0'));var util=require(_0x18d0('0x1'));var moment=require(_0x18d0('0x2'));var BPromise=require(_0x18d0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x18d0('0x4'));var db=require(_0x18d0('0x5'))['db'];var utils=require(_0x18d0('0x6'));var logger=require(_0x18d0('0x7'))(_0x18d0('0x8'));var config=require(_0x18d0('0x9'));var jayson=require(_0x18d0('0xa'));var client=jayson[_0x18d0('0xb')][_0x18d0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xeee448,_0x18b75e,_0x53c1e6){return new BPromise(function(_0x5cb6f1,_0x4123fa){return client[_0x18d0('0xd')](_0xeee448,_0x53c1e6)[_0x18d0('0xe')](function(_0x598986){logger[_0x18d0('0xf')](_0x18d0('0x10'),_0x18b75e,_0x18d0('0x11'));logger[_0x18d0('0x12')](_0x18d0('0x13'),_0x18b75e,_0x18d0('0x11'),JSON[_0x18d0('0x14')](_0x598986));if(_0x598986[_0x18d0('0x15')]){if(_0x598986[_0x18d0('0x15')][_0x18d0('0x16')]===0x1f4){logger['error'](_0x18d0('0x10'),_0x18b75e,_0x598986['error'][_0x18d0('0x17')]);return _0x4123fa(_0x598986[_0x18d0('0x15')][_0x18d0('0x17')]);}logger['error'](_0x18d0('0x10'),_0x18b75e,_0x598986[_0x18d0('0x15')][_0x18d0('0x17')]);return _0x5cb6f1(_0x598986[_0x18d0('0x15')][_0x18d0('0x17')]);}else{logger[_0x18d0('0xf')](_0x18d0('0x10'),_0x18b75e,_0x18d0('0x11'));_0x5cb6f1(_0x598986[_0x18d0('0x18')]['message']);}})[_0x18d0('0x19')](function(_0x4b0a37){logger[_0x18d0('0x15')](_0x18d0('0x10'),_0x18b75e,_0x4b0a37);_0x4123fa(_0x4b0a37);});});}exports['UpdateVoiceRecording']=function(_0x3768f9){var _0x2c06b6=this;return new Promise(function(_0x3803e6,_0x4d227e){return db[_0x18d0('0x1a')][_0x18d0('0x1b')](_0x3768f9[_0x18d0('0x1c')],{'raw':_0x3768f9['options']?_0x3768f9['options'][_0x18d0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3768f9[_0x18d0('0x1e')]?_0x3768f9[_0x18d0('0x1e')][_0x18d0('0x1f')]||null:null,'attributes':_0x3768f9['options']?_0x3768f9['options'][_0x18d0('0x20')]||null:null,'limit':_0x3768f9[_0x18d0('0x1e')]?_0x3768f9[_0x18d0('0x1e')][_0x18d0('0x21')]||null:null})[_0x18d0('0xe')](function(_0x2ff3a1){logger[_0x18d0('0xf')](_0x18d0('0x22'),_0x3768f9);logger[_0x18d0('0x12')](_0x18d0('0x22'),_0x3768f9,JSON[_0x18d0('0x14')](_0x2ff3a1));_0x3803e6(_0x2ff3a1);})[_0x18d0('0x19')](function(_0x580445){logger[_0x18d0('0x15')](_0x18d0('0x22'),_0x580445['message'],_0x3768f9);_0x4d227e(_0x2c06b6[_0x18d0('0x15')](0x1f4,_0x580445[_0x18d0('0x17')]));});});};exports[_0x18d0('0x23')]=function(_0x41ebb9){var _0x3ac3a1=this;return new Promise(function(_0x4321fa,_0x500c1d){var _0xab76a3=require(_0x18d0('0x24'));var _0x3b3fab;return db[_0x18d0('0x25')][_0x18d0('0x26')]({'attributes':['id',_0x18d0('0x27')],'where':{'id':0x1},'raw':!![]})[_0x18d0('0xe')](function(_0x5020bd){_0x3b3fab=_0x5020bd;return db['VoiceRecording'][_0x18d0('0x28')](_0x41ebb9[_0x18d0('0x1c')]);})[_0x18d0('0xe')](function(_0x1cbc55){if(_0x3b3fab[_0x18d0('0x27')]&&fs[_0x18d0('0x29')](_0x1cbc55[_0x18d0('0x2a')])){var _0x483f7e=util[_0x18d0('0x2b')](_0x18d0('0x2c'),_0x1cbc55[_0x18d0('0x2a')]);return _0xab76a3[_0x18d0('0x2d')](_0x1cbc55['value'],_0x483f7e,config[_0x18d0('0x2e')][_0x18d0('0x2f')])[_0x18d0('0xe')](function(){fs[_0x18d0('0x30')](_0x1cbc55[_0x18d0('0x2a')]);logger[_0x18d0('0xf')]('CreateVoiceRecording\x20file\x20encrypted');return _0x1cbc55;});}return _0x1cbc55;})[_0x18d0('0xe')](function(_0x57264e){logger[_0x18d0('0xf')](_0x18d0('0x23'),_0x41ebb9);logger[_0x18d0('0x12')]('CreateVoiceRecording',_0x41ebb9,JSON[_0x18d0('0x14')](_0x57264e));_0x4321fa(_0x57264e);})[_0x18d0('0x19')](function(_0x88c3f9){logger[_0x18d0('0x15')](_0x18d0('0x23'),_0x88c3f9['message'],_0x41ebb9);_0x500c1d(_0x3ac3a1[_0x18d0('0x15')](0x1f4,_0x88c3f9[_0x18d0('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js
index 3cfc55b..66a1970 100644
--- a/server/api/voiceTransferReport/index.js
+++ b/server/api/voiceTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3003=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','exports'];(function(_0x2df537,_0x1359a8){var _0x288850=function(_0x2468a1){while(--_0x2468a1){_0x2df537['push'](_0x2df537['shift']());}};_0x288850(++_0x1359a8);}(_0x3003,0x144));var _0x3300=function(_0x3e6dad,_0x17da5a){_0x3e6dad=_0x3e6dad-0x0;var _0x4999e7=_0x3003[_0x3e6dad];return _0x4999e7;};'use strict';var multer=require(_0x3300('0x0'));var util=require(_0x3300('0x1'));var path=require(_0x3300('0x2'));var timeout=require(_0x3300('0x3'));var express=require(_0x3300('0x4'));var router=express['Router']();var auth=require(_0x3300('0x5'));var interaction=require(_0x3300('0x6'));var config=require(_0x3300('0x7'));var controller=require(_0x3300('0x8'));router[_0x3300('0x9')]('/',auth[_0x3300('0xa')](),controller[_0x3300('0xb')]);router[_0x3300('0x9')](_0x3300('0xc'),auth[_0x3300('0xa')](),controller['show']);router[_0x3300('0xd')]('/',auth[_0x3300('0xa')](),controller[_0x3300('0xe')]);router[_0x3300('0xf')]('/:id',auth[_0x3300('0xa')](),controller['update']);router['delete']('/:id',auth[_0x3300('0xa')](),controller[_0x3300('0x10')]);module[_0x3300('0x11')]=router;
\ No newline at end of file
+var _0x20c4=['./voiceTransferReport.controller','get','isAuthenticated','show','post','create','put','/:id','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x60db2a,_0x2b3e23){var _0x30a984=function(_0x23b12d){while(--_0x23b12d){_0x60db2a['push'](_0x60db2a['shift']());}};_0x30a984(++_0x2b3e23);}(_0x20c4,0x184));var _0x420c=function(_0x141ef3,_0xef3f89){_0x141ef3=_0x141ef3-0x0;var _0x34de08=_0x20c4[_0x141ef3];return _0x34de08;};'use strict';var multer=require(_0x420c('0x0'));var util=require(_0x420c('0x1'));var path=require(_0x420c('0x2'));var timeout=require('connect-timeout');var express=require(_0x420c('0x3'));var router=express[_0x420c('0x4')]();var auth=require(_0x420c('0x5'));var interaction=require(_0x420c('0x6'));var config=require(_0x420c('0x7'));var controller=require(_0x420c('0x8'));router[_0x420c('0x9')]('/',auth[_0x420c('0xa')](),controller['index']);router[_0x420c('0x9')]('/:id',auth[_0x420c('0xa')](),controller[_0x420c('0xb')]);router[_0x420c('0xc')]('/',auth[_0x420c('0xa')](),controller[_0x420c('0xd')]);router[_0x420c('0xe')](_0x420c('0xf'),auth[_0x420c('0xa')](),controller[_0x420c('0x10')]);router['delete']('/:id',auth[_0x420c('0xa')](),controller['destroy']);module[_0x420c('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js
index c8baa45..ad77668 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.attributes.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x98bb=['Yes','sequelize','moment','exports','attended','STRING','ENUM'];(function(_0x4ffa03,_0x363a82){var _0x30d661=function(_0x36ba86){while(--_0x36ba86){_0x4ffa03['push'](_0x4ffa03['shift']());}};_0x30d661(++_0x363a82);}(_0x98bb,0xe8));var _0xb98b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x98bb[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xb98b('0x0'));var moment=require(_0xb98b('0x1'));module[_0xb98b('0x2')]={'type':{'type':Sequelize['ENUM']('blind',_0xb98b('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xb98b('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xb98b('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb98b('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xb98b('0x4')]},'transferercontext':{'type':Sequelize[_0xb98b('0x4')]},'transfererexten':{'type':Sequelize[_0xb98b('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xb98b('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xb98b('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xb98b('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xb98b('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xb98b('0x4')]},'transfereecontext':{'type':Sequelize[_0xb98b('0x4')]},'transfereeexten':{'type':Sequelize[_0xb98b('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xb98b('0x4')]},'isexternal':{'type':Sequelize[_0xb98b('0x5')](_0xb98b('0x6'),'No')},'context':{'type':Sequelize[_0xb98b('0x4')]},'extension':{'type':Sequelize[_0xb98b('0x4')]}};
\ No newline at end of file
+var _0x539c=['moment','exports','attended','STRING','ENUM','Yes','sequelize'];(function(_0x236151,_0x21be25){var _0x41aaf0=function(_0x10b4ac){while(--_0x10b4ac){_0x236151['push'](_0x236151['shift']());}};_0x41aaf0(++_0x21be25);}(_0x539c,0x1a3));var _0xc539=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x539c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc539('0x0'));var moment=require(_0xc539('0x1'));module[_0xc539('0x2')]={'type':{'type':Sequelize['ENUM']('blind',_0xc539('0x3'))},'result':{'type':Sequelize[_0xc539('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xc539('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xc539('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xc539('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xc539('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xc539('0x4')]},'transfereechannel':{'type':Sequelize[_0xc539('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xc539('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xc539('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xc539('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xc539('0x4')]},'transfereecontext':{'type':Sequelize[_0xc539('0x4')]},'transfereeexten':{'type':Sequelize[_0xc539('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xc539('0x4')]},'isexternal':{'type':Sequelize[_0xc539('0x5')](_0xc539('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xc539('0x4')]}};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js
index 4a2285c..7bc123f 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.controller.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x83ac=['rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','options','count','findAll','rows','catch','includeAll','include','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','VoiceTransferReport'];(function(_0x5ac8bc,_0xd6a1ff){var _0x44227a=function(_0x551e15){while(--_0x551e15){_0x5ac8bc['push'](_0x5ac8bc['shift']());}};_0x44227a(++_0xd6a1ff);}(_0x83ac,0x66));var _0xc83a=function(_0x5b745e,_0x504ae2){_0x5b745e=_0x5b745e-0x0;var _0x49d6df=_0x83ac[_0x5b745e];return _0x49d6df;};'use strict';var pdf=require(_0xc83a('0x0'));var emlformat=require(_0xc83a('0x1'));var rimraf=require(_0xc83a('0x2'));var zipdir=require(_0xc83a('0x3'));var jsonpatch=require(_0xc83a('0x4'));var rp=require('request-promise');var moment=require(_0xc83a('0x5'));var BPromise=require(_0xc83a('0x6'));var Mustache=require(_0xc83a('0x7'));var util=require('util');var path=require(_0xc83a('0x8'));var sox=require(_0xc83a('0x9'));var csv=require(_0xc83a('0xa'));var ejs=require(_0xc83a('0xb'));var fs=require('fs');var _=require(_0xc83a('0xc'));var squel=require(_0xc83a('0xd'));var crypto=require('crypto');var jsforce=require(_0xc83a('0xe'));var deskjs=require(_0xc83a('0xf'));var toCsv=require(_0xc83a('0xa'));var querystring=require(_0xc83a('0x10'));var Papa=require(_0xc83a('0x11'));var Redis=require(_0xc83a('0x12'));var authService=require(_0xc83a('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc83a('0x14'))(_0xc83a('0x15'));var utils=require(_0xc83a('0x16'));var config=require('../../config/environment');var db=require(_0xc83a('0x17'))['db'];function respondWithStatusCode(_0x592123,_0x12b74d){_0x12b74d=_0x12b74d||0xcc;return function(_0x1d74ff){if(_0x1d74ff){return _0x592123[_0xc83a('0x18')](_0x12b74d);}return _0x592123['status'](_0x12b74d)[_0xc83a('0x19')]();};}function respondWithResult(_0x5a89ce,_0x1a01cc){_0x1a01cc=_0x1a01cc||0xc8;return function(_0x5d52d8){if(_0x5d52d8){return _0x5a89ce[_0xc83a('0x1a')](_0x1a01cc)[_0xc83a('0x1b')](_0x5d52d8);}};}function respondWithFilteredResult(_0x4b247a,_0x5b2bc4){return function(_0xc8f8db){if(_0xc8f8db){var _0x4750c8=_0xc8f8db['count'],_0x5f1532=_0x5b2bc4[_0xc83a('0x1c')],_0x1cdbb2=_0x5b2bc4['offset']+_0x5b2bc4[_0xc83a('0x1d')],_0x3fb4da;if(_0x1cdbb2>=_0x4750c8){_0x1cdbb2=_0x4750c8;_0x3fb4da=0xc8;}else{_0x3fb4da=0xce;}_0x4b247a['status'](_0x3fb4da);return _0x4b247a[_0xc83a('0x1e')](_0xc83a('0x1f'),_0x5f1532+'-'+_0x1cdbb2+'/'+_0x4750c8)['json'](_0xc8f8db);}return null;};}function patchUpdates(_0x5bd036){return function(_0x511841){try{jsonpatch['apply'](_0x511841,_0x5bd036,!![]);}catch(_0x290dea){return BPromise[_0xc83a('0x20')](_0x290dea);}return _0x511841[_0xc83a('0x21')]();};}function saveUpdates(_0xe5a5fb,_0xbf9f6b){return function(_0x58c8f6){if(_0x58c8f6){return _0x58c8f6[_0xc83a('0x22')](_0xe5a5fb)[_0xc83a('0x23')](function(_0x357e96){return _0x357e96;});}return null;};}function removeEntity(_0x2393de,_0x1def84){return function(_0x435d85){if(_0x435d85){return _0x435d85[_0xc83a('0x24')]()['then'](function(){_0x2393de[_0xc83a('0x1a')](0xcc)[_0xc83a('0x19')]();});}};}function handleEntityNotFound(_0x2c330c,_0x23ded4){return function(_0x45d0fd){if(!_0x45d0fd){_0x2c330c['sendStatus'](0x194);}return _0x45d0fd;};}function handleError(_0x3d991a,_0x425b94){_0x425b94=_0x425b94||0x1f4;return function(_0xb34e45){logger[_0xc83a('0x25')](_0xb34e45['stack']);if(_0xb34e45[_0xc83a('0x26')]){delete _0xb34e45['name'];}_0x3d991a[_0xc83a('0x1a')](_0x425b94)[_0xc83a('0x27')](_0xb34e45);};}exports[_0xc83a('0x28')]=function(_0x18d613,_0x5a0e4f){var _0x27f364={},_0x172634={},_0x632e24={'count':0x0,'rows':[]};var _0xb2c2cc=db[_0xc83a('0x29')][_0xc83a('0x2a')];_0x172634['model']=_[_0xc83a('0x2b')](_0xb2c2cc);_0x172634[_0xc83a('0x2c')]=_[_0xc83a('0x2b')](_0x18d613[_0xc83a('0x2c')]);_0x172634[_0xc83a('0x2d')]=_[_0xc83a('0x2e')](_0x172634[_0xc83a('0x2f')],_0x172634[_0xc83a('0x2c')]);_0x27f364[_0xc83a('0x30')]=_[_0xc83a('0x2e')](_0x172634['model'],qs[_0xc83a('0x31')](_0x18d613[_0xc83a('0x2c')][_0xc83a('0x31')]));_0x27f364[_0xc83a('0x30')]=_0x27f364[_0xc83a('0x30')][_0xc83a('0x32')]?_0x27f364[_0xc83a('0x30')]:_0x172634['model'];if(!_0x18d613[_0xc83a('0x2c')][_0xc83a('0x33')](_0xc83a('0x34'))){_0x27f364[_0xc83a('0x1d')]=qs['limit'](_0x18d613[_0xc83a('0x2c')]['limit']);_0x27f364[_0xc83a('0x1c')]=qs[_0xc83a('0x1c')](_0x18d613[_0xc83a('0x2c')]['offset']);}_0x27f364[_0xc83a('0x35')]=qs[_0xc83a('0x36')](_0x18d613[_0xc83a('0x2c')][_0xc83a('0x36')]);_0x27f364[_0xc83a('0x37')]=qs[_0xc83a('0x2d')](_['pick'](_0x18d613['query'],_0x172634['filters']));if(_0x18d613[_0xc83a('0x2c')][_0xc83a('0x38')]){_0x27f364[_0xc83a('0x37')]=_['merge'](_0x27f364[_0xc83a('0x37')],{'$or':_[_0xc83a('0x39')](_0xb2c2cc,function(_0x5beb89){if(_0x5beb89[_0xc83a('0x3a')][_0xc83a('0x3b')]!==_0xc83a('0x3c')){var _0x1966a3={};_0x1966a3[_0x5beb89['field']]={'$like':'%'+_0x18d613[_0xc83a('0x2c')][_0xc83a('0x38')]+'%'};return _0x1966a3;}})});}_0x27f364=_['merge']({},_0x27f364,_0x18d613[_0xc83a('0x3d')]);var _0x316cf7={'where':_0x27f364['where']};return db[_0xc83a('0x29')]['count'](_0x316cf7)['then'](function(_0x1a0b74){_0x632e24[_0xc83a('0x3e')]=_0x1a0b74;if(_0x18d613[_0xc83a('0x2c')]['includeAll']){_0x27f364['include']=[{'all':!![]}];}return db['VoiceTransferReport'][_0xc83a('0x3f')](_0x27f364);})[_0xc83a('0x23')](function(_0x3c07a6){_0x632e24[_0xc83a('0x40')]=_0x3c07a6;return _0x632e24;})[_0xc83a('0x23')](respondWithFilteredResult(_0x5a0e4f,_0x27f364))[_0xc83a('0x41')](handleError(_0x5a0e4f,null));};exports['show']=function(_0x181d7c,_0x4e4bcf){var _0x147b61={'raw':!![],'where':{'id':_0x181d7c['params']['id']}},_0x362c5b={};_0x362c5b[_0xc83a('0x2f')]=_['keys'](db[_0xc83a('0x29')]['rawAttributes']);_0x362c5b[_0xc83a('0x2c')]=_[_0xc83a('0x2b')](_0x181d7c['query']);_0x362c5b[_0xc83a('0x2d')]=_[_0xc83a('0x2e')](_0x362c5b[_0xc83a('0x2f')],_0x362c5b[_0xc83a('0x2c')]);_0x147b61['attributes']=_[_0xc83a('0x2e')](_0x362c5b[_0xc83a('0x2f')],qs[_0xc83a('0x31')](_0x181d7c[_0xc83a('0x2c')][_0xc83a('0x31')]));_0x147b61[_0xc83a('0x30')]=_0x147b61[_0xc83a('0x30')][_0xc83a('0x32')]?_0x147b61[_0xc83a('0x30')]:_0x362c5b[_0xc83a('0x2f')];if(_0x181d7c[_0xc83a('0x2c')][_0xc83a('0x42')]){_0x147b61[_0xc83a('0x43')]=[{'all':!![]}];}_0x147b61=_['merge']({},_0x147b61,_0x181d7c[_0xc83a('0x3d')]);return db['VoiceTransferReport']['find'](_0x147b61)[_0xc83a('0x23')](handleEntityNotFound(_0x4e4bcf,null))[_0xc83a('0x23')](respondWithResult(_0x4e4bcf,null))[_0xc83a('0x41')](handleError(_0x4e4bcf,null));};exports[_0xc83a('0x44')]=function(_0x13fd0d,_0x4d94b7){return db[_0xc83a('0x29')][_0xc83a('0x44')](_0x13fd0d[_0xc83a('0x45')],{})[_0xc83a('0x23')](respondWithResult(_0x4d94b7,0xc9))[_0xc83a('0x41')](handleError(_0x4d94b7,null));};exports[_0xc83a('0x22')]=function(_0x40de84,_0x106ad4){if(_0x40de84[_0xc83a('0x45')]['id']){delete _0x40de84[_0xc83a('0x45')]['id'];}return db[_0xc83a('0x29')][_0xc83a('0x46')]({'where':{'id':_0x40de84[_0xc83a('0x47')]['id']}})[_0xc83a('0x23')](handleEntityNotFound(_0x106ad4,null))[_0xc83a('0x23')](saveUpdates(_0x40de84[_0xc83a('0x45')],null))[_0xc83a('0x23')](respondWithResult(_0x106ad4,null))[_0xc83a('0x41')](handleError(_0x106ad4,null));};exports['destroy']=function(_0x5e9fe6,_0x378755){return db[_0xc83a('0x29')][_0xc83a('0x46')]({'where':{'id':_0x5e9fe6[_0xc83a('0x47')]['id']}})[_0xc83a('0x23')](handleEntityNotFound(_0x378755,null))[_0xc83a('0x23')](removeEntity(_0x378755,null))[_0xc83a('0x41')](handleError(_0x378755,null));};
\ No newline at end of file
+var _0x4358=['save','update','then','destroy','sendStatus','error','name','send','VoiceTransferReport','rawAttributes','keys','model','attributes','intersection','fields','length','query','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','count','include','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','reject'];(function(_0x100eb7,_0x510fb1){var _0x890f9c=function(_0x2da23b){while(--_0x2da23b){_0x100eb7['push'](_0x100eb7['shift']());}};_0x890f9c(++_0x510fb1);}(_0x4358,0x18c));var _0x8435=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0x4358[_0x5180c3];return _0x55c975;};'use strict';var pdf=require(_0x8435('0x0'));var emlformat=require(_0x8435('0x1'));var rimraf=require(_0x8435('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8435('0x3'));var rp=require(_0x8435('0x4'));var moment=require(_0x8435('0x5'));var BPromise=require(_0x8435('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8435('0x7'));var sox=require(_0x8435('0x8'));var csv=require(_0x8435('0x9'));var ejs=require(_0x8435('0xa'));var fs=require('fs');var _=require(_0x8435('0xb'));var squel=require('squel');var crypto=require(_0x8435('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8435('0xd'));var toCsv=require(_0x8435('0x9'));var querystring=require(_0x8435('0xe'));var Papa=require(_0x8435('0xf'));var Redis=require(_0x8435('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8435('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8435('0x12'))('api');var utils=require(_0x8435('0x13'));var config=require(_0x8435('0x14'));var db=require(_0x8435('0x15'))['db'];function respondWithStatusCode(_0x3a8326,_0x3985c0){_0x3985c0=_0x3985c0||0xcc;return function(_0x349ad7){if(_0x349ad7){return _0x3a8326['sendStatus'](_0x3985c0);}return _0x3a8326[_0x8435('0x16')](_0x3985c0)[_0x8435('0x17')]();};}function respondWithResult(_0x198183,_0x4c7998){_0x4c7998=_0x4c7998||0xc8;return function(_0x98ef8e){if(_0x98ef8e){return _0x198183['status'](_0x4c7998)[_0x8435('0x18')](_0x98ef8e);}};}function respondWithFilteredResult(_0xed1743,_0x11d926){return function(_0x121763){if(_0x121763){var _0x4f0dbf=_0x121763['count'],_0x12ab8c=_0x11d926[_0x8435('0x19')],_0x3a47a0=_0x11d926[_0x8435('0x19')]+_0x11d926[_0x8435('0x1a')],_0x57abf2;if(_0x3a47a0>=_0x4f0dbf){_0x3a47a0=_0x4f0dbf;_0x57abf2=0xc8;}else{_0x57abf2=0xce;}_0xed1743[_0x8435('0x16')](_0x57abf2);return _0xed1743[_0x8435('0x1b')](_0x8435('0x1c'),_0x12ab8c+'-'+_0x3a47a0+'/'+_0x4f0dbf)[_0x8435('0x18')](_0x121763);}return null;};}function patchUpdates(_0x1a1144){return function(_0x36f2c4){try{jsonpatch['apply'](_0x36f2c4,_0x1a1144,!![]);}catch(_0x36a68e){return BPromise[_0x8435('0x1d')](_0x36a68e);}return _0x36f2c4[_0x8435('0x1e')]();};}function saveUpdates(_0x154d72,_0x2d94eb){return function(_0x568f18){if(_0x568f18){return _0x568f18[_0x8435('0x1f')](_0x154d72)[_0x8435('0x20')](function(_0x46508b){return _0x46508b;});}return null;};}function removeEntity(_0x2aa1cc,_0x3f08db){return function(_0x47c0cd){if(_0x47c0cd){return _0x47c0cd[_0x8435('0x21')]()[_0x8435('0x20')](function(){_0x2aa1cc[_0x8435('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1310bd,_0xba29b8){return function(_0x48843a){if(!_0x48843a){_0x1310bd[_0x8435('0x22')](0x194);}return _0x48843a;};}function handleError(_0x1fc55b,_0xd06e7){_0xd06e7=_0xd06e7||0x1f4;return function(_0x2af44b){logger[_0x8435('0x23')](_0x2af44b['stack']);if(_0x2af44b[_0x8435('0x24')]){delete _0x2af44b[_0x8435('0x24')];}_0x1fc55b[_0x8435('0x16')](_0xd06e7)[_0x8435('0x25')](_0x2af44b);};}exports['index']=function(_0x10555a,_0x4bed4d){var _0x5947d8={},_0x55fd2f={},_0x46a18b={'count':0x0,'rows':[]};var _0x1c5f8d=db[_0x8435('0x26')][_0x8435('0x27')];_0x55fd2f['model']=_['keys'](_0x1c5f8d);_0x55fd2f['query']=_[_0x8435('0x28')](_0x10555a['query']);_0x55fd2f['filters']=_['intersection'](_0x55fd2f[_0x8435('0x29')],_0x55fd2f['query']);_0x5947d8[_0x8435('0x2a')]=_[_0x8435('0x2b')](_0x55fd2f[_0x8435('0x29')],qs['fields'](_0x10555a['query'][_0x8435('0x2c')]));_0x5947d8['attributes']=_0x5947d8['attributes'][_0x8435('0x2d')]?_0x5947d8[_0x8435('0x2a')]:_0x55fd2f['model'];if(!_0x10555a[_0x8435('0x2e')][_0x8435('0x2f')](_0x8435('0x30'))){_0x5947d8[_0x8435('0x1a')]=qs['limit'](_0x10555a[_0x8435('0x2e')][_0x8435('0x1a')]);_0x5947d8[_0x8435('0x19')]=qs[_0x8435('0x19')](_0x10555a[_0x8435('0x2e')]['offset']);}_0x5947d8[_0x8435('0x31')]=qs['sort'](_0x10555a[_0x8435('0x2e')][_0x8435('0x32')]);_0x5947d8[_0x8435('0x33')]=qs[_0x8435('0x34')](_[_0x8435('0x35')](_0x10555a[_0x8435('0x2e')],_0x55fd2f[_0x8435('0x34')]));if(_0x10555a[_0x8435('0x2e')][_0x8435('0x36')]){_0x5947d8[_0x8435('0x33')]=_[_0x8435('0x37')](_0x5947d8['where'],{'$or':_[_0x8435('0x38')](_0x1c5f8d,function(_0x22596c){if(_0x22596c['type'][_0x8435('0x39')]!==_0x8435('0x3a')){var _0x8c1c0={};_0x8c1c0[_0x22596c[_0x8435('0x3b')]]={'$like':'%'+_0x10555a['query'][_0x8435('0x36')]+'%'};return _0x8c1c0;}})});}_0x5947d8=_['merge']({},_0x5947d8,_0x10555a[_0x8435('0x3c')]);var _0x2b0228={'where':_0x5947d8[_0x8435('0x33')]};return db[_0x8435('0x26')][_0x8435('0x3d')](_0x2b0228)['then'](function(_0x379c73){_0x46a18b[_0x8435('0x3d')]=_0x379c73;if(_0x10555a[_0x8435('0x2e')]['includeAll']){_0x5947d8[_0x8435('0x3e')]=[{'all':!![]}];}return db[_0x8435('0x26')][_0x8435('0x3f')](_0x5947d8);})[_0x8435('0x20')](function(_0x76d428){_0x46a18b[_0x8435('0x40')]=_0x76d428;return _0x46a18b;})[_0x8435('0x20')](respondWithFilteredResult(_0x4bed4d,_0x5947d8))[_0x8435('0x41')](handleError(_0x4bed4d,null));};exports[_0x8435('0x42')]=function(_0x555a72,_0xa9816e){var _0x9a1723={'raw':!![],'where':{'id':_0x555a72[_0x8435('0x43')]['id']}},_0x268553={};_0x268553[_0x8435('0x29')]=_['keys'](db[_0x8435('0x26')][_0x8435('0x27')]);_0x268553[_0x8435('0x2e')]=_[_0x8435('0x28')](_0x555a72[_0x8435('0x2e')]);_0x268553[_0x8435('0x34')]=_['intersection'](_0x268553['model'],_0x268553['query']);_0x9a1723[_0x8435('0x2a')]=_[_0x8435('0x2b')](_0x268553['model'],qs[_0x8435('0x2c')](_0x555a72['query'][_0x8435('0x2c')]));_0x9a1723[_0x8435('0x2a')]=_0x9a1723[_0x8435('0x2a')][_0x8435('0x2d')]?_0x9a1723[_0x8435('0x2a')]:_0x268553['model'];if(_0x555a72[_0x8435('0x2e')]['includeAll']){_0x9a1723[_0x8435('0x3e')]=[{'all':!![]}];}_0x9a1723=_['merge']({},_0x9a1723,_0x555a72['options']);return db[_0x8435('0x26')][_0x8435('0x44')](_0x9a1723)[_0x8435('0x20')](handleEntityNotFound(_0xa9816e,null))['then'](respondWithResult(_0xa9816e,null))[_0x8435('0x41')](handleError(_0xa9816e,null));};exports[_0x8435('0x45')]=function(_0x512fd4,_0x296e65){return db[_0x8435('0x26')][_0x8435('0x45')](_0x512fd4[_0x8435('0x46')],{})[_0x8435('0x20')](respondWithResult(_0x296e65,0xc9))[_0x8435('0x41')](handleError(_0x296e65,null));};exports['update']=function(_0x302f96,_0x5e7db4){if(_0x302f96[_0x8435('0x46')]['id']){delete _0x302f96[_0x8435('0x46')]['id'];}return db[_0x8435('0x26')][_0x8435('0x44')]({'where':{'id':_0x302f96['params']['id']}})[_0x8435('0x20')](handleEntityNotFound(_0x5e7db4,null))[_0x8435('0x20')](saveUpdates(_0x302f96[_0x8435('0x46')],null))['then'](respondWithResult(_0x5e7db4,null))['catch'](handleError(_0x5e7db4,null));};exports[_0x8435('0x21')]=function(_0x35fd61,_0x365e28){return db[_0x8435('0x26')]['find']({'where':{'id':_0x35fd61['params']['id']}})[_0x8435('0x20')](handleEntityNotFound(_0x365e28,null))[_0x8435('0x20')](removeEntity(_0x365e28,null))['catch'](handleError(_0x365e28,null));};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js
index c167967..856b4ca 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.model.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc389=['exports','define','report_call_transfer','lodash','api','bluebird','request-promise','path','./voiceTransferReport.attributes'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xc389,0x1d7));var _0x9c38=function(_0x35f29f,_0x4619f4){_0x35f29f=_0x35f29f-0x0;var _0x233b90=_0xc389[_0x35f29f];return _0x233b90;};'use strict';var _=require(_0x9c38('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9c38('0x1'));var moment=require('moment');var BPromise=require(_0x9c38('0x2'));var rp=require(_0x9c38('0x3'));var fs=require('fs');var path=require(_0x9c38('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9c38('0x5'));module[_0x9c38('0x6')]=function(_0x3f8f8d,_0x530a2a){return _0x3f8f8d[_0x9c38('0x7')]('VoiceTransferReport',attributes,{'tableName':_0x9c38('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x943a=['define','VoiceTransferReport','lodash','util','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x45608b,_0x386cdc){var _0x3fee7=function(_0x5257f0){while(--_0x5257f0){_0x45608b['push'](_0x45608b['shift']());}};_0x3fee7(++_0x386cdc);}(_0x943a,0x1ce));var _0xa943=function(_0x547e0f,_0x401657){_0x547e0f=_0x547e0f-0x0;var _0x58842e=_0x943a[_0x547e0f];return _0x58842e;};'use strict';var _=require(_0xa943('0x0'));var util=require(_0xa943('0x1'));var logger=require('../../config/logger')(_0xa943('0x2'));var moment=require(_0xa943('0x3'));var BPromise=require(_0xa943('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa943('0x5'));var rimraf=require('rimraf');var config=require(_0xa943('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0xa943('0x7')]=function(_0x4db8a5,_0x1b2b97){return _0x4db8a5[_0xa943('0x8')](_0xa943('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js
index 603372b..e185708 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.rpc.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4178=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','VoiceTransferReport','body','options','CreateVoiceTransferReport','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info'];(function(_0x305d86,_0x18176d){var _0x5a354c=function(_0x3547a8){while(--_0x3547a8){_0x305d86['push'](_0x305d86['shift']());}};_0x5a354c(++_0x18176d);}(_0x4178,0x107));var _0x8417=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4178[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x8417('0x0'));var util=require(_0x8417('0x1'));var moment=require(_0x8417('0x2'));var BPromise=require(_0x8417('0x3'));var rs=require(_0x8417('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8417('0x5'));var logger=require(_0x8417('0x6'))(_0x8417('0x7'));var config=require('../../config/environment');var jayson=require(_0x8417('0x8'));var client=jayson[_0x8417('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492ac4,_0x429237,_0x199ed1){return new BPromise(function(_0x3ecf15,_0x724201){return client[_0x8417('0xa')](_0x492ac4,_0x199ed1)['then'](function(_0x47be62){logger[_0x8417('0xb')](_0x8417('0xc'),_0x429237,_0x8417('0xd'));logger[_0x8417('0xe')](_0x8417('0xf'),_0x429237,'request\x20sent',JSON[_0x8417('0x10')](_0x47be62));if(_0x47be62['error']){if(_0x47be62['error'][_0x8417('0x11')]===0x1f4){logger[_0x8417('0x12')](_0x8417('0xc'),_0x429237,_0x47be62[_0x8417('0x12')][_0x8417('0x13')]);return _0x724201(_0x47be62[_0x8417('0x12')][_0x8417('0x13')]);}logger[_0x8417('0x12')](_0x8417('0xc'),_0x429237,_0x47be62[_0x8417('0x12')][_0x8417('0x13')]);return _0x3ecf15(_0x47be62[_0x8417('0x12')][_0x8417('0x13')]);}else{logger[_0x8417('0xb')](_0x8417('0xc'),_0x429237,_0x8417('0xd'));_0x3ecf15(_0x47be62['result'][_0x8417('0x13')]);}})['catch'](function(_0x36d383){logger[_0x8417('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x429237,_0x36d383);_0x724201(_0x36d383);});});}exports['CreateVoiceTransferReport']=function(_0x36f329){var _0x411742=this;return new Promise(function(_0x222d02,_0x2e9c08){return db[_0x8417('0x14')]['create'](_0x36f329[_0x8417('0x15')],{'raw':_0x36f329[_0x8417('0x16')]?_0x36f329[_0x8417('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3e5d62){logger['info'](_0x8417('0x17'),_0x36f329);logger[_0x8417('0xe')]('CreateVoiceTransferReport',_0x36f329,JSON[_0x8417('0x10')](_0x3e5d62));_0x222d02(_0x3e5d62);})[_0x8417('0x18')](function(_0x25e135){logger[_0x8417('0x12')](_0x8417('0x17'),_0x25e135['message'],_0x36f329);_0x2e9c08(_0x411742[_0x8417('0x12')](0x1f4,_0x25e135[_0x8417('0x13')]));});});};
\ No newline at end of file
+var _0x04df=['request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x2ce0f3,_0x29c17e){var _0x2dfafd=function(_0x4776d9){while(--_0x4776d9){_0x2ce0f3['push'](_0x2ce0f3['shift']());}};_0x2dfafd(++_0x29c17e);}(_0x04df,0xd6));var _0xf04d=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x04df[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0xf04d('0x0'));var util=require(_0xf04d('0x1'));var moment=require('moment');var BPromise=require(_0xf04d('0x2'));var rs=require(_0xf04d('0x3'));var fs=require('fs');var Redis=require(_0xf04d('0x4'));var db=require(_0xf04d('0x5'))['db'];var utils=require(_0xf04d('0x6'));var logger=require('../../config/logger')(_0xf04d('0x7'));var config=require(_0xf04d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf04d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1339d0,_0x2c199c,_0x19bc4e){return new BPromise(function(_0xe9af0d,_0x262e35){return client[_0xf04d('0xa')](_0x1339d0,_0x19bc4e)['then'](function(_0x13676d){logger[_0xf04d('0xb')](_0xf04d('0xc'),_0x2c199c,_0xf04d('0xd'));logger[_0xf04d('0xe')](_0xf04d('0xf'),_0x2c199c,_0xf04d('0xd'),JSON[_0xf04d('0x10')](_0x13676d));if(_0x13676d['error']){if(_0x13676d[_0xf04d('0x11')][_0xf04d('0x12')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x2c199c,_0x13676d['error']['message']);return _0x262e35(_0x13676d[_0xf04d('0x11')]['message']);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x2c199c,_0x13676d['error'][_0xf04d('0x13')]);return _0xe9af0d(_0x13676d[_0xf04d('0x11')][_0xf04d('0x13')]);}else{logger[_0xf04d('0xb')](_0xf04d('0xc'),_0x2c199c,_0xf04d('0xd'));_0xe9af0d(_0x13676d[_0xf04d('0x14')][_0xf04d('0x13')]);}})[_0xf04d('0x15')](function(_0x4dc125){logger[_0xf04d('0x11')](_0xf04d('0xc'),_0x2c199c,_0x4dc125);_0x262e35(_0x4dc125);});});}exports['CreateVoiceTransferReport']=function(_0x1b9b69){var _0x4c2394=this;return new Promise(function(_0x1ec29b,_0x48c143){return db[_0xf04d('0x16')][_0xf04d('0x17')](_0x1b9b69[_0xf04d('0x18')],{'raw':_0x1b9b69[_0xf04d('0x19')]?_0x1b9b69[_0xf04d('0x19')][_0xf04d('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x44ed87){logger[_0xf04d('0xb')](_0xf04d('0x1b'),_0x1b9b69);logger[_0xf04d('0xe')](_0xf04d('0x1b'),_0x1b9b69,JSON[_0xf04d('0x10')](_0x44ed87));_0x1ec29b(_0x44ed87);})[_0xf04d('0x15')](function(_0x40cf25){logger[_0xf04d('0x11')]('CreateVoiceTransferReport',_0x40cf25[_0xf04d('0x13')],_0x1b9b69);_0x48c143(_0x4c2394[_0xf04d('0x11')](0x1f4,_0x40cf25[_0xf04d('0x13')]));});});};
\ No newline at end of file
diff --git a/server/app.js b/server/app.js
index 2eb4452..a534099 100644
--- a/server/app.js
+++ b/server/app.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb08=['./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sync','then','listen','info','start','Online\x20apps:','map','name','join','status','online','None','seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/environment'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0xbb08,0x101));var _0x8bb0=function(_0x1aaa3c,_0x347f8d){_0x1aaa3c=_0x1aaa3c-0x0;var _0x3857ef=_0xbb08[_0x1aaa3c];return _0x3857ef;};'use strict';var _=require(_0x8bb0('0x0'));var mysqldb=require(_0x8bb0('0x1'));var rpc=require('./rpc');var config=require(_0x8bb0('0x2'));var logger=require(_0x8bb0('0x3'))(_0x8bb0('0x4'));var pm2=require(_0x8bb0('0x5'));var pm2Config=require(_0x8bb0('0x6'));var schedule=require(_0x8bb0('0x7'));var chat=require(_0x8bb0('0x8'));function main(){return mysqldb['db']['sequelize'][_0x8bb0('0x9')]()[_0x8bb0('0xa')](function(){return rpc[_0x8bb0('0xb')]();})['then'](function(_0x430547){logger[_0x8bb0('0xc')](_0x430547);return chat['start']();})['then'](function(){return schedule[_0x8bb0('0xd')]();})[_0x8bb0('0xa')](function(_0x25f837){logger[_0x8bb0('0xc')](_0x25f837);return pm2[_0x8bb0('0xd')](pm2Config);})[_0x8bb0('0xa')](function(_0x169aa4){logger[_0x8bb0('0xc')](_0x8bb0('0xe'),_[_0x8bb0('0xf')](_['filter'](_0x169aa4,{'status':'online'}),_0x8bb0('0x10'))[_0x8bb0('0x11')]());logger[_0x8bb0('0xc')]('Offline\x20apps:',_[_0x8bb0('0xf')](_['filter'](_0x169aa4,function(_0x49e0eb){return _0x49e0eb[_0x8bb0('0x12')]!==_0x8bb0('0x13');}),_0x8bb0('0x10'))[_0x8bb0('0x11')]()||_0x8bb0('0x14'));config[_0x8bb0('0x15')]&&require('./config/seedDB')[_0x8bb0('0x16')]();require('./config/license')[_0x8bb0('0x16')]();})[_0x8bb0('0x17')](function(_0x34c8c5){logger[_0x8bb0('0x18')](_0x8bb0('0x19'),_0x34c8c5);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0xa109=['default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','sequelize','then','listen','info','start','Online\x20apps:','map','online','name','Offline\x20apps:','filter','None','seedDB','./config/seedDB'];(function(_0x29859f,_0x2f7896){var _0x3a4118=function(_0x724cc7){while(--_0x724cc7){_0x29859f['push'](_0x29859f['shift']());}};_0x3a4118(++_0x2f7896);}(_0xa109,0x172));var _0x9a10=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa109[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x9a10('0x0'));var mysqldb=require(_0x9a10('0x1'));var rpc=require(_0x9a10('0x2'));var config=require(_0x9a10('0x3'));var logger=require('./config/logger')(_0x9a10('0x4'));var pm2=require(_0x9a10('0x5'));var pm2Config=require(_0x9a10('0x6'));var schedule=require(_0x9a10('0x7'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0x9a10('0x8')]['sync']()[_0x9a10('0x9')](function(){return rpc[_0x9a10('0xa')]();})[_0x9a10('0x9')](function(_0x572f39){logger[_0x9a10('0xb')](_0x572f39);return chat[_0x9a10('0xc')]();})[_0x9a10('0x9')](function(){return schedule[_0x9a10('0xc')]();})[_0x9a10('0x9')](function(_0x5e2e37){logger[_0x9a10('0xb')](_0x5e2e37);return pm2['start'](pm2Config);})['then'](function(_0x407e75){logger['info'](_0x9a10('0xd'),_[_0x9a10('0xe')](_['filter'](_0x407e75,{'status':_0x9a10('0xf')}),_0x9a10('0x10'))['join']());logger['info'](_0x9a10('0x11'),_[_0x9a10('0xe')](_[_0x9a10('0x12')](_0x407e75,function(_0x3d473b){return _0x3d473b['status']!==_0x9a10('0xf');}),'name')['join']()||_0x9a10('0x13'));config[_0x9a10('0x14')]&&require(_0x9a10('0x15'))[_0x9a10('0x16')]();require(_0x9a10('0x17'))[_0x9a10('0x16')]();})[_0x9a10('0x18')](function(_0x5b41ce){logger[_0x9a10('0x19')](_0x9a10('0x1a'),_0x5b41ce);process[_0x9a10('0x1b')](0x1);});}main();
\ No newline at end of file
diff --git a/server/components/auth/service.js b/server/components/auth/service.js
index b469fa0..6662bec 100644
--- a/server/components/auth/service.js
+++ b/server/components/auth/service.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1d67=['faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','interface','userProfileId','isChatInteractionAuthorized','use','ChatInteraction','findOne','closed','disposition','then','status','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','authenticate','pass','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','verify','apikey','getUuid','User','find','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','User\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','update','Forbidden','canUpdate','sign','signToken','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','motion.user','stringify','pick','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','randomBytes','toString','hex','floor','now','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','../../mysqldb','../../config/license/hardware','jsonwebtoken','ipaddr.js','secrets','session','role','fullname','name','internal','email','userpic','voicePause','mailPause'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0x1d67,0x1ea));var _0x71d6=function(_0x38db16,_0x504dc5){_0x38db16=_0x38db16-0x0;var _0x580f2e=_0x1d67[_0x38db16];return _0x580f2e;};'use strict';var db=require(_0x71d6('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x71d6('0x1'));var _=require('lodash');var jwt=require(_0x71d6('0x2'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require('crypto');var ipaddr=require(_0x71d6('0x3'));var validateJwt=expressJwt({'secret':config[_0x71d6('0x4')][_0x71d6('0x5')]});var userAttributes=['id',_0x71d6('0x6'),_0x71d6('0x7'),_0x71d6('0x8'),_0x71d6('0x9'),_0x71d6('0xa'),_0x71d6('0xb'),'permissions',_0x71d6('0xc'),'chatPause',_0x71d6('0xd'),_0x71d6('0xe'),_0x71d6('0xf'),_0x71d6('0x10'),_0x71d6('0x11'),_0x71d6('0x12'),_0x71d6('0x13'),'phoneBarRemoteControl',_0x71d6('0x14'),_0x71d6('0x15')];exports[_0x71d6('0x16')]=function(){return isAuthenticated(!![])[_0x71d6('0x17')](function(_0x54252a,_0x4b7280,_0x282a24){if(_0x54252a['user']){_0x282a24();}else{return db[_0x71d6('0x18')][_0x71d6('0x19')]({'where':{'id':_0x54252a['params']['id']},'attributes':['id',_0x71d6('0x1a'),_0x71d6('0x1b')],'raw':!![]})[_0x71d6('0x1c')](function(_0xeab9cb){if(_0xeab9cb&&_0xeab9cb[_0x71d6('0x1a')]){return _0x4b7280[_0x71d6('0x1d')](_0xeab9cb[_0x71d6('0x1b')]==='unmanaged'?0x195:0x193)[_0x71d6('0x1e')]({'message':_0xeab9cb[_0x71d6('0x1b')]==='unmanaged'?_0x71d6('0x1f'):_0x71d6('0x20')});}else{_0x282a24();}})[_0x71d6('0x21')](function(_0x42ab92){_0x282a24(_0x42ab92);});}});};function isAuthenticated(_0x2ca02b){return compose()[_0x71d6('0x17')](function(_0x4ec9b0,_0xcb9512,_0xc86f47){if(_0x4ec9b0[_0x71d6('0x22')][_0x71d6('0x23')]){if(_[_0x71d6('0x24')](_0x4ec9b0['headers'][_0x71d6('0x23')],'Basic')){var _0x1d3a01=basicAuth(_0x4ec9b0);db['User']['find']({'where':{'name':_0x1d3a01[_0x71d6('0x8')]}})[_0x71d6('0x1c')](function(_0x564e9c){if(!_0x564e9c||!_0x564e9c[_0x71d6('0x25')](_0x1d3a01[_0x71d6('0x26')])){return _0xcb9512[_0x71d6('0x1d')](0x191)[_0x71d6('0x1e')]({'message':_0x71d6('0x27')});}_0x4ec9b0[_0x71d6('0x28')]={'id':_0x564e9c['id']};_0xc86f47();})[_0x71d6('0x21')](function(_0x3017cf){_0xc86f47(_0x3017cf);});}else if(_[_0x71d6('0x24')](_0x4ec9b0[_0x71d6('0x22')][_0x71d6('0x23')],_0x71d6('0x29'))){validateJwt(_0x4ec9b0,_0xcb9512,_0xc86f47);}else{if(_0x2ca02b){_0xc86f47();}else{return _0xcb9512['status'](0x193)[_0x71d6('0x1e')]({'message':_0x71d6('0x2a')});}}}else if(_0x4ec9b0[_0x71d6('0x2b')]['apikey']){try{var _0x1cb469=jwt[_0x71d6('0x2c')](_0x4ec9b0['query'][_0x71d6('0x2d')],config[_0x71d6('0x4')][_0x71d6('0x5')],{'audience':hardwareConf[_0x71d6('0x2e')](),'issuer':hardwareConf[_0x71d6('0x2e')]()});db[_0x71d6('0x2f')][_0x71d6('0x30')]({'where':{'id':_0x1cb469['sub']}})[_0x71d6('0x1c')](function(_0x141c1c){if(!_0x141c1c||!_[_0x71d6('0x31')](_0x141c1c[_0x71d6('0x32')],_0x1cb469['nonce'])){return _0xcb9512['status'](0x193)[_0x71d6('0x1e')]({'message':_0x71d6('0x33')});}_0x4ec9b0[_0x71d6('0x28')]={'id':_0x141c1c['id']};_0xc86f47();})['catch'](function(_0x301e12){_0xc86f47(_0x301e12);});}catch(_0xbddf05){console[_0x71d6('0x34')](_0xbddf05);return _0xcb9512['status'](0x193)['json']({'message':'Unrecognized\x20API\x20access\x20key'});}}else if(_0x2ca02b){_0xc86f47();}else{return _0xcb9512['status'](0x193)[_0x71d6('0x1e')]({'message':_0x71d6('0x2a')});}})['use'](function(_0x3166f6,_0x20e72f,_0x57f860){if(_0x3166f6[_0x71d6('0x28')]){db[_0x71d6('0x2f')][_0x71d6('0x30')]({'where':{'id':_0x3166f6['user']['id']},'attributes':userAttributes})[_0x71d6('0x1c')](function(_0x56142f){if(!_0x56142f){return _0x20e72f[_0x71d6('0x1d')](0x194)[_0x71d6('0x1e')]({'message':_0x71d6('0x35')});}_0x3166f6['user']=_0x56142f;_0x57f860();})[_0x71d6('0x21')](function(_0x4068bb){_0x57f860(_0x4068bb);});}else if(_0x2ca02b){_0x57f860();}else{return _0x20e72f['status'](0x194)[_0x71d6('0x1e')]({'message':'User\x20object\x20not\x20found.'});}});}exports[_0x71d6('0x36')]=isAuthenticated;function canUpdate(){return compose()[_0x71d6('0x17')](function(_0x4818c4,_0x43335b,_0x41a622){return require(_0x71d6('0x37'))[_0x71d6('0x38')]()['then'](function(_0x5cb0f3){if(_0x5cb0f3[_0x71d6('0x39')]){_0x41a622();}else{return _0x43335b[_0x71d6('0x1d')](0x193)['json']({'message':_0x71d6('0x3a')});}})['catch'](function(_0x3e1f74){_0x41a622(_0x3e1f74);});});}exports[_0x71d6('0x3b')]=canUpdate;function signToken(_0x189783,_0x247ea7){return jwt[_0x71d6('0x3c')]({'id':_0x189783,'role':_0x247ea7},config[_0x71d6('0x4')]['session'],{'expiresIn':0x15180});}exports[_0x71d6('0x3d')]=signToken;exports['hasRole']=function(_0x44bb76){if(!_0x44bb76){throw new Error(_0x71d6('0x3e'));}return compose()[_0x71d6('0x17')](isAuthenticated())[_0x71d6('0x17')](function meetsRequirements(_0x294cc4,_0x33aa35,_0x3a406f){if(config[_0x71d6('0x3f')][_0x71d6('0x40')](_0x294cc4[_0x71d6('0x28')][_0x71d6('0x6')])>=config[_0x71d6('0x3f')][_0x71d6('0x40')](_0x44bb76)){return _0x3a406f();}else{return _0x33aa35[_0x71d6('0x1d')](0x193)[_0x71d6('0x1e')]({'message':_0x71d6('0x3a')});}});};exports[_0x71d6('0x41')]=function(_0x54cd10,_0x3bc8d7){if(!_0x54cd10[_0x71d6('0x28')]){return _0x3bc8d7[_0x71d6('0x1d')](0x194)[_0x71d6('0x1e')]({'message':_0x71d6('0x42')});}var _0x2cbf72=signToken(_0x54cd10['user']['id'],_0x54cd10[_0x71d6('0x28')][_0x71d6('0x6')]);_0x3bc8d7[_0x71d6('0x43')](_0x71d6('0x44'),_0x2cbf72);_0x3bc8d7['cookie'](_0x71d6('0x45'),JSON[_0x71d6('0x46')](_[_0x71d6('0x47')](_0x54cd10[_0x71d6('0x28')],userAttributes)));_0x3bc8d7[_0x71d6('0x48')](_0x71d6('0x49'));};exports[_0x71d6('0x4a')]=function(_0x31d08b){if(_[_0x71d6('0x4b')](_0x31d08b['apiKeyNonce'])||_[_0x71d6('0x4b')](_0x31d08b[_0x71d6('0x4c')]))return null;else return createJwt(_0x31d08b);};exports[_0x71d6('0x4d')]=function(_0xe0fdba){_0xe0fdba[_0x71d6('0x32')]=crypto[_0x71d6('0x4e')](0x10)[_0x71d6('0x4f')](_0x71d6('0x50'));_0xe0fdba[_0x71d6('0x4c')]=Math[_0x71d6('0x51')](Date[_0x71d6('0x52')]()/0x3e8)['toString']();return createJwt(_0xe0fdba);};exports['regenerateApiKey']=function(_0x5f08ac,_0x5e449f){if(_0x5f08ac['query']['apikey']){jwt[_0x71d6('0x2c')](_0x5f08ac[_0x71d6('0x2b')][_0x71d6('0x2d')],config['secrets'][_0x71d6('0x5')],{'nonce':_0x5e449f[_0x71d6('0x32')],'iat':_0x5e449f[_0x71d6('0x4c')],'audience':hardwareConf[_0x71d6('0x2e')](),'issuer':hardwareConf[_0x71d6('0x2e')]()});return generateApiKey(_0x5e449f);}else{throw{'message':_0x71d6('0x53')};}};function createJwt(_0x3a4b25){return jwt[_0x71d6('0x3c')]({'iat':_0x3a4b25[_0x71d6('0x4c')],'nonce':_0x3a4b25[_0x71d6('0x32')]},config[_0x71d6('0x4')][_0x71d6('0x5')],{'algorithm':'HS512','subject':_0x3a4b25['id'][_0x71d6('0x4f')](),'issuer':hardwareConf[_0x71d6('0x2e')](),'audience':hardwareConf[_0x71d6('0x2e')]()});}
\ No newline at end of file
+var _0x5fd8=['randomBytes','toString','hex','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','ipaddr.js','secrets','session','role','name','internal','email','userpic','voicePause','chatPause','mailPause','smsPause','openchannelPause','phoneBarRemoteControlPort','phoneBarRemoteControl','userProfileId','isChatInteractionAuthorized','use','user','ChatInteraction','params','disposition','closed','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','find','then','authenticate','pass','status','json','startsWith','Bearer','Unknown\x20authorization\x20format','query','verify','apikey','getUuid','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','../../config/license/util','getLicense','update','Forbidden','canUpdate','sign','signToken','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','setTokenCookie','cookie','motion.user','stringify','pick','/dashboards/general','retrieveApiKey','isNil','generateApiKey'];(function(_0x33d4a2,_0x2baaf4){var _0x2c793f=function(_0x414303){while(--_0x414303){_0x33d4a2['push'](_0x33d4a2['shift']());}};_0x2c793f(++_0x2baaf4);}(_0x5fd8,0x157));var _0x85fd=function(_0x1925ed,_0xcede37){_0x1925ed=_0x1925ed-0x0;var _0x25d5b2=_0x5fd8[_0x1925ed];return _0x25d5b2;};'use strict';var db=require(_0x85fd('0x0'))['db'];var config=require(_0x85fd('0x1'));var hardwareConf=require(_0x85fd('0x2'));var _=require(_0x85fd('0x3'));var jwt=require(_0x85fd('0x4'));var expressJwt=require(_0x85fd('0x5'));var compose=require(_0x85fd('0x6'));var basicAuth=require(_0x85fd('0x7'));var crypto=require(_0x85fd('0x8'));var ipaddr=require(_0x85fd('0x9'));var validateJwt=expressJwt({'secret':config[_0x85fd('0xa')][_0x85fd('0xb')]});var userAttributes=['id',_0x85fd('0xc'),'fullname',_0x85fd('0xd'),_0x85fd('0xe'),_0x85fd('0xf'),_0x85fd('0x10'),'permissions',_0x85fd('0x11'),_0x85fd('0x12'),_0x85fd('0x13'),'faxPause',_0x85fd('0x14'),_0x85fd('0x15'),'pauseType','showWebBar',_0x85fd('0x16'),_0x85fd('0x17'),'interface',_0x85fd('0x18')];exports[_0x85fd('0x19')]=function(){return isAuthenticated(!![])[_0x85fd('0x1a')](function(_0x890289,_0x27519a,_0x16432a){if(_0x890289[_0x85fd('0x1b')]){_0x16432a();}else{return db[_0x85fd('0x1c')]['findOne']({'where':{'id':_0x890289[_0x85fd('0x1d')]['id']},'attributes':['id','closed',_0x85fd('0x1e')],'raw':!![]})['then'](function(_0x2f4651){if(_0x2f4651&&_0x2f4651[_0x85fd('0x1f')]){return _0x27519a['status'](_0x2f4651[_0x85fd('0x1e')]===_0x85fd('0x20')?0x195:0x193)['json']({'message':_0x2f4651[_0x85fd('0x1e')]===_0x85fd('0x20')?_0x85fd('0x21'):_0x85fd('0x22')});}else{_0x16432a();}})[_0x85fd('0x23')](function(_0x4c6867){_0x16432a(_0x4c6867);});}});};function isAuthenticated(_0x334d22){return compose()[_0x85fd('0x1a')](function(_0x35a7bb,_0xe82074,_0x4a24fa){if(_0x35a7bb[_0x85fd('0x24')]['authorization']){if(_['startsWith'](_0x35a7bb[_0x85fd('0x24')][_0x85fd('0x25')],'Basic')){var _0x4f8a9c=basicAuth(_0x35a7bb);db[_0x85fd('0x26')][_0x85fd('0x27')]({'where':{'name':_0x4f8a9c[_0x85fd('0xd')]}})[_0x85fd('0x28')](function(_0xf68a49){if(!_0xf68a49||!_0xf68a49[_0x85fd('0x29')](_0x4f8a9c[_0x85fd('0x2a')])){return _0xe82074[_0x85fd('0x2b')](0x191)[_0x85fd('0x2c')]({'message':'Wrong\x20credentials.'});}_0x35a7bb[_0x85fd('0x1b')]={'id':_0xf68a49['id']};_0x4a24fa();})[_0x85fd('0x23')](function(_0x29b8f0){_0x4a24fa(_0x29b8f0);});}else if(_[_0x85fd('0x2d')](_0x35a7bb[_0x85fd('0x24')]['authorization'],_0x85fd('0x2e'))){validateJwt(_0x35a7bb,_0xe82074,_0x4a24fa);}else{if(_0x334d22){_0x4a24fa();}else{return _0xe82074[_0x85fd('0x2b')](0x193)[_0x85fd('0x2c')]({'message':_0x85fd('0x2f')});}}}else if(_0x35a7bb[_0x85fd('0x30')]['apikey']){try{var _0x454f1f=jwt[_0x85fd('0x31')](_0x35a7bb[_0x85fd('0x30')][_0x85fd('0x32')],config[_0x85fd('0xa')]['session'],{'audience':hardwareConf[_0x85fd('0x33')](),'issuer':hardwareConf[_0x85fd('0x33')]()});db[_0x85fd('0x26')]['find']({'where':{'id':_0x454f1f['sub']}})['then'](function(_0x57b2bd){if(!_0x57b2bd||!_[_0x85fd('0x34')](_0x57b2bd[_0x85fd('0x35')],_0x454f1f['nonce'])){return _0xe82074[_0x85fd('0x2b')](0x193)['json']({'message':_0x85fd('0x36')});}_0x35a7bb[_0x85fd('0x1b')]={'id':_0x57b2bd['id']};_0x4a24fa();})[_0x85fd('0x23')](function(_0x18be33){_0x4a24fa(_0x18be33);});}catch(_0x1bd77b){console['log'](_0x1bd77b);return _0xe82074[_0x85fd('0x2b')](0x193)[_0x85fd('0x2c')]({'message':_0x85fd('0x37')});}}else if(_0x334d22){_0x4a24fa();}else{return _0xe82074[_0x85fd('0x2b')](0x193)['json']({'message':_0x85fd('0x2f')});}})['use'](function(_0x563ecf,_0x3288dd,_0x2392b8){if(_0x563ecf[_0x85fd('0x1b')]){db['User'][_0x85fd('0x27')]({'where':{'id':_0x563ecf[_0x85fd('0x1b')]['id']},'attributes':userAttributes})[_0x85fd('0x28')](function(_0x5915a4){if(!_0x5915a4){return _0x3288dd[_0x85fd('0x2b')](0x194)[_0x85fd('0x2c')]({'message':_0x85fd('0x38')});}_0x563ecf[_0x85fd('0x1b')]=_0x5915a4;_0x2392b8();})[_0x85fd('0x23')](function(_0x3f2670){_0x2392b8(_0x3f2670);});}else if(_0x334d22){_0x2392b8();}else{return _0x3288dd['status'](0x194)[_0x85fd('0x2c')]({'message':_0x85fd('0x39')});}});}exports['isAuthenticated']=isAuthenticated;function canUpdate(){return compose()[_0x85fd('0x1a')](function(_0x1f7927,_0x3e96ac,_0x7fa994){return require(_0x85fd('0x3a'))[_0x85fd('0x3b')]()[_0x85fd('0x28')](function(_0x3e9313){if(_0x3e9313[_0x85fd('0x3c')]){_0x7fa994();}else{return _0x3e96ac[_0x85fd('0x2b')](0x193)[_0x85fd('0x2c')]({'message':_0x85fd('0x3d')});}})['catch'](function(_0x3d79a3){_0x7fa994(_0x3d79a3);});});}exports[_0x85fd('0x3e')]=canUpdate;function signToken(_0x197f0b,_0x2fe23e){return jwt[_0x85fd('0x3f')]({'id':_0x197f0b,'role':_0x2fe23e},config[_0x85fd('0xa')][_0x85fd('0xb')],{'expiresIn':0x15180});}exports[_0x85fd('0x40')]=signToken;exports['hasRole']=function(_0x526dc9){if(!_0x526dc9){throw new Error(_0x85fd('0x41'));}return compose()['use'](isAuthenticated())['use'](function meetsRequirements(_0x44c852,_0x4d6e68,_0x260b59){if(config[_0x85fd('0x42')][_0x85fd('0x43')](_0x44c852[_0x85fd('0x1b')][_0x85fd('0xc')])>=config['userRoles']['indexOf'](_0x526dc9)){return _0x260b59();}else{return _0x4d6e68['status'](0x193)['json']({'message':_0x85fd('0x3d')});}});};exports[_0x85fd('0x44')]=function(_0x170948,_0x234d17){if(!_0x170948['user']){return _0x234d17[_0x85fd('0x2b')](0x194)[_0x85fd('0x2c')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x20fe0c=signToken(_0x170948[_0x85fd('0x1b')]['id'],_0x170948[_0x85fd('0x1b')][_0x85fd('0xc')]);_0x234d17[_0x85fd('0x45')]('motion.token',_0x20fe0c);_0x234d17['cookie'](_0x85fd('0x46'),JSON[_0x85fd('0x47')](_[_0x85fd('0x48')](_0x170948[_0x85fd('0x1b')],userAttributes)));_0x234d17['redirect'](_0x85fd('0x49'));};exports[_0x85fd('0x4a')]=function(_0x33302a){if(_[_0x85fd('0x4b')](_0x33302a[_0x85fd('0x35')])||_[_0x85fd('0x4b')](_0x33302a['apiKeyIat']))return null;else return createJwt(_0x33302a);};exports[_0x85fd('0x4c')]=function(_0x4cabfb){_0x4cabfb['apiKeyNonce']=crypto[_0x85fd('0x4d')](0x10)[_0x85fd('0x4e')](_0x85fd('0x4f'));_0x4cabfb[_0x85fd('0x50')]=Math['floor'](Date['now']()/0x3e8)[_0x85fd('0x4e')]();return createJwt(_0x4cabfb);};exports[_0x85fd('0x51')]=function(_0x43bedc,_0x377674){if(_0x43bedc['query'][_0x85fd('0x32')]){jwt['verify'](_0x43bedc['query'][_0x85fd('0x32')],config['secrets'][_0x85fd('0xb')],{'nonce':_0x377674[_0x85fd('0x35')],'iat':_0x377674[_0x85fd('0x50')],'audience':hardwareConf[_0x85fd('0x33')](),'issuer':hardwareConf[_0x85fd('0x33')]()});return generateApiKey(_0x377674);}else{throw{'message':_0x85fd('0x52')};}};function createJwt(_0x4896cc){return jwt[_0x85fd('0x3f')]({'iat':_0x4896cc[_0x85fd('0x50')],'nonce':_0x4896cc[_0x85fd('0x35')]},config[_0x85fd('0xa')][_0x85fd('0xb')],{'algorithm':_0x85fd('0x53'),'subject':_0x4896cc['id']['toString'](),'issuer':hardwareConf[_0x85fd('0x33')](),'audience':hardwareConf['getUuid']()});}
\ No newline at end of file
diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js
index 4a06b39..ac0e6c6 100644
--- a/server/components/encryptor/index.js
+++ b/server/components/encryptor/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5049=['createDecipher','algorithm','final','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','close','unlink'];(function(_0x9cf6cf,_0x3f5373){var _0x58acb5=function(_0x34b8b2){while(--_0x34b8b2){_0x9cf6cf['push'](_0x9cf6cf['shift']());}};_0x58acb5(++_0x3f5373);}(_0x5049,0x1b3));var _0x9504=function(_0x4abb30,_0x3da88f){_0x4abb30=_0x4abb30-0x0;var _0x235472=_0x5049[_0x4abb30];return _0x235472;};'use strict';var crypto=require(_0x9504('0x0'));var fs=require('fs');var BPromise=require(_0x9504('0x1'));var defaultOptions={'algorithm':_0x9504('0x2')};function combineOptions(_0x27d063){var _0x3a26a7={};for(var _0x454c1d in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x454c1d)){_0x3a26a7[_0x454c1d]=defaultOptions[_0x454c1d];}}if(_0x27d063){for(var _0x3ef9e6 in _0x27d063){if(_0x27d063[_0x9504('0x3')](_0x3ef9e6)){_0x3a26a7[_0x3ef9e6]=_0x27d063[_0x3ef9e6];}}}return _0x3a26a7;}exports[_0x9504('0x4')]=function(_0x279373,_0x2a9e04,_0x2c2512,_0x6d283a){return new BPromise(function(_0x4c0ad7,_0x1b6bde){_0x6d283a=combineOptions(_0x6d283a);var _0x2d5eb0=new Buffer(_0x2c2512);var _0x3ac276=fs[_0x9504('0x5')](_0x279373);var _0x33cefe=fs[_0x9504('0x6')](_0x2a9e04);var _0x405712=crypto[_0x9504('0x7')](_0x6d283a['algorithm'],_0x2d5eb0);_0x3ac276['on'](_0x9504('0x8'),function(_0x4f780d){var _0xd37b08=new Buffer(_0x405712[_0x9504('0x9')](_0x4f780d),_0x9504('0xa'));_0x33cefe[_0x9504('0xb')](_0xd37b08);});_0x3ac276['on'](_0x9504('0xc'),function(){try{var _0x1c443d=new Buffer(_0x405712['final'](_0x9504('0xa')),'binary');_0x33cefe[_0x9504('0xb')](_0x1c443d);_0x33cefe[_0x9504('0xc')]();_0x33cefe['on'](_0x9504('0xd'),function(){return _0x4c0ad7(_0x2a9e04);});}catch(_0x18fcee){fs[_0x9504('0xe')](_0x2a9e04);return _0x1b6bde(_0x18fcee);}});});};exports['decryptFile']=function(_0x46382e,_0x3c5145,_0x2b91d2,_0x3d5741){return new BPromise(function(_0x4d6a66,_0x26682e){_0x3d5741=combineOptions(_0x3d5741);var _0x1d46ef=new Buffer(_0x2b91d2);var _0x3628d0=fs[_0x9504('0x5')](_0x46382e);var _0x36e1fb=fs[_0x9504('0x6')](_0x3c5145);var _0x1a96d1=crypto[_0x9504('0xf')](_0x3d5741[_0x9504('0x10')],_0x1d46ef);_0x3628d0['on']('data',function(_0x27d544){var _0x476d8e=new Buffer(_0x1a96d1[_0x9504('0x9')](_0x27d544),'binary');_0x36e1fb[_0x9504('0xb')](_0x476d8e);});_0x3628d0['on'](_0x9504('0xc'),function(){try{var _0x491d1f=new Buffer(_0x1a96d1[_0x9504('0x11')](_0x9504('0xa')),_0x9504('0xa'));_0x36e1fb['write'](_0x491d1f);_0x36e1fb[_0x9504('0xc')]();_0x36e1fb['on']('close',function(){return _0x4d6a66(_0x3c5145);});}catch(_0x385fa4){fs['unlink'](_0x3c5145);return _0x26682e(_0x385fa4);}});});};
\ No newline at end of file
+var _0x3eb3=['hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm','data','update','binary','write','end','decryptFile','createReadStream','createDecipher','final','close','unlink','crypto','aes192'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0x3eb3,0x1ae));var _0x33eb=function(_0x22b7db,_0x179365){_0x22b7db=_0x22b7db-0x0;var _0x7db553=_0x3eb3[_0x22b7db];return _0x7db553;};'use strict';var crypto=require(_0x33eb('0x0'));var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x33eb('0x1')};function combineOptions(_0x3aae8a){var _0x11378d={};for(var _0x159836 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x159836)){_0x11378d[_0x159836]=defaultOptions[_0x159836];}}if(_0x3aae8a){for(var _0x505fa7 in _0x3aae8a){if(_0x3aae8a[_0x33eb('0x2')](_0x505fa7)){_0x11378d[_0x505fa7]=_0x3aae8a[_0x505fa7];}}}return _0x11378d;}exports[_0x33eb('0x3')]=function(_0x319d82,_0x3751eb,_0x2f1c08,_0x29b6d0){return new BPromise(function(_0x49480b,_0x5ac9a1){_0x29b6d0=combineOptions(_0x29b6d0);var _0x2ab2ea=new Buffer(_0x2f1c08);var _0x30ec24=fs['createReadStream'](_0x319d82);var _0x25e0a4=fs[_0x33eb('0x4')](_0x3751eb);var _0x4cd2cf=crypto[_0x33eb('0x5')](_0x29b6d0[_0x33eb('0x6')],_0x2ab2ea);_0x30ec24['on'](_0x33eb('0x7'),function(_0x512da7){var _0x51e8aa=new Buffer(_0x4cd2cf[_0x33eb('0x8')](_0x512da7),_0x33eb('0x9'));_0x25e0a4[_0x33eb('0xa')](_0x51e8aa);});_0x30ec24['on'](_0x33eb('0xb'),function(){try{var _0x42f30e=new Buffer(_0x4cd2cf['final'](_0x33eb('0x9')),_0x33eb('0x9'));_0x25e0a4['write'](_0x42f30e);_0x25e0a4[_0x33eb('0xb')]();_0x25e0a4['on']('close',function(){return _0x49480b(_0x3751eb);});}catch(_0x12fb6f){fs['unlink'](_0x3751eb);return _0x5ac9a1(_0x12fb6f);}});});};exports[_0x33eb('0xc')]=function(_0x4ee2bd,_0x49e8a1,_0x2685b8,_0x561c16){return new BPromise(function(_0x1762e1,_0x43d295){_0x561c16=combineOptions(_0x561c16);var _0x1b6803=new Buffer(_0x2685b8);var _0x42c281=fs[_0x33eb('0xd')](_0x4ee2bd);var _0x1f5cba=fs[_0x33eb('0x4')](_0x49e8a1);var _0x516c56=crypto[_0x33eb('0xe')](_0x561c16[_0x33eb('0x6')],_0x1b6803);_0x42c281['on'](_0x33eb('0x7'),function(_0xc9fd60){var _0x31ad88=new Buffer(_0x516c56[_0x33eb('0x8')](_0xc9fd60),_0x33eb('0x9'));_0x1f5cba[_0x33eb('0xa')](_0x31ad88);});_0x42c281['on']('end',function(){try{var _0x4b9d24=new Buffer(_0x516c56[_0x33eb('0xf')](_0x33eb('0x9')),_0x33eb('0x9'));_0x1f5cba['write'](_0x4b9d24);_0x1f5cba[_0x33eb('0xb')]();_0x1f5cba['on'](_0x33eb('0x10'),function(){return _0x1762e1(_0x49e8a1);});}catch(_0x180d1e){fs[_0x33eb('0x11')](_0x49e8a1);return _0x43d295(_0x180d1e);}});});};
\ No newline at end of file
diff --git a/server/components/export/csv.js b/server/components/export/csv.js
index 05a468f..0d6efd3 100644
--- a/server/components/export/csv.js
+++ b/server/components/export/csv.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x91a6=['../../config/logger','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','join','each','%s%d.%s','%s.%s','csv','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x91a6,0xda));var _0x691a=function(_0x1ac474,_0x45df28){_0x1ac474=_0x1ac474-0x0;var _0x43961f=_0x91a6[_0x1ac474];return _0x43961f;};'use strict';var util=require(_0x691a('0x0'));var path=require(_0x691a('0x1'));var _=require(_0x691a('0x2'));var csv=require(_0x691a('0x3'));var fs=require('fs');var BPromise=require(_0x691a('0x4'));var zipdir=require(_0x691a('0x5'));var rimraf=require('rimraf');var db=require(_0x691a('0x6'))['db'];var dbH=require(_0x691a('0x6'))['dbH'];var logger=require(_0x691a('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x691a('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x691a('0x8')][0x4];function analyticExtractedReport(_0x373e8c,_0x3f1ad4){var _0x3eda6c={'status':_0x373e8c};var _0x49509e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f1ad4){_0x3eda6c['savename']=_0x3f1ad4;}return db[_0x691a('0x9')][_0x691a('0xa')](_0x3eda6c,_0x49509e);}function main(){var _0x4835c3=0x1388;var _0x23303e;logger[_0x691a('0xb')](util['format'](_0x691a('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x691a('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x691a('0xe'),_0x691a('0xf')]})[_0x691a('0x10')](function(_0x1a949f){if(_0x1a949f){_0x23303e=_0x1a949f;_0x4835c3=_0x23303e[_0x691a('0xf')]||0x1388;}})['then'](function(){return dbH[_0x691a('0x11')][_0x691a('0x12')](util[_0x691a('0x13')](_0x691a('0x14'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x691a('0x15')]});})[_0x691a('0x10')](function(_0x5cd109){if(!_0x5cd109[0x0][_0x691a('0x16')]){return analyticExtractedReport(_0x691a('0x17'));}var _0x36cfed=[];var _0x46ee71=0x0;var _0x3d7891=!![];if(_0x5cd109&&_0x5cd109[_0x691a('0x18')]){var _0x332cf9=_0x5cd109[0x0][_0x691a('0x16')]%(_0x46ee71+_0x4835c3);if(_0x23303e['split']){for(;_0x3d7891;_0x46ee71+=_0x4835c3,_0x332cf9=_0x5cd109[0x0][_0x691a('0x16')]%(_0x46ee71+_0x4835c3)){if(_0x332cf9==0x0||_0x332cf9==_0x5cd109[0x0][_0x691a('0x16')]){_0x3d7891=![];}_0x36cfed[_0x691a('0x19')](dbH['sequelize']['query'](util[_0x691a('0x13')](_0x691a('0x1a'),QUERY,_0x4835c3,_0x46ee71),{'type':dbH[_0x691a('0x11')][_0x691a('0x1b')]['SELECT']}));}}else{_0x36cfed[_0x691a('0x19')](dbH[_0x691a('0x11')][_0x691a('0x12')](QUERY,{'type':dbH[_0x691a('0x11')][_0x691a('0x1b')][_0x691a('0x15')]}));}}var _0x39a3e3=path[_0x691a('0x1c')](PATH);var _0x90d9ec=path[_0x691a('0x1d')](PATH,_0x691a('0x1e'));var _0x14f0c8=_0x23303e[_0x691a('0xe')]&&_0x36cfed['length']>0x1;var _0x236bd4=[];if(!fs[_0x691a('0x1f')](path[_0x691a('0x20')](_0x39a3e3,_0x90d9ec))&&_0x14f0c8){fs['mkdirSync'](path[_0x691a('0x20')](_0x39a3e3,_0x90d9ec));}return BPromise[_0x691a('0x21')](_0x36cfed,function(_0x17941c){_0x236bd4['push'](_0x17941c);})[_0x691a('0x10')](function(){for(var _0x325395=0x0;_0x325395<_0x236bd4[_0x691a('0x18')];_0x325395+=0x1){var _0x230d03;var _0x2e268f=_0x236bd4[_0x325395];if(_0x14f0c8){_0x230d03=path[_0x691a('0x20')](_0x39a3e3,_0x90d9ec,util['format'](_0x691a('0x22'),_0x90d9ec,_0x325395,'csv'));}else{_0x230d03=path[_0x691a('0x20')](_0x39a3e3,util[_0x691a('0x13')](_0x691a('0x23'),_0x90d9ec,_0x691a('0x24')));}fs['writeFileSync'](_0x230d03,csv(_0x2e268f));}})['then'](function(){if(_0x14f0c8){zipdir(path[_0x691a('0x20')](_0x39a3e3,_0x90d9ec),{'saveTo':path[_0x691a('0x20')](_0x39a3e3,util['format'](_0x691a('0x23'),_0x90d9ec,_0x691a('0x25')))},function(_0x3c623c,_0x14c689){});rimraf(path[_0x691a('0x20')](_0x39a3e3,_0x90d9ec),function(){});}})[_0x691a('0x10')](function(){logger[_0x691a('0xb')](util['format'](_0x691a('0x26'),EXTRACTED_REPORT_ID,_0x691a('0x27')));return analyticExtractedReport(_0x691a('0x28'),_0x14f0c8?util[_0x691a('0x13')](_0x691a('0x23'),_0x90d9ec,_0x14f0c8?'zip':_0x691a('0x24')):null);});})[_0x691a('0x29')](function(_0x447f72){logger[_0x691a('0xb')](util['format'](_0x691a('0x2a'),EXTRACTED_REPORT_ID,_0x691a('0x27')),util[_0x691a('0x2b')](_0x447f72,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x691a('0x2c'));});}main();
\ No newline at end of file
+var _0xaf75=['bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','splitSizeCsv','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','split','num','QueryTypes','push','dirname','basename','.csv','existsSync','join','mkdirSync','each','csv','writeFileSync','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','inspect','Failed','util','lodash'];(function(_0x244c03,_0x474f8e){var _0x20df95=function(_0x5d0963){while(--_0x5d0963){_0x244c03['push'](_0x244c03['shift']());}};_0x20df95(++_0x474f8e);}(_0xaf75,0xe8));var _0x5af7=function(_0x46df42,_0x4916de){_0x46df42=_0x46df42-0x0;var _0x3eda6f=_0xaf75[_0x46df42];return _0x3eda6f;};'use strict';var util=require(_0x5af7('0x0'));var path=require('path');var _=require(_0x5af7('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x5af7('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x5af7('0x3'))['db'];var dbH=require(_0x5af7('0x3'))[_0x5af7('0x4')];var logger=require(_0x5af7('0x5'))(_0x5af7('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x5af7('0x7')][0x3];var PATH=process[_0x5af7('0x7')][0x4];function analyticExtractedReport(_0x345a4b,_0xa455b2){var _0x28d982={'status':_0x345a4b};var _0x586968={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa455b2){_0x28d982[_0x5af7('0x8')]=_0xa455b2;}return db['AnalyticExtractedReport']['update'](_0x28d982,_0x586968);}function main(){var _0x314519=0x1388;var _0x1bb14a;logger[_0x5af7('0x9')](util['format'](_0x5af7('0xa'),EXTRACTED_REPORT_ID,_0x5af7('0xb')));return db['Setting'][_0x5af7('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x5af7('0xd')]})[_0x5af7('0xe')](function(_0x335c73){if(_0x335c73){_0x1bb14a=_0x335c73;_0x314519=_0x1bb14a[_0x5af7('0xd')]||0x1388;}})[_0x5af7('0xe')](function(){return dbH['sequelize'][_0x5af7('0xf')](util[_0x5af7('0x10')](_0x5af7('0x11'),QUERY),{'type':dbH[_0x5af7('0x12')]['QueryTypes'][_0x5af7('0x13')]});})['then'](function(_0x49113e){if(!_0x49113e[0x0]['num']){return analyticExtractedReport('Empty');}var _0x58d3f2=[];var _0x43dd69=0x0;var _0x5a11ad=!![];if(_0x49113e&&_0x49113e['length']){var _0x2485d7=_0x49113e[0x0]['num']%(_0x43dd69+_0x314519);if(_0x1bb14a[_0x5af7('0x14')]){for(;_0x5a11ad;_0x43dd69+=_0x314519,_0x2485d7=_0x49113e[0x0][_0x5af7('0x15')]%(_0x43dd69+_0x314519)){if(_0x2485d7==0x0||_0x2485d7==_0x49113e[0x0][_0x5af7('0x15')]){_0x5a11ad=![];}_0x58d3f2['push'](dbH[_0x5af7('0x12')][_0x5af7('0xf')](util[_0x5af7('0x10')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x314519,_0x43dd69),{'type':dbH[_0x5af7('0x12')][_0x5af7('0x16')][_0x5af7('0x13')]}));}}else{_0x58d3f2[_0x5af7('0x17')](dbH[_0x5af7('0x12')]['query'](QUERY,{'type':dbH[_0x5af7('0x12')][_0x5af7('0x16')][_0x5af7('0x13')]}));}}var _0x484af3=path[_0x5af7('0x18')](PATH);var _0x4f5784=path[_0x5af7('0x19')](PATH,_0x5af7('0x1a'));var _0x4466f9=_0x1bb14a[_0x5af7('0x14')]&&_0x58d3f2['length']>0x1;var _0x124308=[];if(!fs[_0x5af7('0x1b')](path[_0x5af7('0x1c')](_0x484af3,_0x4f5784))&&_0x4466f9){fs[_0x5af7('0x1d')](path[_0x5af7('0x1c')](_0x484af3,_0x4f5784));}return BPromise[_0x5af7('0x1e')](_0x58d3f2,function(_0x156a18){_0x124308[_0x5af7('0x17')](_0x156a18);})['then'](function(){for(var _0x5f24d2=0x0;_0x5f24d2<_0x124308['length'];_0x5f24d2+=0x1){var _0x10205c;var _0x2b2894=_0x124308[_0x5f24d2];if(_0x4466f9){_0x10205c=path[_0x5af7('0x1c')](_0x484af3,_0x4f5784,util[_0x5af7('0x10')]('%s%d.%s',_0x4f5784,_0x5f24d2,_0x5af7('0x1f')));}else{_0x10205c=path['join'](_0x484af3,util[_0x5af7('0x10')]('%s.%s',_0x4f5784,'csv'));}fs[_0x5af7('0x20')](_0x10205c,csv(_0x2b2894));}})[_0x5af7('0xe')](function(){if(_0x4466f9){zipdir(path[_0x5af7('0x1c')](_0x484af3,_0x4f5784),{'saveTo':path[_0x5af7('0x1c')](_0x484af3,util[_0x5af7('0x10')](_0x5af7('0x21'),_0x4f5784,_0x5af7('0x22')))},function(_0x2026b9,_0x3d9c3b){});rimraf(path['join'](_0x484af3,_0x4f5784),function(){});}})['then'](function(){logger[_0x5af7('0x9')](util[_0x5af7('0x10')](_0x5af7('0x23'),EXTRACTED_REPORT_ID,_0x5af7('0xb')));return analyticExtractedReport(_0x5af7('0x24'),_0x4466f9?util[_0x5af7('0x10')](_0x5af7('0x21'),_0x4f5784,_0x4466f9?_0x5af7('0x22'):_0x5af7('0x1f')):null);});})['catch'](function(_0x4694f4){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x5af7('0xb')),util[_0x5af7('0x25')](_0x4694f4,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x5af7('0x26'));});}main();
\ No newline at end of file
diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js
index 6b9519d..8b82c8d 100644
--- a/server/components/export/pdf.js
+++ b/server/components/export/pdf.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8c4a=['Setting','find','split','splitSizePdf','then','length','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','join','mkdirSync','each','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','landscape','header','black','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','error','log','err','zip','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','bluebird','util','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','hasOwnProperty','num','Empty','basename','.pdf'];(function(_0x4b373a,_0x3fc14e){var _0x1a5312=function(_0x1d8590){while(--_0x1d8590){_0x4b373a['push'](_0x4b373a['shift']());}};_0x1a5312(++_0x3fc14e);}(_0x8c4a,0x72));var _0xa8c4=function(_0x521ad0,_0x5f0fb4){_0x521ad0=_0x521ad0-0x0;var _0x8c0e72=_0x8c4a[_0x521ad0];return _0x8c0e72;};'use strict';var _=require('lodash');var fs=require('fs');var BPromise=require(_0xa8c4('0x0'));var util=require(_0xa8c4('0x1'));var path=require('path');var moment=require(_0xa8c4('0x2'));var PdfPrinter=require(_0xa8c4('0x3'));var zipdir=require(_0xa8c4('0x4'));var rimraf=require(_0xa8c4('0x5'));var db=require(_0xa8c4('0x6'))['db'];var dbH=require(_0xa8c4('0x6'))['dbH'];var logger=require(_0xa8c4('0x7'))(_0xa8c4('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xa8c4('0x9')][0x2]);var QUERY=process[_0xa8c4('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xa8c4('0x9')][0x5];var FORMAT=_0xa8c4('0xa');var _extractedReport;function analyticExtractedReport(_0x23cd1f,_0x188615){var _0x552f96={'status':_0x23cd1f};var _0x34d29c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x188615){_0x552f96['savename']=_0x188615;}return db[_0xa8c4('0xb')][_0xa8c4('0xc')](_0x552f96,_0x34d29c);}function getHeader(_0x197a0a){var _0x19db89=[];for(var _0x14360f in _0x197a0a){if(_0x197a0a[_0xa8c4('0xd')](_0x14360f)){_0x19db89['push']({'text':_0x14360f,'style':'tableHeader'});}}return _0x19db89;}function extractReport(_0x431eeb){var _0x54a606=0x1388;var _0x3fc8ae;if(!_0x431eeb[0x0][_0xa8c4('0xe')]){return analyticExtractedReport(_0xa8c4('0xf'));}var _0x571264=[];var _0x31f9fb=0x0;var _0x2f3621=!![];var _0xd06876=path['dirname'](PATH);var _0x125ff8=path[_0xa8c4('0x10')](PATH,_0xa8c4('0x11'));var _0x34abe1=![];var _0x51a86c=[];return db[_0xa8c4('0x12')][_0xa8c4('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa8c4('0x14'),_0xa8c4('0x15')]})[_0xa8c4('0x16')](function(_0x2f1092){if(_0x2f1092){_0x3fc8ae=_0x2f1092;_0x54a606=_0x3fc8ae['splitSizePdf']||0x3e8;}})[_0xa8c4('0x16')](function(){if(_0x431eeb&&_0x431eeb[_0xa8c4('0x17')]){var _0x3c3575=_0x431eeb[0x0]['num']%(_0x31f9fb+_0x54a606);if(_0x3fc8ae[_0xa8c4('0x14')]){for(;_0x2f3621;_0x31f9fb+=_0x54a606,_0x3c3575=_0x431eeb[0x0][_0xa8c4('0xe')]%(_0x31f9fb+_0x54a606)){if(_0x3c3575==0x0||_0x3c3575==_0x431eeb[0x0][_0xa8c4('0xe')]){_0x2f3621=![];}_0x571264['push'](dbH[_0xa8c4('0x18')][_0xa8c4('0x19')](util[_0xa8c4('0x1a')](_0xa8c4('0x1b'),QUERY,_0x54a606,_0x31f9fb),{'type':dbH[_0xa8c4('0x18')][_0xa8c4('0x1c')][_0xa8c4('0x1d')]}));}}else{_0x571264['push'](dbH[_0xa8c4('0x18')][_0xa8c4('0x19')](QUERY,{'type':dbH[_0xa8c4('0x18')]['QueryTypes'][_0xa8c4('0x1d')]}));}}_0x34abe1=_0x3fc8ae[_0xa8c4('0x14')]&&_0x571264[_0xa8c4('0x17')]>0x1;if(!fs['existsSync'](path[_0xa8c4('0x1e')](_0xd06876,_0x125ff8))&&_0x34abe1){fs[_0xa8c4('0x1f')](path['join'](_0xd06876,_0x125ff8));}return BPromise[_0xa8c4('0x20')](_0x571264,function(_0xeaea0b){_0x51a86c[_0xa8c4('0x21')](_0xeaea0b);});})[_0xa8c4('0x16')](function(){return BPromise[_0xa8c4('0x20')](_0x571264,function(_0xd748b3,_0x5771af){var _0x55d267;var _0x87090a=util['format'](_0xa8c4('0x22'),NAME,_extractedReport[_0xa8c4('0x23')],moment(_extractedReport[_0xa8c4('0x24')])[_0xa8c4('0x1a')](FORMAT),moment(_extractedReport[_0xa8c4('0x25')])['format'](FORMAT));var _0x3eae12={'pageSize':'A4','pageOrientation':_0xa8c4('0x26'),'content':[{'text':_0x87090a,'style':_0xa8c4('0x27')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa8c4('0x28')}}};var _0x14b0bd={'headerRows':0x1,'body':[]};_0x14b0bd[_0xa8c4('0x29')][_0xa8c4('0x21')](getHeader(_0xd748b3[0x0]));var _0x15cd02;for(var _0x4ee77a=0x0;_0x4ee77a<_0xd748b3[_0xa8c4('0x17')];_0x4ee77a+=0x1){_0x15cd02=[];for(var _0x47d7e5 in _0xd748b3[_0x4ee77a]){if(_0xd748b3[_0x4ee77a]['hasOwnProperty'](_0x47d7e5)){_0x15cd02[_0xa8c4('0x21')](_0xd748b3[_0x4ee77a][_0x47d7e5]?_[_0xa8c4('0x2a')](_0xd748b3[_0x4ee77a][_0x47d7e5]):'');}}_0x14b0bd['body'][_0xa8c4('0x21')](_0x15cd02);}_0x3eae12[_0xa8c4('0x2b')][_0xa8c4('0x21')]({'table':_0x14b0bd});return new BPromise(function(_0x49b3bf,_0x18c808){var _0x19e8d7=new PdfPrinter({'Roboto':{'normal':__dirname+_0xa8c4('0x2c'),'bold':__dirname+_0xa8c4('0x2d'),'italics':__dirname+_0xa8c4('0x2e'),'bolditalics':__dirname+'/fonts/Roboto-MediumItalic.ttf'}});var _0x58efd5=_0x19e8d7[_0xa8c4('0x2f')](_0x3eae12);if(_0x34abe1){_0x55d267=path[_0xa8c4('0x1e')](_0xd06876,_0x125ff8,util[_0xa8c4('0x1a')]('%s%d.%s',_0x125ff8,_0x5771af,_0xa8c4('0x30')));}else{_0x55d267=path[_0xa8c4('0x1e')](_0xd06876,util[_0xa8c4('0x1a')](_0xa8c4('0x31'),_0x125ff8,_0xa8c4('0x30')));}var _0x30c274=_0x58efd5[_0xa8c4('0x32')](fs[_0xa8c4('0x33')](_0x55d267));_0x30c274['on'](_0xa8c4('0x34'),function(){_0x49b3bf();});_0x30c274['on'](_0xa8c4('0x35'),function(_0x336c18){console[_0xa8c4('0x36')](_0xa8c4('0x37'),_0x336c18);_0x18c808(_0x336c18);});_0x58efd5['end']();});});})['then'](function(){if(_0x34abe1){return new BPromise(function(_0x300e1a,_0x3eccc7){zipdir(path[_0xa8c4('0x1e')](_0xd06876,_0x125ff8),{'saveTo':path[_0xa8c4('0x1e')](_0xd06876,util['format'](_0xa8c4('0x31'),_0x125ff8,_0xa8c4('0x38')))},function(_0x3d5676){if(_0x3d5676){_0x3eccc7(_0x3d5676);}else{_0x300e1a();}});});}})['then'](function(){if(_0x34abe1){rimraf(path[_0xa8c4('0x1e')](_0xd06876,_0x125ff8),function(){});}})[_0xa8c4('0x16')](function(){logger[_0xa8c4('0x39')](util[_0xa8c4('0x1a')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xa8c4('0x3a')));return analyticExtractedReport(_0xa8c4('0x3b'),_0x34abe1?util['format'](_0xa8c4('0x31'),_0x125ff8,_0x34abe1?_0xa8c4('0x38'):_0xa8c4('0x30')):null);});}function main(){logger[_0xa8c4('0x39')](util[_0xa8c4('0x1a')](_0xa8c4('0x3c'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xa8c4('0xb')][_0xa8c4('0x3d')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa8c4('0x16')](function(_0x5bc656){_extractedReport=_0x5bc656;return dbH[_0xa8c4('0x18')]['query'](util[_0xa8c4('0x1a')](_0xa8c4('0x3e'),QUERY),{'type':dbH[_0xa8c4('0x18')][_0xa8c4('0x1c')][_0xa8c4('0x1d')]});})[_0xa8c4('0x16')](extractReport)[_0xa8c4('0x3f')](function(_0x56e6df){logger[_0xa8c4('0x39')](util['format'](_0xa8c4('0x40'),EXTRACTED_REPORT_ID,'PDF'),util[_0xa8c4('0x41')](_0x56e6df,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
+var _0xd0cd=['CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','lodash','bluebird','util','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','splitSizePdf','then','push','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','split','length','existsSync','mkdirSync','join','each','name','startDate','endDate','landscape','header','black','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','createPdfKitDocument','%s%d.%s','%s.%s','pdf','pipe','createWriteStream','error','log','end','zip','info'];(function(_0x96eae0,_0x5f1c50){var _0x3d63fb=function(_0x2a0cf2){while(--_0x2a0cf2){_0x96eae0['push'](_0x96eae0['shift']());}};_0x3d63fb(++_0x5f1c50);}(_0xd0cd,0x163));var _0xdd0c=function(_0x587845,_0x3115b9){_0x587845=_0x587845-0x0;var _0x1c2292=_0xd0cd[_0x587845];return _0x1c2292;};'use strict';var _=require(_0xdd0c('0x0'));var fs=require('fs');var BPromise=require(_0xdd0c('0x1'));var util=require(_0xdd0c('0x2'));var path=require('path');var moment=require(_0xdd0c('0x3'));var PdfPrinter=require(_0xdd0c('0x4'));var zipdir=require(_0xdd0c('0x5'));var rimraf=require(_0xdd0c('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xdd0c('0x7'))[_0xdd0c('0x8')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xdd0c('0x9')][0x2]);var QUERY=process[_0xdd0c('0x9')][0x3];var PATH=process[_0xdd0c('0x9')][0x4];var NAME=process[_0xdd0c('0x9')][0x5];var FORMAT=_0xdd0c('0xa');var _extractedReport;function analyticExtractedReport(_0x495bf9,_0xc7d399){var _0x48aaa4={'status':_0x495bf9};var _0x3b36b9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xc7d399){_0x48aaa4[_0xdd0c('0xb')]=_0xc7d399;}return db['AnalyticExtractedReport'][_0xdd0c('0xc')](_0x48aaa4,_0x3b36b9);}function getHeader(_0x3089d7){var _0x11d1e1=[];for(var _0x2544d3 in _0x3089d7){if(_0x3089d7[_0xdd0c('0xd')](_0x2544d3)){_0x11d1e1['push']({'text':_0x2544d3,'style':_0xdd0c('0xe')});}}return _0x11d1e1;}function extractReport(_0x260395){var _0x21cace=0x1388;var _0x5b0e3a;if(!_0x260395[0x0][_0xdd0c('0xf')]){return analyticExtractedReport(_0xdd0c('0x10'));}var _0x12e21b=[];var _0x5f354b=0x0;var _0x6c5546=!![];var _0x57604e=path[_0xdd0c('0x11')](PATH);var _0xb88e03=path[_0xdd0c('0x12')](PATH,_0xdd0c('0x13'));var _0x59d4f6=![];var _0x2a8131=[];return db[_0xdd0c('0x14')][_0xdd0c('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xdd0c('0x16')]})[_0xdd0c('0x17')](function(_0x5b77f4){if(_0x5b77f4){_0x5b0e3a=_0x5b77f4;_0x21cace=_0x5b0e3a[_0xdd0c('0x16')]||0x3e8;}})[_0xdd0c('0x17')](function(){if(_0x260395&&_0x260395['length']){var _0x330603=_0x260395[0x0][_0xdd0c('0xf')]%(_0x5f354b+_0x21cace);if(_0x5b0e3a['split']){for(;_0x6c5546;_0x5f354b+=_0x21cace,_0x330603=_0x260395[0x0][_0xdd0c('0xf')]%(_0x5f354b+_0x21cace)){if(_0x330603==0x0||_0x330603==_0x260395[0x0][_0xdd0c('0xf')]){_0x6c5546=![];}_0x12e21b[_0xdd0c('0x18')](dbH[_0xdd0c('0x19')][_0xdd0c('0x1a')](util[_0xdd0c('0x1b')](_0xdd0c('0x1c'),QUERY,_0x21cace,_0x5f354b),{'type':dbH[_0xdd0c('0x19')][_0xdd0c('0x1d')]['SELECT']}));}}else{_0x12e21b[_0xdd0c('0x18')](dbH[_0xdd0c('0x19')]['query'](QUERY,{'type':dbH[_0xdd0c('0x19')][_0xdd0c('0x1d')]['SELECT']}));}}_0x59d4f6=_0x5b0e3a[_0xdd0c('0x1e')]&&_0x12e21b[_0xdd0c('0x1f')]>0x1;if(!fs[_0xdd0c('0x20')](path['join'](_0x57604e,_0xb88e03))&&_0x59d4f6){fs[_0xdd0c('0x21')](path[_0xdd0c('0x22')](_0x57604e,_0xb88e03));}return BPromise[_0xdd0c('0x23')](_0x12e21b,function(_0x3b0a34){_0x2a8131[_0xdd0c('0x18')](_0x3b0a34);});})[_0xdd0c('0x17')](function(){return BPromise[_0xdd0c('0x23')](_0x12e21b,function(_0x32aac7,_0x1295d5){var _0x4bd1ef;var _0x5a0e98=util[_0xdd0c('0x1b')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xdd0c('0x24')],moment(_extractedReport[_0xdd0c('0x25')])[_0xdd0c('0x1b')](FORMAT),moment(_extractedReport[_0xdd0c('0x26')])['format'](FORMAT));var _0x57b677={'pageSize':'A4','pageOrientation':_0xdd0c('0x27'),'content':[{'text':_0x5a0e98,'style':_0xdd0c('0x28')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xdd0c('0x29')}}};var _0x1339ac={'headerRows':0x1,'body':[]};_0x1339ac[_0xdd0c('0x2a')][_0xdd0c('0x18')](getHeader(_0x32aac7[0x0]));var _0x377eaf;for(var _0x581e8b=0x0;_0x581e8b<_0x32aac7[_0xdd0c('0x1f')];_0x581e8b+=0x1){_0x377eaf=[];for(var _0x5f3af5 in _0x32aac7[_0x581e8b]){if(_0x32aac7[_0x581e8b][_0xdd0c('0xd')](_0x5f3af5)){_0x377eaf[_0xdd0c('0x18')](_0x32aac7[_0x581e8b][_0x5f3af5]?_[_0xdd0c('0x2b')](_0x32aac7[_0x581e8b][_0x5f3af5]):'');}}_0x1339ac[_0xdd0c('0x2a')]['push'](_0x377eaf);}_0x57b677[_0xdd0c('0x2c')][_0xdd0c('0x18')]({'table':_0x1339ac});return new BPromise(function(_0xa8b0df,_0x23bfdc){var _0x3dd80f=new PdfPrinter({'Roboto':{'normal':__dirname+_0xdd0c('0x2d'),'bold':__dirname+_0xdd0c('0x2e'),'italics':__dirname+_0xdd0c('0x2f'),'bolditalics':__dirname+'/fonts/Roboto-MediumItalic.ttf'}});var _0x3df2a3=_0x3dd80f[_0xdd0c('0x30')](_0x57b677);if(_0x59d4f6){_0x4bd1ef=path[_0xdd0c('0x22')](_0x57604e,_0xb88e03,util[_0xdd0c('0x1b')](_0xdd0c('0x31'),_0xb88e03,_0x1295d5,'pdf'));}else{_0x4bd1ef=path[_0xdd0c('0x22')](_0x57604e,util[_0xdd0c('0x1b')](_0xdd0c('0x32'),_0xb88e03,_0xdd0c('0x33')));}var _0x9dc414=_0x3df2a3[_0xdd0c('0x34')](fs[_0xdd0c('0x35')](_0x4bd1ef));_0x9dc414['on']('finish',function(){_0xa8b0df();});_0x9dc414['on'](_0xdd0c('0x36'),function(_0x1a93bd){console[_0xdd0c('0x37')]('err',_0x1a93bd);_0x23bfdc(_0x1a93bd);});_0x3df2a3[_0xdd0c('0x38')]();});});})['then'](function(){if(_0x59d4f6){return new BPromise(function(_0x82152a,_0x35617e){zipdir(path[_0xdd0c('0x22')](_0x57604e,_0xb88e03),{'saveTo':path[_0xdd0c('0x22')](_0x57604e,util['format'](_0xdd0c('0x32'),_0xb88e03,_0xdd0c('0x39')))},function(_0xa54c50){if(_0xa54c50){_0x35617e(_0xa54c50);}else{_0x82152a();}});});}})['then'](function(){if(_0x59d4f6){rimraf(path['join'](_0x57604e,_0xb88e03),function(){});}})[_0xdd0c('0x17')](function(){logger[_0xdd0c('0x3a')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xdd0c('0x3b')));return analyticExtractedReport(_0xdd0c('0x3c'),_0x59d4f6?util[_0xdd0c('0x1b')]('%s.%s',_0xb88e03,_0x59d4f6?_0xdd0c('0x39'):'pdf'):null);});}function main(){logger[_0xdd0c('0x3a')](util[_0xdd0c('0x1b')](_0xdd0c('0x3d'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0xdd0c('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xdd0c('0x17')](function(_0x148c08){_extractedReport=_0x148c08;return dbH[_0xdd0c('0x19')]['query'](util[_0xdd0c('0x1b')](_0xdd0c('0x3f'),QUERY),{'type':dbH[_0xdd0c('0x19')][_0xdd0c('0x1d')]['SELECT']});})[_0xdd0c('0x17')](extractReport)[_0xdd0c('0x40')](function(_0x170802){logger[_0xdd0c('0x3a')](util[_0xdd0c('0x1b')](_0xdd0c('0x41'),EXTRACTED_REPORT_ID,_0xdd0c('0x42')),util[_0xdd0c('0x43')](_0x170802,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xdd0c('0x44'));});}main();
\ No newline at end of file
diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js
index 65d7269..1706bac 100644
--- a/server/components/export/xlsx.js
+++ b/server/components/export/xlsx.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9a7=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','mkdirSync','join','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','Failed','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','split','length','push'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xa9a7,0x1bf));var _0x7a9a=function(_0x29b398,_0x6f6888){_0x29b398=_0x29b398-0x0;var _0x379b4b=_0xa9a7[_0x29b398];return _0x379b4b;};'use strict';var util=require('util');var path=require('path');var _=require(_0x7a9a('0x0'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x7a9a('0x1'));var zipdir=require(_0x7a9a('0x2'));var rimraf=require('rimraf');var db=require(_0x7a9a('0x3'))['db'];var dbH=require(_0x7a9a('0x3'))[_0x7a9a('0x4')];var logger=require(_0x7a9a('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7a9a('0x6')][0x2]);var QUERY=process[_0x7a9a('0x6')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x539852,_0x12f328){var _0x33007b={'status':_0x539852};var _0x48be35={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x12f328){_0x33007b[_0x7a9a('0x7')]=_0x12f328;}return db[_0x7a9a('0x8')][_0x7a9a('0x9')](_0x33007b,_0x48be35);}function main(){var _0x241327=0x1388;var _0x2b06eb;logger[_0x7a9a('0xa')](util[_0x7a9a('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7a9a('0xc')));return db[_0x7a9a('0xd')][_0x7a9a('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x7a9a('0xf')]})['then'](function(_0x4060dc){if(_0x4060dc){_0x2b06eb=_0x4060dc;_0x241327=_0x2b06eb[_0x7a9a('0xf')]||0x1388;}})[_0x7a9a('0x10')](function(){return dbH[_0x7a9a('0x11')][_0x7a9a('0x12')](util[_0x7a9a('0xb')](_0x7a9a('0x13'),QUERY),{'type':dbH[_0x7a9a('0x11')]['QueryTypes'][_0x7a9a('0x14')]});})['then'](function(_0x511879){if(!_0x511879[0x0][_0x7a9a('0x15')]){return analyticExtractedReport(_0x7a9a('0x16'));}var _0x2691fe=[];var _0x5d6246=0x0;var _0x5b9682=!![];if(_0x2b06eb[_0x7a9a('0x17')]){if(_0x511879&&_0x511879[_0x7a9a('0x18')]){var _0x52c7d0=_0x511879[0x0][_0x7a9a('0x15')]%(_0x5d6246+_0x241327);for(;_0x5b9682;_0x5d6246+=_0x241327,_0x52c7d0=_0x511879[0x0]['num']%(_0x5d6246+_0x241327)){if(_0x52c7d0==0x0||_0x52c7d0==_0x511879[0x0]['num']){_0x5b9682=![];}_0x2691fe[_0x7a9a('0x19')](dbH[_0x7a9a('0x11')][_0x7a9a('0x12')](util[_0x7a9a('0xb')](_0x7a9a('0x1a'),QUERY,_0x241327,_0x5d6246),{'type':dbH[_0x7a9a('0x11')][_0x7a9a('0x1b')][_0x7a9a('0x14')]}));}}}else{_0x2691fe[_0x7a9a('0x19')](dbH['sequelize'][_0x7a9a('0x12')](QUERY,{'type':dbH[_0x7a9a('0x11')][_0x7a9a('0x1b')][_0x7a9a('0x14')]}));}var _0x1b318c=path[_0x7a9a('0x1c')](PATH);var _0x4fc41f=path[_0x7a9a('0x1d')](PATH,'.xlsx');var _0x231e51=_0x2b06eb[_0x7a9a('0x17')]&&_0x2691fe[_0x7a9a('0x18')]>0x1;var _0x4e0c63=[];if(!fs[_0x7a9a('0x1e')](path['join'](_0x1b318c,_0x4fc41f))&&_0x231e51){fs[_0x7a9a('0x1f')](path[_0x7a9a('0x20')](_0x1b318c,_0x4fc41f));}return BPromise['each'](_0x2691fe,function(_0x4e38ae){_0x4e0c63[_0x7a9a('0x19')](_0x4e38ae);})[_0x7a9a('0x10')](function(){for(var _0x3f4c87=0x0;_0x3f4c87<_0x4e0c63[_0x7a9a('0x18')];_0x3f4c87+=0x1){var _0x46b6d5;var _0x22ccbe=_0x4e0c63[_0x3f4c87];if(_0x231e51){_0x46b6d5=path['join'](_0x1b318c,_0x4fc41f,util[_0x7a9a('0xb')](_0x7a9a('0x21'),_0x4fc41f,_0x3f4c87,'xlsx'));}else{_0x46b6d5=path[_0x7a9a('0x20')](_0x1b318c,util[_0x7a9a('0xb')]('%s.%s',_0x4fc41f,_0x7a9a('0x22')));}fs[_0x7a9a('0x23')](_0x46b6d5,json2xls(_0x22ccbe),_0x7a9a('0x24'));}})[_0x7a9a('0x10')](function(){if(_0x231e51){zipdir(path[_0x7a9a('0x20')](_0x1b318c,_0x4fc41f),{'saveTo':path['join'](_0x1b318c,util[_0x7a9a('0xb')](_0x7a9a('0x25'),_0x4fc41f,_0x7a9a('0x26')))},function(_0x165f84,_0x512247){});rimraf(path[_0x7a9a('0x20')](_0x1b318c,_0x4fc41f),function(){});}})[_0x7a9a('0x10')](function(){logger[_0x7a9a('0xa')](util['format'](_0x7a9a('0x27'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x231e51?util[_0x7a9a('0xb')](_0x7a9a('0x25'),_0x4fc41f,_0x231e51?'zip':_0x7a9a('0x22')):null);});})[_0x7a9a('0x28')](function(_0x139190){logger[_0x7a9a('0xa')](util[_0x7a9a('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0x7a9a('0x29')](_0x139190,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x7a9a('0x2a'));});}main();
\ No newline at end of file
+var _0x78d8=['update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.xlsx','existsSync','mkdirSync','join','xlsx','%s.%s','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','analytics','argv','AnalyticExtractedReport'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0x78d8,0xf2));var _0x878d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x78d8[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x878d('0x0'));var path=require(_0x878d('0x1'));var _=require(_0x878d('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x878d('0x3'));var zipdir=require(_0x878d('0x4'));var rimraf=require(_0x878d('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x878d('0x6'))['dbH'];var logger=require('../../config/logger')(_0x878d('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x878d('0x8')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x69bd0d,_0x411b70){var _0xc6392d={'status':_0x69bd0d};var _0x2b8c0b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x411b70){_0xc6392d['savename']=_0x411b70;}return db[_0x878d('0x9')][_0x878d('0xa')](_0xc6392d,_0x2b8c0b);}function main(){var _0x314abd=0x1388;var _0x42e61f;logger[_0x878d('0xb')](util[_0x878d('0xc')](_0x878d('0xd'),EXTRACTED_REPORT_ID,_0x878d('0xe')));return db['Setting'][_0x878d('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x878d('0x10'),'splitSizeXlsx']})['then'](function(_0x12ca34){if(_0x12ca34){_0x42e61f=_0x12ca34;_0x314abd=_0x42e61f['splitSizeXlsx']||0x1388;}})[_0x878d('0x11')](function(){return dbH['sequelize'][_0x878d('0x12')](util[_0x878d('0xc')](_0x878d('0x13'),QUERY),{'type':dbH[_0x878d('0x14')]['QueryTypes'][_0x878d('0x15')]});})[_0x878d('0x11')](function(_0x3ec892){if(!_0x3ec892[0x0][_0x878d('0x16')]){return analyticExtractedReport('Empty');}var _0x3c63b1=[];var _0x109bb6=0x0;var _0x2487e1=!![];if(_0x42e61f[_0x878d('0x10')]){if(_0x3ec892&&_0x3ec892[_0x878d('0x17')]){var _0x4f4376=_0x3ec892[0x0][_0x878d('0x16')]%(_0x109bb6+_0x314abd);for(;_0x2487e1;_0x109bb6+=_0x314abd,_0x4f4376=_0x3ec892[0x0][_0x878d('0x16')]%(_0x109bb6+_0x314abd)){if(_0x4f4376==0x0||_0x4f4376==_0x3ec892[0x0][_0x878d('0x16')]){_0x2487e1=![];}_0x3c63b1[_0x878d('0x18')](dbH[_0x878d('0x14')][_0x878d('0x12')](util['format'](_0x878d('0x19'),QUERY,_0x314abd,_0x109bb6),{'type':dbH[_0x878d('0x14')][_0x878d('0x1a')][_0x878d('0x15')]}));}}}else{_0x3c63b1[_0x878d('0x18')](dbH[_0x878d('0x14')][_0x878d('0x12')](QUERY,{'type':dbH[_0x878d('0x14')][_0x878d('0x1a')][_0x878d('0x15')]}));}var _0x593322=path[_0x878d('0x1b')](PATH);var _0x2eb20c=path['basename'](PATH,_0x878d('0x1c'));var _0x230897=_0x42e61f[_0x878d('0x10')]&&_0x3c63b1[_0x878d('0x17')]>0x1;var _0x32ee94=[];if(!fs[_0x878d('0x1d')](path['join'](_0x593322,_0x2eb20c))&&_0x230897){fs[_0x878d('0x1e')](path[_0x878d('0x1f')](_0x593322,_0x2eb20c));}return BPromise['each'](_0x3c63b1,function(_0x742672){_0x32ee94[_0x878d('0x18')](_0x742672);})[_0x878d('0x11')](function(){for(var _0x51b488=0x0;_0x51b488<_0x32ee94[_0x878d('0x17')];_0x51b488+=0x1){var _0x4b6329;var _0x55e13e=_0x32ee94[_0x51b488];if(_0x230897){_0x4b6329=path[_0x878d('0x1f')](_0x593322,_0x2eb20c,util[_0x878d('0xc')]('%s%d.%s',_0x2eb20c,_0x51b488,_0x878d('0x20')));}else{_0x4b6329=path[_0x878d('0x1f')](_0x593322,util['format'](_0x878d('0x21'),_0x2eb20c,_0x878d('0x20')));}fs['writeFileSync'](_0x4b6329,json2xls(_0x55e13e),_0x878d('0x22'));}})[_0x878d('0x11')](function(){if(_0x230897){zipdir(path['join'](_0x593322,_0x2eb20c),{'saveTo':path['join'](_0x593322,util[_0x878d('0xc')](_0x878d('0x21'),_0x2eb20c,_0x878d('0x23')))},function(_0x4683fe,_0x30e829){});rimraf(path[_0x878d('0x1f')](_0x593322,_0x2eb20c),function(){});}})[_0x878d('0x11')](function(){logger[_0x878d('0xb')](util[_0x878d('0xc')](_0x878d('0x24'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x878d('0x25'),_0x230897?util[_0x878d('0xc')]('%s.%s',_0x2eb20c,_0x230897?_0x878d('0x23'):'xlsx'):null);});})[_0x878d('0x26')](function(_0x1b4cf4){logger['info'](util['format'](_0x878d('0x27'),EXTRACTED_REPORT_ID,_0x878d('0xe')),util[_0x878d('0x28')](_0x1b4cf4,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x878d('0x29'));});}main();
\ No newline at end of file
diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js
index 6882e3e..f1e9188 100644
--- a/server/components/extensions/rewrite.js
+++ b/server/components/extensions/rewrite.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x583b=['length','interval','*,*,*,*','intervals','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','catch','error','rewrite','Interval','then','models','findAll','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','extension','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x583b,0x174));var _0xb583=function(_0x5f5497,_0x50803a){_0x5f5497=_0x5f5497-0x0;var _0x10e943=_0x583b[_0x5f5497];return _0x10e943;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x116db4,_0x2b9e38){var _0x3d73ba=this;return _0x116db4['models'][_0xb583('0x0')]['findAll']({'raw':!![]})[_0xb583('0x1')](function(_0x3de958){_0x3d73ba['intervals']=_0x3de958;return _0x116db4[_0xb583('0x2')]['VoiceExtension'][_0xb583('0x3')]({'where':{'IntervalId':_0x2b9e38[_0xb583('0x4')]},'raw':!![]});})[_0xb583('0x1')](function(_0x3a1d04){return _0x116db4[_0xb583('0x2')][_0xb583('0x5')][_0xb583('0x3')]({'where':{'exten':{'$in':_[_0xb583('0x6')](_[_0xb583('0x7')](_0x3a1d04,_0xb583('0x8')))}},'order':[{'raw':_0xb583('0x9')}],'raw':!![]});})[_0xb583('0x1')](function(_0x25c6c4){var _0x5c1c5a=_[_0xb583('0xa')](_0x25c6c4,{'priority':'1'});var _0x352708=_[_0xb583('0xa')](_0x25c6c4,{'isApp':0x1});var _0x49dfc1=_[_0xb583('0xb')](_0x352708,'exten');var _0x176e10=[_0xb583('0xc'),_0xb583('0xd')];var _0x49cba0=[];var _0x4b99fa=[];for(var _0x38c8c6 in _0x49dfc1){if(_0x49dfc1[_0xb583('0xe')](_0x38c8c6)){_0x3d73ba[_0xb583('0xf')]=0x2;_0x3d73ba[_0xb583('0x10')]=[];_0x3d73ba['extension']=_['find'](_0x5c1c5a,{'exten':_0x49dfc1[_0x38c8c6][0x0]['exten']});_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':util[_0xb583('0x14')](_0xb583('0x15'),_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')]),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0]['exten'],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});if(_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')]===_0xb583('0x18')){if(_0x3d73ba[_0xb583('0x19')]){_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x1a')+(_0x3d73ba[_0xb583('0x19')]['cutdigits']?_0xb583('0x1b')+_0x3d73ba[_0xb583('0x19')][_0xb583('0x1c')]+'}':_0xb583('0x1d')),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});}_0x3d73ba[_0xb583('0x10')]['push']({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x1e')+_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')],'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0]['exten'],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0]['VoiceExtensionId']});var _0x494f9e=_0x3d73ba[_0xb583('0xf')]++;_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0]['type'],'app':_0xb583('0x1f'),'appdata':_0xb583('0x20')+(_0x494f9e+0x2)+'):Goto('+(_0x494f9e+0x1)+')','context':_0x49dfc1[_0x38c8c6][0x0]['context'],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x494f9e,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});if(_0x3d73ba[_0xb583('0x19')]){_0x3d73ba['extensions'][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0x3d73ba[_0xb583('0x19')][_0xb583('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x3d73ba[_0xb583('0x19')][_0xb583('0x1c')]+'}':_0xb583('0x21'),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba['priority']++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});}_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x22')+_0x49dfc1[_0x38c8c6][0x0]['VoiceExtensionId'],'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});if(_0x3d73ba['extension']&&_0x3d73ba['extension'][_0xb583('0xe')](_0xb583('0x23'))&&_0x3d73ba['extension']['recordingFormat']!=='none'){_0x3d73ba['extensions'][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x24'),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x25')+_0x3d73ba[_0xb583('0x19')][_0xb583('0x23')]||_0xb583('0x26'),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});}}_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x27'),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba['priority']++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});_0x3d73ba[_0xb583('0x10')]['push']({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x28'),'context':_0x49dfc1[_0x38c8c6][0x0]['context'],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x29'),'context':_0x49dfc1[_0x38c8c6][0x0]['context'],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0]['VoiceExtensionId']});for(var _0x4b7d05=0x0,_0x50904b=0x0;_0x4b7d05<_0x49dfc1[_0x38c8c6][_0xb583('0x2a')];_0x4b7d05+=0x1,_0x50904b=0x0){var _0x2f92e5=_0x49dfc1[_0x38c8c6][_0x4b7d05];if(_0x2f92e5[_0xb583('0x12')]){_0x2f92e5[_0xb583('0x12')]=_0x2f92e5[_0xb583('0x12')]['toLowerCase']();}var _0x12e79d=[];var _0xb12dbc=[];delete _0x2f92e5['id'];delete _0x2f92e5['createdAt'];delete _0x2f92e5['updatedAt'];var _0x4f5489=_0x2f92e5[_0xb583('0x2b')]!==_0xb583('0x2c')?[_0x2f92e5[_0xb583('0x2b')]]:_0x2f92e5[_0xb583('0x4')]?_[_0xb583('0x7')](_['filter'](_0x3d73ba[_0xb583('0x2d')],{'IntervalId':_0x2f92e5[_0xb583('0x4')]}),_0xb583('0x2b')):[];if(_0x2f92e5[_0xb583('0xe')]('tag')){if(_0x2f92e5[_0xb583('0x2e')]&&_0x2f92e5[_0xb583('0x2e')]!=='--'){_0x12e79d[_0xb583('0x11')]({'type':_0x2f92e5[_0xb583('0x12')],'app':'Set','appdata':'CDR(tag)='+_0x2f92e5['tag'],'context':_0x2f92e5['context'],'exten':_0x2f92e5[_0xb583('0x8')],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba[_0xb583('0xf')]+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});}}if(_0x2f92e5[_0xb583('0x12')]===_0xb583('0x18')&&_0x2f92e5['hasOwnProperty'](_0xb583('0x2f'))){if(_0x2f92e5[_0xb583('0x2f')]){_0x12e79d[_0xb583('0x11')]({'type':_0x2f92e5[_0xb583('0x12')],'app':_0xb583('0x1f'),'appdata':_0xb583('0x30')+_0x2f92e5[_0xb583('0x2f')]+')','context':_0x2f92e5['context'],'exten':_0x2f92e5[_0xb583('0x8')],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba[_0xb583('0xf')]+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});}else{_0x12e79d['push']({'type':_0x2f92e5[_0xb583('0x12')],'app':_0xb583('0x1f'),'appdata':_0xb583('0x31'),'context':_0x2f92e5[_0xb583('0x16')],'exten':_0x2f92e5['exten'],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba['priority']+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});}}if(_0x2f92e5[_0xb583('0xe')](_0xb583('0x32'))){if(_0x176e10[_0xb583('0x33')](_0x2f92e5[_0xb583('0x34')][_0xb583('0x35')]())>=0x0&&_0x2f92e5[_0xb583('0x36')]!==_0xb583('0x37')){if(_0x2f92e5['answer']){_0x12e79d[_0xb583('0x11')]({'type':_0x2f92e5[_0xb583('0x12')],'app':_0xb583('0x1f'),'appdata':_0xb583('0x38'),'context':_0x2f92e5['context'],'exten':_0x2f92e5['exten'],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba[_0xb583('0xf')]+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});_0x12e79d[_0xb583('0x11')]({'type':_0x2f92e5['type'],'app':_0xb583('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2f92e5[_0xb583('0x16')],'exten':_0x2f92e5['exten'],'priority':_0x4f5489['length']+_0x3d73ba['priority']+_0x50904b++,'VoiceExtensionId':_0x2f92e5['VoiceExtensionId']});}else{_0x12e79d[_0xb583('0x11')]({'type':_0x2f92e5[_0xb583('0x12')],'app':_0xb583('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2f92e5[_0xb583('0x16')],'exten':_0x2f92e5[_0xb583('0x8')],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba[_0xb583('0xf')]+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});_0x12e79d['push']({'type':_0x2f92e5[_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x39'),'context':_0x2f92e5[_0xb583('0x16')],'exten':_0x2f92e5['exten'],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba[_0xb583('0xf')]+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});}}}for(var _0x227be4=0x0;_0x227be4<_0x4f5489[_0xb583('0x2a')];_0x227be4+=0x1){var _0x2b8b56=_0x3d73ba[_0xb583('0xf')]+_0x4f5489['length'];var _0x481425=_0x227be4===_0x4f5489[_0xb583('0x2a')]-0x1?_0x3d73ba['priority']+_0x12e79d[_0xb583('0x2a')]+_0xb12dbc['length']+0x2:_0x3d73ba[_0xb583('0xf')]+_0x227be4+0x1;_0x12e79d[_0xb583('0x3a')](_0x227be4,0x0,{'type':_0x2f92e5['type'],'app':_0xb583('0x3b'),'appdata':_0x4f5489[_0x227be4]+'?'+_0x2f92e5[_0xb583('0x16')]+',${EXTEN},'+_0x2b8b56+':'+_0x2f92e5[_0xb583('0x16')]+_0xb583('0x3c')+_0x481425,'exten':_0x2f92e5[_0xb583('0x8')],'context':_0x2f92e5['context'],'priority':_0x3d73ba['priority']+_0x227be4,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});}_0x2f92e5[_0xb583('0xf')]=_0x12e79d['length']?_['last'](_0x12e79d)[_0xb583('0xf')]+0x1:_0x3d73ba[_0xb583('0xf')];_0x3d73ba['priority']=(_0xb12dbc[_0xb583('0x2a')]?_[_0xb583('0x3d')](_0xb12dbc)[_0xb583('0xf')]:_0x2f92e5['priority'])+0x1;_0x3d73ba['extensions']=_[_0xb583('0x3e')](_0x3d73ba[_0xb583('0x10')],_0x12e79d,[_0x2f92e5],_0xb12dbc);}_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x3f'),'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'context':_0x49dfc1[_0x38c8c6][0x0]['context'],'priority':_0x3d73ba[_0xb583('0xf')],'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0]['VoiceExtensionId']});_0x49cba0[_0xb583('0x11')](_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]);_0x4b99fa=_['concat'](_0x4b99fa,_0x3d73ba['extensions']);}}return _0x116db4[_0xb583('0x40')](function(_0x61cb0c){return _0x116db4[_0xb583('0x2')][_0xb583('0x5')][_0xb583('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x49cba0}},'transaction':_0x61cb0c})[_0xb583('0x1')](function(_0x59f51e){return _0x116db4['models']['VoiceExtension']['bulkCreate'](_['sortBy'](_0x4b99fa,_0xb583('0xf')),{'transaction':_0x61cb0c});});});})[_0xb583('0x42')](function(_0x3f9b9b){console[_0xb583('0x43')](_0x3f9b9b);});}exports[_0xb583('0x44')]=rewrite;
\ No newline at end of file
+var _0x10d4=['ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','intervals','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','error','rewrite','lodash','util','Interval','then','models','VoiceExtension','findAll','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','priority','extensions','extension','Set','format','context','type','outbound','push','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','VoiceExtensionId','CDR(routeid)='];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x10d4,0x13f));var _0x410d=function(_0x3b5bca,_0x326805){_0x3b5bca=_0x3b5bca-0x0;var _0x39833=_0x10d4[_0x3b5bca];return _0x39833;};'use strict';var _=require(_0x410d('0x0'));var util=require(_0x410d('0x1'));function rewrite(_0x40bb2d,_0x557089){var _0x58c67a=this;return _0x40bb2d['models'][_0x410d('0x2')]['findAll']({'raw':!![]})[_0x410d('0x3')](function(_0x49bfa0){_0x58c67a['intervals']=_0x49bfa0;return _0x40bb2d[_0x410d('0x4')][_0x410d('0x5')][_0x410d('0x6')]({'where':{'IntervalId':_0x557089[_0x410d('0x7')]},'raw':!![]});})[_0x410d('0x3')](function(_0x500abd){return _0x40bb2d[_0x410d('0x4')][_0x410d('0x5')][_0x410d('0x6')]({'where':{'exten':{'$in':_[_0x410d('0x8')](_[_0x410d('0x9')](_0x500abd,'exten'))}},'order':[{'raw':_0x410d('0xa')}],'raw':!![]});})[_0x410d('0x3')](function(_0x2d2e11){var _0x2b3c1d=_['filter'](_0x2d2e11,{'priority':'1'});var _0x52384f=_[_0x410d('0xb')](_0x2d2e11,{'isApp':0x1});var _0x42ed5d=_[_0x410d('0xc')](_0x52384f,_0x410d('0xd'));var _0x21d033=[_0x410d('0xe'),_0x410d('0xf')];var _0x5d4642=[];var _0x3e8234=[];for(var _0x300108 in _0x42ed5d){if(_0x42ed5d['hasOwnProperty'](_0x300108)){_0x58c67a[_0x410d('0x10')]=0x2;_0x58c67a[_0x410d('0x11')]=[];_0x58c67a[_0x410d('0x12')]=_['find'](_0x2b3c1d,{'exten':_0x42ed5d[_0x300108][0x0][_0x410d('0xd')]});_0x58c67a[_0x410d('0x11')]['push']({'type':_0x42ed5d[_0x300108][0x0]['type'],'app':_0x410d('0x13'),'appdata':util[_0x410d('0x14')]('CDR(type)=%s',_0x42ed5d[_0x300108][0x0]['type']),'context':_0x42ed5d[_0x300108][0x0][_0x410d('0x15')],'exten':_0x42ed5d[_0x300108][0x0][_0x410d('0xd')],'priority':_0x58c67a[_0x410d('0x10')]++,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0]['VoiceExtensionId']});if(_0x42ed5d[_0x300108][0x0][_0x410d('0x16')]===_0x410d('0x17')){if(_0x58c67a[_0x410d('0x12')]){_0x58c67a['extensions'][_0x410d('0x18')]({'type':_0x42ed5d[_0x300108][0x0][_0x410d('0x16')],'app':_0x410d('0x13'),'appdata':_0x410d('0x19')+(_0x58c67a[_0x410d('0x12')]['cutdigits']?_0x410d('0x1a')+_0x58c67a['extension'][_0x410d('0x1b')]+'}':_0x410d('0x1c')),'context':_0x42ed5d[_0x300108][0x0][_0x410d('0x15')],'exten':_0x42ed5d[_0x300108][0x0]['exten'],'priority':_0x58c67a[_0x410d('0x10')]++,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0][_0x410d('0x1d')]});}_0x58c67a['extensions'][_0x410d('0x18')]({'type':_0x42ed5d[_0x300108][0x0][_0x410d('0x16')],'app':_0x410d('0x13'),'appdata':_0x410d('0x1e')+_0x42ed5d[_0x300108][0x0]['VoiceExtensionId'],'context':_0x42ed5d[_0x300108][0x0][_0x410d('0x15')],'exten':_0x42ed5d[_0x300108][0x0]['exten'],'priority':_0x58c67a['priority']++,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0]['VoiceExtensionId']});var _0x5284d5=_0x58c67a[_0x410d('0x10')]++;_0x58c67a[_0x410d('0x11')]['push']({'type':_0x42ed5d[_0x300108][0x0][_0x410d('0x16')],'app':_0x410d('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5284d5+0x2)+_0x410d('0x20')+(_0x5284d5+0x1)+')','context':_0x42ed5d[_0x300108][0x0]['context'],'exten':_0x42ed5d[_0x300108][0x0][_0x410d('0xd')],'priority':_0x5284d5,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0][_0x410d('0x1d')]});if(_0x58c67a[_0x410d('0x12')]){_0x58c67a['extensions'][_0x410d('0x18')]({'type':_0x42ed5d[_0x300108][0x0][_0x410d('0x16')],'app':_0x410d('0x13'),'appdata':_0x58c67a[_0x410d('0x12')][_0x410d('0x1b')]?_0x410d('0x21')+_0x58c67a[_0x410d('0x12')][_0x410d('0x1b')]+'}':_0x410d('0x22'),'context':_0x42ed5d[_0x300108][0x0]['context'],'exten':_0x42ed5d[_0x300108][0x0][_0x410d('0xd')],'priority':_0x58c67a['priority']++,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0][_0x410d('0x1d')]});}_0x58c67a[_0x410d('0x11')][_0x410d('0x18')]({'type':_0x42ed5d[_0x300108][0x0]['type'],'app':_0x410d('0x13'),'appdata':_0x410d('0x23')+_0x42ed5d[_0x300108][0x0][_0x410d('0x1d')],'context':_0x42ed5d[_0x300108][0x0][_0x410d('0x15')],'exten':_0x42ed5d[_0x300108][0x0][_0x410d('0xd')],'priority':_0x58c67a[_0x410d('0x10')]++,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0][_0x410d('0x1d')]});if(_0x58c67a[_0x410d('0x12')]&&_0x58c67a[_0x410d('0x12')][_0x410d('0x24')](_0x410d('0x25'))&&_0x58c67a[_0x410d('0x12')][_0x410d('0x25')]!=='none'){_0x58c67a[_0x410d('0x11')][_0x410d('0x18')]({'type':_0x42ed5d[_0x300108][0x0]['type'],'app':'Set','appdata':_0x410d('0x26'),'context':_0x42ed5d[_0x300108][0x0][_0x410d('0x15')],'exten':_0x42ed5d[_0x300108][0x0][_0x410d('0xd')],'priority':_0x58c67a['priority']++,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0][_0x410d('0x1d')]});_0x58c67a[_0x410d('0x11')][_0x410d('0x18')]({'type':_0x42ed5d[_0x300108][0x0]['type'],'app':_0x410d('0x13'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x58c67a['extension'][_0x410d('0x25')]||_0x410d('0x27'),'context':_0x42ed5d[_0x300108][0x0]['context'],'exten':_0x42ed5d[_0x300108][0x0][_0x410d('0xd')],'priority':_0x58c67a[_0x410d('0x10')]++,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0][_0x410d('0x1d')]});}}_0x58c67a[_0x410d('0x11')][_0x410d('0x18')]({'type':_0x42ed5d[_0x300108][0x0]['type'],'app':_0x410d('0x13'),'appdata':_0x410d('0x28'),'context':_0x42ed5d[_0x300108][0x0][_0x410d('0x15')],'exten':_0x42ed5d[_0x300108][0x0][_0x410d('0xd')],'priority':_0x58c67a[_0x410d('0x10')]++,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0][_0x410d('0x1d')]});_0x58c67a[_0x410d('0x11')]['push']({'type':_0x42ed5d[_0x300108][0x0][_0x410d('0x16')],'app':'Set','appdata':_0x410d('0x29'),'context':_0x42ed5d[_0x300108][0x0]['context'],'exten':_0x42ed5d[_0x300108][0x0]['exten'],'priority':_0x58c67a[_0x410d('0x10')]++,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0][_0x410d('0x1d')]});_0x58c67a[_0x410d('0x11')][_0x410d('0x18')]({'type':_0x42ed5d[_0x300108][0x0][_0x410d('0x16')],'app':_0x410d('0x13'),'appdata':_0x410d('0x2a'),'context':_0x42ed5d[_0x300108][0x0][_0x410d('0x15')],'exten':_0x42ed5d[_0x300108][0x0][_0x410d('0xd')],'priority':_0x58c67a[_0x410d('0x10')]++,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0][_0x410d('0x1d')]});for(var _0x59ada4=0x0,_0x339b42=0x0;_0x59ada4<_0x42ed5d[_0x300108][_0x410d('0x2b')];_0x59ada4+=0x1,_0x339b42=0x0){var _0x577d54=_0x42ed5d[_0x300108][_0x59ada4];if(_0x577d54[_0x410d('0x16')]){_0x577d54[_0x410d('0x16')]=_0x577d54['type'][_0x410d('0x2c')]();}var _0x1cb516=[];var _0x606277=[];delete _0x577d54['id'];delete _0x577d54[_0x410d('0x2d')];delete _0x577d54['updatedAt'];var _0x872d7c=_0x577d54[_0x410d('0x2e')]!==_0x410d('0x2f')?[_0x577d54[_0x410d('0x2e')]]:_0x577d54[_0x410d('0x7')]?_[_0x410d('0x9')](_[_0x410d('0xb')](_0x58c67a[_0x410d('0x30')],{'IntervalId':_0x577d54[_0x410d('0x7')]}),_0x410d('0x2e')):[];if(_0x577d54[_0x410d('0x24')](_0x410d('0x31'))){if(_0x577d54[_0x410d('0x31')]&&_0x577d54[_0x410d('0x31')]!=='--'){_0x1cb516['push']({'type':_0x577d54[_0x410d('0x16')],'app':_0x410d('0x13'),'appdata':'CDR(tag)='+_0x577d54['tag'],'context':_0x577d54[_0x410d('0x15')],'exten':_0x577d54['exten'],'priority':_0x872d7c[_0x410d('0x2b')]+_0x58c67a[_0x410d('0x10')]+_0x339b42++,'VoiceExtensionId':_0x577d54[_0x410d('0x1d')]});}}if(_0x577d54[_0x410d('0x16')]===_0x410d('0x17')&&_0x577d54[_0x410d('0x24')](_0x410d('0x32'))){if(_0x577d54[_0x410d('0x32')]){_0x1cb516[_0x410d('0x18')]({'type':_0x577d54[_0x410d('0x16')],'app':_0x410d('0x1f'),'appdata':_0x410d('0x33')+_0x577d54[_0x410d('0x32')]+')','context':_0x577d54[_0x410d('0x15')],'exten':_0x577d54[_0x410d('0xd')],'priority':_0x872d7c['length']+_0x58c67a['priority']+_0x339b42++,'VoiceExtensionId':_0x577d54[_0x410d('0x1d')]});}else{_0x1cb516[_0x410d('0x18')]({'type':_0x577d54[_0x410d('0x16')],'app':'ExecIf','appdata':_0x410d('0x34'),'context':_0x577d54[_0x410d('0x15')],'exten':_0x577d54[_0x410d('0xd')],'priority':_0x872d7c[_0x410d('0x2b')]+_0x58c67a[_0x410d('0x10')]+_0x339b42++,'VoiceExtensionId':_0x577d54[_0x410d('0x1d')]});}}if(_0x577d54['hasOwnProperty'](_0x410d('0x35'))){if(_0x21d033['indexOf'](_0x577d54[_0x410d('0x36')][_0x410d('0x2c')]())>=0x0&&_0x577d54[_0x410d('0x37')]!==_0x410d('0x38')){if(_0x577d54[_0x410d('0x35')]){_0x1cb516[_0x410d('0x18')]({'type':_0x577d54['type'],'app':_0x410d('0x1f'),'appdata':_0x410d('0x39'),'context':_0x577d54[_0x410d('0x15')],'exten':_0x577d54[_0x410d('0xd')],'priority':_0x872d7c[_0x410d('0x2b')]+_0x58c67a[_0x410d('0x10')]+_0x339b42++,'VoiceExtensionId':_0x577d54[_0x410d('0x1d')]});_0x1cb516[_0x410d('0x18')]({'type':_0x577d54[_0x410d('0x16')],'app':_0x410d('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x577d54[_0x410d('0x15')],'exten':_0x577d54[_0x410d('0xd')],'priority':_0x872d7c[_0x410d('0x2b')]+_0x58c67a[_0x410d('0x10')]+_0x339b42++,'VoiceExtensionId':_0x577d54[_0x410d('0x1d')]});}else{_0x1cb516[_0x410d('0x18')]({'type':_0x577d54['type'],'app':'ExecIf','appdata':_0x410d('0x3a'),'context':_0x577d54['context'],'exten':_0x577d54[_0x410d('0xd')],'priority':_0x872d7c[_0x410d('0x2b')]+_0x58c67a['priority']+_0x339b42++,'VoiceExtensionId':_0x577d54[_0x410d('0x1d')]});_0x1cb516['push']({'type':_0x577d54['type'],'app':_0x410d('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x577d54[_0x410d('0x15')],'exten':_0x577d54[_0x410d('0xd')],'priority':_0x872d7c[_0x410d('0x2b')]+_0x58c67a[_0x410d('0x10')]+_0x339b42++,'VoiceExtensionId':_0x577d54['VoiceExtensionId']});}}}for(var _0x52c49a=0x0;_0x52c49a<_0x872d7c[_0x410d('0x2b')];_0x52c49a+=0x1){var _0x53e6da=_0x58c67a['priority']+_0x872d7c['length'];var _0xf978d9=_0x52c49a===_0x872d7c[_0x410d('0x2b')]-0x1?_0x58c67a[_0x410d('0x10')]+_0x1cb516[_0x410d('0x2b')]+_0x606277['length']+0x2:_0x58c67a['priority']+_0x52c49a+0x1;_0x1cb516[_0x410d('0x3b')](_0x52c49a,0x0,{'type':_0x577d54[_0x410d('0x16')],'app':_0x410d('0x3c'),'appdata':_0x872d7c[_0x52c49a]+'?'+_0x577d54[_0x410d('0x15')]+',${EXTEN},'+_0x53e6da+':'+_0x577d54[_0x410d('0x15')]+_0x410d('0x3d')+_0xf978d9,'exten':_0x577d54['exten'],'context':_0x577d54[_0x410d('0x15')],'priority':_0x58c67a['priority']+_0x52c49a,'VoiceExtensionId':_0x42ed5d[_0x300108][0x0]['VoiceExtensionId']});}_0x577d54[_0x410d('0x10')]=_0x1cb516[_0x410d('0x2b')]?_[_0x410d('0x3e')](_0x1cb516)['priority']+0x1:_0x58c67a['priority'];_0x58c67a[_0x410d('0x10')]=(_0x606277[_0x410d('0x2b')]?_[_0x410d('0x3e')](_0x606277)[_0x410d('0x10')]:_0x577d54[_0x410d('0x10')])+0x1;_0x58c67a[_0x410d('0x11')]=_[_0x410d('0x3f')](_0x58c67a[_0x410d('0x11')],_0x1cb516,[_0x577d54],_0x606277);}_0x58c67a[_0x410d('0x11')][_0x410d('0x18')]({'type':_0x42ed5d[_0x300108][0x0][_0x410d('0x16')],'app':_0x410d('0x40'),'exten':_0x42ed5d[_0x300108][0x0][_0x410d('0xd')],'context':_0x42ed5d[_0x300108][0x0][_0x410d('0x15')],'priority':_0x58c67a[_0x410d('0x10')],'VoiceExtensionId':_0x42ed5d[_0x300108][0x0]['VoiceExtensionId']});_0x5d4642['push'](_0x42ed5d[_0x300108][0x0][_0x410d('0x1d')]);_0x3e8234=_[_0x410d('0x3f')](_0x3e8234,_0x58c67a[_0x410d('0x11')]);}}return _0x40bb2d[_0x410d('0x41')](function(_0x4430e9){return _0x40bb2d[_0x410d('0x4')]['VoiceExtension'][_0x410d('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x5d4642}},'transaction':_0x4430e9})[_0x410d('0x3')](function(_0x419247){return _0x40bb2d['models'][_0x410d('0x5')][_0x410d('0x43')](_['sortBy'](_0x3e8234,_0x410d('0x10')),{'transaction':_0x4430e9});});});})['catch'](function(_0x1c4826){console[_0x410d('0x44')](_0x1c4826);});}exports[_0x410d('0x45')]=rewrite;
\ No newline at end of file
diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js
index 34eab0a..0ce8591 100644
--- a/server/components/import/cm/csv.js
+++ b/server/components/import/cm/csv.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b18=['insert','into','fromQuery','str','calleridnum','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get','always','push','query','VoiceQueueId','onlyIfOpen','sequelize','all','outbound','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','CompanyId','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','stringify','checkHopper','scheduledAt','ContactId','ListId','createdAt','updatedAt','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?'];(function(_0x4aa728,_0x3e3220){var _0x73886f=function(_0x12b830){while(--_0x12b830){_0x4aa728['push'](_0x4aa728['shift']());}};_0x73886f(++_0x3e3220);}(_0x0b18,0x96));var _0x80b1=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0x0b18[_0x81f000];return _0x337aa2;};'use strict';var BPromise=require(_0x80b1('0x0'));var util=require(_0x80b1('0x1'));var _=require(_0x80b1('0x2'));var fs=require('fs');var squel=require(_0x80b1('0x3'));var Papa=require(_0x80b1('0x4'));var Redis=require('ioredis');var db=require(_0x80b1('0x5'))['db'];var config=require(_0x80b1('0x6'));var logger=require('../../../config/logger')('api');config['redis']=_[_0x80b1('0x7')](config[_0x80b1('0x8')],{'host':_0x80b1('0x9'),'port':0x18eb});var socket=require(_0x80b1('0xa'))(new Redis(config[_0x80b1('0x8')]));require(_0x80b1('0xb'))[_0x80b1('0xc')](socket);try{if(!process['argv'][0x2]||process[_0x80b1('0xd')][0x2]===_0x80b1('0xe')||process[_0x80b1('0xd')][0x2]===_0x80b1('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x80b1('0xd')][0x2];if(!process[_0x80b1('0xd')][0x3]||process['argv'][0x3]===_0x80b1('0xe')||process[_0x80b1('0xd')][0x3]==='null'||!process[_0x80b1('0xd')][0x4]||process['argv'][0x4]===_0x80b1('0xe')||process[_0x80b1('0xd')][0x4]===_0x80b1('0xf')){throw new Error(_0x80b1('0x10'));}var FIELDS=_[_0x80b1('0x11')](process['argv'][0x3][_0x80b1('0x12')](','),process[_0x80b1('0xd')][0x4][_0x80b1('0x12')](','));if(!process[_0x80b1('0xd')][0x5]||process[_0x80b1('0xd')][0x5]===_0x80b1('0xe')||process['argv'][0x5]===_0x80b1('0xf')){throw new Error(_0x80b1('0x13'));}var LISTID=process[_0x80b1('0xd')][0x5];var COMPANYID=process[_0x80b1('0xd')][0x6]&&process['argv'][0x6]!=='undefined'&&process['argv'][0x6]!==_0x80b1('0xf')?process[_0x80b1('0xd')][0x6]:null;var DUPLICATES=process[_0x80b1('0xd')][0x7]&&process[_0x80b1('0xd')][0x7]!=='undefined'&&process[_0x80b1('0xd')][0x7]!==_0x80b1('0xf')?process[_0x80b1('0xd')][0x7]:null;if(!process[_0x80b1('0xd')][0x8]||process['argv'][0x8]===_0x80b1('0xe')||process[_0x80b1('0xd')][0x8]===_0x80b1('0xf')){throw new Error(_0x80b1('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4e1706){logger[_0x80b1('0x15')](_0x4e1706);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x1ea8c6,_0x4d11b4,_0x1968fe,_0x4f52da){var _0x3660ac={'message':_0x4d11b4};_0x3660ac[_0x1ea8c6]=!![];if(_0x1968fe){_0x3660ac['contact']=_0x1968fe;}if(_0x4f52da){_0x3660ac[_0x80b1('0x16')]=_0x4f52da;}return _0x3660ac;}function isEmail(_0x113238){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x80b1('0x17')](_0x113238);}function checkRow(_0x15307c,_0x4b4b1b,_0x49a4d0){return new BPromise(function(_0x26d069,_0x46e5d8){if(_[_0x80b1('0x18')](_0x15307c)){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),_0x80b1('0x19'),null,_0x49a4d0));}if(_0x15307c['errors']&&_0x15307c[_0x80b1('0x1a')][_0x80b1('0x1b')]){var _0x5e76f9=_['map'](_0x15307c[_0x80b1('0x1a')],_0x80b1('0x1c'))['join'](';');return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),_0x5e76f9,null,_0x49a4d0));}var _0x4dcb1d={};for(var _0x587ea1 in FIELDS){if(FIELDS[_0x80b1('0x1d')](_0x587ea1)&&FIELDS[_0x587ea1]){_0x4dcb1d[_0x587ea1]=_0x15307c['data'][0x0][FIELDS[_0x587ea1]]||_0x15307c[_0x80b1('0x1e')][0x0]['\ufeff'+FIELDS[_0x587ea1]];}}if(!_0x4dcb1d[_0x80b1('0x1f')]){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),_0x80b1('0x20'),null,_0x49a4d0));}if(!_0x4dcb1d[_0x80b1('0x21')]){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),_0x80b1('0x22'),null,_0x49a4d0));}if(_0x4dcb1d[_0x80b1('0x23')]){var _0xe9b1ae=moment(_0x4dcb1d['birthDate'],_0x80b1('0x24'));if(!_0xe9b1ae[_0x80b1('0x25')]()){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),_0x80b1('0x26'),null,_0x49a4d0));}}if(_0x4dcb1d['email']){if(!isEmail(_0x4dcb1d[_0x80b1('0x27')])){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x49a4d0));}}_0x4dcb1d['ListId']=LISTID;_0x4dcb1d[_0x80b1('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x80b1('0x1b')]&&_0x4b4b1b){var _0x8f04f6={};for(var _0x5d413d=0x0,_0xa263f7=DUPLICATES['length'];_0x5d413d<_0xa263f7;_0x5d413d+=0x1){_0x8f04f6[DUPLICATES[_0x5d413d]]=_0x4dcb1d[DUPLICATES[_0x5d413d]];}var _0x417c67=_['find'](_0x4b4b1b,_0x8f04f6);if(_0x417c67){return _0x46e5d8(handleCheckRowError('duplicate',_0x80b1('0x29'),_0x417c67,_0x49a4d0));}}return db[_0x80b1('0x2a')][_0x80b1('0x2b')](_0x4dcb1d,{'raw':!![],'hooks':![],'fields':_[_0x80b1('0x2c')](_0x4dcb1d)})[_0x80b1('0x2d')](function(_0x19d034){if(DUPLICATES&&DUPLICATES[_0x80b1('0x1b')]&&_0x4b4b1b){_0x4b4b1b['push'](_[_0x80b1('0x2e')](_0x4dcb1d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x19d034['id'];return _0x26d069();})[_0x80b1('0x2f')](function(_0x1b83ea){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x1b83ea[_0x80b1('0x1c')]||JSON[_0x80b1('0x30')](_0x1b83ea)),null,_0x49a4d0));});});}function checkHopper(){function _0x58eb04(){return function(_0x357a37){logger[_0x80b1('0x15')]('cmContact',_0x80b1('0x31'),util['inspect'](_0x357a37,{'showHidden':![],'depth':null}));};}var _0x544237=function(_0x42aa92,_0x42f2a7){var _0x5d3816=squel['insert']()['into']('cm_hopper')['fromQuery'](['phone',_0x80b1('0x32'),_0x80b1('0x33'),_0x80b1('0x34'),_0x42f2a7,_0x80b1('0x35'),_0x80b1('0x36')],squel['select']()[_0x80b1('0x37')](_0x80b1('0x21'),_0x80b1('0x21'))[_0x80b1('0x37')]('NOW()',_0x80b1('0x32'))[_0x80b1('0x37')]('id','ContactId')[_0x80b1('0x37')](LISTID[_0x80b1('0x38')](),_0x80b1('0x34'))[_0x80b1('0x37')](_0x42aa92['id'][_0x80b1('0x38')](),_0x42f2a7)[_0x80b1('0x37')](_0x80b1('0x39'),'createdAt')[_0x80b1('0x37')](_0x80b1('0x39'),_0x80b1('0x36'))[_0x80b1('0x3a')](_0x80b1('0x3b'))[_0x80b1('0x3c')](_0x80b1('0x3d'))['where'](_0x80b1('0x3e'),LISTID[_0x80b1('0x38')]())[_0x80b1('0x3c')](_0x80b1('0x3f'))['where'](_0x80b1('0x40'),squel[_0x80b1('0x41')]()[_0x80b1('0x37')](_0x80b1('0x21'))['from'](_0x80b1('0x42'))[_0x80b1('0x3c')](_0x42f2a7+_0x80b1('0x43'),_0x42aa92['id'][_0x80b1('0x38')]())))[_0x80b1('0x38')]();return _0x5d3816;};var _0x266558=function(_0x5850ec,_0x30e524){var _0x5efa44=squel[_0x80b1('0x44')]()[_0x80b1('0x45')](_0x80b1('0x42'))[_0x80b1('0x46')]([_0x80b1('0x21'),'scheduledAt',_0x80b1('0x33'),_0x80b1('0x34'),_0x30e524,'createdAt',_0x80b1('0x36')],squel[_0x80b1('0x41')]()[_0x80b1('0x37')]('phone',_0x80b1('0x21'))[_0x80b1('0x37')](_0x80b1('0x39'),_0x80b1('0x32'))[_0x80b1('0x37')]('id',_0x80b1('0x33'))[_0x80b1('0x37')](LISTID[_0x80b1('0x38')](),'ListId')[_0x80b1('0x37')](_0x5850ec['id']['toString'](),_0x30e524)[_0x80b1('0x37')]('NOW()',_0x80b1('0x35'))['field'](_0x80b1('0x39'),_0x80b1('0x36'))[_0x80b1('0x3a')](_0x80b1('0x3b'))['where'](_0x80b1('0x3d'))['where']('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x80b1('0x47')](hopperContacts))[_0x80b1('0x3c')](_0x80b1('0x3f'))['where'](_0x80b1('0x40'),squel['select']()[_0x80b1('0x37')](_0x80b1('0x48'))['from']('cm_hopper_final')[_0x80b1('0x3c')](_0x30e524+_0x80b1('0x43'),_0x5850ec['id'][_0x80b1('0x38')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x80b1('0x21'))[_0x80b1('0x3a')]('cm_hopper')[_0x80b1('0x3c')](_0x30e524+_0x80b1('0x43'),_0x5850ec['id'][_0x80b1('0x38')]())))['toString']();return _0x5efa44;};function _0x352fe4(_0x28b344,_0x6110b6){var _0x36690c=squel[_0x80b1('0x44')]()[_0x80b1('0x45')](_0x80b1('0x42'))[_0x80b1('0x46')](['phone',_0x80b1('0x32'),'ContactId',_0x80b1('0x34'),_0x6110b6,_0x80b1('0x35'),'updatedAt'],squel[_0x80b1('0x41')]()[_0x80b1('0x37')](_0x80b1('0x21'),'phone')['field'](_0x80b1('0x39'),'scheduledAt')['field']('id',_0x80b1('0x33'))['field'](LISTID[_0x80b1('0x38')](),_0x80b1('0x34'))[_0x80b1('0x37')](_0x28b344['id'][_0x80b1('0x38')](),_0x6110b6)[_0x80b1('0x37')]('NOW()',_0x80b1('0x35'))[_0x80b1('0x37')]('NOW()',_0x80b1('0x36'))[_0x80b1('0x3a')](_0x80b1('0x3b'))['where'](_0x80b1('0x3d'))['where'](_0x80b1('0x3e'),LISTID[_0x80b1('0x38')]())[_0x80b1('0x3c')](_0x80b1('0x49'),squel[_0x80b1('0x47')](hopperContacts))[_0x80b1('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x80b1('0x38')]();return _0x36690c;}function _0x195af4(_0x2f5f2b,_0x227ea9){var _0x5c7b2e=squel[_0x80b1('0x44')]()[_0x80b1('0x45')](_0x80b1('0x4a'))[_0x80b1('0x46')](['phone',_0x80b1('0x33'),_0x80b1('0x34'),_0x227ea9,_0x80b1('0x35'),_0x80b1('0x36')],squel[_0x80b1('0x41')]()[_0x80b1('0x37')](_0x80b1('0x21'),_0x80b1('0x21'))[_0x80b1('0x37')]('id',_0x80b1('0x33'))[_0x80b1('0x37')](LISTID[_0x80b1('0x38')](),_0x80b1('0x34'))[_0x80b1('0x37')](_0x2f5f2b['id']['toString'](),_0x227ea9)[_0x80b1('0x37')]('NOW()','createdAt')['field']('NOW()',_0x80b1('0x36'))[_0x80b1('0x3a')](_0x80b1('0x3b'))[_0x80b1('0x3c')](_0x80b1('0x3d'))[_0x80b1('0x3c')](_0x80b1('0x3e'),LISTID[_0x80b1('0x38')]())['where'](_0x80b1('0x49'),squel[_0x80b1('0x47')](hopperContacts))[_0x80b1('0x3c')](_0x80b1('0x3f')))[_0x80b1('0x38')]();return _0x5c7b2e;}return db[_0x80b1('0x4b')][_0x80b1('0x4c')]({'where':{'type':'outbound'},'attributes':['id',_0x80b1('0x4d')],'include':[{'model':db[_0x80b1('0x4e')],'as':_0x80b1('0x4f'),'where':{'id':LISTID}}]})[_0x80b1('0x2d')](function(_0x1aa7d7){var _0x1872dd=[];if(_0x1aa7d7){var _0x5ea402;for(var _0x11bc98=0x0,_0x4dafa1;_0x11bc98<_0x1aa7d7['length'];_0x11bc98+=0x1){_0x4dafa1=_0x1aa7d7[_0x11bc98][_0x80b1('0x50')]({'plain':!![]});switch(_0x4dafa1[_0x80b1('0x4d')]){case _0x80b1('0x51'):_0x1872dd[_0x80b1('0x52')](db['sequelize'][_0x80b1('0x53')](_0x266558(_0x4dafa1,_0x80b1('0x54')))['then'](function(){})[_0x80b1('0x2f')](_0x58eb04()));break;case _0x80b1('0x55'):_0x1872dd['push'](db[_0x80b1('0x56')][_0x80b1('0x53')](_0x544237(_0x4dafa1,'VoiceQueueId'))[_0x80b1('0x2d')](function(){})[_0x80b1('0x2f')](_0x58eb04()));break;default:_0x1872dd['push'](db['sequelize']['query'](_0x352fe4(_0x4dafa1,_0x80b1('0x54')))[_0x80b1('0x2d')](function(){})[_0x80b1('0x2f')](_0x58eb04()));}}}return _0x1872dd;})[_0x80b1('0x57')]()['then'](function(){return db[_0x80b1('0x4b')][_0x80b1('0x4c')]({'where':{'type':_0x80b1('0x58')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x80b1('0x59'),'where':{'id':LISTID}}]})[_0x80b1('0x2d')](function(_0x4dcea4){var _0x4ea9ae=[];if(_0x4dcea4){var _0x20d000;for(var _0x26943e=0x0,_0x4f1c27;_0x26943e<_0x4dcea4[_0x80b1('0x1b')];_0x26943e+=0x1){_0x4f1c27=_0x4dcea4[_0x26943e][_0x80b1('0x50')]({'plain':!![]});_0x4ea9ae[_0x80b1('0x52')](db[_0x80b1('0x56')][_0x80b1('0x53')](_0x195af4(_0x4f1c27,_0x80b1('0x54')))['then'](function(){})[_0x80b1('0x2f')](_0x58eb04()));}}return _0x4ea9ae;})['all']();})[_0x80b1('0x2d')](function(){return db[_0x80b1('0x5a')]['findAll']({'attributes':['id',_0x80b1('0x4d')],'include':[{'model':db[_0x80b1('0x4e')],'as':_0x80b1('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x380cd9){var _0x5c45c0=[];if(_0x380cd9){for(var _0x35e5db=0x0,_0x58f14f;_0x35e5db<_0x380cd9[_0x80b1('0x1b')];_0x35e5db+=0x1){_0x58f14f=_0x380cd9[_0x35e5db]['get']({'plain':!![]});switch(_0x58f14f['dialCheckDuplicateType']){case'always':_0x5c45c0[_0x80b1('0x52')](db['sequelize']['query'](_0x266558(_0x58f14f,_0x80b1('0x5b')))[_0x80b1('0x2d')](function(){})[_0x80b1('0x2f')](_0x58eb04()));break;case _0x80b1('0x55'):_0x5c45c0[_0x80b1('0x52')](db[_0x80b1('0x56')]['query'](_0x544237(_0x58f14f,_0x80b1('0x5b')))['then'](function(){})[_0x80b1('0x2f')](_0x58eb04()));break;default:_0x5c45c0[_0x80b1('0x52')](db['sequelize'][_0x80b1('0x53')](_0x352fe4(_0x58f14f,_0x80b1('0x5b')))['then'](function(){})[_0x80b1('0x2f')](_0x58eb04()));}}}return _0x5c45c0;})[_0x80b1('0x57')]();})[_0x80b1('0x2d')](function(){return db[_0x80b1('0x5a')][_0x80b1('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x80b1('0x4e')],'as':_0x80b1('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x107d66){var _0x346e30=[];if(_0x107d66){for(var _0xe42597=0x0,_0x22300d;_0xe42597<_0x107d66[_0x80b1('0x1b')];_0xe42597+=0x1){_0x22300d=_0x107d66[_0xe42597][_0x80b1('0x50')]({'plain':!![]});_0x346e30[_0x80b1('0x52')](db['sequelize'][_0x80b1('0x53')](_0x195af4(_0x22300d,_0x80b1('0x5b')))['then'](function(){})[_0x80b1('0x2f')](_0x58eb04()));}}return _0x346e30;})['all']();})[_0x80b1('0x2f')](function(_0x4b9ab7){logger[_0x80b1('0x15')](_0x80b1('0x5c'),'generalCheckHopper',_0x4b9ab7[_0x80b1('0x1c')]);});}var processPromises=function(_0x257ec2){return BPromise[_0x80b1('0x57')](promises)[_0x80b1('0x2d')](function(_0x4abfe9){})['catch'](function(_0x29d8cf){logger[_0x80b1('0x15')](_0x80b1('0x5d'),JSON[_0x80b1('0x30')](_0x29d8cf));})['finally'](function(){socket[_0x80b1('0x5e')](_0x80b1('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x257ec2){return _0x257ec2[_0x80b1('0x60')]();}});};var endCsv=function(){return BPromise[_0x80b1('0x61')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x80b1('0x5e')](_0x80b1('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x80b1('0x62')](FILEPATH);}catch(_0x1961bd){logger[_0x80b1('0x15')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x80b1('0x30')](_0x1961bd));}finally{process[_0x80b1('0x63')](0x0);}});};process['on'](_0x80b1('0x64'),function(){logger[_0x80b1('0x65')](_0x80b1('0x66'));endCsv();});function main(){return BPromise['resolve']()[_0x80b1('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x80b1('0x12')](',');return db[_0x80b1('0x2a')][_0x80b1('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x80b1('0x2d')](function(_0x546b95){var _0x59af65=fs[_0x80b1('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x80b1('0x68')](_0x59af65,{'header':!![],'skipEmptyLines':!![],'step':function(_0x480d61,_0x44a268){total+=0x1;var _0x249cc7=total;promises['push'](checkRow(_0x480d61,_0x546b95,_0x249cc7)['then'](function(){success+=0x1;})['catch'](function(_0x3d416f){if(_0x3d416f[_0x80b1('0x15')]){errors+=0x1;delete _0x3d416f['error'];}else if(_0x3d416f['duplicate']){duplicates+=0x1;delete _0x3d416f[_0x80b1('0x69')];}rows[_0x80b1('0x52')](_0x3d416f);}));if(total%0xc8===0x0){_0x44a268[_0x80b1('0x6a')]();return processPromises(_0x44a268);}},'complete':function(){return processPromises()['then'](function(){logger[_0x80b1('0x65')](_0x80b1('0x6b'));endCsv();});},'error':function(_0x4ca125,_0x134ad7){logger[_0x80b1('0x65')](_0x80b1('0x6c'),JSON[_0x80b1('0x30')](_0x4ca125));endCsv();}});})[_0x80b1('0x2f')](function(_0x15ecbe){logger[_0x80b1('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x80b1('0x30')](_0x15ecbe));});}main();
\ No newline at end of file
+var _0xca5b=['always','query','VoiceQueueId','sequelize','all','VoiceQueue','BlackLists','Campaign','onlyIfOpen','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','info','createReadStream','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','localhost','socket.io-emitter','redis','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','length','errors','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','ListId\x20=\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get'];(function(_0x4898fd,_0x39dc09){var _0x43e88e=function(_0x29ef3b){while(--_0x29ef3b){_0x4898fd['push'](_0x4898fd['shift']());}};_0x43e88e(++_0x39dc09);}(_0xca5b,0xee));var _0xbca5=function(_0xf13ca6,_0x5735ea){_0xf13ca6=_0xf13ca6-0x0;var _0x4a4387=_0xca5b[_0xf13ca6];return _0x4a4387;};'use strict';var BPromise=require(_0xbca5('0x0'));var util=require(_0xbca5('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xbca5('0x2'));var Papa=require(_0xbca5('0x3'));var Redis=require(_0xbca5('0x4'));var db=require(_0xbca5('0x5'))['db'];var config=require(_0xbca5('0x6'));var logger=require('../../../config/logger')('api');config['redis']=_['defaults'](config['redis'],{'host':_0xbca5('0x7'),'port':0x18eb});var socket=require(_0xbca5('0x8'))(new Redis(config[_0xbca5('0x9')]));require('../../../api/cmContact/cmContact.socket')[_0xbca5('0xa')](socket);try{if(!process['argv'][0x2]||process[_0xbca5('0xb')][0x2]===_0xbca5('0xc')||process[_0xbca5('0xb')][0x2]===_0xbca5('0xd')){throw new Error(_0xbca5('0xe'));}var FILEPATH=process[_0xbca5('0xb')][0x2];if(!process[_0xbca5('0xb')][0x3]||process[_0xbca5('0xb')][0x3]===_0xbca5('0xc')||process[_0xbca5('0xb')][0x3]===_0xbca5('0xd')||!process[_0xbca5('0xb')][0x4]||process['argv'][0x4]===_0xbca5('0xc')||process[_0xbca5('0xb')][0x4]===_0xbca5('0xd')){throw new Error(_0xbca5('0xf'));}var FIELDS=_[_0xbca5('0x10')](process[_0xbca5('0xb')][0x3][_0xbca5('0x11')](','),process[_0xbca5('0xb')][0x4][_0xbca5('0x11')](','));if(!process[_0xbca5('0xb')][0x5]||process[_0xbca5('0xb')][0x5]===_0xbca5('0xc')||process[_0xbca5('0xb')][0x5]===_0xbca5('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xbca5('0xb')][0x5];var COMPANYID=process[_0xbca5('0xb')][0x6]&&process['argv'][0x6]!==_0xbca5('0xc')&&process[_0xbca5('0xb')][0x6]!==_0xbca5('0xd')?process[_0xbca5('0xb')][0x6]:null;var DUPLICATES=process[_0xbca5('0xb')][0x7]&&process['argv'][0x7]!==_0xbca5('0xc')&&process[_0xbca5('0xb')][0x7]!=='null'?process[_0xbca5('0xb')][0x7]:null;if(!process[_0xbca5('0xb')][0x8]||process[_0xbca5('0xb')][0x8]===_0xbca5('0xc')||process['argv'][0x8]===_0xbca5('0xd')){throw new Error(_0xbca5('0x12'));}var SOCKET_TIMESTAMP=process[_0xbca5('0xb')][0x8];}catch(_0x4788a5){logger[_0xbca5('0x13')](_0x4788a5);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x560124,_0x5bef00,_0x1dc95b,_0x2f7306){var _0x3ebba4={'message':_0x5bef00};_0x3ebba4[_0x560124]=!![];if(_0x1dc95b){_0x3ebba4[_0xbca5('0x14')]=_0x1dc95b;}if(_0x2f7306){_0x3ebba4['index']=_0x2f7306;}return _0x3ebba4;}function isEmail(_0x213770){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xbca5('0x15')](_0x213770);}function checkRow(_0x30e2c7,_0x4bfe26,_0xc0cd49){return new BPromise(function(_0x11a7cf,_0x1fe1eb){if(_[_0xbca5('0x16')](_0x30e2c7)){return _0x1fe1eb(handleCheckRowError(_0xbca5('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0xc0cd49));}if(_0x30e2c7['errors']&&_0x30e2c7['errors'][_0xbca5('0x17')]){var _0x119fca=_['map'](_0x30e2c7[_0xbca5('0x18')],_0xbca5('0x19'))[_0xbca5('0x1a')](';');return _0x1fe1eb(handleCheckRowError(_0xbca5('0x13'),_0x119fca,null,_0xc0cd49));}var _0x3ccaed={};for(var _0x26d0cc in FIELDS){if(FIELDS[_0xbca5('0x1b')](_0x26d0cc)&&FIELDS[_0x26d0cc]){_0x3ccaed[_0x26d0cc]=_0x30e2c7[_0xbca5('0x1c')][0x0][FIELDS[_0x26d0cc]]||_0x30e2c7['data'][0x0]['\ufeff'+FIELDS[_0x26d0cc]];}}if(!_0x3ccaed[_0xbca5('0x1d')]){return _0x1fe1eb(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0xc0cd49));}if(!_0x3ccaed[_0xbca5('0x1e')]){return _0x1fe1eb(handleCheckRowError('error',_0xbca5('0x1f'),null,_0xc0cd49));}if(_0x3ccaed[_0xbca5('0x20')]){var _0x219287=moment(_0x3ccaed[_0xbca5('0x20')],'YYYY-MM-DD');if(!_0x219287[_0xbca5('0x21')]()){return _0x1fe1eb(handleCheckRowError(_0xbca5('0x13'),_0xbca5('0x22'),null,_0xc0cd49));}}if(_0x3ccaed[_0xbca5('0x23')]){if(!isEmail(_0x3ccaed[_0xbca5('0x23')])){return _0x1fe1eb(handleCheckRowError(_0xbca5('0x13'),'email\x20format\x20is\x20not\x20valid!',null,_0xc0cd49));}}_0x3ccaed[_0xbca5('0x24')]=LISTID;_0x3ccaed[_0xbca5('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xbca5('0x17')]&&_0x4bfe26){var _0x7bfe7c={};for(var _0x2d32fa=0x0,_0x4e6953=DUPLICATES[_0xbca5('0x17')];_0x2d32fa<_0x4e6953;_0x2d32fa+=0x1){_0x7bfe7c[DUPLICATES[_0x2d32fa]]=_0x3ccaed[DUPLICATES[_0x2d32fa]];}var _0x1b4277=_['find'](_0x4bfe26,_0x7bfe7c);if(_0x1b4277){return _0x1fe1eb(handleCheckRowError('duplicate',_0xbca5('0x26'),_0x1b4277,_0xc0cd49));}}return db[_0xbca5('0x27')][_0xbca5('0x28')](_0x3ccaed,{'raw':!![],'hooks':![],'fields':_[_0xbca5('0x29')](_0x3ccaed)})[_0xbca5('0x2a')](function(_0xc83412){if(DUPLICATES&&DUPLICATES[_0xbca5('0x17')]&&_0x4bfe26){_0x4bfe26[_0xbca5('0x2b')](_[_0xbca5('0x2c')](_0x3ccaed,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc83412['id'];return _0x11a7cf();})[_0xbca5('0x2d')](function(_0x497321){return _0x1fe1eb(handleCheckRowError(_0xbca5('0x13'),_0xbca5('0x2e')+(_0x497321[_0xbca5('0x19')]||JSON[_0xbca5('0x2f')](_0x497321)),null,_0xc0cd49));});});}function checkHopper(){function _0x3c6edf(){return function(_0xb1330b){logger[_0xbca5('0x13')]('cmContact','checkHopper',util[_0xbca5('0x30')](_0xb1330b,{'showHidden':![],'depth':null}));};}var _0x2886fd=function(_0x35d550,_0x32e21c){var _0x214f8f=squel[_0xbca5('0x31')]()[_0xbca5('0x32')](_0xbca5('0x33'))[_0xbca5('0x34')]([_0xbca5('0x1e'),_0xbca5('0x35'),_0xbca5('0x36'),_0xbca5('0x24'),_0x32e21c,'createdAt',_0xbca5('0x37')],squel[_0xbca5('0x38')]()[_0xbca5('0x39')]('phone',_0xbca5('0x1e'))['field'](_0xbca5('0x3a'),'scheduledAt')['field']('id',_0xbca5('0x36'))['field'](LISTID[_0xbca5('0x3b')](),_0xbca5('0x24'))[_0xbca5('0x39')](_0x35d550['id']['toString'](),_0x32e21c)[_0xbca5('0x39')](_0xbca5('0x3a'),_0xbca5('0x3c'))[_0xbca5('0x39')](_0xbca5('0x3a'),_0xbca5('0x37'))[_0xbca5('0x3d')](_0xbca5('0x3e'))[_0xbca5('0x3f')](_0xbca5('0x40'))[_0xbca5('0x3f')]('ListId\x20=\x20?',LISTID[_0xbca5('0x3b')]())[_0xbca5('0x3f')](_0xbca5('0x41'))[_0xbca5('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xbca5('0x39')](_0xbca5('0x1e'))[_0xbca5('0x3d')](_0xbca5('0x33'))[_0xbca5('0x3f')](_0x32e21c+_0xbca5('0x42'),_0x35d550['id'][_0xbca5('0x3b')]())))[_0xbca5('0x3b')]();return _0x214f8f;};var _0x592428=function(_0x1a66eb,_0x12c9de){var _0x490a4d=squel[_0xbca5('0x31')]()[_0xbca5('0x32')]('cm_hopper')[_0xbca5('0x34')]([_0xbca5('0x1e'),_0xbca5('0x35'),_0xbca5('0x36'),_0xbca5('0x24'),_0x12c9de,_0xbca5('0x3c'),_0xbca5('0x37')],squel[_0xbca5('0x38')]()['field']('phone',_0xbca5('0x1e'))['field'](_0xbca5('0x3a'),_0xbca5('0x35'))['field']('id',_0xbca5('0x36'))[_0xbca5('0x39')](LISTID['toString'](),_0xbca5('0x24'))['field'](_0x1a66eb['id'][_0xbca5('0x3b')](),_0x12c9de)[_0xbca5('0x39')](_0xbca5('0x3a'),_0xbca5('0x3c'))[_0xbca5('0x39')]('NOW()',_0xbca5('0x37'))[_0xbca5('0x3d')](_0xbca5('0x3e'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xbca5('0x43'),LISTID[_0xbca5('0x3b')]())[_0xbca5('0x3f')]('id\x20IN\x20?',squel[_0xbca5('0x44')](hopperContacts))['where'](_0xbca5('0x41'))[_0xbca5('0x3f')](_0xbca5('0x45'),squel[_0xbca5('0x38')]()[_0xbca5('0x39')](_0xbca5('0x46'))[_0xbca5('0x3d')](_0xbca5('0x47'))[_0xbca5('0x3f')](_0x12c9de+'\x20=\x20?',_0x1a66eb['id'][_0xbca5('0x3b')]()))[_0xbca5('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xbca5('0x38')]()[_0xbca5('0x39')](_0xbca5('0x1e'))[_0xbca5('0x3d')](_0xbca5('0x33'))['where'](_0x12c9de+'\x20=\x20?',_0x1a66eb['id'][_0xbca5('0x3b')]())))[_0xbca5('0x3b')]();return _0x490a4d;};function _0x342f4f(_0x428103,_0x2ef127){var _0x39f4f6=squel['insert']()['into']('cm_hopper')[_0xbca5('0x34')](['phone','scheduledAt',_0xbca5('0x36'),'ListId',_0x2ef127,'createdAt','updatedAt'],squel[_0xbca5('0x38')]()['field'](_0xbca5('0x1e'),_0xbca5('0x1e'))[_0xbca5('0x39')](_0xbca5('0x3a'),_0xbca5('0x35'))[_0xbca5('0x39')]('id',_0xbca5('0x36'))['field'](LISTID['toString'](),'ListId')[_0xbca5('0x39')](_0x428103['id'][_0xbca5('0x3b')](),_0x2ef127)[_0xbca5('0x39')](_0xbca5('0x3a'),_0xbca5('0x3c'))[_0xbca5('0x39')](_0xbca5('0x3a'),_0xbca5('0x37'))['from'](_0xbca5('0x3e'))['where'](_0xbca5('0x40'))[_0xbca5('0x3f')]('ListId\x20=\x20?',LISTID[_0xbca5('0x3b')]())[_0xbca5('0x3f')](_0xbca5('0x48'),squel['str'](hopperContacts))[_0xbca5('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0xbca5('0x3b')]();return _0x39f4f6;}function _0x4d96da(_0x5367e3,_0x1fa652){var _0x1e1280=squel[_0xbca5('0x31')]()[_0xbca5('0x32')](_0xbca5('0x49'))[_0xbca5('0x34')]([_0xbca5('0x1e'),'ContactId','ListId',_0x1fa652,_0xbca5('0x3c'),_0xbca5('0x37')],squel[_0xbca5('0x38')]()['field'](_0xbca5('0x1e'),_0xbca5('0x1e'))[_0xbca5('0x39')]('id',_0xbca5('0x36'))[_0xbca5('0x39')](LISTID[_0xbca5('0x3b')](),_0xbca5('0x24'))['field'](_0x5367e3['id'][_0xbca5('0x3b')](),_0x1fa652)['field'](_0xbca5('0x3a'),_0xbca5('0x3c'))[_0xbca5('0x39')](_0xbca5('0x3a'),_0xbca5('0x37'))[_0xbca5('0x3d')](_0xbca5('0x3e'))[_0xbca5('0x3f')](_0xbca5('0x40'))[_0xbca5('0x3f')]('ListId\x20=\x20?',LISTID[_0xbca5('0x3b')]())['where'](_0xbca5('0x48'),squel['str'](hopperContacts))[_0xbca5('0x3f')](_0xbca5('0x41')))[_0xbca5('0x3b')]();return _0x1e1280;}return db['VoiceQueue'][_0xbca5('0x4a')]({'where':{'type':_0xbca5('0x4b')},'attributes':['id',_0xbca5('0x4c')],'include':[{'model':db[_0xbca5('0x4d')],'as':_0xbca5('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x1fe3fd){var _0x243633=[];if(_0x1fe3fd){var _0x4760e5;for(var _0x5ad322=0x0,_0x8767d1;_0x5ad322<_0x1fe3fd['length'];_0x5ad322+=0x1){_0x8767d1=_0x1fe3fd[_0x5ad322][_0xbca5('0x4f')]({'plain':!![]});switch(_0x8767d1['dialCheckDuplicateType']){case _0xbca5('0x50'):_0x243633[_0xbca5('0x2b')](db['sequelize'][_0xbca5('0x51')](_0x592428(_0x8767d1,_0xbca5('0x52')))['then'](function(){})[_0xbca5('0x2d')](_0x3c6edf()));break;case'onlyIfOpen':_0x243633[_0xbca5('0x2b')](db[_0xbca5('0x53')][_0xbca5('0x51')](_0x2886fd(_0x8767d1,_0xbca5('0x52')))[_0xbca5('0x2a')](function(){})[_0xbca5('0x2d')](_0x3c6edf()));break;default:_0x243633[_0xbca5('0x2b')](db[_0xbca5('0x53')][_0xbca5('0x51')](_0x342f4f(_0x8767d1,'VoiceQueueId'))[_0xbca5('0x2a')](function(){})['catch'](_0x3c6edf()));}}}return _0x243633;})[_0xbca5('0x54')]()[_0xbca5('0x2a')](function(){return db[_0xbca5('0x55')]['findAll']({'where':{'type':_0xbca5('0x4b')},'attributes':['id'],'include':[{'model':db[_0xbca5('0x4d')],'as':_0xbca5('0x56'),'where':{'id':LISTID}}]})[_0xbca5('0x2a')](function(_0x221660){var _0x279457=[];if(_0x221660){var _0x17add4;for(var _0x4c5a02=0x0,_0x4dc721;_0x4c5a02<_0x221660[_0xbca5('0x17')];_0x4c5a02+=0x1){_0x4dc721=_0x221660[_0x4c5a02][_0xbca5('0x4f')]({'plain':!![]});_0x279457[_0xbca5('0x2b')](db[_0xbca5('0x53')][_0xbca5('0x51')](_0x4d96da(_0x4dc721,'VoiceQueueId'))[_0xbca5('0x2a')](function(){})[_0xbca5('0x2d')](_0x3c6edf()));}}return _0x279457;})[_0xbca5('0x54')]();})[_0xbca5('0x2a')](function(){return db[_0xbca5('0x57')][_0xbca5('0x4a')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xbca5('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x24950d){var _0x3ede89=[];if(_0x24950d){for(var _0x4b8a4e=0x0,_0x406d67;_0x4b8a4e<_0x24950d['length'];_0x4b8a4e+=0x1){_0x406d67=_0x24950d[_0x4b8a4e]['get']({'plain':!![]});switch(_0x406d67[_0xbca5('0x4c')]){case _0xbca5('0x50'):_0x3ede89['push'](db[_0xbca5('0x53')][_0xbca5('0x51')](_0x592428(_0x406d67,'CampaignId'))[_0xbca5('0x2a')](function(){})[_0xbca5('0x2d')](_0x3c6edf()));break;case _0xbca5('0x58'):_0x3ede89[_0xbca5('0x2b')](db['sequelize'][_0xbca5('0x51')](_0x2886fd(_0x406d67,_0xbca5('0x59')))[_0xbca5('0x2a')](function(){})[_0xbca5('0x2d')](_0x3c6edf()));break;default:_0x3ede89[_0xbca5('0x2b')](db[_0xbca5('0x53')][_0xbca5('0x51')](_0x342f4f(_0x406d67,_0xbca5('0x59')))[_0xbca5('0x2a')](function(){})[_0xbca5('0x2d')](_0x3c6edf()));}}}return _0x3ede89;})[_0xbca5('0x54')]();})['then'](function(){return db[_0xbca5('0x57')]['findAll']({'attributes':['id'],'include':[{'model':db[_0xbca5('0x4d')],'as':_0xbca5('0x56'),'where':{'id':LISTID}}]})[_0xbca5('0x2a')](function(_0x4de21e){var _0x2dec97=[];if(_0x4de21e){for(var _0x163945=0x0,_0x5c90fe;_0x163945<_0x4de21e['length'];_0x163945+=0x1){_0x5c90fe=_0x4de21e[_0x163945][_0xbca5('0x4f')]({'plain':!![]});_0x2dec97[_0xbca5('0x2b')](db[_0xbca5('0x53')][_0xbca5('0x51')](_0x4d96da(_0x5c90fe,_0xbca5('0x59')))[_0xbca5('0x2a')](function(){})[_0xbca5('0x2d')](_0x3c6edf()));}}return _0x2dec97;})[_0xbca5('0x54')]();})['catch'](function(_0x449197){logger[_0xbca5('0x13')](_0xbca5('0x5a'),_0xbca5('0x5b'),_0x449197[_0xbca5('0x19')]);});}var processPromises=function(_0x3e3091){return BPromise[_0xbca5('0x54')](promises)[_0xbca5('0x2a')](function(_0x4d11ae){})[_0xbca5('0x2d')](function(_0x594382){logger[_0xbca5('0x13')](_0xbca5('0x5c'),JSON['stringify'](_0x594382));})[_0xbca5('0x5d')](function(){socket[_0xbca5('0x5e')](_0xbca5('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3e3091){return _0x3e3091['resume']();}});};var endCsv=function(){return BPromise[_0xbca5('0x60')]()[_0xbca5('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0xbca5('0x2a')](function(){socket[_0xbca5('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xbca5('0x61')](FILEPATH);}catch(_0x3f316a){logger['error'](_0xbca5('0x62'),JSON['stringify'](_0x3f316a));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0xbca5('0x63')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0xbca5('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xbca5('0x11')](',');return db[_0xbca5('0x27')][_0xbca5('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x597f22){var _0x53699e=fs[_0xbca5('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x53699e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2f8d74,_0x7e3db9){total+=0x1;var _0x306c2a=total;promises[_0xbca5('0x2b')](checkRow(_0x2f8d74,_0x597f22,_0x306c2a)[_0xbca5('0x2a')](function(){success+=0x1;})['catch'](function(_0x45226a){if(_0x45226a['error']){errors+=0x1;delete _0x45226a[_0xbca5('0x13')];}else if(_0x45226a[_0xbca5('0x65')]){duplicates+=0x1;delete _0x45226a[_0xbca5('0x65')];}rows[_0xbca5('0x2b')](_0x45226a);}));if(total%0xc8===0x0){_0x7e3db9[_0xbca5('0x66')]();return processPromises(_0x7e3db9);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0xbca5('0x67'));endCsv();});},'error':function(_0x27ac17,_0x5bdd34){logger[_0xbca5('0x63')](_0xbca5('0x68'),JSON[_0xbca5('0x2f')](_0x27ac17));endCsv();}});})['catch'](function(_0x30d371){logger[_0xbca5('0x13')](_0xbca5('0x69'),JSON[_0xbca5('0x2f')](_0x30d371));});}main();
\ No newline at end of file
diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js
index 5bdaabf..3dca681 100644
--- a/server/components/import/cm/csv2.js
+++ b/server/components/import/cm/csv2.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c1b=['.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','priority','UserId','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.id','cm_contacts.createdAt','into','cm_hopper_black','fromQuery','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','MIN(id)','min_id','info','Received\x20SIGINT','error','message','exit','sequelize','query','spread','push','catch','main','stringify','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','createReadStream','length','rows','errors','hasOwnProperty','trim','data','replace','scheduledat','isValid','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','ListId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','each','then','finish','affectedRows','emit','unlink','argv','arguments\x20\x20\x20','existsSync','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','field','from','.id\x20=\x20','where','\x20=\x20'];(function(_0x5a77f1,_0x471a86){var _0x502b48=function(_0x4c77ee){while(--_0x4c77ee){_0x5a77f1['push'](_0x5a77f1['shift']());}};_0x502b48(++_0x471a86);}(_0x9c1b,0xff));var _0xb9c1=function(_0x3ba79c,_0x1547d2){_0x3ba79c=_0x3ba79c-0x0;var _0xd2d1a4=_0x9c1b[_0x3ba79c];return _0xd2d1a4;};'use strict';var fs=require('fs');var path=require(_0xb9c1('0x0'));var _=require(_0xb9c1('0x1'));var Papa=require('papaparse');var util=require(_0xb9c1('0x2'));var BPromise=require(_0xb9c1('0x3'));var moment=require(_0xb9c1('0x4'));var squel=require('squel');var Redis=require(_0xb9c1('0x5'));var db=require(_0xb9c1('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0xb9c1('0x7'))(_0xb9c1('0x8'));config['redis']=_[_0xb9c1('0x9')](config[_0xb9c1('0xa')],{'host':_0xb9c1('0xb'),'port':0x18eb});var socket=require(_0xb9c1('0xc'))(new Redis(config[_0xb9c1('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xb9c1('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0xc16e94){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0xc16e94);}function selectNotIn(_0x303582,_0x3dbc8c,_0x39af61,_0x1bfde0,_0x15f893){return squel['select']()[_0xb9c1('0xe')]('phone')[_0xb9c1('0xf')](_0x1bfde0)['join'](_0x3dbc8c,null,_0x3dbc8c+_0xb9c1('0x10')+_0x1bfde0+'.'+_0x39af61)[_0xb9c1('0x11')](_0x1bfde0+'.'+_0x39af61+_0xb9c1('0x12')+_0x303582+'.'+_0x39af61)[_0xb9c1('0x11')](_0x3dbc8c+_0xb9c1('0x13')+_0x15f893[_0xb9c1('0x14')]()+')');}function insertCmHopper(_0xd39ff2,_0x20d4ac,_0xea2994,_0x25386e,_0x3d37a6){var _0x2e166e=[_0xb9c1('0x15'),_0xb9c1('0x16'),'cm_contacts.id',_0xb9c1('0x17'),_0x20d4ac+'.'+_0x25386e,'cm_contacts.createdAt',_0xb9c1('0x18'),_0xb9c1('0x19'),_0xb9c1('0x1a'),'\x22'+_0x3d37a6+'\x22'];return squel[_0xb9c1('0x1b')]()['into'](_0xb9c1('0x1c'))['fromQuery']([_0xb9c1('0x1d'),'scheduledat',_0xb9c1('0x1e'),'ListId',_0x25386e,_0xb9c1('0x1f'),_0xb9c1('0x20'),_0xb9c1('0x21'),_0xb9c1('0x22'),'recallme'],squel[_0xb9c1('0x23')]()[_0xb9c1('0x24')](_0x2e166e)[_0xb9c1('0xf')](_0x20d4ac)[_0xb9c1('0x14')](_0xb9c1('0x25'),null,_0xb9c1('0x26')+_0x20d4ac+_0xb9c1('0x27'))['join'](_0xea2994,null,_0xea2994+_0xb9c1('0x10')+_0x20d4ac+'.'+_0x25386e)['where'](_0x20d4ac+'.CmListId\x20=\x20?',_0xd39ff2)[_0xb9c1('0x11')](_0xb9c1('0x28'),NOW)[_0xb9c1('0x11')](_0xb9c1('0x29'),selectNotIn(_0x20d4ac,_0xea2994,_0x25386e,_0xb9c1('0x1c'),['\x22always\x22',_0xb9c1('0x2a')]))['where'](_0xb9c1('0x29'),selectNotIn(_0x20d4ac,_0xea2994,_0x25386e,_0xb9c1('0x1c'),[_0xb9c1('0x2b')])))[_0xb9c1('0x2c')]();}function insertCmHopperBlack(_0xc86e3b,_0x520c08,_0x26afb6,_0x48f21d){var _0x13f8e7=[_0xb9c1('0x15'),_0xb9c1('0x2d'),_0xb9c1('0x17'),_0x520c08+'.'+_0x48f21d,_0xb9c1('0x2e'),_0xb9c1('0x18')];return squel['insert']()[_0xb9c1('0x2f')](_0xb9c1('0x30'))[_0xb9c1('0x31')](['phone',_0xb9c1('0x1e'),'ListId',_0x48f21d,'createdAt','updatedAt'],squel[_0xb9c1('0x23')]()['fields'](_0x13f8e7)[_0xb9c1('0xf')](_0x520c08)[_0xb9c1('0x14')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x520c08+'.CmListId')[_0xb9c1('0x14')](_0x26afb6,null,_0x26afb6+'.id\x20=\x20'+_0x520c08+'.'+_0x48f21d)[_0xb9c1('0x11')](_0x520c08+_0xb9c1('0x32'),_0xc86e3b)[_0xb9c1('0x11')](_0xb9c1('0x28'),NOW)[_0xb9c1('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xb9c1('0x23')]()[_0xb9c1('0xe')](_0xb9c1('0x1d'))['from'](_0xb9c1('0x30'))[_0xb9c1('0x11')](_0xb9c1('0x33'),_0xc86e3b)[_0xb9c1('0x11')](_0x48f21d+_0xb9c1('0x34'),_0x520c08+'.'+_0x48f21d)))[_0xb9c1('0x2c')]();}function insertCmContact(_0x42006c,_0x448f77,_0x263408,_0x1e347f){var _0x557590=_[_0xb9c1('0x35')](_[_0xb9c1('0x36')](_0x1e347f),['ListId',_0xb9c1('0x37'),_0xb9c1('0x1f'),_0xb9c1('0x20')]);return squel[_0xb9c1('0x1b')]()[_0xb9c1('0x2f')](_0xb9c1('0x25'))[_0xb9c1('0x31')](_0x557590,squel[_0xb9c1('0x23')]()['fields'](_0x557590)['from'](_0x448f77)['where']('('+_0x263408[_0xb9c1('0x14')](',')+')\x20NOT\x20IN\x20?',squel[_0xb9c1('0x23')]()['fields'](_0x263408)[_0xb9c1('0xf')](_0xb9c1('0x25'))[_0xb9c1('0x11')](_0xb9c1('0x33'),_0x42006c))[_0xb9c1('0x11')]('id\x20IN\x20?',squel[_0xb9c1('0x23')]()[_0xb9c1('0xe')](_0xb9c1('0x38'),_0xb9c1('0x39'))['from'](_0x448f77)['group'](_0x263408[_0xb9c1('0x14')](','))))[_0xb9c1('0x2c')]();}function handleStop(){logger[_0xb9c1('0x3a')](_0xb9c1('0x3b'));stopped=!![];}function handleUncaughtException(_0x3de0ad){logger[_0xb9c1('0x3c')](_0x3de0ad[_0xb9c1('0x3d')]);process[_0xb9c1('0x3e')](0x1);}function handleError(_0x4baf40,_0x12a1cd){stats['errors']['push']({'name':_0x12a1cd['code'],'message':_0x12a1cd[_0xb9c1('0x3d')],'row':_0x4baf40});}function handleQuery(_0xaab34f){logger[_0xb9c1('0x3a')](_0xaab34f);return db[_0xb9c1('0x3f')][_0xb9c1('0x40')](_0xaab34f)[_0xb9c1('0x41')](function(_0x306311){results[_0xb9c1('0x42')](_0x306311);})[_0xb9c1('0x43')](function(_0x4769b0){logger[_0xb9c1('0x3c')](_0x4769b0[_0xb9c1('0x3d')]);});}function main(_0x34ae00,_0x2ec54a,_0x55cccf,_0x4934bc){logger[_0xb9c1('0x3a')](_0xb9c1('0x44'),_0x34ae00,JSON[_0xb9c1('0x45')](_0x2ec54a));process['send'](_0xb9c1('0x46'));var _0x460c0a=_0x2ec54a[_0xb9c1('0x47')];var _0xc1a98f=_0x2ec54a[_0xb9c1('0x48')];var _0x354a83=path[_0xb9c1('0x14')](config[_0xb9c1('0x49')],_0xb9c1('0x4a'),_0xc1a98f+_0xb9c1('0x4b'));var _0x31b381=_[_0xb9c1('0x36')](_0x460c0a)[_0xb9c1('0x14')]();logger['info'](_0xb9c1('0x4c'),_0x31b381);fs[_0xb9c1('0x4d')](_0x354a83,_0x31b381+'\x0a');Papa['parse'](fs[_0xb9c1('0x4e')](_0x34ae00),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3e96c9,_0x14c6d0){try{for(var _0xe32269=0x0,_0x28ac27=[];_0xe32269<_0x3e96c9['data'][_0xb9c1('0x4f')];_0xe32269++){stats[_0xb9c1('0x50')]+=0x1;if(_0x3e96c9[_0xb9c1('0x51')][_0xe32269]){handleError(_0x3e96c9['data'][_0xe32269],_0x3e96c9[_0xb9c1('0x51')][_0xe32269]);}else{var _0x262cce=[];for(var _0x2013a8 in _0x460c0a){if(_0x460c0a[_0xb9c1('0x52')](_0x2013a8)){if(_0x3e96c9['data'][_0xe32269][_0x460c0a[_0x2013a8]]){var _0x5bf45a=_[_0xb9c1('0x53')](_0x3e96c9[_0xb9c1('0x54')][_0xe32269][_0x460c0a[_0x2013a8]][_0xb9c1('0x55')](/"/g,'\x27'));switch(_0x2013a8){case _0xb9c1('0x56'):var _0x34d3cf=moment(_0x5bf45a,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x34d3cf[_0xb9c1('0x57')]()){_0x28ac27[_0xb9c1('0x42')]('\x22'+_0x5bf45a+'\x22');}else{_0x262cce[_0xb9c1('0x42')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xb9c1('0x21'):var _0x5be616=parseInt(_0x5bf45a);_0x5bf45a=_[_0xb9c1('0x58')](_0x5be616)||_0x5be616<0x0||_0x5be616>0x4?_0x4934bc?0x3:0x2:_0x5be616;_0x28ac27[_0xb9c1('0x42')]('\x22'+_0x5bf45a+'\x22');break;case _0xb9c1('0x22'):var _0x4fc155=parseInt(_0x5bf45a);if(_[_0xb9c1('0x59')](_0x4fc155)&&_[_0xb9c1('0x5a')](_0x55cccf,_0x4fc155)){_0x28ac27[_0xb9c1('0x42')]('\x22'+_0x4fc155+'\x22');}else{_0x262cce['push'](_0xb9c1('0x5b'));}break;case'email':if(isEmail(_0x5bf45a)){_0x28ac27['push']('\x22'+_0x5bf45a+'\x22');}else{_0x262cce[_0xb9c1('0x42')](_0xb9c1('0x5c'));}break;case _0xb9c1('0x5d'):var _0x567ab2=moment(_0x5bf45a,_0xb9c1('0x5e'),!![]);if(_0x567ab2['isValid']()){_0x28ac27[_0xb9c1('0x42')]('\x22'+_0x5bf45a+'\x22');}else{_0x262cce[_0xb9c1('0x42')](_0xb9c1('0x5f'));}break;default:_0x28ac27[_0xb9c1('0x42')]('\x22'+_0x5bf45a+'\x22');}}else{switch(_0x2013a8){case _0xb9c1('0x60'):case _0xb9c1('0x1d'):_0x262cce[_0xb9c1('0x42')](_0x2013a8+_0xb9c1('0x61'));break;default:_0x28ac27[_0xb9c1('0x42')]('\x22\x22');}}}}if(_0x262cce[_0xb9c1('0x4f')]){handleError(_0x3e96c9[_0xb9c1('0x54')][_0xe32269],{'code':_0xb9c1('0x62'),'message':_0x262cce[_0xb9c1('0x14')]()});}else{fs[_0xb9c1('0x63')](_0x354a83,_0x28ac27['join']()+'\x0a');}_0x28ac27=[];}if(!(stats[_0xb9c1('0x50')]%0xc8)){socket['emit'](_0xb9c1('0x64')+_0xc1a98f,stats);stats[_0xb9c1('0x51')]=[];}}if(stopped){logger[_0xb9c1('0x3a')](_0xb9c1('0x65'));_0x14c6d0[_0xb9c1('0x66')]();}}catch(_0x31accc){handleError(_0x3e96c9[_0xb9c1('0x54')][_0xe32269],{'code':_0xb9c1('0x67'),'message':_0x31accc[_0xb9c1('0x3d')]});logger[_0xb9c1('0x3c')](_0xb9c1('0x68'),_0x31accc['message']);}},'complete':function(){try{var _0x4af73e=[];var _0x18c5b6=_0xb9c1('0x25');if(_0x2ec54a[_0xb9c1('0x69')]&&_0x2ec54a[_0xb9c1('0x69')]['length']){_0x18c5b6=_0xb9c1('0x6a')+_0xc1a98f;_0x4af73e[_0xb9c1('0x42')](_0xb9c1('0x6b')+_0x18c5b6+_0xb9c1('0x6c'));}var _0x21b3fa=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x354a83,_0x18c5b6,_0x31b381,_0x2ec54a[_0xb9c1('0x6d')],_0x2ec54a[_0xb9c1('0x37')]||null,NOW,NOW);if(_[_0xb9c1('0x6e')](_0x460c0a[_0xb9c1('0x56')])){_0x21b3fa+=_0xb9c1('0x6f');}_0x4af73e[_0xb9c1('0x42')](_0x21b3fa);if(_0x2ec54a[_0xb9c1('0x69')]&&_0x2ec54a[_0xb9c1('0x69')][_0xb9c1('0x4f')]){_0x4af73e[_0xb9c1('0x42')](insertCmContact(_0x2ec54a['ListId'],_0x18c5b6,_0x2ec54a['duplicates'],_0x460c0a));_0x4af73e[_0xb9c1('0x42')](_0xb9c1('0x70')+_0x18c5b6+';');}_0x4af73e[_0xb9c1('0x42')](insertCmHopper(_0x2ec54a[_0xb9c1('0x6d')],'voice_queues_has_cm_lists',_0xb9c1('0x71'),'VoiceQueueId',_0x4934bc));_0x4af73e[_0xb9c1('0x42')](insertCmHopperBlack(_0x2ec54a['ListId'],_0xb9c1('0x72'),_0xb9c1('0x71'),'VoiceQueueId'));_0x4af73e[_0xb9c1('0x42')](insertCmHopper(_0x2ec54a[_0xb9c1('0x6d')],_0xb9c1('0x73'),_0xb9c1('0x74'),_0xb9c1('0x75'),_0x4934bc));_0x4af73e[_0xb9c1('0x42')](insertCmHopperBlack(_0x2ec54a['ListId'],'campaigns_has_cm_blacklists',_0xb9c1('0x74'),_0xb9c1('0x75')));BPromise[_0xb9c1('0x76')](_0x4af73e,handleQuery)[_0xb9c1('0x77')](function(_0x56bc5c){stats[_0xb9c1('0x78')]=!![];stats[_0xb9c1('0x79')]=_0x2ec54a[_0xb9c1('0x69')]&&_0x2ec54a[_0xb9c1('0x69')][_0xb9c1('0x4f')]?results[0x2][_0xb9c1('0x79')]:results[0x0][_0xb9c1('0x79')];socket[_0xb9c1('0x7a')]('contact:import:'+_0xc1a98f,stats);fs[_0xb9c1('0x7b')](_0x34ae00);fs['unlink'](_0x354a83);process[_0xb9c1('0x3e')](0x0);})['catch'](function(_0x521edf){logger[_0xb9c1('0x3c')](_0x521edf['message']);process[_0xb9c1('0x3e')](0x1);});}catch(_0x3e7b67){logger['error']('complete',_0x3e7b67[_0xb9c1('0x3d')]);process[_0xb9c1('0x3e')](0x1);}},'error':function(_0x5cc18d,_0x435134,_0x240486,_0x577599){throw new Error(_0x577599);}});}function validate(){if(process[_0xb9c1('0x7c')]&&process['argv'][_0xb9c1('0x4f')]<0x4){throw new Error(_0xb9c1('0x7d'));}var _0x3acc44=path[_0xb9c1('0x14')](config[_0xb9c1('0x49')],_0xb9c1('0x4a'),process[_0xb9c1('0x7c')][0x2]);if(!fs[_0xb9c1('0x7e')](_0x3acc44)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x57ea70={};try{_0x57ea70=JSON[_0xb9c1('0x7f')](process[_0xb9c1('0x7c')][0x3]);if(!_0x57ea70[_0xb9c1('0x47')]){throw new Error(_0xb9c1('0x80'));}if(!_0x57ea70[_0xb9c1('0x47')]['phone']){throw new Error(_0xb9c1('0x81'));}if(!_0x57ea70[_0xb9c1('0x47')][_0xb9c1('0x60')]){throw new Error(_0xb9c1('0x82'));}var _0x52cdd9=0x0;if(_0x57ea70[_0xb9c1('0x47')][_0xb9c1('0x22')]){_0x52cdd9=0x1;}if(!_0x57ea70['ListId']){throw new Error(_0xb9c1('0x83'));}}catch(_0x26ca8b){throw new Error(_0xb9c1('0x84'));}var _0x16cdf7=[];try{_0x16cdf7=_[_0xb9c1('0x85')](JSON[_0xb9c1('0x7f')](process[_0xb9c1('0x7c')][0x4]),'id');}catch(_0x27b71b){logger[_0xb9c1('0x3a')](_0xb9c1('0x86'));}main(_0x3acc44,_0x57ea70,_0x16cdf7,_0x52cdd9);}validate();process['on'](_0xb9c1('0x87'),handleStop);process['on'](_0xb9c1('0x88'),handleUncaughtException);
\ No newline at end of file
+var _0x1294=['../../../mysqldb','../../../config/environment','import','redis','localhost','socket.io-emitter','format','phone','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','recallme','select','from','cm_contacts','.CmListId','.CmListId\x20=\x20?','where','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','cm_contacts.ListId','into','cm_hopper_black','ListId','updatedAt','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','createdAt','fields',')\x20NOT\x20IN\x20?','id\x20IN\x20?','field','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','spread','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis'];(function(_0x5efa48,_0x4f9989){var _0x78f293=function(_0x48888d){while(--_0x48888d){_0x5efa48['push'](_0x5efa48['shift']());}};_0x78f293(++_0x4f9989);}(_0x1294,0x111));var _0x4129=function(_0x5e8874,_0x134292){_0x5e8874=_0x5e8874-0x0;var _0x4bf1de=_0x1294[_0x5e8874];return _0x4bf1de;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x4129('0x0'));var Papa=require(_0x4129('0x1'));var util=require(_0x4129('0x2'));var BPromise=require(_0x4129('0x3'));var moment=require(_0x4129('0x4'));var squel=require(_0x4129('0x5'));var Redis=require(_0x4129('0x6'));var db=require(_0x4129('0x7'))['db'];var config=require(_0x4129('0x8'));var logger=require('../../../config/logger')(_0x4129('0x9'));config[_0x4129('0xa')]=_['defaults'](config[_0x4129('0xa')],{'host':_0x4129('0xb'),'port':0x18eb});var socket=require(_0x4129('0xc'))(new Redis(config[_0x4129('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x4129('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0xae9e90){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0xae9e90);}function selectNotIn(_0x2e5e27,_0xc79249,_0x7e04c6,_0x48b971,_0x56228b){return squel['select']()['field'](_0x4129('0xe'))['from'](_0x48b971)[_0x4129('0xf')](_0xc79249,null,_0xc79249+_0x4129('0x10')+_0x48b971+'.'+_0x7e04c6)['where'](_0x48b971+'.'+_0x7e04c6+_0x4129('0x11')+_0x2e5e27+'.'+_0x7e04c6)['where'](_0xc79249+_0x4129('0x12')+_0x56228b['join']()+')');}function insertCmHopper(_0x1705df,_0x1ba817,_0x3897e2,_0x21d765,_0x58d99e){var _0x51ab6a=['cm_contacts.phone',_0x4129('0x13'),_0x4129('0x14'),'cm_contacts.ListId',_0x1ba817+'.'+_0x21d765,_0x4129('0x15'),_0x4129('0x16'),_0x4129('0x17'),_0x4129('0x18'),'\x22'+_0x58d99e+'\x22'];return squel[_0x4129('0x19')]()['into'](_0x4129('0x1a'))[_0x4129('0x1b')](['phone',_0x4129('0x1c'),_0x4129('0x1d'),'ListId',_0x21d765,'createdAt','updatedAt','priority','UserId',_0x4129('0x1e')],squel[_0x4129('0x1f')]()['fields'](_0x51ab6a)[_0x4129('0x20')](_0x1ba817)['join'](_0x4129('0x21'),null,'cm_contacts.ListId\x20=\x20'+_0x1ba817+_0x4129('0x22'))[_0x4129('0xf')](_0x3897e2,null,_0x3897e2+_0x4129('0x10')+_0x1ba817+'.'+_0x21d765)['where'](_0x1ba817+_0x4129('0x23'),_0x1705df)[_0x4129('0x24')](_0x4129('0x25'),NOW)['where'](_0x4129('0x26'),selectNotIn(_0x1ba817,_0x3897e2,_0x21d765,'cm_hopper',[_0x4129('0x27'),'\x22onlyIfOpen\x22']))['where'](_0x4129('0x26'),selectNotIn(_0x1ba817,_0x3897e2,_0x21d765,_0x4129('0x1a'),['\x22always\x22'])))[_0x4129('0x28')]();}function insertCmHopperBlack(_0x2790e5,_0x1e0358,_0x6d5ba9,_0x1eb04e){var _0x4ac3f0=[_0x4129('0x29'),_0x4129('0x14'),_0x4129('0x2a'),_0x1e0358+'.'+_0x1eb04e,'cm_contacts.createdAt',_0x4129('0x16')];return squel['insert']()[_0x4129('0x2b')](_0x4129('0x2c'))[_0x4129('0x1b')]([_0x4129('0xe'),_0x4129('0x1d'),_0x4129('0x2d'),_0x1eb04e,'createdAt',_0x4129('0x2e')],squel[_0x4129('0x1f')]()['fields'](_0x4ac3f0)[_0x4129('0x20')](_0x1e0358)[_0x4129('0xf')](_0x4129('0x21'),null,_0x4129('0x2f')+_0x1e0358+_0x4129('0x22'))[_0x4129('0xf')](_0x6d5ba9,null,_0x6d5ba9+_0x4129('0x10')+_0x1e0358+'.'+_0x1eb04e)['where'](_0x1e0358+_0x4129('0x23'),_0x2790e5)[_0x4129('0x24')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x4129('0x24')](_0x4129('0x26'),squel['select']()['field']('phone')[_0x4129('0x20')](_0x4129('0x2c'))['where'](_0x4129('0x30'),_0x2790e5)[_0x4129('0x24')](_0x1eb04e+_0x4129('0x31'),_0x1e0358+'.'+_0x1eb04e)))['toString']();}function insertCmContact(_0x33cdb3,_0x2c7109,_0xa191cc,_0x8982c2){var _0x2afa8e=_[_0x4129('0x32')](_[_0x4129('0x33')](_0x8982c2),[_0x4129('0x2d'),_0x4129('0x34'),_0x4129('0x35'),_0x4129('0x2e')]);return squel[_0x4129('0x19')]()[_0x4129('0x2b')]('cm_contacts')[_0x4129('0x1b')](_0x2afa8e,squel[_0x4129('0x1f')]()[_0x4129('0x36')](_0x2afa8e)['from'](_0x2c7109)[_0x4129('0x24')]('('+_0xa191cc[_0x4129('0xf')](',')+_0x4129('0x37'),squel['select']()[_0x4129('0x36')](_0xa191cc)[_0x4129('0x20')](_0x4129('0x21'))[_0x4129('0x24')](_0x4129('0x30'),_0x33cdb3))[_0x4129('0x24')](_0x4129('0x38'),squel[_0x4129('0x1f')]()[_0x4129('0x39')](_0x4129('0x3a'),_0x4129('0x3b'))['from'](_0x2c7109)[_0x4129('0x3c')](_0xa191cc[_0x4129('0xf')](','))))[_0x4129('0x28')]();}function handleStop(){logger[_0x4129('0x3d')](_0x4129('0x3e'));stopped=!![];}function handleUncaughtException(_0x3ccf93){logger[_0x4129('0x3f')](_0x3ccf93[_0x4129('0x40')]);process[_0x4129('0x41')](0x1);}function handleError(_0x29e3b4,_0x5aaedd){stats[_0x4129('0x42')][_0x4129('0x43')]({'name':_0x5aaedd[_0x4129('0x44')],'message':_0x5aaedd['message'],'row':_0x29e3b4});}function handleQuery(_0x2a7993){logger[_0x4129('0x3d')](_0x2a7993);return db[_0x4129('0x45')]['query'](_0x2a7993)[_0x4129('0x46')](function(_0x486cc7){results[_0x4129('0x43')](_0x486cc7);})['catch'](function(_0x25018f){logger[_0x4129('0x3f')](_0x25018f[_0x4129('0x40')]);});}function main(_0xe1b6f2,_0x14a981,_0xef9e03,_0x49b0f5){logger[_0x4129('0x3d')](_0x4129('0x47'),_0xe1b6f2,JSON[_0x4129('0x48')](_0x14a981));process[_0x4129('0x49')](_0x4129('0x4a'));var _0x3a85f5=_0x14a981[_0x4129('0x4b')];var _0x4d2c7c=_0x14a981[_0x4129('0x4c')];var _0x30abc9=path[_0x4129('0xf')](config['root'],_0x4129('0x4d'),_0x4d2c7c+_0x4129('0x4e'));var _0x2ba865=_[_0x4129('0x33')](_0x3a85f5)['join']();logger[_0x4129('0x3d')](_0x4129('0x4f'),_0x2ba865);fs[_0x4129('0x50')](_0x30abc9,_0x2ba865+'\x0a');Papa[_0x4129('0x51')](fs[_0x4129('0x52')](_0xe1b6f2),{'header':!![],'skipEmptyLines':!![],'step':function(_0x18633b,_0x138b4c){try{for(var _0x54a7d4=0x0,_0x18c858=[];_0x54a7d4<_0x18633b[_0x4129('0x53')][_0x4129('0x54')];_0x54a7d4++){stats[_0x4129('0x55')]+=0x1;if(_0x18633b[_0x4129('0x42')][_0x54a7d4]){handleError(_0x18633b[_0x4129('0x53')][_0x54a7d4],_0x18633b[_0x4129('0x42')][_0x54a7d4]);}else{var _0x257ba6=[];for(var _0x52e0db in _0x3a85f5){if(_0x3a85f5[_0x4129('0x56')](_0x52e0db)){if(_0x18633b[_0x4129('0x53')][_0x54a7d4][_0x3a85f5[_0x52e0db]]){var _0x53dfcc=_[_0x4129('0x57')](_0x18633b[_0x4129('0x53')][_0x54a7d4][_0x3a85f5[_0x52e0db]][_0x4129('0x58')](/"/g,'\x27'));switch(_0x52e0db){case _0x4129('0x1c'):var _0x10a29a=moment(_0x53dfcc,_0x4129('0x59'),!![]);if(_0x10a29a[_0x4129('0x5a')]()){_0x18c858[_0x4129('0x43')]('\x22'+_0x53dfcc+'\x22');}else{_0x257ba6[_0x4129('0x43')](_0x4129('0x5b'));}break;case'priority':var _0x1cff0f=parseInt(_0x53dfcc);_0x53dfcc=_[_0x4129('0x5c')](_0x1cff0f)||_0x1cff0f<0x0||_0x1cff0f>0x4?_0x49b0f5?0x3:0x2:_0x1cff0f;_0x18c858[_0x4129('0x43')]('\x22'+_0x53dfcc+'\x22');break;case _0x4129('0x5d'):var _0x3a707c=parseInt(_0x53dfcc);if(_[_0x4129('0x5e')](_0x3a707c)&&_[_0x4129('0x5f')](_0xef9e03,_0x3a707c)){_0x18c858[_0x4129('0x43')]('\x22'+_0x3a707c+'\x22');}else{_0x257ba6[_0x4129('0x43')](_0x4129('0x60'));}break;case _0x4129('0x61'):if(isEmail(_0x53dfcc)){_0x18c858['push']('\x22'+_0x53dfcc+'\x22');}else{_0x257ba6[_0x4129('0x43')]('email\x20wrong\x20format');}break;case _0x4129('0x62'):var _0x13323d=moment(_0x53dfcc,_0x4129('0x63'),!![]);if(_0x13323d[_0x4129('0x5a')]()){_0x18c858[_0x4129('0x43')]('\x22'+_0x53dfcc+'\x22');}else{_0x257ba6[_0x4129('0x43')](_0x4129('0x64'));}break;default:_0x18c858['push']('\x22'+_0x53dfcc+'\x22');}}else{switch(_0x52e0db){case _0x4129('0x65'):case _0x4129('0xe'):_0x257ba6[_0x4129('0x43')](_0x52e0db+'\x20not\x20specified');break;default:_0x18c858[_0x4129('0x43')]('\x22\x22');}}}}if(_0x257ba6[_0x4129('0x54')]){handleError(_0x18633b[_0x4129('0x53')][_0x54a7d4],{'code':_0x4129('0x66'),'message':_0x257ba6[_0x4129('0xf')]()});}else{fs[_0x4129('0x67')](_0x30abc9,_0x18c858[_0x4129('0xf')]()+'\x0a');}_0x18c858=[];}if(!(stats[_0x4129('0x55')]%0xc8)){socket[_0x4129('0x68')](_0x4129('0x69')+_0x4d2c7c,stats);stats[_0x4129('0x42')]=[];}}if(stopped){logger[_0x4129('0x3d')](_0x4129('0x6a'));_0x138b4c[_0x4129('0x6b')]();}}catch(_0x762f4){handleError(_0x18633b[_0x4129('0x53')][_0x54a7d4],{'code':_0x4129('0x6c'),'message':_0x762f4[_0x4129('0x40')]});logger['error']('step',_0x762f4['message']);}},'complete':function(){try{var _0x4d0fd9=[];var _0x1823bd=_0x4129('0x21');if(_0x14a981['duplicates']&&_0x14a981[_0x4129('0x6d')][_0x4129('0x54')]){_0x1823bd=_0x4129('0x6e')+_0x4d2c7c;_0x4d0fd9[_0x4129('0x43')](_0x4129('0x6f')+_0x1823bd+_0x4129('0x70'));}var _0x15cce9=util[_0x4129('0xd')](_0x4129('0x71'),_0x30abc9,_0x1823bd,_0x2ba865,_0x14a981[_0x4129('0x2d')],_0x14a981['CompanyId']||null,NOW,NOW);if(_[_0x4129('0x72')](_0x3a85f5['scheduledat'])){_0x15cce9+=_0x4129('0x73');}_0x4d0fd9[_0x4129('0x43')](_0x15cce9);if(_0x14a981['duplicates']&&_0x14a981[_0x4129('0x6d')][_0x4129('0x54')]){_0x4d0fd9[_0x4129('0x43')](insertCmContact(_0x14a981[_0x4129('0x2d')],_0x1823bd,_0x14a981[_0x4129('0x6d')],_0x3a85f5));_0x4d0fd9[_0x4129('0x43')](_0x4129('0x74')+_0x1823bd+';');}_0x4d0fd9[_0x4129('0x43')](insertCmHopper(_0x14a981[_0x4129('0x2d')],'voice_queues_has_cm_lists',_0x4129('0x75'),_0x4129('0x76'),_0x49b0f5));_0x4d0fd9[_0x4129('0x43')](insertCmHopperBlack(_0x14a981[_0x4129('0x2d')],_0x4129('0x77'),_0x4129('0x75'),'VoiceQueueId'));_0x4d0fd9['push'](insertCmHopper(_0x14a981[_0x4129('0x2d')],_0x4129('0x78'),_0x4129('0x79'),_0x4129('0x7a'),_0x49b0f5));_0x4d0fd9[_0x4129('0x43')](insertCmHopperBlack(_0x14a981['ListId'],_0x4129('0x7b'),'campaigns','CampaignId'));BPromise[_0x4129('0x7c')](_0x4d0fd9,handleQuery)[_0x4129('0x7d')](function(_0x30e8a7){stats['finish']=!![];stats[_0x4129('0x7e')]=_0x14a981[_0x4129('0x6d')]&&_0x14a981['duplicates'][_0x4129('0x54')]?results[0x2][_0x4129('0x7e')]:results[0x0][_0x4129('0x7e')];socket['emit'](_0x4129('0x69')+_0x4d2c7c,stats);fs[_0x4129('0x7f')](_0xe1b6f2);fs[_0x4129('0x7f')](_0x30abc9);process[_0x4129('0x41')](0x0);})['catch'](function(_0x11c8d3){logger[_0x4129('0x3f')](_0x11c8d3[_0x4129('0x40')]);process[_0x4129('0x41')](0x1);});}catch(_0x3cd07b){logger['error'](_0x4129('0x80'),_0x3cd07b['message']);process[_0x4129('0x41')](0x1);}},'error':function(_0x5b3d3f,_0x5d004b,_0x238de3,_0x58537b){throw new Error(_0x58537b);}});}function validate(){if(process[_0x4129('0x81')]&&process[_0x4129('0x81')][_0x4129('0x54')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x10310f=path[_0x4129('0xf')](config['root'],'server/files/tmp',process[_0x4129('0x81')][0x2]);if(!fs[_0x4129('0x82')](_0x10310f)){throw new Error(_0x4129('0x83'));}var _0x379f77={};try{_0x379f77=JSON[_0x4129('0x51')](process['argv'][0x3]);if(!_0x379f77[_0x4129('0x4b')]){throw new Error(_0x4129('0x84'));}if(!_0x379f77['binding'][_0x4129('0xe')]){throw new Error(_0x4129('0x85'));}if(!_0x379f77['binding']['firstName']){throw new Error(_0x4129('0x86'));}var _0x5b5d64=0x0;if(_0x379f77[_0x4129('0x4b')][_0x4129('0x5d')]){_0x5b5d64=0x1;}if(!_0x379f77[_0x4129('0x2d')]){throw new Error(_0x4129('0x87'));}}catch(_0x27c771){throw new Error(_0x4129('0x88'));}var _0x1cdaf6=[];try{_0x1cdaf6=_['map'](JSON['parse'](process[_0x4129('0x81')][0x4]),'id');}catch(_0x5137f2){logger[_0x4129('0x3d')](_0x4129('0x89'));}main(_0x10310f,_0x379f77,_0x1cdaf6,_0x5b5d64);}validate();process['on'](_0x4129('0x8a'),handleStop);process['on'](_0x4129('0x8b'),handleUncaughtException);
\ No newline at end of file
diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js
index ae343fc..06319d5 100644
--- a/server/components/integrations/configuration.js
+++ b/server/components/integrations/configuration.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['Complete\x20Time','Duration','duration','Billable\x20Time','getSubjects','string','toLowerCase','voice','inbound','push','variable','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Answer\x20Time'];(function(_0x4845ca,_0x33b180){var _0x1cb08e=function(_0x587415){while(--_0x587415){_0x4845ca['push'](_0x4845ca['shift']());}};_0x1cb08e(++_0x33b180);}(_0xb10b,0x12a));var _0xbb10=function(_0x14634f,_0x5ed190){_0x14634f=_0x14634f-0x0;var _0x5021f9=_0xb10b[_0x14634f];return _0x5021f9;};'use strict';exports[_0xbb10('0x0')]=function(_0x4bb7bb,_0x390ae2){var _0x35bc5f=[{'type':_0xbb10('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x4bb7bb[_0xbb10('0x2')]()){case _0xbb10('0x3'):switch(_0x390ae2[_0xbb10('0x2')]()){case _0xbb10('0x4'):_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x6'),'content':'','variableName':'queue'});_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x6'),'content':'','variableName':'calleridnum'});break;case _0xbb10('0x7'):_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x1'),'content':_0xbb10('0x8'),'variableName':null});_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x6'),'content':'','variableName':_0xbb10('0x9')});break;}}return _0x35bc5f;};exports[_0xbb10('0xa')]=function(_0x5ab04a,_0x4e47f8){var _0x20bd61=[];switch(_0x5ab04a[_0xbb10('0x2')]()){case _0xbb10('0x3'):switch(_0x4e47f8['toLowerCase']()){case _0xbb10('0x4'):_0x20bd61=[{'type':'string','content':_0xbb10('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0xd'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0xe')},{'type':_0xbb10('0xc'),'content':'','key':'Caller\x20Name','keyType':_0xbb10('0x6'),'variableName':_0xbb10('0xf')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x10'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x11')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x12'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x13')},{'type':'keyValue','content':'','key':_0xbb10('0x14'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x15')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x16'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x17')},{'type':_0xbb10('0x1'),'content':_0xbb10('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':'Agent\x20Name','keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x19')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x1a'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x9')},{'type':'string','content':_0xbb10('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0xbb10('0x17')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x1c'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x1d')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x1e'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x1f')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x20'),'keyType':_0xbb10('0x6'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x21')}];break;case _0xbb10('0x7'):_0x20bd61=[{'type':'string','content':_0xbb10('0xb'),'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x22'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':_0xbb10('0x9')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x23'),'keyType':'variable','keyContent':'','variableName':_0xbb10('0x24')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x14'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':_0xbb10('0x15')},{'type':_0xbb10('0xc'),'content':'','key':'Date','keyType':_0xbb10('0x6'),'keyContent':'','variableName':'starttime'},{'type':_0xbb10('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x25'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0xbb10('0x26'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x27'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':_0xbb10('0x28')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x29'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x20bd61;};
\ No newline at end of file
+var _0x0b0e=['Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','UniqueId','Date','answertime','Complete\x20Time','Duration','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','uniqueid','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt'];(function(_0x14996e,_0x108636){var _0x2f0151=function(_0x20dd91){while(--_0x20dd91){_0x14996e['push'](_0x14996e['shift']());}};_0x2f0151(++_0x108636);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5e1e25,_0xdc1421){_0x5e1e25=_0x5e1e25-0x0;var _0x548e5f=_0x0b0e[_0x5e1e25];return _0x548e5f;};'use strict';exports[_0xe0b0('0x0')]=function(_0x503596,_0xc416e3){var _0x536e9b=[{'type':_0xe0b0('0x1'),'content':_0xe0b0('0x2'),'variableName':null}];switch(_0x503596[_0xe0b0('0x3')]()){case _0xe0b0('0x4'):switch(_0xc416e3[_0xe0b0('0x3')]()){case _0xe0b0('0x5'):_0x536e9b[_0xe0b0('0x6')]({'type':_0xe0b0('0x7'),'content':'','variableName':_0xe0b0('0x8')});_0x536e9b[_0xe0b0('0x6')]({'type':_0xe0b0('0x7'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x536e9b[_0xe0b0('0x6')]({'type':_0xe0b0('0x1'),'content':_0xe0b0('0x9'),'variableName':null});_0x536e9b[_0xe0b0('0x6')]({'type':'variable','content':'','variableName':_0xe0b0('0xa')});break;}}return _0x536e9b;};exports[_0xe0b0('0xb')]=function(_0x553d4f,_0x1fef28){var _0x2f32b6=[];switch(_0x553d4f['toLowerCase']()){case _0xe0b0('0x4'):switch(_0x1fef28[_0xe0b0('0x3')]()){case _0xe0b0('0x5'):_0x2f32b6=[{'type':'string','content':_0xe0b0('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0xe'),'keyType':_0xe0b0('0x7'),'variableName':_0xe0b0('0xf')},{'type':'keyValue','content':'','key':_0xe0b0('0x10'),'keyType':_0xe0b0('0x7'),'variableName':_0xe0b0('0x11')},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x12'),'keyType':'variable','variableName':_0xe0b0('0x13')},{'type':'keyValue','content':'','key':_0xe0b0('0x14'),'keyType':_0xe0b0('0x7'),'variableName':'queue'},{'type':_0xe0b0('0xd'),'content':'','key':'UniqueId','keyType':_0xe0b0('0x7'),'variableName':_0xe0b0('0x15')},{'type':'keyValue','content':'','key':'Date','keyType':_0xe0b0('0x7'),'variableName':'agentcalledAt'},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xe0b0('0xd'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0xe0b0('0x16')},{'type':'keyValue','content':'','key':_0xe0b0('0x17'),'keyType':'variable','variableName':_0xe0b0('0xa')},{'type':_0xe0b0('0x1'),'content':_0xe0b0('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x19'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xe0b0('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0xe0b0('0x7'),'variableName':_0xe0b0('0x1a')},{'type':'keyValue','content':'','key':_0xe0b0('0x1b'),'keyType':'variable','variableName':_0xe0b0('0x1c')},{'type':'keyValue','content':'','key':_0xe0b0('0x1d'),'keyType':'variable','variableName':_0xe0b0('0x1e')},{'type':'keyValue','content':'','key':_0xe0b0('0x1f'),'keyType':'variable','variableName':_0xe0b0('0x20')}];break;case'outbound':_0x2f32b6=[{'type':_0xe0b0('0x1'),'content':_0xe0b0('0xc'),'variableName':null},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x21'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':_0xe0b0('0xa')},{'type':'keyValue','content':'','key':_0xe0b0('0x22'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':'membername'},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x23'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':_0xe0b0('0x15')},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x24'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':'starttime'},{'type':_0xe0b0('0x1'),'content':_0xe0b0('0x18')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0xe0b0('0x7'),'keyContent':'','variableName':_0xe0b0('0x25')},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x26'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':'endtime'},{'type':_0xe0b0('0xd'),'content':'','key':_0xe0b0('0x27'),'keyType':_0xe0b0('0x7'),'keyContent':'','variableName':_0xe0b0('0x28')},{'type':_0xe0b0('0xd'),'content':'','key':'Billable\x20Time','keyType':_0xe0b0('0x7'),'keyContent':'','variableName':_0xe0b0('0x29')}];break;}}return _0x2f32b6;};
\ No newline at end of file
diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js
index d4d6fe9..d7228d7 100644
--- a/server/components/interaction/service.js
+++ b/server/components/interaction/service.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb1a4=['toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','Interaction','findOne','then','update','info','catch','error','user','query','clone','body','phone','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown'];(function(_0x888385,_0x9cdc66){var _0x22d5c2=function(_0x3b1599){while(--_0x3b1599){_0x888385['push'](_0x888385['shift']());}};_0x22d5c2(++_0x9cdc66);}(_0xb1a4,0x12e));var _0x4b1a=function(_0x17aa49,_0x345e4a){_0x17aa49=_0x17aa49-0x0;var _0x4b4b9c=_0xb1a4[_0x17aa49];return _0x4b4b9c;};'use strict';var _=require(_0x4b1a('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x4b1a('0x1'))(_0x4b1a('0x2')),'mail':require(_0x4b1a('0x1'))(_0x4b1a('0x3')),'fax':require(_0x4b1a('0x1'))(_0x4b1a('0x4')),'sms':require(_0x4b1a('0x1'))(_0x4b1a('0x5')),'chat':require('../../config/logger')(_0x4b1a('0x6'))};function getInteractionId(_0x30f694,_0x2afbac,_0x5b2eca){if(_0x30f694&&_0x30f694[_[_0x4b1a('0x7')](_0x5b2eca)+_0x4b1a('0x8')]){return _0x30f694[_[_0x4b1a('0x7')](_0x5b2eca)+_0x4b1a('0x8')];}else if(_0x30f694&&_0x30f694['id']){return _0x30f694['id'];}else if(_0x2afbac&&_0x2afbac['id']){return _0x2afbac['id'];}else{return _0x4b1a('0x9');}}function log(_0x20d051,_0x832896,_0x22c0e0,_0x72f367,_0x45b2a2,_0x235c08){loggers[_0x45b2a2[_0x4b1a('0xa')]()][_0x20d051](_0x4b1a('0xb'),_0x235c08[_0x4b1a('0xc')](),_0x832896?_0x832896['id']:null,_0x832896?_0x832896[_0x4b1a('0xd')]:null,_0x832896?_0x832896['role']:null,getInteractionId(_0x22c0e0,_0x72f367,_0x45b2a2),_0x22c0e0?JSON['stringify'](_0x22c0e0):'null');}function updateUser(_0x4bbf8c,_0x369b28,_0x40869b,_0x362e49,_0x1af9e7){db[_[_0x4b1a('0x7')](_0x362e49)+_0x4b1a('0xe')][_0x4b1a('0xf')]({'where':{'id':getInteractionId(_0x369b28,_0x40869b,_0x362e49)}})[_0x4b1a('0x10')](function(_0x103bb2){if(_0x103bb2){return _0x103bb2[_0x4b1a('0x11')]({'UserId':_0x4bbf8c?_0x4bbf8c['id']:null});}})[_0x4b1a('0x10')](function(_0x42ff64){if(_0x42ff64){log(_0x4b1a('0x12'),_0x4bbf8c,_0x369b28,_0x40869b,_0x362e49,_0x1af9e7);}})[_0x4b1a('0x13')](function(){log(_0x4b1a('0x14'),_0x4bbf8c,_0x369b28,_0x40869b,_0x362e49,_0x1af9e7);});}exports['tracked']=function(_0x197acc,_0x3813f6){return function(_0x471cd9,_0x591489,_0x2f8b7c){var _0x33df46=_0x471cd9[_0x4b1a('0x15')];var _0x53ecfb={};var _0x4ae729=_0x471cd9[_0x4b1a('0x16')];if(_0x53ecfb){_0x53ecfb=_[_0x4b1a('0x17')](_0x471cd9[_0x4b1a('0x18')]);_0x53ecfb=_['omit'](_0x53ecfb,['body','html',_0x4b1a('0x19'),'fax','mobile']);}updateUser(_0x33df46,_0x53ecfb,_0x4ae729,_0x197acc,_0x3813f6);_0x2f8b7c(null);};};
\ No newline at end of file
+var _0x25b0=['error','tracked','body','phone','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','InteractionId','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','then','update','info'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x25b0,0x123));var _0x025b=function(_0x9bca53,_0x59b4f8){_0x9bca53=_0x9bca53-0x0;var _0x3894bc=_0x25b0[_0x9bca53];return _0x3894bc;};'use strict';var _=require(_0x025b('0x0'));var db=require(_0x025b('0x1'))['db'];var loggers={'openchannel':require(_0x025b('0x2'))(_0x025b('0x3')),'mail':require('../../config/logger')(_0x025b('0x4')),'fax':require(_0x025b('0x2'))('fax-interactions'),'sms':require(_0x025b('0x2'))(_0x025b('0x5')),'chat':require(_0x025b('0x2'))('chat-interactions')};function getInteractionId(_0x13f782,_0x186597,_0x126e12){if(_0x13f782&&_0x13f782[_['upperFirst'](_0x126e12)+_0x025b('0x6')]){return _0x13f782[_[_0x025b('0x7')](_0x126e12)+'InteractionId'];}else if(_0x13f782&&_0x13f782['id']){return _0x13f782['id'];}else if(_0x186597&&_0x186597['id']){return _0x186597['id'];}else{return _0x025b('0x8');}}function log(_0x2f104f,_0x4ed9fc,_0x18c9eb,_0x5169e1,_0xa7ae4a,_0xb95410){loggers[_0xa7ae4a[_0x025b('0x9')]()][_0x2f104f](_0x025b('0xa'),_0xb95410[_0x025b('0xb')](),_0x4ed9fc?_0x4ed9fc['id']:null,_0x4ed9fc?_0x4ed9fc[_0x025b('0xc')]:null,_0x4ed9fc?_0x4ed9fc['role']:null,getInteractionId(_0x18c9eb,_0x5169e1,_0xa7ae4a),_0x18c9eb?JSON[_0x025b('0xd')](_0x18c9eb):'null');}function updateUser(_0x102dbb,_0xd4fe96,_0x211fb1,_0x157b4b,_0x339db0){db[_[_0x025b('0x7')](_0x157b4b)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0xd4fe96,_0x211fb1,_0x157b4b)}})[_0x025b('0xe')](function(_0x4b9f68){if(_0x4b9f68){return _0x4b9f68[_0x025b('0xf')]({'UserId':_0x102dbb?_0x102dbb['id']:null});}})[_0x025b('0xe')](function(_0x3ed23f){if(_0x3ed23f){log(_0x025b('0x10'),_0x102dbb,_0xd4fe96,_0x211fb1,_0x157b4b,_0x339db0);}})['catch'](function(){log(_0x025b('0x11'),_0x102dbb,_0xd4fe96,_0x211fb1,_0x157b4b,_0x339db0);});}exports[_0x025b('0x12')]=function(_0x566bc7,_0xc14918){return function(_0x5469f5,_0x5dab11,_0x2a981e){var _0x138b6a=_0x5469f5['user'];var _0x3a7fd2={};var _0xca0140=_0x5469f5['query'];if(_0x3a7fd2){_0x3a7fd2=_['clone'](_0x5469f5[_0x025b('0x13')]);_0x3a7fd2=_['omit'](_0x3a7fd2,[_0x025b('0x13'),'html',_0x025b('0x14'),'fax',_0x025b('0x15')]);}updateUser(_0x138b6a,_0x3a7fd2,_0xca0140,_0x566bc7,_0xc14918);_0x2a981e(null);};};
\ No newline at end of file
diff --git a/server/components/license/service.js b/server/components/license/service.js
index 731ba1d..7ced3f7 100644
--- a/server/components/license/service.js
+++ b/server/components/license/service.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3940=['catch','User','user','isUserLimit','crypto','util','../../mysqldb','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x546647,_0x4d0c63){var _0xc9d59d=function(_0x9b5e95){while(--_0x9b5e95){_0x546647['push'](_0x546647['shift']());}};_0xc9d59d(++_0x4d0c63);}(_0x3940,0xa6));var _0x0394=function(_0x3acc1f,_0x3cda5c){_0x3acc1f=_0x3acc1f-0x0;var _0x2bf4b8=_0x3940[_0x3acc1f];return _0x2bf4b8;};'use strict';var crypto=require(_0x0394('0x0'));var util=require(_0x0394('0x1'));var compose=require('composable-middleware');var db=require(_0x0394('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x166a6f,_0x35237f){if(_0x166a6f&&_0x35237f){if(_0x35237f['data1']&&_0x35237f[_0x0394('0x3')]){var _0x5697bd=_0x35237f[_0x0394('0x4')];var _0x307f10=_0x35237f['license'];var _0x289994=_0x5697bd[_0x0394('0x5')]('-')[0x4];var _0x510b8d=_0x5697bd[_0x0394('0x5')]('-')[0x0];var _0x4f6faa=crypto[_0x0394('0x6')](_0x0394('0x7'),util[_0x0394('0x8')](_0x0394('0x9'),_0x289994,_0x5697bd,_0x510b8d));var _0xf00b49=_0x4f6faa[_0x0394('0xa')](_0x307f10,_0x0394('0xb'),_0x0394('0xc'));_0xf00b49+=_0x4f6faa[_0x0394('0xd')](_0x0394('0xc'));var _0x569fb3=JSON[_0x0394('0xe')](_0xf00b49);return _0x569fb3[_0x0394('0xf')](_0x166a6f)?_0x569fb3[_0x166a6f]:null;}}return null;}function isLimit(_0x6f6c74,_0x46c0f8,_0x56fe9a,_0x10e241){var _0x7c3d40=_0x46c0f8;return compose()[_0x0394('0x10')](function(_0x51b215,_0x2762d7,_0x53cc66){return db[_0x0394('0x11')][_0x0394('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x0394('0x13')](function(_0x152622){var _0x401ed0=getValueFromLicense(_0x6f6c74,_0x152622);return _0x401ed0?_0x401ed0:_0x7c3d40;})[_0x0394('0x13')](function(_0x2d3caf){_0x7c3d40=_0x2d3caf;return _0x56fe9a['count'](_0x10e241);})[_0x0394('0x13')](function(_0x2ee844){if(_0x2ee844>=_0x7c3d40){return _0x2762d7[_0x0394('0x14')](0x193)[_0x0394('0x15')]({'message':util[_0x0394('0x8')](_0x0394('0x16'),_0x6f6c74)});}_0x53cc66();})[_0x0394('0x17')](function(_0x5d322e){_0x53cc66(_0x5d322e);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x0394('0x18')],{'where':{'$or':[{'role':'admin'},{'role':_0x0394('0x19')}]}});}exports[_0x0394('0x1a')]=isUserLimit;
\ No newline at end of file
+var _0xebd5=['License','findOne','then','count','status','json','catch','users','admin','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty'];(function(_0xb639f7,_0xa204ef){var _0x3cf682=function(_0x31e006){while(--_0x31e006){_0xb639f7['push'](_0xb639f7['shift']());}};_0x3cf682(++_0xa204ef);}(_0xebd5,0xf4));var _0x5ebd=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xebd5[_0xfae23b];return _0x200640;};'use strict';var crypto=require(_0x5ebd('0x0'));var util=require(_0x5ebd('0x1'));var compose=require('composable-middleware');var db=require(_0x5ebd('0x2'))['db'];var config=require(_0x5ebd('0x3'));function getValueFromLicense(_0xe55e7a,_0x497a62){if(_0xe55e7a&&_0x497a62){if(_0x497a62[_0x5ebd('0x4')]&&_0x497a62[_0x5ebd('0x5')]){var _0x3d98f4=_0x497a62[_0x5ebd('0x4')];var _0x322f36=_0x497a62[_0x5ebd('0x5')];var _0x197d85=_0x3d98f4[_0x5ebd('0x6')]('-')[0x4];var _0x414a67=_0x3d98f4[_0x5ebd('0x6')]('-')[0x0];var _0x15d0f4=crypto[_0x5ebd('0x7')]('aes-256-ctr',util[_0x5ebd('0x8')](_0x5ebd('0x9'),_0x197d85,_0x3d98f4,_0x414a67));var _0xcc4be3=_0x15d0f4[_0x5ebd('0xa')](_0x322f36,_0x5ebd('0xb'),_0x5ebd('0xc'));_0xcc4be3+=_0x15d0f4[_0x5ebd('0xd')](_0x5ebd('0xc'));var _0x2c364f=JSON[_0x5ebd('0xe')](_0xcc4be3);return _0x2c364f[_0x5ebd('0xf')](_0xe55e7a)?_0x2c364f[_0xe55e7a]:null;}}return null;}function isLimit(_0x453304,_0x517f4c,_0x2c0ddc,_0x35b775){var _0x459d86=_0x517f4c;return compose()['use'](function(_0x21a2e1,_0x5315ea,_0x4cde3e){return db[_0x5ebd('0x10')][_0x5ebd('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x5ebd('0x12')](function(_0x1bca06){var _0x115550=getValueFromLicense(_0x453304,_0x1bca06);return _0x115550?_0x115550:_0x459d86;})[_0x5ebd('0x12')](function(_0x2d989c){_0x459d86=_0x2d989c;return _0x2c0ddc[_0x5ebd('0x13')](_0x35b775);})[_0x5ebd('0x12')](function(_0xfb46c2){if(_0xfb46c2>=_0x459d86){return _0x5315ea[_0x5ebd('0x14')](0x193)[_0x5ebd('0x15')]({'message':util[_0x5ebd('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x453304)});}_0x4cde3e();})[_0x5ebd('0x16')](function(_0x1bccb9){_0x4cde3e(_0x1bccb9);});});}function isUserLimit(){return isLimit(_0x5ebd('0x17'),0x1,db['User'],{'where':{'$or':[{'role':_0x5ebd('0x18')},{'role':'user'}]}});}exports[_0x5ebd('0x19')]=isUserLimit;
\ No newline at end of file
diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js
index 55af546..f72499b 100644
--- a/server/components/parsers/qs.js
+++ b/server/components/parsers/qs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1aaf=['map','indexOf','priority','col','unsigned','substr','DESC','ASC','length','isObject','isString','unset','hasOwnProperty','omit','isNumeric','match','^[0-9]*$','isEmail','lodash','moment','sequelize','split','filters','isEmpty','forOwn','isArray','parse','limit','offset','sort'];(function(_0x5161fc,_0x37c5f6){var _0x38490b=function(_0x49ebd8){while(--_0x49ebd8){_0x5161fc['push'](_0x5161fc['shift']());}};_0x38490b(++_0x37c5f6);}(_0x1aaf,0x1b6));var _0xf1aa=function(_0x2ac626,_0x1688a2){_0x2ac626=_0x2ac626-0x0;var _0x24cd53=_0x1aaf[_0x2ac626];return _0x24cd53;};'use strict';var _=require(_0xf1aa('0x0'));var moment=require(_0xf1aa('0x1'));var sequelize=require(_0xf1aa('0x2'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x405767){var _0x407cc4=null;if(_0x405767){_0x407cc4=_0x405767[_0xf1aa('0x3')](',');}return _0x407cc4;};exports[_0xf1aa('0x4')]=function(_0xf5bedb){var _0x3fbbb0={};if(!_[_0xf1aa('0x5')](_0xf5bedb)){_0x3fbbb0={};_[_0xf1aa('0x6')](_0xf5bedb,function(_0x11aac5,_0x5b8c12){try{_0x3fbbb0[_0x5b8c12]=_[_0xf1aa('0x7')](_0x11aac5)?_0x11aac5:JSON[_0xf1aa('0x8')](_0x11aac5);}catch(_0x5a4a49){_0x3fbbb0[_0x5b8c12]=_0x11aac5['split'](',');}});}return _0x3fbbb0;};exports[_0xf1aa('0x9')]=function(_0x40083f){_0x40083f=parseInt(_0x40083f,0xa);if(!_0x40083f||_0x40083f<0x0){_0x40083f=LIMIT_VALUE;}return _0x40083f;};exports[_0xf1aa('0xa')]=function(_0x34cd5a){_0x34cd5a=parseInt(_0x34cd5a,0xa);if(!_0x34cd5a||_0x34cd5a<0x0){_0x34cd5a=0x0;}return _0x34cd5a;};exports[_0xf1aa('0xb')]=function(_0x46016a){var _0x535446,_0x4a8e34=null;if(_0x46016a){_0x535446=_0x46016a[_0xf1aa('0x3')](',');_0x4a8e34=_[_0xf1aa('0xc')](_0x535446,function(_0x4641a1){if(_0x4641a1[_0xf1aa('0xd')]('-')===0x0){return[_0x4641a1===_0xf1aa('0xe')?sequelize['cast'](sequelize[_0xf1aa('0xf')](_0xf1aa('0xe')),_0xf1aa('0x10')):_0x4641a1[_0xf1aa('0x11')](0x1),_0xf1aa('0x12')];}else{return[_0x4641a1===_0xf1aa('0xe')?sequelize['cast'](sequelize['col'](_0xf1aa('0xe')),_0xf1aa('0x10')):_0x4641a1,_0xf1aa('0x13')];}});}return _0x4a8e34;};exports['omit']=function(_0x4a2031,_0x18da62){if(_[_0xf1aa('0x5')](_0x4a2031)){return _0x4a2031;}if(_['isArray'](_0x4a2031)){for(var _0x494497=0x0;_0x494497<_0x4a2031[_0xf1aa('0x14')];_0x494497+=0x1){_0x4a2031[_0x494497]=this['omit'](_0x4a2031[_0x494497],_0x18da62);}return _0x4a2031;}if(!_[_0xf1aa('0x15')](_0x4a2031)){return _0x4a2031;}if(_[_0xf1aa('0x16')](_0x18da62)){_0x18da62=[_0x18da62];}if(!_[_0xf1aa('0x7')](_0x18da62)){return _0x4a2031;}for(var _0x1bc2d6=0x0;_0x1bc2d6<_0x18da62[_0xf1aa('0x14')];_0x1bc2d6+=0x1){_[_0xf1aa('0x17')](_0x4a2031,_0x18da62[_0x1bc2d6]);}for(var _0x597522 in _0x4a2031){if(_0x4a2031[_0xf1aa('0x18')](_0x597522)){_0x4a2031[_0x597522]=this[_0xf1aa('0x19')](_0x4a2031[_0x597522],_0x18da62);}}return _0x4a2031;};exports[_0xf1aa('0x1a')]=function(_0x481ea7){return _0x481ea7[_0xf1aa('0x1b')](RegExp(_0xf1aa('0x1c')))?!![]:![];};exports[_0xf1aa('0x1d')]=function(_0x1b485e){return _0x1b485e['match'](/^\S+@\S+$/)?!![]:![];};
\ No newline at end of file
+var _0xbde0=['ASC','length','omit','isObject','unset','hasOwnProperty','isNumeric','^[0-9]*$','match','lodash','moment','sequelize','fields','split','filters','isEmpty','forOwn','isArray','parse','limit','offset','sort','map','indexOf','cast','col','substr','DESC','priority','unsigned'];(function(_0x56bfe3,_0x2413e6){var _0x4881c2=function(_0x1cdaae){while(--_0x1cdaae){_0x56bfe3['push'](_0x56bfe3['shift']());}};_0x4881c2(++_0x2413e6);}(_0xbde0,0x1ad));var _0x0bde=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xbde0[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x0bde('0x0'));var moment=require(_0x0bde('0x1'));var sequelize=require(_0x0bde('0x2'));var LIMIT_VALUE=0xfa;exports[_0x0bde('0x3')]=function(_0x351bc7){var _0x61df9=null;if(_0x351bc7){_0x61df9=_0x351bc7[_0x0bde('0x4')](',');}return _0x61df9;};exports[_0x0bde('0x5')]=function(_0x69c06c){var _0x502d4e={};if(!_[_0x0bde('0x6')](_0x69c06c)){_0x502d4e={};_[_0x0bde('0x7')](_0x69c06c,function(_0x570b5d,_0x5d25cc){try{_0x502d4e[_0x5d25cc]=_[_0x0bde('0x8')](_0x570b5d)?_0x570b5d:JSON[_0x0bde('0x9')](_0x570b5d);}catch(_0x596e9f){_0x502d4e[_0x5d25cc]=_0x570b5d[_0x0bde('0x4')](',');}});}return _0x502d4e;};exports[_0x0bde('0xa')]=function(_0x55754f){_0x55754f=parseInt(_0x55754f,0xa);if(!_0x55754f||_0x55754f<0x0){_0x55754f=LIMIT_VALUE;}return _0x55754f;};exports[_0x0bde('0xb')]=function(_0x47c13f){_0x47c13f=parseInt(_0x47c13f,0xa);if(!_0x47c13f||_0x47c13f<0x0){_0x47c13f=0x0;}return _0x47c13f;};exports[_0x0bde('0xc')]=function(_0x149e75){var _0x5e048c,_0x2a0596=null;if(_0x149e75){_0x5e048c=_0x149e75[_0x0bde('0x4')](',');_0x2a0596=_[_0x0bde('0xd')](_0x5e048c,function(_0x4d2eba){if(_0x4d2eba[_0x0bde('0xe')]('-')===0x0){return[_0x4d2eba==='priority'?sequelize[_0x0bde('0xf')](sequelize[_0x0bde('0x10')]('priority'),'unsigned'):_0x4d2eba[_0x0bde('0x11')](0x1),_0x0bde('0x12')];}else{return[_0x4d2eba===_0x0bde('0x13')?sequelize[_0x0bde('0xf')](sequelize['col']('priority'),_0x0bde('0x14')):_0x4d2eba,_0x0bde('0x15')];}});}return _0x2a0596;};exports['omit']=function(_0x507c53,_0x5c8007){if(_[_0x0bde('0x6')](_0x507c53)){return _0x507c53;}if(_[_0x0bde('0x8')](_0x507c53)){for(var _0x23c13=0x0;_0x23c13<_0x507c53[_0x0bde('0x16')];_0x23c13+=0x1){_0x507c53[_0x23c13]=this[_0x0bde('0x17')](_0x507c53[_0x23c13],_0x5c8007);}return _0x507c53;}if(!_[_0x0bde('0x18')](_0x507c53)){return _0x507c53;}if(_['isString'](_0x5c8007)){_0x5c8007=[_0x5c8007];}if(!_[_0x0bde('0x8')](_0x5c8007)){return _0x507c53;}for(var _0x52cd76=0x0;_0x52cd76<_0x5c8007[_0x0bde('0x16')];_0x52cd76+=0x1){_[_0x0bde('0x19')](_0x507c53,_0x5c8007[_0x52cd76]);}for(var _0x1bb71b in _0x507c53){if(_0x507c53[_0x0bde('0x1a')](_0x1bb71b)){_0x507c53[_0x1bb71b]=this[_0x0bde('0x17')](_0x507c53[_0x1bb71b],_0x5c8007);}}return _0x507c53;};exports[_0x0bde('0x1b')]=function(_0x30d464){return _0x30d464['match'](RegExp(_0x0bde('0x1c')))?!![]:![];};exports['isEmail']=function(_0x1f9438){return _0x1f9438[_0x0bde('0x1d')](/^\S+@\S+$/)?!![]:![];};
\ No newline at end of file
diff --git a/server/config/express.js b/server/config/express.js
index f192a39..cb80702 100644
--- a/server/config/express.js
+++ b/server/config/express.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['50mb','express','serve-favicon','body-parser','errorhandler','passport','cors','moment','./environment','../mysqldb','get','use','public','favicon.ico','set','appPath','join','root','client','json\x20replacer','toISOString','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded'];(function(_0x3401ce,_0x5d1579){var _0x1bb79d=function(_0x46985e){while(--_0x46985e){_0x3401ce['push'](_0x3401ce['shift']());}};_0x1bb79d(++_0x5d1579);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var express=require(_0x0a9e('0x0'));var favicon=require(_0x0a9e('0x1'));var bodyParser=require(_0x0a9e('0x2'));var methodOverride=require('method-override');var cookieParser=require('cookie-parser');var errorHandler=require(_0x0a9e('0x3'));var path=require('path');var passport=require(_0x0a9e('0x4'));var cors=require(_0x0a9e('0x5'));var moment=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var db=require(_0x0a9e('0x8'))['db'];exports['default']=function(_0x219af0){var _0x441e3a=_0x219af0[_0x0a9e('0x9')]('env');if(_0x441e3a==='production'){_0x219af0[_0x0a9e('0xa')](favicon(path['join'](config['root'],_0x0a9e('0xb'),_0x0a9e('0xc'))));_0x219af0[_0x0a9e('0xd')](_0x0a9e('0xe'),path[_0x0a9e('0xf')](config[_0x0a9e('0x10')],'public'));}if(_0x441e3a==='development'||_0x441e3a==='test'){_0x219af0['use'](favicon(path[_0x0a9e('0xf')](config[_0x0a9e('0x10')],_0x0a9e('0x11'),_0x0a9e('0xc'))));_0x219af0[_0x0a9e('0xd')](_0x0a9e('0xe'),path['join'](config[_0x0a9e('0x10')],_0x0a9e('0x11')));_0x219af0[_0x0a9e('0xa')](errorHandler());}_0x219af0[_0x0a9e('0xd')](_0x0a9e('0x12'),function(_0x4d5611,_0x52a03d){if(this[_0x4d5611]instanceof Date){_0x52a03d=this[_0x4d5611][_0x0a9e('0x13')]()['split']('.')[0x0]+'Z';}return _0x52a03d;});_0x219af0[_0x0a9e('0xa')](express['static'](_0x219af0[_0x0a9e('0x9')](_0x0a9e('0xe'))));_0x219af0['set'](_0x0a9e('0x14'),config['root']+_0x0a9e('0x15'));_0x219af0[_0x0a9e('0x16')](_0x0a9e('0x17'),require(_0x0a9e('0x18'))[_0x0a9e('0x19')]);_0x219af0[_0x0a9e('0xd')](_0x0a9e('0x1a'),_0x0a9e('0x17'));_0x219af0[_0x0a9e('0xa')](bodyParser[_0x0a9e('0x1b')]({'limit':_0x0a9e('0x1c'),'extended':!![]}));_0x219af0[_0x0a9e('0xa')](bodyParser['json']({'limit':_0x0a9e('0x1c')}));_0x219af0[_0x0a9e('0xa')](cors());_0x219af0['use'](methodOverride());_0x219af0[_0x0a9e('0xa')](cookieParser());_0x219af0['use'](passport['initialize']());};
\ No newline at end of file
+var _0xe706=['toISOString','engine','html','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','use','join','root','public','favicon.ico','set','appPath','client'];(function(_0x28544a,_0x1d8c7f){var _0x1c3e91=function(_0x2f6354){while(--_0x2f6354){_0x28544a['push'](_0x28544a['shift']());}};_0x1c3e91(++_0x1d8c7f);}(_0xe706,0xa3));var _0x6e70=function(_0x5bb3a0,_0x3fd23a){_0x5bb3a0=_0x5bb3a0-0x0;var _0x1469dd=_0xe706[_0x5bb3a0];return _0x1469dd;};'use strict';var express=require(_0x6e70('0x0'));var favicon=require(_0x6e70('0x1'));var bodyParser=require(_0x6e70('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x6e70('0x3'));var errorHandler=require(_0x6e70('0x4'));var path=require(_0x6e70('0x5'));var passport=require(_0x6e70('0x6'));var cors=require(_0x6e70('0x7'));var moment=require(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var db=require(_0x6e70('0xa'))['db'];exports[_0x6e70('0xb')]=function(_0x4381d1){var _0x36357b=_0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'));if(_0x36357b===_0x6e70('0xe')){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12')));}if(_0x36357b==='development'||_0x36357b==='test'){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x16'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config['root'],'client'));_0x4381d1['use'](errorHandler());}_0x4381d1[_0x6e70('0x14')]('json\x20replacer',function(_0x53aed0,_0x304716){if(this[_0x53aed0]instanceof Date){_0x304716=this[_0x53aed0][_0x6e70('0x17')]()['split']('.')[0x0]+'Z';}return _0x304716;});_0x4381d1[_0x6e70('0xf')](express['static'](_0x4381d1[_0x6e70('0xc')](_0x6e70('0x15'))));_0x4381d1['set']('views',config[_0x6e70('0x11')]+'/server/views');_0x4381d1[_0x6e70('0x18')](_0x6e70('0x19'),require('ejs')['renderFile']);_0x4381d1[_0x6e70('0x14')](_0x6e70('0x1a'),_0x6e70('0x19'));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1b')]({'limit':_0x6e70('0x1c'),'extended':!![]}));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1d')]({'limit':_0x6e70('0x1c')}));_0x4381d1[_0x6e70('0xf')](cors());_0x4381d1['use'](methodOverride());_0x4381d1[_0x6e70('0xf')](cookieParser());_0x4381d1[_0x6e70('0xf')](passport[_0x6e70('0x1e')]());};
\ No newline at end of file
diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js
index db055ca..065a8f8 100644
--- a/server/config/license/hardware.js
+++ b/server/config/license/hardware.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xade4=['ipAddress','createHash','md5','substring','lodash','crypto','child_process','execSync','orderBy','keys','length','filter','family','IPv4','concat','head','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','update','digest','hex','getUuid','platform','dmidecode\x20--string\x20system-uuid','replace','hostname'];(function(_0x1a7d43,_0x4aa2c7){var _0x4a94da=function(_0x50e5fd){while(--_0x50e5fd){_0x1a7d43['push'](_0x1a7d43['shift']());}};_0x4a94da(++_0x4aa2c7);}(_0xade4,0x159));var _0x4ade=function(_0x353afa,_0x4b9bd1){_0x353afa=_0x353afa-0x0;var _0x15cf5a=_0xade4[_0x353afa];return _0x15cf5a;};'use strict';var _=require(_0x4ade('0x0'));var os=require('os');var crypto=require(_0x4ade('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x4ade('0x2'))[_0x4ade('0x3')];function getInterfaces(){var _0x53aefe=[];var _0x36abbe=os['networkInterfaces']();var _0x4bcd01=_[_0x4ade('0x4')](_[_0x4ade('0x5')](_0x36abbe));for(var _0x285eae=0x0;_0x285eae<_0x4bcd01[_0x4ade('0x6')];_0x285eae++){var _0x31b92b=_0x36abbe[_0x4bcd01[_0x285eae]][_0x4ade('0x7')](function(_0x2c0f26){return _0x2c0f26[_0x4ade('0x8')]===_0x4ade('0x9')&&_0x2c0f26['internal']===![];});_0x53aefe=_0x53aefe[_0x4ade('0xa')](_0x31b92b);}return _0x53aefe;}function getFirstInterface(){var _0x3d06e=_[_0x4ade('0xb')](getInterfaces());return{'macAddress':_0x3d06e&&_0x3d06e[_0x4ade('0xc')]?_0x3d06e[_0x4ade('0xc')]:'00:00:00:00:00:00','ipAddress':_0x3d06e&&_0x3d06e[_0x4ade('0xd')]?_0x3d06e['address']:_0x4ade('0xe')};}exports[_0x4ade('0xf')]=getFirstInterface;function getCPUhash(){var _0x78bae3=_[_0x4ade('0x4')](os[_0x4ade('0x10')]()[_0x4ade('0x11')](function(_0x2cabcb){return _0x2cabcb[_0x4ade('0x12')];}))['join'](':');return crypto['createHash']('md5')[_0x4ade('0x13')](_0x78bae3)[_0x4ade('0x14')](_0x4ade('0x15'));}exports[_0x4ade('0x16')]=function(){switch(os[_0x4ade('0x17')]()){case'win32':return exec(_0x4ade('0x18'),{'encoding':'utf8'})[_0x4ade('0x19')]('\x0d\x0a','');default:var _0x3f69b2=getFirstInterface();var _0x4d7d8b=getCPUhash();var _0x7074a2=_0x4d7d8b+'|'+os[_0x4ade('0x1a')]()+'|'+_0x3f69b2['macAddress']+'|'+_0x3f69b2[_0x4ade('0x1b')];var _0x455572=crypto[_0x4ade('0x1c')](_0x4ade('0x1d'))['update'](_0x7074a2)[_0x4ade('0x14')]('hex');return _0x455572['substring'](0x0,0x8)+'-'+_0x455572[_0x4ade('0x1e')](0x8,0xc)+'-'+_0x455572[_0x4ade('0x1e')](0xc,0x10)+'-'+_0x455572[_0x4ade('0x1e')](0x10,0x14)+'-'+_0x455572[_0x4ade('0x1e')](0x14);}};
\ No newline at end of file
+var _0x3965=['update','substring','lodash','crypto','child_process','execSync','orderBy','keys','length','filter','family','IPv4','internal','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','join','createHash','md5','digest','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress'];(function(_0x2b1551,_0x1776fe){var _0x2fc2a1=function(_0x5d43c8){while(--_0x5d43c8){_0x2b1551['push'](_0x2b1551['shift']());}};_0x2fc2a1(++_0x1776fe);}(_0x3965,0x1a2));var _0x5396=function(_0x3891e8,_0x3b6b95){_0x3891e8=_0x3891e8-0x0;var _0xc34c60=_0x3965[_0x3891e8];return _0xc34c60;};'use strict';var _=require(_0x5396('0x0'));var os=require('os');var crypto=require(_0x5396('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x5396('0x2'))[_0x5396('0x3')];function getInterfaces(){var _0x445427=[];var _0x260d33=os['networkInterfaces']();var _0x3d0205=_[_0x5396('0x4')](_[_0x5396('0x5')](_0x260d33));for(var _0x27576d=0x0;_0x27576d<_0x3d0205[_0x5396('0x6')];_0x27576d++){var _0x133bb3=_0x260d33[_0x3d0205[_0x27576d]][_0x5396('0x7')](function(_0x30f9e1){return _0x30f9e1[_0x5396('0x8')]===_0x5396('0x9')&&_0x30f9e1[_0x5396('0xa')]===![];});_0x445427=_0x445427['concat'](_0x133bb3);}return _0x445427;}function getFirstInterface(){var _0x282aad=_['head'](getInterfaces());return{'macAddress':_0x282aad&&_0x282aad[_0x5396('0xb')]?_0x282aad[_0x5396('0xb')]:_0x5396('0xc'),'ipAddress':_0x282aad&&_0x282aad[_0x5396('0xd')]?_0x282aad[_0x5396('0xd')]:'127.0.0.1'};}exports[_0x5396('0xe')]=getFirstInterface;function getCPUhash(){var _0x16191f=_[_0x5396('0x4')](os[_0x5396('0xf')]()[_0x5396('0x10')](function(_0x162381){return _0x162381[_0x5396('0x11')];}))[_0x5396('0x12')](':');return crypto[_0x5396('0x13')](_0x5396('0x14'))['update'](_0x16191f)[_0x5396('0x15')]('hex');}exports[_0x5396('0x16')]=function(){switch(os[_0x5396('0x17')]()){case _0x5396('0x18'):return exec(_0x5396('0x19'),{'encoding':_0x5396('0x1a')})[_0x5396('0x1b')]('\x0d\x0a','');default:var _0x5b7e9e=getFirstInterface();var _0x38b882=getCPUhash();var _0x4f6916=_0x38b882+'|'+os[_0x5396('0x1c')]()+'|'+_0x5b7e9e[_0x5396('0x1d')]+'|'+_0x5b7e9e['ipAddress'];var _0x2c4293=crypto[_0x5396('0x13')]('md5')[_0x5396('0x1e')](_0x4f6916)[_0x5396('0x15')]('hex');return _0x2c4293['substring'](0x0,0x8)+'-'+_0x2c4293[_0x5396('0x1f')](0x8,0xc)+'-'+_0x2c4293['substring'](0xc,0x10)+'-'+_0x2c4293[_0x5396('0x1f')](0x10,0x14)+'-'+_0x2c4293[_0x5396('0x1f')](0x14);}};
\ No newline at end of file
diff --git a/server/config/license/index.js b/server/config/license/index.js
index 8af8f53..93395e9 100644
--- a/server/config/license/index.js
+++ b/server/config/license/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9370=['DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','error','message','getUuid','License','spread','default','util','crypto','moment','bluebird','pkginfo','version','../../mysqldb','../environment','./hardware','../logger','../../api/jira/jira.controller','format','exports','then','createCipher','aes-256-ctr','session','update','utf8','base64','final','createDecipher','secrets','User','findOne','admin','fullname','|uuid|','|machineUuid|','|name|','email','getFirstInterface','ipAddress','openIssue','Alert','get','active','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days'];(function(_0x26c9e4,_0xf6affd){var _0x2d7efa=function(_0x15f497){while(--_0x15f497){_0x26c9e4['push'](_0x26c9e4['shift']());}};_0x2d7efa(++_0xf6affd);}(_0x9370,0x83));var _0x0937=function(_0x4606fb,_0x482674){_0x4606fb=_0x4606fb-0x0;var _0xd1e979=_0x9370[_0x4606fb];return _0xd1e979;};'use strict';var util=require(_0x0937('0x0'));var crypto=require(_0x0937('0x1'));var moment=require(_0x0937('0x2'));var rp=require('request-promise');var BPromise=require(_0x0937('0x3'));var pkginfo=require(_0x0937('0x4'))(module,_0x0937('0x5'));var db=require(_0x0937('0x6'))['db'];var config=require(_0x0937('0x7'));var hardware=require(_0x0937('0x8'));var logger=require(_0x0937('0x9'))('license');var jira=require(_0x0937('0xa'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x33347c){return new BPromise(function(_0x4e7afa,_0x5750d5){var _0x5b4777=util[_0x0937('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x33347c,module[_0x0937('0xc')]['version']);if(oldToken){_0x5b4777=util[_0x0937('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x33347c,module[_0x0937('0xc')][_0x0937('0x5')],oldToken);}var _0x368597={'uri':_0x5b4777,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x368597)[_0x0937('0xd')](function(_0x48f74d){_0x4e7afa(_0x48f74d);})['catch'](function(_0xdaabd5){_0x5750d5(_0xdaabd5);});});}function encryptDate(_0x2949be){var _0x36afc1=crypto[_0x0937('0xe')](_0x0937('0xf'),config['secrets'][_0x0937('0x10')]);var _0x526a69=_0x36afc1[_0x0937('0x11')](_0x2949be,_0x0937('0x12'),_0x0937('0x13'));_0x526a69+=_0x36afc1[_0x0937('0x14')]('base64');return _0x526a69;}function decryptDate(_0x1bb534){var _0x4221da=crypto[_0x0937('0x15')](_0x0937('0xf'),config[_0x0937('0x16')][_0x0937('0x10')]);var _0x2df932=_0x4221da[_0x0937('0x11')](_0x1bb534,'base64',_0x0937('0x12'));_0x2df932+=_0x4221da['final'](_0x0937('0x12'));return _0x2df932;}function sendJiraAlert(_0x5642bd,_0x5b5cab,_0x1fd907){var _0x34076c='||FIELD||VALUE||\x0a';return db[_0x0937('0x17')][_0x0937('0x18')]({'where':{'role':_0x0937('0x19')},'attributes':[_0x0937('0x1a'),'email'],'raw':!![]})[_0x0937('0xd')](function(_0xa924b1){ADMIN=_0xa924b1;_0x34076c+='|reason|'+_0x1fd907+'|\x0a';_0x34076c+=_0x0937('0x1b')+_0x5642bd+'|\x0a';_0x34076c+=_0x0937('0x1c')+_0x5b5cab+'|\x0a';_0x34076c+=_0x0937('0x1d')+ADMIN[_0x0937('0x1a')]+'|\x0a';_0x34076c+='|email|'+ADMIN[_0x0937('0x1e')]+'|\x0a';return _0x34076c;})[_0x0937('0xd')](function(_0x52279d){var _0x45c5cf=hardware[_0x0937('0x1f')]()[_0x0937('0x20')];return jira[_0x0937('0x21')]({'key':'MOTLICENSE','summary':'Motion\x20License\x20Alert','description':_0x52279d,'issuetype':_0x0937('0x22'),'oldToken':_0x5642bd,'newToken':_0x5b5cab,'email':ADMIN[_0x0937('0x1e')],'name':ADMIN[_0x0937('0x1a')],'reason':GRAY_PERIOD_REASON,'ip':_0x45c5cf});});}function manageLicense(_0x1f32fa,_0x5c5ee4){var _0x190261=_0x5c5ee4[_0x0937('0x23')]({'plain':!![]});httpRequest(_0x1f32fa)['then'](function(_0x486c47){if(oldToken){oldToken=undefined;}if(_0x486c47[_0x0937('0x24')]){if(!_0x190261[_0x0937('0x25')]&&_0x190261[_0x0937('0x25')]!=_0x486c47[_0x0937('0x25')]||_0x190261[_0x0937('0x25')]&&_0x190261[_0x0937('0x26')]){logger[_0x0937('0x27')](_0x0937('0x28'));}if(_0x190261['license']&&!_0x190261[_0x0937('0x26')]&&_0x190261[_0x0937('0x25')]!=_0x486c47[_0x0937('0x25')]){logger[_0x0937('0x27')](_0x0937('0x29'));}if(_0x190261[_0x0937('0x25')]&&!_0x190261[_0x0937('0x26')]&&_0x190261[_0x0937('0x25')]==_0x486c47[_0x0937('0x25')]){return _0x5c5ee4;}return _0x5c5ee4[_0x0937('0x11')]({'data1':_0x1f32fa,'data2':null,'license':_0x486c47['license']});}else{if(_0x486c47[_0x0937('0x25')]||_0x190261[_0x0937('0x25')]){if(!_0x190261['data2']){if(_0x190261[_0x0937('0x2a')]==_0x1f32fa){GRAY_PERIOD_REASON=_0x0937('0x2b');logger[_0x0937('0x27')](_0x0937('0x2c'));}else{GRAY_PERIOD_REASON=_0x0937('0x2d');oldToken=_0x190261[_0x0937('0x2a')];logger[_0x0937('0x27')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x190261[_0x0937('0x2a')],_0x1f32fa);}sendJiraAlert(_0x190261['data1'],_0x486c47[_0x0937('0x2e')],GRAY_PERIOD_REASON);logger[_0x0937('0x27')](_0x0937('0x2f'),GRAY_PERIOD_REASON[_0x0937('0x30')](),moment()[_0x0937('0xb')](_0x0937('0x31')));return _0x5c5ee4[_0x0937('0x11')]({'data2':encryptDate(moment()[_0x0937('0xb')](_0x0937('0x31')))});}else{if(moment()[_0x0937('0x32')](decryptDate(_0x190261[_0x0937('0x26')]),_0x0937('0x33'))>DAYS){logger[_0x0937('0x27')](_0x0937('0x34'),moment()[_0x0937('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x5c5ee4['update']({'data1':_0x1f32fa,'data2':null,'license':null});}}}else{if(_0x190261[_0x0937('0x2a')]!=_0x1f32fa){logger['info'](_0x0937('0x35'),_0x190261[_0x0937('0x2a')],_0x1f32fa);return _0x5c5ee4[_0x0937('0x11')]({'data1':_0x1f32fa,'data2':null,'license':null});}}}return _0x5c5ee4;})[_0x0937('0xd')](function(_0x16eaab){_0x5c5ee4=_0x16eaab;})[_0x0937('0x36')](function(_0x23e538){logger[_0x0937('0x37')](_0x23e538[_0x0937('0x38')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x0937('0x39')](),_0x5c5ee4);},TIME);});}function defaultLicense(){var _0x50342c=hardware['getUuid']();if(_0x50342c){return db[_0x0937('0x3a')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x50342c}})[_0x0937('0x3b')](function(_0x2a4363,_0x2074a1){logger[_0x0937('0x27')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x50342c);manageLicense(_0x50342c,_0x2a4363);})[_0x0937('0x36')](function(_0x3526ce){logger[_0x0937('0x37')](_0x3526ce['message']);});}}exports[_0x0937('0x3c')]=defaultLicense;
\ No newline at end of file
+var _0x65a6=['https://www.xcallymotion.com','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','createCipher','aes-256-ctr','session','update','final','base64','secrets','User','findOne','email','|machineUuid|','|name|','fullname','|email|','getFirstInterface','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','format','diff','days','DEMO\x20START\x20AT\x20%s','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','message','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../environment','./hardware','../logger','license'];(function(_0x19e96c,_0x56c275){var _0x4fe77c=function(_0x283a75){while(--_0x283a75){_0x19e96c['push'](_0x19e96c['shift']());}};_0x4fe77c(++_0x56c275);}(_0x65a6,0xd9));var _0x665a=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0x65a6[_0x146484];return _0x4c7aa3;};'use strict';var util=require(_0x665a('0x0'));var crypto=require('crypto');var moment=require(_0x665a('0x1'));var rp=require(_0x665a('0x2'));var BPromise=require(_0x665a('0x3'));var pkginfo=require(_0x665a('0x4'))(module,_0x665a('0x5'));var db=require(_0x665a('0x6'))['db'];var config=require(_0x665a('0x7'));var hardware=require(_0x665a('0x8'));var logger=require(_0x665a('0x9'))(_0x665a('0xa'));var jira=require('../../api/jira/jira.controller');var HOST=_0x665a('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x29aee5){return new BPromise(function(_0x371f91,_0x50c007){var _0x906d12=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x29aee5,module[_0x665a('0xc')][_0x665a('0x5')]);if(oldToken){_0x906d12=util['format'](_0x665a('0xd'),HOST,_0x29aee5,module[_0x665a('0xc')]['version'],oldToken);}var _0xbc5ad1={'uri':_0x906d12,'method':_0x665a('0xe'),'timeout':0xea60,'json':!![]};return rp(_0xbc5ad1)[_0x665a('0xf')](function(_0x76e33c){_0x371f91(_0x76e33c);})['catch'](function(_0x2f6ef3){_0x50c007(_0x2f6ef3);});});}function encryptDate(_0x59fdab){var _0x23918e=crypto[_0x665a('0x10')](_0x665a('0x11'),config['secrets'][_0x665a('0x12')]);var _0x32b7e4=_0x23918e[_0x665a('0x13')](_0x59fdab,'utf8','base64');_0x32b7e4+=_0x23918e[_0x665a('0x14')](_0x665a('0x15'));return _0x32b7e4;}function decryptDate(_0x269789){var _0x4c7d86=crypto['createDecipher']('aes-256-ctr',config[_0x665a('0x16')][_0x665a('0x12')]);var _0x495ef1=_0x4c7d86[_0x665a('0x13')](_0x269789,_0x665a('0x15'),'utf8');_0x495ef1+=_0x4c7d86[_0x665a('0x14')]('utf8');return _0x495ef1;}function sendJiraAlert(_0x53e53b,_0x68f176,_0x3ff8d6){var _0x137a21='||FIELD||VALUE||\x0a';return db[_0x665a('0x17')][_0x665a('0x18')]({'where':{'role':'admin'},'attributes':['fullname',_0x665a('0x19')],'raw':!![]})[_0x665a('0xf')](function(_0x4e4bda){ADMIN=_0x4e4bda;_0x137a21+='|reason|'+_0x3ff8d6+'|\x0a';_0x137a21+='|uuid|'+_0x53e53b+'|\x0a';_0x137a21+=_0x665a('0x1a')+_0x68f176+'|\x0a';_0x137a21+=_0x665a('0x1b')+ADMIN[_0x665a('0x1c')]+'|\x0a';_0x137a21+=_0x665a('0x1d')+ADMIN[_0x665a('0x19')]+'|\x0a';return _0x137a21;})[_0x665a('0xf')](function(_0x84713b){var _0x5cc2aa=hardware[_0x665a('0x1e')]()['ipAddress'];return jira[_0x665a('0x1f')]({'key':_0x665a('0x20'),'summary':_0x665a('0x21'),'description':_0x84713b,'issuetype':_0x665a('0x22'),'oldToken':_0x53e53b,'newToken':_0x68f176,'email':ADMIN[_0x665a('0x19')],'name':ADMIN[_0x665a('0x1c')],'reason':GRAY_PERIOD_REASON,'ip':_0x5cc2aa});});}function manageLicense(_0x23d504,_0x598d4f){var _0x594033=_0x598d4f[_0x665a('0x23')]({'plain':!![]});httpRequest(_0x23d504)[_0x665a('0xf')](function(_0x4ccaf0){if(oldToken){oldToken=undefined;}if(_0x4ccaf0['active']){if(!_0x594033[_0x665a('0xa')]&&_0x594033[_0x665a('0xa')]!=_0x4ccaf0[_0x665a('0xa')]||_0x594033[_0x665a('0xa')]&&_0x594033[_0x665a('0x24')]){logger[_0x665a('0x25')](_0x665a('0x26'));}if(_0x594033['license']&&!_0x594033['data2']&&_0x594033[_0x665a('0xa')]!=_0x4ccaf0[_0x665a('0xa')]){logger[_0x665a('0x25')](_0x665a('0x27'));}if(_0x594033[_0x665a('0xa')]&&!_0x594033['data2']&&_0x594033[_0x665a('0xa')]==_0x4ccaf0[_0x665a('0xa')]){return _0x598d4f;}return _0x598d4f['update']({'data1':_0x23d504,'data2':null,'license':_0x4ccaf0['license']});}else{if(_0x4ccaf0[_0x665a('0xa')]||_0x594033[_0x665a('0xa')]){if(!_0x594033[_0x665a('0x24')]){if(_0x594033['data1']==_0x23d504){GRAY_PERIOD_REASON=_0x665a('0x28');logger[_0x665a('0x25')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x665a('0x29');oldToken=_0x594033['data1'];logger[_0x665a('0x25')](_0x665a('0x2a'),_0x594033['data1'],_0x23d504);}sendJiraAlert(_0x594033[_0x665a('0x2b')],_0x4ccaf0['uuid'],GRAY_PERIOD_REASON);logger[_0x665a('0x25')](_0x665a('0x2c'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x598d4f['update']({'data2':encryptDate(moment()[_0x665a('0x2d')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x665a('0x2e')](decryptDate(_0x594033[_0x665a('0x24')]),_0x665a('0x2f'))>DAYS){logger[_0x665a('0x25')](_0x665a('0x30'),moment()[_0x665a('0x2d')]('YYYY-MM-DD\x20HH:mm'));return _0x598d4f[_0x665a('0x13')]({'data1':_0x23d504,'data2':null,'license':null});}}}else{if(_0x594033[_0x665a('0x2b')]!=_0x23d504){logger[_0x665a('0x25')](_0x665a('0x2a'),_0x594033[_0x665a('0x2b')],_0x23d504);return _0x598d4f[_0x665a('0x13')]({'data1':_0x23d504,'data2':null,'license':null});}}}return _0x598d4f;})[_0x665a('0xf')](function(_0x11cee9){_0x598d4f=_0x11cee9;})['catch'](function(_0x375b6a){logger['error'](_0x375b6a['message']);})[_0x665a('0x31')](function(){setTimeout(function(){manageLicense(hardware[_0x665a('0x32')](),_0x598d4f);},TIME);});}function defaultLicense(){var _0x24813b=hardware[_0x665a('0x32')]();if(_0x24813b){return db['License'][_0x665a('0x33')]({'where':{'id':0x1},'defaults':{'data1':_0x24813b}})[_0x665a('0x34')](function(_0x1bce13,_0x5063af){logger['info'](_0x665a('0x35'),_0x24813b);manageLicense(_0x24813b,_0x1bce13);})[_0x665a('0x36')](function(_0x118f41){logger['error'](_0x118f41[_0x665a('0x37')]);});}}exports[_0x665a('0x38')]=defaultLicense;
\ No newline at end of file
diff --git a/server/config/license/util.js b/server/config/license/util.js
index 54b230c..31119c3 100644
--- a/server/config/license/util.js
+++ b/server/config/license/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf372=['isEmpty','data1','data2','createDecipher','format','%s:%s:%s','utf8','parse','demo','machineUuid','getUuid','secrets','session','update','gray','days','grayReason','uuid','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','Demo\x20license','getLicense','find','then','checkLicense','crypto','util','./hardware','../../mysqldb','license'];(function(_0x48191a,_0xa59be7){var _0x1bb46b=function(_0x5e8f6e){while(--_0x5e8f6e){_0x48191a['push'](_0x48191a['shift']());}};_0x1bb46b(++_0xa59be7);}(_0xf372,0x1bb));var _0x2f37=function(_0x1fb573,_0x138b81){_0x1fb573=_0x1fb573-0x0;var _0xa27e7c=_0xf372[_0x1fb573];return _0xa27e7c;};'use strict';var crypto=require(_0x2f37('0x0'));var util=require(_0x2f37('0x1'));var _=require('lodash');var moment=require('moment');var hardware=require(_0x2f37('0x2'));var config=require('../environment');var db=require(_0x2f37('0x3'))['db'];function checkLicense(_0x52cae7,_0x41c6dd){if(_0x52cae7){try{var _0x464824=_0x41c6dd||_0x52cae7[_0x2f37('0x4')];if(_[_0x2f37('0x5')](_0x464824)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x98acf2=_0x52cae7[_0x2f37('0x6')];var _0x49c776=_0x52cae7[_0x2f37('0x7')];var _0x5050e0=_0x98acf2['split']('-')[0x4];var _0x126254=_0x98acf2['split']('-')[0x0];var _0x8a842e=crypto[_0x2f37('0x8')]('aes-256-ctr',util[_0x2f37('0x9')](_0x2f37('0xa'),_0x5050e0,_0x98acf2,_0x126254));var _0x570022=_0x8a842e['update'](_0x464824,'base64','utf8');_0x570022+=_0x8a842e['final'](_0x2f37('0xb'));var _0x36c455=JSON[_0x2f37('0xc')](_0x570022);_0x36c455[_0x2f37('0xd')]=![];_0x36c455['uuid']=_0x98acf2;_0x36c455[_0x2f37('0xe')]=hardware[_0x2f37('0xf')]();if(_0x49c776){var _0x44f273=crypto['createDecipher']('aes-256-ctr',config[_0x2f37('0x10')][_0x2f37('0x11')]);var _0x2038a4=_0x44f273[_0x2f37('0x12')](_0x49c776,'base64',_0x2f37('0xb'));_0x2038a4+=_0x44f273['final'](_0x2f37('0xb'));_0x36c455[_0x2f37('0x13')]=_0x2038a4;_0x36c455['deadline']=moment(_0x2038a4)['add'](0x7,_0x2f37('0x14'))['format']();_0x36c455[_0x2f37('0x15')]=_0x36c455[_0x2f37('0x16')]!=_0x36c455[_0x2f37('0xe')]?_0x2f37('0x17'):_0x2f37('0x18');}return _0x36c455;}catch(_0x24cd54){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2f37('0x19'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2f37('0x1a'),'uuid':_0x52cae7[_0x2f37('0x6')],'machineUuid':hardware[_0x2f37('0xf')](),'message':_0x24cd54['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2f37('0x19'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x2f37('0x1b'),'uuid':_0x52cae7[_0x2f37('0x6')],'machineUuid':hardware[_0x2f37('0xf')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x2f37('0x1c')]=function(_0x3ab720){return db['License'][_0x2f37('0x1d')](_['defaults'](_0x3ab720,{'raw':!![],'where':{'id':0x1}}))[_0x2f37('0x1e')](function(_0x2bf241){return checkLicense(_0x2bf241,null);});};exports[_0x2f37('0x1f')]=checkLicense;
\ No newline at end of file
+var _0xb903=['message','Demo\x20license','getLicense','License','checkLicense','crypto','util','lodash','moment','../environment','license','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','final','parse','demo','machineUuid','getUuid','secrets','session','utf8','gray','add','days','grayReason','uuid','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0xb903,0x1c1));var _0x3b90=function(_0x1d6d89,_0x239d26){_0x1d6d89=_0x1d6d89-0x0;var _0x5708af=_0xb903[_0x1d6d89];return _0x5708af;};'use strict';var crypto=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var _=require(_0x3b90('0x2'));var moment=require(_0x3b90('0x3'));var hardware=require('./hardware');var config=require(_0x3b90('0x4'));var db=require('../../mysqldb')['db'];function checkLicense(_0x1f0429,_0x2f21dd){if(_0x1f0429){try{var _0x169482=_0x2f21dd||_0x1f0429[_0x3b90('0x5')];if(_['isEmpty'](_0x169482)){throw new Error(_0x3b90('0x6'));}var _0x330df5=_0x1f0429[_0x3b90('0x7')];var _0x110125=_0x1f0429[_0x3b90('0x8')];var _0x39b021=_0x330df5[_0x3b90('0x9')]('-')[0x4];var _0x542195=_0x330df5['split']('-')[0x0];var _0x5e57ad=crypto[_0x3b90('0xa')](_0x3b90('0xb'),util[_0x3b90('0xc')](_0x3b90('0xd'),_0x39b021,_0x330df5,_0x542195));var _0x21e180=_0x5e57ad[_0x3b90('0xe')](_0x169482,'base64','utf8');_0x21e180+=_0x5e57ad[_0x3b90('0xf')]('utf8');var _0x265ea1=JSON[_0x3b90('0x10')](_0x21e180);_0x265ea1[_0x3b90('0x11')]=![];_0x265ea1['uuid']=_0x330df5;_0x265ea1[_0x3b90('0x12')]=hardware[_0x3b90('0x13')]();if(_0x110125){var _0x474b30=crypto[_0x3b90('0xa')](_0x3b90('0xb'),config[_0x3b90('0x14')][_0x3b90('0x15')]);var _0xf5d89f=_0x474b30[_0x3b90('0xe')](_0x110125,'base64',_0x3b90('0x16'));_0xf5d89f+=_0x474b30['final']('utf8');_0x265ea1[_0x3b90('0x17')]=_0xf5d89f;_0x265ea1['deadline']=moment(_0xf5d89f)[_0x3b90('0x18')](0x7,_0x3b90('0x19'))['format']();_0x265ea1[_0x3b90('0x1a')]=_0x265ea1[_0x3b90('0x1b')]!=_0x265ea1[_0x3b90('0x12')]?_0x3b90('0x1c'):_0x3b90('0x1d');}return _0x265ea1;}catch(_0x36aab7){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3b90('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3b90('0x1f'),'uuid':_0x1f0429[_0x3b90('0x7')],'machineUuid':hardware[_0x3b90('0x13')](),'message':_0x36aab7[_0x3b90('0x20')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3b90('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x3b90('0x21'),'uuid':_0x1f0429['data1'],'machineUuid':hardware[_0x3b90('0x13')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x3b90('0x22')]=function(_0x378bac){return db[_0x3b90('0x23')]['find'](_['defaults'](_0x378bac,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x332628){return checkLicense(_0x332628,null);});};exports[_0x3b90('0x24')]=checkLicense;
\ No newline at end of file
diff --git a/server/config/local.env.js b/server/config/local.env.js
index 3074ebd..6704d24 100644
--- a/server/config/local.env.js
+++ b/server/config/local.env.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x13c0=['app-id','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x7c4465,_0xcb0348){var _0x5a648a=function(_0x4350a8){while(--_0x4350a8){_0x7c4465['push'](_0x7c4465['shift']());}};_0x5a648a(++_0xcb0348);}(_0x13c0,0x79));var _0x013c=function(_0x389c94,_0x2a93d9){_0x389c94=_0x389c94-0x0;var _0x1455cb=_0x13c0[_0x389c94];return _0x1455cb;};'use strict';module[_0x013c('0x0')]={'DOMAIN':_0x013c('0x1'),'SESSION_SECRET':_0x013c('0x2'),'GOOGLE_ID':_0x013c('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
+var _0xb18e=['secret','myappanuglar-secret'];(function(_0x3987a1,_0x447793){var _0xe2596e=function(_0x546925){while(--_0x546925){_0x3987a1['push'](_0x3987a1['shift']());}};_0xe2596e(++_0x447793);}(_0xb18e,0x181));var _0xeb18=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0xb18e[_0x4bc65f];return _0x44f85f;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xeb18('0x0'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xeb18('0x1'),'DEBUG':''};
\ No newline at end of file
diff --git a/server/config/logger.js b/server/config/logger.js
index 6db908f..5963030 100644
--- a/server/config/logger.js
+++ b/server/config/logger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa20f=['moment','winston','path','INFO','join','/var','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','debugLevel'];(function(_0x2fe22d,_0x1dfbea){var _0x206404=function(_0x4a739e){while(--_0x4a739e){_0x2fe22d['push'](_0x2fe22d['shift']());}};_0x206404(++_0x1dfbea);}(_0xa20f,0xd2));var _0xfa20=function(_0x401e83,_0xc6d9c5){_0x401e83=_0x401e83-0x0;var _0x3cc505=_0xa20f[_0x401e83];return _0x3cc505;};'use strict';var moment=require(_0xfa20('0x0'));var winston=require(_0xfa20('0x1'));var util=require('util');var path=require(_0xfa20('0x2'));var debugLevel=_0xfa20('0x3');function filename(_0x2b0d41,_0x38c03f){return path[_0xfa20('0x4')](_0xfa20('0x5'),'log',_0xfa20('0x6'),util[_0xfa20('0x7')](_0xfa20('0x8'),_0x2b0d41,_0x38c03f));}function formatter(_0x13e378,_0x17a9ab){return util['format'](_0xfa20('0x9'),moment()[_0xfa20('0x7')](_0xfa20('0xa')),_0x17a9ab['level'][_0xfa20('0xb')](),_0x13e378,_0x17a9ab['message']);}module[_0xfa20('0xc')]=function(_0x543725){return new winston[(_0xfa20('0xd'))]({'transports':[new winston[(_0xfa20('0xe'))][(_0xfa20('0xf'))]({'name':util['format'](_0xfa20('0x10'),_0x543725,_0xfa20('0x11')),'filename':filename(_0x543725,_0xfa20('0x11')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3edfad){return formatter(_0x543725,_0x3edfad);}}),new winston[(_0xfa20('0xe'))][(_0xfa20('0xf'))]({'name':util['format'](_0xfa20('0x10'),_0x543725,_0xfa20('0x12')),'filename':filename(_0x543725,_0xfa20('0x12')),'level':_0xfa20('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4fb907){return formatter(_0x543725,_0x4fb907);}}),new winston[(_0xfa20('0xe'))][(_0xfa20('0x13'))]({'level':process['env'][_0xfa20('0x14')]||debugLevel,'json':![],'formatter':function(_0x121393){return formatter(_0x543725,_0x121393);}})]});};
\ No newline at end of file
+var _0x55e7=['%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','message','exports','Logger','transports','%s-%s','error','File','info','Console','env','debugLevel','moment','path','INFO','join','/var','log','xcally','format'];(function(_0x1dc725,_0x4b120b){var _0x3b9b63=function(_0x4024c5){while(--_0x4024c5){_0x1dc725['push'](_0x1dc725['shift']());}};_0x3b9b63(++_0x4b120b);}(_0x55e7,0xa8));var _0x755e=function(_0x42e455,_0x1effa4){_0x42e455=_0x42e455-0x0;var _0x64221f=_0x55e7[_0x42e455];return _0x64221f;};'use strict';var moment=require(_0x755e('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x755e('0x1'));var debugLevel=_0x755e('0x2');function filename(_0x37c1eb,_0x47975c){return path[_0x755e('0x3')](_0x755e('0x4'),_0x755e('0x5'),_0x755e('0x6'),util[_0x755e('0x7')](_0x755e('0x8'),_0x37c1eb,_0x47975c));}function formatter(_0x534b24,_0x441b3){return util[_0x755e('0x7')](_0x755e('0x9'),moment()[_0x755e('0x7')](_0x755e('0xa')),_0x441b3['level']['toUpperCase'](),_0x534b24,_0x441b3[_0x755e('0xb')]);}module[_0x755e('0xc')]=function(_0x11acc1){return new winston[(_0x755e('0xd'))]({'transports':[new winston[(_0x755e('0xe'))]['File']({'name':util[_0x755e('0x7')](_0x755e('0xf'),_0x11acc1,_0x755e('0x10')),'filename':filename(_0x11acc1,'error'),'level':_0x755e('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x39ad78){return formatter(_0x11acc1,_0x39ad78);}}),new winston[(_0x755e('0xe'))][(_0x755e('0x11'))]({'name':util[_0x755e('0x7')]('%s-%s',_0x11acc1,_0x755e('0x12')),'filename':filename(_0x11acc1,_0x755e('0x12')),'level':_0x755e('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x48b835){return formatter(_0x11acc1,_0x48b835);}}),new winston[(_0x755e('0xe'))][(_0x755e('0x13'))]({'level':process[_0x755e('0x14')][_0x755e('0x15')]||debugLevel,'json':![],'formatter':function(_0x32b294){return formatter(_0x11acc1,_0x32b294);}})]});};
\ No newline at end of file
diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js
index e7725f5..ce41a1b 100644
--- a/server/config/pm2/config.js
+++ b/server/config/pm2/config.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xba57=['path','join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xba57,0xd1));var _0x7ba5=function(_0x33801e,_0x1d6728){_0x33801e=_0x33801e-0x0;var _0x3f3768=_0xba57[_0x33801e];return _0x3f3768;};'use strict';var path=require(_0x7ba5('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x7ba5('0x1')](__dirname,_0x7ba5('0x2'))},{'name':'ami','script':path[_0x7ba5('0x1')](__dirname,_0x7ba5('0x3'))},{'name':_0x7ba5('0x4'),'script':path['join'](__dirname,_0x7ba5('0x5'))},{'name':_0x7ba5('0x6'),'script':path[_0x7ba5('0x1')](__dirname,_0x7ba5('0x7'))},{'name':_0x7ba5('0x8'),'script':path[_0x7ba5('0x1')](__dirname,_0x7ba5('0x9'))},{'name':'xdr','script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0x7ba5('0xa')]=config;
\ No newline at end of file
+var _0x7803=['ami','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js'];(function(_0x17bcc7,_0x539fbd){var _0x531227=function(_0x275511){while(--_0x275511){_0x17bcc7['push'](_0x17bcc7['shift']());}};_0x531227(++_0x539fbd);}(_0x7803,0x175));var _0x3780=function(_0x33431a,_0x524724){_0x33431a=_0x33431a-0x0;var _0x1bc31d=_0x7803[_0x33431a];return _0x1bc31d;};'use strict';var path=require(_0x3780('0x0'));var os=require('os');var config={'apps':[{'name':_0x3780('0x1'),'script':path[_0x3780('0x2')](__dirname,_0x3780('0x3'))},{'name':_0x3780('0x4'),'script':path[_0x3780('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x3780('0x5'),'script':path[_0x3780('0x2')](__dirname,_0x3780('0x6'))},{'name':_0x3780('0x7'),'script':path[_0x3780('0x2')](__dirname,_0x3780('0x8'))},{'name':'routing','script':path['join'](__dirname,_0x3780('0x9'))},{'name':_0x3780('0xa'),'script':path['join'](__dirname,_0x3780('0xb'))}]};module[_0x3780('0xc')]=config;
\ No newline at end of file
diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js
index 62bf898..e9c2e6c 100644
--- a/server/config/pm2/index.js
+++ b/server/config/pm2/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['describe','delete','dump','saved','./config','connect','connected','then','start','disconnect','restart','list'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x49c4('0x0'));function connect(){return new BPromise(function(_0x18bf2d,_0x26844b){return pm2[_0x49c4('0x1')](function(_0x455700){if(_0x455700){return _0x26844b(_0x455700);}return _0x18bf2d(_0x49c4('0x2'));});});};exports['start']=function(_0x4941f1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x57effd,_0xc1278f){return pm2[_0x49c4('0x4')](_0x4941f1,function(_0x69bc41,_0x2c4e2e){if(_0x69bc41){return _0xc1278f(_0x69bc41);}pm2[_0x49c4('0x5')]();return _0x57effd(_0x2c4e2e);});});});};exports['stop']=function(_0x11c586){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1d13fb,_0x4487ca){return pm2['stop'](_0x11c586,function(_0x5ab4a3,_0x451ea6){if(_0x5ab4a3){return _0x4487ca(_0x5ab4a3);}pm2[_0x49c4('0x5')]();return _0x1d13fb(_0x451ea6);});});});};exports['restart']=function(_0xb611a1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x4adb3c,_0x536d42){return pm2[_0x49c4('0x6')](_0xb611a1,function(_0x6d1b08,_0x5487cd){if(_0x6d1b08){return _0x536d42(_0x6d1b08);}pm2[_0x49c4('0x5')]();return _0x4adb3c(_0x5487cd);});});});};exports[_0x49c4('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1909fe,_0x280996){return pm2[_0x49c4('0x7')](function(_0x2decee,_0x12777c){if(_0x2decee){return _0x280996(_0x2decee);}pm2[_0x49c4('0x5')]();return _0x1909fe(_0x12777c);});});});};exports[_0x49c4('0x8')]=function(_0x3de397){return connect()['then'](function(){return new BPromise(function(_0x3acd06,_0x141003){return pm2[_0x49c4('0x8')](_0x3de397,function(_0x81e831,_0x2abc78){if(_0x81e831){return _0x141003(_0x81e831);}pm2['disconnect']();return _0x3acd06(_0x2abc78);});});});};exports[_0x49c4('0x9')]=function(_0x2891f4){return connect()['then'](function(){return new BPromise(function(_0x512650,_0x3c782d){return pm2[_0x49c4('0x9')](_0x2891f4,function(_0x3addb2,_0x59f29b){if(_0x3addb2){return _0x3c782d(_0x3addb2);}pm2[_0x49c4('0x5')]();return _0x512650(_0x59f29b);});});});};exports['dump']=function(){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1806c2,_0xe31fcc){return pm2[_0x49c4('0xa')](function(_0x382040){if(_0x382040){return _0xe31fcc(_0x382040);}return _0x1806c2(_0x49c4('0xb'));});});});};
\ No newline at end of file
+var _0xedd9=['restart','list','describe','delete','saved','bluebird','./config','connect','connected','start','then','stop','disconnect'];(function(_0x22a24b,_0x33ebca){var _0x2309c4=function(_0x37440f){while(--_0x37440f){_0x22a24b['push'](_0x22a24b['shift']());}};_0x2309c4(++_0x33ebca);}(_0xedd9,0xfc));var _0x9edd=function(_0x503286,_0x44a867){_0x503286=_0x503286-0x0;var _0x278824=_0xedd9[_0x503286];return _0x278824;};'use strict';var pm2=require('pm2');var BPromise=require(_0x9edd('0x0'));var config=require(_0x9edd('0x1'));function connect(){return new BPromise(function(_0x2af857,_0x2c16b8){return pm2[_0x9edd('0x2')](function(_0x127cbe){if(_0x127cbe){return _0x2c16b8(_0x127cbe);}return _0x2af857(_0x9edd('0x3'));});});};exports[_0x9edd('0x4')]=function(_0x5943b3){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x2cd163,_0x268f9e){return pm2[_0x9edd('0x4')](_0x5943b3,function(_0x5319f7,_0xf0b2d8){if(_0x5319f7){return _0x268f9e(_0x5319f7);}pm2['disconnect']();return _0x2cd163(_0xf0b2d8);});});});};exports[_0x9edd('0x6')]=function(_0x190185){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x3280fd,_0x49d5e3){return pm2[_0x9edd('0x6')](_0x190185,function(_0x5d2f90,_0x2076fc){if(_0x5d2f90){return _0x49d5e3(_0x5d2f90);}pm2[_0x9edd('0x7')]();return _0x3280fd(_0x2076fc);});});});};exports['restart']=function(_0xbf9da6){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x5b6c00,_0x30c0d7){return pm2[_0x9edd('0x8')](_0xbf9da6,function(_0x25e64c,_0xfd544a){if(_0x25e64c){return _0x30c0d7(_0x25e64c);}pm2[_0x9edd('0x7')]();return _0x5b6c00(_0xfd544a);});});});};exports[_0x9edd('0x9')]=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0xef5498,_0x47eb64){return pm2[_0x9edd('0x9')](function(_0x44fc7c,_0x891832){if(_0x44fc7c){return _0x47eb64(_0x44fc7c);}pm2[_0x9edd('0x7')]();return _0xef5498(_0x891832);});});});};exports[_0x9edd('0xa')]=function(_0x338f3c){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x75a4ab,_0x4ea60f){return pm2[_0x9edd('0xa')](_0x338f3c,function(_0x448996,_0x449cee){if(_0x448996){return _0x4ea60f(_0x448996);}pm2['disconnect']();return _0x75a4ab(_0x449cee);});});});};exports[_0x9edd('0xb')]=function(_0x35f454){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x4d8f33,_0x43dc70){return pm2['delete'](_0x35f454,function(_0x2cdcef,_0x1083e4){if(_0x2cdcef){return _0x43dc70(_0x2cdcef);}pm2['disconnect']();return _0x4d8f33(_0x1083e4);});});});};exports['dump']=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x50338f,_0x27a95a){return pm2['dump'](function(_0x535f37){if(_0x535f37){return _0x27a95a(_0x535f37);}return _0x50338f(_0x9edd('0xc'));});});});};
\ No newline at end of file
diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js
index d91af51..7a537c6 100644
--- a/server/config/schedule/chat.js
+++ b/server/config/schedule/chat.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x115a=['update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','catch','error','start','lodash','moment','ioredis','../../mysqldb','../../config/environment','defaults','localhost','socket.io-emitter','redis','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes'];(function(_0x3a1b19,_0xa8744b){var _0x29b39d=function(_0x1410c3){while(--_0x1410c3){_0x3a1b19['push'](_0x3a1b19['shift']());}};_0x29b39d(++_0xa8744b);}(_0x115a,0x91));var _0xa115=function(_0x29cb5d,_0x3d90a0){_0x29cb5d=_0x29cb5d-0x0;var _0x213ec0=_0x115a[_0x29cb5d];return _0x213ec0;};'use strict';var _=require(_0xa115('0x0'));var moment=require(_0xa115('0x1'));var Redis=require(_0xa115('0x2'));var db=require(_0xa115('0x3'))['db'];var config=require(_0xa115('0x4'));config['redis']=_[_0xa115('0x5')](config['redis'],{'host':_0xa115('0x6'),'port':0x18eb});var io=require(_0xa115('0x7'))(new Redis(config[_0xa115('0x8')]));function closeInteractions(){var _0x40901a=0x0;var _0x1ab6f9=[];return db[_0xa115('0x9')]['find']({'raw':!![],'attributes':['id',_0xa115('0xa')],'where':{'id':0x1}})[_0xa115('0xb')](function(_0x291bec){_0x40901a=_0x291bec[_0xa115('0xa')];if(_0x40901a){return db[_0xa115('0xc')][_0xa115('0xd')]({'raw':!![],'attributes':['id',_0xa115('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa115('0xf')](_0x291bec[_0xa115('0xa')],_0xa115('0x10'))}}});}else{return[];}})[_0xa115('0xb')](function(_0x5683d6){_0x1ab6f9=_0x5683d6;if(_0x40901a){return db[_0xa115('0xc')][_0xa115('0x11')]({'closeReason':_0xa115('0x12'),'disposition':_0xa115('0x13'),'closed':!![],'closedAt':moment()['format'](_0xa115('0x14'))},{'where':{'id':_[_0xa115('0x15')](_0x1ab6f9||[],'id')}});}})[_0xa115('0xb')](function(_0x279a25){for(var _0xf71f3e=0x0;_0xf71f3e<_0x1ab6f9[_0xa115('0x16')];_0xf71f3e++){io[_0xa115('0x17')]('chatInteraction:update',{'id':_0x1ab6f9[_0xf71f3e]['id'],'closed':!![]});}})[_0xa115('0x18')](function(_0x427cd9){console[_0xa115('0x19')](_0x427cd9);});}exports[_0xa115('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xcc19=['ChatInteraction','lastMsgAt','subtract','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','chatInteraction:update','catch','error','lodash','moment','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','then'];(function(_0x299ee3,_0x204580){var _0x1a7773=function(_0x35d079){while(--_0x35d079){_0x299ee3['push'](_0x299ee3['shift']());}};_0x1a7773(++_0x204580);}(_0xcc19,0xbd));var _0x9cc1=function(_0x360484,_0x2d14e5){_0x360484=_0x360484-0x0;var _0x461a10=_0xcc19[_0x360484];return _0x461a10;};'use strict';var _=require(_0x9cc1('0x0'));var moment=require(_0x9cc1('0x1'));var Redis=require('ioredis');var db=require(_0x9cc1('0x2'))['db'];var config=require(_0x9cc1('0x3'));config[_0x9cc1('0x4')]=_[_0x9cc1('0x5')](config[_0x9cc1('0x4')],{'host':_0x9cc1('0x6'),'port':0x18eb});var io=require(_0x9cc1('0x7'))(new Redis(config[_0x9cc1('0x4')]));function closeInteractions(){var _0xcb1739=0x0;var _0x516f91=[];return db['Setting'][_0x9cc1('0x8')]({'raw':!![],'attributes':['id',_0x9cc1('0x9')],'where':{'id':0x1}})[_0x9cc1('0xa')](function(_0x3050ca){_0xcb1739=_0x3050ca[_0x9cc1('0x9')];if(_0xcb1739){return db[_0x9cc1('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x9cc1('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x9cc1('0xd')](_0x3050ca[_0x9cc1('0x9')],_0x9cc1('0xe'))}}});}else{return[];}})['then'](function(_0x2b99ec){_0x516f91=_0x2b99ec;if(_0xcb1739){return db[_0x9cc1('0xb')][_0x9cc1('0xf')]({'closeReason':_0x9cc1('0x10'),'disposition':_0x9cc1('0x11'),'closed':!![],'closedAt':moment()[_0x9cc1('0x12')](_0x9cc1('0x13'))},{'where':{'id':_['map'](_0x516f91||[],'id')}});}})[_0x9cc1('0xa')](function(_0x17e517){for(var _0x2e44dc=0x0;_0x2e44dc<_0x516f91[_0x9cc1('0x14')];_0x2e44dc++){io[_0x9cc1('0x15')](_0x9cc1('0x16'),{'id':_0x516f91[_0x2e44dc]['id'],'closed':!![]});}})[_0x9cc1('0x17')](function(_0x6dfd1e){console[_0x9cc1('0x18')](_0x6dfd1e);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js
index 2d3dd77..49c5917 100644
--- a/server/config/schedule/index.js
+++ b/server/config/schedule/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x87fe=['then','error','error\x20mail','info','email\x20sent','stringify','data','isNil','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','catch','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','delete\x20cron','toRun','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','exists','stop','stop\x20cron','length','update','update\x20cron','deleteJob','run','lodash','cron-job-manager','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','pass','\x22%s\x22\x20<%s>','name','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','status','attachments','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail'];(function(_0x12e007,_0x51646d){var _0x139821=function(_0x27d854){while(--_0x27d854){_0x12e007['push'](_0x12e007['shift']());}};_0x139821(++_0x51646d);}(_0x87fe,0x1ec));var _0xe87f=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0x87fe[_0x2eac4f];return _0x58f73b;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0xe87f('0x0'));var moment=require('moment');var CronJobManager=require(_0xe87f('0x1'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xe87f('0x2'))(_0xe87f('0x3'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xe87f('0x4'));var analyticDefaultReportController=require(_0xe87f('0x5'));var client=jayson[_0xe87f('0x6')][_0xe87f('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xcf6fa6,_0x383a16){return function(){logger['info'](_0xe87f('0x8'),_0xcf6fa6[_0xe87f('0x9')]);var _0x11cfd9=!![];var _0x11d8dd={'tls':{'rejectUnauthorized':![]}};if(_0xcf6fa6[_0xe87f('0xa')][_0xe87f('0xb')]['service']){_0x11d8dd[_0xe87f('0xc')]=_0xcf6fa6['MailAccount'][_0xe87f('0xb')][_0xe87f('0xc')];}else{_0x11d8dd[_0xe87f('0xd')]=_0xcf6fa6['MailAccount'][_0xe87f('0xb')][_0xe87f('0xd')];_0x11d8dd[_0xe87f('0xe')]=_0xcf6fa6[_0xe87f('0xa')][_0xe87f('0xb')][_0xe87f('0xe')];_0x11d8dd[_0xe87f('0xf')]=_0xcf6fa6[_0xe87f('0xa')][_0xe87f('0xb')]['secure'];}if(_0xcf6fa6[_0xe87f('0xa')]['Smtp']['authentication']){_0x11d8dd['auth']={'user':_0xcf6fa6['MailAccount'][_0xe87f('0xb')]['user'],'pass':_0xcf6fa6[_0xe87f('0xa')][_0xe87f('0xb')][_0xe87f('0x10')]};}var _0x30341d={'account':_0x11d8dd,'message':{'from':util['format'](_0xe87f('0x11'),_0xcf6fa6['MailAccount'][_0xe87f('0x12')],_0xcf6fa6[_0xe87f('0xa')][_0xe87f('0x9')]||_0xcf6fa6[_0xe87f('0xa')]['Smtp'][_0xe87f('0x13')]),'to':_0xcf6fa6['email'],'cc':_0xcf6fa6['cc'],'bcc':_0xcf6fa6[_0xe87f('0x14')],'subject':util[_0xe87f('0x15')](_0xe87f('0x16'),_0x383a16[_0xe87f('0x12')],_0xcf6fa6[_0xe87f('0x17')],_0xcf6fa6[_0xe87f('0x18')])}};var _0x2ba261=path[_0xe87f('0x19')](__dirname,'../../files/reports');var _0x1dcc91=_0x383a16[_0xe87f('0x1a')];var _0x25c71d=util[_0xe87f('0x15')](_0xe87f('0x1b'),path[_0xe87f('0x1c')](_0x383a16['savename'],path[_0xe87f('0x1d')](_0x383a16[_0xe87f('0x1a')])),_0xe87f('0x1e'));var _0x2965dd=path['join'](_0x2ba261,_0x1dcc91);var _0x1c96f9=path[_0xe87f('0x19')](_0x2ba261,_0x25c71d);if(fs[_0xe87f('0x1f')](_0x2965dd)){_0x383a16['status']=_0xe87f('0x20');_0x30341d[_0xe87f('0x21')]['attachments']=[{'filename':_0x1dcc91,'path':_0x2965dd}];_0x30341d[_0xe87f('0x21')][_0xe87f('0x22')]=util[_0xe87f('0x15')](_0xe87f('0x23'),JSON['stringify'](_0x383a16,null,0x2));}else if(fs[_0xe87f('0x1f')](_0x1c96f9)){_0x383a16[_0xe87f('0x24')]=_0xe87f('0x20');_0x30341d[_0xe87f('0x21')][_0xe87f('0x25')]=[{'filename':_0x25c71d,'path':_0x1c96f9}];}else{_0x30341d[_0xe87f('0x21')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0xcf6fa6[_0xe87f('0x26')]){_0x11cfd9=![];logger['info'](_0xe87f('0x27'));}}if(_0x11cfd9){return client[_0xe87f('0x28')](_0xe87f('0x29'),_0x30341d)[_0xe87f('0x2a')](function(_0x56e7bc){if(_0x56e7bc[_0xe87f('0x2b')]){return logger[_0xe87f('0x2b')](_0xe87f('0x2c'),JSON['stringify'](_0x56e7bc));}return logger[_0xe87f('0x2d')](_0xe87f('0x2e'));})['catch'](function(_0x3feb55){return logger['error'](_0xe87f('0x2c'),JSON['stringify'](_0x3feb55));});}};}function handleError(){return function(_0xab30fa){return logger['error'](JSON[_0xe87f('0x2f')](_0xab30fa));};}function handleResult(_0x3645d1){return function(_0xe1a279){logger[_0xe87f('0x2d')](_0xe87f('0x30'),JSON[_0xe87f('0x2f')](_0xe1a279));if(_0x3645d1[_0xe87f('0xa')]&&_0x3645d1[_0xe87f('0xa')][_0xe87f('0xb')]&&!_[_0xe87f('0x31')](_0x3645d1[_0xe87f('0x9')])){setTimeout(handleSendEmail(_0x3645d1,_0xe1a279),0x3c*0x3e8);}};}function handleJob(_0x4cb83a){return function(){try{if(_[_0xe87f('0x31')](_0x4cb83a[_0xe87f('0x17')])){return logger[_0xe87f('0x2d')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xe87f('0x31')](_0x4cb83a[_0xe87f('0x18')])){return logger[_0xe87f('0x2d')]('subtractUnit\x20null\x20or\x20undefined');}var _0xeac7d4={'startDate':moment()['subtract'](_0x4cb83a['subtractNumber'],_0x4cb83a[_0xe87f('0x18')])[_0xe87f('0x15')](_0xe87f('0x32')),'endDate':moment()[_0xe87f('0x15')](_0xe87f('0x32')),'type':_0xe87f('0x33'),'output':_0x4cb83a[_0xe87f('0x34')],'name':_0x4cb83a[_0xe87f('0x12')]};if(!_['isNil'](_0x4cb83a[_0xe87f('0x35')])){logger[_0xe87f('0x2d')](_0xe87f('0x36'),_0x4cb83a[_0xe87f('0x35')]);return analyticDefaultReportController[_0xe87f('0x37')]({'id':_0x4cb83a['DefaultReportId']},_0xeac7d4)[_0xe87f('0x2a')](handleResult(_0x4cb83a))['catch'](handleError());}if(!_[_0xe87f('0x31')](_0x4cb83a[_0xe87f('0x38')])){logger[_0xe87f('0x2d')]('exec\x20custom\x20report\x20id:%s',_0x4cb83a[_0xe87f('0x38')]);return analyticCustomReportController['runReport']({'id':_0x4cb83a[_0xe87f('0x38')]},_0xeac7d4)[_0xe87f('0x2a')](handleResult(_0x4cb83a))[_0xe87f('0x39')](handleError());}}catch(_0x4b0a0d){logger[_0xe87f('0x2b')](JSON[_0xe87f('0x2f')](_0x4b0a0d));}return logger[_0xe87f('0x2d')](_0xe87f('0x3a'));};}function getJobs(_0x4839a5){var _0x51e95a={};if(_0x4839a5){_0x51e95a['id']=_0x4839a5;}return db[_0xe87f('0x3b')][_0xe87f('0x3c')]({'where':_0x51e95a,'include':[{'model':db['MailAccount'],'attributes':['id',_0xe87f('0x12'),_0xe87f('0x9')],'include':[{'model':db[_0xe87f('0x3d')],'as':_0xe87f('0xb')}]}]})[_0xe87f('0x2a')](function(_0x2ecd3f){var _0x197a96=_[_0xe87f('0x3e')](manager[_0xe87f('0x3f')]);var _0xd9d4df=_[_0xe87f('0x40')](_0x2ecd3f,function(_0x1eec37){return _0x1eec37['id'][_0xe87f('0x41')]();});var _0x1e4f36=_[_0xe87f('0x42')](_0x2ecd3f,function(_0x2d66c4){return _0x2d66c4['id'][_0xe87f('0x41')]();});var _0x393fb1=_0x4839a5?_0xd9d4df:_[_0xe87f('0x43')](_0xd9d4df,_0x197a96);var _0x3eca72=_[_0xe87f('0x44')](_0xd9d4df,_0x197a96);var _0x308aeb=_[_0xe87f('0x43')](_0x197a96,_0xd9d4df);var _0x11d98e;var _0x2416cc;for(_0x11d98e=0x0;_0x11d98e<_0x308aeb['length']&&!_0x4839a5;_0x11d98e+=0x1){_0x2416cc=_0x308aeb[_0x11d98e][_0xe87f('0x41')]();if(manager['exists'](_0x2416cc)){manager['stop'](_0x2416cc);manager['deleteJob'](_0x2416cc);logger[_0xe87f('0x2d')](_0xe87f('0x45'),_0x2416cc);}}logger[_0xe87f('0x2d')](_0xe87f('0x46'),JSON['stringify'](_0x393fb1));for(_0x11d98e=0x0;_0x11d98e<_0x393fb1['length'];_0x11d98e+=0x1){_0x2416cc=_0x393fb1[_0x11d98e][_0xe87f('0x41')]();logger['info']('index',_0x2416cc);if(_0x4839a5){logger[_0xe87f('0x2d')](_0xe87f('0x47'),_0x4839a5);logger[_0xe87f('0x2d')](JSON[_0xe87f('0x2f')](_0x1e4f36[_0x2416cc]));BPromise[_0xe87f('0x48')]()[_0xe87f('0x2a')](handleJob(_0x1e4f36[_0x2416cc]));logger[_0xe87f('0x2d')]('run\x20job',_0x1e4f36[_0x2416cc][_0xe87f('0x12')],_0x1e4f36[_0x2416cc][_0xe87f('0x49')]);}else if(_0x1e4f36[_0x2416cc][_0xe87f('0x49')]&&_0x1e4f36[_0x2416cc][_0xe87f('0x4a')]&&moment()[_0xe87f('0x4b')](_0x1e4f36[_0x2416cc][_0xe87f('0x4c')],_0x1e4f36[_0x2416cc][_0xe87f('0x4d')])){manager[_0xe87f('0x4e')](_0x2416cc,_0x1e4f36[_0x2416cc][_0xe87f('0x49')],handleJob(_0x1e4f36[_0x2416cc]));manager[_0xe87f('0x4f')](_0x2416cc);logger[_0xe87f('0x2d')](_0xe87f('0x50'),_0x1e4f36[_0x2416cc][_0xe87f('0x12')],_0x1e4f36[_0x2416cc][_0xe87f('0x49')]);}else if(manager[_0xe87f('0x51')](_0x2416cc)){manager[_0xe87f('0x52')](_0x2416cc);manager['deleteJob'](_0x2416cc);logger[_0xe87f('0x2d')](_0xe87f('0x53'),_0x1e4f36[_0x2416cc][_0xe87f('0x12')],_0x1e4f36[_0x2416cc][_0xe87f('0x49')]);}}for(_0x11d98e=0x0,_0x2416cc;_0x11d98e<_0x3eca72[_0xe87f('0x54')]&&!_0x4839a5;_0x11d98e+=0x1){_0x2416cc=_0x3eca72[_0x11d98e][_0xe87f('0x41')]();if(manager[_0xe87f('0x51')](_0x2416cc)){if(_0x1e4f36[_0x2416cc]['cron']&&_0x1e4f36[_0x2416cc]['active']&&moment()['isBetween'](_0x1e4f36[_0x2416cc][_0xe87f('0x4c')],_0x1e4f36[_0x2416cc][_0xe87f('0x4d')])){manager[_0xe87f('0x55')](_0x2416cc,_0x1e4f36[_0x2416cc][_0xe87f('0x49')],handleJob(_0x1e4f36[_0x2416cc]));logger[_0xe87f('0x2d')](_0xe87f('0x56'),_0x1e4f36[_0x2416cc]['name'],_0x1e4f36[_0x2416cc]['cron']);}else{manager[_0xe87f('0x52')](_0x2416cc);manager[_0xe87f('0x57')](_0x2416cc);logger[_0xe87f('0x2d')](_0xe87f('0x53'),_0x1e4f36[_0x2416cc][_0xe87f('0x12')],_0x1e4f36[_0x2416cc][_0xe87f('0x49')]);}}}})[_0xe87f('0x39')](function(_0x3f48a6){logger[_0xe87f('0x2b')](JSON[_0xe87f('0x2f')](_0x3f48a6));});}exports[_0xe87f('0x58')]=function(_0x18b045){return getJobs(_0x18b045);};exports[_0xe87f('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x1059=['DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','map','toString','intersection','difference','length','exists','stop','deleteJob','toRun','index','resolve','run\x20job','active','isBetween','startAt','add','cron','start','add\x20cron','stop\x20cron','update\x20cron','run','util','lodash','cron-job-manager','bluebird','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','host','port','secure','authentication','pass','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','savename','format','%s.%s','basename','extname','zip','existsSync','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','catch','subtractNumber','subtractNumber\x20null\x20or\x20undefined','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','output'];(function(_0x2eee25,_0x53460d){var _0x1cb8c4=function(_0x4dad56){while(--_0x4dad56){_0x2eee25['push'](_0x2eee25['shift']());}};_0x1cb8c4(++_0x53460d);}(_0x1059,0x1ba));var _0x9105=function(_0x23e999,_0x2dd697){_0x23e999=_0x23e999-0x0;var _0x4b3976=_0x1059[_0x23e999];return _0x4b3976;};'use strict';var fs=require('fs');var util=require(_0x9105('0x0'));var path=require('path');var _=require(_0x9105('0x1'));var moment=require('moment');var CronJobManager=require(_0x9105('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0x9105('0x3'));var logger=require(_0x9105('0x4'))(_0x9105('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x9105('0x6'));var client=jayson[_0x9105('0x7')][_0x9105('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x154424,_0x460435){return function(){logger[_0x9105('0x9')](_0x9105('0xa'),_0x154424[_0x9105('0xb')]);var _0x1c2942=!![];var _0x4ca7b5={'tls':{'rejectUnauthorized':![]}};if(_0x154424[_0x9105('0xc')][_0x9105('0xd')]['service']){_0x4ca7b5['service']=_0x154424[_0x9105('0xc')]['Smtp']['service'];}else{_0x4ca7b5[_0x9105('0xe')]=_0x154424['MailAccount']['Smtp'][_0x9105('0xe')];_0x4ca7b5[_0x9105('0xf')]=_0x154424['MailAccount']['Smtp'][_0x9105('0xf')];_0x4ca7b5['secure']=_0x154424['MailAccount'][_0x9105('0xd')][_0x9105('0x10')];}if(_0x154424['MailAccount'][_0x9105('0xd')][_0x9105('0x11')]){_0x4ca7b5['auth']={'user':_0x154424[_0x9105('0xc')][_0x9105('0xd')]['user'],'pass':_0x154424['MailAccount'][_0x9105('0xd')][_0x9105('0x12')]};}var _0x501338={'account':_0x4ca7b5,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x154424['MailAccount'][_0x9105('0x13')],_0x154424[_0x9105('0xc')][_0x9105('0xb')]||_0x154424['MailAccount'][_0x9105('0xd')]['user']),'to':_0x154424[_0x9105('0xb')],'cc':_0x154424['cc'],'bcc':_0x154424[_0x9105('0x14')],'subject':util['format'](_0x9105('0x15'),_0x460435[_0x9105('0x13')],_0x154424['subtractNumber'],_0x154424[_0x9105('0x16')])}};var _0x20d18b=path['join'](__dirname,'../../files/reports');var _0x39a8db=_0x460435[_0x9105('0x17')];var _0x41d196=util[_0x9105('0x18')](_0x9105('0x19'),path[_0x9105('0x1a')](_0x460435[_0x9105('0x17')],path[_0x9105('0x1b')](_0x460435[_0x9105('0x17')])),_0x9105('0x1c'));var _0x4dc633=path['join'](_0x20d18b,_0x39a8db);var _0x7991a=path['join'](_0x20d18b,_0x41d196);if(fs[_0x9105('0x1d')](_0x4dc633)){_0x460435[_0x9105('0x1e')]=_0x9105('0x1f');_0x501338[_0x9105('0x20')][_0x9105('0x21')]=[{'filename':_0x39a8db,'path':_0x4dc633}];_0x501338['message']['text']=util['format'](_0x9105('0x22'),JSON[_0x9105('0x23')](_0x460435,null,0x2));}else if(fs['existsSync'](_0x7991a)){_0x460435[_0x9105('0x1e')]=_0x9105('0x1f');_0x501338[_0x9105('0x20')][_0x9105('0x21')]=[{'filename':_0x41d196,'path':_0x7991a}];}else{_0x501338[_0x9105('0x20')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x154424[_0x9105('0x24')]){_0x1c2942=![];logger[_0x9105('0x9')](_0x9105('0x25'));}}if(_0x1c2942){return client[_0x9105('0x26')]('SendMail',_0x501338)[_0x9105('0x27')](function(_0x3ebe2e){if(_0x3ebe2e['error']){return logger[_0x9105('0x28')](_0x9105('0x29'),JSON[_0x9105('0x23')](_0x3ebe2e));}return logger['info'](_0x9105('0x2a'));})[_0x9105('0x2b')](function(_0x1ad887){return logger['error'](_0x9105('0x29'),JSON[_0x9105('0x23')](_0x1ad887));});}};}function handleError(){return function(_0x3774d2){return logger[_0x9105('0x28')](JSON[_0x9105('0x23')](_0x3774d2));};}function handleResult(_0x3d1c06){return function(_0xdd7bc4){logger[_0x9105('0x9')]('data',JSON['stringify'](_0xdd7bc4));if(_0x3d1c06[_0x9105('0xc')]&&_0x3d1c06['MailAccount'][_0x9105('0xd')]&&!_['isNil'](_0x3d1c06[_0x9105('0xb')])){setTimeout(handleSendEmail(_0x3d1c06,_0xdd7bc4),0x3c*0x3e8);}};}function handleJob(_0x3397b4){return function(){try{if(_['isNil'](_0x3397b4[_0x9105('0x2c')])){return logger[_0x9105('0x9')](_0x9105('0x2d'));}if(_[_0x9105('0x2e')](_0x3397b4[_0x9105('0x16')])){return logger[_0x9105('0x9')]('subtractUnit\x20null\x20or\x20undefined');}var _0x48deeb={'startDate':moment()[_0x9105('0x2f')](_0x3397b4[_0x9105('0x2c')],_0x3397b4[_0x9105('0x16')])[_0x9105('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x9105('0x18')](_0x9105('0x30')),'type':'scheduled','output':_0x3397b4[_0x9105('0x31')],'name':_0x3397b4[_0x9105('0x13')]};if(!_[_0x9105('0x2e')](_0x3397b4[_0x9105('0x32')])){logger['info'](_0x9105('0x33'),_0x3397b4['DefaultReportId']);return analyticDefaultReportController[_0x9105('0x34')]({'id':_0x3397b4[_0x9105('0x32')]},_0x48deeb)[_0x9105('0x27')](handleResult(_0x3397b4))[_0x9105('0x2b')](handleError());}if(!_[_0x9105('0x2e')](_0x3397b4[_0x9105('0x35')])){logger[_0x9105('0x9')](_0x9105('0x36'),_0x3397b4[_0x9105('0x35')]);return analyticCustomReportController['runReport']({'id':_0x3397b4['CustomReportId']},_0x48deeb)[_0x9105('0x27')](handleResult(_0x3397b4))[_0x9105('0x2b')](handleError());}}catch(_0x2ad7a5){logger[_0x9105('0x28')](JSON[_0x9105('0x23')](_0x2ad7a5));}return logger[_0x9105('0x9')](_0x9105('0x37'));};}function getJobs(_0x1c2263){var _0x596afd={};if(_0x1c2263){_0x596afd['id']=_0x1c2263;}return db[_0x9105('0x38')]['findAll']({'where':_0x596afd,'include':[{'model':db[_0x9105('0xc')],'attributes':['id',_0x9105('0x13'),_0x9105('0xb')],'include':[{'model':db[_0x9105('0x39')],'as':_0x9105('0xd')}]}]})[_0x9105('0x27')](function(_0x1388d9){var _0x1286c8=_[_0x9105('0x3a')](manager[_0x9105('0x3b')]);var _0x4f51a5=_[_0x9105('0x3c')](_0x1388d9,function(_0x26590a){return _0x26590a['id'][_0x9105('0x3d')]();});var _0x1ad610=_['keyBy'](_0x1388d9,function(_0x353057){return _0x353057['id'][_0x9105('0x3d')]();});var _0x115868=_0x1c2263?_0x4f51a5:_['difference'](_0x4f51a5,_0x1286c8);var _0x1489b9=_[_0x9105('0x3e')](_0x4f51a5,_0x1286c8);var _0x1e94e0=_[_0x9105('0x3f')](_0x1286c8,_0x4f51a5);var _0x539822;var _0x2e8c22;for(_0x539822=0x0;_0x539822<_0x1e94e0[_0x9105('0x40')]&&!_0x1c2263;_0x539822+=0x1){_0x2e8c22=_0x1e94e0[_0x539822][_0x9105('0x3d')]();if(manager[_0x9105('0x41')](_0x2e8c22)){manager[_0x9105('0x42')](_0x2e8c22);manager[_0x9105('0x43')](_0x2e8c22);logger['info']('delete\x20cron',_0x2e8c22);}}logger[_0x9105('0x9')](_0x9105('0x44'),JSON[_0x9105('0x23')](_0x115868));for(_0x539822=0x0;_0x539822<_0x115868[_0x9105('0x40')];_0x539822+=0x1){_0x2e8c22=_0x115868[_0x539822][_0x9105('0x3d')]();logger[_0x9105('0x9')](_0x9105('0x45'),_0x2e8c22);if(_0x1c2263){logger[_0x9105('0x9')]('my\x20id',_0x1c2263);logger[_0x9105('0x9')](JSON[_0x9105('0x23')](_0x1ad610[_0x2e8c22]));BPromise[_0x9105('0x46')]()[_0x9105('0x27')](handleJob(_0x1ad610[_0x2e8c22]));logger[_0x9105('0x9')](_0x9105('0x47'),_0x1ad610[_0x2e8c22]['name'],_0x1ad610[_0x2e8c22]['cron']);}else if(_0x1ad610[_0x2e8c22]['cron']&&_0x1ad610[_0x2e8c22][_0x9105('0x48')]&&moment()[_0x9105('0x49')](_0x1ad610[_0x2e8c22][_0x9105('0x4a')],_0x1ad610[_0x2e8c22]['endAt'])){manager[_0x9105('0x4b')](_0x2e8c22,_0x1ad610[_0x2e8c22][_0x9105('0x4c')],handleJob(_0x1ad610[_0x2e8c22]));manager[_0x9105('0x4d')](_0x2e8c22);logger[_0x9105('0x9')](_0x9105('0x4e'),_0x1ad610[_0x2e8c22]['name'],_0x1ad610[_0x2e8c22]['cron']);}else if(manager[_0x9105('0x41')](_0x2e8c22)){manager[_0x9105('0x42')](_0x2e8c22);manager[_0x9105('0x43')](_0x2e8c22);logger[_0x9105('0x9')](_0x9105('0x4f'),_0x1ad610[_0x2e8c22][_0x9105('0x13')],_0x1ad610[_0x2e8c22][_0x9105('0x4c')]);}}for(_0x539822=0x0,_0x2e8c22;_0x539822<_0x1489b9[_0x9105('0x40')]&&!_0x1c2263;_0x539822+=0x1){_0x2e8c22=_0x1489b9[_0x539822][_0x9105('0x3d')]();if(manager['exists'](_0x2e8c22)){if(_0x1ad610[_0x2e8c22][_0x9105('0x4c')]&&_0x1ad610[_0x2e8c22][_0x9105('0x48')]&&moment()[_0x9105('0x49')](_0x1ad610[_0x2e8c22][_0x9105('0x4a')],_0x1ad610[_0x2e8c22]['endAt'])){manager['update'](_0x2e8c22,_0x1ad610[_0x2e8c22][_0x9105('0x4c')],handleJob(_0x1ad610[_0x2e8c22]));logger['info'](_0x9105('0x50'),_0x1ad610[_0x2e8c22][_0x9105('0x13')],_0x1ad610[_0x2e8c22][_0x9105('0x4c')]);}else{manager[_0x9105('0x42')](_0x2e8c22);manager[_0x9105('0x43')](_0x2e8c22);logger[_0x9105('0x9')](_0x9105('0x4f'),_0x1ad610[_0x2e8c22][_0x9105('0x13')],_0x1ad610[_0x2e8c22][_0x9105('0x4c')]);}}}})['catch'](function(_0x4f11c6){logger['error'](JSON['stringify'](_0x4f11c6));});}exports[_0x9105('0x51')]=function(_0x49f5e4){return getJobs(_0x49f5e4);};exports[_0x9105('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
diff --git a/server/config/seedContact.js b/server/config/seedContact.js
index 9d68ed5..86a6e84 100644
--- a/server/config/seedContact.js
+++ b/server/config/seedContact.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb9f6=['CmContact','bulkCreate','log','finished\x20populating','contacts1','destroy','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','then'];(function(_0x5668a3,_0x363bf2){var _0x15b01e=function(_0x1b848b){while(--_0x1b848b){_0x5668a3['push'](_0x5668a3['shift']());}};_0x15b01e(++_0x363bf2);}(_0xb9f6,0x1c2));var _0x6b9f=function(_0x37a87a,_0x45f496){_0x37a87a=_0x37a87a-0x0;var _0x3b7124=_0xb9f6[_0x37a87a];return _0x3b7124;};'use strict';var util=require(_0x6b9f('0x0'));var db=require(_0x6b9f('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6b9f('0x2')]({'id':i,'firstName':_0x6b9f('0x3')+i,'lastName':_0x6b9f('0x4')+i,'phone':0xf879fb460+i,'email':_0x6b9f('0x5')+i+_0x6b9f('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x6b9f('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6b9f('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x6b9f('0x3')+i,'lastName':_0x6b9f('0x4')+i,'phone':0xf879fb460+i,'email':_0x6b9f('0x5')+i+_0x6b9f('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6b9f('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6b9f('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6b9f('0x7')](),'updatedAt':Date[_0x6b9f('0x7')]()});}db['CmContact']['destroy']({'where':{}})[_0x6b9f('0x8')](function(){return db[_0x6b9f('0x9')][_0x6b9f('0xa')](contacts);})[_0x6b9f('0x8')](function(){console[_0x6b9f('0xb')](_0x6b9f('0xc'),_0x6b9f('0xd'));return db['CmHopper'][_0x6b9f('0xe')]({'where':{}});})[_0x6b9f('0x8')](function(){return db['CmHopper'][_0x6b9f('0xa')](hopper);})[_0x6b9f('0x8')](function(){console[_0x6b9f('0xb')]('finished\x20populating','hopper1');return db[_0x6b9f('0x9')][_0x6b9f('0xa')](contacts2);})[_0x6b9f('0x8')](function(){console[_0x6b9f('0xb')]('finished\x20populating','contacts2');return db['CmHopper'][_0x6b9f('0xa')](hopper2);})['then'](function(){console['log'](_0x6b9f('0xc'),_0x6b9f('0xf'));})[_0x6b9f('0x10')](function(_0x328ec8){console[_0x6b9f('0xb')](_0x328ec8);});
\ No newline at end of file
+var _0x5dd7=['bulkCreate','log','finished\x20populating','contacts1','CmHopper','contacts2','catch','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','CmContact','destroy','then'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0x5dd7,0x197));var _0x75dd=function(_0x2ee89c,_0x27e14d){_0x2ee89c=_0x2ee89c-0x0;var _0x4328a3=_0x5dd7[_0x2ee89c];return _0x4328a3;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x75dd('0x0')+i,'lastName':_0x75dd('0x1')+i,'phone':0xf879fb460+i,'email':_0x75dd('0x2')+i+_0x75dd('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x75dd('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x75dd('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x75dd('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x75dd('0x4')]({'id':i,'firstName':_0x75dd('0x0')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x75dd('0x2')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x75dd('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x75dd('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x75dd('0x5')](),'updatedAt':Date['now']()});}db[_0x75dd('0x6')][_0x75dd('0x7')]({'where':{}})[_0x75dd('0x8')](function(){return db['CmContact'][_0x75dd('0x9')](contacts);})[_0x75dd('0x8')](function(){console[_0x75dd('0xa')](_0x75dd('0xb'),_0x75dd('0xc'));return db[_0x75dd('0xd')]['destroy']({'where':{}});})[_0x75dd('0x8')](function(){return db[_0x75dd('0xd')][_0x75dd('0x9')](hopper);})[_0x75dd('0x8')](function(){console['log'](_0x75dd('0xb'),'hopper1');return db[_0x75dd('0x6')][_0x75dd('0x9')](contacts2);})[_0x75dd('0x8')](function(){console[_0x75dd('0xa')](_0x75dd('0xb'),_0x75dd('0xe'));return db['CmHopper']['bulkCreate'](hopper2);})[_0x75dd('0x8')](function(){console[_0x75dd('0xa')](_0x75dd('0xb'),'hopper2');})[_0x75dd('0xf')](function(_0x3d8d33){console[_0x75dd('0xa')](_0x3d8d33);});
\ No newline at end of file
diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js
index 84c021c..885fe17 100644
--- a/server/config/seedUsers.js
+++ b/server/config/seedUsers.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a98=['udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','util','../mysqldb','push','format','%s%s','agent','password','friend'];(function(_0x3b286e,_0x5c6129){var _0x428189=function(_0x5ed38b){while(--_0x5ed38b){_0x3b286e['push'](_0x3b286e['shift']());}};_0x428189(++_0x5c6129);}(_0x4a98,0x160));var _0x84a9=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4a98[_0x5d2803];return _0xdcad2c;};'use strict';var util=require(_0x84a9('0x0'));var db=require(_0x84a9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x84a9('0x2')]({'name':util[_0x84a9('0x3')](_0x84a9('0x4'),_0x84a9('0x5'),i),'fullname':util[_0x84a9('0x3')](_0x84a9('0x4'),'agent',i),'email':util[_0x84a9('0x3')]('%s%s@xcally.com',_0x84a9('0x5'),i),'role':_0x84a9('0x5'),'password':_0x84a9('0x6'),'internal':0xfa0+i,'type':_0x84a9('0x7'),'transport':[_0x84a9('0x8'),'ws',_0x84a9('0x9')],'disallow':[_0x84a9('0xa')],'allow':['ulaw'],'defaultuser':util[_0x84a9('0x3')](_0x84a9('0x4'),'agent',i),'encryption':_0x84a9('0xb'),'avpf':'yes','force_avp':_0x84a9('0xb'),'icesupport':_0x84a9('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x84a9('0xc'),'dtlsprivatekey':_0x84a9('0xd'),'dtlssetup':'actpass','callerid':util[_0x84a9('0x3')](_0x84a9('0xe'),util['format'](_0x84a9('0x4'),'agent',i),0xfa0+i)});}db[_0x84a9('0xf')][_0x84a9('0x10')](users)[_0x84a9('0x11')](function(){console[_0x84a9('0x12')](_0x84a9('0x13'));})['catch'](function(_0x3ececd){console[_0x84a9('0x12')](_0x3ececd);});
\ No newline at end of file
+var _0xa0bf=['ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','agent','%s%s','format','password','friend','udp','wss','all'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0xa0bf,0xb6));var _0xfa0b=function(_0x22f150,_0x3188a2){_0x22f150=_0x22f150-0x0;var _0x542e13=_0xa0bf[_0x22f150];return _0x542e13;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s',_0xfa0b('0x0'),i),'fullname':util['format'](_0xfa0b('0x1'),'agent',i),'email':util[_0xfa0b('0x2')]('%s%s@xcally.com',_0xfa0b('0x0'),i),'role':_0xfa0b('0x0'),'password':_0xfa0b('0x3'),'internal':0xfa0+i,'type':_0xfa0b('0x4'),'transport':[_0xfa0b('0x5'),'ws',_0xfa0b('0x6')],'disallow':[_0xfa0b('0x7')],'allow':[_0xfa0b('0x8')],'defaultuser':util[_0xfa0b('0x2')](_0xfa0b('0x1'),'agent',i),'encryption':_0xfa0b('0x9'),'avpf':'yes','force_avp':_0xfa0b('0x9'),'icesupport':_0xfa0b('0x9'),'dtlsenable':_0xfa0b('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xfa0b('0xa'),'dtlssetup':_0xfa0b('0xb'),'callerid':util[_0xfa0b('0x2')](_0xfa0b('0xc'),util['format'](_0xfa0b('0x1'),'agent',i),0xfa0+i)});}db[_0xfa0b('0xd')][_0xfa0b('0xe')](users)[_0xfa0b('0xf')](function(){console[_0xfa0b('0x10')](_0xfa0b('0x11'));})[_0xfa0b('0x12')](function(_0x50f8b8){console[_0xfa0b('0x10')](_0x50f8b8);});
\ No newline at end of file
diff --git a/server/config/socketio.js b/server/config/socketio.js
index a15d0f7..2c8e494 100644
--- a/server/config/socketio.js
+++ b/server/config/socketio.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05af=['Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','ivr','format','%s:queue:%s','length','find','userProfileId','query','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','user','VoiceQueue','ChatQueues','SmsQueues','MailQueues','MailQueue','getVoiceQueues','getChatQueues','getSmsQueues','getOpenchannelQueues','chat','fax','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','user:%s','leave','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','default','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','OpenchannelQueues','findAll','Telephones'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0x05af,0x174));var _0xf05a=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x05af[_0xc82d1a];return _0x32fad2;};'use strict';var _=require(_0xf05a('0x0'));var util=require(_0xf05a('0x1'));var BPromise=require(_0xf05a('0x2'));var db=require(_0xf05a('0x3'))['db'];var config=require(_0xf05a('0x4'));var queryQueues={'attributes':['id',_0xf05a('0x5')],'include':[{'as':_0xf05a('0x6'),'model':db[_0xf05a('0x7')],'attributes':['id','name',_0xf05a('0x8')],'raw':!![],'where':{'role':_0xf05a('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xf05a('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xf05a('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xf05a('0x5')],'where':{'role':_0xf05a('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xf05a('0x5'),_0xf05a('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x362e7b,_0x52b9da,_0x2845a6){return db[_0xf05a('0xb')][_0xf05a('0xc')]({'where':{'name':_0x362e7b,'userProfileId':_0x52b9da},'raw':!![]})[_0xf05a('0xd')](function(_0xdbb669){if(_0xdbb669){if(_0xdbb669[_0xf05a('0xe')]){switch(_0x362e7b){case _0xf05a('0xf'):case'ChatQueues':case _0xf05a('0x10'):case'SmsQueues':case'MailQueues':case _0xf05a('0x11'):return db[_0x2845a6][_0xf05a('0x12')](queryQueues);case _0xf05a('0x13'):return db[_0x2845a6][_0xf05a('0x12')](queryTelephones);case _0xf05a('0x14'):return db[_0x2845a6][_0xf05a('0x12')](queryTrunks);case _0xf05a('0x15'):return db[_0x2845a6]['findAll'](queryCampaigns);}}else{return db[_0xf05a('0x16')][_0xf05a('0x12')]({'attributes':[_0xf05a('0x17')],'where':{'sectionId':_0xdbb669['id']},'raw':!![]})[_0xf05a('0xd')](function(_0x33f108){if(_0x33f108){var _0xf6ac86={'where':{'id':_[_0xf05a('0x18')](_0x33f108,_0xf05a('0x17'))},'raw':!![]};switch(_0x2845a6){case _0xf05a('0x7'):_0xf6ac86[_0xf05a('0x19')][_0xf05a('0x8')]='telephone';break;case _0xf05a('0x1a'):_0xf6ac86['where'][_0xf05a('0xa')]=_0xf05a('0x1b');break;}return db[_0x2845a6]['findAll'](_0xf6ac86);}else{return[];}});}}else{return[];}})[_0xf05a('0xd')](function(_0x308ee9){return _0x308ee9;});}function joinOrLeaveQueues(_0x51c6f0,_0x21145c,_0x38df2f,_0x2de90f){_0x51c6f0[_0x21145c](util[_0xf05a('0x1c')](_0xf05a('0x1d'),_0x38df2f,_0x2de90f[_0xf05a('0x5')]));if(_0x2de90f[_0xf05a('0x6')]){for(var _0x29924d=0x0;_0x29924d<_0x2de90f[_0xf05a('0x6')][_0xf05a('0x1e')];_0x29924d+=0x1){_0x51c6f0[_0x21145c](util[_0xf05a('0x1c')]('user:%s',_0x2de90f['Agents'][_0x29924d]['name']));}}}function joinOrLeave(_0x3f0e43,_0x3392ff,_0x913315){var _0x3933f7;if(_0x3f0e43['handshake']['query']['id']){db[_0xf05a('0x7')][_0xf05a('0x1f')]({'attributes':['id',_0xf05a('0x5'),_0xf05a('0x8'),_0xf05a('0x20')],'where':{'id':_0x3f0e43['handshake'][_0xf05a('0x21')]['id']},'include':[{'model':db[_0xf05a('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf05a('0x23')],'as':_0xf05a('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xf05a('0x25')],'as':_0xf05a('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xf05a('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf05a('0x28')],'as':_0xf05a('0x29'),'attributes':['id'],'raw':!![]}]})[_0xf05a('0xd')](function(_0x3a1dac){if(_0x3a1dac){_0x3933f7=_0x3a1dac;_0x3f0e43[_0x3392ff](util[_0xf05a('0x1c')]('user:%s',_0x3a1dac[_0xf05a('0x5')]));var _0x2ea80b=[];switch(_0x3a1dac[_0xf05a('0x8')]){case _0xf05a('0x2a'):_0x3f0e43[_0x3392ff](_0xf05a('0x2b'));_0x3f0e43[_0x3392ff](_0xf05a('0x2c'));if(queryQueues[_0xf05a('0x2d')](_0xf05a('0x2e'))){delete queryQueues[_0xf05a('0x2e')];}_0x2ea80b[_0xf05a('0x2f')](db['VoiceQueue']['findAll'](queryQueues));_0x2ea80b[_0xf05a('0x2f')](db[_0xf05a('0x30')][_0xf05a('0x12')](queryQueues));_0x2ea80b[_0xf05a('0x2f')](db[_0xf05a('0x31')][_0xf05a('0x12')](queryQueues));_0x2ea80b['push'](db[_0xf05a('0x32')][_0xf05a('0x12')](queryQueues));_0x2ea80b['push'](db['MailQueue'][_0xf05a('0x12')](queryQueues));_0x2ea80b['push'](db[_0xf05a('0x33')][_0xf05a('0x12')](queryQueues));_0x2ea80b[_0xf05a('0x2f')](db[_0xf05a('0x7')]['findAll'](queryTelephones));_0x2ea80b[_0xf05a('0x2f')](db[_0xf05a('0x34')][_0xf05a('0x12')](queryTrunks));_0x2ea80b['push'](db[_0xf05a('0x1a')][_0xf05a('0x12')](queryCampaigns));_0x2ea80b[_0xf05a('0x2f')](db['User'][_0xf05a('0x12')](queryAgents));break;case _0xf05a('0x35'):_0x3f0e43[_0x3392ff](_0xf05a('0x2b'));_0x3f0e43[_0x3392ff]('voice:outbound');_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources('VoiceQueues',_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x36')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources(_0xf05a('0x37'),_0x3a1dac[_0xf05a('0x20')],'ChatQueue'));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources('FaxQueues',_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x31')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources(_0xf05a('0x38'),_0x3a1dac[_0xf05a('0x20')],'SmsQueue'));_0x2ea80b['push'](getAssociatedResources(_0xf05a('0x39'),_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x3a')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources('OpenchannelQueues',_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x33')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources(_0xf05a('0x13'),_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x7')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources(_0xf05a('0x14'),_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x34')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources(_0xf05a('0x15'),_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x1a')));_0x2ea80b[_0xf05a('0x2f')](db['User'][_0xf05a('0x12')](queryAgents));break;case _0xf05a('0x9'):_0x3f0e43[_0x3392ff](_0xf05a('0x2b'));_0x3f0e43[_0x3392ff](_0xf05a('0x2c'));_0x2ea80b['push'](_0x3a1dac[_0xf05a('0x3b')]({'attributes':['id',_0xf05a('0x5')]}));_0x2ea80b[_0xf05a('0x2f')](_0x3a1dac[_0xf05a('0x3c')]({'attributes':['id',_0xf05a('0x5')]}));_0x2ea80b['push'](_0x3a1dac['getFaxQueues']({'attributes':['id',_0xf05a('0x5')]}));_0x2ea80b[_0xf05a('0x2f')](_0x3a1dac[_0xf05a('0x3d')]({'attributes':['id',_0xf05a('0x5')]}));_0x2ea80b[_0xf05a('0x2f')](_0x3a1dac['getMailQueues']({'attributes':['id',_0xf05a('0x5')]}));_0x2ea80b['push'](_0x3a1dac[_0xf05a('0x3e')]({'attributes':['id',_0xf05a('0x5')]}));break;}return BPromise['all'](_0x2ea80b);}})['then'](function(_0x270d92){if(_0x270d92&&_0x270d92[_0xf05a('0x1e')]){for(var _0x8bb795=0x0;_0x8bb795<_0x270d92['length'];_0x8bb795+=0x1){for(var _0x453016=0x0;_0x453016<_0x270d92[_0x8bb795][_0xf05a('0x1e')];_0x453016+=0x1){switch(_0x8bb795){case 0x0:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,'voice',_0x270d92[_0x8bb795][_0x453016]);break;case 0x1:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,_0xf05a('0x3f'),_0x270d92[_0x8bb795][_0x453016]);break;case 0x2:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,_0xf05a('0x40'),_0x270d92[_0x8bb795][_0x453016]);break;case 0x3:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,'sms',_0x270d92[_0x8bb795][_0x453016]);break;case 0x4:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,_0xf05a('0x41'),_0x270d92[_0x8bb795][_0x453016]);break;case 0x5:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,_0xf05a('0x42'),_0x270d92[_0x8bb795][_0x453016]);break;case 0x6:_0x3f0e43[_0x3392ff](util[_0xf05a('0x1c')](_0xf05a('0x43'),_0x270d92[_0x8bb795][_0x453016][_0xf05a('0x5')]));break;case 0x7:_0x3f0e43[_0x3392ff](util[_0xf05a('0x1c')](_0xf05a('0x44'),_0x270d92[_0x8bb795][_0x453016][_0xf05a('0x5')]));break;case 0x8:_0x3f0e43[_0x3392ff](util['format'](_0xf05a('0x45'),_0x270d92[_0x8bb795][_0x453016]['type'],_0x270d92[_0x8bb795][_0x453016][_0xf05a('0x5')]));break;case 0x9:_0x3f0e43[_0x3392ff](util[_0xf05a('0x1c')](_0xf05a('0x46'),_0x270d92[_0x8bb795][_0x453016]['name']));break;}}}}})[_0xf05a('0xd')](function(){if(_0x3392ff===_0xf05a('0x47')){var _0x26b01b=_['map'](_0x3933f7[_0xf05a('0x48')],'id');return _0x3933f7[_0xf05a('0x49')](_0x26b01b)[_0xf05a('0xd')](function(){for(var _0x2d3499=0x0;_0x2d3499<_0x26b01b['length'];_0x2d3499+=0x1){_0x913315['emit'](_0xf05a('0x4a'),{'ChatInteractionId':Number(_0x26b01b[_0x2d3499]),'UserId':Number(_0x3933f7['id'])});}});}})[_0xf05a('0xd')](function(){if(_0x3392ff==='leave'){var _0x59d3f8=_[_0xf05a('0x18')](_0x3933f7[_0xf05a('0x24')],'id');return _0x3933f7[_0xf05a('0x4b')](_0x59d3f8)[_0xf05a('0xd')](function(){for(var _0x2802eb=0x0;_0x2802eb<_0x59d3f8[_0xf05a('0x1e')];_0x2802eb+=0x1){_0x913315[_0xf05a('0x4c')](_0xf05a('0x4d'),{'MailInteractionId':Number(_0x59d3f8[_0x2802eb]),'UserId':Number(_0x3933f7['id'])});}});}})['then'](function(){if(_0x3392ff==='leave'){var _0x3484c4=_[_0xf05a('0x18')](_0x3933f7[_0xf05a('0x26')],'id');return _0x3933f7[_0xf05a('0x4e')](_0x3484c4)['then'](function(){for(var _0x24de7b=0x0;_0x24de7b<_0x3484c4[_0xf05a('0x1e')];_0x24de7b+=0x1){_0x913315['emit'](_0xf05a('0x4f'),{'FaxInteractionId':Number(_0x3484c4[_0x24de7b]),'UserId':Number(_0x3933f7['id'])});}});}})[_0xf05a('0xd')](function(){if(_0x3392ff===_0xf05a('0x47')){var _0x23dc62=_[_0xf05a('0x18')](_0x3933f7[_0xf05a('0x50')],'id');return _0x3933f7[_0xf05a('0x51')](_0x23dc62)[_0xf05a('0xd')](function(){for(var _0x58aaac=0x0;_0x58aaac<_0x23dc62[_0xf05a('0x1e')];_0x58aaac+=0x1){_0x913315['emit'](_0xf05a('0x52'),{'SmsInteractionId':Number(_0x23dc62[_0x58aaac]),'UserId':Number(_0x3933f7['id'])});}});}})[_0xf05a('0xd')](function(){if(_0x3392ff===_0xf05a('0x47')){var _0x1f5b9e=_[_0xf05a('0x18')](_0x3933f7[_0xf05a('0x29')],'id');return _0x3933f7[_0xf05a('0x53')](_0x1f5b9e)[_0xf05a('0xd')](function(){for(var _0x11a561=0x0;_0x11a561<_0x1f5b9e[_0xf05a('0x1e')];_0x11a561+=0x1){_0x913315[_0xf05a('0x4c')](_0xf05a('0x54'),{'OpenchannelInteractionId':Number(_0x1f5b9e[_0x11a561]),'UserId':Number(_0x3933f7['id'])});}});}})[_0xf05a('0x55')](function(_0x5eca20){_0x3f0e43[_0xf05a('0x56')](_0x5eca20);});}}function onDisconnect(_0x47f407,_0x15b13f){joinOrLeave(_0x47f407,'leave',_0x15b13f);}function onConnect(_0x3c424b){joinOrLeave(_0x3c424b,'join');}exports[_0xf05a('0x57')]=function(_0x489a0c){_0x489a0c['on']('connection',function(_0x116438){_0x116438['setMaxListeners'](0x0);_0x116438['address']=_0x116438[_0xf05a('0x58')][_0xf05a('0x59')][_0xf05a('0x5a')]+':'+_0x116438[_0xf05a('0x58')][_0xf05a('0x59')][_0xf05a('0x5b')];_0x116438[_0xf05a('0x5c')]=new Date();_0x116438[_0xf05a('0x56')]=function(_0x24ff31){console[_0xf05a('0x56')](_0xf05a('0x5d')+_0x116438['nsp'][_0xf05a('0x5')]+'['+_0x116438[_0xf05a('0x5e')]+']',_0x24ff31);};_0x116438['on'](_0xf05a('0x5f'),function(){onDisconnect(_0x116438,_0x489a0c);_0x116438[_0xf05a('0x56')](_0xf05a('0x60'));});onConnect(_0x116438);_0x116438['log'](_0xf05a('0x61'));});};
\ No newline at end of file
+var _0x054d=['query','userProfileId','handshake','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','SmsInteractions','OpenchannelInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueue','FaxQueue','SmsQueue','IvrCampaigns','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','voice','chat','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','ChatInteractions','removeMailInteractions','FaxInteractions','removeFaxInteractions','emit','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','util','bluebird','../mysqldb','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','UserProfileResource','then','resourceId','Campaign','where','format','%s:queue:%s','length','user:%s'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x054d,0x98));var _0xd054=function(_0x425d13,_0x590c65){_0x425d13=_0x425d13-0x0;var _0x5dd6b8=_0x054d[_0x425d13];return _0x5dd6b8;};'use strict';var _=require('lodash');var util=require(_0xd054('0x0'));var BPromise=require(_0xd054('0x1'));var db=require(_0xd054('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xd054('0x3')],'include':[{'as':_0xd054('0x4'),'model':db[_0xd054('0x5')],'attributes':['id',_0xd054('0x3'),_0xd054('0x6')],'raw':!![],'where':{'role':_0xd054('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xd054('0x3')],'where':{'role':_0xd054('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xd054('0x3')],'where':{'role':_0xd054('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xd054('0x3'),_0xd054('0x9')],'where':{'type':_0xd054('0xa')}};function getAssociatedResources(_0x5dd61d,_0x338556,_0x49ad72){return db[_0xd054('0xb')][_0xd054('0xc')]({'where':{'name':_0x5dd61d,'userProfileId':_0x338556},'raw':!![]})['then'](function(_0x1d11aa){if(_0x1d11aa){if(_0x1d11aa['autoAssociation']){switch(_0x5dd61d){case'VoiceQueues':case _0xd054('0xd'):case _0xd054('0xe'):case _0xd054('0xf'):case _0xd054('0x10'):case _0xd054('0x11'):return db[_0x49ad72][_0xd054('0x12')](queryQueues);case _0xd054('0x13'):return db[_0x49ad72]['findAll'](queryTelephones);case _0xd054('0x14'):return db[_0x49ad72][_0xd054('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x49ad72]['findAll'](queryCampaigns);}}else{return db[_0xd054('0x15')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x1d11aa['id']},'raw':!![]})[_0xd054('0x16')](function(_0x15976a){if(_0x15976a){var _0x3fbd92={'where':{'id':_['map'](_0x15976a,_0xd054('0x17'))},'raw':!![]};switch(_0x49ad72){case _0xd054('0x5'):_0x3fbd92['where'][_0xd054('0x6')]=_0xd054('0x8');break;case _0xd054('0x18'):_0x3fbd92[_0xd054('0x19')]['type']=_0xd054('0xa');break;}return db[_0x49ad72]['findAll'](_0x3fbd92);}else{return[];}});}}else{return[];}})[_0xd054('0x16')](function(_0x339844){return _0x339844;});}function joinOrLeaveQueues(_0x28102d,_0x31ca88,_0x4a9d55,_0xb7040d){_0x28102d[_0x31ca88](util[_0xd054('0x1a')](_0xd054('0x1b'),_0x4a9d55,_0xb7040d['name']));if(_0xb7040d[_0xd054('0x4')]){for(var _0x4bdde0=0x0;_0x4bdde0<_0xb7040d[_0xd054('0x4')][_0xd054('0x1c')];_0x4bdde0+=0x1){_0x28102d[_0x31ca88](util['format'](_0xd054('0x1d'),_0xb7040d[_0xd054('0x4')][_0x4bdde0]['name']));}}}function joinOrLeave(_0x270169,_0x40d6bc,_0x5867c0){var _0x54ad2e;if(_0x270169['handshake'][_0xd054('0x1e')]['id']){db['User']['find']({'attributes':['id','name','role',_0xd054('0x1f')],'where':{'id':_0x270169[_0xd054('0x20')][_0xd054('0x1e')]['id']},'include':[{'model':db[_0xd054('0x21')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd054('0x22')],'as':_0xd054('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xd054('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xd054('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xd054('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0xd054('0x16')](function(_0x257e31){if(_0x257e31){_0x54ad2e=_0x257e31;_0x270169[_0x40d6bc](util[_0xd054('0x1a')]('user:%s',_0x257e31[_0xd054('0x3')]));var _0x2b8af0=[];switch(_0x257e31[_0xd054('0x6')]){case _0xd054('0x27'):_0x270169[_0x40d6bc](_0xd054('0x28'));_0x270169[_0x40d6bc](_0xd054('0x29'));if(queryQueues[_0xd054('0x2a')]('include')){delete queryQueues[_0xd054('0x2b')];}_0x2b8af0['push'](db['VoiceQueue']['findAll'](queryQueues));_0x2b8af0[_0xd054('0x2c')](db[_0xd054('0x2d')][_0xd054('0x12')](queryQueues));_0x2b8af0['push'](db['FaxQueue']['findAll'](queryQueues));_0x2b8af0['push'](db['SmsQueue'][_0xd054('0x12')](queryQueues));_0x2b8af0[_0xd054('0x2c')](db[_0xd054('0x2e')][_0xd054('0x12')](queryQueues));_0x2b8af0[_0xd054('0x2c')](db[_0xd054('0x2f')]['findAll'](queryQueues));_0x2b8af0[_0xd054('0x2c')](db[_0xd054('0x5')][_0xd054('0x12')](queryTelephones));_0x2b8af0[_0xd054('0x2c')](db[_0xd054('0x30')][_0xd054('0x12')](queryTrunks));_0x2b8af0[_0xd054('0x2c')](db[_0xd054('0x18')][_0xd054('0x12')](queryCampaigns));_0x2b8af0[_0xd054('0x2c')](db[_0xd054('0x5')][_0xd054('0x12')](queryAgents));break;case _0xd054('0x31'):_0x270169[_0x40d6bc](_0xd054('0x28'));_0x270169[_0x40d6bc](_0xd054('0x29'));_0x2b8af0[_0xd054('0x2c')](getAssociatedResources('VoiceQueues',_0x257e31['userProfileId'],_0xd054('0x32')));_0x2b8af0['push'](getAssociatedResources(_0xd054('0xd'),_0x257e31[_0xd054('0x1f')],'ChatQueue'));_0x2b8af0[_0xd054('0x2c')](getAssociatedResources(_0xd054('0xe'),_0x257e31[_0xd054('0x1f')],_0xd054('0x33')));_0x2b8af0['push'](getAssociatedResources(_0xd054('0xf'),_0x257e31[_0xd054('0x1f')],_0xd054('0x34')));_0x2b8af0[_0xd054('0x2c')](getAssociatedResources('MailQueues',_0x257e31[_0xd054('0x1f')],'MailQueue'));_0x2b8af0[_0xd054('0x2c')](getAssociatedResources(_0xd054('0x11'),_0x257e31['userProfileId'],_0xd054('0x2f')));_0x2b8af0[_0xd054('0x2c')](getAssociatedResources(_0xd054('0x13'),_0x257e31['userProfileId'],_0xd054('0x5')));_0x2b8af0[_0xd054('0x2c')](getAssociatedResources('Trunks',_0x257e31[_0xd054('0x1f')],_0xd054('0x30')));_0x2b8af0[_0xd054('0x2c')](getAssociatedResources(_0xd054('0x35'),_0x257e31[_0xd054('0x1f')],_0xd054('0x18')));_0x2b8af0[_0xd054('0x2c')](db[_0xd054('0x5')][_0xd054('0x12')](queryAgents));break;case _0xd054('0x7'):_0x270169[_0x40d6bc]('voice:inbound');_0x270169[_0x40d6bc](_0xd054('0x29'));_0x2b8af0[_0xd054('0x2c')](_0x257e31['getVoiceQueues']({'attributes':['id',_0xd054('0x3')]}));_0x2b8af0['push'](_0x257e31[_0xd054('0x36')]({'attributes':['id',_0xd054('0x3')]}));_0x2b8af0['push'](_0x257e31[_0xd054('0x37')]({'attributes':['id','name']}));_0x2b8af0['push'](_0x257e31[_0xd054('0x38')]({'attributes':['id',_0xd054('0x3')]}));_0x2b8af0[_0xd054('0x2c')](_0x257e31['getMailQueues']({'attributes':['id','name']}));_0x2b8af0['push'](_0x257e31[_0xd054('0x39')]({'attributes':['id',_0xd054('0x3')]}));break;}return BPromise[_0xd054('0x3a')](_0x2b8af0);}})['then'](function(_0xcb6003){if(_0xcb6003&&_0xcb6003[_0xd054('0x1c')]){for(var _0x50e3de=0x0;_0x50e3de<_0xcb6003['length'];_0x50e3de+=0x1){for(var _0x517332=0x0;_0x517332<_0xcb6003[_0x50e3de][_0xd054('0x1c')];_0x517332+=0x1){switch(_0x50e3de){case 0x0:joinOrLeaveQueues(_0x270169,_0x40d6bc,_0xd054('0x3b'),_0xcb6003[_0x50e3de][_0x517332]);break;case 0x1:joinOrLeaveQueues(_0x270169,_0x40d6bc,_0xd054('0x3c'),_0xcb6003[_0x50e3de][_0x517332]);break;case 0x2:joinOrLeaveQueues(_0x270169,_0x40d6bc,'fax',_0xcb6003[_0x50e3de][_0x517332]);break;case 0x3:joinOrLeaveQueues(_0x270169,_0x40d6bc,_0xd054('0x3d'),_0xcb6003[_0x50e3de][_0x517332]);break;case 0x4:joinOrLeaveQueues(_0x270169,_0x40d6bc,_0xd054('0x3e'),_0xcb6003[_0x50e3de][_0x517332]);break;case 0x5:joinOrLeaveQueues(_0x270169,_0x40d6bc,_0xd054('0x3f'),_0xcb6003[_0x50e3de][_0x517332]);break;case 0x6:_0x270169[_0x40d6bc](util[_0xd054('0x1a')](_0xd054('0x40'),_0xcb6003[_0x50e3de][_0x517332][_0xd054('0x3')]));break;case 0x7:_0x270169[_0x40d6bc](util[_0xd054('0x1a')](_0xd054('0x41'),_0xcb6003[_0x50e3de][_0x517332][_0xd054('0x3')]));break;case 0x8:_0x270169[_0x40d6bc](util[_0xd054('0x1a')](_0xd054('0x42'),_0xcb6003[_0x50e3de][_0x517332]['type'],_0xcb6003[_0x50e3de][_0x517332]['name']));break;case 0x9:_0x270169[_0x40d6bc](util['format']('user:%s',_0xcb6003[_0x50e3de][_0x517332][_0xd054('0x3')]));break;}}}}})['then'](function(){if(_0x40d6bc===_0xd054('0x43')){var _0x4b7b6f=_[_0xd054('0x44')](_0x54ad2e[_0xd054('0x45')],'id');return _0x54ad2e['removeChatInteractions'](_0x4b7b6f)[_0xd054('0x16')](function(){for(var _0x1a3293=0x0;_0x1a3293<_0x4b7b6f[_0xd054('0x1c')];_0x1a3293+=0x1){_0x5867c0['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x4b7b6f[_0x1a3293]),'UserId':Number(_0x54ad2e['id'])});}});}})[_0xd054('0x16')](function(){if(_0x40d6bc==='leave'){var _0x1e0096=_[_0xd054('0x44')](_0x54ad2e[_0xd054('0x23')],'id');return _0x54ad2e[_0xd054('0x46')](_0x1e0096)['then'](function(){for(var _0x248874=0x0;_0x248874<_0x1e0096['length'];_0x248874+=0x1){_0x5867c0['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1e0096[_0x248874]),'UserId':Number(_0x54ad2e['id'])});}});}})[_0xd054('0x16')](function(){if(_0x40d6bc==='leave'){var _0x215646=_[_0xd054('0x44')](_0x54ad2e[_0xd054('0x47')],'id');return _0x54ad2e[_0xd054('0x48')](_0x215646)[_0xd054('0x16')](function(){for(var _0x543702=0x0;_0x543702<_0x215646[_0xd054('0x1c')];_0x543702+=0x1){_0x5867c0[_0xd054('0x49')](_0xd054('0x4a'),{'FaxInteractionId':Number(_0x215646[_0x543702]),'UserId':Number(_0x54ad2e['id'])});}});}})[_0xd054('0x16')](function(){if(_0x40d6bc==='leave'){var _0x513bb6=_['map'](_0x54ad2e[_0xd054('0x25')],'id');return _0x54ad2e[_0xd054('0x4b')](_0x513bb6)['then'](function(){for(var _0x32e167=0x0;_0x32e167<_0x513bb6[_0xd054('0x1c')];_0x32e167+=0x1){_0x5867c0[_0xd054('0x49')](_0xd054('0x4c'),{'SmsInteractionId':Number(_0x513bb6[_0x32e167]),'UserId':Number(_0x54ad2e['id'])});}});}})[_0xd054('0x16')](function(){if(_0x40d6bc===_0xd054('0x43')){var _0x5cdc89=_[_0xd054('0x44')](_0x54ad2e['OpenchannelInteractions'],'id');return _0x54ad2e['removeOpenchannelInteractions'](_0x5cdc89)[_0xd054('0x16')](function(){for(var _0x49c297=0x0;_0x49c297<_0x5cdc89[_0xd054('0x1c')];_0x49c297+=0x1){_0x5867c0[_0xd054('0x49')](_0xd054('0x4d'),{'OpenchannelInteractionId':Number(_0x5cdc89[_0x49c297]),'UserId':Number(_0x54ad2e['id'])});}});}})[_0xd054('0x4e')](function(_0x2c5a4c){_0x270169[_0xd054('0x4f')](_0x2c5a4c);});}}function onDisconnect(_0x24894b,_0x494e68){joinOrLeave(_0x24894b,_0xd054('0x43'),_0x494e68);}function onConnect(_0x9418af){joinOrLeave(_0x9418af,_0xd054('0x50'));}exports[_0xd054('0x51')]=function(_0x3dba30){_0x3dba30['on'](_0xd054('0x52'),function(_0x36cf71){_0x36cf71[_0xd054('0x53')](0x0);_0x36cf71[_0xd054('0x54')]=_0x36cf71['request'][_0xd054('0x52')]['remoteAddress']+':'+_0x36cf71[_0xd054('0x55')][_0xd054('0x52')][_0xd054('0x56')];_0x36cf71[_0xd054('0x57')]=new Date();_0x36cf71[_0xd054('0x4f')]=function(_0x54cb20){console[_0xd054('0x4f')](_0xd054('0x58')+_0x36cf71['nsp'][_0xd054('0x3')]+'['+_0x36cf71[_0xd054('0x54')]+']',_0x54cb20);};_0x36cf71['on'](_0xd054('0x59'),function(){onDisconnect(_0x36cf71,_0x3dba30);_0x36cf71[_0xd054('0x4f')](_0xd054('0x5a'));});onConnect(_0x36cf71);_0x36cf71['log']('CONNECTED');});};
\ No newline at end of file
diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js
index 70616de..9374823 100644
--- a/server/config/triggers/index.js
+++ b/server/config/triggers/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3be2=['default','length','model','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','ChatInteraction','afterCreate','afterUpdate','closedinteraction','Chat','Sms','SmsInteraction','newinteraction','newmessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','error','code','catch','get','channel','event','direction','User','find','UserId','then','interface','format','name','incomingmessage','outgoingmessage','opened','changed','closed','SIP/%s'];(function(_0x1a62c7,_0x3e842d){var _0x594e62=function(_0x3c686e){while(--_0x3c686e){_0x1a62c7['push'](_0x1a62c7['shift']());}};_0x594e62(++_0x3e842d);}(_0x3be2,0x150));var _0x23be=function(_0x78da7b,_0xdec768){_0x78da7b=_0x78da7b-0x0;var _0x32c4dc=_0x3be2[_0x78da7b];return _0x32c4dc;};'use strict';var util=require(_0x23be('0x0'));var db=require(_0x23be('0x1'))['db'];var jayson=require(_0x23be('0x2'));var logger=require(_0x23be('0x3'))(_0x23be('0x4'));var client=jayson[_0x23be('0x5')][_0x23be('0x6')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x23be('0x7'),'event':_0x23be('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':'ChatInteraction','event':_0x23be('0x9'),'condition':_0x23be('0xa'),'callback':afterUpdate},{'channel':_0x23be('0xb'),'model':'ChatMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x23be('0xc'),'model':_0x23be('0xd'),'event':_0x23be('0x8'),'condition':_0x23be('0xe'),'callback':afterCreate},{'channel':_0x23be('0xc'),'model':_0x23be('0xd'),'event':_0x23be('0x9'),'condition':_0x23be('0xa'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0x23be('0x8'),'condition':_0x23be('0xf'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x23be('0x10'),'event':_0x23be('0x8'),'condition':_0x23be('0xe'),'callback':afterCreate},{'channel':'Fax','model':_0x23be('0x10'),'event':'afterUpdate','condition':_0x23be('0xa'),'callback':afterUpdate},{'channel':_0x23be('0x11'),'model':_0x23be('0x12'),'event':_0x23be('0x8'),'condition':_0x23be('0xf'),'callback':afterCreateMessage},{'channel':_0x23be('0x13'),'model':_0x23be('0x14'),'event':'afterCreate','condition':_0x23be('0xe'),'callback':afterCreate},{'channel':'Mail','model':_0x23be('0x14'),'event':_0x23be('0x9'),'condition':_0x23be('0xa'),'callback':afterUpdate},{'channel':_0x23be('0x13'),'model':_0x23be('0x15'),'event':_0x23be('0x8'),'condition':_0x23be('0xf'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x23be('0x16'),'event':_0x23be('0x8'),'condition':_0x23be('0xe'),'callback':afterCreate},{'channel':_0x23be('0x17'),'model':_0x23be('0x16'),'event':_0x23be('0x9'),'condition':_0x23be('0xa'),'callback':afterUpdate},{'channel':_0x23be('0x17'),'model':_0x23be('0x18'),'event':_0x23be('0x8'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x137d62){return client[_0x23be('0x19')](_0x23be('0x1a'),_0x137d62)['then'](function(_0x4f31f6){logger[_0x23be('0x1b')](_0x23be('0x1c'),_0x23be('0x1a'),_0x4f31f6);if(_0x4f31f6[_0x23be('0x1d')]){if(_0x4f31f6[_0x23be('0x1d')][_0x23be('0x1e')]===0x1f4){logger[_0x23be('0x1d')]('Trigger,\x20%s','EventManager',_0x4f31f6['error']);}}})[_0x23be('0x1f')](function(_0xc422ab){logger[_0x23be('0x1d')]('Trigger,\x20%s',_0x23be('0x1a'),_0xc422ab);});}function afterCreateMessage(_0x1b3a81,_0x3d3bfe){return function(_0x16d95b,_0x327eb5){_0x16d95b=_0x16d95b[_0x23be('0x20')]({'plain':!![]});_0x16d95b[_0x23be('0x21')]=_0x1b3a81;_0x16d95b[_0x23be('0x22')]=_0x16d95b[_0x23be('0x23')];if(_0x16d95b['UserId']){return db[_0x23be('0x24')][_0x23be('0x25')]({'where':{'id':_0x16d95b[_0x23be('0x26')]},'attributes':['id','name'],'raw':!![]})[_0x23be('0x27')](function(_0x1a664a){_0x16d95b[_0x23be('0x28')]=util[_0x23be('0x29')]('SIP/%s',_0x1a664a[_0x23be('0x2a')]);_0x16d95b['channel']=_0x1b3a81;return request({'event':_0x23be('0x2b'),'message':_0x16d95b});})[_0x23be('0x1f')](function(_0x32740a){console['error'](_0x32740a);});}else{return request({'event':_0x23be('0x2c'),'message':_0x16d95b});}};}function afterCreate(_0x1f4593,_0x3b5471){return function(_0x3c4a36,_0xa4281a){_0x3c4a36=_0x3c4a36[_0x23be('0x20')]({'plain':!![]});_0x3c4a36[_0x23be('0x21')]=_0x1f4593;_0x3c4a36[_0x23be('0x22')]=_0x23be('0x2d');return request({'event':_0x3b5471,'message':_0x3c4a36});};}function afterUpdate(_0x2a9c57,_0x5f5cce){return function(_0x56b1cd,_0xa75544){if(_0x56b1cd[_0x23be('0x2e')](_0x23be('0x2f'))&&_0x56b1cd[_0x23be('0x2f')]){_0x56b1cd=_0x56b1cd[_0x23be('0x20')]({'plain':!![]});_0x56b1cd[_0x23be('0x21')]=_0x2a9c57;_0x56b1cd[_0x23be('0x22')]=_0x23be('0x2f');if(_0x56b1cd[_0x23be('0x26')]){return db['User'][_0x23be('0x25')]({'where':{'id':_0x56b1cd[_0x23be('0x26')]},'attributes':['id',_0x23be('0x2a')],'raw':!![]})[_0x23be('0x27')](function(_0x2e032c){_0x56b1cd[_0x23be('0x28')]=util[_0x23be('0x29')](_0x23be('0x30'),_0x2e032c[_0x23be('0x2a')]);return request({'event':_0x5f5cce,'message':_0x56b1cd});})[_0x23be('0x1f')](function(_0xeb8dc2){console[_0x23be('0x1d')](_0xeb8dc2);});}else{return request({'event':_0x5f5cce,'message':_0x56b1cd});}}};}exports[_0x23be('0x31')]=function(){for(var _0x54fe3d=0x0;_0x54fe3d
@@ -53,7 +53,7 @@
<% if (alignment == 'right') { -%> // Bottom, right
topChat_set(iframe_h, verticalAlignment);
document.body.appendChild(div_tab);
- var html=' <
CHAT ';
+ var html='
CHAT ';
div_tab.innerHTML=html;
document.getElementById("motion-chat-iframe-tab").addEventListener("click", function(){
if(tab_status%2==0) {
diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js
index a36c8ac..49553ef 100644
--- a/server/mysqldb/index.js
+++ b/server/mysqldb/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5162=['JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','hasOne','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','SmsInteractions','FaxInteraction','MailInteractions','belongsTo','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','UserVoiceQueue','MailQueues','ChatQueues','UserChatQueue','FaxQueues','SmsQueue','SmsQueues','UserSmsQueue','OpenchannelQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','MailAccountId','Smtp','Answers','Interactions','List','ListId','Template','TemplateId','ContactId','Owner','mail_interaction_has_tags','Tags','Users','user_has_mail_interactions','Attachments','Contact','Interaction','MailInteractionId','Account','restrict','TagId','Dashboard','Items','Dispositions','FaxAccountId','Applications','Exntensions','Messages','FaxQueue','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','Teams','FaxQueueReport','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatMessage','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','cm_contact_has_tags','CampaignId','CmHopperBlack','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','Extensions','MailApplications','ChatApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','Subjects','DescriptionId','Subject','SubjectId','Field','FieldId','SugarcrmConfiguration','SugarcrmField','Description','VariableId','DeskConfiguration','Descriptions','int_desk_configuration_has_tags','ZohoConfiguration','ZohoField','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowConfiguration','FromId','ToId','SessionId','ProjectId','SquareProject','VoiceQueues','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsQueueId','Queues','user_has_voice_prefixes','UserProfileSections','Resources','exports','path','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','mysql','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model'];(function(_0x29a08d,_0x551eca){var _0x10fc1a=function(_0x4a2117){while(--_0x4a2117){_0x29a08d['push'](_0x29a08d['shift']());}};_0x10fc1a(++_0x551eca);}(_0x5162,0x103));var _0x2516=function(_0x1f6fd5,_0x399cb0){_0x1f6fd5=_0x1f6fd5-0x0;var _0x587d12=_0x5162[_0x1f6fd5];return _0x587d12;};'use strict';var path=require(_0x2516('0x0'));var config=require('../config/environment');var Sequelize=require('sequelize');var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0x2516('0x1')]();config[_0x2516('0x2')]=_[_0x2516('0x3')](config[_0x2516('0x2')],{'database':_0x2516('0x4'),'username':_0x2516('0x5'),'password':_0x2516('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x2516('0x7')](),'define':{'charset':_0x2516('0x8'),'collate':_0x2516('0x9')}}});config[_0x2516('0xa')]=_[_0x2516('0x3')](config[_0x2516('0xa')],{'database':_0x2516('0x4'),'username':'xcall','password':_0x2516('0x6'),'options':{'host':_0x2516('0xb'),'port':0xcea,'dialect':_0x2516('0xc'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2516('0x2')][_0x2516('0xd')],config[_0x2516('0x2')][_0x2516('0xe')],config['sequelize'][_0x2516('0xf')],config[_0x2516('0x2')][_0x2516('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2516('0xa')][_0x2516('0xd')],config[_0x2516('0xa')][_0x2516('0xe')],config[_0x2516('0xa')][_0x2516('0xf')],config[_0x2516('0xa')][_0x2516('0x10')])};db[_0x2516('0x11')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x13'));db['VoiceChanSpy']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x14'));db['VoiceContext']=db[_0x2516('0x2')]['import']('../api/voiceContext/voiceContext.model');db[_0x2516('0x15')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x16'));db[_0x2516('0x17')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x18'));db[_0x2516('0x19')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x1a'));db[_0x2516('0x1b')]=db['sequelize']['import'](_0x2516('0x1c'));db[_0x2516('0x1d')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x1e'));db[_0x2516('0x1f')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/voiceMail/voiceMail.model');db[_0x2516('0x20')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x21'));db['VoiceCallReport']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x22'));db[_0x2516('0x23')]=db[_0x2516('0x2')]['import'](_0x2516('0x24'));db[_0x2516('0x25')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x26'));db[_0x2516('0x27')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x28'));db['MemberReport']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x29'));db[_0x2516('0x2a')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x2b'));db[_0x2516('0x2c')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x2d'));db[_0x2516('0x2e')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x2f'));db['UserVoiceQueue']=db[_0x2516('0x2')]['import'](_0x2516('0x30'));db['UserChatQueue']=db[_0x2516('0x2')]['import'](_0x2516('0x31'));db[_0x2516('0x32')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x33'));db[_0x2516('0x34')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x35'));db['UserSmsQueue']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x36'));db[_0x2516('0x37')]=db['sequelize']['import'](_0x2516('0x38'));db[_0x2516('0x39')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x3a'));db[_0x2516('0x3b')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x3c'));db[_0x2516('0x3d')]=db['sequelize']['import'](_0x2516('0x3e'));db[_0x2516('0x3f')]=db['sequelize']['import'](_0x2516('0x40'));db[_0x2516('0x41')]=db['sequelize'][_0x2516('0x12')]('../api/mailSubstatus/mailSubstatus.model');db[_0x2516('0x42')]=db[_0x2516('0x2')]['import'](_0x2516('0x43'));db[_0x2516('0x44')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x45'));db[_0x2516('0x46')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x47'));db[_0x2516('0x48')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x49'));db['Dashboard']=db[_0x2516('0x2')][_0x2516('0x12')]('../api/dashboard/dashboard.model');db[_0x2516('0x4a')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x4b'));db[_0x2516('0x4c')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x4d'));db[_0x2516('0x4e')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x4f'));db['FaxInteraction']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x50'));db[_0x2516('0x51')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x52'));db['FaxQueue']=db[_0x2516('0x2')]['import'](_0x2516('0x53'));db['FaxQueueReport']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x54'));db['SmsAccount']=db['sequelize'][_0x2516('0x12')](_0x2516('0x55'));db['SmsApplication']=db['sequelize'][_0x2516('0x12')](_0x2516('0x56'));db[_0x2516('0x57')]=db['sequelize'][_0x2516('0x12')]('../api/smsInteraction/smsInteraction.model');db[_0x2516('0x58')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x59'));db['SmsQueue']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x5a'));db[_0x2516('0x5b')]=db[_0x2516('0x2')]['import'](_0x2516('0x5c'));db[_0x2516('0x5d')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/openchannelApplication/openchannelApplication.model');db[_0x2516('0x5e')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x5f'));db[_0x2516('0x60')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x61'));db[_0x2516('0x62')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x63'));db['ChatWebsite']=db['sequelize']['import'](_0x2516('0x64'));db['OpenchannelQueueReport']=db['sequelize']['import'](_0x2516('0x65'));db[_0x2516('0x66')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x67'));db['ChatInteraction']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x68'));db['ChatMessage']=db[_0x2516('0x2')][_0x2516('0x12')]('../api/chatMessage/chatMessage.model');db[_0x2516('0x69')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x6a'));db[_0x2516('0x6b')]=db['sequelize']['import'](_0x2516('0x6c'));db['ChatGroup']=db[_0x2516('0x2')]['import'](_0x2516('0x6d'));db[_0x2516('0x6e')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x6f'));db[_0x2516('0x70')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x71'));db[_0x2516('0x72')]=db[_0x2516('0x2')]['import'](_0x2516('0x73'));db[_0x2516('0x74')]=db[_0x2516('0x2')]['import'](_0x2516('0x75'));db['CmHopperBlack']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x76'));db['CmHopperFinal']=db['sequelize']['import'](_0x2516('0x77'));db[_0x2516('0x78')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x2516('0x79')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x2516('0x7a')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x7b'));db[_0x2516('0x7c')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x7d'));db[_0x2516('0x7e')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x7f'));db[_0x2516('0x80')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x81'));db[_0x2516('0x82')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x83'));db[_0x2516('0x84')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x85'));db[_0x2516('0x86')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x87'));db['Pause']=db['sequelize']['import'](_0x2516('0x88'));db[_0x2516('0x89')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0x2516('0x2')]['import'](_0x2516('0x8a'));db[_0x2516('0x8b')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x8c'));db[_0x2516('0x8d')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x8e'));db[_0x2516('0x8f')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/tag/tag.model');db['Template']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x90'));db['Trigger']=db[_0x2516('0x2')]['import'](_0x2516('0x91'));db[_0x2516('0x92')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x93'));db[_0x2516('0x94')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x95'));db[_0x2516('0x96')]=db['sequelize']['import'](_0x2516('0x97'));db['AnalyticCustomReport']=db['sequelize'][_0x2516('0x12')](_0x2516('0x98'));db[_0x2516('0x99')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x9a'));db[_0x2516('0x9b')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x2516('0x9c')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x9d'));db['AnalyticFieldReport']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x9e'));db[_0x2516('0x9f')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x2516('0xa0')]=db['sequelize']['import'](_0x2516('0xa1'));db[_0x2516('0xa2')]=db[_0x2516('0x2')]['import'](_0x2516('0xa3'));db[_0x2516('0xa4')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x2516('0xa5')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xa6'));db['SugarcrmConfiguration']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xa7'));db['SugarcrmField']=db[_0x2516('0x2')]['import'](_0x2516('0xa8'));db[_0x2516('0xa9')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xaa'));db['DeskConfiguration']=db['sequelize']['import'](_0x2516('0xab'));db[_0x2516('0xac')]=db['sequelize'][_0x2516('0x12')](_0x2516('0xad'));db[_0x2516('0xae')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xaf'));db['ZohoConfiguration']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xb0'));db['ZohoField']=db['sequelize']['import'](_0x2516('0xb1'));db[_0x2516('0xb2')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db['sequelize'][_0x2516('0x12')](_0x2516('0xb3'));db[_0x2516('0xb4')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xb5'));db[_0x2516('0xb6')]=db[_0x2516('0x2')]['import'](_0x2516('0xb7'));db[_0x2516('0xb8')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xb9'));db['FreshdeskField']=db[_0x2516('0x2')][_0x2516('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x2516('0xba')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xbb'));db[_0x2516('0xbc')]=db[_0x2516('0x2')]['import'](_0x2516('0xbd'));db[_0x2516('0xbe')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xbf'));db[_0x2516('0xc0')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xc1'));db['ServicenowConfiguration']=db[_0x2516('0x2')]['import'](_0x2516('0xc2'));db[_0x2516('0xc3')]=db['sequelize']['import'](_0x2516('0xc4'));db[_0x2516('0xc5')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xc6'));db[_0x2516('0xc7')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xc8'));db[_0x2516('0xc9')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xca'));db[_0x2516('0x94')]=db[_0x2516('0x2')]['import']('../api/integration/integration.model');db[_0x2516('0xcb')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/network/network.model');db[_0x2516('0xcc')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xcd'));db[_0x2516('0xce')]=db[_0x2516('0x2')]['import'](_0x2516('0xcf'));db[_0x2516('0xd0')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xd1'));db[_0x2516('0xd2')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xd3'));db[_0x2516('0xd4')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xd5'));db[_0x2516('0xd6')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xd7'));db[_0x2516('0xd8')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xd9'));db[_0x2516('0xda')]=db['sequelize'][_0x2516('0x12')](_0x2516('0xdb'));db[_0x2516('0xdc')]=db['sequelize'][_0x2516('0x12')]('../api/setting/setting.model');db[_0x2516('0xdd')]=db['sequelize'][_0x2516('0x12')](_0x2516('0xde'));db['SquareProject']=db[_0x2516('0x2')]['import'](_0x2516('0xdf'));db[_0x2516('0xe0')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xe1'));db[_0x2516('0xe2')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xe3'));db['Team']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xe4'));db[_0x2516('0xe5')]=db['sequelize'][_0x2516('0x12')](_0x2516('0xe6'));db[_0x2516('0xe7')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/campaign/campaign.model');db[_0x2516('0xe8')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xe9'));db[_0x2516('0xea')]=db[_0x2516('0x2')]['import'](_0x2516('0xeb'));db['Plugin']=db[_0x2516('0x2')]['import']('../api/plugin/plugin.model');db[_0x2516('0xec')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x2516('0xed')]=db[_0x2516('0x2')]['import'](_0x2516('0xee'));db[_0x2516('0xef')]=db['sequelize']['import'](_0x2516('0xf0'));db[_0x2516('0xf1')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xf2'));db[_0x2516('0xf3')]=db['sequelize'][_0x2516('0x12')](_0x2516('0xf4'));db[_0x2516('0xf5')]=db[_0x2516('0x2')]['import'](_0x2516('0xf6'));db[_0x2516('0xf7')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x2516('0xf8')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/userProfile/userProfile.model');db[_0x2516('0xf9')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xfa'));db['UserProfileResource']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xfb'));db[_0x2516('0x11')][_0x2516('0xfc')](db[_0x2516('0x1f')],{'as':'VoiceMail','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x11')]['hasMany'](db[_0x2516('0x1b')],{'as':_0x2516('0xff'),'foreignKey':'UserId'});db['User'][_0x2516('0x100')](db[_0x2516('0x2e')],{'as':_0x2516('0x101'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x11')][_0x2516('0x100')](db[_0x2516('0x15')],{'as':'Extensions','onDelete':_0x2516('0xfd'),'hooks':!![]});db[_0x2516('0x11')][_0x2516('0x100')](db[_0x2516('0x102')],{'as':_0x2516('0x103'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x11')][_0x2516('0x100')](db[_0x2516('0x78')],{'as':_0x2516('0x104'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x11')]['hasMany'](db[_0x2516('0x79')],{'as':_0x2516('0x79'),'foreignKey':'UserId'});db[_0x2516('0x11')][_0x2516('0x100')](db[_0x2516('0x5e')],{'as':_0x2516('0x105'),'foreignKey':_0x2516('0xfe')});db['User'][_0x2516('0x100')](db[_0x2516('0x106')],{'as':'ChatInteractions','foreignKey':_0x2516('0xfe')});db['User']['hasMany'](db[_0x2516('0x57')],{'as':_0x2516('0x107'),'foreignKey':_0x2516('0xfe')});db['User'][_0x2516('0x100')](db[_0x2516('0x108')],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0x2516('0x11')][_0x2516('0x100')](db[_0x2516('0x42')],{'as':_0x2516('0x109'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x11')][_0x2516('0x10a')](db[_0x2516('0xf8')],{'as':_0x2516('0xf8'),'foreignKey':'userProfileId'});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x10c')],{'as':_0x2516('0x10d'),'through':_0x2516('0x10e')});db[_0x2516('0x11')]['belongsToMany'](db[_0x2516('0x72')],{'as':_0x2516('0x10f'),'through':_0x2516('0x110')});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0xf5')],{'as':_0x2516('0x111'),'through':_0x2516('0x112')});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x113')],{'through':_0x2516('0x114')});db[_0x2516('0x11')]['belongsToMany'](db[_0x2516('0x42')],{'as':_0x2516('0x109'),'through':'user_has_mail_interactions'});db['User'][_0x2516('0x10b')](db[_0x2516('0x106')],{'as':_0x2516('0x115'),'through':_0x2516('0x116')});db[_0x2516('0x11')]['belongsToMany'](db[_0x2516('0x108')],{'as':_0x2516('0x117'),'through':_0x2516('0x118')});db[_0x2516('0x11')]['belongsToMany'](db['SmsInteraction'],{'as':'SmsInteractions','through':_0x2516('0x119')});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x5e')],{'as':'OpenchannelInteractions','through':_0x2516('0x11a')});db['User'][_0x2516('0x10b')](db[_0x2516('0x19')],{'as':'VoiceQueues','through':_0x2516('0x11b'),'required':![]});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x3f')],{'as':_0x2516('0x11c'),'through':_0x2516('0x32'),'required':![]});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x6b')],{'as':_0x2516('0x11d'),'through':_0x2516('0x11e'),'required':![],'hooks':!![]});db[_0x2516('0x11')][_0x2516('0x10b')](db['FaxQueue'],{'as':_0x2516('0x11f'),'through':_0x2516('0x34'),'required':![]});db[_0x2516('0x11')]['belongsToMany'](db[_0x2516('0x120')],{'as':_0x2516('0x121'),'through':_0x2516('0x122'),'required':![]});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x62')],{'as':_0x2516('0x123'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x2516('0x10b')](db[_0x2516('0xf5')],{'through':_0x2516('0x112')});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0xf7')],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x124')],{'as':_0x2516('0x125'),'through':_0x2516('0x126')});db['User'][_0x2516('0x10b')](db[_0x2516('0x4c')],{'as':_0x2516('0x127'),'through':_0x2516('0x128')});db['User'][_0x2516('0x10b')](db['MailAccount'],{'as':_0x2516('0x129'),'through':'user_has_mail_accounts'});db['User'][_0x2516('0x10b')](db[_0x2516('0x5b')],{'as':'OpenchannelAccounts','through':_0x2516('0x12a')});db['User'][_0x2516('0x10b')](db[_0x2516('0x12b')],{'as':'SmsAccounts','through':_0x2516('0x12c')});db[_0x2516('0x11')]['belongsToMany'](db['SquareProject'],{'as':_0x2516('0x12d'),'through':_0x2516('0x12e')});db['VoiceChanSpy'][_0x2516('0x100')](db[_0x2516('0x15')],{'as':_0x2516('0x12f'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x130')});db[_0x2516('0x131')][_0x2516('0x100')](db[_0x2516('0x15')],{'onDelete':_0x2516('0xfd')});db[_0x2516('0x15')]['hasMany'](db['VoiceExtension'],{'as':'Applications','onDelete':_0x2516('0xfd')});db[_0x2516('0x17')]['belongsToMany'](db[_0x2516('0x8d')],{'as':_0x2516('0x132'),'through':_0x2516('0x133')});db['VoiceQueue'][_0x2516('0x100')](db[_0x2516('0x2e')],{'as':_0x2516('0x134'),'foreignKey':_0x2516('0x135')});db[_0x2516('0x19')][_0x2516('0x100')](db[_0x2516('0x74')],{'as':_0x2516('0x136'),'foreignKey':_0x2516('0x135')});db['VoiceQueue'][_0x2516('0x100')](db[_0x2516('0x102')],{'as':_0x2516('0x103'),'foreignKey':_0x2516('0x135')});db[_0x2516('0x19')][_0x2516('0x100')](db[_0x2516('0x78')],{'as':_0x2516('0x137'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x2516('0x100')](db[_0x2516('0x79')],{'as':_0x2516('0x79'),'foreignKey':_0x2516('0x135')});db['VoiceQueue'][_0x2516('0x100')](db['CmHopperBlack'],{'as':_0x2516('0x138'),'foreignKey':'VoiceQueueId'});db[_0x2516('0x19')][_0x2516('0x100')](db[_0x2516('0xd4')],{'as':_0x2516('0x139'),'foreignKey':_0x2516('0x135')});db[_0x2516('0x19')][_0x2516('0x10a')](db[_0x2516('0x2a')],{'as':_0x2516('0x2a'),'foreignKey':_0x2516('0x13a')});db[_0x2516('0x19')]['belongsTo'](db[_0x2516('0x2a')],{'as':_0x2516('0x13b'),'foreignKey':_0x2516('0x13c')});db[_0x2516('0x19')]['belongsTo'](db[_0x2516('0x86')],{'as':_0x2516('0x86'),'foreignKey':_0x2516('0x13d')});db[_0x2516('0x19')]['belongsTo'](db[_0x2516('0x13e')],{'as':_0x2516('0x13f'),'foreignKey':_0x2516('0x140')});db[_0x2516('0x19')][_0x2516('0x10b')](db[_0x2516('0xf5')],{'as':_0x2516('0x111'),'through':_0x2516('0x141')});db[_0x2516('0x19')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x11b')});db[_0x2516('0x19')][_0x2516('0x10b')](db[_0x2516('0x113')],{'as':'Teams','through':_0x2516('0x143')});db[_0x2516('0x19')]['belongsToMany'](db[_0x2516('0xf5')],{'as':_0x2516('0x144'),'through':_0x2516('0x145')});db[_0x2516('0x1b')][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x11'),'foreignKey':'UserId'});db[_0x2516('0x1d')]['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x11'),'foreignKey':'UserId'});db[_0x2516('0x1f')][_0x2516('0x100')](db[_0x2516('0x20')],{'as':'Messages','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x146'),'sourceKey':_0x2516('0x147')});db[_0x2516('0x20')][_0x2516('0x10a')](db[_0x2516('0x1f')],{'foreignKey':_0x2516('0x146'),'targetKey':_0x2516('0x147')});db[_0x2516('0x148')]['hasMany'](db['VoiceQueueReport'],{'as':_0x2516('0x149'),'foreignKey':_0x2516('0x14a'),'constraints':![]});db[_0x2516('0x148')][_0x2516('0x100')](db[_0x2516('0x25')],{'as':'AgentReports','foreignKey':_0x2516('0x14a'),'constraints':![]});db[_0x2516('0x148')][_0x2516('0x10a')](db['User'],{'as':_0x2516('0x11'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x148')][_0x2516('0x10a')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['MailServerIn'][_0x2516('0x10a')](db['MailAccount'],{'as':_0x2516('0x3d'),'foreignKey':_0x2516('0x14b')});db['MailServerOut'][_0x2516('0x10a')](db[_0x2516('0x3d')],{'as':_0x2516('0x3d'),'foreignKey':_0x2516('0x14b')});db[_0x2516('0x3d')][_0x2516('0xfc')](db[_0x2516('0x39')],{'as':'Imap','onDelete':_0x2516('0xfd')});db[_0x2516('0x3d')][_0x2516('0xfc')](db['MailServerOut'],{'as':_0x2516('0x14c'),'onDelete':'cascade'});db[_0x2516('0x3d')][_0x2516('0x100')](db[_0x2516('0x82')],{'as':'Dispositions','foreignKey':_0x2516('0x14b')});db[_0x2516('0x3d')]['hasMany'](db[_0x2516('0x80')],{'as':_0x2516('0x14d'),'foreignKey':_0x2516('0x14b')});db[_0x2516('0x3d')]['hasMany'](db[_0x2516('0x44')],{'as':'Messages','foreignKey':_0x2516('0x14b')});db[_0x2516('0x3d')][_0x2516('0x100')](db[_0x2516('0x42')],{'as':_0x2516('0x14e')});db[_0x2516('0x3d')]['hasMany'](db[_0x2516('0x46')],{'as':'Applications'});db[_0x2516('0x3d')]['belongsTo'](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db[_0x2516('0x3d')][_0x2516('0x10a')](db[_0x2516('0x151')],{'as':'Template','foreignKey':_0x2516('0x152')});db[_0x2516('0x3d')][_0x2516('0x10a')](db[_0x2516('0x13e')],{'as':'mandatoryDispositionPause','foreignKey':_0x2516('0x140')});db['MailAccount']['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_mail_accounts'});db['MailQueue']['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':'UserMailQueue'});db[_0x2516('0x3f')][_0x2516('0x10b')](db[_0x2516('0x113')],{'through':'team_has_mail_queues','as':'Teams'});db['MailInteraction'][_0x2516('0x100')](db[_0x2516('0x44')],{'as':'Messages','onDelete':'cascade','foreignKey':'MailInteractionId'});db['MailInteraction'][_0x2516('0x10a')](db[_0x2516('0x3d')],{'as':'Account','foreignKey':_0x2516('0x14b')});db[_0x2516('0x42')]['belongsTo'](db[_0x2516('0x72')],{'as':'Contact','foreignKey':_0x2516('0x153')});db['MailInteraction']['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':'UserId'});db[_0x2516('0x42')]['belongsToMany'](db[_0x2516('0x8f')],{'through':_0x2516('0x155'),'as':_0x2516('0x156')});db[_0x2516('0x42')][_0x2516('0x10b')](db['Tag'],{'through':_0x2516('0x155'),'as':'ThroughTags'});db[_0x2516('0x42')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x157'),'through':_0x2516('0x158'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x2516('0x100')](db['Attachment'],{'as':_0x2516('0x159'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x44')]['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x11')});db[_0x2516('0x44')][_0x2516('0x10a')](db[_0x2516('0x72')],{'onDelete':_0x2516('0xfd'),'as':_0x2516('0x15a')});db[_0x2516('0x44')][_0x2516('0x10a')](db[_0x2516('0x42')],{'as':_0x2516('0x15b'),'foreignKey':_0x2516('0x15c')});db['MailMessage'][_0x2516('0x10a')](db['MailAccount'],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x14b')});db[_0x2516('0x46')][_0x2516('0x10a')](db['User'],{'onDelete':'restrict'});db['MailApplication'][_0x2516('0x10a')](db[_0x2516('0x3f')],{'onDelete':_0x2516('0x15e')});db[_0x2516('0x46')][_0x2516('0x10a')](db[_0x2516('0x3d')],{'onDelete':_0x2516('0x15e')});db[_0x2516('0x46')]['belongsTo'](db[_0x2516('0x86')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['MailApplication'][_0x2516('0x10a')](db[_0x2516('0x8f')],{'onDelete':'restrict','foreignKey':_0x2516('0x15f')});db[_0x2516('0x48')][_0x2516('0x10a')](db['MailAccount'],{});db[_0x2516('0x48')][_0x2516('0x10a')](db['CmList'],{'as':'List','foreignKey':_0x2516('0x150')});db[_0x2516('0x48')]['belongsTo'](db['CmContact'],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db['MailQueueReport'][_0x2516('0x10a')](db[_0x2516('0x42')],{});db[_0x2516('0x48')]['belongsTo'](db['MailMessage'],{});db[_0x2516('0x48')]['belongsTo'](db[_0x2516('0x11')],{});db[_0x2516('0x48')][_0x2516('0x10a')](db['MailQueue'],{});db[_0x2516('0x160')][_0x2516('0x100')](db[_0x2516('0x4a')],{'as':_0x2516('0x161'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x4c')][_0x2516('0x100')](db[_0x2516('0x82')],{'as':_0x2516('0x162'),'foreignKey':_0x2516('0x163')});db[_0x2516('0x4c')][_0x2516('0x100')](db[_0x2516('0x80')],{'as':'Answers','foreignKey':_0x2516('0x163')});db[_0x2516('0x4c')][_0x2516('0x100')](db['FaxInteraction'],{'as':_0x2516('0x14e')});db[_0x2516('0x4c')][_0x2516('0x100')](db['FaxApplication'],{'as':_0x2516('0x164')});db['FaxAccount']['hasMany'](db[_0x2516('0x15')],{'as':_0x2516('0x165'),'onDelete':'cascade'});db[_0x2516('0x4c')][_0x2516('0x100')](db[_0x2516('0x51')],{'as':_0x2516('0x166')});db['FaxAccount'][_0x2516('0x10a')](db['Trunk'],{'as':_0x2516('0x2a')});db[_0x2516('0x4c')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db[_0x2516('0x4c')]['belongsTo'](db[_0x2516('0x13e')],{'as':_0x2516('0x13f'),'foreignKey':_0x2516('0x140')});db[_0x2516('0x4c')]['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x128')});db['FaxApplication'][_0x2516('0x10a')](db[_0x2516('0x11')],{'onDelete':'restrict'});db[_0x2516('0x4e')][_0x2516('0x10a')](db[_0x2516('0x167')],{'onDelete':_0x2516('0x15e')});db[_0x2516('0x4e')][_0x2516('0x10a')](db[_0x2516('0x4c')],{'onDelete':'restrict'});db[_0x2516('0x4e')]['belongsTo'](db[_0x2516('0x8f')],{'onDelete':_0x2516('0x15e'),'foreignKey':'TagId'});db[_0x2516('0x108')][_0x2516('0x100')](db[_0x2516('0x51')],{'as':'Messages','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x168')});db[_0x2516('0x108')][_0x2516('0x10a')](db[_0x2516('0x4c')],{'as':'Account','foreignKey':_0x2516('0x163')});db[_0x2516('0x108')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':_0x2516('0x15a'),'foreignKey':'ContactId'});db[_0x2516('0x108')][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x108')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x169'),'as':_0x2516('0x156')});db[_0x2516('0x108')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':'fax_interaction_has_tags','as':_0x2516('0x16a')});db[_0x2516('0x108')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':'Users','through':_0x2516('0x118'),'foreignKey':_0x2516('0x168')});db[_0x2516('0x51')]['belongsTo'](db['User'],{'onDelete':'cascade','as':'User'});db['FaxMessage'][_0x2516('0x10a')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0x2516('0x168')});db[_0x2516('0x51')][_0x2516('0x10a')](db[_0x2516('0x72')],{'onDelete':'cascade','as':_0x2516('0x15a')});db[_0x2516('0x51')][_0x2516('0x10a')](db[_0x2516('0xea')],{'as':_0x2516('0xea'),'foreignKey':_0x2516('0x16b')});db[_0x2516('0x51')][_0x2516('0x10a')](db[_0x2516('0x4c')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x163')});db[_0x2516('0x167')]['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':'UserFaxQueue'});db[_0x2516('0x167')]['belongsToMany'](db[_0x2516('0x113')],{'through':_0x2516('0x16c'),'as':_0x2516('0x16d')});db['FaxQueueReport'][_0x2516('0x10a')](db[_0x2516('0x4c')],{});db['FaxQueueReport'][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0x2516('0x16e')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':'Contact','foreignKey':_0x2516('0x153')});db[_0x2516('0x16e')][_0x2516('0x10a')](db['FaxInteraction'],{});db[_0x2516('0x16e')][_0x2516('0x10a')](db['FaxMessage'],{});db[_0x2516('0x16e')][_0x2516('0x10a')](db[_0x2516('0x11')],{});db[_0x2516('0x16e')][_0x2516('0x10a')](db['FaxQueue'],{});db[_0x2516('0x12b')][_0x2516('0x100')](db[_0x2516('0x82')],{'as':_0x2516('0x162'),'foreignKey':_0x2516('0x16f')});db[_0x2516('0x12b')][_0x2516('0x100')](db['CannedAnswer'],{'as':_0x2516('0x14d'),'foreignKey':_0x2516('0x16f')});db[_0x2516('0x12b')][_0x2516('0x100')](db[_0x2516('0x58')],{'as':_0x2516('0x166'),'foreignKey':_0x2516('0x16f')});db[_0x2516('0x12b')][_0x2516('0x100')](db[_0x2516('0x57')],{'as':'Interactions'});db[_0x2516('0x12b')]['hasMany'](db[_0x2516('0x170')],{'as':_0x2516('0x164')});db[_0x2516('0x12b')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db[_0x2516('0x12b')]['belongsTo'](db[_0x2516('0x13e')],{'as':'mandatoryDispositionPause','foreignKey':_0x2516('0x140')});db[_0x2516('0x12b')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x12c')});db[_0x2516('0x170')]['belongsTo'](db[_0x2516('0x11')],{'onDelete':_0x2516('0x15e')});db['SmsApplication']['belongsTo'](db[_0x2516('0x120')],{'onDelete':_0x2516('0x15e')});db['SmsApplication'][_0x2516('0x10a')](db['SmsAccount'],{'onDelete':'restrict'});db['SmsApplication'][_0x2516('0x10a')](db[_0x2516('0x86')],{'onDelete':_0x2516('0x15e'),'foreignKey':'IntervalId'});db['SmsApplication'][_0x2516('0x10a')](db[_0x2516('0x8f')],{'onDelete':_0x2516('0x15e'),'foreignKey':_0x2516('0x15f')});db[_0x2516('0x57')]['hasMany'](db[_0x2516('0x58')],{'as':_0x2516('0x166'),'onDelete':'cascade','foreignKey':_0x2516('0x171')});db[_0x2516('0x57')][_0x2516('0x10a')](db[_0x2516('0x12b')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x16f')});db[_0x2516('0x57')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0x2516('0x57')]['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x57')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x172'),'as':_0x2516('0x156')});db[_0x2516('0x57')][_0x2516('0x10b')](db['Tag'],{'through':_0x2516('0x172'),'as':_0x2516('0x16a')});db[_0x2516('0x57')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x157'),'through':_0x2516('0x119'),'foreignKey':_0x2516('0x171')});db[_0x2516('0x58')][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x11')});db[_0x2516('0x58')][_0x2516('0x10a')](db[_0x2516('0x72')],{'onDelete':_0x2516('0xfd'),'as':'Contact'});db['SmsMessage'][_0x2516('0x10a')](db[_0x2516('0x57')],{'onDelete':_0x2516('0xfd'),'as':'Interaction','foreignKey':_0x2516('0x171')});db[_0x2516('0x58')][_0x2516('0x10a')](db[_0x2516('0x12b')],{'as':'Account','foreignKey':_0x2516('0x16f')});db['SmsQueue'][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x122'),'foreignKey':_0x2516('0x173')});db[_0x2516('0x120')]['belongsToMany'](db[_0x2516('0x113')],{'through':'team_has_sms_queues','as':_0x2516('0x16d')});db[_0x2516('0x5b')][_0x2516('0x100')](db[_0x2516('0x82')],{'as':_0x2516('0x162'),'foreignKey':_0x2516('0x174')});db[_0x2516('0x5b')][_0x2516('0x100')](db['CannedAnswer'],{'as':_0x2516('0x14d'),'foreignKey':_0x2516('0x174')});db[_0x2516('0x5b')][_0x2516('0x100')](db[_0x2516('0x5e')],{'as':_0x2516('0x14e'),'foreignKey':_0x2516('0x174')});db[_0x2516('0x5b')][_0x2516('0x100')](db[_0x2516('0x60')],{'as':_0x2516('0x166'),'foreignKey':_0x2516('0x174')});db[_0x2516('0x5b')]['hasMany'](db[_0x2516('0x5d')],{'as':_0x2516('0x164'),'foreignKey':'OpenchannelAccountId'});db[_0x2516('0x5b')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':'List','foreignKey':_0x2516('0x150')});db[_0x2516('0x5b')][_0x2516('0x10a')](db[_0x2516('0x13e')],{'as':_0x2516('0x13f'),'foreignKey':_0x2516('0x140')});db[_0x2516('0x5b')]['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':'user_has_openchannel_accounts'});db[_0x2516('0x5d')][_0x2516('0x10a')](db['User'],{'onDelete':_0x2516('0x15e')});db[_0x2516('0x5d')]['belongsTo'](db[_0x2516('0x62')],{'onDelete':'restrict','foreignKey':_0x2516('0x175')});db[_0x2516('0x5d')][_0x2516('0x10a')](db[_0x2516('0x5b')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0x2516('0x5d')][_0x2516('0x10a')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x2516('0x13d')});db['OpenchannelApplication'][_0x2516('0x10a')](db['Tag'],{'onDelete':_0x2516('0x15e'),'foreignKey':_0x2516('0x15f')});db['OpenchannelInteraction'][_0x2516('0x100')](db[_0x2516('0x60')],{'as':_0x2516('0x166'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x176')});db[_0x2516('0x5e')][_0x2516('0x10a')](db[_0x2516('0x5b')],{'as':_0x2516('0x15d'),'foreignKey':'OpenchannelAccountId'});db[_0x2516('0x5e')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':'Contact','foreignKey':_0x2516('0x153')});db[_0x2516('0x5e')]['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':'UserId'});db[_0x2516('0x5e')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x177'),'as':_0x2516('0x156')});db[_0x2516('0x5e')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':'openchannel_interaction_has_tags','as':_0x2516('0x16a')});db[_0x2516('0x5e')]['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x157'),'through':'user_has_openchannel_interactions','foreignKey':_0x2516('0x176')});db[_0x2516('0x60')][_0x2516('0x10a')](db[_0x2516('0x11')],{'onDelete':'cascade','as':_0x2516('0x11')});db[_0x2516('0x60')][_0x2516('0x10a')](db['CmContact'],{'onDelete':_0x2516('0xfd'),'as':'Contact'});db[_0x2516('0x60')][_0x2516('0x10a')](db[_0x2516('0x5e')],{'onDelete':_0x2516('0xfd'),'as':_0x2516('0x15b'),'foreignKey':_0x2516('0x176')});db['OpenchannelMessage'][_0x2516('0x10a')](db[_0x2516('0xea')],{'as':_0x2516('0xea'),'foreignKey':_0x2516('0x16b')});db[_0x2516('0x60')][_0x2516('0x10a')](db['OpenchannelAccount'],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x174')});db[_0x2516('0x62')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x37'),'foreignKey':_0x2516('0x175')});db[_0x2516('0x62')][_0x2516('0x10b')](db['Team'],{'through':_0x2516('0x178'),'as':_0x2516('0x16d')});db[_0x2516('0x124')]['hasMany'](db[_0x2516('0x82')],{'as':_0x2516('0x162'),'foreignKey':_0x2516('0x179')});db[_0x2516('0x124')][_0x2516('0x100')](db[_0x2516('0x80')],{'as':_0x2516('0x14d'),'foreignKey':_0x2516('0x179')});db[_0x2516('0x124')][_0x2516('0x100')](db[_0x2516('0x6e')],{'as':_0x2516('0x17a')});db[_0x2516('0x124')][_0x2516('0x100')](db[_0x2516('0x106')],{'as':_0x2516('0x14e')});db['ChatWebsite'][_0x2516('0x100')](db['ChatApplication'],{'as':_0x2516('0x164')});db[_0x2516('0x124')][_0x2516('0x100')](db[_0x2516('0x17b')],{'as':'Messages'});db['ChatWebsite'][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db[_0x2516('0x124')][_0x2516('0x10a')](db[_0x2516('0x86')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x2516('0x124')]['belongsTo'](db[_0x2516('0x13e')],{'as':_0x2516('0x13f'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':'Agents','through':_0x2516('0x126')});db[_0x2516('0x17c')]['belongsTo'](db[_0x2516('0x5b')],{});db[_0x2516('0x17c')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0x2516('0x17c')][_0x2516('0x10a')](db['CmContact'],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db[_0x2516('0x17c')][_0x2516('0x10a')](db[_0x2516('0x5e')],{});db[_0x2516('0x17c')]['belongsTo'](db[_0x2516('0x60')],{});db[_0x2516('0x17c')][_0x2516('0x10a')](db[_0x2516('0x11')],{});db[_0x2516('0x17c')][_0x2516('0x10a')](db[_0x2516('0x62')],{});db['ChatApplication'][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x17d'),'foreignKey':_0x2516('0xfe'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x66')][_0x2516('0x10a')](db['ChatQueue'],{'as':_0x2516('0x17e'),'foreignKey':_0x2516('0x17f'),'onDelete':'restrict'});db[_0x2516('0x66')][_0x2516('0x10a')](db[_0x2516('0x124')],{'as':_0x2516('0x180'),'foreignKey':_0x2516('0x179'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x66')][_0x2516('0x10a')](db[_0x2516('0x8f')],{'onDelete':_0x2516('0x15e'),'foreignKey':'TagId'});db[_0x2516('0x106')][_0x2516('0x100')](db[_0x2516('0x17b')],{'as':'Messages','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x181')});db['ChatInteraction'][_0x2516('0x10a')](db[_0x2516('0x124')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x179')});db['ChatInteraction'][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':_0x2516('0x15a'),'foreignKey':'ContactId'});db[_0x2516('0x106')][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x106')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x182'),'as':'Tags'});db[_0x2516('0x106')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x182'),'as':_0x2516('0x16a')});db[_0x2516('0x106')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':'Users','through':_0x2516('0x116'),'foreignKey':_0x2516('0x181')});db[_0x2516('0x17b')][_0x2516('0x10a')](db[_0x2516('0x11')],{'onDelete':_0x2516('0xfd'),'as':'User'});db[_0x2516('0x17b')][_0x2516('0x10a')](db[_0x2516('0x72')],{'onDelete':'cascade','as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db[_0x2516('0x17b')][_0x2516('0x10a')](db[_0x2516('0x106')],{'onDelete':_0x2516('0xfd'),'as':_0x2516('0x15b'),'foreignKey':_0x2516('0x181')});db[_0x2516('0x17b')][_0x2516('0x10a')](db['Attachment'],{'as':_0x2516('0xea'),'foreignKey':'AttachmentId'});db['ChatMessage']['belongsTo'](db[_0x2516('0x124')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x179')});db[_0x2516('0x69')][_0x2516('0x10a')](db[_0x2516('0x72')],{'onDelete':_0x2516('0xfd'),'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db[_0x2516('0x69')][_0x2516('0x10a')](db[_0x2516('0x124')],{'as':'Account','foreignKey':_0x2516('0x179')});db[_0x2516('0x6b')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':'UserChatQueue','hooks':!![]});db[_0x2516('0x6b')][_0x2516('0x10b')](db[_0x2516('0x113')],{'through':_0x2516('0x183'),'as':'Teams'});db['ChatGroup'][_0x2516('0x100')](db[_0x2516('0xce')],{'as':_0x2516('0x166'),'foreignKey':_0x2516('0x184'),'onDelete':'cascade'});db['ChatGroup'][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x134'),'through':_0x2516('0x10e')});db['ChatProactiveAction'][_0x2516('0x10a')](db['ChatWebsite'],{'as':_0x2516('0x180'),'foreignKey':_0x2516('0x179')});db[_0x2516('0x70')][_0x2516('0x100')](db[_0x2516('0x72')],{'as':_0x2516('0x10f'),'foreignKey':_0x2516('0x185')});db[_0x2516('0x72')][_0x2516('0x100')](db[_0x2516('0x74')],{'as':'Hoppers','foreignKey':_0x2516('0x153')});db[_0x2516('0x72')]['hasMany'](db[_0x2516('0x102')],{'as':'HopperFinals','foreignKey':'ContactId'});db['CmContact'][_0x2516('0x100')](db[_0x2516('0x78')],{'as':_0x2516('0x137'),'foreignKey':_0x2516('0x153')});db['CmContact'][_0x2516('0x100')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x2516('0x153')});db[_0x2516('0x72')]['hasMany'](db['JscriptySessionReport'],{'as':_0x2516('0x139'),'foreignKey':'ContactId'});db[_0x2516('0x72')]['hasMany'](db[_0x2516('0x5e')],{'as':_0x2516('0x105'),'foreignKey':_0x2516('0x153'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x72')][_0x2516('0x100')](db[_0x2516('0x106')],{'as':_0x2516('0x115'),'foreignKey':'ContactId','onDelete':_0x2516('0x15e')});db[_0x2516('0x72')][_0x2516('0x100')](db[_0x2516('0x57')],{'as':_0x2516('0x107'),'foreignKey':_0x2516('0x153'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x72')]['hasMany'](db[_0x2516('0x108')],{'as':_0x2516('0x117'),'foreignKey':_0x2516('0x153'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x72')][_0x2516('0x100')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x2516('0x153'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x72')][_0x2516('0x10a')](db[_0x2516('0x70')],{'as':'Company','foreignKey':_0x2516('0x185')});db[_0x2516('0x72')]['belongsTo'](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150'),'onDelete':_0x2516('0xfd')});db['CmContact'][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x157'),'through':_0x2516('0x110')});db['CmContact']['belongsToMany'](db[_0x2516('0x8f')],{'as':'Tags','through':_0x2516('0x186')});db[_0x2516('0x72')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':'cm_contact_has_tags','as':_0x2516('0x16a')});db['CmHopper'][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x74')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x74')]['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x17d'),'foreignKey':'UserId'});db[_0x2516('0x74')][_0x2516('0x10a')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x2516('0x135'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x74')]['belongsTo'](db[_0x2516('0xe7')],{'as':_0x2516('0xe7'),'foreignKey':_0x2516('0x187'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x74')][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':'OwnerId'});db[_0x2516('0x188')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153'),'onDelete':'cascade'});db[_0x2516('0x188')]['belongsTo'](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x188')][_0x2516('0x10a')](db['VoiceQueue'],{'as':_0x2516('0x17e'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x2516('0x188')][_0x2516('0x10a')](db[_0x2516('0xe7')],{'as':_0x2516('0xe7'),'foreignKey':_0x2516('0x187'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x7e')][_0x2516('0x100')](db[_0x2516('0x84')],{'as':{'plural':'All','singular':_0x2516('0x189')},'foreignKey':_0x2516('0x18a'),'onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db[_0x2516('0x84')],{'as':{'plural':_0x2516('0x18b'),'singular':_0x2516('0x18c')},'foreignKey':_0x2516('0x18d'),'onDelete':_0x2516('0xfd'),'hooks':!![]});db[_0x2516('0x7e')][_0x2516('0x100')](db['Action'],{'as':'Actions','foreignKey':_0x2516('0x18e'),'onDelete':_0x2516('0xfd'),'hooks':!![]});db['Interval'][_0x2516('0x100')](db[_0x2516('0x86')],{'as':'Intervals','foreignKey':_0x2516('0x13d'),'onDelete':_0x2516('0xfd'),'hooks':!![],'required':![]});db[_0x2516('0x86')]['hasMany'](db[_0x2516('0x15')],{'as':_0x2516('0x18f'),'foreignKey':_0x2516('0x13d'),'onDelete':'restrict'});db[_0x2516('0x86')][_0x2516('0x100')](db[_0x2516('0x46')],{'as':_0x2516('0x190'),'foreignKey':_0x2516('0x13d')});db[_0x2516('0x86')][_0x2516('0x100')](db[_0x2516('0x66')],{'as':_0x2516('0x191'),'foreignKey':'IntervalId'});db['Interval'][_0x2516('0x100')](db[_0x2516('0x4e')],{'as':'FaxApplications','foreignKey':_0x2516('0x13d')});db[_0x2516('0x86')][_0x2516('0x100')](db[_0x2516('0x170')],{'as':_0x2516('0x192'),'foreignKey':'IntervalId'});db[_0x2516('0x8b')][_0x2516('0x10a')](db['MailAccount'],{});db[_0x2516('0x8b')][_0x2516('0x10a')](db[_0x2516('0x99')],{'foreignKey':_0x2516('0x193')});db[_0x2516('0x8b')][_0x2516('0x10a')](db[_0x2516('0x194')],{'foreignKey':_0x2516('0x195')});db[_0x2516('0x8d')][_0x2516('0x10b')](db['VoiceMusicOnHold'],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0x2516('0x15e')});db[_0x2516('0x8f')][_0x2516('0x10b')](db[_0x2516('0x72')],{'through':_0x2516('0x186')});db[_0x2516('0x8f')][_0x2516('0x10b')](db['ChatInteraction'],{'through':_0x2516('0x182')});db['Tag']['belongsToMany'](db[_0x2516('0x42')],{'through':_0x2516('0x155')});db['Tag'][_0x2516('0x10b')](db[_0x2516('0x57')],{'through':_0x2516('0x172')});db['Tag']['belongsToMany'](db[_0x2516('0x108')],{'through':_0x2516('0x169')});db[_0x2516('0x8f')][_0x2516('0x10b')](db[_0x2516('0x5e')],{'through':'openchannel_interaction_has_tags'});db[_0x2516('0x196')][_0x2516('0x100')](db[_0x2516('0x84')],{'as':{'plural':_0x2516('0x197'),'singular':_0x2516('0x198')},'foreignKey':_0x2516('0x199'),'onDelete':_0x2516('0xfd'),'hooks':!![]});db[_0x2516('0x196')][_0x2516('0x100')](db['Condition'],{'as':{'plural':_0x2516('0x19a'),'singular':_0x2516('0x19b')},'foreignKey':_0x2516('0x19c'),'onDelete':_0x2516('0xfd'),'hooks':!![]});db[_0x2516('0x196')][_0x2516('0x100')](db[_0x2516('0x7c')],{'as':'Actions','foreignKey':_0x2516('0x19d'),'onDelete':_0x2516('0xfd'),'hooks':!![]});db[_0x2516('0x194')]['hasMany'](db[_0x2516('0x19e')],{'as':_0x2516('0x19f'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x195'),'hooks':!![]});db[_0x2516('0x99')][_0x2516('0x100')](db[_0x2516('0x19e')],{'as':_0x2516('0x19f'),'onDelete':'cascade','foreignKey':_0x2516('0x193')});db['AnalyticMetric'][_0x2516('0x100')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x2516('0xfd'),'foreignKey':'MetricId'});db[_0x2516('0x19e')][_0x2516('0x10a')](db[_0x2516('0x9c')],{'foreignKey':_0x2516('0x1a0')});db[_0x2516('0xa0')][_0x2516('0x100')](db[_0x2516('0xa2')],{'as':_0x2516('0x1a1'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0xa2')][_0x2516('0x100')](db[_0x2516('0xa4')],{'as':_0x2516('0x1a3'),'onDelete':_0x2516('0xfd'),'foreignKey':'SubjectId'});db[_0x2516('0xa2')][_0x2516('0x100')](db[_0x2516('0xa4')],{'as':'Descriptions','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a4')});db['SalesforceConfiguration'][_0x2516('0x100')](db['SalesforceField'],{'as':_0x2516('0x19f'),'onDelete':_0x2516('0xfd'),'foreignKey':'FieldId'});db[_0x2516('0xa2')]['belongsTo'](db[_0x2516('0xa0')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db['SalesforceField'][_0x2516('0x100')](db[_0x2516('0xa4')],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0xa4')]['hasMany'](db['SalesforceField'],{'as':'Description','foreignKey':_0x2516('0x1a4')});db['SalesforceField'][_0x2516('0x100')](db['SalesforceField'],{'as':_0x2516('0x1a7'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0xa4')]['belongsTo'](db['Variable'],{'as':_0x2516('0x92'),'foreignKey':'VariableId'});db[_0x2516('0xa5')][_0x2516('0x100')](db[_0x2516('0x1a9')],{'as':_0x2516('0x1a1'),'onDelete':'cascade','foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1a9')][_0x2516('0x100')](db['SugarcrmField'],{'as':_0x2516('0x1a3'),'onDelete':'cascade','foreignKey':_0x2516('0x1a6')});db[_0x2516('0x1a9')]['hasMany'](db[_0x2516('0x1aa')],{'as':'Descriptions','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0x1a9')][_0x2516('0x100')](db['SugarcrmField'],{'as':_0x2516('0x19f'),'onDelete':_0x2516('0xfd'),'foreignKey':'FieldId'});db[_0x2516('0x1a9')]['belongsTo'](db[_0x2516('0xa5')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1aa')][_0x2516('0x100')](db[_0x2516('0x1aa')],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0x1aa')][_0x2516('0x100')](db[_0x2516('0x1aa')],{'as':_0x2516('0x1ab'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0x1aa')][_0x2516('0x100')](db[_0x2516('0x1aa')],{'as':'Field','foreignKey':_0x2516('0x1a8')});db[_0x2516('0x1aa')]['belongsTo'](db[_0x2516('0x92')],{'as':_0x2516('0x92'),'foreignKey':_0x2516('0x1ac')});db[_0x2516('0xa9')][_0x2516('0x100')](db[_0x2516('0x1ad')],{'as':_0x2516('0x1a1'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db['DeskConfiguration'][_0x2516('0x100')](db[_0x2516('0xac')],{'as':_0x2516('0x1a3'),'onDelete':_0x2516('0xfd'),'foreignKey':'SubjectId'});db[_0x2516('0x1ad')][_0x2516('0x100')](db[_0x2516('0xac')],{'as':_0x2516('0x1ae'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0x1ad')][_0x2516('0x100')](db[_0x2516('0xac')],{'as':_0x2516('0x19f'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0x1ad')][_0x2516('0x10a')](db['DeskAccount'],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db['DeskConfiguration'][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x1af')});db[_0x2516('0xac')][_0x2516('0x100')](db[_0x2516('0xac')],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0xac')][_0x2516('0x100')](db[_0x2516('0xac')],{'as':'Description','foreignKey':_0x2516('0x1a4')});db[_0x2516('0xac')][_0x2516('0x100')](db[_0x2516('0xac')],{'as':_0x2516('0x1a7'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0xac')][_0x2516('0x10a')](db['Variable'],{'as':_0x2516('0x92'),'foreignKey':_0x2516('0x1ac')});db[_0x2516('0xae')][_0x2516('0x100')](db['ZohoConfiguration'],{'as':_0x2516('0x1a1'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1b0')][_0x2516('0x100')](db[_0x2516('0x1b1')],{'as':_0x2516('0x1a3'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0x1b0')][_0x2516('0x100')](db[_0x2516('0x1b1')],{'as':'Descriptions','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0x1b0')][_0x2516('0x100')](db[_0x2516('0x1b1')],{'as':_0x2516('0x19f'),'onDelete':'cascade','foreignKey':_0x2516('0x1a8')});db[_0x2516('0x1b0')]['belongsTo'](db[_0x2516('0xae')],{'as':'Account','foreignKey':'AccountId'});db['ZohoField'][_0x2516('0x100')](db['ZohoField'],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0x1b1')][_0x2516('0x100')](db['ZohoField'],{'as':_0x2516('0x1ab'),'foreignKey':'DescriptionId'});db[_0x2516('0x1b1')][_0x2516('0x100')](db['ZohoField'],{'as':_0x2516('0x1a7'),'foreignKey':'FieldId'});db[_0x2516('0x1b1')][_0x2516('0x10a')](db[_0x2516('0x92')],{'as':_0x2516('0x92'),'foreignKey':_0x2516('0x1ac')});db[_0x2516('0xb2')][_0x2516('0x100')](db[_0x2516('0x1b2')],{'as':_0x2516('0x1a1'),'onDelete':'cascade','foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1b2')][_0x2516('0x100')](db[_0x2516('0xb4')],{'as':_0x2516('0x1a3'),'foreignKey':_0x2516('0x1a6')});db['ZendeskConfiguration']['hasMany'](db[_0x2516('0xb4')],{'as':_0x2516('0x1ae'),'foreignKey':'DescriptionId'});db[_0x2516('0x1b2')][_0x2516('0x100')](db[_0x2516('0xb4')],{'as':_0x2516('0x19f'),'foreignKey':'FieldId'});db[_0x2516('0x1b2')][_0x2516('0x10a')](db[_0x2516('0xb2')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1b2')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x1b3')});db['ZendeskField'][_0x2516('0x100')](db['ZendeskField'],{'as':_0x2516('0x1a5'),'foreignKey':'SubjectId'});db[_0x2516('0xb4')][_0x2516('0x100')](db[_0x2516('0xb4')],{'as':'Description','foreignKey':_0x2516('0x1a4')});db[_0x2516('0xb4')][_0x2516('0x100')](db[_0x2516('0xb4')],{'as':_0x2516('0x1a7'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0xb4')][_0x2516('0x10a')](db[_0x2516('0x92')],{'as':_0x2516('0x92'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x2516('0x100')](db[_0x2516('0xb8')],{'as':_0x2516('0x1a1'),'onDelete':'cascade','foreignKey':_0x2516('0x1a2')});db['FreshdeskConfiguration']['hasMany'](db[_0x2516('0x1b4')],{'as':_0x2516('0x1a3'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0xb8')]['hasMany'](db[_0x2516('0x1b4')],{'as':_0x2516('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x2516('0xb8')][_0x2516('0x100')](db[_0x2516('0x1b4')],{'as':_0x2516('0x19f'),'onDelete':'cascade','foreignKey':_0x2516('0x1a8')});db[_0x2516('0xb8')][_0x2516('0x10a')](db[_0x2516('0xb6')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0xb8')][_0x2516('0x10b')](db['Tag'],{'through':_0x2516('0x1b5')});db['FreshdeskField'][_0x2516('0x100')](db[_0x2516('0x1b4')],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0x1b4')][_0x2516('0x100')](db[_0x2516('0x1b4')],{'as':_0x2516('0x1ab'),'foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db[_0x2516('0x1b4')],{'as':'Field','foreignKey':_0x2516('0x1a8')});db[_0x2516('0x1b4')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x2516('0x1ac')});db[_0x2516('0xba')]['hasMany'](db[_0x2516('0xbc')],{'as':'Configurations','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db['VtigerConfiguration'][_0x2516('0x100')](db[_0x2516('0xbe')],{'as':_0x2516('0x1a3'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0xbc')]['hasMany'](db['VtigerField'],{'as':_0x2516('0x1ae'),'foreignKey':'DescriptionId'});db[_0x2516('0xbc')][_0x2516('0x100')](db['VtigerField'],{'as':'Fields','foreignKey':_0x2516('0x1a8')});db['VtigerConfiguration']['belongsTo'](db['VtigerAccount'],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0xbc')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':'int_vtiger_configuration_has_tags'});db[_0x2516('0xbe')][_0x2516('0x100')](db[_0x2516('0xbe')],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db['VtigerField']['hasMany'](db[_0x2516('0xbe')],{'as':_0x2516('0x1ab'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0xbe')][_0x2516('0x100')](db[_0x2516('0xbe')],{'as':_0x2516('0x1a7'),'foreignKey':'FieldId'});db[_0x2516('0xbe')][_0x2516('0x10a')](db[_0x2516('0x92')],{'as':'Variable','foreignKey':_0x2516('0x1ac')});db['ServicenowAccount'][_0x2516('0x100')](db[_0x2516('0x1b6')],{'as':'Configurations','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1b6')][_0x2516('0x100')](db['ServicenowField'],{'as':_0x2516('0x1a3'),'foreignKey':'SubjectId'});db[_0x2516('0x1b6')][_0x2516('0x100')](db['ServicenowField'],{'as':_0x2516('0x1ae'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0x1b6')]['hasMany'](db[_0x2516('0xc3')],{'as':_0x2516('0x19f'),'foreignKey':'FieldId'});db[_0x2516('0x1b6')][_0x2516('0x10a')](db[_0x2516('0xc0')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0xc3')][_0x2516('0x100')](db['ServicenowField'],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db['ServicenowField'][_0x2516('0x100')](db['ServicenowField'],{'as':_0x2516('0x1ab'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0xc3')][_0x2516('0x100')](db['ServicenowField'],{'as':_0x2516('0x1a7'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0xc3')][_0x2516('0x10a')](db[_0x2516('0x92')],{'as':_0x2516('0x92'),'foreignKey':_0x2516('0x1ac')});db[_0x2516('0xc5')][_0x2516('0x100')](db['Dynamics365Configuration'],{'as':_0x2516('0x1a1'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db['Dynamics365Configuration']['hasMany'](db[_0x2516('0xc9')],{'as':_0x2516('0x1a3'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a6')});db['Dynamics365Configuration'][_0x2516('0x100')](db[_0x2516('0xc9')],{'as':_0x2516('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x2516('0xc7')]['hasMany'](db[_0x2516('0xc9')],{'as':_0x2516('0x19f'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0xc7')][_0x2516('0x10a')](db['Dynamics365Account'],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0xc9')]['hasMany'](db[_0x2516('0xc9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x2516('0xc9')]['hasMany'](db[_0x2516('0xc9')],{'as':_0x2516('0x1ab'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0xc9')][_0x2516('0x100')](db[_0x2516('0xc9')],{'as':_0x2516('0x1a7'),'foreignKey':'FieldId'});db[_0x2516('0xc9')][_0x2516('0x10a')](db[_0x2516('0x92')],{'as':_0x2516('0x92'),'foreignKey':_0x2516('0x1ac')});db[_0x2516('0xcc')][_0x2516('0x10a')](db[_0x2516('0x124')],{});db[_0x2516('0xcc')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db[_0x2516('0xcc')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db['ChatQueueReport'][_0x2516('0x10a')](db[_0x2516('0x106')],{});db[_0x2516('0xcc')][_0x2516('0x10a')](db['ChatMessage'],{});db[_0x2516('0xcc')][_0x2516('0x10a')](db['User'],{});db[_0x2516('0xcc')][_0x2516('0x10a')](db[_0x2516('0x6b')],{});db[_0x2516('0xce')]['belongsTo'](db[_0x2516('0x11')],{'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1b7')});db[_0x2516('0xce')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':_0x2516('0x1b8')});db[_0x2516('0xd4')]['hasMany'](db[_0x2516('0xd2')],{'foreignKey':_0x2516('0x1b9'),'onDelete':_0x2516('0xfd')});db[_0x2516('0xd4')]['hasMany'](db[_0x2516('0xd0')],{'foreignKey':'SessionId','onDelete':_0x2516('0xfd')});db[_0x2516('0xd6')]['belongsTo'](db[_0x2516('0x12b')],{});db[_0x2516('0xd6')][_0x2516('0x10a')](db['CmList'],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db['SmsQueueReport'][_0x2516('0x10a')](db['CmContact'],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db['SmsQueueReport']['belongsTo'](db[_0x2516('0x57')],{});db[_0x2516('0xd6')][_0x2516('0x10a')](db[_0x2516('0x58')],{});db[_0x2516('0xd6')][_0x2516('0x10a')](db[_0x2516('0x11')],{});db[_0x2516('0xd6')][_0x2516('0x10a')](db[_0x2516('0x120')],{});db[_0x2516('0xda')][_0x2516('0x100')](db['JscriptySessionReport'],{'foreignKey':_0x2516('0x1ba')});db['JscriptyProject']['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x2516('0x1ba')});db[_0x2516('0xda')][_0x2516('0x100')](db[_0x2516('0xd0')],{'foreignKey':_0x2516('0x1ba')});db[_0x2516('0x1bb')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':'Users','through':_0x2516('0x12e')});db[_0x2516('0x113')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x2516('0x114')});db[_0x2516('0x113')]['belongsToMany'](db[_0x2516('0x19')],{'through':'team_has_voice_queues','as':_0x2516('0x1bc')});db[_0x2516('0x113')][_0x2516('0x10b')](db[_0x2516('0x3f')],{'through':'team_has_mail_queues','as':_0x2516('0x11c')});db['Team']['belongsToMany'](db['ChatQueue'],{'through':_0x2516('0x183'),'as':'ChatQueues'});db[_0x2516('0x113')][_0x2516('0x10b')](db[_0x2516('0x167')],{'through':_0x2516('0x16c'),'as':_0x2516('0x11f')});db['Team'][_0x2516('0x10b')](db[_0x2516('0x120')],{'through':'team_has_sms_queues','as':_0x2516('0x121')});db[_0x2516('0x113')]['belongsToMany'](db[_0x2516('0x62')],{'through':_0x2516('0x178'),'as':'OpenchannelQueues'});db['Campaign'][_0x2516('0x100')](db[_0x2516('0x74')],{'as':_0x2516('0x136'),'foreignKey':_0x2516('0x187')});db[_0x2516('0xe7')][_0x2516('0x100')](db[_0x2516('0x102')],{'as':'HopperFinals','foreignKey':_0x2516('0x187')});db[_0x2516('0xe7')][_0x2516('0x100')](db[_0x2516('0x78')],{'as':_0x2516('0x137'),'foreignKey':_0x2516('0x187')});db[_0x2516('0xe7')][_0x2516('0x100')](db[_0x2516('0x188')],{'as':_0x2516('0x138'),'foreignKey':'CampaignId'});db['Campaign'][_0x2516('0x10a')](db[_0x2516('0x2a')],{'as':_0x2516('0x2a'),'foreignKey':_0x2516('0x13a')});db['Campaign'][_0x2516('0x10a')](db[_0x2516('0x2a')],{'as':_0x2516('0x13b'),'foreignKey':_0x2516('0x13c')});db[_0x2516('0xe7')]['belongsTo'](db['Interval'],{'as':_0x2516('0x86'),'foreignKey':'IntervalId'});db[_0x2516('0xe7')][_0x2516('0x10a')](db['SquareProject'],{'as':'SquareProject','foreignKey':_0x2516('0x1bd')});db['Campaign'][_0x2516('0x10b')](db[_0x2516('0xf5')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x2516('0xe7')][_0x2516('0x10b')](db[_0x2516('0xf5')],{'as':_0x2516('0x144'),'through':_0x2516('0x1be')});db[_0x2516('0xec')]['belongsTo'](db[_0x2516('0x44')],{});db[_0x2516('0xec')][_0x2516('0x10a')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0x2516('0x3d')],{'foreignKey':_0x2516('0x1bf'),'as':_0x2516('0x1c0')});db['MailTransferReport'][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c1'),'as':_0x2516('0x1c2')});db[_0x2516('0xec')][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c3'),'as':_0x2516('0x1c4')});db[_0x2516('0xec')][_0x2516('0x10a')](db[_0x2516('0x3f')],{'foreignKey':_0x2516('0x1c5'),'as':_0x2516('0x1c6')});db[_0x2516('0xec')]['belongsTo'](db[_0x2516('0x3d')],{'foreignKey':_0x2516('0x1c7'),'as':_0x2516('0x1c8')});db[_0x2516('0xed')][_0x2516('0x10a')](db[_0x2516('0x17b')],{});db[_0x2516('0xed')][_0x2516('0x10a')](db['ChatInteraction'],{});db['ChatTransferReport'][_0x2516('0x10a')](db[_0x2516('0x124')],{'foreignKey':_0x2516('0x1c9'),'as':_0x2516('0x1c0')});db[_0x2516('0xed')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x2516('0xed')][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c3'),'as':_0x2516('0x1c4')});db[_0x2516('0xed')][_0x2516('0x10a')](db[_0x2516('0x6b')],{'foreignKey':_0x2516('0x1ca'),'as':'ToQueue'});db['ChatTransferReport'][_0x2516('0x10a')](db[_0x2516('0x124')],{'foreignKey':_0x2516('0x1cb'),'as':_0x2516('0x1c8')});db[_0x2516('0xef')][_0x2516('0x10a')](db[_0x2516('0x51')],{});db[_0x2516('0xef')][_0x2516('0x10a')](db[_0x2516('0x108')],{});db['FaxTransferReport'][_0x2516('0x10a')](db[_0x2516('0x4c')],{'foreignKey':_0x2516('0x1cc'),'as':_0x2516('0x1c0')});db[_0x2516('0xef')][_0x2516('0x10a')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x2516('0xef')]['belongsTo'](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c3'),'as':_0x2516('0x1c4')});db['FaxTransferReport'][_0x2516('0x10a')](db[_0x2516('0x167')],{'foreignKey':_0x2516('0x1cd'),'as':_0x2516('0x1c6')});db[_0x2516('0xef')][_0x2516('0x10a')](db[_0x2516('0x4c')],{'foreignKey':_0x2516('0x1ce'),'as':'ToAccount'});db[_0x2516('0xf1')][_0x2516('0x10a')](db['OpenchannelMessage'],{});db[_0x2516('0xf1')][_0x2516('0x10a')](db[_0x2516('0x5e')],{});db[_0x2516('0xf1')][_0x2516('0x10a')](db[_0x2516('0x5b')],{'foreignKey':_0x2516('0x1cf'),'as':_0x2516('0x1c0')});db[_0x2516('0xf1')]['belongsTo'](db['User'],{'foreignKey':_0x2516('0x1c1'),'as':_0x2516('0x1c2')});db[_0x2516('0xf1')][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':'ToUserId','as':_0x2516('0x1c4')});db[_0x2516('0xf1')][_0x2516('0x10a')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x2516('0xf1')][_0x2516('0x10a')](db[_0x2516('0x5b')],{'foreignKey':_0x2516('0x1d0'),'as':_0x2516('0x1c8')});db[_0x2516('0xf3')]['belongsTo'](db[_0x2516('0x58')],{});db[_0x2516('0xf3')][_0x2516('0x10a')](db[_0x2516('0x57')],{});db[_0x2516('0xf3')][_0x2516('0x10a')](db[_0x2516('0x12b')],{'foreignKey':'FromSmsAccountId','as':_0x2516('0x1c0')});db['SmsTransferReport'][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c1'),'as':_0x2516('0x1c2')});db[_0x2516('0xf3')][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c3'),'as':_0x2516('0x1c4')});db[_0x2516('0xf3')][_0x2516('0x10a')](db[_0x2516('0x120')],{'foreignKey':_0x2516('0x1d1'),'as':_0x2516('0x1c6')});db['SmsTransferReport']['belongsTo'](db[_0x2516('0x12b')],{'foreignKey':'ToSmsAccountId','as':_0x2516('0x1c8')});db[_0x2516('0xf5')][_0x2516('0x100')](db[_0x2516('0x82')],{'as':_0x2516('0x162'),'foreignKey':'ListId'});db['CmList'][_0x2516('0x100')](db[_0x2516('0x7a')],{'as':'CustomFields','foreignKey':_0x2516('0x150')});db[_0x2516('0xf5')][_0x2516('0x100')](db['CmContact'],{'as':_0x2516('0x10f'),'onDelete':'cascade','foreignKey':_0x2516('0x150')});db['CmList'][_0x2516('0x100')](db[_0x2516('0x102')],{'as':'HopperFinals','foreignKey':_0x2516('0x150')});db[_0x2516('0xf5')]['hasMany'](db[_0x2516('0x78')],{'as':_0x2516('0x104'),'foreignKey':'ListId'});db['CmList'][_0x2516('0x100')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x2516('0x150')});db['CmList'][_0x2516('0x10b')](db[_0x2516('0x19')],{'as':_0x2516('0x1d2'),'through':'voice_queues_has_cm_lists'});db[_0x2516('0xf5')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':'cm_user_has_lists'});db[_0x2516('0xf7')][_0x2516('0x100')](db[_0x2516('0x15')],{'as':_0x2516('0x18f'),'onDelete':_0x2516('0x15e')});db[_0x2516('0xf7')]['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x1d3')});db[_0x2516('0xf8')]['hasMany'](db[_0x2516('0x11')],{'as':_0x2516('0x157'),'foreignKey':'userProfileId'});db[_0x2516('0xf8')]['hasMany'](db[_0x2516('0xf9')],{'as':_0x2516('0x1d4'),'foreignKey':'userProfileId','onDelete':_0x2516('0xfd')});db[_0x2516('0xf9')][_0x2516('0x100')](db['UserProfileResource'],{'as':_0x2516('0x1d5'),'foreignKey':'sectionId','onDelete':_0x2516('0xfd')});module[_0x2516('0x1d6')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x6eed=['../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','hasOne','VoiceMail','cascade','UserId','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueue','MailQueues','UserMailQueue','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','FaxAccount','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','user_has_square_projects','SpiedAgents','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessionReport','JscriptySessions','Trunk','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','QueueCalls','AgentReports','uniqueid','ContactId','MailAccountId','Smtp','Dispositions','Answers','Messages','Interactions','List','ListId','TemplateId','mandatoryDispositionPauseId','Agents','MailInteractionId','Account','Contact','Owner','Tags','ThroughTags','Users','Attachment','Interaction','restrict','TagId','MailQueueReport','Items','FaxAccountId','Exntensions','FaxQueue','fax_interaction_has_tags','FaxInteractionId','AttachmentId','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','ChatApplication','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessage','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CmCompany','Contacts','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','Mohs','mail_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','AnalyticFieldReport','Fields','CustomReportId','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','Description','Field','FieldId','Variable','SugarcrmField','Subjects','VariableId','int_desk_configuration_has_tags','Subject','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','FreshdeskField','int_vtiger_configuration_has_tags','Dynamics365Configuration','FromId','ToId','SessionId','ProjectId','team_has_voice_queues','team_has_mail_queues','team_has_fax_queues','team_has_sms_queues','HopperBlacks','TrunkId','TrunkBackup','SquareProjectId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToQueue','ToMailAccountId','ToAccount','FromUserId','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','Queues','UserProfileSections','UserProfileSection','UserProfileResource','Resources','sectionId','exports','path','../config/environment','sequelize','lodash','jstz','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8_general_ci','motion2','name','database','username','options','sequelizeHistory','password','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Pause','../api/pause/pause.model','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport'];(function(_0x1ab224,_0x5909cb){var _0x122076=function(_0x597d4a){while(--_0x597d4a){_0x1ab224['push'](_0x1ab224['shift']());}};_0x122076(++_0x5909cb);}(_0x6eed,0xff));var _0xd6ee=function(_0x124298,_0x542004){_0x124298=_0x124298-0x0;var _0x35ac24=_0x6eed[_0x124298];return _0x35ac24;};'use strict';var path=require(_0xd6ee('0x0'));var config=require(_0xd6ee('0x1'));var Sequelize=require(_0xd6ee('0x2'));var _=require(_0xd6ee('0x3'));var jstz=require(_0xd6ee('0x4'));var timezone=jstz['determine']();config[_0xd6ee('0x2')]=_[_0xd6ee('0x5')](config['sequelize'],{'database':'motion2','username':_0xd6ee('0x6'),'password':_0xd6ee('0x7'),'options':{'host':_0xd6ee('0x8'),'port':0xcea,'dialect':_0xd6ee('0x9'),'dialectOptions':{'charset':_0xd6ee('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xd6ee('0xb')}}});config['sequelizeHistory']=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0xd6ee('0xc'),'username':_0xd6ee('0x6'),'password':'xC@LL1234','options':{'host':_0xd6ee('0x8'),'port':0xcea,'dialect':_0xd6ee('0x9'),'dialectOptions':{'charset':_0xd6ee('0xa')},'logging':![],'timezone':timezone[_0xd6ee('0xd')](),'define':{'charset':'utf8','collate':_0xd6ee('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd6ee('0x2')][_0xd6ee('0xe')],config[_0xd6ee('0x2')][_0xd6ee('0xf')],config[_0xd6ee('0x2')]['password'],config[_0xd6ee('0x2')][_0xd6ee('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xd6ee('0xe')],config[_0xd6ee('0x11')][_0xd6ee('0xf')],config[_0xd6ee('0x11')][_0xd6ee('0x12')],config[_0xd6ee('0x11')]['options'])};db[_0xd6ee('0x13')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/user/user.model');db[_0xd6ee('0x15')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x16'));db[_0xd6ee('0x17')]=db['sequelize'][_0xd6ee('0x14')]('../api/voiceContext/voiceContext.model');db[_0xd6ee('0x18')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x19'));db[_0xd6ee('0x1a')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xd6ee('0x1b')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x1c'));db[_0xd6ee('0x1d')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x1e'));db['VoiceMail']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x1f'));db[_0xd6ee('0x20')]=db[_0xd6ee('0x2')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0xd6ee('0x21')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x22'));db[_0xd6ee('0x23')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x24'));db[_0xd6ee('0x25')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x26'));db[_0xd6ee('0x27')]=db['sequelize']['import'](_0xd6ee('0x28'));db[_0xd6ee('0x29')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x2a'));db['Trunk']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x2b'));db['VoiceTransferReport']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x2c'));db['UserVoiceQueueRt']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x2d'));db[_0xd6ee('0x2e')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xd6ee('0x2f')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x30'));db['UserMailQueue']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x31'));db['UserFaxQueue']=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x32'));db[_0xd6ee('0x33')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x34'));db[_0xd6ee('0x35')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x36'));db[_0xd6ee('0x37')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x38'));db[_0xd6ee('0x39')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x3a'));db[_0xd6ee('0x3b')]=db['sequelize']['import']('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x3c'));db[_0xd6ee('0x3d')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x3e'));db['MailInteraction']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x3f'));db[_0xd6ee('0x40')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x41'));db[_0xd6ee('0x42')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize'][_0xd6ee('0x14')]('../api/mailQueueReport/mailQueueReport.model');db[_0xd6ee('0x43')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x44'));db[_0xd6ee('0x45')]=db['sequelize']['import']('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x46'));db[_0xd6ee('0x47')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x48'));db[_0xd6ee('0x49')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x4a'));db[_0xd6ee('0x4b')]=db['sequelize'][_0xd6ee('0x14')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x4c'));db[_0xd6ee('0x4d')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/smsAccount/smsAccount.model');db[_0xd6ee('0x4e')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x4f'));db[_0xd6ee('0x50')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x51'));db[_0xd6ee('0x52')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x53'));db[_0xd6ee('0x54')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x55'));db[_0xd6ee('0x56')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x57'));db[_0xd6ee('0x58')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x59'));db[_0xd6ee('0x5a')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x5b'));db[_0xd6ee('0x5c')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x5d'));db['OpenchannelQueue']=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x5e'));db[_0xd6ee('0x5f')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x60'));db[_0xd6ee('0x61')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x62'));db['ChatApplication']=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x63'));db[_0xd6ee('0x64')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/chatInteraction/chatInteraction.model');db[_0xd6ee('0x65')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x66'));db['ChatOfflineMessage']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x67'));db[_0xd6ee('0x68')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x69'));db[_0xd6ee('0x6a')]=db['sequelize'][_0xd6ee('0x14')]('../api/chatGroup/chatGroup.model');db[_0xd6ee('0x6b')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x6c'));db['CmCompany']=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x6d'));db['CmContact']=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x6e'));db[_0xd6ee('0x6f')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x70'));db[_0xd6ee('0x71')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x72'));db['CmHopperFinal']=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x73'));db[_0xd6ee('0x74')]=db['sequelize']['import'](_0xd6ee('0x75'));db[_0xd6ee('0x76')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x77'));db[_0xd6ee('0x78')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/cmCustomField/cmCustomField.model');db[_0xd6ee('0x79')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x7a'));db[_0xd6ee('0x7b')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x7c'));db[_0xd6ee('0x7d')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x7e'));db[_0xd6ee('0x7f')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x80'));db[_0xd6ee('0x81')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x82'));db['Interval']=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/interval/interval.model');db[_0xd6ee('0x83')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x84'));db[_0xd6ee('0x85')]=db['sequelize']['import']('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x86'));db[_0xd6ee('0x87')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x88'));db[_0xd6ee('0x89')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x8a'));db[_0xd6ee('0x8b')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x8c'));db[_0xd6ee('0x8d')]=db['sequelize']['import'](_0xd6ee('0x8e'));db['Trigger']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x8f'));db['Variable']=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x90'));db[_0xd6ee('0x91')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x92'));db[_0xd6ee('0x93')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x94'));db[_0xd6ee('0x95')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x96'));db[_0xd6ee('0x97')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x98'));db[_0xd6ee('0x99')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0x9a'));db[_0xd6ee('0x9b')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0x9c'));db[_0xd6ee('0x9d')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0x9e'));db[_0xd6ee('0x9f')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xd6ee('0xa0')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xa1'));db[_0xd6ee('0xa2')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xa3'));db[_0xd6ee('0xa4')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xa5'));db[_0xd6ee('0xa6')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0xa7'));db[_0xd6ee('0xa8')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xa9'));db[_0xd6ee('0xaa')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0xab'));db[_0xd6ee('0xac')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xad'));db[_0xd6ee('0xae')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xaf'));db[_0xd6ee('0xb0')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xd6ee('0xb1')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0xb2'));db[_0xd6ee('0xb3')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0xb4'));db['ZendeskConfiguration']=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xd6ee('0xb5')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0xb6'));db[_0xd6ee('0xb7')]=db[_0xd6ee('0x2')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xb8'));db['FreshdeskField']=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0xb9'));db[_0xd6ee('0xba')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0xbb'));db[_0xd6ee('0xbc')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xbd'));db[_0xd6ee('0xbe')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xbf'));db[_0xd6ee('0xc0')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0xc1'));db[_0xd6ee('0xc2')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0xc3'));db[_0xd6ee('0xc4')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0xc5'));db[_0xd6ee('0xc6')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0xc7'));db['Dynamics365Configuration']=db['sequelize']['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xd6ee('0xc8')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xc9'));db['Integration']=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/integration/integration.model');db['Network']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xca'));db[_0xd6ee('0xcb')]=db['sequelize']['import'](_0xd6ee('0xcc'));db['ChatInternalMessage']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xcd'));db[_0xd6ee('0xce')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0xcf'));db[_0xd6ee('0xd0')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0xd1'));db['JscriptySessionReport']=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0xd2'));db[_0xd6ee('0xd3')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0xd6ee('0xd4')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xd5'));db[_0xd6ee('0xd6')]=db['sequelize'][_0xd6ee('0x14')]('../api/squareReportDetail/squareReportDetail.model');db[_0xd6ee('0xd7')]=db['sequelize'][_0xd6ee('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0xd6ee('0xd8')]=db[_0xd6ee('0x2')]['import']('../api/setting/setting.model');db[_0xd6ee('0xd9')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0xda'));db[_0xd6ee('0xdb')]=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0xdc'));db[_0xd6ee('0xdd')]=db['sequelize']['import'](_0xd6ee('0xde'));db['SquareMessage']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xdf'));db[_0xd6ee('0xe0')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xe1'));db['License']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xe2'));db[_0xd6ee('0xe3')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xe4'));db['Migration']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xe5'));db['Attachment']=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/attachment/attachment.model');db[_0xd6ee('0xe6')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0xe7'));db[_0xd6ee('0xe8')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0xe9'));db[_0xd6ee('0xea')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xeb'));db[_0xd6ee('0xec')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')]('../api/faxTransferReport/faxTransferReport.model');db[_0xd6ee('0xed')]=db[_0xd6ee('0x2')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xd6ee('0xee')]=db['sequelize'][_0xd6ee('0x14')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xef'));db[_0xd6ee('0xf0')]=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xf1'));db[_0xd6ee('0xf2')]=db[_0xd6ee('0x2')]['import'](_0xd6ee('0xf3'));db['UserProfileSection']=db['sequelize'][_0xd6ee('0x14')](_0xd6ee('0xf4'));db['UserProfileResource']=db[_0xd6ee('0x2')][_0xd6ee('0x14')](_0xd6ee('0xf5'));db['User'][_0xd6ee('0xf6')](db[_0xd6ee('0xf7')],{'as':'VoiceMail','onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0xf9')});db['User'][_0xd6ee('0xfa')](db['VoiceRecording'],{'as':_0xd6ee('0xfb'),'foreignKey':_0xd6ee('0xf9')});db[_0xd6ee('0x13')][_0xd6ee('0xfa')](db[_0xd6ee('0xfc')],{'as':_0xd6ee('0xfd'),'foreignKey':_0xd6ee('0xf9')});db['User'][_0xd6ee('0xfa')](db[_0xd6ee('0x18')],{'as':_0xd6ee('0xfe'),'onDelete':_0xd6ee('0xf8'),'hooks':!![]});db[_0xd6ee('0x13')]['hasMany'](db[_0xd6ee('0xff')],{'as':_0xd6ee('0x100'),'foreignKey':_0xd6ee('0xf9')});db[_0xd6ee('0x13')]['hasMany'](db[_0xd6ee('0x74')],{'as':'HopperHistory','foreignKey':_0xd6ee('0xf9')});db['User']['hasMany'](db[_0xd6ee('0x76')],{'as':_0xd6ee('0x76'),'foreignKey':_0xd6ee('0xf9')});db[_0xd6ee('0x13')]['hasMany'](db[_0xd6ee('0x5a')],{'as':_0xd6ee('0x101'),'foreignKey':_0xd6ee('0xf9')});db[_0xd6ee('0x13')][_0xd6ee('0xfa')](db['ChatInteraction'],{'as':_0xd6ee('0x102'),'foreignKey':_0xd6ee('0xf9')});db[_0xd6ee('0x13')][_0xd6ee('0xfa')](db[_0xd6ee('0x50')],{'as':_0xd6ee('0x103'),'foreignKey':_0xd6ee('0xf9')});db[_0xd6ee('0x13')][_0xd6ee('0xfa')](db['FaxInteraction'],{'as':_0xd6ee('0x104'),'foreignKey':_0xd6ee('0xf9')});db[_0xd6ee('0x13')][_0xd6ee('0xfa')](db[_0xd6ee('0x105')],{'as':'MailInteractions','foreignKey':_0xd6ee('0xf9')});db['User'][_0xd6ee('0x106')](db[_0xd6ee('0xf2')],{'as':_0xd6ee('0xf2'),'foreignKey':_0xd6ee('0x107')});db['User'][_0xd6ee('0x108')](db[_0xd6ee('0x6a')],{'as':_0xd6ee('0x109'),'through':_0xd6ee('0x10a')});db['User'][_0xd6ee('0x108')](db[_0xd6ee('0x10b')],{'as':'Contacts','through':_0xd6ee('0x10c')});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db[_0xd6ee('0x10d')],{'as':_0xd6ee('0x10e'),'through':_0xd6ee('0x10f')});db[_0xd6ee('0x13')]['belongsToMany'](db['Team'],{'through':_0xd6ee('0x110')});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db[_0xd6ee('0x105')],{'as':_0xd6ee('0x111'),'through':_0xd6ee('0x112')});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db['ChatInteraction'],{'as':_0xd6ee('0x102'),'through':_0xd6ee('0x113')});db['User']['belongsToMany'](db[_0xd6ee('0x49')],{'as':'FaxInteractions','through':_0xd6ee('0x114')});db['User'][_0xd6ee('0x108')](db[_0xd6ee('0x50')],{'as':_0xd6ee('0x103'),'through':_0xd6ee('0x115')});db['User']['belongsToMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0xd6ee('0x116')});db[_0xd6ee('0x13')]['belongsToMany'](db[_0xd6ee('0x1b')],{'as':_0xd6ee('0x117'),'through':'UserVoiceQueue','required':![]});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db[_0xd6ee('0x118')],{'as':_0xd6ee('0x119'),'through':_0xd6ee('0x11a'),'required':![]});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db['ChatQueue'],{'as':_0xd6ee('0x11b'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db['FaxQueue'],{'as':_0xd6ee('0x11c'),'through':_0xd6ee('0x11d'),'required':![]});db['User'][_0xd6ee('0x108')](db['SmsQueue'],{'as':_0xd6ee('0x11e'),'through':_0xd6ee('0x33'),'required':![]});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db[_0xd6ee('0x11f')],{'as':_0xd6ee('0x120'),'through':_0xd6ee('0x35'),'required':![]});db['User']['belongsToMany'](db[_0xd6ee('0x10d')],{'through':_0xd6ee('0x10f')});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db[_0xd6ee('0xf0')],{'as':_0xd6ee('0x121'),'through':_0xd6ee('0x122'),'required':![]});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db[_0xd6ee('0x5f')],{'as':_0xd6ee('0x123'),'through':'user_has_chat_websites'});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db[_0xd6ee('0x124')],{'as':'FaxAccounts','through':_0xd6ee('0x125')});db['User']['belongsToMany'](db[_0xd6ee('0x3b')],{'as':_0xd6ee('0x126'),'through':_0xd6ee('0x127')});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db[_0xd6ee('0x56')],{'as':_0xd6ee('0x128'),'through':_0xd6ee('0x129')});db[_0xd6ee('0x13')]['belongsToMany'](db[_0xd6ee('0x12a')],{'as':_0xd6ee('0x12b'),'through':_0xd6ee('0x12c')});db[_0xd6ee('0x13')][_0xd6ee('0x108')](db['SquareProject'],{'as':'SquareProjects','through':_0xd6ee('0x12d')});db[_0xd6ee('0x15')][_0xd6ee('0xfa')](db['VoiceExtension'],{'as':_0xd6ee('0x12e'),'onDelete':_0xd6ee('0xf8'),'foreignKey':'ChanSpyId'});db[_0xd6ee('0x17')]['hasMany'](db['VoiceExtension'],{'onDelete':'cascade'});db[_0xd6ee('0x18')][_0xd6ee('0xfa')](db[_0xd6ee('0x18')],{'as':_0xd6ee('0x12f'),'onDelete':_0xd6ee('0xf8')});db['VoiceMusicOnHold'][_0xd6ee('0x108')](db[_0xd6ee('0x89')],{'as':_0xd6ee('0x130'),'through':_0xd6ee('0x131')});db['VoiceQueue']['hasMany'](db[_0xd6ee('0xfc')],{'as':_0xd6ee('0x132'),'foreignKey':_0xd6ee('0x133')});db[_0xd6ee('0x1b')][_0xd6ee('0xfa')](db[_0xd6ee('0x6f')],{'as':_0xd6ee('0x134'),'foreignKey':_0xd6ee('0x133')});db[_0xd6ee('0x1b')]['hasMany'](db[_0xd6ee('0xff')],{'as':_0xd6ee('0x100'),'foreignKey':_0xd6ee('0x133')});db[_0xd6ee('0x1b')][_0xd6ee('0xfa')](db[_0xd6ee('0x74')],{'as':_0xd6ee('0x135'),'foreignKey':'VoiceQueueId'});db[_0xd6ee('0x1b')][_0xd6ee('0xfa')](db['ReportAgentPreview'],{'as':_0xd6ee('0x76'),'foreignKey':_0xd6ee('0x133')});db[_0xd6ee('0x1b')][_0xd6ee('0xfa')](db[_0xd6ee('0x71')],{'as':'HopperBlacks','foreignKey':_0xd6ee('0x133')});db[_0xd6ee('0x1b')][_0xd6ee('0xfa')](db[_0xd6ee('0x136')],{'as':_0xd6ee('0x137'),'foreignKey':_0xd6ee('0x133')});db['VoiceQueue']['belongsTo'](db[_0xd6ee('0x138')],{'as':'Trunk','foreignKey':'TrunkId'});db['VoiceQueue']['belongsTo'](db[_0xd6ee('0x138')],{'as':'TrunkBackup','foreignKey':_0xd6ee('0x139')});db['VoiceQueue'][_0xd6ee('0x106')](db[_0xd6ee('0x13a')],{'as':_0xd6ee('0x13a'),'foreignKey':_0xd6ee('0x13b')});db[_0xd6ee('0x1b')][_0xd6ee('0x106')](db[_0xd6ee('0x83')],{'as':_0xd6ee('0x13c'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xd6ee('0x108')](db[_0xd6ee('0x10d')],{'as':'Lists','through':_0xd6ee('0x13d')});db[_0xd6ee('0x1b')]['belongsToMany'](db[_0xd6ee('0x13')],{'as':'Agents','through':_0xd6ee('0x2e')});db['VoiceQueue'][_0xd6ee('0x108')](db['Team'],{'as':_0xd6ee('0x13e'),'through':'team_has_voice_queues'});db[_0xd6ee('0x1b')][_0xd6ee('0x108')](db['CmList'],{'as':_0xd6ee('0x13f'),'through':_0xd6ee('0x140')});db[_0xd6ee('0x1d')][_0xd6ee('0x106')](db['User'],{'as':'User','foreignKey':'UserId'});db['ScreenRecording']['belongsTo'](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x13'),'foreignKey':'UserId'});db[_0xd6ee('0xf7')][_0xd6ee('0xfa')](db[_0xd6ee('0x20')],{'as':'Messages','onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x141'),'sourceKey':_0xd6ee('0x142')});db[_0xd6ee('0x20')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0xd6ee('0x141'),'targetKey':'mailbox'});db[_0xd6ee('0x21')][_0xd6ee('0xfa')](db[_0xd6ee('0x27')],{'as':_0xd6ee('0x143'),'foreignKey':'uniqueid','constraints':![]});db[_0xd6ee('0x21')][_0xd6ee('0xfa')](db['VoiceAgentReport'],{'as':_0xd6ee('0x144'),'foreignKey':_0xd6ee('0x145'),'constraints':![]});db[_0xd6ee('0x21')]['belongsTo'](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x13'),'foreignKey':'UserId'});db[_0xd6ee('0x21')][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'as':'Contact','foreignKey':_0xd6ee('0x146')});db[_0xd6ee('0x37')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xd6ee('0x147')});db[_0xd6ee('0x39')]['belongsTo'](db[_0xd6ee('0x3b')],{'as':_0xd6ee('0x3b'),'foreignKey':_0xd6ee('0x147')});db[_0xd6ee('0x3b')][_0xd6ee('0xf6')](db[_0xd6ee('0x37')],{'as':'Imap','onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x3b')][_0xd6ee('0xf6')](db[_0xd6ee('0x39')],{'as':_0xd6ee('0x148'),'onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x3b')][_0xd6ee('0xfa')](db[_0xd6ee('0x7f')],{'as':_0xd6ee('0x149'),'foreignKey':_0xd6ee('0x147')});db[_0xd6ee('0x3b')][_0xd6ee('0xfa')](db[_0xd6ee('0x7d')],{'as':_0xd6ee('0x14a'),'foreignKey':_0xd6ee('0x147')});db[_0xd6ee('0x3b')]['hasMany'](db['MailMessage'],{'as':_0xd6ee('0x14b'),'foreignKey':_0xd6ee('0x147')});db[_0xd6ee('0x3b')]['hasMany'](db[_0xd6ee('0x105')],{'as':_0xd6ee('0x14c')});db[_0xd6ee('0x3b')][_0xd6ee('0xfa')](db['MailApplication'],{'as':_0xd6ee('0x12f')});db[_0xd6ee('0x3b')][_0xd6ee('0x106')](db['CmList'],{'as':_0xd6ee('0x14d'),'foreignKey':_0xd6ee('0x14e')});db[_0xd6ee('0x3b')]['belongsTo'](db['Template'],{'as':'Template','foreignKey':_0xd6ee('0x14f')});db[_0xd6ee('0x3b')][_0xd6ee('0x106')](db[_0xd6ee('0x83')],{'as':_0xd6ee('0x13c'),'foreignKey':_0xd6ee('0x150')});db[_0xd6ee('0x3b')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x151'),'through':_0xd6ee('0x127')});db[_0xd6ee('0x118')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':'Agents','through':_0xd6ee('0x11a')});db[_0xd6ee('0x118')][_0xd6ee('0x108')](db[_0xd6ee('0xe0')],{'through':'team_has_mail_queues','as':_0xd6ee('0x13e')});db['MailInteraction'][_0xd6ee('0xfa')](db['MailMessage'],{'as':_0xd6ee('0x14b'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x152')});db['MailInteraction'][_0xd6ee('0x106')](db[_0xd6ee('0x3b')],{'as':_0xd6ee('0x153'),'foreignKey':_0xd6ee('0x147')});db['MailInteraction']['belongsTo'](db['CmContact'],{'as':_0xd6ee('0x154'),'foreignKey':_0xd6ee('0x146')});db['MailInteraction'][_0xd6ee('0x106')](db['User'],{'as':_0xd6ee('0x155'),'foreignKey':_0xd6ee('0xf9')});db[_0xd6ee('0x105')][_0xd6ee('0x108')](db[_0xd6ee('0x8b')],{'through':'mail_interaction_has_tags','as':_0xd6ee('0x156')});db[_0xd6ee('0x105')]['belongsToMany'](db[_0xd6ee('0x8b')],{'through':'mail_interaction_has_tags','as':_0xd6ee('0x157')});db[_0xd6ee('0x105')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x158'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0xd6ee('0x40')][_0xd6ee('0xfa')](db[_0xd6ee('0x159')],{'as':'Attachments','onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x40')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x13')});db[_0xd6ee('0x40')]['belongsTo'](db[_0xd6ee('0x10b')],{'onDelete':_0xd6ee('0xf8'),'as':_0xd6ee('0x154')});db['MailMessage'][_0xd6ee('0x106')](db[_0xd6ee('0x105')],{'as':_0xd6ee('0x15a'),'foreignKey':_0xd6ee('0x152')});db['MailMessage']['belongsTo'](db['MailAccount'],{'as':_0xd6ee('0x153'),'foreignKey':'MailAccountId'});db['MailApplication'][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'onDelete':_0xd6ee('0x15b')});db['MailApplication']['belongsTo'](db[_0xd6ee('0x118')],{'onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x42')][_0xd6ee('0x106')](db[_0xd6ee('0x3b')],{'onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x42')][_0xd6ee('0x106')](db[_0xd6ee('0x13a')],{'onDelete':_0xd6ee('0x15b'),'foreignKey':_0xd6ee('0x13b')});db[_0xd6ee('0x42')]['belongsTo'](db['Tag'],{'onDelete':_0xd6ee('0x15b'),'foreignKey':_0xd6ee('0x15c')});db['MailQueueReport'][_0xd6ee('0x106')](db['MailAccount'],{});db[_0xd6ee('0x15d')][_0xd6ee('0x106')](db[_0xd6ee('0x10d')],{'as':'List','foreignKey':_0xd6ee('0x14e')});db[_0xd6ee('0x15d')][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'as':_0xd6ee('0x154'),'foreignKey':_0xd6ee('0x146')});db[_0xd6ee('0x15d')]['belongsTo'](db[_0xd6ee('0x105')],{});db[_0xd6ee('0x15d')]['belongsTo'](db[_0xd6ee('0x40')],{});db[_0xd6ee('0x15d')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{});db[_0xd6ee('0x15d')]['belongsTo'](db[_0xd6ee('0x118')],{});db['Dashboard'][_0xd6ee('0xfa')](db[_0xd6ee('0x45')],{'as':_0xd6ee('0x15e'),'onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x124')][_0xd6ee('0xfa')](db[_0xd6ee('0x7f')],{'as':'Dispositions','foreignKey':_0xd6ee('0x15f')});db[_0xd6ee('0x124')]['hasMany'](db[_0xd6ee('0x7d')],{'as':_0xd6ee('0x14a'),'foreignKey':'FaxAccountId'});db[_0xd6ee('0x124')][_0xd6ee('0xfa')](db[_0xd6ee('0x49')],{'as':'Interactions'});db[_0xd6ee('0x124')][_0xd6ee('0xfa')](db[_0xd6ee('0x47')],{'as':_0xd6ee('0x12f')});db[_0xd6ee('0x124')][_0xd6ee('0xfa')](db[_0xd6ee('0x18')],{'as':_0xd6ee('0x160'),'onDelete':_0xd6ee('0xf8')});db['FaxAccount']['hasMany'](db[_0xd6ee('0x4b')],{'as':_0xd6ee('0x14b')});db[_0xd6ee('0x124')][_0xd6ee('0x106')](db[_0xd6ee('0x138')],{'as':'Trunk'});db[_0xd6ee('0x124')][_0xd6ee('0x106')](db[_0xd6ee('0x10d')],{'as':_0xd6ee('0x14d'),'foreignKey':'ListId'});db['FaxAccount'][_0xd6ee('0x106')](db[_0xd6ee('0x83')],{'as':_0xd6ee('0x13c'),'foreignKey':_0xd6ee('0x150')});db[_0xd6ee('0x124')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x151'),'through':'user_has_fax_accounts'});db[_0xd6ee('0x47')][_0xd6ee('0x106')](db['User'],{'onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x47')][_0xd6ee('0x106')](db[_0xd6ee('0x161')],{'onDelete':_0xd6ee('0x15b')});db['FaxApplication'][_0xd6ee('0x106')](db[_0xd6ee('0x124')],{'onDelete':_0xd6ee('0x15b')});db['FaxApplication']['belongsTo'](db[_0xd6ee('0x8b')],{'onDelete':_0xd6ee('0x15b'),'foreignKey':_0xd6ee('0x15c')});db[_0xd6ee('0x49')]['hasMany'](db['FaxMessage'],{'as':_0xd6ee('0x14b'),'onDelete':_0xd6ee('0xf8'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0xd6ee('0x106')](db[_0xd6ee('0x124')],{'as':_0xd6ee('0x153'),'foreignKey':'FaxAccountId'});db[_0xd6ee('0x49')][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'as':'Contact','foreignKey':_0xd6ee('0x146')});db[_0xd6ee('0x49')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x155'),'foreignKey':_0xd6ee('0xf9')});db[_0xd6ee('0x49')][_0xd6ee('0x108')](db[_0xd6ee('0x8b')],{'through':_0xd6ee('0x162'),'as':'Tags'});db[_0xd6ee('0x49')][_0xd6ee('0x108')](db['Tag'],{'through':_0xd6ee('0x162'),'as':_0xd6ee('0x157')});db[_0xd6ee('0x49')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x158'),'through':_0xd6ee('0x114'),'foreignKey':_0xd6ee('0x163')});db[_0xd6ee('0x4b')][_0xd6ee('0x106')](db['User'],{'onDelete':'cascade','as':_0xd6ee('0x13')});db[_0xd6ee('0x4b')][_0xd6ee('0x106')](db[_0xd6ee('0x49')],{'as':'Interaction','foreignKey':_0xd6ee('0x163')});db['FaxMessage']['belongsTo'](db[_0xd6ee('0x10b')],{'onDelete':_0xd6ee('0xf8'),'as':_0xd6ee('0x154')});db['FaxMessage'][_0xd6ee('0x106')](db[_0xd6ee('0x159')],{'as':_0xd6ee('0x159'),'foreignKey':_0xd6ee('0x164')});db[_0xd6ee('0x4b')]['belongsTo'](db[_0xd6ee('0x124')],{'as':'Account','foreignKey':_0xd6ee('0x15f')});db[_0xd6ee('0x161')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':'Agents','through':'UserFaxQueue'});db[_0xd6ee('0x161')][_0xd6ee('0x108')](db[_0xd6ee('0xe0')],{'through':'team_has_fax_queues','as':_0xd6ee('0x13e')});db[_0xd6ee('0x4d')][_0xd6ee('0x106')](db[_0xd6ee('0x124')],{});db[_0xd6ee('0x4d')][_0xd6ee('0x106')](db[_0xd6ee('0x10d')],{'as':_0xd6ee('0x14d'),'foreignKey':'ListId'});db['FaxQueueReport'][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'as':_0xd6ee('0x154'),'foreignKey':_0xd6ee('0x146')});db[_0xd6ee('0x4d')]['belongsTo'](db[_0xd6ee('0x49')],{});db[_0xd6ee('0x4d')][_0xd6ee('0x106')](db['FaxMessage'],{});db[_0xd6ee('0x4d')]['belongsTo'](db[_0xd6ee('0x13')],{});db[_0xd6ee('0x4d')][_0xd6ee('0x106')](db[_0xd6ee('0x161')],{});db['SmsAccount'][_0xd6ee('0xfa')](db[_0xd6ee('0x7f')],{'as':_0xd6ee('0x149'),'foreignKey':'SmsAccountId'});db[_0xd6ee('0x12a')][_0xd6ee('0xfa')](db[_0xd6ee('0x7d')],{'as':'Answers','foreignKey':'SmsAccountId'});db['SmsAccount'][_0xd6ee('0xfa')](db['SmsMessage'],{'as':'Messages','foreignKey':_0xd6ee('0x165')});db[_0xd6ee('0x12a')]['hasMany'](db[_0xd6ee('0x50')],{'as':_0xd6ee('0x14c')});db['SmsAccount'][_0xd6ee('0xfa')](db[_0xd6ee('0x4e')],{'as':_0xd6ee('0x12f')});db[_0xd6ee('0x12a')][_0xd6ee('0x106')](db['CmList'],{'as':_0xd6ee('0x14d'),'foreignKey':'ListId'});db[_0xd6ee('0x12a')][_0xd6ee('0x106')](db['Pause'],{'as':_0xd6ee('0x13c'),'foreignKey':_0xd6ee('0x150')});db[_0xd6ee('0x12a')]['belongsToMany'](db[_0xd6ee('0x13')],{'as':'Agents','through':_0xd6ee('0x12c')});db[_0xd6ee('0x4e')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'onDelete':_0xd6ee('0x15b')});db['SmsApplication'][_0xd6ee('0x106')](db['SmsQueue'],{'onDelete':'restrict'});db[_0xd6ee('0x4e')][_0xd6ee('0x106')](db[_0xd6ee('0x12a')],{'onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x4e')]['belongsTo'](db[_0xd6ee('0x13a')],{'onDelete':_0xd6ee('0x15b'),'foreignKey':_0xd6ee('0x13b')});db[_0xd6ee('0x4e')][_0xd6ee('0x106')](db[_0xd6ee('0x8b')],{'onDelete':'restrict','foreignKey':_0xd6ee('0x15c')});db['SmsInteraction'][_0xd6ee('0xfa')](db['SmsMessage'],{'as':_0xd6ee('0x14b'),'onDelete':'cascade','foreignKey':_0xd6ee('0x166')});db[_0xd6ee('0x50')][_0xd6ee('0x106')](db['SmsAccount'],{'as':'Account','foreignKey':_0xd6ee('0x165')});db['SmsInteraction'][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'as':'Contact','foreignKey':_0xd6ee('0x146')});db[_0xd6ee('0x50')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x155'),'foreignKey':'UserId'});db[_0xd6ee('0x50')]['belongsToMany'](db[_0xd6ee('0x8b')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0xd6ee('0x50')][_0xd6ee('0x108')](db['Tag'],{'through':_0xd6ee('0x167'),'as':_0xd6ee('0x157')});db[_0xd6ee('0x50')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x158'),'through':_0xd6ee('0x115'),'foreignKey':_0xd6ee('0x166')});db[_0xd6ee('0x52')]['belongsTo'](db['User'],{'as':_0xd6ee('0x13')});db[_0xd6ee('0x52')][_0xd6ee('0x106')](db['CmContact'],{'onDelete':_0xd6ee('0xf8'),'as':_0xd6ee('0x154')});db['SmsMessage']['belongsTo'](db['SmsInteraction'],{'onDelete':'cascade','as':_0xd6ee('0x15a'),'foreignKey':_0xd6ee('0x166')});db[_0xd6ee('0x52')]['belongsTo'](db[_0xd6ee('0x12a')],{'as':_0xd6ee('0x153'),'foreignKey':_0xd6ee('0x165')});db[_0xd6ee('0x54')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x151'),'through':_0xd6ee('0x33'),'foreignKey':'SmsQueueId'});db[_0xd6ee('0x54')]['belongsToMany'](db[_0xd6ee('0xe0')],{'through':'team_has_sms_queues','as':_0xd6ee('0x13e')});db[_0xd6ee('0x56')][_0xd6ee('0xfa')](db[_0xd6ee('0x7f')],{'as':'Dispositions','foreignKey':_0xd6ee('0x168')});db['OpenchannelAccount'][_0xd6ee('0xfa')](db['CannedAnswer'],{'as':_0xd6ee('0x14a'),'foreignKey':_0xd6ee('0x168')});db[_0xd6ee('0x56')][_0xd6ee('0xfa')](db['OpenchannelInteraction'],{'as':_0xd6ee('0x14c'),'foreignKey':'OpenchannelAccountId'});db[_0xd6ee('0x56')][_0xd6ee('0xfa')](db[_0xd6ee('0x5c')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0xd6ee('0x56')][_0xd6ee('0xfa')](db[_0xd6ee('0x58')],{'as':'Applications','foreignKey':_0xd6ee('0x168')});db[_0xd6ee('0x56')][_0xd6ee('0x106')](db['CmList'],{'as':_0xd6ee('0x14d'),'foreignKey':_0xd6ee('0x14e')});db[_0xd6ee('0x56')]['belongsTo'](db[_0xd6ee('0x83')],{'as':_0xd6ee('0x13c'),'foreignKey':_0xd6ee('0x150')});db[_0xd6ee('0x56')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x151'),'through':_0xd6ee('0x129')});db['OpenchannelApplication'][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x58')][_0xd6ee('0x106')](db[_0xd6ee('0x11f')],{'onDelete':_0xd6ee('0x15b'),'foreignKey':_0xd6ee('0x169')});db['OpenchannelApplication'][_0xd6ee('0x106')](db[_0xd6ee('0x56')],{'onDelete':_0xd6ee('0x15b'),'foreignKey':_0xd6ee('0x168')});db['OpenchannelApplication'][_0xd6ee('0x106')](db['Interval'],{'onDelete':_0xd6ee('0x15b'),'foreignKey':_0xd6ee('0x13b')});db[_0xd6ee('0x58')][_0xd6ee('0x106')](db[_0xd6ee('0x8b')],{'onDelete':_0xd6ee('0x15b'),'foreignKey':_0xd6ee('0x15c')});db[_0xd6ee('0x5a')][_0xd6ee('0xfa')](db['OpenchannelMessage'],{'as':_0xd6ee('0x14b'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x16a')});db[_0xd6ee('0x5a')][_0xd6ee('0x106')](db[_0xd6ee('0x56')],{'as':_0xd6ee('0x153'),'foreignKey':_0xd6ee('0x168')});db[_0xd6ee('0x5a')][_0xd6ee('0x106')](db['CmContact'],{'as':_0xd6ee('0x154'),'foreignKey':_0xd6ee('0x146')});db['OpenchannelInteraction'][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x155'),'foreignKey':_0xd6ee('0xf9')});db[_0xd6ee('0x5a')]['belongsToMany'](db[_0xd6ee('0x8b')],{'through':_0xd6ee('0x16b'),'as':_0xd6ee('0x156')});db['OpenchannelInteraction'][_0xd6ee('0x108')](db[_0xd6ee('0x8b')],{'through':_0xd6ee('0x16b'),'as':_0xd6ee('0x157')});db[_0xd6ee('0x5a')]['belongsToMany'](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x158'),'through':_0xd6ee('0x116'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'onDelete':'cascade','as':_0xd6ee('0x13')});db[_0xd6ee('0x5c')]['belongsTo'](db['CmContact'],{'onDelete':_0xd6ee('0xf8'),'as':_0xd6ee('0x154')});db['OpenchannelMessage']['belongsTo'](db[_0xd6ee('0x5a')],{'onDelete':'cascade','as':_0xd6ee('0x15a'),'foreignKey':'OpenchannelInteractionId'});db[_0xd6ee('0x5c')][_0xd6ee('0x106')](db['Attachment'],{'as':'Attachment','foreignKey':_0xd6ee('0x164')});db[_0xd6ee('0x5c')]['belongsTo'](db[_0xd6ee('0x56')],{'as':_0xd6ee('0x153'),'foreignKey':_0xd6ee('0x168')});db[_0xd6ee('0x11f')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x151'),'through':_0xd6ee('0x35'),'foreignKey':_0xd6ee('0x169')});db[_0xd6ee('0x11f')][_0xd6ee('0x108')](db['Team'],{'through':_0xd6ee('0x16c'),'as':'Teams'});db['ChatWebsite']['hasMany'](db[_0xd6ee('0x7f')],{'as':_0xd6ee('0x149'),'foreignKey':'ChatWebsiteId'});db[_0xd6ee('0x5f')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xd6ee('0x16d')});db[_0xd6ee('0x5f')][_0xd6ee('0xfa')](db[_0xd6ee('0x6b')],{'as':_0xd6ee('0x16e')});db[_0xd6ee('0x5f')][_0xd6ee('0xfa')](db[_0xd6ee('0x64')],{'as':'Interactions'});db['ChatWebsite']['hasMany'](db['ChatApplication'],{'as':'Applications'});db['ChatWebsite']['hasMany'](db[_0xd6ee('0x65')],{'as':_0xd6ee('0x14b')});db['ChatWebsite'][_0xd6ee('0x106')](db[_0xd6ee('0x10d')],{'as':_0xd6ee('0x14d'),'foreignKey':'ListId'});db[_0xd6ee('0x5f')][_0xd6ee('0x106')](db[_0xd6ee('0x13a')],{'as':_0xd6ee('0x13a'),'foreignKey':_0xd6ee('0x13b')});db[_0xd6ee('0x5f')][_0xd6ee('0x106')](db[_0xd6ee('0x83')],{'as':_0xd6ee('0x13c'),'foreignKey':_0xd6ee('0x150')});db[_0xd6ee('0x5f')][_0xd6ee('0x108')](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db[_0xd6ee('0x61')][_0xd6ee('0x106')](db[_0xd6ee('0x56')],{});db[_0xd6ee('0x61')][_0xd6ee('0x106')](db['CmList'],{'as':'List','foreignKey':_0xd6ee('0x14e')});db[_0xd6ee('0x61')][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'as':'Contact','foreignKey':'ContactId'});db['OpenchannelQueueReport'][_0xd6ee('0x106')](db[_0xd6ee('0x5a')],{});db[_0xd6ee('0x61')][_0xd6ee('0x106')](db['OpenchannelMessage'],{});db[_0xd6ee('0x61')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{});db['OpenchannelQueueReport'][_0xd6ee('0x106')](db[_0xd6ee('0x11f')],{});db['ChatApplication']['belongsTo'](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x16f'),'foreignKey':_0xd6ee('0xf9'),'onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x170')]['belongsTo'](db[_0xd6ee('0x68')],{'as':_0xd6ee('0x171'),'foreignKey':'ChatQueueId','onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x170')]['belongsTo'](db[_0xd6ee('0x5f')],{'as':_0xd6ee('0x172'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0xd6ee('0x170')][_0xd6ee('0x106')](db[_0xd6ee('0x8b')],{'onDelete':_0xd6ee('0x15b'),'foreignKey':_0xd6ee('0x15c')});db[_0xd6ee('0x64')][_0xd6ee('0xfa')](db[_0xd6ee('0x65')],{'as':_0xd6ee('0x14b'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x173')});db['ChatInteraction'][_0xd6ee('0x106')](db[_0xd6ee('0x5f')],{'as':_0xd6ee('0x153'),'foreignKey':_0xd6ee('0x16d')});db[_0xd6ee('0x64')]['belongsTo'](db[_0xd6ee('0x10b')],{'as':_0xd6ee('0x154'),'foreignKey':_0xd6ee('0x146')});db[_0xd6ee('0x64')]['belongsTo'](db['User'],{'as':_0xd6ee('0x155'),'foreignKey':'UserId'});db['ChatInteraction'][_0xd6ee('0x108')](db[_0xd6ee('0x8b')],{'through':_0xd6ee('0x174'),'as':_0xd6ee('0x156')});db[_0xd6ee('0x64')]['belongsToMany'](db[_0xd6ee('0x8b')],{'through':_0xd6ee('0x174'),'as':_0xd6ee('0x157')});db[_0xd6ee('0x64')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x158'),'through':_0xd6ee('0x113'),'foreignKey':_0xd6ee('0x173')});db[_0xd6ee('0x65')][_0xd6ee('0x106')](db['User'],{'onDelete':'cascade','as':_0xd6ee('0x13')});db['ChatMessage'][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'onDelete':_0xd6ee('0xf8'),'as':'Contact','foreignKey':'ContactId'});db[_0xd6ee('0x65')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0xd6ee('0xf8'),'as':_0xd6ee('0x15a'),'foreignKey':_0xd6ee('0x173')});db[_0xd6ee('0x65')][_0xd6ee('0x106')](db[_0xd6ee('0x159')],{'as':_0xd6ee('0x159'),'foreignKey':_0xd6ee('0x164')});db[_0xd6ee('0x65')]['belongsTo'](db[_0xd6ee('0x5f')],{'as':_0xd6ee('0x153'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'onDelete':_0xd6ee('0xf8'),'as':_0xd6ee('0x154'),'foreignKey':_0xd6ee('0x146')});db[_0xd6ee('0x175')][_0xd6ee('0x106')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xd6ee('0x16d')});db[_0xd6ee('0x68')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':'Agents','through':_0xd6ee('0x2f'),'hooks':!![]});db[_0xd6ee('0x68')][_0xd6ee('0x108')](db[_0xd6ee('0xe0')],{'through':_0xd6ee('0x176'),'as':_0xd6ee('0x13e')});db[_0xd6ee('0x6a')][_0xd6ee('0xfa')](db[_0xd6ee('0x177')],{'as':_0xd6ee('0x14b'),'foreignKey':_0xd6ee('0x178'),'onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x6a')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x132'),'through':_0xd6ee('0x10a')});db[_0xd6ee('0x6b')][_0xd6ee('0x106')](db[_0xd6ee('0x5f')],{'as':_0xd6ee('0x172'),'foreignKey':'ChatWebsiteId'});db[_0xd6ee('0x179')][_0xd6ee('0xfa')](db['CmContact'],{'as':_0xd6ee('0x17a'),'foreignKey':_0xd6ee('0x17b')});db[_0xd6ee('0x10b')][_0xd6ee('0xfa')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xd6ee('0x146')});db['CmContact']['hasMany'](db[_0xd6ee('0xff')],{'as':'HopperFinals','foreignKey':_0xd6ee('0x146')});db['CmContact'][_0xd6ee('0xfa')](db[_0xd6ee('0x74')],{'as':'HopperHistories','foreignKey':_0xd6ee('0x146')});db[_0xd6ee('0x10b')][_0xd6ee('0xfa')](db[_0xd6ee('0x76')],{'as':_0xd6ee('0x76'),'foreignKey':_0xd6ee('0x146')});db[_0xd6ee('0x10b')][_0xd6ee('0xfa')](db[_0xd6ee('0x136')],{'as':_0xd6ee('0x137'),'foreignKey':_0xd6ee('0x146')});db['CmContact'][_0xd6ee('0xfa')](db['OpenchannelInteraction'],{'as':_0xd6ee('0x101'),'foreignKey':_0xd6ee('0x146'),'onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x10b')][_0xd6ee('0xfa')](db[_0xd6ee('0x64')],{'as':_0xd6ee('0x102'),'foreignKey':'ContactId','onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x10b')][_0xd6ee('0xfa')](db[_0xd6ee('0x50')],{'as':_0xd6ee('0x103'),'foreignKey':_0xd6ee('0x146'),'onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x10b')]['hasMany'](db[_0xd6ee('0x49')],{'as':'FaxInteractions','foreignKey':_0xd6ee('0x146'),'onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x10b')][_0xd6ee('0xfa')](db['MailInteraction'],{'as':_0xd6ee('0x111'),'foreignKey':_0xd6ee('0x146'),'onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x10b')][_0xd6ee('0x106')](db[_0xd6ee('0x179')],{'as':'Company','foreignKey':'CompanyId'});db[_0xd6ee('0x10b')][_0xd6ee('0x106')](db['CmList'],{'as':_0xd6ee('0x14d'),'foreignKey':_0xd6ee('0x14e'),'onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x10b')][_0xd6ee('0x108')](db['User'],{'as':_0xd6ee('0x158'),'through':_0xd6ee('0x10c')});db[_0xd6ee('0x10b')]['belongsToMany'](db[_0xd6ee('0x8b')],{'as':_0xd6ee('0x156'),'through':_0xd6ee('0x17c')});db[_0xd6ee('0x10b')][_0xd6ee('0x108')](db[_0xd6ee('0x8b')],{'through':_0xd6ee('0x17c'),'as':'ThroughTags'});db[_0xd6ee('0x6f')][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'as':'Contact','foreignKey':_0xd6ee('0x146'),'onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x6f')][_0xd6ee('0x106')](db[_0xd6ee('0x10d')],{'as':_0xd6ee('0x14d'),'foreignKey':_0xd6ee('0x14e'),'onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x6f')]['belongsTo'](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x16f'),'foreignKey':'UserId'});db[_0xd6ee('0x6f')][_0xd6ee('0x106')](db[_0xd6ee('0x1b')],{'as':'Queue','foreignKey':_0xd6ee('0x133'),'onDelete':'cascade'});db[_0xd6ee('0x6f')]['belongsTo'](db[_0xd6ee('0xe3')],{'as':_0xd6ee('0xe3'),'foreignKey':_0xd6ee('0x17d'),'onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x6f')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x155'),'foreignKey':_0xd6ee('0x17e')});db[_0xd6ee('0x71')][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'as':_0xd6ee('0x154'),'foreignKey':_0xd6ee('0x146'),'onDelete':_0xd6ee('0xf8')});db['CmHopperBlack']['belongsTo'](db['CmList'],{'as':_0xd6ee('0x14d'),'foreignKey':_0xd6ee('0x14e'),'onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x71')][_0xd6ee('0x106')](db[_0xd6ee('0x1b')],{'as':_0xd6ee('0x171'),'foreignKey':_0xd6ee('0x133'),'onDelete':'cascade'});db[_0xd6ee('0x71')][_0xd6ee('0x106')](db[_0xd6ee('0xe3')],{'as':_0xd6ee('0xe3'),'foreignKey':'CampaignId','onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x7b')]['hasMany'](db[_0xd6ee('0x81')],{'as':{'plural':'All','singular':_0xd6ee('0x17f')},'foreignKey':_0xd6ee('0x180'),'onDelete':_0xd6ee('0xf8'),'hooks':!![]});db['Automation'][_0xd6ee('0xfa')](db[_0xd6ee('0x81')],{'as':{'plural':_0xd6ee('0x181'),'singular':_0xd6ee('0x182')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xd6ee('0x7b')][_0xd6ee('0xfa')](db[_0xd6ee('0x79')],{'as':_0xd6ee('0x183'),'foreignKey':_0xd6ee('0x184'),'onDelete':'cascade','hooks':!![]});db[_0xd6ee('0x13a')][_0xd6ee('0xfa')](db[_0xd6ee('0x13a')],{'as':_0xd6ee('0x185'),'foreignKey':'IntervalId','onDelete':_0xd6ee('0xf8'),'hooks':!![],'required':![]});db[_0xd6ee('0x13a')][_0xd6ee('0xfa')](db[_0xd6ee('0x18')],{'as':_0xd6ee('0xfe'),'foreignKey':_0xd6ee('0x13b'),'onDelete':'restrict'});db[_0xd6ee('0x13a')][_0xd6ee('0xfa')](db[_0xd6ee('0x42')],{'as':_0xd6ee('0x186'),'foreignKey':_0xd6ee('0x13b')});db[_0xd6ee('0x13a')]['hasMany'](db[_0xd6ee('0x170')],{'as':_0xd6ee('0x187'),'foreignKey':_0xd6ee('0x13b')});db[_0xd6ee('0x13a')]['hasMany'](db[_0xd6ee('0x47')],{'as':'FaxApplications','foreignKey':_0xd6ee('0x13b')});db['Interval'][_0xd6ee('0xfa')](db[_0xd6ee('0x4e')],{'as':_0xd6ee('0x188'),'foreignKey':_0xd6ee('0x13b')});db[_0xd6ee('0x87')][_0xd6ee('0x106')](db[_0xd6ee('0x3b')],{});db['Schedule'][_0xd6ee('0x106')](db[_0xd6ee('0x97')],{'foreignKey':_0xd6ee('0x189')});db[_0xd6ee('0x87')]['belongsTo'](db[_0xd6ee('0x95')],{'foreignKey':'CustomReportId'});db[_0xd6ee('0x89')][_0xd6ee('0x108')](db['VoiceMusicOnHold'],{'as':_0xd6ee('0x18a'),'through':_0xd6ee('0x131'),'onDelete':_0xd6ee('0x15b')});db[_0xd6ee('0x8b')][_0xd6ee('0x108')](db[_0xd6ee('0x10b')],{'through':_0xd6ee('0x17c')});db[_0xd6ee('0x8b')][_0xd6ee('0x108')](db[_0xd6ee('0x64')],{'through':_0xd6ee('0x174')});db[_0xd6ee('0x8b')][_0xd6ee('0x108')](db[_0xd6ee('0x105')],{'through':_0xd6ee('0x18b')});db[_0xd6ee('0x8b')][_0xd6ee('0x108')](db[_0xd6ee('0x50')],{'through':_0xd6ee('0x167')});db[_0xd6ee('0x8b')]['belongsToMany'](db['FaxInteraction'],{'through':_0xd6ee('0x162')});db['Tag'][_0xd6ee('0x108')](db[_0xd6ee('0x5a')],{'through':_0xd6ee('0x16b')});db[_0xd6ee('0x18c')]['hasMany'](db[_0xd6ee('0x81')],{'as':{'plural':_0xd6ee('0x18d'),'singular':_0xd6ee('0x18e')},'foreignKey':_0xd6ee('0x18f'),'onDelete':_0xd6ee('0xf8'),'hooks':!![]});db[_0xd6ee('0x18c')]['hasMany'](db['Condition'],{'as':{'plural':_0xd6ee('0x190'),'singular':_0xd6ee('0x191')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0xd6ee('0x18c')]['hasMany'](db[_0xd6ee('0x79')],{'as':'Actions','foreignKey':_0xd6ee('0x192'),'onDelete':_0xd6ee('0xf8'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0xd6ee('0x193')],{'as':_0xd6ee('0x194'),'onDelete':'cascade','foreignKey':_0xd6ee('0x195'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0xd6ee('0x193')],{'as':_0xd6ee('0x194'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x189')});db[_0xd6ee('0x9b')]['hasMany'](db[_0xd6ee('0x193')],{'as':_0xd6ee('0x194'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x196')});db['AnalyticFieldReport']['belongsTo'](db[_0xd6ee('0x9b')],{'foreignKey':_0xd6ee('0x196')});db[_0xd6ee('0x9f')][_0xd6ee('0xfa')](db[_0xd6ee('0xa0')],{'as':_0xd6ee('0x197'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x198')});db[_0xd6ee('0xa0')][_0xd6ee('0xfa')](db['SalesforceField'],{'as':'Subjects','onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x199')});db[_0xd6ee('0xa0')][_0xd6ee('0xfa')](db['SalesforceField'],{'as':_0xd6ee('0x19a'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x19b')});db['SalesforceConfiguration'][_0xd6ee('0xfa')](db['SalesforceField'],{'as':'Fields','onDelete':_0xd6ee('0xf8'),'foreignKey':'FieldId'});db[_0xd6ee('0xa0')]['belongsTo'](db[_0xd6ee('0x9f')],{'as':_0xd6ee('0x153'),'foreignKey':_0xd6ee('0x198')});db[_0xd6ee('0xa2')][_0xd6ee('0xfa')](db['SalesforceField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xd6ee('0xa2')][_0xd6ee('0xfa')](db[_0xd6ee('0xa2')],{'as':_0xd6ee('0x19c'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0xd6ee('0xfa')](db[_0xd6ee('0xa2')],{'as':_0xd6ee('0x19d'),'foreignKey':_0xd6ee('0x19e')});db[_0xd6ee('0xa2')]['belongsTo'](db[_0xd6ee('0x19f')],{'as':_0xd6ee('0x19f'),'foreignKey':'VariableId'});db['SugarcrmAccount'][_0xd6ee('0xfa')](db[_0xd6ee('0xa6')],{'as':_0xd6ee('0x197'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x198')});db[_0xd6ee('0xa6')][_0xd6ee('0xfa')](db[_0xd6ee('0x1a0')],{'as':_0xd6ee('0x1a1'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x199')});db['SugarcrmConfiguration'][_0xd6ee('0xfa')](db[_0xd6ee('0x1a0')],{'as':_0xd6ee('0x19a'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xd6ee('0xa6')][_0xd6ee('0xfa')](db['SugarcrmField'],{'as':_0xd6ee('0x194'),'onDelete':_0xd6ee('0xf8'),'foreignKey':'FieldId'});db[_0xd6ee('0xa6')][_0xd6ee('0x106')](db[_0xd6ee('0xa4')],{'as':_0xd6ee('0x153'),'foreignKey':_0xd6ee('0x198')});db[_0xd6ee('0x1a0')]['hasMany'](db[_0xd6ee('0x1a0')],{'as':'Subject','foreignKey':_0xd6ee('0x199')});db[_0xd6ee('0x1a0')][_0xd6ee('0xfa')](db['SugarcrmField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0xd6ee('0x1a0')][_0xd6ee('0xfa')](db[_0xd6ee('0x1a0')],{'as':'Field','foreignKey':'FieldId'});db[_0xd6ee('0x1a0')][_0xd6ee('0x106')](db[_0xd6ee('0x19f')],{'as':_0xd6ee('0x19f'),'foreignKey':_0xd6ee('0x1a2')});db[_0xd6ee('0xa8')]['hasMany'](db[_0xd6ee('0xaa')],{'as':'Configurations','onDelete':_0xd6ee('0xf8'),'foreignKey':'AccountId'});db['DeskConfiguration']['hasMany'](db[_0xd6ee('0xac')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xd6ee('0x199')});db[_0xd6ee('0xaa')]['hasMany'](db[_0xd6ee('0xac')],{'as':'Descriptions','onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x19b')});db['DeskConfiguration'][_0xd6ee('0xfa')](db[_0xd6ee('0xac')],{'as':_0xd6ee('0x194'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x19e')});db[_0xd6ee('0xaa')][_0xd6ee('0x106')](db['DeskAccount'],{'as':_0xd6ee('0x153'),'foreignKey':_0xd6ee('0x198')});db[_0xd6ee('0xaa')]['belongsToMany'](db[_0xd6ee('0x8b')],{'through':_0xd6ee('0x1a3')});db['DeskField']['hasMany'](db[_0xd6ee('0xac')],{'as':'Subject','foreignKey':_0xd6ee('0x199')});db[_0xd6ee('0xac')][_0xd6ee('0xfa')](db[_0xd6ee('0xac')],{'as':_0xd6ee('0x19c'),'foreignKey':_0xd6ee('0x19b')});db[_0xd6ee('0xac')][_0xd6ee('0xfa')](db[_0xd6ee('0xac')],{'as':_0xd6ee('0x19d'),'foreignKey':_0xd6ee('0x19e')});db[_0xd6ee('0xac')][_0xd6ee('0x106')](db[_0xd6ee('0x19f')],{'as':_0xd6ee('0x19f'),'foreignKey':_0xd6ee('0x1a2')});db['ZohoAccount'][_0xd6ee('0xfa')](db['ZohoConfiguration'],{'as':_0xd6ee('0x197'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x198')});db[_0xd6ee('0xb0')]['hasMany'](db[_0xd6ee('0xb1')],{'as':'Subjects','onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x199')});db[_0xd6ee('0xb0')][_0xd6ee('0xfa')](db[_0xd6ee('0xb1')],{'as':'Descriptions','onDelete':_0xd6ee('0xf8'),'foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0xd6ee('0xfa')](db['ZohoField'],{'as':_0xd6ee('0x194'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x19e')});db[_0xd6ee('0xb0')][_0xd6ee('0x106')](db[_0xd6ee('0xae')],{'as':_0xd6ee('0x153'),'foreignKey':_0xd6ee('0x198')});db['ZohoField'][_0xd6ee('0xfa')](db[_0xd6ee('0xb1')],{'as':_0xd6ee('0x1a4'),'foreignKey':'SubjectId'});db[_0xd6ee('0xb1')][_0xd6ee('0xfa')](db[_0xd6ee('0xb1')],{'as':_0xd6ee('0x19c'),'foreignKey':_0xd6ee('0x19b')});db['ZohoField'][_0xd6ee('0xfa')](db[_0xd6ee('0xb1')],{'as':'Field','foreignKey':_0xd6ee('0x19e')});db[_0xd6ee('0xb1')]['belongsTo'](db[_0xd6ee('0x19f')],{'as':_0xd6ee('0x19f'),'foreignKey':_0xd6ee('0x1a2')});db['ZendeskAccount'][_0xd6ee('0xfa')](db['ZendeskConfiguration'],{'as':_0xd6ee('0x197'),'onDelete':'cascade','foreignKey':_0xd6ee('0x198')});db[_0xd6ee('0x1a5')][_0xd6ee('0xfa')](db[_0xd6ee('0xb5')],{'as':_0xd6ee('0x1a1'),'foreignKey':_0xd6ee('0x199')});db[_0xd6ee('0x1a5')][_0xd6ee('0xfa')](db[_0xd6ee('0xb5')],{'as':_0xd6ee('0x19a'),'foreignKey':_0xd6ee('0x19b')});db[_0xd6ee('0x1a5')][_0xd6ee('0xfa')](db[_0xd6ee('0xb5')],{'as':_0xd6ee('0x194'),'foreignKey':_0xd6ee('0x19e')});db['ZendeskConfiguration'][_0xd6ee('0x106')](db['ZendeskAccount'],{'as':_0xd6ee('0x153'),'foreignKey':_0xd6ee('0x198')});db['ZendeskConfiguration'][_0xd6ee('0x108')](db['Tag'],{'through':_0xd6ee('0x1a6')});db[_0xd6ee('0xb5')][_0xd6ee('0xfa')](db[_0xd6ee('0xb5')],{'as':_0xd6ee('0x1a4'),'foreignKey':_0xd6ee('0x199')});db[_0xd6ee('0xb5')][_0xd6ee('0xfa')](db[_0xd6ee('0xb5')],{'as':'Description','foreignKey':_0xd6ee('0x19b')});db[_0xd6ee('0xb5')]['hasMany'](db[_0xd6ee('0xb5')],{'as':_0xd6ee('0x19d'),'foreignKey':_0xd6ee('0x19e')});db[_0xd6ee('0xb5')]['belongsTo'](db[_0xd6ee('0x19f')],{'as':'Variable','foreignKey':_0xd6ee('0x1a2')});db[_0xd6ee('0xb7')][_0xd6ee('0xfa')](db[_0xd6ee('0x1a7')],{'as':_0xd6ee('0x197'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x198')});db[_0xd6ee('0x1a7')][_0xd6ee('0xfa')](db['FreshdeskField'],{'as':_0xd6ee('0x1a1'),'onDelete':_0xd6ee('0xf8'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0xd6ee('0xfa')](db[_0xd6ee('0x1a8')],{'as':_0xd6ee('0x19a'),'onDelete':'cascade','foreignKey':_0xd6ee('0x19b')});db[_0xd6ee('0x1a7')][_0xd6ee('0xfa')](db[_0xd6ee('0x1a8')],{'as':_0xd6ee('0x194'),'onDelete':'cascade','foreignKey':_0xd6ee('0x19e')});db[_0xd6ee('0x1a7')][_0xd6ee('0x106')](db[_0xd6ee('0xb7')],{'as':_0xd6ee('0x153'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xd6ee('0x108')](db[_0xd6ee('0x8b')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0xd6ee('0xfa')](db[_0xd6ee('0x1a8')],{'as':_0xd6ee('0x1a4'),'foreignKey':_0xd6ee('0x199')});db[_0xd6ee('0x1a8')][_0xd6ee('0xfa')](db[_0xd6ee('0x1a8')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xd6ee('0x1a8')]['hasMany'](db[_0xd6ee('0x1a8')],{'as':_0xd6ee('0x19d'),'foreignKey':'FieldId'});db[_0xd6ee('0x1a8')][_0xd6ee('0x106')](db[_0xd6ee('0x19f')],{'as':_0xd6ee('0x19f'),'foreignKey':'VariableId'});db[_0xd6ee('0xba')][_0xd6ee('0xfa')](db[_0xd6ee('0xbc')],{'as':_0xd6ee('0x197'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x198')});db[_0xd6ee('0xbc')]['hasMany'](db[_0xd6ee('0xbe')],{'as':_0xd6ee('0x1a1'),'foreignKey':_0xd6ee('0x199')});db[_0xd6ee('0xbc')][_0xd6ee('0xfa')](db['VtigerField'],{'as':_0xd6ee('0x19a'),'foreignKey':_0xd6ee('0x19b')});db[_0xd6ee('0xbc')][_0xd6ee('0xfa')](db[_0xd6ee('0xbe')],{'as':'Fields','foreignKey':_0xd6ee('0x19e')});db[_0xd6ee('0xbc')][_0xd6ee('0x106')](db['VtigerAccount'],{'as':'Account','foreignKey':_0xd6ee('0x198')});db['VtigerConfiguration'][_0xd6ee('0x108')](db[_0xd6ee('0x8b')],{'through':_0xd6ee('0x1a9')});db[_0xd6ee('0xbe')]['hasMany'](db[_0xd6ee('0xbe')],{'as':_0xd6ee('0x1a4'),'foreignKey':_0xd6ee('0x199')});db['VtigerField']['hasMany'](db[_0xd6ee('0xbe')],{'as':_0xd6ee('0x19c'),'foreignKey':_0xd6ee('0x19b')});db[_0xd6ee('0xbe')][_0xd6ee('0xfa')](db['VtigerField'],{'as':_0xd6ee('0x19d'),'foreignKey':'FieldId'});db[_0xd6ee('0xbe')][_0xd6ee('0x106')](db['Variable'],{'as':_0xd6ee('0x19f'),'foreignKey':_0xd6ee('0x1a2')});db['ServicenowAccount'][_0xd6ee('0xfa')](db['ServicenowConfiguration'],{'as':_0xd6ee('0x197'),'onDelete':_0xd6ee('0xf8'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0xd6ee('0xfa')](db[_0xd6ee('0xc4')],{'as':_0xd6ee('0x1a1'),'foreignKey':_0xd6ee('0x199')});db[_0xd6ee('0xc2')][_0xd6ee('0xfa')](db[_0xd6ee('0xc4')],{'as':_0xd6ee('0x19a'),'foreignKey':'DescriptionId'});db[_0xd6ee('0xc2')]['hasMany'](db[_0xd6ee('0xc4')],{'as':_0xd6ee('0x194'),'foreignKey':_0xd6ee('0x19e')});db[_0xd6ee('0xc2')][_0xd6ee('0x106')](db[_0xd6ee('0xc0')],{'as':_0xd6ee('0x153'),'foreignKey':_0xd6ee('0x198')});db[_0xd6ee('0xc4')]['hasMany'](db[_0xd6ee('0xc4')],{'as':_0xd6ee('0x1a4'),'foreignKey':_0xd6ee('0x199')});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':_0xd6ee('0x19c'),'foreignKey':'DescriptionId'});db[_0xd6ee('0xc4')]['hasMany'](db['ServicenowField'],{'as':_0xd6ee('0x19d'),'foreignKey':_0xd6ee('0x19e')});db[_0xd6ee('0xc4')][_0xd6ee('0x106')](db[_0xd6ee('0x19f')],{'as':'Variable','foreignKey':_0xd6ee('0x1a2')});db[_0xd6ee('0xc6')][_0xd6ee('0xfa')](db['Dynamics365Configuration'],{'as':_0xd6ee('0x197'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x198')});db[_0xd6ee('0x1aa')][_0xd6ee('0xfa')](db[_0xd6ee('0xc8')],{'as':_0xd6ee('0x1a1'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x199')});db[_0xd6ee('0x1aa')]['hasMany'](db['Dynamics365Field'],{'as':_0xd6ee('0x19a'),'onDelete':_0xd6ee('0xf8'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0xd6ee('0xfa')](db[_0xd6ee('0xc8')],{'as':_0xd6ee('0x194'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x19e')});db[_0xd6ee('0x1aa')][_0xd6ee('0x106')](db[_0xd6ee('0xc6')],{'as':_0xd6ee('0x153'),'foreignKey':'AccountId'});db[_0xd6ee('0xc8')][_0xd6ee('0xfa')](db[_0xd6ee('0xc8')],{'as':_0xd6ee('0x1a4'),'foreignKey':'SubjectId'});db[_0xd6ee('0xc8')][_0xd6ee('0xfa')](db['Dynamics365Field'],{'as':_0xd6ee('0x19c'),'foreignKey':_0xd6ee('0x19b')});db[_0xd6ee('0xc8')]['hasMany'](db[_0xd6ee('0xc8')],{'as':_0xd6ee('0x19d'),'foreignKey':'FieldId'});db[_0xd6ee('0xc8')][_0xd6ee('0x106')](db[_0xd6ee('0x19f')],{'as':_0xd6ee('0x19f'),'foreignKey':_0xd6ee('0x1a2')});db[_0xd6ee('0xcb')]['belongsTo'](db[_0xd6ee('0x5f')],{});db[_0xd6ee('0xcb')]['belongsTo'](db[_0xd6ee('0x10d')],{'as':_0xd6ee('0x14d'),'foreignKey':'ListId'});db[_0xd6ee('0xcb')][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'as':_0xd6ee('0x154'),'foreignKey':_0xd6ee('0x146')});db[_0xd6ee('0xcb')][_0xd6ee('0x106')](db[_0xd6ee('0x64')],{});db['ChatQueueReport'][_0xd6ee('0x106')](db[_0xd6ee('0x65')],{});db[_0xd6ee('0xcb')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{});db['ChatQueueReport'][_0xd6ee('0x106')](db[_0xd6ee('0x68')],{});db['ChatInternalMessage'][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x1ab')});db[_0xd6ee('0x177')]['belongsTo'](db[_0xd6ee('0x13')],{'onDelete':'cascade','foreignKey':_0xd6ee('0x1ac')});db[_0xd6ee('0x136')][_0xd6ee('0xfa')](db[_0xd6ee('0xd0')],{'foreignKey':_0xd6ee('0x1ad'),'onDelete':_0xd6ee('0xf8')});db['JscriptySessionReport'][_0xd6ee('0xfa')](db[_0xd6ee('0xce')],{'foreignKey':_0xd6ee('0x1ad'),'onDelete':_0xd6ee('0xf8')});db['SmsQueueReport'][_0xd6ee('0x106')](db['SmsAccount'],{});db[_0xd6ee('0xd3')]['belongsTo'](db[_0xd6ee('0x10d')],{'as':_0xd6ee('0x14d'),'foreignKey':_0xd6ee('0x14e')});db[_0xd6ee('0xd3')][_0xd6ee('0x106')](db[_0xd6ee('0x10b')],{'as':_0xd6ee('0x154'),'foreignKey':_0xd6ee('0x146')});db[_0xd6ee('0xd3')][_0xd6ee('0x106')](db[_0xd6ee('0x50')],{});db[_0xd6ee('0xd3')][_0xd6ee('0x106')](db[_0xd6ee('0x52')],{});db[_0xd6ee('0xd3')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{});db[_0xd6ee('0xd3')][_0xd6ee('0x106')](db[_0xd6ee('0x54')],{});db['JscriptyProject'][_0xd6ee('0xfa')](db[_0xd6ee('0x136')],{'foreignKey':_0xd6ee('0x1ae')});db['JscriptyProject'][_0xd6ee('0xfa')](db[_0xd6ee('0xd0')],{'foreignKey':_0xd6ee('0x1ae')});db[_0xd6ee('0xd7')][_0xd6ee('0xfa')](db[_0xd6ee('0xce')],{'foreignKey':_0xd6ee('0x1ae')});db['SquareProject'][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x158'),'through':'user_has_square_projects'});db['Team'][_0xd6ee('0x108')](db['User'],{'as':'Agents','through':_0xd6ee('0x110')});db[_0xd6ee('0xe0')][_0xd6ee('0x108')](db['VoiceQueue'],{'through':_0xd6ee('0x1af'),'as':_0xd6ee('0x117')});db[_0xd6ee('0xe0')]['belongsToMany'](db[_0xd6ee('0x118')],{'through':_0xd6ee('0x1b0'),'as':'MailQueues'});db[_0xd6ee('0xe0')][_0xd6ee('0x108')](db[_0xd6ee('0x68')],{'through':_0xd6ee('0x176'),'as':_0xd6ee('0x11b')});db[_0xd6ee('0xe0')][_0xd6ee('0x108')](db[_0xd6ee('0x161')],{'through':_0xd6ee('0x1b1'),'as':'FaxQueues'});db[_0xd6ee('0xe0')][_0xd6ee('0x108')](db[_0xd6ee('0x54')],{'through':_0xd6ee('0x1b2'),'as':_0xd6ee('0x11e')});db['Team'][_0xd6ee('0x108')](db[_0xd6ee('0x11f')],{'through':'team_has_openchannel_queues','as':_0xd6ee('0x120')});db[_0xd6ee('0xe3')][_0xd6ee('0xfa')](db[_0xd6ee('0x6f')],{'as':_0xd6ee('0x134'),'foreignKey':_0xd6ee('0x17d')});db['Campaign'][_0xd6ee('0xfa')](db['CmHopperFinal'],{'as':_0xd6ee('0x100'),'foreignKey':_0xd6ee('0x17d')});db[_0xd6ee('0xe3')][_0xd6ee('0xfa')](db[_0xd6ee('0x74')],{'as':_0xd6ee('0x135'),'foreignKey':'CampaignId'});db[_0xd6ee('0xe3')]['hasMany'](db[_0xd6ee('0x71')],{'as':_0xd6ee('0x1b3'),'foreignKey':'CampaignId'});db[_0xd6ee('0xe3')]['belongsTo'](db[_0xd6ee('0x138')],{'as':_0xd6ee('0x138'),'foreignKey':_0xd6ee('0x1b4')});db[_0xd6ee('0xe3')][_0xd6ee('0x106')](db[_0xd6ee('0x138')],{'as':_0xd6ee('0x1b5'),'foreignKey':'TrunkBackupId'});db[_0xd6ee('0xe3')][_0xd6ee('0x106')](db[_0xd6ee('0x13a')],{'as':_0xd6ee('0x13a'),'foreignKey':_0xd6ee('0x13b')});db['Campaign'][_0xd6ee('0x106')](db['SquareProject'],{'as':_0xd6ee('0xdb'),'foreignKey':_0xd6ee('0x1b6')});db[_0xd6ee('0xe3')]['belongsToMany'](db[_0xd6ee('0x10d')],{'as':'Lists','through':_0xd6ee('0x1b7')});db[_0xd6ee('0xe3')][_0xd6ee('0x108')](db[_0xd6ee('0x10d')],{'as':_0xd6ee('0x13f'),'through':'campaigns_has_cm_blacklists'});db[_0xd6ee('0xe8')][_0xd6ee('0x106')](db[_0xd6ee('0x40')],{});db[_0xd6ee('0xe8')][_0xd6ee('0x106')](db[_0xd6ee('0x105')],{});db[_0xd6ee('0xe8')][_0xd6ee('0x106')](db[_0xd6ee('0x3b')],{'foreignKey':_0xd6ee('0x1b8'),'as':_0xd6ee('0x1b9')});db['MailTransferReport'][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'foreignKey':'FromUserId','as':_0xd6ee('0x1ba')});db[_0xd6ee('0xe8')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'foreignKey':_0xd6ee('0x1bb'),'as':'ToAgent'});db[_0xd6ee('0xe8')][_0xd6ee('0x106')](db[_0xd6ee('0x118')],{'foreignKey':'ToMailQueueId','as':_0xd6ee('0x1bc')});db[_0xd6ee('0xe8')]['belongsTo'](db[_0xd6ee('0x3b')],{'foreignKey':_0xd6ee('0x1bd'),'as':_0xd6ee('0x1be')});db[_0xd6ee('0xea')][_0xd6ee('0x106')](db[_0xd6ee('0x65')],{});db['ChatTransferReport'][_0xd6ee('0x106')](db[_0xd6ee('0x64')],{});db[_0xd6ee('0xea')]['belongsTo'](db[_0xd6ee('0x5f')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db['ChatTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xd6ee('0x1bf'),'as':_0xd6ee('0x1ba')});db[_0xd6ee('0xea')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'foreignKey':'ToUserId','as':_0xd6ee('0x1c0')});db['ChatTransferReport'][_0xd6ee('0x106')](db[_0xd6ee('0x68')],{'foreignKey':_0xd6ee('0x1c1'),'as':_0xd6ee('0x1bc')});db[_0xd6ee('0xea')][_0xd6ee('0x106')](db[_0xd6ee('0x5f')],{'foreignKey':_0xd6ee('0x1c2'),'as':_0xd6ee('0x1be')});db[_0xd6ee('0xec')][_0xd6ee('0x106')](db['FaxMessage'],{});db['FaxTransferReport'][_0xd6ee('0x106')](db[_0xd6ee('0x49')],{});db['FaxTransferReport']['belongsTo'](db['FaxAccount'],{'foreignKey':_0xd6ee('0x1c3'),'as':_0xd6ee('0x1b9')});db[_0xd6ee('0xec')][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'foreignKey':_0xd6ee('0x1bf'),'as':_0xd6ee('0x1ba')});db['FaxTransferReport']['belongsTo'](db[_0xd6ee('0x13')],{'foreignKey':'ToUserId','as':_0xd6ee('0x1c0')});db[_0xd6ee('0xec')][_0xd6ee('0x106')](db[_0xd6ee('0x161')],{'foreignKey':_0xd6ee('0x1c4'),'as':'ToQueue'});db[_0xd6ee('0xec')][_0xd6ee('0x106')](db[_0xd6ee('0x124')],{'foreignKey':'ToFaxAccountId','as':_0xd6ee('0x1be')});db['OpenchannelTransferReport'][_0xd6ee('0x106')](db['OpenchannelMessage'],{});db[_0xd6ee('0xed')][_0xd6ee('0x106')](db[_0xd6ee('0x5a')],{});db['OpenchannelTransferReport'][_0xd6ee('0x106')](db[_0xd6ee('0x56')],{'foreignKey':_0xd6ee('0x1c5'),'as':_0xd6ee('0x1b9')});db['OpenchannelTransferReport'][_0xd6ee('0x106')](db[_0xd6ee('0x13')],{'foreignKey':_0xd6ee('0x1bf'),'as':_0xd6ee('0x1ba')});db[_0xd6ee('0xed')]['belongsTo'](db[_0xd6ee('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xd6ee('0xed')][_0xd6ee('0x106')](db[_0xd6ee('0x11f')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0xd6ee('0x1c6'),'as':'ToAccount'});db[_0xd6ee('0xee')][_0xd6ee('0x106')](db['SmsMessage'],{});db[_0xd6ee('0xee')][_0xd6ee('0x106')](db[_0xd6ee('0x50')],{});db['SmsTransferReport'][_0xd6ee('0x106')](db[_0xd6ee('0x12a')],{'foreignKey':_0xd6ee('0x1c7'),'as':_0xd6ee('0x1b9')});db['SmsTransferReport']['belongsTo'](db[_0xd6ee('0x13')],{'foreignKey':_0xd6ee('0x1bf'),'as':_0xd6ee('0x1ba')});db['SmsTransferReport']['belongsTo'](db[_0xd6ee('0x13')],{'foreignKey':_0xd6ee('0x1bb'),'as':'ToAgent'});db[_0xd6ee('0xee')][_0xd6ee('0x106')](db[_0xd6ee('0x54')],{'foreignKey':_0xd6ee('0x1c8'),'as':_0xd6ee('0x1bc')});db[_0xd6ee('0xee')][_0xd6ee('0x106')](db[_0xd6ee('0x12a')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0xd6ee('0x10d')][_0xd6ee('0xfa')](db[_0xd6ee('0x7f')],{'as':'Dispositions','foreignKey':'ListId'});db[_0xd6ee('0x10d')]['hasMany'](db[_0xd6ee('0x78')],{'as':'CustomFields','foreignKey':_0xd6ee('0x14e')});db[_0xd6ee('0x10d')][_0xd6ee('0xfa')](db['CmContact'],{'as':_0xd6ee('0x17a'),'onDelete':_0xd6ee('0xf8'),'foreignKey':_0xd6ee('0x14e')});db['CmList'][_0xd6ee('0xfa')](db[_0xd6ee('0xff')],{'as':_0xd6ee('0x100'),'foreignKey':'ListId'});db[_0xd6ee('0x10d')][_0xd6ee('0xfa')](db[_0xd6ee('0x74')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0xd6ee('0x10d')][_0xd6ee('0xfa')](db[_0xd6ee('0x76')],{'as':_0xd6ee('0x76'),'foreignKey':'ListId'});db['CmList'][_0xd6ee('0x108')](db[_0xd6ee('0x1b')],{'as':_0xd6ee('0x1c9'),'through':_0xd6ee('0x13d')});db[_0xd6ee('0x10d')][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':'Agents','through':_0xd6ee('0x10f')});db['VoicePrefix']['hasMany'](db[_0xd6ee('0x18')],{'as':_0xd6ee('0xfe'),'onDelete':_0xd6ee('0x15b')});db['VoicePrefix'][_0xd6ee('0x108')](db[_0xd6ee('0x13')],{'as':_0xd6ee('0x151'),'through':_0xd6ee('0x122')});db['UserProfile'][_0xd6ee('0xfa')](db[_0xd6ee('0x13')],{'as':'Users','foreignKey':'userProfileId'});db[_0xd6ee('0xf2')][_0xd6ee('0xfa')](db['UserProfileSection'],{'as':_0xd6ee('0x1ca'),'foreignKey':_0xd6ee('0x107'),'onDelete':_0xd6ee('0xf8')});db[_0xd6ee('0x1cb')][_0xd6ee('0xfa')](db[_0xd6ee('0x1cc')],{'as':_0xd6ee('0x1cd'),'foreignKey':_0xd6ee('0x1ce'),'onDelete':_0xd6ee('0xf8')});module[_0xd6ee('0x1cf')]={'db':db,'dbH':dbH};
\ No newline at end of file
diff --git a/server/routes.js b/server/routes.js
index 136b9a0..945f3ba 100644
--- a/server/routes.js
+++ b/server/routes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a2c=['./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations/reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/networks','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','./api/pm2','/apidoc','static','join','root','/www','/snippet','snippet','1.0.14','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express-winston','util','./errors','./config/environment','./config/logger','api','auth','use','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','url','responseTime','user','name','role','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','other','agent_name','test','/api/users','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/tags'];(function(_0x4fdd28,_0x4b3c0a){var _0x9cdb=function(_0x1c6226){while(--_0x1c6226){_0x4fdd28['push'](_0x4fdd28['shift']());}};_0x9cdb(++_0x4b3c0a);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x13ef47,_0x5d272d){_0x13ef47=_0x13ef47-0x0;var _0x5ed135=_0x7a2c[_0x13ef47];return _0x5ed135;};'use strict';var path=require(_0xc7a2('0x0'));var express=require('express');var ewinston=require(_0xc7a2('0x1'));var util=require(_0xc7a2('0x2'));var errors=require(_0xc7a2('0x3'));var config=require(_0xc7a2('0x4'));var logger=require(_0xc7a2('0x5'))(_0xc7a2('0x6'));var authLogger=require(_0xc7a2('0x5'))(_0xc7a2('0x7'));exports['default']=function(_0x3a47c8){_0x3a47c8[_0xc7a2('0x8')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x481430,_0x48773c){return util[_0xc7a2('0x9')](_0xc7a2('0xa'),_0x481430[_0xc7a2('0xb')],_0x481430[_0xc7a2('0xc')]['x-forwarded-for']?_0x481430[_0xc7a2('0xc')][_0xc7a2('0xd')]:_0x481430[_0xc7a2('0xe')]['remoteAddress']||_0x481430['ip'],_0x481430[_0xc7a2('0xf')],_0x48773c['statusCode'],_0x48773c[_0xc7a2('0x10')],_0x481430[_0xc7a2('0x11')]?_0x481430[_0xc7a2('0x11')]['id']:null,_0x481430['user']?_0x481430[_0xc7a2('0x11')][_0xc7a2('0x12')]:null,_0x481430[_0xc7a2('0x11')]?_0x481430['user'][_0xc7a2('0x13')]:null);}}));_0x3a47c8[_0xc7a2('0x8')](ewinston[_0xc7a2('0x14')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2cbe93,_0x39929c){var _0x2af363=_0xc7a2('0x15');if(_0x2cbe93[_0xc7a2('0x16')]&&_0x2cbe93[_0xc7a2('0x16')][_0xc7a2('0x17')]&&_0x2cbe93[_0xc7a2('0x16')][_0xc7a2('0x18')]){_0x2af363=_0xc7a2('0x19');}return util[_0xc7a2('0x9')](_0x2af363,_0x2cbe93[_0xc7a2('0xb')],_0x2cbe93['headers'][_0xc7a2('0xd')]?_0x2cbe93['headers'][_0xc7a2('0xd')]:_0x2cbe93[_0xc7a2('0xe')][_0xc7a2('0x1a')]||_0x2cbe93['ip'],_0x2cbe93[_0xc7a2('0xf')],_0x39929c['statusCode'],_0x39929c['responseTime'],_0x2cbe93[_0xc7a2('0x11')]?_0x2cbe93[_0xc7a2('0x11')]['id']:null,_0x2cbe93['user']?_0x2cbe93['user']['name']:null,_0x2cbe93[_0xc7a2('0x11')]?_0x2cbe93['user'][_0xc7a2('0x13')]:null,_0x2cbe93[_0xc7a2('0x16')]&&_0x2cbe93['body'][_0xc7a2('0x17')]?_0x2cbe93[_0xc7a2('0x16')][_0xc7a2('0x17')]:_0xc7a2('0x1b'),_0x2cbe93[_0xc7a2('0x16')]&&_0x2cbe93[_0xc7a2('0x16')][_0xc7a2('0x18')]?_0x2cbe93['body']['agent_id']:'',_0x2cbe93[_0xc7a2('0x16')]&&_0x2cbe93[_0xc7a2('0x16')]['agent_name']?_0x2cbe93[_0xc7a2('0x16')][_0xc7a2('0x1c')]:'');},'ignoreRoute':function(_0x19f69a){var _0x2c2281=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2c2281[_0xc7a2('0x1d')](_0x19f69a[_0xc7a2('0xf')]);}}));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x1e'),require('./api/user'));_0x3a47c8[_0xc7a2('0x8')]('/api/voice/chanspy',require(_0xc7a2('0x1f')));_0x3a47c8['use'](_0xc7a2('0x20'),require(_0xc7a2('0x21')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x22'),require('./api/voiceExtension'));_0x3a47c8['use'](_0xc7a2('0x23'),require(_0xc7a2('0x24')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x25'),require(_0xc7a2('0x26')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x27'),require('./api/voiceRecording'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x28'),require('./api/screenRecording'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x29'),require(_0xc7a2('0x2a')));_0x3a47c8['use'](_0xc7a2('0x2b'),require('./api/voiceMailMessage'));_0x3a47c8[_0xc7a2('0x8')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x3a47c8[_0xc7a2('0x8')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x3a47c8[_0xc7a2('0x8')]('/api/voice/agents/reports',require(_0xc7a2('0x2c')));_0x3a47c8['use'](_0xc7a2('0x2d'),require(_0xc7a2('0x2e')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x2f'),require(_0xc7a2('0x30')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x31'),require(_0xc7a2('0x32')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x33'),require('./api/voiceTransferReport'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x34'),require('./api/mailServerOut'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x35'),require(_0xc7a2('0x36')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x37'),require(_0xc7a2('0x38')));_0x3a47c8[_0xc7a2('0x8')]('/api/mail/substatuses',require(_0xc7a2('0x39')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x3a'),require('./api/mailInteraction'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x3b'),require('./api/mailMessage'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x3c'),require(_0xc7a2('0x3d')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x3e'),require(_0xc7a2('0x3f')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x40'),require('./api/dashboard'));_0x3a47c8[_0xc7a2('0x8')]('/api/dashboards/items',require(_0xc7a2('0x41')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x42'),require(_0xc7a2('0x43')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x44'),require(_0xc7a2('0x45')));_0x3a47c8[_0xc7a2('0x8')]('/api/fax/interactions',require(_0xc7a2('0x46')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x47'),require(_0xc7a2('0x48')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x49'),require('./api/faxQueue'));_0x3a47c8['use']('/api/fax/reports/queue',require(_0xc7a2('0x4a')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x4b'),require(_0xc7a2('0x4c')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x4d'),require(_0xc7a2('0x4e')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x4f'),require('./api/smsInteraction'));_0x3a47c8['use']('/api/sms/messages',require(_0xc7a2('0x50')));_0x3a47c8[_0xc7a2('0x8')]('/api/sms/queues',require(_0xc7a2('0x51')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x52'),require('./api/openchannelAccount'));_0x3a47c8[_0xc7a2('0x8')]('/api/openchannel/applications',require(_0xc7a2('0x53')));_0x3a47c8[_0xc7a2('0x8')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x54'),require('./api/openchannelMessage'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x55'),require(_0xc7a2('0x56')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x57'),require(_0xc7a2('0x58')));_0x3a47c8['use'](_0xc7a2('0x59'),require(_0xc7a2('0x5a')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x5b'),require('./api/chatApplication'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x5c'),require(_0xc7a2('0x5d')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x5e'),require(_0xc7a2('0x5f')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x60'),require('./api/chatOfflineMessage'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x61'),require(_0xc7a2('0x62')));_0x3a47c8[_0xc7a2('0x8')]('/api/chat/groups',require(_0xc7a2('0x63')));_0x3a47c8[_0xc7a2('0x8')]('/api/chat/proactive_actions',require(_0xc7a2('0x64')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x65'),require(_0xc7a2('0x66')));_0x3a47c8[_0xc7a2('0x8')]('/api/cm/contacts',require(_0xc7a2('0x67')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x68'),require('./api/cmHopper'));_0x3a47c8['use'](_0xc7a2('0x69'),require('./api/cmHopperBlack'));_0x3a47c8['use'](_0xc7a2('0x6a'),require(_0xc7a2('0x6b')));_0x3a47c8['use']('/api/cm/hopper_history',require(_0xc7a2('0x6c')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x6d'),require(_0xc7a2('0x6e')));_0x3a47c8[_0xc7a2('0x8')]('/api/actions',require(_0xc7a2('0x6f')));_0x3a47c8[_0xc7a2('0x8')]('/api/automations',require(_0xc7a2('0x70')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x71'),require(_0xc7a2('0x72')));_0x3a47c8[_0xc7a2('0x8')]('/api/dispositions',require(_0xc7a2('0x73')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x74'),require('./api/condition'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x75'),require(_0xc7a2('0x76')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x77'),require(_0xc7a2('0x78')));_0x3a47c8['use'](_0xc7a2('0x79'),require(_0xc7a2('0x7a')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x7b'),require(_0xc7a2('0x7c')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x7d'),require('./api/schedule'));_0x3a47c8[_0xc7a2('0x8')]('/api/sounds',require('./api/sound'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x7e'),require(_0xc7a2('0x7f')));_0x3a47c8['use'](_0xc7a2('0x80'),require('./api/template'));_0x3a47c8['use'](_0xc7a2('0x81'),require(_0xc7a2('0x82')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x83'),require(_0xc7a2('0x84')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations',require('./api/integration'));_0x3a47c8['use'](_0xc7a2('0x85'),require('./api/integrationReport'));_0x3a47c8['use']('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x86'),require(_0xc7a2('0x87')));_0x3a47c8[_0xc7a2('0x8')]('/api/analytics/extracted_reports',require(_0xc7a2('0x88')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x89'),require(_0xc7a2('0x8a')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x8b'),require(_0xc7a2('0x8c')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x8d'),require(_0xc7a2('0x8e')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/salesforce/configurations',require(_0xc7a2('0x8f')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x90'),require(_0xc7a2('0x91')));_0x3a47c8['use'](_0xc7a2('0x92'),require(_0xc7a2('0x93')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x94'),require(_0xc7a2('0x95')));_0x3a47c8['use'](_0xc7a2('0x96'),require(_0xc7a2('0x97')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x98'),require(_0xc7a2('0x99')));_0x3a47c8['use'](_0xc7a2('0x9a'),require('./api/intDeskConfiguration'));_0x3a47c8['use'](_0xc7a2('0x9b'),require(_0xc7a2('0x9c')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/zoho/accounts',require(_0xc7a2('0x9d')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/zoho/configurations',require(_0xc7a2('0x9e')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x9f'),require('./api/intZohoField'));_0x3a47c8['use']('/api/integrations/zendesk/accounts',require(_0xc7a2('0xa0')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/zendesk/configurations',require(_0xc7a2('0xa1')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/zendesk/fields',require(_0xc7a2('0xa2')));_0x3a47c8['use'](_0xc7a2('0xa3'),require('./api/intFreshdeskAccount'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xa4'),require('./api/intFreshdeskConfiguration'));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/freshdesk/fields',require(_0xc7a2('0xa5')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xa6'),require(_0xc7a2('0xa7')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xa8'),require('./api/intVtigerConfiguration'));_0x3a47c8['use']('/api/integrations/vtiger/fields',require(_0xc7a2('0xa9')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xaa'),require(_0xc7a2('0xab')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xac'),require(_0xc7a2('0xad')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xae'),require(_0xc7a2('0xaf')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xb0'),require(_0xc7a2('0xb1')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xb2'),require('./api/network'));_0x3a47c8[_0xc7a2('0x8')]('/api/chat/reports/queue',require(_0xc7a2('0xb3')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xb4'),require(_0xc7a2('0xb5')));_0x3a47c8['use'](_0xc7a2('0xb6'),require(_0xc7a2('0xb7')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xb8'),require('./api/jscriptyQuestionReport'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xb9'),require(_0xc7a2('0xba')));_0x3a47c8[_0xc7a2('0x8')]('/api/sms/reports/queue',require(_0xc7a2('0xbb')));_0x3a47c8['use']('/api/square/reports',require('./api/squareReport'));_0x3a47c8[_0xc7a2('0x8')]('/api/square/details/reports',require(_0xc7a2('0xbc')));_0x3a47c8['use'](_0xc7a2('0xbd'),require(_0xc7a2('0xbe')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xbf'),require(_0xc7a2('0xc0')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xc1'),require(_0xc7a2('0xc2')));_0x3a47c8[_0xc7a2('0x8')]('/api/square/projects',require(_0xc7a2('0xc3')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xc4'),require(_0xc7a2('0xc5')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xc6'),require(_0xc7a2('0xc7')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xc8'),require(_0xc7a2('0xc9')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xca'),require(_0xc7a2('0xcb')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xcc'),require(_0xc7a2('0xcd')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xce'),require('./api/migration'));_0x3a47c8['use'](_0xc7a2('0xcf'),require(_0xc7a2('0xd0')));_0x3a47c8['use'](_0xc7a2('0xd1'),require(_0xc7a2('0xd2')));_0x3a47c8['use']('/api/mail/reports/transfer',require(_0xc7a2('0xd3')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xd4'),require(_0xc7a2('0xd5')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xd6'),require('./api/faxTransferReport'));_0x3a47c8[_0xc7a2('0x8')]('/api/openchannel/reports/transfer',require(_0xc7a2('0xd7')));_0x3a47c8['use'](_0xc7a2('0xd8'),require(_0xc7a2('0xd9')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xda'),require(_0xc7a2('0xdb')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xdc'),require(_0xc7a2('0xdd')));_0x3a47c8[_0xc7a2('0x8')]('/api/userProfiles',require('./api/userProfile'));_0x3a47c8['use'](_0xc7a2('0xde'),require(_0xc7a2('0xdf')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xe0'),require(_0xc7a2('0xe1')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xe2'),require(_0xc7a2('0xe3')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xe4'),require('./api/authGoogle'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xe5'),require(_0xc7a2('0xe6')));_0x3a47c8['use'](_0xc7a2('0xe7'),require(_0xc7a2('0xe8')));_0x3a47c8[_0xc7a2('0x8')]('/api/version',require(_0xc7a2('0xe9')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xea'),require(_0xc7a2('0xeb')));_0x3a47c8['use']('/api/pm2',require(_0xc7a2('0xec')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xed'),express[_0xc7a2('0xee')](path[_0xc7a2('0xef')](config[_0xc7a2('0xf0')],_0xc7a2('0xed'))));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xf1'),express['static'](path[_0xc7a2('0xef')](config[_0xc7a2('0xf0')],_0xc7a2('0xf1'))));_0x3a47c8[_0xc7a2('0x8')]('/demo',express[_0xc7a2('0xee')](path[_0xc7a2('0xef')](config[_0xc7a2('0xf0')],'/demo')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xf2'),express[_0xc7a2('0xee')](path[_0xc7a2('0xef')](config['root'],_0xc7a2('0xf3'),_0xc7a2('0xf4'))));_0x3a47c8['use'](_0xc7a2('0xf5'),express[_0xc7a2('0xee')](path[_0xc7a2('0xef')](config[_0xc7a2('0xf0')],_0xc7a2('0xf6'))));_0x3a47c8[_0xc7a2('0xf7')](_0xc7a2('0xf8'))[_0xc7a2('0xf9')](errors[0x194]);_0x3a47c8[_0xc7a2('0xf7')]('/*')[_0xc7a2('0xf9')](function(_0x48faa9,_0x42ff3f){_0x42ff3f[_0xc7a2('0xfa')](path['resolve'](_0x3a47c8[_0xc7a2('0xf9')](_0xc7a2('0xfb'))+_0xc7a2('0xfc')));});};
\ No newline at end of file
+var _0xa4db=['./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','/www','/demo','root','/snippet','snippet','/plugins','/server/files/plugins','route','sendFile','resolve','get','appPath','/index.html','util','./errors','./config/environment','./config/logger','api','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_name','test','./api/user','/api/voice/chanspy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','./api/trigger','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/fields','/api/integrations/zoho/configurations','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer'];(function(_0x209bff,_0x545184){var _0x8592f5=function(_0x63f250){while(--_0x63f250){_0x209bff['push'](_0x209bff['shift']());}};_0x8592f5(++_0x545184);}(_0xa4db,0x139));var _0xba4d=function(_0x16128f,_0x799a8d){_0x16128f=_0x16128f-0x0;var _0x417dd9=_0xa4db[_0x16128f];return _0x417dd9;};'use strict';var path=require('path');var express=require('express');var ewinston=require('express-winston');var util=require(_0xba4d('0x0'));var errors=require(_0xba4d('0x1'));var config=require(_0xba4d('0x2'));var logger=require(_0xba4d('0x3'))(_0xba4d('0x4'));var authLogger=require(_0xba4d('0x3'))('auth');exports[_0xba4d('0x5')]=function(_0x4f8bbe){_0x4f8bbe[_0xba4d('0x6')](ewinston[_0xba4d('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x325531,_0x14b2fd){return util[_0xba4d('0x8')](_0xba4d('0x9'),_0x325531[_0xba4d('0xa')],_0x325531[_0xba4d('0xb')][_0xba4d('0xc')]?_0x325531['headers'][_0xba4d('0xc')]:_0x325531[_0xba4d('0xd')][_0xba4d('0xe')]||_0x325531['ip'],_0x325531[_0xba4d('0xf')],_0x14b2fd[_0xba4d('0x10')],_0x14b2fd[_0xba4d('0x11')],_0x325531[_0xba4d('0x12')]?_0x325531[_0xba4d('0x12')]['id']:null,_0x325531[_0xba4d('0x12')]?_0x325531[_0xba4d('0x12')][_0xba4d('0x13')]:null,_0x325531[_0xba4d('0x12')]?_0x325531['user']['role']:null);}}));_0x4f8bbe['use'](ewinston[_0xba4d('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x52e57e,_0x4ae237){var _0x393713=_0xba4d('0x14');if(_0x52e57e[_0xba4d('0x15')]&&_0x52e57e['body']['device']&&_0x52e57e['body'][_0xba4d('0x16')]){_0x393713=_0xba4d('0x17');}return util[_0xba4d('0x8')](_0x393713,_0x52e57e['method'],_0x52e57e['headers']['x-forwarded-for']?_0x52e57e['headers']['x-forwarded-for']:_0x52e57e['connection'][_0xba4d('0xe')]||_0x52e57e['ip'],_0x52e57e['url'],_0x4ae237[_0xba4d('0x10')],_0x4ae237['responseTime'],_0x52e57e['user']?_0x52e57e['user']['id']:null,_0x52e57e['user']?_0x52e57e['user'][_0xba4d('0x13')]:null,_0x52e57e[_0xba4d('0x12')]?_0x52e57e['user']['role']:null,_0x52e57e[_0xba4d('0x15')]&&_0x52e57e['body'][_0xba4d('0x18')]?_0x52e57e[_0xba4d('0x15')][_0xba4d('0x18')]:_0xba4d('0x19'),_0x52e57e[_0xba4d('0x15')]&&_0x52e57e[_0xba4d('0x15')][_0xba4d('0x16')]?_0x52e57e[_0xba4d('0x15')][_0xba4d('0x16')]:'',_0x52e57e[_0xba4d('0x15')]&&_0x52e57e[_0xba4d('0x15')]['agent_name']?_0x52e57e[_0xba4d('0x15')][_0xba4d('0x1a')]:'');},'ignoreRoute':function(_0x3edbe6){var _0x34c3e9=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x34c3e9[_0xba4d('0x1b')](_0x3edbe6['url']);}}));_0x4f8bbe['use']('/api/users',require(_0xba4d('0x1c')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x1d'),require('./api/voiceChanSpy'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x1e'),require('./api/voiceContext'));_0x4f8bbe['use'](_0xba4d('0x1f'),require(_0xba4d('0x20')));_0x4f8bbe['use'](_0xba4d('0x21'),require(_0xba4d('0x22')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x23'),require('./api/voiceQueue'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x24'),require('./api/voiceRecording'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x25'),require(_0xba4d('0x26')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x27'),require('./api/voiceMail'));_0x4f8bbe['use'](_0xba4d('0x28'),require(_0xba4d('0x29')));_0x4f8bbe[_0xba4d('0x6')]('/api/voice/calls/reports',require(_0xba4d('0x2a')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x2b'),require('./api/voiceDialReport'));_0x4f8bbe['use'](_0xba4d('0x2c'),require(_0xba4d('0x2d')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x2e'),require(_0xba4d('0x2f')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x30'),require(_0xba4d('0x31')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x32'),require(_0xba4d('0x33')));_0x4f8bbe['use']('/api/voice/transfers/reports',require(_0xba4d('0x34')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x35'),require(_0xba4d('0x36')));_0x4f8bbe[_0xba4d('0x6')]('/api/mail/accounts',require('./api/mailAccount'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x37'),require('./api/mailQueue'));_0x4f8bbe['use']('/api/mail/substatuses',require(_0xba4d('0x38')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x39'),require(_0xba4d('0x3a')));_0x4f8bbe[_0xba4d('0x6')]('/api/mail/messages',require(_0xba4d('0x3b')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x3c'),require('./api/mailApplication'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x3d'),require(_0xba4d('0x3e')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x3f'),require('./api/dashboard'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x40'),require('./api/dashboardItem'));_0x4f8bbe['use'](_0xba4d('0x41'),require(_0xba4d('0x42')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x43'),require(_0xba4d('0x44')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x45'),require('./api/faxInteraction'));_0x4f8bbe[_0xba4d('0x6')]('/api/fax/messages',require(_0xba4d('0x46')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x47'),require(_0xba4d('0x48')));_0x4f8bbe[_0xba4d('0x6')]('/api/fax/reports/queue',require(_0xba4d('0x49')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x4a'),require('./api/smsAccount'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x4b'),require(_0xba4d('0x4c')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x4d'),require('./api/smsInteraction'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x4e'),require(_0xba4d('0x4f')));_0x4f8bbe[_0xba4d('0x6')]('/api/sms/queues',require(_0xba4d('0x50')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x51'),require(_0xba4d('0x52')));_0x4f8bbe['use'](_0xba4d('0x53'),require('./api/openchannelApplication'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x54'),require(_0xba4d('0x55')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x56'),require(_0xba4d('0x57')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x58'),require('./api/openchannelQueue'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x59'),require(_0xba4d('0x5a')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x5b'),require('./api/openchannelQueueReport'));_0x4f8bbe[_0xba4d('0x6')]('/api/chat/applications',require(_0xba4d('0x5c')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x5d'),require('./api/chatInteraction'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x5e'),require(_0xba4d('0x5f')));_0x4f8bbe[_0xba4d('0x6')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x60'),require('./api/chatQueue'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x61'),require(_0xba4d('0x62')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x63'),require(_0xba4d('0x64')));_0x4f8bbe[_0xba4d('0x6')]('/api/cm/companies',require(_0xba4d('0x65')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x66'),require(_0xba4d('0x67')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x68'),require(_0xba4d('0x69')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x6a'),require('./api/cmHopperBlack'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x6b'),require(_0xba4d('0x6c')));_0x4f8bbe[_0xba4d('0x6')]('/api/cm/hopper_history',require(_0xba4d('0x6d')));_0x4f8bbe['use']('/api/cm/custom_fields',require(_0xba4d('0x6e')));_0x4f8bbe['use'](_0xba4d('0x6f'),require(_0xba4d('0x70')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x71'),require(_0xba4d('0x72')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x73'),require('./api/cannedAnswer'));_0x4f8bbe['use'](_0xba4d('0x74'),require(_0xba4d('0x75')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x76'),require(_0xba4d('0x77')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x78'),require(_0xba4d('0x79')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x7a'),require(_0xba4d('0x7b')));_0x4f8bbe['use'](_0xba4d('0x7c'),require(_0xba4d('0x7d')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x7e'),require(_0xba4d('0x7f')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x80'),require(_0xba4d('0x81')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x82'),require(_0xba4d('0x83')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x84'),require(_0xba4d('0x85')));_0x4f8bbe[_0xba4d('0x6')]('/api/templates',require(_0xba4d('0x86')));_0x4f8bbe[_0xba4d('0x6')]('/api/triggers',require(_0xba4d('0x87')));_0x4f8bbe['use']('/api/variables',require(_0xba4d('0x88')));_0x4f8bbe[_0xba4d('0x6')]('/api/integrations',require(_0xba4d('0x89')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x8a'),require(_0xba4d('0x8b')));_0x4f8bbe['use']('/api/analytics/custom_reports',require(_0xba4d('0x8c')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x8d'),require('./api/analyticDefaultReport'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x8e'),require(_0xba4d('0x8f')));_0x4f8bbe[_0xba4d('0x6')]('/api/analytics/metrics',require(_0xba4d('0x90')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x91'),require(_0xba4d('0x92')));_0x4f8bbe['use'](_0xba4d('0x93'),require(_0xba4d('0x94')));_0x4f8bbe[_0xba4d('0x6')]('/api/integrations/salesforce/accounts',require(_0xba4d('0x95')));_0x4f8bbe[_0xba4d('0x6')]('/api/integrations/salesforce/configurations',require(_0xba4d('0x96')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x97'),require(_0xba4d('0x98')));_0x4f8bbe[_0xba4d('0x6')]('/api/integrations/sugarcrm/accounts',require(_0xba4d('0x99')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x9a'),require(_0xba4d('0x9b')));_0x4f8bbe['use']('/api/integrations/sugarcrm/fields',require(_0xba4d('0x9c')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0x9d'),require(_0xba4d('0x9e')));_0x4f8bbe[_0xba4d('0x6')]('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x4f8bbe['use'](_0xba4d('0x9f'),require('./api/intDeskField'));_0x4f8bbe['use']('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xa0'),require('./api/intZohoConfiguration'));_0x4f8bbe[_0xba4d('0x6')]('/api/integrations/zoho/fields',require(_0xba4d('0xa1')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xa2'),require(_0xba4d('0xa3')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xa4'),require(_0xba4d('0xa5')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xa6'),require(_0xba4d('0xa7')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xa8'),require(_0xba4d('0xa9')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xaa'),require(_0xba4d('0xab')));_0x4f8bbe['use']('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0x4f8bbe['use'](_0xba4d('0xac'),require(_0xba4d('0xad')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xae'),require(_0xba4d('0xaf')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xb0'),require(_0xba4d('0xb1')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xb2'),require(_0xba4d('0xb3')));_0x4f8bbe['use'](_0xba4d('0xb4'),require(_0xba4d('0xb5')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xb6'),require(_0xba4d('0xb7')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xb8'),require(_0xba4d('0xb9')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xba'),require(_0xba4d('0xbb')));_0x4f8bbe['use']('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xbc'),require(_0xba4d('0xbd')));_0x4f8bbe['use']('/api/chat/reports/queue',require(_0xba4d('0xbe')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xbf'),require(_0xba4d('0xc0')));_0x4f8bbe['use']('/api/jscripty/answers/reports',require(_0xba4d('0xc1')));_0x4f8bbe['use'](_0xba4d('0xc2'),require('./api/jscriptyQuestionReport'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xc3'),require(_0xba4d('0xc4')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xc5'),require(_0xba4d('0xc6')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xc7'),require(_0xba4d('0xc8')));_0x4f8bbe[_0xba4d('0x6')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xc9'),require(_0xba4d('0xca')));_0x4f8bbe[_0xba4d('0x6')]('/api/settings',require(_0xba4d('0xcb')));_0x4f8bbe['use'](_0xba4d('0xcc'),require(_0xba4d('0xcd')));_0x4f8bbe[_0xba4d('0x6')]('/api/square/projects',require(_0xba4d('0xce')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xcf'),require(_0xba4d('0xd0')));_0x4f8bbe[_0xba4d('0x6')]('/api/square/messages',require(_0xba4d('0xd1')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xd2'),require(_0xba4d('0xd3')));_0x4f8bbe[_0xba4d('0x6')]('/api/license',require(_0xba4d('0xd4')));_0x4f8bbe[_0xba4d('0x6')]('/api/campaigns',require(_0xba4d('0xd5')));_0x4f8bbe['use'](_0xba4d('0xd6'),require(_0xba4d('0xd7')));_0x4f8bbe['use'](_0xba4d('0xd8'),require(_0xba4d('0xd9')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xda'),require(_0xba4d('0xdb')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xdc'),require(_0xba4d('0xdd')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xde'),require(_0xba4d('0xdf')));_0x4f8bbe['use'](_0xba4d('0xe0'),require(_0xba4d('0xe1')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xe2'),require(_0xba4d('0xe3')));_0x4f8bbe['use'](_0xba4d('0xe4'),require('./api/smsTransferReport'));_0x4f8bbe[_0xba4d('0x6')]('/api/cm/lists',require(_0xba4d('0xe5')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xe6'),require(_0xba4d('0xe7')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xe8'),require(_0xba4d('0xe9')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xea'),require(_0xba4d('0xeb')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xec'),require(_0xba4d('0xed')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xee'),require(_0xba4d('0xef')));_0x4f8bbe['use'](_0xba4d('0xf0'),require(_0xba4d('0xf1')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xf2'),require(_0xba4d('0xf3')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xf4'),require(_0xba4d('0xf5')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xf6'),require(_0xba4d('0xf7')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xf8'),require(_0xba4d('0xf9')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xfa'),require(_0xba4d('0xfb')));_0x4f8bbe[_0xba4d('0x6')](_0xba4d('0xfc'),express[_0xba4d('0xfd')](path['join'](config['root'],_0xba4d('0xfc'))));_0x4f8bbe[_0xba4d('0x6')]('/www',express['static'](path[_0xba4d('0xfe')](config['root'],_0xba4d('0xff'))));_0x4f8bbe['use'](_0xba4d('0x100'),express[_0xba4d('0xfd')](path[_0xba4d('0xfe')](config[_0xba4d('0x101')],_0xba4d('0x100'))));_0x4f8bbe['use'](_0xba4d('0x102'),express[_0xba4d('0xfd')](path[_0xba4d('0xfe')](config['root'],_0xba4d('0x103'),'1.0.14')));_0x4f8bbe['use'](_0xba4d('0x104'),express[_0xba4d('0xfd')](path[_0xba4d('0xfe')](config[_0xba4d('0x101')],_0xba4d('0x105'))));_0x4f8bbe[_0xba4d('0x106')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x4f8bbe['route']('/*')['get'](function(_0xad610d,_0x1c3941){_0x1c3941[_0xba4d('0x107')](path[_0xba4d('0x108')](_0x4f8bbe[_0xba4d('0x109')](_0xba4d('0x10a'))+_0xba4d('0x10b')));});};
\ No newline at end of file
diff --git a/server/rpc/index.js b/server/rpc/index.js
index 7fe3385..0004fa6 100644
--- a/server/rpc/index.js
+++ b/server/rpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x624c=['../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','server','http','port','rpc','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','bluebird','lodash','../config/environment','listen','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc'];(function(_0x2dcccb,_0x125a4b){var _0x2aa0eb=function(_0x2c90d0){while(--_0x2c90d0){_0x2dcccb['push'](_0x2dcccb['shift']());}};_0x2aa0eb(++_0x125a4b);}(_0x624c,0x1ee));var _0xc624=function(_0x3e655a,_0x1a2097){_0x3e655a=_0x3e655a-0x0;var _0x40a6c5=_0x624c[_0x3e655a];return _0x40a6c5;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xc624('0x0'));var _=require(_0xc624('0x1'));var config=require(_0xc624('0x2'));exports[_0xc624('0x3')]=function(){return new BPromise(function(_0x297040,_0x547db8){var _0x406db7={};_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x4')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x5')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x7')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x8')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x9')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0xa')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0xb')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0xc')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/memberReport/memberReport.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0xd')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0xe')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0xf')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x10')));_0x406db7=_['merge'](_0x406db7,require('../api/mailQueue/mailQueue.rpc'));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x11')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x12')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x13')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x14')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/faxAccount/faxAccount.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x15')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/faxInteraction/faxInteraction.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x16')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x17')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/smsAccount/smsAccount.rpc'));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x18')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x19')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x1a')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x1b')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x1c')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x1d')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x1e')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x1f')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x20')));_0x406db7=_['merge'](_0x406db7,require('../api/chatMessage/chatMessage.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x21')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x22')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x23')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x24')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x25')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x26')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x27')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x28')));_0x406db7=_['merge'](_0x406db7,require('../api/pause/pause.rpc'));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x29')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x2a')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x2b')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x2c')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x2d')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x2e')));_0x406db7=_['merge'](_0x406db7,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x2f')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x30')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x31')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x32')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x33')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x34')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x35')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x36')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x37')));_0x406db7=_['merge'](_0x406db7,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x38')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x39')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x3a')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x3b')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x3c')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/attachment/attachment.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/plugin/plugin.rpc'));var _0x584f12=jayson[_0xc624('0x3d')](_0x406db7)[_0xc624('0x3e')]();var _0x2fa86c=config['rpc']['port']||config[_0xc624('0x3f')]+0x1;var _0x5f7f3a=config[_0xc624('0x40')]['ip']||'localhost';_0x584f12['on']('error',function(_0x12acf2){return _0x547db8(_0x12acf2);});_0x584f12['listen'](_0x2fa86c,_0x5f7f3a,function(){console[_0xc624('0x41')](_0xc624('0x42'),_0x5f7f3a,_0x2fa86c);require('../config/triggers')[_0xc624('0x43')]();return _0x297040('RPC\x20listening\x20on\x20'+_0x5f7f3a+':'+_0x2fa86c);});});};
\ No newline at end of file
+var _0x3148=['log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','port','rpc','error'];(function(_0x1a6ac3,_0x2c7cc1){var _0x2bc8bd=function(_0x5cf527){while(--_0x5cf527){_0x1a6ac3['push'](_0x1a6ac3['shift']());}};_0x2bc8bd(++_0x2c7cc1);}(_0x3148,0x1d3));var _0x8314=function(_0x3b045b,_0x401ddc){_0x3b045b=_0x3b045b-0x0;var _0x278d9e=_0x3148[_0x3b045b];return _0x278d9e;};'use strict';var jayson=require(_0x8314('0x0'));var BPromise=require(_0x8314('0x1'));var _=require('lodash');var config=require(_0x8314('0x2'));exports[_0x8314('0x3')]=function(){return new BPromise(function(_0x1b13ca,_0x63760b){var _0x58f818={};_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x5')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x6')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x7')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/voiceRecording/voiceRecording.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x8')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x9')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0xa')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0xb')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0xc')));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0xd')));_0x58f818=_['merge'](_0x58f818,require('../api/mailAccount/mailAccount.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0xe')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0xf')));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x10')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x11')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x12')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/faxAccount/faxAccount.rpc'));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x13')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x14')));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x15')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/faxQueue/faxQueue.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x16')));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x17')));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x18')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x19')));_0x58f818=_['merge'](_0x58f818,require('../api/smsQueue/smsQueue.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x1a')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x1b')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x1c')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x1d')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x1e')));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x1f')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x20')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x21')));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x22')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x23')));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x24')));_0x58f818=_['merge'](_0x58f818,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x25')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x26')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x27')));_0x58f818=_['merge'](_0x58f818,require('../api/template/template.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x28')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/variable/variable.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x29')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x2a')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x2b')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x2c')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x2d')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x2e')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x2f')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x30')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x31')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x32')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x33')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require('../api/squareOdbc/squareOdbc.rpc'));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x34')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x35')));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x36')));_0x58f818=_[_0x8314('0x4')](_0x58f818,require(_0x8314('0x37')));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x38')));_0x58f818=_['merge'](_0x58f818,require(_0x8314('0x39')));var _0x1d4157=jayson['server'](_0x58f818)['http']();var _0x208043=config['rpc'][_0x8314('0x3a')]||config['port']+0x1;var _0x1dc2ac=config[_0x8314('0x3b')]['ip']||'localhost';_0x1d4157['on'](_0x8314('0x3c'),function(_0x83e57a){return _0x63760b(_0x83e57a);});_0x1d4157[_0x8314('0x3')](_0x208043,_0x1dc2ac,function(){console[_0x8314('0x3d')](_0x8314('0x3e'),_0x1dc2ac,_0x208043);require(_0x8314('0x3f'))[_0x8314('0x40')]();return _0x1b13ca(_0x8314('0x41')+_0x1dc2ac+':'+_0x208043);});});};
\ No newline at end of file
diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js
index 3d2e3a6..51f75f5 100644
--- a/server/services/agi/channel.js
+++ b/server/services/agi/channel.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8281=['recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','function','write','inherits','sync','answer','ANSWER','prototype','getData','beep','sendRequest','noop','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22'];(function(_0x527452,_0x130cec){var _0x3a53a4=function(_0x320115){while(--_0x320115){_0x527452['push'](_0x527452['shift']());}};_0x3a53a4(++_0x130cec);}(_0x8281,0xab));var _0x1828=function(_0x5bae90,_0x4cfe5c){_0x5bae90=_0x5bae90-0x0;var _0x7bcd33=_0x8281[_0x5bae90];return _0x7bcd33;};'use strict';var util=require(_0x1828('0x0'));var _=require(_0x1828('0x1'));var EventEmitter=require(_0x1828('0x2'))['EventEmitter'];var AGIReply=require(_0x1828('0x3'));var AGIError=require(_0x1828('0x4'));function AGIChannel(_0x13c2bc){var _0x445f9f=this,_0x545bed=new AGIReply(),_0x2a321d=![],_0x58cc05={};EventEmitter[_0x1828('0x5')](_0x445f9f);_0x13c2bc[_0x1828('0x6')](_0x1828('0x7'));_0x13c2bc[_0x1828('0x8')](0x8*0x3c*0x3c*0x3e8);_0x545bed[_0x1828('0x6')](_0x1828('0x7'));_0x545bed['on'](_0x1828('0x9'),function(_0x195643){for(var _0x1e6f99 in _0x195643){_0x445f9f[_0x1e6f99]=_0x195643[_0x1e6f99];}_0x445f9f[_0x1828('0xa')](_0x1828('0xb'));});_0x545bed['on'](_0x1828('0xc'),function(_0x2b1b5c){if(_0x2b1b5c[_0x1828('0xd')]()==_0x1828('0xe')){_0x445f9f[_0x1828('0xa')](_0x1828('0xe'));return;}if(_0x2b1b5c[_0x1828('0xf')](0x0,0xb)==_0x1828('0x10')){_0x2a321d=!![];}if(_0x2a321d){_0x58cc05['rx']+=_0x2b1b5c+'\x0a';if(_0x2b1b5c['search'](_0x1828('0x11'))!=-0x1){_0x2a321d=![];}}else{_0x58cc05['rx']=_0x2b1b5c;}if(_0x2a321d){return;}if(typeof _0x58cc05['cb']=='function'){var _0x5cfe32=_0x58cc05['rx'][_0x1828('0xf')](0x0,0x3),_0x3e1050=null,_0x3dac7c=null;_0x5cfe32=parseInt(_0x5cfe32);if(isNaN(_0x5cfe32)){_0x58cc05['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x5cfe32!=0xc8){_0x58cc05['cb'](null,{'code':_0x5cfe32,'result':-0x1,'extra':'KO'});return;}_0x3e1050=_0x58cc05['rx'][_0x1828('0xf')](0x4)[_0x1828('0x12')](_0x1828('0x13'),'');if(_0x3e1050[_0x1828('0x14')]('\x20')!=-0x1){_0x3e1050=_0x3e1050[_0x1828('0x15')](0x0,_0x3e1050['indexOf']('\x20'));}if(_[_0x1828('0x16')](_0x3e1050,'-1')){_0x3e1050=parseInt(_0x3e1050);}_0x3dac7c=_0x58cc05['rx'][_0x1828('0x17')]('\x20');if(_0x3dac7c['length']==0x3){_0x3dac7c=_0x3dac7c[0x2]['substring'](0x1,_0x3dac7c[0x2]['length']-0x1);}else if(_0x3dac7c[_0x1828('0x18')]>0x3){var _0x703290=/\((.+)\)/;var _0x2759ea=_0x58cc05['rx'][_0x1828('0x19')](_0x703290);if(_0x2759ea){_0x3dac7c=_0x2759ea[0x1];}else{_0x3dac7c=null;}}else{_0x3dac7c=null;}_0x58cc05['cb'](null,{'code':_0x5cfe32,'result':_0x3e1050,'extra':_0x3dac7c});}});_0x13c2bc['on'](_0x1828('0x1a'),function(_0x4ad82){_0x445f9f['emit'](_0x1828('0x1a'),new AGIError(_0x1828('0x1b'),_0x4ad82[_0x1828('0x1c')]));});_0x13c2bc['on'](_0x1828('0x1d'),function(){_0x445f9f['emit'](_0x1828('0x1d'),new AGIError(_0x1828('0x1e')));});_0x13c2bc['on'](_0x1828('0x1f'),function(){_0x445f9f[_0x1828('0xa')](_0x1828('0x1f'),new AGIError(_0x1828('0x20')));_0x13c2bc[_0x1828('0x21')]();});_0x13c2bc['pipe'](_0x545bed);this[_0x1828('0x22')]=function(_0x46ac87,_0x234d8d){var _0x46ac87=_0x46ac87||'',_0x234d8d=typeof _0x234d8d==_0x1828('0x23')?_0x234d8d:new Function();_0x58cc05={'tx':_0x46ac87,'rx':'','cb':_0x234d8d};_0x13c2bc[_0x1828('0x24')](_0x46ac87+'\x0a');},this[_0x1828('0x1d')]=function(){_0x13c2bc['destroy']();};}util[_0x1828('0x25')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x3fe560){return this[_0x1828('0x22')][_0x1828('0x26')](this,_0x3fe560);};AGIChannel['prototype'][_0x1828('0x27')]=function(){return this['sendRequest'](_0x1828('0x28'));};AGIChannel[_0x1828('0x29')][_0x1828('0x2a')]=function(_0x6a4d9b,_0x3d293c,_0xd0e966){_0x6a4d9b=_0x6a4d9b===undefined?_0x1828('0x2b'):_0x6a4d9b;_0x3d293c=_0x3d293c===undefined?'5':_0x3d293c;_0xd0e966=_0xd0e966===undefined?'1':_0xd0e966;return this[_0x1828('0x2c')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x6a4d9b,_0x3d293c*0x3e8,_0xd0e966));};AGIChannel[_0x1828('0x29')][_0x1828('0x2d')]=function(_0x59eb12){_0x59eb12=_0x59eb12||'NO\x20MESSAGE';return this[_0x1828('0x2c')](util[_0x1828('0x2e')](_0x1828('0x2f'),_0x59eb12));};AGIChannel['prototype'][_0x1828('0x30')]=function(_0x4d71e4,_0x1c5d33){if(_[_0x1828('0x31')](_0x1c5d33)){return this['sendRequest'](util[_0x1828('0x2e')](_0x1828('0x32'),_0x4d71e4,_0x1c5d33[_0x1828('0x33')](',')));}return this[_0x1828('0x2c')](util[_0x1828('0x2e')]('EXEC\x20%s\x20%s',_0x4d71e4,_0x1c5d33));};AGIChannel[_0x1828('0x29')][_0x1828('0x34')]=function(_0x335e87){return this[_0x1828('0x2c')](util[_0x1828('0x2e')](_0x1828('0x35'),_0x335e87));};AGIChannel['prototype'][_0x1828('0x36')]=function(_0x349d10){return this[_0x1828('0x2c')](util['format'](_0x1828('0x37'),_0x349d10));};AGIChannel[_0x1828('0x29')]['setPriority']=function(_0x3bc858){return this[_0x1828('0x2c')](util[_0x1828('0x2e')](_0x1828('0x38'),_0x3bc858));};AGIChannel[_0x1828('0x29')]['hangup']=function(){return this[_0x1828('0x2c')](_0x1828('0x39'));};AGIChannel['prototype'][_0x1828('0x3a')]=function(_0x4c19fc,_0x2be85d){return this[_0x1828('0x2c')](util['format'](_0x1828('0x3b'),_0x4c19fc,_0x2be85d?_0x2be85d[_0x1828('0x3c')]()[_0x1828('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x1828('0x3d')]=function(_0x6b3378,_0x585c03){return this['sendRequest'](util[_0x1828('0x2e')]('SAY\x20NUMBER\x20%s\x20%s',_0x6b3378,_0x585c03));};AGIChannel[_0x1828('0x29')]['sayDigits']=function(_0x3bb87b,_0x524cb3){return this[_0x1828('0x2c')](util['format'](_0x1828('0x3e'),_0x3bb87b,_0x524cb3));};AGIChannel[_0x1828('0x29')][_0x1828('0x3f')]=function(_0xc715a0,_0x1965ad){return this['sendRequest'](util['format'](_0x1828('0x40'),_0xc715a0,_0x1965ad));};AGIChannel[_0x1828('0x29')][_0x1828('0x41')]=function(_0x43bcd3,_0x4c7acc,_0x44dcf0){_0x4c7acc=_0x4c7acc||this[_0x1828('0x42')];_0x44dcf0=_0x44dcf0||0x1;this[_0x1828('0x34')](_0x43bcd3);this[_0x1828('0x36')](_0x4c7acc);this['setPriority'](_0x44dcf0);return this[_0x1828('0x2d')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x43bcd3,_0x4c7acc,_0x44dcf0));};AGIChannel['prototype'][_0x1828('0x43')]=function(_0x51e48e){return this['sendRequest'](util[_0x1828('0x2e')](_0x1828('0x44'),_0x51e48e));};AGIChannel[_0x1828('0x29')][_0x1828('0x45')]=function(_0x905af9,_0x3d49c4,_0xd79ef5,_0x5baf65,_0x232b47,_0x59a85f){_0x3d49c4=_0x3d49c4||_0x1828('0x46');_0xd79ef5=_0xd79ef5||'';_0x5baf65=_0x5baf65===undefined?-0x1:_0x5baf65==='-1'?-0x1:_0x5baf65*0x3e8;_0x232b47=_0x232b47===undefined?'':'s='+_0x232b47;_0x59a85f=_0x59a85f?_0x1828('0x47'):'';return this[_0x1828('0x2c')](util['format'](_0x1828('0x48'),_0x905af9,_0x3d49c4,_0xd79ef5,_0x5baf65,_0x59a85f,_0x232b47));};AGIChannel[_0x1828('0x29')][_0x1828('0x49')]=function(_0x24446c,_0x352af4){_0x352af4=_0x352af4||'';return this[_0x1828('0x2c')](util[_0x1828('0x2e')](_0x1828('0x4a'),_0x24446c,_0x352af4));};AGIChannel['prototype'][_0x1828('0x4b')]=function(_0xbe1df3){return this['exec'](_0x1828('0x4c'),_0xbe1df3);};AGIChannel[_0x1828('0x29')][_0x1828('0x4d')]=function(_0x5e4096){return this[_0x1828('0x30')]('WAIT',_0x5e4096);};AGIChannel['prototype']['error']=function(_0x5de9d0,_0x268f9f){this[_0x1828('0x2d')](util[_0x1828('0x2e')](_0x1828('0x4e'),_0x5de9d0['id'],_0x5de9d0[_0x1828('0x4f')],_0x268f9f));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0xdd81=['code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','inherits','prototype','command','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','sendRequest','isArray','format','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','exec','AGI','wait','WAIT','exports','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR'];(function(_0x1170eb,_0x1e412b){var _0x53d56e=function(_0x2ed63b){while(--_0x2ed63b){_0x1170eb['push'](_0x1170eb['shift']());}};_0x53d56e(++_0x1e412b);}(_0xdd81,0xd3));var _0x1dd8=function(_0x2307e8,_0x29b61e){_0x2307e8=_0x2307e8-0x0;var _0x276d83=_0xdd81[_0x2307e8];return _0x276d83;};'use strict';var util=require('util');var _=require(_0x1dd8('0x0'));var EventEmitter=require(_0x1dd8('0x1'))[_0x1dd8('0x2')];var AGIReply=require(_0x1dd8('0x3'));var AGIError=require(_0x1dd8('0x4'));function AGIChannel(_0x4efe04){var _0x1fbf12=this,_0x255c22=new AGIReply(),_0x4fec73=![],_0x396f2d={};EventEmitter['call'](_0x1fbf12);_0x4efe04[_0x1dd8('0x5')](_0x1dd8('0x6'));_0x4efe04[_0x1dd8('0x7')](0x8*0x3c*0x3c*0x3e8);_0x255c22[_0x1dd8('0x5')](_0x1dd8('0x6'));_0x255c22['on'](_0x1dd8('0x8'),function(_0x397d53){for(var _0x5f520e in _0x397d53){_0x1fbf12[_0x5f520e]=_0x397d53[_0x5f520e];}_0x1fbf12[_0x1dd8('0x9')](_0x1dd8('0xa'));});_0x255c22['on'](_0x1dd8('0xb'),function(_0x19dbbf){if(_0x19dbbf[_0x1dd8('0xc')]()==_0x1dd8('0xd')){_0x1fbf12['emit'](_0x1dd8('0xd'));return;}if(_0x19dbbf['substring'](0x0,0xb)==_0x1dd8('0xe')){_0x4fec73=!![];}if(_0x4fec73){_0x396f2d['rx']+=_0x19dbbf+'\x0a';if(_0x19dbbf[_0x1dd8('0xf')](_0x1dd8('0x10'))!=-0x1){_0x4fec73=![];}}else{_0x396f2d['rx']=_0x19dbbf;}if(_0x4fec73){return;}if(typeof _0x396f2d['cb']==_0x1dd8('0x11')){var _0x266c6d=_0x396f2d['rx'][_0x1dd8('0x12')](0x0,0x3),_0x5881f9=null,_0x39d265=null;_0x266c6d=parseInt(_0x266c6d);if(isNaN(_0x266c6d)){_0x396f2d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1dd8('0x13')});return;}if(_0x266c6d!=0xc8){_0x396f2d['cb'](null,{'code':_0x266c6d,'result':-0x1,'extra':'KO'});return;}_0x5881f9=_0x396f2d['rx'][_0x1dd8('0x12')](0x4)['replace'](_0x1dd8('0x14'),'');if(_0x5881f9[_0x1dd8('0x15')]('\x20')!=-0x1){_0x5881f9=_0x5881f9[_0x1dd8('0x16')](0x0,_0x5881f9[_0x1dd8('0x15')]('\x20'));}if(_[_0x1dd8('0x17')](_0x5881f9,'-1')){_0x5881f9=parseInt(_0x5881f9);}_0x39d265=_0x396f2d['rx'][_0x1dd8('0x18')]('\x20');if(_0x39d265[_0x1dd8('0x19')]==0x3){_0x39d265=_0x39d265[0x2][_0x1dd8('0x12')](0x1,_0x39d265[0x2][_0x1dd8('0x19')]-0x1);}else if(_0x39d265[_0x1dd8('0x19')]>0x3){var _0x559ecd=/\((.+)\)/;var _0x1ac494=_0x396f2d['rx'][_0x1dd8('0x1a')](_0x559ecd);if(_0x1ac494){_0x39d265=_0x1ac494[0x1];}else{_0x39d265=null;}}else{_0x39d265=null;}_0x396f2d['cb'](null,{'code':_0x266c6d,'result':_0x5881f9,'extra':_0x39d265});}});_0x4efe04['on']('error',function(_0x563b2b){_0x1fbf12[_0x1dd8('0x9')](_0x1dd8('0x1b'),new AGIError(_0x1dd8('0x1c'),_0x563b2b[_0x1dd8('0x1d')]));});_0x4efe04['on'](_0x1dd8('0x1e'),function(){_0x1fbf12[_0x1dd8('0x9')](_0x1dd8('0x1e'),new AGIError(_0x1dd8('0x1f')));});_0x4efe04['on'](_0x1dd8('0x20'),function(){_0x1fbf12[_0x1dd8('0x9')](_0x1dd8('0x20'),new AGIError(_0x1dd8('0x21')));_0x4efe04[_0x1dd8('0x22')]();});_0x4efe04['pipe'](_0x255c22);this['command']=function(_0x5d44a4,_0x3e574b){var _0x5d44a4=_0x5d44a4||'',_0x3e574b=typeof _0x3e574b==_0x1dd8('0x11')?_0x3e574b:new Function();_0x396f2d={'tx':_0x5d44a4,'rx':'','cb':_0x3e574b};_0x4efe04['write'](_0x5d44a4+'\x0a');},this[_0x1dd8('0x1e')]=function(){_0x4efe04[_0x1dd8('0x22')]();};}util[_0x1dd8('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x1dd8('0x24')]['sendRequest']=function(_0x44c47a){return this[_0x1dd8('0x25')]['sync'](this,_0x44c47a);};AGIChannel['prototype'][_0x1dd8('0x26')]=function(){return this['sendRequest'](_0x1dd8('0x27'));};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x28')]=function(_0x295457,_0x4df3d5,_0x4247d3){_0x295457=_0x295457===undefined?_0x1dd8('0x29'):_0x295457;_0x4df3d5=_0x4df3d5===undefined?'5':_0x4df3d5;_0x4247d3=_0x4247d3===undefined?'1':_0x4247d3;return this['sendRequest'](util['format'](_0x1dd8('0x2a'),_0x295457,_0x4df3d5*0x3e8,_0x4247d3));};AGIChannel[_0x1dd8('0x24')]['noop']=function(_0x48b531){_0x48b531=_0x48b531||_0x1dd8('0x2b');return this[_0x1dd8('0x2c')](util['format']('VERBOSE\x20\x22%s\x22',_0x48b531));};AGIChannel['prototype']['exec']=function(_0xe2bb51,_0x46ec5c){if(_[_0x1dd8('0x2d')](_0x46ec5c)){return this[_0x1dd8('0x2c')](util[_0x1dd8('0x2e')](_0x1dd8('0x2f'),_0xe2bb51,_0x46ec5c[_0x1dd8('0x30')](',')));}return this[_0x1dd8('0x2c')](util[_0x1dd8('0x2e')]('EXEC\x20%s\x20%s',_0xe2bb51,_0x46ec5c));};AGIChannel['prototype'][_0x1dd8('0x31')]=function(_0x27a475){return this[_0x1dd8('0x2c')](util[_0x1dd8('0x2e')](_0x1dd8('0x32'),_0x27a475));};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x33')]=function(_0x5584b7){return this[_0x1dd8('0x2c')](util[_0x1dd8('0x2e')](_0x1dd8('0x34'),_0x5584b7));};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x35')]=function(_0x1270df){return this[_0x1dd8('0x2c')](util['format'](_0x1dd8('0x36'),_0x1270df));};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0xd')]=function(){return this[_0x1dd8('0x2c')](_0x1dd8('0x37'));};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x38')]=function(_0x2efaa1,_0x149c54){return this[_0x1dd8('0x2c')](util['format'](_0x1dd8('0x39'),_0x2efaa1,_0x149c54?_0x149c54['toString']()[_0x1dd8('0x3a')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x3b')]=function(_0x229c6f,_0x5a7fa5){return this[_0x1dd8('0x2c')](util[_0x1dd8('0x2e')](_0x1dd8('0x3c'),_0x229c6f,_0x5a7fa5));};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x3d')]=function(_0x4c4497,_0x28d47c){return this['sendRequest'](util[_0x1dd8('0x2e')](_0x1dd8('0x3e'),_0x4c4497,_0x28d47c));};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x3f')]=function(_0x1682d6,_0x1dbd52){return this[_0x1dd8('0x2c')](util[_0x1dd8('0x2e')](_0x1dd8('0x40'),_0x1682d6,_0x1dbd52));};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x41')]=function(_0x2d4c9a,_0x14fe0e,_0x5626aa){_0x14fe0e=_0x14fe0e||this[_0x1dd8('0x42')];_0x5626aa=_0x5626aa||0x1;this[_0x1dd8('0x31')](_0x2d4c9a);this['setExtension'](_0x14fe0e);this[_0x1dd8('0x35')](_0x5626aa);return this[_0x1dd8('0x43')](util['format'](_0x1dd8('0x44'),_0x2d4c9a,_0x14fe0e,_0x5626aa));};AGIChannel['prototype']['getVariable']=function(_0x3402d6){return this['sendRequest'](util[_0x1dd8('0x2e')](_0x1dd8('0x45'),_0x3402d6));};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x46')]=function(_0x1d978e,_0x4f3742,_0x19b255,_0x2555b4,_0x38fb15,_0x4ef5d9){_0x4f3742=_0x4f3742||_0x1dd8('0x47');_0x19b255=_0x19b255||'';_0x2555b4=_0x2555b4===undefined?-0x1:_0x2555b4==='-1'?-0x1:_0x2555b4*0x3e8;_0x38fb15=_0x38fb15===undefined?'':'s='+_0x38fb15;_0x4ef5d9=_0x4ef5d9?_0x1dd8('0x48'):'';return this[_0x1dd8('0x2c')](util[_0x1dd8('0x2e')](_0x1dd8('0x49'),_0x1d978e,_0x4f3742,_0x19b255,_0x2555b4,_0x4ef5d9,_0x38fb15));};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x4a')]=function(_0x20d68f,_0x1080ca){_0x1080ca=_0x1080ca||'';return this[_0x1dd8('0x2c')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x20d68f,_0x1080ca));};AGIChannel['prototype']['agi']=function(_0x4c0e43){return this[_0x1dd8('0x4b')](_0x1dd8('0x4c'),_0x4c0e43);};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x4d')]=function(_0x534501){return this['exec'](_0x1dd8('0x4e'),_0x534501);};AGIChannel[_0x1dd8('0x24')][_0x1dd8('0x1b')]=function(_0x1100b3,_0x254bb2){this['noop'](util[_0x1dd8('0x2e')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x1100b3['id'],_0x1100b3['label'],_0x254bb2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1dd8('0x4f')]=AGIChannel;
\ No newline at end of file
diff --git a/server/services/agi/error.js b/server/services/agi/error.js
index e4a4090..4c0632c 100644
--- a/server/services/agi/error.js
+++ b/server/services/agi/error.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf34d=['push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf34d,0x14a));var _0xdf34=function(_0x423856,_0x4f35c0){_0x423856=_0x423856-0x0;var _0x54f272=_0xf34d[_0x423856];return _0x54f272;};'use strict';var util=require(_0xdf34('0x0'));var error={'E_AGI_UNDEFINED':_0xdf34('0x1'),'E_AGI_ARGUMENT_PORT':_0xdf34('0x2'),'E_AGI_SERVER_ERROR':_0xdf34('0x3'),'E_AGI_SERVER_CLOSE':_0xdf34('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xdf34('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xdf34('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xdf34('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xdf34('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xdf34('0x9'),'E_AGI_IVR_ENTRY':_0xdf34('0xa')};function AGIError(_0x94ce6c){var _0x94ce6c=_0x94ce6c||null,_0x56d420=_0x56d420||[],_0x3a37ab=0x1,_0x117c70='';if(!error[_0x94ce6c]){_0x94ce6c=_0xdf34('0xb');}_0x56d420[_0xdf34('0xc')](error[_0x94ce6c]);while(arguments[_0x3a37ab]){_0x56d420[_0xdf34('0xc')](arguments[_0x3a37ab]);_0x3a37ab++;}_0x117c70=util[_0xdf34('0xd')][_0xdf34('0xe')](util,_0x56d420);this[_0xdf34('0xf')]=_0x117c70;this[_0xdf34('0x10')]=_0x94ce6c;}module[_0xdf34('0x11')]=AGIError;
\ No newline at end of file
+var _0x09b6=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','E_AGI_UNDEFINED','push','format','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x09b6,0x19b));var _0x609b=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0x09b6[_0x5517c0];return _0x33803b;};'use strict';var util=require(_0x609b('0x0'));var error={'E_AGI_UNDEFINED':_0x609b('0x1'),'E_AGI_ARGUMENT_PORT':_0x609b('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x609b('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x609b('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x609b('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x609b('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x609b('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x32f839){var _0x32f839=_0x32f839||null,_0x1bdc44=_0x1bdc44||[],_0xb9f550=0x1,_0x1c1497='';if(!error[_0x32f839]){_0x32f839=_0x609b('0x8');}_0x1bdc44[_0x609b('0x9')](error[_0x32f839]);while(arguments[_0xb9f550]){_0x1bdc44['push'](arguments[_0xb9f550]);_0xb9f550++;}_0x1c1497=util[_0x609b('0xa')]['apply'](util,_0x1bdc44);this[_0x609b('0xb')]=_0x1c1497;this[_0x609b('0xc')]=_0x32f839;}module['exports']=AGIError;
\ No newline at end of file
diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js
index 8a7d78f..db92783 100644
--- a/server/services/agi/graph/index.js
+++ b/server/services/agi/graph/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcecc=['target','default','agicommand','invalid','max\x20retry\x20reach','condition\x20not\x20found','lodash','agi','getsecretdigits','vertices','edges','numberOfEdges','prototype','addEdge','push','size','relations','getVertex','traverseBFS','info','length','no\x20edge/s\x20available','condition','vswitch'];(function(_0x3ccd37,_0x4a45c){var _0x48b3a1=function(_0x578964){while(--_0x578964){_0x3ccd37['push'](_0x3ccd37['shift']());}};_0x48b3a1(++_0x4a45c);}(_0xcecc,0x186));var _0xccec=function(_0x3bcd34,_0x4195fc){_0x3bcd34=_0x3bcd34-0x0;var _0x3ce925=_0xcecc[_0x3bcd34];return _0x3ce925;};'use strict';var _=require(_0xccec('0x0'));var logger=require('../../../config/logger')(_0xccec('0x1'));var verticesWithRetry=['menu','getdigits',_0xccec('0x2')];var Graph=function(){this[_0xccec('0x3')]={};this[_0xccec('0x4')]={};this[_0xccec('0x5')]=0x0;};Graph['prototype']['addVertex']=function(_0x160675){this['vertices'][_0x160675['id']]=_0x160675;this[_0xccec('0x4')][_0x160675['id']]=[];};Graph[_0xccec('0x6')][_0xccec('0x7')]=function(_0x5788aa,_0x372ea6,_0x3d7b1a){this['edges'][_0x5788aa][_0xccec('0x8')]({'target':_0x372ea6,'condition':_0x3d7b1a});this[_0xccec('0x5')]+=0x1;};Graph[_0xccec('0x6')][_0xccec('0x9')]=function(){return _['size'](this[_0xccec('0x3')]);};Graph['prototype'][_0xccec('0xa')]=function(){return this[_0xccec('0x5')];};Graph['prototype'][_0xccec('0xb')]=function(_0x1e2b5f){return this[_0xccec('0x3')][_0x1e2b5f];};Graph['prototype'][_0xccec('0xc')]=function(_0x2ac888,_0x27b36f){if(!this[_0xccec('0x3')][_0x2ac888]){return logger[_0xccec('0xd')]('no\x20vertex\x20found');}var _0x2882d9=_0x27b36f(this['vertices'][_0x2ac888]);if(!_0x2882d9){return logger['info']('stop\x20traverse');}if(this[_0xccec('0x4')][_0x2ac888][_0xccec('0xe')]===0x0){return logger[_0xccec('0xd')](_0xccec('0xf'));}for(var _0x1d588f=0x0,_0x3b8786=[],_0x7abe38=![];_0x1d588f\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','debug','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','listening','lodash','syncho','moment','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./vertices','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','name','message','[%s]\x20%s','format','[ERROR]\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','hasOwnProperty','retry','maxRetry','omit','mxCell','isArray','length','target','addEdge','value','getSquareProject','then'];(function(_0x41bd14,_0x487433){var _0x5d5d10=function(_0x92374e){while(--_0x92374e){_0x41bd14['push'](_0x41bd14['shift']());}};_0x5d5d10(++_0x487433);}(_0x7b00,0x125));var _0x07b0=function(_0x366067,_0x3f8f22){_0x366067=_0x366067-0x0;var _0x363cd7=_0x7b00[_0x366067];return _0x363cd7;};'use strict';var parser=require('xml2json');var _=require(_0x07b0('0x0'));var syncho=require(_0x07b0('0x1'));var util=require('util');var moment=require(_0x07b0('0x2'));var config=require(_0x07b0('0x3'));var logger=require('../../config/logger')(_0x07b0('0x4'));var utilLicense=require(_0x07b0('0x5'));var rpc=require(_0x07b0('0x6'));var mailRpc=require(_0x07b0('0x7'));var Graph=require('./graph');var Vertices=require(_0x07b0('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x07b0('0x4')]=_['defaults'](config[_0x07b0('0x4')],{'ip':_0x07b0('0x9'),'port':0x11dd});function connectionHandler(_0x43ac6d){process[_0x07b0('0xa')](function(){syncho(function(){try{setChannelVariables(_0x43ac6d);agiHandler(_0x43ac6d);}catch(_0x40dc82){logger[_0x07b0('0xb')](_0x40dc82[_0x07b0('0xc')]);}});});}function listeningHandler(){console['log'](_0x07b0('0xd'),config[_0x07b0('0x4')][_0x07b0('0xe')]);logger[_0x07b0('0xf')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi']['port']));}function errorHandler(_0x5d3296){if(_0x5d3296&&_0x5d3296[_0x07b0('0x10')]&&_0x5d3296[_0x07b0('0x11')]){logger['error'](util['format'](_0x07b0('0x12'),_0x5d3296['name'],_0x5d3296[_0x07b0('0x11')]));}else{logger['error'](util[_0x07b0('0x13')](_0x07b0('0x14'),_0x5d3296[_0x07b0('0xc')]));}}function closeHandler(){logger[_0x07b0('0xf')](util[_0x07b0('0x13')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x07b0('0x15')],this[_0x07b0('0x16')],this[_0x07b0('0x17')],this[_0x07b0('0x18')],this[_0x07b0('0x19')]));try{createSquareReport(this);}catch(_0xfdc024){logger[_0x07b0('0xb')](_0xfdc024[_0x07b0('0xc')]);}}function timeoutHandler(){logger['info'](util[_0x07b0('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x07b0('0x15')],this['calleridname'],this[_0x07b0('0x17')],this[_0x07b0('0x18')],this[_0x07b0('0x19')]));}function hangupHandler(){logger[_0x07b0('0xf')](util['format'](_0x07b0('0x1a'),this['arg_1'],this['calleridname'],this[_0x07b0('0x17')],this['dnid'],this['uniqueid']));this[_0x07b0('0x1b')]=!![];}function getRoot(_0x3a37b9){return parser[_0x07b0('0x1c')](_0x3a37b9,{'object':!![]})[_0x07b0('0x1d')][_0x07b0('0x1e')];}function addVertex(_0x50498a,_0x14f568,_0x24703a){_0x14f568['agicommand']=_0x24703a;if(_0x14f568[_0x07b0('0x1f')](_0x07b0('0x20'))){_0x14f568[_0x07b0('0x21')]=parseInt(_0x14f568['retry'],0xa);}_0x50498a['addVertex'](_[_0x07b0('0x22')](_0x14f568,_0x07b0('0x23')));}function initGraph(_0x4b912a,_0x144b88){var _0xc4f8a7=new Graph();for(var _0x3dd217 in _0x4b912a){if(_0x4b912a[_0x07b0('0x1f')](_0x3dd217)){if(_[_0x07b0('0x24')](_0x4b912a[_0x3dd217])){for(var _0x3927f6=0x0;_0x3927f6<_0x4b912a[_0x3dd217][_0x07b0('0x25')];_0x3927f6+=0x1){addVertex(_0xc4f8a7,_0x4b912a[_0x3dd217][_0x3927f6],_0x3dd217);}}else{addVertex(_0xc4f8a7,_0x4b912a[_0x3dd217],_0x3dd217);}}}for(var _0x4d69bb=0x0;_0x4d69bb<_0x144b88[_0x07b0('0x25')];_0x4d69bb+=0x1){if(_0x144b88[_0x4d69bb]['source']&&_0x144b88[_0x4d69bb][_0x07b0('0x26')]){_0xc4f8a7[_0x07b0('0x27')](_0x144b88[_0x4d69bb]['source'],_0x144b88[_0x4d69bb][_0x07b0('0x26')],_0x144b88[_0x4d69bb][_0x07b0('0x28')]);}}return _0xc4f8a7;}function getSquareProject(_0x45c48f,_0x47e9ad){rpc[_0x07b0('0x29')](_0x45c48f)[_0x07b0('0x2a')](function(_0x2b4e75){_0x47e9ad(null,_0x2b4e75);})['catch'](function(_0x2d9fa0){_0x47e9ad(null,_0x2d9fa0);});}function createSquareReport(_0x3dcefa,_0x20a7c3){rpc[_0x07b0('0x2b')](_0x3dcefa)['then'](function(_0x2b4841){if(_0x20a7c3){_0x20a7c3(null,_0x2b4841);}})[_0x07b0('0x2c')](function(_0x5a6748){if(_0x20a7c3){_0x20a7c3(null,_0x5a6748);}});}function setChannelVariables(_0x1b8994){for(var _0x353a20 in _0x1b8994){if(_0x1b8994['hasOwnProperty'](_0x353a20)){if(_0x353a20[_0x07b0('0x2d')]('agi_')===0x0){_0x1b8994[_0x353a20[_0x07b0('0x2e')](0x4)]=_0x1b8994[_0x353a20];delete _0x1b8994[_0x353a20];}}}}function getLogFromObject(_0x1b1f41){return util['inspect'](_0x1b1f41,{'showHidden':![],'depth':null});}function agiHandler(_0xcf17ca){var _0x55fbcb,_0x3ab3f1,_0x1878fd,_0x3d7498,_0x4d9812;logger['debug']('variables',JSON[_0x07b0('0x2f')](_0xcf17ca,null,0x2));logger[_0x07b0('0xf')](util['format'](_0x07b0('0x30'),_0xcf17ca[_0x07b0('0x15')],_0xcf17ca['calleridname'],_0xcf17ca['callerid'],_0xcf17ca[_0x07b0('0x18')],_0xcf17ca[_0x07b0('0x19')]));_0xcf17ca['on'](_0x07b0('0xb'),errorHandler);_0xcf17ca['on'](_0x07b0('0x31'),closeHandler);_0xcf17ca['on'](_0x07b0('0x32'),timeoutHandler);_0xcf17ca[_0x07b0('0x1b')]=![];_0xcf17ca['on']('hangup',hangupHandler);var _0x541066=getSquareProject[_0x07b0('0x33')](null,_0xcf17ca['arg_1']);if(_0x541066){if(_0x541066[_0x07b0('0x34')]){_0x55fbcb=getRoot(_0x541066[_0x07b0('0x34')]);if(_0x55fbcb&&_0x55fbcb[_0x07b0('0x35')]){logger['debug']('root',JSON[_0x07b0('0x2f')](_0x55fbcb,null,0x2));_0xcf17ca[_0x07b0('0x36')]=moment()[_0x07b0('0x13')](_0x07b0('0x37'));_0x3ab3f1=initGraph(_[_0x07b0('0x22')](_0x55fbcb,_0x07b0('0x23')),_0x55fbcb[_0x07b0('0x23')]);_0x1878fd=new Vertices(_0xcf17ca,rpc,mailRpc);logger[_0x07b0('0xf')](util[_0x07b0('0x13')](_0x07b0('0x38'),_0xcf17ca[_0x07b0('0x15')],_0xcf17ca[_0x07b0('0x16')],_0xcf17ca[_0x07b0('0x17')],_0xcf17ca[_0x07b0('0x18')],_0xcf17ca[_0x07b0('0x19')]));_0x3ab3f1['traverseBFS'](_0x55fbcb[_0x07b0('0x35')]['id'],function(_0x355aba){try{_0x355aba=_0x1878fd[_0x07b0('0x39')](_0x355aba);logger[_0x07b0('0x3a')]('vertex',JSON[_0x07b0('0x2f')](_0x355aba,null,0x2));if(_0x355aba[_0x07b0('0x3b')]===_0x07b0('0x3c')){logger[_0x07b0('0xf')](_0x07b0('0x3d'));_0xcf17ca[_0x07b0('0x3e')]=_0x355aba[_0x07b0('0x3e')]||_0xcf17ca[_0x07b0('0x3e')];_0xcf17ca[_0x07b0('0x3f')]=_0x355aba['extension'];_0xcf17ca[_0x07b0('0x40')]=_0x355aba['priority']?_0x355aba[_0x07b0('0x40')]-0x1:0x1;return null;}else if(_0x355aba&&_0x1878fd[_0x355aba[_0x07b0('0x3b')]]){_0x4d9812=_0x1878fd[_0x355aba[_0x07b0('0x3b')]](_0x355aba);logger[_0x07b0('0xf')](_0x07b0('0x41'),JSON['stringify'](_0x4d9812,null,0x2));if(_0x4d9812&&_0x4d9812[_0x07b0('0x42')]===AGI_CODE_SUCCESS&&_0x4d9812[_0x07b0('0x43')]!==AGI_RESULT_ERROR&&!_0xcf17ca[_0x07b0('0x1b')]){logger[_0x07b0('0x3a')]('response',getLogFromObject(_0x4d9812));return _[_0x07b0('0x44')](_0x4d9812[_0x07b0('0x43')])?null:_0x4d9812['result'][_0x07b0('0x45')]();}else{logger['error']('response',getLogFromObject(_0x4d9812));return null;}}else{logger[_0x07b0('0xb')](_0x07b0('0x46'));return null;}}catch(_0x3198af){logger[_0x07b0('0xb')](_0x3198af[_0x07b0('0xc')]);return null;}});if(_0x55fbcb[_0x07b0('0x47')]){logger['info'](util['format'](_0x07b0('0x48'),_0xcf17ca[_0x07b0('0x15')],_0xcf17ca[_0x07b0('0x16')],_0xcf17ca[_0x07b0('0x17')],_0xcf17ca[_0x07b0('0x18')],_0xcf17ca[_0x07b0('0x19')]));_0x3ab3f1[_0x07b0('0x49')](_0x55fbcb[_0x07b0('0x47')]['id'],function(_0x950691){try{_0x950691=_0x1878fd[_0x07b0('0x39')](_0x950691);logger['debug'](_0x07b0('0x4a'),JSON[_0x07b0('0x2f')](_0x950691,null,0x2));if(_0x950691&&_0x1878fd[_0x950691[_0x07b0('0x3b')]]){_0x4d9812=_0x1878fd[_0x950691[_0x07b0('0x3b')]](_0x950691);if(_0x4d9812){logger['debug'](_0x07b0('0x41'),getLogFromObject(_0x4d9812));return _[_0x07b0('0x44')](_0x4d9812[_0x07b0('0x43')])?null:_0x4d9812[_0x07b0('0x43')][_0x07b0('0x45')]();}else{logger[_0x07b0('0xb')](_0x07b0('0x41'),getLogFromObject(_0x4d9812));return null;}}else{logger[_0x07b0('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x4fa237){logger['error'](_0x4fa237[_0x07b0('0xc')]);return null;}});}logger[_0x07b0('0xf')](util[_0x07b0('0x13')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xcf17ca[_0x07b0('0x15')],_0xcf17ca[_0x07b0('0x16')],_0xcf17ca[_0x07b0('0x17')],_0xcf17ca['dnid'],_0xcf17ca[_0x07b0('0x19')]));logger['info'](util[_0x07b0('0x13')](_0x07b0('0x4b'),_0xcf17ca[_0x07b0('0x3e')],_0xcf17ca[_0x07b0('0x3f')],parseInt(_0xcf17ca[_0x07b0('0x40')],0xa)+0x1));_0xcf17ca['continueAt'](_0xcf17ca[_0x07b0('0x3e')],_0xcf17ca['extension'],parseInt(_0xcf17ca[_0x07b0('0x40')],0xa)+0x1);_0xcf17ca[_0x07b0('0x31')]();}}else{logger['error'](util[_0x07b0('0x13')](_0x07b0('0x4c'),_0xcf17ca[_0x07b0('0x15')]));_0xcf17ca['continueAt'](_0xcf17ca['context'],_0xcf17ca[_0x07b0('0x3f')],parseInt(_0xcf17ca['priority'],0xa)+0x1);_0xcf17ca[_0x07b0('0x31')]();}}else{logger['error'](util[_0x07b0('0x13')]('Project\x20%s\x20not\x20found',_0xcf17ca['arg_1']));_0xcf17ca[_0x07b0('0x4d')](_0xcf17ca[_0x07b0('0x3e')],_0xcf17ca['extension'],parseInt(_0xcf17ca['priority'],0xa)+0x1);_0xcf17ca[_0x07b0('0x31')]();}}function main(){var _0x4c1413;return utilLicense[_0x07b0('0x4e')]()[_0x07b0('0x2a')](function(_0x4e58c9){if(_0x4e58c9){if(_0x4e58c9[_0x07b0('0x4f')]){if(_0x4e58c9[_0x07b0('0x50')]&&_0x4e58c9['callysquare']>0x0){logger[_0x07b0('0xf')](util[_0x07b0('0x13')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4e58c9[_0x07b0('0x50')]));_0x4c1413=_0x4e58c9[_0x07b0('0x50')];}else{logger['info'](_0x07b0('0x51'));}}else{logger[_0x07b0('0xf')](_0x07b0('0x52'));_0x4c1413=-0x1;}}})[_0x07b0('0x2c')](function(_0xf99e19){logger['error']('[LICENSE]',_0xf99e19['stack']);})['finally'](function(){var _0x19499e=require('./server')(config[_0x07b0('0x4')]['port'],config['agi']['ip'],_0x4c1413);_0x19499e['on'](_0x07b0('0xb'),errorHandler);_0x19499e['on'](_0x07b0('0x53'),listeningHandler);_0x19499e['on']('connection',connectionHandler);_0x19499e['on'](_0x07b0('0x31'),closeHandler);});}main();
\ No newline at end of file
+var _0xe497=['close','timeout','hangup','sync','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','context','extension','priority','code','result','response','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','connection','xml2json','lodash','util','moment','../../config/environment','../../config/logger','../../config/license/util','./mailRpc','./graph','agi','defaults','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','maxRetry','addVertex','isArray','length','source','target','addEdge','getSquareProject','catch','createSquareReport','then','agi_','debug','variables','stringify'];(function(_0x152405,_0x5e8952){var _0x46647a=function(_0x4608b5){while(--_0x4608b5){_0x152405['push'](_0x152405['shift']());}};_0x46647a(++_0x5e8952);}(_0xe497,0x1d8));var _0x7e49=function(_0x4677de,_0x1a12ca){_0x4677de=_0x4677de-0x0;var _0x3a3701=_0xe497[_0x4677de];return _0x3a3701;};'use strict';var parser=require(_0x7e49('0x0'));var _=require(_0x7e49('0x1'));var syncho=require('syncho');var util=require(_0x7e49('0x2'));var moment=require(_0x7e49('0x3'));var config=require(_0x7e49('0x4'));var logger=require(_0x7e49('0x5'))('agi');var utilLicense=require(_0x7e49('0x6'));var rpc=require('./rpc');var mailRpc=require(_0x7e49('0x7'));var Graph=require(_0x7e49('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x7e49('0x9')]=_[_0x7e49('0xa')](config[_0x7e49('0x9')],{'ip':_0x7e49('0xb'),'port':0x11dd});function connectionHandler(_0x19ac40){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x19ac40);agiHandler(_0x19ac40);}catch(_0x41bd11){logger[_0x7e49('0xc')](_0x41bd11[_0x7e49('0xd')]);}});});}function listeningHandler(){console[_0x7e49('0xe')](_0x7e49('0xf'),config['agi'][_0x7e49('0x10')]);logger[_0x7e49('0x11')](util[_0x7e49('0x12')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x7e49('0x9')]['ip'],config['agi'][_0x7e49('0x10')]));}function errorHandler(_0x35798d){if(_0x35798d&&_0x35798d[_0x7e49('0x13')]&&_0x35798d[_0x7e49('0x14')]){logger[_0x7e49('0xc')](util[_0x7e49('0x12')]('[%s]\x20%s',_0x35798d[_0x7e49('0x13')],_0x35798d[_0x7e49('0x14')]));}else{logger[_0x7e49('0xc')](util[_0x7e49('0x12')](_0x7e49('0x15'),_0x35798d[_0x7e49('0xd')]));}}function closeHandler(){logger[_0x7e49('0x11')](util['format'](_0x7e49('0x16'),this[_0x7e49('0x17')],this['calleridname'],this[_0x7e49('0x18')],this['dnid'],this[_0x7e49('0x19')]));try{createSquareReport(this);}catch(_0x29901e){logger[_0x7e49('0xc')](_0x29901e[_0x7e49('0xd')]);}}function timeoutHandler(){logger[_0x7e49('0x11')](util[_0x7e49('0x12')](_0x7e49('0x1a'),this[_0x7e49('0x17')],this[_0x7e49('0x1b')],this['callerid'],this[_0x7e49('0x1c')],this[_0x7e49('0x19')]));}function hangupHandler(){logger[_0x7e49('0x11')](util['format'](_0x7e49('0x1d'),this['arg_1'],this[_0x7e49('0x1b')],this[_0x7e49('0x18')],this[_0x7e49('0x1c')],this[_0x7e49('0x19')]));this[_0x7e49('0x1e')]=!![];}function getRoot(_0x3db16f){return parser[_0x7e49('0x1f')](_0x3db16f,{'object':!![]})[_0x7e49('0x20')]['root'];}function addVertex(_0x548598,_0x51e4f2,_0xaee8a5){_0x51e4f2[_0x7e49('0x21')]=_0xaee8a5;if(_0x51e4f2[_0x7e49('0x22')]('retry')){_0x51e4f2[_0x7e49('0x23')]=parseInt(_0x51e4f2['retry'],0xa);}_0x548598[_0x7e49('0x24')](_['omit'](_0x51e4f2,'mxCell'));}function initGraph(_0x479eeb,_0x4bfd55){var _0x42adcc=new Graph();for(var _0x32dc2b in _0x479eeb){if(_0x479eeb[_0x7e49('0x22')](_0x32dc2b)){if(_[_0x7e49('0x25')](_0x479eeb[_0x32dc2b])){for(var _0x52f800=0x0;_0x52f800<_0x479eeb[_0x32dc2b][_0x7e49('0x26')];_0x52f800+=0x1){addVertex(_0x42adcc,_0x479eeb[_0x32dc2b][_0x52f800],_0x32dc2b);}}else{addVertex(_0x42adcc,_0x479eeb[_0x32dc2b],_0x32dc2b);}}}for(var _0x6906be=0x0;_0x6906be<_0x4bfd55[_0x7e49('0x26')];_0x6906be+=0x1){if(_0x4bfd55[_0x6906be][_0x7e49('0x27')]&&_0x4bfd55[_0x6906be][_0x7e49('0x28')]){_0x42adcc[_0x7e49('0x29')](_0x4bfd55[_0x6906be]['source'],_0x4bfd55[_0x6906be][_0x7e49('0x28')],_0x4bfd55[_0x6906be]['value']);}}return _0x42adcc;}function getSquareProject(_0x5da85d,_0x39e69d){rpc[_0x7e49('0x2a')](_0x5da85d)['then'](function(_0x5d35ca){_0x39e69d(null,_0x5d35ca);})[_0x7e49('0x2b')](function(_0x106497){_0x39e69d(null,_0x106497);});}function createSquareReport(_0x313ee1,_0x344366){rpc[_0x7e49('0x2c')](_0x313ee1)[_0x7e49('0x2d')](function(_0xb9ba1e){if(_0x344366){_0x344366(null,_0xb9ba1e);}})[_0x7e49('0x2b')](function(_0x200261){if(_0x344366){_0x344366(null,_0x200261);}});}function setChannelVariables(_0x4d0844){for(var _0x13eda3 in _0x4d0844){if(_0x4d0844[_0x7e49('0x22')](_0x13eda3)){if(_0x13eda3['indexOf'](_0x7e49('0x2e'))===0x0){_0x4d0844[_0x13eda3['substring'](0x4)]=_0x4d0844[_0x13eda3];delete _0x4d0844[_0x13eda3];}}}}function getLogFromObject(_0x99232a){return util['inspect'](_0x99232a,{'showHidden':![],'depth':null});}function agiHandler(_0x44b4db){var _0x3807bc,_0x2396fe,_0x1201f7,_0x5a435f,_0x24a2ef;logger[_0x7e49('0x2f')](_0x7e49('0x30'),JSON[_0x7e49('0x31')](_0x44b4db,null,0x2));logger[_0x7e49('0x11')](util[_0x7e49('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x44b4db[_0x7e49('0x17')],_0x44b4db[_0x7e49('0x1b')],_0x44b4db[_0x7e49('0x18')],_0x44b4db[_0x7e49('0x1c')],_0x44b4db['uniqueid']));_0x44b4db['on'](_0x7e49('0xc'),errorHandler);_0x44b4db['on'](_0x7e49('0x32'),closeHandler);_0x44b4db['on'](_0x7e49('0x33'),timeoutHandler);_0x44b4db[_0x7e49('0x1e')]=![];_0x44b4db['on'](_0x7e49('0x34'),hangupHandler);var _0x3fd563=getSquareProject[_0x7e49('0x35')](null,_0x44b4db['arg_1']);if(_0x3fd563){if(_0x3fd563[_0x7e49('0x36')]){_0x3807bc=getRoot(_0x3fd563['production']);if(_0x3807bc&&_0x3807bc[_0x7e49('0x37')]){logger[_0x7e49('0x2f')](_0x7e49('0x38'),JSON['stringify'](_0x3807bc,null,0x2));_0x44b4db[_0x7e49('0x39')]=moment()['format'](_0x7e49('0x3a'));_0x2396fe=initGraph(_['omit'](_0x3807bc,_0x7e49('0x3b')),_0x3807bc[_0x7e49('0x3b')]);_0x1201f7=new Vertices(_0x44b4db,rpc,mailRpc);logger[_0x7e49('0x11')](util[_0x7e49('0x12')](_0x7e49('0x3c'),_0x44b4db[_0x7e49('0x17')],_0x44b4db[_0x7e49('0x1b')],_0x44b4db[_0x7e49('0x18')],_0x44b4db['dnid'],_0x44b4db[_0x7e49('0x19')]));_0x2396fe[_0x7e49('0x3d')](_0x3807bc['start']['id'],function(_0x408b6e){try{_0x408b6e=_0x1201f7[_0x7e49('0x3e')](_0x408b6e);logger[_0x7e49('0x2f')](_0x7e49('0x3f'),JSON['stringify'](_0x408b6e,null,0x2));if(_0x408b6e[_0x7e49('0x21')]===_0x7e49('0x40')){logger[_0x7e49('0x11')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x44b4db[_0x7e49('0x41')]=_0x408b6e[_0x7e49('0x41')]||_0x44b4db[_0x7e49('0x41')];_0x44b4db['extension']=_0x408b6e[_0x7e49('0x42')];_0x44b4db['priority']=_0x408b6e[_0x7e49('0x43')]?_0x408b6e[_0x7e49('0x43')]-0x1:0x1;return null;}else if(_0x408b6e&&_0x1201f7[_0x408b6e['agicommand']]){_0x24a2ef=_0x1201f7[_0x408b6e[_0x7e49('0x21')]](_0x408b6e);logger[_0x7e49('0x11')]('response',JSON[_0x7e49('0x31')](_0x24a2ef,null,0x2));if(_0x24a2ef&&_0x24a2ef[_0x7e49('0x44')]===AGI_CODE_SUCCESS&&_0x24a2ef[_0x7e49('0x45')]!==AGI_RESULT_ERROR&&!_0x44b4db[_0x7e49('0x1e')]){logger['debug'](_0x7e49('0x46'),getLogFromObject(_0x24a2ef));return _['isUndefined'](_0x24a2ef['result'])?null:_0x24a2ef['result'][_0x7e49('0x47')]();}else{logger[_0x7e49('0xc')](_0x7e49('0x46'),getLogFromObject(_0x24a2ef));return null;}}else{logger[_0x7e49('0xc')](_0x7e49('0x48'));return null;}}catch(_0x4222e7){logger['error'](_0x4222e7[_0x7e49('0xd')]);return null;}});if(_0x3807bc[_0x7e49('0x49')]){logger['info'](util[_0x7e49('0x12')](_0x7e49('0x4a'),_0x44b4db[_0x7e49('0x17')],_0x44b4db[_0x7e49('0x1b')],_0x44b4db[_0x7e49('0x18')],_0x44b4db['dnid'],_0x44b4db[_0x7e49('0x19')]));_0x2396fe[_0x7e49('0x3d')](_0x3807bc[_0x7e49('0x49')]['id'],function(_0x3aefe5){try{_0x3aefe5=_0x1201f7[_0x7e49('0x3e')](_0x3aefe5);logger[_0x7e49('0x2f')](_0x7e49('0x3f'),JSON[_0x7e49('0x31')](_0x3aefe5,null,0x2));if(_0x3aefe5&&_0x1201f7[_0x3aefe5['agicommand']]){_0x24a2ef=_0x1201f7[_0x3aefe5[_0x7e49('0x21')]](_0x3aefe5);if(_0x24a2ef){logger[_0x7e49('0x2f')](_0x7e49('0x46'),getLogFromObject(_0x24a2ef));return _[_0x7e49('0x4b')](_0x24a2ef[_0x7e49('0x45')])?null:_0x24a2ef[_0x7e49('0x45')][_0x7e49('0x47')]();}else{logger['error']('response',getLogFromObject(_0x24a2ef));return null;}}else{logger[_0x7e49('0xc')](_0x7e49('0x48'));return null;}}catch(_0x27b035){logger[_0x7e49('0xc')](_0x27b035[_0x7e49('0xd')]);return null;}});}logger['info'](util[_0x7e49('0x12')](_0x7e49('0x4c'),_0x44b4db[_0x7e49('0x17')],_0x44b4db[_0x7e49('0x1b')],_0x44b4db[_0x7e49('0x18')],_0x44b4db['dnid'],_0x44b4db['uniqueid']));logger['info'](util[_0x7e49('0x12')](_0x7e49('0x4d'),_0x44b4db[_0x7e49('0x41')],_0x44b4db[_0x7e49('0x42')],parseInt(_0x44b4db['priority'],0xa)+0x1));_0x44b4db[_0x7e49('0x4e')](_0x44b4db['context'],_0x44b4db[_0x7e49('0x42')],parseInt(_0x44b4db[_0x7e49('0x43')],0xa)+0x1);_0x44b4db[_0x7e49('0x32')]();}}else{logger[_0x7e49('0xc')](util[_0x7e49('0x12')](_0x7e49('0x4f'),_0x44b4db[_0x7e49('0x17')]));_0x44b4db[_0x7e49('0x4e')](_0x44b4db[_0x7e49('0x41')],_0x44b4db[_0x7e49('0x42')],parseInt(_0x44b4db['priority'],0xa)+0x1);_0x44b4db[_0x7e49('0x32')]();}}else{logger['error'](util[_0x7e49('0x12')](_0x7e49('0x50'),_0x44b4db[_0x7e49('0x17')]));_0x44b4db['continueAt'](_0x44b4db['context'],_0x44b4db['extension'],parseInt(_0x44b4db[_0x7e49('0x43')],0xa)+0x1);_0x44b4db[_0x7e49('0x32')]();}}function main(){var _0x283c87;return utilLicense[_0x7e49('0x51')]()['then'](function(_0x5dff2e){if(_0x5dff2e){if(_0x5dff2e[_0x7e49('0x52')]){if(_0x5dff2e[_0x7e49('0x53')]&&_0x5dff2e[_0x7e49('0x53')]>0x0){logger[_0x7e49('0x11')](util[_0x7e49('0x12')](_0x7e49('0x54'),_0x5dff2e[_0x7e49('0x53')]));_0x283c87=_0x5dff2e[_0x7e49('0x53')];}else{logger[_0x7e49('0x11')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x7e49('0x11')](_0x7e49('0x55'));_0x283c87=-0x1;}}})[_0x7e49('0x2b')](function(_0x411d36){logger['error']('[LICENSE]',_0x411d36[_0x7e49('0xd')]);})[_0x7e49('0x49')](function(){var _0x2f7825=require('./server')(config['agi'][_0x7e49('0x10')],config[_0x7e49('0x9')]['ip'],_0x283c87);_0x2f7825['on'](_0x7e49('0xc'),errorHandler);_0x2f7825['on']('listening',listeningHandler);_0x2f7825['on'](_0x7e49('0x56'),connectionHandler);_0x2f7825['on'](_0x7e49('0x32'),closeHandler);});}main();
\ No newline at end of file
diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js
index 0f9afc5..6c1a3dc 100644
--- a/server/services/agi/mailRpc/index.js
+++ b/server/services/agi/mailRpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x5b8b3f,_0x4900c0){var _0x416d54=function(_0x37309c){while(--_0x37309c){_0x5b8b3f['push'](_0x5b8b3f['shift']());}};_0x416d54(++_0x4900c0);}(_0x814b,0x1a2));var _0xb814=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0x814b[_0x3ef2d5];return _0x2fefb2;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});};
\ No newline at end of file
+var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x4b4427,_0x261402){var _0x812a28=function(_0x409a8c){while(--_0x409a8c){_0x4b4427['push'](_0x4b4427['shift']());}};_0x812a28(++_0x261402);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js
index 0a7826a..c958fbf 100644
--- a/server/services/agi/reply.js
+++ b/server/services/agi/reply.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xb10b,0x12a));var _0xbb10=function(_0x173336,_0x3f98c4){_0x173336=_0x173336-0x0;var _0x12dc79=_0xb10b[_0x173336];return _0x12dc79;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply;
\ No newline at end of file
+var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x2b9316,_0x26a84f){var _0x27fc1d=function(_0x18ca01){while(--_0x18ca01){_0x2b9316['push'](_0x2b9316['shift']());}};_0x27fc1d(++_0x26a84f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1a7715,_0x144a22){_0x1a7715=_0x1a7715-0x0;var _0x349362=_0x5f2f[_0x1a7715];return _0x349362;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply;
\ No newline at end of file
diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js
index fa01994..408e983 100644
--- a/server/services/agi/rpc/index.js
+++ b/server/services/agi/rpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x79b0=['then','error','message','result','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','phone','ListId','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','client','request'];(function(_0xc7c8e9,_0x4dabea){var _0xc65a78=function(_0x33b1dc){while(--_0x33b1dc){_0xc7c8e9['push'](_0xc7c8e9['shift']());}};_0xc65a78(++_0x4dabea);}(_0x79b0,0x9f));var _0x079b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x79b0[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require(_0x079b('0x0'));var moment=require(_0x079b('0x1'));var _=require(_0x079b('0x2'));var util=require(_0x079b('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x079b('0x4')]['http']({'port':0x2329});function request(_0x64d916,_0x5786bb){return new BPromise(function(_0x347d2c,_0x7f276c){return client[_0x079b('0x5')](_0x64d916,_0x5786bb)[_0x079b('0x6')](function(_0x355332){if(_0x355332[_0x079b('0x7')]){return _0x7f276c(_0x355332[_0x079b('0x7')][_0x079b('0x8')]);}else{return _0x347d2c(_0x355332[_0x079b('0x9')]);}})['catch'](function(_0x27a3ca){return _0x7f276c(_0x27a3ca);});});}exports[_0x079b('0xa')]=function(_0x15315a){return request(_0x079b('0xb'),{'options':{'raw':![],'where':{'name':_0x15315a},'attributes':['production']}});};exports[_0x079b('0xc')]=function(_0x14a2fa){return request(_0x079b('0xd'),{'options':{'raw':![],'where':{'id':_0x14a2fa},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x079b('0xe'),'email']}});};exports[_0x079b('0xf')]=function(_0x41c7e1){return request(_0x079b('0xb'),{'options':{'where':{'id':_0x41c7e1},'attributes':[_0x079b('0xe')]}});};exports[_0x079b('0x10')]=function(_0x5f2580){return request(_0x079b('0x11'),{'options':{'where':{'id':_0x5f2580},'attributes':['name']}});};exports['getVariableById']=function(_0x387c45){return request(_0x079b('0x12'),{'options':{'where':{'id':_0x387c45},'attributes':['name']}});};exports[_0x079b('0x13')]=function(_0x4529cc){return request(_0x079b('0x14'),{'options':{'where':{'id':_0x4529cc},'attributes':[_0x079b('0x15')]}});};exports[_0x079b('0x16')]=function(_0x25b51b){return request(_0x079b('0x17'),{'options':{'where':{'id':_0x25b51b},'attributes':['name']}});};exports[_0x079b('0x18')]=function(_0x289d2e){return request(_0x079b('0x19'),{'options':{'where':{'id':_0x289d2e},'attributes':[_0x079b('0xe')]}});};exports['getSoundById']=function(_0x52bba5){return request(_0x079b('0x1a'),{'options':{'where':{'id':_0x52bba5},'attributes':[_0x079b('0x1b')]}});};exports[_0x079b('0x1c')]=function(_0x4f8a8d){return request(_0x079b('0x1d'),{'options':{'raw':![],'where':{'id':_0x4f8a8d},'include':[{'model':_0x079b('0x1e'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0xfc5ddb){return request(_0x079b('0x1f'),{'options':{'where':{'id':_0xfc5ddb},'attributes':['id',_0x079b('0xe')]}});};exports[_0x079b('0x20')]=function(_0x479b38){return request(_0x079b('0x21'),{'body':_0x479b38});};exports['createSquareDetailsReport']=function(_0x125fc2){return request(_0x079b('0x22'),{'body':_0x125fc2});};exports['createSquareReport']=function(_0x5cdff6){return request(_0x079b('0x23'),{'body':_[_0x079b('0x24')](_0x5cdff6,{'project_name':_0x5cdff6[_0x079b('0x25')],'prev_project_name':_0x5cdff6[_0x079b('0x26')]||'','is_subproject':_0x5cdff6[_0x079b('0x26')]?!![]:![],'leaveAt':moment()[_0x079b('0x27')](_0x079b('0x28'))})});};exports['createSquareRecording']=function(_0x1c6630){return request(_0x079b('0x29'),{'body':_0x1c6630});};exports[_0x079b('0x2a')]=function(_0x38a10f){return request(_0x079b('0x2b'),{'body':_0x38a10f});};exports['createCmContact']=function(_0x2ae6e7){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x2ae6e7[_0x079b('0x2c')],'ListId':_0x2ae6e7[_0x079b('0x2d')]}}})[_0x079b('0x6')](function(_0x3de50f){if(_0x3de50f){return _0x3de50f;}return request('CreateCmContact',{'body':_0x2ae6e7});});};exports[_0x079b('0x2e')]=function(_0x3675d8){return request('ShowPause',{'options':{'where':{'id':_0x3675d8},'attributes':['name']}});};exports[_0x079b('0x2f')]=function(_0x2f7b02,_0x383b6a){return request(_0x079b('0x30'),{'body':{'interface':_0x383b6a},'options':{'where':_0x2f7b02}});};exports[_0x079b('0x31')]=function(_0x33d26a,_0x337714,_0x4130b9){return request(_0x079b('0x32'),{'body':{'type':_0x337714,'uniqueid':_0x4130b9},'options':{'where':_0x33d26a}});};exports[_0x079b('0x33')]=function(_0x43faa2){return request(_0x079b('0x34'),{'body':{},'options':{'where':_0x43faa2}});};exports[_0x079b('0x35')]=function(_0x1de8aa){return request(_0x079b('0x36'),{'body':{},'options':{'where':_0x1de8aa}});};
\ No newline at end of file
+var _0xcae2=['getMailAccountById','ShowMailAccount','MailServerOut','name','getSquareProjectById','getVoiceQueueById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','then','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash','util','jayson/promise','client','http','request','error','message','result','ShowSquareProject','production'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x2cae('0x0'));var moment=require(_0x2cae('0x1'));var _=require(_0x2cae('0x2'));var util=require(_0x2cae('0x3'));var jayson=require(_0x2cae('0x4'));var client=jayson[_0x2cae('0x5')][_0x2cae('0x6')]({'port':0x2329});function request(_0x508f2e,_0x7310ab){return new BPromise(function(_0x1910d0,_0x203811){return client[_0x2cae('0x7')](_0x508f2e,_0x7310ab)['then'](function(_0x3a3e3b){if(_0x3a3e3b[_0x2cae('0x8')]){return _0x203811(_0x3a3e3b[_0x2cae('0x8')][_0x2cae('0x9')]);}else{return _0x1910d0(_0x3a3e3b[_0x2cae('0xa')]);}})['catch'](function(_0x49b96c){return _0x203811(_0x49b96c);});});}exports['getSquareProject']=function(_0x49f0d3){return request(_0x2cae('0xb'),{'options':{'raw':![],'where':{'name':_0x49f0d3},'attributes':[_0x2cae('0xc')]}});};exports[_0x2cae('0xd')]=function(_0x3212ec){return request(_0x2cae('0xe'),{'options':{'raw':![],'where':{'id':_0x3212ec},'include':[{'model':_0x2cae('0xf'),'as':'Smtp'}],'attributes':['id',_0x2cae('0x10'),'email']}});};exports[_0x2cae('0x11')]=function(_0x125b4b){return request(_0x2cae('0xb'),{'options':{'where':{'id':_0x125b4b},'attributes':[_0x2cae('0x10')]}});};exports[_0x2cae('0x12')]=function(_0x9f306f){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x9f306f},'attributes':[_0x2cae('0x10')]}});};exports['getVariableById']=function(_0x42f393){return request(_0x2cae('0x13'),{'options':{'where':{'id':_0x42f393},'attributes':['name']}});};exports[_0x2cae('0x14')]=function(_0x2295c0){return request(_0x2cae('0x15'),{'options':{'where':{'id':_0x2295c0},'attributes':[_0x2cae('0x16')]}});};exports['getUserById']=function(_0x3fda2f){return request(_0x2cae('0x17'),{'options':{'where':{'id':_0x3fda2f},'attributes':['name']}});};exports[_0x2cae('0x18')]=function(_0x235286){return request(_0x2cae('0x19'),{'options':{'where':{'id':_0x235286},'attributes':[_0x2cae('0x10')]}});};exports[_0x2cae('0x1a')]=function(_0x164aee){return request(_0x2cae('0x1b'),{'options':{'where':{'id':_0x164aee},'attributes':[_0x2cae('0x1c')]}});};exports['getIntervalById']=function(_0x5cb971){return request(_0x2cae('0x1d'),{'options':{'raw':![],'where':{'id':_0x5cb971},'include':[{'model':_0x2cae('0x1e'),'as':_0x2cae('0x1f')}]}});};exports[_0x2cae('0x20')]=function(_0x2f4f5c){return request(_0x2cae('0x21'),{'options':{'where':{'id':_0x2f4f5c},'attributes':['id',_0x2cae('0x10')]}});};exports['createSmsMessage']=function(_0x4bc93c){return request(_0x2cae('0x22'),{'body':_0x4bc93c});};exports[_0x2cae('0x23')]=function(_0x5d800e){return request('CreateSquareDetailsReport',{'body':_0x5d800e});};exports['createSquareReport']=function(_0x1fbc3f){return request(_0x2cae('0x24'),{'body':_['merge'](_0x1fbc3f,{'project_name':_0x1fbc3f['arg_1'],'prev_project_name':_0x1fbc3f[_0x2cae('0x25')]||'','is_subproject':_0x1fbc3f[_0x2cae('0x25')]?!![]:![],'leaveAt':moment()[_0x2cae('0x26')](_0x2cae('0x27'))})});};exports[_0x2cae('0x28')]=function(_0x447c72){return request(_0x2cae('0x29'),{'body':_0x447c72});};exports[_0x2cae('0x2a')]=function(_0x214dba){return request(_0x2cae('0x2b'),{'body':_0x214dba});};exports[_0x2cae('0x2c')]=function(_0x2e0005){return request(_0x2cae('0x2d'),{'options':{'raw':![],'where':{'phone':_0x2e0005[_0x2cae('0x2e')],'ListId':_0x2e0005[_0x2cae('0x2f')]}}})[_0x2cae('0x30')](function(_0x564892){if(_0x564892){return _0x564892;}return request('CreateCmContact',{'body':_0x2e0005});});};exports['getPauseById']=function(_0x5afca5){return request(_0x2cae('0x31'),{'options':{'where':{'id':_0x5afca5},'attributes':[_0x2cae('0x10')]}});};exports[_0x2cae('0x32')]=function(_0x508069,_0x4f9b56){return request(_0x2cae('0x33'),{'body':{'interface':_0x4f9b56},'options':{'where':_0x508069}});};exports[_0x2cae('0x34')]=function(_0xd53da6,_0x5d1fc8,_0x2db662){return request('PauseUser',{'body':{'type':_0x5d1fc8,'uniqueid':_0x2db662},'options':{'where':_0xd53da6}});};exports[_0x2cae('0x35')]=function(_0x594c4f){return request(_0x2cae('0x36'),{'body':{},'options':{'where':_0x594c4f}});};exports[_0x2cae('0x37')]=function(_0x768aaf){return request('LogoutUser',{'body':{},'options':{'where':_0x768aaf}});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js
index 62e1b37..a1c7b0f 100644
--- a/server/services/agi/scripts/aws/index.js
+++ b/server/services/agi/scripts/aws/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd337=['./lex','exports','./polly'];(function(_0x3bb45b,_0x2dcc0b){var _0x513162=function(_0x46f44b){while(--_0x46f44b){_0x3bb45b['push'](_0x3bb45b['shift']());}};_0x513162(++_0x2dcc0b);}(_0xd337,0x16a));var _0x7d33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd337[_0x3dd15e];return _0x231fd0;};var polly=require(_0x7d33('0x0'));var lex=require(_0x7d33('0x1'));module[_0x7d33('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x1c4b=['exports','./polly','./lex'];(function(_0x3c21f8,_0x4dd92d){var _0x2bedef=function(_0x27c2cb){while(--_0x27c2cb){_0x3c21f8['push'](_0x3c21f8['shift']());}};_0x2bedef(++_0x4dd92d);}(_0x1c4b,0x19f));var _0xb1c4=function(_0x27b712,_0x112b55){_0x27b712=_0x27b712-0x0;var _0x3a9279=_0x1c4b[_0x27b712];return _0x3a9279;};var polly=require(_0xb1c4('0x0'));var lex=require(_0xb1c4('0x1'));module[_0xb1c4('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js
index 3588109..8b18863 100644
--- a/server/services/agi/scripts/aws/lex/index.js
+++ b/server/services/agi/scripts/aws/lex/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7fc=['./lib/api'];(function(_0x248e9c,_0x1e6747){var _0x1ede8e=function(_0x50aa5d){while(--_0x50aa5d){_0x248e9c['push'](_0x248e9c['shift']());}};_0x1ede8e(++_0x1e6747);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x45bd84,_0x4a61bb){_0x45bd84=_0x45bd84-0x0;var _0x551b62=_0xb7fc[_0x45bd84];return _0x551b62;};'use strict';var lex=require(_0xcb7f('0x0'));module['exports']=function(_0x52c9f2,_0x189517,_0x2f2354,_0x12656f,_0x495101,_0x4b3408){return lex(_0x52c9f2,_0x189517,_0x2f2354,_0x12656f,_0x495101,_0x4b3408);};
\ No newline at end of file
+var _0x0c02=['exports'];(function(_0x4718a1,_0x210d24){var _0x415229=function(_0x4c741a){while(--_0x4c741a){_0x4718a1['push'](_0x4718a1['shift']());}};_0x415229(++_0x210d24);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var lex=require('./lib/api');module[_0x20c0('0x0')]=function(_0x33da8b,_0x590c5c,_0x1338cf,_0x5c8750,_0x454922,_0x6d03d0){return lex(_0x33da8b,_0x590c5c,_0x1338cf,_0x5c8750,_0x454922,_0x6d03d0);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js
index cc4fa2a..0d26d87 100644
--- a/server/services/agi/scripts/aws/lex/lib/api.js
+++ b/server/services/agi/scripts/aws/lex/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b0b=['slots','hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird','postText'];(function(_0x7532e2,_0x3bb229){var _0xa42ad1=function(_0x51cc7e){while(--_0x51cc7e){_0x7532e2['push'](_0x7532e2['shift']());}};_0xa42ad1(++_0x3bb229);}(_0x9b0b,0x10e));var _0xb9b0=function(_0x51ab83,_0x2721b9){_0x51ab83=_0x51ab83-0x0;var _0x14b6de=_0x9b0b[_0x51ab83];return _0x14b6de;};'use strict';var BPromise=require(_0xb9b0('0x0'));var AWS=require('aws-sdk');function lexResult(_0x50995e,_0x2c9d10){return new BPromise(function(_0x5ced10,_0xfffe71){_0x50995e[_0xb9b0('0x1')](_0x2c9d10,function(_0x295dd1,_0x19a0eb){if(_0x295dd1){_0xfffe71(_0x295dd1);}if(_0x19a0eb[_0xb9b0('0x2')]){for(const _0x49f20a in _0x19a0eb[_0xb9b0('0x2')]){if(_0x19a0eb[_0xb9b0('0x2')][_0xb9b0('0x3')](_0x49f20a)){var _0x4cee4c=_0x19a0eb[_0xb9b0('0x2')][_0x49f20a];_0x19a0eb[_0xb9b0('0x4')+_0x49f20a]=_0x4cee4c;}}}_0x5ced10(_0x19a0eb);});});}module[_0xb9b0('0x5')]=function(_0x21ff79,_0x4fb2e2,_0x499dbb,_0x14cb66,_0x108607,_0x3d80b5){var _0xc38494=new AWS[(_0xb9b0('0x6'))]({'accessKeyId':_0x4fb2e2,'secretAccessKey':_0x499dbb,'region':_0x14cb66});var _0x8bdd13={'botAlias':_0xb9b0('0x7'),'botName':_0x3d80b5,'inputText':_0x108607,'userId':_0x21ff79};return lexResult(_0xc38494,_0x8bdd13);};
\ No newline at end of file
+var _0x8247=['exports','LexRuntime','$LATEST','bluebird','postText','slots','hasOwnProperty','slot_'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x8247,0x1cb));var _0x7824=function(_0x673722,_0x275d7e){_0x673722=_0x673722-0x0;var _0x21249c=_0x8247[_0x673722];return _0x21249c;};'use strict';var BPromise=require(_0x7824('0x0'));var AWS=require('aws-sdk');function lexResult(_0x3a67a7,_0x598eae){return new BPromise(function(_0x45b72c,_0x2f9ee9){_0x3a67a7[_0x7824('0x1')](_0x598eae,function(_0xe37636,_0x9ae1de){if(_0xe37636){_0x2f9ee9(_0xe37636);}if(_0x9ae1de[_0x7824('0x2')]){for(const _0x1e3cd2 in _0x9ae1de[_0x7824('0x2')]){if(_0x9ae1de[_0x7824('0x2')][_0x7824('0x3')](_0x1e3cd2)){var _0x360004=_0x9ae1de['slots'][_0x1e3cd2];_0x9ae1de[_0x7824('0x4')+_0x1e3cd2]=_0x360004;}}}_0x45b72c(_0x9ae1de);});});}module[_0x7824('0x5')]=function(_0x3b0162,_0xdedd1f,_0x190527,_0xa01423,_0x5c6221,_0x478bda){var _0x3af668=new AWS[(_0x7824('0x6'))]({'accessKeyId':_0xdedd1f,'secretAccessKey':_0x190527,'region':_0xa01423});var _0x3b13d8={'botAlias':_0x7824('0x7'),'botName':_0x478bda,'inputText':_0x5c6221,'userId':_0x3b0162};return lexResult(_0x3af668,_0x3b13d8);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js
index 31340a8..d3bf59c 100644
--- a/server/services/agi/scripts/aws/polly/index.js
+++ b/server/services/agi/scripts/aws/polly/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x64eb=['exports','./lib/api'];(function(_0x472a96,_0x2d81d9){var _0x25b5fa=function(_0xc699d2){while(--_0xc699d2){_0x472a96['push'](_0x472a96['shift']());}};_0x25b5fa(++_0x2d81d9);}(_0x64eb,0x17f));var _0xb64e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x64eb[_0x14add3];return _0x4a174f;};'use strict';var polly=require(_0xb64e('0x0'));module[_0xb64e('0x1')]=function(_0x596daf,_0x1e01b2,_0x4d862e,_0x2047ed,_0x2e3437,_0x27aeb0,_0x3becb1){return polly(_0x596daf,_0x1e01b2,_0x4d862e,_0x2047ed,_0x2e3437,_0x27aeb0,_0x3becb1);};
\ No newline at end of file
+var _0xb8f8=['exports','./lib/api'];(function(_0x5ae1a2,_0x3601ba){var _0x9ac42f=function(_0x16abe8){while(--_0x16abe8){_0x5ae1a2['push'](_0x5ae1a2['shift']());}};_0x9ac42f(++_0x3601ba);}(_0xb8f8,0x17d));var _0x8b8f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xb8f8[_0x413feb];return _0x40ee88;};'use strict';var polly=require(_0x8b8f('0x0'));module[_0x8b8f('0x1')]=function(_0xe1385d,_0x1041d4,_0xa349d5,_0x5dd5a1,_0x35dd96,_0x509415,_0x28859f){return polly(_0xe1385d,_0x1041d4,_0xa349d5,_0x5dd5a1,_0x35dd96,_0x509415,_0x28859f);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js
index d33454b..5110af8 100644
--- a/server/services/agi/scripts/aws/polly/lib/api.js
+++ b/server/services/agi/scripts/aws/polly/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5ec9=['No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','mp3','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5ec9,0xae));var _0x95ec=function(_0x273432,_0x36f797){_0x273432=_0x273432-0x0;var _0x2b9bd6=_0x5ec9[_0x273432];return _0x2b9bd6;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x95ec('0x0'));var AWS=require(_0x95ec('0x1'));function pollyResult(_0x428932,_0x22e7f5,_0x344b5b){return new BPromise(function(_0x118a65,_0x54ddb9){_0x428932[_0x95ec('0x2')](_0x22e7f5,function(_0x3cdba2,_0xaeccb5){if(_0x3cdba2){_0x54ddb9(_0x3cdba2);}else if(_0xaeccb5){if(_0xaeccb5[_0x95ec('0x3')]instanceof Buffer){fs[_0x95ec('0x4')](_0x344b5b,_0xaeccb5[_0x95ec('0x3')],function(_0x36c02e){if(_0x36c02e){_0x54ddb9(_0x36c02e);}else{_0x118a65();}});}else{_0x54ddb9(new Error(_0x95ec('0x5')));}}else{_0x54ddb9(new Error(_0x95ec('0x6')));}});});}module['exports']=function(_0x203222,_0x33f370,_0x433220,_0x585e44,_0x1ad151,_0x3202a9,_0x4f6810){var _0x558605=new AWS[(_0x95ec('0x7'))]({'accessKeyId':_0x203222,'secretAccessKey':_0x33f370,'region':_0x433220});var _0x1a7143={'Text':_0x1ad151,'TextType':_0x3202a9||'text','OutputFormat':_0x95ec('0x8'),'VoiceId':_0x585e44};return pollyResult(_0x558605,_0x1a7143,_0x4f6810);};
\ No newline at end of file
+var _0xf42a=['path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3'];(function(_0x1670c8,_0x79f9db){var _0x21b46f=function(_0x1d187f){while(--_0x1d187f){_0x1670c8['push'](_0x1670c8['shift']());}};_0x21b46f(++_0x79f9db);}(_0xf42a,0x14a));var _0xaf42=function(_0x1f2ebd,_0x43bb35){_0x1f2ebd=_0x1f2ebd-0x0;var _0x33da83=_0xf42a[_0x1f2ebd];return _0x33da83;};'use strict';var fs=require('fs');var path=require(_0xaf42('0x0'));var BPromise=require(_0xaf42('0x1'));var rs=require(_0xaf42('0x2'));var AWS=require(_0xaf42('0x3'));function pollyResult(_0x5eacc4,_0x478189,_0x4ea7d3){return new BPromise(function(_0x12b44d,_0x442f06){_0x5eacc4[_0xaf42('0x4')](_0x478189,function(_0x5b8c5e,_0xada06e){if(_0x5b8c5e){_0x442f06(_0x5b8c5e);}else if(_0xada06e){if(_0xada06e[_0xaf42('0x5')]instanceof Buffer){fs[_0xaf42('0x6')](_0x4ea7d3,_0xada06e[_0xaf42('0x5')],function(_0x34454f){if(_0x34454f){_0x442f06(_0x34454f);}else{_0x12b44d();}});}else{_0x442f06(new Error(_0xaf42('0x7')));}}else{_0x442f06(new Error(_0xaf42('0x8')));}});});}module['exports']=function(_0x3fbf1a,_0x487750,_0x46c50f,_0x341a45,_0x5d076a,_0x302726,_0x52bc89){var _0x2b0b65=new AWS['Polly']({'accessKeyId':_0x3fbf1a,'secretAccessKey':_0x487750,'region':_0x46c50f});var _0x226491={'Text':_0x5d076a,'TextType':_0x302726||_0xaf42('0x9'),'OutputFormat':_0xaf42('0xa'),'VoiceId':_0x341a45};return pollyResult(_0x2b0b65,_0x226491,_0x52bc89);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js
index d8d9653..0cc1d99 100644
--- a/server/services/agi/scripts/google/asr/index.js
+++ b/server/services/agi/scripts/google/asr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3aee=['exports','./lib/api'];(function(_0x4e5e6c,_0x959eb4){var _0xcf9053=function(_0x3bce18){while(--_0x3bce18){_0x4e5e6c['push'](_0x4e5e6c['shift']());}};_0xcf9053(++_0x959eb4);}(_0x3aee,0x131));var _0xe3ae=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x3aee[_0x11a220];return _0x20d8fe;};'use strict';var asr=require(_0xe3ae('0x0'));module[_0xe3ae('0x1')]=function(_0x5c6962,_0x20aa4e,_0x2d16b7,_0x328af4){return asr(_0x5c6962,_0x20aa4e,_0x2d16b7);};
\ No newline at end of file
+var _0x5453=['exports','./lib/api'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5453,0x18b));var _0x3545=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5453[_0x126558];return _0x1f6d14;};'use strict';var asr=require(_0x3545('0x0'));module[_0x3545('0x1')]=function(_0x211344,_0x26a950,_0x14b021,_0x2fffbe){return asr(_0x211344,_0x26a950,_0x14b021);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js
index 833051f..5b4e4fe 100644
--- a/server/services/agi/scripts/google/asr/lib/api.js
+++ b/server/services/agi/scripts/google/asr/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfc1b=['LINEAR16','8000','url','bluebird','https://speech.googleapis.com','filepath\x20should\x20be\x20a\x20string','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key='];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfc1b,0x98));var _0xbfc1=function(_0x7f153,_0x3e1c8b){_0x7f153=_0x7f153-0x0;var _0x5a2157=_0xfc1b[_0x7f153];return _0x5a2157;};'use strict';var url=require(_0xbfc1('0x0'));var BPromise=require(_0xbfc1('0x1'));var fs=require('fs');var host=_0xbfc1('0x2');module['exports']=function(_0x171f09,_0x2f6798,_0xbe9a1a){return new BPromise(function(_0x12bab3,_0x45e453){var _0x31f832;if(typeof _0x171f09!=='string'||_0x171f09['length']===0x0){return _0x45e453(_0xbfc1('0x3'));}if(typeof _0x2f6798!==_0xbfc1('0x4')||_0x2f6798[_0xbfc1('0x5')]===0x0){return _0x45e453(_0xbfc1('0x6'));}if(typeof _0xbe9a1a!==_0xbfc1('0x7')&&(typeof _0xbe9a1a!=='string'||_0xbe9a1a[_0xbfc1('0x5')]===0x0)){return _0x45e453(_0xbfc1('0x8'));}try{_0x31f832=fs[_0xbfc1('0x9')](_0x171f09)[_0xbfc1('0xa')]('base64');}catch(_0x1659b2){return _0x45e453(_0x1659b2);}return _0x12bab3({'method':_0xbfc1('0xb'),'uri':host+_0xbfc1('0xc')+_0x2f6798,'body':{'config':{'encoding':_0xbfc1('0xd'),'sampleRateHertz':_0xbfc1('0xe'),'languageCode':_0xbe9a1a},'audio':{'content':_0x31f832}},'json':!![]});});};
\ No newline at end of file
+var _0x31ef=['string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x31ef,0x6e));var _0xf31e=function(_0x8985f1,_0x3a0d0d){_0x8985f1=_0x8985f1-0x0;var _0x19e533=_0x31ef[_0x8985f1];return _0x19e533;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x4f0437,_0x4c6c62,_0x5a534d){return new BPromise(function(_0x1ed6cc,_0x33721c){var _0x4637c1;if(typeof _0x4f0437!==_0xf31e('0x0')||_0x4f0437[_0xf31e('0x1')]===0x0){return _0x33721c('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x4c6c62!==_0xf31e('0x0')||_0x4c6c62[_0xf31e('0x1')]===0x0){return _0x33721c(_0xf31e('0x2'));}if(typeof _0x5a534d!==_0xf31e('0x3')&&(typeof _0x5a534d!==_0xf31e('0x0')||_0x5a534d['length']===0x0)){return _0x33721c(_0xf31e('0x4'));}try{_0x4637c1=fs[_0xf31e('0x5')](_0x4f0437)[_0xf31e('0x6')](_0xf31e('0x7'));}catch(_0x2b5b6f){return _0x33721c(_0x2b5b6f);}return _0x1ed6cc({'method':_0xf31e('0x8'),'uri':host+_0xf31e('0x9')+_0x4c6c62,'body':{'config':{'encoding':_0xf31e('0xa'),'sampleRateHertz':'8000','languageCode':_0x5a534d},'audio':{'content':_0x4637c1}},'json':!![]});});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js
index aaf0913..ac095eb 100644
--- a/server/services/agi/scripts/google/index.js
+++ b/server/services/agi/scripts/google/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34e8=['./asr','exports'];(function(_0xeb80e,_0x337608){var _0x68e9d7=function(_0x50c896){while(--_0x50c896){_0xeb80e['push'](_0xeb80e['shift']());}};_0x68e9d7(++_0x337608);}(_0x34e8,0x12c));var _0x834e=function(_0x48bb77,_0x2a893c){_0x48bb77=_0x48bb77-0x0;var _0x3725f1=_0x34e8[_0x48bb77];return _0x3725f1;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x34e8=['./asr','exports'];(function(_0x3ae4bf,_0x554978){var _0x27f7dd=function(_0x406997){while(--_0x406997){_0x3ae4bf['push'](_0x3ae4bf['shift']());}};_0x27f7dd(++_0x554978);}(_0x34e8,0x12c));var _0x834e=function(_0x421726,_0x4630f1){_0x421726=_0x421726-0x0;var _0x277f9b=_0x34e8[_0x421726];return _0x277f9b;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr};
\ No newline at end of file
diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js
index 4c07994..6c8854b 100644
--- a/server/services/agi/scripts/index.js
+++ b/server/services/agi/scripts/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x3142c3,_0x328abe){var _0x1a548d=function(_0x486f28){while(--_0x486f28){_0x3142c3['push'](_0x3142c3['shift']());}};_0x1a548d(++_0x328abe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;};
\ No newline at end of file
+var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x24a064,_0x12252f){var _0x10c980=function(_0x52bd93){while(--_0x52bd93){_0x24a064['push'](_0x24a064['shift']());}};_0x10c980(++_0x12252f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;};
\ No newline at end of file
diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js
index 34107f6..2c47574 100644
--- a/server/services/agi/scripts/sestek/index.js
+++ b/server/services/agi/scripts/sestek/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x760c=['./nda','exports'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0x760c,0x194));var _0xc760=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x760c[_0x122ef9];return _0x42fba0;};var nda=require(_0xc760('0x0'));module[_0xc760('0x1')]={'nda':nda};
\ No newline at end of file
+var _0x31f5=['./nda'];(function(_0x163eb5,_0x4d2fac){var _0x3a9062=function(_0x311349){while(--_0x311349){_0x163eb5['push'](_0x163eb5['shift']());}};_0x3a9062(++_0x4d2fac);}(_0x31f5,0x18a));var _0x531f=function(_0x2a288e,_0x16fea8){_0x2a288e=_0x2a288e-0x0;var _0x14ecf7=_0x31f5[_0x2a288e];return _0x14ecf7;};var nda=require(_0x531f('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js
index 3963d9a..b2c81ac 100644
--- a/server/services/agi/scripts/sestek/nda/index.js
+++ b/server/services/agi/scripts/sestek/nda/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0f17=['request-promise','url','exports','POST','resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','project','ndagenerate_audio','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify'];(function(_0x415ada,_0x2b7172){var _0x1bf0c7=function(_0x235627){while(--_0x235627){_0x415ada['push'](_0x415ada['shift']());}};_0x1bf0c7(++_0x2b7172);}(_0x0f17,0xe8));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x70f1('0x0'));var url=require(_0x70f1('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x70f1('0x2')]=function(_0x490c19,_0x2b3596){var _0x3f4486={'method':_0x70f1('0x3'),'uri':url[_0x70f1('0x4')](_0x2b3596[_0x70f1('0x5')],_0x70f1('0x6')),'form':{'grant_type':_0x70f1('0x7'),'username':_0x2b3596[_0x70f1('0x8')],'password':_0x2b3596[_0x70f1('0x7')]},'json':!![]};return rp(_0x3f4486)[_0x70f1('0x9')](function(_0x2f7c45){var _0x1c4834={'method':'POST','uri':url[_0x70f1('0x4')](_0x2b3596['ndassistant_url'],_0x70f1('0xa')),'body':{'type':_0x2b3596[_0x70f1('0xb')]||'message','channelId':'Nda','conversation':{'id':_0x490c19[_0x70f1('0xc')]},'from':{'id':_0x490c19['callerid'],'name':_0x490c19[_0x70f1('0xd')]},'recipient':{'id':_0x490c19[_0x70f1('0xe')],'name':_0x490c19[_0x70f1('0xf')]},'text':_0x2b3596[_0x70f1('0x10')],'channelData':{}},'headers':{'Authorization':_0x70f1('0x11')+_0x2f7c45[_0x70f1('0x12')]},'json':!![]};if(_0x2b3596['project']){_0x1c4834[_0x70f1('0x13')][_0x70f1('0x14')]['ProjectName']=_0x2b3596[_0x70f1('0x15')];}if(_0x2b3596[_0x70f1('0x16')]=='1'){_0x1c4834['body'][_0x70f1('0x14')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x2b3596[_0x70f1('0x17')]){_0x1c4834[_0x70f1('0x13')][_0x70f1('0x14')][_0x70f1('0x18')]=_0x2b3596[_0x70f1('0x17')];if(_0x2b3596['custom_action_data']){_0x1c4834[_0x70f1('0x13')][_0x70f1('0x14')][_0x70f1('0x19')]=_0x2b3596[_0x70f1('0x1a')];}}logger[_0x70f1('0x1b')](JSON[_0x70f1('0x1c')](_0x1c4834));return rp(_0x1c4834);});};
\ No newline at end of file
+var _0x466e=['CustomActionData','info','stringify','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x466e,0xe3));var _0xe466=function(_0x2f5612,_0x4c10b4){_0x2f5612=_0x2f5612-0x0;var _0x2d53a8=_0x466e[_0x2f5612];return _0x2d53a8;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0xe466('0x0'))(_0xe466('0x1'));module[_0xe466('0x2')]=function(_0x4fbccc,_0x2d10b7){var _0x261557={'method':_0xe466('0x3'),'uri':url[_0xe466('0x4')](_0x2d10b7[_0xe466('0x5')],_0xe466('0x6')),'form':{'grant_type':_0xe466('0x7'),'username':_0x2d10b7['username'],'password':_0x2d10b7['password']},'json':!![]};return rp(_0x261557)[_0xe466('0x8')](function(_0x141466){var _0x4a94d1={'method':_0xe466('0x3'),'uri':url['resolve'](_0x2d10b7['ndassistant_url'],_0xe466('0x9')),'body':{'type':_0x2d10b7[_0xe466('0xa')]||'message','channelId':'Nda','conversation':{'id':_0x4fbccc[_0xe466('0xb')]},'from':{'id':_0x4fbccc[_0xe466('0xc')],'name':_0x4fbccc[_0xe466('0xd')]},'recipient':{'id':_0x4fbccc[_0xe466('0xe')],'name':_0x4fbccc[_0xe466('0xf')]},'text':_0x2d10b7[_0xe466('0x10')],'channelData':{}},'headers':{'Authorization':_0xe466('0x11')+_0x141466['access_token']},'json':!![]};if(_0x2d10b7[_0xe466('0x12')]){_0x4a94d1[_0xe466('0x13')][_0xe466('0x14')][_0xe466('0x15')]=_0x2d10b7['project'];}if(_0x2d10b7[_0xe466('0x16')]=='1'){_0x4a94d1['body']['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe466('0x17')};}if(_0x2d10b7[_0xe466('0x18')]){_0x4a94d1[_0xe466('0x13')][_0xe466('0x14')]['CustomAction']=_0x2d10b7['custom_action'];if(_0x2d10b7['custom_action_data']){_0x4a94d1[_0xe466('0x13')][_0xe466('0x14')][_0xe466('0x19')]=_0x2d10b7['custom_action_data'];}}logger[_0xe466('0x1a')](JSON[_0xe466('0x1b')](_0x4a94d1));return rp(_0x4a94d1);});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js
index 1325b57..1154b8d 100644
--- a/server/services/agi/scripts/tilde/asr/index.js
+++ b/server/services/agi/scripts/tilde/asr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-'use strict';var asr=require('./lib/api');module['exports']=function(_0x265a6d,_0x54aeac,_0x347560,_0xbd0b09){return asr(_0x265a6d,_0x54aeac,_0x347560,_0xbd0b09);};
\ No newline at end of file
+var _0x9c68=['exports','./lib/api'];(function(_0xbf8ec1,_0x9169c8){var _0xc84567=function(_0x509094){while(--_0x509094){_0xbf8ec1['push'](_0xbf8ec1['shift']());}};_0xc84567(++_0x9169c8);}(_0x9c68,0xbf));var _0x89c6=function(_0x3fb1f6,_0x1570c2){_0x3fb1f6=_0x3fb1f6-0x0;var _0x52a923=_0x9c68[_0x3fb1f6];return _0x52a923;};'use strict';var asr=require(_0x89c6('0x0'));module[_0x89c6('0x1')]=function(_0x24a076,_0x54be3a,_0x624d89,_0x178c8c){return asr(_0x24a076,_0x54be3a,_0x624d89,_0x178c8c);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js
index b7e0f29..8aa9c0f 100644
--- a/server/services/agi/scripts/tilde/asr/lib/api.js
+++ b/server/services/agi/scripts/tilde/asr/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x078c=['digest','hex','info','unix','send','createReadStream','data','close','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','message','bluebird','lodash','moment','crypto','agi','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update'];(function(_0x7f36e0,_0x1a5ca5){var _0x3e1ce2=function(_0x46b485){while(--_0x46b485){_0x7f36e0['push'](_0x7f36e0['shift']());}};_0x3e1ce2(++_0x1a5ca5);}(_0x078c,0x171));var _0xc078=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x078c[_0x96f74c];return _0x379222;};'use strict';var BPromise=require(_0xc078('0x0'));var _=require(_0xc078('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc078('0x2'));var crypto=require(_0xc078('0x3'));var logger=require('../../../../../../config/logger')(_0xc078('0x4'));module['exports']=function(_0x1e2b39,_0x3e8dca,_0x4af830,_0x254fa2){return new BPromise(function(_0x440112,_0x10328a){logger['info'](_0xc078('0x5'),_0x254fa2||_0xc078('0x6'));var _0x54c87e=new WebSocket(_0x254fa2||_0xc078('0x6'),{'perMessageDeflate':![]});var _0x573f45='';var _0x600550='0';var _0x2c7204='1';var _0x34cb75=_0xc078('0x7');function _0x38e09d(_0x433c48){var _0x1fe49c=crypto[_0xc078('0x8')](_0xc078('0x9'));_0x1fe49c[_0xc078('0xa')](_0x433c48);return _0x1fe49c[_0xc078('0xb')](_0xc078('0xc'));}function _0x241192(){try{logger[_0xc078('0xd')]('Open\x20Tilde\x20ASR\x20socket');var _0x2b8af8=moment()[_0xc078('0xe')]();var _0x58b50f=_0x38e09d(_0x2b8af8+_0x3e8dca+_0x4af830);_0x54c87e[_0xc078('0xf')](JSON['stringify']({'appID':_0x3e8dca,'timestamp':_0x2b8af8,'appKey':_0x58b50f}));var _0x1a4c47=fs[_0xc078('0x10')](_0x1e2b39);_0x1a4c47['on'](_0xc078('0x11'),function(_0x520e3d){_0x54c87e[_0xc078('0xf')](_0x520e3d);});_0x1a4c47['on'](_0xc078('0x12'),function(){_0x54c87e[_0xc078('0xf')]('EOS');});}catch(_0x2b17e3){logger['error'](_0xc078('0x13'),JSON[_0xc078('0x14')](_0x2b17e3));_0x54c87e[_0xc078('0x15')]();}}function _0x31d20b(_0x1ce477){try{if(_0x1ce477){var _0x60420d=JSON[_0xc078('0x16')](_0x1ce477);switch(_0x60420d[_0xc078('0x17')]){case 0x0:if(_0x60420d[_0xc078('0x18')]){if(_0x60420d[_0xc078('0x18')][_0xc078('0x19')]){logger[_0xc078('0xd')](_0xc078('0x1a'),JSON[_0xc078('0x14')](_0x60420d[_0xc078('0x18')]['hypotheses']));_0x573f45=_0x60420d[_0xc078('0x18')][_0xc078('0x1b')][0x0][_0xc078('0x1c')];_0x600550=_0x60420d[_0xc078('0x18')][_0xc078('0x1b')][0x0]['likelihood'];_0x2c7204='0';_0x34cb75=_0xc078('0x1d');_0x54c87e[_0xc078('0x15')]();}}break;case 0x1:logger[_0xc078('0xd')](_0xc078('0x7'));_0x2c7204='1';_0x34cb75=_0xc078('0x7');break;case 0x2:logger[_0xc078('0xd')](_0xc078('0x1e'));_0x2c7204='2';_0x34cb75=_0xc078('0x1e');break;case 0x9:logger[_0xc078('0xd')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x2c7204='9';_0x34cb75=_0xc078('0x1f');break;case 0xa:logger['info']('Authentication\x20failed.');_0x2c7204='10';_0x34cb75=_0xc078('0x20');break;case 0xb:logger[_0xc078('0xd')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2c7204='11';_0x34cb75='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x45b644){logger[_0xc078('0x21')](_0xc078('0x22'),JSON[_0xc078('0x14')](_0x45b644));_0x54c87e[_0xc078('0x15')]();}}function _0x1504d2(){logger[_0xc078('0xd')](_0xc078('0x23'));_0x440112({'transcript':_0x573f45,'confidence':_0x600550,'status':_0x2c7204,'status_message':_0x34cb75});}function _0xe9c3e3(_0x26ff6d){logger[_0xc078('0x21')](_0xc078('0x24'));if(!_['isNil'](_0x26ff6d)){logger[_0xc078('0x21')](_['isObject'](_0x26ff6d)?JSON[_0xc078('0x14')](_0x26ff6d):_0x26ff6d);}}_0x54c87e['on']('open',_0x241192);_0x54c87e['on'](_0xc078('0x25'),_0x31d20b);_0x54c87e['on']('close',_0x1504d2);_0x54c87e['on'](_0xc078('0x21'),_0xe9c3e3);});};
\ No newline at end of file
+var _0xa7cb=['../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','stringify','data','send','close','EOS','Tilde\x20ASR\x20send\x20error','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','terminate','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto'];(function(_0x476168,_0x27d9ba){var _0x31f332=function(_0x4b41ab){while(--_0x4b41ab){_0x476168['push'](_0x476168['shift']());}};_0x31f332(++_0x27d9ba);}(_0xa7cb,0x11b));var _0xba7c=function(_0xd76c86,_0x3042e0){_0xd76c86=_0xd76c86-0x0;var _0x1c3482=_0xa7cb[_0xd76c86];return _0x1c3482;};'use strict';var BPromise=require(_0xba7c('0x0'));var _=require(_0xba7c('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xba7c('0x2'));var crypto=require(_0xba7c('0x3'));var logger=require(_0xba7c('0x4'))(_0xba7c('0x5'));module[_0xba7c('0x6')]=function(_0x33fcde,_0x55c249,_0x559abc,_0x516225){return new BPromise(function(_0x12e04f,_0x2a8029){logger['info'](_0xba7c('0x7'),_0x516225||_0xba7c('0x8'));var _0x448c59=new WebSocket(_0x516225||_0xba7c('0x8'),{'perMessageDeflate':![]});var _0x52acc2='';var _0x2c8606='0';var _0x56d35c='1';var _0x2c574e='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x31ba45(_0x62e6a8){var _0x19e64d=crypto[_0xba7c('0x9')](_0xba7c('0xa'));_0x19e64d[_0xba7c('0xb')](_0x62e6a8);return _0x19e64d[_0xba7c('0xc')](_0xba7c('0xd'));}function _0x4826ba(){try{logger[_0xba7c('0xe')](_0xba7c('0xf'));var _0x515028=moment()[_0xba7c('0x10')]();var _0x16977d=_0x31ba45(_0x515028+_0x55c249+_0x559abc);_0x448c59['send'](JSON[_0xba7c('0x11')]({'appID':_0x55c249,'timestamp':_0x515028,'appKey':_0x16977d}));var _0x3f9c0f=fs['createReadStream'](_0x33fcde);_0x3f9c0f['on'](_0xba7c('0x12'),function(_0x1edcd5){_0x448c59[_0xba7c('0x13')](_0x1edcd5);});_0x3f9c0f['on'](_0xba7c('0x14'),function(){_0x448c59[_0xba7c('0x13')](_0xba7c('0x15'));});}catch(_0x4e322e){logger['error'](_0xba7c('0x16'),JSON[_0xba7c('0x11')](_0x4e322e));_0x448c59['terminate']();}}function _0x920c8b(_0xefc5e6){try{if(_0xefc5e6){var _0x1c397f=JSON[_0xba7c('0x17')](_0xefc5e6);switch(_0x1c397f[_0xba7c('0x18')]){case 0x0:if(_0x1c397f[_0xba7c('0x19')]){if(_0x1c397f[_0xba7c('0x19')]['final']){logger[_0xba7c('0xe')](_0xba7c('0x1a'),JSON[_0xba7c('0x11')](_0x1c397f[_0xba7c('0x19')][_0xba7c('0x1b')]));_0x52acc2=_0x1c397f['result'][_0xba7c('0x1b')][0x0]['transcript'];_0x2c8606=_0x1c397f[_0xba7c('0x19')][_0xba7c('0x1b')][0x0]['likelihood'];_0x56d35c='0';_0x2c574e=_0xba7c('0x1c');_0x448c59[_0xba7c('0x1d')]();}}break;case 0x1:logger[_0xba7c('0xe')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x56d35c='1';_0x2c574e=_0xba7c('0x1e');break;case 0x2:logger[_0xba7c('0xe')](_0xba7c('0x1f'));_0x56d35c='2';_0x2c574e=_0xba7c('0x1f');break;case 0x9:logger[_0xba7c('0xe')](_0xba7c('0x20'));_0x56d35c='9';_0x2c574e=_0xba7c('0x20');break;case 0xa:logger[_0xba7c('0xe')]('Authentication\x20failed.');_0x56d35c='10';_0x2c574e='Authentication\x20failed.';break;case 0xb:logger[_0xba7c('0xe')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x56d35c='11';_0x2c574e='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x1b41b8){logger[_0xba7c('0x21')](_0xba7c('0x22'),JSON[_0xba7c('0x11')](_0x1b41b8));_0x448c59['terminate']();}}function _0x4d16c0(){logger['info'](_0xba7c('0x23'));_0x12e04f({'transcript':_0x52acc2,'confidence':_0x2c8606,'status':_0x56d35c,'status_message':_0x2c574e});}function _0x1f28f5(_0x3847cd){logger[_0xba7c('0x21')](_0xba7c('0x24'));if(!_[_0xba7c('0x25')](_0x3847cd)){logger[_0xba7c('0x21')](_[_0xba7c('0x26')](_0x3847cd)?JSON['stringify'](_0x3847cd):_0x3847cd);}}_0x448c59['on'](_0xba7c('0x27'),_0x4826ba);_0x448c59['on'](_0xba7c('0x28'),_0x920c8b);_0x448c59['on'](_0xba7c('0x14'),_0x4d16c0);_0x448c59['on'](_0xba7c('0x21'),_0x1f28f5);});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js
index 3e4febd..f4c77bf 100644
--- a/server/services/agi/scripts/tilde/index.js
+++ b/server/services/agi/scripts/tilde/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['./asr','exports'];(function(_0x55b8ec,_0x11b8ed){var _0x1f3940=function(_0x3498fd){while(--_0x3498fd){_0x55b8ec['push'](_0x55b8ec['shift']());}};_0x1f3940(++_0x11b8ed);}(_0x008c,0x188));var _0xc008=function(_0x304471,_0x361864){_0x304471=_0x304471-0x0;var _0x2b6563=_0x008c[_0x304471];return _0x2b6563;};var asr=require(_0xc008('0x0'));module[_0xc008('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xedd9=['exports'];(function(_0x252178,_0x94c4f1){var _0x455f25=function(_0x405884){while(--_0x405884){_0x252178['push'](_0x252178['shift']());}};_0x455f25(++_0x94c4f1);}(_0xedd9,0xfc));var _0x9edd=function(_0x59bfa1,_0x1b15bc){_0x59bfa1=_0x59bfa1-0x0;var _0x58d506=_0xedd9[_0x59bfa1];return _0x58d506;};var asr=require('./asr');module[_0x9edd('0x0')]={'asr':asr};
\ No newline at end of file
diff --git a/server/services/agi/server.js b/server/services/agi/server.js
index d353078..feb5524 100644
--- a/server/services/agi/server.js
+++ b/server/services/agi/server.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x586b=['ready','code','close','nextTick','inherits','exports','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION'];(function(_0x17a50b,_0x14fdd8){var _0xb4b92d=function(_0x3e177e){while(--_0x3e177e){_0x17a50b['push'](_0x17a50b['shift']());}};_0xb4b92d(++_0x14fdd8);}(_0x586b,0x1bb));var _0xb586=function(_0x8deda,_0x2a6fc6){_0x8deda=_0x8deda-0x0;var _0x2e98db=_0x586b[_0x8deda];return _0x2e98db;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0xb586('0x0'))[_0xb586('0x1')];var AGIError=require(_0xb586('0x2'));var AGIChannel=require(_0xb586('0x3'));var AGIServer=function(_0x23f7c8,_0x2f277f,_0xea2263){var _0x16579d=this,_0x23f7c8=_0x23f7c8||0x11dd,_0x2f277f=_0x2f277f||_0xb586('0x4'),_0x2c242b=null,_0x3cf312=0x0;EventEmitter[_0xb586('0x5')](_0x16579d);function _0x37b9a5(){if(!_0x23f7c8){_0x16579d[_0xb586('0x6')]('error',new AGIError(_0xb586('0x7')));return![];}_0x2c242b=net[_0xb586('0x8')]();_0x2c242b[_0xb586('0x9')](_0x23f7c8,_0x2f277f);_0x2c242b['on'](_0xb586('0xa'),function(){_0x16579d[_0xb586('0x6')](_0xb586('0xa'));});_0x2c242b['on'](_0xb586('0xb'),function(_0x167551){_0x2c242b['getConnections'](function(_0x34dba2,_0x4c2967){if(_0x34dba2){_0x16579d[_0xb586('0x6')](_0xb586('0xc'),new AGIError(_0xb586('0xd'),_0x34dba2));}else if(_0xea2263&&_0xea2263<0x0){_0x16579d['emit'](_0xb586('0xc'),new AGIError(_0xb586('0xe')));_0x167551[_0xb586('0xf')]();}else if(_0xea2263&&_0xea2263>0x0&&_0xea2263<_0x4c2967){_0x3cf312+=0x1;_0x16579d[_0xb586('0x6')]('error',new AGIError(_0xb586('0x10'),_0x3cf312));_0x167551['destroy']();}else{var _0x20c90a=new AGIChannel(_0x167551);_0x20c90a['on'](_0xb586('0x11'),function(){_0x16579d[_0xb586('0x6')](_0xb586('0xb'),_0x20c90a);});}});});_0x2c242b['on'](_0xb586('0xc'),function(_0xb6dd9){_0x16579d[_0xb586('0x6')](_0xb586('0xc'),new AGIError(_0xb586('0xd'),_0xb6dd9[_0xb586('0x12')]));});_0x2c242b['on']('close',function(){_0x16579d[_0xb586('0x6')](_0xb586('0x13'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xb586('0x14')](function(){_0x37b9a5();});};util[_0xb586('0x15')](AGIServer,EventEmitter);module[_0xb586('0x16')]=function(_0x2dfbea,_0x225173,_0x4e004f){return new AGIServer(_0x2dfbea,_0x225173,_0x4e004f);};
\ No newline at end of file
+var _0xdd6b=['./error','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','events','EventEmitter'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdd6b,0x19a));var _0xbdd6=function(_0x1eb07f,_0xcc3d46){_0x1eb07f=_0x1eb07f-0x0;var _0xe5b3bc=_0xdd6b[_0x1eb07f];return _0xe5b3bc;};'use strict';var util=require(_0xbdd6('0x0'));var net=require(_0xbdd6('0x1'));var EventEmitter=require(_0xbdd6('0x2'))[_0xbdd6('0x3')];var AGIError=require(_0xbdd6('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x393606,_0x3607cd,_0x1543de){var _0x44542c=this,_0x393606=_0x393606||0x11dd,_0x3607cd=_0x3607cd||_0xbdd6('0x5'),_0x5510ed=null,_0x28a5d9=0x0;EventEmitter['call'](_0x44542c);function _0x578c67(){if(!_0x393606){_0x44542c[_0xbdd6('0x6')](_0xbdd6('0x7'),new AGIError(_0xbdd6('0x8')));return![];}_0x5510ed=net[_0xbdd6('0x9')]();_0x5510ed[_0xbdd6('0xa')](_0x393606,_0x3607cd);_0x5510ed['on'](_0xbdd6('0xb'),function(){_0x44542c['emit'](_0xbdd6('0xb'));});_0x5510ed['on'](_0xbdd6('0xc'),function(_0x55f05a){_0x5510ed[_0xbdd6('0xd')](function(_0x511e27,_0x588435){if(_0x511e27){_0x44542c[_0xbdd6('0x6')](_0xbdd6('0x7'),new AGIError(_0xbdd6('0xe'),_0x511e27));}else if(_0x1543de&&_0x1543de<0x0){_0x44542c[_0xbdd6('0x6')](_0xbdd6('0x7'),new AGIError(_0xbdd6('0xf')));_0x55f05a['destroy']();}else if(_0x1543de&&_0x1543de>0x0&&_0x1543de<_0x588435){_0x28a5d9+=0x1;_0x44542c['emit'](_0xbdd6('0x7'),new AGIError(_0xbdd6('0x10'),_0x28a5d9));_0x55f05a[_0xbdd6('0x11')]();}else{var _0xcf9c9f=new AGIChannel(_0x55f05a);_0xcf9c9f['on']('ready',function(){_0x44542c['emit'](_0xbdd6('0xc'),_0xcf9c9f);});}});});_0x5510ed['on'](_0xbdd6('0x7'),function(_0x3a4620){_0x44542c['emit'](_0xbdd6('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x3a4620[_0xbdd6('0x12')]));});_0x5510ed['on'](_0xbdd6('0x13'),function(){_0x44542c[_0xbdd6('0x6')]('close',new AGIError(_0xbdd6('0x14')));});}process[_0xbdd6('0x15')](function(){_0x578c67();});};util['inherits'](AGIServer,EventEmitter);module[_0xbdd6('0x16')]=function(_0x387455,_0x1e51ea,_0x4e2114){return new AGIServer(_0x387455,_0x1e51ea,_0x4e2114);};
\ No newline at end of file
diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js
index d5df18b..880f73f 100644
--- a/server/services/agi/vertices.js
+++ b/server/services/agi/vertices.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc21e=['sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','replace','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','sendSMS\x20message','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','tts','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','moment','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','then','catch','prototype','getVoiceQueue','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getTrunk','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createCmContact','isEmpty','isNil','callback_','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','googleTTS','text','google_tts_language','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','key','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','includes','clone','isString','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','createSquareDetailsReport','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','args','answer','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','noop','phone','custom_app','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','options','Executed\x20command\x20MRCPSynth\x20%s','sestektts','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','no\x20database\x20selected','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','setVariable','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','no\x20text\x20configured','bot','Trying\x20Dialogflow:\x20%s','hasOwnProperty','DIALOGFLOW_%s','toUpperCase','createSquareMessage','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','getData','test','mindigit','maxdigit','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','stringify','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','no\x20find\x20by\x20configured','getPause','playback','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block'];(function(_0x4c3717,_0x36af39){var _0x469d32=function(_0xc3b55c){while(--_0xc3b55c){_0x4c3717['push'](_0x4c3717['shift']());}};_0x469d32(++_0x36af39);}(_0xc21e,0x1ca));var _0xec21=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc21e[_0x59ee6f];return _0x4c0979;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xec21('0x0'));var _=require(_0xec21('0x1'));var sh=require(_0xec21('0x2'));var odbc=require(_0xec21('0x3'))();var rs=require(_0xec21('0x4'));var moment=require(_0xec21('0x5'));var Mustache=require('mustache');var logger=require(_0xec21('0x6'))(_0xec21('0x7'));var config=require(_0xec21('0x8'));var scripts=require(_0xec21('0x9'));var FILES_PATH=_0xec21('0xa');var verticesWithRetry=[_0xec21('0xb'),_0xec21('0xc'),_0xec21('0xd')];var AGIVertices=function(_0x51f6dc,_0x2b1396,_0x3d74a2){this[_0xec21('0xe')]=_0x51f6dc;this[_0xec21('0xf')]=_0x2b1396;this[_0xec21('0x10')]=_0x3d74a2;};AGIVertices['prototype'][_0xec21('0x11')]=function(_0x1d5e4b,_0x25a1bc){this['rpc']['getVariableById'](_0x1d5e4b)[_0xec21('0x12')](function(_0x276437){_0x25a1bc(null,_0x276437?_0x276437['name']:![]);})[_0xec21('0x13')](function(_0x2efc12){_0x25a1bc(_0x2efc12);});};AGIVertices[_0xec21('0x14')][_0xec21('0x15')]=function(_0xc1cca0,_0x5ee9f6){this[_0xec21('0xf')]['getVoiceQueueById'](_0xc1cca0)[_0xec21('0x12')](function(_0x1987f4){_0x5ee9f6(null,_0x1987f4?_0x1987f4[_0xec21('0x16')]:![]);})['catch'](function(_0x168cbd){_0x5ee9f6(_0x168cbd);});};AGIVertices[_0xec21('0x14')][_0xec21('0x17')]=function(_0x2c3124,_0x324853){this[_0xec21('0xf')][_0xec21('0x18')](_0x2c3124)[_0xec21('0x12')](function(_0x4fdb21){_0x324853(null,_0x4fdb21?_0x4fdb21[_0xec21('0x16')]:![]);})[_0xec21('0x13')](function(_0x2fcbcc){_0x324853(_0x2fcbcc);});};AGIVertices[_0xec21('0x14')][_0xec21('0x19')]=function(_0x1d901e,_0x90c3f5){this[_0xec21('0xf')][_0xec21('0x1a')](_0x1d901e)[_0xec21('0x12')](function(_0x4f4b12){_0x90c3f5(null,_0x4f4b12?_0x4f4b12['dsn']:![]);})[_0xec21('0x13')](function(_0x2f4ef9){_0x90c3f5(_0x2f4ef9);});};AGIVertices['prototype']['getUser']=function(_0x176b59,_0xa3d694){this[_0xec21('0xf')]['getUserById'](_0x176b59)[_0xec21('0x12')](function(_0x1f86d2){_0xa3d694(null,_0x1f86d2?_0x1f86d2[_0xec21('0x16')]:![]);})['catch'](function(_0x20ede9){_0xa3d694(_0x20ede9);});};AGIVertices[_0xec21('0x14')][_0xec21('0x1b')]=function(_0x46fd9e,_0x3afe77){this[_0xec21('0xf')]['getTrunkById'](_0x46fd9e)[_0xec21('0x12')](function(_0x26cdae){_0x3afe77(null,_0x26cdae?_0x26cdae['name']:![]);})[_0xec21('0x13')](function(_0x5bfe85){_0x3afe77(_0x5bfe85);});};AGIVertices[_0xec21('0x14')]['getSound']=function(_0x4ef840,_0x1f398f){var _0x199974=this;this[_0xec21('0xf')][_0xec21('0x1c')](_0x4ef840)[_0xec21('0x12')](function(_0x5521e3){_0x1f398f(null,_0x5521e3?_0x199974[_0xec21('0x1d')](_0x5521e3['save_name']):![]);})[_0xec21('0x13')](function(_0x233bf9){_0x1f398f(_0x233bf9);});};AGIVertices[_0xec21('0x14')][_0xec21('0x1e')]=function(_0x4dd56b,_0x1eb6de){this[_0xec21('0xf')][_0xec21('0x1f')](_0x4dd56b)[_0xec21('0x12')](function(_0xa0dea2){_0x1eb6de(null,_0xa0dea2?_0xa0dea2:![]);})[_0xec21('0x13')](function(_0x361b28){_0x1eb6de(_0x361b28);});};AGIVertices[_0xec21('0x14')][_0xec21('0x20')]=function(_0x1bfc3c,_0x43a2de,_0x57e004){this[_0xec21('0x10')][_0xec21('0x20')](_0x1bfc3c,_0x43a2de)[_0xec21('0x12')](function(){_0x57e004(null);})[_0xec21('0x13')](function(_0x4742ee){_0x57e004(_0x4742ee);});};AGIVertices['prototype'][_0xec21('0x21')]=function(_0x5dfc34,_0x528061){this['rpc'][_0xec21('0x22')](_0x5dfc34)[_0xec21('0x12')](function(_0x18dff8){if(_0x18dff8){if(_0x18dff8[_0xec21('0x23')]){_0x528061(null,[_0x18dff8[_0xec21('0x24')]]);}else{_0x528061(null,_[_0xec21('0x25')](_0x18dff8[_0xec21('0x26')],_0xec21('0x24')));}}else{_0x528061(null,![]);}})[_0xec21('0x13')](function(_0x1a7586){_0x528061(_0x1a7586);});};AGIVertices[_0xec21('0x14')][_0xec21('0x1d')]=function(_0x4d1ae3){return util[_0xec21('0x27')](_0xec21('0x28'),FILES_PATH,_0x4d1ae3);};AGIVertices['prototype'][_0xec21('0x29')]=function(_0x4d5859,_0x5eaa14,_0x453db6){odbc['open'](_0x4d5859,function(_0x4556c2){if(_0x4556c2){logger['error'](_0xec21('0x2a'),_0x4556c2);_0x453db6(_0x4556c2);}else{logger[_0xec21('0x2b')]('ODBC\x20connection\x20successfully');odbc[_0xec21('0x2c')](_0x5eaa14,function(_0x14fa33,_0x1d0d8c){if(_0x14fa33){logger['info'](_0xec21('0x2d'),_0x5eaa14);_0x453db6(_0x14fa33);}else{logger[_0xec21('0x2b')](_0xec21('0x2e'),_0x5eaa14);odbc['close'](function(_0x192354){if(_0x192354){logger[_0xec21('0x2f')](_0xec21('0x30'),_0x192354);}_0x453db6(null,_0x1d0d8c);});}});}});};AGIVertices[_0xec21('0x14')][_0xec21('0x31')]=function(_0x49b429,_0x28558f){this[_0xec21('0xf')]['getSmsAccountById'](_0x49b429)[_0xec21('0x12')](function(_0x54e642){_0x28558f(null,_0x54e642?_0x54e642:![]);})[_0xec21('0x13')](function(_0x18e20d){_0x28558f(_0x18e20d);});};AGIVertices[_0xec21('0x14')]['createSmsMessage']=function(_0x3a8730,_0x146930){this[_0xec21('0xf')][_0xec21('0x32')](_0x3a8730)['then'](function(_0x575e99){_0x146930(null,_0x575e99);})[_0xec21('0x13')](function(_0x506f08){_0x146930(_0x506f08);});};AGIVertices[_0xec21('0x14')]['createSquareDetailsReport']=function(_0x16a794,_0x52e024,_0x46d4f4){this[_0xec21('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0xec21('0xe')][_0xec21('0x33')],'node':_0x16a794['label'],'application':_0x16a794[_0xec21('0x34')],'data':_0x52e024||null,'project_name':this[_0xec21('0xe')][_0xec21('0x35')],'callerid':this[_0xec21('0xe')][_0xec21('0x36')]})[_0xec21('0x12')](function(_0x3e3835){if(_0x46d4f4){_0x46d4f4(null,_0x3e3835);}})[_0xec21('0x13')](function(_0x459bc3){if(_0x46d4f4){_0x46d4f4(_0x459bc3);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x3f73d9,_0x354d39,_0x3f2a5c,_0x49e76f){this[_0xec21('0xf')][_0xec21('0x37')]({'uniqueid':this[_0xec21('0xe')]['uniqueid'],'callerid':this['channel']['callerid'],'calleridname':this[_0xec21('0xe')][_0xec21('0x38')],'context':this[_0xec21('0xe')][_0xec21('0x39')],'extension':this[_0xec21('0xe')][_0xec21('0x3a')],'priority':this[_0xec21('0xe')]['priority'],'accountcode':this[_0xec21('0xe')][_0xec21('0x3b')],'dnid':this[_0xec21('0xe')][_0xec21('0x3c')],'projectName':this[_0xec21('0xe')][_0xec21('0x35')],'saveName':_0x354d39,'filename':_0x3f73d9[_0xec21('0x3d')]||_0x354d39,'savePath':_0x3f2a5c})[_0xec21('0x12')](function(_0x58cd1f){_0x49e76f(null,_0x58cd1f);})[_0xec21('0x13')](function(_0x21e67f){_0x49e76f(_0x21e67f);});};AGIVertices[_0xec21('0x14')]['createSquareMessage']=function(_0x5afbab,_0x51e954,_0x165d2d){this[_0xec21('0xf')]['createSquareMessage']({'uniqueid':this[_0xec21('0xe')][_0xec21('0x33')],'body':_0x5afbab,'direction':_0x51e954})[_0xec21('0x12')](function(_0x5d28ce){if(_0x165d2d){_0x165d2d(null,_0x5d28ce);}})[_0xec21('0x13')](function(_0x5e90eb){if(_0x165d2d){_0x165d2d(_0x5e90eb);}});};AGIVertices[_0xec21('0x14')]['createCmContact']=function(_0x251a68,_0x3f86a5){this[_0xec21('0xf')][_0xec21('0x3e')]({'firstName':_[_0xec21('0x3f')](_0x251a68['name'])||_[_0xec21('0x40')](_0x251a68['name'])?_0xec21('0x41')+Math['random']():_0x251a68[_0xec21('0x16')],'lastName':_[_0xec21('0x3f')](_0x251a68[_0xec21('0x42')])||_[_0xec21('0x40')](_0x251a68[_0xec21('0x42')])?null:_0x251a68[_0xec21('0x42')],'phone':_0x251a68['phone'],'ListId':_0x251a68[_0xec21('0x43')],'scheduledAt':_0x251a68[_0xec21('0x44')],'callbackUniqueid':this[_0xec21('0xe')][_0xec21('0x33')],'tags':'callback','description':_0xec21('0x45')+_0x251a68[_0xec21('0x44')][_0xec21('0x46')](),'priority':_0x251a68['callback_priority']})['then'](function(_0x674ba7){_0x3f86a5(null,_0x674ba7);})['catch'](function(_0x38873a){_0x3f86a5(_0x38873a);});};AGIVertices[_0xec21('0x14')]['getPause']=function(_0x5ab10b,_0x477ccb){this[_0xec21('0xf')][_0xec21('0x47')](_0x5ab10b)[_0xec21('0x12')](function(_0x21159c){_0x477ccb(null,_0x21159c?_0x21159c[_0xec21('0x16')]:![]);})[_0xec21('0x13')](function(_0x41e4f3){_0x477ccb(_0x41e4f3);});};AGIVertices['prototype'][_0xec21('0x48')]=function(_0x4d9339,_0x2d60e7,_0x47d734){var _0x3f2d3e={'role':_0xec21('0x49')};_0x3f2d3e[_0x4d9339]=this[_0xec21('0xe')][_0xec21('0x36')];this[_0xec21('0xf')]['agentPause'](_0x3f2d3e,_0x2d60e7,this['channel']['uniqueid'])[_0xec21('0x12')](function(_0x5a1be8){_0x47d734(null,_[_0xec21('0x40')](_0x5a1be8)?![]:!![]);})[_0xec21('0x13')](function(_0x16448c){logger[_0xec21('0x2f')](_0x16448c);_0x47d734(null,![]);});};AGIVertices[_0xec21('0x14')][_0xec21('0x4a')]=function(_0xfe9c9e,_0x155725){var _0x47636a={'role':'agent'};_0x47636a[_0xfe9c9e]=this[_0xec21('0xe')]['callerid'];this[_0xec21('0xf')][_0xec21('0x4a')](_0x47636a)[_0xec21('0x12')](function(_0x53729e){_0x155725(null,_['isNil'](_0x53729e)?![]:!![]);})[_0xec21('0x13')](function(_0x5a375e){logger['error'](_0x5a375e);_0x155725(null,![]);});};AGIVertices[_0xec21('0x14')][_0xec21('0x4b')]=function(_0x3280c7,_0x55ff27){var _0x10cfbd={'role':_0xec21('0x49')};_0x10cfbd[_0x3280c7]=this[_0xec21('0xe')][_0xec21('0x36')];this[_0xec21('0xf')][_0xec21('0x4b')](_0x10cfbd)['then'](function(_0x6db048){_0x55ff27(null,_[_0xec21('0x40')](_0x6db048)?![]:!![]);})[_0xec21('0x13')](function(_0x1b6078){logger['error'](_0x1b6078);_0x55ff27(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x1c601f,_0x3e74b7){var _0x36eda1={'role':_0xec21('0x49')};_0x36eda1[_0x1c601f]=this[_0xec21('0xe')][_0xec21('0x36')];var _0x25dd98=_0x1c601f!=_0xec21('0x4c')?util[_0xec21('0x27')](_0xec21('0x4d'),_0xec21('0x4e'),this[_0xec21('0xe')][_0xec21('0x36')]):undefined;this[_0xec21('0xf')][_0xec21('0x4f')](_0x36eda1,_0x25dd98)['then'](function(_0x18113b){_0x3e74b7(null,_[_0xec21('0x40')](_0x18113b)?![]:!![]);})[_0xec21('0x13')](function(_0x9273d2){logger['error'](_0x9273d2);_0x3e74b7(null,![]);});};AGIVertices['prototype'][_0xec21('0x50')]=function(_0x3ee7ca,_0xd9050){sh[_0xec21('0x51')](_['trim'](_0x3ee7ca),function(_0x3e4b39,_0x481fdc){var _0x4674cb=_0x481fdc['replace'](/(\r\n|\n|\r)/gm,'');_0xd9050(null,_0x4674cb);});};AGIVertices[_0xec21('0x14')][_0xec21('0x52')]=function(_0x1d4627,_0x5ed61d){scripts['googleTTS'](_0x1d4627[_0xec21('0x53')],_0x1d4627[_0xec21('0x54')]||'en',0x1)['then'](function(_0x53a8c2){_0x5ed61d(null,_0x53a8c2);})[_0xec21('0x13')](function(_0x1d7b6c){_0x5ed61d(_0x1d7b6c);});};AGIVertices['prototype']['googleDialogflow']=function(_0xfc9ed4,_0x34ae3f){scripts['googleDialogflow'](this[_0xec21('0xe')]['uniqueid'],_0xfc9ed4['key'],_0xfc9ed4[_0xec21('0x53')],_0xfc9ed4[_0xec21('0x55')]||'en')['then'](function(_0x2f973b){_0x34ae3f(null,_0x2f973b);})[_0xec21('0x13')](function(_0x55fac0){_0x34ae3f(_0x55fac0);});};AGIVertices[_0xec21('0x14')]['sestekNDA']=function(_0x5d822f,_0xde9c74){scripts[_0xec21('0x56')](this[_0xec21('0xe')],_0x5d822f)[_0xec21('0x12')](function(_0x19ce61){_0xde9c74(null,_0x19ce61);})[_0xec21('0x13')](function(_0x3e6468){_0xde9c74(_0x3e6468);});};AGIVertices[_0xec21('0x14')][_0xec21('0x57')]=function(_0x4aab85,_0x46f1f8){scripts[_0xec21('0x57')](_0x4aab85['key'],_0x4aab85['text'],_0x4aab85[_0xec21('0x58')]||_0xec21('0x59'),_0x4aab85[_0xec21('0x5a')])[_0xec21('0x12')](function(_0x3513f4){_0x46f1f8(null,_0x3513f4);})[_0xec21('0x13')](function(_0x535b20){_0x46f1f8(_0x535b20);});};AGIVertices[_0xec21('0x14')][_0xec21('0x5b')]=function(_0x2d61ce,_0x2f1449,_0x1f1dd4){scripts[_0xec21('0x5b')](_0x2f1449,_0x2d61ce[_0xec21('0x5c')],_0x2d61ce[_0xec21('0x5d')]||_0xec21('0x59'),this[_0xec21('0x5e')](_0x2d61ce[_0xec21('0x5f')])?_0x2d61ce[_0xec21('0x5f')]:undefined)[_0xec21('0x12')](function(_0x50d547){_0x1f1dd4(null,_0x50d547);})['catch'](function(_0x318255){_0x1f1dd4(_0x318255);});};AGIVertices['prototype'][_0xec21('0x60')]=function(_0xf2227c,_0x3898e8){scripts[_0xec21('0x60')](_0xf2227c[_0xec21('0x61')],_0xf2227c[_0xec21('0x62')],_0xf2227c[_0xec21('0x63')],_0xf2227c[_0xec21('0x64')]||_0xec21('0x65'),_0xf2227c['text'],_0xf2227c[_0xec21('0x66')]||_0xec21('0x53'))['then'](function(_0xfee0b1){_0x3898e8(null,_0xfee0b1);})[_0xec21('0x13')](function(_0x1cbca1){_0x3898e8(_0x1cbca1);});};AGIVertices[_0xec21('0x14')][_0xec21('0x67')]=function(_0x1b5ecf,_0x1109cc){scripts[_0xec21('0x67')](this[_0xec21('0xe')][_0xec21('0x33')],_0x1b5ecf[_0xec21('0x61')],_0x1b5ecf[_0xec21('0x62')],_0x1b5ecf[_0xec21('0x68')],_0x1b5ecf[_0xec21('0x53')],_0x1b5ecf[_0xec21('0x69')])['then'](function(_0x138d1c){_0x1109cc(null,_0x138d1c);})[_0xec21('0x13')](function(_0x137c10){_0x1109cc(_0x137c10);});};AGIVertices[_0xec21('0x14')][_0xec21('0x6a')]=function(_0xaac4f7,_0x3f3bf0,_0x595f59){scripts[_0xec21('0x6a')](_0x3f3bf0,_0xaac4f7[_0xec21('0x5c')],_0xaac4f7[_0xec21('0x6b')]||_0xec21('0x59'))['then'](function(_0x40e19a){_0x595f59(null,_0x40e19a);})['catch'](function(_0x2db996){_0x595f59(_0x2db996);});};AGIVertices['prototype'][_0xec21('0x6c')]=function(_0x5b939c,_0x4b13a3,_0xc7ba9d){scripts[_0xec21('0x6c')](_0x4b13a3,_0x5b939c[_0xec21('0x6d')],_0x5b939c[_0xec21('0x6e')],_0x5b939c[_0xec21('0x6f')])[_0xec21('0x12')](function(_0x4dd684){_0xc7ba9d(null,_0x4dd684);})[_0xec21('0x13')](function(_0x2a606d){_0xc7ba9d(_0x2a606d);});};AGIVertices['prototype']['clear']=function(_0x2cbd81){var _0xfb706c=_[_0xec21('0x70')](verticesWithRetry,_0x2cbd81['agicommand'])?_0x2cbd81:_[_0xec21('0x71')](_0x2cbd81);for(var _0x2ddc2a in _0xfb706c){if(_0xfb706c['hasOwnProperty'](_0x2ddc2a)){if(_0xfb706c[_0x2ddc2a]&&_[_0xec21('0x72')](_0xfb706c[_0x2ddc2a])){_0xfb706c[_0x2ddc2a]=this[_0xec21('0x73')](_0xfb706c[_0x2ddc2a]);}}}return _0xfb706c;};AGIVertices[_0xec21('0x14')][_0xec21('0x73')]=function(_0x478f7a){var _0x45d2fc=_0x478f7a[_0xec21('0x74')]('{');for(var _0xb3f47b=0x1;_0xb3f47b<_0x45d2fc[_0xec21('0x75')];_0xb3f47b+=0x1){var _0x27a859=_0x45d2fc[_0xb3f47b]['split']('}');if(_0x27a859['length']>0x1){_0x478f7a=_0x478f7a[_0xec21('0x76')]('{'+_0x27a859[0x0]+'}',this['channel'][_0xec21('0x11')](_0x27a859[0x0])[_0xec21('0x77')]||_0x27a859[0x0]);}}if(_0x45d2fc[_0xec21('0x75')]===0x1){return _0x478f7a[_0xec21('0x46')]();}return this[_0xec21('0x73')](_0x478f7a);};AGIVertices[_0xec21('0x14')][_0xec21('0x78')]=function(_0x1b2205,_0x35bd80){var _0x58491e=this[_0xec21('0xe')][_0xec21('0x11')](_0x1b2205);if(_0x58491e[_0xec21('0x79')]===-0x1){return _0x58491e;}logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x7a'),_0x35bd80,_0x58491e[_0xec21('0x77')]));return this['channel']['setVariable'](_0x35bd80,_0x58491e[_0xec21('0x77')]);};AGIVertices[_0xec21('0x14')][_0xec21('0x5e')]=function(_0x43d13a){return _0x43d13a&&_0x43d13a!=='0'&&_0x43d13a!=='-1'&&_0x43d13a!=='';};AGIVertices['prototype'][_0xec21('0x7b')]=function(_0x37df7c){this[_0xec21('0x7c')][_0xec21('0x7d')](this,_0x37df7c,'-');_0x37df7c[_0xec21('0x7e')]=_0x37df7c[_0xec21('0x7b')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xec21('0x14')][_0xec21('0x7')]=function(_0x4b85e8){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x7f'),_0x4b85e8[_0xec21('0x80')]));return this[_0xec21('0xe')][_0xec21('0x7')]([_0x4b85e8[_0xec21('0x81')],_0x4b85e8[_0xec21('0x82')]]);};AGIVertices[_0xec21('0x14')][_0xec21('0x83')]=function(_0x148f67){logger[_0xec21('0x2b')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x148f67['label']));if(this[_0xec21('0x5e')](_0x148f67[_0xec21('0x84')])){logger['info'](util[_0xec21('0x27')](_0xec21('0x85'),_0x148f67[_0xec21('0x84')]));var _0x59eb56=this[_0xec21('0xe')][_0xec21('0x86')](_0x148f67[_0xec21('0x84')]);if(_0x59eb56[_0xec21('0x79')]===-0x1){return _0x59eb56;}}return this[_0xec21('0xe')][_0xec21('0x83')]();};AGIVertices[_0xec21('0x14')][_0xec21('0x87')]=function(_0x4c4eb5){logger['info'](util[_0xec21('0x27')](_0xec21('0x88'),_0x4c4eb5[_0xec21('0x80')]));if(!this['isConfigured'](_0x4c4eb5[_0xec21('0x43')])){return this['channel'][_0xec21('0x2f')](_0x4c4eb5,_0xec21('0x89'));}_0x4c4eb5[_0xec21('0x44')]=moment();if(this[_0xec21('0x5e')](_0x4c4eb5[_0xec21('0x8a')])){_0x4c4eb5[_0xec21('0x44')]=moment()['add'](_0x4c4eb5[_0xec21('0x8a')],_0xec21('0x8b'));}if(!this[_0xec21('0x5e')](_0x4c4eb5[_0xec21('0x8c')])){_0x4c4eb5['callback_priority']=0x2;}this[_0xec21('0x3e')][_0xec21('0x7d')](this,_0x4c4eb5);return this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x4c4eb5[_0xec21('0x8e')],_0x4c4eb5[_0xec21('0x43')],_0x4c4eb5[_0xec21('0x44')]));};AGIVertices[_0xec21('0x14')][_0xec21('0x8f')]=function(_0x59237f){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x59237f[_0xec21('0x80')]));var _0x5cdce6=this[_0xec21('0xe')]['exec'](_0x59237f[_0xec21('0x90')],_0x59237f['options']);if(_0x5cdce6[_0xec21('0x79')]===-0x1){return _0x5cdce6;}return this['channel']['noop'](util[_0xec21('0x27')]('Executed\x20command\x20%s\x20%s',_0x59237f[_0xec21('0x90')],_0x59237f['options']));};AGIVertices[_0xec21('0x14')]['lumenvoxtts']=function(_0x11b1c2){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x91'),_0x11b1c2['label']));if(!this[_0xec21('0x5e')](_0x11b1c2['text'])){return this['channel']['noop']('no\x20text\x20configured');}var _0x4fbb58='\x22'+_0x11b1c2[_0xec21('0x53')]+'\x22';if(this[_0xec21('0x5e')](_0x11b1c2['options'])){_0x4fbb58+=','+_0x11b1c2[_0xec21('0x92')];}var _0x37e4fe=this[_0xec21('0xe')][_0xec21('0x51')]('MRCPSynth',_0x4fbb58);if(_0x37e4fe[_0xec21('0x79')]===-0x1){return _0x37e4fe;}return this['channel']['noop'](util[_0xec21('0x27')](_0xec21('0x93'),_0x4fbb58));};AGIVertices['prototype'][_0xec21('0x94')]=function(_0x46400c){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x46400c['label']));if(!this[_0xec21('0x5e')](_0x46400c[_0xec21('0x53')])){return this[_0xec21('0xe')][_0xec21('0x8d')]('no\x20text\x20configured');}var _0x7112c='\x22'+_0x46400c[_0xec21('0x53')]+'\x22';if(this[_0xec21('0x5e')](_0x46400c[_0xec21('0x92')])){_0x7112c+=','+_0x46400c[_0xec21('0x92')];}var _0x42be15=this['channel'][_0xec21('0x51')](_0xec21('0x95'),_0x7112c);if(_0x42be15[_0xec21('0x79')]===-0x1){return _0x42be15;}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x93'),_0x7112c));};AGIVertices[_0xec21('0x14')][_0xec21('0x96')]=function(_0x607101){logger[_0xec21('0x2b')](util['format'](_0xec21('0x97'),_0x607101['label']));if(!this[_0xec21('0x5e')](_0x607101[_0xec21('0x98')])){return this[_0xec21('0xe')]['noop'](_0xec21('0x99'));}var _0x4ff3ee=_0x607101[_0xec21('0x98')];if(this[_0xec21('0x5e')](_0x607101[_0xec21('0x92')])){_0x4ff3ee+=','+_0x607101[_0xec21('0x92')];}var _0x2c90eb=this[_0xec21('0xe')][_0xec21('0x51')](_0xec21('0x9a'),_0x4ff3ee);if(_0x2c90eb[_0xec21('0x79')]===-0x1){return _0x2c90eb;}var _0x4cf8e9=this[_0xec21('0x78')](_0xec21('0x9b'),_0xec21('0x9c'));if(_0x4cf8e9[_0xec21('0x79')]===-0x1){return _0x4cf8e9;}var _0x3e8a4f=this['getAndSetVariable'](_0xec21('0x9d'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x3e8a4f[_0xec21('0x79')]===-0x1){return _0x3e8a4f;}var _0x5af495=this[_0xec21('0x78')](_0xec21('0x9e'),'LUMENVOX_ASR_INSTANCE');if(_0x5af495[_0xec21('0x79')]===-0x1){return _0x5af495;}return this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x9f'),_0x4ff3ee));};AGIVertices[_0xec21('0x14')][_0xec21('0xa0')]=function(_0x44da78){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x44da78[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x44da78[_0xec21('0x98')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x99'));}var _0x5e52e2=_0x44da78[_0xec21('0x98')];if(this[_0xec21('0x5e')](_0x44da78[_0xec21('0x92')])){_0x5e52e2+=','+_0x44da78[_0xec21('0x92')];}var _0x213e30=this[_0xec21('0xe')][_0xec21('0x51')](_0xec21('0x9a'),_0x5e52e2);if(_0x213e30['result']===-0x1){return _0x213e30;}var _0x56f67d=this[_0xec21('0x78')](_0xec21('0x9b'),_0xec21('0xa1'));if(_0x56f67d[_0xec21('0x79')]===-0x1){return _0x56f67d;}var _0x45e14a=this[_0xec21('0x78')](_0xec21('0x9d'),_0xec21('0xa2'));if(_0x45e14a[_0xec21('0x79')]===-0x1){return _0x45e14a;}var _0x3f8bb4=this[_0xec21('0x78')](_0xec21('0x9e'),'SESTEK_ASR_INSTANCE');if(_0x3f8bb4['result']===-0x1){return _0x3f8bb4;}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x9f'),_0x5e52e2));};AGIVertices['prototype'][_0xec21('0xa3')]=function(_0x4d473d){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x4d473d[_0xec21('0x80')]));if(!this['isConfigured'](_0x4d473d['odbc_id'])){return this['channel'][_0xec21('0x2f')](_0x4d473d,_0xec21('0xa4'));}var _0xffe99a=this[_0xec21('0x19')][_0xec21('0x7d')](this,_0x4d473d['odbc_id']);if(!_0xffe99a){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4d473d,'no\x20odbc\x20database\x20found');}if(!this[_0xec21('0x5e')](_0x4d473d['query'])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4d473d,'no\x20query\x20configured');}var _0x2b99ce=_0x4d473d[_0xec21('0x2c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xec21('0xe')]['noop'](util['format'](_0xec21('0xa5'),_0x2b99ce));var _0x3c5a2a=this['getQueryOdbc'][_0xec21('0x7d')](this,_0xffe99a,_0x2b99ce);this[_0xec21('0x7c')][_0xec21('0x7d')](this,_0x4d473d,_0x2b99ce);if(!this[_0xec21('0x5e')](_0x4d473d[_0xec21('0xa6')])){return this['channel'][_0xec21('0x8d')](_0xec21('0xa7'));}var _0x336ac0=this['getVariable'][_0xec21('0x7d')](this,_0x4d473d['variable_id']);if(!_0x336ac0){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4d473d,_0xec21('0xa8'));}var _0x239b81=this;_0x3c5a2a[_0xec21('0xa9')](function(_0x3201d3,_0x1c8360){Object[_0xec21('0xaa')](_0x3201d3)[_0xec21('0xa9')](function(_0x588c33){_0x239b81['channel']['setVariable'](util[_0xec21('0x27')](_0xec21('0xab'),_0x336ac0,_0x1c8360,_0x588c33),_0x3201d3[_0x588c33]);});});this['channel'][_0xec21('0xac')](util[_0xec21('0x27')](_0xec21('0xad'),_0x336ac0),_0x3c5a2a['length']);return this['channel']['noop'](util[_0xec21('0x27')](_0xec21('0xae'),_0x336ac0));};AGIVertices[_0xec21('0x14')][_0xec21('0xaf')]=function(_0x3ef59f){logger[_0xec21('0xb0')](util['format'](_0xec21('0xb1'),_0x3ef59f[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x3ef59f[_0xec21('0xb2')])){return this['channel']['error'](_0x3ef59f,_0xec21('0xb3'));}var _0x17cbbf=this['getUser']['sync'](this,_0x3ef59f['sip_id']);if(!_0x17cbbf){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x3ef59f,'no\x20user\x20found');}var _0x14d4f0=this[_0xec21('0xe')][_0xec21('0x51')](_0xec21('0xb4'),[util[_0xec21('0x27')]('SIP/%s',_0x17cbbf),_0x3ef59f[_0xec21('0x84')],_0x3ef59f['opts'],_0x3ef59f[_0xec21('0xb5')]]);if(_0x14d4f0['result']===-0x1){return _0x14d4f0;}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')]('Executed\x20command\x20%s',_0xec21('0xb4')));};AGIVertices[_0xec21('0x14')][_0xec21('0xb6')]=function(_0x242756){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xb7'),_0x242756[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x242756[_0xec21('0x5c')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb8'));}if(!this[_0xec21('0x5e')](_0x242756[_0xec21('0x53')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb9'));}this[_0xec21('0xe')][_0xec21('0xba')]=!![];this['createSquareDetailsReport'](_0x242756);this['createSquareMessage'](_0x242756['text'],'in');this['channel'][_0xec21('0x8d')](util['format'](_0xec21('0xbb'),_0x242756[_0xec21('0x53')]));var _0x11dd67=this['googleDialogflow']['sync'](this,_0x242756);if(_0x11dd67){for(var _0x51665c in _0x11dd67){if(_0x11dd67[_0xec21('0xbc')](_0x51665c)){this[_0xec21('0xe')]['setVariable'](util['format'](_0xec21('0xbd'),_0x51665c[_0xec21('0xbe')]()),_0x11dd67[_0x51665c]);}}this[_0xec21('0xbf')](_0x11dd67[_0xec21('0xc0')],_0xec21('0xc1'));return this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0xc2'),_0x11dd67[_0xec21('0xc0')]));}return this[_0xec21('0xe')]['error'](_0x242756,_0xec21('0xc3'));};AGIVertices[_0xec21('0x14')][_0xec21('0xc4')]=function(_0x46b266){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x46b266[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x46b266[_0xec21('0xc5')])){return this['channel']['noop']('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x46b266[_0xec21('0xc6')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xc7'));}if(!this['isConfigured'](_0x46b266[_0xec21('0xc8')])){return this['channel'][_0xec21('0x8d')](_0xec21('0xc9'));}if(!this['isConfigured'](_0x46b266[_0xec21('0xca')])){return this['channel'][_0xec21('0x8d')](_0xec21('0xb9'));}this[_0xec21('0xe')]['bot']=!![];this[_0xec21('0x7c')](_0x46b266);this[_0xec21('0xbf')](_0x46b266['text'],'in');this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0xcb'),_0x46b266['text']));var _0x46703a=this['sestekNDA']['sync'](this,_0x46b266);if(_0x46703a){for(var _0x23a914 in _0x46703a){if(_0x46703a[_0xec21('0xbc')](_0x23a914)){this[_0xec21('0xe')][_0xec21('0xac')](util[_0xec21('0x27')](_0xec21('0xcc'),_0x23a914[_0xec21('0xbe')]()),_0x46703a[_0x23a914]);}}this[_0xec21('0xbf')](_0x46703a[_0xec21('0xc0')],'out');if(_0x46703a[_0xec21('0xcd')]){this['channel']['noop'](util['format'](_0xec21('0xce'),_0x46703a[_0xec21('0xcd')]));var _0x1494c6=this[_0xec21('0xe')]['streamFile'](_0x46703a['audiofile']);try{fs[_0xec21('0xcf')](_0x46703a[_0xec21('0xcd')]+_0xec21('0xd0'));}catch(_0x382378){logger['error'](_0x382378);}return _0x1494c6;}else{return this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')](_0xec21('0xd1'),_0x46703a[_0xec21('0xc0')]));}}return this[_0xec21('0xe')][_0xec21('0x2f')](_0x46b266,_0xec21('0xd2'));};AGIVertices[_0xec21('0x14')][_0xec21('0xd3')]=function(_0x552c19){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xd4'),_0x552c19[_0xec21('0x80')]));return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xd3'));};AGIVertices['prototype']['ext_dial']=function(_0x4a23c9){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xd5'),_0x4a23c9['label']));var _0x5d5e3c='';if(_0x4a23c9[_0xec21('0xd6')]){if(!this[_0xec21('0x5e')](_0x4a23c9[_0xec21('0xd6')])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4a23c9,'no\x20trunk\x20selected');}else{var _0x2fbf81=parseInt(_0x4a23c9[_0xec21('0xd6')],0xa);if(isNaN(_0x2fbf81)){_0x5d5e3c=_0x4a23c9[_0xec21('0xd6')];}else{_0x5d5e3c=this[_0xec21('0x1b')][_0xec21('0x7d')](this,_0x4a23c9[_0xec21('0xd6')]);if(!_0x5d5e3c){return this['channel'][_0xec21('0x2f')](_0x4a23c9,'no\x20trunk\x20found');}}}}else if(_0x4a23c9[_0xec21('0xd7')]){_0x5d5e3c=_0x4a23c9[_0xec21('0xd7')];}else{return this[_0xec21('0xe')]['error'](_0x4a23c9,_0xec21('0xd8'));}var _0x559b97=this[_0xec21('0xe')][_0xec21('0x51')](_0xec21('0xb4'),[util[_0xec21('0x27')](_0xec21('0xd9'),_0x5d5e3c,_0x4a23c9['phone']),_0x4a23c9[_0xec21('0x84')],_0x4a23c9[_0xec21('0xda')],_0x4a23c9[_0xec21('0xb5')]]);if(_0x559b97[_0xec21('0x79')]===-0x1){return _0x559b97;}return this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0xdb'),'DIAL'));};AGIVertices[_0xec21('0x14')][_0xec21('0xdc')]=function(_0x4b40df){logger[_0xec21('0x2b')](util['format'](_0xec21('0xdd'),_0x4b40df['label']));return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xdc'));};AGIVertices[_0xec21('0x14')]['getdigits']=function(_0x3f5a5a){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xde'),_0x3f5a5a[_0xec21('0x80')]));if(_0x3f5a5a['retry']===0x0){return this[_0xec21('0x7b')](_0x3f5a5a);}_0x3f5a5a[_0xec21('0x7e')]-=0x1;if(!this[_0xec21('0x5e')](_0x3f5a5a[_0xec21('0xdf')])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x3f5a5a,_0xec21('0xe0'));}var _0x5d1971=this[_0xec21('0xe1')]['sync'](this,_0x3f5a5a[_0xec21('0xdf')]);if(!_0x5d1971){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x3f5a5a,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x3f5a5a[_0xec21('0xa6')])){return this[_0xec21('0xe')]['error'](_0xec21('0xa7'));}var _0x7944e5=this[_0xec21('0xe')][_0xec21('0xe2')](_0x5d1971,_0x3f5a5a['response'],_0x3f5a5a['maxdigit']);var _0x1f7719=_0x7944e5[_0xec21('0x79')]?_0x7944e5[_0xec21('0x79')][_0xec21('0x46')]():'';logger['info'](_0xec21('0xe3'),JSON['stringify'](_0x7944e5));if(_0x7944e5['result']===-0x1){this[_0xec21('0x7c')]['sync'](this,_0x3f5a5a,_0x1f7719);return _0x7944e5;}else if(_0x7944e5[_0xec21('0x77')]===_0xec21('0x84')){_0x7944e5[_0xec21('0x79')]=_0x1f7719[_0xec21('0x75')]>=parseInt(_0x3f5a5a[_0xec21('0xe4')])?'x':'i';}else{_0x7944e5[_0xec21('0x79')]=_0x1f7719[_0xec21('0x75')]>=parseInt(_0x3f5a5a[_0xec21('0xe4')])&&_0x1f7719['length']<=parseInt(_0x3f5a5a[_0xec21('0xe5')])?'x':'i';}var _0x2afee7=this['getVariable'][_0xec21('0x7d')](this,_0x3f5a5a[_0xec21('0xa6')]);if(!_0x2afee7){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x3f5a5a,_0xec21('0xa8'));}this[_0xec21('0xe')][_0xec21('0xac')](_0x2afee7,_0x1f7719);if(this[_0xec21('0x5e')](_0x3f5a5a['hiddendigitsnum'])){var _0x5d1268=parseInt(_0x3f5a5a['hiddendigitsnum'],0xa);var _0x4f8ed5=rs['generate']({'charset':'*','length':_0x5d1268});var _0x53d61b=_0x1f7719[_0xec21('0x75')];if(_0x53d61b>0x0){if(_0x53d61b>_0x5d1268){this['createSquareDetailsReport'][_0xec21('0x7d')](this,_0x3f5a5a,_0x3f5a5a[_0xec21('0xe6')]===_0xec21('0xe7')?_0x4f8ed5+_0x1f7719[_0xec21('0xe8')](_0x5d1268):_0x1f7719[_0xec21('0xe8')](0x0,_0x53d61b-_0x5d1268)+_0x4f8ed5);}else{this[_0xec21('0x7c')]['sync'](this,_0x3f5a5a,rs[_0xec21('0xe9')]({'charset':'*','length':_0x53d61b}));}}else{this[_0xec21('0x7c')]['sync'](this,_0x3f5a5a,'');}}else{this[_0xec21('0x7c')][_0xec21('0x7d')](this,_0x3f5a5a,_0x1f7719);}return _0x7944e5;};AGIVertices[_0xec21('0x14')]['getsecretdigits']=function(_0x18f3e5){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xea'),_0x18f3e5[_0xec21('0x80')]));return this[_0xec21('0xc')](_0x18f3e5);};AGIVertices['prototype'][_0xec21('0xeb')]=function(_0xadbf1a){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xec'),_0xadbf1a['label']));this[_0xec21('0x7c')]['sync'](this,_0xadbf1a,_0xadbf1a['goalname']);return this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')]('GOAL\x20%s',_0xadbf1a['goalname']));};AGIVertices[_0xec21('0x14')][_0xec21('0xed')]=function(_0x20b693){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xee'),_0x20b693['label']));if(!this[_0xec21('0x5e')](_0x20b693['aws_access_key_id'])||!this[_0xec21('0x5e')](_0x20b693[_0xec21('0x62')])){return this['channel'][_0xec21('0x8d')](_0xec21('0xef'));}if(!this[_0xec21('0x5e')](_0x20b693['text'])){return this['channel']['noop']('no\x20text\x20configured');}this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0xf0'),_0x20b693[_0xec21('0x53')]));var _0x394e73=this['awsPolly'][_0xec21('0x7d')](this,_0x20b693);if(_0x394e73){this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0xf1'),_0x394e73));var _0x4c418a=this[_0xec21('0xe')][_0xec21('0xf2')](_0x394e73);try{fs[_0xec21('0xcf')](_0x394e73+'.wav');}catch(_0x35a82f){logger[_0xec21('0x2f')](_0x35a82f);}return _0x4c418a;}return this['channel'][_0xec21('0x2f')](_0x20b693,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xec21('0x14')][_0xec21('0xf3')]=function(_0x157cbe){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x157cbe[_0xec21('0x80')]));if(!this['isConfigured'](_0x157cbe[_0xec21('0x61')])||!this[_0xec21('0x5e')](_0x157cbe['aws_secret_access_key'])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xef'));}if(!this[_0xec21('0x5e')](_0x157cbe[_0xec21('0x69')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xf4'));}if(!this[_0xec21('0x5e')](_0x157cbe[_0xec21('0x53')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb9'));}this[_0xec21('0xe')]['bot']=!![];this[_0xec21('0x7c')](_0x157cbe);this[_0xec21('0xbf')](_0x157cbe[_0xec21('0x53')],'in');this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0xf5'),_0x157cbe['text']));var _0x9379d6=this[_0xec21('0x67')]['sync'](this,_0x157cbe);if(_0x9379d6){for(var _0x31bf00 in _0x9379d6){if(_0x9379d6[_0xec21('0xbc')](_0x31bf00)&&_[_0xec21('0x72')](_0x9379d6[_0x31bf00])){this[_0xec21('0xe')]['setVariable'](util[_0xec21('0x27')](_0xec21('0xf6'),_0x31bf00[_0xec21('0xbe')]()),_0x9379d6[_0x31bf00]);}}if(_[_0xec21('0x40')](_0x9379d6['message'])){return this['channel'][_0xec21('0x8d')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xec21('0xbf')](_0x9379d6[_0xec21('0xf7')],_0xec21('0xc1'));return this[_0xec21('0xe')]['noop'](util['format'](_0xec21('0xf8'),_0x9379d6[_0xec21('0xf7')]));}}return this[_0xec21('0xe')][_0xec21('0x2f')](_0x157cbe,_0xec21('0xf9'));};AGIVertices[_0xec21('0x14')]['googleasr']=function(_0x785bc7){logger['info'](util['format'](_0xec21('0xfa'),_0x785bc7[_0xec21('0x80')],_0x785bc7[_0xec21('0x84')]));if(!this[_0xec21('0x5e')](_0x785bc7[_0xec21('0x5c')])){return this['channel'][_0xec21('0x8d')](_0xec21('0xb8'));}var _0x5f08b5=_0xec21('0xfb');var _0x7316a3=util['format'](_0xec21('0xfc'),FILES_PATH,rs['generate'](0x4));var _0x513e1=util['format'](_0xec21('0xfd'),_0x7316a3,_0x5f08b5);var _0x36d84c=!![];if(_0x785bc7[_0xec21('0xfe')]===_0xec21('0xff')){_0x36d84c=![];}var _0x14245a=this[_0xec21('0xe')]['recordFile'](_0x7316a3,_0x5f08b5,_0x785bc7[_0xec21('0x100')],_0x785bc7[_0xec21('0x84')],undefined,_0x36d84c);if(_0x14245a[_0xec21('0x79')]!==-0x1){this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x101'),_0x513e1));var _0x5f235e=this[_0xec21('0x6a')][_0xec21('0x7d')](this,_0x785bc7,_0x513e1);if(_0x5f235e){for(var _0x33f413 in _0x5f235e){if(_0x5f235e[_0xec21('0xbc')](_0x33f413)){this[_0xec21('0xe')][_0xec21('0xac')](util['format'](_0xec21('0x102'),_0x33f413[_0xec21('0xbe')]()),_0x5f235e[_0x33f413]);}}return this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')]('GoogleASR\x20Result\x20%s',JSON[_0xec21('0x103')](_0x5f235e)));}}return _0x14245a;};AGIVertices[_0xec21('0x14')]['tildeasr']=function(_0x4c5829){logger['info'](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4c5829[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x4c5829[_0xec21('0x6d')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x104'));}if(!this[_0xec21('0x5e')](_0x4c5829[_0xec21('0x6e')])){return this[_0xec21('0xe')][_0xec21('0x8d')]('no\x20appsecret\x20configured');}var _0x5bff2a='wav';var _0x25d96f=util['format'](_0xec21('0xfc'),FILES_PATH,rs[_0xec21('0xe9')](0x4));var _0x358e4e=util['format']('%s.%s',_0x25d96f,_0x5bff2a);var _0x1a705e=!![];if(_0x4c5829['beep']===_0xec21('0xff')){_0x1a705e=![];}var _0x2fdf09=this[_0xec21('0xe')]['recordFile'](_0x25d96f,_0x5bff2a,_0x4c5829[_0xec21('0x100')],_0x4c5829[_0xec21('0x84')],undefined,_0x1a705e);if(_0x2fdf09[_0xec21('0x79')]!==-0x1){this[_0xec21('0xe')]['noop'](util['format'](_0xec21('0x105'),_0x358e4e));var _0x5d9d4d=this[_0xec21('0x6c')][_0xec21('0x7d')](this,_0x4c5829,_0x358e4e);if(_0x5d9d4d){for(var _0x4f0363 in _0x5d9d4d){if(_0x5d9d4d['hasOwnProperty'](_0x4f0363)){this[_0xec21('0xe')][_0xec21('0xac')](util[_0xec21('0x27')](_0xec21('0x106'),_0x4f0363[_0xec21('0xbe')]()),_0x5d9d4d[_0x4f0363]);}}return this[_0xec21('0xe')]['noop'](util['format'](_0xec21('0x107'),JSON[_0xec21('0x103')](_0x5d9d4d)));}}return _0x2fdf09;};AGIVertices[_0xec21('0x14')]['gotoc']=function(_0x5803e3){logger['info'](util['format'](_0xec21('0x108'),_0x5803e3['label']));return this[_0xec21('0xe')][_0xec21('0x109')](_0x5803e3[_0xec21('0x39')],_0x5803e3[_0xec21('0x3a')],_0x5803e3[_0xec21('0x10a')]);};AGIVertices[_0xec21('0x14')][_0xec21('0x10b')]=function(_0x1fc31c){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x10c'),_0x1fc31c['label']));if(!this[_0xec21('0x5e')](_0x1fc31c[_0xec21('0x10d')])){return this['channel']['error'](_0x1fc31c,_0xec21('0x10e'));}try{var _0xfc82f=eval(_0x1fc31c[_0xec21('0x10d')])?_0xec21('0x10f'):_0xec21('0x110');this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x111'),_0x1fc31c[_0xec21('0x10d')],_0xfc82f));return{'code':0xc8,'result':_0xfc82f};}catch(_0x1631a5){return{'code':0xc8,'result':_0xec21('0x110')};}};AGIVertices['prototype'][_0xec21('0x112')]=function(_0x4ee0df){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x4ee0df[_0xec21('0x80')]));if(!this['isConfigured'](_0x4ee0df['interval_id'])){return this['channel']['error'](_0x4ee0df,_0xec21('0x113'));}var _0x4638d0=this['getIntervals'][_0xec21('0x7d')](this,_0x4ee0df[_0xec21('0x114')]);if(!_0x4638d0){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4ee0df,_0xec21('0x115'));}for(var _0x36e272=0x0;_0x36e272<_0x4638d0[_0xec21('0x75')];_0x36e272+=0x1){var _0x237783=this[_0xec21('0xe')]['getVariable'](util[_0xec21('0x27')]('IFTIME(%s?true:false)',_0x4638d0[_0x36e272]));if(_0x237783[_0xec21('0x79')]===-0x1){return _0x237783;}logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x116'),_0x4638d0[_0x36e272],_0x237783['extra']));if(_0x237783[_0xec21('0x77')]===_0xec21('0x10f')){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x116'),_0x4638d0[_0x36e272],_0xec21('0x10f')));this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x116'),_0x4638d0[_0x36e272],_0xec21('0x10f')));return{'code':0xc8,'result':_0xec21('0x10f')};}else{logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x116'),_0x4638d0[_0x36e272],_0xec21('0x110')));this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x116'),_0x4638d0[_0x36e272],_0xec21('0x110')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xec21('0x14')][_0xec21('0x117')]=function(_0x419b5a){logger[_0xec21('0x2b')](util['format'](_0xec21('0x118'),_0x419b5a[_0xec21('0x80')]));return this[_0xec21('0xe')]['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x526cdb){logger[_0xec21('0x2b')](util['format'](_0xec21('0x119'),_0x526cdb[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x526cdb['key'])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb8'));}var _0x2e6f28=_0xec21('0xfb');var _0x38d2ff=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xec21('0xe9')](0x4));var _0x3eb7d2=util[_0xec21('0x27')](_0xec21('0xfd'),_0x38d2ff,_0x2e6f28);var _0x61fd8e=!![];if(_0x526cdb['beep']===_0xec21('0xff')){_0x61fd8e=![];}var _0x12edea=this['channel']['recordFile'](_0x38d2ff,_0x2e6f28,_0x526cdb[_0xec21('0x100')],_0x526cdb[_0xec21('0x84')],undefined,_0x61fd8e);if(_0x12edea['result']!==-0x1){this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x11a'),_0x3eb7d2));var _0x44561c=this[_0xec21('0x5b')]['sync'](this,_0x526cdb,_0x3eb7d2);if(_0x44561c){for(var _0x3ce344 in _0x44561c){if(_0x44561c[_0xec21('0xbc')](_0x3ce344)){this[_0xec21('0xe')][_0xec21('0xac')](util[_0xec21('0x27')](_0xec21('0x11b'),_0x3ce344[_0xec21('0xbe')]()),_0x44561c[_0x3ce344]);}}return this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')](_0xec21('0x11c'),JSON['stringify'](_0x44561c)));}}return _0x12edea;};AGIVertices[_0xec21('0x14')][_0xec21('0x11d')]=function(_0x19989f){logger['info'](util[_0xec21('0x27')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x19989f[_0xec21('0x80')]));if(!this['isConfigured'](_0x19989f[_0xec21('0x5c')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb8'));}if(!this[_0xec21('0x5e')](_0x19989f[_0xec21('0x53')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb9'));}this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x11e'),_0x19989f[_0xec21('0x53')]));var _0x203f3e=this['ispeechTTS'][_0xec21('0x7d')](this,_0x19989f);if(_0x203f3e){this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x11a'),_0x203f3e));var _0x127fe6=this['channel'][_0xec21('0xf2')](_0x203f3e,_0x19989f[_0xec21('0x100')]);try{fs[_0xec21('0xcf')](_0x203f3e+_0xec21('0xd0'));}catch(_0x33c9c3){logger[_0xec21('0x2f')](_0x33c9c3);}return _0x127fe6;}return this[_0xec21('0xe')][_0xec21('0x2f')](_0x19989f,_0xec21('0x11f'));};AGIVertices[_0xec21('0x14')][_0xec21('0x120')]=function(_0x562cd2){logger[_0xec21('0x2b')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x562cd2[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x562cd2['findBy'])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x562cd2,'no\x20find\x20by\x20configured');}logger['info'](util[_0xec21('0x27')](_0xec21('0x121'),this[_0xec21('0xe')][_0xec21('0x36')],_0x562cd2[_0xec21('0x122')]));var _0x225df1=this[_0xec21('0x4f')][_0xec21('0x7d')](this,_0x562cd2['findBy']);if(_0x225df1){logger[_0xec21('0x2b')](util['format'](_0xec21('0x123'),this[_0xec21('0xe')][_0xec21('0x36')],_0x562cd2[_0xec21('0x122')]));this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x123'),this[_0xec21('0xe')]['callerid'],_0x562cd2['findBy']));return{'code':0xc8,'result':_0xec21('0x124')};}else{logger[_0xec21('0x2b')](util['format'](_0xec21('0x125'),this[_0xec21('0xe')][_0xec21('0x36')],_0x562cd2['findBy']));this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x125'),this[_0xec21('0xe')]['callerid'],_0x562cd2[_0xec21('0x122')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xec21('0x14')][_0xec21('0x126')]=function(_0x2802fc){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x127'),_0x2802fc[_0xec21('0x80')]));if(!this['isConfigured'](_0x2802fc[_0xec21('0x122')])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x2802fc,'no\x20find\x20by\x20configured');}logger[_0xec21('0x2b')](util['format'](_0xec21('0x121'),this[_0xec21('0xe')][_0xec21('0x36')],_0x2802fc[_0xec21('0x122')]));var _0x72a3e9=this[_0xec21('0x4b')][_0xec21('0x7d')](this,_0x2802fc[_0xec21('0x122')]);if(_0x72a3e9){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x123'),this[_0xec21('0xe')][_0xec21('0x36')],_0x2802fc['findBy']));this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x123'),this[_0xec21('0xe')][_0xec21('0x36')],_0x2802fc[_0xec21('0x122')]));return{'code':0xc8,'result':_0xec21('0x124')};}else{logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x125'),this[_0xec21('0xe')][_0xec21('0x36')],_0x2802fc[_0xec21('0x122')]));this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x125'),this['channel'][_0xec21('0x36')],_0x2802fc[_0xec21('0x122')]));return{'code':0xc8,'result':_0xec21('0x128')};}};AGIVertices['prototype'][_0xec21('0x129')]=function(_0x4ab574){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x12a'),_0x4ab574[_0xec21('0x80')]));if(!this['isConfigured'](_0x4ab574[_0xec21('0x12b')])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4ab574,_0xec21('0x12c'));}this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')](_0xec21('0x12d'),_0x4ab574[_0xec21('0x12b')]));var _0x53aff4=eval(_0x4ab574[_0xec21('0x12b')]);if(!this[_0xec21('0x5e')](_0x4ab574[_0xec21('0xa6')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xa7'));}var _0x3f6127=this[_0xec21('0x11')][_0xec21('0x7d')](this,_0x4ab574['variable_id']);if(!_0x3f6127){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4ab574,'no\x20variable\x20found');}if(_[_0xec21('0x12e')](_0x53aff4)){var _0xa4f8a9=this;_0x53aff4[_0xec21('0xa9')](function(_0x1f0abb,_0x5b757b){_0xa4f8a9[_0xec21('0xe')][_0xec21('0xac')](util[_0xec21('0x27')](_0xec21('0x12f'),_0x3f6127,_0x5b757b),_0x1f0abb);});return this['channel'][_0xec21('0x8d')](util['format'](_0xec21('0x130'),_0x3f6127));}else{return this[_0xec21('0xe')][_0xec21('0xac')](_0x3f6127,_0x53aff4);}};AGIVertices[_0xec21('0x14')][_0xec21('0xb')]=function(_0x10df3c){logger[_0xec21('0x2b')](util['format'](_0xec21('0x131'),_0x10df3c[_0xec21('0x80')]));if(_0x10df3c[_0xec21('0x7e')]===0x0){return this[_0xec21('0x7b')](_0x10df3c);}_0x10df3c[_0xec21('0x7e')]-=0x1;if(!this[_0xec21('0x5e')](_0x10df3c['file_id'])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x10df3c,_0xec21('0xe0'));}var _0x383b75=this[_0xec21('0xe1')]['sync'](this,_0x10df3c['file_id']);if(!_0x383b75){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x10df3c,_0xec21('0x132'));}var _0x1f6021=this[_0xec21('0xe')][_0xec21('0xe2')](_0x383b75,_0x10df3c[_0xec21('0x133')],_0x10df3c[_0xec21('0x134')]);var _0x12ae84=_0x1f6021[_0xec21('0x79')];if(_0x1f6021[_0xec21('0x79')]===-0x1){this[_0xec21('0x7c')][_0xec21('0x7d')](this,_0x10df3c,'-1');return _0x1f6021;}else if(_0x1f6021[_0xec21('0x77')]===_0xec21('0x84')){_0x1f6021[_0xec21('0x79')]=_0x1f6021[_0xec21('0x79')]['length']>0x0?_0x1f6021[_0xec21('0x79')]:'t';}else if(_['isEmpty'](_0x1f6021['result'])){_0x1f6021[_0xec21('0x79')]='#';_0x12ae84='#';}if(!this['isConfigured'](_0x10df3c[_0xec21('0xa6')])){this[_0xec21('0xe')]['noop'](_0xec21('0xa7'));}else{var _0x3df533=this[_0xec21('0x11')][_0xec21('0x7d')](this,_0x10df3c[_0xec21('0xa6')]);if(!_0x3df533){return this['channel'][_0xec21('0x2f')](_0x10df3c,_0xec21('0xa8'));}this[_0xec21('0xe')][_0xec21('0xac')](_0x3df533,_0x12ae84);}this[_0xec21('0x7c')][_0xec21('0x7d')](this,_0x10df3c,_0x12ae84);return _0x1f6021;};AGIVertices['prototype'][_0xec21('0x8d')]=function(_0x307cd4){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x135'),_0x307cd4['label']));return this['channel']['noop'](_0x307cd4[_0xec21('0x136')]||_0x307cd4[_0xec21('0x80')]);};AGIVertices[_0xec21('0x14')][_0xec21('0x137')]=function(_0x29e976){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x29e976['label']));if(!this['isConfigured'](_0x29e976['findBy'])){return this['channel'][_0xec21('0x2f')](_0x29e976,_0xec21('0x138'));}logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x121'),this['channel'][_0xec21('0x36')],_0x29e976[_0xec21('0x122')]));var _0x2dac51=this[_0xec21('0x139')][_0xec21('0x7d')](this,_0x29e976['pause_id']);var _0x4a1800=this[_0xec21('0x48')][_0xec21('0x7d')](this,_0x29e976[_0xec21('0x122')],_0x2dac51);if(_0x4a1800){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x123'),this['channel'][_0xec21('0x36')],_0x29e976[_0xec21('0x122')]));this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x123'),this[_0xec21('0xe')][_0xec21('0x36')],_0x29e976['findBy']));return{'code':0xc8,'result':_0xec21('0x124')};}else{logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x125'),this[_0xec21('0xe')][_0xec21('0x36')],_0x29e976[_0xec21('0x122')]));this[_0xec21('0xe')][_0xec21('0x8d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xec21('0xe')]['callerid'],_0x29e976['findBy']));return{'code':0xc8,'result':_0xec21('0x128')};}};AGIVertices[_0xec21('0x14')][_0xec21('0x13a')]=function(_0x2ac748){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x2ac748[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x2ac748[_0xec21('0xdf')])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x2ac748,_0xec21('0xe0'));}var _0x9e3709=this[_0xec21('0xe1')][_0xec21('0x7d')](this,_0x2ac748[_0xec21('0xdf')]);if(!_0x9e3709){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x2ac748,'no\x20file\x20audio\x20found');}var _0x32a8a8=this[_0xec21('0xe')]['exec'](_0xec21('0x13b'),[_0x9e3709,_0x2ac748[_0xec21('0xda')]]);if(_0x32a8a8[_0xec21('0x79')]===-0x1){return _0x32a8a8;}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x13c'),_0xec21('0x13b'),_0x9e3709));};AGIVertices[_0xec21('0x14')][_0xec21('0x13d')]=function(_0x4f5f3b){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4f5f3b[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x4f5f3b[_0xec21('0x13e')])){return this[_0xec21('0xe')]['error'](_0x4f5f3b,_0xec21('0x13f'));}var _0x2ca1db='';var _0x1f5f48=parseInt(_0x4f5f3b[_0xec21('0x13e')],0xa);if(isNaN(_0x1f5f48)){_0x2ca1db=_0x4f5f3b[_0xec21('0x13e')];}else{_0x2ca1db=this['getVoiceQueue'][_0xec21('0x7d')](this,_0x4f5f3b[_0xec21('0x13e')]);if(!_0x2ca1db){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4f5f3b,_0xec21('0x140'));}}var _0x3487d5='';if(this[_0xec21('0x5e')](_0x4f5f3b[_0xec21('0xdf')])){var _0x247989=this[_0xec21('0xe1')][_0xec21('0x7d')](this,_0x4f5f3b['file_id']);if(_0x247989){_0x3487d5=_0x247989;}}this['createSquareDetailsReport']['sync'](this,_0x4f5f3b,_0x2ca1db);if(_0x4f5f3b[_0xec21('0xda')][_0xec21('0x141')]('x')<0x0){_0x4f5f3b[_0xec21('0xda')]+='x';}if(_0x4f5f3b[_0xec21('0xda')][_0xec21('0x141')]('X')<0x0){_0x4f5f3b[_0xec21('0xda')]+='X';}this[_0xec21('0xe')][_0xec21('0xac')](_0xec21('0x142'),_0x2ca1db?_0x2ca1db[_0xec21('0x143')]():'');var _0x212bef=this[_0xec21('0xe')][_0xec21('0x51')]('QUEUE',[_0x2ca1db,_0x4f5f3b[_0xec21('0xda')],_0x4f5f3b[_0xec21('0xb5')],_0x3487d5,_0x4f5f3b[_0xec21('0x84')],_0x4f5f3b[_0xec21('0x7')],_0x4f5f3b[_0xec21('0x144')],_0x4f5f3b['gosub'],'',_0x4f5f3b['position']]);if(_0x212bef['result']===-0x1){return _0x212bef;}return this[_0xec21('0xe')][_0xec21('0x8d')](util['format']('Executed\x20command\x20%s\x20%s','QUEUE',_0x2ca1db));};AGIVertices['prototype']['record']=function(_0x2e9d5a){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x145'),_0x2e9d5a['label']));var _0x3b83b6=_0x2e9d5a[_0xec21('0x146')]||_0xec21('0xfb');var _0x130fcb=util[_0xec21('0x27')](_0xec21('0x147'),this['channel'][_0xec21('0x33')],rs['generate'](0x5));var _0x372c84=util['format'](_0xec21('0x148'),FILES_PATH,_0x130fcb,_0x3b83b6);var _0x45e73e=util['format'](_0xec21('0xfc'),FILES_PATH,_0x130fcb);this['createSquareRecording'][_0xec21('0x7d')](this,_0x2e9d5a,_0x130fcb,_0x372c84);this['channel']['setVariable'](_0xec21('0x149'),_0x130fcb);logger[_0xec21('0x2b')](_0xec21('0x14a'),_0x45e73e,_0x3b83b6,_0x2e9d5a[_0xec21('0x14b')],_0x2e9d5a[_0xec21('0x84')]);return this[_0xec21('0xe')]['recordFile'](_0x45e73e,_0x3b83b6,_0x2e9d5a[_0xec21('0x14b')],_0x2e9d5a['timeout'],undefined,!![]);};AGIVertices['prototype'][_0xec21('0x14c')]=function(_0x80c68d){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x14d'),_0x80c68d[_0xec21('0x80')]));return this[_0xec21('0xe')][_0xec21('0x14e')](_0x80c68d['digits']['replace'](/\s+/g,''),_0x80c68d[_0xec21('0x14b')]);};AGIVertices[_0xec21('0x14')]['saynumber']=function(_0x4b453b){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x14f'),_0x4b453b[_0xec21('0x80')]));return this[_0xec21('0xe')][_0xec21('0x150')](_0x4b453b[_0xec21('0x151')][_0xec21('0x152')](/\s+/g,''),_0x4b453b[_0xec21('0x14b')]);};AGIVertices['prototype'][_0xec21('0x153')]=function(_0x5dfc26){logger['info'](util['format'](_0xec21('0x154'),_0x5dfc26[_0xec21('0x80')]));return this[_0xec21('0xe')][_0xec21('0x155')](_0x5dfc26[_0xec21('0x53')],_0x5dfc26['escape_digits']);};AGIVertices[_0xec21('0x14')][_0xec21('0x156')]=function(_0x1dfa24){logger[_0xec21('0x2b')](util['format'](_0xec21('0x157'),_0x1dfa24['label']));if(!this[_0xec21('0x5e')](_0x1dfa24[_0xec21('0x158')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x159'));}var _0x4c2de4=this[_0xec21('0x1e')]['sync'](this,_0x1dfa24[_0xec21('0x158')]);if(!_0x4c2de4||!_0x4c2de4[_0xec21('0x15a')]){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x1dfa24,_0xec21('0x15b'));}var _0x408d9e={'from':util[_0xec21('0x27')](_0xec21('0x15c'),_0x4c2de4['name'],_0x4c2de4[_0xec21('0x15d')]||_0x4c2de4[_0xec21('0x15a')][_0xec21('0x15e')]),'to':_0x1dfa24['to']||'','cc':_0x1dfa24['cc']||'','bcc':_0x1dfa24['bcc']||'','subject':_0x1dfa24['subject'],'html':_0x1dfa24[_0xec21('0x53')],'text':_0x1dfa24[_0xec21('0x53')]};var _0x1dd0ca={'tls':{'rejectUnauthorized':![]}};if(_0x4c2de4[_0xec21('0x15a')][_0xec21('0x15f')]){_0x1dd0ca['service']=_0x4c2de4[_0xec21('0x15a')][_0xec21('0x15f')];}else{_0x1dd0ca[_0xec21('0x160')]=_0x4c2de4[_0xec21('0x15a')][_0xec21('0x160')];_0x1dd0ca[_0xec21('0x161')]=_0x4c2de4[_0xec21('0x15a')][_0xec21('0x161')];_0x1dd0ca[_0xec21('0x162')]=_0x4c2de4['Smtp'][_0xec21('0x162')];}if(_0x4c2de4[_0xec21('0x15a')][_0xec21('0x163')]){_0x1dd0ca[_0xec21('0x164')]={'user':_0x4c2de4[_0xec21('0x15a')][_0xec21('0x15e')],'pass':_0x4c2de4[_0xec21('0x15a')]['pass']};}if(this[_0xec21('0x5e')](_0x1dfa24[_0xec21('0x165')])){}logger['debug'](_0xec21('0x166'),JSON['stringify'](_0x408d9e));this['createSquareDetailsReport'][_0xec21('0x7d')](this,_0x1dfa24,_0x1dfa24[_0xec21('0x158')]);this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x167'),_0x4c2de4[_0xec21('0x16')]));this[_0xec21('0x20')][_0xec21('0x7d')](this,_0x1dd0ca,_0x408d9e);return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x168'));};AGIVertices[_0xec21('0x14')]['sendFax']=function(_0x556d66){logger['info'](util[_0xec21('0x27')](_0xec21('0x169'),_0x556d66[_0xec21('0x80')]));return this[_0xec21('0xe')]['noop'](_0xec21('0x16a'));};AGIVertices[_0xec21('0x14')][_0xec21('0x16b')]=function(_0x5036b3){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5036b3[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x5036b3['sms_account_id'])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x16c'));}var _0x197445=this[_0xec21('0x31')][_0xec21('0x7d')](this,_0x5036b3[_0xec21('0x16d')]);if(!_0x197445){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x5036b3,'no\x20sms\x20account\x20found');}var _0x59e2ed={'body':_0x5036b3['sms_text'],'phone':_0x5036b3['to']||'','SmsAccountId':_0x197445['id']};logger[_0xec21('0xb0')](_0xec21('0x16e'),JSON[_0xec21('0x103')](_0x59e2ed));this[_0xec21('0x7c')]['sync'](this,_0x5036b3,_0x5036b3[_0xec21('0x16d')]);this['channel']['noop'](util[_0xec21('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x197445[_0xec21('0x16')]));this[_0xec21('0x32')]['sync'](this,_0x59e2ed);return this['channel']['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xec21('0x14')]['set']=function(_0x48f1f1){logger[_0xec21('0x2b')](util['format'](_0xec21('0x16f'),_0x48f1f1['label']));if(!this[_0xec21('0x5e')](_0x48f1f1[_0xec21('0xa6')])){return this['channel'][_0xec21('0x2f')](_0x48f1f1,_0xec21('0x170'));}var _0x82c13a=this[_0xec21('0x11')]['sync'](this,_0x48f1f1[_0xec21('0xa6')]);if(!_0x82c13a){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x48f1f1,'no\x20variable\x20found');}return this[_0xec21('0xe')][_0xec21('0xac')](_0x82c13a,_0x48f1f1['variable_value']);};AGIVertices[_0xec21('0x14')]['start']=function(_0x46e68a){logger[_0xec21('0x2b')](util['format'](_0xec21('0x171'),_0x46e68a['label']));this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x172'));if(_0x46e68a['answer']===_0xec21('0x173')){this['channel'][_0xec21('0x8d')](_0xec21('0x174'));return this[_0xec21('0xe')][_0xec21('0x83')]();}return this['channel'][_0xec21('0x8d')](_0xec21('0x175'));};AGIVertices['prototype'][_0xec21('0x176')]=function(_0x495c3b){logger[_0xec21('0x2b')](util['format'](_0xec21('0x177'),_0x495c3b[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x495c3b[_0xec21('0x178')])){return this['channel'][_0xec21('0x2f')](_0x495c3b,_0xec21('0x179'));}var _0x9433e6=this[_0xec21('0x17')][_0xec21('0x7d')](this,_0x495c3b[_0xec21('0x178')]);if(!this['isConfigured'](_0x9433e6)){return this['channel'][_0xec21('0x2f')](_0x495c3b,util[_0xec21('0x27')](_0xec21('0x17a'),_0x495c3b['project_id']));}if(_0x9433e6===this[_0xec21('0xe')][_0xec21('0x35')]){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x495c3b,_0xec21('0x17b'));}this['createSquareDetailsReport'][_0xec21('0x7d')](this,_0x495c3b,_0x9433e6);var _0x696de2=this[_0xec21('0xe')]['exec'](_0xec21('0x17c'),util[_0xec21('0x27')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xec21('0x7')]['host']||_0xec21('0x17d'),_0x9433e6,this[_0xec21('0xe')][_0xec21('0x35')]));if(_0x696de2['result']===-0x1){return _0x696de2;}return this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')](_0xec21('0x13c'),_0xec21('0x17c'),_0x9433e6));};AGIVertices[_0xec21('0x14')][_0xec21('0x17e')]=function(_0x1ca126){logger[_0xec21('0x2b')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1ca126[_0xec21('0x80')]));var _0x39fd15=this[_0xec21('0x50')]['sync'](this,_0x1ca126[_0xec21('0x81')]);this[_0xec21('0x7c')]['sync'](this,_0x1ca126,_0x1ca126[_0xec21('0x81')]);if(this['isConfigured'](_0x1ca126[_0xec21('0xa6')])){var _0xc6bb78=this[_0xec21('0x11')][_0xec21('0x7d')](this,_0x1ca126[_0xec21('0xa6')]);if(_0xc6bb78){this['channel']['setVariable'](_0xc6bb78,_0x39fd15);return this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x17f'),_0x1ca126[_0xec21('0x81')],_0xc6bb78));}}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1ca126[_0xec21('0x81')]));};AGIVertices[_0xec21('0x14')][_0xec21('0x180')]=function(_0x49805c){logger['info'](util[_0xec21('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x49805c[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x49805c['text'])){return this[_0xec21('0xe')]['noop']('no\x20text\x20configured');}this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')]('Trying\x20Google\x20TTS\x20%s',_0x49805c[_0xec21('0x53')]));var _0x16080f=this['googleTTS'][_0xec21('0x7d')](this,_0x49805c);if(_0x16080f){this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')](_0xec21('0x181'),_0x16080f));var _0x3ea65d=this[_0xec21('0xe')][_0xec21('0xf2')](_0x16080f);try{fs['unlink'](_0x16080f+_0xec21('0xd0'));}catch(_0x4c6d35){logger[_0xec21('0x2f')](_0x4c6d35);}return _0x3ea65d;}return this[_0xec21('0xe')][_0xec21('0x2f')](_0x49805c,_0xec21('0x182'));};AGIVertices[_0xec21('0x14')][_0xec21('0x183')]=function(_0x17bac6){logger[_0xec21('0x2b')](util['format'](_0xec21('0x184'),_0x17bac6[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x17bac6[_0xec21('0x122')])){return this[_0xec21('0xe')]['error'](_0x17bac6,_0xec21('0x138'));}logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x121'),this[_0xec21('0xe')][_0xec21('0x36')],_0x17bac6[_0xec21('0x122')]));var _0x5270e7=this[_0xec21('0x4a')][_0xec21('0x7d')](this,_0x17bac6[_0xec21('0x122')]);if(_0x5270e7){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xec21('0xe')][_0xec21('0x36')],_0x17bac6[_0xec21('0x122')]));this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x123'),this[_0xec21('0xe')][_0xec21('0x36')],_0x17bac6[_0xec21('0x122')]));return{'code':0xc8,'result':_0xec21('0x124')};}else{logger[_0xec21('0x2b')](util[_0xec21('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xec21('0xe')][_0xec21('0x36')],_0x17bac6['findBy']));this[_0xec21('0xe')]['noop'](util['format'](_0xec21('0x125'),this[_0xec21('0xe')]['callerid'],_0x17bac6['findBy']));return{'code':0xc8,'result':_0xec21('0x128')};}};AGIVertices[_0xec21('0x14')][_0xec21('0x185')]=function(_0x32cab7){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x186'),_0x32cab7['label']));var _0x528d58=this['channel'][_0xec21('0x51')](_0xec21('0x187'),[_0x32cab7['mailbox'],_0x32cab7[_0xec21('0x92')]]);if(_0x528d58[_0xec21('0x79')]===-0x1){return _0x528d58;}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x13c'),_0xec21('0x187'),_0x32cab7['mailbox']));};AGIVertices[_0xec21('0x14')][_0xec21('0x188')]=function(_0x47bb4f){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x189'),_0x47bb4f[_0xec21('0x80')]));if(!this['isConfigured'](_0x47bb4f[_0xec21('0xa6')])){return this['channel'][_0xec21('0x2f')](_0x47bb4f,'no\x20variable\x20selected');}var _0x3ea49a=this[_0xec21('0x11')][_0xec21('0x7d')](this,_0x47bb4f['variable_id']);if(!_0x3ea49a){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x47bb4f,_0xec21('0xa8'));}var _0x3e7f0f=this['channel'][_0xec21('0x11')](_0x3ea49a);return{'code':0xc8,'result':_0x3e7f0f[_0xec21('0x77')]?_0x3e7f0f['extra']:'-'};};String[_0xec21('0x14')]['replaceAll']=function(_0x31d57b,_0x3b7b8f){return this[_0xec21('0x74')](_0x31d57b)[_0xec21('0x18a')](_0x3b7b8f);};module[_0xec21('0x18b')]=AGIVertices;
\ No newline at end of file
+var _0x9c63=['AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','moment','mustache','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','name','getVoiceQueueById','catch','prototype','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleTTS','text','google_tts_language','googleDialogflow','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','aws_bot_name','googleASR','tildeASR','appid','appsecret','uri','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','setVariable','isConfigured','maxRetry','sync','Enter\x20in\x20AGI\x20(%s)\x20block','agi','command','args','answer','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','result','no\x20list\x20selected','add','minutes','callback_priority','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query','no\x20query\x20configured','variable_id','no\x20variable\x20found','keys','forEach','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','DIAL','SIP/%s','url','Executed\x20command\x20%s','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','test','maxdigit','hiddendigitsnum','generate','hiddendigitspos','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','awsLex','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','%s/recordings/%s','%s.%s','beep','NOBEEP','intKey','GOOGLE_ASR_%s','stringify','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','isArray','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','agi://%s/square,\x22%s\x22,\x22%s\x22'];(function(_0x4fd772,_0x35b9d7){var _0x27077e=function(_0x18672e){while(--_0x18672e){_0x4fd772['push'](_0x4fd772['shift']());}};_0x27077e(++_0x35b9d7);}(_0x9c63,0x1a7));var _0x39c6=function(_0x1ccc58,_0x46ab5a){_0x1ccc58=_0x1ccc58-0x0;var _0x46788e=_0x9c63[_0x1ccc58];return _0x46788e;};'use strict';var fs=require('fs');var path=require(_0x39c6('0x0'));var util=require(_0x39c6('0x1'));var _=require(_0x39c6('0x2'));var sh=require(_0x39c6('0x3'));var odbc=require(_0x39c6('0x4'))();var rs=require('randomstring');var moment=require(_0x39c6('0x5'));var Mustache=require(_0x39c6('0x6'));var logger=require('../../config/logger')('agi');var config=require(_0x39c6('0x7'));var scripts=require(_0x39c6('0x8'));var FILES_PATH=_0x39c6('0x9');var verticesWithRetry=[_0x39c6('0xa'),_0x39c6('0xb'),_0x39c6('0xc')];var AGIVertices=function(_0x48e68f,_0x364ad5,_0x1c8bdd){this[_0x39c6('0xd')]=_0x48e68f;this[_0x39c6('0xe')]=_0x364ad5;this[_0x39c6('0xf')]=_0x1c8bdd;};AGIVertices['prototype'][_0x39c6('0x10')]=function(_0x4fccae,_0x114818){this['rpc'][_0x39c6('0x11')](_0x4fccae)[_0x39c6('0x12')](function(_0x3aa1b0){_0x114818(null,_0x3aa1b0?_0x3aa1b0[_0x39c6('0x13')]:![]);})['catch'](function(_0x365139){_0x114818(_0x365139);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x1f3e1d,_0x10859a){this[_0x39c6('0xe')][_0x39c6('0x14')](_0x1f3e1d)['then'](function(_0x124d43){_0x10859a(null,_0x124d43?_0x124d43['name']:![]);})[_0x39c6('0x15')](function(_0x1c25a9){_0x10859a(_0x1c25a9);});};AGIVertices[_0x39c6('0x16')]['getSquareProject']=function(_0x5e3046,_0x4581d7){this[_0x39c6('0xe')]['getSquareProjectById'](_0x5e3046)[_0x39c6('0x12')](function(_0x258b0a){_0x4581d7(null,_0x258b0a?_0x258b0a[_0x39c6('0x13')]:![]);})[_0x39c6('0x15')](function(_0x129613){_0x4581d7(_0x129613);});};AGIVertices[_0x39c6('0x16')]['getSquareOdbc']=function(_0x5b4320,_0x4d6fcb){this['rpc']['getSquareOdbcById'](_0x5b4320)[_0x39c6('0x12')](function(_0x5d4eec){_0x4d6fcb(null,_0x5d4eec?_0x5d4eec['dsn']:![]);})[_0x39c6('0x15')](function(_0x37dce5){_0x4d6fcb(_0x37dce5);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x17')]=function(_0x5608dd,_0x5b7805){this['rpc'][_0x39c6('0x18')](_0x5608dd)['then'](function(_0x5d4083){_0x5b7805(null,_0x5d4083?_0x5d4083[_0x39c6('0x13')]:![]);})[_0x39c6('0x15')](function(_0x358f6f){_0x5b7805(_0x358f6f);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x19')]=function(_0x33132f,_0x19e54d){this[_0x39c6('0xe')][_0x39c6('0x1a')](_0x33132f)[_0x39c6('0x12')](function(_0x2fd3a7){_0x19e54d(null,_0x2fd3a7?_0x2fd3a7[_0x39c6('0x13')]:![]);})[_0x39c6('0x15')](function(_0xa177fc){_0x19e54d(_0xa177fc);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x1b')]=function(_0x1708e7,_0x48e08e){var _0x3f5985=this;this[_0x39c6('0xe')][_0x39c6('0x1c')](_0x1708e7)['then'](function(_0xf06e09){_0x48e08e(null,_0xf06e09?_0x3f5985[_0x39c6('0x1d')](_0xf06e09[_0x39c6('0x1e')]):![]);})[_0x39c6('0x15')](function(_0x5c07f7){_0x48e08e(_0x5c07f7);});};AGIVertices['prototype'][_0x39c6('0x1f')]=function(_0x243d47,_0x5f5aa8){this[_0x39c6('0xe')]['getMailAccountById'](_0x243d47)['then'](function(_0x21ca3f){_0x5f5aa8(null,_0x21ca3f?_0x21ca3f:![]);})[_0x39c6('0x15')](function(_0x2a9b70){_0x5f5aa8(_0x2a9b70);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x20')]=function(_0x1d5d33,_0x2db566,_0xd0d54b){this[_0x39c6('0xf')][_0x39c6('0x20')](_0x1d5d33,_0x2db566)[_0x39c6('0x12')](function(){_0xd0d54b(null);})[_0x39c6('0x15')](function(_0x33db66){_0xd0d54b(_0x33db66);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x21')]=function(_0x955f40,_0x213333){this['rpc']['getIntervalById'](_0x955f40)[_0x39c6('0x12')](function(_0x29c845){if(_0x29c845){if(_0x29c845[_0x39c6('0x22')]){_0x213333(null,[_0x29c845[_0x39c6('0x23')]]);}else{_0x213333(null,_[_0x39c6('0x24')](_0x29c845[_0x39c6('0x25')],_0x39c6('0x23')));}}else{_0x213333(null,![]);}})['catch'](function(_0xaf1c75){_0x213333(_0xaf1c75);});};AGIVertices[_0x39c6('0x16')]['getSoundPath']=function(_0x4f716b){return util[_0x39c6('0x26')](_0x39c6('0x27'),FILES_PATH,_0x4f716b);};AGIVertices[_0x39c6('0x16')][_0x39c6('0x28')]=function(_0x454c1b,_0x2ec74d,_0x321f5a){odbc[_0x39c6('0x29')](_0x454c1b,function(_0x3c86ea){if(_0x3c86ea){logger[_0x39c6('0x2a')](_0x39c6('0x2b'),_0x3c86ea);_0x321f5a(_0x3c86ea);}else{logger[_0x39c6('0x2c')](_0x39c6('0x2d'));odbc['query'](_0x2ec74d,function(_0x5e0486,_0x401bb5){if(_0x5e0486){logger[_0x39c6('0x2c')](_0x39c6('0x2e'),_0x2ec74d);_0x321f5a(_0x5e0486);}else{logger['info'](_0x39c6('0x2f'),_0x2ec74d);odbc[_0x39c6('0x30')](function(_0x2d2dfc){if(_0x2d2dfc){logger[_0x39c6('0x2a')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x2d2dfc);}_0x321f5a(null,_0x401bb5);});}});}});};AGIVertices['prototype'][_0x39c6('0x31')]=function(_0x59d4cb,_0x467c4a){this[_0x39c6('0xe')][_0x39c6('0x32')](_0x59d4cb)[_0x39c6('0x12')](function(_0x53266c){_0x467c4a(null,_0x53266c?_0x53266c:![]);})[_0x39c6('0x15')](function(_0x8e4821){_0x467c4a(_0x8e4821);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x33')]=function(_0x2a2201,_0x37317b){this[_0x39c6('0xe')][_0x39c6('0x33')](_0x2a2201)[_0x39c6('0x12')](function(_0x4bf748){_0x37317b(null,_0x4bf748);})['catch'](function(_0x1b15b0){_0x37317b(_0x1b15b0);});};AGIVertices['prototype'][_0x39c6('0x34')]=function(_0x4c3bf2,_0x4989ac,_0x3642fc){this[_0x39c6('0xe')][_0x39c6('0x34')]({'uniqueid':this['channel'][_0x39c6('0x35')],'node':_0x4c3bf2[_0x39c6('0x36')],'application':_0x4c3bf2[_0x39c6('0x37')],'data':_0x4989ac||null,'project_name':this[_0x39c6('0xd')][_0x39c6('0x38')],'callerid':this[_0x39c6('0xd')]['callerid']})['then'](function(_0x2e7099){if(_0x3642fc){_0x3642fc(null,_0x2e7099);}})[_0x39c6('0x15')](function(_0x4e7e51){if(_0x3642fc){_0x3642fc(_0x4e7e51);}});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x39')]=function(_0x5e50d5,_0x43bf40,_0x12a112,_0x100283){this[_0x39c6('0xe')][_0x39c6('0x39')]({'uniqueid':this[_0x39c6('0xd')]['uniqueid'],'callerid':this[_0x39c6('0xd')][_0x39c6('0x3a')],'calleridname':this[_0x39c6('0xd')][_0x39c6('0x3b')],'context':this[_0x39c6('0xd')]['context'],'extension':this[_0x39c6('0xd')]['extension'],'priority':this[_0x39c6('0xd')][_0x39c6('0x3c')],'accountcode':this[_0x39c6('0xd')][_0x39c6('0x3d')],'dnid':this[_0x39c6('0xd')][_0x39c6('0x3e')],'projectName':this[_0x39c6('0xd')][_0x39c6('0x38')],'saveName':_0x43bf40,'filename':_0x5e50d5['file']||_0x43bf40,'savePath':_0x12a112})[_0x39c6('0x12')](function(_0x7c2f08){_0x100283(null,_0x7c2f08);})[_0x39c6('0x15')](function(_0x3147e2){_0x100283(_0x3147e2);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x3f')]=function(_0x369859,_0x47841f,_0x3a2fb7){this['rpc'][_0x39c6('0x3f')]({'uniqueid':this[_0x39c6('0xd')][_0x39c6('0x35')],'body':_0x369859,'direction':_0x47841f})['then'](function(_0xc8358){if(_0x3a2fb7){_0x3a2fb7(null,_0xc8358);}})['catch'](function(_0x34f0bf){if(_0x3a2fb7){_0x3a2fb7(_0x34f0bf);}});};AGIVertices['prototype'][_0x39c6('0x40')]=function(_0x4374a3,_0x4759a1){this['rpc'][_0x39c6('0x40')]({'firstName':_[_0x39c6('0x41')](_0x4374a3[_0x39c6('0x13')])||_[_0x39c6('0x42')](_0x4374a3[_0x39c6('0x13')])?_0x39c6('0x43')+Math['random']():_0x4374a3[_0x39c6('0x13')],'lastName':_[_0x39c6('0x41')](_0x4374a3[_0x39c6('0x44')])||_['isNil'](_0x4374a3[_0x39c6('0x44')])?null:_0x4374a3[_0x39c6('0x44')],'phone':_0x4374a3['phone'],'ListId':_0x4374a3[_0x39c6('0x45')],'scheduledAt':_0x4374a3[_0x39c6('0x46')],'callbackUniqueid':this[_0x39c6('0xd')][_0x39c6('0x35')],'tags':_0x39c6('0x47'),'description':_0x39c6('0x48')+_0x4374a3['scheduledAt'][_0x39c6('0x49')](),'priority':_0x4374a3['callback_priority']})[_0x39c6('0x12')](function(_0x1e3ddf){_0x4759a1(null,_0x1e3ddf);})['catch'](function(_0x5459e7){_0x4759a1(_0x5459e7);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x4a')]=function(_0x39035e,_0x1979f9){this[_0x39c6('0xe')]['getPauseById'](_0x39035e)['then'](function(_0x4c7776){_0x1979f9(null,_0x4c7776?_0x4c7776[_0x39c6('0x13')]:![]);})[_0x39c6('0x15')](function(_0x30487d){_0x1979f9(_0x30487d);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x4b')]=function(_0x4fa220,_0x21c157,_0x92d574){var _0x2ca6f5={'role':_0x39c6('0x4c')};_0x2ca6f5[_0x4fa220]=this[_0x39c6('0xd')][_0x39c6('0x3a')];this['rpc']['agentPause'](_0x2ca6f5,_0x21c157,this[_0x39c6('0xd')]['uniqueid'])[_0x39c6('0x12')](function(_0x2608e0){_0x92d574(null,_[_0x39c6('0x42')](_0x2608e0)?![]:!![]);})[_0x39c6('0x15')](function(_0x3b5d9d){logger[_0x39c6('0x2a')](_0x3b5d9d);_0x92d574(null,![]);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x4d')]=function(_0x3950ab,_0x21c171){var _0x4f69cf={'role':_0x39c6('0x4c')};_0x4f69cf[_0x3950ab]=this['channel'][_0x39c6('0x3a')];this['rpc'][_0x39c6('0x4d')](_0x4f69cf)[_0x39c6('0x12')](function(_0x3e4954){_0x21c171(null,_[_0x39c6('0x42')](_0x3e4954)?![]:!![]);})[_0x39c6('0x15')](function(_0x57247f){logger[_0x39c6('0x2a')](_0x57247f);_0x21c171(null,![]);});};AGIVertices[_0x39c6('0x16')]['agentLogout']=function(_0x6f1aab,_0x390bcf){var _0x1fba73={'role':_0x39c6('0x4c')};_0x1fba73[_0x6f1aab]=this[_0x39c6('0xd')][_0x39c6('0x3a')];this[_0x39c6('0xe')][_0x39c6('0x4e')](_0x1fba73)[_0x39c6('0x12')](function(_0x24ba4e){_0x390bcf(null,_['isNil'](_0x24ba4e)?![]:!![]);})[_0x39c6('0x15')](function(_0x3800d4){logger[_0x39c6('0x2a')](_0x3800d4);_0x390bcf(null,![]);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x4f')]=function(_0x5394f9,_0x157645){var _0xd4d2e3={'role':_0x39c6('0x4c')};_0xd4d2e3[_0x5394f9]=this[_0x39c6('0xd')][_0x39c6('0x3a')];var _0x15d807=_0x5394f9!='internal'?util['format'](_0x39c6('0x50'),_0x39c6('0x51'),this['channel'][_0x39c6('0x3a')]):undefined;this[_0x39c6('0xe')]['agentLogin'](_0xd4d2e3,_0x15d807)[_0x39c6('0x12')](function(_0x5bd7db){_0x157645(null,_[_0x39c6('0x42')](_0x5bd7db)?![]:!![]);})[_0x39c6('0x15')](function(_0x4f7a75){logger[_0x39c6('0x2a')](_0x4f7a75);_0x157645(null,![]);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x52')]=function(_0x256d11,_0x522457){sh[_0x39c6('0x53')](_['trim'](_0x256d11),function(_0x232c76,_0x55d1bf){var _0x1b6610=_0x55d1bf[_0x39c6('0x54')](/(\r\n|\n|\r)/gm,'');_0x522457(null,_0x1b6610);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x55')]=function(_0x4eefd1,_0x4d02a5){scripts[_0x39c6('0x55')](_0x4eefd1[_0x39c6('0x56')],_0x4eefd1[_0x39c6('0x57')]||'en',0x1)['then'](function(_0x1e2b9c){_0x4d02a5(null,_0x1e2b9c);})[_0x39c6('0x15')](function(_0x5507a1){_0x4d02a5(_0x5507a1);});};AGIVertices[_0x39c6('0x16')]['googleDialogflow']=function(_0x2254b8,_0x131983){scripts[_0x39c6('0x58')](this[_0x39c6('0xd')][_0x39c6('0x35')],_0x2254b8['key'],_0x2254b8['text'],_0x2254b8['dialogflow_language']||'en')[_0x39c6('0x12')](function(_0x11f8bb){_0x131983(null,_0x11f8bb);})[_0x39c6('0x15')](function(_0x39f290){_0x131983(_0x39f290);});};AGIVertices['prototype'][_0x39c6('0x59')]=function(_0x2ac00e,_0x36a16d){scripts[_0x39c6('0x59')](this[_0x39c6('0xd')],_0x2ac00e)[_0x39c6('0x12')](function(_0x562264){_0x36a16d(null,_0x562264);})[_0x39c6('0x15')](function(_0x4e5de9){_0x36a16d(_0x4e5de9);});};AGIVertices['prototype'][_0x39c6('0x5a')]=function(_0x2dc9a4,_0xf3e95c){scripts[_0x39c6('0x5a')](_0x2dc9a4[_0x39c6('0x5b')],_0x2dc9a4[_0x39c6('0x56')],_0x2dc9a4[_0x39c6('0x5c')]||_0x39c6('0x5d'),_0x2dc9a4[_0x39c6('0x5e')])[_0x39c6('0x12')](function(_0x33a318){_0xf3e95c(null,_0x33a318);})[_0x39c6('0x15')](function(_0x26bf99){_0xf3e95c(_0x26bf99);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x5f')]=function(_0x1d245,_0x2f246e,_0x54c78d){scripts['ispeechASR'](_0x2f246e,_0x1d245[_0x39c6('0x5b')],_0x1d245[_0x39c6('0x60')]||_0x39c6('0x5d'),this['isConfigured'](_0x1d245[_0x39c6('0x61')])?_0x1d245[_0x39c6('0x61')]:undefined)[_0x39c6('0x12')](function(_0x582a1d){_0x54c78d(null,_0x582a1d);})['catch'](function(_0x2c5090){_0x54c78d(_0x2c5090);});};AGIVertices[_0x39c6('0x16')]['awsPolly']=function(_0x367825,_0x255fac){scripts[_0x39c6('0x62')](_0x367825[_0x39c6('0x63')],_0x367825[_0x39c6('0x64')],_0x367825['aws_polly_region'],_0x367825[_0x39c6('0x65')]||_0x39c6('0x66'),_0x367825[_0x39c6('0x56')],_0x367825[_0x39c6('0x67')]||_0x39c6('0x56'))[_0x39c6('0x12')](function(_0x23de7a){_0x255fac(null,_0x23de7a);})[_0x39c6('0x15')](function(_0x2fddb4){_0x255fac(_0x2fddb4);});};AGIVertices[_0x39c6('0x16')]['awsLex']=function(_0x16ef03,_0x13d368){scripts['awsLex'](this[_0x39c6('0xd')]['uniqueid'],_0x16ef03['aws_access_key_id'],_0x16ef03[_0x39c6('0x64')],_0x16ef03['aws_lex_region'],_0x16ef03[_0x39c6('0x56')],_0x16ef03[_0x39c6('0x68')])[_0x39c6('0x12')](function(_0x150389){_0x13d368(null,_0x150389);})['catch'](function(_0x29e990){_0x13d368(_0x29e990);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x69')]=function(_0x147535,_0x394ef6,_0xda33a){scripts['googleASR'](_0x394ef6,_0x147535['key'],_0x147535['google_asr_language']||_0x39c6('0x5d'))['then'](function(_0x57e216){_0xda33a(null,_0x57e216);})['catch'](function(_0x470aa3){_0xda33a(_0x470aa3);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x6a')]=function(_0x5e97a0,_0x59e658,_0x42eeb5){scripts[_0x39c6('0x6a')](_0x59e658,_0x5e97a0[_0x39c6('0x6b')],_0x5e97a0[_0x39c6('0x6c')],_0x5e97a0[_0x39c6('0x6d')])[_0x39c6('0x12')](function(_0x99a34a){_0x42eeb5(null,_0x99a34a);})[_0x39c6('0x15')](function(_0xc00b70){_0x42eeb5(_0xc00b70);});};AGIVertices[_0x39c6('0x16')][_0x39c6('0x6e')]=function(_0x31841b){var _0x2fa73b=_[_0x39c6('0x6f')](verticesWithRetry,_0x31841b[_0x39c6('0x37')])?_0x31841b:_[_0x39c6('0x70')](_0x31841b);for(var _0x1a0ffc in _0x2fa73b){if(_0x2fa73b[_0x39c6('0x71')](_0x1a0ffc)){if(_0x2fa73b[_0x1a0ffc]&&_[_0x39c6('0x72')](_0x2fa73b[_0x1a0ffc])){_0x2fa73b[_0x1a0ffc]=this[_0x39c6('0x73')](_0x2fa73b[_0x1a0ffc]);}}}return _0x2fa73b;};AGIVertices[_0x39c6('0x16')][_0x39c6('0x73')]=function(_0x275b39){var _0x5df3ef=_0x275b39[_0x39c6('0x74')]('{');for(var _0x590d47=0x1;_0x590d47<_0x5df3ef[_0x39c6('0x75')];_0x590d47+=0x1){var _0x31b0d4=_0x5df3ef[_0x590d47][_0x39c6('0x74')]('}');if(_0x31b0d4[_0x39c6('0x75')]>0x1){_0x275b39=_0x275b39[_0x39c6('0x76')]('{'+_0x31b0d4[0x0]+'}',this[_0x39c6('0xd')][_0x39c6('0x10')](_0x31b0d4[0x0])[_0x39c6('0x77')]||_0x31b0d4[0x0]);}}if(_0x5df3ef[_0x39c6('0x75')]===0x1){return _0x275b39[_0x39c6('0x49')]();}return this['replaceAllVariables'](_0x275b39);};AGIVertices[_0x39c6('0x16')][_0x39c6('0x78')]=function(_0x409bfc,_0x5dfd17){var _0x5c7ca5=this[_0x39c6('0xd')][_0x39c6('0x10')](_0x409bfc);if(_0x5c7ca5['result']===-0x1){return _0x5c7ca5;}logger[_0x39c6('0x2c')](util[_0x39c6('0x26')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5dfd17,_0x5c7ca5['extra']));return this['channel'][_0x39c6('0x79')](_0x5dfd17,_0x5c7ca5[_0x39c6('0x77')]);};AGIVertices[_0x39c6('0x16')][_0x39c6('0x7a')]=function(_0x2a1fc8){return _0x2a1fc8&&_0x2a1fc8!=='0'&&_0x2a1fc8!=='-1'&&_0x2a1fc8!=='';};AGIVertices['prototype'][_0x39c6('0x7b')]=function(_0x7eed03){this[_0x39c6('0x34')][_0x39c6('0x7c')](this,_0x7eed03,'-');_0x7eed03['retry']=_0x7eed03[_0x39c6('0x7b')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x39c6('0x16')]['agi']=function(_0x5b4e7e){logger['info'](util[_0x39c6('0x26')](_0x39c6('0x7d'),_0x5b4e7e['label']));return this[_0x39c6('0xd')][_0x39c6('0x7e')]([_0x5b4e7e[_0x39c6('0x7f')],_0x5b4e7e[_0x39c6('0x80')]]);};AGIVertices[_0x39c6('0x16')][_0x39c6('0x81')]=function(_0x5a28c2){logger['info'](util[_0x39c6('0x26')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x5a28c2[_0x39c6('0x36')]));if(this[_0x39c6('0x7a')](_0x5a28c2[_0x39c6('0x82')])){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x83'),_0x5a28c2[_0x39c6('0x82')]));var _0x5d02a5=this[_0x39c6('0xd')][_0x39c6('0x84')](_0x5a28c2[_0x39c6('0x82')]);if(_0x5d02a5[_0x39c6('0x85')]===-0x1){return _0x5d02a5;}}return this[_0x39c6('0xd')]['answer']();};AGIVertices[_0x39c6('0x16')][_0x39c6('0x47')]=function(_0x296944){logger[_0x39c6('0x2c')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x296944[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x296944[_0x39c6('0x45')])){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x296944,_0x39c6('0x86'));}_0x296944['scheduledAt']=moment();if(this[_0x39c6('0x7a')](_0x296944['delay'])){_0x296944[_0x39c6('0x46')]=moment()[_0x39c6('0x87')](_0x296944['delay'],_0x39c6('0x88'));}if(!this[_0x39c6('0x7a')](_0x296944['callback_priority'])){_0x296944[_0x39c6('0x89')]=0x2;}this[_0x39c6('0x40')][_0x39c6('0x7c')](this,_0x296944);return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x8b'),_0x296944[_0x39c6('0x8c')],_0x296944[_0x39c6('0x45')],_0x296944[_0x39c6('0x46')]));};AGIVertices[_0x39c6('0x16')]['custom_app']=function(_0x418073){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x8d'),_0x418073[_0x39c6('0x36')]));var _0x1540f1=this[_0x39c6('0xd')][_0x39c6('0x53')](_0x418073[_0x39c6('0x8e')],_0x418073[_0x39c6('0x8f')]);if(_0x1540f1[_0x39c6('0x85')]===-0x1){return _0x1540f1;}return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x90'),_0x418073[_0x39c6('0x8e')],_0x418073[_0x39c6('0x8f')]));};AGIVertices[_0x39c6('0x16')][_0x39c6('0x91')]=function(_0x1a370c){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x92'),_0x1a370c[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x1a370c[_0x39c6('0x56')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0x93'));}var _0x2900d9='\x22'+_0x1a370c[_0x39c6('0x56')]+'\x22';if(this[_0x39c6('0x7a')](_0x1a370c[_0x39c6('0x8f')])){_0x2900d9+=','+_0x1a370c[_0x39c6('0x8f')];}var _0x268d50=this[_0x39c6('0xd')][_0x39c6('0x53')](_0x39c6('0x94'),_0x2900d9);if(_0x268d50[_0x39c6('0x85')]===-0x1){return _0x268d50;}return this[_0x39c6('0xd')][_0x39c6('0x8a')](util['format'](_0x39c6('0x95'),_0x2900d9));};AGIVertices[_0x39c6('0x16')]['sestektts']=function(_0x105917){logger[_0x39c6('0x2c')](util['format'](_0x39c6('0x96'),_0x105917[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x105917[_0x39c6('0x56')])){return this[_0x39c6('0xd')]['noop'](_0x39c6('0x93'));}var _0x4c806f='\x22'+_0x105917[_0x39c6('0x56')]+'\x22';if(this[_0x39c6('0x7a')](_0x105917[_0x39c6('0x8f')])){_0x4c806f+=','+_0x105917[_0x39c6('0x8f')];}var _0x43db4d=this[_0x39c6('0xd')]['exec'](_0x39c6('0x94'),_0x4c806f);if(_0x43db4d['result']===-0x1){return _0x43db4d;}return this[_0x39c6('0xd')][_0x39c6('0x8a')](util['format'](_0x39c6('0x95'),_0x4c806f));};AGIVertices[_0x39c6('0x16')][_0x39c6('0x97')]=function(_0x3d8be6){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x98'),_0x3d8be6['label']));if(!this['isConfigured'](_0x3d8be6[_0x39c6('0x99')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0x9a'));}var _0x555134=_0x3d8be6['grammar'];if(this[_0x39c6('0x7a')](_0x3d8be6[_0x39c6('0x8f')])){_0x555134+=','+_0x3d8be6[_0x39c6('0x8f')];}var _0x58a08f=this[_0x39c6('0xd')][_0x39c6('0x53')](_0x39c6('0x9b'),_0x555134);if(_0x58a08f[_0x39c6('0x85')]===-0x1){return _0x58a08f;}var _0x797df8=this[_0x39c6('0x78')](_0x39c6('0x9c'),'LUMENVOX_ASR_CONFIDENCE');if(_0x797df8[_0x39c6('0x85')]===-0x1){return _0x797df8;}var _0x5c1263=this[_0x39c6('0x78')](_0x39c6('0x9d'),_0x39c6('0x9e'));if(_0x5c1263[_0x39c6('0x85')]===-0x1){return _0x5c1263;}var _0x4da48c=this['getAndSetVariable'](_0x39c6('0x9f'),_0x39c6('0xa0'));if(_0x4da48c[_0x39c6('0x85')]===-0x1){return _0x4da48c;}return this[_0x39c6('0xd')]['noop'](util[_0x39c6('0x26')](_0x39c6('0xa1'),_0x555134));};AGIVertices[_0x39c6('0x16')][_0x39c6('0xa2')]=function(_0x17f82a){logger['info'](util[_0x39c6('0x26')](_0x39c6('0xa3'),_0x17f82a[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x17f82a[_0x39c6('0x99')])){return this[_0x39c6('0xd')]['noop'](_0x39c6('0x9a'));}var _0x5569b7=_0x17f82a[_0x39c6('0x99')];if(this[_0x39c6('0x7a')](_0x17f82a[_0x39c6('0x8f')])){_0x5569b7+=','+_0x17f82a[_0x39c6('0x8f')];}var _0x4271ea=this['channel'][_0x39c6('0x53')](_0x39c6('0x9b'),_0x5569b7);if(_0x4271ea[_0x39c6('0x85')]===-0x1){return _0x4271ea;}var _0x2293cb=this[_0x39c6('0x78')](_0x39c6('0x9c'),_0x39c6('0xa4'));if(_0x2293cb['result']===-0x1){return _0x2293cb;}var _0x32ce38=this[_0x39c6('0x78')](_0x39c6('0x9d'),_0x39c6('0xa5'));if(_0x32ce38[_0x39c6('0x85')]===-0x1){return _0x32ce38;}var _0x512454=this[_0x39c6('0x78')](_0x39c6('0x9f'),_0x39c6('0xa6'));if(_0x512454[_0x39c6('0x85')]===-0x1){return _0x512454;}return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0xa1'),_0x5569b7));};AGIVertices[_0x39c6('0x16')][_0x39c6('0xa7')]=function(_0x42fe44){logger['info'](util[_0x39c6('0x26')](_0x39c6('0xa8'),_0x42fe44[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x42fe44[_0x39c6('0xa9')])){return this[_0x39c6('0xd')]['error'](_0x42fe44,_0x39c6('0xaa'));}var _0x23a531=this['getSquareOdbc']['sync'](this,_0x42fe44[_0x39c6('0xa9')]);if(!_0x23a531){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x42fe44,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x42fe44[_0x39c6('0xab')])){return this['channel'][_0x39c6('0x2a')](_0x42fe44,_0x39c6('0xac'));}var _0x4b5dcd=_0x42fe44['query'][_0x39c6('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')]('query:\x20%s',_0x4b5dcd));var _0x1d4e23=this[_0x39c6('0x28')][_0x39c6('0x7c')](this,_0x23a531,_0x4b5dcd);this[_0x39c6('0x34')]['sync'](this,_0x42fe44,_0x4b5dcd);if(!this[_0x39c6('0x7a')](_0x42fe44[_0x39c6('0xad')])){return this[_0x39c6('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3ac0cc=this[_0x39c6('0x10')][_0x39c6('0x7c')](this,_0x42fe44[_0x39c6('0xad')]);if(!_0x3ac0cc){return this['channel'][_0x39c6('0x2a')](_0x42fe44,_0x39c6('0xae'));}var _0x4df7a5=this;_0x1d4e23['forEach'](function(_0x5869b6,_0x299870){Object[_0x39c6('0xaf')](_0x5869b6)[_0x39c6('0xb0')](function(_0x478f0a){_0x4df7a5[_0x39c6('0xd')][_0x39c6('0x79')](util[_0x39c6('0x26')](_0x39c6('0xb1'),_0x3ac0cc,_0x299870,_0x478f0a),_0x5869b6[_0x478f0a]);});});this[_0x39c6('0xd')][_0x39c6('0x79')](util[_0x39c6('0x26')]('%s_ROWS_COUNT',_0x3ac0cc),_0x1d4e23[_0x39c6('0x75')]);return this[_0x39c6('0xd')]['noop'](util[_0x39c6('0x26')](_0x39c6('0xb2'),_0x3ac0cc));};AGIVertices[_0x39c6('0x16')][_0x39c6('0xb3')]=function(_0x5f36c4){logger[_0x39c6('0xb4')](util['format'](_0x39c6('0xb5'),_0x5f36c4['label']));if(!this['isConfigured'](_0x5f36c4['sip_id'])){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x5f36c4,_0x39c6('0xb6'));}var _0x3b58b7=this[_0x39c6('0x17')][_0x39c6('0x7c')](this,_0x5f36c4[_0x39c6('0xb7')]);if(!_0x3b58b7){return this[_0x39c6('0xd')]['error'](_0x5f36c4,'no\x20user\x20found');}var _0x174169=this[_0x39c6('0xd')][_0x39c6('0x53')](_0x39c6('0xb8'),[util['format'](_0x39c6('0xb9'),_0x3b58b7),_0x5f36c4[_0x39c6('0x82')],_0x5f36c4['opts'],_0x5f36c4[_0x39c6('0xba')]]);if(_0x174169['result']===-0x1){return _0x174169;}return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0xbb'),_0x39c6('0xb8')));};AGIVertices[_0x39c6('0x16')]['dialogflow']=function(_0x16796d){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x16796d[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x16796d['key'])){return this['channel'][_0x39c6('0x8a')](_0x39c6('0xbc'));}if(!this[_0x39c6('0x7a')](_0x16796d[_0x39c6('0x56')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0x93'));}this[_0x39c6('0xd')][_0x39c6('0xbd')]=!![];this[_0x39c6('0x34')](_0x16796d);this[_0x39c6('0x3f')](_0x16796d[_0x39c6('0x56')],'in');this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0xbe'),_0x16796d[_0x39c6('0x56')]));var _0x554c42=this['googleDialogflow'][_0x39c6('0x7c')](this,_0x16796d);if(_0x554c42){for(var _0x4bf566 in _0x554c42){if(_0x554c42[_0x39c6('0x71')](_0x4bf566)){this['channel'][_0x39c6('0x79')](util[_0x39c6('0x26')](_0x39c6('0xbf'),_0x4bf566[_0x39c6('0xc0')]()),_0x554c42[_0x4bf566]);}}this[_0x39c6('0x3f')](_0x554c42[_0x39c6('0xc1')],_0x39c6('0xc2'));return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0xc3'),_0x554c42['speech']));}return this['channel'][_0x39c6('0x2a')](_0x16796d,_0x39c6('0xc4'));};AGIVertices[_0x39c6('0x16')][_0x39c6('0xc5')]=function(_0x2800a2){logger['info'](util['format'](_0x39c6('0xc6'),_0x2800a2[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x2800a2[_0x39c6('0xc7')])){return this[_0x39c6('0xd')]['noop'](_0x39c6('0xc8'));}if(!this[_0x39c6('0x7a')](_0x2800a2['username'])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0xc9'));}if(!this[_0x39c6('0x7a')](_0x2800a2[_0x39c6('0xca')])){return this[_0x39c6('0xd')]['noop'](_0x39c6('0xcb'));}if(!this[_0x39c6('0x7a')](_0x2800a2['ndassistant_url'])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0x93'));}this[_0x39c6('0xd')][_0x39c6('0xbd')]=!![];this[_0x39c6('0x34')](_0x2800a2);this[_0x39c6('0x3f')](_0x2800a2[_0x39c6('0x56')],'in');this['channel'][_0x39c6('0x8a')](util['format']('Trying\x20SestekNDA:\x20%s',_0x2800a2[_0x39c6('0x56')]));var _0x419c27=this[_0x39c6('0x59')][_0x39c6('0x7c')](this,_0x2800a2);if(_0x419c27){for(var _0x459a4e in _0x419c27){if(_0x419c27[_0x39c6('0x71')](_0x459a4e)){this[_0x39c6('0xd')][_0x39c6('0x79')](util[_0x39c6('0x26')]('SESTEK_NDA_%s',_0x459a4e[_0x39c6('0xc0')]()),_0x419c27[_0x459a4e]);}}this['createSquareMessage'](_0x419c27[_0x39c6('0xc1')],_0x39c6('0xc2'));if(_0x419c27['audiofile']){this['channel']['noop'](util[_0x39c6('0x26')](_0x39c6('0xcc'),_0x419c27[_0x39c6('0xcd')]));var _0x5e8669=this[_0x39c6('0xd')][_0x39c6('0xce')](_0x419c27[_0x39c6('0xcd')]);try{fs[_0x39c6('0xcf')](_0x419c27[_0x39c6('0xcd')]+_0x39c6('0xd0'));}catch(_0x373e6a){logger[_0x39c6('0x2a')](_0x373e6a);}return _0x5e8669;}else{return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0xd1'),_0x419c27[_0x39c6('0xc1')]));}}return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x2800a2,_0x39c6('0xd2'));};AGIVertices[_0x39c6('0x16')][_0x39c6('0xd3')]=function(_0x16052d){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0xd4'),_0x16052d[_0x39c6('0x36')]));return this[_0x39c6('0xd')][_0x39c6('0x8a')]('end');};AGIVertices[_0x39c6('0x16')][_0x39c6('0xd5')]=function(_0x2ada73){logger['info'](util['format'](_0x39c6('0xd6'),_0x2ada73[_0x39c6('0x36')]));var _0x48b8b0='';if(_0x2ada73[_0x39c6('0xd7')]){if(!this[_0x39c6('0x7a')](_0x2ada73['trunk_id'])){return this[_0x39c6('0xd')]['error'](_0x2ada73,'no\x20trunk\x20selected');}else{var _0x32ee31=parseInt(_0x2ada73[_0x39c6('0xd7')],0xa);if(isNaN(_0x32ee31)){_0x48b8b0=_0x2ada73[_0x39c6('0xd7')];}else{_0x48b8b0=this[_0x39c6('0x19')][_0x39c6('0x7c')](this,_0x2ada73['trunk_id']);if(!_0x48b8b0){return this['channel'][_0x39c6('0x2a')](_0x2ada73,_0x39c6('0xd8'));}}}}else if(_0x2ada73['trunk_name']){_0x48b8b0=_0x2ada73[_0x39c6('0xd9')];}else{return this['channel'][_0x39c6('0x2a')](_0x2ada73,_0x39c6('0xda'));}var _0x21f215=this[_0x39c6('0xd')]['exec'](_0x39c6('0xb8'),[util[_0x39c6('0x26')](_0x39c6('0xdb'),_0x48b8b0,_0x2ada73[_0x39c6('0x8c')]),_0x2ada73['timeout'],_0x2ada73[_0x39c6('0xdc')],_0x2ada73[_0x39c6('0xba')]]);if(_0x21f215[_0x39c6('0x85')]===-0x1){return _0x21f215;}return this['channel']['noop'](util[_0x39c6('0x26')](_0x39c6('0xbb'),'DIAL'));};AGIVertices[_0x39c6('0x16')][_0x39c6('0xdd')]=function(_0x2880f5){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0xde'),_0x2880f5[_0x39c6('0x36')]));return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0xdd'));};AGIVertices[_0x39c6('0x16')][_0x39c6('0xb')]=function(_0x26e682){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0xdf'),_0x26e682['label']));if(_0x26e682[_0x39c6('0xe0')]===0x0){return this['maxRetry'](_0x26e682);}_0x26e682['retry']-=0x1;if(!this[_0x39c6('0x7a')](_0x26e682[_0x39c6('0xe1')])){return this['channel'][_0x39c6('0x2a')](_0x26e682,_0x39c6('0xe2'));}var _0xb1cff0=this[_0x39c6('0x1b')][_0x39c6('0x7c')](this,_0x26e682[_0x39c6('0xe1')]);if(!_0xb1cff0){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x26e682,_0x39c6('0xe3'));}if(!this[_0x39c6('0x7a')](_0x26e682[_0x39c6('0xad')])){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x39c6('0xe4'));}var _0x2dae9a=this[_0x39c6('0xd')][_0x39c6('0xe5')](_0xb1cff0,_0x26e682[_0x39c6('0xe6')],_0x26e682['maxdigit']);var _0x95b3f8=_0x2dae9a['result']?_0x2dae9a[_0x39c6('0x85')]['toString']():'';logger[_0x39c6('0x2c')](_0x39c6('0xe7'),JSON['stringify'](_0x2dae9a));if(_0x2dae9a[_0x39c6('0x85')]===-0x1){this['createSquareDetailsReport'][_0x39c6('0x7c')](this,_0x26e682,_0x95b3f8);return _0x2dae9a;}else if(_0x2dae9a['extra']===_0x39c6('0x82')){_0x2dae9a[_0x39c6('0x85')]=_0x95b3f8[_0x39c6('0x75')]>=parseInt(_0x26e682['mindigit'])?'x':'i';}else{_0x2dae9a[_0x39c6('0x85')]=_0x95b3f8[_0x39c6('0x75')]>=parseInt(_0x26e682['mindigit'])&&_0x95b3f8[_0x39c6('0x75')]<=parseInt(_0x26e682[_0x39c6('0xe8')])?'x':'i';}var _0x1cc78c=this[_0x39c6('0x10')][_0x39c6('0x7c')](this,_0x26e682[_0x39c6('0xad')]);if(!_0x1cc78c){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x26e682,'no\x20variable\x20found');}this[_0x39c6('0xd')][_0x39c6('0x79')](_0x1cc78c,_0x95b3f8);if(this[_0x39c6('0x7a')](_0x26e682['hiddendigitsnum'])){var _0x510dfb=parseInt(_0x26e682[_0x39c6('0xe9')],0xa);var _0x13965f=rs[_0x39c6('0xea')]({'charset':'*','length':_0x510dfb});var _0x2ddc31=_0x95b3f8[_0x39c6('0x75')];if(_0x2ddc31>0x0){if(_0x2ddc31>_0x510dfb){this[_0x39c6('0x34')][_0x39c6('0x7c')](this,_0x26e682,_0x26e682[_0x39c6('0xeb')]==='first'?_0x13965f+_0x95b3f8[_0x39c6('0xec')](_0x510dfb):_0x95b3f8[_0x39c6('0xec')](0x0,_0x2ddc31-_0x510dfb)+_0x13965f);}else{this[_0x39c6('0x34')]['sync'](this,_0x26e682,rs[_0x39c6('0xea')]({'charset':'*','length':_0x2ddc31}));}}else{this['createSquareDetailsReport'][_0x39c6('0x7c')](this,_0x26e682,'');}}else{this[_0x39c6('0x34')][_0x39c6('0x7c')](this,_0x26e682,_0x95b3f8);}return _0x2dae9a;};AGIVertices[_0x39c6('0x16')]['getsecretdigits']=function(_0x28f44b){logger[_0x39c6('0x2c')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x28f44b[_0x39c6('0x36')]));return this[_0x39c6('0xb')](_0x28f44b);};AGIVertices['prototype'][_0x39c6('0xed')]=function(_0x4231f3){logger['info'](util['format'](_0x39c6('0xee'),_0x4231f3[_0x39c6('0x36')]));this[_0x39c6('0x34')]['sync'](this,_0x4231f3,_0x4231f3[_0x39c6('0xef')]);return this[_0x39c6('0xd')]['noop'](util[_0x39c6('0x26')](_0x39c6('0xf0'),_0x4231f3['goalname']));};AGIVertices[_0x39c6('0x16')][_0x39c6('0xf1')]=function(_0x558045){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x558045[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x558045[_0x39c6('0x63')])||!this[_0x39c6('0x7a')](_0x558045['aws_secret_access_key'])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0xf2'));}if(!this[_0x39c6('0x7a')](_0x558045[_0x39c6('0x56')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0x93'));}this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0xf3'),_0x558045[_0x39c6('0x56')]));var _0xbce928=this['awsPolly'][_0x39c6('0x7c')](this,_0x558045);if(_0xbce928){this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0xf4'),_0xbce928));var _0x501461=this[_0x39c6('0xd')]['streamFile'](_0xbce928);try{fs[_0x39c6('0xcf')](_0xbce928+_0x39c6('0xd0'));}catch(_0x47b31f){logger['error'](_0x47b31f);}return _0x501461;}return this['channel'][_0x39c6('0x2a')](_0x558045,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x39c6('0x16')]['awslex']=function(_0x24af61){logger['info'](util[_0x39c6('0x26')](_0x39c6('0xf5'),_0x24af61[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x24af61[_0x39c6('0x63')])||!this['isConfigured'](_0x24af61['aws_secret_access_key'])){return this['channel']['noop'](_0x39c6('0xf2'));}if(!this[_0x39c6('0x7a')](_0x24af61[_0x39c6('0x68')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0xf6'));}if(!this['isConfigured'](_0x24af61['text'])){return this[_0x39c6('0xd')]['noop'](_0x39c6('0x93'));}this[_0x39c6('0xd')][_0x39c6('0xbd')]=!![];this[_0x39c6('0x34')](_0x24af61);this[_0x39c6('0x3f')](_0x24af61[_0x39c6('0x56')],'in');this['channel']['noop'](util[_0x39c6('0x26')](_0x39c6('0xf7'),_0x24af61[_0x39c6('0x56')]));var _0x250ed3=this[_0x39c6('0xf8')][_0x39c6('0x7c')](this,_0x24af61);if(_0x250ed3){for(var _0x3f8e3d in _0x250ed3){if(_0x250ed3['hasOwnProperty'](_0x3f8e3d)&&_['isString'](_0x250ed3[_0x3f8e3d])){this[_0x39c6('0xd')]['setVariable'](util[_0x39c6('0x26')](_0x39c6('0xf9'),_0x3f8e3d['toUpperCase']()),_0x250ed3[_0x3f8e3d]);}}if(_[_0x39c6('0x42')](_0x250ed3[_0x39c6('0xfa')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0xfb'));}else{this[_0x39c6('0x3f')](_0x250ed3[_0x39c6('0xfa')],_0x39c6('0xc2'));return this[_0x39c6('0xd')][_0x39c6('0x8a')](util['format'](_0x39c6('0xfc'),_0x250ed3[_0x39c6('0xfa')]));}}return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x24af61,_0x39c6('0xfd'));};AGIVertices[_0x39c6('0x16')]['googleasr']=function(_0x16d0b7){logger['info'](util[_0x39c6('0x26')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x16d0b7[_0x39c6('0x36')],_0x16d0b7['timeout']));if(!this[_0x39c6('0x7a')](_0x16d0b7[_0x39c6('0x5b')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0xbc'));}var _0x1786c4='wav';var _0x5c3833=util['format'](_0x39c6('0xfe'),FILES_PATH,rs[_0x39c6('0xea')](0x4));var _0x4e9ab6=util[_0x39c6('0x26')](_0x39c6('0xff'),_0x5c3833,_0x1786c4);var _0x21d681=!![];if(_0x16d0b7[_0x39c6('0x100')]===_0x39c6('0x101')){_0x21d681=![];}var _0x424c7e=this[_0x39c6('0xd')]['recordFile'](_0x5c3833,_0x1786c4,_0x16d0b7[_0x39c6('0x102')],_0x16d0b7['timeout'],undefined,_0x21d681);if(_0x424c7e['result']!==-0x1){this[_0x39c6('0xd')][_0x39c6('0x8a')](util['format']('google\x20%s\x20file\x20created',_0x4e9ab6));var _0x477587=this[_0x39c6('0x69')]['sync'](this,_0x16d0b7,_0x4e9ab6);if(_0x477587){for(var _0x407605 in _0x477587){if(_0x477587[_0x39c6('0x71')](_0x407605)){this[_0x39c6('0xd')]['setVariable'](util[_0x39c6('0x26')](_0x39c6('0x103'),_0x407605['toUpperCase']()),_0x477587[_0x407605]);}}return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')]('GoogleASR\x20Result\x20%s',JSON[_0x39c6('0x104')](_0x477587)));}}return _0x424c7e;};AGIVertices[_0x39c6('0x16')]['tildeasr']=function(_0x531f0a){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x105'),_0x531f0a[_0x39c6('0x36')]));if(!this['isConfigured'](_0x531f0a[_0x39c6('0x6b')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0x106'));}if(!this[_0x39c6('0x7a')](_0x531f0a[_0x39c6('0x6c')])){return this['channel'][_0x39c6('0x8a')](_0x39c6('0x107'));}var _0xa65810=_0x39c6('0x108');var _0x365ffd=util[_0x39c6('0x26')](_0x39c6('0xfe'),FILES_PATH,rs[_0x39c6('0xea')](0x4));var _0x10e072=util[_0x39c6('0x26')](_0x39c6('0xff'),_0x365ffd,_0xa65810);var _0x4af684=!![];if(_0x531f0a[_0x39c6('0x100')]===_0x39c6('0x101')){_0x4af684=![];}var _0x43599f=this[_0x39c6('0xd')][_0x39c6('0x109')](_0x365ffd,_0xa65810,_0x531f0a[_0x39c6('0x102')],_0x531f0a[_0x39c6('0x82')],undefined,_0x4af684);if(_0x43599f[_0x39c6('0x85')]!==-0x1){this['channel'][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x10a'),_0x10e072));var _0x456eec=this['tildeASR'][_0x39c6('0x7c')](this,_0x531f0a,_0x10e072);if(_0x456eec){for(var _0x38234c in _0x456eec){if(_0x456eec[_0x39c6('0x71')](_0x38234c)){this[_0x39c6('0xd')]['setVariable'](util[_0x39c6('0x26')](_0x39c6('0x10b'),_0x38234c[_0x39c6('0xc0')]()),_0x456eec[_0x38234c]);}}return this['channel']['noop'](util['format'](_0x39c6('0x10c'),JSON[_0x39c6('0x104')](_0x456eec)));}}return _0x43599f;};AGIVertices[_0x39c6('0x16')][_0x39c6('0x10d')]=function(_0x5a18ca){logger[_0x39c6('0x2c')](util['format'](_0x39c6('0x10e'),_0x5a18ca[_0x39c6('0x36')]));return this[_0x39c6('0xd')][_0x39c6('0x10f')](_0x5a18ca[_0x39c6('0x110')],_0x5a18ca[_0x39c6('0x111')],_0x5a18ca[_0x39c6('0x3c')]);};AGIVertices[_0x39c6('0x16')][_0x39c6('0x112')]=function(_0x19d6c9){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x113'),_0x19d6c9[_0x39c6('0x36')]));if(!this['isConfigured'](_0x19d6c9[_0x39c6('0x114')])){return this['channel'][_0x39c6('0x2a')](_0x19d6c9,_0x39c6('0x115'));}try{var _0x40b2e1=eval(_0x19d6c9[_0x39c6('0x114')])?_0x39c6('0x116'):_0x39c6('0x117');this['channel'][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x118'),_0x19d6c9[_0x39c6('0x114')],_0x40b2e1));return{'code':0xc8,'result':_0x40b2e1};}catch(_0x7ef2f8){return{'code':0xc8,'result':_0x39c6('0x117')};}};AGIVertices['prototype'][_0x39c6('0x119')]=function(_0x593117){logger[_0x39c6('0x2c')](util['format'](_0x39c6('0x11a'),_0x593117[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x593117[_0x39c6('0x11b')])){return this['channel'][_0x39c6('0x2a')](_0x593117,_0x39c6('0x11c'));}var _0x3edcc0=this[_0x39c6('0x21')][_0x39c6('0x7c')](this,_0x593117[_0x39c6('0x11b')]);if(!_0x3edcc0){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x593117,'no\x20intervals\x20found');}for(var _0x220e02=0x0;_0x220e02<_0x3edcc0[_0x39c6('0x75')];_0x220e02+=0x1){var _0x2040ea=this['channel'][_0x39c6('0x10')](util['format']('IFTIME(%s?true:false)',_0x3edcc0[_0x220e02]));if(_0x2040ea['result']===-0x1){return _0x2040ea;}logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x11d'),_0x3edcc0[_0x220e02],_0x2040ea[_0x39c6('0x77')]));if(_0x2040ea[_0x39c6('0x77')]==='true'){logger['info'](util[_0x39c6('0x26')]('IFTIME\x20%s\x20%s',_0x3edcc0[_0x220e02],_0x39c6('0x116')));this['channel']['noop'](util[_0x39c6('0x26')](_0x39c6('0x11d'),_0x3edcc0[_0x220e02],_0x39c6('0x116')));return{'code':0xc8,'result':_0x39c6('0x116')};}else{logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x11d'),_0x3edcc0[_0x220e02],_0x39c6('0x117')));this['channel'][_0x39c6('0x8a')](util[_0x39c6('0x26')]('IFTIME\x20%s\x20%s',_0x3edcc0[_0x220e02],_0x39c6('0x117')));}}return{'code':0xc8,'result':_0x39c6('0x117')};};AGIVertices[_0x39c6('0x16')][_0x39c6('0x11e')]=function(_0x54b910){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x11f'),_0x54b910[_0x39c6('0x36')]));return this[_0x39c6('0xd')][_0x39c6('0x11e')]();};AGIVertices['prototype'][_0x39c6('0x120')]=function(_0x334297){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x121'),_0x334297[_0x39c6('0x36')]));if(!this['isConfigured'](_0x334297[_0x39c6('0x5b')])){return this['channel']['noop'](_0x39c6('0xbc'));}var _0x4d08f5=_0x39c6('0x108');var _0x3f3e84=util[_0x39c6('0x26')](_0x39c6('0xfe'),FILES_PATH,rs[_0x39c6('0xea')](0x4));var _0x30d22f=util[_0x39c6('0x26')](_0x39c6('0xff'),_0x3f3e84,_0x4d08f5);var _0x5a3113=!![];if(_0x334297[_0x39c6('0x100')]===_0x39c6('0x101')){_0x5a3113=![];}var _0x35b9d7=this[_0x39c6('0xd')][_0x39c6('0x109')](_0x3f3e84,_0x4d08f5,_0x334297[_0x39c6('0x102')],_0x334297[_0x39c6('0x82')],undefined,_0x5a3113);if(_0x35b9d7[_0x39c6('0x85')]!==-0x1){this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x122'),_0x30d22f));var _0x20451a=this['ispeechASR'][_0x39c6('0x7c')](this,_0x334297,_0x30d22f);if(_0x20451a){for(var _0x4cf4f9 in _0x20451a){if(_0x20451a[_0x39c6('0x71')](_0x4cf4f9)){this[_0x39c6('0xd')][_0x39c6('0x79')](util[_0x39c6('0x26')](_0x39c6('0x123'),_0x4cf4f9['toUpperCase']()),_0x20451a[_0x4cf4f9]);}}return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')]('IspeechASR\x20Result\x20%s',JSON[_0x39c6('0x104')](_0x20451a)));}}return _0x35b9d7;};AGIVertices[_0x39c6('0x16')][_0x39c6('0x124')]=function(_0x226521){logger['info'](util['format'](_0x39c6('0x125'),_0x226521[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x226521[_0x39c6('0x5b')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0xbc'));}if(!this[_0x39c6('0x7a')](_0x226521[_0x39c6('0x56')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')]('no\x20text\x20configured');}this[_0x39c6('0xd')][_0x39c6('0x8a')](util['format'](_0x39c6('0x126'),_0x226521['text']));var _0x61d354=this[_0x39c6('0x5a')][_0x39c6('0x7c')](this,_0x226521);if(_0x61d354){this['channel'][_0x39c6('0x8a')](util['format']('ispeech\x20%s\x20file\x20created',_0x61d354));var _0x1914cb=this[_0x39c6('0xd')][_0x39c6('0xce')](_0x61d354,_0x226521[_0x39c6('0x102')]);try{fs[_0x39c6('0xcf')](_0x61d354+'.wav');}catch(_0x12b538){logger[_0x39c6('0x2a')](_0x12b538);}return _0x1914cb;}return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x226521,_0x39c6('0x127'));};AGIVertices[_0x39c6('0x16')][_0x39c6('0x128')]=function(_0x5e8d76){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x129'),_0x5e8d76[_0x39c6('0x36')]));if(!this['isConfigured'](_0x5e8d76['findBy'])){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x5e8d76,_0x39c6('0x12a'));}logger[_0x39c6('0x2c')](util['format'](_0x39c6('0x12b'),this[_0x39c6('0xd')]['callerid'],_0x5e8d76['findBy']));var _0x29cec5=this['agentLogin']['sync'](this,_0x5e8d76[_0x39c6('0x12c')]);if(_0x29cec5){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x12d'),this['channel'][_0x39c6('0x3a')],_0x5e8d76[_0x39c6('0x12c')]));this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x39c6('0x3a')],_0x5e8d76['findBy']));return{'code':0xc8,'result':_0x39c6('0x12e')};}else{logger[_0x39c6('0x2c')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x5e8d76[_0x39c6('0x12c')]));this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x12f'),this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x5e8d76[_0x39c6('0x12c')]));return{'code':0xc8,'result':_0x39c6('0x130')};}};AGIVertices[_0x39c6('0x16')]['logout']=function(_0x5166db){logger[_0x39c6('0x2c')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x5166db[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x5166db[_0x39c6('0x12c')])){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x5166db,'no\x20find\x20by\x20configured');}logger[_0x39c6('0x2c')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x5166db['findBy']));var _0x22f4ca=this[_0x39c6('0x4e')][_0x39c6('0x7c')](this,_0x5166db[_0x39c6('0x12c')]);if(_0x22f4ca){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x12d'),this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x5166db[_0x39c6('0x12c')]));this['channel']['noop'](util['format'](_0x39c6('0x12d'),this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x5166db['findBy']));return{'code':0xc8,'result':_0x39c6('0x12e')};}else{logger[_0x39c6('0x2c')](util['format'](_0x39c6('0x12f'),this[_0x39c6('0xd')]['callerid'],_0x5166db['findBy']));this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x12f'),this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x5166db[_0x39c6('0x12c')]));return{'code':0xc8,'result':_0x39c6('0x130')};}};AGIVertices[_0x39c6('0x16')]['math']=function(_0xa1aec5){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x131'),_0xa1aec5[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0xa1aec5[_0x39c6('0x132')])){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0xa1aec5,_0x39c6('0x133'));}this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x134'),_0xa1aec5[_0x39c6('0x132')]));var _0x14864b=eval(_0xa1aec5[_0x39c6('0x132')]);if(!this[_0x39c6('0x7a')](_0xa1aec5[_0x39c6('0xad')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4e94a2=this[_0x39c6('0x10')][_0x39c6('0x7c')](this,_0xa1aec5[_0x39c6('0xad')]);if(!_0x4e94a2){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0xa1aec5,_0x39c6('0xae'));}if(_[_0x39c6('0x135')](_0x14864b)){var _0x4e3822=this;_0x14864b['forEach'](function(_0xed17ce,_0xd56202){_0x4e3822[_0x39c6('0xd')][_0x39c6('0x79')](util[_0x39c6('0x26')]('%s[%s]',_0x4e94a2,_0xd56202),_0xed17ce);});return this[_0x39c6('0xd')][_0x39c6('0x8a')](util['format']('variable\x20%s[key]\x20set',_0x4e94a2));}else{return this['channel']['setVariable'](_0x4e94a2,_0x14864b);}};AGIVertices['prototype']['menu']=function(_0x240835){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x240835[_0x39c6('0x36')]));if(_0x240835[_0x39c6('0xe0')]===0x0){return this[_0x39c6('0x7b')](_0x240835);}_0x240835[_0x39c6('0xe0')]-=0x1;if(!this['isConfigured'](_0x240835['file_id'])){return this[_0x39c6('0xd')]['error'](_0x240835,_0x39c6('0xe2'));}var _0x2289db=this['getSound'][_0x39c6('0x7c')](this,_0x240835[_0x39c6('0xe1')]);if(!_0x2289db){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x240835,_0x39c6('0xe3'));}var _0x388547=this['channel']['getData'](_0x2289db,_0x240835[_0x39c6('0xe6')],_0x240835[_0x39c6('0x136')]);var _0x5cb1fe=_0x388547[_0x39c6('0x85')];if(_0x388547[_0x39c6('0x85')]===-0x1){this[_0x39c6('0x34')][_0x39c6('0x7c')](this,_0x240835,'-1');return _0x388547;}else if(_0x388547[_0x39c6('0x77')]===_0x39c6('0x82')){_0x388547[_0x39c6('0x85')]=_0x388547['result']['length']>0x0?_0x388547[_0x39c6('0x85')]:'t';}else if(_[_0x39c6('0x41')](_0x388547[_0x39c6('0x85')])){_0x388547['result']='#';_0x5cb1fe='#';}if(!this[_0x39c6('0x7a')](_0x240835[_0x39c6('0xad')])){this[_0x39c6('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x418e8c=this[_0x39c6('0x10')]['sync'](this,_0x240835[_0x39c6('0xad')]);if(!_0x418e8c){return this['channel'][_0x39c6('0x2a')](_0x240835,_0x39c6('0xae'));}this[_0x39c6('0xd')][_0x39c6('0x79')](_0x418e8c,_0x5cb1fe);}this[_0x39c6('0x34')][_0x39c6('0x7c')](this,_0x240835,_0x5cb1fe);return _0x388547;};AGIVertices['prototype'][_0x39c6('0x8a')]=function(_0x32ef5e){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x137'),_0x32ef5e[_0x39c6('0x36')]));return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x32ef5e['output']||_0x32ef5e['label']);};AGIVertices[_0x39c6('0x16')]['pause']=function(_0x3d8031){logger['info'](util[_0x39c6('0x26')](_0x39c6('0x138'),_0x3d8031[_0x39c6('0x36')]));if(!this['isConfigured'](_0x3d8031[_0x39c6('0x12c')])){return this[_0x39c6('0xd')]['error'](_0x3d8031,_0x39c6('0x12a'));}logger[_0x39c6('0x2c')](util['format'](_0x39c6('0x12b'),this[_0x39c6('0xd')]['callerid'],_0x3d8031[_0x39c6('0x12c')]));var _0x14b034=this['getPause']['sync'](this,_0x3d8031[_0x39c6('0x139')]);var _0x4ba1f0=this[_0x39c6('0x4b')][_0x39c6('0x7c')](this,_0x3d8031[_0x39c6('0x12c')],_0x14b034);if(_0x4ba1f0){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x12d'),this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x3d8031['findBy']));this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x12d'),this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x3d8031[_0x39c6('0x12c')]));return{'code':0xc8,'result':_0x39c6('0x12e')};}else{logger['info'](util['format'](_0x39c6('0x12f'),this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x3d8031[_0x39c6('0x12c')]));this['channel'][_0x39c6('0x8a')](util[_0x39c6('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x39c6('0x3a')],_0x3d8031[_0x39c6('0x12c')]));return{'code':0xc8,'result':_0x39c6('0x130')};}};AGIVertices['prototype'][_0x39c6('0x13a')]=function(_0x532895){logger['info'](util[_0x39c6('0x26')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x532895[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x532895['file_id'])){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x532895,'no\x20file\x20audio\x20selected');}var _0x3cb3ec=this['getSound'][_0x39c6('0x7c')](this,_0x532895[_0x39c6('0xe1')]);if(!_0x3cb3ec){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x532895,_0x39c6('0xe3'));}var _0x3c99d2=this[_0x39c6('0xd')][_0x39c6('0x53')](_0x39c6('0x13b'),[_0x3cb3ec,_0x532895[_0x39c6('0xdc')]]);if(_0x3c99d2[_0x39c6('0x85')]===-0x1){return _0x3c99d2;}return this['channel'][_0x39c6('0x8a')](util[_0x39c6('0x26')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x3cb3ec));};AGIVertices['prototype'][_0x39c6('0x13c')]=function(_0x2ecd87){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x13d'),_0x2ecd87[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x2ecd87[_0x39c6('0x13e')])){return this['channel'][_0x39c6('0x2a')](_0x2ecd87,_0x39c6('0x13f'));}var _0x522edb='';var _0x4791ad=parseInt(_0x2ecd87['queue_id'],0xa);if(isNaN(_0x4791ad)){_0x522edb=_0x2ecd87[_0x39c6('0x13e')];}else{_0x522edb=this[_0x39c6('0x140')]['sync'](this,_0x2ecd87[_0x39c6('0x13e')]);if(!_0x522edb){return this['channel'][_0x39c6('0x2a')](_0x2ecd87,_0x39c6('0x141'));}}var _0x5595a8='';if(this[_0x39c6('0x7a')](_0x2ecd87['file_id'])){var _0x56bb07=this[_0x39c6('0x1b')]['sync'](this,_0x2ecd87['file_id']);if(_0x56bb07){_0x5595a8=_0x56bb07;}}this[_0x39c6('0x34')][_0x39c6('0x7c')](this,_0x2ecd87,_0x522edb);if(_0x2ecd87[_0x39c6('0xdc')][_0x39c6('0x142')]('x')<0x0){_0x2ecd87[_0x39c6('0xdc')]+='x';}if(_0x2ecd87['opts']['indexOf']('X')<0x0){_0x2ecd87[_0x39c6('0xdc')]+='X';}this['channel'][_0x39c6('0x79')](_0x39c6('0x143'),_0x522edb?_0x522edb['toLowerCase']():'');var _0x5cf32f=this['channel'][_0x39c6('0x53')](_0x39c6('0x144'),[_0x522edb,_0x2ecd87['opts'],_0x2ecd87[_0x39c6('0xba')],_0x5595a8,_0x2ecd87[_0x39c6('0x82')],_0x2ecd87[_0x39c6('0x7e')],_0x2ecd87[_0x39c6('0x145')],_0x2ecd87[_0x39c6('0x146')],'',_0x2ecd87[_0x39c6('0x147')]]);if(_0x5cf32f[_0x39c6('0x85')]===-0x1){return _0x5cf32f;}return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x90'),_0x39c6('0x144'),_0x522edb));};AGIVertices[_0x39c6('0x16')][_0x39c6('0x148')]=function(_0x5cedc3){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x149'),_0x5cedc3[_0x39c6('0x36')]));var _0x5969f2=_0x5cedc3[_0x39c6('0x14a')]||_0x39c6('0x108');var _0x483d4b=util[_0x39c6('0x26')](_0x39c6('0x14b'),this[_0x39c6('0xd')][_0x39c6('0x35')],rs[_0x39c6('0xea')](0x5));var _0x2f5605=util[_0x39c6('0x26')](_0x39c6('0x14c'),FILES_PATH,_0x483d4b,_0x5969f2);var _0x12fe9b=util['format'](_0x39c6('0xfe'),FILES_PATH,_0x483d4b);this[_0x39c6('0x39')][_0x39c6('0x7c')](this,_0x5cedc3,_0x483d4b,_0x2f5605);this['channel'][_0x39c6('0x79')](_0x39c6('0x14d'),_0x483d4b);logger[_0x39c6('0x2c')](_0x39c6('0x14e'),_0x12fe9b,_0x5969f2,_0x5cedc3[_0x39c6('0x14f')],_0x5cedc3[_0x39c6('0x82')]);return this[_0x39c6('0xd')][_0x39c6('0x109')](_0x12fe9b,_0x5969f2,_0x5cedc3[_0x39c6('0x14f')],_0x5cedc3[_0x39c6('0x82')],undefined,!![]);};AGIVertices[_0x39c6('0x16')][_0x39c6('0x150')]=function(_0x1fa635){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x151'),_0x1fa635[_0x39c6('0x36')]));return this[_0x39c6('0xd')][_0x39c6('0x152')](_0x1fa635[_0x39c6('0x153')]['replace'](/\s+/g,''),_0x1fa635[_0x39c6('0x14f')]);};AGIVertices[_0x39c6('0x16')][_0x39c6('0x154')]=function(_0x3f1995){logger['info'](util[_0x39c6('0x26')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x3f1995[_0x39c6('0x36')]));return this[_0x39c6('0xd')]['sayNumber'](_0x3f1995[_0x39c6('0x155')][_0x39c6('0x54')](/\s+/g,''),_0x3f1995[_0x39c6('0x14f')]);};AGIVertices['prototype'][_0x39c6('0x156')]=function(_0x209205){logger[_0x39c6('0x2c')](util['format'](_0x39c6('0x157'),_0x209205[_0x39c6('0x36')]));return this[_0x39c6('0xd')][_0x39c6('0x158')](_0x209205[_0x39c6('0x56')],_0x209205['escape_digits']);};AGIVertices[_0x39c6('0x16')][_0x39c6('0x159')]=function(_0x52ae5a){logger['info'](util[_0x39c6('0x26')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x52ae5a[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x52ae5a[_0x39c6('0x15a')])){return this[_0x39c6('0xd')]['noop'](_0x39c6('0x15b'));}var _0x3f8ed6=this[_0x39c6('0x1f')][_0x39c6('0x7c')](this,_0x52ae5a['account_id']);if(!_0x3f8ed6||!_0x3f8ed6[_0x39c6('0x15c')]){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x52ae5a,_0x39c6('0x15d'));}var _0x86c4a4={'from':util['format']('\x22%s\x22\x20<%s>',_0x3f8ed6[_0x39c6('0x13')],_0x3f8ed6['email']||_0x3f8ed6[_0x39c6('0x15c')][_0x39c6('0x15e')]),'to':_0x52ae5a['to']||'','cc':_0x52ae5a['cc']||'','bcc':_0x52ae5a[_0x39c6('0x15f')]||'','subject':_0x52ae5a[_0x39c6('0x160')],'html':_0x52ae5a[_0x39c6('0x56')],'text':_0x52ae5a['text']};var _0x1c6cad={'tls':{'rejectUnauthorized':![]}};if(_0x3f8ed6[_0x39c6('0x15c')]['service']){_0x1c6cad['service']=_0x3f8ed6[_0x39c6('0x15c')][_0x39c6('0x161')];}else{_0x1c6cad[_0x39c6('0x162')]=_0x3f8ed6[_0x39c6('0x15c')][_0x39c6('0x162')];_0x1c6cad[_0x39c6('0x163')]=_0x3f8ed6[_0x39c6('0x15c')][_0x39c6('0x163')];_0x1c6cad[_0x39c6('0x164')]=_0x3f8ed6['Smtp'][_0x39c6('0x164')];}if(_0x3f8ed6[_0x39c6('0x15c')][_0x39c6('0x165')]){_0x1c6cad[_0x39c6('0x166')]={'user':_0x3f8ed6[_0x39c6('0x15c')][_0x39c6('0x15e')],'pass':_0x3f8ed6[_0x39c6('0x15c')][_0x39c6('0x167')]};}if(this[_0x39c6('0x7a')](_0x52ae5a[_0x39c6('0x168')])){}logger[_0x39c6('0xb4')]('sendMail\x20message',JSON[_0x39c6('0x104')](_0x86c4a4));this[_0x39c6('0x34')]['sync'](this,_0x52ae5a,_0x52ae5a['account_id']);this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x169'),_0x3f8ed6[_0x39c6('0x13')]));this[_0x39c6('0x20')][_0x39c6('0x7c')](this,_0x1c6cad,_0x86c4a4);return this['channel'][_0x39c6('0x8a')](_0x39c6('0x16a'));};AGIVertices[_0x39c6('0x16')][_0x39c6('0x16b')]=function(_0x1394c5){logger['info'](util[_0x39c6('0x26')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x1394c5[_0x39c6('0x36')]));return this['channel'][_0x39c6('0x8a')](_0x39c6('0x16c'));};AGIVertices['prototype'][_0x39c6('0x16d')]=function(_0x4bc22d){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x16e'),_0x4bc22d[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x4bc22d[_0x39c6('0x16f')])){return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0x170'));}var _0x2b4c6b=this['getSmsAccount'][_0x39c6('0x7c')](this,_0x4bc22d[_0x39c6('0x16f')]);if(!_0x2b4c6b){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x4bc22d,_0x39c6('0x171'));}var _0x160454={'body':_0x4bc22d[_0x39c6('0x172')],'phone':_0x4bc22d['to']||'','SmsAccountId':_0x2b4c6b['id']};logger[_0x39c6('0xb4')](_0x39c6('0x173'),JSON[_0x39c6('0x104')](_0x160454));this[_0x39c6('0x34')][_0x39c6('0x7c')](this,_0x4bc22d,_0x4bc22d[_0x39c6('0x16f')]);this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x174'),_0x2b4c6b['name']));this[_0x39c6('0x33')][_0x39c6('0x7c')](this,_0x160454);return this['channel'][_0x39c6('0x8a')](_0x39c6('0x175'));};AGIVertices['prototype'][_0x39c6('0x176')]=function(_0x5c63f3){logger[_0x39c6('0x2c')](util['format'](_0x39c6('0x177'),_0x5c63f3['label']));if(!this[_0x39c6('0x7a')](_0x5c63f3[_0x39c6('0xad')])){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x5c63f3,_0x39c6('0x178'));}var _0x32ecf9=this[_0x39c6('0x10')][_0x39c6('0x7c')](this,_0x5c63f3['variable_id']);if(!_0x32ecf9){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x5c63f3,_0x39c6('0xae'));}return this[_0x39c6('0xd')]['setVariable'](_0x32ecf9,_0x5c63f3[_0x39c6('0x179')]);};AGIVertices[_0x39c6('0x16')][_0x39c6('0x17a')]=function(_0x417335){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')]('Enter\x20in\x20START\x20(%s)\x20block',_0x417335[_0x39c6('0x36')]));this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0x17b'));if(_0x417335[_0x39c6('0x81')]==='yes'){this[_0x39c6('0xd')][_0x39c6('0x8a')]('Answer');return this[_0x39c6('0xd')]['answer']();}return this[_0x39c6('0xd')][_0x39c6('0x8a')](_0x39c6('0x17c'));};AGIVertices[_0x39c6('0x16')]['subproject']=function(_0x14f84c){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x17d'),_0x14f84c[_0x39c6('0x36')]));if(!this['isConfigured'](_0x14f84c['project_id'])){return this[_0x39c6('0xd')]['error'](_0x14f84c,_0x39c6('0x17e'));}var _0x2e7ed4=this[_0x39c6('0x17f')][_0x39c6('0x7c')](this,_0x14f84c[_0x39c6('0x180')]);if(!this[_0x39c6('0x7a')](_0x2e7ed4)){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x14f84c,util[_0x39c6('0x26')](_0x39c6('0x181'),_0x14f84c[_0x39c6('0x180')]));}if(_0x2e7ed4===this[_0x39c6('0xd')]['arg_1']){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x14f84c,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x39c6('0x34')][_0x39c6('0x7c')](this,_0x14f84c,_0x2e7ed4);var _0x44343a=this['channel'][_0x39c6('0x53')]('AGI',util[_0x39c6('0x26')](_0x39c6('0x182'),config[_0x39c6('0x7e')][_0x39c6('0x162')]||'127.0.0.1',_0x2e7ed4,this[_0x39c6('0xd')][_0x39c6('0x38')]));if(_0x44343a[_0x39c6('0x85')]===-0x1){return _0x44343a;}return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')]('Executed\x20command\x20%s\x20%s',_0x39c6('0x183'),_0x2e7ed4));};AGIVertices['prototype'][_0x39c6('0x184')]=function(_0x48784f){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x185'),_0x48784f[_0x39c6('0x36')]));var _0x5577be=this['shellCommand'][_0x39c6('0x7c')](this,_0x48784f[_0x39c6('0x7f')]);this['createSquareDetailsReport'][_0x39c6('0x7c')](this,_0x48784f,_0x48784f['command']);if(this[_0x39c6('0x7a')](_0x48784f[_0x39c6('0xad')])){var _0x1f5488=this[_0x39c6('0x10')][_0x39c6('0x7c')](this,_0x48784f['variable_id']);if(_0x1f5488){this[_0x39c6('0xd')][_0x39c6('0x79')](_0x1f5488,_0x5577be);return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x186'),_0x48784f[_0x39c6('0x7f')],_0x1f5488));}}return this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x187'),_0x48784f['command']));};AGIVertices[_0x39c6('0x16')][_0x39c6('0x188')]=function(_0x58a961){logger['info'](util[_0x39c6('0x26')](_0x39c6('0x189'),_0x58a961[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x58a961[_0x39c6('0x56')])){return this[_0x39c6('0xd')]['noop'](_0x39c6('0x93'));}this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')](_0x39c6('0x18a'),_0x58a961['text']));var _0x46d7c8=this[_0x39c6('0x55')][_0x39c6('0x7c')](this,_0x58a961);if(_0x46d7c8){this[_0x39c6('0xd')][_0x39c6('0x8a')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x46d7c8));var _0x50c55a=this['channel'][_0x39c6('0xce')](_0x46d7c8);try{fs[_0x39c6('0xcf')](_0x46d7c8+_0x39c6('0xd0'));}catch(_0x1272df){logger[_0x39c6('0x2a')](_0x1272df);}return _0x50c55a;}return this['channel']['error'](_0x58a961,_0x39c6('0x18b'));};AGIVertices['prototype'][_0x39c6('0x18c')]=function(_0x238598){logger['info'](util[_0x39c6('0x26')](_0x39c6('0x18d'),_0x238598[_0x39c6('0x36')]));if(!this[_0x39c6('0x7a')](_0x238598[_0x39c6('0x12c')])){return this['channel']['error'](_0x238598,_0x39c6('0x12a'));}logger[_0x39c6('0x2c')](util['format'](_0x39c6('0x12b'),this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x238598[_0x39c6('0x12c')]));var _0x563b88=this[_0x39c6('0x4d')]['sync'](this,_0x238598[_0x39c6('0x12c')]);if(_0x563b88){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')](_0x39c6('0x12d'),this[_0x39c6('0xd')]['callerid'],_0x238598['findBy']));this[_0x39c6('0xd')]['noop'](util[_0x39c6('0x26')](_0x39c6('0x12d'),this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x238598['findBy']));return{'code':0xc8,'result':_0x39c6('0x12e')};}else{logger[_0x39c6('0x2c')](util['format'](_0x39c6('0x12f'),this[_0x39c6('0xd')][_0x39c6('0x3a')],_0x238598[_0x39c6('0x12c')]));this[_0x39c6('0xd')][_0x39c6('0x8a')](util[_0x39c6('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x39c6('0x3a')],_0x238598[_0x39c6('0x12c')]));return{'code':0xc8,'result':_0x39c6('0x130')};}};AGIVertices['prototype'][_0x39c6('0x18e')]=function(_0x589d8b){logger[_0x39c6('0x2c')](util[_0x39c6('0x26')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x589d8b[_0x39c6('0x36')]));var _0x25875b=this[_0x39c6('0xd')][_0x39c6('0x53')](_0x39c6('0x18f'),[_0x589d8b[_0x39c6('0x190')],_0x589d8b[_0x39c6('0x8f')]]);if(_0x25875b[_0x39c6('0x85')]===-0x1){return _0x25875b;}return this['channel']['noop'](util['format']('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x589d8b[_0x39c6('0x190')]));};AGIVertices[_0x39c6('0x16')][_0x39c6('0x191')]=function(_0x4c7447){logger[_0x39c6('0x2c')](util['format'](_0x39c6('0x192'),_0x4c7447[_0x39c6('0x36')]));if(!this['isConfigured'](_0x4c7447['variable_id'])){return this[_0x39c6('0xd')][_0x39c6('0x2a')](_0x4c7447,'no\x20variable\x20selected');}var _0x28270d=this['getVariable'][_0x39c6('0x7c')](this,_0x4c7447[_0x39c6('0xad')]);if(!_0x28270d){return this[_0x39c6('0xd')]['error'](_0x4c7447,'no\x20variable\x20found');}var _0x5ef7e8=this[_0x39c6('0xd')][_0x39c6('0x10')](_0x28270d);return{'code':0xc8,'result':_0x5ef7e8[_0x39c6('0x77')]?_0x5ef7e8[_0x39c6('0x77')]:'-'};};String['prototype'][_0x39c6('0x76')]=function(_0x2cc00d,_0xd768b6){return this[_0x39c6('0x74')](_0x2cc00d)[_0x39c6('0x193')](_0xd768b6);};module[_0x39c6('0x194')]=AGIVertices;
\ No newline at end of file
diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js
index fcfa0cb..5d0ab74 100644
--- a/server/services/ami/acw/index.js
+++ b/server/services/ami/acw/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7bae=['stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','uniqueid','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','destlinkedid','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer'];(function(_0xfa91d6,_0x2731de){var _0x77cc1d=function(_0xe57e9e){while(--_0xe57e9e){_0xfa91d6['push'](_0xfa91d6['shift']());}};_0x77cc1d(++_0x2731de);}(_0x7bae,0x13b));var _0xe7ba=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x7bae[_0x4bfac3];return _0x15f0f2;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe7ba('0x0'));var ami=require(_0xe7ba('0x1'));var logger=require('../../../config/logger')(_0xe7ba('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xe7ba('0x3'));function Acw(_0x10908b){this[_0xe7ba('0x4')]=_0x10908b[_0xe7ba('0x4')];this[_0xe7ba('0x5')]=_0x10908b[_0xe7ba('0x5')];this[_0xe7ba('0x6')]=_0x10908b[_0xe7ba('0x6')];this[_0xe7ba('0x7')]={};ami['on'](_0xe7ba('0x8'),this[_0xe7ba('0x9')][_0xe7ba('0xa')](this));ami['on'](_0xe7ba('0xb'),this[_0xe7ba('0xc')]['bind'](this));ami['on'](_0xe7ba('0xd'),this[_0xe7ba('0xe')][_0xe7ba('0xa')](this));ami['on'](_0xe7ba('0xf'),this[_0xe7ba('0x10')][_0xe7ba('0xa')](this));ami['on'](_0xe7ba('0x11'),this[_0xe7ba('0x12')][_0xe7ba('0xa')](this));ami['on']('blindtransfer',this[_0xe7ba('0x13')]['bind'](this));ami['on'](_0xe7ba('0x14'),this[_0xe7ba('0x15')][_0xe7ba('0xa')](this));}function getDiff(_0x17e4e6){var _0x15d018=moment()[_0xe7ba('0x16')](0x0);var _0x561dbb=moment(_0x17e4e6)['milliseconds'](0x0);return _0x15d018[_0xe7ba('0x17')](_0x561dbb,_0xe7ba('0x18'));}Acw[_0xe7ba('0x19')]['startAcw']=function(_0x4390e3){try{var _0x4b20fd=this;var _0x590bab=this['channels'][_0x4390e3][_0xe7ba('0x1a')];var _0x4e87f5=this[_0xe7ba('0x7')][_0x4390e3]['queue'];var _0x4e3021=this['voiceQueues'][_0x4e87f5];var _0x3f326a=![];var _0x30086c=_0xe7ba('0x1b');if(_0x4e3021[_0xe7ba('0x1c')]){if(_0x4e3021[_0xe7ba('0x1d')]['name']){_0x3f326a=!![];_0x30086c=_0x4e3021[_0xe7ba('0x1d')][_0xe7ba('0x1e')];}}ami[_0xe7ba('0x1f')]({'action':_0xe7ba('0x20'),'interface':_0x590bab,'paused':!![],'reason':_0x30086c})['then'](function(_0x1076c5){if(_0x4b20fd[_0xe7ba('0x5')][_0x590bab]){return RpcUser['getAgent'](_0x4b20fd[_0xe7ba('0x5')][_0x590bab]['id'])[_0xe7ba('0x21')](function(_0x27c882){if(_0x27c882&&!_0x27c882[_0xe7ba('0x22')]){logger[_0xe7ba('0x23')](_0xe7ba('0x24'),_0x4390e3,_0x590bab,_0x4e87f5);var _0x293b14=_0x4b20fd[_0xe7ba('0x7')][_0x4390e3][_0xe7ba('0x25')]&&_0x4b20fd[_0xe7ba('0x7')][_0x4390e3]['destlinkedid']?_0x4b20fd['channels'][_0x4390e3]['destlinkedid']:_0x4390e3;return RpcUser['savePause'](_0x4b20fd[_0xe7ba('0x5')][_0x590bab],_0x30086c,_0x293b14)['then'](function(_0x4ecc0d){if(!_0x3f326a){_0x4b20fd['timers'][_0x590bab]={};logger[_0xe7ba('0x23')](_0xe7ba('0x26'),_0x4390e3,_0x4b20fd[_0xe7ba('0x4')][_0x4e87f5][_0xe7ba('0x27')],_0x590bab,_0x4e87f5);_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x28')]=setTimeout(_0x4b20fd[_0xe7ba('0x29')][_0xe7ba('0xa')](_0x4b20fd,_0x590bab),_0x4b20fd['voiceQueues'][_0x4e87f5][_0xe7ba('0x27')]*0x3e8);_0x4b20fd['timers'][_0x590bab][_0xe7ba('0x2a')]=moment()[_0xe7ba('0x2b')](_0xe7ba('0x2c'));_0x4b20fd['timers'][_0x590bab]['uniqueid']=_0x4390e3;_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x2d')]=_0x4e87f5;_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x2e')]=function(){var _0x268308=getDiff(_0x4b20fd['timers'][_0x590bab][_0xe7ba('0x2a')]);clearTimeout(_0x4b20fd[_0xe7ba('0x6')][_0x590bab]['timer']);_0x4b20fd[_0xe7ba('0x6')][_0x590bab]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x268308},_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x2f')],_0x590bab)[_0xe7ba('0x21')](function(_0x52f90e){logger[_0xe7ba('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x4390e3,_0x268308,_0x52f90e);})[_0xe7ba('0x30')](function(_0x343cd2){logger[_0xe7ba('0x31')](_0xe7ba('0x32'),_0x4390e3,_0x343cd2);});delete _0x4b20fd[_0xe7ba('0x6')][_0x590bab];};}});}else{logger['info'](_0xe7ba('0x33'),_0x4390e3,_0x590bab,_0x4e87f5);}});}})[_0xe7ba('0x30')](function(_0x4baf97){logger[_0xe7ba('0x31')](_0xe7ba('0x26'),_0x4390e3,_0x4b20fd[_0xe7ba('0x4')][_0x4e87f5]['acwTimeout'],_0x590bab,_0x4e87f5);})[_0xe7ba('0x34')](function(){delete _0x4b20fd[_0xe7ba('0x7')][_0x4390e3];});}catch(_0x5db8ab){logger[_0xe7ba('0x31')](_0xe7ba('0x35'),_0x5db8ab[_0xe7ba('0x36')]);}};Acw['prototype'][_0xe7ba('0x29')]=function(_0x43b313){try{var _0x575f4b=this;if(_0x575f4b[_0xe7ba('0x6')][_0x43b313]){_0x575f4b[_0xe7ba('0x6')][_0x43b313][_0xe7ba('0x28')]=![];var _0x582833=_0x575f4b['timers'][_0x43b313][_0xe7ba('0x2f')];var _0x2ebb27=_0x575f4b[_0xe7ba('0x6')][_0x43b313][_0xe7ba('0x2d')];var _0x3581ef=_0x575f4b['voiceQueues'][_0x2ebb27][_0xe7ba('0x27')];logger[_0xe7ba('0x23')](_0xe7ba('0x37'),_0x43b313);RpcUser[_0xe7ba('0x38')](this['agents'][_0x43b313]);RpcVoiceAgentReport[_0xe7ba('0x39')]({'acwtime':_0x3581ef,'agentacw':!![]},_0x582833,_0x43b313)[_0xe7ba('0x21')](function(_0x46e31a){logger[_0xe7ba('0x23')](_0xe7ba('0x3a'),_0x582833,_0x3581ef,_0x46e31a);})[_0xe7ba('0x30')](function(_0x124cc4){logger['error'](_0xe7ba('0x32'),_0x582833,_0x124cc4);});}else{logger[_0xe7ba('0x31')](_0xe7ba('0x3b'),_0x43b313);if(_0x575f4b[_0xe7ba('0x6')]){logger[_0xe7ba('0x23')](_0xe7ba('0x3c'),JSON[_0xe7ba('0x3d')](_0x575f4b[_0xe7ba('0x6')]));}}}catch(_0x39d903){logger['error'](_0xe7ba('0x3e'),_0x39d903[_0xe7ba('0x36')]);}};Acw['prototype']['syncAgentConnect']=function(_0x32053d){try{if(this[_0xe7ba('0x4')][_0x32053d[_0xe7ba('0x2d')]]&&(this['voiceQueues'][_0x32053d[_0xe7ba('0x2d')]][_0xe7ba('0x2')]||this[_0xe7ba('0x4')][_0x32053d[_0xe7ba('0x2d')]][_0xe7ba('0x1c')])){if(this['agents'][_0x32053d[_0xe7ba('0x1a')]]){this['channels'][_0x32053d[_0xe7ba('0x2f')]]={'queue':_0x32053d[_0xe7ba('0x2d')],'interface':_0x32053d[_0xe7ba('0x1a')],'destlinkedid':_0x32053d[_0xe7ba('0x3f')]};}}}catch(_0x3053a4){logger[_0xe7ba('0x31')](_0xe7ba('0x40'),_0x3053a4[_0xe7ba('0x36')]);}};Acw['prototype'][_0xe7ba('0x15')]=function(_0x4178b9){try{if(this[_0xe7ba('0x4')][_0x4178b9[_0xe7ba('0x2d')]]&&(this[_0xe7ba('0x4')][_0x4178b9[_0xe7ba('0x2d')]][_0xe7ba('0x2')]||this[_0xe7ba('0x4')][_0x4178b9[_0xe7ba('0x2d')]][_0xe7ba('0x1c')])){if(this['agents'][_0x4178b9[_0xe7ba('0x1a')]]){this['channels'][_0x4178b9[_0xe7ba('0x2f')]]={'queue':_0x4178b9[_0xe7ba('0x2d')],'interface':_0x4178b9[_0xe7ba('0x1a')]};}}}catch(_0x15177c){logger[_0xe7ba('0x31')](_0xe7ba('0x41'),_0x15177c['message']);}};Acw[_0xe7ba('0x19')][_0xe7ba('0xc')]=function(_0x3f17ed){try{if(this[_0xe7ba('0x7')][_0x3f17ed[_0xe7ba('0x2f')]]&&_[_0xe7ba('0x42')](this[_0xe7ba('0x7')][_0x3f17ed[_0xe7ba('0x2f')]][_0xe7ba('0x25')])){logger[_0xe7ba('0x23')](_0xe7ba('0x43'),_0x3f17ed['uniqueid']);this[_0xe7ba('0x44')](_0x3f17ed[_0xe7ba('0x2f')]);}else if(this[_0xe7ba('0x7')][_0x3f17ed[_0xe7ba('0x45')]]&&_[_0xe7ba('0x42')](this[_0xe7ba('0x7')][_0x3f17ed['linkedid']][_0xe7ba('0x25')])){logger[_0xe7ba('0x23')]('[%s][HANGUP:LINKEDID]',_0x3f17ed[_0xe7ba('0x45')]);this[_0xe7ba('0x44')](_0x3f17ed[_0xe7ba('0x45')]);}}catch(_0x1b9a05){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x1b9a05[_0xe7ba('0x36')]);}};Acw[_0xe7ba('0x19')][_0xe7ba('0xe')]=function(_0x5af106){try{if(this[_0xe7ba('0x7')][_0x5af106[_0xe7ba('0x2f')]]&&this[_0xe7ba('0x7')][_0x5af106[_0xe7ba('0x2f')]][_0xe7ba('0x25')]){logger[_0xe7ba('0x23')](_0xe7ba('0x46'),_0x5af106['uniqueid']);this[_0xe7ba('0x44')](_0x5af106[_0xe7ba('0x2f')]);}else if(this[_0xe7ba('0x7')][_0x5af106['linkedid']]&&this[_0xe7ba('0x7')][_0x5af106[_0xe7ba('0x45')]]['attended']){logger[_0xe7ba('0x23')](_0xe7ba('0x47'),_0x5af106['linkedid']);this[_0xe7ba('0x44')](_0x5af106['linkedid']);}}catch(_0xe2cbba){logger[_0xe7ba('0x31')](_0xe7ba('0x48'),_0xe2cbba['message']);}};Acw[_0xe7ba('0x19')][_0xe7ba('0x12')]=function(_0x314549){try{if(!_[_0xe7ba('0x49')](this[_0xe7ba('0x7')][_0x314549['transfereeuniqueid']])){this[_0xe7ba('0x44')](_0x314549[_0xe7ba('0x4a')]);if(this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4b')]]){this[_0xe7ba('0x7')][_0x314549['secondtransfereruniqueid']][_0xe7ba('0x25')]=!![];this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4c')]]=this[_0xe7ba('0x7')][_0x314549['secondtransfereruniqueid']];delete this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4b')]];}}else if(!_[_0xe7ba('0x49')](this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4c')]])){this[_0xe7ba('0x44')](_0x314549['transfertargetuniqueid']);if(this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4d')]]){this[_0xe7ba('0x7')][_0x314549['origtransfereruniqueid']][_0xe7ba('0x25')]=!![];this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4a')]]=this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4d')]];delete this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4d')]];}}}catch(_0x3351d5){logger[_0xe7ba('0x31')](_0xe7ba('0x4e'),_0x3351d5[_0xe7ba('0x36')]);}};Acw[_0xe7ba('0x19')]['syncBlindTransfer']=function(_0x131331){try{if(this[_0xe7ba('0x7')][_0x131331[_0xe7ba('0x4f')]]){logger['info'](_0xe7ba('0x50'),JSON['stringify'](_0x131331[_0xe7ba('0x4f')]));this[_0xe7ba('0x44')](_0x131331[_0xe7ba('0x4f')]);}else if(this['channels'][_0x131331['transfererlinkedid']]){logger[_0xe7ba('0x23')](_0xe7ba('0x51'),JSON[_0xe7ba('0x3d')](_0x131331['transfererlinkedid']));this[_0xe7ba('0x44')](_0x131331[_0xe7ba('0x52')]);}}catch(_0x3fe82a){logger[_0xe7ba('0x31')](_0xe7ba('0x53'),_0x3fe82a['message']);}};Acw[_0xe7ba('0x19')][_0xe7ba('0x10')]=function(_0x70ce9c){try{if(this['voiceQueues'][_0x70ce9c[_0xe7ba('0x2d')]]&&this[_0xe7ba('0x4')][_0x70ce9c[_0xe7ba('0x2d')]][_0xe7ba('0x54')]===_0xe7ba('0x55')){if(this[_0xe7ba('0x5')][_0x70ce9c[_0xe7ba('0x1a')]]){logger[_0xe7ba('0x23')](_0xe7ba('0x56'),_0x70ce9c[_0xe7ba('0x2f')],_0x70ce9c['interface'],_0x70ce9c[_0xe7ba('0x2d')]);return RpcUser[_0xe7ba('0x57')](this[_0xe7ba('0x5')][_0x70ce9c[_0xe7ba('0x1a')]],'Auto-Pause',_0x70ce9c['uniqueid']);}}}catch(_0x103eb8){logger[_0xe7ba('0x31')](_0xe7ba('0x58'),_0x103eb8['message']);}};module['exports']=Acw;
\ No newline at end of file
+var _0x008c=['[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','[ACW][START]\x20%s','message','stopAcw','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','isUndefined','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','bind','hangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','mandatoryDisposition','Action','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause'];(function(_0x5191f9,_0x3a513a){var _0x27d020=function(_0x55b55a){while(--_0x55b55a){_0x5191f9['push'](_0x5191f9['shift']());}};_0x27d020(++_0x3a513a);}(_0x008c,0x188));var _0xc008=function(_0x341c7d,_0x4ca460){_0x341c7d=_0x341c7d-0x0;var _0x5ab893=_0x008c[_0x341c7d];return _0x5ab893;};'use strict';var util=require(_0xc008('0x0'));var _=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var ami=require(_0xc008('0x3'));var logger=require(_0xc008('0x4'))('acw');var RpcUser=require(_0xc008('0x5'));var RpcVoiceAgentReport=require(_0xc008('0x6'));function Acw(_0x10b33c){this[_0xc008('0x7')]=_0x10b33c[_0xc008('0x7')];this[_0xc008('0x8')]=_0x10b33c[_0xc008('0x8')];this[_0xc008('0x9')]=_0x10b33c[_0xc008('0x9')];this['channels']={};ami['on'](_0xc008('0xa'),this['syncAgentConnect'][_0xc008('0xb')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0xc008('0xb')](this));ami['on'](_0xc008('0xc'),this['syncHangup']['bind'](this));ami['on']('agentringnoanswer',this[_0xc008('0xd')][_0xc008('0xb')](this));ami['on']('attendedtransfer',this[_0xc008('0xe')][_0xc008('0xb')](this));ami['on'](_0xc008('0xf'),this[_0xc008('0x10')][_0xc008('0xb')](this));ami['on'](_0xc008('0x11'),this[_0xc008('0x12')]['bind'](this));}function getDiff(_0x560e28){var _0x33f44c=moment()['milliseconds'](0x0);var _0x25e13f=moment(_0x560e28)[_0xc008('0x13')](0x0);return _0x33f44c[_0xc008('0x14')](_0x25e13f,_0xc008('0x15'));}Acw[_0xc008('0x16')]['startAcw']=function(_0x5e894e){try{var _0x4bd0f4=this;var _0x11ef38=this[_0xc008('0x17')][_0x5e894e][_0xc008('0x18')];var _0x3eb12a=this['channels'][_0x5e894e]['queue'];var _0x540e45=this['voiceQueues'][_0x3eb12a];var _0x46042b=![];var _0x462af5='ACW';if(_0x540e45[_0xc008('0x19')]){if(_0x540e45['mandatoryDispositionPause']['name']){_0x46042b=!![];_0x462af5=_0x540e45['mandatoryDispositionPause']['name'];}}ami[_0xc008('0x1a')]({'action':'QueuePause','interface':_0x11ef38,'paused':!![],'reason':_0x462af5})['then'](function(_0x590a71){if(_0x4bd0f4['agents'][_0x11ef38]){return RpcUser['getAgent'](_0x4bd0f4[_0xc008('0x8')][_0x11ef38]['id'])[_0xc008('0x1b')](function(_0x251db2){if(_0x251db2&&!_0x251db2[_0xc008('0x1c')]){logger[_0xc008('0x1d')](_0xc008('0x1e'),_0x5e894e,_0x11ef38,_0x3eb12a);var _0x4f43e2=_0x4bd0f4[_0xc008('0x17')][_0x5e894e]['attended']&&_0x4bd0f4['channels'][_0x5e894e][_0xc008('0x1f')]?_0x4bd0f4[_0xc008('0x17')][_0x5e894e][_0xc008('0x1f')]:_0x5e894e;return RpcUser[_0xc008('0x20')](_0x4bd0f4['agents'][_0x11ef38],_0x462af5,_0x4f43e2)['then'](function(_0x5de1e9){if(!_0x46042b){_0x4bd0f4[_0xc008('0x9')][_0x11ef38]={};logger[_0xc008('0x1d')](_0xc008('0x21'),_0x5e894e,_0x4bd0f4[_0xc008('0x7')][_0x3eb12a]['acwTimeout'],_0x11ef38,_0x3eb12a);_0x4bd0f4['timers'][_0x11ef38]['timer']=setTimeout(_0x4bd0f4['stopAcw']['bind'](_0x4bd0f4,_0x11ef38),_0x4bd0f4[_0xc008('0x7')][_0x3eb12a][_0xc008('0x22')]*0x3e8);_0x4bd0f4[_0xc008('0x9')][_0x11ef38]['lastPauseAt']=moment()[_0xc008('0x23')](_0xc008('0x24'));_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x25')]=_0x5e894e;_0x4bd0f4['timers'][_0x11ef38][_0xc008('0x26')]=_0x3eb12a;_0x4bd0f4[_0xc008('0x9')][_0x11ef38]['updateAcw']=function(){var _0x58db82=getDiff(_0x4bd0f4['timers'][_0x11ef38][_0xc008('0x27')]);clearTimeout(_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x28')]);_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x28')]=![];RpcVoiceAgentReport[_0xc008('0x29')]({'acwtime':_0x58db82},_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x25')],_0x11ef38)[_0xc008('0x1b')](function(_0x2b862d){logger[_0xc008('0x1d')](_0xc008('0x2a'),_0x5e894e,_0x58db82,_0x2b862d);})['catch'](function(_0x334a09){logger[_0xc008('0x2b')]('[%s][UPDATE][ERRORS:%s]',_0x5e894e,_0x334a09);});delete _0x4bd0f4[_0xc008('0x9')][_0x11ef38];};}});}else{logger[_0xc008('0x1d')](_0xc008('0x2c'),_0x5e894e,_0x11ef38,_0x3eb12a);}});}})[_0xc008('0x2d')](function(_0xd0e05a){logger[_0xc008('0x2b')](_0xc008('0x21'),_0x5e894e,_0x4bd0f4[_0xc008('0x7')][_0x3eb12a][_0xc008('0x22')],_0x11ef38,_0x3eb12a);})['finally'](function(){delete _0x4bd0f4[_0xc008('0x17')][_0x5e894e];});}catch(_0x389a40){logger[_0xc008('0x2b')](_0xc008('0x2e'),_0x389a40[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x30')]=function(_0x5d0e06){try{var _0x35f360=this;if(_0x35f360[_0xc008('0x9')][_0x5d0e06]){_0x35f360['timers'][_0x5d0e06][_0xc008('0x28')]=![];var _0x15453c=_0x35f360['timers'][_0x5d0e06][_0xc008('0x25')];var _0x2e4ae1=_0x35f360[_0xc008('0x9')][_0x5d0e06]['queue'];var _0x53b353=_0x35f360['voiceQueues'][_0x2e4ae1][_0xc008('0x22')];logger['info'](_0xc008('0x31'),_0x5d0e06);RpcUser[_0xc008('0x32')](this[_0xc008('0x8')][_0x5d0e06]);RpcVoiceAgentReport[_0xc008('0x29')]({'acwtime':_0x53b353,'agentacw':!![]},_0x15453c,_0x5d0e06)[_0xc008('0x1b')](function(_0xa381d1){logger[_0xc008('0x1d')](_0xc008('0x2a'),_0x15453c,_0x53b353,_0xa381d1);})[_0xc008('0x2d')](function(_0x387dfd){logger[_0xc008('0x2b')](_0xc008('0x33'),_0x15453c,_0x387dfd);});}else{logger[_0xc008('0x2b')](_0xc008('0x34'),_0x5d0e06);if(_0x35f360['timers']){logger[_0xc008('0x1d')](_0xc008('0x35'),JSON[_0xc008('0x36')](_0x35f360[_0xc008('0x9')]));}}}catch(_0x49a16d){logger[_0xc008('0x2b')](_0xc008('0x37'),_0x49a16d[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x38')]=function(_0x5706bb){try{if(this[_0xc008('0x7')][_0x5706bb[_0xc008('0x26')]]&&(this[_0xc008('0x7')][_0x5706bb[_0xc008('0x26')]][_0xc008('0x39')]||this['voiceQueues'][_0x5706bb[_0xc008('0x26')]][_0xc008('0x19')])){if(this[_0xc008('0x8')][_0x5706bb[_0xc008('0x18')]]){this['channels'][_0x5706bb[_0xc008('0x25')]]={'queue':_0x5706bb[_0xc008('0x26')],'interface':_0x5706bb[_0xc008('0x18')],'destlinkedid':_0x5706bb['destlinkedid']};}}}catch(_0x1f9af7){logger['error'](_0xc008('0x3a'),_0x1f9af7['message']);}};Acw[_0xc008('0x16')][_0xc008('0x12')]=function(_0x5a5d85){try{if(this[_0xc008('0x7')][_0x5a5d85[_0xc008('0x26')]]&&(this[_0xc008('0x7')][_0x5a5d85['queue']][_0xc008('0x39')]||this[_0xc008('0x7')][_0x5a5d85[_0xc008('0x26')]][_0xc008('0x19')])){if(this[_0xc008('0x8')][_0x5a5d85[_0xc008('0x18')]]){this['channels'][_0x5a5d85['uniqueid']]={'queue':_0x5a5d85['queue'],'interface':_0x5a5d85[_0xc008('0x18')]};}}}catch(_0x36417a){logger[_0xc008('0x2b')](_0xc008('0x3b'),_0x36417a[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x3c')]=function(_0x33be4f){try{if(this['channels'][_0x33be4f['uniqueid']]&&_['isUndefined'](this[_0xc008('0x17')][_0x33be4f[_0xc008('0x25')]][_0xc008('0x3d')])){logger['info'](_0xc008('0x3e'),_0x33be4f[_0xc008('0x25')]);this[_0xc008('0x3f')](_0x33be4f[_0xc008('0x25')]);}else if(this[_0xc008('0x17')][_0x33be4f[_0xc008('0x40')]]&&_[_0xc008('0x41')](this[_0xc008('0x17')][_0x33be4f[_0xc008('0x40')]][_0xc008('0x3d')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x33be4f[_0xc008('0x40')]);this['startAcw'](_0x33be4f[_0xc008('0x40')]);}}catch(_0x36e6f8){logger[_0xc008('0x2b')]('[ACW][syncHangupRequest]\x20%s',_0x36e6f8[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x42')]=function(_0x8b9775){try{if(this[_0xc008('0x17')][_0x8b9775['uniqueid']]&&this[_0xc008('0x17')][_0x8b9775[_0xc008('0x25')]]['attended']){logger[_0xc008('0x1d')](_0xc008('0x43'),_0x8b9775['uniqueid']);this['startAcw'](_0x8b9775[_0xc008('0x25')]);}else if(this[_0xc008('0x17')][_0x8b9775[_0xc008('0x40')]]&&this[_0xc008('0x17')][_0x8b9775[_0xc008('0x40')]]['attended']){logger['info'](_0xc008('0x44'),_0x8b9775['linkedid']);this[_0xc008('0x3f')](_0x8b9775[_0xc008('0x40')]);}}catch(_0xf94fcb){logger[_0xc008('0x2b')](_0xc008('0x45'),_0xf94fcb[_0xc008('0x2f')]);}};Acw['prototype'][_0xc008('0xe')]=function(_0xbd7422){try{if(!_[_0xc008('0x46')](this[_0xc008('0x17')][_0xbd7422[_0xc008('0x47')]])){this['startAcw'](_0xbd7422[_0xc008('0x47')]);if(this['channels'][_0xbd7422['secondtransfereruniqueid']]){this['channels'][_0xbd7422[_0xc008('0x48')]][_0xc008('0x3d')]=!![];this[_0xc008('0x17')][_0xbd7422['transfertargetuniqueid']]=this[_0xc008('0x17')][_0xbd7422[_0xc008('0x48')]];delete this[_0xc008('0x17')][_0xbd7422['secondtransfereruniqueid']];}}else if(!_[_0xc008('0x46')](this[_0xc008('0x17')][_0xbd7422[_0xc008('0x49')]])){this[_0xc008('0x3f')](_0xbd7422['transfertargetuniqueid']);if(this[_0xc008('0x17')][_0xbd7422['origtransfereruniqueid']]){this[_0xc008('0x17')][_0xbd7422[_0xc008('0x4a')]][_0xc008('0x3d')]=!![];this[_0xc008('0x17')][_0xbd7422[_0xc008('0x47')]]=this[_0xc008('0x17')][_0xbd7422['origtransfereruniqueid']];delete this[_0xc008('0x17')][_0xbd7422['origtransfereruniqueid']];}}}catch(_0x5bf4a9){logger[_0xc008('0x2b')](_0xc008('0x4b'),_0x5bf4a9['message']);}};Acw[_0xc008('0x16')][_0xc008('0x10')]=function(_0x3e373e){try{if(this[_0xc008('0x17')][_0x3e373e[_0xc008('0x4c')]]){logger[_0xc008('0x1d')](_0xc008('0x4d'),JSON['stringify'](_0x3e373e[_0xc008('0x4c')]));this[_0xc008('0x3f')](_0x3e373e[_0xc008('0x4c')]);}else if(this[_0xc008('0x17')][_0x3e373e[_0xc008('0x4e')]]){logger[_0xc008('0x1d')](_0xc008('0x4f'),JSON[_0xc008('0x36')](_0x3e373e[_0xc008('0x4e')]));this[_0xc008('0x3f')](_0x3e373e[_0xc008('0x4e')]);}}catch(_0x2b5eb6){logger[_0xc008('0x2b')](_0xc008('0x50'),_0x2b5eb6['message']);}};Acw[_0xc008('0x16')][_0xc008('0xd')]=function(_0x3d3a7e){try{if(this['voiceQueues'][_0x3d3a7e[_0xc008('0x26')]]&&this[_0xc008('0x7')][_0x3d3a7e['queue']]['autopause']===_0xc008('0x51')){if(this[_0xc008('0x8')][_0x3d3a7e[_0xc008('0x18')]]){logger[_0xc008('0x1d')](_0xc008('0x52'),_0x3d3a7e[_0xc008('0x25')],_0x3d3a7e[_0xc008('0x18')],_0x3d3a7e[_0xc008('0x26')]);return RpcUser[_0xc008('0x20')](this[_0xc008('0x8')][_0x3d3a7e[_0xc008('0x18')]],'Auto-Pause',_0x3d3a7e[_0xc008('0x25')]);}}}catch(_0x25a52b){logger[_0xc008('0x2b')](_0xc008('0x53'),_0x25a52b['message']);}};module[_0xc008('0x54')]=Acw;
\ No newline at end of file
diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js
index bf602d5..b99583f 100644
--- a/server/services/ami/ami.js
+++ b/server/services/ami/ami.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d67=['connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','catch','log','close','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../config/environment','port','asterisk','username','password','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once'];(function(_0x1ba3ca,_0x49958c){var _0x29d8c9=function(_0x4a94bf){while(--_0x4a94bf){_0x1ba3ca['push'](_0x1ba3ca['shift']());}};_0x29d8c9(++_0x49958c);}(_0x4d67,0xcf));var _0x74d6=function(_0x19433d,_0x283c41){_0x19433d=_0x19433d-0x0;var _0x30fa27=_0x4d67[_0x19433d];return _0x30fa27;};'use strict';var Manager=require(_0x74d6('0x0'));var BPromise=require(_0x74d6('0x1'));var moment=require(_0x74d6('0x2'));var util=require(_0x74d6('0x3'));var _=require(_0x74d6('0x4'));var logger=require(_0x74d6('0x5'))('ami');var config=require(_0x74d6('0x6'));var ami=new Manager(config['asterisk'][_0x74d6('0x7')],config[_0x74d6('0x8')]['ip'],config[_0x74d6('0x8')][_0x74d6('0x9')],config['asterisk'][_0x74d6('0xa')],!![]);ami[_0x74d6('0xb')]();ami[_0x74d6('0xc')]=BPromise[_0x74d6('0xd')](ami[_0x74d6('0xe')]);function error(_0x58520c){logger['error'](util[_0x74d6('0xf')](_0x74d6('0x10'),config[_0x74d6('0x8')][_0x74d6('0x9')],config['asterisk']['ip'],config['asterisk'][_0x74d6('0x7')],util[_0x74d6('0x11')](_0x58520c,![],null)));}function close(){logger[_0x74d6('0x12')](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x74d6('0x8')][_0x74d6('0x9')],config['asterisk']['ip'],config[_0x74d6('0x8')][_0x74d6('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x74d6('0xc')]({'action':_0x74d6('0x13')});};};ami[_0x74d6('0x14')]=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0x74d6('0x15')]=function(){return function(){return ami[_0x74d6('0xc')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x74d6('0xc')]({'action':_0x74d6('0x16')});};};ami[_0x74d6('0x17')]=function(){return function(){return ami[_0x74d6('0xc')]({'action':'coreshowchannels'});};};function connect(_0x417142){logger[_0x74d6('0x18')](util[_0x74d6('0xf')](_0x74d6('0x19'),config[_0x74d6('0x8')][_0x74d6('0x9')],config['asterisk']['ip'],config[_0x74d6('0x8')][_0x74d6('0x7')]));ami['once']('error',error);ami[_0x74d6('0x1a')]('close',close);}ami['on'](_0x74d6('0x1b'),connect);ami['on'](_0x74d6('0x1c'),function(_0x2480ed){logger[_0x74d6('0x18')](util['format'](_0x74d6('0x1d'),config[_0x74d6('0x8')][_0x74d6('0x9')],config['asterisk']['ip'],config['asterisk']['port'],util[_0x74d6('0x11')](_0x2480ed,![],null)));});ami['on'](_0x74d6('0x1e'),function(_0x36a570){logger[_0x74d6('0x18')](util[_0x74d6('0xf')](_0x74d6('0x1f'),config['asterisk']['username'],config[_0x74d6('0x8')]['ip'],config[_0x74d6('0x8')][_0x74d6('0x7')]));return BPromise[_0x74d6('0x20')]()['then'](ami['actionSipShowRegistry']())[_0x74d6('0x21')](ami[_0x74d6('0x14')]())[_0x74d6('0x21')](ami[_0x74d6('0x15')]())[_0x74d6('0x21')](ami[_0x74d6('0x22')]())[_0x74d6('0x21')](ami['actionCoreShowChannels']())[_0x74d6('0x23')](function(_0x179c16){console[_0x74d6('0x24')](_0x179c16);});});ami[_0x74d6('0x1a')](_0x74d6('0x12'),error);ami[_0x74d6('0x1a')](_0x74d6('0x25'),close);module[_0x74d6('0x26')]=ami;
\ No newline at end of file
+var _0xeac3=['actionCoreShowChannels','catch','log','close','exports','asterisk-manager','bluebird','util','lodash','../../config/logger','ami','port','asterisk','username','password','keepConnected','promisify','error','format','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then'];(function(_0x1bbcdb,_0x12ce8f){var _0x3c9c4a=function(_0x554237){while(--_0x554237){_0x1bbcdb['push'](_0x1bbcdb['shift']());}};_0x3c9c4a(++_0x12ce8f);}(_0xeac3,0x108));var _0x3eac=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xeac3[_0x160c73];return _0xd9302;};'use strict';var Manager=require(_0x3eac('0x0'));var BPromise=require(_0x3eac('0x1'));var moment=require('moment');var util=require(_0x3eac('0x2'));var _=require(_0x3eac('0x3'));var logger=require(_0x3eac('0x4'))(_0x3eac('0x5'));var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0x3eac('0x6')],config['asterisk']['ip'],config[_0x3eac('0x7')][_0x3eac('0x8')],config[_0x3eac('0x7')][_0x3eac('0x9')],!![]);ami[_0x3eac('0xa')]();ami['Action']=BPromise[_0x3eac('0xb')](ami['action']);function error(_0x452ed0){logger[_0x3eac('0xc')](util[_0x3eac('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x3eac('0x7')][_0x3eac('0x8')],config[_0x3eac('0x7')]['ip'],config[_0x3eac('0x7')][_0x3eac('0x6')],util[_0x3eac('0xe')](_0x452ed0,![],null)));}function close(){logger['error'](util[_0x3eac('0xd')](_0x3eac('0xf'),config[_0x3eac('0x7')][_0x3eac('0x8')],config[_0x3eac('0x7')]['ip'],config['asterisk'][_0x3eac('0x6')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x3eac('0x10')]({'action':_0x3eac('0x11')});};};ami[_0x3eac('0x12')]=function(){return function(){return ami[_0x3eac('0x10')]({'action':_0x3eac('0x13')});};};ami[_0x3eac('0x14')]=function(){return function(){return ami['Action']({'action':_0x3eac('0x15')});};};ami[_0x3eac('0x16')]=function(){return function(){return ami[_0x3eac('0x10')]({'action':_0x3eac('0x17')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x3eac('0x10')]({'action':'coreshowchannels'});};};function connect(_0x261b2c){logger[_0x3eac('0x18')](util[_0x3eac('0xd')](_0x3eac('0x19'),config['asterisk'][_0x3eac('0x8')],config[_0x3eac('0x7')]['ip'],config[_0x3eac('0x7')][_0x3eac('0x6')]));ami[_0x3eac('0x1a')](_0x3eac('0xc'),error);ami[_0x3eac('0x1a')]('close',close);}ami['on'](_0x3eac('0x1b'),connect);ami['on']('shutdown',function(_0x8a72c2){logger['info'](util[_0x3eac('0xd')](_0x3eac('0x1c'),config[_0x3eac('0x7')]['username'],config[_0x3eac('0x7')]['ip'],config['asterisk']['port'],util[_0x3eac('0xe')](_0x8a72c2,![],null)));});ami['on']('fullybooted',function(_0x6306b){logger[_0x3eac('0x18')](util['format'](_0x3eac('0x1d'),config[_0x3eac('0x7')][_0x3eac('0x8')],config['asterisk']['ip'],config[_0x3eac('0x7')][_0x3eac('0x6')]));return BPromise[_0x3eac('0x1e')]()[_0x3eac('0x1f')](ami['actionSipShowRegistry']())[_0x3eac('0x1f')](ami[_0x3eac('0x12')]())[_0x3eac('0x1f')](ami['actionSipPeerStatus']())['then'](ami[_0x3eac('0x16')]())[_0x3eac('0x1f')](ami[_0x3eac('0x20')]())[_0x3eac('0x21')](function(_0x1d26a6){console[_0x3eac('0x22')](_0x1d26a6);});});ami['once'](_0x3eac('0xc'),error);ami[_0x3eac('0x1a')](_0x3eac('0x23'),close);module[_0x3eac('0x24')]=ami;
\ No newline at end of file
diff --git a/server/services/ami/client.js b/server/services/ami/client.js
index 9b59f4f..78a45fa 100644
--- a/server/services/ami/client.js
+++ b/server/services/ami/client.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x637e=['client','http','Request','then','rpc','memberReport','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x637e,0xdd));var _0xe637=function(_0x5c725f,_0x2bdf4a){_0x5c725f=_0x5c725f-0x0;var _0x1760e6=_0x637e[_0x5c725f];return _0x1760e6;};'use strict';var jayson=require(_0xe637('0x0'));var BPromise=require(_0xe637('0x1'));var logger=require(_0xe637('0x2'))(_0xe637('0x3'));var client=jayson[_0xe637('0x4')][_0xe637('0x5')]({'port':0x2329});client[_0xe637('0x6')]=function(_0x127808,_0x516de6){return new BPromise(function(_0x1aa339,_0x14a173){return client['request'](_0x127808,_0x516de6)[_0xe637('0x7')](function(_0xba364a){logger['debug'](_0xe637('0x8'),_0xe637('0x9'),_0x127808,_0x516de6,_0xba364a);if(_0xba364a[_0xe637('0xa')]){logger['error'](_0xe637('0x8'),'memberReport',_0x127808,_0xba364a[_0xe637('0xa')][_0xe637('0xb')],_0x516de6);return _0x14a173(_0xba364a['error'][_0xe637('0xb')]);}else{return _0x1aa339(_0xba364a[_0xe637('0xc')]);}})[_0xe637('0xd')](function(_0x224614){logger[_0xe637('0xa')](_0xe637('0x8'),'memberReport',_0x127808,_0x224614,_0x516de6);return _0x14a173(_0x224614);});});};module[_0xe637('0xe')]=client;
\ No newline at end of file
+var _0x5dff=['client','http','Request','request','then','debug','rpc','memberReport','error','message','jayson/promise','bluebird','ami'];(function(_0x6209fd,_0x2414d3){var _0x5d5a5a=function(_0x1401a3){while(--_0x1401a3){_0x6209fd['push'](_0x6209fd['shift']());}};_0x5d5a5a(++_0x2414d3);}(_0x5dff,0x15c));var _0xf5df=function(_0x274410,_0x537586){_0x274410=_0x274410-0x0;var _0x578e69=_0x5dff[_0x274410];return _0x578e69;};'use strict';var jayson=require(_0xf5df('0x0'));var BPromise=require(_0xf5df('0x1'));var logger=require('../../config/logger')(_0xf5df('0x2'));var client=jayson[_0xf5df('0x3')][_0xf5df('0x4')]({'port':0x2329});client[_0xf5df('0x5')]=function(_0x31d87b,_0x4bd885){return new BPromise(function(_0x15e5f7,_0x31a333){return client[_0xf5df('0x6')](_0x31d87b,_0x4bd885)[_0xf5df('0x7')](function(_0x3bdbe2){logger[_0xf5df('0x8')](_0xf5df('0x9'),_0xf5df('0xa'),_0x31d87b,_0x4bd885,_0x3bdbe2);if(_0x3bdbe2[_0xf5df('0xb')]){logger[_0xf5df('0xb')]('rpc',_0xf5df('0xa'),_0x31d87b,_0x3bdbe2[_0xf5df('0xb')][_0xf5df('0xc')],_0x4bd885);return _0x31a333(_0x3bdbe2[_0xf5df('0xb')][_0xf5df('0xc')]);}else{return _0x15e5f7(_0x3bdbe2['result']);}})['catch'](function(_0x57558a){logger[_0xf5df('0xb')](_0xf5df('0x9'),'memberReport',_0x31d87b,_0x57558a,_0x4bd885);return _0x31a333(_0x57558a);});});};module['exports']=client;
\ No newline at end of file
diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js
index 827b060..0d211da 100644
--- a/server/services/ami/dialer/action.js
+++ b/server/services/ami/dialer/action.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb957=['dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','moment','string','isNil','voiceQueue','uniqueid','name','Contact','firstName','lastName','queue','type'];(function(_0x39dee1,_0x3c3409){var _0x3ccebd=function(_0x321ba7){while(--_0x321ba7){_0x39dee1['push'](_0x39dee1['shift']());}};_0x3ccebd(++_0x3c3409);}(_0xb957,0x6d));var _0x7b95=function(_0x32d725,_0x35832f){_0x32d725=_0x32d725-0x0;var _0xd3a06=_0xb957[_0x32d725];return _0xd3a06;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x7b95('0x0'));function checkNameSurname(_0x5012da,_0x477577,_0x24ded4){var _0xef509a='';if(!_['isNil'](_0x477577)&&_0x7b95('0x1')===typeof _0x477577){_0xef509a+=_0x477577;}if(!_[_0x7b95('0x2')](_0x24ded4)&&_0x7b95('0x1')===typeof _0x24ded4){_0xef509a+='\x20'+_0x24ded4;}if(_0xef509a!==''){return _0xef509a;}return _0x5012da;}function Action(_0x3ef8f4,_0x19ff14,_0x518099){this[_0x7b95('0x3')]=_0x3ef8f4;this[_0x7b95('0x4')]=_0x518099||undefined;this[_0x7b95('0x5')]=checkNameSurname(_0x19ff14['Contact']['phone'],_0x19ff14[_0x7b95('0x6')][_0x7b95('0x7')],_0x19ff14[_0x7b95('0x6')][_0x7b95('0x8')]);this['number']=_0x19ff14['Contact']['phone'];this[_0x7b95('0x9')]=_0x3ef8f4[_0x7b95('0x5')];this['active']=_0x19ff14['active']||![];this[_0x7b95('0xa')]=_0x3ef8f4[_0x7b95('0xa')];this[_0x7b95('0xb')]=_0x3ef8f4['dialQueueTimeout']||0x3;this['scheduledat']=_0x19ff14[_0x7b95('0xc')];this['countbusyretry']=_0x19ff14[_0x7b95('0xd')];this[_0x7b95('0xe')]=_0x19ff14[_0x7b95('0xe')];this[_0x7b95('0xf')]=_0x19ff14['countnoanswerretry'];this['ContactId']=_0x19ff14[_0x7b95('0x10')];this[_0x7b95('0x11')]=_0x19ff14[_0x7b95('0x11')];this[_0x7b95('0x12')]=_0x19ff14[_0x7b95('0x12')];this[_0x7b95('0x13')]=_0x19ff14[_0x7b95('0x13')];this[_0x7b95('0x14')]=_0x19ff14[_0x7b95('0x14')];this[_0x7b95('0x15')]=_0x19ff14['id'];this[_0x7b95('0x16')]=_0x19ff14['Contact'][_0x7b95('0x7')]||'';this[_0x7b95('0x17')]=moment()[_0x7b95('0x18')](_0x7b95('0x19'));this[_0x7b95('0x1a')]=_0x19ff14[_0x7b95('0x1a')];this[_0x7b95('0x1b')]=_0x19ff14[_0x7b95('0x1b')];this['callbackat']=_0x19ff14[_0x7b95('0x1c')];this[_0x7b95('0x1d')]=_0x19ff14[_0x7b95('0x1d')];this[_0x7b95('0x1e')]='';this[_0x7b95('0x1f')]='';}Action[_0x7b95('0x20')][_0x7b95('0x21')]=function(){return util[_0x7b95('0x18')](_0x7b95('0x22'),this[_0x7b95('0x5')],this[_0x7b95('0x3')][_0x7b95('0x23')]>0x0?this[_0x7b95('0x24')][_0x7b95('0x25')](this['voiceQueue'][_0x7b95('0x23')]):this[_0x7b95('0x24')]);};Action['prototype'][_0x7b95('0x26')]=function(){return this[_0x7b95('0x9')];};module[_0x7b95('0x27')]=Action;
\ No newline at end of file
+var _0xcca7=['getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','queue','exports','util','lodash','moment','string','isNil','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','CampaignId','idHopper','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype'];(function(_0x9bea48,_0x587c06){var _0x2b0244=function(_0x21984c){while(--_0x21984c){_0x9bea48['push'](_0x9bea48['shift']());}};_0x2b0244(++_0x587c06);}(_0xcca7,0x1aa));var _0x7cca=function(_0x1dd218,_0x44bff8){_0x1dd218=_0x1dd218-0x0;var _0x4705e7=_0xcca7[_0x1dd218];return _0x4705e7;};'use strict';var util=require(_0x7cca('0x0'));var _=require(_0x7cca('0x1'));var moment=require(_0x7cca('0x2'));function checkNameSurname(_0x33db4f,_0x5cfce5,_0x4c311e){var _0x30823f='';if(!_['isNil'](_0x5cfce5)&&_0x7cca('0x3')===typeof _0x5cfce5){_0x30823f+=_0x5cfce5;}if(!_[_0x7cca('0x4')](_0x4c311e)&&_0x7cca('0x3')===typeof _0x4c311e){_0x30823f+='\x20'+_0x4c311e;}if(_0x30823f!==''){return _0x30823f;}return _0x33db4f;}function Action(_0x312e98,_0x1c6c95,_0xe70805){this['voiceQueue']=_0x312e98;this['uniqueid']=_0xe70805||undefined;this[_0x7cca('0x5')]=checkNameSurname(_0x1c6c95[_0x7cca('0x6')][_0x7cca('0x7')],_0x1c6c95[_0x7cca('0x6')][_0x7cca('0x8')],_0x1c6c95[_0x7cca('0x6')][_0x7cca('0x9')]);this[_0x7cca('0xa')]=_0x1c6c95[_0x7cca('0x6')][_0x7cca('0x7')];this['queue']=_0x312e98[_0x7cca('0x5')];this[_0x7cca('0xb')]=_0x1c6c95[_0x7cca('0xb')]||![];this[_0x7cca('0xc')]=_0x312e98[_0x7cca('0xc')];this['dialQueueTimeout']=_0x312e98[_0x7cca('0xd')]||0x3;this[_0x7cca('0xe')]=_0x1c6c95[_0x7cca('0xe')];this['countbusyretry']=_0x1c6c95['countbusyretry'];this[_0x7cca('0xf')]=_0x1c6c95[_0x7cca('0xf')];this[_0x7cca('0x10')]=_0x1c6c95[_0x7cca('0x10')];this[_0x7cca('0x11')]=_0x1c6c95[_0x7cca('0x11')];this[_0x7cca('0x12')]=_0x1c6c95['ListId'];this[_0x7cca('0x13')]=_0x1c6c95['UserId'];this['VoiceQueueId']=_0x1c6c95['VoiceQueueId'];this[_0x7cca('0x14')]=_0x1c6c95[_0x7cca('0x14')];this[_0x7cca('0x15')]=_0x1c6c95['id'];this[_0x7cca('0x16')]=_0x1c6c95[_0x7cca('0x6')]['firstName']||'';this[_0x7cca('0x17')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x1c6c95[_0x7cca('0x18')];this[_0x7cca('0x19')]=_0x1c6c95[_0x7cca('0x19')];this[_0x7cca('0x1a')]=_0x1c6c95[_0x7cca('0x1a')];this[_0x7cca('0x1b')]=_0x1c6c95[_0x7cca('0x1b')];this[_0x7cca('0x1c')]='';this['originatecalleridname']='';}Action[_0x7cca('0x1d')][_0x7cca('0x1e')]=function(){return util[_0x7cca('0x1f')](_0x7cca('0x20'),this['name'],this[_0x7cca('0x21')][_0x7cca('0x22')]>0x0?this[_0x7cca('0xa')][_0x7cca('0x23')](this[_0x7cca('0x21')][_0x7cca('0x22')]):this[_0x7cca('0xa')]);};Action[_0x7cca('0x1d')]['getQueue']=function(){return this[_0x7cca('0x24')];};module[_0x7cca('0x25')]=Action;
\ No newline at end of file
diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js
index f9099da..08aaaa3 100644
--- a/server/services/ami/dialer/agentComplete.js
+++ b/server/services/ami/dialer/agentComplete.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbb26=['holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format'];(function(_0x29f429,_0x3df852){var _0x3234d6=function(_0x42e680){while(--_0x42e680){_0x29f429['push'](_0x29f429['shift']());}};_0x3234d6(++_0x3df852);}(_0xbb26,0xde));var _0x6bb2=function(_0x12988b,_0x4349eb){_0x12988b=_0x12988b-0x0;var _0x2050c2=_0xbb26[_0x12988b];return _0x2050c2;};'use strict';var util=require(_0x6bb2('0x0'));var _=require(_0x6bb2('0x1'));var moment=require('moment');function getSeconds(_0x54795d,_0x34dfcf){var _0x271996=moment(_0x54795d)[_0x6bb2('0x2')](0x0);var _0x4b9f96=moment(_0x34dfcf)[_0x6bb2('0x2')](0x0);return _0x271996[_0x6bb2('0x3')](_0x4b9f96,_0x6bb2('0x4'));}function AgentComplete(_0x2e12eb,_0x15b10d){this[_0x6bb2('0x5')]=0x4;this['statedesc']=_0x6bb2('0x6');this[_0x6bb2('0x7')]=_0x2e12eb['scheduledat'];this[_0x6bb2('0x8')]=_0x2e12eb[_0x6bb2('0x8')];this[_0x6bb2('0x9')]=_0x2e12eb[_0x6bb2('0x8')]==='outbound'?'queue':_0x2e12eb[_0x6bb2('0x8')];this[_0x6bb2('0xa')]=_0x2e12eb[_0x6bb2('0xa')];this['countcongestionretry']=_0x2e12eb[_0x6bb2('0xb')];this[_0x6bb2('0xc')]=_0x2e12eb[_0x6bb2('0xc')];this[_0x6bb2('0xd')]=_0x2e12eb['countbusyretry']+_0x2e12eb[_0x6bb2('0xb')]+_0x2e12eb['countnoanswerretry'];this[_0x6bb2('0xe')]=_0x15b10d[_0x6bb2('0xe')];this[_0x6bb2('0xf')]=_0x2e12eb[_0x6bb2('0x10')];this[_0x6bb2('0x11')]=_0x2e12eb[_0x6bb2('0x12')];this[_0x6bb2('0x13')]=_0x2e12eb[_0x6bb2('0x13')];this[_0x6bb2('0x14')]=_0x2e12eb[_0x6bb2('0x14')];this[_0x6bb2('0x15')]=_0x2e12eb['answertime'];this[_0x6bb2('0x16')]=moment()[_0x6bb2('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x2e12eb['responsetime'],_0x2e12eb[_0x6bb2('0x13')]);this[_0x6bb2('0x18')]=getSeconds(_0x2e12eb[_0x6bb2('0x15')],_0x2e12eb[_0x6bb2('0x14')]);this[_0x6bb2('0x19')]=getSeconds(this[_0x6bb2('0x16')],_0x2e12eb['answertime']);this[_0x6bb2('0x1a')]=_0x15b10d['queue'];this['membername']=_0x15b10d[_0x6bb2('0x1b')];this['reason']=_0x15b10d[_0x6bb2('0x1c')];this['callback']=_0x2e12eb[_0x6bb2('0x1d')];this[_0x6bb2('0x1e')]=_0x2e12eb['callbackuniqueid'];this[_0x6bb2('0x1f')]=_0x2e12eb['callbackat'];this['recallme']=_0x2e12eb[_0x6bb2('0x20')];this[_0x6bb2('0x21')]=_0x2e12eb[_0x6bb2('0x21')];this[_0x6bb2('0x22')]=_0x2e12eb[_0x6bb2('0x22')];this[_0x6bb2('0x23')]=_0x2e12eb[_0x6bb2('0x23')];this[_0x6bb2('0x24')]=_0x2e12eb[_0x6bb2('0x24')];this[_0x6bb2('0x25')]=_0x2e12eb['CampaignId'];this[_0x6bb2('0x26')]=_0x2e12eb[_0x6bb2('0x26')]||'';this[_0x6bb2('0x27')]=_0x2e12eb['originatecalleridname']||'';}module[_0x6bb2('0x28')]=AgentComplete;
\ No newline at end of file
+var _0xee6e=['seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff'];(function(_0x334573,_0x5f535e){var _0x420969=function(_0x105f8b){while(--_0x105f8b){_0x334573['push'](_0x334573['shift']());}};_0x420969(++_0x5f535e);}(_0xee6e,0x1e7));var _0xeee6=function(_0x5d597b,_0x848b86){_0x5d597b=_0x5d597b-0x0;var _0x2f5a59=_0xee6e[_0x5d597b];return _0x2f5a59;};'use strict';var util=require(_0xeee6('0x0'));var _=require(_0xeee6('0x1'));var moment=require(_0xeee6('0x2'));function getSeconds(_0x2def3e,_0x5ed452){var _0x5cd5a9=moment(_0x2def3e)['milliseconds'](0x0);var _0x5f17f6=moment(_0x5ed452)[_0xeee6('0x3')](0x0);return _0x5cd5a9[_0xeee6('0x4')](_0x5f17f6,_0xeee6('0x5'));}function AgentComplete(_0x653725,_0x2b9f84){this[_0xeee6('0x6')]=0x4;this[_0xeee6('0x7')]=_0xeee6('0x8');this[_0xeee6('0x9')]=_0x653725[_0xeee6('0x9')];this[_0xeee6('0xa')]=_0x653725[_0xeee6('0xa')];this[_0xeee6('0xb')]=_0x653725[_0xeee6('0xa')]===_0xeee6('0xc')?_0xeee6('0xd'):_0x653725['type'];this[_0xeee6('0xe')]=_0x653725[_0xeee6('0xe')];this[_0xeee6('0xf')]=_0x653725[_0xeee6('0xf')];this[_0xeee6('0x10')]=_0x653725[_0xeee6('0x10')];this['countglobal']=_0x653725[_0xeee6('0xe')]+_0x653725[_0xeee6('0xf')]+_0x653725[_0xeee6('0x10')];this[_0xeee6('0x11')]=_0x2b9f84[_0xeee6('0x11')];this[_0xeee6('0x12')]=_0x653725['name'];this[_0xeee6('0x13')]=_0x653725[_0xeee6('0x14')];this[_0xeee6('0x15')]=_0x653725[_0xeee6('0x15')];this[_0xeee6('0x16')]=_0x653725[_0xeee6('0x16')];this[_0xeee6('0x17')]=_0x653725[_0xeee6('0x17')];this[_0xeee6('0x18')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xeee6('0x19')]=getSeconds(_0x653725[_0xeee6('0x16')],_0x653725[_0xeee6('0x15')]);this['holdtime']=getSeconds(_0x653725[_0xeee6('0x17')],_0x653725[_0xeee6('0x16')]);this[_0xeee6('0x1a')]=getSeconds(this['endtime'],_0x653725[_0xeee6('0x17')]);this['queue']=_0x2b9f84[_0xeee6('0xd')];this[_0xeee6('0x1b')]=_0x2b9f84[_0xeee6('0x1b')];this[_0xeee6('0x1c')]=_0x2b9f84[_0xeee6('0x1c')];this[_0xeee6('0x1d')]=_0x653725[_0xeee6('0x1d')];this[_0xeee6('0x1e')]=_0x653725[_0xeee6('0x1e')];this['callbackat']=_0x653725[_0xeee6('0x1f')];this[_0xeee6('0x20')]=_0x653725[_0xeee6('0x20')];this[_0xeee6('0x21')]=_0x653725[_0xeee6('0x21')];this[_0xeee6('0x22')]=_0x653725[_0xeee6('0x22')];this[_0xeee6('0x23')]=_0x653725['UserId'];this[_0xeee6('0x24')]=_0x653725[_0xeee6('0x24')];this[_0xeee6('0x25')]=_0x653725[_0xeee6('0x25')];this['originatecalleridnum']=_0x653725[_0xeee6('0x26')]||'';this[_0xeee6('0x27')]=_0x653725[_0xeee6('0x27')]||'';}module[_0xeee6('0x28')]=AgentComplete;
\ No newline at end of file
diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js
index c2be340..571de0c 100644
--- a/server/services/ami/dialer/final.js
+++ b/server/services/ami/dialer/final.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2eba=['queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','diff','seconds','uniqueid','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2eba,0xc7));var _0xa2eb=function(_0x57c45b,_0x2d6c69){_0x57c45b=_0x57c45b-0x0;var _0x3d127e=_0x2eba[_0x57c45b];return _0x3d127e;};'use strict';var util=require('util');var _=require(_0xa2eb('0x0'));var moment=require(_0xa2eb('0x1'));function getSeconds(_0x42f9dc,_0x2c5b95){var _0x55acba=moment(_0x42f9dc)['milliseconds'](0x0);var _0x45ff67=moment(_0x2c5b95)['milliseconds'](0x0);return _0x55acba[_0xa2eb('0x2')](_0x45ff67,_0xa2eb('0x3'));}function Final(_0x2d3a77){this[_0xa2eb('0x4')]=_0x2d3a77['uniqueid'];this['scheduledat']=_0x2d3a77['scheduledat'];this[_0xa2eb('0x5')]=_0x2d3a77['type'];this[_0xa2eb('0x6')]=_0x2d3a77[_0xa2eb('0x5')]===_0xa2eb('0x7')?'queue':_0x2d3a77['type'];this[_0xa2eb('0x8')]=_0x2d3a77[_0xa2eb('0x8')];this[_0xa2eb('0x9')]=_0x2d3a77['countcongestionretry'];this[_0xa2eb('0xa')]=_0x2d3a77[_0xa2eb('0xa')];this['countglobal']=_0x2d3a77[_0xa2eb('0x8')]+_0x2d3a77['countcongestionretry']+_0x2d3a77[_0xa2eb('0xa')];this[_0xa2eb('0xb')]=_0x2d3a77[_0xa2eb('0xb')];this[_0xa2eb('0xc')]=_0x2d3a77[_0xa2eb('0xc')];this[_0xa2eb('0xd')]=_0x2d3a77['calleridnum'];this[_0xa2eb('0xe')]=_0x2d3a77[_0xa2eb('0xe')];this[_0xa2eb('0xf')]=_0x2d3a77[_0xa2eb('0xf')];this[_0xa2eb('0x10')]=_0x2d3a77[_0xa2eb('0xf')];this[_0xa2eb('0x11')]=_0x2d3a77[_0xa2eb('0x11')]||0x0;this[_0xa2eb('0x12')]=_0x2d3a77[_0xa2eb('0x12')]||0x0;this[_0xa2eb('0x13')]=_0x2d3a77[_0xa2eb('0x13')]||0x0;this['callback']=_0x2d3a77['callback'];this[_0xa2eb('0x14')]=_0x2d3a77[_0xa2eb('0x14')];this[_0xa2eb('0x15')]=_0x2d3a77[_0xa2eb('0x15')];this[_0xa2eb('0x16')]=_0x2d3a77[_0xa2eb('0x16')];this[_0xa2eb('0x17')]=_0x2d3a77['ContactId'];this[_0xa2eb('0x18')]=_0x2d3a77[_0xa2eb('0x18')];this[_0xa2eb('0x19')]=_0x2d3a77[_0xa2eb('0x19')];this[_0xa2eb('0x1a')]=_0x2d3a77['VoiceQueueId'];this['CampaignId']=_0x2d3a77[_0xa2eb('0x1b')];this[_0xa2eb('0x1c')]=_0x2d3a77['originatecalleridnum']||'';this[_0xa2eb('0x1d')]=_0x2d3a77[_0xa2eb('0x1d')]||'';}module['exports']=Final;
\ No newline at end of file
+var _0x4489=['scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridname','exports','util','lodash','milliseconds','uniqueid'];(function(_0x76bdd0,_0x265eca){var _0x5d3189=function(_0x5dfb1e){while(--_0x5dfb1e){_0x76bdd0['push'](_0x76bdd0['shift']());}};_0x5d3189(++_0x265eca);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x9448('0x0'));var _=require(_0x9448('0x1'));var moment=require('moment');function getSeconds(_0x39e8d9,_0x12e7d8){var _0x2856c8=moment(_0x39e8d9)[_0x9448('0x2')](0x0);var _0x4f7c08=moment(_0x12e7d8)['milliseconds'](0x0);return _0x2856c8['diff'](_0x4f7c08,'seconds');}function Final(_0x541cbe){this[_0x9448('0x3')]=_0x541cbe['uniqueid'];this[_0x9448('0x4')]=_0x541cbe['scheduledat'];this[_0x9448('0x5')]=_0x541cbe[_0x9448('0x5')];this[_0x9448('0x6')]=_0x541cbe['type']==='outbound'?'queue':_0x541cbe[_0x9448('0x5')];this[_0x9448('0x7')]=_0x541cbe[_0x9448('0x7')];this[_0x9448('0x8')]=_0x541cbe[_0x9448('0x8')];this['countnoanswerretry']=_0x541cbe[_0x9448('0x9')];this[_0x9448('0xa')]=_0x541cbe[_0x9448('0x7')]+_0x541cbe[_0x9448('0x8')]+_0x541cbe[_0x9448('0x9')];this[_0x9448('0xb')]=_0x541cbe[_0x9448('0xb')];this[_0x9448('0xc')]=_0x541cbe['calleridname'];this[_0x9448('0xd')]=_0x541cbe['calleridnum'];this[_0x9448('0xe')]=_0x541cbe[_0x9448('0xe')];this['responsetime']=_0x541cbe[_0x9448('0xf')];this[_0x9448('0x10')]=_0x541cbe[_0x9448('0xf')];this[_0x9448('0x11')]=_0x541cbe[_0x9448('0x11')]||0x0;this[_0x9448('0x12')]=_0x541cbe[_0x9448('0x12')]||0x0;this[_0x9448('0x13')]=_0x541cbe['talktime']||0x0;this[_0x9448('0x14')]=_0x541cbe['callback'];this[_0x9448('0x15')]=_0x541cbe[_0x9448('0x15')];this[_0x9448('0x16')]=_0x541cbe[_0x9448('0x16')];this[_0x9448('0x17')]=_0x541cbe[_0x9448('0x17')];this[_0x9448('0x18')]=_0x541cbe[_0x9448('0x18')];this[_0x9448('0x19')]=_0x541cbe[_0x9448('0x19')];this['UserId']=_0x541cbe[_0x9448('0x1a')];this['VoiceQueueId']=_0x541cbe['VoiceQueueId'];this[_0x9448('0x1b')]=_0x541cbe['CampaignId'];this['originatecalleridnum']=_0x541cbe['originatecalleridnum']||'';this[_0x9448('0x1c')]=_0x541cbe['originatecalleridname']||'';}module[_0x9448('0x1d')]=Final;
\ No newline at end of file
diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js
index 39af764..57f5ba5 100644
--- a/server/services/ami/dialer/hangup.js
+++ b/server/services/ami/dialer/hangup.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x201fd9,_0x1671ee){var _0x42e7fe=function(_0x2608ee){while(--_0x2608ee){_0x201fd9['push'](_0x201fd9['shift']());}};_0x42e7fe(++_0x1671ee);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup;
\ No newline at end of file
+var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup;
\ No newline at end of file
diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js
index 91d9237..e9d1ab9 100644
--- a/server/services/ami/dialer/history.js
+++ b/server/services/ami/dialer/history.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x23d3=['countbusyretry','countnoanswerretry','countglobal','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x3bba35,_0x472df5){var _0x52512f=function(_0x41c188){while(--_0x41c188){_0x3bba35['push'](_0x3bba35['shift']());}};_0x52512f(++_0x472df5);}(_0x23d3,0x16a));var _0x323d=function(_0x2f2d58,_0x47377d){_0x2f2d58=_0x2f2d58-0x0;var _0x2f3f27=_0x23d3[_0x2f2d58];return _0x2f3f27;};'use strict';var util=require(_0x323d('0x0'));var _=require(_0x323d('0x1'));var moment=require('moment');function getSeconds(_0x2e1081,_0x11a792){var _0x8c47ad=moment(_0x2e1081)[_0x323d('0x2')](0x0);var _0xa794b1=moment(_0x11a792)[_0x323d('0x2')](0x0);return _0x8c47ad[_0x323d('0x3')](_0xa794b1,'seconds');}function History(_0x2d6e20){this[_0x323d('0x4')]=_0x2d6e20[_0x323d('0x4')];this[_0x323d('0x5')]=_0x2d6e20['scheduledat']||undefined;this[_0x323d('0x6')]=_0x2d6e20['type'];this[_0x323d('0x7')]=_0x2d6e20[_0x323d('0x6')]===_0x323d('0x8')?_0x323d('0x9'):_0x2d6e20[_0x323d('0x6')];this[_0x323d('0xa')]=_0x2d6e20[_0x323d('0xa')];this['countcongestionretry']=_0x2d6e20['countcongestionretry'];this[_0x323d('0xb')]=_0x2d6e20[_0x323d('0xb')];this[_0x323d('0xc')]=_0x2d6e20['countbusyretry']+_0x2d6e20['countcongestionretry']+_0x2d6e20['countnoanswerretry'];this[_0x323d('0x9')]=_0x2d6e20[_0x323d('0x9')];this[_0x323d('0xd')]=_0x2d6e20['name'];this[_0x323d('0xe')]=_0x2d6e20[_0x323d('0xf')];this[_0x323d('0x10')]=_0x2d6e20['starttime'];this[_0x323d('0x11')]=_0x2d6e20[_0x323d('0x11')];this[_0x323d('0x12')]=_0x2d6e20[_0x323d('0x11')];this[_0x323d('0x13')]=getSeconds(_0x2d6e20['responsetime'],_0x2d6e20[_0x323d('0x10')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x323d('0x14')]=_0x2d6e20[_0x323d('0x14')];this['callbackuniqueid']=_0x2d6e20['callbackuniqueid'];this[_0x323d('0x15')]=_0x2d6e20[_0x323d('0x15')];this[_0x323d('0x16')]=_0x2d6e20[_0x323d('0x16')];this[_0x323d('0x17')]=_0x2d6e20[_0x323d('0x17')];this[_0x323d('0x18')]=_0x2d6e20[_0x323d('0x18')];this['UserId']=_0x2d6e20[_0x323d('0x19')];this[_0x323d('0x1a')]=_0x2d6e20[_0x323d('0x1a')];this[_0x323d('0x1b')]=_0x2d6e20[_0x323d('0x1b')];this['originatecalleridnum']=_0x2d6e20[_0x323d('0x1c')]||'';this['originatecalleridname']=_0x2d6e20[_0x323d('0x1d')]||'';}module[_0x323d('0x1e')]=History;
\ No newline at end of file
+var _0x4c58=['ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','name','calleridnum','number','starttime','responsetime','endtime'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x4c58,0x1db));var _0x84c5=function(_0x1dc146,_0x455f29){_0x1dc146=_0x1dc146-0x0;var _0xe7dee1=_0x4c58[_0x1dc146];return _0xe7dee1;};'use strict';var util=require(_0x84c5('0x0'));var _=require(_0x84c5('0x1'));var moment=require('moment');function getSeconds(_0x5e1a8e,_0x148c8e){var _0x55272c=moment(_0x5e1a8e)[_0x84c5('0x2')](0x0);var _0x1551d7=moment(_0x148c8e)[_0x84c5('0x2')](0x0);return _0x55272c['diff'](_0x1551d7,_0x84c5('0x3'));}function History(_0x257f23){this[_0x84c5('0x4')]=_0x257f23[_0x84c5('0x4')];this[_0x84c5('0x5')]=_0x257f23[_0x84c5('0x5')]||undefined;this[_0x84c5('0x6')]=_0x257f23[_0x84c5('0x6')];this[_0x84c5('0x7')]=_0x257f23[_0x84c5('0x6')]==='outbound'?_0x84c5('0x8'):_0x257f23[_0x84c5('0x6')];this[_0x84c5('0x9')]=_0x257f23['countbusyretry'];this['countcongestionretry']=_0x257f23[_0x84c5('0xa')];this['countnoanswerretry']=_0x257f23[_0x84c5('0xb')];this[_0x84c5('0xc')]=_0x257f23[_0x84c5('0x9')]+_0x257f23['countcongestionretry']+_0x257f23['countnoanswerretry'];this[_0x84c5('0x8')]=_0x257f23['queue'];this[_0x84c5('0xd')]=_0x257f23[_0x84c5('0xe')];this[_0x84c5('0xf')]=_0x257f23[_0x84c5('0x10')];this['starttime']=_0x257f23[_0x84c5('0x11')];this[_0x84c5('0x12')]=_0x257f23[_0x84c5('0x12')];this[_0x84c5('0x13')]=_0x257f23[_0x84c5('0x12')];this[_0x84c5('0x14')]=getSeconds(_0x257f23[_0x84c5('0x12')],_0x257f23[_0x84c5('0x11')]);this[_0x84c5('0x15')]=0x0;this[_0x84c5('0x16')]=0x0;this[_0x84c5('0x17')]=_0x257f23[_0x84c5('0x17')];this[_0x84c5('0x18')]=_0x257f23[_0x84c5('0x18')];this[_0x84c5('0x19')]=_0x257f23[_0x84c5('0x19')];this[_0x84c5('0x1a')]=_0x257f23['recallme'];this[_0x84c5('0x1b')]=_0x257f23[_0x84c5('0x1b')];this[_0x84c5('0x1c')]=_0x257f23[_0x84c5('0x1c')];this[_0x84c5('0x1d')]=_0x257f23['UserId'];this['VoiceQueueId']=_0x257f23['VoiceQueueId'];this[_0x84c5('0x1e')]=_0x257f23['CampaignId'];this[_0x84c5('0x1f')]=_0x257f23[_0x84c5('0x1f')]||'';this[_0x84c5('0x20')]=_0x257f23[_0x84c5('0x20')]||'';}module['exports']=History;
\ No newline at end of file
diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js
index f2fe292..47d4f96 100644
--- a/server/services/ami/dialer/index.js
+++ b/server/services/ami/dialer/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf8de=['syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','Abandoned','CALLEREXIT','actionid','locked','stateinterface','queueBooked','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','ContactId','[booked][unlock3]','loopCampaigns','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','length','content','indexOf','true','command','iftime\x20%s,%s','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Timezone:\x20','handlePower','power','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkDialMethod','pow','replace','random','match','actionOriginate','originate','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','object','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','stateGlobal','reason\x205\x20busy','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','predictiveIntervalAvailable','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','loggedIn','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','inBlackList','limitCalls','temp','maxNumberOriginate','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','channels','actions','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','milliseconds','diff','emit','type','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','startPredictive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','ivr','string','\x22%s\x22\x20<%s>','error','inspect','stack','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','statedesc','endtime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','saveInDb','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','variable','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','state','HangupInAMD','AMD','[syncHangupInAMD][createHistory]','MACHINE','Machine','membername','amd','[syncMachine][createHistory]','uniqueid','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow'];(function(_0x187ae6,_0x4572d0){var _0x6be7c8=function(_0x3ac662){while(--_0x3ac662){_0x187ae6['push'](_0x187ae6['shift']());}};_0x6be7c8(++_0x4572d0);}(_0xf8de,0xf6));var _0xef8d=function(_0x19ade7,_0x4398e8){_0x19ade7=_0x19ade7-0x0;var _0x5547f3=_0xf8de[_0x19ade7];return _0x5547f3;};'use strict';var util=require('util');var _=require(_0xef8d('0x0'));var BPromise=require(_0xef8d('0x1'));var uuid=require(_0xef8d('0x2'));var moment=require(_0xef8d('0x3'));var rr=require('rr');var md5=require(_0xef8d('0x4'));var Redis=require(_0xef8d('0x5'));var config=require(_0xef8d('0x6'));var logger=require(_0xef8d('0x7'))(_0xef8d('0x8'));var loggerBooked=require('../../../config/logger')(_0xef8d('0x9'));var loggerPredictive=require(_0xef8d('0x7'))(_0xef8d('0xa'));var loggerPredictiveCalls=require(_0xef8d('0x7'))(_0xef8d('0xb'));var loggerSyncQueueSummary=require(_0xef8d('0x7'))(_0xef8d('0xc'));var ami=require('../ami');config[_0xef8d('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xef8d('0xd')]));var cmHopper=require(_0xef8d('0xe'));var cmHopperFinal=require(_0xef8d('0xf'));var cmHopperHistory=require(_0xef8d('0x10'));var cmHopperBlack=require(_0xef8d('0x11'));var voiceQueueRt=require(_0xef8d('0x12'));var Action=require(_0xef8d('0x13'));var History=require(_0xef8d('0x14'));var Final=require(_0xef8d('0x15'));var AgentComplete=require(_0xef8d('0x16'));var QueueCallerAbandon=require(_0xef8d('0x17'));var Hangup=require(_0xef8d('0x18'));var ipAgi=process[_0xef8d('0x19')][_0xef8d('0x1a')]||_0xef8d('0x1b');var strategy={'rrmemory':_0xef8d('0x1c'),'roundrobin':_0xef8d('0x1d')};var Sequence=function(){};Sequence[_0xef8d('0x1e')][_0xef8d('0x1f')]=function(_0x5b5c9e){this[_0xef8d('0x20')]=this[_0xef8d('0x20')]?this[_0xef8d('0x20')][_0xef8d('0x21')](_0x5b5c9e):_0x5b5c9e();};function Dialer(_0x431eed,_0x12295a){this[_0xef8d('0x22')]=new Sequence();this[_0xef8d('0x23')]=_0x12295a;this[_0xef8d('0x24')]=_0x431eed[_0xef8d('0x24')];this[_0xef8d('0x25')]=_0x431eed[_0xef8d('0x25')];this[_0xef8d('0x26')]=_0x431eed[_0xef8d('0x26')];this[_0xef8d('0x27')]=_0x431eed[_0xef8d('0x27')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0xef8d('0x28')]={};this[_0xef8d('0x29')]={};this['contactsId']={};this[_0xef8d('0x2a')]={};this[_0xef8d('0x2b')]={};this['startPredictive']={};this[_0xef8d('0x2c')]={};this[_0xef8d('0x2d')]={};this['queueBooked']={};this[_0xef8d('0x2e')]={};ami['on'](_0xef8d('0x2f'),this[_0xef8d('0x30')][_0xef8d('0x31')](this));ami['on'](_0xef8d('0x32'),this[_0xef8d('0x33')][_0xef8d('0x31')](this));ami['on'](_0xef8d('0x34'),this[_0xef8d('0x35')][_0xef8d('0x31')](this));ami['on'](_0xef8d('0x36'),this['syncAgentComplete'][_0xef8d('0x31')](this));ami['on'](_0xef8d('0x37'),this[_0xef8d('0xc')][_0xef8d('0x31')](this));ami['on'](_0xef8d('0x38'),this[_0xef8d('0x39')]['bind'](this));ami['on'](_0xef8d('0x3a'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0xef8d('0x3b')]['bind'](this));ami['on'](_0xef8d('0x3c'),this[_0xef8d('0x3d')]['bind'](this));ami['on'](_0xef8d('0x3e'),this[_0xef8d('0x3f')][_0xef8d('0x31')](this));this['loopCampaigns']();this[_0xef8d('0x40')]();}function isNotNull(_0x194b8e){return _0x194b8e!==null&&!_[_0xef8d('0x41')](_0x194b8e);}function checkIsLoggedIn(_0x40cc61,_0xe2810e){return function(){if(_0xe2810e<=0x0){_0x40cc61[_0xef8d('0x42')]=_0xef8d('0x43');throw _0x40cc61[_0xef8d('0x44')]+_0xef8d('0x45');}};}function isActive(_0x2f5eec){return _0x2f5eec;}function checkIsActive(_0x8b9f75,_0x1db3a5){return function(){if(!isActive(_0x1db3a5)){_0x8b9f75['message']=_0xef8d('0x46');throw _0x8b9f75[_0xef8d('0x44')]+'\x20NOT\x20Active';}};}function checkInterval(_0x1c0643){return function(){if(!isNotNull(_0x1c0643[_0xef8d('0x47')])){_0x1c0643[_0xef8d('0x42')]=_0xef8d('0x48');throw _0x1c0643[_0xef8d('0x44')]+_0xef8d('0x49');}if(!isNotNull(_0x1c0643[_0xef8d('0x47')][_0xef8d('0x4a')])){_0x1c0643[_0xef8d('0x42')]=_0xef8d('0x48');throw _0x1c0643['name']+_0xef8d('0x49');}if(!isNotNull(_[_0xef8d('0x4b')](_0x1c0643[_0xef8d('0x47')][_0xef8d('0x4a')]))){_0x1c0643[_0xef8d('0x42')]=_0xef8d('0x48');throw _0x1c0643['name']+_0xef8d('0x49');}};}function msgResponse(_0x38381e,_0x2b412d,_0x1200e8){return{'action':_0x38381e,'response':_0x2b412d,'message':_0x1200e8,'stack':_0x1200e8};}function myreject(_0x576e1c){return function(_0x436a65){return _0x576e1c(msgResponse(_0xef8d('0x4c'),_0xef8d('0x4d'),JSON['stringify'](_0x436a65)));};}function getSeconds(_0x345f31,_0x567d98){var _0x586896=moment(_0x345f31)[_0xef8d('0x4e')](0x0);var _0x17ccc0=moment(_0x567d98)[_0xef8d('0x4e')](0x0);return _0x586896[_0xef8d('0x4f')](_0x17ccc0,'seconds');}function emit(_0xc6dcd4,_0x361129,_0x596064){io['to'](_0xc6dcd4)[_0xef8d('0x50')](_0x361129,_0x596064);}function emitVoiceQueueSummary(_0x1e7b54){if(_0x1e7b54[_0xef8d('0x51')]==='outbound'){var _0x1f2e30={'id':_0x1e7b54['id'],'name':_0x1e7b54['name'],'strategy':_0x1e7b54[_0xef8d('0x52')],'answered':_0x1e7b54[_0xef8d('0x53')],'available':_0x1e7b54[_0xef8d('0x54')],'loggedIn':_0x1e7b54['loggedIn'],'pTalking':_0x1e7b54[_0xef8d('0x55')],'sumBillable':_0x1e7b54[_0xef8d('0x56')],'sumDuration':_0x1e7b54[_0xef8d('0x57')],'sumHoldTime':_0x1e7b54[_0xef8d('0x58')]||0x0,'talking':_0x1e7b54['talking'],'total':_0x1e7b54[_0xef8d('0x59')],'type':_0x1e7b54[_0xef8d('0x51')],'unmanaged':_0x1e7b54['unmanaged'],'abandoned':_0x1e7b54[_0xef8d('0x5a')],'waiting':_0x1e7b54[_0xef8d('0x5b')],'loggedInDb':_0x1e7b54[_0xef8d('0x5c')],'dialActive':_0x1e7b54[_0xef8d('0x5d')],'dialMethod':_0x1e7b54[_0xef8d('0x5e')],'dialOriginateCallerIdName':_0x1e7b54[_0xef8d('0x5f')],'dialOriginateCallerIdNumber':_0x1e7b54[_0xef8d('0x60')],'dialOriginateTimeout':_0x1e7b54[_0xef8d('0x61')],'dialPrefix':_0x1e7b54['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1e7b54['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1e7b54[_0xef8d('0x62')],'outboundBlacklistCallsDay':_0x1e7b54[_0xef8d('0x63')],'outboundBusyCallsDay':_0x1e7b54[_0xef8d('0x64')],'outboundCongestionCallsDay':_0x1e7b54[_0xef8d('0x65')],'outboundDropCallsDayACS':_0x1e7b54['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1e7b54[_0xef8d('0x66')],'outboundDropCallsDayTimeout':_0x1e7b54[_0xef8d('0x67')],'outboundNoAnswerCallsDay':_0x1e7b54[_0xef8d('0x68')],'outboundNoSuchCallsDay':_0x1e7b54[_0xef8d('0x69')],'outboundOriginateFailureCallsDay':_0x1e7b54[_0xef8d('0x6a')],'outboundReCallsDay':_0x1e7b54[_0xef8d('0x6b')],'outboundRejectCallsDay':_0x1e7b54[_0xef8d('0x6c')],'outboundUnknownCallsDay':_0x1e7b54[_0xef8d('0x6d')],'predictiveIntervalAnsweredCalls':_0x1e7b54[_0xef8d('0x6e')],'predictiveIntervalAvgHoldtime':_0x1e7b54[_0xef8d('0x6f')],'predictiveIntervalAvgTalktime':_0x1e7b54[_0xef8d('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x1e7b54[_0xef8d('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x1e7b54[_0xef8d('0x72')],'predictiveIntervalErlangCalls':_0x1e7b54[_0xef8d('0x73')],'predictiveIntervalErlangCallsDroppedCalls':_0x1e7b54[_0xef8d('0x74')],'predictiveIntervalHitRate':_0x1e7b54[_0xef8d('0x75')],'predictiveIntervalMultiplicativeFactor':_0x1e7b54[_0xef8d('0x76')],'predictiveIntervalPauses':_0x1e7b54[_0xef8d('0x77')],'predictiveIntervalAvailable':_0x1e7b54['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1e7b54[_0xef8d('0x78')],'message':_0x1e7b54[_0xef8d('0x42')],'originated':_0x1e7b54[_0xef8d('0x79')],'erlangCalls':_0x1e7b54[_0xef8d('0x7a')],'erlangCallToSecond':_0x1e7b54[_0xef8d('0x7b')],'erlangAbandonmentRate':_0x1e7b54[_0xef8d('0x7c')],'erlangBusyFactor':_0x1e7b54[_0xef8d('0x7d')],'startPredictive':_0x1e7b54['startPredictive'],'startProgressive':_0x1e7b54['startProgressive']};if(_0x1e7b54[_0xef8d('0x7e')]){_0x1f2e30[_0xef8d('0x7e')]={'id':_0x1e7b54[_0xef8d('0x7e')]['id'],'name':_0x1e7b54[_0xef8d('0x7e')][_0xef8d('0x44')],'active':_0x1e7b54[_0xef8d('0x7e')][_0xef8d('0x7f')],'callerid':_0x1e7b54['Trunk'][_0xef8d('0x80')]};}if(_0x1e7b54['Interval']){_0x1f2e30[_0xef8d('0x47')]={'id':_0x1e7b54['Interval']['id'],'name':_0x1e7b54[_0xef8d('0x47')][_0xef8d('0x44')]};}var _0x3e9863=md5(JSON[_0xef8d('0x81')](_0x1f2e30));if(_0x1e7b54[_0xef8d('0x4')]!==_0x3e9863){_0x1e7b54[_0xef8d('0x4')]=_0x3e9863;emit(util[_0xef8d('0x82')](_0xef8d('0x83'),_0x1f2e30[_0xef8d('0x44')]),_0xef8d('0x84'),_0x1f2e30);}}}function emitCampaignSummary(_0x3bb112){if(_0x3bb112[_0xef8d('0x51')]==='ivr'){emit(util['format'](_0xef8d('0x85'),_0x3bb112[_0xef8d('0x44')]),_0xef8d('0x86'),_0x3bb112);}}function checkGetDataPredictive(_0x2d1070){if(isNotNull(_0x2d1070)){if(!_['isEmpty'](_0x2d1070)){loggerPredictive[_0xef8d('0x87')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xef8d('0x87')](_0xef8d('0x88'),_0x2d1070[_0xef8d('0x78')]);loggerPredictive[_0xef8d('0x87')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d1070[_0xef8d('0x6e')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d1070['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x89'),_0x2d1070[_0xef8d('0x71')]);loggerPredictive[_0xef8d('0x87')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d1070[_0xef8d('0x6f')]);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8a'),_0x2d1070['predictiveIntervalAvgTalktime']);loggerPredictive[_0xef8d('0x87')]('---------------------------');if(_0x2d1070['predictiveIntervalTotalCalls']>0x0){if(!_[_0xef8d('0x41')](_0x2d1070[_0xef8d('0x70')])&&_0x2d1070[_0xef8d('0x70')]>0x0){return!![];}else{loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8b'));}if(!_['isUndefined'](_0x2d1070['predictiveIntervalAvgHoldtime'])&&_0x2d1070[_0xef8d('0x6f')]>0x0){return!![];}else{loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8c'));}}else{loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8d'));}}else{loggerPredictive['info'](_0xef8d('0x8e'));}}else{loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8e'));}return![];}function mergeDataErlangB(_0x91e32e){return function(_0x3a6cf1){loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8f'));loggerPredictive['info'](_0xef8d('0x90'),_0x3a6cf1[_0xef8d('0x7a')]);loggerPredictive[_0xef8d('0x87')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a6cf1['erlangCallToSecond']);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x91'),_0x3a6cf1[_0xef8d('0x7c')]);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x92'),_0x3a6cf1[_0xef8d('0x7d')]);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x91'),_0x3a6cf1[_0xef8d('0x7c')]);loggerPredictive[_0xef8d('0x87')]('---------------------------');_[_0xef8d('0x93')](_0x91e32e,_0x3a6cf1);};}function getDiff(_0x1ac1d3){var _0x153a29=moment()['milliseconds'](0x0);var _0x3aebcf=moment(_0x1ac1d3)[_0xef8d('0x4e')](0x0);return _0x153a29[_0xef8d('0x4f')](_0x3aebcf,_0xef8d('0x94'));}function ifInterval(_0x295565,_0x2a8b0e){if(_[_0xef8d('0x41')](_0x2a8b0e)){return![];}if(getDiff(_0x2a8b0e)<_0x295565*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x58d30f){if(isNotNull(_0x58d30f)){if(!_[_0xef8d('0x41')](_0x58d30f[_0xef8d('0x2c')])){_0x58d30f[_0xef8d('0x2c')]=undefined;loggerPredictive[_0xef8d('0x87')](_0x58d30f[_0xef8d('0x44')],_0xef8d('0x95'));}if(!_[_0xef8d('0x41')](_0x58d30f[_0xef8d('0x96')])){_0x58d30f[_0xef8d('0x96')]=undefined;loggerPredictive[_0xef8d('0x87')](_0x58d30f[_0xef8d('0x44')],_0xef8d('0x97'));}if(!_[_0xef8d('0x41')](_0x58d30f['handlePredictive'])){clearInterval(_0x58d30f[_0xef8d('0x98')]);_0x58d30f[_0xef8d('0x98')]=undefined;loggerPredictive[_0xef8d('0x87')](_0x58d30f[_0xef8d('0x44')],_0xef8d('0x99'));}}}function erlangb(_0x382ea9,_0x336ec9){if(_0x336ec9===0x0){return 0x0;}var _0x5711c2=0x1;for(var _0x270026=0x1;_0x270026<=_0x336ec9;_0x270026+=0x1){_0x5711c2=0x1+_0x5711c2*_0x270026/_0x382ea9;}return 0x1/_0x5711c2;}function isVoiceQueueOutbound(_0x38c9d8){return _0x38c9d8===_0xef8d('0x9a');}function isNotPreview(_0x4f52ca){return _0x4f52ca!==_0xef8d('0x23');}function isCampaignIvr(_0x9fafa1){return _0x9fafa1===_0xef8d('0x9b');}function getCallerId(_0x22e6b3,_0x36d26c,_0x478c43){if(!_[_0xef8d('0x41')](_0x478c43)&&_0xef8d('0x9c')===typeof _0x478c43&&!_[_0xef8d('0x4b')](_0x478c43)){if(!_[_0xef8d('0x41')](_0x36d26c)&&_0xef8d('0x9c')===typeof _0x36d26c&&!_[_0xef8d('0x4b')](_0x36d26c)){return util[_0xef8d('0x82')](_0xef8d('0x9d'),_0x36d26c,_0x478c43);}return util['format']('\x22%s\x22\x20<%s>',_0x478c43,_0x478c43);}if(!_[_0xef8d('0x41')](_0x22e6b3)&&'string'===typeof _0x22e6b3&&!_[_0xef8d('0x4b')](_0x22e6b3)){return _0x22e6b3;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x437d9c,_0x19a72f){return function(_0x373a92){freeVariablesPredictive(_0x19a72f);emitVoiceQueueSummary(_0x19a72f);emitCampaignSummary(_0x19a72f);loggerSyncQueueSummary[_0xef8d('0x9e')](_0x437d9c,util[_0xef8d('0x9f')](_0x373a92,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2f45e7,_0x1ab1a4){return function(_0x156c41){loggerPredictive['error'](_0x1ab1a4[_0xef8d('0x44')],_0x2f45e7);loggerPredictive[_0xef8d('0x9e')](_0x156c41[_0xef8d('0xa0')]);freeVariablesPredictive(_0x1ab1a4);};}function loggerCatch(_0x461d12){return function(_0x37dd85){logger[_0xef8d('0x9e')](_0x461d12,util[_0xef8d('0x9f')](_0x37dd85,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x13ebcc){return _0x13ebcc&&!_[_0xef8d('0x41')](_0x13ebcc)&&_0x13ebcc['length']>0x0;}function decremetOriginate(_0x8bb1de){if(!_['isUndefined'](_0x8bb1de)&&_0x8bb1de!==null){if(_0x8bb1de['hasOwnProperty']('originated')){if(_0x8bb1de[_0xef8d('0x79')]>0x0){_0x8bb1de[_0xef8d('0x79')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x5ebb14,_0x1fd01d,_0x2974f6){if(_0x1fd01d>_0x2974f6){for(var _0x4de9b0=0x0;_0x4de9b0<_0x1fd01d-_0x2974f6;_0x4de9b0+=0x1){decremetOriginate(_0x5ebb14);}}}function loggerGetContactDialer(_0x24dd54,_0x50c3c8,_0x5729b6){return function(_0x5c594e){checkContactLowerLimitOriginate(_0x50c3c8,_0x5729b6,0x0);logger['error'](_0x24dd54,util[_0xef8d('0x9f')](_0x5c594e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2daca7){return function(_0x5d6d71){if(isNotNull(_0x5d6d71)&&isNotNull(_0x5d6d71[0x0])){if(_0x5d6d71[0x0][_0xef8d('0xa1')]>0x0){_0x2daca7[_0xef8d('0x42')]=_0xef8d('0xa2');logger['info']('[getContactDialer2][ReScheduled]'+_0x2daca7[_0xef8d('0x44')],_0x5d6d71[0x0]['contactsRescheduled'],_0xef8d('0xa3'));}else{_0x2daca7[_0xef8d('0x42')]=_0xef8d('0xa4');logger[_0xef8d('0x87')]('[getContactDialer2][Empty]'+_0x2daca7['name']);}}};}function notSendMessagesQueue(_0x32c643){if(_0x32c643[_0xef8d('0xa5')]){freeVariablesPredictive(_0x32c643);if(_0x32c643['originated']===0x0&&_0x32c643[_0xef8d('0xa6')]===0x0&&_0x32c643[_0xef8d('0x5b')]===0x0&&(_0x32c643[_0xef8d('0x55')]||0x0)===0x0){_0x32c643['sendMessageOneNotActive']=![];_0x32c643['available']=0x0;_0x32c643[_0xef8d('0x42')]=_0xef8d('0x46');loggerSyncQueueSummary[_0xef8d('0x9e')](_0xef8d('0xa7'),_0x32c643[_0xef8d('0x44')],'is\x20not\x20active');}else{_0x32c643['message']=_0xef8d('0xa8');loggerSyncQueueSummary[_0xef8d('0x9e')](_0xef8d('0xa7'),_0x32c643[_0xef8d('0x44')],_0xef8d('0xa9'));}emitVoiceQueueSummary(_0x32c643);}}function notSendMessagesCampaign(_0x2a74e1){if(_0x2a74e1[_0xef8d('0xa5')]){if(_0x2a74e1[_0xef8d('0x79')]===0x0){_0x2a74e1[_0xef8d('0xa5')]=![];_0x2a74e1[_0xef8d('0x42')]=_0xef8d('0x46');loggerSyncQueueSummary[_0xef8d('0x9e')](_0xef8d('0xaa'),_0x2a74e1['name'],_0xef8d('0xab'));}else{_0x2a74e1['message']='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xef8d('0xaa'),_0x2a74e1[_0xef8d('0x44')],'is\x20disactive');}emitCampaignSummary(_0x2a74e1);}}function createObjHistory(_0x1f7ad3,_0x498967,_0x179059,_0x314622,_0x276393){_0x1f7ad3[_0xef8d('0x42')]=_0x179059;var _0x503c50=new Action(_0x1f7ad3,_0x498967);var _0x4934a1=new History(_0x503c50);_0x4934a1['state']=_0x314622;_0x4934a1[_0xef8d('0xac')]=_0x276393;_0x4934a1[_0xef8d('0xad')]=_0x503c50['starttime'];return _0x4934a1;}Dialer[_0xef8d('0x1e')][_0xef8d('0x40')]=function(){var _0x3c9b11=this;setInterval(function(){_0x3c9b11[_0xef8d('0xae')](_0x3c9b11[_0xef8d('0x2a')],_0xef8d('0xaf'));_0x3c9b11[_0xef8d('0xae')](_0x3c9b11[_0xef8d('0x29')],_0xef8d('0xb0'));},0x32c8);};Dialer[_0xef8d('0x1e')][_0xef8d('0xae')]=function(_0x2df125,_0x50e802){var _0x5f0dfb=this;for(var _0x1e1e3a in _0x2df125){if(_0x2df125['hasOwnProperty'](_0x1e1e3a)){this['sequence'][_0xef8d('0x1f')](function(){if(!_[_0xef8d('0xb1')](_0x2df125[_0x1e1e3a])){return ami[_0xef8d('0xb2')]({'action':_0xef8d('0xb3'),'channel':_0x2df125[_0x1e1e3a][_0xef8d('0xb4')]})[_0xef8d('0xb5')](function(_0x55af62){if(_0x55af62[_0xef8d('0x42')]===_0xef8d('0xb6')){setTimeout(function(){if(_0x2df125[_0x1e1e3a]&&_0x2df125[_0x1e1e3a]['type']!==_0xef8d('0x9b')){_0x5f0dfb[_0xef8d('0xb7')](_0x5f0dfb['voiceQueues'][_0x2df125[_0x1e1e3a][_0xef8d('0xb8')]]);logger['error'](_0xef8d('0xb9'),_0x50e802,_0x1e1e3a,_0x2df125[_0x1e1e3a][_0xef8d('0xb8')]);delete _0x2df125[_0x1e1e3a];}if(_0x2df125[_0x1e1e3a]&&_0x2df125[_0x1e1e3a]['type']==='ivr'){_0x5f0dfb[_0xef8d('0xb7')](_0x5f0dfb[_0xef8d('0x25')][_0x2df125[_0x1e1e3a]['queue']]);logger[_0xef8d('0x9e')](_0xef8d('0xba'),_0x50e802,_0x1e1e3a,_0x2df125[_0x1e1e3a]['queue']);delete _0x2df125[_0x1e1e3a];}},0x2328);}});}});}}};Dialer[_0xef8d('0x1e')]['countReScheduled']=function(_0x1fd0b1){return BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](cmHopper[_0xef8d('0xbd')](_0x1fd0b1))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xbe')));};Dialer[_0xef8d('0x1e')]['checkIsBlackList']=function(_0x30d5fc){return BPromise['resolve']()[_0xef8d('0xbc')](cmHopperBlack['checkIsBlackList'](_0x30d5fc))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xbf')));};Dialer['prototype'][_0xef8d('0xc0')]=function(_0x3e71b4){return BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](cmHopperBlack[_0xef8d('0xc0')](_0x3e71b4))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xc1')));};Dialer['prototype']['averageHandleTime']=function(_0x3c44ae){return BPromise['resolve']()['then'](cmHopperHistory[_0xef8d('0xc2')](_0x3c44ae))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xc3')));};Dialer[_0xef8d('0x1e')][_0xef8d('0xc4')]=function(_0x33702e){return BPromise[_0xef8d('0xbb')]()['then'](cmHopper[_0xef8d('0xc4')](_0x33702e))[_0xef8d('0xb5')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xef8d('0x1e')]['getContactDialer']=function(_0x784cda,_0x230dba,_0x319853,_0x495628){return BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](cmHopper[_0xef8d('0xc5')](_0x784cda,_0x230dba,_0x319853,_0x495628))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xc6')));};Dialer['prototype'][_0xef8d('0xc7')]=function(_0x3d555c,_0x34cb14,_0x2e99a9){return BPromise[_0xef8d('0xbb')]()['then'](cmHopper[_0xef8d('0xc7')](_0x3d555c,_0x34cb14,_0x2e99a9))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xc6')));};Dialer['prototype'][_0xef8d('0xc8')]=function(_0x1e84e7){return BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](voiceQueueRt[_0xef8d('0xc8')](_0x1e84e7))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['moveContactManagedDialer']=function(_0x12e0b8){return BPromise[_0xef8d('0xbb')]()['then'](cmHopper[_0xef8d('0xc9')](_0x12e0b8))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xca')));};Dialer['prototype'][_0xef8d('0xcb')]=function(_0x28c2c2){return BPromise[_0xef8d('0xbb')]()['then'](cmHopperHistory[_0xef8d('0xcb')](_0x28c2c2))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xcc')));};Dialer[_0xef8d('0x1e')][_0xef8d('0xb7')]=function(_0x3e7439){if(!_[_0xef8d('0x41')](_0x3e7439)&&_0x3e7439!==null){if(_0x3e7439['hasOwnProperty'](_0xef8d('0x79'))){if(_0x3e7439[_0xef8d('0x79')]>0x0){_0x3e7439[_0xef8d('0x79')]-=0x1;}else{logger[_0xef8d('0x9e')](_0xef8d('0xcd'));}}}else{logger[_0xef8d('0x9e')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xef8d('0x1e')][_0xef8d('0xce')]=function(_0x146d1e,_0x266c8d){var _0x18ff15=this;return function(_0x311f36){_0x18ff15[_0xef8d('0xb7')](_0x266c8d);logger[_0xef8d('0x9e')](_0x146d1e,util[_0xef8d('0x9f')](_0x311f36,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x198f69,_0x310d6e,_0x2b5276){var _0x5e4ef2={'state':0x19,'statedesc':'notFound'};this[_0xef8d('0xb7')](_0x310d6e);this[_0xef8d('0xcf')](_[_0xef8d('0x93')](_0x5e4ef2,_[_0xef8d('0xd0')](_0x2b5276,['ContactId',_0xef8d('0xd1'),_0xef8d('0xd2'),_0xef8d('0xd3'),_0xef8d('0xd4')])),'[emptyContact][createHistory]',_0xef8d('0xd5'));logger['error'](_0x198f69);};Dialer[_0xef8d('0x1e')][_0xef8d('0xd6')]=function(_0x1a37d6){return _0x1a37d6===_0xef8d('0xd7');};Dialer[_0xef8d('0x1e')][_0xef8d('0xd8')]=function(_0x5fd43c){return!_[_0xef8d('0x41')](_0x5fd43c)&&_0x5fd43c&&!_['isUndefined'](_0x5fd43c[_0xef8d('0x44')])&&!_['isUndefined'](_0x5fd43c[_0xef8d('0x7f')])&&_0x5fd43c[_0xef8d('0x7f')]&&(this['trunks'][util[_0xef8d('0x82')](_0xef8d('0xd9'),_0x5fd43c[_0xef8d('0x44')])][_0xef8d('0xb3')]===_0xef8d('0xda')||this['trunks'][util[_0xef8d('0x82')](_0xef8d('0xd9'),_0x5fd43c[_0xef8d('0x44')])][_0xef8d('0xb3')]===_0xef8d('0xdb'));};Dialer[_0xef8d('0x1e')]['saveInDb']=function(_0x239494,_0x5b90c4,_0x33ff7a){this[_0xef8d('0xcb')](_0x239494)[_0xef8d('0xb5')](loggerCatch(_0x5b90c4));this[_0xef8d('0xc9')](_0x239494)['catch'](loggerCatch(_0x33ff7a));};Dialer[_0xef8d('0x1e')]['syncVarSet']=function(_0x307231){var _0x306eda=this[_0xef8d('0x2a')][_0x307231['uniqueid']];var _0x3cc264;if(!_['isNil'](_0x307231)&&!_[_0xef8d('0xb1')](_0x307231[_0xef8d('0xdc')])&&!_[_0xef8d('0xb1')](_0x307231[_0xef8d('0xdc')]['amdstatus'])&&_0x307231[_0xef8d('0xdd')]==='xcally-motion-dialer'&&_0x306eda){if(_0x306eda[_0xef8d('0x51')]!==_0xef8d('0x9b')&&this[_0xef8d('0x24')][_0x306eda['queue']][_0xef8d('0xde')]&&_0x307231[_0xef8d('0xdf')]===_0xef8d('0xe0')){delete this[_0xef8d('0x2a')][_0x307231['uniqueid']];this['updateOriginated'](this[_0xef8d('0x24')][_0x306eda[_0xef8d('0xb8')]]);this['voiceQueues'][_0x306eda[_0xef8d('0xb8')]][_0xef8d('0x62')]+=0x1;this['voiceQueues'][_0x306eda[_0xef8d('0xb8')]][_0xef8d('0xe1')]+=0x1;_0x3cc264=new Hangup(_0x306eda,_0x307231);_0x3cc264[_0xef8d('0xe2')]=0x12;_0x3cc264['statedesc']=_0xef8d('0xe3');_0x3cc264['membername']=_0xef8d('0xe4');this[_0xef8d('0xcf')](_0x3cc264,_0xef8d('0xe5'),'[syncHangupInAMD]');}if(_0x306eda[_0xef8d('0x51')]!=='ivr'&&this['voiceQueues'][_0x306eda['queue']][_0xef8d('0xde')]&&_0x307231[_0xef8d('0xdf')]===_0xef8d('0xe6')){delete this['uniqueId'][_0x307231['uniqueid']];this[_0xef8d('0xb7')](this[_0xef8d('0x24')][_0x306eda['queue']]);this[_0xef8d('0x24')][_0x306eda['queue']][_0xef8d('0x62')]+=0x1;this[_0xef8d('0x24')][_0x306eda[_0xef8d('0xb8')]][_0xef8d('0xe1')]+=0x1;_0x3cc264=new Hangup(_0x306eda,_0x307231);_0x3cc264['state']=0x13;_0x3cc264['statedesc']=_0xef8d('0xe7');_0x3cc264[_0xef8d('0xe8')]=_0xef8d('0xe4');_0x3cc264[_0xef8d('0xe9')]=!![];this[_0xef8d('0xcf')](_0x3cc264,_0xef8d('0xea'),'[syncMachine]');}if(_0x306eda[_0xef8d('0x51')]==='ivr'&&this[_0xef8d('0x25')][_0x306eda[_0xef8d('0xb8')]]['dialAMDActive']&&_0x307231[_0xef8d('0xdf')]===_0xef8d('0xe0')){delete this[_0xef8d('0x2a')][_0x307231[_0xef8d('0xeb')]];this[_0xef8d('0xb7')](this[_0xef8d('0x25')][_0x306eda[_0xef8d('0xb8')]]);_0x3cc264=new Hangup(_0x306eda,_0x307231);_0x3cc264[_0xef8d('0xe2')]=0x12;_0x3cc264[_0xef8d('0xac')]='HangupInAMD';_0x3cc264[_0xef8d('0xe8')]=_0xef8d('0xe4');this['saveInDb'](_0x3cc264,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x306eda[_0xef8d('0x51')]===_0xef8d('0x9b')&&this['campaigns'][_0x306eda[_0xef8d('0xb8')]]['dialAMDActive']&&_0x307231['value']===_0xef8d('0xe6')){delete this[_0xef8d('0x2a')][_0x307231[_0xef8d('0xeb')]];this[_0xef8d('0xb7')](this[_0xef8d('0x25')][_0x306eda[_0xef8d('0xb8')]]);_0x3cc264=new Hangup(_0x306eda,_0x307231);_0x3cc264['state']=0x13;_0x3cc264['statedesc']=_0xef8d('0xe7');_0x3cc264[_0xef8d('0xe8')]='AMD';_0x3cc264[_0xef8d('0xe9')]=!![];this[_0xef8d('0xcf')](_0x3cc264,'[syncMachineIvr][createHistory]',_0xef8d('0xec'));}}};Dialer[_0xef8d('0x1e')][_0xef8d('0x39')]=function(_0x110c00){var _0x31ae42=this[_0xef8d('0x2a')][_0x110c00[_0xef8d('0xeb')]];var _0x41fd68=this;var _0x33bc33;if(_0x31ae42&&_0x31ae42[_0xef8d('0x51')]===_0xef8d('0x9b')){delete this['uniqueId'][_0x110c00[_0xef8d('0xeb')]];this['updateOriginated'](this['campaigns'][_0x31ae42['queue']]);this['campaigns'][_0x31ae42[_0xef8d('0xb8')]][_0xef8d('0xed')]+=0x1;_0x33bc33=new Hangup(_0x31ae42,_0x110c00);this['createHistory'](_0x33bc33)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xee')));this[_0xef8d('0xc9')](_0x33bc33)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xef')));}if(_0x31ae42&&_0x31ae42['type']!=='ivr'&&isNotNull(this[_0xef8d('0x24')][_0x31ae42['queue']][_0xef8d('0xf0')])){delete this[_0xef8d('0x2a')][_0x110c00[_0xef8d('0xeb')]];this[_0xef8d('0xb7')](this['voiceQueues'][_0x31ae42[_0xef8d('0xb8')]]);this[_0xef8d('0x24')][_0x31ae42['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x31ae42[_0xef8d('0xb8')]]['outboundAnswerAgiCallsDay']+=0x1;_0x33bc33=new Hangup(_0x31ae42,_0x110c00);_0x33bc33['state']=0x10;_0x33bc33[_0xef8d('0xac')]=_0xef8d('0xf1');_0x33bc33[_0xef8d('0xe8')]=_0xef8d('0xf2');this[_0xef8d('0xcb')](_0x33bc33)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xee')));this[_0xef8d('0xc9')](_0x33bc33)[_0xef8d('0xb5')](loggerCatch('[syncHangupIvr]'));}if(_0x31ae42&&_0x31ae42[_0xef8d('0x51')]!==_0xef8d('0x9b')&&!isNotNull(this['voiceQueues'][_0x31ae42['queue']]['dialQueueProject'])){delete this[_0xef8d('0x2a')][_0x110c00[_0xef8d('0xeb')]];this[_0xef8d('0xb7')](this[_0xef8d('0x24')][_0x31ae42[_0xef8d('0xb8')]]);this[_0xef8d('0x24')][_0x31ae42[_0xef8d('0xb8')]][_0xef8d('0x6d')]+=0x1;_0x33bc33=new Hangup(_0x31ae42,_0x110c00);_0x33bc33[_0xef8d('0xe2')]=0xc;_0x33bc33[_0xef8d('0xac')]=_0x110c00[_0xef8d('0xf3')];_0x33bc33[_0xef8d('0xe8')]=_0xef8d('0xf4');this[_0xef8d('0xcb')](_0x33bc33)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xee')));this[_0xef8d('0xc9')](_0x33bc33)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xef')));}};Dialer[_0xef8d('0x1e')][_0xef8d('0xf5')]=function(_0x19f237){var _0x45bd20=this[_0xef8d('0x2a')][_0x19f237[_0xef8d('0xeb')]];var _0x4c44b2=this;if(this['voiceQueues'][_0x19f237[_0xef8d('0xb8')]]){if(_0x45bd20&&_0x45bd20[_0xef8d('0x51')]!==_0xef8d('0x9b')){delete this[_0xef8d('0x2a')][_0x19f237[_0xef8d('0xeb')]];this[_0xef8d('0x24')][_0x19f237[_0xef8d('0xb8')]][_0xef8d('0x62')]+=0x1;var _0x5857d7=new AgentComplete(_0x45bd20,_0x19f237);if(_0x19f237[_0xef8d('0xf6')]===_0xef8d('0xf7')){_0x5857d7[_0xef8d('0xf8')]=this[_0xef8d('0x24')][_0x19f237[_0xef8d('0xb8')]][_0xef8d('0xf9')]&&this[_0xef8d('0x24')][_0x19f237[_0xef8d('0xb8')]][_0xef8d('0xfa')]?moment()[_0xef8d('0x82')](_0xef8d('0xfb')):undefined;}this[_0xef8d('0xcb')](_0x5857d7)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xfc')));this['moveContactManagedDialer'](_0x5857d7)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xfd')));}}};Dialer[_0xef8d('0x1e')][_0xef8d('0x30')]=function(_0x20541b){if(this[_0xef8d('0x24')][_0x20541b[_0xef8d('0xb8')]]){if(this[_0xef8d('0x2a')][_0x20541b[_0xef8d('0xeb')]]&&this[_0xef8d('0x2a')][_0x20541b[_0xef8d('0xeb')]]['type']!==_0xef8d('0x9b')){this[_0xef8d('0xb7')](this[_0xef8d('0x24')][_0x20541b[_0xef8d('0xb8')]]);this[_0xef8d('0x2a')][_0x20541b[_0xef8d('0xeb')]][_0xef8d('0xfe')]=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));}}};Dialer[_0xef8d('0x1e')][_0xef8d('0xff')]=function(_0x8e15){this[_0xef8d('0xcb')](_0x8e15)[_0xef8d('0xb5')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x8e15)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x100')));};Dialer[_0xef8d('0x1e')]['syncQueueCallerAbandon']=function(_0x4929fe){var _0x2c4fa0=this[_0xef8d('0x2a')][_0x4929fe[_0xef8d('0xeb')]];var _0x205e3c=this;if(this[_0xef8d('0x24')][_0x4929fe[_0xef8d('0xb8')]]){if(_0x2c4fa0&&_0x2c4fa0[_0xef8d('0x51')]!==_0xef8d('0x9b')){delete this['uniqueId'][_0x4929fe[_0xef8d('0xeb')]];this[_0xef8d('0xb7')](this[_0xef8d('0x24')][_0x4929fe[_0xef8d('0xb8')]]);_0x2c4fa0['droptime']=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));var _0x1688db=new QueueCallerAbandon(_0x2c4fa0,_0x4929fe);if(getSeconds(_0x2c4fa0[_0xef8d('0x101')],_0x2c4fa0[_0xef8d('0x102')])>=_0x2c4fa0[_0xef8d('0x103')]){this[_0xef8d('0x24')][_0x4929fe['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xef8d('0x24')][_0x4929fe[_0xef8d('0xb8')]][_0xef8d('0x67')]+=0x1;this['voiceQueues'][_0x4929fe['queue']][_0xef8d('0x74')]+=0x1;_0x1688db[_0xef8d('0xe2')]=0xa;_0x1688db[_0xef8d('0xac')]=_0xef8d('0x104');_0x1688db[_0xef8d('0x105')]='TIMEOUT';_0x1688db[_0xef8d('0xf8')]=this[_0xef8d('0x24')][_0x4929fe[_0xef8d('0xb8')]][_0xef8d('0xf9')]?moment()['format'](_0xef8d('0xfb')):undefined;this[_0xef8d('0xff')](_0x1688db);}else{this[_0xef8d('0x24')][_0x4929fe['queue']][_0xef8d('0x71')]+=0x1;this[_0xef8d('0x24')][_0x4929fe[_0xef8d('0xb8')]][_0xef8d('0x66')]+=0x1;_0x1688db[_0xef8d('0xe2')]=0xb;_0x1688db[_0xef8d('0xac')]=_0xef8d('0x106');_0x1688db['dropreason']=_0xef8d('0x107');this[_0xef8d('0xff')](_0x1688db);}}}};Dialer[_0xef8d('0x1e')]['syncNewExten']=function(_0x396678){if(this[_0xef8d('0x29')][_0x396678['uniqueid']]){this[_0xef8d('0x29')][_0x396678[_0xef8d('0xeb')]]['channel']=_0x396678[_0xef8d('0xb4')];}if(this['uniqueId'][_0x396678[_0xef8d('0xeb')]]){this[_0xef8d('0x2a')][_0x396678[_0xef8d('0xeb')]][_0xef8d('0xb4')]=_0x396678[_0xef8d('0xb4')];}};Dialer[_0xef8d('0x1e')][_0xef8d('0x3d')]=function(_0x5885d7){if(strategy[this[_0xef8d('0x24')][this[_0xef8d('0x29')][_0x5885d7['actionid']][_0xef8d('0xb8')]][_0xef8d('0x52')]]===_0xef8d('0x1d')){if(this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]]&&_['isNil'](this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]][_0xef8d('0x109')])&&_0x5885d7[_0xef8d('0xb3')]==='1'&&_0x5885d7['paused']==='0'){if(this[_0xef8d('0x26')][_0x5885d7['stateinterface']]){if(!this[_0xef8d('0x26')][_0x5885d7['stateinterface']][_0xef8d('0x109')]){this[_0xef8d('0x26')][_0x5885d7[_0xef8d('0x10a')]][_0xef8d('0x109')]=!![];this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]][_0xef8d('0x109')]=!![];this[_0xef8d('0x29')][_0x5885d7['actionid']]['stateinterface']=_0x5885d7[_0xef8d('0x10a')];}}}}else if((strategy[this[_0xef8d('0x24')][this['actions'][_0x5885d7[_0xef8d('0x108')]]['queue']][_0xef8d('0x52')]]||_0xef8d('0x1c'))===_0xef8d('0x1c')){if(this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]]){if(this[_0xef8d('0x26')][_0x5885d7[_0xef8d('0x10a')]]){this['actions'][_0x5885d7[_0xef8d('0x108')]][_0xef8d('0x10a')]=_0x5885d7['stateinterface'];if(_['isNil'](this['queueBooked'][this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]]['queue']])){this[_0xef8d('0x10b')][this[_0xef8d('0x29')][_0x5885d7['actionid']][_0xef8d('0xb8')]]=[];}this[_0xef8d('0x10b')][this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]][_0xef8d('0xb8')]][_0xef8d('0x10c')](_[_0xef8d('0x93')](_['pick'](this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]],[_0xef8d('0x10d'),'stateinterface']),{'status':_0x5885d7[_0xef8d('0xb3')],'paused':_0x5885d7[_0xef8d('0x10e')]}));}}}};function unlockQueueStatus(_0x1fbb4c,_0x557435){setTimeout(function(){if(_[_0xef8d('0x41')](_0x1fbb4c[_0xef8d('0x10f')])){loggerBooked['error'](_0xef8d('0x110'),_0x557435);}_0x1fbb4c['queueStatusComplete']=!![];loggerBooked[_0xef8d('0x87')](_0xef8d('0x111'),_0x557435,JSON[_0xef8d('0x81')](_[_0xef8d('0xd0')](_0x1fbb4c,[_0xef8d('0x44'),_0xef8d('0x10f')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x589fdd){var _0x20d21e=this;var _0x4dfd17=_0x20d21e[_0xef8d('0x24')][_0x20d21e['actions'][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]];if(strategy[this[_0xef8d('0x24')][this['actions'][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]][_0xef8d('0x52')]]==='roundrobin'){if(this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]&&this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0x10a')]){this['preview'][_0xef8d('0x112')](this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]['idHopper'],this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0x10a')])['catch'](function(_0x1843d2){logger[_0xef8d('0x9e')](_0xef8d('0x113'),util[_0xef8d('0x9f')](_0x1843d2,{'showHidden':![],'depth':null}));})[_0xef8d('0x21')](function(){_0x20d21e[_0xef8d('0xb7')](_0x20d21e[_0xef8d('0x24')][_0x20d21e[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]]);_0x20d21e['agents'][_0x20d21e[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0x10a')]][_0xef8d('0x109')]=![];delete _0x20d21e['actions'][_0x589fdd[_0xef8d('0x108')]];unlockQueueStatus(_0x4dfd17);});}else{this[_0xef8d('0xb7')](this[_0xef8d('0x24')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]]);this[_0xef8d('0xc4')]({'active':![],'ContactId':this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]['ContactId'],'ListId':this['actions'][_0x589fdd['actionid']][_0xef8d('0xd1')],'VoiceQueueId':this['actions'][_0x589fdd['actionid']][_0xef8d('0xd3')]||undefined,'CampaignId':this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]['CampaignId']||undefined})[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x114')));delete this['actions'][_0x589fdd[_0xef8d('0x108')]];unlockQueueStatus(_0x4dfd17);}}else if((strategy[this[_0xef8d('0x24')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]][_0xef8d('0x52')]]||_0xef8d('0x1c'))==='rrmemory'){var _0x12c9b8;if(this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]&&!_[_0xef8d('0x4b')](this[_0xef8d('0x10b')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]])){if(this[_0xef8d('0x2e')][_0x20d21e[_0xef8d('0x29')][_0x589fdd['actionid']][_0xef8d('0xb8')]]){this[_0xef8d('0x2e')][_0x20d21e[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]['queue']]=this['queueBookedRR'][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]]?this[_0xef8d('0x2e')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]]:this[_0xef8d('0x10b')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]['queue']]?this[_0xef8d('0x10b')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]]['_rr']||0x0:0x0;}this[_0xef8d('0x10b')][this['actions'][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]][_0xef8d('0x115')]=this['queueBookedRR'][this[_0xef8d('0x29')][_0x589fdd['actionid']]['queue']];for(var _0x362a8d=0x0;_0x362a8d=0x0?!![]:![];})['catch'](myreject(_0x4ac408)));}}else{_0x5d2e2b[_0xef8d('0x10c')](ami[_0xef8d('0xb2')]({'action':_0xef8d('0x130'),'command':util['format'](_0xef8d('0x131'),_0x277ba9,!_[_0xef8d('0x41')](config[_0xef8d('0x128')][_0x42f59])?_0x42f59:'')})[_0xef8d('0xbc')](function(_0x3c6880){return _0x3c6880[_0xef8d('0x12d')]['indexOf'](_0xef8d('0x12f'))>=0x0?!![]:![];})['catch'](myreject(_0x4ac408)));}BPromise['all'](_0x5d2e2b)['then'](function(_0x1a7a36){var _0x4f1b86=_['some'](_0x1a7a36);if(_0x4f1b86){return _0x356b2c(_0x4f1b86);}else{_0x435027[_0xef8d('0x42')]=_0x5af0fc?_0xef8d('0x132'):'INTERVAL_IS_OVERTIME';return _0x4ac408(msgResponse(_0xef8d('0x133'),'Failure','Global:\x20'+_0x5af0fc+'\x20'+_0x452d8a+'\x20Interval\x20is\x20overtime:\x20'+util[_0xef8d('0x9f')](_0x277ba9,{'showHidden':![],'depth':null})+_0xef8d('0x134')+_0x42f59));}})[_0xef8d('0xb5')](function(_0x6c99d2){return _0x4ac408(msgResponse('ifTime',_0xef8d('0x125'),JSON[_0xef8d('0x81')](_0x6c99d2)));});});};Dialer[_0xef8d('0x1e')]['checkDialMethod']=function(_0x519811){var _0x26d29d=this;return function(){switch(_0x519811['dialMethod']){case'progressive':freeVariablesPredictive(_0x519811);_0x26d29d[_0xef8d('0x135')](_0x519811,0x1);break;case _0xef8d('0x136'):freeVariablesPredictive(_0x519811);_0x26d29d[_0xef8d('0x135')](_0x519811,_0x519811[_0xef8d('0x137')]);break;case'predictive':_0x26d29d[_0xef8d('0xa')](_0x519811);break;case _0xef8d('0x9'):freeVariablesPredictive(_0x519811);_0x26d29d['handlePower'](_0x519811,0x1);break;default:freeVariablesPredictive(_0x519811);logger['error']('Queue',_0x519811['name'],_0xef8d('0x138'));}};};Dialer[_0xef8d('0x1e')][_0xef8d('0x139')]=function(_0x22cb27){var _0x57a1d5=this;return function(){_0x57a1d5[_0xef8d('0x13a')](_0x22cb27);};};Dialer['prototype'][_0xef8d('0xc')]=function(_0x18d686){var _0x21e249=this;if(isNotPreview(_0x18d686[_0xef8d('0x5e')])){if(isVoiceQueueOutbound(_0x18d686['type'])&&isActive(_0x18d686['dialActive'])){_0x18d686['sendMessageOneNotActive']=!![];BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](checkIsLoggedIn(_0x18d686,_0x18d686['loggedIn']))[_0xef8d('0xbc')](checkIsActive(_0x18d686,_0x18d686[_0xef8d('0x5d')]))['then'](checkInterval(_0x18d686))['then'](_0x21e249[_0xef8d('0x13b')](_0x18d686))[_0xef8d('0xbc')](_0x21e249[_0xef8d('0x122')](_0x18d686[_0xef8d('0x13c')],_0x18d686[_0xef8d('0x13d')],_0x18d686[_0xef8d('0x44')],_0x18d686))[_0xef8d('0xbc')](_0x21e249[_0xef8d('0x124')](_0x18d686[_0xef8d('0x47')],_0x18d686[_0xef8d('0x13d')],_0x18d686['name'],_0x18d686))[_0xef8d('0xbc')](_0x21e249[_0xef8d('0x13e')](_0x18d686))[_0xef8d('0xb5')](loggerCatchQueueSummary('[syncQueueSummary]',_0x18d686));}else{notSendMessagesQueue(_0x18d686);}}else{freeVariablesPredictive(_0x18d686);}};Dialer[_0xef8d('0x1e')]['syncCampaigns']=function(){var _0x22c87e=this;var _0x132571;for(var _0x224013 in this[_0xef8d('0x25')]){if(this[_0xef8d('0x25')]['hasOwnProperty'](_0x224013)){_0x132571=this['campaigns'][_0x224013];if(isCampaignIvr(_0x132571[_0xef8d('0x51')])&&isActive(_0x132571[_0xef8d('0x7f')])){_0x132571[_0xef8d('0xa5')]=!![];BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](checkIsActive(_0x132571,_0x132571['active']))[_0xef8d('0xbc')](checkInterval(_0x132571))[_0xef8d('0xbc')](_0x22c87e[_0xef8d('0x13b')](_0x132571))[_0xef8d('0xbc')](_0x22c87e[_0xef8d('0x122')](_0x132571[_0xef8d('0x13c')],_0x132571['dialTimezone'],_0x132571[_0xef8d('0x44')],_0x132571))['then'](_0x22c87e[_0xef8d('0x124')](_0x132571['Interval'],_0x132571['dialTimezone'],_0x132571[_0xef8d('0x44')],_0x132571))[_0xef8d('0xbc')](_0x22c87e[_0xef8d('0x139')](_0x132571))[_0xef8d('0xb5')](loggerCatchQueueSummary('[syncCampaigns]',_0x132571));}else{notSendMessagesCampaign(_0x132571);}}}};function getCallerIdRandom(_0x17529e,_0x27a536){var _0x51610e,_0xd0055b,_0x1b02da;if(_0x27a536<=0x0){_0x27a536=0x1;}_0x51610e=new RegExp('\x5cw{0,'+_0x27a536+'}$');_0xd0055b=Math[_0xef8d('0x13f')](0xa,_0x27a536-0x1);_0x1b02da=Math['pow'](0xa,_0x27a536)-0x1;return util[_0xef8d('0x82')]('%s',_[_0xef8d('0x140')](_0x17529e,_0x51610e,_[_0xef8d('0x141')](_0xd0055b,_0x1b02da)));}function extractCalleridName(_0x1fcedb){var _0x37ff8c=_0x1fcedb['match'](/"(.*?)"/);return _0x37ff8c?_0x37ff8c[0x1]:_0x1fcedb;}function extractCalleridNumber(_0x53131a){var _0x3f03a2=_0x53131a[_0xef8d('0x142')](/<(.*?)>/);return _0x3f03a2?_0x3f03a2[0x1]:_0x53131a;}Dialer[_0xef8d('0x1e')][_0xef8d('0x143')]=function(_0x5488b3,_0x137bf2){var _0x28efc5=this;var _0x5518c5=uuid['v4']();this[_0xef8d('0x29')][_0x5518c5]=new Action(_0x5488b3,_0x137bf2,_0x5518c5);return new BPromise(function(_0x475fb4,_0x40f750){if(_['isUndefined'](_0x5488b3)&&'object'!==typeof _0x5488b3){return _0x40f750(msgResponse(_0xef8d('0x144'),_0xef8d('0x125'),'voiceQueue\x20is\x20undefine'));}if(_[_0xef8d('0x41')](_0x137bf2['Contact'][_0xef8d('0x145')])||_0x137bf2[_0xef8d('0x146')][_0xef8d('0x145')]===null){return _0x40f750(msgResponse(_0xef8d('0x144'),'Failure',_0xef8d('0x147')));}var _0x4378bf={'XMD-CALLERID':_0x28efc5[_0xef8d('0x29')][_0x5518c5][_0xef8d('0x148')](),'XMD-AGI':_0x5488b3[_0xef8d('0xf0')]?util[_0xef8d('0x82')](_0xef8d('0x149'),ipAgi,_0x5488b3['dialQueueProject']):_0xef8d('0x14a'),'XMD-AGIAFTER':_0x5488b3[_0xef8d('0xf9')]?util['format'](_0xef8d('0x149'),ipAgi,_0x5488b3[_0xef8d('0xf9')]):_0xef8d('0x14a'),'XMD-QUEUE':_0x5488b3[_0xef8d('0x51')]===_0xef8d('0x9a')?util[_0xef8d('0x82')](_0xef8d('0x14b'),_0x5488b3[_0xef8d('0x44')],_0x5488b3[_0xef8d('0x14c')]||'',_0x5488b3[_0xef8d('0xfa')]?'c':'',_0x5488b3['dialQueueTimeout']||0x3):_0xef8d('0x14a'),'XMD-CONTACTID':_0x137bf2['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x28efc5[_0xef8d('0x29')][_0x5518c5][_0xef8d('0x148')](),'XMD-AMD':_0x5488b3[_0xef8d('0xde')]?_0xef8d('0x14d'):_0xef8d('0x14a'),'XMD-DESTINATION':_0xef8d('0x14e')};if(_0x5488b3[_0xef8d('0xde')]){_0x4378bf[_0xef8d('0x14f')]=_0x5488b3['dialAMDInitialSilence']||0x9c4;_0x4378bf[_0xef8d('0x150')]=_0x5488b3['dialAMDGreeting']||0x5dc;_0x4378bf[_0xef8d('0x151')]=_0x5488b3['dialAMDAfterGreetingSilence']||0x320;_0x4378bf[_0xef8d('0x152')]=_0x5488b3['dialAMDTotalAnalysisTime']||0x1388;_0x4378bf[_0xef8d('0x153')]=_0x5488b3[_0xef8d('0x154')]||0x64;_0x4378bf[_0xef8d('0x155')]=_0x5488b3[_0xef8d('0x156')]||0x32;_0x4378bf[_0xef8d('0x157')]=_0x5488b3[_0xef8d('0x158')]||0x3;_0x4378bf[_0xef8d('0x159')]=_0x5488b3[_0xef8d('0x15a')]||0x100;_0x4378bf[_0xef8d('0x15b')]=_0x5488b3[_0xef8d('0x15c')]||0x1388;}if(_0x5488b3['type']===_0xef8d('0x9a')){_0x4378bf['XMD-VOICEQUEUEID']=_0x137bf2['VoiceQueueId'];}else{_0x4378bf[_0xef8d('0x15d')]=_0x137bf2[_0xef8d('0xd4')];}for(var _0x515e24 in _0x137bf2[_0xef8d('0x146')]){if(_0x137bf2['Contact'][_0xef8d('0x15e')](_0x515e24)){if(isNotNull(_0x137bf2[_0xef8d('0x146')][_0x515e24])&&_0x515e24!=='id'&&_0x515e24!==_0xef8d('0x15f')&&_0x515e24!=='createdAt'&&_0x515e24!==_0xef8d('0x160')){_0x4378bf[util[_0xef8d('0x82')](_0xef8d('0x161'),_0xef8d('0x162'),_[_0xef8d('0x163')](_0x515e24))]=_0x137bf2[_0xef8d('0x146')][_0x515e24];}}}var _0x180784=_0x28efc5[_0xef8d('0xd8')](_0x5488b3[_0xef8d('0x7e')])?getCallerId(_0x5488b3[_0xef8d('0x7e')][_0xef8d('0x80')],_0x5488b3['dialOriginateCallerIdName'],_0x5488b3['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5488b3[_0xef8d('0x60')],_0x5488b3[_0xef8d('0x164')]):_0x5488b3[_0xef8d('0x60')]):getCallerId(_[_0xef8d('0xb1')](_0x5488b3[_0xef8d('0x120')])?_0x5488b3[_0xef8d('0x7e')][_0xef8d('0x80')]:_0x5488b3[_0xef8d('0x120')][_0xef8d('0x80')],_0x5488b3[_0xef8d('0x5f')],_0x5488b3[_0xef8d('0x164')]>0x0?getCallerIdRandom(_0x5488b3[_0xef8d('0x60')],_0x5488b3[_0xef8d('0x164')]):_0x5488b3['dialOriginateCallerIdNumber']);if(_0x180784){_0x4378bf[_0xef8d('0x165')]=_0x28efc5[_0xef8d('0x29')][_0x5518c5][_0xef8d('0x166')]=extractCalleridName(_0x180784);_0x4378bf[_0xef8d('0x167')]=_0x28efc5[_0xef8d('0x29')][_0x5518c5]['originatecalleridnum']=extractCalleridNumber(_0x180784);}return ami[_0xef8d('0xb2')]({'actionid':_0x5518c5,'action':_0xef8d('0x144'),'channel':_0x28efc5[_0xef8d('0xd8')](_0x5488b3[_0xef8d('0x7e')])?util['format'](_0xef8d('0x168'),_0x5488b3[_0xef8d('0x7e')][_0xef8d('0x44')],isNotNull(_0x5488b3['dialPrefix'])?_0x5488b3[_0xef8d('0x169')][_0xef8d('0x16a')]()||'':'',_0x5488b3[_0xef8d('0x16b')]>0x0?_0x137bf2[_0xef8d('0x146')][_0xef8d('0x145')][_0xef8d('0x16c')](_0x5488b3[_0xef8d('0x16b')]):_0x137bf2['Contact']['phone']):util[_0xef8d('0x82')]('SIP/%s/%s%s',_['isNil'](_0x5488b3[_0xef8d('0x120')])?_0x5488b3[_0xef8d('0x7e')]['name']:_0x5488b3[_0xef8d('0x120')][_0xef8d('0x44')],isNotNull(_0x5488b3[_0xef8d('0x169')])?_0x5488b3['dialPrefix'][_0xef8d('0x16a')]()||'':'',_0x5488b3['dialCutDigit']>0x0?_0x137bf2[_0xef8d('0x146')][_0xef8d('0x145')]['substring'](_0x5488b3['dialCutDigit']):_0x137bf2[_0xef8d('0x146')][_0xef8d('0x145')]),'callerid':_0x180784,'Exten':_0xef8d('0x14e'),'Context':_0xef8d('0x16d'),'Priority':'1','variable':_0x4378bf,'timeout':(_0x5488b3['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5518c5})[_0xef8d('0xbc')](function(_0x5e4502){return _0x475fb4(_0x5e4502);})[_0xef8d('0xb5')](function(_0x33dabb){_0x5488b3[_0xef8d('0x6a')]+=0x1;var _0x518078=new History(_0x28efc5[_0xef8d('0x29')][_0x5518c5]);logger[_0xef8d('0x9e')](util[_0xef8d('0x82')](_0xef8d('0x16e'),JSON[_0xef8d('0x81')](_0x33dabb)));_0x518078['state']=0xe;_0x518078[_0xef8d('0xac')]=_0xef8d('0x16f');_0x518078['starttime']=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));_0x518078[_0xef8d('0xad')]=_0x518078[_0xef8d('0x170')];_0x28efc5[_0xef8d('0xcb')](_0x518078)[_0xef8d('0xb5')](loggerCatch('[originate][error]'));_0x28efc5[_0xef8d('0xc9')](_0x518078)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x171')))['finally'](function(){delete _0x28efc5['actions'][_0x5518c5];return _0x40f750(msgResponse(_0xef8d('0x144'),_0xef8d('0x4d'),_0xef8d('0x172')));});});});};Dialer[_0xef8d('0x1e')][_0xef8d('0x35')]=function(_0x358416){var _0x3d387a=this[_0xef8d('0x29')][_0x358416[_0xef8d('0x108')]];var _0x5c981e=this;if(_0x3d387a){delete this[_0xef8d('0x29')][_0x358416[_0xef8d('0x108')]];_0x3d387a[_0xef8d('0x102')]=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));var _0x2e4469=_0x3d387a[_0xef8d('0x51')]===_0xef8d('0x9b')?this[_0xef8d('0x25')][_0x3d387a[_0xef8d('0xb8')]]:this[_0xef8d('0x24')][_0x3d387a[_0xef8d('0x173')]()];if(!this[_0xef8d('0xd6')](_0x358416[_0xef8d('0x174')])){this[_0xef8d('0xb7')](_0x2e4469);return this[_0xef8d('0x175')](_0x3d387a,_0x2e4469,_0x358416)[_0xef8d('0xbc')](function(_0x3d12e0){})[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x176')));}else{this[_0xef8d('0x2a')][_0x358416[_0xef8d('0xeb')]]=_0x3d387a;}}};Dialer[_0xef8d('0x1e')][_0xef8d('0x177')]=function(_0x4de12e,_0x205621,_0x17ef6f){var _0xc9b787=new History(_0x205621);if(_0xc9b787[_0xef8d('0x178')]+_0xc9b787[_0xef8d('0x179')]+_0xc9b787['countnoanswerretry']>=_0x17ef6f['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x4de12e){case 0x3:if(_0xc9b787[_0xef8d('0x17a')]>=_0x17ef6f[_0xef8d('0x17b')]-0x1){return!![];}else{this[_0xef8d('0xc4')]({'active':![],'countnoanswerretry':_0xc9b787[_0xef8d('0x17a')]+=0x1,'scheduledat':moment()['add'](_0x17ef6f[_0xef8d('0x17c')],_0xef8d('0x17d'))['format'](_0xef8d('0xfb')),'ContactId':_0xc9b787[_0xef8d('0x11d')],'ListId':_0xc9b787['ListId'],'VoiceQueueId':_0xc9b787[_0xef8d('0xd3')]||undefined,'CampaignId':_0xc9b787[_0xef8d('0xd4')]||undefined})['catch'](loggerCatch(_0xef8d('0x17e')));}break;case 0x5:if(_0xc9b787[_0xef8d('0x178')]>=_0x17ef6f[_0xef8d('0x17f')]-0x1){return!![];}else{this[_0xef8d('0xc4')]({'active':![],'countbusyretry':_0xc9b787[_0xef8d('0x178')]+=0x1,'scheduledat':moment()['add'](_0x17ef6f[_0xef8d('0x180')],_0xef8d('0x17d'))['format'](_0xef8d('0xfb')),'ContactId':_0xc9b787[_0xef8d('0x11d')],'ListId':_0xc9b787[_0xef8d('0xd1')],'VoiceQueueId':_0xc9b787[_0xef8d('0xd3')]||undefined,'CampaignId':_0xc9b787['CampaignId']||undefined})[_0xef8d('0xb5')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0xc9b787['countcongestionretry']>=_0x17ef6f[_0xef8d('0x181')]-0x1){return!![];}else{this[_0xef8d('0xc4')]({'active':![],'countcongestionretry':_0xc9b787[_0xef8d('0x179')]+=0x1,'scheduledat':moment()['add'](_0x17ef6f['dialCongestionRetryFrequency'],_0xef8d('0x17d'))['format'](_0xef8d('0xfb')),'ContactId':_0xc9b787[_0xef8d('0x11d')],'ListId':_0xc9b787[_0xef8d('0xd1')],'VoiceQueueId':_0xc9b787['VoiceQueueId']||undefined,'CampaignId':_0xc9b787[_0xef8d('0xd4')]||undefined})[_0xef8d('0xb5')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0xef8d('0x1e')][_0xef8d('0x175')]=function(_0x31f3d8,_0x5f36d4,_0x3fad4a){var _0x2c569f=this;var _0x1bc80e=new History(_0x31f3d8);return new BPromise(function(_0xba2d18,_0xd69773){if(_[_0xef8d('0x41')](_0x5f36d4)&&_0xef8d('0x182')!==typeof _0x5f36d4){return _0xd69773(msgResponse('[callProgressDetecting]',_0xef8d('0x125'),_0xef8d('0x183')));}if(_[_0xef8d('0x41')](_0x3fad4a)&&_0xef8d('0x182')!==typeof _0x3fad4a){return _0xd69773(msgResponse('[callProgressDetecting]',_0xef8d('0x125'),_0xef8d('0x184')));}switch(_0x3fad4a[_0xef8d('0xf6')]){case'0':_0x5f36d4['outboundNoSuchCallsDay']+=0x1;_0x1bc80e[_0xef8d('0xe2')]=0x0;_0x1bc80e[_0xef8d('0xac')]=_0xef8d('0x185');_0x2c569f['createHistory'](_0x1bc80e)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x186')));if(_0x2c569f[_0xef8d('0x177')](0x0,_0x31f3d8,_0x5f36d4)){if(_0x1bc80e[_0xef8d('0x178')]+_0x1bc80e[_0xef8d('0x179')]+_0x1bc80e[_0xef8d('0x17a')]>=_0x5f36d4[_0xef8d('0x187')]){_0x2c569f['stateGlobal'](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x188'));}else{_0x2c569f[_0xef8d('0x189')](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x188'));}}break;case'3':_0x5f36d4[_0xef8d('0x68')]+=0x1;_0x1bc80e[_0xef8d('0xe2')]=0x3;_0x1bc80e[_0xef8d('0xac')]=_0xef8d('0x18a');_0x1bc80e[_0xef8d('0x17a')]+=0x1;_0x1bc80e[_0xef8d('0x18b')]+=0x1;_0x2c569f[_0xef8d('0xcb')](_0x1bc80e)[_0xef8d('0xb5')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2c569f[_0xef8d('0x177')](0x3,_0x31f3d8,_0x5f36d4)){if(_0x1bc80e[_0xef8d('0x17a')]>=_0x5f36d4[_0xef8d('0x17b')]){_0x2c569f[_0xef8d('0x189')](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x18c'));}else{_0x2c569f[_0xef8d('0x18d')](_0x1bc80e,_0xba2d18,_0xd69773,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5f36d4[_0xef8d('0x64')]+=0x1;_0x1bc80e[_0xef8d('0xe2')]=0x5;_0x1bc80e[_0xef8d('0xac')]='Busy';_0x1bc80e[_0xef8d('0x178')]+=0x1;_0x1bc80e[_0xef8d('0x18b')]+=0x1;_0x2c569f[_0xef8d('0xcb')](_0x1bc80e)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x2c569f[_0xef8d('0x177')](0x5,_0x31f3d8,_0x5f36d4)){if(_0x1bc80e[_0xef8d('0x178')]>=_0x5f36d4[_0xef8d('0x17f')]){_0x2c569f[_0xef8d('0x189')](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x18e'));}else{_0x2c569f[_0xef8d('0x18d')](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x18e'));}}break;case'8':_0x5f36d4[_0xef8d('0x65')]+=0x1;_0x1bc80e['state']=0x8;_0x1bc80e[_0xef8d('0xac')]='Congestion';_0x1bc80e[_0xef8d('0x179')]+=0x1;_0x1bc80e[_0xef8d('0x18b')]+=0x1;_0x2c569f[_0xef8d('0xcb')](_0x1bc80e)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x18f')));if(_0x2c569f[_0xef8d('0x177')](0x8,_0x31f3d8,_0x5f36d4)){if(_0x1bc80e[_0xef8d('0x179')]>=_0x5f36d4[_0xef8d('0x181')]){_0x2c569f[_0xef8d('0x189')](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x190'));}else{_0x2c569f['stateGlobal'](_0x1bc80e,_0xba2d18,_0xd69773,'reason\x208\x20congestion');}}break;default:_0x5f36d4[_0xef8d('0x6d')]+=0x1;_0x1bc80e[_0xef8d('0xe2')]=0xc;_0x1bc80e[_0xef8d('0xac')]=_0x3fad4a[_0xef8d('0xf6')];_0x2c569f[_0xef8d('0xcb')](_0x1bc80e)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x191')));if(_0x2c569f[_0xef8d('0x177')](_0x3fad4a[_0xef8d('0xf6')],_0x31f3d8,_0x5f36d4)){if(_0x1bc80e[_0xef8d('0x178')]+_0x1bc80e['countcongestionretry']+_0x1bc80e['countnoanswerretry']>=_0x5f36d4['dialGlobalMaxRetry']){_0x2c569f[_0xef8d('0x18d')](_0x1bc80e,_0xba2d18,_0xd69773,_0x3fad4a[_0xef8d('0xf6')]);}else{_0x2c569f[_0xef8d('0x189')](_0x1bc80e,_0xba2d18,_0xd69773,_0x3fad4a[_0xef8d('0xf6')]);}}}});};Dialer['prototype'][_0xef8d('0x18d')]=function(_0x379283,_0x30709e,_0x5c9a85,_0x166e65){var _0x4b68af=new Final(_0x379283);_0x4b68af[_0xef8d('0xe2')]=0xf;_0x4b68af[_0xef8d('0xac')]=_0xef8d('0x192');this[_0xef8d('0x189')](_0x4b68af,_0x30709e,_0x5c9a85,_0x166e65);};Dialer['prototype']['createStateFinal']=function(_0x351a7b,_0xce816b,_0x26ad51,_0x3ee538){this[_0xef8d('0xc9')](_0x351a7b)[_0xef8d('0xbc')](function(_0x271a26){return _0xce816b(msgResponse(_0xef8d('0x193'),_0xef8d('0xd7'),_0x3ee538));})[_0xef8d('0xb5')](function(_0x4bcd7b){return _0x26ad51(msgResponse(_0xef8d('0x194'),_0xef8d('0x125'),_0xef8d('0x195')));});};Dialer['prototype']['predictive']=function(_0x30a410){var _0x5e50bb=this;var _0x23845a=_0x30a410['dialPredictiveOptimizationPercentage']/0x64;var _0x5b30d9=_0x30a410['outboundDropCallsDayTimeout']/(_0x30a410[_0xef8d('0x67')]+_0x30a410[_0xef8d('0x62')]);var _0x17a766=Math['round'](_0x30a410['predictiveIntervalAvailable']*(_0x30a410['predictiveIntervalMaxThreshold']/0x64));var _0x4c1a0c=Math['round'](_0x30a410[_0xef8d('0x196')]*(_0x30a410['predictiveIntervalMinThreshold']/0x64));var _0x1fda17=_0x30a410[_0xef8d('0x54')]+_0x30a410['talking'];var _0x9575e2=Math[_0xef8d('0x197')](_0x30a410[_0xef8d('0x7a')]*_0x30a410[_0xef8d('0x7c')]*_0x30a410['predictiveIntervalHitRate']*_0x30a410[_0xef8d('0x76')]);if(_[_0xef8d('0x41')](_0x30a410[_0xef8d('0x2c')])){if(!_[_0xef8d('0x41')](_0x30a410[_0xef8d('0x96')])){_0x30a410[_0xef8d('0x96')]=undefined;loggerPredictive[_0xef8d('0x9e')](_0xef8d('0x198'),_0xef8d('0x199'));}if(!_['isUndefined'](_0x30a410[_0xef8d('0x98')])){loggerPredictive['error'](_0xef8d('0x198'),_0xef8d('0x19a'));clearInterval(_0x30a410[_0xef8d('0x98')]);_0x30a410[_0xef8d('0x98')]=undefined;}_0x30a410[_0xef8d('0x2c')]=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));loggerPredictive[_0xef8d('0x87')](_0x30a410[_0xef8d('0x44')],_0xef8d('0x19b'),_0x30a410['startProgressive']);this['handlePower'](_0x30a410,0x1);}else if(ifInterval(_0x30a410[_0xef8d('0x19c')],_0x30a410[_0xef8d('0x2c')])){this[_0xef8d('0x135')](_0x30a410,0x1);loggerPredictiveCalls[_0xef8d('0x87')](_0xef8d('0x19d'),_0x30a410[_0xef8d('0x2c')],_0x30a410[_0xef8d('0x44')]);_0x30a410[_0xef8d('0x7a')]=0x0;_0x30a410[_0xef8d('0x74')]=0x0;}else if(_0x23845a<_0x5b30d9&&_0x30a410[_0xef8d('0x19e')]===_0xef8d('0x19f')){freeVariablesPredictive(_0x30a410);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1a0'),_0xef8d('0x1a1'),_0x5b30d9,_0xef8d('0x2c'),_0x30a410[_0xef8d('0x44')]);}else if(_0x9575e2<_0x30a410['predictiveIntervalErlangCallsDroppedCalls']&&_0x30a410[_0xef8d('0x19e')]===_0xef8d('0x19f')){freeVariablesPredictive(_0x30a410);loggerPredictive[_0xef8d('0x87')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xef8d('0x1a2'),_0x9575e2,_0xef8d('0x1a3'),_0x30a410[_0xef8d('0x74')],_0xef8d('0x2c'),_0x30a410[_0xef8d('0x44')]);}else if(!ifInterval(_0x30a410[_0xef8d('0x19c')],_0x30a410[_0xef8d('0x2c')])&&_[_0xef8d('0x41')](_0x30a410[_0xef8d('0x96')])&&!_[_0xef8d('0x41')](_0x30a410[_0xef8d('0x2c')])){_0x30a410['startPredictive']=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));loggerPredictive['info'](_0x30a410[_0xef8d('0x44')],'started\x20in\x20predictive\x20at',_0x30a410[_0xef8d('0x96')]);this[_0xef8d('0x1a4')](_0x30a410[_0xef8d('0x19c')])[_0xef8d('0xbc')](this[_0xef8d('0x1a5')](_0x30a410))[_0xef8d('0xbc')](mergeDataErlangB(_0x30a410))['then'](this[_0xef8d('0x1a6')](_0x30a410))[_0xef8d('0xb5')](loggerCatchPredictive(_0xef8d('0x1a7'),_0x30a410));}else if(!ifInterval(_0x30a410[_0xef8d('0x19c')],_0x30a410[_0xef8d('0x96')])){_0x30a410['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x30a410[_0xef8d('0x96')]=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));loggerPredictive[_0xef8d('0x87')](_0x30a410[_0xef8d('0x44')],_0xef8d('0x1a8'),_0x30a410[_0xef8d('0x96')]);clearInterval(_0x30a410[_0xef8d('0x98')]);_0x30a410[_0xef8d('0x98')]=undefined;this[_0xef8d('0x1a4')](_0x30a410[_0xef8d('0x19c')])[_0xef8d('0xbc')](this[_0xef8d('0x1a5')](_0x30a410))[_0xef8d('0xbc')](mergeDataErlangB(_0x30a410))[_0xef8d('0xbc')](this[_0xef8d('0x1a6')](_0x30a410))[_0xef8d('0xb5')](loggerCatchPredictive(_0xef8d('0x1a9'),_0x30a410));}else if(_0x30a410[_0xef8d('0x196')]&&_0x1fda17<_0x30a410['predictiveIntervalAvailable']-_0x4c1a0c){freeVariablesPredictive(_0x30a410);loggerPredictive['info'](_0x30a410[_0xef8d('0x44')],_0xef8d('0x1aa'),_0x1fda17,')\x20are\x20less\x20than\x20threshold\x20(',_0x30a410[_0xef8d('0x196')],'-',_0x4c1a0c,'=',_0x30a410['predictiveIntervalAvailable']-_0x4c1a0c,')');}else if(_0x30a410[_0xef8d('0x196')]&&_0x1fda17>_0x30a410['predictiveIntervalAvailable']+_0x17a766){freeVariablesPredictive(_0x30a410);loggerPredictive['info'](_0x30a410[_0xef8d('0x44')],_0xef8d('0x1aa'),_0x1fda17,_0xef8d('0x1ab'),_0x30a410[_0xef8d('0x196')],'+',_0x17a766,'=',_0x30a410[_0xef8d('0x196')]+_0x17a766,')');}};Dialer[_0xef8d('0x1e')][_0xef8d('0x1a5')]=function(_0x58c379){var _0x57285c=this;return function(_0x39b341){return new BPromise(function(_0x1a0c72,_0x214cc0){_[_0xef8d('0x93')](_0x58c379,_0x39b341[0x0]);if(checkGetDataPredictive(_0x39b341[0x0])){var _0x4b9c88=_0x58c379[_0xef8d('0x196')]=_0x58c379[_0xef8d('0xa6')]+_0x58c379[_0xef8d('0x54')];var _0x4d6c55=_0x58c379[_0xef8d('0x19c')]*0x3c;var _0x9c06ad=_0x39b341[0x0][_0xef8d('0x70')]+_0x39b341[0x0][_0xef8d('0x6f')];var _0x402ad3=(_0x39b341[0x0][_0xef8d('0x6e')]+_0x39b341[0x0][_0xef8d('0x72')]+_0x39b341[0x0][_0xef8d('0x71')])/_0x39b341[0x0][_0xef8d('0x78')];_0x58c379[_0xef8d('0x75')]=_0x402ad3>0x0?_0x402ad3:0x1;switch(_0x58c379[_0xef8d('0x19e')]){case'dropRate':var _0x54729b=_0x58c379[_0xef8d('0x1ac')]/0x64;return _0x57285c['abandonmentRate'](_0x4b9c88,_0x4d6c55,_0x9c06ad,_0x402ad3,_0x54729b)[_0xef8d('0xbc')](function(_0x28b2cb){return _0x1a0c72(_0x28b2cb);});case'agentBusyFactor':var _0x9fc225=_0x58c379[_0xef8d('0x1ac')]/0x64;return _0x57285c[_0xef8d('0x1ad')](_0x4b9c88,_0x4d6c55,_0x9c06ad,_0x402ad3,_0x9fc225)['then'](function(_0x47f737){return _0x1a0c72(_0x47f737);});default:return _0x214cc0(msgResponse('[getDataPredictive]',_0xef8d('0x125'),_0xef8d('0x1ae')));}}else{return _0x214cc0(msgResponse(_0xef8d('0x1af'),_0xef8d('0x125'),_0xef8d('0x1b0')));}});};};Dialer[_0xef8d('0x1e')][_0xef8d('0x1b1')]=function(_0x698409){var _0x1a36c8=this;return function(_0x433005){return new BPromise(function(_0x5efb2a,_0x509995){_[_0xef8d('0x93')](_0x698409,_0x433005[0x0]);if(checkGetDataPredictive(_0x433005[0x0])){loggerPredictive[_0xef8d('0x87')](JSON[_0xef8d('0x81')](_0x433005[0x0]));if(_0x698409[_0xef8d('0x19e')]===_0xef8d('0x19f')){return _0x1a36c8['getVoiceQueueRtPauses'](_0x698409['id'])['then'](function(_0x2a85f1){var _0x1b65ba=_0x698409['loggedIn']-_0x2a85f1[0x0][_0xef8d('0x1b2')];var _0x4dc0be=_0x698409[_0xef8d('0x19c')]*0x3c;var _0x4a54e6=_0x433005[0x0][_0xef8d('0x70')]+_0x433005[0x0][_0xef8d('0x6f')];var _0x20104f=(_0x433005[0x0][_0xef8d('0x6e')]+_0x433005[0x0][_0xef8d('0x72')]+_0x433005[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x433005[0x0][_0xef8d('0x78')];var _0x7d2635=_0x698409[_0xef8d('0x1ac')]/0x64;_0x698409[_0xef8d('0x77')]=_0x2a85f1[0x0]['outboundQueuePauses']||0x0;_0x698409[_0xef8d('0x75')]=_0x20104f>0x0?_0x20104f:0x1;return _0x1a36c8['abandonmentRate'](_0x1b65ba,_0x4dc0be,_0x4a54e6,_0x20104f,_0x7d2635);})[_0xef8d('0xbc')](function(_0x4eac5b){return _0x5efb2a(_0x4eac5b);})[_0xef8d('0xb5')](function(_0x45a766){return _0x509995(msgResponse(_0xef8d('0x1b3'),_0xef8d('0x125'),JSON['stringify'](_0x45a766)));});}if(_0x698409[_0xef8d('0x19e')]===_0xef8d('0x1b4')){return _0x1a36c8[_0xef8d('0xc8')](_0x698409['id'])[_0xef8d('0xbc')](function(_0x5bd38c){var _0x487f7c=_0x698409[_0xef8d('0x1b5')]-_0x5bd38c[0x0][_0xef8d('0x1b2')];var _0x3c4676=_0x698409['dialPredictiveInterval']*0x3c;var _0x574403=_0x433005[0x0][_0xef8d('0x70')]+_0x433005[0x0]['predictiveIntervalAvgHoldtime'];var _0x2ad07f=(_0x433005[0x0][_0xef8d('0x6e')]+_0x433005[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x433005[0x0][_0xef8d('0x71')])/_0x433005[0x0][_0xef8d('0x78')];var _0x263583=_0x698409[_0xef8d('0x1ac')]/0x64;_0x698409['predictiveIntervalPauses']=_0x5bd38c[0x0][_0xef8d('0x1b2')]||0x0;_0x698409[_0xef8d('0x75')]=_0x2ad07f>0x0?_0x2ad07f:0x1;return _0x1a36c8[_0xef8d('0x1ad')](_0x487f7c,_0x3c4676,_0x574403,_0x2ad07f,_0x263583);})[_0xef8d('0xbc')](function(_0x4066e1){return _0x5efb2a(_0x4066e1);})[_0xef8d('0xb5')](function(_0xb8c9ce){return _0x509995(msgResponse(_0xef8d('0x1b3'),_0xef8d('0x125'),JSON['stringify'](_0xb8c9ce)));});}}else{return _0x509995(msgResponse('[getDataPredictive]',_0xef8d('0x125'),_0xef8d('0x1b0')));}});};};Dialer[_0xef8d('0x1e')][_0xef8d('0x1a6')]=function(_0x27e3f7){var _0x1fe0d6=this;return function(){var _0x5b9cbb=0x0;var _0x57f029=Math[_0xef8d('0x197')](_0x27e3f7['erlangCallToSecond']*0x3e8);if(_0x57f029>0x0){_0x57f029=_0x57f029<0x64?0x64:_0x57f029;loggerPredictive['info'](_0x27e3f7[_0xef8d('0x44')],'one\x20call\x20every:',_0x57f029,_0xef8d('0x4e'));_0x27e3f7[_0xef8d('0x98')]=setInterval(function(){_0x1fe0d6[_0xef8d('0x98')](_0x27e3f7);loggerPredictiveCalls[_0xef8d('0x87')]('[handlePredictive]',_0x5b9cbb+=0x1);},_0x57f029);}else{loggerPredictive['info'](_0x27e3f7[_0xef8d('0x44')],_0xef8d('0x1b6'));}};};Dialer[_0xef8d('0x1e')][_0xef8d('0x1b7')]=function(_0x261859,_0x42a954){var _0x790130=this;return function(_0x22855c){if(_[_0xef8d('0x4b')](_0x22855c)){if(_[_0xef8d('0xb1')](_0x42a954[_0xef8d('0xd2')])||!_0x42a954['recallme']){if(_0x261859[_0xef8d('0x5e')]===_0xef8d('0x9')){_0x261859[_0xef8d('0x10f')]=_[_0xef8d('0x41')](_0x261859[_0xef8d('0x10f')])?!![]:_0x261859[_0xef8d('0x10f')];var _0x151f15=uuid['v4']();_0x790130['actions'][_0x151f15]=new Action(_0x261859,_0x42a954,_0x151f15);loggerBooked[_0xef8d('0x87')](_0xef8d('0x1b8'),_0x151f15,'queueStatusComplete:\x20',JSON['stringify'](_0x261859['queueStatusComplete']),_0xef8d('0x1b9'),_0x261859[_0xef8d('0x44')]);if(_0x261859['queueStatusComplete']){_0x261859[_0xef8d('0x10f')]=![];_0x790130[_0xef8d('0x10b')][_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xb8')]]=[];ami[_0xef8d('0xb2')]({'actionid':_0x151f15,'action':_0xef8d('0x1ba'),'queue':_0x261859[_0xef8d('0x44')]})['catch'](function(_0x3802bf){_0x790130[_0xef8d('0xb7')](_0x261859);_0x790130[_0xef8d('0xc4')]({'active':![],'ContactId':_0x790130[_0xef8d('0x29')][_0x151f15]['ContactId'],'ListId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xd1')],'VoiceQueueId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xd3')]||undefined,'CampaignId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xd4')]||undefined})['catch'](loggerCatch(_0xef8d('0x1bb')));delete _0x790130[_0xef8d('0x29')][_0x151f15];});}else{loggerBooked[_0xef8d('0x87')](_0xef8d('0x1bc'),JSON[_0xef8d('0x81')](_0x261859['queueStatusComplete']),_0xef8d('0x1b9'),_0x261859['name']);_0x790130[_0xef8d('0xb7')](_0x261859);_0x790130[_0xef8d('0xc4')]({'active':![],'ContactId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0x11d')],'ListId':_0x790130['actions'][_0x151f15][_0xef8d('0xd1')],'VoiceQueueId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xd3')]||undefined,'CampaignId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xd4')]||undefined})['catch'](loggerCatch(_0xef8d('0x1bb')));delete _0x790130[_0xef8d('0x29')][_0x151f15];}}else{return _0x790130[_0xef8d('0x143')](_0x261859,_0x42a954);}}else{if(getDiff(_0x42a954['scheduledat'])<_0x261859[_0xef8d('0x1bd')]*0x3c){_0x790130[_0xef8d('0x23')][_0xef8d('0x112')](_0x42a954['id'])[_0xef8d('0x21')](function(){_0x790130[_0xef8d('0xb7')](_0x261859);});}else{_0x261859[_0xef8d('0x6b')]+=0x1;_0x790130['updateOriginated'](_0x261859);if(_0x261859[_0xef8d('0x1be')]){_0x790130[_0xef8d('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x42a954['ContactId'],'ListId':_0x42a954[_0xef8d('0xd1')],'VoiceQueueId':_0x42a954[_0xef8d('0xd3')]||undefined,'CampaignId':_0x42a954[_0xef8d('0xd4')]||undefined})['catch'](loggerCatch(_0xef8d('0x1bf')));_0x790130['createHistory'](createObjHistory(_0x261859,_0x42a954,'RECALLINQUEUE',0x17,_0xef8d('0x1c0')))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x1c1')));}else{_0x790130[_0xef8d('0xcf')](createObjHistory(_0x261859,_0x42a954,_0xef8d('0x1c2'),0x16,_0xef8d('0x1c3')),_0xef8d('0x1c4'),_0xef8d('0x1c5'));}}}}else{_0x261859[_0xef8d('0x63')]+=0x1;_0x790130[_0xef8d('0xcf')](createObjHistory(_0x261859,_0x42a954,_0xef8d('0x1c6'),0xd,_0xef8d('0x1c7')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0xef8d('0x1c8');}};};Dialer[_0xef8d('0x1e')][_0xef8d('0x13a')]=function(_0x313d45){var _0x3edfd3=this;var _0x564ccb=[];var _0x14a6c0=_0x313d45[_0xef8d('0x1c9')]-_0x313d45[_0xef8d('0x79')]-_0x313d45[_0xef8d('0x1ca')];emitCampaignSummary(_0x313d45);if(_0x14a6c0>0x0){if(_0x14a6c0>this[_0xef8d('0x1cb')]){_0x14a6c0=this[_0xef8d('0x1cb')];}_0x313d45[_0xef8d('0x1ca')]+=_0x14a6c0;this['getContactDialerIvr'](_0x313d45['id'],_0x14a6c0,_0x313d45[_0xef8d('0x1cc')])[_0xef8d('0xbc')](function(_0x33c56d){_0x313d45[_0xef8d('0x1ca')]-=_0x14a6c0;_0x313d45['temp']=_0x313d45[_0xef8d('0x1ca')]>0x0?_0x313d45[_0xef8d('0x1ca')]:0x0;if(!checkContactEmpty(_0x33c56d)){_0x313d45[_0xef8d('0x42')]=_0xef8d('0xa4');logger[_0xef8d('0x87')](_0xef8d('0x1cd')+_0x313d45[_0xef8d('0x44')]);}else{_0x313d45['originated']+=_0x33c56d['length'];_0x313d45[_0xef8d('0x42')]=_0xef8d('0x1ce');for(var _0x4a2c37=0x0;_0x4a2c37<_0x33c56d['length'];_0x4a2c37+=0x1){_0x313d45['ivrTotalCallsDays']+=0x1;if(_[_0xef8d('0xb1')](_0x33c56d[_0x4a2c37])||_[_0xef8d('0xb1')](_0x33c56d[_0x4a2c37][_0xef8d('0x146')])||_['isNil'](_0x33c56d[_0x4a2c37][_0xef8d('0x146')][_0xef8d('0x145')])){_0x3edfd3[_0xef8d('0x1cf')](_0xef8d('0x1d0'),_0x313d45,_0x33c56d[_0x4a2c37]);}else{_0x3edfd3[_0xef8d('0xc0')](_[_0xef8d('0xd0')](_0x33c56d[_0x4a2c37],[_0xef8d('0xd4'),_0xef8d('0x1d1')]))[_0xef8d('0xbc')](_0x3edfd3[_0xef8d('0x1b7')](_0x313d45,_0x33c56d[_0x4a2c37]))[_0xef8d('0xb5')](_0x3edfd3[_0xef8d('0xce')](_0xef8d('0x1d2'),_0x313d45));}}}})[_0xef8d('0xb5')](loggerGetContactDialer(_0xef8d('0x1d3'),_0x313d45,_0x14a6c0));}};Dialer[_0xef8d('0x1e')]['handlePower']=function(_0x37b7ab,_0x23fcc){var _0x4f2101=this;var _0x12deaf=[];var _0x30ab24=_0x23fcc>=0x1?_0x23fcc:0x1;var _0x10525a=[];if(_0x37b7ab[_0xef8d('0x5e')]===_0xef8d('0x9')){_0x30ab24=0x1;}var _0x3d0dd4=Math[_0xef8d('0x197')](_0x37b7ab[_0xef8d('0x54')]*_0x30ab24)-_0x37b7ab['originated']-_0x37b7ab[_0xef8d('0x1ca')];emitVoiceQueueSummary(_0x37b7ab);if(_0x37b7ab[_0xef8d('0x1d4')]>0x0){var _0x241eca=_0x37b7ab[_0xef8d('0x1d4')]-_0x37b7ab[_0xef8d('0x79')]-_0x37b7ab[_0xef8d('0xa6')]-_0x37b7ab[_0xef8d('0x1ca')]-_0x37b7ab[_0xef8d('0x55')];if(_0x3d0dd4>_0x241eca){_0x3d0dd4=_0x241eca;}}if(_0x3d0dd4>0x0){if(_0x37b7ab[_0xef8d('0x5e')]===_0xef8d('0x9')){_0x3d0dd4=0x1;}if(_0x3d0dd4>this[_0xef8d('0x1cb')]){_0x3d0dd4=this[_0xef8d('0x1cb')];}_0x37b7ab[_0xef8d('0x1ca')]+=_0x3d0dd4;for(var _0x691438 in this[_0xef8d('0x26')]){if(this[_0xef8d('0x26')][_0xef8d('0x15e')](_0x691438)){if(this[_0xef8d('0x26')][_0x691438][_0xef8d('0xe2')]==='not_inuse'&&this[_0xef8d('0x26')][_0x691438][_0xef8d('0xb3')]===_0xef8d('0xda')){_0x12deaf[_0xef8d('0x10c')](this[_0xef8d('0x26')][_0x691438]['id']);}}}this[_0xef8d('0xc5')](_0x37b7ab['id'],_0x12deaf,_0x3d0dd4,_0x37b7ab['dialOrderByScheduledAt'])['then'](function(_0x1834c8){_0x37b7ab[_0xef8d('0x1ca')]-=_0x3d0dd4;_0x37b7ab[_0xef8d('0x1ca')]=_0x37b7ab[_0xef8d('0x1ca')]>0x0?_0x37b7ab[_0xef8d('0x1ca')]:0x0;if(!checkContactEmpty(_0x1834c8)){_0x4f2101['countReScheduled'](_0x37b7ab)[_0xef8d('0xbc')](sendMessageReschedule(_0x37b7ab))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x37b7ab[_0xef8d('0x79')]+=_0x1834c8[_0xef8d('0x12c')];_0x37b7ab[_0xef8d('0x42')]=_0x37b7ab[_0xef8d('0x5e')]==='booked'?_0xef8d('0x14d'):_0xef8d('0x1ce');for(var _0x527baa=0x0;_0x527baa<_0x1834c8['length'];_0x527baa+=0x1){if(_[_0xef8d('0xb1')](_0x1834c8[_0x527baa])||_[_0xef8d('0xb1')](_0x1834c8[_0x527baa][_0xef8d('0x146')])||_[_0xef8d('0xb1')](_0x1834c8[_0x527baa][_0xef8d('0x146')][_0xef8d('0x145')])){_0x4f2101[_0xef8d('0x1cf')](_0xef8d('0x1d0'),_0x37b7ab,_0x1834c8[_0x527baa]);}else{_0x4f2101[_0xef8d('0x1d5')](_[_0xef8d('0xd0')](_0x1834c8[_0x527baa],['VoiceQueueId',_0xef8d('0x1d1')]))[_0xef8d('0xbc')](_0x4f2101[_0xef8d('0x1b7')](_0x37b7ab,_0x1834c8[_0x527baa]))['catch'](_0x4f2101['loggerHandler'](_0xef8d('0x1d0'),_0x37b7ab));}}}})[_0xef8d('0xb5')](loggerGetContactDialer(_0xef8d('0x1d6'),_0x37b7ab,_0x3d0dd4));}};Dialer[_0xef8d('0x1e')]['handlePredictive']=function(_0x109df5){var _0x5c5601=this;if(_0x109df5[_0xef8d('0x1d4')]>0x0){var _0x1410aa=_0x109df5[_0xef8d('0x1d4')]-_0x109df5[_0xef8d('0x79')]-_0x109df5[_0xef8d('0xa6')];if(_0x1410aa>0x0){this[_0xef8d('0x1d7')](_0x109df5);}else{loggerPredictiveCalls['info'](_0xef8d('0x1d8'));}}else{this['tryOriginatePredictive'](_0x109df5);}};Dialer[_0xef8d('0x1e')][_0xef8d('0x1d7')]=function(_0x1315b9){var _0x3bdf7c=this;var _0x2437a3=[];_0x1315b9[_0xef8d('0x79')]+=0x1;for(var _0x5c82cb in this['agents']){if(this[_0xef8d('0x26')][_0xef8d('0x15e')](_0x5c82cb)){if(this[_0xef8d('0x26')][_0x5c82cb][_0xef8d('0xe2')]===_0xef8d('0x1d9')&&this[_0xef8d('0x26')][_0x5c82cb][_0xef8d('0xb3')]===_0xef8d('0xda')){_0x2437a3[_0xef8d('0x10c')](this[_0xef8d('0x26')][_0x5c82cb]['id']);}}}this[_0xef8d('0xc5')](_0x1315b9['id'],_0x2437a3,0x1,_0x1315b9[_0xef8d('0x1cc')])[_0xef8d('0xbc')](function(_0x233666){if(!checkContactEmpty(_0x233666)){checkContactLowerLimitOriginate(_0x1315b9,0x1,0x0);_0x3bdf7c[_0xef8d('0xbd')](_0x1315b9)[_0xef8d('0xbc')](sendMessageReschedule(_0x1315b9))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xbe')));}else{_0x1315b9[_0xef8d('0x42')]='RUNNING';if(_[_0xef8d('0xb1')](_0x233666[0x0])||_[_0xef8d('0xb1')](_0x233666[0x0][_0xef8d('0x146')])||_[_0xef8d('0xb1')](_0x233666[0x0][_0xef8d('0x146')]['phone'])){_0x3bdf7c[_0xef8d('0x1cf')](_0xef8d('0x1d0'),_0x1315b9,_0x233666[0x0]);}else{_0x3bdf7c[_0xef8d('0x1d5')](_['pick'](_0x233666[0x0],['VoiceQueueId',_0xef8d('0x1d1')]))[_0xef8d('0xbc')](_0x3bdf7c[_0xef8d('0x1b7')](_0x1315b9,_0x233666[0x0]))[_0xef8d('0xb5')](_0x3bdf7c[_0xef8d('0xce')](_0xef8d('0x1da'),_0x1315b9));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x1315b9,0x1));emitVoiceQueueSummary(_0x1315b9);};Dialer[_0xef8d('0x1e')][_0xef8d('0x1db')]=function(_0x59614c,_0x4b745f,_0x19f709,_0x45bdf2,_0x4cff8a,_0x2892b8){loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1dc'));loggerPredictive['info'](_0xef8d('0x1dd'),_0x59614c);loggerPredictive[_0xef8d('0x87')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b745f);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1de'),_0x19f709);loggerPredictive[_0xef8d('0x87')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x45bdf2);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4cff8a);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1df'));return new BPromise(function(_0x4755bd,_0x1fb2e1){if(_0x59614c<=0x0||isNaN(_0x59614c)){return _0x1fb2e1(msgResponse(_0xef8d('0x1e0'),'Error','m\x20=\x20'+_0x59614c));}if(_0x19f709<=0x0||isNaN(_0x19f709)){return _0x1fb2e1(msgResponse(_0xef8d('0x1e0'),_0xef8d('0x4d'),_0xef8d('0x1e1')+_0x19f709));}if(_0x45bdf2<=0x0||isNaN(_0x45bdf2)){return _0x1fb2e1(msgResponse('[abandonmentRate]',_0xef8d('0x4d'),_0xef8d('0x1e2')+_0x45bdf2));}if(_0x4b745f<=0x0||isNaN(_0x4b745f)){return _0x1fb2e1(msgResponse(_0xef8d('0x1e0'),_0xef8d('0x4d'),_0xef8d('0x1e3')+_0x4b745f));}if(_0x4cff8a<=0x0||isNaN(_0x4cff8a)){return _0x1fb2e1(msgResponse(_0xef8d('0x1e0'),'Error',_0xef8d('0x1e4')+_0x4cff8a));}_0x2892b8=_0x2892b8||0x0;var _0xd20f86=0x1/_0x19f709;var _0x231d97=0x0;var _0x43585c=0x0;var _0x21bdb1=0x0;var _0x2a6378=0x0;for(var _0x47879e=0x0;_0x21bdb1<_0x4cff8a;_0x47879e+=0x1){_0x43585c=_0x47879e/_0x4b745f;_0x231d97=(_0x45bdf2*_0x43585c+_0x2892b8)/_0xd20f86;_0x21bdb1=erlangb(_0x231d97,_0x59614c);_0x2a6378=_0x231d97/_0x59614c*(0x1-erlangb(_0x231d97,_0x59614c));}return _0x4755bd({'erlangCalls':_0x47879e,'erlangCallToSecond':_0x4b745f/_0x47879e,'erlangAbandonmentRate':_0x21bdb1,'erlangBusyFactor':_0x2a6378});});};Dialer['prototype'][_0xef8d('0x1ad')]=function(_0xf36faf,_0x32afb0,_0x512ea8,_0x36e6c4,_0x12a236,_0x1f6acd){loggerPredictive['info'](_0xef8d('0x1e5'));loggerPredictive[_0xef8d('0x87')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf36faf);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1e6'),_0x32afb0);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1de'),_0x512ea8);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1e7'),_0x36e6c4);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1e8'),_0x12a236);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1df'));return new BPromise(function(_0x302323,_0x2650ad){if(_0xf36faf<=0x0||isNaN(_0xf36faf)){return _0x2650ad(msgResponse(_0xef8d('0x1e9'),_0xef8d('0x4d'),'m\x20=\x20'+_0xf36faf));}if(_0x512ea8<=0x0||isNaN(_0x512ea8)){return _0x2650ad(msgResponse(_0xef8d('0x1e9'),_0xef8d('0x4d'),_0xef8d('0x1e1')+_0x512ea8));}if(_0x36e6c4<=0x0||isNaN(_0x36e6c4)){return _0x2650ad(msgResponse('[busyFactor]',_0xef8d('0x4d'),_0xef8d('0x1e2')+_0x36e6c4));}if(_0x32afb0<=0x0||isNaN(_0x32afb0)){return _0x2650ad(msgResponse('[busyFactor]',_0xef8d('0x4d'),'interval\x20=\x20'+_0x32afb0));}if(_0x12a236<=0x0||isNaN(_0x12a236)){return _0x2650ad(msgResponse(_0xef8d('0x1e9'),_0xef8d('0x4d'),'Umin\x20=\x20'+_0x12a236));}_0x1f6acd=_0x1f6acd||0x0;var _0x7c8c77=0x1/_0x512ea8;var _0x7816d7=0x0;var _0x5b0544=0x0;var _0x20e1a5=0x0;var _0x5dab69=0x0;for(var _0x2a84c9=0x0;_0x5dab69<_0x12a236;_0x2a84c9+=0x1){_0x5b0544=_0x2a84c9/_0x32afb0;_0x7816d7=(_0x36e6c4*_0x5b0544+_0x1f6acd)/_0x7c8c77;_0x20e1a5=erlangb(_0x7816d7,_0xf36faf);_0x5dab69=_0x7816d7/_0xf36faf*(0x1-erlangb(_0x7816d7,_0xf36faf));}return _0x302323({'erlangCalls':_0x2a84c9,'erlangCallToSecond':_0x32afb0/_0x2a84c9,'erlangAbandonmentRate':_0x20e1a5,'erlangBusyFactor':_0x5dab69});});};module[_0xef8d('0x1ea')]=Dialer;
\ No newline at end of file
+var _0xd586=['variable','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','amd','[syncMachine][createHistory]','[syncHangupInAMDIvr]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','queueCallerAbandonCreateState','Abandoned','CALLEREXIT','syncQueueMember','actionid','strategy','locked','paused','stateinterface','rrmemory','push','pick','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','ContactId','CampaignId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','Action','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','handleIvr','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','dialTimezone','[syncQueueSummary]','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','object','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','originate','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateTimeout','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','reason','NoSuchNumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','[syncAgentComplete][createHistory][3]','createStateFinal','reason\x203\x20ringing\x20no\x20answer','stateGlobal','outboundBusyCallsDay','countglobal','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','startMethodPredictive','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','dialRecallMeTimeout','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[countReScheduled]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','newexten','syncNewExten','varset','syncVarSet','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','isEmpty','\x20INTERVAL_IS_NULL','Error','milliseconds','diff','emit','type','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','startProgressive','Trunk','active','stringify','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgHoldtime','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','outbound','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','enqueue','isNil','channel','catch','updateOriginated','campaigns','queue','[Dialer][checkChannel][ivr]','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','SIP/%s','status','reachable','unmonitored','createHistory','uniqueid'];(function(_0x3949bd,_0x21356c){var _0x5003b7=function(_0x12e459){while(--_0x12e459){_0x3949bd['push'](_0x3949bd['shift']());}};_0x5003b7(++_0x21356c);}(_0xd586,0x113));var _0x6d58=function(_0x548af6,_0x57dfde){_0x548af6=_0x548af6-0x0;var _0x120cf2=_0xd586[_0x548af6];return _0x120cf2;};'use strict';var util=require(_0x6d58('0x0'));var _=require(_0x6d58('0x1'));var BPromise=require(_0x6d58('0x2'));var uuid=require(_0x6d58('0x3'));var moment=require(_0x6d58('0x4'));var rr=require('rr');var md5=require(_0x6d58('0x5'));var Redis=require(_0x6d58('0x6'));var config=require('../../../config/environment/');var logger=require(_0x6d58('0x7'))(_0x6d58('0x8'));var loggerBooked=require(_0x6d58('0x7'))(_0x6d58('0x9'));var loggerPredictive=require(_0x6d58('0x7'))(_0x6d58('0xa'));var loggerPredictiveCalls=require(_0x6d58('0x7'))(_0x6d58('0xb'));var loggerSyncQueueSummary=require(_0x6d58('0x7'))(_0x6d58('0xc'));var ami=require(_0x6d58('0xd'));config[_0x6d58('0xe')]=_[_0x6d58('0xf')](config['redis'],{'host':_0x6d58('0x10'),'port':0x18eb});var io=require(_0x6d58('0x11'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x6d58('0x12'));var cmHopperHistory=require(_0x6d58('0x13'));var cmHopperBlack=require(_0x6d58('0x14'));var voiceQueueRt=require(_0x6d58('0x15'));var Action=require(_0x6d58('0x16'));var History=require(_0x6d58('0x17'));var Final=require(_0x6d58('0x18'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x6d58('0x19'));var Hangup=require(_0x6d58('0x1a'));var ipAgi=process[_0x6d58('0x1b')][_0x6d58('0x1c')]||_0x6d58('0x1d');var strategy={'rrmemory':'rrmemory','roundrobin':_0x6d58('0x1e')};var Sequence=function(){};Sequence[_0x6d58('0x1f')]['enqueue']=function(_0x5f0215){this[_0x6d58('0x20')]=this[_0x6d58('0x20')]?this['tail'][_0x6d58('0x21')](_0x5f0215):_0x5f0215();};function Dialer(_0x4b50d8,_0x409b42){this[_0x6d58('0x22')]=new Sequence();this[_0x6d58('0x23')]=_0x409b42;this[_0x6d58('0x24')]=_0x4b50d8[_0x6d58('0x24')];this['campaigns']=_0x4b50d8['campaigns'];this[_0x6d58('0x25')]=_0x4b50d8[_0x6d58('0x25')];this[_0x6d58('0x26')]=_0x4b50d8[_0x6d58('0x26')];this['maxNumberOriginate']=config[_0x6d58('0x27')]||0x2;this[_0x6d58('0x28')]={};this[_0x6d58('0x29')]={};this[_0x6d58('0x2a')]={};this[_0x6d58('0x2b')]={};this[_0x6d58('0x2c')]={};this[_0x6d58('0x2d')]={};this['startProgressive']={};this[_0x6d58('0x2e')]={};this[_0x6d58('0x2f')]={};this[_0x6d58('0x30')]={};ami['on'](_0x6d58('0x31'),this[_0x6d58('0x32')][_0x6d58('0x33')](this));ami['on'](_0x6d58('0x34'),this[_0x6d58('0x35')][_0x6d58('0x33')](this));ami['on'](_0x6d58('0x36'),this[_0x6d58('0x37')][_0x6d58('0x33')](this));ami['on'](_0x6d58('0x38'),this[_0x6d58('0x39')][_0x6d58('0x33')](this));ami['on']('custom:queuesummary',this[_0x6d58('0xc')][_0x6d58('0x33')](this));ami['on'](_0x6d58('0x3a'),this['syncHangup'][_0x6d58('0x33')](this));ami['on'](_0x6d58('0x3b'),this[_0x6d58('0x3c')][_0x6d58('0x33')](this));ami['on'](_0x6d58('0x3d'),this[_0x6d58('0x3e')][_0x6d58('0x33')](this));ami['on']('queuemember',this['syncQueueMember'][_0x6d58('0x33')](this));ami['on'](_0x6d58('0x3f'),this[_0x6d58('0x40')][_0x6d58('0x33')](this));this[_0x6d58('0x41')]();this[_0x6d58('0x42')]();}function isNotNull(_0x421d58){return _0x421d58!==null&&!_[_0x6d58('0x43')](_0x421d58);}function checkIsLoggedIn(_0x1ea163,_0x543799){return function(){if(_0x543799<=0x0){_0x1ea163[_0x6d58('0x44')]=_0x6d58('0x45');throw _0x1ea163['name']+_0x6d58('0x46');}};}function isActive(_0x32f4b9){return _0x32f4b9;}function checkIsActive(_0x5dcf0f,_0x30f97c){return function(){if(!isActive(_0x30f97c)){_0x5dcf0f['message']=_0x6d58('0x47');throw _0x5dcf0f[_0x6d58('0x48')]+_0x6d58('0x49');}};}function checkInterval(_0x37126f){return function(){if(!isNotNull(_0x37126f[_0x6d58('0x4a')])){_0x37126f[_0x6d58('0x44')]=_0x6d58('0x4b');throw _0x37126f[_0x6d58('0x48')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x37126f[_0x6d58('0x4a')][_0x6d58('0x4c')])){_0x37126f['message']=_0x6d58('0x4b');throw _0x37126f[_0x6d58('0x48')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x6d58('0x4d')](_0x37126f[_0x6d58('0x4a')][_0x6d58('0x4c')]))){_0x37126f[_0x6d58('0x44')]=_0x6d58('0x4b');throw _0x37126f['name']+_0x6d58('0x4e');}};}function msgResponse(_0x4ece96,_0x5df46c,_0x16f6f2){return{'action':_0x4ece96,'response':_0x5df46c,'message':_0x16f6f2,'stack':_0x16f6f2};}function myreject(_0x5671fd){return function(_0x5da541){return _0x5671fd(msgResponse('[ifTime][Action]',_0x6d58('0x4f'),JSON['stringify'](_0x5da541)));};}function getSeconds(_0x4f770a,_0x2fa113){var _0xd3b604=moment(_0x4f770a)['milliseconds'](0x0);var _0x32cc8a=moment(_0x2fa113)[_0x6d58('0x50')](0x0);return _0xd3b604[_0x6d58('0x51')](_0x32cc8a,'seconds');}function emit(_0x4cbede,_0x629ae6,_0xb7748d){io['to'](_0x4cbede)[_0x6d58('0x52')](_0x629ae6,_0xb7748d);}function emitVoiceQueueSummary(_0x1787fb){if(_0x1787fb[_0x6d58('0x53')]==='outbound'){var _0x3e39d6={'id':_0x1787fb['id'],'name':_0x1787fb[_0x6d58('0x48')],'strategy':_0x1787fb['strategy'],'answered':_0x1787fb['answered'],'available':_0x1787fb[_0x6d58('0x54')],'loggedIn':_0x1787fb[_0x6d58('0x55')],'pTalking':_0x1787fb[_0x6d58('0x56')],'sumBillable':_0x1787fb[_0x6d58('0x57')],'sumDuration':_0x1787fb[_0x6d58('0x58')],'sumHoldTime':_0x1787fb[_0x6d58('0x59')]||0x0,'talking':_0x1787fb[_0x6d58('0x5a')],'total':_0x1787fb['total'],'type':_0x1787fb[_0x6d58('0x53')],'unmanaged':_0x1787fb['unmanaged'],'abandoned':_0x1787fb['abandoned'],'waiting':_0x1787fb['waiting'],'loggedInDb':_0x1787fb[_0x6d58('0x5b')],'dialActive':_0x1787fb[_0x6d58('0x5c')],'dialMethod':_0x1787fb[_0x6d58('0x5d')],'dialOriginateCallerIdName':_0x1787fb[_0x6d58('0x5e')],'dialOriginateCallerIdNumber':_0x1787fb[_0x6d58('0x5f')],'dialOriginateTimeout':_0x1787fb['dialOriginateTimeout'],'dialPrefix':_0x1787fb[_0x6d58('0x60')],'outboundAnswerAgiCallsDay':_0x1787fb[_0x6d58('0x61')],'outboundAnswerCallsDay':_0x1787fb[_0x6d58('0x62')],'outboundBlacklistCallsDay':_0x1787fb[_0x6d58('0x63')],'outboundBusyCallsDay':_0x1787fb['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1787fb[_0x6d58('0x64')],'outboundDropCallsDayACS':_0x1787fb['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1787fb[_0x6d58('0x65')],'outboundDropCallsDayTimeout':_0x1787fb[_0x6d58('0x66')],'outboundNoAnswerCallsDay':_0x1787fb[_0x6d58('0x67')],'outboundNoSuchCallsDay':_0x1787fb[_0x6d58('0x68')],'outboundOriginateFailureCallsDay':_0x1787fb[_0x6d58('0x69')],'outboundReCallsDay':_0x1787fb[_0x6d58('0x6a')],'outboundRejectCallsDay':_0x1787fb[_0x6d58('0x6b')],'outboundUnknownCallsDay':_0x1787fb[_0x6d58('0x6c')],'predictiveIntervalAnsweredCalls':_0x1787fb[_0x6d58('0x6d')],'predictiveIntervalAvgHoldtime':_0x1787fb['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1787fb[_0x6d58('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x1787fb[_0x6d58('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x1787fb['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x1787fb['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1787fb[_0x6d58('0x70')],'predictiveIntervalHitRate':_0x1787fb[_0x6d58('0x71')],'predictiveIntervalMultiplicativeFactor':_0x1787fb['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1787fb[_0x6d58('0x72')],'predictiveIntervalAvailable':_0x1787fb[_0x6d58('0x73')],'predictiveIntervalTotalCalls':_0x1787fb[_0x6d58('0x74')],'message':_0x1787fb[_0x6d58('0x44')],'originated':_0x1787fb[_0x6d58('0x75')],'erlangCalls':_0x1787fb[_0x6d58('0x76')],'erlangCallToSecond':_0x1787fb[_0x6d58('0x77')],'erlangAbandonmentRate':_0x1787fb['erlangAbandonmentRate'],'erlangBusyFactor':_0x1787fb['erlangBusyFactor'],'startPredictive':_0x1787fb[_0x6d58('0x2d')],'startProgressive':_0x1787fb[_0x6d58('0x78')]};if(_0x1787fb[_0x6d58('0x79')]){_0x3e39d6[_0x6d58('0x79')]={'id':_0x1787fb['Trunk']['id'],'name':_0x1787fb[_0x6d58('0x79')][_0x6d58('0x48')],'active':_0x1787fb[_0x6d58('0x79')][_0x6d58('0x7a')],'callerid':_0x1787fb[_0x6d58('0x79')]['callerid']};}if(_0x1787fb[_0x6d58('0x4a')]){_0x3e39d6[_0x6d58('0x4a')]={'id':_0x1787fb[_0x6d58('0x4a')]['id'],'name':_0x1787fb[_0x6d58('0x4a')][_0x6d58('0x48')]};}var _0x2b19b7=md5(JSON[_0x6d58('0x7b')](_0x3e39d6));if(_0x1787fb[_0x6d58('0x5')]!==_0x2b19b7){_0x1787fb['md5']=_0x2b19b7;emit(util[_0x6d58('0x7c')]('voice:queue:%s',_0x3e39d6[_0x6d58('0x48')]),_0x6d58('0x7d'),_0x3e39d6);}}}function emitCampaignSummary(_0x2ec24f){if(_0x2ec24f[_0x6d58('0x53')]===_0x6d58('0x7e')){emit(util[_0x6d58('0x7c')](_0x6d58('0x7f'),_0x2ec24f[_0x6d58('0x48')]),_0x6d58('0x80'),_0x2ec24f);}}function checkGetDataPredictive(_0x55d8b3){if(isNotNull(_0x55d8b3)){if(!_[_0x6d58('0x4d')](_0x55d8b3)){loggerPredictive[_0x6d58('0x81')](_0x6d58('0x82'));loggerPredictive['info'](_0x6d58('0x83'),_0x55d8b3['predictiveIntervalTotalCalls']);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x84'),_0x55d8b3[_0x6d58('0x6d')]);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x85'),_0x55d8b3[_0x6d58('0x86')]);loggerPredictive[_0x6d58('0x81')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x55d8b3['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x87'),_0x55d8b3['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x6d58('0x88'),_0x55d8b3[_0x6d58('0x6e')]);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x89'));if(_0x55d8b3['predictiveIntervalTotalCalls']>0x0){if(!_[_0x6d58('0x43')](_0x55d8b3[_0x6d58('0x6e')])&&_0x55d8b3[_0x6d58('0x6e')]>0x0){return!![];}else{loggerPredictive[_0x6d58('0x81')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x6d58('0x43')](_0x55d8b3[_0x6d58('0x8a')])&&_0x55d8b3[_0x6d58('0x8a')]>0x0){return!![];}else{loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x6d58('0x81')](_0x6d58('0x8b'));}}else{loggerPredictive[_0x6d58('0x81')]('History\x20information\x20are\x20empty');}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x436089){return function(_0x3c0f46){loggerPredictive[_0x6d58('0x81')](_0x6d58('0x8c'));loggerPredictive[_0x6d58('0x81')](_0x6d58('0x8d'),_0x3c0f46['erlangCalls']);loggerPredictive[_0x6d58('0x81')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c0f46[_0x6d58('0x77')]);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x8e'),_0x3c0f46[_0x6d58('0x8f')]);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x90'),_0x3c0f46[_0x6d58('0x91')]);loggerPredictive['info'](_0x6d58('0x8e'),_0x3c0f46[_0x6d58('0x8f')]);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x89'));_[_0x6d58('0x92')](_0x436089,_0x3c0f46);};}function getDiff(_0x4639ae){var _0x2513c5=moment()[_0x6d58('0x50')](0x0);var _0x272078=moment(_0x4639ae)[_0x6d58('0x50')](0x0);return _0x2513c5['diff'](_0x272078,_0x6d58('0x93'));}function ifInterval(_0x51b4b0,_0x1a1e15){if(_[_0x6d58('0x43')](_0x1a1e15)){return![];}if(getDiff(_0x1a1e15)<_0x51b4b0*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x22b1a9){if(isNotNull(_0x22b1a9)){if(!_[_0x6d58('0x43')](_0x22b1a9['startProgressive'])){_0x22b1a9['startProgressive']=undefined;loggerPredictive[_0x6d58('0x81')](_0x22b1a9[_0x6d58('0x48')],_0x6d58('0x94'));}if(!_[_0x6d58('0x43')](_0x22b1a9[_0x6d58('0x2d')])){_0x22b1a9[_0x6d58('0x2d')]=undefined;loggerPredictive['info'](_0x22b1a9['name'],_0x6d58('0x95'));}if(!_[_0x6d58('0x43')](_0x22b1a9[_0x6d58('0x96')])){clearInterval(_0x22b1a9['handlePredictive']);_0x22b1a9['handlePredictive']=undefined;loggerPredictive['info'](_0x22b1a9[_0x6d58('0x48')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x5bfa69,_0x539729){if(_0x539729===0x0){return 0x0;}var _0x577d19=0x1;for(var _0x3ba479=0x1;_0x3ba479<=_0x539729;_0x3ba479+=0x1){_0x577d19=0x1+_0x577d19*_0x3ba479/_0x5bfa69;}return 0x1/_0x577d19;}function isVoiceQueueOutbound(_0x541747){return _0x541747===_0x6d58('0x97');}function isNotPreview(_0x16d724){return _0x16d724!=='preview';}function isCampaignIvr(_0x4e8f90){return _0x4e8f90==='ivr';}function getCallerId(_0x504a7c,_0x101e9b,_0xc31dbe){if(!_[_0x6d58('0x43')](_0xc31dbe)&&_0x6d58('0x98')===typeof _0xc31dbe&&!_[_0x6d58('0x4d')](_0xc31dbe)){if(!_[_0x6d58('0x43')](_0x101e9b)&&'string'===typeof _0x101e9b&&!_[_0x6d58('0x4d')](_0x101e9b)){return util['format']('\x22%s\x22\x20<%s>',_0x101e9b,_0xc31dbe);}return util[_0x6d58('0x7c')](_0x6d58('0x99'),_0xc31dbe,_0xc31dbe);}if(!_[_0x6d58('0x43')](_0x504a7c)&&_0x6d58('0x98')===typeof _0x504a7c&&!_[_0x6d58('0x4d')](_0x504a7c)){return _0x504a7c;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x3d4374,_0x4039e3){return function(_0x1886d6){freeVariablesPredictive(_0x4039e3);emitVoiceQueueSummary(_0x4039e3);emitCampaignSummary(_0x4039e3);loggerSyncQueueSummary[_0x6d58('0x9a')](_0x3d4374,util[_0x6d58('0x9b')](_0x1886d6,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3524fe,_0x121ff3){return function(_0x37c783){loggerPredictive[_0x6d58('0x9a')](_0x121ff3[_0x6d58('0x48')],_0x3524fe);loggerPredictive[_0x6d58('0x9a')](_0x37c783[_0x6d58('0x9c')]);freeVariablesPredictive(_0x121ff3);};}function loggerCatch(_0x3b9093){return function(_0x355638){logger[_0x6d58('0x9a')](_0x3b9093,util[_0x6d58('0x9b')](_0x355638,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3d5d07){return _0x3d5d07&&!_[_0x6d58('0x43')](_0x3d5d07)&&_0x3d5d07[_0x6d58('0x9d')]>0x0;}function decremetOriginate(_0x25e0e5){if(!_[_0x6d58('0x43')](_0x25e0e5)&&_0x25e0e5!==null){if(_0x25e0e5[_0x6d58('0x9e')](_0x6d58('0x75'))){if(_0x25e0e5[_0x6d58('0x75')]>0x0){_0x25e0e5[_0x6d58('0x75')]-=0x1;}else{logger[_0x6d58('0x9a')](_0x6d58('0x9f'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x56971c,_0x5e514b,_0x258321){if(_0x5e514b>_0x258321){for(var _0x74d420=0x0;_0x74d420<_0x5e514b-_0x258321;_0x74d420+=0x1){decremetOriginate(_0x56971c);}}}function loggerGetContactDialer(_0x54b585,_0x47b483,_0x5089f3){return function(_0x1f42d8){checkContactLowerLimitOriginate(_0x47b483,_0x5089f3,0x0);logger[_0x6d58('0x9a')](_0x54b585,util[_0x6d58('0x9b')](_0x1f42d8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3bde49){return function(_0x5c283){if(isNotNull(_0x5c283)&&isNotNull(_0x5c283[0x0])){if(_0x5c283[0x0][_0x6d58('0xa0')]>0x0){_0x3bde49[_0x6d58('0x44')]='RESCHEDULED_CONTACTS';logger[_0x6d58('0x81')](_0x6d58('0xa1')+_0x3bde49[_0x6d58('0x48')],_0x5c283[0x0][_0x6d58('0xa0')],_0x6d58('0xa2'));}else{_0x3bde49[_0x6d58('0x44')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x6d58('0xa3')+_0x3bde49[_0x6d58('0x48')]);}}};}function notSendMessagesQueue(_0x576916){if(_0x576916[_0x6d58('0xa4')]){freeVariablesPredictive(_0x576916);if(_0x576916[_0x6d58('0x75')]===0x0&&_0x576916[_0x6d58('0x5a')]===0x0&&_0x576916['waiting']===0x0&&(_0x576916['pTalking']||0x0)===0x0){_0x576916['sendMessageOneNotActive']=![];_0x576916[_0x6d58('0x54')]=0x0;_0x576916['message']='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0x6d58('0xa5'),_0x576916[_0x6d58('0x48')],_0x6d58('0xa6'));}else{_0x576916[_0x6d58('0x44')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0x6d58('0xa5'),_0x576916['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x576916);}}function notSendMessagesCampaign(_0x1ed686){if(_0x1ed686[_0x6d58('0xa4')]){if(_0x1ed686[_0x6d58('0x75')]===0x0){_0x1ed686[_0x6d58('0xa4')]=![];_0x1ed686[_0x6d58('0x44')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x6d58('0x9a')](_0x6d58('0xa7'),_0x1ed686[_0x6d58('0x48')],_0x6d58('0xa6'));}else{_0x1ed686[_0x6d58('0x44')]=_0x6d58('0xa8');loggerSyncQueueSummary[_0x6d58('0x9a')](_0x6d58('0xa7'),_0x1ed686['name'],_0x6d58('0xa9'));}emitCampaignSummary(_0x1ed686);}}function createObjHistory(_0x1c504a,_0x1c32a9,_0x1f8209,_0x16b424,_0x1917aa){_0x1c504a[_0x6d58('0x44')]=_0x1f8209;var _0x3808a0=new Action(_0x1c504a,_0x1c32a9);var _0x3169a5=new History(_0x3808a0);_0x3169a5[_0x6d58('0xaa')]=_0x16b424;_0x3169a5[_0x6d58('0xab')]=_0x1917aa;_0x3169a5[_0x6d58('0xac')]=_0x3808a0[_0x6d58('0xad')];return _0x3169a5;}Dialer[_0x6d58('0x1f')][_0x6d58('0x42')]=function(){var _0x29e945=this;setInterval(function(){_0x29e945[_0x6d58('0xae')](_0x29e945[_0x6d58('0x2b')],_0x6d58('0xaf'));_0x29e945[_0x6d58('0xae')](_0x29e945['actions'],'[actions]');},0x32c8);};Dialer['prototype'][_0x6d58('0xae')]=function(_0x1732b0,_0x3575e3){var _0x27aeb1=this;for(var _0x141898 in _0x1732b0){if(_0x1732b0[_0x6d58('0x9e')](_0x141898)){this[_0x6d58('0x22')][_0x6d58('0xb0')](function(){if(!_[_0x6d58('0xb1')](_0x1732b0[_0x141898])){return ami['Action']({'action':'status','channel':_0x1732b0[_0x141898][_0x6d58('0xb2')]})[_0x6d58('0xb3')](function(_0x256e92){if(_0x256e92['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x1732b0[_0x141898]&&_0x1732b0[_0x141898][_0x6d58('0x53')]!=='ivr'){_0x27aeb1['updateOriginated'](_0x27aeb1['voiceQueues'][_0x1732b0[_0x141898]['queue']]);logger[_0x6d58('0x9a')]('[Dialer][checkChannel]',_0x3575e3,_0x141898,_0x1732b0[_0x141898]['queue']);delete _0x1732b0[_0x141898];}if(_0x1732b0[_0x141898]&&_0x1732b0[_0x141898]['type']===_0x6d58('0x7e')){_0x27aeb1[_0x6d58('0xb4')](_0x27aeb1[_0x6d58('0xb5')][_0x1732b0[_0x141898][_0x6d58('0xb6')]]);logger['error'](_0x6d58('0xb7'),_0x3575e3,_0x141898,_0x1732b0[_0x141898][_0x6d58('0xb6')]);delete _0x1732b0[_0x141898];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x26b3f5){return BPromise[_0x6d58('0xb8')]()[_0x6d58('0xb9')](cmHopper['countReScheduled'](_0x26b3f5))[_0x6d58('0xb3')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x6d58('0xba')]=function(_0x319a72){return BPromise[_0x6d58('0xb8')]()['then'](cmHopperBlack['checkIsBlackList'](_0x319a72))[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xbb')));};Dialer[_0x6d58('0x1f')][_0x6d58('0xbc')]=function(_0x5dfaa9){return BPromise[_0x6d58('0xb8')]()[_0x6d58('0xb9')](cmHopperBlack[_0x6d58('0xbc')](_0x5dfaa9))['catch'](loggerCatch(_0x6d58('0xbd')));};Dialer[_0x6d58('0x1f')][_0x6d58('0xbe')]=function(_0x41068d){return BPromise['resolve']()[_0x6d58('0xb9')](cmHopperHistory[_0x6d58('0xbf')](_0x41068d))[_0x6d58('0xb3')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0x6d58('0xc0')]=function(_0x489f60){return BPromise['resolve']()[_0x6d58('0xb9')](cmHopper['rescheduleContact'](_0x489f60))['catch'](loggerCatch(_0x6d58('0xc1')));};Dialer[_0x6d58('0x1f')][_0x6d58('0xc2')]=function(_0x48b78f,_0x5e0adf,_0x4f0416,_0x4f18a1){return BPromise[_0x6d58('0xb8')]()[_0x6d58('0xb9')](cmHopper[_0x6d58('0xc2')](_0x48b78f,_0x5e0adf,_0x4f0416,_0x4f18a1))[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xc3')));};Dialer['prototype'][_0x6d58('0xc4')]=function(_0x26ff9a,_0xd677c9,_0xa3f079){return BPromise[_0x6d58('0xb8')]()[_0x6d58('0xb9')](cmHopper[_0x6d58('0xc4')](_0x26ff9a,_0xd677c9,_0xa3f079))[_0x6d58('0xb3')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x6d58('0x1f')][_0x6d58('0xc5')]=function(_0x3b604e){return BPromise['resolve']()[_0x6d58('0xb9')](voiceQueueRt[_0x6d58('0xc5')](_0x3b604e))[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xc6')));};Dialer[_0x6d58('0x1f')][_0x6d58('0xc7')]=function(_0x566a6e){return BPromise[_0x6d58('0xb8')]()[_0x6d58('0xb9')](cmHopper[_0x6d58('0xc7')](_0x566a6e))['catch'](loggerCatch(_0x6d58('0xc8')));};Dialer['prototype']['createHistory']=function(_0x20e531){return BPromise['resolve']()[_0x6d58('0xb9')](cmHopperHistory['createHistory'](_0x20e531))[_0x6d58('0xb3')](loggerCatch('[createHistory]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x310157){if(!_[_0x6d58('0x43')](_0x310157)&&_0x310157!==null){if(_0x310157[_0x6d58('0x9e')](_0x6d58('0x75'))){if(_0x310157[_0x6d58('0x75')]>0x0){_0x310157[_0x6d58('0x75')]-=0x1;}else{logger['error'](_0x6d58('0xc9'));}}}else{logger[_0x6d58('0x9a')](_0x6d58('0xca'));}};Dialer[_0x6d58('0x1f')][_0x6d58('0xcb')]=function(_0x3de3ab,_0x1c05aa){var _0x5ac479=this;return function(_0x2a4394){_0x5ac479['updateOriginated'](_0x1c05aa);logger[_0x6d58('0x9a')](_0x3de3ab,util[_0x6d58('0x9b')](_0x2a4394,{'showHidden':![],'depth':null}));};};Dialer[_0x6d58('0x1f')][_0x6d58('0xcc')]=function(_0xc26dc5,_0x16819f,_0x52ff88){var _0x2d23b8={'state':0x19,'statedesc':_0x6d58('0xcd')};this[_0x6d58('0xb4')](_0x16819f);this[_0x6d58('0xce')](_['merge'](_0x2d23b8,_['pick'](_0x52ff88,['ContactId',_0x6d58('0xcf'),_0x6d58('0xd0'),_0x6d58('0xd1'),'CampaignId'])),_0x6d58('0xd2'),'[emptyContact]');logger[_0x6d58('0x9a')](_0xc26dc5);};Dialer[_0x6d58('0x1f')][_0x6d58('0xd3')]=function(_0x1c280d){return _0x1c280d==='Success';};Dialer['prototype'][_0x6d58('0xd4')]=function(_0x4574bc){return!_[_0x6d58('0x43')](_0x4574bc)&&_0x4574bc&&!_[_0x6d58('0x43')](_0x4574bc[_0x6d58('0x48')])&&!_['isUndefined'](_0x4574bc['active'])&&_0x4574bc[_0x6d58('0x7a')]&&(this[_0x6d58('0x26')][util[_0x6d58('0x7c')](_0x6d58('0xd5'),_0x4574bc[_0x6d58('0x48')])][_0x6d58('0xd6')]===_0x6d58('0xd7')||this[_0x6d58('0x26')][util[_0x6d58('0x7c')](_0x6d58('0xd5'),_0x4574bc[_0x6d58('0x48')])]['status']===_0x6d58('0xd8'));};Dialer['prototype'][_0x6d58('0xce')]=function(_0x3bf5a8,_0x57f9e8,_0x13592a){this[_0x6d58('0xd9')](_0x3bf5a8)[_0x6d58('0xb3')](loggerCatch(_0x57f9e8));this[_0x6d58('0xc7')](_0x3bf5a8)[_0x6d58('0xb3')](loggerCatch(_0x13592a));};Dialer[_0x6d58('0x1f')][_0x6d58('0x3e')]=function(_0x190290){var _0x413841=this[_0x6d58('0x2b')][_0x190290[_0x6d58('0xda')]];var _0x3cea35;if(!_[_0x6d58('0xb1')](_0x190290)&&!_[_0x6d58('0xb1')](_0x190290[_0x6d58('0xdb')])&&!_['isNil'](_0x190290[_0x6d58('0xdb')]['amdstatus'])&&_0x190290['exten']==='xcally-motion-dialer'&&_0x413841){if(_0x413841[_0x6d58('0x53')]!==_0x6d58('0x7e')&&this['voiceQueues'][_0x413841[_0x6d58('0xb6')]][_0x6d58('0xdc')]&&_0x190290[_0x6d58('0xdd')]===_0x6d58('0xde')){delete this['uniqueId'][_0x190290[_0x6d58('0xda')]];this[_0x6d58('0xb4')](this[_0x6d58('0x24')][_0x413841[_0x6d58('0xb6')]]);this[_0x6d58('0x24')][_0x413841[_0x6d58('0xb6')]][_0x6d58('0x62')]+=0x1;this[_0x6d58('0x24')][_0x413841[_0x6d58('0xb6')]][_0x6d58('0x61')]+=0x1;_0x3cea35=new Hangup(_0x413841,_0x190290);_0x3cea35[_0x6d58('0xaa')]=0x12;_0x3cea35[_0x6d58('0xab')]=_0x6d58('0xdf');_0x3cea35[_0x6d58('0xe0')]=_0x6d58('0xe1');this[_0x6d58('0xce')](_0x3cea35,_0x6d58('0xe2'),_0x6d58('0xe3'));}if(_0x413841[_0x6d58('0x53')]!=='ivr'&&this[_0x6d58('0x24')][_0x413841['queue']][_0x6d58('0xdc')]&&_0x190290[_0x6d58('0xdd')]===_0x6d58('0xe4')){delete this[_0x6d58('0x2b')][_0x190290[_0x6d58('0xda')]];this[_0x6d58('0xb4')](this[_0x6d58('0x24')][_0x413841['queue']]);this[_0x6d58('0x24')][_0x413841[_0x6d58('0xb6')]][_0x6d58('0x62')]+=0x1;this[_0x6d58('0x24')][_0x413841[_0x6d58('0xb6')]][_0x6d58('0x61')]+=0x1;_0x3cea35=new Hangup(_0x413841,_0x190290);_0x3cea35[_0x6d58('0xaa')]=0x13;_0x3cea35[_0x6d58('0xab')]=_0x6d58('0xe5');_0x3cea35[_0x6d58('0xe0')]=_0x6d58('0xe1');_0x3cea35[_0x6d58('0xe6')]=!![];this[_0x6d58('0xce')](_0x3cea35,_0x6d58('0xe7'),'[syncMachine]');}if(_0x413841[_0x6d58('0x53')]==='ivr'&&this[_0x6d58('0xb5')][_0x413841[_0x6d58('0xb6')]]['dialAMDActive']&&_0x190290[_0x6d58('0xdd')]===_0x6d58('0xde')){delete this[_0x6d58('0x2b')][_0x190290['uniqueid']];this[_0x6d58('0xb4')](this[_0x6d58('0xb5')][_0x413841[_0x6d58('0xb6')]]);_0x3cea35=new Hangup(_0x413841,_0x190290);_0x3cea35['state']=0x12;_0x3cea35[_0x6d58('0xab')]=_0x6d58('0xdf');_0x3cea35[_0x6d58('0xe0')]=_0x6d58('0xe1');this[_0x6d58('0xce')](_0x3cea35,'[syncHangupInAMDIvr][createHistory]',_0x6d58('0xe8'));}if(_0x413841[_0x6d58('0x53')]===_0x6d58('0x7e')&&this[_0x6d58('0xb5')][_0x413841[_0x6d58('0xb6')]][_0x6d58('0xdc')]&&_0x190290[_0x6d58('0xdd')]===_0x6d58('0xe4')){delete this[_0x6d58('0x2b')][_0x190290[_0x6d58('0xda')]];this[_0x6d58('0xb4')](this['campaigns'][_0x413841[_0x6d58('0xb6')]]);_0x3cea35=new Hangup(_0x413841,_0x190290);_0x3cea35['state']=0x13;_0x3cea35[_0x6d58('0xab')]=_0x6d58('0xe5');_0x3cea35[_0x6d58('0xe0')]=_0x6d58('0xe1');_0x3cea35[_0x6d58('0xe6')]=!![];this[_0x6d58('0xce')](_0x3cea35,'[syncMachineIvr][createHistory]','[syncMachineIvr]');}}};Dialer[_0x6d58('0x1f')][_0x6d58('0xe9')]=function(_0x651eb6){var _0x5fda2e=this['uniqueId'][_0x651eb6[_0x6d58('0xda')]];var _0x234682=this;var _0x1b959f;if(_0x5fda2e&&_0x5fda2e[_0x6d58('0x53')]==='ivr'){delete this[_0x6d58('0x2b')][_0x651eb6['uniqueid']];this['updateOriginated'](this[_0x6d58('0xb5')][_0x5fda2e[_0x6d58('0xb6')]]);this[_0x6d58('0xb5')][_0x5fda2e[_0x6d58('0xb6')]][_0x6d58('0xea')]+=0x1;_0x1b959f=new Hangup(_0x5fda2e,_0x651eb6);this[_0x6d58('0xd9')](_0x1b959f)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xeb')));this[_0x6d58('0xc7')](_0x1b959f)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xec')));}if(_0x5fda2e&&_0x5fda2e[_0x6d58('0x53')]!==_0x6d58('0x7e')&&isNotNull(this[_0x6d58('0x24')][_0x5fda2e[_0x6d58('0xb6')]][_0x6d58('0xed')])){delete this[_0x6d58('0x2b')][_0x651eb6['uniqueid']];this[_0x6d58('0xb4')](this[_0x6d58('0x24')][_0x5fda2e[_0x6d58('0xb6')]]);this['voiceQueues'][_0x5fda2e[_0x6d58('0xb6')]][_0x6d58('0x62')]+=0x1;this['voiceQueues'][_0x5fda2e[_0x6d58('0xb6')]][_0x6d58('0x61')]+=0x1;_0x1b959f=new Hangup(_0x5fda2e,_0x651eb6);_0x1b959f[_0x6d58('0xaa')]=0x10;_0x1b959f['statedesc']=_0x6d58('0xee');_0x1b959f[_0x6d58('0xe0')]='AGI';this[_0x6d58('0xd9')](_0x1b959f)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xeb')));this[_0x6d58('0xc7')](_0x1b959f)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xec')));}if(_0x5fda2e&&_0x5fda2e[_0x6d58('0x53')]!==_0x6d58('0x7e')&&!isNotNull(this[_0x6d58('0x24')][_0x5fda2e[_0x6d58('0xb6')]][_0x6d58('0xed')])){delete this['uniqueId'][_0x651eb6[_0x6d58('0xda')]];this[_0x6d58('0xb4')](this[_0x6d58('0x24')][_0x5fda2e[_0x6d58('0xb6')]]);this[_0x6d58('0x24')][_0x5fda2e[_0x6d58('0xb6')]][_0x6d58('0x6c')]+=0x1;_0x1b959f=new Hangup(_0x5fda2e,_0x651eb6);_0x1b959f['state']=0xc;_0x1b959f[_0x6d58('0xab')]=_0x651eb6[_0x6d58('0xef')];_0x1b959f[_0x6d58('0xe0')]=_0x6d58('0xf0');this[_0x6d58('0xd9')](_0x1b959f)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xeb')));this[_0x6d58('0xc7')](_0x1b959f)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xec')));}};Dialer[_0x6d58('0x1f')]['syncAgentComplete']=function(_0x1e39b2){var _0x4d3ef5=this[_0x6d58('0x2b')][_0x1e39b2[_0x6d58('0xda')]];var _0x4ad751=this;if(this['voiceQueues'][_0x1e39b2[_0x6d58('0xb6')]]){if(_0x4d3ef5&&_0x4d3ef5[_0x6d58('0x53')]!==_0x6d58('0x7e')){delete this['uniqueId'][_0x1e39b2[_0x6d58('0xda')]];this['voiceQueues'][_0x1e39b2[_0x6d58('0xb6')]]['outboundAnswerCallsDay']+=0x1;var _0x3a4041=new AgentComplete(_0x4d3ef5,_0x1e39b2);if(_0x1e39b2['reason']===_0x6d58('0xf1')){_0x3a4041[_0x6d58('0xf2')]=this[_0x6d58('0x24')][_0x1e39b2['queue']][_0x6d58('0xf3')]&&this[_0x6d58('0x24')][_0x1e39b2[_0x6d58('0xb6')]][_0x6d58('0xf4')]?moment()[_0x6d58('0x7c')](_0x6d58('0xf5')):undefined;}this[_0x6d58('0xd9')](_0x3a4041)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xf6')));this[_0x6d58('0xc7')](_0x3a4041)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xf7')));}}};Dialer[_0x6d58('0x1f')][_0x6d58('0x32')]=function(_0x36c6de){if(this[_0x6d58('0x24')][_0x36c6de[_0x6d58('0xb6')]]){if(this['uniqueId'][_0x36c6de[_0x6d58('0xda')]]&&this[_0x6d58('0x2b')][_0x36c6de[_0x6d58('0xda')]][_0x6d58('0x53')]!=='ivr'){this[_0x6d58('0xb4')](this[_0x6d58('0x24')][_0x36c6de[_0x6d58('0xb6')]]);this[_0x6d58('0x2b')][_0x36c6de[_0x6d58('0xda')]][_0x6d58('0xf8')]=moment()[_0x6d58('0x7c')](_0x6d58('0xf5'));}}};Dialer[_0x6d58('0x1f')]['queueCallerAbandonCreateState']=function(_0x3da1e5){this[_0x6d58('0xd9')](_0x3da1e5)[_0x6d58('0xb3')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x6d58('0xc7')](_0x3da1e5)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0xf9')));};Dialer[_0x6d58('0x1f')]['syncQueueCallerAbandon']=function(_0x39128f){var _0xa86fc3=this[_0x6d58('0x2b')][_0x39128f[_0x6d58('0xda')]];var _0x5d5acf=this;if(this[_0x6d58('0x24')][_0x39128f[_0x6d58('0xb6')]]){if(_0xa86fc3&&_0xa86fc3[_0x6d58('0x53')]!==_0x6d58('0x7e')){delete this[_0x6d58('0x2b')][_0x39128f[_0x6d58('0xda')]];this[_0x6d58('0xb4')](this['voiceQueues'][_0x39128f[_0x6d58('0xb6')]]);_0xa86fc3['droptime']=moment()[_0x6d58('0x7c')](_0x6d58('0xf5'));var _0x48cd3f=new QueueCallerAbandon(_0xa86fc3,_0x39128f);if(getSeconds(_0xa86fc3[_0x6d58('0xfa')],_0xa86fc3[_0x6d58('0xfb')])>=_0xa86fc3[_0x6d58('0xfc')]){this['voiceQueues'][_0x39128f[_0x6d58('0xb6')]][_0x6d58('0x86')]+=0x1;this[_0x6d58('0x24')][_0x39128f[_0x6d58('0xb6')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x6d58('0x24')][_0x39128f[_0x6d58('0xb6')]][_0x6d58('0x70')]+=0x1;_0x48cd3f[_0x6d58('0xaa')]=0xa;_0x48cd3f[_0x6d58('0xab')]=_0x6d58('0xfd');_0x48cd3f[_0x6d58('0xfe')]='TIMEOUT';_0x48cd3f[_0x6d58('0xf2')]=this['voiceQueues'][_0x39128f[_0x6d58('0xb6')]][_0x6d58('0xf3')]?moment()[_0x6d58('0x7c')](_0x6d58('0xf5')):undefined;this[_0x6d58('0xff')](_0x48cd3f);}else{this[_0x6d58('0x24')][_0x39128f[_0x6d58('0xb6')]][_0x6d58('0x6f')]+=0x1;this[_0x6d58('0x24')][_0x39128f[_0x6d58('0xb6')]][_0x6d58('0x65')]+=0x1;_0x48cd3f[_0x6d58('0xaa')]=0xb;_0x48cd3f[_0x6d58('0xab')]=_0x6d58('0x100');_0x48cd3f[_0x6d58('0xfe')]=_0x6d58('0x101');this[_0x6d58('0xff')](_0x48cd3f);}}}};Dialer[_0x6d58('0x1f')][_0x6d58('0x3c')]=function(_0x508bcc){if(this[_0x6d58('0x29')][_0x508bcc['uniqueid']]){this[_0x6d58('0x29')][_0x508bcc[_0x6d58('0xda')]]['channel']=_0x508bcc[_0x6d58('0xb2')];}if(this[_0x6d58('0x2b')][_0x508bcc['uniqueid']]){this[_0x6d58('0x2b')][_0x508bcc['uniqueid']][_0x6d58('0xb2')]=_0x508bcc[_0x6d58('0xb2')];}};Dialer[_0x6d58('0x1f')][_0x6d58('0x102')]=function(_0x282779){if(strategy[this[_0x6d58('0x24')][this['actions'][_0x282779[_0x6d58('0x103')]][_0x6d58('0xb6')]][_0x6d58('0x104')]]===_0x6d58('0x1e')){if(this[_0x6d58('0x29')][_0x282779[_0x6d58('0x103')]]&&_['isNil'](this[_0x6d58('0x29')][_0x282779[_0x6d58('0x103')]][_0x6d58('0x105')])&&_0x282779[_0x6d58('0xd6')]==='1'&&_0x282779[_0x6d58('0x106')]==='0'){if(this[_0x6d58('0x25')][_0x282779[_0x6d58('0x107')]]){if(!this[_0x6d58('0x25')][_0x282779[_0x6d58('0x107')]][_0x6d58('0x105')]){this[_0x6d58('0x25')][_0x282779[_0x6d58('0x107')]][_0x6d58('0x105')]=!![];this[_0x6d58('0x29')][_0x282779['actionid']][_0x6d58('0x105')]=!![];this[_0x6d58('0x29')][_0x282779['actionid']][_0x6d58('0x107')]=_0x282779['stateinterface'];}}}}else if((strategy[this[_0x6d58('0x24')][this[_0x6d58('0x29')][_0x282779[_0x6d58('0x103')]][_0x6d58('0xb6')]]['strategy']]||'rrmemory')===_0x6d58('0x108')){if(this[_0x6d58('0x29')][_0x282779[_0x6d58('0x103')]]){if(this[_0x6d58('0x25')][_0x282779[_0x6d58('0x107')]]){this[_0x6d58('0x29')][_0x282779[_0x6d58('0x103')]]['stateinterface']=_0x282779[_0x6d58('0x107')];if(_[_0x6d58('0xb1')](this['queueBooked'][this[_0x6d58('0x29')][_0x282779[_0x6d58('0x103')]][_0x6d58('0xb6')]])){this[_0x6d58('0x2f')][this[_0x6d58('0x29')][_0x282779['actionid']][_0x6d58('0xb6')]]=[];}this[_0x6d58('0x2f')][this['actions'][_0x282779[_0x6d58('0x103')]][_0x6d58('0xb6')]][_0x6d58('0x109')](_[_0x6d58('0x92')](_[_0x6d58('0x10a')](this[_0x6d58('0x29')][_0x282779[_0x6d58('0x103')]],[_0x6d58('0x10b'),'stateinterface']),{'status':_0x282779['status'],'paused':_0x282779[_0x6d58('0x106')]}));}}}};function unlockQueueStatus(_0x266f5a,_0x34b35d){setTimeout(function(){if(_[_0x6d58('0x43')](_0x266f5a[_0x6d58('0x10c')])){loggerBooked[_0x6d58('0x9a')]('[unlockQueueStatus][undefined]',_0x34b35d);}_0x266f5a[_0x6d58('0x10c')]=!![];loggerBooked['info'](_0x6d58('0x10d'),_0x34b35d,JSON['stringify'](_[_0x6d58('0x10a')](_0x266f5a,['name','queueStatusComplete'])));},0x1f3);}Dialer[_0x6d58('0x1f')]['syncQueueStatusComplete']=function(_0x34767f){var _0xd9fec0=this;var _0x1dd642=_0xd9fec0[_0x6d58('0x24')][_0xd9fec0[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]][_0x6d58('0xb6')]];if(strategy[this['voiceQueues'][this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]][_0x6d58('0xb6')]][_0x6d58('0x104')]]==='roundrobin'){if(this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]]&&this['actions'][_0x34767f['actionid']][_0x6d58('0x107')]){this[_0x6d58('0x23')][_0x6d58('0x10e')](this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]][_0x6d58('0x10b')],this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]][_0x6d58('0x107')])[_0x6d58('0xb3')](function(_0x584d86){logger[_0x6d58('0x9a')](_0x6d58('0x10f'),util[_0x6d58('0x9b')](_0x584d86,{'showHidden':![],'depth':null}));})[_0x6d58('0x21')](function(){_0xd9fec0[_0x6d58('0xb4')](_0xd9fec0[_0x6d58('0x24')][_0xd9fec0[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]]['queue']]);_0xd9fec0['agents'][_0xd9fec0[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]]['stateinterface']]['locked']=![];delete _0xd9fec0[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]];unlockQueueStatus(_0x1dd642);});}else{this[_0x6d58('0xb4')](this[_0x6d58('0x24')][this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x6d58('0x29')][_0x34767f['actionid']][_0x6d58('0x110')],'ListId':this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]]['ListId'],'VoiceQueueId':this['actions'][_0x34767f[_0x6d58('0x103')]][_0x6d58('0xd1')]||undefined,'CampaignId':this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]][_0x6d58('0x111')]||undefined})[_0x6d58('0xb3')](loggerCatch(_0x6d58('0x112')));delete this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]];unlockQueueStatus(_0x1dd642);}}else if((strategy[this[_0x6d58('0x24')][this['actions'][_0x34767f[_0x6d58('0x103')]]['queue']]['strategy']]||_0x6d58('0x108'))===_0x6d58('0x108')){var _0x15ae48;if(this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]]&&!_[_0x6d58('0x4d')](this['queueBooked'][this[_0x6d58('0x29')][_0x34767f['actionid']][_0x6d58('0xb6')]])){if(this[_0x6d58('0x30')][_0xd9fec0[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]][_0x6d58('0xb6')]]){this[_0x6d58('0x30')][_0xd9fec0[_0x6d58('0x29')][_0x34767f['actionid']][_0x6d58('0xb6')]]=this[_0x6d58('0x30')][this[_0x6d58('0x29')][_0x34767f['actionid']]['queue']]?this[_0x6d58('0x30')][this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]][_0x6d58('0xb6')]]:this[_0x6d58('0x2f')][this['actions'][_0x34767f[_0x6d58('0x103')]]['queue']]?this['queueBooked'][this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]][_0x6d58('0xb6')]][_0x6d58('0x113')]||0x0:0x0;}this[_0x6d58('0x2f')][this[_0x6d58('0x29')][_0x34767f['actionid']][_0x6d58('0xb6')]][_0x6d58('0x113')]=this['queueBookedRR'][this[_0x6d58('0x29')][_0x34767f[_0x6d58('0x103')]][_0x6d58('0xb6')]];for(var _0x48a031=0x0;_0x48a031=0x0?!![]:![];})[_0x6d58('0xb3')](myreject(_0x128234)));}}else{_0xedeff5['push'](ami[_0x6d58('0x129')]({'action':'command','command':util[_0x6d58('0x7c')](_0x6d58('0x12a'),_0x265c36,!_[_0x6d58('0x43')](config['timezones'][_0x5bebca])?_0x5bebca:'')})['then'](function(_0x41dfac){return _0x41dfac[_0x6d58('0x12c')][_0x6d58('0x12d')](_0x6d58('0x12e'))>=0x0?!![]:![];})[_0x6d58('0xb3')](myreject(_0x128234)));}BPromise[_0x6d58('0x12f')](_0xedeff5)['then'](function(_0x116088){var _0x2d7295=_[_0x6d58('0x130')](_0x116088);if(_0x2d7295){return _0x4160f6(_0x2d7295);}else{_0x2c95b5['message']=_0x3e1df7?_0x6d58('0x131'):_0x6d58('0x132');return _0x128234(msgResponse(_0x6d58('0x133'),_0x6d58('0x123'),'Global:\x20'+_0x3e1df7+'\x20'+_0x80e6d1+_0x6d58('0x134')+util[_0x6d58('0x9b')](_0x265c36,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x5bebca));}})['catch'](function(_0x445d5b){return _0x128234(msgResponse(_0x6d58('0x121'),_0x6d58('0x123'),JSON['stringify'](_0x445d5b)));});});};Dialer['prototype'][_0x6d58('0x135')]=function(_0x1c29e3){var _0x56b097=this;return function(){switch(_0x1c29e3[_0x6d58('0x5d')]){case _0x6d58('0x136'):freeVariablesPredictive(_0x1c29e3);_0x56b097[_0x6d58('0x137')](_0x1c29e3,0x1);break;case _0x6d58('0x138'):freeVariablesPredictive(_0x1c29e3);_0x56b097[_0x6d58('0x137')](_0x1c29e3,_0x1c29e3[_0x6d58('0x139')]);break;case'predictive':_0x56b097[_0x6d58('0xa')](_0x1c29e3);break;case _0x6d58('0x9'):freeVariablesPredictive(_0x1c29e3);_0x56b097[_0x6d58('0x137')](_0x1c29e3,0x1);break;default:freeVariablesPredictive(_0x1c29e3);logger[_0x6d58('0x9a')]('Queue',_0x1c29e3[_0x6d58('0x48')],_0x6d58('0x13a'));}};};Dialer[_0x6d58('0x1f')]['launchHandleIvr']=function(_0xc9f0e4){var _0x201a93=this;return function(){_0x201a93[_0x6d58('0x13b')](_0xc9f0e4);};};Dialer['prototype']['syncQueueSummary']=function(_0x1d9127){var _0x3544bb=this;if(isNotPreview(_0x1d9127[_0x6d58('0x5d')])){if(isVoiceQueueOutbound(_0x1d9127[_0x6d58('0x53')])&&isActive(_0x1d9127['dialActive'])){_0x1d9127[_0x6d58('0xa4')]=!![];BPromise['resolve']()[_0x6d58('0xb9')](checkIsLoggedIn(_0x1d9127,_0x1d9127[_0x6d58('0x55')]))['then'](checkIsActive(_0x1d9127,_0x1d9127['dialActive']))[_0x6d58('0xb9')](checkInterval(_0x1d9127))[_0x6d58('0xb9')](_0x3544bb[_0x6d58('0x13c')](_0x1d9127))[_0x6d58('0xb9')](_0x3544bb[_0x6d58('0x13d')](_0x1d9127[_0x6d58('0x13e')],_0x1d9127[_0x6d58('0x13f')],_0x1d9127['name'],_0x1d9127))['then'](_0x3544bb[_0x6d58('0x122')](_0x1d9127[_0x6d58('0x4a')],_0x1d9127[_0x6d58('0x13f')],_0x1d9127[_0x6d58('0x48')],_0x1d9127))['then'](_0x3544bb[_0x6d58('0x135')](_0x1d9127))['catch'](loggerCatchQueueSummary(_0x6d58('0x140'),_0x1d9127));}else{notSendMessagesQueue(_0x1d9127);}}else{freeVariablesPredictive(_0x1d9127);}};Dialer[_0x6d58('0x1f')][_0x6d58('0x11d')]=function(){var _0x2dea94=this;var _0x26c4db;for(var _0x43ebd9 in this[_0x6d58('0xb5')]){if(this['campaigns']['hasOwnProperty'](_0x43ebd9)){_0x26c4db=this[_0x6d58('0xb5')][_0x43ebd9];if(isCampaignIvr(_0x26c4db['type'])&&isActive(_0x26c4db['active'])){_0x26c4db[_0x6d58('0xa4')]=!![];BPromise[_0x6d58('0xb8')]()[_0x6d58('0xb9')](checkIsActive(_0x26c4db,_0x26c4db[_0x6d58('0x7a')]))[_0x6d58('0xb9')](checkInterval(_0x26c4db))[_0x6d58('0xb9')](_0x2dea94[_0x6d58('0x13c')](_0x26c4db))[_0x6d58('0xb9')](_0x2dea94[_0x6d58('0x13d')](_0x26c4db[_0x6d58('0x13e')],_0x26c4db[_0x6d58('0x13f')],_0x26c4db[_0x6d58('0x48')],_0x26c4db))[_0x6d58('0xb9')](_0x2dea94['checkIfTimeIntervals'](_0x26c4db[_0x6d58('0x4a')],_0x26c4db[_0x6d58('0x13f')],_0x26c4db[_0x6d58('0x48')],_0x26c4db))[_0x6d58('0xb9')](_0x2dea94[_0x6d58('0x141')](_0x26c4db))[_0x6d58('0xb3')](loggerCatchQueueSummary(_0x6d58('0x142'),_0x26c4db));}else{notSendMessagesCampaign(_0x26c4db);}}}};function getCallerIdRandom(_0x4343ba,_0x5178d4){var _0x507b5c,_0x4a7816,_0x4260a8;if(_0x5178d4<=0x0){_0x5178d4=0x1;}_0x507b5c=new RegExp(_0x6d58('0x143')+_0x5178d4+'}$');_0x4a7816=Math[_0x6d58('0x144')](0xa,_0x5178d4-0x1);_0x4260a8=Math[_0x6d58('0x144')](0xa,_0x5178d4)-0x1;return util[_0x6d58('0x7c')]('%s',_[_0x6d58('0x145')](_0x4343ba,_0x507b5c,_['random'](_0x4a7816,_0x4260a8)));}function extractCalleridName(_0x458452){var _0x588b89=_0x458452['match'](/"(.*?)"/);return _0x588b89?_0x588b89[0x1]:_0x458452;}function extractCalleridNumber(_0x52596c){var _0x392860=_0x52596c['match'](/<(.*?)>/);return _0x392860?_0x392860[0x1]:_0x52596c;}Dialer[_0x6d58('0x1f')]['actionOriginate']=function(_0x54e6e8,_0x52d91a){var _0x158b7a=this;var _0x5effc4=uuid['v4']();this['actions'][_0x5effc4]=new Action(_0x54e6e8,_0x52d91a,_0x5effc4);return new BPromise(function(_0x7ac297,_0x2d0b68){if(_['isUndefined'](_0x54e6e8)&&_0x6d58('0x146')!==typeof _0x54e6e8){return _0x2d0b68(msgResponse('originate',_0x6d58('0x123'),_0x6d58('0x147')));}if(_[_0x6d58('0x43')](_0x52d91a['Contact'][_0x6d58('0x148')])||_0x52d91a[_0x6d58('0x149')][_0x6d58('0x148')]===null){return _0x2d0b68(msgResponse('originate',_0x6d58('0x123'),_0x6d58('0x14a')));}var _0xd9294b={'XMD-CALLERID':_0x158b7a['actions'][_0x5effc4][_0x6d58('0x14b')](),'XMD-AGI':_0x54e6e8[_0x6d58('0xed')]?util[_0x6d58('0x7c')](_0x6d58('0x14c'),ipAgi,_0x54e6e8['dialQueueProject']):_0x6d58('0x14d'),'XMD-AGIAFTER':_0x54e6e8[_0x6d58('0xf3')]?util[_0x6d58('0x7c')](_0x6d58('0x14c'),ipAgi,_0x54e6e8[_0x6d58('0xf3')]):_0x6d58('0x14d'),'XMD-QUEUE':_0x54e6e8[_0x6d58('0x53')]===_0x6d58('0x97')?util[_0x6d58('0x7c')](_0x6d58('0x14e'),_0x54e6e8['name'],_0x54e6e8[_0x6d58('0x14f')]||'',_0x54e6e8[_0x6d58('0xf4')]?'c':'',_0x54e6e8[_0x6d58('0xfc')]||0x3):_0x6d58('0x14d'),'XMD-CONTACTID':_0x52d91a[_0x6d58('0x110')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x158b7a[_0x6d58('0x29')][_0x5effc4]['getCaller'](),'XMD-AMD':_0x54e6e8[_0x6d58('0xdc')]?_0x6d58('0x150'):_0x6d58('0x14d'),'XMD-DESTINATION':_0x6d58('0x151')};if(_0x54e6e8[_0x6d58('0xdc')]){_0xd9294b[_0x6d58('0x152')]=_0x54e6e8[_0x6d58('0x153')]||0x9c4;_0xd9294b[_0x6d58('0x154')]=_0x54e6e8[_0x6d58('0x155')]||0x5dc;_0xd9294b[_0x6d58('0x156')]=_0x54e6e8[_0x6d58('0x157')]||0x320;_0xd9294b[_0x6d58('0x158')]=_0x54e6e8['dialAMDTotalAnalysisTime']||0x1388;_0xd9294b[_0x6d58('0x159')]=_0x54e6e8[_0x6d58('0x15a')]||0x64;_0xd9294b['XMD-AMDBETWEENWORDSSILENCE']=_0x54e6e8[_0x6d58('0x15b')]||0x32;_0xd9294b[_0x6d58('0x15c')]=_0x54e6e8[_0x6d58('0x15d')]||0x3;_0xd9294b['XMD-AMDSILENCETHRESHOLD']=_0x54e6e8[_0x6d58('0x15e')]||0x100;_0xd9294b[_0x6d58('0x15f')]=_0x54e6e8[_0x6d58('0x160')]||0x1388;}if(_0x54e6e8['type']===_0x6d58('0x97')){_0xd9294b[_0x6d58('0x161')]=_0x52d91a[_0x6d58('0xd1')];}else{_0xd9294b['XMD-CAMPAIGNID']=_0x52d91a[_0x6d58('0x111')];}for(var _0x423c46 in _0x52d91a[_0x6d58('0x149')]){if(_0x52d91a[_0x6d58('0x149')][_0x6d58('0x9e')](_0x423c46)){if(isNotNull(_0x52d91a['Contact'][_0x423c46])&&_0x423c46!=='id'&&_0x423c46!==_0x6d58('0x162')&&_0x423c46!==_0x6d58('0x163')&&_0x423c46!=='updatedAt'){_0xd9294b[util['format'](_0x6d58('0x164'),_0x6d58('0x165'),_[_0x6d58('0x166')](_0x423c46))]=_0x52d91a[_0x6d58('0x149')][_0x423c46];}}}var _0x4035c0=_0x158b7a[_0x6d58('0xd4')](_0x54e6e8[_0x6d58('0x79')])?getCallerId(_0x54e6e8['Trunk']['callerid'],_0x54e6e8[_0x6d58('0x5e')],_0x54e6e8[_0x6d58('0x167')]>0x0?getCallerIdRandom(_0x54e6e8[_0x6d58('0x5f')],_0x54e6e8[_0x6d58('0x167')]):_0x54e6e8['dialOriginateCallerIdNumber']):getCallerId(_[_0x6d58('0xb1')](_0x54e6e8[_0x6d58('0x11e')])?_0x54e6e8[_0x6d58('0x79')]['callerid']:_0x54e6e8[_0x6d58('0x11e')]['callerid'],_0x54e6e8[_0x6d58('0x5e')],_0x54e6e8['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x54e6e8[_0x6d58('0x5f')],_0x54e6e8['dialRandomLastDigitCallerIdNumber']):_0x54e6e8['dialOriginateCallerIdNumber']);if(_0x4035c0){_0xd9294b[_0x6d58('0x168')]=_0x158b7a[_0x6d58('0x29')][_0x5effc4][_0x6d58('0x169')]=extractCalleridName(_0x4035c0);_0xd9294b[_0x6d58('0x16a')]=_0x158b7a[_0x6d58('0x29')][_0x5effc4][_0x6d58('0x16b')]=extractCalleridNumber(_0x4035c0);}return ami[_0x6d58('0x129')]({'actionid':_0x5effc4,'action':_0x6d58('0x16c'),'channel':_0x158b7a[_0x6d58('0xd4')](_0x54e6e8['Trunk'])?util['format'](_0x6d58('0x16d'),_0x54e6e8[_0x6d58('0x79')]['name'],isNotNull(_0x54e6e8[_0x6d58('0x60')])?_0x54e6e8[_0x6d58('0x60')][_0x6d58('0x16e')]()||'':'',_0x54e6e8[_0x6d58('0x16f')]>0x0?_0x52d91a[_0x6d58('0x149')]['phone'][_0x6d58('0x170')](_0x54e6e8['dialCutDigit']):_0x52d91a[_0x6d58('0x149')]['phone']):util[_0x6d58('0x7c')](_0x6d58('0x16d'),_[_0x6d58('0xb1')](_0x54e6e8[_0x6d58('0x11e')])?_0x54e6e8[_0x6d58('0x79')][_0x6d58('0x48')]:_0x54e6e8[_0x6d58('0x11e')][_0x6d58('0x48')],isNotNull(_0x54e6e8[_0x6d58('0x60')])?_0x54e6e8[_0x6d58('0x60')][_0x6d58('0x16e')]()||'':'',_0x54e6e8[_0x6d58('0x16f')]>0x0?_0x52d91a[_0x6d58('0x149')][_0x6d58('0x148')][_0x6d58('0x170')](_0x54e6e8['dialCutDigit']):_0x52d91a[_0x6d58('0x149')]['phone']),'callerid':_0x4035c0,'Exten':_0x6d58('0x151'),'Context':'from-sip','Priority':'1','variable':_0xd9294b,'timeout':(_0x54e6e8[_0x6d58('0x171')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5effc4})['then'](function(_0x2fd88a){return _0x7ac297(_0x2fd88a);})[_0x6d58('0xb3')](function(_0x1b7601){_0x54e6e8[_0x6d58('0x69')]+=0x1;var _0x1deee5=new History(_0x158b7a[_0x6d58('0x29')][_0x5effc4]);logger[_0x6d58('0x9a')](util[_0x6d58('0x7c')]('[originateError]:\x20%s',JSON[_0x6d58('0x7b')](_0x1b7601)));_0x1deee5[_0x6d58('0xaa')]=0xe;_0x1deee5[_0x6d58('0xab')]=_0x6d58('0x172');_0x1deee5['starttime']=moment()[_0x6d58('0x7c')](_0x6d58('0xf5'));_0x1deee5[_0x6d58('0xac')]=_0x1deee5['starttime'];_0x158b7a['createHistory'](_0x1deee5)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0x173')));_0x158b7a[_0x6d58('0xc7')](_0x1deee5)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0x173')))[_0x6d58('0x21')](function(){delete _0x158b7a['actions'][_0x5effc4];return _0x2d0b68(msgResponse('originate',_0x6d58('0x4f'),_0x6d58('0x174')));});});});};Dialer[_0x6d58('0x1f')][_0x6d58('0x37')]=function(_0x11d44a){var _0x5f1751=this[_0x6d58('0x29')][_0x11d44a[_0x6d58('0x103')]];var _0x54e3d0=this;if(_0x5f1751){delete this[_0x6d58('0x29')][_0x11d44a['actionid']];_0x5f1751[_0x6d58('0xfb')]=moment()[_0x6d58('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2fa831=_0x5f1751[_0x6d58('0x53')]===_0x6d58('0x7e')?this[_0x6d58('0xb5')][_0x5f1751['queue']]:this[_0x6d58('0x24')][_0x5f1751[_0x6d58('0x175')]()];if(!this[_0x6d58('0xd3')](_0x11d44a['response'])){this[_0x6d58('0xb4')](_0x2fa831);return this[_0x6d58('0x176')](_0x5f1751,_0x2fa831,_0x11d44a)['then'](function(_0x5ee139){})['catch'](loggerCatch('[callProgressDetecting]\x20'));}else{this[_0x6d58('0x2b')][_0x11d44a[_0x6d58('0xda')]]=_0x5f1751;}}};Dialer[_0x6d58('0x1f')]['checkRetriveMax']=function(_0x4b9e67,_0x4f0a7c,_0x416feb){var _0x567250=new History(_0x4f0a7c);if(_0x567250[_0x6d58('0x177')]+_0x567250[_0x6d58('0x178')]+_0x567250[_0x6d58('0x179')]>=_0x416feb[_0x6d58('0x17a')]-0x1){return!![];}switch(_0x4b9e67){case 0x3:if(_0x567250[_0x6d58('0x179')]>=_0x416feb[_0x6d58('0x17b')]-0x1){return!![];}else{this[_0x6d58('0xc0')]({'active':![],'countnoanswerretry':_0x567250[_0x6d58('0x179')]+=0x1,'scheduledat':moment()[_0x6d58('0x17c')](_0x416feb[_0x6d58('0x17d')],_0x6d58('0x17e'))['format'](_0x6d58('0xf5')),'ContactId':_0x567250['ContactId'],'ListId':_0x567250[_0x6d58('0xcf')],'VoiceQueueId':_0x567250['VoiceQueueId']||undefined,'CampaignId':_0x567250[_0x6d58('0x111')]||undefined})[_0x6d58('0xb3')](loggerCatch(_0x6d58('0x17f')));}break;case 0x5:if(_0x567250['countbusyretry']>=_0x416feb[_0x6d58('0x180')]-0x1){return!![];}else{this[_0x6d58('0xc0')]({'active':![],'countbusyretry':_0x567250[_0x6d58('0x177')]+=0x1,'scheduledat':moment()[_0x6d58('0x17c')](_0x416feb[_0x6d58('0x181')],_0x6d58('0x17e'))[_0x6d58('0x7c')](_0x6d58('0xf5')),'ContactId':_0x567250[_0x6d58('0x110')],'ListId':_0x567250['ListId'],'VoiceQueueId':_0x567250[_0x6d58('0xd1')]||undefined,'CampaignId':_0x567250[_0x6d58('0x111')]||undefined})[_0x6d58('0xb3')](loggerCatch(_0x6d58('0x182')));}break;case 0x8:if(_0x567250[_0x6d58('0x178')]>=_0x416feb[_0x6d58('0x183')]-0x1){return!![];}else{this[_0x6d58('0xc0')]({'active':![],'countcongestionretry':_0x567250['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x416feb['dialCongestionRetryFrequency'],_0x6d58('0x17e'))[_0x6d58('0x7c')](_0x6d58('0xf5')),'ContactId':_0x567250['ContactId'],'ListId':_0x567250[_0x6d58('0xcf')],'VoiceQueueId':_0x567250['VoiceQueueId']||undefined,'CampaignId':_0x567250['CampaignId']||undefined})[_0x6d58('0xb3')](loggerCatch(_0x6d58('0x184')));}break;default:return!![];}};Dialer['prototype'][_0x6d58('0x176')]=function(_0x1a699a,_0x59e617,_0x216450){var _0x5249f0=this;var _0x414c53=new History(_0x1a699a);return new BPromise(function(_0x54a035,_0x16e30d){if(_['isUndefined'](_0x59e617)&&'object'!==typeof _0x59e617){return _0x16e30d(msgResponse(_0x6d58('0x185'),_0x6d58('0x123'),'entity\x20is\x20undefine'));}if(_[_0x6d58('0x43')](_0x216450)&&_0x6d58('0x146')!==typeof _0x216450){return _0x16e30d(msgResponse(_0x6d58('0x185'),_0x6d58('0x123'),'evt\x20is\x20undefine'));}switch(_0x216450[_0x6d58('0x186')]){case'0':_0x59e617[_0x6d58('0x68')]+=0x1;_0x414c53[_0x6d58('0xaa')]=0x0;_0x414c53[_0x6d58('0xab')]=_0x6d58('0x187');_0x5249f0[_0x6d58('0xd9')](_0x414c53)['catch'](loggerCatch(_0x6d58('0x188')));if(_0x5249f0[_0x6d58('0x189')](0x0,_0x1a699a,_0x59e617)){if(_0x414c53[_0x6d58('0x177')]+_0x414c53[_0x6d58('0x178')]+_0x414c53[_0x6d58('0x179')]>=_0x59e617[_0x6d58('0x17a')]){_0x5249f0['stateGlobal'](_0x414c53,_0x54a035,_0x16e30d,_0x6d58('0x18a'));}else{_0x5249f0['createStateFinal'](_0x414c53,_0x54a035,_0x16e30d,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x59e617[_0x6d58('0x67')]+=0x1;_0x414c53['state']=0x3;_0x414c53[_0x6d58('0xab')]=_0x6d58('0x18b');_0x414c53[_0x6d58('0x179')]+=0x1;_0x414c53['countglobal']+=0x1;_0x5249f0[_0x6d58('0xd9')](_0x414c53)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0x18c')));if(_0x5249f0[_0x6d58('0x189')](0x3,_0x1a699a,_0x59e617)){if(_0x414c53[_0x6d58('0x179')]>=_0x59e617[_0x6d58('0x17b')]){_0x5249f0[_0x6d58('0x18d')](_0x414c53,_0x54a035,_0x16e30d,_0x6d58('0x18e'));}else{_0x5249f0[_0x6d58('0x18f')](_0x414c53,_0x54a035,_0x16e30d,_0x6d58('0x18e'));}}break;case'5':_0x59e617[_0x6d58('0x190')]+=0x1;_0x414c53[_0x6d58('0xaa')]=0x5;_0x414c53[_0x6d58('0xab')]='Busy';_0x414c53[_0x6d58('0x177')]+=0x1;_0x414c53['countglobal']+=0x1;_0x5249f0['createHistory'](_0x414c53)[_0x6d58('0xb3')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x5249f0['checkRetriveMax'](0x5,_0x1a699a,_0x59e617)){if(_0x414c53[_0x6d58('0x177')]>=_0x59e617['dialBusyMaxRetry']){_0x5249f0['createStateFinal'](_0x414c53,_0x54a035,_0x16e30d,'reason\x205\x20busy');}else{_0x5249f0['stateGlobal'](_0x414c53,_0x54a035,_0x16e30d,'reason\x205\x20busy');}}break;case'8':_0x59e617[_0x6d58('0x64')]+=0x1;_0x414c53[_0x6d58('0xaa')]=0x8;_0x414c53[_0x6d58('0xab')]='Congestion';_0x414c53[_0x6d58('0x178')]+=0x1;_0x414c53[_0x6d58('0x191')]+=0x1;_0x5249f0[_0x6d58('0xd9')](_0x414c53)[_0x6d58('0xb3')](loggerCatch(_0x6d58('0x192')));if(_0x5249f0[_0x6d58('0x189')](0x8,_0x1a699a,_0x59e617)){if(_0x414c53[_0x6d58('0x178')]>=_0x59e617[_0x6d58('0x183')]){_0x5249f0[_0x6d58('0x18d')](_0x414c53,_0x54a035,_0x16e30d,_0x6d58('0x193'));}else{_0x5249f0[_0x6d58('0x18f')](_0x414c53,_0x54a035,_0x16e30d,_0x6d58('0x193'));}}break;default:_0x59e617[_0x6d58('0x6c')]+=0x1;_0x414c53[_0x6d58('0xaa')]=0xc;_0x414c53[_0x6d58('0xab')]=_0x216450[_0x6d58('0x186')];_0x5249f0[_0x6d58('0xd9')](_0x414c53)['catch'](loggerCatch(_0x6d58('0x194')));if(_0x5249f0['checkRetriveMax'](_0x216450[_0x6d58('0x186')],_0x1a699a,_0x59e617)){if(_0x414c53['countbusyretry']+_0x414c53[_0x6d58('0x178')]+_0x414c53[_0x6d58('0x179')]>=_0x59e617[_0x6d58('0x17a')]){_0x5249f0['stateGlobal'](_0x414c53,_0x54a035,_0x16e30d,_0x216450[_0x6d58('0x186')]);}else{_0x5249f0[_0x6d58('0x18d')](_0x414c53,_0x54a035,_0x16e30d,_0x216450['reason']);}}}});};Dialer[_0x6d58('0x1f')]['stateGlobal']=function(_0x38151b,_0x51e2e0,_0x449fb3,_0x40d99a){var _0xe88be7=new Final(_0x38151b);_0xe88be7[_0x6d58('0xaa')]=0xf;_0xe88be7[_0x6d58('0xab')]='Global';this[_0x6d58('0x18d')](_0xe88be7,_0x51e2e0,_0x449fb3,_0x40d99a);};Dialer[_0x6d58('0x1f')][_0x6d58('0x18d')]=function(_0x217d98,_0x15ea69,_0x4ca73b,_0x5db195){this[_0x6d58('0xc7')](_0x217d98)['then'](function(_0x5ef092){return _0x15ea69(msgResponse(_0x6d58('0x185'),_0x6d58('0x195'),_0x5db195));})[_0x6d58('0xb3')](function(_0x42d524){return _0x4ca73b(msgResponse(_0x6d58('0x196'),_0x6d58('0x123'),_0x6d58('0x197')));});};Dialer[_0x6d58('0x1f')][_0x6d58('0xa')]=function(_0x17a56b){var _0xbb18d1=this;var _0x24ea0c=_0x17a56b[_0x6d58('0x198')]/0x64;var _0x4feafd=_0x17a56b[_0x6d58('0x66')]/(_0x17a56b[_0x6d58('0x66')]+_0x17a56b[_0x6d58('0x62')]);var _0x488267=Math[_0x6d58('0x199')](_0x17a56b[_0x6d58('0x73')]*(_0x17a56b[_0x6d58('0x19a')]/0x64));var _0x24a691=Math['round'](_0x17a56b[_0x6d58('0x73')]*(_0x17a56b[_0x6d58('0x19b')]/0x64));var _0x99ccb2=_0x17a56b['available']+_0x17a56b[_0x6d58('0x5a')];var _0x232424=Math[_0x6d58('0x19c')](_0x17a56b['erlangCalls']*_0x17a56b[_0x6d58('0x8f')]*_0x17a56b['predictiveIntervalHitRate']*_0x17a56b['predictiveIntervalMultiplicativeFactor']);if(_[_0x6d58('0x43')](_0x17a56b[_0x6d58('0x78')])){if(!_['isUndefined'](_0x17a56b[_0x6d58('0x2d')])){_0x17a56b[_0x6d58('0x2d')]=undefined;loggerPredictive['error'](_0x6d58('0x19d'),_0x6d58('0x19e'));}if(!_[_0x6d58('0x43')](_0x17a56b[_0x6d58('0x96')])){loggerPredictive[_0x6d58('0x9a')](_0x6d58('0x19d'),_0x6d58('0x19f'));clearInterval(_0x17a56b[_0x6d58('0x96')]);_0x17a56b[_0x6d58('0x96')]=undefined;}_0x17a56b[_0x6d58('0x78')]=moment()[_0x6d58('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x6d58('0x81')](_0x17a56b[_0x6d58('0x48')],'collection\x20data\x20in\x20progressive\x20at',_0x17a56b[_0x6d58('0x78')]);this['handlePower'](_0x17a56b,0x1);}else if(ifInterval(_0x17a56b[_0x6d58('0x1a0')],_0x17a56b[_0x6d58('0x78')])){this[_0x6d58('0x137')](_0x17a56b,0x1);loggerPredictiveCalls[_0x6d58('0x81')](_0x6d58('0x1a1'),_0x17a56b[_0x6d58('0x78')],_0x17a56b[_0x6d58('0x48')]);_0x17a56b[_0x6d58('0x76')]=0x0;_0x17a56b[_0x6d58('0x70')]=0x0;}else if(_0x24ea0c<_0x4feafd&&_0x17a56b['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x17a56b);loggerPredictive['info'](_0x6d58('0x1a2'),_0x6d58('0x1a3'),_0x4feafd,_0x6d58('0x78'),_0x17a56b['name']);}else if(_0x232424<_0x17a56b[_0x6d58('0x70')]&&_0x17a56b[_0x6d58('0x1a4')]===_0x6d58('0x1a5')){freeVariablesPredictive(_0x17a56b);loggerPredictive[_0x6d58('0x81')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x6d58('0x1a6'),_0x232424,'Drop\x20in\x20this\x20interval',_0x17a56b['predictiveIntervalErlangCallsDroppedCalls'],_0x6d58('0x78'),_0x17a56b[_0x6d58('0x48')]);}else if(!ifInterval(_0x17a56b[_0x6d58('0x1a0')],_0x17a56b[_0x6d58('0x78')])&&_[_0x6d58('0x43')](_0x17a56b['startPredictive'])&&!_[_0x6d58('0x43')](_0x17a56b[_0x6d58('0x78')])){_0x17a56b[_0x6d58('0x2d')]=moment()['format'](_0x6d58('0xf5'));loggerPredictive['info'](_0x17a56b[_0x6d58('0x48')],_0x6d58('0x1a7'),_0x17a56b[_0x6d58('0x2d')]);this[_0x6d58('0xbe')](_0x17a56b['dialPredictiveInterval'])[_0x6d58('0xb9')](this[_0x6d58('0x1a8')](_0x17a56b))['then'](mergeDataErlangB(_0x17a56b))['then'](this['startMethodPredictive'](_0x17a56b))[_0x6d58('0xb3')](loggerCatchPredictive(_0x6d58('0x1a9'),_0x17a56b));}else if(!ifInterval(_0x17a56b[_0x6d58('0x1a0')],_0x17a56b[_0x6d58('0x2d')])){_0x17a56b[_0x6d58('0x70')]=0x0;_0x17a56b['startPredictive']=moment()[_0x6d58('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x17a56b[_0x6d58('0x48')],_0x6d58('0x1aa'),_0x17a56b[_0x6d58('0x2d')]);clearInterval(_0x17a56b[_0x6d58('0x96')]);_0x17a56b[_0x6d58('0x96')]=undefined;this[_0x6d58('0xbe')](_0x17a56b['dialPredictiveInterval'])['then'](this[_0x6d58('0x1a8')](_0x17a56b))[_0x6d58('0xb9')](mergeDataErlangB(_0x17a56b))[_0x6d58('0xb9')](this['startMethodPredictive'](_0x17a56b))[_0x6d58('0xb3')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x17a56b));}else if(_0x17a56b[_0x6d58('0x73')]&&_0x99ccb2<_0x17a56b[_0x6d58('0x73')]-_0x24a691){freeVariablesPredictive(_0x17a56b);loggerPredictive['info'](_0x17a56b[_0x6d58('0x48')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x99ccb2,_0x6d58('0x1ab'),_0x17a56b[_0x6d58('0x73')],'-',_0x24a691,'=',_0x17a56b['predictiveIntervalAvailable']-_0x24a691,')');}else if(_0x17a56b['predictiveIntervalAvailable']&&_0x99ccb2>_0x17a56b[_0x6d58('0x73')]+_0x488267){freeVariablesPredictive(_0x17a56b);loggerPredictive[_0x6d58('0x81')](_0x17a56b['name'],_0x6d58('0x1ac'),_0x99ccb2,_0x6d58('0x1ad'),_0x17a56b[_0x6d58('0x73')],'+',_0x488267,'=',_0x17a56b[_0x6d58('0x73')]+_0x488267,')');}};Dialer[_0x6d58('0x1f')]['getDataPredictive']=function(_0x43e350){var _0x3fc5e9=this;return function(_0x491f97){return new BPromise(function(_0x20cc2b,_0x57ccb8){_[_0x6d58('0x92')](_0x43e350,_0x491f97[0x0]);if(checkGetDataPredictive(_0x491f97[0x0])){var _0x55bbc8=_0x43e350[_0x6d58('0x73')]=_0x43e350[_0x6d58('0x5a')]+_0x43e350[_0x6d58('0x54')];var _0x2a21b7=_0x43e350['dialPredictiveInterval']*0x3c;var _0xa5cffe=_0x491f97[0x0][_0x6d58('0x6e')]+_0x491f97[0x0][_0x6d58('0x8a')];var _0x24a9ad=(_0x491f97[0x0][_0x6d58('0x6d')]+_0x491f97[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x491f97[0x0][_0x6d58('0x6f')])/_0x491f97[0x0]['predictiveIntervalTotalCalls'];_0x43e350[_0x6d58('0x71')]=_0x24a9ad>0x0?_0x24a9ad:0x1;switch(_0x43e350[_0x6d58('0x1a4')]){case _0x6d58('0x1a5'):var _0x166545=_0x43e350[_0x6d58('0x198')]/0x64;return _0x3fc5e9[_0x6d58('0x1ae')](_0x55bbc8,_0x2a21b7,_0xa5cffe,_0x24a9ad,_0x166545)[_0x6d58('0xb9')](function(_0x5b619f){return _0x20cc2b(_0x5b619f);});case'agentBusyFactor':var _0x32c4e4=_0x43e350[_0x6d58('0x198')]/0x64;return _0x3fc5e9[_0x6d58('0x1af')](_0x55bbc8,_0x2a21b7,_0xa5cffe,_0x24a9ad,_0x32c4e4)[_0x6d58('0xb9')](function(_0x436df8){return _0x20cc2b(_0x436df8);});default:return _0x57ccb8(msgResponse(_0x6d58('0x1b0'),_0x6d58('0x123'),'Unknown\x20Predictive'));}}else{return _0x57ccb8(msgResponse(_0x6d58('0x1b0'),_0x6d58('0x123'),_0x6d58('0x1b1')));}});};};Dialer[_0x6d58('0x1f')][_0x6d58('0x1b2')]=function(_0x348ece){var _0x2a437e=this;return function(_0x551445){return new BPromise(function(_0x67432b,_0x3d3c42){_[_0x6d58('0x92')](_0x348ece,_0x551445[0x0]);if(checkGetDataPredictive(_0x551445[0x0])){loggerPredictive[_0x6d58('0x81')](JSON[_0x6d58('0x7b')](_0x551445[0x0]));if(_0x348ece['dialPredictiveOptimization']===_0x6d58('0x1a5')){return _0x2a437e['getVoiceQueueRtPauses'](_0x348ece['id'])[_0x6d58('0xb9')](function(_0x58b4a5){var _0x1a22dd=_0x348ece[_0x6d58('0x55')]-_0x58b4a5[0x0][_0x6d58('0x1b3')];var _0x516df5=_0x348ece[_0x6d58('0x1a0')]*0x3c;var _0x471f2d=_0x551445[0x0][_0x6d58('0x6e')]+_0x551445[0x0][_0x6d58('0x8a')];var _0x2e70fa=(_0x551445[0x0]['predictiveIntervalAnsweredCalls']+_0x551445[0x0][_0x6d58('0x86')]+_0x551445[0x0][_0x6d58('0x6f')])/_0x551445[0x0][_0x6d58('0x74')];var _0x3b2672=_0x348ece[_0x6d58('0x198')]/0x64;_0x348ece[_0x6d58('0x72')]=_0x58b4a5[0x0]['outboundQueuePauses']||0x0;_0x348ece[_0x6d58('0x71')]=_0x2e70fa>0x0?_0x2e70fa:0x1;return _0x2a437e[_0x6d58('0x1ae')](_0x1a22dd,_0x516df5,_0x471f2d,_0x2e70fa,_0x3b2672);})[_0x6d58('0xb9')](function(_0x3565b7){return _0x67432b(_0x3565b7);})[_0x6d58('0xb3')](function(_0x25efb9){return _0x3d3c42(msgResponse(_0x6d58('0x1b4'),_0x6d58('0x123'),JSON[_0x6d58('0x7b')](_0x25efb9)));});}if(_0x348ece[_0x6d58('0x1a4')]===_0x6d58('0x1b5')){return _0x2a437e[_0x6d58('0xc5')](_0x348ece['id'])[_0x6d58('0xb9')](function(_0x47c022){var _0x1a0b22=_0x348ece['loggedIn']-_0x47c022[0x0][_0x6d58('0x1b3')];var _0x225d94=_0x348ece[_0x6d58('0x1a0')]*0x3c;var _0x4a6454=_0x551445[0x0][_0x6d58('0x6e')]+_0x551445[0x0]['predictiveIntervalAvgHoldtime'];var _0x257366=(_0x551445[0x0][_0x6d58('0x6d')]+_0x551445[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x551445[0x0][_0x6d58('0x6f')])/_0x551445[0x0][_0x6d58('0x74')];var _0xdedf1=_0x348ece[_0x6d58('0x198')]/0x64;_0x348ece[_0x6d58('0x72')]=_0x47c022[0x0][_0x6d58('0x1b3')]||0x0;_0x348ece['predictiveIntervalHitRate']=_0x257366>0x0?_0x257366:0x1;return _0x2a437e[_0x6d58('0x1af')](_0x1a0b22,_0x225d94,_0x4a6454,_0x257366,_0xdedf1);})[_0x6d58('0xb9')](function(_0x2af587){return _0x67432b(_0x2af587);})['catch'](function(_0x2513e3){return _0x3d3c42(msgResponse('[CatchErlangB]','Failure',JSON[_0x6d58('0x7b')](_0x2513e3)));});}}else{return _0x3d3c42(msgResponse('[getDataPredictive]',_0x6d58('0x123'),_0x6d58('0x1b1')));}});};};Dialer[_0x6d58('0x1f')][_0x6d58('0x1b6')]=function(_0x34c856){var _0x4250d2=this;return function(){var _0x59962d=0x0;var _0x5870ae=Math[_0x6d58('0x19c')](_0x34c856['erlangCallToSecond']*0x3e8);if(_0x5870ae>0x0){_0x5870ae=_0x5870ae<0x64?0x64:_0x5870ae;loggerPredictive[_0x6d58('0x81')](_0x34c856[_0x6d58('0x48')],_0x6d58('0x1b7'),_0x5870ae,_0x6d58('0x50'));_0x34c856[_0x6d58('0x96')]=setInterval(function(){_0x4250d2['handlePredictive'](_0x34c856);loggerPredictiveCalls[_0x6d58('0x81')](_0x6d58('0x1b8'),_0x59962d+=0x1);},_0x5870ae);}else{loggerPredictive[_0x6d58('0x81')](_0x34c856['name'],_0x6d58('0x1b9'));}};};Dialer[_0x6d58('0x1f')][_0x6d58('0x1ba')]=function(_0x509da8,_0xe4472d){var _0x4fa8e6=this;return function(_0x5e8cc8){if(_[_0x6d58('0x4d')](_0x5e8cc8)){if(_[_0x6d58('0xb1')](_0xe4472d[_0x6d58('0xd0')])||!_0xe4472d[_0x6d58('0x1bb')]){if(_0x509da8[_0x6d58('0x5d')]===_0x6d58('0x9')){_0x509da8[_0x6d58('0x10c')]=_[_0x6d58('0x43')](_0x509da8[_0x6d58('0x10c')])?!![]:_0x509da8[_0x6d58('0x10c')];var _0x15f1ad=uuid['v4']();_0x4fa8e6[_0x6d58('0x29')][_0x15f1ad]=new Action(_0x509da8,_0xe4472d,_0x15f1ad);loggerBooked[_0x6d58('0x81')](_0x6d58('0x1bc'),_0x15f1ad,'queueStatusComplete:\x20',JSON[_0x6d58('0x7b')](_0x509da8[_0x6d58('0x10c')]),_0x6d58('0x1bd'),_0x509da8[_0x6d58('0x48')]);if(_0x509da8[_0x6d58('0x10c')]){_0x509da8[_0x6d58('0x10c')]=![];_0x4fa8e6[_0x6d58('0x2f')][_0x4fa8e6[_0x6d58('0x29')][_0x15f1ad]['queue']]=[];ami[_0x6d58('0x129')]({'actionid':_0x15f1ad,'action':'queuestatus','queue':_0x509da8[_0x6d58('0x48')]})[_0x6d58('0xb3')](function(_0x13ffcf){_0x4fa8e6[_0x6d58('0xb4')](_0x509da8);_0x4fa8e6[_0x6d58('0xc0')]({'active':![],'ContactId':_0x4fa8e6['actions'][_0x15f1ad][_0x6d58('0x110')],'ListId':_0x4fa8e6[_0x6d58('0x29')][_0x15f1ad][_0x6d58('0xcf')],'VoiceQueueId':_0x4fa8e6['actions'][_0x15f1ad][_0x6d58('0xd1')]||undefined,'CampaignId':_0x4fa8e6['actions'][_0x15f1ad]['CampaignId']||undefined})['catch'](loggerCatch(_0x6d58('0x1be')));delete _0x4fa8e6['actions'][_0x15f1ad];});}else{loggerBooked[_0x6d58('0x81')](_0x6d58('0x1bf'),JSON[_0x6d58('0x7b')](_0x509da8[_0x6d58('0x10c')]),'Queue:\x20',_0x509da8[_0x6d58('0x48')]);_0x4fa8e6[_0x6d58('0xb4')](_0x509da8);_0x4fa8e6['rescheduleContact']({'active':![],'ContactId':_0x4fa8e6[_0x6d58('0x29')][_0x15f1ad][_0x6d58('0x110')],'ListId':_0x4fa8e6[_0x6d58('0x29')][_0x15f1ad]['ListId'],'VoiceQueueId':_0x4fa8e6[_0x6d58('0x29')][_0x15f1ad][_0x6d58('0xd1')]||undefined,'CampaignId':_0x4fa8e6[_0x6d58('0x29')][_0x15f1ad][_0x6d58('0x111')]||undefined})[_0x6d58('0xb3')](loggerCatch(_0x6d58('0x1be')));delete _0x4fa8e6['actions'][_0x15f1ad];}}else{return _0x4fa8e6[_0x6d58('0x1c0')](_0x509da8,_0xe4472d);}}else{if(getDiff(_0xe4472d['scheduledat'])<_0x509da8[_0x6d58('0x1c1')]*0x3c){_0x4fa8e6['preview'][_0x6d58('0x10e')](_0xe4472d['id'])[_0x6d58('0x21')](function(){_0x4fa8e6[_0x6d58('0xb4')](_0x509da8);});}else{_0x509da8['outboundReCallsDay']+=0x1;_0x4fa8e6[_0x6d58('0xb4')](_0x509da8);if(_0x509da8[_0x6d58('0x1c2')]){_0x4fa8e6[_0x6d58('0xc0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xe4472d['ContactId'],'ListId':_0xe4472d[_0x6d58('0xcf')],'VoiceQueueId':_0xe4472d[_0x6d58('0xd1')]||undefined,'CampaignId':_0xe4472d['CampaignId']||undefined})[_0x6d58('0xb3')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x4fa8e6['createHistory'](createObjHistory(_0x509da8,_0xe4472d,_0x6d58('0x1c3'),0x17,_0x6d58('0x1c4')))[_0x6d58('0xb3')](loggerCatch(_0x6d58('0x1c5')));}else{_0x4fa8e6[_0x6d58('0xce')](createObjHistory(_0x509da8,_0xe4472d,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0x6d58('0x1c6'),_0x6d58('0x1c7'));}}}}else{_0x509da8[_0x6d58('0x63')]+=0x1;_0x4fa8e6[_0x6d58('0xce')](createObjHistory(_0x509da8,_0xe4472d,_0x6d58('0x1c8'),0xd,_0x6d58('0x1c9')),_0x6d58('0x1ca'),'[Originate][MoveBlacklist]');throw _0x6d58('0x1cb');}};};Dialer[_0x6d58('0x1f')][_0x6d58('0x13b')]=function(_0x3b52a6){var _0x4467a9=this;var _0x2182b9=[];var _0x20aa39=_0x3b52a6['limitCalls']-_0x3b52a6[_0x6d58('0x75')]-_0x3b52a6[_0x6d58('0x1cc')];emitCampaignSummary(_0x3b52a6);if(_0x20aa39>0x0){if(_0x20aa39>this['maxNumberOriginate']){_0x20aa39=this[_0x6d58('0x27')];}_0x3b52a6['temp']+=_0x20aa39;this[_0x6d58('0xc4')](_0x3b52a6['id'],_0x20aa39,_0x3b52a6[_0x6d58('0x1cd')])[_0x6d58('0xb9')](function(_0x9eae71){_0x3b52a6[_0x6d58('0x1cc')]-=_0x20aa39;_0x3b52a6[_0x6d58('0x1cc')]=_0x3b52a6[_0x6d58('0x1cc')]>0x0?_0x3b52a6[_0x6d58('0x1cc')]:0x0;if(!checkContactEmpty(_0x9eae71)){_0x3b52a6[_0x6d58('0x44')]=_0x6d58('0x1ce');logger[_0x6d58('0x81')](_0x6d58('0x1cf')+_0x3b52a6['name']);}else{_0x3b52a6['originated']+=_0x9eae71[_0x6d58('0x9d')];_0x3b52a6['message']=_0x6d58('0x1d0');for(var _0x987a13=0x0;_0x987a13<_0x9eae71['length'];_0x987a13+=0x1){_0x3b52a6[_0x6d58('0x1d1')]+=0x1;if(_[_0x6d58('0xb1')](_0x9eae71[_0x987a13])||_[_0x6d58('0xb1')](_0x9eae71[_0x987a13]['Contact'])||_[_0x6d58('0xb1')](_0x9eae71[_0x987a13][_0x6d58('0x149')][_0x6d58('0x148')])){_0x4467a9['emptyContact'](_0x6d58('0x1d2'),_0x3b52a6,_0x9eae71[_0x987a13]);}else{_0x4467a9[_0x6d58('0xbc')](_[_0x6d58('0x10a')](_0x9eae71[_0x987a13],[_0x6d58('0x111'),_0x6d58('0x1d3')]))[_0x6d58('0xb9')](_0x4467a9[_0x6d58('0x1ba')](_0x3b52a6,_0x9eae71[_0x987a13]))[_0x6d58('0xb3')](_0x4467a9[_0x6d58('0xcb')]('[actionOriginateIvr]\x20',_0x3b52a6));}}}})['catch'](loggerGetContactDialer(_0x6d58('0x1d4'),_0x3b52a6,_0x20aa39));}};Dialer[_0x6d58('0x1f')]['handlePower']=function(_0x19419e,_0x2101ac){var _0x1689a7=this;var _0x49336f=[];var _0x3005cd=_0x2101ac>=0x1?_0x2101ac:0x1;var _0x7da695=[];if(_0x19419e[_0x6d58('0x5d')]==='booked'){_0x3005cd=0x1;}var _0x58c894=Math[_0x6d58('0x19c')](_0x19419e[_0x6d58('0x54')]*_0x3005cd)-_0x19419e[_0x6d58('0x75')]-_0x19419e[_0x6d58('0x1cc')];emitVoiceQueueSummary(_0x19419e);if(_0x19419e[_0x6d58('0x1d5')]>0x0){var _0x4a7f8a=_0x19419e[_0x6d58('0x1d5')]-_0x19419e[_0x6d58('0x75')]-_0x19419e[_0x6d58('0x5a')]-_0x19419e['temp']-_0x19419e[_0x6d58('0x56')];if(_0x58c894>_0x4a7f8a){_0x58c894=_0x4a7f8a;}}if(_0x58c894>0x0){if(_0x19419e[_0x6d58('0x5d')]==='booked'){_0x58c894=0x1;}if(_0x58c894>this[_0x6d58('0x27')]){_0x58c894=this[_0x6d58('0x27')];}_0x19419e['temp']+=_0x58c894;for(var _0x320a54 in this[_0x6d58('0x25')]){if(this['agents'][_0x6d58('0x9e')](_0x320a54)){if(this[_0x6d58('0x25')][_0x320a54][_0x6d58('0xaa')]===_0x6d58('0x1d6')&&this[_0x6d58('0x25')][_0x320a54][_0x6d58('0xd6')]===_0x6d58('0xd7')){_0x49336f[_0x6d58('0x109')](this[_0x6d58('0x25')][_0x320a54]['id']);}}}this[_0x6d58('0xc2')](_0x19419e['id'],_0x49336f,_0x58c894,_0x19419e[_0x6d58('0x1cd')])[_0x6d58('0xb9')](function(_0x9a6951){_0x19419e[_0x6d58('0x1cc')]-=_0x58c894;_0x19419e[_0x6d58('0x1cc')]=_0x19419e[_0x6d58('0x1cc')]>0x0?_0x19419e[_0x6d58('0x1cc')]:0x0;if(!checkContactEmpty(_0x9a6951)){_0x1689a7[_0x6d58('0x1d7')](_0x19419e)[_0x6d58('0xb9')](sendMessageReschedule(_0x19419e))[_0x6d58('0xb3')](loggerCatch('[countReScheduled]\x20'));}else{_0x19419e[_0x6d58('0x75')]+=_0x9a6951[_0x6d58('0x9d')];_0x19419e[_0x6d58('0x44')]=_0x19419e['dialMethod']===_0x6d58('0x9')?_0x6d58('0x150'):_0x6d58('0x1d0');for(var _0x33c37a=0x0;_0x33c37a<_0x9a6951[_0x6d58('0x9d')];_0x33c37a+=0x1){if(_[_0x6d58('0xb1')](_0x9a6951[_0x33c37a])||_['isNil'](_0x9a6951[_0x33c37a][_0x6d58('0x149')])||_['isNil'](_0x9a6951[_0x33c37a][_0x6d58('0x149')][_0x6d58('0x148')])){_0x1689a7[_0x6d58('0xcc')](_0x6d58('0x1d2'),_0x19419e,_0x9a6951[_0x33c37a]);}else{_0x1689a7[_0x6d58('0xba')](_[_0x6d58('0x10a')](_0x9a6951[_0x33c37a],[_0x6d58('0xd1'),_0x6d58('0x1d3')]))[_0x6d58('0xb9')](_0x1689a7['checkContactBlack'](_0x19419e,_0x9a6951[_0x33c37a]))['catch'](_0x1689a7[_0x6d58('0xcb')]('[actionOriginate]\x20',_0x19419e));}}}})[_0x6d58('0xb3')](loggerGetContactDialer(_0x6d58('0x1d8'),_0x19419e,_0x58c894));}};Dialer[_0x6d58('0x1f')][_0x6d58('0x96')]=function(_0x40990b){var _0x9162d9=this;if(_0x40990b[_0x6d58('0x1d5')]>0x0){var _0x25995e=_0x40990b[_0x6d58('0x1d5')]-_0x40990b['originated']-_0x40990b['talking'];if(_0x25995e>0x0){this[_0x6d58('0x1d9')](_0x40990b);}else{loggerPredictiveCalls['info'](_0x6d58('0x1da'));}}else{this[_0x6d58('0x1d9')](_0x40990b);}};Dialer[_0x6d58('0x1f')]['tryOriginatePredictive']=function(_0x5716b3){var _0x422584=this;var _0x95b78a=[];_0x5716b3[_0x6d58('0x75')]+=0x1;for(var _0x2b1d0c in this[_0x6d58('0x25')]){if(this[_0x6d58('0x25')][_0x6d58('0x9e')](_0x2b1d0c)){if(this[_0x6d58('0x25')][_0x2b1d0c][_0x6d58('0xaa')]===_0x6d58('0x1d6')&&this[_0x6d58('0x25')][_0x2b1d0c][_0x6d58('0xd6')]===_0x6d58('0xd7')){_0x95b78a[_0x6d58('0x109')](this['agents'][_0x2b1d0c]['id']);}}}this[_0x6d58('0xc2')](_0x5716b3['id'],_0x95b78a,0x1,_0x5716b3[_0x6d58('0x1cd')])[_0x6d58('0xb9')](function(_0xe7f8d7){if(!checkContactEmpty(_0xe7f8d7)){checkContactLowerLimitOriginate(_0x5716b3,0x1,0x0);_0x422584['countReScheduled'](_0x5716b3)['then'](sendMessageReschedule(_0x5716b3))[_0x6d58('0xb3')](loggerCatch(_0x6d58('0x1db')));}else{_0x5716b3['message']=_0x6d58('0x1d0');if(_[_0x6d58('0xb1')](_0xe7f8d7[0x0])||_[_0x6d58('0xb1')](_0xe7f8d7[0x0][_0x6d58('0x149')])||_[_0x6d58('0xb1')](_0xe7f8d7[0x0][_0x6d58('0x149')]['phone'])){_0x422584[_0x6d58('0xcc')](_0x6d58('0x1d2'),_0x5716b3,_0xe7f8d7[0x0]);}else{_0x422584[_0x6d58('0xba')](_['pick'](_0xe7f8d7[0x0],[_0x6d58('0xd1'),_0x6d58('0x1d3')]))[_0x6d58('0xb9')](_0x422584['checkContactBlack'](_0x5716b3,_0xe7f8d7[0x0]))['catch'](_0x422584[_0x6d58('0xcb')]('[actionOriginatePredictive]\x20',_0x5716b3));}}})[_0x6d58('0xb3')](loggerGetContactDialer(_0x6d58('0x1dc'),_0x5716b3,0x1));emitVoiceQueueSummary(_0x5716b3);};Dialer[_0x6d58('0x1f')][_0x6d58('0x1ae')]=function(_0x3397c0,_0x4ce72e,_0x7469f0,_0x1cb6d0,_0x4224a9,_0x4585cc){loggerPredictive[_0x6d58('0x81')](_0x6d58('0x1dd'));loggerPredictive[_0x6d58('0x81')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3397c0);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x1de'),_0x4ce72e);loggerPredictive['info'](_0x6d58('0x1df'),_0x7469f0);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x1e0'),_0x1cb6d0);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x1e1'),_0x4224a9);loggerPredictive['info'](_0x6d58('0x89'));return new BPromise(function(_0x430cae,_0x101812){if(_0x3397c0<=0x0||isNaN(_0x3397c0)){return _0x101812(msgResponse(_0x6d58('0x1e2'),_0x6d58('0x4f'),_0x6d58('0x1e3')+_0x3397c0));}if(_0x7469f0<=0x0||isNaN(_0x7469f0)){return _0x101812(msgResponse('[abandonmentRate]','Error',_0x6d58('0x1e4')+_0x7469f0));}if(_0x1cb6d0<=0x0||isNaN(_0x1cb6d0)){return _0x101812(msgResponse(_0x6d58('0x1e2'),_0x6d58('0x4f'),_0x6d58('0x1e5')+_0x1cb6d0));}if(_0x4ce72e<=0x0||isNaN(_0x4ce72e)){return _0x101812(msgResponse(_0x6d58('0x1e2'),_0x6d58('0x4f'),_0x6d58('0x1e6')+_0x4ce72e));}if(_0x4224a9<=0x0||isNaN(_0x4224a9)){return _0x101812(msgResponse('[abandonmentRate]',_0x6d58('0x4f'),_0x6d58('0x1e7')+_0x4224a9));}_0x4585cc=_0x4585cc||0x0;var _0x530bc3=0x1/_0x7469f0;var _0x1628c6=0x0;var _0x53c548=0x0;var _0x1ada69=0x0;var _0x2ff2d7=0x0;for(var _0x2ca311=0x0;_0x1ada69<_0x4224a9;_0x2ca311+=0x1){_0x53c548=_0x2ca311/_0x4ce72e;_0x1628c6=(_0x1cb6d0*_0x53c548+_0x4585cc)/_0x530bc3;_0x1ada69=erlangb(_0x1628c6,_0x3397c0);_0x2ff2d7=_0x1628c6/_0x3397c0*(0x1-erlangb(_0x1628c6,_0x3397c0));}return _0x430cae({'erlangCalls':_0x2ca311,'erlangCallToSecond':_0x4ce72e/_0x2ca311,'erlangAbandonmentRate':_0x1ada69,'erlangBusyFactor':_0x2ff2d7});});};Dialer['prototype']['busyFactor']=function(_0x4f54c3,_0x157fff,_0x1a53a7,_0x6da404,_0x19646b,_0x1233c8){loggerPredictive[_0x6d58('0x81')](_0x6d58('0x1e8'));loggerPredictive[_0x6d58('0x81')](_0x6d58('0x1e9'),_0x4f54c3);loggerPredictive[_0x6d58('0x81')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x157fff);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x1df'),_0x1a53a7);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x6da404);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x1ea'),_0x19646b);loggerPredictive[_0x6d58('0x81')](_0x6d58('0x89'));return new BPromise(function(_0x3a18db,_0x4a95bd){if(_0x4f54c3<=0x0||isNaN(_0x4f54c3)){return _0x4a95bd(msgResponse('[busyFactor]',_0x6d58('0x4f'),_0x6d58('0x1e3')+_0x4f54c3));}if(_0x1a53a7<=0x0||isNaN(_0x1a53a7)){return _0x4a95bd(msgResponse(_0x6d58('0x1eb'),_0x6d58('0x4f'),_0x6d58('0x1e4')+_0x1a53a7));}if(_0x6da404<=0x0||isNaN(_0x6da404)){return _0x4a95bd(msgResponse(_0x6d58('0x1eb'),_0x6d58('0x4f'),_0x6d58('0x1e5')+_0x6da404));}if(_0x157fff<=0x0||isNaN(_0x157fff)){return _0x4a95bd(msgResponse(_0x6d58('0x1eb'),'Error',_0x6d58('0x1e6')+_0x157fff));}if(_0x19646b<=0x0||isNaN(_0x19646b)){return _0x4a95bd(msgResponse(_0x6d58('0x1eb'),'Error',_0x6d58('0x1ec')+_0x19646b));}_0x1233c8=_0x1233c8||0x0;var _0x4e8899=0x1/_0x1a53a7;var _0x5d0aea=0x0;var _0x3f52f8=0x0;var _0x3ff8cf=0x0;var _0x2fdb0c=0x0;for(var _0x13b0e3=0x0;_0x2fdb0c<_0x19646b;_0x13b0e3+=0x1){_0x3f52f8=_0x13b0e3/_0x157fff;_0x5d0aea=(_0x6da404*_0x3f52f8+_0x1233c8)/_0x4e8899;_0x3ff8cf=erlangb(_0x5d0aea,_0x4f54c3);_0x2fdb0c=_0x5d0aea/_0x4f54c3*(0x1-erlangb(_0x5d0aea,_0x4f54c3));}return _0x3a18db({'erlangCalls':_0x13b0e3,'erlangCallToSecond':_0x157fff/_0x13b0e3,'erlangAbandonmentRate':_0x3ff8cf,'erlangBusyFactor':_0x2fdb0c});});};module[_0x6d58('0x1ed')]=Dialer;
\ No newline at end of file
diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js
index b646b23..580598d 100644
--- a/server/services/ami/dialer/queueCallerAbandon.js
+++ b/server/services/ami/dialer/queueCallerAbandon.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9fca=['droptime','ringtime','starttime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','seconds','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','calleridnum','number','responsetime'];(function(_0x5ff0c5,_0x23b78d){var _0x260424=function(_0x5c6077){while(--_0x5c6077){_0x5ff0c5['push'](_0x5ff0c5['shift']());}};_0x260424(++_0x23b78d);}(_0x9fca,0x1d0));var _0xa9fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9fca[_0x122ef9];return _0x42fba0;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x233282,_0x338910){var _0x18ec71=moment(_0x233282)[_0xa9fc('0x0')](0x0);var _0x52890d=moment(_0x338910)[_0xa9fc('0x0')](0x0);return _0x18ec71[_0xa9fc('0x1')](_0x52890d,_0xa9fc('0x2'));}function QueueCallerAbandon(_0x3e2133,_0x57ec74){this[_0xa9fc('0x3')]=_0x3e2133['scheduledat'];this['type']=_0x3e2133['type'];this[_0xa9fc('0x4')]=_0x3e2133[_0xa9fc('0x5')]===_0xa9fc('0x6')?_0xa9fc('0x7'):_0x3e2133['type'];this[_0xa9fc('0x8')]=_0x3e2133['countbusyretry'];this[_0xa9fc('0x9')]=_0x3e2133['countcongestionretry'];this['countnoanswerretry']=_0x3e2133[_0xa9fc('0xa')];this['countglobal']=_0x3e2133[_0xa9fc('0x8')]+_0x3e2133[_0xa9fc('0x9')]+_0x3e2133[_0xa9fc('0xa')];this[_0xa9fc('0xb')]=_0x57ec74[_0xa9fc('0xb')];this[_0xa9fc('0xc')]=_0x3e2133[_0xa9fc('0xd')];this[_0xa9fc('0xe')]=_0x3e2133[_0xa9fc('0xf')];this['starttime']=_0x3e2133['starttime'];this[_0xa9fc('0x10')]=_0x3e2133['responsetime'];this[_0xa9fc('0x11')]=_0x3e2133[_0xa9fc('0x11')];this['endtime']=this[_0xa9fc('0x11')];this[_0xa9fc('0x12')]=getSeconds(_0x3e2133[_0xa9fc('0x10')],_0x3e2133[_0xa9fc('0x13')]);this[_0xa9fc('0x14')]=getSeconds(this['droptime'],_0x3e2133[_0xa9fc('0x10')]);this[_0xa9fc('0x15')]=0x0;this['queue']=_0x57ec74[_0xa9fc('0x7')];this[_0xa9fc('0x16')]=_0x57ec74[_0xa9fc('0x17')];this[_0xa9fc('0x18')]=_0x57ec74[_0xa9fc('0x18')];this[_0xa9fc('0x19')]=_0x3e2133['callback'];this['callbackuniqueid']=_0x3e2133[_0xa9fc('0x1a')];this['callbackat']=_0x3e2133[_0xa9fc('0x1b')];this['recallme']=_0x3e2133[_0xa9fc('0x1c')];this['ContactId']=_0x3e2133[_0xa9fc('0x1d')];this[_0xa9fc('0x1e')]=_0x3e2133['ListId'];this['UserId']=_0x3e2133[_0xa9fc('0x1f')];this[_0xa9fc('0x20')]=_0x3e2133['VoiceQueueId'];this[_0xa9fc('0x21')]=_0x3e2133['CampaignId'];this[_0xa9fc('0x22')]=_0x3e2133[_0xa9fc('0x22')]||'';this[_0xa9fc('0x23')]=_0x3e2133[_0xa9fc('0x23')]||'';}module[_0xa9fc('0x24')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x1dc9=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1dc9,0x7b));var _0x91dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dc9[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x91dc('0x0'));var _=require(_0x91dc('0x1'));var moment=require(_0x91dc('0x2'));function getSeconds(_0x4a20a2,_0x1f15b0){var _0x3acc3c=moment(_0x4a20a2)['milliseconds'](0x0);var _0x26292e=moment(_0x1f15b0)[_0x91dc('0x3')](0x0);return _0x3acc3c[_0x91dc('0x4')](_0x26292e,_0x91dc('0x5'));}function QueueCallerAbandon(_0x17572b,_0x1bd0b9){this[_0x91dc('0x6')]=_0x17572b['scheduledat'];this[_0x91dc('0x7')]=_0x17572b['type'];this['campaigntype']=_0x17572b[_0x91dc('0x7')]===_0x91dc('0x8')?_0x91dc('0x9'):_0x17572b[_0x91dc('0x7')];this[_0x91dc('0xa')]=_0x17572b[_0x91dc('0xa')];this[_0x91dc('0xb')]=_0x17572b[_0x91dc('0xb')];this[_0x91dc('0xc')]=_0x17572b[_0x91dc('0xc')];this[_0x91dc('0xd')]=_0x17572b[_0x91dc('0xa')]+_0x17572b[_0x91dc('0xb')]+_0x17572b[_0x91dc('0xc')];this['uniqueid']=_0x1bd0b9[_0x91dc('0xe')];this[_0x91dc('0xf')]=_0x17572b['name'];this[_0x91dc('0x10')]=_0x17572b[_0x91dc('0x11')];this['starttime']=_0x17572b[_0x91dc('0x12')];this[_0x91dc('0x13')]=_0x17572b[_0x91dc('0x13')];this[_0x91dc('0x14')]=_0x17572b[_0x91dc('0x14')];this['endtime']=this[_0x91dc('0x14')];this[_0x91dc('0x15')]=getSeconds(_0x17572b[_0x91dc('0x13')],_0x17572b[_0x91dc('0x12')]);this[_0x91dc('0x16')]=getSeconds(this[_0x91dc('0x14')],_0x17572b[_0x91dc('0x13')]);this[_0x91dc('0x17')]=0x0;this[_0x91dc('0x9')]=_0x1bd0b9[_0x91dc('0x9')];this[_0x91dc('0x18')]=_0x1bd0b9[_0x91dc('0x19')];this[_0x91dc('0x1a')]=_0x1bd0b9['reason'];this[_0x91dc('0x1b')]=_0x17572b[_0x91dc('0x1b')];this[_0x91dc('0x1c')]=_0x17572b[_0x91dc('0x1c')];this[_0x91dc('0x1d')]=_0x17572b[_0x91dc('0x1d')];this[_0x91dc('0x1e')]=_0x17572b[_0x91dc('0x1e')];this[_0x91dc('0x1f')]=_0x17572b[_0x91dc('0x1f')];this[_0x91dc('0x20')]=_0x17572b[_0x91dc('0x20')];this[_0x91dc('0x21')]=_0x17572b['UserId'];this[_0x91dc('0x22')]=_0x17572b[_0x91dc('0x22')];this[_0x91dc('0x23')]=_0x17572b[_0x91dc('0x23')];this['originatecalleridnum']=_0x17572b['originatecalleridnum']||'';this[_0x91dc('0x24')]=_0x17572b['originatecalleridname']||'';}module[_0x91dc('0x25')]=QueueCallerAbandon;
\ No newline at end of file
diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js
index f7c180e..72915ac 100644
--- a/server/services/ami/fax/action.js
+++ b/server/services/ami/fax/action.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3aa7=['AttachmentId','exports','util','lodash','moment','uniqueid','channel','format','%s/%s/%s','tech','name','fax','localstationid','headerinfo','path'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0x3aa7,0x13d));var _0x73aa=function(_0x2f8c78,_0x21e252){_0x2f8c78=_0x2f8c78-0x0;var _0x48b64b=_0x3aa7[_0x2f8c78];return _0x48b64b;};'use strict';var util=require(_0x73aa('0x0'));var _=require(_0x73aa('0x1'));var moment=require(_0x73aa('0x2'));function Action(_0x5ba1aa,_0x178904,_0x344bb0){this[_0x73aa('0x3')]=_0x5ba1aa||undefined;this[_0x73aa('0x4')]=util[_0x73aa('0x5')](_0x73aa('0x6'),_0x178904[_0x73aa('0x7')],_0x178904['Trunk'][_0x73aa('0x8')],_0x344bb0[_0x73aa('0x9')]);this[_0x73aa('0xa')]=_0x178904[_0x73aa('0xa')];this['headerinfo']=_0x178904[_0x73aa('0xb')];this[_0x73aa('0xc')]=_0x344bb0[_0x73aa('0xc')];this[_0x73aa('0xd')]=_0x344bb0['AttachmentId'];}module[_0x73aa('0xe')]=Action;
\ No newline at end of file
+var _0x3556=['path','AttachmentId','exports','util','lodash','moment','uniqueid','tech','Trunk','fax','localstationid','headerinfo'];(function(_0x3cc720,_0x1771d1){var _0x4ca9a0=function(_0x1ceb05){while(--_0x1ceb05){_0x3cc720['push'](_0x3cc720['shift']());}};_0x4ca9a0(++_0x1771d1);}(_0x3556,0xab));var _0x6355=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x3556[_0xbd08b4];return _0x314f1e;};'use strict';var util=require(_0x6355('0x0'));var _=require(_0x6355('0x1'));var moment=require(_0x6355('0x2'));function Action(_0x4f6c3a,_0x5df8e1,_0xc963cf){this[_0x6355('0x3')]=_0x4f6c3a||undefined;this['channel']=util['format']('%s/%s/%s',_0x5df8e1[_0x6355('0x4')],_0x5df8e1[_0x6355('0x5')]['name'],_0xc963cf[_0x6355('0x6')]);this[_0x6355('0x7')]=_0x5df8e1[_0x6355('0x7')];this[_0x6355('0x8')]=_0x5df8e1[_0x6355('0x8')];this[_0x6355('0x9')]=_0xc963cf[_0x6355('0x9')];this[_0x6355('0xa')]=_0xc963cf[_0x6355('0xa')];}module[_0x6355('0xb')]=Action;
\ No newline at end of file
diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js
index 89bb025..374d341 100644
--- a/server/services/ami/fax/index.js
+++ b/server/services/ami/fax/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2fd5=['\x20result\x20conversion\x20file\x20','message','create','parse','name','.pdf','then','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','response','AttachmentId','update','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','logger','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED','execOriginate','FaxAccountId','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH','Action','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','./util/gs','../../../config/logger','fax','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','receivefax','hangup','syncOriginateResponse','prototype','from-voip-provider','localstationid','uniqueid','channel','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','hasOwnProperty','syncFaxStatus','operation','status','filename','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/'];(function(_0x4da39e,_0x47e3ed){var _0x2a8580=function(_0x555ce7){while(--_0x555ce7){_0x4da39e['push'](_0x4da39e['shift']());}};_0x2a8580(++_0x47e3ed);}(_0x2fd5,0xa9));var _0x52fd=function(_0x530682,_0x378309){_0x530682=_0x530682-0x0;var _0x445a23=_0x2fd5[_0x530682];return _0x445a23;};'use strict';var util=require(_0x52fd('0x0'));var _=require(_0x52fd('0x1'));var BPromise=require(_0x52fd('0x2'));var uuid=require(_0x52fd('0x3'));var moment=require(_0x52fd('0x4'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require(_0x52fd('0x5'));var logger=require(_0x52fd('0x6'))(_0x52fd('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x52fd('0x8'));var ut=require(_0x52fd('0x9'));var Action=require(_0x52fd('0xa'));var faxAccount=require(_0x52fd('0xb'));var attachment=require(_0x52fd('0xc'));var faxMessage=require(_0x52fd('0xd'));function Fax(_0x2428ac){this[_0x52fd('0xe')]={};this[_0x52fd('0xf')]=_0x2428ac[_0x52fd('0xf')];this[_0x52fd('0x10')]=_0x2428ac['trunks'];this[_0x52fd('0x11')]={};ami['on'](_0x52fd('0x12'),this[_0x52fd('0x13')][_0x52fd('0x14')](this));ami['on'](_0x52fd('0x15'),this[_0x52fd('0x16')][_0x52fd('0x14')](this));ami['on']('newstate',this[_0x52fd('0x17')][_0x52fd('0x14')](this));ami['on'](_0x52fd('0x18'),this[_0x52fd('0x19')][_0x52fd('0x14')](this));ami['on'](_0x52fd('0x1a'),this['syncFaxStatus'][_0x52fd('0x14')](this));ami['on'](_0x52fd('0x1b'),this['syncReceiveFax'][_0x52fd('0x14')](this));ami['on'](_0x52fd('0x1c'),this['syncHangup'][_0x52fd('0x14')](this));ami['on']('originateresponse',this[_0x52fd('0x1d')][_0x52fd('0x14')](this));}Fax[_0x52fd('0x1e')][_0x52fd('0x13')]=function(_0x50a946){if(_0x50a946['context']===_0x52fd('0x1f')){for(var _0x4bd90d in this['faxAccounts']){if(this[_0x52fd('0xf')]['hasOwnProperty'](_0x4bd90d)){if(_0x50a946['exten']===this[_0x52fd('0xf')][_0x4bd90d][_0x52fd('0x20')]){this[_0x52fd('0xe')][_0x50a946[_0x52fd('0x21')]]={};this['channels'][_0x50a946[_0x52fd('0x21')]][_0x52fd('0x22')]=_0x50a946[_0x52fd('0x22')];this[_0x52fd('0xe')][_0x50a946[_0x52fd('0x21')]]['id']=this['faxAccounts'][_0x4bd90d]['id'];this['channels'][_0x50a946['uniqueid']]['name']=this[_0x52fd('0xf')][_0x4bd90d]['name'];logger[_0x52fd('0x23')](_0x50a946[_0x52fd('0x21')],_0x52fd('0x24'));}}}}if(this[_0x52fd('0x11')][_0x50a946[_0x52fd('0x21')]]){this[_0x52fd('0xe')][_0x50a946[_0x52fd('0x21')]]={};this[_0x52fd('0xe')][_0x50a946['uniqueid']][_0x52fd('0x22')]=_0x50a946[_0x52fd('0x22')];logger[_0x52fd('0x23')](_0x50a946[_0x52fd('0x21')],'\x20syncNewchannel\x20');}};Fax[_0x52fd('0x1e')]['syncVarSet']=function(_0xf9a6f7){if(this[_0x52fd('0xe')][_0xf9a6f7[_0x52fd('0x21')]]){for(var _0x39b71a in _0xf9a6f7[_0x52fd('0x25')]){if(_0xf9a6f7[_0x52fd('0x25')]['hasOwnProperty'](_0x39b71a)){this[_0x52fd('0xe')][_0xf9a6f7['uniqueid']][_0x39b71a]=_0xf9a6f7[_0x52fd('0x26')];}}}};Fax[_0x52fd('0x1e')][_0x52fd('0x17')]=function(_0x11043f){if(this[_0x52fd('0xe')][_0x11043f['uniqueid']]){this[_0x52fd('0xe')][_0x11043f[_0x52fd('0x21')]][_0x52fd('0x27')]=_0x11043f[_0x52fd('0x27')];this[_0x52fd('0xe')][_0x11043f['uniqueid']][_0x52fd('0x28')]=_0x11043f[_0x52fd('0x28')];}};Fax[_0x52fd('0x1e')][_0x52fd('0x19')]=function(_0x285657){if(this['channels'][_0x285657[_0x52fd('0x21')]]){for(var _0x447b63 in _0x285657[_0x52fd('0x25')]){if(_0x285657[_0x52fd('0x25')][_0x52fd('0x29')](_0x447b63)){this[_0x52fd('0xe')][_0x285657[_0x52fd('0x21')]][_0x447b63]=_0x285657[_0x52fd('0x26')];}}}};Fax[_0x52fd('0x1e')][_0x52fd('0x2a')]=function(_0x34dffa){if(this[_0x52fd('0xe')][_0x34dffa[_0x52fd('0x21')]]){this[_0x52fd('0xe')][_0x34dffa[_0x52fd('0x21')]][_0x52fd('0x2b')]=_0x34dffa[_0x52fd('0x2b')];this[_0x52fd('0xe')][_0x34dffa[_0x52fd('0x21')]][_0x52fd('0x2c')]=_0x34dffa[_0x52fd('0x2c')];this['channels'][_0x34dffa[_0x52fd('0x21')]][_0x52fd('0x20')]=_0x34dffa['localstationid'];this['channels'][_0x34dffa[_0x52fd('0x21')]][_0x52fd('0x2d')]=_0x34dffa[_0x52fd('0x2d')];logger[_0x52fd('0x23')](_0x34dffa[_0x52fd('0x21')],'\x20syncFaxStatus\x20');}};Fax[_0x52fd('0x1e')][_0x52fd('0x2e')]=function(_0x12de12){var _0x729122=this;if(this['channels'][_0x12de12[_0x52fd('0x21')]]){var _0x53ac48=this['channels'][_0x12de12[_0x52fd('0x21')]]['id'];this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x2f')]=_0x12de12['remotestationid'];this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x30')]=_0x12de12[_0x52fd('0x30')];this[_0x52fd('0xe')][_0x12de12['uniqueid']][_0x52fd('0x20')]=_0x12de12[_0x52fd('0x20')];this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x31')]=_0x12de12[_0x52fd('0x31')];this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x32')]=_0x12de12[_0x52fd('0x32')];this[_0x52fd('0xe')][_0x12de12['uniqueid']][_0x52fd('0x2d')]=_0x12de12[_0x52fd('0x2d')];this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x33')]=_0x12de12[_0x52fd('0x33')];if(this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x30')]>0x0){tiff2pdf(_0x12de12[_0x52fd('0x2d')],_0x52fd('0x34'),function(_0x3991be){logger['info'](_0x12de12[_0x52fd('0x21')],_0x52fd('0x35'),_0x3991be[_0x52fd('0x36')]);attachment[_0x52fd('0x37')]({'name':path[_0x52fd('0x38')](_0x12de12['filename'])[_0x52fd('0x39')],'basename':path[_0x52fd('0x38')](_0x12de12[_0x52fd('0x2d')])[_0x52fd('0x39')]+_0x52fd('0x3a'),'type':'application/pdf'})[_0x52fd('0x3b')](function(_0x479a53){faxAccount['notify'](_0x53ac48,{'from':_0x12de12[_0x52fd('0x33')],'mapKey':'fax','body':path[_0x52fd('0x38')](_0x12de12[_0x52fd('0x2d')])[_0x52fd('0x39')]+_0x52fd('0x3a'),'AttachmentId':_0x479a53['id']})[_0x52fd('0x3c')](function(_0x45439e){logger['error'](_0x12de12['uniqueid'],_0x52fd('0x3d'),JSON[_0x52fd('0x3e')](_0x45439e));});})['catch'](function(_0x422994){logger[_0x52fd('0x3f')](_0x12de12[_0x52fd('0x21')],'\x20receiveFax\x20',JSON[_0x52fd('0x3e')](_0x422994));});});}logger[_0x52fd('0x23')](_0x12de12['uniqueid'],_0x52fd('0x40'));}};Fax[_0x52fd('0x1e')][_0x52fd('0x1d')]=function(_0x51c0ee){if(this[_0x52fd('0x11')][_0x51c0ee[_0x52fd('0x21')]]){_[_0x52fd('0x41')](this[_0x52fd('0xe')][_0x51c0ee[_0x52fd('0x21')]],_['pick'](_0x51c0ee,[_0x52fd('0x42'),'reason']));}};function updateStatus(_0x29474b){if(_0x29474b[_0x52fd('0x43')]){faxMessage[_0x52fd('0x44')](_0x29474b['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x52fd('0x3b')](function(_0x4c1082){ut['logger']('[Fax][Message][Error][Updated]',_0x4c1082);})[_0x52fd('0x3c')](function(_0xe60dd5){ut['logger'](_0x52fd('0x45'),_0xe60dd5);});}else{ut['logger'](_0x52fd('0x46'));}}Fax['prototype'][_0x52fd('0x47')]=function(_0x22e7c5,_0x150721,_0x4b2d81){var _0x3e90c2=this;var _0x97d393={};if(_0x150721){_0x97d393={'read':_0x150721};}else{_0x97d393={'failMessage':_0x4b2d81};}if(this[_0x52fd('0x11')][_0x22e7c5]['AttachmentId']){faxMessage[_0x52fd('0x44')](this[_0x52fd('0x11')][_0x22e7c5][_0x52fd('0x43')],_0x97d393)['then'](function(_0x281cfa){ut[_0x52fd('0x48')]('[Fax][Message][Updated]',_0x281cfa);})[_0x52fd('0x3c')](function(_0x945d3c){ut[_0x52fd('0x48')](_0x52fd('0x49'),_0x945d3c);})[_0x52fd('0x4a')](function(){delete _0x3e90c2[_0x52fd('0xe')][_0x22e7c5];delete _0x3e90c2[_0x52fd('0x11')][_0x22e7c5];});}else{ut[_0x52fd('0x48')](_0x52fd('0x4b'));delete this[_0x52fd('0xe')][_0x22e7c5];delete this[_0x52fd('0x11')][_0x22e7c5];}};Fax['prototype'][_0x52fd('0x4c')]=function(_0x357337){var _0x388ca4=this;if(this[_0x52fd('0xe')][_0x357337[_0x52fd('0x21')]]){if(this['actions'][_0x357337[_0x52fd('0x21')]]){this['channels'][_0x357337[_0x52fd('0x21')]]['id']=this[_0x52fd('0x11')][_0x357337[_0x52fd('0x21')]]['id'];this[_0x52fd('0xe')][_0x357337[_0x52fd('0x21')]]['name']=this[_0x52fd('0x11')][_0x357337[_0x52fd('0x21')]][_0x52fd('0x39')];}logger[_0x52fd('0x23')](_0x357337[_0x52fd('0x21')],this[_0x52fd('0x11')][_0x357337['uniqueid']]?_0x52fd('0x4d'):_0x52fd('0x4e'),JSON[_0x52fd('0x3e')](this['channels'][_0x357337[_0x52fd('0x21')]]));if(this[_0x52fd('0x11')][_0x357337[_0x52fd('0x21')]]){if(this[_0x52fd('0xe')][_0x357337['uniqueid']][_0x52fd('0x4f')]>0x0&&this[_0x52fd('0xe')][_0x357337['uniqueid']][_0x52fd('0x1a')]==='SUCCESS'){this[_0x52fd('0x47')](_0x357337[_0x52fd('0x21')],!![]);}else{this[_0x52fd('0x47')](_0x357337[_0x52fd('0x21')],![],this[_0x52fd('0xe')][_0x357337[_0x52fd('0x21')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0x52fd('0xe')][_0x357337[_0x52fd('0x21')]][_0x52fd('0x50')]:_0x52fd('0x51'));}}}};Fax[_0x52fd('0x1e')]['send']=function(_0x4384ae){var _0xa7d005=this;return new BPromise(function(_0x3e397e,_0x15d481){_0xa7d005[_0x52fd('0x52')](_0x4384ae,_0xa7d005[_0x52fd('0xf')][_0x4384ae[_0x52fd('0x53')]])[_0x52fd('0x3b')](function(_0x555c3e){ut[_0x52fd('0x48')]('[Fax][execOriginate][success]',_0x555c3e);_0x3e397e(ut[_0x52fd('0x36')](_0x52fd('0x54')));})[_0x52fd('0x3c')](function(_0x50c3cc){ut[_0x52fd('0x48')]('[Fax][execOriginate][failure]',_0x50c3cc);updateStatus(_0x4384ae);_0x15d481(ut[_0x52fd('0x36')](_0x52fd('0x55')));});});};Fax[_0x52fd('0x1e')][_0x52fd('0x56')]=function(_0x654821){var _0x5294af=this;return new BPromise(function(_0x23aaa8,_0x54ea51){var _0x1eb4fb=_0x5294af[_0x52fd('0x57')](_0x5294af[_0x52fd('0xf')][_0x654821['FaxAccountId']]['Trunk'],_0x654821);if(_0x1eb4fb[_0x52fd('0x58')]){_0x23aaa8(ut[_0x52fd('0x36')]('Trunk\x20Reachable'));}else{_0x54ea51(ut[_0x52fd('0x36')](_0x1eb4fb[_0x52fd('0x36')]));}});};function originate(_0xd45230,_0x918a51,_0x25228d){return new BPromise(function(_0x5a7493,_0x5ca600){if(_0x25228d){var _0x5910d0=util[_0x52fd('0x59')](_0x52fd('0x5a'),path[_0x52fd('0x38')](_0xd45230[_0x52fd('0x5b')])[_0x52fd('0x39')],_0xd45230['path']);gs[_0x52fd('0x5c')](_0x5910d0)[_0x52fd('0x3b')](function(){_0xd45230['path']=util[_0x52fd('0x59')](_0x52fd('0x5d'),path[_0x52fd('0x38')](_0xd45230[_0x52fd('0x5b')])[_0x52fd('0x5e')],path[_0x52fd('0x38')](_0xd45230[_0x52fd('0x5b')])[_0x52fd('0x39')]);_0x918a51[_0x52fd('0x5f')]=_0xd45230[_0x52fd('0x5b')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x52fd('0x60')](ut['variablesAction'](_0xd45230,_0x918a51))[_0x52fd('0x3b')](function(_0x63e61a){_0x5a7493(_0x63e61a);})['catch'](function(_0x2ee346){_0x5ca600(_0x2ee346);});})[_0x52fd('0x3c')](function(_0x1d690a){_0x5ca600(_0x1d690a);});}else{ami[_0x52fd('0x60')](ut['variablesAction'](_0xd45230,_0x918a51))[_0x52fd('0x3b')](function(_0x4d6ff3){_0x5a7493(_0x4d6ff3);})[_0x52fd('0x3c')](function(_0x337378){_0x5ca600(_0x337378);});}});}Fax[_0x52fd('0x1e')]['execOriginate']=function(_0x1ed7c1,_0x3b2110){var _0x5d1505=this;return new BPromise(function(_0x2dce02,_0x7ee309){var _0x458d9b=uuid['v4']();var _0x11d180=ut['addVariables'](_0x1ed7c1,_0x3b2110);_0x5d1505['actions'][_0x458d9b]=new Action(_0x458d9b,_0x3b2110,_0x1ed7c1);var _0x9472eb=_0x5d1505['actions'][_0x458d9b];if(path[_0x52fd('0x38')](_0x1ed7c1['path'])['ext']===_0x52fd('0x3a')){originate(_0x9472eb,_0x11d180,!![])[_0x52fd('0x3b')](function(_0x16f6b5){_0x2dce02(_0x16f6b5);})['catch'](function(_0x4be586){_0x7ee309(_0x4be586);});}else{originate(_0x9472eb,_0x11d180,![])[_0x52fd('0x3b')](function(_0x5d6775){_0x2dce02(_0x5d6775);})['catch'](function(_0x24d6a7){_0x7ee309(_0x24d6a7);});}});};Fax[_0x52fd('0x1e')][_0x52fd('0x61')]=function(_0x17e5ca){return!_[_0x52fd('0x62')](_0x17e5ca)&&!_[_0x52fd('0x62')](_0x17e5ca[_0x52fd('0x39')])&&!_[_0x52fd('0x62')](_0x17e5ca[_0x52fd('0x63')])&&_0x17e5ca[_0x52fd('0x63')]&&!_[_0x52fd('0x62')](this[_0x52fd('0x10')][util['format'](_0x52fd('0x64'),_0x17e5ca['name'])])&&!_[_0x52fd('0x62')](this[_0x52fd('0x10')][util['format']('SIP/%s',_0x17e5ca[_0x52fd('0x39')])][_0x52fd('0x2c')])&&(this[_0x52fd('0x10')][util['format'](_0x52fd('0x64'),_0x17e5ca[_0x52fd('0x39')])][_0x52fd('0x2c')]===_0x52fd('0x65')||this[_0x52fd('0x10')][util[_0x52fd('0x59')]('SIP/%s',_0x17e5ca['name'])][_0x52fd('0x2c')]===_0x52fd('0x66'));};Fax['prototype'][_0x52fd('0x57')]=function(_0x265838,_0x3868ab){if(!this['isTrunkReachable'](_0x265838)){ut[_0x52fd('0x48')](_0x52fd('0x67'),_[_0x52fd('0x62')](_0x265838)?'':_0x265838[_0x52fd('0x39')]+_0x52fd('0x68'));return{'isValid':![],'message':_0x52fd('0x69')};}if(_['isNil'](_0x3868ab['fax'])){ut[_0x52fd('0x48')](_0x52fd('0x6a'),JSON['stringify'](_0x3868ab));return{'isValid':![],'message':_0x52fd('0x6b')};}if(_[_0x52fd('0x62')](_0x3868ab['path'])){ut[_0x52fd('0x48')](_0x52fd('0x6c'),JSON['stringify'](_0x3868ab));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x52fd('0x6d')};};module[_0x52fd('0x6e')]=Fax;
\ No newline at end of file
+var _0x9204=['operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20receiveFax\x20','stringify','merge','response','reason','SENDING\x20FAILED\x20','logger','AttachmentId','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk\x20Reachable','format','execute','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','path','./util/gs','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','newexten','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','context','from-voip-provider','exten','localstationid','channels','uniqueid','name','info','\x20syncNewchannel\x20','prototype','syncVarSet','variable','hasOwnProperty','value','syncNewState','channelstate','channelstatedesc','syncNewExten','syncFaxStatus'];(function(_0x4f2d7d,_0x25e0ca){var _0x3dd393=function(_0x5c173b){while(--_0x5c173b){_0x4f2d7d['push'](_0x4f2d7d['shift']());}};_0x3dd393(++_0x25e0ca);}(_0x9204,0x11e));var _0x4920=function(_0x30417e,_0x33b3a1){_0x30417e=_0x30417e-0x0;var _0x549274=_0x9204[_0x30417e];return _0x549274;};'use strict';var util=require(_0x4920('0x0'));var _=require(_0x4920('0x1'));var BPromise=require('bluebird');var uuid=require(_0x4920('0x2'));var moment=require(_0x4920('0x3'));var path=require(_0x4920('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x4920('0x5'));var logger=require('../../../config/logger')(_0x4920('0x6'));var ami=require(_0x4920('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x4920('0x8'));var ut=require(_0x4920('0x9'));var Action=require(_0x4920('0xa'));var faxAccount=require(_0x4920('0xb'));var attachment=require(_0x4920('0xc'));var faxMessage=require(_0x4920('0xd'));function Fax(_0x181293){this['channels']={};this[_0x4920('0xe')]=_0x181293[_0x4920('0xe')];this[_0x4920('0xf')]=_0x181293[_0x4920('0xf')];this[_0x4920('0x10')]={};ami['on'](_0x4920('0x11'),this[_0x4920('0x12')][_0x4920('0x13')](this));ami['on'](_0x4920('0x14'),this['syncVarSet']['bind'](this));ami['on'](_0x4920('0x15'),this['syncNewState'][_0x4920('0x13')](this));ami['on'](_0x4920('0x16'),this['syncNewExten'][_0x4920('0x13')](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on'](_0x4920('0x17'),this[_0x4920('0x18')][_0x4920('0x13')](this));ami['on'](_0x4920('0x19'),this['syncHangup'][_0x4920('0x13')](this));ami['on'](_0x4920('0x1a'),this[_0x4920('0x1b')]['bind'](this));}Fax['prototype'][_0x4920('0x12')]=function(_0xefa082){if(_0xefa082[_0x4920('0x1c')]===_0x4920('0x1d')){for(var _0x4d0743 in this[_0x4920('0xe')]){if(this[_0x4920('0xe')]['hasOwnProperty'](_0x4d0743)){if(_0xefa082[_0x4920('0x1e')]===this[_0x4920('0xe')][_0x4d0743][_0x4920('0x1f')]){this[_0x4920('0x20')][_0xefa082[_0x4920('0x21')]]={};this['channels'][_0xefa082['uniqueid']]['channel']=_0xefa082['channel'];this['channels'][_0xefa082[_0x4920('0x21')]]['id']=this[_0x4920('0xe')][_0x4d0743]['id'];this['channels'][_0xefa082['uniqueid']][_0x4920('0x22')]=this['faxAccounts'][_0x4d0743][_0x4920('0x22')];logger[_0x4920('0x23')](_0xefa082[_0x4920('0x21')],_0x4920('0x24'));}}}}if(this[_0x4920('0x10')][_0xefa082['uniqueid']]){this[_0x4920('0x20')][_0xefa082['uniqueid']]={};this[_0x4920('0x20')][_0xefa082[_0x4920('0x21')]]['channel']=_0xefa082['channel'];logger[_0x4920('0x23')](_0xefa082[_0x4920('0x21')],'\x20syncNewchannel\x20');}};Fax[_0x4920('0x25')][_0x4920('0x26')]=function(_0x1a59c2){if(this['channels'][_0x1a59c2[_0x4920('0x21')]]){for(var _0x51958e in _0x1a59c2[_0x4920('0x27')]){if(_0x1a59c2['variable'][_0x4920('0x28')](_0x51958e)){this[_0x4920('0x20')][_0x1a59c2['uniqueid']][_0x51958e]=_0x1a59c2[_0x4920('0x29')];}}}};Fax[_0x4920('0x25')][_0x4920('0x2a')]=function(_0x21e669){if(this[_0x4920('0x20')][_0x21e669['uniqueid']]){this['channels'][_0x21e669[_0x4920('0x21')]][_0x4920('0x2b')]=_0x21e669[_0x4920('0x2b')];this[_0x4920('0x20')][_0x21e669[_0x4920('0x21')]]['channelstatedesc']=_0x21e669[_0x4920('0x2c')];}};Fax[_0x4920('0x25')][_0x4920('0x2d')]=function(_0x2948dc){if(this[_0x4920('0x20')][_0x2948dc[_0x4920('0x21')]]){for(var _0x2ec802 in _0x2948dc[_0x4920('0x27')]){if(_0x2948dc['variable']['hasOwnProperty'](_0x2ec802)){this[_0x4920('0x20')][_0x2948dc[_0x4920('0x21')]][_0x2ec802]=_0x2948dc[_0x4920('0x29')];}}}};Fax[_0x4920('0x25')][_0x4920('0x2e')]=function(_0x4f0231){if(this[_0x4920('0x20')][_0x4f0231[_0x4920('0x21')]]){this[_0x4920('0x20')][_0x4f0231[_0x4920('0x21')]]['operation']=_0x4f0231[_0x4920('0x2f')];this[_0x4920('0x20')][_0x4f0231[_0x4920('0x21')]]['status']=_0x4f0231[_0x4920('0x30')];this['channels'][_0x4f0231[_0x4920('0x21')]][_0x4920('0x1f')]=_0x4f0231[_0x4920('0x1f')];this['channels'][_0x4f0231[_0x4920('0x21')]][_0x4920('0x31')]=_0x4f0231['filename'];logger['info'](_0x4f0231[_0x4920('0x21')],_0x4920('0x32'));}};Fax['prototype'][_0x4920('0x18')]=function(_0x422f12){var _0x244f7d=this;if(this['channels'][_0x422f12[_0x4920('0x21')]]){var _0x5e9dae=this[_0x4920('0x20')][_0x422f12[_0x4920('0x21')]]['id'];this['channels'][_0x422f12[_0x4920('0x21')]]['remotestationid']=_0x422f12[_0x4920('0x33')];this[_0x4920('0x20')][_0x422f12['uniqueid']][_0x4920('0x34')]=_0x422f12[_0x4920('0x34')];this[_0x4920('0x20')][_0x422f12[_0x4920('0x21')]][_0x4920('0x1f')]=_0x422f12[_0x4920('0x1f')];this[_0x4920('0x20')][_0x422f12[_0x4920('0x21')]][_0x4920('0x35')]=_0x422f12[_0x4920('0x35')];this[_0x4920('0x20')][_0x422f12[_0x4920('0x21')]][_0x4920('0x36')]=_0x422f12[_0x4920('0x36')];this[_0x4920('0x20')][_0x422f12[_0x4920('0x21')]]['filename']=_0x422f12[_0x4920('0x31')];this[_0x4920('0x20')][_0x422f12[_0x4920('0x21')]][_0x4920('0x37')]=_0x422f12[_0x4920('0x37')];if(this[_0x4920('0x20')][_0x422f12[_0x4920('0x21')]]['pagestransferred']>0x0){tiff2pdf(_0x422f12['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x5c4dac){logger[_0x4920('0x23')](_0x422f12[_0x4920('0x21')],'\x20result\x20conversion\x20file\x20',_0x5c4dac[_0x4920('0x38')]);attachment[_0x4920('0x39')]({'name':path['parse'](_0x422f12[_0x4920('0x31')])['name'],'basename':path[_0x4920('0x3a')](_0x422f12[_0x4920('0x31')])[_0x4920('0x22')]+_0x4920('0x3b'),'type':_0x4920('0x3c')})[_0x4920('0x3d')](function(_0x20abc6){faxAccount[_0x4920('0x3e')](_0x5e9dae,{'from':_0x422f12[_0x4920('0x37')],'mapKey':'fax','body':path[_0x4920('0x3a')](_0x422f12[_0x4920('0x31')])[_0x4920('0x22')]+_0x4920('0x3b'),'AttachmentId':_0x20abc6['id']})[_0x4920('0x3f')](function(_0x51e838){logger[_0x4920('0x40')](_0x422f12[_0x4920('0x21')],'\x20notify\x20',JSON['stringify'](_0x51e838));});})[_0x4920('0x3f')](function(_0xcb8f76){logger[_0x4920('0x40')](_0x422f12[_0x4920('0x21')],_0x4920('0x41'),JSON[_0x4920('0x42')](_0xcb8f76));});});}logger[_0x4920('0x23')](_0x422f12[_0x4920('0x21')],_0x4920('0x41'));}};Fax[_0x4920('0x25')]['syncOriginateResponse']=function(_0x410521){if(this['actions'][_0x410521[_0x4920('0x21')]]){_[_0x4920('0x43')](this['channels'][_0x410521[_0x4920('0x21')]],_['pick'](_0x410521,[_0x4920('0x44'),_0x4920('0x45')]));}};function updateStatus(_0x1b79b7){if(_0x1b79b7['AttachmentId']){faxMessage['update'](_0x1b79b7['AttachmentId'],{'failMessage':_0x4920('0x46')})['then'](function(_0x143fbf){ut['logger']('[Fax][Message][Error][Updated]',_0x143fbf);})[_0x4920('0x3f')](function(_0x12d30f){ut[_0x4920('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x12d30f);});}else{ut[_0x4920('0x47')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x4920('0x25')]['updateStatus']=function(_0x5a8b13,_0x526ae4,_0x2d1563){var _0x47de80=this;var _0xc41334={};if(_0x526ae4){_0xc41334={'read':_0x526ae4};}else{_0xc41334={'failMessage':_0x2d1563};}if(this[_0x4920('0x10')][_0x5a8b13][_0x4920('0x48')]){faxMessage[_0x4920('0x49')](this[_0x4920('0x10')][_0x5a8b13][_0x4920('0x48')],_0xc41334)[_0x4920('0x3d')](function(_0x57b8bf){ut['logger'](_0x4920('0x4a'),_0x57b8bf);})[_0x4920('0x3f')](function(_0x3ce9a4){ut[_0x4920('0x47')](_0x4920('0x4b'),_0x3ce9a4);})[_0x4920('0x4c')](function(){delete _0x47de80[_0x4920('0x20')][_0x5a8b13];delete _0x47de80[_0x4920('0x10')][_0x5a8b13];});}else{ut[_0x4920('0x47')](_0x4920('0x4d'));delete this[_0x4920('0x20')][_0x5a8b13];delete this[_0x4920('0x10')][_0x5a8b13];}};Fax[_0x4920('0x25')]['syncHangup']=function(_0xe22623){var _0x5d68e4=this;if(this['channels'][_0xe22623[_0x4920('0x21')]]){if(this[_0x4920('0x10')][_0xe22623[_0x4920('0x21')]]){this[_0x4920('0x20')][_0xe22623[_0x4920('0x21')]]['id']=this['actions'][_0xe22623['uniqueid']]['id'];this['channels'][_0xe22623['uniqueid']][_0x4920('0x22')]=this[_0x4920('0x10')][_0xe22623[_0x4920('0x21')]]['name'];}logger[_0x4920('0x23')](_0xe22623[_0x4920('0x21')],this[_0x4920('0x10')][_0xe22623[_0x4920('0x21')]]?_0x4920('0x4e'):_0x4920('0x4f'),JSON[_0x4920('0x42')](this['channels'][_0xe22623[_0x4920('0x21')]]));if(this['actions'][_0xe22623['uniqueid']]){if(this[_0x4920('0x20')][_0xe22623[_0x4920('0x21')]]['faxpages']>0x0&&this['channels'][_0xe22623[_0x4920('0x21')]][_0x4920('0x50')]===_0x4920('0x51')){this[_0x4920('0x52')](_0xe22623[_0x4920('0x21')],!![]);}else{this[_0x4920('0x52')](_0xe22623['uniqueid'],![],this[_0x4920('0x20')][_0xe22623['uniqueid']][_0x4920('0x53')]?_0x4920('0x54')+this[_0x4920('0x20')][_0xe22623[_0x4920('0x21')]][_0x4920('0x53')]:'SENDING\x20FAILED');}}}};Fax[_0x4920('0x25')]['send']=function(_0x373a29){var _0xa9c050=this;return new BPromise(function(_0x3054b8,_0x5354e2){_0xa9c050[_0x4920('0x55')](_0x373a29,_0xa9c050['faxAccounts'][_0x373a29['FaxAccountId']])[_0x4920('0x3d')](function(_0x3e6fa3){ut[_0x4920('0x47')](_0x4920('0x56'),_0x3e6fa3);_0x3054b8(ut['message'](_0x4920('0x57')));})[_0x4920('0x3f')](function(_0x190e7d){ut[_0x4920('0x47')]('[Fax][execOriginate][failure]',_0x190e7d);updateStatus(_0x373a29);_0x5354e2(ut[_0x4920('0x38')](_0x4920('0x58')));});});};Fax[_0x4920('0x25')][_0x4920('0x59')]=function(_0x181374){var _0x5a91e9=this;return new BPromise(function(_0x47f9e0,_0x1e7b0d){var _0x47085e=_0x5a91e9[_0x4920('0x5a')](_0x5a91e9[_0x4920('0xe')][_0x181374['FaxAccountId']]['Trunk'],_0x181374);if(_0x47085e['isValid']){_0x47f9e0(ut['message'](_0x4920('0x5b')));}else{_0x1e7b0d(ut['message'](_0x47085e[_0x4920('0x38')]));}});};function originate(_0x381e05,_0x50b30f,_0x1ae624){return new BPromise(function(_0x31eb02,_0x183136){if(_0x1ae624){var _0x17ef20=util[_0x4920('0x5c')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x381e05['path'])[_0x4920('0x22')],_0x381e05[_0x4920('0x4')]);gs[_0x4920('0x5d')](_0x17ef20)['then'](function(){_0x381e05[_0x4920('0x4')]=util[_0x4920('0x5c')]('%s/%s.tif',path['parse'](_0x381e05['path'])['dir'],path[_0x4920('0x3a')](_0x381e05['path'])[_0x4920('0x22')]);_0x50b30f[_0x4920('0x5e')]=_0x381e05['path'];ut[_0x4920('0x47')](_0x4920('0x5f'),'');ami[_0x4920('0x60')](ut['variablesAction'](_0x381e05,_0x50b30f))[_0x4920('0x3d')](function(_0x201c37){_0x31eb02(_0x201c37);})[_0x4920('0x3f')](function(_0x129295){_0x183136(_0x129295);});})[_0x4920('0x3f')](function(_0x567ab3){_0x183136(_0x567ab3);});}else{ami[_0x4920('0x60')](ut[_0x4920('0x61')](_0x381e05,_0x50b30f))[_0x4920('0x3d')](function(_0x58eab1){_0x31eb02(_0x58eab1);})[_0x4920('0x3f')](function(_0x30a277){_0x183136(_0x30a277);});}});}Fax[_0x4920('0x25')]['execOriginate']=function(_0x10cf4e,_0x21aecd){var _0x581ee4=this;return new BPromise(function(_0x4abac4,_0xf52eb9){var _0x3d3536=uuid['v4']();var _0x5a99d3=ut['addVariables'](_0x10cf4e,_0x21aecd);_0x581ee4[_0x4920('0x10')][_0x3d3536]=new Action(_0x3d3536,_0x21aecd,_0x10cf4e);var _0x24fd1d=_0x581ee4[_0x4920('0x10')][_0x3d3536];if(path[_0x4920('0x3a')](_0x10cf4e[_0x4920('0x4')])['ext']===_0x4920('0x3b')){originate(_0x24fd1d,_0x5a99d3,!![])['then'](function(_0x50feeb){_0x4abac4(_0x50feeb);})['catch'](function(_0x2a25e3){_0xf52eb9(_0x2a25e3);});}else{originate(_0x24fd1d,_0x5a99d3,![])[_0x4920('0x3d')](function(_0x403ab6){_0x4abac4(_0x403ab6);})[_0x4920('0x3f')](function(_0x2c2527){_0xf52eb9(_0x2c2527);});}});};Fax[_0x4920('0x25')][_0x4920('0x62')]=function(_0x1e89c4){return!_[_0x4920('0x63')](_0x1e89c4)&&!_['isNil'](_0x1e89c4['name'])&&!_[_0x4920('0x63')](_0x1e89c4[_0x4920('0x64')])&&_0x1e89c4[_0x4920('0x64')]&&!_[_0x4920('0x63')](this['trunks'][util[_0x4920('0x5c')](_0x4920('0x65'),_0x1e89c4[_0x4920('0x22')])])&&!_['isNil'](this[_0x4920('0xf')][util['format']('SIP/%s',_0x1e89c4['name'])][_0x4920('0x30')])&&(this[_0x4920('0xf')][util[_0x4920('0x5c')](_0x4920('0x65'),_0x1e89c4[_0x4920('0x22')])][_0x4920('0x30')]===_0x4920('0x66')||this['trunks'][util[_0x4920('0x5c')]('SIP/%s',_0x1e89c4[_0x4920('0x22')])][_0x4920('0x30')]===_0x4920('0x67'));};Fax[_0x4920('0x25')][_0x4920('0x5a')]=function(_0x4d91f8,_0x57c054){if(!this[_0x4920('0x62')](_0x4d91f8)){ut[_0x4920('0x47')](_0x4920('0x68'),_['isNil'](_0x4d91f8)?'':_0x4d91f8[_0x4920('0x22')]+_0x4920('0x69'));return{'isValid':![],'message':_0x4920('0x6a')};}if(_[_0x4920('0x63')](_0x57c054['fax'])){ut[_0x4920('0x47')](_0x4920('0x6b'),JSON[_0x4920('0x42')](_0x57c054));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x4920('0x63')](_0x57c054[_0x4920('0x4')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x57c054));return{'isValid':![],'message':_0x4920('0x6c')};}return{'isValid':!![],'message':_0x4920('0x6d')};};module[_0x4920('0x6e')]=Fax;
\ No newline at end of file
diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js
index 71da20c..402345e 100644
--- a/server/services/ami/fax/rpcDb.js
+++ b/server/services/ami/fax/rpcDb.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf78f=['lodash','../rpc/faxAccount','then','notify','catch','[Notify]\x20','bluebird','../../../config/logger','preview'];(function(_0x162c62,_0x9c6779){var _0x2c4b08=function(_0x1fadcd){while(--_0x1fadcd){_0x162c62['push'](_0x162c62['shift']());}};_0x2c4b08(++_0x9c6779);}(_0xf78f,0x72));var _0xff78=function(_0x34838f,_0x406e59){_0x34838f=_0x34838f-0x0;var _0x5b1222=_0xf78f[_0x34838f];return _0x5b1222;};'use strict';var util=require('util');var BPromise=require(_0xff78('0x0'));var logger=require(_0xff78('0x1'))(_0xff78('0x2'));var _=require(_0xff78('0x3'));var faxAccount=require(_0xff78('0x4'));function loggerCatch(_0x2cf009){return function(_0x48df16){logger['error'](_0x2cf009,util['inspect'](_0x48df16,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x5d11cd,_0x35f208){return BPromise['resolve']()[_0xff78('0x5')](faxAccount[_0xff78('0x6')](_0x5d11cd,_0x35f208))[_0xff78('0x7')](loggerCatch(_0xff78('0x8')));};
\ No newline at end of file
+var _0x579f=['resolve','then','[Notify]\x20','util','bluebird','preview','lodash','../rpc/faxAccount','error','inspect','notify'];(function(_0x165da6,_0x4bff8e){var _0x5b4948=function(_0x1c05be){while(--_0x1c05be){_0x165da6['push'](_0x165da6['shift']());}};_0x5b4948(++_0x4bff8e);}(_0x579f,0x14d));var _0xf579=function(_0x3642a1,_0xb6c822){_0x3642a1=_0x3642a1-0x0;var _0x111da3=_0x579f[_0x3642a1];return _0x111da3;};'use strict';var util=require(_0xf579('0x0'));var BPromise=require(_0xf579('0x1'));var logger=require('../../../config/logger')(_0xf579('0x2'));var _=require(_0xf579('0x3'));var faxAccount=require(_0xf579('0x4'));function loggerCatch(_0x7ddf2e){return function(_0x42a7c2){logger[_0xf579('0x5')](_0x7ddf2e,util[_0xf579('0x6')](_0x42a7c2,{'showHidden':![],'depth':null}));};}exports[_0xf579('0x7')]=function(_0x2d13c0,_0x203fc1){return BPromise[_0xf579('0x8')]()[_0xf579('0x9')](faxAccount[_0xf579('0x7')](_0x2d13c0,_0x203fc1))['catch'](loggerCatch(_0xf579('0xa')));};
\ No newline at end of file
diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js
index 091a819..18175e7 100644
--- a/server/services/ami/fax/util/gs.js
+++ b/server/services/ami/fax/util/gs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd88f=['../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0xf10c98,_0x34e198){var _0x57fd53=function(_0x1a11b7){while(--_0x1a11b7){_0xf10c98['push'](_0xf10c98['shift']());}};_0x57fd53(++_0x34e198);}(_0xd88f,0x112));var _0xfd88=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xd88f[_0x88cd7b];return _0x56fcc8;};'use strict';var util=require(_0xfd88('0x0'));var logger=require(_0xfd88('0x1'))(_0xfd88('0x2'));var BPromise=require(_0xfd88('0x3'));var exec=require(_0xfd88('0x4'))[_0xfd88('0x5')];exports[_0xfd88('0x6')]=function(_0x486304){return new BPromise(function(_0x48b61b,_0x2820e0){exec(_0x486304,function(_0xf749b1,_0x274df2,_0x5d17ad){logger[_0xfd88('0x7')](_0xfd88('0x8'),_0x274df2);if(_0xf749b1){logger[_0xfd88('0x7')]('Exec\x20gs',_0xfd88('0x9'),util[_0xfd88('0xa')](_0xf749b1,{'showHidden':![],'depth':null}),_0x274df2,_0x5d17ad);_0x2820e0(_0xf749b1);}_0x48b61b(_0x274df2);});});};
\ No newline at end of file
+var _0xf89c=['child_process','info','Exec\x20gs','\x20Error\x20:','util','bluebird'];(function(_0x4e85ec,_0x2913b6){var _0x1c1ab3=function(_0x2c55b6){while(--_0x2c55b6){_0x4e85ec['push'](_0x4e85ec['shift']());}};_0x1c1ab3(++_0x2913b6);}(_0xf89c,0xa6));var _0xcf89=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf89c[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xcf89('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0xcf89('0x1'));var exec=require(_0xcf89('0x2'))['exec'];exports['execute']=function(_0x43df07){return new BPromise(function(_0x3918a0,_0x3ee074){exec(_0x43df07,function(_0x114d31,_0x50535c,_0x49432b){logger[_0xcf89('0x3')](_0xcf89('0x4'),_0x50535c);if(_0x114d31){logger[_0xcf89('0x3')](_0xcf89('0x4'),_0xcf89('0x5'),util['inspect'](_0x114d31,{'showHidden':![],'depth':null}),_0x50535c,_0x49432b);_0x3ee074(_0x114d31);}_0x3918a0(_0x50535c);});});};
\ No newline at end of file
diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js
index 0528caa..c618d3f 100644
--- a/server/services/ami/fax/util/util.js
+++ b/server/services/ami/fax/util/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x142a=['logger','info','inspect','ecm','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','originate','channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','localstationid','uniqueid','util','lodash','moment','../../../../config/logger','fax','message'];(function(_0x281ee5,_0x479f84){var _0x4a81d2=function(_0x253ba2){while(--_0x253ba2){_0x281ee5['push'](_0x281ee5['shift']());}};_0x4a81d2(++_0x479f84);}(_0x142a,0x159));var _0xa142=function(_0x46894c,_0x15c966){_0x46894c=_0x46894c-0x0;var _0x4938c0=_0x142a[_0x46894c];return _0x4938c0;};'use strict';var util=require(_0xa142('0x0'));var _=require(_0xa142('0x1'));var moment=require(_0xa142('0x2'));var logger=require(_0xa142('0x3'))(_0xa142('0x4'));exports[_0xa142('0x5')]=function(_0x54b5b8){return{'message':_0x54b5b8};};exports[_0xa142('0x6')]=function(_0x2c1d4a,_0x4f7e40){logger[_0xa142('0x7')](_0x2c1d4a,util[_0xa142('0x8')](_0x4f7e40,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2af575,_0x45e2cb){var _0x7f11ae={'XMF-ECM':_0x45e2cb[_0xa142('0x9')],'XMF-HEADERINFO':_0x45e2cb['headerinfo'],'XMF-MINRATE':_0x45e2cb[_0xa142('0xa')],'XMF-MAXRATE':_0x45e2cb[_0xa142('0xb')],'XMF-MODEM':util[_0xa142('0xc')](_0xa142('0xd'),_0x45e2cb[_0xa142('0xe')]),'XMF-GATEWAY':_0x45e2cb[_0xa142('0xf')],'XMF-FAXDETECT':_0x45e2cb[_0xa142('0x10')],'XMF-T38TIMEOUT':_0x45e2cb[_0xa142('0x11')],'XMF-LOCALSTATIONID':_0x45e2cb['localstationid'],'XMF-PATH':_0x2af575[_0xa142('0x12')]};return _0x7f11ae;};exports[_0xa142('0x13')]=function(_0x2477c9,_0x20d6f6){return{'actionid':_0x2477c9['uniqueid'],'action':_0xa142('0x14'),'channel':_0x2477c9[_0xa142('0x15')],'Exten':'xcally-motion-fax','Context':_0xa142('0x16'),'Priority':'1','callerid':util[_0xa142('0xc')](_0xa142('0x17'),_0x2477c9['headerinfo']?_0x2477c9[_0xa142('0x18')]:'',_0x2477c9[_0xa142('0x19')]),'variable':_0x20d6f6,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2477c9[_0xa142('0x1a')]};};
\ No newline at end of file
+var _0xe5f9=['path','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','localstationid'];(function(_0x5e8f4f,_0x298d72){var _0x6a316b=function(_0x2e121c){while(--_0x2e121c){_0x5e8f4f['push'](_0x5e8f4f['shift']());}};_0x6a316b(++_0x298d72);}(_0xe5f9,0x1bc));var _0x9e5f=function(_0x51035b,_0x1cf2b2){_0x51035b=_0x51035b-0x0;var _0x2a5b33=_0xe5f9[_0x51035b];return _0x2a5b33;};'use strict';var util=require(_0x9e5f('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x9e5f('0x1'))(_0x9e5f('0x2'));exports[_0x9e5f('0x3')]=function(_0xeabea){return{'message':_0xeabea};};exports[_0x9e5f('0x4')]=function(_0x40a5a0,_0x1e63b2){logger[_0x9e5f('0x5')](_0x40a5a0,util[_0x9e5f('0x6')](_0x1e63b2,{'showHidden':![],'depth':null}));};exports[_0x9e5f('0x7')]=function(_0x48aced,_0x46aadb){var _0xd935b0={'XMF-ECM':_0x46aadb[_0x9e5f('0x8')],'XMF-HEADERINFO':_0x46aadb[_0x9e5f('0x9')],'XMF-MINRATE':_0x46aadb['minrate'],'XMF-MAXRATE':_0x46aadb[_0x9e5f('0xa')],'XMF-MODEM':util[_0x9e5f('0xb')](_0x9e5f('0xc'),_0x46aadb[_0x9e5f('0xd')]),'XMF-GATEWAY':_0x46aadb[_0x9e5f('0xe')],'XMF-FAXDETECT':_0x46aadb['faxdetect'],'XMF-T38TIMEOUT':_0x46aadb['t38timeout'],'XMF-LOCALSTATIONID':_0x46aadb[_0x9e5f('0xf')],'XMF-PATH':_0x48aced[_0x9e5f('0x10')]};return _0xd935b0;};exports[_0x9e5f('0x11')]=function(_0x4b891f,_0x5de290){return{'actionid':_0x4b891f[_0x9e5f('0x12')],'action':_0x9e5f('0x13'),'channel':_0x4b891f[_0x9e5f('0x14')],'Exten':'xcally-motion-fax','Context':_0x9e5f('0x15'),'Priority':'1','callerid':util[_0x9e5f('0xb')](_0x9e5f('0x16'),_0x4b891f['headerinfo']?_0x4b891f[_0x9e5f('0x9')]:'',_0x4b891f[_0x9e5f('0xf')]),'variable':_0x5de290,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4b891f[_0x9e5f('0x12')]};};
\ No newline at end of file
diff --git a/server/services/ami/index.js b/server/services/ami/index.js
index 9f8912f..272de47 100644
--- a/server/services/ami/index.js
+++ b/server/services/ami/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b39=['initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueueReport','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports'];(function(_0x2de7ff,_0x2ce730){var _0x46f8dc=function(_0x1edd3c){while(--_0x1edd3c){_0x2de7ff['push'](_0x2de7ff['shift']());}};_0x46f8dc(++_0x2ce730);}(_0x9b39,0x90));var _0x99b3=function(_0x2b0c2e,_0x586346){_0x2b0c2e=_0x2b0c2e-0x0;var _0xd6c0aa=_0x9b39[_0x2b0c2e];return _0xd6c0aa;};'use strict';var BPromise=require(_0x99b3('0x0'));var util=require(_0x99b3('0x1'));var moment=require(_0x99b3('0x2'));var server=require(_0x99b3('0x3'));var Realtime=require(_0x99b3('0x4'));var Report=require(_0x99b3('0x5'));var Acw=require(_0x99b3('0x6'));var Trigger=require(_0x99b3('0x7'));var Dialer=require(_0x99b3('0x8'));var Preview=require(_0x99b3('0x9'));var Fax=require(_0x99b3('0xa'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x99b3('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0x99b3('0xc'));var cmHopperHistory=require(_0x99b3('0xd'));var campaign=require(_0x99b3('0xe'));var voiceExtension=require(_0x99b3('0xf'));var faxAccount=require(_0x99b3('0x10'));var zendesk=require(_0x99b3('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x99b3('0x12'));var freshdesk=require(_0x99b3('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x99b3('0x14'));var vtiger=require(_0x99b3('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x99b3('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x99b3('0x17')](_0x99b3('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x99b3('0x17')](_0x99b3('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x99b3('0x19')]()[_0x99b3('0x1a')](user[_0x99b3('0x1b')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x1c')]())[_0x99b3('0x1a')](user[_0x99b3('0x1d')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x1e')]())[_0x99b3('0x1a')](trunk[_0x99b3('0x1f')]())['then'](realtime[_0x99b3('0x20')]())[_0x99b3('0x1a')](voiceQueue['getVoiceQueues']())[_0x99b3('0x1a')](realtime[_0x99b3('0x21')]())[_0x99b3('0x1a')](trigger[_0x99b3('0x22')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x23')]())[_0x99b3('0x1a')](template['getTemplates']())[_0x99b3('0x1a')](realtime['initTemplates']())['then'](zendesk[_0x99b3('0x24')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x25')]())[_0x99b3('0x1a')](salesforce[_0x99b3('0x26')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x27')]())['then'](sugarcrm[_0x99b3('0x28')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x29')]())[_0x99b3('0x1a')](freshdesk[_0x99b3('0x2a')]())['then'](realtime[_0x99b3('0x2b')]())[_0x99b3('0x1a')](desk['getDeskAccounts']())[_0x99b3('0x1a')](realtime[_0x99b3('0x2c')]())[_0x99b3('0x1a')](zoho[_0x99b3('0x2d')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x2e')]())[_0x99b3('0x1a')](vtiger[_0x99b3('0x2f')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x30')]())['then'](servicenow['getServicenowAccounts']())[_0x99b3('0x1a')](realtime[_0x99b3('0x31')]())[_0x99b3('0x1a')](dynamics365[_0x99b3('0x32')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x33')]())[_0x99b3('0x1a')](campaign[_0x99b3('0x34')]())['then'](realtime['initCampaigns']())[_0x99b3('0x1a')](voiceExtension['getVoiceExtensions']())[_0x99b3('0x1a')](realtime[_0x99b3('0x35')]())[_0x99b3('0x1a')](faxAccount[_0x99b3('0x36')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x37')]())[_0x99b3('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x99b3('0x19')]()[_0x99b3('0x1a')](voiceQueueReport[_0x99b3('0x38')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x39')]())[_0x99b3('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x99b3('0x3a')]())[_0x99b3('0x1a')](cmHopperHistory[_0x99b3('0x3b')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x3c')]())[_0x99b3('0x1a')](voiceCallReport[_0x99b3('0x3d')]())['then'](realtime[_0x99b3('0x3e')]())['then'](function(_0x353de3){})[_0x99b3('0x3f')](function(_0x17a803){console[_0x99b3('0x40')](_0x17a803);});}function main(){return server[_0x99b3('0x41')](realtime,preview,fax)['then'](function(_0x3ce76b){return initRealtime();})[_0x99b3('0x1a')](function(){return initParams();})[_0x99b3('0x1a')](function(){report[_0x99b3('0x42')]();setInterval(initRealtime,0x1388);})[_0x99b3('0x3f')](function(_0x34739c){console[_0x99b3('0x40')](_0x34739c);});}main();
\ No newline at end of file
+var _0xd418=['initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','catch','bluebird','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','getAgents','then','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions'];(function(_0x4fcb24,_0x4469a1){var _0x28b5a4=function(_0x1c72e5){while(--_0x1c72e5){_0x4fcb24['push'](_0x4fcb24['shift']());}};_0x28b5a4(++_0x4469a1);}(_0xd418,0x170));var _0x8d41=function(_0x1719be,_0x52d408){_0x1719be=_0x1719be-0x0;var _0x5da113=_0xd418[_0x1719be];return _0x5da113;};'use strict';var BPromise=require(_0x8d41('0x0'));var util=require('util');var moment=require(_0x8d41('0x1'));var server=require(_0x8d41('0x2'));var Realtime=require(_0x8d41('0x3'));var Report=require(_0x8d41('0x4'));var Acw=require(_0x8d41('0x5'));var Trigger=require(_0x8d41('0x6'));var Dialer=require(_0x8d41('0x7'));var Preview=require(_0x8d41('0x8'));var Fax=require(_0x8d41('0x9'));var user=require(_0x8d41('0xa'));var voiceQueue=require(_0x8d41('0xb'));var voiceQueueReport=require(_0x8d41('0xc'));var voiceCallReport=require(_0x8d41('0xd'));var trunk=require(_0x8d41('0xe'));var trigger=require('./rpc/trigger');var template=require(_0x8d41('0xf'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x8d41('0x10'));var voiceExtension=require(_0x8d41('0x11'));var faxAccount=require(_0x8d41('0x12'));var zendesk=require(_0x8d41('0x13'));var salesforce=require(_0x8d41('0x14'));var sugarcrm=require(_0x8d41('0x15'));var freshdesk=require(_0x8d41('0x16'));var desk=require(_0x8d41('0x17'));var zoho=require(_0x8d41('0x18'));var vtiger=require(_0x8d41('0x19'));var servicenow=require(_0x8d41('0x1a'));var dynamics365=require(_0x8d41('0x1b'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8d41('0x1c')](_0x8d41('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8d41('0x1c')](_0x8d41('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8d41('0x1e')]()['then'](user[_0x8d41('0x1f')]())[_0x8d41('0x20')](realtime['initAgents']())[_0x8d41('0x20')](user[_0x8d41('0x21')]())[_0x8d41('0x20')](realtime[_0x8d41('0x22')]())['then'](trunk['getTrunks']())[_0x8d41('0x20')](realtime[_0x8d41('0x23')]())[_0x8d41('0x20')](voiceQueue[_0x8d41('0x24')]())['then'](realtime[_0x8d41('0x25')]())[_0x8d41('0x20')](trigger[_0x8d41('0x26')]())['then'](realtime[_0x8d41('0x27')]())[_0x8d41('0x20')](template[_0x8d41('0x28')]())[_0x8d41('0x20')](realtime[_0x8d41('0x29')]())[_0x8d41('0x20')](zendesk['getZendeskAccounts']())[_0x8d41('0x20')](realtime[_0x8d41('0x2a')]())[_0x8d41('0x20')](salesforce['getSalesforceAccounts']())[_0x8d41('0x20')](realtime['initSalesforceAccounts']())[_0x8d41('0x20')](sugarcrm[_0x8d41('0x2b')]())[_0x8d41('0x20')](realtime[_0x8d41('0x2c')]())[_0x8d41('0x20')](freshdesk['getFreshdeskAccounts']())[_0x8d41('0x20')](realtime[_0x8d41('0x2d')]())[_0x8d41('0x20')](desk[_0x8d41('0x2e')]())[_0x8d41('0x20')](realtime[_0x8d41('0x2f')]())['then'](zoho[_0x8d41('0x30')]())[_0x8d41('0x20')](realtime[_0x8d41('0x31')]())[_0x8d41('0x20')](vtiger[_0x8d41('0x32')]())['then'](realtime[_0x8d41('0x33')]())[_0x8d41('0x20')](servicenow[_0x8d41('0x34')]())[_0x8d41('0x20')](realtime['initServicenowAccounts']())[_0x8d41('0x20')](dynamics365[_0x8d41('0x35')]())[_0x8d41('0x20')](realtime[_0x8d41('0x36')]())[_0x8d41('0x20')](campaign[_0x8d41('0x37')]())[_0x8d41('0x20')](realtime[_0x8d41('0x38')]())[_0x8d41('0x20')](voiceExtension[_0x8d41('0x39')]())[_0x8d41('0x20')](realtime[_0x8d41('0x3a')]())[_0x8d41('0x20')](faxAccount[_0x8d41('0x3b')]())[_0x8d41('0x20')](realtime[_0x8d41('0x3c')]())[_0x8d41('0x20')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x8d41('0x20')](voiceQueueReport[_0x8d41('0x3d')]())[_0x8d41('0x20')](realtime[_0x8d41('0x3e')]())[_0x8d41('0x20')](cmHopperHistory[_0x8d41('0x3f')]())[_0x8d41('0x20')](realtime[_0x8d41('0x40')]())['then'](cmHopperHistory[_0x8d41('0x41')]())[_0x8d41('0x20')](realtime[_0x8d41('0x42')]())[_0x8d41('0x20')](voiceCallReport[_0x8d41('0x43')]())[_0x8d41('0x20')](realtime[_0x8d41('0x44')]())[_0x8d41('0x20')](function(_0xaaf138){})['catch'](function(_0x4268f6){console[_0x8d41('0x45')](_0x4268f6);});}function main(){return server['listen'](realtime,preview,fax)[_0x8d41('0x20')](function(_0xe21736){return initRealtime();})[_0x8d41('0x20')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x8d41('0x46')](function(_0x35f522){console['log'](_0x35f522);});}main();
\ No newline at end of file
diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js
index e45cc1c..c8d53ea 100644
--- a/server/services/ami/model/agent.js
+++ b/server/services/ami/model/agent.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x38df=['ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','format','stringify','user:%s','emit','user:save','exports','util'];(function(_0x5bbf15,_0x1afe73){var _0x4ed9a5=function(_0x583021){while(--_0x583021){_0x5bbf15['push'](_0x5bbf15['shift']());}};_0x4ed9a5(++_0x1afe73);}(_0x38df,0x117));var _0xf38d=function(_0xd93cbe,_0x11202e){_0xd93cbe=_0xd93cbe-0x0;var _0xe0bb40=_0x38df[_0xd93cbe];return _0xe0bb40;};'use strict';var _=require('lodash');var util=require(_0xf38d('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xf38d('0x1'));var config=require(_0xf38d('0x2'));config['redis']=_[_0xf38d('0x3')](config[_0xf38d('0x4')],{'host':_0xf38d('0x5'),'port':0x18eb});var io=require(_0xf38d('0x6'))(new Redis(config[_0xf38d('0x4')]));function Agent(_0x1e0710){this['id']=_0x1e0710['id']||0x0;this[_0xf38d('0x7')]=_0x1e0710[_0xf38d('0x7')]||'';this[_0xf38d('0x8')]=_0x1e0710[_0xf38d('0x8')]||'';this[_0xf38d('0x9')]=_0x1e0710[_0xf38d('0x9')]||'';this[_0xf38d('0xa')]=_0x1e0710[_0xf38d('0xa')]||'';this[_0xf38d('0xb')]=_0xf38d('0xc');this[_0xf38d('0xd')]=0x0;this[_0xf38d('0xe')]=_0xf38d('0xc');this[_0xf38d('0xf')]='';this['phone']='';this[_0xf38d('0x10')]='';this[_0xf38d('0x11')]='';this[_0xf38d('0x12')]=_0x1e0710[_0xf38d('0x12')]||![];this[_0xf38d('0x13')]=_0xf38d('0xc');this[_0xf38d('0x14')]=0x0;this[_0xf38d('0x15')]='';this[_0xf38d('0x16')]='';this[_0xf38d('0x17')]=![];this[_0xf38d('0x18')]=![];this[_0xf38d('0x19')]='';}Agent[_0xf38d('0x1a')][_0xf38d('0x1b')]=function(_0x430a89){var _0x44dc49;if(_0x430a89&&_0x430a89[_0xf38d('0xb')]){_0x44dc49=_0x430a89[_0xf38d('0xb')][_0xf38d('0x1c')]();switch(_0x44dc49){case _0xf38d('0x1d'):_0x44dc49=_0xf38d('0x1e');break;case _0xf38d('0x1f'):_0x44dc49=_0xf38d('0x20');break;}}if(_0x44dc49&&this['voiceStatus']!==_0x44dc49||_0x430a89[_0xf38d('0x21')]){this[_0xf38d('0x14')]=_['toNumber'](moment()[_0xf38d('0x22')]('x'));}if(_0x44dc49){this['voiceStatus']=_0x44dc49;}var _0x392549={'id':this['id'],'name':this[_0xf38d('0x7')],'email':this['email'],'accountcode':this[_0xf38d('0x9')],'fullname':this[_0xf38d('0xa')],'state':this[_0xf38d('0xb')],'stateTime':this['stateTime'],'status':this[_0xf38d('0xe')],'address':this['address'],'online':this[_0xf38d('0x12')],'voiceStatus':this[_0xf38d('0x13')],'voiceStatusTime':this[_0xf38d('0x14')],'voiceStatusCallerIdNumber':this[_0xf38d('0x15')],'voiceStatusQueue':this[_0xf38d('0x16')],'interface':this['interface'],'onhold':this['onhold']};var _0x95c7b1=md5(JSON[_0xf38d('0x23')](_0x392549));if(this[_0xf38d('0x19')]!==_0x95c7b1){this[_0xf38d('0x19')]=_0x95c7b1;io['to'](util[_0xf38d('0x22')](_0xf38d('0x24'),_0x392549[_0xf38d('0x7')]))[_0xf38d('0x25')](_0xf38d('0x26'),_0x392549);}};module[_0xf38d('0x27')]=Agent;
\ No newline at end of file
+var _0x483b=['exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','status','phone','mobile','interface','online','voiceStatus','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','address','voiceStatusCallerIdNumber','stringify','format','user:save'];(function(_0x2db63f,_0x5e3dcc){var _0x2da78c=function(_0x3598ea){while(--_0x3598ea){_0x2db63f['push'](_0x2db63f['shift']());}};_0x2da78c(++_0x5e3dcc);}(_0x483b,0xbf));var _0xb483=function(_0x5d6ed3,_0x1f4e78){_0x5d6ed3=_0x5d6ed3-0x0;var _0x45cb46=_0x483b[_0x5d6ed3];return _0x45cb46;};'use strict';var _=require(_0xb483('0x0'));var util=require('util');var moment=require(_0xb483('0x1'));var md5=require('md5');var Redis=require(_0xb483('0x2'));var config=require(_0xb483('0x3'));config[_0xb483('0x4')]=_[_0xb483('0x5')](config[_0xb483('0x4')],{'host':_0xb483('0x6'),'port':0x18eb});var io=require(_0xb483('0x7'))(new Redis(config['redis']));function Agent(_0x10ae13){this['id']=_0x10ae13['id']||0x0;this[_0xb483('0x8')]=_0x10ae13[_0xb483('0x8')]||'';this[_0xb483('0x9')]=_0x10ae13[_0xb483('0x9')]||'';this[_0xb483('0xa')]=_0x10ae13[_0xb483('0xa')]||'';this['fullname']=_0x10ae13[_0xb483('0xb')]||'';this[_0xb483('0xc')]=_0xb483('0xd');this['stateTime']=0x0;this[_0xb483('0xe')]=_0xb483('0xd');this['address']='';this[_0xb483('0xf')]='';this[_0xb483('0x10')]='';this[_0xb483('0x11')]='';this[_0xb483('0x12')]=_0x10ae13[_0xb483('0x12')]||![];this[_0xb483('0x13')]=_0xb483('0xd');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0xb483('0x14')]='';this['onhold']=![];this[_0xb483('0x15')]=![];this[_0xb483('0x16')]='';}Agent[_0xb483('0x17')][_0xb483('0x18')]=function(_0x5ea0aa){var _0x451b3f;if(_0x5ea0aa&&_0x5ea0aa[_0xb483('0xc')]){_0x451b3f=_0x5ea0aa[_0xb483('0xc')][_0xb483('0x19')]();switch(_0x451b3f){case _0xb483('0x1a'):_0x451b3f=_0xb483('0x1b');break;case _0xb483('0x1c'):_0x451b3f=_0xb483('0x1d');break;}}if(_0x451b3f&&this[_0xb483('0x13')]!==_0x451b3f||_0x5ea0aa[_0xb483('0x1e')]){this['voiceStatusTime']=_[_0xb483('0x1f')](moment()['format']('x'));}if(_0x451b3f){this[_0xb483('0x13')]=_0x451b3f;}var _0x252735={'id':this['id'],'name':this[_0xb483('0x8')],'email':this[_0xb483('0x9')],'accountcode':this[_0xb483('0xa')],'fullname':this[_0xb483('0xb')],'state':this[_0xb483('0xc')],'stateTime':this['stateTime'],'status':this[_0xb483('0xe')],'address':this[_0xb483('0x20')],'online':this['online'],'voiceStatus':this[_0xb483('0x13')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xb483('0x21')],'voiceStatusQueue':this[_0xb483('0x14')],'interface':this[_0xb483('0x11')],'onhold':this['onhold']};var _0x1ca070=md5(JSON[_0xb483('0x22')](_0x252735));if(this[_0xb483('0x16')]!==_0x1ca070){this[_0xb483('0x16')]=_0x1ca070;io['to'](util[_0xb483('0x23')]('user:%s',_0x252735[_0xb483('0x8')]))['emit'](_0xb483('0x24'),_0x252735);}};module[_0xb483('0x25')]=Agent;
\ No newline at end of file
diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js
index 5686f28..6abf65c 100644
--- a/server/services/ami/model/campaign.js
+++ b/server/services/ami/model/campaign.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x69d3=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','ivrAnswerCallsDay'];(function(_0x55a777,_0x2c95f7){var _0x8ca6a1=function(_0x3cc973){while(--_0x3cc973){_0x55a777['push'](_0x55a777['shift']());}};_0x8ca6a1(++_0x2c95f7);}(_0x69d3,0xda));var _0x369d=function(_0x20c688,_0x5edcff){_0x20c688=_0x20c688-0x0;var _0x27b921=_0x69d3[_0x20c688];return _0x27b921;};'use strict';function Campaign(_0x485606){this['id']=_0x485606['id']||0x0;this[_0x369d('0x0')]=_0x485606[_0x369d('0x0')]||'';this['type']=_0x485606[_0x369d('0x1')]||_0x369d('0x2');this['originated']=0x0;this['temp']=0x0;this[_0x369d('0x3')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x369d('0x4')]=!![];this[_0x369d('0x5')]=_0x485606[_0x369d('0x5')];this[_0x369d('0x6')]=_0x485606[_0x369d('0x6')];this[_0x369d('0x7')]=_0x485606[_0x369d('0x7')]||null;this[_0x369d('0x8')]=_0x485606[_0x369d('0x8')]?_0x485606['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x485606[_0x369d('0x9')];this[_0x369d('0xa')]=_0x485606[_0x369d('0xa')];this[_0x369d('0xb')]=_0x485606['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x485606[_0x369d('0xc')];this[_0x369d('0xd')]=_0x485606[_0x369d('0xd')];this[_0x369d('0xe')]=_0x485606[_0x369d('0xe')];this[_0x369d('0xf')]=_0x485606['dialBusyRetryFrequency'];this[_0x369d('0x10')]=_0x485606[_0x369d('0x10')];this[_0x369d('0x11')]=_0x485606[_0x369d('0x11')];this[_0x369d('0x12')]=_0x485606['dialGlobalMaxRetry'];this['dialOrderByScheduledAt']=_0x485606['dialOrderByScheduledAt']||_0x369d('0x13');this[_0x369d('0x14')]=_0x485606[_0x369d('0x14')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x485606[_0x369d('0x15')]||undefined;this[_0x369d('0x16')]=_0x485606[_0x369d('0x16')]||undefined;this['TrunkBackup']=_0x485606[_0x369d('0x17')]?_0x485606[_0x369d('0x17')]:undefined;this['Trunk']=_0x485606['Trunk']?_0x485606['Trunk']:undefined;this[_0x369d('0x18')]=_0x485606[_0x369d('0x18')]?_0x485606[_0x369d('0x18')]:undefined;this['SquareProject']=_0x485606[_0x369d('0x19')]?_0x485606[_0x369d('0x19')]:undefined;this[_0x369d('0x1a')]=_0x485606[_0x369d('0x19')]?_0x485606[_0x369d('0x19')]['name']:undefined;this[_0x369d('0x1b')]=_0x485606[_0x369d('0x1b')]||![];this[_0x369d('0x1c')]=_0x485606[_0x369d('0x1c')];this[_0x369d('0x1d')]=_0x485606[_0x369d('0x1d')];this[_0x369d('0x1e')]=_0x485606[_0x369d('0x1e')];this['dialAMDTotalAnalysisTime']=_0x485606['dialAMDTotalAnalysisTime'];this[_0x369d('0x1f')]=_0x485606[_0x369d('0x1f')];this[_0x369d('0x20')]=_0x485606[_0x369d('0x20')];this[_0x369d('0x21')]=_0x485606[_0x369d('0x21')];this[_0x369d('0x22')]=_0x485606['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x485606[_0x369d('0x23')];}module[_0x369d('0x24')]=Campaign;
\ No newline at end of file
+var _0xac4a=['dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting'];(function(_0x5a4d13,_0x34c9d2){var _0x27818d=function(_0x5e1f88){while(--_0x5e1f88){_0x5a4d13['push'](_0x5a4d13['shift']());}};_0x27818d(++_0x34c9d2);}(_0xac4a,0x13f));var _0xaac4=function(_0x308639,_0x26c24e){_0x308639=_0x308639-0x0;var _0x3a463c=_0xac4a[_0x308639];return _0x3a463c;};'use strict';function Campaign(_0x5d2081){this['id']=_0x5d2081['id']||0x0;this[_0xaac4('0x0')]=_0x5d2081[_0xaac4('0x0')]||'';this[_0xaac4('0x1')]=_0x5d2081[_0xaac4('0x1')]||_0xaac4('0x2');this['originated']=0x0;this['temp']=0x0;this[_0xaac4('0x3')]=0x0;this[_0xaac4('0x4')]=0x0;this[_0xaac4('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0xaac4('0x6')]=_0x5d2081['active'];this[_0xaac4('0x7')]=_0x5d2081['limitCalls'];this[_0xaac4('0x8')]=_0x5d2081[_0xaac4('0x8')]||null;this['dialGlobalInterval']=_0x5d2081['dialGlobalInterval']?_0x5d2081[_0xaac4('0x9')]:null;this['dialOriginateCallerIdName']=_0x5d2081[_0xaac4('0xa')];this['dialOriginateCallerIdNumber']=_0x5d2081['dialOriginateCallerIdNumber'];this[_0xaac4('0xb')]=_0x5d2081[_0xaac4('0xb')]||0x1e;this[_0xaac4('0xc')]=_0x5d2081[_0xaac4('0xc')];this[_0xaac4('0xd')]=_0x5d2081['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x5d2081[_0xaac4('0xe')];this[_0xaac4('0xf')]=_0x5d2081[_0xaac4('0xf')];this['dialNoAnswerMaxRetry']=_0x5d2081[_0xaac4('0x10')];this[_0xaac4('0x11')]=_0x5d2081['dialNoAnswerRetryFrequency'];this[_0xaac4('0x12')]=_0x5d2081[_0xaac4('0x12')];this[_0xaac4('0x13')]=_0x5d2081[_0xaac4('0x13')]||_0xaac4('0x14');this[_0xaac4('0x15')]=_0x5d2081[_0xaac4('0x15')]||undefined;this[_0xaac4('0x16')]=_0x5d2081[_0xaac4('0x16')]||undefined;this[_0xaac4('0x17')]=_0x5d2081[_0xaac4('0x17')]||undefined;this[_0xaac4('0x18')]=_0x5d2081[_0xaac4('0x18')]?_0x5d2081['TrunkBackup']:undefined;this[_0xaac4('0x19')]=_0x5d2081['Trunk']?_0x5d2081[_0xaac4('0x19')]:undefined;this['Interval']=_0x5d2081[_0xaac4('0x1a')]?_0x5d2081[_0xaac4('0x1a')]:undefined;this[_0xaac4('0x1b')]=_0x5d2081[_0xaac4('0x1b')]?_0x5d2081[_0xaac4('0x1b')]:undefined;this[_0xaac4('0x1c')]=_0x5d2081[_0xaac4('0x1b')]?_0x5d2081[_0xaac4('0x1b')][_0xaac4('0x0')]:undefined;this['dialAMDActive']=_0x5d2081[_0xaac4('0x1d')]||![];this['dialAMDInitialSilence']=_0x5d2081[_0xaac4('0x1e')];this[_0xaac4('0x1f')]=_0x5d2081[_0xaac4('0x1f')];this[_0xaac4('0x20')]=_0x5d2081[_0xaac4('0x20')];this[_0xaac4('0x21')]=_0x5d2081['dialAMDTotalAnalysisTime'];this[_0xaac4('0x22')]=_0x5d2081[_0xaac4('0x22')];this[_0xaac4('0x23')]=_0x5d2081[_0xaac4('0x23')];this[_0xaac4('0x24')]=_0x5d2081[_0xaac4('0x24')];this[_0xaac4('0x25')]=_0x5d2081['dialAMDSilenceThreshold'];this[_0xaac4('0x26')]=_0x5d2081['dialAMDMaximumWordLength'];}module['exports']=Campaign;
\ No newline at end of file
diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js
index 9ff2d6c..f955165 100644
--- a/server/services/ami/model/channel.js
+++ b/server/services/ami/model/channel.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb89c=['context','uniqueid','linkedid','answertime','endtime','unmanaged','lastapplication','lastdata','holdtime','tag','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb89c,0x198));var _0xcb89=function(_0x2c59bb,_0x2927bc){_0x2c59bb=_0x2c59bb-0x0;var _0x151825=_0xb89c[_0x2c59bb];return _0x151825;};'use strict';function Channel(){this[_0xcb89('0x0')]=null;this[_0xcb89('0x1')]='';this[_0xcb89('0x2')]='';this[_0xcb89('0x3')]=0x0;this['calleridname']='';this[_0xcb89('0x4')]=undefined;this[_0xcb89('0x5')]=undefined;this['accountcode']=0x0;this[_0xcb89('0x6')]='';this[_0xcb89('0x7')]=0x0;this[_0xcb89('0x8')]=0x0;this['exten']=0x0;this['answered']=![];this[_0xcb89('0x9')]=null;this[_0xcb89('0xa')]=null;this[_0xcb89('0xb')]=![];this['abandoned']=![];this[_0xcb89('0xc')]='';this[_0xcb89('0xd')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0xcb89('0xe')]=0x0;this['type']=null;this[_0xcb89('0xf')]=null;this[_0xcb89('0x10')]=null;this[_0xcb89('0x11')]=![];this[_0xcb89('0x12')]=null;this[_0xcb89('0x13')]=null;this[_0xcb89('0x14')]=[];this['transfercalleridnum']=undefined;this[_0xcb89('0x15')]=undefined;this['mohtime']=0x0;}module[_0xcb89('0x16')]=Channel;
\ No newline at end of file
+var _0x1967=['monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag'];(function(_0xc06638,_0x68dc26){var _0x34e96c=function(_0x15381a){while(--_0x15381a){_0xc06638['push'](_0xc06638['shift']());}};_0x34e96c(++_0x68dc26);}(_0x1967,0x173));var _0x7196=function(_0x214251,_0x221eec){_0x214251=_0x214251-0x0;var _0x13b6d1=_0x1967[_0x214251];return _0x13b6d1;};'use strict';function Channel(){this['starttime']=null;this[_0x7196('0x0')]='';this[_0x7196('0x1')]='';this[_0x7196('0x2')]=0x0;this[_0x7196('0x3')]='';this[_0x7196('0x4')]=undefined;this[_0x7196('0x5')]=undefined;this[_0x7196('0x6')]=0x0;this[_0x7196('0x7')]='';this[_0x7196('0x8')]=0x0;this[_0x7196('0x9')]=0x0;this['exten']=0x0;this[_0x7196('0xa')]=![];this[_0x7196('0xb')]=null;this[_0x7196('0xc')]=null;this[_0x7196('0xd')]=![];this[_0x7196('0xe')]=![];this[_0x7196('0xf')]='';this['lastdata']='';this[_0x7196('0x10')]=0x0;this[_0x7196('0x11')]=0x0;this[_0x7196('0x12')]=0x0;this[_0x7196('0x13')]=null;this[_0x7196('0x14')]=null;this['disposition']=null;this['monitor']=![];this[_0x7196('0x15')]=null;this[_0x7196('0x16')]=null;this[_0x7196('0x17')]=[];this[_0x7196('0x18')]=undefined;this[_0x7196('0x19')]=undefined;this[_0x7196('0x1a')]=0x0;}module[_0x7196('0x1b')]=Channel;
\ No newline at end of file
diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js
index 31f26ba..0898493 100644
--- a/server/services/ami/model/deskAccount.js
+++ b/server/services/ami/model/deskAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xed9f=['type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x5c0368,_0x423cf2){var _0x5b31b9=function(_0x118b40){while(--_0x118b40){_0x5c0368['push'](_0x5c0368['shift']());}};_0x5b31b9(++_0x423cf2);}(_0xed9f,0x1a7));var _0xfed9=function(_0x5d24c1,_0xf7cd20){_0x5d24c1=_0x5d24c1-0x0;var _0x89701b=_0xed9f[_0x5d24c1];return _0x89701b;};'use strict';function DeskAccount(_0x30a365){this['id']=_0x30a365['id']||0x0;this['name']=_0x30a365[_0xfed9('0x0')]||'';this[_0xfed9('0x1')]=_0x30a365[_0xfed9('0x1')]||'';this[_0xfed9('0x2')]=_0x30a365['remoteUri']||'';this['authType']=_0x30a365[_0xfed9('0x3')]||'';this[_0xfed9('0x4')]=_0x30a365[_0xfed9('0x4')]||'';this[_0xfed9('0x5')]=_0x30a365[_0xfed9('0x5')]||'';this[_0xfed9('0x6')]=_0x30a365[_0xfed9('0x6')]||'';this[_0xfed9('0x7')]=_0x30a365[_0xfed9('0x7')]||'';this[_0xfed9('0x8')]=_0x30a365[_0xfed9('0x8')]||'';this[_0xfed9('0x9')]=_0x30a365['type']||'';this[_0xfed9('0xa')]=_0x30a365[_0xfed9('0xa')]||'';this[_0xfed9('0xb')]=_0x30a365[_0xfed9('0xb')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0x1761=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','password','consumerKey','consumerSecret'];(function(_0x3f2bf7,_0x24c64b){var _0x58a77=function(_0x33d4b7){while(--_0x33d4b7){_0x3f2bf7['push'](_0x3f2bf7['shift']());}};_0x58a77(++_0x24c64b);}(_0x1761,0xde));var _0x1176=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1761[_0x2dafbe];return _0x58a45a;};'use strict';function DeskAccount(_0x50c832){this['id']=_0x50c832['id']||0x0;this[_0x1176('0x0')]=_0x50c832['name']||'';this[_0x1176('0x1')]=_0x50c832[_0x1176('0x1')]||'';this[_0x1176('0x2')]=_0x50c832[_0x1176('0x2')]||'';this['authType']=_0x50c832['authType']||'';this[_0x1176('0x3')]=_0x50c832[_0x1176('0x3')]||'';this[_0x1176('0x4')]=_0x50c832['consumerKey']||'';this[_0x1176('0x5')]=_0x50c832[_0x1176('0x5')]||'';this[_0x1176('0x6')]=_0x50c832[_0x1176('0x6')]||'';this['tokenSecret']=_0x50c832[_0x1176('0x7')]||'';this[_0x1176('0x8')]=_0x50c832[_0x1176('0x8')]||'';this[_0x1176('0x9')]=_0x50c832[_0x1176('0x9')]||'';this['Configurations']=_0x50c832[_0x1176('0xa')]||{};}module[_0x1176('0xb')]=DeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js
index 92a0117..fb16845 100644
--- a/server/services/ami/model/dynamics365Account.js
+++ b/server/services/ami/model/dynamics365Account.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9583=['username','password','clientId','clientSecret','serverUrl','Configurations','name'];(function(_0x660430,_0x4a029f){var _0x4109ad=function(_0x49789d){while(--_0x49789d){_0x660430['push'](_0x660430['shift']());}};_0x4109ad(++_0x4a029f);}(_0x9583,0x148));var _0x3958=function(_0x3da825,_0x582150){_0x3da825=_0x3da825-0x0;var _0x9f4619=_0x9583[_0x3da825];return _0x9f4619;};'use strict';function Dynamics365Account(_0x39697c){this['id']=_0x39697c['id']||0x0;this[_0x3958('0x0')]=_0x39697c['name']||'';this[_0x3958('0x1')]=_0x39697c[_0x3958('0x1')]||'';this[_0x3958('0x2')]=_0x39697c[_0x3958('0x2')]||'';this['remoteUri']=_0x39697c['remoteUri']||'';this['tenantId']=_0x39697c['tenantId']||'';this['clientId']=_0x39697c[_0x3958('0x3')]||'';this[_0x3958('0x4')]=_0x39697c[_0x3958('0x4')]||{};this[_0x3958('0x5')]=_0x39697c[_0x3958('0x5')]||'';this[_0x3958('0x6')]=_0x39697c['Configurations']||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
+var _0x6063=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name'];(function(_0x2df8c6,_0x103411){var _0x55c13c=function(_0x44e29b){while(--_0x44e29b){_0x2df8c6['push'](_0x2df8c6['shift']());}};_0x55c13c(++_0x103411);}(_0x6063,0x149));var _0x3606=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6063[_0x4b369d];return _0x571a98;};'use strict';function Dynamics365Account(_0x71a687){this['id']=_0x71a687['id']||0x0;this[_0x3606('0x0')]=_0x71a687[_0x3606('0x0')]||'';this[_0x3606('0x1')]=_0x71a687['username']||'';this[_0x3606('0x2')]=_0x71a687['password']||'';this[_0x3606('0x3')]=_0x71a687['remoteUri']||'';this['tenantId']=_0x71a687[_0x3606('0x4')]||'';this[_0x3606('0x5')]=_0x71a687[_0x3606('0x5')]||'';this[_0x3606('0x6')]=_0x71a687['clientSecret']||{};this[_0x3606('0x7')]=_0x71a687[_0x3606('0x7')]||'';this[_0x3606('0x8')]=_0x71a687[_0x3606('0x8')]||{};}module[_0x3606('0x9')]=Dynamics365Account;
\ No newline at end of file
diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js
index 479e9ac..88435da 100644
--- a/server/services/ami/model/faxAccount.js
+++ b/server/services/ami/model/faxAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2750=['minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0x2750,0x13b));var _0x0275=function(_0x1d6f0e,_0xb8245e){_0x1d6f0e=_0x1d6f0e-0x0;var _0x528109=_0x2750[_0x1d6f0e];return _0x528109;};'use strict';function FaxAccount(_0x1c9f4d){this['id']=_0x1c9f4d['id']||0x0;this['name']=_0x1c9f4d[_0x0275('0x0')]||'';this[_0x0275('0x1')]=_0x1c9f4d[_0x0275('0x1')];this[_0x0275('0x2')]=_0x1c9f4d[_0x0275('0x2')];this[_0x0275('0x3')]=_0x1c9f4d[_0x0275('0x3')];this[_0x0275('0x4')]=_0x1c9f4d[_0x0275('0x4')];this[_0x0275('0x5')]=_0x1c9f4d['minrate']||0x960;this[_0x0275('0x6')]=_0x1c9f4d[_0x0275('0x6')]||0x3840;this[_0x0275('0x7')]=_0x1c9f4d[_0x0275('0x7')]||'v17,v27,v29';this[_0x0275('0x8')]=_0x1c9f4d[_0x0275('0x8')]||'no';this[_0x0275('0x9')]=_0x1c9f4d['faxdetect']||'no';this['t38timeout']=_0x1c9f4d[_0x0275('0xa')]||0x1388;this['tech']=_0x1c9f4d[_0x0275('0xb')]||_0x0275('0xc');this[_0x0275('0xd')]=_0x1c9f4d[_0x0275('0xd')]?_0x1c9f4d[_0x0275('0xd')]:undefined;this['ListId']=_0x1c9f4d[_0x0275('0xe')];this[_0x0275('0xf')]=_0x1c9f4d[_0x0275('0xf')];}module['exports']=FaxAccount;
\ No newline at end of file
+var _0xd8b0=['ListId','key','exports','name','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';function FaxAccount(_0x5d04de){this['id']=_0x5d04de['id']||0x0;this[_0x0d8b('0x0')]=_0x5d04de['name']||'';this['description']=_0x5d04de['description'];this[_0x0d8b('0x1')]=_0x5d04de[_0x0d8b('0x1')];this[_0x0d8b('0x2')]=_0x5d04de[_0x0d8b('0x2')];this[_0x0d8b('0x3')]=_0x5d04de['localstationid'];this['minrate']=_0x5d04de[_0x0d8b('0x4')]||0x960;this[_0x0d8b('0x5')]=_0x5d04de[_0x0d8b('0x5')]||0x3840;this['modem']=_0x5d04de[_0x0d8b('0x6')]||_0x0d8b('0x7');this['gateway']=_0x5d04de[_0x0d8b('0x8')]||'no';this[_0x0d8b('0x9')]=_0x5d04de[_0x0d8b('0x9')]||'no';this[_0x0d8b('0xa')]=_0x5d04de[_0x0d8b('0xa')]||0x1388;this[_0x0d8b('0xb')]=_0x5d04de[_0x0d8b('0xb')]||_0x0d8b('0xc');this['Trunk']=_0x5d04de[_0x0d8b('0xd')]?_0x5d04de['Trunk']:undefined;this[_0x0d8b('0xe')]=_0x5d04de[_0x0d8b('0xe')];this[_0x0d8b('0xf')]=_0x5d04de[_0x0d8b('0xf')];}module[_0x0d8b('0x10')]=FaxAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js
index 784f4c0..7dd5e74 100644
--- a/server/services/ami/model/freshdeskAccount.js
+++ b/server/services/ami/model/freshdeskAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c9a=['name','username','token','remoteUri','Configurations','exports'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x0c9a,0x7e));var _0xa0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9a[_0x3dd15e];return _0x231fd0;};'use strict';function FreshdeskAccount(_0x59f09f){this['id']=_0x59f09f['id']||0x0;this[_0xa0c9('0x0')]=_0x59f09f[_0xa0c9('0x0')]||'';this[_0xa0c9('0x1')]=_0x59f09f['username']||'';this['apiKey']=_0x59f09f[_0xa0c9('0x2')]||'';this[_0xa0c9('0x3')]=_0x59f09f['remoteUri']||'';this['serverUrl']=_0x59f09f['serverUrl']||'';this[_0xa0c9('0x4')]=_0x59f09f[_0xa0c9('0x4')]||{};}module[_0xa0c9('0x5')]=FreshdeskAccount;
\ No newline at end of file
+var _0xc179=['name','username','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x4b067e,_0x163c77){var _0x116120=function(_0x251f8f){while(--_0x251f8f){_0x4b067e['push'](_0x4b067e['shift']());}};_0x116120(++_0x163c77);}(_0xc179,0x70));var _0x9c17=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0xc179[_0x52e0ee];return _0x32534c;};'use strict';function FreshdeskAccount(_0x5837be){this['id']=_0x5837be['id']||0x0;this[_0x9c17('0x0')]=_0x5837be['name']||'';this['username']=_0x5837be[_0x9c17('0x1')]||'';this['apiKey']=_0x5837be[_0x9c17('0x2')]||'';this[_0x9c17('0x3')]=_0x5837be['remoteUri']||'';this[_0x9c17('0x4')]=_0x5837be[_0x9c17('0x4')]||'';this['Configurations']=_0x5837be[_0x9c17('0x5')]||{};}module[_0x9c17('0x6')]=FreshdeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js
index 344ab0b..dfb86af 100644
--- a/server/services/ami/model/queueReport.js
+++ b/server/services/ami/model/queueReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc0aa=['holdtime','assigned','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority'];(function(_0x3cd184,_0x1a0b49){var _0x40f2b8=function(_0x5579ef){while(--_0x5579ef){_0x3cd184['push'](_0x3cd184['shift']());}};_0x40f2b8(++_0x1a0b49);}(_0xc0aa,0x185));var _0xac0a=function(_0x57836f,_0x28ab76){_0x57836f=_0x57836f-0x0;var _0x3d60cf=_0xc0aa[_0x57836f];return _0x3d60cf;};'use strict';function QueueReport(){this[_0xac0a('0x0')]=_0xac0a('0x1');this['uniqueid']='';this[_0xac0a('0x2')]='';this[_0xac0a('0x3')]='';this['queue']='';this[_0xac0a('0x4')]=null;this[_0xac0a('0x5')]=null;this[_0xac0a('0x6')]=0x1;this[_0xac0a('0x7')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0xac0a('0x8')]=null;this[_0xac0a('0x9')]=![];this[_0xac0a('0xa')]=null;this[_0xac0a('0xb')]=0x1;this[_0xac0a('0xc')]='';this[_0xac0a('0xd')]='';this[_0xac0a('0xe')]='';this[_0xac0a('0xf')]='';this[_0xac0a('0x10')]='';this[_0xac0a('0x11')]='';this[_0xac0a('0x12')]='';this[_0xac0a('0x13')]=0x0;this[_0xac0a('0x14')]=![];this['lastAssignedTo']='';this[_0xac0a('0x15')]=0x0;this[_0xac0a('0x16')]={};}module[_0xac0a('0x17')]=QueueReport;
\ No newline at end of file
+var _0x80dd=['queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','lastAssignedTo','mohtime','variables','exports','type','inbound','uniqueid','calleridname'];(function(_0x2d2823,_0x5b985c){var _0x349af9=function(_0x2ecbf1){while(--_0x2ecbf1){_0x2d2823['push'](_0x2d2823['shift']());}};_0x349af9(++_0x5b985c);}(_0x80dd,0x11c));var _0xd80d=function(_0x5dd10d,_0x40be4d){_0x5dd10d=_0x5dd10d-0x0;var _0x195665=_0x80dd[_0x5dd10d];return _0x195665;};'use strict';function QueueReport(){this[_0xd80d('0x0')]=_0xd80d('0x1');this[_0xd80d('0x2')]='';this['calleridnum']='';this[_0xd80d('0x3')]='';this['queue']='';this[_0xd80d('0x4')]=null;this[_0xd80d('0x5')]=null;this[_0xd80d('0x6')]=0x1;this[_0xd80d('0x7')]=0x1;this[_0xd80d('0x8')]=![];this[_0xd80d('0x9')]=null;this['queuecallercomplete']=![];this[_0xd80d('0xa')]=null;this['queuecallerexit']=![];this[_0xd80d('0xb')]=null;this[_0xd80d('0xc')]=0x1;this[_0xd80d('0xd')]='';this[_0xd80d('0xe')]='';this[_0xd80d('0xf')]='';this[_0xd80d('0x10')]='';this['context']='';this[_0xd80d('0x11')]='';this[_0xd80d('0x12')]='';this[_0xd80d('0x13')]=0x0;this['assigned']=![];this[_0xd80d('0x14')]='';this[_0xd80d('0x15')]=0x0;this[_0xd80d('0x16')]={};}module[_0xd80d('0x17')]=QueueReport;
\ No newline at end of file
diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js
index 49c8c75..417f8dc 100644
--- a/server/services/ami/model/salesforceAccount.js
+++ b/server/services/ami/model/salesforceAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x23aa=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x395bfe,_0x4db521){var _0x35c81c=function(_0x484a1b){while(--_0x484a1b){_0x395bfe['push'](_0x395bfe['shift']());}};_0x35c81c(++_0x4db521);}(_0x23aa,0x98));var _0xa23a=function(_0x2382eb,_0x428714){_0x2382eb=_0x2382eb-0x0;var _0x38bfe8=_0x23aa[_0x2382eb];return _0x38bfe8;};'use strict';function SalesforceAccount(_0x1aaf31){this['id']=_0x1aaf31['id']||0x0;this[_0xa23a('0x0')]=_0x1aaf31[_0xa23a('0x0')]||'';this[_0xa23a('0x1')]=_0x1aaf31[_0xa23a('0x1')]||'';this[_0xa23a('0x2')]=_0x1aaf31[_0xa23a('0x2')]||'';this[_0xa23a('0x3')]=_0x1aaf31['password']||'';this[_0xa23a('0x4')]=_0x1aaf31[_0xa23a('0x4')]||'';this[_0xa23a('0x5')]=_0x1aaf31[_0xa23a('0x5')]||'';this['securityToken']=_0x1aaf31[_0xa23a('0x6')]||'';this[_0xa23a('0x7')]=_0x1aaf31[_0xa23a('0x7')]||_0xa23a('0x8');this[_0xa23a('0x9')]=_0x1aaf31['serverUrl']||'';this['Configurations']=_0x1aaf31[_0xa23a('0xa')]||{};}module[_0xa23a('0xb')]=SalesforceAccount;
\ No newline at end of file
+var _0xfb76=['username','remoteUri','password','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x3996b4,_0x11fa52){var _0x1877e9=function(_0x4ca759){while(--_0x4ca759){_0x3996b4['push'](_0x3996b4['shift']());}};_0x1877e9(++_0x11fa52);}(_0xfb76,0x12b));var _0x6fb7=function(_0x281fbb,_0x16254d){_0x281fbb=_0x281fbb-0x0;var _0x55cdf6=_0xfb76[_0x281fbb];return _0x55cdf6;};'use strict';function SalesforceAccount(_0xf516ee){this['id']=_0xf516ee['id']||0x0;this[_0x6fb7('0x0')]=_0xf516ee[_0x6fb7('0x0')]||'';this[_0x6fb7('0x1')]=_0xf516ee['username']||'';this['remoteUri']=_0xf516ee[_0x6fb7('0x2')]||'';this[_0x6fb7('0x3')]=_0xf516ee[_0x6fb7('0x3')]||'';this['clientId']=_0xf516ee['clientId']||'';this['clientSecret']=_0xf516ee['clientSecret']||'';this[_0x6fb7('0x4')]=_0xf516ee[_0x6fb7('0x4')]||'';this['type']=_0xf516ee[_0x6fb7('0x5')]||_0x6fb7('0x6');this[_0x6fb7('0x7')]=_0xf516ee[_0x6fb7('0x7')]||'';this['Configurations']=_0xf516ee[_0x6fb7('0x8')]||{};}module[_0x6fb7('0x9')]=SalesforceAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js
index 8a2cd11..8e0b2db 100644
--- a/server/services/ami/model/servicenowAccount.js
+++ b/server/services/ami/model/servicenowAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x37da=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x37da,0xc1));var _0xa37d=function(_0x11d0bc,_0x5b4283){_0x11d0bc=_0x11d0bc-0x0;var _0x5b5171=_0x37da[_0x11d0bc];return _0x5b5171;};'use strict';function ServicenowAccount(_0x32ac16){this['id']=_0x32ac16['id']||0x0;this[_0xa37d('0x0')]=_0x32ac16[_0xa37d('0x0')]||'';this[_0xa37d('0x1')]=_0x32ac16[_0xa37d('0x1')]||'';this[_0xa37d('0x2')]=_0x32ac16[_0xa37d('0x2')]||'';this[_0xa37d('0x3')]=_0x32ac16['remoteUri']||'';this['serverUrl']=_0x32ac16[_0xa37d('0x4')]||'';this[_0xa37d('0x5')]=_0x32ac16['Configurations']||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
+var _0xc651=['Configurations','exports','name','password','remoteUri','serverUrl'];(function(_0xa8b370,_0x2b77db){var _0x643e37=function(_0x1486eb){while(--_0x1486eb){_0xa8b370['push'](_0xa8b370['shift']());}};_0x643e37(++_0x2b77db);}(_0xc651,0x10a));var _0x1c65=function(_0x39a58f,_0x103de9){_0x39a58f=_0x39a58f-0x0;var _0x2ceb43=_0xc651[_0x39a58f];return _0x2ceb43;};'use strict';function ServicenowAccount(_0x46c57d){this['id']=_0x46c57d['id']||0x0;this[_0x1c65('0x0')]=_0x46c57d[_0x1c65('0x0')]||'';this['username']=_0x46c57d['username']||'';this[_0x1c65('0x1')]=_0x46c57d[_0x1c65('0x1')]||'';this[_0x1c65('0x2')]=_0x46c57d[_0x1c65('0x2')]||'';this['serverUrl']=_0x46c57d[_0x1c65('0x3')]||'';this[_0x1c65('0x4')]=_0x46c57d[_0x1c65('0x4')]||{};}module[_0x1c65('0x5')]=ServicenowAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js
index a276b54..12069ec 100644
--- a/server/services/ami/model/sugarcrmAccount.js
+++ b/server/services/ami/model/sugarcrmAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb48f=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x377432,_0x3066ff){var _0x32ead1=function(_0x38a53b){while(--_0x38a53b){_0x377432['push'](_0x377432['shift']());}};_0x32ead1(++_0x3066ff);}(_0xb48f,0x91));var _0xfb48=function(_0x243427,_0x784e11){_0x243427=_0x243427-0x0;var _0xc59f9a=_0xb48f[_0x243427];return _0xc59f9a;};'use strict';function SugarcrmAccount(_0x2a178e){this['id']=_0x2a178e['id']||0x0;this['name']=_0x2a178e[_0xfb48('0x0')]||'';this['username']=_0x2a178e[_0xfb48('0x1')]||'';this[_0xfb48('0x2')]=_0x2a178e['password']||'';this[_0xfb48('0x3')]=_0x2a178e[_0xfb48('0x3')]||'';this[_0xfb48('0x4')]=_0x2a178e[_0xfb48('0x4')]||'';this[_0xfb48('0x5')]=_0x2a178e[_0xfb48('0x5')]||{};}module[_0xfb48('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0x61f0=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x1dcb61,_0x533143){var _0x275729=function(_0x1987eb){while(--_0x1987eb){_0x1dcb61['push'](_0x1dcb61['shift']());}};_0x275729(++_0x533143);}(_0x61f0,0x1e4));var _0x061f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x61f0[_0x14add3];return _0x4a174f;};'use strict';function SugarcrmAccount(_0xb27108){this['id']=_0xb27108['id']||0x0;this[_0x061f('0x0')]=_0xb27108[_0x061f('0x0')]||'';this[_0x061f('0x1')]=_0xb27108[_0x061f('0x1')]||'';this[_0x061f('0x2')]=_0xb27108[_0x061f('0x2')]||'';this[_0x061f('0x3')]=_0xb27108[_0x061f('0x3')]||'';this[_0x061f('0x4')]=_0xb27108['serverUrl']||'';this[_0x061f('0x5')]=_0xb27108['Configurations']||{};}module[_0x061f('0x6')]=SugarcrmAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js
index d0dbf11..6776578 100644
--- a/server/services/ami/model/telephone.js
+++ b/server/services/ami/model/telephone.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x202d=['accountcode','stateTime','status','unknown','address','exports','name'];(function(_0x4dbda8,_0xbce830){var _0x1149ed=function(_0x299a39){while(--_0x299a39){_0x4dbda8['push'](_0x4dbda8['shift']());}};_0x1149ed(++_0xbce830);}(_0x202d,0xc3));var _0xd202=function(_0x2ba5ea,_0x3deeca){_0x2ba5ea=_0x2ba5ea-0x0;var _0x2f806e=_0x202d[_0x2ba5ea];return _0x2f806e;};'use strict';function Telephone(_0x30e00f){this['id']=_0x30e00f['id']||0x0;this[_0xd202('0x0')]=_0x30e00f[_0xd202('0x0')]||'';this[_0xd202('0x1')]=_0x30e00f[_0xd202('0x1')]||'';this['state']='unknown';this[_0xd202('0x2')]=0x0;this[_0xd202('0x3')]=_0xd202('0x4');this[_0xd202('0x5')]='';}module[_0xd202('0x6')]=Telephone;
\ No newline at end of file
+var _0x6c06=['stateTime','exports','name','accountcode','unknown'];(function(_0x38552f,_0x1c103e){var _0x4722d0=function(_0x4a600f){while(--_0x4a600f){_0x38552f['push'](_0x38552f['shift']());}};_0x4722d0(++_0x1c103e);}(_0x6c06,0x1d3));var _0x66c0=function(_0x1a040d,_0x58de5d){_0x1a040d=_0x1a040d-0x0;var _0x49ebf1=_0x6c06[_0x1a040d];return _0x49ebf1;};'use strict';function Telephone(_0x5c7675){this['id']=_0x5c7675['id']||0x0;this[_0x66c0('0x0')]=_0x5c7675[_0x66c0('0x0')]||'';this['accountcode']=_0x5c7675[_0x66c0('0x1')]||'';this['state']=_0x66c0('0x2');this[_0x66c0('0x3')]=0x0;this['status']='unknown';this['address']='';}module[_0x66c0('0x4')]=Telephone;
\ No newline at end of file
diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js
index b0463fa..243d52d 100644
--- a/server/services/ami/model/template.js
+++ b/server/services/ami/model/template.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x524a=['html','exports','name'];(function(_0x7d78ed,_0x24518b){var _0x5027ef=function(_0x5189e6){while(--_0x5189e6){_0x7d78ed['push'](_0x7d78ed['shift']());}};_0x5027ef(++_0x24518b);}(_0x524a,0xf5));var _0xa524=function(_0x10fe1a,_0x31d5c8){_0x10fe1a=_0x10fe1a-0x0;var _0x3001c3=_0x524a[_0x10fe1a];return _0x3001c3;};'use strict';function template(_0x6366f7){this['id']=_0x6366f7['id']||0x0;this[_0xa524('0x0')]=_0x6366f7[_0xa524('0x0')]||'';this[_0xa524('0x1')]=_0x6366f7['html']||'';}module[_0xa524('0x2')]=template;
\ No newline at end of file
+var _0x5ff3=['name','html','exports'];(function(_0x5c8ca6,_0x1f2961){var _0x2f28e8=function(_0x11f800){while(--_0x11f800){_0x5c8ca6['push'](_0x5c8ca6['shift']());}};_0x2f28e8(++_0x1f2961);}(_0x5ff3,0x17d));var _0x35ff=function(_0xbaa628,_0x26977f){_0xbaa628=_0xbaa628-0x0;var _0x2553e3=_0x5ff3[_0xbaa628];return _0x2553e3;};'use strict';function template(_0x2fc021){this['id']=_0x2fc021['id']||0x0;this[_0x35ff('0x0')]=_0x2fc021['name']||'';this[_0x35ff('0x1')]=_0x2fc021['html']||'';}module[_0x35ff('0x2')]=template;
\ No newline at end of file
diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js
index 4d8aec3..36ee38e 100644
--- a/server/services/ami/model/trigger.js
+++ b/server/services/ami/model/trigger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd907=['status','AllConditions','AnyConditions','Actions','name','channel','voice'];(function(_0x50d595,_0x3ac532){var _0x1fa287=function(_0x43d8f3){while(--_0x43d8f3){_0x50d595['push'](_0x50d595['shift']());}};_0x1fa287(++_0x3ac532);}(_0xd907,0x1bd));var _0x7d90=function(_0x309879,_0x29f94a){_0x309879=_0x309879-0x0;var _0x480e63=_0xd907[_0x309879];return _0x480e63;};'use strict';function Trigger(_0x3cd677){this['id']=_0x3cd677['id']||0x0;this[_0x7d90('0x0')]=_0x3cd677[_0x7d90('0x0')]||'';this[_0x7d90('0x1')]=_0x3cd677[_0x7d90('0x1')]||_0x7d90('0x2');this['status']=_0x3cd677[_0x7d90('0x3')]||![];this[_0x7d90('0x4')]=_0x3cd677['AllConditions']||[];this[_0x7d90('0x5')]=_0x3cd677[_0x7d90('0x5')]||[];this[_0x7d90('0x6')]=_0x3cd677[_0x7d90('0x6')]||[];}module['exports']=Trigger;
\ No newline at end of file
+var _0xebb3=['Actions','exports','name','channel','status','AnyConditions'];(function(_0x334f61,_0x20cd4c){var _0x307da4=function(_0x516e0d){while(--_0x516e0d){_0x334f61['push'](_0x334f61['shift']());}};_0x307da4(++_0x20cd4c);}(_0xebb3,0x134));var _0x3ebb=function(_0x304080,_0x227ad3){_0x304080=_0x304080-0x0;var _0x50adaf=_0xebb3[_0x304080];return _0x50adaf;};'use strict';function Trigger(_0x1c4756){this['id']=_0x1c4756['id']||0x0;this['name']=_0x1c4756[_0x3ebb('0x0')]||'';this[_0x3ebb('0x1')]=_0x1c4756['channel']||'voice';this[_0x3ebb('0x2')]=_0x1c4756[_0x3ebb('0x2')]||![];this['AllConditions']=_0x1c4756['AllConditions']||[];this['AnyConditions']=_0x1c4756[_0x3ebb('0x3')]||[];this['Actions']=_0x1c4756[_0x3ebb('0x4')]||[];}module[_0x3ebb('0x5')]=Trigger;
\ No newline at end of file
diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js
index c33bd80..4b6aad0 100644
--- a/server/services/ami/model/trunk.js
+++ b/server/services/ami/model/trunk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55c4=['registry','indexOf','host','port','domain','stateRegistry','registrationtime','address','exports','active','name','state','unknown','stateTime','status'];(function(_0x50e5c9,_0xb955b4){var _0x1543a8=function(_0x54bf47){while(--_0x54bf47){_0x50e5c9['push'](_0x50e5c9['shift']());}};_0x1543a8(++_0xb955b4);}(_0x55c4,0x9f));var _0x455c=function(_0x37f4d7,_0x5106f2){_0x37f4d7=_0x37f4d7-0x0;var _0xf26e38=_0x55c4[_0x37f4d7];return _0xf26e38;};'use strict';function Trunk(_0x3370b9){this['id']=_0x3370b9['id']||0x0;this[_0x455c('0x0')]=_0x3370b9[_0x455c('0x0')]||![];this[_0x455c('0x1')]=_0x3370b9['name']||'';this[_0x455c('0x2')]=_0x455c('0x3');this[_0x455c('0x4')]=0x0;this[_0x455c('0x5')]='unknown';this[_0x455c('0x6')]=_0x3370b9[_0x455c('0x6')]&&_0x3370b9[_0x455c('0x6')][_0x455c('0x7')](':')?_0x3370b9['registry']['split'](':')[0x0]:'';this[_0x455c('0x8')]='';this[_0x455c('0x9')]='';this[_0x455c('0xa')]='';this['domainport']='';this['refresh']='';this[_0x455c('0xb')]=_0x455c('0x3');this[_0x455c('0xc')]='';this[_0x455c('0xd')]='';}module[_0x455c('0xe')]=Trunk;
\ No newline at end of file
+var _0x942a=['exports','active','state','stateTime','status','unknown','registry','split','host','port','domain','domainport','refresh','registrationtime','address'];(function(_0x49f3a1,_0x3d7b72){var _0x26434d=function(_0xcbb480){while(--_0xcbb480){_0x49f3a1['push'](_0x49f3a1['shift']());}};_0x26434d(++_0x3d7b72);}(_0x942a,0x1b4));var _0xa942=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0x942a[_0x31e5cb];return _0x4170df;};'use strict';function Trunk(_0x598c3f){this['id']=_0x598c3f['id']||0x0;this[_0xa942('0x0')]=_0x598c3f[_0xa942('0x0')]||![];this['name']=_0x598c3f['name']||'';this[_0xa942('0x1')]='unknown';this[_0xa942('0x2')]=0x0;this[_0xa942('0x3')]=_0xa942('0x4');this[_0xa942('0x5')]=_0x598c3f['registry']&&_0x598c3f[_0xa942('0x5')]['indexOf'](':')?_0x598c3f[_0xa942('0x5')][_0xa942('0x6')](':')[0x0]:'';this[_0xa942('0x7')]='';this[_0xa942('0x8')]='';this[_0xa942('0x9')]='';this[_0xa942('0xa')]='';this[_0xa942('0xb')]='';this['stateRegistry']=_0xa942('0x4');this[_0xa942('0xc')]='';this[_0xa942('0xd')]='';}module[_0xa942('0xe')]=Trunk;
\ No newline at end of file
diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js
index 01b22f9..d025613 100644
--- a/server/services/ami/model/voiceExtension.js
+++ b/server/services/ami/model/voiceExtension.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x707b=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x245e51,_0x52fbdb){var _0x4ab583=function(_0x4b7230){while(--_0x4b7230){_0x245e51['push'](_0x245e51['shift']());}};_0x4ab583(++_0x52fbdb);}(_0x707b,0x1b2));var _0xb707=function(_0x23bcd4,_0xd3deb0){_0x23bcd4=_0x23bcd4-0x0;var _0x4cb792=_0x707b[_0x23bcd4];return _0x4cb792;};'use strict';function voiceExtension(_0x2175d4){this['id']=_0x2175d4['id']||0x0;this['exten']=_0x2175d4[_0xb707('0x0')]||'';this[_0xb707('0x1')]=_0x2175d4[_0xb707('0x1')]||_0xb707('0x2');this[_0xb707('0x3')]=_0x2175d4[_0xb707('0x3')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
+var _0x255a=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x5b8d66,_0x48bf05){var _0x592c4e=function(_0x169e00){while(--_0x169e00){_0x5b8d66['push'](_0x5b8d66['shift']());}};_0x592c4e(++_0x48bf05);}(_0x255a,0x9b));var _0xa255=function(_0x1bdd24,_0x54682f){_0x1bdd24=_0x1bdd24-0x0;var _0x5337bb=_0x255a[_0x1bdd24];return _0x5337bb;};'use strict';function voiceExtension(_0x11362f){this['id']=_0x11362f['id']||0x0;this[_0xa255('0x0')]=_0x11362f[_0xa255('0x0')]||'';this['recordingFormat']=_0x11362f[_0xa255('0x1')]||_0xa255('0x2');this[_0xa255('0x3')]=_0x11362f[_0xa255('0x3')]||![];}module[_0xa255('0x4')]=voiceExtension;
\ No newline at end of file
diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js
index be21192..4db19bf 100644
--- a/server/services/ami/model/voiceQueue.js
+++ b/server/services/ami/model/voiceQueue.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6307=['strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','busy','invalid','ringing','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x6307,0x1de));var _0x7630=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x6307[_0x42bc91];return _0x3f5507;};'use strict';var statusDesc=[_0x7630('0x0'),'not_inuse','inuse',_0x7630('0x1'),_0x7630('0x2'),'unavailable',_0x7630('0x3'),_0x7630('0x4'),_0x7630('0x5')];var monitorFormat={'wav':_0x7630('0x6'),'wav49':_0x7630('0x7'),'gsm':'gsm'};var strategy={'rrmemory':_0x7630('0x8'),'roundrobin':_0x7630('0x9')};function VoiceQueue(_0x1d629a){this['id']=_0x1d629a['id']||0x0;this[_0x7630('0xa')]=_0x1d629a['name']||'';this[_0x7630('0xb')]=_0x1d629a[_0x7630('0xb')]||'';this['type']=_0x1d629a[_0x7630('0xc')]||_0x7630('0xd');this[_0x7630('0xe')]=0x0;this['talking']=0x0;this[_0x7630('0xf')]=0x0;this[_0x7630('0x10')]=0x0;this['sumDuration']=0x0;this[_0x7630('0x11')]=0x0;this[_0x7630('0x12')]=0x0;this[_0x7630('0x13')]=0x0;this[_0x7630('0x14')]=0x0;this[_0x7630('0x15')]=0x0;this[_0x7630('0x16')]=0x0;this[_0x7630('0x17')]=_0x1d629a[_0x7630('0x17')]||![];this[_0x7630('0x18')]=_0x1d629a['acwTimeout']||0xa;this[_0x7630('0x19')]=_0x1d629a[_0x7630('0x19')]||'no';this[_0x7630('0x1a')]=!![];this[_0x7630('0x1b')]='';this[_0x7630('0x1c')]=0x0;this[_0x7630('0x1d')]=0x0;this[_0x7630('0x1e')]=_0x1d629a[_0x7630('0x1e')]||null;this[_0x7630('0x1f')]=_0x1d629a[_0x7630('0x1f')]?_0x1d629a[_0x7630('0x1f')]:null;this[_0x7630('0x20')]=_0x1d629a[_0x7630('0x20')];this[_0x7630('0x21')]=_0x1d629a['dialMethod']||_0x7630('0x22');this[_0x7630('0x23')]=_0x1d629a[_0x7630('0x23')]||0x0;this[_0x7630('0x24')]=_0x1d629a[_0x7630('0x24')]||0x0;this[_0x7630('0x25')]=_0x1d629a[_0x7630('0x25')]||0x1;this[_0x7630('0x26')]=_0x1d629a[_0x7630('0x26')]||_0x7630('0x27');this[_0x7630('0x28')]=_0x1d629a['dialPredictiveOptimizationPercentage']||0.03;this[_0x7630('0x29')]=_0x1d629a['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x1d629a[_0x7630('0x2a')]||_0x7630('0x2b');this['dialOriginateCallerIdNumber']=_0x1d629a[_0x7630('0x2c')]||_0x7630('0x2b');this[_0x7630('0x2d')]=_0x1d629a[_0x7630('0x2d')]||0x1e;this[_0x7630('0x2e')]=_0x1d629a[_0x7630('0x2e')]||_0x7630('0x2f');this[_0x7630('0x30')]=_0x1d629a[_0x7630('0x30')]||0x3;this['dialQueueProject']=_0x1d629a[_0x7630('0x31')]||undefined;this[_0x7630('0x32')]=_0x1d629a['dialCongestionMaxRetry']||0x3;this[_0x7630('0x33')]=_0x1d629a['dialCongestionRetryFrequency']||0x96;this[_0x7630('0x34')]=_0x1d629a['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x1d629a[_0x7630('0x35')]||0x96;this['dialNoAnswerMaxRetry']=_0x1d629a['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x1d629a['dialNoAnswerRetryFrequency']||0x96;this[_0x7630('0x36')]=_0x1d629a[_0x7630('0x36')]||0x4;this[_0x7630('0x37')]=_0x1d629a['Trunk']?_0x1d629a['Trunk']:undefined;this[_0x7630('0x38')]=_0x1d629a[_0x7630('0x38')]?_0x1d629a[_0x7630('0x38')]:undefined;this[_0x7630('0x39')]=_0x1d629a[_0x7630('0x39')]||undefined;this[_0x7630('0x3a')]=_0x1d629a[_0x7630('0x3a')]?_0x1d629a[_0x7630('0x3a')]:undefined;this[_0x7630('0x3b')]=_0x1d629a['dialOrderByScheduledAt']||'DESC';this[_0x7630('0x3c')]=_0x1d629a[_0x7630('0x3c')]||undefined;this[_0x7630('0x3d')]=_0x1d629a['dialCutDigit']||undefined;this[_0x7630('0x3e')]=strategy[_0x1d629a['strategy']]||'rrmemory';this[_0x7630('0x3f')]=!![];this[_0x7630('0x40')]=_0x1d629a['dialAMDActive']||![];this[_0x7630('0x41')]=_0x1d629a['dialAMDInitialSilence'];this[_0x7630('0x42')]=_0x1d629a[_0x7630('0x42')];this[_0x7630('0x43')]=_0x1d629a[_0x7630('0x43')];this['dialAMDTotalAnalysisTime']=_0x1d629a[_0x7630('0x44')];this[_0x7630('0x45')]=_0x1d629a[_0x7630('0x45')];this[_0x7630('0x46')]=_0x1d629a[_0x7630('0x46')];this[_0x7630('0x47')]=_0x1d629a[_0x7630('0x47')];this[_0x7630('0x48')]=_0x1d629a[_0x7630('0x48')];this[_0x7630('0x49')]=_0x1d629a[_0x7630('0x49')];this[_0x7630('0x4a')]=0x0;this['pTalking']=0x0;this[_0x7630('0x4b')]=_0x1d629a['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x7630('0x4c')]=0x0;this[_0x7630('0x4d')]=0x0;this[_0x7630('0x4e')]=0x0;this[_0x7630('0x4f')]=0x0;this[_0x7630('0x50')]=0x0;this[_0x7630('0x51')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x7630('0x52')]=0x0;this[_0x7630('0x53')]=0x0;this[_0x7630('0x54')]=0x0;this[_0x7630('0x55')]=0x0;this['outboundReCallsDay']=0x0;this[_0x7630('0x56')]=undefined;this[_0x7630('0x57')]=undefined;this[_0x7630('0x58')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x7630('0x59')]=0x0;this[_0x7630('0x5a')]=0x0;this[_0x7630('0x5b')]=0x0;this[_0x7630('0x5c')]=0x0;this[_0x7630('0x5d')]=0x0;this[_0x7630('0x5e')]=0x0;this[_0x7630('0x5f')]=0x0;this[_0x7630('0x60')]=0x0;this['predictiveIntervalMaxThreshold']=_0x1d629a[_0x7630('0x61')]||0x14;this['predictiveIntervalMinThreshold']=_0x1d629a[_0x7630('0x61')]||0xa;this[_0x7630('0x62')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x7630('0x63')]=0x0;this[_0x7630('0x64')]=0x0;this['dialRecallMeTimeout']=_0x1d629a[_0x7630('0x65')]||0x1e;this[_0x7630('0x66')]=_0x1d629a[_0x7630('0x66')]||![];this[_0x7630('0x67')]=_0x1d629a[_0x7630('0x67')]||undefined;this['dialAgiAfterHangupClient']=_0x1d629a[_0x7630('0x68')]||![];this['dialAgiAfterHangupAgent']=_0x1d629a[_0x7630('0x69')]||![];this[_0x7630('0xb')]=monitorFormat[_0x1d629a[_0x7630('0xb')]]?monitorFormat[_0x1d629a[_0x7630('0xb')]]:undefined;this[_0x7630('0x6a')]=_0x1d629a[_0x7630('0x6a')]||![];this[_0x7630('0x6b')]=_0x1d629a['mandatoryDispositionPause']?_0x1d629a[_0x7630('0x6b')]:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
+var _0x22f6=['wav49','rrmemory','roundrobin','name','monitor_format','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','unavailable','onhold','wav'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x22f6,0x18e));var _0x622f=function(_0xc58dd5,_0x208d54){_0xc58dd5=_0xc58dd5-0x0;var _0xa084e9=_0x22f6[_0xc58dd5];return _0xa084e9;};'use strict';var statusDesc=[_0x622f('0x0'),_0x622f('0x1'),_0x622f('0x2'),'busy','invalid',_0x622f('0x3'),'ringing','ringinuse',_0x622f('0x4')];var monitorFormat={'wav':_0x622f('0x5'),'wav49':_0x622f('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0x622f('0x7'),'roundrobin':_0x622f('0x8')};function VoiceQueue(_0x71c238){this['id']=_0x71c238['id']||0x0;this[_0x622f('0x9')]=_0x71c238[_0x622f('0x9')]||'';this[_0x622f('0xa')]=_0x71c238[_0x622f('0xa')]||'';this['type']=_0x71c238['type']||_0x622f('0xb');this['waiting']=0x0;this[_0x622f('0xc')]=0x0;this[_0x622f('0xd')]=0x0;this[_0x622f('0xe')]=0x0;this[_0x622f('0xf')]=0x0;this[_0x622f('0x10')]=0x0;this[_0x622f('0x11')]=0x0;this[_0x622f('0x12')]=0x0;this[_0x622f('0x13')]=0x0;this[_0x622f('0x14')]=0x0;this['available']=0x0;this['acw']=_0x71c238[_0x622f('0x15')]||![];this[_0x622f('0x16')]=_0x71c238[_0x622f('0x16')]||0xa;this[_0x622f('0x17')]=_0x71c238[_0x622f('0x17')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x622f('0x18')]=0x0;this[_0x622f('0x19')]=0x0;this[_0x622f('0x1a')]=_0x71c238[_0x622f('0x1a')]||null;this[_0x622f('0x1b')]=_0x71c238[_0x622f('0x1b')]?_0x71c238[_0x622f('0x1b')]:null;this[_0x622f('0x1c')]=_0x71c238[_0x622f('0x1c')];this['dialMethod']=_0x71c238[_0x622f('0x1d')]||'progressive';this[_0x622f('0x1e')]=_0x71c238[_0x622f('0x1e')]||0x0;this[_0x622f('0x1f')]=_0x71c238['dialLimitQueue']||0x0;this[_0x622f('0x20')]=_0x71c238[_0x622f('0x20')]||0x1;this['dialPredictiveOptimization']=_0x71c238['dialPredictiveOptimization']||'dropRate';this[_0x622f('0x21')]=_0x71c238['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x71c238[_0x622f('0x22')]||0x258;this[_0x622f('0x23')]=_0x71c238[_0x622f('0x23')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x71c238['dialOriginateCallerIdNumber']||_0x622f('0x24');this[_0x622f('0x25')]=_0x71c238[_0x622f('0x25')]||0x1e;this[_0x622f('0x26')]=_0x71c238[_0x622f('0x26')]||_0x622f('0x27');this[_0x622f('0x28')]=_0x71c238[_0x622f('0x28')]||0x3;this[_0x622f('0x29')]=_0x71c238['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x71c238[_0x622f('0x2a')]||0x3;this['dialCongestionRetryFrequency']=_0x71c238[_0x622f('0x2b')]||0x96;this['dialBusyMaxRetry']=_0x71c238[_0x622f('0x2c')]||0x3;this['dialBusyRetryFrequency']=_0x71c238['dialBusyRetryFrequency']||0x96;this[_0x622f('0x2d')]=_0x71c238[_0x622f('0x2d')]||0x3;this['dialNoAnswerRetryFrequency']=_0x71c238[_0x622f('0x2e')]||0x96;this[_0x622f('0x2f')]=_0x71c238[_0x622f('0x2f')]||0x4;this[_0x622f('0x30')]=_0x71c238[_0x622f('0x30')]?_0x71c238[_0x622f('0x30')]:undefined;this['TrunkBackup']=_0x71c238[_0x622f('0x31')]?_0x71c238[_0x622f('0x31')]:undefined;this[_0x622f('0x32')]=_0x71c238[_0x622f('0x32')]||undefined;this[_0x622f('0x33')]=_0x71c238[_0x622f('0x33')]?_0x71c238[_0x622f('0x33')]:undefined;this[_0x622f('0x34')]=_0x71c238[_0x622f('0x34')]||_0x622f('0x35');this['dialRandomLastDigitCallerIdNumber']=_0x71c238[_0x622f('0x36')]||undefined;this[_0x622f('0x37')]=_0x71c238['dialCutDigit']||undefined;this['strategy']=strategy[_0x71c238[_0x622f('0x38')]]||_0x622f('0x7');this['queueStatusComplete']=!![];this[_0x622f('0x39')]=_0x71c238[_0x622f('0x39')]||![];this['dialAMDInitialSilence']=_0x71c238[_0x622f('0x3a')];this[_0x622f('0x3b')]=_0x71c238['dialAMDGreeting'];this[_0x622f('0x3c')]=_0x71c238[_0x622f('0x3c')];this[_0x622f('0x3d')]=_0x71c238[_0x622f('0x3d')];this[_0x622f('0x3e')]=_0x71c238[_0x622f('0x3e')];this[_0x622f('0x3f')]=_0x71c238[_0x622f('0x3f')];this[_0x622f('0x40')]=_0x71c238[_0x622f('0x40')];this['dialAMDSilenceThreshold']=_0x71c238[_0x622f('0x41')];this['dialAMDMaximumWordLength']=_0x71c238['dialAMDMaximumWordLength'];this[_0x622f('0x42')]=0x0;this['pTalking']=0x0;this[_0x622f('0x43')]=_0x71c238[_0x622f('0x43')];this[_0x622f('0x44')]=0x0;this[_0x622f('0x45')]=0x0;this[_0x622f('0x46')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x622f('0x47')]=0x0;this[_0x622f('0x48')]=0x0;this[_0x622f('0x49')]=0x0;this[_0x622f('0x4a')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x622f('0x4b')]=0x0;this[_0x622f('0x4c')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x622f('0x4d')]=0x0;this[_0x622f('0x4e')]=undefined;this[_0x622f('0x4f')]=undefined;this[_0x622f('0x50')]=undefined;this[_0x622f('0x51')]=1.05;this[_0x622f('0x52')]=0x0;this[_0x622f('0x53')]=0x0;this[_0x622f('0x54')]=0x0;this[_0x622f('0x55')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x622f('0x56')]=0x0;this[_0x622f('0x57')]=_0x71c238[_0x622f('0x58')]||0x14;this['predictiveIntervalMinThreshold']=_0x71c238[_0x622f('0x58')]||0xa;this[_0x622f('0x59')]=0x0;this[_0x622f('0x5a')]=0x0;this[_0x622f('0x5b')]=0x1;this['erlangCalls']=0x0;this[_0x622f('0x5c')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0x622f('0x5d')]=_0x71c238[_0x622f('0x5d')]||0x1e;this[_0x622f('0x5e')]=_0x71c238[_0x622f('0x5e')]||![];this[_0x622f('0x5f')]=_0x71c238[_0x622f('0x5f')]||undefined;this['dialAgiAfterHangupClient']=_0x71c238[_0x622f('0x60')]||![];this['dialAgiAfterHangupAgent']=_0x71c238[_0x622f('0x61')]||![];this['monitor_format']=monitorFormat[_0x71c238['monitor_format']]?monitorFormat[_0x71c238[_0x622f('0xa')]]:undefined;this['mandatoryDisposition']=_0x71c238[_0x622f('0x62')]||![];this['mandatoryDispositionPause']=_0x71c238[_0x622f('0x63')]?_0x71c238[_0x622f('0x63')]:undefined;}module[_0x622f('0x64')]=VoiceQueue;
\ No newline at end of file
diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js
index 3d936a5..5c2a170 100644
--- a/server/services/ami/model/vtigerAccount.js
+++ b/server/services/ami/model/vtigerAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0e29=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x3062cb,_0x44ca12){var _0xf29731=function(_0x11fc4b){while(--_0x11fc4b){_0x3062cb['push'](_0x3062cb['shift']());}};_0xf29731(++_0x44ca12);}(_0x0e29,0x1ec));var _0x90e2=function(_0x174696,_0x3aede3){_0x174696=_0x174696-0x0;var _0x3e7daa=_0x0e29[_0x174696];return _0x3e7daa;};'use strict';function VtigerAccount(_0x4c2486){this['id']=_0x4c2486['id']||0x0;this[_0x90e2('0x0')]=_0x4c2486[_0x90e2('0x0')]||'';this[_0x90e2('0x1')]=_0x4c2486[_0x90e2('0x1')]||'';this[_0x90e2('0x2')]=_0x4c2486[_0x90e2('0x2')]||'';this[_0x90e2('0x3')]=_0x4c2486[_0x90e2('0x3')]||'';this[_0x90e2('0x4')]=_0x4c2486[_0x90e2('0x4')]||'';this[_0x90e2('0x5')]=_0x4c2486[_0x90e2('0x5')]||{};}module[_0x90e2('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x6b4d=['accessKey','serverUrl','Configurations','exports','name','username'];(function(_0x3e1c65,_0x21dbcd){var _0x9c0ed2=function(_0xbc89f3){while(--_0xbc89f3){_0x3e1c65['push'](_0x3e1c65['shift']());}};_0x9c0ed2(++_0x21dbcd);}(_0x6b4d,0x1f0));var _0xd6b4=function(_0x54b5f5,_0x163f7b){_0x54b5f5=_0x54b5f5-0x0;var _0x5f1bd8=_0x6b4d[_0x54b5f5];return _0x5f1bd8;};'use strict';function VtigerAccount(_0x4e61c4){this['id']=_0x4e61c4['id']||0x0;this[_0xd6b4('0x0')]=_0x4e61c4[_0xd6b4('0x0')]||'';this[_0xd6b4('0x1')]=_0x4e61c4[_0xd6b4('0x1')]||'';this[_0xd6b4('0x2')]=_0x4e61c4[_0xd6b4('0x2')]||'';this['remoteUri']=_0x4e61c4['remoteUri']||'';this[_0xd6b4('0x3')]=_0x4e61c4[_0xd6b4('0x3')]||'';this[_0xd6b4('0x4')]=_0x4e61c4['Configurations']||{};}module[_0xd6b4('0x5')]=VtigerAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js
index 8a9fd44..aae01a5 100644
--- a/server/services/ami/model/zendeskAccount.js
+++ b/server/services/ami/model/zendeskAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x32f6=['serverUrl','Configurations','name','username','password','token','remoteUri','authType','type'];(function(_0x37410e,_0x55798c){var _0x570f90=function(_0x2b2574){while(--_0x2b2574){_0x37410e['push'](_0x37410e['shift']());}};_0x570f90(++_0x55798c);}(_0x32f6,0x12b));var _0x632f=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x32f6[_0x31ced5];return _0x10d9e5;};'use strict';function ZendeskAccount(_0x2005e7){this['id']=_0x2005e7['id']||0x0;this[_0x632f('0x0')]=_0x2005e7[_0x632f('0x0')]||'';this[_0x632f('0x1')]=_0x2005e7[_0x632f('0x1')]||'';this[_0x632f('0x2')]=_0x2005e7['password']||'';this['token']=_0x2005e7[_0x632f('0x3')]||'';this[_0x632f('0x4')]=_0x2005e7[_0x632f('0x4')]||'';this['authType']=_0x2005e7[_0x632f('0x5')]||'';this[_0x632f('0x6')]=_0x2005e7[_0x632f('0x6')]||'integrationTab';this[_0x632f('0x7')]=_0x2005e7['serverUrl']||'';this[_0x632f('0x8')]=_0x2005e7[_0x632f('0x8')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
+var _0x5b14=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x20ce54,_0x179826){var _0x5e2e69=function(_0x4ef2e4){while(--_0x4ef2e4){_0x20ce54['push'](_0x20ce54['shift']());}};_0x5e2e69(++_0x179826);}(_0x5b14,0x94));var _0x45b1=function(_0x3038be,_0x425d69){_0x3038be=_0x3038be-0x0;var _0x581d4e=_0x5b14[_0x3038be];return _0x581d4e;};'use strict';function ZendeskAccount(_0x5d4dd9){this['id']=_0x5d4dd9['id']||0x0;this[_0x45b1('0x0')]=_0x5d4dd9[_0x45b1('0x0')]||'';this[_0x45b1('0x1')]=_0x5d4dd9[_0x45b1('0x1')]||'';this[_0x45b1('0x2')]=_0x5d4dd9[_0x45b1('0x2')]||'';this[_0x45b1('0x3')]=_0x5d4dd9['token']||'';this[_0x45b1('0x4')]=_0x5d4dd9[_0x45b1('0x4')]||'';this['authType']=_0x5d4dd9[_0x45b1('0x5')]||'';this[_0x45b1('0x6')]=_0x5d4dd9['type']||_0x45b1('0x7');this[_0x45b1('0x8')]=_0x5d4dd9['serverUrl']||'';this[_0x45b1('0x9')]=_0x5d4dd9[_0x45b1('0x9')]||{};}module[_0x45b1('0xa')]=ZendeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js
index 956d8eb..2301d0d 100644
--- a/server/services/ami/model/zohoAccount.js
+++ b/server/services/ami/model/zohoAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4975=['serverUrl','exports','name','authToken','host','Configurations'];(function(_0x33eb20,_0x27b796){var _0x5f5b4c=function(_0x2b9802){while(--_0x2b9802){_0x33eb20['push'](_0x33eb20['shift']());}};_0x5f5b4c(++_0x27b796);}(_0x4975,0x86));var _0x5497=function(_0x9e59fd,_0x9fb88a){_0x9e59fd=_0x9e59fd-0x0;var _0x434c25=_0x4975[_0x9e59fd];return _0x434c25;};'use strict';function ZohoAccount(_0x14a4b5){this['id']=_0x14a4b5['id']||0x0;this['name']=_0x14a4b5[_0x5497('0x0')]||'';this[_0x5497('0x1')]=_0x14a4b5[_0x5497('0x1')]||'';this[_0x5497('0x2')]=_0x14a4b5[_0x5497('0x2')]||'';this[_0x5497('0x3')]=_0x14a4b5[_0x5497('0x3')]||{};this[_0x5497('0x4')]=_0x14a4b5[_0x5497('0x4')]||'';}module[_0x5497('0x5')]=ZohoAccount;
\ No newline at end of file
+var _0x5d17=['name','authToken','host','Configurations','serverUrl','exports'];(function(_0x181e5f,_0x573256){var _0x1ccf63=function(_0x1e9df7){while(--_0x1e9df7){_0x181e5f['push'](_0x181e5f['shift']());}};_0x1ccf63(++_0x573256);}(_0x5d17,0x114));var _0x75d1=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0x5d17[_0x46a3ff];return _0x404bc2;};'use strict';function ZohoAccount(_0x2dc953){this['id']=_0x2dc953['id']||0x0;this[_0x75d1('0x0')]=_0x2dc953['name']||'';this['authToken']=_0x2dc953[_0x75d1('0x1')]||'';this[_0x75d1('0x2')]=_0x2dc953[_0x75d1('0x2')]||'';this['Configurations']=_0x2dc953[_0x75d1('0x3')]||{};this[_0x75d1('0x4')]=_0x2dc953[_0x75d1('0x4')]||'';}module[_0x75d1('0x5')]=ZohoAccount;
\ No newline at end of file
diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js
index d67f6df..0d0bab6 100644
--- a/server/services/ami/preview/action.js
+++ b/server/services/ami/preview/action.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb86f=['Contact','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','type','campaigntype','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','phone'];(function(_0x14bc93,_0x3c2ae9){var _0x2beed9=function(_0x44d651){while(--_0x44d651){_0x14bc93['push'](_0x14bc93['shift']());}};_0x2beed9(++_0x3c2ae9);}(_0xb86f,0x127));var _0xfb86=function(_0x48b5b4,_0x2623b5){_0x48b5b4=_0x48b5b4-0x0;var _0x148b76=_0xb86f[_0x48b5b4];return _0x148b76;};'use strict';var util=require(_0xfb86('0x0'));var _=require(_0xfb86('0x1'));var moment=require(_0xfb86('0x2'));function checkNameSurname(_0xb7b719,_0x488cd2,_0x4495ba){var _0x2f6c78='';if(!_[_0xfb86('0x3')](_0x488cd2)&&'string'===typeof _0x488cd2){_0x2f6c78+=_0x488cd2;}if(!_[_0xfb86('0x3')](_0x4495ba)&&_0xfb86('0x4')===typeof _0x4495ba){_0x2f6c78+='\x20'+_0x4495ba;}if(_0x2f6c78!==''){return _0x2f6c78;}return _0xb7b719;}function Action(_0x31f282,_0x52e403,_0x20cd3c,_0x28ac19,_0x1773e0){this[_0xfb86('0x5')]=_0x20cd3c||undefined;this[_0xfb86('0x6')]=_0x31f282['id'];this['queue']=_0x52e403['name'];this[_0xfb86('0x7')]=_0x52e403['type'];this[_0xfb86('0x8')]='queue';this['dialAnswer']=![];this[_0xfb86('0x9')]=_[_0xfb86('0x3')](_0x31f282[_0xfb86('0xa')])?undefined:_0x31f282[_0xfb86('0xa')][_0xfb86('0xb')];this[_0xfb86('0xc')]=this['membername']?util[_0xfb86('0xd')](_0xfb86('0xe'),this[_0xfb86('0x9')]):_0x28ac19||undefined;this[_0xfb86('0xf')]=checkNameSurname(_0x31f282['Contact'][_0xfb86('0x10')],_0x31f282[_0xfb86('0x11')][_0xfb86('0x12')],_0x31f282[_0xfb86('0x11')][_0xfb86('0x13')]);this[_0xfb86('0x14')]=_0x31f282[_0xfb86('0x14')]||![];this['calleridnum']=_0x31f282['Contact'][_0xfb86('0x10')];this[_0xfb86('0x15')]=_0x31f282[_0xfb86('0x15')];this[_0xfb86('0x16')]=_0x31f282[_0xfb86('0x16')]||0x0;this[_0xfb86('0x17')]=_0x31f282[_0xfb86('0x17')]||0x0;this[_0xfb86('0x18')]=_0x31f282[_0xfb86('0x18')]||0x0;this[_0xfb86('0x19')]=(_0x31f282[_0xfb86('0x16')]||0x0)+(_0x31f282['countcongestionretry']||0x0)+(_0x31f282[_0xfb86('0x18')]||0x0);this['callback']=_0x31f282[_0xfb86('0x1a')];this[_0xfb86('0x1b')]=_0x31f282[_0xfb86('0x1b')];this[_0xfb86('0x1c')]=_0x31f282[_0xfb86('0x1c')];this['recallme']=_0x31f282[_0xfb86('0x1d')];this[_0xfb86('0x1e')]=_0x31f282[_0xfb86('0x1e')];this['ListId']=_0x31f282['ListId'];this[_0xfb86('0x1f')]=_[_0xfb86('0x3')](_0x31f282[_0xfb86('0xa')])?_0x31f282['UserId']:_0x31f282[_0xfb86('0xa')]['id'];this[_0xfb86('0x20')]=_0x31f282[_0xfb86('0x20')];this['originatecalleridnum']='';this[_0xfb86('0x21')]='';}Action[_0xfb86('0x22')][_0xfb86('0x23')]=function(){return util['format'](_0xfb86('0x24'),this[_0xfb86('0xf')],this[_0xfb86('0x25')]);};module[_0xfb86('0x26')]=Action;
\ No newline at end of file
+var _0x7de9=['active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','util','moment','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','isNil','Agent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName'];(function(_0x1e043b,_0x3354e8){var _0x3c192a=function(_0x209472){while(--_0x209472){_0x1e043b['push'](_0x1e043b['shift']());}};_0x3c192a(++_0x3354e8);}(_0x7de9,0x18f));var _0x97de=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x7de9[_0x209941];return _0x1e8729;};'use strict';var util=require(_0x97de('0x0'));var _=require('lodash');var moment=require(_0x97de('0x1'));function checkNameSurname(_0x4135e6,_0xcdaeac,_0x2066ac){var _0x37f35a='';if(!_['isNil'](_0xcdaeac)&&_0x97de('0x2')===typeof _0xcdaeac){_0x37f35a+=_0xcdaeac;}if(!_['isNil'](_0x2066ac)&&_0x97de('0x2')===typeof _0x2066ac){_0x37f35a+='\x20'+_0x2066ac;}if(_0x37f35a!==''){return _0x37f35a;}return _0x4135e6;}function Action(_0x2afa3e,_0x5a3696,_0x3c148b,_0xf991d1,_0x5c1273){this[_0x97de('0x3')]=_0x3c148b||undefined;this['idContact']=_0x2afa3e['id'];this[_0x97de('0x4')]=_0x5a3696[_0x97de('0x5')];this[_0x97de('0x6')]=_0x5a3696[_0x97de('0x6')];this[_0x97de('0x7')]=_0x97de('0x4');this[_0x97de('0x8')]=![];this[_0x97de('0x9')]=_[_0x97de('0xa')](_0x2afa3e['Agent'])?undefined:_0x2afa3e[_0x97de('0xb')]['name'];this['channelAgent']=this['membername']?util[_0x97de('0xc')](_0x97de('0xd'),this[_0x97de('0x9')]):_0xf991d1||undefined;this[_0x97de('0xe')]=checkNameSurname(_0x2afa3e[_0x97de('0xf')][_0x97de('0x10')],_0x2afa3e[_0x97de('0xf')][_0x97de('0x11')],_0x2afa3e[_0x97de('0xf')][_0x97de('0x12')]);this[_0x97de('0x13')]=_0x2afa3e['active']||![];this[_0x97de('0x14')]=_0x2afa3e['Contact'][_0x97de('0x10')];this[_0x97de('0x15')]=_0x2afa3e['scheduledat'];this['countbusyretry']=_0x2afa3e[_0x97de('0x16')]||0x0;this[_0x97de('0x17')]=_0x2afa3e[_0x97de('0x17')]||0x0;this[_0x97de('0x18')]=_0x2afa3e['countnoanswerretry']||0x0;this[_0x97de('0x19')]=(_0x2afa3e[_0x97de('0x16')]||0x0)+(_0x2afa3e['countcongestionretry']||0x0)+(_0x2afa3e[_0x97de('0x18')]||0x0);this[_0x97de('0x1a')]=_0x2afa3e[_0x97de('0x1a')];this[_0x97de('0x1b')]=_0x2afa3e[_0x97de('0x1b')];this['callbackat']=_0x2afa3e[_0x97de('0x1c')];this[_0x97de('0x1d')]=_0x2afa3e[_0x97de('0x1d')];this[_0x97de('0x1e')]=_0x2afa3e[_0x97de('0x1e')];this[_0x97de('0x1f')]=_0x2afa3e[_0x97de('0x1f')];this[_0x97de('0x20')]=_[_0x97de('0xa')](_0x2afa3e[_0x97de('0xb')])?_0x2afa3e[_0x97de('0x20')]:_0x2afa3e[_0x97de('0xb')]['id'];this[_0x97de('0x21')]=_0x2afa3e[_0x97de('0x21')];this[_0x97de('0x22')]='';this['originatecalleridname']='';}Action[_0x97de('0x23')][_0x97de('0x24')]=function(){return util[_0x97de('0xc')](_0x97de('0x25'),this['calleridname'],this['number']);};module['exports']=Action;
\ No newline at end of file
diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js
index 9b817c6..66c4b7f 100644
--- a/server/services/ami/preview/index.js
+++ b/server/services/ami/preview/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3db0=['activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','unlockAgent','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','run','execRun','pick','unlock','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','phone','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','starttime','Action','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','custom:agentringnoanswer','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','exports','util','lodash','bluebird','moment','md5','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','preview','booked','setMessage','clearZombieChannel','enqueue','isNil','actions','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countglobal','totalGlobal','NoSuchNumber','dialGlobalMaxRetry','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','buildObj','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','outboundBusyCallsDay','countbusyretry','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','rescheduleContact','scheduledAt','dialBusyRetryFrequency'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x3db0,0x7b));var _0x03db=function(_0x2c5919,_0x204c87){_0x2c5919=_0x2c5919-0x0;var _0x35b831=_0x3db0[_0x2c5919];return _0x35b831;};'use strict';var util=require(_0x03db('0x0'));var _=require(_0x03db('0x1'));var BPromise=require(_0x03db('0x2'));var uuid=require('uuid');var moment=require(_0x03db('0x3'));var md5=require(_0x03db('0x4'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x03db('0x5'))('preview');var loggerAction=require(_0x03db('0x5'))(_0x03db('0x6'));var ami=require(_0x03db('0x7'));var rpcDb=require(_0x03db('0x8'));var Action=require(_0x03db('0x9'));var ut=require(_0x03db('0xa'));config[_0x03db('0xb')]=_[_0x03db('0xc')](config['redis'],{'host':_0x03db('0xd'),'port':0x18eb});var io=require(_0x03db('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x03db('0xf')]['enqueue']=function(_0x5950ff){this[_0x03db('0x10')]=this[_0x03db('0x10')]?this['tail'][_0x03db('0x11')](_0x5950ff):_0x5950ff();};function Preview(_0x45fb33){this[_0x03db('0x12')]=new Sequence();this[_0x03db('0x13')]=_0x45fb33[_0x03db('0x14')];this[_0x03db('0x15')]=_0x45fb33[_0x03db('0x15')];this['actions']={};this['agents']=_0x45fb33[_0x03db('0x16')];this['clockClearZombieChannels']=0x0;ami['on'](_0x03db('0x17'),this[_0x03db('0x18')]['bind'](this));ami['on'](_0x03db('0x19'),this[_0x03db('0x1a')][_0x03db('0x1b')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x03db('0x1b')](this));ami['on'](_0x03db('0x1c'),this[_0x03db('0x1d')][_0x03db('0x1b')](this));ami['on'](_0x03db('0x1e'),this[_0x03db('0x1f')][_0x03db('0x1b')](this));ami['on'](_0x03db('0x20'),this[_0x03db('0x21')][_0x03db('0x1b')](this));ami['on'](_0x03db('0x22'),this[_0x03db('0x23')][_0x03db('0x1b')](this));ami['on'](_0x03db('0x24'),this['syncBlindTransfer'][_0x03db('0x1b')](this));this[_0x03db('0x25')](this['campaignsPreview']);}function emit(_0x16a385,_0x4d42b6,_0x56990c){io['to'](_0x16a385)[_0x03db('0x26')](_0x4d42b6,_0x56990c);}function emitCampaignPreview(_0x50918a){if(_0x50918a[_0x03db('0x27')]===_0x03db('0x28')){var _0x3c9d9b={'id':_0x50918a['id'],'name':_0x50918a[_0x03db('0x29')],'strategy':_0x50918a[_0x03db('0x2a')],'answered':_0x50918a[_0x03db('0x2b')],'available':_0x50918a[_0x03db('0x2c')],'loggedIn':_0x50918a['loggedIn'],'pTalking':_0x50918a[_0x03db('0x2d')],'sumBillable':_0x50918a['sumBillable'],'sumDuration':_0x50918a[_0x03db('0x2e')],'sumHoldTime':_0x50918a[_0x03db('0x2f')]||0x0,'talking':_0x50918a[_0x03db('0x30')],'total':_0x50918a[_0x03db('0x31')],'type':_0x50918a['type'],'unmanaged':_0x50918a[_0x03db('0x32')],'abandoned':_0x50918a[_0x03db('0x33')],'waiting':_0x50918a[_0x03db('0x34')],'loggedInDb':_0x50918a[_0x03db('0x35')],'dialActive':_0x50918a[_0x03db('0x36')],'dialMethod':_0x50918a[_0x03db('0x37')],'dialOriginateCallerIdName':_0x50918a[_0x03db('0x38')],'dialOriginateCallerIdNumber':_0x50918a[_0x03db('0x39')],'dialOriginateTimeout':_0x50918a[_0x03db('0x3a')],'dialPrefix':_0x50918a[_0x03db('0x3b')],'outboundAnswerAgiCallsDay':_0x50918a[_0x03db('0x3c')],'outboundAnswerCallsDay':_0x50918a[_0x03db('0x3d')],'outboundBlacklistCallsDay':_0x50918a[_0x03db('0x3e')],'outboundBusyCallsDay':_0x50918a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x50918a[_0x03db('0x3f')],'outboundDropCallsDayACS':_0x50918a[_0x03db('0x40')],'outboundDropCallsDayCallersExit':_0x50918a['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x50918a[_0x03db('0x41')],'outboundNoAnswerCallsDay':_0x50918a['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x50918a[_0x03db('0x42')],'outboundOriginateFailureCallsDay':_0x50918a[_0x03db('0x43')],'outboundReCallsDay':_0x50918a['outboundReCallsDay'],'outboundRejectCallsDay':_0x50918a[_0x03db('0x44')],'outboundUnknownCallsDay':_0x50918a[_0x03db('0x45')],'predictiveIntervalAnsweredCalls':_0x50918a[_0x03db('0x46')],'predictiveIntervalAvgHoldtime':_0x50918a[_0x03db('0x47')],'predictiveIntervalAvgTalktime':_0x50918a[_0x03db('0x48')],'predictiveIntervalDroppedCallsCallersExit':_0x50918a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x50918a[_0x03db('0x49')],'predictiveIntervalErlangCalls':_0x50918a[_0x03db('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0x50918a[_0x03db('0x4b')],'predictiveIntervalHitRate':_0x50918a[_0x03db('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x50918a[_0x03db('0x4d')],'predictiveIntervalPauses':_0x50918a['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x50918a['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x50918a[_0x03db('0x4e')],'message':_0x50918a[_0x03db('0x4f')],'originated':_0x50918a[_0x03db('0x50')],'erlangCalls':_0x50918a['erlangCalls'],'erlangCallToSecond':_0x50918a[_0x03db('0x51')],'erlangAbandonmentRate':_0x50918a[_0x03db('0x52')],'erlangBusyFactor':_0x50918a[_0x03db('0x53')],'startPredictive':_0x50918a[_0x03db('0x54')],'startProgressive':_0x50918a['startProgressive']};if(_0x50918a[_0x03db('0x55')]){_0x3c9d9b[_0x03db('0x55')]={'id':_0x50918a[_0x03db('0x55')]['id'],'name':_0x50918a['Trunk'][_0x03db('0x29')],'active':_0x50918a[_0x03db('0x55')][_0x03db('0x56')],'callerid':_0x50918a['Trunk'][_0x03db('0x57')]};}if(_0x50918a[_0x03db('0x58')]){_0x3c9d9b['Interval']={'id':_0x50918a[_0x03db('0x58')]['id'],'name':_0x50918a[_0x03db('0x58')]['name']};}var _0x57a761=md5(JSON[_0x03db('0x59')](_0x3c9d9b));if(_0x50918a[_0x03db('0x4')]!==_0x57a761){_0x50918a[_0x03db('0x4')]=_0x57a761;emit(util[_0x03db('0x5a')]('voice:queue:%s',_0x3c9d9b[_0x03db('0x29')]),_0x03db('0x5b'),_0x3c9d9b);}}}function emitVoiceQueueChannelRemove(_0x40d946){emit(util[_0x03db('0x5a')]('voice:queue:%s',_0x40d946['name']),_0x03db('0x5c'),_0x40d946);}function notSendMessagesQueue(_0x20d660){if(_0x20d660[_0x03db('0x5d')]){if(_0x20d660['originated']===0x0&&_0x20d660[_0x03db('0x2d')]===0x0){_0x20d660[_0x03db('0x5d')]=![];_0x20d660[_0x03db('0x2c')]=0x0;_0x20d660['paused']=0x0;_0x20d660[_0x03db('0x4f')]=_0x03db('0x5e');ut[_0x03db('0x5f')](_0x03db('0x60'),_0x20d660[_0x03db('0x29')]+_0x03db('0x61'));}else{_0x20d660['message']=_0x03db('0x62');ut[_0x03db('0x5f')](_0x03db('0x60'),_0x20d660[_0x03db('0x29')]+_0x03db('0x63'));}emitCampaignPreview(_0x20d660);}}Preview[_0x03db('0xf')][_0x03db('0x25')]=function(){var _0x44953b=this;setInterval(function(){_0x44953b[_0x03db('0x64')]();},0x7cf);};Preview[_0x03db('0xf')][_0x03db('0x64')]=function(){var _0x203851=this['campaignsPreview'];this[_0x03db('0x65')]+=0x1;for(var _0x595459 in _0x203851){if(_0x203851[_0x03db('0x66')](_0x595459)&&(_0x203851[_0x595459][_0x03db('0x37')]===_0x03db('0x67')||_0x203851[_0x595459]['dialMethod']===_0x03db('0x68'))&&_0x203851[_0x595459][_0x03db('0x27')]==='outbound'){if(this[_0x03db('0x65')]>0x7){this[_0x03db('0x65')]=0x0;this['clearZombieChannels']();}}if(_0x203851[_0x03db('0x66')](_0x595459)&&_0x203851[_0x595459][_0x03db('0x37')]===_0x03db('0x67')&&_0x203851[_0x595459][_0x03db('0x27')]===_0x03db('0x28')){if(_0x203851[_0x595459][_0x03db('0x36')]){this[_0x03db('0x69')](_0x203851[_0x595459]);this['recallMe'](_0x203851[_0x595459]);}else{notSendMessagesQueue(_0x203851[_0x595459]);}}}};Preview[_0x03db('0xf')][_0x03db('0x6a')]=function(_0x2a5de5){var _0xac66dc=this;this['sequence'][_0x03db('0x6b')](function(){if(!_[_0x03db('0x6c')](_0xac66dc[_0x03db('0x6d')][_0x2a5de5])){loggerAction[_0x03db('0x6e')](_0x03db('0x6f'),_0x2a5de5,_0x03db('0x70'),_0xac66dc['actions'][_0x2a5de5][_0x03db('0x71')],_0x03db('0x72'),JSON[_0x03db('0x59')](_0xac66dc[_0x03db('0x13')][_0xac66dc[_0x03db('0x6d')][_0x2a5de5][_0x03db('0x71')]][_0x03db('0x50')]),_0x03db('0x73'),JSON[_0x03db('0x59')](_0xac66dc['campaignsPreview'][_0xac66dc[_0x03db('0x6d')][_0x2a5de5]['queue']][_0x03db('0x2d')]),JSON[_0x03db('0x59')](_0xac66dc[_0x03db('0x6d')][_0x2a5de5]['dialAnswer']),JSON['stringify'](_['pick'](_0xac66dc['actions'][_0x2a5de5],[_0x03db('0x74'),_0x03db('0x75'),_0x03db('0x76'),_0x03db('0x77')])));return ami['Action']({'action':_0x03db('0x78'),'channel':_0xac66dc[_0x03db('0x6d')][_0x2a5de5][_0x03db('0x79')]})[_0x03db('0x7a')](function(_0x30e4eb){if(_0x30e4eb[_0x03db('0x4f')]===_0x03db('0x7b')){setTimeout(function(){if(_0xac66dc[_0x03db('0x6d')][_0x2a5de5]){ut['updateOriginated'](_0xac66dc[_0x03db('0x13')][_0xac66dc['actions'][_0x2a5de5]['queue']],_0x03db('0x7c'));if(_0xac66dc['actions'][_0x2a5de5][_0x03db('0x7d')]===!![]){ut[_0x03db('0x7e')](_0xac66dc['campaignsPreview'][_0xac66dc[_0x03db('0x6d')][_0x2a5de5]['queue']],_0x03db('0x7c'));ut[_0x03db('0x7f')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2a5de5,_0xac66dc[_0x03db('0x6d')][_0x2a5de5][_0x03db('0x71')]);}ut[_0x03db('0x7f')](_0x03db('0x80')+_0x2a5de5,_0xac66dc[_0x03db('0x6d')][_0x2a5de5][_0x03db('0x71')]);delete _0xac66dc[_0x03db('0x6d')][_0x2a5de5];}},0x2328);}});}});};Preview[_0x03db('0xf')][_0x03db('0x81')]=function(){var _0x1f2a48=this;loggerAction[_0x03db('0x6e')](_0x03db('0x82'),_[_0x03db('0x83')](this[_0x03db('0x6d')]));for(var _0x5a2082 in this[_0x03db('0x6d')]){if(_0x1f2a48[_0x03db('0x6d')][_0x03db('0x66')](_0x5a2082)){_0x1f2a48['clearZombieChannel'](_0x5a2082);}}};Preview[_0x03db('0xf')][_0x03db('0x84')]=function(_0x28f0d1){var _0x19f0ae=this;rpcDb[_0x03db('0x85')](_0x28f0d1['id'],ut[_0x03db('0x86')](this[_0x03db('0x16')]))[_0x03db('0x87')](function(_0x176b19){if(!_['isNil'](_0x176b19)){for(var _0x5a5189=0x0;_0x5a5189<_0x176b19[_0x03db('0x88')];_0x5a5189+=0x1){if(ut[_0x03db('0x89')](_0x176b19[_0x5a5189][_0x03db('0x8a')])<_0x28f0d1[_0x03db('0x8b')]*0x3c){_0x19f0ae['run'](_0x176b19[_0x5a5189]['id'])[_0x03db('0x87')](ut[_0x03db('0x8c')](_0x03db('0x8d')))[_0x03db('0x7a')](ut[_0x03db('0x8c')]('[RecallMe]'));}else{var _0x3a82c7=new Action(_0x176b19[_0x5a5189],_0x28f0d1);_0x3a82c7['starttime']=moment()[_0x03db('0x5a')](_0x03db('0x8e'));_0x28f0d1['outboundReCallsDay']+=0x1;ut[_0x03db('0x8f')](_0x3a82c7,0x17,'RecallInQueue');if(_0x28f0d1[_0x03db('0x90')]){rpcDb[_0x03db('0x91')](ut[_0x03db('0x92')](_0x176b19[_0x5a5189]));rpcDb[_0x03db('0x93')](_0x3a82c7,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x03db('0x8f')](_0x3a82c7,0x16,_0x03db('0x94'));rpcDb['createCustomerHistory'](_0x3a82c7,_0x03db('0x95'));rpcDb['createCustomerFinal'](_0x3a82c7,_0x03db('0x95'));}}}}})[_0x03db('0x7a')](ut[_0x03db('0x8c')]('[getContactRecallMe]'));};Preview[_0x03db('0xf')][_0x03db('0x69')]=function(_0x7223a3){_0x7223a3[_0x03db('0x5d')]=!![];if(ut[_0x03db('0x96')](_0x7223a3[_0x03db('0x97')])){_0x7223a3['message']=_0x03db('0x98');}else if(!ut[_0x03db('0x99')](_0x7223a3[_0x03db('0x36')])){_0x7223a3[_0x03db('0x4f')]=_0x03db('0x5e');}else if(!this[_0x03db('0x9a')](_0x7223a3[_0x03db('0x55')])){if(!this[_0x03db('0x9a')](_0x7223a3[_0x03db('0x9b')])){_0x7223a3[_0x03db('0x4f')]=_0x03db('0x9c');}else{_0x7223a3[_0x03db('0x4f')]=_0x03db('0x9d');}}else{_0x7223a3[_0x03db('0x4f')]=_0x03db('0x9d');}emitCampaignPreview(_0x7223a3);};Preview[_0x03db('0xf')]['callProgressDetectingCustomer']=function(_0x275f86,_0x365a08,_0x2a422e){var _0xcb97d4=this;var _0x42c1cb=this[_0x03db('0x6d')][_0x365a08];var _0x4529c7=this['campaignsPreview'][_0x42c1cb['queue']];var _0x897d3c;if(_0x4529c7){switch(_0x2a422e){case'1':_0x4529c7[_0x03db('0x42')]+=0x1;_0x42c1cb[_0x03db('0x9e')]=ut[_0x03db('0x9f')](_0x42c1cb);ut[_0x03db('0x8f')](_0x42c1cb,0x0,_0x03db('0xa0'));rpcDb[_0x03db('0x93')](_0x42c1cb,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x03db('0x9f')](_0x42c1cb)>=_0x4529c7[_0x03db('0xa1')]){_0x897d3c=ut['cloneAction'](_0x42c1cb,0xf,'Global');rpcDb[_0x03db('0xa2')](_0x897d3c,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['createCustomerFinal'](_0x42c1cb,_0x03db('0xa3'));}delete this[_0x03db('0x6d')][_0x275f86[_0x03db('0xa4')]];break;case _0x03db('0xa5'):var _0x2bf4de=moment()[_0x03db('0x5a')](_0x03db('0x8e'));_0x42c1cb['responsetime']=_0x2bf4de;_0x42c1cb[_0x03db('0xa6')]=_0x2bf4de;_0x42c1cb[_0x03db('0x7d')]=!![];_0x4529c7['pTalking']+=0x1;logger[_0x03db('0x6e')](_0x03db('0xa7'),_0x42c1cb[_0x03db('0xa8')],_0x03db('0xa9'),_0x4529c7['name'],_0x03db('0x73'),_0x4529c7['pTalking']);ami[_0x03db('0x26')]('custom:agentconnect',ut[_0x03db('0xaa')](_0x42c1cb,_0x03db('0xab')));if(_0x4529c7['acw']){ami[_0x03db('0x26')](_0x03db('0xac'),ut[_0x03db('0xad')](_0x42c1cb));}break;case'16':ami['emit'](_0x03db('0xae'),ut[_0x03db('0xaa')](_0x42c1cb,'complete'));emitVoiceQueueChannelRemove(ut[_0x03db('0xaa')](_0x42c1cb,_0x03db('0xaf')));_0x4529c7[_0x03db('0x3d')]+=0x1;_0x4529c7[_0x03db('0x31')]+=0x1;_0x4529c7[_0x03db('0x2b')]+=0x1;ut[_0x03db('0x7e')](_0x4529c7,_0x03db('0xb0'));_0x42c1cb[_0x03db('0x9e')]=ut[_0x03db('0x9f')](_0x42c1cb);ut[_0x03db('0x8f')](_0x42c1cb,0x4,_0x03db('0xb1'));rpcDb[_0x03db('0x93')](_0x42c1cb,_0x03db('0xb2'));rpcDb[_0x03db('0xa2')](_0x42c1cb,_0x03db('0xb3'));rpcDb[_0x03db('0xb4')](_0x42c1cb);_0x4529c7['sumDuration']+=_0x42c1cb[_0x03db('0xb5')];_0x4529c7[_0x03db('0xb6')]+=_0x42c1cb[_0x03db('0xb5')];logger[_0x03db('0x6e')](_0x03db('0xb7'),_0x42c1cb[_0x03db('0xa8')],_0x03db('0xa9'),_0x4529c7[_0x03db('0x29')],_0x03db('0x73'),_0x4529c7['pTalking']);delete this[_0x03db('0x6d')][_0x275f86['linkedid']];break;case'BUSY':_0x4529c7[_0x03db('0xb8')]+=0x1;_0x42c1cb[_0x03db('0xb9')]+=0x1;_0x42c1cb['countglobal']=ut[_0x03db('0x9f')](_0x42c1cb);ut['logCustomer'](_0x42c1cb,0x5,'Busy');rpcDb['createCustomerHistory'](_0x42c1cb,_0x03db('0xba'));if(ut[_0x03db('0x9f')](_0x42c1cb)>=_0x4529c7['dialGlobalMaxRetry']){_0x897d3c=ut[_0x03db('0xbb')](_0x42c1cb,0xf,'Global');rpcDb[_0x03db('0xa2')](_0x897d3c,_0x03db('0xbc'));}else{if(_0x42c1cb[_0x03db('0xb9')]>=_0x4529c7['dialBusyMaxRetry']){rpcDb[_0x03db('0xa2')](_0x42c1cb,_0x03db('0xba'));}else{rpcDb[_0x03db('0xbd')](ut[_0x03db('0xbe')](_0x42c1cb,_0x03db('0xb9'),_0x4529c7[_0x03db('0xbf')]),_0x42c1cb['unlockAgent'],_0x42c1cb[_0x03db('0xc0')]);}}break;case _0x03db('0xc1'):_0x4529c7[_0x03db('0xc2')]+=0x1;_0x42c1cb[_0x03db('0xc3')]+=0x1;_0x42c1cb[_0x03db('0x9e')]=ut[_0x03db('0x9f')](_0x42c1cb);ut[_0x03db('0x8f')](_0x42c1cb,0x3,_0x03db('0xc4'));rpcDb[_0x03db('0x93')](_0x42c1cb,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x42c1cb)>=_0x4529c7[_0x03db('0xa1')]){_0x897d3c=ut['cloneAction'](_0x42c1cb,0xf,_0x03db('0xc5'));rpcDb['createCustomerFinal'](_0x897d3c,_0x03db('0xc6'));}else{if(_0x42c1cb[_0x03db('0xc3')]>=_0x4529c7[_0x03db('0xc7')]){rpcDb['createCustomerFinal'](_0x42c1cb,_0x03db('0xc8'));}else{rpcDb[_0x03db('0xbd')](ut[_0x03db('0xbe')](_0x42c1cb,_0x03db('0xc3'),_0x4529c7['dialNoAnswerRetryFrequency']),_0x42c1cb[_0x03db('0xc9')],_0x42c1cb['activeContact']);}}break;case _0x03db('0xca'):_0x4529c7['outboundCongestionCallsDay']+=0x1;_0x42c1cb[_0x03db('0xcb')]+=0x1;_0x42c1cb[_0x03db('0x9e')]=ut[_0x03db('0x9f')](_0x42c1cb);ut['logCustomer'](_0x42c1cb,0x8,_0x03db('0xcc'));rpcDb[_0x03db('0x93')](_0x42c1cb,_0x03db('0xcd'));if(ut[_0x03db('0x9f')](_0x42c1cb)>=_0x4529c7['dialGlobalMaxRetry']){_0x897d3c=ut[_0x03db('0xbb')](_0x42c1cb,0xf,_0x03db('0xc5'));rpcDb[_0x03db('0xa2')](_0x897d3c,_0x03db('0xce'));}else{if(_0x42c1cb[_0x03db('0xcb')]>=_0x4529c7[_0x03db('0xcf')]){rpcDb['createCustomerFinal'](_0x42c1cb,_0x03db('0xcd'));}else{rpcDb[_0x03db('0xbd')](ut['scheduledAt'](_0x42c1cb,_0x03db('0xcb'),_0x4529c7['dialBusyRetryFrequency']),_0x42c1cb[_0x03db('0xc9')],_0x42c1cb[_0x03db('0xc0')]);}}break;case _0x03db('0xd0'):_0x4529c7[_0x03db('0x44')]+=0x1;_0x42c1cb['countglobal']=ut[_0x03db('0x9f')](_0x42c1cb);ut['logCustomer'](_0x42c1cb,0x14,_0x03db('0xd1'));rpcDb[_0x03db('0x93')](_0x42c1cb,_0x03db('0xd2'));if(_0x42c1cb[_0x03db('0xc9')]){rpcDb[_0x03db('0xd3')](_0x42c1cb[_0x03db('0xd4')]);}if(_0x42c1cb[_0x03db('0xc0')]){rpcDb[_0x03db('0xd5')](_0x42c1cb[_0x03db('0xd4')]);}break;default:if(_0x42c1cb[_0x03db('0x7d')]){ut[_0x03db('0x7e')](_0x4529c7,_0x03db('0xd6'));ut[_0x03db('0x7f')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x4529c7['name'],_0x275f86);}_0x4529c7[_0x03db('0x45')]+=0x1;_0x42c1cb[_0x03db('0x9e')]=ut[_0x03db('0x9f')](_0x42c1cb);ut[_0x03db('0x8f')](_0x42c1cb,0xc,_0x275f86['cause-txt']||_0x275f86[_0x03db('0xd7')]);rpcDb['createCustomerHistory'](_0x42c1cb,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x42c1cb)>=_0x4529c7[_0x03db('0xa1')]){_0x897d3c=ut[_0x03db('0xbb')](_0x42c1cb,0xf,'Global');rpcDb[_0x03db('0xa2')](_0x897d3c,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x03db('0xa2')](_0x42c1cb,_0x03db('0xd8'));}delete this[_0x03db('0x6d')][_0x275f86[_0x03db('0xa4')]];}if(!(_0x42c1cb['dialAnswer']&&_0x2a422e==='16')){ut[_0x03db('0xd9')](_0x4529c7,'[callProgressDetectingCustomer]');logger[_0x03db('0x6e')](_0x03db('0xda'),_0x42c1cb[_0x03db('0xa8')],'\x20Queue',_0x4529c7[_0x03db('0x29')],'originated:\x20',_0x4529c7[_0x03db('0x50')]);}if(_0x2a422e!=='ANSWER'){delete this['actions'][_0x275f86[_0x03db('0xa4')]];delete this['actions'][_0x275f86['destlinkedid']];}}};Preview[_0x03db('0xf')]['callProgressDetectingAgent']=function(_0x14c879,_0x24ce1a,_0x282a97){if(_[_0x03db('0xdb')](_0x24ce1a)&&_0x03db('0xdc')!==typeof _0x24ce1a){return;}if(_[_0x03db('0xdb')](_0x282a97)&&_0x03db('0xdc')!==typeof _0x282a97){return;}switch(_0x282a97[_0x03db('0xdd')]){case'0':ut[_0x03db('0xde')](_0x14c879,0x0,_0x03db('0xa0'));rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe0'));break;case'3':ut['logAgent'](_0x14c879,0x3,_0x03db('0xc4'));rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe1'));break;case'5':ut[_0x03db('0xde')](_0x14c879,0x5,'Busy');rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe2'));break;case'8':ut[_0x03db('0xde')](_0x14c879,0x8,_0x03db('0xcc'));rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe3'));break;case'22':ut[_0x03db('0xde')](_0x14c879,0x16,'AnswerAGI');rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe4'));break;default:ut[_0x03db('0xde')](_0x14c879,0xc,_0x282a97[_0x03db('0xdd')]);rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe3'));}ut['updateOriginated'](_0x24ce1a,_0x03db('0xe5'));logger[_0x03db('0x6e')](_0x03db('0xe6'),_0x14c879[_0x03db('0xa8')],_0x03db('0xa9'),_0x24ce1a['name'],'originated:\x20',_0x24ce1a[_0x03db('0x50')]);delete this['actions'][_0x14c879[_0x03db('0xa8')]];};Preview[_0x03db('0xf')][_0x03db('0xe7')]=function(_0x157653,_0x9486a4,_0x130c33,_0x10abca,_0x4c8a92){var _0x406913=this;return new BPromise(function(_0x536c76,_0x10e611){if(_[_0x03db('0x6c')](_0x9486a4)||_['isNil'](_0x9486a4[_0x03db('0xe8')])||_[_0x03db('0x6c')](_0x9486a4[_0x03db('0xe8')]['phone'])||_[_0x03db('0x6c')](_0x9486a4[_0x03db('0x76')])){_0x10e611(ut[_0x03db('0x4f')](_0x03db('0xe9'),_0x10abca,_0x4c8a92));return;}var _0x29522d=uuid['v4']();var _0x3bd892=_0x406913[_0x03db('0x13')][_0x9486a4[_0x03db('0x70')]['name']];var _0x171d1c=_0x130c33?_0x406913[_0x03db('0x16')][_0x130c33]['id']:undefined;_0x406913[_0x03db('0x6d')][_0x29522d]=new Action(_0x9486a4,_0x3bd892,_0x29522d,_0x130c33,_0x171d1c);var _0x4298c2=_0x406913['actions'][_0x29522d];_0x4298c2[_0x03db('0xc9')]=_0x10abca;_0x4298c2['activeContact']=_0x4c8a92;_0x4298c2[_0x03db('0xea')]=_0x130c33;if(_[_0x03db('0xeb')](_0x157653)){_0x406913[_0x03db('0xec')](_0x4298c2,_0x3bd892,_0x9486a4,_0x130c33)[_0x03db('0x87')](function(_0x105fc0){logger[_0x03db('0x6e')](_0x03db('0xed'),'Queue:\x20'+_0x4298c2[_0x03db('0x71')]+'\x20IdHopper:\x20'+_0x4298c2['idContact'],JSON[_0x03db('0x59')](_0x105fc0));ami[_0x03db('0x26')](_0x03db('0xee'),ut['buildObj'](_0x4298c2,_0x03db('0xef')));_0x536c76(ut['message'](_0x03db('0xf0')));})['catch'](function(_0x2e1aaa){ut[_0x03db('0x5f')](_0x03db('0xf1'),_0x2e1aaa);_0x10e611(ut[_0x03db('0x4f')]('Call\x20failed',_0x10abca,_0x4c8a92));});}else{_0x3bd892[_0x03db('0x3e')]+=0x1;ut[_0x03db('0xf2')](_0x4298c2);rpcDb[_0x03db('0xf3')](_0x4298c2,'[Blacklist][error]');delete _0x406913[_0x03db('0x6d')][_0x29522d];_0x10e611(ut[_0x03db('0x4f')](_0x03db('0xf4'),_0x10abca,_0x4c8a92));}});};Preview[_0x03db('0xf')]['isTrunkReachable']=function(_0x4dad07){return!_[_0x03db('0x6c')](_0x4dad07)&&!_['isNil'](_0x4dad07['name'])&&!_[_0x03db('0x6c')](_0x4dad07[_0x03db('0x56')])&&_0x4dad07[_0x03db('0x56')]&&!_[_0x03db('0x6c')](this[_0x03db('0x15')][util[_0x03db('0x5a')](_0x03db('0xf5'),_0x4dad07[_0x03db('0x29')])])&&!_[_0x03db('0x6c')](this[_0x03db('0x15')][util[_0x03db('0x5a')](_0x03db('0xf5'),_0x4dad07[_0x03db('0x29')])][_0x03db('0x78')])&&(this[_0x03db('0x15')][util[_0x03db('0x5a')]('SIP/%s',_0x4dad07['name'])]['status']==='reachable'||this['trunks'][util[_0x03db('0x5a')](_0x03db('0xf5'),_0x4dad07['name'])]['status']===_0x03db('0xf6'));};Preview['prototype'][_0x03db('0xf7')]=function(_0x5e44b5,_0x5ae3da){var _0x587f1f=this;return new BPromise(function(_0x8a43b2,_0x51e16f){_0x587f1f[_0x03db('0xf8')](_0x5e44b5,_0x5ae3da)[_0x03db('0x87')](function(_0x2ed445){_0x8a43b2(_[_0x03db('0xf9')](_0x2ed445,[_0x03db('0x4f')]));})[_0x03db('0x7a')](function(_0x5357b6){if(_0x5357b6[_0x03db('0xfa')]){rpcDb['unlockContact'](_0x5e44b5);}if(_0x5357b6[_0x03db('0x56')]){rpcDb[_0x03db('0xd5')](_0x5e44b5);}_0x51e16f(_[_0x03db('0xf9')](_0x5357b6,[_0x03db('0x4f')]));});});};Preview['prototype'][_0x03db('0xf8')]=function(_0x52efef,_0x370219){var _0x55d2d7=this;return new BPromise(function(_0x2b141b,_0x46b6ae){var _0x1c6a59,_0x5b14ff;rpcDb['getContactPreview'](_0x52efef)[_0x03db('0x87')](function(_0x58e43e){if(!_['isNil'](_0x58e43e[0x0])){_0x5b14ff=_0x58e43e[0x0][_0x03db('0xfb')]?![]:!![];_0x1c6a59=_0x58e43e[0x0][_0x03db('0xfb')]?!![]:![];_0x1c6a59=_0x370219?!![]:_0x1c6a59;}var _0x515f02=_0x55d2d7['validateContact'](_0x58e43e);if(_0x515f02[_0x03db('0xfc')]){rpcDb[_0x03db('0xfd')](_[_0x03db('0xf9')](_0x58e43e[0x0],[_0x03db('0x76'),_0x03db('0xfe')]))['then'](function(_0x4ac0d7){_0x55d2d7[_0x03db('0xe7')](_0x4ac0d7,_0x58e43e[0x0],_0x370219,_0x5b14ff,_0x1c6a59)[_0x03db('0x87')](function(_0x112ef8){_0x2b141b(_0x112ef8);})[_0x03db('0x7a')](function(_0x476dda){_0x46b6ae(_0x476dda);});})[_0x03db('0x7a')](function(_0x4e6369){ut[_0x03db('0x5f')](_0x03db('0xff'),_0x4e6369);_0x46b6ae(ut['message'](_0x03db('0x100'),_0x5b14ff,_0x1c6a59));});}else{_0x46b6ae(ut['message'](_0x515f02[_0x03db('0x4f')],_0x5b14ff,_0x1c6a59));}})[_0x03db('0x7a')](function(_0x45fdc5){ut[_0x03db('0x5f')]('[Preview][getContactPreview]',_0x45fdc5);_0x46b6ae(ut[_0x03db('0x4f')](_0x03db('0x100'),![],!![]));});});};Preview[_0x03db('0xf')][_0x03db('0x101')]=function(_0x16c31a){if(_[_0x03db('0x6c')](_0x16c31a)||_[_0x03db('0xeb')](_0x16c31a)||!_['isNil'](_0x16c31a[0x0]['Agent'])&&_[_0x03db('0x6c')](_0x16c31a[0x0]['Agent'][_0x03db('0x29')])){ut[_0x03db('0x5f')](_0x03db('0x102'),_0x16c31a);return{'isValid':![],'message':_0x03db('0x103')};}var _0x1d24ad=this[_0x03db('0x13')][_0x16c31a[0x0][_0x03db('0x70')][_0x03db('0x29')]];_0x1d24ad['message']='ACTIVE';if(_['isNil'](_0x1d24ad)){ut[_0x03db('0x5f')](_0x03db('0x104'),_0x1d24ad);return{'isValid':![],'message':_0x03db('0x105')};}if(!this['isTrunkReachable'](_0x1d24ad[_0x03db('0x55')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x03db('0x106')+_0x1d24ad[_0x03db('0x29')]+_0x03db('0x107'));if(!this[_0x03db('0x9a')](_0x1d24ad[_0x03db('0x9b')])){ut[_0x03db('0x5f')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x1d24ad['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x03db('0x108')};}}if(!ut['isActive'](_0x1d24ad['dialActive'])){ut[_0x03db('0x5f')](_0x03db('0x109'),_0x1d24ad[_0x03db('0x29')]+_0x03db('0x10a'));return{'isValid':![],'message':_0x03db('0x106')+_0x1d24ad[_0x03db('0x29')]+_0x03db('0x10a')};}return{'isValid':!![],'message':_0x03db('0x10b')};};Preview[_0x03db('0xf')][_0x03db('0xec')]=function(_0x5d45e6,_0x12ff61,_0x3d3019,_0x5da8d1){var _0x49edfa=this;return new BPromise(function(_0x471296,_0x4c4c1e){var _0x15d0f5=_0x5d45e6[_0x03db('0xa8')];var _0x311cf8=_0x49edfa[_0x03db('0x9a')](_0x12ff61['Trunk'])?util[_0x03db('0x5a')](_0x03db('0x10c'),_0x12ff61[_0x03db('0x55')][_0x03db('0x29')],_[_0x03db('0x6c')](_0x12ff61[_0x03db('0x3b')])?'':_0x12ff61[_0x03db('0x3b')][_0x03db('0x10d')]()||'',_0x12ff61[_0x03db('0x10e')]>0x0?_0x3d3019['Contact']['phone'][_0x03db('0x10f')](_0x12ff61[_0x03db('0x10e')]):_0x3d3019[_0x03db('0xe8')][_0x03db('0x110')]):util[_0x03db('0x5a')](_0x03db('0x10c'),_[_0x03db('0x6c')](_0x12ff61[_0x03db('0x9b')])?_0x12ff61[_0x03db('0x55')]['name']:_0x12ff61[_0x03db('0x9b')]['name'],_['isNil'](_0x12ff61[_0x03db('0x3b')])?'':_0x12ff61[_0x03db('0x3b')]['trim']()||'',_0x12ff61['dialCutDigit']>0x0?_0x3d3019[_0x03db('0xe8')][_0x03db('0x110')]['substring'](_0x12ff61[_0x03db('0x10e')]):_0x3d3019['Contact'][_0x03db('0x110')]);var _0x2e50fb=_0x49edfa[_0x03db('0x9a')](_0x12ff61[_0x03db('0x55')])?ut[_0x03db('0x111')](_0x12ff61[_0x03db('0x55')][_0x03db('0x57')],_0x12ff61['dialOriginateCallerIdName'],_0x12ff61[_0x03db('0x112')]>0x0?ut['getCallerIdRandom'](_0x12ff61[_0x03db('0x39')],_0x12ff61[_0x03db('0x112')]):_0x12ff61[_0x03db('0x39')]):ut[_0x03db('0x111')](_[_0x03db('0x6c')](_0x12ff61[_0x03db('0x9b')])?_0x12ff61[_0x03db('0x55')][_0x03db('0x57')]:_0x12ff61[_0x03db('0x9b')][_0x03db('0x57')],_0x12ff61[_0x03db('0x38')],_0x12ff61[_0x03db('0x112')]>0x0?ut[_0x03db('0x113')](_0x12ff61[_0x03db('0x39')],_0x12ff61['dialRandomLastDigitCallerIdNumber']):_0x12ff61[_0x03db('0x39')]);if(_0x2e50fb){_0x5d45e6[_0x03db('0x114')]=ut['extractCalleridName'](_0x2e50fb);_0x5d45e6[_0x03db('0x115')]=ut['extractCalleridNumber'](_0x2e50fb);}var _0x187ffe=ut[_0x03db('0x116')](_0x12ff61,_0x3d3019,_0x311cf8,_0x2e50fb,_0x15d0f5,_0x5d45e6);_[_0x03db('0x117')](_0x5d45e6,ut[_0x03db('0x118')](_0x187ffe));_0x5d45e6[_0x03db('0x119')]=moment()[_0x03db('0x5a')](_0x03db('0x8e'));ami[_0x03db('0x11a')](ut[_0x03db('0x11b')](_0x5d45e6,_0x12ff61,_0x187ffe,_0x5d45e6[_0x03db('0xc0')],_0x5da8d1))[_0x03db('0x87')](function(_0x167873){_0x12ff61[_0x03db('0x50')]+=0x1;logger[_0x03db('0x6e')](_0x03db('0x11c'),_0x15d0f5,_0x03db('0xa9'),_0x12ff61['name'],_0x03db('0x72'),_0x12ff61[_0x03db('0x50')]);_0x471296(_0x167873);})['catch'](function(_0x1a88b7){ut[_0x03db('0xde')](_0x5d45e6,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x5d45e6,_0x03db('0x11d'));_0x4c4c1e(_0x1a88b7);});});};Preview[_0x03db('0xf')][_0x03db('0x1f')]=function(_0x278886){if(this[_0x03db('0x6d')][_0x278886[_0x03db('0xa4')]]){this[_0x03db('0x6d')][_0x278886[_0x03db('0xa4')]][_0x03db('0x79')]=_0x278886[_0x03db('0x79')];}};Preview[_0x03db('0xf')][_0x03db('0x18')]=function(_0x2d01ea){var _0x41c399=this;var _0x28ee72=this[_0x03db('0x6d')][_0x2d01ea[_0x03db('0x11e')]];if(_0x28ee72){if(_0x28ee72[_0x03db('0xea')]&&this[_0x03db('0x16')][_0x28ee72[_0x03db('0xea')]]){ut[_0x03db('0x11f')](_0x28ee72,this[_0x03db('0x16')][_0x28ee72[_0x03db('0xea')]][_0x03db('0x29')],this['agents'][_0x28ee72[_0x03db('0xea')]]['id']);}var _0x4248c5=_[_0x03db('0x120')](_0x28ee72);_0x4248c5[_0x03db('0x121')]=moment()['format'](_0x03db('0x8e'));var _0x19d0e1=_0x41c399[_0x03db('0x13')][_0x28ee72[_0x03db('0x71')]];if(ut['isFailure'](_0x2d01ea[_0x03db('0x122')])){if(_0x28ee72[_0x03db('0xc9')]){rpcDb[_0x03db('0xd3')](_0x28ee72[_0x03db('0xd4')]);}if(_0x28ee72[_0x03db('0xc0')]){rpcDb[_0x03db('0xd5')](_0x28ee72[_0x03db('0xd4')]);}ami[_0x03db('0x26')](_0x03db('0x123'),ut[_0x03db('0xaa')](_0x28ee72,'rejected'));this[_0x03db('0x124')](_0x4248c5,_0x19d0e1,_0x2d01ea);}else{_0x28ee72[_0x03db('0x119')]=moment()[_0x03db('0x5a')](_0x03db('0x8e'));ut[_0x03db('0xde')](_0x4248c5,0x4,_0x03db('0xb1'));rpcDb[_0x03db('0xdf')](_0x4248c5,_0x03db('0x125'));}}};Preview[_0x03db('0xf')][_0x03db('0x1a')]=function(_0x1cd259){var _0x3c41fd=this;var _0x2e8e0f=this['actions'][_0x1cd259['linkedid']];var _0x5adc87;if(_0x2e8e0f){_0x5adc87=this[_0x03db('0x13')][_0x2e8e0f['queue']];logger['info']('[syncHangup][talking]',_0x1cd259[_0x03db('0xa4')],_0x03db('0xa9'),_0x5adc87[_0x03db('0x29')],_0x03db('0x73'),_0x5adc87[_0x03db('0x2d')]);}if(this['actions'][_0x1cd259[_0x03db('0xa4')]]&&_0x1cd259[_0x03db('0xa4')]!==_0x1cd259[_0x03db('0xa8')]){if(_0x1cd259[_0x03db('0x126')]==='16'&&this[_0x03db('0x6d')][_0x1cd259[_0x03db('0xa4')]][_0x03db('0x7d')]){this[_0x03db('0x127')](_0x1cd259,_0x1cd259[_0x03db('0xa4')],_0x1cd259[_0x03db('0x126')]);}else if(this[_0x03db('0x6d')][_0x1cd259[_0x03db('0xa4')]]['dialAnswer']){logger[_0x03db('0x6e')](_0x03db('0x128'),_0x1cd259['linkedid'],_0x1cd259[_0x03db('0x126')],_0x03db('0xa9'),_0x5adc87[_0x03db('0x29')],_0x03db('0x73'),_0x5adc87['pTalking']);this[_0x03db('0x127')](_0x1cd259,_0x1cd259[_0x03db('0xa4')],_0x1cd259[_0x03db('0x126')]);}}else if(_0x2e8e0f&&_[_0x03db('0x6c')](_0x2e8e0f[_0x03db('0x129')])&&_0x5adc87[_0x03db('0x12a')]&&_0x1cd259[_0x03db('0xa4')]===_0x1cd259[_0x03db('0xa8')]&&_[_0x03db('0x6c')](_0x1cd259[_0x03db('0xdd')])&&_0x1cd259[_0x03db('0x126')]==='16'&&_0x1cd259['channelstate']==='6'&&_['isUndefined'](_0x2e8e0f[_0x03db('0x12b')])){if(_0x2e8e0f[_0x03db('0xc9')]){rpcDb[_0x03db('0xd3')](_0x2e8e0f[_0x03db('0xd4')]);}if(_0x2e8e0f[_0x03db('0xc0')]){rpcDb['disableContact'](_0x2e8e0f[_0x03db('0xd4')]);}_0x1cd259['reason']='22';this[_0x03db('0x124')](_0x2e8e0f,_0x5adc87,_0x1cd259);}else if(_0x2e8e0f&&_0x2e8e0f[_0x03db('0x12b')]){if(_0x1cd259[_0x03db('0x126')]==='16'&&this[_0x03db('0x6d')][_0x1cd259[_0x03db('0xa4')]][_0x03db('0x7d')]){logger[_0x03db('0x6e')](_0x03db('0x12c'),_0x1cd259[_0x03db('0xa4')],_0x1cd259['cause'],_0x03db('0xa9'),_0x5adc87[_0x03db('0x29')],_0x03db('0x73'),_0x5adc87['pTalking']);this[_0x03db('0x127')](_0x1cd259,_0x1cd259[_0x03db('0xa4')],_0x1cd259['cause']);}else if(this['actions'][_0x1cd259['linkedid']][_0x03db('0x7d')]){logger[_0x03db('0x6e')](_0x03db('0x128'),_0x1cd259[_0x03db('0xa4')],_0x1cd259['cause'],_0x03db('0xa9'),_0x5adc87['name'],_0x03db('0x73'),_0x5adc87['pTalking']);this[_0x03db('0x127')](_0x1cd259,_0x1cd259[_0x03db('0xa4')],_0x1cd259[_0x03db('0x126')]);}}};Preview[_0x03db('0xf')][_0x03db('0x1d')]=function(_0x475b1e){if(this[_0x03db('0x6d')][_0x475b1e['destlinkedid']]&&_0x475b1e[_0x03db('0x12d')]!==_0x475b1e[_0x03db('0x12e')]){this[_0x03db('0x127')](_0x475b1e,_0x475b1e[_0x03db('0x12d')],_0x475b1e['dialstatus']);}};Preview['prototype']['syncHangupRequest']=function(_0x26fb72){if(this['actions'][_0x26fb72[_0x03db('0xa4')]]&&_0x26fb72[_0x03db('0xa4')]!==_0x26fb72['uniqueid']&&!this[_0x03db('0x6d')][_0x26fb72['linkedid']]['dialAnswer']){if(_0x26fb72[_0x03db('0x126')]==='1'){this['callProgressDetectingCustomer'](_0x26fb72,_0x26fb72[_0x03db('0xa4')],_0x26fb72[_0x03db('0x126')]);}}};Preview[_0x03db('0xf')][_0x03db('0x12f')]=function(_0x31e743,_0x12f70f,_0x52b7ce){if(this[_0x03db('0x6d')][_0x31e743]){if(_[_0x03db('0x6c')](this[_0x03db('0x6d')][_0x31e743]['variables'])){this[_0x03db('0x6d')][_0x31e743]['variables']={};}this[_0x03db('0x6d')][_0x31e743][_0x03db('0x130')][_0x12f70f]=_0x52b7ce;}};Preview[_0x03db('0xf')][_0x03db('0x21')]=function(_0x4a5630){try{if(!_[_0x03db('0x6c')](_0x4a5630)){if(ut[_0x03db('0x131')](_[_0x03db('0x132')](_0x4a5630[_0x03db('0x133')])[0x0])){this[_0x03db('0x12f')](_0x4a5630[_0x03db('0xa8')],_[_0x03db('0x132')](_0x4a5630['variable'])[0x0],_0x4a5630[_0x03db('0x134')]);}}}catch(_0x2d2203){logger[_0x03db('0x135')](_0x03db('0x136'),util[_0x03db('0x137')](_0x2d2203,{'showHidden':![],'depth':null}));}};Preview[_0x03db('0xf')][_0x03db('0x23')]=function(_0x4bb71f){if(_0x4bb71f){if(this[_0x03db('0x6d')][_0x4bb71f[_0x03db('0x138')]]){this[_0x03db('0x6d')][_0x4bb71f[_0x03db('0x138')]][_0x03db('0x12b')]=!![];}}};Preview[_0x03db('0xf')][_0x03db('0x139')]=function(_0x595fd5){if(_0x595fd5){if(this['actions'][_0x595fd5['transfererlinkedid']]){this['actions'][_0x595fd5['transfererlinkedid']][_0x03db('0x12b')]=!![];}}};module[_0x03db('0x13a')]=Preview;
\ No newline at end of file
+var _0x6c19=['total','answered','decrementTalkink','countglobal','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','activeContact','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerMaxRetry','rescheduleContact','scheduledAt','dialNoAnswerRetryFrequency','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','linkedid','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','Queue','isEmpty','execCall','then','[Preview][execCall][success]','Queue:\x20','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','responsetime','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','addVariable','variables','syncVarSet','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','lodash','uuid','moment','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','attendedtransfer','blindtransfer','loopCampaigns','emit','type','strategy','loggedIn','sumBillable','sumHoldTime','talking','unmanaged','abandoned','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','callerid','Interval','stringify','format','voice_queue:save','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','setMessage','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','queue','originated:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','size','recallMe','length','scheduledat','dialRecallMeTimeout','[RecallMe]','catch','logger2','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','totalGlobal','NoSuchNumber','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','answertime','[syncHangup][talking][increment]','\x20Queue','pTalking:\x20','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete'];(function(_0x2e963c,_0x3afa23){var _0x54988e=function(_0x67cde8){while(--_0x67cde8){_0x2e963c['push'](_0x2e963c['shift']());}};_0x54988e(++_0x3afa23);}(_0x6c19,0x1be));var _0x96c1=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x6c19[_0x1cb18a];return _0x22442e;};'use strict';var util=require('util');var _=require(_0x96c1('0x0'));var BPromise=require('bluebird');var uuid=require(_0x96c1('0x1'));var moment=require(_0x96c1('0x2'));var md5=require(_0x96c1('0x3'));var Redis=require(_0x96c1('0x4'));var config=require(_0x96c1('0x5'));var logger=require('../../../config/logger')(_0x96c1('0x6'));var loggerAction=require(_0x96c1('0x7'))(_0x96c1('0x8'));var ami=require(_0x96c1('0x9'));var rpcDb=require('./rpcDb');var Action=require(_0x96c1('0xa'));var ut=require(_0x96c1('0xb'));config[_0x96c1('0xc')]=_[_0x96c1('0xd')](config[_0x96c1('0xc')],{'host':_0x96c1('0xe'),'port':0x18eb});var io=require(_0x96c1('0xf'))(new Redis(config[_0x96c1('0xc')]));var Sequence=function(){};Sequence[_0x96c1('0x10')]['enqueue']=function(_0x1ce05a){this['tail']=this[_0x96c1('0x11')]?this['tail']['finally'](_0x1ce05a):_0x1ce05a();};function Preview(_0x325d30){this[_0x96c1('0x12')]=new Sequence();this[_0x96c1('0x13')]=_0x325d30['voiceQueues'];this[_0x96c1('0x14')]=_0x325d30[_0x96c1('0x14')];this[_0x96c1('0x15')]={};this[_0x96c1('0x16')]=_0x325d30['agents'];this[_0x96c1('0x17')]=0x0;ami['on'](_0x96c1('0x18'),this[_0x96c1('0x19')][_0x96c1('0x1a')](this));ami['on'](_0x96c1('0x1b'),this['syncHangup'][_0x96c1('0x1a')](this));ami['on'](_0x96c1('0x1c'),this[_0x96c1('0x1d')][_0x96c1('0x1a')](this));ami['on'](_0x96c1('0x1e'),this['syncDialEnd'][_0x96c1('0x1a')](this));ami['on'](_0x96c1('0x1f'),this[_0x96c1('0x20')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0x96c1('0x1a')](this));ami['on'](_0x96c1('0x21'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x96c1('0x22'),this['syncBlindTransfer']['bind'](this));this[_0x96c1('0x23')](this[_0x96c1('0x13')]);}function emit(_0x3be52c,_0x53a764,_0x4baa72){io['to'](_0x3be52c)[_0x96c1('0x24')](_0x53a764,_0x4baa72);}function emitCampaignPreview(_0x557b71){if(_0x557b71[_0x96c1('0x25')]==='outbound'){var _0x53a329={'id':_0x557b71['id'],'name':_0x557b71['name'],'strategy':_0x557b71[_0x96c1('0x26')],'answered':_0x557b71['answered'],'available':_0x557b71['available'],'loggedIn':_0x557b71[_0x96c1('0x27')],'pTalking':_0x557b71['pTalking'],'sumBillable':_0x557b71[_0x96c1('0x28')],'sumDuration':_0x557b71['sumDuration'],'sumHoldTime':_0x557b71[_0x96c1('0x29')]||0x0,'talking':_0x557b71[_0x96c1('0x2a')],'total':_0x557b71['total'],'type':_0x557b71[_0x96c1('0x25')],'unmanaged':_0x557b71[_0x96c1('0x2b')],'abandoned':_0x557b71[_0x96c1('0x2c')],'waiting':_0x557b71['waiting'],'loggedInDb':_0x557b71[_0x96c1('0x2d')],'dialActive':_0x557b71[_0x96c1('0x2e')],'dialMethod':_0x557b71['dialMethod'],'dialOriginateCallerIdName':_0x557b71[_0x96c1('0x2f')],'dialOriginateCallerIdNumber':_0x557b71[_0x96c1('0x30')],'dialOriginateTimeout':_0x557b71[_0x96c1('0x31')],'dialPrefix':_0x557b71['dialPrefix'],'outboundAnswerAgiCallsDay':_0x557b71['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x557b71['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x557b71[_0x96c1('0x32')],'outboundBusyCallsDay':_0x557b71['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x557b71[_0x96c1('0x33')],'outboundDropCallsDayACS':_0x557b71[_0x96c1('0x34')],'outboundDropCallsDayCallersExit':_0x557b71['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x557b71[_0x96c1('0x35')],'outboundNoAnswerCallsDay':_0x557b71[_0x96c1('0x36')],'outboundNoSuchCallsDay':_0x557b71[_0x96c1('0x37')],'outboundOriginateFailureCallsDay':_0x557b71[_0x96c1('0x38')],'outboundReCallsDay':_0x557b71[_0x96c1('0x39')],'outboundRejectCallsDay':_0x557b71['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x557b71[_0x96c1('0x3a')],'predictiveIntervalAnsweredCalls':_0x557b71[_0x96c1('0x3b')],'predictiveIntervalAvgHoldtime':_0x557b71['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x557b71['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x557b71['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x557b71['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x557b71[_0x96c1('0x3c')],'predictiveIntervalErlangCallsDroppedCalls':_0x557b71[_0x96c1('0x3d')],'predictiveIntervalHitRate':_0x557b71[_0x96c1('0x3e')],'predictiveIntervalMultiplicativeFactor':_0x557b71[_0x96c1('0x3f')],'predictiveIntervalPauses':_0x557b71['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x557b71[_0x96c1('0x40')],'predictiveIntervalTotalCalls':_0x557b71[_0x96c1('0x41')],'message':_0x557b71[_0x96c1('0x42')],'originated':_0x557b71[_0x96c1('0x43')],'erlangCalls':_0x557b71[_0x96c1('0x44')],'erlangCallToSecond':_0x557b71[_0x96c1('0x45')],'erlangAbandonmentRate':_0x557b71[_0x96c1('0x46')],'erlangBusyFactor':_0x557b71[_0x96c1('0x47')],'startPredictive':_0x557b71[_0x96c1('0x48')],'startProgressive':_0x557b71[_0x96c1('0x49')]};if(_0x557b71[_0x96c1('0x4a')]){_0x53a329[_0x96c1('0x4a')]={'id':_0x557b71['Trunk']['id'],'name':_0x557b71[_0x96c1('0x4a')][_0x96c1('0x4b')],'active':_0x557b71[_0x96c1('0x4a')]['active'],'callerid':_0x557b71[_0x96c1('0x4a')][_0x96c1('0x4c')]};}if(_0x557b71[_0x96c1('0x4d')]){_0x53a329[_0x96c1('0x4d')]={'id':_0x557b71[_0x96c1('0x4d')]['id'],'name':_0x557b71[_0x96c1('0x4d')]['name']};}var _0x12443f=md5(JSON[_0x96c1('0x4e')](_0x53a329));if(_0x557b71['md5']!==_0x12443f){_0x557b71[_0x96c1('0x3')]=_0x12443f;emit(util[_0x96c1('0x4f')]('voice:queue:%s',_0x53a329[_0x96c1('0x4b')]),_0x96c1('0x50'),_0x53a329);}}}function emitVoiceQueueChannelRemove(_0x20800a){emit(util[_0x96c1('0x4f')](_0x96c1('0x51'),_0x20800a[_0x96c1('0x4b')]),_0x96c1('0x52'),_0x20800a);}function notSendMessagesQueue(_0x556fb8){if(_0x556fb8[_0x96c1('0x53')]){if(_0x556fb8[_0x96c1('0x43')]===0x0&&_0x556fb8[_0x96c1('0x54')]===0x0){_0x556fb8[_0x96c1('0x53')]=![];_0x556fb8['available']=0x0;_0x556fb8['paused']=0x0;_0x556fb8[_0x96c1('0x42')]=_0x96c1('0x55');ut[_0x96c1('0x56')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x556fb8[_0x96c1('0x4b')]+'\x20is\x20not\x20active');}else{_0x556fb8[_0x96c1('0x42')]='IS_DISACTIVED';ut['logger'](_0x96c1('0x57'),_0x556fb8['name']+_0x96c1('0x58'));}emitCampaignPreview(_0x556fb8);}}Preview['prototype'][_0x96c1('0x23')]=function(){var _0x20ee38=this;setInterval(function(){_0x20ee38[_0x96c1('0x59')]();},0x7cf);};Preview[_0x96c1('0x10')]['syncCampaigns']=function(){var _0x10a3f1=this['campaignsPreview'];this[_0x96c1('0x17')]+=0x1;for(var _0x5148b8 in _0x10a3f1){if(_0x10a3f1[_0x96c1('0x5a')](_0x5148b8)&&(_0x10a3f1[_0x5148b8]['dialMethod']===_0x96c1('0x6')||_0x10a3f1[_0x5148b8][_0x96c1('0x5b')]===_0x96c1('0x5c'))&&_0x10a3f1[_0x5148b8][_0x96c1('0x25')]===_0x96c1('0x5d')){if(this[_0x96c1('0x17')]>0x7){this[_0x96c1('0x17')]=0x0;this[_0x96c1('0x5e')]();}}if(_0x10a3f1['hasOwnProperty'](_0x5148b8)&&_0x10a3f1[_0x5148b8][_0x96c1('0x5b')]===_0x96c1('0x6')&&_0x10a3f1[_0x5148b8][_0x96c1('0x25')]==='outbound'){if(_0x10a3f1[_0x5148b8][_0x96c1('0x2e')]){this[_0x96c1('0x5f')](_0x10a3f1[_0x5148b8]);this['recallMe'](_0x10a3f1[_0x5148b8]);}else{notSendMessagesQueue(_0x10a3f1[_0x5148b8]);}}}};Preview[_0x96c1('0x10')][_0x96c1('0x60')]=function(_0x13d95b){var _0x49e987=this;this[_0x96c1('0x12')]['enqueue'](function(){if(!_[_0x96c1('0x61')](_0x49e987['actions'][_0x13d95b])){loggerAction[_0x96c1('0x62')](_0x96c1('0x63'),_0x13d95b,'Queue',_0x49e987['actions'][_0x13d95b][_0x96c1('0x64')],_0x96c1('0x65'),JSON[_0x96c1('0x4e')](_0x49e987[_0x96c1('0x13')][_0x49e987[_0x96c1('0x15')][_0x13d95b][_0x96c1('0x64')]][_0x96c1('0x43')]),'pTalking:\x20',JSON[_0x96c1('0x4e')](_0x49e987['campaignsPreview'][_0x49e987['actions'][_0x13d95b]['queue']]['pTalking']),JSON[_0x96c1('0x4e')](_0x49e987[_0x96c1('0x15')][_0x13d95b][_0x96c1('0x66')]),JSON[_0x96c1('0x4e')](_[_0x96c1('0x67')](_0x49e987[_0x96c1('0x15')][_0x13d95b],['contactId',_0x96c1('0x68'),_0x96c1('0x69'),_0x96c1('0x6a')])));return ami[_0x96c1('0x6b')]({'action':_0x96c1('0x6c'),'channel':_0x49e987[_0x96c1('0x15')][_0x13d95b][_0x96c1('0x6d')]})['catch'](function(_0x5d85b6){if(_0x5d85b6[_0x96c1('0x42')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x49e987[_0x96c1('0x15')][_0x13d95b]){ut[_0x96c1('0x6e')](_0x49e987[_0x96c1('0x13')][_0x49e987['actions'][_0x13d95b]['queue']],_0x96c1('0x6f'));if(_0x49e987[_0x96c1('0x15')][_0x13d95b]['dialAnswer']===!![]){ut['decrementTalkink'](_0x49e987[_0x96c1('0x13')][_0x49e987[_0x96c1('0x15')][_0x13d95b][_0x96c1('0x64')]],'[clearZombieChannel]');ut[_0x96c1('0x70')](_0x96c1('0x71')+_0x13d95b,_0x49e987['actions'][_0x13d95b][_0x96c1('0x64')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x13d95b,_0x49e987['actions'][_0x13d95b]['queue']);delete _0x49e987['actions'][_0x13d95b];}},0x2328);}});}});};Preview[_0x96c1('0x10')][_0x96c1('0x5e')]=function(){var _0x42e705=this;loggerAction[_0x96c1('0x62')]('[action]',_[_0x96c1('0x72')](this[_0x96c1('0x15')]));for(var _0xf50f18 in this[_0x96c1('0x15')]){if(_0x42e705[_0x96c1('0x15')][_0x96c1('0x5a')](_0xf50f18)){_0x42e705[_0x96c1('0x60')](_0xf50f18);}}};Preview[_0x96c1('0x10')][_0x96c1('0x73')]=function(_0x2a461f){var _0x26722b=this;rpcDb['getContactRecallMe'](_0x2a461f['id'],ut['agentReadyId'](this['agents']))['then'](function(_0x5ce3b0){if(!_[_0x96c1('0x61')](_0x5ce3b0)){for(var _0x9b581=0x0;_0x9b581<_0x5ce3b0[_0x96c1('0x74')];_0x9b581+=0x1){if(ut['getDiff'](_0x5ce3b0[_0x9b581][_0x96c1('0x75')])<_0x2a461f[_0x96c1('0x76')]*0x3c){_0x26722b['run'](_0x5ce3b0[_0x9b581]['id'])['then'](ut['logger2'](_0x96c1('0x77')))[_0x96c1('0x78')](ut[_0x96c1('0x79')](_0x96c1('0x77')));}else{var _0x1f2091=new Action(_0x5ce3b0[_0x9b581],_0x2a461f);_0x1f2091[_0x96c1('0x7a')]=moment()[_0x96c1('0x4f')](_0x96c1('0x7b'));_0x2a461f[_0x96c1('0x39')]+=0x1;ut[_0x96c1('0x7c')](_0x1f2091,0x17,'RecallInQueue');if(_0x2a461f['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0x96c1('0x7d')](_0x5ce3b0[_0x9b581]));rpcDb['createCustomerHistory'](_0x1f2091,_0x96c1('0x7e'));}else{ut['logCustomer'](_0x1f2091,0x16,_0x96c1('0x7f'));rpcDb[_0x96c1('0x80')](_0x1f2091,_0x96c1('0x81'));rpcDb[_0x96c1('0x82')](_0x1f2091,_0x96c1('0x81'));}}}}})['catch'](ut[_0x96c1('0x79')]('[getContactRecallMe]'));};Preview[_0x96c1('0x10')][_0x96c1('0x5f')]=function(_0x29f02d){_0x29f02d['sendMessageOneNotActive']=!![];if(ut[_0x96c1('0x83')](_0x29f02d[_0x96c1('0x27')])){_0x29f02d['message']=_0x96c1('0x84');}else if(!ut[_0x96c1('0x85')](_0x29f02d['dialActive'])){_0x29f02d[_0x96c1('0x42')]=_0x96c1('0x55');}else if(!this[_0x96c1('0x86')](_0x29f02d[_0x96c1('0x4a')])){if(!this[_0x96c1('0x86')](_0x29f02d[_0x96c1('0x87')])){_0x29f02d[_0x96c1('0x42')]=_0x96c1('0x88');}else{_0x29f02d[_0x96c1('0x42')]=_0x96c1('0x89');}}else{_0x29f02d['message']=_0x96c1('0x89');}emitCampaignPreview(_0x29f02d);};Preview['prototype'][_0x96c1('0x8a')]=function(_0x4c7a75,_0x505a98,_0x252bfd){var _0x152940=this;var _0x4b4376=this[_0x96c1('0x15')][_0x505a98];var _0xd30f50=this[_0x96c1('0x13')][_0x4b4376[_0x96c1('0x64')]];var _0x139665;if(_0xd30f50){switch(_0x252bfd){case'1':_0xd30f50[_0x96c1('0x37')]+=0x1;_0x4b4376['countglobal']=ut[_0x96c1('0x8b')](_0x4b4376);ut[_0x96c1('0x7c')](_0x4b4376,0x0,_0x96c1('0x8c'));rpcDb['createCustomerHistory'](_0x4b4376,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x4b4376)>=_0xd30f50[_0x96c1('0x8d')]){_0x139665=ut[_0x96c1('0x8e')](_0x4b4376,0xf,_0x96c1('0x8f'));rpcDb[_0x96c1('0x82')](_0x139665,_0x96c1('0x90'));}else{rpcDb[_0x96c1('0x82')](_0x4b4376,_0x96c1('0x90'));}delete this[_0x96c1('0x15')][_0x4c7a75['linkedid']];break;case _0x96c1('0x91'):var _0x197d3a=moment()[_0x96c1('0x4f')](_0x96c1('0x7b'));_0x4b4376['responsetime']=_0x197d3a;_0x4b4376[_0x96c1('0x92')]=_0x197d3a;_0x4b4376[_0x96c1('0x66')]=!![];_0xd30f50[_0x96c1('0x54')]+=0x1;logger[_0x96c1('0x62')](_0x96c1('0x93'),_0x4b4376['uniqueid'],_0x96c1('0x94'),_0xd30f50[_0x96c1('0x4b')],_0x96c1('0x95'),_0xd30f50[_0x96c1('0x54')]);ami['emit'](_0x96c1('0x96'),ut[_0x96c1('0x97')](_0x4b4376,_0x96c1('0x98')));if(_0xd30f50[_0x96c1('0x99')]){ami[_0x96c1('0x24')](_0x96c1('0x9a'),ut[_0x96c1('0x9b')](_0x4b4376));}break;case'16':ami[_0x96c1('0x24')](_0x96c1('0x9c'),ut[_0x96c1('0x97')](_0x4b4376,_0x96c1('0x9d')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x4b4376,_0x96c1('0x9d')));_0xd30f50['outboundAnswerCallsDay']+=0x1;_0xd30f50[_0x96c1('0x9e')]+=0x1;_0xd30f50[_0x96c1('0x9f')]+=0x1;ut[_0x96c1('0xa0')](_0xd30f50,'[16]');_0x4b4376[_0x96c1('0xa1')]=ut[_0x96c1('0x8b')](_0x4b4376);ut['logCustomer'](_0x4b4376,0x4,_0x96c1('0xa2'));rpcDb[_0x96c1('0x80')](_0x4b4376,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x96c1('0x82')](_0x4b4376,_0x96c1('0xa3'));rpcDb[_0x96c1('0xa4')](_0x4b4376);_0xd30f50[_0x96c1('0xa5')]+=_0x4b4376[_0x96c1('0xa6')];_0xd30f50['sumBillable']+=_0x4b4376[_0x96c1('0xa6')];logger[_0x96c1('0x62')](_0x96c1('0xa7'),_0x4b4376[_0x96c1('0xa8')],_0x96c1('0x94'),_0xd30f50[_0x96c1('0x4b')],_0x96c1('0x95'),_0xd30f50[_0x96c1('0x54')]);delete this[_0x96c1('0x15')][_0x4c7a75['linkedid']];break;case _0x96c1('0xa9'):_0xd30f50[_0x96c1('0xaa')]+=0x1;_0x4b4376[_0x96c1('0xab')]+=0x1;_0x4b4376[_0x96c1('0xa1')]=ut[_0x96c1('0x8b')](_0x4b4376);ut['logCustomer'](_0x4b4376,0x5,_0x96c1('0xac'));rpcDb[_0x96c1('0x80')](_0x4b4376,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x96c1('0x8b')](_0x4b4376)>=_0xd30f50[_0x96c1('0x8d')]){_0x139665=ut[_0x96c1('0x8e')](_0x4b4376,0xf,_0x96c1('0x8f'));rpcDb[_0x96c1('0x82')](_0x139665,_0x96c1('0xad'));}else{if(_0x4b4376['countbusyretry']>=_0xd30f50[_0x96c1('0xae')]){rpcDb[_0x96c1('0x82')](_0x4b4376,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x4b4376,_0x96c1('0xab'),_0xd30f50['dialBusyRetryFrequency']),_0x4b4376[_0x96c1('0xaf')],_0x4b4376[_0x96c1('0xb0')]);}}break;case _0x96c1('0xb1'):_0xd30f50['outboundNoAnswerCallsDay']+=0x1;_0x4b4376[_0x96c1('0xb2')]+=0x1;_0x4b4376[_0x96c1('0xa1')]=ut['totalGlobal'](_0x4b4376);ut[_0x96c1('0x7c')](_0x4b4376,0x3,_0x96c1('0xb3'));rpcDb['createCustomerHistory'](_0x4b4376,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x96c1('0x8b')](_0x4b4376)>=_0xd30f50[_0x96c1('0x8d')]){_0x139665=ut[_0x96c1('0x8e')](_0x4b4376,0xf,'Global');rpcDb[_0x96c1('0x82')](_0x139665,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x4b4376['countnoanswerretry']>=_0xd30f50[_0x96c1('0xb4')]){rpcDb[_0x96c1('0x82')](_0x4b4376,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x96c1('0xb5')](ut[_0x96c1('0xb6')](_0x4b4376,'countnoanswerretry',_0xd30f50[_0x96c1('0xb7')]),_0x4b4376[_0x96c1('0xaf')],_0x4b4376[_0x96c1('0xb0')]);}}break;case'CONGESTION':_0xd30f50[_0x96c1('0x33')]+=0x1;_0x4b4376[_0x96c1('0xb8')]+=0x1;_0x4b4376[_0x96c1('0xa1')]=ut[_0x96c1('0x8b')](_0x4b4376);ut[_0x96c1('0x7c')](_0x4b4376,0x8,'Congestion');rpcDb['createCustomerHistory'](_0x4b4376,_0x96c1('0xb9'));if(ut[_0x96c1('0x8b')](_0x4b4376)>=_0xd30f50['dialGlobalMaxRetry']){_0x139665=ut['cloneAction'](_0x4b4376,0xf,_0x96c1('0x8f'));rpcDb[_0x96c1('0x82')](_0x139665,_0x96c1('0xba'));}else{if(_0x4b4376['countcongestionretry']>=_0xd30f50[_0x96c1('0xbb')]){rpcDb['createCustomerFinal'](_0x4b4376,_0x96c1('0xb9'));}else{rpcDb[_0x96c1('0xb5')](ut[_0x96c1('0xb6')](_0x4b4376,_0x96c1('0xb8'),_0xd30f50[_0x96c1('0xbc')]),_0x4b4376[_0x96c1('0xaf')],_0x4b4376[_0x96c1('0xb0')]);}}break;case _0x96c1('0xbd'):_0xd30f50[_0x96c1('0xbe')]+=0x1;_0x4b4376[_0x96c1('0xa1')]=ut[_0x96c1('0x8b')](_0x4b4376);ut[_0x96c1('0x7c')](_0x4b4376,0x14,'AgentReject');rpcDb['createCustomerHistory'](_0x4b4376,_0x96c1('0xbf'));if(_0x4b4376['unlockAgent']){rpcDb[_0x96c1('0xc0')](_0x4b4376[_0x96c1('0xc1')]);}if(_0x4b4376[_0x96c1('0xb0')]){rpcDb[_0x96c1('0xc2')](_0x4b4376['idContact']);}break;default:if(_0x4b4376[_0x96c1('0x66')]){ut[_0x96c1('0xa0')](_0xd30f50,_0x96c1('0xc3'));ut[_0x96c1('0x70')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0xd30f50[_0x96c1('0x4b')],_0x4c7a75);}_0xd30f50['outboundUnknownCallsDay']+=0x1;_0x4b4376[_0x96c1('0xa1')]=ut[_0x96c1('0x8b')](_0x4b4376);ut[_0x96c1('0x7c')](_0x4b4376,0xc,_0x4c7a75[_0x96c1('0xc4')]||_0x4c7a75[_0x96c1('0xc5')]);rpcDb['createCustomerHistory'](_0x4b4376,_0x96c1('0xc6'));if(ut[_0x96c1('0x8b')](_0x4b4376)>=_0xd30f50['dialGlobalMaxRetry']){_0x139665=ut['cloneAction'](_0x4b4376,0xf,_0x96c1('0x8f'));rpcDb['createCustomerFinal'](_0x139665,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x4b4376,_0x96c1('0xc7'));}delete this[_0x96c1('0x15')][_0x4c7a75[_0x96c1('0xc8')]];}if(!(_0x4b4376['dialAnswer']&&_0x252bfd==='16')){ut[_0x96c1('0x6e')](_0xd30f50,_0x96c1('0xc9'));logger['info'](_0x96c1('0xca'),_0x4b4376[_0x96c1('0xa8')],_0x96c1('0x94'),_0xd30f50[_0x96c1('0x4b')],_0x96c1('0x65'),_0xd30f50[_0x96c1('0x43')]);}if(_0x252bfd!==_0x96c1('0x91')){delete this[_0x96c1('0x15')][_0x4c7a75['linkedid']];delete this[_0x96c1('0x15')][_0x4c7a75[_0x96c1('0xcb')]];}}};Preview[_0x96c1('0x10')][_0x96c1('0xcc')]=function(_0x1e5a71,_0x3d0c2b,_0x2654c7){if(_[_0x96c1('0xcd')](_0x3d0c2b)&&_0x96c1('0xce')!==typeof _0x3d0c2b){return;}if(_[_0x96c1('0xcd')](_0x2654c7)&&_0x96c1('0xce')!==typeof _0x2654c7){return;}switch(_0x2654c7[_0x96c1('0xcf')]){case'0':ut[_0x96c1('0xd0')](_0x1e5a71,0x0,_0x96c1('0x8c'));rpcDb[_0x96c1('0xd1')](_0x1e5a71,_0x96c1('0xd2'));break;case'3':ut[_0x96c1('0xd0')](_0x1e5a71,0x3,_0x96c1('0xb3'));rpcDb['createAgentHistory'](_0x1e5a71,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x96c1('0xd0')](_0x1e5a71,0x5,'Busy');rpcDb[_0x96c1('0xd1')](_0x1e5a71,_0x96c1('0xd3'));break;case'8':ut[_0x96c1('0xd0')](_0x1e5a71,0x8,'Congestion');rpcDb[_0x96c1('0xd1')](_0x1e5a71,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x96c1('0xd0')](_0x1e5a71,0x16,_0x96c1('0xd4'));rpcDb['createAgentHistory'](_0x1e5a71,_0x96c1('0xd5'));break;default:ut[_0x96c1('0xd0')](_0x1e5a71,0xc,_0x2654c7[_0x96c1('0xcf')]);rpcDb[_0x96c1('0xd1')](_0x1e5a71,_0x96c1('0xd6'));}ut[_0x96c1('0x6e')](_0x3d0c2b,'[callProgressDetectingAgent]');logger[_0x96c1('0x62')](_0x96c1('0xd7'),_0x1e5a71[_0x96c1('0xa8')],_0x96c1('0x94'),_0x3d0c2b[_0x96c1('0x4b')],_0x96c1('0x65'),_0x3d0c2b[_0x96c1('0x43')]);delete this[_0x96c1('0x15')][_0x1e5a71[_0x96c1('0xa8')]];};Preview[_0x96c1('0x10')]['checkInBlack']=function(_0x54f7d7,_0x45fb73,_0x4c478a,_0x536990,_0xdf2bd1){var _0x43ed3b=this;return new BPromise(function(_0x3087eb,_0x2dc05b){if(_[_0x96c1('0x61')](_0x45fb73)||_[_0x96c1('0x61')](_0x45fb73[_0x96c1('0xd8')])||_[_0x96c1('0x61')](_0x45fb73[_0x96c1('0xd8')][_0x96c1('0xd9')])||_[_0x96c1('0x61')](_0x45fb73[_0x96c1('0x69')])){_0x2dc05b(ut['message'](_0x96c1('0xda'),_0x536990,_0xdf2bd1));return;}var _0x2cacb6=uuid['v4']();var _0x5c5ea4=_0x43ed3b[_0x96c1('0x13')][_0x45fb73[_0x96c1('0xdb')][_0x96c1('0x4b')]];var _0xa8996=_0x4c478a?_0x43ed3b['agents'][_0x4c478a]['id']:undefined;_0x43ed3b[_0x96c1('0x15')][_0x2cacb6]=new Action(_0x45fb73,_0x5c5ea4,_0x2cacb6,_0x4c478a,_0xa8996);var _0x5a687d=_0x43ed3b[_0x96c1('0x15')][_0x2cacb6];_0x5a687d[_0x96c1('0xaf')]=_0x536990;_0x5a687d[_0x96c1('0xb0')]=_0xdf2bd1;_0x5a687d['lookAgent']=_0x4c478a;if(_[_0x96c1('0xdc')](_0x54f7d7)){_0x43ed3b[_0x96c1('0xdd')](_0x5a687d,_0x5c5ea4,_0x45fb73,_0x4c478a)[_0x96c1('0xde')](function(_0x29f699){logger[_0x96c1('0x62')](_0x96c1('0xdf'),_0x96c1('0xe0')+_0x5a687d['queue']+'\x20IdHopper:\x20'+_0x5a687d[_0x96c1('0xc1')],JSON['stringify'](_0x29f699));ami[_0x96c1('0x24')]('custom:agentcalled',ut[_0x96c1('0x97')](_0x5a687d,_0x96c1('0xe1')));_0x3087eb(ut[_0x96c1('0x42')](_0x96c1('0xe2')));})[_0x96c1('0x78')](function(_0x1f60d3){ut['logger'](_0x96c1('0xe3'),_0x1f60d3);_0x2dc05b(ut[_0x96c1('0x42')](_0x96c1('0xe4'),_0x536990,_0xdf2bd1));});}else{_0x5c5ea4[_0x96c1('0x32')]+=0x1;ut[_0x96c1('0xe5')](_0x5a687d);rpcDb[_0x96c1('0xe6')](_0x5a687d,_0x96c1('0xe7'));delete _0x43ed3b[_0x96c1('0x15')][_0x2cacb6];_0x2dc05b(ut[_0x96c1('0x42')](_0x96c1('0xe8'),_0x536990,_0xdf2bd1));}});};Preview['prototype'][_0x96c1('0x86')]=function(_0x580570){return!_[_0x96c1('0x61')](_0x580570)&&!_[_0x96c1('0x61')](_0x580570['name'])&&!_['isNil'](_0x580570[_0x96c1('0xe9')])&&_0x580570[_0x96c1('0xe9')]&&!_['isNil'](this[_0x96c1('0x14')][util['format'](_0x96c1('0xea'),_0x580570[_0x96c1('0x4b')])])&&!_[_0x96c1('0x61')](this[_0x96c1('0x14')][util[_0x96c1('0x4f')](_0x96c1('0xea'),_0x580570[_0x96c1('0x4b')])][_0x96c1('0x6c')])&&(this[_0x96c1('0x14')][util[_0x96c1('0x4f')](_0x96c1('0xea'),_0x580570[_0x96c1('0x4b')])][_0x96c1('0x6c')]===_0x96c1('0xeb')||this['trunks'][util['format'](_0x96c1('0xea'),_0x580570['name'])][_0x96c1('0x6c')]===_0x96c1('0xec'));};Preview[_0x96c1('0x10')]['run']=function(_0x508420,_0x445a51){var _0x10dfe0=this;return new BPromise(function(_0x46fe42,_0x3c07eb){_0x10dfe0[_0x96c1('0xed')](_0x508420,_0x445a51)[_0x96c1('0xde')](function(_0x3d1436){_0x46fe42(_[_0x96c1('0x67')](_0x3d1436,['message']));})[_0x96c1('0x78')](function(_0x207bc0){if(_0x207bc0['unlock']){rpcDb[_0x96c1('0xc0')](_0x508420);}if(_0x207bc0['active']){rpcDb['disableContact'](_0x508420);}_0x3c07eb(_[_0x96c1('0x67')](_0x207bc0,[_0x96c1('0x42')]));});});};Preview['prototype'][_0x96c1('0xed')]=function(_0x121594,_0x34eb60){var _0x32c90c=this;return new BPromise(function(_0x1f241c,_0x1d60d1){var _0x17e7b7,_0x5ef828;rpcDb[_0x96c1('0xee')](_0x121594)[_0x96c1('0xde')](function(_0x4f23b5){if(!_[_0x96c1('0x61')](_0x4f23b5[0x0])){_0x5ef828=_0x4f23b5[0x0][_0x96c1('0xef')]?![]:!![];_0x17e7b7=_0x4f23b5[0x0][_0x96c1('0xef')]?!![]:![];_0x17e7b7=_0x34eb60?!![]:_0x17e7b7;}var _0x488947=_0x32c90c[_0x96c1('0xf0')](_0x4f23b5);if(_0x488947[_0x96c1('0xf1')]){rpcDb[_0x96c1('0xf2')](_[_0x96c1('0x67')](_0x4f23b5[0x0],[_0x96c1('0x69'),_0x96c1('0xf3')]))[_0x96c1('0xde')](function(_0x3c75a3){_0x32c90c[_0x96c1('0xf4')](_0x3c75a3,_0x4f23b5[0x0],_0x34eb60,_0x5ef828,_0x17e7b7)[_0x96c1('0xde')](function(_0x594e44){_0x1f241c(_0x594e44);})[_0x96c1('0x78')](function(_0x14e388){_0x1d60d1(_0x14e388);});})['catch'](function(_0x1b9303){ut['logger'](_0x96c1('0xf5'),_0x1b9303);_0x1d60d1(ut[_0x96c1('0x42')](_0x96c1('0xf6'),_0x5ef828,_0x17e7b7));});}else{_0x1d60d1(ut['message'](_0x488947[_0x96c1('0x42')],_0x5ef828,_0x17e7b7));}})[_0x96c1('0x78')](function(_0x22163e){ut[_0x96c1('0x56')](_0x96c1('0xf7'),_0x22163e);_0x1d60d1(ut[_0x96c1('0x42')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x96c1('0x10')][_0x96c1('0xf0')]=function(_0x15ab9c){if(_[_0x96c1('0x61')](_0x15ab9c)||_[_0x96c1('0xdc')](_0x15ab9c)||!_['isNil'](_0x15ab9c[0x0]['Agent'])&&_[_0x96c1('0x61')](_0x15ab9c[0x0]['Agent'][_0x96c1('0x4b')])){ut['logger'](_0x96c1('0xf8'),_0x15ab9c);return{'isValid':![],'message':_0x96c1('0xf9')};}var _0x16e8a8=this[_0x96c1('0x13')][_0x15ab9c[0x0][_0x96c1('0xdb')]['name']];_0x16e8a8['message']=_0x96c1('0x89');if(_['isNil'](_0x16e8a8)){ut['logger'](_0x96c1('0xfa'),_0x16e8a8);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x96c1('0x86')](_0x16e8a8[_0x96c1('0x4a')])){ut[_0x96c1('0x56')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x96c1('0xfb')+_0x16e8a8[_0x96c1('0x4b')]+_0x96c1('0xfc'));if(!this['isTrunkReachable'](_0x16e8a8[_0x96c1('0x87')])){ut['logger'](_0x96c1('0xfd'),_0x16e8a8['name']+_0x96c1('0xfe'));return{'isValid':![],'message':_0x96c1('0xff')};}}if(!ut[_0x96c1('0x85')](_0x16e8a8[_0x96c1('0x2e')])){ut['logger'](_0x96c1('0x100'),_0x16e8a8[_0x96c1('0x4b')]+_0x96c1('0x101'));return{'isValid':![],'message':_0x96c1('0xfb')+_0x16e8a8[_0x96c1('0x4b')]+_0x96c1('0x101')};}return{'isValid':!![],'message':_0x96c1('0x102')};};Preview[_0x96c1('0x10')][_0x96c1('0xdd')]=function(_0x1f93c6,_0x39f340,_0x593ed3,_0x15af09){var _0x2acab5=this;return new BPromise(function(_0x2c3f6b,_0x5dc1aa){var _0x18df83=_0x1f93c6['uniqueid'];var _0x19a361=_0x2acab5['isTrunkReachable'](_0x39f340[_0x96c1('0x4a')])?util['format'](_0x96c1('0x103'),_0x39f340[_0x96c1('0x4a')]['name'],_[_0x96c1('0x61')](_0x39f340[_0x96c1('0x104')])?'':_0x39f340[_0x96c1('0x104')]['trim']()||'',_0x39f340['dialCutDigit']>0x0?_0x593ed3[_0x96c1('0xd8')]['phone'][_0x96c1('0x105')](_0x39f340['dialCutDigit']):_0x593ed3[_0x96c1('0xd8')][_0x96c1('0xd9')]):util[_0x96c1('0x4f')](_0x96c1('0x103'),_[_0x96c1('0x61')](_0x39f340[_0x96c1('0x87')])?_0x39f340[_0x96c1('0x4a')][_0x96c1('0x4b')]:_0x39f340[_0x96c1('0x87')]['name'],_[_0x96c1('0x61')](_0x39f340['dialPrefix'])?'':_0x39f340[_0x96c1('0x104')]['trim']()||'',_0x39f340[_0x96c1('0x106')]>0x0?_0x593ed3['Contact']['phone'][_0x96c1('0x105')](_0x39f340[_0x96c1('0x106')]):_0x593ed3[_0x96c1('0xd8')][_0x96c1('0xd9')]);var _0x5b0343=_0x2acab5['isTrunkReachable'](_0x39f340['Trunk'])?ut[_0x96c1('0x107')](_0x39f340[_0x96c1('0x4a')][_0x96c1('0x4c')],_0x39f340['dialOriginateCallerIdName'],_0x39f340['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x39f340['dialOriginateCallerIdNumber'],_0x39f340['dialRandomLastDigitCallerIdNumber']):_0x39f340[_0x96c1('0x30')]):ut[_0x96c1('0x107')](_[_0x96c1('0x61')](_0x39f340[_0x96c1('0x87')])?_0x39f340['Trunk']['callerid']:_0x39f340[_0x96c1('0x87')][_0x96c1('0x4c')],_0x39f340['dialOriginateCallerIdName'],_0x39f340[_0x96c1('0x108')]>0x0?ut[_0x96c1('0x109')](_0x39f340[_0x96c1('0x30')],_0x39f340['dialRandomLastDigitCallerIdNumber']):_0x39f340['dialOriginateCallerIdNumber']);if(_0x5b0343){_0x1f93c6['originatecalleridname']=ut[_0x96c1('0x10a')](_0x5b0343);_0x1f93c6['originatecalleridnum']=ut[_0x96c1('0x10b')](_0x5b0343);}var _0x12e892=ut[_0x96c1('0x10c')](_0x39f340,_0x593ed3,_0x19a361,_0x5b0343,_0x18df83,_0x1f93c6);_[_0x96c1('0x10d')](_0x1f93c6,ut[_0x96c1('0x10e')](_0x12e892));_0x1f93c6[_0x96c1('0x7a')]=moment()[_0x96c1('0x4f')](_0x96c1('0x7b'));ami[_0x96c1('0x6b')](ut['variablesAction'](_0x1f93c6,_0x39f340,_0x12e892,_0x1f93c6['activeContact'],_0x15af09))[_0x96c1('0xde')](function(_0x5e65e5){_0x39f340[_0x96c1('0x43')]+=0x1;logger[_0x96c1('0x62')](_0x96c1('0x10f'),_0x18df83,'\x20Queue',_0x39f340[_0x96c1('0x4b')],_0x96c1('0x65'),_0x39f340[_0x96c1('0x43')]);_0x2c3f6b(_0x5e65e5);})['catch'](function(_0x22b5d1){ut[_0x96c1('0xd0')](_0x1f93c6,0xe,_0x96c1('0x110'));rpcDb[_0x96c1('0xd1')](_0x1f93c6,_0x96c1('0x111'));_0x5dc1aa(_0x22b5d1);});});};Preview[_0x96c1('0x10')][_0x96c1('0x20')]=function(_0x3d216a){if(this[_0x96c1('0x15')][_0x3d216a[_0x96c1('0xc8')]]){this[_0x96c1('0x15')][_0x3d216a[_0x96c1('0xc8')]]['channel']=_0x3d216a[_0x96c1('0x6d')];}};Preview[_0x96c1('0x10')][_0x96c1('0x19')]=function(_0x3b43d0){var _0x4a3f49=this;var _0x4298dd=this['actions'][_0x3b43d0[_0x96c1('0x112')]];if(_0x4298dd){if(_0x4298dd[_0x96c1('0x113')]&&this['agents'][_0x4298dd[_0x96c1('0x113')]]){ut['logLookAgent'](_0x4298dd,this[_0x96c1('0x16')][_0x4298dd[_0x96c1('0x113')]]['name'],this[_0x96c1('0x16')][_0x4298dd[_0x96c1('0x113')]]['id']);}var _0x4a154b=_['clone'](_0x4298dd);_0x4a154b[_0x96c1('0x114')]=moment()[_0x96c1('0x4f')](_0x96c1('0x7b'));var _0x433be2=_0x4a3f49[_0x96c1('0x13')][_0x4298dd[_0x96c1('0x64')]];if(ut[_0x96c1('0x115')](_0x3b43d0[_0x96c1('0x116')])){if(_0x4298dd[_0x96c1('0xaf')]){rpcDb['unlockContact'](_0x4298dd[_0x96c1('0xc1')]);}if(_0x4298dd[_0x96c1('0xb0')]){rpcDb[_0x96c1('0xc2')](_0x4298dd[_0x96c1('0xc1')]);}ami[_0x96c1('0x24')](_0x96c1('0x117'),ut[_0x96c1('0x97')](_0x4298dd,_0x96c1('0x118')));this['callProgressDetectingAgent'](_0x4a154b,_0x433be2,_0x3b43d0);}else{_0x4298dd[_0x96c1('0x7a')]=moment()[_0x96c1('0x4f')](_0x96c1('0x7b'));ut['logAgent'](_0x4a154b,0x4,_0x96c1('0xa2'));rpcDb[_0x96c1('0xd1')](_0x4a154b,_0x96c1('0x119'));}}};Preview[_0x96c1('0x10')][_0x96c1('0x11a')]=function(_0x266836){var _0x1bb8a2=this;var _0x1bb686=this['actions'][_0x266836[_0x96c1('0xc8')]];var _0x32b295;if(_0x1bb686){_0x32b295=this['campaignsPreview'][_0x1bb686[_0x96c1('0x64')]];logger[_0x96c1('0x62')]('[syncHangup][talking]',_0x266836[_0x96c1('0xc8')],_0x96c1('0x94'),_0x32b295['name'],_0x96c1('0x95'),_0x32b295[_0x96c1('0x54')]);}if(this[_0x96c1('0x15')][_0x266836['linkedid']]&&_0x266836[_0x96c1('0xc8')]!==_0x266836[_0x96c1('0xa8')]){if(_0x266836['cause']==='16'&&this[_0x96c1('0x15')][_0x266836[_0x96c1('0xc8')]][_0x96c1('0x66')]){this['callProgressDetectingCustomer'](_0x266836,_0x266836[_0x96c1('0xc8')],_0x266836['cause']);}else if(this[_0x96c1('0x15')][_0x266836[_0x96c1('0xc8')]]['dialAnswer']){logger[_0x96c1('0x62')]('[syncHangup][talking][cause]',_0x266836[_0x96c1('0xc8')],_0x266836['cause'],'\x20Queue',_0x32b295['name'],_0x96c1('0x95'),_0x32b295[_0x96c1('0x54')]);this[_0x96c1('0x8a')](_0x266836,_0x266836[_0x96c1('0xc8')],_0x266836[_0x96c1('0x11b')]);}}else if(_0x1bb686&&_['isNil'](_0x1bb686['statedesc'])&&_0x32b295[_0x96c1('0x11c')]&&_0x266836[_0x96c1('0xc8')]===_0x266836['uniqueid']&&_[_0x96c1('0x61')](_0x266836[_0x96c1('0xcf')])&&_0x266836[_0x96c1('0x11b')]==='16'&&_0x266836[_0x96c1('0x11d')]==='6'&&_[_0x96c1('0xcd')](_0x1bb686['transfer'])){if(_0x1bb686[_0x96c1('0xaf')]){rpcDb[_0x96c1('0xc0')](_0x1bb686['idContact']);}if(_0x1bb686['activeContact']){rpcDb[_0x96c1('0xc2')](_0x1bb686[_0x96c1('0xc1')]);}_0x266836[_0x96c1('0xcf')]='22';this[_0x96c1('0xcc')](_0x1bb686,_0x32b295,_0x266836);}else if(_0x1bb686&&_0x1bb686[_0x96c1('0x11e')]){if(_0x266836[_0x96c1('0x11b')]==='16'&&this[_0x96c1('0x15')][_0x266836[_0x96c1('0xc8')]]['dialAnswer']){logger['info'](_0x96c1('0x11f'),_0x266836[_0x96c1('0xc8')],_0x266836['cause'],'\x20Queue',_0x32b295[_0x96c1('0x4b')],_0x96c1('0x95'),_0x32b295[_0x96c1('0x54')]);this[_0x96c1('0x8a')](_0x266836,_0x266836[_0x96c1('0xc8')],_0x266836['cause']);}else if(this[_0x96c1('0x15')][_0x266836[_0x96c1('0xc8')]]['dialAnswer']){logger[_0x96c1('0x62')]('[syncHangup][talking][cause]',_0x266836[_0x96c1('0xc8')],_0x266836[_0x96c1('0x11b')],_0x96c1('0x94'),_0x32b295[_0x96c1('0x4b')],_0x96c1('0x95'),_0x32b295[_0x96c1('0x54')]);this['callProgressDetectingCustomer'](_0x266836,_0x266836['linkedid'],_0x266836[_0x96c1('0x11b')]);}}};Preview[_0x96c1('0x10')][_0x96c1('0x120')]=function(_0x2e397e){if(this['actions'][_0x2e397e[_0x96c1('0xcb')]]&&_0x2e397e[_0x96c1('0xcb')]!==_0x2e397e['destuniqueid']){this[_0x96c1('0x8a')](_0x2e397e,_0x2e397e[_0x96c1('0xcb')],_0x2e397e['dialstatus']);}};Preview[_0x96c1('0x10')]['syncHangupRequest']=function(_0x20cd81){if(this[_0x96c1('0x15')][_0x20cd81['linkedid']]&&_0x20cd81[_0x96c1('0xc8')]!==_0x20cd81[_0x96c1('0xa8')]&&!this[_0x96c1('0x15')][_0x20cd81[_0x96c1('0xc8')]][_0x96c1('0x66')]){if(_0x20cd81[_0x96c1('0x11b')]==='1'){this[_0x96c1('0x8a')](_0x20cd81,_0x20cd81[_0x96c1('0xc8')],_0x20cd81[_0x96c1('0x11b')]);}}};Preview['prototype'][_0x96c1('0x121')]=function(_0x37d7d7,_0x1f692b,_0xabf88a){if(this[_0x96c1('0x15')][_0x37d7d7]){if(_['isNil'](this['actions'][_0x37d7d7][_0x96c1('0x122')])){this[_0x96c1('0x15')][_0x37d7d7]['variables']={};}this[_0x96c1('0x15')][_0x37d7d7][_0x96c1('0x122')][_0x1f692b]=_0xabf88a;}};Preview[_0x96c1('0x10')][_0x96c1('0x123')]=function(_0x12126f){try{if(!_[_0x96c1('0x61')](_0x12126f)){if(ut[_0x96c1('0x124')](_[_0x96c1('0x125')](_0x12126f[_0x96c1('0x126')])[0x0])){this[_0x96c1('0x121')](_0x12126f[_0x96c1('0xa8')],_[_0x96c1('0x125')](_0x12126f[_0x96c1('0x126')])[0x0],_0x12126f['value']);}}}catch(_0xffc449){logger[_0x96c1('0x127')](_0x96c1('0x128'),util[_0x96c1('0x129')](_0xffc449,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x96c1('0x12a')]=function(_0x18294e){if(_0x18294e){if(this[_0x96c1('0x15')][_0x18294e['transfertargetlinkedid']]){this[_0x96c1('0x15')][_0x18294e[_0x96c1('0x12b')]][_0x96c1('0x11e')]=!![];}}};Preview[_0x96c1('0x10')]['syncBlindTransfer']=function(_0xb41a0){if(_0xb41a0){if(this[_0x96c1('0x15')][_0xb41a0[_0x96c1('0x12c')]]){this['actions'][_0xb41a0[_0x96c1('0x12c')]]['transfer']=!![];}}};module[_0x96c1('0x12d')]=Preview;
\ No newline at end of file
diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js
index da5b44c..27332ef 100644
--- a/server/services/ami/preview/rpcDb.js
+++ b/server/services/ami/preview/rpcDb.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6dd5=['rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','[voiceQueueReport]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6dd5,0x15c));var _0x56dd=function(_0x46cad2,_0x2835ad){_0x46cad2=_0x46cad2-0x0;var _0x4ae5f5=_0x6dd5[_0x46cad2];return _0x4ae5f5;};'use strict';var util=require(_0x56dd('0x0'));var BPromise=require(_0x56dd('0x1'));var logger=require(_0x56dd('0x2'))(_0x56dd('0x3'));var _=require(_0x56dd('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x56dd('0x5'));var voiceQueueRt=require(_0x56dd('0x6'));var agentReportPreview=require(_0x56dd('0x7'));var voiceQueueReport=require(_0x56dd('0x8'));function loggerCatch(_0x4c34bc){return function(_0x5793c1){logger[_0x56dd('0x9')](_0x4c34bc,util['inspect'](_0x5793c1,{'showHidden':![],'depth':null}));};}function create(_0x3b81af){return BPromise[_0x56dd('0xa')]()[_0x56dd('0xb')](cmHopperHistory['createHistory'](_0x3b81af))[_0x56dd('0xc')](loggerCatch(_0x56dd('0xd')));}function createAgent(_0x381c95){return BPromise['resolve']()[_0x56dd('0xb')](agentReportPreview['createHistory'](_0x381c95))[_0x56dd('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x809e8d){return BPromise[_0x56dd('0xa')]()[_0x56dd('0xb')](cmHopper[_0x56dd('0xe')](_0x809e8d,!![]))['catch'](loggerCatch(_0x56dd('0xf')));}exports[_0x56dd('0x10')]=function(_0x1ba590){return BPromise['resolve']()[_0x56dd('0xb')](cmHopperBlack[_0x56dd('0x10')](_0x1ba590))[_0x56dd('0xc')](loggerCatch(_0x56dd('0x11')));};exports[_0x56dd('0x12')]=function(_0x1192bc){return BPromise['resolve']()[_0x56dd('0xb')](cmHopper[_0x56dd('0x12')](_0x1192bc))[_0x56dd('0xc')](loggerCatch(_0x56dd('0x13')));};exports['createHistory']=function(_0x3c7c92,_0x218f59){create(_0x3c7c92)['catch'](loggerCatch(_0x218f59));moveContact(_0x3c7c92)[_0x56dd('0xc')](loggerCatch(_0x218f59));};exports[_0x56dd('0x14')]=function(_0x3a8e9e,_0x4d7e82){createAgent(_0x3a8e9e)[_0x56dd('0xc')](loggerCatch(_0x4d7e82));};exports[_0x56dd('0x15')]=function(_0x228e57,_0x228bd8){create(_0x228e57)[_0x56dd('0xc')](loggerCatch(_0x228bd8));};exports[_0x56dd('0x16')]=function(_0x3d1a30,_0x35ddd9){moveContact(_0x3d1a30)[_0x56dd('0xc')](loggerCatch(_0x35ddd9));};exports[_0x56dd('0x17')]=function(_0x4c2007,_0xa21062,_0x5b6305){if(_0xa21062){_0x4c2007[_0x56dd('0x18')]=null;}if(_0x5b6305){_0x4c2007[_0x56dd('0x19')]=![];}return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x4c2007))[_0x56dd('0xc')](loggerCatch(_0x56dd('0x1a')));};exports['countReScheduled']=function(_0x5f493c){return BPromise[_0x56dd('0xa')]()[_0x56dd('0xb')](cmHopper[_0x56dd('0x1b')](_0x5f493c))[_0x56dd('0xc')](loggerCatch(_0x56dd('0x1c')));};exports[_0x56dd('0x1d')]=function(_0x458d7f){return BPromise[_0x56dd('0xa')]()['then'](cmHopper['unlockContact']({'UserId':null},_0x458d7f,0x1))[_0x56dd('0xc')](loggerCatch('[unlockContact]\x20'));};exports[_0x56dd('0x1e')]=function(_0x4073bb){return BPromise[_0x56dd('0xa')]()['then'](cmHopper[_0x56dd('0x1d')]({'active':![]},_0x4073bb,0x1))[_0x56dd('0xc')](loggerCatch(_0x56dd('0x1f')));};exports['crateCustomerReportQueue']=function(_0x1ad8bb){var _0x819540={};_0x819540[_0x56dd('0x20')]=_0x1ad8bb['type'];_0x819540[_0x56dd('0x21')]=_0x1ad8bb[_0x56dd('0x21')];_0x819540[_0x56dd('0x22')]=_0x1ad8bb[_0x56dd('0x22')];_0x819540[_0x56dd('0x23')]=_0x1ad8bb[_0x56dd('0x23')];_0x819540[_0x56dd('0x24')]=_0x1ad8bb[_0x56dd('0x24')];_0x819540[_0x56dd('0x25')]=_0x1ad8bb[_0x56dd('0x26')];_0x819540['queuecallerleaveAt']=_0x1ad8bb['answertime'];_0x819540[_0x56dd('0x27')]=0x1;_0x819540[_0x56dd('0x28')]=_0x1ad8bb['endtime'];_0x819540[_0x56dd('0x29')]=_0x1ad8bb[_0x56dd('0x2a')];_0x819540[_0x56dd('0x2b')]=_0x56dd('0x2c');_0x819540[_0x56dd('0x2d')]=_0x56dd('0x2e');_0x819540[_0x56dd('0x2f')]=0x0;_0x819540[_0x56dd('0x30')]=0x1;_0x819540[_0x56dd('0x31')]=_0x1ad8bb[_0x56dd('0x2a')];_0x819540[_0x56dd('0x32')]='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x819540))['catch'](loggerCatch(_0x56dd('0x33')));};exports['getContactRecallMe']=function(_0x5b5823,_0x1f79be){return BPromise[_0x56dd('0xa')]()[_0x56dd('0xb')](cmHopper['getContactRecallMe'](_0x5b5823,_0x1f79be))[_0x56dd('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x56dd('0x34')]=function(_0x47cfbd){return BPromise['resolve']()[_0x56dd('0xb')](cmHopper[_0x56dd('0x17')](_0x47cfbd,!![],!![]))[_0x56dd('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
+var _0x3f42=['crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20'];(function(_0x221f44,_0x3c31ce){var _0x165c5f=function(_0x265791){while(--_0x265791){_0x221f44['push'](_0x221f44['shift']());}};_0x165c5f(++_0x3c31ce);}(_0x3f42,0xc4));var _0x23f4=function(_0x525ec6,_0x2c8973){_0x525ec6=_0x525ec6-0x0;var _0x320abe=_0x3f42[_0x525ec6];return _0x320abe;};'use strict';var util=require(_0x23f4('0x0'));var BPromise=require(_0x23f4('0x1'));var logger=require(_0x23f4('0x2'))(_0x23f4('0x3'));var _=require(_0x23f4('0x4'));var cmHopper=require(_0x23f4('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x23f4('0x6'));var voiceQueueRt=require(_0x23f4('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x23f4('0x8'));function loggerCatch(_0x23f60b){return function(_0x485261){logger['error'](_0x23f60b,util[_0x23f4('0x9')](_0x485261,{'showHidden':![],'depth':null}));};}function create(_0x5833b5){return BPromise[_0x23f4('0xa')]()[_0x23f4('0xb')](cmHopperHistory[_0x23f4('0xc')](_0x5833b5))[_0x23f4('0xd')](loggerCatch(_0x23f4('0xe')));}function createAgent(_0x58136d){return BPromise[_0x23f4('0xa')]()[_0x23f4('0xb')](agentReportPreview[_0x23f4('0xc')](_0x58136d))[_0x23f4('0xd')](loggerCatch(_0x23f4('0xe')));}function moveContact(_0x10237e){return BPromise['resolve']()[_0x23f4('0xb')](cmHopper[_0x23f4('0xf')](_0x10237e,!![]))['catch'](loggerCatch(_0x23f4('0x10')));}exports[_0x23f4('0x11')]=function(_0x2611c1){return BPromise[_0x23f4('0xa')]()[_0x23f4('0xb')](cmHopperBlack[_0x23f4('0x11')](_0x2611c1))[_0x23f4('0xd')](loggerCatch(_0x23f4('0x12')));};exports[_0x23f4('0x13')]=function(_0x13029d){return BPromise[_0x23f4('0xa')]()[_0x23f4('0xb')](cmHopper[_0x23f4('0x13')](_0x13029d))[_0x23f4('0xd')](loggerCatch(_0x23f4('0x14')));};exports[_0x23f4('0xc')]=function(_0x162d4d,_0x2d0a67){create(_0x162d4d)['catch'](loggerCatch(_0x2d0a67));moveContact(_0x162d4d)[_0x23f4('0xd')](loggerCatch(_0x2d0a67));};exports[_0x23f4('0x15')]=function(_0x1050b3,_0x1259dd){createAgent(_0x1050b3)['catch'](loggerCatch(_0x1259dd));};exports[_0x23f4('0x16')]=function(_0x383a35,_0x387543){create(_0x383a35)[_0x23f4('0xd')](loggerCatch(_0x387543));};exports[_0x23f4('0x17')]=function(_0x2c2254,_0x4bd1b1){moveContact(_0x2c2254)[_0x23f4('0xd')](loggerCatch(_0x4bd1b1));};exports[_0x23f4('0x18')]=function(_0xde3cc4,_0x3c25c3,_0x4764c8){if(_0x3c25c3){_0xde3cc4['UserId']=null;}if(_0x4764c8){_0xde3cc4[_0x23f4('0x19')]=![];}return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0xde3cc4))[_0x23f4('0xd')](loggerCatch(_0x23f4('0x1a')));};exports[_0x23f4('0x1b')]=function(_0x211f27){return BPromise[_0x23f4('0xa')]()[_0x23f4('0xb')](cmHopper['countReScheduled'](_0x211f27))[_0x23f4('0xd')](loggerCatch(_0x23f4('0x1c')));};exports[_0x23f4('0x1d')]=function(_0x3ec8f7){return BPromise[_0x23f4('0xa')]()['then'](cmHopper['unlockContact']({'UserId':null},_0x3ec8f7,0x1))['catch'](loggerCatch(_0x23f4('0x1e')));};exports['disableContact']=function(_0x52a517){return BPromise[_0x23f4('0xa')]()[_0x23f4('0xb')](cmHopper[_0x23f4('0x1d')]({'active':![]},_0x52a517,0x1))['catch'](loggerCatch(_0x23f4('0x1f')));};exports[_0x23f4('0x20')]=function(_0x4e47b6){var _0xa45e4c={};_0xa45e4c[_0x23f4('0x21')]=_0x4e47b6[_0x23f4('0x21')];_0xa45e4c[_0x23f4('0x22')]=_0x4e47b6[_0x23f4('0x22')];_0xa45e4c['calleridnum']=_0x4e47b6[_0x23f4('0x23')];_0xa45e4c[_0x23f4('0x24')]=_0x4e47b6[_0x23f4('0x24')];_0xa45e4c[_0x23f4('0x25')]=_0x4e47b6[_0x23f4('0x25')];_0xa45e4c[_0x23f4('0x26')]=_0x4e47b6[_0x23f4('0x27')];_0xa45e4c['queuecallerleaveAt']=_0x4e47b6[_0x23f4('0x27')];_0xa45e4c[_0x23f4('0x28')]=0x1;_0xa45e4c[_0x23f4('0x29')]=_0x4e47b6[_0x23f4('0x2a')];_0xa45e4c[_0x23f4('0x2b')]=_0x4e47b6[_0x23f4('0x2c')];_0xa45e4c[_0x23f4('0x2d')]=_0x23f4('0x2e');_0xa45e4c[_0x23f4('0x2f')]='xcally-motion-preview';_0xa45e4c[_0x23f4('0x30')]=0x0;_0xa45e4c['assigned']=0x1;_0xa45e4c[_0x23f4('0x31')]=_0x4e47b6['membername'];_0xa45e4c[_0x23f4('0x32')]=_0x23f4('0x33');return BPromise[_0x23f4('0xa')]()[_0x23f4('0xb')](voiceQueueReport[_0x23f4('0x34')](_0xa45e4c))['catch'](loggerCatch(_0x23f4('0x35')));};exports[_0x23f4('0x36')]=function(_0xf0630e,_0x32d753){return BPromise[_0x23f4('0xa')]()[_0x23f4('0xb')](cmHopper[_0x23f4('0x36')](_0xf0630e,_0x32d753))[_0x23f4('0xd')](loggerCatch(_0x23f4('0x37')));};exports[_0x23f4('0x38')]=function(_0x518db3){return BPromise['resolve']()[_0x23f4('0xb')](cmHopper['rescheduleContact'](_0x518db3,!![],!![]))[_0x23f4('0xd')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js
index cdbd171..23c088c 100644
--- a/server/services/ami/preview/util/util.js
+++ b/server/services/ami/preview/util/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd92=['rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosloss','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','inspect','loggerError','error','logger2','info','message','isUndefined','string','format','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','updatedAt','XMD-','toUpper','toLowerVariables','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','statedesc','ringtime','logLookAgent','logCustomer','endtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','scheduledAt','scheduledat','add','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','buildAcw','agentReadyId','status','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','membername','active','countglobal','callback','callbackuniqueid','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcd92,0x1b3));var _0x2cd9=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xcd92[_0x42bdad];return _0x122626;};'use strict';var util=require(_0x2cd9('0x0'));var _=require(_0x2cd9('0x1'));var moment=require(_0x2cd9('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x2cd9('0x3')][_0x2cd9('0x4')]||_0x2cd9('0x5');function getSeconds(_0x37e34f,_0x154d6a){var _0x303fa7=moment(_0x37e34f)['milliseconds'](0x0);var _0x2dc09d=moment(_0x154d6a)[_0x2cd9('0x6')](0x0);return _0x303fa7[_0x2cd9('0x7')](_0x2dc09d,'seconds');}exports[_0x2cd9('0x8')]=function(_0x2dd561){return function(_0x41ea3e){logger['error'](_0x2dd561,util[_0x2cd9('0x9')](_0x41ea3e,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x41c241,_0x9cf4b7){logger['info'](_0x41c241,util['inspect'](_0x9cf4b7,{'showHidden':![],'depth':null}));};exports[_0x2cd9('0xa')]=function(_0x3bc039,_0x444b36){logger[_0x2cd9('0xb')](_0x3bc039,util['inspect'](_0x444b36,{'showHidden':![],'depth':null}));};exports[_0x2cd9('0xc')]=function(_0x31a968){return function(_0x9b9853){logger[_0x2cd9('0xd')](_0x31a968,util[_0x2cd9('0x9')](_0x9b9853,{'showHidden':![],'depth':null}));};};exports[_0x2cd9('0xe')]=function(_0xd94aae,_0x2d4d13,_0x580c92){return{'message':_0xd94aae,'unlock':_0x2d4d13,'active':_0x580c92};};exports['getCallerId']=function(_0x459429,_0x36b807,_0xab8f9){if(!_[_0x2cd9('0xf')](_0xab8f9)&&_0x2cd9('0x10')===typeof _0xab8f9&&!_['isEmpty'](_0xab8f9)){if(!_[_0x2cd9('0xf')](_0x36b807)&&_0x2cd9('0x10')===typeof _0x36b807&&!_['isEmpty'](_0x36b807)){return util[_0x2cd9('0x11')]('\x22%s\x22\x20<%s>',_0x36b807,_0xab8f9);}return util[_0x2cd9('0x11')](_0x2cd9('0x12'),_0xab8f9,_0xab8f9);}if(!_[_0x2cd9('0xf')](_0x459429)&&_0x2cd9('0x10')===typeof _0x459429&&!_[_0x2cd9('0x13')](_0x459429)){return _0x459429;}return _0x2cd9('0x14');};exports[_0x2cd9('0x15')]=function(_0xb038ad){if(_['isNil'](_0xb038ad)){return![];}return _0xb038ad;};exports[_0x2cd9('0x16')]=function(_0x2c3ee1,_0xb71440,_0x2d3060,_0x4d7b99,_0x43f160,_0x103233){var _0x381fa5={'XMD-QUEUE':_0xb71440['Queue']?_0xb71440[_0x2cd9('0x17')][_0x2cd9('0x18')]:'','XMD-CALLERID':_0x4d7b99,'XMD-CALLERID-PREVIEW':_0x103233?util[_0x2cd9('0x11')](_0x2cd9('0x12'),_0x103233[_0x2cd9('0x19')],_0x103233['calleridnum']):_0x4d7b99,'XMD-DIALID':_0x43f160,'XMD-CONTACTID':_0xb71440['ContactId'],'XMD-CDRTYPE':_0x2cd9('0x1a'),'CALLERID(all)':_0x4d7b99,'XMD-VOICEQUEUEID':_0xb71440['VoiceQueueId'],'XMD-DIALCHANNEL':_0x2d3060,'XMD-DIALTIMEOUT':_0x2c3ee1[_0x2cd9('0x1b')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x2cd9('0x1c'),_0x2c3ee1[_0x2cd9('0x1d')]?'g':'',_[_0x2cd9('0x13')](_0x2c3ee1[_0x2cd9('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x2c3ee1['dialPreviewUrl']||'','XMD-AGI':_0x2c3ee1[_0x2cd9('0x1f')]?util[_0x2cd9('0x11')](_0x2cd9('0x20'),ipAgi,_0x2c3ee1[_0x2cd9('0x1f')]):_0x2cd9('0x21'),'XMD-AGIAFTER':_0x2c3ee1['dialQueueProject2']?util[_0x2cd9('0x11')](_0x2cd9('0x20'),ipAgi,_0x2c3ee1['dialQueueProject2']):_0x2cd9('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x103233?_0x103233[_0x2cd9('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x103233?_0x103233[_0x2cd9('0x23')]:'','XMD-DESTINATION':_0x2cd9('0x24')};if(!_[_0x2cd9('0x13')](_0x2c3ee1[_0x2cd9('0x1e')])){_0x381fa5[util[_0x2cd9('0x11')]('%s',_0x2cd9('0x25'))]=_0x2c3ee1[_0x2cd9('0x1e')];_0x381fa5[util['format']('%s',_0x2cd9('0x26'))]=_0x43f160;}if(_0xb71440&&_0xb71440[_0x2cd9('0x27')]){for(var _0x4b448b in _0xb71440[_0x2cd9('0x27')]){if(_0xb71440[_0x2cd9('0x27')][_0x2cd9('0x28')](_0x4b448b)){if(!_['isNil'](_0xb71440[_0x2cd9('0x27')][_0x4b448b])&&_0x4b448b!=='id'&&_0x4b448b!=='tags'&&_0x4b448b!=='createdAt'&&_0x4b448b!==_0x2cd9('0x29')){_0x381fa5[util['format']('%s%s',_0x2cd9('0x2a'),_[_0x2cd9('0x2b')](_0x4b448b))]=_0xb71440[_0x2cd9('0x27')][_0x4b448b];}}}}return _0x381fa5;};exports[_0x2cd9('0x2c')]=function(_0x45cc1a){var _0x18387a={};for(var _0x26c419 in _0x45cc1a){if(_0x45cc1a[_0x2cd9('0x28')](_0x26c419)){_0x18387a[util[_0x2cd9('0x11')]('%s',_['toLower'](_0x26c419))]=_0x45cc1a[_0x26c419];}}return{'variables':_0x18387a};};exports[_0x2cd9('0x2d')]=function(_0x4fe07f,_0x5adbd9){if(!_[_0x2cd9('0x2e')](_0x4fe07f)){if(_0x4fe07f['hasOwnProperty']('originated')){if(_0x4fe07f[_0x2cd9('0x2f')]>0x0){_0x4fe07f[_0x2cd9('0x2f')]-=0x1;}else{logger[_0x2cd9('0xb')](_0x2cd9('0x30'),_0x5adbd9);}}}else{logger[_0x2cd9('0xb')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5adbd9);}};exports[_0x2cd9('0x31')]=function(_0x431a32){var _0x1c0b41=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x431a32[_0x2cd9('0x32')]=0xd;_0x431a32['statedesc']='Blacklist';_0x431a32[_0x2cd9('0x33')]=_0x1c0b41;_0x431a32[_0x2cd9('0x34')]=_0x1c0b41;_0x431a32['endtime']=_0x1c0b41;};exports[_0x2cd9('0x35')]=function(_0x285cb3,_0x238db2,_0x2adb8f){var _0x2d638d=moment()[_0x2cd9('0x11')](_0x2cd9('0x36'));_0x285cb3[_0x2cd9('0x32')]=_0x238db2;_0x285cb3[_0x2cd9('0x37')]=_0x2adb8f;_0x285cb3[_0x2cd9('0x34')]=_0x2d638d;_0x285cb3[_0x2cd9('0x38')]=getSeconds(_0x285cb3[_0x2cd9('0x34')],_0x285cb3[_0x2cd9('0x33')]);};exports[_0x2cd9('0x39')]=function(_0x505936,_0x10c934,_0x194213){_0x505936['membername']=_0x10c934;_0x505936['UserId']=_0x194213;};exports[_0x2cd9('0x3a')]=function(_0x2ed459,_0x2e5ab5,_0x40fa81){var _0x3e2f13=moment()[_0x2cd9('0x11')](_0x2cd9('0x36'));_0x2ed459[_0x2cd9('0x32')]=_0x2e5ab5;_0x2ed459['statedesc']=_0x40fa81;_0x2ed459[_0x2cd9('0x34')]=_0x2ed459[_0x2cd9('0x34')]?_0x2ed459['responsetime']:_0x3e2f13;_0x2ed459[_0x2cd9('0x3b')]=_0x2ed459['endtime']?_0x2ed459['endtime']:_0x3e2f13;_0x2ed459[_0x2cd9('0x38')]=getSeconds(_0x2ed459[_0x2cd9('0x34')]||0x0,_0x2ed459[_0x2cd9('0x33')]||0x0);_0x2ed459[_0x2cd9('0x3c')]=_0x2ed459[_0x2cd9('0x3d')]?getSeconds(_0x2ed459[_0x2cd9('0x3b')],_0x2ed459['answertime']):0x0;};exports['isFailure']=function(_0x53a36a){return _0x53a36a===_0x2cd9('0x3e');};exports[_0x2cd9('0x3f')]=function(_0xf0ff98,_0x32d165,_0x55476d,_0x168b3a,_0x1e7e78){var _0x34c387=_0x168b3a?_0x2cd9('0x40'):_0xf0ff98['calleridname'];_0x34c387=_0x1e7e78?_0x2cd9('0x41'):_0x34c387;return{'actionid':_0xf0ff98[_0x2cd9('0x42')],'action':'originate','channel':_0xf0ff98[_0x2cd9('0x43')],'callerid':util[_0x2cd9('0x11')](_0x2cd9('0x12'),_0x34c387,_0xf0ff98[_0x2cd9('0x44')]),'Exten':'xcally-motion-preview','Context':_0x2cd9('0x45'),'Priority':'1','variable':_0x55476d,'timeout':(_0x32d165[_0x2cd9('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0xf0ff98[_0x2cd9('0x42')]};};exports[_0x2cd9('0x47')]=function(_0x26b2fb){return _0x26b2fb[_0x2cd9('0x48')]+_0x26b2fb[_0x2cd9('0x49')]+_0x26b2fb[_0x2cd9('0x4a')];};exports[_0x2cd9('0x4b')]=function(_0x19e946){var _0xcc1170=_[_0x2cd9('0x4c')](_0x19e946);_0xcc1170['state']=0xf;_0xcc1170['statedesc']='Global';return _0xcc1170;};exports[_0x2cd9('0x4d')]=function(_0x10672c,_0x3189bd,_0xbd380a){var _0x3c67e5={};_0x3c67e5[_0x3189bd]=_0x10672c[_0x3189bd];_0x3c67e5['active']=![];_0x3c67e5[_0x2cd9('0x4e')]=moment()[_0x2cd9('0x4f')](_0xbd380a,_0x2cd9('0x50'))[_0x2cd9('0x11')](_0x2cd9('0x36'));_0x3c67e5[_0x2cd9('0x51')]=_0x10672c[_0x2cd9('0x51')];_0x3c67e5[_0x2cd9('0x52')]=_0x10672c[_0x2cd9('0x52')];_0x3c67e5[_0x2cd9('0x53')]=_0x10672c['VoiceQueueId']||undefined;return _0x3c67e5;};exports[_0x2cd9('0x54')]=function(_0x528f8d,_0x13415a){if(!_[_0x2cd9('0x2e')](_0x528f8d)){if(_0x528f8d[_0x2cd9('0x55')]>0x0){_0x528f8d[_0x2cd9('0x55')]-=0x1;}else{logger[_0x2cd9('0xb')](_0x13415a,_0x2cd9('0x56'));}}else{logger['error'](_0x13415a,_0x2cd9('0x57'));}};exports[_0x2cd9('0x58')]=function(_0x38a94a){if(_0x38a94a<=0x0){return!![];}return![];};exports['buildObj']=function(_0x225dc7,_0x8c0d71){_0x225dc7[_0x2cd9('0x59')]=_0x8c0d71;_0x225dc7[_0x2cd9('0x18')]=_0x225dc7[_0x2cd9('0x5a')];_0x225dc7[_0x2cd9('0x5b')]=_0x225dc7[_0x2cd9('0x43')];return _0x225dc7;};exports[_0x2cd9('0x5c')]=function(_0x3ad217){var _0x35c2bd={};_0x35c2bd[_0x2cd9('0x5a')]=_0x3ad217[_0x2cd9('0x5a')];_0x35c2bd['interface']=_0x3ad217[_0x2cd9('0x43')];_0x35c2bd[_0x2cd9('0x42')]=_0x3ad217[_0x2cd9('0x42')];return _0x35c2bd;};exports[_0x2cd9('0x5d')]=function(_0x4bf9a2){var _0x27e098=[];for(var _0x3b88a9 in _0x4bf9a2){if(_0x4bf9a2[_0x2cd9('0x28')](_0x3b88a9)){if(!_['isNil'](_0x4bf9a2[_0x3b88a9])&&_0x4bf9a2[_0x3b88a9][_0x2cd9('0x32')]==='not_inuse'&&_0x4bf9a2[_0x3b88a9][_0x2cd9('0x5e')]===_0x2cd9('0x5f')){_0x27e098[_0x2cd9('0x60')](_0x4bf9a2[_0x3b88a9]['id']);}}}return _0x27e098;};exports[_0x2cd9('0x61')]=function(_0xdef023){var _0x408d5f=moment()[_0x2cd9('0x6')](0x0);var _0x156caf=moment(_0xdef023)[_0x2cd9('0x6')](0x0);return _0x408d5f[_0x2cd9('0x7')](_0x156caf,_0x2cd9('0x62'));};exports[_0x2cd9('0x63')]=function(_0x151bac){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x151bac['ContactId'],'ListId':_0x151bac[_0x2cd9('0x52')],'VoiceQueueId':_0x151bac['VoiceQueueId']||undefined,'CampaignId':_0x151bac[_0x2cd9('0x64')]||undefined};};exports[_0x2cd9('0x65')]=function(_0x4be004){if(_0x4be004===_0x2cd9('0x42')||_0x4be004==='idContact'||_0x4be004==='queue'||_0x4be004===_0x2cd9('0x66')||_0x4be004===_0x2cd9('0x67')||_0x4be004===_0x2cd9('0x68')||_0x4be004===_0x2cd9('0x69')||_0x4be004===_0x2cd9('0x43')||_0x4be004===_0x2cd9('0x19')||_0x4be004===_0x2cd9('0x6a')||_0x4be004===_0x2cd9('0x44')||_0x4be004==='scheduledat'||_0x4be004===_0x2cd9('0x48')||_0x4be004==='countcongestionretry'||_0x4be004===_0x2cd9('0x4a')||_0x4be004===_0x2cd9('0x6b')||_0x4be004===_0x2cd9('0x6c')||_0x4be004===_0x2cd9('0x6d')||_0x4be004==='callbackat'||_0x4be004==='recallme'||_0x4be004===_0x2cd9('0x51')||_0x4be004===_0x2cd9('0x52')||_0x4be004==='UserId'||_0x4be004===_0x2cd9('0x53')||_0x4be004===_0x2cd9('0x6e')||_0x4be004===_0x2cd9('0x6f')||_0x4be004===_0x2cd9('0x70')||_0x4be004===_0x2cd9('0x71')||_0x4be004===_0x2cd9('0x72')||_0x4be004==='xmd-dialurl'||_0x4be004===_0x2cd9('0x73')||_0x4be004===_0x2cd9('0x74')||_0x4be004===_0x2cd9('0x75')||_0x4be004===_0x2cd9('0x76')||_0x4be004==='xmd-contactid'||_0x4be004===_0x2cd9('0x77')||_0x4be004===_0x2cd9('0x78')||_0x4be004===_0x2cd9('0x79')||_0x4be004===_0x2cd9('0x7a')||_0x4be004===_0x2cd9('0x7b')||_0x4be004===_0x2cd9('0x7c')||_0x4be004===_0x2cd9('0x7d')||_0x4be004===_0x2cd9('0x7e')||_0x4be004==='rtpaudioqosloss'||_0x4be004===_0x2cd9('0x7f')||_0x4be004==='rtpaudioqosrtt'||_0x4be004===_0x2cd9('0x80')||_0x4be004==='rtpaudioqos'||_0x4be004===_0x2cd9('0x7c')||_0x4be004===_0x2cd9('0x7d')||_0x4be004===_0x2cd9('0x7e')||_0x4be004===_0x2cd9('0x81')||_0x4be004===_0x2cd9('0x7f')||_0x4be004===_0x2cd9('0x82')||_0x4be004===_0x2cd9('0x80')||_0x4be004===_0x2cd9('0x83')||_0x4be004===_0x2cd9('0x84')||_0x4be004==='state'||_0x4be004===_0x2cd9('0x37')){return![];}return!![];};exports[_0x2cd9('0x85')]=function(_0x3809b4,_0x227cb0){var _0x1444f5,_0x165751,_0x364149;if(_0x227cb0<=0x0){_0x227cb0=0x1;}_0x1444f5=new RegExp(_0x2cd9('0x86')+_0x227cb0+'}$');_0x165751=Math[_0x2cd9('0x87')](0xa,_0x227cb0-0x1);_0x364149=Math[_0x2cd9('0x87')](0xa,_0x227cb0)-0x1;return util['format']('%s',_['replace'](_0x3809b4,_0x1444f5,_[_0x2cd9('0x88')](_0x165751,_0x364149)));};exports[_0x2cd9('0x89')]=function(_0x1bbbe5){var _0x43540b=_0x1bbbe5[_0x2cd9('0x8a')](/"(.*?)"/);return _0x43540b?_0x43540b[0x1]:_0x1bbbe5;};exports[_0x2cd9('0x8b')]=function(_0x2a16a2){var _0x470fdf=_0x2a16a2['match'](/<(.*?)>/);return _0x470fdf?_0x470fdf[0x1]:_0x2a16a2;};
\ No newline at end of file
+var _0x7617=['buildObj','lastevent','name','interface','buildAcw','queue','agentReadyId','not_inuse','status','reachable','push','seconds','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','scheduledat','countcongestionretry','countglobal','callback','callbackuniqueid','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','pow','random','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','env','milliseconds','diff','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logLookAgent','membername','logCustomer','talktime','answertime','isFailure','Failure','RECALL','originate','channelAgent','calleridnum','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn'];(function(_0x50f060,_0x1c285d){var _0x493eb5=function(_0x44528c){while(--_0x44528c){_0x50f060['push'](_0x50f060['shift']());}};_0x493eb5(++_0x1c285d);}(_0x7617,0x1cd));var _0x7761=function(_0x19b03a,_0x57acc7){_0x19b03a=_0x19b03a-0x0;var _0xe74be1=_0x7617[_0x19b03a];return _0xe74be1;};'use strict';var util=require(_0x7761('0x0'));var _=require(_0x7761('0x1'));var moment=require('moment');var logger=require(_0x7761('0x2'))('preview');var ipAgi=process[_0x7761('0x3')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x5f013f,_0x3629dc){var _0x3f580f=moment(_0x5f013f)[_0x7761('0x4')](0x0);var _0xd3d23b=moment(_0x3629dc)[_0x7761('0x4')](0x0);return _0x3f580f[_0x7761('0x5')](_0xd3d23b,'seconds');}exports['loggerCatch']=function(_0x1e95a6){return function(_0x1192f4){logger[_0x7761('0x6')](_0x1e95a6,util[_0x7761('0x7')](_0x1192f4,{'showHidden':![],'depth':null}));};};exports[_0x7761('0x8')]=function(_0x354369,_0x57015c){logger[_0x7761('0x9')](_0x354369,util[_0x7761('0x7')](_0x57015c,{'showHidden':![],'depth':null}));};exports[_0x7761('0xa')]=function(_0x12a55d,_0x5c25c5){logger[_0x7761('0x6')](_0x12a55d,util[_0x7761('0x7')](_0x5c25c5,{'showHidden':![],'depth':null}));};exports[_0x7761('0xb')]=function(_0x33ff41){return function(_0x1f3b97){logger[_0x7761('0x9')](_0x33ff41,util['inspect'](_0x1f3b97,{'showHidden':![],'depth':null}));};};exports[_0x7761('0xc')]=function(_0x1938e7,_0x3fd190,_0xc37ec3){return{'message':_0x1938e7,'unlock':_0x3fd190,'active':_0xc37ec3};};exports[_0x7761('0xd')]=function(_0x129e5d,_0x292f1b,_0x5cf5c9){if(!_[_0x7761('0xe')](_0x5cf5c9)&&_0x7761('0xf')===typeof _0x5cf5c9&&!_['isEmpty'](_0x5cf5c9)){if(!_[_0x7761('0xe')](_0x292f1b)&&'string'===typeof _0x292f1b&&!_[_0x7761('0x10')](_0x292f1b)){return util['format'](_0x7761('0x11'),_0x292f1b,_0x5cf5c9);}return util[_0x7761('0x12')]('\x22%s\x22\x20<%s>',_0x5cf5c9,_0x5cf5c9);}if(!_['isUndefined'](_0x129e5d)&&_0x7761('0xf')===typeof _0x129e5d&&!_[_0x7761('0x10')](_0x129e5d)){return _0x129e5d;}return _0x7761('0x13');};exports[_0x7761('0x14')]=function(_0x4e56da){if(_[_0x7761('0x15')](_0x4e56da)){return![];}return _0x4e56da;};exports[_0x7761('0x16')]=function(_0xc68bf8,_0x24163e,_0x403b05,_0x21a1c0,_0x1adf1d,_0x3d26c8){var _0x3beddc={'XMD-QUEUE':_0x24163e['Queue']?_0x24163e[_0x7761('0x17')]['name']:'','XMD-CALLERID':_0x21a1c0,'XMD-CALLERID-PREVIEW':_0x3d26c8?util[_0x7761('0x12')](_0x7761('0x11'),_0x3d26c8[_0x7761('0x18')],_0x3d26c8['calleridnum']):_0x21a1c0,'XMD-DIALID':_0x1adf1d,'XMD-CONTACTID':_0x24163e[_0x7761('0x19')],'XMD-CDRTYPE':_0x7761('0x1a'),'CALLERID(all)':_0x21a1c0,'XMD-VOICEQUEUEID':_0x24163e['VoiceQueueId'],'XMD-DIALCHANNEL':_0x403b05,'XMD-DIALTIMEOUT':_0xc68bf8[_0x7761('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x7761('0x12')](_0x7761('0x1c'),_0xc68bf8[_0x7761('0x1d')]?'g':'',_[_0x7761('0x10')](_0xc68bf8[_0x7761('0x1e')])?'':_0x7761('0x1f')),'XMD-DIALURL':_0xc68bf8[_0x7761('0x20')]||'','XMD-AGI':_0xc68bf8[_0x7761('0x21')]?util['format'](_0x7761('0x22'),ipAgi,_0xc68bf8[_0x7761('0x21')]):_0x7761('0x23'),'XMD-AGIAFTER':_0xc68bf8[_0x7761('0x1d')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0xc68bf8[_0x7761('0x1d')]):_0x7761('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x3d26c8?_0x3d26c8[_0x7761('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x3d26c8?_0x3d26c8['originatecalleridname']:'','XMD-DESTINATION':_0x7761('0x25')};if(!_[_0x7761('0x10')](_0xc68bf8[_0x7761('0x1e')])){_0x3beddc[util[_0x7761('0x12')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0xc68bf8[_0x7761('0x1e')];_0x3beddc[util[_0x7761('0x12')]('%s',_0x7761('0x26'))]=_0x1adf1d;}if(_0x24163e&&_0x24163e[_0x7761('0x27')]){for(var _0x52d830 in _0x24163e['Contact']){if(_0x24163e['Contact'][_0x7761('0x28')](_0x52d830)){if(!_[_0x7761('0x15')](_0x24163e['Contact'][_0x52d830])&&_0x52d830!=='id'&&_0x52d830!==_0x7761('0x29')&&_0x52d830!==_0x7761('0x2a')&&_0x52d830!==_0x7761('0x2b')){_0x3beddc[util['format']('%s%s',_0x7761('0x2c'),_[_0x7761('0x2d')](_0x52d830))]=_0x24163e[_0x7761('0x27')][_0x52d830];}}}}return _0x3beddc;};exports['toLowerVariables']=function(_0xe95751){var _0x484ecd={};for(var _0x18d076 in _0xe95751){if(_0xe95751[_0x7761('0x28')](_0x18d076)){_0x484ecd[util[_0x7761('0x12')]('%s',_['toLower'](_0x18d076))]=_0xe95751[_0x18d076];}}return{'variables':_0x484ecd};};exports[_0x7761('0x2e')]=function(_0x2175e9,_0x58afbb){if(!_['isNil'](_0x2175e9)){if(_0x2175e9[_0x7761('0x28')]('originated')){if(_0x2175e9[_0x7761('0x2f')]>0x0){_0x2175e9['originated']-=0x1;}else{logger['error'](_0x7761('0x30'),_0x58afbb);}}}else{logger['error'](_0x7761('0x31'),_0x58afbb);}};exports[_0x7761('0x32')]=function(_0x436f95){var _0x3d1aa3=moment()['format'](_0x7761('0x33'));_0x436f95[_0x7761('0x34')]=0xd;_0x436f95[_0x7761('0x35')]='Blacklist';_0x436f95[_0x7761('0x36')]=_0x3d1aa3;_0x436f95[_0x7761('0x37')]=_0x3d1aa3;_0x436f95[_0x7761('0x38')]=_0x3d1aa3;};exports['logAgent']=function(_0xaab6f0,_0x103f7a,_0x37d964){var _0x2305a3=moment()['format'](_0x7761('0x33'));_0xaab6f0[_0x7761('0x34')]=_0x103f7a;_0xaab6f0[_0x7761('0x35')]=_0x37d964;_0xaab6f0[_0x7761('0x37')]=_0x2305a3;_0xaab6f0['ringtime']=getSeconds(_0xaab6f0['responsetime'],_0xaab6f0[_0x7761('0x36')]);};exports[_0x7761('0x39')]=function(_0xc5e0cc,_0x3ade84,_0xd592a5){_0xc5e0cc[_0x7761('0x3a')]=_0x3ade84;_0xc5e0cc['UserId']=_0xd592a5;};exports[_0x7761('0x3b')]=function(_0x5a1a72,_0xb7ecc8,_0x4410aa){var _0x24f954=moment()[_0x7761('0x12')](_0x7761('0x33'));_0x5a1a72[_0x7761('0x34')]=_0xb7ecc8;_0x5a1a72['statedesc']=_0x4410aa;_0x5a1a72[_0x7761('0x37')]=_0x5a1a72[_0x7761('0x37')]?_0x5a1a72[_0x7761('0x37')]:_0x24f954;_0x5a1a72[_0x7761('0x38')]=_0x5a1a72[_0x7761('0x38')]?_0x5a1a72[_0x7761('0x38')]:_0x24f954;_0x5a1a72['ringtime']=getSeconds(_0x5a1a72[_0x7761('0x37')]||0x0,_0x5a1a72[_0x7761('0x36')]||0x0);_0x5a1a72[_0x7761('0x3c')]=_0x5a1a72[_0x7761('0x3d')]?getSeconds(_0x5a1a72[_0x7761('0x38')],_0x5a1a72['answertime']):0x0;};exports[_0x7761('0x3e')]=function(_0x4652ca){return _0x4652ca===_0x7761('0x3f');};exports['variablesAction']=function(_0x536f3e,_0x5484d9,_0x244fbd,_0x52c762,_0x3536e5){var _0xcc1641=_0x52c762?_0x7761('0x40'):_0x536f3e[_0x7761('0x18')];_0xcc1641=_0x3536e5?'BOOKED':_0xcc1641;return{'actionid':_0x536f3e['uniqueid'],'action':_0x7761('0x41'),'channel':_0x536f3e[_0x7761('0x42')],'callerid':util[_0x7761('0x12')](_0x7761('0x11'),_0xcc1641,_0x536f3e[_0x7761('0x43')]),'Exten':'xcally-motion-preview','Context':_0x7761('0x44'),'Priority':'1','variable':_0x244fbd,'timeout':(_0x5484d9[_0x7761('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x536f3e[_0x7761('0x46')]};};exports[_0x7761('0x47')]=function(_0x13a278){return _0x13a278[_0x7761('0x48')]+_0x13a278['countcongestionretry']+_0x13a278[_0x7761('0x49')];};exports[_0x7761('0x4a')]=function(_0xecbc79){var _0x1a9a8a=_[_0x7761('0x4b')](_0xecbc79);_0x1a9a8a['state']=0xf;_0x1a9a8a[_0x7761('0x35')]=_0x7761('0x4c');return _0x1a9a8a;};exports[_0x7761('0x4d')]=function(_0x106494,_0x141ba1,_0x5a580d){var _0x2949ce={};_0x2949ce[_0x141ba1]=_0x106494[_0x141ba1];_0x2949ce['active']=![];_0x2949ce['scheduledat']=moment()[_0x7761('0x4e')](_0x5a580d,_0x7761('0x4f'))['format'](_0x7761('0x33'));_0x2949ce[_0x7761('0x19')]=_0x106494[_0x7761('0x19')];_0x2949ce[_0x7761('0x50')]=_0x106494['ListId'];_0x2949ce[_0x7761('0x51')]=_0x106494[_0x7761('0x51')]||undefined;return _0x2949ce;};exports[_0x7761('0x52')]=function(_0x45e156,_0x418db2){if(!_[_0x7761('0x15')](_0x45e156)){if(_0x45e156[_0x7761('0x53')]>0x0){_0x45e156[_0x7761('0x53')]-=0x1;}else{logger[_0x7761('0x6')](_0x418db2,_0x7761('0x54'));}}else{logger[_0x7761('0x6')](_0x418db2,_0x7761('0x55'));}};exports[_0x7761('0x56')]=function(_0x12bf60){if(_0x12bf60<=0x0){return!![];}return![];};exports[_0x7761('0x57')]=function(_0x539990,_0x227f81){_0x539990[_0x7761('0x58')]=_0x227f81;_0x539990[_0x7761('0x59')]=_0x539990['queue'];_0x539990[_0x7761('0x5a')]=_0x539990['channelAgent'];return _0x539990;};exports[_0x7761('0x5b')]=function(_0xd2c27f){var _0x584c10={};_0x584c10[_0x7761('0x5c')]=_0xd2c27f['queue'];_0x584c10[_0x7761('0x5a')]=_0xd2c27f[_0x7761('0x42')];_0x584c10[_0x7761('0x46')]=_0xd2c27f[_0x7761('0x46')];return _0x584c10;};exports[_0x7761('0x5d')]=function(_0x59ab78){var _0x4d5c1e=[];for(var _0x14d13c in _0x59ab78){if(_0x59ab78[_0x7761('0x28')](_0x14d13c)){if(!_[_0x7761('0x15')](_0x59ab78[_0x14d13c])&&_0x59ab78[_0x14d13c][_0x7761('0x34')]===_0x7761('0x5e')&&_0x59ab78[_0x14d13c][_0x7761('0x5f')]===_0x7761('0x60')){_0x4d5c1e[_0x7761('0x61')](_0x59ab78[_0x14d13c]['id']);}}}return _0x4d5c1e;};exports['getDiff']=function(_0x4f6661){var _0x2c8087=moment()[_0x7761('0x4')](0x0);var _0x23a0e6=moment(_0x4f6661)[_0x7761('0x4')](0x0);return _0x2c8087[_0x7761('0x5')](_0x23a0e6,_0x7761('0x62'));};exports[_0x7761('0x63')]=function(_0x3693b0){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3693b0[_0x7761('0x19')],'ListId':_0x3693b0[_0x7761('0x50')],'VoiceQueueId':_0x3693b0[_0x7761('0x51')]||undefined,'CampaignId':_0x3693b0[_0x7761('0x64')]||undefined};};exports[_0x7761('0x65')]=function(_0x4775c7){if(_0x4775c7==='uniqueid'||_0x4775c7===_0x7761('0x66')||_0x4775c7===_0x7761('0x5c')||_0x4775c7==='type'||_0x4775c7===_0x7761('0x67')||_0x4775c7===_0x7761('0x68')||_0x4775c7===_0x7761('0x3a')||_0x4775c7===_0x7761('0x42')||_0x4775c7===_0x7761('0x18')||_0x4775c7==='active'||_0x4775c7===_0x7761('0x43')||_0x4775c7===_0x7761('0x69')||_0x4775c7===_0x7761('0x48')||_0x4775c7===_0x7761('0x6a')||_0x4775c7==='countnoanswerretry'||_0x4775c7===_0x7761('0x6b')||_0x4775c7===_0x7761('0x6c')||_0x4775c7===_0x7761('0x6d')||_0x4775c7==='callbackat'||_0x4775c7===_0x7761('0x6e')||_0x4775c7==='ContactId'||_0x4775c7===_0x7761('0x50')||_0x4775c7===_0x7761('0x6f')||_0x4775c7===_0x7761('0x51')||_0x4775c7===_0x7761('0x70')||_0x4775c7===_0x7761('0x71')||_0x4775c7===_0x7761('0x72')||_0x4775c7===_0x7761('0x73')||_0x4775c7===_0x7761('0x74')||_0x4775c7===_0x7761('0x75')||_0x4775c7==='xmd-dialtimeout'||_0x4775c7===_0x7761('0x76')||_0x4775c7===_0x7761('0x77')||_0x4775c7==='xmd-dialchannel'||_0x4775c7==='xmd-contactid'||_0x4775c7===_0x7761('0x78')||_0x4775c7===_0x7761('0x79')||_0x4775c7===_0x7761('0x7a')||_0x4775c7==='xmd-agi'||_0x4775c7===_0x7761('0x7b')||_0x4775c7===_0x7761('0x7c')||_0x4775c7==='rtpaudioqosjitter'||_0x4775c7==='rtpaudioqosjitterbridged'||_0x4775c7==='rtpaudioqosloss'||_0x4775c7===_0x7761('0x7d')||_0x4775c7===_0x7761('0x7e')||_0x4775c7==='rtpaudioqosrttbridged'||_0x4775c7===_0x7761('0x7b')||_0x4775c7==='rtpaudioqosbridged'||_0x4775c7===_0x7761('0x7f')||_0x4775c7===_0x7761('0x80')||_0x4775c7==='rtpaudioqosloss'||_0x4775c7==='rtpaudioqoslossbridged'||_0x4775c7===_0x7761('0x7e')||_0x4775c7===_0x7761('0x81')||_0x4775c7==='bridgepeer'||_0x4775c7===_0x7761('0x82')||_0x4775c7==='state'||_0x4775c7===_0x7761('0x35')){return![];}return!![];};exports[_0x7761('0x83')]=function(_0x33c4ae,_0x3b0a01){var _0x531add,_0x440f9f,_0xad228f;if(_0x3b0a01<=0x0){_0x3b0a01=0x1;}_0x531add=new RegExp('\x5cw{0,'+_0x3b0a01+'}$');_0x440f9f=Math[_0x7761('0x84')](0xa,_0x3b0a01-0x1);_0xad228f=Math['pow'](0xa,_0x3b0a01)-0x1;return util[_0x7761('0x12')]('%s',_['replace'](_0x33c4ae,_0x531add,_[_0x7761('0x85')](_0x440f9f,_0xad228f)));};exports[_0x7761('0x86')]=function(_0x5ba4d6){var _0x119bf7=_0x5ba4d6[_0x7761('0x87')](/"(.*?)"/);return _0x119bf7?_0x119bf7[0x1]:_0x5ba4d6;};exports[_0x7761('0x88')]=function(_0x4c5b2c){var _0x16d863=_0x4c5b2c[_0x7761('0x87')](/<(.*?)>/);return _0x16d863?_0x16d863[0x1]:_0x4c5b2c;};
\ No newline at end of file
diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js
index 6da991d..e115c5e 100644
--- a/server/services/ami/properties.js
+++ b/server/services/ami/properties.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4f29=['voicequeuechannelredirect','string','number','boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0xba7530,_0x4c5f41){var _0x1dc93a=function(_0x1a6aca){while(--_0x1a6aca){_0xba7530['push'](_0xba7530['shift']());}};_0x1dc93a(++_0x4c5f41);}(_0x4f29,0xfd));var _0x94f2=function(_0x2a58b,_0x3eb11e){_0x2a58b=_0x2a58b-0x0;var _0x3d8e32=_0x4f29[_0x2a58b];return _0x3d8e32;};'use strict';exports['queueadd']={'queue':{'type':_0x94f2('0x0'),'required':!![]},'interface':{'type':_0x94f2('0x0'),'required':!![]},'membername':{'type':_0x94f2('0x0'),'required':!![]},'penalty':{'type':_0x94f2('0x1'),'required':![]},'paused':{'type':_0x94f2('0x2'),'required':![]}};exports[_0x94f2('0x3')]={'queue':{'type':_0x94f2('0x0'),'required':!![]},'interface':{'type':_0x94f2('0x0'),'required':!![]}};exports[_0x94f2('0x4')]={'interface':{'type':_0x94f2('0x0'),'required':!![]},'paused':{'type':_0x94f2('0x2')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x94f2('0x0'),'required':![]}};exports[_0x94f2('0x5')]={'uniqueid':{'type':_0x94f2('0x0'),'required':!![]}};exports[_0x94f2('0x6')]={'uniqueid':{'type':_0x94f2('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x94f2('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x94f2('0x8')]={'uniqueid':{'type':_0x94f2('0x0'),'required':!![]},'exten':{'type':_0x94f2('0x0'),'required':!![]},'context':{'type':_0x94f2('0x0')}};
\ No newline at end of file
+var _0xc5c7=['number','boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelredirect','string'];(function(_0x503e86,_0x4c18e3){var _0x2cfde7=function(_0x4b88cf){while(--_0x4b88cf){_0x503e86['push'](_0x503e86['shift']());}};_0x2cfde7(++_0x4c18e3);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x9be8e3,_0x18eafc){_0x9be8e3=_0x9be8e3-0x0;var _0x20140c=_0xc5c7[_0x9be8e3];return _0x20140c;};'use strict';exports['queueadd']={'queue':{'type':_0x7c5c('0x0'),'required':!![]},'interface':{'type':_0x7c5c('0x0'),'required':!![]},'membername':{'type':_0x7c5c('0x0'),'required':!![]},'penalty':{'type':_0x7c5c('0x1'),'required':![]},'paused':{'type':_0x7c5c('0x2'),'required':![]}};exports[_0x7c5c('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x7c5c('0x0'),'required':!![]}};exports[_0x7c5c('0x4')]={'interface':{'type':_0x7c5c('0x0'),'required':!![]},'paused':{'type':_0x7c5c('0x2')},'reason':{'type':_0x7c5c('0x0'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0x7c5c('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x7c5c('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x7c5c('0x0')},'format':{'type':_0x7c5c('0x0')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x7c5c('0x0'),'required':!![]}};exports[_0x7c5c('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x7c5c('0x0'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js
index d3e37ac..1f82bdc 100644
--- a/server/services/ami/realtime/index.js
+++ b/server/services/ami/realtime/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46b3=['voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','channels','queueChannels','timers','zendeskAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','isUndefined','initTelephones','length','mergeFromDatabase','initTrunks','initVoiceQueues','initTriggers','initZendeskAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','diff','initVoiceCallReports','duration','ANSWERED','billableseconds','campaigns'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x46b3,0x194));var _0x346b=function(_0x6c2468,_0x506ac0){_0x6c2468=_0x6c2468-0x0;var _0x5d6fb7=_0x46b3[_0x6c2468];return _0x5d6fb7;};'use strict';var BPromise=require(_0x346b('0x0'));var util=require(_0x346b('0x1'));var _=require(_0x346b('0x2'));var moment=require(_0x346b('0x3'));var Agent=require(_0x346b('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0x346b('0x5'));var VoiceQueue=require(_0x346b('0x6'));var Trigger=require(_0x346b('0x7'));var Template=require(_0x346b('0x8'));var Campaign=require(_0x346b('0x9'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x346b('0xa'));var SalesforceAccount=require(_0x346b('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x346b('0xc'));var ZohoAccount=require(_0x346b('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x346b('0xe'));var ServicenowAccount=require(_0x346b('0xf'));var Dynamics365Account=require(_0x346b('0x10'));var FaxAccount=require(_0x346b('0x11'));var Realtime=function(){this[_0x346b('0x12')]={};this[_0x346b('0x13')]={};this[_0x346b('0x14')]={};this[_0x346b('0x15')]={};this[_0x346b('0x16')]={};this['campaigns']={};this[_0x346b('0x17')]={};this[_0x346b('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x346b('0x19')]={};this[_0x346b('0x1a')]={};this['outboundChannels']={};this[_0x346b('0x1b')]={};this[_0x346b('0x1c')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0x346b('0x1d')]={};this[_0x346b('0x1e')]={};this[_0x346b('0x1f')]={};this[_0x346b('0x20')]={};this[_0x346b('0x21')]={};this[_0x346b('0x22')]={};this[_0x346b('0x23')]={};};function freeIsNotKey(_0x15acda,_0x1919d2,_0x216ef3){var _0x5708f2=_[_0x346b('0x24')](_0x15acda,function(_0x539b0b,_0x1ab499){return _0x539b0b[_0x216ef3];});for(var _0x1b9c19 in _0x1919d2){if(_0x1919d2[_0x346b('0x25')](_0x1b9c19)){if(!_0x5708f2[_0x1b9c19]){delete _0x1919d2[_0x1b9c19];}}}}function freeIsNotKeySip(_0x57977c,_0x572e63){var _0xb75198=_['mapKeys'](_0x57977c,function(_0xd41d73,_0x29be83){return util[_0x346b('0x26')](_0x346b('0x27'),_0xd41d73[_0x346b('0x28')]);});for(var _0x3db379 in _0x572e63){if(_0x572e63['hasOwnProperty'](_0x3db379)){if(!_0xb75198[_0x3db379]){delete _0x572e63[_0x3db379];}}}}function freeIsNotKeyAgent(_0x1e2647,_0x261734){var _0x47d8ab=_['mapKeys'](_0x1e2647,function(_0x43cf75,_0x125959){var _0x222d1a=_['isNil'](_0x43cf75[_0x346b('0x29')])?util[_0x346b('0x26')](_0x346b('0x27'),_0x43cf75['name']):_0x43cf75[_0x346b('0x29')];return _0x222d1a;});for(var _0x4996ef in _0x261734){if(_0x261734[_0x346b('0x25')](_0x4996ef)){if(!_0x47d8ab[_0x4996ef]){delete _0x261734[_0x4996ef];}}}}function clearVoiceCallReports(_0x5af763){_0x5af763[_0x346b('0x2a')]=0x0;_0x5af763[_0x346b('0x2b')]=0x0;_0x5af763[_0x346b('0x2c')]=0x0;_0x5af763[_0x346b('0x2d')]=0x0;_0x5af763['sumBillable']=0x0;}function clearCampaigns(_0x2d4e29){if(!_[_0x346b('0x2e')](_0x2d4e29)){for(var _0x5b62e5 in _0x2d4e29){if(_0x2d4e29['hasOwnProperty'](_0x5b62e5)){_0x2d4e29[_0x5b62e5][_0x346b('0x2f')]=0x0;_0x2d4e29[_0x5b62e5][_0x346b('0x30')]=0x0;}}}}function clearVoiceQueues(_0x53b3b6){if(!_[_0x346b('0x2e')](_0x53b3b6)){for(var _0x523d7d in _0x53b3b6){if(_0x53b3b6[_0x346b('0x25')](_0x523d7d)){_0x53b3b6[_0x523d7d][_0x346b('0x2a')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x2b')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x31')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x32')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x2c')]=0x0;_0x53b3b6[_0x523d7d]['sumDuration']=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x33')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x34')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x35')]=0x0;_0x53b3b6[_0x523d7d]['outboundBusyCallsDay']=0x0;_0x53b3b6[_0x523d7d]['outboundCongestionCallsDay']=0x0;_0x53b3b6[_0x523d7d]['outboundNoSuchCallsDay']=0x0;_0x53b3b6[_0x523d7d]['outboundUnknownCallsDay']=0x0;_0x53b3b6[_0x523d7d]['outboundDropCallsDayTimeout']=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x36')]=0x0;_0x53b3b6[_0x523d7d]['outboundBlacklistCallsDay']=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x37')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x38')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x39')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x34')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x3a')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x3b')]=!![];}}}}Realtime[_0x346b('0x3c')]['mergeFromDatabase']=function(_0x5baa95,_0xbe772f){for(var _0x140b66 in _0xbe772f){if(_0x5baa95[_0x346b('0x25')](_0x140b66)){_0x5baa95[_0x140b66]=_0xbe772f[_0x140b66];}}};Realtime[_0x346b('0x3c')]['initAgents']=function(){var _0x44a1fa=this;return function(_0x1badc9){if(_0x1badc9){freeIsNotKeyAgent(_0x1badc9,_0x44a1fa['agents']);for(var _0x462dac=0x0,_0xb21d54={},_0x1764f8={};_0x462dac<_0x1badc9['length'];_0x462dac+=0x1){_0xb21d54=_0x1badc9[_0x462dac];var _0x623810=_['isNil'](_0xb21d54[_0x346b('0x29')])?util[_0x346b('0x26')](_0x346b('0x27'),_0xb21d54[_0x346b('0x28')]):_0xb21d54[_0x346b('0x29')];if(_[_0x346b('0x3d')](_0x44a1fa[_0x346b('0x12')][_0x623810])){_0x44a1fa[_0x346b('0x12')][_0x623810]=new Agent(_0xb21d54);}else{_0x44a1fa['mergeFromDatabase'](_0x44a1fa[_0x346b('0x12')][_0x623810],_0xb21d54);}}}return _0x44a1fa['agents'];};};Realtime[_0x346b('0x3c')][_0x346b('0x3e')]=function(){var _0xaf4b5b=this;return function(_0x2d26f9){if(_0x2d26f9){freeIsNotKeySip(_0x2d26f9,_0xaf4b5b[_0x346b('0x13')]);for(var _0x11e44a=0x0,_0x51db43={},_0x1fe5ab={};_0x11e44a<_0x2d26f9[_0x346b('0x3f')];_0x11e44a+=0x1){_0x51db43=_0x2d26f9[_0x11e44a];if(_[_0x346b('0x3d')](_0xaf4b5b['telephones'][util[_0x346b('0x26')]('SIP/%s',_0x51db43['name'])])){_0xaf4b5b[_0x346b('0x13')][util[_0x346b('0x26')](_0x346b('0x27'),_0x51db43['name'])]=new Telephone(_0x51db43);}else{_0xaf4b5b[_0x346b('0x40')](_0xaf4b5b[_0x346b('0x13')][util['format']('SIP/%s',_0x51db43[_0x346b('0x28')])],_0x51db43);}}}return _0xaf4b5b[_0x346b('0x13')];};};Realtime[_0x346b('0x3c')][_0x346b('0x41')]=function(){var _0x517248=this;return function(_0x319283){if(_0x319283){freeIsNotKeySip(_0x319283,_0x517248['trunks']);for(var _0x20487f=0x0,_0x481dd2={},_0x40b198={};_0x20487f<_0x319283[_0x346b('0x3f')];_0x20487f+=0x1){_0x481dd2=_0x319283[_0x20487f];if(_[_0x346b('0x3d')](_0x517248['trunks'][util['format'](_0x346b('0x27'),_0x481dd2['name'])])){_0x517248[_0x346b('0x14')][util['format']('SIP/%s',_0x481dd2['name'])]=new Trunk(_0x481dd2);}else{_0x517248[_0x346b('0x40')](_0x517248['trunks'][util[_0x346b('0x26')](_0x346b('0x27'),_0x481dd2[_0x346b('0x28')])],_0x481dd2);}}}return _0x517248['trunks'];};};Realtime[_0x346b('0x3c')][_0x346b('0x42')]=function(){var _0x2d69c1=this;return function(_0x5b54b9){if(_0x5b54b9){freeIsNotKey(_0x5b54b9,_0x2d69c1[_0x346b('0x15')],_0x346b('0x28'));for(var _0x30c585=0x0,_0x4e05aa={},_0x14b701={};_0x30c585<_0x5b54b9[_0x346b('0x3f')];_0x30c585+=0x1){_0x4e05aa=_0x5b54b9[_0x30c585];if(_['isUndefined'](_0x2d69c1[_0x346b('0x15')][_0x4e05aa[_0x346b('0x28')]])){_0x2d69c1['voiceQueues'][_0x4e05aa['name']]=new VoiceQueue(_0x4e05aa);}else{_0x2d69c1['mergeFromDatabase'](_0x2d69c1['voiceQueues'][_0x4e05aa['name']],_0x4e05aa);}}}return _0x2d69c1['voiceQueues'];};};Realtime['prototype'][_0x346b('0x43')]=function(){var _0x48fc11=this;return function(_0x5501e0){if(_0x5501e0){freeIsNotKey(_0x5501e0,_0x48fc11[_0x346b('0x16')],'id');for(var _0x122c20=0x0,_0x3c7011={},_0x29e8bd={};_0x122c20<_0x5501e0[_0x346b('0x3f')];_0x122c20+=0x1){_0x3c7011=_0x5501e0[_0x122c20];if(_[_0x346b('0x3d')](_0x48fc11[_0x346b('0x16')][_0x3c7011['id']])){_0x48fc11[_0x346b('0x16')][_0x3c7011['id']]=new Trigger(_0x3c7011);}else{_0x48fc11['mergeFromDatabase'](_0x48fc11[_0x346b('0x16')][_0x3c7011['id']],_0x3c7011);}}}return _0x48fc11[_0x346b('0x16')];};};Realtime[_0x346b('0x3c')]['initTemplates']=function(){var _0x5c6054=this;return function(_0x4f84be){if(_0x4f84be){freeIsNotKey(_0x4f84be,_0x5c6054[_0x346b('0x17')],'id');for(var _0x3c62fc=0x0,_0x52b83c={},_0x2fa5e8={};_0x3c62fc<_0x4f84be[_0x346b('0x3f')];_0x3c62fc+=0x1){_0x52b83c=_0x4f84be[_0x3c62fc];if(_[_0x346b('0x3d')](_0x5c6054[_0x346b('0x17')][_0x52b83c['id']])){_0x5c6054[_0x346b('0x17')][_0x52b83c['id']]=new Template(_0x52b83c);}else{_0x5c6054[_0x346b('0x40')](_0x5c6054[_0x346b('0x17')][_0x52b83c['id']],_0x52b83c);}}}return _0x5c6054[_0x346b('0x17')];};};Realtime[_0x346b('0x3c')][_0x346b('0x44')]=function(){var _0x26b320=this;return function(_0x47af04){if(_0x47af04){freeIsNotKey(_0x47af04,_0x26b320[_0x346b('0x1c')],'id');for(var _0xcecc1b=0x0,_0x25c1b5={},_0x3fd47d={};_0xcecc1b<_0x47af04[_0x346b('0x3f')];_0xcecc1b+=0x1){_0x25c1b5=_0x47af04[_0xcecc1b];if(_[_0x346b('0x3d')](_0x26b320[_0x346b('0x1c')][_0x25c1b5['id']])){_0x26b320[_0x346b('0x1c')][_0x25c1b5['id']]=new ZendeskAccount(_0x25c1b5);}else{_0x26b320[_0x346b('0x40')](_0x26b320['zendeskAccounts'][_0x25c1b5['id']],_0x25c1b5);}}}return _0x26b320['zendeskAccounts'];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x332548=this;return function(_0x2c9790){if(_0x2c9790){freeIsNotKey(_0x2c9790,_0x332548[_0x346b('0x45')],'id');for(var _0x407dcf=0x0,_0x3f56a7={},_0x2581ff={};_0x407dcf<_0x2c9790[_0x346b('0x3f')];_0x407dcf+=0x1){_0x3f56a7=_0x2c9790[_0x407dcf];if(_[_0x346b('0x3d')](_0x332548[_0x346b('0x45')][_0x3f56a7['id']])){_0x332548[_0x346b('0x45')][_0x3f56a7['id']]=new SalesforceAccount(_0x3f56a7);}else{_0x332548[_0x346b('0x40')](_0x332548[_0x346b('0x45')][_0x3f56a7['id']],_0x3f56a7);}}}return _0x332548[_0x346b('0x45')];};};Realtime[_0x346b('0x3c')][_0x346b('0x46')]=function(){var _0x126164=this;return function(_0x32831c){if(_0x32831c){freeIsNotKey(_0x32831c,_0x126164['freshdeskAccounts'],'id');for(var _0x5bb2ed=0x0,_0x446b4e={},_0x54ed0a={};_0x5bb2ed<_0x32831c[_0x346b('0x3f')];_0x5bb2ed+=0x1){_0x446b4e=_0x32831c[_0x5bb2ed];if(_['isUndefined'](_0x126164[_0x346b('0x1d')][_0x446b4e['id']])){_0x126164[_0x346b('0x1d')][_0x446b4e['id']]=new FreshdeskAccount(_0x446b4e);}else{_0x126164[_0x346b('0x40')](_0x126164[_0x346b('0x1d')][_0x446b4e['id']],_0x446b4e);}}}return _0x126164[_0x346b('0x1d')];};};Realtime[_0x346b('0x3c')][_0x346b('0x47')]=function(){var _0xc1bde=this;return function(_0x7891ee){if(_0x7891ee){freeIsNotKey(_0x7891ee,_0xc1bde[_0x346b('0x1e')],'id');for(var _0x3011bc=0x0,_0x2765ae={},_0x83dd8f={};_0x3011bc<_0x7891ee[_0x346b('0x3f')];_0x3011bc+=0x1){_0x2765ae=_0x7891ee[_0x3011bc];if(_['isUndefined'](_0xc1bde[_0x346b('0x1e')][_0x2765ae['id']])){_0xc1bde['zohoAccounts'][_0x2765ae['id']]=new ZohoAccount(_0x2765ae);}else{_0xc1bde[_0x346b('0x40')](_0xc1bde[_0x346b('0x1e')][_0x2765ae['id']],_0x2765ae);}}}return _0xc1bde[_0x346b('0x1e')];};};Realtime[_0x346b('0x3c')][_0x346b('0x48')]=function(){var _0x2ea4cd=this;return function(_0x414ce4){if(_0x414ce4){freeIsNotKey(_0x414ce4,_0x2ea4cd['deskAccounts'],'id');for(var _0x28f325=0x0,_0x39b9f2={},_0x76ac3f={};_0x28f325<_0x414ce4['length'];_0x28f325+=0x1){_0x39b9f2=_0x414ce4[_0x28f325];if(_['isUndefined'](_0x2ea4cd['deskAccounts'][_0x39b9f2['id']])){_0x2ea4cd['deskAccounts'][_0x39b9f2['id']]=new DeskAccount(_0x39b9f2);}else{_0x2ea4cd[_0x346b('0x40')](_0x2ea4cd[_0x346b('0x1f')][_0x39b9f2['id']],_0x39b9f2);}}}return _0x2ea4cd[_0x346b('0x1f')];};};Realtime[_0x346b('0x3c')][_0x346b('0x49')]=function(){var _0x30b0d5=this;return function(_0x55b2e4){if(_0x55b2e4){freeIsNotKey(_0x55b2e4,_0x30b0d5[_0x346b('0x4a')],'id');for(var _0x42bf5e=0x0,_0x26584a={},_0x31d005={};_0x42bf5e<_0x55b2e4['length'];_0x42bf5e+=0x1){_0x26584a=_0x55b2e4[_0x42bf5e];if(_[_0x346b('0x3d')](_0x30b0d5[_0x346b('0x4a')][_0x26584a['id']])){_0x30b0d5[_0x346b('0x4a')][_0x26584a['id']]=new SugarcrmAccount(_0x26584a);}else{_0x30b0d5['mergeFromDatabase'](_0x30b0d5[_0x346b('0x4a')][_0x26584a['id']],_0x26584a);}}}return _0x30b0d5[_0x346b('0x4a')];};};Realtime['prototype'][_0x346b('0x4b')]=function(){var _0x1da1f4=this;return function(_0x148425){if(_0x148425){freeIsNotKey(_0x148425,_0x1da1f4[_0x346b('0x20')],'id');for(var _0x2e5db5=0x0,_0xc97c92={},_0x590c1a={};_0x2e5db5<_0x148425[_0x346b('0x3f')];_0x2e5db5+=0x1){_0xc97c92=_0x148425[_0x2e5db5];if(_[_0x346b('0x3d')](_0x1da1f4[_0x346b('0x20')][_0xc97c92['id']])){_0x1da1f4[_0x346b('0x20')][_0xc97c92['id']]=new VtigerAccount(_0xc97c92);}else{_0x1da1f4[_0x346b('0x40')](_0x1da1f4[_0x346b('0x20')][_0xc97c92['id']],_0xc97c92);}}}return _0x1da1f4[_0x346b('0x20')];};};Realtime[_0x346b('0x3c')]['initServicenowAccounts']=function(){var _0x52c15a=this;return function(_0xe49d7f){if(_0xe49d7f){freeIsNotKey(_0xe49d7f,_0x52c15a[_0x346b('0x21')],'id');for(var _0x537f6b=0x0,_0x181283={},_0x26dde8={};_0x537f6b<_0xe49d7f['length'];_0x537f6b+=0x1){_0x181283=_0xe49d7f[_0x537f6b];if(_[_0x346b('0x3d')](_0x52c15a['servicenowAccounts'][_0x181283['id']])){_0x52c15a['servicenowAccounts'][_0x181283['id']]=new ServicenowAccount(_0x181283);}else{_0x52c15a[_0x346b('0x40')](_0x52c15a[_0x346b('0x21')][_0x181283['id']],_0x181283);}}}return _0x52c15a['servicenowAccounts'];};};Realtime[_0x346b('0x3c')][_0x346b('0x4c')]=function(){var _0x33fd58=this;return function(_0x568718){if(_0x568718){freeIsNotKey(_0x568718,_0x33fd58[_0x346b('0x22')],'id');for(var _0x197b14=0x0,_0x490b35={},_0x2f617f={};_0x197b14<_0x568718[_0x346b('0x3f')];_0x197b14+=0x1){_0x490b35=_0x568718[_0x197b14];if(_[_0x346b('0x3d')](_0x33fd58[_0x346b('0x22')][_0x490b35['id']])){_0x33fd58[_0x346b('0x22')][_0x490b35['id']]=new Dynamics365Account(_0x490b35);}else{_0x33fd58[_0x346b('0x40')](_0x33fd58[_0x346b('0x22')][_0x490b35['id']],_0x490b35);}}}return _0x33fd58[_0x346b('0x22')];};};Realtime['prototype'][_0x346b('0x4d')]=function(){var _0x25d378=this;return function(_0x467681){for(var _0x5a23e8=0x0;_0x5a23e8<_0x467681[_0x346b('0x3f')];_0x5a23e8+=0x1){_[_0x346b('0x4e')](_0x25d378[_0x346b('0x15')][_0x467681[_0x5a23e8]['name']],_0x467681[_0x5a23e8]);}return _0x25d378['voiceQueues'];};};Realtime[_0x346b('0x3c')][_0x346b('0x4f')]=function(){var _0x3498a4=this;return function(_0x20def4){clearVoiceQueues(_0x3498a4[_0x346b('0x15')]);if(_0x20def4){_0x20def4=_[_0x346b('0x50')](_0x20def4,'uniqueid');for(var _0x145c54 in _0x20def4){if(_0x20def4[_0x346b('0x25')](_0x145c54)){var _0x200d46={};for(var _0x30f1b6=0x0;_0x30f1b6<_0x20def4[_0x145c54][_0x346b('0x3f')];_0x30f1b6+=0x1){var _0x5ce969=_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x51')];if(_0x3498a4[_0x346b('0x15')][_0x5ce969]){if(_0x20def4[_0x145c54][_0x30f1b6]['queuecallerexit']){_0x3498a4['voiceQueues'][_0x5ce969]['unmanaged']+=0x1;}if(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x52')]){_0x3498a4['voiceQueues'][_0x5ce969][_0x346b('0x32')]+=0x1;}_0x3498a4[_0x346b('0x15')][_0x5ce969]['sumHoldTime']+=moment(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x53')])['diff'](moment(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x54')]),_0x346b('0x55'))||0x0;if(_0x30f1b6===_0x20def4[_0x145c54]['length']-0x1){_0x3498a4[_0x346b('0x15')][_0x5ce969][_0x346b('0x2d')]+=moment(_0x20def4[_0x145c54][_0x30f1b6]['queuecallercompleteAt']||_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x56')]||_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x57')])['diff'](moment(_0x20def4[_0x145c54][_0x30f1b6]['queuecallerjoinAt']),_0x346b('0x55'))||0x0;_0x3498a4[_0x346b('0x15')][_0x5ce969][_0x346b('0x2a')]+=0x1;if(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x58')]){_0x3498a4[_0x346b('0x15')][_0x5ce969]['answered']+=0x1;_0x3498a4[_0x346b('0x15')][_0x5ce969][_0x346b('0x33')]+=moment(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x59')])[_0x346b('0x5a')](moment(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x53')]),'seconds')||0x0;}}else{_0x3498a4[_0x346b('0x15')][_0x5ce969][_0x346b('0x2d')]+=_0x3498a4[_0x346b('0x15')][_0x5ce969]['sumHoldTime']||0x0;}}}}}}return _0x3498a4['voiceQueues'];};};Realtime['prototype'][_0x346b('0x5b')]=function(){var _0x17c1ec=this;return function(_0x1b8619){clearVoiceCallReports(_0x17c1ec[_0x346b('0x18')]);if(_0x1b8619){for(var _0x390d6c=0x0;_0x390d6c<_0x1b8619[_0x346b('0x3f')];_0x390d6c+=0x1){_0x17c1ec['outbound'][_0x346b('0x2a')]+=0x1;_0x17c1ec[_0x346b('0x18')][_0x346b('0x2d')]+=_0x1b8619[_0x390d6c][_0x346b('0x5c')];if(_0x1b8619[_0x390d6c]['disposition']===_0x346b('0x5d')){_0x17c1ec['outbound'][_0x346b('0x2b')]+=0x1;_0x17c1ec[_0x346b('0x18')][_0x346b('0x2c')]+=_0x1b8619[_0x390d6c]['duration']-_0x1b8619[_0x390d6c]['billableseconds']||0x0;_0x17c1ec['outbound'][_0x346b('0x33')]+=_0x1b8619[_0x390d6c][_0x346b('0x5e')];}}}return _0x17c1ec[_0x346b('0x18')];};};Realtime[_0x346b('0x3c')]['initCampaigns']=function(){var _0xc241f4=this;return function(_0x2d281d){if(_0x2d281d){freeIsNotKey(_0x2d281d,_0xc241f4['campaigns'],_0x346b('0x28'));for(var _0x778aa=0x0,_0x2625d5={};_0x778aa<_0x2d281d['length'];_0x778aa+=0x1){_0x2625d5=_0x2d281d[_0x778aa];if(_[_0x346b('0x3d')](_0xc241f4[_0x346b('0x5f')][_0x2625d5[_0x346b('0x28')]])){_0xc241f4[_0x346b('0x5f')][_0x2625d5['name']]=new Campaign(_0x2625d5);}else{_0xc241f4[_0x346b('0x40')](_0xc241f4['campaigns'][_0x2625d5[_0x346b('0x28')]],_0x2625d5);}}}return _0xc241f4[_0x346b('0x5f')];};};Realtime[_0x346b('0x3c')]['initVoiceExtensions']=function(){var _0x596102=this;return function(_0x459219){if(_0x459219){freeIsNotKey(_0x459219,_0x596102['voiceExtensions'],'id');for(var _0x56eedd=0x0,_0x584d83={};_0x56eedd<_0x459219[_0x346b('0x3f')];_0x56eedd+=0x1){_0x584d83=_0x459219[_0x56eedd];if(_[_0x346b('0x3d')](_0x596102[_0x346b('0x60')][_0x584d83['id']])){_0x596102[_0x346b('0x60')][_0x584d83['id']]=new VoiceExtension(_0x584d83);}else{_0x596102[_0x346b('0x40')](_0x596102[_0x346b('0x60')][_0x584d83['id']],_0x584d83);}}}return _0x596102[_0x346b('0x60')];};};Realtime[_0x346b('0x3c')][_0x346b('0x61')]=function(){var _0x29560a=this;return function(_0x5b94cd){clearCampaigns(_0x29560a[_0x346b('0x5f')]);for(var _0x3249dc=0x0;_0x3249dc<_0x5b94cd[_0x346b('0x3f')];_0x3249dc+=0x1){_[_0x346b('0x4e')](_0x29560a[_0x346b('0x5f')][_0x5b94cd[_0x3249dc][_0x346b('0x28')]],_0x5b94cd[_0x3249dc]);}return _0x29560a[_0x346b('0x5f')];};};Realtime[_0x346b('0x3c')][_0x346b('0x62')]=function(){var _0x4f4a1e=this;return function(_0x553faa){if(_0x553faa){freeIsNotKey(_0x553faa,_0x4f4a1e[_0x346b('0x23')],'id');for(var _0x983053=0x0,_0x24ceb4={},_0x402576={};_0x983053<_0x553faa[_0x346b('0x3f')];_0x983053+=0x1){_0x24ceb4=_0x553faa[_0x983053];if(_[_0x346b('0x3d')](_0x4f4a1e[_0x346b('0x23')][_0x24ceb4['id']])){_0x4f4a1e[_0x346b('0x23')][_0x24ceb4['id']]=new FaxAccount(_0x24ceb4);}else{_0x4f4a1e['mergeFromDatabase'](_0x4f4a1e[_0x346b('0x23')][_0x24ceb4['id']],_0x24ceb4);}}}return _0x4f4a1e[_0x346b('0x23')];};};module[_0x346b('0x63')]=Realtime;
\ No newline at end of file
+var _0x481a=['campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','hasOwnProperty','mapKeys','SIP/%s','name','isNil','format','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','initTelephones','initTrunks','isUndefined','initVoiceQueues','voiceQueues','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','sumDuration','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','faxAccounts','bluebird','util','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','agents','telephones','trunks','triggers'];(function(_0x119ad8,_0x739086){var _0x2bf6e=function(_0xc81774){while(--_0xc81774){_0x119ad8['push'](_0x119ad8['shift']());}};_0x2bf6e(++_0x739086);}(_0x481a,0xbb));var _0xa481=function(_0x226abc,_0xd2207b){_0x226abc=_0x226abc-0x0;var _0x46139a=_0x481a[_0x226abc];return _0x46139a;};'use strict';var BPromise=require(_0xa481('0x0'));var util=require(_0xa481('0x1'));var _=require(_0xa481('0x2'));var moment=require(_0xa481('0x3'));var Agent=require(_0xa481('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0xa481('0x5'));var VoiceQueue=require(_0xa481('0x6'));var Trigger=require(_0xa481('0x7'));var Template=require(_0xa481('0x8'));var Campaign=require(_0xa481('0x9'));var VoiceExtension=require(_0xa481('0xa'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xa481('0xb'));var FreshdeskAccount=require(_0xa481('0xc'));var SugarcrmAccount=require(_0xa481('0xd'));var ZohoAccount=require(_0xa481('0xe'));var DeskAccount=require(_0xa481('0xf'));var VtigerAccount=require(_0xa481('0x10'));var ServicenowAccount=require(_0xa481('0x11'));var Dynamics365Account=require(_0xa481('0x12'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xa481('0x13')]={};this[_0xa481('0x14')]={};this[_0xa481('0x15')]={};this['voiceQueues']={};this[_0xa481('0x16')]={};this[_0xa481('0x17')]={};this[_0xa481('0x18')]={};this[_0xa481('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xa481('0x1a')]={};this[_0xa481('0x1b')]={};this[_0xa481('0x1c')]={};this[_0xa481('0x1d')]={};this[_0xa481('0x1e')]={};this['zendeskAccounts']={};this[_0xa481('0x1f')]={};this['sugarcrmAccounts']={};this[_0xa481('0x20')]={};this[_0xa481('0x21')]={};this[_0xa481('0x22')]={};this[_0xa481('0x23')]={};this[_0xa481('0x24')]={};this['dynamics365Accounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x57eda0,_0x2b81a5,_0x8cb3c){var _0x3bad6a=_['mapKeys'](_0x57eda0,function(_0x1ba2cf,_0x5b7b5d){return _0x1ba2cf[_0x8cb3c];});for(var _0x23c047 in _0x2b81a5){if(_0x2b81a5[_0xa481('0x25')](_0x23c047)){if(!_0x3bad6a[_0x23c047]){delete _0x2b81a5[_0x23c047];}}}}function freeIsNotKeySip(_0x2d220d,_0x53765a){var _0xd3b8f0=_[_0xa481('0x26')](_0x2d220d,function(_0x46f27d,_0xb77b17){return util['format'](_0xa481('0x27'),_0x46f27d[_0xa481('0x28')]);});for(var _0x106e1d in _0x53765a){if(_0x53765a[_0xa481('0x25')](_0x106e1d)){if(!_0xd3b8f0[_0x106e1d]){delete _0x53765a[_0x106e1d];}}}}function freeIsNotKeyAgent(_0x319f61,_0x16b910){var _0x5a5bee=_[_0xa481('0x26')](_0x319f61,function(_0x1f07d2,_0x1f4bb4){var _0x3b0a0d=_[_0xa481('0x29')](_0x1f07d2['interface'])?util[_0xa481('0x2a')](_0xa481('0x27'),_0x1f07d2['name']):_0x1f07d2[_0xa481('0x2b')];return _0x3b0a0d;});for(var _0x6170ad in _0x16b910){if(_0x16b910['hasOwnProperty'](_0x6170ad)){if(!_0x5a5bee[_0x6170ad]){delete _0x16b910[_0x6170ad];}}}}function clearVoiceCallReports(_0x16e762){_0x16e762[_0xa481('0x2c')]=0x0;_0x16e762[_0xa481('0x2d')]=0x0;_0x16e762[_0xa481('0x2e')]=0x0;_0x16e762['sumDuration']=0x0;_0x16e762[_0xa481('0x2f')]=0x0;}function clearCampaigns(_0x206613){if(!_[_0xa481('0x30')](_0x206613)){for(var _0x2e1845 in _0x206613){if(_0x206613[_0xa481('0x25')](_0x2e1845)){_0x206613[_0x2e1845]['ivrTotalCallsDays']=0x0;_0x206613[_0x2e1845][_0xa481('0x31')]=0x0;}}}}function clearVoiceQueues(_0x311ed2){if(!_[_0xa481('0x30')](_0x311ed2)){for(var _0x3bb01d in _0x311ed2){if(_0x311ed2['hasOwnProperty'](_0x3bb01d)){_0x311ed2[_0x3bb01d][_0xa481('0x2c')]=0x0;_0x311ed2[_0x3bb01d]['answered']=0x0;_0x311ed2[_0x3bb01d][_0xa481('0x32')]=0x0;_0x311ed2[_0x3bb01d]['abandoned']=0x0;_0x311ed2[_0x3bb01d][_0xa481('0x2e')]=0x0;_0x311ed2[_0x3bb01d]['sumDuration']=0x0;_0x311ed2[_0x3bb01d][_0xa481('0x2f')]=0x0;_0x311ed2[_0x3bb01d]['outboundAnswerAgiCallsDay']=0x0;_0x311ed2[_0x3bb01d]['outboundNoAnswerCallsDay']=0x0;_0x311ed2[_0x3bb01d][_0xa481('0x33')]=0x0;_0x311ed2[_0x3bb01d]['outboundCongestionCallsDay']=0x0;_0x311ed2[_0x3bb01d][_0xa481('0x34')]=0x0;_0x311ed2[_0x3bb01d][_0xa481('0x35')]=0x0;_0x311ed2[_0x3bb01d]['outboundDropCallsDayTimeout']=0x0;_0x311ed2[_0x3bb01d]['outboundDropCallsDayCallersExit']=0x0;_0x311ed2[_0x3bb01d]['outboundBlacklistCallsDay']=0x0;_0x311ed2[_0x3bb01d][_0xa481('0x36')]=0x0;_0x311ed2[_0x3bb01d][_0xa481('0x37')]=0x0;_0x311ed2[_0x3bb01d][_0xa481('0x38')]=0x0;_0x311ed2[_0x3bb01d][_0xa481('0x39')]=0x0;_0x311ed2[_0x3bb01d]['outboundAnswerCallsDay']=0x0;_0x311ed2[_0x3bb01d][_0xa481('0x3a')]=!![];}}}}Realtime['prototype'][_0xa481('0x3b')]=function(_0xbc1efb,_0x47ec21){for(var _0x525944 in _0x47ec21){if(_0xbc1efb[_0xa481('0x25')](_0x525944)){_0xbc1efb[_0x525944]=_0x47ec21[_0x525944];}}};Realtime[_0xa481('0x3c')][_0xa481('0x3d')]=function(){var _0x249ce9=this;return function(_0x3c5ee6){if(_0x3c5ee6){freeIsNotKeyAgent(_0x3c5ee6,_0x249ce9[_0xa481('0x13')]);for(var _0x638e05=0x0,_0x4f467e={},_0x7ae25d={};_0x638e05<_0x3c5ee6[_0xa481('0x3e')];_0x638e05+=0x1){_0x4f467e=_0x3c5ee6[_0x638e05];var _0x198981=_[_0xa481('0x29')](_0x4f467e[_0xa481('0x2b')])?util[_0xa481('0x2a')](_0xa481('0x27'),_0x4f467e[_0xa481('0x28')]):_0x4f467e[_0xa481('0x2b')];if(_['isUndefined'](_0x249ce9[_0xa481('0x13')][_0x198981])){_0x249ce9[_0xa481('0x13')][_0x198981]=new Agent(_0x4f467e);}else{_0x249ce9[_0xa481('0x3b')](_0x249ce9['agents'][_0x198981],_0x4f467e);}}}return _0x249ce9[_0xa481('0x13')];};};Realtime[_0xa481('0x3c')][_0xa481('0x3f')]=function(){var _0x54f5d2=this;return function(_0xee2276){if(_0xee2276){freeIsNotKeySip(_0xee2276,_0x54f5d2[_0xa481('0x14')]);for(var _0x3325c5=0x0,_0x44e8bc={},_0x160c67={};_0x3325c5<_0xee2276[_0xa481('0x3e')];_0x3325c5+=0x1){_0x44e8bc=_0xee2276[_0x3325c5];if(_['isUndefined'](_0x54f5d2[_0xa481('0x14')][util[_0xa481('0x2a')](_0xa481('0x27'),_0x44e8bc['name'])])){_0x54f5d2['telephones'][util[_0xa481('0x2a')](_0xa481('0x27'),_0x44e8bc[_0xa481('0x28')])]=new Telephone(_0x44e8bc);}else{_0x54f5d2[_0xa481('0x3b')](_0x54f5d2[_0xa481('0x14')][util[_0xa481('0x2a')]('SIP/%s',_0x44e8bc[_0xa481('0x28')])],_0x44e8bc);}}}return _0x54f5d2[_0xa481('0x14')];};};Realtime[_0xa481('0x3c')][_0xa481('0x40')]=function(){var _0x56cd3d=this;return function(_0x55c27d){if(_0x55c27d){freeIsNotKeySip(_0x55c27d,_0x56cd3d[_0xa481('0x15')]);for(var _0x2b2711=0x0,_0x1f1d66={},_0x122d26={};_0x2b2711<_0x55c27d[_0xa481('0x3e')];_0x2b2711+=0x1){_0x1f1d66=_0x55c27d[_0x2b2711];if(_[_0xa481('0x41')](_0x56cd3d[_0xa481('0x15')][util[_0xa481('0x2a')](_0xa481('0x27'),_0x1f1d66[_0xa481('0x28')])])){_0x56cd3d[_0xa481('0x15')][util[_0xa481('0x2a')](_0xa481('0x27'),_0x1f1d66['name'])]=new Trunk(_0x1f1d66);}else{_0x56cd3d[_0xa481('0x3b')](_0x56cd3d['trunks'][util[_0xa481('0x2a')](_0xa481('0x27'),_0x1f1d66['name'])],_0x1f1d66);}}}return _0x56cd3d['trunks'];};};Realtime[_0xa481('0x3c')][_0xa481('0x42')]=function(){var _0x566785=this;return function(_0x2a507a){if(_0x2a507a){freeIsNotKey(_0x2a507a,_0x566785[_0xa481('0x43')],_0xa481('0x28'));for(var _0x386792=0x0,_0x4a2d74={},_0x28186a={};_0x386792<_0x2a507a[_0xa481('0x3e')];_0x386792+=0x1){_0x4a2d74=_0x2a507a[_0x386792];if(_[_0xa481('0x41')](_0x566785['voiceQueues'][_0x4a2d74[_0xa481('0x28')]])){_0x566785[_0xa481('0x43')][_0x4a2d74[_0xa481('0x28')]]=new VoiceQueue(_0x4a2d74);}else{_0x566785[_0xa481('0x3b')](_0x566785[_0xa481('0x43')][_0x4a2d74[_0xa481('0x28')]],_0x4a2d74);}}}return _0x566785[_0xa481('0x43')];};};Realtime[_0xa481('0x3c')]['initTriggers']=function(){var _0x4d6f58=this;return function(_0x480d44){if(_0x480d44){freeIsNotKey(_0x480d44,_0x4d6f58[_0xa481('0x16')],'id');for(var _0x28c159=0x0,_0x391c67={},_0x1f49ef={};_0x28c159<_0x480d44[_0xa481('0x3e')];_0x28c159+=0x1){_0x391c67=_0x480d44[_0x28c159];if(_[_0xa481('0x41')](_0x4d6f58['triggers'][_0x391c67['id']])){_0x4d6f58['triggers'][_0x391c67['id']]=new Trigger(_0x391c67);}else{_0x4d6f58[_0xa481('0x3b')](_0x4d6f58['triggers'][_0x391c67['id']],_0x391c67);}}}return _0x4d6f58[_0xa481('0x16')];};};Realtime['prototype']['initTemplates']=function(){var _0x46cc51=this;return function(_0x258e62){if(_0x258e62){freeIsNotKey(_0x258e62,_0x46cc51[_0xa481('0x18')],'id');for(var _0x49e0fb=0x0,_0x386b11={},_0x423dcf={};_0x49e0fb<_0x258e62['length'];_0x49e0fb+=0x1){_0x386b11=_0x258e62[_0x49e0fb];if(_[_0xa481('0x41')](_0x46cc51[_0xa481('0x18')][_0x386b11['id']])){_0x46cc51[_0xa481('0x18')][_0x386b11['id']]=new Template(_0x386b11);}else{_0x46cc51[_0xa481('0x3b')](_0x46cc51['templates'][_0x386b11['id']],_0x386b11);}}}return _0x46cc51[_0xa481('0x18')];};};Realtime[_0xa481('0x3c')][_0xa481('0x44')]=function(){var _0x123414=this;return function(_0x1c6fb7){if(_0x1c6fb7){freeIsNotKey(_0x1c6fb7,_0x123414[_0xa481('0x45')],'id');for(var _0x13e25e=0x0,_0xf72ad5={},_0x4f472c={};_0x13e25e<_0x1c6fb7[_0xa481('0x3e')];_0x13e25e+=0x1){_0xf72ad5=_0x1c6fb7[_0x13e25e];if(_[_0xa481('0x41')](_0x123414[_0xa481('0x45')][_0xf72ad5['id']])){_0x123414[_0xa481('0x45')][_0xf72ad5['id']]=new ZendeskAccount(_0xf72ad5);}else{_0x123414[_0xa481('0x3b')](_0x123414[_0xa481('0x45')][_0xf72ad5['id']],_0xf72ad5);}}}return _0x123414['zendeskAccounts'];};};Realtime['prototype'][_0xa481('0x46')]=function(){var _0x1c8bb5=this;return function(_0x664722){if(_0x664722){freeIsNotKey(_0x664722,_0x1c8bb5[_0xa481('0x1f')],'id');for(var _0x218fe7=0x0,_0x5292e3={},_0x589dba={};_0x218fe7<_0x664722[_0xa481('0x3e')];_0x218fe7+=0x1){_0x5292e3=_0x664722[_0x218fe7];if(_[_0xa481('0x41')](_0x1c8bb5['salesforceAccounts'][_0x5292e3['id']])){_0x1c8bb5['salesforceAccounts'][_0x5292e3['id']]=new SalesforceAccount(_0x5292e3);}else{_0x1c8bb5[_0xa481('0x3b')](_0x1c8bb5[_0xa481('0x1f')][_0x5292e3['id']],_0x5292e3);}}}return _0x1c8bb5[_0xa481('0x1f')];};};Realtime[_0xa481('0x3c')]['initFreshdeskAccounts']=function(){var _0x2c3f10=this;return function(_0x598a2f){if(_0x598a2f){freeIsNotKey(_0x598a2f,_0x2c3f10[_0xa481('0x20')],'id');for(var _0x4fa344=0x0,_0xfc5273={},_0xd307a7={};_0x4fa344<_0x598a2f[_0xa481('0x3e')];_0x4fa344+=0x1){_0xfc5273=_0x598a2f[_0x4fa344];if(_[_0xa481('0x41')](_0x2c3f10[_0xa481('0x20')][_0xfc5273['id']])){_0x2c3f10[_0xa481('0x20')][_0xfc5273['id']]=new FreshdeskAccount(_0xfc5273);}else{_0x2c3f10[_0xa481('0x3b')](_0x2c3f10['freshdeskAccounts'][_0xfc5273['id']],_0xfc5273);}}}return _0x2c3f10[_0xa481('0x20')];};};Realtime[_0xa481('0x3c')][_0xa481('0x47')]=function(){var _0x37c267=this;return function(_0x1c0112){if(_0x1c0112){freeIsNotKey(_0x1c0112,_0x37c267[_0xa481('0x21')],'id');for(var _0xc4c8a9=0x0,_0x24a2e4={},_0xdd7ffb={};_0xc4c8a9<_0x1c0112[_0xa481('0x3e')];_0xc4c8a9+=0x1){_0x24a2e4=_0x1c0112[_0xc4c8a9];if(_['isUndefined'](_0x37c267['zohoAccounts'][_0x24a2e4['id']])){_0x37c267['zohoAccounts'][_0x24a2e4['id']]=new ZohoAccount(_0x24a2e4);}else{_0x37c267[_0xa481('0x3b')](_0x37c267[_0xa481('0x21')][_0x24a2e4['id']],_0x24a2e4);}}}return _0x37c267[_0xa481('0x21')];};};Realtime['prototype'][_0xa481('0x48')]=function(){var _0xbdd6a2=this;return function(_0x556dce){if(_0x556dce){freeIsNotKey(_0x556dce,_0xbdd6a2[_0xa481('0x22')],'id');for(var _0x2a8869=0x0,_0x1c34ea={},_0x113a7d={};_0x2a8869<_0x556dce[_0xa481('0x3e')];_0x2a8869+=0x1){_0x1c34ea=_0x556dce[_0x2a8869];if(_['isUndefined'](_0xbdd6a2['deskAccounts'][_0x1c34ea['id']])){_0xbdd6a2[_0xa481('0x22')][_0x1c34ea['id']]=new DeskAccount(_0x1c34ea);}else{_0xbdd6a2[_0xa481('0x3b')](_0xbdd6a2[_0xa481('0x22')][_0x1c34ea['id']],_0x1c34ea);}}}return _0xbdd6a2[_0xa481('0x22')];};};Realtime[_0xa481('0x3c')][_0xa481('0x49')]=function(){var _0x38e78c=this;return function(_0x1f5cdc){if(_0x1f5cdc){freeIsNotKey(_0x1f5cdc,_0x38e78c['sugarcrmAccounts'],'id');for(var _0x2bff0d=0x0,_0x28f0b8={},_0x36558f={};_0x2bff0d<_0x1f5cdc[_0xa481('0x3e')];_0x2bff0d+=0x1){_0x28f0b8=_0x1f5cdc[_0x2bff0d];if(_[_0xa481('0x41')](_0x38e78c[_0xa481('0x4a')][_0x28f0b8['id']])){_0x38e78c[_0xa481('0x4a')][_0x28f0b8['id']]=new SugarcrmAccount(_0x28f0b8);}else{_0x38e78c['mergeFromDatabase'](_0x38e78c[_0xa481('0x4a')][_0x28f0b8['id']],_0x28f0b8);}}}return _0x38e78c[_0xa481('0x4a')];};};Realtime[_0xa481('0x3c')][_0xa481('0x4b')]=function(){var _0x4a1085=this;return function(_0x13ee8a){if(_0x13ee8a){freeIsNotKey(_0x13ee8a,_0x4a1085[_0xa481('0x23')],'id');for(var _0x295f2c=0x0,_0x5e7f9c={},_0x50aa14={};_0x295f2c<_0x13ee8a[_0xa481('0x3e')];_0x295f2c+=0x1){_0x5e7f9c=_0x13ee8a[_0x295f2c];if(_['isUndefined'](_0x4a1085[_0xa481('0x23')][_0x5e7f9c['id']])){_0x4a1085['vtigerAccounts'][_0x5e7f9c['id']]=new VtigerAccount(_0x5e7f9c);}else{_0x4a1085[_0xa481('0x3b')](_0x4a1085[_0xa481('0x23')][_0x5e7f9c['id']],_0x5e7f9c);}}}return _0x4a1085['vtigerAccounts'];};};Realtime[_0xa481('0x3c')][_0xa481('0x4c')]=function(){var _0xd0e44e=this;return function(_0xa8116e){if(_0xa8116e){freeIsNotKey(_0xa8116e,_0xd0e44e[_0xa481('0x24')],'id');for(var _0x2e5433=0x0,_0x3ee6af={},_0x31ab04={};_0x2e5433<_0xa8116e['length'];_0x2e5433+=0x1){_0x3ee6af=_0xa8116e[_0x2e5433];if(_[_0xa481('0x41')](_0xd0e44e[_0xa481('0x24')][_0x3ee6af['id']])){_0xd0e44e['servicenowAccounts'][_0x3ee6af['id']]=new ServicenowAccount(_0x3ee6af);}else{_0xd0e44e['mergeFromDatabase'](_0xd0e44e[_0xa481('0x24')][_0x3ee6af['id']],_0x3ee6af);}}}return _0xd0e44e[_0xa481('0x24')];};};Realtime[_0xa481('0x3c')][_0xa481('0x4d')]=function(){var _0x312d4f=this;return function(_0x53f172){if(_0x53f172){freeIsNotKey(_0x53f172,_0x312d4f[_0xa481('0x4e')],'id');for(var _0x513974=0x0,_0xb3b4f7={},_0x321d86={};_0x513974<_0x53f172[_0xa481('0x3e')];_0x513974+=0x1){_0xb3b4f7=_0x53f172[_0x513974];if(_[_0xa481('0x41')](_0x312d4f[_0xa481('0x4e')][_0xb3b4f7['id']])){_0x312d4f[_0xa481('0x4e')][_0xb3b4f7['id']]=new Dynamics365Account(_0xb3b4f7);}else{_0x312d4f[_0xa481('0x3b')](_0x312d4f[_0xa481('0x4e')][_0xb3b4f7['id']],_0xb3b4f7);}}}return _0x312d4f[_0xa481('0x4e')];};};Realtime[_0xa481('0x3c')][_0xa481('0x4f')]=function(){var _0x274762=this;return function(_0x3d886e){for(var _0x4cc590=0x0;_0x4cc590<_0x3d886e['length'];_0x4cc590+=0x1){_['merge'](_0x274762[_0xa481('0x43')][_0x3d886e[_0x4cc590][_0xa481('0x28')]],_0x3d886e[_0x4cc590]);}return _0x274762['voiceQueues'];};};Realtime[_0xa481('0x3c')]['initVoiceQueueReports']=function(){var _0x2ea311=this;return function(_0x2faa9d){clearVoiceQueues(_0x2ea311['voiceQueues']);if(_0x2faa9d){_0x2faa9d=_[_0xa481('0x50')](_0x2faa9d,_0xa481('0x51'));for(var _0x35941b in _0x2faa9d){if(_0x2faa9d[_0xa481('0x25')](_0x35941b)){var _0x4c189b={};for(var _0x48fc7c=0x0;_0x48fc7c<_0x2faa9d[_0x35941b]['length'];_0x48fc7c+=0x1){var _0x245129=_0x2faa9d[_0x35941b][_0x48fc7c][_0xa481('0x52')];if(_0x2ea311[_0xa481('0x43')][_0x245129]){if(_0x2faa9d[_0x35941b][_0x48fc7c][_0xa481('0x53')]){_0x2ea311['voiceQueues'][_0x245129][_0xa481('0x32')]+=0x1;}if(_0x2faa9d[_0x35941b][_0x48fc7c][_0xa481('0x54')]){_0x2ea311[_0xa481('0x43')][_0x245129]['abandoned']+=0x1;}_0x2ea311[_0xa481('0x43')][_0x245129][_0xa481('0x2e')]+=moment(_0x2faa9d[_0x35941b][_0x48fc7c][_0xa481('0x55')])['diff'](moment(_0x2faa9d[_0x35941b][_0x48fc7c][_0xa481('0x56')]),_0xa481('0x57'))||0x0;if(_0x48fc7c===_0x2faa9d[_0x35941b][_0xa481('0x3e')]-0x1){_0x2ea311[_0xa481('0x43')][_0x245129][_0xa481('0x58')]+=moment(_0x2faa9d[_0x35941b][_0x48fc7c]['queuecallercompleteAt']||_0x2faa9d[_0x35941b][_0x48fc7c][_0xa481('0x59')]||_0x2faa9d[_0x35941b][_0x48fc7c][_0xa481('0x5a')])[_0xa481('0x5b')](moment(_0x2faa9d[_0x35941b][_0x48fc7c][_0xa481('0x56')]),_0xa481('0x57'))||0x0;_0x2ea311[_0xa481('0x43')][_0x245129][_0xa481('0x2c')]+=0x1;if(_0x2faa9d[_0x35941b][_0x48fc7c][_0xa481('0x5c')]){_0x2ea311[_0xa481('0x43')][_0x245129][_0xa481('0x2d')]+=0x1;_0x2ea311['voiceQueues'][_0x245129][_0xa481('0x2f')]+=moment(_0x2faa9d[_0x35941b][_0x48fc7c][_0xa481('0x5d')])[_0xa481('0x5b')](moment(_0x2faa9d[_0x35941b][_0x48fc7c]['queuecallerleaveAt']),_0xa481('0x57'))||0x0;}}else{_0x2ea311[_0xa481('0x43')][_0x245129][_0xa481('0x58')]+=_0x2ea311[_0xa481('0x43')][_0x245129][_0xa481('0x2e')]||0x0;}}}}}}return _0x2ea311[_0xa481('0x43')];};};Realtime[_0xa481('0x3c')][_0xa481('0x5e')]=function(){var _0x3421b9=this;return function(_0x29ee57){clearVoiceCallReports(_0x3421b9[_0xa481('0x19')]);if(_0x29ee57){for(var _0x40a585=0x0;_0x40a585<_0x29ee57['length'];_0x40a585+=0x1){_0x3421b9[_0xa481('0x19')][_0xa481('0x2c')]+=0x1;_0x3421b9['outbound'][_0xa481('0x58')]+=_0x29ee57[_0x40a585][_0xa481('0x5f')];if(_0x29ee57[_0x40a585][_0xa481('0x60')]===_0xa481('0x61')){_0x3421b9[_0xa481('0x19')]['answered']+=0x1;_0x3421b9['outbound'][_0xa481('0x2e')]+=_0x29ee57[_0x40a585][_0xa481('0x5f')]-_0x29ee57[_0x40a585][_0xa481('0x62')]||0x0;_0x3421b9[_0xa481('0x19')][_0xa481('0x2f')]+=_0x29ee57[_0x40a585][_0xa481('0x62')];}}}return _0x3421b9[_0xa481('0x19')];};};Realtime[_0xa481('0x3c')][_0xa481('0x63')]=function(){var _0x439506=this;return function(_0x3c7079){if(_0x3c7079){freeIsNotKey(_0x3c7079,_0x439506[_0xa481('0x17')],_0xa481('0x28'));for(var _0x10c670=0x0,_0x275073={};_0x10c670<_0x3c7079[_0xa481('0x3e')];_0x10c670+=0x1){_0x275073=_0x3c7079[_0x10c670];if(_[_0xa481('0x41')](_0x439506['campaigns'][_0x275073[_0xa481('0x28')]])){_0x439506[_0xa481('0x17')][_0x275073['name']]=new Campaign(_0x275073);}else{_0x439506[_0xa481('0x3b')](_0x439506['campaigns'][_0x275073['name']],_0x275073);}}}return _0x439506[_0xa481('0x17')];};};Realtime[_0xa481('0x3c')][_0xa481('0x64')]=function(){var _0x14fb70=this;return function(_0x58c5c8){if(_0x58c5c8){freeIsNotKey(_0x58c5c8,_0x14fb70[_0xa481('0x1a')],'id');for(var _0x2cd35f=0x0,_0x223c73={};_0x2cd35f<_0x58c5c8['length'];_0x2cd35f+=0x1){_0x223c73=_0x58c5c8[_0x2cd35f];if(_[_0xa481('0x41')](_0x14fb70[_0xa481('0x1a')][_0x223c73['id']])){_0x14fb70[_0xa481('0x1a')][_0x223c73['id']]=new VoiceExtension(_0x223c73);}else{_0x14fb70['mergeFromDatabase'](_0x14fb70['voiceExtensions'][_0x223c73['id']],_0x223c73);}}}return _0x14fb70['voiceExtensions'];};};Realtime[_0xa481('0x3c')][_0xa481('0x65')]=function(){var _0x2fe14e=this;return function(_0x2c1925){clearCampaigns(_0x2fe14e[_0xa481('0x17')]);for(var _0x2a75ca=0x0;_0x2a75ca<_0x2c1925[_0xa481('0x3e')];_0x2a75ca+=0x1){_[_0xa481('0x66')](_0x2fe14e[_0xa481('0x17')][_0x2c1925[_0x2a75ca][_0xa481('0x28')]],_0x2c1925[_0x2a75ca]);}return _0x2fe14e[_0xa481('0x17')];};};Realtime[_0xa481('0x3c')][_0xa481('0x67')]=function(){var _0x416486=this;return function(_0x373f87){if(_0x373f87){freeIsNotKey(_0x373f87,_0x416486[_0xa481('0x68')],'id');for(var _0x417701=0x0,_0xa86736={},_0x393afb={};_0x417701<_0x373f87[_0xa481('0x3e')];_0x417701+=0x1){_0xa86736=_0x373f87[_0x417701];if(_[_0xa481('0x41')](_0x416486['faxAccounts'][_0xa86736['id']])){_0x416486[_0xa481('0x68')][_0xa86736['id']]=new FaxAccount(_0xa86736);}else{_0x416486[_0xa481('0x3b')](_0x416486['faxAccounts'][_0xa86736['id']],_0xa86736);}}}return _0x416486[_0xa481('0x68')];};};module['exports']=Realtime;
\ No newline at end of file
diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js
index 5978b54..f353dcf 100644
--- a/server/services/ami/report/index.js
+++ b/server/services/ami/report/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x935a=['interface','format','SIP/%s','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridnum','destinationchannel','channel','calleridpreview','originatecalleridnum','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','monitor','monitors','length','monitorFilename','filename','calleridname','connectedlinename','xcally-motion-dialer','voiceAgentReport','forEach','voiceDialReport','startsWith','Local','indexOf','substring','lastIndexOf','membername','attendedTransfer','exports','bluebird','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','telephones','prototype','sync','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','agents','accountcode','isNil','name'];(function(_0x21eec5,_0x247273){var _0x324d22=function(_0x2e7baf){while(--_0x2e7baf){_0x21eec5['push'](_0x21eec5['shift']());}};_0x324d22(++_0x247273);}(_0x935a,0x8a));var _0xa935=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x935a[_0x255d5b];return _0x3e141a;};'use strict';var BPromise=require(_0xa935('0x0'));var _=require('lodash');var moment=require(_0xa935('0x1'));var util=require(_0xa935('0x2'));var config=require(_0xa935('0x3'));var logger=require(_0xa935('0x4'))(_0xa935('0x5'));var ami=require(_0xa935('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xa935('0x7'));var RpcVoiceDialReport=require(_0xa935('0x8'));var RpcMemberReport=require(_0xa935('0x9'));var RpcVoiceQueueReport=require(_0xa935('0xa'));var RpcVoiceRecording=require(_0xa935('0xb'));var RpcVoiceTransferReport=require(_0xa935('0xc'));var VoiceQueueReport=require(_0xa935('0xd'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xa935('0xe'));var VoiceDialReport=require(_0xa935('0xf'));var UserReport=require(_0xa935('0x10'));function Report(_0x4502c1){this['realtime']=_0x4502c1;this['agents']=_0x4502c1['agents'];this[_0xa935('0x11')]=_0x4502c1[_0xa935('0x11')];}Report[_0xa935('0x12')][_0xa935('0x13')]=function(_0x379b51){var _0x504e06=new VoiceQueueReport(this['realtime']);var _0x173b58=new VoiceAgentReport(this[_0xa935('0x14')]);var _0xbc3671=new VoiceDialReport(this[_0xa935('0x14')]);var _0x1230a9=new VoiceCallReport(this[_0xa935('0x14')]);var _0x5914a4=new UserReport(this[_0xa935('0x14')]);if(config[_0xa935('0x15')]&&config['xdr']['disabled']){ami['on'](_0xa935('0x16'),this[_0xa935('0x17')]['bind'](this));ami['on'](_0xa935('0x18'),this['voiceCallReport'][_0xa935('0x19')](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport']['bind'](this));ami['on'](_0xa935('0x1a'),this['voiceDialReport'][_0xa935('0x19')](this));ami['on'](_0xa935('0x1b'),this[_0xa935('0x1c')][_0xa935('0x19')](this));ami['on'](_0xa935('0x1d'),this['attendedTransfer'][_0xa935('0x19')](this));}};Report[_0xa935('0x12')][_0xa935('0x1e')]=function(_0xb848b5){var _0xaad704=undefined;_0xaad704=_[_0xa935('0x1f')](this[_0xa935('0x20')],function(_0x9f3d7b){return _0x9f3d7b[_0xa935('0x21')]==_0xb848b5||_0x9f3d7b['name']==_0xb848b5;});if(_[_0xa935('0x22')](_0xaad704)){var _0x3183a5=_[_0xa935('0x1f')](this['telephones'],function(_0x3e5002){return _0x3e5002[_0xa935('0x21')]==_0xb848b5||_0x3e5002[_0xa935('0x23')]==_0xb848b5;});if(_0x3183a5){_0xaad704=_[_0xa935('0x1f')](this['agents'],function(_0xc950f0){return _0xc950f0[_0xa935('0x24')]==util[_0xa935('0x25')](_0xa935('0x26'),_0x3183a5['name']);});}}return _0xaad704;};Report[_0xa935('0x12')][_0xa935('0x17')]=function(_0x5826ef){for(var _0x5646ae=0x0;_0x5646ae<_0x5826ef['length'];_0x5646ae+=0x1){var _0x17bea7=this['findAgent'](_0x5826ef[_0x5646ae]['connectedlinenum']);if(_0x17bea7){_0x5826ef[_0x5646ae][_0xa935('0x21')]=_0x17bea7[_0xa935('0x21')];_0x5826ef[_0x5646ae][_0xa935('0x27')]=!![];_0x5826ef[_0x5646ae][_0xa935('0x28')]=_0x17bea7[_0xa935('0x23')];_0x5826ef[_0x5646ae][_0xa935('0x24')]=_[_0xa935('0x22')](_0x17bea7[_0xa935('0x24')])?util[_0xa935('0x25')]('SIP/%s',_0x17bea7[_0xa935('0x23')]):_0x17bea7[_0xa935('0x24')];if(_0x5826ef[_0x5646ae][_0xa935('0x29')]){_0x5826ef[_0x5646ae]['queuecallercompleteAt']=moment()[_0xa935('0x25')](_0xa935('0x2a'));}if(_0x5826ef[_0x5646ae][_0xa935('0x2b')]){_0x5826ef[_0x5646ae]['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xa935('0x17')](_0x5826ef[_0x5646ae]);}RpcVoiceQueueReport[_0xa935('0x2c')](_0x5826ef[_0x5646ae]);}};function extractCalleridNumber(_0x13e068){var _0x5db943=_0x13e068[_0xa935('0x2d')](/<(.*?)>/);return _0x5db943?_0x5db943[0x1]:_0x13e068;}Report['prototype'][_0xa935('0x2e')]=function(_0x584f7a){_0x584f7a[_0xa935('0x2f')]=_0x584f7a[_0xa935('0x2f')]||_0x584f7a[_0xa935('0x30')];if(_0x584f7a[_0xa935('0x31')]==_0xa935('0x32')){_0x584f7a[_0xa935('0x33')]=_0xa935('0x34');_0x584f7a[_0xa935('0x35')]=_0x584f7a[_0xa935('0x34')];if(_0x584f7a[_0xa935('0x36')]==_0xa935('0x37')){_0x584f7a[_0xa935('0x21')]='';_0x584f7a[_0xa935('0x2f')]=extractCalleridNumber(_0x584f7a[_0xa935('0x38')]);}else if(_0x584f7a[_0xa935('0x36')]==_0xa935('0x39')){if(_0x584f7a[_0xa935('0x2f')]==_0xa935('0x3a')){_0x584f7a[_0xa935('0x2f')]=extractCalleridNumber(_0x584f7a['calleridpreview']);_0x584f7a[_0xa935('0x3b')]=_0x584f7a['originatecalleridnum'];_0x584f7a[_0xa935('0x3c')]=[_0x584f7a[_0xa935('0x3d')],_0x584f7a['channel']=_0x584f7a['destinationchannel']][0x0];_0x584f7a[_0xa935('0x38')]=_0x584f7a[_0xa935('0x3e')];}else{_0x584f7a[_0xa935('0x2f')]=_0x584f7a[_0xa935('0x3b')];_0x584f7a[_0xa935('0x3b')]=_0x584f7a[_0xa935('0x3f')];if(_0x584f7a[_0xa935('0x40')]==_0xa935('0x41')){_0x584f7a[_0xa935('0x21')]=_0x584f7a[_0xa935('0x42')];}else{_0x584f7a[_0xa935('0x21')]='';}}}}else{_0x584f7a[_0xa935('0x38')]=util[_0xa935('0x25')](_0xa935('0x43'),_0x584f7a['calleridname'],_0x584f7a['calleridnum']);}RpcVoiceCallReport[_0xa935('0x2c')](_0x584f7a);if(_0x584f7a[_0xa935('0x44')]){for(var _0x1d9f2a=0x0;_0x1d9f2a<_0x584f7a[_0xa935('0x45')][_0xa935('0x46')];_0x1d9f2a+=0x1){_0x584f7a[_0xa935('0x47')]=_0x584f7a['monitors'][_0x1d9f2a][_0xa935('0x48')];_0x584f7a['createdAt']=_0x584f7a[_0xa935('0x45')][_0x1d9f2a]['createdAt'];if(_0x584f7a[_0xa935('0x30')]==_0xa935('0x3a')){_0x584f7a[_0xa935('0x3b')]=_0x584f7a[_0xa935('0x42')];_0x584f7a[_0xa935('0x49')]=_0x584f7a[_0xa935('0x4a')];_0x584f7a[_0xa935('0x42')]=_0x584f7a[_0xa935('0x21')];_0x584f7a[_0xa935('0x4a')]=_0x584f7a['membername'];_0x584f7a[_0xa935('0x30')]=_0x584f7a[_0xa935('0x3f')];}else if(_0x584f7a[_0xa935('0x30')]==_0xa935('0x4b')){_0x584f7a[_0xa935('0x3b')]=_0x584f7a[_0xa935('0x2f')];_0x584f7a[_0xa935('0x30')]=_0x584f7a[_0xa935('0x3f')];}RpcVoiceRecording[_0xa935('0x2c')](_0x584f7a);}}};Report['prototype'][_0xa935('0x4c')]=function(_0x33b863){if(_['isArray'](_0x33b863)){_0x33b863[_0xa935('0x4d')](function(_0x434cb8){RpcVoiceAgentReport[_0xa935('0x2c')](_0x434cb8);});}else{RpcVoiceAgentReport[_0xa935('0x2c')](_0x33b863);}};Report['prototype'][_0xa935('0x4e')]=function(_0x32892d){RpcVoiceDialReport[_0xa935('0x2c')](_0x32892d);var _0x295312=undefined;var _0x907a3e=_0x32892d[_0xa935('0x3d')];if(_[_0xa935('0x4f')](_0x907a3e,_0xa935('0x50'))){var _0x5efc60=_0x907a3e['substring'](_0x907a3e['indexOf']('/')+0x1,_0x907a3e[_0xa935('0x51')]('@'));_0x295312=_[_0xa935('0x1f')](this[_0xa935('0x20')],function(_0x23f1fb){return _0x23f1fb['mobile']==_0x5efc60||_0x23f1fb['phone']==_0x5efc60||_0x23f1fb[_0xa935('0x21')]==_0x5efc60;});}else{var _0x5efc60=_0x907a3e[_0xa935('0x52')](_0x907a3e[_0xa935('0x51')]('/')+0x1,_0x907a3e[_0xa935('0x53')]('-'));_0x295312=this['findAgent'](_0x5efc60);}if(_0x295312){_0x32892d[_0xa935('0x24')]=_[_0xa935('0x22')](_0x295312[_0xa935('0x24')])?util[_0xa935('0x25')](_0xa935('0x26'),_0x295312[_0xa935('0x23')]):_0x295312[_0xa935('0x24')];_0x32892d[_0xa935('0x54')]=_0x295312['name'];_0x32892d[_0xa935('0x21')]=_0x295312[_0xa935('0x21')];RpcMemberReport[_0xa935('0x4e')](_0x32892d);}};Report['prototype'][_0xa935('0x1c')]=function(_0x52a750){RpcVoiceTransferReport['blindTransfer'](_0x52a750);};Report[_0xa935('0x12')][_0xa935('0x55')]=function(_0x31d2f9){RpcVoiceTransferReport['attendedTransfer'](_0x31d2f9);};module[_0xa935('0x56')]=Report;
\ No newline at end of file
+var _0xd9b3=['YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','match','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','callerid','calleridnum','ANSWERED','\x22%s\x22\x20<%s>','create','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','blindTransfer','exports','bluebird','lodash','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','agents','telephones','prototype','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','length','connectedlinenum','lastAssignedTo','interface','format','SIP/%s','queuecallercomplete','queuecallercompleteAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd9b3,0x1d8));var _0x3d9b=function(_0x69bc1,_0x4c3c9d){_0x69bc1=_0x69bc1-0x0;var _0x305e61=_0xd9b3[_0x69bc1];return _0x305e61;};'use strict';var BPromise=require(_0x3d9b('0x0'));var _=require(_0x3d9b('0x1'));var moment=require('moment');var util=require('util');var config=require(_0x3d9b('0x2'));var logger=require(_0x3d9b('0x3'))(_0x3d9b('0x4'));var ami=require(_0x3d9b('0x5'));var RpcVoiceAgentReport=require(_0x3d9b('0x6'));var RpcVoiceCallReport=require(_0x3d9b('0x7'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x3d9b('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x3d9b('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x3d9b('0xa'));var VoiceCallReport=require(_0x3d9b('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x3d9b('0xc'));var UserReport=require(_0x3d9b('0xd'));function Report(_0x8d251d){this['realtime']=_0x8d251d;this[_0x3d9b('0xe')]=_0x8d251d[_0x3d9b('0xe')];this[_0x3d9b('0xf')]=_0x8d251d[_0x3d9b('0xf')];}Report[_0x3d9b('0x10')]['sync']=function(_0x237e0d){var _0x4ec439=new VoiceQueueReport(this[_0x3d9b('0x11')]);var _0x35a36a=new VoiceAgentReport(this['realtime']);var _0x14d61c=new VoiceDialReport(this['realtime']);var _0xf98417=new VoiceCallReport(this['realtime']);var _0x21df38=new UserReport(this[_0x3d9b('0x11')]);if(config['xdr']&&config[_0x3d9b('0x12')][_0x3d9b('0x13')]){ami['on'](_0x3d9b('0x14'),this[_0x3d9b('0x15')][_0x3d9b('0x16')](this));ami['on'](_0x3d9b('0x17'),this['voiceCallReport'][_0x3d9b('0x16')](this));ami['on'](_0x3d9b('0x18'),this[_0x3d9b('0x19')][_0x3d9b('0x16')](this));ami['on'](_0x3d9b('0x1a'),this[_0x3d9b('0x1b')][_0x3d9b('0x16')](this));ami['on'](_0x3d9b('0x1c'),this['blindTransfer'][_0x3d9b('0x16')](this));ami['on'](_0x3d9b('0x1d'),this[_0x3d9b('0x1e')][_0x3d9b('0x16')](this));}};Report['prototype'][_0x3d9b('0x1f')]=function(_0x316f24){var _0x3d7458=undefined;_0x3d7458=_['find'](this[_0x3d9b('0xe')],function(_0x96c1c4){return _0x96c1c4[_0x3d9b('0x20')]==_0x316f24||_0x96c1c4[_0x3d9b('0x21')]==_0x316f24;});if(_[_0x3d9b('0x22')](_0x3d7458)){var _0x27977b=_[_0x3d9b('0x23')](this[_0x3d9b('0xf')],function(_0x2fd6d3){return _0x2fd6d3[_0x3d9b('0x20')]==_0x316f24||_0x2fd6d3[_0x3d9b('0x21')]==_0x316f24;});if(_0x27977b){_0x3d7458=_[_0x3d9b('0x23')](this[_0x3d9b('0xe')],function(_0x219eff){return _0x219eff['interface']==util['format']('SIP/%s',_0x27977b['name']);});}}return _0x3d7458;};Report[_0x3d9b('0x10')][_0x3d9b('0x15')]=function(_0xa999f){for(var _0x526779=0x0;_0x526779<_0xa999f[_0x3d9b('0x24')];_0x526779+=0x1){var _0x4fa973=this['findAgent'](_0xa999f[_0x526779][_0x3d9b('0x25')]);if(_0x4fa973){_0xa999f[_0x526779][_0x3d9b('0x20')]=_0x4fa973['accountcode'];_0xa999f[_0x526779]['assigned']=!![];_0xa999f[_0x526779][_0x3d9b('0x26')]=_0x4fa973[_0x3d9b('0x21')];_0xa999f[_0x526779][_0x3d9b('0x27')]=_['isNil'](_0x4fa973['interface'])?util[_0x3d9b('0x28')](_0x3d9b('0x29'),_0x4fa973['name']):_0x4fa973[_0x3d9b('0x27')];if(_0xa999f[_0x526779][_0x3d9b('0x2a')]){_0xa999f[_0x526779][_0x3d9b('0x2b')]=moment()[_0x3d9b('0x28')](_0x3d9b('0x2c'));}if(_0xa999f[_0x526779]['queuecallerexit']){_0xa999f[_0x526779][_0x3d9b('0x2d')]=moment()[_0x3d9b('0x28')](_0x3d9b('0x2c'));}RpcMemberReport[_0x3d9b('0x15')](_0xa999f[_0x526779]);}RpcVoiceQueueReport['create'](_0xa999f[_0x526779]);}};function extractCalleridNumber(_0x62a2c7){var _0x3300f0=_0x62a2c7[_0x3d9b('0x2e')](/<(.*?)>/);return _0x3300f0?_0x3300f0[0x1]:_0x62a2c7;}Report[_0x3d9b('0x10')][_0x3d9b('0x2f')]=function(_0x2e3a77){_0x2e3a77['destination']=_0x2e3a77[_0x3d9b('0x30')]||_0x2e3a77[_0x3d9b('0x31')];if(_0x2e3a77[_0x3d9b('0x32')]==_0x3d9b('0x33')){_0x2e3a77[_0x3d9b('0x34')]=_0x3d9b('0x35');_0x2e3a77[_0x3d9b('0x36')]=_0x2e3a77[_0x3d9b('0x35')];if(_0x2e3a77[_0x3d9b('0x37')]==_0x3d9b('0x38')){_0x2e3a77[_0x3d9b('0x20')]='';_0x2e3a77[_0x3d9b('0x30')]=extractCalleridNumber(_0x2e3a77['callerid']);}else if(_0x2e3a77[_0x3d9b('0x37')]=='from-sip'){if(_0x2e3a77[_0x3d9b('0x30')]==_0x3d9b('0x39')){_0x2e3a77['destination']=extractCalleridNumber(_0x2e3a77[_0x3d9b('0x3a')]);_0x2e3a77['calleridnum']=_0x2e3a77[_0x3d9b('0x3b')];_0x2e3a77[_0x3d9b('0x3c')]=[_0x2e3a77['channel'],_0x2e3a77['channel']=_0x2e3a77[_0x3d9b('0x3c')]][0x0];_0x2e3a77[_0x3d9b('0x3d')]=_0x2e3a77[_0x3d9b('0x3a')];}else{_0x2e3a77[_0x3d9b('0x30')]=_0x2e3a77[_0x3d9b('0x3e')];_0x2e3a77[_0x3d9b('0x3e')]=_0x2e3a77['originatecalleridnum'];if(_0x2e3a77['disposition']==_0x3d9b('0x3f')){_0x2e3a77[_0x3d9b('0x20')]=_0x2e3a77[_0x3d9b('0x25')];}else{_0x2e3a77[_0x3d9b('0x20')]='';}}}}else{_0x2e3a77[_0x3d9b('0x3d')]=util[_0x3d9b('0x28')](_0x3d9b('0x40'),_0x2e3a77['calleridname'],_0x2e3a77['calleridnum']);}RpcVoiceCallReport[_0x3d9b('0x41')](_0x2e3a77);if(_0x2e3a77[_0x3d9b('0x42')]){for(var _0x25a7c3=0x0;_0x25a7c3<_0x2e3a77[_0x3d9b('0x43')]['length'];_0x25a7c3+=0x1){_0x2e3a77[_0x3d9b('0x44')]=_0x2e3a77[_0x3d9b('0x43')][_0x25a7c3][_0x3d9b('0x45')];_0x2e3a77['createdAt']=_0x2e3a77[_0x3d9b('0x43')][_0x25a7c3][_0x3d9b('0x46')];if(_0x2e3a77['exten']==_0x3d9b('0x39')){_0x2e3a77[_0x3d9b('0x3e')]=_0x2e3a77[_0x3d9b('0x25')];_0x2e3a77[_0x3d9b('0x47')]=_0x2e3a77[_0x3d9b('0x48')];_0x2e3a77[_0x3d9b('0x25')]=_0x2e3a77[_0x3d9b('0x20')];_0x2e3a77[_0x3d9b('0x48')]=_0x2e3a77[_0x3d9b('0x49')];_0x2e3a77['exten']=_0x2e3a77[_0x3d9b('0x3b')];}else if(_0x2e3a77[_0x3d9b('0x31')]==_0x3d9b('0x4a')){_0x2e3a77['calleridnum']=_0x2e3a77[_0x3d9b('0x30')];_0x2e3a77[_0x3d9b('0x31')]=_0x2e3a77[_0x3d9b('0x3b')];}RpcVoiceRecording[_0x3d9b('0x41')](_0x2e3a77);}}};Report[_0x3d9b('0x10')][_0x3d9b('0x19')]=function(_0x1a3043){if(_[_0x3d9b('0x4b')](_0x1a3043)){_0x1a3043[_0x3d9b('0x4c')](function(_0x5e3315){RpcVoiceAgentReport[_0x3d9b('0x41')](_0x5e3315);});}else{RpcVoiceAgentReport[_0x3d9b('0x41')](_0x1a3043);}};Report[_0x3d9b('0x10')][_0x3d9b('0x1b')]=function(_0x1dd4b9){RpcVoiceDialReport[_0x3d9b('0x41')](_0x1dd4b9);var _0x4b3b41=undefined;var _0x24e581=_0x1dd4b9['channel'];if(_[_0x3d9b('0x4d')](_0x24e581,_0x3d9b('0x4e'))){var _0xb61ec5=_0x24e581[_0x3d9b('0x4f')](_0x24e581[_0x3d9b('0x50')]('/')+0x1,_0x24e581['indexOf']('@'));_0x4b3b41=_['find'](this[_0x3d9b('0xe')],function(_0x3208a0){return _0x3208a0[_0x3d9b('0x51')]==_0xb61ec5||_0x3208a0[_0x3d9b('0x52')]==_0xb61ec5||_0x3208a0[_0x3d9b('0x20')]==_0xb61ec5;});}else{var _0xb61ec5=_0x24e581[_0x3d9b('0x4f')](_0x24e581[_0x3d9b('0x50')]('/')+0x1,_0x24e581[_0x3d9b('0x53')]('-'));_0x4b3b41=this[_0x3d9b('0x1f')](_0xb61ec5);}if(_0x4b3b41){_0x1dd4b9[_0x3d9b('0x27')]=_['isNil'](_0x4b3b41[_0x3d9b('0x27')])?util[_0x3d9b('0x28')](_0x3d9b('0x29'),_0x4b3b41[_0x3d9b('0x21')]):_0x4b3b41['interface'];_0x1dd4b9[_0x3d9b('0x49')]=_0x4b3b41[_0x3d9b('0x21')];_0x1dd4b9[_0x3d9b('0x20')]=_0x4b3b41[_0x3d9b('0x20')];RpcMemberReport[_0x3d9b('0x1b')](_0x1dd4b9);}};Report[_0x3d9b('0x10')][_0x3d9b('0x54')]=function(_0x48fd75){RpcVoiceTransferReport[_0x3d9b('0x54')](_0x48fd75);};Report[_0x3d9b('0x10')][_0x3d9b('0x1e')]=function(_0x473bcc){RpcVoiceTransferReport[_0x3d9b('0x1e')](_0x473bcc);};module[_0x3d9b('0x55')]=Report;
\ No newline at end of file
diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js
index 866ae84..40650cf 100644
--- a/server/services/ami/report/userReport.js
+++ b/server/services/ami/report/userReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f3d=['address','[syncPeerStatus][UserReport]','exports','bluebird','util','ioredis','../../../config/environment','../ami','defaults','localhost','socket.io-emitter','redis','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','resolve','then','actionSipPeerStatus','[loopSyncRealTimeShow]','prototype','loopSyncRealTimeShow','actionSipShowRegistry','actionDeviceStateList','isUndefined','emit','find','username','stateRegistry','merge','omit','event','actionid','trunk:%s','trunk:save','error','inspect','isNotNull','device','local','toLowerCase','inuse','state','stateTime','toNumber','format','updateStatusRealtime','telephone:%s','name','startsWith','substring','indexOf','mobile','phone','[syncDeviceState][UserReport]','syncPeerStatus','peer','registered','status'];(function(_0x5e0e90,_0x1c8363){var _0x33cfe3=function(_0x44f842){while(--_0x44f842){_0x5e0e90['push'](_0x5e0e90['shift']());}};_0x33cfe3(++_0x1c8363);}(_0x5f3d,0x189));var _0xd5f3=function(_0x5b4c0a,_0x92d53b){_0x5b4c0a=_0x5b4c0a-0x0;var _0x5c9dda=_0x5f3d[_0x5b4c0a];return _0x5c9dda;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xd5f3('0x0'));var util=require(_0xd5f3('0x1'));var Redis=require(_0xd5f3('0x2'));var config=require(_0xd5f3('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0xd5f3('0x4'));config['redis']=_[_0xd5f3('0x5')](config['redis'],{'host':_0xd5f3('0x6'),'port':0x18eb});var io=require(_0xd5f3('0x7'))(new Redis(config[_0xd5f3('0x8')]));function UserReport(_0x2319b8){this[_0xd5f3('0x9')]=_0x2319b8[_0xd5f3('0x9')];this[_0xd5f3('0xa')]=_0x2319b8[_0xd5f3('0xa')];this[_0xd5f3('0xb')]=_0x2319b8['telephones'];ami['on'](_0xd5f3('0xc'),this[_0xd5f3('0xd')][_0xd5f3('0xe')](this));ami['on'](_0xd5f3('0xf'),this[_0xd5f3('0xd')][_0xd5f3('0xe')](this));ami['on'](_0xd5f3('0x10'),this[_0xd5f3('0x11')][_0xd5f3('0xe')](this));ami['on'](_0xd5f3('0x12'),this['syncPeerStatus'][_0xd5f3('0xe')](this));this['loopSyncRealTimeShow']();return BPromise[_0xd5f3('0x13')]()[_0xd5f3('0x14')](ami['actionSipShowRegistry']())[_0xd5f3('0x14')](ami['actionDeviceStateList']())[_0xd5f3('0x14')](ami[_0xd5f3('0x15')]())['catch'](loggerCatch(_0xd5f3('0x16')));}function loggerCatch(_0x19dae7){return function(_0x2496ce){logger['error'](_0x19dae7,util['inspect'](_0x2496ce,{'showHidden':![],'depth':null}));};}UserReport[_0xd5f3('0x17')][_0xd5f3('0x18')]=function(){setInterval(function(){BPromise[_0xd5f3('0x13')]()['then'](ami[_0xd5f3('0x19')]())[_0xd5f3('0x14')](ami[_0xd5f3('0x1a')]())[_0xd5f3('0x14')](ami[_0xd5f3('0x15')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0xd5f3('0x17')]['isNotNull']=function(_0x5395b8){return _0x5395b8!==null&&!_[_0xd5f3('0x1b')](_0x5395b8);};UserReport[_0xd5f3('0x17')][_0xd5f3('0x1c')]=function(_0x17bf22,_0x2d4eb2,_0x3b6a4d){io['to'](_0x17bf22)[_0xd5f3('0x1c')](_0x2d4eb2,_0x3b6a4d);};UserReport[_0xd5f3('0x17')]['syncRegistry']=function(_0xe9a054){try{if(this['isNotNull'](_0xe9a054)){var _0x4d796f=_[_0xd5f3('0x1d')](this['trunks'],{'registry':_0xe9a054[_0xd5f3('0x1e')]});if(_0x4d796f){_0xe9a054[_0xd5f3('0x1f')]=_0xe9a054['state'];_[_0xd5f3('0x20')](_0x4d796f,_[_0xd5f3('0x21')](_0xe9a054,[_0xd5f3('0x22'),_0xd5f3('0x23'),'username','state']));this[_0xd5f3('0x1c')](util['format'](_0xd5f3('0x24'),_0x4d796f['name']),_0xd5f3('0x25'),_0x4d796f);}}}catch(_0x23ee46){logger[_0xd5f3('0x26')]('[syncRegistry][UserReport]',util[_0xd5f3('0x27')](_0x23ee46,{'showHidden':![],'depth':null}));}};UserReport[_0xd5f3('0x17')]['syncDeviceState']=function(_0x29e0fc){try{if(this[_0xd5f3('0x28')](_0x29e0fc)){if(this['agents'][_0x29e0fc[_0xd5f3('0x29')]]){if(!this[_0xd5f3('0xa')][_0x29e0fc['device']][_0xd5f3('0x2a')]||_0x29e0fc['state'][_0xd5f3('0x2b')]()==_0xd5f3('0x2c')){this[_0xd5f3('0xa')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2a')]=![];if(this[_0xd5f3('0xa')][_0x29e0fc[_0xd5f3('0x29')]]['state']!==_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]()){this[_0xd5f3('0xa')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2e')]=_[_0xd5f3('0x2f')](moment()[_0xd5f3('0x30')]('x'));}this[_0xd5f3('0xa')][_0x29e0fc['device']][_0xd5f3('0x2d')]=_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]();this['agents'][_0x29e0fc['device']][_0xd5f3('0x31')](_0x29e0fc);}}else if(this[_0xd5f3('0xb')][_0x29e0fc[_0xd5f3('0x29')]]){if(this[_0xd5f3('0xb')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2d')]!==_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]()){this['telephones'][_0x29e0fc['device']][_0xd5f3('0x2e')]=_[_0xd5f3('0x2f')](moment()[_0xd5f3('0x30')]('x'));}this[_0xd5f3('0xb')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2d')]=_0x29e0fc[_0xd5f3('0x2d')]['toLowerCase']();this[_0xd5f3('0x1c')](util[_0xd5f3('0x30')](_0xd5f3('0x32'),this[_0xd5f3('0xb')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x33')]),'telephone:save',this[_0xd5f3('0xb')][_0x29e0fc['device']]);}else if(this[_0xd5f3('0x9')][_0x29e0fc[_0xd5f3('0x29')]]){if(this[_0xd5f3('0x9')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2d')]!==_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]()){this[_0xd5f3('0x9')][_0x29e0fc[_0xd5f3('0x29')]]['stateTime']=_['toNumber'](moment()[_0xd5f3('0x30')]('x'));}this[_0xd5f3('0x9')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2d')]=_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]();this[_0xd5f3('0x1c')](util[_0xd5f3('0x30')](_0xd5f3('0x24'),this[_0xd5f3('0x9')][_0x29e0fc['device']][_0xd5f3('0x33')]),_0xd5f3('0x25'),this[_0xd5f3('0x9')][_0x29e0fc[_0xd5f3('0x29')]]);}else if(_[_0xd5f3('0x34')](_0x29e0fc['device'],'Queue')){}else if(_[_0xd5f3('0x34')](_0x29e0fc[_0xd5f3('0x29')],'Local')){var _0x177ca3=_0x29e0fc[_0xd5f3('0x29')];var _0x536272=_0x177ca3[_0xd5f3('0x35')](_0x177ca3[_0xd5f3('0x36')]('/')+0x1,_0x177ca3[_0xd5f3('0x36')]('@'));var _0x3990d5=_[_0xd5f3('0x1d')](this[_0xd5f3('0xa')],function(_0x37bb53){return _0x37bb53[_0xd5f3('0x37')]==_0x536272||_0x37bb53[_0xd5f3('0x38')]==_0x536272||_0x37bb53['accountcode']==_0x536272;});if(_0x3990d5){if(_0x3990d5[_0xd5f3('0x2d')]!==_0x29e0fc[_0xd5f3('0x2d')]['toLowerCase']()){_0x3990d5[_0xd5f3('0x2e')]=_[_0xd5f3('0x2f')](moment()[_0xd5f3('0x30')]('x'));}_0x3990d5[_0xd5f3('0x2d')]=_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]();_0x3990d5[_0xd5f3('0x2a')]=!![];_0x3990d5[_0xd5f3('0x31')](_0x29e0fc);}}else{}}}catch(_0x561998){logger['error'](_0xd5f3('0x39'),util[_0xd5f3('0x27')](_0x561998,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xd5f3('0x3a')]=function(_0x2268ac){try{if(this['isNotNull'](_0x2268ac)&&this[_0xd5f3('0x28')](_0x2268ac[_0xd5f3('0x12')])){if(this[_0xd5f3('0xa')][_0x2268ac[_0xd5f3('0x3b')]]){if(!this[_0xd5f3('0xa')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x2a')]||_0x2268ac[_0xd5f3('0x12')]['toLowerCase']()==_0xd5f3('0x3c')){this[_0xd5f3('0xa')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x2a')]=![];this['agents'][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x3d')]=_0x2268ac[_0xd5f3('0x12')][_0xd5f3('0x2b')]();this[_0xd5f3('0xa')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x3e')]=_0x2268ac[_0xd5f3('0x3e')];this[_0xd5f3('0xa')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x31')](_0x2268ac);}}else if(this['telephones'][_0x2268ac[_0xd5f3('0x3b')]]){this[_0xd5f3('0xb')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x3d')]=_0x2268ac[_0xd5f3('0x12')][_0xd5f3('0x2b')]();this['telephones'][_0x2268ac['peer']][_0xd5f3('0x3e')]=_0x2268ac[_0xd5f3('0x3e')];this['emit'](util[_0xd5f3('0x30')](_0xd5f3('0x32'),this[_0xd5f3('0xb')][_0x2268ac['peer']][_0xd5f3('0x33')]),'telephone:save',this[_0xd5f3('0xb')][_0x2268ac[_0xd5f3('0x3b')]]);}else if(this[_0xd5f3('0x9')][_0x2268ac[_0xd5f3('0x3b')]]){this[_0xd5f3('0x9')][_0x2268ac['peer']][_0xd5f3('0x3d')]=_0x2268ac[_0xd5f3('0x12')][_0xd5f3('0x2b')]();this[_0xd5f3('0x9')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x3e')]=_0x2268ac[_0xd5f3('0x3e')];this['emit'](util['format']('trunk:%s',this['trunks'][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x33')]),_0xd5f3('0x25'),this[_0xd5f3('0x9')][_0x2268ac[_0xd5f3('0x3b')]]);}else{}}}catch(_0x282a46){logger['error'](_0xd5f3('0x3f'),util[_0xd5f3('0x27')](_0x282a46,{'showHidden':![],'depth':null}));}};module[_0xd5f3('0x40')]=UserReport;
\ No newline at end of file
+var _0x7685=['util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','peerstatus','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isNotNull','isUndefined','emit','omit','event','actionid','username','state','format','trunk:%s','name','[syncRegistry][UserReport]','syncDeviceState','device','local','inuse','stateTime','toNumber','updateStatusRealtime','toLowerCase','telephone:save','startsWith','Local','substring','indexOf','find','phone','accountcode','[syncDeviceState][UserReport]','syncPeerStatus','peer','registered','status','address','telephone:%s','trunk:save','[syncPeerStatus][UserReport]','lodash','moment','bluebird'];(function(_0x21e97b,_0x65a77f){var _0x10ba44=function(_0x239ef2){while(--_0x239ef2){_0x21e97b['push'](_0x21e97b['shift']());}};_0x10ba44(++_0x65a77f);}(_0x7685,0x10d));var _0x5768=function(_0xa114b9,_0x42d0a7){_0xa114b9=_0xa114b9-0x0;var _0x818512=_0x7685[_0xa114b9];return _0x818512;};'use strict';var _=require(_0x5768('0x0'));var moment=require(_0x5768('0x1'));var BPromise=require(_0x5768('0x2'));var util=require(_0x5768('0x3'));var Redis=require('ioredis');var config=require(_0x5768('0x4'));var logger=require(_0x5768('0x5'))(_0x5768('0x6'));var ami=require(_0x5768('0x7'));config[_0x5768('0x8')]=_[_0x5768('0x9')](config[_0x5768('0x8')],{'host':_0x5768('0xa'),'port':0x18eb});var io=require(_0x5768('0xb'))(new Redis(config['redis']));function UserReport(_0x5001d7){this[_0x5768('0xc')]=_0x5001d7[_0x5768('0xc')];this[_0x5768('0xd')]=_0x5001d7[_0x5768('0xd')];this[_0x5768('0xe')]=_0x5001d7[_0x5768('0xe')];ami['on'](_0x5768('0xf'),this[_0x5768('0x10')][_0x5768('0x11')](this));ami['on'](_0x5768('0x12'),this[_0x5768('0x10')]['bind'](this));ami['on'](_0x5768('0x13'),this['syncDeviceState'][_0x5768('0x11')](this));ami['on'](_0x5768('0x14'),this['syncPeerStatus'][_0x5768('0x11')](this));this['loopSyncRealTimeShow']();return BPromise[_0x5768('0x15')]()[_0x5768('0x16')](ami[_0x5768('0x17')]())['then'](ami[_0x5768('0x18')]())[_0x5768('0x16')](ami[_0x5768('0x19')]())[_0x5768('0x1a')](loggerCatch(_0x5768('0x1b')));}function loggerCatch(_0x2edddb){return function(_0x510c47){logger[_0x5768('0x1c')](_0x2edddb,util[_0x5768('0x1d')](_0x510c47,{'showHidden':![],'depth':null}));};}UserReport[_0x5768('0x1e')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0x5768('0x15')]()['then'](ami[_0x5768('0x17')]())[_0x5768('0x16')](ami['actionDeviceStateList']())['then'](ami[_0x5768('0x19')]())[_0x5768('0x1a')](loggerCatch(_0x5768('0x1b')));},0x32c8);};UserReport[_0x5768('0x1e')][_0x5768('0x1f')]=function(_0x378a35){return _0x378a35!==null&&!_[_0x5768('0x20')](_0x378a35);};UserReport['prototype']['emit']=function(_0x304ac6,_0x1a4bfa,_0x56b306){io['to'](_0x304ac6)[_0x5768('0x21')](_0x1a4bfa,_0x56b306);};UserReport[_0x5768('0x1e')][_0x5768('0x10')]=function(_0x5e1a3c){try{if(this[_0x5768('0x1f')](_0x5e1a3c)){var _0x3e11cb=_['find'](this[_0x5768('0xc')],{'registry':_0x5e1a3c['username']});if(_0x3e11cb){_0x5e1a3c['stateRegistry']=_0x5e1a3c['state'];_['merge'](_0x3e11cb,_[_0x5768('0x22')](_0x5e1a3c,[_0x5768('0x23'),_0x5768('0x24'),_0x5768('0x25'),_0x5768('0x26')]));this[_0x5768('0x21')](util[_0x5768('0x27')](_0x5768('0x28'),_0x3e11cb[_0x5768('0x29')]),'trunk:save',_0x3e11cb);}}}catch(_0x1479e7){logger['error'](_0x5768('0x2a'),util[_0x5768('0x1d')](_0x1479e7,{'showHidden':![],'depth':null}));}};UserReport[_0x5768('0x1e')][_0x5768('0x2b')]=function(_0x1c9b94){try{if(this[_0x5768('0x1f')](_0x1c9b94)){if(this[_0x5768('0xd')][_0x1c9b94['device']]){if(!this[_0x5768('0xd')][_0x1c9b94[_0x5768('0x2c')]][_0x5768('0x2d')]||_0x1c9b94[_0x5768('0x26')]['toLowerCase']()==_0x5768('0x2e')){this[_0x5768('0xd')][_0x1c9b94['device']][_0x5768('0x2d')]=![];if(this[_0x5768('0xd')][_0x1c9b94[_0x5768('0x2c')]][_0x5768('0x26')]!==_0x1c9b94['state']['toLowerCase']()){this[_0x5768('0xd')][_0x1c9b94[_0x5768('0x2c')]][_0x5768('0x2f')]=_[_0x5768('0x30')](moment()[_0x5768('0x27')]('x'));}this[_0x5768('0xd')][_0x1c9b94[_0x5768('0x2c')]]['state']=_0x1c9b94[_0x5768('0x26')]['toLowerCase']();this[_0x5768('0xd')][_0x1c9b94[_0x5768('0x2c')]][_0x5768('0x31')](_0x1c9b94);}}else if(this[_0x5768('0xe')][_0x1c9b94['device']]){if(this[_0x5768('0xe')][_0x1c9b94[_0x5768('0x2c')]]['state']!==_0x1c9b94[_0x5768('0x26')][_0x5768('0x32')]()){this[_0x5768('0xe')][_0x1c9b94[_0x5768('0x2c')]][_0x5768('0x2f')]=_['toNumber'](moment()[_0x5768('0x27')]('x'));}this[_0x5768('0xe')][_0x1c9b94[_0x5768('0x2c')]][_0x5768('0x26')]=_0x1c9b94[_0x5768('0x26')][_0x5768('0x32')]();this[_0x5768('0x21')](util['format']('telephone:%s',this[_0x5768('0xe')][_0x1c9b94[_0x5768('0x2c')]][_0x5768('0x29')]),_0x5768('0x33'),this['telephones'][_0x1c9b94['device']]);}else if(this[_0x5768('0xc')][_0x1c9b94[_0x5768('0x2c')]]){if(this['trunks'][_0x1c9b94[_0x5768('0x2c')]][_0x5768('0x26')]!==_0x1c9b94['state'][_0x5768('0x32')]()){this[_0x5768('0xc')][_0x1c9b94[_0x5768('0x2c')]][_0x5768('0x2f')]=_[_0x5768('0x30')](moment()[_0x5768('0x27')]('x'));}this[_0x5768('0xc')][_0x1c9b94[_0x5768('0x2c')]][_0x5768('0x26')]=_0x1c9b94[_0x5768('0x26')][_0x5768('0x32')]();this['emit'](util['format'](_0x5768('0x28'),this['trunks'][_0x1c9b94['device']][_0x5768('0x29')]),'trunk:save',this['trunks'][_0x1c9b94[_0x5768('0x2c')]]);}else if(_[_0x5768('0x34')](_0x1c9b94['device'],'Queue')){}else if(_[_0x5768('0x34')](_0x1c9b94['device'],_0x5768('0x35'))){var _0x25a811=_0x1c9b94[_0x5768('0x2c')];var _0x3f6415=_0x25a811[_0x5768('0x36')](_0x25a811[_0x5768('0x37')]('/')+0x1,_0x25a811[_0x5768('0x37')]('@'));var _0x229efd=_[_0x5768('0x38')](this[_0x5768('0xd')],function(_0x2f043b){return _0x2f043b['mobile']==_0x3f6415||_0x2f043b[_0x5768('0x39')]==_0x3f6415||_0x2f043b[_0x5768('0x3a')]==_0x3f6415;});if(_0x229efd){if(_0x229efd[_0x5768('0x26')]!==_0x1c9b94[_0x5768('0x26')][_0x5768('0x32')]()){_0x229efd[_0x5768('0x2f')]=_['toNumber'](moment()[_0x5768('0x27')]('x'));}_0x229efd[_0x5768('0x26')]=_0x1c9b94[_0x5768('0x26')][_0x5768('0x32')]();_0x229efd[_0x5768('0x2d')]=!![];_0x229efd[_0x5768('0x31')](_0x1c9b94);}}else{}}}catch(_0x49f900){logger[_0x5768('0x1c')](_0x5768('0x3b'),util[_0x5768('0x1d')](_0x49f900,{'showHidden':![],'depth':null}));}};UserReport[_0x5768('0x1e')][_0x5768('0x3c')]=function(_0x3974da){try{if(this['isNotNull'](_0x3974da)&&this['isNotNull'](_0x3974da[_0x5768('0x14')])){if(this[_0x5768('0xd')][_0x3974da[_0x5768('0x3d')]]){if(!this[_0x5768('0xd')][_0x3974da[_0x5768('0x3d')]][_0x5768('0x2d')]||_0x3974da[_0x5768('0x14')]['toLowerCase']()==_0x5768('0x3e')){this[_0x5768('0xd')][_0x3974da[_0x5768('0x3d')]][_0x5768('0x2d')]=![];this[_0x5768('0xd')][_0x3974da['peer']][_0x5768('0x3f')]=_0x3974da[_0x5768('0x14')]['toLowerCase']();this[_0x5768('0xd')][_0x3974da['peer']][_0x5768('0x40')]=_0x3974da[_0x5768('0x40')];this[_0x5768('0xd')][_0x3974da[_0x5768('0x3d')]]['updateStatusRealtime'](_0x3974da);}}else if(this[_0x5768('0xe')][_0x3974da[_0x5768('0x3d')]]){this[_0x5768('0xe')][_0x3974da[_0x5768('0x3d')]][_0x5768('0x3f')]=_0x3974da[_0x5768('0x14')]['toLowerCase']();this[_0x5768('0xe')][_0x3974da[_0x5768('0x3d')]][_0x5768('0x40')]=_0x3974da[_0x5768('0x40')];this[_0x5768('0x21')](util[_0x5768('0x27')](_0x5768('0x41'),this['telephones'][_0x3974da['peer']][_0x5768('0x29')]),'telephone:save',this[_0x5768('0xe')][_0x3974da[_0x5768('0x3d')]]);}else if(this[_0x5768('0xc')][_0x3974da[_0x5768('0x3d')]]){this[_0x5768('0xc')][_0x3974da[_0x5768('0x3d')]][_0x5768('0x3f')]=_0x3974da[_0x5768('0x14')][_0x5768('0x32')]();this[_0x5768('0xc')][_0x3974da[_0x5768('0x3d')]]['address']=_0x3974da[_0x5768('0x40')];this[_0x5768('0x21')](util[_0x5768('0x27')](_0x5768('0x28'),this[_0x5768('0xc')][_0x3974da[_0x5768('0x3d')]][_0x5768('0x29')]),_0x5768('0x42'),this[_0x5768('0xc')][_0x3974da[_0x5768('0x3d')]]);}else{}}}catch(_0x197def){logger[_0x5768('0x1c')](_0x5768('0x43'),util[_0x5768('0x1d')](_0x197def,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js
index 91d3e03..734eb5f 100644
--- a/server/services/ami/report/voiceAgentReport.js
+++ b/server/services/ami/report/voiceAgentReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2798=['bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','secondtransfereruniqueid','transfereruniqueid','complete','seconds','[syncBlindTransfer][VoiceAgentReport]','syncMusicOnHoldStart','channel','substring','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','isNotNull','isUndefined','destuniqueid','uniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','emit','custom:agentcalled','format','user:%s','membername','user:called','error','inspect','syncAgentConnect','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','rejected','custom:agentringnoanswer','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','talktime','transfer','acw','agentacw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x2798,0x112));var _0x8279=function(_0x28a6f6,_0x42bfa9){_0x28a6f6=_0x28a6f6-0x0;var _0x1f66e6=_0x2798[_0x28a6f6];return _0x1f66e6;};'use strict';var _=require('lodash');var moment=require(_0x8279('0x0'));var util=require(_0x8279('0x1'));var Redis=require(_0x8279('0x2'));var config=require(_0x8279('0x3'));var logger=require(_0x8279('0x4'))(_0x8279('0x5'));var ami=require(_0x8279('0x6'));config[_0x8279('0x7')]=_[_0x8279('0x8')](config[_0x8279('0x7')],{'host':_0x8279('0x9'),'port':0x18eb});var io=require(_0x8279('0xa'))(new Redis(config[_0x8279('0x7')]));function VoiceAgentReport(_0x559984){this[_0x8279('0xb')]={};this[_0x8279('0xc')]=_0x559984[_0x8279('0xc')];this[_0x8279('0xd')]=_0x559984['agents'];this[_0x8279('0xe')]={};ami['on'](_0x8279('0xf'),this[_0x8279('0x10')][_0x8279('0x11')](this));ami['on'](_0x8279('0x12'),this['syncAgentConnect'][_0x8279('0x11')](this));ami['on'](_0x8279('0x13'),this[_0x8279('0x14')][_0x8279('0x11')](this));ami['on'](_0x8279('0x15'),this[_0x8279('0x16')][_0x8279('0x11')](this));ami['on'](_0x8279('0x17'),this[_0x8279('0x18')][_0x8279('0x11')](this));ami['on'](_0x8279('0x19'),this[_0x8279('0x1a')][_0x8279('0x11')](this));ami['on']('hangup',this['syncHangup'][_0x8279('0x11')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x8279('0x11')](this));ami['on'](_0x8279('0x1b'),this[_0x8279('0x1c')]['bind'](this));ami['on'](_0x8279('0x1d'),this[_0x8279('0x1e')][_0x8279('0x11')](this));ami['on'](_0x8279('0x1f'),this[_0x8279('0x20')][_0x8279('0x11')](this));}VoiceAgentReport[_0x8279('0x21')]['emit']=function(_0x116794,_0x5601b1,_0x3ea64a){io['to'](_0x116794)['emit'](_0x5601b1,_0x3ea64a);};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x22')]=function(_0x5d45eb){return _0x5d45eb!==null&&!_[_0x8279('0x23')](_0x5d45eb);};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x10')]=function(_0x4014ac){try{if(this[_0x8279('0x22')](_0x4014ac)){if(_['isUndefined'](this['channels'][_0x4014ac['uniqueid']])){this[_0x8279('0xb')][_0x4014ac['uniqueid']]={};}if(_[_0x8279('0x23')](this[_0x8279('0xb')][_0x4014ac['uniqueid']][_0x4014ac[_0x8279('0x24')]])){this[_0x8279('0xb')][_0x4014ac[_0x8279('0x25')]][_0x4014ac[_0x8279('0x24')]]={'agentcalledAt':moment()['format'](_0x8279('0x26')),'lastevent':_0x8279('0x27'),'variables':this[_0x8279('0xe')][_0x4014ac['uniqueid']],'type':this[_0x8279('0xc')][_0x4014ac[_0x8279('0x28')]]?this['voiceQueues'][_0x4014ac[_0x8279('0x28')]][_0x8279('0x29')]||_0x8279('0x2a'):'inbound'};}_[_0x8279('0x2b')](this['channels'][_0x4014ac[_0x8279('0x25')]][_0x4014ac['destuniqueid']],_[_0x8279('0x2c')](_0x4014ac,[_0x8279('0x2d'),'privilege']));ami[_0x8279('0x2e')](_0x8279('0x2f'),this[_0x8279('0xb')][_0x4014ac[_0x8279('0x25')]][_0x4014ac['destuniqueid']]);this[_0x8279('0x2e')](util[_0x8279('0x30')](_0x8279('0x31'),_0x4014ac[_0x8279('0x32')]),_0x8279('0x33'),this[_0x8279('0xb')][_0x4014ac[_0x8279('0x25')]][_0x4014ac['destuniqueid']]);}}catch(_0xa41d2e){logger[_0x8279('0x34')]('[syncAgentCalled][VoiceAgentReport]',util[_0x8279('0x35')](_0xa41d2e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8279('0x36')]=function(_0x56d1d9){try{if(this[_0x8279('0x22')](_0x56d1d9)){if(this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]]){for(var _0x3b8982 in this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]]){if(this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x8279('0x37')](_0x3b8982)){if(_0x56d1d9[_0x8279('0x24')]===_0x3b8982){this[_0x8279('0xb')][_0x56d1d9['uniqueid']][_0x3b8982][_0x8279('0x38')]=moment()[_0x8279('0x30')](_0x8279('0x26'));this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x39')]=_0x8279('0x3a');this['channels'][_0x56d1d9['uniqueid']][_0x3b8982][_0x8279('0x3b')]=_0x56d1d9[_0x8279('0x3b')];this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]['connectedlinenum']=_0x56d1d9[_0x8279('0x3c')];this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x3d')]=_0x56d1d9['connectedlinename'];this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x3e')]=_0x56d1d9[_0x8279('0x3e')];this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]['destchannelstatedesc']=_0x56d1d9[_0x8279('0x3f')];_[_0x8279('0x2b')](this[_0x8279('0xd')][_0x56d1d9[_0x8279('0x40')]],_[_0x8279('0x41')](_0x56d1d9,['queue',_0x8279('0x42')]));this[_0x8279('0x2e')](util[_0x8279('0x30')](_0x8279('0x31'),_0x56d1d9[_0x8279('0x32')]),'user:agentconnect',this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x56d1d9[_0x8279('0x24')]]);ami['emit']('custom:agentconnect',this[_0x8279('0xb')][_0x56d1d9['uniqueid']][_0x3b8982]);}else if(!this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x13')]&&!this[_0x8279('0xb')][_0x56d1d9['uniqueid']][_0x3b8982][_0x8279('0x17')]){this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]['agentringnoanswer']=!![];this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x43')]=moment()[_0x8279('0x30')](_0x8279('0x26'));this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x44')]=_0x8279('0x45');this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]['lastevent']=_0x8279('0x45');this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]['answeredelsewheredestinationuniqueid']=_0x56d1d9['destuniqueid'];this[_0x8279('0xb')][_0x56d1d9['uniqueid']][_0x3b8982][_0x8279('0x46')]=_0x56d1d9[_0x8279('0x32')];ami[_0x8279('0x2e')](_0x8279('0x47'),this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]);}}}}}}catch(_0x525bbd){logger[_0x8279('0x34')]('[syncAgentConnect][VoiceAgentReport]',util[_0x8279('0x35')](_0x525bbd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8279('0x14')]=function(_0xeb0844){try{if(this[_0x8279('0x22')](_0xeb0844)){if(this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]]&&this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]][_0xeb0844[_0x8279('0x24')]]){this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]][_0xeb0844[_0x8279('0x24')]][_0x8279('0x13')]=!![];this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]][_0xeb0844[_0x8279('0x24')]]['agentringnoanswerAt']=moment()['format'](_0x8279('0x26'));this[_0x8279('0xb')][_0xeb0844['uniqueid']][_0xeb0844[_0x8279('0x24')]][_0x8279('0x44')]=_0x8279('0x48');this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]][_0xeb0844[_0x8279('0x24')]][_0x8279('0x39')]='rejected';ami[_0x8279('0x2e')](_0x8279('0x49'),this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]][_0xeb0844[_0x8279('0x24')]]);}}}catch(_0x2d3f35){logger[_0x8279('0x34')]('[syncAgentRingNoAnswer][VoiceAgentReport]',util['inspect'](_0x2d3f35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x16')]=function(_0x3dba61){try{if(this[_0x8279('0x22')](_0x3dba61)){if(this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]]){for(var _0x5f1753 in this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]]){if(this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]]['hasOwnProperty'](_0x5f1753)&&!this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]][_0x5f1753][_0x8279('0x13')]&&!this[_0x8279('0xb')][_0x3dba61['uniqueid']][_0x5f1753][_0x8279('0x17')]){this['channels'][_0x3dba61[_0x8279('0x25')]][_0x5f1753]['agentringnoanswer']=!![];this['channels'][_0x3dba61[_0x8279('0x25')]][_0x5f1753]['agentringnoanswerAt']=moment()[_0x8279('0x30')](_0x8279('0x26'));this['channels'][_0x3dba61['uniqueid']][_0x5f1753]['reason']='abandoned';this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]][_0x5f1753][_0x8279('0x39')]=_0x8279('0x4a');ami['emit']('custom:agentqueuecallerabandon',this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]][_0x5f1753]);}}}}}catch(_0x5e9ce5){logger[_0x8279('0x34')](_0x8279('0x4b'),util[_0x8279('0x35')](_0x5e9ce5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')]['syncAgentComplete']=function(_0x552ffa){try{if(this[_0x8279('0x22')](_0x552ffa)){if(this['channels'][_0x552ffa[_0x8279('0x25')]]){for(var _0xd09bef in this[_0x8279('0xb')][_0x552ffa['uniqueid']]){if(this[_0x8279('0xb')][_0x552ffa[_0x8279('0x25')]][_0x8279('0x37')](_0xd09bef)){if(this[_0x8279('0xb')][_0x552ffa['uniqueid']][_0xd09bef][_0x8279('0x38')]&&!this[_0x8279('0xb')][_0x552ffa[_0x8279('0x25')]][_0xd09bef][_0x8279('0x17')]){this[_0x8279('0xb')][_0x552ffa['uniqueid']][_0xd09bef]['agentcomplete']=!![];this[_0x8279('0xb')][_0x552ffa['uniqueid']][_0xd09bef][_0x8279('0x4c')]=moment()['format'](_0x8279('0x26'));this[_0x8279('0xb')][_0x552ffa['uniqueid']][_0xd09bef][_0x8279('0x39')]='complete';this['channels'][_0x552ffa[_0x8279('0x25')]][_0xd09bef][_0x8279('0x4d')]=_0x552ffa[_0x8279('0x4d')];this['channels'][_0x552ffa['uniqueid']][_0xd09bef]['reason']=_0x552ffa[_0x8279('0x44')]==_0x8279('0x4e')?'agent':_0x552ffa[_0x8279('0x44')];if(this[_0x8279('0xc')][_0x552ffa[_0x8279('0x28')]]&&this[_0x8279('0xc')][_0x552ffa[_0x8279('0x28')]][_0x8279('0x4f')]){this['channels'][_0x552ffa['uniqueid']][_0xd09bef][_0x8279('0x50')]=!![];this[_0x8279('0xb')][_0x552ffa[_0x8279('0x25')]][_0xd09bef][_0x8279('0x51')]=this[_0x8279('0xc')][_0x552ffa[_0x8279('0x28')]][_0x8279('0x52')];}this[_0x8279('0xd')][_0x552ffa[_0x8279('0x40')]]=_[_0x8279('0x2c')](this[_0x8279('0xd')][_0x552ffa[_0x8279('0x40')]],[_0x8279('0x28'),_0x8279('0x42')]);this['emit'](util[_0x8279('0x30')](_0x8279('0x31'),_0x552ffa[_0x8279('0x32')]),_0x8279('0x53'),this['channels'][_0x552ffa[_0x8279('0x25')]][_0xd09bef]);ami[_0x8279('0x2e')](_0x8279('0x54'),this[_0x8279('0xb')][_0x552ffa['uniqueid']][_0xd09bef]);}}}}}}catch(_0x55e241){logger[_0x8279('0x34')](_0x8279('0x55'),util[_0x8279('0x35')](_0x55e241,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x1a')]=function(_0x1ca8b6){try{if(this[_0x8279('0x22')](_0x1ca8b6)){this[_0x8279('0x56')](_0x1ca8b6[_0x8279('0x25')],_[_0x8279('0x57')](_0x1ca8b6[_0x8279('0x58')])[0x0],_0x1ca8b6[_0x8279('0x59')]);if(this[_0x8279('0xb')][_0x1ca8b6[_0x8279('0x25')]]){for(var _0x3175c3 in this[_0x8279('0xb')][_0x1ca8b6[_0x8279('0x25')]]){if(this[_0x8279('0xb')][_0x1ca8b6[_0x8279('0x25')]][_0x8279('0x37')](_0x3175c3)){if(_['isUndefined'](this[_0x8279('0xb')][_0x1ca8b6[_0x8279('0x25')]][_0x3175c3][_0x8279('0xe')])){this[_0x8279('0xb')][_0x1ca8b6['uniqueid']][_0x3175c3][_0x8279('0xe')]={};}this[_0x8279('0xb')][_0x1ca8b6[_0x8279('0x25')]][_0x3175c3]['variables']=this[_0x8279('0xe')][_0x1ca8b6[_0x8279('0x25')]];}}}}}catch(_0x19077b){logger[_0x8279('0x34')](_0x8279('0x5a'),util['inspect'](_0x19077b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x56')]=function(_0x25fa01,_0x7084d,_0x54ffb4){var _0x1fa509=['rtpaudioqos',_0x8279('0x5b'),_0x8279('0x5c'),_0x8279('0x5d'),'rtpaudioqosloss',_0x8279('0x5e'),_0x8279('0x5f'),_0x8279('0x60'),'sipcallid',_0x8279('0x61'),_0x8279('0x62'),_0x8279('0x63'),'membercalls','memberdynamic',_0x8279('0x64'),_0x8279('0x65'),'membername',_0x8279('0x66'),_0x8279('0x67')];if(!_[_0x8279('0x68')](_0x7084d)&&!_[_0x8279('0x69')](_0x1fa509,_0x7084d)){if(_[_0x8279('0x23')](this[_0x8279('0xe')][_0x25fa01])){this[_0x8279('0xe')][_0x25fa01]={};}this['variables'][_0x25fa01][_0x7084d]=_0x54ffb4;}};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x6a')]=function(_0x59833a){try{if(this[_0x8279('0x22')](_0x59833a)){if(this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]]){for(var _0x5556fe in this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]]){if(this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]]['hasOwnProperty'](_0x5556fe)){if(this['channels'][_0x59833a['uniqueid']][_0x5556fe][_0x8279('0x44')]==_0x8279('0x4e')&&this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]][_0x5556fe]['agentcomplete']){this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]][_0x5556fe][_0x8279('0x4c')]=moment()[_0x8279('0x30')](_0x8279('0x26'));}}}ami[_0x8279('0x2e')](_0x8279('0x6b'),_[_0x8279('0x6c')](this['channels'][_0x59833a[_0x8279('0x25')]]));delete this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]];}if(this[_0x8279('0xe')][_0x59833a['uniqueid']]){delete this['variables'][_0x59833a[_0x8279('0x25')]];}}}catch(_0x49e302){logger[_0x8279('0x34')](_0x8279('0x6d'),util['inspect'](_0x49e302,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x1e')]=function(_0x156614){try{if(this[_0x8279('0x22')](_0x156614)){if(this[_0x8279('0xb')][_0x156614[_0x8279('0x6e')]]){for(var _0x8a67ca in this['channels'][_0x156614['transfereeuniqueid']]){if(this['channels'][_0x156614['transfereeuniqueid']][_0x8279('0x37')](_0x8a67ca)){if(_0x156614[_0x8279('0x6f')]===_0x8a67ca){var _0x22ec81=moment();this['channels'][_0x156614[_0x8279('0x6e')]][_0x8a67ca][_0x8279('0x17')]=!![];this[_0x8279('0xb')][_0x156614[_0x8279('0x6e')]][_0x8a67ca][_0x8279('0x4c')]=moment()[_0x8279('0x30')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8279('0xb')][_0x156614[_0x8279('0x6e')]][_0x8a67ca][_0x8279('0x44')]='transfer';this[_0x8279('0xb')][_0x156614[_0x8279('0x6e')]][_0x8a67ca][_0x8279('0x39')]='complete';this[_0x8279('0xb')][_0x156614[_0x8279('0x6e')]][_0x8a67ca]['talktime']=_0x22ec81[_0x8279('0x70')](this['channels'][_0x156614['transfereeuniqueid']][_0x8a67ca][_0x8279('0x38')],'seconds');}}}}if(this[_0x8279('0xb')][_0x156614[_0x8279('0x71')]]){var _0x30ee66=this[_0x8279('0xb')][_0x156614['secondtransfereruniqueid']];this[_0x8279('0xb')][_0x156614['secondtransfereruniqueid']]=this['channels'][_0x156614[_0x8279('0x6e')]];this['channels'][_0x156614[_0x8279('0x6e')]]=_0x30ee66;}}}catch(_0x57b862){logger[_0x8279('0x34')]('[syncAttendedTransfer][VoiceAgentReport]',util[_0x8279('0x35')](_0x57b862,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')]['syncBlindTransfer']=function(_0x1e41f3){try{if(this['isNotNull'](_0x1e41f3)){if(this[_0x8279('0xb')][_0x1e41f3['transfereeuniqueid']]){for(var _0x1d8d98 in this[_0x8279('0xb')][_0x1e41f3['transfereeuniqueid']]){if(this[_0x8279('0xb')][_0x1e41f3[_0x8279('0x6e')]][_0x8279('0x37')](_0x1d8d98)){if(_0x1e41f3[_0x8279('0x72')]===_0x1d8d98){var _0x10213c=moment();this[_0x8279('0xb')][_0x1e41f3[_0x8279('0x6e')]][_0x1d8d98][_0x8279('0x17')]=!![];this[_0x8279('0xb')][_0x1e41f3['transfereeuniqueid']][_0x1d8d98][_0x8279('0x4c')]=_0x10213c;this[_0x8279('0xb')][_0x1e41f3[_0x8279('0x6e')]][_0x1d8d98][_0x8279('0x44')]=_0x8279('0x4e');this[_0x8279('0xb')][_0x1e41f3['transfereeuniqueid']][_0x1d8d98][_0x8279('0x39')]=_0x8279('0x73');this[_0x8279('0xb')][_0x1e41f3[_0x8279('0x6e')]][_0x1d8d98]['talktime']=_0x10213c[_0x8279('0x70')](this[_0x8279('0xb')][_0x1e41f3[_0x8279('0x6e')]][_0x1d8d98][_0x8279('0x38')],_0x8279('0x74'));}}}}}}catch(_0x44df04){logger[_0x8279('0x34')](_0x8279('0x75'),util[_0x8279('0x35')](_0x44df04,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8279('0x76')]=function(_0x23c46c){var _0x78a9a8='';try{if(this[_0x8279('0x22')](_0x23c46c)){if(_0x23c46c[_0x8279('0x77')]){_0x78a9a8=_0x23c46c[_0x8279('0x77')][_0x8279('0x78')](0x0,_0x23c46c['channel']['lastIndexOf']('-'));if(this[_0x8279('0xd')][_0x78a9a8]){this['agents'][_0x78a9a8][_0x8279('0x79')]=!![];}}}}catch(_0x36f5da){logger[_0x8279('0x34')](_0x8279('0x7a'),util['inspect'](_0x36f5da,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8279('0x1c')]=function(_0x39564f){var _0x386e41='';try{if(this[_0x8279('0x22')](_0x39564f)){if(_0x39564f[_0x8279('0x77')]){_0x386e41=_0x39564f[_0x8279('0x77')][_0x8279('0x78')](0x0,_0x39564f[_0x8279('0x77')]['lastIndexOf']('-'));if(this[_0x8279('0xd')][_0x386e41]){this[_0x8279('0xd')][_0x386e41][_0x8279('0x79')]=![];}}}}catch(_0x45f42c){logger[_0x8279('0x34')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x8279('0x35')](_0x45f42c,{'showHidden':![],'depth':null}));}};module[_0x8279('0x7b')]=VoiceAgentReport;
\ No newline at end of file
+var _0x7da2=['queue','type','inbound','merge','omit','event','custom:agentcalled','membername','user:called','error','inspect','hasOwnProperty','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentcomplete','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','complete','talktime','transfer','agent','agentacw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','memberrealtime','isNil','includes','agentcompleteAt','values','[syncHangup][VoiceAgentReport]','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','moment','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','syncAgentComplete','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','blindtransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','format','called','variables'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7da2,0x1ca));var _0x27da=function(_0xa7c8ce,_0x1ad6f0){_0xa7c8ce=_0xa7c8ce-0x0;var _0x1d9198=_0x7da2[_0xa7c8ce];return _0x1d9198;};'use strict';var _=require('lodash');var moment=require(_0x27da('0x0'));var util=require(_0x27da('0x1'));var Redis=require(_0x27da('0x2'));var config=require(_0x27da('0x3'));var logger=require('../../../config/logger')(_0x27da('0x4'));var ami=require(_0x27da('0x5'));config[_0x27da('0x6')]=_[_0x27da('0x7')](config['redis'],{'host':_0x27da('0x8'),'port':0x18eb});var io=require(_0x27da('0x9'))(new Redis(config[_0x27da('0x6')]));function VoiceAgentReport(_0x319f64){this[_0x27da('0xa')]={};this[_0x27da('0xb')]=_0x319f64['voiceQueues'];this[_0x27da('0xc')]=_0x319f64[_0x27da('0xc')];this['variables']={};ami['on'](_0x27da('0xd'),this[_0x27da('0xe')][_0x27da('0xf')](this));ami['on'](_0x27da('0x10'),this[_0x27da('0x11')][_0x27da('0xf')](this));ami['on'](_0x27da('0x12'),this[_0x27da('0x13')][_0x27da('0xf')](this));ami['on']('queuecallerabandon',this[_0x27da('0x14')][_0x27da('0xf')](this));ami['on']('agentcomplete',this[_0x27da('0x15')][_0x27da('0xf')](this));ami['on']('varset',this[_0x27da('0x16')]['bind'](this));ami['on'](_0x27da('0x17'),this['syncHangup'][_0x27da('0xf')](this));ami['on'](_0x27da('0x18'),this[_0x27da('0x19')][_0x27da('0xf')](this));ami['on'](_0x27da('0x1a'),this[_0x27da('0x1b')][_0x27da('0xf')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x27da('0xf')](this));ami['on'](_0x27da('0x1c'),this['syncBlindTransfer'][_0x27da('0xf')](this));}VoiceAgentReport[_0x27da('0x1d')][_0x27da('0x1e')]=function(_0xa7c414,_0x4986ed,_0x760a39){io['to'](_0xa7c414)[_0x27da('0x1e')](_0x4986ed,_0x760a39);};VoiceAgentReport['prototype'][_0x27da('0x1f')]=function(_0x288952){return _0x288952!==null&&!_['isUndefined'](_0x288952);};VoiceAgentReport[_0x27da('0x1d')][_0x27da('0xe')]=function(_0x8bc393){try{if(this[_0x27da('0x1f')](_0x8bc393)){if(_[_0x27da('0x20')](this[_0x27da('0xa')][_0x8bc393['uniqueid']])){this['channels'][_0x8bc393[_0x27da('0x21')]]={};}if(_[_0x27da('0x20')](this[_0x27da('0xa')][_0x8bc393[_0x27da('0x21')]][_0x8bc393[_0x27da('0x22')]])){this[_0x27da('0xa')][_0x8bc393['uniqueid']][_0x8bc393[_0x27da('0x22')]]={'agentcalledAt':moment()[_0x27da('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x27da('0x24'),'variables':this[_0x27da('0x25')][_0x8bc393['uniqueid']],'type':this[_0x27da('0xb')][_0x8bc393[_0x27da('0x26')]]?this['voiceQueues'][_0x8bc393['queue']][_0x27da('0x27')]||'inbound':_0x27da('0x28')};}_[_0x27da('0x29')](this[_0x27da('0xa')][_0x8bc393[_0x27da('0x21')]][_0x8bc393['destuniqueid']],_[_0x27da('0x2a')](_0x8bc393,[_0x27da('0x2b'),'privilege']));ami[_0x27da('0x1e')](_0x27da('0x2c'),this[_0x27da('0xa')][_0x8bc393['uniqueid']][_0x8bc393[_0x27da('0x22')]]);this[_0x27da('0x1e')](util[_0x27da('0x23')]('user:%s',_0x8bc393[_0x27da('0x2d')]),_0x27da('0x2e'),this[_0x27da('0xa')][_0x8bc393['uniqueid']][_0x8bc393[_0x27da('0x22')]]);}}catch(_0x3d48c2){logger[_0x27da('0x2f')]('[syncAgentCalled][VoiceAgentReport]',util[_0x27da('0x30')](_0x3d48c2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0x596bfb){try{if(this['isNotNull'](_0x596bfb)){if(this[_0x27da('0xa')][_0x596bfb[_0x27da('0x21')]]){for(var _0x39788f in this['channels'][_0x596bfb[_0x27da('0x21')]]){if(this[_0x27da('0xa')][_0x596bfb[_0x27da('0x21')]][_0x27da('0x31')](_0x39788f)){if(_0x596bfb[_0x27da('0x22')]===_0x39788f){this['channels'][_0x596bfb[_0x27da('0x21')]][_0x39788f][_0x27da('0x32')]=moment()['format'](_0x27da('0x33'));this[_0x27da('0xa')][_0x596bfb['uniqueid']][_0x39788f][_0x27da('0x34')]=_0x27da('0x35');this['channels'][_0x596bfb['uniqueid']][_0x39788f][_0x27da('0x36')]=_0x596bfb[_0x27da('0x36')];this[_0x27da('0xa')][_0x596bfb[_0x27da('0x21')]][_0x39788f][_0x27da('0x37')]=_0x596bfb[_0x27da('0x37')];this[_0x27da('0xa')][_0x596bfb[_0x27da('0x21')]][_0x39788f][_0x27da('0x38')]=_0x596bfb['connectedlinename'];this[_0x27da('0xa')][_0x596bfb[_0x27da('0x21')]][_0x39788f][_0x27da('0x39')]=_0x596bfb['destchannelstate'];this[_0x27da('0xa')][_0x596bfb['uniqueid']][_0x39788f][_0x27da('0x3a')]=_0x596bfb['destchannelstatedesc'];_[_0x27da('0x29')](this[_0x27da('0xc')][_0x596bfb[_0x27da('0x3b')]],_[_0x27da('0x3c')](_0x596bfb,[_0x27da('0x26'),_0x27da('0x3d')]));this[_0x27da('0x1e')](util[_0x27da('0x23')]('user:%s',_0x596bfb[_0x27da('0x2d')]),_0x27da('0x3e'),this[_0x27da('0xa')][_0x596bfb[_0x27da('0x21')]][_0x596bfb[_0x27da('0x22')]]);ami[_0x27da('0x1e')](_0x27da('0x3f'),this[_0x27da('0xa')][_0x596bfb[_0x27da('0x21')]][_0x39788f]);}else if(!this['channels'][_0x596bfb[_0x27da('0x21')]][_0x39788f][_0x27da('0x12')]&&!this[_0x27da('0xa')][_0x596bfb['uniqueid']][_0x39788f][_0x27da('0x40')]){this[_0x27da('0xa')][_0x596bfb[_0x27da('0x21')]][_0x39788f]['agentringnoanswer']=!![];this[_0x27da('0xa')][_0x596bfb['uniqueid']][_0x39788f][_0x27da('0x41')]=moment()[_0x27da('0x23')](_0x27da('0x33'));this[_0x27da('0xa')][_0x596bfb[_0x27da('0x21')]][_0x39788f][_0x27da('0x42')]=_0x27da('0x43');this['channels'][_0x596bfb[_0x27da('0x21')]][_0x39788f][_0x27da('0x34')]=_0x27da('0x43');this[_0x27da('0xa')][_0x596bfb['uniqueid']][_0x39788f]['answeredelsewheredestinationuniqueid']=_0x596bfb[_0x27da('0x22')];this[_0x27da('0xa')][_0x596bfb[_0x27da('0x21')]][_0x39788f][_0x27da('0x44')]=_0x596bfb[_0x27da('0x2d')];ami[_0x27da('0x1e')](_0x27da('0x45'),this['channels'][_0x596bfb[_0x27da('0x21')]][_0x39788f]);}}}}}}catch(_0xc508c8){logger['error'](_0x27da('0x46'),util[_0x27da('0x30')](_0xc508c8,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x27da('0x13')]=function(_0x4fb568){try{if(this[_0x27da('0x1f')](_0x4fb568)){if(this['channels'][_0x4fb568[_0x27da('0x21')]]&&this[_0x27da('0xa')][_0x4fb568[_0x27da('0x21')]][_0x4fb568[_0x27da('0x22')]]){this['channels'][_0x4fb568[_0x27da('0x21')]][_0x4fb568[_0x27da('0x22')]][_0x27da('0x12')]=!![];this['channels'][_0x4fb568[_0x27da('0x21')]][_0x4fb568['destuniqueid']][_0x27da('0x41')]=moment()[_0x27da('0x23')](_0x27da('0x33'));this['channels'][_0x4fb568[_0x27da('0x21')]][_0x4fb568[_0x27da('0x22')]][_0x27da('0x42')]='rejected';this[_0x27da('0xa')][_0x4fb568[_0x27da('0x21')]][_0x4fb568['destuniqueid']]['lastevent']=_0x27da('0x47');ami[_0x27da('0x1e')](_0x27da('0x48'),this[_0x27da('0xa')][_0x4fb568[_0x27da('0x21')]][_0x4fb568[_0x27da('0x22')]]);}}}catch(_0x2859b){logger[_0x27da('0x2f')](_0x27da('0x49'),util[_0x27da('0x30')](_0x2859b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x49590c){try{if(this[_0x27da('0x1f')](_0x49590c)){if(this[_0x27da('0xa')][_0x49590c[_0x27da('0x21')]]){for(var _0x4c414f in this[_0x27da('0xa')][_0x49590c['uniqueid']]){if(this['channels'][_0x49590c['uniqueid']]['hasOwnProperty'](_0x4c414f)&&!this[_0x27da('0xa')][_0x49590c[_0x27da('0x21')]][_0x4c414f][_0x27da('0x12')]&&!this['channels'][_0x49590c[_0x27da('0x21')]][_0x4c414f][_0x27da('0x40')]){this['channels'][_0x49590c['uniqueid']][_0x4c414f][_0x27da('0x12')]=!![];this['channels'][_0x49590c[_0x27da('0x21')]][_0x4c414f][_0x27da('0x41')]=moment()[_0x27da('0x23')](_0x27da('0x33'));this[_0x27da('0xa')][_0x49590c[_0x27da('0x21')]][_0x4c414f][_0x27da('0x42')]='abandoned';this[_0x27da('0xa')][_0x49590c['uniqueid']][_0x4c414f]['lastevent']=_0x27da('0x4a');ami['emit']('custom:agentqueuecallerabandon',this[_0x27da('0xa')][_0x49590c['uniqueid']][_0x4c414f]);}}}}}catch(_0x2f170b){logger[_0x27da('0x2f')](_0x27da('0x4b'),util[_0x27da('0x30')](_0x2f170b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x27da('0x1d')]['syncAgentComplete']=function(_0xc37965){try{if(this[_0x27da('0x1f')](_0xc37965)){if(this['channels'][_0xc37965[_0x27da('0x21')]]){for(var _0x26bb91 in this[_0x27da('0xa')][_0xc37965[_0x27da('0x21')]]){if(this[_0x27da('0xa')][_0xc37965[_0x27da('0x21')]]['hasOwnProperty'](_0x26bb91)){if(this[_0x27da('0xa')][_0xc37965['uniqueid']][_0x26bb91][_0x27da('0x32')]&&!this[_0x27da('0xa')][_0xc37965[_0x27da('0x21')]][_0x26bb91][_0x27da('0x40')]){this[_0x27da('0xa')][_0xc37965['uniqueid']][_0x26bb91][_0x27da('0x40')]=!![];this['channels'][_0xc37965[_0x27da('0x21')]][_0x26bb91]['agentcompleteAt']=moment()['format'](_0x27da('0x33'));this[_0x27da('0xa')][_0xc37965['uniqueid']][_0x26bb91][_0x27da('0x34')]=_0x27da('0x4c');this[_0x27da('0xa')][_0xc37965[_0x27da('0x21')]][_0x26bb91][_0x27da('0x4d')]=_0xc37965[_0x27da('0x4d')];this[_0x27da('0xa')][_0xc37965['uniqueid']][_0x26bb91][_0x27da('0x42')]=_0xc37965[_0x27da('0x42')]==_0x27da('0x4e')?_0x27da('0x4f'):_0xc37965[_0x27da('0x42')];if(this[_0x27da('0xb')][_0xc37965[_0x27da('0x26')]]&&this[_0x27da('0xb')][_0xc37965[_0x27da('0x26')]]['acw']){this['channels'][_0xc37965[_0x27da('0x21')]][_0x26bb91][_0x27da('0x50')]=!![];this['channels'][_0xc37965[_0x27da('0x21')]][_0x26bb91][_0x27da('0x51')]=this[_0x27da('0xb')][_0xc37965[_0x27da('0x26')]][_0x27da('0x52')];}this[_0x27da('0xc')][_0xc37965[_0x27da('0x3b')]]=_[_0x27da('0x2a')](this[_0x27da('0xc')][_0xc37965[_0x27da('0x3b')]],[_0x27da('0x26'),'destconnectedlinenum']);this[_0x27da('0x1e')](util[_0x27da('0x23')]('user:%s',_0xc37965[_0x27da('0x2d')]),_0x27da('0x53'),this[_0x27da('0xa')][_0xc37965[_0x27da('0x21')]][_0x26bb91]);ami['emit'](_0x27da('0x54'),this[_0x27da('0xa')][_0xc37965[_0x27da('0x21')]][_0x26bb91]);}}}}}}catch(_0x4668a2){logger['error'](_0x27da('0x55'),util[_0x27da('0x30')](_0x4668a2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x27da('0x1d')][_0x27da('0x16')]=function(_0xb98fe6){try{if(this[_0x27da('0x1f')](_0xb98fe6)){this[_0x27da('0x56')](_0xb98fe6[_0x27da('0x21')],_[_0x27da('0x57')](_0xb98fe6[_0x27da('0x58')])[0x0],_0xb98fe6[_0x27da('0x59')]);if(this[_0x27da('0xa')][_0xb98fe6[_0x27da('0x21')]]){for(var _0x255fb8 in this[_0x27da('0xa')][_0xb98fe6[_0x27da('0x21')]]){if(this['channels'][_0xb98fe6[_0x27da('0x21')]][_0x27da('0x31')](_0x255fb8)){if(_[_0x27da('0x20')](this[_0x27da('0xa')][_0xb98fe6[_0x27da('0x21')]][_0x255fb8][_0x27da('0x25')])){this[_0x27da('0xa')][_0xb98fe6[_0x27da('0x21')]][_0x255fb8]['variables']={};}this['channels'][_0xb98fe6['uniqueid']][_0x255fb8]['variables']=this[_0x27da('0x25')][_0xb98fe6[_0x27da('0x21')]];}}}}}catch(_0x2b7937){logger[_0x27da('0x2f')](_0x27da('0x5a'),util[_0x27da('0x30')](_0x2b7937,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x27da('0x1d')][_0x27da('0x56')]=function(_0x3ee5ab,_0x477718,_0x2d0849){var _0x57f626=[_0x27da('0x5b'),_0x27da('0x5c'),_0x27da('0x5d'),_0x27da('0x5e'),_0x27da('0x5f'),'rtpaudioqoslossbridged',_0x27da('0x60'),'rtpaudioqosrttbridged',_0x27da('0x61'),_0x27da('0x62'),_0x27da('0x63'),_0x27da('0x64'),'membercalls','memberdynamic',_0x27da('0x65'),_0x27da('0x66'),'membername','memberpenalty',_0x27da('0x67')];if(!_[_0x27da('0x68')](_0x477718)&&!_[_0x27da('0x69')](_0x57f626,_0x477718)){if(_[_0x27da('0x20')](this[_0x27da('0x25')][_0x3ee5ab])){this[_0x27da('0x25')][_0x3ee5ab]={};}this[_0x27da('0x25')][_0x3ee5ab][_0x477718]=_0x2d0849;}};VoiceAgentReport[_0x27da('0x1d')]['syncHangup']=function(_0x2a61a5){try{if(this['isNotNull'](_0x2a61a5)){if(this['channels'][_0x2a61a5[_0x27da('0x21')]]){for(var _0x569503 in this['channels'][_0x2a61a5[_0x27da('0x21')]]){if(this[_0x27da('0xa')][_0x2a61a5['uniqueid']][_0x27da('0x31')](_0x569503)){if(this['channels'][_0x2a61a5[_0x27da('0x21')]][_0x569503]['reason']==_0x27da('0x4e')&&this[_0x27da('0xa')][_0x2a61a5[_0x27da('0x21')]][_0x569503]['agentcomplete']){this[_0x27da('0xa')][_0x2a61a5[_0x27da('0x21')]][_0x569503][_0x27da('0x6a')]=moment()[_0x27da('0x23')](_0x27da('0x33'));}}}ami[_0x27da('0x1e')]('custom:voiceAgentReport',_[_0x27da('0x6b')](this[_0x27da('0xa')][_0x2a61a5[_0x27da('0x21')]]));delete this[_0x27da('0xa')][_0x2a61a5['uniqueid']];}if(this[_0x27da('0x25')][_0x2a61a5[_0x27da('0x21')]]){delete this[_0x27da('0x25')][_0x2a61a5[_0x27da('0x21')]];}}}catch(_0x1a812a){logger['error'](_0x27da('0x6c'),util[_0x27da('0x30')](_0x1a812a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x27da('0x6d')]=function(_0x254a27){try{if(this['isNotNull'](_0x254a27)){if(this[_0x27da('0xa')][_0x254a27[_0x27da('0x6e')]]){for(var _0x1bb394 in this[_0x27da('0xa')][_0x254a27[_0x27da('0x6e')]]){if(this[_0x27da('0xa')][_0x254a27[_0x27da('0x6e')]][_0x27da('0x31')](_0x1bb394)){if(_0x254a27[_0x27da('0x6f')]===_0x1bb394){var _0x38e75d=moment();this[_0x27da('0xa')][_0x254a27['transfereeuniqueid']][_0x1bb394][_0x27da('0x40')]=!![];this['channels'][_0x254a27[_0x27da('0x6e')]][_0x1bb394][_0x27da('0x6a')]=moment()[_0x27da('0x23')](_0x27da('0x33'));this[_0x27da('0xa')][_0x254a27[_0x27da('0x6e')]][_0x1bb394]['reason']=_0x27da('0x4e');this[_0x27da('0xa')][_0x254a27[_0x27da('0x6e')]][_0x1bb394][_0x27da('0x34')]=_0x27da('0x4c');this[_0x27da('0xa')][_0x254a27[_0x27da('0x6e')]][_0x1bb394][_0x27da('0x4d')]=_0x38e75d[_0x27da('0x70')](this[_0x27da('0xa')][_0x254a27[_0x27da('0x6e')]][_0x1bb394][_0x27da('0x32')],_0x27da('0x71'));}}}}if(this[_0x27da('0xa')][_0x254a27[_0x27da('0x72')]]){var _0x45ac7b=this[_0x27da('0xa')][_0x254a27[_0x27da('0x72')]];this['channels'][_0x254a27['secondtransfereruniqueid']]=this[_0x27da('0xa')][_0x254a27['transfereeuniqueid']];this[_0x27da('0xa')][_0x254a27[_0x27da('0x6e')]]=_0x45ac7b;}}}catch(_0x301c87){logger[_0x27da('0x2f')](_0x27da('0x73'),util[_0x27da('0x30')](_0x301c87,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x27da('0x1d')][_0x27da('0x74')]=function(_0xc8bd57){try{if(this[_0x27da('0x1f')](_0xc8bd57)){if(this[_0x27da('0xa')][_0xc8bd57[_0x27da('0x6e')]]){for(var _0x3bb614 in this[_0x27da('0xa')][_0xc8bd57['transfereeuniqueid']]){if(this[_0x27da('0xa')][_0xc8bd57['transfereeuniqueid']][_0x27da('0x31')](_0x3bb614)){if(_0xc8bd57[_0x27da('0x75')]===_0x3bb614){var _0x2e1ed1=moment();this[_0x27da('0xa')][_0xc8bd57[_0x27da('0x6e')]][_0x3bb614][_0x27da('0x40')]=!![];this['channels'][_0xc8bd57[_0x27da('0x6e')]][_0x3bb614][_0x27da('0x6a')]=_0x2e1ed1;this[_0x27da('0xa')][_0xc8bd57[_0x27da('0x6e')]][_0x3bb614][_0x27da('0x42')]='transfer';this[_0x27da('0xa')][_0xc8bd57[_0x27da('0x6e')]][_0x3bb614][_0x27da('0x34')]=_0x27da('0x4c');this[_0x27da('0xa')][_0xc8bd57[_0x27da('0x6e')]][_0x3bb614][_0x27da('0x4d')]=_0x2e1ed1[_0x27da('0x70')](this['channels'][_0xc8bd57[_0x27da('0x6e')]][_0x3bb614][_0x27da('0x32')],_0x27da('0x71'));}}}}}}catch(_0x59a08a){logger['error'](_0x27da('0x76'),util[_0x27da('0x30')](_0x59a08a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x27da('0x19')]=function(_0x39854c){var _0x285462='';try{if(this[_0x27da('0x1f')](_0x39854c)){if(_0x39854c[_0x27da('0x77')]){_0x285462=_0x39854c[_0x27da('0x77')][_0x27da('0x78')](0x0,_0x39854c[_0x27da('0x77')][_0x27da('0x79')]('-'));if(this[_0x27da('0xc')][_0x285462]){this['agents'][_0x285462][_0x27da('0x7a')]=!![];}}}}catch(_0x540b23){logger[_0x27da('0x2f')](_0x27da('0x7b'),util[_0x27da('0x30')](_0x540b23,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x4e7e5e){var _0x128161='';try{if(this[_0x27da('0x1f')](_0x4e7e5e)){if(_0x4e7e5e['channel']){_0x128161=_0x4e7e5e[_0x27da('0x77')][_0x27da('0x78')](0x0,_0x4e7e5e[_0x27da('0x77')][_0x27da('0x79')]('-'));if(this[_0x27da('0xc')][_0x128161]){this[_0x27da('0xc')][_0x128161][_0x27da('0x7a')]=![];}}}}catch(_0x421369){logger[_0x27da('0x2f')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x27da('0x30')](_0x421369,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js
index 1652b21..1ac3390 100644
--- a/server/services/ami/report/voiceCallReport.js
+++ b/server/services/ami/report/voiceCallReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc5ec=['[syncNewExten][VoiceCallReport]','syncNewState','answered','holdtime','diff','calleridnum','connectedlinenum','connectedlinename','calleridname','destinationchannel','toNumber','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','endsWith','.wav49','replace','monitorFilename','find','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','type','xmd-queue','xmd-originatecalleridnum','xmd-destination','destination','calleridpreview','xmcs-queue','sipcalluniqueid','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','billableseconds','answertime','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','context','[syncBlindTransfer][VoiceCallReport]','syncMusicOnHoldStart','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','mohtime','milliseconds','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','resolve','then','actionCoreShowChannels','log','prototype','isNotNull','isUndefined','linkedid','uniqueid','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','channel','OutgoingSpoolFailed','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','merge','split','destconnectedlinenum','exten','emit','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','appdata','starttime','subtract','duration','seconds','pick','includes','lastapplication','lastdata','startsWith','match'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc5ec,0x17e));var _0xcc5e=function(_0x30ba3a,_0x282bbe){_0x30ba3a=_0x30ba3a-0x0;var _0x4bdf7a=_0xc5ec[_0x30ba3a];return _0x4bdf7a;};'use strict';var BPromise=require(_0xcc5e('0x0'));var _=require(_0xcc5e('0x1'));var moment=require(_0xcc5e('0x2'));var util=require(_0xcc5e('0x3'));var path=require(_0xcc5e('0x4'));var Redis=require(_0xcc5e('0x5'));var config=require(_0xcc5e('0x6'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var Channel=require('../model/channel');var statusDesc=[_0xcc5e('0x7'),_0xcc5e('0x8'),_0xcc5e('0x9'),_0xcc5e('0xa'),_0xcc5e('0xb'),_0xcc5e('0xc'),'ringing',_0xcc5e('0xd'),_0xcc5e('0xe')];var applications=[_0xcc5e('0xf'),_0xcc5e('0x10'),_0xcc5e('0x11'),_0xcc5e('0x12'),_0xcc5e('0x13'),_0xcc5e('0x14')];var dispositions=[_0xcc5e('0x15'),_0xcc5e('0x16'),_0xcc5e('0x16'),_0xcc5e('0x15'),_0xcc5e('0x15'),'NO\x20ANSWER',_0xcc5e('0x17'),_0xcc5e('0x18'),_0xcc5e('0x16'),_0xcc5e('0x16'),_0xcc5e('0x16')];var actions={};config[_0xcc5e('0x19')]=_['defaults'](config[_0xcc5e('0x19')],{'host':_0xcc5e('0x1a'),'port':0x18eb});var io=require(_0xcc5e('0x1b'))(new Redis(config[_0xcc5e('0x19')]));function VoiceCallReport(_0x302086){this['channels']=_0x302086[_0xcc5e('0x1c')];this['agents']=_0x302086[_0xcc5e('0x1d')];ami['on'](_0xcc5e('0x1e'),this[_0xcc5e('0x1f')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x21'),this[_0xcc5e('0x1f')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x22'),this[_0xcc5e('0x23')][_0xcc5e('0x20')](this));ami['on']('newstate',this['syncNewState'][_0xcc5e('0x20')](this));ami['on']('varset',this[_0xcc5e('0x24')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x25'),this[_0xcc5e('0x26')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x27'),this[_0xcc5e('0x28')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x29'),this[_0xcc5e('0x2a')][_0xcc5e('0x20')](this));ami['on']('blindtransfer',this[_0xcc5e('0x2b')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x2c'),this['syncMusicOnHoldStart'][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x2d'),this['syncMusicOnHoldStop'][_0xcc5e('0x20')](this));return BPromise[_0xcc5e('0x2e')]()[_0xcc5e('0x2f')](ami[_0xcc5e('0x30')]())['catch'](function(_0x3b5627){console[_0xcc5e('0x31')](_0x3b5627);});}VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x33')]=function(_0x2b535d){return _0x2b535d!==null&&!_[_0xcc5e('0x34')](_0x2b535d);};VoiceCallReport[_0xcc5e('0x32')]['emit']=function(_0x370e1b,_0x39d4cd,_0x5e0a0a){io['to'](_0x370e1b)['emit'](_0x39d4cd,_0x5e0a0a);};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x28')]=function(_0x44a197){try{if(this[_0xcc5e('0x33')](_0x44a197)){if(_0x44a197['uniqueid']===_0x44a197[_0xcc5e('0x35')]){if(!_[_0xcc5e('0x34')](this[_0xcc5e('0x1c')][_0x44a197[_0xcc5e('0x36')]])){_['merge'](this['channels'][_0x44a197[_0xcc5e('0x36')]],_['pick'](_0x44a197,_[_0xcc5e('0x37')](this[_0xcc5e('0x1c')][_0x44a197[_0xcc5e('0x36')]])));}}}}catch(_0x2150a0){logger[_0xcc5e('0x38')](_0xcc5e('0x39'),util[_0xcc5e('0x3a')](_0x2150a0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')]['syncNewChannel']=function(_0x523363){try{if(this[_0xcc5e('0x33')](_0x523363)){if(_0x523363['uniqueid']===_0x523363[_0xcc5e('0x35')]&&_0x523363[_0xcc5e('0x3b')]!=_0xcc5e('0x3c')){if(_[_0xcc5e('0x34')](this[_0xcc5e('0x1c')][_0x523363[_0xcc5e('0x36')]])){this[_0xcc5e('0x1c')][_0x523363[_0xcc5e('0x36')]]=new Channel();this[_0xcc5e('0x1c')][_0x523363[_0xcc5e('0x36')]]['starttime']=moment()[_0xcc5e('0x3d')](_0xcc5e('0x3e'));this[_0xcc5e('0x1c')][_0x523363[_0xcc5e('0x36')]][_0xcc5e('0x3f')]=dispositions[_['toNumber'](_0x523363[_0xcc5e('0x40')])];_[_0xcc5e('0x41')](this[_0xcc5e('0x1c')][_0x523363[_0xcc5e('0x36')]],_['pick'](_0x523363,_[_0xcc5e('0x37')](this['channels'][_0x523363[_0xcc5e('0x36')]])));if(_0x523363['context']==='from-sip'){if(this[_0xcc5e('0x1d')][_0x523363[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]){this[_0xcc5e('0x1d')][_0x523363[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x43')]=_0x523363[_0xcc5e('0x44')];this[_0xcc5e('0x45')](util['format'](_0xcc5e('0x46'),this['agents'][_0x523363['channel'][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x47')]),_0xcc5e('0x48'),{'destaccountcode':this['agents'][_0x523363['channel'][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x49')],'destconnectedlinenum':_0x523363[_0xcc5e('0x44')]});}}}}}}catch(_0x1f6928){logger[_0xcc5e('0x38')](_0xcc5e('0x4a'),util[_0xcc5e('0x3a')](_0x1f6928,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x1f')]=function(_0xa5aa9b){try{if(this[_0xcc5e('0x33')](_0xa5aa9b)){if(_0xa5aa9b[_0xcc5e('0x36')]===_0xa5aa9b[_0xcc5e('0x35')]&&_0xa5aa9b['exten']!='h'&&_0xa5aa9b[_0xcc5e('0x3b')]!=_0xcc5e('0x3c')){_0xa5aa9b[_0xcc5e('0x4b')]=_0xa5aa9b[_0xcc5e('0x4b')][_0xcc5e('0x4c')]();_0xa5aa9b[_0xcc5e('0x4d')]=(_0xa5aa9b[_0xcc5e('0x4e')]||_0xa5aa9b[_0xcc5e('0x4d')])[_0xcc5e('0x4c')]();if(_[_0xcc5e('0x34')](this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]])){this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]]=new Channel();this[_0xcc5e('0x1c')][_0xa5aa9b['uniqueid']][_0xcc5e('0x4f')]=_0xa5aa9b['duration']?moment()[_0xcc5e('0x50')](moment[_0xcc5e('0x51')](_0xa5aa9b[_0xcc5e('0x51')])[_0xcc5e('0x52')](),_0xcc5e('0x52'))[_0xcc5e('0x3d')](_0xcc5e('0x3e')):moment()[_0xcc5e('0x3d')](_0xcc5e('0x3e'));this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]][_0xcc5e('0x3f')]=_0xcc5e('0x15');}_[_0xcc5e('0x41')](this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]],_[_0xcc5e('0x53')](_0xa5aa9b,_[_0xcc5e('0x37')](this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]])));if(_[_0xcc5e('0x54')](applications,_0xa5aa9b[_0xcc5e('0x4b')])){this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]][_0xcc5e('0x55')]=_0xa5aa9b[_0xcc5e('0x4b')];this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]][_0xcc5e('0x56')]=_0xa5aa9b['applicationdata'];if(_0xa5aa9b[_0xcc5e('0x4b')]===_0xcc5e('0xf')&&_[_0xcc5e('0x57')](_0xa5aa9b[_0xcc5e('0x4d')],'cdr(')){var _0x257a25=_0xa5aa9b['applicationdata'][_0xcc5e('0x42')]('=');var _0x2b9e54=_0x257a25[0x0][_0xcc5e('0x58')](/cdr\((.*)\)/);if(_0x2b9e54){this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]][_0x2b9e54[0x1]]=_0x257a25[0x1];}}else if(_0xa5aa9b[_0xcc5e('0x4b')]===_0xcc5e('0x10')){this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]][_0xcc5e('0x10')]=_0xa5aa9b[_0xcc5e('0x4d')]['split'](',')[0x0];}}}}}catch(_0xa97336){logger[_0xcc5e('0x38')](_0xcc5e('0x59'),util[_0xcc5e('0x3a')](_0xa97336,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x5a')]=function(_0x52639d){try{if(this[_0xcc5e('0x33')](_0x52639d)){if(_0x52639d['uniqueid']!==_0x52639d[_0xcc5e('0x35')]){if(this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]]){if(_0x52639d[_0xcc5e('0x40')]==='6'){if(!this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x5b')]){var _0x5ca5c3=moment();this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x5b')]=!![];this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]]['answertime']=_0x5ca5c3[_0xcc5e('0x3d')](_0xcc5e('0x3e'));if(this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]]['starttime']){this[_0xcc5e('0x1c')][_0x52639d['linkedid']][_0xcc5e('0x5c')]=_0x5ca5c3[_0xcc5e('0x5d')](this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x4f')],_0xcc5e('0x52'));}}this['channels'][_0x52639d[_0xcc5e('0x35')]]['linkedid']=_0x52639d[_0xcc5e('0x36')];if(_0x52639d[_0xcc5e('0x5e')]!=='xcally-motion-preview'){this['channels'][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x5f')]=_0x52639d[_0xcc5e('0x5e')];}this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x60')]=_0x52639d[_0xcc5e('0x61')];this[_0xcc5e('0x1c')][_0x52639d['linkedid']][_0xcc5e('0x62')]=_0x52639d[_0xcc5e('0x3b')];this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]]['disposition']=dispositions[_[_0xcc5e('0x63')](_0x52639d[_0xcc5e('0x40')])];if(this[_0xcc5e('0x1d')][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]){this['channels'][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x64')]=this[_0xcc5e('0x1d')][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]['id'];this['channels'][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x65')]=this['agents'][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x47')];}}}}else{if(this['channels'][_0x52639d['uniqueid']]){if(_0x52639d['channelstate']==='6'){if(this[_0xcc5e('0x1d')][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]){this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x36')]][_0xcc5e('0x64')]=this[_0xcc5e('0x1d')][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]['id'];this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x36')]][_0xcc5e('0x65')]=this[_0xcc5e('0x1d')][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x47')];}}}}}}catch(_0x3bea5b){logger[_0xcc5e('0x38')](_0xcc5e('0x66'),util['inspect'](_0x3bea5b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x67')]=function(_0x5e439a,_0x297007){if(this['channels'][_0x5e439a]){this[_0xcc5e('0x1c')][_0x5e439a]['monitor']=!![];if(_[_0xcc5e('0x68')](_0x297007,_0xcc5e('0x69'))){_0x297007=_0x297007[_0xcc5e('0x6a')](_0xcc5e('0x69'),'.WAV');}this[_0xcc5e('0x1c')][_0x5e439a][_0xcc5e('0x6b')]=_0x297007;var _0x142fa3=_[_0xcc5e('0x6c')](this[_0xcc5e('0x1c')][_0x5e439a][_0xcc5e('0x6d')],{'filename':_0x297007});if(_[_0xcc5e('0x6e')](_0x142fa3)){this[_0xcc5e('0x1c')][_0x5e439a][_0xcc5e('0x6d')][_0xcc5e('0x6f')]({'filename':_0x297007,'createdAt':moment()[_0xcc5e('0x3d')](_0xcc5e('0x3e')),'mixmonitorid':'','status':_0xcc5e('0x70')});}}};VoiceCallReport['prototype'][_0xcc5e('0x24')]=function(_0xc6e598){try{if(this[_0xcc5e('0x33')](_0xc6e598)){if(this[_0xcc5e('0x1c')][_0xc6e598[_0xcc5e('0x36')]]&&_0xc6e598[_0xcc5e('0x3b')]!=_0xcc5e('0x3c')){if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')])){if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x72')])){this[_0xcc5e('0x67')](_0xc6e598[_0xcc5e('0x36')],_0xc6e598[_0xcc5e('0x73')]);}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x74')])){this['channels'][_0xc6e598[_0xcc5e('0x36')]][_0xcc5e('0x5e')]=_0xc6e598[_0xcc5e('0x73')];}else if(this[_0xcc5e('0x33')](_0xc6e598['variable'][_0xcc5e('0x75')])){this[_0xcc5e('0x1c')][_0xc6e598[_0xcc5e('0x36')]][_0xcc5e('0x76')]=_0xc6e598['value'];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')]['xmd-cdrtype'])){this[_0xcc5e('0x1c')][_0xc6e598[_0xcc5e('0x36')]][_0xcc5e('0x77')]=_0xc6e598[_0xcc5e('0x73')];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x78')])){this[_0xcc5e('0x1c')][_0xc6e598[_0xcc5e('0x36')]][_0xcc5e('0x10')]=_0xc6e598['value'][_0xcc5e('0x42')](',')[0x0];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x79')])){this['channels'][_0xc6e598[_0xcc5e('0x36')]]['originatecalleridnum']=_0xc6e598[_0xcc5e('0x73')];}else if(this[_0xcc5e('0x33')](_0xc6e598['variable'][_0xcc5e('0x7a')])){this[_0xcc5e('0x1c')][_0xc6e598['uniqueid']][_0xcc5e('0x7b')]=_0xc6e598['value'];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')]['xmd-callerid-preview'])){this['channels'][_0xc6e598['uniqueid']][_0xcc5e('0x7c')]=_0xc6e598['value'];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x7d')])){this[_0xcc5e('0x1c')][_0xc6e598['uniqueid']][_0xcc5e('0x10')]=_0xc6e598[_0xcc5e('0x73')];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')]['sipcallid'])){this[_0xcc5e('0x1c')][_0xc6e598['uniqueid']][_0xcc5e('0x7e')]=_0xc6e598[_0xcc5e('0x73')];}}}else if(this[_0xcc5e('0x33')](_0xc6e598['variable'][_0xcc5e('0x72')])){if(_0xc6e598[_0xcc5e('0x73')]){var _0x2a638d=path[_0xcc5e('0x7f')](_0xc6e598[_0xcc5e('0x73')])['name'];this[_0xcc5e('0x67')](_0x2a638d,_0xc6e598[_0xcc5e('0x73')]);}}else if(this['channels'][_0xc6e598[_0xcc5e('0x35')]]){if(this['isNotNull'](_0xc6e598[_0xcc5e('0x71')])){if(this['isNotNull'](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x80')])){this[_0xcc5e('0x1c')][_0xc6e598[_0xcc5e('0x35')]][_0xcc5e('0x81')]=_0xc6e598[_0xcc5e('0x73')];}}}}}catch(_0x3e6a0e){logger[_0xcc5e('0x38')](_0xcc5e('0x82'),util[_0xcc5e('0x3a')](_0x3e6a0e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xcc5e('0x26')]=function(_0x2bf866){try{if(this[_0xcc5e('0x33')](_0x2bf866)){if(this['channels'][_0x2bf866[_0xcc5e('0x36')]]){var _0x8113eb=moment();this['channels'][_0x2bf866[_0xcc5e('0x36')]]['endtime']=_0x8113eb[_0xcc5e('0x3d')](_0xcc5e('0x3e'));this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x51')]=_0x8113eb['diff'](this['channels'][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x4f')],_0xcc5e('0x52'));if(this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x5b')]){this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x83')]=_0x8113eb[_0xcc5e('0x5d')](this['channels'][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x84')],_0xcc5e('0x52'));this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x5c')]=this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]]['duration']-this[_0xcc5e('0x1c')][_0x2bf866['uniqueid']][_0xcc5e('0x83')];}if(_0x2bf866['context']==='from-sip'){if(this['agents'][_0x2bf866[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]){this[_0xcc5e('0x1d')][_0x2bf866['channel'][_0xcc5e('0x42')]('-')[0x0]]=_[_0xcc5e('0x85')](this[_0xcc5e('0x1d')][_0x2bf866[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]],['destconnectedlinenum']);this[_0xcc5e('0x45')](util[_0xcc5e('0x3d')](_0xcc5e('0x46'),this[_0xcc5e('0x1d')][_0x2bf866[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x47')]),_0xcc5e('0x86'),{'destaccountcode':this[_0xcc5e('0x1d')][_0x2bf866[_0xcc5e('0x3b')]['split']('-')[0x0]][_0xcc5e('0x49')]});}}ami['emit'](_0xcc5e('0x87'),this['channels'][_0x2bf866[_0xcc5e('0x36')]]);delete this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]];}}}catch(_0x506fe5){logger[_0xcc5e('0x38')](_0xcc5e('0x88'),util[_0xcc5e('0x3a')](_0x506fe5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x2a')]=function(_0x33362d){try{if(this[_0xcc5e('0x33')](_0x33362d)){if(this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x89')]]){this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x89')]]['transfercalleridnum']=_0x33362d[_0xcc5e('0x8a')];this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x89')]][_0xcc5e('0x8b')]=_0x33362d[_0xcc5e('0x8c')];if(this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x8d')]]){var _0x32d6ac=this[_0xcc5e('0x1c')][_0x33362d['secondtransfereruniqueid']];this['channels'][_0x33362d[_0xcc5e('0x8d')]]=this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x89')]];this[_0xcc5e('0x1c')][_0x33362d['transfereeuniqueid']]=_0x32d6ac;}}else if(this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x8e')]]){this[_0xcc5e('0x1c')][_0x33362d['transfertargetuniqueid']][_0xcc5e('0x8f')]=_0x33362d['origtransferercalleridnum'];this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x8e')]][_0xcc5e('0x8b')]=_0x33362d['transfertargetcalleridnum'];if(this[_0xcc5e('0x1c')][_0x33362d['origtransfereruniqueid']]){var _0x32d6ac=this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x90')]];this['channels'][_0x33362d[_0xcc5e('0x90')]]=this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x8e')]];this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x8e')]]=_0x32d6ac;}}}}catch(_0x348267){logger[_0xcc5e('0x38')](_0xcc5e('0x91'),util[_0xcc5e('0x3a')](_0x348267,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xcc5e('0x2b')]=function(_0x312794){try{if(this[_0xcc5e('0x33')](_0x312794)){if(this[_0xcc5e('0x1c')][_0x312794[_0xcc5e('0x89')]]){this[_0xcc5e('0x1c')][_0x312794[_0xcc5e('0x89')]][_0xcc5e('0x8f')]=_0x312794[_0xcc5e('0x92')];this[_0xcc5e('0x1c')][_0x312794[_0xcc5e('0x89')]]['transferconnectedlinenum']=_0x312794[_0xcc5e('0x93')];this[_0xcc5e('0x26')]({'event':_0xcc5e('0x94'),'uniqueid':_0x312794[_0xcc5e('0x89')],'context':_0x312794[_0xcc5e('0x95')],'channel':_0x312794['transfererchannel']});}}}catch(_0x182404){logger[_0xcc5e('0x38')](_0xcc5e('0x96'),util['inspect'](_0x182404,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x97')]=function(_0x2be71c){try{if(this[_0xcc5e('0x33')](_0x2be71c)){if(this[_0xcc5e('0x1c')][_0x2be71c[_0xcc5e('0x36')]]){if(!_[_0xcc5e('0x6e')](this[_0xcc5e('0x1c')][_0x2be71c[_0xcc5e('0x36')]][_0xcc5e('0x84')])){this[_0xcc5e('0x1c')][_0x2be71c[_0xcc5e('0x36')]][_0xcc5e('0x98')]=moment()[_0xcc5e('0x3d')](_0xcc5e('0x3e'));}}}}catch(_0x3e8fe0){logger[_0xcc5e('0x38')](_0xcc5e('0x99'),util['inspect'](_0x3e8fe0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x9a')]=function(_0xdf05d1){try{if(this[_0xcc5e('0x33')](_0xdf05d1)){if(this['channels'][_0xdf05d1['uniqueid']]){if(!_[_0xcc5e('0x6e')](this[_0xcc5e('0x1c')][_0xdf05d1[_0xcc5e('0x36')]][_0xcc5e('0x98')])){this[_0xcc5e('0x1c')][_0xdf05d1[_0xcc5e('0x36')]][_0xcc5e('0x9b')]+=moment()[_0xcc5e('0x9c')](0x0)[_0xcc5e('0x5d')](this['channels'][_0xdf05d1['uniqueid']][_0xcc5e('0x98')],'seconds');delete this[_0xcc5e('0x1c')][_0xdf05d1[_0xcc5e('0x36')]][_0xcc5e('0x98')];}}}}catch(_0x305f26){logger['error']('[syncMusicOnHoldStop][VoiceCallReport]',util[_0xcc5e('0x3a')](_0x305f26,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
+var _0xacd1=['isNotNull','prototype','emit','uniqueid','isUndefined','merge','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','syncNewChannel','channel','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','context','split','destconnectedlinenum','user:%s','name','user:agentconnect','accountcode','exten','[syncNewChannel][VoiceCallReport]','linkedid','application','toLowerCase','applicationdata','appdata','starttime','duration','subtract','seconds','includes','lastapplication','lastdata','startsWith','cdr(','match','queue','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','xcally-motion-preview','connectedlinenum','calleridnum','connectedlinename','toNumber','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','replace','.WAV','monitorFilename','find','monitors','isNil','rec','syncVarSet','OutgoingSpoolFailed','variable','mixmonitor_filename','xmd-phone','value','xmd-callerid','callerid','type','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','from-sip','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','[syncMusicOnHoldStop][VoiceCallReport]','exports','lodash','moment','path','../../../config/logger','ami','../ami','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','set','agi','dial','voicemail','NO\x20ANSWER','FAILED','defaults','redis','localhost','socket.io-emitter','channels','agents','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','varset','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','then','catch','log'];(function(_0x484cac,_0x30ad3a){var _0x1d6e77=function(_0x4f5f16){while(--_0x4f5f16){_0x484cac['push'](_0x484cac['shift']());}};_0x1d6e77(++_0x30ad3a);}(_0xacd1,0xff));var _0x1acd=function(_0x2c8437,_0x495263){_0x2c8437=_0x2c8437-0x0;var _0xbd03d7=_0xacd1[_0x2c8437];return _0xbd03d7;};'use strict';var BPromise=require('bluebird');var _=require(_0x1acd('0x0'));var moment=require(_0x1acd('0x1'));var util=require('util');var path=require(_0x1acd('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x1acd('0x3'))(_0x1acd('0x4'));var ami=require(_0x1acd('0x5'));var Channel=require('../model/channel');var statusDesc=[_0x1acd('0x6'),_0x1acd('0x7'),_0x1acd('0x8'),_0x1acd('0x9'),_0x1acd('0xa'),_0x1acd('0xb'),_0x1acd('0xc'),_0x1acd('0xd'),'onhold'];var applications=[_0x1acd('0xe'),'queue',_0x1acd('0xf'),_0x1acd('0x10'),'playback',_0x1acd('0x11')];var dispositions=[_0x1acd('0x12'),_0x1acd('0x13'),_0x1acd('0x13'),_0x1acd('0x12'),'NO\x20ANSWER',_0x1acd('0x12'),'ANSWERED','BUSY','FAILED',_0x1acd('0x13'),_0x1acd('0x13')];var actions={};config['redis']=_[_0x1acd('0x14')](config[_0x1acd('0x15')],{'host':_0x1acd('0x16'),'port':0x18eb});var io=require(_0x1acd('0x17'))(new Redis(config[_0x1acd('0x15')]));function VoiceCallReport(_0x308f36){this[_0x1acd('0x18')]=_0x308f36['channels'];this[_0x1acd('0x19')]=_0x308f36['agents'];ami['on']('coreshowchannel',this[_0x1acd('0x1a')][_0x1acd('0x1b')](this));ami['on'](_0x1acd('0x1c'),this[_0x1acd('0x1a')][_0x1acd('0x1b')](this));ami['on'](_0x1acd('0x1d'),this['syncNewChannel'][_0x1acd('0x1b')](this));ami['on'](_0x1acd('0x1e'),this[_0x1acd('0x1f')][_0x1acd('0x1b')](this));ami['on'](_0x1acd('0x20'),this['syncVarSet']['bind'](this));ami['on']('hangup',this[_0x1acd('0x21')][_0x1acd('0x1b')](this));ami['on'](_0x1acd('0x22'),this[_0x1acd('0x23')][_0x1acd('0x1b')](this));ami['on'](_0x1acd('0x24'),this['syncAttendedTransfer'][_0x1acd('0x1b')](this));ami['on'](_0x1acd('0x25'),this['syncBlindTransfer'][_0x1acd('0x1b')](this));ami['on'](_0x1acd('0x26'),this[_0x1acd('0x27')][_0x1acd('0x1b')](this));ami['on'](_0x1acd('0x28'),this[_0x1acd('0x29')]['bind'](this));return BPromise['resolve']()[_0x1acd('0x2a')](ami['actionCoreShowChannels']())[_0x1acd('0x2b')](function(_0x2b070c){console[_0x1acd('0x2c')](_0x2b070c);});}VoiceCallReport['prototype'][_0x1acd('0x2d')]=function(_0x33f6ca){return _0x33f6ca!==null&&!_['isUndefined'](_0x33f6ca);};VoiceCallReport[_0x1acd('0x2e')]['emit']=function(_0x1b4451,_0x1d533b,_0x57670e){io['to'](_0x1b4451)[_0x1acd('0x2f')](_0x1d533b,_0x57670e);};VoiceCallReport[_0x1acd('0x2e')][_0x1acd('0x23')]=function(_0x478880){try{if(this['isNotNull'](_0x478880)){if(_0x478880[_0x1acd('0x30')]===_0x478880['linkedid']){if(!_[_0x1acd('0x31')](this[_0x1acd('0x18')][_0x478880[_0x1acd('0x30')]])){_[_0x1acd('0x32')](this['channels'][_0x478880[_0x1acd('0x30')]],_[_0x1acd('0x33')](_0x478880,_[_0x1acd('0x34')](this[_0x1acd('0x18')][_0x478880[_0x1acd('0x30')]])));}}}}catch(_0x465452){logger[_0x1acd('0x35')](_0x1acd('0x36'),util[_0x1acd('0x37')](_0x465452,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1acd('0x2e')][_0x1acd('0x38')]=function(_0x163f84){try{if(this['isNotNull'](_0x163f84)){if(_0x163f84[_0x1acd('0x30')]===_0x163f84['linkedid']&&_0x163f84[_0x1acd('0x39')]!='OutgoingSpoolFailed'){if(_['isUndefined'](this[_0x1acd('0x18')][_0x163f84[_0x1acd('0x30')]])){this['channels'][_0x163f84[_0x1acd('0x30')]]=new Channel();this[_0x1acd('0x18')][_0x163f84['uniqueid']]['starttime']=moment()[_0x1acd('0x3a')](_0x1acd('0x3b'));this[_0x1acd('0x18')][_0x163f84['uniqueid']][_0x1acd('0x3c')]=dispositions[_['toNumber'](_0x163f84[_0x1acd('0x3d')])];_[_0x1acd('0x32')](this[_0x1acd('0x18')][_0x163f84['uniqueid']],_[_0x1acd('0x33')](_0x163f84,_[_0x1acd('0x34')](this['channels'][_0x163f84[_0x1acd('0x30')]])));if(_0x163f84[_0x1acd('0x3e')]==='from-sip'){if(this['agents'][_0x163f84[_0x1acd('0x39')][_0x1acd('0x3f')]('-')[0x0]]){this[_0x1acd('0x19')][_0x163f84[_0x1acd('0x39')]['split']('-')[0x0]][_0x1acd('0x40')]=_0x163f84['exten'];this[_0x1acd('0x2f')](util[_0x1acd('0x3a')](_0x1acd('0x41'),this['agents'][_0x163f84[_0x1acd('0x39')][_0x1acd('0x3f')]('-')[0x0]][_0x1acd('0x42')]),_0x1acd('0x43'),{'destaccountcode':this[_0x1acd('0x19')][_0x163f84[_0x1acd('0x39')][_0x1acd('0x3f')]('-')[0x0]][_0x1acd('0x44')],'destconnectedlinenum':_0x163f84[_0x1acd('0x45')]});}}}}}}catch(_0x4e1fcd){logger[_0x1acd('0x35')](_0x1acd('0x46'),util[_0x1acd('0x37')](_0x4e1fcd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1acd('0x2e')][_0x1acd('0x1a')]=function(_0x7e58f){try{if(this['isNotNull'](_0x7e58f)){if(_0x7e58f[_0x1acd('0x30')]===_0x7e58f[_0x1acd('0x47')]&&_0x7e58f[_0x1acd('0x45')]!='h'&&_0x7e58f[_0x1acd('0x39')]!='OutgoingSpoolFailed'){_0x7e58f['application']=_0x7e58f[_0x1acd('0x48')][_0x1acd('0x49')]();_0x7e58f[_0x1acd('0x4a')]=(_0x7e58f[_0x1acd('0x4b')]||_0x7e58f[_0x1acd('0x4a')])['toLowerCase']();if(_['isUndefined'](this[_0x1acd('0x18')][_0x7e58f[_0x1acd('0x30')]])){this['channels'][_0x7e58f[_0x1acd('0x30')]]=new Channel();this[_0x1acd('0x18')][_0x7e58f[_0x1acd('0x30')]][_0x1acd('0x4c')]=_0x7e58f[_0x1acd('0x4d')]?moment()[_0x1acd('0x4e')](moment[_0x1acd('0x4d')](_0x7e58f[_0x1acd('0x4d')])[_0x1acd('0x4f')](),'seconds')[_0x1acd('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x1acd('0x3a')](_0x1acd('0x3b'));this[_0x1acd('0x18')][_0x7e58f[_0x1acd('0x30')]][_0x1acd('0x3c')]=_0x1acd('0x12');}_[_0x1acd('0x32')](this['channels'][_0x7e58f[_0x1acd('0x30')]],_[_0x1acd('0x33')](_0x7e58f,_['keys'](this[_0x1acd('0x18')][_0x7e58f['uniqueid']])));if(_[_0x1acd('0x50')](applications,_0x7e58f['application'])){this[_0x1acd('0x18')][_0x7e58f[_0x1acd('0x30')]][_0x1acd('0x51')]=_0x7e58f['application'];this[_0x1acd('0x18')][_0x7e58f[_0x1acd('0x30')]][_0x1acd('0x52')]=_0x7e58f[_0x1acd('0x4a')];if(_0x7e58f[_0x1acd('0x48')]==='set'&&_[_0x1acd('0x53')](_0x7e58f['applicationdata'],_0x1acd('0x54'))){var _0x12be47=_0x7e58f[_0x1acd('0x4a')][_0x1acd('0x3f')]('=');var _0x1ed461=_0x12be47[0x0][_0x1acd('0x55')](/cdr\((.*)\)/);if(_0x1ed461){this[_0x1acd('0x18')][_0x7e58f[_0x1acd('0x30')]][_0x1ed461[0x1]]=_0x12be47[0x1];}}else if(_0x7e58f[_0x1acd('0x48')]===_0x1acd('0x56')){this['channels'][_0x7e58f['uniqueid']][_0x1acd('0x56')]=_0x7e58f[_0x1acd('0x4a')][_0x1acd('0x3f')](',')[0x0];}}}}}catch(_0x1405ae){logger[_0x1acd('0x35')](_0x1acd('0x57'),util[_0x1acd('0x37')](_0x1405ae,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1acd('0x2e')]['syncNewState']=function(_0x311504){try{if(this['isNotNull'](_0x311504)){if(_0x311504[_0x1acd('0x30')]!==_0x311504[_0x1acd('0x47')]){if(this['channels'][_0x311504['linkedid']]){if(_0x311504[_0x1acd('0x3d')]==='6'){if(!this['channels'][_0x311504['linkedid']][_0x1acd('0x58')]){var _0x52c2c4=moment();this[_0x1acd('0x18')][_0x311504[_0x1acd('0x47')]][_0x1acd('0x58')]=!![];this[_0x1acd('0x18')][_0x311504[_0x1acd('0x47')]][_0x1acd('0x59')]=_0x52c2c4['format'](_0x1acd('0x3b'));if(this[_0x1acd('0x18')][_0x311504[_0x1acd('0x47')]][_0x1acd('0x4c')]){this[_0x1acd('0x18')][_0x311504[_0x1acd('0x47')]][_0x1acd('0x5a')]=_0x52c2c4[_0x1acd('0x5b')](this[_0x1acd('0x18')][_0x311504[_0x1acd('0x47')]]['starttime'],_0x1acd('0x4f'));}}this[_0x1acd('0x18')][_0x311504[_0x1acd('0x47')]][_0x1acd('0x47')]=_0x311504[_0x1acd('0x30')];if(_0x311504['calleridnum']!==_0x1acd('0x5c')){this[_0x1acd('0x18')][_0x311504[_0x1acd('0x47')]][_0x1acd('0x5d')]=_0x311504[_0x1acd('0x5e')];}this['channels'][_0x311504[_0x1acd('0x47')]][_0x1acd('0x5f')]=_0x311504['calleridname'];this[_0x1acd('0x18')][_0x311504[_0x1acd('0x47')]]['destinationchannel']=_0x311504['channel'];this['channels'][_0x311504[_0x1acd('0x47')]][_0x1acd('0x3c')]=dispositions[_[_0x1acd('0x60')](_0x311504[_0x1acd('0x3d')])];if(this[_0x1acd('0x19')][_0x311504[_0x1acd('0x39')]['split']('-')[0x0]]){this[_0x1acd('0x18')][_0x311504[_0x1acd('0x47')]][_0x1acd('0x61')]=this[_0x1acd('0x19')][_0x311504[_0x1acd('0x39')][_0x1acd('0x3f')]('-')[0x0]]['id'];this['channels'][_0x311504[_0x1acd('0x47')]]['membername']=this[_0x1acd('0x19')][_0x311504['channel'][_0x1acd('0x3f')]('-')[0x0]][_0x1acd('0x42')];}}}}else{if(this[_0x1acd('0x18')][_0x311504['uniqueid']]){if(_0x311504['channelstate']==='6'){if(this['agents'][_0x311504[_0x1acd('0x39')][_0x1acd('0x3f')]('-')[0x0]]){this[_0x1acd('0x18')][_0x311504['uniqueid']]['UserId']=this[_0x1acd('0x19')][_0x311504['channel'][_0x1acd('0x3f')]('-')[0x0]]['id'];this['channels'][_0x311504[_0x1acd('0x30')]][_0x1acd('0x62')]=this[_0x1acd('0x19')][_0x311504['channel']['split']('-')[0x0]][_0x1acd('0x42')];}}}}}}catch(_0x46a465){logger['error'](_0x1acd('0x63'),util[_0x1acd('0x37')](_0x46a465,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1acd('0x2e')][_0x1acd('0x64')]=function(_0x5981a3,_0x39ae0d){if(this[_0x1acd('0x18')][_0x5981a3]){this[_0x1acd('0x18')][_0x5981a3][_0x1acd('0x65')]=!![];if(_[_0x1acd('0x66')](_0x39ae0d,'.wav49')){_0x39ae0d=_0x39ae0d[_0x1acd('0x67')]('.wav49',_0x1acd('0x68'));}this[_0x1acd('0x18')][_0x5981a3][_0x1acd('0x69')]=_0x39ae0d;var _0x2fed5a=_[_0x1acd('0x6a')](this['channels'][_0x5981a3][_0x1acd('0x6b')],{'filename':_0x39ae0d});if(_[_0x1acd('0x6c')](_0x2fed5a)){this[_0x1acd('0x18')][_0x5981a3][_0x1acd('0x6b')]['push']({'filename':_0x39ae0d,'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x1acd('0x6d')});}}};VoiceCallReport[_0x1acd('0x2e')][_0x1acd('0x6e')]=function(_0xda4c03){try{if(this[_0x1acd('0x2d')](_0xda4c03)){if(this['channels'][_0xda4c03[_0x1acd('0x30')]]&&_0xda4c03['channel']!=_0x1acd('0x6f')){if(this[_0x1acd('0x2d')](_0xda4c03[_0x1acd('0x70')])){if(this['isNotNull'](_0xda4c03[_0x1acd('0x70')][_0x1acd('0x71')])){this['syncMixMonitorFilename'](_0xda4c03[_0x1acd('0x30')],_0xda4c03['value']);}else if(this[_0x1acd('0x2d')](_0xda4c03[_0x1acd('0x70')][_0x1acd('0x72')])){this['channels'][_0xda4c03[_0x1acd('0x30')]][_0x1acd('0x5e')]=_0xda4c03[_0x1acd('0x73')];}else if(this['isNotNull'](_0xda4c03['variable'][_0x1acd('0x74')])){this[_0x1acd('0x18')][_0xda4c03[_0x1acd('0x30')]][_0x1acd('0x75')]=_0xda4c03['value'];}else if(this[_0x1acd('0x2d')](_0xda4c03['variable']['xmd-cdrtype'])){this[_0x1acd('0x18')][_0xda4c03[_0x1acd('0x30')]][_0x1acd('0x76')]=_0xda4c03['value'];}else if(this[_0x1acd('0x2d')](_0xda4c03[_0x1acd('0x70')]['xmd-queue'])){this[_0x1acd('0x18')][_0xda4c03[_0x1acd('0x30')]]['queue']=_0xda4c03['value'][_0x1acd('0x3f')](',')[0x0];}else if(this[_0x1acd('0x2d')](_0xda4c03[_0x1acd('0x70')]['xmd-originatecalleridnum'])){this[_0x1acd('0x18')][_0xda4c03['uniqueid']][_0x1acd('0x77')]=_0xda4c03[_0x1acd('0x73')];}else if(this[_0x1acd('0x2d')](_0xda4c03[_0x1acd('0x70')]['xmd-destination'])){this[_0x1acd('0x18')][_0xda4c03[_0x1acd('0x30')]][_0x1acd('0x78')]=_0xda4c03[_0x1acd('0x73')];}else if(this[_0x1acd('0x2d')](_0xda4c03[_0x1acd('0x70')][_0x1acd('0x79')])){this[_0x1acd('0x18')][_0xda4c03[_0x1acd('0x30')]][_0x1acd('0x7a')]=_0xda4c03[_0x1acd('0x73')];}else if(this[_0x1acd('0x2d')](_0xda4c03['variable'][_0x1acd('0x7b')])){this[_0x1acd('0x18')][_0xda4c03['uniqueid']]['queue']=_0xda4c03[_0x1acd('0x73')];}else if(this[_0x1acd('0x2d')](_0xda4c03[_0x1acd('0x70')][_0x1acd('0x7c')])){this[_0x1acd('0x18')][_0xda4c03[_0x1acd('0x30')]][_0x1acd('0x7d')]=_0xda4c03['value'];}}}else if(this[_0x1acd('0x2d')](_0xda4c03[_0x1acd('0x70')][_0x1acd('0x71')])){if(_0xda4c03['value']){var _0x1a1bf8=path['parse'](_0xda4c03[_0x1acd('0x73')])['name'];this[_0x1acd('0x64')](_0x1a1bf8,_0xda4c03['value']);}}else if(this[_0x1acd('0x18')][_0xda4c03[_0x1acd('0x47')]]){if(this[_0x1acd('0x2d')](_0xda4c03[_0x1acd('0x70')])){if(this[_0x1acd('0x2d')](_0xda4c03['variable'][_0x1acd('0x7c')])){this[_0x1acd('0x18')][_0xda4c03[_0x1acd('0x47')]][_0x1acd('0x7e')]=_0xda4c03['value'];}}}}}catch(_0x39ff44){logger[_0x1acd('0x35')](_0x1acd('0x7f'),util[_0x1acd('0x37')](_0x39ff44,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1acd('0x21')]=function(_0x255cc2){try{if(this[_0x1acd('0x2d')](_0x255cc2)){if(this[_0x1acd('0x18')][_0x255cc2['uniqueid']]){var _0x2765d9=moment();this[_0x1acd('0x18')][_0x255cc2[_0x1acd('0x30')]][_0x1acd('0x80')]=_0x2765d9[_0x1acd('0x3a')](_0x1acd('0x3b'));this[_0x1acd('0x18')][_0x255cc2[_0x1acd('0x30')]]['duration']=_0x2765d9['diff'](this[_0x1acd('0x18')][_0x255cc2[_0x1acd('0x30')]][_0x1acd('0x4c')],_0x1acd('0x4f'));if(this[_0x1acd('0x18')][_0x255cc2[_0x1acd('0x30')]][_0x1acd('0x58')]){this[_0x1acd('0x18')][_0x255cc2[_0x1acd('0x30')]]['billableseconds']=_0x2765d9[_0x1acd('0x5b')](this[_0x1acd('0x18')][_0x255cc2[_0x1acd('0x30')]][_0x1acd('0x59')],'seconds');this[_0x1acd('0x18')][_0x255cc2['uniqueid']][_0x1acd('0x5a')]=this['channels'][_0x255cc2[_0x1acd('0x30')]][_0x1acd('0x4d')]-this[_0x1acd('0x18')][_0x255cc2[_0x1acd('0x30')]][_0x1acd('0x81')];}if(_0x255cc2[_0x1acd('0x3e')]===_0x1acd('0x82')){if(this['agents'][_0x255cc2['channel'][_0x1acd('0x3f')]('-')[0x0]]){this[_0x1acd('0x19')][_0x255cc2['channel']['split']('-')[0x0]]=_['omit'](this[_0x1acd('0x19')][_0x255cc2[_0x1acd('0x39')][_0x1acd('0x3f')]('-')[0x0]],['destconnectedlinenum']);this[_0x1acd('0x2f')](util[_0x1acd('0x3a')](_0x1acd('0x41'),this[_0x1acd('0x19')][_0x255cc2['channel'][_0x1acd('0x3f')]('-')[0x0]][_0x1acd('0x42')]),'user:agentcomplete',{'destaccountcode':this[_0x1acd('0x19')][_0x255cc2[_0x1acd('0x39')][_0x1acd('0x3f')]('-')[0x0]][_0x1acd('0x44')]});}}ami[_0x1acd('0x2f')]('custom:voiceCallReport',this[_0x1acd('0x18')][_0x255cc2[_0x1acd('0x30')]]);delete this[_0x1acd('0x18')][_0x255cc2[_0x1acd('0x30')]];}}}catch(_0x22e082){logger[_0x1acd('0x35')](_0x1acd('0x83'),util[_0x1acd('0x37')](_0x22e082,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1acd('0x2e')][_0x1acd('0x84')]=function(_0x254a1f){try{if(this['isNotNull'](_0x254a1f)){if(this[_0x1acd('0x18')][_0x254a1f[_0x1acd('0x85')]]){this[_0x1acd('0x18')][_0x254a1f[_0x1acd('0x85')]][_0x1acd('0x86')]=_0x254a1f[_0x1acd('0x87')];this[_0x1acd('0x18')][_0x254a1f['transfereeuniqueid']][_0x1acd('0x88')]=_0x254a1f['transfertargetcalleridnum'];if(this[_0x1acd('0x18')][_0x254a1f['secondtransfereruniqueid']]){var _0x15d90a=this[_0x1acd('0x18')][_0x254a1f[_0x1acd('0x89')]];this[_0x1acd('0x18')][_0x254a1f[_0x1acd('0x89')]]=this[_0x1acd('0x18')][_0x254a1f[_0x1acd('0x85')]];this['channels'][_0x254a1f[_0x1acd('0x85')]]=_0x15d90a;}}else if(this[_0x1acd('0x18')][_0x254a1f[_0x1acd('0x8a')]]){this[_0x1acd('0x18')][_0x254a1f['transfertargetuniqueid']][_0x1acd('0x86')]=_0x254a1f['origtransferercalleridnum'];this[_0x1acd('0x18')][_0x254a1f[_0x1acd('0x8a')]][_0x1acd('0x88')]=_0x254a1f['transfertargetcalleridnum'];if(this['channels'][_0x254a1f[_0x1acd('0x8b')]]){var _0x15d90a=this[_0x1acd('0x18')][_0x254a1f[_0x1acd('0x8b')]];this[_0x1acd('0x18')][_0x254a1f[_0x1acd('0x8b')]]=this[_0x1acd('0x18')][_0x254a1f[_0x1acd('0x8a')]];this[_0x1acd('0x18')][_0x254a1f[_0x1acd('0x8a')]]=_0x15d90a;}}}}catch(_0x3e6b7d){logger[_0x1acd('0x35')](_0x1acd('0x8c'),util['inspect'](_0x3e6b7d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1acd('0x2e')]['syncBlindTransfer']=function(_0x50b13b){try{if(this[_0x1acd('0x2d')](_0x50b13b)){if(this[_0x1acd('0x18')][_0x50b13b[_0x1acd('0x85')]]){this[_0x1acd('0x18')][_0x50b13b['transfereeuniqueid']][_0x1acd('0x86')]=_0x50b13b[_0x1acd('0x8d')];this['channels'][_0x50b13b['transfereeuniqueid']][_0x1acd('0x88')]=_0x50b13b[_0x1acd('0x8e')];this['syncHangup']({'event':_0x1acd('0x8f'),'uniqueid':_0x50b13b[_0x1acd('0x85')],'context':_0x50b13b[_0x1acd('0x3e')],'channel':_0x50b13b['transfererchannel']});}}}catch(_0x26e311){logger[_0x1acd('0x35')](_0x1acd('0x90'),util[_0x1acd('0x37')](_0x26e311,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1acd('0x2e')][_0x1acd('0x27')]=function(_0x2e51fd){try{if(this[_0x1acd('0x2d')](_0x2e51fd)){if(this[_0x1acd('0x18')][_0x2e51fd['uniqueid']]){if(!_[_0x1acd('0x6c')](this['channels'][_0x2e51fd[_0x1acd('0x30')]]['answertime'])){this['channels'][_0x2e51fd[_0x1acd('0x30')]][_0x1acd('0x91')]=moment()['format'](_0x1acd('0x3b'));}}}}catch(_0x49c77c){logger[_0x1acd('0x35')](_0x1acd('0x92'),util[_0x1acd('0x37')](_0x49c77c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1acd('0x2e')]['syncMusicOnHoldStop']=function(_0x3a5643){try{if(this['isNotNull'](_0x3a5643)){if(this['channels'][_0x3a5643['uniqueid']]){if(!_[_0x1acd('0x6c')](this[_0x1acd('0x18')][_0x3a5643[_0x1acd('0x30')]][_0x1acd('0x91')])){this[_0x1acd('0x18')][_0x3a5643[_0x1acd('0x30')]][_0x1acd('0x93')]+=moment()['milliseconds'](0x0)['diff'](this[_0x1acd('0x18')][_0x3a5643[_0x1acd('0x30')]][_0x1acd('0x91')],'seconds');delete this[_0x1acd('0x18')][_0x3a5643[_0x1acd('0x30')]][_0x1acd('0x91')];}}}}catch(_0x25d696){logger['error'](_0x1acd('0x94'),util[_0x1acd('0x37')](_0x25d696,{'showHidden':![],'depth':null}));}};module[_0x1acd('0x95')]=VoiceCallReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js
index c35b67c..0c9e571 100644
--- a/server/services/ami/report/voiceDialReport.js
+++ b/server/services/ami/report/voiceDialReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe0ab=['rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','duration','endtime','diff','starttime','seconds','lastevent','complete','outbound','total','answered','billableseconds','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','omit','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','custom:dialconnect','error','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss'];(function(_0x5b20e7,_0x4fdd80){var _0x38a218=function(_0x3a6c61){while(--_0x3a6c61){_0x5b20e7['push'](_0x5b20e7['shift']());}};_0x38a218(++_0x4fdd80);}(_0xe0ab,0x7a));var _0xbe0a=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xe0ab[_0x40ac5e];return _0x2839d6;};'use strict';var _=require('lodash');var moment=require(_0xbe0a('0x0'));var util=require(_0xbe0a('0x1'));var Redis=require(_0xbe0a('0x2'));var config=require(_0xbe0a('0x3'));var logger=require(_0xbe0a('0x4'))('ami');var ami=require('../ami');config[_0xbe0a('0x5')]=_[_0xbe0a('0x6')](config[_0xbe0a('0x5')],{'host':_0xbe0a('0x7'),'port':0x18eb});var io=require(_0xbe0a('0x8'))(new Redis(config[_0xbe0a('0x5')]));function VoiceDialReport(_0x15c142){this[_0xbe0a('0x9')]=_0x15c142[_0xbe0a('0xa')];this['outbound']=_0x15c142['outbound'];this[_0xbe0a('0xb')]={};ami['on'](_0xbe0a('0xc'),this[_0xbe0a('0xd')][_0xbe0a('0xe')](this));ami['on'](_0xbe0a('0xf'),this[_0xbe0a('0x10')][_0xbe0a('0xe')](this));ami['on'](_0xbe0a('0x11'),this[_0xbe0a('0x12')][_0xbe0a('0xe')](this));ami['on'](_0xbe0a('0x13'),this[_0xbe0a('0x14')][_0xbe0a('0xe')](this));}VoiceDialReport[_0xbe0a('0x15')][_0xbe0a('0x16')]=function(_0x2b5068){return _0x2b5068!==null&&!_[_0xbe0a('0x17')](_0x2b5068);};VoiceDialReport[_0xbe0a('0x15')][_0xbe0a('0x18')]=function(_0x10990b,_0x1019bc,_0x23175a){io['to'](_0x10990b)[_0xbe0a('0x18')](_0x1019bc,_0x23175a);};VoiceDialReport[_0xbe0a('0x15')][_0xbe0a('0xd')]=function(_0x271410){try{if(this['isNotNull'](_0x271410)){if(this[_0xbe0a('0x9')][_0x271410[_0xbe0a('0x19')]]){_['merge'](this[_0xbe0a('0x9')][_0x271410[_0xbe0a('0x19')]],{'starttime':moment()[_0xbe0a('0x1a')](_0xbe0a('0x1b')),'lastevent':_0xbe0a('0x1c'),'interface':_0x271410['channel'][_0xbe0a('0x1d')](0x0,_0x271410['channel']['lastIndexOf']('-')),'membername':_0x271410[_0xbe0a('0x1e')][_0xbe0a('0x1d')](_0x271410[_0xbe0a('0x1e')]['lastIndexOf']('/')+0x1,_0x271410['channel']['lastIndexOf']('-'))},_[_0xbe0a('0x1f')](_0x271410,[_0xbe0a('0x20'),_0xbe0a('0x21')]));this[_0xbe0a('0x18')](_0xbe0a('0x22'),_0xbe0a('0x23'),this['channels'][_0x271410[_0xbe0a('0x19')]]);ami[_0xbe0a('0x18')](_0xbe0a('0x24'),this['channels'][_0x271410[_0xbe0a('0x19')]]);}}}catch(_0x83d2eb){logger['error'](_0xbe0a('0x25'),util[_0xbe0a('0x26')](_0x83d2eb,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe0a('0x15')]['syncDialEnd']=function(_0x36ac20){try{if(this[_0xbe0a('0x16')](_0x36ac20)){if(this[_0xbe0a('0x9')][_0x36ac20['uniqueid']]){this[_0xbe0a('0x9')][_0x36ac20[_0xbe0a('0x19')]][_0xbe0a('0x27')]=_0x36ac20[_0xbe0a('0x27')];if(_0x36ac20['dialstatus']===_0xbe0a('0x28')){this[_0xbe0a('0x9')][_0x36ac20[_0xbe0a('0x19')]]['connectedlinenum']=_0x36ac20[_0xbe0a('0x29')];this[_0xbe0a('0x9')][_0x36ac20[_0xbe0a('0x19')]][_0xbe0a('0x2a')]=_0x36ac20['connectedlinename'];this[_0xbe0a('0x9')][_0x36ac20[_0xbe0a('0x19')]][_0xbe0a('0x2b')]=moment()[_0xbe0a('0x1a')](_0xbe0a('0x1b'));this[_0xbe0a('0x9')][_0x36ac20[_0xbe0a('0x19')]]['lastevent']='connect';ami[_0xbe0a('0x18')](_0xbe0a('0x2c'),this['channels'][_0x36ac20[_0xbe0a('0x19')]]);}this[_0xbe0a('0x18')](_0xbe0a('0x22'),_0xbe0a('0x23'),this[_0xbe0a('0x9')][_0x36ac20['uniqueid']]);}}}catch(_0x2d4767){logger[_0xbe0a('0x2d')](_0xbe0a('0x2e'),util[_0xbe0a('0x26')](_0x2d4767,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe0a('0x15')]['syncVarSet']=function(_0x582868){try{if(this[_0xbe0a('0x16')](_0x582868)){this[_0xbe0a('0x2f')](_0x582868['uniqueid'],_[_0xbe0a('0x30')](_0x582868[_0xbe0a('0x31')])[0x0],_0x582868[_0xbe0a('0x32')]);if(this[_0xbe0a('0x16')](_0x582868[_0xbe0a('0x31')])&&this[_0xbe0a('0x16')](_0x582868[_0xbe0a('0x31')][_0xbe0a('0x33')])){if(_['isUndefined'](this[_0xbe0a('0x9')][_0x582868['uniqueid']])){this[_0xbe0a('0x9')][_0x582868['uniqueid']]={'routeId':_0x582868['value'],'variables':this['variables'][_0x582868['uniqueid']]};this[_0xbe0a('0x18')]('voice:outbound',_0xbe0a('0x23'),this[_0xbe0a('0x9')][_0x582868['uniqueid']]);}}}}catch(_0x4c47e0){logger['error'](_0xbe0a('0x34'),util[_0xbe0a('0x26')](_0x4c47e0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe0a('0x15')][_0xbe0a('0x2f')]=function(_0x3ba232,_0x31846b,_0x2d81a6){var _0x260cdc=[_0xbe0a('0x35'),_0xbe0a('0x36'),_0xbe0a('0x37'),_0xbe0a('0x38'),_0xbe0a('0x39'),_0xbe0a('0x3a'),_0xbe0a('0x3b'),_0xbe0a('0x3c'),_0xbe0a('0x3d'),_0xbe0a('0x3e'),_0xbe0a('0x3f'),_0xbe0a('0x40'),_0xbe0a('0x41'),'memberdynamic',_0xbe0a('0x42'),_0xbe0a('0x43'),_0xbe0a('0x44'),_0xbe0a('0x45'),_0xbe0a('0x46')];if(!_[_0xbe0a('0x47')](_0x31846b)&&!_[_0xbe0a('0x48')](_0x260cdc,_0x31846b)){if(_[_0xbe0a('0x17')](this[_0xbe0a('0xb')][_0x3ba232])){this[_0xbe0a('0xb')][_0x3ba232]={};}this[_0xbe0a('0xb')][_0x3ba232][_0x31846b]=_0x2d81a6;}};VoiceDialReport[_0xbe0a('0x15')]['syncHangup']=function(_0x4edbd5){try{if(this[_0xbe0a('0x16')](_0x4edbd5)){if(this[_0xbe0a('0x9')][_0x4edbd5['uniqueid']]){this['channels'][_0x4edbd5[_0xbe0a('0x19')]]['endtime']=moment()[_0xbe0a('0x1a')](_0xbe0a('0x1b'));this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x49')]=moment(this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x4a')])[_0xbe0a('0x4b')](this['channels'][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x4c')],_0xbe0a('0x4d'));this['channels'][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x4e')]=_0xbe0a('0x4f');this[_0xbe0a('0x50')][_0xbe0a('0x51')]+=0x1;if(this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x2b')]){this[_0xbe0a('0x50')][_0xbe0a('0x52')]+=0x1;this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]]['holdtime']=moment(this[_0xbe0a('0x9')][_0x4edbd5['uniqueid']]['answertime'])['diff'](this[_0xbe0a('0x9')][_0x4edbd5['uniqueid']][_0xbe0a('0x4c')],'seconds');this['channels'][_0x4edbd5['uniqueid']][_0xbe0a('0x53')]=moment(this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x4a')])['diff'](this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x2b')],_0xbe0a('0x4d'));this[_0xbe0a('0x50')]['sumHoldTime']+=this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]]['holdtime']||0x0;this[_0xbe0a('0x50')]['sumBillable']+=this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x53')];}this['outbound'][_0xbe0a('0x54')]+=this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]]['duration'];ami['emit'](_0xbe0a('0x55'),this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]]);ami[_0xbe0a('0x18')](_0xbe0a('0x56'),this[_0xbe0a('0x9')][_0x4edbd5['uniqueid']]);this[_0xbe0a('0x18')]('voice:outbound',_0xbe0a('0x57'),this[_0xbe0a('0x50')]);this[_0xbe0a('0x18')](_0xbe0a('0x22'),_0xbe0a('0x58'),this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]]);delete this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]];}if(this[_0xbe0a('0xb')][_0x4edbd5[_0xbe0a('0x19')]]){delete this[_0xbe0a('0xb')][_0x4edbd5[_0xbe0a('0x19')]];}}}catch(_0x3e974b){logger[_0xbe0a('0x2d')]('[syncHangup][VoiceDialReport]',util[_0xbe0a('0x26')](_0x3e974b,{'showHidden':![],'depth':null}));}};module[_0xbe0a('0x59')]=VoiceDialReport;
\ No newline at end of file
+var _0x99c1=['answertime','lastevent','connect','custom:dialconnect','error','addVariable','variable','value','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','isNil','includes','duration','endtime','diff','starttime','complete','total','answered','holdtime','seconds','billableseconds','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','isUndefined','prototype','emit','isNotNull','channels','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','substring','omit','voice:outbound','voice_outbound_channel:save','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename'];(function(_0x33657a,_0x2ef68e){var _0x548613=function(_0x5b4d87){while(--_0x5b4d87){_0x33657a['push'](_0x33657a['shift']());}};_0x548613(++_0x2ef68e);}(_0x99c1,0x12d));var _0x199c=function(_0x4bb922,_0xff6b3a){_0x4bb922=_0x4bb922-0x0;var _0x18b07b=_0x99c1[_0x4bb922];return _0x18b07b;};'use strict';var _=require(_0x199c('0x0'));var moment=require(_0x199c('0x1'));var util=require(_0x199c('0x2'));var Redis=require(_0x199c('0x3'));var config=require(_0x199c('0x4'));var logger=require(_0x199c('0x5'))(_0x199c('0x6'));var ami=require(_0x199c('0x7'));config[_0x199c('0x8')]=_['defaults'](config[_0x199c('0x8')],{'host':_0x199c('0x9'),'port':0x18eb});var io=require(_0x199c('0xa'))(new Redis(config['redis']));function VoiceDialReport(_0x32c5b2){this['channels']=_0x32c5b2[_0x199c('0xb')];this[_0x199c('0xc')]=_0x32c5b2['outbound'];this[_0x199c('0xd')]={};ami['on'](_0x199c('0xe'),this[_0x199c('0xf')][_0x199c('0x10')](this));ami['on'](_0x199c('0x11'),this[_0x199c('0x12')][_0x199c('0x10')](this));ami['on'](_0x199c('0x13'),this[_0x199c('0x14')][_0x199c('0x10')](this));ami['on'](_0x199c('0x15'),this['syncHangup'][_0x199c('0x10')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x59e4d1){return _0x59e4d1!==null&&!_[_0x199c('0x16')](_0x59e4d1);};VoiceDialReport[_0x199c('0x17')]['emit']=function(_0x55e665,_0x347ea3,_0x2cc4e2){io['to'](_0x55e665)[_0x199c('0x18')](_0x347ea3,_0x2cc4e2);};VoiceDialReport['prototype'][_0x199c('0xf')]=function(_0x47d285){try{if(this[_0x199c('0x19')](_0x47d285)){if(this[_0x199c('0x1a')][_0x47d285[_0x199c('0x1b')]]){_['merge'](this[_0x199c('0x1a')][_0x47d285[_0x199c('0x1b')]],{'starttime':moment()[_0x199c('0x1c')](_0x199c('0x1d')),'lastevent':_0x199c('0x1e'),'interface':_0x47d285[_0x199c('0x1f')]['substring'](0x0,_0x47d285[_0x199c('0x1f')][_0x199c('0x20')]('-')),'membername':_0x47d285['channel'][_0x199c('0x21')](_0x47d285[_0x199c('0x1f')][_0x199c('0x20')]('/')+0x1,_0x47d285[_0x199c('0x1f')][_0x199c('0x20')]('-'))},_[_0x199c('0x22')](_0x47d285,['event','privilege']));this[_0x199c('0x18')](_0x199c('0x23'),_0x199c('0x24'),this['channels'][_0x47d285['uniqueid']]);ami[_0x199c('0x18')]('custom:dialbegin',this[_0x199c('0x1a')][_0x47d285['uniqueid']]);}}}catch(_0x5224c7){logger['error'](_0x199c('0x25'),util[_0x199c('0x26')](_0x5224c7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x199c('0x17')]['syncDialEnd']=function(_0x283892){try{if(this[_0x199c('0x19')](_0x283892)){if(this[_0x199c('0x1a')][_0x283892['uniqueid']]){this[_0x199c('0x1a')][_0x283892[_0x199c('0x1b')]][_0x199c('0x27')]=_0x283892['dialstatus'];if(_0x283892[_0x199c('0x27')]===_0x199c('0x28')){this[_0x199c('0x1a')][_0x283892[_0x199c('0x1b')]][_0x199c('0x29')]=_0x283892[_0x199c('0x29')];this[_0x199c('0x1a')][_0x283892['uniqueid']][_0x199c('0x2a')]=_0x283892[_0x199c('0x2a')];this['channels'][_0x283892[_0x199c('0x1b')]][_0x199c('0x2b')]=moment()[_0x199c('0x1c')](_0x199c('0x1d'));this['channels'][_0x283892[_0x199c('0x1b')]][_0x199c('0x2c')]=_0x199c('0x2d');ami[_0x199c('0x18')](_0x199c('0x2e'),this[_0x199c('0x1a')][_0x283892['uniqueid']]);}this[_0x199c('0x18')](_0x199c('0x23'),_0x199c('0x24'),this['channels'][_0x283892[_0x199c('0x1b')]]);}}}catch(_0x51c596){logger[_0x199c('0x2f')]('[syncDialEnd][VoiceDialReport]',util[_0x199c('0x26')](_0x51c596,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x36754d){try{if(this['isNotNull'](_0x36754d)){this[_0x199c('0x30')](_0x36754d[_0x199c('0x1b')],_['keys'](_0x36754d[_0x199c('0x31')])[0x0],_0x36754d[_0x199c('0x32')]);if(this['isNotNull'](_0x36754d[_0x199c('0x31')])&&this[_0x199c('0x19')](_0x36754d['variable']['outboundrouteid'])){if(_[_0x199c('0x16')](this[_0x199c('0x1a')][_0x36754d[_0x199c('0x1b')]])){this[_0x199c('0x1a')][_0x36754d['uniqueid']]={'routeId':_0x36754d[_0x199c('0x32')],'variables':this[_0x199c('0xd')][_0x36754d['uniqueid']]};this['emit'](_0x199c('0x23'),_0x199c('0x24'),this['channels'][_0x36754d['uniqueid']]);}}}}catch(_0x490540){logger[_0x199c('0x2f')](_0x199c('0x33'),util[_0x199c('0x26')](_0x490540,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x199c('0x17')][_0x199c('0x30')]=function(_0x2777e,_0x1bdaca,_0xf87de5){var _0x4e5b08=[_0x199c('0x34'),_0x199c('0x35'),'rtpaudioqosjitter',_0x199c('0x36'),_0x199c('0x37'),'rtpaudioqoslossbridged',_0x199c('0x38'),_0x199c('0x39'),_0x199c('0x3a'),_0x199c('0x3b'),_0x199c('0x3c'),_0x199c('0x3d'),_0x199c('0x3e'),_0x199c('0x3f'),_0x199c('0x40'),_0x199c('0x41'),_0x199c('0x42'),_0x199c('0x43'),'memberrealtime'];if(!_[_0x199c('0x44')](_0x1bdaca)&&!_[_0x199c('0x45')](_0x4e5b08,_0x1bdaca)){if(_[_0x199c('0x16')](this[_0x199c('0xd')][_0x2777e])){this[_0x199c('0xd')][_0x2777e]={};}this[_0x199c('0xd')][_0x2777e][_0x1bdaca]=_0xf87de5;}};VoiceDialReport[_0x199c('0x17')]['syncHangup']=function(_0x50f47b){try{if(this[_0x199c('0x19')](_0x50f47b)){if(this[_0x199c('0x1a')][_0x50f47b[_0x199c('0x1b')]]){this['channels'][_0x50f47b[_0x199c('0x1b')]]['endtime']=moment()[_0x199c('0x1c')](_0x199c('0x1d'));this[_0x199c('0x1a')][_0x50f47b[_0x199c('0x1b')]][_0x199c('0x46')]=moment(this[_0x199c('0x1a')][_0x50f47b['uniqueid']][_0x199c('0x47')])[_0x199c('0x48')](this[_0x199c('0x1a')][_0x50f47b[_0x199c('0x1b')]][_0x199c('0x49')],'seconds');this[_0x199c('0x1a')][_0x50f47b[_0x199c('0x1b')]][_0x199c('0x2c')]=_0x199c('0x4a');this[_0x199c('0xc')][_0x199c('0x4b')]+=0x1;if(this[_0x199c('0x1a')][_0x50f47b['uniqueid']][_0x199c('0x2b')]){this['outbound'][_0x199c('0x4c')]+=0x1;this['channels'][_0x50f47b[_0x199c('0x1b')]][_0x199c('0x4d')]=moment(this[_0x199c('0x1a')][_0x50f47b[_0x199c('0x1b')]][_0x199c('0x2b')])[_0x199c('0x48')](this[_0x199c('0x1a')][_0x50f47b[_0x199c('0x1b')]][_0x199c('0x49')],_0x199c('0x4e'));this[_0x199c('0x1a')][_0x50f47b[_0x199c('0x1b')]][_0x199c('0x4f')]=moment(this['channels'][_0x50f47b[_0x199c('0x1b')]]['endtime'])[_0x199c('0x48')](this[_0x199c('0x1a')][_0x50f47b[_0x199c('0x1b')]][_0x199c('0x2b')],'seconds');this[_0x199c('0xc')]['sumHoldTime']+=this['channels'][_0x50f47b[_0x199c('0x1b')]][_0x199c('0x4d')]||0x0;this[_0x199c('0xc')]['sumBillable']+=this[_0x199c('0x1a')][_0x50f47b[_0x199c('0x1b')]][_0x199c('0x4f')];}this[_0x199c('0xc')][_0x199c('0x50')]+=this[_0x199c('0x1a')][_0x50f47b[_0x199c('0x1b')]][_0x199c('0x46')];ami['emit'](_0x199c('0x51'),this['channels'][_0x50f47b[_0x199c('0x1b')]]);ami[_0x199c('0x18')](_0x199c('0x52'),this[_0x199c('0x1a')][_0x50f47b['uniqueid']]);this[_0x199c('0x18')]('voice:outbound',_0x199c('0x53'),this['outbound']);this[_0x199c('0x18')]('voice:outbound',_0x199c('0x54'),this[_0x199c('0x1a')][_0x50f47b[_0x199c('0x1b')]]);delete this[_0x199c('0x1a')][_0x50f47b['uniqueid']];}if(this['variables'][_0x50f47b[_0x199c('0x1b')]]){delete this[_0x199c('0xd')][_0x50f47b[_0x199c('0x1b')]];}}}catch(_0x3e0126){logger[_0x199c('0x2f')](_0x199c('0x55'),util[_0x199c('0x26')](_0x3e0126,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js
index e4f7856..aa2b00c 100644
--- a/server/services/ami/report/voiceQueueReport.js
+++ b/server/services/ami/report/voiceQueueReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf3b=['membercalls','memberdynamic','memberlastcall','includes','length','sumHoldTime','milliseconds','diff','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfererexten','ATTENDEDTRANSFER','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','syncBlindTransfer','BLINDTRANSFER','BLIND','extension','context','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','mohtime','exports','moment','util','md5','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','localhost','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','fullybooted','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','isNil','catch','No\x20such\x20channel','[voiceQueueReport][checkChannel]','error','variables','syncFullyBooted','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_channel:remove','emitVoiceQueueSummary','inbound','available','loggedIn','pTalking','sumBillable','sumDuration','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','voice_queue:save','isNotNull','Action','queues','[queues]','queuesummary','then','[queuesummary]','syncQueueSummary','queue','callers','toNumber','loggedin','custom:queuesummary','syncNewExten','type','queuecallerjoinAt','count','merge','keys','uniqueid','push','[syncQueueCallerJoin][VoiceQueueReport]','inspect','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','assigned','membername','queuecallerexit','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','queuestatus','queuecallerexitAt','queueposition','EXITWITHKEY','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid'];(function(_0x27a21a,_0x46fa7c){var _0x18a357=function(_0x478c04){while(--_0x478c04){_0x27a21a['push'](_0x27a21a['shift']());}};_0x18a357(++_0x46fa7c);}(_0xcf3b,0x198));var _0xbcf3=function(_0xe93045,_0x5a3b8f){_0xe93045=_0xe93045-0x0;var _0x45a0c2=_0xcf3b[_0xe93045];return _0x45a0c2;};'use strict';var _=require('lodash');var moment=require(_0xbcf3('0x0'));var BPromise=require('bluebird');var util=require(_0xbcf3('0x1'));var md5=require(_0xbcf3('0x2'));var Redis=require('ioredis');var config=require(_0xbcf3('0x3'));var logger=require(_0xbcf3('0x4'))(_0xbcf3('0x5'));var ami=require(_0xbcf3('0x6'));var QueueReport=require(_0xbcf3('0x7'));config[_0xbcf3('0x8')]=_['defaults'](config[_0xbcf3('0x8')],{'host':_0xbcf3('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xbcf3('0xa')][_0xbcf3('0xb')]=function(_0x3705d2){this[_0xbcf3('0xc')]=this[_0xbcf3('0xc')]?this[_0xbcf3('0xc')][_0xbcf3('0xd')](_0x3705d2):_0x3705d2();};function VoiceQueueReport(_0x4eb883){this[_0xbcf3('0xe')]=new Sequence();this[_0xbcf3('0xf')]={};this['agents']=_0x4eb883[_0xbcf3('0x10')];this[_0xbcf3('0x11')]=_0x4eb883[_0xbcf3('0x12')];this[_0xbcf3('0x13')]=_0x4eb883['voiceQueues'];this[_0xbcf3('0x14')]=!![];this[_0xbcf3('0x15')]=_0x4eb883[_0xbcf3('0x15')];this['variables']={};ami['on']('queuesummary',this['syncQueueSummary'][_0xbcf3('0x16')](this));ami['on'](_0xbcf3('0x17'),this[_0xbcf3('0x18')]['bind'](this));ami['on'](_0xbcf3('0x19'),this[_0xbcf3('0x1a')][_0xbcf3('0x16')](this));ami['on']('queuecallerabandon',this[_0xbcf3('0x1b')][_0xbcf3('0x16')](this));ami['on'](_0xbcf3('0x1c'),this[_0xbcf3('0x1d')][_0xbcf3('0x16')](this));ami['on'](_0xbcf3('0x1e'),this[_0xbcf3('0x1f')]['bind'](this));ami['on']('agentconnect',this['syncAgentConnect'][_0xbcf3('0x16')](this));ami['on'](_0xbcf3('0x20'),this['syncVarSet']['bind'](this));ami['on'](_0xbcf3('0x21'),this[_0xbcf3('0x22')]['bind'](this));ami['on'](_0xbcf3('0x23'),this['syncFullyBooted'][_0xbcf3('0x16')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0xbcf3('0x16')](this));ami['on'](_0xbcf3('0x24'),this[_0xbcf3('0x25')][_0xbcf3('0x16')](this));ami['on'](_0xbcf3('0x26'),this[_0xbcf3('0x27')][_0xbcf3('0x16')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this[_0xbcf3('0x28')]();this[_0xbcf3('0x29')]();}function isNotNull(_0x27f57a){return _0x27f57a!==null&&!_[_0xbcf3('0x2a')](_0x27f57a);}function clearChannels(_0x3a5c8c){if(!_[_0xbcf3('0x2b')](_0x3a5c8c)){for(var _0x107722 in _0x3a5c8c){if(_0x3a5c8c[_0xbcf3('0x2c')](_0x107722)){delete _0x3a5c8c[_0x107722];}}}}function clearCampaigns(_0x3ca6e0){if(!_['isEmpty'](_0x3ca6e0)){for(var _0x4ac81d in _0x3ca6e0){if(_0x3ca6e0[_0xbcf3('0x2c')](_0x4ac81d)){_0x3ca6e0[_0x4ac81d]['originated']=0x0;}}}}function clearVoiceQueues(_0x3f05ba){if(!_[_0xbcf3('0x2b')](_0x3f05ba)){for(var _0x25c489 in _0x3f05ba){if(_0x3f05ba['hasOwnProperty'](_0x25c489)){_0x3f05ba[_0x25c489][_0xbcf3('0x2d')]=0x0;_0x3f05ba[_0x25c489][_0xbcf3('0x2e')]=0x0;_0x3f05ba[_0x25c489]['pTalking']=0x0;_0x3f05ba[_0x25c489][_0xbcf3('0x2f')]=0x0;_0x3f05ba[_0x25c489][_0xbcf3('0x30')]=!![];}}}}function clearAgentBooked(_0x24cca1){if(!_[_0xbcf3('0x2b')](_0x24cca1)){for(var _0x50ca4b in _0x24cca1){if(_0x24cca1[_0xbcf3('0x2c')](_0x50ca4b)){_0x24cca1[_0x50ca4b][_0xbcf3('0x31')]=!![];}}}}VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x32')]=function(){var _0x287265=this;for(var _0x4fd3a1 in this[_0xbcf3('0x11')]){if(this[_0xbcf3('0x11')][_0xbcf3('0x2c')](_0x4fd3a1)&&!this[_0xbcf3('0x11')][_0x4fd3a1][_0xbcf3('0x33')]){this[_0xbcf3('0xe')]['enqueue'](function(){if(!_[_0xbcf3('0x34')](_0x287265[_0xbcf3('0x11')][_0x4fd3a1])){return ami['Action']({'action':'status','channel':_0x287265['channels'][_0x4fd3a1]['channel']})[_0xbcf3('0x35')](function(_0x5df55d){if(_0x5df55d['message']===_0xbcf3('0x36')){setTimeout(function(){if(_0x287265[_0xbcf3('0x11')][_0x4fd3a1]){delete _0x287265[_0xbcf3('0x11')][_0x4fd3a1];logger['error'](_0xbcf3('0x37'),_0x4fd3a1);}if(_0x287265[_0xbcf3('0xf')][_0x4fd3a1]){delete _0x287265[_0xbcf3('0xf')][_0x4fd3a1];logger[_0xbcf3('0x38')]('[voiceQueueReport][checkQueueReport]',_0x4fd3a1);}if(_0x287265[_0xbcf3('0x39')][_0x4fd3a1]){delete _0x287265[_0xbcf3('0x39')][_0x4fd3a1];logger[_0xbcf3('0x38')]('[voiceQueueReport][checkVariables]',_0x4fd3a1);}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0xbcf3('0x3a')]=function(){logger[_0xbcf3('0x38')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xbcf3('0x11')]);this[_0xbcf3('0x3b')](this[_0xbcf3('0xf')]);clearAgentBooked(this[_0xbcf3('0x10')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xbcf3('0x15')]);};VoiceQueueReport['prototype'][_0xbcf3('0x3b')]=function(_0x1efe66){var _0x845805=this;if(!_['isEmpty'](_0x1efe66)){for(var _0x135056 in _0x1efe66){if(_0x1efe66[_0xbcf3('0x2c')](_0x135056)){_0x845805[_0xbcf3('0x3c')](_0x1efe66[_0x135056]);delete _0x1efe66[_0x135056];}}}};function loggerCatch(_0x278151){return function(_0x217cc4){logger[_0xbcf3('0x38')](_0x278151,util['inspect'](_0x217cc4,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x3d')]=function(_0x3b61e3,_0x16f6d4,_0x3be0c1){io['to'](_0x3b61e3)['emit'](_0x16f6d4,_0x3be0c1);};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x3e')]=function(_0x30fab0){this[_0xbcf3('0x3d')](util[_0xbcf3('0x3f')](_0xbcf3('0x40'),_0x30fab0[_0xbcf3('0x41')]),_0xbcf3('0x42'),_0x30fab0);};VoiceQueueReport[_0xbcf3('0xa')]['emitVoiceQueueChannelRemove']=function(_0x541727){this[_0xbcf3('0x3d')](util[_0xbcf3('0x3f')](_0xbcf3('0x40'),_0x541727[_0xbcf3('0x41')]),_0xbcf3('0x43'),_0x541727);};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x44')]=function(_0x515678){if(_0x515678['type']===_0xbcf3('0x45')){var _0xb0048b={'id':_0x515678['id'],'name':_0x515678[_0xbcf3('0x41')],'strategy':_0x515678['strategy'],'answered':_0x515678['answered'],'available':_0x515678[_0xbcf3('0x46')],'loggedIn':_0x515678[_0xbcf3('0x47')],'pTalking':_0x515678[_0xbcf3('0x48')],'sumBillable':_0x515678[_0xbcf3('0x49')],'sumDuration':_0x515678[_0xbcf3('0x4a')],'sumHoldTime':_0x515678['sumHoldTime']||0x0,'talking':_0x515678[_0xbcf3('0x2e')],'total':_0x515678['total'],'type':_0x515678['type'],'unmanaged':_0x515678[_0xbcf3('0x4b')],'abandoned':_0x515678[_0xbcf3('0x4c')],'waiting':_0x515678[_0xbcf3('0x2f')]};if(_0x515678[_0xbcf3('0x4d')]){_0xb0048b['Trunk']={'id':_0x515678['Trunk']['id'],'name':_0x515678[_0xbcf3('0x4d')][_0xbcf3('0x41')],'active':_0x515678[_0xbcf3('0x4d')][_0xbcf3('0x4e')],'callerid':_0x515678[_0xbcf3('0x4d')][_0xbcf3('0x4f')]};}if(_0x515678[_0xbcf3('0x50')]){_0xb0048b[_0xbcf3('0x50')]={'id':_0x515678['Interval']['id'],'name':_0x515678[_0xbcf3('0x50')][_0xbcf3('0x41')]};}var _0x282a28=md5(JSON[_0xbcf3('0x51')](_0xb0048b));if(_0x515678[_0xbcf3('0x2')]!==_0x282a28){_0x515678['md5']=_0x282a28;this['emit'](util['format']('voice:queue:%s',_0xb0048b[_0xbcf3('0x41')]),_0xbcf3('0x52'),_0xb0048b);}}};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x53')]=function(_0x53d942){return _0x53d942!==null&&!_[_0xbcf3('0x2a')](_0x53d942);};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x29')]=function(){var _0x422bb3=this;setInterval(function(){_0x422bb3[_0xbcf3('0x32')]();ami[_0xbcf3('0x54')]({'action':_0xbcf3('0x55')})[_0xbcf3('0x35')](loggerCatch(_0xbcf3('0x56')));},0x2710);};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x28')]=function(){var _0x3deb4c=this;setInterval(function(){if(_0x3deb4c[_0xbcf3('0x14')]){return ami[_0xbcf3('0x54')]({'action':_0xbcf3('0x57')})[_0xbcf3('0x58')](function(_0xe1d611){_0x3deb4c[_0xbcf3('0x14')]=![];})[_0xbcf3('0x35')](loggerCatch(_0xbcf3('0x59')));}},0x3e8);};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x5a')]=function(_0x5813b7){try{if(this['isNotNull'](_0x5813b7)&&this[_0xbcf3('0x53')](_0x5813b7[_0xbcf3('0x5b')])){if(this[_0xbcf3('0x13')][_0x5813b7[_0xbcf3('0x5b')]]){var _0x29f1cd=_['countBy'](this[_0xbcf3('0x11')],_0xbcf3('0x5b'))[_0x5813b7[_0xbcf3('0x5b')]]||0x0;var _0x264b80=_0x29f1cd-_0x5813b7[_0xbcf3('0x5c')];if(this['voiceQueues'][_0x5813b7[_0xbcf3('0x5b')]][_0xbcf3('0x2f')]!==_[_0xbcf3('0x5d')](_0x5813b7['callers'])||this[_0xbcf3('0x13')][_0x5813b7[_0xbcf3('0x5b')]]['loggedIn']!==_['toNumber'](_0x5813b7[_0xbcf3('0x5e')])||this[_0xbcf3('0x13')][_0x5813b7[_0xbcf3('0x5b')]][_0xbcf3('0x46')]!==_[_0xbcf3('0x5d')](_0x5813b7[_0xbcf3('0x46')])||this[_0xbcf3('0x13')][_0x5813b7[_0xbcf3('0x5b')]][_0xbcf3('0x2e')]!==_0x264b80){this['voiceQueues'][_0x5813b7['queue']][_0xbcf3('0x2f')]=_[_0xbcf3('0x5d')](_0x5813b7[_0xbcf3('0x5c')]);this[_0xbcf3('0x13')][_0x5813b7[_0xbcf3('0x5b')]][_0xbcf3('0x47')]=_['toNumber'](_0x5813b7[_0xbcf3('0x5e')]);this[_0xbcf3('0x13')][_0x5813b7['queue']]['available']=_['toNumber'](_0x5813b7[_0xbcf3('0x46')]);this['voiceQueues'][_0x5813b7[_0xbcf3('0x5b')]][_0xbcf3('0x2e')]=_0x264b80>0x0?_0x264b80:0x0;this['voiceQueues'][_0x5813b7[_0xbcf3('0x5b')]][_0xbcf3('0x2e')]=this[_0xbcf3('0x13')][_0x5813b7[_0xbcf3('0x5b')]][_0xbcf3('0x2e')]>_[_0xbcf3('0x5d')](_0x5813b7[_0xbcf3('0x5e')])?_['toNumber'](_0x5813b7[_0xbcf3('0x5e')]):this[_0xbcf3('0x13')][_0x5813b7['queue']][_0xbcf3('0x2e')];this[_0xbcf3('0x44')](this[_0xbcf3('0x13')][_0x5813b7['queue']]);}ami[_0xbcf3('0x3d')](_0xbcf3('0x5f'),this[_0xbcf3('0x13')][_0x5813b7[_0xbcf3('0x5b')]]);}}}catch(_0x5ef36b){logger[_0xbcf3('0x38')]('[syncQueueSummary][VoiceQueueReport]',util['inspect'](_0x5ef36b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x18')]=function(_0x36497c){this['flagQueueSummary']=!![];};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x60')]=function(_0x59cc93){};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x1a')]=function(_0x24a2c4){try{if(this[_0xbcf3('0x53')](_0x24a2c4)){if(_[_0xbcf3('0x2a')](this['queueReports'][_0x24a2c4['uniqueid']])){this[_0xbcf3('0xf')][_0x24a2c4['uniqueid']]=[];this[_0xbcf3('0x11')][_0x24a2c4['uniqueid']]={};}var _0x459150=new QueueReport();_0x459150[_0xbcf3('0x41')]=_0x24a2c4[_0xbcf3('0x5b')];_0x459150['type']=this[_0xbcf3('0x13')][_0x459150[_0xbcf3('0x41')]]&&this['voiceQueues'][_0x459150[_0xbcf3('0x41')]][_0xbcf3('0x61')]?this[_0xbcf3('0x13')][_0x459150[_0xbcf3('0x41')]][_0xbcf3('0x61')]||_0xbcf3('0x45'):_0xbcf3('0x45');_0x459150[_0xbcf3('0x5b')]=_0x24a2c4[_0xbcf3('0x5b')];_0x459150[_0xbcf3('0x62')]=moment()[_0xbcf3('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');_0x459150['position']=_0x24a2c4['position'];_0x459150[_0xbcf3('0x63')]=_0x24a2c4[_0xbcf3('0x63')];_[_0xbcf3('0x64')](_0x459150,_['pick'](_0x24a2c4,_[_0xbcf3('0x65')](_0x459150)));this['queueReports'][_0x24a2c4[_0xbcf3('0x66')]][_0xbcf3('0x67')](_0x459150);this[_0xbcf3('0x11')][_0x24a2c4['uniqueid']]=_0x459150;this[_0xbcf3('0x3e')](_0x459150);}}catch(_0x1ec634){logger[_0xbcf3('0x38')](_0xbcf3('0x68'),util[_0xbcf3('0x69')](_0x1ec634,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x1b')]=function(_0x57225b){try{if(this[_0xbcf3('0x53')](_0x57225b)){if(this[_0xbcf3('0xf')][_0x57225b[_0xbcf3('0x66')]]){var _0x30bc6d=_[_0xbcf3('0x6a')](this[_0xbcf3('0xf')][_0x57225b[_0xbcf3('0x66')]]);_0x30bc6d[_0xbcf3('0x6b')]=![];_0x30bc6d[_0xbcf3('0x6c')]=null;_0x30bc6d['holdtime']=_0x57225b[_0xbcf3('0x6d')];_0x30bc6d['originalposition']=_0x57225b[_0xbcf3('0x6e')];_0x30bc6d[_0xbcf3('0x6f')]=!![];_0x30bc6d[_0xbcf3('0x70')]=moment()[_0xbcf3('0x3f')](_0xbcf3('0x71'));_0x30bc6d[_0xbcf3('0x72')]=_0xbcf3('0x73');_0x30bc6d[_0xbcf3('0x74')]=null;this[_0xbcf3('0x11')][_0x57225b[_0xbcf3('0x66')]]=_0x30bc6d;this[_0xbcf3('0x3c')](_0x30bc6d);}}}catch(_0x14a058){logger[_0xbcf3('0x38')](_0xbcf3('0x75'),util[_0xbcf3('0x69')](_0x14a058,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')]['syncQueueCallerLeave']=function(_0x2d7bb2){try{if(this[_0xbcf3('0x53')](_0x2d7bb2)){if(this[_0xbcf3('0xf')][_0x2d7bb2[_0xbcf3('0x66')]]){var _0x48a34a=_[_0xbcf3('0x6a')](this[_0xbcf3('0xf')][_0x2d7bb2[_0xbcf3('0x66')]]);_0x48a34a[_0xbcf3('0x76')]=moment()['format'](_0xbcf3('0x71'));_0x48a34a[_0xbcf3('0x77')]=_0x2d7bb2['connectedlinenum'];_0x48a34a[_0xbcf3('0x78')]=_0x2d7bb2[_0xbcf3('0x78')];this[_0xbcf3('0x11')][_0x2d7bb2[_0xbcf3('0x66')]]=_0x48a34a;this[_0xbcf3('0x3e')](_0x48a34a);}}}catch(_0x545670){logger[_0xbcf3('0x38')]('[syncQueueCallerLeave][VoiceQueueReport]',util[_0xbcf3('0x69')](_0x545670,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x1aa8a3){try{if(this[_0xbcf3('0x53')](_0x1aa8a3)){if(this[_0xbcf3('0xf')][_0x1aa8a3[_0xbcf3('0x66')]]){var _0x23a815=_[_0xbcf3('0x6a')](this[_0xbcf3('0xf')][_0x1aa8a3[_0xbcf3('0x66')]]);_0x23a815[_0xbcf3('0x6b')]=!![];_0x23a815[_0xbcf3('0x72')]=_0xbcf3('0x79');}}}catch(_0x2cf7a3){logger[_0xbcf3('0x38')](_0xbcf3('0x7a'),util[_0xbcf3('0x69')](_0x2cf7a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x1f')]=function(_0x4e354a){try{if(this[_0xbcf3('0x53')](_0x4e354a)){if(this[_0xbcf3('0xf')][_0x4e354a[_0xbcf3('0x66')]]){var _0x27a44a=_['last'](this[_0xbcf3('0xf')][_0x4e354a[_0xbcf3('0x66')]]);_0x27a44a[_0xbcf3('0x6f')]=![];_0x27a44a[_0xbcf3('0x70')]=null;_0x27a44a[_0xbcf3('0x7b')]=!![];_0x27a44a[_0xbcf3('0x74')]=_0x4e354a[_0xbcf3('0x7c')];_0x27a44a['holdtime']=_0x4e354a[_0xbcf3('0x6d')];_0x27a44a[_0xbcf3('0x6b')]=!![];_0x27a44a[_0xbcf3('0x7d')]=![];_0x27a44a['queuecallerexitAt']=null;if(!_0x27a44a[_0xbcf3('0x7e')]){if(_0x4e354a[_0xbcf3('0x7f')]==_0xbcf3('0x7e')){_0x27a44a[_0xbcf3('0x72')]=_0xbcf3('0x80');}else{if(_[_0xbcf3('0x81')](_0x4e354a['channel'][_0xbcf3('0x82')](),_0xbcf3('0x83'))){if(this[_0xbcf3('0xf')][_0x4e354a[_0xbcf3('0x84')]]){var _0x4a04f3=_[_0xbcf3('0x6a')](this[_0xbcf3('0xf')][_0x4e354a[_0xbcf3('0x84')]]);_0x4a04f3[_0xbcf3('0x6b')]=![];_0x4a04f3[_0xbcf3('0x7d')]=!![];_0x4a04f3['queuecallerexitAt']=moment(_0x27a44a[_0xbcf3('0x62')])[_0xbcf3('0x85')](_0x4e354a['holdtime'],_0xbcf3('0x86'))[_0xbcf3('0x3f')](_0xbcf3('0x71'));_0x4a04f3['queuecallerexitreason']=_0xbcf3('0x87');_0x4a04f3[_0xbcf3('0x7e')]=!![];_0x4a04f3[_0xbcf3('0x88')]=_0xbcf3('0x89');_0x4a04f3[_0xbcf3('0x8a')]=_0x4e354a[_0xbcf3('0x8b')];_0x4a04f3['transferuniqueid']=_0x4e354a['uniqueid'];var _0x407433=this[_0xbcf3('0xf')][_0x4e354a[_0xbcf3('0x84')]];this[_0xbcf3('0xf')][_0x4e354a['linkedid']]=this[_0xbcf3('0xf')][_0x4e354a['uniqueid']];this[_0xbcf3('0xf')][_0x4e354a['uniqueid']]=_0x407433;}}else{_0x27a44a[_0xbcf3('0x72')]='COMPLETEDBY'+_0x4e354a[_0xbcf3('0x7f')]['toUpperCase']();}}}this['channels'][_0x4e354a[_0xbcf3('0x66')]]=_0x27a44a;this[_0xbcf3('0x3c')](_0x27a44a);}}}catch(_0x61264b){logger[_0xbcf3('0x38')](_0xbcf3('0x8c'),util[_0xbcf3('0x69')](_0x61264b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')]['syncVarSet']=function(_0xc2a923){try{if(this[_0xbcf3('0x53')](_0xc2a923)){this[_0xbcf3('0x8d')](_0xc2a923[_0xbcf3('0x66')],_[_0xbcf3('0x65')](_0xc2a923[_0xbcf3('0x8e')])[0x0],_0xc2a923[_0xbcf3('0x8f')]);if(this['queueReports'][_0xc2a923['uniqueid']]){var _0x36a40a=_[_0xbcf3('0x6a')](this['queueReports'][_0xc2a923[_0xbcf3('0x66')]]);if(_0x36a40a){if(this[_0xbcf3('0x53')](_0xc2a923['variable'])&&this['isNotNull'](_0xc2a923[_0xbcf3('0x8e')][_0xbcf3('0x90')])){switch(_0xc2a923[_0xbcf3('0x8f')]){case'CONTINUE':_0x36a40a[_0xbcf3('0x7d')]=![];_0x36a40a['queuecallerexitAt']=null;break;default:_0x36a40a[_0xbcf3('0x7d')]=!![];_0x36a40a[_0xbcf3('0x91')]=moment()[_0xbcf3('0x3f')](_0xbcf3('0x71'));_0x36a40a[_0xbcf3('0x76')]=moment()['format'](_0xbcf3('0x71'));}_0x36a40a[_0xbcf3('0x6f')]=![];_0x36a40a['queuecallerabandonAt']=null;_0x36a40a[_0xbcf3('0x72')]=_0xc2a923['value'];this[_0xbcf3('0x11')][_0xc2a923[_0xbcf3('0x66')]]=_0x36a40a;this[_0xbcf3('0x3c')](_0x36a40a);}else if(this['isNotNull'](_0xc2a923[_0xbcf3('0x8e')])&&this[_0xbcf3('0x53')](_0xc2a923[_0xbcf3('0x8e')][_0xbcf3('0x92')])){if(!_0x36a40a[_0xbcf3('0x6f')]){_0x36a40a[_0xbcf3('0x7d')]=!![];_0x36a40a[_0xbcf3('0x91')]=moment()[_0xbcf3('0x3f')](_0xbcf3('0x71'));_0x36a40a[_0xbcf3('0x72')]=_0xbcf3('0x93');_0x36a40a[_0xbcf3('0x76')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xbcf3('0x11')][_0xc2a923['uniqueid']]=_0x36a40a;}}_0x36a40a['variables']=this[_0xbcf3('0x39')][_0xc2a923[_0xbcf3('0x66')]];}}}}catch(_0x2b1f2f){logger['error']('[syncVarSet][VoiceQueueReport]',util[_0xbcf3('0x69')](_0x2b1f2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')]['addVariable']=function(_0xaf4f04,_0x3c9881,_0x49175b){var _0x2f4803=[_0xbcf3('0x94'),'rtpaudioqosbridged',_0xbcf3('0x95'),'rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0xbcf3('0x96'),_0xbcf3('0x97'),_0xbcf3('0x98'),_0xbcf3('0x99'),_0xbcf3('0x9a'),_0xbcf3('0x9b'),_0xbcf3('0x9c'),_0xbcf3('0x9d'),'memberinterface',_0xbcf3('0x9e'),'membername','memberpenalty','memberrealtime'];if(!_[_0xbcf3('0x34')](_0x3c9881)&&!_[_0xbcf3('0x9f')](_0x2f4803,_0x3c9881)){if(_['isUndefined'](this[_0xbcf3('0x39')][_0xaf4f04])){this[_0xbcf3('0x39')][_0xaf4f04]={};}this['variables'][_0xaf4f04][_0x3c9881]=_0x49175b;}};VoiceQueueReport['prototype']['syncHangup']=function(_0x4c8fd8){try{if(this[_0xbcf3('0x53')](_0x4c8fd8)){if(this[_0xbcf3('0xf')][_0x4c8fd8[_0xbcf3('0x66')]]){for(var _0x1e04fd=0x0,_0x5c20bb={};_0x1e04fd0x0?_0x2df5c8:0x0;this[_0x72c8('0x12')][_0x4316db[_0x72c8('0x5c')]][_0x72c8('0x4e')]=this[_0x72c8('0x12')][_0x4316db[_0x72c8('0x5c')]]['talking']>_[_0x72c8('0x5f')](_0x4316db[_0x72c8('0x60')])?_[_0x72c8('0x5f')](_0x4316db['loggedin']):this[_0x72c8('0x12')][_0x4316db[_0x72c8('0x5c')]][_0x72c8('0x4e')];this['emitVoiceQueueSummary'](this[_0x72c8('0x12')][_0x4316db[_0x72c8('0x5c')]]);}ami[_0x72c8('0x3e')](_0x72c8('0x62'),this[_0x72c8('0x12')][_0x4316db['queue']]);}}}catch(_0x3db042){logger[_0x72c8('0x39')](_0x72c8('0x63'),util['inspect'](_0x3db042,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x72c8('0x64')]=function(_0x280885){this[_0x72c8('0x13')]=!![];};VoiceQueueReport[_0x72c8('0xa')][_0x72c8('0x65')]=function(_0x15b9d9){};VoiceQueueReport[_0x72c8('0xa')][_0x72c8('0x1a')]=function(_0xf6be98){try{if(this['isNotNull'](_0xf6be98)){if(_[_0x72c8('0x57')](this['queueReports'][_0xf6be98[_0x72c8('0x66')]])){this[_0x72c8('0xf')][_0xf6be98['uniqueid']]=[];this[_0x72c8('0x11')][_0xf6be98[_0x72c8('0x66')]]={};}var _0x36a738=new QueueReport();_0x36a738['name']=_0xf6be98[_0x72c8('0x5c')];_0x36a738[_0x72c8('0x50')]=this[_0x72c8('0x12')][_0x36a738[_0x72c8('0x42')]]&&this['voiceQueues'][_0x36a738[_0x72c8('0x42')]]['type']?this[_0x72c8('0x12')][_0x36a738['name']]['type']||'inbound':_0x72c8('0x46');_0x36a738['queue']=_0xf6be98[_0x72c8('0x5c')];_0x36a738[_0x72c8('0x67')]=moment()[_0x72c8('0x40')](_0x72c8('0x68'));_0x36a738[_0x72c8('0x69')]=_0xf6be98[_0x72c8('0x69')];_0x36a738['count']=_0xf6be98[_0x72c8('0x6a')];_[_0x72c8('0x6b')](_0x36a738,_[_0x72c8('0x6c')](_0xf6be98,_[_0x72c8('0x6d')](_0x36a738)));this[_0x72c8('0xf')][_0xf6be98[_0x72c8('0x66')]][_0x72c8('0x6e')](_0x36a738);this[_0x72c8('0x11')][_0xf6be98[_0x72c8('0x66')]]=_0x36a738;this['emitVoiceQueueChannelSave'](_0x36a738);}}catch(_0x1bfd80){logger[_0x72c8('0x39')](_0x72c8('0x6f'),util[_0x72c8('0x3d')](_0x1bfd80,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x72c8('0xa')][_0x72c8('0x1c')]=function(_0x27c330){try{if(this['isNotNull'](_0x27c330)){if(this[_0x72c8('0xf')][_0x27c330[_0x72c8('0x66')]]){var _0xf0c04a=_[_0x72c8('0x70')](this['queueReports'][_0x27c330[_0x72c8('0x66')]]);_0xf0c04a['queuecallercomplete']=![];_0xf0c04a[_0x72c8('0x71')]=null;_0xf0c04a[_0x72c8('0x72')]=_0x27c330[_0x72c8('0x72')];_0xf0c04a['originalposition']=_0x27c330[_0x72c8('0x73')];_0xf0c04a[_0x72c8('0x1b')]=!![];_0xf0c04a['queuecallerabandonAt']=moment()['format'](_0x72c8('0x68'));_0xf0c04a[_0x72c8('0x74')]=_0x72c8('0x75');_0xf0c04a[_0x72c8('0x76')]=null;this['channels'][_0x27c330[_0x72c8('0x66')]]=_0xf0c04a;this[_0x72c8('0x43')](_0xf0c04a);}}}catch(_0x275b6e){logger['error'](_0x72c8('0x77'),util[_0x72c8('0x3d')](_0x275b6e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x72c8('0x78')]=function(_0x124cd4){try{if(this[_0x72c8('0x56')](_0x124cd4)){if(this['queueReports'][_0x124cd4[_0x72c8('0x66')]]){var _0x477240=_['last'](this[_0x72c8('0xf')][_0x124cd4[_0x72c8('0x66')]]);_0x477240[_0x72c8('0x79')]=moment()['format'](_0x72c8('0x68'));_0x477240[_0x72c8('0x7a')]=_0x124cd4[_0x72c8('0x7a')];_0x477240[_0x72c8('0x7b')]=_0x124cd4[_0x72c8('0x7b')];this[_0x72c8('0x11')][_0x124cd4[_0x72c8('0x66')]]=_0x477240;this[_0x72c8('0x3f')](_0x477240);}}}catch(_0x1808f8){logger[_0x72c8('0x39')](_0x72c8('0x7c'),util[_0x72c8('0x3d')](_0x1808f8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x72c8('0x7d')]=function(_0x2e2dea){try{if(this['isNotNull'](_0x2e2dea)){if(this[_0x72c8('0xf')][_0x2e2dea[_0x72c8('0x66')]]){var _0x10cd64=_[_0x72c8('0x70')](this[_0x72c8('0xf')][_0x2e2dea[_0x72c8('0x66')]]);_0x10cd64[_0x72c8('0x7e')]=!![];_0x10cd64['queuecallerexitreason']=_0x72c8('0x7f');}}}catch(_0x1f6e2a){logger[_0x72c8('0x39')](_0x72c8('0x80'),util[_0x72c8('0x3d')](_0x1f6e2a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x37cf38){try{if(this['isNotNull'](_0x37cf38)){if(this[_0x72c8('0xf')][_0x37cf38['uniqueid']]){var _0x2ef1a9=_[_0x72c8('0x70')](this[_0x72c8('0xf')][_0x37cf38[_0x72c8('0x66')]]);_0x2ef1a9[_0x72c8('0x1b')]=![];_0x2ef1a9[_0x72c8('0x81')]=null;_0x2ef1a9[_0x72c8('0x82')]=!![];_0x2ef1a9[_0x72c8('0x76')]=_0x37cf38[_0x72c8('0x83')];_0x2ef1a9['holdtime']=_0x37cf38['holdtime'];_0x2ef1a9['queuecallercomplete']=!![];_0x2ef1a9[_0x72c8('0x84')]=![];_0x2ef1a9[_0x72c8('0x85')]=null;if(!_0x2ef1a9[_0x72c8('0x86')]){if(_0x37cf38[_0x72c8('0x87')]=='transfer'){_0x2ef1a9['queuecallerexitreason']=_0x72c8('0x88');}else{if(_[_0x72c8('0x89')](_0x37cf38[_0x72c8('0x8a')]['toLowerCase'](),'local/')){if(this['queueReports'][_0x37cf38[_0x72c8('0x8b')]]){var _0x59470e=_[_0x72c8('0x70')](this[_0x72c8('0xf')][_0x37cf38[_0x72c8('0x8b')]]);_0x59470e[_0x72c8('0x7e')]=![];_0x59470e['queuecallerexit']=!![];_0x59470e['queuecallerexitAt']=moment(_0x2ef1a9[_0x72c8('0x67')])[_0x72c8('0x8c')](_0x37cf38['holdtime'],_0x72c8('0x8d'))['format'](_0x72c8('0x68'));_0x59470e[_0x72c8('0x74')]=_0x72c8('0x8e');_0x59470e[_0x72c8('0x86')]=!![];_0x59470e[_0x72c8('0x8f')]=_0x72c8('0x90');_0x59470e[_0x72c8('0x91')]=_0x37cf38['destexten'];_0x59470e['transferuniqueid']=_0x37cf38['uniqueid'];var _0x27d70f=this['queueReports'][_0x37cf38['linkedid']];this['queueReports'][_0x37cf38[_0x72c8('0x8b')]]=this[_0x72c8('0xf')][_0x37cf38[_0x72c8('0x66')]];this['queueReports'][_0x37cf38[_0x72c8('0x66')]]=_0x27d70f;}}else{_0x2ef1a9['queuecallerexitreason']=_0x72c8('0x92')+_0x37cf38['reason'][_0x72c8('0x93')]();}}}this[_0x72c8('0x11')][_0x37cf38[_0x72c8('0x66')]]=_0x2ef1a9;this[_0x72c8('0x43')](_0x2ef1a9);}}}catch(_0x1f10a7){logger['error'](_0x72c8('0x94'),util[_0x72c8('0x3d')](_0x1f10a7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x72c8('0xa')][_0x72c8('0x20')]=function(_0x2c11cc){try{if(this[_0x72c8('0x56')](_0x2c11cc)){this[_0x72c8('0x95')](_0x2c11cc['uniqueid'],_[_0x72c8('0x6d')](_0x2c11cc['variable'])[0x0],_0x2c11cc[_0x72c8('0x96')]);if(this[_0x72c8('0xf')][_0x2c11cc[_0x72c8('0x66')]]){var _0x1d7329=_['last'](this[_0x72c8('0xf')][_0x2c11cc['uniqueid']]);if(_0x1d7329){if(this[_0x72c8('0x56')](_0x2c11cc[_0x72c8('0x97')])&&this['isNotNull'](_0x2c11cc['variable'][_0x72c8('0x98')])){switch(_0x2c11cc[_0x72c8('0x96')]){case _0x72c8('0x99'):_0x1d7329['queuecallerexit']=![];_0x1d7329['queuecallerexitAt']=null;break;default:_0x1d7329[_0x72c8('0x84')]=!![];_0x1d7329['queuecallerexitAt']=moment()[_0x72c8('0x40')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d7329[_0x72c8('0x79')]=moment()['format'](_0x72c8('0x68'));}_0x1d7329['queuecallerabandon']=![];_0x1d7329[_0x72c8('0x81')]=null;_0x1d7329['queuecallerexitreason']=_0x2c11cc[_0x72c8('0x96')];this[_0x72c8('0x11')][_0x2c11cc['uniqueid']]=_0x1d7329;this['emitVoiceQueueChannelRemove'](_0x1d7329);}else if(this[_0x72c8('0x56')](_0x2c11cc[_0x72c8('0x97')])&&this[_0x72c8('0x56')](_0x2c11cc[_0x72c8('0x97')]['queueposition'])){if(!_0x1d7329['queuecallerabandon']){_0x1d7329[_0x72c8('0x84')]=!![];_0x1d7329[_0x72c8('0x85')]=moment()[_0x72c8('0x40')](_0x72c8('0x68'));_0x1d7329['queuecallerexitreason']='EXITWITHKEY';_0x1d7329['queuecallerleaveAt']=moment()[_0x72c8('0x40')](_0x72c8('0x68'));this['channels'][_0x2c11cc['uniqueid']]=_0x1d7329;}}_0x1d7329[_0x72c8('0x15')]=this[_0x72c8('0x15')][_0x2c11cc[_0x72c8('0x66')]];}}}}catch(_0x469d34){logger[_0x72c8('0x39')](_0x72c8('0x9a'),util[_0x72c8('0x3d')](_0x469d34,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x72c8('0xa')]['addVariable']=function(_0x794476,_0x5a5c9c,_0xf066e4){var _0x5de591=[_0x72c8('0x9b'),'rtpaudioqosbridged',_0x72c8('0x9c'),_0x72c8('0x9d'),'rtpaudioqosloss',_0x72c8('0x9e'),_0x72c8('0x9f'),_0x72c8('0xa0'),_0x72c8('0xa1'),_0x72c8('0xa2'),_0x72c8('0xa3'),_0x72c8('0xa4'),_0x72c8('0xa5'),'memberdynamic',_0x72c8('0xa6'),_0x72c8('0xa7'),_0x72c8('0x83'),_0x72c8('0xa8'),_0x72c8('0xa9')];if(!_[_0x72c8('0x34')](_0x5a5c9c)&&!_[_0x72c8('0xaa')](_0x5de591,_0x5a5c9c)){if(_[_0x72c8('0x57')](this[_0x72c8('0x15')][_0x794476])){this['variables'][_0x794476]={};}this[_0x72c8('0x15')][_0x794476][_0x5a5c9c]=_0xf066e4;}};VoiceQueueReport[_0x72c8('0xa')][_0x72c8('0xab')]=function(_0x4f5e15){try{if(this[_0x72c8('0x56')](_0x4f5e15)){if(this[_0x72c8('0xf')][_0x4f5e15[_0x72c8('0x66')]]){for(var _0x35772e=0x0,_0x2214cf={};_0x35772e=0x0?moment(_0x2268fc[_0xbf80('0x17')])['diff'](_0x2268fc[_0xbf80('0x16')],_0xbf80('0xe')):null,'data1':_0xbf80('0x18'),'data2':_0x2268fc['accountcode'],'data3':_0x2268fc[_0xbf80('0x19')],'data4':_0x2268fc[_0xbf80('0x1a')]||null,'role':'agent','internal':_0x2268fc['accountcode']?_[_0xbf80('0x14')](_0x2268fc[_0xbf80('0x13')]):undefined,'uniqueid':_0x2268fc[_0xbf80('0x1b')]},'log':_0xbf80('0x6')});};
\ No newline at end of file
+var _0x8fa0=['Request','CreateMemberReport','voice','lastAssignedTo','isNil','format','SIP/%s','interface','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','starttime','endtime','seconds','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt'];(function(_0x2fe6e7,_0x22fbd3){var _0x4ee270=function(_0x55fb2a){while(--_0x55fb2a){_0x2fe6e7['push'](_0x2fe6e7['shift']());}};_0x4ee270(++_0x22fbd3);}(_0x8fa0,0x1d7));var _0x08fa=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x8fa0[_0x138adb];return _0x1b27f2;};'use strict';var moment=require('moment');var _=require(_0x08fa('0x0'));var util=require(_0x08fa('0x1'));var client=require(_0x08fa('0x2'));exports['voiceQueueReport']=function(_0x4022bf){var _0x3b6f5f=_0x4022bf[_0x08fa('0x3')]||_0x4022bf[_0x08fa('0x4')];return client[_0x08fa('0x5')](_0x08fa('0x6'),{'body':{'channel':_0x08fa('0x7'),'membername':_0x4022bf[_0x08fa('0x8')],'interface':_[_0x08fa('0x9')](_0x4022bf['interface'])?util[_0x08fa('0xa')](_0x08fa('0xb'),_0x4022bf[_0x08fa('0x8')]):_0x4022bf[_0x08fa('0xc')],'type':_0x08fa('0xd'),'enterAt':_0x4022bf[_0x08fa('0xe')],'exitAt':_0x3b6f5f,'duration':moment(_0x3b6f5f)[_0x08fa('0xf')](_0x4022bf[_0x08fa('0xe')],'seconds'),'data1':_0x08fa('0x10'),'data2':_0x4022bf[_0x08fa('0x11')],'data3':_0x4022bf[_0x08fa('0x12')],'data4':null,'data5':_0x4022bf[_0x08fa('0x13')],'role':_0x08fa('0x14'),'internal':_0x4022bf[_0x08fa('0x15')]?_[_0x08fa('0x16')](_0x4022bf[_0x08fa('0x15')]):undefined,'uniqueid':_0x4022bf[_0x08fa('0x17')]},'log':'CreateMemberReport'});};exports[_0x08fa('0x18')]=function(_0x194003){return client[_0x08fa('0x5')](_0x08fa('0x6'),{'body':{'channel':_0x08fa('0x7'),'membername':_0x194003['membername'],'interface':_0x194003[_0x08fa('0xc')],'type':_0x08fa('0xd'),'enterAt':_0x194003[_0x08fa('0x19')],'exitAt':_0x194003[_0x08fa('0x1a')],'duration':moment(_0x194003[_0x08fa('0x1a')])[_0x08fa('0xf')](_0x194003[_0x08fa('0x19')],_0x08fa('0x1b'))>=0x0?moment(_0x194003[_0x08fa('0x1a')])[_0x08fa('0xf')](_0x194003[_0x08fa('0x19')],_0x08fa('0x1b')):null,'data1':'outbound','data2':_0x194003['accountcode'],'data3':_0x194003[_0x08fa('0x12')],'data4':_0x194003['dialstring']||null,'role':_0x08fa('0x14'),'internal':_0x194003['accountcode']?_[_0x08fa('0x16')](_0x194003[_0x08fa('0x15')]):undefined,'uniqueid':_0x194003['uniqueid']},'log':_0x08fa('0x6')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js
index dffcc67..3437d6e 100644
--- a/server/services/ami/rpc/template.js
+++ b/server/services/ami/rpc/template.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc564=['html','../client','getTemplates','GetTemplate'];(function(_0x1ee2c3,_0x1ee21e){var _0x352d97=function(_0x215b77){while(--_0x215b77){_0x1ee2c3['push'](_0x1ee2c3['shift']());}};_0x352d97(++_0x1ee21e);}(_0xc564,0x145));var _0x4c56=function(_0x24b75b,_0x19b7fc){_0x24b75b=_0x24b75b-0x0;var _0x1c63f4=_0xc564[_0x24b75b];return _0x1c63f4;};'use strict';var client=require(_0x4c56('0x0'));exports[_0x4c56('0x1')]=function(_0x5815b0){return function(_0x35d3e8){return client['Request'](_0x4c56('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x4c56('0x3')]},'log':'GetTemplate'});};};
\ No newline at end of file
+var _0xb983=['getTemplates','GetTemplate','html','../client'];(function(_0x4f56c3,_0x42cacd){var _0x168776=function(_0x3c56ca){while(--_0x3c56ca){_0x4f56c3['push'](_0x4f56c3['shift']());}};_0x168776(++_0x42cacd);}(_0xb983,0xa3));var _0x3b98=function(_0x4914ad,_0x551a18){_0x4914ad=_0x4914ad-0x0;var _0x3cd61f=_0xb983[_0x4914ad];return _0x3cd61f;};'use strict';var client=require(_0x3b98('0x0'));exports[_0x3b98('0x1')]=function(_0x407fc0){return function(_0x32fd4f){return client['Request'](_0x3b98('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x3b98('0x3')]},'log':_0x3b98('0x2')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js
index 776c090..6131c4b 100644
--- a/server/services/ami/rpc/trigger.js
+++ b/server/services/ami/rpc/trigger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x1584ae,_0x5270a4){var _0x417d41=function(_0x3ca67f){while(--_0x3ca67f){_0x1584ae['push'](_0x1584ae['shift']());}};_0x417d41(++_0x5270a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x324cfa,_0x169324){var _0x475b55=function(_0x3b99fa){while(--_0x3b99fa){_0x324cfa['push'](_0x324cfa['shift']());}};_0x475b55(++_0x169324);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js
index 20ab77e..0ef2650 100644
--- a/server/services/ami/rpc/trunk.js
+++ b/server/services/ami/rpc/trunk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0014=['GetTrunk','name','getTrunks'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0014,0x1ca));var _0x4001=function(_0x10d2a8,_0xefc4dc){_0x10d2a8=_0x10d2a8-0x0;var _0xbc0636=_0x0014[_0x10d2a8];return _0xbc0636;};'use strict';var client=require('../client');exports[_0x4001('0x0')]=function(_0x10ef3b){return function(_0x872343){return client['Request'](_0x4001('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x4001('0x2'),'registry']},'log':_0x4001('0x1')});};};
\ No newline at end of file
+var _0xc017=['GetTrunk','name','getTrunks'];(function(_0x196192,_0x58189a){var _0x3fdb0f=function(_0x285ee6){while(--_0x285ee6){_0x196192['push'](_0x196192['shift']());}};_0x3fdb0f(++_0x58189a);}(_0xc017,0x1dc));var _0x7c01=function(_0x20c88b,_0x1e45e1){_0x20c88b=_0x20c88b-0x0;var _0x1204db=_0xc017[_0x20c88b];return _0x1204db;};'use strict';var client=require('../client');exports[_0x7c01('0x0')]=function(_0xf2727f){return function(_0x43b544){return client['Request'](_0x7c01('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7c01('0x2'),'registry']},'log':'GetTrunk'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js
index c3f5d3c..f1e9965 100644
--- a/server/services/ami/rpc/user.js
+++ b/server/services/ami/rpc/user.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc33d=['phone','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','getAgent','voicePause','getAgents','Request','agent','name','email','accountcode','online','lastLoginAt','pauseType','lastPauseAt'];(function(_0x1476df,_0x4ed81f){var _0x2cf680=function(_0x85d227){while(--_0x85d227){_0x1476df['push'](_0x1476df['shift']());}};_0x2cf680(++_0x4ed81f);}(_0xc33d,0x96));var _0xdc33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc33d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xdc33('0x0')]=function(){return function(){return client[_0xdc33('0x1')]('GetUser',{'options':{'raw':![],'where':{'role':_0xdc33('0x2')},'attributes':['id',_0xdc33('0x3'),_0xdc33('0x4'),_0xdc33('0x5'),'fullname',_0xdc33('0x6'),_0xdc33('0x7'),_0xdc33('0x8'),_0xdc33('0x9'),'voicePause',_0xdc33('0xa'),'mobile',_0xdc33('0xb')]},'log':_0xdc33('0x0')});};};exports[_0xdc33('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0xdc33('0xd')},'attributes':['id',_0xdc33('0x3'),_0xdc33('0x5'),_0xdc33('0xe')]},'log':'getTelephones'});};};exports[_0xdc33('0xf')]=function(_0x489104,_0x92dc73,_0xe0c4ac){return client[_0xdc33('0x1')](_0xdc33('0x10'),{'body':{'type':_0x92dc73,'uniqueid':_0xe0c4ac},'options':{'where':{'id':_0x489104['id']}},'log':_0xdc33('0xf')});};exports[_0xdc33('0x11')]=function(_0x198015){return client['Request']('UnpauseUser',{'body':{},'options':{'where':{'id':_0x198015['id']}},'log':_0xdc33('0xf')});};exports[_0xdc33('0x12')]=function(_0x40810e){return client[_0xdc33('0x1')]('ShowUser',{'options':{'raw':![],'where':{'role':_0xdc33('0x2'),'id':_0x40810e},'attributes':['id',_0xdc33('0x3'),_0xdc33('0x4'),'accountcode','fullname',_0xdc33('0x6'),_0xdc33('0x7'),_0xdc33('0x8'),_0xdc33('0x9'),_0xdc33('0x13'),'interface']},'log':_0xdc33('0x12')});};
\ No newline at end of file
+var _0xb296=['pauseType','phone','mobile','interface','getTelephones','Request','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','email','lastLoginAt','lastPauseAt','voicePause','../client','getAgents','agent','name','accountcode','fullname','online'];(function(_0x4b351d,_0xba54b3){var _0x258c90=function(_0x2b2c42){while(--_0x2b2c42){_0x4b351d['push'](_0x4b351d['shift']());}};_0x258c90(++_0xba54b3);}(_0xb296,0x1f1));var _0x6b29=function(_0x43c0ed,_0x305af1){_0x43c0ed=_0x43c0ed-0x0;var _0x4e137b=_0xb296[_0x43c0ed];return _0x4e137b;};'use strict';var client=require(_0x6b29('0x0'));exports[_0x6b29('0x1')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':![],'where':{'role':_0x6b29('0x2')},'attributes':['id',_0x6b29('0x3'),'email',_0x6b29('0x4'),_0x6b29('0x5'),_0x6b29('0x6'),'lastLoginAt',_0x6b29('0x7'),'lastPauseAt','voicePause',_0x6b29('0x8'),_0x6b29('0x9'),_0x6b29('0xa')]},'log':_0x6b29('0x1')});};};exports[_0x6b29('0xb')]=function(){return function(){return client[_0x6b29('0xc')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x6b29('0xd')},'attributes':['id',_0x6b29('0x3'),_0x6b29('0x4'),_0x6b29('0xe')]},'log':_0x6b29('0xb')});};};exports[_0x6b29('0xf')]=function(_0x3b3c31,_0x11b493,_0x47d64b){return client[_0x6b29('0xc')](_0x6b29('0x10'),{'body':{'type':_0x11b493,'uniqueid':_0x47d64b},'options':{'where':{'id':_0x3b3c31['id']}},'log':_0x6b29('0xf')});};exports[_0x6b29('0x11')]=function(_0x31acdf){return client[_0x6b29('0xc')](_0x6b29('0x12'),{'body':{},'options':{'where':{'id':_0x31acdf['id']}},'log':_0x6b29('0xf')});};exports['getAgent']=function(_0x3c36b3){return client[_0x6b29('0xc')](_0x6b29('0x13'),{'options':{'raw':![],'where':{'role':_0x6b29('0x2'),'id':_0x3c36b3},'attributes':['id',_0x6b29('0x3'),_0x6b29('0x14'),_0x6b29('0x4'),_0x6b29('0x5'),_0x6b29('0x6'),_0x6b29('0x15'),_0x6b29('0x7'),_0x6b29('0x16'),_0x6b29('0x17'),_0x6b29('0xa')]},'log':'getAgent'});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js
index b7d0b98..3858864 100644
--- a/server/services/ami/rpc/voiceAgentReport.js
+++ b/server/services/ami/rpc/voiceAgentReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x825a=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x825a,0x187));var _0xa825=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x825a[_0x10791d];return _0x1b4f9c;};'use strict';var client=require(_0xa825('0x0'));exports[_0xa825('0x1')]=function(_0x2da3a2){return client[_0xa825('0x2')](_0xa825('0x3'),{'body':_0x2da3a2,'log':'CreateVoiceAgentReport'});};exports[_0xa825('0x4')]=function(_0x3cf26d,_0xd43259,_0x8af563){return client['Request'](_0xa825('0x5'),{'body':_0x3cf26d,'options':{'where':{'uniqueid':_0xd43259,'interface':_0x8af563}},'log':_0xa825('0x5')});};
\ No newline at end of file
+var _0x3652=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0xb729d2,_0x131a0e){var _0x181500=function(_0x38cdec){while(--_0x38cdec){_0xb729d2['push'](_0xb729d2['shift']());}};_0x181500(++_0x131a0e);}(_0x3652,0x1c9));var _0x2365=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x3652[_0xe30e17];return _0x2342c9;};'use strict';var client=require(_0x2365('0x0'));exports[_0x2365('0x1')]=function(_0x31e8e0){return client[_0x2365('0x2')](_0x2365('0x3'),{'body':_0x31e8e0,'log':_0x2365('0x3')});};exports[_0x2365('0x4')]=function(_0x5187c0,_0x109410,_0x5ac42a){return client['Request']('UpdateVoiceAgentReport',{'body':_0x5187c0,'options':{'where':{'uniqueid':_0x109410,'interface':_0x5ac42a}},'log':_0x2365('0x5')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js
index 1305f4d..8cfe030 100644
--- a/server/services/ami/rpc/voiceCallReport.js
+++ b/server/services/ami/rpc/voiceCallReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a21=['DOCUMENTATION','Request','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','billableseconds','GetVoiceCallReports','util','lodash','../client','CreateVoiceCallReport','merge','calleridnum','context','callerid'];(function(_0x11d965,_0x463c0e){var _0x16db5b=function(_0x376893){while(--_0x376893){_0x11d965['push'](_0x11d965['shift']());}};_0x16db5b(++_0x463c0e);}(_0x3a21,0xca));var _0x13a2=function(_0x1c7968,_0x4ef3d9){_0x1c7968=_0x1c7968-0x0;var _0x1432b2=_0x3a21[_0x1c7968];return _0x1432b2;};'use strict';var moment=require('moment');var util=require(_0x13a2('0x0'));var _=require(_0x13a2('0x1'));var client=require(_0x13a2('0x2'));exports['create']=function(_0x1dca05){return client['Request'](_0x13a2('0x3'),{'body':_[_0x13a2('0x4')](_0x1dca05,{'source':_0x1dca05[_0x13a2('0x5')],'destinationcontext':_0x1dca05[_0x13a2('0x6')],'callerid':_0x1dca05[_0x13a2('0x7')],'amaflags':_0x13a2('0x8')}),'log':_0x13a2('0x3')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x13a2('0x9')](_0x13a2('0xa'),{'options':{'where':{'type':[_0x13a2('0xb')],'createdAt':{'$between':[moment()[_0x13a2('0xc')](_0x13a2('0xd'))[_0x13a2('0xe')](_0x13a2('0xf')),moment()[_0x13a2('0x10')]('day')['format'](_0x13a2('0xf'))]}},'attributes':[_0x13a2('0x11'),_0x13a2('0x12'),'duration',_0x13a2('0x13')]},'log':_0x13a2('0x14')});};};
\ No newline at end of file
+var _0x223a=['GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds'];(function(_0x151381,_0x97b314){var _0x2afab6=function(_0x4b3941){while(--_0x4b3941){_0x151381['push'](_0x151381['shift']());}};_0x2afab6(++_0x97b314);}(_0x223a,0x1a5));var _0xa223=function(_0x5948e6,_0x618459){_0x5948e6=_0x5948e6-0x0;var _0x17d5a5=_0x223a[_0x5948e6];return _0x17d5a5;};'use strict';var moment=require(_0xa223('0x0'));var util=require('util');var _=require(_0xa223('0x1'));var client=require(_0xa223('0x2'));exports[_0xa223('0x3')]=function(_0xebd182){return client[_0xa223('0x4')](_0xa223('0x5'),{'body':_[_0xa223('0x6')](_0xebd182,{'source':_0xebd182[_0xa223('0x7')],'destinationcontext':_0xebd182[_0xa223('0x8')],'callerid':_0xebd182[_0xa223('0x9')],'amaflags':'DOCUMENTATION'}),'log':_0xa223('0x5')});};exports[_0xa223('0xa')]=function(){return function(){return client[_0xa223('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xa223('0xb')],'createdAt':{'$between':[moment()[_0xa223('0xc')](_0xa223('0xd'))['format'](_0xa223('0xe')),moment()[_0xa223('0xf')](_0xa223('0xd'))['format'](_0xa223('0xe'))]}},'attributes':['type',_0xa223('0x10'),_0xa223('0x11'),_0xa223('0x12')]},'log':_0xa223('0x13')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js
index 96ad23d..9f280ff 100644
--- a/server/services/ami/rpc/voiceDialReport.js
+++ b/server/services/ami/rpc/voiceDialReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1eb6=['../client','create','CreateVoiceDialReport'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0x1eb6,0xcc));var _0x61eb=function(_0x36fd2f,_0x94d493){_0x36fd2f=_0x36fd2f-0x0;var _0x130db9=_0x1eb6[_0x36fd2f];return _0x130db9;};'use strict';var client=require(_0x61eb('0x0'));exports[_0x61eb('0x1')]=function(_0x4e1b2c){return client['Request'](_0x61eb('0x2'),{'body':_0x4e1b2c,'log':_0x61eb('0x2')});};
\ No newline at end of file
+var _0x6a71=['create','CreateVoiceDialReport','../client'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x6a71,0x146));var _0x16a7=function(_0x1e483c,_0x509fd4){_0x1e483c=_0x1e483c-0x0;var _0x2e5a9b=_0x6a71[_0x1e483c];return _0x2e5a9b;};'use strict';var client=require(_0x16a7('0x0'));exports[_0x16a7('0x1')]=function(_0x5c8686){return client['Request'](_0x16a7('0x2'),{'body':_0x5c8686,'log':_0x16a7('0x2')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js
index f0db0c9..2d26886 100644
--- a/server/services/ami/rpc/voiceExtension.js
+++ b/server/services/ami/rpc/voiceExtension.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe0da=['exten','recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x4b4983,_0xa9ee1f){var _0x5ceab7=function(_0x308324){while(--_0x308324){_0x4b4983['push'](_0x4b4983['shift']());}};_0x5ceab7(++_0xa9ee1f);}(_0xe0da,0x16f));var _0xae0d=function(_0xeebb33,_0xf4e7c4){_0xeebb33=_0xeebb33-0x0;var _0x57209d=_0xe0da[_0xeebb33];return _0x57209d;};'use strict';var client=require('../client');exports[_0xae0d('0x0')]=function(){return function(){return client[_0xae0d('0x1')](_0xae0d('0x2'),{'options':{'raw':!![],'attributes':['id',_0xae0d('0x3'),_0xae0d('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xae0d('0x0')});};};
\ No newline at end of file
+var _0xbb3f=['Request','GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x4a3a65,_0x1eed9b){var _0xf91034=function(_0x24c88f){while(--_0x24c88f){_0x4a3a65['push'](_0x4a3a65['shift']());}};_0xf91034(++_0x1eed9b);}(_0xbb3f,0x16c));var _0xfbb3=function(_0x35526c,_0x1554be){_0x35526c=_0x35526c-0x0;var _0x100975=_0xbb3f[_0x35526c];return _0x100975;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0xfbb3('0x0')](_0xfbb3('0x1'),{'options':{'raw':!![],'attributes':['id',_0xfbb3('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xfbb3('0x3')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js
index 4d3a7f3..8550934 100644
--- a/server/services/ami/rpc/voiceQueue.js
+++ b/server/services/ami/rpc/voiceQueue.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x65cb=['dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel'];(function(_0x44be6d,_0x1cbcb5){var _0x540b5b=function(_0x80459f){while(--_0x80459f){_0x44be6d['push'](_0x44be6d['shift']());}};_0x540b5b(++_0x1cbcb5);}(_0x65cb,0xa4));var _0xb65c=function(_0xc9ab53,_0x424948){_0xc9ab53=_0xc9ab53-0x0;var _0x410bcd=_0x65cb[_0xc9ab53];return _0x410bcd;};'use strict';var client=require(_0xb65c('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xb65c('0x1')](_0xb65c('0x2'),{'options':{'raw':![],'attributes':['id',_0xb65c('0x3'),'acw',_0xb65c('0x4'),_0xb65c('0x5'),_0xb65c('0x6'),_0xb65c('0x7'),_0xb65c('0x8'),'dialMethod',_0xb65c('0x9'),_0xb65c('0xa'),_0xb65c('0xb'),_0xb65c('0xc'),_0xb65c('0xd'),_0xb65c('0xe'),_0xb65c('0xf'),_0xb65c('0x10'),'dialOriginateTimeout',_0xb65c('0x11'),_0xb65c('0x12'),_0xb65c('0x13'),_0xb65c('0x14'),'dialCongestionRetryFrequency',_0xb65c('0x15'),'dialBusyRetryFrequency',_0xb65c('0x16'),_0xb65c('0x17'),_0xb65c('0x18'),_0xb65c('0x19'),_0xb65c('0x1a'),_0xb65c('0x1b'),'dialCheckDuplicateType',_0xb65c('0x1c'),_0xb65c('0x1d'),_0xb65c('0x1e'),_0xb65c('0x1f'),_0xb65c('0x20'),_0xb65c('0x21'),_0xb65c('0x22'),'dialAMDMaximumNumberOfWords',_0xb65c('0x23'),_0xb65c('0x24'),'timeout',_0xb65c('0x25'),'dialRecallInQueue',_0xb65c('0x26'),_0xb65c('0x27'),_0xb65c('0x28'),_0xb65c('0x29'),_0xb65c('0x6'),_0xb65c('0x2a'),_0xb65c('0x2b'),_0xb65c('0x2c'),_0xb65c('0x2d'),_0xb65c('0x2e'),_0xb65c('0x2f')],'include':[{'model':_0xb65c('0x30'),'as':_0xb65c('0x30'),'attributes':['id',_0xb65c('0x3'),_0xb65c('0x31'),'active']},{'model':_0xb65c('0x32'),'as':_0xb65c('0x33'),'attributes':['id',_0xb65c('0x3')]},{'model':_0xb65c('0x30'),'as':_0xb65c('0x34'),'attributes':['id',_0xb65c('0x3'),_0xb65c('0x31'),_0xb65c('0x35')]},{'model':_0xb65c('0x36'),'as':_0xb65c('0x36'),'attributes':['id',_0xb65c('0x3')],'include':[{'model':_0xb65c('0x36'),'as':_0xb65c('0x37'),'attributes':['id',_0xb65c('0x3'),_0xb65c('0x38')]}]}]},'log':_0xb65c('0x39')});};};
\ No newline at end of file
+var _0xa544=['Intervals','getVoiceQueues','Request','name','acw','acwTimeout','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval'];(function(_0x5d25c0,_0x44ed46){var _0x2b8c25=function(_0x581995){while(--_0x581995){_0x5d25c0['push'](_0x5d25c0['shift']());}};_0x2b8c25(++_0x44ed46);}(_0xa544,0x97));var _0x4a54=function(_0x2dd177,_0x4acb33){_0x2dd177=_0x2dd177-0x0;var _0x56f254=_0xa544[_0x2dd177];return _0x56f254;};'use strict';var client=require('../client');exports[_0x4a54('0x0')]=function(){return function(){return client[_0x4a54('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x4a54('0x2'),_0x4a54('0x3'),_0x4a54('0x4'),'autopause',_0x4a54('0x5'),_0x4a54('0x6'),'dialActive',_0x4a54('0x7'),_0x4a54('0x8'),_0x4a54('0x9'),'dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x4a54('0xa'),_0x4a54('0xb'),_0x4a54('0xc'),'dialOriginateTimeout','dialQueueOptions',_0x4a54('0xd'),_0x4a54('0xe'),_0x4a54('0xf'),_0x4a54('0x10'),_0x4a54('0x11'),'dialBusyRetryFrequency',_0x4a54('0x12'),_0x4a54('0x13'),_0x4a54('0x14'),_0x4a54('0x15'),_0x4a54('0x16'),'dialPrefix',_0x4a54('0x17'),'dialAMDActive','dialAMDInitialSilence',_0x4a54('0x18'),_0x4a54('0x19'),_0x4a54('0x1a'),_0x4a54('0x1b'),_0x4a54('0x1c'),_0x4a54('0x1d'),_0x4a54('0x1e'),_0x4a54('0x1f'),'timeout',_0x4a54('0x20'),_0x4a54('0x21'),_0x4a54('0x22'),_0x4a54('0x23'),_0x4a54('0x24'),_0x4a54('0x25'),_0x4a54('0x5'),_0x4a54('0x26'),_0x4a54('0x27'),_0x4a54('0x28'),_0x4a54('0x29'),'dialPredictiveIntervalMaxThreshold',_0x4a54('0x2a')],'include':[{'model':_0x4a54('0x2b'),'as':_0x4a54('0x2b'),'attributes':['id','name',_0x4a54('0x2c'),_0x4a54('0x2d')]},{'model':_0x4a54('0x2e'),'as':_0x4a54('0x2f'),'attributes':['id',_0x4a54('0x2')]},{'model':_0x4a54('0x2b'),'as':'TrunkBackup','attributes':['id',_0x4a54('0x2'),_0x4a54('0x2c'),_0x4a54('0x2d')]},{'model':_0x4a54('0x30'),'as':_0x4a54('0x30'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0x4a54('0x31'),'attributes':['id','name','interval']}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js
index d848933..c78a3af 100644
--- a/server/services/ami/rpc/voiceQueueReport.js
+++ b/server/services/ami/rpc/voiceQueueReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x25e1=['Request','GetVoiceQueueReport','startOf','format','endOf','day','YYYY-MM-DD\x20HH:mm:ss','queuecallerleaveAt','queuecallercomplete','queuecallerexit','queuecallerabandon','queuecallerabandonAt','lodash','../client','create','CreateVoiceQueueReport','getVoiceQueueReports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x25e1,0x14f));var _0x125e=function(_0x4d2a99,_0x3649d6){_0x4d2a99=_0x4d2a99-0x0;var _0x888f3a=_0x25e1[_0x4d2a99];return _0x888f3a;};'use strict';var moment=require('moment');var _=require(_0x125e('0x0'));var client=require(_0x125e('0x1'));exports[_0x125e('0x2')]=function(_0x585ae6){return client['Request']('CreateVoiceQueueReport',{'body':_0x585ae6,'log':_0x125e('0x3')});};exports[_0x125e('0x4')]=function(){return function(){return client[_0x125e('0x5')](_0x125e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x125e('0x7')]('day')[_0x125e('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x125e('0x9')](_0x125e('0xa'))[_0x125e('0x8')](_0x125e('0xb'))]}},'attributes':['uniqueid','queue','queuecallerjoinAt',_0x125e('0xc'),_0x125e('0xd'),'queuecallercompleteAt',_0x125e('0xe'),'queuecallerexitAt',_0x125e('0xf'),_0x125e('0x10')]},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
+var _0xbc90=['lodash','create','Request','CreateVoiceQueueReport','day','endOf','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment'];(function(_0x30810d,_0x519cbe){var _0x56388f=function(_0x5c42b9){while(--_0x5c42b9){_0x30810d['push'](_0x30810d['shift']());}};_0x56388f(++_0x519cbe);}(_0xbc90,0x11f));var _0x0bc9=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xbc90[_0x1a36a5];return _0x746243;};'use strict';var moment=require(_0x0bc9('0x0'));var _=require(_0x0bc9('0x1'));var client=require('../client');exports[_0x0bc9('0x2')]=function(_0x5ee90a){return client[_0x0bc9('0x3')](_0x0bc9('0x4'),{'body':_0x5ee90a,'log':'CreateVoiceQueueReport'});};exports['getVoiceQueueReports']=function(){return function(){return client[_0x0bc9('0x3')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x0bc9('0x5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x0bc9('0x6')](_0x0bc9('0x5'))['format'](_0x0bc9('0x7'))]}},'attributes':[_0x0bc9('0x8'),_0x0bc9('0x9'),_0x0bc9('0xa'),_0x0bc9('0xb'),'queuecallercomplete',_0x0bc9('0xc'),_0x0bc9('0xd'),_0x0bc9('0xe'),_0x0bc9('0xf'),_0x0bc9('0x10')]},'log':_0x0bc9('0x11')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js
index 9228166..b6ae1cf 100644
--- a/server/services/ami/rpc/voiceQueueRt.js
+++ b/server/services/ami/rpc/voiceQueueRt.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf215=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x3525d4,_0xc765c4){var _0x29d535=function(_0x403741){while(--_0x403741){_0x3525d4['push'](_0x3525d4['shift']());}};_0x29d535(++_0xc765c4);}(_0xf215,0xec));var _0x5f21=function(_0x1e5725,_0x3f4e13){_0x1e5725=_0x1e5725-0x0;var _0x4b5cf8=_0xf215[_0x1e5725];return _0x4b5cf8;};'use strict';var client=require(_0x5f21('0x0'));exports[_0x5f21('0x1')]=function(_0x56aa5d){return function(){return client[_0x5f21('0x2')](_0x5f21('0x3'),{'options':{'where':{'VoiceQueueId':_0x56aa5d,'paused':!![]},'raw':!![]},'log':_0x5f21('0x1')});};};
\ No newline at end of file
+var _0x0a3e=['getVoiceQueueRtPauses','../client','Request','GetVoiceQueueRtPauses'];(function(_0x4c1c6b,_0x1d8da0){var _0x58bec7=function(_0x4623b2){while(--_0x4623b2){_0x4c1c6b['push'](_0x4c1c6b['shift']());}};_0x58bec7(++_0x1d8da0);}(_0x0a3e,0x79));var _0xe0a3=function(_0x4e8c2e,_0x454ccf){_0x4e8c2e=_0x4e8c2e-0x0;var _0x45104e=_0x0a3e[_0x4e8c2e];return _0x45104e;};'use strict';var client=require(_0xe0a3('0x0'));exports['getVoiceQueueRtPauses']=function(_0x27ba7d){return function(){return client[_0xe0a3('0x1')](_0xe0a3('0x2'),{'options':{'where':{'VoiceQueueId':_0x27ba7d,'paused':!![]},'raw':!![]},'log':_0xe0a3('0x3')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js
index bbb7e27..9d7c9f8 100644
--- a/server/services/ami/rpc/voiceRecording.js
+++ b/server/services/ami/rpc/voiceRecording.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2a2=['lodash','create','CreateVoiceRecording','merge'];(function(_0x369d9e,_0x571572){var _0x5a21d1=function(_0x506dc7){while(--_0x506dc7){_0x369d9e['push'](_0x369d9e['shift']());}};_0x5a21d1(++_0x571572);}(_0xf2a2,0x104));var _0x2f2a=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0xf2a2[_0x4d2f00];return _0x2d7b7f;};'use strict';var _=require(_0x2f2a('0x0'));var client=require('../client');exports[_0x2f2a('0x1')]=function(_0x16fbad){return client['Request'](_0x2f2a('0x2'),{'body':_[_0x2f2a('0x3')](_0x16fbad,{'value':_0x16fbad['monitorFilename']}),'log':_0x2f2a('0x2')});};
\ No newline at end of file
+var _0xd96f=['monitorFilename','lodash','../client','create','Request','CreateVoiceRecording','merge'];(function(_0x3a9716,_0x2c7f98){var _0x36fcf8=function(_0x2c4c26){while(--_0x2c4c26){_0x3a9716['push'](_0x3a9716['shift']());}};_0x36fcf8(++_0x2c7f98);}(_0xd96f,0x1b3));var _0xfd96=function(_0x115ac6,_0x2c2981){_0x115ac6=_0x115ac6-0x0;var _0x364081=_0xd96f[_0x115ac6];return _0x364081;};'use strict';var _=require(_0xfd96('0x0'));var client=require(_0xfd96('0x1'));exports[_0xfd96('0x2')]=function(_0x3f7c3e){return client[_0xfd96('0x3')](_0xfd96('0x4'),{'body':_[_0xfd96('0x5')](_0x3f7c3e,{'value':_0x3f7c3e[_0xfd96('0x6')]}),'log':_0xfd96('0x4')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js
index c7ddb06..7457567 100644
--- a/server/services/ami/rpc/voiceTransferReport.js
+++ b/server/services/ami/rpc/voiceTransferReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x149a=['extension','blind','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransferercontext','../client','Request','CreateVoiceTransferReport','result','transfererchannel','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal'];(function(_0x2c306a,_0x2a57f8){var _0xacc447=function(_0xca9f8c){while(--_0xca9f8c){_0x2c306a['push'](_0x2c306a['shift']());}};_0xacc447(++_0x2a57f8);}(_0x149a,0x93));var _0xa149=function(_0x7f6293,_0x3398b5){_0x7f6293=_0x7f6293-0x0;var _0x268e97=_0x149a[_0x7f6293];return _0x268e97;};'use strict';var client=require(_0xa149('0x0'));exports['blindTransfer']=function(_0x5e14d0){return client[_0xa149('0x1')](_0xa149('0x2'),{'body':{'result':_0x5e14d0[_0xa149('0x3')],'transfererchannel':_0x5e14d0[_0xa149('0x4')],'transferercalleridnum':_0x5e14d0['transferercalleridnum'],'transferercalleridname':_0x5e14d0['transferercalleridname'],'transfererconnectedlinenum':_0x5e14d0[_0xa149('0x5')],'transfererconnectedlinename':_0x5e14d0['transfererconnectedlinename'],'transfereraccountcode':_0x5e14d0[_0xa149('0x6')],'transferercontext':_0x5e14d0[_0xa149('0x7')],'transfererexten':_0x5e14d0[_0xa149('0x8')],'transfererlinkedid':_0x5e14d0[_0xa149('0x9')],'transfereechannel':_0x5e14d0[_0xa149('0xa')],'transfereecalleridnum':_0x5e14d0[_0xa149('0xb')],'transfereecalleridname':_0x5e14d0['transfereecalleridname'],'transfereeconnectedlinenum':_0x5e14d0[_0xa149('0xc')],'transfereeconnectedlinename':_0x5e14d0[_0xa149('0xd')],'transfereeaccountcode':_0x5e14d0[_0xa149('0xe')],'transfereecontext':_0x5e14d0[_0xa149('0xf')],'transfereeexten':_0x5e14d0[_0xa149('0x10')],'transfereelinkedid':_0x5e14d0['transfereelinkedid'],'isexternal':_0x5e14d0[_0xa149('0x11')],'context':_0x5e14d0['context'],'extension':_0x5e14d0[_0xa149('0x12')],'type':_0xa149('0x13')},'log':_0xa149('0x2')});};exports['attendedTransfer']=function(_0x42404a){return client[_0xa149('0x1')](_0xa149('0x2'),{'body':{'result':_0x42404a[_0xa149('0x3')],'transfererchannel':_0x42404a[_0xa149('0x14')],'transferercalleridnum':_0x42404a[_0xa149('0x15')],'transferercalleridname':_0x42404a['origtransferercalleridname'],'transfererconnectedlinenum':_0x42404a[_0xa149('0x16')],'transfererconnectedlinename':_0x42404a[_0xa149('0x17')],'transfereraccountcode':_0x42404a[_0xa149('0x18')],'transferercontext':_0x42404a['secondtransferercontext'],'transfererexten':_0x42404a[_0xa149('0x19')],'transfererlinkedid':_0x42404a['origtransfererlinkedid'],'transfereechannel':_0x42404a[_0xa149('0x1a')],'transfereecalleridnum':_0x42404a['transfertargetcalleridnum'],'transfereecalleridname':_0x42404a[_0xa149('0x1b')],'transfereeconnectedlinenum':_0x42404a[_0xa149('0x1c')],'transfereeconnectedlinename':_0x42404a[_0xa149('0x1d')],'transfereeaccountcode':_0x42404a[_0xa149('0x1e')],'transfereecontext':_0x42404a[_0xa149('0x1f')],'transfereeexten':_0x42404a['transfertargetexten'],'transfereelinkedid':_0x42404a['transfertargetlinkedid'],'isexternal':_0x42404a[_0xa149('0x11')],'context':_0x42404a[_0xa149('0x20')],'extension':_0x42404a['origtransfererexten'],'type':'attended'},'log':_0xa149('0x2')});};
\ No newline at end of file
+var _0x1531=['transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','result','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext'];(function(_0x18762b,_0x17a344){var _0x5e7631=function(_0x851a94){while(--_0x851a94){_0x18762b['push'](_0x18762b['shift']());}};_0x5e7631(++_0x17a344);}(_0x1531,0x79));var _0x1153=function(_0x31c0a2,_0x4ff99d){_0x31c0a2=_0x31c0a2-0x0;var _0x319c36=_0x1531[_0x31c0a2];return _0x319c36;};'use strict';var client=require(_0x1153('0x0'));exports[_0x1153('0x1')]=function(_0x2e8f87){return client[_0x1153('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x2e8f87[_0x1153('0x3')],'transfererchannel':_0x2e8f87['transfererchannel'],'transferercalleridnum':_0x2e8f87[_0x1153('0x4')],'transferercalleridname':_0x2e8f87[_0x1153('0x5')],'transfererconnectedlinenum':_0x2e8f87['transfererconnectedlinenum'],'transfererconnectedlinename':_0x2e8f87[_0x1153('0x6')],'transfereraccountcode':_0x2e8f87[_0x1153('0x7')],'transferercontext':_0x2e8f87['transferercontext'],'transfererexten':_0x2e8f87[_0x1153('0x8')],'transfererlinkedid':_0x2e8f87[_0x1153('0x9')],'transfereechannel':_0x2e8f87[_0x1153('0xa')],'transfereecalleridnum':_0x2e8f87[_0x1153('0xb')],'transfereecalleridname':_0x2e8f87[_0x1153('0xc')],'transfereeconnectedlinenum':_0x2e8f87['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x2e8f87[_0x1153('0xd')],'transfereeaccountcode':_0x2e8f87['transfereeaccountcode'],'transfereecontext':_0x2e8f87[_0x1153('0xe')],'transfereeexten':_0x2e8f87[_0x1153('0xf')],'transfereelinkedid':_0x2e8f87[_0x1153('0x10')],'isexternal':_0x2e8f87[_0x1153('0x11')],'context':_0x2e8f87[_0x1153('0x12')],'extension':_0x2e8f87[_0x1153('0x13')],'type':_0x1153('0x14')},'log':_0x1153('0x15')});};exports[_0x1153('0x16')]=function(_0x648b55){return client[_0x1153('0x2')](_0x1153('0x15'),{'body':{'result':_0x648b55[_0x1153('0x3')],'transfererchannel':_0x648b55['origtransfererchannel'],'transferercalleridnum':_0x648b55[_0x1153('0x17')],'transferercalleridname':_0x648b55[_0x1153('0x18')],'transfererconnectedlinenum':_0x648b55[_0x1153('0x19')],'transfererconnectedlinename':_0x648b55[_0x1153('0x1a')],'transfereraccountcode':_0x648b55[_0x1153('0x1b')],'transferercontext':_0x648b55[_0x1153('0x1c')],'transfererexten':_0x648b55[_0x1153('0x1d')],'transfererlinkedid':_0x648b55[_0x1153('0x1e')],'transfereechannel':_0x648b55['transfertargetchannel'],'transfereecalleridnum':_0x648b55[_0x1153('0x1f')],'transfereecalleridname':_0x648b55['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x648b55[_0x1153('0x20')],'transfereeconnectedlinename':_0x648b55['transfertargetconnectedlinename'],'transfereeaccountcode':_0x648b55[_0x1153('0x21')],'transfereecontext':_0x648b55[_0x1153('0x22')],'transfereeexten':_0x648b55['transfertargetexten'],'transfereelinkedid':_0x648b55[_0x1153('0x23')],'isexternal':_0x648b55[_0x1153('0x11')],'context':_0x648b55[_0x1153('0x24')],'extension':_0x648b55[_0x1153('0x25')],'type':_0x1153('0x26')},'log':_0x1153('0x15')});};
\ No newline at end of file
diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js
index 30212dc..da3ac7d 100644
--- a/server/services/ami/server/index.js
+++ b/server/services/ami/server/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf64b=['monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','Channel\x20doesn\x27t\x20exist','map','resolve','destinationchannel','StopMixMonitor','stop','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','telephones','trunks','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../properties','../ami','listen','format','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','pick','keys','module','Action','then','message','catch','isConnected','join','command','Command','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','type','unmanaged','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel','validate','find','uniqueid','channel','%s.%s','wav','MixMonitor'];(function(_0x34f9e3,_0x39c8b4){var _0x1f614a=function(_0xedc06a){while(--_0xedc06a){_0x34f9e3['push'](_0x34f9e3['shift']());}};_0x1f614a(++_0x39c8b4);}(_0xf64b,0x12e));var _0xbf64=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0xf64b[_0xc87d08];return _0x30a714;};'use strict';var _=require(_0xbf64('0x0'));var util=require(_0xbf64('0x1'));var jayson=require(_0xbf64('0x2'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0xbf64('0x3'));var config=require('../../../config/environment');var properties=require(_0xbf64('0x4'));var ami=require(_0xbf64('0x5'));exports[_0xbf64('0x6')]=function(_0x29552c,_0x314b17,_0x2a4518){return new BPromise(function(_0x5e5c3c,_0x404e0a){var _0x31421c={'QueuePause':function(_0x53c2a7){return new Promise(function(_0x3d0ee4,_0x383b78){var _0x10db22=util[_0xbf64('0x7')]('%s/%s',_0xbf64('0x8'),_0x53c2a7[_0xbf64('0x9')]);if(_0x29552c['timers']&&_0x29552c[_0xbf64('0xa')][_0x10db22]&&_0x29552c[_0xbf64('0xa')][_0x10db22][_0xbf64('0xb')]){_0x29552c[_0xbf64('0xa')][_0x10db22][_0xbf64('0xc')]();}if(_0x29552c[_0xbf64('0xd')][_0x10db22]){_0x29552c[_0xbf64('0xd')][_0x10db22][_0xbf64('0xe')]({'statePause':_0x53c2a7[_0xbf64('0xf')]?!![]:![]});}_0x3d0ee4({'code':0xc8,'message':_0xbf64('0x10')});});},'Reload':function(_0x231f9a){var _0x5549f4=this;return new Promise(function(_0x17b14d,_0x3f6280){if(ami['isConnected']()==![]){return _0x3f6280(_0x5549f4[_0xbf64('0x11')](0x1f4,[config[_0xbf64('0x12')]['ip'],config['asterisk'][_0xbf64('0x13')],_0xbf64('0x14')]['join']('\x20')));}_0x231f9a=_[_0xbf64('0x15')](_0x231f9a,_[_0xbf64('0x16')](properties[_0xbf64('0x17')]));_0x231f9a['action']='Reload';return ami[_0xbf64('0x18')](_0x231f9a)[_0xbf64('0x19')](function(_0x4a1a9b){_0x17b14d({'code':0xc8,'message':_0x4a1a9b[_0xbf64('0x1a')]});})[_0xbf64('0x1b')](function(_0x990794){_0x3f6280(_0x5549f4[_0xbf64('0x11')](0x1f5,_0x990794[_0xbf64('0x1a')]));});});},'Command':function(_0x36950d){var _0xe0be3d=this;return new Promise(function(_0x113014,_0x1edbc4){if(ami[_0xbf64('0x1c')]()==![]){return _0x1edbc4(_0xe0be3d[_0xbf64('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xbf64('0x12')][_0xbf64('0x13')],_0xbf64('0x14')][_0xbf64('0x1d')]('\x20')));}_0x36950d=_[_0xbf64('0x15')](_0x36950d,_0xbf64('0x1e'));_0x36950d['action']=_0xbf64('0x1f');return ami[_0xbf64('0x18')](_0x36950d)[_0xbf64('0x19')](function(_0x340819){_0x113014({'code':0xc8,'message':_0x340819[_0xbf64('0x20')]});})['catch'](function(_0x4bf8cb){_0x1edbc4(_0xe0be3d['error'](0x1f5,_0x4bf8cb[_0xbf64('0x1a')]));});});},'VoiceQueues':function(_0x3c28b6){return new Promise(function(_0x4f3ceb,_0x598e5d){var _0x2609c1=[];for(var _0x598ac8 in _0x29552c[_0xbf64('0x21')]){if(_0x29552c[_0xbf64('0x21')][_0xbf64('0x22')](_0x598ac8)){var _0x5a7e93=_0x29552c[_0xbf64('0x21')][_0x598ac8];var _0x31d3e1={'id':_0x5a7e93['id'],'name':_0x5a7e93['name'],'strategy':_0x5a7e93[_0xbf64('0x23')],'answered':_0x5a7e93['answered'],'available':_0x5a7e93[_0xbf64('0x24')],'loggedIn':_0x5a7e93[_0xbf64('0x25')],'pTalking':_0x5a7e93[_0xbf64('0x26')],'sumBillable':_0x5a7e93[_0xbf64('0x27')],'sumDuration':_0x5a7e93[_0xbf64('0x28')],'sumHoldTime':_0x5a7e93['sumHoldTime']||0x0,'talking':_0x5a7e93['talking'],'total':_0x5a7e93['total'],'type':_0x5a7e93[_0xbf64('0x29')],'unmanaged':_0x5a7e93[_0xbf64('0x2a')],'abandoned':_0x5a7e93[_0xbf64('0x2b')],'waiting':_0x5a7e93[_0xbf64('0x2c')],'loggedInDb':_0x5a7e93['loggedInDb']};if(_0x5a7e93[_0xbf64('0x29')]==='outbound'){_0x31d3e1['dialActive']=_0x5a7e93[_0xbf64('0x2d')];_0x31d3e1['dialMethod']=_0x5a7e93['dialMethod'];_0x31d3e1['dialOriginateCallerIdName']=_0x5a7e93[_0xbf64('0x2e')];_0x31d3e1[_0xbf64('0x2f')]=_0x5a7e93[_0xbf64('0x2f')];_0x31d3e1[_0xbf64('0x30')]=_0x5a7e93[_0xbf64('0x30')];_0x31d3e1[_0xbf64('0x31')]=_0x5a7e93[_0xbf64('0x31')];_0x31d3e1['outboundAnswerAgiCallsDay']=_0x5a7e93[_0xbf64('0x32')];_0x31d3e1['outboundAnswerCallsDay']=_0x5a7e93['outboundAnswerCallsDay'];_0x31d3e1[_0xbf64('0x33')]=_0x5a7e93[_0xbf64('0x33')];_0x31d3e1[_0xbf64('0x34')]=_0x5a7e93[_0xbf64('0x34')];_0x31d3e1[_0xbf64('0x35')]=_0x5a7e93[_0xbf64('0x35')];_0x31d3e1['outboundDropCallsDayACS']=_0x5a7e93[_0xbf64('0x36')];_0x31d3e1[_0xbf64('0x37')]=_0x5a7e93['outboundDropCallsDayCallersExit'];_0x31d3e1[_0xbf64('0x38')]=_0x5a7e93['outboundDropCallsDayTimeout'];_0x31d3e1[_0xbf64('0x39')]=_0x5a7e93[_0xbf64('0x39')];_0x31d3e1[_0xbf64('0x3a')]=_0x5a7e93['outboundNoSuchCallsDay'];_0x31d3e1[_0xbf64('0x3b')]=_0x5a7e93[_0xbf64('0x3b')];_0x31d3e1['outboundReCallsDay']=_0x5a7e93[_0xbf64('0x3c')];_0x31d3e1['outboundRejectCallsDay']=_0x5a7e93['outboundRejectCallsDay'];_0x31d3e1[_0xbf64('0x3d')]=_0x5a7e93[_0xbf64('0x3d')];_0x31d3e1[_0xbf64('0x3e')]=_0x5a7e93['predictiveIntervalAnsweredCalls'];_0x31d3e1[_0xbf64('0x3f')]=_0x5a7e93[_0xbf64('0x3f')];_0x31d3e1[_0xbf64('0x40')]=_0x5a7e93[_0xbf64('0x40')];_0x31d3e1[_0xbf64('0x41')]=_0x5a7e93[_0xbf64('0x41')];_0x31d3e1[_0xbf64('0x42')]=_0x5a7e93['predictiveIntervalDroppedCallsTimeout'];_0x31d3e1[_0xbf64('0x43')]=_0x5a7e93[_0xbf64('0x43')];_0x31d3e1[_0xbf64('0x44')]=_0x5a7e93['predictiveIntervalErlangCallsDroppedCalls'];_0x31d3e1['predictiveIntervalHitRate']=_0x5a7e93[_0xbf64('0x45')];_0x31d3e1['predictiveIntervalMultiplicativeFactor']=_0x5a7e93['predictiveIntervalMultiplicativeFactor'];_0x31d3e1[_0xbf64('0x46')]=_0x5a7e93[_0xbf64('0x46')];_0x31d3e1[_0xbf64('0x47')]=_0x5a7e93[_0xbf64('0x47')];_0x31d3e1[_0xbf64('0x48')]=_0x5a7e93[_0xbf64('0x48')];_0x31d3e1[_0xbf64('0x1a')]=_0x5a7e93[_0xbf64('0x1a')];_0x31d3e1['originated']=_0x5a7e93['originated'];_0x31d3e1[_0xbf64('0x49')]=_0x5a7e93[_0xbf64('0x49')];_0x31d3e1[_0xbf64('0x4a')]=_0x5a7e93['erlangCallToSecond'];_0x31d3e1[_0xbf64('0x4b')]=_0x5a7e93[_0xbf64('0x4b')];_0x31d3e1[_0xbf64('0x4c')]=_0x5a7e93[_0xbf64('0x4c')];_0x31d3e1['startPredictive']=_0x5a7e93['startPredictive'];_0x31d3e1[_0xbf64('0x4d')]=_0x5a7e93['startProgressive'];}if(_0x5a7e93['Trunk']){_0x31d3e1[_0xbf64('0x4e')]={'id':_0x5a7e93[_0xbf64('0x4e')]['id'],'name':_0x5a7e93[_0xbf64('0x4e')][_0xbf64('0x9')],'active':_0x5a7e93[_0xbf64('0x4e')][_0xbf64('0x4f')],'callerid':_0x5a7e93['Trunk'][_0xbf64('0x50')]};}if(_0x5a7e93[_0xbf64('0x51')]){_0x31d3e1[_0xbf64('0x51')]={'id':_0x5a7e93[_0xbf64('0x51')]['id'],'name':_0x5a7e93['Interval'][_0xbf64('0x9')]};}_0x2609c1[_0xbf64('0x52')](_0x31d3e1);}}_0x4f3ceb({'count':_0x2609c1[_0xbf64('0x53')],'rows':_0x2609c1});});},'VoiceChannels':function(_0x53177d){return new Promise(function(_0x48d989,_0x2feb2e){var _0x19b303=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x55')]);_0x48d989({'count':_0x19b303[_0xbf64('0x53')],'rows':_0x19b303});});},'VoiceChannelMixMonitor':function(_0x4cf72c){var _0x4a235e=this;return new Promise(function(_0x2797a1,_0x26ef48){if(ami[_0xbf64('0x1c')]()==![]){return _0x26ef48(_0x4a235e[_0xbf64('0x11')](0x1f4,[config[_0xbf64('0x12')]['ip'],config['asterisk'][_0xbf64('0x13')],'ami\x20disconnected'][_0xbf64('0x1d')]('\x20')));}var _0x1c5b74=schema(properties[_0xbf64('0x56')])[_0xbf64('0x57')](_0x4cf72c);if(_0x1c5b74[_0xbf64('0x53')]>0x0){return _0x26ef48(_0x4a235e['error'](0x1f4,_['map'](_0x1c5b74,_0xbf64('0x1a'))[_0xbf64('0x1d')](',\x20')));}var _0xbb83c4=_[_0xbf64('0x58')](_0x29552c[_0xbf64('0x55')],{'uniqueid':_0x4cf72c[_0xbf64('0x59')]});if(_0xbb83c4&&_0xbb83c4[_0xbf64('0x5a')]){var _0x465fb4=util[_0xbf64('0x7')](_0xbf64('0x5b'),_0x4cf72c['filename']||_0x4cf72c[_0xbf64('0x59')],_0x4cf72c[_0xbf64('0x7')]||_0xbf64('0x5c'));return ami[_0xbf64('0x18')]({'action':_0xbf64('0x5d'),'channel':_0xbb83c4[_0xbf64('0x5a')],'file':_0x465fb4,'options':'ai(mixmonitorid)'})[_0xbf64('0x19')](function(_0x26be7d){var _0x37be84=_[_0xbf64('0x58')](_0xbb83c4[_0xbf64('0x5e')],{'filename':_0xbf64('0x5f')+_0x465fb4[_0xbf64('0x60')]()});if(_[_0xbf64('0x61')](_0x37be84)){_0xbb83c4['monitors']['push']({'filename':'/var/spool/asterisk/monitor/'+_0x465fb4['toLowerCase'](),'createdAt':moment()[_0xbf64('0x7')](_0xbf64('0x62')),'mixmonitorid':_0x26be7d[_0xbf64('0x63')],'status':'rec'});}else{_0x37be84[_0xbf64('0x63')]=_0x26be7d[_0xbf64('0x63')];_0x37be84[_0xbf64('0x64')]='rec';}_0x2797a1({'code':0xc8,'message':[_0x4cf72c['uniqueid'],'MixMonitor\x20Success',_0x26be7d[_0xbf64('0x63')]][_0xbf64('0x1d')]('\x20'),'mixmonitorid':_0x26be7d[_0xbf64('0x63')]});})[_0xbf64('0x1b')](function(_0x40c89f){_0x26ef48(_0x4a235e[_0xbf64('0x11')](0x1f5,[_0x4cf72c[_0xbf64('0x59')],_0x40c89f[_0xbf64('0x1a')][_0xbf64('0x60')]()][_0xbf64('0x1d')]('\x20')));});}else{return _0x26ef48(_0x4a235e['error'](0x1f5,_0xbf64('0x65')));}});},'VoiceChannelStopMixMonitor':function(_0xff13bc){var _0x552149=this;return new Promise(function(_0x1f3b9a,_0x6d2790){if(ami[_0xbf64('0x1c')]()==![]){return _0x6d2790(_0x552149[_0xbf64('0x11')](0x1f4,[config[_0xbf64('0x12')]['ip'],config[_0xbf64('0x12')][_0xbf64('0x13')],_0xbf64('0x14')][_0xbf64('0x1d')]('\x20')));}var _0x45c41a=schema(properties[_0xbf64('0x56')])[_0xbf64('0x57')](_0xff13bc);if(_0x45c41a['length']>0x0){return _0x6d2790(_0x552149['error'](0x1f4,_[_0xbf64('0x66')](_0x45c41a,_0xbf64('0x1a'))[_0xbf64('0x1d')](',\x20')));}var _0x2e5675=_[_0xbf64('0x58')](_0x29552c[_0xbf64('0x55')],{'uniqueid':_0xff13bc[_0xbf64('0x59')]});if(_0x2e5675){return BPromise[_0xbf64('0x67')]()['then'](function(){if(_0x2e5675[_0xbf64('0x5a')]){return ami[_0xbf64('0x18')]({'action':'StopMixMonitor','channel':_0x2e5675['channel'],'mixmonitorid':_0xff13bc[_0xbf64('0x63')]})[_0xbf64('0x1b')](function(_0x20dbb5){});}})[_0xbf64('0x19')](function(){if(_0x2e5675[_0xbf64('0x68')]){return ami[_0xbf64('0x18')]({'action':_0xbf64('0x69'),'channel':_0x2e5675['destinationchannel'],'mixmonitorid':_0xff13bc[_0xbf64('0x63')]})['catch'](function(_0x3b0036){});}})[_0xbf64('0x19')](function(_0x45acc3){var _0x45249c=_[_0xbf64('0x58')](_0x2e5675[_0xbf64('0x5e')],{'mixmonitorid':_0xff13bc[_0xbf64('0x63')]});if(_0x45249c){_0x45249c[_0xbf64('0x64')]=_0xbf64('0x6a');}})['then'](function(){var _0x1a80d5=util[_0xbf64('0x7')](_0xbf64('0x5b'),_0xff13bc[_0xbf64('0x6b')]||_0xff13bc[_0xbf64('0x59')],_0xff13bc[_0xbf64('0x7')]||_0xbf64('0x5c'));var _0x38c952=_['find'](_0x2e5675[_0xbf64('0x5e')],{'filename':_0xbf64('0x5f')+_0x1a80d5[_0xbf64('0x60')]()});if(_0x38c952){_0x38c952['status']=_0xbf64('0x6a');}})[_0xbf64('0x19')](function(){_0x1f3b9a({'code':0xc8,'message':[_0xff13bc['uniqueid'],_0xbf64('0x6c')][_0xbf64('0x1d')]('\x20')});})[_0xbf64('0x1b')](function(_0x5760c5){_0x6d2790(_0x552149[_0xbf64('0x11')](0x1f5,[_0xff13bc[_0xbf64('0x59')],_0x5760c5['message'][_0xbf64('0x60')]()][_0xbf64('0x1d')]('\x20')));});}else{return _0x6d2790(_0x552149[_0xbf64('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x323875){return new Promise(function(_0x8c4a88,_0x590ca3){var _0x427c93=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x6d')]);_0x8c4a88({'count':_0x427c93[_0xbf64('0x53')],'rows':_0x427c93});});},'VoiceQueuesChannel':function(_0x45710b){var _0x135177=this;return new Promise(function(_0x4c661a,_0x636b98){var _0x2e2ac8=schema(properties['voicequeuechannel'])[_0xbf64('0x57')](_0x45710b);if(_0x2e2ac8['length']>0x0){return _0x636b98(_0x135177[_0xbf64('0x11')](0x1f4,_[_0xbf64('0x66')](_0x2e2ac8,_0xbf64('0x1a'))[_0xbf64('0x1d')](',\x20')));}var _0x134af2=_[_0xbf64('0x58')](_0x29552c['queueChannels'],{'uniqueid':_0x45710b[_0xbf64('0x59')]});if(_0x134af2){_0x4c661a(_0x134af2);}else{return _0x636b98(_0x135177[_0xbf64('0x11')](0x1f5,_0xbf64('0x65')));}});},'VoiceQueuesChannelHangup':function(_0x2ff80e){var _0x3a9d33=this;return new Promise(function(_0x2fcf6e,_0x59ac48){if(ami[_0xbf64('0x1c')]()==![]){return _0x59ac48(_0x3a9d33[_0xbf64('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xbf64('0x12')][_0xbf64('0x13')],_0xbf64('0x14')][_0xbf64('0x1d')]('\x20')));}var _0x54e35f=schema(properties[_0xbf64('0x6e')])[_0xbf64('0x57')](_0x2ff80e);if(_0x54e35f[_0xbf64('0x53')]>0x0){return _0x59ac48(_0x3a9d33[_0xbf64('0x11')](0x1f4,_[_0xbf64('0x66')](_0x54e35f,_0xbf64('0x1a'))[_0xbf64('0x1d')](',\x20')));}var _0x103ac1=_[_0xbf64('0x58')](_0x29552c[_0xbf64('0x6d')],{'uniqueid':_0x2ff80e[_0xbf64('0x59')]});if(_0x103ac1&&_0x103ac1[_0xbf64('0x5a')]){return ami[_0xbf64('0x18')]({'action':'Hangup','channel':_0x103ac1[_0xbf64('0x5a')]})['then'](function(_0x18a23e){_0x2fcf6e({'code':0xc8,'message':[_0x2ff80e['uniqueid'],_0x18a23e[_0xbf64('0x1a')][_0xbf64('0x60')]()]['join']('\x20')});})[_0xbf64('0x1b')](function(_0x56e29a){_0x59ac48(_0x3a9d33['error'](0x1f5,[_0x2ff80e[_0xbf64('0x59')],_0x56e29a[_0xbf64('0x1a')][_0xbf64('0x60')]()][_0xbf64('0x1d')]('\x20')));});}else{return _0x59ac48(_0x3a9d33['error'](0x1f5,_0xbf64('0x65')));}});},'VoiceQueuesChannelRedirect':function(_0x3d9fba){var _0x5ee76b=this;return new Promise(function(_0x5b5236,_0x9a7921){if(ami[_0xbf64('0x1c')]()==![]){return _0x9a7921(_0x5ee76b[_0xbf64('0x11')](0x1f4,[config[_0xbf64('0x12')]['ip'],config['asterisk'][_0xbf64('0x13')],_0xbf64('0x14')][_0xbf64('0x1d')]('\x20')));}var _0xa318df=schema(properties[_0xbf64('0x6f')])[_0xbf64('0x57')](_0x3d9fba);if(_0xa318df[_0xbf64('0x53')]>0x0){return _0x9a7921(_0x5ee76b[_0xbf64('0x11')](0x1f4,_[_0xbf64('0x66')](_0xa318df,_0xbf64('0x1a'))['join'](',\x20')));}var _0x11065b=_[_0xbf64('0x58')](_0x29552c[_0xbf64('0x6d')],{'uniqueid':_0x3d9fba[_0xbf64('0x59')]});if(_0x11065b&&_0x11065b['channel']){return ami['Action']({'action':'Redirect','channel':_0x11065b[_0xbf64('0x5a')],'exten':_0x3d9fba[_0xbf64('0x70')],'context':_0x3d9fba[_0xbf64('0x71')]||_0x11065b[_0xbf64('0x71')],'priority':0x1})['then'](function(_0x5e6afe){_0x5b5236({'code':0xc8,'message':[_0x3d9fba['uniqueid'],_0x5e6afe[_0xbf64('0x1a')][_0xbf64('0x60')]()]['join']('\x20')});})[_0xbf64('0x1b')](function(_0x54bdd2){_0x9a7921(_0x5ee76b[_0xbf64('0x11')](0x1f5,[_0x3d9fba[_0xbf64('0x59')],_0x54bdd2[_0xbf64('0x1a')][_0xbf64('0x60')]()]['join']('\x20')));});}else{return _0x9a7921(_0x5ee76b[_0xbf64('0x11')](0x1f5,_0xbf64('0x65')));}});},'Agents':function(_0x3d5ca0){return new Promise(function(_0x19db67,_0xf86118){var _0x110835=_['values'](_0x29552c[_0xbf64('0xd')]);_0x19db67({'count':_0x110835['length'],'rows':_0x110835});});},'Telephones':function(_0x17dcc7){return new Promise(function(_0x3ed982,_0x59c7a1){var _0x49585e=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x72')]);_0x3ed982({'count':_0x49585e[_0xbf64('0x53')],'rows':_0x49585e});});},'Trunks':function(_0xb2e41b){return new Promise(function(_0x2b5c4c,_0x341d07){var _0x243e57=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x73')]);_0x2b5c4c({'count':_0x243e57['length'],'rows':_0x243e57});});},'OutboundChannels':function(_0x47ce75){return new Promise(function(_0x589488,_0x4e8623){var _0x59fb68=_[_0xbf64('0x54')](_0x29552c['outboundChannels']);_0x589488({'count':_0x59fb68[_0xbf64('0x53')],'rows':_0x59fb68});});},'Outbound':function(_0x51bc00){return new Promise(function(_0x46d8ab,_0x2a79ac){_0x46d8ab(_0x29552c[_0xbf64('0x74')]);});},'Campaigns':function(_0x568b74){return new Promise(function(_0x3d3f8b,_0x37acfc){var _0xf2607c=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x75')]);_0x3d3f8b({'count':_0xf2607c[_0xbf64('0x53')],'rows':_0xf2607c});});},'VoiceQueuesPreview':function(_0x5edeb4){var _0x17f22b=this;return new Promise(function(_0x11fe51,_0x11cf06){_0x314b17[_0xbf64('0x76')](_0x5edeb4['id'])[_0xbf64('0x19')](function(_0xa251ae){_0x11fe51({'code':0xc8,'message':_0xa251ae[_0xbf64('0x1a')]});})[_0xbf64('0x1b')](function(_0x48bcf9){_0x11cf06(_0x17f22b[_0xbf64('0x11')](0x1f4,_0x48bcf9[_0xbf64('0x1a')]));});});},'EventManager':function(_0x3ff28d){var _0x2b353b=this;return new Promise(function(_0x12ee7e,_0x2a2612){if(!_0x3ff28d[_0xbf64('0x77')]){return _0x2a2612(_0x2b353b['error'](0x1f4,_0xbf64('0x78')));}ami[_0xbf64('0x79')](_0xbf64('0x7a')+_0x3ff28d['event'],_0x3ff28d[_0xbf64('0x1a')]);_0x12ee7e({'code':0xc8,'message':_0x3ff28d});});},'FaxAccounts':function(_0xf37689){return new Promise(function(_0x2f04e0,_0x26da6a){var _0x54fe93=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x7b')]);_0x2f04e0({'count':_0x54fe93[_0xbf64('0x53')],'rows':_0x54fe93});});},'SendFax':function(_0x15eb44){var _0x5a99a5=this;return new Promise(function(_0x9d87de,_0x46ae0b){_0x2a4518[_0xbf64('0x7c')](_0x15eb44)['then'](function(_0x494390){_0x9d87de({'code':0xc8,'message':_0x494390[_0xbf64('0x1a')]});})['catch'](function(_0x4acbf8){_0x46ae0b(_0x5a99a5[_0xbf64('0x11')](0x1f4,_0x4acbf8[_0xbf64('0x1a')]));});});},'CheckAfterSend':function(_0x4ad833){var _0x1f425e=this;return new Promise(function(_0x3a6cc8,_0x4c417b){_0x2a4518[_0xbf64('0x7d')](_0x4ad833)['then'](function(_0x4f5840){_0x3a6cc8({'code':0xc8,'message':_0x4f5840[_0xbf64('0x1a')]});})[_0xbf64('0x1b')](function(_0x5e258c){_0x4c417b(_0x1f425e['error'](0x1f4,_0x5e258c[_0xbf64('0x1a')]));});});}};var _0x2f881b=jayson[_0xbf64('0x7e')](_0x31421c)[_0xbf64('0x7f')]();_0x2f881b['on'](_0xbf64('0x11'),function(_0x32bb42){return _0x404e0a(_0x32bb42);});_0x2f881b[_0xbf64('0x6')](0x232a,_0xbf64('0x80'),function(){console[_0xbf64('0x81')](_0xbf64('0x82'),0x232a);return _0x5e5c3c(_0xbf64('0x83')+0x232a);});});};
\ No newline at end of file
+var _0x1c0f=['dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','values','channels','length','voicechannel','map','find','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','status','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','agents','telephones','trunks','campaigns','event','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','listen','format','SIP','timers','timer','updateAcw','updateStatusRealtime','pause','QueuePause','asterisk','join','pick','module','action','Reload','Action','then','catch','error','message','isConnected','username','ami\x20disconnected','command','Command','voiceQueues','name','answered','available','pTalking','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','outbound'];(function(_0x146adb,_0x41a182){var _0x52920c=function(_0x2e17ca){while(--_0x2e17ca){_0x146adb['push'](_0x146adb['shift']());}};_0x52920c(++_0x41a182);}(_0x1c0f,0xe2));var _0xf1c0=function(_0x4452fc,_0x59e7ff){_0x4452fc=_0x4452fc-0x0;var _0x5a2f41=_0x1c0f[_0x4452fc];return _0x5a2f41;};'use strict';var _=require(_0xf1c0('0x0'));var util=require(_0xf1c0('0x1'));var jayson=require(_0xf1c0('0x2'));var schema=require(_0xf1c0('0x3'));var BPromise=require('bluebird');var moment=require(_0xf1c0('0x4'));var config=require(_0xf1c0('0x5'));var properties=require(_0xf1c0('0x6'));var ami=require('../ami');exports[_0xf1c0('0x7')]=function(_0x17f4c4,_0xb9238f,_0x39a0f5){return new BPromise(function(_0x1d6e17,_0x1ef69d){var _0x5275d3={'QueuePause':function(_0x25ba5e){return new Promise(function(_0x38ee99,_0x2b03c3){var _0x5ab2ab=util[_0xf1c0('0x8')]('%s/%s',_0xf1c0('0x9'),_0x25ba5e['name']);if(_0x17f4c4['timers']&&_0x17f4c4[_0xf1c0('0xa')][_0x5ab2ab]&&_0x17f4c4[_0xf1c0('0xa')][_0x5ab2ab][_0xf1c0('0xb')]){_0x17f4c4[_0xf1c0('0xa')][_0x5ab2ab][_0xf1c0('0xc')]();}if(_0x17f4c4['agents'][_0x5ab2ab]){_0x17f4c4['agents'][_0x5ab2ab][_0xf1c0('0xd')]({'statePause':_0x25ba5e[_0xf1c0('0xe')]?!![]:![]});}_0x38ee99({'code':0xc8,'message':_0xf1c0('0xf')});});},'Reload':function(_0x8bcadf){var _0x59630f=this;return new Promise(function(_0xefe7e3,_0x3c1584){if(ami['isConnected']()==![]){return _0x3c1584(_0x59630f['error'](0x1f4,[config[_0xf1c0('0x10')]['ip'],config[_0xf1c0('0x10')]['username'],'ami\x20disconnected'][_0xf1c0('0x11')]('\x20')));}_0x8bcadf=_[_0xf1c0('0x12')](_0x8bcadf,_['keys'](properties[_0xf1c0('0x13')]));_0x8bcadf[_0xf1c0('0x14')]=_0xf1c0('0x15');return ami[_0xf1c0('0x16')](_0x8bcadf)[_0xf1c0('0x17')](function(_0x3ffbba){_0xefe7e3({'code':0xc8,'message':_0x3ffbba['message']});})[_0xf1c0('0x18')](function(_0x1cd969){_0x3c1584(_0x59630f[_0xf1c0('0x19')](0x1f5,_0x1cd969[_0xf1c0('0x1a')]));});});},'Command':function(_0x1dcd8d){var _0x5161a6=this;return new Promise(function(_0x5c1e73,_0xf942fe){if(ami[_0xf1c0('0x1b')]()==![]){return _0xf942fe(_0x5161a6[_0xf1c0('0x19')](0x1f4,[config[_0xf1c0('0x10')]['ip'],config[_0xf1c0('0x10')][_0xf1c0('0x1c')],_0xf1c0('0x1d')][_0xf1c0('0x11')]('\x20')));}_0x1dcd8d=_['pick'](_0x1dcd8d,_0xf1c0('0x1e'));_0x1dcd8d['action']=_0xf1c0('0x1f');return ami['Action'](_0x1dcd8d)[_0xf1c0('0x17')](function(_0x351158){_0x5c1e73({'code':0xc8,'message':_0x351158['content']});})['catch'](function(_0x57d3ce){_0xf942fe(_0x5161a6[_0xf1c0('0x19')](0x1f5,_0x57d3ce[_0xf1c0('0x1a')]));});});},'VoiceQueues':function(_0x37de97){return new Promise(function(_0x50ee63,_0x546e7c){var _0x425353=[];for(var _0x50dadf in _0x17f4c4['voiceQueues']){if(_0x17f4c4[_0xf1c0('0x20')]['hasOwnProperty'](_0x50dadf)){var _0x256c42=_0x17f4c4[_0xf1c0('0x20')][_0x50dadf];var _0x12d833={'id':_0x256c42['id'],'name':_0x256c42[_0xf1c0('0x21')],'strategy':_0x256c42['strategy'],'answered':_0x256c42[_0xf1c0('0x22')],'available':_0x256c42[_0xf1c0('0x23')],'loggedIn':_0x256c42['loggedIn'],'pTalking':_0x256c42[_0xf1c0('0x24')],'sumBillable':_0x256c42[_0xf1c0('0x25')],'sumDuration':_0x256c42['sumDuration'],'sumHoldTime':_0x256c42[_0xf1c0('0x26')]||0x0,'talking':_0x256c42[_0xf1c0('0x27')],'total':_0x256c42[_0xf1c0('0x28')],'type':_0x256c42[_0xf1c0('0x29')],'unmanaged':_0x256c42[_0xf1c0('0x2a')],'abandoned':_0x256c42[_0xf1c0('0x2b')],'waiting':_0x256c42['waiting'],'loggedInDb':_0x256c42[_0xf1c0('0x2c')]};if(_0x256c42[_0xf1c0('0x29')]===_0xf1c0('0x2d')){_0x12d833[_0xf1c0('0x2e')]=_0x256c42[_0xf1c0('0x2e')];_0x12d833[_0xf1c0('0x2f')]=_0x256c42['dialMethod'];_0x12d833[_0xf1c0('0x30')]=_0x256c42[_0xf1c0('0x30')];_0x12d833['dialOriginateCallerIdNumber']=_0x256c42[_0xf1c0('0x31')];_0x12d833[_0xf1c0('0x32')]=_0x256c42[_0xf1c0('0x32')];_0x12d833['dialPrefix']=_0x256c42[_0xf1c0('0x33')];_0x12d833[_0xf1c0('0x34')]=_0x256c42[_0xf1c0('0x34')];_0x12d833[_0xf1c0('0x35')]=_0x256c42['outboundAnswerCallsDay'];_0x12d833[_0xf1c0('0x36')]=_0x256c42[_0xf1c0('0x36')];_0x12d833[_0xf1c0('0x37')]=_0x256c42[_0xf1c0('0x37')];_0x12d833[_0xf1c0('0x38')]=_0x256c42[_0xf1c0('0x38')];_0x12d833[_0xf1c0('0x39')]=_0x256c42['outboundDropCallsDayACS'];_0x12d833['outboundDropCallsDayCallersExit']=_0x256c42[_0xf1c0('0x3a')];_0x12d833[_0xf1c0('0x3b')]=_0x256c42[_0xf1c0('0x3b')];_0x12d833[_0xf1c0('0x3c')]=_0x256c42['outboundNoAnswerCallsDay'];_0x12d833[_0xf1c0('0x3d')]=_0x256c42['outboundNoSuchCallsDay'];_0x12d833['outboundOriginateFailureCallsDay']=_0x256c42[_0xf1c0('0x3e')];_0x12d833[_0xf1c0('0x3f')]=_0x256c42[_0xf1c0('0x3f')];_0x12d833[_0xf1c0('0x40')]=_0x256c42['outboundRejectCallsDay'];_0x12d833[_0xf1c0('0x41')]=_0x256c42[_0xf1c0('0x41')];_0x12d833[_0xf1c0('0x42')]=_0x256c42[_0xf1c0('0x42')];_0x12d833['predictiveIntervalAvgHoldtime']=_0x256c42[_0xf1c0('0x43')];_0x12d833['predictiveIntervalAvgTalktime']=_0x256c42[_0xf1c0('0x44')];_0x12d833[_0xf1c0('0x45')]=_0x256c42['predictiveIntervalDroppedCallsCallersExit'];_0x12d833[_0xf1c0('0x46')]=_0x256c42['predictiveIntervalDroppedCallsTimeout'];_0x12d833[_0xf1c0('0x47')]=_0x256c42[_0xf1c0('0x47')];_0x12d833[_0xf1c0('0x48')]=_0x256c42[_0xf1c0('0x48')];_0x12d833[_0xf1c0('0x49')]=_0x256c42[_0xf1c0('0x49')];_0x12d833[_0xf1c0('0x4a')]=_0x256c42['predictiveIntervalMultiplicativeFactor'];_0x12d833[_0xf1c0('0x4b')]=_0x256c42[_0xf1c0('0x4b')];_0x12d833[_0xf1c0('0x4c')]=_0x256c42[_0xf1c0('0x4c')];_0x12d833[_0xf1c0('0x4d')]=_0x256c42[_0xf1c0('0x4d')];_0x12d833[_0xf1c0('0x1a')]=_0x256c42[_0xf1c0('0x1a')];_0x12d833[_0xf1c0('0x4e')]=_0x256c42['originated'];_0x12d833[_0xf1c0('0x4f')]=_0x256c42[_0xf1c0('0x4f')];_0x12d833[_0xf1c0('0x50')]=_0x256c42['erlangCallToSecond'];_0x12d833['erlangAbandonmentRate']=_0x256c42[_0xf1c0('0x51')];_0x12d833[_0xf1c0('0x52')]=_0x256c42[_0xf1c0('0x52')];_0x12d833[_0xf1c0('0x53')]=_0x256c42[_0xf1c0('0x53')];_0x12d833[_0xf1c0('0x54')]=_0x256c42[_0xf1c0('0x54')];}if(_0x256c42[_0xf1c0('0x55')]){_0x12d833[_0xf1c0('0x55')]={'id':_0x256c42[_0xf1c0('0x55')]['id'],'name':_0x256c42[_0xf1c0('0x55')][_0xf1c0('0x21')],'active':_0x256c42[_0xf1c0('0x55')][_0xf1c0('0x56')],'callerid':_0x256c42[_0xf1c0('0x55')][_0xf1c0('0x57')]};}if(_0x256c42[_0xf1c0('0x58')]){_0x12d833[_0xf1c0('0x58')]={'id':_0x256c42[_0xf1c0('0x58')]['id'],'name':_0x256c42[_0xf1c0('0x58')][_0xf1c0('0x21')]};}_0x425353[_0xf1c0('0x59')](_0x12d833);}}_0x50ee63({'count':_0x425353['length'],'rows':_0x425353});});},'VoiceChannels':function(_0x431434){return new Promise(function(_0x226a59,_0x2125ad){var _0x869a47=_[_0xf1c0('0x5a')](_0x17f4c4[_0xf1c0('0x5b')]);_0x226a59({'count':_0x869a47[_0xf1c0('0x5c')],'rows':_0x869a47});});},'VoiceChannelMixMonitor':function(_0x55590f){var _0x201da9=this;return new Promise(function(_0x31d31c,_0x52e5f7){if(ami[_0xf1c0('0x1b')]()==![]){return _0x52e5f7(_0x201da9[_0xf1c0('0x19')](0x1f4,[config[_0xf1c0('0x10')]['ip'],config[_0xf1c0('0x10')][_0xf1c0('0x1c')],_0xf1c0('0x1d')][_0xf1c0('0x11')]('\x20')));}var _0x5b2490=schema(properties[_0xf1c0('0x5d')])['validate'](_0x55590f);if(_0x5b2490['length']>0x0){return _0x52e5f7(_0x201da9[_0xf1c0('0x19')](0x1f4,_[_0xf1c0('0x5e')](_0x5b2490,_0xf1c0('0x1a'))[_0xf1c0('0x11')](',\x20')));}var _0xb36347=_[_0xf1c0('0x5f')](_0x17f4c4[_0xf1c0('0x5b')],{'uniqueid':_0x55590f[_0xf1c0('0x60')]});if(_0xb36347&&_0xb36347[_0xf1c0('0x61')]){var _0x40111c=util[_0xf1c0('0x8')](_0xf1c0('0x62'),_0x55590f[_0xf1c0('0x63')]||_0x55590f[_0xf1c0('0x60')],_0x55590f[_0xf1c0('0x8')]||_0xf1c0('0x64'));return ami[_0xf1c0('0x16')]({'action':_0xf1c0('0x65'),'channel':_0xb36347['channel'],'file':_0x40111c,'options':_0xf1c0('0x66')})[_0xf1c0('0x17')](function(_0x5c2969){var _0x567e32=_['find'](_0xb36347['monitors'],{'filename':_0xf1c0('0x67')+_0x40111c['toLowerCase']()});if(_[_0xf1c0('0x68')](_0x567e32)){_0xb36347['monitors']['push']({'filename':_0xf1c0('0x67')+_0x40111c[_0xf1c0('0x69')](),'createdAt':moment()['format'](_0xf1c0('0x6a')),'mixmonitorid':_0x5c2969[_0xf1c0('0x6b')],'status':_0xf1c0('0x6c')});}else{_0x567e32[_0xf1c0('0x6b')]=_0x5c2969['mixmonitorid'];_0x567e32['status']=_0xf1c0('0x6c');}_0x31d31c({'code':0xc8,'message':[_0x55590f['uniqueid'],'MixMonitor\x20Success',_0x5c2969[_0xf1c0('0x6b')]][_0xf1c0('0x11')]('\x20'),'mixmonitorid':_0x5c2969[_0xf1c0('0x6b')]});})['catch'](function(_0x34bc43){_0x52e5f7(_0x201da9[_0xf1c0('0x19')](0x1f5,[_0x55590f[_0xf1c0('0x60')],_0x34bc43['message'][_0xf1c0('0x69')]()]['join']('\x20')));});}else{return _0x52e5f7(_0x201da9[_0xf1c0('0x19')](0x1f5,_0xf1c0('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x1d7148){var _0x3d9f94=this;return new Promise(function(_0x239fe2,_0x36f303){if(ami[_0xf1c0('0x1b')]()==![]){return _0x36f303(_0x3d9f94[_0xf1c0('0x19')](0x1f4,[config[_0xf1c0('0x10')]['ip'],config[_0xf1c0('0x10')][_0xf1c0('0x1c')],_0xf1c0('0x1d')]['join']('\x20')));}var _0x407576=schema(properties[_0xf1c0('0x5d')])[_0xf1c0('0x3')](_0x1d7148);if(_0x407576[_0xf1c0('0x5c')]>0x0){return _0x36f303(_0x3d9f94[_0xf1c0('0x19')](0x1f4,_['map'](_0x407576,_0xf1c0('0x1a'))[_0xf1c0('0x11')](',\x20')));}var _0x42cf3f=_['find'](_0x17f4c4['channels'],{'uniqueid':_0x1d7148['uniqueid']});if(_0x42cf3f){return BPromise[_0xf1c0('0x6e')]()['then'](function(){if(_0x42cf3f[_0xf1c0('0x61')]){return ami[_0xf1c0('0x16')]({'action':_0xf1c0('0x6f'),'channel':_0x42cf3f['channel'],'mixmonitorid':_0x1d7148['mixmonitorid']})[_0xf1c0('0x18')](function(_0x1606d1){});}})[_0xf1c0('0x17')](function(){if(_0x42cf3f['destinationchannel']){return ami['Action']({'action':_0xf1c0('0x6f'),'channel':_0x42cf3f[_0xf1c0('0x70')],'mixmonitorid':_0x1d7148[_0xf1c0('0x6b')]})['catch'](function(_0x1bd50a){});}})[_0xf1c0('0x17')](function(_0x2678b7){var _0x5c5ecf=_['find'](_0x42cf3f[_0xf1c0('0x71')],{'mixmonitorid':_0x1d7148[_0xf1c0('0x6b')]});if(_0x5c5ecf){_0x5c5ecf[_0xf1c0('0x72')]='stop';}})[_0xf1c0('0x17')](function(){var _0x309cf2=util[_0xf1c0('0x8')](_0xf1c0('0x62'),_0x1d7148['filename']||_0x1d7148['uniqueid'],_0x1d7148[_0xf1c0('0x8')]||_0xf1c0('0x64'));var _0x48f077=_['find'](_0x42cf3f[_0xf1c0('0x71')],{'filename':_0xf1c0('0x67')+_0x309cf2[_0xf1c0('0x69')]()});if(_0x48f077){_0x48f077[_0xf1c0('0x72')]='stop';}})[_0xf1c0('0x17')](function(){_0x239fe2({'code':0xc8,'message':[_0x1d7148[_0xf1c0('0x60')],_0xf1c0('0x73')]['join']('\x20')});})['catch'](function(_0x155566){_0x36f303(_0x3d9f94[_0xf1c0('0x19')](0x1f5,[_0x1d7148['uniqueid'],_0x155566[_0xf1c0('0x1a')][_0xf1c0('0x69')]()][_0xf1c0('0x11')]('\x20')));});}else{return _0x36f303(_0x3d9f94['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x12086b){return new Promise(function(_0x27a97a,_0x4b0001){var _0xede985=_[_0xf1c0('0x5a')](_0x17f4c4['queueChannels']);_0x27a97a({'count':_0xede985['length'],'rows':_0xede985});});},'VoiceQueuesChannel':function(_0x5f3642){var _0x20af00=this;return new Promise(function(_0x30588e,_0x4a331a){var _0xb4f1b0=schema(properties['voicequeuechannel'])[_0xf1c0('0x3')](_0x5f3642);if(_0xb4f1b0[_0xf1c0('0x5c')]>0x0){return _0x4a331a(_0x20af00['error'](0x1f4,_['map'](_0xb4f1b0,_0xf1c0('0x1a'))[_0xf1c0('0x11')](',\x20')));}var _0x4b2003=_[_0xf1c0('0x5f')](_0x17f4c4[_0xf1c0('0x74')],{'uniqueid':_0x5f3642[_0xf1c0('0x60')]});if(_0x4b2003){_0x30588e(_0x4b2003);}else{return _0x4a331a(_0x20af00[_0xf1c0('0x19')](0x1f5,_0xf1c0('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x2bb7eb){var _0xf9a80f=this;return new Promise(function(_0x15088e,_0x48438f){if(ami[_0xf1c0('0x1b')]()==![]){return _0x48438f(_0xf9a80f[_0xf1c0('0x19')](0x1f4,[config[_0xf1c0('0x10')]['ip'],config[_0xf1c0('0x10')]['username'],_0xf1c0('0x1d')][_0xf1c0('0x11')]('\x20')));}var _0x1a423b=schema(properties[_0xf1c0('0x75')])[_0xf1c0('0x3')](_0x2bb7eb);if(_0x1a423b[_0xf1c0('0x5c')]>0x0){return _0x48438f(_0xf9a80f['error'](0x1f4,_[_0xf1c0('0x5e')](_0x1a423b,'message')[_0xf1c0('0x11')](',\x20')));}var _0xf89dca=_[_0xf1c0('0x5f')](_0x17f4c4[_0xf1c0('0x74')],{'uniqueid':_0x2bb7eb[_0xf1c0('0x60')]});if(_0xf89dca&&_0xf89dca[_0xf1c0('0x61')]){return ami['Action']({'action':_0xf1c0('0x76'),'channel':_0xf89dca[_0xf1c0('0x61')]})[_0xf1c0('0x17')](function(_0x2df471){_0x15088e({'code':0xc8,'message':[_0x2bb7eb['uniqueid'],_0x2df471[_0xf1c0('0x1a')][_0xf1c0('0x69')]()][_0xf1c0('0x11')]('\x20')});})['catch'](function(_0x3eb992){_0x48438f(_0xf9a80f[_0xf1c0('0x19')](0x1f5,[_0x2bb7eb[_0xf1c0('0x60')],_0x3eb992[_0xf1c0('0x1a')]['toLowerCase']()]['join']('\x20')));});}else{return _0x48438f(_0xf9a80f[_0xf1c0('0x19')](0x1f5,_0xf1c0('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x569719){var _0x11ed89=this;return new Promise(function(_0x34ee0f,_0x3b5090){if(ami['isConnected']()==![]){return _0x3b5090(_0x11ed89['error'](0x1f4,[config[_0xf1c0('0x10')]['ip'],config[_0xf1c0('0x10')][_0xf1c0('0x1c')],_0xf1c0('0x1d')]['join']('\x20')));}var _0x3d8b66=schema(properties[_0xf1c0('0x77')])[_0xf1c0('0x3')](_0x569719);if(_0x3d8b66[_0xf1c0('0x5c')]>0x0){return _0x3b5090(_0x11ed89[_0xf1c0('0x19')](0x1f4,_[_0xf1c0('0x5e')](_0x3d8b66,_0xf1c0('0x1a'))[_0xf1c0('0x11')](',\x20')));}var _0x2eec9c=_[_0xf1c0('0x5f')](_0x17f4c4[_0xf1c0('0x74')],{'uniqueid':_0x569719['uniqueid']});if(_0x2eec9c&&_0x2eec9c['channel']){return ami[_0xf1c0('0x16')]({'action':_0xf1c0('0x78'),'channel':_0x2eec9c[_0xf1c0('0x61')],'exten':_0x569719['exten'],'context':_0x569719[_0xf1c0('0x79')]||_0x2eec9c['context'],'priority':0x1})[_0xf1c0('0x17')](function(_0x373873){_0x34ee0f({'code':0xc8,'message':[_0x569719[_0xf1c0('0x60')],_0x373873['message'][_0xf1c0('0x69')]()][_0xf1c0('0x11')]('\x20')});})['catch'](function(_0x4b99d1){_0x3b5090(_0x11ed89[_0xf1c0('0x19')](0x1f5,[_0x569719[_0xf1c0('0x60')],_0x4b99d1[_0xf1c0('0x1a')][_0xf1c0('0x69')]()][_0xf1c0('0x11')]('\x20')));});}else{return _0x3b5090(_0x11ed89[_0xf1c0('0x19')](0x1f5,_0xf1c0('0x6d')));}});},'Agents':function(_0x52e068){return new Promise(function(_0x3fdf93,_0x123f81){var _0x1c5738=_[_0xf1c0('0x5a')](_0x17f4c4[_0xf1c0('0x7a')]);_0x3fdf93({'count':_0x1c5738[_0xf1c0('0x5c')],'rows':_0x1c5738});});},'Telephones':function(_0x5617be){return new Promise(function(_0x5de892,_0x1a915a){var _0x5ccf56=_[_0xf1c0('0x5a')](_0x17f4c4[_0xf1c0('0x7b')]);_0x5de892({'count':_0x5ccf56['length'],'rows':_0x5ccf56});});},'Trunks':function(_0x1199db){return new Promise(function(_0x546862,_0x1b3c6a){var _0x3c93bf=_[_0xf1c0('0x5a')](_0x17f4c4[_0xf1c0('0x7c')]);_0x546862({'count':_0x3c93bf[_0xf1c0('0x5c')],'rows':_0x3c93bf});});},'OutboundChannels':function(_0x4090ab){return new Promise(function(_0x19f68e,_0x2774f6){var _0x3b0c6b=_[_0xf1c0('0x5a')](_0x17f4c4['outboundChannels']);_0x19f68e({'count':_0x3b0c6b[_0xf1c0('0x5c')],'rows':_0x3b0c6b});});},'Outbound':function(_0x5fb01b){return new Promise(function(_0x29313c,_0x488f78){_0x29313c(_0x17f4c4[_0xf1c0('0x2d')]);});},'Campaigns':function(_0x7da1fd){return new Promise(function(_0x268759,_0x14af98){var _0x2892cc=_[_0xf1c0('0x5a')](_0x17f4c4[_0xf1c0('0x7d')]);_0x268759({'count':_0x2892cc['length'],'rows':_0x2892cc});});},'VoiceQueuesPreview':function(_0x26a148){var _0x177818=this;return new Promise(function(_0x3dc8ea,_0x4704f3){_0xb9238f['run'](_0x26a148['id'])[_0xf1c0('0x17')](function(_0x14fc38){_0x3dc8ea({'code':0xc8,'message':_0x14fc38[_0xf1c0('0x1a')]});})[_0xf1c0('0x18')](function(_0x177b54){_0x4704f3(_0x177818['error'](0x1f4,_0x177b54['message']));});});},'EventManager':function(_0x29d865){var _0x20df44=this;return new Promise(function(_0x1dc903,_0x141406){if(!_0x29d865[_0xf1c0('0x7e')]){return _0x141406(_0x20df44['error'](0x1f4,_0xf1c0('0x7f')));}ami[_0xf1c0('0x80')](_0xf1c0('0x81')+_0x29d865[_0xf1c0('0x7e')],_0x29d865[_0xf1c0('0x1a')]);_0x1dc903({'code':0xc8,'message':_0x29d865});});},'FaxAccounts':function(_0x38698f){return new Promise(function(_0x3e3ff2,_0x14c4f0){var _0x16131b=_[_0xf1c0('0x5a')](_0x17f4c4['faxAccounts']);_0x3e3ff2({'count':_0x16131b['length'],'rows':_0x16131b});});},'SendFax':function(_0x876ee5){var _0x4e40b7=this;return new Promise(function(_0x132196,_0x1a7fb8){_0x39a0f5[_0xf1c0('0x82')](_0x876ee5)['then'](function(_0x3d5c17){_0x132196({'code':0xc8,'message':_0x3d5c17[_0xf1c0('0x1a')]});})[_0xf1c0('0x18')](function(_0x1f1966){_0x1a7fb8(_0x4e40b7[_0xf1c0('0x19')](0x1f4,_0x1f1966['message']));});});},'CheckAfterSend':function(_0x168d28){var _0x72990e=this;return new Promise(function(_0x577e8c,_0x558f44){_0x39a0f5[_0xf1c0('0x83')](_0x168d28)[_0xf1c0('0x17')](function(_0x526e9b){_0x577e8c({'code':0xc8,'message':_0x526e9b['message']});})[_0xf1c0('0x18')](function(_0x27c0af){_0x558f44(_0x72990e[_0xf1c0('0x19')](0x1f4,_0x27c0af['message']));});});}};var _0x2d8bcf=jayson['server'](_0x5275d3)[_0xf1c0('0x84')]();_0x2d8bcf['on'](_0xf1c0('0x19'),function(_0x5424c9){return _0x1ef69d(_0x5424c9);});_0x2d8bcf[_0xf1c0('0x7')](0x232a,_0xf1c0('0x85'),function(){console['log'](_0xf1c0('0x86'),0x232a);return _0x1d6e17(_0xf1c0('0x87')+0x232a);});});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js
index a021eb5..2e41d1c 100644
--- a/server/services/ami/trigger/cmContact/index.js
+++ b/server/services/ami/trigger/cmContact/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3ee6=['calleridnum','uniqueid','firstName','destcalleridname','destcalleridnum','phone','resolve','showContact','omit','xmd-contactid2','format','user:%s','name','trigger:%s','toLowerCase','action','merge','catch','error','Error\x20creating\x20contact','bluebird','lodash','ioredis','../../../../config/logger','trigger','redis','socket.io-emitter','info','stringify','emit','autoCreate','data2','data1','routeId','calleridname',''];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x3ee6,0xc8));var _0x63ee=function(_0x24b479,_0x339a4d){_0x24b479=_0x24b479-0x0;var _0x33f092=_0x3ee6[_0x24b479];return _0x33f092;};'use strict';var BPromise=require(_0x63ee('0x0'));var util=require('util');var _=require(_0x63ee('0x1'));var Redis=require(_0x63ee('0x2'));var config=require('../../../../config/environment');var logger=require(_0x63ee('0x3'))(_0x63ee('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0x63ee('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x63ee('0x6'))(new Redis(config[_0x63ee('0x5')]));function emit(_0x3d0098,_0x29f929,_0x4f3c93){logger[_0x63ee('0x7')](_0x3d0098,_0x29f929,JSON[_0x63ee('0x8')](_0x4f3c93));io['to'](_0x3d0098)[_0x63ee('0x9')](_0x29f929,_0x4f3c93);}exports['exec']=function(_0x32efe8,_0xc70d55,_0xa83642){_0xa83642[_0x63ee('0xa')]=0x0;if(_0xc70d55[_0x63ee('0xb')]&&parseInt(_0xc70d55[_0x63ee('0xb')],0xa)){var _0x3df6cd={'ListId':parseInt(_0xc70d55[_0x63ee('0xc')],0xa),'phone':_0xa83642['calleridnum']};if(_['isNil'](_0xa83642[_0x63ee('0xd')])){_0x3df6cd['firstName']=_0xa83642[_0x63ee('0xe')]&&_0xa83642[_0x63ee('0xe')]!==_0x63ee('0xf')?_0xa83642[_0x63ee('0xe')]:_0xa83642[_0x63ee('0x10')]||_0xa83642[_0x63ee('0x11')];}else{_0x3df6cd[_0x63ee('0x12')]=_0xa83642[_0x63ee('0x13')]&&_0xa83642['destcalleridname']!==_0x63ee('0xf')?_0xa83642[_0x63ee('0x13')]:_0xa83642[_0x63ee('0x14')]||_0xa83642[_0x63ee('0x11')];_0x3df6cd[_0x63ee('0x15')]=_0xa83642['destcalleridname']&&_0xa83642[_0x63ee('0x13')]!==''?_0xa83642[_0x63ee('0x13')]:_0xa83642[_0x63ee('0x14')]||_0xa83642[_0x63ee('0x11')];}BPromise[_0x63ee('0x16')]()['then'](cmContactRpc[_0x63ee('0x17')]({'where':_[_0x63ee('0x18')](_0x3df6cd,[_0x63ee('0x12')])}))['then'](function(_0x2f47db){if(_0x2f47db){_0xa83642[_0x63ee('0x19')]=_0x2f47db['id'];emit(util[_0x63ee('0x1a')](_0x63ee('0x1b'),_0x32efe8[_0x63ee('0x1c')]),util[_0x63ee('0x1a')](_0x63ee('0x1d'),_0xc70d55['action'][_0x63ee('0x1e')]()),_['merge'](_0xa83642,{'ListId':parseInt(_0xc70d55['data1'],0xa)}));return;}else{return BPromise[_0x63ee('0x16')]()['then'](cmContactRpc['createContact'](_0x3df6cd));}})['then'](function(_0x309add){if(_0x309add){_0xa83642[_0x63ee('0x19')]=_0x309add['id'];emit(util[_0x63ee('0x1a')](_0x63ee('0x1b'),_0x32efe8[_0x63ee('0x1c')]),util[_0x63ee('0x1a')](_0x63ee('0x1d'),_0xc70d55[_0x63ee('0x1f')]['toLowerCase']()),_[_0x63ee('0x20')](_0xa83642,{'ListId':parseInt(_0xc70d55[_0x63ee('0xc')],0xa)}));}})[_0x63ee('0x21')](function(_0x46ff11){logger[_0x63ee('0x22')](_0x63ee('0x23'),JSON['stringify'](_0x46ff11));});}else{if(_0x32efe8){emit(util[_0x63ee('0x1a')](_0x63ee('0x1b'),_0x32efe8['name']),util[_0x63ee('0x1a')](_0x63ee('0x1d'),_0xc70d55[_0x63ee('0x1f')][_0x63ee('0x1e')]()),_['merge']({'ListId':parseInt(_0xc70d55[_0x63ee('0xc')],0xa)},_0xa83642));}}};
\ No newline at end of file
+var _0xcfd1=['destcalleridnum','uniqueid','resolve','then','xmd-contactid2','format','user:%s','trigger:%s','merge','data1','name','toLowerCase','catch','error','action','bluebird','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','autoCreate','data2','calleridnum','isNil','routeId','firstName','calleridname','','destcalleridname'];(function(_0xd9fcb6,_0x6b8104){var _0x50a60a=function(_0x2f4bb7){while(--_0x2f4bb7){_0xd9fcb6['push'](_0xd9fcb6['shift']());}};_0x50a60a(++_0x6b8104);}(_0xcfd1,0x18b));var _0x1cfd=function(_0x823229,_0x1710e2){_0x823229=_0x823229-0x0;var _0x2d2103=_0xcfd1[_0x823229];return _0x2d2103;};'use strict';var BPromise=require(_0x1cfd('0x0'));var util=require('util');var _=require(_0x1cfd('0x1'));var Redis=require(_0x1cfd('0x2'));var config=require(_0x1cfd('0x3'));var logger=require(_0x1cfd('0x4'))(_0x1cfd('0x5'));var cmContactRpc=require(_0x1cfd('0x6'));config[_0x1cfd('0x7')]=_[_0x1cfd('0x8')](config['redis'],{'host':_0x1cfd('0x9'),'port':0x18eb});var io=require(_0x1cfd('0xa'))(new Redis(config[_0x1cfd('0x7')]));function emit(_0x476ad2,_0x19f1dc,_0x200b40){logger[_0x1cfd('0xb')](_0x476ad2,_0x19f1dc,JSON[_0x1cfd('0xc')](_0x200b40));io['to'](_0x476ad2)[_0x1cfd('0xd')](_0x19f1dc,_0x200b40);}exports['exec']=function(_0x292321,_0x2c310c,_0x4efd27){_0x4efd27[_0x1cfd('0xe')]=0x0;if(_0x2c310c[_0x1cfd('0xf')]&&parseInt(_0x2c310c[_0x1cfd('0xf')],0xa)){var _0x12ab41={'ListId':parseInt(_0x2c310c['data1'],0xa),'phone':_0x4efd27[_0x1cfd('0x10')]};if(_[_0x1cfd('0x11')](_0x4efd27[_0x1cfd('0x12')])){_0x12ab41[_0x1cfd('0x13')]=_0x4efd27[_0x1cfd('0x14')]&&_0x4efd27[_0x1cfd('0x14')]!==_0x1cfd('0x15')?_0x4efd27[_0x1cfd('0x14')]:_0x4efd27[_0x1cfd('0x10')]||_0x4efd27['uniqueid'];}else{_0x12ab41[_0x1cfd('0x13')]=_0x4efd27[_0x1cfd('0x16')]&&_0x4efd27[_0x1cfd('0x16')]!==_0x1cfd('0x15')?_0x4efd27['destcalleridname']:_0x4efd27[_0x1cfd('0x17')]||_0x4efd27['uniqueid'];_0x12ab41['phone']=_0x4efd27['destcalleridname']&&_0x4efd27['destcalleridname']!==_0x1cfd('0x15')?_0x4efd27[_0x1cfd('0x16')]:_0x4efd27[_0x1cfd('0x17')]||_0x4efd27[_0x1cfd('0x18')];}BPromise[_0x1cfd('0x19')]()['then'](cmContactRpc['showContact']({'where':_['omit'](_0x12ab41,['firstName'])}))[_0x1cfd('0x1a')](function(_0x4a5dfb){if(_0x4a5dfb){_0x4efd27[_0x1cfd('0x1b')]=_0x4a5dfb['id'];emit(util[_0x1cfd('0x1c')](_0x1cfd('0x1d'),_0x292321['name']),util[_0x1cfd('0x1c')](_0x1cfd('0x1e'),_0x2c310c['action']['toLowerCase']()),_[_0x1cfd('0x1f')](_0x4efd27,{'ListId':parseInt(_0x2c310c[_0x1cfd('0x20')],0xa)}));return;}else{return BPromise[_0x1cfd('0x19')]()['then'](cmContactRpc['createContact'](_0x12ab41));}})[_0x1cfd('0x1a')](function(_0x4e09ce){if(_0x4e09ce){_0x4efd27[_0x1cfd('0x1b')]=_0x4e09ce['id'];emit(util[_0x1cfd('0x1c')]('user:%s',_0x292321[_0x1cfd('0x21')]),util[_0x1cfd('0x1c')](_0x1cfd('0x1e'),_0x2c310c['action'][_0x1cfd('0x22')]()),_[_0x1cfd('0x1f')](_0x4efd27,{'ListId':parseInt(_0x2c310c[_0x1cfd('0x20')],0xa)}));}})[_0x1cfd('0x23')](function(_0x26be5f){logger[_0x1cfd('0x24')]('Error\x20creating\x20contact',JSON[_0x1cfd('0xc')](_0x26be5f));});}else{if(_0x292321){emit(util[_0x1cfd('0x1c')]('user:%s',_0x292321['name']),util[_0x1cfd('0x1c')](_0x1cfd('0x1e'),_0x2c310c[_0x1cfd('0x25')][_0x1cfd('0x22')]()),_['merge']({'ListId':parseInt(_0x2c310c[_0x1cfd('0x20')],0xa)},_0x4efd27));}}};
\ No newline at end of file
diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js
index ebc2e2c..f096dc4 100644
--- a/server/services/ami/trigger/index.js
+++ b/server/services/ami/trigger/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x305b=['checkConditions','channel','some','field','account','value','ChatWebsiteId','upperFirst','AccountId','operator','interaction','message','event','queue','agent','membername','lastevent','util','lodash','url','ioredis','./urlforward','./integration','./cmContact','./script','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','zohoAccounts','servicenowAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','checkTriggers','hasOwnProperty','status','checkTrigger','Actions','length','interface','motionbar','browser','data2','html','render','template\x20not\x20found','uri','isNil','data4','location','uriLocation','windowWidth','data5','data6','600','winApplication','winArguments','data3','format','user:%s','trigger:%s:%s','action','toLowerCase','data1','jscripty','name','merge','trigger:%s','contactmanager','exec','accounts','routeId','urlforward','script','buildUri','parse','query','AllConditions','every'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x305b,0x81));var _0xb305=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x305b[_0x454165];return _0x56db53;};'use strict';var util=require(_0xb305('0x0'));var _=require(_0xb305('0x1'));var url=require(_0xb305('0x2'));var Mustache=require('mustache');var Redis=require(_0xb305('0x3'));var urlforward=require(_0xb305('0x4'));var integration=require(_0xb305('0x5'));var cmContact=require(_0xb305('0x6'));var script=require(_0xb305('0x7'));var cmContactRpc=require(_0xb305('0x8'));var config=require(_0xb305('0x9'));var logger=require(_0xb305('0xa'))(_0xb305('0xb'));var ami=require(_0xb305('0xc'));config[_0xb305('0xd')]=_[_0xb305('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb305('0xf'))(new Redis(config['redis']));var operators={'equals':function(_0x16c09f,_0x35e8c5){return _0x16c09f==_0x35e8c5;},'not_equals':function(_0x2a3a62,_0x294664){return _0x2a3a62!=_0x294664;}};var barAndWebActions=[_0xb305('0x10'),'url','winapp'];function Trigger(_0x51e434){this['triggers']=_0x51e434[_0xb305('0x11')];this['agents']=_0x51e434[_0xb305('0x12')];this[_0xb305('0x13')]=_0x51e434[_0xb305('0x13')];this[_0xb305('0x14')]=_0x51e434[_0xb305('0x14')];this[_0xb305('0x15')]=_0x51e434[_0xb305('0x15')];this[_0xb305('0x16')]=_0x51e434[_0xb305('0x16')];this[_0xb305('0x17')]=_0x51e434['freshdeskAccounts'];this[_0xb305('0x18')]=_0x51e434[_0xb305('0x18')];this['sugarcrmAccounts']=_0x51e434[_0xb305('0x19')];this['zohoAccounts']=_0x51e434['zohoAccounts'];this[_0xb305('0x1a')]=_0x51e434[_0xb305('0x1a')];this[_0xb305('0x1b')]=_0x51e434[_0xb305('0x1b')];this['servicenowAccounts']=_0x51e434['servicenowAccounts'];this['dynamics365Accounts']=_0x51e434[_0xb305('0x1c')];this['accounts']={'zendesk':this[_0xb305('0x16')],'salesforce':this[_0xb305('0x18')],'freshdesk':this[_0xb305('0x17')],'sugarcrm':this[_0xb305('0x19')],'zoho':this[_0xb305('0x1d')],'desk':this[_0xb305('0x1a')],'vtiger':this[_0xb305('0x1b')],'servicenow':this[_0xb305('0x1e')],'dynamics365':this[_0xb305('0x1c')]};ami['on'](_0xb305('0x1f'),this[_0xb305('0x20')][_0xb305('0x21')](this));ami['on']('custom:agentconnect',this[_0xb305('0x20')]['bind'](this));ami['on'](_0xb305('0x22'),this[_0xb305('0x20')][_0xb305('0x21')](this));ami['on'](_0xb305('0x23'),this['syncCustomEvent'][_0xb305('0x21')](this));ami['on'](_0xb305('0x24'),this[_0xb305('0x20')][_0xb305('0x21')](this));ami['on'](_0xb305('0x25'),this[_0xb305('0x26')][_0xb305('0x21')](this));ami['on'](_0xb305('0x27'),this['syncAgentDial']['bind'](this));ami['on'](_0xb305('0x28'),this[_0xb305('0x26')]['bind'](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0xb305('0x21')](this));ami['on']('custom:closedinteraction',this[_0xb305('0x20')][_0xb305('0x21')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xb305('0x21')](this));ami['on'](_0xb305('0x29'),this[_0xb305('0x20')][_0xb305('0x21')](this));ami['on'](_0xb305('0x2a'),this[_0xb305('0x20')]['bind'](this));ami['on'](_0xb305('0x2b'),this[_0xb305('0x20')][_0xb305('0x21')](this));}Trigger[_0xb305('0x2c')][_0xb305('0x2d')]=function(_0x151435,_0x5a68a6,_0x3f4ee4){logger[_0xb305('0x2e')](_0x151435,_0x5a68a6,JSON[_0xb305('0x2f')](_0x3f4ee4));io['to'](_0x151435)[_0xb305('0x2d')](_0x5a68a6,_0x3f4ee4);};Trigger[_0xb305('0x2c')][_0xb305('0x20')]=function(_0x1d5ffc){var _0x11a3c4=_[_0xb305('0x30')](_0x1d5ffc);this[_0xb305('0x31')](_0x11a3c4);};Trigger[_0xb305('0x2c')][_0xb305('0x26')]=function(_0xbe42d2){if(this[_0xb305('0x12')][_0xbe42d2['interface']]){this[_0xb305('0x20')](_0xbe42d2);}};Trigger[_0xb305('0x2c')][_0xb305('0x31')]=function(_0x5bfecd){var _0x1f4abd;for(var _0x29617f in this[_0xb305('0x11')]){if(this[_0xb305('0x11')][_0xb305('0x32')](_0x29617f)){if(this[_0xb305('0x11')][_0x29617f][_0xb305('0x33')]){_0x1f4abd=this[_0xb305('0x34')](this['triggers'][_0x29617f],_0x5bfecd);if(_0x1f4abd){_['merge'](_0x5bfecd,_0x5bfecd['variables']);for(var _0x1e8475=0x0,_0x44d945,_0x6c6eff,_0x5b6ce4;_0x1e84750x0){_0x4c6460=_[_0x4033('0x2f')](_0x42ae4d,_0x33bbb4);}return _0x4c6460;}function getCustomFields(_0x1597cc,_0x587eb8){var _0x49e3ab=[];var _0x373a23={'custom_fields':{}};if(_0x1597cc['length']>0x0){_[_0x4033('0x30')](_0x1597cc,function(_0x1ac186){if(_0x1ac186[_0x4033('0x31')]===_0x4033('0x32')&&_0x1ac186['nameField']&&!_0x1ac186['customField']){_0x373a23[_0x1ac186[_0x4033('0x33')][_0x4033('0x34')]()]=_0x1ac186[_0x4033('0x35')][_0x4033('0x24')]();}else if(_0x1ac186[_0x4033('0x31')]===_0x4033('0x32')&&_0x1ac186[_0x4033('0x36')]&&_0x1ac186[_0x4033('0x37')]){_0x373a23[_0x4033('0x38')][_0x1ac186[_0x4033('0x36')]]=_0x1ac186[_0x4033('0x35')][_0x4033('0x24')]();}else if(_0x1ac186[_0x4033('0x31')]==='variable'&&_0x1ac186[_0x4033('0x39')]&&_0x1ac186[_0x4033('0x36')]&&_0x1ac186[_0x4033('0x37')]){_0x587eb8[_0x1ac186[_0x4033('0x39')]]&&(_0x373a23['custom_fields'][_0x1ac186[_0x4033('0x36')]]=_0x587eb8[_0x1ac186[_0x4033('0x39')]][_0x4033('0x24')]());}else if(_0x1ac186['type']==='customVariable'&&_0x1ac186[_0x4033('0x3a')]&&_0x1ac186[_0x4033('0x3a')][_0x4033('0x3b')]&&_0x1ac186[_0x4033('0x36')]&&_0x1ac186[_0x4033('0x37')]){_0x587eb8[_0x1ac186[_0x4033('0x3a')][_0x4033('0x3b')][_0x4033('0x34')]()]&&(_0x373a23[_0x4033('0x38')][_0x1ac186['idField']]=_0x587eb8[_0x1ac186['Variable'][_0x4033('0x3b')][_0x4033('0x34')]()][_0x4033('0x24')]());}});}if(_0x373a23[_0x4033('0x3c')]){_0x373a23['priority']=Number(_0x373a23[_0x4033('0x3c')]);}return _0x373a23;}function getTicket(_0x41d64b,_0x2e2c8c,_0x5dc304,_0x5345a5,_0x45d3da){logger[_0x4033('0xd')]('Creating\x20new\x20ticket...');var _0x7a1c3e=_['merge']({'subject':intUtil[_0x4033('0x3d')](_0x5345a5['Subjects'],_0x45d3da,'\x20'),'type':_0x4033('0x3e'),'status':_0x4033('0x3f'),'labels':['xCALLY',_0x4033('0x40'),_0x4033('0x41')][_0x4033('0x42')](getTags(_0x5345a5[_0x4033('0x43')],_0x4033('0x3b'))),'description':intUtil[_0x4033('0x3d')](_0x5345a5[_0x4033('0x44')],_0x45d3da,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x4033('0x45'),_0x2e2c8c['id']),'class':_0x4033('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0x5345a5[_0x4033('0x44')],_0x45d3da,'\x0a')}},getCustomFields(_0x5345a5[_0x4033('0x47')],_0x45d3da));return request({'uri':util[_0x4033('0x16')](_0x4033('0x48'),_0x41d64b[_0x4033('0x10')],_0x5dc304['id']),'method':'POST','body':_0x7a1c3e});}exports[_0x4033('0x49')]=function(_0x1eb8cf,_0x4ee97c,_0x21c0d8,_0x27fd9a,_0x27811c,_0x24aaca){var _0x289ed7,_0x10d51c;_0x24aaca[_0x4033('0x10')]=intUtil['stripTrailingSlash'](_0x24aaca[_0x4033('0x10')]);_0x24aaca[_0x4033('0x4a')]=intUtil[_0x4033('0x4b')](_0x24aaca[_0x4033('0x4a')]);if(_0x27811c&&_0x27811c[_0x4033('0x4c')]){logger[_0x4033('0xd')]('[QUEUE]',_0x4033('0x4d'));_0x4ee97c[_0x4033('0x4e')]=util[_0x4033('0x16')](_0x4033('0x4f'),_0x24aaca['serverUrl'],_0x4ee97c['uniqueid'],md5(_0x4ee97c[_0x4033('0x50')]));}else{_0x4ee97c[_0x4033('0x4e')]='';}headers[_0x4033('0x51')]=getAuth(_0x24aaca);return getUser(_0x24aaca,_0x27fd9a[_0x4033('0x52')])[_0x4033('0x11')](function(_0x506655){_0x289ed7=_0x506655;logger[_0x4033('0xd')](_0x4033('0x53'),_0x289ed7['id']);return getEndUser(_0x24aaca,_0x4ee97c[_0x4033('0x54')],_0x4ee97c[_0x4033('0x55')]);})[_0x4033('0x11')](function(_0x4ccbe3){_0x10d51c=_0x4ccbe3;logger[_0x4033('0xd')]('The\x20Enduser\x20ID\x20is:',_0x10d51c['id']);return getTicket(_0x24aaca,_0x289ed7,_0x10d51c,_0x21c0d8,_0x4ee97c);})[_0x4033('0x11')](function(_0x568b02){if(_0x568b02){logger[_0x4033('0xd')]('Ticket\x20created!');logger['info'](_0x4033('0x56'),_0x568b02['id']);switch(_0x24aaca[_0x4033('0x31')]){case'integrationTab':logger['info'](_0x4033('0x57'),_0x4033('0x58'));emit(util[_0x4033('0x16')](_0x4033('0x59'),_0x27fd9a['name']),_0x4033('0x5a'),{'recordId':_0x568b02['id']});break;case _0x4033('0x5b'):logger[_0x4033('0xd')](_0x4033('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4033('0x16')]('user:%s',_0x27fd9a['name']),_0x4033('0x5c'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x568b02['id'])});break;default:logger[_0x4033('0x5d')](_0x4033('0x57'),_0x4033('0x5e'));}}})[_0x4033('0x5f')](function(_0x304914){console[_0x4033('0x5d')](_0x304914);logger[_0x4033('0x5d')]('[QUEUE]',JSON['stringify'](_0x304914));});};exports[_0x4033('0x60')]=function(_0x566a1f,_0x9093b7,_0x502679,_0x28d946,_0x386d44,_0x3dd503,_0x2b4b7f){var _0x435e66,_0xea614d;_0x3dd503[_0x4033('0x10')]=intUtil[_0x4033('0x4b')](_0x3dd503['remoteUri']);_0x3dd503[_0x4033('0x4a')]=intUtil[_0x4033('0x4b')](_0x3dd503[_0x4033('0x4a')]);if(_0x2b4b7f&&_0x2b4b7f[_0x4033('0x61')]&&_0x2b4b7f['recordingFormat']!=='none'){logger[_0x4033('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x9093b7[_0x4033('0x4e')]=util[_0x4033('0x16')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3dd503[_0x4033('0x4a')],_0x9093b7[_0x4033('0x50')],md5(_0x9093b7[_0x4033('0x50')]));}headers[_0x4033('0x51')]=getAuth(_0x3dd503);return getUser(_0x3dd503,_0x28d946[_0x4033('0x52')])[_0x4033('0x11')](function(_0x469bb3){_0x435e66=_0x469bb3;logger[_0x4033('0xd')]('The\x20User\x20ID\x20is:',_0x435e66['id']);return getEndUser(_0x3dd503,_0x9093b7[_0x4033('0x62')],_0x9093b7[_0x4033('0x63')]);})[_0x4033('0x11')](function(_0x5719d9){_0xea614d=_0x5719d9;logger[_0x4033('0xd')](_0x4033('0x64'),_0xea614d['id']);return getTicket(_0x3dd503,_0x435e66,_0xea614d,_0x502679,_0x9093b7);})['then'](function(_0x3a37f0){if(_0x3a37f0){logger['info'](_0x4033('0x65'));logger[_0x4033('0xd')](_0x4033('0x56'),_0x3a37f0['id']);switch(_0x3dd503[_0x4033('0x31')]){case _0x4033('0x66'):logger['info'](_0x4033('0x57'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x4033('0x16')](_0x4033('0x59'),_0x28d946['name']),'trigger:desk:display',{'recordId':_0x3a37f0['id']});break;case _0x4033('0x5b'):logger['info'](_0x4033('0x57'),_0x4033('0x67'));emit(util[_0x4033('0x16')]('user:%s',_0x28d946[_0x4033('0x3b')]),'trigger:browser:url',{'uri':util[_0x4033('0x16')]('%s/agent/tickets/%s',_0x3dd503[_0x4033('0x10')],_0x3a37f0['id'])});break;default:logger['error']('[OUTBOUND]',_0x4033('0x5e'));}}})[_0x4033('0x5f')](function(_0x458344){logger['error']('[OUTBOUND]',JSON['stringify'](_0x458344));});};exports[_0x4033('0x68')]=function(_0x4d0434,_0x291847,_0x28d56b,_0x27b4cf,_0x54a0d0,_0x347537){var _0x1ddf03,_0x1eeef3;_0x347537[_0x4033('0x10')]=intUtil['stripTrailingSlash'](_0x347537['remoteUri']);_0x347537[_0x4033('0x4a')]=intUtil[_0x4033('0x4b')](_0x347537[_0x4033('0x4a')]);if(_0x54a0d0&&_0x54a0d0[_0x4033('0x4c')]){logger[_0x4033('0xd')]('[ABANDONED]',_0x4033('0x4d'));_0x291847[_0x4033('0x4e')]=util[_0x4033('0x16')](_0x4033('0x4f'),_0x347537['serverUrl'],_0x291847[_0x4033('0x50')],md5(_0x291847[_0x4033('0x50')]));}else{_0x291847['recordingURL']='';}headers[_0x4033('0x51')]=getAuth(_0x347537);return getUser(_0x347537)[_0x4033('0x11')](function(_0x378433){_0x1ddf03=_0x378433;logger[_0x4033('0xd')](_0x4033('0x53'),_0x1ddf03['id']);return getEndUser(_0x347537,_0x291847[_0x4033('0x54')],_0x291847['calleridnum']);})[_0x4033('0x11')](function(_0x23ebe3){_0x1eeef3=_0x23ebe3;logger['info'](_0x4033('0x64'),_0x1eeef3['id']);return getTicket(_0x347537,_0x1ddf03,_0x1eeef3,_0x28d56b,_0x291847);})[_0x4033('0x11')](function(_0xcfbe2e){if(_0xcfbe2e){logger[_0x4033('0xd')]('Ticket\x20created!');logger[_0x4033('0xd')]('The\x20Ticket\x20ID\x20is:',_0xcfbe2e['id']);}})[_0x4033('0x5f')](function(_0x11b658){logger[_0x4033('0x5d')](_0x4033('0x69'),JSON[_0x4033('0x1a')](_0x11b658));});};
\ No newline at end of file
+var _0x36a8=['%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','work','length','string','nameField','customField','toLowerCase','content','type','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','xCALLY','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','Ticket\x20created!','abandoned','calleridnum','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','desk','redis','defaults','socket.io-emitter','emit','application/json','validateEmail','format','%s/users','remoteUri','total_entries','find','_embedded','entries','info','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','authType','basic','%s:%s','username','password','token'];(function(_0x2fa11e,_0x57a5c4){var _0x2b445c=function(_0x1179c4){while(--_0x1179c4){_0x2fa11e['push'](_0x2fa11e['shift']());}};_0x2b445c(++_0x57a5c4);}(_0x36a8,0x180));var _0x836a=function(_0x452bed,_0x128e55){_0x452bed=_0x452bed-0x0;var _0x4bb2cf=_0x36a8[_0x452bed];return _0x4bb2cf;};'use strict';var _=require(_0x836a('0x0'));var rp=require(_0x836a('0x1'));var md5=require(_0x836a('0x2'));var util=require(_0x836a('0x3'));var Redis=require(_0x836a('0x4'));var intUtil=require(_0x836a('0x5'));var config=require(_0x836a('0x6'));var logger=require('../../../../config/logger')(_0x836a('0x7'));config[_0x836a('0x8')]=_[_0x836a('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x836a('0xa'))(new Redis(config[_0x836a('0x8')]));function emit(_0xc9e18,_0x42f1a8,_0x5a0cfb){io['to'](_0xc9e18)[_0x836a('0xb')](_0x42f1a8,_0x5a0cfb);}var headers={'Content-Type':_0x836a('0xc'),'Accept':_0x836a('0xc')};function getUser(_0x3e7cde,_0x48eaaf){if(intUtil[_0x836a('0xd')](_0x48eaaf)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0x48eaaf);return request({'uri':util[_0x836a('0xe')](_0x836a('0xf'),_0x3e7cde[_0x836a('0x10')])})['then'](function(_0x1e7130){if(_0x1e7130[_0x836a('0x11')]){return _[_0x836a('0x12')](_0x1e7130[_0x836a('0x13')][_0x836a('0x14')],{'email':_0x48eaaf});}})['then'](function(_0x5e530b){if(_0x5e530b){logger[_0x836a('0x15')]('Agent\x20found!');return _0x5e530b;}else{logger[_0x836a('0x15')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me',_0x3e7cde[_0x836a('0x10')])});}});}else{logger['info'](_0x836a('0x16'));return request({'uri':util['format'](_0x836a('0x17'),_0x3e7cde[_0x836a('0x10')])});}}function request(_0xf49bfb){logger[_0x836a('0x18')]('[HTTP]',JSON[_0x836a('0x19')](_0xf49bfb));return rp(_[_0x836a('0x9')](_0xf49bfb,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x13ea8c){var _0x98e940;if(_0x13ea8c[_0x836a('0x1a')]===_0x836a('0x1b')){_0x98e940=util[_0x836a('0xe')](_0x836a('0x1c'),_0x13ea8c[_0x836a('0x1d')],_0x13ea8c[_0x836a('0x1e')]);}else if(_0x13ea8c[_0x836a('0x1a')]===_0x836a('0x1f')){_0x98e940=util['format'](_0x836a('0x20'),_0x13ea8c[_0x836a('0x1d')],_0x13ea8c['token']);}return util['format'](_0x836a('0x21'),new Buffer(_0x98e940)[_0x836a('0x22')](_0x836a('0x23')));}function getEndUser(_0x4c3f8f,_0x1d4dd0,_0x55de22){logger[_0x836a('0x15')](_0x836a('0x24'),_0x55de22);return request({'uri':util[_0x836a('0xe')]('%s/customers/search',_0x4c3f8f[_0x836a('0x10')]),'qs':{'phone':_0x55de22}})[_0x836a('0x25')](function(_0x440d71){if(_0x440d71['total_entries']){logger[_0x836a('0x15')](_0x836a('0x26'));return _0x440d71[_0x836a('0x13')][_0x836a('0x14')][0x0];}else{logger[_0x836a('0x15')](_0x836a('0x27'));return request({'uri':util['format'](_0x836a('0x28'),_0x4c3f8f[_0x836a('0x10')]),'method':'POST','body':{'first_name':_0x1d4dd0,'title':_0x1d4dd0,'phone_numbers':[{'type':_0x836a('0x29'),'value':_0x55de22}]}});}});}function getTags(_0x185451,_0x2c473c){var _0x16343d=[];if(_0x185451&&_0x185451[_0x836a('0x2a')]>0x0){_0x16343d=_['map'](_0x185451,_0x2c473c);}return _0x16343d;}function getCustomFields(_0x2c51c2,_0x2564e3){var _0x1b5826=[];var _0x337f88={'custom_fields':{}};if(_0x2c51c2[_0x836a('0x2a')]>0x0){_['forEach'](_0x2c51c2,function(_0x15dcfa){if(_0x15dcfa['type']===_0x836a('0x2b')&&_0x15dcfa[_0x836a('0x2c')]&&!_0x15dcfa[_0x836a('0x2d')]){_0x337f88[_0x15dcfa[_0x836a('0x2c')][_0x836a('0x2e')]()]=_0x15dcfa[_0x836a('0x2f')][_0x836a('0x22')]();}else if(_0x15dcfa[_0x836a('0x30')]===_0x836a('0x2b')&&_0x15dcfa[_0x836a('0x31')]&&_0x15dcfa[_0x836a('0x2d')]){_0x337f88[_0x836a('0x32')][_0x15dcfa[_0x836a('0x31')]]=_0x15dcfa[_0x836a('0x2f')]['toString']();}else if(_0x15dcfa[_0x836a('0x30')]===_0x836a('0x33')&&_0x15dcfa[_0x836a('0x34')]&&_0x15dcfa[_0x836a('0x31')]&&_0x15dcfa['customField']){_0x2564e3[_0x15dcfa[_0x836a('0x34')]]&&(_0x337f88[_0x836a('0x32')][_0x15dcfa[_0x836a('0x31')]]=_0x2564e3[_0x15dcfa[_0x836a('0x34')]]['toString']());}else if(_0x15dcfa['type']===_0x836a('0x35')&&_0x15dcfa[_0x836a('0x36')]&&_0x15dcfa[_0x836a('0x36')][_0x836a('0x37')]&&_0x15dcfa[_0x836a('0x31')]&&_0x15dcfa['customField']){_0x2564e3[_0x15dcfa[_0x836a('0x36')]['name'][_0x836a('0x2e')]()]&&(_0x337f88[_0x836a('0x32')][_0x15dcfa[_0x836a('0x31')]]=_0x2564e3[_0x15dcfa[_0x836a('0x36')][_0x836a('0x37')][_0x836a('0x2e')]()][_0x836a('0x22')]());}});}if(_0x337f88[_0x836a('0x38')]){_0x337f88[_0x836a('0x38')]=Number(_0x337f88[_0x836a('0x38')]);}return _0x337f88;}function getTicket(_0x4f7300,_0x29706c,_0x17c290,_0x5c991b,_0xbc78fc){logger[_0x836a('0x15')](_0x836a('0x39'));var _0x4fb0c5=_[_0x836a('0x3a')]({'subject':intUtil[_0x836a('0x3b')](_0x5c991b[_0x836a('0x3c')],_0xbc78fc,'\x20'),'type':_0x836a('0x3d'),'status':'new','labels':[_0x836a('0x3e'),'Motion','CTI'][_0x836a('0x3f')](getTags(_0x5c991b[_0x836a('0x40')],_0x836a('0x37'))),'description':intUtil['getString'](_0x5c991b[_0x836a('0x41')],_0xbc78fc,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x836a('0x42'),_0x29706c['id']),'class':_0x836a('0x43')}},'message':{'direction':'in','body':intUtil[_0x836a('0x3b')](_0x5c991b[_0x836a('0x41')],_0xbc78fc,'\x0a')}},getCustomFields(_0x5c991b['Fields'],_0xbc78fc));return request({'uri':util['format'](_0x836a('0x44'),_0x4f7300[_0x836a('0x10')],_0x17c290['id']),'method':_0x836a('0x45'),'body':_0x4fb0c5});}exports[_0x836a('0x46')]=function(_0xdcedb6,_0x503992,_0x5c710c,_0x24d328,_0x4caf8f,_0x8aa690){var _0x580bef,_0x4a6cd7;_0x8aa690[_0x836a('0x10')]=intUtil[_0x836a('0x47')](_0x8aa690['remoteUri']);_0x8aa690[_0x836a('0x48')]=intUtil[_0x836a('0x47')](_0x8aa690['serverUrl']);if(_0x4caf8f&&_0x4caf8f['monitor_format']){logger[_0x836a('0x15')]('[QUEUE]',_0x836a('0x49'));_0x503992[_0x836a('0x4a')]=util[_0x836a('0xe')](_0x836a('0x4b'),_0x8aa690[_0x836a('0x48')],_0x503992[_0x836a('0x4c')],md5(_0x503992[_0x836a('0x4c')]));}else{_0x503992['recordingURL']='';}headers['Authorization']=getAuth(_0x8aa690);return getUser(_0x8aa690,_0x24d328[_0x836a('0x4d')])[_0x836a('0x25')](function(_0x2e04f1){_0x580bef=_0x2e04f1;logger[_0x836a('0x15')](_0x836a('0x4e'),_0x580bef['id']);return getEndUser(_0x8aa690,_0x503992[_0x836a('0x4f')],_0x503992['calleridnum']);})[_0x836a('0x25')](function(_0x20b44d){_0x4a6cd7=_0x20b44d;logger[_0x836a('0x15')](_0x836a('0x50'),_0x4a6cd7['id']);return getTicket(_0x8aa690,_0x580bef,_0x4a6cd7,_0x5c710c,_0x503992);})[_0x836a('0x25')](function(_0x5bb104){if(_0x5bb104){logger['info']('Ticket\x20created!');logger[_0x836a('0x15')](_0x836a('0x51'),_0x5bb104['id']);switch(_0x8aa690['type']){case _0x836a('0x52'):logger[_0x836a('0x15')](_0x836a('0x53'),_0x836a('0x54'));emit(util[_0x836a('0xe')](_0x836a('0x55'),_0x24d328[_0x836a('0x37')]),_0x836a('0x56'),{'recordId':_0x5bb104['id']});break;case _0x836a('0x57'):logger[_0x836a('0x15')](_0x836a('0x53'),_0x836a('0x58'));emit(util[_0x836a('0xe')](_0x836a('0x55'),_0x24d328[_0x836a('0x37')]),_0x836a('0x59'),{'uri':util['format'](_0x836a('0x5a'),_0x5bb104['id'])});break;default:logger[_0x836a('0x5b')](_0x836a('0x53'),_0x836a('0x5c'));}}})[_0x836a('0x5d')](function(_0x1e34de){console['error'](_0x1e34de);logger['error'](_0x836a('0x53'),JSON[_0x836a('0x19')](_0x1e34de));});};exports[_0x836a('0x5e')]=function(_0x248a83,_0x6e7766,_0x779cc8,_0x427df3,_0x338bcc,_0x92a712,_0x1b612d){var _0x44dc5c,_0x1b8b72;_0x92a712[_0x836a('0x10')]=intUtil[_0x836a('0x47')](_0x92a712[_0x836a('0x10')]);_0x92a712[_0x836a('0x48')]=intUtil[_0x836a('0x47')](_0x92a712[_0x836a('0x48')]);if(_0x1b612d&&_0x1b612d['recordingFormat']&&_0x1b612d['recordingFormat']!==_0x836a('0x5f')){logger[_0x836a('0x15')](_0x836a('0x60'),_0x836a('0x49'));_0x6e7766[_0x836a('0x4a')]=util[_0x836a('0xe')](_0x836a('0x4b'),_0x92a712[_0x836a('0x48')],_0x6e7766['uniqueid'],md5(_0x6e7766['uniqueid']));}headers[_0x836a('0x61')]=getAuth(_0x92a712);return getUser(_0x92a712,_0x427df3[_0x836a('0x4d')])[_0x836a('0x25')](function(_0x36caa3){_0x44dc5c=_0x36caa3;logger[_0x836a('0x15')](_0x836a('0x4e'),_0x44dc5c['id']);return getEndUser(_0x92a712,_0x6e7766[_0x836a('0x62')],_0x6e7766[_0x836a('0x63')]);})[_0x836a('0x25')](function(_0x53fbf4){_0x1b8b72=_0x53fbf4;logger[_0x836a('0x15')](_0x836a('0x50'),_0x1b8b72['id']);return getTicket(_0x92a712,_0x44dc5c,_0x1b8b72,_0x779cc8,_0x6e7766);})[_0x836a('0x25')](function(_0x2b2af3){if(_0x2b2af3){logger[_0x836a('0x15')](_0x836a('0x64'));logger[_0x836a('0x15')](_0x836a('0x51'),_0x2b2af3['id']);switch(_0x92a712[_0x836a('0x30')]){case _0x836a('0x52'):logger['info'](_0x836a('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x836a('0xe')]('user:%s',_0x427df3[_0x836a('0x37')]),_0x836a('0x56'),{'recordId':_0x2b2af3['id']});break;case _0x836a('0x57'):logger[_0x836a('0x15')](_0x836a('0x53'),_0x836a('0x58'));emit(util[_0x836a('0xe')](_0x836a('0x55'),_0x427df3['name']),_0x836a('0x59'),{'uri':util['format']('%s/agent/tickets/%s',_0x92a712[_0x836a('0x10')],_0x2b2af3['id'])});break;default:logger[_0x836a('0x5b')](_0x836a('0x60'),_0x836a('0x5c'));}}})[_0x836a('0x5d')](function(_0x31cd84){logger[_0x836a('0x5b')]('[OUTBOUND]',JSON[_0x836a('0x19')](_0x31cd84));});};exports[_0x836a('0x65')]=function(_0x57492a,_0x389474,_0x1aab4c,_0x160635,_0x3a2b5d,_0x4ad5cc){var _0x3e58ca,_0x4b913e;_0x4ad5cc[_0x836a('0x10')]=intUtil[_0x836a('0x47')](_0x4ad5cc['remoteUri']);_0x4ad5cc[_0x836a('0x48')]=intUtil[_0x836a('0x47')](_0x4ad5cc[_0x836a('0x48')]);if(_0x3a2b5d&&_0x3a2b5d['monitor_format']){logger[_0x836a('0x15')]('[ABANDONED]',_0x836a('0x49'));_0x389474[_0x836a('0x4a')]=util[_0x836a('0xe')](_0x836a('0x4b'),_0x4ad5cc[_0x836a('0x48')],_0x389474['uniqueid'],md5(_0x389474['uniqueid']));}else{_0x389474[_0x836a('0x4a')]='';}headers[_0x836a('0x61')]=getAuth(_0x4ad5cc);return getUser(_0x4ad5cc)[_0x836a('0x25')](function(_0x494d16){_0x3e58ca=_0x494d16;logger['info']('The\x20User\x20ID\x20is:',_0x3e58ca['id']);return getEndUser(_0x4ad5cc,_0x389474['calleridname'],_0x389474[_0x836a('0x66')]);})[_0x836a('0x25')](function(_0x300d32){_0x4b913e=_0x300d32;logger[_0x836a('0x15')]('The\x20Enduser\x20ID\x20is:',_0x4b913e['id']);return getTicket(_0x4ad5cc,_0x3e58ca,_0x4b913e,_0x1aab4c,_0x389474);})['then'](function(_0x53e58d){if(_0x53e58d){logger[_0x836a('0x15')]('Ticket\x20created!');logger[_0x836a('0x15')](_0x836a('0x51'),_0x53e58d['id']);}})[_0x836a('0x5d')](function(_0x3b92bc){logger['error'](_0x836a('0x67'),JSON[_0x836a('0x19')](_0x3b92bc));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js
index db4a363..ea063cb 100644
--- a/server/services/ami/trigger/integration/dynamics365.js
+++ b/server/services/ami/trigger/integration/dynamics365.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b49=['content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','phonecall','phonecalls','Subjects','callDirection','queue','Fields','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error','inspect','lodash','bluebird','request-promise','./util','md5','ioredis','dynamics365','redis','localhost','socket.io-emitter','POST','remoteUri','username','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','GET','telephone1','contactid',']\x20Enduser\x20created!','enduserId',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','indexOf'];(function(_0x4d886a,_0x1980d3){var _0x3fa895=function(_0x3731f8){while(--_0x3731f8){_0x4d886a['push'](_0x4d886a['shift']());}};_0x3fa895(++_0x1980d3);}(_0x4b49,0xef));var _0x94b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b49[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x94b4('0x0'));var BPromise=require(_0x94b4('0x1'));var rp=require(_0x94b4('0x2'));var util=require('util');var intUtil=require(_0x94b4('0x3'));var md5=require(_0x94b4('0x4'));var Redis=require(_0x94b4('0x5'));var logger=require('../../../../config/logger')(_0x94b4('0x6'));var config=require('../../../../config/environment');config[_0x94b4('0x7')]=_['defaults'](config['redis'],{'host':_0x94b4('0x8'),'port':0x18eb});var io=require(_0x94b4('0x9'))(new Redis(config[_0x94b4('0x7')]));function getAuthToken(_0x26eace,_0x1ff3e2,_0x1ce3ba){var _0x7705ce={'method':_0x94b4('0xa'),'uri':_0x1ff3e2,'form':{'client_id':_0x26eace['clientId'],'resource':_0x26eace[_0x94b4('0xb')],'username':_0x26eace[_0x94b4('0xc')],'password':_0x26eace[_0x94b4('0xd')],'grant_type':'password','client_secret':_0x26eace[_0x94b4('0xe')]},'json':!![]};return rp(_0x7705ce)[_0x94b4('0xf')](function(_0x3a492d){return _0x3a492d[_0x94b4('0x10')];})[_0x94b4('0x11')](function(_0x310147){logger['error']('['+[_0x1ce3ba[_0x94b4('0x12')]()]+_0x94b4('0x13'));return _0x310147[_0x94b4('0x14')];});}function getUser(_0x31b8a6,_0x248df6,_0x404ce8,_0x38057f,_0x5bdce7,_0x519c1c){return new BPromise(function(_0x5e1ed3,_0x5f428e){return getAuthToken(_0x248df6,_0x38057f,_0x519c1c)[_0x94b4('0xf')](function(_0x4c2d2c){var _0x1d8348={'method':'GET','uri':_0x5bdce7+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x94b4('0x15')+_0x4c2d2c,'OData-Version':_0x94b4('0x16')},'json':!![]};return rp(_0x1d8348);})['then'](function(_0x1d5403){var _0x2f4cf5=_0x1d5403[_0x94b4('0x17')];var _0x246a9f=![];var _0x4744b5=null;if(!_[_0x94b4('0x18')](_0x404ce8)){if(intUtil[_0x94b4('0x19')](_0x404ce8[_0x94b4('0x1a')])){_0x31b8a6[_0x94b4('0x1b')]=_0x404ce8['email'];for(_0x4744b5=0x0;_0x4744b5<_0x2f4cf5[_0x94b4('0x1c')];_0x4744b5++){if(_0x2f4cf5[_0x4744b5]['internalemailaddress']===_0x404ce8[_0x94b4('0x1a')]&&!_0x2f4cf5[_0x4744b5]['isdisabled']){_0x246a9f=!![];logger[_0x94b4('0x1d')]('['+[_0x519c1c[_0x94b4('0x12')]()]+_0x94b4('0x1e')+_0x2f4cf5[_0x4744b5][_0x94b4('0x1f')]+'!');_0x31b8a6['userId']=_0x2f4cf5[_0x4744b5][_0x94b4('0x1f')];}}}}if(!_0x246a9f){logger[_0x94b4('0x1d')]('['+[_0x519c1c[_0x94b4('0x12')]()]+_0x94b4('0x20'));_0x31b8a6['userEmail']=_0x248df6['username'];for(_0x4744b5=0x0;_0x4744b5<_0x2f4cf5[_0x94b4('0x1c')];_0x4744b5++){if(_0x2f4cf5[_0x4744b5][_0x94b4('0x21')]===_0x248df6[_0x94b4('0xc')]){_0x31b8a6[_0x94b4('0x22')]=_0x2f4cf5[_0x4744b5]['systemuserid'];}}}_0x5e1ed3(_0x31b8a6);})[_0x94b4('0x11')](function(_0x3d93c4){_0x5f428e(_0x3d93c4[_0x94b4('0x14')]);});});}function createEndUser(_0x50797d,_0x245ddf,_0x4ad4c7,_0x3b3453,_0x247ec8,_0x4bc14d){return new BPromise(function(_0x5bffb0,_0x467301){return getAuthToken(_0x245ddf,_0x4ad4c7,_0x4bc14d)[_0x94b4('0xf')](function(_0x215658){var _0x1f7273=_0x4bc14d[_0x94b4('0x23')]()===_0x94b4('0x24')?_0x247ec8[_0x94b4('0x25')]:_0x247ec8[_0x94b4('0x26')];var _0x44246d={'method':_0x94b4('0xa'),'uri':_0x3b3453+_0x94b4('0x27'),'body':{'telephone1':_0x1f7273,'fullname':_0x1f7273,'firstname':_0x1f7273,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x94b4('0x28')+_0x50797d[_0x94b4('0x22')]+')'},'headers':{'Authorization':_0x94b4('0x15')+_0x215658,'OData-Version':_0x94b4('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x44246d);})[_0x94b4('0xf')](function(_0x4e2b8c){var _0x8487f9=_0x4e2b8c[_0x94b4('0x29')][_0x94b4('0x2a')];var _0x53305d=_0x8487f9[_0x94b4('0x2b')](_0x8487f9['lastIndexOf']('(')+0x1,_0x8487f9[_0x94b4('0x2c')](')'));_0x50797d['enduserId']=_0x53305d;_0x5bffb0(_0x50797d);})['catch'](function(_0x503c3c){_0x467301(_0x503c3c[_0x94b4('0x14')]);});});}function getEndUser(_0x5a6d85,_0xf21fe0,_0x5c02ab,_0x250344,_0xa7a18a,_0x1716e7){return new BPromise(function(_0x4c1107,_0xfaffee){return getAuthToken(_0xf21fe0,_0x5c02ab,_0x1716e7)[_0x94b4('0xf')](function(_0x19be52){var _0x5de553={'method':_0x94b4('0x2d'),'uri':_0x250344+'contacts?$select=telephone1','headers':{'Authorization':'Bearer\x20'+_0x19be52,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5de553);})[_0x94b4('0xf')](function(_0x21e9cb){var _0x301817=null;if(_0x21e9cb){var _0xd9f6a0=_0x21e9cb[_0x94b4('0x17')];var _0x254977=![];for(_0x301817=0x0;_0x301817<_0xd9f6a0[_0x94b4('0x1c')];_0x301817++){var _0x31b84d=_0x1716e7[_0x94b4('0x23')]()===_0x94b4('0x24')?_0xa7a18a[_0x94b4('0x25')]:_0xa7a18a[_0x94b4('0x26')];if(_0xd9f6a0[_0x301817][_0x94b4('0x2e')]===_0x31b84d){_0x254977=!![];_0x5a6d85['enduserId']=_0xd9f6a0[_0x301817][_0x94b4('0x2f')];}}if(_0x254977){_0x4c1107(_0x5a6d85);}else{return createEndUser(_0x5a6d85,_0xf21fe0,_0x5c02ab,_0x250344,_0xa7a18a,_0x1716e7)[_0x94b4('0xf')](function(_0x34aca0){logger[_0x94b4('0x1d')]('['+[_0x1716e7[_0x94b4('0x12')]()]+_0x94b4('0x30'),_0x34aca0[_0x94b4('0x31')]);_0x4c1107(_0x34aca0);});}}else{return createEndUser(_0x5a6d85,_0xf21fe0,_0x5c02ab,_0x250344,_0xa7a18a,_0x1716e7)['then'](function(_0x3089f6){logger['info']('['+[_0x1716e7['toUpperCase']()]+_0x94b4('0x32'),_0x3089f6[_0x94b4('0x31')]);_0x4c1107(_0x3089f6);});}});});}function getCustomFields(_0x1d01c3,_0x19fcbd,_0x591c68){var _0x38ae70={};if(_0x1d01c3['length']>0x0){_[_0x94b4('0x33')](_0x1d01c3,function(_0x388da2){if(_0x388da2[_0x94b4('0x34')]===_0x94b4('0x35')&&_0x388da2[_0x94b4('0x36')]&&!_0x388da2[_0x94b4('0x37')]){var _0x8c9fbe=_0x388da2[_0x94b4('0x38')][_0x94b4('0x23')]();var _0x3f604f=_0x8c9fbe[_0x94b4('0x2b')](0x0,_0x8c9fbe['indexOf']('_'));var _0x2c3e0d=_0x8c9fbe[_0x94b4('0x2b')](_0x8c9fbe[_0x94b4('0x39')]('_')+0x1);if(_0x3f604f===_0x591c68){_0x38ae70[_0x2c3e0d]=_0x388da2[_0x94b4('0x3a')];}}});}return _0x38ae70;}function getTicket(_0x3232bf,_0x7e3c37,_0x13e8d1,_0x15bc00,_0x6a5b59,_0xe61265,_0x5e59bc){return new BPromise(function(_0x46c638,_0x5cb08c){var _0x40110a;return getAuthToken(_0x7e3c37,_0x13e8d1,_0x5e59bc)[_0x94b4('0xf')](function(_0x3d6da2){if(_0xe61265[_0x94b4('0x3b')]===_0x94b4('0x3c')){_0x40110a={'method':_0x94b4('0xa'),'uri':_0x15bc00+_0x94b4('0x3d'),'body':Object[_0x94b4('0x3e')]({},{'title':intUtil[_0x94b4('0x3f')](_0xe61265['Subjects'],_0x6a5b59,'\x20'),'description':intUtil[_0x94b4('0x3f')](_0xe61265[_0x94b4('0x40')],_0x6a5b59,'\x0a'),'customerid_contact@odata.bind':_0x94b4('0x41')+_0x3232bf[_0x94b4('0x31')]+')','ownerid@odata.bind':_0x94b4('0x28')+_0x3232bf['userId']+')','caseorigincode':'1'},getCustomFields(_0xe61265['Fields'],_0x6a5b59,_0xe61265[_0x94b4('0x3b')])),'headers':{'Authorization':'Bearer\x20'+_0x3d6da2,'OData-Version':_0x94b4('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xe61265[_0x94b4('0x3b')]===_0x94b4('0x42')){_0x40110a={'method':_0x94b4('0xa'),'uri':_0x15bc00+_0x94b4('0x43'),'body':Object[_0x94b4('0x3e')]({},{'subject':intUtil[_0x94b4('0x3f')](_0xe61265[_0x94b4('0x44')],_0x6a5b59,'\x20'),'phonenumber':String(_0x6a5b59[_0x94b4('0x26')]),'description':intUtil[_0x94b4('0x3f')](_0xe61265[_0x94b4('0x40')],_0x6a5b59,'\x0a'),'regardingobjectid_contact@odata.bind':_0x94b4('0x41')+_0x3232bf[_0x94b4('0x31')]+')','ownerid@odata.bind':'/systemusers('+_0x3232bf[_0x94b4('0x22')]+')','directioncode':_0x3232bf[_0x94b4('0x45')]===_0x94b4('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x94b4('0x28')+_0x3232bf['userId']+')','participationtypemask':_0x3232bf['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x3232bf[_0x94b4('0x31')]+')','participationtypemask':_0x3232bf[_0x94b4('0x45')]==='queue'?0x1:0x2}]},getCustomFields(_0xe61265[_0x94b4('0x47')],_0x6a5b59,_0xe61265[_0x94b4('0x3b')])),'headers':{'Authorization':_0x94b4('0x15')+_0x3d6da2,'OData-Version':_0x94b4('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x40110a);})[_0x94b4('0xf')](function(_0x1df567){var _0x3fab65=_0x1df567[_0x94b4('0x29')][_0x94b4('0x2a')];var _0x493c6e=_0x3fab65['substring'](_0x3fab65['lastIndexOf']('(')+0x1,_0x3fab65[_0x94b4('0x2c')](')'));_0x3232bf[_0x94b4('0x48')]=_0x493c6e;_0x46c638(_0x3232bf);})[_0x94b4('0x11')](function(_0x52571a){_0x5cb08c(_0x52571a[_0x94b4('0x14')]);});});}function emit(_0x4f5def,_0x3e65f7,_0x375fa9,_0x53adeb){var _0x5c6eba={'uri':util['format'](_0x94b4('0x49'),_0x4f5def,_0x375fa9,_0x53adeb)};io['to'](util[_0x94b4('0x4a')](_0x94b4('0x4b'),_0x3e65f7))['emit'](_0x94b4('0x4c'),_0x5c6eba);}exports['cs']=function(_0x31ac55,_0x4b43eb,_0x300d13,_0x4c530f,_0x5b7ac2,_0x25dfe1,_0x3edc9e,_0x33b66c){var _0x37f57a={};_0x25dfe1[_0x94b4('0xb')]=intUtil[_0x94b4('0x4d')](_0x25dfe1['remoteUri']);_0x25dfe1[_0x94b4('0x4e')]=intUtil[_0x94b4('0x4d')](_0x25dfe1['serverUrl']);_0x37f57a[_0x94b4('0x45')]=_0x33b66c===_0x94b4('0x46')||_0x33b66c===_0x94b4('0x4f')?'queue':'outbound';var _0x275c84=util[_0x94b4('0x4a')]('%s/api/data/v9.0/',_0x25dfe1[_0x94b4('0xb')]);var _0x32190d=util['format'](_0x94b4('0x50'),_0x25dfe1[_0x94b4('0x51')]);var _0x2ea479=util['format'](_0x94b4('0x52'),_0x25dfe1['serverUrl'],_0x4b43eb['uniqueid'],md5(_0x4b43eb[_0x94b4('0x53')]));if(_0x5b7ac2&&_0x5b7ac2['monitor_format']){logger['info'](_0x94b4('0x54'),_0x94b4('0x55'));_0x4b43eb['recordingURL']=_0x2ea479;}else if(_0x3edc9e&&_0x3edc9e[_0x94b4('0x56')]&&_0x3edc9e[_0x94b4('0x56')]!==_0x94b4('0x57')){logger[_0x94b4('0x1d')](_0x94b4('0x58'),'Recording\x20is\x20enabled!');_0x4b43eb['recordingURL']=_0x2ea479;}else{_0x4b43eb['recordingURL']='';}return getUser(_0x37f57a,_0x25dfe1,_0x4c530f,_0x32190d,_0x275c84,_0x33b66c)[_0x94b4('0xf')](function(_0x56d3ce){logger[_0x94b4('0x1d')]('['+_0x33b66c['toUpperCase']()+_0x94b4('0x59'),_0x56d3ce['userId']);logger[_0x94b4('0x1d')]('['+_0x33b66c[_0x94b4('0x12')]()+_0x94b4('0x5a'),_0x56d3ce['userEmail']);return getEndUser(_0x56d3ce,_0x25dfe1,_0x32190d,_0x275c84,_0x4b43eb,_0x33b66c);})[_0x94b4('0xf')](function(_0xd93dfe){logger[_0x94b4('0x1d')]('['+_0x33b66c['toUpperCase']()+_0x94b4('0x5b'),_0xd93dfe[_0x94b4('0x31')]);logger[_0x94b4('0x1d')]('['+_0x33b66c[_0x94b4('0x12')]()+_0x94b4('0x5c'),_0x4b43eb[_0x94b4('0x26')]);return getTicket(_0xd93dfe,_0x25dfe1,_0x32190d,_0x275c84,_0x4b43eb,_0x300d13,_0x33b66c);})[_0x94b4('0xf')](function(_0x54d66f){logger[_0x94b4('0x1d')](util[_0x94b4('0x4a')]('['+_0x33b66c[_0x94b4('0x12')]()+_0x94b4('0x5d'),_0x300d13[_0x94b4('0x3b')],_0x54d66f[_0x94b4('0x48')]));logger[_0x94b4('0x1d')](util['format']('['+_0x33b66c[_0x94b4('0x12')]()+_0x94b4('0x5e'),_0x33b66c));if(_0x33b66c!==_0x94b4('0x4f')){logger[_0x94b4('0x1d')]('['+_0x33b66c['toUpperCase']()+']',_0x94b4('0x5f'));emit(_0x25dfe1['remoteUri'],_0x4c530f[_0x94b4('0x60')],_0x300d13[_0x94b4('0x3b')],_0x54d66f['ticketId']);}})[_0x94b4('0x11')](function(_0xe97df9){logger[_0x94b4('0x61')]('['+_0x33b66c[_0x94b4('0x12')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x94b4('0x62')](_0xe97df9,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x8128=['forEach','type','string','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','Fields','phonecall','Descriptions','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','util','./util','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','clientId','remoteUri','username','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','toLowerCase','POST','contacts','/systemusers(','Bearer\x20','headers','substring','lastIndexOf','enduserId','destcalleridnum','calleridnum','contactid',']\x20Enduser\x20Created!'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x8128,0x1b1));var _0x8812=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8128[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x8812('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var util=require(_0x8812('0x1'));var intUtil=require(_0x8812('0x2'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x8812('0x3'))(_0x8812('0x4'));var config=require(_0x8812('0x5'));config['redis']=_[_0x8812('0x6')](config[_0x8812('0x7')],{'host':_0x8812('0x8'),'port':0x18eb});var io=require(_0x8812('0x9'))(new Redis(config['redis']));function getAuthToken(_0xfdd696,_0x3d030b,_0x4e5012){var _0x51ad6b={'method':'POST','uri':_0x3d030b,'form':{'client_id':_0xfdd696[_0x8812('0xa')],'resource':_0xfdd696[_0x8812('0xb')],'username':_0xfdd696[_0x8812('0xc')],'password':_0xfdd696[_0x8812('0xd')],'grant_type':_0x8812('0xd'),'client_secret':_0xfdd696[_0x8812('0xe')]},'json':!![]};return rp(_0x51ad6b)[_0x8812('0xf')](function(_0x12c0ac){return _0x12c0ac[_0x8812('0x10')];})['catch'](function(_0x15f3bb){logger[_0x8812('0x11')]('['+[_0x4e5012[_0x8812('0x12')]()]+_0x8812('0x13'));return _0x15f3bb[_0x8812('0x14')];});}function getUser(_0x8386f1,_0x53be83,_0x1b1ab2,_0x43bb44,_0x589fd9,_0x557c5c){return new BPromise(function(_0x4b37fa,_0x3de706){return getAuthToken(_0x53be83,_0x43bb44,_0x557c5c)[_0x8812('0xf')](function(_0x554ddb){var _0x50f04c={'method':'GET','uri':_0x589fd9+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x554ddb,'OData-Version':_0x8812('0x15')},'json':!![]};return rp(_0x50f04c);})['then'](function(_0x15acbe){var _0x496daa=_0x15acbe[_0x8812('0x16')];var _0x38a8ad=![];var _0x4ae563=null;if(!_[_0x8812('0x17')](_0x1b1ab2)){if(intUtil[_0x8812('0x18')](_0x1b1ab2[_0x8812('0x19')])){_0x8386f1['userEmail']=_0x1b1ab2['email'];for(_0x4ae563=0x0;_0x4ae563<_0x496daa[_0x8812('0x1a')];_0x4ae563++){if(_0x496daa[_0x4ae563][_0x8812('0x1b')]===_0x1b1ab2[_0x8812('0x19')]&&!_0x496daa[_0x4ae563][_0x8812('0x1c')]){_0x38a8ad=!![];logger[_0x8812('0x1d')]('['+[_0x557c5c[_0x8812('0x12')]()]+']\x20Agent\x20found\x20'+_0x496daa[_0x4ae563][_0x8812('0x1e')]+'!');_0x8386f1[_0x8812('0x1f')]=_0x496daa[_0x4ae563][_0x8812('0x1e')];}}}}if(!_0x38a8ad){logger['info']('['+[_0x557c5c[_0x8812('0x12')]()]+_0x8812('0x20'));_0x8386f1['userEmail']=_0x53be83[_0x8812('0xc')];for(_0x4ae563=0x0;_0x4ae563<_0x496daa['length'];_0x4ae563++){if(_0x496daa[_0x4ae563][_0x8812('0x1b')]===_0x53be83[_0x8812('0xc')]){_0x8386f1[_0x8812('0x1f')]=_0x496daa[_0x4ae563]['systemuserid'];}}}_0x4b37fa(_0x8386f1);})[_0x8812('0x21')](function(_0x1e1a93){_0x3de706(_0x1e1a93[_0x8812('0x14')]);});});}function createEndUser(_0x465f1f,_0x510ad9,_0x477a40,_0x108a0f,_0x2c2420,_0x2015de){return new BPromise(function(_0x31b575,_0xd33f4b){return getAuthToken(_0x510ad9,_0x477a40,_0x2015de)[_0x8812('0xf')](function(_0x117a24){var _0x462baa=_0x2015de[_0x8812('0x22')]()==='outbound'?_0x2c2420['destcalleridnum']:_0x2c2420['calleridnum'];var _0x53b2e1={'method':_0x8812('0x23'),'uri':_0x108a0f+_0x8812('0x24'),'body':{'telephone1':_0x462baa,'fullname':_0x462baa,'firstname':_0x462baa,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8812('0x25')+_0x465f1f[_0x8812('0x1f')]+')'},'headers':{'Authorization':_0x8812('0x26')+_0x117a24,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x53b2e1);})[_0x8812('0xf')](function(_0xef8778){var _0x2ca077=_0xef8778[_0x8812('0x27')]['odata-entityid'];var _0x1c557f=_0x2ca077[_0x8812('0x28')](_0x2ca077[_0x8812('0x29')]('(')+0x1,_0x2ca077[_0x8812('0x29')](')'));_0x465f1f[_0x8812('0x2a')]=_0x1c557f;_0x31b575(_0x465f1f);})[_0x8812('0x21')](function(_0x665c2){_0xd33f4b(_0x665c2['message']);});});}function getEndUser(_0x1a815e,_0x309ca1,_0x453ad6,_0x3cc888,_0x58ee1e,_0x485f56){return new BPromise(function(_0x590792,_0xb4c15c){return getAuthToken(_0x309ca1,_0x453ad6,_0x485f56)[_0x8812('0xf')](function(_0x24ca05){var _0x4e23e5={'method':'GET','uri':_0x3cc888+'contacts?$select=telephone1','headers':{'Authorization':_0x8812('0x26')+_0x24ca05,'If-None-Match':null,'OData-Version':_0x8812('0x15')},'json':!![]};return rp(_0x4e23e5);})['then'](function(_0x326cd0){var _0x12b64b=null;if(_0x326cd0){var _0x107015=_0x326cd0[_0x8812('0x16')];var _0x5c4161=![];for(_0x12b64b=0x0;_0x12b64b<_0x107015[_0x8812('0x1a')];_0x12b64b++){var _0x20659e=_0x485f56['toLowerCase']()==='outbound'?_0x58ee1e[_0x8812('0x2b')]:_0x58ee1e[_0x8812('0x2c')];if(_0x107015[_0x12b64b]['telephone1']===_0x20659e){_0x5c4161=!![];_0x1a815e['enduserId']=_0x107015[_0x12b64b][_0x8812('0x2d')];}}if(_0x5c4161){_0x590792(_0x1a815e);}else{return createEndUser(_0x1a815e,_0x309ca1,_0x453ad6,_0x3cc888,_0x58ee1e,_0x485f56)[_0x8812('0xf')](function(_0x4b29e8){logger[_0x8812('0x1d')]('['+[_0x485f56['toUpperCase']()]+']\x20Enduser\x20created!',_0x4b29e8[_0x8812('0x2a')]);_0x590792(_0x4b29e8);});}}else{return createEndUser(_0x1a815e,_0x309ca1,_0x453ad6,_0x3cc888,_0x58ee1e,_0x485f56)[_0x8812('0xf')](function(_0x1f862b){logger['info']('['+[_0x485f56[_0x8812('0x12')]()]+_0x8812('0x2e'),_0x1f862b[_0x8812('0x2a')]);_0x590792(_0x1f862b);});}});});}function getCustomFields(_0x4de444,_0x567766,_0x1289e1){var _0x415e48={};if(_0x4de444[_0x8812('0x1a')]>0x0){_[_0x8812('0x2f')](_0x4de444,function(_0x56e5aa){if(_0x56e5aa[_0x8812('0x30')]===_0x8812('0x31')&&_0x56e5aa[_0x8812('0x32')]&&!_0x56e5aa[_0x8812('0x33')]){var _0x40894d=_0x56e5aa[_0x8812('0x34')][_0x8812('0x22')]();var _0x3806da=_0x40894d['substring'](0x0,_0x40894d['indexOf']('_'));var _0x475aca=_0x40894d['substring'](_0x40894d[_0x8812('0x35')]('_')+0x1);if(_0x3806da===_0x1289e1){_0x415e48[_0x475aca]=_0x56e5aa[_0x8812('0x36')];}}});}return _0x415e48;}function getTicket(_0x2dfbe5,_0xae3c9e,_0x3f4e4e,_0x2e4f16,_0x50eda0,_0x3e7bc0,_0x5e9af9){return new BPromise(function(_0x2f3637,_0xfff9cb){var _0x106b50;return getAuthToken(_0xae3c9e,_0x3f4e4e,_0x5e9af9)[_0x8812('0xf')](function(_0x1dc070){if(_0x3e7bc0[_0x8812('0x37')]===_0x8812('0x38')){_0x106b50={'method':_0x8812('0x23'),'uri':_0x2e4f16+_0x8812('0x39'),'body':Object[_0x8812('0x3a')]({},{'title':intUtil[_0x8812('0x3b')](_0x3e7bc0[_0x8812('0x3c')],_0x50eda0,'\x20'),'description':intUtil[_0x8812('0x3b')](_0x3e7bc0['Descriptions'],_0x50eda0,'\x0a'),'customerid_contact@odata.bind':_0x8812('0x3d')+_0x2dfbe5['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x2dfbe5[_0x8812('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x3e7bc0[_0x8812('0x3e')],_0x50eda0,_0x3e7bc0[_0x8812('0x37')])),'headers':{'Authorization':_0x8812('0x26')+_0x1dc070,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3e7bc0['ticketType']===_0x8812('0x3f')){_0x106b50={'method':_0x8812('0x23'),'uri':_0x2e4f16+'phonecalls','body':Object[_0x8812('0x3a')]({},{'subject':intUtil['getString'](_0x3e7bc0['Subjects'],_0x50eda0,'\x20'),'phonenumber':String(_0x50eda0['calleridnum']),'description':intUtil[_0x8812('0x3b')](_0x3e7bc0[_0x8812('0x40')],_0x50eda0,'\x0a'),'regardingobjectid_contact@odata.bind':_0x8812('0x3d')+_0x2dfbe5['enduserId']+')','ownerid@odata.bind':_0x8812('0x25')+_0x2dfbe5['userId']+')','directioncode':_0x2dfbe5[_0x8812('0x41')]===_0x8812('0x42')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2dfbe5[_0x8812('0x1f')]+')','participationtypemask':_0x2dfbe5[_0x8812('0x41')]===_0x8812('0x42')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x2dfbe5[_0x8812('0x2a')]+')','participationtypemask':_0x2dfbe5[_0x8812('0x41')]===_0x8812('0x42')?0x1:0x2}]},getCustomFields(_0x3e7bc0['Fields'],_0x50eda0,_0x3e7bc0[_0x8812('0x37')])),'headers':{'Authorization':'Bearer\x20'+_0x1dc070,'OData-Version':_0x8812('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x106b50);})[_0x8812('0xf')](function(_0x43d054){var _0x16ef4c=_0x43d054[_0x8812('0x27')]['odata-entityid'];var _0x420b60=_0x16ef4c[_0x8812('0x28')](_0x16ef4c[_0x8812('0x29')]('(')+0x1,_0x16ef4c[_0x8812('0x29')](')'));_0x2dfbe5['ticketId']=_0x420b60;_0x2f3637(_0x2dfbe5);})[_0x8812('0x21')](function(_0x1058a8){_0xfff9cb(_0x1058a8[_0x8812('0x14')]);});});}function emit(_0x41e34d,_0x6054e2,_0x4b8418,_0x3a2d30){var _0x272119={'uri':util[_0x8812('0x43')](_0x8812('0x44'),_0x41e34d,_0x4b8418,_0x3a2d30)};io['to'](util[_0x8812('0x43')]('user:%s',_0x6054e2))[_0x8812('0x45')](_0x8812('0x46'),_0x272119);}exports['cs']=function(_0x42b0d8,_0x242dc9,_0x4f904c,_0x4e0324,_0x3f68e3,_0x262387,_0x479c6a,_0x17111b){var _0x40a719={};_0x262387[_0x8812('0xb')]=intUtil[_0x8812('0x47')](_0x262387[_0x8812('0xb')]);_0x262387[_0x8812('0x48')]=intUtil[_0x8812('0x47')](_0x262387[_0x8812('0x48')]);_0x40a719[_0x8812('0x41')]=_0x17111b==='queue'||_0x17111b===_0x8812('0x49')?_0x8812('0x42'):'outbound';var _0x170e05=util[_0x8812('0x43')]('%s/api/data/v9.0/',_0x262387['remoteUri']);var _0x584884=util[_0x8812('0x43')](_0x8812('0x4a'),_0x262387['tenantId']);var _0x5da59b=util[_0x8812('0x43')](_0x8812('0x4b'),_0x262387[_0x8812('0x48')],_0x242dc9[_0x8812('0x4c')],md5(_0x242dc9['uniqueid']));if(_0x3f68e3&&_0x3f68e3[_0x8812('0x4d')]){logger['info'](_0x8812('0x4e'),_0x8812('0x4f'));_0x242dc9[_0x8812('0x50')]=_0x5da59b;}else if(_0x479c6a&&_0x479c6a[_0x8812('0x51')]&&_0x479c6a[_0x8812('0x51')]!==_0x8812('0x52')){logger[_0x8812('0x1d')](_0x8812('0x53'),'Recording\x20is\x20enabled!');_0x242dc9[_0x8812('0x50')]=_0x5da59b;}else{_0x242dc9[_0x8812('0x50')]='';}return getUser(_0x40a719,_0x262387,_0x4e0324,_0x584884,_0x170e05,_0x17111b)['then'](function(_0x574076){logger[_0x8812('0x1d')]('['+_0x17111b[_0x8812('0x12')]()+_0x8812('0x54'),_0x574076[_0x8812('0x1f')]);logger[_0x8812('0x1d')]('['+_0x17111b[_0x8812('0x12')]()+_0x8812('0x55'),_0x574076[_0x8812('0x56')]);return getEndUser(_0x574076,_0x262387,_0x584884,_0x170e05,_0x242dc9,_0x17111b);})[_0x8812('0xf')](function(_0x2549fb){logger[_0x8812('0x1d')]('['+_0x17111b['toUpperCase']()+_0x8812('0x57'),_0x2549fb['enduserId']);logger[_0x8812('0x1d')]('['+_0x17111b[_0x8812('0x12')]()+_0x8812('0x58'),_0x242dc9[_0x8812('0x2c')]);return getTicket(_0x2549fb,_0x262387,_0x584884,_0x170e05,_0x242dc9,_0x4f904c,_0x17111b);})[_0x8812('0xf')](function(_0x194a7e){logger[_0x8812('0x1d')](util[_0x8812('0x43')]('['+_0x17111b[_0x8812('0x12')]()+_0x8812('0x59'),_0x4f904c[_0x8812('0x37')],_0x194a7e[_0x8812('0x5a')]));logger['info'](util[_0x8812('0x43')]('['+_0x17111b[_0x8812('0x12')]()+_0x8812('0x5b'),_0x17111b));if(_0x17111b!=='abandoned'){logger[_0x8812('0x1d')]('['+_0x17111b[_0x8812('0x12')]()+']',_0x8812('0x5c'));emit(_0x262387[_0x8812('0xb')],_0x4e0324[_0x8812('0x5d')],_0x4f904c['ticketType'],_0x194a7e[_0x8812('0x5a')]);}})[_0x8812('0x21')](function(_0x538963){logger[_0x8812('0x11')]('['+_0x17111b['toUpperCase']()+_0x8812('0x5e'),util[_0x8812('0x5f')](_0x538963,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js
index 16d0fe3..66e7c03 100644
--- a/server/services/ami/trigger/integration/freshdesk.js
+++ b/server/services/ami/trigger/integration/freshdesk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1e71=['POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','toString','base64','[HTTP]','GET','map','forEach','string','toLowerCase','content','type','idField','customField','push','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','stringify','abandoned','md5','util','ioredis','./util','../../../../config/logger','freshdesk','defaults','redis','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Subjects','Descriptions',' ','Tags','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri'];(function(_0x37cdd4,_0x57c7b9){var _0x167bb1=function(_0xbbc6f2){while(--_0xbbc6f2){_0x37cdd4['push'](_0x37cdd4['shift']());}};_0x167bb1(++_0x57c7b9);}(_0x1e71,0x194));var _0x11e7=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x1e71[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x11e7('0x0'));var util=require(_0x11e7('0x1'));var Redis=require(_0x11e7('0x2'));var intUtil=require(_0x11e7('0x3'));var config=require('../../../../config/environment');var logger=require(_0x11e7('0x4'))(_0x11e7('0x5'));config['redis']=_[_0x11e7('0x6')](config[_0x11e7('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x11e7('0x8'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x156a6d,_0x87127f,_0x3820ab){io['to'](_0x156a6d)[_0x11e7('0x9')](_0x87127f,_0x3820ab);}function getTicket(_0x84bfe6,_0x5c319c,_0x3ff14b,_0x334e4a,_0x7d5add){logger[_0x11e7('0xa')](_0x11e7('0xb'));var _0x3a19f2=_[_0x11e7('0xc')]({'responder_id':_0x5c319c['id'],'requester_id':_0x3ff14b['id'],'name':util[_0x11e7('0xd')]('Caller\x20-\x20%s',_0x7d5add['calleridname']),'phone':_0x7d5add[_0x11e7('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x11e7('0xf')](_0x334e4a[_0x11e7('0x10')],_0x7d5add,'\x20'),'description':intUtil[_0x11e7('0xf')](_0x334e4a[_0x11e7('0x11')],_0x7d5add,_0x11e7('0x12')),'tags':getTags(_0x334e4a[_0x11e7('0x13')],'name')},getCustomFields(_0x334e4a[_0x11e7('0x14')],_0x7d5add));_0x3a19f2[_0x11e7('0x15')]=_[_0x11e7('0x16')](_[_0x11e7('0x17')](_0x3a19f2['custom_fields'],'id'),'value');return request({'uri':util[_0x11e7('0xd')](_0x11e7('0x18'),_0x84bfe6[_0x11e7('0x19')]),'method':_0x11e7('0x1a'),'body':_0x3a19f2})[_0x11e7('0x1b')](function(_0x502c73){logger[_0x11e7('0xa')](_0x11e7('0x1c'));return _0x502c73;});}function getUser(_0x3b3353,_0x283031){if(intUtil['validateEmail'](_0x283031)){return request({'uri':util[_0x11e7('0xd')](_0x11e7('0x1d'),_0x3b3353[_0x11e7('0x19')]),'qs':{'email':_0x283031}})[_0x11e7('0x1b')](function(_0x435c30){if(_0x435c30[_0x11e7('0x1e')]){logger['info'](_0x11e7('0x1f'));return _[_0x11e7('0x20')](_0x435c30,function(_0x2ba3fb){return _0x2ba3fb[_0x11e7('0x21')][_0x11e7('0x22')]===_0x283031;});}else{logger[_0x11e7('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x11e7('0xd')](_0x11e7('0x23'),_0x3b3353['remoteUri'])})[_0x11e7('0x1b')](function(_0x529a60){logger[_0x11e7('0xa')](_0x11e7('0x24'));return _0x529a60;});}});}else{logger[_0x11e7('0xa')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x11e7('0xd')]('%s/api/v2/agents/me',_0x3b3353[_0x11e7('0x19')])})[_0x11e7('0x1b')](function(_0x439f25){logger['info'](_0x11e7('0x24'));return _0x439f25;});}}function getEndUser(_0x39b53d,_0x5285be,_0x18bbe2){logger[_0x11e7('0xa')](_0x11e7('0x25'),_0x18bbe2);return request({'uri':util[_0x11e7('0xd')](_0x11e7('0x26'),_0x39b53d[_0x11e7('0x19')]),'qs':{'phone':_0x18bbe2}})[_0x11e7('0x1b')](function(_0x10b9ad){if(_0x10b9ad['length']){logger[_0x11e7('0xa')]('Enduser\x20found!');return _[_0x11e7('0x20')](_0x10b9ad,{'phone':_0x18bbe2});}else{logger[_0x11e7('0xa')](_0x11e7('0x27'));return request({'uri':util['format'](_0x11e7('0x26'),_0x39b53d[_0x11e7('0x19')]),'method':_0x11e7('0x1a'),'body':{'name':_0x5285be,'phone':_0x18bbe2}})[_0x11e7('0x1b')](function(_0x43bccb){logger[_0x11e7('0xa')]('Enduser\x20created.');return _0x43bccb;});}});}function getAuth(_0x37ea00){return util[_0x11e7('0xd')]('Basic\x20%s',new Buffer(_0x37ea00[_0x11e7('0x28')]+':X')[_0x11e7('0x29')](_0x11e7('0x2a')));}function request(_0x3b96b0){logger['debug'](_0x11e7('0x2b'),JSON['stringify'](_0x3b96b0));return rp(_[_0x11e7('0x6')](_0x3b96b0,{'method':_0x11e7('0x2c'),'headers':headers,'json':!![]}));}function getTags(_0x31f192,_0x18f9a5){var _0x4f7e87=[];if(_0x31f192&&_0x31f192[_0x11e7('0x1e')]>0x0){_0x4f7e87=_[_0x11e7('0x2d')](_0x31f192,_0x18f9a5);}return _0x4f7e87;}function getCustomFields(_0x4ea26d,_0x191a47){var _0x3f8a0c=[];var _0x4b1d57={'custom_fields':[]};if(_0x4ea26d[_0x11e7('0x1e')]>0x0){_[_0x11e7('0x2e')](_0x4ea26d,function(_0x53c6fa){if(_0x53c6fa['type']===_0x11e7('0x2f')&&_0x53c6fa['nameField']&&!_0x53c6fa['customField']){_0x4b1d57[_0x53c6fa['nameField'][_0x11e7('0x30')]()]=_0x53c6fa[_0x11e7('0x31')][_0x11e7('0x29')]();}else if(_0x53c6fa[_0x11e7('0x32')]===_0x11e7('0x2f')&&_0x53c6fa[_0x11e7('0x33')]&&_0x53c6fa[_0x11e7('0x34')]){_0x4b1d57['custom_fields'][_0x11e7('0x35')]({'id':_0x53c6fa[_0x11e7('0x33')],'value':_0x53c6fa[_0x11e7('0x31')][_0x11e7('0x29')]()});}else if(_0x53c6fa[_0x11e7('0x32')]==='variable'&&_0x53c6fa[_0x11e7('0x36')]&&_0x53c6fa[_0x11e7('0x33')]&&_0x53c6fa[_0x11e7('0x34')]){_0x191a47[_0x53c6fa[_0x11e7('0x36')]]&&_0x4b1d57[_0x11e7('0x15')][_0x11e7('0x35')]({'id':_0x53c6fa[_0x11e7('0x33')],'value':_0x191a47[_0x53c6fa[_0x11e7('0x36')]]['toString']()});}else if(_0x53c6fa[_0x11e7('0x32')]===_0x11e7('0x37')&&_0x53c6fa[_0x11e7('0x38')]&&_0x53c6fa['Variable'][_0x11e7('0x39')]&&_0x53c6fa[_0x11e7('0x33')]&&_0x53c6fa['customField']){_0x191a47[_0x53c6fa[_0x11e7('0x38')][_0x11e7('0x39')][_0x11e7('0x30')]()]&&_0x4b1d57['custom_fields'][_0x11e7('0x35')]({'id':_0x53c6fa[_0x11e7('0x33')],'value':_0x191a47[_0x53c6fa[_0x11e7('0x38')][_0x11e7('0x39')][_0x11e7('0x30')]()][_0x11e7('0x29')]()});}});}return _0x4b1d57;}exports[_0x11e7('0x3a')]=function(_0x5340ee,_0x1b1181,_0x1ab493,_0x37ca88,_0x47e699,_0xc646c0){var _0x2ee2c9,_0x76df71;_0xc646c0[_0x11e7('0x19')]=intUtil[_0x11e7('0x3b')](_0xc646c0[_0x11e7('0x19')]);_0xc646c0[_0x11e7('0x3c')]=intUtil['stripTrailingSlash'](_0xc646c0[_0x11e7('0x3c')]);if(_0x47e699&&_0x47e699[_0x11e7('0x3d')]){logger['info'](_0x11e7('0x3e'),_0x11e7('0x3f'));_0x1b1181['recordingURL']=util['format'](_0x11e7('0x40'),_0xc646c0['serverUrl'],_0x1b1181[_0x11e7('0x41')],md5(_0x1b1181[_0x11e7('0x41')]));}else{_0x1b1181[_0x11e7('0x42')]='';}headers['Authorization']=getAuth(_0xc646c0);return getUser(_0xc646c0,_0x37ca88['email'])[_0x11e7('0x1b')](function(_0x2ee7b5){_0x2ee2c9=_0x2ee7b5;logger[_0x11e7('0xa')](_0x11e7('0x43'),_0x2ee2c9['id']);return getEndUser(_0xc646c0,_0x1b1181[_0x11e7('0x44')],_0x1b1181[_0x11e7('0xe')]);})[_0x11e7('0x1b')](function(_0x55f640){_0x76df71=_0x55f640;logger[_0x11e7('0xa')]('The\x20Enduser\x20ID\x20is:',_0x76df71['id']);return getTicket(_0xc646c0,_0x2ee2c9,_0x76df71,_0x1ab493,_0x1b1181);})[_0x11e7('0x1b')](function(_0x291555){if(_0x291555&&_0x291555['id']){logger[_0x11e7('0xa')](_0x11e7('0x1c'));logger[_0x11e7('0xa')](_0x11e7('0x45'),_0x291555['id']);logger[_0x11e7('0xa')](_0x11e7('0x3e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x11e7('0xd')](_0x11e7('0x46'),_0x37ca88[_0x11e7('0x39')]),_0x11e7('0x47'),{'uri':util[_0x11e7('0xd')](_0x11e7('0x48'),_0xc646c0['remoteUri'],_0x291555['id'])});}})['catch'](function(_0x581077){logger[_0x11e7('0x49')](_0x11e7('0x3e'),JSON['stringify'](_0x581077));});};exports[_0x11e7('0x4a')]=function(_0x40b829,_0x1d0dfa,_0x3ba97f,_0x12626b,_0x57859c,_0x58d984,_0x383a99){var _0xbc03a7,_0x1f2303;_0x58d984['remoteUri']=intUtil['stripTrailingSlash'](_0x58d984[_0x11e7('0x19')]);_0x58d984[_0x11e7('0x3c')]=intUtil['stripTrailingSlash'](_0x58d984['serverUrl']);if(_0x383a99&&_0x383a99[_0x11e7('0x4b')]&&_0x383a99[_0x11e7('0x4b')]!==_0x11e7('0x4c')){logger[_0x11e7('0xa')](_0x11e7('0x4d'),_0x11e7('0x3f'));_0x1d0dfa['recordingURL']=util['format'](_0x11e7('0x40'),_0x58d984[_0x11e7('0x3c')],_0x1d0dfa['uniqueid'],md5(_0x1d0dfa[_0x11e7('0x41')]));}headers[_0x11e7('0x4e')]=getAuth(_0x58d984);return getUser(_0x58d984,_0x12626b[_0x11e7('0x22')])[_0x11e7('0x1b')](function(_0xd2b63f){_0xbc03a7=_0xd2b63f;logger[_0x11e7('0xa')](_0x11e7('0x43'),_0xbc03a7['id']);return getEndUser(_0x58d984,_0x1d0dfa[_0x11e7('0x4f')],_0x1d0dfa[_0x11e7('0x50')]);})['then'](function(_0x4cc8a8){_0x1f2303=_0x4cc8a8;logger['info'](_0x11e7('0x51'),_0x1f2303['id']);return getTicket(_0x58d984,_0xbc03a7,_0x1f2303,_0x3ba97f,_0x1d0dfa);})['then'](function(_0x298715){if(_0x298715&&_0x298715['id']){logger[_0x11e7('0xa')](_0x11e7('0x1c'));logger[_0x11e7('0xa')]('The\x20Ticket\x20ID\x20is:',_0x298715['id']);logger['info']('[OUTBOUND]',_0x11e7('0x52'));emit(util[_0x11e7('0xd')](_0x11e7('0x46'),_0x12626b[_0x11e7('0x39')]),_0x11e7('0x47'),{'uri':util['format'](_0x11e7('0x48'),_0x58d984['remoteUri'],_0x298715['id'])});}})[_0x11e7('0x53')](function(_0x596745){logger[_0x11e7('0x49')](_0x11e7('0x4d'),JSON[_0x11e7('0x54')](_0x596745));});};exports[_0x11e7('0x55')]=function(_0x585055,_0xe08b3b,_0x34ba58,_0x3223ef,_0x2da851,_0x1b743d){var _0x2d63d8,_0x3a9741;_0x1b743d[_0x11e7('0x19')]=intUtil['stripTrailingSlash'](_0x1b743d['remoteUri']);_0x1b743d[_0x11e7('0x3c')]=intUtil['stripTrailingSlash'](_0x1b743d['serverUrl']);if(_0x2da851&&_0x2da851[_0x11e7('0x3d')]){logger[_0x11e7('0xa')]('[ABANDONED]',_0x11e7('0x3f'));_0xe08b3b['recordingURL']=util['format'](_0x11e7('0x40'),_0x1b743d[_0x11e7('0x3c')],_0xe08b3b[_0x11e7('0x41')],md5(_0xe08b3b['uniqueid']));}else{_0xe08b3b[_0x11e7('0x42')]='';}headers[_0x11e7('0x4e')]=getAuth(_0x1b743d);return getUser(_0x1b743d,'')[_0x11e7('0x1b')](function(_0x57c26a){_0x2d63d8=_0x57c26a;logger[_0x11e7('0xa')](_0x11e7('0x43'),_0x2d63d8['id']);return getEndUser(_0x1b743d,_0xe08b3b[_0x11e7('0x44')],_0xe08b3b[_0x11e7('0xe')]);})[_0x11e7('0x1b')](function(_0x346444){_0x3a9741=_0x346444;logger['info'](_0x11e7('0x51'),_0x3a9741['id']);return getTicket(_0x1b743d,_0x2d63d8,_0x3a9741,_0x34ba58,_0xe08b3b);})[_0x11e7('0x1b')](function(_0x1ec158){if(_0x1ec158){logger[_0x11e7('0xa')]('Ticket\x20created!');logger['info'](_0x11e7('0x45'),_0x1ec158['id']);}})[_0x11e7('0x53')](function(_0x417b92){logger['error']('[ABANDONED]',JSON['stringify'](_0x417b92));});};
\ No newline at end of file
+var _0x284b=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','abandoned','[ABANDONED]','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','Creating\x20new\x20ticket...','format','calleridname','getString','Tags','name','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri','then','info','Ticket\x20created!','%s/api/v2/agents','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','GET','map','forEach','type','nameField','content','string','idField','push','variable','variableName','customVariable','Variable','customField','toLowerCase','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x18a1c9,_0x56df18){var _0x42cf22=function(_0x116895){while(--_0x116895){_0x18a1c9['push'](_0x18a1c9['shift']());}};_0x42cf22(++_0x56df18);}(_0x284b,0x72));var _0xb284=function(_0x4248c6,_0x550559){_0x4248c6=_0x4248c6-0x0;var _0x4bb031=_0x284b[_0x4248c6];return _0x4bb031;};'use strict';var _=require('lodash');var rp=require(_0xb284('0x0'));var md5=require(_0xb284('0x1'));var util=require(_0xb284('0x2'));var Redis=require(_0xb284('0x3'));var intUtil=require(_0xb284('0x4'));var config=require(_0xb284('0x5'));var logger=require(_0xb284('0x6'))(_0xb284('0x7'));config[_0xb284('0x8')]=_[_0xb284('0x9')](config[_0xb284('0x8')],{'host':_0xb284('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0xb284('0xb'),'Accept':_0xb284('0xb')};function emit(_0x705d35,_0x408420,_0x172b5d){io['to'](_0x705d35)[_0xb284('0xc')](_0x408420,_0x172b5d);}function getTicket(_0x4f5da4,_0x5f08b1,_0x5bf940,_0x4b0091,_0x2433c7){logger['info'](_0xb284('0xd'));var _0x11e5a5=_['merge']({'responder_id':_0x5f08b1['id'],'requester_id':_0x5bf940['id'],'name':util[_0xb284('0xe')]('Caller\x20-\x20%s',_0x2433c7[_0xb284('0xf')]),'phone':_0x2433c7['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x4b0091['Subjects'],_0x2433c7,'\x20'),'description':intUtil[_0xb284('0x10')](_0x4b0091['Descriptions'],_0x2433c7,' '),'tags':getTags(_0x4b0091[_0xb284('0x11')],_0xb284('0x12'))},getCustomFields(_0x4b0091['Fields'],_0x2433c7));_0x11e5a5[_0xb284('0x13')]=_[_0xb284('0x14')](_['keyBy'](_0x11e5a5[_0xb284('0x13')],'id'),_0xb284('0x15'));return request({'uri':util[_0xb284('0xe')](_0xb284('0x16'),_0x4f5da4[_0xb284('0x17')]),'method':'POST','body':_0x11e5a5})[_0xb284('0x18')](function(_0x2172a3){logger[_0xb284('0x19')](_0xb284('0x1a'));return _0x2172a3;});}function getUser(_0xfd7855,_0x195696){if(intUtil['validateEmail'](_0x195696)){return request({'uri':util['format'](_0xb284('0x1b'),_0xfd7855[_0xb284('0x17')]),'qs':{'email':_0x195696}})[_0xb284('0x18')](function(_0x3ca9e2){if(_0x3ca9e2[_0xb284('0x1c')]){logger['info']('Agent\x20found!');return _[_0xb284('0x1d')](_0x3ca9e2,function(_0x3833e4){return _0x3833e4[_0xb284('0x1e')]['email']===_0x195696;});}else{logger[_0xb284('0x19')](_0xb284('0x1f'));return request({'uri':util[_0xb284('0xe')](_0xb284('0x20'),_0xfd7855[_0xb284('0x17')])})['then'](function(_0x27cfab){logger[_0xb284('0x19')]('Admin\x20account\x20selected.');return _0x27cfab;});}});}else{logger[_0xb284('0x19')](_0xb284('0x21'));return request({'uri':util['format']('%s/api/v2/agents/me',_0xfd7855['remoteUri'])})[_0xb284('0x18')](function(_0x2501fe){logger[_0xb284('0x19')](_0xb284('0x22'));return _0x2501fe;});}}function getEndUser(_0x3a36d2,_0x23b3d0,_0x1edb16){logger[_0xb284('0x19')](_0xb284('0x23'),_0x1edb16);return request({'uri':util['format'](_0xb284('0x24'),_0x3a36d2['remoteUri']),'qs':{'phone':_0x1edb16}})[_0xb284('0x18')](function(_0x2cd560){if(_0x2cd560[_0xb284('0x1c')]){logger[_0xb284('0x19')](_0xb284('0x25'));return _[_0xb284('0x1d')](_0x2cd560,{'phone':_0x1edb16});}else{logger[_0xb284('0x19')](_0xb284('0x26'));return request({'uri':util[_0xb284('0xe')](_0xb284('0x24'),_0x3a36d2['remoteUri']),'method':_0xb284('0x27'),'body':{'name':_0x23b3d0,'phone':_0x1edb16}})[_0xb284('0x18')](function(_0x4db790){logger[_0xb284('0x19')](_0xb284('0x28'));return _0x4db790;});}});}function getAuth(_0x53c670){return util[_0xb284('0xe')](_0xb284('0x29'),new Buffer(_0x53c670[_0xb284('0x2a')]+':X')[_0xb284('0x2b')](_0xb284('0x2c')));}function request(_0x49a9e5){logger[_0xb284('0x2d')]('[HTTP]',JSON['stringify'](_0x49a9e5));return rp(_[_0xb284('0x9')](_0x49a9e5,{'method':_0xb284('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x5d376b,_0x2fb17e){var _0x1a561d=[];if(_0x5d376b&&_0x5d376b[_0xb284('0x1c')]>0x0){_0x1a561d=_[_0xb284('0x2f')](_0x5d376b,_0x2fb17e);}return _0x1a561d;}function getCustomFields(_0x579d0b,_0x204e8f){var _0x17d3bb=[];var _0x5f57a1={'custom_fields':[]};if(_0x579d0b[_0xb284('0x1c')]>0x0){_[_0xb284('0x30')](_0x579d0b,function(_0x540ea5){if(_0x540ea5[_0xb284('0x31')]==='string'&&_0x540ea5[_0xb284('0x32')]&&!_0x540ea5['customField']){_0x5f57a1[_0x540ea5['nameField']['toLowerCase']()]=_0x540ea5[_0xb284('0x33')]['toString']();}else if(_0x540ea5[_0xb284('0x31')]===_0xb284('0x34')&&_0x540ea5[_0xb284('0x35')]&&_0x540ea5['customField']){_0x5f57a1[_0xb284('0x13')][_0xb284('0x36')]({'id':_0x540ea5['idField'],'value':_0x540ea5['content']['toString']()});}else if(_0x540ea5['type']===_0xb284('0x37')&&_0x540ea5['variableName']&&_0x540ea5[_0xb284('0x35')]&&_0x540ea5['customField']){_0x204e8f[_0x540ea5[_0xb284('0x38')]]&&_0x5f57a1[_0xb284('0x13')]['push']({'id':_0x540ea5[_0xb284('0x35')],'value':_0x204e8f[_0x540ea5['variableName']][_0xb284('0x2b')]()});}else if(_0x540ea5[_0xb284('0x31')]===_0xb284('0x39')&&_0x540ea5[_0xb284('0x3a')]&&_0x540ea5[_0xb284('0x3a')][_0xb284('0x12')]&&_0x540ea5[_0xb284('0x35')]&&_0x540ea5[_0xb284('0x3b')]){_0x204e8f[_0x540ea5['Variable'][_0xb284('0x12')][_0xb284('0x3c')]()]&&_0x5f57a1[_0xb284('0x13')][_0xb284('0x36')]({'id':_0x540ea5[_0xb284('0x35')],'value':_0x204e8f[_0x540ea5[_0xb284('0x3a')][_0xb284('0x12')][_0xb284('0x3c')]()][_0xb284('0x2b')]()});}});}return _0x5f57a1;}exports[_0xb284('0x3d')]=function(_0x28aaca,_0x34c260,_0x5bf71e,_0x3f87e1,_0xbbeb13,_0x3fe86d){var _0x447cef,_0xfb74a3;_0x3fe86d['remoteUri']=intUtil[_0xb284('0x3e')](_0x3fe86d['remoteUri']);_0x3fe86d['serverUrl']=intUtil[_0xb284('0x3e')](_0x3fe86d['serverUrl']);if(_0xbbeb13&&_0xbbeb13[_0xb284('0x3f')]){logger[_0xb284('0x19')](_0xb284('0x40'),_0xb284('0x41'));_0x34c260[_0xb284('0x42')]=util[_0xb284('0xe')](_0xb284('0x43'),_0x3fe86d[_0xb284('0x44')],_0x34c260['uniqueid'],md5(_0x34c260[_0xb284('0x45')]));}else{_0x34c260[_0xb284('0x42')]='';}headers[_0xb284('0x46')]=getAuth(_0x3fe86d);return getUser(_0x3fe86d,_0x3f87e1[_0xb284('0x47')])[_0xb284('0x18')](function(_0x58ece9){_0x447cef=_0x58ece9;logger[_0xb284('0x19')](_0xb284('0x48'),_0x447cef['id']);return getEndUser(_0x3fe86d,_0x34c260[_0xb284('0xf')],_0x34c260[_0xb284('0x49')]);})[_0xb284('0x18')](function(_0x560857){_0xfb74a3=_0x560857;logger[_0xb284('0x19')](_0xb284('0x4a'),_0xfb74a3['id']);return getTicket(_0x3fe86d,_0x447cef,_0xfb74a3,_0x5bf71e,_0x34c260);})[_0xb284('0x18')](function(_0x5f4d08){if(_0x5f4d08&&_0x5f4d08['id']){logger[_0xb284('0x19')](_0xb284('0x1a'));logger['info'](_0xb284('0x4b'),_0x5f4d08['id']);logger[_0xb284('0x19')](_0xb284('0x40'),_0xb284('0x4c'));emit(util['format'](_0xb284('0x4d'),_0x3f87e1[_0xb284('0x12')]),_0xb284('0x4e'),{'uri':util['format'](_0xb284('0x4f'),_0x3fe86d[_0xb284('0x17')],_0x5f4d08['id'])});}})[_0xb284('0x50')](function(_0x382f66){logger[_0xb284('0x51')](_0xb284('0x40'),JSON[_0xb284('0x52')](_0x382f66));});};exports[_0xb284('0x53')]=function(_0x43ef8e,_0x120f67,_0x148554,_0x1f08b5,_0x3a040c,_0x4c7791,_0x22bae6){var _0x7a9f1c,_0x75720f;_0x4c7791[_0xb284('0x17')]=intUtil[_0xb284('0x3e')](_0x4c7791[_0xb284('0x17')]);_0x4c7791[_0xb284('0x44')]=intUtil[_0xb284('0x3e')](_0x4c7791[_0xb284('0x44')]);if(_0x22bae6&&_0x22bae6[_0xb284('0x54')]&&_0x22bae6['recordingFormat']!=='none'){logger['info'](_0xb284('0x55'),'Recording\x20is\x20enabled!');_0x120f67[_0xb284('0x42')]=util[_0xb284('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4c7791[_0xb284('0x44')],_0x120f67[_0xb284('0x45')],md5(_0x120f67[_0xb284('0x45')]));}headers[_0xb284('0x46')]=getAuth(_0x4c7791);return getUser(_0x4c7791,_0x1f08b5['email'])['then'](function(_0x2a4b76){_0x7a9f1c=_0x2a4b76;logger['info']('The\x20User\x20ID\x20is:',_0x7a9f1c['id']);return getEndUser(_0x4c7791,_0x120f67[_0xb284('0x56')],_0x120f67[_0xb284('0x57')]);})[_0xb284('0x18')](function(_0x5302c7){_0x75720f=_0x5302c7;logger['info'](_0xb284('0x4a'),_0x75720f['id']);return getTicket(_0x4c7791,_0x7a9f1c,_0x75720f,_0x148554,_0x120f67);})[_0xb284('0x18')](function(_0x51f92b){if(_0x51f92b&&_0x51f92b['id']){logger['info']('Ticket\x20created!');logger['info'](_0xb284('0x4b'),_0x51f92b['id']);logger['info'](_0xb284('0x55'),_0xb284('0x4c'));emit(util['format'](_0xb284('0x4d'),_0x1f08b5['name']),_0xb284('0x4e'),{'uri':util['format'](_0xb284('0x4f'),_0x4c7791[_0xb284('0x17')],_0x51f92b['id'])});}})['catch'](function(_0x2c7774){logger['error'](_0xb284('0x55'),JSON['stringify'](_0x2c7774));});};exports[_0xb284('0x58')]=function(_0x434015,_0x2b90cb,_0x9726f6,_0x28d4ed,_0x120313,_0xef8ff4){var _0x4ba953,_0x568538;_0xef8ff4[_0xb284('0x17')]=intUtil[_0xb284('0x3e')](_0xef8ff4['remoteUri']);_0xef8ff4[_0xb284('0x44')]=intUtil[_0xb284('0x3e')](_0xef8ff4[_0xb284('0x44')]);if(_0x120313&&_0x120313[_0xb284('0x3f')]){logger[_0xb284('0x19')]('[ABANDONED]',_0xb284('0x41'));_0x2b90cb[_0xb284('0x42')]=util[_0xb284('0xe')](_0xb284('0x43'),_0xef8ff4[_0xb284('0x44')],_0x2b90cb[_0xb284('0x45')],md5(_0x2b90cb[_0xb284('0x45')]));}else{_0x2b90cb[_0xb284('0x42')]='';}headers[_0xb284('0x46')]=getAuth(_0xef8ff4);return getUser(_0xef8ff4,'')['then'](function(_0x564db3){_0x4ba953=_0x564db3;logger['info'](_0xb284('0x48'),_0x4ba953['id']);return getEndUser(_0xef8ff4,_0x2b90cb[_0xb284('0xf')],_0x2b90cb[_0xb284('0x49')]);})[_0xb284('0x18')](function(_0x2782e8){_0x568538=_0x2782e8;logger[_0xb284('0x19')](_0xb284('0x4a'),_0x568538['id']);return getTicket(_0xef8ff4,_0x4ba953,_0x568538,_0x9726f6,_0x2b90cb);})['then'](function(_0x5f5071){if(_0x5f5071){logger[_0xb284('0x19')](_0xb284('0x1a'));logger[_0xb284('0x19')](_0xb284('0x4b'),_0x5f5071['id']);}})[_0xb284('0x50')](function(_0x544963){logger[_0xb284('0x51')](_0xb284('0x59'),JSON[_0xb284('0x52')](_0x544963));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js
index e974467..ea27aad 100644
--- a/server/services/ami/trigger/integration/index.js
+++ b/server/services/ami/trigger/integration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x656f=['find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','abandoned','sugarcrm','zoho','dynamics365','unknown\x20integration','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','desk','vtiger','servicenow','exec','data1','toLowerCase','data2'];(function(_0x3688d7,_0x25728b){var _0x2d0d5b=function(_0x2f7fbe){while(--_0x2f7fbe){_0x3688d7['push'](_0x3688d7['shift']());}};_0x2d0d5b(++_0x25728b);}(_0x656f,0xa1));var _0xf656=function(_0x1a3d8d,_0x21e8ad){_0x1a3d8d=_0x1a3d8d-0x0;var _0x1a3328=_0x656f[_0x1a3d8d];return _0x1a3328;};'use strict';var _=require(_0xf656('0x0'));var util=require(_0xf656('0x1'));var zendesk=require(_0xf656('0x2'));var salesforce=require(_0xf656('0x3'));var sugarcrm=require(_0xf656('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0xf656('0x5'));var desk=require(_0xf656('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0xf656('0x7'));var dynamics365=require(_0xf656('0x8'));var integrations=[_0xf656('0x9'),_0xf656('0xa'),'sugarcrm',_0xf656('0xb'),'zoho',_0xf656('0xc'),_0xf656('0xd'),_0xf656('0xe'),'dynamics365'];exports[_0xf656('0xf')]=function(_0x3f6926,_0x4e9dc3,_0x2c3c25,_0x109c13,_0x26f307,_0x10a3ea){if(_0x2c3c25){if(_['includes'](integrations,_0x3f6926[_0xf656('0x10')][_0xf656('0x11')]())){try{var _0x5a176c=null;var _0x34f298='';var _0x4a9fd4=_0x2c3c25[_0x3f6926[_0xf656('0x10')]['toLowerCase']()];if(_0x4a9fd4){var _0x1c43a5=_0x4a9fd4[_0x3f6926[_0xf656('0x12')]];if(_0x1c43a5){var _0x4b7139=_[_0xf656('0x13')](_0x1c43a5[_0xf656('0x14')],{'id':parseInt(_0x3f6926[_0xf656('0x15')],0xa)});if(_0x4b7139){if(_0x109c13){if(_0x26f307&&_0x4e9dc3[_0xf656('0x16')]){_0x34f298='queue';}else if(_0x4e9dc3[_0xf656('0x17')]){_0x34f298='outbound';}else{console[_0xf656('0x18')](_0xf656('0x19'),_0x4e9dc3);}}else{_0x34f298=_0xf656('0x1a');}switch(_0x3f6926['data1'][_0xf656('0x11')]()){case _0xf656('0x9'):zendesk[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0xa'):salesforce[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0x1b'):sugarcrm[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0xb'):freshdesk[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0x1c'):zoho[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0xc'):desk[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case'vtiger':vtiger[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0xe'):servicenow['cs'](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea,_0x34f298);break;case _0xf656('0x1d'):dynamics365['cs'](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea,_0x34f298);break;default:console[_0xf656('0x18')](_0xf656('0x1e'));}}else{_0x5a176c=require('../../../../config/logger')(_0x3f6926[_0xf656('0x10')][_0xf656('0x11')]());_0x5a176c[_0xf656('0x1f')]('[EXEC]',util[_0xf656('0x20')](_0xf656('0x21'),_0x3f6926['data1'][_0xf656('0x11')](),_0x3f6926[_0xf656('0x15')]));}}else{_0x5a176c=require('../../../../config/logger')(_0x3f6926[_0xf656('0x10')]['toLowerCase']());_0x5a176c[_0xf656('0x1f')](_0xf656('0x22'),util[_0xf656('0x20')](_0xf656('0x23'),_0x3f6926[_0xf656('0x10')][_0xf656('0x11')](),_0x3f6926[_0xf656('0x12')]));}}else{}}catch(_0x3f3628){console['error'](_0x3f3628);}}}};
\ No newline at end of file
+var _0xcd1d=['./vtiger','./dynamics365','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','dynamics365','includes','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','abandoned','salesforce','log','unknown\x20integration','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','format','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./desk'];(function(_0x491a81,_0x47e900){var _0x10f960=function(_0x183641){while(--_0x183641){_0x491a81['push'](_0x491a81['shift']());}};_0x10f960(++_0x47e900);}(_0xcd1d,0x8b));var _0xdcd1=function(_0x39103f,_0x220608){_0x39103f=_0x39103f-0x0;var _0x98203c=_0xcd1d[_0x39103f];return _0x98203c;};'use strict';var _=require('lodash');var util=require(_0xdcd1('0x0'));var zendesk=require(_0xdcd1('0x1'));var salesforce=require(_0xdcd1('0x2'));var sugarcrm=require(_0xdcd1('0x3'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0xdcd1('0x4'));var vtiger=require(_0xdcd1('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0xdcd1('0x6'));var integrations=[_0xdcd1('0x7'),'salesforce',_0xdcd1('0x8'),_0xdcd1('0x9'),_0xdcd1('0xa'),_0xdcd1('0xb'),_0xdcd1('0xc'),_0xdcd1('0xd'),_0xdcd1('0xe')];exports['exec']=function(_0x18ca7c,_0x1de3e3,_0x969b41,_0x47060e,_0x7a096a,_0x2ae0b1){if(_0x969b41){if(_[_0xdcd1('0xf')](integrations,_0x18ca7c['data1'][_0xdcd1('0x10')]())){try{var _0x269e89=null;var _0x55ca23='';var _0x1e3ccb=_0x969b41[_0x18ca7c[_0xdcd1('0x11')]['toLowerCase']()];if(_0x1e3ccb){var _0x5b4258=_0x1e3ccb[_0x18ca7c[_0xdcd1('0x12')]];if(_0x5b4258){var _0x5cb194=_[_0xdcd1('0x13')](_0x5b4258[_0xdcd1('0x14')],{'id':parseInt(_0x18ca7c[_0xdcd1('0x15')],0xa)});if(_0x5cb194){if(_0x47060e){if(_0x7a096a&&_0x1de3e3[_0xdcd1('0x16')]){_0x55ca23=_0xdcd1('0x16');}else if(_0x1de3e3[_0xdcd1('0x17')]){_0x55ca23=_0xdcd1('0x18');}else{console['log'](_0xdcd1('0x19'),_0x1de3e3);}}else{_0x55ca23=_0xdcd1('0x1a');}switch(_0x18ca7c[_0xdcd1('0x11')][_0xdcd1('0x10')]()){case _0xdcd1('0x7'):zendesk[_0x55ca23](_0x18ca7c,_0x1de3e3,_0x5cb194,_0x47060e,_0x7a096a,_0x5b4258,_0x2ae0b1);break;case _0xdcd1('0x1b'):salesforce[_0x55ca23](_0x18ca7c,_0x1de3e3,_0x5cb194,_0x47060e,_0x7a096a,_0x5b4258,_0x2ae0b1);break;case _0xdcd1('0x8'):sugarcrm[_0x55ca23](_0x18ca7c,_0x1de3e3,_0x5cb194,_0x47060e,_0x7a096a,_0x5b4258,_0x2ae0b1);break;case _0xdcd1('0x9'):freshdesk[_0x55ca23](_0x18ca7c,_0x1de3e3,_0x5cb194,_0x47060e,_0x7a096a,_0x5b4258,_0x2ae0b1);break;case _0xdcd1('0xa'):zoho[_0x55ca23](_0x18ca7c,_0x1de3e3,_0x5cb194,_0x47060e,_0x7a096a,_0x5b4258,_0x2ae0b1);break;case _0xdcd1('0xb'):desk[_0x55ca23](_0x18ca7c,_0x1de3e3,_0x5cb194,_0x47060e,_0x7a096a,_0x5b4258,_0x2ae0b1);break;case'vtiger':vtiger[_0x55ca23](_0x18ca7c,_0x1de3e3,_0x5cb194,_0x47060e,_0x7a096a,_0x5b4258,_0x2ae0b1);break;case'servicenow':servicenow['cs'](_0x18ca7c,_0x1de3e3,_0x5cb194,_0x47060e,_0x7a096a,_0x5b4258,_0x2ae0b1,_0x55ca23);break;case _0xdcd1('0xe'):dynamics365['cs'](_0x18ca7c,_0x1de3e3,_0x5cb194,_0x47060e,_0x7a096a,_0x5b4258,_0x2ae0b1,_0x55ca23);break;default:console[_0xdcd1('0x1c')](_0xdcd1('0x1d'));}}else{_0x269e89=require('../../../../config/logger')(_0x18ca7c[_0xdcd1('0x11')][_0xdcd1('0x10')]());_0x269e89[_0xdcd1('0x1e')](_0xdcd1('0x1f'),util['format'](_0xdcd1('0x20'),_0x18ca7c['data1'][_0xdcd1('0x10')](),_0x18ca7c[_0xdcd1('0x15')]));}}else{_0x269e89=require(_0xdcd1('0x21'))(_0x18ca7c[_0xdcd1('0x11')][_0xdcd1('0x10')]());_0x269e89[_0xdcd1('0x1e')]('[EXEC]',util[_0xdcd1('0x22')](_0xdcd1('0x23'),_0x18ca7c[_0xdcd1('0x11')]['toLowerCase'](),_0x18ca7c[_0xdcd1('0x12')]));}}else{}}catch(_0x954083){console[_0xdcd1('0x1e')](_0x954083);}}}};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js
index d89cd77..1134acc 100644
--- a/server/services/ami/trigger/integration/salesforce.js
+++ b/server/services/ami/trigger/integration/salesforce.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','ticketType','Task','getString','Descriptions','assign','Subjects','ContactId','sobject','create','isNil','validateEmail','User','find','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','execute','lead','Lead','Case','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','type','string','idField','variableName','toString','customVariable','Variable','name','toLowerCase','password','securityToken','remoteUri','clientId','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e'];(function(_0x1b88fd,_0x3fc359){var _0x287cd1=function(_0x5aa428){while(--_0x5aa428){_0x1b88fd['push'](_0x1b88fd['shift']());}};_0x287cd1(++_0x3fc359);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var md5=require(_0x3071('0x2'));var jsforce=require(_0x3071('0x3'));var util=require(_0x3071('0x4'));var Redis=require('ioredis');var intUtil=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var logger=require(_0x3071('0x7'))(_0x3071('0x8'));config[_0x3071('0x9')]=_[_0x3071('0xa')](config[_0x3071('0x9')],{'host':_0x3071('0xb'),'port':0x18eb});var io=require(_0x3071('0xc'))(new Redis(config[_0x3071('0x9')]));function emit(_0x3e9a5e,_0x2fce7a,_0x1a868e){io['to'](_0x3e9a5e)['emit'](_0x2fce7a,_0x1a868e);}function getTicket(_0x3457cd,_0x2610b4,_0x937259,_0xff9a29,_0x1ce844,_0x4a470a,_0x2ace21,_0x11a7ee){var _0x401b4d={};if(_0xff9a29[_0x3071('0xd')]===_0x3071('0xe')){_0x401b4d=Object['assign']({},{'OwnerId':_0x2610b4['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x3071('0xf')](_0xff9a29['Subjects'],_0x1ce844,'\x20'),'Description':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x10')],_0x1ce844,'\x0a')},getCustomFields(_0x4a470a,_0x1ce844));if(_0x937259){_0x401b4d['WhoId']=_0x937259['id'];}}else if(_0xff9a29[_0x3071('0xd')]==='Case'){_0x401b4d=Object[_0x3071('0x11')]({},{'OwnerId':_0x2610b4['id'],'Subject':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x12')],_0x1ce844,'\x20'),'Description':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x10')],_0x1ce844,'\x0a')},getCustomFields(_0x4a470a,_0x1ce844));if(_0x937259){_0x401b4d[_0x3071('0x13')]=_0x937259['id'];}}return _0x2ace21[_0x3071('0x14')](_0xff9a29[_0x3071('0xd')])[_0x3071('0x15')](_0x401b4d);}function getUser(_0x344ea6,_0x5f3c22,_0x224996){if(!_[_0x3071('0x16')](_0x5f3c22)&&intUtil[_0x3071('0x17')](_0x5f3c22)){var _0x108a83={'Email':_0x5f3c22};var _0x3acf0e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x224996[_0x3071('0x14')](_0x3071('0x18'))[_0x3071('0x19')](_0x108a83,_0x3acf0e)['execute']()[_0x3071('0x1a')](function(_0x2bfa33){if(_0x2bfa33[_0x3071('0x1b')]){var _0x56c267=_[_0x3071('0x19')](_0x2bfa33,function(_0x5cd80d){return _0x5cd80d[_0x3071('0x1c')]===_0x5f3c22;});if(_0x56c267){logger[_0x3071('0x1d')](_0x3071('0x1e'),_0x5f3c22);return BPromise[_0x3071('0x1f')]({'id':_0x56c267['Id'],'name':_0x56c267[_0x3071('0x20')]});}}else{logger[_0x3071('0x1d')](_0x3071('0x21'),_0x5f3c22);return _0x224996[_0x3071('0x22')]()['then'](function(_0x481a51){return BPromise[_0x3071('0x1f')]({'id':_0x481a51[_0x3071('0x23')],'name':_0x481a51[_0x3071('0x24')]});});}});}else{logger[_0x3071('0x1d')](_0x3071('0x21'),_0x5f3c22);return _0x224996[_0x3071('0x22')]()[_0x3071('0x1a')](function(_0x1fe727){return BPromise[_0x3071('0x1f')]({'id':_0x1fe727['user_id'],'name':_0x1fe727[_0x3071('0x24')]});});}}function getEndUser(_0x3f1e6e,_0x177138,_0x4d5c4b,_0x4fb1ca,_0x28792d){var _0x163604={'Phone':_0x4fb1ca};var _0x950fde={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3071('0x1f')]()[_0x3071('0x1a')](function(){if(_0x177138[_0x3071('0xd')]===_0x3071('0xe')){logger[_0x3071('0x1d')](_0x3071('0x25'),_0x4fb1ca,_0x177138[_0x3071('0x26')]);switch(_0x177138['moduleSearch']){case'contact_lead':return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))[_0x3071('0x19')](_0x163604,_0x950fde)[_0x3071('0x28')]()[_0x3071('0x1a')](function(_0x29538c){if(_0x29538c&&_0x29538c[_0x3071('0x1b')]){return _0x29538c;}else{return _0x28792d[_0x3071('0x14')]('Lead')['find'](_0x163604,_0x950fde);}});case'contact':return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))['find'](_0x163604,_0x950fde)[_0x3071('0x28')]();case _0x3071('0x29'):return _0x28792d[_0x3071('0x14')](_0x3071('0x2a'))['find'](_0x163604,_0x950fde);default:return null;}}else if(_0x177138[_0x3071('0xd')]===_0x3071('0x2b')){logger[_0x3071('0x1d')](_0x3071('0x25'),_0x4fb1ca,_0x3071('0x2c'));return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))[_0x3071('0x19')](_0x163604,_0x950fde)['execute']();}})[_0x3071('0x1a')](function(_0x54e52f){if(_0x54e52f&&_0x54e52f['length']){var _0x1a1a64=_[_0x3071('0x19')](_0x54e52f,function(_0x54d9c3){return _0x54d9c3[_0x3071('0x2d')]===_0x4fb1ca;});if(_0x1a1a64){return BPromise[_0x3071('0x1f')]({'id':_0x1a1a64['Id'],'name':_0x1a1a64[_0x3071('0x20')],'phone':_0x1a1a64[_0x3071('0x2d')]});}}})[_0x3071('0x1a')](function(_0x232235){if(_0x232235){logger['info'](_0x3071('0x2e'),_0x4fb1ca);return BPromise[_0x3071('0x1f')](_0x232235);}else{logger['info'](_0x3071('0x2f'),_0x4fb1ca);var _0x5b1392={'LastName':_0x4d5c4b!==_0x3071('0x30')?_0x4d5c4b:util[_0x3071('0x31')]('Caller\x20-\x20%s',_0x4fb1ca),'Phone':_0x4fb1ca};if(_0x177138['moduleCreate']){if(_0x177138[_0x3071('0x32')]===_0x3071('0x2c')){logger[_0x3071('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4fb1ca,_0x177138[_0x3071('0x32')]);}else if(_0x177138['moduleCreate']===_0x3071('0x29')&&_0x177138['ticketType']===_0x3071('0xe')){logger[_0x3071('0x1d')](_0x3071('0x33'),_0x4fb1ca,_0x177138[_0x3071('0x32')]);_0x5b1392[_0x3071('0x34')]='No\x20Company';}else{return null;}}return _0x28792d['sobject'](_[_0x3071('0x35')](_0x177138[_0x3071('0x32')]))[_0x3071('0x15')](_0x5b1392);}});}function getCustomFields(_0x1f69a6,_0x525389){var _0x3cfc05={};if(_0x1f69a6[_0x3071('0x1b')]>0x0){_[_0x3071('0x36')](_0x1f69a6,function(_0x25c29f){if(_0x25c29f[_0x3071('0x37')]===_0x3071('0x38')&&_0x25c29f['idField']){_0x3cfc05[_0x25c29f[_0x3071('0x39')]]=_0x25c29f['content']['toString']();}else if(_0x25c29f['type']==='variable'&&_0x25c29f[_0x3071('0x3a')]&&_0x25c29f[_0x3071('0x39')]){_0x525389[_0x25c29f[_0x3071('0x3a')]]&&(_0x3cfc05[_0x25c29f[_0x3071('0x39')]]=_0x525389[_0x25c29f[_0x3071('0x3a')]][_0x3071('0x3b')]());}else if(_0x25c29f[_0x3071('0x37')]===_0x3071('0x3c')&&_0x25c29f['Variable']&&_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')]&&_0x25c29f[_0x3071('0x39')]){_0x525389[_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')]['toLowerCase']()]&&(_0x3cfc05[_0x25c29f['idField']]=_0x525389[_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')][_0x3071('0x3f')]()][_0x3071('0x3b')]());}});}return _0x3cfc05;}function getConnection(_0x606ef8){var _0x5db437=_0x606ef8[_0x3071('0x40')]['concat'](_0x606ef8[_0x3071('0x41')]);var _0x509178=new jsforce['Connection']({'oauth2':{'loginUrl':_0x606ef8[_0x3071('0x42')]||'https://login.salesforce.com','clientId':_0x606ef8[_0x3071('0x43')],'clientSecret':_0x606ef8['clientSecret']}});return _0x509178[_0x3071('0x44')](_0x606ef8[_0x3071('0x45')],_0x5db437)[_0x3071('0x1a')](function(){logger[_0x3071('0x1d')]('Connection\x20established.');return _0x509178;});}exports[_0x3071('0x46')]=function(_0x575c12,_0xd273ec,_0x4b6bbb,_0x46924d,_0x2060e9,_0x4d395a){var _0x131ae6,_0x117e73,_0x224a70,_0x38bcc2;_0x4d395a[_0x3071('0x47')]=intUtil[_0x3071('0x48')](_0x4d395a[_0x3071('0x47')]);_0x4d395a['remoteUri']=intUtil[_0x3071('0x48')](_0x4d395a[_0x3071('0x42')]);if(_0x2060e9&&_0x2060e9[_0x3071('0x49')]){logger[_0x3071('0x1d')]('[QUEUE]',_0x3071('0x4a'));_0xd273ec[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x4d395a[_0x3071('0x47')],_0xd273ec[_0x3071('0x4d')],md5(_0xd273ec[_0x3071('0x4d')]));}else{_0xd273ec[_0x3071('0x4b')]='';}return getConnection(_0x4d395a)[_0x3071('0x1a')](function(_0x886f7){_0x38bcc2=_0x886f7;return getUser(_0x4d395a,_0x46924d[_0x3071('0x4e')],_0x38bcc2);})[_0x3071('0x1a')](function(_0x24977b){_0x131ae6=_0x24977b;return getEndUser(_0x4d395a,_0x4b6bbb,_0xd273ec[_0x3071('0x4f')],_0xd273ec[_0x3071('0x50')],_0x38bcc2);})[_0x3071('0x1a')](function(_0x596cdd){_0x117e73=_0x596cdd;return getTicket(_0x4d395a,_0x131ae6,_0x117e73,_0x4b6bbb,_0xd273ec,_0x4b6bbb['Fields'],_0x38bcc2,_0x3071('0x46'));})['then'](function(_0x403761){_0x224a70=_0x403761;logger[_0x3071('0x1d')](_0x3071('0x51'),_0x224a70['id']);logger['info'](_0x3071('0x52'),_0x224a70['id'],_0x46924d[_0x3071('0x3e')],_0x4d395a['type']);switch(_0x4d395a['type']){case _0x3071('0x53'):emit(util[_0x3071('0x31')](_0x3071('0x54'),_0x46924d[_0x3071('0x3e')]),'trigger:salesforce:display',{'recordId':_0x224a70['id']});break;case _0x3071('0x55'):emit(util[_0x3071('0x31')](_0x3071('0x54'),_0x46924d[_0x3071('0x3e')]),_0x3071('0x56'),{'uri':util['format'](_0x3071('0x57'),_0x38bcc2[_0x3071('0x58')],_0x224a70['id'])});break;default:logger[_0x3071('0x59')](_0x3071('0x5a'));}})[_0x3071('0x5b')](function(_0x24f429){logger[_0x3071('0x59')]('[QUEUE]',JSON['stringify'](_0x24f429));});};exports[_0x3071('0x5c')]=function(_0x4de4f3,_0xe96994,_0x26ba8a,_0x499b6a,_0x19dc95,_0x1bf911,_0x4d3886){var _0x108b14,_0x1878e2,_0x180344,_0x6e96c7;_0x1bf911[_0x3071('0x47')]=intUtil['stripTrailingSlash'](_0x1bf911[_0x3071('0x47')]);_0x1bf911[_0x3071('0x42')]=intUtil[_0x3071('0x48')](_0x1bf911['remoteUri']);if(_0x4d3886&&_0x4d3886[_0x3071('0x5d')]&&_0x4d3886[_0x3071('0x5d')]!==_0x3071('0x5e')){logger[_0x3071('0x1d')](_0x3071('0x5f'),_0x3071('0x4a'));_0xe96994[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x1bf911['serverUrl'],_0xe96994[_0x3071('0x4d')],md5(_0xe96994[_0x3071('0x4d')]));}return getConnection(_0x1bf911)[_0x3071('0x1a')](function(_0x26ecb2){_0x6e96c7=_0x26ecb2;return getUser(_0x1bf911,_0x499b6a[_0x3071('0x4e')],_0x6e96c7);})[_0x3071('0x1a')](function(_0x389dca){_0x108b14=_0x389dca;return getEndUser(_0x1bf911,_0x26ba8a,_0xe96994[_0x3071('0x60')],_0xe96994[_0x3071('0x61')],_0x6e96c7);})[_0x3071('0x1a')](function(_0x195d03){_0x1878e2=_0x195d03;return getTicket(_0x1bf911,_0x108b14,_0x1878e2,_0x26ba8a,_0xe96994,_0x26ba8a['Fields'],_0x6e96c7,_0x3071('0x5c'));})[_0x3071('0x1a')](function(_0x279594){_0x180344=_0x279594;logger[_0x3071('0x1d')](_0x3071('0x62'),_0x180344['id']);logger[_0x3071('0x1d')](_0x3071('0x63'),_0x180344['id'],_0x499b6a[_0x3071('0x3e')],_0x1bf911['type']);switch(_0x1bf911[_0x3071('0x37')]){case _0x3071('0x53'):emit(util['format']('user:%s',_0x499b6a[_0x3071('0x3e')]),_0x3071('0x64'),{'recordId':_0x180344['id']});break;case _0x3071('0x55'):emit(util[_0x3071('0x31')]('user:%s',_0x499b6a['name']),_0x3071('0x56'),{'uri':util['format']('%s/%s/e',_0x6e96c7['instanceUrl'],_0x180344['id'])});break;default:logger['error'](_0x3071('0x5f'),_0x3071('0x65'));}})[_0x3071('0x5b')](function(_0x567d19){logger[_0x3071('0x59')](_0x3071('0x5f'),JSON[_0x3071('0x66')](_0x567d19));});};exports[_0x3071('0x67')]=function(_0x5a0c1b,_0x2103a4,_0x29841a,_0x588406,_0x1b35d3,_0x29ee70){var _0x388cd1,_0x40c258,_0x4edd23,_0x11ffdd;_0x29ee70[_0x3071('0x47')]=intUtil['stripTrailingSlash'](_0x29ee70['serverUrl']);_0x29ee70[_0x3071('0x42')]=intUtil[_0x3071('0x48')](_0x29ee70[_0x3071('0x42')]);if(_0x1b35d3&&_0x1b35d3['monitor_format']){logger['info'](_0x3071('0x68'),_0x3071('0x4a'));_0x2103a4[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x29ee70[_0x3071('0x47')],_0x2103a4[_0x3071('0x4d')],md5(_0x2103a4[_0x3071('0x4d')]));}else{_0x2103a4['recordingURL']='';}return getConnection(_0x29ee70)[_0x3071('0x1a')](function(_0x5ea33f){_0x11ffdd=_0x5ea33f;if(!_[_0x3071('0x16')](_0x588406)){return getUser(_0x29ee70,_0x588406[_0x3071('0x3e')],_0x11ffdd);}else{return getUser(_0x29ee70,null,_0x11ffdd);}})[_0x3071('0x1a')](function(_0x2fbac7){_0x388cd1=_0x2fbac7;return getEndUser(_0x29ee70,_0x29841a,_0x2103a4[_0x3071('0x4f')],_0x2103a4[_0x3071('0x50')],_0x11ffdd);})[_0x3071('0x1a')](function(_0x2ae053){_0x40c258=_0x2ae053;return getTicket(_0x29ee70,_0x388cd1,_0x40c258,_0x29841a,_0x2103a4,_0x29841a['Fields'],_0x11ffdd);})[_0x3071('0x1a')](function(_0x138a94){_0x4edd23=_0x138a94;logger[_0x3071('0x1d')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x4edd23['id']);logger[_0x3071('0x1d')](_0x3071('0x69'),_0x29ee70[_0x3071('0x37')]);})['catch'](function(_0x521ee6){logger[_0x3071('0x59')]('[ABANDONED]',JSON[_0x3071('0x66')](_0x521ee6));});};
\ No newline at end of file
+var _0xcb91=['concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','[OUTBOUND]','uniqueid','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','abandoned','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/logger','salesforce','defaults','redis','socket.io-emitter','ticketType','Task','Subjects','getString','Descriptions','WhoId','Case','assign','sobject','create','isNil','User','find','execute','then','Email','info','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','resolve','moduleSearch','contact_lead','Contact','length','Lead','contact','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','No\x20Company','upperFirst','type','string','idField','content','variableName','customVariable','name','Variable','toLowerCase','password'];(function(_0x159641,_0x292389){var _0x41c53a=function(_0x21dd62){while(--_0x21dd62){_0x159641['push'](_0x159641['shift']());}};_0x41c53a(++_0x292389);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0xcb91[_0x80f51a];return _0x327148;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var md5=require(_0x1cb9('0x2'));var jsforce=require(_0x1cb9('0x3'));var util=require('util');var Redis=require(_0x1cb9('0x4'));var intUtil=require(_0x1cb9('0x5'));var config=require('../../../../config/environment');var logger=require(_0x1cb9('0x6'))(_0x1cb9('0x7'));config['redis']=_[_0x1cb9('0x8')](config[_0x1cb9('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0xa'))(new Redis(config[_0x1cb9('0x9')]));function emit(_0x59d1be,_0x3ae0f1,_0x5a0e99){io['to'](_0x59d1be)['emit'](_0x3ae0f1,_0x5a0e99);}function getTicket(_0x45a12f,_0x2fa15c,_0x74ce19,_0x1f0eca,_0x2fc627,_0x50ce71,_0x9b58f1,_0x44a6b4){var _0x3af35f={};if(_0x1f0eca[_0x1cb9('0xb')]===_0x1cb9('0xc')){_0x3af35f=Object['assign']({},{'OwnerId':_0x2fa15c['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x1f0eca[_0x1cb9('0xd')],_0x2fc627,'\x20'),'Description':intUtil[_0x1cb9('0xe')](_0x1f0eca[_0x1cb9('0xf')],_0x2fc627,'\x0a')},getCustomFields(_0x50ce71,_0x2fc627));if(_0x74ce19){_0x3af35f[_0x1cb9('0x10')]=_0x74ce19['id'];}}else if(_0x1f0eca['ticketType']===_0x1cb9('0x11')){_0x3af35f=Object[_0x1cb9('0x12')]({},{'OwnerId':_0x2fa15c['id'],'Subject':intUtil[_0x1cb9('0xe')](_0x1f0eca[_0x1cb9('0xd')],_0x2fc627,'\x20'),'Description':intUtil[_0x1cb9('0xe')](_0x1f0eca['Descriptions'],_0x2fc627,'\x0a')},getCustomFields(_0x50ce71,_0x2fc627));if(_0x74ce19){_0x3af35f['ContactId']=_0x74ce19['id'];}}return _0x9b58f1[_0x1cb9('0x13')](_0x1f0eca[_0x1cb9('0xb')])[_0x1cb9('0x14')](_0x3af35f);}function getUser(_0x3f1376,_0x3e21e0,_0xf22920){if(!_[_0x1cb9('0x15')](_0x3e21e0)&&intUtil['validateEmail'](_0x3e21e0)){var _0x479d43={'Email':_0x3e21e0};var _0x1b2fa6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xf22920[_0x1cb9('0x13')](_0x1cb9('0x16'))[_0x1cb9('0x17')](_0x479d43,_0x1b2fa6)[_0x1cb9('0x18')]()[_0x1cb9('0x19')](function(_0x24fa1f){if(_0x24fa1f['length']){var _0x559bcc=_[_0x1cb9('0x17')](_0x24fa1f,function(_0x5dbfae){return _0x5dbfae[_0x1cb9('0x1a')]===_0x3e21e0;});if(_0x559bcc){logger[_0x1cb9('0x1b')]('Agent\x20%s\x20found.',_0x3e21e0);return BPromise['resolve']({'id':_0x559bcc['Id'],'name':_0x559bcc[_0x1cb9('0x1c')]});}}else{logger[_0x1cb9('0x1b')](_0x1cb9('0x1d'),_0x3e21e0);return _0xf22920[_0x1cb9('0x1e')]()[_0x1cb9('0x19')](function(_0x27db16){return BPromise['resolve']({'id':_0x27db16['user_id'],'name':_0x27db16[_0x1cb9('0x1f')]});});}});}else{logger['info'](_0x1cb9('0x1d'),_0x3e21e0);return _0xf22920[_0x1cb9('0x1e')]()[_0x1cb9('0x19')](function(_0x44d3c4){return BPromise[_0x1cb9('0x20')]({'id':_0x44d3c4['user_id'],'name':_0x44d3c4[_0x1cb9('0x1f')]});});}}function getEndUser(_0x9df250,_0x4c8d76,_0xd6891c,_0x21effa,_0x41a9a0){var _0x1804fd={'Phone':_0x21effa};var _0x406821={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1cb9('0x20')]()[_0x1cb9('0x19')](function(){if(_0x4c8d76[_0x1cb9('0xb')]===_0x1cb9('0xc')){logger[_0x1cb9('0x1b')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x21effa,_0x4c8d76[_0x1cb9('0x21')]);switch(_0x4c8d76['moduleSearch']){case _0x1cb9('0x22'):return _0x41a9a0['sobject'](_0x1cb9('0x23'))[_0x1cb9('0x17')](_0x1804fd,_0x406821)[_0x1cb9('0x18')]()[_0x1cb9('0x19')](function(_0x561d89){if(_0x561d89&&_0x561d89[_0x1cb9('0x24')]){return _0x561d89;}else{return _0x41a9a0['sobject'](_0x1cb9('0x25'))[_0x1cb9('0x17')](_0x1804fd,_0x406821);}});case _0x1cb9('0x26'):return _0x41a9a0['sobject'](_0x1cb9('0x23'))['find'](_0x1804fd,_0x406821)[_0x1cb9('0x18')]();case'lead':return _0x41a9a0[_0x1cb9('0x13')](_0x1cb9('0x25'))[_0x1cb9('0x17')](_0x1804fd,_0x406821);default:return null;}}else if(_0x4c8d76[_0x1cb9('0xb')]==='Case'){logger[_0x1cb9('0x1b')](_0x1cb9('0x27'),_0x21effa,_0x1cb9('0x26'));return _0x41a9a0[_0x1cb9('0x13')](_0x1cb9('0x23'))[_0x1cb9('0x17')](_0x1804fd,_0x406821)[_0x1cb9('0x18')]();}})[_0x1cb9('0x19')](function(_0x386e8b){if(_0x386e8b&&_0x386e8b[_0x1cb9('0x24')]){var _0x294eec=_[_0x1cb9('0x17')](_0x386e8b,function(_0x29f149){return _0x29f149['Phone']===_0x21effa;});if(_0x294eec){return BPromise['resolve']({'id':_0x294eec['Id'],'name':_0x294eec[_0x1cb9('0x1c')],'phone':_0x294eec[_0x1cb9('0x28')]});}}})[_0x1cb9('0x19')](function(_0x29f451){if(_0x29f451){logger[_0x1cb9('0x1b')](_0x1cb9('0x29'),_0x21effa);return BPromise[_0x1cb9('0x20')](_0x29f451);}else{logger[_0x1cb9('0x1b')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x21effa);var _0x2aa59b={'LastName':_0xd6891c!==_0x1cb9('0x2a')?_0xd6891c:util[_0x1cb9('0x2b')]('Caller\x20-\x20%s',_0x21effa),'Phone':_0x21effa};if(_0x4c8d76[_0x1cb9('0x2c')]){if(_0x4c8d76['moduleCreate']===_0x1cb9('0x26')){logger['info'](_0x1cb9('0x2d'),_0x21effa,_0x4c8d76[_0x1cb9('0x2c')]);}else if(_0x4c8d76[_0x1cb9('0x2c')]===_0x1cb9('0x2e')&&_0x4c8d76[_0x1cb9('0xb')]===_0x1cb9('0xc')){logger[_0x1cb9('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x21effa,_0x4c8d76['moduleCreate']);_0x2aa59b[_0x1cb9('0x2f')]=_0x1cb9('0x30');}else{return null;}}return _0x41a9a0[_0x1cb9('0x13')](_[_0x1cb9('0x31')](_0x4c8d76[_0x1cb9('0x2c')]))[_0x1cb9('0x14')](_0x2aa59b);}});}function getCustomFields(_0x32130b,_0x4a670c){var _0xbcaa32={};if(_0x32130b['length']>0x0){_['forEach'](_0x32130b,function(_0x4c6c75){if(_0x4c6c75[_0x1cb9('0x32')]===_0x1cb9('0x33')&&_0x4c6c75[_0x1cb9('0x34')]){_0xbcaa32[_0x4c6c75[_0x1cb9('0x34')]]=_0x4c6c75[_0x1cb9('0x35')]['toString']();}else if(_0x4c6c75[_0x1cb9('0x32')]==='variable'&&_0x4c6c75[_0x1cb9('0x36')]&&_0x4c6c75[_0x1cb9('0x34')]){_0x4a670c[_0x4c6c75[_0x1cb9('0x36')]]&&(_0xbcaa32[_0x4c6c75['idField']]=_0x4a670c[_0x4c6c75[_0x1cb9('0x36')]]['toString']());}else if(_0x4c6c75[_0x1cb9('0x32')]===_0x1cb9('0x37')&&_0x4c6c75['Variable']&&_0x4c6c75['Variable'][_0x1cb9('0x38')]&&_0x4c6c75[_0x1cb9('0x34')]){_0x4a670c[_0x4c6c75[_0x1cb9('0x39')][_0x1cb9('0x38')][_0x1cb9('0x3a')]()]&&(_0xbcaa32[_0x4c6c75['idField']]=_0x4a670c[_0x4c6c75[_0x1cb9('0x39')]['name']['toLowerCase']()]['toString']());}});}return _0xbcaa32;}function getConnection(_0x398d04){var _0x242ec4=_0x398d04[_0x1cb9('0x3b')][_0x1cb9('0x3c')](_0x398d04[_0x1cb9('0x3d')]);var _0x2a8b7f=new jsforce[(_0x1cb9('0x3e'))]({'oauth2':{'loginUrl':_0x398d04[_0x1cb9('0x3f')]||_0x1cb9('0x40'),'clientId':_0x398d04[_0x1cb9('0x41')],'clientSecret':_0x398d04[_0x1cb9('0x42')]}});return _0x2a8b7f['login'](_0x398d04[_0x1cb9('0x43')],_0x242ec4)[_0x1cb9('0x19')](function(){logger[_0x1cb9('0x1b')]('Connection\x20established.');return _0x2a8b7f;});}exports[_0x1cb9('0x44')]=function(_0x57251,_0x3c6044,_0x2efdbb,_0x4599a4,_0x4791ee,_0x2c18c6){var _0x59d76b,_0x2eaa11,_0x4ac483,_0x1cf2ee;_0x2c18c6[_0x1cb9('0x45')]=intUtil[_0x1cb9('0x46')](_0x2c18c6[_0x1cb9('0x45')]);_0x2c18c6['remoteUri']=intUtil[_0x1cb9('0x46')](_0x2c18c6[_0x1cb9('0x3f')]);if(_0x4791ee&&_0x4791ee[_0x1cb9('0x47')]){logger[_0x1cb9('0x1b')](_0x1cb9('0x48'),_0x1cb9('0x49'));_0x3c6044[_0x1cb9('0x4a')]=util[_0x1cb9('0x2b')](_0x1cb9('0x4b'),_0x2c18c6[_0x1cb9('0x45')],_0x3c6044['uniqueid'],md5(_0x3c6044['uniqueid']));}else{_0x3c6044[_0x1cb9('0x4a')]='';}return getConnection(_0x2c18c6)[_0x1cb9('0x19')](function(_0x19e83a){_0x1cf2ee=_0x19e83a;return getUser(_0x2c18c6,_0x4599a4[_0x1cb9('0x4c')],_0x1cf2ee);})[_0x1cb9('0x19')](function(_0x2d076b){_0x59d76b=_0x2d076b;return getEndUser(_0x2c18c6,_0x2efdbb,_0x3c6044[_0x1cb9('0x4d')],_0x3c6044[_0x1cb9('0x4e')],_0x1cf2ee);})[_0x1cb9('0x19')](function(_0x166ca2){_0x2eaa11=_0x166ca2;return getTicket(_0x2c18c6,_0x59d76b,_0x2eaa11,_0x2efdbb,_0x3c6044,_0x2efdbb['Fields'],_0x1cf2ee,_0x1cb9('0x44'));})['then'](function(_0x222aa4){_0x4ac483=_0x222aa4;logger['info'](_0x1cb9('0x4f'),_0x4ac483['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4ac483['id'],_0x4599a4[_0x1cb9('0x38')],_0x2c18c6[_0x1cb9('0x32')]);switch(_0x2c18c6[_0x1cb9('0x32')]){case'integrationTab':emit(util[_0x1cb9('0x2b')](_0x1cb9('0x50'),_0x4599a4['name']),'trigger:salesforce:display',{'recordId':_0x4ac483['id']});break;case _0x1cb9('0x51'):emit(util[_0x1cb9('0x2b')](_0x1cb9('0x50'),_0x4599a4[_0x1cb9('0x38')]),_0x1cb9('0x52'),{'uri':util[_0x1cb9('0x2b')](_0x1cb9('0x53'),_0x1cf2ee['instanceUrl'],_0x4ac483['id'])});break;default:logger[_0x1cb9('0x54')](_0x1cb9('0x55'));}})[_0x1cb9('0x56')](function(_0x49946f){logger[_0x1cb9('0x54')](_0x1cb9('0x48'),JSON[_0x1cb9('0x57')](_0x49946f));});};exports[_0x1cb9('0x58')]=function(_0x12d283,_0x3c4681,_0x5ae762,_0x37ceb5,_0x36c40d,_0x41e81f,_0x128c5b){var _0x4ad7cd,_0x274c90,_0x1c27d3,_0x3c126a;_0x41e81f[_0x1cb9('0x45')]=intUtil[_0x1cb9('0x46')](_0x41e81f[_0x1cb9('0x45')]);_0x41e81f['remoteUri']=intUtil[_0x1cb9('0x46')](_0x41e81f[_0x1cb9('0x3f')]);if(_0x128c5b&&_0x128c5b[_0x1cb9('0x59')]&&_0x128c5b[_0x1cb9('0x59')]!=='none'){logger['info'](_0x1cb9('0x5a'),_0x1cb9('0x49'));_0x3c4681[_0x1cb9('0x4a')]=util[_0x1cb9('0x2b')](_0x1cb9('0x4b'),_0x41e81f[_0x1cb9('0x45')],_0x3c4681[_0x1cb9('0x5b')],md5(_0x3c4681[_0x1cb9('0x5b')]));}return getConnection(_0x41e81f)['then'](function(_0x49f74c){_0x3c126a=_0x49f74c;return getUser(_0x41e81f,_0x37ceb5[_0x1cb9('0x4c')],_0x3c126a);})['then'](function(_0x5cefa3){_0x4ad7cd=_0x5cefa3;return getEndUser(_0x41e81f,_0x5ae762,_0x3c4681['destcalleridname'],_0x3c4681['destcalleridnum'],_0x3c126a);})['then'](function(_0x455c40){_0x274c90=_0x455c40;return getTicket(_0x41e81f,_0x4ad7cd,_0x274c90,_0x5ae762,_0x3c4681,_0x5ae762[_0x1cb9('0x5c')],_0x3c126a,_0x1cb9('0x58'));})[_0x1cb9('0x19')](function(_0x23d435){_0x1c27d3=_0x23d435;logger[_0x1cb9('0x1b')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x1c27d3['id']);logger[_0x1cb9('0x1b')](_0x1cb9('0x5d'),_0x1c27d3['id'],_0x37ceb5['name'],_0x41e81f['type']);switch(_0x41e81f[_0x1cb9('0x32')]){case _0x1cb9('0x5e'):emit(util[_0x1cb9('0x2b')](_0x1cb9('0x50'),_0x37ceb5[_0x1cb9('0x38')]),'trigger:salesforce:display',{'recordId':_0x1c27d3['id']});break;case'newTab':emit(util['format'](_0x1cb9('0x50'),_0x37ceb5[_0x1cb9('0x38')]),_0x1cb9('0x52'),{'uri':util[_0x1cb9('0x2b')](_0x1cb9('0x53'),_0x3c126a['instanceUrl'],_0x1c27d3['id'])});break;default:logger[_0x1cb9('0x54')](_0x1cb9('0x5a'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x1d914d){logger['error'](_0x1cb9('0x5a'),JSON[_0x1cb9('0x57')](_0x1d914d));});};exports[_0x1cb9('0x5f')]=function(_0x1e7561,_0x3619a2,_0x398779,_0x4aeeff,_0xde0d93,_0x15fc04){var _0x330fc1,_0x17c361,_0x5b5f0d,_0x520d98;_0x15fc04[_0x1cb9('0x45')]=intUtil[_0x1cb9('0x46')](_0x15fc04[_0x1cb9('0x45')]);_0x15fc04[_0x1cb9('0x3f')]=intUtil[_0x1cb9('0x46')](_0x15fc04[_0x1cb9('0x3f')]);if(_0xde0d93&&_0xde0d93['monitor_format']){logger[_0x1cb9('0x1b')]('[ABANDONED]',_0x1cb9('0x49'));_0x3619a2[_0x1cb9('0x4a')]=util['format'](_0x1cb9('0x4b'),_0x15fc04[_0x1cb9('0x45')],_0x3619a2[_0x1cb9('0x5b')],md5(_0x3619a2['uniqueid']));}else{_0x3619a2[_0x1cb9('0x4a')]='';}return getConnection(_0x15fc04)[_0x1cb9('0x19')](function(_0x306abf){_0x520d98=_0x306abf;if(!_[_0x1cb9('0x15')](_0x4aeeff)){return getUser(_0x15fc04,_0x4aeeff[_0x1cb9('0x38')],_0x520d98);}else{return getUser(_0x15fc04,null,_0x520d98);}})[_0x1cb9('0x19')](function(_0x5a3f1d){_0x330fc1=_0x5a3f1d;return getEndUser(_0x15fc04,_0x398779,_0x3619a2[_0x1cb9('0x4d')],_0x3619a2[_0x1cb9('0x4e')],_0x520d98);})[_0x1cb9('0x19')](function(_0x4398dc){_0x17c361=_0x4398dc;return getTicket(_0x15fc04,_0x330fc1,_0x17c361,_0x398779,_0x3619a2,_0x398779[_0x1cb9('0x5c')],_0x520d98);})[_0x1cb9('0x19')](function(_0x128a41){_0x5b5f0d=_0x128a41;logger[_0x1cb9('0x1b')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x5b5f0d['id']);logger[_0x1cb9('0x1b')](_0x1cb9('0x60'),_0x15fc04['type']);})[_0x1cb9('0x56')](function(_0x5415fa){logger[_0x1cb9('0x54')]('[ABANDONED]',JSON['stringify'](_0x5415fa));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js
index 8068652..529e468 100644
--- a/server/services/ami/trigger/integration/servicenow.js
+++ b/server/services/ami/trigger/integration/servicenow.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb2b5=['sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','type','string','nameField','idField','customField','content','variable','toLowerCase','variableName','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','md5','ioredis','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId'];(function(_0x45c001,_0x38db9a){var _0x2603a6=function(_0x5903a0){while(--_0x5903a0){_0x45c001['push'](_0x45c001['shift']());}};_0x2603a6(++_0x38db9a);}(_0xb2b5,0xa3));var _0x5b2b=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xb2b5[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require('request-promise');var util=require('util');var md5=require(_0x5b2b('0x0'));var Redis=require(_0x5b2b('0x1'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x5b2b('0x2'))(_0x5b2b('0x3'));config[_0x5b2b('0x4')]=_[_0x5b2b('0x5')](config['redis'],{'host':_0x5b2b('0x6'),'port':0x18eb});var io=require(_0x5b2b('0x7'))(new Redis(config['redis']));function getAdminUser(_0x54389e,_0x1e08e6,_0x8e6e14,_0x2a7fa8,_0x168af6,_0x6cc9ab){return new Promise(function(_0x29d7be,_0x15425f){var _0xa39fc6={'method':'GET','uri':_0x2a7fa8+_0x5b2b('0x8')+'&'+_0x168af6+'&'+_0x6cc9ab,'auth':_0x1e08e6,'json':!![]};return rp(_0xa39fc6)[_0x5b2b('0x9')](function(_0x53e4ca){if(_0x53e4ca[_0x5b2b('0xa')][_0x5b2b('0xb')]>0x0){_0x8e6e14['adminId']=_0x53e4ca[_0x5b2b('0xa')][0x0][_0x5b2b('0xc')];}logger[_0x5b2b('0xd')]('['+[_0x54389e[_0x5b2b('0xe')]()]+_0x5b2b('0xf'),_0x8e6e14);_0x29d7be(_0x8e6e14);})[_0x5b2b('0x10')](function(_0x235bae){logger['error']('['+[_0x54389e[_0x5b2b('0xe')]()]+']',_0x235bae['message']);_0x15425f(_0x235bae[_0x5b2b('0x11')]);});});}function getUser(_0x36e1bc,_0x3f5236,_0x2611a3,_0x4ff4ba,_0x310060){return function(_0x57b38f){logger[_0x5b2b('0xd')]('['+[_0x36e1bc['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x57b38f);return new Promise(function(_0x44be6d,_0x16e49b){if(intUtil['validateEmail'](_0x57b38f[_0x5b2b('0x12')])){var _0x2db9ee={'method':_0x5b2b('0x13'),'uri':_0x2611a3+_0x5b2b('0x14')+_0x57b38f[_0x5b2b('0x12')]+'&'+_0x4ff4ba+'&'+_0x310060,'auth':_0x3f5236,'json':!![]};logger['info']('['+[_0x36e1bc[_0x5b2b('0xe')]()]+_0x5b2b('0x15'),_0x2db9ee);return rp(_0x2db9ee)[_0x5b2b('0x9')](function(_0x318e05){logger[_0x5b2b('0xd')]('['+[_0x36e1bc[_0x5b2b('0xe')]()]+_0x5b2b('0x16'),_0x318e05);if(_0x318e05[_0x5b2b('0xa')][_0x5b2b('0xb')]>0x0&&String(_0x318e05[_0x5b2b('0xa')][0x0][_0x5b2b('0x17')])===_0x5b2b('0x18')){_0x57b38f[_0x5b2b('0x19')]=_0x318e05[_0x5b2b('0xa')][0x0]['sys_id'];}else{_0x57b38f['userId']=_0x57b38f[_0x5b2b('0x1a')];_0x57b38f['userEmail']=_0x57b38f[_0x5b2b('0x1b')];}logger['info']('['+[_0x36e1bc[_0x5b2b('0xe')]()]+_0x5b2b('0x1c'),_0x57b38f);_0x44be6d(_0x57b38f);})[_0x5b2b('0x10')](function(_0x37cbd8){logger[_0x5b2b('0x1d')]('['+[_0x36e1bc['toUpperCase']()]+']',_0x37cbd8[_0x5b2b('0x11')]);_0x16e49b(_0x37cbd8[_0x5b2b('0x11')]);});}else{logger['info']('['+[_0x36e1bc[_0x5b2b('0xe')]()]+_0x5b2b('0x1e'));_0x57b38f['userId']=_0x57b38f[_0x5b2b('0x1a')];_0x57b38f[_0x5b2b('0x12')]=_0x57b38f[_0x5b2b('0x1b')];_0x44be6d(_0x57b38f);}});};}function createEndUser(_0x1bfd12,_0x3e3ca7,_0x94d866,_0x57284a,_0x2c80be){logger[_0x5b2b('0xd')]('['+[_0x1bfd12[_0x5b2b('0xe')]()]+_0x5b2b('0x1f'),_0x94d866);return new Promise(function(_0x45a0cd,_0x5930ef){var _0x3ff027={'method':_0x5b2b('0x20'),'uri':_0x57284a+_0x5b2b('0x21')+_0x2c80be,'body':{'user_name':_0x94d866[_0x5b2b('0x22')],'roles':_0x5b2b('0x23'),'first_name':_0x94d866[_0x5b2b('0x22')],'active':'true','date_format':_0x5b2b('0x24'),'phone':_0x94d866[_0x5b2b('0x22')]},'auth':_0x3e3ca7,'json':!![]};return rp(_0x3ff027)[_0x5b2b('0x9')](function(_0x1127b0){logger[_0x5b2b('0xd')]('['+[_0x1bfd12[_0x5b2b('0xe')]()]+_0x5b2b('0x25'),_0x1127b0[_0x5b2b('0xa')]);_0x94d866[_0x5b2b('0x26')]=_0x1127b0[_0x5b2b('0xa')]['sys_id'];_0x45a0cd(_0x94d866);})[_0x5b2b('0x10')](function(_0xd2cc6){logger[_0x5b2b('0x1d')]('['+[_0x1bfd12[_0x5b2b('0xe')]()]+']',_0xd2cc6[_0x5b2b('0x11')]);_0x5930ef(_0xd2cc6[_0x5b2b('0x11')]);});});}function getEndUser(_0x39821a,_0x1adc11,_0x2ea8f2,_0x508ea5,_0x124a42){return function(_0x349e56){logger[_0x5b2b('0xd')]('['+[_0x39821a[_0x5b2b('0xe')]()]+'],\x20getEndUser\x20input\x20crm',_0x349e56);return new Promise(function(_0x531054,_0x2ea56b){var _0x5a9572={'method':_0x5b2b('0x13'),'uri':_0x2ea8f2+_0x5b2b('0x27')+_0x349e56[_0x5b2b('0x22')]+'&'+_0x508ea5+'&'+_0x124a42,'auth':_0x1adc11,'json':!![]};return rp(_0x5a9572)[_0x5b2b('0x9')](function(_0x5cdf37){if(_0x5cdf37[_0x5b2b('0xa')][_0x5b2b('0xb')]>0x0){_0x349e56[_0x5b2b('0x26')]=_0x5cdf37[_0x5b2b('0xa')][0x0][_0x5b2b('0xc')];logger[_0x5b2b('0xd')]('['+[_0x39821a[_0x5b2b('0xe')]()]+'],\x20getEndUser\x20crm',_0x349e56);_0x531054(_0x349e56);}else{return createEndUser(_0x39821a,_0x1adc11,_0x349e56,_0x2ea8f2,_0x508ea5)['then'](function(_0x411857){logger[_0x5b2b('0xd')]('['+[_0x39821a['toUpperCase']()]+_0x5b2b('0x28'),_0x411857);_0x531054(_0x411857);});}})[_0x5b2b('0x10')](function(_0x501615){logger['error']('['+[_0x39821a['toUpperCase']()]+']',_0x501615[_0x5b2b('0x11')]);_0x2ea56b(_0x501615[_0x5b2b('0x11')]);});});};}function getCustomFields(_0x2317ca,_0xe2238e){var _0x49aeca={};if(_0x2317ca['length']>0x0){_[_0x5b2b('0x29')](_0x2317ca,function(_0x5ee112){if(_0x5ee112[_0x5b2b('0x2a')]===_0x5b2b('0x2b')&&_0x5ee112[_0x5b2b('0x2c')]&&!_0x5ee112['customField']){_0x49aeca[_0x5ee112[_0x5b2b('0x2d')]['toLowerCase']()]=_0x5ee112['content']['toString']();}else if(_0x5ee112[_0x5b2b('0x2a')]===_0x5b2b('0x2b')&&_0x5ee112[_0x5b2b('0x2d')]&&_0x5ee112[_0x5b2b('0x2e')]){_0x49aeca[_0x5ee112[_0x5b2b('0x2d')]['toLowerCase']()]=_0x5ee112[_0x5b2b('0x2f')]['toString']();}else if(_0x5ee112[_0x5b2b('0x2a')]===_0x5b2b('0x30')&&_0x5ee112['variableName']&&_0x5ee112[_0x5b2b('0x2d')]&&_0x5ee112[_0x5b2b('0x2e')]){_0x49aeca[_0x5ee112['idField'][_0x5b2b('0x31')]()]=_0xe2238e[_0x5ee112[_0x5b2b('0x32')]][_0x5b2b('0x33')]();}else if(_0x5ee112['type']===_0x5b2b('0x34')&&_0x5ee112[_0x5b2b('0x35')]&&_0x5ee112[_0x5b2b('0x35')][_0x5b2b('0x36')]&&_0x5ee112[_0x5b2b('0x2d')]&&_0x5ee112[_0x5b2b('0x2e')]){_0x49aeca[_0x5ee112[_0x5b2b('0x2d')][_0x5b2b('0x31')]()]=_0xe2238e[_0x5ee112[_0x5b2b('0x35')]['name'][_0x5b2b('0x31')]()][_0x5b2b('0x33')]();}});}return _0x49aeca;}function getTicket(_0x1de131,_0x33efee,_0x541953,_0x2e8832,_0x57ebea,_0x4a7d7b){return function(_0x4f4a57){logger['info']('['+[_0x1de131[_0x5b2b('0xe')]()]+_0x5b2b('0x37'),_0x4f4a57);return new Promise(function(_0x24b948,_0x3ee657){var _0x21451e=_0x1de131[_0x5b2b('0x31')]()===_0x5b2b('0x38')?_0x4f4a57['userId']:_0x4f4a57[_0x5b2b('0x26')];var _0x1f814c={'method':'POST','uri':_0x541953+'incident'+'?'+_0x4a7d7b,'body':Object[_0x5b2b('0x39')]({},{'active':'true','caller_id':_0x21451e,'assigned_to':_0x4f4a57['userId'],'short_description':intUtil[_0x5b2b('0x3a')](_0x2e8832[_0x5b2b('0x3b')],_0x57ebea,'\x20'),'description':intUtil[_0x5b2b('0x3a')](_0x2e8832[_0x5b2b('0x3c')],_0x57ebea,'\x0a')},getCustomFields(_0x2e8832['Fields'],_0x57ebea)),'auth':_0x33efee,'json':!![]};return rp(_0x1f814c)[_0x5b2b('0x9')](function(_0x2d14cc){logger['info']('['+[_0x1de131['toUpperCase']()]+_0x5b2b('0x3d'),_0x2d14cc[_0x5b2b('0xa')]);_0x4f4a57[_0x5b2b('0x3e')]=_0x2d14cc['result']['sys_id'];_0x4f4a57[_0x5b2b('0x3f')]=_0x2d14cc[_0x5b2b('0xa')]['number'];logger[_0x5b2b('0xd')]('['+[_0x1de131[_0x5b2b('0xe')]()]+']\x20getTicket\x20crm',_0x4f4a57);_0x24b948(_0x4f4a57);})[_0x5b2b('0x10')](function(_0x4f3a07){logger['error']('['+[_0x1de131[_0x5b2b('0xe')]()]+']',_0x4f3a07[_0x5b2b('0x11')]);_0x3ee657(_0x4f3a07[_0x5b2b('0x11')]);});});};}function createRemoteTag(_0x2fe144,_0x585789,_0xa7da0d,_0x57e376){return new Promise(function(_0x44b2b8,_0x498c27){var _0x341816={'method':_0x5b2b('0x20'),'uri':_0xa7da0d+_0x5b2b('0x40')+'?'+_0x57e376,'body':{'short_description':_0x2fe144,'global':!![],'active':!![],'name':_0x2fe144},'auth':_0x585789,'json':!![]};return rp(_0x341816)[_0x5b2b('0x9')](function(_0x503d2b){var _0x1d0efe=_0x503d2b[_0x5b2b('0xa')][_0x5b2b('0xc')];_0x44b2b8(_0x1d0efe);});});}function getRemoteTag(_0x593501,_0x42fac9,_0x5a0e86,_0x536648,_0x420c4d){return new Promise(function(_0xfdcbf1,_0xb9eb98){var _0x35733d={'method':_0x5b2b('0x13'),'uri':_0x5a0e86+_0x5b2b('0x40')+_0x5b2b('0x41')+_0x593501+'&'+_0x536648,'auth':_0x42fac9,'json':!![]};return rp(_0x35733d)['then'](function(_0x45cf58){if(_0x45cf58[_0x5b2b('0xa')][_0x5b2b('0xb')]>0x0){var _0x5959ea=_0x45cf58[_0x5b2b('0xa')][0x0][_0x5b2b('0xc')];_0xfdcbf1(_0x5959ea);}else{return createRemoteTag(_0x593501,_0x42fac9,_0x5a0e86,_0x536648)['then'](function(_0x4eceb9){_0xfdcbf1(_0x4eceb9);});}});});}function assignTagToIncident(_0x26e063,_0x530d99,_0x37f4fa,_0x106409,_0xe71e33){return new Promise(function(_0x27e68b,_0x37f78b){var _0x1d914f={'method':_0x5b2b('0x20'),'uri':_0x37f4fa+_0x5b2b('0x42')+'?'+_0xe71e33,'body':{'label':_0x26e063,'table':_0x5b2b('0x43'),'id_type':_0x5b2b('0x44'),'table_key':_0x106409[_0x5b2b('0x3e')],'title':_0x5b2b('0x45')+_0x106409[_0x5b2b('0x3f')],'id_display':_0x106409[_0x5b2b('0x3f')]},'auth':_0x530d99,'json':!![]};return rp(_0x1d914f)['then'](function(_0x48f869){_0x27e68b();})[_0x5b2b('0x10')](function(){_0x27e68b();});});}function manageTags(_0x35a0d6,_0x5f3c42,_0x581a72,_0x3a91cf,_0x477578,_0x24e47d,_0x1be3e0){return new Promise(function(_0x40af7b,_0x135d8c){var _0xa9c28c=[];_0x5f3c42['forEach'](function(_0x573200){_0xa9c28c['push'](getRemoteTag(_0x573200,_0x581a72,_0x3a91cf,_0x24e47d,_0x1be3e0));});return Promise[_0x5b2b('0x46')](_0xa9c28c)[_0x5b2b('0x9')](function(_0x90f792){if(_0x90f792[_0x5b2b('0xb')]){logger[_0x5b2b('0xd')]('['+[_0x35a0d6['toUpperCase']()]+_0x5b2b('0x47'),_0x90f792);var _0x5a523b=[];_0x90f792[_0x5b2b('0x29')](function(_0x197bda){_0x5a523b['push'](assignTagToIncident(_0x197bda,_0x581a72,_0x3a91cf,_0x477578,_0x24e47d));});return Promise[_0x5b2b('0x46')](_0x5a523b)['then'](function(){_0x40af7b();})[_0x5b2b('0x10')](function(){_0x40af7b();});}else{_0x40af7b();}});});}function getTags(_0x467624,_0x56e334,_0x394401,_0x7e1906,_0x2e8260,_0x24f79c){return function(_0x4ff350){return new Promise(function(_0x203ab1,_0x494a6d){var _0x45ffdc=[];var _0x33c4e5=_0x7e1906['Tags'];if(_0x33c4e5&&_0x33c4e5[_0x5b2b('0xb')]>0x0){_0x45ffdc=_[_0x5b2b('0x48')](_0x33c4e5,'name');}if(_0x45ffdc['length']>0x0){return manageTags(_0x467624,_0x45ffdc,_0x56e334,_0x394401,_0x4ff350,_0x2e8260,_0x24f79c)[_0x5b2b('0x9')](function(){_0x203ab1(_0x4ff350);});}else{_0x203ab1(_0x4ff350);}});};}function emit(_0x255de4,_0x282a6d,_0x1c29ed){var _0x4edbf1=_0x5b2b('0x49')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x9f803b={'uri':_0x255de4+_0x5b2b('0x4a')+_0x1c29ed+_0x4edbf1};io['to'](util['format'](_0x5b2b('0x4b'),_0x282a6d))[_0x5b2b('0x4c')]('trigger:browser:url',_0x9f803b);}exports['cs']=function(_0x54a55f,_0x154a5b,_0x30a14c,_0xb2b53c,_0x5a6a0f,_0x5e2a7f,_0x1127ae,_0x4c8053){var _0x2e5fcb={};var _0x29af50={'user':_0x5e2a7f[_0x5b2b('0x4d')],'pass':_0x5e2a7f[_0x5b2b('0x4e')]};var _0x2d19cb=_0x5b2b('0x4f');var _0x3f79e9='sysparm_display_value=true';_0x5e2a7f[_0x5b2b('0x50')]=intUtil[_0x5b2b('0x51')](_0x5e2a7f['remoteUri']);_0x5e2a7f['serverUrl']=intUtil[_0x5b2b('0x51')](_0x5e2a7f[_0x5b2b('0x52')]);var _0x55e1d1=util[_0x5b2b('0x53')](_0x5b2b('0x54'),_0x5e2a7f['remoteUri']);_0x2e5fcb[_0x5b2b('0x12')]=!_[_0x5b2b('0x55')](_0xb2b53c)?_0xb2b53c[_0x5b2b('0x56')]:null;_0x2e5fcb[_0x5b2b('0x1b')]=_0x5e2a7f[_0x5b2b('0x56')];_0x2e5fcb[_0x5b2b('0x22')]=_0x4c8053[_0x5b2b('0x31')]()===_0x5b2b('0x38')?_0x154a5b[_0x5b2b('0x57')]:_0x154a5b['calleridnum'];_0x2e5fcb['callDirection']=_0x4c8053===_0x5b2b('0x58')||_0x4c8053===_0x5b2b('0x59')?_0x5b2b('0x58'):_0x5b2b('0x38');var _0x5a6333=util[_0x5b2b('0x53')](_0x5b2b('0x5a'),_0x5e2a7f['serverUrl'],_0x154a5b[_0x5b2b('0x5b')],md5(_0x154a5b['uniqueid']));if(_0x5a6a0f&&_0x5a6a0f['monitor_format']){logger['info'](_0x5b2b('0x5c'),_0x5b2b('0x5d'));_0x154a5b[_0x5b2b('0x5e')]=_0x5a6333;}else if(_0x1127ae&&_0x1127ae['recordingFormat']&&_0x1127ae[_0x5b2b('0x5f')]!=='none'){logger[_0x5b2b('0xd')](_0x5b2b('0x60'),_0x5b2b('0x5d'));_0x154a5b[_0x5b2b('0x5e')]=_0x5a6333;}else{_0x154a5b['recordingURL']='';}return getAdminUser(_0x4c8053,_0x29af50,_0x2e5fcb,_0x55e1d1,_0x3f79e9,_0x2d19cb)[_0x5b2b('0x9')](getUser(_0x4c8053,_0x29af50,_0x55e1d1,_0x3f79e9,_0x2d19cb))[_0x5b2b('0x9')](getEndUser(_0x4c8053,_0x29af50,_0x55e1d1,_0x3f79e9,_0x2d19cb))[_0x5b2b('0x9')](getTicket(_0x4c8053,_0x29af50,_0x55e1d1,_0x30a14c,_0x154a5b,_0x3f79e9))[_0x5b2b('0x9')](function(_0x3c5e07){logger[_0x5b2b('0xd')](util[_0x5b2b('0x53')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3c5e07[_0x5b2b('0x3e')]));logger['info'](util[_0x5b2b('0x53')](_0x5b2b('0x61'),_0x4c8053));if(_0x4c8053!==_0x5b2b('0x59')){logger[_0x5b2b('0xd')]('['+[_0x4c8053[_0x5b2b('0xe')]()]+']',_0x5b2b('0x62'));emit(_0x5e2a7f[_0x5b2b('0x50')],_0xb2b53c['name'],_0x3c5e07[_0x5b2b('0x3e')]);}})['catch'](function(_0x4c6954){logger[_0x5b2b('0x1d')]('['+[_0x4c8053['toUpperCase']()]+_0x5b2b('0x63'),util[_0x5b2b('0x64')](_0x4c6954,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xa98d=['customField','toLowerCase','content','toString','string','idField','variable','variableName','customVariable','name','Variable','assign','getString','Descriptions','Fields','ticketNumber','label','?sysparm_query=name%3D','label_entry','incident','Incident','ticketId','push','all','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','remoteUri','stripTrailingSlash','serverUrl','isNil','email','outbound','destcalleridnum','calleridnum','abandoned','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','result','active','true','adminEmail','userId','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','type','nameField'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0xa98d,0xa3));var _0xda98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xda98('0x0'));var Promise=require('bluebird');var rp=require(_0xda98('0x1'));var util=require('util');var md5=require(_0xda98('0x2'));var Redis=require(_0xda98('0x3'));var intUtil=require('./util');var config=require(_0xda98('0x4'));var logger=require(_0xda98('0x5'))(_0xda98('0x6'));config['redis']=_[_0xda98('0x7')](config[_0xda98('0x8')],{'host':_0xda98('0x9'),'port':0x18eb});var io=require(_0xda98('0xa'))(new Redis(config[_0xda98('0x8')]));function getAdminUser(_0x3706ba,_0x59b7fc,_0x3f7a45,_0x4ad603,_0x1df38a,_0x2aa3a3){return new Promise(function(_0x589b3b,_0x3ba148){var _0x350a3c={'method':'GET','uri':_0x4ad603+_0xda98('0xb')+'&'+_0x1df38a+'&'+_0x2aa3a3,'auth':_0x59b7fc,'json':!![]};return rp(_0x350a3c)[_0xda98('0xc')](function(_0x351bdb){if(_0x351bdb['result'][_0xda98('0xd')]>0x0){_0x3f7a45[_0xda98('0xe')]=_0x351bdb['result'][0x0][_0xda98('0xf')];}logger[_0xda98('0x10')]('['+[_0x3706ba[_0xda98('0x11')]()]+_0xda98('0x12'),_0x3f7a45);_0x589b3b(_0x3f7a45);})[_0xda98('0x13')](function(_0x2122d5){logger[_0xda98('0x14')]('['+[_0x3706ba['toUpperCase']()]+']',_0x2122d5['message']);_0x3ba148(_0x2122d5[_0xda98('0x15')]);});});}function getUser(_0x36fb2f,_0x28c180,_0x5b04cb,_0x44dd82,_0xcc4fdb){return function(_0x13e47d){logger[_0xda98('0x10')]('['+[_0x36fb2f['toUpperCase']()]+_0xda98('0x16'),_0x13e47d);return new Promise(function(_0x41cdb0,_0x2e86a3){if(intUtil[_0xda98('0x17')](_0x13e47d[_0xda98('0x18')])){var _0x51bb58={'method':_0xda98('0x19'),'uri':_0x5b04cb+_0xda98('0x1a')+_0x13e47d[_0xda98('0x18')]+'&'+_0x44dd82+'&'+_0xcc4fdb,'auth':_0x28c180,'json':!![]};logger['info']('['+[_0x36fb2f['toUpperCase']()]+_0xda98('0x1b'),_0x51bb58);return rp(_0x51bb58)[_0xda98('0xc')](function(_0x2b3e3e){logger['info']('['+[_0x36fb2f[_0xda98('0x11')]()]+_0xda98('0x1c'),_0x2b3e3e);if(_0x2b3e3e[_0xda98('0x1d')][_0xda98('0xd')]>0x0&&String(_0x2b3e3e[_0xda98('0x1d')][0x0][_0xda98('0x1e')])===_0xda98('0x1f')){_0x13e47d['userId']=_0x2b3e3e['result'][0x0]['sys_id'];}else{_0x13e47d['userId']=_0x13e47d[_0xda98('0xe')];_0x13e47d[_0xda98('0x18')]=_0x13e47d[_0xda98('0x20')];}logger[_0xda98('0x10')]('['+[_0x36fb2f[_0xda98('0x11')]()]+'],\x20getUser\x20crm',_0x13e47d);_0x41cdb0(_0x13e47d);})['catch'](function(_0x3de0ce){logger['error']('['+[_0x36fb2f[_0xda98('0x11')]()]+']',_0x3de0ce['message']);_0x2e86a3(_0x3de0ce[_0xda98('0x15')]);});}else{logger[_0xda98('0x10')]('['+[_0x36fb2f[_0xda98('0x11')]()]+']\x20using\x20admin\x20profile');_0x13e47d[_0xda98('0x21')]=_0x13e47d[_0xda98('0xe')];_0x13e47d['userEmail']=_0x13e47d[_0xda98('0x20')];_0x41cdb0(_0x13e47d);}});};}function createEndUser(_0x405a75,_0x53d5ae,_0x591be7,_0x312f53,_0x3ddd61){logger[_0xda98('0x10')]('['+[_0x405a75[_0xda98('0x11')]()]+'],\x20createEndUser\x20input\x20crm',_0x591be7);return new Promise(function(_0x44aa85,_0x3c218b){var _0x27d180={'method':_0xda98('0x22'),'uri':_0x312f53+_0xda98('0x23')+_0x3ddd61,'body':{'user_name':_0x591be7[_0xda98('0x24')],'roles':_0xda98('0x25'),'first_name':_0x591be7[_0xda98('0x24')],'active':'true','date_format':_0xda98('0x26'),'phone':_0x591be7[_0xda98('0x24')]},'auth':_0x53d5ae,'json':!![]};return rp(_0x27d180)[_0xda98('0xc')](function(_0x255a78){logger[_0xda98('0x10')]('['+[_0x405a75[_0xda98('0x11')]()]+_0xda98('0x27'),_0x255a78[_0xda98('0x1d')]);_0x591be7[_0xda98('0x28')]=_0x255a78[_0xda98('0x1d')][_0xda98('0xf')];_0x44aa85(_0x591be7);})[_0xda98('0x13')](function(_0x570f7f){logger[_0xda98('0x14')]('['+[_0x405a75[_0xda98('0x11')]()]+']',_0x570f7f[_0xda98('0x15')]);_0x3c218b(_0x570f7f[_0xda98('0x15')]);});});}function getEndUser(_0x50d84e,_0x1f15b7,_0x2ed563,_0x29e149,_0x4348a3){return function(_0x54a35e){logger[_0xda98('0x10')]('['+[_0x50d84e[_0xda98('0x11')]()]+_0xda98('0x29'),_0x54a35e);return new Promise(function(_0x51a114,_0x238e59){var _0x5dc1b9={'method':'GET','uri':_0x2ed563+_0xda98('0x2a')+_0x54a35e['endUserNumber']+'&'+_0x29e149+'&'+_0x4348a3,'auth':_0x1f15b7,'json':!![]};return rp(_0x5dc1b9)['then'](function(_0x4b6ddc){if(_0x4b6ddc[_0xda98('0x1d')]['length']>0x0){_0x54a35e[_0xda98('0x28')]=_0x4b6ddc['result'][0x0][_0xda98('0xf')];logger[_0xda98('0x10')]('['+[_0x50d84e[_0xda98('0x11')]()]+_0xda98('0x2b'),_0x54a35e);_0x51a114(_0x54a35e);}else{return createEndUser(_0x50d84e,_0x1f15b7,_0x54a35e,_0x2ed563,_0x29e149)['then'](function(_0x4a0b1d){logger['info']('['+[_0x50d84e[_0xda98('0x11')]()]+'],\x20createEndUser\x20crm',_0x4a0b1d);_0x51a114(_0x4a0b1d);});}})[_0xda98('0x13')](function(_0x3aa9ae){logger['error']('['+[_0x50d84e[_0xda98('0x11')]()]+']',_0x3aa9ae['message']);_0x238e59(_0x3aa9ae[_0xda98('0x15')]);});});};}function getCustomFields(_0x524112,_0x56da1b){var _0x34111f={};if(_0x524112[_0xda98('0xd')]>0x0){_[_0xda98('0x2c')](_0x524112,function(_0x1daf9d){if(_0x1daf9d[_0xda98('0x2d')]==='string'&&_0x1daf9d[_0xda98('0x2e')]&&!_0x1daf9d[_0xda98('0x2f')]){_0x34111f[_0x1daf9d['idField'][_0xda98('0x30')]()]=_0x1daf9d[_0xda98('0x31')][_0xda98('0x32')]();}else if(_0x1daf9d[_0xda98('0x2d')]===_0xda98('0x33')&&_0x1daf9d[_0xda98('0x34')]&&_0x1daf9d['customField']){_0x34111f[_0x1daf9d[_0xda98('0x34')][_0xda98('0x30')]()]=_0x1daf9d[_0xda98('0x31')][_0xda98('0x32')]();}else if(_0x1daf9d[_0xda98('0x2d')]===_0xda98('0x35')&&_0x1daf9d[_0xda98('0x36')]&&_0x1daf9d[_0xda98('0x34')]&&_0x1daf9d[_0xda98('0x2f')]){_0x34111f[_0x1daf9d[_0xda98('0x34')][_0xda98('0x30')]()]=_0x56da1b[_0x1daf9d[_0xda98('0x36')]][_0xda98('0x32')]();}else if(_0x1daf9d[_0xda98('0x2d')]===_0xda98('0x37')&&_0x1daf9d['Variable']&&_0x1daf9d['Variable'][_0xda98('0x38')]&&_0x1daf9d[_0xda98('0x34')]&&_0x1daf9d['customField']){_0x34111f[_0x1daf9d[_0xda98('0x34')]['toLowerCase']()]=_0x56da1b[_0x1daf9d[_0xda98('0x39')]['name'][_0xda98('0x30')]()][_0xda98('0x32')]();}});}return _0x34111f;}function getTicket(_0x49476e,_0x53a7be,_0x412f73,_0x378685,_0x47f9c2,_0x54e0ac){return function(_0x218c3b){logger['info']('['+[_0x49476e[_0xda98('0x11')]()]+']\x20getTicket\x20input\x20crm',_0x218c3b);return new Promise(function(_0x362a88,_0x526037){var _0x25ff5f=_0x49476e['toLowerCase']()==='outbound'?_0x218c3b['userId']:_0x218c3b[_0xda98('0x28')];var _0x127a90={'method':'POST','uri':_0x412f73+'incident'+'?'+_0x54e0ac,'body':Object[_0xda98('0x3a')]({},{'active':'true','caller_id':_0x25ff5f,'assigned_to':_0x218c3b[_0xda98('0x21')],'short_description':intUtil[_0xda98('0x3b')](_0x378685['Subjects'],_0x47f9c2,'\x20'),'description':intUtil[_0xda98('0x3b')](_0x378685[_0xda98('0x3c')],_0x47f9c2,'\x0a')},getCustomFields(_0x378685[_0xda98('0x3d')],_0x47f9c2)),'auth':_0x53a7be,'json':!![]};return rp(_0x127a90)[_0xda98('0xc')](function(_0x3808d8){logger[_0xda98('0x10')]('['+[_0x49476e[_0xda98('0x11')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x3808d8['result']);_0x218c3b['ticketId']=_0x3808d8[_0xda98('0x1d')][_0xda98('0xf')];_0x218c3b[_0xda98('0x3e')]=_0x3808d8[_0xda98('0x1d')]['number'];logger['info']('['+[_0x49476e[_0xda98('0x11')]()]+']\x20getTicket\x20crm',_0x218c3b);_0x362a88(_0x218c3b);})[_0xda98('0x13')](function(_0x81ab24){logger[_0xda98('0x14')]('['+[_0x49476e[_0xda98('0x11')]()]+']',_0x81ab24[_0xda98('0x15')]);_0x526037(_0x81ab24[_0xda98('0x15')]);});});};}function createRemoteTag(_0x23ab80,_0x4c04a9,_0x3a6fff,_0x3e0d5e){return new Promise(function(_0x35b8f8,_0x527404){var _0xcbcd3b={'method':_0xda98('0x22'),'uri':_0x3a6fff+_0xda98('0x3f')+'?'+_0x3e0d5e,'body':{'short_description':_0x23ab80,'global':!![],'active':!![],'name':_0x23ab80},'auth':_0x4c04a9,'json':!![]};return rp(_0xcbcd3b)[_0xda98('0xc')](function(_0x22eb7a){var _0x4133e9=_0x22eb7a[_0xda98('0x1d')][_0xda98('0xf')];_0x35b8f8(_0x4133e9);});});}function getRemoteTag(_0x52b3d2,_0x450931,_0x473571,_0x291e5d,_0x4010c8){return new Promise(function(_0x6e071d,_0x1a436d){var _0x1179eb={'method':_0xda98('0x19'),'uri':_0x473571+_0xda98('0x3f')+_0xda98('0x40')+_0x52b3d2+'&'+_0x291e5d,'auth':_0x450931,'json':!![]};return rp(_0x1179eb)['then'](function(_0x7cbf44){if(_0x7cbf44[_0xda98('0x1d')][_0xda98('0xd')]>0x0){var _0x4d57c0=_0x7cbf44[_0xda98('0x1d')][0x0]['sys_id'];_0x6e071d(_0x4d57c0);}else{return createRemoteTag(_0x52b3d2,_0x450931,_0x473571,_0x291e5d)[_0xda98('0xc')](function(_0xbc9f02){_0x6e071d(_0xbc9f02);});}});});}function assignTagToIncident(_0x2e0fb0,_0x5d47ea,_0x22f9ae,_0x577f5c,_0x14edaa){return new Promise(function(_0x2a61bc,_0x3d540f){var _0x593323={'method':_0xda98('0x22'),'uri':_0x22f9ae+_0xda98('0x41')+'?'+_0x14edaa,'body':{'label':_0x2e0fb0,'table':_0xda98('0x42'),'id_type':_0xda98('0x43'),'table_key':_0x577f5c[_0xda98('0x44')],'title':'Incident\x20-\x20'+_0x577f5c[_0xda98('0x3e')],'id_display':_0x577f5c[_0xda98('0x3e')]},'auth':_0x5d47ea,'json':!![]};return rp(_0x593323)[_0xda98('0xc')](function(_0x6e4994){_0x2a61bc();})['catch'](function(){_0x2a61bc();});});}function manageTags(_0x48030f,_0x4774a1,_0x38eb55,_0x1b1a22,_0x1ccb3d,_0x20e127,_0x3891f1){return new Promise(function(_0x42804f,_0x1bb420){var _0xe611ae=[];_0x4774a1[_0xda98('0x2c')](function(_0xdd9d29){_0xe611ae[_0xda98('0x45')](getRemoteTag(_0xdd9d29,_0x38eb55,_0x1b1a22,_0x20e127,_0x3891f1));});return Promise['all'](_0xe611ae)[_0xda98('0xc')](function(_0x3b9e52){if(_0x3b9e52[_0xda98('0xd')]){logger['info']('['+[_0x48030f[_0xda98('0x11')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x3b9e52);var _0x2a394a=[];_0x3b9e52[_0xda98('0x2c')](function(_0x477cf6){_0x2a394a[_0xda98('0x45')](assignTagToIncident(_0x477cf6,_0x38eb55,_0x1b1a22,_0x1ccb3d,_0x20e127));});return Promise[_0xda98('0x46')](_0x2a394a)['then'](function(){_0x42804f();})['catch'](function(){_0x42804f();});}else{_0x42804f();}});});}function getTags(_0x9e2147,_0x54ae50,_0xca36bf,_0x189a02,_0x222cef,_0x80789b){return function(_0x20e2a8){return new Promise(function(_0x24595f,_0x4bf18e){var _0x1ae96a=[];var _0x2615a1=_0x189a02[_0xda98('0x47')];if(_0x2615a1&&_0x2615a1[_0xda98('0xd')]>0x0){_0x1ae96a=_['map'](_0x2615a1,'name');}if(_0x1ae96a[_0xda98('0xd')]>0x0){return manageTags(_0x9e2147,_0x1ae96a,_0x54ae50,_0xca36bf,_0x20e2a8,_0x222cef,_0x80789b)[_0xda98('0xc')](function(){_0x24595f(_0x20e2a8);});}else{_0x24595f(_0x20e2a8);}});};}function emit(_0x4af265,_0x34a806,_0x2e494c){var _0x5cecc7='%26sysparm_record_target%3Dincident'+_0xda98('0x48')+_0xda98('0x49')+_0xda98('0x4a');var _0x491835={'uri':_0x4af265+_0xda98('0x4b')+_0x2e494c+_0x5cecc7};io['to'](util[_0xda98('0x4c')](_0xda98('0x4d'),_0x34a806))[_0xda98('0x4e')]('trigger:browser:url',_0x491835);}exports['cs']=function(_0x523317,_0xc803ad,_0x48e54b,_0x2f20a7,_0xcf03c6,_0x30b7d9,_0x13735a,_0x19849a){var _0x4847b0={};var _0x5ddbc9={'user':_0x30b7d9[_0xda98('0x4f')],'pass':_0x30b7d9[_0xda98('0x50')]};var _0x5d110f='sysparm_limit=1';var _0x17c736='sysparm_display_value=true';_0x30b7d9[_0xda98('0x51')]=intUtil[_0xda98('0x52')](_0x30b7d9['remoteUri']);_0x30b7d9[_0xda98('0x53')]=intUtil['stripTrailingSlash'](_0x30b7d9[_0xda98('0x53')]);var _0x2fcc0f=util[_0xda98('0x4c')]('%s/api/now/table/',_0x30b7d9['remoteUri']);_0x4847b0[_0xda98('0x18')]=!_[_0xda98('0x54')](_0x2f20a7)?_0x2f20a7[_0xda98('0x55')]:null;_0x4847b0[_0xda98('0x20')]=_0x30b7d9[_0xda98('0x55')];_0x4847b0[_0xda98('0x24')]=_0x19849a[_0xda98('0x30')]()===_0xda98('0x56')?_0xc803ad[_0xda98('0x57')]:_0xc803ad[_0xda98('0x58')];_0x4847b0['callDirection']=_0x19849a==='queue'||_0x19849a===_0xda98('0x59')?_0xda98('0x5a'):_0xda98('0x56');var _0x2cebca=util[_0xda98('0x4c')](_0xda98('0x5b'),_0x30b7d9['serverUrl'],_0xc803ad[_0xda98('0x5c')],md5(_0xc803ad[_0xda98('0x5c')]));if(_0xcf03c6&&_0xcf03c6[_0xda98('0x5d')]){logger[_0xda98('0x10')](_0xda98('0x5e'),_0xda98('0x5f'));_0xc803ad[_0xda98('0x60')]=_0x2cebca;}else if(_0x13735a&&_0x13735a[_0xda98('0x61')]&&_0x13735a[_0xda98('0x61')]!==_0xda98('0x62')){logger[_0xda98('0x10')](_0xda98('0x63'),_0xda98('0x5f'));_0xc803ad[_0xda98('0x60')]=_0x2cebca;}else{_0xc803ad[_0xda98('0x60')]='';}return getAdminUser(_0x19849a,_0x5ddbc9,_0x4847b0,_0x2fcc0f,_0x17c736,_0x5d110f)['then'](getUser(_0x19849a,_0x5ddbc9,_0x2fcc0f,_0x17c736,_0x5d110f))['then'](getEndUser(_0x19849a,_0x5ddbc9,_0x2fcc0f,_0x17c736,_0x5d110f))[_0xda98('0xc')](getTicket(_0x19849a,_0x5ddbc9,_0x2fcc0f,_0x48e54b,_0xc803ad,_0x17c736))[_0xda98('0xc')](function(_0x3b3540){logger[_0xda98('0x10')](util[_0xda98('0x4c')](_0xda98('0x64'),_0x3b3540['ticketId']));logger['info'](util[_0xda98('0x4c')](_0xda98('0x65'),_0x19849a));if(_0x19849a!==_0xda98('0x59')){logger[_0xda98('0x10')]('['+[_0x19849a[_0xda98('0x11')]()]+']',_0xda98('0x66'));emit(_0x30b7d9[_0xda98('0x51')],_0x2f20a7[_0xda98('0x38')],_0x3b3540[_0xda98('0x44')]);}})['catch'](function(_0x5c3230){logger[_0xda98('0x14')]('['+[_0x19849a[_0xda98('0x11')]()]+_0xda98('0x67'),util[_0xda98('0x68')](_0x5c3230,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js
index 4937f37..c8d4bbd 100644
--- a/server/services/ami/trigger/integration/sugarcrm.js
+++ b/server/services/ami/trigger/integration/sugarcrm.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5194=['duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','value','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','customField','custom_fields','idField','Variable','login','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','uri','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','Outbound','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','catch','abandoned','[ABANDONED]','request-promise','util','./util','../../../../config/environment','redis','defaults','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','description','Descriptions','toISOString','slice'];(function(_0x535c32,_0x1474c8){var _0x478b3b=function(_0x436ba2){while(--_0x436ba2){_0x535c32['push'](_0x535c32['shift']());}};_0x478b3b(++_0x1474c8);}(_0x5194,0xd5));var _0x4519=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x5194[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var rp=require(_0x4519('0x0'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x4519('0x1'));var Redis=require('ioredis');var intUtil=require(_0x4519('0x2'));var config=require(_0x4519('0x3'));var logger=require('../../../../config/logger')('sugarcrm');config[_0x4519('0x4')]=_[_0x4519('0x5')](config[_0x4519('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4519('0x4')]));var def={'method':_0x4519('0x6'),'json':!![]};function emit(_0x35f7b7,_0x42a70e,_0x1b4a06){io['to'](_0x35f7b7)[_0x4519('0x7')](_0x42a70e,_0x1b4a06);}function getTicket(_0x1dc914,_0x2f19d7,_0x46d023,_0x839b2d,_0x997d93,_0x2e77dd,_0x4c325f,_0xf79cd5){logger[_0x4519('0x8')](_0x4519('0x9'));var _0x27131d=new Date();var _0x37defe=[{'name':'name','value':intUtil[_0x4519('0xa')](_0x839b2d[_0x4519('0xb')],_0x997d93,'\x20')},{'name':_0x4519('0xc'),'value':_0x2f19d7['id']},{'name':'created_by','value':_0x2f19d7['id']},{'name':_0x4519('0xd'),'value':intUtil[_0x4519('0xa')](_0x839b2d[_0x4519('0xe')],_0x997d93,'\x0a')},{'name':'date_start','value':_0x27131d[_0x4519('0xf')]()[_0x4519('0x10')](0x0,0x13)['replace']('T','\x20')},{'name':_0x4519('0x11'),'value':'0'},{'name':_0x4519('0x12'),'value':'15'},{'name':_0x4519('0x13'),'value':_0x46d023['id']},{'name':_0x4519('0x14'),'value':_0x4519('0x15')},{'name':_0x4519('0x16'),'value':_0x46d023[_0x4519('0x17')]},{'name':_0x4519('0x18'),'value':_0xf79cd5}];if(_0x2e77dd[_0x4519('0x19')]){_[_0x4519('0x1a')](_0x2e77dd,function(_0x49aa30){if(_0x997d93[_0x49aa30[_0x4519('0x1b')]]){_0x37defe[_0x4519('0x1c')]({'name':_0x49aa30['idField'],'value':_0x997d93[_0x49aa30[_0x4519('0x1b')]]});}});}return request({'form':{'method':_0x4519('0x1d'),'input_type':_0x4519('0x1e'),'response_type':_0x4519('0x1e'),'rest_data':JSON[_0x4519('0x1f')]({'session':_0x4c325f['id'],'module_name':_0x4519('0x20'),'name_value_list':_0x37defe})}});}function getAuth(_0x2e7ce6){return util[_0x4519('0x21')]('Basic\x20%s',new Buffer(_0x2e7ce6[_0x4519('0x22')]+':X')[_0x4519('0x23')](_0x4519('0x24')));}function getServerInfo(_0x4dc6ca){return request({'form':{'method':_0x4519('0x25'),'input_type':_0x4519('0x1e'),'response_type':_0x4519('0x1e'),'rest_data':JSON[_0x4519('0x1f')]({'session':_0x4dc6ca['id']})}});}function getUser(_0x21e480,_0x373ff5,_0x1f7db3){if(!_[_0x4519('0x26')](_0x373ff5)){logger['info'](_0x4519('0x27'),_0x373ff5);return request({'form':{'method':_0x4519('0x28'),'input_type':_0x4519('0x1e'),'response_type':'JSON','rest_data':JSON[_0x4519('0x1f')]({'session':_0x1f7db3['id'],'module_name':'Employees','query':util['format'](_0x4519('0x29'),_0x373ff5),'order_by':'','offset':'0','select_fields':['id',_0x4519('0x17'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4519('0x2a')](function(_0xf5af91){if(_0xf5af91[_0x4519('0x2b')][_0x4519('0x19')]){var _0x54f1d6=_[_0x4519('0x2c')](_0xf5af91[_0x4519('0x2b')],function(_0x1bc619){return _0x1bc619[_0x4519('0x2d')][_0x4519('0x2e')]['value']===_0x373ff5;});if(_0x54f1d6){logger[_0x4519('0x8')](_0x4519('0x2f'));return BPromise[_0x4519('0x30')]({'id':_0x54f1d6[_0x4519('0x2d')]['id']['value'],'name':_0x54f1d6[_0x4519('0x2d')][_0x4519('0x17')]['value']});}}logger[_0x4519('0x8')](_0x4519('0x31'));return BPromise[_0x4519('0x30')]({'id':_0x1f7db3[_0x4519('0x2d')][_0x4519('0x32')]['value'],'name':_0x1f7db3['name_value_list'][_0x4519('0x2e')][_0x4519('0x33')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x4519('0x30')]({'id':_0x1f7db3[_0x4519('0x2d')][_0x4519('0x32')][_0x4519('0x33')],'name':_0x1f7db3[_0x4519('0x2d')]['user_name'][_0x4519('0x33')]});}}function getEndUser(_0x27536d,_0x28ce2f,_0x59dc63,_0x5994ea){logger['info'](_0x4519('0x34'),_0x59dc63);return request({'form':{'method':_0x4519('0x28'),'input_type':_0x4519('0x1e'),'response_type':'JSON','rest_data':JSON[_0x4519('0x1f')]({'session':_0x5994ea['id'],'module_name':_0x4519('0x15'),'query':util[_0x4519('0x21')](_0x4519('0x35'),_0x59dc63),'order_by':'','offset':'0','select_fields':['id','name',_0x4519('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4519('0x2a')](function(_0x51caa3){if(_0x51caa3[_0x4519('0x2b')]['length']){var _0x4e5c54=_[_0x4519('0x2c')](_0x51caa3['entry_list'],function(_0x9d52b8){return _0x9d52b8[_0x4519('0x2d')][_0x4519('0x36')][_0x4519('0x33')]===_0x59dc63;});if(_0x4e5c54){logger[_0x4519('0x8')](_0x4519('0x37'));return BPromise[_0x4519('0x30')]({'id':_0x4e5c54[_0x4519('0x2d')]['id']['value'],'name':_0x4e5c54[_0x4519('0x2d')][_0x4519('0x17')][_0x4519('0x33')],'phone':_0x4e5c54[_0x4519('0x2d')][_0x4519('0x36')][_0x4519('0x33')]});}}else{logger['info'](_0x4519('0x38'));return request({'form':{'method':_0x4519('0x1d'),'input_type':_0x4519('0x1e'),'response_type':_0x4519('0x1e'),'rest_data':JSON[_0x4519('0x1f')]({'session':_0x5994ea['id'],'module_name':_0x4519('0x15'),'name_value_list':[{'name':_0x4519('0x39'),'value':_0x28ce2f!==_0x4519('0x3a')?_0x28ce2f:util['format'](_0x4519('0x3b'),_0x59dc63)},{'name':_0x4519('0x36'),'value':_0x59dc63}]})}})[_0x4519('0x2a')](function(_0x11d34e){logger[_0x4519('0x8')]('Enduser\x20created.');return BPromise[_0x4519('0x30')]({'id':_0x11d34e['id'],'name':_0x11d34e['entry_list'][_0x4519('0x39')][_0x4519('0x33')],'phone':_0x11d34e[_0x4519('0x2b')]['phone_home']['value']});});}});}function request(_0x1baae9){logger[_0x4519('0x3c')](_0x4519('0x3d'),JSON[_0x4519('0x1f')](_0x1baae9));return rp(_[_0x4519('0x3e')](def,_0x1baae9));}function getTags(_0x549098,_0x4e7a89){var _0x58fce2=[];if(_0x549098&&_0x549098[_0x4519('0x19')]>0x0){_0x58fce2=_[_0x4519('0x3f')](_0x549098,_0x4e7a89);}return _0x58fce2;}function getCustomFields(_0xb9ebd0,_0x344b9c){var _0x2fc769=[];var _0x25fc55={'custom_fields':[]};if(_0xb9ebd0[_0x4519('0x19')]>0x0){_['forEach'](_0xb9ebd0,function(_0x12459d){if(_0x12459d[_0x4519('0x40')]===_0x4519('0x41')&&_0x12459d['nameField']&&!_0x12459d['customField']){_0x25fc55[_0x12459d[_0x4519('0x42')][_0x4519('0x43')]()]=_0x12459d[_0x4519('0x44')][_0x4519('0x23')]();}else if(_0x12459d[_0x4519('0x40')]===_0x4519('0x41')&&_0x12459d['idField']&&_0x12459d[_0x4519('0x45')]){_0x25fc55[_0x4519('0x46')][_0x4519('0x1c')]({'id':_0x12459d[_0x4519('0x47')],'value':_0x12459d[_0x4519('0x44')]['toString']()});}else if(_0x12459d[_0x4519('0x40')]==='variable'&&_0x12459d[_0x4519('0x1b')]&&_0x12459d[_0x4519('0x47')]&&_0x12459d[_0x4519('0x45')]){_0x344b9c[_0x12459d[_0x4519('0x1b')]]&&_0x25fc55[_0x4519('0x46')]['push']({'id':_0x12459d['idField'],'value':_0x344b9c[_0x12459d[_0x4519('0x1b')]][_0x4519('0x23')]()});}else if(_0x12459d[_0x4519('0x40')]==='customVariable'&&_0x12459d['Variable']&&_0x12459d[_0x4519('0x48')][_0x4519('0x17')]&&_0x12459d[_0x4519('0x47')]&&_0x12459d[_0x4519('0x45')]){_0x344b9c[_0x12459d[_0x4519('0x48')][_0x4519('0x17')][_0x4519('0x43')]()]&&_0x25fc55['custom_fields'][_0x4519('0x1c')]({'id':_0x12459d[_0x4519('0x47')],'value':_0x344b9c[_0x12459d[_0x4519('0x48')][_0x4519('0x17')][_0x4519('0x43')]()][_0x4519('0x23')]()});}});}return _0x25fc55;}function getConnection(_0x58ee0c){return request({'method':_0x4519('0x6'),'form':{'method':_0x4519('0x49'),'input_type':_0x4519('0x1e'),'response_type':'JSON','rest_data':JSON[_0x4519('0x1f')]({'user_auth':{'user_name':_0x58ee0c['username'],'password':_0x58ee0c['password'],'encryption':_0x4519('0x4a')},'application':_0x4519('0x4b')})}})['then'](function(_0x466910){var _0x2df287=_0x466910;if(_0x2df287['id']){def[_0x4519('0x4c')]=_0x2df287['id'];return BPromise[_0x4519('0x30')](_0x2df287);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x58ee0c['id']));}});}function setRelationship(_0x12529e,_0x416da5,_0x412dcc,_0x945a45){return request({'form':{'method':_0x4519('0x4d'),'input_type':_0x4519('0x1e'),'response_type':'JSON','rest_data':JSON[_0x4519('0x1f')]({'session':_0x12529e['id'],'module_name':_0x4519('0x20'),'module_id':_0x412dcc['id'],'link_field_name':_0x945a45,'related_ids':[_0x416da5['id']]})}});}exports[_0x4519('0x4e')]=function(_0x4155ce,_0x110d1b,_0x1c8d1c,_0x59ce84,_0x28723f,_0x212473){var _0x35f61b,_0x3e919f,_0x579f6c,_0xfeaf0b;_0x212473[_0x4519('0x4f')]=intUtil[_0x4519('0x50')](_0x212473[_0x4519('0x4f')]);_0x212473[_0x4519('0x51')]=intUtil['stripTrailingSlash'](_0x212473[_0x4519('0x51')]);def['uri']=util[_0x4519('0x21')]('%s/service/v4_1/rest.php',_0x212473[_0x4519('0x4f')]);if(_0x28723f&&_0x28723f[_0x4519('0x52')]){logger[_0x4519('0x8')]('[QUEUE]',_0x4519('0x53'));_0x110d1b[_0x4519('0x54')]=util[_0x4519('0x21')](_0x4519('0x55'),_0x212473[_0x4519('0x51')],_0x110d1b['uniqueid'],md5(_0x110d1b[_0x4519('0x56')]));}else{_0x110d1b[_0x4519('0x54')]='';}return getConnection(_0x212473)[_0x4519('0x2a')](function(_0x3af0bd){_0xfeaf0b=_0x3af0bd;return getUser(_0x212473,_0x59ce84[_0x4519('0x17')],_0xfeaf0b);})[_0x4519('0x2a')](function(_0x596200){_0x35f61b=_0x596200;logger[_0x4519('0x8')](_0x4519('0x57'),_0x35f61b['id']);return getEndUser(_0x212473,_0x110d1b[_0x4519('0x58')],_0x110d1b[_0x4519('0x59')],_0xfeaf0b);})[_0x4519('0x2a')](function(_0x495fcb){_0x3e919f=_0x495fcb;logger[_0x4519('0x8')]('The\x20Enduser\x20ID\x20is:',_0x3e919f['id']);return getTicket(_0x212473,_0x35f61b,_0x3e919f,_0x1c8d1c,_0x110d1b,_0x1c8d1c['Fields'],_0xfeaf0b,_0x4519('0x5a'));})[_0x4519('0x2a')](function(_0x5ea3ae){_0x579f6c=_0x5ea3ae;logger['info'](_0x4519('0x5b'));logger[_0x4519('0x8')](_0x4519('0x5c'),_0x579f6c['id']);return setRelationship(_0xfeaf0b,_0x35f61b,_0x579f6c,_0x4519('0x5d'));})[_0x4519('0x2a')](function(){return setRelationship(_0xfeaf0b,_0x3e919f,_0x579f6c,'contacts');})[_0x4519('0x2a')](function(){return getServerInfo(_0xfeaf0b);})[_0x4519('0x2a')](function(_0x429142){var _0x50f28d=parseInt(_0x429142[_0x4519('0x5e')][_0x4519('0x5f')](0x0));var _0x22134b=util['format'](_0x4519('0x60'),_0x212473['remoteUri'],_0x579f6c['id']);if(_0x50f28d>0x6){_0x22134b=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x212473['remoteUri'],_0x579f6c['id']);}logger['info'](_0x4519('0x61'),_0x4519('0x62'));emit(util[_0x4519('0x21')](_0x4519('0x63'),_0x59ce84[_0x4519('0x17')]),_0x4519('0x64'),{'uri':_0x22134b});})['catch'](function(_0x1cb492){logger[_0x4519('0x65')](_0x4519('0x61'),JSON[_0x4519('0x1f')](_0x1cb492));});};exports['outbound']=function(_0x333796,_0x488351,_0x2e272c,_0x18a048,_0x1327c3,_0xb24e5a,_0x1acb3b){var _0x1f8cb0,_0x5e9ab6,_0x6ce677,_0x3fc9f6;_0xb24e5a[_0x4519('0x4f')]=intUtil[_0x4519('0x50')](_0xb24e5a[_0x4519('0x4f')]);_0xb24e5a['serverUrl']=intUtil[_0x4519('0x50')](_0xb24e5a[_0x4519('0x51')]);def[_0x4519('0x66')]=util[_0x4519('0x21')](_0x4519('0x67'),_0xb24e5a[_0x4519('0x4f')]);if(_0x1acb3b&&_0x1acb3b[_0x4519('0x68')]&&_0x1acb3b[_0x4519('0x68')]!=='none'){logger['info'](_0x4519('0x69'),'Recording\x20is\x20enabled!');_0x488351[_0x4519('0x54')]=util[_0x4519('0x21')](_0x4519('0x55'),_0xb24e5a['serverUrl'],_0x488351[_0x4519('0x56')],md5(_0x488351[_0x4519('0x56')]));}return getConnection(_0xb24e5a)[_0x4519('0x2a')](function(_0x136fc5){_0x3fc9f6=_0x136fc5;return getUser(_0xb24e5a,_0x18a048[_0x4519('0x17')],_0x3fc9f6);})[_0x4519('0x2a')](function(_0x40452a){_0x1f8cb0=_0x40452a;logger[_0x4519('0x8')]('The\x20User\x20ID\x20is:',_0x1f8cb0['id']);return getEndUser(_0xb24e5a,_0x488351['destcalleridname'],_0x488351[_0x4519('0x6a')],_0x3fc9f6);})['then'](function(_0x2822c0){_0x5e9ab6=_0x2822c0;logger[_0x4519('0x8')](_0x4519('0x6b'),_0x5e9ab6['id']);return getTicket(_0xb24e5a,_0x1f8cb0,_0x5e9ab6,_0x2e272c,_0x488351,_0x2e272c[_0x4519('0x6c')],_0x3fc9f6,_0x4519('0x6d'));})[_0x4519('0x2a')](function(_0x1a596b){_0x6ce677=_0x1a596b;logger[_0x4519('0x8')](_0x4519('0x5b'));logger['info'](_0x4519('0x5c'),_0x6ce677['id']);return setRelationship(_0x3fc9f6,_0x1f8cb0,_0x6ce677,_0x4519('0x5d'));})[_0x4519('0x2a')](function(){return setRelationship(_0x3fc9f6,_0x5e9ab6,_0x6ce677,_0x4519('0x6e'));})[_0x4519('0x2a')](function(){return getServerInfo(_0x3fc9f6);})[_0x4519('0x2a')](function(_0x11c119){var _0x3dfe0c=parseInt(_0x11c119[_0x4519('0x5e')]['charAt'](0x0));var _0x22c0d8=util[_0x4519('0x21')](_0x4519('0x60'),_0xb24e5a[_0x4519('0x4f')],_0x6ce677['id']);if(_0x3dfe0c>0x6){_0x22c0d8=util['format'](_0x4519('0x6f'),_0xb24e5a['remoteUri'],_0x6ce677['id']);}logger['info'](_0x4519('0x69'),_0x4519('0x62'));emit(util['format'](_0x4519('0x63'),_0x18a048[_0x4519('0x17')]),_0x4519('0x64'),{'uri':_0x22c0d8});})[_0x4519('0x70')](function(_0x36dc6b){logger[_0x4519('0x65')](_0x4519('0x69'),JSON[_0x4519('0x1f')](_0x36dc6b));});};exports[_0x4519('0x71')]=function(_0x3a745b,_0x5322bb,_0x4c1e01,_0x45efbf,_0x112668,_0x2eb1df){var _0x46fe57,_0x4c2628,_0x255dcb,_0x473c0c;_0x2eb1df[_0x4519('0x4f')]=intUtil[_0x4519('0x50')](_0x2eb1df[_0x4519('0x4f')]);_0x2eb1df['serverUrl']=intUtil[_0x4519('0x50')](_0x2eb1df['serverUrl']);def[_0x4519('0x66')]=util[_0x4519('0x21')]('%s/service/v4_1/rest.php',_0x2eb1df[_0x4519('0x4f')]);if(_0x112668&&_0x112668[_0x4519('0x52')]){logger[_0x4519('0x8')](_0x4519('0x72'),'Recording\x20is\x20enabled!');_0x5322bb[_0x4519('0x54')]=util[_0x4519('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2eb1df[_0x4519('0x51')],_0x5322bb[_0x4519('0x56')],md5(_0x5322bb[_0x4519('0x56')]));}else{_0x5322bb[_0x4519('0x54')]='';}return getConnection(_0x2eb1df)['then'](function(_0x52d26){_0x473c0c=_0x52d26;if(!_[_0x4519('0x26')](_0x45efbf)){return getUser(_0x2eb1df,_0x45efbf[_0x4519('0x17')],_0x473c0c);}else{return getUser(_0x2eb1df,null,_0x473c0c);}})[_0x4519('0x2a')](function(_0x59fb81){_0x46fe57=_0x59fb81;logger[_0x4519('0x8')](_0x4519('0x57'),_0x46fe57['id']);return getEndUser(_0x2eb1df,_0x5322bb[_0x4519('0x58')],_0x5322bb[_0x4519('0x59')],_0x473c0c);})[_0x4519('0x2a')](function(_0x431868){_0x4c2628=_0x431868;logger[_0x4519('0x8')](_0x4519('0x6b'),_0x4c2628['id']);return getTicket(_0x2eb1df,_0x46fe57,_0x4c2628,_0x4c1e01,_0x5322bb,_0x4c1e01[_0x4519('0x6c')],_0x473c0c,_0x4519('0x5a'));})['then'](function(_0x3a7a22){_0x255dcb=_0x3a7a22;logger[_0x4519('0x8')](_0x4519('0x5b'));logger[_0x4519('0x8')](_0x4519('0x5c'),_0x255dcb['id']);return setRelationship(_0x473c0c,_0x46fe57,_0x255dcb,_0x4519('0x5d'));})[_0x4519('0x2a')](function(){return setRelationship(_0x473c0c,_0x4c2628,_0x255dcb,_0x4519('0x6e'));})[_0x4519('0x2a')](function(){return getServerInfo(_0x473c0c);})[_0x4519('0x70')](function(_0x218da){logger['error'](_0x4519('0x72'),JSON[_0x4519('0x1f')](_0x218da));});};
\ No newline at end of file
+var _0xc582=['forEach','push','idField','variableName','set_entry','JSON','format','Basic\x20%s','apiKey','base64','stringify','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','first_name','','Enduser\x20created.','debug','[HTTP]','merge','map','string','customField','toLowerCase','content','toString','type','variable','custom_fields','customVariable','Variable','login','username','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','trigger:browser:url','abandoned','monitor_format','[ABANDONED]','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','POST','emit','info','name','Subjects','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','length'];(function(_0x41220a,_0x5be576){var _0x3fae3b=function(_0x5f2436){while(--_0x5f2436){_0x41220a['push'](_0x41220a['shift']());}};_0x3fae3b(++_0x5be576);}(_0xc582,0xd2));var _0x2c58=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0xc582[_0x47242d];return _0x30273a;};'use strict';var _=require(_0x2c58('0x0'));var rp=require(_0x2c58('0x1'));var BPromise=require(_0x2c58('0x2'));var md5=require(_0x2c58('0x3'));var util=require(_0x2c58('0x4'));var Redis=require(_0x2c58('0x5'));var intUtil=require(_0x2c58('0x6'));var config=require('../../../../config/environment');var logger=require(_0x2c58('0x7'))(_0x2c58('0x8'));config[_0x2c58('0x9')]=_['defaults'](config[_0x2c58('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0x2c58('0xa'),'json':!![]};function emit(_0x5d1f80,_0x4bac4a,_0x301a82){io['to'](_0x5d1f80)[_0x2c58('0xb')](_0x4bac4a,_0x301a82);}function getTicket(_0x5f02b4,_0x149d6e,_0x5dc04b,_0x599fa6,_0x5e4ecb,_0x3fafc4,_0x3f735d,_0x27b7ab){logger[_0x2c58('0xc')]('Creating\x20new\x20ticket...');var _0x584d39=new Date();var _0x3e7073=[{'name':_0x2c58('0xd'),'value':intUtil['getString'](_0x599fa6[_0x2c58('0xe')],_0x5e4ecb,'\x20')},{'name':_0x2c58('0xf'),'value':_0x149d6e['id']},{'name':_0x2c58('0x10'),'value':_0x149d6e['id']},{'name':_0x2c58('0x11'),'value':intUtil[_0x2c58('0x12')](_0x599fa6[_0x2c58('0x13')],_0x5e4ecb,'\x0a')},{'name':_0x2c58('0x14'),'value':_0x584d39[_0x2c58('0x15')]()[_0x2c58('0x16')](0x0,0x13)[_0x2c58('0x17')]('T','\x20')},{'name':_0x2c58('0x18'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x2c58('0x19'),'value':_0x5dc04b['id']},{'name':_0x2c58('0x1a'),'value':_0x2c58('0x1b')},{'name':_0x2c58('0x1c'),'value':_0x5dc04b['name']},{'name':'direction','value':_0x27b7ab}];if(_0x3fafc4[_0x2c58('0x1d')]){_[_0x2c58('0x1e')](_0x3fafc4,function(_0x102a0e){if(_0x5e4ecb[_0x102a0e['variableName']]){_0x3e7073[_0x2c58('0x1f')]({'name':_0x102a0e[_0x2c58('0x20')],'value':_0x5e4ecb[_0x102a0e[_0x2c58('0x21')]]});}});}return request({'form':{'method':_0x2c58('0x22'),'input_type':_0x2c58('0x23'),'response_type':_0x2c58('0x23'),'rest_data':JSON['stringify']({'session':_0x3f735d['id'],'module_name':'Calls','name_value_list':_0x3e7073})}});}function getAuth(_0x25f31a){return util[_0x2c58('0x24')](_0x2c58('0x25'),new Buffer(_0x25f31a[_0x2c58('0x26')]+':X')['toString'](_0x2c58('0x27')));}function getServerInfo(_0x38eef2){return request({'form':{'method':'get_server_info','input_type':_0x2c58('0x23'),'response_type':'JSON','rest_data':JSON[_0x2c58('0x28')]({'session':_0x38eef2['id']})}});}function getUser(_0x5cbebe,_0x5a6ca7,_0x42d36d){if(!_[_0x2c58('0x29')](_0x5a6ca7)){logger[_0x2c58('0xc')](_0x2c58('0x2a'),_0x5a6ca7);return request({'form':{'method':'get_entry_list','input_type':_0x2c58('0x23'),'response_type':_0x2c58('0x23'),'rest_data':JSON['stringify']({'session':_0x42d36d['id'],'module_name':_0x2c58('0x2b'),'query':util[_0x2c58('0x24')](_0x2c58('0x2c'),_0x5a6ca7),'order_by':'','offset':'0','select_fields':['id',_0x2c58('0xd'),_0x2c58('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x53502e){if(_0x53502e[_0x2c58('0x2e')][_0x2c58('0x1d')]){var _0x349aa3=_[_0x2c58('0x2f')](_0x53502e['entry_list'],function(_0x4d6044){return _0x4d6044[_0x2c58('0x30')][_0x2c58('0x2d')][_0x2c58('0x31')]===_0x5a6ca7;});if(_0x349aa3){logger[_0x2c58('0xc')](_0x2c58('0x32'));return BPromise['resolve']({'id':_0x349aa3[_0x2c58('0x30')]['id'][_0x2c58('0x31')],'name':_0x349aa3[_0x2c58('0x30')][_0x2c58('0xd')][_0x2c58('0x31')]});}}logger[_0x2c58('0xc')](_0x2c58('0x33'));return BPromise[_0x2c58('0x34')]({'id':_0x42d36d['name_value_list'][_0x2c58('0x35')]['value'],'name':_0x42d36d['name_value_list'][_0x2c58('0x2d')][_0x2c58('0x31')]});});}else{logger[_0x2c58('0xc')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x2c58('0x34')]({'id':_0x42d36d[_0x2c58('0x30')][_0x2c58('0x35')][_0x2c58('0x31')],'name':_0x42d36d[_0x2c58('0x30')][_0x2c58('0x2d')][_0x2c58('0x31')]});}}function getEndUser(_0x4b9ad6,_0x1974ce,_0x3e452c,_0x46a15d){logger['info'](_0x2c58('0x36'),_0x3e452c);return request({'form':{'method':'get_entry_list','input_type':_0x2c58('0x23'),'response_type':_0x2c58('0x23'),'rest_data':JSON[_0x2c58('0x28')]({'session':_0x46a15d['id'],'module_name':_0x2c58('0x1b'),'query':util[_0x2c58('0x24')](_0x2c58('0x37'),_0x3e452c),'order_by':'','offset':'0','select_fields':['id',_0x2c58('0xd'),_0x2c58('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2c58('0x39')](function(_0x125c4a){if(_0x125c4a[_0x2c58('0x2e')][_0x2c58('0x1d')]){var _0x3f9af1=_['find'](_0x125c4a[_0x2c58('0x2e')],function(_0x54fa15){return _0x54fa15[_0x2c58('0x30')]['phone_home'][_0x2c58('0x31')]===_0x3e452c;});if(_0x3f9af1){logger['info'](_0x2c58('0x3a'));return BPromise[_0x2c58('0x34')]({'id':_0x3f9af1['name_value_list']['id']['value'],'name':_0x3f9af1[_0x2c58('0x30')][_0x2c58('0xd')][_0x2c58('0x31')],'phone':_0x3f9af1['name_value_list'][_0x2c58('0x38')]['value']});}}else{logger[_0x2c58('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0x2c58('0x23'),'response_type':_0x2c58('0x23'),'rest_data':JSON[_0x2c58('0x28')]({'session':_0x46a15d['id'],'module_name':_0x2c58('0x1b'),'name_value_list':[{'name':_0x2c58('0x3b'),'value':_0x1974ce!==_0x2c58('0x3c')?_0x1974ce:util[_0x2c58('0x24')]('Caller\x20-\x20%s',_0x3e452c)},{'name':_0x2c58('0x38'),'value':_0x3e452c}]})}})[_0x2c58('0x39')](function(_0x15bed3){logger[_0x2c58('0xc')](_0x2c58('0x3d'));return BPromise[_0x2c58('0x34')]({'id':_0x15bed3['id'],'name':_0x15bed3[_0x2c58('0x2e')]['first_name'][_0x2c58('0x31')],'phone':_0x15bed3[_0x2c58('0x2e')]['phone_home'][_0x2c58('0x31')]});});}});}function request(_0x35d93e){logger[_0x2c58('0x3e')](_0x2c58('0x3f'),JSON['stringify'](_0x35d93e));return rp(_[_0x2c58('0x40')](def,_0x35d93e));}function getTags(_0x3e800d,_0x34396b){var _0x54b867=[];if(_0x3e800d&&_0x3e800d[_0x2c58('0x1d')]>0x0){_0x54b867=_[_0x2c58('0x41')](_0x3e800d,_0x34396b);}return _0x54b867;}function getCustomFields(_0x507a32,_0x2e4513){var _0x556944=[];var _0x42531b={'custom_fields':[]};if(_0x507a32['length']>0x0){_[_0x2c58('0x1e')](_0x507a32,function(_0x121558){if(_0x121558['type']===_0x2c58('0x42')&&_0x121558['nameField']&&!_0x121558[_0x2c58('0x43')]){_0x42531b[_0x121558['nameField'][_0x2c58('0x44')]()]=_0x121558[_0x2c58('0x45')][_0x2c58('0x46')]();}else if(_0x121558[_0x2c58('0x47')]===_0x2c58('0x42')&&_0x121558[_0x2c58('0x20')]&&_0x121558['customField']){_0x42531b['custom_fields'][_0x2c58('0x1f')]({'id':_0x121558['idField'],'value':_0x121558[_0x2c58('0x45')]['toString']()});}else if(_0x121558[_0x2c58('0x47')]===_0x2c58('0x48')&&_0x121558[_0x2c58('0x21')]&&_0x121558[_0x2c58('0x20')]&&_0x121558[_0x2c58('0x43')]){_0x2e4513[_0x121558[_0x2c58('0x21')]]&&_0x42531b[_0x2c58('0x49')][_0x2c58('0x1f')]({'id':_0x121558[_0x2c58('0x20')],'value':_0x2e4513[_0x121558[_0x2c58('0x21')]]['toString']()});}else if(_0x121558[_0x2c58('0x47')]===_0x2c58('0x4a')&&_0x121558[_0x2c58('0x4b')]&&_0x121558[_0x2c58('0x4b')][_0x2c58('0xd')]&&_0x121558[_0x2c58('0x20')]&&_0x121558[_0x2c58('0x43')]){_0x2e4513[_0x121558[_0x2c58('0x4b')][_0x2c58('0xd')]['toLowerCase']()]&&_0x42531b[_0x2c58('0x49')][_0x2c58('0x1f')]({'id':_0x121558[_0x2c58('0x20')],'value':_0x2e4513[_0x121558['Variable'][_0x2c58('0xd')][_0x2c58('0x44')]()][_0x2c58('0x46')]()});}});}return _0x42531b;}function getConnection(_0x2da6fb){return request({'method':'POST','form':{'method':_0x2c58('0x4c'),'input_type':_0x2c58('0x23'),'response_type':_0x2c58('0x23'),'rest_data':JSON[_0x2c58('0x28')]({'user_auth':{'user_name':_0x2da6fb[_0x2c58('0x4d')],'password':_0x2da6fb['password'],'encryption':'PLAIN'},'application':_0x2c58('0x4e')})}})[_0x2c58('0x39')](function(_0x3ce65e){var _0x5178bf=_0x3ce65e;if(_0x5178bf['id']){def[_0x2c58('0x4f')]=_0x5178bf['id'];return BPromise[_0x2c58('0x34')](_0x5178bf);}else{throw new Error(util[_0x2c58('0x24')](_0x2c58('0x50'),_0x2da6fb['id']));}});}function setRelationship(_0x31d224,_0x40c697,_0x1d9236,_0x12c8ee){return request({'form':{'method':'set_relationship','input_type':_0x2c58('0x23'),'response_type':_0x2c58('0x23'),'rest_data':JSON['stringify']({'session':_0x31d224['id'],'module_name':_0x2c58('0x51'),'module_id':_0x1d9236['id'],'link_field_name':_0x12c8ee,'related_ids':[_0x40c697['id']]})}});}exports[_0x2c58('0x52')]=function(_0x4971d7,_0x2a5015,_0x54ad06,_0x262575,_0x191757,_0x6b0619){var _0x216e60,_0x3f1d49,_0x187407,_0x3ae6d0;_0x6b0619[_0x2c58('0x53')]=intUtil[_0x2c58('0x54')](_0x6b0619['remoteUri']);_0x6b0619['serverUrl']=intUtil[_0x2c58('0x54')](_0x6b0619[_0x2c58('0x55')]);def[_0x2c58('0x56')]=util[_0x2c58('0x24')](_0x2c58('0x57'),_0x6b0619[_0x2c58('0x53')]);if(_0x191757&&_0x191757['monitor_format']){logger[_0x2c58('0xc')](_0x2c58('0x58'),_0x2c58('0x59'));_0x2a5015[_0x2c58('0x5a')]=util[_0x2c58('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x6b0619['serverUrl'],_0x2a5015[_0x2c58('0x5b')],md5(_0x2a5015[_0x2c58('0x5b')]));}else{_0x2a5015[_0x2c58('0x5a')]='';}return getConnection(_0x6b0619)[_0x2c58('0x39')](function(_0x27dd25){_0x3ae6d0=_0x27dd25;return getUser(_0x6b0619,_0x262575['name'],_0x3ae6d0);})[_0x2c58('0x39')](function(_0x41ca0a){_0x216e60=_0x41ca0a;logger[_0x2c58('0xc')](_0x2c58('0x5c'),_0x216e60['id']);return getEndUser(_0x6b0619,_0x2a5015[_0x2c58('0x5d')],_0x2a5015[_0x2c58('0x5e')],_0x3ae6d0);})[_0x2c58('0x39')](function(_0x4cb944){_0x3f1d49=_0x4cb944;logger[_0x2c58('0xc')]('The\x20Enduser\x20ID\x20is:',_0x3f1d49['id']);return getTicket(_0x6b0619,_0x216e60,_0x3f1d49,_0x54ad06,_0x2a5015,_0x54ad06[_0x2c58('0x5f')],_0x3ae6d0,_0x2c58('0x60'));})[_0x2c58('0x39')](function(_0x18d781){_0x187407=_0x18d781;logger['info'](_0x2c58('0x61'));logger[_0x2c58('0xc')](_0x2c58('0x62'),_0x187407['id']);return setRelationship(_0x3ae6d0,_0x216e60,_0x187407,_0x2c58('0x63'));})['then'](function(){return setRelationship(_0x3ae6d0,_0x3f1d49,_0x187407,_0x2c58('0x64'));})[_0x2c58('0x39')](function(){return getServerInfo(_0x3ae6d0);})[_0x2c58('0x39')](function(_0xcb398f){var _0xd0649e=parseInt(_0xcb398f['version'][_0x2c58('0x65')](0x0));var _0x38a80a=util[_0x2c58('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x6b0619['remoteUri'],_0x187407['id']);if(_0xd0649e>0x6){_0x38a80a=util[_0x2c58('0x24')](_0x2c58('0x66'),_0x6b0619[_0x2c58('0x53')],_0x187407['id']);}logger[_0x2c58('0xc')]('[QUEUE]',_0x2c58('0x67'));emit(util[_0x2c58('0x24')](_0x2c58('0x68'),_0x262575[_0x2c58('0xd')]),'trigger:browser:url',{'uri':_0x38a80a});})[_0x2c58('0x69')](function(_0x2afc51){logger[_0x2c58('0x6a')]('[QUEUE]',JSON[_0x2c58('0x28')](_0x2afc51));});};exports['outbound']=function(_0x3f919e,_0x5151cd,_0x3679ea,_0x3fb275,_0x32b787,_0x1eb09a,_0x1e3938){var _0x18984f,_0x36c41e,_0x1f584e,_0xc1ca1c;_0x1eb09a['remoteUri']=intUtil[_0x2c58('0x54')](_0x1eb09a[_0x2c58('0x53')]);_0x1eb09a[_0x2c58('0x55')]=intUtil[_0x2c58('0x54')](_0x1eb09a[_0x2c58('0x55')]);def[_0x2c58('0x56')]=util['format']('%s/service/v4_1/rest.php',_0x1eb09a['remoteUri']);if(_0x1e3938&&_0x1e3938[_0x2c58('0x6b')]&&_0x1e3938[_0x2c58('0x6b')]!==_0x2c58('0x6c')){logger[_0x2c58('0xc')]('[OUTBOUND]',_0x2c58('0x59'));_0x5151cd['recordingURL']=util[_0x2c58('0x24')](_0x2c58('0x6d'),_0x1eb09a[_0x2c58('0x55')],_0x5151cd[_0x2c58('0x5b')],md5(_0x5151cd[_0x2c58('0x5b')]));}return getConnection(_0x1eb09a)[_0x2c58('0x39')](function(_0x29afa6){_0xc1ca1c=_0x29afa6;return getUser(_0x1eb09a,_0x3fb275['name'],_0xc1ca1c);})[_0x2c58('0x39')](function(_0x81cc81){_0x18984f=_0x81cc81;logger[_0x2c58('0xc')](_0x2c58('0x5c'),_0x18984f['id']);return getEndUser(_0x1eb09a,_0x5151cd[_0x2c58('0x6e')],_0x5151cd[_0x2c58('0x6f')],_0xc1ca1c);})[_0x2c58('0x39')](function(_0x58864b){_0x36c41e=_0x58864b;logger[_0x2c58('0xc')](_0x2c58('0x70'),_0x36c41e['id']);return getTicket(_0x1eb09a,_0x18984f,_0x36c41e,_0x3679ea,_0x5151cd,_0x3679ea[_0x2c58('0x5f')],_0xc1ca1c,'Outbound');})[_0x2c58('0x39')](function(_0x407b0f){_0x1f584e=_0x407b0f;logger[_0x2c58('0xc')](_0x2c58('0x61'));logger[_0x2c58('0xc')]('The\x20Ticket\x20ID\x20is:',_0x1f584e['id']);return setRelationship(_0xc1ca1c,_0x18984f,_0x1f584e,'users');})['then'](function(){return setRelationship(_0xc1ca1c,_0x36c41e,_0x1f584e,_0x2c58('0x64'));})['then'](function(){return getServerInfo(_0xc1ca1c);})[_0x2c58('0x39')](function(_0x3a174a){var _0x2a0c3c=parseInt(_0x3a174a[_0x2c58('0x71')][_0x2c58('0x65')](0x0));var _0x45b6dd=util[_0x2c58('0x24')](_0x2c58('0x72'),_0x1eb09a[_0x2c58('0x53')],_0x1f584e['id']);if(_0x2a0c3c>0x6){_0x45b6dd=util[_0x2c58('0x24')](_0x2c58('0x66'),_0x1eb09a[_0x2c58('0x53')],_0x1f584e['id']);}logger[_0x2c58('0xc')](_0x2c58('0x73'),_0x2c58('0x67'));emit(util[_0x2c58('0x24')](_0x2c58('0x68'),_0x3fb275[_0x2c58('0xd')]),_0x2c58('0x74'),{'uri':_0x45b6dd});})[_0x2c58('0x69')](function(_0xeae1a9){logger['error'](_0x2c58('0x73'),JSON[_0x2c58('0x28')](_0xeae1a9));});};exports[_0x2c58('0x75')]=function(_0x229100,_0x102200,_0x19bdf9,_0x21902c,_0x2b835c,_0x53dab2){var _0x25ea16,_0x2b6ada,_0x1f6a54,_0x341912;_0x53dab2[_0x2c58('0x53')]=intUtil[_0x2c58('0x54')](_0x53dab2[_0x2c58('0x53')]);_0x53dab2['serverUrl']=intUtil[_0x2c58('0x54')](_0x53dab2[_0x2c58('0x55')]);def[_0x2c58('0x56')]=util[_0x2c58('0x24')](_0x2c58('0x57'),_0x53dab2[_0x2c58('0x53')]);if(_0x2b835c&&_0x2b835c[_0x2c58('0x76')]){logger[_0x2c58('0xc')](_0x2c58('0x77'),_0x2c58('0x59'));_0x102200['recordingURL']=util[_0x2c58('0x24')](_0x2c58('0x6d'),_0x53dab2[_0x2c58('0x55')],_0x102200[_0x2c58('0x5b')],md5(_0x102200[_0x2c58('0x5b')]));}else{_0x102200['recordingURL']='';}return getConnection(_0x53dab2)[_0x2c58('0x39')](function(_0x2c162d){_0x341912=_0x2c162d;if(!_['isNil'](_0x21902c)){return getUser(_0x53dab2,_0x21902c[_0x2c58('0xd')],_0x341912);}else{return getUser(_0x53dab2,null,_0x341912);}})[_0x2c58('0x39')](function(_0x77059c){_0x25ea16=_0x77059c;logger['info']('The\x20User\x20ID\x20is:',_0x25ea16['id']);return getEndUser(_0x53dab2,_0x102200[_0x2c58('0x5d')],_0x102200[_0x2c58('0x5e')],_0x341912);})['then'](function(_0x2f9007){_0x2b6ada=_0x2f9007;logger[_0x2c58('0xc')](_0x2c58('0x70'),_0x2b6ada['id']);return getTicket(_0x53dab2,_0x25ea16,_0x2b6ada,_0x19bdf9,_0x102200,_0x19bdf9[_0x2c58('0x5f')],_0x341912,_0x2c58('0x60'));})['then'](function(_0x2b8d0d){_0x1f6a54=_0x2b8d0d;logger[_0x2c58('0xc')](_0x2c58('0x61'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1f6a54['id']);return setRelationship(_0x341912,_0x25ea16,_0x1f6a54,_0x2c58('0x63'));})[_0x2c58('0x39')](function(){return setRelationship(_0x341912,_0x2b6ada,_0x1f6a54,'contacts');})[_0x2c58('0x39')](function(){return getServerInfo(_0x341912);})['catch'](function(_0x1b91a5){logger[_0x2c58('0x6a')]('[ABANDONED]',JSON[_0x2c58('0x28')](_0x1b91a5));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js
index 03639a7..77f0613 100644
--- a/server/services/ami/trigger/integration/util.js
+++ b/server/services/ami/trigger/integration/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf6f3=['validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','format','%s:\x20%s','keyContent','key','join','stripTrailingSlash','slice','lastIndexOf'];(function(_0x9d8e04,_0x5b81de){var _0x32042f=function(_0x5de028){while(--_0x5de028){_0x9d8e04['push'](_0x9d8e04['shift']());}};_0x32042f(++_0x5b81de);}(_0xf6f3,0x77));var _0x3f6f=function(_0x33bccf,_0x24a5f8){_0x33bccf=_0x33bccf-0x0;var _0x1a62c1=_0xf6f3[_0x33bccf];return _0x1a62c1;};'use strict';var _=require(_0x3f6f('0x0'));var util=require(_0x3f6f('0x1'));exports[_0x3f6f('0x2')]=function(_0x4405af,_0x5c901c,_0x1300b4){var _0x4cb7c7=[];if(_0x4405af[_0x3f6f('0x3')]>0x0){var _0x30700e=_[_0x3f6f('0x4')](_0x4405af,['id']);for(var _0x19714b=0x0;_0x19714b<_0x30700e[_0x3f6f('0x3')];_0x19714b++){var _0x5f21b4=_0x30700e[_0x19714b];if(_0x5f21b4[_0x3f6f('0x5')]===_0x3f6f('0x6')){_0x4cb7c7[_0x3f6f('0x7')](_0x5f21b4[_0x3f6f('0x8')]);}else if(_0x5f21b4[_0x3f6f('0x5')]===_0x3f6f('0x9')&&_0x5f21b4[_0x3f6f('0xa')]){_0x5c901c[_0x5f21b4[_0x3f6f('0xa')]]&&_0x4cb7c7[_0x3f6f('0x7')](_0x5c901c[_0x5f21b4[_0x3f6f('0xa')]]['toString']());}else if(_0x5f21b4[_0x3f6f('0x5')]===_0x3f6f('0xb')&&_0x5f21b4[_0x3f6f('0xc')]&&_0x5f21b4['Variable'][_0x3f6f('0xd')]){_0x5c901c[_0x5f21b4[_0x3f6f('0xc')][_0x3f6f('0xd')][_0x3f6f('0xe')]()]&&_0x4cb7c7[_0x3f6f('0x7')](_0x5c901c[_0x5f21b4[_0x3f6f('0xc')]['name'][_0x3f6f('0xe')]()][_0x3f6f('0xf')]());}else if(_0x5f21b4[_0x3f6f('0x5')]===_0x3f6f('0x10')){if(_0x5f21b4[_0x3f6f('0x11')]===_0x3f6f('0x6')&&_0x5f21b4['key']){_0x4cb7c7[_0x3f6f('0x7')](util[_0x3f6f('0x12')](_0x3f6f('0x13'),_0x5f21b4['key'],_0x5f21b4[_0x3f6f('0x14')]));}else if(_0x5f21b4['keyType']===_0x3f6f('0x9')&&_0x5f21b4[_0x3f6f('0xa')]&&_0x5f21b4[_0x3f6f('0x15')]){_0x5c901c[_0x5f21b4[_0x3f6f('0xa')]]&&_0x4cb7c7[_0x3f6f('0x7')](util[_0x3f6f('0x12')](_0x3f6f('0x13'),_0x5f21b4[_0x3f6f('0x15')],_0x5c901c[_0x5f21b4[_0x3f6f('0xa')]]));}else if(_0x5f21b4[_0x3f6f('0x11')]==='customVariable'&&_0x5f21b4['Variable']&&_0x5f21b4['Variable']['name']&&_0x5f21b4['key']){_0x5c901c[_0x5f21b4['Variable'][_0x3f6f('0xd')][_0x3f6f('0xe')]()]&&_0x4cb7c7[_0x3f6f('0x7')](util[_0x3f6f('0x12')](_0x3f6f('0x13'),_0x5f21b4['key'],_0x5c901c[_0x5f21b4['Variable']['name'][_0x3f6f('0xe')]()]));}}}}return _0x4cb7c7[_0x3f6f('0x16')](_0x1300b4);};exports[_0x3f6f('0x17')]=function(_0x5ca3a7){var _0x356dd3=_0x5ca3a7[_0x3f6f('0x18')](-0x1);if(_0x356dd3==='/'){_0x5ca3a7=_0x5ca3a7['substring'](0x0,_0x5ca3a7[_0x3f6f('0x19')](_0x356dd3));}return _0x5ca3a7;};exports[_0x3f6f('0x1a')]=function(_0x3d74f5){if(!_[_0x3f6f('0x1b')](_0x3d74f5)&&_0x3d74f5!==''){var _0x366346=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x366346[_0x3f6f('0x1c')](String(_0x3d74f5)['toLowerCase']());}else{return![];}};
\ No newline at end of file
+var _0x5cb5=['type','string','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','isNil','lodash','util','length'];(function(_0x652b90,_0x52865b){var _0x523368=function(_0x36e0a3){while(--_0x36e0a3){_0x652b90['push'](_0x652b90['shift']());}};_0x523368(++_0x52865b);}(_0x5cb5,0xb5));var _0x55cb=function(_0x3fe6db,_0x1bf309){_0x3fe6db=_0x3fe6db-0x0;var _0x17da42=_0x5cb5[_0x3fe6db];return _0x17da42;};'use strict';var _=require(_0x55cb('0x0'));var util=require(_0x55cb('0x1'));exports['getString']=function(_0x42e6d6,_0xdb059b,_0x402db0){var _0x3595d7=[];if(_0x42e6d6[_0x55cb('0x2')]>0x0){var _0x2cba27=_['sortBy'](_0x42e6d6,['id']);for(var _0x265052=0x0;_0x265052<_0x2cba27[_0x55cb('0x2')];_0x265052++){var _0x1cbcf8=_0x2cba27[_0x265052];if(_0x1cbcf8[_0x55cb('0x3')]===_0x55cb('0x4')){_0x3595d7[_0x55cb('0x5')](_0x1cbcf8[_0x55cb('0x6')]);}else if(_0x1cbcf8[_0x55cb('0x3')]===_0x55cb('0x7')&&_0x1cbcf8['variableName']){_0xdb059b[_0x1cbcf8[_0x55cb('0x8')]]&&_0x3595d7[_0x55cb('0x5')](_0xdb059b[_0x1cbcf8[_0x55cb('0x8')]]['toString']());}else if(_0x1cbcf8['type']===_0x55cb('0x9')&&_0x1cbcf8[_0x55cb('0xa')]&&_0x1cbcf8[_0x55cb('0xa')][_0x55cb('0xb')]){_0xdb059b[_0x1cbcf8['Variable'][_0x55cb('0xb')][_0x55cb('0xc')]()]&&_0x3595d7['push'](_0xdb059b[_0x1cbcf8[_0x55cb('0xa')][_0x55cb('0xb')][_0x55cb('0xc')]()][_0x55cb('0xd')]());}else if(_0x1cbcf8[_0x55cb('0x3')]===_0x55cb('0xe')){if(_0x1cbcf8[_0x55cb('0xf')]==='string'&&_0x1cbcf8[_0x55cb('0x10')]){_0x3595d7[_0x55cb('0x5')](util[_0x55cb('0x11')](_0x55cb('0x12'),_0x1cbcf8[_0x55cb('0x10')],_0x1cbcf8[_0x55cb('0x13')]));}else if(_0x1cbcf8[_0x55cb('0xf')]===_0x55cb('0x7')&&_0x1cbcf8[_0x55cb('0x8')]&&_0x1cbcf8[_0x55cb('0x10')]){_0xdb059b[_0x1cbcf8[_0x55cb('0x8')]]&&_0x3595d7['push'](util[_0x55cb('0x11')]('%s:\x20%s',_0x1cbcf8[_0x55cb('0x10')],_0xdb059b[_0x1cbcf8[_0x55cb('0x8')]]));}else if(_0x1cbcf8[_0x55cb('0xf')]==='customVariable'&&_0x1cbcf8[_0x55cb('0xa')]&&_0x1cbcf8[_0x55cb('0xa')][_0x55cb('0xb')]&&_0x1cbcf8[_0x55cb('0x10')]){_0xdb059b[_0x1cbcf8[_0x55cb('0xa')]['name'][_0x55cb('0xc')]()]&&_0x3595d7[_0x55cb('0x5')](util[_0x55cb('0x11')](_0x55cb('0x12'),_0x1cbcf8[_0x55cb('0x10')],_0xdb059b[_0x1cbcf8[_0x55cb('0xa')][_0x55cb('0xb')][_0x55cb('0xc')]()]));}}}}return _0x3595d7[_0x55cb('0x14')](_0x402db0);};exports[_0x55cb('0x15')]=function(_0x2921c7){var _0x333403=_0x2921c7['slice'](-0x1);if(_0x333403==='/'){_0x2921c7=_0x2921c7['substring'](0x0,_0x2921c7['lastIndexOf'](_0x333403));}return _0x2921c7;};exports['validateEmail']=function(_0x162829){if(!_[_0x55cb('0x16')](_0x162829)&&_0x162829!==''){var _0x52c101=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x52c101['test'](String(_0x162829)[_0x55cb('0xc')]());}else{return![];}};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js
index 9a85ee4..15ac74b 100644
--- a/server/services/ami/trigger/integration/vtiger.js
+++ b/server/services/ami/trigger/integration/vtiger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf1a=['token','Account\x20%d\x20is\x20not\x20valid','queue','monitor_format','recordingURL','uniqueid','email','Fields','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[QUEUE]','outbound','serverUrl','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','user:%s','trigger:browser:url','Recording\x20is\x20enabled!','calleridname','calleridnum','lodash','request-promise','bluebird','md5','util','./util','../../../../config/logger','vTiger','redis','localhost','emit','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','sessionName','success','result','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','remoteUri','admin','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','Contacts','Enduser\x20created.','phone','getEndUser','accessKey'];(function(_0x470f24,_0x2436a9){var _0x2c6fc8=function(_0x3ef190){while(--_0x3ef190){_0x470f24['push'](_0x470f24['shift']());}};_0x2c6fc8(++_0x2436a9);}(_0xbf1a,0x7c));var _0xabf1=function(_0x135497,_0x23fcac){_0x135497=_0x135497-0x0;var _0x418b82=_0xbf1a[_0x135497];return _0x418b82;};'use strict';var _=require(_0xabf1('0x0'));var rp=require(_0xabf1('0x1'));var BPromise=require(_0xabf1('0x2'));var md5=require(_0xabf1('0x3'));var util=require(_0xabf1('0x4'));var Redis=require('ioredis');var intUtil=require(_0xabf1('0x5'));var config=require('../../../../config/environment');var logger=require(_0xabf1('0x6'))(_0xabf1('0x7'));config[_0xabf1('0x8')]=_['defaults'](config['redis'],{'host':_0xabf1('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xabf1('0x8')]));function emit(_0x1cc1f6,_0x1f48f5,_0x3eb992){io['to'](_0x1cc1f6)[_0xabf1('0xa')](_0x1f48f5,_0x3eb992);}function getCustomFields(_0x3d2234,_0x59a7a2){var _0x94a69={};if(_0x3d2234[_0xabf1('0xb')]>0x0){_[_0xabf1('0xc')](_0x3d2234,function(_0x3aff77){if(_0x3aff77[_0xabf1('0xd')]===_0xabf1('0xe')&&_0x3aff77['idField']){_0x94a69[_0x3aff77[_0xabf1('0xf')]]=_0x3aff77[_0xabf1('0x10')][_0xabf1('0x11')]();}else if(_0x3aff77[_0xabf1('0xd')]===_0xabf1('0x12')&&_0x3aff77[_0xabf1('0x13')]&&_0x3aff77[_0xabf1('0xf')]&&_0x59a7a2[_0x3aff77[_0xabf1('0x13')]]){_0x94a69[_0x3aff77[_0xabf1('0xf')]]=_0x59a7a2[_0x3aff77[_0xabf1('0x13')]]['toString']();}else if(_0x3aff77[_0xabf1('0xd')]===_0xabf1('0x14')&&_0x3aff77[_0xabf1('0x15')]&&_0x3aff77['Variable'][_0xabf1('0x16')]&&_0x3aff77[_0xabf1('0xf')]&&_0x59a7a2[_0x3aff77[_0xabf1('0x15')][_0xabf1('0x16')]['toLowerCase']()]){_0x94a69[_0x3aff77[_0xabf1('0xf')]]=_0x59a7a2[_0x3aff77['Variable'][_0xabf1('0x16')][_0xabf1('0x17')]()][_0xabf1('0x11')]();}});}return _0x94a69;}function createTicket(_0x363c21,_0x26e9f8,_0xd5dc16,_0x3cfc35,_0x2d8fac,_0x8a5df5,_0x18f315){logger[_0xabf1('0x18')](_0xabf1('0x19'));var _0x1e0d23=_[_0xabf1('0x1a')]({'parent_id':'','assigned_user_id':_0x26e9f8['id'],'ticketpriorities':_0xabf1('0x1b'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x3cfc35[_0xabf1('0x1c')],_0x2d8fac,'\x20'),'description':intUtil[_0xabf1('0x1d')](_0x3cfc35[_0xabf1('0x1e')],_0x2d8fac,'\x0a'),'contact_id':_0xd5dc16['id']},getCustomFields(_0x8a5df5,_0x2d8fac));var _0x53e531={'method':_0xabf1('0x1f'),'uri':util[_0xabf1('0x20')](_0xabf1('0x21'),_0x363c21['remoteUri']),'form':{'operation':_0xabf1('0x22'),'username':'admin','sessionName':_0x18f315[_0xabf1('0x23')],'elementType':'HelpDesk','element':JSON['stringify'](_0x1e0d23)},'json':!![]};return request(_0x53e531)['then'](function(_0x29d5bf){if(_0x29d5bf[_0xabf1('0x24')]){return BPromise['resolve']({'id':_0x29d5bf[_0xabf1('0x25')]['id']});}else{throw new Error(util[_0xabf1('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON['stringify'](_0x29d5bf[_0xabf1('0x26')])));}})[_0xabf1('0x27')](function(_0x3e58f6){var _0x420590=_0x3e58f6[_0xabf1('0x28')]||0x1f4;logger['error'](_0xabf1('0x29'),'createTicket',_0x420590,JSON[_0xabf1('0x2a')](_0x3e58f6));});}function getUser(_0x5ddf0d,_0xb54b63,_0x582fbf){if(intUtil[_0xabf1('0x2b')](_0xb54b63)){logger[_0xabf1('0x18')](_0xabf1('0x2c'),_0xb54b63);return request({'method':_0xabf1('0x2d'),'uri':util['format'](_0xabf1('0x21'),_0x5ddf0d[_0xabf1('0x2e')]),'qs':{'operation':'query','username':_0xabf1('0x2f'),'sessionName':_0x582fbf['sessionName'],'query':util['format']('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0xb54b63)},'json':!![]})[_0xabf1('0x30')](function(_0x1a5745){if(_0x1a5745[_0xabf1('0x24')]&&_0x1a5745[_0xabf1('0x25')]['length']){logger[_0xabf1('0x18')](_0xabf1('0x31'));return BPromise[_0xabf1('0x32')]({'id':_0x1a5745[_0xabf1('0x25')][0x0]['id'],'email':_0x1a5745['result'][0x0][_0xabf1('0x33')],'name':_0x1a5745['result'][0x0][_0xabf1('0x34')]+'\x20'+_0x1a5745['result']['last_name']});}else{logger[_0xabf1('0x18')](_0xabf1('0x35'));return BPromise[_0xabf1('0x32')]({'id':_0x582fbf[_0xabf1('0x36')],'email':_0x5ddf0d[_0xabf1('0x37')],'name':_0xabf1('0x2f')});}})[_0xabf1('0x27')](function(_0x476841){var _0x58f5b7=_0x476841[_0xabf1('0x28')]||0x1f4;logger[_0xabf1('0x26')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x58f5b7,JSON['stringify'](_0x476841));});}else{logger[_0xabf1('0x18')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xabf1('0x32')]({'id':_0x582fbf[_0xabf1('0x36')],'email':_0x5ddf0d[_0xabf1('0x37')],'name':_0xabf1('0x2f')})['catch'](function(_0xd23acf){var _0x49bb46=_0xd23acf[_0xabf1('0x28')]||0x1f4;logger[_0xabf1('0x26')](_0xabf1('0x29'),_0xabf1('0x38'),_0x49bb46,JSON['stringify'](_0xd23acf));});}}function getEndUser(_0x24ae53,_0x336ca6,_0x2066c7,_0x284a36){logger[_0xabf1('0x18')](_0xabf1('0x39'),_0x2066c7);return request({'method':_0xabf1('0x2d'),'uri':util[_0xabf1('0x20')](_0xabf1('0x21'),_0x24ae53[_0xabf1('0x2e')]),'qs':{'operation':'query','username':'admin','sessionName':_0x284a36[_0xabf1('0x23')],'query':util[_0xabf1('0x20')](_0xabf1('0x3a'),_0x2066c7,_0x2066c7,_0x2066c7,_0x2066c7,_0x2066c7)},'json':!![]})[_0xabf1('0x30')](function(_0x3548e5){if(_0x3548e5['success']&&_0x3548e5[_0xabf1('0x25')]['length']){logger[_0xabf1('0x18')](_0xabf1('0x3b'));return BPromise[_0xabf1('0x32')]({'id':_0x3548e5[_0xabf1('0x25')][0x0]['id'],'name':_0x3548e5[_0xabf1('0x25')][0x0][_0xabf1('0x3c')]+'\x20'+_0x3548e5['result'][0x0]['lastname'],'phone':_0x2066c7});}else{logger[_0xabf1('0x18')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0xabf1('0x1f'),'uri':util[_0xabf1('0x20')](_0xabf1('0x21'),_0x24ae53[_0xabf1('0x2e')]),'form':{'operation':_0xabf1('0x22'),'sessionName':_0x284a36['sessionName'],'elementType':_0xabf1('0x3d'),'element':JSON[_0xabf1('0x2a')]({'lastname':_0x336ca6,'phone':_0x2066c7,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x379d8a){logger[_0xabf1('0x18')](_0xabf1('0x3e'));return BPromise[_0xabf1('0x32')]({'id':_0x379d8a['result']['id'],'name':_0x379d8a[_0xabf1('0x25')]['lastname'],'phone':_0x379d8a[_0xabf1('0x25')][_0xabf1('0x3f')]});})[_0xabf1('0x27')](function(_0x556e45){var _0x326fab=_0x556e45[_0xabf1('0x28')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0xabf1('0x40'),_0x326fab,JSON[_0xabf1('0x2a')](_0x556e45));});}});}function getConnection(_0x1be0a9){var _0x57c238=_0x1be0a9['username'];var _0x55d635=_0x1be0a9[_0xabf1('0x41')];return request({'method':_0xabf1('0x2d'),'uri':util[_0xabf1('0x20')](_0xabf1('0x21'),_0x1be0a9['remoteUri']),'qs':{'operation':'getchallenge','username':_0x57c238},'json':!![]})[_0xabf1('0x30')](function(_0x3c4453){if(_0x3c4453[_0xabf1('0x24')]){return request({'method':'POST','uri':util[_0xabf1('0x20')](_0xabf1('0x21'),_0x1be0a9['remoteUri']),'form':{'operation':'login','username':'admin','accessKey':md5(_0x3c4453['result'][_0xabf1('0x42')]+_0x55d635)},'json':!![]});}})[_0xabf1('0x30')](function(_0x40dad7){if(_0x40dad7[_0xabf1('0x24')]){return BPromise[_0xabf1('0x32')](_0x40dad7[_0xabf1('0x25')]);}else{throw new Error(util[_0xabf1('0x20')](_0xabf1('0x43'),_0x1be0a9['id']));}})[_0xabf1('0x27')](function(_0x5de2b8){var _0x522769=_0x5de2b8['statusCode']||0x1f4;logger['error'](_0xabf1('0x29'),'getConnection',_0x522769,JSON[_0xabf1('0x2a')](_0x5de2b8));});}function request(_0x59b48a){logger['info']('[HTTP]',JSON['stringify'](_0x59b48a));return rp(_0x59b48a);}exports[_0xabf1('0x44')]=function(_0x204c51,_0x2d8259,_0x390f9b,_0x529a08,_0x2dace7,_0x3ee213){var _0x1cd6d8,_0x40210b,_0x2aa7c0,_0x1e7e10;_0x3ee213[_0xabf1('0x2e')]=intUtil['stripTrailingSlash'](_0x3ee213[_0xabf1('0x2e')]);if(_0x2dace7&&_0x2dace7[_0xabf1('0x45')]){logger[_0xabf1('0x18')]('[QUEUE]','Recording\x20is\x20enabled!');_0x2d8259[_0xabf1('0x46')]=util[_0xabf1('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ee213['serverUrl'],_0x2d8259[_0xabf1('0x47')],md5(_0x2d8259[_0xabf1('0x47')]));}else{_0x2d8259[_0xabf1('0x46')]='';}return getConnection(_0x3ee213)[_0xabf1('0x30')](function(_0x2533d0){_0x1e7e10=_0x2533d0;return getUser(_0x3ee213,_0x529a08[_0xabf1('0x48')],_0x1e7e10);})[_0xabf1('0x30')](function(_0x110853){_0x1cd6d8=_0x110853;logger['info']('The\x20User\x20ID\x20is:',_0x1cd6d8['id']);return getEndUser(_0x3ee213,_0x2d8259['calleridname'],_0x2d8259['calleridnum'],_0x1e7e10);})[_0xabf1('0x30')](function(_0x41b431){_0x40210b=_0x41b431;logger[_0xabf1('0x18')]('The\x20Enduser\x20ID\x20is:',_0x40210b['id']);return createTicket(_0x3ee213,_0x1cd6d8,_0x40210b,_0x390f9b,_0x2d8259,_0x390f9b[_0xabf1('0x49')],_0x1e7e10);})['then'](function(_0x4b7659){_0x2aa7c0=_0x4b7659;logger[_0xabf1('0x18')]('Ticket\x20created!');logger[_0xabf1('0x18')](_0xabf1('0x4a'),_0x2aa7c0['id']);var _0x342ade=util[_0xabf1('0x20')](_0xabf1('0x4b'),_0x3ee213[_0xabf1('0x2e')],_[_0xabf1('0x4c')](_0x2aa7c0['id'],'x')[0x1]);logger[_0xabf1('0x18')]('[QUEUE]',_0xabf1('0x4d'));emit(util[_0xabf1('0x20')]('user:%s',_0x529a08[_0xabf1('0x16')]),'trigger:browser:url',{'uri':_0x342ade});})['catch'](function(_0x2e7dd4){logger['error'](_0xabf1('0x4e'),JSON[_0xabf1('0x2a')](_0x2e7dd4));});};exports[_0xabf1('0x4f')]=function(_0x26739c,_0x2fa775,_0x4527dc,_0x5e1e40,_0x18cc78,_0x748830,_0x285c79){var _0x51c220,_0x3a67fd,_0x5e98f2,_0x58308b;_0x748830[_0xabf1('0x2e')]=intUtil['stripTrailingSlash'](_0x748830[_0xabf1('0x2e')]);_0x748830[_0xabf1('0x50')]=intUtil[_0xabf1('0x51')](_0x748830[_0xabf1('0x50')]);if(_0x285c79&&_0x285c79['recordingFormat']&&_0x285c79[_0xabf1('0x52')]!==_0xabf1('0x53')){logger['info'](_0xabf1('0x54'),'Recording\x20is\x20enabled!');_0x2fa775[_0xabf1('0x46')]=util[_0xabf1('0x20')](_0xabf1('0x55'),_0x748830[_0xabf1('0x50')],_0x2fa775[_0xabf1('0x47')],md5(_0x2fa775[_0xabf1('0x47')]));}return getConnection(_0x748830)[_0xabf1('0x30')](function(_0x3baf37){_0x58308b=_0x3baf37;return getUser(_0x748830,_0x5e1e40[_0xabf1('0x48')],_0x58308b);})[_0xabf1('0x30')](function(_0x3b32b8){_0x51c220=_0x3b32b8;logger[_0xabf1('0x18')](_0xabf1('0x56'),_0x51c220['id']);return getEndUser(_0x748830,_0x2fa775['destcalleridname'],_0x2fa775[_0xabf1('0x57')],_0x58308b);})['then'](function(_0x1589e3){_0x3a67fd=_0x1589e3;logger[_0xabf1('0x18')](_0xabf1('0x58'),_0x3a67fd['id']);return createTicket(_0x748830,_0x51c220,_0x3a67fd,_0x4527dc,_0x2fa775,_0x4527dc[_0xabf1('0x49')],_0x58308b);})['then'](function(_0x4c2099){_0x5e98f2=_0x4c2099;logger['info'](_0xabf1('0x59'));logger[_0xabf1('0x18')]('The\x20Ticket\x20ID\x20is:',_0x5e98f2['id']);var _0xe54cf2=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x748830[_0xabf1('0x2e')],_[_0xabf1('0x4c')](_0x5e98f2['id'],'x')[0x1]);logger[_0xabf1('0x18')](_0xabf1('0x54'),_0xabf1('0x4d'));emit(util['format'](_0xabf1('0x5a'),_0x5e1e40['name']),_0xabf1('0x5b'),{'uri':_0xe54cf2});})[_0xabf1('0x27')](function(_0x4b0ec9){logger[_0xabf1('0x26')](_0xabf1('0x54'),JSON[_0xabf1('0x2a')](_0x4b0ec9));});};exports['abandoned']=function(_0x2e15d2,_0x2c0580,_0x23309b,_0x7f2e66,_0x156556,_0x316301){var _0x437a1b,_0x3e106e,_0x5b3edd,_0x480245;_0x316301[_0xabf1('0x2e')]=intUtil[_0xabf1('0x51')](_0x316301[_0xabf1('0x2e')]);_0x316301['serverUrl']=intUtil[_0xabf1('0x51')](_0x316301[_0xabf1('0x50')]);if(_0x156556&&_0x156556[_0xabf1('0x45')]){logger['info']('[ABANDONED]',_0xabf1('0x5c'));_0x2c0580[_0xabf1('0x46')]=util[_0xabf1('0x20')](_0xabf1('0x55'),_0x316301[_0xabf1('0x50')],_0x2c0580[_0xabf1('0x47')],md5(_0x2c0580['uniqueid']));}else{_0x2c0580[_0xabf1('0x46')]='';}return getConnection(_0x316301)[_0xabf1('0x30')](function(_0x7b891e){_0x480245=_0x7b891e;return getUser(_0x316301,'',_0x480245);})['then'](function(_0x4a0c54){_0x437a1b=_0x4a0c54;logger['info'](_0xabf1('0x56'),_0x437a1b['id']);return getEndUser(_0x316301,_0x2c0580[_0xabf1('0x5d')],_0x2c0580[_0xabf1('0x5e')],_0x480245);})[_0xabf1('0x30')](function(_0xbd7194){_0x3e106e=_0xbd7194;logger[_0xabf1('0x18')](_0xabf1('0x58'),_0x3e106e['id']);return createTicket(_0x316301,_0x437a1b,_0x3e106e,_0x23309b,_0x2c0580,_0x23309b[_0xabf1('0x49')],_0x480245);})['then'](function(_0x50683a){_0x5b3edd=_0x50683a;logger[_0xabf1('0x18')](_0xabf1('0x59'));logger[_0xabf1('0x18')](_0xabf1('0x4a'),_0x5b3edd['id']);})[_0xabf1('0x27')](function(_0x4f2143){logger['error']('[ABANDONED]',JSON[_0xabf1('0x2a')](_0x4f2143));});};
\ No newline at end of file
+var _0x4dd2=['getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Ticket\x20created!','[ABANDONED]','request-promise','bluebird','md5','ioredis','../../../../config/environment','vTiger','redis','defaults','socket.io-emitter','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Open','getString','Descriptions','POST','format','create','admin','sessionName','HelpDesk','stringify','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','result','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','statusCode'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x4dd2,0xf1));var _0x24dd=function(_0x51308d,_0x42cf02){_0x51308d=_0x51308d-0x0;var _0x37cde8=_0x4dd2[_0x51308d];return _0x37cde8;};'use strict';var _=require('lodash');var rp=require(_0x24dd('0x0'));var BPromise=require(_0x24dd('0x1'));var md5=require(_0x24dd('0x2'));var util=require('util');var Redis=require(_0x24dd('0x3'));var intUtil=require('./util');var config=require(_0x24dd('0x4'));var logger=require('../../../../config/logger')(_0x24dd('0x5'));config[_0x24dd('0x6')]=_[_0x24dd('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x24dd('0x8'))(new Redis(config[_0x24dd('0x6')]));function emit(_0x1dd44c,_0x424e48,_0x312f04){io['to'](_0x1dd44c)['emit'](_0x424e48,_0x312f04);}function getCustomFields(_0x43f2e0,_0x107a09){var _0x3105a1={};if(_0x43f2e0[_0x24dd('0x9')]>0x0){_[_0x24dd('0xa')](_0x43f2e0,function(_0x5c42bb){if(_0x5c42bb[_0x24dd('0xb')]===_0x24dd('0xc')&&_0x5c42bb[_0x24dd('0xd')]){_0x3105a1[_0x5c42bb[_0x24dd('0xd')]]=_0x5c42bb[_0x24dd('0xe')][_0x24dd('0xf')]();}else if(_0x5c42bb[_0x24dd('0xb')]===_0x24dd('0x10')&&_0x5c42bb['variableName']&&_0x5c42bb[_0x24dd('0xd')]&&_0x107a09[_0x5c42bb['variableName']]){_0x3105a1[_0x5c42bb[_0x24dd('0xd')]]=_0x107a09[_0x5c42bb[_0x24dd('0x11')]]['toString']();}else if(_0x5c42bb['type']===_0x24dd('0x12')&&_0x5c42bb[_0x24dd('0x13')]&&_0x5c42bb[_0x24dd('0x13')]['name']&&_0x5c42bb[_0x24dd('0xd')]&&_0x107a09[_0x5c42bb['Variable'][_0x24dd('0x14')][_0x24dd('0x15')]()]){_0x3105a1[_0x5c42bb[_0x24dd('0xd')]]=_0x107a09[_0x5c42bb[_0x24dd('0x13')]['name'][_0x24dd('0x15')]()][_0x24dd('0xf')]();}});}return _0x3105a1;}function createTicket(_0x593c8c,_0x4cce12,_0x2962d0,_0x5751cb,_0x3debf8,_0xdda9bc,_0x362d37){logger[_0x24dd('0x16')](_0x24dd('0x17'));var _0x24ca36=_['merge']({'parent_id':'','assigned_user_id':_0x4cce12['id'],'ticketpriorities':'Normal','ticketstatus':_0x24dd('0x18'),'ticket_title':intUtil[_0x24dd('0x19')](_0x5751cb['Subjects'],_0x3debf8,'\x20'),'description':intUtil['getString'](_0x5751cb[_0x24dd('0x1a')],_0x3debf8,'\x0a'),'contact_id':_0x2962d0['id']},getCustomFields(_0xdda9bc,_0x3debf8));var _0x57f7b0={'method':_0x24dd('0x1b'),'uri':util[_0x24dd('0x1c')]('%s/webservice.php',_0x593c8c['remoteUri']),'form':{'operation':_0x24dd('0x1d'),'username':_0x24dd('0x1e'),'sessionName':_0x362d37[_0x24dd('0x1f')],'elementType':_0x24dd('0x20'),'element':JSON[_0x24dd('0x21')](_0x24ca36)},'json':!![]};return request(_0x57f7b0)['then'](function(_0x359cd9){if(_0x359cd9[_0x24dd('0x22')]){return BPromise[_0x24dd('0x23')]({'id':_0x359cd9['result']['id']});}else{throw new Error(util[_0x24dd('0x1c')](_0x24dd('0x24'),JSON[_0x24dd('0x21')](_0x359cd9[_0x24dd('0x25')])));}})[_0x24dd('0x26')](function(_0x57affd){var _0x50061f=_0x57affd['statusCode']||0x1f4;logger[_0x24dd('0x25')](_0x24dd('0x27'),_0x24dd('0x28'),_0x50061f,JSON['stringify'](_0x57affd));});}function getUser(_0x48b1c8,_0x52dc35,_0x3329a6){if(intUtil[_0x24dd('0x29')](_0x52dc35)){logger[_0x24dd('0x16')](_0x24dd('0x2a'),_0x52dc35);return request({'method':_0x24dd('0x2b'),'uri':util['format'](_0x24dd('0x2c'),_0x48b1c8['remoteUri']),'qs':{'operation':_0x24dd('0x2d'),'username':_0x24dd('0x1e'),'sessionName':_0x3329a6[_0x24dd('0x1f')],'query':util['format'](_0x24dd('0x2e'),_0x52dc35)},'json':!![]})[_0x24dd('0x2f')](function(_0x5287d9){if(_0x5287d9[_0x24dd('0x22')]&&_0x5287d9['result'][_0x24dd('0x9')]){logger[_0x24dd('0x16')]('Agent\x20found!');return BPromise['resolve']({'id':_0x5287d9[_0x24dd('0x30')][0x0]['id'],'email':_0x5287d9[_0x24dd('0x30')][0x0][_0x24dd('0x31')],'name':_0x5287d9[_0x24dd('0x30')][0x0][_0x24dd('0x32')]+'\x20'+_0x5287d9[_0x24dd('0x30')][_0x24dd('0x33')]});}else{logger[_0x24dd('0x16')](_0x24dd('0x34'));return BPromise[_0x24dd('0x23')]({'id':_0x3329a6[_0x24dd('0x35')],'email':_0x48b1c8[_0x24dd('0x36')],'name':'admin'});}})[_0x24dd('0x26')](function(_0x421eaa){var _0x50251d=_0x421eaa[_0x24dd('0x37')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x24dd('0x38'),_0x50251d,JSON[_0x24dd('0x21')](_0x421eaa));});}else{logger['info'](_0x24dd('0x34'));return BPromise['resolve']({'id':_0x3329a6[_0x24dd('0x35')],'email':_0x48b1c8[_0x24dd('0x36')],'name':_0x24dd('0x1e')})[_0x24dd('0x26')](function(_0x23ced3){var _0x47ce28=_0x23ced3[_0x24dd('0x37')]||0x1f4;logger[_0x24dd('0x25')](_0x24dd('0x27'),_0x24dd('0x38'),_0x47ce28,JSON[_0x24dd('0x21')](_0x23ced3));});}}function getEndUser(_0xa2f8a2,_0x2d483d,_0x124889,_0xb71476){logger['info'](_0x24dd('0x39'),_0x124889);return request({'method':'GET','uri':util[_0x24dd('0x1c')](_0x24dd('0x2c'),_0xa2f8a2[_0x24dd('0x3a')]),'qs':{'operation':_0x24dd('0x2d'),'username':_0x24dd('0x1e'),'sessionName':_0xb71476[_0x24dd('0x1f')],'query':util[_0x24dd('0x1c')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x124889,_0x124889,_0x124889,_0x124889,_0x124889)},'json':!![]})[_0x24dd('0x2f')](function(_0x27bfe3){if(_0x27bfe3[_0x24dd('0x22')]&&_0x27bfe3[_0x24dd('0x30')][_0x24dd('0x9')]){logger[_0x24dd('0x16')](_0x24dd('0x3b'));return BPromise[_0x24dd('0x23')]({'id':_0x27bfe3['result'][0x0]['id'],'name':_0x27bfe3[_0x24dd('0x30')][0x0][_0x24dd('0x3c')]+'\x20'+_0x27bfe3[_0x24dd('0x30')][0x0][_0x24dd('0x3d')],'phone':_0x124889});}else{logger[_0x24dd('0x16')](_0x24dd('0x3e'));return request({'method':_0x24dd('0x1b'),'uri':util[_0x24dd('0x1c')](_0x24dd('0x2c'),_0xa2f8a2[_0x24dd('0x3a')]),'form':{'operation':_0x24dd('0x1d'),'sessionName':_0xb71476[_0x24dd('0x1f')],'elementType':_0x24dd('0x3f'),'element':JSON[_0x24dd('0x21')]({'lastname':_0x2d483d,'phone':_0x124889,'assigned_user_id':'\x20'})},'json':!![]})[_0x24dd('0x2f')](function(_0x1559e1){logger[_0x24dd('0x16')](_0x24dd('0x40'));return BPromise[_0x24dd('0x23')]({'id':_0x1559e1[_0x24dd('0x30')]['id'],'name':_0x1559e1[_0x24dd('0x30')]['lastname'],'phone':_0x1559e1[_0x24dd('0x30')]['phone']});})['catch'](function(_0x3fe680){var _0x46181b=_0x3fe680[_0x24dd('0x37')]||0x1f4;logger['error'](_0x24dd('0x27'),_0x24dd('0x41'),_0x46181b,JSON[_0x24dd('0x21')](_0x3fe680));});}});}function getConnection(_0x59222b){var _0xe268ab=_0x59222b[_0x24dd('0x36')];var _0x2a1330=_0x59222b[_0x24dd('0x42')];return request({'method':_0x24dd('0x2b'),'uri':util[_0x24dd('0x1c')](_0x24dd('0x2c'),_0x59222b[_0x24dd('0x3a')]),'qs':{'operation':'getchallenge','username':_0xe268ab},'json':!![]})[_0x24dd('0x2f')](function(_0x1e02ba){if(_0x1e02ba[_0x24dd('0x22')]){return request({'method':_0x24dd('0x1b'),'uri':util[_0x24dd('0x1c')](_0x24dd('0x2c'),_0x59222b[_0x24dd('0x3a')]),'form':{'operation':_0x24dd('0x43'),'username':'admin','accessKey':md5(_0x1e02ba[_0x24dd('0x30')]['token']+_0x2a1330)},'json':!![]});}})[_0x24dd('0x2f')](function(_0x1a4339){if(_0x1a4339['success']){return BPromise[_0x24dd('0x23')](_0x1a4339['result']);}else{throw new Error(util[_0x24dd('0x1c')](_0x24dd('0x44'),_0x59222b['id']));}})[_0x24dd('0x26')](function(_0x1f6c30){var _0x1e49ff=_0x1f6c30[_0x24dd('0x37')]||0x1f4;logger[_0x24dd('0x25')](_0x24dd('0x27'),_0x24dd('0x45'),_0x1e49ff,JSON['stringify'](_0x1f6c30));});}function request(_0x43c11e){logger['info'](_0x24dd('0x46'),JSON['stringify'](_0x43c11e));return rp(_0x43c11e);}exports['queue']=function(_0x13262c,_0x5e2d8e,_0x545ec1,_0x4caf8d,_0x1b7e0a,_0x1e3706){var _0x1884d6,_0x18a65b,_0x1e3f2b,_0x33927d;_0x1e3706[_0x24dd('0x3a')]=intUtil['stripTrailingSlash'](_0x1e3706[_0x24dd('0x3a')]);if(_0x1b7e0a&&_0x1b7e0a[_0x24dd('0x47')]){logger[_0x24dd('0x16')](_0x24dd('0x48'),_0x24dd('0x49'));_0x5e2d8e[_0x24dd('0x4a')]=util[_0x24dd('0x1c')](_0x24dd('0x4b'),_0x1e3706[_0x24dd('0x4c')],_0x5e2d8e[_0x24dd('0x4d')],md5(_0x5e2d8e[_0x24dd('0x4d')]));}else{_0x5e2d8e[_0x24dd('0x4a')]='';}return getConnection(_0x1e3706)[_0x24dd('0x2f')](function(_0x4a7d24){_0x33927d=_0x4a7d24;return getUser(_0x1e3706,_0x4caf8d[_0x24dd('0x4e')],_0x33927d);})[_0x24dd('0x2f')](function(_0x551f93){_0x1884d6=_0x551f93;logger[_0x24dd('0x16')](_0x24dd('0x4f'),_0x1884d6['id']);return getEndUser(_0x1e3706,_0x5e2d8e[_0x24dd('0x50')],_0x5e2d8e[_0x24dd('0x51')],_0x33927d);})[_0x24dd('0x2f')](function(_0x45ae08){_0x18a65b=_0x45ae08;logger[_0x24dd('0x16')](_0x24dd('0x52'),_0x18a65b['id']);return createTicket(_0x1e3706,_0x1884d6,_0x18a65b,_0x545ec1,_0x5e2d8e,_0x545ec1[_0x24dd('0x53')],_0x33927d);})[_0x24dd('0x2f')](function(_0x4a8990){_0x1e3f2b=_0x4a8990;logger['info']('Ticket\x20created!');logger['info'](_0x24dd('0x54'),_0x1e3f2b['id']);var _0x3a9f1c=util[_0x24dd('0x1c')](_0x24dd('0x55'),_0x1e3706['remoteUri'],_[_0x24dd('0x56')](_0x1e3f2b['id'],'x')[0x1]);logger['info'](_0x24dd('0x48'),_0x24dd('0x57'));emit(util[_0x24dd('0x1c')](_0x24dd('0x58'),_0x4caf8d[_0x24dd('0x14')]),_0x24dd('0x59'),{'uri':_0x3a9f1c});})['catch'](function(_0x4f821b){logger['error'](_0x24dd('0x48'),JSON[_0x24dd('0x21')](_0x4f821b));});};exports[_0x24dd('0x5a')]=function(_0x4d7e63,_0x3915b1,_0xd963d,_0x509d2f,_0x4f1e52,_0x1bc067,_0x23a61d){var _0x48f765,_0x56df2f,_0x2b8499,_0x58a0f4;_0x1bc067['remoteUri']=intUtil[_0x24dd('0x5b')](_0x1bc067['remoteUri']);_0x1bc067[_0x24dd('0x4c')]=intUtil[_0x24dd('0x5b')](_0x1bc067[_0x24dd('0x4c')]);if(_0x23a61d&&_0x23a61d[_0x24dd('0x5c')]&&_0x23a61d[_0x24dd('0x5c')]!==_0x24dd('0x5d')){logger['info'](_0x24dd('0x5e'),_0x24dd('0x49'));_0x3915b1[_0x24dd('0x4a')]=util[_0x24dd('0x1c')](_0x24dd('0x4b'),_0x1bc067[_0x24dd('0x4c')],_0x3915b1['uniqueid'],md5(_0x3915b1['uniqueid']));}return getConnection(_0x1bc067)[_0x24dd('0x2f')](function(_0x55e45d){_0x58a0f4=_0x55e45d;return getUser(_0x1bc067,_0x509d2f[_0x24dd('0x4e')],_0x58a0f4);})[_0x24dd('0x2f')](function(_0x391584){_0x48f765=_0x391584;logger[_0x24dd('0x16')](_0x24dd('0x4f'),_0x48f765['id']);return getEndUser(_0x1bc067,_0x3915b1[_0x24dd('0x5f')],_0x3915b1[_0x24dd('0x60')],_0x58a0f4);})['then'](function(_0x2af4c6){_0x56df2f=_0x2af4c6;logger['info'](_0x24dd('0x52'),_0x56df2f['id']);return createTicket(_0x1bc067,_0x48f765,_0x56df2f,_0xd963d,_0x3915b1,_0xd963d[_0x24dd('0x53')],_0x58a0f4);})[_0x24dd('0x2f')](function(_0x188089){_0x2b8499=_0x188089;logger['info'](_0x24dd('0x61'));logger[_0x24dd('0x16')](_0x24dd('0x54'),_0x2b8499['id']);var _0x4098ac=util['format'](_0x24dd('0x55'),_0x1bc067[_0x24dd('0x3a')],_[_0x24dd('0x56')](_0x2b8499['id'],'x')[0x1]);logger[_0x24dd('0x16')](_0x24dd('0x5e'),_0x24dd('0x57'));emit(util['format'](_0x24dd('0x58'),_0x509d2f[_0x24dd('0x14')]),_0x24dd('0x59'),{'uri':_0x4098ac});})['catch'](function(_0x1c8f37){logger[_0x24dd('0x25')](_0x24dd('0x5e'),JSON[_0x24dd('0x21')](_0x1c8f37));});};exports['abandoned']=function(_0x1ab13b,_0x48fbdc,_0x4da301,_0x5190a2,_0x456257,_0x5d894d){var _0x54e803,_0x222f90,_0x31cad0,_0x41d3ff;_0x5d894d['remoteUri']=intUtil['stripTrailingSlash'](_0x5d894d[_0x24dd('0x3a')]);_0x5d894d[_0x24dd('0x4c')]=intUtil[_0x24dd('0x5b')](_0x5d894d[_0x24dd('0x4c')]);if(_0x456257&&_0x456257[_0x24dd('0x47')]){logger['info'](_0x24dd('0x62'),_0x24dd('0x49'));_0x48fbdc['recordingURL']=util[_0x24dd('0x1c')](_0x24dd('0x4b'),_0x5d894d[_0x24dd('0x4c')],_0x48fbdc[_0x24dd('0x4d')],md5(_0x48fbdc[_0x24dd('0x4d')]));}else{_0x48fbdc['recordingURL']='';}return getConnection(_0x5d894d)[_0x24dd('0x2f')](function(_0x140d61){_0x41d3ff=_0x140d61;return getUser(_0x5d894d,'',_0x41d3ff);})[_0x24dd('0x2f')](function(_0x2c06a7){_0x54e803=_0x2c06a7;logger[_0x24dd('0x16')](_0x24dd('0x4f'),_0x54e803['id']);return getEndUser(_0x5d894d,_0x48fbdc[_0x24dd('0x50')],_0x48fbdc['calleridnum'],_0x41d3ff);})[_0x24dd('0x2f')](function(_0x11d22c){_0x222f90=_0x11d22c;logger[_0x24dd('0x16')](_0x24dd('0x52'),_0x222f90['id']);return createTicket(_0x5d894d,_0x54e803,_0x222f90,_0x4da301,_0x48fbdc,_0x4da301[_0x24dd('0x53')],_0x41d3ff);})['then'](function(_0x27c14f){_0x31cad0=_0x27c14f;logger[_0x24dd('0x16')]('Ticket\x20created!');logger[_0x24dd('0x16')]('The\x20Ticket\x20ID\x20is:',_0x31cad0['id']);})[_0x24dd('0x26')](function(_0x4a372e){logger[_0x24dd('0x25')]('[ABANDONED]',JSON['stringify'](_0x4a372e));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js
index 4425821..4507cea 100644
--- a/server/services/ami/trigger/integration/zendesk.js
+++ b/server/services/ami/trigger/integration/zendesk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1ae9=['%s/agent/tickets/%s','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','newTab','user:%s','error','[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','calleridnum','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/logger','zendesk','redis','defaults','localhost','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','password','%s:%s','username','authType','token','Basic\x20%s','base64','[HTTP]','stringify','map','forEach','type','nameField','customField','toLowerCase','content','toString','string','idField','variable','variableName','custom_fields','customVariable','push','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url'];(function(_0x30788e,_0x5398bf){var _0x2fb93a=function(_0x5ab7ec){while(--_0x5ab7ec){_0x30788e['push'](_0x30788e['shift']());}};_0x2fb93a(++_0x5398bf);}(_0x1ae9,0xe3));var _0x91ae=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x1ae9[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x91ae('0x0'));var rp=require(_0x91ae('0x1'));var md5=require('md5');var util=require(_0x91ae('0x2'));var Redis=require('ioredis');var intUtil=require(_0x91ae('0x3'));var config=require('../../../../config/environment');var logger=require(_0x91ae('0x4'))(_0x91ae('0x5'));config[_0x91ae('0x6')]=_[_0x91ae('0x7')](config[_0x91ae('0x6')],{'host':_0x91ae('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x91ae('0x6')]));function emit(_0x49e941,_0xfe19fc,_0x5496bf){io['to'](_0x49e941)['emit'](_0xfe19fc,_0x5496bf);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x206633,_0x30968e,_0x3cd582,_0x1e91b2,_0x187bdd){logger['info'](_0x91ae('0x9'));return request({'uri':util['format'](_0x91ae('0xa'),_0x206633[_0x91ae('0xb')]),'method':_0x91ae('0xc'),'body':{'ticket':_[_0x91ae('0xd')]({'requester_id':_0x3cd582['id'],'submitter_id':_0x30968e?_0x30968e['id']:undefined,'assignee_id':_0x30968e?_0x30968e['id']:undefined,'tags':getTags(_0x1e91b2['Tags'],_0x91ae('0xe')),'subject':intUtil[_0x91ae('0xf')](_0x1e91b2[_0x91ae('0x10')],_0x187bdd,'\x20'),'description':intUtil[_0x91ae('0xf')](_0x1e91b2[_0x91ae('0x11')],_0x187bdd,'\x0a'),'comment':{'public':![],'body':intUtil[_0x91ae('0xf')](_0x1e91b2['Descriptions'],_0x187bdd,'\x0a')}},getCustomFields(_0x1e91b2[_0x91ae('0x12')],_0x187bdd))}})['then'](function(_0x15f885){logger['info'](_0x91ae('0x13'));return _0x15f885['ticket'];});}function getUser(_0x507725,_0x52fbaa){if(intUtil[_0x91ae('0x14')](_0x52fbaa)){logger[_0x91ae('0x15')](_0x91ae('0x16'),_0x52fbaa);return request({'uri':util[_0x91ae('0x17')](_0x91ae('0x18'),_0x507725[_0x91ae('0xb')]),'qs':{'query':util['format'](_0x91ae('0x19'),_0x52fbaa)}})[_0x91ae('0x1a')](function(_0x2005dd){if(_0x2005dd[_0x91ae('0x1b')]){logger[_0x91ae('0x15')](_0x91ae('0x1c'));return _[_0x91ae('0x1d')](_0x2005dd['results'],{'email':_0x52fbaa,'role':_0x91ae('0x1e')});}else{logger[_0x91ae('0x15')](_0x91ae('0x1f'));return request({'uri':util[_0x91ae('0x17')](_0x91ae('0x20'),_0x507725[_0x91ae('0xb')])})[_0x91ae('0x1a')](function(_0x186f36){logger['info']('Admin\x20account\x20selected.');return _0x186f36[_0x91ae('0x21')];});}});}else{logger[_0x91ae('0x15')](_0x91ae('0x1f'));return request({'uri':util['format'](_0x91ae('0x20'),_0x507725[_0x91ae('0xb')])})[_0x91ae('0x1a')](function(_0x33f496){logger[_0x91ae('0x15')]('Admin\x20account\x20selected.');return _0x33f496[_0x91ae('0x21')];});}}function getEndUser(_0x5d26a2,_0xa66a8b,_0x2a1589){logger[_0x91ae('0x15')](_0x91ae('0x22'),_0x2a1589);return request({'uri':util['format'](_0x91ae('0x18'),_0x5d26a2[_0x91ae('0xb')]),'qs':{'query':util[_0x91ae('0x17')](_0x91ae('0x23'),_0x2a1589)}})[_0x91ae('0x1a')](function(_0x29b9e1){var _0x1428cf;if(_0x29b9e1[_0x91ae('0x24')][_0x91ae('0x25')]){_0x29b9e1[_0x91ae('0x24')]=_[_0x91ae('0x26')](_0x29b9e1['results'],{'suspended':![],'role':_0x91ae('0x27')});if(_0x29b9e1['results'][_0x91ae('0x25')]){_0x1428cf=_['first'](_0x29b9e1['results']);}}if(_0x1428cf){logger[_0x91ae('0x15')](_0x91ae('0x28'));return _0x1428cf;}else{logger[_0x91ae('0x15')](_0x91ae('0x29'));return request({'uri':util[_0x91ae('0x17')]('%s/users.json',_0x5d26a2[_0x91ae('0xb')]),'method':'POST','body':{'user':{'role':_0x91ae('0x27'),'name':util[_0x91ae('0x17')]('Caller\x20-\x20%s',_0xa66a8b||_0x2a1589),'phone':_0x2a1589}}})[_0x91ae('0x1a')](function(_0x22331c){logger[_0x91ae('0x15')]('Enduser\x20created.');return _0x22331c['user'];});}});}function getAuth(_0x307d46){var _0x3f6845;if(_0x307d46['authType']===_0x91ae('0x2a')){_0x3f6845=util['format'](_0x91ae('0x2b'),_0x307d46[_0x91ae('0x2c')],_0x307d46['password']);}else if(_0x307d46[_0x91ae('0x2d')]===_0x91ae('0x2e')){_0x3f6845=util['format']('%s/token:%s',_0x307d46[_0x91ae('0x2c')],_0x307d46[_0x91ae('0x2e')]);}return util[_0x91ae('0x17')](_0x91ae('0x2f'),new Buffer(_0x3f6845)['toString'](_0x91ae('0x30')));}function request(_0x1d05d9){logger['debug'](_0x91ae('0x31'),JSON[_0x91ae('0x32')](_0x1d05d9));return rp(_[_0x91ae('0x7')](_0x1d05d9,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2f0a64,_0x428f30){var _0x38ecd5=[];if(_0x2f0a64&&_0x2f0a64[_0x91ae('0x25')]>0x0){_0x38ecd5=_[_0x91ae('0x33')](_0x2f0a64,_0x428f30);}return _0x38ecd5;}function getCustomFields(_0x396f57,_0x53314c){var _0x4078a9=[];var _0x2c525c={'custom_fields':[]};if(_0x396f57['length']>0x0){_[_0x91ae('0x34')](_0x396f57,function(_0x5d638c){if(_0x5d638c[_0x91ae('0x35')]==='string'&&_0x5d638c[_0x91ae('0x36')]&&!_0x5d638c[_0x91ae('0x37')]){_0x2c525c[_0x5d638c[_0x91ae('0x36')][_0x91ae('0x38')]()]=_0x5d638c[_0x91ae('0x39')][_0x91ae('0x3a')]();}else if(_0x5d638c['type']===_0x91ae('0x3b')&&_0x5d638c[_0x91ae('0x3c')]&&_0x5d638c['customField']){_0x2c525c['custom_fields']['push']({'id':_0x5d638c[_0x91ae('0x3c')],'value':_0x5d638c[_0x91ae('0x39')]['toString']()});}else if(_0x5d638c[_0x91ae('0x35')]===_0x91ae('0x3d')&&_0x5d638c['variableName']&&_0x5d638c[_0x91ae('0x3c')]&&_0x5d638c[_0x91ae('0x37')]){_0x53314c[_0x5d638c[_0x91ae('0x3e')]]&&_0x2c525c[_0x91ae('0x3f')]['push']({'id':_0x5d638c[_0x91ae('0x3c')],'value':_0x53314c[_0x5d638c['variableName']]['toString']()});}else if(_0x5d638c[_0x91ae('0x35')]===_0x91ae('0x40')&&_0x5d638c['Variable']&&_0x5d638c['Variable'][_0x91ae('0xe')]&&_0x5d638c[_0x91ae('0x3c')]&&_0x5d638c['customField']){_0x53314c[_0x5d638c['Variable'][_0x91ae('0xe')][_0x91ae('0x38')]()]&&_0x2c525c['custom_fields'][_0x91ae('0x41')]({'id':_0x5d638c[_0x91ae('0x3c')],'value':_0x53314c[_0x5d638c['Variable'][_0x91ae('0xe')][_0x91ae('0x38')]()]['toString']()});}});}return _0x2c525c;}exports['queue']=function(_0x310eee,_0x24a1d8,_0x3ffab,_0x341d4f,_0x1b9842,_0x1983c1){var _0x16b5bb,_0x5cc5f2;_0x1983c1['remoteUri']=intUtil[_0x91ae('0x42')](_0x1983c1[_0x91ae('0xb')]);_0x1983c1[_0x91ae('0x43')]=intUtil['stripTrailingSlash'](_0x1983c1['serverUrl']);if(_0x1b9842&&_0x1b9842[_0x91ae('0x44')]){logger[_0x91ae('0x15')](_0x91ae('0x45'),_0x91ae('0x46'));_0x24a1d8[_0x91ae('0x47')]=util[_0x91ae('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1983c1[_0x91ae('0x43')],_0x24a1d8[_0x91ae('0x48')],md5(_0x24a1d8[_0x91ae('0x48')]));}else{_0x24a1d8[_0x91ae('0x47')]='';}headers['Authorization']=getAuth(_0x1983c1);return getUser(_0x1983c1,_0x341d4f[_0x91ae('0x49')])[_0x91ae('0x1a')](function(_0x3a7913){_0x16b5bb=_0x3a7913;logger[_0x91ae('0x15')](_0x91ae('0x4a'),_0x16b5bb['id']);return getEndUser(_0x1983c1,_0x24a1d8[_0x91ae('0x4b')],_0x24a1d8['calleridnum']);})[_0x91ae('0x1a')](function(_0x16df29){_0x5cc5f2=_0x16df29;logger[_0x91ae('0x15')](_0x91ae('0x4c'),_0x5cc5f2['id']);return getTicket(_0x1983c1,_0x16b5bb,_0x5cc5f2,_0x3ffab,_0x24a1d8);})['then'](function(_0x47cfc5){if(_0x47cfc5){logger[_0x91ae('0x15')]('The\x20Ticket\x20ID\x20is:',_0x47cfc5['id']);switch(_0x1983c1['type']){case _0x91ae('0x4d'):logger[_0x91ae('0x15')](_0x91ae('0x45'),_0x91ae('0x4e'));return request({'uri':util[_0x91ae('0x17')](_0x91ae('0x4f'),_0x1983c1['remoteUri'],_0x16b5bb['id'],_0x47cfc5['id']),'method':_0x91ae('0xc')});case'newTab':logger[_0x91ae('0x15')](_0x91ae('0x45'),_0x91ae('0x50'));emit(util['format']('user:%s',_0x341d4f[_0x91ae('0xe')]),_0x91ae('0x51'),{'uri':util[_0x91ae('0x17')](_0x91ae('0x52'),_0x1983c1[_0x91ae('0xb')],_0x47cfc5['id'])});break;default:logger['error'](_0x91ae('0x45'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x91ae('0x53')](function(_0x5c714d){logger['error'](_0x91ae('0x54'),util[_0x91ae('0x55')](_0x5c714d,{'showHidden':!![],'depth':null}));});};exports[_0x91ae('0x56')]=function(_0x416634,_0x120b08,_0x405a38,_0x431b36,_0x4ece85,_0x4cb13a,_0x29ff2c){var _0x376fbb,_0x24c0ff;_0x4cb13a[_0x91ae('0xb')]=intUtil[_0x91ae('0x42')](_0x4cb13a[_0x91ae('0xb')]);_0x4cb13a[_0x91ae('0x43')]=intUtil[_0x91ae('0x42')](_0x4cb13a[_0x91ae('0x43')]);if(_0x29ff2c&&_0x29ff2c[_0x91ae('0x57')]&&_0x29ff2c[_0x91ae('0x57')]!=='none'){logger[_0x91ae('0x15')]('[OUTBOUND]',_0x91ae('0x46'));_0x120b08[_0x91ae('0x47')]=util[_0x91ae('0x17')](_0x91ae('0x58'),_0x4cb13a[_0x91ae('0x43')],_0x120b08[_0x91ae('0x48')],md5(_0x120b08[_0x91ae('0x48')]));}headers[_0x91ae('0x59')]=getAuth(_0x4cb13a);return getUser(_0x4cb13a,_0x431b36[_0x91ae('0x49')])['then'](function(_0x391bc){_0x376fbb=_0x391bc;logger[_0x91ae('0x15')]('The\x20User\x20ID\x20is:',_0x376fbb['id']);return getEndUser(_0x4cb13a,_0x120b08[_0x91ae('0x5a')],_0x120b08[_0x91ae('0x5b')]);})[_0x91ae('0x1a')](function(_0x3148e1){_0x24c0ff=_0x3148e1;logger[_0x91ae('0x15')](_0x91ae('0x4c'),_0x24c0ff['id']);return getTicket(_0x4cb13a,_0x376fbb,_0x24c0ff,_0x405a38,_0x120b08);})[_0x91ae('0x1a')](function(_0x5ba452){if(_0x5ba452){logger[_0x91ae('0x15')](_0x91ae('0x5c'),_0x5ba452['id']);switch(_0x4cb13a[_0x91ae('0x35')]){case'integrationTab':logger[_0x91ae('0x15')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x91ae('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4cb13a['remoteUri'],_0x376fbb['id'],_0x5ba452['id']),'method':'POST'});case _0x91ae('0x5d'):logger[_0x91ae('0x15')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x91ae('0x5e'),_0x431b36[_0x91ae('0xe')]),_0x91ae('0x51'),{'uri':util[_0x91ae('0x17')](_0x91ae('0x52'),_0x4cb13a[_0x91ae('0xb')],_0x5ba452['id'])});break;default:logger[_0x91ae('0x5f')](_0x91ae('0x60'),_0x91ae('0x61'));}}})[_0x91ae('0x53')](function(_0x5c1306){logger[_0x91ae('0x5f')](_0x91ae('0x62'),util[_0x91ae('0x55')](_0x5c1306,{'showHidden':!![],'depth':null}));});};exports[_0x91ae('0x63')]=function(_0x2328d0,_0x466e91,_0x4ca810,_0xdde247,_0x2d911f,_0x528a46){var _0x1fa203,_0x3ff607;_0x528a46['remoteUri']=intUtil['stripTrailingSlash'](_0x528a46[_0x91ae('0xb')]);_0x528a46[_0x91ae('0x43')]=intUtil[_0x91ae('0x42')](_0x528a46[_0x91ae('0x43')]);if(_0x2d911f&&_0x2d911f[_0x91ae('0x44')]){logger[_0x91ae('0x15')](_0x91ae('0x64'),_0x91ae('0x46'));_0x466e91['recordingURL']=util[_0x91ae('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x528a46[_0x91ae('0x43')],_0x466e91[_0x91ae('0x48')],md5(_0x466e91['uniqueid']));}else{_0x466e91[_0x91ae('0x47')]='';}headers[_0x91ae('0x59')]=getAuth(_0x528a46);return getUser(_0x528a46)[_0x91ae('0x1a')](function(_0x5b345f){_0x1fa203=_0x5b345f;logger[_0x91ae('0x15')](_0x91ae('0x4a'),_0x1fa203['id']);return getEndUser(_0x528a46,_0x466e91[_0x91ae('0x4b')],_0x466e91[_0x91ae('0x65')]);})['then'](function(_0x1d9d68){_0x3ff607=_0x1d9d68;logger[_0x91ae('0x15')](_0x91ae('0x4c'),_0x3ff607['id']);return getTicket(_0x528a46,_0x1fa203,_0x3ff607,_0x4ca810,_0x466e91);})[_0x91ae('0x1a')](function(_0x3b03e9){if(_0x3b03e9){logger[_0x91ae('0x15')](_0x91ae('0x5c'),_0x3b03e9['id']);}})[_0x91ae('0x53')](function(_0x1920ff){logger['error'](_0x91ae('0x66'),util[_0x91ae('0x55')](_0x1920ff,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x38be=['remoteUri','POST','Tags','name','getString','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','%s/users.json','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','[HTTP]','defaults','GET','map','forEach','type','string','nameField','customField','toLowerCase','content','idField','custom_fields','variable','variableName','Variable','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','trigger:browser:url','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','abandoned','[ABANDONED]','Authorization','calleridnum','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','%s/tickets.json'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x38be,0xca));var _0xe38b=function(_0x4fec10,_0x58665a){_0x4fec10=_0x4fec10-0x0;var _0x650c5a=_0x38be[_0x4fec10];return _0x650c5a;};'use strict';var _=require(_0xe38b('0x0'));var rp=require('request-promise');var md5=require(_0xe38b('0x1'));var util=require(_0xe38b('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xe38b('0x3'))(_0xe38b('0x4'));config[_0xe38b('0x5')]=_['defaults'](config[_0xe38b('0x5')],{'host':_0xe38b('0x6'),'port':0x18eb});var io=require(_0xe38b('0x7'))(new Redis(config[_0xe38b('0x5')]));function emit(_0x10e132,_0x4fa3c6,_0x454747){io['to'](_0x10e132)[_0xe38b('0x8')](_0x4fa3c6,_0x454747);}var headers={'Content-Type':_0xe38b('0x9'),'Accept':_0xe38b('0x9')};function getTicket(_0x5e1bff,_0x80c569,_0x2ec9de,_0x2119a4,_0x2148e6){logger[_0xe38b('0xa')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0xe38b('0xb'),_0x5e1bff[_0xe38b('0xc')]),'method':_0xe38b('0xd'),'body':{'ticket':_['merge']({'requester_id':_0x2ec9de['id'],'submitter_id':_0x80c569?_0x80c569['id']:undefined,'assignee_id':_0x80c569?_0x80c569['id']:undefined,'tags':getTags(_0x2119a4[_0xe38b('0xe')],_0xe38b('0xf')),'subject':intUtil[_0xe38b('0x10')](_0x2119a4['Subjects'],_0x2148e6,'\x20'),'description':intUtil['getString'](_0x2119a4[_0xe38b('0x11')],_0x2148e6,'\x0a'),'comment':{'public':![],'body':intUtil[_0xe38b('0x10')](_0x2119a4[_0xe38b('0x11')],_0x2148e6,'\x0a')}},getCustomFields(_0x2119a4[_0xe38b('0x12')],_0x2148e6))}})[_0xe38b('0x13')](function(_0x445f52){logger[_0xe38b('0xa')]('Ticket\x20created!');return _0x445f52[_0xe38b('0x14')];});}function getUser(_0x562ed8,_0x5c708f){if(intUtil[_0xe38b('0x15')](_0x5c708f)){logger[_0xe38b('0xa')](_0xe38b('0x16'),_0x5c708f);return request({'uri':util[_0xe38b('0x17')](_0xe38b('0x18'),_0x562ed8[_0xe38b('0xc')]),'qs':{'query':util[_0xe38b('0x17')](_0xe38b('0x19'),_0x5c708f)}})['then'](function(_0x4da335){if(_0x4da335['count']){logger[_0xe38b('0xa')](_0xe38b('0x1a'));return _[_0xe38b('0x1b')](_0x4da335[_0xe38b('0x1c')],{'email':_0x5c708f,'role':_0xe38b('0x1d')});}else{logger[_0xe38b('0xa')](_0xe38b('0x1e'));return request({'uri':util[_0xe38b('0x17')]('%s/users/me.json',_0x562ed8[_0xe38b('0xc')])})[_0xe38b('0x13')](function(_0x1cce49){logger[_0xe38b('0xa')](_0xe38b('0x1f'));return _0x1cce49['user'];});}});}else{logger[_0xe38b('0xa')](_0xe38b('0x1e'));return request({'uri':util[_0xe38b('0x17')](_0xe38b('0x20'),_0x562ed8[_0xe38b('0xc')])})[_0xe38b('0x13')](function(_0x98674f){logger[_0xe38b('0xa')](_0xe38b('0x1f'));return _0x98674f[_0xe38b('0x21')];});}}function getEndUser(_0x15d4cc,_0x4aa87e,_0x36217e){logger[_0xe38b('0xa')](_0xe38b('0x22'),_0x36217e);return request({'uri':util[_0xe38b('0x17')](_0xe38b('0x18'),_0x15d4cc[_0xe38b('0xc')]),'qs':{'query':util[_0xe38b('0x17')](_0xe38b('0x23'),_0x36217e)}})[_0xe38b('0x13')](function(_0x4b2cc7){var _0x59359c;if(_0x4b2cc7[_0xe38b('0x1c')][_0xe38b('0x24')]){_0x4b2cc7[_0xe38b('0x1c')]=_[_0xe38b('0x25')](_0x4b2cc7[_0xe38b('0x1c')],{'suspended':![],'role':_0xe38b('0x26')});if(_0x4b2cc7[_0xe38b('0x1c')]['length']){_0x59359c=_[_0xe38b('0x27')](_0x4b2cc7[_0xe38b('0x1c')]);}}if(_0x59359c){logger[_0xe38b('0xa')](_0xe38b('0x28'));return _0x59359c;}else{logger[_0xe38b('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xe38b('0x29'),_0x15d4cc[_0xe38b('0xc')]),'method':'POST','body':{'user':{'role':_0xe38b('0x26'),'name':util[_0xe38b('0x17')]('Caller\x20-\x20%s',_0x4aa87e||_0x36217e),'phone':_0x36217e}}})[_0xe38b('0x13')](function(_0x2ac4f1){logger[_0xe38b('0xa')](_0xe38b('0x2a'));return _0x2ac4f1[_0xe38b('0x21')];});}});}function getAuth(_0x6fa905){var _0x27b3c0;if(_0x6fa905[_0xe38b('0x2b')]===_0xe38b('0x2c')){_0x27b3c0=util['format'](_0xe38b('0x2d'),_0x6fa905[_0xe38b('0x2e')],_0x6fa905[_0xe38b('0x2c')]);}else if(_0x6fa905[_0xe38b('0x2b')]===_0xe38b('0x2f')){_0x27b3c0=util[_0xe38b('0x17')](_0xe38b('0x30'),_0x6fa905['username'],_0x6fa905[_0xe38b('0x2f')]);}return util[_0xe38b('0x17')]('Basic\x20%s',new Buffer(_0x27b3c0)[_0xe38b('0x31')](_0xe38b('0x32')));}function request(_0x1cad8b){logger[_0xe38b('0x33')](_0xe38b('0x34'),JSON['stringify'](_0x1cad8b));return rp(_[_0xe38b('0x35')](_0x1cad8b,{'method':_0xe38b('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x2e5ed8,_0x387c35){var _0x3e6f4e=[];if(_0x2e5ed8&&_0x2e5ed8[_0xe38b('0x24')]>0x0){_0x3e6f4e=_[_0xe38b('0x37')](_0x2e5ed8,_0x387c35);}return _0x3e6f4e;}function getCustomFields(_0x5048cc,_0x46c8e9){var _0x42e399=[];var _0x51ad59={'custom_fields':[]};if(_0x5048cc['length']>0x0){_[_0xe38b('0x38')](_0x5048cc,function(_0x5ef389){if(_0x5ef389[_0xe38b('0x39')]===_0xe38b('0x3a')&&_0x5ef389[_0xe38b('0x3b')]&&!_0x5ef389[_0xe38b('0x3c')]){_0x51ad59[_0x5ef389[_0xe38b('0x3b')][_0xe38b('0x3d')]()]=_0x5ef389[_0xe38b('0x3e')][_0xe38b('0x31')]();}else if(_0x5ef389['type']===_0xe38b('0x3a')&&_0x5ef389[_0xe38b('0x3f')]&&_0x5ef389[_0xe38b('0x3c')]){_0x51ad59[_0xe38b('0x40')]['push']({'id':_0x5ef389[_0xe38b('0x3f')],'value':_0x5ef389[_0xe38b('0x3e')][_0xe38b('0x31')]()});}else if(_0x5ef389['type']===_0xe38b('0x41')&&_0x5ef389[_0xe38b('0x42')]&&_0x5ef389['idField']&&_0x5ef389['customField']){_0x46c8e9[_0x5ef389[_0xe38b('0x42')]]&&_0x51ad59['custom_fields']['push']({'id':_0x5ef389[_0xe38b('0x3f')],'value':_0x46c8e9[_0x5ef389[_0xe38b('0x42')]][_0xe38b('0x31')]()});}else if(_0x5ef389['type']==='customVariable'&&_0x5ef389[_0xe38b('0x43')]&&_0x5ef389[_0xe38b('0x43')]['name']&&_0x5ef389[_0xe38b('0x3f')]&&_0x5ef389['customField']){_0x46c8e9[_0x5ef389['Variable'][_0xe38b('0xf')][_0xe38b('0x3d')]()]&&_0x51ad59[_0xe38b('0x40')][_0xe38b('0x44')]({'id':_0x5ef389[_0xe38b('0x3f')],'value':_0x46c8e9[_0x5ef389[_0xe38b('0x43')][_0xe38b('0xf')][_0xe38b('0x3d')]()]['toString']()});}});}return _0x51ad59;}exports[_0xe38b('0x45')]=function(_0x4bb693,_0x1c9d3b,_0x3aa487,_0x47f7b0,_0x507e8c,_0x3d12ce){var _0x221e78,_0x2b5414;_0x3d12ce[_0xe38b('0xc')]=intUtil[_0xe38b('0x46')](_0x3d12ce[_0xe38b('0xc')]);_0x3d12ce['serverUrl']=intUtil['stripTrailingSlash'](_0x3d12ce[_0xe38b('0x47')]);if(_0x507e8c&&_0x507e8c[_0xe38b('0x48')]){logger[_0xe38b('0xa')](_0xe38b('0x49'),_0xe38b('0x4a'));_0x1c9d3b[_0xe38b('0x4b')]=util[_0xe38b('0x17')](_0xe38b('0x4c'),_0x3d12ce[_0xe38b('0x47')],_0x1c9d3b[_0xe38b('0x4d')],md5(_0x1c9d3b[_0xe38b('0x4d')]));}else{_0x1c9d3b[_0xe38b('0x4b')]='';}headers['Authorization']=getAuth(_0x3d12ce);return getUser(_0x3d12ce,_0x47f7b0[_0xe38b('0x4e')])['then'](function(_0x3a83ec){_0x221e78=_0x3a83ec;logger[_0xe38b('0xa')](_0xe38b('0x4f'),_0x221e78['id']);return getEndUser(_0x3d12ce,_0x1c9d3b[_0xe38b('0x50')],_0x1c9d3b['calleridnum']);})[_0xe38b('0x13')](function(_0x4804a6){_0x2b5414=_0x4804a6;logger['info'](_0xe38b('0x51'),_0x2b5414['id']);return getTicket(_0x3d12ce,_0x221e78,_0x2b5414,_0x3aa487,_0x1c9d3b);})[_0xe38b('0x13')](function(_0x2153c4){if(_0x2153c4){logger[_0xe38b('0xa')]('The\x20Ticket\x20ID\x20is:',_0x2153c4['id']);switch(_0x3d12ce[_0xe38b('0x39')]){case _0xe38b('0x52'):logger[_0xe38b('0xa')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xe38b('0x17')](_0xe38b('0x53'),_0x3d12ce[_0xe38b('0xc')],_0x221e78['id'],_0x2153c4['id']),'method':_0xe38b('0xd')});case _0xe38b('0x54'):logger[_0xe38b('0xa')](_0xe38b('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe38b('0x17')]('user:%s',_0x47f7b0[_0xe38b('0xf')]),_0xe38b('0x55'),{'uri':util['format']('%s/agent/tickets/%s',_0x3d12ce['remoteUri'],_0x2153c4['id'])});break;default:logger['error'](_0xe38b('0x49'),_0xe38b('0x56'));}}})[_0xe38b('0x57')](function(_0x16457f){logger[_0xe38b('0x58')](_0xe38b('0x59'),util['inspect'](_0x16457f,{'showHidden':!![],'depth':null}));});};exports[_0xe38b('0x5a')]=function(_0x30a227,_0x4dad70,_0x484087,_0x43464e,_0x571b85,_0x4f8893,_0x17f680){var _0x2567e1,_0x43d4a4;_0x4f8893[_0xe38b('0xc')]=intUtil[_0xe38b('0x46')](_0x4f8893[_0xe38b('0xc')]);_0x4f8893[_0xe38b('0x47')]=intUtil['stripTrailingSlash'](_0x4f8893[_0xe38b('0x47')]);if(_0x17f680&&_0x17f680[_0xe38b('0x5b')]&&_0x17f680['recordingFormat']!==_0xe38b('0x5c')){logger[_0xe38b('0xa')](_0xe38b('0x5d'),_0xe38b('0x4a'));_0x4dad70[_0xe38b('0x4b')]=util[_0xe38b('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4f8893[_0xe38b('0x47')],_0x4dad70[_0xe38b('0x4d')],md5(_0x4dad70[_0xe38b('0x4d')]));}headers['Authorization']=getAuth(_0x4f8893);return getUser(_0x4f8893,_0x43464e[_0xe38b('0x4e')])['then'](function(_0x48dedb){_0x2567e1=_0x48dedb;logger[_0xe38b('0xa')](_0xe38b('0x4f'),_0x2567e1['id']);return getEndUser(_0x4f8893,_0x4dad70[_0xe38b('0x5e')],_0x4dad70[_0xe38b('0x5f')]);})[_0xe38b('0x13')](function(_0x4a3939){_0x43d4a4=_0x4a3939;logger['info'](_0xe38b('0x51'),_0x43d4a4['id']);return getTicket(_0x4f8893,_0x2567e1,_0x43d4a4,_0x484087,_0x4dad70);})['then'](function(_0x4a80a3){if(_0x4a80a3){logger[_0xe38b('0xa')](_0xe38b('0x60'),_0x4a80a3['id']);switch(_0x4f8893[_0xe38b('0x39')]){case'integrationTab':logger[_0xe38b('0xa')](_0xe38b('0x5d'),_0xe38b('0x61'));return request({'uri':util[_0xe38b('0x17')](_0xe38b('0x53'),_0x4f8893['remoteUri'],_0x2567e1['id'],_0x4a80a3['id']),'method':_0xe38b('0xd')});case'newTab':logger[_0xe38b('0xa')](_0xe38b('0x5d'),_0xe38b('0x62'));emit(util[_0xe38b('0x17')]('user:%s',_0x43464e[_0xe38b('0xf')]),_0xe38b('0x55'),{'uri':util['format'](_0xe38b('0x63'),_0x4f8893[_0xe38b('0xc')],_0x4a80a3['id'])});break;default:logger[_0xe38b('0x58')](_0xe38b('0x5d'),_0xe38b('0x56'));}}})[_0xe38b('0x57')](function(_0x5bd3f9){logger['error'](_0xe38b('0x64'),util[_0xe38b('0x65')](_0x5bd3f9,{'showHidden':!![],'depth':null}));});};exports[_0xe38b('0x66')]=function(_0x2e2342,_0x2c1723,_0x47ab03,_0x24c37f,_0x48feda,_0x3bbad6){var _0x479924,_0x54e17f;_0x3bbad6[_0xe38b('0xc')]=intUtil['stripTrailingSlash'](_0x3bbad6[_0xe38b('0xc')]);_0x3bbad6[_0xe38b('0x47')]=intUtil['stripTrailingSlash'](_0x3bbad6['serverUrl']);if(_0x48feda&&_0x48feda['monitor_format']){logger[_0xe38b('0xa')](_0xe38b('0x67'),_0xe38b('0x4a'));_0x2c1723[_0xe38b('0x4b')]=util[_0xe38b('0x17')](_0xe38b('0x4c'),_0x3bbad6['serverUrl'],_0x2c1723[_0xe38b('0x4d')],md5(_0x2c1723[_0xe38b('0x4d')]));}else{_0x2c1723[_0xe38b('0x4b')]='';}headers[_0xe38b('0x68')]=getAuth(_0x3bbad6);return getUser(_0x3bbad6)[_0xe38b('0x13')](function(_0x3b1e73){_0x479924=_0x3b1e73;logger['info'](_0xe38b('0x4f'),_0x479924['id']);return getEndUser(_0x3bbad6,_0x2c1723[_0xe38b('0x50')],_0x2c1723[_0xe38b('0x69')]);})[_0xe38b('0x13')](function(_0x4197dd){_0x54e17f=_0x4197dd;logger[_0xe38b('0xa')]('The\x20Enduser\x20ID\x20is:',_0x54e17f['id']);return getTicket(_0x3bbad6,_0x479924,_0x54e17f,_0x47ab03,_0x2c1723);})['then'](function(_0x4ba996){if(_0x4ba996){logger['info'](_0xe38b('0x60'),_0x4ba996['id']);}})['catch'](function(_0xc2264f){logger['error'](_0xe38b('0x6a'),util[_0xe38b('0x65')](_0xc2264f,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js
index 2538e67..3c2bcac 100644
--- a/server/services/ami/trigger/integration/zoho.js
+++ b/server/services/ami/trigger/integration/zoho.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x79bb=['Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','talktime','utc','endtime','Call\x20Duration','YYYY-MM-DD\x20HH:mm:ss','diff','format','mm:ss','CONTACTID','LEADID','SEMODULE','SEID','hasOwnProperty','%s ','encodeXML','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','authToken','crmapi','then','parse','response','result','recorddetail','Call\x20created!','GET','host','AllUsers','users','user','log','zoho\x20data\x20users','find','Standard','isNil','Using\x20the\x20admin\x20account!','Administrator','zoho\x20user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','row','Contacts','length','val','content','https://crm.%s/crm/private/json/Leads/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Leads!','Leads','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','%s %s %s |
','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','string','idField','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','uniqueid','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','user:%s','[ABANDONED]','lodash','util','moment','ioredis','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20call...','inbound','starttime','agentcalledAt','getString','Descriptions','Fields','lastevent','Call\x20Result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x79bb,0xee));var _0xb79b=function(_0x139071,_0x5bf029){_0x139071=_0x139071-0x0;var _0x200300=_0x79bb[_0x139071];return _0x200300;};'use strict';var _=require(_0xb79b('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xb79b('0x1'));var intUtil=require('./util');var parser=require('xml2json');var entities=require('entities');var moment=require(_0xb79b('0x2'));var Redis=require(_0xb79b('0x3'));var config=require(_0xb79b('0x4'));var logger=require('../../../../config/logger')(_0xb79b('0x5'));config[_0xb79b('0x6')]=_[_0xb79b('0x7')](config['redis'],{'host':_0xb79b('0x8'),'port':0x18eb});var io=require(_0xb79b('0x9'))(new Redis(config[_0xb79b('0x6')]));function emit(_0x2e074b,_0x328b60,_0x44248d){io['to'](_0x2e074b)[_0xb79b('0xa')](_0x328b60,_0x44248d);}var headers={'Content-Type':_0xb79b('0xb'),'Accept':_0xb79b('0xb')};function getCall(_0x5ed79c,_0x32996e,_0x12296d,_0x44e6d7,_0x1e7be1,_0x38f126){logger[_0xb79b('0xc')](_0xb79b('0xd'));var _0x1bb960=_['merge']({'SMOWNERID':_0x32996e['id'],'Call Type':_0x38f126||_0xb79b('0xe'),'Call Start Time':(_0x38f126==='outbound'?_0x1e7be1[_0xb79b('0xf')]:_0x1e7be1[_0xb79b('0x10')])||moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'Subject':intUtil[_0xb79b('0x11')](_0x44e6d7['Subjects'],_0x1e7be1,'\x20'),'Description':intUtil[_0xb79b('0x11')](_0x44e6d7[_0xb79b('0x12')],_0x1e7be1,'\x0a')},getCustomFields(_0x44e6d7[_0xb79b('0x13')],_0x1e7be1));switch(_0x1e7be1[_0xb79b('0x14')]){case'called':_0x1bb960[_0xb79b('0x15')]=_0xb79b('0x16');break;case _0xb79b('0x17'):case'connect':_0x1bb960[_0xb79b('0x15')]=_0xb79b('0x18');break;case _0xb79b('0x19'):_0x1bb960[_0xb79b('0x15')]=_0xb79b('0x1a');break;case _0xb79b('0x1b'):_0x1bb960[_0xb79b('0x15')]=_0xb79b('0x1c');break;default:}if(_0x1e7be1[_0xb79b('0x1d')]){_0x1bb960['Call\x20Duration']=moment[_0xb79b('0x1e')](parseInt(_0x1e7be1[_0xb79b('0x1d')])*0x3e8)['format']('mm:ss');}else if(_0x1e7be1['answertime']&&_0x1e7be1[_0xb79b('0x1f')]){_0x1bb960[_0xb79b('0x20')]=moment[_0xb79b('0x1e')](moment(_0x1e7be1['endtime'],_0xb79b('0x21'))[_0xb79b('0x22')](moment(_0x1e7be1[_0xb79b('0xf')],_0xb79b('0x21'))))[_0xb79b('0x23')](_0xb79b('0x24'));}if(_0x12296d[_0xb79b('0x25')]){_0x1bb960[_0xb79b('0x25')]=_0x12296d['CONTACTID'];}else if(_0x12296d[_0xb79b('0x26')]){_0x1bb960[_0xb79b('0x27')]='Leads';_0x1bb960[_0xb79b('0x28')]=_0x12296d['LEADID'];}var _0x2c710d='';for(var _0xadbbb4 in _0x1bb960){if(_0x1bb960[_0xb79b('0x29')](_0xadbbb4)){_0x2c710d+=util[_0xb79b('0x23')](_0xb79b('0x2a'),entities[_0xb79b('0x2b')](_0xadbbb4),entities[_0xb79b('0x2b')](_0x1bb960[_0xadbbb4]));}}_0x2c710d+='
';return request({'method':_0xb79b('0x2c'),'uri':util[_0xb79b('0x23')](_0xb79b('0x2d'),_0x5ed79c['host']),'qs':{'authtoken':_0x5ed79c[_0xb79b('0x2e')],'scope':_0xb79b('0x2f'),'xmlData':_0x2c710d},'json':!![]})[_0xb79b('0x30')](function(_0x535b52){_0x535b52=JSON[_0xb79b('0x31')](parser['toJson'](_0x535b52));if(_0x535b52[_0xb79b('0x32')]){if(_0x535b52[_0xb79b('0x32')]['result']&&_0x535b52[_0xb79b('0x32')][_0xb79b('0x33')][_0xb79b('0x34')]){logger['info'](_0xb79b('0x35'));return{'id':_0x535b52['response'][_0xb79b('0x33')][_0xb79b('0x34')]['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON['stringify'](_0x535b52));});}function getUser(_0x3810c8,_0x1ccaaa){return request({'method':_0xb79b('0x36'),'uri':util[_0xb79b('0x23')]('https://crm.%s/crm/private/json/Users/getUsers',_0x3810c8[_0xb79b('0x37')]),'qs':{'type':_0xb79b('0x38'),'authtoken':_0x3810c8[_0xb79b('0x2e')],'scope':'crmapi'},'json':!![]})[_0xb79b('0x30')](function(_0x26b0e8){if(_0x26b0e8['users']&&_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')]){var _0x9dee80;console[_0xb79b('0x3b')](_0xb79b('0x3c'),_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')]);if(_['isArrayLikeObject'](_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')])){console[_0xb79b('0x3b')](_0xb79b('0x3c'),_0x26b0e8[_0xb79b('0x39')]['user']);if(!_['isNil'](_0x1ccaaa)){_0x9dee80=_[_0xb79b('0x3d')](_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')],{'email':_0x1ccaaa,'profile':_0xb79b('0x3e'),'status':'active'});}if(!_[_0xb79b('0x3f')](_0x9dee80)){logger[_0xb79b('0xc')]('Agent\x20found!');}else{logger[_0xb79b('0xc')](_0xb79b('0x40'));_0x9dee80=_[_0xb79b('0x3d')](_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')],{'profile':_0xb79b('0x41')});}console[_0xb79b('0x3b')](_0xb79b('0x42'),_0x9dee80);return _0x9dee80;}else{if(_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')]['profile']===_0xb79b('0x41')){logger[_0xb79b('0xc')](_0xb79b('0x40'));_0x9dee80=_0x26b0e8[_0xb79b('0x39')]['user'];return _0x9dee80;}else{logger['error'](_0xb79b('0x43'),JSON['stringify'](_0x26b0e8));throw new Error(_0xb79b('0x44')+JSON[_0xb79b('0x45')](_0x26b0e8));}}}else{logger['error'](_0xb79b('0x43'),JSON[_0xb79b('0x45')](_0x26b0e8));throw new Error(_0xb79b('0x44')+JSON[_0xb79b('0x45')](_0x26b0e8));}});}function getEndUser(_0x54ab7f,_0x3dc4ff,_0x37fbf9){logger[_0xb79b('0xc')](_0xb79b('0x46'),_0x37fbf9);return request({'method':'GET','uri':util[_0xb79b('0x23')](_0xb79b('0x47'),_0x54ab7f[_0xb79b('0x37')]),'qs':{'authtoken':_0x54ab7f[_0xb79b('0x2e')],'scope':'crmapi','criteria':util[_0xb79b('0x23')]('((Phone:%s))',_0x37fbf9)},'json':!![]})[_0xb79b('0x30')](function(_0x4dea22){if(_0x4dea22[_0xb79b('0x32')]&&_0x4dea22[_0xb79b('0x32')][_0xb79b('0x33')]){logger[_0xb79b('0xc')]('Enduser\x20found\x20in\x20Contacts!');var _0x5a18a8={};var _0x176ae3=_0x4dea22[_0xb79b('0x32')][_0xb79b('0x33')]['Contacts'][_0xb79b('0x48')]['no']?_0x4dea22['response']['result'][_0xb79b('0x49')][_0xb79b('0x48')]['FL']:_0x4dea22[_0xb79b('0x32')][_0xb79b('0x33')][_0xb79b('0x49')][_0xb79b('0x48')][0x0]['FL'];for(var _0x1e968b=0x0,_0xcb7910=_0x176ae3[_0xb79b('0x4a')];_0x1e968b<_0xcb7910;_0x1e968b++){_0x5a18a8[_0x176ae3[_0x1e968b][_0xb79b('0x4b')]]=_0x176ae3[_0x1e968b][_0xb79b('0x4c')];}return _0x5a18a8;}else{return request({'method':'GET','uri':util[_0xb79b('0x23')](_0xb79b('0x4d'),_0x54ab7f['host']),'qs':{'authtoken':_0x54ab7f[_0xb79b('0x2e')],'scope':_0xb79b('0x2f'),'criteria':util['format'](_0xb79b('0x4e'),_0x37fbf9)},'json':!![]})[_0xb79b('0x30')](function(_0x18ac70){if(_0x18ac70[_0xb79b('0x32')]&&_0x18ac70[_0xb79b('0x32')][_0xb79b('0x33')]){logger[_0xb79b('0xc')](_0xb79b('0x4f'));var _0x40f21d={};var _0x32bb81=_0x18ac70['response'][_0xb79b('0x33')][_0xb79b('0x50')][_0xb79b('0x48')]['no']?_0x18ac70[_0xb79b('0x32')][_0xb79b('0x33')]['Leads'][_0xb79b('0x48')]['FL']:_0x18ac70[_0xb79b('0x32')][_0xb79b('0x33')][_0xb79b('0x50')][_0xb79b('0x48')][0x0]['FL'];for(var _0x59f358=0x0,_0x5b3483=_0x32bb81[_0xb79b('0x4a')];_0x59f358<_0x5b3483;_0x59f358++){_0x40f21d[_0x32bb81[_0x59f358]['val']]=_0x32bb81[_0x59f358][_0xb79b('0x4c')];}return _0x40f21d;}else{logger[_0xb79b('0xc')](_0xb79b('0x51'));_0x3dc4ff=getName(_0x3dc4ff);return request({'method':_0xb79b('0x2c'),'uri':util[_0xb79b('0x23')](_0xb79b('0x52'),_0x54ab7f['host']),'qs':{'authtoken':_0x54ab7f[_0xb79b('0x2e')],'scope':_0xb79b('0x2f'),'xmlData':util['format'](_0xb79b('0x53'),entities[_0xb79b('0x2b')](_0x3dc4ff[0x0]),entities['encodeXML'](_0x3dc4ff[0x1]),_0x37fbf9)},'json':!![]})[_0xb79b('0x30')](function(_0x48ca31){_0x48ca31=JSON[_0xb79b('0x31')](parser['toJson'](_0x48ca31));if(_0x48ca31[_0xb79b('0x32')]){if(_0x48ca31[_0xb79b('0x32')][_0xb79b('0x33')]&&_0x48ca31[_0xb79b('0x32')]['result'][_0xb79b('0x34')]){logger[_0xb79b('0xc')](_0xb79b('0x54'));return request({'method':'GET','uri':util[_0xb79b('0x23')](_0xb79b('0x55'),_0x54ab7f[_0xb79b('0x37')]),'qs':{'authtoken':_0x54ab7f[_0xb79b('0x2e')],'scope':_0xb79b('0x2f'),'id':_0x48ca31['response'][_0xb79b('0x33')][_0xb79b('0x34')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0xb79b('0x56')+JSON['stringify'](_0x48ca31));})[_0xb79b('0x30')](function(_0x1e53ac){if(_0x1e53ac[_0xb79b('0x32')]){if(_0x1e53ac['response']['result']){var _0x5eaaf6={};for(var _0x1316b7=0x0,_0x1bc793=_0x1e53ac[_0xb79b('0x32')][_0xb79b('0x33')][_0xb79b('0x50')][_0xb79b('0x48')]['FL'][_0xb79b('0x4a')];_0x1316b7<_0x1bc793;_0x1316b7++){_0x5eaaf6[_0x1e53ac['response']['result'][_0xb79b('0x50')][_0xb79b('0x48')]['FL'][_0x1316b7][_0xb79b('0x4b')]]=_0x1e53ac[_0xb79b('0x32')][_0xb79b('0x33')][_0xb79b('0x50')][_0xb79b('0x48')]['FL'][_0x1316b7][_0xb79b('0x4c')];}return _0x5eaaf6;}}throw new Error(_0xb79b('0x57')+JSON[_0xb79b('0x45')](_0x1e53ac));});}});}});}function request(_0x250034){logger[_0xb79b('0x58')](_0xb79b('0x59'),JSON[_0xb79b('0x45')](_0x250034));return rp(_0x250034);}function getCustomFields(_0x466edd,_0xb3426c){var _0x3218a4={};if(_0x466edd['length']>0x0){_[_0xb79b('0x5a')](_0x466edd,function(_0x31ac46){if(_0x31ac46['type']===_0xb79b('0x5b')&&_0x31ac46[_0xb79b('0x5c')]){_0x3218a4[_0x31ac46[_0xb79b('0x5c')]]=_0x31ac46[_0xb79b('0x4c')][_0xb79b('0x5d')]();}else if(_0x31ac46[_0xb79b('0x5e')]===_0xb79b('0x5f')&&_0x31ac46[_0xb79b('0x60')]&&_0x31ac46[_0xb79b('0x5c')]&&_0xb3426c[_0x31ac46[_0xb79b('0x60')]]){_0x3218a4[_0x31ac46[_0xb79b('0x5c')]]=_0xb3426c[_0x31ac46['variableName']]['toString']();}else if(_0x31ac46[_0xb79b('0x5e')]===_0xb79b('0x61')&&_0x31ac46[_0xb79b('0x62')]&&_0x31ac46['Variable'][_0xb79b('0x63')]&&_0x31ac46['idField']&&_0xb3426c[_0x31ac46['Variable'][_0xb79b('0x63')][_0xb79b('0x64')]()]){_0x3218a4[_0x31ac46[_0xb79b('0x5c')]]=_0xb3426c[_0x31ac46[_0xb79b('0x62')][_0xb79b('0x63')][_0xb79b('0x64')]()][_0xb79b('0x5d')]();}});}return _0x3218a4;}function getName(_0x53d309){if(_0x53d309[_0xb79b('0x65')]('\x20')>0x0){var _0xf7b51f=_0x53d309[_0xb79b('0x66')](/ (.+)/);if(_0xf7b51f[0x1]){return _0xf7b51f;}}return[_0x53d309,_0x53d309];}exports['queue']=function(_0x515579,_0x13fe56,_0xbc73ec,_0x13b1de,_0x51522a,_0xd2f7e7){var _0x24efa7,_0xcddebc;_0xd2f7e7['host']=intUtil['stripTrailingSlash'](_0xd2f7e7['host']);_0xd2f7e7[_0xb79b('0x67')]=intUtil[_0xb79b('0x68')](_0xd2f7e7[_0xb79b('0x67')]);if(_0x51522a&&_0x51522a['monitor_format']){logger[_0xb79b('0xc')]('[QUEUE]',_0xb79b('0x69'));_0x13fe56['recordingURL']=util[_0xb79b('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd2f7e7[_0xb79b('0x67')],_0x13fe56[_0xb79b('0x6a')],md5(_0x13fe56['uniqueid']));}else{_0x13fe56[_0xb79b('0x6b')]='';}return getUser(_0xd2f7e7,_0x13b1de[_0xb79b('0x6c')])['then'](function(_0x42d56b){_0x24efa7=_0x42d56b;logger['info']('The\x20User\x20ID\x20is:',_0x24efa7['id']);return getEndUser(_0xd2f7e7,_0x13fe56[_0xb79b('0x6d')],_0x13fe56[_0xb79b('0x6e')]);})[_0xb79b('0x30')](function(_0xe2c01d){_0xcddebc=_0xe2c01d;logger['info'](_0xb79b('0x6f'),_0xcddebc[_0xb79b('0x25')]||_0xcddebc[_0xb79b('0x26')]);return getCall(_0xd2f7e7,_0x24efa7,_0xcddebc,_0xbc73ec,_0x13fe56,_0xb79b('0x70'));})['then'](function(_0x57524e){if(_0x57524e){logger[_0xb79b('0xc')](_0xb79b('0x71'),_0x57524e['id']);logger[_0xb79b('0xc')](_0xb79b('0x72'),_0xb79b('0x73'));emit(util[_0xb79b('0x23')]('user:%s',_0x13b1de[_0xb79b('0x63')]),_0xb79b('0x74'),{'uri':util['format'](_0xb79b('0x75'),_0xd2f7e7[_0xb79b('0x37')],_0x57524e['id'])});}})[_0xb79b('0x76')](function(_0x188c70){logger[_0xb79b('0x77')](_0xb79b('0x72'),JSON['stringify'](_0x188c70));});};exports[_0xb79b('0x78')]=function(_0x350ea2,_0x3f0afa,_0x168f00,_0x277f9d,_0x52c363,_0xd84941,_0x161daf){var _0x4da46c,_0x6ccdb3;_0xd84941[_0xb79b('0x37')]=intUtil[_0xb79b('0x68')](_0xd84941['host']);_0xd84941[_0xb79b('0x67')]=intUtil['stripTrailingSlash'](_0xd84941[_0xb79b('0x67')]);if(_0x161daf&&_0x161daf['recordingFormat']&&_0x161daf[_0xb79b('0x79')]!==_0xb79b('0x7a')){logger['info'](_0xb79b('0x7b'),_0xb79b('0x69'));_0x3f0afa[_0xb79b('0x6b')]=util['format'](_0xb79b('0x7c'),_0xd84941[_0xb79b('0x67')],_0x3f0afa[_0xb79b('0x6a')],md5(_0x3f0afa[_0xb79b('0x6a')]));}return getUser(_0xd84941,_0x277f9d['email'])[_0xb79b('0x30')](function(_0x48ac3b){_0x4da46c=_0x48ac3b;logger[_0xb79b('0xc')](_0xb79b('0x7d'),_0x4da46c['id']);return getEndUser(_0xd84941,_0x3f0afa[_0xb79b('0x7e')],_0x3f0afa[_0xb79b('0x7f')]);})[_0xb79b('0x30')](function(_0x53592b){_0x6ccdb3=_0x53592b;logger[_0xb79b('0xc')](_0xb79b('0x6f'),_0x6ccdb3[_0xb79b('0x25')]||_0x6ccdb3[_0xb79b('0x26')]);return getCall(_0xd84941,_0x4da46c,_0x6ccdb3,_0x168f00,_0x3f0afa,'Outbound');})[_0xb79b('0x30')](function(_0x1ac157){if(_0x1ac157){logger[_0xb79b('0xc')](_0xb79b('0x71'),_0x1ac157['id']);logger[_0xb79b('0xc')](_0xb79b('0x7b'),_0xb79b('0x73'));emit(util['format'](_0xb79b('0x80'),_0x277f9d[_0xb79b('0x63')]),_0xb79b('0x74'),{'uri':util['format'](_0xb79b('0x75'),_0xd84941[_0xb79b('0x37')],_0x1ac157['id'])});}})[_0xb79b('0x76')](function(_0x4711f3){logger[_0xb79b('0x77')](_0xb79b('0x7b'),JSON[_0xb79b('0x45')](_0x4711f3));});};exports[_0xb79b('0x1b')]=function(_0x59033f,_0x523691,_0x4560c4,_0x576dcb,_0x25fc5d,_0x4bab37){var _0x2221e1,_0xcae95c;_0x4bab37[_0xb79b('0x37')]=intUtil[_0xb79b('0x68')](_0x4bab37[_0xb79b('0x37')]);_0x4bab37[_0xb79b('0x67')]=intUtil[_0xb79b('0x68')](_0x4bab37['serverUrl']);if(_0x25fc5d&&_0x25fc5d['monitor_format']){logger[_0xb79b('0xc')](_0xb79b('0x81'),_0xb79b('0x69'));_0x523691[_0xb79b('0x6b')]=util['format'](_0xb79b('0x7c'),_0x4bab37['serverUrl'],_0x523691['uniqueid'],md5(_0x523691[_0xb79b('0x6a')]));}else{_0x523691[_0xb79b('0x6b')]='';}return getUser(_0x4bab37)[_0xb79b('0x30')](function(_0x46d980){_0x2221e1=_0x46d980;logger['info'](_0xb79b('0x7d'),_0x2221e1['id']);return getEndUser(_0x4bab37,_0x523691[_0xb79b('0x6d')],_0x523691[_0xb79b('0x6e')]);})['then'](function(_0x2cb8f9){_0xcae95c=_0x2cb8f9;logger[_0xb79b('0xc')](_0xb79b('0x6f'),_0xcae95c[_0xb79b('0x25')]||_0xcae95c[_0xb79b('0x26')]);return getCall(_0x4bab37,_0x2221e1,_0xcae95c,_0x4560c4,_0x523691,_0xb79b('0x70'));})[_0xb79b('0x30')](function(_0x5795aa){if(_0x5795aa){logger[_0xb79b('0xc')](_0xb79b('0x71'),_0x5795aa['id']);}})['catch'](function(_0x4dc026){logger[_0xb79b('0x77')](_0xb79b('0x81'),JSON['stringify'](_0x4dc026));});};
\ No newline at end of file
+var _0x04ef=['((Phone:%s))','then','Enduser\x20found\x20in\x20Contacts!','Contacts','row','val','content','GET','length','https://crm.%s/crm/private/xml/Leads/insertRecords','%s %s %s |
','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','[HTTP]','forEach','type','string','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','[ABANDONED]','Inbound','md5','util','./util','xml2json','moment','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20call...','merge','starttime','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','Fields','Called','Call\x20Result','Answered','rejected','Rejected','abandoned','Abandoned','talktime','utc','mm:ss','answertime','endtime','Call\x20Duration','diff','CONTACTID','LEADID','SEMODULE','Leads','SEID','hasOwnProperty','%s ','encodeXML','','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','host','crmapi','parse','toJson','response','result','recorddetail','Error\x20on\x20call\x20creation:\x20','stringify','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','authToken','users','user','log','zoho\x20data\x20users','isArrayLikeObject','active','Using\x20the\x20admin\x20account!','find','Administrator','zoho\x20user','profile','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0x04ef,0xb7));var _0xf04e=function(_0x57a0d9,_0x211caa){_0x57a0d9=_0x57a0d9-0x0;var _0x45e86e=_0x04ef[_0x57a0d9];return _0x45e86e;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xf04e('0x0'));var util=require(_0xf04e('0x1'));var intUtil=require(_0xf04e('0x2'));var parser=require(_0xf04e('0x3'));var entities=require('entities');var moment=require(_0xf04e('0x4'));var Redis=require('ioredis');var config=require(_0xf04e('0x5'));var logger=require(_0xf04e('0x6'))(_0xf04e('0x7'));config[_0xf04e('0x8')]=_[_0xf04e('0x9')](config[_0xf04e('0x8')],{'host':_0xf04e('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf04e('0x8')]));function emit(_0x475797,_0x42f505,_0x321a17){io['to'](_0x475797)[_0xf04e('0xb')](_0x42f505,_0x321a17);}var headers={'Content-Type':_0xf04e('0xc'),'Accept':_0xf04e('0xc')};function getCall(_0x3c346c,_0x406585,_0x453493,_0x185e1c,_0x5d388f,_0x59301f){logger[_0xf04e('0xd')](_0xf04e('0xe'));var _0x3f7c25=_[_0xf04e('0xf')]({'SMOWNERID':_0x406585['id'],'Call Type':_0x59301f||'inbound','Call Start Time':(_0x59301f==='outbound'?_0x5d388f[_0xf04e('0x10')]:_0x5d388f['agentcalledAt'])||moment()[_0xf04e('0x11')](_0xf04e('0x12')),'Subject':intUtil[_0xf04e('0x13')](_0x185e1c[_0xf04e('0x14')],_0x5d388f,'\x20'),'Description':intUtil[_0xf04e('0x13')](_0x185e1c[_0xf04e('0x15')],_0x5d388f,'\x0a')},getCustomFields(_0x185e1c[_0xf04e('0x16')],_0x5d388f));switch(_0x5d388f['lastevent']){case'called':_0x3f7c25['Call\x20Result']=_0xf04e('0x17');break;case'complete':case'connect':_0x3f7c25[_0xf04e('0x18')]=_0xf04e('0x19');break;case _0xf04e('0x1a'):_0x3f7c25[_0xf04e('0x18')]=_0xf04e('0x1b');break;case _0xf04e('0x1c'):_0x3f7c25[_0xf04e('0x18')]=_0xf04e('0x1d');break;default:}if(_0x5d388f[_0xf04e('0x1e')]){_0x3f7c25['Call\x20Duration']=moment[_0xf04e('0x1f')](parseInt(_0x5d388f['talktime'])*0x3e8)[_0xf04e('0x11')](_0xf04e('0x20'));}else if(_0x5d388f[_0xf04e('0x21')]&&_0x5d388f[_0xf04e('0x22')]){_0x3f7c25[_0xf04e('0x23')]=moment['utc'](moment(_0x5d388f['endtime'],_0xf04e('0x12'))[_0xf04e('0x24')](moment(_0x5d388f[_0xf04e('0x10')],'YYYY-MM-DD\x20HH:mm:ss')))[_0xf04e('0x11')](_0xf04e('0x20'));}if(_0x453493[_0xf04e('0x25')]){_0x3f7c25[_0xf04e('0x25')]=_0x453493[_0xf04e('0x25')];}else if(_0x453493[_0xf04e('0x26')]){_0x3f7c25[_0xf04e('0x27')]=_0xf04e('0x28');_0x3f7c25[_0xf04e('0x29')]=_0x453493[_0xf04e('0x26')];}var _0x2b64f7='';for(var _0x31f6b8 in _0x3f7c25){if(_0x3f7c25[_0xf04e('0x2a')](_0x31f6b8)){_0x2b64f7+=util[_0xf04e('0x11')](_0xf04e('0x2b'),entities[_0xf04e('0x2c')](_0x31f6b8),entities[_0xf04e('0x2c')](_0x3f7c25[_0x31f6b8]));}}_0x2b64f7+=_0xf04e('0x2d');return request({'method':_0xf04e('0x2e'),'uri':util['format'](_0xf04e('0x2f'),_0x3c346c[_0xf04e('0x30')]),'qs':{'authtoken':_0x3c346c['authToken'],'scope':_0xf04e('0x31'),'xmlData':_0x2b64f7},'json':!![]})['then'](function(_0x42eaea){_0x42eaea=JSON[_0xf04e('0x32')](parser[_0xf04e('0x33')](_0x42eaea));if(_0x42eaea[_0xf04e('0x34')]){if(_0x42eaea['response'][_0xf04e('0x35')]&&_0x42eaea[_0xf04e('0x34')][_0xf04e('0x35')]['recorddetail']){logger[_0xf04e('0xd')]('Call\x20created!');return{'id':_0x42eaea[_0xf04e('0x34')][_0xf04e('0x35')][_0xf04e('0x36')]['FL'][0x0]['$t']};}}throw new Error(_0xf04e('0x37')+JSON[_0xf04e('0x38')](_0x42eaea));});}function getUser(_0x49a7e6,_0x495e2c){return request({'method':'GET','uri':util[_0xf04e('0x11')](_0xf04e('0x39'),_0x49a7e6['host']),'qs':{'type':_0xf04e('0x3a'),'authtoken':_0x49a7e6[_0xf04e('0x3b')],'scope':_0xf04e('0x31')},'json':!![]})['then'](function(_0x483984){if(_0x483984['users']&&_0x483984[_0xf04e('0x3c')][_0xf04e('0x3d')]){var _0x2301f3;console[_0xf04e('0x3e')](_0xf04e('0x3f'),_0x483984[_0xf04e('0x3c')][_0xf04e('0x3d')]);if(_[_0xf04e('0x40')](_0x483984[_0xf04e('0x3c')][_0xf04e('0x3d')])){console[_0xf04e('0x3e')](_0xf04e('0x3f'),_0x483984[_0xf04e('0x3c')]['user']);if(!_['isNil'](_0x495e2c)){_0x2301f3=_['find'](_0x483984[_0xf04e('0x3c')][_0xf04e('0x3d')],{'email':_0x495e2c,'profile':'Standard','status':_0xf04e('0x41')});}if(!_['isNil'](_0x2301f3)){logger['info']('Agent\x20found!');}else{logger[_0xf04e('0xd')](_0xf04e('0x42'));_0x2301f3=_[_0xf04e('0x43')](_0x483984['users']['user'],{'profile':_0xf04e('0x44')});}console[_0xf04e('0x3e')](_0xf04e('0x45'),_0x2301f3);return _0x2301f3;}else{if(_0x483984[_0xf04e('0x3c')][_0xf04e('0x3d')][_0xf04e('0x46')]==='Administrator'){logger[_0xf04e('0xd')](_0xf04e('0x42'));_0x2301f3=_0x483984[_0xf04e('0x3c')][_0xf04e('0x3d')];return _0x2301f3;}else{logger[_0xf04e('0x47')](_0xf04e('0x48'),JSON['stringify'](_0x483984));throw new Error(_0xf04e('0x49')+JSON[_0xf04e('0x38')](_0x483984));}}}else{logger[_0xf04e('0x47')](_0xf04e('0x48'),JSON['stringify'](_0x483984));throw new Error(_0xf04e('0x49')+JSON[_0xf04e('0x38')](_0x483984));}});}function getEndUser(_0x4181fd,_0x1f20c4,_0x5401c3){logger[_0xf04e('0xd')](_0xf04e('0x4a'),_0x5401c3);return request({'method':'GET','uri':util[_0xf04e('0x11')]('https://crm.%s/crm/private/json/Contacts/searchRecords',_0x4181fd['host']),'qs':{'authtoken':_0x4181fd[_0xf04e('0x3b')],'scope':_0xf04e('0x31'),'criteria':util['format'](_0xf04e('0x4b'),_0x5401c3)},'json':!![]})[_0xf04e('0x4c')](function(_0x496906){if(_0x496906[_0xf04e('0x34')]&&_0x496906[_0xf04e('0x34')][_0xf04e('0x35')]){logger['info'](_0xf04e('0x4d'));var _0x5f64fd={};var _0xba372f=_0x496906[_0xf04e('0x34')][_0xf04e('0x35')][_0xf04e('0x4e')][_0xf04e('0x4f')]['no']?_0x496906[_0xf04e('0x34')]['result'][_0xf04e('0x4e')]['row']['FL']:_0x496906[_0xf04e('0x34')][_0xf04e('0x35')]['Contacts'][_0xf04e('0x4f')][0x0]['FL'];for(var _0x261404=0x0,_0x2a6aa4=_0xba372f['length'];_0x261404<_0x2a6aa4;_0x261404++){_0x5f64fd[_0xba372f[_0x261404][_0xf04e('0x50')]]=_0xba372f[_0x261404][_0xf04e('0x51')];}return _0x5f64fd;}else{return request({'method':_0xf04e('0x52'),'uri':util[_0xf04e('0x11')]('https://crm.%s/crm/private/json/Leads/searchRecords',_0x4181fd[_0xf04e('0x30')]),'qs':{'authtoken':_0x4181fd[_0xf04e('0x3b')],'scope':_0xf04e('0x31'),'criteria':util['format'](_0xf04e('0x4b'),_0x5401c3)},'json':!![]})['then'](function(_0x3d7f49){if(_0x3d7f49[_0xf04e('0x34')]&&_0x3d7f49[_0xf04e('0x34')]['result']){logger[_0xf04e('0xd')]('Enduser\x20found\x20in\x20Leads!');var _0x24f84a={};var _0x35c344=_0x3d7f49['response']['result'][_0xf04e('0x28')][_0xf04e('0x4f')]['no']?_0x3d7f49['response'][_0xf04e('0x35')][_0xf04e('0x28')]['row']['FL']:_0x3d7f49[_0xf04e('0x34')][_0xf04e('0x35')]['Leads'][_0xf04e('0x4f')][0x0]['FL'];for(var _0x4db13c=0x0,_0x14cfb5=_0x35c344[_0xf04e('0x53')];_0x4db13c<_0x14cfb5;_0x4db13c++){_0x24f84a[_0x35c344[_0x4db13c]['val']]=_0x35c344[_0x4db13c][_0xf04e('0x51')];}return _0x24f84a;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x1f20c4=getName(_0x1f20c4);return request({'method':_0xf04e('0x2e'),'uri':util[_0xf04e('0x11')](_0xf04e('0x54'),_0x4181fd['host']),'qs':{'authtoken':_0x4181fd[_0xf04e('0x3b')],'scope':'crmapi','xmlData':util['format'](_0xf04e('0x55'),entities[_0xf04e('0x2c')](_0x1f20c4[0x0]),entities[_0xf04e('0x2c')](_0x1f20c4[0x1]),_0x5401c3)},'json':!![]})[_0xf04e('0x4c')](function(_0x2c69cb){_0x2c69cb=JSON[_0xf04e('0x32')](parser[_0xf04e('0x33')](_0x2c69cb));if(_0x2c69cb[_0xf04e('0x34')]){if(_0x2c69cb[_0xf04e('0x34')][_0xf04e('0x35')]&&_0x2c69cb[_0xf04e('0x34')][_0xf04e('0x35')][_0xf04e('0x36')]){logger[_0xf04e('0xd')](_0xf04e('0x56'));return request({'method':'GET','uri':util[_0xf04e('0x11')](_0xf04e('0x57'),_0x4181fd[_0xf04e('0x30')]),'qs':{'authtoken':_0x4181fd[_0xf04e('0x3b')],'scope':_0xf04e('0x31'),'id':_0x2c69cb[_0xf04e('0x34')][_0xf04e('0x35')][_0xf04e('0x36')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0xf04e('0x58')+JSON[_0xf04e('0x38')](_0x2c69cb));})[_0xf04e('0x4c')](function(_0x14e033){if(_0x14e033[_0xf04e('0x34')]){if(_0x14e033[_0xf04e('0x34')][_0xf04e('0x35')]){var _0x964199={};for(var _0x57f863=0x0,_0x196a68=_0x14e033[_0xf04e('0x34')][_0xf04e('0x35')][_0xf04e('0x28')][_0xf04e('0x4f')]['FL']['length'];_0x57f863<_0x196a68;_0x57f863++){_0x964199[_0x14e033[_0xf04e('0x34')]['result']['Leads'][_0xf04e('0x4f')]['FL'][_0x57f863]['val']]=_0x14e033[_0xf04e('0x34')][_0xf04e('0x35')]['Leads'][_0xf04e('0x4f')]['FL'][_0x57f863]['content'];}return _0x964199;}}throw new Error(_0xf04e('0x59')+JSON[_0xf04e('0x38')](_0x14e033));});}});}});}function request(_0x249496){logger['debug'](_0xf04e('0x5a'),JSON[_0xf04e('0x38')](_0x249496));return rp(_0x249496);}function getCustomFields(_0x597d03,_0x238b7b){var _0x1421e8={};if(_0x597d03[_0xf04e('0x53')]>0x0){_[_0xf04e('0x5b')](_0x597d03,function(_0x26a71c){if(_0x26a71c[_0xf04e('0x5c')]===_0xf04e('0x5d')&&_0x26a71c[_0xf04e('0x5e')]){_0x1421e8[_0x26a71c['idField']]=_0x26a71c[_0xf04e('0x51')][_0xf04e('0x5f')]();}else if(_0x26a71c[_0xf04e('0x5c')]===_0xf04e('0x60')&&_0x26a71c[_0xf04e('0x61')]&&_0x26a71c[_0xf04e('0x5e')]&&_0x238b7b[_0x26a71c[_0xf04e('0x61')]]){_0x1421e8[_0x26a71c['idField']]=_0x238b7b[_0x26a71c[_0xf04e('0x61')]][_0xf04e('0x5f')]();}else if(_0x26a71c[_0xf04e('0x5c')]==='customVariable'&&_0x26a71c[_0xf04e('0x62')]&&_0x26a71c[_0xf04e('0x62')][_0xf04e('0x63')]&&_0x26a71c[_0xf04e('0x5e')]&&_0x238b7b[_0x26a71c[_0xf04e('0x62')][_0xf04e('0x63')][_0xf04e('0x64')]()]){_0x1421e8[_0x26a71c['idField']]=_0x238b7b[_0x26a71c[_0xf04e('0x62')][_0xf04e('0x63')][_0xf04e('0x64')]()][_0xf04e('0x5f')]();}});}return _0x1421e8;}function getName(_0x199497){if(_0x199497[_0xf04e('0x65')]('\x20')>0x0){var _0x108a47=_0x199497['split'](/ (.+)/);if(_0x108a47[0x1]){return _0x108a47;}}return[_0x199497,_0x199497];}exports['queue']=function(_0x3fdda1,_0x1078b0,_0x49c258,_0x42a3ac,_0x533cf1,_0x412a67){var _0x4ad486,_0x58c645;_0x412a67[_0xf04e('0x30')]=intUtil['stripTrailingSlash'](_0x412a67['host']);_0x412a67[_0xf04e('0x66')]=intUtil[_0xf04e('0x67')](_0x412a67[_0xf04e('0x66')]);if(_0x533cf1&&_0x533cf1[_0xf04e('0x68')]){logger[_0xf04e('0xd')](_0xf04e('0x69'),_0xf04e('0x6a'));_0x1078b0[_0xf04e('0x6b')]=util[_0xf04e('0x11')](_0xf04e('0x6c'),_0x412a67[_0xf04e('0x66')],_0x1078b0[_0xf04e('0x6d')],md5(_0x1078b0[_0xf04e('0x6d')]));}else{_0x1078b0['recordingURL']='';}return getUser(_0x412a67,_0x42a3ac[_0xf04e('0x6e')])['then'](function(_0x3cfc85){_0x4ad486=_0x3cfc85;logger[_0xf04e('0xd')](_0xf04e('0x6f'),_0x4ad486['id']);return getEndUser(_0x412a67,_0x1078b0['calleridname'],_0x1078b0[_0xf04e('0x70')]);})[_0xf04e('0x4c')](function(_0x5c1ab3){_0x58c645=_0x5c1ab3;logger[_0xf04e('0xd')]('The\x20Enduser\x20ID\x20is:',_0x58c645[_0xf04e('0x25')]||_0x58c645[_0xf04e('0x26')]);return getCall(_0x412a67,_0x4ad486,_0x58c645,_0x49c258,_0x1078b0,'Inbound');})['then'](function(_0x1ab731){if(_0x1ab731){logger[_0xf04e('0xd')]('The\x20Call\x20ID\x20is:',_0x1ab731['id']);logger['info'](_0xf04e('0x69'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf04e('0x11')]('user:%s',_0x42a3ac[_0xf04e('0x63')]),_0xf04e('0x71'),{'uri':util[_0xf04e('0x11')](_0xf04e('0x72'),_0x412a67[_0xf04e('0x30')],_0x1ab731['id'])});}})['catch'](function(_0x2134b7){logger[_0xf04e('0x47')](_0xf04e('0x69'),JSON['stringify'](_0x2134b7));});};exports[_0xf04e('0x73')]=function(_0x1eae31,_0x30dba7,_0x3e152c,_0x1507be,_0x303718,_0x36aa20,_0x4dbd00){var _0x34b6ff,_0x1c8500;_0x36aa20['host']=intUtil[_0xf04e('0x67')](_0x36aa20[_0xf04e('0x30')]);_0x36aa20[_0xf04e('0x66')]=intUtil[_0xf04e('0x67')](_0x36aa20[_0xf04e('0x66')]);if(_0x4dbd00&&_0x4dbd00['recordingFormat']&&_0x4dbd00[_0xf04e('0x74')]!==_0xf04e('0x75')){logger[_0xf04e('0xd')](_0xf04e('0x76'),'Recording\x20is\x20enabled!');_0x30dba7['recordingURL']=util[_0xf04e('0x11')](_0xf04e('0x6c'),_0x36aa20['serverUrl'],_0x30dba7[_0xf04e('0x6d')],md5(_0x30dba7['uniqueid']));}return getUser(_0x36aa20,_0x1507be[_0xf04e('0x6e')])['then'](function(_0x6ef519){_0x34b6ff=_0x6ef519;logger['info']('The\x20User\x20ID\x20is:',_0x34b6ff['id']);return getEndUser(_0x36aa20,_0x30dba7[_0xf04e('0x77')],_0x30dba7[_0xf04e('0x78')]);})[_0xf04e('0x4c')](function(_0x2de915){_0x1c8500=_0x2de915;logger[_0xf04e('0xd')](_0xf04e('0x79'),_0x1c8500['CONTACTID']||_0x1c8500['LEADID']);return getCall(_0x36aa20,_0x34b6ff,_0x1c8500,_0x3e152c,_0x30dba7,_0xf04e('0x7a'));})[_0xf04e('0x4c')](function(_0x1e3f30){if(_0x1e3f30){logger['info'](_0xf04e('0x7b'),_0x1e3f30['id']);logger['info'](_0xf04e('0x76'),_0xf04e('0x7c'));emit(util[_0xf04e('0x11')](_0xf04e('0x7d'),_0x1507be[_0xf04e('0x63')]),'trigger:browser:url',{'uri':util[_0xf04e('0x11')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x36aa20[_0xf04e('0x30')],_0x1e3f30['id'])});}})[_0xf04e('0x7e')](function(_0x541a8c){logger[_0xf04e('0x47')](_0xf04e('0x76'),JSON['stringify'](_0x541a8c));});};exports[_0xf04e('0x1c')]=function(_0x1a6fae,_0x15872c,_0x557500,_0x1ec8ac,_0x36d731,_0x936ad3){var _0x299b48,_0x348c97;_0x936ad3[_0xf04e('0x30')]=intUtil[_0xf04e('0x67')](_0x936ad3[_0xf04e('0x30')]);_0x936ad3[_0xf04e('0x66')]=intUtil[_0xf04e('0x67')](_0x936ad3[_0xf04e('0x66')]);if(_0x36d731&&_0x36d731[_0xf04e('0x68')]){logger[_0xf04e('0xd')](_0xf04e('0x7f'),_0xf04e('0x6a'));_0x15872c[_0xf04e('0x6b')]=util[_0xf04e('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x936ad3[_0xf04e('0x66')],_0x15872c['uniqueid'],md5(_0x15872c[_0xf04e('0x6d')]));}else{_0x15872c[_0xf04e('0x6b')]='';}return getUser(_0x936ad3)['then'](function(_0x38bbd7){_0x299b48=_0x38bbd7;logger[_0xf04e('0xd')](_0xf04e('0x6f'),_0x299b48['id']);return getEndUser(_0x936ad3,_0x15872c['calleridname'],_0x15872c[_0xf04e('0x70')]);})[_0xf04e('0x4c')](function(_0xdf827d){_0x348c97=_0xdf827d;logger['info'](_0xf04e('0x79'),_0x348c97[_0xf04e('0x25')]||_0x348c97[_0xf04e('0x26')]);return getCall(_0x936ad3,_0x299b48,_0x348c97,_0x557500,_0x15872c,_0xf04e('0x80'));})['then'](function(_0x1e96ef){if(_0x1e96ef){logger[_0xf04e('0xd')](_0xf04e('0x7b'),_0x1e96ef['id']);}})[_0xf04e('0x7e')](function(_0x55bce4){logger[_0xf04e('0x47')]('[ABANDONED]',JSON[_0xf04e('0x38')](_0x55bce4));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js
index 18968a3..d5335b9 100644
--- a/server/services/ami/trigger/script/index.js
+++ b/server/services/ami/trigger/script/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x301278,_0x19fe5e){var _0xa71b0=function(_0x32d666){while(--_0x32d666){_0x301278['push'](_0x301278['shift']());}};_0xa71b0(++_0x19fe5e);}(_0x7a54,0x106));var _0x47a5=function(_0x4497f9,_0x4e68e7){_0x4497f9=_0x4497f9-0x0;var _0x3afc68=_0x7a54[_0x4497f9];return _0x3afc68;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});};
\ No newline at end of file
+var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x41ab88,_0x2eb8b0){var _0x38e83d=function(_0x5106b0){while(--_0x5106b0){_0x41ab88['push'](_0x41ab88['shift']());}};_0x38e83d(++_0x2eb8b0);}(_0x7a54,0x106));var _0x47a5=function(_0x6a7243,_0x409bc2){_0x6a7243=_0x6a7243-0x0;var _0x3c12e9=_0x7a54[_0x6a7243];return _0x3c12e9;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js
index 6edd24a..3e12ff6 100644
--- a/server/services/ami/trigger/urlforward/index.js
+++ b/server/services/ami/trigger/urlforward/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ffc=['%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil','body','object','stringify','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','../../../../config/logger','exec','data1','toUpperCase','render','headers','data6','parse','error','stack','GET','PUT','data7','info'];(function(_0x26662e,_0x208144){var _0x1cb1b6=function(_0x52aae3){while(--_0x52aae3){_0x26662e['push'](_0x26662e['shift']());}};_0x1cb1b6(++_0x208144);}(_0x0ffc,0x9e));var _0xc0ff=function(_0x479464,_0x47e3ca){_0x479464=_0x479464-0x0;var _0x16005a=_0x0ffc[_0x479464];return _0x16005a;};'use strict';var rp=require('request-promise');var util=require(_0xc0ff('0x0'));var _=require(_0xc0ff('0x1'));var Mustache=require('mustache');var logger=require(_0xc0ff('0x2'))('trigger');exports[_0xc0ff('0x3')]=function(_0x114cd6,_0x145a1b){var _0x46319b,_0x2c6126;var _0x275e00={'method':_0x114cd6[_0xc0ff('0x4')][_0xc0ff('0x5')](),'uri':encodeURI(Mustache[_0xc0ff('0x6')](_0x114cd6['data2'],_0x145a1b)),'json':!![],'resolveWithFullResponse':!![]};try{_0x275e00[_0xc0ff('0x7')]=_0x114cd6[_0xc0ff('0x8')]?JSON[_0xc0ff('0x9')](Mustache[_0xc0ff('0x6')](_0x114cd6[_0xc0ff('0x8')],_0x145a1b)):{};}catch(_0x380604){logger[_0xc0ff('0xa')](_0x380604[_0xc0ff('0xb')]);}switch(_0x114cd6['data1']['toUpperCase']()){case _0xc0ff('0xc'):_0x275e00['qs']=_0x145a1b;break;case'POST':case _0xc0ff('0xd'):_0x46319b={};if(_0x114cd6[_0xc0ff('0xe')]){_0x46319b=Mustache[_0xc0ff('0x6')](_0x114cd6[_0xc0ff('0xe')],_0x145a1b);}else{_0x46319b=_0x145a1b;}_0x275e00['body']=JSON[_0xc0ff('0x9')](_0x46319b);break;}logger[_0xc0ff('0xf')](util['format'](_0xc0ff('0x10'),_0x114cd6['data1'],_0x114cd6['data2'],JSON['stringify'](_0x275e00)));rp(_0x275e00)[_0xc0ff('0x11')](function(_0xa91369){_0x46319b=!_[_0xc0ff('0x12')](_0x46319b)?',\x20request\x20body:\x20'+_0x46319b:'';_0x2c6126=typeof _0xa91369[_0xc0ff('0x13')]===_0xc0ff('0x14')?JSON[_0xc0ff('0x15')](_0xa91369[_0xc0ff('0x13')]):_0xa91369[_0xc0ff('0x13')];logger[_0xc0ff('0xf')](util[_0xc0ff('0x16')](_0xc0ff('0x17'),_0x114cd6[_0xc0ff('0x4')],_0x114cd6[_0xc0ff('0x18')],_0xa91369[_0xc0ff('0x19')],_0x2c6126));})['catch'](function(_0x21b852){logger['error'](util[_0xc0ff('0x16')](_0xc0ff('0x1a'),_0x114cd6[_0xc0ff('0x4')],_0x114cd6['data2'],_0x21b852[_0xc0ff('0x19')],_0x21b852[_0xc0ff('0x1b')],_0x21b852[_0xc0ff('0x1c')]));});};
\ No newline at end of file
+var _0xab95=['format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','util','lodash','../../../../config/logger','trigger','data1','render','data2','data6','parse','error','stack','toUpperCase','GET','data7','body','info'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xab95,0x1d5));var _0x5ab9=function(_0x34d18a,_0x4f624a){_0x34d18a=_0x34d18a-0x0;var _0x2f2c78=_0xab95[_0x34d18a];return _0x2f2c78;};'use strict';var rp=require(_0x5ab9('0x0'));var util=require(_0x5ab9('0x1'));var _=require(_0x5ab9('0x2'));var Mustache=require('mustache');var logger=require(_0x5ab9('0x3'))(_0x5ab9('0x4'));exports['exec']=function(_0x50b633,_0x1e988b){var _0x24e54f,_0x59ff8e;var _0x15c50d={'method':_0x50b633[_0x5ab9('0x5')]['toUpperCase'](),'uri':encodeURI(Mustache[_0x5ab9('0x6')](_0x50b633[_0x5ab9('0x7')],_0x1e988b)),'json':!![],'resolveWithFullResponse':!![]};try{_0x15c50d['headers']=_0x50b633[_0x5ab9('0x8')]?JSON[_0x5ab9('0x9')](Mustache[_0x5ab9('0x6')](_0x50b633['data6'],_0x1e988b)):{};}catch(_0x54ea1c){logger[_0x5ab9('0xa')](_0x54ea1c[_0x5ab9('0xb')]);}switch(_0x50b633[_0x5ab9('0x5')][_0x5ab9('0xc')]()){case _0x5ab9('0xd'):_0x15c50d['qs']=_0x1e988b;break;case'POST':case'PUT':_0x24e54f={};if(_0x50b633[_0x5ab9('0xe')]){_0x24e54f=Mustache[_0x5ab9('0x6')](_0x50b633['data7'],_0x1e988b);}else{_0x24e54f=_0x1e988b;}_0x15c50d[_0x5ab9('0xf')]=JSON['parse'](_0x24e54f);break;}logger[_0x5ab9('0x10')](util[_0x5ab9('0x11')](_0x5ab9('0x12'),_0x50b633[_0x5ab9('0x5')],_0x50b633[_0x5ab9('0x7')],JSON['stringify'](_0x15c50d)));rp(_0x15c50d)[_0x5ab9('0x13')](function(_0x161c4c){_0x24e54f=!_[_0x5ab9('0x14')](_0x24e54f)?',\x20request\x20body:\x20'+_0x24e54f:'';_0x59ff8e=typeof _0x161c4c[_0x5ab9('0xf')]==='object'?JSON['stringify'](_0x161c4c[_0x5ab9('0xf')]):_0x161c4c[_0x5ab9('0xf')];logger[_0x5ab9('0x10')](util[_0x5ab9('0x11')](_0x5ab9('0x15'),_0x50b633[_0x5ab9('0x5')],_0x50b633[_0x5ab9('0x7')],_0x161c4c['statusCode'],_0x59ff8e));})[_0x5ab9('0x16')](function(_0x274383){logger['error'](util[_0x5ab9('0x11')](_0x5ab9('0x17'),_0x50b633['data1'],_0x50b633[_0x5ab9('0x7')],_0x274383[_0x5ab9('0x18')],_0x274383[_0x5ab9('0x19')],_0x274383[_0x5ab9('0x1a')]));});};
\ No newline at end of file
diff --git a/server/services/email/client.js b/server/services/email/client.js
index 29df568..c81acc9 100644
--- a/server/services/email/client.js
+++ b/server/services/email/client.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3164=['request','then','debug','rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request'];(function(_0x332835,_0x4fb907){var _0x2a7fae=function(_0x2609d0){while(--_0x2609d0){_0x332835['push'](_0x332835['shift']());}};_0x2a7fae(++_0x4fb907);}(_0x3164,0x182));var _0x4316=function(_0x21bfab,_0x2fee48){_0x21bfab=_0x21bfab-0x0;var _0x4db318=_0x3164[_0x21bfab];return _0x4db318;};'use strict';var jayson=require(_0x4316('0x0'));var BPromise=require(_0x4316('0x1'));var logger=require(_0x4316('0x2'))(_0x4316('0x3'));var client=jayson[_0x4316('0x4')]['http']({'port':0x2329});client[_0x4316('0x5')]=function(_0x2355a6,_0x1235d9){return new BPromise(function(_0x56124c,_0x5ee7e6){return client[_0x4316('0x6')](_0x2355a6,_0x1235d9)[_0x4316('0x7')](function(_0xf88ba4){logger[_0x4316('0x8')](_0x4316('0x9'),_0x4316('0x3'),_0x2355a6,_0x1235d9,_0xf88ba4);if(_0xf88ba4[_0x4316('0xa')]){logger[_0x4316('0xa')](_0x4316('0x9'),_0x4316('0x3'),_0x2355a6,_0xf88ba4[_0x4316('0xa')][_0x4316('0xb')],_0x1235d9);return _0x5ee7e6(_0xf88ba4[_0x4316('0xa')][_0x4316('0xb')]);}else{return _0x56124c(_0xf88ba4['result']);}})[_0x4316('0xc')](function(_0x446361){logger[_0x4316('0xa')](_0x4316('0x9'),'routing',_0x2355a6,_0x446361,_0x1235d9);return _0x5ee7e6(_0x446361);});});};module[_0x4316('0xd')]=client;
\ No newline at end of file
+var _0x1f75=['http','Request','request','then','debug','rpc','error','message','result','catch','routing','exports','jayson/promise','bluebird','../../config/logger','client'];(function(_0x23fe87,_0x34c89f){var _0x5bf53a=function(_0x326023){while(--_0x326023){_0x23fe87['push'](_0x23fe87['shift']());}};_0x5bf53a(++_0x34c89f);}(_0x1f75,0x12c));var _0x51f7=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x1f75[_0x4fde08];return _0x12e725;};'use strict';var jayson=require(_0x51f7('0x0'));var BPromise=require(_0x51f7('0x1'));var logger=require(_0x51f7('0x2'))('routing');var client=jayson[_0x51f7('0x3')][_0x51f7('0x4')]({'port':0x2329});client[_0x51f7('0x5')]=function(_0x11265a,_0x3df27f){return new BPromise(function(_0x4e6fc,_0x205684){return client[_0x51f7('0x6')](_0x11265a,_0x3df27f)[_0x51f7('0x7')](function(_0x22fc29){logger[_0x51f7('0x8')](_0x51f7('0x9'),'routing',_0x11265a,_0x3df27f,_0x22fc29);if(_0x22fc29[_0x51f7('0xa')]){logger[_0x51f7('0xa')](_0x51f7('0x9'),'routing',_0x11265a,_0x22fc29['error'][_0x51f7('0xb')],_0x3df27f);return _0x205684(_0x22fc29[_0x51f7('0xa')]['message']);}else{return _0x4e6fc(_0x22fc29[_0x51f7('0xc')]);}})[_0x51f7('0xd')](function(_0x5f4a51){logger['error'](_0x51f7('0x9'),_0x51f7('0xe'),_0x11265a,_0x5f4a51,_0x3df27f);return _0x205684(_0x5f4a51);});});};module[_0x51f7('0xf')]=client;
\ No newline at end of file
diff --git a/server/services/email/index.js b/server/services/email/index.js
index 4cdd641..4f70455 100644
--- a/server/services/email/index.js
+++ b/server/services/email/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc8eb=['mailAccounts','listen','catch','./server','./realtime','./lib/email','resolve','then','initMailAccounts','refresh'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc8eb,0xcb));var _0xbc8e=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0xc8eb[_0x3ec333];return _0x15ccb8;};'use strict';var BPromise=require('bluebird');var server=require(_0xbc8e('0x0'));var Realtime=require(_0xbc8e('0x1'));var EmailChannel=require(_0xbc8e('0x2'));var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xbc8e('0x3')]()[_0xbc8e('0x4')](mailAccount['getMailAccounts']())[_0xbc8e('0x4')](realtime[_0xbc8e('0x5')]())[_0xbc8e('0x4')](function(){email[_0xbc8e('0x6')](realtime[_0xbc8e('0x7')]);return realtime;});}function main(){return server[_0xbc8e('0x8')](realtime,email)['then'](function(_0x5bbdbf){return initRealtime();})[_0xbc8e('0x4')](function(_0x316012){return setInterval(initRealtime,0x2710);})[_0xbc8e('0x9')](function(_0x581294){console['log'](_0x581294);});}main();
\ No newline at end of file
+var _0xcdc6=['./server','./realtime','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','listen'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xcdc6,0x88));var _0x6cdc=function(_0x34126c,_0x421784){_0x34126c=_0x34126c-0x0;var _0x160b20=_0xcdc6[_0x34126c];return _0x160b20;};'use strict';var BPromise=require('bluebird');var server=require(_0x6cdc('0x0'));var Realtime=require(_0x6cdc('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x6cdc('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x6cdc('0x3')]()[_0x6cdc('0x4')](mailAccount[_0x6cdc('0x5')]())[_0x6cdc('0x4')](realtime[_0x6cdc('0x6')]())['then'](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x6cdc('0x7')](realtime,email)['then'](function(_0x196462){return initRealtime();})[_0x6cdc('0x4')](function(_0x51108a){return setInterval(initRealtime,0x2710);})['catch'](function(_0x4c9844){console['log'](_0x4c9844);});}main();
\ No newline at end of file
diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js
index efd7db8..5d1584d 100644
--- a/server/services/email/lib/email.js
+++ b/server/services/email/lib/email.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['lastSync','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','box','bind','handleImapEnd','error','handleImapError','disabled','handleImapBox','connected','name','messages','handleImapEmail','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x54bcab,_0x562e4d){_0x54bcab=_0x54bcab-0x0;var _0xd0a7fc=_0x5f2f[_0x54bcab];return _0xd0a7fc;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var BPromise=require(_0xf5f2('0x2'));var md5=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var config=require(_0xf5f2('0x5'));var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));config['redis']=_['defaults'](config[_0xf5f2('0x8')],{'host':_0xf5f2('0x9'),'port':0x18eb});var io=require(_0xf5f2('0xa'))(new Redis(config[_0xf5f2('0x8')]));var EmailImap=require(_0xf5f2('0xb'));var EmailSmtp=require(_0xf5f2('0xc'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x466882){logger[_0xf5f2('0xd')](_0xf5f2('0xe'));this['mailAccounts']=_0x466882[_0xf5f2('0xf')];this[_0xf5f2('0x10')]={};this[_0xf5f2('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0xf5f2('0x12')]=function(_0x4ebbbe){var _0x53fb33=this[_0xf5f2('0xf')][_0x4ebbbe];var _0x151aba={'id':_0x53fb33['id'],'name':_0x53fb33['name'],'key':_0x53fb33[_0xf5f2('0x13')],'active':_0x53fb33[_0xf5f2('0x14')],'Imap':{'status':_0x53fb33[_0xf5f2('0x15')][_0xf5f2('0x16')],'messageStatus':_0x53fb33[_0xf5f2('0x15')][_0xf5f2('0x17')],'total':_0x53fb33['Imap'][_0xf5f2('0x18')]}};if(_[_0xf5f2('0x19')](md5Accounts[_0x4ebbbe])){md5Accounts[_0x4ebbbe]={};}var _0x269909=md5(JSON[_0xf5f2('0x1a')](_0x151aba));if(md5Accounts[_0x4ebbbe][_0xf5f2('0x3')]!==_0x269909){md5Accounts[_0x4ebbbe]['md5']=_0x269909;io[_0xf5f2('0x12')](_0xf5f2('0x1b'),_0x151aba);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x1d')]=function(_0x23e23a){for(var _0x3a9dbb in _0x23e23a){if(_0x23e23a[_0xf5f2('0x1e')](_0x3a9dbb)){if(_0x23e23a[_0x3a9dbb][_0xf5f2('0x15')]&&_0x23e23a[_0x3a9dbb][_0xf5f2('0x14')]){var _0x228ace=_0x23e23a[_0x3a9dbb][_0xf5f2('0x15')];if(!this[_0xf5f2('0x10')][_0xf5f2('0x1e')](_0x228ace['id'])){this[_0xf5f2('0x10')][_0x228ace['id']]=new EmailImap(_0x228ace,_0x23e23a[_0x3a9dbb][_0xf5f2('0x7')]);this[_0xf5f2('0x10')][_0x228ace['id']]['on'](_0xf5f2('0x1f'),this['handleImapBox'][_0xf5f2('0x20')](this,_0x3a9dbb));this[_0xf5f2('0x10')][_0x228ace['id']]['on']('email',this['handleImapEmail'][_0xf5f2('0x20')](this,_0x3a9dbb));this[_0xf5f2('0x10')][_0x228ace['id']]['on']('end',this[_0xf5f2('0x21')][_0xf5f2('0x20')](this,_0x3a9dbb));this[_0xf5f2('0x10')][_0x228ace['id']]['on'](_0xf5f2('0x22'),this[_0xf5f2('0x23')]['bind'](this,_0x3a9dbb));}}else{if(_[_0xf5f2('0x19')](this[_0xf5f2('0xf')][_0x3a9dbb][_0xf5f2('0x15')])){this[_0xf5f2('0xf')][_0x3a9dbb][_0xf5f2('0x15')]={};}this['mailAccounts'][_0x3a9dbb]['Imap'][_0xf5f2('0x16')]=_0xf5f2('0x24');this[_0xf5f2('0xf')][_0x3a9dbb][_0xf5f2('0x15')][_0xf5f2('0x17')]='';this[_0xf5f2('0x12')](_0x3a9dbb);}}}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x25')]=function(_0x294414,_0x4ab014){if(this[_0xf5f2('0xf')][_0x294414]){this[_0xf5f2('0xf')][_0x294414][_0xf5f2('0x15')][_0xf5f2('0x16')]=_0xf5f2('0x26');this[_0xf5f2('0xf')][_0x294414]['Imap']['messageStatus']=_0x4ab014[_0xf5f2('0x27')];if(_0x4ab014[_0xf5f2('0x28')]){this[_0xf5f2('0xf')][_0x294414]['Imap']['total']=_0x4ab014[_0xf5f2('0x28')][_0xf5f2('0x18')];}return this[_0xf5f2('0x12')](_0x294414);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x29')]=function(_0x54c0c8,_0x52e959){logger[_0xf5f2('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x52e959[_0xf5f2('0x2a')],_0x52e959['lastName'],_0x52e959[_0xf5f2('0x2b')],_0x54c0c8);if(this[_0xf5f2('0xf')][_0x54c0c8]){return mailAccount[_0xf5f2('0x2c')](_0x54c0c8,_0x52e959)[_0xf5f2('0x2d')](function(_0x256bd9){if(_0x256bd9){logger[_0xf5f2('0xd')](_0xf5f2('0x2e'));}})[_0xf5f2('0x2f')](function(_0x5ca917){logger[_0xf5f2('0x22')](_0xf5f2('0x30'),JSON[_0xf5f2('0x1a')](_0x5ca917));});}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x21')]=function(_0x27c0e7){if(this[_0xf5f2('0xf')][_0x27c0e7]&&this['mailAccounts'][_0x27c0e7][_0xf5f2('0x15')]){if(this[_0xf5f2('0x10')][this['mailAccounts'][_0x27c0e7][_0xf5f2('0x15')]['id']]){delete this['imapAccounts'][this[_0xf5f2('0xf')][_0x27c0e7][_0xf5f2('0x15')]['id']];}this[_0xf5f2('0xf')][_0x27c0e7][_0xf5f2('0x15')]['lastSync']=moment();this['emit'](_0x27c0e7);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x23')]=function(_0x20eb74,_0x4ec8fb){if(this[_0xf5f2('0xf')][_0x20eb74]){this['mailAccounts'][_0x20eb74][_0xf5f2('0x15')]['status']=_0xf5f2('0x22');this[_0xf5f2('0xf')][_0x20eb74]['Imap'][_0xf5f2('0x17')]=_0x4ec8fb;return this[_0xf5f2('0x12')](_0x20eb74);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x31')]=function(_0x542cd6,_0x5d2d82){return this[_0xf5f2('0x11')][_0xf5f2('0x32')](_0x542cd6,_0x5d2d82);};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x33')]=function(_0x2c7f65){var _0xe62b57=this;if(this[_0xf5f2('0xf')][_0x2c7f65['id']]){if(_['isNil'](this[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')])){this['mailAccounts'][_0x2c7f65['id']][_0xf5f2('0x34')]={};}this[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x35')]=moment();return new BPromise(function(_0xd10701,_0x3b6372){return _0xe62b57[_0xf5f2('0x11')][_0xf5f2('0x36')](_0x2c7f65)['then'](function(_0x31c3c){_0xe62b57[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')]['status']='verified';_0xe62b57['mailAccounts'][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x17')]='';_0xe62b57['emit'](_0x2c7f65['id']);_0xd10701(_0x31c3c);})[_0xf5f2('0x2f')](function(_0xeed03d){_0xe62b57[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x16')]=_0xf5f2('0x22');_0xe62b57[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x17')]=_0xeed03d;_0xe62b57[_0xf5f2('0x12')](_0x2c7f65['id']);_0x3b6372(_0xeed03d);});});}return this[_0xf5f2('0x11')][_0xf5f2('0x36')](_0x2c7f65);};module[_0xf5f2('0x37')]=EmailChannel;
\ No newline at end of file
+var _0xdbb1=['verifySmtp','Smtp','verify','then','verified','exports','lodash','ioredis','email','defaults','redis','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','Imap','status','messageStatus','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','active','bind','end','handleImapEnd','error','handleImapError','disabled','messages','total','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send'];(function(_0xfeb39,_0x1d20b7){var _0x167aa8=function(_0x54b506){while(--_0x54b506){_0xfeb39['push'](_0xfeb39['shift']());}};_0x167aa8(++_0x1d20b7);}(_0xdbb1,0x105));var _0x1dbb=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xdbb1[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x1dbb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x1dbb('0x1'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x1dbb('0x2'));config['redis']=_[_0x1dbb('0x3')](config[_0x1dbb('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1dbb('0x4')]));var EmailImap=require(_0x1dbb('0x5'));var EmailSmtp=require(_0x1dbb('0x6'));var mailAccount=require(_0x1dbb('0x7'));var md5Accounts={};function EmailChannel(_0x5e622c){logger[_0x1dbb('0x8')](_0x1dbb('0x9'));this['mailAccounts']=_0x5e622c[_0x1dbb('0xa')];this[_0x1dbb('0xb')]={};this[_0x1dbb('0xc')]=new EmailSmtp();}EmailChannel[_0x1dbb('0xd')][_0x1dbb('0xe')]=function(_0x183120){var _0x111841=this[_0x1dbb('0xa')][_0x183120];var _0x3e71bd={'id':_0x111841['id'],'name':_0x111841[_0x1dbb('0xf')],'key':_0x111841[_0x1dbb('0x10')],'active':_0x111841['active'],'Imap':{'status':_0x111841[_0x1dbb('0x11')][_0x1dbb('0x12')],'messageStatus':_0x111841[_0x1dbb('0x11')][_0x1dbb('0x13')],'total':_0x111841['Imap']['total']}};if(_[_0x1dbb('0x14')](md5Accounts[_0x183120])){md5Accounts[_0x183120]={};}var _0x175864=md5(JSON[_0x1dbb('0x15')](_0x3e71bd));if(md5Accounts[_0x183120][_0x1dbb('0x16')]!==_0x175864){md5Accounts[_0x183120][_0x1dbb('0x16')]=_0x175864;io['emit'](_0x1dbb('0x17'),_0x3e71bd);}};EmailChannel[_0x1dbb('0xd')][_0x1dbb('0x18')]=function(_0x5e1dce){for(var _0x5b6e42 in _0x5e1dce){if(_0x5e1dce[_0x1dbb('0x19')](_0x5b6e42)){if(_0x5e1dce[_0x5b6e42]['Imap']&&_0x5e1dce[_0x5b6e42][_0x1dbb('0x1a')]){var _0x376daa=_0x5e1dce[_0x5b6e42][_0x1dbb('0x11')];if(!this[_0x1dbb('0xb')][_0x1dbb('0x19')](_0x376daa['id'])){this[_0x1dbb('0xb')][_0x376daa['id']]=new EmailImap(_0x376daa,_0x5e1dce[_0x5b6e42][_0x1dbb('0x2')]);this[_0x1dbb('0xb')][_0x376daa['id']]['on']('box',this['handleImapBox']['bind'](this,_0x5b6e42));this[_0x1dbb('0xb')][_0x376daa['id']]['on'](_0x1dbb('0x2'),this['handleImapEmail'][_0x1dbb('0x1b')](this,_0x5b6e42));this[_0x1dbb('0xb')][_0x376daa['id']]['on'](_0x1dbb('0x1c'),this[_0x1dbb('0x1d')][_0x1dbb('0x1b')](this,_0x5b6e42));this[_0x1dbb('0xb')][_0x376daa['id']]['on'](_0x1dbb('0x1e'),this[_0x1dbb('0x1f')][_0x1dbb('0x1b')](this,_0x5b6e42));}}else{if(_[_0x1dbb('0x14')](this[_0x1dbb('0xa')][_0x5b6e42][_0x1dbb('0x11')])){this[_0x1dbb('0xa')][_0x5b6e42][_0x1dbb('0x11')]={};}this[_0x1dbb('0xa')][_0x5b6e42][_0x1dbb('0x11')][_0x1dbb('0x12')]=_0x1dbb('0x20');this[_0x1dbb('0xa')][_0x5b6e42]['Imap'][_0x1dbb('0x13')]='';this['emit'](_0x5b6e42);}}}};EmailChannel[_0x1dbb('0xd')]['handleImapBox']=function(_0x72cfed,_0x27fd18){if(this[_0x1dbb('0xa')][_0x72cfed]){this[_0x1dbb('0xa')][_0x72cfed][_0x1dbb('0x11')][_0x1dbb('0x12')]='connected';this[_0x1dbb('0xa')][_0x72cfed][_0x1dbb('0x11')][_0x1dbb('0x13')]=_0x27fd18['name'];if(_0x27fd18['messages']){this[_0x1dbb('0xa')][_0x72cfed]['Imap']['total']=_0x27fd18[_0x1dbb('0x21')][_0x1dbb('0x22')];}return this[_0x1dbb('0xe')](_0x72cfed);}};EmailChannel[_0x1dbb('0xd')][_0x1dbb('0x23')]=function(_0x154884,_0x15cc71){logger[_0x1dbb('0x8')](_0x1dbb('0x24'),_0x15cc71['firstName'],_0x15cc71['lastName'],_0x15cc71[_0x1dbb('0x25')],_0x154884);if(this[_0x1dbb('0xa')][_0x154884]){return mailAccount[_0x1dbb('0x26')](_0x154884,_0x15cc71)['then'](function(_0x48b9b8){if(_0x48b9b8){logger[_0x1dbb('0x8')](_0x1dbb('0x27'));}})[_0x1dbb('0x28')](function(_0x4a90db){logger['error'](_0x1dbb('0x29'),JSON[_0x1dbb('0x15')](_0x4a90db));});}};EmailChannel['prototype'][_0x1dbb('0x1d')]=function(_0x15d934){if(this[_0x1dbb('0xa')][_0x15d934]&&this[_0x1dbb('0xa')][_0x15d934]['Imap']){if(this[_0x1dbb('0xb')][this[_0x1dbb('0xa')][_0x15d934][_0x1dbb('0x11')]['id']]){delete this[_0x1dbb('0xb')][this[_0x1dbb('0xa')][_0x15d934][_0x1dbb('0x11')]['id']];}this['mailAccounts'][_0x15d934][_0x1dbb('0x11')][_0x1dbb('0x2a')]=moment();this['emit'](_0x15d934);}};EmailChannel[_0x1dbb('0xd')][_0x1dbb('0x1f')]=function(_0x22d9d6,_0xde3241){if(this[_0x1dbb('0xa')][_0x22d9d6]){this['mailAccounts'][_0x22d9d6][_0x1dbb('0x11')][_0x1dbb('0x12')]=_0x1dbb('0x1e');this[_0x1dbb('0xa')][_0x22d9d6][_0x1dbb('0x11')][_0x1dbb('0x13')]=_0xde3241;return this['emit'](_0x22d9d6);}};EmailChannel[_0x1dbb('0xd')][_0x1dbb('0x2b')]=function(_0x5191b8,_0xb5c6ae){return this[_0x1dbb('0xc')][_0x1dbb('0x2c')](_0x5191b8,_0xb5c6ae);};EmailChannel[_0x1dbb('0xd')][_0x1dbb('0x2d')]=function(_0x3bbf81){var _0xbce716=this;if(this[_0x1dbb('0xa')][_0x3bbf81['id']]){if(_[_0x1dbb('0x14')](this[_0x1dbb('0xa')][_0x3bbf81['id']][_0x1dbb('0x2e')])){this[_0x1dbb('0xa')][_0x3bbf81['id']][_0x1dbb('0x2e')]={};}this['mailAccounts'][_0x3bbf81['id']][_0x1dbb('0x2e')][_0x1dbb('0x2a')]=moment();return new BPromise(function(_0x114ae4,_0x2af34d){return _0xbce716[_0x1dbb('0xc')][_0x1dbb('0x2f')](_0x3bbf81)[_0x1dbb('0x30')](function(_0x23b461){_0xbce716[_0x1dbb('0xa')][_0x3bbf81['id']][_0x1dbb('0x2e')][_0x1dbb('0x12')]=_0x1dbb('0x31');_0xbce716[_0x1dbb('0xa')][_0x3bbf81['id']]['Smtp'][_0x1dbb('0x13')]='';_0xbce716[_0x1dbb('0xe')](_0x3bbf81['id']);_0x114ae4(_0x23b461);})[_0x1dbb('0x28')](function(_0x3c105c){_0xbce716['mailAccounts'][_0x3bbf81['id']][_0x1dbb('0x2e')][_0x1dbb('0x12')]=_0x1dbb('0x1e');_0xbce716[_0x1dbb('0xa')][_0x3bbf81['id']][_0x1dbb('0x2e')][_0x1dbb('0x13')]=_0x3c105c;_0xbce716[_0x1dbb('0xe')](_0x3bbf81['id']);_0x2af34d(_0x3c105c);});});}return this[_0x1dbb('0xc')]['verify'](_0x3bbf81);};module[_0x1dbb('0x32')]=EmailChannel;
\ No newline at end of file
diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js
index 93e2513..5e33aa1 100644
--- a/server/services/email/lib/imap.js
+++ b/server/services/email/lib/imap.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2697=['prototype','connTimeout','authTimeout','isNil','authentication','user','password','port','tls','autotls','required','getHost','anonymous@xcally.com','handleReady','openBox','handleOpenBox','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','error','handleFetchError','handleFetchMessage','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','handleFetchEnd','closeBox','emit','textCode','hasOwnProperty','upperFirst','exports','util','imap','lodash','randomstring','mailparser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','ready','bind','once','handleEnd','handleError','connect','inherits'];(function(_0x317b07,_0x5628b5){var _0x37f1f4=function(_0xccbd55){while(--_0xccbd55){_0x317b07['push'](_0x317b07['shift']());}};_0x37f1f4(++_0x5628b5);}(_0x2697,0x120));var _0x7269=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x2697[_0x57975f];return _0x4793b8;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x7269('0x0'));var Imap=require(_0x7269('0x1'));var _=require(_0x7269('0x2'));var rs=require(_0x7269('0x3'));var simpleParser=require(_0x7269('0x4'))['simpleParser'];var Iconv=require(_0x7269('0x5'))['Iconv'];var EventEmitter=require(_0x7269('0x6'))[_0x7269('0x7')];var utils=require(_0x7269('0x8'));var logger=require(_0x7269('0x9'))(_0x7269('0xa'));function EmailImap(_0x1e47e3,_0x20ddbf){this[_0x7269('0xb')]=_0x7269('0xc');this[_0x7269('0xd')]=this[_0x7269('0xe')](_0x1e47e3,_0x20ddbf);this['imap']=new Imap(this[_0x7269('0xd')]);this[_0x7269('0x1')]['once'](_0x7269('0xf'),this['handleReady'][_0x7269('0x10')](this));this['imap'][_0x7269('0x11')]('end',this[_0x7269('0x12')][_0x7269('0x10')](this));this[_0x7269('0x1')]['on']('error',this[_0x7269('0x13')][_0x7269('0x10')](this));this['imap'][_0x7269('0x14')]();}util[_0x7269('0x15')](EmailImap,EventEmitter);EmailImap[_0x7269('0x16')]['getAccount']=function(_0x2ba8ec,_0x4eeb9b){var _0x2d78a0={'connTimeout':_0x2ba8ec[_0x7269('0x17')]?_0x2ba8ec[_0x7269('0x17')]*0x3e8:0x2710,'authTimeout':_0x2ba8ec[_0x7269('0x18')]?_0x2ba8ec[_0x7269('0x18')]*0x3e8:0x1388};if(_[_0x7269('0x19')](_0x2ba8ec['service'])){if(_0x2ba8ec[_0x7269('0x1a')]){_0x2d78a0[_0x7269('0x1b')]=_0x2ba8ec[_0x7269('0x1b')];_0x2d78a0[_0x7269('0x1c')]=_0x2ba8ec['password'];}_0x2d78a0['host']=_0x2ba8ec['host'];_0x2d78a0[_0x7269('0x1d')]=_0x2ba8ec[_0x7269('0x1d')]||0x3e1;if(_0x2ba8ec[_0x7269('0x1e')]){_0x2d78a0[_0x7269('0x1e')]=!![];}else{_0x2d78a0[_0x7269('0x1e')]=![];_0x2d78a0[_0x7269('0x1f')]=_0x7269('0x20');}}else{_0x2d78a0['user']=_0x2ba8ec['user'];_0x2d78a0['password']=_0x2ba8ec[_0x7269('0x1c')];_0x2d78a0['host']=utils[_0x7269('0x21')](_0x2ba8ec['service']);_0x2d78a0[_0x7269('0x1d')]=0x3e1;_0x2d78a0[_0x7269('0x1e')]=!![];}_0x2d78a0['email']=_0x4eeb9b||_0x2ba8ec[_0x7269('0x1b')]||_0x7269('0x22');return _0x2d78a0;};EmailImap['prototype'][_0x7269('0x23')]=function(){this[_0x7269('0x1')][_0x7269('0x24')](this[_0x7269('0xb')],![],this['handleOpenBox'][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')][_0x7269('0x25')]=function(_0x2e6c02,_0x3392ec){if(_0x2e6c02){this[_0x7269('0x13')](_0x2e6c02,!![]);}else{this['emit'](_0x7269('0x26'),_0x3392ec);this[_0x7269('0x27')]();}};EmailImap[_0x7269('0x16')][_0x7269('0x28')]=function(_0x43f33d){if(_0x43f33d){this['handleError'](_0x43f33d,!![]);}else{this[_0x7269('0x1')][_0x7269('0x29')]();}};EmailImap['prototype'][_0x7269('0x27')]=function(){this['imap'][_0x7269('0x2a')]([_0x7269('0x2b')],this[_0x7269('0x2c')][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')]['handleReadUnseen']=function(_0x43e363,_0x12448b){if(_0x43e363){this[_0x7269('0x13')](_0x43e363,!![]);}else{if(_0x12448b[_0x7269('0x2d')]){try{var _0x4a213c=this[_0x7269('0x1')][_0x7269('0x2e')](_0x12448b,{'bodies':'','markSeen':!![]});_0x4a213c['on']('message',this['handleFetchMessage'][_0x7269('0x10')](this));_0x4a213c[_0x7269('0x11')](_0x7269('0x2f'),this[_0x7269('0x30')][_0x7269('0x10')](this));_0x4a213c[_0x7269('0x11')]('end',this['handleFetchEnd'][_0x7269('0x10')](this));}catch(_0x46e31d){logger['error'](_0x46e31d);}}else{this[_0x7269('0x1')]['closeBox'](!![],this[_0x7269('0x28')][_0x7269('0x10')](this));}}};EmailImap[_0x7269('0x16')][_0x7269('0x31')]=function(_0xb20df,_0x287452){_0xb20df['on'](_0x7269('0x32'),this['handleMessageBody'][_0x7269('0x10')](this));_0xb20df[_0x7269('0x11')]('attributes',this[_0x7269('0x33')][_0x7269('0x10')](this));_0xb20df[_0x7269('0x11')]('end',this[_0x7269('0x34')][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')][_0x7269('0x35')]=function(_0x487f25,_0x285274){simpleParser(_0x487f25,{'Iconv':Iconv},this[_0x7269('0x36')][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')][_0x7269('0x33')]=function(_0x53ccc5){};EmailImap[_0x7269('0x16')][_0x7269('0x34')]=function(){};EmailImap[_0x7269('0x16')]['handleSimpleParser']=function(_0x588b9d,_0x399efe){if(_0x588b9d){logger['error'](_0x588b9d);}else{var _0x2873fa=this;utils['parser'](this[_0x7269('0xd')],_0x399efe,function(_0x4d4a04){_0x2873fa['emit']('email',_0x4d4a04);});}};EmailImap[_0x7269('0x16')][_0x7269('0x37')]=function(){this[_0x7269('0x1')][_0x7269('0x38')](!![],this[_0x7269('0x28')][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')][_0x7269('0x30')]=function(_0x1f6ae5){this[_0x7269('0x13')](_0x1f6ae5);this[_0x7269('0x1')]['closeBox'](!![],this[_0x7269('0x28')][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')][_0x7269('0x12')]=function(){this[_0x7269('0x39')](_0x7269('0x29'));};EmailImap[_0x7269('0x16')][_0x7269('0x13')]=function(_0x5ebeb7,_0x5dc295){logger[_0x7269('0x2f')](_0x7269('0x13'),this['account']['email'],JSON['stringify'](_0x5ebeb7));var _0x451725='';if(_0x5ebeb7){if(_0x5ebeb7[_0x7269('0x3a')]){_0x451725=_0x5ebeb7['textCode'];}else{for(var _0x3ae2af in _0x5ebeb7){if(_0x5ebeb7[_0x7269('0x3b')](_0x3ae2af)){_0x451725+=_[_0x7269('0x3c')](_0x3ae2af)+':\x20'+_0x5ebeb7[_0x3ae2af]+'\x0a';}}}}if(_0x5dc295){this[_0x7269('0x1')][_0x7269('0x29')]();}else{this['emit']('error',_0x451725);this[_0x7269('0x39')](_0x7269('0x29'));}};module[_0x7269('0x3d')]=EmailImap;
\ No newline at end of file
+var _0xeae7=['lodash','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','handleReady','bind','end','handleEnd','handleError','connect','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','getHost','service','anonymous@xcally.com','prototype','openBox','handleOpenBox','emit','box','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','stringify','textCode','hasOwnProperty','exports','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xeae7,0xfb));var _0x7eae=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0xeae7[_0x4521e3];return _0x46a272;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x7eae('0x0'));var Imap=require('imap');var _=require(_0x7eae('0x1'));var rs=require('randomstring');var simpleParser=require(_0x7eae('0x2'))[_0x7eae('0x3')];var Iconv=require(_0x7eae('0x4'))[_0x7eae('0x5')];var EventEmitter=require(_0x7eae('0x6'))[_0x7eae('0x7')];var utils=require(_0x7eae('0x8'));var logger=require(_0x7eae('0x9'))(_0x7eae('0xa'));function EmailImap(_0x329cc7,_0x2ac021){this[_0x7eae('0xb')]=_0x7eae('0xc');this[_0x7eae('0xd')]=this[_0x7eae('0xe')](_0x329cc7,_0x2ac021);this[_0x7eae('0xf')]=new Imap(this[_0x7eae('0xd')]);this['imap'][_0x7eae('0x10')]('ready',this[_0x7eae('0x11')][_0x7eae('0x12')](this));this[_0x7eae('0xf')][_0x7eae('0x10')](_0x7eae('0x13'),this[_0x7eae('0x14')][_0x7eae('0x12')](this));this[_0x7eae('0xf')]['on']('error',this[_0x7eae('0x15')][_0x7eae('0x12')](this));this['imap'][_0x7eae('0x16')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x7eae('0xe')]=function(_0x2f9ddc,_0x35ecd8){var _0x5eccaf={'connTimeout':_0x2f9ddc[_0x7eae('0x17')]?_0x2f9ddc['connTimeout']*0x3e8:0x2710,'authTimeout':_0x2f9ddc[_0x7eae('0x18')]?_0x2f9ddc['authTimeout']*0x3e8:0x1388};if(_[_0x7eae('0x19')](_0x2f9ddc['service'])){if(_0x2f9ddc[_0x7eae('0x1a')]){_0x5eccaf[_0x7eae('0x1b')]=_0x2f9ddc[_0x7eae('0x1b')];_0x5eccaf[_0x7eae('0x1c')]=_0x2f9ddc[_0x7eae('0x1c')];}_0x5eccaf[_0x7eae('0x1d')]=_0x2f9ddc[_0x7eae('0x1d')];_0x5eccaf[_0x7eae('0x1e')]=_0x2f9ddc['port']||0x3e1;if(_0x2f9ddc[_0x7eae('0x1f')]){_0x5eccaf[_0x7eae('0x1f')]=!![];}else{_0x5eccaf['tls']=![];_0x5eccaf[_0x7eae('0x20')]=_0x7eae('0x21');}}else{_0x5eccaf[_0x7eae('0x1b')]=_0x2f9ddc[_0x7eae('0x1b')];_0x5eccaf['password']=_0x2f9ddc[_0x7eae('0x1c')];_0x5eccaf[_0x7eae('0x1d')]=utils[_0x7eae('0x22')](_0x2f9ddc[_0x7eae('0x23')]);_0x5eccaf[_0x7eae('0x1e')]=0x3e1;_0x5eccaf[_0x7eae('0x1f')]=!![];}_0x5eccaf[_0x7eae('0xa')]=_0x35ecd8||_0x2f9ddc[_0x7eae('0x1b')]||_0x7eae('0x24');return _0x5eccaf;};EmailImap[_0x7eae('0x25')]['handleReady']=function(){this[_0x7eae('0xf')][_0x7eae('0x26')](this[_0x7eae('0xb')],![],this[_0x7eae('0x27')]['bind'](this));};EmailImap[_0x7eae('0x25')][_0x7eae('0x27')]=function(_0xe29577,_0x3ad113){if(_0xe29577){this[_0x7eae('0x15')](_0xe29577,!![]);}else{this[_0x7eae('0x28')](_0x7eae('0x29'),_0x3ad113);this['readUnseen']();}};EmailImap[_0x7eae('0x25')]['handleCloseBox']=function(_0x19b326){if(_0x19b326){this['handleError'](_0x19b326,!![]);}else{this[_0x7eae('0xf')][_0x7eae('0x13')]();}};EmailImap[_0x7eae('0x25')]['readUnseen']=function(){this[_0x7eae('0xf')][_0x7eae('0x2a')]([_0x7eae('0x2b')],this[_0x7eae('0x2c')]['bind'](this));};EmailImap[_0x7eae('0x25')][_0x7eae('0x2c')]=function(_0x224c0d,_0x99a1b1){if(_0x224c0d){this[_0x7eae('0x15')](_0x224c0d,!![]);}else{if(_0x99a1b1['length']){try{var _0xb473d4=this[_0x7eae('0xf')][_0x7eae('0x2d')](_0x99a1b1,{'bodies':'','markSeen':!![]});_0xb473d4['on'](_0x7eae('0x2e'),this[_0x7eae('0x2f')][_0x7eae('0x12')](this));_0xb473d4[_0x7eae('0x10')](_0x7eae('0x30'),this[_0x7eae('0x31')][_0x7eae('0x12')](this));_0xb473d4['once'](_0x7eae('0x13'),this[_0x7eae('0x32')][_0x7eae('0x12')](this));}catch(_0xa52581){logger['error'](_0xa52581);}}else{this[_0x7eae('0xf')][_0x7eae('0x33')](!![],this[_0x7eae('0x34')][_0x7eae('0x12')](this));}}};EmailImap[_0x7eae('0x25')]['handleFetchMessage']=function(_0x132fa3,_0x55ea9e){_0x132fa3['on'](_0x7eae('0x35'),this['handleMessageBody']['bind'](this));_0x132fa3['once'](_0x7eae('0x36'),this[_0x7eae('0x37')][_0x7eae('0x12')](this));_0x132fa3[_0x7eae('0x10')]('end',this[_0x7eae('0x38')][_0x7eae('0x12')](this));};EmailImap['prototype'][_0x7eae('0x39')]=function(_0x434798,_0x111ad9){simpleParser(_0x434798,{'Iconv':Iconv},this[_0x7eae('0x3a')][_0x7eae('0x12')](this));};EmailImap[_0x7eae('0x25')][_0x7eae('0x37')]=function(_0x46b2bf){};EmailImap['prototype'][_0x7eae('0x38')]=function(){};EmailImap[_0x7eae('0x25')]['handleSimpleParser']=function(_0x15eff8,_0x24fecf){if(_0x15eff8){logger[_0x7eae('0x30')](_0x15eff8);}else{var _0x2564f6=this;utils['parser'](this[_0x7eae('0xd')],_0x24fecf,function(_0x18f11f){_0x2564f6['emit']('email',_0x18f11f);});}};EmailImap[_0x7eae('0x25')][_0x7eae('0x32')]=function(){this[_0x7eae('0xf')][_0x7eae('0x33')](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype']['handleFetchError']=function(_0x8abc3f){this[_0x7eae('0x15')](_0x8abc3f);this[_0x7eae('0xf')][_0x7eae('0x33')](!![],this[_0x7eae('0x34')]['bind'](this));};EmailImap[_0x7eae('0x25')][_0x7eae('0x14')]=function(){this['emit']('end');};EmailImap[_0x7eae('0x25')]['handleError']=function(_0x43bc35,_0x34c375){logger['error'](_0x7eae('0x15'),this[_0x7eae('0xd')][_0x7eae('0xa')],JSON[_0x7eae('0x3b')](_0x43bc35));var _0x4d7367='';if(_0x43bc35){if(_0x43bc35[_0x7eae('0x3c')]){_0x4d7367=_0x43bc35['textCode'];}else{for(var _0x555728 in _0x43bc35){if(_0x43bc35[_0x7eae('0x3d')](_0x555728)){_0x4d7367+=_['upperFirst'](_0x555728)+':\x20'+_0x43bc35[_0x555728]+'\x0a';}}}}if(_0x34c375){this['imap'][_0x7eae('0x13')]();}else{this[_0x7eae('0x28')](_0x7eae('0x30'),_0x4d7367);this[_0x7eae('0x28')]('end');}};module[_0x7eae('0x3e')]=EmailImap;
\ No newline at end of file
diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js
index 2c2d35e..c420952 100644
--- a/server/services/email/lib/smtp.js
+++ b/server/services/email/lib/smtp.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb3d0=['use','compile','sendMail','verify','createTransport','toString','exports','nodemailer','bluebird','send'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb3d0,0xa7));var _0x0b3d=function(_0x439e2e,_0x580431){_0x439e2e=_0x439e2e-0x0;var _0x118c49=_0xb3d0[_0x439e2e];return _0x118c49;};'use strict';var nodemailer=require(_0x0b3d('0x0'));var BPromise=require(_0x0b3d('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x0b3d('0x2')]=function(_0xf24e94,_0x43c751){return new BPromise(function(_0x39b6c5,_0x10994c){var _0x4c0175=nodemailer['createTransport'](_0xf24e94);_0x4c0175[_0x0b3d('0x3')](_0x0b3d('0x4'),inlineBase64());_0x4c0175[_0x0b3d('0x5')](_0x43c751,function(_0x5c6861,_0x57e3b1){if(_0x5c6861){_0x10994c(_0x5c6861['toString']());}else{_0x39b6c5(_0x57e3b1);}});});};EmailSmtp['prototype'][_0x0b3d('0x6')]=function(_0x4fa328){return new BPromise(function(_0x4eecd9,_0x4aabeb){var _0x139fc8=nodemailer[_0x0b3d('0x7')](_0x4fa328);_0x139fc8[_0x0b3d('0x6')](function(_0x4c3c85,_0x28ea97){if(_0x4c3c85){_0x4aabeb(_0x4c3c85[_0x0b3d('0x8')]());}else{if(_0x28ea97){_0x4eecd9(_0x28ea97);}else{_0x4aabeb('Not\x20verifired');}}});});};module[_0x0b3d('0x9')]=EmailSmtp;
\ No newline at end of file
+var _0x48cf=['nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer'];(function(_0x4da23a,_0x4bf405){var _0x12d91b=function(_0x5bbcdf){while(--_0x5bbcdf){_0x4da23a['push'](_0x4da23a['shift']());}};_0x12d91b(++_0x4bf405);}(_0x48cf,0xc5));var _0xf48c=function(_0x5ae677,_0x2c6e82){_0x5ae677=_0x5ae677-0x0;var _0x3a54e7=_0x48cf[_0x5ae677];return _0x3a54e7;};'use strict';var nodemailer=require(_0xf48c('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xf48c('0x1'));function EmailSmtp(){}EmailSmtp[_0xf48c('0x2')]['send']=function(_0x296fb2,_0x13d45f){return new BPromise(function(_0x398976,_0x6ba501){var _0x66a626=nodemailer[_0xf48c('0x3')](_0x296fb2);_0x66a626[_0xf48c('0x4')](_0xf48c('0x5'),inlineBase64());_0x66a626[_0xf48c('0x6')](_0x13d45f,function(_0x1860b3,_0x32243c){if(_0x1860b3){_0x6ba501(_0x1860b3[_0xf48c('0x7')]());}else{_0x398976(_0x32243c);}});});};EmailSmtp[_0xf48c('0x2')][_0xf48c('0x8')]=function(_0x68f096){return new BPromise(function(_0x5ce1b3,_0x2c72bc){var _0x1b8a44=nodemailer[_0xf48c('0x3')](_0x68f096);_0x1b8a44['verify'](function(_0x463da6,_0x47ee19){if(_0x463da6){_0x2c72bc(_0x463da6[_0xf48c('0x7')]());}else{if(_0x47ee19){_0x5ce1b3(_0x47ee19);}else{_0x2c72bc(_0xf48c('0x9'));}}});});};module[_0xf48c('0xa')]=EmailSmtp;
\ No newline at end of file
diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js
index 23e216d..d33ed3b 100644
--- a/server/services/email/lib/utils.js
+++ b/server/services/email/lib/utils.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdd72=['slice','join','Anonymous','split','pop','@xcally.com','test','html','replace','body','textAsHtml','Empty\x20message
','Attachments','push','Title','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','value','name','length'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xdd72,0xb4));var _0x2dd7=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0xdd72[_0x403115];return _0x596ef3;};'use strict';var _=require(_0x2dd7('0x0'));var moment=require(_0x2dd7('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x2dd7('0x2'));var util=require(_0x2dd7('0x3'));var tnef=require(_0x2dd7('0x4'));var logger=require(_0x2dd7('0x5'))(_0x2dd7('0x6'));var config=require(_0x2dd7('0x7'));function getAddress(_0x19d79b){var _0x47f7c0=_[_0x2dd7('0x8')](_0x19d79b['value']);return _0x47f7c0&&_0x47f7c0[_0x2dd7('0x9')]?_0x47f7c0[_0x2dd7('0x9')]:_0x2dd7('0xa')+random[_0x2dd7('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x48592a){var _0x42e173=_[_0x2dd7('0x8')](_0x48592a[_0x2dd7('0xc')]);if(_0x42e173&&_0x42e173[_0x2dd7('0xd')]){var _0x42eb61=_0x42e173[_0x2dd7('0xd')]['split'](/\s+/);return _0x42eb61[_0x2dd7('0xe')]?_0x42eb61[_0x2dd7('0xf')](0x0,-0x1)[_0x2dd7('0x10')]('\x20'):_0x42e173[_0x2dd7('0xd')];}return _0x2dd7('0x11');}function getLastName(_0x269984){var _0x274229=_[_0x2dd7('0x8')](_0x269984[_0x2dd7('0xc')]);if(_0x274229&&_0x274229[_0x2dd7('0xd')]){var _0x231079=_0x274229['name'][_0x2dd7('0x12')](/\s+/);return _0x231079[_0x2dd7('0xe')]>0x1?_0x231079[_0x2dd7('0x13')]():'';}return'';}function getMails(_0x436586,_0xd41ec0){var _0x1f2d65='';for(var _0x496860=0x0;_0x496860<_0xd41ec0['value']['length'];_0x496860+=0x1){if(_0xd41ec0['value'][_0x496860][_0x2dd7('0x9')]!==_0x436586){if(!_['isEmpty'](_0x1f2d65)){_0x1f2d65+=',';}_0x1f2d65+=_0xd41ec0[_0x2dd7('0xc')][_0x496860][_0x2dd7('0xd')]||_0xd41ec0[_0x2dd7('0xc')][_0x496860][_0x2dd7('0x9')]||'';_0x1f2d65+='\x20<';_0x1f2d65+=_0xd41ec0[_0x2dd7('0xc')][_0x496860][_0x2dd7('0x9')]?_0xd41ec0[_0x2dd7('0xc')][_0x496860][_0x2dd7('0x9')]:_0x2dd7('0xa')+random[_0x2dd7('0xb')](0x6)+_0x2dd7('0x14');_0x1f2d65+='>';}}return _0x1f2d65;}function parseEmail(_0xf1bf27,_0x1deccd,_0x545f1a){if(_0x1deccd['html']){var _0xf2d674=/